From 74626a59dcd604eb31c56297e0559cd0ab217743 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 5 Jan 2018 05:18:35 +0530 Subject: [PATCH 01/10] galsfaser section cms plugin extra padding fix --- ungleich_page/static/ungleich_page/css/agency.css | 13 ++++++++++++- .../templates/ungleich_page/glasfaser.html | 11 +++++------ .../glasfaser/section_text_glasfaser.html | 3 +-- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ungleich_page/static/ungleich_page/css/agency.css b/ungleich_page/static/ungleich_page/css/agency.css index 43a05898..011781e3 100755 --- a/ungleich_page/static/ungleich_page/css/agency.css +++ b/ungleich_page/static/ungleich_page/css/agency.css @@ -280,7 +280,7 @@ fieldset[disabled] .btn-xl.active { } .navbar-default .navbar-brand { - padding: 4px 8px 12px; + padding: 8px 8px; } .navbar-default.navbar-shrink .navbar-brand { padding: 6px 8px 10px; @@ -345,6 +345,7 @@ header .intro-text .intro-heading { section { padding: 75px 0; + border-bottom: 1px solid #f3f4f5; } @media(max-width:767px) { @@ -353,6 +354,16 @@ section { } } +section .section-heading-contain { + margin-bottom: 50px; +} + +@media(min-width:767px) { + section .section-heading-contain { + margin-bottom: 75px; + } +} + section h2.section-heading { margin-top: 0; margin-bottom: 15px; diff --git a/ungleich_page/templates/ungleich_page/glasfaser.html b/ungleich_page/templates/ungleich_page/glasfaser.html index 3d8fbb76..77338ac9 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser.html +++ b/ungleich_page/templates/ungleich_page/glasfaser.html @@ -83,7 +83,7 @@ -
+
@@ -96,13 +96,12 @@
-
+
-
+

Was ist es?

-

Bei diesem Angebot handelt es sich um einen Internetzugang für Firmenkunden.

@@ -114,7 +113,7 @@
-
+

Technische Details

Im Angebot enthalten sind

@@ -156,7 +155,7 @@
-
+

Wie funktioniert es?

So kommen Sie in wenigen einfachen Schritten zu Ihrem High-Speed-Internet

diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_text_glasfaser.html b/ungleich_page/templates/ungleich_page/glasfaser/section_text_glasfaser.html index d3d83dfc..06b0e26d 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_text_glasfaser.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_text_glasfaser.html @@ -1,9 +1,8 @@
-
+

{{instance.title}}

-

{{instance.description}}

From 3ef2aa4bfbd007721845c679cd572d717d0da28d Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 5 Jan 2018 18:31:24 +0530 Subject: [PATCH 02/10] removed unused header plugins --- ungleich_page/cms_plugins.py | 70 +------------------ .../migrations/0018_auto_20180105_1826.py | 64 +++++++++++++++++ ungleich_page/models.py | 53 -------------- 3 files changed, 67 insertions(+), 120 deletions(-) create mode 100644 ungleich_page/migrations/0018_auto_20180105_1826.py diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index fb40ea2b..47f296aa 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -3,11 +3,10 @@ from cms.plugin_pool import plugin_pool from .models import ( UngelichContactUsSection, UngelichTextSection, Service, ServiceItem, - About, AboutItem, SectionWithImage, UngleichServiceItem, UngleichHeader, - UngleichHeaderItem, UngleichProductItem, UngleichProduct, UngleichCustomer, - UngleichCustomerItem, UngleichHTMLOnly, UngleichSimpleHeader, + About, AboutItem, SectionWithImage, UngleichServiceItem, + UngleichProductItem, UngleichProduct, UngleichCustomer, + UngleichCustomerItem, UngleichHTMLOnly, UngleichHeaderWithBackgroundImageSlider, - UngleichHeaderWithBackgroundImageSliderItem, UngleichHeaderWithBackgroundVideoSliderItem, ) @@ -184,49 +183,6 @@ class UngleichServicesItemPlugin(CMSPluginBase): return context -@plugin_pool.register_plugin -class UngleichHeaderWithTextAndImagePlugin(CMSPluginBase): - name = "ungleich Header with Text and Image Plugin" - model = UngleichSimpleHeader - render_template = "ungleich_page/ungleich/header.html" - cache = False - - def render(self, context, instance, placeholder): - context['instance'] = instance - return context - - -@plugin_pool.register_plugin -class UngleichHeaderWithTextAndImageSliderPlugin(CMSPluginBase): - name = "ungleich Header with Text and Image Slider Plugin" - model = UngleichHeader - render_template = "ungleich_page/ungleich/header_with_slider.html" - cache = False - allow_children = True - child_classes = ['UngleichHeaderItemPlugin'] - - def render(self, context, instance, placeholder): - context['instance'] = instance - return context - - -@plugin_pool.register_plugin -class UngleichHeaderItemPlugin(CMSPluginBase): - name = "ungleich Header Item Plugin" - model = UngleichHeaderItem - render_template = "ungleich_page/ungleich/_header_item.html" - cache = False - require_parent = True - parent_classes = ['UngleichHeaderWithTextAndImageSliderPlugin'] - - def render(self, context, instance, placeholder): - context = super(UngleichHeaderItemPlugin, self).render( - context, instance, placeholder - ) - context['instance'] = instance - return context - - @plugin_pool.register_plugin class UngleichHeaderBackgroundImageAndTextSliderPlugin(CMSPluginBase): name = "ungleich Header with Background and Image Slider Plugin" @@ -237,7 +193,6 @@ class UngleichHeaderBackgroundImageAndTextSliderPlugin(CMSPluginBase): cache = False allow_children = True child_classes = [ - 'UngleichHeaderBackgroundImageAndTextItemPlugin', 'UngleichHeaderBackgroundVideoItemPlugin', ] @@ -263,25 +218,6 @@ class UngleichHeaderBackgroundVideoItemPlugin(CMSPluginBase): return context -@plugin_pool.register_plugin -class UngleichHeaderBackgroundImageAndTextItemPlugin(CMSPluginBase): - name = "ungleich Header with Background and Image and Text Item Plugin" - model = UngleichHeaderWithBackgroundImageSliderItem - render_template = ( - 'ungleich_page/ungleich/_header_with_background_image_slider_item.html' - ) - cache = False - require_parent = True - parent_classes = ['UngleichHeaderBackgroundImageAndTextSliderPlugin'] - - def render(self, context, instance, placeholder): - context = super( - UngleichHeaderBackgroundImageAndTextItemPlugin, self - ).render(context, instance, placeholder) - context['instance'] = instance - return context - - @plugin_pool.register_plugin class UngleichProductsPlugin(CMSPluginBase): name = "ungleich Products Plugin" diff --git a/ungleich_page/migrations/0018_auto_20180105_1826.py b/ungleich_page/migrations/0018_auto_20180105_1826.py new file mode 100644 index 00000000..b269fb04 --- /dev/null +++ b/ungleich_page/migrations/0018_auto_20180105_1826.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2018-01-05 12:56 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('cms', '0014_auto_20160404_1908'), + ('ungleich_page', '0017_auto_20171219_1856'), + ] + + operations = [ + migrations.RemoveField( + model_name='ungleichheader', + name='background_image', + ), + migrations.RemoveField( + model_name='ungleichheader', + name='cmsplugin_ptr', + ), + migrations.RemoveField( + model_name='ungleichheaderitem', + name='cmsplugin_ptr', + ), + migrations.RemoveField( + model_name='ungleichheaderitem', + name='image', + ), + migrations.RemoveField( + model_name='ungleichheaderwithbackgroundimageslideritem', + name='background_image', + ), + migrations.RemoveField( + model_name='ungleichheaderwithbackgroundimageslideritem', + name='cmsplugin_ptr', + ), + migrations.RemoveField( + model_name='ungleichsimpleheader', + name='background_image', + ), + migrations.RemoveField( + model_name='ungleichsimpleheader', + name='cmsplugin_ptr', + ), + migrations.RemoveField( + model_name='ungleichsimpleheader', + name='image', + ), + migrations.DeleteModel( + name='UngleichHeader', + ), + migrations.DeleteModel( + name='UngleichHeaderItem', + ), + migrations.DeleteModel( + name='UngleichHeaderWithBackgroundImageSliderItem', + ), + migrations.DeleteModel( + name='UngleichSimpleHeader', + ), + ] diff --git a/ungleich_page/models.py b/ungleich_page/models.py index ad44c161..b96afcb1 100644 --- a/ungleich_page/models.py +++ b/ungleich_page/models.py @@ -98,63 +98,10 @@ class UngleichServiceItem(ServiceItem): ) -class UngleichSimpleHeader(CMSPlugin): - background_image = FilerImageField( - null=True, - blank=True, - related_name="ungleich_simple_header_background_image", - on_delete=models.SET_NULL - ) - image = FilerImageField( - null=True, - blank=True, - related_name="ungleich_simple_header_image", - on_delete=models.SET_NULL - ) - text = HTMLField() - - -class UngleichHeader(CMSPlugin): - background_image = FilerImageField( - null=True, - blank=True, - related_name="ungleich_header_background_image", - on_delete=models.SET_NULL - ) - carousel_data_interval = models.IntegerField(default=5000) - - -class UngleichHeaderWithBackgroundImageSliderItem(CMSPlugin): - background_image = FilerImageField( - null=True, blank=True, - related_name="ungleich_header_slider_item_image", - on_delete=models.SET_NULL - ) - description = HTMLField( - default='
We Design, Configure & Maintain ' - '
Your Linux Infrastructure

' - 'Ruby on Rails, Django, Java, Webserver, Mailserver, any ' - 'infrastructure that needs to configured, we provide ' - 'comprehensive solutions. Amazon, rackspace or bare metal ' - 'servers, we configure for you.

Learn More

' - ) - - class UngleichHeaderWithBackgroundImageSlider(CMSPlugin): carousel_data_interval = models.IntegerField(default=2000) -class UngleichHeaderItem(CMSPlugin): - image = FilerImageField( - null=True, - blank=True, - related_name="ungleich_header_item_image", - on_delete=models.SET_NULL - ) - description = HTMLField() - - class UngleichHeaderWithBackgroundVideoSliderItem(CMSPlugin): image = FilerImageField( null=True, From 205274be42c72b60e2ea8f5f50f29a05383c7418 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sun, 7 Jan 2018 20:40:38 +0530 Subject: [PATCH 03/10] removed ununsed templates --- .../ungleich_page/ungleich/_header_item.html | 14 ------------- ...der_with_background_image_slider_item.html | 4 ---- .../ungleich_page/ungleich/header.html | 15 ------------- .../ungleich/header_with_slider.html | 21 ------------------- 4 files changed, 54 deletions(-) delete mode 100644 ungleich_page/templates/ungleich_page/ungleich/_header_item.html delete mode 100644 ungleich_page/templates/ungleich_page/ungleich/_header_with_background_image_slider_item.html delete mode 100644 ungleich_page/templates/ungleich_page/ungleich/header.html delete mode 100644 ungleich_page/templates/ungleich_page/ungleich/header_with_slider.html diff --git a/ungleich_page/templates/ungleich_page/ungleich/_header_item.html b/ungleich_page/templates/ungleich_page/ungleich/_header_item.html deleted file mode 100644 index a770d1ed..00000000 --- a/ungleich_page/templates/ungleich_page/ungleich/_header_item.html +++ /dev/null @@ -1,14 +0,0 @@ -
-
- {% if instance.image %} - -
- {% endif %} -
- - {{ instance.description }} - -
-
-
diff --git a/ungleich_page/templates/ungleich_page/ungleich/_header_with_background_image_slider_item.html b/ungleich_page/templates/ungleich_page/ungleich/_header_with_background_image_slider_item.html deleted file mode 100644 index 063a0a7b..00000000 --- a/ungleich_page/templates/ungleich_page/ungleich/_header_with_background_image_slider_item.html +++ /dev/null @@ -1,4 +0,0 @@ -
-
- {{ instance.description }} -
\ No newline at end of file diff --git a/ungleich_page/templates/ungleich_page/ungleich/header.html b/ungleich_page/templates/ungleich_page/ungleich/header.html deleted file mode 100644 index 77c7ffdf..00000000 --- a/ungleich_page/templates/ungleich_page/ungleich/header.html +++ /dev/null @@ -1,15 +0,0 @@ -{% load cms_tags %} - -
-
-
- -


-
- - {{ instance.text }} - -
-
-
-
diff --git a/ungleich_page/templates/ungleich_page/ungleich/header_with_slider.html b/ungleich_page/templates/ungleich_page/ungleich/header_with_slider.html deleted file mode 100644 index 9cf759e6..00000000 --- a/ungleich_page/templates/ungleich_page/ungleich/header_with_slider.html +++ /dev/null @@ -1,21 +0,0 @@ -{% load cms_tags %} -
- -
\ No newline at end of file From 1f8fe3cb005bfc5d52c7d6403430232940bd806d Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sun, 4 Feb 2018 19:33:47 +0530 Subject: [PATCH 04/10] section-heading margin issue fix --- ungleich_page/static/ungleich_page/css/agency.css | 10 ---------- ungleich_page/static/ungleich_page/css/glasfaser.css | 2 +- .../ungleich_page/glasfaser/section_about.html | 2 +- .../ungleich_page/glasfaser/section_services.html | 2 +- .../templates/ungleich_page/includes/_about.html | 2 +- .../templates/ungleich_page/includes/_portfolio.html | 2 +- .../templates/ungleich_page/includes/_services.html | 2 +- 7 files changed, 6 insertions(+), 16 deletions(-) diff --git a/ungleich_page/static/ungleich_page/css/agency.css b/ungleich_page/static/ungleich_page/css/agency.css index 011781e3..fd70ef75 100755 --- a/ungleich_page/static/ungleich_page/css/agency.css +++ b/ungleich_page/static/ungleich_page/css/agency.css @@ -209,11 +209,6 @@ fieldset[disabled] .btn-xl.active { border-color: rgba(255,255,255,.02); } -.navbar-default .navbar-toggle { - /*border-color: #fed136; - background-color: #fed136;*/ -} - .navbar-default .navbar-toggle .icon-bar { background-color: #fff; } @@ -372,7 +367,6 @@ section h2.section-heading { } section h3.section-subheading { - margin-bottom: 50px; text-transform: none; font-family: 'Raleway', "Helvetica Neue", "Open Sans", "Droid Serif", Helvetica, Arial, sans-serif; font-size: 16px; @@ -382,15 +376,11 @@ section h3.section-subheading { } @media(min-width:768px) { - section { - padding: 80px 0; - } section h2.section-heading { font-size: 40px; } section h3.section-subheading { font-size: 18px; - margin-bottom: 75px; } } diff --git a/ungleich_page/static/ungleich_page/css/glasfaser.css b/ungleich_page/static/ungleich_page/css/glasfaser.css index a6518611..5547ea0e 100644 --- a/ungleich_page/static/ungleich_page/css/glasfaser.css +++ b/ungleich_page/static/ungleich_page/css/glasfaser.css @@ -124,7 +124,7 @@ overflow: hidden; } .split-section.right { - padding: 100px 0; + /* padding: 100px 0; */ background: rgba(0,0,0,0.03); } .split-section.right .split-description { diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_about.html b/ungleich_page/templates/ungleich_page/glasfaser/section_about.html index 5e3f0410..f3fcffe7 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_about.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_about.html @@ -1,7 +1,7 @@ {% load cms_tags %}
-
+

{{ about_instance.title }}

{{ about_instance.sub_title }}

diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_services.html b/ungleich_page/templates/ungleich_page/glasfaser/section_services.html index 4f373653..c883cb11 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_services.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_services.html @@ -1,7 +1,7 @@ {% load static i18n cms_tags %}
-
+

{{ service_instance.title }}

{{ service_instance.sub_title }}

diff --git a/ungleich_page/templates/ungleich_page/includes/_about.html b/ungleich_page/templates/ungleich_page/includes/_about.html index ba6717fc..3333e7c9 100644 --- a/ungleich_page/templates/ungleich_page/includes/_about.html +++ b/ungleich_page/templates/ungleich_page/includes/_about.html @@ -2,7 +2,7 @@
-
+

{% trans "ABOUT" %}

{% trans "The timeline of ungleich" %}

diff --git a/ungleich_page/templates/ungleich_page/includes/_portfolio.html b/ungleich_page/templates/ungleich_page/includes/_portfolio.html index b30993be..75d35ef6 100644 --- a/ungleich_page/templates/ungleich_page/includes/_portfolio.html +++ b/ungleich_page/templates/ungleich_page/includes/_portfolio.html @@ -3,7 +3,7 @@
-
+

{% trans "Our Products" %}

{% blocktrans %}Our products include an innovative datacenter,
affordable VM hosting, and high speed fiber internet for canton Glarus.{% endblocktrans %}

diff --git a/ungleich_page/templates/ungleich_page/includes/_services.html b/ungleich_page/templates/ungleich_page/includes/_services.html index 3f2311f0..cee09db4 100644 --- a/ungleich_page/templates/ungleich_page/includes/_services.html +++ b/ungleich_page/templates/ungleich_page/includes/_services.html @@ -3,7 +3,7 @@
-
+

{% trans "our services" %}

{% trans "We support our clients in all areas of Unix infrastructure." %}
From 9f052986756c3e803dfa87c37502cf4b02279c45 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sun, 4 Feb 2018 19:56:11 +0530 Subject: [PATCH 05/10] margin reduced for grid items --- ungleich_page/static/ungleich_page/css/agency.css | 3 --- 1 file changed, 3 deletions(-) diff --git a/ungleich_page/static/ungleich_page/css/agency.css b/ungleich_page/static/ungleich_page/css/agency.css index fd70ef75..60985d06 100755 --- a/ungleich_page/static/ungleich_page/css/agency.css +++ b/ungleich_page/static/ungleich_page/css/agency.css @@ -700,9 +700,6 @@ section h3.section-subheading { } @media(min-width:768px) { - .team-member { - margin-bottom: 50px; - } .team-member h4 { margin-top: 20px; margin-bottom: 20px; From d73b0e2fdef2b44f872d298c0830a250a7dfddbb Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Mon, 5 Feb 2018 03:17:33 +0530 Subject: [PATCH 06/10] scale increased to 2 --- hosting/static/hosting/js/order.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hosting/static/hosting/js/order.js b/hosting/static/hosting/js/order.js index e9de4cf9..66c3b6b6 100644 --- a/hosting/static/hosting/js/order.js +++ b/hosting/static/hosting/js/order.js @@ -5,6 +5,9 @@ $(document).ready(function() { var fileName = $target.attr('id') + '.pdf'; html2pdf($target[0], { filename: fileName, + html2canvas: { + scale: 2 + } }); }); $('.btn-print').click(function(e) { From 95370c756282e51ffc52b8d7ed59881612d00bad Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Mon, 5 Feb 2018 03:26:33 +0530 Subject: [PATCH 07/10] Update Changelog --- Changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog b/Changelog index 097121b7..debfb974 100644 --- a/Changelog +++ b/Changelog @@ -2,6 +2,7 @@ Next: * #4049: [blog] Replace header background image * #3670: [hosting] Shorten ssh key name * #4046: [hosting] Add sdd_size, hdd_size to VirtualMachineSerializer (No visual change) + * bgfix: [hosting] increase invoice pdf resolution 1.3.2: 2018-01-16 * #4000: [all] Replace all ungleich.com with ungleich.ch * #4067: [ungleich] mobile navbar toggle fix From e93eda884542c3a70aecabd450abef7bb8e8e85d Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Wed, 7 Feb 2018 02:23:23 +0530 Subject: [PATCH 08/10] update html2canvas to fix bugs --- hosting/static/hosting/js/html2canvas.min.js | 6 +++++ hosting/static/hosting/js/html2pdf.js | 24 +++++++++++++------- hosting/templates/hosting/order_detail.html | 2 +- 3 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 hosting/static/hosting/js/html2canvas.min.js diff --git a/hosting/static/hosting/js/html2canvas.min.js b/hosting/static/hosting/js/html2canvas.min.js new file mode 100644 index 00000000..c537a308 --- /dev/null +++ b/hosting/static/hosting/js/html2canvas.min.js @@ -0,0 +1,6 @@ +/*! + * html2canvas 1.0.0-alpha.9 + * Copyright (c) 2018 Niklas von Hertzen + * Released under MIT License + */ +!function(A,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.html2canvas=e():A.html2canvas=e()}(this,function(){return function(A){var e={};function t(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return A[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}return t.m=A,t.c=e,t.d=function(A,e,r){t.o(A,e)||Object.defineProperty(A,e,{configurable:!1,enumerable:!0,get:r})},t.n=function(A){var e=A&&A.__esModule?function(){return A.default}:function(){return A};return t.d(e,"a",e),e},t.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},t.p="",t(t.s=27)}([function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){return function(A,e){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return function(A,e){var t=[],r=!0,n=!1,B=void 0;try{for(var a,s=A[Symbol.iterator]();!(r=(a=s.next()).done)&&(t.push(a.value),!e||t.length!==e);r=!0);}catch(A){n=!0,B=A}finally{try{!r&&s.return&&s.return()}finally{if(n)throw B}}return t}(A,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),n=function(){function A(A,e){for(var t=0;t4)&&[Number(e[1]),Number(e[2]),Number(e[3]),Number(e[4])]},Q=function(A){return[Math.min(A[0],255),Math.min(A[1],255),Math.min(A[2],255),A.length>3?A[3]:null]},w=function(A){var e=g[A.toLowerCase()];return e||!1},U=function(){function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A);var t=Array.isArray(e)?Q(e):a(e)||c(e)||u(e)||w(e)||o(e)||[0,0,0,null],n=r(t,4),B=n[0],s=n[1],i=n[2],l=n[3];this.r=B,this.g=s,this.b=i,this.a=l}return n(A,[{key:"isTransparent",value:function(){return 0===this.a}},{key:"toString",value:function(){return null!==this.a&&1!==this.a?"rgba("+this.r+","+this.g+","+this.b+","+this.a+")":"rgb("+this.r+","+this.g+","+this.b+")"}}]),A}();e.default=U;var g={transparent:[0,0,0,0],aliceblue:[240,248,255,null],antiquewhite:[250,235,215,null],aqua:[0,255,255,null],aquamarine:[127,255,212,null],azure:[240,255,255,null],beige:[245,245,220,null],bisque:[255,228,196,null],black:[0,0,0,null],blanchedalmond:[255,235,205,null],blue:[0,0,255,null],blueviolet:[138,43,226,null],brown:[165,42,42,null],burlywood:[222,184,135,null],cadetblue:[95,158,160,null],chartreuse:[127,255,0,null],chocolate:[210,105,30,null],coral:[255,127,80,null],cornflowerblue:[100,149,237,null],cornsilk:[255,248,220,null],crimson:[220,20,60,null],cyan:[0,255,255,null],darkblue:[0,0,139,null],darkcyan:[0,139,139,null],darkgoldenrod:[184,134,11,null],darkgray:[169,169,169,null],darkgreen:[0,100,0,null],darkgrey:[169,169,169,null],darkkhaki:[189,183,107,null],darkmagenta:[139,0,139,null],darkolivegreen:[85,107,47,null],darkorange:[255,140,0,null],darkorchid:[153,50,204,null],darkred:[139,0,0,null],darksalmon:[233,150,122,null],darkseagreen:[143,188,143,null],darkslateblue:[72,61,139,null],darkslategray:[47,79,79,null],darkslategrey:[47,79,79,null],darkturquoise:[0,206,209,null],darkviolet:[148,0,211,null],deeppink:[255,20,147,null],deepskyblue:[0,191,255,null],dimgray:[105,105,105,null],dimgrey:[105,105,105,null],dodgerblue:[30,144,255,null],firebrick:[178,34,34,null],floralwhite:[255,250,240,null],forestgreen:[34,139,34,null],fuchsia:[255,0,255,null],gainsboro:[220,220,220,null],ghostwhite:[248,248,255,null],gold:[255,215,0,null],goldenrod:[218,165,32,null],gray:[128,128,128,null],green:[0,128,0,null],greenyellow:[173,255,47,null],grey:[128,128,128,null],honeydew:[240,255,240,null],hotpink:[255,105,180,null],indianred:[205,92,92,null],indigo:[75,0,130,null],ivory:[255,255,240,null],khaki:[240,230,140,null],lavender:[230,230,250,null],lavenderblush:[255,240,245,null],lawngreen:[124,252,0,null],lemonchiffon:[255,250,205,null],lightblue:[173,216,230,null],lightcoral:[240,128,128,null],lightcyan:[224,255,255,null],lightgoldenrodyellow:[250,250,210,null],lightgray:[211,211,211,null],lightgreen:[144,238,144,null],lightgrey:[211,211,211,null],lightpink:[255,182,193,null],lightsalmon:[255,160,122,null],lightseagreen:[32,178,170,null],lightskyblue:[135,206,250,null],lightslategray:[119,136,153,null],lightslategrey:[119,136,153,null],lightsteelblue:[176,196,222,null],lightyellow:[255,255,224,null],lime:[0,255,0,null],limegreen:[50,205,50,null],linen:[250,240,230,null],magenta:[255,0,255,null],maroon:[128,0,0,null],mediumaquamarine:[102,205,170,null],mediumblue:[0,0,205,null],mediumorchid:[186,85,211,null],mediumpurple:[147,112,219,null],mediumseagreen:[60,179,113,null],mediumslateblue:[123,104,238,null],mediumspringgreen:[0,250,154,null],mediumturquoise:[72,209,204,null],mediumvioletred:[199,21,133,null],midnightblue:[25,25,112,null],mintcream:[245,255,250,null],mistyrose:[255,228,225,null],moccasin:[255,228,181,null],navajowhite:[255,222,173,null],navy:[0,0,128,null],oldlace:[253,245,230,null],olive:[128,128,0,null],olivedrab:[107,142,35,null],orange:[255,165,0,null],orangered:[255,69,0,null],orchid:[218,112,214,null],palegoldenrod:[238,232,170,null],palegreen:[152,251,152,null],paleturquoise:[175,238,238,null],palevioletred:[219,112,147,null],papayawhip:[255,239,213,null],peachpuff:[255,218,185,null],peru:[205,133,63,null],pink:[255,192,203,null],plum:[221,160,221,null],powderblue:[176,224,230,null],purple:[128,0,128,null],rebeccapurple:[102,51,153,null],red:[255,0,0,null],rosybrown:[188,143,143,null],royalblue:[65,105,225,null],saddlebrown:[139,69,19,null],salmon:[250,128,114,null],sandybrown:[244,164,96,null],seagreen:[46,139,87,null],seashell:[255,245,238,null],sienna:[160,82,45,null],silver:[192,192,192,null],skyblue:[135,206,235,null],slateblue:[106,90,205,null],slategray:[112,128,144,null],slategrey:[112,128,144,null],snow:[255,250,250,null],springgreen:[0,255,127,null],steelblue:[70,130,180,null],tan:[210,180,140,null],teal:[0,128,128,null],thistle:[216,191,216,null],tomato:[255,99,71,null],turquoise:[64,224,208,null],violet:[238,130,238,null],wheat:[245,222,179,null],white:[255,255,255,null],whitesmoke:[245,245,245,null],yellow:[255,255,0,null],yellowgreen:[154,205,50,null]};e.TRANSPARENT=new U([0,0,0,0])},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseBoundCurves=e.calculatePaddingBoxPath=e.calculateBorderBoxPath=e.parsePathForBorder=e.parseDocumentSize=e.calculateContentBox=e.calculatePaddingBox=e.parseBounds=e.Bounds=void 0;var r=function(){function A(A,e){for(var t=0;t1&&(r/=U,B/=U,a/=U,s/=U,o/=U,l/=U,u/=U,Q/=U);var g=A.width-a,C=A.height-l,d=A.width-o,F=A.height-Q;return{topLeftOuter:r>0||B>0?c(A.left,A.top,r,B,i.TOP_LEFT):new n.default(A.left,A.top),topLeftInner:r>0||B>0?c(A.left+e[3].borderWidth,A.top+e[0].borderWidth,Math.max(0,r-e[3].borderWidth),Math.max(0,B-e[0].borderWidth),i.TOP_LEFT):new n.default(A.left+e[3].borderWidth,A.top+e[0].borderWidth),topRightOuter:a>0||s>0?c(A.left+g,A.top,a,s,i.TOP_RIGHT):new n.default(A.left+A.width,A.top),topRightInner:a>0||s>0?c(A.left+Math.min(g,A.width+e[3].borderWidth),A.top+e[0].borderWidth,g>A.width+e[3].borderWidth?0:a-e[3].borderWidth,s-e[0].borderWidth,i.TOP_RIGHT):new n.default(A.left+A.width-e[1].borderWidth,A.top+e[0].borderWidth),bottomRightOuter:o>0||l>0?c(A.left+d,A.top+C,o,l,i.BOTTOM_RIGHT):new n.default(A.left+A.width,A.top+A.height),bottomRightInner:o>0||l>0?c(A.left+Math.min(d,A.width-e[3].borderWidth),A.top+Math.min(C,A.height+e[0].borderWidth),Math.max(0,o-e[1].borderWidth),l-e[2].borderWidth,i.BOTTOM_RIGHT):new n.default(A.left+A.width-e[1].borderWidth,A.top+A.height-e[2].borderWidth),bottomLeftOuter:u>0||Q>0?c(A.left,A.top+F,u,Q,i.BOTTOM_LEFT):new n.default(A.left,A.top+A.height),bottomLeftInner:u>0||Q>0?c(A.left+e[3].borderWidth,A.top+F,Math.max(0,u-e[3].borderWidth),Q-e[2].borderWidth,i.BOTTOM_LEFT):new n.default(A.left+e[3].borderWidth,A.top+A.height-e[2].borderWidth)}},{TOP_LEFT:0,TOP_RIGHT:1,BOTTOM_RIGHT:2,BOTTOM_LEFT:3}),c=function(A,e,t,r,a){var s=(Math.sqrt(2)-1)/3*4,o=t*s,c=r*s,l=A+t,u=e+r;switch(a){case i.TOP_LEFT:return new B.default(new n.default(A,u),new n.default(A,u-c),new n.default(l-o,e),new n.default(l,e));case i.TOP_RIGHT:return new B.default(new n.default(A,e),new n.default(A+o,e),new n.default(l,u-c),new n.default(l,u));case i.BOTTOM_RIGHT:return new B.default(new n.default(l,e),new n.default(l,e+c),new n.default(A+o,u),new n.default(A,u));case i.BOTTOM_LEFT:default:return new B.default(new n.default(l,u),new n.default(l-o,u),new n.default(A,e+c),new n.default(A,e))}}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.calculateLengthFromValueWithUnit=e.LENGTH_TYPE=void 0;var r,n=function(){function A(A,e){for(var t=0;t0&&this.style.visibility===I.VISIBILITY.VISIBLE}},{key:"isAbsolutelyPositioned",value:function(){return this.style.position!==f.POSITION.STATIC&&this.style.position!==f.POSITION.RELATIVE}},{key:"isPositioned",value:function(){return this.style.position!==f.POSITION.STATIC}},{key:"isFloating",value:function(){return this.style.float!==u.FLOAT.NONE}},{key:"isRootElement",value:function(){return null===this.parent}},{key:"isTransformed",value:function(){return null!==this.style.transform}},{key:"isPositionedWithZIndex",value:function(){return this.isPositioned()&&!this.style.zIndex.auto}},{key:"isInlineLevel",value:function(){return(0,s.contains)(this.style.display,l.DISPLAY.INLINE)||(0,s.contains)(this.style.display,l.DISPLAY.INLINE_BLOCK)||(0,s.contains)(this.style.display,l.DISPLAY.INLINE_FLEX)||(0,s.contains)(this.style.display,l.DISPLAY.INLINE_GRID)||(0,s.contains)(this.style.display,l.DISPLAY.INLINE_LIST_ITEM)||(0,s.contains)(this.style.display,l.DISPLAY.INLINE_TABLE)}},{key:"isInlineBlockOrInlineTable",value:function(){return(0,s.contains)(this.style.display,l.DISPLAY.INLINE_BLOCK)||(0,s.contains)(this.style.display,l.DISPLAY.INLINE_TABLE)}}]),A}();e.default=S;var L=function(A,e){if(A instanceof A.ownerDocument.defaultView.SVGSVGElement||A instanceof SVGSVGElement){var t=new XMLSerializer;return e.loadImage("data:image/svg+xml,"+encodeURIComponent(t.serializeToString(A)))}switch(A.tagName){case"IMG":var r=A;return e.loadImage(r.currentSrc||r.src);case"CANVAS":var n=A;return e.loadCanvas(n);case"IFRAME":var B=A.getAttribute("data-html2canvas-internal-iframe-key");if(B)return B}return null}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.contains=function(A,e){return 0!=(A&e)},e.distance=function(A,e){return Math.sqrt(A*A+e*e)},e.copyCSSStyles=function(A,e){for(var t=A.length-1;t>=0;t--){var r=A.item(t);"content"!==r&&e.style.setProperty(r,A.getPropertyValue(r))}return e},e.SMALL_IMAGE="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseBackgroundImage=e.parseBackground=e.calculateBackgroundRepeatPath=e.calculateBackgroundPosition=e.calculateBackgroungPositioningArea=e.calculateBackgroungPaintingArea=e.calculateGradientBackgroundSize=e.calculateBackgroundSize=e.BACKGROUND_ORIGIN=e.BACKGROUND_CLIP=e.BACKGROUND_SIZE=e.BACKGROUND_REPEAT=void 0;var r=i(t(0)),n=i(t(2)),B=i(t(31)),a=i(t(7)),s=t(1),o=t(17);function i(A){return A&&A.__esModule?A:{default:A}}var c=e.BACKGROUND_REPEAT={REPEAT:0,NO_REPEAT:1,REPEAT_X:2,REPEAT_Y:3},l=e.BACKGROUND_SIZE={AUTO:0,CONTAIN:1,COVER:2,LENGTH:3},u=e.BACKGROUND_CLIP={BORDER_BOX:0,PADDING_BOX:1,CONTENT_BOX:2},Q=e.BACKGROUND_ORIGIN=u,w=function A(e){switch(function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),e){case"contain":this.size=l.CONTAIN;break;case"cover":this.size=l.COVER;break;case"auto":this.size=l.AUTO;break;default:this.value=new n.default(e)}},U=(e.calculateBackgroundSize=function(A,e,t){var r=0,n=0,a=A.size;if(a[0].size===l.CONTAIN||a[0].size===l.COVER){var s=t.width/t.height,o=e.width/e.height;return s0&&(A=n.substr(0,e).toLowerCase(),n=n.substr(e)),"none"!==(n=n.toLowerCase())&&t.push({prefix:A,method:n,args:r})}r=[],n=a=""};return A.split("").forEach(function(A){if(0!==s||!e.test(A)){switch(A){case'"':B?B===A&&(B=null):B=A;break;case"(":if(B)break;if(0===s)return void(s=1);o++;break;case")":if(B)break;if(1===s){if(0===o)return s=0,void i();o--}break;case",":if(B)break;if(0===s)return void i();if(1===s&&0===o&&!n.match(/^url$/i))return r.push(a.trim()),void(a="")}0===s?n+=A:a+=A}}),i(),t}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PATH={VECTOR:0,BEZIER_CURVE:1,CIRCLE:2}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(6);e.default=function A(e,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.type=r.PATH.VECTOR,this.x=e,this.y=t}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseListStyle=e.parseListStyleType=e.LIST_STYLE_TYPE=e.LIST_STYLE_POSITION=void 0;var r=t(5),n=e.LIST_STYLE_POSITION={INSIDE:0,OUTSIDE:1},B=e.LIST_STYLE_TYPE={NONE:-1,DISC:0,CIRCLE:1,SQUARE:2,DECIMAL:3,CJK_DECIMAL:4,DECIMAL_LEADING_ZERO:5,LOWER_ROMAN:6,UPPER_ROMAN:7,LOWER_GREEK:8,LOWER_ALPHA:9,UPPER_ALPHA:10,ARABIC_INDIC:11,ARMENIAN:12,BENGALI:13,CAMBODIAN:14,CJK_EARTHLY_BRANCH:15,CJK_HEAVENLY_STEM:16,CJK_IDEOGRAPHIC:17,DEVANAGARI:18,ETHIOPIC_NUMERIC:19,GEORGIAN:20,GUJARATI:21,GURMUKHI:22,HEBREW:22,HIRAGANA:23,HIRAGANA_IROHA:24,JAPANESE_FORMAL:25,JAPANESE_INFORMAL:26,KANNADA:27,KATAKANA:28,KATAKANA_IROHA:29,KHMER:30,KOREAN_HANGUL_FORMAL:31,KOREAN_HANJA_FORMAL:32,KOREAN_HANJA_INFORMAL:33,LAO:34,LOWER_ARMENIAN:35,MALAYALAM:36,MONGOLIAN:37,MYANMAR:38,ORIYA:39,PERSIAN:40,SIMP_CHINESE_FORMAL:41,SIMP_CHINESE_INFORMAL:42,TAMIL:43,TELUGU:44,THAI:45,TIBETAN:46,TRAD_CHINESE_FORMAL:47,TRAD_CHINESE_INFORMAL:48,UPPER_ARMENIAN:49,DISCLOSURE_OPEN:50,DISCLOSURE_CLOSED:51},a=e.parseListStyleType=function(A){switch(A){case"disc":return B.DISC;case"circle":return B.CIRCLE;case"square":return B.SQUARE;case"decimal":return B.DECIMAL;case"cjk-decimal":return B.CJK_DECIMAL;case"decimal-leading-zero":return B.DECIMAL_LEADING_ZERO;case"lower-roman":return B.LOWER_ROMAN;case"upper-roman":return B.UPPER_ROMAN;case"lower-greek":return B.LOWER_GREEK;case"lower-alpha":return B.LOWER_ALPHA;case"upper-alpha":return B.UPPER_ALPHA;case"arabic-indic":return B.ARABIC_INDIC;case"armenian":return B.ARMENIAN;case"bengali":return B.BENGALI;case"cambodian":return B.CAMBODIAN;case"cjk-earthly-branch":return B.CJK_EARTHLY_BRANCH;case"cjk-heavenly-stem":return B.CJK_HEAVENLY_STEM;case"cjk-ideographic":return B.CJK_IDEOGRAPHIC;case"devanagari":return B.DEVANAGARI;case"ethiopic-numeric":return B.ETHIOPIC_NUMERIC;case"georgian":return B.GEORGIAN;case"gujarati":return B.GUJARATI;case"gurmukhi":return B.GURMUKHI;case"hebrew":return B.HEBREW;case"hiragana":return B.HIRAGANA;case"hiragana-iroha":return B.HIRAGANA_IROHA;case"japanese-formal":return B.JAPANESE_FORMAL;case"japanese-informal":return B.JAPANESE_INFORMAL;case"kannada":return B.KANNADA;case"katakana":return B.KATAKANA;case"katakana-iroha":return B.KATAKANA_IROHA;case"khmer":return B.KHMER;case"korean-hangul-formal":return B.KOREAN_HANGUL_FORMAL;case"korean-hanja-formal":return B.KOREAN_HANJA_FORMAL;case"korean-hanja-informal":return B.KOREAN_HANJA_INFORMAL;case"lao":return B.LAO;case"lower-armenian":return B.LOWER_ARMENIAN;case"malayalam":return B.MALAYALAM;case"mongolian":return B.MONGOLIAN;case"myanmar":return B.MYANMAR;case"oriya":return B.ORIYA;case"persian":return B.PERSIAN;case"simp-chinese-formal":return B.SIMP_CHINESE_FORMAL;case"simp-chinese-informal":return B.SIMP_CHINESE_INFORMAL;case"tamil":return B.TAMIL;case"telugu":return B.TELUGU;case"thai":return B.THAI;case"tibetan":return B.TIBETAN;case"trad-chinese-formal":return B.TRAD_CHINESE_FORMAL;case"trad-chinese-informal":return B.TRAD_CHINESE_INFORMAL;case"upper-armenian":return B.UPPER_ARMENIAN;case"disclosure-open":return B.DISCLOSURE_OPEN;case"disclosure-closed":return B.DISCLOSURE_CLOSED;case"none":default:return B.NONE}},s=(e.parseListStyle=function(A){var e=(0,r.parseBackgroundImage)(A.getPropertyValue("list-style-image"));return{listStyleType:a(A.getPropertyValue("list-style-type")),listStyleImage:e.length?e[0]:null,listStylePosition:s(A.getPropertyValue("list-style-position"))}},function(A){switch(A){case"inside":return n.INSIDE;case"outside":default:return n.OUTSIDE}})},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function A(A,e){for(var t=0;t0?e+t.toUpperCase():A}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(23),n=function(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]},B={get SUPPORT_RANGE_BOUNDS(){var A=function(A){if(A.createRange){var e=A.createRange();if(e.getBoundingClientRect){var t=A.createElement("boundtest");t.style.height="123px",t.style.display="block",A.body.appendChild(t),e.selectNode(t);var r=e.getBoundingClientRect(),n=Math.round(r.height);if(A.body.removeChild(t),123===n)return!0}}return!1}(document);return Object.defineProperty(B,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas"),r=t.getContext("2d");e.src="data:image/svg+xml,";try{r.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(B,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_BASE64_DRAWING(){return function(A){var e=function(A,e){var t=new Image,r=A.createElement("canvas"),n=r.getContext("2d");return new Promise(function(A){t.src=e;var B=function(){try{n.drawImage(t,0,0),r.toDataURL()}catch(e){return A(!1)}return A(!0)};t.onload=B,t.onerror=function(){return A(!1)},!0===t.complete&&setTimeout(function(){B()},500)})}(document,A);return Object.defineProperty(B,"SUPPORT_BASE64_DRAWING",{value:function(){return e}}),e}},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(A){var e=A.createElement("canvas");e.width=100,e.height=100;var t=e.getContext("2d");t.fillStyle="rgb(0, 255, 0)",t.fillRect(0,0,100,100);var B=new Image,a=e.toDataURL();B.src=a;var s=(0,r.createForeignObjectSVG)(100,100,0,0,B);return t.fillStyle="red",t.fillRect(0,0,100,100),(0,r.loadSerializedSVG)(s).then(function(e){t.drawImage(e,0,0);var B=t.getImageData(0,0,100,100).data;t.fillStyle="red",t.fillRect(0,0,100,100);var s=A.createElement("div");return s.style.backgroundImage="url("+a+")",s.style.height="100px",n(B)?(0,r.loadSerializedSVG)((0,r.createForeignObjectSVG)(100,100,0,0,s)):Promise.reject(!1)}).then(function(A){return t.drawImage(A,0,0),n(t.getImageData(0,0,100,100).data)}).catch(function(A){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(B,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(B,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(B,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(B,"SUPPORT_CORS_XHR",{value:A}),A}};e.default=B},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseTextDecoration=e.TEXT_DECORATION_LINE=e.TEXT_DECORATION=e.TEXT_DECORATION_STYLE=void 0;var r,n=t(0),B=(r=n,r&&r.__esModule?r:{default:r});var a=e.TEXT_DECORATION_STYLE={SOLID:0,DOUBLE:1,DOTTED:2,DASHED:3,WAVY:4},s=e.TEXT_DECORATION={NONE:null},o=e.TEXT_DECORATION_LINE={UNDERLINE:1,OVERLINE:2,LINE_THROUGH:3,BLINK:4},i=function(A){switch(A){case"underline":return o.UNDERLINE;case"overline":return o.OVERLINE;case"line-through":return o.LINE_THROUGH}return o.BLINK};e.parseTextDecoration=function(A){var e,t=(e=A.textDecorationLine?A.textDecorationLine:A.textDecoration,"none"===e?null:e.split(" ").map(i));if(null===t)return s.NONE;return{textDecorationLine:t,textDecorationColor:A.textDecorationColor?new B.default(A.textDecorationColor):null,textDecorationStyle:function(A){switch(A){case"double":return a.DOUBLE;case"dotted":return a.DOTTED;case"dashed":return a.DASHED;case"wavy":return a.WAVY}return a.SOLID}(A.textDecorationStyle)}}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseBorder=e.BORDER_SIDES=e.BORDER_STYLE=void 0;var r,n=t(0),B=(r=n,r&&r.__esModule?r:{default:r});var a=e.BORDER_STYLE={NONE:0,SOLID:1},s=e.BORDER_SIDES={TOP:0,RIGHT:1,BOTTOM:2,LEFT:3},o=Object.keys(s).map(function(A){return A.toLowerCase()});e.parseBorder=function(A){return o.map(function(e){var t=new B.default(A.getPropertyValue("border-"+e+"-color")),r=function(A){switch(A){case"none":return a.NONE}return a.SOLID}(A.getPropertyValue("border-"+e+"-style")),n=parseFloat(A.getPropertyValue("border-"+e+"-width"));return{borderColor:t,borderStyle:r,borderWidth:isNaN(n)?0:n}})}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.toCodePoints=function(A){for(var e=[],t=0,r=A.length;t=55296&&n<=56319&&t>10),n%1024+56320)),(t+1===A||e.length>16384)&&(r+=String.fromCharCode.apply(String,e),e.length=0)}return r};for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="undefined"==typeof Uint8Array?[]:new Uint8Array(256),B=0;B>4,l[B++]=(15&s)<<4|o>>2,l[B++]=(3&o)<<6|63&i;return c},e.polyUint16Array=function(A){for(var e=A.length,t=[],r=0;rt?F(A,n,B.length>0):r.integers.reduce(function(e,t,n){for(;A>=t;)A-=t,e+=r.values[n];return e},"")+B},U=function(A,e,t,r){var n="";do{t||A--,n=r(A)+n,A/=e}while(A*e>=e);return n},g=function(A,e,t,r,n){var B=t-e+1;return(A<0?"-":"")+(U(Math.abs(A),B,r,function(A){return(0,s.fromCodePoint)(Math.floor(A%B)+e)})+n)},C=function(A,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:". ",r=e.length;return U(Math.abs(A),r,!1,function(A){return e[Math.floor(A%r)]})+t},d=function(A,e,t,n,B,s){if(A<-9999||A>9999)return F(A,a.LIST_STYLE_TYPE.CJK_DECIMAL,B.length>0);var o=Math.abs(A),i=B;if(0===o)return e[0]+i;for(var c=0;o>0&&c<=4;c++){var l=o%10;0===l&&(0,r.contains)(s,1)&&""!==i?i=e[l]+i:l>1||1===l&&0===c||1===l&&1===c&&(0,r.contains)(s,2)||1===l&&1===c&&(0,r.contains)(s,4)&&A>100||1===l&&c>1&&(0,r.contains)(s,8)?i=e[l]+(c>0?t[c-1]:"")+i:1===l&&c>0&&(i=t[c-1]+i),o=Math.floor(o/10)}return(A<0?n:"")+i},F=e.createCounterText=function(A,e,t){var r=t?". ":"",n=t?"、":"",B=t?", ":"";switch(e){case a.LIST_STYLE_TYPE.DISC:return"•";case a.LIST_STYLE_TYPE.CIRCLE:return"◦";case a.LIST_STYLE_TYPE.SQUARE:return"◾";case a.LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:var s=g(A,48,57,!0,r);return s.length<4?"0"+s:s;case a.LIST_STYLE_TYPE.CJK_DECIMAL:return C(A,"〇一二三四五六七八九",n);case a.LIST_STYLE_TYPE.LOWER_ROMAN:return w(A,1,3999,c,a.LIST_STYLE_TYPE.DECIMAL,r).toLowerCase();case a.LIST_STYLE_TYPE.UPPER_ROMAN:return w(A,1,3999,c,a.LIST_STYLE_TYPE.DECIMAL,r);case a.LIST_STYLE_TYPE.LOWER_GREEK:return g(A,945,969,!1,r);case a.LIST_STYLE_TYPE.LOWER_ALPHA:return g(A,97,122,!1,r);case a.LIST_STYLE_TYPE.UPPER_ALPHA:return g(A,65,90,!1,r);case a.LIST_STYLE_TYPE.ARABIC_INDIC:return g(A,1632,1641,!0,r);case a.LIST_STYLE_TYPE.ARMENIAN:case a.LIST_STYLE_TYPE.UPPER_ARMENIAN:return w(A,1,9999,l,a.LIST_STYLE_TYPE.DECIMAL,r);case a.LIST_STYLE_TYPE.LOWER_ARMENIAN:return w(A,1,9999,l,a.LIST_STYLE_TYPE.DECIMAL,r).toLowerCase();case a.LIST_STYLE_TYPE.BENGALI:return g(A,2534,2543,!0,r);case a.LIST_STYLE_TYPE.CAMBODIAN:case a.LIST_STYLE_TYPE.KHMER:return g(A,6112,6121,!0,r);case a.LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:return C(A,"子丑寅卯辰巳午未申酉戌亥",n);case a.LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:return C(A,"甲乙丙丁戊己庚辛壬癸",n);case a.LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:case a.LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:return d(A,"零一二三四五六七八九","十百千萬","負",n,14);case a.LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:return d(A,"零壹貳參肆伍陸柒捌玖","拾佰仟萬","負",n,15);case a.LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL:return d(A,"零一二三四五六七八九","十百千萬","负",n,14);case a.LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL:return d(A,"零壹贰叁肆伍陆柒捌玖","拾佰仟萬","负",n,15);case a.LIST_STYLE_TYPE.JAPANESE_INFORMAL:return d(A,"〇一二三四五六七八九","十百千万","マイナス",n,0);case a.LIST_STYLE_TYPE.JAPANESE_FORMAL:return d(A,"零壱弐参四伍六七八九","拾百千万","マイナス",n,7);case a.LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:return d(A,"영일이삼사오육칠팔구","십백천만","마이너스 ",B,7);case a.LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:return d(A,"零一二三四五六七八九","十百千萬","마이너스 ",B,0);case a.LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:return d(A,"零壹貳參四五六七八九","拾百千","마이너스 ",B,7);case a.LIST_STYLE_TYPE.DEVANAGARI:return g(A,2406,2415,!0,r);case a.LIST_STYLE_TYPE.GEORGIAN:return w(A,1,19999,Q,a.LIST_STYLE_TYPE.DECIMAL,r);case a.LIST_STYLE_TYPE.GUJARATI:return g(A,2790,2799,!0,r);case a.LIST_STYLE_TYPE.GURMUKHI:return g(A,2662,2671,!0,r);case a.LIST_STYLE_TYPE.HEBREW:return w(A,1,10999,u,a.LIST_STYLE_TYPE.DECIMAL,r);case a.LIST_STYLE_TYPE.HIRAGANA:return C(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case a.LIST_STYLE_TYPE.HIRAGANA_IROHA:return C(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case a.LIST_STYLE_TYPE.KANNADA:return g(A,3302,3311,!0,r);case a.LIST_STYLE_TYPE.KATAKANA:return C(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case a.LIST_STYLE_TYPE.KATAKANA_IROHA:return C(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case a.LIST_STYLE_TYPE.LAO:return g(A,3792,3801,!0,r);case a.LIST_STYLE_TYPE.MONGOLIAN:return g(A,6160,6169,!0,r);case a.LIST_STYLE_TYPE.MYANMAR:return g(A,4160,4169,!0,r);case a.LIST_STYLE_TYPE.ORIYA:return g(A,2918,2927,!0,r);case a.LIST_STYLE_TYPE.PERSIAN:return g(A,1776,1785,!0,r);case a.LIST_STYLE_TYPE.TAMIL:return g(A,3046,3055,!0,r);case a.LIST_STYLE_TYPE.TELUGU:return g(A,3174,3183,!0,r);case a.LIST_STYLE_TYPE.THAI:return g(A,3664,3673,!0,r);case a.LIST_STYLE_TYPE.TIBETAN:return g(A,3872,3881,!0,r);case a.LIST_STYLE_TYPE.DECIMAL:default:return g(A,48,57,!0,r)}}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function A(A,e){for(var t=0;tA.height?(A.left+=(A.width-A.height)/2,A.width=A.height):A.width0&&B){var a=e.ownerDocument.createElement("html2canvaswrapper");(0,c.copyCSSStyles)(e.ownerDocument.defaultView.getComputedStyle(e,null),a),a.style.position="absolute",a.style.left=t.bounds.left+"px",a.style.top=t.bounds.top+"px",n||(a.style.whiteSpace="nowrap");var s=e.ownerDocument.createTextNode(A);a.appendChild(s),B.appendChild(a),t.childNodes.push(r.default.fromTextNode(s,t)),B.removeChild(a)}}),h=function(A){var e="password"===A.type?new Array(A.value.length+1).join("•"):A.value;return 0===e.length?A.placeholder||"":e}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseTextBounds=e.TextBounds=void 0;var r,n=t(1),B=t(11),a=t(10),s=(r=a,r&&r.__esModule?r:{default:r}),o=t(24);var i=e.TextBounds=function A(e,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.text=e,this.bounds=t},c=(e.parseTextBounds=function(A,e,t){for(var r=0!==e.style.letterSpacing?(0,o.toCodePoints)(A).map(function(A){return(0,o.fromCodePoint)(A)}):(0,o.breakWords)(A,e),n=r.length,a=t.parentNode?t.parentNode.ownerDocument.defaultView:null,u=a?a.pageXOffset:0,Q=a?a.pageYOffset:0,w=[],U=0,g=0;g0)if(s.default.SUPPORT_RANGE_BOUNDS)w.push(new i(C,l(t,U,C.length,u,Q)));else{var d=t.splitText(C.length);w.push(new i(C,c(t,u,Q))),t=d}else s.default.SUPPORT_RANGE_BOUNDS||(t=t.splitText(C.length));U+=C.length}return w},function(A,e,t){var r=A.ownerDocument.createElement("html2canvaswrapper");r.appendChild(A.cloneNode(!0));var B=A.parentNode;if(B){B.replaceChild(r,A);var a=(0,n.parseBounds)(r,e,t);return r.firstChild&&B.replaceChild(r.firstChild,r),a}return new n.Bounds(0,0,0,0)}),l=function(A,e,t,r,B){var a=A.ownerDocument.createRange();return a.setStart(A,e),a.setEnd(A,e+t),n.Bounds.fromClientRect(a.getBoundingClientRect(),r,B)}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function A(A,e){for(var t=0;t0&&t.childNodes.push(B.default.fromTextNode(g,t));else if(g instanceof C.HTMLElement||g instanceof HTMLElement||C.parent&&g instanceof C.parent.HTMLElement){if(-1===c.indexOf(g.nodeName)){var d=new n.default(g,t,l,w++);if(d.isVisible()){"INPUT"===g.tagName?(0,a.inlineInputElement)(g,d):"TEXTAREA"===g.tagName?(0,a.inlineTextAreaElement)(g,d):"SELECT"===g.tagName?(0,a.inlineSelectElement)(g,d):d.style.listStyle&&d.style.listStyle.listStyleType!==o.LIST_STYLE_TYPE.NONE&&(0,s.inlineListItemElement)(g,d,l);var F="TEXTAREA"!==g.tagName,E=u(d,g);if(E||Q(d)){var f=E||d.isPositioned()?i.getRealParentStackingContext():i,h=new r.default(d,f,E);f.contexts.push(h),F&&A(g,d,h,l,w)}else i.children.push(d),F&&A(g,d,i,l,w)}}}else if(g instanceof C.SVGSVGElement||g instanceof SVGSVGElement||C.parent&&g instanceof C.parent.SVGSVGElement){var H=new n.default(g,t,l,w++),p=u(H,g);if(p||Q(H)){var N=p||H.isPositioned()?i.getRealParentStackingContext():i,I=new r.default(H,N,p);N.contexts.push(I)}else i.children.push(H)}}},u=function(A,e){return A.isRootElement()||A.isPositionedWithZIndex()||A.style.opacity<1||A.isTransformed()||w(A,e)},Q=function(A){return A.isPositioned()||A.isFloating()},w=function(A,e){return"BODY"===e.nodeName&&A.parent instanceof n.default&&A.parent.style.background.backgroundColor.isTransparent()}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,n=function(){function A(A,e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"strict",t=[],r=[],n=[];return A.forEach(function(A,B){var a=O.get(A);if(a>c?(n.push(!0),a-=c):n.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return r.push(B),t.push(16);if(4===a||11===a){if(0===B)return r.push(B),t.push(N);var s=t[B-1];return-1===x.indexOf(s)?(r.push(r[B-1]),t.push(s)):(r.push(B),t.push(N))}return r.push(B),31===a?t.push("strict"===e?d:v):a===L?t.push(N):29===a?t.push(N):43===a?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(v):t.push(N):void t.push(a)}),[r,t,n]},G=function(A,e,t,r){var n=r[t];if(Array.isArray(A)?-1!==A.indexOf(n):A===n)for(var B=t;B<=r.length;){var a=r[++B];if(a===e)return!0;if(a!==l)break}if(n===l)for(var s=t;s>0;){var o=r[--s];if(Array.isArray(A)?-1!==A.indexOf(o):A===o)for(var i=t;i<=r.length;){var c=r[++i];if(c===e)return!0;if(c!==l)break}if(o!==l)break}return!1},Y=function(A,e){for(var t=A;t>=0;){var r=e[t];if(r!==l)return r;t--}return 0},W=function(A,e,t,r,n){if(0===t[r])return D;var B=r-1;if(Array.isArray(n)&&!0===n[B])return D;var a=B-1,s=B+1,o=e[B],i=a>=0?e[a]:0,c=e[s];if(2===o&&3===c)return D;if(-1!==P.indexOf(o))return _;if(-1!==P.indexOf(c))return D;if(-1!==X.indexOf(c))return D;if(8===Y(B,e))return M;if(11===O.get(A[B])&&(c===v||c===I||c===K))return D;if(7===o||7===c)return D;if(9===o)return D;if(-1===[l,u,Q].indexOf(o)&&9===c)return D;if(-1!==[w,U,g,E,p].indexOf(c))return D;if(Y(B,e)===F)return D;if(G(23,F,B,e))return D;if(G([w,U],d,B,e))return D;if(G(12,12,B,e))return D;if(o===l)return M;if(23===o||23===c)return D;if(16===c||16===o)return M;if(-1!==[u,Q,d].indexOf(c)||14===o)return D;if(36===i&&-1!==k.indexOf(o))return D;if(o===p&&36===c)return D;if(c===C&&-1!==R.concat(C,g,f,v,I,K).indexOf(o))return D;if(-1!==R.indexOf(c)&&o===f||-1!==R.indexOf(o)&&c===f)return D;if(o===H&&-1!==[v,I,K].indexOf(c)||-1!==[v,I,K].indexOf(o)&&c===h)return D;if(-1!==R.indexOf(o)&&-1!==z.indexOf(c)||-1!==z.indexOf(o)&&-1!==R.indexOf(c))return D;if(-1!==[H,h].indexOf(o)&&(c===f||-1!==[F,Q].indexOf(c)&&e[s+1]===f)||-1!==[F,Q].indexOf(o)&&c===f||o===f&&-1!==[f,p,E].indexOf(c))return D;if(-1!==[f,p,E,w,U].indexOf(c))for(var N=B;N>=0;){var L=e[N];if(L===f)return D;if(-1===[p,E].indexOf(L))break;N--}if(-1!==[H,h].indexOf(c))for(var x=-1!==[w,U].indexOf(o)?a:B;x>=0;){var J=e[x];if(J===f)return D;if(-1===[p,E].indexOf(J))break;x--}if(y===o&&-1!==[y,b,T,m].indexOf(c)||-1!==[b,T].indexOf(o)&&-1!==[b,S].indexOf(c)||-1!==[S,m].indexOf(o)&&c===S)return D;if(-1!==V.indexOf(o)&&-1!==[C,h].indexOf(c)||-1!==V.indexOf(c)&&o===H)return D;if(-1!==R.indexOf(o)&&-1!==R.indexOf(c))return D;if(o===E&&-1!==R.indexOf(c))return D;if(-1!==R.concat(f).indexOf(o)&&c===F||-1!==R.concat(f).indexOf(c)&&o===U)return D;if(41===o&&41===c){for(var W=t[B],j=1;W>0&&41===e[--W];)j++;if(j%2!=0)return D}return o===I&&c===K?D:M},j=(e.lineBreakAtIndex=function(A,e){if(0===e)return D;if(e>=A.length)return _;var t=J(A),r=B(t,2),n=r[0],a=r[1];return W(A,a,n,e)},function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=J(A,e.lineBreak),r=B(t,3),n=r[0],a=r[1],s=r[2];"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(a=a.map(function(A){return-1!==[f,N,L].indexOf(A)?v:A}));return[n,a,"keep-all"===e.wordBreak?s.map(function(e,t){return e&&A[t]>=19968&&A[t]<=40959}):null]}),q=(e.inlineBreakOpportunities=function(A,e){var t=(0,i.toCodePoints)(A),r=D,n=j(t,e),a=B(n,3),s=a[0],o=a[1],c=a[2];return t.forEach(function(A,e){r+=(0,i.fromCodePoint)(A)+(e>=t.length-1?_:W(t,o,s,e+1,c))}),r},function(){function A(e,t,r,n){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this._codePoints=e,this.required=t===_,this.start=r,this.end=n}return n(A,[{key:"slice",value:function(){return i.fromCodePoint.apply(void 0,function(A){if(Array.isArray(A)){for(var e=0,t=Array(A.length);e=c)return{done:!0};for(var A=D;u>B,c=e.UTRIE2_DATA_BLOCK_LENGTH=1<>B,Q=e.UTRIE2_INDEX_2_BMP_LENGTH=i+u,w=e.UTRIE2_UTF8_2B_INDEX_2_OFFSET=Q,U=e.UTRIE2_UTF8_2B_INDEX_2_LENGTH=32,g=e.UTRIE2_INDEX_1_OFFSET=w+U,C=e.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH=65536>>a,d=e.UTRIE2_INDEX_2_BLOCK_LENGTH=1<=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>B])<>B)])<>a),e=this.index[e],e+=A>>B&F,e=((e=this.index[e])<0?t.width:r.width,B="number"==typeof t.height&&t.height>0?t.height:r.height;n>0&&B>0&&e.target.clip([(0,a.calculatePaddingBoxPath)(A.curvedBounds)],function(){e.target.drawImage(t,new a.Bounds(0,0,n,B),r)})}}},r=A.getClipPaths();r.length?this.target.clip(r,t):t()}},{key:"renderNodeBackgroundAndBorders",value:function(A){var e=this,t=!A.style.background.backgroundColor.isTransparent()||A.style.background.backgroundImage.length,r=A.style.border.some(function(A){return A.borderStyle!==l.BORDER_STYLE.NONE&&!A.borderColor.isTransparent()}),n=function(){var r=(0,c.calculateBackgroungPaintingArea)(A.curvedBounds,A.style.background.backgroundClip);t&&e.target.clip([r],function(){A.style.background.backgroundColor.isTransparent()||e.target.fill(A.style.background.backgroundColor),e.renderBackgroundImage(A)}),A.style.border.forEach(function(t,r){t.borderStyle===l.BORDER_STYLE.NONE||t.borderColor.isTransparent()||e.renderBorder(t,r,A.curvedBounds)})};if(t||r){var B=A.parent?A.parent.getClipPaths():[];B.length?this.target.clip(B,n):n()}}},{key:"renderBackgroundImage",value:function(A){var e=this;A.style.background.backgroundImage.slice(0).reverse().forEach(function(t){"url"===t.source.method&&t.source.args.length?e.renderBackgroundRepeat(A,t):/gradient/i.test(t.source.method)&&e.renderBackgroundGradient(A,t)})}},{key:"renderBackgroundRepeat",value:function(A,e){var t=this.options.imageStore.get(e.source.args[0]);if(t){var r=(0,c.calculateBackgroungPositioningArea)(A.style.background.backgroundOrigin,A.bounds,A.style.padding,A.style.border),n=(0,c.calculateBackgroundSize)(e,t,r),B=(0,c.calculateBackgroundPosition)(e.position,n,r),a=(0,c.calculateBackgroundRepeatPath)(e,B,n,r,A.bounds),s=Math.round(r.left+B.x),o=Math.round(r.top+B.y);this.target.renderRepeat(a,t,n,s,o)}}},{key:"renderBackgroundGradient",value:function(A,e){var t=(0,c.calculateBackgroungPositioningArea)(A.style.background.backgroundOrigin,A.bounds,A.style.padding,A.style.border),r=(0,c.calculateGradientBackgroundSize)(e,t),n=(0,c.calculateBackgroundPosition)(e.position,r,t),B=new a.Bounds(Math.round(t.left+n.x),Math.round(t.top+n.y),r.width,r.height),o=(0,s.parseGradient)(A,e.source,B);if(o)switch(o.type){case s.GRADIENT_TYPE.LINEAR_GRADIENT:this.target.renderLinearGradient(B,o);break;case s.GRADIENT_TYPE.RADIAL_GRADIENT:this.target.renderRadialGradient(B,o)}}},{key:"renderBorder",value:function(A,e,t){this.target.drawShape((0,a.parsePathForBorder)(t,e),A.borderColor)}},{key:"renderStack",value:function(A){var e=this;if(A.container.isVisible()){var t=A.getOpacity();t!==this._opacity&&(this.target.setOpacity(A.getOpacity()),this._opacity=t);var r=A.container.style.transform;null!==r?this.target.transform(A.container.bounds.left+r.transformOrigin[0].value,A.container.bounds.top+r.transformOrigin[1].value,r.transform,function(){return e.renderStackContent(A)}):this.renderStackContent(A)}}},{key:"renderStackContent",value:function(A){var e=w(A),t=n(e,5),r=t[0],B=t[1],a=t[2],s=t[3],o=t[4],i=Q(A),c=n(i,2),l=c[0],u=c[1];this.renderNodeBackgroundAndBorders(A.container),r.sort(U).forEach(this.renderStack,this),this.renderNodeContent(A.container),u.forEach(this.renderNode,this),s.forEach(this.renderStack,this),o.forEach(this.renderStack,this),l.forEach(this.renderNode,this),B.forEach(this.renderStack,this),a.sort(U).forEach(this.renderStack,this)}},{key:"render",value:function(A){this.options.backgroundColor&&this.target.rectangle(this.options.x,this.options.y,this.options.width,this.options.height,this.options.backgroundColor),this.renderStack(A);var e=this.target.getTarget();return e}}]),A}();e.default=u;var Q=function(A){for(var e=[],t=[],r=A.children.length,n=0;n0?r.push(o):t.push(o):o.container.isFloating()?n.push(o):B.push(o)}return[e,t,r,n,B]},U=function(A,e){return A.container.style.zIndex.order>e.container.style.zIndex.order?1:A.container.style.zIndex.ordere.container.index?1:-1}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transformWebkitRadialGradientArgs=e.parseGradient=e.RadialGradient=e.LinearGradient=e.RADIAL_GRADIENT_SHAPE=e.GRADIENT_TYPE=void 0;var r=function(){return function(A,e){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return function(A,e){var t=[],r=!0,n=!1,B=void 0;try{for(var a,s=A[Symbol.iterator]();!(r=(a=s.next()).done)&&(t.push(a.value),!e||t.length!==e);r=!0);}catch(A){n=!0,B=A}finally{try{!r&&s.return&&s.return()}finally{if(n)throw B}}return t}(A,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),n=(i(t(3)),t(53)),B=i(t(0)),a=t(2),s=i(a),o=t(4);function i(A){return A&&A.__esModule?A:{default:A}}function c(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}var l=/^(to )?(left|top|right|bottom)( (left|top|right|bottom))?$/i,u=/^([+-]?\d*\.?\d+)% ([+-]?\d*\.?\d+)%$/i,Q=/(px)|%|( 0)$/i,w=/^(from|to|color-stop)\((?:([\d.]+)(%)?,\s*)?(.+?)\)$/i,U=/^\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,g=e.GRADIENT_TYPE={LINEAR_GRADIENT:0,RADIAL_GRADIENT:1},C=e.RADIAL_GRADIENT_SHAPE={CIRCLE:0,ELLIPSE:1},d={left:new s.default("0%"),top:new s.default("0%"),center:new s.default("50%"),right:new s.default("100%"),bottom:new s.default("100%")},F=e.LinearGradient=function A(e,t){c(this,A),this.type=g.LINEAR_GRADIENT,this.colorStops=e,this.direction=t},E=e.RadialGradient=function A(e,t,r,n){c(this,A),this.type=g.RADIAL_GRADIENT,this.colorStops=e,this.shape=t,this.center=r,this.radius=n},f=(e.parseGradient=function(A,e,t){var r=e.args,n=e.method,B=e.prefix;return"linear-gradient"===n?h(r,t,!!B):"gradient"===n&&"linear"===r[0]?h(["to bottom"].concat(y(r.slice(3))),t,!!B):"radial-gradient"===n?H(A,"-webkit-"===B?v(r):r,t):"gradient"===n&&"radial"===r[0]?H(A,y(v(r.slice(1))),t):void 0},function(A,e,t){for(var r=[],n=e;nA.optimumDistance)?{optimumCorner:n,optimumDistance:B}:A},{optimumDistance:r?1/0:-1/0,optimumCorner:null}).optimumCorner},m=function(A,e,t,r,n){var B=t.x,a=t.y,s=0,i=0;switch(A){case"closest-side":e===C.CIRCLE?s=i=Math.min(Math.abs(B),Math.abs(B-n.width),Math.abs(a),Math.abs(a-n.height)):e===C.ELLIPSE&&(s=Math.min(Math.abs(B),Math.abs(B-n.width)),i=Math.min(Math.abs(a),Math.abs(a-n.height)));break;case"closest-corner":if(e===C.CIRCLE)s=i=Math.min((0,o.distance)(B,a),(0,o.distance)(B,a-n.height),(0,o.distance)(B-n.width,a),(0,o.distance)(B-n.width,a-n.height));else if(e===C.ELLIPSE){var c=Math.min(Math.abs(a),Math.abs(a-n.height))/Math.min(Math.abs(B),Math.abs(B-n.width)),l=T(n,B,a,!0);i=c*(s=(0,o.distance)(l.x-B,(l.y-a)/c))}break;case"farthest-side":e===C.CIRCLE?s=i=Math.max(Math.abs(B),Math.abs(B-n.width),Math.abs(a),Math.abs(a-n.height)):e===C.ELLIPSE&&(s=Math.max(Math.abs(B),Math.abs(B-n.width)),i=Math.max(Math.abs(a),Math.abs(a-n.height)));break;case"farthest-corner":if(e===C.CIRCLE)s=i=Math.max((0,o.distance)(B,a),(0,o.distance)(B,a-n.height),(0,o.distance)(B-n.width,a),(0,o.distance)(B-n.width,a-n.height));else if(e===C.ELLIPSE){var u=Math.max(Math.abs(a),Math.abs(a-n.height))/Math.max(Math.abs(B),Math.abs(B-n.width)),Q=T(n,B,a,!1);i=u*(s=(0,o.distance)(Q.x-B,(Q.y-a)/u))}break;default:s=r.x||0,i=void 0!==r.y?r.y:s}return{x:s,y:i}},v=e.transformWebkitRadialGradientArgs=function(A){var e="",t="",r="",n="",B=0,a=/^(left|center|right|\d+(?:px|r?em|%)?)(?:\s+(top|center|bottom|\d+(?:px|r?em|%)?))?$/i,s=/^\d+(px|r?em|%)?(?:\s+\d+(px|r?em|%)?)?$/i,o=A[B].match(a);o&&B++;var i=A[B].match(/^(circle|ellipse)?\s*(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)?$/i);i&&(e=i[1]||"","contain"===(r=i[2]||"")?r="closest-side":"cover"===r&&(r="farthest-corner"),B++);var c=A[B].match(s);c&&B++;var l=A[B].match(a);l&&B++;var u=A[B].match(s);u&&B++;var Q=l||o;Q&&Q[1]&&(n=Q[1]+(/^\d+$/.test(Q[1])?"px":""),Q[2]&&(n+=" "+Q[2]+(/^\d+$/.test(Q[2])?"px":"")));var w=u||c;return w&&(t=w[0],w[1]||(t+="px")),!n||e||t||r||(t=n,n=""),n&&(n="at "+n),[[e,r,t,n].filter(function(A){return!!A}).join(" ")].concat(A.slice(B))},y=function(A){return A.map(function(A){return A.match(w)}).map(function(e,t){if(!e)return A[t];switch(e[1]){case"from":return e[4]+" 0%";case"to":return e[4]+" 100%";case"color-stop":return"%"===e[3]?e[4]+" "+e[2]:e[4]+" "+100*parseFloat(e[2])+"%"}})}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=/([+-]?\d*\.?\d+)(deg|grad|rad|turn)/i;e.parseAngle=function(A){var e=A.match(r);if(e){var t=parseFloat(e[1]);switch(e[2].toLowerCase()){case"deg":return Math.PI*t/180;case"grad":return Math.PI/200*t;case"rad":return t;case"turn":return 2*Math.PI*t}}return null}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.cloneWindow=e.DocumentCloner=void 0;var r=function(){return function(A,e){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return function(A,e){var t=[],r=!0,n=!1,B=void 0;try{for(var a,s=A[Symbol.iterator]();!(r=(a=s.next()).done)&&(t.push(a.value),!e||t.length!==e);r=!0);}catch(A){n=!0,B=A}finally{try{!r&&s.return&&s.return()}finally{if(n)throw B}}return t}(A,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),n=function(){function A(A,e){for(var t=0;t1&&(t.backgroundColor=""),t.backgroundImage=A.join(",")}),A instanceof HTMLImageElement&&this.resourceLoader.inlineImage(A.src).then(function(e){if(e&&A instanceof HTMLImageElement&&A.parentNode){var t=A.parentNode,r=(0,o.copyCSSStyles)(A.style,e.cloneNode(!1));t.replaceChild(r,A)}}).catch(function(A){0})}}},{key:"inlineFonts",value:function(A){var e=this;return Promise.all(Array.from(A.styleSheets).map(function(e){return e.href?fetch(e.href).then(function(A){return A.text()}).then(function(A){return g(A,e.href)}).catch(function(A){return[]}):U(e,A)})).then(function(A){return A.reduce(function(A,e){return A.concat(e)},[])}).then(function(A){return Promise.all(A.map(function(A){return fetch(A.formats[0].src).then(function(A){return A.blob()}).then(function(A){return new Promise(function(e,t){var r=new FileReader;r.onerror=t,r.onload=function(){var A=r.result;e(A)},r.readAsDataURL(A)})}).then(function(e){return A.fontFace.setProperty("src",'url("'+e+'")'),"@font-face {"+A.fontFace.cssText+" "})}))}).then(function(t){var r=A.createElement("style");r.textContent=t.join("\n"),e.documentElement.appendChild(r)})}},{key:"createElementClone",value:function(A){var e=this;if(this.copyStyles&&A instanceof HTMLCanvasElement){var t=A.ownerDocument.createElement("img");try{return t.src=A.toDataURL(),t}catch(A){0}}if(A instanceof HTMLIFrameElement){var r=A.cloneNode(!1),n=K();r.setAttribute("data-html2canvas-internal-iframe-key",n);var a=(0,B.parseBounds)(A,0,0),s=a.width,i=a.height;return this.resourceLoader.cache[n]=m(A,this.options).then(function(A){return e.renderer(A,{async:e.options.async,allowTaint:e.options.allowTaint,backgroundColor:"#ffffff",canvas:null,imageTimeout:e.options.imageTimeout,logging:e.options.logging,proxy:e.options.proxy,removeContainer:e.options.removeContainer,scale:e.options.scale,foreignObjectRendering:e.options.foreignObjectRendering,useCORS:e.options.useCORS,target:new c.default,width:s,height:i,x:0,y:0,windowWidth:A.ownerDocument.defaultView.innerWidth,windowHeight:A.ownerDocument.defaultView.innerHeight,scrollX:A.ownerDocument.defaultView.pageXOffset,scrollY:A.ownerDocument.defaultView.pageYOffset},e.logger.child(n))}).then(function(e){return new Promise(function(t,n){var B=document.createElement("img");B.onload=function(){return t(e)},B.onerror=n,B.src=e.toDataURL(),r.parentNode&&r.parentNode.replaceChild((0,o.copyCSSStyles)(A.ownerDocument.defaultView.getComputedStyle(A),B),r)})}),r}if(A instanceof HTMLStyleElement&&A.sheet&&A.sheet.cssRules){var l=[].slice.call(A.sheet.cssRules,0).reduce(function(A,e){return A+e.cssText},""),u=A.cloneNode(!1);return u.textContent=l,u}return A.cloneNode(!1)}},{key:"cloneNode",value:function(A){var e=A.nodeType===Node.TEXT_NODE?document.createTextNode(A.nodeValue):this.createElementClone(A),t=A.ownerDocument.defaultView,r=A instanceof t.HTMLElement?t.getComputedStyle(A):null,n=A instanceof t.HTMLElement?t.getComputedStyle(A,":before"):null,B=A instanceof t.HTMLElement?t.getComputedStyle(A,":after"):null;this.referenceElement===A&&e instanceof t.HTMLElement&&(this.clonedReferenceElement=e),e instanceof t.HTMLBodyElement&&p(e);for(var a=(0,l.parseCounterReset)(r,this.pseudoContentData),s=(0,l.resolvePseudoContent)(A,n,this.pseudoContentData),i=A.firstChild;i;i=i.nextSibling)(i.nodeType!==Node.ELEMENT_NODE||"SCRIPT"!==i.nodeName&&!i.hasAttribute(Q))&&(this.copyStyles&&"STYLE"===i.nodeName||e.appendChild(this.cloneNode(i)));var c=(0,l.resolvePseudoContent)(A,B,this.pseudoContentData);if((0,l.popCounters)(a,this.pseudoContentData),A instanceof t.HTMLElement&&e instanceof t.HTMLElement)switch(n&&this.inlineAllImages(d(A,e,n,s,F)),B&&this.inlineAllImages(d(A,e,B,c,E)),!r||!this.copyStyles||A instanceof HTMLIFrameElement||(0,o.copyCSSStyles)(r,e),this.inlineAllImages(e),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([e,A.scrollLeft,A.scrollTop]),A.nodeName){case"CANVAS":this.copyStyles||C(A,e);break;case"TEXTAREA":case"SELECT":e.value=A.value}return e}}]),A}(),U=function(A,e){return(A.cssRules?Array.from(A.cssRules):[]).filter(function(A){return A.type===CSSRule.FONT_FACE_RULE}).map(function(A){for(var t=(0,i.parseBackgroundImage)(A.style.getPropertyValue("src")),r=[],n=0;n0&&"complete"===t.readyState&&(clearInterval(e),r(A))},50)}})},b=(e.cloneWindow=function(A,e,t,r,n,B){var a=new w(t,r,n,!1,B),s=A.defaultView.pageXOffset,o=A.defaultView.pageYOffset;return v(A,e).then(function(r){var n=r.contentWindow,B=n.document,i=y(r).then(function(){return a.scrolledElements.forEach(I),n.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||n.scrollY===e.top&&n.scrollX===e.left||(B.documentElement.style.top=-e.top+"px",B.documentElement.style.left=-e.left+"px",B.documentElement.style.position="absolute"),a.clonedReferenceElement instanceof n.HTMLElement||a.clonedReferenceElement instanceof A.defaultView.HTMLElement||a.clonedReferenceElement instanceof HTMLElement?Promise.resolve([r,a.clonedReferenceElement,a.resourceLoader]):Promise.reject("")});B.open(),B.write(b(document.doctype)+""),c=t.ownerDocument,l=s,u=o,!c.defaultView||l===c.defaultView.pageXOffset&&u===c.defaultView.pageYOffset||c.defaultView.scrollTo(l,u);var c,l,u;return B.replaceChild(B.adoptNode(a.documentElement),B.documentElement),B.close(),i})},function(A){var e="";return A&&(e+=""),e})},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ResourceStore=void 0;var r,n=function(){function A(A,e){for(var t=0;t0&&t.push({type:s.ATTRIBUTE,value:l[0]});break;case"counter":if(l.length>0){var w={type:s.COUNTER,name:l[0]};l.length>1&&(w.format=l[1]),t.push(w)}break;case"counters":if(l.length>0){var U={type:s.COUNTERS,name:l[0]};l.length>1&&(U.glue=l[1]),l.length>2&&(U.format=l[2]),t.push(U)}break;case"url":l.length>0&&t.push({type:s.URL,value:l[0]})}a=!1,o=""}break;case",":n?o+=Q:a&&(l.push(o),o="");break;case" ":case"\t":n?o+=Q:o&&(i(t,o),o="");break;default:o+=Q}"\\"!==Q&&(B=!1)}return o&&i(t,o),e&&(e[A]=t),t}),i=function(A,e){switch(e){case"open-quote":A.push({type:s.OPENQUOTE});break;case"close-quote":A.push({type:s.CLOSEQUOTE})}},c=function(A,e,t){var r=A.quotes?A.quotes.split(/\s+/):["'\"'","'\"'"],n=2*t;return n>=r.length&&(n=r.length-2),e||++n,r[n].replace(/^["']|["']$/g,"")},l=function(A,e,t){for(var r=A.length,a="",s=0;s0&&(a+=e||""),a+=(0,n.createCounterText)(A[s],(0,B.parseListStyleType)(t||"decimal"),!1);return a}}])}); \ No newline at end of file diff --git a/hosting/static/hosting/js/html2pdf.js b/hosting/static/hosting/js/html2pdf.js index 45ae5b0c..92b970ac 100644 --- a/hosting/static/hosting/js/html2pdf.js +++ b/hosting/static/hosting/js/html2pdf.js @@ -32,6 +32,7 @@ * 'image' ('type' and 'quality'), and 'html2canvas' / 'jspdf', which are * sent as settings to their corresponding functions. */ + var html2pdf = (function(html2canvas, jsPDF) { /* ---------- MAIN FUNCTION ---------- */ @@ -73,13 +74,18 @@ var html2pdf = (function(html2canvas, jsPDF) { } // Render the canvas and pass the result to makePDF. - var onRendered = opt.html2canvas.onrendered || function() {}; - opt.html2canvas.onrendered = function(canvas) { - onRendered(canvas); - document.body.removeChild(overlay); - html2pdf.makePDF(canvas, pageSize, opt); - } - html2canvas(container, opt.html2canvas); + // var onRendered = opt.html2canvas.onrendered || function() {}; + // opt.html2canvas.onrendered = function(canvas) { + // onRendered(canvas); + // document.body.removeChild(overlay); + // html2pdf.makePDF(canvas, pageSize, opt); + // } + html2canvas(container, opt.html2canvas) + .then((canvas) => { + // onRendered(canvas); + document.body.removeChild(overlay); + html2pdf.makePDF(canvas, pageSize, opt); + }); }; html2pdf.parseInput = function(source, opt) { @@ -303,7 +309,7 @@ var html2pdf = (function(html2canvas, jsPDF) { var format_as_string = ('' + format).toLowerCase(); // Size in pt of various paper formats - pageFormats = { + var pageFormats = { '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], @@ -331,6 +337,7 @@ var html2pdf = (function(html2canvas, jsPDF) { }; // Unit conversion + var k; switch (unit) { case 'pt': k = 1; break; case 'mm': k = 72 / 25.4; break; @@ -345,6 +352,7 @@ var html2pdf = (function(html2canvas, jsPDF) { } // Dimensions are stored as user units and converted to points on output + var pageHeight, pageWidth; if (pageFormats.hasOwnProperty(format_as_string)) { pageHeight = pageFormats[format_as_string][1] / k; pageWidth = pageFormats[format_as_string][0] / k; diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index 2b062b55..fe59dede 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -216,7 +216,7 @@ {% block js_extra %} {% if order %} - + {% endif %} From 22121fa7bcb0bf254ba2671dbe255c8494af439c Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Wed, 7 Feb 2018 19:14:03 +0530 Subject: [PATCH 09/10] use the minified js --- hosting/static/hosting/js/html2pdf.js | 395 ---------------------- hosting/static/hosting/js/html2pdf.min.js | 6 + 2 files changed, 6 insertions(+), 395 deletions(-) delete mode 100644 hosting/static/hosting/js/html2pdf.js create mode 100644 hosting/static/hosting/js/html2pdf.min.js diff --git a/hosting/static/hosting/js/html2pdf.js b/hosting/static/hosting/js/html2pdf.js deleted file mode 100644 index 92b970ac..00000000 --- a/hosting/static/hosting/js/html2pdf.js +++ /dev/null @@ -1,395 +0,0 @@ -/** - * @license - * - * MIT License - * - * Copyright (c) 2017 Erik Koopmans - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/** - * Generate a PDF from an HTML element or string using html2canvas and jsPDF. - * - * @param {Element|string} source The source element or HTML string. - * @param {Object=} opt An object of optional settings: 'margin', 'filename', - * 'image' ('type' and 'quality'), and 'html2canvas' / 'jspdf', which are - * sent as settings to their corresponding functions. - */ - -var html2pdf = (function(html2canvas, jsPDF) { - - /* ---------- MAIN FUNCTION ---------- */ - - var html2pdf = function(source, opt) { - // Handle input. - opt = objType(opt) === 'object' ? opt : {}; - var source = html2pdf.parseInput(source, opt); - - // Determine the PDF page size. - var pageSize = jsPDF.getPageSize(opt.jsPDF); - pageSize.inner = { - width: pageSize.width - opt.margin[1] - opt.margin[3], - height: pageSize.height - opt.margin[0] - opt.margin[2] - }; - pageSize.inner.ratio = pageSize.inner.height / pageSize.inner.width; - - // Copy the source element into a PDF-styled container div. - var container = html2pdf.makeContainer(source, pageSize); - var overlay = container.parentElement; - - // Get the locations of all hyperlinks. - if (opt.enableLinks) { - // Find all anchor tags and get the container's bounds for reference. - opt.links = []; - var links = container.querySelectorAll('a'); - var containerRect = unitConvert(container.getBoundingClientRect(), pageSize.k); - - // Treat each client rect as a separate link (for text-wrapping). - Array.prototype.forEach.call(links, function(link) { - var clientRects = link.getClientRects(); - for (var i=0; i { - // onRendered(canvas); - document.body.removeChild(overlay); - html2pdf.makePDF(canvas, pageSize, opt); - }); - }; - - html2pdf.parseInput = function(source, opt) { - // Parse the opt object. - opt.jsPDF = opt.jsPDF || {}; - opt.html2canvas = opt.html2canvas || {}; - opt.filename = opt.filename && objType(opt.filename) === 'string' ? opt.filename : 'file.pdf'; - opt.enableLinks = opt.hasOwnProperty('enableLinks') ? opt.enableLinks : true; - opt.image = opt.image || {}; - opt.image.type = opt.image.type || 'jpeg'; - opt.image.quality = opt.image.quality || 0.95; - - // Parse the margin property of the opt object. - switch (objType(opt.margin)) { - case 'undefined': - opt.margin = 0; - case 'number': - opt.margin = [opt.margin, opt.margin, opt.margin, opt.margin]; - break; - case 'array': - if (opt.margin.length === 2) { - opt.margin = [opt.margin[0], opt.margin[1], opt.margin[0], opt.margin[1]]; - } - if (opt.margin.length === 4) { - break; - } - default: - throw 'Invalid margin array.'; - } - - // Parse the source element/string. - if (!source) { - throw 'Missing source element or string.'; - } else if (objType(source) === 'string') { - source = createElement('div', { innerHTML: source }); - } else if (objType(source) === 'element') { - source = cloneNode(source, opt.html2canvas.javascriptEnabled); - } else { - throw 'Invalid source - please specify an HTML Element or string.'; - } - - // Return the parsed input (opt is modified in-place, no need to return). - return source; - }; - - html2pdf.makeContainer = function(source, pageSize) { - // Define the CSS styles for the container and its overlay parent. - var overlayCSS = { - position: 'fixed', overflow: 'hidden', zIndex: 1000, - left: 0, right: 0, bottom: 0, top: 0, - backgroundColor: 'rgba(0,0,0,0.8)' - }; - var containerCSS = { - position: 'absolute', width: pageSize.inner.width + pageSize.unit, - left: 0, right: 0, top: 0, height: 'auto', margin: 'auto', - backgroundColor: 'white' - }; - - // Set the overlay to hidden (could be changed in the future to provide a print preview). - overlayCSS.opacity = 0; - - // Create and attach the elements. - var overlay = createElement('div', { className: 'html2pdf__overlay', style: overlayCSS }); - var container = createElement('div', { className: 'html2pdf__container', style: containerCSS }); - container.appendChild(source); - overlay.appendChild(container); - document.body.appendChild(overlay); - - // Enable page-breaks. - var pageBreaks = source.querySelectorAll('.html2pdf__page-break'); - var pxPageHeight = pageSize.inner.height * pageSize.k / 72 * 96; - Array.prototype.forEach.call(pageBreaks, function(el) { - el.style.display = 'block'; - var clientRect = el.getBoundingClientRect(); - el.style.height = pxPageHeight - (clientRect.top % pxPageHeight) + 'px'; - }, this); - - // Return the container. - return container; - }; - - html2pdf.makePDF = function(canvas, pageSize, opt) { - // Calculate the number of pages. - var ctx = canvas.getContext('2d'); - var pxFullHeight = canvas.height; - var pxPageHeight = Math.floor(canvas.width * pageSize.inner.ratio); - var nPages = Math.ceil(pxFullHeight / pxPageHeight); - - // Create a one-page canvas to split up the full image. - var pageCanvas = document.createElement('canvas'); - var pageCtx = pageCanvas.getContext('2d'); - var pageHeight = pageSize.inner.height; - pageCanvas.width = canvas.width; - pageCanvas.height = pxPageHeight; - - // Initialize the PDF. - var pdf = new jsPDF(opt.jsPDF); - - for (var page=0; page pageTop && link.clientRect.top < pageTop + pageSize.inner.height) { - var left = opt.margin[1] + link.clientRect.left; - var top = opt.margin[0] + link.clientRect.top - pageTop; - pdf.link(left, top, link.clientRect.width, link.clientRect.height, { url: link.el.href }); - } - }); - } - } - - // Finish the PDF. - pdf.save( opt.filename ); - } - - - /* ---------- UTILS ---------- */ - - // Determine the type of a variable/object. - var objType = function(obj) { - if (typeof obj === 'undefined') return 'undefined'; - else if (typeof obj === 'string' || obj instanceof String) return 'string'; - else if (typeof obj === 'number' || obj instanceof Number) return 'number'; - else if (!!obj && obj.constructor === Array) return 'array'; - else if (obj && obj.nodeType === 1) return 'element'; - else if (typeof obj === 'object') return 'object'; - else return 'unknown'; - }; - - // Create an HTML element with optional className, innerHTML, and style. - var createElement = function(tagName, opt) { - var el = document.createElement(tagName); - if (opt.className) el.className = opt.className; - if (opt.innerHTML) { - el.innerHTML = opt.innerHTML; - var scripts = el.getElementsByTagName('script'); - for (var i = scripts.length; i-- > 0; null) { - scripts[i].parentNode.removeChild(scripts[i]); - } - } - for (var key in opt.style) { - el.style[key] = opt.style[key]; - } - return el; - }; - - // Deep-clone a node and preserve contents/properties. - var cloneNode = function(node, javascriptEnabled) { - // Recursively clone the node. - var clone = node.nodeType === 3 ? document.createTextNode(node.nodeValue) : node.cloneNode(false); - for (var child = node.firstChild; child; child = child.nextSibling) { - if (javascriptEnabled === true || child.nodeType !== 1 || child.nodeName !== 'SCRIPT') { - clone.appendChild(cloneNode(child, javascriptEnabled)); - } - } - - if (node.nodeType === 1) { - // Preserve contents/properties of special nodes. - if (node.nodeName === 'CANVAS') { - clone.width = node.width; - clone.height = node.height; - clone.getContext('2d').drawImage(node, 0, 0); - } else if (node.nodeName === 'TEXTAREA' || node.nodeName === 'SELECT') { - clone.value = node.value; - } - - // Preserve the node's scroll position when it loads. - clone.addEventListener('load', function() { - clone.scrollTop = node.scrollTop; - clone.scrollLeft = node.scrollLeft; - }, true); - } - - // Return the cloned node. - return clone; - } - - // Convert units using the conversion value 'k' from jsPDF. - var unitConvert = function(obj, k) { - var newObj = {}; - for (var key in obj) { - newObj[key] = obj[key] * 72 / 96 / k; - } - return newObj; - }; - - // Get dimensions of a PDF page, as determined by jsPDF. - jsPDF.getPageSize = function(orientation, unit, format) { - // Decode options object - if (typeof orientation === 'object') { - var options = orientation; - orientation = options.orientation; - unit = options.unit || unit; - format = options.format || format; - } - - // Default options - unit = unit || 'mm'; - format = format || 'a4'; - orientation = ('' + (orientation || 'P')).toLowerCase(); - var format_as_string = ('' + format).toLowerCase(); - - // Size in pt of various paper formats - var pageFormats = { - '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.40, 209.76], 'a9' : [ 104.88, 147.40], - 'a10' : [ 73.70, 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.90, 708.66], 'b6' : [ 354.33, 498.90], - '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] - }; - - // Unit conversion - var k; - switch (unit) { - case 'pt': k = 1; break; - case 'mm': k = 72 / 25.4; break; - case 'cm': k = 72 / 2.54; break; - case 'in': k = 72; break; - case 'px': k = 72 / 96; break; - case 'pc': k = 12; break; - case 'em': k = 12; break; - case 'ex': k = 6; break; - default: - throw ('Invalid unit: ' + unit); - } - - // Dimensions are stored as user units and converted to points on output - var pageHeight, pageWidth; - if (pageFormats.hasOwnProperty(format_as_string)) { - pageHeight = pageFormats[format_as_string][1] / k; - pageWidth = pageFormats[format_as_string][0] / k; - } else { - try { - pageHeight = format[1]; - pageWidth = format[0]; - } catch (err) { - throw new Error('Invalid format: ' + format); - } - } - - // Handle page orientation - if (orientation === 'p' || orientation === 'portrait') { - orientation = 'p'; - if (pageWidth > pageHeight) { - tmp = pageWidth; - pageWidth = pageHeight; - pageHeight = tmp; - } - } else if (orientation === 'l' || orientation === 'landscape') { - orientation = 'l'; - if (pageHeight > pageWidth) { - tmp = pageWidth; - pageWidth = pageHeight; - pageHeight = tmp; - } - } else { - throw('Invalid orientation: ' + orientation); - } - - // Return information (k is the unit conversion ratio from pts) - var info = { 'width': pageWidth, 'height': pageHeight, 'unit': unit, 'k': k }; - return info; - }; - - - // Expose the html2pdf function. - return html2pdf; -}(html2canvas, jsPDF)); diff --git a/hosting/static/hosting/js/html2pdf.min.js b/hosting/static/hosting/js/html2pdf.min.js new file mode 100644 index 00000000..deac0f69 --- /dev/null +++ b/hosting/static/hosting/js/html2pdf.min.js @@ -0,0 +1,6 @@ +/** + * html2pdf.js v0.8.2 + * Copyright (c) 2017 Erik Koopmans + * Released under the MIT License. + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("es6-promise/auto"),require("jspdf"),require("html2canvas")):"function"==typeof define&&define.amd?define(["es6-promise/auto","jspdf","html2canvas"],t):e.html2pdf=t(null,e.jsPDF,e.html2canvas)}(this,function(e,t,n){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t,n=n&&n.hasOwnProperty("default")?n.default:n;var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.getPageSize=function(e,t,n){if("object"===(void 0===e?"undefined":a(e))){var i=e;e=i.orientation,t=i.unit||t,n=i.format||n}t=t||"mm",n=n||"a4",e=(""+(e||"P")).toLowerCase();var r=(""+n).toLowerCase(),o={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]};switch(t){case"pt":l=1;break;case"mm":l=72/25.4;break;case"cm":l=72/2.54;break;case"in":l=72;break;case"px":l=.75;break;case"pc":case"em":l=12;break;case"ex":var l=6;break;default:throw"Invalid unit: "+t}if(o.hasOwnProperty(r))var c=o[r][1]/l,d=o[r][0]/l;else try{var c=n[1],d=n[0]}catch(e){throw new Error("Invalid format: "+n)}if("p"===e||"portrait"===e){if(e="p",d>c){s=d;d=c,c=s}}else{if("l"!==e&&"landscape"!==e)throw"Invalid orientation: "+e;if(e="l",c>d){var s=d;d=c,c=s}}return{width:d,height:c,unit:t,k:l}};var i=function(e){var t=void 0===e?"undefined":a(e);return"undefined"===t?"undefined":"string"===t||e instanceof String?"string":"number"===t||e instanceof Number?"number":"function"===t||e instanceof Function?"function":e&&e.constructor===Array?"array":e&&1===e.nodeType?"element":"object"===t?"object":"unknown"},r=function(e,t){var n=document.createElement(e);if(t.className&&(n.className=t.className),t.innerHTML){n.innerHTML=t.innerHTML;for(var a=n.getElementsByTagName("script"),i=a.length;i-- >0;null)a[i].parentNode.removeChild(a[i])}for(var r in t.style)n.style[r]=t.style[r];return n},o=function(e,t){var n={};for(var a in e)n[a]=72*e[a]/96/t;return n},l=function e(a,r){r="object"===i(r)?r:{};var a=e.parseInput(a,r),l=t.getPageSize(r.jsPDF);l.inner={width:l.width-r.margin[1]-r.margin[3],height:l.height-r.margin[0]-r.margin[2]},l.inner.ratio=l.inner.height/l.inner.width;var c=e.makeContainer(a,l),d=c.parentElement;if(r.enableLinks){r.links=[];var s=c.querySelectorAll("a"),m=o(c.getBoundingClientRect(),l.k);Array.prototype.forEach.call(s,function(e){for(var t=e.getClientRects(),n=0;ng&&e.clientRect.top Date: Wed, 7 Feb 2018 19:30:53 +0530 Subject: [PATCH 10/10] Update order_detail.html --- hosting/templates/hosting/order_detail.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index fe59dede..a8cd58c1 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -217,7 +217,7 @@ {% if order %} - + {% endif %} {% endblock js_extra %}