MailPoet Newsletters (New) - Version 3.14.0

Version Description

  • 2018-11-13 =
  • Added: readme clarified to show we do not support multisite;
  • Added: retina-friendly icon;
  • Added: expanded GDPR information in plugin UI;
  • Added: ten new fonts for use in emails;
  • Improved: post notification email logic;
  • Fixed: new post notification templates aren't sent without posts;
  • Fixed: missing space in listings returned after brief hiatus;
  • Fixed: pausing post notification history items to not prevent further post notifications from being sent; Thanks, Mathieu!
  • Fixed: JS errors on emails page.
Download this release

Release Info

Developer wysija
Plugin Icon 128x128 MailPoet Newsletters (New)
Version 3.14.0
Comparing to
See all releases

Code changes from version 3.13.0 to 3.14.0

assets/css/admin-global.673373a1.css DELETED
@@ -1,35 +0,0 @@
1
- @font-face {
2
- font-family: 'mailpoet';
3
- src: url("../fonts/mailpoet.ttf?mx0b6n") format('truetype'), url("../fonts/mailpoet.woff?mx0b6n") format('woff'), url("../fonts/mailpoet.svg?mx0b6n#mailpoet") format('svg');
4
- font-weight: normal;
5
- font-style: normal;
6
- }
7
- [class^="mailpoet-icon-"],
8
- [class*=" mailpoet-icon-"] {
9
- font-family: 'mailpoet' !important;
10
- speak: none;
11
- font-style: normal;
12
- font-weight: normal;
13
- font-variant: normal;
14
- text-transform: none;
15
- line-height: 1;
16
- /* Better Font Rendering =========== */
17
- -webkit-font-smoothing: antialiased;
18
- -moz-osx-font-smoothing: grayscale;
19
- }
20
- .mailpoet-icon-logo:before {
21
- content: "\e900";
22
- }
23
- /*
24
- Style for Members plugin
25
- */
26
- .members-tab-title .mailpoet-icon-logo {
27
- vertical-align: middle;
28
- height: 20px;
29
- width: 20px;
30
- font-size: 20px;
31
- margin-right: 3px;
32
- }
33
- #wpbody {
34
- padding-bottom: 20px;
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/admin-global.bcd24dab.css ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'mailpoet';
3
+ src: url("../fonts/mailpoet.ttf?mx0b6n") format('truetype'), url("../fonts/mailpoet.woff?mx0b6n") format('woff'), url("../fonts/mailpoet.svg?mx0b6n#mailpoet") format('svg');
4
+ font-weight: normal;
5
+ font-style: normal;
6
+ }
7
+ [class^="mailpoet-icon-"],
8
+ [class*=" mailpoet-icon-"] {
9
+ font-family: 'mailpoet' !important;
10
+ speak: none;
11
+ font-style: normal;
12
+ font-weight: normal;
13
+ font-variant: normal;
14
+ text-transform: none;
15
+ line-height: 1;
16
+ /* Better Font Rendering =========== */
17
+ -webkit-font-smoothing: antialiased;
18
+ -moz-osx-font-smoothing: grayscale;
19
+ }
20
+ .mailpoet-icon-logo:before {
21
+ content: "\e900";
22
+ }
23
+ /*
24
+ Style for Members plugin
25
+ */
26
+ .members-tab-title .mailpoet-icon-logo {
27
+ vertical-align: middle;
28
+ height: 20px;
29
+ width: 20px;
30
+ font-size: 20px;
31
+ margin-right: 3px;
32
+ }
33
+ #wpbody {
34
+ padding-bottom: 20px;
35
+ }
36
+ /* menu icon */
37
+ #adminmenu #toplevel_page_mailpoet-newsletters .wp-menu-image {
38
+ -webkit-background-size: 18px 18px;
39
+ -moz-background-size: 18px 18px;
40
+ background-size: 18px 18px;
41
+ background-repeat: no-repeat;
42
+ background-position: center;
43
+ }
44
+ #adminmenu #toplevel_page_mailpoet-newsletters.wp-not-current-submenu .wp-menu-image {
45
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABcFJREFUeNrsWHtsU1UYP7e37/W9MDYYInSosI6XEBhjgxEEDBI0GNTEGFFgEkR5iEGFsChBghJgSwBh4RElGhN1iQy2MF5jjMfYg40NeQxhjiEra2nXrrfry98pt1hqW1hj+YuTfOm95/R8/Z1zvu/3/U4ZEqV9uX7jZH3akAKXy5UR6NPpEjdtWJe/vurUSVO0uROyssmq1fnTTabOPXhN4bs5oVC476/Wmx98tnJZ2HkCEr2tgRmCO8xm09JPVq2emT0pN+pEj8czjmGYrXhMDuqWwmbBZkea9yhAOhgT3OHz+VisMlcgEPSNNCkrexIBaAN257nQ+WhimDZWQGEbVp7ldDoHRxoH4CSpVJoJ8EwkF/8rIBybfsmyFZkTcyaHHec4BwWbFYvvmAB5vV5WpVKPk0pl/f8TzBNzyOKPlmeYzeYhTwwQ316y220ZoZ1yeUKiVqcb6/V62CcK6J7ZrH1/4SIDDeDgZrPZRuPj1Vj9xgzI7XaT5JR+L2o02pR/uSeHvDc/b7jl3r0+fFcPzBpPQF0UC59pxOf1vtzVZR3/gCMSE5P7pw4YDSINdN2GVccTUCXsz8CL1WpRz33r7VE0kP3vFssoxM5UP1ifj0gkkssqtXo/kiBugDpgJ2Gd/vPo6SGD9PpMpVKZlp4xnMx5480RAJlEx2QyGamtOd+4vXBrk1qtjg8grFSGdC8B6V2lO0B3wuN2jzcajQaFQiF6/oWhIylInhxvddz5+/CF+lqhWCyJDyCVSiXbt6foZE31uYt0B/xZ1dWlmDlr9rPTZswcZ+rszAo6ritqtaZSLBYr6XtcAEkkUvbc2aru1tabx0Ui8V3ahxJChqVnTIMtxXOqv4JKZc7a2vOnyw4dsCtVKnHcghor9QGUBjFRhh24GDg2p5ObBHuFPvurp1jceuP69WOX/7hEpPxOxo2HECuSyooTd+sQsYilQPrI6QbyoOlxNau1Wn+6+3qRYTEBksvlpLmpkVxqvngEP9waOg6Q9gv1dVUnjh6xxIOpQ+sRi0zzz9FoNKeRPfXBAUufcZw3rrdcrairqY4kNZgwfh8bkDso5UlCgqJbKBI56Hv12TOWlmtXypFJrgAoxBdpbKivaaivawxmi4dWxLJSHLs9opaKejwJCfuVShXrcvUkyWRyY8WJo7+2t7X5s6v63BnCObniBXmLdYPT0qY7OQ5lTXfl4IHinRizB4m1FnDXUfgYLWBZH+rcscNlpRHLCRMN0OzXXhf0SUqaAH08EGzcCg6qgkNP8HcoQ+dOmTrMbrdDJcpq62qrrWeqTj0YH/DMQPiZMxDj07E75HZ7+5GS34tbyNP2tMWpMajQ9HMQLPV+WgobQHyWJwVgaLpB6/V40vkEa2eKD5bT28EO2JT7qS5f9/nK5b+ZOu8aeQka6e5luXWrjbPbbOHogqSmDpBD5ioiZDLtk4HD+mzYtGWuw8GtCAhAZu/+n9fiIT+EbTmBgK3kBZkvDJl61FrN2aId205VVVbcMBo7zJAhJEGhIH2TkhPHjs9MW/Thx9m4CNBbiSiEHH18n97r844BjZBAUfYj/f6nXz4Fz3wdg1jz7wR4quCHfbsLSksOtE2dNkM/b37eEmPHnTzwDoPrdu9j6JvNhfq+ySk/AuVQAFP01gHdURTU02KJZBfU4rucw5ETvOLHLqosS9n9mn/mxs2FVMOsBvcvwKrUvJSIVAAZgBA+jgqkwGDuMMceXOc4+OoymTp343ntQ0vZ8O0WOerODBzHFP5vFCaMAwlEl0EkEvWjei0KGKfb7Wp3dDua6I+GCQkKsgPfO9btsB9auXSJ7ZG1LFJ7Z958FXT0FxzHLQQoTRgwVmilbeVlpWuKdm5z98Z3TPdv3CScKKTlGcNHeHEpzAlRDU7c79eXHirJ371ru7e3vtlYCa3hQh2VqjdHjhpjgLh/8E8HVMFxVPOv9hZ9Z43F7z8CDAAMFFaTyVAO5gAAAABJRU5ErkJggg==");
46
+ }
47
+ #adminmenu #toplevel_page_mailpoet-newsletters.wp-has-current-submenu .wp-menu-image {
48
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAa9JREFUeNrsWO2NgkAUnGeuAErgOuAq0A7YDs4OtIPLVWCsQK8CtQJKkA6kA+lg7s+a4Mp+HLtgLnESfoDsY3gz77FPwAKSGckD71GRzBAAkorkxVi/wVCQXLIfu4C1GcmrZX3hWjtz/JZbrquALCkAtnuyoYTgCKg895RDlZkNXFe65AognJyQS7bBZGIIuR5cPotQmVqu6AyRzD1Za8YmVHsImFnbjk3oxzj/dMjV9LxAckJ747zoyKY85NMTEpEWwNEi28pDfjRTm2++0lnqfqNqEWkmISQiRwCt8c37SiFXTNmbcixTyBVDyJWBo/badIREpHaU9OlZnbovS62I7MciZFZJ2+OT1uOdNiDuHd5cXgAw7+wct2ZPIvnRMXRjZkdEapLfOg4AnIa2gxde+L8gmesJtSK5nvjZiuRZHwsAEJIXYyisdbetLX3kVuKNZxQq9GGbTuYAFsa1d3A4ziSVQWTR83/AX7CEDhyDg57lN5FxriRzJAwWg+phgtHm3iTIWCguJHc3M8dURhHgkwd/TVGya5unntnDqh5CWUzMWSQnc5O2j9m+AsDvAIQNSWYrVntNAAAAAElFTkSuQmCC");
49
+ }
50
+ #adminmenu #toplevel_page_mailpoet-newsletters a:hover .wp-menu-image {
51
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAa9JREFUeNrsWO2NgkAUnGeuAErgOuAq0A7YDs4OtIPLVWCsQK8CtQJKkA6kA+lg7s+a4Mp+HLtgLnESfoDsY3gz77FPwAKSGckD71GRzBAAkorkxVi/wVCQXLIfu4C1GcmrZX3hWjtz/JZbrquALCkAtnuyoYTgCKg895RDlZkNXFe65AognJyQS7bBZGIIuR5cPotQmVqu6AyRzD1Za8YmVHsImFnbjk3oxzj/dMjV9LxAckJ747zoyKY85NMTEpEWwNEi28pDfjRTm2++0lnqfqNqEWkmISQiRwCt8c37SiFXTNmbcixTyBVDyJWBo/badIREpHaU9OlZnbovS62I7MciZFZJ2+OT1uOdNiDuHd5cXgAw7+wct2ZPIvnRMXRjZkdEapLfOg4AnIa2gxde+L8gmesJtSK5nvjZiuRZHwsAEJIXYyisdbetLX3kVuKNZxQq9GGbTuYAFsa1d3A4ziSVQWTR83/AX7CEDhyDg57lN5FxriRzJAwWg+phgtHm3iTIWCguJHc3M8dURhHgkwd/TVGya5unntnDqh5CWUzMWSQnc5O2j9m+AsDvAIQNSWYrVntNAAAAAElFTkSuQmCC");
52
+ }
assets/css/{admin.b559a0fe.css → admin.e99a5857.css} RENAMED
@@ -1496,14 +1496,28 @@ body.mailpoet_modal_opened {
1496
  }
1497
  }
1498
  #mailpoet_loading {
1499
- width: 150px;
1500
- height: 32px;
1501
  position: relative;
1502
  left: 50%;
1503
  top: 50%;
1504
  margin-left: -75px;
1505
  margin-top: -16px;
1506
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1507
  .mailpoet_modal_loading {
1508
  -webkit-animation-direction: linear;
1509
  -moz-animation-direction: linear;
@@ -1527,26 +1541,28 @@ body.mailpoet_modal_opened {
1527
  animation-name: bounce_mailpoet_modal_loading;
1528
  border-radius: 21px;
1529
  background-color: #e01d4e;
1530
- float: left;
1531
  height: 32px;
1532
  margin-left: 17px;
1533
  width: 32px;
1534
  }
1535
- #mailpoet_modal_loading_1 {
 
1536
  -webkit-animation-delay: 0.39s;
1537
  -moz-animation-delay: 0.39s;
1538
  -o-animation-delay: 0.39s;
1539
  -ms-animation-delay: 0.39s;
1540
  animation-delay: 0.39s;
1541
  }
1542
- #mailpoet_modal_loading_2 {
 
1543
  -webkit-animation-delay: 0.91s;
1544
  -moz-animation-delay: 0.91s;
1545
  -o-animation-delay: 0.91s;
1546
  -ms-animation-delay: 0.91s;
1547
  animation-delay: 0.91s;
1548
  }
1549
- #mailpoet_modal_loading_3 {
 
1550
  -webkit-animation-delay: 1.17s;
1551
  -moz-animation-delay: 1.17s;
1552
  -o-animation-delay: 1.17s;
@@ -4533,6 +4549,31 @@ tr.introjs-showElement > th {
4533
  box-shadow: 0 0 0 0 rgba(255,83,1,0);
4534
  }
4535
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4536
  .mailpoet-discount-container {
4537
  margin: 15px;
4538
  padding: 20px;
1496
  }
1497
  }
1498
  #mailpoet_loading {
 
 
1499
  position: relative;
1500
  left: 50%;
1501
  top: 50%;
1502
  margin-left: -75px;
1503
  margin-top: -16px;
1504
  }
1505
+ .mailpoet_loading {
1506
+ height: 32px;
1507
+ width: 150px;
1508
+ display: -webkit-box;
1509
+ display: -moz-box;
1510
+ display: -webkit-flex;
1511
+ display: -ms-flexbox;
1512
+ display: box;
1513
+ display: flex;
1514
+ -webkit-box-orient: horizontal;
1515
+ -moz-box-orient: horizontal;
1516
+ -o-box-orient: horizontal;
1517
+ -webkit-flex-direction: row;
1518
+ -ms-flex-direction: row;
1519
+ flex-direction: row;
1520
+ }
1521
  .mailpoet_modal_loading {
1522
  -webkit-animation-direction: linear;
1523
  -moz-animation-direction: linear;
1541
  animation-name: bounce_mailpoet_modal_loading;
1542
  border-radius: 21px;
1543
  background-color: #e01d4e;
 
1544
  height: 32px;
1545
  margin-left: 17px;
1546
  width: 32px;
1547
  }
1548
+ #mailpoet_modal_loading_1,
1549
+ .mailpoet_modal_loading_1 {
1550
  -webkit-animation-delay: 0.39s;
1551
  -moz-animation-delay: 0.39s;
1552
  -o-animation-delay: 0.39s;
1553
  -ms-animation-delay: 0.39s;
1554
  animation-delay: 0.39s;
1555
  }
1556
+ #mailpoet_modal_loading_2,
1557
+ .mailpoet_modal_loading_2 {
1558
  -webkit-animation-delay: 0.91s;
1559
  -moz-animation-delay: 0.91s;
1560
  -o-animation-delay: 0.91s;
1561
  -ms-animation-delay: 0.91s;
1562
  animation-delay: 0.91s;
1563
  }
1564
+ #mailpoet_modal_loading_3,
1565
+ .mailpoet_modal_loading_3 {
1566
  -webkit-animation-delay: 1.17s;
1567
  -moz-animation-delay: 1.17s;
1568
  -o-animation-delay: 1.17s;
4549
  box-shadow: 0 0 0 0 rgba(255,83,1,0);
4550
  }
4551
  }
4552
+ .newsletter_congratulate_page {
4553
+ margin-top: 30px;
4554
+ }
4555
+ .mailpoet_newsletter_loading {
4556
+ text-align: center;
4557
+ }
4558
+ .mailpoet_newsletter_loading .mailpoet_loading {
4559
+ margin: 100px auto 0 auto;
4560
+ }
4561
+ .mailpoet_newsletter_loading .mailpoet_newsletter_loading_header {
4562
+ margin: 30px;
4563
+ }
4564
+ .mailpoet_congratulate_success {
4565
+ width: 100%;
4566
+ }
4567
+ .mailpoet_congratulate_success h1 {
4568
+ text-align: center;
4569
+ margin-bottom: 30px;
4570
+ }
4571
+ .mailpoet_congratulate_success img,
4572
+ .mailpoet_congratulate_success .button {
4573
+ margin-left: auto;
4574
+ margin-right: auto;
4575
+ display: block;
4576
+ }
4577
  .mailpoet-discount-container {
4578
  margin: 15px;
4579
  padding: 20px;
assets/css/manifest.json CHANGED
@@ -1,8 +1,8 @@
1
  {
2
- "admin-global.css": "admin-global.673373a1.css",
3
- "admin.css": "admin.b559a0fe.css",
4
  "importExport.css": "importExport.b3745466.css",
5
- "newsletter_editor.css": "newsletter_editor.91a99b96.css",
6
  "public.css": "public.cae357df.css",
7
  "rtl.css": "rtl.58324dad.css"
8
  }
1
  {
2
+ "admin-global.css": "admin-global.bcd24dab.css",
3
+ "admin.css": "admin.e99a5857.css",
4
  "importExport.css": "importExport.b3745466.css",
5
+ "newsletter_editor.css": "newsletter_editor.5b5c9654.css",
6
  "public.css": "public.cae357df.css",
7
  "rtl.css": "rtl.58324dad.css"
8
  }
assets/css/{newsletter_editor.91a99b96.css → newsletter_editor.5b5c9654.css} RENAMED
@@ -1271,6 +1271,31 @@ select.mailpoet_font-size {
1271
  input.mailpoet_option_offset_left_small {
1272
  margin-left: 10px !important;
1273
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1274
  #mailpoet_editor {
1275
  width: 100%;
1276
  clear: both;
@@ -1549,7 +1574,7 @@ input.mailpoet_option_offset_left_small {
1549
  vertical-align: middle;
1550
  }
1551
  #mailpoet_editor_bottom {
1552
- margin: 10px 0 70px;
1553
  }
1554
  .mailpoet_save_wrapper {
1555
  float: right;
@@ -1557,6 +1582,9 @@ input.mailpoet_option_offset_left_small {
1557
  margin-right: 20px;
1558
  margin-bottom: 10px;
1559
  }
 
 
 
1560
  .mailpoet_save_options {
1561
  -webkit-border-radius: 3px;
1562
  -moz-border-radius: 3px;
@@ -1593,6 +1621,8 @@ input.mailpoet_option_offset_left_small {
1593
  }
1594
  .mailpoet_save_show_options_icon {
1595
  vertical-align: middle;
 
 
1596
  }
1597
  .mailpoet_save_as_template_container,
1598
  .mailpoet_export_template_container {
@@ -1613,15 +1643,25 @@ input.mailpoet_option_offset_left_small {
1613
  .mailpoet_export_template_title {
1614
  font-size: 1.1em;
1615
  }
 
 
 
 
 
 
 
 
1616
  .mailpoet_editor_last_saved {
1617
  color: #a4a4a4;
1618
  font-size: 0.9em;
1619
- position: absolute;
1620
- right: 0;
1621
  margin-top: 10px;
 
1622
  }
1623
  .mailpoet_save_error {
 
 
1624
  color: #d54e21;
 
1625
  }
1626
  .mailpoet_save_dropdown_down .mailpoet_save_options,
1627
  .mailpoet_save_dropdown_down .mailpoet_save_as_template_container,
1271
  input.mailpoet_option_offset_left_small {
1272
  margin-left: 10px !important;
1273
  }
1274
+ .mailpoet_form_field span.select2-container {
1275
+ width: 103px !important;
1276
+ }
1277
+ span.select2-container--open > span.select2-dropdown {
1278
+ width: 150px !important;
1279
+ }
1280
+ span.select2-container--open > span.select2-dropdown li.select2-results__option {
1281
+ font-size: 13px;
1282
+ margin: 0px !important;
1283
+ }
1284
+ span.select2-container--open > span.select2-dropdown li.select2-results__option .select2-results__group {
1285
+ font-weight: normal;
1286
+ color: #bfbfbf;
1287
+ }
1288
+ span.select2-container--open > span.select2-dropdown li.select2-results__option .select2-results__option {
1289
+ padding-left: 15px;
1290
+ font-size: 13px;
1291
+ }
1292
+ span.select2-container--open > span.select2-dropdown li.select2-results__option .select2-results__option[aria-selected=true] {
1293
+ background-color: #eee;
1294
+ color: #444;
1295
+ }
1296
+ .mailpoet-fonts-notice {
1297
+ color: #999;
1298
+ }
1299
  #mailpoet_editor {
1300
  width: 100%;
1301
  clear: both;
1574
  vertical-align: middle;
1575
  }
1576
  #mailpoet_editor_bottom {
1577
+ margin: 10px 0 120px;
1578
  }
1579
  .mailpoet_save_wrapper {
1580
  float: right;
1582
  margin-right: 20px;
1583
  margin-bottom: 10px;
1584
  }
1585
+ .mailpoet_save_wrapper .mailpoet_save_next {
1586
+ margin-left: 5px;
1587
+ }
1588
  .mailpoet_save_options {
1589
  -webkit-border-radius: 3px;
1590
  -moz-border-radius: 3px;
1621
  }
1622
  .mailpoet_save_show_options_icon {
1623
  vertical-align: middle;
1624
+ height: 14px;
1625
+ margin-top: -6px;
1626
  }
1627
  .mailpoet_save_as_template_container,
1628
  .mailpoet_export_template_container {
1643
  .mailpoet_export_template_title {
1644
  font-size: 1.1em;
1645
  }
1646
+ .mailpoet_save_next,
1647
+ .mailpoet_save_button_group {
1648
+ float: right;
1649
+ }
1650
+ .mailpoet_editor_messages {
1651
+ position: absolute;
1652
+ right: 0;
1653
+ }
1654
  .mailpoet_editor_last_saved {
1655
  color: #a4a4a4;
1656
  font-size: 0.9em;
 
 
1657
  margin-top: 10px;
1658
+ text-align: right;
1659
  }
1660
  .mailpoet_save_error {
1661
+ margin-top: 10px;
1662
+ width: 310px;
1663
  color: #d54e21;
1664
+ text-align: right;
1665
  }
1666
  .mailpoet_save_dropdown_down .mailpoet_save_options,
1667
  .mailpoet_save_dropdown_down .mailpoet_save_as_template_container,
assets/img/mailpoet_logo.png DELETED
Binary file
assets/img/menu_icon.png DELETED
Binary file
assets/img/newsletter/congrat-illu-success.png ADDED
Binary file
assets/img/newsletter/congratulation-page-illustration-transparent-LQ.png ADDED
Binary file
assets/img/newsletter/index.php ADDED
File without changes
assets/js/{admin.ebf7dd89.js → admin.31a4291b.js} RENAMED
@@ -1,6 +1,5 @@
1
- webpackJsonp([2],{
2
-
3
- /***/ 22:
4
  /***/ (function(module, exports) {
5
 
6
  if (typeof Object.create === 'function') {
@@ -29,2610 +28,2661 @@ if (typeof Object.create === 'function') {
29
 
30
 
31
  /***/ }),
32
-
33
- /***/ 226:
 
 
 
 
 
 
 
 
34
  /***/ (function(module, exports, __webpack_require__) {
35
 
36
  "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
 
 
 
 
38
 
39
- var _propTypes = __webpack_require__(3);
40
-
41
- var _propTypes2 = _interopRequireDefault(_propTypes);
42
-
43
- var _react = __webpack_require__(2);
44
 
45
- var _react2 = _interopRequireDefault(_react);
46
 
47
- var _reactTooltip = __webpack_require__(232);
48
 
49
- var _reactTooltip2 = _interopRequireDefault(_reactTooltip);
 
50
 
51
- var _reactHtmlParser = __webpack_require__(416);
 
 
 
 
 
 
 
52
 
53
- var _reactHtmlParser2 = _interopRequireDefault(_reactHtmlParser);
54
 
55
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
56
 
57
- function Tooltip(props) {
58
- var tooltipId = props.tooltipId;
59
- var tooltip = props.tooltip;
60
- // tooltip ID must be unique, defaults to tooltip text
61
- if (!props.tooltipId && typeof props.tooltip === 'string') {
62
- tooltipId = props.tooltip;
63
- }
64
 
65
- if (typeof props.tooltip === 'string') {
66
- tooltip = _react2.default.createElement(
67
- 'span',
68
- {
69
- style: {
70
- pointerEvents: 'all',
71
- maxWidth: '400px',
72
- display: 'inline-block'
73
- }
74
- },
75
- (0, _reactHtmlParser2.default)(props.tooltip)
76
- );
77
- }
78
 
79
- return _react2.default.createElement(
80
- 'span',
81
- { className: props.className },
82
- _react2.default.createElement('span', {
83
- style: {
84
- cursor: 'pointer'
85
- },
86
- className: 'tooltip dashicons dashicons-editor-help',
87
- 'data-event': 'click',
88
- 'data-tip': true,
89
- 'data-for': tooltipId
90
- }),
91
- _react2.default.createElement(
92
- _reactTooltip2.default,
93
- {
94
- globalEventOff: 'click',
95
- multiline: true,
96
- id: tooltipId,
97
- efect: 'solid',
98
- place: props.place
99
- },
100
- tooltip
101
- )
102
- );
103
  }
104
 
105
- Tooltip.propTypes = {
106
- tooltipId: _propTypes2.default.string,
107
- tooltip: _propTypes2.default.node.isRequired,
108
- place: _propTypes2.default.string,
109
- className: _propTypes2.default.string
110
- };
111
 
112
- Tooltip.defaultProps = {
113
- tooltipId: undefined,
114
- place: undefined,
115
- className: undefined
116
- };
117
 
118
- module.exports = Tooltip;
119
 
120
- /***/ }),
121
 
122
- /***/ 258:
123
- /***/ (function(module, exports, __webpack_require__) {
124
 
125
- var Tokenizer = __webpack_require__(259);
 
126
 
127
- /*
128
- Options:
 
 
 
129
 
130
- xmlMode: Disables the special behavior for script/style tags (false by default)
131
- lowerCaseAttributeNames: call .toLowerCase for each attribute name (true if xmlMode is `false`)
132
- lowerCaseTags: call .toLowerCase for each tag name (true if xmlMode is `false`)
133
- */
134
 
135
- /*
136
- Callbacks:
 
137
 
138
- oncdataend,
139
- oncdatastart,
140
- onclosetag,
141
- oncomment,
142
- oncommentend,
143
- onerror,
144
- onopentag,
145
- onprocessinginstruction,
146
- onreset,
147
- ontext
148
- */
 
 
149
 
150
- var formTags = {
151
- input: true,
152
- option: true,
153
- optgroup: true,
154
- select: true,
155
- button: true,
156
- datalist: true,
157
- textarea: true
158
- };
159
 
160
- var openImpliesClose = {
161
- tr : { tr:true, th:true, td:true },
162
- th : { th:true },
163
- td : { thead:true, th:true, td:true },
164
- body : { head:true, link:true, script:true },
165
- li : { li:true },
166
- p : { p:true },
167
- h1 : { p:true },
168
- h2 : { p:true },
169
- h3 : { p:true },
170
- h4 : { p:true },
171
- h5 : { p:true },
172
- h6 : { p:true },
173
- select : formTags,
174
- input : formTags,
175
- output : formTags,
176
- button : formTags,
177
- datalist: formTags,
178
- textarea: formTags,
179
- option : { option:true },
180
- optgroup: { optgroup:true }
181
  };
182
 
183
- var voidElements = {
184
- __proto__: null,
185
- area: true,
186
- base: true,
187
- basefont: true,
188
- br: true,
189
- col: true,
190
- command: true,
191
- embed: true,
192
- frame: true,
193
- hr: true,
194
- img: true,
195
- input: true,
196
- isindex: true,
197
- keygen: true,
198
- link: true,
199
- meta: true,
200
- param: true,
201
- source: true,
202
- track: true,
203
- wbr: true,
204
 
205
- //common self closing svg elements
206
- path: true,
207
- circle: true,
208
- ellipse: true,
209
- line: true,
210
- rect: true,
211
- use: true,
212
- stop: true,
213
- polyline: true,
214
- polygon: true
215
- };
216
 
217
- var re_nameEnd = /\s|\//;
 
218
 
219
- function Parser(cbs, options){
220
- this._options = options || {};
221
- this._cbs = cbs || {};
 
 
222
 
223
- this._tagname = "";
224
- this._attribname = "";
225
- this._attribvalue = "";
226
- this._attribs = null;
227
- this._stack = [];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
 
229
- this.startIndex = 0;
230
- this.endIndex = null;
231
 
232
- this._lowerCaseTagNames = "lowerCaseTags" in this._options ?
233
- !!this._options.lowerCaseTags :
234
- !this._options.xmlMode;
235
- this._lowerCaseAttributeNames = "lowerCaseAttributeNames" in this._options ?
236
- !!this._options.lowerCaseAttributeNames :
237
- !this._options.xmlMode;
238
 
239
- if(this._options.Tokenizer) {
240
- Tokenizer = this._options.Tokenizer;
241
- }
242
- this._tokenizer = new Tokenizer(this._options, this);
243
 
244
- if(this._cbs.onparserinit) this._cbs.onparserinit(this);
245
- }
 
 
 
 
 
 
246
 
247
- __webpack_require__(22)(Parser, __webpack_require__(55).EventEmitter);
 
 
 
 
 
 
 
 
 
248
 
249
- Parser.prototype._updatePosition = function(initialOffset){
250
- if(this.endIndex === null){
251
- if(this._tokenizer._sectionStart <= initialOffset){
252
- this.startIndex = 0;
253
- } else {
254
- this.startIndex = this._tokenizer._sectionStart - initialOffset;
255
- }
256
  }
257
- else this.startIndex = this.endIndex + 1;
258
- this.endIndex = this._tokenizer.getAbsoluteIndex();
259
  };
260
 
261
- //Tokenizer event handlers
262
- Parser.prototype.ontext = function(data){
263
- this._updatePosition(1);
264
- this.endIndex--;
265
-
266
- if(this._cbs.ontext) this._cbs.ontext(data);
267
- };
268
 
269
- Parser.prototype.onopentagname = function(name){
270
- if(this._lowerCaseTagNames){
271
- name = name.toLowerCase();
272
- }
273
 
274
- this._tagname = name;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
275
 
276
- if(!this._options.xmlMode && name in openImpliesClose) {
277
- for(
278
- var el;
279
- (el = this._stack[this._stack.length - 1]) in openImpliesClose[name];
280
- this.onclosetag(el)
281
- );
282
- }
283
 
284
- if(this._options.xmlMode || !(name in voidElements)){
285
- this._stack.push(name);
286
- }
 
 
 
 
287
 
288
- if(this._cbs.onopentagname) this._cbs.onopentagname(name);
289
- if(this._cbs.onopentag) this._attribs = {};
290
- };
 
291
 
292
- Parser.prototype.onopentagend = function(){
293
- this._updatePosition(1);
 
 
294
 
295
- if(this._attribs){
296
- if(this._cbs.onopentag) this._cbs.onopentag(this._tagname, this._attribs);
297
- this._attribs = null;
298
- }
299
 
300
- if(!this._options.xmlMode && this._cbs.onclosetag && this._tagname in voidElements){
301
- this._cbs.onclosetag(this._tagname);
302
- }
 
303
 
304
- this._tagname = "";
305
- };
 
 
306
 
307
- Parser.prototype.onclosetag = function(name){
308
- this._updatePosition(1);
 
 
309
 
310
- if(this._lowerCaseTagNames){
311
- name = name.toLowerCase();
312
- }
 
313
 
314
- if(this._stack.length && (!(name in voidElements) || this._options.xmlMode)){
315
- var pos = this._stack.lastIndexOf(name);
316
- if(pos !== -1){
317
- if(this._cbs.onclosetag){
318
- pos = this._stack.length - pos;
319
- while(pos--) this._cbs.onclosetag(this._stack.pop());
320
- }
321
- else this._stack.length = pos;
322
- } else if(name === "p" && !this._options.xmlMode){
323
- this.onopentagname(name);
324
- this._closeCurrentTag();
325
- }
326
- } else if(!this._options.xmlMode && (name === "br" || name === "p")){
327
- this.onopentagname(name);
328
- this._closeCurrentTag();
329
- }
330
- };
331
 
332
- Parser.prototype.onselfclosingtag = function(){
333
- if(this._options.xmlMode || this._options.recognizeSelfClosing){
334
- this._closeCurrentTag();
335
- } else {
336
- this.onopentagend();
337
- }
338
- };
339
 
340
- Parser.prototype._closeCurrentTag = function(){
341
- var name = this._tagname;
 
 
342
 
343
- this.onopentagend();
 
 
 
344
 
345
- //self-closing tags will be on the top of the stack
346
- //(cheaper check than in onclosetag)
347
- if(this._stack[this._stack.length - 1] === name){
348
- if(this._cbs.onclosetag){
349
- this._cbs.onclosetag(name);
350
- }
351
- this._stack.pop();
352
- }
353
- };
354
-
355
- Parser.prototype.onattribname = function(name){
356
- if(this._lowerCaseAttributeNames){
357
- name = name.toLowerCase();
358
- }
359
- this._attribname = name;
360
- };
361
 
362
- Parser.prototype.onattribdata = function(value){
363
- this._attribvalue += value;
364
- };
 
 
 
 
 
 
365
 
366
- Parser.prototype.onattribend = function(){
367
- if(this._cbs.onattribute) this._cbs.onattribute(this._attribname, this._attribvalue);
368
- if(
369
- this._attribs &&
370
- !Object.prototype.hasOwnProperty.call(this._attribs, this._attribname)
371
- ){
372
- this._attribs[this._attribname] = this._attribvalue;
373
- }
374
- this._attribname = "";
375
- this._attribvalue = "";
376
- };
377
 
378
- Parser.prototype._getInstructionName = function(value){
379
- var idx = value.search(re_nameEnd),
380
- name = idx < 0 ? value : value.substr(0, idx);
381
 
382
- if(this._lowerCaseTagNames){
383
- name = name.toLowerCase();
384
- }
385
 
386
- return name;
387
- };
 
 
 
 
 
 
 
 
 
388
 
389
- Parser.prototype.ondeclaration = function(value){
390
- if(this._cbs.onprocessinginstruction){
391
- var name = this._getInstructionName(value);
392
- this._cbs.onprocessinginstruction("!" + name, "!" + value);
393
- }
394
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
395
 
396
- Parser.prototype.onprocessinginstruction = function(value){
397
- if(this._cbs.onprocessinginstruction){
398
- var name = this._getInstructionName(value);
399
- this._cbs.onprocessinginstruction("?" + name, "?" + value);
400
- }
401
- };
402
 
403
- Parser.prototype.oncomment = function(value){
404
- this._updatePosition(4);
405
 
406
- if(this._cbs.oncomment) this._cbs.oncomment(value);
407
- if(this._cbs.oncommentend) this._cbs.oncommentend();
408
- };
409
 
410
- Parser.prototype.oncdata = function(value){
411
- this._updatePosition(1);
 
412
 
413
- if(this._options.xmlMode || this._options.recognizeCDATA){
414
- if(this._cbs.oncdatastart) this._cbs.oncdatastart();
415
- if(this._cbs.ontext) this._cbs.ontext(value);
416
- if(this._cbs.oncdataend) this._cbs.oncdataend();
417
- } else {
418
- this.oncomment("[CDATA[" + value + "]]");
419
- }
420
  };
421
 
422
- Parser.prototype.onerror = function(err){
423
- if(this._cbs.onerror) this._cbs.onerror(err);
424
- };
425
 
426
- Parser.prototype.onend = function(){
427
- if(this._cbs.onclosetag){
428
- for(
429
- var i = this._stack.length;
430
- i > 0;
431
- this._cbs.onclosetag(this._stack[--i])
432
- );
433
- }
434
- if(this._cbs.onend) this._cbs.onend();
435
- };
436
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
 
438
- //Resets the parser to a blank state, ready to parse a new HTML document
439
- Parser.prototype.reset = function(){
440
- if(this._cbs.onreset) this._cbs.onreset();
441
- this._tokenizer.reset();
442
 
443
- this._tagname = "";
444
- this._attribname = "";
445
- this._attribs = null;
446
- this._stack = [];
447
 
448
- if(this._cbs.onparserinit) this._cbs.onparserinit(this);
449
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450
 
451
- //Parses a complete HTML document and pushes it to the handler
452
- Parser.prototype.parseComplete = function(data){
453
- this.reset();
454
- this.end(data);
455
  };
456
 
457
- Parser.prototype.write = function(chunk){
458
- this._tokenizer.write(chunk);
459
- };
460
 
461
- Parser.prototype.end = function(chunk){
462
- this._tokenizer.end(chunk);
463
- };
464
 
465
- Parser.prototype.pause = function(){
466
- this._tokenizer.pause();
467
- };
468
 
469
- Parser.prototype.resume = function(){
470
- this._tokenizer.resume();
471
- };
 
 
 
472
 
473
- //alias for backwards compat
474
- Parser.prototype.parseChunk = Parser.prototype.write;
475
- Parser.prototype.done = Parser.prototype.end;
 
 
 
 
 
 
476
 
477
- module.exports = Parser;
 
 
 
 
 
 
478
 
 
 
 
 
 
 
 
 
 
 
 
 
479
 
480
- /***/ }),
 
481
 
482
- /***/ 259:
483
- /***/ (function(module, exports, __webpack_require__) {
484
 
485
- module.exports = Tokenizer;
 
 
486
 
487
- var decodeCodePoint = __webpack_require__(260),
488
- entityMap = __webpack_require__(85),
489
- legacyMap = __webpack_require__(261),
490
- xmlMap = __webpack_require__(86),
491
 
492
- i = 0,
 
493
 
494
- TEXT = i++,
495
- BEFORE_TAG_NAME = i++, //after <
496
- IN_TAG_NAME = i++,
497
- IN_SELF_CLOSING_TAG = i++,
498
- BEFORE_CLOSING_TAG_NAME = i++,
499
- IN_CLOSING_TAG_NAME = i++,
500
- AFTER_CLOSING_TAG_NAME = i++,
501
 
502
- //attributes
503
- BEFORE_ATTRIBUTE_NAME = i++,
504
- IN_ATTRIBUTE_NAME = i++,
505
- AFTER_ATTRIBUTE_NAME = i++,
506
- BEFORE_ATTRIBUTE_VALUE = i++,
507
- IN_ATTRIBUTE_VALUE_DQ = i++, // "
508
- IN_ATTRIBUTE_VALUE_SQ = i++, // '
509
- IN_ATTRIBUTE_VALUE_NQ = i++,
510
 
511
- //declarations
512
- BEFORE_DECLARATION = i++, // !
513
- IN_DECLARATION = i++,
514
 
515
- //processing instructions
516
- IN_PROCESSING_INSTRUCTION = i++, // ?
 
517
 
518
- //comments
519
- BEFORE_COMMENT = i++,
520
- IN_COMMENT = i++,
521
- AFTER_COMMENT_1 = i++,
522
- AFTER_COMMENT_2 = i++,
523
 
524
- //cdata
525
- BEFORE_CDATA_1 = i++, // [
526
- BEFORE_CDATA_2 = i++, // C
527
- BEFORE_CDATA_3 = i++, // D
528
- BEFORE_CDATA_4 = i++, // A
529
- BEFORE_CDATA_5 = i++, // T
530
- BEFORE_CDATA_6 = i++, // A
531
- IN_CDATA = i++, // [
532
- AFTER_CDATA_1 = i++, // ]
533
- AFTER_CDATA_2 = i++, // ]
534
 
535
- //special tags
536
- BEFORE_SPECIAL = i++, //S
537
- BEFORE_SPECIAL_END = i++, //S
538
 
539
- BEFORE_SCRIPT_1 = i++, //C
540
- BEFORE_SCRIPT_2 = i++, //R
541
- BEFORE_SCRIPT_3 = i++, //I
542
- BEFORE_SCRIPT_4 = i++, //P
543
- BEFORE_SCRIPT_5 = i++, //T
544
- AFTER_SCRIPT_1 = i++, //C
545
- AFTER_SCRIPT_2 = i++, //R
546
- AFTER_SCRIPT_3 = i++, //I
547
- AFTER_SCRIPT_4 = i++, //P
548
- AFTER_SCRIPT_5 = i++, //T
549
 
550
- BEFORE_STYLE_1 = i++, //T
551
- BEFORE_STYLE_2 = i++, //Y
552
- BEFORE_STYLE_3 = i++, //L
553
- BEFORE_STYLE_4 = i++, //E
554
- AFTER_STYLE_1 = i++, //T
555
- AFTER_STYLE_2 = i++, //Y
556
- AFTER_STYLE_3 = i++, //L
557
- AFTER_STYLE_4 = i++, //E
558
 
559
- BEFORE_ENTITY = i++, //&
560
- BEFORE_NUMERIC_ENTITY = i++, //#
561
- IN_NAMED_ENTITY = i++,
562
- IN_NUMERIC_ENTITY = i++,
563
- IN_HEX_ENTITY = i++, //X
564
 
565
- j = 0,
 
 
 
 
 
566
 
567
- SPECIAL_NONE = j++,
568
- SPECIAL_SCRIPT = j++,
569
- SPECIAL_STYLE = j++;
570
 
571
- function whitespace(c){
572
- return c === " " || c === "\n" || c === "\t" || c === "\f" || c === "\r";
573
- }
574
 
575
- function characterState(char, SUCCESS){
576
- return function(c){
577
- if(c === char) this._state = SUCCESS;
578
- };
579
- }
580
 
581
- function ifElseState(upper, SUCCESS, FAILURE){
582
- var lower = upper.toLowerCase();
583
 
584
- if(upper === lower){
585
- return function(c){
586
- if(c === lower){
587
- this._state = SUCCESS;
588
- } else {
589
- this._state = FAILURE;
590
- this._index--;
591
- }
592
- };
593
- } else {
594
- return function(c){
595
- if(c === lower || c === upper){
596
- this._state = SUCCESS;
597
- } else {
598
- this._state = FAILURE;
599
- this._index--;
600
- }
601
- };
602
- }
603
- }
604
 
605
- function consumeSpecialNameChar(upper, NEXT_STATE){
606
- var lower = upper.toLowerCase();
 
 
 
 
 
 
 
 
607
 
608
- return function(c){
609
- if(c === lower || c === upper){
610
- this._state = NEXT_STATE;
611
- } else {
612
- this._state = IN_TAG_NAME;
613
- this._index--; //consume the token again
614
- }
615
- };
616
- }
617
 
618
- function Tokenizer(options, cbs){
619
- this._state = TEXT;
620
- this._buffer = "";
621
- this._sectionStart = 0;
622
- this._index = 0;
623
- this._bufferOffset = 0; //chars removed from _buffer
624
- this._baseState = TEXT;
625
- this._special = SPECIAL_NONE;
626
- this._cbs = cbs;
627
- this._running = true;
628
- this._ended = false;
629
- this._xmlMode = !!(options && options.xmlMode);
630
- this._decodeEntities = !!(options && options.decodeEntities);
631
- }
632
 
633
- Tokenizer.prototype._stateText = function(c){
634
- if(c === "<"){
635
- if(this._index > this._sectionStart){
636
- this._cbs.ontext(this._getSection());
637
- }
638
- this._state = BEFORE_TAG_NAME;
639
- this._sectionStart = this._index;
640
- } else if(this._decodeEntities && this._special === SPECIAL_NONE && c === "&"){
641
- if(this._index > this._sectionStart){
642
- this._cbs.ontext(this._getSection());
643
- }
644
- this._baseState = TEXT;
645
- this._state = BEFORE_ENTITY;
646
- this._sectionStart = this._index;
647
- }
648
  };
649
 
650
- Tokenizer.prototype._stateBeforeTagName = function(c){
651
- if(c === "/"){
652
- this._state = BEFORE_CLOSING_TAG_NAME;
653
- } else if(c === "<"){
654
- this._cbs.ontext(this._getSection());
655
- this._sectionStart = this._index;
656
- } else if(c === ">" || this._special !== SPECIAL_NONE || whitespace(c)) {
657
- this._state = TEXT;
658
- } else if(c === "!"){
659
- this._state = BEFORE_DECLARATION;
660
- this._sectionStart = this._index + 1;
661
- } else if(c === "?"){
662
- this._state = IN_PROCESSING_INSTRUCTION;
663
- this._sectionStart = this._index + 1;
664
- } else {
665
- this._state = (!this._xmlMode && (c === "s" || c === "S")) ?
666
- BEFORE_SPECIAL : IN_TAG_NAME;
667
- this._sectionStart = this._index;
668
- }
669
  };
670
 
671
- Tokenizer.prototype._stateInTagName = function(c){
672
- if(c === "/" || c === ">" || whitespace(c)){
673
- this._emitToken("onopentagname");
674
- this._state = BEFORE_ATTRIBUTE_NAME;
675
- this._index--;
676
- }
677
- };
678
 
679
- Tokenizer.prototype._stateBeforeCloseingTagName = function(c){
680
- if(whitespace(c));
681
- else if(c === ">"){
682
- this._state = TEXT;
683
- } else if(this._special !== SPECIAL_NONE){
684
- if(c === "s" || c === "S"){
685
- this._state = BEFORE_SPECIAL_END;
686
- } else {
687
- this._state = TEXT;
688
- this._index--;
689
- }
690
- } else {
691
- this._state = IN_CLOSING_TAG_NAME;
692
- this._sectionStart = this._index;
693
- }
694
  };
695
 
696
- Tokenizer.prototype._stateInCloseingTagName = function(c){
697
- if(c === ">" || whitespace(c)){
698
- this._emitToken("onclosetag");
699
- this._state = AFTER_CLOSING_TAG_NAME;
700
- this._index--;
701
- }
702
  };
703
 
704
- Tokenizer.prototype._stateAfterCloseingTagName = function(c){
705
- //skip everything until ">"
706
- if(c === ">"){
707
- this._state = TEXT;
708
- this._sectionStart = this._index + 1;
709
- }
710
- };
711
 
712
- Tokenizer.prototype._stateBeforeAttributeName = function(c){
713
- if(c === ">"){
714
- this._cbs.onopentagend();
715
- this._state = TEXT;
716
- this._sectionStart = this._index + 1;
717
- } else if(c === "/"){
718
- this._state = IN_SELF_CLOSING_TAG;
719
- } else if(!whitespace(c)){
720
- this._state = IN_ATTRIBUTE_NAME;
721
- this._sectionStart = this._index;
722
- }
723
- };
724
 
725
- Tokenizer.prototype._stateInSelfClosingTag = function(c){
726
- if(c === ">"){
727
- this._cbs.onselfclosingtag();
728
- this._state = TEXT;
729
- this._sectionStart = this._index + 1;
730
- } else if(!whitespace(c)){
731
- this._state = BEFORE_ATTRIBUTE_NAME;
732
- this._index--;
733
- }
734
- };
735
 
736
- Tokenizer.prototype._stateInAttributeName = function(c){
737
- if(c === "=" || c === "/" || c === ">" || whitespace(c)){
738
- this._cbs.onattribname(this._getSection());
739
- this._sectionStart = -1;
740
- this._state = AFTER_ATTRIBUTE_NAME;
741
- this._index--;
742
- }
743
- };
744
 
745
- Tokenizer.prototype._stateAfterAttributeName = function(c){
746
- if(c === "="){
747
- this._state = BEFORE_ATTRIBUTE_VALUE;
748
- } else if(c === "/" || c === ">"){
749
- this._cbs.onattribend();
750
- this._state = BEFORE_ATTRIBUTE_NAME;
751
- this._index--;
752
- } else if(!whitespace(c)){
753
- this._cbs.onattribend();
754
- this._state = IN_ATTRIBUTE_NAME;
755
- this._sectionStart = this._index;
756
- }
757
- };
758
 
759
- Tokenizer.prototype._stateBeforeAttributeValue = function(c){
760
- if(c === "\""){
761
- this._state = IN_ATTRIBUTE_VALUE_DQ;
762
- this._sectionStart = this._index + 1;
763
- } else if(c === "'"){
764
- this._state = IN_ATTRIBUTE_VALUE_SQ;
765
- this._sectionStart = this._index + 1;
766
- } else if(!whitespace(c)){
767
- this._state = IN_ATTRIBUTE_VALUE_NQ;
768
- this._sectionStart = this._index;
769
- this._index--; //reconsume token
770
- }
771
- };
772
 
773
- Tokenizer.prototype._stateInAttributeValueDoubleQuotes = function(c){
774
- if(c === "\""){
775
- this._emitToken("onattribdata");
776
- this._cbs.onattribend();
777
- this._state = BEFORE_ATTRIBUTE_NAME;
778
- } else if(this._decodeEntities && c === "&"){
779
- this._emitToken("onattribdata");
780
- this._baseState = this._state;
781
- this._state = BEFORE_ENTITY;
782
- this._sectionStart = this._index;
783
- }
784
- };
785
 
786
- Tokenizer.prototype._stateInAttributeValueSingleQuotes = function(c){
787
- if(c === "'"){
788
- this._emitToken("onattribdata");
789
- this._cbs.onattribend();
790
- this._state = BEFORE_ATTRIBUTE_NAME;
791
- } else if(this._decodeEntities && c === "&"){
792
- this._emitToken("onattribdata");
793
- this._baseState = this._state;
794
- this._state = BEFORE_ENTITY;
795
- this._sectionStart = this._index;
796
- }
797
- };
798
 
799
- Tokenizer.prototype._stateInAttributeValueNoQuotes = function(c){
800
- if(whitespace(c) || c === ">"){
801
- this._emitToken("onattribdata");
802
- this._cbs.onattribend();
803
- this._state = BEFORE_ATTRIBUTE_NAME;
804
- this._index--;
805
- } else if(this._decodeEntities && c === "&"){
806
- this._emitToken("onattribdata");
807
- this._baseState = this._state;
808
- this._state = BEFORE_ENTITY;
809
- this._sectionStart = this._index;
810
- }
811
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
812
 
813
- Tokenizer.prototype._stateBeforeDeclaration = function(c){
814
- this._state = c === "[" ? BEFORE_CDATA_1 :
815
- c === "-" ? BEFORE_COMMENT :
816
- IN_DECLARATION;
817
- };
818
 
819
- Tokenizer.prototype._stateInDeclaration = function(c){
820
- if(c === ">"){
821
- this._cbs.ondeclaration(this._getSection());
822
- this._state = TEXT;
823
- this._sectionStart = this._index + 1;
824
- }
825
- };
826
 
827
- Tokenizer.prototype._stateInProcessingInstruction = function(c){
828
- if(c === ">"){
829
- this._cbs.onprocessinginstruction(this._getSection());
830
- this._state = TEXT;
831
- this._sectionStart = this._index + 1;
832
- }
833
- };
834
 
835
- Tokenizer.prototype._stateBeforeComment = function(c){
836
- if(c === "-"){
837
- this._state = IN_COMMENT;
838
- this._sectionStart = this._index + 1;
839
- } else {
840
- this._state = IN_DECLARATION;
841
- }
842
- };
 
 
 
 
 
843
 
844
- Tokenizer.prototype._stateInComment = function(c){
845
- if(c === "-") this._state = AFTER_COMMENT_1;
846
- };
847
 
848
- Tokenizer.prototype._stateAfterComment1 = function(c){
849
- if(c === "-"){
850
- this._state = AFTER_COMMENT_2;
851
- } else {
852
- this._state = IN_COMMENT;
853
- }
854
- };
855
 
856
- Tokenizer.prototype._stateAfterComment2 = function(c){
857
- if(c === ">"){
858
- //remove 2 trailing chars
859
- this._cbs.oncomment(this._buffer.substring(this._sectionStart, this._index - 2));
860
- this._state = TEXT;
861
- this._sectionStart = this._index + 1;
862
- } else if(c !== "-"){
863
- this._state = IN_COMMENT;
864
- }
865
- // else: stay in AFTER_COMMENT_2 (`--->`)
866
- };
867
 
868
- Tokenizer.prototype._stateBeforeCdata1 = ifElseState("C", BEFORE_CDATA_2, IN_DECLARATION);
869
- Tokenizer.prototype._stateBeforeCdata2 = ifElseState("D", BEFORE_CDATA_3, IN_DECLARATION);
870
- Tokenizer.prototype._stateBeforeCdata3 = ifElseState("A", BEFORE_CDATA_4, IN_DECLARATION);
871
- Tokenizer.prototype._stateBeforeCdata4 = ifElseState("T", BEFORE_CDATA_5, IN_DECLARATION);
872
- Tokenizer.prototype._stateBeforeCdata5 = ifElseState("A", BEFORE_CDATA_6, IN_DECLARATION);
 
 
 
 
 
 
 
 
 
 
 
873
 
874
- Tokenizer.prototype._stateBeforeCdata6 = function(c){
875
- if(c === "["){
876
- this._state = IN_CDATA;
877
- this._sectionStart = this._index + 1;
878
- } else {
879
- this._state = IN_DECLARATION;
880
- this._index--;
881
- }
882
- };
883
 
884
- Tokenizer.prototype._stateInCdata = function(c){
885
- if(c === "]") this._state = AFTER_CDATA_1;
886
- };
 
 
 
887
 
888
- Tokenizer.prototype._stateAfterCdata1 = characterState("]", AFTER_CDATA_2);
889
 
890
- Tokenizer.prototype._stateAfterCdata2 = function(c){
891
- if(c === ">"){
892
- //remove 2 trailing chars
893
- this._cbs.oncdata(this._buffer.substring(this._sectionStart, this._index - 2));
894
- this._state = TEXT;
895
- this._sectionStart = this._index + 1;
896
- } else if(c !== "]") {
897
- this._state = IN_CDATA;
898
- }
899
- //else: stay in AFTER_CDATA_2 (`]]]>`)
900
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
901
 
902
- Tokenizer.prototype._stateBeforeSpecial = function(c){
903
- if(c === "c" || c === "C"){
904
- this._state = BEFORE_SCRIPT_1;
905
- } else if(c === "t" || c === "T"){
906
- this._state = BEFORE_STYLE_1;
907
- } else {
908
- this._state = IN_TAG_NAME;
909
- this._index--; //consume the token again
910
- }
911
- };
912
 
913
- Tokenizer.prototype._stateBeforeSpecialEnd = function(c){
914
- if(this._special === SPECIAL_SCRIPT && (c === "c" || c === "C")){
915
- this._state = AFTER_SCRIPT_1;
916
- } else if(this._special === SPECIAL_STYLE && (c === "t" || c === "T")){
917
- this._state = AFTER_STYLE_1;
918
- }
919
- else this._state = TEXT;
920
- };
921
 
922
- Tokenizer.prototype._stateBeforeScript1 = consumeSpecialNameChar("R", BEFORE_SCRIPT_2);
923
- Tokenizer.prototype._stateBeforeScript2 = consumeSpecialNameChar("I", BEFORE_SCRIPT_3);
924
- Tokenizer.prototype._stateBeforeScript3 = consumeSpecialNameChar("P", BEFORE_SCRIPT_4);
925
- Tokenizer.prototype._stateBeforeScript4 = consumeSpecialNameChar("T", BEFORE_SCRIPT_5);
926
 
927
- Tokenizer.prototype._stateBeforeScript5 = function(c){
928
- if(c === "/" || c === ">" || whitespace(c)){
929
- this._special = SPECIAL_SCRIPT;
930
- }
931
- this._state = IN_TAG_NAME;
932
- this._index--; //consume the token again
933
- };
934
 
935
- Tokenizer.prototype._stateAfterScript1 = ifElseState("R", AFTER_SCRIPT_2, TEXT);
936
- Tokenizer.prototype._stateAfterScript2 = ifElseState("I", AFTER_SCRIPT_3, TEXT);
937
- Tokenizer.prototype._stateAfterScript3 = ifElseState("P", AFTER_SCRIPT_4, TEXT);
938
- Tokenizer.prototype._stateAfterScript4 = ifElseState("T", AFTER_SCRIPT_5, TEXT);
 
 
 
939
 
940
- Tokenizer.prototype._stateAfterScript5 = function(c){
941
- if(c === ">" || whitespace(c)){
942
- this._special = SPECIAL_NONE;
943
- this._state = IN_CLOSING_TAG_NAME;
944
- this._sectionStart = this._index - 6;
945
- this._index--; //reconsume the token
946
- }
947
- else this._state = TEXT;
948
- };
949
 
950
- Tokenizer.prototype._stateBeforeStyle1 = consumeSpecialNameChar("Y", BEFORE_STYLE_2);
951
- Tokenizer.prototype._stateBeforeStyle2 = consumeSpecialNameChar("L", BEFORE_STYLE_3);
952
- Tokenizer.prototype._stateBeforeStyle3 = consumeSpecialNameChar("E", BEFORE_STYLE_4);
953
 
954
- Tokenizer.prototype._stateBeforeStyle4 = function(c){
955
- if(c === "/" || c === ">" || whitespace(c)){
956
- this._special = SPECIAL_STYLE;
957
- }
958
- this._state = IN_TAG_NAME;
959
- this._index--; //consume the token again
960
- };
 
961
 
962
- Tokenizer.prototype._stateAfterStyle1 = ifElseState("Y", AFTER_STYLE_2, TEXT);
963
- Tokenizer.prototype._stateAfterStyle2 = ifElseState("L", AFTER_STYLE_3, TEXT);
964
- Tokenizer.prototype._stateAfterStyle3 = ifElseState("E", AFTER_STYLE_4, TEXT);
965
 
966
- Tokenizer.prototype._stateAfterStyle4 = function(c){
967
- if(c === ">" || whitespace(c)){
968
- this._special = SPECIAL_NONE;
969
- this._state = IN_CLOSING_TAG_NAME;
970
- this._sectionStart = this._index - 5;
971
- this._index--; //reconsume the token
972
- }
973
- else this._state = TEXT;
974
- };
975
 
976
- Tokenizer.prototype._stateBeforeEntity = ifElseState("#", BEFORE_NUMERIC_ENTITY, IN_NAMED_ENTITY);
977
- Tokenizer.prototype._stateBeforeNumericEntity = ifElseState("X", IN_HEX_ENTITY, IN_NUMERIC_ENTITY);
 
978
 
979
- //for entities terminated with a semicolon
980
- Tokenizer.prototype._parseNamedEntityStrict = function(){
981
- //offset = 1
982
- if(this._sectionStart + 1 < this._index){
983
- var entity = this._buffer.substring(this._sectionStart + 1, this._index),
984
- map = this._xmlMode ? xmlMap : entityMap;
985
 
986
- if(map.hasOwnProperty(entity)){
987
- this._emitPartial(map[entity]);
988
- this._sectionStart = this._index + 1;
989
- }
990
- }
991
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
992
 
 
 
 
 
 
 
993
 
994
- //parses legacy entities (without trailing semicolon)
995
- Tokenizer.prototype._parseLegacyEntity = function(){
996
- var start = this._sectionStart + 1,
997
- limit = this._index - start;
998
 
999
- if(limit > 6) limit = 6; //the max length of legacy entities is 6
 
 
 
 
 
 
 
 
 
 
1000
 
1001
- while(limit >= 2){ //the min length of legacy entities is 2
1002
- var entity = this._buffer.substr(start, limit);
 
 
 
1003
 
1004
- if(legacyMap.hasOwnProperty(entity)){
1005
- this._emitPartial(legacyMap[entity]);
1006
- this._sectionStart += limit + 1;
1007
- return;
1008
- } else {
1009
- limit--;
1010
- }
1011
- }
1012
- };
 
 
 
 
 
 
1013
 
1014
- Tokenizer.prototype._stateInNamedEntity = function(c){
1015
- if(c === ";"){
1016
- this._parseNamedEntityStrict();
1017
- if(this._sectionStart + 1 < this._index && !this._xmlMode){
1018
- this._parseLegacyEntity();
1019
- }
1020
- this._state = this._baseState;
1021
- } else if((c < "a" || c > "z") && (c < "A" || c > "Z") && (c < "0" || c > "9")){
1022
- if(this._xmlMode);
1023
- else if(this._sectionStart + 1 === this._index);
1024
- else if(this._baseState !== TEXT){
1025
- if(c !== "="){
1026
- this._parseNamedEntityStrict();
1027
- }
1028
- } else {
1029
- this._parseLegacyEntity();
1030
- }
1031
-
1032
- this._state = this._baseState;
1033
- this._index--;
1034
- }
1035
- };
1036
 
1037
- Tokenizer.prototype._decodeNumericEntity = function(offset, base){
1038
- var sectionStart = this._sectionStart + offset;
 
 
 
 
 
 
 
1039
 
1040
- if(sectionStart !== this._index){
1041
- //parse entity
1042
- var entity = this._buffer.substring(sectionStart, this._index);
1043
- var parsed = parseInt(entity, base);
1044
 
1045
- this._emitPartial(decodeCodePoint(parsed));
1046
- this._sectionStart = this._index;
1047
- } else {
1048
- this._sectionStart--;
1049
- }
 
 
 
 
 
 
1050
 
1051
- this._state = this._baseState;
1052
- };
1053
 
1054
- Tokenizer.prototype._stateInNumericEntity = function(c){
1055
- if(c === ";"){
1056
- this._decodeNumericEntity(2, 10);
1057
- this._sectionStart++;
1058
- } else if(c < "0" || c > "9"){
1059
- if(!this._xmlMode){
1060
- this._decodeNumericEntity(2, 10);
1061
- } else {
1062
- this._state = this._baseState;
1063
- }
1064
- this._index--;
1065
- }
1066
- };
1067
 
1068
- Tokenizer.prototype._stateInHexEntity = function(c){
1069
- if(c === ";"){
1070
- this._decodeNumericEntity(3, 16);
1071
- this._sectionStart++;
1072
- } else if((c < "a" || c > "f") && (c < "A" || c > "F") && (c < "0" || c > "9")){
1073
- if(!this._xmlMode){
1074
- this._decodeNumericEntity(3, 16);
1075
- } else {
1076
- this._state = this._baseState;
1077
- }
1078
- this._index--;
1079
- }
1080
- };
1081
 
1082
- Tokenizer.prototype._cleanup = function (){
1083
- if(this._sectionStart < 0){
1084
- this._buffer = "";
1085
- this._bufferOffset += this._index;
1086
- this._index = 0;
1087
- } else if(this._running){
1088
- if(this._state === TEXT){
1089
- if(this._sectionStart !== this._index){
1090
- this._cbs.ontext(this._buffer.substr(this._sectionStart));
1091
- }
1092
- this._buffer = "";
1093
- this._bufferOffset += this._index;
1094
- this._index = 0;
1095
- } else if(this._sectionStart === this._index){
1096
- //the section just started
1097
- this._buffer = "";
1098
- this._bufferOffset += this._index;
1099
- this._index = 0;
1100
- } else {
1101
- //remove everything unnecessary
1102
- this._buffer = this._buffer.substr(this._sectionStart);
1103
- this._index -= this._sectionStart;
1104
- this._bufferOffset += this._sectionStart;
1105
- }
1106
 
1107
- this._sectionStart = 0;
1108
- }
1109
- };
1110
 
1111
- //TODO make events conditional
1112
- Tokenizer.prototype.write = function(chunk){
1113
- if(this._ended) this._cbs.onerror(Error(".write() after done!"));
1114
 
1115
- this._buffer += chunk;
1116
- this._parse();
1117
- };
 
 
 
 
 
 
 
 
1118
 
1119
- Tokenizer.prototype._parse = function(){
1120
- while(this._index < this._buffer.length && this._running){
1121
- var c = this._buffer.charAt(this._index);
1122
- if(this._state === TEXT) {
1123
- this._stateText(c);
1124
- } else if(this._state === BEFORE_TAG_NAME){
1125
- this._stateBeforeTagName(c);
1126
- } else if(this._state === IN_TAG_NAME) {
1127
- this._stateInTagName(c);
1128
- } else if(this._state === BEFORE_CLOSING_TAG_NAME){
1129
- this._stateBeforeCloseingTagName(c);
1130
- } else if(this._state === IN_CLOSING_TAG_NAME){
1131
- this._stateInCloseingTagName(c);
1132
- } else if(this._state === AFTER_CLOSING_TAG_NAME){
1133
- this._stateAfterCloseingTagName(c);
1134
- } else if(this._state === IN_SELF_CLOSING_TAG){
1135
- this._stateInSelfClosingTag(c);
1136
- }
1137
 
1138
- /*
1139
- * attributes
1140
- */
1141
- else if(this._state === BEFORE_ATTRIBUTE_NAME){
1142
- this._stateBeforeAttributeName(c);
1143
- } else if(this._state === IN_ATTRIBUTE_NAME){
1144
- this._stateInAttributeName(c);
1145
- } else if(this._state === AFTER_ATTRIBUTE_NAME){
1146
- this._stateAfterAttributeName(c);
1147
- } else if(this._state === BEFORE_ATTRIBUTE_VALUE){
1148
- this._stateBeforeAttributeValue(c);
1149
- } else if(this._state === IN_ATTRIBUTE_VALUE_DQ){
1150
- this._stateInAttributeValueDoubleQuotes(c);
1151
- } else if(this._state === IN_ATTRIBUTE_VALUE_SQ){
1152
- this._stateInAttributeValueSingleQuotes(c);
1153
- } else if(this._state === IN_ATTRIBUTE_VALUE_NQ){
1154
- this._stateInAttributeValueNoQuotes(c);
1155
- }
1156
 
1157
- /*
1158
- * declarations
1159
- */
1160
- else if(this._state === BEFORE_DECLARATION){
1161
- this._stateBeforeDeclaration(c);
1162
- } else if(this._state === IN_DECLARATION){
1163
- this._stateInDeclaration(c);
1164
- }
 
 
 
 
 
 
 
1165
 
1166
- /*
1167
- * processing instructions
1168
- */
1169
- else if(this._state === IN_PROCESSING_INSTRUCTION){
1170
- this._stateInProcessingInstruction(c);
1171
- }
 
1172
 
1173
- /*
1174
- * comments
1175
- */
1176
- else if(this._state === BEFORE_COMMENT){
1177
- this._stateBeforeComment(c);
1178
- } else if(this._state === IN_COMMENT){
1179
- this._stateInComment(c);
1180
- } else if(this._state === AFTER_COMMENT_1){
1181
- this._stateAfterComment1(c);
1182
- } else if(this._state === AFTER_COMMENT_2){
1183
- this._stateAfterComment2(c);
1184
- }
1185
 
1186
- /*
1187
- * cdata
1188
- */
1189
- else if(this._state === BEFORE_CDATA_1){
1190
- this._stateBeforeCdata1(c);
1191
- } else if(this._state === BEFORE_CDATA_2){
1192
- this._stateBeforeCdata2(c);
1193
- } else if(this._state === BEFORE_CDATA_3){
1194
- this._stateBeforeCdata3(c);
1195
- } else if(this._state === BEFORE_CDATA_4){
1196
- this._stateBeforeCdata4(c);
1197
- } else if(this._state === BEFORE_CDATA_5){
1198
- this._stateBeforeCdata5(c);
1199
- } else if(this._state === BEFORE_CDATA_6){
1200
- this._stateBeforeCdata6(c);
1201
- } else if(this._state === IN_CDATA){
1202
- this._stateInCdata(c);
1203
- } else if(this._state === AFTER_CDATA_1){
1204
- this._stateAfterCdata1(c);
1205
- } else if(this._state === AFTER_CDATA_2){
1206
- this._stateAfterCdata2(c);
1207
- }
1208
-
1209
- /*
1210
- * special tags
1211
- */
1212
- else if(this._state === BEFORE_SPECIAL){
1213
- this._stateBeforeSpecial(c);
1214
- } else if(this._state === BEFORE_SPECIAL_END){
1215
- this._stateBeforeSpecialEnd(c);
1216
- }
1217
 
1218
- /*
1219
- * script
1220
- */
1221
- else if(this._state === BEFORE_SCRIPT_1){
1222
- this._stateBeforeScript1(c);
1223
- } else if(this._state === BEFORE_SCRIPT_2){
1224
- this._stateBeforeScript2(c);
1225
- } else if(this._state === BEFORE_SCRIPT_3){
1226
- this._stateBeforeScript3(c);
1227
- } else if(this._state === BEFORE_SCRIPT_4){
1228
- this._stateBeforeScript4(c);
1229
- } else if(this._state === BEFORE_SCRIPT_5){
1230
- this._stateBeforeScript5(c);
1231
- }
1232
 
1233
- else if(this._state === AFTER_SCRIPT_1){
1234
- this._stateAfterScript1(c);
1235
- } else if(this._state === AFTER_SCRIPT_2){
1236
- this._stateAfterScript2(c);
1237
- } else if(this._state === AFTER_SCRIPT_3){
1238
- this._stateAfterScript3(c);
1239
- } else if(this._state === AFTER_SCRIPT_4){
1240
- this._stateAfterScript4(c);
1241
- } else if(this._state === AFTER_SCRIPT_5){
1242
- this._stateAfterScript5(c);
1243
- }
1244
 
1245
- /*
1246
- * style
1247
- */
1248
- else if(this._state === BEFORE_STYLE_1){
1249
- this._stateBeforeStyle1(c);
1250
- } else if(this._state === BEFORE_STYLE_2){
1251
- this._stateBeforeStyle2(c);
1252
- } else if(this._state === BEFORE_STYLE_3){
1253
- this._stateBeforeStyle3(c);
1254
- } else if(this._state === BEFORE_STYLE_4){
1255
- this._stateBeforeStyle4(c);
1256
- }
1257
 
1258
- else if(this._state === AFTER_STYLE_1){
1259
- this._stateAfterStyle1(c);
1260
- } else if(this._state === AFTER_STYLE_2){
1261
- this._stateAfterStyle2(c);
1262
- } else if(this._state === AFTER_STYLE_3){
1263
- this._stateAfterStyle3(c);
1264
- } else if(this._state === AFTER_STYLE_4){
1265
- this._stateAfterStyle4(c);
1266
- }
1267
 
1268
- /*
1269
- * entities
1270
- */
1271
- else if(this._state === BEFORE_ENTITY){
1272
- this._stateBeforeEntity(c);
1273
- } else if(this._state === BEFORE_NUMERIC_ENTITY){
1274
- this._stateBeforeNumericEntity(c);
1275
- } else if(this._state === IN_NAMED_ENTITY){
1276
- this._stateInNamedEntity(c);
1277
- } else if(this._state === IN_NUMERIC_ENTITY){
1278
- this._stateInNumericEntity(c);
1279
- } else if(this._state === IN_HEX_ENTITY){
1280
- this._stateInHexEntity(c);
1281
- }
1282
 
1283
- else {
1284
- this._cbs.onerror(Error("unknown _state"), this._state);
1285
- }
1286
 
1287
- this._index++;
1288
- }
 
 
 
 
 
 
1289
 
1290
- this._cleanup();
1291
- };
1292
 
1293
- Tokenizer.prototype.pause = function(){
1294
- this._running = false;
1295
- };
1296
- Tokenizer.prototype.resume = function(){
1297
- this._running = true;
1298
 
1299
- if(this._index < this._buffer.length){
1300
- this._parse();
1301
- }
1302
- if(this._ended){
1303
- this._finish();
1304
- }
1305
- };
1306
 
1307
- Tokenizer.prototype.end = function(chunk){
1308
- if(this._ended) this._cbs.onerror(Error(".end() after done!"));
1309
- if(chunk) this.write(chunk);
 
 
 
 
1310
 
1311
- this._ended = true;
 
 
 
 
 
 
 
 
 
1312
 
1313
- if(this._running) this._finish();
1314
- };
 
 
1315
 
1316
- Tokenizer.prototype._finish = function(){
1317
- //if there is remaining data, emit it in a reasonable way
1318
- if(this._sectionStart < this._index){
1319
- this._handleTrailingData();
1320
- }
1321
 
1322
- this._cbs.onend();
1323
- };
 
1324
 
1325
- Tokenizer.prototype._handleTrailingData = function(){
1326
- var data = this._buffer.substr(this._sectionStart);
 
 
 
 
 
 
1327
 
1328
- if(this._state === IN_CDATA || this._state === AFTER_CDATA_1 || this._state === AFTER_CDATA_2){
1329
- this._cbs.oncdata(data);
1330
- } else if(this._state === IN_COMMENT || this._state === AFTER_COMMENT_1 || this._state === AFTER_COMMENT_2){
1331
- this._cbs.oncomment(data);
1332
- } else if(this._state === IN_NAMED_ENTITY && !this._xmlMode){
1333
- this._parseLegacyEntity();
1334
- if(this._sectionStart < this._index){
1335
- this._state = this._baseState;
1336
- this._handleTrailingData();
1337
- }
1338
- } else if(this._state === IN_NUMERIC_ENTITY && !this._xmlMode){
1339
- this._decodeNumericEntity(2, 10);
1340
- if(this._sectionStart < this._index){
1341
- this._state = this._baseState;
1342
- this._handleTrailingData();
1343
- }
1344
- } else if(this._state === IN_HEX_ENTITY && !this._xmlMode){
1345
- this._decodeNumericEntity(3, 16);
1346
- if(this._sectionStart < this._index){
1347
- this._state = this._baseState;
1348
- this._handleTrailingData();
1349
- }
1350
- } else if(
1351
- this._state !== IN_TAG_NAME &&
1352
- this._state !== BEFORE_ATTRIBUTE_NAME &&
1353
- this._state !== BEFORE_ATTRIBUTE_VALUE &&
1354
- this._state !== AFTER_ATTRIBUTE_NAME &&
1355
- this._state !== IN_ATTRIBUTE_NAME &&
1356
- this._state !== IN_ATTRIBUTE_VALUE_SQ &&
1357
- this._state !== IN_ATTRIBUTE_VALUE_DQ &&
1358
- this._state !== IN_ATTRIBUTE_VALUE_NQ &&
1359
- this._state !== IN_CLOSING_TAG_NAME
1360
- ){
1361
- this._cbs.ontext(data);
1362
- }
1363
- //else, ignore remaining data
1364
- //TODO add a way to remove current tag
1365
- };
1366
 
1367
- Tokenizer.prototype.reset = function(){
1368
- Tokenizer.call(this, {xmlMode: this._xmlMode, decodeEntities: this._decodeEntities}, this._cbs);
1369
- };
1370
 
1371
- Tokenizer.prototype.getAbsoluteIndex = function(){
1372
- return this._bufferOffset + this._index;
1373
- };
1374
-
1375
- Tokenizer.prototype._getSection = function(){
1376
- return this._buffer.substring(this._sectionStart, this._index);
1377
- };
1378
-
1379
- Tokenizer.prototype._emitToken = function(name){
1380
- this._cbs[name](this._getSection());
1381
- this._sectionStart = -1;
1382
- };
1383
 
1384
- Tokenizer.prototype._emitPartial = function(value){
1385
- if(this._baseState !== TEXT){
1386
- this._cbs.onattribdata(value); //TODO implement the new event
1387
- } else {
1388
- this._cbs.ontext(value);
1389
- }
1390
- };
1391
 
 
 
 
1392
 
1393
- /***/ }),
 
 
 
1394
 
1395
- /***/ 260:
1396
- /***/ (function(module, exports, __webpack_require__) {
1397
 
1398
- var decodeMap = __webpack_require__(418);
 
1399
 
1400
- module.exports = decodeCodePoint;
 
 
 
 
 
 
1401
 
1402
- // modified version of https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119
1403
- function decodeCodePoint(codePoint){
 
 
1404
 
1405
- if((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF){
1406
- return "\uFFFD";
1407
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1408
 
1409
- if(codePoint in decodeMap){
1410
- codePoint = decodeMap[codePoint];
1411
- }
 
1412
 
1413
- var output = "";
 
 
1414
 
1415
- if(codePoint > 0xFFFF){
1416
- codePoint -= 0x10000;
1417
- output += String.fromCharCode(codePoint >>> 10 & 0x3FF | 0xD800);
1418
- codePoint = 0xDC00 | codePoint & 0x3FF;
1419
- }
 
 
1420
 
1421
- output += String.fromCharCode(codePoint);
1422
- return output;
 
 
 
 
 
 
 
 
 
1423
  }
1424
 
 
 
 
 
 
 
 
 
 
 
 
1425
 
1426
- /***/ }),
1427
-
1428
- /***/ 261:
1429
- /***/ (function(module, exports) {
1430
 
1431
- module.exports = {"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\"","QUOT":"\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1432
 
1433
- /***/ }),
 
1434
 
1435
- /***/ 262:
1436
- /***/ (function(module, exports) {
1437
 
1438
- // This object will be used as the prototype for Nodes when creating a
1439
- // DOM-Level-1-compliant structure.
1440
- var NodePrototype = module.exports = {
1441
- get firstChild() {
1442
- var children = this.children;
1443
- return children && children[0] || null;
1444
- },
1445
- get lastChild() {
1446
- var children = this.children;
1447
- return children && children[children.length - 1] || null;
1448
- },
1449
- get nodeType() {
1450
- return nodeTypes[this.type] || nodeTypes.element;
1451
- }
1452
- };
1453
 
1454
- var domLvl1 = {
1455
- tagName: "name",
1456
- childNodes: "children",
1457
- parentNode: "parent",
1458
- previousSibling: "prev",
1459
- nextSibling: "next",
1460
- nodeValue: "data"
1461
- };
1462
 
1463
- var nodeTypes = {
1464
- element: 1,
1465
- text: 3,
1466
- cdata: 4,
1467
- comment: 8
1468
- };
1469
 
1470
- Object.keys(domLvl1).forEach(function(key) {
1471
- var shorthand = domLvl1[key];
1472
- Object.defineProperty(NodePrototype, key, {
1473
- get: function() {
1474
- return this[shorthand] || null;
1475
- },
1476
- set: function(val) {
1477
- this[shorthand] = val;
1478
- return val;
1479
- }
1480
- });
1481
- });
1482
 
 
 
 
1483
 
1484
- /***/ }),
1485
 
1486
- /***/ 263:
1487
- /***/ (function(module, exports, __webpack_require__) {
 
 
1488
 
1489
- module.exports = Stream;
 
 
1490
 
1491
- var Parser = __webpack_require__(258),
1492
- WritableStream = __webpack_require__(423).Writable || __webpack_require__(435).Writable,
1493
- StringDecoder = __webpack_require__(90).StringDecoder,
1494
- Buffer = __webpack_require__(88).Buffer;
1495
 
1496
- function Stream(cbs, options){
1497
- var parser = this._parser = new Parser(cbs, options);
1498
- var decoder = this._decoder = new StringDecoder();
1499
 
1500
- WritableStream.call(this, {decodeStrings: false});
 
1501
 
1502
- this.once("finish", function(){
1503
- parser.end(decoder.end());
1504
- });
1505
- }
 
1506
 
1507
- __webpack_require__(22)(Stream, WritableStream);
 
 
 
 
 
 
1508
 
1509
- WritableStream.prototype._write = function(chunk, encoding, cb){
1510
- if(chunk instanceof Buffer) chunk = this._decoder.write(chunk);
1511
- this._parser.write(chunk);
1512
- cb();
1513
- };
1514
 
1515
- /***/ }),
 
 
 
 
1516
 
1517
- /***/ 264:
1518
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
1519
 
1520
- "use strict";
1521
- /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
1522
- //
1523
- // Permission is hereby granted, free of charge, to any person obtaining a
1524
- // copy of this software and associated documentation files (the
1525
- // "Software"), to deal in the Software without restriction, including
1526
- // without limitation the rights to use, copy, modify, merge, publish,
1527
- // distribute, sublicense, and/or sell copies of the Software, and to permit
1528
- // persons to whom the Software is furnished to do so, subject to the
1529
- // following conditions:
1530
- //
1531
- // The above copyright notice and this permission notice shall be included
1532
- // in all copies or substantial portions of the Software.
1533
- //
1534
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1535
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1536
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
1537
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
1538
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1539
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
1540
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
1541
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1542
 
 
 
 
 
 
 
1543
 
1544
- /*<replacement>*/
 
 
 
 
1545
 
1546
- var processNextTick = __webpack_require__(56);
1547
- /*</replacement>*/
 
 
 
 
 
 
 
1548
 
1549
- module.exports = Readable;
 
 
 
1550
 
1551
- /*<replacement>*/
1552
- var isArray = __webpack_require__(265);
1553
- /*</replacement>*/
 
 
 
 
 
 
 
 
 
1554
 
1555
- /*<replacement>*/
1556
- var Duplex;
1557
- /*</replacement>*/
1558
 
1559
- Readable.ReadableState = ReadableState;
 
 
 
 
 
 
 
 
1560
 
1561
- /*<replacement>*/
1562
- var EE = __webpack_require__(55).EventEmitter;
 
 
1563
 
1564
- var EElistenerCount = function (emitter, type) {
1565
- return emitter.listeners(type).length;
1566
- };
1567
- /*</replacement>*/
1568
 
1569
- /*<replacement>*/
1570
- var Stream = __webpack_require__(266);
1571
- /*</replacement>*/
1572
 
1573
- // TODO(bmeurer): Change this back to const once hole checks are
1574
- // properly optimized away early in Ignition+TurboFan.
1575
- /*<replacement>*/
1576
- var Buffer = __webpack_require__(57).Buffer;
1577
- var OurUint8Array = global.Uint8Array || function () {};
1578
- function _uint8ArrayToBuffer(chunk) {
1579
- return Buffer.from(chunk);
1580
- }
1581
- function _isUint8Array(obj) {
1582
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
1583
- }
1584
- /*</replacement>*/
1585
 
1586
- /*<replacement>*/
1587
- var util = __webpack_require__(46);
1588
- util.inherits = __webpack_require__(22);
1589
- /*</replacement>*/
 
 
 
1590
 
1591
- /*<replacement>*/
1592
- var debugUtil = __webpack_require__(426);
1593
- var debug = void 0;
1594
- if (debugUtil && debugUtil.debuglog) {
1595
- debug = debugUtil.debuglog('stream');
1596
- } else {
1597
- debug = function () {};
1598
  }
1599
- /*</replacement>*/
1600
-
1601
- var BufferList = __webpack_require__(427);
1602
- var destroyImpl = __webpack_require__(267);
1603
- var StringDecoder;
1604
-
1605
- util.inherits(Readable, Stream);
1606
 
1607
- var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
 
 
 
 
 
 
 
 
 
 
 
1608
 
1609
- function prependListener(emitter, event, fn) {
1610
- // Sadly this is not cacheable as some libraries bundle their own
1611
- // event emitter implementation with them.
1612
- if (typeof emitter.prependListener === 'function') {
1613
- return emitter.prependListener(event, fn);
1614
- } else {
1615
- // This is a hack to make sure that our error handler is attached before any
1616
- // userland ones. NEVER DO THIS. This is here only because this code needs
1617
- // to continue to work with older versions of Node.js that do not include
1618
- // the prependListener() method. The goal is to eventually remove this hack.
1619
- if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
 
 
1620
  }
1621
- }
1622
 
1623
- function ReadableState(options, stream) {
1624
- Duplex = Duplex || __webpack_require__(32);
 
 
 
 
 
 
 
1625
 
1626
- options = options || {};
 
 
 
1627
 
1628
- // object stream flag. Used to make read(n) ignore n and to
1629
- // make all the buffer merging and length checks go away
1630
- this.objectMode = !!options.objectMode;
1631
-
1632
- if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
1633
-
1634
- // the point at which it stops calling _read() to fill the buffer
1635
- // Note: 0 is a valid value, means "don't call _read preemptively ever"
1636
- var hwm = options.highWaterMark;
1637
- var defaultHwm = this.objectMode ? 16 : 16 * 1024;
1638
- this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
1639
-
1640
- // cast to ints.
1641
- this.highWaterMark = Math.floor(this.highWaterMark);
1642
-
1643
- // A linked list is used to store data chunks instead of an array because the
1644
- // linked list can remove elements from the beginning faster than
1645
- // array.shift()
1646
- this.buffer = new BufferList();
1647
- this.length = 0;
1648
- this.pipes = null;
1649
- this.pipesCount = 0;
1650
- this.flowing = null;
1651
- this.ended = false;
1652
- this.endEmitted = false;
1653
- this.reading = false;
1654
-
1655
- // a flag to be able to tell if the event 'readable'/'data' is emitted
1656
- // immediately, or on a later tick. We set this to true at first, because
1657
- // any actions that shouldn't happen until "later" should generally also
1658
- // not happen before the first read call.
1659
- this.sync = true;
1660
-
1661
- // whenever we return null, then we set a flag to say
1662
- // that we're awaiting a 'readable' event emission.
1663
- this.needReadable = false;
1664
- this.emittedReadable = false;
1665
- this.readableListening = false;
1666
- this.resumeScheduled = false;
1667
 
1668
- // has it been destroyed
1669
- this.destroyed = false;
1670
 
1671
- // Crypto is kind of old and crusty. Historically, its default string
1672
- // encoding is 'binary' so we have to make this configurable.
1673
- // Everything else in the universe uses 'utf8', though.
1674
- this.defaultEncoding = options.defaultEncoding || 'utf8';
1675
 
1676
- // the number of writers that are awaiting a drain event in .pipe()s
1677
- this.awaitDrain = 0;
 
 
 
 
 
 
 
 
 
 
 
1678
 
1679
- // if true, a maybeReadMore has been scheduled
1680
- this.readingMore = false;
 
 
 
 
 
1681
 
1682
- this.decoder = null;
1683
- this.encoding = null;
1684
- if (options.encoding) {
1685
- if (!StringDecoder) StringDecoder = __webpack_require__(90).StringDecoder;
1686
- this.decoder = new StringDecoder(options.encoding);
1687
- this.encoding = options.encoding;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1688
  }
 
 
1689
  }
1690
 
1691
- function Readable(options) {
1692
- Duplex = Duplex || __webpack_require__(32);
 
1693
 
1694
- if (!(this instanceof Readable)) return new Readable(options);
 
 
1695
 
1696
- this._readableState = new ReadableState(options, this);
 
 
1697
 
1698
- // legacy
1699
- this.readable = true;
 
 
 
 
 
 
 
 
 
1700
 
1701
- if (options) {
1702
- if (typeof options.read === 'function') this._read = options.read;
 
1703
 
1704
- if (typeof options.destroy === 'function') this._destroy = options.destroy;
 
 
 
 
 
 
1705
  }
 
 
1706
 
1707
- Stream.call(this);
 
1708
  }
1709
 
1710
- Object.defineProperty(Readable.prototype, 'destroyed', {
1711
- get: function () {
1712
- if (this._readableState === undefined) {
1713
- return false;
1714
- }
1715
- return this._readableState.destroyed;
1716
- },
1717
- set: function (value) {
1718
- // we ignore the value if the stream
1719
- // has not been initialized yet
1720
- if (!this._readableState) {
1721
- return;
1722
- }
1723
 
1724
- // backward compatibility, the user is explicitly
1725
- // managing destroyed
1726
- this._readableState.destroyed = value;
1727
- }
1728
- });
1729
 
1730
- Readable.prototype.destroy = destroyImpl.destroy;
1731
- Readable.prototype._undestroy = destroyImpl.undestroy;
1732
- Readable.prototype._destroy = function (err, cb) {
1733
- this.push(null);
1734
- cb(err);
1735
- };
1736
 
1737
- // Manually shove something into the read() buffer.
1738
- // This returns true if the highWaterMark has not been hit yet,
1739
- // similar to how Writable.write() returns true if you should
1740
- // write() some more.
1741
- Readable.prototype.push = function (chunk, encoding) {
1742
- var state = this._readableState;
1743
- var skipChunkCheck;
1744
 
1745
- if (!state.objectMode) {
1746
- if (typeof chunk === 'string') {
1747
- encoding = encoding || state.defaultEncoding;
1748
- if (encoding !== state.encoding) {
1749
- chunk = Buffer.from(chunk, encoding);
1750
- encoding = '';
1751
- }
1752
- skipChunkCheck = true;
 
 
 
 
 
 
 
 
 
 
 
 
1753
  }
 
1754
  } else {
1755
- skipChunkCheck = true;
 
 
1756
  }
1757
 
1758
- return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
1759
- };
1760
 
1761
- // Unshift should *always* be something directly out of read()
1762
- Readable.prototype.unshift = function (chunk) {
1763
- return readableAddChunk(this, chunk, null, true, false);
1764
- };
1765
 
1766
- function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
1767
- var state = stream._readableState;
1768
- if (chunk === null) {
1769
- state.reading = false;
1770
- onEofChunk(stream, state);
1771
- } else {
1772
- var er;
1773
- if (!skipChunkCheck) er = chunkInvalid(state, chunk);
1774
- if (er) {
1775
- stream.emit('error', er);
1776
- } else if (state.objectMode || chunk && chunk.length > 0) {
1777
- if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
1778
- chunk = _uint8ArrayToBuffer(chunk);
1779
- }
1780
 
1781
- if (addToFront) {
1782
- if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
1783
- } else if (state.ended) {
1784
- stream.emit('error', new Error('stream.push() after EOF'));
1785
- } else {
1786
- state.reading = false;
1787
- if (state.decoder && !encoding) {
1788
- chunk = state.decoder.write(chunk);
1789
- if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
1790
- } else {
1791
- addChunk(stream, state, chunk, false);
1792
- }
1793
- }
1794
- } else if (!addToFront) {
1795
- state.reading = false;
1796
- }
1797
- }
1798
 
1799
- return needMoreData(state);
1800
- }
 
1801
 
1802
- function addChunk(stream, state, chunk, addToFront) {
1803
- if (state.flowing && state.length === 0 && !state.sync) {
1804
- stream.emit('data', chunk);
1805
- stream.read(0);
1806
- } else {
1807
- // update the buffer info.
1808
- state.length += state.objectMode ? 1 : chunk.length;
1809
- if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
1810
 
1811
- if (state.needReadable) emitReadable(stream);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1812
  }
1813
- maybeReadMore(stream, state);
1814
  }
1815
 
1816
- function chunkInvalid(state, chunk) {
1817
- var er;
1818
- if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
1819
- er = new TypeError('Invalid non-string/buffer chunk');
1820
  }
1821
- return er;
1822
  }
1823
 
1824
- // if it's past the high water mark, we can push in some more.
1825
- // Also, if we have no data yet, we can stand some
1826
- // more bytes. This is to work around cases where hwm=0,
1827
- // such as the repl. Also, if the push() triggered a
1828
- // readable event, and the user called read(largeNumber) such that
1829
- // needReadable was set, then we ought to push more, so that another
1830
- // 'readable' event will be triggered.
1831
- function needMoreData(state) {
1832
- return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
1833
  }
1834
 
1835
- Readable.prototype.isPaused = function () {
1836
- return this._readableState.flowing === false;
1837
- };
1838
 
1839
- // backwards compatibility.
1840
- Readable.prototype.setEncoding = function (enc) {
1841
- if (!StringDecoder) StringDecoder = __webpack_require__(90).StringDecoder;
1842
- this._readableState.decoder = new StringDecoder(enc);
1843
- this._readableState.encoding = enc;
1844
- return this;
1845
- };
 
1846
 
1847
- // Don't raise the hwm > 8MB
1848
- var MAX_HWM = 0x800000;
1849
- function computeNewHighWaterMark(n) {
1850
- if (n >= MAX_HWM) {
1851
- n = MAX_HWM;
1852
- } else {
1853
- // Get the next highest power of 2 to prevent increasing hwm excessively in
1854
- // tiny amounts
1855
- n--;
1856
- n |= n >>> 1;
1857
- n |= n >>> 2;
1858
- n |= n >>> 4;
1859
- n |= n >>> 8;
1860
- n |= n >>> 16;
1861
- n++;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1862
  }
1863
- return n;
 
1864
  }
1865
 
1866
- // This function is designed to be inlinable, so please take care when making
1867
- // changes to the function body.
1868
- function howMuchToRead(n, state) {
1869
- if (n <= 0 || state.length === 0 && state.ended) return 0;
1870
- if (state.objectMode) return 1;
1871
- if (n !== n) {
1872
- // Only flow one buffer at a time
1873
- if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
 
1874
  }
1875
- // If we're asking for more than the current hwm, then raise the hwm.
1876
- if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
1877
- if (n <= state.length) return n;
1878
- // Don't have enough
1879
- if (!state.ended) {
1880
- state.needReadable = true;
1881
- return 0;
 
 
1882
  }
1883
- return state.length;
1884
  }
1885
 
1886
- // you can override either this method, or the async _read(n) below.
1887
- Readable.prototype.read = function (n) {
1888
- debug('read', n);
1889
- n = parseInt(n, 10);
1890
- var state = this._readableState;
1891
- var nOrig = n;
1892
-
1893
- if (n !== 0) state.emittedReadable = false;
1894
 
1895
- // if we're doing read(0) to trigger a readable event, but we
1896
- // already have a bunch of data in the buffer, then just trigger
1897
- // the 'readable' event and move on.
1898
- if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
1899
- debug('read: emitReadable', state.length, state.ended);
1900
- if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
1901
- return null;
1902
  }
 
 
1903
 
1904
- n = howMuchToRead(n, state);
 
 
1905
 
1906
- // if we've ended, and we're now clear, then finish it up.
1907
- if (n === 0 && state.ended) {
1908
- if (state.length === 0) endReadable(this);
1909
- return null;
1910
  }
 
 
1911
 
1912
- // All the actual chunk generation logic needs to be
1913
- // *below* the call to _read. The reason is that in certain
1914
- // synthetic stream cases, such as passthrough streams, _read
1915
- // may be a completely synchronous operation which may change
1916
- // the state of the read buffer, providing enough data when
1917
- // before there was *not* enough.
1918
- //
1919
- // So, the steps are:
1920
- // 1. Figure out what the state of things will be after we do
1921
- // a read from the buffer.
1922
- //
1923
- // 2. If that resulting state will trigger a _read, then call _read.
1924
- // Note that this may be asynchronous, or synchronous. Yes, it is
1925
- // deeply ugly to write APIs this way, but that still doesn't mean
1926
- // that the Readable class should behave improperly, as streams are
1927
- // designed to be sync/async agnostic.
1928
- // Take note if the _read call is sync or async (ie, if the read call
1929
- // has returned yet), so that we know whether or not it's safe to emit
1930
- // 'readable' etc.
1931
- //
1932
- // 3. Actually pull the requested chunks out of the buffer and return.
1933
 
1934
- // if we need a readable event, then we need to do some reading.
1935
- var doRead = state.needReadable;
1936
- debug('need readable', doRead);
1937
 
1938
- // if we currently have less than the highWaterMark, then also read some
1939
- if (state.length === 0 || state.length - n < state.highWaterMark) {
1940
- doRead = true;
1941
- debug('length less than watermark', doRead);
1942
  }
 
 
1943
 
1944
- // however, if we've ended, then there's no point, and if we're already
1945
- // reading, then it's unnecessary.
1946
- if (state.ended || state.reading) {
1947
- doRead = false;
1948
- debug('reading or ended', doRead);
1949
- } else if (doRead) {
1950
- debug('do read');
1951
- state.reading = true;
1952
- state.sync = true;
1953
- // if the length is currently zero, then we *need* a readable event.
1954
- if (state.length === 0) state.needReadable = true;
1955
- // call internal read method
1956
- this._read(state.highWaterMark);
1957
- state.sync = false;
1958
- // If _read pushed data synchronously, then `reading` will be false,
1959
- // and we need to re-evaluate how much data we can return to the user.
1960
- if (!state.reading) n = howMuchToRead(nOrig, state);
1961
  }
 
 
1962
 
1963
- var ret;
1964
- if (n > 0) ret = fromList(n, state);else ret = null;
 
 
1965
 
1966
- if (ret === null) {
1967
- state.needReadable = true;
1968
- n = 0;
1969
- } else {
1970
- state.length -= n;
1971
  }
1972
 
1973
- if (state.length === 0) {
1974
- // If we have nothing in the buffer, then we want to know
1975
- // as soon as we *do* get something into the buffer.
1976
- if (!state.ended) state.needReadable = true;
 
 
1977
 
1978
- // If we tried to read() past the EOF, then emit end on the next tick.
1979
- if (nOrig !== n && state.ended) endReadable(this);
 
 
 
 
 
 
 
 
 
 
1980
  }
1981
 
1982
- if (ret !== null) this.emit('data', ret);
 
1983
 
1984
- return ret;
1985
- };
 
 
 
 
 
1986
 
1987
- function onEofChunk(stream, state) {
1988
- if (state.ended) return;
1989
- if (state.decoder) {
1990
- var chunk = state.decoder.end();
1991
- if (chunk && chunk.length) {
1992
- state.buffer.push(chunk);
1993
- state.length += state.objectMode ? 1 : chunk.length;
1994
- }
 
 
1995
  }
1996
- state.ended = true;
1997
 
1998
- // emit 'readable' now to make sure it gets picked up.
1999
- emitReadable(stream);
2000
  }
2001
 
2002
- // Don't emit readable right away in sync mode, because this can trigger
2003
- // another read() call => stack overflow. This way, it might trigger
2004
- // a nextTick recursion warning, but that's not so bad.
2005
- function emitReadable(stream) {
2006
- var state = stream._readableState;
2007
- state.needReadable = false;
2008
- if (!state.emittedReadable) {
2009
- debug('emitReadable', state.flowing);
2010
- state.emittedReadable = true;
2011
- if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);
2012
  }
 
 
 
 
 
 
 
 
2013
  }
2014
 
2015
- function emitReadable_(stream) {
2016
- debug('emit readable');
2017
- stream.emit('readable');
2018
- flow(stream);
2019
  }
2020
 
2021
- // at this point, the user has presumably seen the 'readable' event,
2022
- // and called read() to consume some data. that may have triggered
2023
- // in turn another _read(n) call, in which case reading = true if
2024
- // it's in progress.
2025
- // However, if we're not ended, or reading, and the length < hwm,
2026
- // then go ahead and try to read some more preemptively.
2027
- function maybeReadMore(stream, state) {
2028
- if (!state.readingMore) {
2029
- state.readingMore = true;
2030
- processNextTick(maybeReadMore_, stream, state);
2031
- }
2032
  }
2033
 
2034
- function maybeReadMore_(stream, state) {
2035
- var len = state.length;
2036
- while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
2037
- debug('maybeReadMore read 0');
2038
- stream.read(0);
2039
- if (len === state.length)
2040
- // didn't get any data, stop spinning.
2041
- break;else len = state.length;
2042
- }
2043
- state.readingMore = false;
2044
  }
2045
 
2046
- // abstract method. to be overridden in specific implementation classes.
2047
- // call cb(er, data) where data is <= n in length.
2048
- // for virtual (non-string, non-buffer) streams, "length" is somewhat
2049
- // arbitrary, and perhaps not very meaningful.
2050
- Readable.prototype._read = function (n) {
2051
- this.emit('error', new Error('_read() is not implemented'));
2052
- };
2053
 
2054
- Readable.prototype.pipe = function (dest, pipeOpts) {
2055
- var src = this;
2056
- var state = this._readableState;
 
 
2057
 
2058
- switch (state.pipesCount) {
2059
- case 0:
2060
- state.pipes = dest;
2061
- break;
2062
- case 1:
2063
- state.pipes = [state.pipes, dest];
2064
- break;
2065
- default:
2066
- state.pipes.push(dest);
2067
- break;
2068
- }
2069
- state.pipesCount += 1;
2070
- debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
2071
 
2072
- var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
 
 
 
 
2073
 
2074
- var endFn = doEnd ? onend : unpipe;
2075
- if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);
 
 
2076
 
2077
- dest.on('unpipe', onunpipe);
2078
- function onunpipe(readable, unpipeInfo) {
2079
- debug('onunpipe');
2080
- if (readable === src) {
2081
- if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
2082
- unpipeInfo.hasUnpiped = true;
2083
- cleanup();
2084
- }
2085
- }
2086
  }
 
2087
 
2088
- function onend() {
2089
- debug('onend');
2090
- dest.end();
2091
- }
2092
-
2093
- // when the dest drains, it reduces the awaitDrain counter
2094
- // on the source. This would be more elegant with a .once()
2095
- // handler in flow(), but adding and removing repeatedly is
2096
- // too slow.
2097
- var ondrain = pipeOnDrain(src);
2098
- dest.on('drain', ondrain);
2099
-
2100
- var cleanedUp = false;
2101
- function cleanup() {
2102
- debug('cleanup');
2103
- // cleanup event handlers once the pipe is broken
2104
- dest.removeListener('close', onclose);
2105
- dest.removeListener('finish', onfinish);
2106
- dest.removeListener('drain', ondrain);
2107
- dest.removeListener('error', onerror);
2108
- dest.removeListener('unpipe', onunpipe);
2109
- src.removeListener('end', onend);
2110
- src.removeListener('end', unpipe);
2111
- src.removeListener('data', ondata);
2112
-
2113
- cleanedUp = true;
2114
 
2115
- // if the reader is waiting for a drain event from this
2116
- // specific writer, then it would cause it to never start
2117
- // flowing again.
2118
- // So, if this is awaiting a drain, then we just call it now.
2119
- // If we don't know, then assume that we are waiting for one.
2120
- if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
2121
- }
2122
 
2123
- // If the user pushes more data while we're writing to dest then we'll end up
2124
- // in ondata again. However, we only want to increase awaitDrain once because
2125
- // dest will only emit one 'drain' event for the multiple writes.
2126
- // => Introduce a guard on increasing awaitDrain.
2127
- var increasedAwaitDrain = false;
2128
- src.on('data', ondata);
2129
- function ondata(chunk) {
2130
- debug('ondata');
2131
- increasedAwaitDrain = false;
2132
- var ret = dest.write(chunk);
2133
- if (false === ret && !increasedAwaitDrain) {
2134
- // If the user unpiped during `dest.write()`, it is possible
2135
- // to get stuck in a permanently paused state if that write
2136
- // also returned false.
2137
- // => Check whether `dest` is still a piping destination.
2138
- if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
2139
- debug('false write response, pause', src._readableState.awaitDrain);
2140
- src._readableState.awaitDrain++;
2141
- increasedAwaitDrain = true;
2142
- }
2143
- src.pause();
2144
- }
2145
- }
2146
 
2147
- // if the dest has an error, then stop piping into it.
2148
- // however, don't suppress the throwing behavior for this.
2149
- function onerror(er) {
2150
- debug('onerror', er);
2151
- unpipe();
2152
- dest.removeListener('error', onerror);
2153
- if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
2154
  }
 
2155
 
2156
- // Make sure our error handler is attached before userland ones.
2157
- prependListener(dest, 'error', onerror);
2158
 
2159
- // Both close and finish should trigger unpipe, but only once.
2160
- function onclose() {
2161
- dest.removeListener('finish', onfinish);
2162
- unpipe();
2163
- }
2164
- dest.once('close', onclose);
2165
- function onfinish() {
2166
- debug('onfinish');
2167
- dest.removeListener('close', onclose);
2168
- unpipe();
2169
- }
2170
- dest.once('finish', onfinish);
2171
 
2172
- function unpipe() {
2173
- debug('unpipe');
2174
- src.unpipe(dest);
2175
- }
 
2176
 
2177
- // tell the dest that it's being piped to
2178
- dest.emit('pipe', src);
 
 
 
2179
 
2180
- // start the flow if it hasn't been started already.
2181
- if (!state.flowing) {
2182
- debug('pipe resume');
2183
- src.resume();
2184
- }
2185
 
2186
- return dest;
2187
- };
2188
 
2189
- function pipeOnDrain(src) {
2190
- return function () {
2191
- var state = src._readableState;
2192
- debug('pipeOnDrain', state.awaitDrain);
2193
- if (state.awaitDrain) state.awaitDrain--;
2194
- if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
2195
- state.flowing = true;
2196
- flow(src);
2197
- }
2198
- };
2199
  }
2200
 
2201
- Readable.prototype.unpipe = function (dest) {
2202
- var state = this._readableState;
2203
- var unpipeInfo = { hasUnpiped: false };
2204
 
2205
- // if we're not piping anywhere, then do nothing.
2206
- if (state.pipesCount === 0) return this;
 
 
 
2207
 
2208
- // just one destination. most common case.
2209
- if (state.pipesCount === 1) {
2210
- // passed in one, but it's not the right one.
2211
- if (dest && dest !== state.pipes) return this;
2212
 
2213
- if (!dest) dest = state.pipes;
 
 
 
2214
 
2215
- // got a match.
2216
- state.pipes = null;
2217
- state.pipesCount = 0;
2218
- state.flowing = false;
2219
- if (dest) dest.emit('unpipe', this, unpipeInfo);
2220
- return this;
2221
- }
2222
 
2223
- // slow case. multiple pipe destinations.
 
 
 
2224
 
2225
- if (!dest) {
2226
- // remove all.
2227
- var dests = state.pipes;
2228
- var len = state.pipesCount;
2229
- state.pipes = null;
2230
- state.pipesCount = 0;
2231
- state.flowing = false;
2232
 
2233
- for (var i = 0; i < len; i++) {
2234
- dests[i].emit('unpipe', this, unpipeInfo);
2235
- }return this;
 
 
 
 
2236
  }
2237
 
2238
- // try to find the right one.
2239
- var index = indexOf(state.pipes, dest);
2240
- if (index === -1) return this;
2241
-
2242
- state.pipes.splice(index, 1);
2243
- state.pipesCount -= 1;
2244
- if (state.pipesCount === 1) state.pipes = state.pipes[0];
2245
-
2246
- dest.emit('unpipe', this, unpipeInfo);
2247
-
2248
- return this;
2249
- };
2250
 
2251
- // set up data events if they are asked for
2252
- // Ensure readable listeners eventually get something
2253
- Readable.prototype.on = function (ev, fn) {
2254
- var res = Stream.prototype.on.call(this, ev, fn);
2255
 
2256
- if (ev === 'data') {
2257
- // Start flowing on next tick if stream isn't explicitly paused
2258
- if (this._readableState.flowing !== false) this.resume();
2259
- } else if (ev === 'readable') {
2260
- var state = this._readableState;
2261
- if (!state.endEmitted && !state.readableListening) {
2262
- state.readableListening = state.needReadable = true;
2263
- state.emittedReadable = false;
2264
- if (!state.reading) {
2265
- processNextTick(nReadingNextTick, this);
2266
- } else if (state.length) {
2267
- emitReadable(this);
2268
- }
2269
- }
2270
  }
2271
 
2272
- return res;
2273
- };
2274
- Readable.prototype.addListener = Readable.prototype.on;
 
 
 
2275
 
2276
- function nReadingNextTick(self) {
2277
- debug('readable nexttick read 0');
2278
- self.read(0);
2279
  }
2280
 
2281
- // pause() and resume() are remnants of the legacy readable stream API
2282
- // If the user uses them, then switch into old mode.
2283
- Readable.prototype.resume = function () {
2284
- var state = this._readableState;
2285
- if (!state.flowing) {
2286
- debug('resume');
2287
- state.flowing = true;
2288
- resume(this, state);
2289
- }
2290
- return this;
2291
- };
2292
 
2293
- function resume(stream, state) {
2294
- if (!state.resumeScheduled) {
2295
- state.resumeScheduled = true;
2296
- processNextTick(resume_, stream, state);
 
2297
  }
2298
  }
2299
 
2300
- function resume_(stream, state) {
2301
- if (!state.reading) {
2302
- debug('resume read 0');
2303
- stream.read(0);
 
 
 
 
 
2304
  }
2305
-
2306
- state.resumeScheduled = false;
2307
- state.awaitDrain = 0;
2308
- stream.emit('resume');
2309
- flow(stream);
2310
- if (state.flowing && !state.reading) stream.read(0);
2311
  }
2312
 
2313
- Readable.prototype.pause = function () {
2314
- debug('call pause flowing=%j', this._readableState.flowing);
2315
- if (false !== this._readableState.flowing) {
2316
- debug('pause');
2317
- this._readableState.flowing = false;
2318
- this.emit('pause');
 
 
 
2319
  }
2320
- return this;
2321
- };
2322
-
2323
- function flow(stream) {
2324
- var state = stream._readableState;
2325
- debug('flow', state.flowing);
2326
- while (state.flowing && stream.read() !== null) {}
2327
  }
2328
 
2329
- // wrap an old-style stream as the async data source.
2330
- // This is *not* part of the readable stream interface.
2331
- // It is an ugly unfortunate mess of history.
2332
- Readable.prototype.wrap = function (stream) {
2333
- var state = this._readableState;
2334
- var paused = false;
2335
-
2336
- var self = this;
2337
- stream.on('end', function () {
2338
- debug('wrapped end');
2339
- if (state.decoder && !state.ended) {
2340
- var chunk = state.decoder.end();
2341
- if (chunk && chunk.length) self.push(chunk);
2342
- }
2343
 
2344
- self.push(null);
2345
- });
 
 
 
 
 
 
 
 
 
 
 
 
2346
 
2347
- stream.on('data', function (chunk) {
2348
- debug('wrapped data');
2349
- if (state.decoder) chunk = state.decoder.write(chunk);
 
 
 
 
 
 
 
 
 
 
 
2350
 
2351
- // don't skip over falsy values in objectMode
2352
- if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
 
 
 
2353
 
2354
- var ret = self.push(chunk);
2355
- if (!ret) {
2356
- paused = true;
2357
- stream.pause();
2358
- }
2359
- });
2360
 
2361
- // proxy all the other methods.
2362
- // important when wrapping filters and duplexes.
2363
- for (var i in stream) {
2364
- if (this[i] === undefined && typeof stream[i] === 'function') {
2365
- this[i] = function (method) {
2366
- return function () {
2367
- return stream[method].apply(stream, arguments);
2368
- };
2369
- }(i);
2370
  }
 
2371
  }
2372
 
2373
- // proxy certain important events.
2374
- for (var n = 0; n < kProxyEvents.length; n++) {
2375
- stream.on(kProxyEvents[n], self.emit.bind(self, kProxyEvents[n]));
 
 
 
 
 
 
 
2376
  }
2377
 
2378
- // when we try to consume some more bytes, simply unpause the
2379
- // underlying stream.
2380
- self._read = function (n) {
2381
- debug('wrapped _read', n);
2382
- if (paused) {
2383
- paused = false;
2384
- stream.resume();
2385
  }
2386
- };
2387
-
2388
- return self;
2389
- };
2390
 
2391
- // exposed for testing purposes only.
2392
- Readable._fromList = fromList;
2393
 
2394
- // Pluck off n bytes from an array of buffers.
2395
- // Length is the combined lengths of all the buffers in the list.
2396
- // This function is designed to be inlinable, so please take care when making
2397
- // changes to the function body.
2398
- function fromList(n, state) {
2399
- // nothing buffered
2400
- if (state.length === 0) return null;
 
 
2401
 
2402
- var ret;
2403
- if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
2404
- // read it all, truncate the list
2405
- if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
2406
- state.buffer.clear();
 
 
2407
  } else {
2408
- // read part of list
2409
- ret = fromListPartial(n, state.buffer, state.decoder);
2410
  }
2411
-
2412
- return ret;
2413
  }
2414
 
2415
- // Extracts only enough buffered data to satisfy the amount requested.
2416
- // This function is designed to be inlinable, so please take care when making
2417
- // changes to the function body.
2418
- function fromListPartial(n, list, hasStrings) {
2419
- var ret;
2420
- if (n < list.head.data.length) {
2421
- // slice is the same for buffers and strings
2422
- ret = list.head.data.slice(0, n);
2423
- list.head.data = list.head.data.slice(n);
2424
- } else if (n === list.head.data.length) {
2425
- // first chunk is a perfect match
2426
- ret = list.shift();
2427
  } else {
2428
- // result spans more than one buffer
2429
- ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
2430
  }
2431
- return ret;
2432
  }
2433
 
2434
- // Copies a specified amount of characters from the list of buffered data
2435
- // chunks.
2436
- // This function is designed to be inlinable, so please take care when making
2437
- // changes to the function body.
2438
- function copyFromBufferString(n, list) {
2439
- var p = list.head;
2440
- var c = 1;
2441
- var ret = p.data;
2442
- n -= ret.length;
2443
- while (p = p.next) {
2444
- var str = p.data;
2445
- var nb = n > str.length ? str.length : n;
2446
- if (nb === str.length) ret += str;else ret += str.slice(0, n);
2447
- n -= nb;
2448
- if (n === 0) {
2449
- if (nb === str.length) {
2450
- ++c;
2451
- if (p.next) list.head = p.next;else list.head = list.tail = null;
2452
- } else {
2453
- list.head = p;
2454
- p.data = str.slice(nb);
2455
- }
2456
- break;
2457
- }
2458
- ++c;
2459
  }
2460
- list.length -= c;
2461
- return ret;
2462
  }
2463
 
2464
- // Copies a specified amount of bytes from the list of buffered data chunks.
2465
- // This function is designed to be inlinable, so please take care when making
2466
- // changes to the function body.
2467
- function copyFromBuffer(n, list) {
2468
- var ret = Buffer.allocUnsafe(n);
2469
- var p = list.head;
2470
- var c = 1;
2471
- p.data.copy(ret);
2472
- n -= p.data.length;
2473
- while (p = p.next) {
2474
- var buf = p.data;
2475
- var nb = n > buf.length ? buf.length : n;
2476
- buf.copy(ret, ret.length - n, 0, nb);
2477
- n -= nb;
2478
- if (n === 0) {
2479
- if (nb === buf.length) {
2480
- ++c;
2481
- if (p.next) list.head = p.next;else list.head = list.tail = null;
2482
- } else {
2483
- list.head = p;
2484
- p.data = buf.slice(nb);
2485
- }
2486
- break;
2487
- }
2488
- ++c;
2489
  }
2490
- list.length -= c;
2491
- return ret;
2492
  }
2493
 
2494
- function endReadable(stream) {
2495
- var state = stream._readableState;
2496
-
2497
- // If we get here before consuming all the bytes, then that is a
2498
- // bug in node. Should never happen.
2499
- if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
2500
 
2501
- if (!state.endEmitted) {
2502
- state.ended = true;
2503
- processNextTick(endReadableNT, state, stream);
2504
  }
 
 
2505
  }
2506
 
2507
- function endReadableNT(state, stream) {
2508
- // Check that we didn't get one last unshift.
2509
- if (!state.endEmitted && state.length === 0) {
2510
- state.endEmitted = true;
2511
- stream.readable = false;
2512
- stream.emit('end');
2513
- }
2514
  }
2515
 
2516
- function forEach(xs, f) {
2517
- for (var i = 0, l = xs.length; i < l; i++) {
2518
- f(xs[i], i);
2519
- }
2520
  }
2521
 
2522
- function indexOf(xs, x) {
2523
- for (var i = 0, l = xs.length; i < l; i++) {
2524
- if (xs[i] === x) return i;
2525
  }
2526
- return -1;
 
2527
  }
2528
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9), __webpack_require__(1)))
2529
-
2530
- /***/ }),
2531
-
2532
- /***/ 265:
2533
- /***/ (function(module, exports) {
2534
 
2535
- var toString = {}.toString;
2536
-
2537
- module.exports = Array.isArray || function (arr) {
2538
- return toString.call(arr) == '[object Array]';
2539
- };
2540
 
 
 
 
2541
 
2542
- /***/ }),
 
 
 
 
 
 
2543
 
2544
- /***/ 266:
2545
- /***/ (function(module, exports, __webpack_require__) {
 
2546
 
2547
- module.exports = __webpack_require__(55).EventEmitter;
 
 
 
 
 
2548
 
 
 
 
 
 
2549
 
2550
- /***/ }),
 
2551
 
2552
- /***/ 267:
2553
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2554
 
2555
- "use strict";
 
2556
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2557
 
2558
- /*<replacement>*/
 
 
 
2559
 
2560
- var processNextTick = __webpack_require__(56);
2561
- /*</replacement>*/
 
2562
 
2563
- // undocumented cb() API, needed for core, not for public API
2564
- function destroy(err, cb) {
2565
- var _this = this;
2566
 
2567
- var readableDestroyed = this._readableState && this._readableState.destroyed;
2568
- var writableDestroyed = this._writableState && this._writableState.destroyed;
2569
 
2570
- if (readableDestroyed || writableDestroyed) {
2571
- if (cb) {
2572
- cb(err);
2573
- } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
2574
- processNextTick(emitErrorNT, this, err);
 
 
 
 
 
 
 
2575
  }
2576
- return;
2577
  }
2578
 
2579
- // we set destroyed to true before firing error callbacks in order
2580
- // to make it re-entrance safe in case destroy() is called within callbacks
2581
 
2582
- if (this._readableState) {
2583
- this._readableState.destroyed = true;
2584
- }
2585
 
2586
- // if this is a duplex stream mark the writable part as destroyed as well
2587
- if (this._writableState) {
2588
- this._writableState.destroyed = true;
 
 
 
 
 
 
 
2589
  }
 
 
2590
 
2591
- this._destroy(err || null, function (err) {
2592
- if (!cb && err) {
2593
- processNextTick(emitErrorNT, _this, err);
2594
- if (_this._writableState) {
2595
- _this._writableState.errorEmitted = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2596
  }
2597
- } else if (cb) {
2598
- cb(err);
 
 
 
 
 
 
 
 
 
 
 
2599
  }
2600
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2601
  }
2602
 
2603
- function undestroy() {
2604
- if (this._readableState) {
2605
- this._readableState.destroyed = false;
2606
- this._readableState.reading = false;
2607
- this._readableState.ended = false;
2608
- this._readableState.endEmitted = false;
2609
  }
 
 
2610
 
2611
- if (this._writableState) {
2612
- this._writableState.destroyed = false;
2613
- this._writableState.ended = false;
2614
- this._writableState.ending = false;
2615
- this._writableState.finished = false;
2616
- this._writableState.errorEmitted = false;
 
 
 
 
 
2617
  }
 
 
2618
  }
2619
 
2620
- function emitErrorNT(self, err) {
2621
- self.emit('error', err);
2622
  }
2623
 
2624
- module.exports = {
2625
- destroy: destroy,
2626
- undestroy: undestroy
2627
- };
 
 
 
2628
 
2629
- /***/ }),
 
 
 
 
2630
 
2631
- /***/ 269:
 
2632
  /***/ (function(module, exports, __webpack_require__) {
2633
 
2634
  "use strict";
2635
- // Copyright Joyent, Inc. and other Node contributors.
2636
  //
2637
  // Permission is hereby granted, free of charge, to any person obtaining a
2638
  // copy of this software and associated documentation files (the
@@ -2653,3059 +2703,3904 @@ module.exports = {
2653
  // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2654
  // USE OR OTHER DEALINGS IN THE SOFTWARE.
2655
 
2656
- // a transform stream is a readable/writable stream where you do
2657
- // something with the data. Sometimes it's called a "filter",
2658
- // but that's not a great name for it, since that implies a thing where
2659
- // some bits pass through, and others are simply ignored. (That would
2660
- // be a valid example of a transform, of course.)
2661
- //
2662
- // While the output is causally related to the input, it's not a
2663
- // necessarily symmetric or synchronous transformation. For example,
2664
- // a zlib stream might take multiple plain-text writes(), and then
2665
- // emit a single compressed chunk some time in the future.
2666
- //
2667
- // Here's how this works:
2668
- //
2669
- // The Transform stream has all the aspects of the readable and writable
2670
- // stream classes. When you write(chunk), that calls _write(chunk,cb)
2671
- // internally, and returns false if there's a lot of pending writes
2672
- // buffered up. When you call read(), that calls _read(n) until
2673
- // there's enough pending readable data buffered up.
2674
- //
2675
- // In a transform stream, the written data is placed in a buffer. When
2676
- // _read(n) is called, it transforms the queued up data, calling the
2677
- // buffered _write cb's as it consumes chunks. If consuming a single
2678
- // written chunk would result in multiple output chunks, then the first
2679
- // outputted bit calls the readcb, and subsequent chunks just go into
2680
- // the read buffer, and will cause it to emit 'readable' if necessary.
2681
- //
2682
- // This way, back-pressure is actually determined by the reading side,
2683
- // since _read has to be called to start processing a new chunk. However,
2684
- // a pathological inflate type of transform can cause excessive buffering
2685
- // here. For example, imagine a stream where every byte of input is
2686
- // interpreted as an integer from 0-255, and then results in that many
2687
- // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
2688
- // 1kb of data being output. In this case, you could write a very small
2689
- // amount of input, and end up with a very large amount of output. In
2690
- // such a pathological inflating mechanism, there'd be no way to tell
2691
- // the system to stop doing the transform. A single 4MB write could
2692
- // cause the system to run out of memory.
2693
- //
2694
- // However, even in such a pathological case, only a single written chunk
2695
- // would be consumed, and then the rest would wait (un-transformed) until
2696
- // the results of the previous transformed chunk were consumed.
2697
-
2698
-
2699
 
2700
- module.exports = Transform;
2701
 
2702
- var Duplex = __webpack_require__(32);
2703
 
2704
  /*<replacement>*/
2705
- var util = __webpack_require__(46);
2706
- util.inherits = __webpack_require__(22);
2707
- /*</replacement>*/
2708
 
2709
- util.inherits(Transform, Duplex);
 
2710
 
2711
- function TransformState(stream) {
2712
- this.afterTransform = function (er, data) {
2713
- return afterTransform(stream, er, data);
2714
- };
2715
 
2716
- this.needTransform = false;
2717
- this.transforming = false;
2718
- this.writecb = null;
2719
- this.writechunk = null;
2720
- this.writeencoding = null;
 
2721
  }
2722
 
2723
- function afterTransform(stream, er, data) {
2724
- var ts = stream._transformState;
2725
- ts.transforming = false;
 
2726
 
2727
- var cb = ts.writecb;
 
 
 
 
 
 
2728
 
2729
- if (!cb) {
2730
- return stream.emit('error', new Error('write callback called multiple times'));
2731
- }
2732
 
2733
- ts.writechunk = null;
2734
- ts.writecb = null;
 
2735
 
2736
- if (data !== null && data !== undefined) stream.push(data);
2737
 
2738
- cb(er);
 
 
 
2739
 
2740
- var rs = stream._readableState;
2741
- rs.reading = false;
2742
- if (rs.needReadable || rs.length < rs.highWaterMark) {
2743
- stream._read(rs.highWaterMark);
2744
- }
2745
- }
2746
 
2747
- function Transform(options) {
2748
- if (!(this instanceof Transform)) return new Transform(options);
 
2749
 
2750
- Duplex.call(this, options);
 
 
 
 
 
 
 
 
 
2751
 
2752
- this._transformState = new TransformState(this);
2753
 
2754
- var stream = this;
2755
 
2756
- // start out asking for a readable event once data is transformed.
2757
- this._readableState.needReadable = true;
2758
 
2759
- // we have implemented the _read method, and done the other things
2760
- // that Readable wants before the first _read call, so unset the
2761
- // sync guard flag.
2762
- this._readableState.sync = false;
2763
 
2764
- if (options) {
2765
- if (typeof options.transform === 'function') this._transform = options.transform;
2766
 
2767
- if (typeof options.flush === 'function') this._flush = options.flush;
2768
- }
 
2769
 
2770
- // When the writable side finishes, then flush out anything remaining.
2771
- this.once('prefinish', function () {
2772
- if (typeof this._flush === 'function') this._flush(function (er, data) {
2773
- done(stream, er, data);
2774
- });else done(stream);
2775
- });
2776
- }
2777
 
2778
- Transform.prototype.push = function (chunk, encoding) {
2779
- this._transformState.needTransform = false;
2780
- return Duplex.prototype.push.call(this, chunk, encoding);
2781
- };
 
 
2782
 
2783
- // This is the part where you do stuff!
2784
- // override this function in implementation classes.
2785
- // 'chunk' is an input chunk.
2786
- //
2787
- // Call `push(newChunk)` to pass along transformed output
2788
- // to the readable side. You may call 'push' zero or more times.
2789
- //
2790
- // Call `cb(err)` when you are done with this chunk. If you pass
2791
- // an error, then that'll put the hurt on the whole operation. If you
2792
- // never call cb(), then you'll never get another chunk.
2793
- Transform.prototype._transform = function (chunk, encoding, cb) {
2794
- throw new Error('_transform() is not implemented');
2795
- };
2796
 
2797
- Transform.prototype._write = function (chunk, encoding, cb) {
2798
- var ts = this._transformState;
2799
- ts.writecb = cb;
2800
- ts.writechunk = chunk;
2801
- ts.writeencoding = encoding;
2802
- if (!ts.transforming) {
2803
- var rs = this._readableState;
2804
- if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
2805
- }
2806
- };
2807
 
2808
- // Doesn't matter what the args are here.
2809
- // _transform does all the work.
2810
- // That we got here means that the readable side wants more data.
2811
- Transform.prototype._read = function (n) {
2812
- var ts = this._transformState;
 
 
 
2813
 
2814
- if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
2815
- ts.transforming = true;
2816
- this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
2817
- } else {
2818
- // mark that we need a transform, so that any data that comes in
2819
- // will get processed, now that we've asked for it.
2820
- ts.needTransform = true;
2821
- }
2822
- };
2823
 
2824
- Transform.prototype._destroy = function (err, cb) {
2825
- var _this = this;
 
 
 
2826
 
2827
- Duplex.prototype._destroy.call(this, err, function (err2) {
2828
- cb(err2);
2829
- _this.emit('close');
2830
- });
2831
- };
2832
 
2833
- function done(stream, er, data) {
2834
- if (er) return stream.emit('error', er);
 
 
2835
 
2836
- if (data !== null && data !== undefined) stream.push(data);
 
2837
 
2838
- // if there's nothing in the write buffer, then that means
2839
- // that nothing more will ever be provided
2840
- var ws = stream._writableState;
2841
- var ts = stream._transformState;
2842
 
2843
- if (ws.length) throw new Error('Calling transform done when ws.length != 0');
 
 
 
 
2844
 
2845
- if (ts.transforming) throw new Error('Calling transform done when still transforming');
 
 
 
2846
 
2847
- return stream.push(null);
2848
- }
 
 
2849
 
2850
- /***/ }),
 
2851
 
2852
- /***/ 270:
2853
- /***/ (function(module, exports, __webpack_require__) {
2854
 
2855
- "use strict";
 
2856
 
 
 
 
2857
 
2858
- Object.defineProperty(exports, "__esModule", {
2859
- value: true
2860
- });
2861
- exports.default = ProcessNodes;
2862
 
2863
- var _elementTypes = __webpack_require__(450);
 
2864
 
2865
- var _elementTypes2 = _interopRequireDefault(_elementTypes);
 
2866
 
2867
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
2868
 
2869
- /**
2870
- * Tests a htmlparser2 node and returns whether is it a text node at the start and end of the line containing only
2871
- * white space. This allows these node types to be excluded from the rendering because they are unnecessary.
2872
- *
2873
- * @param {Object} node The element object as created by htmlparser2
2874
- * @returns {boolean} Whether
2875
- */
2876
- var filterOutEmptyTextNodes = function filterOutEmptyTextNodes(node) {
2877
- return !(node.type === 'text' && /\r?\n/.test(node.data) && node.data.trim() === '');
2878
  };
2879
 
2880
- /**
2881
- * Converts a htmlparser2 node to a React element
2882
- *
2883
- * @param {Object} node The htmlparser2 node to convert
2884
- * @param {Number} index The index of the current node
2885
- * @returns {React.Element}
2886
- */
2887
- var convertNodeToElement = function convertNodeToElement(node, index) {
2888
- var key = 'rhp-' + index;
2889
- return _elementTypes2.default[node.type](node, key);
2890
- };
2891
 
2892
- /**
2893
- * Processes the nodes generated by htmlparser2 and convert them all into React elements
2894
- *
2895
- * @param {Object[]} nodes List of nodes to process
2896
- * @returns {React.Element[]} The list of processed React elements
2897
- */
2898
- function ProcessNodes(nodes) {
 
2899
 
2900
- return nodes.filter(filterOutEmptyTextNodes).map(function (node, index) {
2901
- return convertNodeToElement(node, index);
2902
  });
 
 
 
 
2903
  }
2904
 
2905
- /***/ }),
2906
-
2907
- /***/ 271:
2908
- /***/ (function(module, exports, __webpack_require__) {
2909
 
2910
- "use strict";
 
 
2911
 
 
 
 
 
 
 
2912
 
2913
- Object.defineProperty(exports, "__esModule", {
2914
- value: true
2915
- });
2916
 
2917
- var _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; };
 
2918
 
2919
- exports.default = GeneratePropsFromAttributes;
 
2920
 
2921
- var _HtmlAttributesToReact = __webpack_require__(453);
2922
 
2923
- var _HtmlAttributesToReact2 = _interopRequireDefault(_HtmlAttributesToReact);
2924
 
2925
- var _InlineStyleToObject = __webpack_require__(456);
 
2926
 
2927
- var _InlineStyleToObject2 = _interopRequireDefault(_InlineStyleToObject);
 
2928
 
2929
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
2930
 
2931
- /**
2932
- * Generates props for a React element from an object of HTML attributes
2933
- *
2934
- * @param {Object} attributes The HTML attributes
2935
- * @param {String} key The key to give the react element
2936
- */
2937
- function GeneratePropsFromAttributes(attributes, key) {
2938
 
2939
- // generate props
2940
- var props = _extends({}, (0, _HtmlAttributesToReact2.default)(attributes), { key: key });
 
 
 
 
2941
 
2942
- // if there is a style prop then convert it to a React style object
2943
- if (props.style) {
2944
- props.style = (0, _InlineStyleToObject2.default)(props.style);
 
2945
  }
2946
-
2947
- return props;
 
 
 
 
2948
  }
2949
 
2950
- /***/ }),
 
 
 
2951
 
2952
- /***/ 32:
2953
- /***/ (function(module, exports, __webpack_require__) {
 
2954
 
2955
- "use strict";
2956
- // Copyright Joyent, Inc. and other Node contributors.
2957
- //
2958
- // Permission is hereby granted, free of charge, to any person obtaining a
2959
- // copy of this software and associated documentation files (the
2960
- // "Software"), to deal in the Software without restriction, including
2961
- // without limitation the rights to use, copy, modify, merge, publish,
2962
- // distribute, sublicense, and/or sell copies of the Software, and to permit
2963
- // persons to whom the Software is furnished to do so, subject to the
2964
- // following conditions:
2965
- //
2966
- // The above copyright notice and this permission notice shall be included
2967
- // in all copies or substantial portions of the Software.
2968
- //
2969
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2970
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2971
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2972
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2973
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2974
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2975
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
2976
 
2977
- // a duplex stream is just a stream that is both readable and writable.
2978
- // Since JS doesn't have multiple prototypal inheritance, this class
2979
- // prototypally inherits from Readable, and then parasitically from
2980
- // Writable.
2981
 
 
2982
 
 
 
 
 
2983
 
2984
- /*<replacement>*/
 
2985
 
2986
- var processNextTick = __webpack_require__(56);
2987
- /*</replacement>*/
2988
 
2989
- /*<replacement>*/
2990
- var objectKeys = Object.keys || function (obj) {
2991
- var keys = [];
2992
- for (var key in obj) {
2993
- keys.push(key);
2994
- }return keys;
2995
  };
2996
- /*</replacement>*/
2997
 
2998
- module.exports = Duplex;
 
2999
 
3000
- /*<replacement>*/
3001
- var util = __webpack_require__(46);
3002
- util.inherits = __webpack_require__(22);
3003
- /*</replacement>*/
3004
 
3005
- var Readable = __webpack_require__(264);
3006
- var Writable = __webpack_require__(89);
 
3007
 
3008
- util.inherits(Duplex, Readable);
 
 
 
 
 
 
3009
 
3010
- var keys = objectKeys(Writable.prototype);
3011
- for (var v = 0; v < keys.length; v++) {
3012
- var method = keys[v];
3013
- if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
 
3014
  }
3015
 
3016
- function Duplex(options) {
3017
- if (!(this instanceof Duplex)) return new Duplex(options);
3018
-
3019
- Readable.call(this, options);
3020
- Writable.call(this, options);
 
 
 
 
 
 
 
 
3021
 
3022
- if (options && options.readable === false) this.readable = false;
3023
 
3024
- if (options && options.writable === false) this.writable = false;
 
 
3025
 
3026
- this.allowHalfOpen = true;
3027
- if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3028
 
3029
- this.once('end', onend);
3030
  }
3031
 
3032
- // the no-half-open enforcer
3033
- function onend() {
3034
- // if we allow half-open state, or if the writable side ended,
3035
- // then we're ok.
3036
- if (this.allowHalfOpen || this._writableState.ended) return;
3037
-
3038
- // no more data can be written.
3039
- // But allow more writes to happen in this tick.
3040
- processNextTick(onEndNT, this);
3041
  }
3042
 
3043
- function onEndNT(self) {
3044
- self.end();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3045
  }
3046
 
3047
- Object.defineProperty(Duplex.prototype, 'destroyed', {
3048
- get: function () {
3049
- if (this._readableState === undefined || this._writableState === undefined) {
3050
- return false;
3051
- }
3052
- return this._readableState.destroyed && this._writableState.destroyed;
3053
- },
3054
- set: function (value) {
3055
- // we ignore the value if the stream
3056
- // has not been initialized yet
3057
- if (this._readableState === undefined || this._writableState === undefined) {
3058
- return;
3059
- }
3060
 
3061
- // backward compatibility, the user is explicitly
3062
- // managing destroyed
3063
- this._readableState.destroyed = value;
3064
- this._writableState.destroyed = value;
3065
- }
3066
- });
3067
 
3068
- Duplex.prototype._destroy = function (err, cb) {
3069
- this.push(null);
3070
- this.end();
3071
 
3072
- processNextTick(cb, err);
3073
- };
 
3074
 
3075
- function forEach(xs, f) {
3076
- for (var i = 0, l = xs.length; i < l; i++) {
3077
- f(xs[i], i);
 
 
 
 
 
 
 
 
3078
  }
3079
  }
3080
 
3081
- /***/ }),
3082
-
3083
- /***/ 38:
3084
- /***/ (function(module, exports, __webpack_require__) {
3085
-
3086
- var Parser = __webpack_require__(258),
3087
- DomHandler = __webpack_require__(419);
3088
-
3089
- function defineProp(name, value){
3090
- delete module.exports[name];
3091
- module.exports[name] = value;
3092
- return value;
3093
  }
3094
 
3095
- module.exports = {
3096
- Parser: Parser,
3097
- Tokenizer: __webpack_require__(259),
3098
- ElementType: __webpack_require__(45),
3099
- DomHandler: DomHandler,
3100
- get FeedHandler(){
3101
- return defineProp("FeedHandler", __webpack_require__(421));
3102
- },
3103
- get Stream(){
3104
- return defineProp("Stream", __webpack_require__(422));
3105
- },
3106
- get WritableStream(){
3107
- return defineProp("WritableStream", __webpack_require__(263));
3108
- },
3109
- get ProxyHandler(){
3110
- return defineProp("ProxyHandler", __webpack_require__(436));
3111
- },
3112
- get DomUtils(){
3113
- return defineProp("DomUtils", __webpack_require__(437));
3114
- },
3115
- get CollectingHandler(){
3116
- return defineProp("CollectingHandler", __webpack_require__(449));
3117
- },
3118
- // For legacy support
3119
- DefaultHandler: DomHandler,
3120
- get RssHandler(){
3121
- return defineProp("RssHandler", this.FeedHandler);
3122
- },
3123
- //helper methods
3124
- parseDOM: function(data, options){
3125
- var handler = new DomHandler(options);
3126
- new Parser(handler, options).end(data);
3127
- return handler.dom;
3128
- },
3129
- parseFeed: function(feed, options){
3130
- var handler = new module.exports.FeedHandler(options);
3131
- new Parser(handler, options).end(feed);
3132
- return handler.dom;
3133
- },
3134
- createDomStream: function(cb, options, elementCb){
3135
- var handler = new DomHandler(cb, options, elementCb);
3136
- return new Parser(handler, options);
3137
- },
3138
- // List of all events that the parser emits
3139
- EVENTS: { /* Format: eventname: number of arguments */
3140
- attribute: 2,
3141
- cdatastart: 0,
3142
- cdataend: 0,
3143
- text: 1,
3144
- processinginstruction: 2,
3145
- comment: 1,
3146
- commentend: 0,
3147
- closetag: 1,
3148
- opentag: 2,
3149
- opentagname: 1,
3150
- error: 1,
3151
- end: 0
3152
- }
3153
- };
3154
-
3155
-
3156
- /***/ }),
3157
-
3158
- /***/ 39:
3159
- /***/ (function(module, exports, __webpack_require__) {
3160
-
3161
- /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["Backbone"] = __webpack_require__(482);
3162
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9)))
3163
-
3164
- /***/ }),
3165
-
3166
- /***/ 416:
3167
- /***/ (function(module, exports, __webpack_require__) {
3168
-
3169
- "use strict";
3170
-
3171
 
3172
- Object.defineProperty(exports, "__esModule", {
3173
- value: true
3174
- });
 
3175
 
3176
- var _HtmlParser = __webpack_require__(417);
 
 
 
 
 
3177
 
3178
- var _HtmlParser2 = _interopRequireDefault(_HtmlParser);
 
 
 
 
 
 
 
 
3179
 
3180
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3181
 
3182
- exports.default = _HtmlParser2.default;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3183
 
3184
- /***/ }),
 
 
 
 
 
 
 
 
 
3185
 
3186
- /***/ 417:
3187
- /***/ (function(module, exports, __webpack_require__) {
3188
 
3189
- "use strict";
 
 
 
3190
 
 
 
 
3191
 
3192
- Object.defineProperty(exports, "__esModule", {
3193
- value: true
3194
- });
3195
- exports.default = HtmlParser;
3196
 
3197
- var _htmlparser = __webpack_require__(38);
 
3198
 
3199
- var _htmlparser2 = _interopRequireDefault(_htmlparser);
 
 
 
 
 
 
 
3200
 
3201
- var _ProcessNodes = __webpack_require__(270);
3202
 
3203
- var _ProcessNodes2 = _interopRequireDefault(_ProcessNodes);
 
 
 
 
3204
 
3205
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
3206
 
3207
- /**
3208
- * Parses a HTML string and returns a list of React components generated from it
3209
- *
3210
- * @param {String} html The HTML to convert into React components
3211
- * @returns {Array} List of top level React elements
3212
- */
3213
- function HtmlParser(html) {
3214
- var nodes = _htmlparser2.default.parseDOM(html);
3215
- return (0, _ProcessNodes2.default)(nodes);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3216
  }
3217
 
3218
- /***/ }),
3219
-
3220
- /***/ 418:
3221
- /***/ (function(module, exports) {
3222
-
3223
- module.exports = {"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}
3224
-
3225
- /***/ }),
3226
-
3227
- /***/ 419:
3228
- /***/ (function(module, exports, __webpack_require__) {
3229
-
3230
- var ElementType = __webpack_require__(45);
3231
 
3232
- var re_whitespace = /\s+/g;
3233
- var NodePrototype = __webpack_require__(262);
3234
- var ElementPrototype = __webpack_require__(420);
 
 
 
 
 
 
3235
 
3236
- function DomHandler(callback, options, elementCB){
3237
- if(typeof callback === "object"){
3238
- elementCB = options;
3239
- options = callback;
3240
- callback = null;
3241
- } else if(typeof options === "function"){
3242
- elementCB = options;
3243
- options = defaultOpts;
3244
- }
3245
- this._callback = callback;
3246
- this._options = options || defaultOpts;
3247
- this._elementCB = elementCB;
3248
- this.dom = [];
3249
- this._done = false;
3250
- this._tagStack = [];
3251
- this._parser = this._parser || null;
3252
  }
3253
 
3254
- //default options
3255
- var defaultOpts = {
3256
- normalizeWhitespace: false, //Replace all whitespace with single spaces
3257
- withStartIndices: false, //Add startIndex properties to nodes
3258
- withEndIndices: false, //Add endIndex properties to nodes
3259
- };
 
 
 
 
 
 
 
3260
 
3261
- DomHandler.prototype.onparserinit = function(parser){
3262
- this._parser = parser;
3263
- };
 
 
3264
 
3265
- //Resets the handler back to starting state
3266
- DomHandler.prototype.onreset = function(){
3267
- DomHandler.call(this, this._callback, this._options, this._elementCB);
 
 
3268
  };
 
3269
 
3270
- //Signals the handler that parsing is done
3271
- DomHandler.prototype.onend = function(){
3272
- if(this._done) return;
3273
- this._done = true;
3274
- this._parser = null;
3275
- this._handleCallback(null);
3276
- };
3277
 
3278
- DomHandler.prototype._handleCallback =
3279
- DomHandler.prototype.onerror = function(error){
3280
- if(typeof this._callback === "function"){
3281
- this._callback(error, this.dom);
3282
- } else {
3283
- if(error) throw error;
3284
- }
3285
- };
3286
 
3287
- DomHandler.prototype.onclosetag = function(){
3288
- //if(this._tagStack.pop().name !== name) this._handleCallback(Error("Tagname didn't match!"));
3289
-
3290
- var elem = this._tagStack.pop();
3291
 
3292
- if(this._options.withEndIndices){
3293
- elem.endIndex = this._parser.endIndex;
3294
- }
3295
 
3296
- if(this._elementCB) this._elementCB(elem);
 
 
 
 
 
 
 
3297
  };
3298
 
3299
- DomHandler.prototype._createDomElement = function(properties){
3300
- if (!this._options.withDomLvl1) return properties;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3301
 
3302
- var element;
3303
- if (properties.type === "tag") {
3304
- element = Object.create(ElementPrototype);
3305
- } else {
3306
- element = Object.create(NodePrototype);
3307
- }
 
3308
 
3309
- for (var key in properties) {
3310
- if (properties.hasOwnProperty(key)) {
3311
- element[key] = properties[key];
3312
- }
3313
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3314
 
3315
- return element;
 
 
 
 
 
 
 
 
 
 
 
 
 
3316
  };
3317
 
3318
- DomHandler.prototype._addDomElement = function(element){
3319
- var parent = this._tagStack[this._tagStack.length - 1];
3320
- var siblings = parent ? parent.children : this.dom;
3321
- var previousSibling = siblings[siblings.length - 1];
3322
 
3323
- element.next = null;
 
3324
 
3325
- if(this._options.withStartIndices){
3326
- element.startIndex = this._parser.startIndex;
3327
- }
3328
- if(this._options.withEndIndices){
3329
- element.endIndex = this._parser.endIndex;
3330
- }
3331
-
3332
- if(previousSibling){
3333
- element.prev = previousSibling;
3334
- previousSibling.next = element;
3335
- } else {
3336
- element.prev = null;
3337
- }
3338
-
3339
- siblings.push(element);
3340
- element.parent = parent || null;
3341
  };
3342
 
3343
- DomHandler.prototype.onopentag = function(name, attribs){
3344
- var properties = {
3345
- type: name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag,
3346
- name: name,
3347
- attribs: attribs,
3348
- children: []
3349
- };
3350
 
3351
- var element = this._createDomElement(properties);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3352
 
3353
- this._addDomElement(element);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3354
 
3355
- this._tagStack.push(element);
3356
- };
 
 
 
 
 
 
 
 
 
 
3357
 
3358
- DomHandler.prototype.ontext = function(data){
3359
- //the ignoreWhitespace is officially dropped, but for now,
3360
- //it's an alias for normalizeWhitespace
3361
- var normalize = this._options.normalizeWhitespace || this._options.ignoreWhitespace;
 
 
 
 
 
 
 
3362
 
3363
- var lastTag;
 
 
 
 
 
 
3364
 
3365
- if(!this._tagStack.length && this.dom.length && (lastTag = this.dom[this.dom.length-1]).type === ElementType.Text){
3366
- if(normalize){
3367
- lastTag.data = (lastTag.data + data).replace(re_whitespace, " ");
3368
- } else {
3369
- lastTag.data += data;
3370
- }
3371
- } else {
3372
- if(
3373
- this._tagStack.length &&
3374
- (lastTag = this._tagStack[this._tagStack.length - 1]) &&
3375
- (lastTag = lastTag.children[lastTag.children.length - 1]) &&
3376
- lastTag.type === ElementType.Text
3377
- ){
3378
- if(normalize){
3379
- lastTag.data = (lastTag.data + data).replace(re_whitespace, " ");
3380
- } else {
3381
- lastTag.data += data;
3382
- }
3383
- } else {
3384
- if(normalize){
3385
- data = data.replace(re_whitespace, " ");
3386
- }
 
 
3387
 
3388
- var element = this._createDomElement({
3389
- data: data,
3390
- type: ElementType.Text
3391
- });
 
 
 
 
 
 
3392
 
3393
- this._addDomElement(element);
3394
- }
3395
- }
3396
- };
 
 
 
 
 
 
 
 
 
3397
 
3398
- DomHandler.prototype.oncomment = function(data){
3399
- var lastTag = this._tagStack[this._tagStack.length - 1];
 
 
 
3400
 
3401
- if(lastTag && lastTag.type === ElementType.Comment){
3402
- lastTag.data += data;
3403
- return;
3404
- }
3405
 
3406
- var properties = {
3407
- data: data,
3408
- type: ElementType.Comment
3409
- };
3410
 
3411
- var element = this._createDomElement(properties);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3412
 
3413
- this._addDomElement(element);
3414
- this._tagStack.push(element);
3415
- };
3416
 
3417
- DomHandler.prototype.oncdatastart = function(){
3418
- var properties = {
3419
- children: [{
3420
- data: "",
3421
- type: ElementType.Text
3422
- }],
3423
- type: ElementType.CDATA
3424
- };
3425
 
3426
- var element = this._createDomElement(properties);
3427
 
3428
- this._addDomElement(element);
3429
- this._tagStack.push(element);
3430
- };
3431
 
3432
- DomHandler.prototype.oncommentend = DomHandler.prototype.oncdataend = function(){
3433
- this._tagStack.pop();
3434
- };
3435
 
3436
- DomHandler.prototype.onprocessinginstruction = function(name, data){
3437
- var element = this._createDomElement({
3438
- name: name,
3439
- data: data,
3440
- type: ElementType.Directive
3441
- });
3442
 
3443
- this._addDomElement(element);
3444
- };
3445
 
3446
- module.exports = DomHandler;
3447
 
 
3448
 
3449
- /***/ }),
3450
 
3451
- /***/ 420:
3452
- /***/ (function(module, exports, __webpack_require__) {
3453
 
3454
- // DOM-Level-1-compliant structure
3455
- var NodePrototype = __webpack_require__(262);
3456
- var ElementPrototype = module.exports = Object.create(NodePrototype);
 
 
 
 
3457
 
3458
- var domLvl1 = {
3459
- tagName: "name"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3460
  };
3461
 
3462
- Object.keys(domLvl1).forEach(function(key) {
3463
- var shorthand = domLvl1[key];
3464
- Object.defineProperty(ElementPrototype, key, {
3465
- get: function() {
3466
- return this[shorthand] || null;
3467
- },
3468
- set: function(val) {
3469
- this[shorthand] = val;
3470
- return val;
3471
- }
3472
- });
3473
- });
3474
 
 
3475
 
3476
  /***/ }),
3477
-
3478
- /***/ 421:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3479
  /***/ (function(module, exports, __webpack_require__) {
3480
 
3481
- var index = __webpack_require__(38),
3482
- DomHandler = index.DomHandler,
3483
- DomUtils = index.DomUtils;
3484
 
3485
- //TODO: make this a streamable handler
3486
- function FeedHandler(callback, options){
3487
- this.init(callback, options);
3488
- }
3489
 
3490
- __webpack_require__(22)(FeedHandler, DomHandler);
 
 
 
3491
 
3492
- FeedHandler.prototype.init = DomHandler;
 
3493
 
3494
- function getElements(what, where){
3495
- return DomUtils.getElementsByTagName(what, where, true);
3496
- }
3497
- function getOneElement(what, where){
3498
- return DomUtils.getElementsByTagName(what, where, true, 1)[0];
3499
- }
3500
- function fetch(what, where, recurse){
3501
- return DomUtils.getText(
3502
- DomUtils.getElementsByTagName(what, where, recurse, 1)
3503
- ).trim();
3504
- }
3505
 
3506
- function addConditionally(obj, prop, what, where, recurse){
3507
- var tmp = fetch(what, where, recurse);
3508
- if(tmp) obj[prop] = tmp;
3509
- }
 
 
 
 
 
3510
 
3511
- var isValidFeed = function(value){
3512
- return value === "rss" || value === "feed" || value === "rdf:RDF";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3513
  };
3514
 
3515
- FeedHandler.prototype.onend = function(){
3516
- var feed = {},
3517
- feedRoot = getOneElement(isValidFeed, this.dom),
3518
- tmp, childs;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3519
 
3520
- if(feedRoot){
3521
- if(feedRoot.name === "feed"){
3522
- childs = feedRoot.children;
 
 
 
 
 
 
 
 
3523
 
3524
- feed.type = "atom";
3525
- addConditionally(feed, "id", "id", childs);
3526
- addConditionally(feed, "title", "title", childs);
3527
- if((tmp = getOneElement("link", childs)) && (tmp = tmp.attribs) && (tmp = tmp.href)) feed.link = tmp;
3528
- addConditionally(feed, "description", "subtitle", childs);
3529
- if((tmp = fetch("updated", childs))) feed.updated = new Date(tmp);
3530
- addConditionally(feed, "author", "email", childs, true);
3531
 
3532
- feed.items = getElements("entry", childs).map(function(item){
3533
- var entry = {}, tmp;
 
3534
 
3535
- item = item.children;
 
 
 
 
3536
 
3537
- addConditionally(entry, "id", "id", item);
3538
- addConditionally(entry, "title", "title", item);
3539
- if((tmp = getOneElement("link", item)) && (tmp = tmp.attribs) && (tmp = tmp.href)) entry.link = tmp;
3540
- if((tmp = fetch("summary", item) || fetch("content", item))) entry.description = tmp;
3541
- if((tmp = fetch("updated", item))) entry.pubDate = new Date(tmp);
3542
- return entry;
3543
- });
3544
- } else {
3545
- childs = getOneElement("channel", feedRoot.children).children;
3546
 
3547
- feed.type = feedRoot.name.substr(0, 3);
3548
- feed.id = "";
3549
- addConditionally(feed, "title", "title", childs);
3550
- addConditionally(feed, "link", "link", childs);
3551
- addConditionally(feed, "description", "description", childs);
3552
- if((tmp = fetch("lastBuildDate", childs))) feed.updated = new Date(tmp);
3553
- addConditionally(feed, "author", "managingEditor", childs, true);
3554
 
3555
- feed.items = getElements("item", feedRoot.children).map(function(item){
3556
- var entry = {}, tmp;
 
 
3557
 
3558
- item = item.children;
 
3559
 
3560
- addConditionally(entry, "id", "guid", item);
3561
- addConditionally(entry, "title", "title", item);
3562
- addConditionally(entry, "link", "link", item);
3563
- addConditionally(entry, "description", "description", item);
3564
- if((tmp = fetch("pubDate", item))) entry.pubDate = new Date(tmp);
3565
- return entry;
3566
- });
 
3567
  }
3568
  }
3569
- this.dom = feed;
3570
- DomHandler.prototype._handleCallback.call(
3571
- this, feedRoot ? null : Error("couldn't find root of feed")
3572
- );
3573
  };
3574
 
3575
- module.exports = FeedHandler;
 
 
 
3576
 
 
 
3577
 
3578
- /***/ }),
 
 
 
3579
 
3580
- /***/ 422:
3581
- /***/ (function(module, exports, __webpack_require__) {
3582
 
3583
- module.exports = Stream;
 
 
 
 
 
 
3584
 
3585
- var Parser = __webpack_require__(263);
 
 
3586
 
3587
- function Stream(options){
3588
- Parser.call(this, new Cbs(this), options);
3589
- }
3590
 
3591
- __webpack_require__(22)(Stream, Parser);
 
3592
 
3593
- Stream.prototype.readable = true;
 
 
 
3594
 
3595
- function Cbs(scope){
3596
- this.scope = scope;
3597
- }
3598
 
3599
- var EVENTS = __webpack_require__(38).EVENTS;
 
3600
 
3601
- Object.keys(EVENTS).forEach(function(name){
3602
- if(EVENTS[name] === 0){
3603
- Cbs.prototype["on" + name] = function(){
3604
- this.scope.emit(name);
3605
- };
3606
- } else if(EVENTS[name] === 1){
3607
- Cbs.prototype["on" + name] = function(a){
3608
- this.scope.emit(name, a);
3609
- };
3610
- } else if(EVENTS[name] === 2){
3611
- Cbs.prototype["on" + name] = function(a, b){
3612
- this.scope.emit(name, a, b);
3613
- };
3614
- } else {
3615
- throw Error("wrong number of arguments!");
3616
- }
3617
- });
3618
 
3619
- /***/ }),
 
 
3620
 
3621
- /***/ 423:
3622
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3623
 
3624
- // Copyright Joyent, Inc. and other Node contributors.
3625
- //
3626
- // Permission is hereby granted, free of charge, to any person obtaining a
3627
- // copy of this software and associated documentation files (the
3628
- // "Software"), to deal in the Software without restriction, including
3629
- // without limitation the rights to use, copy, modify, merge, publish,
3630
- // distribute, sublicense, and/or sell copies of the Software, and to permit
3631
- // persons to whom the Software is furnished to do so, subject to the
3632
- // following conditions:
3633
- //
3634
- // The above copyright notice and this permission notice shall be included
3635
- // in all copies or substantial portions of the Software.
3636
- //
3637
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
3638
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3639
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
3640
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
3641
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
3642
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
3643
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
3644
 
3645
- module.exports = Stream;
 
3646
 
3647
- var EE = __webpack_require__(55).EventEmitter;
3648
- var inherits = __webpack_require__(22);
3649
 
3650
- inherits(Stream, EE);
3651
- Stream.Readable = __webpack_require__(87);
3652
- Stream.Writable = __webpack_require__(431);
3653
- Stream.Duplex = __webpack_require__(432);
3654
- Stream.Transform = __webpack_require__(433);
3655
- Stream.PassThrough = __webpack_require__(434);
 
 
 
3656
 
3657
- // Backwards-compat with node 0.4.x
3658
- Stream.Stream = Stream;
 
 
 
 
3659
 
 
 
 
3660
 
 
 
 
 
 
 
 
 
 
 
 
3661
 
3662
- // old-style streams. Note that the pipe method (the only relevant
3663
- // part of this class) is overridden in the Readable class.
 
3664
 
3665
- function Stream() {
3666
- EE.call(this);
3667
- }
3668
 
3669
- Stream.prototype.pipe = function(dest, options) {
3670
- var source = this;
3671
 
3672
- function ondata(chunk) {
3673
- if (dest.writable) {
3674
- if (false === dest.write(chunk) && source.pause) {
3675
- source.pause();
3676
- }
3677
- }
3678
- }
3679
 
3680
- source.on('data', ondata);
 
 
 
 
 
3681
 
3682
- function ondrain() {
3683
- if (source.readable && source.resume) {
3684
- source.resume();
3685
- }
3686
- }
3687
 
3688
- dest.on('drain', ondrain);
 
 
3689
 
3690
- // If the 'end' option is not supplied, dest.end() will be called when
3691
- // source gets the 'end' or 'close' events. Only dest.end() once.
3692
- if (!dest._isStdio && (!options || options.end !== false)) {
3693
- source.on('end', onend);
3694
- source.on('close', onclose);
3695
- }
3696
 
3697
- var didOnEnd = false;
3698
- function onend() {
3699
- if (didOnEnd) return;
3700
- didOnEnd = true;
 
 
 
 
3701
 
3702
- dest.end();
3703
- }
 
3704
 
 
 
 
 
 
 
 
 
 
 
3705
 
3706
- function onclose() {
3707
- if (didOnEnd) return;
3708
- didOnEnd = true;
3709
 
3710
- if (typeof dest.destroy === 'function') dest.destroy();
3711
- }
3712
-
3713
- // don't leave dangling pipes when there are errors.
3714
- function onerror(er) {
3715
- cleanup();
3716
- if (EE.listenerCount(this, 'error') === 0) {
3717
- throw er; // Unhandled stream error in pipe.
3718
- }
3719
- }
3720
-
3721
- source.on('error', onerror);
3722
- dest.on('error', onerror);
3723
 
3724
- // remove all the event listeners that were added.
3725
- function cleanup() {
3726
- source.removeListener('data', ondata);
3727
- dest.removeListener('drain', ondrain);
3728
 
3729
- source.removeListener('end', onend);
3730
- source.removeListener('close', onclose);
3731
 
3732
- source.removeListener('error', onerror);
3733
- dest.removeListener('error', onerror);
 
 
 
3734
 
3735
- source.removeListener('end', cleanup);
3736
- source.removeListener('close', cleanup);
 
3737
 
3738
- dest.removeListener('close', cleanup);
3739
- }
 
3740
 
3741
- source.on('end', cleanup);
3742
- source.on('close', cleanup);
 
3743
 
3744
- dest.on('close', cleanup);
 
 
3745
 
3746
- dest.emit('pipe', source);
 
 
3747
 
3748
- // Allow for unix-like usage: A.pipe(B).pipe(C)
3749
- return dest;
3750
- };
3751
 
3752
 
3753
  /***/ }),
3754
-
3755
- /***/ 424:
3756
  /***/ (function(module, exports, __webpack_require__) {
3757
 
3758
- "use strict";
3759
-
3760
 
3761
- exports.byteLength = byteLength
3762
- exports.toByteArray = toByteArray
3763
- exports.fromByteArray = fromByteArray
 
3764
 
3765
- var lookup = []
3766
- var revLookup = []
3767
- var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
3768
 
3769
- var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
3770
- for (var i = 0, len = code.length; i < len; ++i) {
3771
- lookup[i] = code[i]
3772
- revLookup[code.charCodeAt(i)] = i
3773
- }
 
 
3774
 
3775
- revLookup['-'.charCodeAt(0)] = 62
3776
- revLookup['_'.charCodeAt(0)] = 63
 
 
 
 
 
 
3777
 
3778
- function placeHoldersCount (b64) {
3779
- var len = b64.length
3780
- if (len % 4 > 0) {
3781
- throw new Error('Invalid string. Length must be a multiple of 4')
3782
- }
3783
 
3784
- // the number of equal signs (place holders)
3785
- // if there are two placeholders, than the two characters before it
3786
- // represent one byte
3787
- // if there is only one, then the three characters before it represent 2 bytes
3788
- // this is just a cheap hack to not do indexOf twice
3789
- return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
3790
- }
3791
 
3792
- function byteLength (b64) {
3793
- // base64 is 4/3 + up to two characters of the original data
3794
- return (b64.length * 3 / 4) - placeHoldersCount(b64)
3795
- }
 
3796
 
3797
- function toByteArray (b64) {
3798
- var i, l, tmp, placeHolders, arr
3799
- var len = b64.length
3800
- placeHolders = placeHoldersCount(b64)
 
 
 
 
 
 
3801
 
3802
- arr = new Arr((len * 3 / 4) - placeHolders)
 
 
3803
 
3804
- // if there are placeholders, only get up to the last complete 4 chars
3805
- l = placeHolders > 0 ? len - 4 : len
 
 
 
 
 
 
 
 
3806
 
3807
- var L = 0
 
 
 
 
 
 
 
3808
 
3809
- for (i = 0; i < l; i += 4) {
3810
- tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
3811
- arr[L++] = (tmp >> 16) & 0xFF
3812
- arr[L++] = (tmp >> 8) & 0xFF
3813
- arr[L++] = tmp & 0xFF
3814
- }
3815
 
3816
- if (placeHolders === 2) {
3817
- tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
3818
- arr[L++] = tmp & 0xFF
3819
- } else if (placeHolders === 1) {
3820
- tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
3821
- arr[L++] = (tmp >> 8) & 0xFF
3822
- arr[L++] = tmp & 0xFF
3823
- }
3824
 
3825
- return arr
3826
- }
 
3827
 
3828
- function tripletToBase64 (num) {
3829
- return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
3830
  }
3831
 
3832
- function encodeChunk (uint8, start, end) {
3833
- var tmp
3834
- var output = []
3835
- for (var i = start; i < end; i += 3) {
3836
- tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
3837
- output.push(tripletToBase64(tmp))
3838
- }
3839
- return output.join('')
3840
  }
3841
 
3842
- function fromByteArray (uint8) {
3843
- var tmp
3844
- var len = uint8.length
3845
- var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
3846
- var output = ''
3847
- var parts = []
3848
- var maxChunkLength = 16383 // must be multiple of 3
3849
-
3850
- // go through the array every three bytes, we'll deal with trailing stuff later
3851
- for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
3852
- parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
3853
- }
3854
-
3855
- // pad the end with zeros, but make sure to not forget the extra bytes
3856
- if (extraBytes === 1) {
3857
- tmp = uint8[len - 1]
3858
- output += lookup[tmp >> 2]
3859
- output += lookup[(tmp << 4) & 0x3F]
3860
- output += '=='
3861
- } else if (extraBytes === 2) {
3862
- tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
3863
- output += lookup[tmp >> 10]
3864
- output += lookup[(tmp >> 4) & 0x3F]
3865
- output += lookup[(tmp << 2) & 0x3F]
3866
- output += '='
3867
- }
3868
-
3869
- parts.push(output)
3870
 
3871
- return parts.join('')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3872
  }
3873
 
 
 
3874
 
3875
- /***/ }),
3876
-
3877
- /***/ 425:
3878
- /***/ (function(module, exports) {
3879
-
3880
- exports.read = function (buffer, offset, isLE, mLen, nBytes) {
3881
- var e, m
3882
- var eLen = nBytes * 8 - mLen - 1
3883
- var eMax = (1 << eLen) - 1
3884
- var eBias = eMax >> 1
3885
- var nBits = -7
3886
- var i = isLE ? (nBytes - 1) : 0
3887
- var d = isLE ? -1 : 1
3888
- var s = buffer[offset + i]
3889
-
3890
- i += d
3891
-
3892
- e = s & ((1 << (-nBits)) - 1)
3893
- s >>= (-nBits)
3894
- nBits += eLen
3895
- for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
3896
-
3897
- m = e & ((1 << (-nBits)) - 1)
3898
- e >>= (-nBits)
3899
- nBits += mLen
3900
- for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
3901
-
3902
- if (e === 0) {
3903
- e = 1 - eBias
3904
- } else if (e === eMax) {
3905
- return m ? NaN : ((s ? -1 : 1) * Infinity)
3906
- } else {
3907
- m = m + Math.pow(2, mLen)
3908
- e = e - eBias
3909
- }
3910
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
3911
  }
3912
 
3913
- exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
3914
- var e, m, c
3915
- var eLen = nBytes * 8 - mLen - 1
3916
- var eMax = (1 << eLen) - 1
3917
- var eBias = eMax >> 1
3918
- var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
3919
- var i = isLE ? 0 : (nBytes - 1)
3920
- var d = isLE ? 1 : -1
3921
- var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
3922
-
3923
- value = Math.abs(value)
3924
-
3925
- if (isNaN(value) || value === Infinity) {
3926
- m = isNaN(value) ? 1 : 0
3927
- e = eMax
3928
- } else {
3929
- e = Math.floor(Math.log(value) / Math.LN2)
3930
- if (value * (c = Math.pow(2, -e)) < 1) {
3931
- e--
3932
- c *= 2
3933
- }
3934
- if (e + eBias >= 1) {
3935
- value += rt / c
3936
- } else {
3937
- value += rt * Math.pow(2, 1 - eBias)
3938
- }
3939
- if (value * c >= 2) {
3940
- e++
3941
- c /= 2
3942
- }
3943
-
3944
- if (e + eBias >= eMax) {
3945
- m = 0
3946
- e = eMax
3947
- } else if (e + eBias >= 1) {
3948
- m = (value * c - 1) * Math.pow(2, mLen)
3949
- e = e + eBias
3950
- } else {
3951
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
3952
- e = 0
3953
- }
3954
- }
3955
-
3956
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
3957
-
3958
- e = (e << mLen) | m
3959
- eLen += mLen
3960
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
3961
-
3962
- buffer[offset + i - d] |= s * 128
3963
  }
3964
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3965
 
3966
- /***/ }),
3967
-
3968
- /***/ 426:
3969
- /***/ (function(module, exports) {
3970
-
3971
- /* (ignored) */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3972
 
3973
- /***/ }),
 
 
 
 
 
 
3974
 
3975
- /***/ 427:
3976
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3977
 
3978
- "use strict";
 
 
 
 
 
 
3979
 
 
 
 
 
 
 
 
3980
 
3981
- /*<replacement>*/
 
 
 
 
 
 
 
 
 
 
 
3982
 
3983
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
 
 
 
3984
 
3985
- var Buffer = __webpack_require__(57).Buffer;
3986
- /*</replacement>*/
 
 
 
 
 
 
3987
 
3988
- function copyBuffer(src, target, offset) {
3989
- src.copy(target, offset);
3990
- }
 
 
 
 
 
 
 
 
 
 
3991
 
3992
- module.exports = function () {
3993
- function BufferList() {
3994
- _classCallCheck(this, BufferList);
 
 
 
 
 
 
 
 
 
 
3995
 
3996
- this.head = null;
3997
- this.tail = null;
3998
- this.length = 0;
3999
- }
4000
-
4001
- BufferList.prototype.push = function push(v) {
4002
- var entry = { data: v, next: null };
4003
- if (this.length > 0) this.tail.next = entry;else this.head = entry;
4004
- this.tail = entry;
4005
- ++this.length;
4006
- };
4007
-
4008
- BufferList.prototype.unshift = function unshift(v) {
4009
- var entry = { data: v, next: this.head };
4010
- if (this.length === 0) this.tail = entry;
4011
- this.head = entry;
4012
- ++this.length;
4013
- };
4014
 
4015
- BufferList.prototype.shift = function shift() {
4016
- if (this.length === 0) return;
4017
- var ret = this.head.data;
4018
- if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
4019
- --this.length;
4020
- return ret;
4021
- };
 
 
 
 
 
4022
 
4023
- BufferList.prototype.clear = function clear() {
4024
- this.head = this.tail = null;
4025
- this.length = 0;
4026
- };
 
 
 
 
 
 
 
 
 
4027
 
4028
- BufferList.prototype.join = function join(s) {
4029
- if (this.length === 0) return '';
4030
- var p = this.head;
4031
- var ret = '' + p.data;
4032
- while (p = p.next) {
4033
- ret += s + p.data;
4034
- }return ret;
4035
- };
4036
 
4037
- BufferList.prototype.concat = function concat(n) {
4038
- if (this.length === 0) return Buffer.alloc(0);
4039
- if (this.length === 1) return this.head.data;
4040
- var ret = Buffer.allocUnsafe(n >>> 0);
4041
- var p = this.head;
4042
- var i = 0;
4043
- while (p) {
4044
- copyBuffer(p.data, ret, i);
4045
- i += p.data.length;
4046
- p = p.next;
4047
- }
4048
- return ret;
4049
- };
4050
 
4051
- return BufferList;
4052
- }();
 
 
 
 
 
4053
 
4054
- /***/ }),
 
 
 
 
 
 
 
4055
 
4056
- /***/ 429:
4057
- /***/ (function(module, exports, __webpack_require__) {
 
4058
 
4059
- /* WEBPACK VAR INJECTION */(function(global) {
4060
- /**
4061
- * Module exports.
4062
- */
 
 
 
4063
 
4064
- module.exports = deprecate;
 
 
 
 
 
 
 
 
 
 
4065
 
4066
- /**
4067
- * Mark that a method should not be used.
4068
- * Returns a modified function which warns once by default.
4069
- *
4070
- * If `localStorage.noDeprecation = true` is set, then it is a no-op.
4071
- *
4072
- * If `localStorage.throwDeprecation = true` is set, then deprecated functions
4073
- * will throw an Error when invoked.
4074
- *
4075
- * If `localStorage.traceDeprecation = true` is set, then deprecated functions
4076
- * will invoke `console.trace()` instead of `console.error()`.
4077
- *
4078
- * @param {Function} fn - the function to deprecate
4079
- * @param {String} msg - the string to print to the console when `fn` is invoked
4080
- * @returns {Function} a new "deprecated" version of `fn`
4081
- * @api public
4082
- */
4083
 
4084
- function deprecate (fn, msg) {
4085
- if (config('noDeprecation')) {
4086
- return fn;
4087
- }
 
 
 
 
 
4088
 
4089
- var warned = false;
4090
- function deprecated() {
4091
- if (!warned) {
4092
- if (config('throwDeprecation')) {
4093
- throw new Error(msg);
4094
- } else if (config('traceDeprecation')) {
4095
- console.trace(msg);
4096
- } else {
4097
- console.warn(msg);
4098
- }
4099
- warned = true;
4100
- }
4101
- return fn.apply(this, arguments);
4102
- }
4103
 
4104
- return deprecated;
4105
- }
4106
 
4107
- /**
4108
- * Checks `localStorage` for boolean values for the given `name`.
4109
- *
4110
- * @param {String} name
4111
- * @returns {Boolean}
4112
- * @api private
4113
- */
 
 
 
 
4114
 
4115
- function config (name) {
4116
- // accessing global.localStorage can trigger a DOMException in sandboxed iframes
4117
- try {
4118
- if (!global.localStorage) return false;
4119
- } catch (_) {
4120
- return false;
4121
- }
4122
- var val = global.localStorage[name];
4123
- if (null == val) return false;
4124
- return String(val).toLowerCase() === 'true';
4125
- }
4126
 
4127
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9)))
 
 
 
 
 
 
 
4128
 
4129
- /***/ }),
 
 
 
4130
 
4131
- /***/ 430:
4132
- /***/ (function(module, exports, __webpack_require__) {
4133
-
4134
- "use strict";
4135
- // Copyright Joyent, Inc. and other Node contributors.
4136
- //
4137
- // Permission is hereby granted, free of charge, to any person obtaining a
4138
- // copy of this software and associated documentation files (the
4139
- // "Software"), to deal in the Software without restriction, including
4140
- // without limitation the rights to use, copy, modify, merge, publish,
4141
- // distribute, sublicense, and/or sell copies of the Software, and to permit
4142
- // persons to whom the Software is furnished to do so, subject to the
4143
- // following conditions:
4144
- //
4145
- // The above copyright notice and this permission notice shall be included
4146
- // in all copies or substantial portions of the Software.
4147
- //
4148
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
4149
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
4150
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
4151
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
4152
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
4153
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
4154
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
4155
-
4156
- // a passthrough stream.
4157
- // basically just the most minimal sort of Transform stream.
4158
- // Every written chunk gets output as-is.
4159
 
 
 
 
 
4160
 
 
 
 
 
 
 
 
 
 
4161
 
4162
- module.exports = PassThrough;
 
 
4163
 
4164
- var Transform = __webpack_require__(269);
 
 
 
 
 
 
4165
 
4166
- /*<replacement>*/
4167
- var util = __webpack_require__(46);
4168
- util.inherits = __webpack_require__(22);
4169
- /*</replacement>*/
4170
 
4171
- util.inherits(PassThrough, Transform);
 
 
 
 
 
 
 
 
4172
 
4173
- function PassThrough(options) {
4174
- if (!(this instanceof PassThrough)) return new PassThrough(options);
4175
 
4176
- Transform.call(this, options);
4177
- }
 
 
 
 
4178
 
4179
- PassThrough.prototype._transform = function (chunk, encoding, cb) {
4180
- cb(null, chunk);
 
 
 
4181
  };
4182
 
4183
- /***/ }),
4184
-
4185
- /***/ 431:
4186
- /***/ (function(module, exports, __webpack_require__) {
4187
 
4188
- module.exports = __webpack_require__(89);
 
 
 
4189
 
 
4190
 
4191
- /***/ }),
 
4192
 
4193
- /***/ 432:
4194
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
4195
 
4196
- module.exports = __webpack_require__(32);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4197
 
 
 
 
 
4198
 
4199
- /***/ }),
 
4200
 
4201
- /***/ 433:
4202
- /***/ (function(module, exports, __webpack_require__) {
 
 
4203
 
4204
- module.exports = __webpack_require__(87).Transform
 
 
 
 
4205
 
 
 
4206
 
4207
- /***/ }),
 
 
 
 
 
 
 
 
 
 
 
 
4208
 
4209
- /***/ 434:
4210
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
4211
 
4212
- module.exports = __webpack_require__(87).PassThrough
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4213
 
 
 
 
4214
 
4215
- /***/ }),
 
 
4216
 
4217
- /***/ 435:
4218
- /***/ (function(module, exports) {
 
4219
 
4220
- /* (ignored) */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4221
 
4222
- /***/ }),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4223
 
4224
- /***/ 436:
4225
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
4226
 
4227
- module.exports = ProxyHandler;
 
 
 
 
 
4228
 
4229
- function ProxyHandler(cbs){
4230
- this._cbs = cbs || {};
4231
- }
 
 
 
 
 
 
 
 
 
4232
 
4233
- var EVENTS = __webpack_require__(38).EVENTS;
4234
- Object.keys(EVENTS).forEach(function(name){
4235
- if(EVENTS[name] === 0){
4236
- name = "on" + name;
4237
- ProxyHandler.prototype[name] = function(){
4238
- if(this._cbs[name]) this._cbs[name]();
4239
- };
4240
- } else if(EVENTS[name] === 1){
4241
- name = "on" + name;
4242
- ProxyHandler.prototype[name] = function(a){
4243
- if(this._cbs[name]) this._cbs[name](a);
4244
- };
4245
- } else if(EVENTS[name] === 2){
4246
- name = "on" + name;
4247
- ProxyHandler.prototype[name] = function(a, b){
4248
- if(this._cbs[name]) this._cbs[name](a, b);
4249
- };
4250
- } else {
4251
- throw Error("wrong number of arguments");
4252
- }
4253
- });
 
4254
 
4255
- /***/ }),
 
 
 
 
 
 
 
4256
 
4257
- /***/ 437:
4258
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
4259
 
4260
- var DomUtils = module.exports;
 
 
 
 
 
 
 
 
 
 
4261
 
4262
- [
4263
- __webpack_require__(438),
4264
- __webpack_require__(444),
4265
- __webpack_require__(445),
4266
- __webpack_require__(446),
4267
- __webpack_require__(447),
4268
- __webpack_require__(448)
4269
- ].forEach(function(ext){
4270
- Object.keys(ext).forEach(function(key){
4271
- DomUtils[key] = ext[key].bind(DomUtils);
4272
- });
4273
- });
4274
 
 
 
 
 
 
 
 
 
 
4275
 
4276
- /***/ }),
 
 
 
 
 
 
 
 
 
 
 
 
 
4277
 
4278
- /***/ 438:
4279
- /***/ (function(module, exports, __webpack_require__) {
 
4280
 
4281
- var ElementType = __webpack_require__(45),
4282
- getOuterHTML = __webpack_require__(439),
4283
- isTag = ElementType.isTag;
4284
 
4285
- module.exports = {
4286
- getInnerHTML: getInnerHTML,
4287
- getOuterHTML: getOuterHTML,
4288
- getText: getText
4289
  };
4290
 
4291
- function getInnerHTML(elem, opts){
4292
- return elem.children ? elem.children.map(function(elem){
4293
- return getOuterHTML(elem, opts);
4294
- }).join("") : "";
4295
- }
4296
-
4297
- function getText(elem){
4298
- if(Array.isArray(elem)) return elem.map(getText).join("");
4299
- if(isTag(elem)) return elem.name === "br" ? "\n" : getText(elem.children);
4300
- if(elem.type === ElementType.CDATA) return getText(elem.children);
4301
- if(elem.type === ElementType.Text) return elem.data;
4302
- return "";
4303
- }
4304
-
4305
-
4306
- /***/ }),
4307
 
4308
- /***/ 439:
4309
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
4310
 
4311
- /*
4312
- Module dependencies
4313
- */
4314
- var ElementType = __webpack_require__(440);
4315
- var entities = __webpack_require__(441);
4316
 
4317
- /*
4318
- Boolean Attributes
4319
- */
4320
- var booleanAttributes = {
4321
- __proto__: null,
4322
- allowfullscreen: true,
4323
- async: true,
4324
- autofocus: true,
4325
- autoplay: true,
4326
- checked: true,
4327
- controls: true,
4328
- default: true,
4329
- defer: true,
4330
- disabled: true,
4331
- hidden: true,
4332
- ismap: true,
4333
- loop: true,
4334
- multiple: true,
4335
- muted: true,
4336
- open: true,
4337
- readonly: true,
4338
- required: true,
4339
- reversed: true,
4340
- scoped: true,
4341
- seamless: true,
4342
- selected: true,
4343
- typemustmatch: true
4344
- };
4345
 
4346
- var unencodedElements = {
4347
- __proto__: null,
4348
- style: true,
4349
- script: true,
4350
- xmp: true,
4351
- iframe: true,
4352
- noembed: true,
4353
- noframes: true,
4354
- plaintext: true,
4355
- noscript: true
4356
  };
4357
 
4358
- /*
4359
- Format attributes
4360
- */
4361
- function formatAttrs(attributes, opts) {
4362
- if (!attributes) return;
4363
 
4364
- var output = '',
4365
- value;
4366
 
4367
- // Loop through the attributes
4368
- for (var key in attributes) {
4369
- value = attributes[key];
4370
- if (output) {
4371
- output += ' ';
4372
- }
4373
 
4374
- if (!value && booleanAttributes[key]) {
4375
- output += key;
4376
- } else {
4377
- output += key + '="' + (opts.decodeEntities ? entities.encodeXML(value) : value) + '"';
4378
- }
4379
- }
4380
-
4381
- return output;
4382
- }
4383
-
4384
- /*
4385
- Self-enclosing tags (stolen from node-htmlparser)
4386
- */
4387
- var singleTag = {
4388
- __proto__: null,
4389
- area: true,
4390
- base: true,
4391
- basefont: true,
4392
- br: true,
4393
- col: true,
4394
- command: true,
4395
- embed: true,
4396
- frame: true,
4397
- hr: true,
4398
- img: true,
4399
- input: true,
4400
- isindex: true,
4401
- keygen: true,
4402
- link: true,
4403
- meta: true,
4404
- param: true,
4405
- source: true,
4406
- track: true,
4407
- wbr: true,
 
 
 
4408
  };
4409
 
 
 
 
4410
 
4411
- var render = module.exports = function(dom, opts) {
4412
- if (!Array.isArray(dom) && !dom.cheerio) dom = [dom];
4413
- opts = opts || {};
4414
-
4415
- var output = '';
4416
-
4417
- for(var i = 0; i < dom.length; i++){
4418
- var elem = dom[i];
4419
-
4420
- if (elem.type === 'root')
4421
- output += render(elem.children, opts);
4422
- else if (ElementType.isTag(elem))
4423
- output += renderTag(elem, opts);
4424
- else if (elem.type === ElementType.Directive)
4425
- output += renderDirective(elem);
4426
- else if (elem.type === ElementType.Comment)
4427
- output += renderComment(elem);
4428
- else if (elem.type === ElementType.CDATA)
4429
- output += renderCdata(elem);
4430
- else
4431
- output += renderText(elem, opts);
4432
- }
4433
 
4434
- return output;
 
4435
  };
4436
 
4437
- function renderTag(elem, opts) {
4438
- // Handle SVG
4439
- if (elem.name === "svg") opts = {decodeEntities: opts.decodeEntities, xmlMode: true};
 
4440
 
4441
- var tag = '<' + elem.name,
4442
- attribs = formatAttrs(elem.attribs, opts);
 
 
 
 
 
4443
 
4444
- if (attribs) {
4445
- tag += ' ' + attribs;
4446
- }
4447
 
4448
- if (
4449
- opts.xmlMode
4450
- && (!elem.children || elem.children.length === 0)
4451
- ) {
4452
- tag += '/>';
4453
- } else {
4454
- tag += '>';
4455
- if (elem.children) {
4456
- tag += render(elem.children, opts);
4457
- }
4458
 
4459
- if (!singleTag[elem.name] || opts.xmlMode) {
4460
- tag += '</' + elem.name + '>';
4461
- }
4462
- }
4463
 
4464
- return tag;
4465
- }
4466
 
4467
- function renderDirective(elem) {
4468
- return '<' + elem.data + '>';
4469
- }
4470
 
4471
- function renderText(elem, opts) {
4472
- var data = elem.data || '';
 
4473
 
4474
- // if entities weren't decoded, no need to encode them back
4475
- if (opts.decodeEntities && !(elem.parent && elem.parent.name in unencodedElements)) {
4476
- data = entities.encodeXML(data);
4477
- }
4478
 
4479
- return data;
4480
- }
4481
 
4482
- function renderCdata(elem) {
4483
- return '<![CDATA[' + elem.children[0].data + ']]>';
4484
- }
 
 
4485
 
4486
- function renderComment(elem) {
4487
- return '<!--' + elem.data + '-->';
4488
  }
4489
 
4490
 
4491
  /***/ }),
4492
-
4493
- /***/ 440:
4494
  /***/ (function(module, exports) {
4495
 
4496
- //Types of elements found in the DOM
4497
- module.exports = {
4498
- Text: "text", //Text
4499
- Directive: "directive", //<? ... ?>
4500
- Comment: "comment", //<!-- ... -->
4501
- Script: "script", //<script> tags
4502
- Style: "style", //<style> tags
4503
- Tag: "tag", //Any tag
4504
- CDATA: "cdata", //<![CDATA[ ... ]]>
4505
-
4506
- isTag: function(elem){
4507
- return elem.type === "tag" || elem.type === "script" || elem.type === "style";
4508
- }
4509
- };
4510
 
4511
  /***/ }),
 
 
4512
 
4513
- /***/ 441:
4514
- /***/ (function(module, exports, __webpack_require__) {
4515
-
4516
- var encode = __webpack_require__(442),
4517
- decode = __webpack_require__(443);
4518
-
4519
- exports.decode = function(data, level){
4520
- return (!level || level <= 0 ? decode.XML : decode.HTML)(data);
 
 
 
 
 
 
4521
  };
4522
 
4523
- exports.decodeStrict = function(data, level){
4524
- return (!level || level <= 0 ? decode.XML : decode.HTMLStrict)(data);
 
 
 
 
 
4525
  };
4526
 
4527
- exports.encode = function(data, level){
4528
- return (!level || level <= 0 ? encode.XML : encode.HTML)(data);
 
 
 
4529
  };
4530
 
4531
- exports.encodeXML = encode.XML;
 
 
 
 
 
 
 
 
 
 
 
4532
 
4533
- exports.encodeHTML4 =
4534
- exports.encodeHTML5 =
4535
- exports.encodeHTML = encode.HTML;
4536
 
4537
- exports.decodeXML =
4538
- exports.decodeXMLStrict = decode.XML;
 
4539
 
4540
- exports.decodeHTML4 =
4541
- exports.decodeHTML5 =
4542
- exports.decodeHTML = decode.HTML;
4543
 
4544
- exports.decodeHTML4Strict =
4545
- exports.decodeHTML5Strict =
4546
- exports.decodeHTMLStrict = decode.HTMLStrict;
 
4547
 
4548
- exports.escape = encode.escape;
 
 
4549
 
 
4550
 
4551
- /***/ }),
 
 
 
 
 
 
 
 
 
 
 
4552
 
4553
- /***/ 442:
 
4554
  /***/ (function(module, exports, __webpack_require__) {
4555
 
4556
- var inverseXML = getInverseObj(__webpack_require__(86)),
4557
- xmlReplacer = getInverseReplacer(inverseXML);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4558
 
4559
- exports.XML = getInverse(inverseXML, xmlReplacer);
4560
 
4561
- var inverseHTML = getInverseObj(__webpack_require__(85)),
4562
- htmlReplacer = getInverseReplacer(inverseHTML);
4563
 
4564
- exports.HTML = getInverse(inverseHTML, htmlReplacer);
4565
 
4566
- function getInverseObj(obj){
4567
- return Object.keys(obj).sort().reduce(function(inverse, name){
4568
- inverse[obj[name]] = "&" + name + ";";
4569
- return inverse;
4570
- }, {});
4571
- }
4572
 
4573
- function getInverseReplacer(inverse){
4574
- var single = [],
4575
- multiple = [];
4576
 
4577
- Object.keys(inverse).forEach(function(k){
4578
- if(k.length === 1){
4579
- single.push("\\" + k);
4580
- } else {
4581
- multiple.push(k);
4582
- }
4583
- });
4584
 
4585
- //TODO add ranges
4586
- multiple.unshift("[" + single.join("") + "]");
 
4587
 
4588
- return new RegExp(multiple.join("|"), "g");
4589
- }
4590
 
4591
- var re_nonASCII = /[^\0-\x7F]/g,
4592
- re_astralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
4593
 
4594
- function singleCharReplacer(c){
4595
- return "&#x" + c.charCodeAt(0).toString(16).toUpperCase() + ";";
4596
- }
 
4597
 
4598
- function astralReplacer(c){
4599
- // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
4600
- var high = c.charCodeAt(0);
4601
- var low = c.charCodeAt(1);
4602
- var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000;
4603
- return "&#x" + codePoint.toString(16).toUpperCase() + ";";
 
 
 
 
 
 
 
 
4604
  }
 
4605
 
4606
- function getInverse(inverse, re){
4607
- function func(name){
4608
- return inverse[name];
4609
- }
4610
 
4611
- return function(data){
4612
- return data
4613
- .replace(re, func)
4614
- .replace(re_astralSymbols, astralReplacer)
4615
- .replace(re_nonASCII, singleCharReplacer);
4616
- };
 
4617
  }
 
4618
 
4619
- var re_xmlChars = getInverseReplacer(inverseXML);
 
 
4620
 
4621
- function escapeXML(data){
4622
- return data
4623
- .replace(re_xmlChars, singleCharReplacer)
4624
- .replace(re_astralSymbols, astralReplacer)
4625
- .replace(re_nonASCII, singleCharReplacer);
 
 
 
 
 
 
 
 
 
 
 
4626
  }
4627
 
4628
- exports.escape = escapeXML;
 
4629
 
 
4630
 
4631
- /***/ }),
 
 
4632
 
4633
- /***/ 443:
4634
- /***/ (function(module, exports, __webpack_require__) {
4635
 
4636
- var entityMap = __webpack_require__(85),
4637
- legacyMap = __webpack_require__(261),
4638
- xmlMap = __webpack_require__(86),
4639
- decodeCodePoint = __webpack_require__(260);
 
4640
 
4641
- var decodeXMLStrict = getStrictDecoder(xmlMap),
4642
- decodeHTMLStrict = getStrictDecoder(entityMap);
4643
 
4644
- function getStrictDecoder(map){
4645
- var keys = Object.keys(map).join("|"),
4646
- replace = getReplacer(map);
 
 
 
 
 
 
 
 
4647
 
4648
- keys += "|#[xX][\\da-fA-F]+|#\\d+";
 
 
 
 
4649
 
4650
- var re = new RegExp("&(?:" + keys + ");", "g");
 
 
 
 
 
4651
 
4652
- return function(str){
4653
- return String(str).replace(re, replace);
4654
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4655
  }
4656
 
4657
- var decodeHTML = (function(){
4658
- var legacy = Object.keys(legacyMap)
4659
- .sort(sorter);
4660
 
4661
- var keys = Object.keys(entityMap)
4662
- .sort(sorter);
4663
 
4664
- for(var i = 0, j = 0; i < keys.length; i++){
4665
- if(legacy[j] === keys[i]){
4666
- keys[i] += ";?";
4667
- j++;
4668
- } else {
4669
- keys[i] += ";";
4670
- }
4671
- }
4672
 
4673
- var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"),
4674
- replace = getReplacer(entityMap);
4675
 
4676
- function replacer(str){
4677
- if(str.substr(-1) !== ";") str += ";";
4678
- return replace(str);
4679
- }
4680
 
4681
- //TODO consider creating a merged map
4682
- return function(str){
4683
- return String(str).replace(re, replacer);
4684
- };
4685
- }());
4686
 
4687
- function sorter(a, b){
4688
- return a < b ? 1 : -1;
4689
  }
4690
 
4691
- function getReplacer(map){
4692
- return function replace(str){
4693
- if(str.charAt(1) === "#"){
4694
- if(str.charAt(2) === "X" || str.charAt(2) === "x"){
4695
- return decodeCodePoint(parseInt(str.substr(3), 16));
4696
- }
4697
- return decodeCodePoint(parseInt(str.substr(2), 10));
4698
- }
4699
- return map[str.slice(1, -1)];
4700
- };
4701
- }
 
 
4702
 
4703
- module.exports = {
4704
- XML: decodeXMLStrict,
4705
- HTML: decodeHTML,
4706
- HTMLStrict: decodeHTMLStrict
 
 
 
 
 
 
 
4707
  };
4708
 
4709
- /***/ }),
 
 
 
 
 
 
4710
 
4711
- /***/ 444:
4712
- /***/ (function(module, exports) {
 
 
 
 
 
 
 
 
 
 
4713
 
4714
- var getChildren = exports.getChildren = function(elem){
4715
- return elem.children;
4716
  };
4717
 
4718
- var getParent = exports.getParent = function(elem){
4719
- return elem.parent;
 
4720
  };
4721
 
4722
- exports.getSiblings = function(elem){
4723
- var parent = getParent(elem);
4724
- return parent ? getChildren(parent) : [elem];
4725
- };
 
 
 
 
 
 
 
 
 
 
4726
 
4727
- exports.getAttributeValue = function(elem, name){
4728
- return elem.attribs && elem.attribs[name];
4729
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4730
 
4731
- exports.hasAttrib = function(elem, name){
4732
- return !!elem.attribs && hasOwnProperty.call(elem.attribs, name);
4733
- };
4734
 
4735
- exports.getName = function(elem){
4736
- return elem.name;
4737
- };
 
 
 
 
 
4738
 
 
 
 
 
4739
 
4740
- /***/ }),
 
 
 
 
 
 
4741
 
4742
- /***/ 445:
4743
- /***/ (function(module, exports) {
 
 
 
 
 
 
 
 
4744
 
4745
- exports.removeElement = function(elem){
4746
- if(elem.prev) elem.prev.next = elem.next;
4747
- if(elem.next) elem.next.prev = elem.prev;
4748
 
4749
- if(elem.parent){
4750
- var childs = elem.parent.children;
4751
- childs.splice(childs.lastIndexOf(elem), 1);
4752
- }
 
 
4753
  };
4754
 
4755
- exports.replaceElement = function(elem, replacement){
4756
- var prev = replacement.prev = elem.prev;
4757
- if(prev){
4758
- prev.next = replacement;
4759
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
4760
 
4761
- var next = replacement.next = elem.next;
4762
- if(next){
4763
- next.prev = replacement;
4764
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4765
 
4766
- var parent = replacement.parent = elem.parent;
4767
- if(parent){
4768
- var childs = parent.children;
4769
- childs[childs.lastIndexOf(elem)] = replacement;
4770
- }
4771
- };
4772
 
4773
- exports.appendChild = function(elem, child){
4774
- child.parent = elem;
4775
 
4776
- if(elem.children.push(child) !== 1){
4777
- var sibling = elem.children[elem.children.length - 2];
4778
- sibling.next = child;
4779
- child.prev = sibling;
4780
- child.next = null;
4781
- }
4782
- };
 
4783
 
4784
- exports.append = function(elem, next){
4785
- var parent = elem.parent,
4786
- currNext = elem.next;
4787
 
4788
- next.next = currNext;
4789
- next.prev = elem;
4790
- elem.next = next;
4791
- next.parent = parent;
 
4792
 
4793
- if(currNext){
4794
- currNext.prev = next;
4795
- if(parent){
4796
- var childs = parent.children;
4797
- childs.splice(childs.lastIndexOf(currNext), 0, next);
4798
- }
4799
- } else if(parent){
4800
- parent.children.push(next);
4801
- }
4802
- };
 
 
 
 
 
 
 
 
 
 
 
4803
 
4804
- exports.prepend = function(elem, prev){
4805
- var parent = elem.parent;
4806
- if(parent){
4807
- var childs = parent.children;
4808
- childs.splice(childs.lastIndexOf(elem), 0, prev);
4809
- }
4810
 
4811
- if(elem.prev){
4812
- elem.prev.next = prev;
4813
- }
4814
-
4815
- prev.parent = parent;
4816
- prev.prev = elem.prev;
4817
- prev.next = elem;
4818
- elem.prev = prev;
4819
- };
4820
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4821
 
 
 
4822
 
 
 
 
 
 
 
4823
 
4824
- /***/ }),
 
 
 
4825
 
4826
- /***/ 446:
4827
- /***/ (function(module, exports, __webpack_require__) {
 
4828
 
4829
- var isTag = __webpack_require__(45).isTag;
4830
 
4831
- module.exports = {
4832
- filter: filter,
4833
- find: find,
4834
- findOneChild: findOneChild,
4835
- findOne: findOne,
4836
- existsOne: existsOne,
4837
- findAll: findAll
4838
  };
4839
 
4840
- function filter(test, element, recurse, limit){
4841
- if(!Array.isArray(element)) element = [element];
 
 
 
 
 
 
 
 
4842
 
4843
- if(typeof limit !== "number" || !isFinite(limit)){
4844
- limit = Infinity;
4845
- }
4846
- return find(test, element, recurse !== false, limit);
4847
  }
4848
 
4849
- function find(test, elems, recurse, limit){
4850
- var result = [], childs;
4851
-
4852
- for(var i = 0, j = elems.length; i < j; i++){
4853
- if(test(elems[i])){
4854
- result.push(elems[i]);
4855
- if(--limit <= 0) break;
4856
- }
4857
-
4858
- childs = elems[i].children;
4859
- if(recurse && childs && childs.length > 0){
4860
- childs = find(test, childs, recurse, limit);
4861
- result = result.concat(childs);
4862
- limit -= childs.length;
4863
- if(limit <= 0) break;
4864
- }
4865
- }
4866
-
4867
- return result;
4868
  }
4869
 
4870
- function findOneChild(test, elems){
4871
- for(var i = 0, l = elems.length; i < l; i++){
4872
- if(test(elems[i])) return elems[i];
4873
- }
4874
-
4875
- return null;
4876
  }
4877
 
4878
- function findOne(test, elems){
4879
- var elem = null;
4880
-
4881
- for(var i = 0, l = elems.length; i < l && !elem; i++){
4882
- if(!isTag(elems[i])){
4883
- continue;
4884
- } else if(test(elems[i])){
4885
- elem = elems[i];
4886
- } else if(elems[i].children.length > 0){
4887
- elem = findOne(test, elems[i].children);
4888
- }
4889
- }
4890
-
4891
- return elem;
4892
  }
4893
 
4894
- function existsOne(test, elems){
4895
- for(var i = 0, l = elems.length; i < l; i++){
4896
- if(
4897
- isTag(elems[i]) && (
4898
- test(elems[i]) || (
4899
- elems[i].children.length > 0 &&
4900
- existsOne(test, elems[i].children)
4901
- )
4902
- )
4903
- ){
4904
- return true;
4905
- }
4906
- }
4907
-
4908
- return false;
4909
  }
4910
 
4911
- function findAll(test, rootElems){
4912
- var result = [];
4913
- var stack = [rootElems];
4914
- while(stack.length){
4915
- var elems = stack.pop();
4916
- for(var i = 0, j = elems.length; i < j; i++){
4917
- if(!isTag(elems[i])) continue;
4918
- if(test(elems[i])) result.push(elems[i]);
4919
- }
4920
- while(j-- > 0){
4921
- if(elems[j].children && elems[j].children.length > 0){
4922
- stack.push(elems[j].children);
4923
- }
4924
- }
4925
- }
4926
- return result;
4927
- }
4928
 
 
 
 
4929
 
4930
- /***/ }),
 
 
 
 
 
 
 
 
 
 
 
 
4931
 
4932
- /***/ 447:
4933
- /***/ (function(module, exports, __webpack_require__) {
4934
 
4935
- var ElementType = __webpack_require__(45);
4936
- var isTag = exports.isTag = ElementType.isTag;
4937
 
4938
- exports.testElement = function(options, element){
4939
- for(var key in options){
4940
- if(!options.hasOwnProperty(key));
4941
- else if(key === "tag_name"){
4942
- if(!isTag(element) || !options.tag_name(element.name)){
4943
- return false;
4944
- }
4945
- } else if(key === "tag_type"){
4946
- if(!options.tag_type(element.type)) return false;
4947
- } else if(key === "tag_contains"){
4948
- if(isTag(element) || !options.tag_contains(element.data)){
4949
- return false;
4950
- }
4951
- } else if(!element.attribs || !options[key](element.attribs[key])){
4952
- return false;
4953
- }
4954
- }
4955
- return true;
4956
- };
4957
 
4958
- var Checks = {
4959
- tag_name: function(name){
4960
- if(typeof name === "function"){
4961
- return function(elem){ return isTag(elem) && name(elem.name); };
4962
- } else if(name === "*"){
4963
- return isTag;
4964
- } else {
4965
- return function(elem){ return isTag(elem) && elem.name === name; };
4966
- }
4967
- },
4968
- tag_type: function(type){
4969
- if(typeof type === "function"){
4970
- return function(elem){ return type(elem.type); };
4971
- } else {
4972
- return function(elem){ return elem.type === type; };
4973
- }
4974
- },
4975
- tag_contains: function(data){
4976
- if(typeof data === "function"){
4977
- return function(elem){ return !isTag(elem) && data(elem.data); };
4978
- } else {
4979
- return function(elem){ return !isTag(elem) && elem.data === data; };
4980
- }
4981
- }
4982
- };
4983
 
4984
- function getAttribCheck(attrib, value){
4985
- if(typeof value === "function"){
4986
- return function(elem){ return elem.attribs && value(elem.attribs[attrib]); };
4987
- } else {
4988
- return function(elem){ return elem.attribs && elem.attribs[attrib] === value; };
4989
- }
4990
- }
4991
 
4992
- function combineFuncs(a, b){
4993
- return function(elem){
4994
- return a(elem) || b(elem);
4995
- };
4996
- }
 
 
 
 
 
 
 
4997
 
4998
- exports.getElements = function(options, element, recurse, limit){
4999
- var funcs = Object.keys(options).map(function(key){
5000
- var value = options[key];
5001
- return key in Checks ? Checks[key](value) : getAttribCheck(key, value);
5002
- });
5003
 
5004
- return funcs.length === 0 ? [] : this.filter(
5005
- funcs.reduce(combineFuncs),
5006
- element, recurse, limit
5007
- );
5008
- };
 
 
5009
 
5010
- exports.getElementById = function(id, element, recurse){
5011
- if(!Array.isArray(element)) element = [element];
5012
- return this.findOne(getAttribCheck("id", id), element, recurse !== false);
5013
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5014
 
5015
- exports.getElementsByTagName = function(name, element, recurse, limit){
5016
- return this.filter(Checks.tag_name(name), element, recurse, limit);
5017
- };
 
 
 
 
 
5018
 
5019
- exports.getElementsByTagType = function(type, element, recurse, limit){
5020
- return this.filter(Checks.tag_type(type), element, recurse, limit);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5021
  };
5022
 
 
 
 
 
 
 
 
 
 
 
 
5023
 
5024
- /***/ }),
 
 
5025
 
5026
- /***/ 448:
5027
- /***/ (function(module, exports) {
5028
 
5029
- // removeSubsets
5030
- // Given an array of nodes, remove any member that is contained by another.
5031
- exports.removeSubsets = function(nodes) {
5032
- var idx = nodes.length, node, ancestor, replace;
5033
 
5034
- // Check if each node (or one of its ancestors) is already contained in the
5035
- // array.
5036
- while (--idx > -1) {
5037
- node = ancestor = nodes[idx];
5038
 
5039
- // Temporarily remove the node under consideration
5040
- nodes[idx] = null;
5041
- replace = true;
 
 
 
 
5042
 
5043
- while (ancestor) {
5044
- if (nodes.indexOf(ancestor) > -1) {
5045
- replace = false;
5046
- nodes.splice(idx, 1);
5047
- break;
5048
- }
5049
- ancestor = ancestor.parent;
5050
- }
5051
 
5052
- // If the node has been found to be unique, re-insert it.
5053
- if (replace) {
5054
- nodes[idx] = node;
5055
- }
5056
- }
 
 
5057
 
5058
- return nodes;
5059
- };
 
 
5060
 
5061
- // Source: http://dom.spec.whatwg.org/#dom-node-comparedocumentposition
5062
- var POSITION = {
5063
- DISCONNECTED: 1,
5064
- PRECEDING: 2,
5065
- FOLLOWING: 4,
5066
- CONTAINS: 8,
5067
- CONTAINED_BY: 16
 
 
 
 
5068
  };
5069
 
5070
- // Compare the position of one node against another node in any other document.
5071
- // The return value is a bitmask with the following values:
5072
- //
5073
- // document order:
5074
- // > There is an ordering, document order, defined on all the nodes in the
5075
- // > document corresponding to the order in which the first character of the
5076
- // > XML representation of each node occurs in the XML representation of the
5077
- // > document after expansion of general entities. Thus, the document element
5078
- // > node will be the first node. Element nodes occur before their children.
5079
- // > Thus, document order orders element nodes in order of the occurrence of
5080
- // > their start-tag in the XML (after expansion of entities). The attribute
5081
- // > nodes of an element occur after the element and before its children. The
5082
- // > relative order of attribute nodes is implementation-dependent./
5083
- // Source:
5084
- // http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order
5085
- //
5086
- // @argument {Node} nodaA The first node to use in the comparison
5087
- // @argument {Node} nodeB The second node to use in the comparison
5088
- //
5089
- // @return {Number} A bitmask describing the input nodes' relative position.
5090
- // See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for
5091
- // a description of these values.
5092
- var comparePos = exports.compareDocumentPosition = function(nodeA, nodeB) {
5093
- var aParents = [];
5094
- var bParents = [];
5095
- var current, sharedParent, siblings, aSibling, bSibling, idx;
5096
-
5097
- if (nodeA === nodeB) {
5098
- return 0;
5099
- }
5100
-
5101
- current = nodeA;
5102
- while (current) {
5103
- aParents.unshift(current);
5104
- current = current.parent;
5105
- }
5106
- current = nodeB;
5107
- while (current) {
5108
- bParents.unshift(current);
5109
- current = current.parent;
5110
- }
5111
 
5112
- idx = 0;
5113
- while (aParents[idx] === bParents[idx]) {
5114
- idx++;
5115
- }
 
 
 
 
 
 
 
 
 
 
 
5116
 
5117
- if (idx === 0) {
5118
- return POSITION.DISCONNECTED;
5119
- }
5120
 
5121
- sharedParent = aParents[idx - 1];
5122
- siblings = sharedParent.children;
5123
- aSibling = aParents[idx];
5124
- bSibling = bParents[idx];
5125
 
5126
- if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {
5127
- if (sharedParent === nodeB) {
5128
- return POSITION.FOLLOWING | POSITION.CONTAINED_BY;
5129
- }
5130
- return POSITION.FOLLOWING;
5131
- } else {
5132
- if (sharedParent === nodeA) {
5133
- return POSITION.PRECEDING | POSITION.CONTAINS;
5134
- }
5135
- return POSITION.PRECEDING;
5136
- }
5137
  };
5138
 
5139
- // Sort an array of nodes based on their relative position in the document and
5140
- // remove any duplicate nodes. If the array contains nodes that do not belong
5141
- // to the same document, sort order is unspecified.
5142
- //
5143
- // @argument {Array} nodes Array of DOM nodes
5144
- //
5145
- // @returns {Array} collection of unique nodes, sorted in document order
5146
- exports.uniqueSort = function(nodes) {
5147
- var idx = nodes.length, node, position;
5148
 
5149
- nodes = nodes.slice();
 
 
 
 
5150
 
5151
- while (--idx > -1) {
5152
- node = nodes[idx];
5153
- position = nodes.indexOf(node);
5154
- if (position > -1 && position < idx) {
5155
- nodes.splice(idx, 1);
5156
- }
5157
- }
5158
- nodes.sort(function(a, b) {
5159
- var relative = comparePos(a, b);
5160
- if (relative & POSITION.PRECEDING) {
5161
- return -1;
5162
- } else if (relative & POSITION.FOLLOWING) {
5163
- return 1;
5164
- }
5165
- return 0;
5166
- });
5167
 
5168
- return nodes;
 
 
 
 
 
 
 
5169
  };
5170
 
 
 
 
 
 
5171
 
5172
- /***/ }),
 
 
 
 
 
5173
 
5174
- /***/ 449:
5175
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
5176
 
5177
- module.exports = CollectingHandler;
 
5178
 
5179
- function CollectingHandler(cbs){
5180
- this._cbs = cbs || {};
5181
- this.events = [];
5182
- }
5183
 
5184
- var EVENTS = __webpack_require__(38).EVENTS;
5185
- Object.keys(EVENTS).forEach(function(name){
5186
- if(EVENTS[name] === 0){
5187
- name = "on" + name;
5188
- CollectingHandler.prototype[name] = function(){
5189
- this.events.push([name]);
5190
- if(this._cbs[name]) this._cbs[name]();
5191
- };
5192
- } else if(EVENTS[name] === 1){
5193
- name = "on" + name;
5194
- CollectingHandler.prototype[name] = function(a){
5195
- this.events.push([name, a]);
5196
- if(this._cbs[name]) this._cbs[name](a);
5197
- };
5198
- } else if(EVENTS[name] === 2){
5199
- name = "on" + name;
5200
- CollectingHandler.prototype[name] = function(a, b){
5201
- this.events.push([name, a, b]);
5202
- if(this._cbs[name]) this._cbs[name](a, b);
5203
- };
5204
- } else {
5205
- throw Error("wrong number of arguments");
5206
- }
5207
- });
5208
 
5209
- CollectingHandler.prototype.onreset = function(){
5210
- this.events = [];
5211
- if(this._cbs.onreset) this._cbs.onreset();
5212
- };
 
 
5213
 
5214
- CollectingHandler.prototype.restart = function(){
5215
- if(this._cbs.onreset) this._cbs.onreset();
 
 
 
 
 
 
 
 
 
5216
 
5217
- for(var i = 0, len = this.events.length; i < len; i++){
5218
- if(this._cbs[this.events[i][0]]){
 
 
5219
 
5220
- var num = this.events[i].length;
 
 
 
 
 
 
 
 
5221
 
5222
- if(num === 1){
5223
- this._cbs[this.events[i][0]]();
5224
- } else if(num === 2){
5225
- this._cbs[this.events[i][0]](this.events[i][1]);
5226
- } else {
5227
- this._cbs[this.events[i][0]](this.events[i][1], this.events[i][2]);
5228
- }
5229
- }
5230
- }
5231
  };
5232
 
 
 
5233
 
5234
- /***/ }),
5235
-
5236
- /***/ 45:
5237
- /***/ (function(module, exports) {
5238
-
5239
- //Types of elements found in the DOM
5240
- module.exports = {
5241
- Text: "text", //Text
5242
- Directive: "directive", //<? ... ?>
5243
- Comment: "comment", //<!-- ... -->
5244
- Script: "script", //<script> tags
5245
- Style: "style", //<style> tags
5246
- Tag: "tag", //Any tag
5247
- CDATA: "cdata", //<![CDATA[ ... ]]>
5248
- Doctype: "doctype",
5249
-
5250
- isTag: function(elem){
5251
- return elem.type === "tag" || elem.type === "script" || elem.type === "style";
5252
- }
5253
- };
5254
-
5255
-
5256
- /***/ }),
5257
-
5258
- /***/ 450:
5259
- /***/ (function(module, exports, __webpack_require__) {
5260
-
5261
- "use strict";
5262
 
 
 
 
 
 
 
 
 
 
5263
 
5264
- Object.defineProperty(exports, "__esModule", {
5265
- value: true
5266
- });
5267
 
5268
- var _ElementType$Text$Ele;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5269
 
5270
- var _htmlparser = __webpack_require__(38);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5271
 
5272
- var _TextElementType = __webpack_require__(451);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5273
 
5274
- var _TextElementType2 = _interopRequireDefault(_TextElementType);
 
5275
 
5276
- var _TagElementType = __webpack_require__(452);
 
 
5277
 
5278
- var _TagElementType2 = _interopRequireDefault(_TagElementType);
 
 
 
 
5279
 
5280
- var _StyleElementType = __webpack_require__(459);
 
 
 
 
 
 
 
5281
 
5282
- var _StyleElementType2 = _interopRequireDefault(_StyleElementType);
 
 
 
 
5283
 
5284
- var _UnsupportedElementType = __webpack_require__(460);
 
 
 
 
 
 
5285
 
5286
- var _UnsupportedElementType2 = _interopRequireDefault(_UnsupportedElementType);
 
 
5287
 
5288
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5289
 
5290
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /*
5291
- * Map each htmlparser2 element type to a function which will convert that element type to a React element
5292
- * Not all of the element types are supported so the UnsupportedElementType is used for them which will not return any
5293
- * value
5294
- */
5295
 
5296
- exports.default = (_ElementType$Text$Ele = {}, _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Text, _TextElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Tag, _TagElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Style, _StyleElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Directive, _UnsupportedElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Comment, _UnsupportedElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Script, _UnsupportedElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.CDATA, _UnsupportedElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Doctype, _UnsupportedElementType2.default), _ElementType$Text$Ele);
5297
 
5298
  /***/ }),
5299
-
5300
- /***/ 451:
5301
  /***/ (function(module, exports, __webpack_require__) {
5302
 
5303
- "use strict";
5304
-
5305
-
5306
- Object.defineProperty(exports, "__esModule", {
5307
- value: true
5308
- });
5309
- exports.default = TextElementType;
5310
- /**
5311
- * Converts a text node to a React text element
5312
- *
5313
- * @param {Object} node The text node
5314
- * @returns {String} The text
5315
- */
5316
- function TextElementType(node) {
5317
 
5318
- // React will accept plain text for rendering so just return the node data
5319
- return node.data;
5320
- }
5321
 
5322
  /***/ }),
5323
-
5324
- /***/ 452:
5325
  /***/ (function(module, exports, __webpack_require__) {
5326
 
5327
  "use strict";
5328
 
5329
 
5330
- Object.defineProperty(exports, "__esModule", {
5331
- value: true
5332
- });
5333
- exports.default = TagElementType;
5334
-
5335
- var _react = __webpack_require__(2);
5336
 
5337
- var _react2 = _interopRequireDefault(_react);
 
5338
 
5339
- var _ProcessNodes = __webpack_require__(270);
 
 
5340
 
5341
- var _ProcessNodes2 = _interopRequireDefault(_ProcessNodes);
 
5342
 
5343
- var _GeneratePropsFromAttributes = __webpack_require__(271);
 
 
 
 
 
 
 
5344
 
5345
- var _GeneratePropsFromAttributes2 = _interopRequireDefault(_GeneratePropsFromAttributes);
 
5346
 
5347
- var _TransformTagName = __webpack_require__(457);
 
 
5348
 
5349
- var _TransformTagName2 = _interopRequireDefault(_TransformTagName);
 
 
 
5350
 
5351
- var _VoidElements = __webpack_require__(458);
 
 
 
 
 
 
 
 
 
 
5352
 
5353
- var _VoidElements2 = _interopRequireDefault(_VoidElements);
 
 
 
 
 
 
5354
 
5355
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
 
 
5356
 
5357
- /**
5358
- * Converts any element (excluding style - see StyleElementType - and script) to a react element.
5359
- *
5360
- * @param {Object} node The tag node
5361
- * @param {String} key The key to give the React element
5362
- * @returns {React.Element} The React tag element
5363
- */
5364
- function TagElementType(node, key) {
5365
-
5366
- // generate props
5367
- var props = (0, _GeneratePropsFromAttributes2.default)(node.attribs, key);
5368
-
5369
- // transform the tag name if needed
5370
- var tagName = (0, _TransformTagName2.default)(node.name);
5371
-
5372
- // If the node is not a void element and has children then process them
5373
- var children = null;
5374
- if (_VoidElements2.default.indexOf(tagName) === -1) {
5375
- children = (0, _ProcessNodes2.default)(node.children);
5376
- }
5377
-
5378
- // create and return the element
5379
- return _react2.default.createElement(tagName, props, children);
5380
  }
5381
 
5382
- /***/ }),
 
 
 
5383
 
5384
- /***/ 453:
 
 
5385
  /***/ (function(module, exports, __webpack_require__) {
5386
 
5387
  "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5388
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5389
 
5390
- Object.defineProperty(exports, "__esModule", {
5391
- value: true
5392
- });
5393
- exports.default = HtmlAttributesToReact;
5394
 
5395
- var _BooleanAttributes = __webpack_require__(454);
5396
 
5397
- var _BooleanAttributes2 = _interopRequireDefault(_BooleanAttributes);
5398
 
5399
- var _ReactAttributes = __webpack_require__(455);
5400
 
5401
- var _ReactAttributes2 = _interopRequireDefault(_ReactAttributes);
 
 
 
5402
 
5403
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5404
 
5405
- /**
5406
- * Returns the parsed attribute value taking into account things like boolean attributes
5407
- *
5408
- * @param {String} attribute The name of the attribute
5409
- * @param {*} value The value of the attribute from the HTML
5410
- * @returns {*} The parsed attribute value
5411
- */
5412
- var getParsedAttributeValue = function getParsedAttributeValue(attribute, value) {
5413
 
5414
- // if the attribute if a boolean then it's value should be the same as it's name
5415
- // e.g. disabled="disabled"
5416
- var lowerBooleanAttributes = _BooleanAttributes2.default.map(function (attr) {
5417
- return attr.toLowerCase();
5418
- });
5419
- if (lowerBooleanAttributes.indexOf(attribute.toLowerCase()) >= 0) {
5420
- value = attribute;
5421
- }
5422
 
5423
- return value;
5424
- };
 
5425
 
5426
- /**
5427
- * Takes an object of standard HTML property names and converts them to their React counterpart. If the react
5428
- * version does not exist for an attribute then just use it as it is
5429
- *
5430
- * @param {Object} attributes The HTML attributes to convert
5431
- * @returns {Object} The React attributes
5432
- */
5433
- function HtmlAttributesToReact(attributes) {
5434
 
5435
- return Object.keys(attributes).reduce(function (mappedAttributes, attribute) {
 
 
5436
 
5437
- // lowercase the attribute name and find it in the react attribute map
5438
- var lowerCaseAttribute = attribute.toLowerCase();
5439
 
5440
- // format the attribute name
5441
- var name = _ReactAttributes2.default[lowerCaseAttribute] || lowerCaseAttribute;
5442
 
5443
- // add the parsed attribute value to the mapped attributes
5444
- mappedAttributes[name] = getParsedAttributeValue(name, attributes[attribute]);
5445
 
5446
- return mappedAttributes;
5447
- }, {});
 
 
 
5448
  }
5449
 
5450
- /***/ }),
 
5451
 
5452
- /***/ 454:
5453
- /***/ (function(module, exports, __webpack_require__) {
5454
 
5455
- "use strict";
5456
 
 
5457
 
5458
- Object.defineProperty(exports, "__esModule", {
5459
- value: true
5460
- });
5461
- /**
5462
- * List of boolean attributes
5463
- * These attributes should have their React attribute value set to be the same as their name
5464
- * E.g. <input disabled> = <input disabled>
5465
- * <input disabled=""> = <input disabled>
5466
- * <input disabled="disabled"> = <input disabled>
5467
- * @type {Array}
5468
- */
5469
- exports.default = ['allowfullScreen', 'async', 'autoplay', 'capture', 'checked', 'controls', 'default', 'defer', 'disabled', 'formnovalidate', 'hidden', 'loop', 'multiple', 'muted', 'novalidate', 'open', 'readonly', 'required', 'reversed', 'scoped', 'seamless', 'selected', 'itemscope'];
5470
 
5471
- /***/ }),
 
 
 
5472
 
5473
- /***/ 455:
5474
- /***/ (function(module, exports, __webpack_require__) {
5475
 
5476
- "use strict";
 
5477
 
 
 
 
 
 
 
 
5478
 
5479
- Object.defineProperty(exports, "__esModule", {
5480
- value: true
5481
- });
5482
- /**
5483
- * Mapping of standard HTML attributes to their React counterparts
5484
- * List taken and reversed from react/src/renderers/dom/shared/HTMLDOMPropertyConfig.js
5485
- * https://github.com/facebook/react/blob/c9c3c339b757682f1154f1c915eb55e6a8766933/src/renderers/dom/shared/HTMLDOMPropertyConfig.js
5486
- * @type {Object}
5487
- */
5488
- exports.default = {
5489
- /**
5490
- * Standard Properties
5491
- */
5492
- accept: 'accept',
5493
- 'accept-charset': 'acceptCharset',
5494
- accesskey: 'accessKey',
5495
- action: 'action',
5496
- allowfullscreen: 'allowFullScreen',
5497
- allowtransparency: 'allowTransparency',
5498
- alt: 'alt',
5499
- async: 'async',
5500
- autocomplete: 'autoComplete',
5501
- autoplay: 'autoPlay',
5502
- capture: 'capture',
5503
- cellpadding: 'cellPadding',
5504
- cellspacing: 'cellSpacing',
5505
- charset: 'charSet',
5506
- challenge: 'challenge',
5507
- checked: 'checked',
5508
- classid: 'classID',
5509
- class: 'className',
5510
- cols: 'cols',
5511
- colspan: 'colSpan',
5512
- content: 'content',
5513
- contenteditable: 'contentEditable',
5514
- contextmenu: 'contextMenu',
5515
- controls: 'controls',
5516
- coords: 'coords',
5517
- crossorigin: 'crossOrigin',
5518
- data: 'data',
5519
- datetime: 'dateTime',
5520
- default: 'default',
5521
- defer: 'defer',
5522
- dir: 'dir',
5523
- disabled: 'disabled',
5524
- download: 'download',
5525
- draggable: 'draggable',
5526
- enctype: 'encType',
5527
- form: 'form',
5528
- formaction: 'formAction',
5529
- formenctype: 'formEncType',
5530
- formmethod: 'formMethod',
5531
- formnovalidate: 'formNoValidate',
5532
- formtarget: 'formTarget',
5533
- frameborder: 'frameBorder',
5534
- headers: 'headers',
5535
- height: 'height',
5536
- hidden: 'hidden',
5537
- high: 'high',
5538
- href: 'href',
5539
- hreflang: 'hrefLang',
5540
- for: 'htmlFor',
5541
- 'http-equiv': 'httpEquiv',
5542
- icon: 'icon',
5543
- id: 'id',
5544
- inputmode: 'inputMode',
5545
- integrity: 'integrity',
5546
- is: 'is',
5547
- keyparams: 'keyParams',
5548
- keytype: 'keyType',
5549
- kind: 'kind',
5550
- label: 'label',
5551
- lang: 'lang',
5552
- list: 'list',
5553
- loop: 'loop',
5554
- low: 'low',
5555
- manifest: 'manifest',
5556
- marginheight: 'marginHeight',
5557
- marginwidth: 'marginWidth',
5558
- max: 'max',
5559
- maxlength: 'maxLength',
5560
- media: 'media',
5561
- mediagroup: 'mediaGroup',
5562
- method: 'method',
5563
- min: 'min',
5564
- minlength: 'minLength',
5565
- multiple: 'multiple',
5566
- muted: 'muted',
5567
- name: 'name',
5568
- nonce: 'nonce',
5569
- novalidate: 'noValidate',
5570
- open: 'open',
5571
- optimum: 'optimum',
5572
- pattern: 'pattern',
5573
- placeholder: 'placeholder',
5574
- poster: 'poster',
5575
- preload: 'preload',
5576
- radiogroup: 'radioGroup',
5577
- readonly: 'readOnly',
5578
- rel: 'rel',
5579
- required: 'required',
5580
- reversed: 'reversed',
5581
- role: 'role',
5582
- rows: 'rows',
5583
- rowspan: 'rowSpan',
5584
- sandbox: 'sandbox',
5585
- scope: 'scope',
5586
- scoped: 'scoped',
5587
- scrolling: 'scrolling',
5588
- seamless: 'seamless',
5589
- selected: 'selected',
5590
- shape: 'shape',
5591
- size: 'size',
5592
- sizes: 'sizes',
5593
- span: 'span',
5594
- spellcheck: 'spellCheck',
5595
- src: 'src',
5596
- srcdoc: 'srcDoc',
5597
- srclang: 'srcLang',
5598
- srcset: 'srcSet',
5599
- start: 'start',
5600
- step: 'step',
5601
- style: 'style',
5602
- summary: 'summary',
5603
- tabindex: 'tabIndex',
5604
- target: 'target',
5605
- title: 'title',
5606
- type: 'type',
5607
- usemap: 'useMap',
5608
- value: 'value',
5609
- width: 'width',
5610
- wmode: 'wmode',
5611
- wrap: 'wrap',
5612
- /**
5613
- * RDFa Properties
5614
- */
5615
- about: 'about',
5616
- datatype: 'datatype',
5617
- inlist: 'inlist',
5618
- prefix: 'prefix',
5619
- property: 'property',
5620
- resource: 'resource',
5621
- typeof: 'typeof',
5622
- vocab: 'vocab',
5623
- /**
5624
- * Non-standard Properties
5625
- */
5626
- autocapitalize: 'autoCapitalize',
5627
- autocorrect: 'autoCorrect',
5628
- autosave: 'autoSave',
5629
- color: 'color',
5630
- itemprop: 'itemProp',
5631
- itemscope: 'itemScope',
5632
- itemtype: 'itemType',
5633
- itemid: 'itemID',
5634
- itemref: 'itemRef',
5635
- results: 'results',
5636
- security: 'security',
5637
- unselectable: 'unselectable',
5638
- autofocus: 'autoFocus'
5639
  };
5640
 
5641
- /***/ }),
5642
-
5643
- /***/ 456:
5644
- /***/ (function(module, exports, __webpack_require__) {
5645
-
5646
- "use strict";
5647
-
5648
-
5649
- Object.defineProperty(exports, "__esModule", {
5650
- value: true
5651
- });
5652
-
5653
- var _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"); } }; }();
5654
-
5655
- exports.default = InlineStyleToObject;
5656
- /**
5657
- * Converts an inline style string into an object of React style properties
5658
- *
5659
- * @param {String} inlineStyle='' The inline style to convert
5660
- * @returns {Object} The converted style
5661
- */
5662
- function InlineStyleToObject() {
5663
- var inlineStyle = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
5664
-
5665
 
5666
- // just return empty object if the inlineStyle is empty
5667
- if (inlineStyle === '') {
5668
- return {};
 
 
 
 
 
5669
  }
 
5670
 
5671
- return inlineStyle.split(';').reduce(function (styleObject, stylePropertyValue) {
 
 
 
 
5672
 
5673
- // extract the style property name and value
 
 
 
 
 
 
 
 
5674
 
5675
- var _stylePropertyValue$s = stylePropertyValue.split(':').map(function (item) {
5676
- return item.trim().toLowerCase();
5677
- });
5678
 
5679
- var _stylePropertyValue$s2 = _slicedToArray(_stylePropertyValue$s, 2);
 
 
 
 
5680
 
5681
- var property = _stylePropertyValue$s2[0];
5682
- var value = _stylePropertyValue$s2[1];
5683
 
5684
- // if there is no value (i.e. no : in the style) then ignore it
5685
 
5686
- if (value === undefined) {
5687
- return styleObject;
5688
- }
 
5689
 
5690
- // convert the property name into the correct React format
5691
- // remove all hyphens and convert the letter immediately after each hyphen to upper case
5692
- // additionally don't uppercase any -ms- prefix
5693
- // e.g. -ms-style-property = msStyleProperty
5694
- // -webkit-style-property = WebkitStyleProperty
5695
- property = property.replace(/^-ms-/, 'ms-').replace(/-(.)/g, function (_, character) {
5696
- return character.toUpperCase();
5697
- });
5698
 
5699
- // add the new style property and value to the style object
5700
- styleObject[property] = value;
5701
 
5702
- return styleObject;
5703
- }, {});
5704
  }
5705
 
5706
  /***/ }),
5707
-
5708
- /***/ 457:
5709
  /***/ (function(module, exports, __webpack_require__) {
5710
 
5711
  "use strict";
@@ -5714,48 +6609,52 @@ function InlineStyleToObject() {
5714
  Object.defineProperty(exports, "__esModule", {
5715
  value: true
5716
  });
5717
- exports.default = TransformTagName;
5718
- var TAGS_TO_TRANSFORM = {
5719
- 'html': 'div',
5720
- 'head': 'div',
5721
- 'body': 'div'
5722
- };
5723
-
5724
- /**
5725
- * Transforms the specified tag name to another tag name if needed
5726
- *
5727
- * @param {String} tagName The name of the tag
5728
- * @returns {String} The transformed tag name or the original if it doesn't need to be transformed
5729
- */
5730
- function TransformTagName(tagName) {
5731
- if (TAGS_TO_TRANSFORM.hasOwnProperty(tagName)) {
5732
- return TAGS_TO_TRANSFORM[tagName];
5733
- } else {
5734
- return tagName;
5735
- }
5736
- }
5737
-
5738
- /***/ }),
5739
 
5740
- /***/ 458:
5741
- /***/ (function(module, exports, __webpack_require__) {
5742
 
5743
- "use strict";
5744
 
 
5745
 
5746
- Object.defineProperty(exports, "__esModule", {
5747
- value: true
5748
- });
5749
  /**
5750
- * List of void elements
5751
- * These elements are not allowed to have children
5752
- * @type {Array}
 
 
5753
  */
5754
- exports.default = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
 
 
5755
 
5756
- /***/ }),
 
 
 
 
 
 
 
 
 
 
5757
 
5758
- /***/ 459:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5759
  /***/ (function(module, exports, __webpack_require__) {
5760
 
5761
  "use strict";
@@ -5764,159 +6663,258 @@ exports.default = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img',
5764
  Object.defineProperty(exports, "__esModule", {
5765
  value: true
5766
  });
5767
- exports.default = StyleElementType;
5768
 
5769
- var _react = __webpack_require__(2);
5770
 
5771
- var _react2 = _interopRequireDefault(_react);
5772
 
5773
- var _GeneratePropsFromAttributes = __webpack_require__(271);
5774
 
5775
- var _GeneratePropsFromAttributes2 = _interopRequireDefault(_GeneratePropsFromAttributes);
 
 
 
 
5776
 
5777
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5778
 
5779
  /**
5780
- * Converts a <style> element to a React element
5781
  *
5782
- * @param {Object} node The style node
5783
- * @param {String} key The key to give the React element
5784
- * @returns {React.Element} The React style element
5785
  */
5786
- function StyleElementType(node, key) {
5787
-
5788
- // The style element only ever has a single child which is the styles so try and find this to add as
5789
- // a child to the style element that will be created
5790
- var styles = void 0;
5791
- if (node.children.length > 0) {
5792
- styles = node.children[0].data;
5793
- }
5794
 
5795
  // generate props
5796
- var props = (0, _GeneratePropsFromAttributes2.default)(node.attribs, key);
5797
 
5798
- // create and return the element
5799
- return _react2.default.createElement('style', props, styles);
 
 
 
 
5800
  }
5801
 
5802
  /***/ }),
5803
-
5804
- /***/ 46:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5805
  /***/ (function(module, exports, __webpack_require__) {
5806
 
5807
- /* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.
5808
- //
5809
- // Permission is hereby granted, free of charge, to any person obtaining a
5810
- // copy of this software and associated documentation files (the
5811
- // "Software"), to deal in the Software without restriction, including
5812
- // without limitation the rights to use, copy, modify, merge, publish,
5813
- // distribute, sublicense, and/or sell copies of the Software, and to permit
5814
- // persons to whom the Software is furnished to do so, subject to the
5815
- // following conditions:
5816
- //
5817
- // The above copyright notice and this permission notice shall be included
5818
- // in all copies or substantial portions of the Software.
5819
- //
5820
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5821
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5822
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5823
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5824
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5825
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5826
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
5827
 
5828
- // NOTE: These type checking functions intentionally don't use `instanceof`
5829
- // because it is fragile and can be easily faked with `Object.create()`.
5830
 
5831
- function isArray(arg) {
5832
- if (Array.isArray) {
5833
- return Array.isArray(arg);
5834
- }
5835
- return objectToString(arg) === '[object Array]';
5836
- }
5837
- exports.isArray = isArray;
5838
 
5839
- function isBoolean(arg) {
5840
- return typeof arg === 'boolean';
5841
- }
5842
- exports.isBoolean = isBoolean;
5843
 
5844
- function isNull(arg) {
5845
- return arg === null;
5846
- }
5847
- exports.isNull = isNull;
5848
 
5849
- function isNullOrUndefined(arg) {
5850
- return arg == null;
5851
- }
5852
- exports.isNullOrUndefined = isNullOrUndefined;
5853
 
5854
- function isNumber(arg) {
5855
- return typeof arg === 'number';
5856
- }
5857
- exports.isNumber = isNumber;
5858
 
5859
- function isString(arg) {
5860
- return typeof arg === 'string';
5861
- }
5862
- exports.isString = isString;
5863
 
5864
- function isSymbol(arg) {
5865
- return typeof arg === 'symbol';
5866
- }
5867
- exports.isSymbol = isSymbol;
5868
 
5869
- function isUndefined(arg) {
5870
- return arg === void 0;
5871
- }
5872
- exports.isUndefined = isUndefined;
5873
 
5874
- function isRegExp(re) {
5875
- return objectToString(re) === '[object RegExp]';
5876
- }
5877
- exports.isRegExp = isRegExp;
5878
 
5879
- function isObject(arg) {
5880
- return typeof arg === 'object' && arg !== null;
5881
- }
5882
- exports.isObject = isObject;
5883
 
5884
- function isDate(d) {
5885
- return objectToString(d) === '[object Date]';
5886
- }
5887
- exports.isDate = isDate;
 
 
 
 
 
 
 
 
 
 
 
 
 
5888
 
5889
- function isError(e) {
5890
- return (objectToString(e) === '[object Error]' || e instanceof Error);
5891
- }
5892
- exports.isError = isError;
5893
 
5894
- function isFunction(arg) {
5895
- return typeof arg === 'function';
5896
- }
5897
- exports.isFunction = isFunction;
 
 
 
 
 
 
5898
 
5899
- function isPrimitive(arg) {
5900
- return arg === null ||
5901
- typeof arg === 'boolean' ||
5902
- typeof arg === 'number' ||
5903
- typeof arg === 'string' ||
5904
- typeof arg === 'symbol' || // ES6 symbol
5905
- typeof arg === 'undefined';
5906
  }
5907
- exports.isPrimitive = isPrimitive;
5908
 
5909
- exports.isBuffer = Buffer.isBuffer;
5910
-
5911
- function objectToString(o) {
5912
- return Object.prototype.toString.call(o);
5913
- }
5914
 
5915
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(88).Buffer))
5916
 
5917
  /***/ }),
5918
-
5919
- /***/ 460:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5920
  /***/ (function(module, exports, __webpack_require__) {
5921
 
5922
  "use strict";
@@ -5925,21 +6923,17 @@ function objectToString(o) {
5925
  Object.defineProperty(exports, "__esModule", {
5926
  value: true
5927
  });
5928
- exports.default = UnsupportedElementType;
5929
- /**
5930
- * Handles an unsupported element type by returning null so nothing is rendered
5931
- * @returns {null}
5932
- */
5933
- function UnsupportedElementType() {
5934
 
5935
- // do nothing because the element type is unsupported
5936
- // comment, directive, script, cdata, doctype are all currently unsupported
5937
- return null;
5938
- }
5939
 
5940
- /***/ }),
 
 
 
 
5941
 
5942
- /***/ 479:
 
5943
  /***/ (function(module, exports, __webpack_require__) {
5944
 
5945
  "use strict";
@@ -5948,3804 +6942,3579 @@ function UnsupportedElementType() {
5948
  Object.defineProperty(exports, "__esModule", {
5949
  value: true
5950
  });
5951
- exports.fromNewsletter = exports.fromUrl = exports.fromDom = undefined;
5952
-
5953
- var _underscore = __webpack_require__(8);
5954
-
5955
- var _underscore2 = _interopRequireDefault(_underscore);
5956
 
5957
- var _mailpoet = __webpack_require__(4);
5958
 
5959
- var _mailpoet2 = _interopRequireDefault(_mailpoet);
5960
 
5961
- var _html2canvas = __webpack_require__(480);
5962
 
5963
- var _html2canvas2 = _interopRequireDefault(_html2canvas);
5964
 
5965
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5966
 
5967
  /**
5968
- * Generates a thumbnail from a DOM element.
5969
  *
5970
- * @param {DOMElement} element
5971
- * @return {Promise<String>} DataURL of the generated image.
5972
  */
5973
- var fromDom = exports.fromDom = function fromDom(element) {
5974
- return (0, _html2canvas2.default)(element, {
5975
- logging: false
5976
- }).then(function (canvas) {
5977
- return canvas.toDataURL('image/jpeg');
5978
- });
5979
- };
5980
-
5981
- /**
5982
- * Generates a thumbnail from an URL.
5983
- *
5984
- * @param {String} url
5985
- * @return {Promise<String>} DataURL of the generated image.
5986
- */
5987
- var fromUrl = exports.fromUrl = function fromUrl(url) {
5988
- return new Promise(function (resolve, reject) {
5989
- var iframe = document.createElement('iframe');
5990
- var protocol = location.href.startsWith('https://') ? 'https:' : 'http:';
5991
- iframe.src = protocol + url.replace(/^https?:/, '');
5992
- iframe.style.opacity = 0;
5993
- iframe.scrolling = 'no';
5994
- iframe.onload = function () {
5995
- fromDom(iframe.contentDocument.documentElement).then(function (image) {
5996
- document.body.removeChild(iframe);
5997
- resolve(image);
5998
- }).catch(function () {
5999
- document.body.removeChild(iframe);
6000
- reject(_mailpoet2.default.I18n.t('errorWhileTakingScreenshot'));
6001
- });
6002
- };
6003
- var onError = function onError() {
6004
- document.body.removeChild(iframe);
6005
- reject(_mailpoet2.default.I18n.t('errorWhileTakingScreenshot'));
6006
- };
6007
- iframe.onerror = onError;
6008
- iframe.onError = onError;
6009
- iframe.className = 'mailpoet_template_iframe';
6010
- try {
6011
- document.body.appendChild(iframe);
6012
- } catch (err) {
6013
- onError();
6014
- }
6015
- });
6016
- };
6017
-
6018
- /**
6019
- * Generates a thumbnail from a newsletter's data.
6020
- *
6021
- * @param {Object} data
6022
- * @return {Promise<String>} DataURL of the generated image.
6023
- */
6024
- var fromNewsletter = exports.fromNewsletter = function fromNewsletter(data) {
6025
- return new Promise(function (resolve, reject) {
6026
- var json = data;
6027
- if (!_underscore2.default.isUndefined(json.body)) {
6028
- json.body = JSON.stringify(json.body);
6029
- }
6030
- _mailpoet2.default.Ajax.post({
6031
- api_version: window.mailpoet_api_version,
6032
- endpoint: 'newsletters',
6033
- action: 'showPreview',
6034
- data: json
6035
- }).done(function (response) {
6036
- return fromUrl(response.meta.preview_url).then(resolve).catch(reject);
6037
- }).fail(function (response) {
6038
- return reject(response.errors);
6039
- });
6040
- });
6041
- };
6042
 
6043
  /***/ }),
 
 
6044
 
6045
- /***/ 480:
6046
- /***/ (function(module, exports, __webpack_require__) {
6047
-
6048
- /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["html2canvas"] = __webpack_require__(481);
6049
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9)))
6050
 
6051
  /***/ }),
6052
-
6053
- /***/ 481:
6054
- /***/ (function(module, exports, __webpack_require__) {
6055
-
6056
- /*!
6057
- * html2canvas 1.0.0-alpha.12 <https://html2canvas.hertzen.com>
6058
- * Copyright (c) 2018 Niklas von Hertzen <https://hertzen.com>
6059
- * Released under MIT License
6060
- */
6061
- (function webpackUniversalModuleDefinition(root, factory) {
6062
- if(true)
6063
- module.exports = factory();
6064
- else if(typeof define === 'function' && define.amd)
6065
- define([], factory);
6066
- else if(typeof exports === 'object')
6067
- exports["html2canvas"] = factory();
6068
- else
6069
- root["html2canvas"] = factory();
6070
- })(this, function() {
6071
- return /******/ (function(modules) { // webpackBootstrap
6072
- /******/ // The module cache
6073
- /******/ var installedModules = {};
6074
- /******/
6075
- /******/ // The require function
6076
- /******/ function __webpack_require__(moduleId) {
6077
- /******/
6078
- /******/ // Check if module is in cache
6079
- /******/ if(installedModules[moduleId]) {
6080
- /******/ return installedModules[moduleId].exports;
6081
- /******/ }
6082
- /******/ // Create a new module (and put it into the cache)
6083
- /******/ var module = installedModules[moduleId] = {
6084
- /******/ i: moduleId,
6085
- /******/ l: false,
6086
- /******/ exports: {}
6087
- /******/ };
6088
- /******/
6089
- /******/ // Execute the module function
6090
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
6091
- /******/
6092
- /******/ // Flag the module as loaded
6093
- /******/ module.l = true;
6094
- /******/
6095
- /******/ // Return the exports of the module
6096
- /******/ return module.exports;
6097
- /******/ }
6098
- /******/
6099
- /******/
6100
- /******/ // expose the modules object (__webpack_modules__)
6101
- /******/ __webpack_require__.m = modules;
6102
- /******/
6103
- /******/ // expose the module cache
6104
- /******/ __webpack_require__.c = installedModules;
6105
- /******/
6106
- /******/ // define getter function for harmony exports
6107
- /******/ __webpack_require__.d = function(exports, name, getter) {
6108
- /******/ if(!__webpack_require__.o(exports, name)) {
6109
- /******/ Object.defineProperty(exports, name, {
6110
- /******/ configurable: false,
6111
- /******/ enumerable: true,
6112
- /******/ get: getter
6113
- /******/ });
6114
- /******/ }
6115
- /******/ };
6116
- /******/
6117
- /******/ // getDefaultExport function for compatibility with non-harmony modules
6118
- /******/ __webpack_require__.n = function(module) {
6119
- /******/ var getter = module && module.__esModule ?
6120
- /******/ function getDefault() { return module['default']; } :
6121
- /******/ function getModuleExports() { return module; };
6122
- /******/ __webpack_require__.d(getter, 'a', getter);
6123
- /******/ return getter;
6124
- /******/ };
6125
- /******/
6126
- /******/ // Object.prototype.hasOwnProperty.call
6127
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
6128
- /******/
6129
- /******/ // __webpack_public_path__
6130
- /******/ __webpack_require__.p = "";
6131
- /******/
6132
- /******/ // Load entry module and return exports
6133
- /******/ return __webpack_require__(__webpack_require__.s = 27);
6134
- /******/ })
6135
- /************************************************************************/
6136
- /******/ ([
6137
- /* 0 */
6138
  /***/ (function(module, exports, __webpack_require__) {
6139
 
6140
- "use strict";
6141
-
6142
-
6143
- // http://dev.w3.org/csswg/css-color/
6144
-
6145
- Object.defineProperty(exports, "__esModule", {
6146
- value: true
6147
- });
6148
-
6149
- var _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"); } }; }();
6150
 
6151
- var _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; }; }();
 
 
6152
 
6153
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6154
 
6155
- var HEX3 = /^#([a-f0-9]{3})$/i;
6156
- var hex3 = function hex3(value) {
6157
- var match = value.match(HEX3);
6158
- if (match) {
6159
- 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];
6160
- }
6161
- return false;
6162
  };
6163
 
6164
- var HEX6 = /^#([a-f0-9]{6})$/i;
6165
- var hex6 = function hex6(value) {
6166
- var match = value.match(HEX6);
6167
- if (match) {
6168
- return [parseInt(match[1].substring(0, 2), 16), parseInt(match[1].substring(2, 4), 16), parseInt(match[1].substring(4, 6), 16), null];
6169
- }
6170
- return false;
6171
  };
6172
 
6173
- var RGB = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;
6174
- var rgb = function rgb(value) {
6175
- var match = value.match(RGB);
6176
- if (match) {
6177
- return [Number(match[1]), Number(match[2]), Number(match[3]), null];
6178
- }
6179
- return false;
6180
  };
6181
 
6182
- var RGBA = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/;
6183
- var rgba = function rgba(value) {
6184
- var match = value.match(RGBA);
6185
- if (match && match.length > 4) {
6186
- return [Number(match[1]), Number(match[2]), Number(match[3]), Number(match[4])];
6187
- }
6188
- return false;
6189
  };
6190
 
6191
- var fromArray = function fromArray(array) {
6192
- return [Math.min(array[0], 255), Math.min(array[1], 255), Math.min(array[2], 255), array.length > 3 ? array[3] : null];
 
 
 
 
 
6193
  };
6194
 
6195
- var namedColor = function namedColor(name) {
6196
- var color = NAMED_COLORS[name.toLowerCase()];
6197
- return color ? color : false;
6198
- };
6199
 
6200
- var Color = function () {
6201
- function Color(value) {
6202
- _classCallCheck(this, Color);
6203
 
6204
- var _ref = Array.isArray(value) ? fromArray(value) : hex3(value) || rgb(value) || rgba(value) || namedColor(value) || hex6(value) || [0, 0, 0, null],
6205
- _ref2 = _slicedToArray(_ref, 4),
6206
- r = _ref2[0],
6207
- g = _ref2[1],
6208
- b = _ref2[2],
6209
- a = _ref2[3];
6210
 
6211
- this.r = r;
6212
- this.g = g;
6213
- this.b = b;
6214
- this.a = a;
6215
- }
6216
-
6217
- _createClass(Color, [{
6218
- key: 'isTransparent',
6219
- value: function isTransparent() {
6220
- return this.a === 0;
6221
- }
6222
- }, {
6223
- key: 'toString',
6224
- value: function toString() {
6225
- return this.a !== null && this.a !== 1 ? 'rgba(' + this.r + ',' + this.g + ',' + this.b + ',' + this.a + ')' : 'rgb(' + this.r + ',' + this.g + ',' + this.b + ')';
6226
- }
6227
- }]);
6228
-
6229
- return Color;
6230
- }();
6231
 
6232
- exports.default = Color;
 
 
 
 
 
6233
 
 
 
 
 
 
6234
 
6235
- var NAMED_COLORS = {
6236
- transparent: [0, 0, 0, 0],
6237
- aliceblue: [240, 248, 255, null],
6238
- antiquewhite: [250, 235, 215, null],
6239
- aqua: [0, 255, 255, null],
6240
- aquamarine: [127, 255, 212, null],
6241
- azure: [240, 255, 255, null],
6242
- beige: [245, 245, 220, null],
6243
- bisque: [255, 228, 196, null],
6244
- black: [0, 0, 0, null],
6245
- blanchedalmond: [255, 235, 205, null],
6246
- blue: [0, 0, 255, null],
6247
- blueviolet: [138, 43, 226, null],
6248
- brown: [165, 42, 42, null],
6249
- burlywood: [222, 184, 135, null],
6250
- cadetblue: [95, 158, 160, null],
6251
- chartreuse: [127, 255, 0, null],
6252
- chocolate: [210, 105, 30, null],
6253
- coral: [255, 127, 80, null],
6254
- cornflowerblue: [100, 149, 237, null],
6255
- cornsilk: [255, 248, 220, null],
6256
- crimson: [220, 20, 60, null],
6257
- cyan: [0, 255, 255, null],
6258
- darkblue: [0, 0, 139, null],
6259
- darkcyan: [0, 139, 139, null],
6260
- darkgoldenrod: [184, 134, 11, null],
6261
- darkgray: [169, 169, 169, null],
6262
- darkgreen: [0, 100, 0, null],
6263
- darkgrey: [169, 169, 169, null],
6264
- darkkhaki: [189, 183, 107, null],
6265
- darkmagenta: [139, 0, 139, null],
6266
- darkolivegreen: [85, 107, 47, null],
6267
- darkorange: [255, 140, 0, null],
6268
- darkorchid: [153, 50, 204, null],
6269
- darkred: [139, 0, 0, null],
6270
- darksalmon: [233, 150, 122, null],
6271
- darkseagreen: [143, 188, 143, null],
6272
- darkslateblue: [72, 61, 139, null],
6273
- darkslategray: [47, 79, 79, null],
6274
- darkslategrey: [47, 79, 79, null],
6275
- darkturquoise: [0, 206, 209, null],
6276
- darkviolet: [148, 0, 211, null],
6277
- deeppink: [255, 20, 147, null],
6278
- deepskyblue: [0, 191, 255, null],
6279
- dimgray: [105, 105, 105, null],
6280
- dimgrey: [105, 105, 105, null],
6281
- dodgerblue: [30, 144, 255, null],
6282
- firebrick: [178, 34, 34, null],
6283
- floralwhite: [255, 250, 240, null],
6284
- forestgreen: [34, 139, 34, null],
6285
- fuchsia: [255, 0, 255, null],
6286
- gainsboro: [220, 220, 220, null],
6287
- ghostwhite: [248, 248, 255, null],
6288
- gold: [255, 215, 0, null],
6289
- goldenrod: [218, 165, 32, null],
6290
- gray: [128, 128, 128, null],
6291
- green: [0, 128, 0, null],
6292
- greenyellow: [173, 255, 47, null],
6293
- grey: [128, 128, 128, null],
6294
- honeydew: [240, 255, 240, null],
6295
- hotpink: [255, 105, 180, null],
6296
- indianred: [205, 92, 92, null],
6297
- indigo: [75, 0, 130, null],
6298
- ivory: [255, 255, 240, null],
6299
- khaki: [240, 230, 140, null],
6300
- lavender: [230, 230, 250, null],
6301
- lavenderblush: [255, 240, 245, null],
6302
- lawngreen: [124, 252, 0, null],
6303
- lemonchiffon: [255, 250, 205, null],
6304
- lightblue: [173, 216, 230, null],
6305
- lightcoral: [240, 128, 128, null],
6306
- lightcyan: [224, 255, 255, null],
6307
- lightgoldenrodyellow: [250, 250, 210, null],
6308
- lightgray: [211, 211, 211, null],
6309
- lightgreen: [144, 238, 144, null],
6310
- lightgrey: [211, 211, 211, null],
6311
- lightpink: [255, 182, 193, null],
6312
- lightsalmon: [255, 160, 122, null],
6313
- lightseagreen: [32, 178, 170, null],
6314
- lightskyblue: [135, 206, 250, null],
6315
- lightslategray: [119, 136, 153, null],
6316
- lightslategrey: [119, 136, 153, null],
6317
- lightsteelblue: [176, 196, 222, null],
6318
- lightyellow: [255, 255, 224, null],
6319
- lime: [0, 255, 0, null],
6320
- limegreen: [50, 205, 50, null],
6321
- linen: [250, 240, 230, null],
6322
- magenta: [255, 0, 255, null],
6323
- maroon: [128, 0, 0, null],
6324
- mediumaquamarine: [102, 205, 170, null],
6325
- mediumblue: [0, 0, 205, null],
6326
- mediumorchid: [186, 85, 211, null],
6327
- mediumpurple: [147, 112, 219, null],
6328
- mediumseagreen: [60, 179, 113, null],
6329
- mediumslateblue: [123, 104, 238, null],
6330
- mediumspringgreen: [0, 250, 154, null],
6331
- mediumturquoise: [72, 209, 204, null],
6332
- mediumvioletred: [199, 21, 133, null],
6333
- midnightblue: [25, 25, 112, null],
6334
- mintcream: [245, 255, 250, null],
6335
- mistyrose: [255, 228, 225, null],
6336
- moccasin: [255, 228, 181, null],
6337
- navajowhite: [255, 222, 173, null],
6338
- navy: [0, 0, 128, null],
6339
- oldlace: [253, 245, 230, null],
6340
- olive: [128, 128, 0, null],
6341
- olivedrab: [107, 142, 35, null],
6342
- orange: [255, 165, 0, null],
6343
- orangered: [255, 69, 0, null],
6344
- orchid: [218, 112, 214, null],
6345
- palegoldenrod: [238, 232, 170, null],
6346
- palegreen: [152, 251, 152, null],
6347
- paleturquoise: [175, 238, 238, null],
6348
- palevioletred: [219, 112, 147, null],
6349
- papayawhip: [255, 239, 213, null],
6350
- peachpuff: [255, 218, 185, null],
6351
- peru: [205, 133, 63, null],
6352
- pink: [255, 192, 203, null],
6353
- plum: [221, 160, 221, null],
6354
- powderblue: [176, 224, 230, null],
6355
- purple: [128, 0, 128, null],
6356
- rebeccapurple: [102, 51, 153, null],
6357
- red: [255, 0, 0, null],
6358
- rosybrown: [188, 143, 143, null],
6359
- royalblue: [65, 105, 225, null],
6360
- saddlebrown: [139, 69, 19, null],
6361
- salmon: [250, 128, 114, null],
6362
- sandybrown: [244, 164, 96, null],
6363
- seagreen: [46, 139, 87, null],
6364
- seashell: [255, 245, 238, null],
6365
- sienna: [160, 82, 45, null],
6366
- silver: [192, 192, 192, null],
6367
- skyblue: [135, 206, 235, null],
6368
- slateblue: [106, 90, 205, null],
6369
- slategray: [112, 128, 144, null],
6370
- slategrey: [112, 128, 144, null],
6371
- snow: [255, 250, 250, null],
6372
- springgreen: [0, 255, 127, null],
6373
- steelblue: [70, 130, 180, null],
6374
- tan: [210, 180, 140, null],
6375
- teal: [0, 128, 128, null],
6376
- thistle: [216, 191, 216, null],
6377
- tomato: [255, 99, 71, null],
6378
- turquoise: [64, 224, 208, null],
6379
- violet: [238, 130, 238, null],
6380
- wheat: [245, 222, 179, null],
6381
- white: [255, 255, 255, null],
6382
- whitesmoke: [245, 245, 245, null],
6383
- yellow: [255, 255, 0, null],
6384
- yellowgreen: [154, 205, 50, null]
6385
  };
6386
 
6387
- var TRANSPARENT = exports.TRANSPARENT = new Color([0, 0, 0, 0]);
6388
-
6389
- /***/ }),
6390
- /* 1 */
6391
- /***/ (function(module, exports, __webpack_require__) {
6392
-
6393
- "use strict";
6394
-
6395
 
6396
- Object.defineProperty(exports, "__esModule", {
6397
- value: true
6398
- });
6399
- exports.calculateLengthFromValueWithUnit = exports.LENGTH_TYPE = undefined;
6400
 
6401
- var _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; }; }();
 
 
 
 
 
6402
 
6403
- var _NodeContainer = __webpack_require__(3);
 
 
 
 
 
6404
 
6405
- var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
 
 
6406
 
6407
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
 
6408
 
6409
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6410
 
6411
- var LENGTH_WITH_UNIT = /([\d.]+)(px|r?em|%)/i;
6412
 
6413
- var LENGTH_TYPE = exports.LENGTH_TYPE = {
6414
- PX: 0,
6415
- PERCENTAGE: 1
6416
  };
6417
 
6418
- var Length = function () {
6419
- function Length(value) {
6420
- _classCallCheck(this, Length);
 
6421
 
6422
- this.type = value.substr(value.length - 1) === '%' ? LENGTH_TYPE.PERCENTAGE : LENGTH_TYPE.PX;
6423
- var parsedValue = parseFloat(value);
6424
- if (true && isNaN(parsedValue)) {
6425
- console.error('Invalid value given for Length: "' + value + '"');
6426
- }
6427
- this.value = isNaN(parsedValue) ? 0 : parsedValue;
6428
- }
6429
 
6430
- _createClass(Length, [{
6431
- key: 'isPercentage',
6432
- value: function isPercentage() {
6433
- return this.type === LENGTH_TYPE.PERCENTAGE;
6434
- }
6435
- }, {
6436
- key: 'getAbsoluteValue',
6437
- value: function getAbsoluteValue(parentLength) {
6438
- return this.isPercentage() ? parentLength * (this.value / 100) : this.value;
6439
- }
6440
- }], [{
6441
- key: 'create',
6442
- value: function create(v) {
6443
- return new Length(v);
6444
- }
6445
- }]);
6446
-
6447
- return Length;
6448
- }();
6449
-
6450
- exports.default = Length;
 
6451
 
 
 
 
 
6452
 
6453
- var getRootFontSize = function getRootFontSize(container) {
6454
- var parent = container.parent;
6455
- return parent ? getRootFontSize(parent) : parseFloat(container.style.font.fontSize);
6456
  };
6457
 
6458
- var calculateLengthFromValueWithUnit = exports.calculateLengthFromValueWithUnit = function calculateLengthFromValueWithUnit(container, value, unit) {
6459
- switch (unit) {
6460
- case 'px':
6461
- case '%':
6462
- return new Length(value + unit);
6463
- case 'em':
6464
- case 'rem':
6465
- var length = new Length(value);
6466
- length.value *= unit === 'em' ? parseFloat(container.style.font.fontSize) : getRootFontSize(container);
6467
- return length;
6468
- default:
6469
- // TODO: handle correctly if unknown unit is used
6470
- return new Length('0');
6471
- }
6472
- };
6473
 
6474
- /***/ }),
6475
- /* 2 */
6476
- /***/ (function(module, exports, __webpack_require__) {
 
6477
 
6478
- "use strict";
 
 
 
6479
 
 
6480
 
6481
- Object.defineProperty(exports, "__esModule", {
6482
- value: true
6483
- });
6484
- exports.parseBoundCurves = exports.calculatePaddingBoxPath = exports.calculateBorderBoxPath = exports.parsePathForBorder = exports.parseDocumentSize = exports.calculateContentBox = exports.calculatePaddingBox = exports.parseBounds = exports.Bounds = undefined;
6485
 
6486
- var _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; }; }();
 
 
 
 
 
 
 
6487
 
6488
- var _Vector = __webpack_require__(7);
6489
 
6490
- var _Vector2 = _interopRequireDefault(_Vector);
 
 
6491
 
6492
- var _BezierCurve = __webpack_require__(32);
 
 
6493
 
6494
- var _BezierCurve2 = _interopRequireDefault(_BezierCurve);
 
 
 
 
 
6495
 
6496
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
6497
 
6498
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6499
 
6500
- var TOP = 0;
6501
- var RIGHT = 1;
6502
- var BOTTOM = 2;
6503
- var LEFT = 3;
6504
 
6505
- var H = 0;
6506
- var V = 1;
 
6507
 
6508
- var Bounds = exports.Bounds = function () {
6509
- function Bounds(x, y, w, h) {
6510
- _classCallCheck(this, Bounds);
6511
 
6512
- this.left = x;
6513
- this.top = y;
6514
- this.width = w;
6515
- this.height = h;
6516
- }
6517
 
6518
- _createClass(Bounds, null, [{
6519
- key: 'fromClientRect',
6520
- value: function fromClientRect(clientRect, scrollX, scrollY) {
6521
- return new Bounds(clientRect.left + scrollX, clientRect.top + scrollY, clientRect.width, clientRect.height);
6522
- }
6523
- }]);
 
 
 
 
 
 
6524
 
6525
- return Bounds;
6526
- }();
6527
 
6528
- var parseBounds = exports.parseBounds = function parseBounds(node, scrollX, scrollY) {
6529
- return Bounds.fromClientRect(node.getBoundingClientRect(), scrollX, scrollY);
6530
- };
6531
 
6532
- var calculatePaddingBox = exports.calculatePaddingBox = function calculatePaddingBox(bounds, borders) {
6533
- 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));
6534
- };
6535
 
6536
- var calculateContentBox = exports.calculateContentBox = function calculateContentBox(bounds, padding, borders) {
6537
- // TODO support percentage paddings
6538
- var paddingTop = padding[TOP].value;
6539
- var paddingRight = padding[RIGHT].value;
6540
- var paddingBottom = padding[BOTTOM].value;
6541
- var paddingLeft = padding[LEFT].value;
6542
 
6543
- 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));
6544
- };
6545
 
6546
- var parseDocumentSize = exports.parseDocumentSize = function parseDocumentSize(document) {
6547
- var body = document.body;
6548
- var documentElement = document.documentElement;
6549
 
6550
- if (!body || !documentElement) {
6551
- throw new Error( true ? 'Unable to get document size' : '');
6552
- }
6553
- var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));
 
 
 
 
 
 
 
6554
 
6555
- var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));
 
 
 
6556
 
6557
- return new Bounds(0, 0, width, height);
 
6558
  };
6559
 
6560
- var parsePathForBorder = exports.parsePathForBorder = function parsePathForBorder(curves, borderSide) {
6561
- switch (borderSide) {
6562
- case TOP:
6563
- return createPathFromCurves(curves.topLeftOuter, curves.topLeftInner, curves.topRightOuter, curves.topRightInner);
6564
- case RIGHT:
6565
- return createPathFromCurves(curves.topRightOuter, curves.topRightInner, curves.bottomRightOuter, curves.bottomRightInner);
6566
- case BOTTOM:
6567
- return createPathFromCurves(curves.bottomRightOuter, curves.bottomRightInner, curves.bottomLeftOuter, curves.bottomLeftInner);
6568
- case LEFT:
6569
- default:
6570
- return createPathFromCurves(curves.bottomLeftOuter, curves.bottomLeftInner, curves.topLeftOuter, curves.topLeftInner);
6571
- }
6572
- };
6573
 
6574
- var createPathFromCurves = function createPathFromCurves(outer1, inner1, outer2, inner2) {
6575
- var path = [];
6576
- if (outer1 instanceof _BezierCurve2.default) {
6577
- path.push(outer1.subdivide(0.5, false));
6578
- } else {
6579
- path.push(outer1);
6580
- }
6581
 
6582
- if (outer2 instanceof _BezierCurve2.default) {
6583
- path.push(outer2.subdivide(0.5, true));
6584
- } else {
6585
- path.push(outer2);
6586
- }
 
 
6587
 
6588
- if (inner2 instanceof _BezierCurve2.default) {
6589
- path.push(inner2.subdivide(0.5, true).reverse());
6590
- } else {
6591
- path.push(inner2);
6592
- }
6593
 
6594
- if (inner1 instanceof _BezierCurve2.default) {
6595
- path.push(inner1.subdivide(0.5, false).reverse());
6596
- } else {
6597
- path.push(inner1);
6598
- }
6599
-
6600
- return path;
6601
- };
6602
-
6603
- var calculateBorderBoxPath = exports.calculateBorderBoxPath = function calculateBorderBoxPath(curves) {
6604
- return [curves.topLeftOuter, curves.topRightOuter, curves.bottomRightOuter, curves.bottomLeftOuter];
6605
- };
6606
-
6607
- var calculatePaddingBoxPath = exports.calculatePaddingBoxPath = function calculatePaddingBoxPath(curves) {
6608
- return [curves.topLeftInner, curves.topRightInner, curves.bottomRightInner, curves.bottomLeftInner];
6609
- };
6610
-
6611
- var parseBoundCurves = exports.parseBoundCurves = function parseBoundCurves(bounds, borders, borderRadius) {
6612
- var tlh = borderRadius[CORNER.TOP_LEFT][H].getAbsoluteValue(bounds.width);
6613
- var tlv = borderRadius[CORNER.TOP_LEFT][V].getAbsoluteValue(bounds.height);
6614
- var trh = borderRadius[CORNER.TOP_RIGHT][H].getAbsoluteValue(bounds.width);
6615
- var trv = borderRadius[CORNER.TOP_RIGHT][V].getAbsoluteValue(bounds.height);
6616
- var brh = borderRadius[CORNER.BOTTOM_RIGHT][H].getAbsoluteValue(bounds.width);
6617
- var brv = borderRadius[CORNER.BOTTOM_RIGHT][V].getAbsoluteValue(bounds.height);
6618
- var blh = borderRadius[CORNER.BOTTOM_LEFT][H].getAbsoluteValue(bounds.width);
6619
- var blv = borderRadius[CORNER.BOTTOM_LEFT][V].getAbsoluteValue(bounds.height);
6620
 
6621
- var factors = [];
6622
- factors.push((tlh + trh) / bounds.width);
6623
- factors.push((blh + brh) / bounds.width);
6624
- factors.push((tlv + blv) / bounds.height);
6625
- factors.push((trv + brv) / bounds.height);
6626
- var maxFactor = Math.max.apply(Math, factors);
 
 
 
6627
 
6628
- if (maxFactor > 1) {
6629
- tlh /= maxFactor;
6630
- tlv /= maxFactor;
6631
- trh /= maxFactor;
6632
- trv /= maxFactor;
6633
- brh /= maxFactor;
6634
- brv /= maxFactor;
6635
- blh /= maxFactor;
6636
- blv /= maxFactor;
6637
- }
6638
 
6639
- var topWidth = bounds.width - trh;
6640
- var rightHeight = bounds.height - brv;
6641
- var bottomWidth = bounds.width - brh;
6642
- var leftHeight = bounds.height - blv;
6643
 
6644
- return {
6645
- topLeftOuter: tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT) : new _Vector2.default(bounds.left, bounds.top),
6646
- 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),
6647
- 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),
6648
- 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),
6649
- 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),
6650
- 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),
6651
- 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),
6652
- 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)
6653
- };
6654
- };
6655
 
6656
- var CORNER = {
6657
- TOP_LEFT: 0,
6658
- TOP_RIGHT: 1,
6659
- BOTTOM_RIGHT: 2,
6660
- BOTTOM_LEFT: 3
 
 
 
 
 
 
 
 
6661
  };
6662
 
6663
- var getCurvePoints = function getCurvePoints(x, y, r1, r2, position) {
6664
- var kappa = 4 * ((Math.sqrt(2) - 1) / 3);
6665
- var ox = r1 * kappa; // control point offset horizontal
6666
- var oy = r2 * kappa; // control point offset vertical
6667
- var xm = x + r1; // x-middle
6668
- var ym = y + r2; // y-middle
6669
 
6670
- switch (position) {
6671
- case CORNER.TOP_LEFT:
6672
- 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));
6673
- case CORNER.TOP_RIGHT:
6674
- 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));
6675
- case CORNER.BOTTOM_RIGHT:
6676
- 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));
6677
- case CORNER.BOTTOM_LEFT:
6678
- default:
6679
- 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));
6680
- }
6681
- };
6682
 
6683
  /***/ }),
6684
- /* 3 */
6685
  /***/ (function(module, exports, __webpack_require__) {
6686
 
6687
- "use strict";
6688
 
 
6689
 
6690
- Object.defineProperty(exports, "__esModule", {
6691
- value: true
6692
- });
6693
 
6694
- var _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; }; }();
6695
 
6696
- var _Color = __webpack_require__(0);
6697
 
6698
- var _Color2 = _interopRequireDefault(_Color);
 
 
6699
 
6700
- var _Util = __webpack_require__(4);
6701
 
6702
- var _background = __webpack_require__(5);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6703
 
6704
- var _border = __webpack_require__(12);
 
 
6705
 
6706
- var _borderRadius = __webpack_require__(33);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6707
 
6708
- var _display = __webpack_require__(34);
6709
 
6710
- var _float = __webpack_require__(35);
 
6711
 
6712
- var _font = __webpack_require__(36);
 
 
 
 
 
6713
 
6714
- var _letterSpacing = __webpack_require__(37);
 
6715
 
6716
- var _lineBreak = __webpack_require__(38);
6717
 
6718
- var _listStyle = __webpack_require__(8);
6719
 
6720
- var _margin = __webpack_require__(39);
 
6721
 
6722
- var _overflow = __webpack_require__(40);
 
 
6723
 
6724
- var _overflowWrap = __webpack_require__(18);
 
6725
 
6726
- var _padding = __webpack_require__(17);
 
 
 
 
 
 
6727
 
6728
- var _position = __webpack_require__(19);
6729
 
6730
- var _textDecoration = __webpack_require__(11);
 
 
 
 
6731
 
6732
- var _textShadow = __webpack_require__(41);
6733
 
6734
- var _textTransform = __webpack_require__(20);
 
 
 
 
 
6735
 
6736
- var _transform = __webpack_require__(42);
 
 
 
6737
 
6738
- var _visibility = __webpack_require__(43);
 
6739
 
6740
- var _wordBreak = __webpack_require__(44);
6741
 
6742
- var _zIndex = __webpack_require__(45);
 
 
6743
 
6744
- var _Bounds = __webpack_require__(2);
 
6745
 
6746
- var _Input = __webpack_require__(21);
 
 
 
 
 
 
6747
 
6748
- var _ListItem = __webpack_require__(14);
 
6749
 
6750
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
6751
 
6752
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
6753
 
6754
- var INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];
6755
-
6756
- var NodeContainer = function () {
6757
- function NodeContainer(node, parent, resourceLoader, index) {
6758
- var _this = this;
6759
-
6760
- _classCallCheck(this, NodeContainer);
6761
-
6762
- this.parent = parent;
6763
- this.tagName = node.tagName;
6764
- this.index = index;
6765
- this.childNodes = [];
6766
- this.listItems = [];
6767
- if (typeof node.start === 'number') {
6768
- this.listStart = node.start;
6769
- }
6770
- var defaultView = node.ownerDocument.defaultView;
6771
- var scrollX = defaultView.pageXOffset;
6772
- var scrollY = defaultView.pageYOffset;
6773
- var style = defaultView.getComputedStyle(node, null);
6774
- var display = (0, _display.parseDisplay)(style.display);
6775
-
6776
- var IS_INPUT = node.type === 'radio' || node.type === 'checkbox';
6777
-
6778
- var position = (0, _position.parsePosition)(style.position);
6779
-
6780
- this.style = {
6781
- background: IS_INPUT ? _Input.INPUT_BACKGROUND : (0, _background.parseBackground)(style, resourceLoader),
6782
- border: IS_INPUT ? _Input.INPUT_BORDERS : (0, _border.parseBorder)(style),
6783
- borderRadius: (node instanceof defaultView.HTMLInputElement || node instanceof HTMLInputElement) && IS_INPUT ? (0, _Input.getInputBorderRadius)(node) : (0, _borderRadius.parseBorderRadius)(style),
6784
- color: IS_INPUT ? _Input.INPUT_COLOR : new _Color2.default(style.color),
6785
- display: display,
6786
- float: (0, _float.parseCSSFloat)(style.float),
6787
- font: (0, _font.parseFont)(style),
6788
- letterSpacing: (0, _letterSpacing.parseLetterSpacing)(style.letterSpacing),
6789
- listStyle: display === _display.DISPLAY.LIST_ITEM ? (0, _listStyle.parseListStyle)(style) : null,
6790
- lineBreak: (0, _lineBreak.parseLineBreak)(style.lineBreak),
6791
- margin: (0, _margin.parseMargin)(style),
6792
- opacity: parseFloat(style.opacity),
6793
- overflow: INPUT_TAGS.indexOf(node.tagName) === -1 ? (0, _overflow.parseOverflow)(style.overflow) : _overflow.OVERFLOW.HIDDEN,
6794
- overflowWrap: (0, _overflowWrap.parseOverflowWrap)(style.overflowWrap ? style.overflowWrap : style.wordWrap),
6795
- padding: (0, _padding.parsePadding)(style),
6796
- position: position,
6797
- textDecoration: (0, _textDecoration.parseTextDecoration)(style),
6798
- textShadow: (0, _textShadow.parseTextShadow)(style.textShadow),
6799
- textTransform: (0, _textTransform.parseTextTransform)(style.textTransform),
6800
- transform: (0, _transform.parseTransform)(style),
6801
- visibility: (0, _visibility.parseVisibility)(style.visibility),
6802
- wordBreak: (0, _wordBreak.parseWordBreak)(style.wordBreak),
6803
- zIndex: (0, _zIndex.parseZIndex)(position !== _position.POSITION.STATIC ? style.zIndex : 'auto')
6804
- };
6805
-
6806
- if (this.isTransformed()) {
6807
- // getBoundingClientRect provides values post-transform, we want them without the transformation
6808
- node.style.transform = 'matrix(1,0,0,1,0,0)';
6809
- }
6810
-
6811
- if (display === _display.DISPLAY.LIST_ITEM) {
6812
- var listOwner = (0, _ListItem.getListOwner)(this);
6813
- if (listOwner) {
6814
- var listIndex = listOwner.listItems.length;
6815
- listOwner.listItems.push(this);
6816
- 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;
6817
- }
6818
- }
6819
-
6820
- // TODO move bound retrieval for all nodes to a later stage?
6821
- if (node.tagName === 'IMG') {
6822
- node.addEventListener('load', function () {
6823
- _this.bounds = (0, _Bounds.parseBounds)(node, scrollX, scrollY);
6824
- _this.curvedBounds = (0, _Bounds.parseBoundCurves)(_this.bounds, _this.style.border, _this.style.borderRadius);
6825
- });
6826
- }
6827
- this.image = getImage(node, resourceLoader);
6828
- this.bounds = IS_INPUT ? (0, _Input.reformatInputBounds)((0, _Bounds.parseBounds)(node, scrollX, scrollY)) : (0, _Bounds.parseBounds)(node, scrollX, scrollY);
6829
- this.curvedBounds = (0, _Bounds.parseBoundCurves)(this.bounds, this.style.border, this.style.borderRadius);
6830
-
6831
- if (true) {
6832
- this.name = '' + node.tagName.toLowerCase() + (node.id ? '#' + node.id : '') + node.className.toString().split(' ').map(function (s) {
6833
- return s.length ? '.' + s : '';
6834
- }).join('');
6835
- }
6836
- }
6837
-
6838
- _createClass(NodeContainer, [{
6839
- key: 'getClipPaths',
6840
- value: function getClipPaths() {
6841
- var parentClips = this.parent ? this.parent.getClipPaths() : [];
6842
- var isClipped = this.style.overflow !== _overflow.OVERFLOW.VISIBLE;
6843
 
6844
- return isClipped ? parentClips.concat([(0, _Bounds.calculatePaddingBoxPath)(this.curvedBounds)]) : parentClips;
6845
- }
6846
- }, {
6847
- key: 'isInFlow',
6848
- value: function isInFlow() {
6849
- return this.isRootElement() && !this.isFloating() && !this.isAbsolutelyPositioned();
6850
- }
6851
- }, {
6852
- key: 'isVisible',
6853
- value: function isVisible() {
6854
- return !(0, _Util.contains)(this.style.display, _display.DISPLAY.NONE) && this.style.opacity > 0 && this.style.visibility === _visibility.VISIBILITY.VISIBLE;
6855
- }
6856
- }, {
6857
- key: 'isAbsolutelyPositioned',
6858
- value: function isAbsolutelyPositioned() {
6859
- return this.style.position !== _position.POSITION.STATIC && this.style.position !== _position.POSITION.RELATIVE;
6860
- }
6861
- }, {
6862
- key: 'isPositioned',
6863
- value: function isPositioned() {
6864
- return this.style.position !== _position.POSITION.STATIC;
6865
- }
6866
- }, {
6867
- key: 'isFloating',
6868
- value: function isFloating() {
6869
- return this.style.float !== _float.FLOAT.NONE;
6870
- }
6871
- }, {
6872
- key: 'isRootElement',
6873
- value: function isRootElement() {
6874
- return this.parent === null;
6875
- }
6876
- }, {
6877
- key: 'isTransformed',
6878
- value: function isTransformed() {
6879
- return this.style.transform !== null;
6880
- }
6881
- }, {
6882
- key: 'isPositionedWithZIndex',
6883
- value: function isPositionedWithZIndex() {
6884
- return this.isPositioned() && !this.style.zIndex.auto;
6885
- }
6886
- }, {
6887
- key: 'isInlineLevel',
6888
- value: function isInlineLevel() {
6889
- 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);
6890
- }
6891
- }, {
6892
- key: 'isInlineBlockOrInlineTable',
6893
- value: function isInlineBlockOrInlineTable() {
6894
- return (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_BLOCK) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_TABLE);
6895
- }
6896
- }]);
6897
 
6898
- return NodeContainer;
6899
- }();
6900
 
6901
- exports.default = NodeContainer;
 
6902
 
 
6903
 
6904
- var getImage = function getImage(node, resourceLoader) {
6905
- if (node instanceof node.ownerDocument.defaultView.SVGSVGElement || node instanceof SVGSVGElement) {
6906
- var s = new XMLSerializer();
6907
- return resourceLoader.loadImage('data:image/svg+xml,' + encodeURIComponent(s.serializeToString(node)));
6908
- }
6909
- switch (node.tagName) {
6910
- case 'IMG':
6911
- // $FlowFixMe
6912
- var img = node;
6913
- return resourceLoader.loadImage(img.currentSrc || img.src);
6914
- case 'CANVAS':
6915
- // $FlowFixMe
6916
- var canvas = node;
6917
- return resourceLoader.loadCanvas(canvas);
6918
- case 'IFRAME':
6919
- var iframeKey = node.getAttribute('data-html2canvas-internal-iframe-key');
6920
- if (iframeKey) {
6921
- return iframeKey;
6922
- }
6923
- break;
6924
- }
6925
 
6926
- return null;
 
6927
  };
6928
 
 
6929
  /***/ }),
6930
- /* 4 */
6931
  /***/ (function(module, exports, __webpack_require__) {
6932
 
6933
  "use strict";
6934
 
6935
 
6936
- Object.defineProperty(exports, "__esModule", {
6937
- value: true
6938
- });
6939
- var contains = exports.contains = function contains(bit, value) {
6940
- return (bit & value) !== 0;
6941
- };
6942
-
6943
- var distance = exports.distance = function distance(a, b) {
6944
- return Math.sqrt(a * a + b * b);
6945
- };
6946
-
6947
- var copyCSSStyles = exports.copyCSSStyles = function copyCSSStyles(style, target) {
6948
- // Edge does not provide value for cssText
6949
- for (var i = style.length - 1; i >= 0; i--) {
6950
- var property = style.item(i);
6951
- // Safari shows pseudoelements if content is set
6952
- if (property !== 'content') {
6953
- target.style.setProperty(property, style.getPropertyValue(property));
6954
- }
6955
- }
6956
- return target;
6957
- };
6958
-
6959
- var SMALL_IMAGE = exports.SMALL_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
6960
 
6961
- /***/ }),
6962
- /* 5 */
6963
- /***/ (function(module, exports, __webpack_require__) {
6964
 
6965
- "use strict";
 
 
 
 
6966
 
 
 
6967
 
6968
- Object.defineProperty(exports, "__esModule", {
6969
- value: true
6970
- });
6971
- exports.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;
 
6972
 
6973
- var _Color = __webpack_require__(0);
 
 
 
 
 
 
6974
 
6975
- var _Color2 = _interopRequireDefault(_Color);
 
 
 
6976
 
6977
- var _Length = __webpack_require__(1);
 
 
 
6978
 
6979
- var _Length2 = _interopRequireDefault(_Length);
6980
 
6981
- var _Size = __webpack_require__(31);
 
6982
 
6983
- var _Size2 = _interopRequireDefault(_Size);
6984
 
6985
- var _Vector = __webpack_require__(7);
 
 
 
 
 
6986
 
6987
- var _Vector2 = _interopRequireDefault(_Vector);
 
 
 
 
 
 
 
6988
 
6989
- var _Bounds = __webpack_require__(2);
 
6990
 
6991
- var _padding = __webpack_require__(17);
 
 
6992
 
6993
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
 
 
 
6994
 
6995
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
6996
 
6997
- var BACKGROUND_REPEAT = exports.BACKGROUND_REPEAT = {
6998
- REPEAT: 0,
6999
- NO_REPEAT: 1,
7000
- REPEAT_X: 2,
7001
- REPEAT_Y: 3
7002
- };
7003
 
7004
- var BACKGROUND_SIZE = exports.BACKGROUND_SIZE = {
7005
- AUTO: 0,
7006
- CONTAIN: 1,
7007
- COVER: 2,
7008
- LENGTH: 3
7009
- };
 
 
 
 
 
 
 
7010
 
7011
- var BACKGROUND_CLIP = exports.BACKGROUND_CLIP = {
7012
- BORDER_BOX: 0,
7013
- PADDING_BOX: 1,
7014
- CONTENT_BOX: 2
7015
- };
7016
 
7017
- var BACKGROUND_ORIGIN = exports.BACKGROUND_ORIGIN = BACKGROUND_CLIP;
 
7018
 
7019
- var AUTO = 'auto';
7020
 
7021
- var BackgroundSize = function BackgroundSize(size) {
7022
- _classCallCheck(this, BackgroundSize);
 
7023
 
7024
- switch (size) {
7025
- case 'contain':
7026
- this.size = BACKGROUND_SIZE.CONTAIN;
7027
- break;
7028
- case 'cover':
7029
- this.size = BACKGROUND_SIZE.COVER;
7030
- break;
7031
- case 'auto':
7032
- this.size = BACKGROUND_SIZE.AUTO;
7033
- break;
7034
- default:
7035
- this.value = new _Length2.default(size);
7036
- }
7037
- };
7038
 
7039
- var calculateBackgroundSize = exports.calculateBackgroundSize = function calculateBackgroundSize(backgroundImage, image, bounds) {
7040
- var width = 0;
7041
- var height = 0;
7042
- var size = backgroundImage.size;
7043
- if (size[0].size === BACKGROUND_SIZE.CONTAIN || size[0].size === BACKGROUND_SIZE.COVER) {
7044
- var targetRatio = bounds.width / bounds.height;
7045
- var currentRatio = image.width / image.height;
7046
- 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);
7047
- }
7048
 
7049
- if (size[0].value) {
7050
- width = size[0].value.getAbsoluteValue(bounds.width);
7051
- }
 
7052
 
7053
- if (size[0].size === BACKGROUND_SIZE.AUTO && size[1].size === BACKGROUND_SIZE.AUTO) {
7054
- height = image.height;
7055
- } else if (size[1].size === BACKGROUND_SIZE.AUTO) {
7056
- height = width / image.width * image.height;
7057
- } else if (size[1].value) {
7058
- height = size[1].value.getAbsoluteValue(bounds.height);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7059
  }
7060
 
7061
- if (size[0].size === BACKGROUND_SIZE.AUTO) {
7062
- width = height / image.height * image.width;
 
 
 
 
 
 
 
7063
  }
 
7064
 
7065
- return new _Size2.default(width, height);
7066
- };
7067
 
7068
- var calculateGradientBackgroundSize = exports.calculateGradientBackgroundSize = function calculateGradientBackgroundSize(backgroundImage, bounds) {
7069
- var size = backgroundImage.size;
7070
- var width = size[0].value ? size[0].value.getAbsoluteValue(bounds.width) : bounds.width;
7071
- var height = size[1].value ? size[1].value.getAbsoluteValue(bounds.height) : size[0].value ? width : bounds.height;
7072
 
7073
- return new _Size2.default(width, height);
7074
- };
7075
 
7076
- var AUTO_SIZE = new BackgroundSize(AUTO);
7077
 
7078
- var calculateBackgroungPaintingArea = exports.calculateBackgroungPaintingArea = function calculateBackgroungPaintingArea(curves, clip) {
7079
- switch (clip) {
7080
- case BACKGROUND_CLIP.BORDER_BOX:
7081
- return (0, _Bounds.calculateBorderBoxPath)(curves);
7082
- case BACKGROUND_CLIP.PADDING_BOX:
7083
- default:
7084
- return (0, _Bounds.calculatePaddingBoxPath)(curves);
7085
- }
7086
- };
7087
 
7088
- var calculateBackgroungPositioningArea = exports.calculateBackgroungPositioningArea = function calculateBackgroungPositioningArea(backgroundOrigin, bounds, padding, border) {
7089
- var paddingBox = (0, _Bounds.calculatePaddingBox)(bounds, border);
7090
 
7091
- switch (backgroundOrigin) {
7092
- case BACKGROUND_ORIGIN.BORDER_BOX:
7093
- return bounds;
7094
- case BACKGROUND_ORIGIN.CONTENT_BOX:
7095
- var paddingLeft = padding[_padding.PADDING_SIDES.LEFT].getAbsoluteValue(bounds.width);
7096
- var paddingRight = padding[_padding.PADDING_SIDES.RIGHT].getAbsoluteValue(bounds.width);
7097
- var paddingTop = padding[_padding.PADDING_SIDES.TOP].getAbsoluteValue(bounds.width);
7098
- var paddingBottom = padding[_padding.PADDING_SIDES.BOTTOM].getAbsoluteValue(bounds.width);
7099
- return new _Bounds.Bounds(paddingBox.left + paddingLeft, paddingBox.top + paddingTop, paddingBox.width - paddingLeft - paddingRight, paddingBox.height - paddingTop - paddingBottom);
7100
- case BACKGROUND_ORIGIN.PADDING_BOX:
7101
- default:
7102
- return paddingBox;
7103
- }
7104
- };
7105
 
7106
- var calculateBackgroundPosition = exports.calculateBackgroundPosition = function calculateBackgroundPosition(position, size, bounds) {
7107
- return new _Vector2.default(position[0].getAbsoluteValue(bounds.width - size.width), position[1].getAbsoluteValue(bounds.height - size.height));
7108
- };
7109
 
7110
- var calculateBackgroundRepeatPath = exports.calculateBackgroundRepeatPath = function calculateBackgroundRepeatPath(background, position, size, backgroundPositioningArea, bounds) {
7111
- var repeat = background.repeat;
7112
- switch (repeat) {
7113
- case BACKGROUND_REPEAT.REPEAT_X:
7114
- 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))];
7115
- case BACKGROUND_REPEAT.REPEAT_Y:
7116
- 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))];
7117
- case BACKGROUND_REPEAT.NO_REPEAT:
7118
- 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))];
7119
- default:
7120
- 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))];
7121
- }
7122
- };
7123
 
7124
- var parseBackground = exports.parseBackground = function parseBackground(style, resourceLoader) {
7125
- return {
7126
- backgroundColor: new _Color2.default(style.backgroundColor),
7127
- backgroundImage: parseBackgroundImages(style, resourceLoader),
7128
- backgroundClip: parseBackgroundClip(style.backgroundClip),
7129
- backgroundOrigin: parseBackgroundOrigin(style.backgroundOrigin)
7130
- };
7131
- };
7132
-
7133
- var parseBackgroundClip = function parseBackgroundClip(backgroundClip) {
7134
- switch (backgroundClip) {
7135
- case 'padding-box':
7136
- return BACKGROUND_CLIP.PADDING_BOX;
7137
- case 'content-box':
7138
- return BACKGROUND_CLIP.CONTENT_BOX;
7139
- }
7140
- return BACKGROUND_CLIP.BORDER_BOX;
7141
- };
7142
-
7143
- var parseBackgroundOrigin = function parseBackgroundOrigin(backgroundOrigin) {
7144
- switch (backgroundOrigin) {
7145
- case 'padding-box':
7146
- return BACKGROUND_ORIGIN.PADDING_BOX;
7147
- case 'content-box':
7148
- return BACKGROUND_ORIGIN.CONTENT_BOX;
7149
- }
7150
- return BACKGROUND_ORIGIN.BORDER_BOX;
7151
- };
7152
-
7153
- var parseBackgroundRepeat = function parseBackgroundRepeat(backgroundRepeat) {
7154
- switch (backgroundRepeat.trim()) {
7155
- case 'no-repeat':
7156
- return BACKGROUND_REPEAT.NO_REPEAT;
7157
- case 'repeat-x':
7158
- case 'repeat no-repeat':
7159
- return BACKGROUND_REPEAT.REPEAT_X;
7160
- case 'repeat-y':
7161
- case 'no-repeat repeat':
7162
- return BACKGROUND_REPEAT.REPEAT_Y;
7163
- case 'repeat':
7164
- return BACKGROUND_REPEAT.REPEAT;
7165
- }
7166
-
7167
- if (true) {
7168
- console.error('Invalid background-repeat value "' + backgroundRepeat + '"');
7169
- }
7170
-
7171
- return BACKGROUND_REPEAT.REPEAT;
7172
- };
7173
-
7174
- var parseBackgroundImages = function parseBackgroundImages(style, resourceLoader) {
7175
- var sources = parseBackgroundImage(style.backgroundImage).map(function (backgroundImage) {
7176
- if (backgroundImage.method === 'url') {
7177
- var key = resourceLoader.loadImage(backgroundImage.args[0]);
7178
- backgroundImage.args = key ? [key] : [];
7179
- }
7180
- return backgroundImage;
7181
- });
7182
- var positions = style.backgroundPosition.split(',');
7183
- var repeats = style.backgroundRepeat.split(',');
7184
- var sizes = style.backgroundSize.split(',');
7185
-
7186
- return sources.map(function (source, index) {
7187
- var size = (sizes[index] || AUTO).trim().split(' ').map(parseBackgroundSize);
7188
- var position = (positions[index] || AUTO).trim().split(' ').map(parseBackgoundPosition);
7189
 
7190
- return {
7191
- source: source,
7192
- repeat: parseBackgroundRepeat(typeof repeats[index] === 'string' ? repeats[index] : repeats[0]),
7193
- size: size.length < 2 ? [size[0], AUTO_SIZE] : [size[0], size[1]],
7194
- position: position.length < 2 ? [position[0], position[0]] : [position[0], position[1]]
7195
- };
7196
- });
7197
- };
7198
 
7199
- var parseBackgroundSize = function parseBackgroundSize(size) {
7200
- return size === 'auto' ? AUTO_SIZE : new BackgroundSize(size);
7201
- };
7202
 
7203
- var parseBackgoundPosition = function parseBackgoundPosition(position) {
7204
- switch (position) {
7205
- case 'bottom':
7206
- case 'right':
7207
- return new _Length2.default('100%');
7208
- case 'left':
7209
- case 'top':
7210
- return new _Length2.default('0%');
7211
- case 'auto':
7212
- return new _Length2.default('0');
7213
- }
7214
- return new _Length2.default(position);
7215
- };
7216
 
7217
- var parseBackgroundImage = exports.parseBackgroundImage = function parseBackgroundImage(image) {
7218
- var whitespace = /^\s$/;
7219
- var results = [];
7220
 
7221
- var args = [];
7222
- var method = '';
7223
- var quote = null;
7224
- var definition = '';
7225
- var mode = 0;
7226
- var numParen = 0;
7227
 
7228
- var appendResult = function appendResult() {
7229
- var prefix = '';
7230
- if (method) {
7231
- if (definition.substr(0, 1) === '"') {
7232
- definition = definition.substr(1, definition.length - 2);
7233
- }
7234
 
7235
- if (definition) {
7236
- args.push(definition.trim());
7237
- }
 
 
 
7238
 
7239
- var prefix_i = method.indexOf('-', 1) + 1;
7240
- if (method.substr(0, 1) === '-' && prefix_i > 0) {
7241
- prefix = method.substr(0, prefix_i).toLowerCase();
7242
- method = method.substr(prefix_i);
7243
- }
7244
- method = method.toLowerCase();
7245
- if (method !== 'none') {
7246
- results.push({
7247
- prefix: prefix,
7248
- method: method,
7249
- args: args
7250
- });
7251
- }
7252
- }
7253
- args = [];
7254
- method = definition = '';
7255
- };
7256
 
7257
- image.split('').forEach(function (c) {
7258
- if (mode === 0 && whitespace.test(c)) {
7259
- return;
7260
- }
7261
- switch (c) {
7262
- case '"':
7263
- if (!quote) {
7264
- quote = c;
7265
- } else if (quote === c) {
7266
- quote = null;
7267
- }
7268
- break;
7269
- case '(':
7270
- if (quote) {
7271
- break;
7272
- } else if (mode === 0) {
7273
- mode = 1;
7274
- return;
7275
- } else {
7276
- numParen++;
7277
- }
7278
- break;
7279
- case ')':
7280
- if (quote) {
7281
- break;
7282
- } else if (mode === 1) {
7283
- if (numParen === 0) {
7284
- mode = 0;
7285
- appendResult();
7286
- return;
7287
- } else {
7288
- numParen--;
7289
- }
7290
- }
7291
- break;
7292
 
7293
- case ',':
7294
- if (quote) {
7295
- break;
7296
- } else if (mode === 0) {
7297
- appendResult();
7298
- return;
7299
- } else if (mode === 1) {
7300
- if (numParen === 0 && !method.match(/^url$/i)) {
7301
- args.push(definition.trim());
7302
- definition = '';
7303
- return;
7304
- }
7305
- }
7306
- break;
7307
- }
7308
 
7309
- if (mode === 0) {
7310
- method += c;
7311
- } else {
7312
- definition += c;
7313
- }
7314
- });
 
 
 
 
 
 
 
7315
 
7316
- appendResult();
7317
- return results;
7318
- };
7319
 
7320
  /***/ }),
7321
- /* 6 */
 
7322
  /***/ (function(module, exports, __webpack_require__) {
7323
 
7324
- "use strict";
7325
-
7326
-
7327
- Object.defineProperty(exports, "__esModule", {
7328
- value: true
7329
- });
7330
- var PATH = exports.PATH = {
7331
- VECTOR: 0,
7332
- BEZIER_CURVE: 1,
7333
- CIRCLE: 2
7334
- };
7335
 
7336
- /***/ }),
7337
- /* 7 */
7338
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7339
 
7340
  "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7341
 
 
 
 
7342
 
7343
- Object.defineProperty(exports, "__esModule", {
7344
- value: true
7345
- });
7346
 
7347
- var _Path = __webpack_require__(6);
7348
 
7349
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7350
 
7351
- var Vector = function Vector(x, y) {
7352
- _classCallCheck(this, Vector);
7353
 
7354
- this.type = _Path.PATH.VECTOR;
7355
- this.x = x;
7356
- this.y = y;
7357
- if (true) {
7358
- if (isNaN(x)) {
7359
- console.error('Invalid x value given for Vector');
7360
- }
7361
- if (isNaN(y)) {
7362
- console.error('Invalid y value given for Vector');
7363
- }
7364
- }
 
 
 
 
7365
  };
7366
 
7367
- exports.default = Vector;
 
 
 
 
 
7368
 
7369
  /***/ }),
7370
- /* 8 */
7371
  /***/ (function(module, exports, __webpack_require__) {
7372
 
7373
- "use strict";
7374
 
7375
 
7376
- Object.defineProperty(exports, "__esModule", {
7377
- value: true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7378
  });
7379
- exports.parseListStyle = exports.parseListStyleType = exports.LIST_STYLE_TYPE = exports.LIST_STYLE_POSITION = undefined;
7380
 
7381
- var _background = __webpack_require__(5);
 
 
7382
 
7383
- var LIST_STYLE_POSITION = exports.LIST_STYLE_POSITION = {
7384
- INSIDE: 0,
7385
- OUTSIDE: 1
7386
- };
7387
 
7388
- var LIST_STYLE_TYPE = exports.LIST_STYLE_TYPE = {
7389
- NONE: -1,
7390
- DISC: 0,
7391
- CIRCLE: 1,
7392
- SQUARE: 2,
7393
- DECIMAL: 3,
7394
- CJK_DECIMAL: 4,
7395
- DECIMAL_LEADING_ZERO: 5,
7396
- LOWER_ROMAN: 6,
7397
- UPPER_ROMAN: 7,
7398
- LOWER_GREEK: 8,
7399
- LOWER_ALPHA: 9,
7400
- UPPER_ALPHA: 10,
7401
- ARABIC_INDIC: 11,
7402
- ARMENIAN: 12,
7403
- BENGALI: 13,
7404
- CAMBODIAN: 14,
7405
- CJK_EARTHLY_BRANCH: 15,
7406
- CJK_HEAVENLY_STEM: 16,
7407
- CJK_IDEOGRAPHIC: 17,
7408
- DEVANAGARI: 18,
7409
- ETHIOPIC_NUMERIC: 19,
7410
- GEORGIAN: 20,
7411
- GUJARATI: 21,
7412
- GURMUKHI: 22,
7413
- HEBREW: 22,
7414
- HIRAGANA: 23,
7415
- HIRAGANA_IROHA: 24,
7416
- JAPANESE_FORMAL: 25,
7417
- JAPANESE_INFORMAL: 26,
7418
- KANNADA: 27,
7419
- KATAKANA: 28,
7420
- KATAKANA_IROHA: 29,
7421
- KHMER: 30,
7422
- KOREAN_HANGUL_FORMAL: 31,
7423
- KOREAN_HANJA_FORMAL: 32,
7424
- KOREAN_HANJA_INFORMAL: 33,
7425
- LAO: 34,
7426
- LOWER_ARMENIAN: 35,
7427
- MALAYALAM: 36,
7428
- MONGOLIAN: 37,
7429
- MYANMAR: 38,
7430
- ORIYA: 39,
7431
- PERSIAN: 40,
7432
- SIMP_CHINESE_FORMAL: 41,
7433
- SIMP_CHINESE_INFORMAL: 42,
7434
- TAMIL: 43,
7435
- TELUGU: 44,
7436
- THAI: 45,
7437
- TIBETAN: 46,
7438
- TRAD_CHINESE_FORMAL: 47,
7439
- TRAD_CHINESE_INFORMAL: 48,
7440
- UPPER_ARMENIAN: 49,
7441
- DISCLOSURE_OPEN: 50,
7442
- DISCLOSURE_CLOSED: 51
7443
- };
7444
 
7445
- var parseListStyleType = exports.parseListStyleType = function parseListStyleType(type) {
7446
- switch (type) {
7447
- case 'disc':
7448
- return LIST_STYLE_TYPE.DISC;
7449
- case 'circle':
7450
- return LIST_STYLE_TYPE.CIRCLE;
7451
- case 'square':
7452
- return LIST_STYLE_TYPE.SQUARE;
7453
- case 'decimal':
7454
- return LIST_STYLE_TYPE.DECIMAL;
7455
- case 'cjk-decimal':
7456
- return LIST_STYLE_TYPE.CJK_DECIMAL;
7457
- case 'decimal-leading-zero':
7458
- return LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO;
7459
- case 'lower-roman':
7460
- return LIST_STYLE_TYPE.LOWER_ROMAN;
7461
- case 'upper-roman':
7462
- return LIST_STYLE_TYPE.UPPER_ROMAN;
7463
- case 'lower-greek':
7464
- return LIST_STYLE_TYPE.LOWER_GREEK;
7465
- case 'lower-alpha':
7466
- return LIST_STYLE_TYPE.LOWER_ALPHA;
7467
- case 'upper-alpha':
7468
- return LIST_STYLE_TYPE.UPPER_ALPHA;
7469
- case 'arabic-indic':
7470
- return LIST_STYLE_TYPE.ARABIC_INDIC;
7471
- case 'armenian':
7472
- return LIST_STYLE_TYPE.ARMENIAN;
7473
- case 'bengali':
7474
- return LIST_STYLE_TYPE.BENGALI;
7475
- case 'cambodian':
7476
- return LIST_STYLE_TYPE.CAMBODIAN;
7477
- case 'cjk-earthly-branch':
7478
- return LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH;
7479
- case 'cjk-heavenly-stem':
7480
- return LIST_STYLE_TYPE.CJK_HEAVENLY_STEM;
7481
- case 'cjk-ideographic':
7482
- return LIST_STYLE_TYPE.CJK_IDEOGRAPHIC;
7483
- case 'devanagari':
7484
- return LIST_STYLE_TYPE.DEVANAGARI;
7485
- case 'ethiopic-numeric':
7486
- return LIST_STYLE_TYPE.ETHIOPIC_NUMERIC;
7487
- case 'georgian':
7488
- return LIST_STYLE_TYPE.GEORGIAN;
7489
- case 'gujarati':
7490
- return LIST_STYLE_TYPE.GUJARATI;
7491
- case 'gurmukhi':
7492
- return LIST_STYLE_TYPE.GURMUKHI;
7493
- case 'hebrew':
7494
- return LIST_STYLE_TYPE.HEBREW;
7495
- case 'hiragana':
7496
- return LIST_STYLE_TYPE.HIRAGANA;
7497
- case 'hiragana-iroha':
7498
- return LIST_STYLE_TYPE.HIRAGANA_IROHA;
7499
- case 'japanese-formal':
7500
- return LIST_STYLE_TYPE.JAPANESE_FORMAL;
7501
- case 'japanese-informal':
7502
- return LIST_STYLE_TYPE.JAPANESE_INFORMAL;
7503
- case 'kannada':
7504
- return LIST_STYLE_TYPE.KANNADA;
7505
- case 'katakana':
7506
- return LIST_STYLE_TYPE.KATAKANA;
7507
- case 'katakana-iroha':
7508
- return LIST_STYLE_TYPE.KATAKANA_IROHA;
7509
- case 'khmer':
7510
- return LIST_STYLE_TYPE.KHMER;
7511
- case 'korean-hangul-formal':
7512
- return LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL;
7513
- case 'korean-hanja-formal':
7514
- return LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL;
7515
- case 'korean-hanja-informal':
7516
- return LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL;
7517
- case 'lao':
7518
- return LIST_STYLE_TYPE.LAO;
7519
- case 'lower-armenian':
7520
- return LIST_STYLE_TYPE.LOWER_ARMENIAN;
7521
- case 'malayalam':
7522
- return LIST_STYLE_TYPE.MALAYALAM;
7523
- case 'mongolian':
7524
- return LIST_STYLE_TYPE.MONGOLIAN;
7525
- case 'myanmar':
7526
- return LIST_STYLE_TYPE.MYANMAR;
7527
- case 'oriya':
7528
- return LIST_STYLE_TYPE.ORIYA;
7529
- case 'persian':
7530
- return LIST_STYLE_TYPE.PERSIAN;
7531
- case 'simp-chinese-formal':
7532
- return LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL;
7533
- case 'simp-chinese-informal':
7534
- return LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL;
7535
- case 'tamil':
7536
- return LIST_STYLE_TYPE.TAMIL;
7537
- case 'telugu':
7538
- return LIST_STYLE_TYPE.TELUGU;
7539
- case 'thai':
7540
- return LIST_STYLE_TYPE.THAI;
7541
- case 'tibetan':
7542
- return LIST_STYLE_TYPE.TIBETAN;
7543
- case 'trad-chinese-formal':
7544
- return LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL;
7545
- case 'trad-chinese-informal':
7546
- return LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL;
7547
- case 'upper-armenian':
7548
- return LIST_STYLE_TYPE.UPPER_ARMENIAN;
7549
- case 'disclosure-open':
7550
- return LIST_STYLE_TYPE.DISCLOSURE_OPEN;
7551
- case 'disclosure-closed':
7552
- return LIST_STYLE_TYPE.DISCLOSURE_CLOSED;
7553
- case 'none':
7554
- default:
7555
- return LIST_STYLE_TYPE.NONE;
7556
- }
7557
- };
7558
-
7559
- var parseListStyle = exports.parseListStyle = function parseListStyle(style) {
7560
- var listStyleImage = (0, _background.parseBackgroundImage)(style.getPropertyValue('list-style-image'));
7561
- return {
7562
- listStyleType: parseListStyleType(style.getPropertyValue('list-style-type')),
7563
- listStyleImage: listStyleImage.length ? listStyleImage[0] : null,
7564
- listStylePosition: parseListStylePosition(style.getPropertyValue('list-style-position'))
7565
- };
7566
- };
7567
-
7568
- var parseListStylePosition = function parseListStylePosition(position) {
7569
- switch (position) {
7570
- case 'inside':
7571
- return LIST_STYLE_POSITION.INSIDE;
7572
- case 'outside':
7573
- default:
7574
- return LIST_STYLE_POSITION.OUTSIDE;
7575
- }
7576
- };
7577
 
7578
  /***/ }),
7579
- /* 9 */
7580
  /***/ (function(module, exports, __webpack_require__) {
7581
 
7582
- "use strict";
7583
-
7584
-
7585
- Object.defineProperty(exports, "__esModule", {
7586
- value: true
7587
- });
7588
-
7589
- var _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; }; }();
7590
 
7591
- var _textTransform = __webpack_require__(20);
 
 
 
 
7592
 
7593
- var _TextBounds = __webpack_require__(22);
 
 
 
 
7594
 
7595
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
7596
 
7597
- var TextContainer = function () {
7598
- function TextContainer(text, parent, bounds) {
7599
- _classCallCheck(this, TextContainer);
7600
 
7601
- this.text = text;
7602
- this.parent = parent;
7603
- this.bounds = bounds;
7604
- }
7605
 
7606
- _createClass(TextContainer, null, [{
7607
- key: 'fromTextNode',
7608
- value: function fromTextNode(node, parent) {
7609
- var text = transform(node.data, parent.style.textTransform);
7610
- return new TextContainer(text, parent, (0, _TextBounds.parseTextBounds)(text, parent, node));
7611
- }
7612
- }]);
7613
 
7614
- return TextContainer;
7615
- }();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7616
 
7617
- exports.default = TextContainer;
 
 
 
 
 
 
 
 
 
 
7618
 
 
 
 
 
 
7619
 
7620
- var CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g;
 
7621
 
7622
- var transform = function transform(text, _transform) {
7623
- switch (_transform) {
7624
- case _textTransform.TEXT_TRANSFORM.LOWERCASE:
7625
- return text.toLowerCase();
7626
- case _textTransform.TEXT_TRANSFORM.CAPITALIZE:
7627
- return text.replace(CAPITALIZE, capitalize);
7628
- case _textTransform.TEXT_TRANSFORM.UPPERCASE:
7629
- return text.toUpperCase();
7630
- default:
7631
- return text;
7632
  }
7633
- };
7634
 
7635
- function capitalize(m, p1, p2) {
7636
- if (m.length > 0) {
7637
- return p1 + p2.toUpperCase();
 
7638
  }
 
7639
 
7640
- return m;
7641
  }
7642
 
7643
- /***/ }),
7644
- /* 10 */
7645
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7646
 
7647
- "use strict";
7648
 
 
 
 
7649
 
7650
- Object.defineProperty(exports, "__esModule", {
7651
- value: true
7652
- });
7653
 
7654
- var _ForeignObjectRenderer = __webpack_require__(23);
 
7655
 
7656
- var testRangeBounds = function testRangeBounds(document) {
7657
- var TEST_HEIGHT = 123;
 
 
 
 
 
 
 
 
 
 
 
7658
 
7659
- if (document.createRange) {
7660
- var range = document.createRange();
7661
- if (range.getBoundingClientRect) {
7662
- var testElement = document.createElement('boundtest');
7663
- testElement.style.height = TEST_HEIGHT + 'px';
7664
- testElement.style.display = 'block';
7665
- document.body.appendChild(testElement);
7666
 
7667
- range.selectNode(testElement);
7668
- var rangeBounds = range.getBoundingClientRect();
7669
- var rangeHeight = Math.round(rangeBounds.height);
7670
- document.body.removeChild(testElement);
7671
- if (rangeHeight === TEST_HEIGHT) {
7672
- return true;
7673
- }
7674
- }
 
 
 
 
 
 
 
 
 
 
 
 
7675
  }
7676
 
7677
- return false;
7678
- };
 
 
7679
 
7680
- // iOS 10.3 taints canvas with base64 images unless crossOrigin = 'anonymous'
7681
- var testBase64 = function testBase64(document, src) {
7682
- var img = new Image();
7683
- var canvas = document.createElement('canvas');
7684
- var ctx = canvas.getContext('2d');
7685
 
7686
- return new Promise(function (resolve) {
7687
- // Single pixel base64 image renders fine on iOS 10.3???
7688
- img.src = src;
7689
 
7690
- var onload = function onload() {
7691
- try {
7692
- ctx.drawImage(img, 0, 0);
7693
- canvas.toDataURL();
7694
- } catch (e) {
7695
- return resolve(false);
7696
- }
7697
 
7698
- return resolve(true);
7699
- };
 
 
7700
 
7701
- img.onload = onload;
7702
- img.onerror = function () {
7703
- return resolve(false);
7704
- };
7705
 
7706
- if (img.complete === true) {
7707
- setTimeout(function () {
7708
- onload();
7709
- }, 500);
7710
- }
7711
- });
7712
- };
7713
 
7714
- var testCORS = function testCORS() {
7715
- return typeof new Image().crossOrigin !== 'undefined';
7716
- };
7717
 
7718
- var testResponseType = function testResponseType() {
7719
- return typeof new XMLHttpRequest().responseType === 'string';
7720
- };
7721
 
7722
- var testSVG = function testSVG(document) {
7723
- var img = new Image();
7724
- var canvas = document.createElement('canvas');
7725
- var ctx = canvas.getContext('2d');
7726
- img.src = 'data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\'></svg>';
7727
 
7728
- try {
7729
- ctx.drawImage(img, 0, 0);
7730
- canvas.toDataURL();
7731
- } catch (e) {
7732
- return false;
7733
- }
7734
- return true;
7735
- };
 
7736
 
7737
- var isGreenPixel = function isGreenPixel(data) {
7738
- return data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255;
 
7739
  };
7740
 
7741
- var testForeignObject = function testForeignObject(document) {
7742
- var canvas = document.createElement('canvas');
7743
- var size = 100;
7744
- canvas.width = size;
7745
- canvas.height = size;
7746
- var ctx = canvas.getContext('2d');
7747
- ctx.fillStyle = 'rgb(0, 255, 0)';
7748
- ctx.fillRect(0, 0, size, size);
7749
 
7750
- var img = new Image();
7751
- var greenImageSrc = canvas.toDataURL();
7752
- img.src = greenImageSrc;
7753
- var svg = (0, _ForeignObjectRenderer.createForeignObjectSVG)(size, size, 0, 0, img);
7754
- ctx.fillStyle = 'red';
7755
- ctx.fillRect(0, 0, size, size);
7756
 
7757
- return (0, _ForeignObjectRenderer.loadSerializedSVG)(svg).then(function (img) {
7758
- ctx.drawImage(img, 0, 0);
7759
- var data = ctx.getImageData(0, 0, size, size).data;
7760
- ctx.fillStyle = 'red';
7761
- ctx.fillRect(0, 0, size, size);
7762
 
7763
- var node = document.createElement('div');
7764
- node.style.backgroundImage = 'url(' + greenImageSrc + ')';
7765
- node.style.height = size + 'px';
7766
- // Firefox 55 does not render inline <img /> tags
7767
- return isGreenPixel(data) ? (0, _ForeignObjectRenderer.loadSerializedSVG)((0, _ForeignObjectRenderer.createForeignObjectSVG)(size, size, 0, 0, node)) : Promise.reject(false);
7768
- }).then(function (img) {
7769
- ctx.drawImage(img, 0, 0);
7770
- // Edge does not render background-images
7771
- return isGreenPixel(ctx.getImageData(0, 0, size, size).data);
7772
- }).catch(function (e) {
7773
- return false;
7774
- });
7775
  };
7776
 
7777
- var FEATURES = {
7778
- // $FlowFixMe - get/set properties not yet supported
7779
- get SUPPORT_RANGE_BOUNDS() {
7780
- 'use strict';
7781
 
7782
- var value = testRangeBounds(document);
7783
- Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });
7784
- return value;
7785
- },
7786
- // $FlowFixMe - get/set properties not yet supported
7787
- get SUPPORT_SVG_DRAWING() {
7788
- 'use strict';
7789
 
7790
- var value = testSVG(document);
7791
- Object.defineProperty(FEATURES, 'SUPPORT_SVG_DRAWING', { value: value });
7792
- return value;
7793
- },
7794
- // $FlowFixMe - get/set properties not yet supported
7795
- get SUPPORT_BASE64_DRAWING() {
7796
- 'use strict';
7797
 
7798
- return function (src) {
7799
- var _value = testBase64(document, src);
7800
- Object.defineProperty(FEATURES, 'SUPPORT_BASE64_DRAWING', { value: function value() {
7801
- return _value;
7802
- } });
7803
- return _value;
7804
- };
7805
- },
7806
- // $FlowFixMe - get/set properties not yet supported
7807
- get SUPPORT_FOREIGNOBJECT_DRAWING() {
7808
- 'use strict';
7809
 
7810
- var value = typeof Array.from === 'function' && typeof window.fetch === 'function' ? testForeignObject(document) : Promise.resolve(false);
7811
- Object.defineProperty(FEATURES, 'SUPPORT_FOREIGNOBJECT_DRAWING', { value: value });
7812
- return value;
7813
- },
7814
- // $FlowFixMe - get/set properties not yet supported
7815
- get SUPPORT_CORS_IMAGES() {
7816
- 'use strict';
7817
-
7818
- var value = testCORS();
7819
- Object.defineProperty(FEATURES, 'SUPPORT_CORS_IMAGES', { value: value });
7820
- return value;
7821
- },
7822
- // $FlowFixMe - get/set properties not yet supported
7823
- get SUPPORT_RESPONSE_TYPE() {
7824
- 'use strict';
7825
 
7826
- var value = testResponseType();
7827
- Object.defineProperty(FEATURES, 'SUPPORT_RESPONSE_TYPE', { value: value });
7828
- return value;
7829
- },
7830
- // $FlowFixMe - get/set properties not yet supported
7831
- get SUPPORT_CORS_XHR() {
7832
- 'use strict';
7833
 
7834
- var value = 'withCredentials' in new XMLHttpRequest();
7835
- Object.defineProperty(FEATURES, 'SUPPORT_CORS_XHR', { value: value });
7836
- return value;
7837
- }
7838
- };
7839
 
7840
- exports.default = FEATURES;
7841
 
7842
  /***/ }),
7843
- /* 11 */
7844
  /***/ (function(module, exports, __webpack_require__) {
7845
 
7846
- "use strict";
 
7847
 
 
7848
 
7849
- Object.defineProperty(exports, "__esModule", {
7850
- value: true
7851
- });
7852
- exports.parseTextDecoration = exports.TEXT_DECORATION_LINE = exports.TEXT_DECORATION = exports.TEXT_DECORATION_STYLE = undefined;
7853
 
7854
- var _Color = __webpack_require__(0);
7855
 
7856
- var _Color2 = _interopRequireDefault(_Color);
 
 
 
 
 
7857
 
7858
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
7859
 
7860
- var TEXT_DECORATION_STYLE = exports.TEXT_DECORATION_STYLE = {
7861
- SOLID: 0,
7862
- DOUBLE: 1,
7863
- DOTTED: 2,
7864
- DASHED: 3,
7865
- WAVY: 4
7866
- };
7867
 
7868
- var TEXT_DECORATION = exports.TEXT_DECORATION = {
7869
- NONE: null
7870
- };
7871
 
7872
- var TEXT_DECORATION_LINE = exports.TEXT_DECORATION_LINE = {
7873
- UNDERLINE: 1,
7874
- OVERLINE: 2,
7875
- LINE_THROUGH: 3,
7876
- BLINK: 4
7877
- };
7878
 
7879
- var parseLine = function parseLine(line) {
7880
- switch (line) {
7881
- case 'underline':
7882
- return TEXT_DECORATION_LINE.UNDERLINE;
7883
- case 'overline':
7884
- return TEXT_DECORATION_LINE.OVERLINE;
7885
- case 'line-through':
7886
- return TEXT_DECORATION_LINE.LINE_THROUGH;
7887
- }
7888
- return TEXT_DECORATION_LINE.BLINK;
7889
- };
7890
 
7891
- var parseTextDecorationLine = function parseTextDecorationLine(line) {
7892
- if (line === 'none') {
7893
- return null;
7894
- }
7895
 
7896
- return line.split(' ').map(parseLine);
7897
- };
 
 
 
 
 
7898
 
7899
- var parseTextDecorationStyle = function parseTextDecorationStyle(style) {
7900
- switch (style) {
7901
- case 'double':
7902
- return TEXT_DECORATION_STYLE.DOUBLE;
7903
- case 'dotted':
7904
- return TEXT_DECORATION_STYLE.DOTTED;
7905
- case 'dashed':
7906
- return TEXT_DECORATION_STYLE.DASHED;
7907
- case 'wavy':
7908
- return TEXT_DECORATION_STYLE.WAVY;
7909
- }
7910
- return TEXT_DECORATION_STYLE.SOLID;
7911
- };
7912
 
7913
- var parseTextDecoration = exports.parseTextDecoration = function parseTextDecoration(style) {
7914
- var textDecorationLine = parseTextDecorationLine(style.textDecorationLine ? style.textDecorationLine : style.textDecoration);
7915
- if (textDecorationLine === null) {
7916
- return TEXT_DECORATION.NONE;
7917
- }
 
 
7918
 
7919
- var textDecorationColor = style.textDecorationColor ? new _Color2.default(style.textDecorationColor) : null;
7920
- var textDecorationStyle = parseTextDecorationStyle(style.textDecorationStyle);
 
 
 
 
 
 
 
 
7921
 
7922
- return {
7923
- textDecorationLine: textDecorationLine,
7924
- textDecorationColor: textDecorationColor,
7925
- textDecorationStyle: textDecorationStyle
7926
- };
7927
- };
7928
 
7929
  /***/ }),
7930
- /* 12 */
7931
  /***/ (function(module, exports, __webpack_require__) {
7932
 
7933
- "use strict";
 
 
 
7934
 
 
 
7935
 
7936
- Object.defineProperty(exports, "__esModule", {
7937
- value: true
7938
- });
7939
- exports.parseBorder = exports.BORDER_SIDES = exports.BORDER_STYLE = undefined;
7940
 
7941
- var _Color = __webpack_require__(0);
7942
 
7943
- var _Color2 = _interopRequireDefault(_Color);
7944
 
7945
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
7946
 
7947
- var BORDER_STYLE = exports.BORDER_STYLE = {
7948
- NONE: 0,
7949
- SOLID: 1
7950
- };
7951
 
7952
- var BORDER_SIDES = exports.BORDER_SIDES = {
7953
- TOP: 0,
7954
- RIGHT: 1,
7955
- BOTTOM: 2,
7956
- LEFT: 3
7957
- };
7958
 
7959
- var SIDES = Object.keys(BORDER_SIDES).map(function (s) {
7960
- return s.toLowerCase();
7961
- });
 
 
 
 
 
7962
 
7963
- var parseBorderStyle = function parseBorderStyle(style) {
7964
- switch (style) {
7965
- case 'none':
7966
- return BORDER_STYLE.NONE;
7967
- }
7968
- return BORDER_STYLE.SOLID;
7969
- };
7970
 
7971
- var parseBorder = exports.parseBorder = function parseBorder(style) {
7972
- return SIDES.map(function (side) {
7973
- var borderColor = new _Color2.default(style.getPropertyValue('border-' + side + '-color'));
7974
- var borderStyle = parseBorderStyle(style.getPropertyValue('border-' + side + '-style'));
7975
- var borderWidth = parseFloat(style.getPropertyValue('border-' + side + '-width'));
7976
- return {
7977
- borderColor: borderColor,
7978
- borderStyle: borderStyle,
7979
- borderWidth: isNaN(borderWidth) ? 0 : borderWidth
7980
- };
7981
- });
7982
- };
7983
 
7984
- /***/ }),
7985
- /* 13 */
7986
- /***/ (function(module, exports, __webpack_require__) {
 
 
7987
 
7988
- "use strict";
 
 
7989
 
 
 
 
 
 
 
 
 
 
 
 
7990
 
7991
- Object.defineProperty(exports, "__esModule", {
7992
- value: true
7993
- });
7994
- var toCodePoints = exports.toCodePoints = function toCodePoints(str) {
7995
- var codePoints = [];
7996
- var i = 0;
7997
- var length = str.length;
7998
- while (i < length) {
7999
- var value = str.charCodeAt(i++);
8000
- if (value >= 0xd800 && value <= 0xdbff && i < length) {
8001
- var extra = str.charCodeAt(i++);
8002
- if ((extra & 0xfc00) === 0xdc00) {
8003
- codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);
8004
- } else {
8005
- codePoints.push(value);
8006
- i--;
8007
- }
8008
- } else {
8009
- codePoints.push(value);
8010
- }
8011
- }
8012
- return codePoints;
8013
  };
8014
 
8015
- var fromCodePoint = exports.fromCodePoint = function fromCodePoint() {
8016
- if (String.fromCodePoint) {
8017
- return String.fromCodePoint.apply(String, arguments);
8018
- }
8019
-
8020
- var length = arguments.length;
8021
- if (!length) {
8022
- return '';
8023
- }
8024
 
8025
- var codeUnits = [];
 
 
8026
 
8027
- var index = -1;
8028
- var result = '';
8029
- while (++index < length) {
8030
- var codePoint = arguments.length <= index ? undefined : arguments[index];
8031
- if (codePoint <= 0xffff) {
8032
- codeUnits.push(codePoint);
8033
- } else {
8034
- codePoint -= 0x10000;
8035
- codeUnits.push((codePoint >> 10) + 0xd800, codePoint % 0x400 + 0xdc00);
8036
- }
8037
- if (index + 1 === length || codeUnits.length > 0x4000) {
8038
- result += String.fromCharCode.apply(String, codeUnits);
8039
- codeUnits.length = 0;
8040
- }
8041
- }
8042
- return result;
8043
  };
8044
 
8045
- var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
 
 
 
8046
 
8047
- // Use a lookup table to find the index.
8048
- var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
8049
- for (var i = 0; i < chars.length; i++) {
8050
- lookup[chars.charCodeAt(i)] = i;
8051
- }
8052
 
8053
- var decode = exports.decode = function decode(base64) {
8054
- var bufferLength = base64.length * 0.75,
8055
- len = base64.length,
8056
- i = void 0,
8057
- p = 0,
8058
- encoded1 = void 0,
8059
- encoded2 = void 0,
8060
- encoded3 = void 0,
8061
- encoded4 = void 0;
8062
 
8063
- if (base64[base64.length - 1] === '=') {
8064
- bufferLength--;
8065
- if (base64[base64.length - 2] === '=') {
8066
- bufferLength--;
8067
- }
8068
- }
8069
 
8070
- var buffer = typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint8Array.prototype.slice !== 'undefined' ? new ArrayBuffer(bufferLength) : new Array(bufferLength);
8071
- var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
8072
 
8073
- for (i = 0; i < len; i += 4) {
8074
- encoded1 = lookup[base64.charCodeAt(i)];
8075
- encoded2 = lookup[base64.charCodeAt(i + 1)];
8076
- encoded3 = lookup[base64.charCodeAt(i + 2)];
8077
- encoded4 = lookup[base64.charCodeAt(i + 3)];
8078
 
8079
- bytes[p++] = encoded1 << 2 | encoded2 >> 4;
8080
- bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
8081
- bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
8082
- }
8083
 
8084
- return buffer;
 
 
 
8085
  };
8086
 
8087
- var polyUint16Array = exports.polyUint16Array = function polyUint16Array(buffer) {
8088
- var length = buffer.length;
8089
- var bytes = [];
8090
- for (var _i = 0; _i < length; _i += 2) {
8091
- bytes.push(buffer[_i + 1] << 8 | buffer[_i]);
8092
- }
8093
- return bytes;
8094
- };
8095
 
8096
- var polyUint32Array = exports.polyUint32Array = function polyUint32Array(buffer) {
8097
- var length = buffer.length;
8098
- var bytes = [];
8099
- for (var _i2 = 0; _i2 < length; _i2 += 4) {
8100
- bytes.push(buffer[_i2 + 3] << 24 | buffer[_i2 + 2] << 16 | buffer[_i2 + 1] << 8 | buffer[_i2]);
8101
- }
8102
- return bytes;
 
 
 
8103
  };
8104
 
8105
- /***/ }),
8106
- /* 14 */
8107
- /***/ (function(module, exports, __webpack_require__) {
8108
 
8109
- "use strict";
 
 
 
 
 
 
8110
 
 
 
 
8111
 
8112
- Object.defineProperty(exports, "__esModule", {
8113
- value: true
8114
- });
8115
- exports.createCounterText = exports.inlineListItemElement = exports.getListOwner = undefined;
8116
 
8117
- var _Util = __webpack_require__(4);
 
 
 
 
 
 
 
 
 
8118
 
8119
- var _NodeContainer = __webpack_require__(3);
 
 
 
 
 
8120
 
8121
- var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
 
 
 
 
 
 
 
 
8122
 
8123
- var _TextContainer = __webpack_require__(9);
8124
 
8125
- var _TextContainer2 = _interopRequireDefault(_TextContainer);
8126
 
8127
- var _listStyle = __webpack_require__(8);
8128
 
8129
- var _Unicode = __webpack_require__(24);
 
 
8130
 
8131
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8132
 
8133
- // Margin between the enumeration and the list item content
8134
- var MARGIN_RIGHT = 7;
 
 
 
 
 
 
8135
 
8136
- var ancestorTypes = ['OL', 'UL', 'MENU'];
 
8137
 
8138
- var getListOwner = exports.getListOwner = function getListOwner(container) {
8139
- var parent = container.parent;
8140
- if (!parent) {
8141
- return null;
8142
- }
8143
 
8144
- do {
8145
- var isAncestor = ancestorTypes.indexOf(parent.tagName) !== -1;
8146
- if (isAncestor) {
8147
- return parent;
8148
- }
8149
- parent = parent.parent;
8150
- } while (parent);
8151
 
8152
- return container.parent;
8153
- };
 
 
 
8154
 
8155
- var inlineListItemElement = exports.inlineListItemElement = function inlineListItemElement(node, container, resourceLoader) {
8156
- var listStyle = container.style.listStyle;
 
 
 
 
 
 
8157
 
8158
- if (!listStyle) {
8159
- return;
8160
- }
8161
 
8162
- var style = node.ownerDocument.defaultView.getComputedStyle(node, null);
8163
- var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
8164
- (0, _Util.copyCSSStyles)(style, wrapper);
 
8165
 
8166
- wrapper.style.position = 'absolute';
8167
- wrapper.style.bottom = 'auto';
8168
- wrapper.style.display = 'block';
8169
- wrapper.style.letterSpacing = 'normal';
8170
 
8171
- switch (listStyle.listStylePosition) {
8172
- case _listStyle.LIST_STYLE_POSITION.OUTSIDE:
8173
- wrapper.style.left = 'auto';
8174
- wrapper.style.right = node.ownerDocument.defaultView.innerWidth - container.bounds.left - container.style.margin[1].getAbsoluteValue(container.bounds.width) + MARGIN_RIGHT + 'px';
8175
- wrapper.style.textAlign = 'right';
8176
- break;
8177
- case _listStyle.LIST_STYLE_POSITION.INSIDE:
8178
- wrapper.style.left = container.bounds.left - container.style.margin[3].getAbsoluteValue(container.bounds.width) + 'px';
8179
- wrapper.style.right = 'auto';
8180
- wrapper.style.textAlign = 'left';
8181
- break;
8182
- }
8183
 
8184
- var text = void 0;
8185
- var MARGIN_TOP = container.style.margin[0].getAbsoluteValue(container.bounds.width);
8186
- var styleImage = listStyle.listStyleImage;
8187
- if (styleImage) {
8188
- if (styleImage.method === 'url') {
8189
- var image = node.ownerDocument.createElement('img');
8190
- image.src = styleImage.args[0];
8191
- wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px';
8192
- wrapper.style.width = 'auto';
8193
- wrapper.style.height = 'auto';
8194
- wrapper.appendChild(image);
8195
- } else {
8196
- var size = parseFloat(container.style.font.fontSize) * 0.5;
8197
- wrapper.style.top = container.bounds.top - MARGIN_TOP + container.bounds.height - 1.5 * size + 'px';
8198
- wrapper.style.width = size + 'px';
8199
- wrapper.style.height = size + 'px';
8200
- wrapper.style.backgroundImage = style.listStyleImage;
8201
- }
8202
- } else if (typeof container.listIndex === 'number') {
8203
- text = node.ownerDocument.createTextNode(createCounterText(container.listIndex, listStyle.listStyleType, true));
8204
- wrapper.appendChild(text);
8205
- wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px';
8206
- }
8207
 
8208
- // $FlowFixMe
8209
- var body = node.ownerDocument.body;
8210
- body.appendChild(wrapper);
8211
 
8212
- if (text) {
8213
- container.childNodes.push(_TextContainer2.default.fromTextNode(text, container));
8214
- body.removeChild(wrapper);
8215
- } else {
8216
- // $FlowFixMe
8217
- container.childNodes.push(new _NodeContainer2.default(wrapper, container, resourceLoader, 0));
8218
- }
8219
- };
 
 
 
 
 
8220
 
8221
- var ROMAN_UPPER = {
8222
- integers: [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],
8223
- values: ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
8224
- };
8225
 
8226
- var ARMENIAN = {
8227
- 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],
8228
- values: ['Ք', 'Փ', 'Ւ', 'Ց', 'Ր', 'Տ', 'Վ', 'Ս', 'Ռ', 'Ջ', 'Պ', 'Չ', 'Ո', 'Շ', 'Ն', 'Յ', 'Մ', 'Ճ', 'Ղ', 'Ձ', 'Հ', 'Կ', 'Ծ', 'Խ', 'Լ', 'Ի', 'Ժ', 'Թ', 'Ը', 'Է', 'Զ', 'Ե', 'Դ', 'Գ', 'Բ', 'Ա']
8229
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
8230
 
8231
- var HEBREW = {
8232
- 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],
8233
- values: ['י׳', 'ט׳', 'ח׳', 'ז׳', 'ו׳', 'ה׳', 'ד׳', 'ג׳', 'ב׳', 'א׳', 'ת', 'ש', 'ר', 'ק', 'צ', 'פ', 'ע', 'ס', 'נ', 'מ', 'ל', 'כ', 'יט', 'יח', 'יז', 'טז', 'טו', 'י', 'ט', 'ח', 'ז', 'ו', 'ה', 'ד', 'ג', 'ב', 'א']
8234
- };
8235
 
8236
- var GEORGIAN = {
8237
- 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],
8238
- values: ['ჵ', 'ჰ', 'ჯ', 'ჴ', 'ხ', 'ჭ', 'წ', 'ძ', 'ც', 'ჩ', 'შ', 'ყ', 'ღ', 'ქ', 'ფ', 'ჳ', 'ტ', 'ს', 'რ', 'ჟ', 'პ', 'ო', 'ჲ', 'ნ', 'მ', 'ლ', 'კ', 'ი', 'თ', 'ჱ', 'ზ', 'ვ', 'ე', 'დ', 'გ', 'ბ', 'ა']
8239
- };
8240
 
8241
- var createAdditiveCounter = function createAdditiveCounter(value, min, max, symbols, fallback, suffix) {
8242
- if (value < min || value > max) {
8243
- return createCounterText(value, fallback, suffix.length > 0);
8244
- }
8245
 
8246
- return symbols.integers.reduce(function (string, integer, index) {
8247
- while (value >= integer) {
8248
- value -= integer;
8249
- string += symbols.values[index];
8250
- }
8251
- return string;
8252
- }, '') + suffix;
 
 
 
 
 
 
 
 
 
 
 
8253
  };
8254
 
8255
- var createCounterStyleWithSymbolResolver = function createCounterStyleWithSymbolResolver(value, codePointRangeLength, isNumeric, resolver) {
8256
- var string = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8257
 
8258
- do {
8259
- if (!isNumeric) {
8260
- value--;
8261
- }
8262
- string = resolver(value) + string;
8263
- value /= codePointRangeLength;
8264
- } while (value * codePointRangeLength >= codePointRangeLength);
8265
 
8266
- return string;
8267
- };
 
 
 
8268
 
8269
- var createCounterStyleFromRange = function createCounterStyleFromRange(value, codePointRangeStart, codePointRangeEnd, isNumeric, suffix) {
8270
- var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;
 
 
 
8271
 
8272
- return (value < 0 ? '-' : '') + (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, function (codePoint) {
8273
- return (0, _Unicode.fromCodePoint)(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart);
8274
- }) + suffix);
 
8275
  };
8276
 
8277
- var createCounterStyleFromSymbols = function createCounterStyleFromSymbols(value, symbols) {
8278
- var suffix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '. ';
 
 
8279
 
8280
- var codePointRangeLength = symbols.length;
8281
- return createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function (codePoint) {
8282
- return symbols[Math.floor(codePoint % codePointRangeLength)];
8283
- }) + suffix;
8284
  };
8285
 
8286
- var CJK_ZEROS = 1 << 0;
8287
- var CJK_TEN_COEFFICIENTS = 1 << 1;
8288
- var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;
8289
- var CJK_HUNDRED_COEFFICIENTS = 1 << 3;
8290
 
8291
- var createCJKCounter = function createCJKCounter(value, numbers, multipliers, negativeSign, suffix, flags) {
8292
- if (value < -9999 || value > 9999) {
8293
- return createCounterText(value, _listStyle.LIST_STYLE_TYPE.CJK_DECIMAL, suffix.length > 0);
8294
- }
8295
- var tmp = Math.abs(value);
8296
- var string = suffix;
8297
 
8298
- if (tmp === 0) {
8299
- return numbers[0] + string;
8300
- }
8301
 
8302
- for (var digit = 0; tmp > 0 && digit <= 4; digit++) {
8303
- var coefficient = tmp % 10;
 
 
8304
 
8305
- if (coefficient === 0 && (0, _Util.contains)(flags, CJK_ZEROS) && string !== '') {
8306
- string = numbers[coefficient] + string;
8307
- } 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)) {
8308
- string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : '') + string;
8309
- } else if (coefficient === 1 && digit > 0) {
8310
- string = multipliers[digit - 1] + string;
8311
- }
8312
- tmp = Math.floor(tmp / 10);
8313
- }
8314
 
8315
- return (value < 0 ? negativeSign : '') + string;
8316
- };
 
8317
 
8318
- var CHINESE_INFORMAL_MULTIPLIERS = '十百千萬';
8319
- var CHINESE_FORMAL_MULTIPLIERS = '拾佰仟萬';
8320
- var JAPANESE_NEGATIVE = 'マイナス';
8321
- var KOREAN_NEGATIVE = '마이너스 ';
 
 
 
 
8322
 
8323
- var createCounterText = exports.createCounterText = function createCounterText(value, type, appendSuffix) {
8324
- var defaultSuffix = appendSuffix ? '. ' : '';
8325
- var cjkSuffix = appendSuffix ? '、' : '';
8326
- var koreanSuffix = appendSuffix ? ', ' : '';
8327
- switch (type) {
8328
- case _listStyle.LIST_STYLE_TYPE.DISC:
8329
- return '•';
8330
- case _listStyle.LIST_STYLE_TYPE.CIRCLE:
8331
- return '◦';
8332
- case _listStyle.LIST_STYLE_TYPE.SQUARE:
8333
- return '◾';
8334
- case _listStyle.LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:
8335
- var string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
8336
- return string.length < 4 ? '0' + string : string;
8337
- case _listStyle.LIST_STYLE_TYPE.CJK_DECIMAL:
8338
- return createCounterStyleFromSymbols(value, '〇一二三四五六七八九', cjkSuffix);
8339
- case _listStyle.LIST_STYLE_TYPE.LOWER_ROMAN:
8340
- return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
8341
- case _listStyle.LIST_STYLE_TYPE.UPPER_ROMAN:
8342
- return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
8343
- case _listStyle.LIST_STYLE_TYPE.LOWER_GREEK:
8344
- return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);
8345
- case _listStyle.LIST_STYLE_TYPE.LOWER_ALPHA:
8346
- return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);
8347
- case _listStyle.LIST_STYLE_TYPE.UPPER_ALPHA:
8348
- return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);
8349
- case _listStyle.LIST_STYLE_TYPE.ARABIC_INDIC:
8350
- return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);
8351
- case _listStyle.LIST_STYLE_TYPE.ARMENIAN:
8352
- case _listStyle.LIST_STYLE_TYPE.UPPER_ARMENIAN:
8353
- return createAdditiveCounter(value, 1, 9999, ARMENIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
8354
- case _listStyle.LIST_STYLE_TYPE.LOWER_ARMENIAN:
8355
- return createAdditiveCounter(value, 1, 9999, ARMENIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
8356
- case _listStyle.LIST_STYLE_TYPE.BENGALI:
8357
- return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);
8358
- case _listStyle.LIST_STYLE_TYPE.CAMBODIAN:
8359
- case _listStyle.LIST_STYLE_TYPE.KHMER:
8360
- return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);
8361
- case _listStyle.LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:
8362
- return createCounterStyleFromSymbols(value, '子丑寅卯辰巳午未申酉戌亥', cjkSuffix);
8363
- case _listStyle.LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:
8364
- return createCounterStyleFromSymbols(value, '甲乙丙丁戊己庚辛壬癸', cjkSuffix);
8365
- case _listStyle.LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:
8366
- case _listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:
8367
- return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
8368
- case _listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:
8369
- return createCJKCounter(value, '零壹貳參肆伍陸柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
8370
- case _listStyle.LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL:
8371
- return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
8372
- case _listStyle.LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL:
8373
- return createCJKCounter(value, '零壹贰叁肆伍陆柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
8374
- case _listStyle.LIST_STYLE_TYPE.JAPANESE_INFORMAL:
8375
- return createCJKCounter(value, '〇一二三四五六七八九', '十百千万', JAPANESE_NEGATIVE, cjkSuffix, 0);
8376
- case _listStyle.LIST_STYLE_TYPE.JAPANESE_FORMAL:
8377
- return createCJKCounter(value, '零壱弐参四伍六七八九', '拾百千万', JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
8378
- case _listStyle.LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:
8379
- return createCJKCounter(value, '영일이삼사오육칠팔구', '십백천만', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
8380
- case _listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:
8381
- return createCJKCounter(value, '零一二三四五六七八九', '十百千萬', KOREAN_NEGATIVE, koreanSuffix, 0);
8382
- case _listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:
8383
- return createCJKCounter(value, '零壹貳參四五六七八九', '拾百千', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
8384
- case _listStyle.LIST_STYLE_TYPE.DEVANAGARI:
8385
- return createCounterStyleFromRange(value, 0x966, 0x96f, true, defaultSuffix);
8386
- case _listStyle.LIST_STYLE_TYPE.GEORGIAN:
8387
- return createAdditiveCounter(value, 1, 19999, GEORGIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
8388
- case _listStyle.LIST_STYLE_TYPE.GUJARATI:
8389
- return createCounterStyleFromRange(value, 0xae6, 0xaef, true, defaultSuffix);
8390
- case _listStyle.LIST_STYLE_TYPE.GURMUKHI:
8391
- return createCounterStyleFromRange(value, 0xa66, 0xa6f, true, defaultSuffix);
8392
- case _listStyle.LIST_STYLE_TYPE.HEBREW:
8393
- return createAdditiveCounter(value, 1, 10999, HEBREW, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
8394
- case _listStyle.LIST_STYLE_TYPE.HIRAGANA:
8395
- return createCounterStyleFromSymbols(value, 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん');
8396
- case _listStyle.LIST_STYLE_TYPE.HIRAGANA_IROHA:
8397
- return createCounterStyleFromSymbols(value, 'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす');
8398
- case _listStyle.LIST_STYLE_TYPE.KANNADA:
8399
- return createCounterStyleFromRange(value, 0xce6, 0xcef, true, defaultSuffix);
8400
- case _listStyle.LIST_STYLE_TYPE.KATAKANA:
8401
- return createCounterStyleFromSymbols(value, 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン', cjkSuffix);
8402
- case _listStyle.LIST_STYLE_TYPE.KATAKANA_IROHA:
8403
- return createCounterStyleFromSymbols(value, 'イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス', cjkSuffix);
8404
- case _listStyle.LIST_STYLE_TYPE.LAO:
8405
- return createCounterStyleFromRange(value, 0xed0, 0xed9, true, defaultSuffix);
8406
- case _listStyle.LIST_STYLE_TYPE.MONGOLIAN:
8407
- return createCounterStyleFromRange(value, 0x1810, 0x1819, true, defaultSuffix);
8408
- case _listStyle.LIST_STYLE_TYPE.MYANMAR:
8409
- return createCounterStyleFromRange(value, 0x1040, 0x1049, true, defaultSuffix);
8410
- case _listStyle.LIST_STYLE_TYPE.ORIYA:
8411
- return createCounterStyleFromRange(value, 0xb66, 0xb6f, true, defaultSuffix);
8412
- case _listStyle.LIST_STYLE_TYPE.PERSIAN:
8413
- return createCounterStyleFromRange(value, 0x6f0, 0x6f9, true, defaultSuffix);
8414
- case _listStyle.LIST_STYLE_TYPE.TAMIL:
8415
- return createCounterStyleFromRange(value, 0xbe6, 0xbef, true, defaultSuffix);
8416
- case _listStyle.LIST_STYLE_TYPE.TELUGU:
8417
- return createCounterStyleFromRange(value, 0xc66, 0xc6f, true, defaultSuffix);
8418
- case _listStyle.LIST_STYLE_TYPE.THAI:
8419
- return createCounterStyleFromRange(value, 0xe50, 0xe59, true, defaultSuffix);
8420
- case _listStyle.LIST_STYLE_TYPE.TIBETAN:
8421
- return createCounterStyleFromRange(value, 0xf20, 0xf29, true, defaultSuffix);
8422
- case _listStyle.LIST_STYLE_TYPE.DECIMAL:
8423
- default:
8424
- return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
8425
- }
8426
- };
8427
 
8428
- /***/ }),
8429
- /* 15 */
8430
- /***/ (function(module, exports, __webpack_require__) {
8431
 
8432
- "use strict";
 
 
 
 
 
 
 
8433
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8434
 
8435
- Object.defineProperty(exports, "__esModule", {
8436
- value: true
8437
- });
8438
 
8439
- var _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; }; }();
 
 
 
 
 
 
 
 
 
8440
 
8441
- var _Path = __webpack_require__(6);
 
 
 
8442
 
8443
- var _textDecoration = __webpack_require__(11);
 
 
8444
 
8445
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
8446
 
8447
- var addColorStops = function addColorStops(gradient, canvasGradient) {
8448
- var maxStop = Math.max.apply(null, gradient.colorStops.map(function (colorStop) {
8449
- return colorStop.stop;
8450
- }));
8451
- var f = 1 / Math.max(1, maxStop);
8452
- gradient.colorStops.forEach(function (colorStop) {
8453
- canvasGradient.addColorStop(f * colorStop.stop, colorStop.color.toString());
8454
- });
 
 
 
8455
  };
8456
 
8457
- var CanvasRenderer = function () {
8458
- function CanvasRenderer(canvas) {
8459
- _classCallCheck(this, CanvasRenderer);
8460
-
8461
- this.canvas = canvas ? canvas : document.createElement('canvas');
8462
- }
 
 
 
8463
 
8464
- _createClass(CanvasRenderer, [{
8465
- key: 'render',
8466
- value: function render(options) {
8467
- this.ctx = this.canvas.getContext('2d');
8468
- this.options = options;
8469
- this.canvas.width = Math.floor(options.width * options.scale);
8470
- this.canvas.height = Math.floor(options.height * options.scale);
8471
- this.canvas.style.width = options.width + 'px';
8472
- this.canvas.style.height = options.height + 'px';
8473
 
8474
- this.ctx.scale(this.options.scale, this.options.scale);
8475
- this.ctx.translate(-options.x, -options.y);
8476
- this.ctx.textBaseline = 'bottom';
8477
- options.logger.log('Canvas renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + this.options.scale);
8478
- }
8479
- }, {
8480
- key: 'clip',
8481
- value: function clip(clipPaths, callback) {
8482
- var _this = this;
 
 
 
 
 
 
 
8483
 
8484
- if (clipPaths.length) {
8485
- this.ctx.save();
8486
- clipPaths.forEach(function (path) {
8487
- _this.path(path);
8488
- _this.ctx.clip();
8489
- });
8490
- }
8491
 
8492
- callback();
8493
 
8494
- if (clipPaths.length) {
8495
- this.ctx.restore();
8496
- }
8497
- }
8498
- }, {
8499
- key: 'drawImage',
8500
- value: function drawImage(image, source, destination) {
8501
- this.ctx.drawImage(image, source.left, source.top, source.width, source.height, destination.left, destination.top, destination.width, destination.height);
8502
- }
8503
- }, {
8504
- key: 'drawShape',
8505
- value: function drawShape(path, color) {
8506
- this.path(path);
8507
- this.ctx.fillStyle = color.toString();
8508
- this.ctx.fill();
8509
- }
8510
- }, {
8511
- key: 'fill',
8512
- value: function fill(color) {
8513
- this.ctx.fillStyle = color.toString();
8514
- this.ctx.fill();
8515
- }
8516
- }, {
8517
- key: 'getTarget',
8518
- value: function getTarget() {
8519
- this.canvas.getContext('2d').setTransform(1, 0, 0, 1, 0, 0);
8520
- return Promise.resolve(this.canvas);
8521
- }
8522
- }, {
8523
- key: 'path',
8524
- value: function path(_path) {
8525
- var _this2 = this;
8526
 
8527
- this.ctx.beginPath();
8528
- if (Array.isArray(_path)) {
8529
- _path.forEach(function (point, index) {
8530
- var start = point.type === _Path.PATH.VECTOR ? point : point.start;
8531
- if (index === 0) {
8532
- _this2.ctx.moveTo(start.x, start.y);
8533
- } else {
8534
- _this2.ctx.lineTo(start.x, start.y);
8535
- }
8536
 
8537
- if (point.type === _Path.PATH.BEZIER_CURVE) {
8538
- _this2.ctx.bezierCurveTo(point.startControl.x, point.startControl.y, point.endControl.x, point.endControl.y, point.end.x, point.end.y);
8539
- }
8540
- });
8541
- } else {
8542
- this.ctx.arc(_path.x + _path.radius, _path.y + _path.radius, _path.radius, 0, Math.PI * 2, true);
8543
- }
8544
 
8545
- this.ctx.closePath();
8546
- }
8547
- }, {
8548
- key: 'rectangle',
8549
- value: function rectangle(x, y, width, height, color) {
8550
- this.ctx.fillStyle = color.toString();
8551
- this.ctx.fillRect(x, y, width, height);
8552
- }
8553
- }, {
8554
- key: 'renderLinearGradient',
8555
- value: function renderLinearGradient(bounds, gradient) {
8556
- 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);
 
 
 
 
 
 
 
 
 
 
 
 
8557
 
8558
- addColorStops(gradient, linearGradient);
8559
- this.ctx.fillStyle = linearGradient;
8560
- this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height);
8561
- }
8562
- }, {
8563
- key: 'renderRadialGradient',
8564
- value: function renderRadialGradient(bounds, gradient) {
8565
- var _this3 = this;
8566
 
8567
- var x = bounds.left + gradient.center.x;
8568
- var y = bounds.top + gradient.center.y;
8569
 
8570
- var radialGradient = this.ctx.createRadialGradient(x, y, 0, x, y, gradient.radius.x);
8571
- if (!radialGradient) {
8572
- return;
8573
- }
8574
 
8575
- addColorStops(gradient, radialGradient);
8576
- this.ctx.fillStyle = radialGradient;
8577
 
8578
- if (gradient.radius.x !== gradient.radius.y) {
8579
- // transforms for elliptical radial gradient
8580
- var midX = bounds.left + 0.5 * bounds.width;
8581
- var midY = bounds.top + 0.5 * bounds.height;
8582
- var f = gradient.radius.y / gradient.radius.x;
8583
- var invF = 1 / f;
 
 
 
 
8584
 
8585
- this.transform(midX, midY, [1, 0, 0, f, 0, 0], function () {
8586
- return _this3.ctx.fillRect(bounds.left, invF * (bounds.top - midY) + midY, bounds.width, bounds.height * invF);
8587
- });
8588
- } else {
8589
- this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height);
8590
- }
8591
- }
8592
- }, {
8593
- key: 'renderRepeat',
8594
- value: function renderRepeat(path, image, imageSize, offsetX, offsetY) {
8595
- this.path(path);
8596
- this.ctx.fillStyle = this.ctx.createPattern(this.resizeImage(image, imageSize), 'repeat');
8597
- this.ctx.translate(offsetX, offsetY);
8598
- this.ctx.fill();
8599
- this.ctx.translate(-offsetX, -offsetY);
8600
- }
8601
- }, {
8602
- key: 'renderTextNode',
8603
- value: function renderTextNode(textBounds, color, font, textDecoration, textShadows) {
8604
- var _this4 = this;
8605
 
8606
- this.ctx.font = [font.fontStyle, font.fontVariant, font.fontWeight, font.fontSize, font.fontFamily].join(' ');
 
 
8607
 
8608
- textBounds.forEach(function (text) {
8609
- _this4.ctx.fillStyle = color.toString();
8610
- if (textShadows && text.text.trim().length) {
8611
- textShadows.slice(0).reverse().forEach(function (textShadow) {
8612
- _this4.ctx.shadowColor = textShadow.color.toString();
8613
- _this4.ctx.shadowOffsetX = textShadow.offsetX * _this4.options.scale;
8614
- _this4.ctx.shadowOffsetY = textShadow.offsetY * _this4.options.scale;
8615
- _this4.ctx.shadowBlur = textShadow.blur;
8616
 
8617
- _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
8618
- });
8619
- } else {
8620
- _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
8621
- }
8622
 
8623
- if (textDecoration !== null) {
8624
- var textDecorationColor = textDecoration.textDecorationColor || color;
8625
- textDecoration.textDecorationLine.forEach(function (textDecorationLine) {
8626
- switch (textDecorationLine) {
8627
- case _textDecoration.TEXT_DECORATION_LINE.UNDERLINE:
8628
- // Draws a line at the baseline of the font
8629
- // TODO As some browsers display the line as more than 1px if the font-size is big,
8630
- // need to take that into account both in position and size
8631
- var _options$fontMetrics$ = _this4.options.fontMetrics.getMetrics(font),
8632
- baseline = _options$fontMetrics$.baseline;
8633
 
8634
- _this4.rectangle(text.bounds.left, Math.round(text.bounds.top + baseline), text.bounds.width, 1, textDecorationColor);
8635
- break;
8636
- case _textDecoration.TEXT_DECORATION_LINE.OVERLINE:
8637
- _this4.rectangle(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1, textDecorationColor);
8638
- break;
8639
- case _textDecoration.TEXT_DECORATION_LINE.LINE_THROUGH:
8640
- // TODO try and find exact position for line-through
8641
- var _options$fontMetrics$2 = _this4.options.fontMetrics.getMetrics(font),
8642
- middle = _options$fontMetrics$2.middle;
8643
 
8644
- _this4.rectangle(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1, textDecorationColor);
8645
- break;
8646
- }
8647
- });
8648
- }
8649
- });
8650
- }
8651
- }, {
8652
- key: 'resizeImage',
8653
- value: function resizeImage(image, size) {
8654
- if (image.width === size.width && image.height === size.height) {
8655
- return image;
8656
- }
8657
 
8658
- var canvas = this.canvas.ownerDocument.createElement('canvas');
8659
- canvas.width = size.width;
8660
- canvas.height = size.height;
8661
- var ctx = canvas.getContext('2d');
8662
- ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, size.width, size.height);
8663
- return canvas;
8664
- }
8665
- }, {
8666
- key: 'setOpacity',
8667
- value: function setOpacity(opacity) {
8668
- this.ctx.globalAlpha = opacity;
8669
- }
8670
- }, {
8671
- key: 'transform',
8672
- value: function transform(offsetX, offsetY, matrix, callback) {
8673
- this.ctx.save();
8674
- this.ctx.translate(offsetX, offsetY);
8675
- this.ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
8676
- this.ctx.translate(-offsetX, -offsetY);
8677
 
8678
- callback();
8679
 
8680
- this.ctx.restore();
8681
- }
8682
- }]);
8683
 
8684
- return CanvasRenderer;
8685
- }();
8686
 
8687
- exports.default = CanvasRenderer;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8688
 
8689
  /***/ }),
8690
- /* 16 */
8691
  /***/ (function(module, exports, __webpack_require__) {
8692
 
8693
  "use strict";
8694
 
8695
 
8696
  Object.defineProperty(exports, "__esModule", {
8697
- value: true
8698
  });
 
 
 
 
 
 
 
 
8699
 
8700
- var _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; }; }();
8701
-
8702
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8703
-
8704
- var Logger = function () {
8705
- function Logger(enabled, id, start) {
8706
- _classCallCheck(this, Logger);
8707
 
8708
- this.enabled = typeof window !== 'undefined' && enabled;
8709
- this.start = start ? start : Date.now();
8710
- this.id = id;
8711
- }
8712
 
8713
- _createClass(Logger, [{
8714
- key: 'child',
8715
- value: function child(id) {
8716
- return new Logger(this.enabled, id, this.start);
8717
- }
8718
 
8719
- // eslint-disable-next-line flowtype/no-weak-types
8720
 
8721
- }, {
8722
- key: 'log',
8723
- value: function log() {
8724
- if (this.enabled && window.console && window.console.log) {
8725
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
8726
- args[_key] = arguments[_key];
8727
- }
8728
 
8729
- 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)));
8730
- }
8731
- }
8732
 
8733
- // eslint-disable-next-line flowtype/no-weak-types
8734
 
8735
- }, {
8736
- key: 'error',
8737
- value: function error() {
8738
- if (this.enabled && window.console && window.console.error) {
8739
- for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
8740
- args[_key2] = arguments[_key2];
8741
- }
8742
 
8743
- 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)));
8744
- }
8745
- }
8746
- }]);
8747
 
8748
- return Logger;
8749
- }();
8750
 
8751
- exports.default = Logger;
8752
 
8753
- /***/ }),
8754
- /* 17 */
8755
- /***/ (function(module, exports, __webpack_require__) {
8756
 
8757
- "use strict";
8758
 
 
8759
 
8760
- Object.defineProperty(exports, "__esModule", {
8761
- value: true
8762
- });
8763
- exports.parsePadding = exports.PADDING_SIDES = undefined;
8764
 
8765
- var _Length = __webpack_require__(1);
8766
 
8767
- var _Length2 = _interopRequireDefault(_Length);
 
 
 
 
 
 
 
8768
 
8769
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
8770
 
8771
- var PADDING_SIDES = exports.PADDING_SIDES = {
8772
- TOP: 0,
8773
- RIGHT: 1,
8774
- BOTTOM: 2,
8775
- LEFT: 3
8776
- };
8777
 
8778
- var SIDES = ['top', 'right', 'bottom', 'left'];
 
 
 
 
8779
 
8780
- var parsePadding = exports.parsePadding = function parsePadding(style) {
8781
- return SIDES.map(function (side) {
8782
- return new _Length2.default(style.getPropertyValue('padding-' + side));
8783
- });
8784
- };
8785
 
8786
  /***/ }),
8787
- /* 18 */
8788
  /***/ (function(module, exports, __webpack_require__) {
8789
 
8790
  "use strict";
8791
 
8792
 
8793
  Object.defineProperty(exports, "__esModule", {
8794
- value: true
8795
  });
8796
- var OVERFLOW_WRAP = exports.OVERFLOW_WRAP = {
8797
- NORMAL: 0,
8798
- BREAK_WORD: 1
8799
- };
8800
 
8801
- var parseOverflowWrap = exports.parseOverflowWrap = function parseOverflowWrap(overflow) {
8802
- switch (overflow) {
8803
- case 'break-word':
8804
- return OVERFLOW_WRAP.BREAK_WORD;
8805
- case 'normal':
8806
- default:
8807
- return OVERFLOW_WRAP.NORMAL;
8808
- }
8809
- };
8810
 
8811
- /***/ }),
8812
- /* 19 */
8813
- /***/ (function(module, exports, __webpack_require__) {
8814
 
8815
- "use strict";
8816
 
 
8817
 
8818
- Object.defineProperty(exports, "__esModule", {
8819
- value: true
8820
- });
8821
- var POSITION = exports.POSITION = {
8822
- STATIC: 0,
8823
- RELATIVE: 1,
8824
- ABSOLUTE: 2,
8825
- FIXED: 3,
8826
- STICKY: 4
8827
- };
8828
 
8829
- var parsePosition = exports.parsePosition = function parsePosition(position) {
8830
- switch (position) {
8831
- case 'relative':
8832
- return POSITION.RELATIVE;
8833
- case 'absolute':
8834
- return POSITION.ABSOLUTE;
8835
- case 'fixed':
8836
- return POSITION.FIXED;
8837
- case 'sticky':
8838
- return POSITION.STICKY;
8839
- }
8840
 
8841
- return POSITION.STATIC;
 
 
 
 
 
 
 
 
 
8842
  };
8843
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8844
  /***/ }),
8845
- /* 20 */
8846
  /***/ (function(module, exports, __webpack_require__) {
8847
 
8848
  "use strict";
8849
 
8850
 
8851
  Object.defineProperty(exports, "__esModule", {
8852
- value: true
8853
  });
8854
- var TEXT_TRANSFORM = exports.TEXT_TRANSFORM = {
8855
- NONE: 0,
8856
- LOWERCASE: 1,
8857
- UPPERCASE: 2,
8858
- CAPITALIZE: 3
8859
- };
8860
-
8861
- var parseTextTransform = exports.parseTextTransform = function parseTextTransform(textTransform) {
8862
- switch (textTransform) {
8863
- case 'uppercase':
8864
- return TEXT_TRANSFORM.UPPERCASE;
8865
- case 'lowercase':
8866
- return TEXT_TRANSFORM.LOWERCASE;
8867
- case 'capitalize':
8868
- return TEXT_TRANSFORM.CAPITALIZE;
8869
- }
8870
-
8871
- return TEXT_TRANSFORM.NONE;
8872
- };
8873
 
8874
  /***/ }),
8875
- /* 21 */
8876
  /***/ (function(module, exports, __webpack_require__) {
8877
 
8878
  "use strict";
8879
 
8880
 
8881
  Object.defineProperty(exports, "__esModule", {
8882
- value: true
8883
  });
8884
- exports.reformatInputBounds = exports.inlineSelectElement = exports.inlineTextAreaElement = exports.inlineInputElement = exports.getInputBorderRadius = exports.INPUT_BACKGROUND = exports.INPUT_BORDERS = exports.INPUT_COLOR = undefined;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8885
 
8886
- var _TextContainer = __webpack_require__(9);
 
 
8887
 
8888
- var _TextContainer2 = _interopRequireDefault(_TextContainer);
8889
 
8890
- var _background = __webpack_require__(5);
8891
 
8892
- var _border = __webpack_require__(12);
 
 
8893
 
8894
- var _Circle = __webpack_require__(50);
8895
 
8896
- var _Circle2 = _interopRequireDefault(_Circle);
 
 
 
 
 
 
 
 
8897
 
8898
- var _Vector = __webpack_require__(7);
8899
 
8900
- var _Vector2 = _interopRequireDefault(_Vector);
 
 
 
8901
 
8902
- var _Color = __webpack_require__(0);
8903
 
8904
- var _Color2 = _interopRequireDefault(_Color);
8905
 
8906
- var _Length = __webpack_require__(1);
 
 
8907
 
8908
- var _Length2 = _interopRequireDefault(_Length);
8909
 
8910
- var _Bounds = __webpack_require__(2);
 
8911
 
8912
- var _TextBounds = __webpack_require__(22);
8913
 
8914
- var _Util = __webpack_require__(4);
 
 
8915
 
8916
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
 
 
8917
 
8918
- var INPUT_COLOR = exports.INPUT_COLOR = new _Color2.default([42, 42, 42]);
8919
- var INPUT_BORDER_COLOR = new _Color2.default([165, 165, 165]);
8920
- var INPUT_BACKGROUND_COLOR = new _Color2.default([222, 222, 222]);
8921
- var INPUT_BORDER = {
8922
- borderWidth: 1,
8923
- borderColor: INPUT_BORDER_COLOR,
8924
- borderStyle: _border.BORDER_STYLE.SOLID
8925
- };
8926
- var INPUT_BORDERS = exports.INPUT_BORDERS = [INPUT_BORDER, INPUT_BORDER, INPUT_BORDER, INPUT_BORDER];
8927
- var INPUT_BACKGROUND = exports.INPUT_BACKGROUND = {
8928
- backgroundColor: INPUT_BACKGROUND_COLOR,
8929
- backgroundImage: [],
8930
- backgroundClip: _background.BACKGROUND_CLIP.PADDING_BOX,
8931
- backgroundOrigin: _background.BACKGROUND_ORIGIN.PADDING_BOX
8932
- };
8933
 
8934
- var RADIO_BORDER_RADIUS = new _Length2.default('50%');
8935
- var RADIO_BORDER_RADIUS_TUPLE = [RADIO_BORDER_RADIUS, RADIO_BORDER_RADIUS];
8936
- var INPUT_RADIO_BORDER_RADIUS = [RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE];
8937
 
8938
- var CHECKBOX_BORDER_RADIUS = new _Length2.default('3px');
8939
- var CHECKBOX_BORDER_RADIUS_TUPLE = [CHECKBOX_BORDER_RADIUS, CHECKBOX_BORDER_RADIUS];
8940
- var INPUT_CHECKBOX_BORDER_RADIUS = [CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE];
8941
 
8942
- var getInputBorderRadius = exports.getInputBorderRadius = function getInputBorderRadius(node) {
8943
- return node.type === 'radio' ? INPUT_RADIO_BORDER_RADIUS : INPUT_CHECKBOX_BORDER_RADIUS;
8944
- };
8945
 
8946
- var inlineInputElement = exports.inlineInputElement = function inlineInputElement(node, container) {
8947
- if (node.type === 'radio' || node.type === 'checkbox') {
8948
- if (node.checked) {
8949
- var size = Math.min(container.bounds.width, container.bounds.height);
8950
- 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));
8951
- }
8952
- } else {
8953
- inlineFormElement(getInputValue(node), node, container, false);
8954
- }
8955
- };
8956
 
8957
- var inlineTextAreaElement = exports.inlineTextAreaElement = function inlineTextAreaElement(node, container) {
8958
- inlineFormElement(node.value, node, container, true);
 
 
 
 
 
 
8959
  };
8960
 
8961
- var inlineSelectElement = exports.inlineSelectElement = function inlineSelectElement(node, container) {
8962
- var option = node.options[node.selectedIndex || 0];
8963
- inlineFormElement(option ? option.text || '' : '', node, container, false);
8964
- };
 
 
 
 
 
 
 
 
 
8965
 
8966
- var reformatInputBounds = exports.reformatInputBounds = function reformatInputBounds(bounds) {
8967
- if (bounds.width > bounds.height) {
8968
- bounds.left += (bounds.width - bounds.height) / 2;
8969
- bounds.width = bounds.height;
8970
- } else if (bounds.width < bounds.height) {
8971
- bounds.top += (bounds.height - bounds.width) / 2;
8972
- bounds.height = bounds.width;
8973
- }
8974
- return bounds;
8975
- };
8976
 
8977
- var inlineFormElement = function inlineFormElement(value, node, container, allowLinebreak) {
8978
- var body = node.ownerDocument.body;
8979
- if (value.length > 0 && body) {
8980
- var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
8981
- (0, _Util.copyCSSStyles)(node.ownerDocument.defaultView.getComputedStyle(node, null), wrapper);
8982
- wrapper.style.position = 'absolute';
8983
- wrapper.style.left = container.bounds.left + 'px';
8984
- wrapper.style.top = container.bounds.top + 'px';
8985
- if (!allowLinebreak) {
8986
- wrapper.style.whiteSpace = 'nowrap';
8987
- }
8988
- var text = node.ownerDocument.createTextNode(value);
8989
- wrapper.appendChild(text);
8990
- body.appendChild(wrapper);
8991
- container.childNodes.push(_TextContainer2.default.fromTextNode(text, container));
8992
- body.removeChild(wrapper);
8993
- }
8994
- };
8995
 
8996
- var getInputValue = function getInputValue(node) {
8997
- var value = node.type === 'password' ? new Array(node.value.length + 1).join('\u2022') : node.value;
8998
 
8999
- return value.length === 0 ? node.placeholder || '' : value;
9000
- };
 
 
 
 
 
 
 
9001
 
9002
  /***/ }),
9003
- /* 22 */
9004
  /***/ (function(module, exports, __webpack_require__) {
9005
 
9006
  "use strict";
9007
 
9008
 
9009
  Object.defineProperty(exports, "__esModule", {
9010
- value: true
9011
  });
9012
- exports.parseTextBounds = exports.TextBounds = undefined;
9013
-
9014
- var _Bounds = __webpack_require__(2);
9015
 
9016
- var _textDecoration = __webpack_require__(11);
9017
 
9018
- var _Feature = __webpack_require__(10);
9019
 
9020
- var _Feature2 = _interopRequireDefault(_Feature);
9021
 
9022
- var _Unicode = __webpack_require__(24);
9023
 
9024
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9025
 
9026
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9027
-
9028
- var TextBounds = exports.TextBounds = function TextBounds(text, bounds) {
9029
- _classCallCheck(this, TextBounds);
9030
-
9031
- this.text = text;
9032
- this.bounds = bounds;
9033
- };
9034
 
9035
- var parseTextBounds = exports.parseTextBounds = function parseTextBounds(value, parent, node) {
9036
- var letterRendering = parent.style.letterSpacing !== 0;
9037
- var textList = letterRendering ? (0, _Unicode.toCodePoints)(value).map(function (i) {
9038
- return (0, _Unicode.fromCodePoint)(i);
9039
- }) : (0, _Unicode.breakWords)(value, parent);
9040
- var length = textList.length;
9041
- var defaultView = node.parentNode ? node.parentNode.ownerDocument.defaultView : null;
9042
- var scrollX = defaultView ? defaultView.pageXOffset : 0;
9043
- var scrollY = defaultView ? defaultView.pageYOffset : 0;
9044
- var textBounds = [];
9045
- var offset = 0;
9046
- for (var i = 0; i < length; i++) {
9047
- var text = textList[i];
9048
- if (parent.style.textDecoration !== _textDecoration.TEXT_DECORATION.NONE || text.trim().length > 0) {
9049
- if (_Feature2.default.SUPPORT_RANGE_BOUNDS) {
9050
- textBounds.push(new TextBounds(text, getRangeBounds(node, offset, text.length, scrollX, scrollY)));
9051
- } else {
9052
- var replacementNode = node.splitText(text.length);
9053
- textBounds.push(new TextBounds(text, getWrapperBounds(node, scrollX, scrollY)));
9054
- node = replacementNode;
9055
- }
9056
- } else if (!_Feature2.default.SUPPORT_RANGE_BOUNDS) {
9057
- node = node.splitText(text.length);
9058
- }
9059
- offset += text.length;
9060
- }
9061
- return textBounds;
9062
- };
9063
 
9064
- var getWrapperBounds = function getWrapperBounds(node, scrollX, scrollY) {
9065
- var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
9066
- wrapper.appendChild(node.cloneNode(true));
9067
- var parentNode = node.parentNode;
9068
- if (parentNode) {
9069
- parentNode.replaceChild(wrapper, node);
9070
- var bounds = (0, _Bounds.parseBounds)(wrapper, scrollX, scrollY);
9071
- if (wrapper.firstChild) {
9072
- parentNode.replaceChild(wrapper.firstChild, wrapper);
9073
- }
9074
- return bounds;
9075
- }
9076
- return new _Bounds.Bounds(0, 0, 0, 0);
9077
- };
9078
 
9079
- var getRangeBounds = function getRangeBounds(node, offset, length, scrollX, scrollY) {
9080
- var range = node.ownerDocument.createRange();
9081
- range.setStart(node, offset);
9082
- range.setEnd(node, offset + length);
9083
- return _Bounds.Bounds.fromClientRect(range.getBoundingClientRect(), scrollX, scrollY);
9084
- };
9085
 
9086
  /***/ }),
9087
- /* 23 */
9088
  /***/ (function(module, exports, __webpack_require__) {
9089
 
9090
  "use strict";
9091
 
9092
 
9093
  Object.defineProperty(exports, "__esModule", {
9094
- value: true
9095
  });
 
 
 
 
 
 
9096
 
9097
- var _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; }; }();
9098
-
9099
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
9100
 
9101
- var ForeignObjectRenderer = function () {
9102
- function ForeignObjectRenderer(element) {
9103
- _classCallCheck(this, ForeignObjectRenderer);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9104
 
9105
- this.element = element;
9106
- }
9107
 
9108
- _createClass(ForeignObjectRenderer, [{
9109
- key: 'render',
9110
- value: function render(options) {
9111
- var _this = this;
9112
 
9113
- this.options = options;
9114
- this.canvas = document.createElement('canvas');
9115
- this.ctx = this.canvas.getContext('2d');
9116
- this.canvas.width = Math.floor(options.width) * options.scale;
9117
- this.canvas.height = Math.floor(options.height) * options.scale;
9118
- this.canvas.style.width = options.width + 'px';
9119
- this.canvas.style.height = options.height + 'px';
9120
 
9121
- options.logger.log('ForeignObject renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + options.scale);
9122
- 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);
9123
 
9124
- return loadSerializedSVG(svg).then(function (img) {
9125
- if (options.backgroundColor) {
9126
- _this.ctx.fillStyle = options.backgroundColor.toString();
9127
- _this.ctx.fillRect(0, 0, options.width * options.scale, options.height * options.scale);
9128
- }
9129
 
9130
- _this.ctx.drawImage(img, -options.x * options.scale, -options.y * options.scale);
9131
- return _this.canvas;
9132
- });
9133
- }
9134
- }]);
9135
 
9136
- return ForeignObjectRenderer;
9137
- }();
9138
 
9139
- exports.default = ForeignObjectRenderer;
9140
- var createForeignObjectSVG = exports.createForeignObjectSVG = function createForeignObjectSVG(width, height, x, y, node) {
9141
- var xmlns = 'http://www.w3.org/2000/svg';
9142
- var svg = document.createElementNS(xmlns, 'svg');
9143
- var foreignObject = document.createElementNS(xmlns, 'foreignObject');
9144
- svg.setAttributeNS(null, 'width', width);
9145
- svg.setAttributeNS(null, 'height', height);
9146
 
9147
- foreignObject.setAttributeNS(null, 'width', '100%');
9148
- foreignObject.setAttributeNS(null, 'height', '100%');
9149
- foreignObject.setAttributeNS(null, 'x', x);
9150
- foreignObject.setAttributeNS(null, 'y', y);
9151
- foreignObject.setAttributeNS(null, 'externalResourcesRequired', 'true');
9152
- svg.appendChild(foreignObject);
9153
 
9154
- foreignObject.appendChild(node);
9155
 
9156
- return svg;
 
 
 
 
 
 
 
 
 
 
 
9157
  };
9158
 
9159
- var loadSerializedSVG = exports.loadSerializedSVG = function loadSerializedSVG(svg) {
9160
- return new Promise(function (resolve, reject) {
9161
- var img = new Image();
9162
- img.onload = function () {
9163
- return resolve(img);
9164
- };
9165
- img.onerror = reject;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9166
 
9167
- img.src = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(new XMLSerializer().serializeToString(svg));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9168
  });
 
9169
  };
9170
 
9171
  /***/ }),
9172
- /* 24 */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9173
  /***/ (function(module, exports, __webpack_require__) {
9174
 
9175
  "use strict";
9176
 
9177
 
 
 
9178
  Object.defineProperty(exports, "__esModule", {
9179
  value: true
9180
  });
9181
- exports.breakWords = exports.fromCodePoint = exports.toCodePoints = undefined;
9182
 
9183
- var _cssLineBreak = __webpack_require__(46);
9184
 
9185
- Object.defineProperty(exports, 'toCodePoints', {
9186
- enumerable: true,
9187
- get: function get() {
9188
- return _cssLineBreak.toCodePoints;
 
 
 
 
 
9189
  }
9190
- });
9191
- Object.defineProperty(exports, 'fromCodePoint', {
9192
- enumerable: true,
9193
- get: function get() {
9194
- return _cssLineBreak.fromCodePoint;
 
 
 
9195
  }
9196
- });
 
9197
 
9198
- var _NodeContainer = __webpack_require__(3);
 
 
 
 
 
 
 
9199
 
9200
- var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
 
 
 
 
 
 
 
9201
 
9202
- var _overflowWrap = __webpack_require__(18);
 
 
9203
 
9204
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
9205
 
9206
- var breakWords = exports.breakWords = function breakWords(str, parent) {
9207
- var breaker = (0, _cssLineBreak.LineBreaker)(str, {
9208
- lineBreak: parent.style.lineBreak,
9209
- wordBreak: parent.style.overflowWrap === _overflowWrap.OVERFLOW_WRAP.BREAK_WORD ? 'break-word' : parent.style.wordBreak
9210
- });
9211
 
9212
- var words = [];
9213
- var bk = void 0;
 
 
 
 
9214
 
9215
- while (!(bk = breaker.next()).done) {
9216
- words.push(bk.value.slice());
 
 
9217
  }
9218
 
9219
- return words;
9220
- };
 
 
 
 
 
 
 
 
 
9221
 
9222
- /***/ }),
9223
- /* 25 */
9224
- /***/ (function(module, exports, __webpack_require__) {
9225
 
9226
- "use strict";
9227
 
9228
 
9229
- Object.defineProperty(exports, "__esModule", {
9230
- value: true
9231
- });
9232
- exports.FontMetrics = undefined;
9233
-
9234
- var _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; }; }();
9235
-
9236
- var _Util = __webpack_require__(4);
9237
-
9238
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9239
-
9240
- var SAMPLE_TEXT = 'Hidden Text';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9241
 
9242
- var FontMetrics = exports.FontMetrics = function () {
9243
- function FontMetrics(document) {
9244
- _classCallCheck(this, FontMetrics);
9245
 
9246
- this._data = {};
9247
- this._document = document;
9248
- }
9249
 
9250
- _createClass(FontMetrics, [{
9251
- key: '_parseMetrics',
9252
- value: function _parseMetrics(font) {
9253
- var container = this._document.createElement('div');
9254
- var img = this._document.createElement('img');
9255
- var span = this._document.createElement('span');
9256
 
9257
- var body = this._document.body;
9258
- if (!body) {
9259
- throw new Error( true ? 'No document found for font metrics' : '');
9260
- }
9261
 
9262
- container.style.visibility = 'hidden';
9263
- container.style.fontFamily = font.fontFamily;
9264
- container.style.fontSize = font.fontSize;
9265
- container.style.margin = '0';
9266
- container.style.padding = '0';
9267
 
9268
- body.appendChild(container);
9269
 
9270
- img.src = _Util.SMALL_IMAGE;
9271
- img.width = 1;
9272
- img.height = 1;
9273
 
9274
- img.style.margin = '0';
9275
- img.style.padding = '0';
9276
- img.style.verticalAlign = 'baseline';
9277
 
9278
- span.style.fontFamily = font.fontFamily;
9279
- span.style.fontSize = font.fontSize;
9280
- span.style.margin = '0';
9281
- span.style.padding = '0';
9282
 
9283
- span.appendChild(this._document.createTextNode(SAMPLE_TEXT));
9284
- container.appendChild(span);
9285
- container.appendChild(img);
9286
- var baseline = img.offsetTop - span.offsetTop + 2;
9287
 
9288
- container.removeChild(span);
9289
- container.appendChild(this._document.createTextNode(SAMPLE_TEXT));
9290
 
9291
- container.style.lineHeight = 'normal';
9292
- img.style.verticalAlign = 'super';
 
 
9293
 
9294
- var middle = img.offsetTop - container.offsetTop + 2;
 
 
9295
 
9296
- body.removeChild(container);
 
 
 
 
 
 
9297
 
9298
- return { baseline: baseline, middle: middle };
 
 
 
9299
  }
9300
  }, {
9301
- key: 'getMetrics',
9302
- value: function getMetrics(font) {
9303
- var key = font.fontFamily + ' ' + font.fontSize;
9304
- if (this._data[key] === undefined) {
9305
- this._data[key] = this._parseMetrics(font);
9306
- }
9307
-
9308
- return this._data[key];
9309
  }
9310
  }]);
9311
 
9312
- return FontMetrics;
9313
  }();
9314
 
9315
- /***/ }),
9316
- /* 26 */
9317
- /***/ (function(module, exports, __webpack_require__) {
9318
-
9319
- "use strict";
9320
-
9321
-
9322
- Object.defineProperty(exports, "__esModule", {
9323
- value: true
9324
- });
9325
- exports.Proxy = undefined;
9326
-
9327
- var _Feature = __webpack_require__(10);
9328
 
9329
- var _Feature2 = _interopRequireDefault(_Feature);
9330
 
9331
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
9332
 
9333
- var Proxy = exports.Proxy = function Proxy(src, options) {
9334
- if (!options.proxy) {
9335
- return Promise.reject( true ? 'No proxy defined' : null);
 
 
 
 
 
 
 
 
 
 
9336
  }
9337
- var proxy = options.proxy;
9338
-
9339
- return new Promise(function (resolve, reject) {
9340
- var responseType = _Feature2.default.SUPPORT_CORS_XHR && _Feature2.default.SUPPORT_RESPONSE_TYPE ? 'blob' : 'text';
9341
- var xhr = _Feature2.default.SUPPORT_CORS_XHR ? new XMLHttpRequest() : new XDomainRequest();
9342
- xhr.onload = function () {
9343
- if (xhr instanceof XMLHttpRequest) {
9344
- if (xhr.status === 200) {
9345
- if (responseType === 'text') {
9346
- resolve(xhr.response);
9347
- } else {
9348
- var reader = new FileReader();
9349
- // $FlowFixMe
9350
- reader.addEventListener('load', function () {
9351
- return resolve(reader.result);
9352
- }, false);
9353
- // $FlowFixMe
9354
- reader.addEventListener('error', function (e) {
9355
- return reject(e);
9356
- }, false);
9357
- reader.readAsDataURL(xhr.response);
9358
- }
9359
- } else {
9360
- reject( true ? 'Failed to proxy resource ' + src.substring(0, 256) + ' with status code ' + xhr.status : '');
9361
- }
9362
- } else {
9363
- resolve(xhr.responseText);
9364
- }
9365
- };
9366
-
9367
- xhr.onerror = reject;
9368
- xhr.open('GET', proxy + '?url=' + encodeURIComponent(src) + '&responseType=' + responseType);
9369
-
9370
- if (responseType !== 'text' && xhr instanceof XMLHttpRequest) {
9371
- xhr.responseType = responseType;
9372
- }
9373
-
9374
- if (options.imageTimeout) {
9375
- var timeout = options.imageTimeout;
9376
- xhr.timeout = timeout;
9377
- xhr.ontimeout = function () {
9378
- return reject( true ? 'Timed out (' + timeout + 'ms) proxying ' + src.substring(0, 256) : '');
9379
- };
9380
- }
9381
-
9382
- xhr.send();
9383
- });
9384
  };
9385
 
9386
  /***/ }),
9387
- /* 27 */
9388
  /***/ (function(module, exports, __webpack_require__) {
9389
 
9390
  "use strict";
9391
 
9392
 
9393
- var _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; };
 
 
 
9394
 
9395
- var _CanvasRenderer = __webpack_require__(15);
9396
 
9397
- var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);
9398
 
9399
- var _Logger = __webpack_require__(16);
9400
 
9401
- var _Logger2 = _interopRequireDefault(_Logger);
9402
 
9403
- var _Window = __webpack_require__(28);
9404
 
9405
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9406
 
9407
- var html2canvas = function html2canvas(element, conf) {
9408
- var config = conf || {};
9409
- var logger = new _Logger2.default(typeof config.logging === 'boolean' ? config.logging : true);
9410
- logger.log('html2canvas ' + "1.0.0-alpha.12");
9411
-
9412
- if (true && typeof config.onrendered === 'function') {
9413
- logger.error('onrendered option is deprecated, html2canvas returns a Promise with the canvas as the value');
9414
- }
9415
 
9416
- var ownerDocument = element.ownerDocument;
9417
- if (!ownerDocument) {
9418
- return Promise.reject('Provided element is not within a Document');
9419
- }
9420
- var defaultView = ownerDocument.defaultView;
9421
 
9422
- var defaultOptions = {
9423
- async: true,
9424
- allowTaint: false,
9425
- backgroundColor: '#ffffff',
9426
- imageTimeout: 15000,
9427
- logging: true,
9428
- proxy: null,
9429
- removeContainer: true,
9430
- foreignObjectRendering: false,
9431
- scale: defaultView.devicePixelRatio || 1,
9432
- target: new _CanvasRenderer2.default(config.canvas),
9433
- useCORS: false,
9434
- windowWidth: defaultView.innerWidth,
9435
- windowHeight: defaultView.innerHeight,
9436
- scrollX: defaultView.pageXOffset,
9437
- scrollY: defaultView.pageYOffset
9438
- };
9439
 
9440
- var result = (0, _Window.renderElement)(element, _extends({}, defaultOptions, config), logger);
 
 
9441
 
9442
- if (true) {
9443
- return result.catch(function (e) {
9444
- logger.error(e);
9445
- throw e;
9446
- });
9447
  }
9448
- return result;
9449
- };
9450
 
9451
- html2canvas.CanvasRenderer = _CanvasRenderer2.default;
 
 
 
 
 
9452
 
9453
- module.exports = html2canvas;
 
9454
 
9455
- /***/ }),
9456
- /* 28 */
9457
- /***/ (function(module, exports, __webpack_require__) {
9458
 
9459
- "use strict";
 
 
9460
 
 
 
 
 
 
 
9461
 
9462
- Object.defineProperty(exports, "__esModule", {
9463
- value: true
9464
- });
9465
- exports.renderElement = undefined;
9466
 
9467
- var _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"); } }; }();
 
 
9468
 
9469
- var _Logger = __webpack_require__(16);
 
 
 
9470
 
9471
- var _Logger2 = _interopRequireDefault(_Logger);
9472
 
9473
- var _NodeParser = __webpack_require__(29);
 
9474
 
9475
- var _Renderer = __webpack_require__(51);
 
 
 
 
 
 
 
 
 
 
 
 
9476
 
9477
- var _Renderer2 = _interopRequireDefault(_Renderer);
 
 
 
 
 
 
9478
 
9479
- var _ForeignObjectRenderer = __webpack_require__(23);
 
 
 
 
9480
 
9481
- var _ForeignObjectRenderer2 = _interopRequireDefault(_ForeignObjectRenderer);
 
 
 
 
9482
 
9483
- var _Feature = __webpack_require__(10);
 
 
 
 
9484
 
9485
- var _Feature2 = _interopRequireDefault(_Feature);
 
9486
 
9487
- var _Bounds = __webpack_require__(2);
 
 
9488
 
9489
- var _Clone = __webpack_require__(54);
 
 
9490
 
9491
- var _Font = __webpack_require__(25);
 
 
 
 
 
 
 
 
9492
 
9493
- var _Color = __webpack_require__(0);
 
 
 
 
 
9494
 
9495
- var _Color2 = _interopRequireDefault(_Color);
 
 
 
 
 
 
 
 
 
9496
 
9497
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
9498
 
9499
- var renderElement = exports.renderElement = function renderElement(element, options, logger) {
9500
- var ownerDocument = element.ownerDocument;
 
 
 
 
 
 
 
 
 
9501
 
9502
- var windowBounds = new _Bounds.Bounds(options.scrollX, options.scrollY, options.windowWidth, options.windowHeight);
 
 
 
 
 
9503
 
9504
- // http://www.w3.org/TR/css3-background/#special-backgrounds
9505
- var documentBackgroundColor = ownerDocument.documentElement ? new _Color2.default(getComputedStyle(ownerDocument.documentElement).backgroundColor) : _Color.TRANSPARENT;
9506
- var bodyBackgroundColor = ownerDocument.body ? new _Color2.default(getComputedStyle(ownerDocument.body).backgroundColor) : _Color.TRANSPARENT;
 
 
 
9507
 
9508
- var backgroundColor = element === ownerDocument.documentElement ? documentBackgroundColor.isTransparent() ? bodyBackgroundColor.isTransparent() ? options.backgroundColor ? new _Color2.default(options.backgroundColor) : null : bodyBackgroundColor : documentBackgroundColor : options.backgroundColor ? new _Color2.default(options.backgroundColor) : null;
 
 
 
 
 
 
 
 
 
 
 
9509
 
9510
- return (options.foreignObjectRendering ? // $FlowFixMe
9511
- _Feature2.default.SUPPORT_FOREIGNOBJECT_DRAWING : Promise.resolve(false)).then(function (supportForeignObject) {
9512
- return supportForeignObject ? function (cloner) {
9513
- if (true) {
9514
- logger.log('Document cloned, using foreignObject rendering');
9515
- }
9516
 
9517
- return cloner.inlineFonts(ownerDocument).then(function () {
9518
- return cloner.resourceLoader.ready();
9519
- }).then(function () {
9520
- var renderer = new _ForeignObjectRenderer2.default(cloner.documentElement);
9521
 
9522
- var defaultView = ownerDocument.defaultView;
9523
- var scrollX = defaultView.pageXOffset;
9524
- var scrollY = defaultView.pageYOffset;
9525
 
9526
- var isDocument = element.tagName === 'HTML' || element.tagName === 'BODY';
 
 
9527
 
9528
- var _ref = isDocument ? (0, _Bounds.parseDocumentSize)(ownerDocument) : (0, _Bounds.parseBounds)(element, scrollX, scrollY),
9529
- width = _ref.width,
9530
- height = _ref.height,
9531
- left = _ref.left,
9532
- top = _ref.top;
9533
 
9534
- return renderer.render({
9535
- backgroundColor: backgroundColor,
9536
- logger: logger,
9537
- scale: options.scale,
9538
- x: typeof options.x === 'number' ? options.x : left,
9539
- y: typeof options.y === 'number' ? options.y : top,
9540
- width: typeof options.width === 'number' ? options.width : Math.ceil(width),
9541
- height: typeof options.height === 'number' ? options.height : Math.ceil(height),
9542
- windowWidth: options.windowWidth,
9543
- windowHeight: options.windowHeight,
9544
- scrollX: options.scrollX,
9545
- scrollY: options.scrollY
9546
- });
9547
- });
9548
- }(new _Clone.DocumentCloner(element, options, logger, true, renderElement)) : (0, _Clone.cloneWindow)(ownerDocument, windowBounds, element, options, logger, renderElement).then(function (_ref2) {
9549
- var _ref3 = _slicedToArray(_ref2, 3),
9550
- container = _ref3[0],
9551
- clonedElement = _ref3[1],
9552
- resourceLoader = _ref3[2];
9553
 
9554
- if (true) {
9555
- logger.log('Document cloned, using computed rendering');
9556
- }
9557
 
9558
- var stack = (0, _NodeParser.NodeParser)(clonedElement, resourceLoader, logger);
9559
- var clonedDocument = clonedElement.ownerDocument;
9560
 
9561
- if (backgroundColor === stack.container.style.background.backgroundColor) {
9562
- stack.container.style.background.backgroundColor = _Color.TRANSPARENT;
9563
- }
9564
 
9565
- return resourceLoader.ready().then(function (imageStore) {
9566
- var fontMetrics = new _Font.FontMetrics(clonedDocument);
9567
- if (true) {
9568
- logger.log('Starting renderer');
9569
- }
9570
 
9571
- var defaultView = clonedDocument.defaultView;
9572
- var scrollX = defaultView.pageXOffset;
9573
- var scrollY = defaultView.pageYOffset;
9574
 
9575
- var isDocument = clonedElement.tagName === 'HTML' || clonedElement.tagName === 'BODY';
9576
 
9577
- var _ref4 = isDocument ? (0, _Bounds.parseDocumentSize)(ownerDocument) : (0, _Bounds.parseBounds)(clonedElement, scrollX, scrollY),
9578
- width = _ref4.width,
9579
- height = _ref4.height,
9580
- left = _ref4.left,
9581
- top = _ref4.top;
9582
 
9583
- var renderOptions = {
9584
- backgroundColor: backgroundColor,
9585
- fontMetrics: fontMetrics,
9586
- imageStore: imageStore,
9587
- logger: logger,
9588
- scale: options.scale,
9589
- x: typeof options.x === 'number' ? options.x : left,
9590
- y: typeof options.y === 'number' ? options.y : top,
9591
- width: typeof options.width === 'number' ? options.width : Math.ceil(width),
9592
- height: typeof options.height === 'number' ? options.height : Math.ceil(height)
9593
- };
9594
 
9595
- if (Array.isArray(options.target)) {
9596
- return Promise.all(options.target.map(function (target) {
9597
- var renderer = new _Renderer2.default(target, renderOptions);
9598
- return renderer.render(stack);
9599
- }));
9600
- } else {
9601
- var renderer = new _Renderer2.default(options.target, renderOptions);
9602
- var canvas = renderer.render(stack);
9603
- if (options.removeContainer === true) {
9604
- if (container.parentNode) {
9605
- container.parentNode.removeChild(container);
9606
- } else if (true) {
9607
- logger.log('Cannot detach cloned iframe as it is not in the DOM anymore');
9608
- }
9609
- }
9610
 
9611
- return canvas;
9612
- }
9613
- });
9614
- });
9615
- });
9616
- };
9617
 
9618
- /***/ }),
9619
- /* 29 */
9620
- /***/ (function(module, exports, __webpack_require__) {
9621
 
9622
- "use strict";
9623
 
 
9624
 
9625
- Object.defineProperty(exports, "__esModule", {
9626
- value: true
9627
- });
9628
- exports.NodeParser = undefined;
9629
 
9630
- var _StackingContext = __webpack_require__(30);
9631
 
9632
- var _StackingContext2 = _interopRequireDefault(_StackingContext);
9633
 
9634
- var _NodeContainer = __webpack_require__(3);
9635
 
9636
- var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
9637
 
9638
- var _TextContainer = __webpack_require__(9);
9639
 
9640
- var _TextContainer2 = _interopRequireDefault(_TextContainer);
 
 
 
 
 
 
 
 
9641
 
9642
  var _Input = __webpack_require__(21);
9643
 
9644
  var _ListItem = __webpack_require__(14);
9645
 
9646
- var _listStyle = __webpack_require__(8);
9647
-
9648
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9649
 
9650
- var NodeParser = exports.NodeParser = function NodeParser(node, resourceLoader, logger) {
9651
- if (true) {
9652
- logger.log('Starting node parsing');
9653
- }
9654
-
9655
- var index = 0;
9656
 
9657
- var container = new _NodeContainer2.default(node, null, resourceLoader, index++);
9658
- var stack = new _StackingContext2.default(container, null, true);
9659
 
9660
- parseNodeTree(node, container, stack, resourceLoader, index);
 
 
9661
 
9662
- if (true) {
9663
- logger.log('Finished parsing node tree');
9664
- }
9665
 
9666
- return stack;
9667
- };
 
 
 
 
 
 
 
 
 
 
 
9668
 
9669
- var IGNORED_NODE_NAMES = ['SCRIPT', 'HEAD', 'TITLE', 'OBJECT', 'BR', 'OPTION'];
9670
 
9671
- var parseNodeTree = function parseNodeTree(node, parent, stack, resourceLoader, index) {
9672
- if (true && index > 50000) {
9673
- throw new Error('Recursion error while parsing node tree');
9674
- }
9675
 
9676
- for (var childNode = node.firstChild, nextNode; childNode; childNode = nextNode) {
9677
- nextNode = childNode.nextSibling;
9678
- var defaultView = childNode.ownerDocument.defaultView;
9679
- if (childNode instanceof defaultView.Text || childNode instanceof Text || defaultView.parent && childNode instanceof defaultView.parent.Text) {
9680
- if (childNode.data.trim().length > 0) {
9681
- parent.childNodes.push(_TextContainer2.default.fromTextNode(childNode, parent));
9682
- }
9683
- } else if (childNode instanceof defaultView.HTMLElement || childNode instanceof HTMLElement || defaultView.parent && childNode instanceof defaultView.parent.HTMLElement) {
9684
- if (IGNORED_NODE_NAMES.indexOf(childNode.nodeName) === -1) {
9685
- var container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++);
9686
- if (container.isVisible()) {
9687
- if (childNode.tagName === 'INPUT') {
9688
- // $FlowFixMe
9689
- (0, _Input.inlineInputElement)(childNode, container);
9690
- } else if (childNode.tagName === 'TEXTAREA') {
9691
- // $FlowFixMe
9692
- (0, _Input.inlineTextAreaElement)(childNode, container);
9693
- } else if (childNode.tagName === 'SELECT') {
9694
- // $FlowFixMe
9695
- (0, _Input.inlineSelectElement)(childNode, container);
9696
- } else if (container.style.listStyle && container.style.listStyle.listStyleType !== _listStyle.LIST_STYLE_TYPE.NONE) {
9697
- (0, _ListItem.inlineListItemElement)(childNode, container, resourceLoader);
9698
- }
 
 
9699
 
9700
- var SHOULD_TRAVERSE_CHILDREN = childNode.tagName !== 'TEXTAREA';
9701
- var treatAsRealStackingContext = createsRealStackingContext(container, childNode);
9702
- if (treatAsRealStackingContext || createsStackingContext(container)) {
9703
- // for treatAsRealStackingContext:false, any positioned descendants and descendants
9704
- // which actually create a new stacking context should be considered part of the parent stacking context
9705
- var parentStack = treatAsRealStackingContext || container.isPositioned() ? stack.getRealParentStackingContext() : stack;
9706
- var childStack = new _StackingContext2.default(container, parentStack, treatAsRealStackingContext);
9707
- parentStack.contexts.push(childStack);
9708
- if (SHOULD_TRAVERSE_CHILDREN) {
9709
- parseNodeTree(childNode, container, childStack, resourceLoader, index);
9710
- }
9711
- } else {
9712
- stack.children.push(container);
9713
- if (SHOULD_TRAVERSE_CHILDREN) {
9714
- parseNodeTree(childNode, container, stack, resourceLoader, index);
9715
- }
9716
- }
9717
- }
9718
- }
9719
- } else if (childNode instanceof defaultView.SVGSVGElement || childNode instanceof SVGSVGElement || defaultView.parent && childNode instanceof defaultView.parent.SVGSVGElement) {
9720
- var _container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++);
9721
- var _treatAsRealStackingContext = createsRealStackingContext(_container, childNode);
9722
- if (_treatAsRealStackingContext || createsStackingContext(_container)) {
9723
- // for treatAsRealStackingContext:false, any positioned descendants and descendants
9724
- // which actually create a new stacking context should be considered part of the parent stacking context
9725
- var _parentStack = _treatAsRealStackingContext || _container.isPositioned() ? stack.getRealParentStackingContext() : stack;
9726
- var _childStack = new _StackingContext2.default(_container, _parentStack, _treatAsRealStackingContext);
9727
- _parentStack.contexts.push(_childStack);
9728
- } else {
9729
- stack.children.push(_container);
9730
  }
9731
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9732
  }
9733
- };
9734
 
9735
- var createsRealStackingContext = function createsRealStackingContext(container, node) {
9736
- return container.isRootElement() || container.isPositionedWithZIndex() || container.style.opacity < 1 || container.isTransformed() || isBodyWithTransparentRoot(container, node);
9737
- };
 
 
9738
 
9739
- var createsStackingContext = function createsStackingContext(container) {
9740
- return container.isPositioned() || container.isFloating();
9741
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9742
 
9743
- var isBodyWithTransparentRoot = function isBodyWithTransparentRoot(container, node) {
9744
- return node.nodeName === 'BODY' && container.parent instanceof _NodeContainer2.default && container.parent.style.background.backgroundColor.isTransparent();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9745
  };
9746
 
9747
  /***/ }),
9748
- /* 30 */
9749
  /***/ (function(module, exports, __webpack_require__) {
9750
 
9751
  "use strict";
@@ -9754,49 +10523,30 @@ var isBodyWithTransparentRoot = function isBodyWithTransparentRoot(container, no
9754
  Object.defineProperty(exports, "__esModule", {
9755
  value: true
9756
  });
 
 
 
9757
 
9758
- var _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; }; }();
9759
-
9760
- var _NodeContainer = __webpack_require__(3);
9761
-
9762
- var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
9763
-
9764
- var _position = __webpack_require__(19);
9765
-
9766
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9767
-
9768
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9769
-
9770
- var StackingContext = function () {
9771
- function StackingContext(container, parent, treatAsRealStackingContext) {
9772
- _classCallCheck(this, StackingContext);
9773
-
9774
- this.container = container;
9775
- this.parent = parent;
9776
- this.contexts = [];
9777
- this.children = [];
9778
- this.treatAsRealStackingContext = treatAsRealStackingContext;
9779
- }
9780
 
9781
- _createClass(StackingContext, [{
9782
- key: 'getOpacity',
9783
- value: function getOpacity() {
9784
- return this.parent ? this.container.style.opacity * this.parent.getOpacity() : this.container.style.opacity;
9785
- }
9786
- }, {
9787
- key: 'getRealParentStackingContext',
9788
- value: function getRealParentStackingContext() {
9789
- return !this.parent || this.treatAsRealStackingContext ? this : this.parent.getRealParentStackingContext();
9790
  }
9791
- }]);
9792
-
9793
- return StackingContext;
9794
- }();
9795
 
9796
- exports.default = StackingContext;
9797
 
9798
  /***/ }),
9799
- /* 31 */
9800
  /***/ (function(module, exports, __webpack_require__) {
9801
 
9802
  "use strict";
@@ -9805,232 +10555,357 @@ exports.default = StackingContext;
9805
  Object.defineProperty(exports, "__esModule", {
9806
  value: true
9807
  });
 
9808
 
9809
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9810
 
9811
- var Size = function Size(width, height) {
9812
- _classCallCheck(this, Size);
9813
-
9814
- this.width = width;
9815
- this.height = height;
9816
- };
9817
-
9818
- exports.default = Size;
9819
-
9820
- /***/ }),
9821
- /* 32 */
9822
- /***/ (function(module, exports, __webpack_require__) {
9823
-
9824
- "use strict";
9825
 
 
9826
 
9827
- Object.defineProperty(exports, "__esModule", {
9828
- value: true
9829
- });
9830
 
9831
- var _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; }; }();
9832
 
9833
- var _Path = __webpack_require__(6);
9834
 
9835
  var _Vector = __webpack_require__(7);
9836
 
9837
  var _Vector2 = _interopRequireDefault(_Vector);
9838
 
 
 
 
 
9839
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9840
 
9841
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9842
 
9843
- var lerp = function lerp(a, b, t) {
9844
- return new _Vector2.default(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t);
 
 
 
9845
  };
9846
 
9847
- var BezierCurve = function () {
9848
- function BezierCurve(start, startControl, endControl, end) {
9849
- _classCallCheck(this, BezierCurve);
 
 
 
9850
 
9851
- this.type = _Path.PATH.BEZIER_CURVE;
9852
- this.start = start;
9853
- this.startControl = startControl;
9854
- this.endControl = endControl;
9855
- this.end = end;
9856
- }
9857
 
9858
- _createClass(BezierCurve, [{
9859
- key: 'subdivide',
9860
- value: function subdivide(t, firstHalf) {
9861
- var ab = lerp(this.start, this.startControl, t);
9862
- var bc = lerp(this.startControl, this.endControl, t);
9863
- var cd = lerp(this.endControl, this.end, t);
9864
- var abbc = lerp(ab, bc, t);
9865
- var bccd = lerp(bc, cd, t);
9866
- var dest = lerp(abbc, bccd, t);
9867
- return firstHalf ? new BezierCurve(this.start, ab, abbc, dest) : new BezierCurve(dest, bccd, cd, this.end);
9868
- }
9869
- }, {
9870
- key: 'reverse',
9871
- value: function reverse() {
9872
- return new BezierCurve(this.end, this.endControl, this.startControl, this.start);
9873
- }
9874
- }]);
9875
 
9876
- return BezierCurve;
9877
- }();
9878
 
9879
- exports.default = BezierCurve;
 
9880
 
9881
- /***/ }),
9882
- /* 33 */
9883
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
9884
 
9885
- "use strict";
 
 
 
 
 
 
 
 
9886
 
 
 
 
9887
 
9888
- Object.defineProperty(exports, "__esModule", {
9889
- value: true
9890
- });
9891
- exports.parseBorderRadius = undefined;
 
 
 
9892
 
9893
- var _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"); } }; }();
 
 
9894
 
9895
- var _Length = __webpack_require__(1);
 
9896
 
9897
- var _Length2 = _interopRequireDefault(_Length);
 
 
 
9898
 
9899
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
9900
 
9901
- var SIDES = ['top-left', 'top-right', 'bottom-right', 'bottom-left'];
9902
 
9903
- var parseBorderRadius = exports.parseBorderRadius = function parseBorderRadius(style) {
9904
- return SIDES.map(function (side) {
9905
- var value = style.getPropertyValue('border-' + side + '-radius');
 
 
 
 
 
 
9906
 
9907
- var _value$split$map = value.split(' ').map(_Length2.default.create),
9908
- _value$split$map2 = _slicedToArray(_value$split$map, 2),
9909
- horizontal = _value$split$map2[0],
9910
- vertical = _value$split$map2[1];
9911
 
9912
- return typeof vertical === 'undefined' ? [horizontal, horizontal] : [horizontal, vertical];
9913
- });
 
 
 
 
 
 
 
 
 
 
 
9914
  };
9915
 
9916
- /***/ }),
9917
- /* 34 */
9918
- /***/ (function(module, exports, __webpack_require__) {
9919
 
9920
- "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
9921
 
 
 
 
 
 
 
 
 
9922
 
9923
- Object.defineProperty(exports, "__esModule", {
9924
- value: true
9925
- });
9926
- var DISPLAY = exports.DISPLAY = {
9927
- NONE: 1 << 0,
9928
- BLOCK: 1 << 1,
9929
- INLINE: 1 << 2,
9930
- RUN_IN: 1 << 3,
9931
- FLOW: 1 << 4,
9932
- FLOW_ROOT: 1 << 5,
9933
- TABLE: 1 << 6,
9934
- FLEX: 1 << 7,
9935
- GRID: 1 << 8,
9936
- RUBY: 1 << 9,
9937
- SUBGRID: 1 << 10,
9938
- LIST_ITEM: 1 << 11,
9939
- TABLE_ROW_GROUP: 1 << 12,
9940
- TABLE_HEADER_GROUP: 1 << 13,
9941
- TABLE_FOOTER_GROUP: 1 << 14,
9942
- TABLE_ROW: 1 << 15,
9943
- TABLE_CELL: 1 << 16,
9944
- TABLE_COLUMN_GROUP: 1 << 17,
9945
- TABLE_COLUMN: 1 << 18,
9946
- TABLE_CAPTION: 1 << 19,
9947
- RUBY_BASE: 1 << 20,
9948
- RUBY_TEXT: 1 << 21,
9949
- RUBY_BASE_CONTAINER: 1 << 22,
9950
- RUBY_TEXT_CONTAINER: 1 << 23,
9951
- CONTENTS: 1 << 24,
9952
- INLINE_BLOCK: 1 << 25,
9953
- INLINE_LIST_ITEM: 1 << 26,
9954
- INLINE_TABLE: 1 << 27,
9955
- INLINE_FLEX: 1 << 28,
9956
- INLINE_GRID: 1 << 29
9957
  };
9958
 
9959
- var parseDisplayValue = function parseDisplayValue(display) {
9960
- switch (display) {
9961
- case 'block':
9962
- return DISPLAY.BLOCK;
9963
- case 'inline':
9964
- return DISPLAY.INLINE;
9965
- case 'run-in':
9966
- return DISPLAY.RUN_IN;
9967
- case 'flow':
9968
- return DISPLAY.FLOW;
9969
- case 'flow-root':
9970
- return DISPLAY.FLOW_ROOT;
9971
- case 'table':
9972
- return DISPLAY.TABLE;
9973
- case 'flex':
9974
- return DISPLAY.FLEX;
9975
- case 'grid':
9976
- return DISPLAY.GRID;
9977
- case 'ruby':
9978
- return DISPLAY.RUBY;
9979
- case 'subgrid':
9980
- return DISPLAY.SUBGRID;
9981
- case 'list-item':
9982
- return DISPLAY.LIST_ITEM;
9983
- case 'table-row-group':
9984
- return DISPLAY.TABLE_ROW_GROUP;
9985
- case 'table-header-group':
9986
- return DISPLAY.TABLE_HEADER_GROUP;
9987
- case 'table-footer-group':
9988
- return DISPLAY.TABLE_FOOTER_GROUP;
9989
- case 'table-row':
9990
- return DISPLAY.TABLE_ROW;
9991
- case 'table-cell':
9992
- return DISPLAY.TABLE_CELL;
9993
- case 'table-column-group':
9994
- return DISPLAY.TABLE_COLUMN_GROUP;
9995
- case 'table-column':
9996
- return DISPLAY.TABLE_COLUMN;
9997
- case 'table-caption':
9998
- return DISPLAY.TABLE_CAPTION;
9999
- case 'ruby-base':
10000
- return DISPLAY.RUBY_BASE;
10001
- case 'ruby-text':
10002
- return DISPLAY.RUBY_TEXT;
10003
- case 'ruby-base-container':
10004
- return DISPLAY.RUBY_BASE_CONTAINER;
10005
- case 'ruby-text-container':
10006
- return DISPLAY.RUBY_TEXT_CONTAINER;
10007
- case 'contents':
10008
- return DISPLAY.CONTENTS;
10009
- case 'inline-block':
10010
- return DISPLAY.INLINE_BLOCK;
10011
- case 'inline-list-item':
10012
- return DISPLAY.INLINE_LIST_ITEM;
10013
- case 'inline-table':
10014
- return DISPLAY.INLINE_TABLE;
10015
- case 'inline-flex':
10016
- return DISPLAY.INLINE_FLEX;
10017
- case 'inline-grid':
10018
- return DISPLAY.INLINE_GRID;
10019
  }
 
 
10020
 
10021
- return DISPLAY.NONE;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10022
  };
10023
 
10024
- var setDisplayBit = function setDisplayBit(bit, display) {
10025
- return bit | parseDisplayValue(display);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10026
  };
10027
 
10028
- var parseDisplay = exports.parseDisplay = function parseDisplay(display) {
10029
- return display.split(' ').reduce(setDisplayBit, 0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10030
  };
10031
 
10032
  /***/ }),
10033
- /* 35 */
10034
  /***/ (function(module, exports, __webpack_require__) {
10035
 
10036
  "use strict";
@@ -10039,30 +10914,14 @@ var parseDisplay = exports.parseDisplay = function parseDisplay(display) {
10039
  Object.defineProperty(exports, "__esModule", {
10040
  value: true
10041
  });
10042
- var FLOAT = exports.FLOAT = {
10043
- NONE: 0,
10044
- LEFT: 1,
10045
- RIGHT: 2,
10046
- INLINE_START: 3,
10047
- INLINE_END: 4
10048
- };
10049
-
10050
- var parseCSSFloat = exports.parseCSSFloat = function parseCSSFloat(float) {
10051
- switch (float) {
10052
- case 'left':
10053
- return FLOAT.LEFT;
10054
- case 'right':
10055
- return FLOAT.RIGHT;
10056
- case 'inline-start':
10057
- return FLOAT.INLINE_START;
10058
- case 'inline-end':
10059
- return FLOAT.INLINE_END;
10060
- }
10061
- return FLOAT.NONE;
10062
  };
10063
 
10064
  /***/ }),
10065
- /* 36 */
10066
  /***/ (function(module, exports, __webpack_require__) {
10067
 
10068
  "use strict";
@@ -10072,37 +10931,30 @@ Object.defineProperty(exports, "__esModule", {
10072
  value: true
10073
  });
10074
 
 
10075
 
10076
- var parseFontWeight = function parseFontWeight(weight) {
10077
- switch (weight) {
10078
- case 'normal':
10079
- return 400;
10080
- case 'bold':
10081
- return 700;
10082
- }
10083
 
10084
- var value = parseInt(weight, 10);
10085
- return isNaN(value) ? 400 : value;
10086
- };
10087
-
10088
- var parseFont = exports.parseFont = function parseFont(style) {
10089
- var fontFamily = style.fontFamily;
10090
- var fontSize = style.fontSize;
10091
- var fontStyle = style.fontStyle;
10092
- var fontVariant = style.fontVariant;
10093
- var fontWeight = parseFontWeight(style.fontWeight);
10094
 
10095
- return {
10096
- fontFamily: fontFamily,
10097
- fontSize: fontSize,
10098
- fontStyle: fontStyle,
10099
- fontVariant: fontVariant,
10100
- fontWeight: fontWeight
10101
- };
 
 
 
 
10102
  };
10103
 
 
 
10104
  /***/ }),
10105
- /* 37 */
10106
  /***/ (function(module, exports, __webpack_require__) {
10107
 
10108
  "use strict";
@@ -10111,41 +10963,207 @@ var parseFont = exports.parseFont = function parseFont(style) {
10111
  Object.defineProperty(exports, "__esModule", {
10112
  value: true
10113
  });
10114
- var parseLetterSpacing = exports.parseLetterSpacing = function parseLetterSpacing(letterSpacing) {
10115
- if (letterSpacing === 'normal') {
10116
- return 0;
10117
- }
10118
- var value = parseFloat(letterSpacing);
10119
- return isNaN(value) ? 0 : value;
10120
- };
10121
 
10122
- /***/ }),
10123
- /* 38 */
10124
- /***/ (function(module, exports, __webpack_require__) {
10125
 
10126
- "use strict";
 
 
 
10127
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10128
 
10129
- Object.defineProperty(exports, "__esModule", {
10130
- value: true
10131
- });
10132
- var LINE_BREAK = exports.LINE_BREAK = {
10133
- NORMAL: 'normal',
10134
- STRICT: 'strict'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10135
  };
10136
 
10137
- var parseLineBreak = exports.parseLineBreak = function parseLineBreak(wordBreak) {
10138
- switch (wordBreak) {
10139
- case 'strict':
10140
- return LINE_BREAK.STRICT;
10141
- case 'normal':
 
 
 
 
 
 
 
 
 
10142
  default:
10143
- return LINE_BREAK.NORMAL;
10144
  }
10145
  };
10146
 
10147
  /***/ }),
10148
- /* 39 */
10149
  /***/ (function(module, exports, __webpack_require__) {
10150
 
10151
  "use strict";
@@ -10154,55 +11172,63 @@ var parseLineBreak = exports.parseLineBreak = function parseLineBreak(wordBreak)
10154
  Object.defineProperty(exports, "__esModule", {
10155
  value: true
10156
  });
10157
- exports.parseMargin = undefined;
10158
 
10159
- var _Length = __webpack_require__(1);
10160
 
10161
- var _Length2 = _interopRequireDefault(_Length);
10162
 
10163
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10164
 
10165
- var SIDES = ['top', 'right', 'bottom', 'left'];
10166
 
10167
- var parseMargin = exports.parseMargin = function parseMargin(style) {
10168
- return SIDES.map(function (side) {
10169
- return new _Length2.default(style.getPropertyValue('margin-' + side));
10170
- });
10171
- };
10172
 
10173
- /***/ }),
10174
- /* 40 */
10175
- /***/ (function(module, exports, __webpack_require__) {
 
10176
 
10177
- "use strict";
 
 
 
 
 
 
10178
 
 
 
10179
 
10180
- Object.defineProperty(exports, "__esModule", {
10181
- value: true
10182
- });
10183
- var OVERFLOW = exports.OVERFLOW = {
10184
- VISIBLE: 0,
10185
- HIDDEN: 1,
10186
- SCROLL: 2,
10187
- AUTO: 3
10188
- };
10189
 
10190
- var parseOverflow = exports.parseOverflow = function parseOverflow(overflow) {
10191
- switch (overflow) {
10192
- case 'hidden':
10193
- return OVERFLOW.HIDDEN;
10194
- case 'scroll':
10195
- return OVERFLOW.SCROLL;
10196
- case 'auto':
10197
- return OVERFLOW.AUTO;
10198
- case 'visible':
 
 
10199
  default:
10200
- return OVERFLOW.VISIBLE;
10201
  }
10202
  };
10203
 
 
 
 
 
 
 
 
 
10204
  /***/ }),
10205
- /* 41 */
10206
  /***/ (function(module, exports, __webpack_require__) {
10207
 
10208
  "use strict";
@@ -10211,200 +11237,197 @@ var parseOverflow = exports.parseOverflow = function parseOverflow(overflow) {
10211
  Object.defineProperty(exports, "__esModule", {
10212
  value: true
10213
  });
10214
- exports.parseTextShadow = undefined;
10215
-
10216
- var _Color = __webpack_require__(0);
10217
-
10218
- var _Color2 = _interopRequireDefault(_Color);
10219
 
10220
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10221
-
10222
- var NUMBER = /^([+-]|\d|\.)$/i;
10223
 
10224
- var parseTextShadow = exports.parseTextShadow = function parseTextShadow(textShadow) {
10225
- if (textShadow === 'none' || typeof textShadow !== 'string') {
10226
- return null;
10227
- }
10228
 
10229
- var currentValue = '';
10230
- var isLength = false;
10231
- var values = [];
10232
- var shadows = [];
10233
- var numParens = 0;
10234
- var color = null;
 
10235
 
10236
- var appendValue = function appendValue() {
10237
- if (currentValue.length) {
10238
- if (isLength) {
10239
- values.push(parseFloat(currentValue));
10240
- } else {
10241
- color = new _Color2.default(currentValue);
10242
  }
10243
  }
10244
- isLength = false;
10245
- currentValue = '';
10246
- };
10247
-
10248
- var appendShadow = function appendShadow() {
10249
- if (values.length && color !== null) {
10250
- shadows.push({
10251
- color: color,
10252
- offsetX: values[0] || 0,
10253
- offsetY: values[1] || 0,
10254
- blur: values[2] || 0
10255
- });
10256
- }
10257
- values.splice(0, values.length);
10258
- color = null;
10259
- };
10260
-
10261
- for (var i = 0; i < textShadow.length; i++) {
10262
- var c = textShadow[i];
10263
- switch (c) {
10264
- case '(':
10265
- currentValue += c;
10266
- numParens++;
10267
- break;
10268
- case ')':
10269
- currentValue += c;
10270
- numParens--;
10271
- break;
10272
- case ',':
10273
- if (numParens === 0) {
10274
- appendValue();
10275
- appendShadow();
10276
- } else {
10277
- currentValue += c;
10278
- }
10279
- break;
10280
- case ' ':
10281
- if (numParens === 0) {
10282
- appendValue();
10283
- } else {
10284
- currentValue += c;
10285
- }
10286
- break;
10287
- default:
10288
- if (currentValue.length === 0 && NUMBER.test(c)) {
10289
- isLength = true;
10290
- }
10291
- currentValue += c;
10292
- }
10293
- }
10294
-
10295
- appendValue();
10296
- appendShadow();
10297
-
10298
- if (shadows.length === 0) {
10299
- return null;
10300
  }
10301
 
10302
- return shadows;
10303
  };
10304
 
10305
- /***/ }),
10306
- /* 42 */
10307
- /***/ (function(module, exports, __webpack_require__) {
 
 
10308
 
10309
- "use strict";
 
 
10310
 
 
 
 
 
 
 
 
10311
 
10312
- Object.defineProperty(exports, "__esModule", {
10313
- value: true
10314
- });
10315
- exports.parseTransform = undefined;
10316
 
10317
- var _Length = __webpack_require__(1);
 
 
 
10318
 
10319
- var _Length2 = _interopRequireDefault(_Length);
 
 
 
 
 
 
10320
 
10321
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
10322
 
10323
- var toFloat = function toFloat(s) {
10324
- return parseFloat(s.trim());
10325
  };
10326
 
10327
- var MATRIX = /(matrix|matrix3d)\((.+)\)/;
 
 
 
 
10328
 
10329
- var parseTransform = exports.parseTransform = function parseTransform(style) {
10330
- var transform = parseTransformMatrix(style.transform || style.webkitTransform || style.mozTransform ||
10331
- // $FlowFixMe
10332
- style.msTransform ||
10333
- // $FlowFixMe
10334
- style.oTransform);
10335
- if (transform === null) {
10336
- return null;
10337
  }
10338
-
10339
- return {
10340
- transform: transform,
10341
- transformOrigin: parseTransformOrigin(style.transformOrigin || style.webkitTransformOrigin || style.mozTransformOrigin ||
10342
- // $FlowFixMe
10343
- style.msTransformOrigin ||
10344
- // $FlowFixMe
10345
- style.oTransformOrigin)
10346
- };
10347
  };
10348
 
10349
- // $FlowFixMe
10350
- var parseTransformOrigin = function parseTransformOrigin(origin) {
10351
- if (typeof origin !== 'string') {
10352
- var v = new _Length2.default('0');
10353
- return [v, v];
10354
- }
10355
- var values = origin.split(' ').map(_Length2.default.create);
10356
- return [values[0], values[1]];
10357
  };
10358
 
10359
- // $FlowFixMe
10360
- var parseTransformMatrix = function parseTransformMatrix(transform) {
10361
- if (transform === 'none' || typeof transform !== 'string') {
10362
- return null;
10363
- }
10364
-
10365
- var match = transform.match(MATRIX);
10366
- if (match) {
10367
- if (match[1] === 'matrix') {
10368
- var matrix = match[2].split(',').map(toFloat);
10369
- return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]];
10370
- } else {
10371
- var matrix3d = match[2].split(',').map(toFloat);
10372
- return [matrix3d[0], matrix3d[1], matrix3d[4], matrix3d[5], matrix3d[12], matrix3d[13]];
10373
- }
10374
- }
10375
- return null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10376
  };
10377
 
10378
- /***/ }),
10379
- /* 43 */
10380
- /***/ (function(module, exports, __webpack_require__) {
 
10381
 
10382
- "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10383
 
 
 
 
 
 
 
 
 
 
 
 
10384
 
10385
- Object.defineProperty(exports, "__esModule", {
10386
- value: true
10387
- });
10388
- var VISIBILITY = exports.VISIBILITY = {
10389
- VISIBLE: 0,
10390
- HIDDEN: 1,
10391
- COLLAPSE: 2
10392
- };
10393
 
10394
- var parseVisibility = exports.parseVisibility = function parseVisibility(visibility) {
10395
- switch (visibility) {
10396
- case 'hidden':
10397
- return VISIBILITY.HIDDEN;
10398
- case 'collapse':
10399
- return VISIBILITY.COLLAPSE;
10400
- case 'visible':
10401
- default:
10402
- return VISIBILITY.VISIBLE;
 
 
 
 
 
 
 
 
 
 
10403
  }
10404
  };
10405
 
 
 
10406
  /***/ }),
10407
- /* 44 */
10408
  /***/ (function(module, exports, __webpack_require__) {
10409
 
10410
  "use strict";
@@ -10413,79 +11436,85 @@ var parseVisibility = exports.parseVisibility = function parseVisibility(visibil
10413
  Object.defineProperty(exports, "__esModule", {
10414
  value: true
10415
  });
10416
- var WORD_BREAK = exports.WORD_BREAK = {
10417
- NORMAL: 'normal',
10418
- BREAK_ALL: 'break-all',
10419
- KEEP_ALL: 'keep-all'
10420
- };
10421
 
10422
- var parseWordBreak = exports.parseWordBreak = function parseWordBreak(wordBreak) {
10423
- switch (wordBreak) {
10424
- case 'break-all':
10425
- return WORD_BREAK.BREAK_ALL;
10426
- case 'keep-all':
10427
- return WORD_BREAK.KEEP_ALL;
10428
- case 'normal':
10429
- default:
10430
- return WORD_BREAK.NORMAL;
10431
- }
10432
- };
10433
 
10434
- /***/ }),
10435
- /* 45 */
10436
- /***/ (function(module, exports, __webpack_require__) {
10437
 
10438
- "use strict";
10439
 
 
 
 
 
 
 
 
10440
 
10441
- Object.defineProperty(exports, "__esModule", {
10442
- value: true
10443
- });
10444
- var parseZIndex = exports.parseZIndex = function parseZIndex(zIndex) {
10445
- var auto = zIndex === 'auto';
10446
- return {
10447
- auto: auto,
10448
- order: auto ? 0 : parseInt(zIndex, 10)
10449
- };
10450
  };
10451
 
10452
- /***/ }),
10453
- /* 46 */
10454
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
10455
 
10456
- "use strict";
 
 
 
 
 
 
 
 
 
 
10457
 
 
 
 
 
10458
 
10459
- Object.defineProperty(exports, "__esModule", {
10460
- value: true
10461
- });
10462
 
10463
- var _Util = __webpack_require__(13);
 
 
 
 
 
 
 
 
 
 
 
 
10464
 
10465
- Object.defineProperty(exports, 'toCodePoints', {
10466
- enumerable: true,
10467
- get: function get() {
10468
- return _Util.toCodePoints;
10469
- }
10470
- });
10471
- Object.defineProperty(exports, 'fromCodePoint', {
10472
- enumerable: true,
10473
- get: function get() {
10474
- return _Util.fromCodePoint;
10475
- }
10476
- });
10477
 
10478
- var _LineBreak = __webpack_require__(47);
 
10479
 
10480
- Object.defineProperty(exports, 'LineBreaker', {
10481
- enumerable: true,
10482
- get: function get() {
10483
- return _LineBreak.LineBreaker;
10484
- }
10485
- });
10486
 
10487
  /***/ }),
10488
- /* 47 */
10489
  /***/ (function(module, exports, __webpack_require__) {
10490
 
10491
  "use strict";
@@ -10494,613 +11523,497 @@ Object.defineProperty(exports, 'LineBreaker', {
10494
  Object.defineProperty(exports, "__esModule", {
10495
  value: true
10496
  });
10497
- exports.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;
10498
-
10499
- var _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; }; }();
10500
 
10501
- var _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"); } }; }();
10502
 
10503
- var _Trie = __webpack_require__(48);
10504
 
10505
- var _linebreakTrie = __webpack_require__(49);
10506
 
10507
- var _linebreakTrie2 = _interopRequireDefault(_linebreakTrie);
 
 
 
10508
 
10509
- var _Util = __webpack_require__(13);
 
 
 
 
 
10510
 
10511
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
10512
 
10513
- function _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); } }
 
 
 
 
 
 
10514
 
10515
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
 
 
 
 
 
10516
 
10517
- var LETTER_NUMBER_MODIFIER = exports.LETTER_NUMBER_MODIFIER = 50;
 
 
10518
 
10519
- // Non-tailorable Line Breaking Classes
10520
- var BK = 1; // Cause a line break (after)
10521
- var CR = 2; // Cause a line break (after), except between CR and LF
10522
- var LF = 3; // Cause a line break (after)
10523
- var CM = 4; // Prohibit a line break between the character and the preceding character
10524
- var NL = 5; // Cause a line break (after)
10525
- var SG = 6; // Do not occur in well-formed text
10526
- var WJ = 7; // Prohibit line breaks before and after
10527
- var ZW = 8; // Provide a break opportunity
10528
- var GL = 9; // Prohibit line breaks before and after
10529
- var SP = 10; // Enable indirect line breaks
10530
- var ZWJ = 11; // Prohibit line breaks within joiner sequences
10531
- // Break Opportunities
10532
- var B2 = 12; // Provide a line break opportunity before and after the character
10533
- var BA = 13; // Generally provide a line break opportunity after the character
10534
- var BB = 14; // Generally provide a line break opportunity before the character
10535
- var HY = 15; // Provide a line break opportunity after the character, except in numeric context
10536
- var CB = 16; // Provide a line break opportunity contingent on additional information
10537
- // Characters Prohibiting Certain Breaks
10538
- var CL = 17; // Prohibit line breaks before
10539
- var CP = 18; // Prohibit line breaks before
10540
- var EX = 19; // Prohibit line breaks before
10541
- var IN = 20; // Allow only indirect line breaks between pairs
10542
- var NS = 21; // Allow only indirect line breaks before
10543
- var OP = 22; // Prohibit line breaks after
10544
- var QU = 23; // Act like they are both opening and closing
10545
- // Numeric Context
10546
- var IS = 24; // Prevent breaks after any and before numeric
10547
- var NU = 25; // Form numeric expressions for line breaking purposes
10548
- var PO = 26; // Do not break following a numeric expression
10549
- var PR = 27; // Do not break in front of a numeric expression
10550
- var SY = 28; // Prevent a break before; and allow a break after
10551
- // Other Characters
10552
- var AI = 29; // Act like AL when the resolvedEAW is N; otherwise; act as ID
10553
- var AL = 30; // Are alphabetic characters or symbols that are used with alphabetic characters
10554
- var CJ = 31; // Treat as NS or ID for strict or normal breaking.
10555
- var EB = 32; // Do not break from following Emoji Modifier
10556
- var EM = 33; // Do not break from preceding Emoji Base
10557
- var H2 = 34; // Form Korean syllable blocks
10558
- var H3 = 35; // Form Korean syllable blocks
10559
- var HL = 36; // Do not break around a following hyphen; otherwise act as Alphabetic
10560
- var ID = 37; // Break before or after; except in some numeric context
10561
- var JL = 38; // Form Korean syllable blocks
10562
- var JV = 39; // Form Korean syllable blocks
10563
- var JT = 40; // Form Korean syllable blocks
10564
- var RI = 41; // Keep pairs together. For pairs; break before and after other classes
10565
- var SA = 42; // Provide a line break opportunity contingent on additional, language-specific context analysis
10566
- var XX = 43; // Have as yet unknown line breaking behavior or unassigned code positions
10567
 
10568
- var classes = exports.classes = {
10569
- BK: BK,
10570
- CR: CR,
10571
- LF: LF,
10572
- CM: CM,
10573
- NL: NL,
10574
- SG: SG,
10575
- WJ: WJ,
10576
- ZW: ZW,
10577
- GL: GL,
10578
- SP: SP,
10579
- ZWJ: ZWJ,
10580
- B2: B2,
10581
- BA: BA,
10582
- BB: BB,
10583
- HY: HY,
10584
- CB: CB,
10585
- CL: CL,
10586
- CP: CP,
10587
- EX: EX,
10588
- IN: IN,
10589
- NS: NS,
10590
- OP: OP,
10591
- QU: QU,
10592
- IS: IS,
10593
- NU: NU,
10594
- PO: PO,
10595
- PR: PR,
10596
- SY: SY,
10597
- AI: AI,
10598
- AL: AL,
10599
- CJ: CJ,
10600
- EB: EB,
10601
- EM: EM,
10602
- H2: H2,
10603
- H3: H3,
10604
- HL: HL,
10605
- ID: ID,
10606
- JL: JL,
10607
- JV: JV,
10608
- JT: JT,
10609
- RI: RI,
10610
- SA: SA,
10611
- XX: XX
10612
  };
10613
 
10614
- var BREAK_MANDATORY = exports.BREAK_MANDATORY = '!';
10615
- var BREAK_NOT_ALLOWED = exports.BREAK_NOT_ALLOWED = '×';
10616
- var BREAK_ALLOWED = exports.BREAK_ALLOWED = '÷';
10617
- var UnicodeTrie = exports.UnicodeTrie = (0, _Trie.createTrieFromBase64)(_linebreakTrie2.default);
10618
 
10619
- var ALPHABETICS = [AL, HL];
10620
- var HARD_LINE_BREAKS = [BK, CR, LF, NL];
10621
- var SPACE = [SP, ZW];
10622
- var PREFIX_POSTFIX = [PR, PO];
10623
- var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE);
10624
- var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];
10625
- var HYPHEN = [HY, BA];
10626
 
10627
- var codePointsToCharacterClasses = exports.codePointsToCharacterClasses = function codePointsToCharacterClasses(codePoints) {
10628
- var lineBreak = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'strict';
10629
 
10630
- var types = [];
10631
- var indicies = [];
10632
- var categories = [];
10633
- codePoints.forEach(function (codePoint, index) {
10634
- var classType = UnicodeTrie.get(codePoint);
10635
- if (classType > LETTER_NUMBER_MODIFIER) {
10636
- categories.push(true);
10637
- classType -= LETTER_NUMBER_MODIFIER;
10638
  } else {
10639
- categories.push(false);
 
10640
  }
10641
-
10642
- if (['normal', 'auto', 'loose'].indexOf(lineBreak) !== -1) {
10643
- // U+2010, – U+2013, 〜 U+301C, ゠ U+30A0
10644
- if ([0x2010, 0x2013, 0x301c, 0x30a0].indexOf(codePoint) !== -1) {
10645
- indicies.push(index);
10646
- return types.push(CB);
10647
- }
10648
  }
 
 
 
10649
 
10650
- if (classType === CM || classType === ZWJ) {
10651
- // LB10 Treat any remaining combining mark or ZWJ as AL.
10652
- if (index === 0) {
10653
- indicies.push(index);
10654
- return types.push(AL);
10655
- }
10656
 
10657
- // LB9 Do not break a combining character sequence; treat it as if it has the line breaking class of
10658
- // the base character in all of the following rules. Treat ZWJ as if it were CM.
10659
- var prev = types[index - 1];
10660
- if (LINE_BREAKS.indexOf(prev) === -1) {
10661
- indicies.push(indicies[index - 1]);
10662
- return types.push(prev);
10663
- }
10664
- indicies.push(index);
10665
- return types.push(AL);
10666
- }
10667
 
10668
- indicies.push(index);
 
 
 
 
 
 
 
 
10669
 
10670
- if (classType === CJ) {
10671
- return types.push(lineBreak === 'strict' ? NS : ID);
 
 
10672
  }
 
10673
 
10674
- if (classType === SA) {
10675
- return types.push(AL);
10676
- }
10677
 
10678
- if (classType === AI) {
10679
- return types.push(AL);
10680
- }
10681
-
10682
- // For supplementary characters, a useful default is to treat characters in the range 10000..1FFFD as AL
10683
- // and characters in the ranges 20000..2FFFD and 30000..3FFFD as ID, until the implementation can be revised
10684
- // to take into account the actual line breaking properties for these characters.
10685
- if (classType === XX) {
10686
- if (codePoint >= 0x20000 && codePoint <= 0x2fffd || codePoint >= 0x30000 && codePoint <= 0x3fffd) {
10687
- return types.push(ID);
10688
- } else {
10689
- return types.push(AL);
10690
- }
10691
- }
10692
 
10693
- types.push(classType);
10694
- });
 
 
10695
 
10696
- return [indicies, types, categories];
10697
  };
10698
 
10699
- var isAdjacentWithSpaceIgnored = function isAdjacentWithSpaceIgnored(a, b, currentIndex, classTypes) {
10700
- var current = classTypes[currentIndex];
10701
- if (Array.isArray(a) ? a.indexOf(current) !== -1 : a === current) {
10702
- var i = currentIndex;
10703
- while (i <= classTypes.length) {
10704
- i++;
10705
- var next = classTypes[i];
10706
-
10707
- if (next === b) {
10708
- return true;
10709
- }
10710
-
10711
- if (next !== SP) {
10712
- break;
10713
- }
10714
- }
10715
  }
 
 
10716
 
10717
- if (current === SP) {
10718
- var _i = currentIndex;
 
 
 
 
 
 
10719
 
10720
- while (_i > 0) {
10721
- _i--;
10722
- var prev = classTypes[_i];
10723
 
10724
- if (Array.isArray(a) ? a.indexOf(prev) !== -1 : a === prev) {
10725
- var n = currentIndex;
10726
- while (n <= classTypes.length) {
10727
- n++;
10728
- var _next = classTypes[n];
10729
 
10730
- if (_next === b) {
10731
- return true;
10732
- }
10733
 
10734
- if (_next !== SP) {
10735
- break;
10736
- }
10737
- }
10738
- }
10739
 
10740
- if (prev !== SP) {
10741
- break;
10742
- }
10743
- }
10744
- }
10745
- return false;
10746
- };
10747
 
10748
- var previousNonSpaceClassType = function previousNonSpaceClassType(currentIndex, classTypes) {
10749
- var i = currentIndex;
10750
- while (i >= 0) {
10751
- var type = classTypes[i];
10752
- if (type === SP) {
10753
- i--;
10754
- } else {
10755
- return type;
10756
- }
10757
- }
10758
- return 0;
10759
- };
10760
 
10761
- var _lineBreakAtIndex = function _lineBreakAtIndex(codePoints, classTypes, indicies, index, forbiddenBreaks) {
10762
- if (indicies[index] === 0) {
10763
- return BREAK_NOT_ALLOWED;
10764
- }
10765
 
10766
- var currentIndex = index - 1;
10767
- if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {
10768
- return BREAK_NOT_ALLOWED;
10769
- }
10770
 
10771
- var beforeIndex = currentIndex - 1;
10772
- var afterIndex = currentIndex + 1;
10773
- var current = classTypes[currentIndex];
10774
 
10775
- // LB4 Always break after hard line breaks.
10776
- // LB5 Treat CR followed by LF, as well as CR, LF, and NL as hard line breaks.
10777
- var before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;
10778
- var next = classTypes[afterIndex];
10779
 
10780
- if (current === CR && next === LF) {
10781
- return BREAK_NOT_ALLOWED;
10782
- }
10783
 
10784
- if (HARD_LINE_BREAKS.indexOf(current) !== -1) {
10785
- return BREAK_MANDATORY;
10786
- }
10787
 
10788
- // LB6 Do not break before hard line breaks.
10789
- if (HARD_LINE_BREAKS.indexOf(next) !== -1) {
10790
- return BREAK_NOT_ALLOWED;
10791
- }
10792
 
10793
- // LB7 Do not break before spaces or zero width space.
10794
- if (SPACE.indexOf(next) !== -1) {
10795
- return BREAK_NOT_ALLOWED;
10796
- }
10797
 
10798
- // LB8 Break before any character following a zero-width space, even if one or more spaces intervene.
10799
- if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {
10800
- return BREAK_ALLOWED;
 
10801
  }
10802
 
10803
- // LB8a Do not break between a zero width joiner and an ideograph, emoji base or emoji modifier.
10804
- if (UnicodeTrie.get(codePoints[currentIndex]) === ZWJ && (next === ID || next === EB || next === EM)) {
10805
- return BREAK_NOT_ALLOWED;
10806
- }
 
 
 
10807
 
10808
- // LB11 Do not break before or after Word joiner and related characters.
10809
- if (current === WJ || next === WJ) {
10810
- return BREAK_NOT_ALLOWED;
10811
- }
10812
 
10813
- // LB12 Do not break after NBSP and related characters.
10814
- if (current === GL) {
10815
- return BREAK_NOT_ALLOWED;
10816
- }
10817
 
10818
- // LB12a Do not break before NBSP and related characters, except after spaces and hyphens.
10819
- if ([SP, BA, HY].indexOf(current) === -1 && next === GL) {
10820
- return BREAK_NOT_ALLOWED;
10821
  }
10822
 
10823
- // LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces.
10824
- if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) {
10825
- return BREAK_NOT_ALLOWED;
10826
- }
10827
 
10828
- // LB14 Do not break after ‘[’, even after spaces.
10829
- if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {
10830
- return BREAK_NOT_ALLOWED;
10831
- }
10832
 
10833
- // LB15 Do not break within ‘”[’, even with intervening spaces.
10834
- if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {
10835
- return BREAK_NOT_ALLOWED;
 
 
 
 
 
 
 
 
10836
  }
10837
 
10838
- // LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with intervening spaces.
10839
- if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {
10840
- return BREAK_NOT_ALLOWED;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10841
  }
10842
 
10843
- // LB17 Do not break within ‘——’, even with intervening spaces.
10844
- if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {
10845
- return BREAK_NOT_ALLOWED;
10846
- }
10847
 
10848
- // LB18 Break after spaces.
10849
- if (current === SP) {
10850
- return BREAK_ALLOWED;
 
 
 
10851
  }
 
10852
 
10853
- // LB19 Do not break before or after quotation marks, such as ‘ ” ’.
10854
- if (current === QU || next === QU) {
10855
- return BREAK_NOT_ALLOWED;
10856
- }
10857
 
10858
- // LB20 Break before and after unresolved CB.
10859
- if (next === CB || current === CB) {
10860
- return BREAK_ALLOWED;
10861
- }
10862
-
10863
- // LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small kana, and other non-starters, or after acute accents.
10864
- if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) {
10865
- return BREAK_NOT_ALLOWED;
10866
- }
10867
-
10868
- // LB21a Don't break after Hebrew + Hyphen.
10869
- if (before === HL && HYPHEN.indexOf(current) !== -1) {
10870
- return BREAK_NOT_ALLOWED;
10871
- }
10872
-
10873
- // LB21b Don’t break between Solidus and Hebrew letters.
10874
- if (current === SY && next === HL) {
10875
- return BREAK_NOT_ALLOWED;
10876
- }
10877
-
10878
- // LB22 Do not break between two ellipses, or between letters, numbers or exclamations and ellipsis.
10879
- if (next === IN && ALPHABETICS.concat(IN, EX, NU, ID, EB, EM).indexOf(current) !== -1) {
10880
- return BREAK_NOT_ALLOWED;
10881
- }
10882
-
10883
- // LB23 Do not break between digits and letters.
10884
- if (ALPHABETICS.indexOf(next) !== -1 && current === NU || ALPHABETICS.indexOf(current) !== -1 && next === NU) {
10885
- return BREAK_NOT_ALLOWED;
10886
- }
10887
-
10888
- // LB23a Do not break between numeric prefixes and ideographs, or between ideographs and numeric postfixes.
10889
- if (current === PR && [ID, EB, EM].indexOf(next) !== -1 || [ID, EB, EM].indexOf(current) !== -1 && next === PO) {
10890
- return BREAK_NOT_ALLOWED;
10891
- }
10892
 
10893
- // LB24 Do not break between numeric prefix/postfix and letters, or between letters and prefix/postfix.
10894
- if (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1 || PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
10895
- return BREAK_NOT_ALLOWED;
10896
- }
10897
 
10898
- // LB25 Do not break between the following pairs of classes relevant to numbers:
10899
- if (
10900
- // (PR | PO) × ( OP | HY )? NU
10901
- [PR, PO].indexOf(current) !== -1 && (next === NU || [OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU) ||
10902
- // ( OP | HY ) × NU
10903
- [OP, HY].indexOf(current) !== -1 && next === NU ||
10904
- // NU × (NU | SY | IS)
10905
- current === NU && [NU, SY, IS].indexOf(next) !== -1) {
10906
- return BREAK_NOT_ALLOWED;
10907
- }
10908
 
10909
- // NU (NU | SY | IS)* × (NU | SY | IS | CL | CP)
10910
- if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) {
10911
- var prevIndex = currentIndex;
10912
- while (prevIndex >= 0) {
10913
- var type = classTypes[prevIndex];
10914
- if (type === NU) {
10915
- return BREAK_NOT_ALLOWED;
10916
- } else if ([SY, IS].indexOf(type) !== -1) {
10917
- prevIndex--;
10918
- } else {
10919
- break;
10920
- }
10921
- }
10922
  }
10923
 
10924
- // NU (NU | SY | IS)* (CL | CP)? × (PO | PR))
10925
- if ([PR, PO].indexOf(next) !== -1) {
10926
- var _prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;
10927
- while (_prevIndex >= 0) {
10928
- var _type = classTypes[_prevIndex];
10929
- if (_type === NU) {
10930
- return BREAK_NOT_ALLOWED;
10931
- } else if ([SY, IS].indexOf(_type) !== -1) {
10932
- _prevIndex--;
10933
- } else {
10934
- break;
10935
- }
10936
  }
10937
- }
10938
-
10939
- // LB26 Do not break a Korean syllable.
10940
- 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) {
10941
- return BREAK_NOT_ALLOWED;
10942
- }
10943
-
10944
- // LB27 Treat a Korean Syllable Block the same as ID.
10945
- if (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1 || KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR) {
10946
- return BREAK_NOT_ALLOWED;
10947
- }
10948
-
10949
- // LB28 Do not break between alphabetics (“at”).
10950
- if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
10951
- return BREAK_NOT_ALLOWED;
10952
- }
10953
-
10954
- // LB29 Do not break between numeric punctuation and alphabetics (“e.g.”).
10955
- if (current === IS && ALPHABETICS.indexOf(next) !== -1) {
10956
- return BREAK_NOT_ALLOWED;
10957
- }
10958
 
10959
- // LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses.
10960
- if (ALPHABETICS.concat(NU).indexOf(current) !== -1 && next === OP || ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP) {
10961
- return BREAK_NOT_ALLOWED;
10962
- }
10963
 
10964
- // LB30a Break between two regional indicator symbols if and only if there are an even number of regional
10965
- // indicators preceding the position of the break.
10966
- if (current === RI && next === RI) {
10967
- var i = indicies[currentIndex];
10968
- var count = 1;
10969
- while (i > 0) {
10970
- i--;
10971
- if (classTypes[i] === RI) {
10972
- count++;
10973
- } else {
10974
- break;
10975
- }
10976
- }
10977
- if (count % 2 !== 0) {
10978
- return BREAK_NOT_ALLOWED;
10979
  }
10980
- }
10981
-
10982
- // LB30b Do not break between an emoji base and an emoji modifier.
10983
- if (current === EB && next === EM) {
10984
- return BREAK_NOT_ALLOWED;
10985
- }
10986
 
10987
- return BREAK_ALLOWED;
10988
  };
10989
 
10990
- var lineBreakAtIndex = exports.lineBreakAtIndex = function lineBreakAtIndex(codePoints, index) {
10991
- // LB2 Never break at the start of text.
10992
- if (index === 0) {
10993
- return BREAK_NOT_ALLOWED;
10994
- }
10995
-
10996
- // LB3 Always break at the end of text.
10997
- if (index >= codePoints.length) {
10998
- return BREAK_MANDATORY;
10999
- }
11000
-
11001
- var _codePointsToCharacte = codePointsToCharacterClasses(codePoints),
11002
- _codePointsToCharacte2 = _slicedToArray(_codePointsToCharacte, 2),
11003
- indicies = _codePointsToCharacte2[0],
11004
- classTypes = _codePointsToCharacte2[1];
11005
 
11006
- return _lineBreakAtIndex(codePoints, classTypes, indicies, index);
 
 
11007
  };
11008
 
11009
- var cssFormattedClasses = function cssFormattedClasses(codePoints, options) {
11010
- if (!options) {
11011
- options = { lineBreak: 'normal', wordBreak: 'normal' };
11012
- }
11013
-
11014
- var _codePointsToCharacte3 = codePointsToCharacterClasses(codePoints, options.lineBreak),
11015
- _codePointsToCharacte4 = _slicedToArray(_codePointsToCharacte3, 3),
11016
- indicies = _codePointsToCharacte4[0],
11017
- classTypes = _codePointsToCharacte4[1],
11018
- isLetterNumber = _codePointsToCharacte4[2];
11019
-
11020
- if (options.wordBreak === 'break-all' || options.wordBreak === 'break-word') {
11021
- classTypes = classTypes.map(function (type) {
11022
- return [NU, AL, SA].indexOf(type) !== -1 ? ID : type;
11023
- });
11024
- }
11025
-
11026
- var forbiddenBreakpoints = options.wordBreak === 'keep-all' ? isLetterNumber.map(function (isLetterNumber, i) {
11027
- return isLetterNumber && codePoints[i] >= 0x4e00 && codePoints[i] <= 0x9fff;
11028
- }) : null;
11029
 
11030
- return [indicies, classTypes, forbiddenBreakpoints];
 
 
 
11031
  };
11032
 
11033
- var inlineBreakOpportunities = exports.inlineBreakOpportunities = function inlineBreakOpportunities(str, options) {
11034
- var codePoints = (0, _Util.toCodePoints)(str);
11035
- var output = BREAK_NOT_ALLOWED;
11036
-
11037
- var _cssFormattedClasses = cssFormattedClasses(codePoints, options),
11038
- _cssFormattedClasses2 = _slicedToArray(_cssFormattedClasses, 3),
11039
- indicies = _cssFormattedClasses2[0],
11040
- classTypes = _cssFormattedClasses2[1],
11041
- forbiddenBreakpoints = _cssFormattedClasses2[2];
11042
 
11043
- codePoints.forEach(function (codePoint, i) {
11044
- output += (0, _Util.fromCodePoint)(codePoint) + (i >= codePoints.length - 1 ? BREAK_MANDATORY : _lineBreakAtIndex(codePoints, classTypes, indicies, i + 1, forbiddenBreakpoints));
11045
- });
 
 
 
11046
 
11047
- return output;
11048
- };
 
11049
 
11050
- var Break = function () {
11051
- function Break(codePoints, lineBreak, start, end) {
11052
- _classCallCheck(this, Break);
11053
 
11054
- this._codePoints = codePoints;
11055
- this.required = lineBreak === BREAK_MANDATORY;
11056
- this.start = start;
11057
- this.end = end;
 
 
 
 
11058
  }
11059
 
11060
- _createClass(Break, [{
11061
- key: 'slice',
11062
- value: function slice() {
11063
- return _Util.fromCodePoint.apply(undefined, _toConsumableArray(this._codePoints.slice(this.start, this.end)));
11064
- }
11065
- }]);
11066
 
11067
- return Break;
11068
- }();
 
 
11069
 
11070
- var LineBreaker = exports.LineBreaker = function LineBreaker(str, options) {
11071
- var codePoints = (0, _Util.toCodePoints)(str);
11072
-
11073
- var _cssFormattedClasses3 = cssFormattedClasses(codePoints, options),
11074
- _cssFormattedClasses4 = _slicedToArray(_cssFormattedClasses3, 3),
11075
- indicies = _cssFormattedClasses4[0],
11076
- classTypes = _cssFormattedClasses4[1],
11077
- forbiddenBreakpoints = _cssFormattedClasses4[2];
11078
-
11079
- var length = codePoints.length;
11080
- var lastEnd = 0;
11081
- var nextIndex = 0;
11082
-
11083
- return {
11084
- next: function next() {
11085
- if (nextIndex >= length) {
11086
- return { done: true };
11087
- }
11088
- var lineBreak = BREAK_NOT_ALLOWED;
11089
- while (nextIndex < length && (lineBreak = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) === BREAK_NOT_ALLOWED) {}
11090
-
11091
- if (lineBreak !== BREAK_NOT_ALLOWED || nextIndex === length) {
11092
- var value = new Break(codePoints, lineBreak, lastEnd, nextIndex);
11093
- lastEnd = nextIndex;
11094
- return { value: value, done: false };
11095
- }
11096
-
11097
- return { done: true };
11098
- }
11099
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11100
  };
11101
 
11102
  /***/ }),
11103
- /* 48 */
11104
  /***/ (function(module, exports, __webpack_require__) {
11105
 
11106
  "use strict";
@@ -11109,172 +12022,259 @@ var LineBreaker = exports.LineBreaker = function LineBreaker(str, options) {
11109
  Object.defineProperty(exports, "__esModule", {
11110
  value: true
11111
  });
11112
- exports.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;
11113
 
11114
  var _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; }; }();
11115
 
11116
- var _Util = __webpack_require__(13);
11117
-
11118
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11119
-
11120
- /** Shift size for getting the index-2 table offset. */
11121
- var UTRIE2_SHIFT_2 = exports.UTRIE2_SHIFT_2 = 5;
11122
-
11123
- /** Shift size for getting the index-1 table offset. */
11124
- var UTRIE2_SHIFT_1 = exports.UTRIE2_SHIFT_1 = 6 + 5;
11125
-
11126
- /**
11127
- * Shift size for shifting left the index array values.
11128
- * Increases possible data size with 16-bit index values at the cost
11129
- * of compactability.
11130
- * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.
11131
- */
11132
- var UTRIE2_INDEX_SHIFT = exports.UTRIE2_INDEX_SHIFT = 2;
11133
-
11134
- /**
11135
- * Difference between the two shift sizes,
11136
- * for getting an index-1 offset from an index-2 offset. 6=11-5
11137
- */
11138
- var UTRIE2_SHIFT_1_2 = exports.UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;
11139
 
11140
- /**
11141
- * The part of the index-2 table for U+D800..U+DBFF stores values for
11142
- * lead surrogate code _units_ not code _points_.
11143
- * Values for lead surrogate code _points_ are indexed with this portion of the table.
11144
- * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)
11145
- */
11146
- var UTRIE2_LSCP_INDEX_2_OFFSET = exports.UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2;
11147
 
11148
- /** Number of entries in a data block. 32=0x20 */
11149
- var UTRIE2_DATA_BLOCK_LENGTH = exports.UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;
11150
- /** Mask for getting the lower bits for the in-data-block offset. */
11151
- var UTRIE2_DATA_MASK = exports.UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;
11152
 
11153
- var UTRIE2_LSCP_INDEX_2_LENGTH = exports.UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2;
11154
- /** Count the lengths of both BMP pieces. 2080=0x820 */
11155
- var UTRIE2_INDEX_2_BMP_LENGTH = exports.UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;
11156
- /**
11157
- * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.
11158
- * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.
11159
- */
11160
- var UTRIE2_UTF8_2B_INDEX_2_OFFSET = exports.UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;
11161
- var 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 */
11162
- /**
11163
- * The index-1 table, only used for supplementary code points, at offset 2112=0x840.
11164
- * Variable length, for code points up to highStart, where the last single-value range starts.
11165
- * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.
11166
- * (For 0x100000 supplementary code points U+10000..U+10ffff.)
11167
- *
11168
- * The part of the index-2 table for supplementary code points starts
11169
- * after this index-1 table.
11170
- *
11171
- * Both the index-1 table and the following part of the index-2 table
11172
- * are omitted completely if there is only BMP data.
11173
- */
11174
- var UTRIE2_INDEX_1_OFFSET = exports.UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;
11175
 
11176
- /**
11177
- * Number of index-1 entries for the BMP. 32=0x20
11178
- * This part of the index-1 table is omitted from the serialized form.
11179
- */
11180
- var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = exports.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1;
11181
 
11182
- /** Number of entries in an index-2 block. 64=0x40 */
11183
- var UTRIE2_INDEX_2_BLOCK_LENGTH = exports.UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;
11184
- /** Mask for getting the lower bits for the in-index-2-block offset. */
11185
- var UTRIE2_INDEX_2_MASK = exports.UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;
11186
 
11187
- var createTrieFromBase64 = exports.createTrieFromBase64 = function createTrieFromBase64(base64) {
11188
- var buffer = (0, _Util.decode)(base64);
11189
- var view32 = Array.isArray(buffer) ? (0, _Util.polyUint32Array)(buffer) : new Uint32Array(buffer);
11190
- var view16 = Array.isArray(buffer) ? (0, _Util.polyUint16Array)(buffer) : new Uint16Array(buffer);
11191
- var headerLength = 24;
 
 
 
 
11192
 
11193
- var index = view16.slice(headerLength / 2, view32[4] / 2);
11194
- var data = view32[5] === 2 ? view16.slice((headerLength + view32[4]) / 2) : view32.slice(Math.ceil((headerLength + view32[4]) / 4));
 
 
 
 
 
 
 
11195
 
11196
- return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);
11197
- };
 
 
 
 
 
11198
 
11199
- var Trie = exports.Trie = function () {
11200
- function Trie(initialValue, errorValue, highStart, highValueIndex, index, data) {
11201
- _classCallCheck(this, Trie);
11202
 
11203
- this.initialValue = initialValue;
11204
- this.errorValue = errorValue;
11205
- this.highStart = highStart;
11206
- this.highValueIndex = highValueIndex;
11207
- this.index = index;
11208
- this.data = data;
11209
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11210
 
11211
- /**
11212
- * Get the value for a code point as stored in the Trie.
11213
- *
11214
- * @param codePoint the code point
11215
- * @return the value
11216
- */
 
 
 
11217
 
 
 
 
 
 
 
 
11218
 
11219
- _createClass(Trie, [{
11220
- key: 'get',
11221
- value: function get(codePoint) {
11222
- var ix = void 0;
11223
- if (codePoint >= 0) {
11224
- if (codePoint < 0x0d800 || codePoint > 0x0dbff && codePoint <= 0x0ffff) {
11225
- // Ordinary BMP code point, excluding leading surrogates.
11226
- // BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.
11227
- // 16 bit data is stored in the index array itself.
11228
- ix = this.index[codePoint >> UTRIE2_SHIFT_2];
11229
- ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
11230
- return this.data[ix];
11231
- }
11232
 
11233
- if (codePoint <= 0xffff) {
11234
- // Lead Surrogate Code Point. A Separate index section is stored for
11235
- // lead surrogate code units and code points.
11236
- // The main index has the code unit data.
11237
- // For this function, we need the code point data.
11238
- // Note: this expression could be refactored for slightly improved efficiency, but
11239
- // surrogate code points will be so rare in practice that it's not worth it.
11240
- ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + (codePoint - 0xd800 >> UTRIE2_SHIFT_2)];
11241
- ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
11242
- return this.data[ix];
11243
- }
11244
 
11245
- if (codePoint < this.highStart) {
11246
- // Supplemental code point, use two-level lookup.
11247
- ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);
11248
- ix = this.index[ix];
11249
- ix += codePoint >> UTRIE2_SHIFT_2 & UTRIE2_INDEX_2_MASK;
11250
- ix = this.index[ix];
11251
- ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
11252
- return this.data[ix];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11253
  }
11254
- if (codePoint <= 0x10ffff) {
11255
- return this.data[this.highValueIndex];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11256
  }
 
 
 
 
 
 
 
11257
  }
11258
 
11259
- // Fall through. The code point is outside of the legal range of 0..0x10ffff.
11260
- return this.errorValue;
 
 
 
 
11261
  }
11262
- }]);
11263
-
11264
- return Trie;
11265
- }();
 
 
 
 
 
 
 
 
11266
 
11267
- /***/ }),
11268
- /* 49 */
11269
- /***/ (function(module, exports, __webpack_require__) {
11270
 
11271
- "use strict";
 
 
11272
 
 
 
11273
 
11274
- module.exports = 'KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5wPsA/QD/AOAAIAABAQMBBIEgAAWBB4EJgQuBDMEIAM7BEEEXgBJBCADUQRZBGEEaQQwADAAcQQ+AXkEgQSJBJEEgACYBIAAoASoBK8EtwQwAL8ExQSAAIAAgACAAIAAgACgAM0EXgBeAF4AXgBeAF4AXgBeANUEXgDZBOEEXgDpBPEE+QQBBQkFEQUZBSEFKQUxBTUFPQVFBUwFVAVcBV4AYwVeAGsFcwV7BYMFiwWSBV4AmgWgBacFXgBeAF4AXgBeAKsFXgCyBbEFugW7BcIFwgXIBcIFwgXQBdQF3AXkBesF8wX7BQMGCwYTBhsGIwYrBjMGOwZeAD8GRwZNBl4AVAZbBl4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAGMGXgBqBnEGXgBeAF4AXgBeAF4AXgBeAF4AXgB5BoAG4wSGBo4GkwaAAIADHgR5AF4AXgBeAJsGgABGA4AAowarBrMGswagALsGwwbLBjAA0wbaBtoG3QbaBtoG2gbaBtoG2gblBusG8wb7BgMHCwcTBxsHCwcjBysHMAc1BzUHOgdCB9oGSgdSB1oHYAfaBloHaAfaBlIH2gbaBtoG2gbaBtoG2gbaBjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHbQdeAF4ANQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQd1B30HNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B4MH2gaKB68EgACAAIAAgACAAIAAgACAAI8HlwdeAJ8HpweAAIAArwe3B14AXgC/B8UHygcwANAH2AfgB4AA6AfwBz4B+AcACFwBCAgPCBcIogEYAR8IJwiAAC8INwg/CCADRwhPCFcIXwhnCEoDGgSAAIAAgABvCHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIhAiLCI4IMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANQc1BzUHNQc1BzUHNQc1BzUHNQc1B54INQc1B6II2gaqCLIIugiAAIAAvgjGCIAAgACAAIAAgACAAIAAgACAAIAAywiHAYAA0wiAANkI3QjlCO0I9Aj8CIAAgACAAAIJCgkSCRoJIgknCTYHLwk3CZYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACJCR4E6AswADAAhwHwC4AA+AsADAgMEAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMACAAIAAGAwdDCUMMAAwAC0MNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQw1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHPQwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADUHNQc1BzUHNQc1BzUHNQc2BzAAMAA5DDUHNQc1BzUHNQc1BzUHNQc1BzUHNQdFDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAATQxSDFoMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAF4AXgBeAF4AXgBeAF4AYgxeAGoMXgBxDHkMfwxeAIUMXgBeAI0MMAAwADAAMAAwAF4AXgCVDJ0MMAAwADAAMABeAF4ApQxeAKsMswy7DF4Awgy9DMoMXgBeAF4AXgBeAF4AXgBeAF4AXgDRDNkMeQBqCeAM3Ax8AOYM7Az0DPgMXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgCgAAANoAAHDQ4NFg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAeDSYNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAC4NMABeAF4ANg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAD4NRg1ODVYNXg1mDTAAbQ0wADAAMAAwADAAMAAwADAA2gbaBtoG2gbaBtoG2gbaBnUNeg3CBYANwgWFDdoGjA3aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gaUDZwNpA2oDdoG2gawDbcNvw3HDdoG2gbPDdYN3A3fDeYN2gbsDfMN2gbaBvoN/g3aBgYODg7aBl4AXgBeABYOXgBeACUG2gYeDl4AJA5eACwO2w3aBtoGMQ45DtoG2gbaBtoGQQ7aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B1EO2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQdZDjUHNQc1BzUHNQc1B2EONQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHaA41BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B3AO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B2EO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBkkOeA6gAKAAoAAwADAAMAAwAKAAoACgAKAAoACgAKAAgA4wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAD//wQABAAEAAQABAAEAAQABAAEAA0AAwABAAEAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAKABMAFwAeABsAGgAeABcAFgASAB4AGwAYAA8AGAAcAEsASwBLAEsASwBLAEsASwBLAEsAGAAYAB4AHgAeABMAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAFgAbABIAHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYADQARAB4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkAFgAaABsAGwAbAB4AHQAdAB4ATwAXAB4ADQAeAB4AGgAbAE8ATwAOAFAAHQAdAB0ATwBPABcATwBPAE8AFgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAABABQAFAAUABQAAQABAAEAFAAUAAEAAQABAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAKwBQACsAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAKwArAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAKwAeAB4AHgAeAB4AHgAeAA4AHgArAA0ADQANAA0ADQANAA0ACQANAA0ADQAIAAQACwAEAAQADQAJAA0ADQAMAB0AHQAeABcAFwAWABcAFwAXABYAFwAdAB0AHgAeABQAFAAUAA0AAQABAAQABAAEAAQABAAJABoAGgAaABoAGgAaABoAGgAeABcAFwAdABUAFQAeAB4AHgAeAB4AHgAYABYAEQAVABUAFQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgANAB4ADQANAA0ADQAeAA0ADQANAAcAHgAeAB4AHgArAAQABAAEAAQABAAEAAQABAAEAAQAUABQACsAKwBPAFAAUABQAFAAUAAeAB4AHgAWABEATwBQAE8ATwBPAE8AUABQAFAAUABQAB4AHgAeABYAEQArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGgAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgBQABoAHgAdAB4AUAAeABoAHgAeAB4AHgAeAB4AHgAeAB4ATwAeAFAAGwAeAB4AUABQAFAAUABQAB4AHgAeAB0AHQAeAFAAHgBQAB4AUAAeAFAATwBQAFAAHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AUABQAFAAUABPAE8AUABQAFAAUABQAE8AUABQAE8AUABPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAE8ATwBPAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAATwAeAB4AKwArACsAKwAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB0AHQAeAB4AHgAdAB0AHgAeAB0AHgAeAB4AHQAeAB0AGwAbAB4AHQAeAB4AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB0AHgAdAB4AHQAdAB0AHQAdAB0AHgAdAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAdAB0AHQAdAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAlACUAHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB0AHQAeAB4AHgAeAB0AHQAdAB4AHgAdAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB0AHQAeAB4AHQAeAB4AHgAeAB0AHQAeAB4AHgAeACUAJQAdAB0AJQAeACUAJQAlACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHQAdAB0AHgAdACUAHQAdAB4AHQAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHQAdAB0AHQAlAB4AJQAlACUAHQAlACUAHQAdAB0AJQAlAB0AHQAlAB0AHQAlACUAJQAeAB0AHgAeAB4AHgAdAB0AJQAdAB0AHQAdAB0AHQAlACUAJQAlACUAHQAlACUAIAAlAB0AHQAlACUAJQAlACUAJQAlACUAHgAeAB4AJQAlACAAIAAgACAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeABcAFwAXABcAFwAXAB4AEwATACUAHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACUAJQBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwArACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAE8ATwBPAE8ATwBPAE8ATwAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFwAXABcAFQAVABUAHgAeAB4AHgAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAlACAAIAAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA';
11275
 
11276
  /***/ }),
11277
- /* 50 */
11278
  /***/ (function(module, exports, __webpack_require__) {
11279
 
11280
  "use strict";
@@ -11284,34 +12284,152 @@ Object.defineProperty(exports, "__esModule", {
11284
  value: true
11285
  });
11286
 
11287
- var _Path = __webpack_require__(6);
11288
 
11289
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11290
 
11291
- var Circle = function Circle(x, y, radius) {
11292
- _classCallCheck(this, Circle);
 
11293
 
11294
- this.type = _Path.PATH.CIRCLE;
11295
- this.x = x;
11296
- this.y = y;
11297
- this.radius = radius;
11298
- if (true) {
11299
- if (isNaN(x)) {
11300
- console.error('Invalid x value given for Circle');
11301
- }
11302
- if (isNaN(y)) {
11303
- console.error('Invalid y value given for Circle');
11304
  }
11305
- if (isNaN(radius)) {
11306
- console.error('Invalid radius value given for Circle');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11307
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11308
  }
11309
  };
11310
 
11311
- exports.default = Circle;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11312
 
11313
  /***/ }),
11314
- /* 51 */
11315
  /***/ (function(module, exports, __webpack_require__) {
11316
 
11317
  "use strict";
@@ -11320,16 +12438,37 @@ exports.default = Circle;
11320
  Object.defineProperty(exports, "__esModule", {
11321
  value: true
11322
  });
 
 
 
 
 
 
11323
 
11324
- var _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"); } }; }();
 
 
 
 
 
 
 
 
11325
 
11326
- var _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; }; }();
 
11327
 
11328
- var _Bounds = __webpack_require__(2);
 
 
11329
 
11330
- var _Font = __webpack_require__(25);
11331
 
11332
- var _Gradient = __webpack_require__(52);
 
 
 
 
11333
 
11334
  var _TextContainer = __webpack_require__(9);
11335
 
@@ -11339,313 +12478,200 @@ var _background = __webpack_require__(5);
11339
 
11340
  var _border = __webpack_require__(12);
11341
 
11342
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11343
-
11344
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11345
 
11346
- var Renderer = function () {
11347
- function Renderer(target, options) {
11348
- _classCallCheck(this, Renderer);
11349
 
11350
- this.target = target;
11351
- this.options = options;
11352
- target.render(options);
11353
- }
11354
 
11355
- _createClass(Renderer, [{
11356
- key: 'renderNode',
11357
- value: function renderNode(container) {
11358
- if (container.isVisible()) {
11359
- this.renderNodeBackgroundAndBorders(container);
11360
- this.renderNodeContent(container);
11361
- }
11362
- }
11363
- }, {
11364
- key: 'renderNodeContent',
11365
- value: function renderNodeContent(container) {
11366
- var _this = this;
11367
 
11368
- var callback = function callback() {
11369
- if (container.childNodes.length) {
11370
- container.childNodes.forEach(function (child) {
11371
- if (child instanceof _TextContainer2.default) {
11372
- var style = child.parent.style;
11373
- _this.target.renderTextNode(child.bounds, style.color, style.font, style.textDecoration, style.textShadow);
11374
- } else {
11375
- _this.target.drawShape(child, container.style.color);
11376
- }
11377
- });
11378
- }
11379
 
11380
- if (container.image) {
11381
- var _image = _this.options.imageStore.get(container.image);
11382
- if (_image) {
11383
- var contentBox = (0, _Bounds.calculateContentBox)(container.bounds, container.style.padding, container.style.border);
11384
- var _width = typeof _image.width === 'number' && _image.width > 0 ? _image.width : contentBox.width;
11385
- var _height = typeof _image.height === 'number' && _image.height > 0 ? _image.height : contentBox.height;
11386
- if (_width > 0 && _height > 0) {
11387
- _this.target.clip([(0, _Bounds.calculatePaddingBoxPath)(container.curvedBounds)], function () {
11388
- _this.target.drawImage(_image, new _Bounds.Bounds(0, 0, _width, _height), contentBox);
11389
- });
11390
- }
11391
- }
11392
- }
11393
- };
11394
- var paths = container.getClipPaths();
11395
- if (paths.length) {
11396
- this.target.clip(paths, callback);
11397
- } else {
11398
- callback();
11399
- }
11400
- }
11401
- }, {
11402
- key: 'renderNodeBackgroundAndBorders',
11403
- value: function renderNodeBackgroundAndBorders(container) {
11404
- var _this2 = this;
11405
 
11406
- var HAS_BACKGROUND = !container.style.background.backgroundColor.isTransparent() || container.style.background.backgroundImage.length;
11407
 
11408
- var hasRenderableBorders = container.style.border.some(function (border) {
11409
- return border.borderStyle !== _border.BORDER_STYLE.NONE && !border.borderColor.isTransparent();
11410
- });
11411
 
11412
- var callback = function callback() {
11413
- var backgroundPaintingArea = (0, _background.calculateBackgroungPaintingArea)(container.curvedBounds, container.style.background.backgroundClip);
11414
 
11415
- if (HAS_BACKGROUND) {
11416
- _this2.target.clip([backgroundPaintingArea], function () {
11417
- if (!container.style.background.backgroundColor.isTransparent()) {
11418
- _this2.target.fill(container.style.background.backgroundColor);
11419
- }
11420
 
11421
- _this2.renderBackgroundImage(container);
11422
- });
11423
- }
11424
 
11425
- container.style.border.forEach(function (border, side) {
11426
- if (border.borderStyle !== _border.BORDER_STYLE.NONE && !border.borderColor.isTransparent()) {
11427
- _this2.renderBorder(border, side, container.curvedBounds);
11428
- }
11429
- });
11430
- };
11431
 
11432
- if (HAS_BACKGROUND || hasRenderableBorders) {
11433
- var paths = container.parent ? container.parent.getClipPaths() : [];
11434
- if (paths.length) {
11435
- this.target.clip(paths, callback);
11436
- } else {
11437
- callback();
11438
- }
11439
- }
11440
- }
11441
- }, {
11442
- key: 'renderBackgroundImage',
11443
- value: function renderBackgroundImage(container) {
11444
- var _this3 = this;
 
 
11445
 
11446
- container.style.background.backgroundImage.slice(0).reverse().forEach(function (backgroundImage) {
11447
- if (backgroundImage.source.method === 'url' && backgroundImage.source.args.length) {
11448
- _this3.renderBackgroundRepeat(container, backgroundImage);
11449
- } else if (/gradient/i.test(backgroundImage.source.method)) {
11450
- _this3.renderBackgroundGradient(container, backgroundImage);
11451
- }
11452
- });
11453
- }
11454
- }, {
11455
- key: 'renderBackgroundRepeat',
11456
- value: function renderBackgroundRepeat(container, background) {
11457
- var image = this.options.imageStore.get(background.source.args[0]);
11458
- if (image) {
11459
- var backgroundPositioningArea = (0, _background.calculateBackgroungPositioningArea)(container.style.background.backgroundOrigin, container.bounds, container.style.padding, container.style.border);
11460
- var backgroundImageSize = (0, _background.calculateBackgroundSize)(background, image, backgroundPositioningArea);
11461
- var position = (0, _background.calculateBackgroundPosition)(background.position, backgroundImageSize, backgroundPositioningArea);
11462
- var _path = (0, _background.calculateBackgroundRepeatPath)(background, position, backgroundImageSize, backgroundPositioningArea, container.bounds);
11463
 
11464
- var _offsetX = Math.round(backgroundPositioningArea.left + position.x);
11465
- var _offsetY = Math.round(backgroundPositioningArea.top + position.y);
11466
- this.target.renderRepeat(_path, image, backgroundImageSize, _offsetX, _offsetY);
11467
- }
11468
- }
11469
- }, {
11470
- key: 'renderBackgroundGradient',
11471
- value: function renderBackgroundGradient(container, background) {
11472
- var backgroundPositioningArea = (0, _background.calculateBackgroungPositioningArea)(container.style.background.backgroundOrigin, container.bounds, container.style.padding, container.style.border);
11473
- var backgroundImageSize = (0, _background.calculateGradientBackgroundSize)(background, backgroundPositioningArea);
11474
- var position = (0, _background.calculateBackgroundPosition)(background.position, backgroundImageSize, backgroundPositioningArea);
11475
- var gradientBounds = new _Bounds.Bounds(Math.round(backgroundPositioningArea.left + position.x), Math.round(backgroundPositioningArea.top + position.y), backgroundImageSize.width, backgroundImageSize.height);
11476
 
11477
- var gradient = (0, _Gradient.parseGradient)(container, background.source, gradientBounds);
11478
- if (gradient) {
11479
- switch (gradient.type) {
11480
- case _Gradient.GRADIENT_TYPE.LINEAR_GRADIENT:
11481
- // $FlowFixMe
11482
- this.target.renderLinearGradient(gradientBounds, gradient);
11483
- break;
11484
- case _Gradient.GRADIENT_TYPE.RADIAL_GRADIENT:
11485
- // $FlowFixMe
11486
- this.target.renderRadialGradient(gradientBounds, gradient);
11487
- break;
11488
- }
11489
- }
11490
- }
11491
- }, {
11492
- key: 'renderBorder',
11493
- value: function renderBorder(border, side, curvePoints) {
11494
- this.target.drawShape((0, _Bounds.parsePathForBorder)(curvePoints, side), border.borderColor);
11495
  }
11496
- }, {
11497
- key: 'renderStack',
11498
- value: function renderStack(stack) {
11499
- var _this4 = this;
11500
 
11501
- if (stack.container.isVisible()) {
11502
- var _opacity = stack.getOpacity();
11503
- if (_opacity !== this._opacity) {
11504
- this.target.setOpacity(stack.getOpacity());
11505
- this._opacity = _opacity;
11506
- }
11507
 
11508
- var _transform = stack.container.style.transform;
11509
- if (_transform !== null) {
11510
- this.target.transform(stack.container.bounds.left + _transform.transformOrigin[0].value, stack.container.bounds.top + _transform.transformOrigin[1].value, _transform.transform, function () {
11511
- return _this4.renderStackContent(stack);
11512
- });
11513
- } else {
11514
- this.renderStackContent(stack);
11515
- }
11516
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11517
  }
11518
- }, {
11519
- key: 'renderStackContent',
11520
- value: function renderStackContent(stack) {
11521
- var _splitStackingContext = splitStackingContexts(stack),
11522
- _splitStackingContext2 = _slicedToArray(_splitStackingContext, 5),
11523
- negativeZIndex = _splitStackingContext2[0],
11524
- zeroOrAutoZIndexOrTransformedOrOpacity = _splitStackingContext2[1],
11525
- positiveZIndex = _splitStackingContext2[2],
11526
- nonPositionedFloats = _splitStackingContext2[3],
11527
- nonPositionedInlineLevel = _splitStackingContext2[4];
11528
 
11529
- var _splitDescendants = splitDescendants(stack),
11530
- _splitDescendants2 = _slicedToArray(_splitDescendants, 2),
11531
- inlineLevel = _splitDescendants2[0],
11532
- nonInlineLevel = _splitDescendants2[1];
11533
 
11534
- // https://www.w3.org/TR/css-position-3/#painting-order
11535
- // 1. the background and borders of the element forming the stacking context.
11536
 
 
 
 
11537
 
11538
- this.renderNodeBackgroundAndBorders(stack.container);
11539
- // 2. the child stacking contexts with negative stack levels (most negative first).
11540
- negativeZIndex.sort(sortByZIndex).forEach(this.renderStack, this);
11541
- // 3. For all its in-flow, non-positioned, block-level descendants in tree order:
11542
- this.renderNodeContent(stack.container);
11543
- nonInlineLevel.forEach(this.renderNode, this);
11544
- // 4. All non-positioned floating descendants, in tree order. For each one of these,
11545
- // treat the element as if it created a new stacking context, but any positioned descendants and descendants
11546
- // which actually create a new stacking context should be considered part of the parent stacking context,
11547
- // not this new one.
11548
- nonPositionedFloats.forEach(this.renderStack, this);
11549
- // 5. the in-flow, inline-level, non-positioned descendants, including inline tables and inline blocks.
11550
- nonPositionedInlineLevel.forEach(this.renderStack, this);
11551
- inlineLevel.forEach(this.renderNode, this);
11552
- // 6. All positioned, opacity or transform descendants, in tree order that fall into the following categories:
11553
- // All positioned descendants with 'z-index: auto' or 'z-index: 0', in tree order.
11554
- // For those with 'z-index: auto', treat the element as if it created a new stacking context,
11555
- // but any positioned descendants and descendants which actually create a new stacking context should be
11556
- // considered part of the parent stacking context, not this new one. For those with 'z-index: 0',
11557
- // treat the stacking context generated atomically.
11558
- //
11559
- // All opacity descendants with opacity less than 1
11560
- //
11561
- // All transform descendants with transform other than none
11562
- zeroOrAutoZIndexOrTransformedOrOpacity.forEach(this.renderStack, this);
11563
- // 7. Stacking contexts formed by positioned descendants with z-indices greater than or equal to 1 in z-index
11564
- // order (smallest first) then tree order.
11565
- positiveZIndex.sort(sortByZIndex).forEach(this.renderStack, this);
11566
- }
11567
- }, {
11568
- key: 'render',
11569
- value: function render(stack) {
11570
- var _this5 = this;
11571
 
11572
- if (this.options.backgroundColor) {
11573
- this.target.rectangle(this.options.x, this.options.y, this.options.width, this.options.height, this.options.backgroundColor);
11574
- }
11575
- this.renderStack(stack);
11576
- var target = this.target.getTarget();
11577
- if (true) {
11578
- return target.then(function (output) {
11579
- _this5.options.logger.log('Render completed');
11580
- return output;
11581
- });
11582
- }
11583
- return target;
11584
- }
11585
- }]);
11586
 
11587
- return Renderer;
11588
- }();
 
 
11589
 
11590
- exports.default = Renderer;
11591
 
 
11592
 
11593
- var splitDescendants = function splitDescendants(stack) {
11594
- var inlineLevel = [];
11595
- var nonInlineLevel = [];
11596
 
11597
- var length = stack.children.length;
11598
- for (var i = 0; i < length; i++) {
11599
- var child = stack.children[i];
11600
- if (child.isInlineLevel()) {
11601
- inlineLevel.push(child);
11602
- } else {
11603
- nonInlineLevel.push(child);
11604
- }
11605
- }
11606
- return [inlineLevel, nonInlineLevel];
 
 
 
11607
  };
11608
 
11609
- var splitStackingContexts = function splitStackingContexts(stack) {
11610
- var negativeZIndex = [];
11611
- var zeroOrAutoZIndexOrTransformedOrOpacity = [];
11612
- var positiveZIndex = [];
11613
- var nonPositionedFloats = [];
11614
- var nonPositionedInlineLevel = [];
11615
- var length = stack.contexts.length;
 
 
 
 
11616
  for (var i = 0; i < length; i++) {
11617
- var child = stack.contexts[i];
11618
- if (child.container.isPositioned() || child.container.style.opacity < 1 || child.container.isTransformed()) {
11619
- if (child.container.style.zIndex.order < 0) {
11620
- negativeZIndex.push(child);
11621
- } else if (child.container.style.zIndex.order > 0) {
11622
- positiveZIndex.push(child);
11623
- } else {
11624
- zeroOrAutoZIndexOrTransformedOrOpacity.push(child);
11625
- }
11626
- } else {
11627
- if (child.container.isFloating()) {
11628
- nonPositionedFloats.push(child);
11629
  } else {
11630
- nonPositionedInlineLevel.push(child);
 
 
11631
  }
 
 
11632
  }
 
11633
  }
11634
- return [negativeZIndex, zeroOrAutoZIndexOrTransformedOrOpacity, positiveZIndex, nonPositionedFloats, nonPositionedInlineLevel];
11635
  };
11636
 
11637
- var sortByZIndex = function sortByZIndex(a, b) {
11638
- if (a.container.style.zIndex.order > b.container.style.zIndex.order) {
11639
- return 1;
11640
- } else if (a.container.style.zIndex.order < b.container.style.zIndex.order) {
11641
- return -1;
 
 
 
 
 
 
11642
  }
 
 
11643
 
11644
- return a.container.index > b.container.index ? 1 : -1;
 
 
 
 
11645
  };
11646
 
11647
  /***/ }),
11648
- /* 52 */
11649
  /***/ (function(module, exports, __webpack_require__) {
11650
 
11651
  "use strict";
@@ -11654,483 +12680,367 @@ var sortByZIndex = function sortByZIndex(a, b) {
11654
  Object.defineProperty(exports, "__esModule", {
11655
  value: true
11656
  });
11657
- exports.transformWebkitRadialGradientArgs = exports.parseGradient = exports.RadialGradient = exports.LinearGradient = exports.RADIAL_GRADIENT_SHAPE = exports.GRADIENT_TYPE = undefined;
11658
 
11659
- var _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"); } }; }();
11660
 
11661
- var _NodeContainer = __webpack_require__(3);
11662
 
11663
- var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
 
 
11664
 
11665
- var _Angle = __webpack_require__(53);
 
11666
 
11667
- var _Color = __webpack_require__(0);
 
 
 
11668
 
11669
- var _Color2 = _interopRequireDefault(_Color);
 
 
 
 
 
 
11670
 
11671
- var _Length = __webpack_require__(1);
 
11672
 
11673
- var _Length2 = _interopRequireDefault(_Length);
 
 
 
 
11674
 
11675
- var _Util = __webpack_require__(4);
 
 
 
 
11676
 
11677
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
11678
 
11679
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
11680
 
11681
- var SIDE_OR_CORNER = /^(to )?(left|top|right|bottom)( (left|top|right|bottom))?$/i;
11682
- var PERCENTAGE_ANGLES = /^([+-]?\d*\.?\d+)% ([+-]?\d*\.?\d+)%$/i;
11683
- var ENDS_WITH_LENGTH = /(px)|%|( 0)$/i;
11684
- var FROM_TO_COLORSTOP = /^(from|to|color-stop)\((?:([\d.]+)(%)?,\s*)?(.+?)\)$/i;
11685
- var 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;
 
11686
 
11687
- var GRADIENT_TYPE = exports.GRADIENT_TYPE = {
11688
- LINEAR_GRADIENT: 0,
11689
- RADIAL_GRADIENT: 1
11690
- };
11691
 
11692
- var RADIAL_GRADIENT_SHAPE = exports.RADIAL_GRADIENT_SHAPE = {
11693
- CIRCLE: 0,
11694
- ELLIPSE: 1
11695
  };
11696
 
11697
- var LENGTH_FOR_POSITION = {
11698
- left: new _Length2.default('0%'),
11699
- top: new _Length2.default('0%'),
11700
- center: new _Length2.default('50%'),
11701
- right: new _Length2.default('100%'),
11702
- bottom: new _Length2.default('100%')
 
 
 
 
11703
  };
11704
 
11705
- var LinearGradient = exports.LinearGradient = function LinearGradient(colorStops, direction) {
11706
- _classCallCheck(this, LinearGradient);
 
11707
 
11708
- this.type = GRADIENT_TYPE.LINEAR_GRADIENT;
11709
- this.colorStops = colorStops;
11710
- this.direction = direction;
11711
- };
11712
 
11713
- var RadialGradient = exports.RadialGradient = function RadialGradient(colorStops, shape, center, radius) {
11714
- _classCallCheck(this, RadialGradient);
11715
 
11716
- this.type = GRADIENT_TYPE.RADIAL_GRADIENT;
11717
- this.colorStops = colorStops;
11718
- this.shape = shape;
11719
- this.center = center;
11720
- this.radius = radius;
11721
- };
11722
 
11723
- var parseGradient = exports.parseGradient = function parseGradient(container, _ref, bounds) {
11724
- var args = _ref.args,
11725
- method = _ref.method,
11726
- prefix = _ref.prefix;
11727
 
11728
- if (method === 'linear-gradient') {
11729
- return parseLinearGradient(args, bounds, !!prefix);
11730
- } else if (method === 'gradient' && args[0] === 'linear') {
11731
- // TODO handle correct angle
11732
- return parseLinearGradient(['to bottom'].concat(transformObsoleteColorStops(args.slice(3))), bounds, !!prefix);
11733
- } else if (method === 'radial-gradient') {
11734
- return parseRadialGradient(container, prefix === '-webkit-' ? transformWebkitRadialGradientArgs(args) : args, bounds);
11735
- } else if (method === 'gradient' && args[0] === 'radial') {
11736
- return parseRadialGradient(container, transformObsoleteColorStops(transformWebkitRadialGradientArgs(args.slice(1))), bounds);
11737
  }
11738
- };
 
 
 
 
 
 
11739
 
11740
- var parseColorStops = function parseColorStops(args, firstColorStopIndex, lineLength) {
11741
- var colorStops = [];
11742
 
11743
- for (var i = firstColorStopIndex; i < args.length; i++) {
11744
- var value = args[i];
11745
- var HAS_LENGTH = ENDS_WITH_LENGTH.test(value);
11746
- var lastSpaceIndex = value.lastIndexOf(' ');
11747
- var _color = new _Color2.default(HAS_LENGTH ? value.substring(0, lastSpaceIndex) : value);
11748
- 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;
11749
- colorStops.push({ color: _color, stop: _stop });
11750
- }
11751
 
11752
- var absoluteValuedColorStops = colorStops.map(function (_ref2) {
11753
- var color = _ref2.color,
11754
- stop = _ref2.stop;
11755
 
11756
- var absoluteStop = lineLength === 0 ? 0 : stop ? stop.getAbsoluteValue(lineLength) / lineLength : null;
11757
 
11758
- return {
11759
- color: color,
11760
- // $FlowFixMe
11761
- stop: absoluteStop
11762
- };
11763
  });
11764
 
11765
- var previousColorStop = absoluteValuedColorStops[0].stop;
11766
- for (var _i = 0; _i < absoluteValuedColorStops.length; _i++) {
11767
- if (previousColorStop !== null) {
11768
- var _stop2 = absoluteValuedColorStops[_i].stop;
11769
- if (_stop2 === null) {
11770
- var n = _i;
11771
- while (absoluteValuedColorStops[n].stop === null) {
11772
- n++;
11773
- }
11774
- var steps = n - _i + 1;
11775
- var nextColorStep = absoluteValuedColorStops[n].stop;
11776
- var stepSize = (nextColorStep - previousColorStop) / steps;
11777
- for (; _i < n; _i++) {
11778
- previousColorStop = absoluteValuedColorStops[_i].stop = previousColorStop + stepSize;
11779
- }
11780
- } else {
11781
- previousColorStop = _stop2;
11782
- }
11783
- }
11784
  }
11785
 
11786
- return absoluteValuedColorStops;
11787
  };
11788
 
11789
- var parseLinearGradient = function parseLinearGradient(args, bounds, hasPrefix) {
11790
- var angle = (0, _Angle.parseAngle)(args[0]);
11791
- var HAS_SIDE_OR_CORNER = SIDE_OR_CORNER.test(args[0]);
11792
- var HAS_DIRECTION = HAS_SIDE_OR_CORNER || angle !== null || PERCENTAGE_ANGLES.test(args[0]);
11793
- var direction = HAS_DIRECTION ? angle !== null ? calculateGradientDirection(
11794
- // if there is a prefix, the 0° angle points due East (instead of North per W3C)
11795
- hasPrefix ? angle - Math.PI * 0.5 : angle, bounds) : HAS_SIDE_OR_CORNER ? parseSideOrCorner(args[0], bounds) : parsePercentageAngle(args[0], bounds) : calculateGradientDirection(Math.PI, bounds);
11796
- var firstColorStopIndex = HAS_DIRECTION ? 1 : 0;
11797
 
11798
- // TODO: Fix some inaccuracy with color stops with px values
11799
- 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);
11800
 
11801
- return new LinearGradient(parseColorStops(args, firstColorStopIndex, lineLength), direction);
11802
- };
11803
 
11804
- var parseRadialGradient = function parseRadialGradient(container, args, bounds) {
11805
- var m = args[0].match(RADIAL_SHAPE_DEFINITION);
11806
- var shape = m && (m[1] === 'circle' || // explicit shape specification
11807
- m[3] !== undefined && m[5] === undefined) // only one radius coordinate
11808
- ? RADIAL_GRADIENT_SHAPE.CIRCLE : RADIAL_GRADIENT_SHAPE.ELLIPSE;
11809
- var radius = {};
11810
- var center = {};
11811
 
11812
- if (m) {
11813
- // Radius
11814
- if (m[3] !== undefined) {
11815
- radius.x = (0, _Length.calculateLengthFromValueWithUnit)(container, m[3], m[4]).getAbsoluteValue(bounds.width);
11816
- }
11817
 
11818
- if (m[5] !== undefined) {
11819
- radius.y = (0, _Length.calculateLengthFromValueWithUnit)(container, m[5], m[6]).getAbsoluteValue(bounds.height);
11820
- }
11821
 
11822
- // Position
11823
- if (m[7]) {
11824
- center.x = LENGTH_FOR_POSITION[m[7].toLowerCase()];
11825
- } else if (m[8] !== undefined) {
11826
- center.x = (0, _Length.calculateLengthFromValueWithUnit)(container, m[8], m[9]);
11827
- }
11828
 
11829
- if (m[10]) {
11830
- center.y = LENGTH_FOR_POSITION[m[10].toLowerCase()];
11831
- } else if (m[11] !== undefined) {
11832
- center.y = (0, _Length.calculateLengthFromValueWithUnit)(container, m[11], m[12]);
11833
- }
 
 
 
11834
  }
11835
 
11836
- var gradientCenter = {
11837
- x: center.x === undefined ? bounds.width / 2 : center.x.getAbsoluteValue(bounds.width),
11838
- y: center.y === undefined ? bounds.height / 2 : center.y.getAbsoluteValue(bounds.height)
11839
- };
11840
- var gradientRadius = calculateRadius(m && m[2] || 'farthest-corner', shape, gradientCenter, radius, bounds);
 
11841
 
11842
- return new RadialGradient(parseColorStops(args, m ? 1 : 0, Math.min(gradientRadius.x, gradientRadius.y)), shape, gradientCenter, gradientRadius);
11843
- };
 
 
11844
 
11845
- var calculateGradientDirection = function calculateGradientDirection(radian, bounds) {
11846
- var width = bounds.width;
11847
- var height = bounds.height;
11848
- var HALF_WIDTH = width * 0.5;
11849
- var HALF_HEIGHT = height * 0.5;
11850
- var lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian));
11851
- var HALF_LINE_LENGTH = lineLength / 2;
11852
 
11853
- var x0 = HALF_WIDTH + Math.sin(radian) * HALF_LINE_LENGTH;
11854
- var y0 = HALF_HEIGHT - Math.cos(radian) * HALF_LINE_LENGTH;
11855
- var x1 = width - x0;
11856
- var y1 = height - y0;
11857
 
11858
- return { x0: x0, x1: x1, y0: y0, y1: y1 };
11859
- };
 
11860
 
11861
- var parseTopRight = function parseTopRight(bounds) {
11862
- return Math.acos(bounds.width / 2 / ((0, _Util.distance)(bounds.width, bounds.height) / 2));
11863
- };
11864
 
11865
- var parseSideOrCorner = function parseSideOrCorner(side, bounds) {
11866
- switch (side) {
11867
- case 'bottom':
11868
- case 'to top':
11869
- return calculateGradientDirection(0, bounds);
11870
- case 'left':
11871
- case 'to right':
11872
- return calculateGradientDirection(Math.PI / 2, bounds);
11873
- case 'right':
11874
- case 'to left':
11875
- return calculateGradientDirection(3 * Math.PI / 2, bounds);
11876
- case 'top right':
11877
- case 'right top':
11878
- case 'to bottom left':
11879
- case 'to left bottom':
11880
- return calculateGradientDirection(Math.PI + parseTopRight(bounds), bounds);
11881
- case 'top left':
11882
- case 'left top':
11883
- case 'to bottom right':
11884
- case 'to right bottom':
11885
- return calculateGradientDirection(Math.PI - parseTopRight(bounds), bounds);
11886
- case 'bottom left':
11887
- case 'left bottom':
11888
- case 'to top right':
11889
- case 'to right top':
11890
- return calculateGradientDirection(parseTopRight(bounds), bounds);
11891
- case 'bottom right':
11892
- case 'right bottom':
11893
- case 'to top left':
11894
- case 'to left top':
11895
- return calculateGradientDirection(2 * Math.PI - parseTopRight(bounds), bounds);
11896
- case 'top':
11897
- case 'to bottom':
11898
- default:
11899
- return calculateGradientDirection(Math.PI, bounds);
11900
- }
11901
- };
11902
 
11903
- var parsePercentageAngle = function parsePercentageAngle(angle, bounds) {
11904
- var _angle$split$map = angle.split(' ').map(parseFloat),
11905
- _angle$split$map2 = _slicedToArray(_angle$split$map, 2),
11906
- left = _angle$split$map2[0],
11907
- top = _angle$split$map2[1];
11908
 
11909
- var ratio = left / 100 * bounds.width / (top / 100 * bounds.height);
 
11910
 
11911
- return calculateGradientDirection(Math.atan(isNaN(ratio) ? 1 : ratio) + Math.PI / 2, bounds);
11912
- };
11913
 
11914
- var findCorner = function findCorner(bounds, x, y, closest) {
11915
- var corners = [{ x: 0, y: 0 }, { x: 0, y: bounds.height }, { x: bounds.width, y: 0 }, { x: bounds.width, y: bounds.height }];
11916
 
11917
- // $FlowFixMe
11918
- return corners.reduce(function (stat, corner) {
11919
- var d = (0, _Util.distance)(x - corner.x, y - corner.y);
11920
- if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {
11921
- return {
11922
- optimumCorner: corner,
11923
- optimumDistance: d
11924
- };
11925
- }
11926
 
11927
- return stat;
 
11928
  }, {
11929
- optimumDistance: closest ? Infinity : -Infinity,
11930
- optimumCorner: null
11931
- }).optimumCorner;
11932
- };
 
 
11933
 
11934
- var calculateRadius = function calculateRadius(extent, shape, center, radius, bounds) {
11935
- var x = center.x;
11936
- var y = center.y;
11937
- var rx = 0;
11938
- var ry = 0;
11939
 
11940
- switch (extent) {
11941
- case 'closest-side':
11942
- // The ending shape is sized so that that it exactly meets the side of the gradient box closest to the gradient’s center.
11943
- // If the shape is an ellipse, it exactly meets the closest side in each dimension.
11944
- if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
11945
- rx = ry = Math.min(Math.abs(x), Math.abs(x - bounds.width), Math.abs(y), Math.abs(y - bounds.height));
11946
- } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
11947
- rx = Math.min(Math.abs(x), Math.abs(x - bounds.width));
11948
- ry = Math.min(Math.abs(y), Math.abs(y - bounds.height));
11949
- }
11950
- break;
11951
 
11952
- case 'closest-corner':
11953
- // The ending shape is sized so that that it passes through the corner of the gradient box closest to the gradient’s center.
11954
- // If the shape is an ellipse, the ending shape is given the same aspect-ratio it would have if closest-side were specified.
11955
- if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
11956
- 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));
11957
- } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
11958
- // Compute the ratio ry/rx (which is to be the same as for "closest-side")
11959
- var c = Math.min(Math.abs(y), Math.abs(y - bounds.height)) / Math.min(Math.abs(x), Math.abs(x - bounds.width));
11960
- var corner = findCorner(bounds, x, y, true);
11961
- rx = (0, _Util.distance)(corner.x - x, (corner.y - y) / c);
11962
- ry = c * rx;
11963
- }
11964
- break;
11965
 
11966
- case 'farthest-side':
11967
- // Same as closest-side, except the ending shape is sized based on the farthest side(s)
11968
- if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
11969
- rx = ry = Math.max(Math.abs(x), Math.abs(x - bounds.width), Math.abs(y), Math.abs(y - bounds.height));
11970
- } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
11971
- rx = Math.max(Math.abs(x), Math.abs(x - bounds.width));
11972
- ry = Math.max(Math.abs(y), Math.abs(y - bounds.height));
11973
- }
11974
- break;
11975
 
11976
- case 'farthest-corner':
11977
- // Same as closest-corner, except the ending shape is sized based on the farthest corner.
11978
- // If the shape is an ellipse, the ending shape is given the same aspect ratio it would have if farthest-side were specified.
11979
- if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
11980
- 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));
11981
- } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
11982
- // Compute the ratio ry/rx (which is to be the same as for "farthest-side")
11983
- var _c = Math.max(Math.abs(y), Math.abs(y - bounds.height)) / Math.max(Math.abs(x), Math.abs(x - bounds.width));
11984
- var _corner = findCorner(bounds, x, y, false);
11985
- rx = (0, _Util.distance)(_corner.x - x, (_corner.y - y) / _c);
11986
- ry = _c * rx;
11987
- }
11988
- break;
11989
 
11990
- default:
11991
- // pixel or percentage values
11992
- rx = radius.x || 0;
11993
- ry = radius.y !== undefined ? radius.y : rx;
11994
- break;
11995
- }
11996
 
11997
- return {
11998
- x: rx,
11999
- y: ry
12000
- };
12001
- };
12002
-
12003
- var transformWebkitRadialGradientArgs = exports.transformWebkitRadialGradientArgs = function transformWebkitRadialGradientArgs(args) {
12004
- var shape = '';
12005
- var radius = '';
12006
- var extent = '';
12007
- var position = '';
12008
- var idx = 0;
12009
-
12010
- var POSITION = /^(left|center|right|\d+(?:px|r?em|%)?)(?:\s+(top|center|bottom|\d+(?:px|r?em|%)?))?$/i;
12011
- var SHAPE_AND_EXTENT = /^(circle|ellipse)?\s*(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)?$/i;
12012
- var RADIUS = /^\d+(px|r?em|%)?(?:\s+\d+(px|r?em|%)?)?$/i;
12013
-
12014
- var matchStartPosition = args[idx].match(POSITION);
12015
- if (matchStartPosition) {
12016
- idx++;
12017
- }
12018
 
12019
- var matchShapeExtent = args[idx].match(SHAPE_AND_EXTENT);
12020
- if (matchShapeExtent) {
12021
- shape = matchShapeExtent[1] || '';
12022
- extent = matchShapeExtent[2] || '';
12023
- if (extent === 'contain') {
12024
- extent = 'closest-side';
12025
- } else if (extent === 'cover') {
12026
- extent = 'farthest-corner';
12027
- }
12028
- idx++;
12029
- }
12030
 
12031
- var matchStartRadius = args[idx].match(RADIUS);
12032
- if (matchStartRadius) {
12033
- idx++;
12034
- }
12035
 
12036
- var matchEndPosition = args[idx].match(POSITION);
12037
- if (matchEndPosition) {
12038
- idx++;
12039
  }
 
12040
 
12041
- var matchEndRadius = args[idx].match(RADIUS);
12042
- if (matchEndRadius) {
12043
- idx++;
12044
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12045
 
12046
- var matchPosition = matchEndPosition || matchStartPosition;
12047
- if (matchPosition && matchPosition[1]) {
12048
- position = matchPosition[1] + (/^\d+$/.test(matchPosition[1]) ? 'px' : '');
12049
- if (matchPosition[2]) {
12050
- position += ' ' + matchPosition[2] + (/^\d+$/.test(matchPosition[2]) ? 'px' : '');
12051
- }
12052
- }
12053
 
12054
- var matchRadius = matchEndRadius || matchStartRadius;
12055
- if (matchRadius) {
12056
- radius = matchRadius[0];
12057
- if (!matchRadius[1]) {
12058
- radius += 'px';
12059
  }
12060
- }
12061
-
12062
- if (position && !shape && !radius && !extent) {
12063
- radius = position;
12064
- position = '';
12065
- }
12066
-
12067
- if (position) {
12068
- position = 'at ' + position;
12069
- }
12070
-
12071
- return [[shape, extent, radius, position].filter(function (s) {
12072
- return !!s;
12073
- }).join(' ')].concat(args.slice(idx));
12074
- };
12075
 
12076
- var transformObsoleteColorStops = function transformObsoleteColorStops(args) {
12077
- return args.map(function (color) {
12078
- return color.match(FROM_TO_COLORSTOP);
12079
- })
12080
- // $FlowFixMe
12081
- .map(function (v, index) {
12082
- if (!v) {
12083
- return args[index];
12084
  }
12085
 
12086
- switch (v[1]) {
12087
- case 'from':
12088
- return v[4] + ' 0%';
12089
- case 'to':
12090
- return v[4] + ' 100%';
12091
- case 'color-stop':
12092
- if (v[3] === '%') {
12093
- return v[4] + ' ' + v[2];
12094
- }
12095
- return v[4] + ' ' + parseFloat(v[2]) * 100 + '%';
12096
- }
12097
  });
12098
  };
12099
 
12100
  /***/ }),
12101
- /* 53 */
12102
  /***/ (function(module, exports, __webpack_require__) {
12103
 
12104
  "use strict";
12105
 
12106
 
12107
- Object.defineProperty(exports, "__esModule", {
12108
- value: true
12109
- });
12110
- var ANGLE = /([+-]?\d*\.?\d+)(deg|grad|rad|turn)/i;
12111
 
12112
- var parseAngle = exports.parseAngle = function parseAngle(angle) {
12113
- var match = angle.match(ANGLE);
12114
 
12115
- if (match) {
12116
- var value = parseFloat(match[1]);
12117
- switch (match[2].toLowerCase()) {
12118
- case 'deg':
12119
- return Math.PI * value / 180;
12120
- case 'grad':
12121
- return Math.PI / 200 * value;
12122
- case 'rad':
12123
- return value;
12124
- case 'turn':
12125
- return Math.PI * 2 * value;
12126
- }
 
 
 
 
 
12127
  }
12128
 
12129
- return null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12130
  };
12131
 
 
 
 
 
12132
  /***/ }),
12133
- /* 54 */
12134
  /***/ (function(module, exports, __webpack_require__) {
12135
 
12136
  "use strict";
@@ -12139,586 +13049,363 @@ var parseAngle = exports.parseAngle = function parseAngle(angle) {
12139
  Object.defineProperty(exports, "__esModule", {
12140
  value: true
12141
  });
12142
- exports.cloneWindow = exports.DocumentCloner = undefined;
12143
 
12144
  var _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"); } }; }();
12145
 
12146
- var _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; }; }();
12147
 
12148
- var _Bounds = __webpack_require__(2);
12149
 
12150
- var _Proxy = __webpack_require__(26);
12151
 
12152
- var _ResourceLoader = __webpack_require__(55);
12153
 
12154
- var _ResourceLoader2 = _interopRequireDefault(_ResourceLoader);
12155
 
12156
- var _Util = __webpack_require__(4);
12157
 
12158
- var _background = __webpack_require__(5);
12159
 
12160
- var _CanvasRenderer = __webpack_require__(15);
12161
 
12162
- var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);
12163
 
12164
- var _PseudoNodeContent = __webpack_require__(56);
 
 
 
 
 
 
 
 
12165
 
12166
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12167
 
12168
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
12169
 
12170
- var IGNORE_ATTRIBUTE = 'data-html2canvas-ignore';
12171
 
12172
- var DocumentCloner = exports.DocumentCloner = function () {
12173
- function DocumentCloner(element, options, logger, copyInline, renderer) {
12174
- _classCallCheck(this, DocumentCloner);
12175
 
12176
- this.referenceElement = element;
12177
- this.scrolledElements = [];
12178
- this.copyStyles = copyInline;
12179
- this.inlineImages = copyInline;
12180
- this.logger = logger;
12181
- this.options = options;
12182
- this.renderer = renderer;
12183
- this.resourceLoader = new _ResourceLoader2.default(options, logger, window);
12184
- this.pseudoContentData = {
12185
- counters: {},
12186
- quoteDepth: 0
12187
- };
12188
- // $FlowFixMe
12189
- this.documentElement = this.cloneNode(element.ownerDocument.documentElement);
12190
- }
12191
-
12192
- _createClass(DocumentCloner, [{
12193
- key: 'inlineAllImages',
12194
- value: function inlineAllImages(node) {
12195
- var _this = this;
12196
-
12197
- if (this.inlineImages && node) {
12198
- var style = node.style;
12199
- Promise.all((0, _background.parseBackgroundImage)(style.backgroundImage).map(function (backgroundImage) {
12200
- if (backgroundImage.method === 'url') {
12201
- return _this.resourceLoader.inlineImage(backgroundImage.args[0]).then(function (img) {
12202
- return img && typeof img.src === 'string' ? 'url("' + img.src + '")' : 'none';
12203
- }).catch(function (e) {
12204
- if (true) {
12205
- _this.logger.log('Unable to load image', e);
12206
- }
12207
- });
12208
- }
12209
- return Promise.resolve('' + backgroundImage.prefix + backgroundImage.method + '(' + backgroundImage.args.join(',') + ')');
12210
- })).then(function (backgroundImages) {
12211
- if (backgroundImages.length > 1) {
12212
- // TODO Multiple backgrounds somehow broken in Chrome
12213
- style.backgroundColor = '';
12214
- }
12215
- style.backgroundImage = backgroundImages.join(',');
12216
- });
12217
 
12218
- if (node instanceof HTMLImageElement) {
12219
- this.resourceLoader.inlineImage(node.src).then(function (img) {
12220
- if (img && node instanceof HTMLImageElement && node.parentNode) {
12221
- var parentNode = node.parentNode;
12222
- var clonedChild = (0, _Util.copyCSSStyles)(node.style, img.cloneNode(false));
12223
- parentNode.replaceChild(clonedChild, node);
12224
- }
12225
- }).catch(function (e) {
12226
- if (true) {
12227
- _this.logger.log('Unable to load image', e);
12228
- }
12229
- });
12230
- }
12231
  }
12232
- }
12233
- }, {
12234
- key: 'inlineFonts',
12235
- value: function inlineFonts(document) {
12236
- var _this2 = this;
12237
 
12238
- return Promise.all(Array.from(document.styleSheets).map(function (sheet) {
12239
- if (sheet.href) {
12240
- return fetch(sheet.href).then(function (res) {
12241
- return res.text();
12242
- }).then(function (text) {
12243
- return createStyleSheetFontsFromText(text, sheet.href);
12244
- }).catch(function (e) {
12245
- if (true) {
12246
- _this2.logger.log('Unable to load stylesheet', e);
12247
- }
12248
- return [];
12249
- });
12250
- }
12251
- return getSheetFonts(sheet, document);
12252
- })).then(function (fonts) {
12253
- return fonts.reduce(function (acc, font) {
12254
- return acc.concat(font);
12255
- }, []);
12256
- }).then(function (fonts) {
12257
- return Promise.all(fonts.map(function (font) {
12258
- return fetch(font.formats[0].src).then(function (response) {
12259
- return response.blob();
12260
- }).then(function (blob) {
12261
- return new Promise(function (resolve, reject) {
12262
- var reader = new FileReader();
12263
- reader.onerror = reject;
12264
- reader.onload = function () {
12265
- // $FlowFixMe
12266
- var result = reader.result;
12267
- resolve(result);
12268
- };
12269
- reader.readAsDataURL(blob);
12270
- });
12271
- }).then(function (dataUri) {
12272
- font.fontFace.setProperty('src', 'url("' + dataUri + '")');
12273
- return '@font-face {' + font.fontFace.cssText + ' ';
12274
- });
12275
- }));
12276
- }).then(function (fontCss) {
12277
- var style = document.createElement('style');
12278
- style.textContent = fontCss.join('\n');
12279
- _this2.documentElement.appendChild(style);
12280
- });
12281
- }
12282
- }, {
12283
- key: 'createElementClone',
12284
- value: function createElementClone(node) {
12285
- var _this3 = this;
12286
 
12287
- if (this.copyStyles && node instanceof HTMLCanvasElement) {
12288
- var img = node.ownerDocument.createElement('img');
12289
- try {
12290
- img.src = node.toDataURL();
12291
- return img;
12292
- } catch (e) {
12293
- if (true) {
12294
- this.logger.log('Unable to clone canvas contents, canvas is tainted');
12295
- }
12296
- }
12297
- }
12298
 
12299
- if (node instanceof HTMLIFrameElement) {
12300
- var tempIframe = node.cloneNode(false);
12301
- var iframeKey = generateIframeKey();
12302
- tempIframe.setAttribute('data-html2canvas-internal-iframe-key', iframeKey);
12303
 
12304
- var _parseBounds = (0, _Bounds.parseBounds)(node, 0, 0),
12305
- width = _parseBounds.width,
12306
- height = _parseBounds.height;
 
 
12307
 
12308
- this.resourceLoader.cache[iframeKey] = getIframeDocumentElement(node, this.options).then(function (documentElement) {
12309
- return _this3.renderer(documentElement, {
12310
- async: _this3.options.async,
12311
- allowTaint: _this3.options.allowTaint,
12312
- backgroundColor: '#ffffff',
12313
- canvas: null,
12314
- imageTimeout: _this3.options.imageTimeout,
12315
- logging: _this3.options.logging,
12316
- proxy: _this3.options.proxy,
12317
- removeContainer: _this3.options.removeContainer,
12318
- scale: _this3.options.scale,
12319
- foreignObjectRendering: _this3.options.foreignObjectRendering,
12320
- useCORS: _this3.options.useCORS,
12321
- target: new _CanvasRenderer2.default(),
12322
- width: width,
12323
- height: height,
12324
- x: 0,
12325
- y: 0,
12326
- windowWidth: documentElement.ownerDocument.defaultView.innerWidth,
12327
- windowHeight: documentElement.ownerDocument.defaultView.innerHeight,
12328
- scrollX: documentElement.ownerDocument.defaultView.pageXOffset,
12329
- scrollY: documentElement.ownerDocument.defaultView.pageYOffset
12330
- }, _this3.logger.child(iframeKey));
12331
- }).then(function (canvas) {
12332
- return new Promise(function (resolve, reject) {
12333
- var iframeCanvas = document.createElement('img');
12334
- iframeCanvas.onload = function () {
12335
- return resolve(canvas);
12336
- };
12337
- iframeCanvas.onerror = reject;
12338
- iframeCanvas.src = canvas.toDataURL();
12339
- if (tempIframe.parentNode) {
12340
- tempIframe.parentNode.replaceChild((0, _Util.copyCSSStyles)(node.ownerDocument.defaultView.getComputedStyle(node), iframeCanvas), tempIframe);
12341
- }
12342
- });
12343
  });
12344
- return tempIframe;
12345
- }
 
 
 
 
12346
 
12347
- if (node instanceof HTMLStyleElement && node.sheet && node.sheet.cssRules) {
12348
- var css = [].slice.call(node.sheet.cssRules, 0).reduce(function (css, rule) {
12349
- try {
12350
- if (rule && rule.cssText) {
12351
- return css + rule.cssText;
12352
- }
12353
- return css;
12354
- } catch (err) {
12355
- _this3.logger.log('Unable to access cssText property', rule.name);
12356
- return css;
12357
- }
12358
- }, '');
12359
- var style = node.cloneNode(false);
12360
- style.textContent = css;
12361
- return style;
12362
  }
12363
 
12364
- return node.cloneNode(false);
12365
- }
12366
- }, {
12367
- key: 'cloneNode',
12368
- value: function cloneNode(node) {
12369
- var clone = node.nodeType === Node.TEXT_NODE ? document.createTextNode(node.nodeValue) : this.createElementClone(node);
12370
-
12371
- var window = node.ownerDocument.defaultView;
12372
- var style = node instanceof window.HTMLElement ? window.getComputedStyle(node) : null;
12373
- var styleBefore = node instanceof window.HTMLElement ? window.getComputedStyle(node, ':before') : null;
12374
- var styleAfter = node instanceof window.HTMLElement ? window.getComputedStyle(node, ':after') : null;
12375
 
12376
- if (this.referenceElement === node && clone instanceof window.HTMLElement) {
12377
- this.clonedReferenceElement = clone;
12378
  }
12379
 
12380
- if (clone instanceof window.HTMLBodyElement) {
12381
- createPseudoHideStyles(clone);
12382
- }
 
 
12383
 
12384
- var counters = (0, _PseudoNodeContent.parseCounterReset)(style, this.pseudoContentData);
12385
- var contentBefore = (0, _PseudoNodeContent.resolvePseudoContent)(node, styleBefore, this.pseudoContentData);
 
12386
 
12387
- for (var child = node.firstChild; child; child = child.nextSibling) {
12388
- if (child.nodeType !== Node.ELEMENT_NODE || child.nodeName !== 'SCRIPT' &&
12389
- // $FlowFixMe
12390
- !child.hasAttribute(IGNORE_ATTRIBUTE) && (typeof this.options.ignoreElements !== 'function' ||
12391
- // $FlowFixMe
12392
- !this.options.ignoreElements(child))) {
12393
- if (!this.copyStyles || child.nodeName !== 'STYLE') {
12394
- clone.appendChild(this.cloneNode(child));
12395
- }
12396
- }
12397
- }
12398
 
12399
- var contentAfter = (0, _PseudoNodeContent.resolvePseudoContent)(node, styleAfter, this.pseudoContentData);
12400
- (0, _PseudoNodeContent.popCounters)(counters, this.pseudoContentData);
12401
-
12402
- if (node instanceof window.HTMLElement && clone instanceof window.HTMLElement) {
12403
- if (styleBefore) {
12404
- this.inlineAllImages(inlinePseudoElement(node, clone, styleBefore, contentBefore, PSEUDO_BEFORE));
12405
- }
12406
- if (styleAfter) {
12407
- this.inlineAllImages(inlinePseudoElement(node, clone, styleAfter, contentAfter, PSEUDO_AFTER));
12408
- }
12409
- if (style && this.copyStyles && !(node instanceof HTMLIFrameElement)) {
12410
- (0, _Util.copyCSSStyles)(style, clone);
12411
- }
12412
- this.inlineAllImages(clone);
12413
- if (node.scrollTop !== 0 || node.scrollLeft !== 0) {
12414
- this.scrolledElements.push([clone, node.scrollLeft, node.scrollTop]);
12415
- }
12416
- switch (node.nodeName) {
12417
- case 'CANVAS':
12418
- if (!this.copyStyles) {
12419
- cloneCanvasContents(node, clone);
12420
- }
12421
- break;
12422
- case 'TEXTAREA':
12423
- case 'SELECT':
12424
- clone.value = node.value;
12425
- break;
12426
- }
12427
- }
12428
- return clone;
12429
- }
12430
- }]);
12431
-
12432
- return DocumentCloner;
12433
- }();
12434
-
12435
- var getSheetFonts = function getSheetFonts(sheet, document) {
12436
- // $FlowFixMe
12437
- return (sheet.cssRules ? Array.from(sheet.cssRules) : []).filter(function (rule) {
12438
- return rule.type === CSSRule.FONT_FACE_RULE;
12439
- }).map(function (rule) {
12440
- var src = (0, _background.parseBackgroundImage)(rule.style.getPropertyValue('src'));
12441
- var formats = [];
12442
- for (var i = 0; i < src.length; i++) {
12443
- if (src[i].method === 'url' && src[i + 1] && src[i + 1].method === 'format') {
12444
- var a = document.createElement('a');
12445
- a.href = src[i].args[0];
12446
- if (document.body) {
12447
- document.body.appendChild(a);
12448
- }
12449
 
12450
- var font = {
12451
- src: a.href,
12452
- format: src[i + 1].args[0]
 
 
 
 
 
 
 
12453
  };
12454
- formats.push(font);
12455
- }
12456
- }
12457
 
12458
- return {
12459
- // TODO select correct format for browser),
 
 
 
 
 
 
 
 
 
 
 
 
 
12460
 
12461
- formats: formats.filter(function (font) {
12462
- return (/^woff/i.test(font.format)
12463
- );
12464
- }),
12465
- fontFace: rule.style
12466
- };
12467
- }).filter(function (font) {
12468
- return font.formats.length;
12469
  });
12470
  };
12471
 
12472
- var createStyleSheetFontsFromText = function createStyleSheetFontsFromText(text, baseHref) {
12473
- var doc = document.implementation.createHTMLDocument('');
12474
- var base = document.createElement('base');
12475
- // $FlowFixMe
12476
- base.href = baseHref;
12477
- var style = document.createElement('style');
12478
 
12479
- style.textContent = text;
12480
- if (doc.head) {
12481
- doc.head.appendChild(base);
12482
- }
12483
- if (doc.body) {
12484
- doc.body.appendChild(style);
12485
- }
12486
 
12487
- return style.sheet ? getSheetFonts(style.sheet, doc) : [];
12488
- };
12489
 
12490
- var restoreOwnerScroll = function restoreOwnerScroll(ownerDocument, x, y) {
12491
- if (ownerDocument.defaultView && (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)) {
12492
- ownerDocument.defaultView.scrollTo(x, y);
12493
- }
12494
- };
12495
 
12496
- var cloneCanvasContents = function cloneCanvasContents(canvas, clonedCanvas) {
12497
- try {
12498
- if (clonedCanvas) {
12499
- clonedCanvas.width = canvas.width;
12500
- clonedCanvas.height = canvas.height;
12501
- var ctx = canvas.getContext('2d');
12502
- var clonedCtx = clonedCanvas.getContext('2d');
12503
- if (ctx) {
12504
- clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
12505
- } else {
12506
- clonedCtx.drawImage(canvas, 0, 0);
12507
- }
12508
- }
12509
- } catch (e) {}
12510
- };
12511
 
12512
- var inlinePseudoElement = function inlinePseudoElement(node, clone, style, contentItems, pseudoElt) {
12513
- if (!style || !style.content || style.content === 'none' || style.content === '-moz-alt-content' || style.display === 'none') {
12514
- return;
12515
- }
12516
 
12517
- var anonymousReplacedElement = clone.ownerDocument.createElement('html2canvaspseudoelement');
12518
- (0, _Util.copyCSSStyles)(style, anonymousReplacedElement);
12519
 
12520
- if (contentItems) {
12521
- var len = contentItems.length;
12522
- for (var i = 0; i < len; i++) {
12523
- var item = contentItems[i];
12524
- switch (item.type) {
12525
- case _PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE.IMAGE:
12526
- var img = clone.ownerDocument.createElement('img');
12527
- img.src = (0, _background.parseBackgroundImage)('url(' + item.value + ')')[0].args[0];
12528
- img.style.opacity = '1';
12529
- anonymousReplacedElement.appendChild(img);
12530
- break;
12531
- case _PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE.TEXT:
12532
- anonymousReplacedElement.appendChild(clone.ownerDocument.createTextNode(item.value));
12533
- break;
12534
- }
12535
- }
12536
- }
12537
 
12538
- anonymousReplacedElement.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + ' ' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
12539
- clone.className += pseudoElt === PSEUDO_BEFORE ? ' ' + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE : ' ' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
12540
- if (pseudoElt === PSEUDO_BEFORE) {
12541
- clone.insertBefore(anonymousReplacedElement, clone.firstChild);
12542
- } else {
12543
- clone.appendChild(anonymousReplacedElement);
12544
- }
12545
 
12546
- return anonymousReplacedElement;
12547
- };
12548
 
12549
- var URL_REGEXP = /^url\((.+)\)$/i;
12550
- var PSEUDO_BEFORE = ':before';
12551
- var PSEUDO_AFTER = ':after';
12552
- var PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = '___html2canvas___pseudoelement_before';
12553
- var PSEUDO_HIDE_ELEMENT_CLASS_AFTER = '___html2canvas___pseudoelement_after';
12554
 
12555
- var PSEUDO_HIDE_ELEMENT_STYLE = '{\n content: "" !important;\n display: none !important;\n}';
12556
 
12557
- var createPseudoHideStyles = function createPseudoHideStyles(body) {
12558
- 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);
12559
- };
12560
 
12561
- var createStyles = function createStyles(body, styles) {
12562
- var style = body.ownerDocument.createElement('style');
12563
- style.innerHTML = styles;
12564
- body.appendChild(style);
12565
- };
12566
 
12567
- var initNode = function initNode(_ref) {
12568
- var _ref2 = _slicedToArray(_ref, 3),
12569
- element = _ref2[0],
12570
- x = _ref2[1],
12571
- y = _ref2[2];
12572
 
12573
- element.scrollLeft = x;
12574
- element.scrollTop = y;
12575
- };
12576
 
12577
- var generateIframeKey = function generateIframeKey() {
12578
- return Math.ceil(Date.now() + Math.random() * 10000000).toString(16);
12579
- };
12580
 
12581
- var DATA_URI_REGEXP = /^data:text\/(.+);(base64)?,(.*)$/i;
12582
 
12583
- var getIframeDocumentElement = function getIframeDocumentElement(node, options) {
12584
- try {
12585
- return Promise.resolve(node.contentWindow.document.documentElement);
12586
- } catch (e) {
12587
- return options.proxy ? (0, _Proxy.Proxy)(node.src, options).then(function (html) {
12588
- var match = html.match(DATA_URI_REGEXP);
12589
- if (!match) {
12590
- return Promise.reject();
12591
- }
12592
 
12593
- return match[2] === 'base64' ? window.atob(decodeURIComponent(match[3])) : decodeURIComponent(match[3]);
12594
- }).then(function (html) {
12595
- return createIframeContainer(node.ownerDocument, (0, _Bounds.parseBounds)(node, 0, 0)).then(function (cloneIframeContainer) {
12596
- var cloneWindow = cloneIframeContainer.contentWindow;
12597
- var documentClone = cloneWindow.document;
12598
 
12599
- documentClone.open();
12600
- documentClone.write(html);
12601
- var iframeLoad = iframeLoader(cloneIframeContainer).then(function () {
12602
- return documentClone.documentElement;
12603
- });
12604
 
12605
- documentClone.close();
12606
- return iframeLoad;
12607
- });
12608
- }) : Promise.reject();
12609
  }
12610
- };
12611
 
12612
- var createIframeContainer = function createIframeContainer(ownerDocument, bounds) {
12613
- var cloneIframeContainer = ownerDocument.createElement('iframe');
12614
-
12615
- cloneIframeContainer.className = 'html2canvas-container';
12616
- cloneIframeContainer.style.visibility = 'hidden';
12617
- cloneIframeContainer.style.position = 'fixed';
12618
- cloneIframeContainer.style.left = '-10000px';
12619
- cloneIframeContainer.style.top = '0px';
12620
- cloneIframeContainer.style.border = '0';
12621
- cloneIframeContainer.width = bounds.width.toString();
12622
- cloneIframeContainer.height = bounds.height.toString();
12623
- cloneIframeContainer.scrolling = 'no'; // ios won't scroll without it
12624
- cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, 'true');
12625
- if (!ownerDocument.body) {
12626
- return Promise.reject( true ? 'Body element not found in Document that is getting rendered' : '');
12627
- }
 
 
 
 
 
 
 
12628
 
12629
- ownerDocument.body.appendChild(cloneIframeContainer);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12630
 
12631
- return Promise.resolve(cloneIframeContainer);
 
12632
  };
12633
 
12634
- var iframeLoader = function iframeLoader(cloneIframeContainer) {
12635
- var cloneWindow = cloneIframeContainer.contentWindow;
12636
- var documentClone = cloneWindow.document;
12637
 
12638
- return new Promise(function (resolve, reject) {
12639
- cloneWindow.onload = cloneIframeContainer.onload = documentClone.onreadystatechange = function () {
12640
- var interval = setInterval(function () {
12641
- if (documentClone.body.childNodes.length > 0 && documentClone.readyState === 'complete') {
12642
- clearInterval(interval);
12643
- resolve(cloneIframeContainer);
12644
- }
12645
- }, 50);
12646
- };
12647
- });
12648
  };
12649
 
12650
- var cloneWindow = exports.cloneWindow = function cloneWindow(ownerDocument, bounds, referenceElement, options, logger, renderer) {
12651
- var cloner = new DocumentCloner(referenceElement, options, logger, false, renderer);
12652
- var scrollX = ownerDocument.defaultView.pageXOffset;
12653
- var scrollY = ownerDocument.defaultView.pageYOffset;
12654
 
12655
- return createIframeContainer(ownerDocument, bounds).then(function (cloneIframeContainer) {
12656
- var cloneWindow = cloneIframeContainer.contentWindow;
12657
- var documentClone = cloneWindow.document;
12658
 
12659
- /* Chrome doesn't detect relative background-images assigned in inline <style> sheets when fetched through getComputedStyle
12660
- if window url is about:blank, we can assign the url to current by writing onto the document
12661
- */
12662
 
12663
- var iframeLoad = iframeLoader(cloneIframeContainer).then(function () {
12664
- cloner.scrolledElements.forEach(initNode);
12665
- cloneWindow.scrollTo(bounds.left, bounds.top);
12666
- if (/(iPad|iPhone|iPod)/g.test(navigator.userAgent) && (cloneWindow.scrollY !== bounds.top || cloneWindow.scrollX !== bounds.left)) {
12667
- documentClone.documentElement.style.top = -bounds.top + 'px';
12668
- documentClone.documentElement.style.left = -bounds.left + 'px';
12669
- documentClone.documentElement.style.position = 'absolute';
12670
- }
12671
 
12672
- var result = Promise.resolve([cloneIframeContainer, cloner.clonedReferenceElement, cloner.resourceLoader]);
12673
 
12674
- var onclone = options.onclone;
12675
 
12676
- return cloner.clonedReferenceElement instanceof cloneWindow.HTMLElement || cloner.clonedReferenceElement instanceof ownerDocument.defaultView.HTMLElement || cloner.clonedReferenceElement instanceof HTMLElement ? typeof onclone === 'function' ? Promise.resolve().then(function () {
12677
- return onclone(documentClone);
12678
- }).then(function () {
12679
- return result;
12680
- }) : result : Promise.reject( true ? 'Error finding the ' + referenceElement.nodeName + ' in the cloned document' : '');
12681
- });
12682
 
12683
- documentClone.open();
12684
- documentClone.write(serializeDoctype(document.doctype) + '<html></html>');
12685
- // Chrome scrolls the parent document for some reason after the write to the cloned window???
12686
- restoreOwnerScroll(referenceElement.ownerDocument, scrollX, scrollY);
12687
- documentClone.replaceChild(documentClone.adoptNode(cloner.documentElement), documentClone.documentElement);
12688
- documentClone.close();
12689
 
12690
- return iframeLoad;
12691
- });
12692
- };
12693
 
12694
- var serializeDoctype = function serializeDoctype(doctype) {
12695
- var str = '';
12696
- if (doctype) {
12697
- str += '<!DOCTYPE ';
12698
- if (doctype.name) {
12699
- str += doctype.name;
12700
- }
12701
 
12702
- if (doctype.internalSubset) {
12703
- str += doctype.internalSubset;
12704
- }
12705
 
12706
- if (doctype.publicId) {
12707
- str += '"' + doctype.publicId + '"';
12708
- }
 
 
 
12709
 
12710
- if (doctype.systemId) {
12711
- str += '"' + doctype.systemId + '"';
 
 
 
 
 
 
 
12712
  }
 
12713
 
12714
- str += '>';
12715
- }
12716
 
12717
- return str;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12718
  };
12719
 
 
 
12720
  /***/ }),
12721
- /* 55 */
12722
  /***/ (function(module, exports, __webpack_require__) {
12723
 
12724
  "use strict";
@@ -12727,275 +13414,94 @@ var serializeDoctype = function serializeDoctype(doctype) {
12727
  Object.defineProperty(exports, "__esModule", {
12728
  value: true
12729
  });
12730
- exports.ResourceStore = undefined;
12731
 
12732
  var _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; }; }();
12733
 
12734
- var _Feature = __webpack_require__(10);
12735
 
12736
- var _Feature2 = _interopRequireDefault(_Feature);
12737
 
12738
- var _Proxy = __webpack_require__(26);
12739
 
12740
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12741
 
12742
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12743
 
12744
- var ResourceLoader = function () {
12745
- function ResourceLoader(options, logger, window) {
12746
- _classCallCheck(this, ResourceLoader);
12747
 
12748
- this.options = options;
12749
- this._window = window;
12750
- this.origin = this.getOrigin(window.location.href);
12751
- this.cache = {};
12752
- this.logger = logger;
12753
- this._index = 0;
 
 
 
12754
  }
12755
 
12756
- _createClass(ResourceLoader, [{
12757
- key: 'loadImage',
12758
- value: function loadImage(src) {
12759
- var _this = this;
 
 
 
 
 
 
 
 
 
 
 
 
 
12760
 
12761
- if (this.hasResourceInCache(src)) {
12762
- return src;
12763
- }
12764
- if (isBlobImage(src)) {
12765
- this.cache[src] = _loadImage(src, this.options.imageTimeout || 0);
12766
- return src;
12767
- }
12768
-
12769
- if (!isSVG(src) || _Feature2.default.SUPPORT_SVG_DRAWING) {
12770
- if (this.options.allowTaint === true || isInlineImage(src) || this.isSameOrigin(src)) {
12771
- return this.addImage(src, src, false);
12772
- } else if (!this.isSameOrigin(src)) {
12773
- if (typeof this.options.proxy === 'string') {
12774
- this.cache[src] = (0, _Proxy.Proxy)(src, this.options).then(function (src) {
12775
- return _loadImage(src, _this.options.imageTimeout || 0);
12776
- });
12777
- return src;
12778
- } else if (this.options.useCORS === true && _Feature2.default.SUPPORT_CORS_IMAGES) {
12779
- return this.addImage(src, src, true);
12780
- }
12781
- }
12782
- }
12783
- }
12784
- }, {
12785
- key: 'inlineImage',
12786
- value: function inlineImage(src) {
12787
- var _this2 = this;
12788
-
12789
- if (isInlineImage(src)) {
12790
- return _loadImage(src, this.options.imageTimeout || 0);
12791
- }
12792
- if (this.hasResourceInCache(src)) {
12793
- return this.cache[src];
12794
- }
12795
- if (!this.isSameOrigin(src) && typeof this.options.proxy === 'string') {
12796
- return this.cache[src] = (0, _Proxy.Proxy)(src, this.options).then(function (src) {
12797
- return _loadImage(src, _this2.options.imageTimeout || 0);
12798
- });
12799
- }
12800
-
12801
- return this.xhrImage(src);
12802
- }
12803
- }, {
12804
- key: 'xhrImage',
12805
- value: function xhrImage(src) {
12806
- var _this3 = this;
12807
-
12808
- this.cache[src] = new Promise(function (resolve, reject) {
12809
- var xhr = new XMLHttpRequest();
12810
- xhr.onreadystatechange = function () {
12811
- if (xhr.readyState === 4) {
12812
- if (xhr.status !== 200) {
12813
- reject('Failed to fetch image ' + src.substring(0, 256) + ' with status code ' + xhr.status);
12814
- } else {
12815
- var reader = new FileReader();
12816
- reader.addEventListener('load', function () {
12817
- // $FlowFixMe
12818
- var result = reader.result;
12819
- resolve(result);
12820
- }, false);
12821
- reader.addEventListener('error', function (e) {
12822
- return reject(e);
12823
- }, false);
12824
- reader.readAsDataURL(xhr.response);
12825
- }
12826
- }
12827
- };
12828
- xhr.responseType = 'blob';
12829
- if (_this3.options.imageTimeout) {
12830
- var timeout = _this3.options.imageTimeout;
12831
- xhr.timeout = timeout;
12832
- xhr.ontimeout = function () {
12833
- return reject( true ? 'Timed out (' + timeout + 'ms) fetching ' + src.substring(0, 256) : '');
12834
- };
12835
- }
12836
- xhr.open('GET', src, true);
12837
- xhr.send();
12838
- }).then(function (src) {
12839
- return _loadImage(src, _this3.options.imageTimeout || 0);
12840
- });
12841
-
12842
- return this.cache[src];
12843
- }
12844
- }, {
12845
- key: 'loadCanvas',
12846
- value: function loadCanvas(node) {
12847
- var key = String(this._index++);
12848
- this.cache[key] = Promise.resolve(node);
12849
- return key;
12850
- }
12851
- }, {
12852
- key: 'hasResourceInCache',
12853
- value: function hasResourceInCache(key) {
12854
- return typeof this.cache[key] !== 'undefined';
12855
- }
12856
- }, {
12857
- key: 'addImage',
12858
- value: function addImage(key, src, useCORS) {
12859
- var _this4 = this;
12860
-
12861
- if (true) {
12862
- this.logger.log('Added image ' + key.substring(0, 256));
12863
- }
12864
-
12865
- var imageLoadHandler = function imageLoadHandler(supportsDataImages) {
12866
- return new Promise(function (resolve, reject) {
12867
- var img = new Image();
12868
- img.onload = function () {
12869
- return resolve(img);
12870
- };
12871
- //ios safari 10.3 taints canvas with data urls unless crossOrigin is set to anonymous
12872
- if (!supportsDataImages || useCORS) {
12873
- img.crossOrigin = 'anonymous';
12874
- }
12875
 
12876
- img.onerror = reject;
12877
- img.src = src;
12878
- if (img.complete === true) {
12879
- // Inline XML images may fail to parse, throwing an Error later on
12880
- setTimeout(function () {
12881
- resolve(img);
12882
- }, 500);
12883
- }
12884
- if (_this4.options.imageTimeout) {
12885
- var timeout = _this4.options.imageTimeout;
12886
- setTimeout(function () {
12887
- return reject( true ? 'Timed out (' + timeout + 'ms) fetching ' + src.substring(0, 256) : '');
12888
- }, timeout);
12889
- }
12890
- });
12891
- };
12892
 
12893
- this.cache[key] = isInlineBase64Image(src) && !isSVG(src) ? // $FlowFixMe
12894
- _Feature2.default.SUPPORT_BASE64_DRAWING(src).then(imageLoadHandler) : imageLoadHandler(true);
12895
- return key;
12896
- }
12897
- }, {
12898
- key: 'isSameOrigin',
12899
- value: function isSameOrigin(url) {
12900
- return this.getOrigin(url) === this.origin;
12901
- }
12902
- }, {
12903
- key: 'getOrigin',
12904
- value: function getOrigin(url) {
12905
- var link = this._link || (this._link = this._window.document.createElement('a'));
12906
- link.href = url;
12907
- link.href = link.href; // IE9, LOL! - http://jsfiddle.net/niklasvh/2e48b/
12908
- return link.protocol + link.hostname + link.port;
12909
- }
12910
- }, {
12911
- key: 'ready',
12912
- value: function ready() {
12913
- var _this5 = this;
12914
 
12915
- var keys = Object.keys(this.cache);
12916
- var values = keys.map(function (str) {
12917
- return _this5.cache[str].catch(function (e) {
12918
- if (true) {
12919
- _this5.logger.log('Unable to load image', e);
12920
- }
12921
- return null;
12922
- });
12923
- });
12924
- return Promise.all(values).then(function (images) {
12925
- if (true) {
12926
- _this5.logger.log('Finished loading ' + images.length + ' images', images);
12927
- }
12928
- return new ResourceStore(keys, images);
12929
- });
12930
- }
12931
- }]);
12932
 
12933
- return ResourceLoader;
12934
- }();
12935
 
12936
- exports.default = ResourceLoader;
 
 
 
12937
 
12938
- var ResourceStore = exports.ResourceStore = function () {
12939
- function ResourceStore(keys, resources) {
12940
- _classCallCheck(this, ResourceStore);
12941
 
12942
- this._keys = keys;
12943
- this._resources = resources;
12944
- }
12945
 
12946
- _createClass(ResourceStore, [{
12947
- key: 'get',
12948
- value: function get(key) {
12949
- var index = this._keys.indexOf(key);
12950
- return index === -1 ? null : this._resources[index];
12951
- }
12952
- }]);
12953
 
12954
- return ResourceStore;
12955
- }();
12956
 
12957
- var INLINE_SVG = /^data:image\/svg\+xml/i;
12958
- var INLINE_BASE64 = /^data:image\/.*;base64,/i;
12959
- var INLINE_IMG = /^data:image\/.*/i;
12960
 
12961
- var isInlineImage = function isInlineImage(src) {
12962
- return INLINE_IMG.test(src);
12963
- };
12964
- var isInlineBase64Image = function isInlineBase64Image(src) {
12965
- return INLINE_BASE64.test(src);
12966
- };
12967
- var isBlobImage = function isBlobImage(src) {
12968
- return src.substr(0, 4) === 'blob';
12969
- };
12970
 
12971
- var isSVG = function isSVG(src) {
12972
- return src.substr(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src);
12973
- };
 
12974
 
12975
- var _loadImage = function _loadImage(src, timeout) {
12976
- return new Promise(function (resolve, reject) {
12977
- var img = new Image();
12978
- img.onload = function () {
12979
- return resolve(img);
12980
- };
12981
- img.onerror = reject;
12982
- img.src = src;
12983
- if (img.complete === true) {
12984
- // Inline XML images may fail to parse, throwing an Error later on
12985
- setTimeout(function () {
12986
- resolve(img);
12987
- }, 500);
12988
- }
12989
- if (timeout) {
12990
- setTimeout(function () {
12991
- return reject( true ? 'Timed out (' + timeout + 'ms) loading image' : '');
12992
- }, timeout);
12993
- }
12994
  });
12995
  };
12996
 
12997
  /***/ }),
12998
- /* 56 */
12999
  /***/ (function(module, exports, __webpack_require__) {
13000
 
13001
  "use strict";
@@ -13004,6236 +13510,6135 @@ var _loadImage = function _loadImage(src, timeout) {
13004
  Object.defineProperty(exports, "__esModule", {
13005
  value: true
13006
  });
13007
- exports.parseContent = exports.resolvePseudoContent = exports.popCounters = exports.parseCounterReset = exports.TOKEN_TYPE = exports.PSEUDO_CONTENT_ITEM_TYPE = undefined;
13008
-
13009
- var _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"); } }; }();
13010
-
13011
- var _ListItem = __webpack_require__(14);
13012
-
13013
- var _listStyle = __webpack_require__(8);
13014
-
13015
- var PSEUDO_CONTENT_ITEM_TYPE = exports.PSEUDO_CONTENT_ITEM_TYPE = {
13016
- TEXT: 0,
13017
- IMAGE: 1
13018
- };
13019
-
13020
- var TOKEN_TYPE = exports.TOKEN_TYPE = {
13021
- STRING: 0,
13022
- ATTRIBUTE: 1,
13023
- URL: 2,
13024
- COUNTER: 3,
13025
- COUNTERS: 4,
13026
- OPENQUOTE: 5,
13027
- CLOSEQUOTE: 6
 
 
 
 
 
 
 
 
 
 
13028
  };
13029
 
13030
- var parseCounterReset = exports.parseCounterReset = function parseCounterReset(style, data) {
13031
- if (!style || !style.counterReset || style.counterReset === 'none') {
13032
- return [];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13033
  }
13034
 
13035
- var counterNames = [];
13036
- var counterResets = style.counterReset.split(/\s*,\s*/);
13037
- var lenCounterResets = counterResets.length;
13038
-
13039
- for (var i = 0; i < lenCounterResets; i++) {
13040
- var _counterResets$i$spli = counterResets[i].split(/\s+/),
13041
- _counterResets$i$spli2 = _slicedToArray(_counterResets$i$spli, 2),
13042
- counterName = _counterResets$i$spli2[0],
13043
- initialValue = _counterResets$i$spli2[1];
13044
-
13045
- counterNames.push(counterName);
13046
- var counter = data.counters[counterName];
13047
- if (!counter) {
13048
- counter = data.counters[counterName] = [];
13049
- }
13050
- counter.push(parseInt(initialValue || 0, 10));
13051
- }
13052
 
13053
- return counterNames;
 
13054
  };
13055
 
13056
- var popCounters = exports.popCounters = function popCounters(counterNames, data) {
13057
- var lenCounters = counterNames.length;
13058
- for (var i = 0; i < lenCounters; i++) {
13059
- data.counters[counterNames[i]].pop();
13060
- }
13061
  };
13062
 
13063
- var resolvePseudoContent = exports.resolvePseudoContent = function resolvePseudoContent(node, style, data) {
13064
- if (!style || !style.content || style.content === 'none' || style.content === '-moz-alt-content' || style.display === 'none') {
13065
- return null;
13066
- }
13067
 
13068
- var tokens = parseContent(style.content);
13069
 
13070
- var len = tokens.length;
13071
- var contentItems = [];
13072
- var s = '';
13073
 
13074
- // increment the counter (if there is a "counter-increment" declaration)
13075
- var counterIncrement = style.counterIncrement;
13076
- if (counterIncrement && counterIncrement !== 'none') {
13077
- var _counterIncrement$spl = counterIncrement.split(/\s+/),
13078
- _counterIncrement$spl2 = _slicedToArray(_counterIncrement$spl, 2),
13079
- counterName = _counterIncrement$spl2[0],
13080
- incrementValue = _counterIncrement$spl2[1];
 
 
 
13081
 
13082
- var counter = data.counters[counterName];
13083
- if (counter) {
13084
- counter[counter.length - 1] += incrementValue === undefined ? 1 : parseInt(incrementValue, 10);
13085
- }
 
 
 
 
 
 
13086
  }
 
 
13087
 
13088
- // build the content string
13089
- for (var i = 0; i < len; i++) {
13090
- var token = tokens[i];
13091
- switch (token.type) {
13092
- case TOKEN_TYPE.STRING:
13093
- s += token.value || '';
13094
- break;
13095
-
13096
- case TOKEN_TYPE.ATTRIBUTE:
13097
- if (node instanceof HTMLElement && token.value) {
13098
- s += node.getAttribute(token.value) || '';
13099
- }
13100
- break;
13101
-
13102
- case TOKEN_TYPE.COUNTER:
13103
- var _counter = data.counters[token.name || ''];
13104
- if (_counter) {
13105
- s += formatCounterValue([_counter[_counter.length - 1]], '', token.format);
13106
- }
13107
- break;
13108
 
13109
- case TOKEN_TYPE.COUNTERS:
13110
- var _counters = data.counters[token.name || ''];
13111
- if (_counters) {
13112
- s += formatCounterValue(_counters, token.glue, token.format);
13113
- }
13114
- break;
13115
 
13116
- case TOKEN_TYPE.OPENQUOTE:
13117
- s += getQuote(style, true, data.quoteDepth);
13118
- data.quoteDepth++;
13119
- break;
13120
 
13121
- case TOKEN_TYPE.CLOSEQUOTE:
13122
- data.quoteDepth--;
13123
- s += getQuote(style, false, data.quoteDepth);
13124
- break;
13125
 
13126
- case TOKEN_TYPE.URL:
13127
- if (s) {
13128
- contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.TEXT, value: s });
13129
- s = '';
13130
- }
13131
- contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.IMAGE, value: token.value || '' });
13132
- break;
13133
- }
13134
- }
13135
 
13136
- if (s) {
13137
- contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.TEXT, value: s });
 
 
 
 
13138
  }
13139
 
13140
- return contentItems;
 
13141
  };
13142
 
13143
- var parseContent = exports.parseContent = function parseContent(content, cache) {
13144
- if (cache && cache[content]) {
13145
- return cache[content];
13146
- }
 
 
13147
 
13148
- var tokens = [];
13149
- var len = content.length;
 
 
 
 
 
 
13150
 
13151
- var isString = false;
13152
- var isEscaped = false;
13153
- var isFunction = false;
13154
- var str = '';
13155
- var functionName = '';
13156
- var args = [];
13157
 
13158
- for (var i = 0; i < len; i++) {
13159
- var c = content.charAt(i);
13160
 
13161
- switch (c) {
13162
- case "'":
13163
- case '"':
13164
- if (isEscaped) {
13165
- str += c;
13166
- } else {
13167
- isString = !isString;
13168
- if (!isFunction && !isString) {
13169
- tokens.push({ type: TOKEN_TYPE.STRING, value: str });
13170
- str = '';
13171
- }
13172
- }
13173
- break;
13174
 
13175
- case '\\':
13176
- if (isEscaped) {
13177
- str += c;
13178
- isEscaped = false;
13179
- } else {
13180
- isEscaped = true;
13181
- }
13182
- break;
 
 
13183
 
13184
- case '(':
13185
- if (isString) {
13186
- str += c;
13187
- } else {
13188
- isFunction = true;
13189
- functionName = str;
13190
- str = '';
13191
- args = [];
13192
- }
13193
- break;
13194
 
13195
- case ')':
13196
- if (isString) {
13197
- str += c;
13198
- } else if (isFunction) {
13199
- if (str) {
13200
- args.push(str);
13201
- }
13202
 
13203
- switch (functionName) {
13204
- case 'attr':
13205
- if (args.length > 0) {
13206
- tokens.push({ type: TOKEN_TYPE.ATTRIBUTE, value: args[0] });
13207
- }
13208
- break;
13209
 
13210
- case 'counter':
13211
- if (args.length > 0) {
13212
- var counter = {
13213
- type: TOKEN_TYPE.COUNTER,
13214
- name: args[0]
13215
- };
13216
- if (args.length > 1) {
13217
- counter.format = args[1];
13218
- }
13219
- tokens.push(counter);
13220
- }
13221
- break;
13222
 
13223
- case 'counters':
13224
- if (args.length > 0) {
13225
- var _counters2 = {
13226
- type: TOKEN_TYPE.COUNTERS,
13227
- name: args[0]
13228
- };
13229
- if (args.length > 1) {
13230
- _counters2.glue = args[1];
13231
- }
13232
- if (args.length > 2) {
13233
- _counters2.format = args[2];
13234
- }
13235
- tokens.push(_counters2);
13236
- }
13237
- break;
13238
 
13239
- case 'url':
13240
- if (args.length > 0) {
13241
- tokens.push({ type: TOKEN_TYPE.URL, value: args[0] });
13242
- }
13243
- break;
13244
- }
13245
 
13246
- isFunction = false;
13247
- str = '';
13248
- }
13249
- break;
13250
 
13251
- case ',':
13252
- if (isString) {
13253
- str += c;
13254
- } else if (isFunction) {
13255
- args.push(str);
13256
- str = '';
13257
- }
13258
- break;
13259
 
13260
- case ' ':
13261
- case '\t':
13262
- if (isString) {
13263
- str += c;
13264
- } else if (str) {
13265
- addOtherToken(tokens, str);
13266
- str = '';
13267
- }
13268
- break;
13269
 
13270
- default:
13271
- str += c;
13272
- }
13273
 
13274
- if (c !== '\\') {
13275
- isEscaped = false;
13276
- }
13277
- }
13278
 
13279
- if (str) {
13280
- addOtherToken(tokens, str);
13281
- }
13282
 
13283
- if (cache) {
13284
- cache[content] = tokens;
13285
- }
13286
 
13287
- return tokens;
 
 
 
13288
  };
13289
 
13290
- var addOtherToken = function addOtherToken(tokens, identifier) {
13291
- switch (identifier) {
13292
- case 'open-quote':
13293
- tokens.push({ type: TOKEN_TYPE.OPENQUOTE });
13294
- break;
13295
- case 'close-quote':
13296
- tokens.push({ type: TOKEN_TYPE.CLOSEQUOTE });
13297
- break;
13298
- }
 
 
 
 
 
 
13299
  };
13300
 
13301
- var getQuote = function getQuote(style, isOpening, quoteDepth) {
13302
- var quotes = style.quotes ? style.quotes.split(/\s+/) : ["'\"'", "'\"'"];
13303
- var idx = quoteDepth * 2;
13304
- if (idx >= quotes.length) {
13305
- idx = quotes.length - 2;
13306
- }
13307
- if (!isOpening) {
13308
- ++idx;
 
 
 
13309
  }
13310
- return quotes[idx].replace(/^["']|["']$/g, '');
13311
  };
13312
 
13313
- var formatCounterValue = function formatCounterValue(counter, glue, format) {
13314
- var len = counter.length;
13315
- var result = '';
13316
 
13317
- for (var i = 0; i < len; i++) {
13318
- if (i > 0) {
13319
- result += glue || '';
13320
- }
13321
- result += (0, _ListItem.createCounterText)(counter[i], (0, _listStyle.parseListStyleType)(format || 'decimal'), false);
13322
- }
13323
 
13324
- return result;
13325
- };
13326
 
13327
- /***/ })
13328
- /******/ ]);
13329
  });
 
13330
 
13331
- /***/ }),
13332
-
13333
- /***/ 482:
13334
- /***/ (function(module, exports, __webpack_require__) {
13335
 
13336
- /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Backbone.js 1.3.3
13337
 
13338
- // (c) 2010-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
13339
- // Backbone may be freely distributed under the MIT license.
13340
- // For all details and documentation:
13341
- // http://backbonejs.org
13342
 
13343
- (function(factory) {
13344
 
13345
- // Establish the root object, `window` (`self`) in the browser, or `global` on the server.
13346
- // We use `self` instead of `window` for `WebWorker` support.
13347
- var root = (typeof self == 'object' && self.self === self && self) ||
13348
- (typeof global == 'object' && global.global === global && global);
13349
 
13350
- // Set up Backbone appropriately for the environment. Start with AMD.
13351
- if (true) {
13352
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(8), __webpack_require__(10), exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function(_, $, exports) {
13353
- // Export global even in AMD case in case this script is loaded with
13354
- // others that may still expect a global Backbone.
13355
- root.Backbone = factory(root, exports, _, $);
13356
- }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
13357
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
13358
-
13359
- // Next for Node.js or CommonJS. jQuery may not be needed as a module.
13360
- } else if (typeof exports !== 'undefined') {
13361
- var _ = require('underscore'), $;
13362
- try { $ = require('jquery'); } catch (e) {}
13363
- factory(root, exports, _, $);
13364
 
13365
- // Finally, as a browser global.
13366
- } else {
13367
- root.Backbone = factory(root, {}, root._, (root.jQuery || root.Zepto || root.ender || root.$));
13368
- }
 
 
 
 
 
 
 
13369
 
13370
- })(function(root, Backbone, _, $) {
 
 
 
 
 
 
 
 
 
 
 
13371
 
13372
- // Initial Setup
13373
- // -------------
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13374
 
13375
- // Save the previous value of the `Backbone` variable, so that it can be
13376
- // restored later on, if `noConflict` is used.
13377
- var previousBackbone = root.Backbone;
13378
 
13379
- // Create a local reference to a common array method we'll want to use later.
13380
- var slice = Array.prototype.slice;
 
13381
 
13382
- // Current version of the library. Keep in sync with `package.json`.
13383
- Backbone.VERSION = '1.3.3';
13384
 
13385
- // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
13386
- // the `$` variable.
13387
- Backbone.$ = $;
13388
 
13389
- // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
13390
- // to its previous owner. Returns a reference to this Backbone object.
13391
- Backbone.noConflict = function() {
13392
- root.Backbone = previousBackbone;
13393
- return this;
13394
- };
13395
 
13396
- // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
13397
- // will fake `"PATCH"`, `"PUT"` and `"DELETE"` requests via the `_method` parameter and
13398
- // set a `X-Http-Method-Override` header.
13399
- Backbone.emulateHTTP = false;
13400
 
13401
- // Turn on `emulateJSON` to support legacy servers that can't deal with direct
13402
- // `application/json` requests ... this will encode the body as
13403
- // `application/x-www-form-urlencoded` instead and will send the model in a
13404
- // form param named `model`.
13405
- Backbone.emulateJSON = false;
13406
 
13407
- // Proxy Backbone class methods to Underscore functions, wrapping the model's
13408
- // `attributes` object or collection's `models` array behind the scenes.
13409
- //
13410
- // collection.filter(function(model) { return model.get('age') > 10 });
13411
- // collection.each(this.addView);
13412
- //
13413
- // `Function#apply` can be slow so we use the method's arg count, if we know it.
13414
- var addMethod = function(length, method, attribute) {
13415
- switch (length) {
13416
- case 1: return function() {
13417
- return _[method](this[attribute]);
13418
- };
13419
- case 2: return function(value) {
13420
- return _[method](this[attribute], value);
13421
- };
13422
- case 3: return function(iteratee, context) {
13423
- return _[method](this[attribute], cb(iteratee, this), context);
13424
- };
13425
- case 4: return function(iteratee, defaultVal, context) {
13426
- return _[method](this[attribute], cb(iteratee, this), defaultVal, context);
13427
- };
13428
- default: return function() {
13429
- var args = slice.call(arguments);
13430
- args.unshift(this[attribute]);
13431
- return _[method].apply(_, args);
13432
- };
13433
- }
13434
- };
13435
- var addUnderscoreMethods = function(Class, methods, attribute) {
13436
- _.each(methods, function(length, method) {
13437
- if (_[method]) Class.prototype[method] = addMethod(length, method, attribute);
13438
- });
13439
- };
13440
 
13441
- // Support `collection.sortBy('attr')` and `collection.findWhere({id: 1})`.
13442
- var cb = function(iteratee, instance) {
13443
- if (_.isFunction(iteratee)) return iteratee;
13444
- if (_.isObject(iteratee) && !instance._isModel(iteratee)) return modelMatcher(iteratee);
13445
- if (_.isString(iteratee)) return function(model) { return model.get(iteratee); };
13446
- return iteratee;
13447
- };
13448
- var modelMatcher = function(attrs) {
13449
- var matcher = _.matches(attrs);
13450
- return function(model) {
13451
- return matcher(model.attributes);
13452
- };
13453
- };
13454
 
13455
- // Backbone.Events
13456
- // ---------------
13457
 
13458
- // A module that can be mixed in to *any object* in order to provide it with
13459
- // a custom event channel. You may bind a callback to an event with `on` or
13460
- // remove with `off`; `trigger`-ing an event fires all callbacks in
13461
- // succession.
13462
- //
13463
- // var object = {};
13464
- // _.extend(object, Backbone.Events);
13465
- // object.on('expand', function(){ alert('expanded'); });
13466
- // object.trigger('expand');
13467
- //
13468
- var Events = Backbone.Events = {};
13469
 
13470
- // Regular expression used to split event strings.
13471
- var eventSplitter = /\s+/;
13472
 
13473
- // Iterates over the standard `event, callback` (as well as the fancy multiple
13474
- // space-separated events `"change blur", callback` and jQuery-style event
13475
- // maps `{event: callback}`).
13476
- var eventsApi = function(iteratee, events, name, callback, opts) {
13477
- var i = 0, names;
13478
- if (name && typeof name === 'object') {
13479
- // Handle event maps.
13480
- if (callback !== void 0 && 'context' in opts && opts.context === void 0) opts.context = callback;
13481
- for (names = _.keys(name); i < names.length ; i++) {
13482
- events = eventsApi(iteratee, events, names[i], name[names[i]], opts);
13483
- }
13484
- } else if (name && eventSplitter.test(name)) {
13485
- // Handle space-separated event names by delegating them individually.
13486
- for (names = name.split(eventSplitter); i < names.length; i++) {
13487
- events = iteratee(events, names[i], callback, opts);
13488
- }
13489
- } else {
13490
- // Finally, standard events.
13491
- events = iteratee(events, name, callback, opts);
13492
  }
13493
- return events;
13494
- };
13495
 
13496
- // Bind an event to a `callback` function. Passing `"all"` will bind
13497
- // the callback to all events fired.
13498
- Events.on = function(name, callback, context) {
13499
- return internalOn(this, name, callback, context);
13500
- };
 
 
 
 
13501
 
13502
- // Guard the `listening` argument from the public API.
13503
- var internalOn = function(obj, name, callback, context, listening) {
13504
- obj._events = eventsApi(onApi, obj._events || {}, name, callback, {
13505
- context: context,
13506
- ctx: obj,
13507
- listening: listening
13508
- });
 
 
13509
 
13510
- if (listening) {
13511
- var listeners = obj._listeners || (obj._listeners = {});
13512
- listeners[listening.id] = listening;
 
13513
  }
13514
 
13515
- return obj;
13516
- };
 
 
 
 
 
 
 
 
 
 
13517
 
13518
- // Inversion-of-control versions of `on`. Tell *this* object to listen to
13519
- // an event in another object... keeping track of what it's listening to
13520
- // for easier unbinding later.
13521
- Events.listenTo = function(obj, name, callback) {
13522
- if (!obj) return this;
13523
- var id = obj._listenId || (obj._listenId = _.uniqueId('l'));
13524
- var listeningTo = this._listeningTo || (this._listeningTo = {});
13525
- var listening = listeningTo[id];
13526
 
13527
- // This object is not listening to any other events on `obj` yet.
13528
- // Setup the necessary references to track the listening callbacks.
13529
- if (!listening) {
13530
- var thisId = this._listenId || (this._listenId = _.uniqueId('l'));
13531
- listening = listeningTo[id] = {obj: obj, objId: id, id: thisId, listeningTo: listeningTo, count: 0};
13532
- }
13533
 
13534
- // Bind callbacks on obj, and keep track of them on listening.
13535
- internalOn(obj, name, callback, this, listening);
13536
- return this;
13537
- };
13538
 
13539
- // The reducing API that adds a callback to the `events` object.
13540
- var onApi = function(events, name, callback, options) {
13541
- if (callback) {
13542
- var handlers = events[name] || (events[name] = []);
13543
- var context = options.context, ctx = options.ctx, listening = options.listening;
13544
- if (listening) listening.count++;
 
 
13545
 
13546
- handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening});
 
 
 
 
 
 
 
 
13547
  }
13548
- return events;
13549
- };
13550
-
13551
- // Remove one or many callbacks. If `context` is null, removes all
13552
- // callbacks with that function. If `callback` is null, removes all
13553
- // callbacks for the event. If `name` is null, removes all bound
13554
- // callbacks for all events.
13555
- Events.off = function(name, callback, context) {
13556
- if (!this._events) return this;
13557
- this._events = eventsApi(offApi, this._events, name, callback, {
13558
- context: context,
13559
- listeners: this._listeners
13560
- });
13561
- return this;
13562
- };
13563
 
13564
- // Tell this object to stop listening to either specific events ... or
13565
- // to every object it's currently listening to.
13566
- Events.stopListening = function(obj, name, callback) {
13567
- var listeningTo = this._listeningTo;
13568
- if (!listeningTo) return this;
13569
 
13570
- var ids = obj ? [obj._listenId] : _.keys(listeningTo);
13571
 
13572
- for (var i = 0; i < ids.length; i++) {
13573
- var listening = listeningTo[ids[i]];
13574
 
13575
- // If listening doesn't exist, this object is not currently
13576
- // listening to obj. Break out early.
13577
- if (!listening) break;
 
 
 
 
 
13578
 
13579
- listening.obj.off(name, callback, this);
 
 
 
 
 
 
 
 
13580
  }
 
13581
 
13582
- return this;
13583
- };
 
13584
 
13585
- // The reducing API that removes a callback from the `events` object.
13586
- var offApi = function(events, name, callback, options) {
13587
- if (!events) return;
13588
 
13589
- var i = 0, listening;
13590
- var context = options.context, listeners = options.listeners;
13591
 
13592
- // Delete all events listeners and "drop" events.
13593
- if (!name && !callback && !context) {
13594
- var ids = _.keys(listeners);
13595
- for (; i < ids.length; i++) {
13596
- listening = listeners[ids[i]];
13597
- delete listeners[listening.id];
13598
- delete listening.listeningTo[listening.objId];
13599
- }
13600
- return;
13601
- }
13602
 
13603
- var names = name ? [name] : _.keys(events);
13604
- for (; i < names.length; i++) {
13605
- name = names[i];
13606
- var handlers = events[name];
13607
 
13608
- // Bail out if there are no events stored.
13609
- if (!handlers) break;
13610
 
13611
- // Replace events if there are any remaining. Otherwise, clean up.
13612
- var remaining = [];
13613
- for (var j = 0; j < handlers.length; j++) {
13614
- var handler = handlers[j];
13615
- if (
13616
- callback && callback !== handler.callback &&
13617
- callback !== handler.callback._callback ||
13618
- context && context !== handler.context
13619
- ) {
13620
- remaining.push(handler);
13621
- } else {
13622
- listening = handler.listening;
13623
- if (listening && --listening.count === 0) {
13624
- delete listeners[listening.id];
13625
- delete listening.listeningTo[listening.objId];
13626
- }
13627
- }
13628
- }
13629
 
13630
- // Update tail event if the list has any events. Otherwise, clean up.
13631
- if (remaining.length) {
13632
- events[name] = remaining;
13633
- } else {
13634
- delete events[name];
13635
- }
13636
- }
13637
- return events;
13638
- };
13639
 
13640
- // Bind an event to only be triggered a single time. After the first time
13641
- // the callback is invoked, its listener will be removed. If multiple events
13642
- // are passed in using the space-separated syntax, the handler will fire
13643
- // once for each event, not once for a combination of all events.
13644
- Events.once = function(name, callback, context) {
13645
- // Map the event into a `{event: once}` object.
13646
- var events = eventsApi(onceMap, {}, name, callback, _.bind(this.off, this));
13647
- if (typeof name === 'string' && context == null) callback = void 0;
13648
- return this.on(events, callback, context);
13649
- };
13650
 
13651
- // Inversion-of-control versions of `once`.
13652
- Events.listenToOnce = function(obj, name, callback) {
13653
- // Map the event into a `{event: once}` object.
13654
- var events = eventsApi(onceMap, {}, name, callback, _.bind(this.stopListening, this, obj));
13655
- return this.listenTo(obj, events);
13656
- };
 
 
 
 
 
 
13657
 
13658
- // Reduces the event callbacks into a map of `{event: onceWrapper}`.
13659
- // `offer` unbinds the `onceWrapper` after it has been called.
13660
- var onceMap = function(map, name, callback, offer) {
13661
- if (callback) {
13662
- var once = map[name] = _.once(function() {
13663
- offer(name, once);
13664
- callback.apply(this, arguments);
13665
- });
13666
- once._callback = callback;
13667
- }
13668
- return map;
13669
- };
13670
 
13671
- // Trigger one or many events, firing all bound callbacks. Callbacks are
13672
- // passed the same arguments as `trigger` is, apart from the event name
13673
- // (unless you're listening on `"all"`, which will cause your callback to
13674
- // receive the true name of the event as the first argument).
13675
- Events.trigger = function(name) {
13676
- if (!this._events) return this;
13677
 
13678
- var length = Math.max(0, arguments.length - 1);
13679
- var args = Array(length);
13680
- for (var i = 0; i < length; i++) args[i] = arguments[i + 1];
13681
 
13682
- eventsApi(triggerApi, this._events, name, void 0, args);
13683
- return this;
13684
- };
13685
 
13686
- // Handles triggering the appropriate event callbacks.
13687
- var triggerApi = function(objEvents, name, callback, args) {
13688
- if (objEvents) {
13689
- var events = objEvents[name];
13690
- var allEvents = objEvents.all;
13691
- if (events && allEvents) allEvents = allEvents.slice();
13692
- if (events) triggerEvents(events, args);
13693
- if (allEvents) triggerEvents(allEvents, [name].concat(args));
13694
- }
13695
- return objEvents;
13696
- };
13697
 
13698
- // A difficult-to-believe, but optimized internal dispatch function for
13699
- // triggering events. Tries to keep the usual cases speedy (most internal
13700
- // Backbone events have 3 arguments).
13701
- var triggerEvents = function(events, args) {
13702
- var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
13703
- switch (args.length) {
13704
- case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;
13705
- case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;
13706
- case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;
13707
- case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;
13708
- default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;
13709
- }
13710
- };
13711
 
13712
- // Aliases for backwards compatibility.
13713
- Events.bind = Events.on;
13714
- Events.unbind = Events.off;
13715
 
13716
- // Allow the `Backbone` object to serve as a global event bus, for folks who
13717
- // want global "pubsub" in a convenient place.
13718
- _.extend(Backbone, Events);
13719
 
13720
- // Backbone.Model
13721
- // --------------
13722
 
13723
- // Backbone **Models** are the basic data object in the framework --
13724
- // frequently representing a row in a table in a database on your server.
13725
- // A discrete chunk of data and a bunch of useful, related methods for
13726
- // performing computations and transformations on that data.
13727
 
13728
- // Create a new model with the specified attributes. A client id (`cid`)
13729
- // is automatically generated and assigned for you.
13730
- var Model = Backbone.Model = function(attributes, options) {
13731
- var attrs = attributes || {};
13732
- options || (options = {});
13733
- this.cid = _.uniqueId(this.cidPrefix);
13734
- this.attributes = {};
13735
- if (options.collection) this.collection = options.collection;
13736
- if (options.parse) attrs = this.parse(attrs, options) || {};
13737
- var defaults = _.result(this, 'defaults');
13738
- attrs = _.defaults(_.extend({}, defaults, attrs), defaults);
13739
- this.set(attrs, options);
13740
- this.changed = {};
13741
- this.initialize.apply(this, arguments);
13742
- };
13743
 
13744
- // Attach all inheritable methods to the Model prototype.
13745
- _.extend(Model.prototype, Events, {
13746
 
13747
- // A hash of attributes whose current and previous value differ.
13748
- changed: null,
13749
 
13750
- // The value returned during the last failed validation.
13751
- validationError: null,
13752
 
13753
- // The default name for the JSON `id` attribute is `"id"`. MongoDB and
13754
- // CouchDB users may want to set this to `"_id"`.
13755
- idAttribute: 'id',
13756
 
13757
- // The prefix is used to create the client id which is used to identify models locally.
13758
- // You may want to override this if you're experiencing name clashes with model ids.
13759
- cidPrefix: 'c',
13760
 
13761
- // Initialize is an empty function by default. Override it with your own
13762
- // initialization logic.
13763
- initialize: function(){},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13764
 
13765
- // Return a copy of the model's `attributes` object.
13766
- toJSON: function(options) {
13767
- return _.clone(this.attributes);
13768
- },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13769
 
13770
- // Proxy `Backbone.sync` by default -- but override this if you need
13771
- // custom syncing semantics for *this* particular model.
13772
- sync: function() {
13773
- return Backbone.sync.apply(this, arguments);
13774
- },
13775
 
13776
- // Get the value of an attribute.
13777
- get: function(attr) {
13778
- return this.attributes[attr];
13779
- },
 
 
 
13780
 
13781
- // Get the HTML-escaped value of an attribute.
13782
- escape: function(attr) {
13783
- return _.escape(this.get(attr));
13784
- },
13785
 
13786
- // Returns `true` if the attribute contains a value that is not null
13787
- // or undefined.
13788
- has: function(attr) {
13789
- return this.get(attr) != null;
13790
- },
 
 
 
 
 
 
13791
 
13792
- // Special-cased proxy to underscore's `_.matches` method.
13793
- matches: function(attrs) {
13794
- return !!_.iteratee(attrs, this)(this.attributes);
13795
- },
 
 
 
13796
 
13797
- // Set a hash of model attributes on the object, firing `"change"`. This is
13798
- // the core primitive operation of a model, updating the data and notifying
13799
- // anyone who needs to know about the change in state. The heart of the beast.
13800
- set: function(key, val, options) {
13801
- if (key == null) return this;
 
13802
 
13803
- // Handle both `"key", value` and `{key: value}` -style arguments.
13804
- var attrs;
13805
- if (typeof key === 'object') {
13806
- attrs = key;
13807
- options = val;
13808
- } else {
13809
- (attrs = {})[key] = val;
13810
- }
 
 
13811
 
13812
- options || (options = {});
13813
 
13814
- // Run validation.
13815
- if (!this._validate(attrs, options)) return false;
 
13816
 
13817
- // Extract attributes and options.
13818
- var unset = options.unset;
13819
- var silent = options.silent;
13820
- var changes = [];
13821
- var changing = this._changing;
13822
- this._changing = true;
13823
-
13824
- if (!changing) {
13825
- this._previousAttributes = _.clone(this.attributes);
13826
- this.changed = {};
13827
- }
13828
-
13829
- var current = this.attributes;
13830
- var changed = this.changed;
13831
- var prev = this._previousAttributes;
13832
-
13833
- // For each `set` attribute, update or delete the current value.
13834
- for (var attr in attrs) {
13835
- val = attrs[attr];
13836
- if (!_.isEqual(current[attr], val)) changes.push(attr);
13837
- if (!_.isEqual(prev[attr], val)) {
13838
- changed[attr] = val;
13839
- } else {
13840
- delete changed[attr];
13841
  }
13842
- unset ? delete current[attr] : current[attr] = val;
13843
- }
13844
-
13845
- // Update the `id`.
13846
- if (this.idAttribute in attrs) this.id = this.get(this.idAttribute);
13847
 
13848
- // Trigger all relevant attribute changes.
13849
- if (!silent) {
13850
- if (changes.length) this._pending = options;
13851
- for (var i = 0; i < changes.length; i++) {
13852
- this.trigger('change:' + changes[i], this, current[changes[i]], options);
13853
  }
13854
- }
13855
 
13856
- // You might be wondering why there's a `while` loop here. Changes can
13857
- // be recursively nested within `"change"` events.
13858
- if (changing) return this;
13859
- if (!silent) {
13860
- while (this._pending) {
13861
- options = this._pending;
13862
- this._pending = false;
13863
- this.trigger('change', this, options);
 
13864
  }
13865
- }
13866
- this._pending = false;
13867
- this._changing = false;
13868
- return this;
13869
- },
13870
 
13871
- // Remove an attribute from the model, firing `"change"`. `unset` is a noop
13872
- // if the attribute doesn't exist.
13873
- unset: function(attr, options) {
13874
- return this.set(attr, void 0, _.extend({}, options, {unset: true}));
13875
- },
13876
 
13877
- // Clear all attributes on the model, firing `"change"`.
13878
- clear: function(options) {
13879
- var attrs = {};
13880
- for (var key in this.attributes) attrs[key] = void 0;
13881
- return this.set(attrs, _.extend({}, options, {unset: true}));
13882
- },
13883
 
13884
- // Determine if the model has changed since the last `"change"` event.
13885
- // If you specify an attribute name, determine if that attribute has changed.
13886
- hasChanged: function(attr) {
13887
- if (attr == null) return !_.isEmpty(this.changed);
13888
- return _.has(this.changed, attr);
13889
- },
 
13890
 
13891
- // Return an object containing all the attributes that have changed, or
13892
- // false if there are no changed attributes. Useful for determining what
13893
- // parts of a view need to be updated and/or what attributes need to be
13894
- // persisted to the server. Unset attributes will be set to undefined.
13895
- // You can also pass an attributes object to diff against the model,
13896
- // determining if there *would be* a change.
13897
- changedAttributes: function(diff) {
13898
- if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
13899
- var old = this._changing ? this._previousAttributes : this.attributes;
13900
- var changed = {};
13901
- for (var attr in diff) {
13902
- var val = diff[attr];
13903
- if (_.isEqual(old[attr], val)) continue;
13904
- changed[attr] = val;
13905
- }
13906
- return _.size(changed) ? changed : false;
13907
- },
13908
 
13909
- // Get the previous value of an attribute, recorded at the time the last
13910
- // `"change"` event was fired.
13911
- previous: function(attr) {
13912
- if (attr == null || !this._previousAttributes) return null;
13913
- return this._previousAttributes[attr];
13914
- },
13915
 
13916
- // Get all of the attributes of the model at the time of the previous
13917
- // `"change"` event.
13918
- previousAttributes: function() {
13919
- return _.clone(this._previousAttributes);
13920
- },
13921
 
13922
- // Fetch the model from the server, merging the response with the model's
13923
- // local attributes. Any changed attributes will trigger a "change" event.
13924
- fetch: function(options) {
13925
- options = _.extend({parse: true}, options);
13926
- var model = this;
13927
- var success = options.success;
13928
- options.success = function(resp) {
13929
- var serverAttrs = options.parse ? model.parse(resp, options) : resp;
13930
- if (!model.set(serverAttrs, options)) return false;
13931
- if (success) success.call(options.context, model, resp, options);
13932
- model.trigger('sync', model, resp, options);
13933
- };
13934
- wrapError(this, options);
13935
- return this.sync('read', this, options);
13936
- },
13937
 
13938
- // Set a hash of model attributes, and sync the model to the server.
13939
- // If the server returns an attributes hash that differs, the model's
13940
- // state will be `set` again.
13941
- save: function(key, val, options) {
13942
- // Handle both `"key", value` and `{key: value}` -style arguments.
13943
- var attrs;
13944
- if (key == null || typeof key === 'object') {
13945
- attrs = key;
13946
- options = val;
13947
- } else {
13948
- (attrs = {})[key] = val;
13949
- }
13950
 
13951
- options = _.extend({validate: true, parse: true}, options);
13952
- var wait = options.wait;
 
13953
 
13954
- // If we're not waiting and attributes exist, save acts as
13955
- // `set(attr).save(null, opts)` with validation. Otherwise, check if
13956
- // the model will be valid when the attributes, if any, are set.
13957
- if (attrs && !wait) {
13958
- if (!this.set(attrs, options)) return false;
13959
- } else if (!this._validate(attrs, options)) {
13960
- return false;
13961
- }
13962
 
13963
- // After a successful server-side save, the client is (optionally)
13964
- // updated with the server-side state.
13965
- var model = this;
13966
- var success = options.success;
13967
- var attributes = this.attributes;
13968
- options.success = function(resp) {
13969
- // Ensure attributes are restored during synchronous saves.
13970
- model.attributes = attributes;
13971
- var serverAttrs = options.parse ? model.parse(resp, options) : resp;
13972
- if (wait) serverAttrs = _.extend({}, attrs, serverAttrs);
13973
- if (serverAttrs && !model.set(serverAttrs, options)) return false;
13974
- if (success) success.call(options.context, model, resp, options);
13975
- model.trigger('sync', model, resp, options);
13976
- };
13977
- wrapError(this, options);
13978
 
13979
- // Set temporary attributes if `{wait: true}` to properly find new ids.
13980
- if (attrs && wait) this.attributes = _.extend({}, attributes, attrs);
 
 
 
 
 
 
 
 
 
 
13981
 
13982
- var method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
13983
- if (method === 'patch' && !options.attrs) options.attrs = attrs;
13984
- var xhr = this.sync(method, this, options);
 
13985
 
13986
- // Restore attributes.
13987
- this.attributes = attributes;
 
 
13988
 
13989
- return xhr;
13990
- },
 
13991
 
13992
- // Destroy this model on the server if it was already persisted.
13993
- // Optimistically removes the model from its collection, if it has one.
13994
- // If `wait: true` is passed, waits for the server to respond before removal.
13995
- destroy: function(options) {
13996
- options = options ? _.clone(options) : {};
13997
- var model = this;
13998
- var success = options.success;
13999
- var wait = options.wait;
14000
 
14001
- var destroy = function() {
14002
- model.stopListening();
14003
- model.trigger('destroy', model, model.collection, options);
14004
- };
14005
 
14006
- options.success = function(resp) {
14007
- if (wait) destroy();
14008
- if (success) success.call(options.context, model, resp, options);
14009
- if (!model.isNew()) model.trigger('sync', model, resp, options);
14010
- };
14011
-
14012
- var xhr = false;
14013
- if (this.isNew()) {
14014
- _.defer(options.success);
14015
- } else {
14016
- wrapError(this, options);
14017
- xhr = this.sync('delete', this, options);
14018
- }
14019
- if (!wait) destroy();
14020
- return xhr;
14021
- },
14022
-
14023
- // Default URL for the model's representation on the server -- if you're
14024
- // using Backbone's restful methods, override this to change the endpoint
14025
- // that will be called.
14026
- url: function() {
14027
- var base =
14028
- _.result(this, 'urlRoot') ||
14029
- _.result(this.collection, 'url') ||
14030
- urlError();
14031
- if (this.isNew()) return base;
14032
- var id = this.get(this.idAttribute);
14033
- return base.replace(/[^\/]$/, '$&/') + encodeURIComponent(id);
14034
- },
14035
 
14036
- // **parse** converts a response into the hash of attributes to be `set` on
14037
- // the model. The default implementation is just to pass the response along.
14038
- parse: function(resp, options) {
14039
- return resp;
14040
- },
14041
 
14042
- // Create a new model with identical attributes to this one.
14043
- clone: function() {
14044
- return new this.constructor(this.attributes);
14045
- },
14046
 
14047
- // A model is new if it has never been saved to the server, and lacks an id.
14048
- isNew: function() {
14049
- return !this.has(this.idAttribute);
14050
- },
14051
 
14052
- // Check if the model is currently in a valid state.
14053
- isValid: function(options) {
14054
- return this._validate({}, _.extend({}, options, {validate: true}));
14055
- },
14056
 
14057
- // Run validation against the next complete set of model attributes,
14058
- // returning `true` if all is well. Otherwise, fire an `"invalid"` event.
14059
- _validate: function(attrs, options) {
14060
- if (!options.validate || !this.validate) return true;
14061
- attrs = _.extend({}, this.attributes, attrs);
14062
- var error = this.validationError = this.validate(attrs, options) || null;
14063
- if (!error) return true;
14064
- this.trigger('invalid', this, error, _.extend(options, {validationError: error}));
14065
- return false;
14066
  }
14067
 
14068
- });
 
 
 
14069
 
14070
- // Underscore methods that we want to implement on the Model, mapped to the
14071
- // number of arguments they take.
14072
- var modelMethods = {keys: 1, values: 1, pairs: 1, invert: 1, pick: 0,
14073
- omit: 0, chain: 1, isEmpty: 1};
14074
 
14075
- // Mix in each Underscore method as a proxy to `Model#attributes`.
14076
- addUnderscoreMethods(Model, modelMethods, 'attributes');
 
 
14077
 
14078
- // Backbone.Collection
14079
- // -------------------
 
 
14080
 
14081
- // If models tend to represent a single row of data, a Backbone Collection is
14082
- // more analogous to a table full of data ... or a small slice or page of that
14083
- // table, or a collection of rows that belong together for a particular reason
14084
- // -- all of the messages in this particular folder, all of the documents
14085
- // belonging to this particular author, and so on. Collections maintain
14086
- // indexes of their models, both in order, and for lookup by `id`.
14087
 
14088
- // Create a new **Collection**, perhaps to contain a specific type of `model`.
14089
- // If a `comparator` is specified, the Collection will maintain
14090
- // its models in sort order, as they're added and removed.
14091
- var Collection = Backbone.Collection = function(models, options) {
14092
- options || (options = {});
14093
- if (options.model) this.model = options.model;
14094
- if (options.comparator !== void 0) this.comparator = options.comparator;
14095
- this._reset();
14096
- this.initialize.apply(this, arguments);
14097
- if (models) this.reset(models, _.extend({silent: true}, options));
14098
- };
14099
 
14100
- // Default options for `Collection#set`.
14101
- var setOptions = {add: true, remove: true, merge: true};
14102
- var addOptions = {add: true, remove: false};
 
14103
 
14104
- // Splices `insert` into `array` at index `at`.
14105
- var splice = function(array, insert, at) {
14106
- at = Math.min(Math.max(at, 0), array.length);
14107
- var tail = Array(array.length - at);
14108
- var length = insert.length;
14109
- var i;
14110
- for (i = 0; i < tail.length; i++) tail[i] = array[i + at];
14111
- for (i = 0; i < length; i++) array[i + at] = insert[i];
14112
- for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i];
14113
- };
14114
 
14115
- // Define the Collection's inheritable methods.
14116
- _.extend(Collection.prototype, Events, {
 
 
14117
 
14118
- // The default model for a collection is just a **Backbone.Model**.
14119
- // This should be overridden in most cases.
14120
- model: Model,
 
14121
 
14122
- // Initialize is an empty function by default. Override it with your own
14123
- // initialization logic.
14124
- initialize: function(){},
 
14125
 
14126
- // The JSON representation of a Collection is an array of the
14127
- // models' attributes.
14128
- toJSON: function(options) {
14129
- return this.map(function(model) { return model.toJSON(options); });
14130
- },
14131
 
14132
- // Proxy `Backbone.sync` by default.
14133
- sync: function() {
14134
- return Backbone.sync.apply(this, arguments);
14135
- },
14136
 
14137
- // Add a model, or list of models to the set. `models` may be Backbone
14138
- // Models or raw JavaScript objects to be converted to Models, or any
14139
- // combination of the two.
14140
- add: function(models, options) {
14141
- return this.set(models, _.extend({merge: false}, options, addOptions));
14142
- },
14143
 
14144
- // Remove a model, or a list of models from the set.
14145
- remove: function(models, options) {
14146
- options = _.extend({}, options);
14147
- var singular = !_.isArray(models);
14148
- models = singular ? [models] : models.slice();
14149
- var removed = this._removeModels(models, options);
14150
- if (!options.silent && removed.length) {
14151
- options.changes = {added: [], merged: [], removed: removed};
14152
- this.trigger('update', this, options);
14153
- }
14154
- return singular ? removed[0] : removed;
14155
- },
14156
 
14157
- // Update a collection by `set`-ing a new list of models, adding new ones,
14158
- // removing models that are no longer present, and merging models that
14159
- // already exist in the collection, as necessary. Similar to **Model#set**,
14160
- // the core operation for updating the data contained by the collection.
14161
- set: function(models, options) {
14162
- if (models == null) return;
14163
 
14164
- options = _.extend({}, setOptions, options);
14165
- if (options.parse && !this._isModel(models)) {
14166
- models = this.parse(models, options) || [];
14167
- }
14168
 
14169
- var singular = !_.isArray(models);
14170
- models = singular ? [models] : models.slice();
 
 
 
 
 
 
 
 
14171
 
14172
- var at = options.at;
14173
- if (at != null) at = +at;
14174
- if (at > this.length) at = this.length;
14175
- if (at < 0) at += this.length + 1;
 
 
 
 
 
 
 
 
 
 
14176
 
14177
- var set = [];
14178
- var toAdd = [];
14179
- var toMerge = [];
14180
- var toRemove = [];
14181
- var modelMap = {};
 
 
 
 
 
 
 
 
 
14182
 
14183
- var add = options.add;
14184
- var merge = options.merge;
14185
- var remove = options.remove;
 
14186
 
14187
- var sort = false;
14188
- var sortable = this.comparator && at == null && options.sort !== false;
14189
- var sortAttr = _.isString(this.comparator) ? this.comparator : null;
 
14190
 
14191
- // Turn bare objects into model references, and prevent invalid models
14192
- // from being added.
14193
- var model, i;
14194
- for (i = 0; i < models.length; i++) {
14195
- model = models[i];
14196
 
14197
- // If a duplicate is found, prevent it from being added and
14198
- // optionally merge it into the existing model.
14199
- var existing = this.get(model);
14200
- if (existing) {
14201
- if (merge && model !== existing) {
14202
- var attrs = this._isModel(model) ? model.attributes : model;
14203
- if (options.parse) attrs = existing.parse(attrs, options);
14204
- existing.set(attrs, options);
14205
- toMerge.push(existing);
14206
- if (sortable && !sort) sort = existing.hasChanged(sortAttr);
14207
- }
14208
- if (!modelMap[existing.cid]) {
14209
- modelMap[existing.cid] = true;
14210
- set.push(existing);
14211
- }
14212
- models[i] = existing;
14213
 
14214
- // If this is a new, valid model, push it to the `toAdd` list.
14215
- } else if (add) {
14216
- model = models[i] = this._prepareModel(model, options);
14217
- if (model) {
14218
- toAdd.push(model);
14219
- this._addReference(model, options);
14220
- modelMap[model.cid] = true;
14221
- set.push(model);
14222
- }
14223
- }
14224
- }
14225
 
14226
- // Remove stale models.
14227
- if (remove) {
14228
- for (i = 0; i < this.length; i++) {
14229
- model = this.models[i];
14230
- if (!modelMap[model.cid]) toRemove.push(model);
 
 
 
 
 
 
 
14231
  }
14232
- if (toRemove.length) this._removeModels(toRemove, options);
14233
- }
 
 
14234
 
14235
- // See if sorting is needed, update `length` and splice in new models.
14236
- var orderChanged = false;
14237
- var replace = !sortable && add && remove;
14238
- if (set.length && replace) {
14239
- orderChanged = this.length !== set.length || _.some(this.models, function(m, index) {
14240
- return m !== set[index];
14241
- });
14242
- this.models.length = 0;
14243
- splice(this.models, set, 0);
14244
- this.length = this.models.length;
14245
- } else if (toAdd.length) {
14246
- if (sortable) sort = true;
14247
- splice(this.models, toAdd, at == null ? this.length : at);
14248
- this.length = this.models.length;
14249
- }
14250
 
14251
- // Silently sort the collection if appropriate.
14252
- if (sort) this.sort({silent: true});
14253
 
14254
- // Unless silenced, it's time to fire all appropriate add/sort/update events.
14255
- if (!options.silent) {
14256
- for (i = 0; i < toAdd.length; i++) {
14257
- if (at != null) options.index = at + i;
14258
- model = toAdd[i];
14259
- model.trigger('add', model, this, options);
14260
- }
14261
- if (sort || orderChanged) this.trigger('sort', this, options);
14262
- if (toAdd.length || toRemove.length || toMerge.length) {
14263
- options.changes = {
14264
- added: toAdd,
14265
- removed: toRemove,
14266
- merged: toMerge
14267
- };
14268
- this.trigger('update', this, options);
14269
- }
14270
- }
14271
 
14272
- // Return the added (or merged) model (or models).
14273
- return singular ? models[0] : models;
14274
- },
 
14275
 
14276
- // When you have more items than you want to add or remove individually,
14277
- // you can reset the entire set with a new list of models, without firing
14278
- // any granular `add` or `remove` events. Fires `reset` when finished.
14279
- // Useful for bulk operations and optimizations.
14280
- reset: function(models, options) {
14281
- options = options ? _.clone(options) : {};
14282
- for (var i = 0; i < this.models.length; i++) {
14283
- this._removeReference(this.models[i], options);
14284
- }
14285
- options.previousModels = this.models;
14286
- this._reset();
14287
- models = this.add(models, _.extend({silent: true}, options));
14288
- if (!options.silent) this.trigger('reset', this, options);
14289
- return models;
14290
- },
14291
 
14292
- // Add a model to the end of the collection.
14293
- push: function(model, options) {
14294
- return this.add(model, _.extend({at: this.length}, options));
14295
- },
14296
 
14297
- // Remove a model from the end of the collection.
14298
- pop: function(options) {
14299
- var model = this.at(this.length - 1);
14300
- return this.remove(model, options);
14301
- },
14302
 
14303
- // Add a model to the beginning of the collection.
14304
- unshift: function(model, options) {
14305
- return this.add(model, _.extend({at: 0}, options));
14306
- },
 
14307
 
14308
- // Remove a model from the beginning of the collection.
14309
- shift: function(options) {
14310
- var model = this.at(0);
14311
- return this.remove(model, options);
14312
- },
14313
 
14314
- // Slice out a sub-array of models from the collection.
14315
- slice: function() {
14316
- return slice.apply(this.models, arguments);
14317
- },
14318
 
14319
- // Get a model from the set by id, cid, model object with id or cid
14320
- // properties, or an attributes object that is transformed through modelId.
14321
- get: function(obj) {
14322
- if (obj == null) return void 0;
14323
- return this._byId[obj] ||
14324
- this._byId[this.modelId(obj.attributes || obj)] ||
14325
- obj.cid && this._byId[obj.cid];
14326
- },
14327
 
14328
- // Returns `true` if the model is in the collection.
14329
- has: function(obj) {
14330
- return this.get(obj) != null;
14331
- },
14332
 
14333
- // Get the model at the given index.
14334
- at: function(index) {
14335
- if (index < 0) index += this.length;
14336
- return this.models[index];
14337
- },
14338
 
14339
- // Return models with matching attributes. Useful for simple cases of
14340
- // `filter`.
14341
- where: function(attrs, first) {
14342
- return this[first ? 'find' : 'filter'](attrs);
14343
- },
14344
 
14345
- // Return the first model with matching attributes. Useful for simple cases
14346
- // of `find`.
14347
- findWhere: function(attrs) {
14348
- return this.where(attrs, true);
14349
- },
14350
 
14351
- // Force the collection to re-sort itself. You don't need to call this under
14352
- // normal circumstances, as the set will maintain sort order as each item
14353
- // is added.
14354
- sort: function(options) {
14355
- var comparator = this.comparator;
14356
- if (!comparator) throw new Error('Cannot sort a set without a comparator');
14357
- options || (options = {});
14358
-
14359
- var length = comparator.length;
14360
- if (_.isFunction(comparator)) comparator = _.bind(comparator, this);
14361
-
14362
- // Run sort based on type of `comparator`.
14363
- if (length === 1 || _.isString(comparator)) {
14364
- this.models = this.sortBy(comparator);
14365
- } else {
14366
- this.models.sort(comparator);
14367
- }
14368
- if (!options.silent) this.trigger('sort', this, options);
14369
- return this;
14370
- },
14371
 
14372
- // Pluck an attribute from each model in the collection.
14373
- pluck: function(attr) {
14374
- return this.map(attr + '');
14375
- },
 
14376
 
14377
- // Fetch the default set of models for this collection, resetting the
14378
- // collection when they arrive. If `reset: true` is passed, the response
14379
- // data will be passed through the `reset` method instead of `set`.
14380
- fetch: function(options) {
14381
- options = _.extend({parse: true}, options);
14382
- var success = options.success;
14383
- var collection = this;
14384
- options.success = function(resp) {
14385
- var method = options.reset ? 'reset' : 'set';
14386
- collection[method](resp, options);
14387
- if (success) success.call(options.context, collection, resp, options);
14388
- collection.trigger('sync', collection, resp, options);
14389
- };
14390
- wrapError(this, options);
14391
- return this.sync('read', this, options);
14392
- },
14393
 
14394
- // Create a new instance of a model in this collection. Add the model to the
14395
- // collection immediately, unless `wait: true` is passed, in which case we
14396
- // wait for the server to agree.
14397
- create: function(model, options) {
14398
- options = options ? _.clone(options) : {};
14399
- var wait = options.wait;
14400
- model = this._prepareModel(model, options);
14401
- if (!model) return false;
14402
- if (!wait) this.add(model, options);
14403
- var collection = this;
14404
- var success = options.success;
14405
- options.success = function(m, resp, callbackOpts) {
14406
- if (wait) collection.add(m, callbackOpts);
14407
- if (success) success.call(callbackOpts.context, m, resp, callbackOpts);
14408
- };
14409
- model.save(null, options);
14410
- return model;
14411
- },
14412
 
14413
- // **parse** converts a response into a list of models to be added to the
14414
- // collection. The default implementation is just to pass it through.
14415
- parse: function(resp, options) {
14416
- return resp;
14417
- },
14418
 
14419
- // Create a new collection with an identical list of models as this one.
14420
- clone: function() {
14421
- return new this.constructor(this.models, {
14422
- model: this.model,
14423
- comparator: this.comparator
14424
- });
14425
- },
14426
 
14427
- // Define how to uniquely identify models in the collection.
14428
- modelId: function(attrs) {
14429
- return attrs[this.model.prototype.idAttribute || 'id'];
14430
- },
14431
 
14432
- // Private method to reset all internal state. Called when the collection
14433
- // is first initialized or reset.
14434
- _reset: function() {
14435
- this.length = 0;
14436
- this.models = [];
14437
- this._byId = {};
14438
- },
14439
 
14440
- // Prepare a hash of attributes (or other model) to be added to this
14441
- // collection.
14442
- _prepareModel: function(attrs, options) {
14443
- if (this._isModel(attrs)) {
14444
- if (!attrs.collection) attrs.collection = this;
14445
- return attrs;
14446
- }
14447
- options = options ? _.clone(options) : {};
14448
- options.collection = this;
14449
- var model = new this.model(attrs, options);
14450
- if (!model.validationError) return model;
14451
- this.trigger('invalid', this, model.validationError, options);
14452
- return false;
14453
- },
14454
 
14455
- // Internal method called by both remove and set.
14456
- _removeModels: function(models, options) {
14457
- var removed = [];
14458
- for (var i = 0; i < models.length; i++) {
14459
- var model = this.get(models[i]);
14460
- if (!model) continue;
14461
 
14462
- var index = this.indexOf(model);
14463
- this.models.splice(index, 1);
14464
- this.length--;
14465
 
14466
- // Remove references before triggering 'remove' event to prevent an
14467
- // infinite loop. #3693
14468
- delete this._byId[model.cid];
14469
- var id = this.modelId(model.attributes);
14470
- if (id != null) delete this._byId[id];
14471
 
14472
- if (!options.silent) {
14473
- options.index = index;
14474
- model.trigger('remove', model, this, options);
14475
- }
14476
 
14477
- removed.push(model);
14478
- this._removeReference(model, options);
14479
- }
14480
- return removed;
14481
- },
14482
 
14483
- // Method for checking whether an object should be considered a model for
14484
- // the purposes of adding to the collection.
14485
- _isModel: function(model) {
14486
- return model instanceof Model;
14487
- },
14488
 
14489
- // Internal method to create a model's ties to a collection.
14490
- _addReference: function(model, options) {
14491
- this._byId[model.cid] = model;
14492
- var id = this.modelId(model.attributes);
14493
- if (id != null) this._byId[id] = model;
14494
- model.on('all', this._onModelEvent, this);
14495
- },
14496
 
14497
- // Internal method to sever a model's ties to a collection.
14498
- _removeReference: function(model, options) {
14499
- delete this._byId[model.cid];
14500
- var id = this.modelId(model.attributes);
14501
- if (id != null) delete this._byId[id];
14502
- if (this === model.collection) delete model.collection;
14503
- model.off('all', this._onModelEvent, this);
14504
- },
14505
 
14506
- // Internal method called every time a model in the set fires an event.
14507
- // Sets need to update their indexes when models change ids. All other
14508
- // events simply proxy through. "add" and "remove" events that originate
14509
- // in other collections are ignored.
14510
- _onModelEvent: function(event, model, collection, options) {
14511
- if (model) {
14512
- if ((event === 'add' || event === 'remove') && collection !== this) return;
14513
- if (event === 'destroy') this.remove(model, options);
14514
- if (event === 'change') {
14515
- var prevId = this.modelId(model.previousAttributes());
14516
- var id = this.modelId(model.attributes);
14517
- if (prevId !== id) {
14518
- if (prevId != null) delete this._byId[prevId];
14519
- if (id != null) this._byId[id] = model;
14520
- }
14521
- }
14522
- }
14523
- this.trigger.apply(this, arguments);
14524
- }
14525
 
14526
- });
 
14527
 
14528
- // Underscore methods that we want to implement on the Collection.
14529
- // 90% of the core usefulness of Backbone Collections is actually implemented
14530
- // right here:
14531
- var collectionMethods = {forEach: 3, each: 3, map: 3, collect: 3, reduce: 0,
14532
- foldl: 0, inject: 0, reduceRight: 0, foldr: 0, find: 3, detect: 3, filter: 3,
14533
- select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 3, includes: 3,
14534
- contains: 3, invoke: 0, max: 3, min: 3, toArray: 1, size: 1, first: 3,
14535
- head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3,
14536
- without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3,
14537
- isEmpty: 1, chain: 1, sample: 3, partition: 3, groupBy: 3, countBy: 3,
14538
- sortBy: 3, indexBy: 3, findIndex: 3, findLastIndex: 3};
14539
 
14540
- // Mix in each Underscore method as a proxy to `Collection#models`.
14541
- addUnderscoreMethods(Collection, collectionMethods, 'models');
 
 
 
14542
 
14543
- // Backbone.View
14544
- // -------------
 
 
 
 
 
14545
 
14546
- // Backbone Views are almost more convention than they are actual code. A View
14547
- // is simply a JavaScript object that represents a logical chunk of UI in the
14548
- // DOM. This might be a single item, an entire list, a sidebar or panel, or
14549
- // even the surrounding frame which wraps your whole app. Defining a chunk of
14550
- // UI as a **View** allows you to define your DOM events declaratively, without
14551
- // having to worry about render order ... and makes it easy for the view to
14552
- // react to specific changes in the state of your models.
14553
 
14554
- // Creating a Backbone.View creates its initial element outside of the DOM,
14555
- // if an existing element is not provided...
14556
- var View = Backbone.View = function(options) {
14557
- this.cid = _.uniqueId('view');
14558
- _.extend(this, _.pick(options, viewOptions));
14559
- this._ensureElement();
14560
- this.initialize.apply(this, arguments);
14561
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14562
 
14563
- // Cached regex to split keys for `delegate`.
14564
- var delegateEventSplitter = /^(\S+)\s*(.*)$/;
 
 
 
14565
 
14566
- // List of view options to be set as properties.
14567
- var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
 
 
14568
 
14569
- // Set up all inheritable **Backbone.View** properties and methods.
14570
- _.extend(View.prototype, Events, {
 
 
 
14571
 
14572
- // The default `tagName` of a View's element is `"div"`.
14573
- tagName: 'div',
14574
 
14575
- // jQuery delegate for element lookup, scoped to DOM elements within the
14576
- // current view. This should be preferred to global lookups where possible.
14577
- $: function(selector) {
14578
- return this.$el.find(selector);
14579
- },
14580
 
14581
- // Initialize is an empty function by default. Override it with your own
14582
- // initialization logic.
14583
- initialize: function(){},
14584
 
14585
- // **render** is the core function that your view should override, in order
14586
- // to populate its element (`this.el`), with the appropriate HTML. The
14587
- // convention is for **render** to always return `this`.
14588
- render: function() {
14589
- return this;
14590
- },
 
14591
 
14592
- // Remove this view by taking the element out of the DOM, and removing any
14593
- // applicable Backbone.Events listeners.
14594
- remove: function() {
14595
- this._removeElement();
14596
- this.stopListening();
14597
- return this;
14598
- },
14599
 
14600
- // Remove this view's element from the document and all event listeners
14601
- // attached to it. Exposed for subclasses using an alternative DOM
14602
- // manipulation API.
14603
- _removeElement: function() {
14604
- this.$el.remove();
14605
- },
14606
 
14607
- // Change the view's element (`this.el` property) and re-delegate the
14608
- // view's events on the new element.
14609
- setElement: function(element) {
14610
- this.undelegateEvents();
14611
- this._setElement(element);
14612
- this.delegateEvents();
14613
- return this;
14614
- },
 
 
 
 
 
14615
 
14616
- // Creates the `this.el` and `this.$el` references for this view using the
14617
- // given `el`. `el` can be a CSS selector or an HTML string, a jQuery
14618
- // context or an element. Subclasses can override this to utilize an
14619
- // alternative DOM manipulation API and are only required to set the
14620
- // `this.el` property.
14621
- _setElement: function(el) {
14622
- this.$el = el instanceof Backbone.$ ? el : Backbone.$(el);
14623
- this.el = this.$el[0];
14624
- },
 
 
14625
 
14626
- // Set callbacks, where `this.events` is a hash of
14627
- //
14628
- // *{"event selector": "callback"}*
14629
- //
14630
- // {
14631
- // 'mousedown .title': 'edit',
14632
- // 'click .button': 'save',
14633
- // 'click .open': function(e) { ... }
14634
- // }
14635
- //
14636
- // pairs. Callbacks will be bound to the view, with `this` set properly.
14637
- // Uses event delegation for efficiency.
14638
- // Omitting the selector binds the event to `this.el`.
14639
- delegateEvents: function(events) {
14640
- events || (events = _.result(this, 'events'));
14641
- if (!events) return this;
14642
- this.undelegateEvents();
14643
- for (var key in events) {
14644
- var method = events[key];
14645
- if (!_.isFunction(method)) method = this[method];
14646
- if (!method) continue;
14647
- var match = key.match(delegateEventSplitter);
14648
- this.delegate(match[1], match[2], _.bind(method, this));
14649
- }
14650
- return this;
14651
- },
1
+ webpackJsonp([2],Array(22).concat([
2
+ /* 22 */
 
3
  /***/ (function(module, exports) {
4
 
5
  if (typeof Object.create === 'function') {
28
 
29
 
30
  /***/ }),
31
+ /* 23 */,
32
+ /* 24 */,
33
+ /* 25 */,
34
+ /* 26 */,
35
+ /* 27 */,
36
+ /* 28 */,
37
+ /* 29 */,
38
+ /* 30 */,
39
+ /* 31 */,
40
+ /* 32 */
41
  /***/ (function(module, exports, __webpack_require__) {
42
 
43
  "use strict";
44
+ // Copyright Joyent, Inc. and other Node contributors.
45
+ //
46
+ // Permission is hereby granted, free of charge, to any person obtaining a
47
+ // copy of this software and associated documentation files (the
48
+ // "Software"), to deal in the Software without restriction, including
49
+ // without limitation the rights to use, copy, modify, merge, publish,
50
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
51
+ // persons to whom the Software is furnished to do so, subject to the
52
+ // following conditions:
53
+ //
54
+ // The above copyright notice and this permission notice shall be included
55
+ // in all copies or substantial portions of the Software.
56
+ //
57
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
58
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
59
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
60
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
61
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
62
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
63
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
64
 
65
+ // a duplex stream is just a stream that is both readable and writable.
66
+ // Since JS doesn't have multiple prototypal inheritance, this class
67
+ // prototypally inherits from Readable, and then parasitically from
68
+ // Writable.
69
 
 
 
 
 
 
70
 
 
71
 
72
+ /*<replacement>*/
73
 
74
+ var processNextTick = __webpack_require__(56);
75
+ /*</replacement>*/
76
 
77
+ /*<replacement>*/
78
+ var objectKeys = Object.keys || function (obj) {
79
+ var keys = [];
80
+ for (var key in obj) {
81
+ keys.push(key);
82
+ }return keys;
83
+ };
84
+ /*</replacement>*/
85
 
86
+ module.exports = Duplex;
87
 
88
+ /*<replacement>*/
89
+ var util = __webpack_require__(46);
90
+ util.inherits = __webpack_require__(22);
91
+ /*</replacement>*/
92
 
93
+ var Readable = __webpack_require__(264);
94
+ var Writable = __webpack_require__(90);
 
 
 
 
 
95
 
96
+ util.inherits(Duplex, Readable);
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
+ var keys = objectKeys(Writable.prototype);
99
+ for (var v = 0; v < keys.length; v++) {
100
+ var method = keys[v];
101
+ if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  }
103
 
104
+ function Duplex(options) {
105
+ if (!(this instanceof Duplex)) return new Duplex(options);
 
 
 
 
106
 
107
+ Readable.call(this, options);
108
+ Writable.call(this, options);
 
 
 
109
 
110
+ if (options && options.readable === false) this.readable = false;
111
 
112
+ if (options && options.writable === false) this.writable = false;
113
 
114
+ this.allowHalfOpen = true;
115
+ if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
116
 
117
+ this.once('end', onend);
118
+ }
119
 
120
+ // the no-half-open enforcer
121
+ function onend() {
122
+ // if we allow half-open state, or if the writable side ended,
123
+ // then we're ok.
124
+ if (this.allowHalfOpen || this._writableState.ended) return;
125
 
126
+ // no more data can be written.
127
+ // But allow more writes to happen in this tick.
128
+ processNextTick(onEndNT, this);
129
+ }
130
 
131
+ function onEndNT(self) {
132
+ self.end();
133
+ }
134
 
135
+ Object.defineProperty(Duplex.prototype, 'destroyed', {
136
+ get: function () {
137
+ if (this._readableState === undefined || this._writableState === undefined) {
138
+ return false;
139
+ }
140
+ return this._readableState.destroyed && this._writableState.destroyed;
141
+ },
142
+ set: function (value) {
143
+ // we ignore the value if the stream
144
+ // has not been initialized yet
145
+ if (this._readableState === undefined || this._writableState === undefined) {
146
+ return;
147
+ }
148
 
149
+ // backward compatibility, the user is explicitly
150
+ // managing destroyed
151
+ this._readableState.destroyed = value;
152
+ this._writableState.destroyed = value;
153
+ }
154
+ });
 
 
 
155
 
156
+ Duplex.prototype._destroy = function (err, cb) {
157
+ this.push(null);
158
+ this.end();
159
+
160
+ processNextTick(cb, err);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  };
162
 
163
+ function forEach(xs, f) {
164
+ for (var i = 0, l = xs.length; i < l; i++) {
165
+ f(xs[i], i);
166
+ }
167
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
 
169
+ /***/ }),
170
+ /* 33 */,
171
+ /* 34 */,
172
+ /* 35 */,
173
+ /* 36 */,
174
+ /* 37 */,
175
+ /* 38 */
176
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
177
 
178
+ var Parser = __webpack_require__(258),
179
+ DomHandler = __webpack_require__(420);
180
 
181
+ function defineProp(name, value){
182
+ delete module.exports[name];
183
+ module.exports[name] = value;
184
+ return value;
185
+ }
186
 
187
+ module.exports = {
188
+ Parser: Parser,
189
+ Tokenizer: __webpack_require__(259),
190
+ ElementType: __webpack_require__(45),
191
+ DomHandler: DomHandler,
192
+ get FeedHandler(){
193
+ return defineProp("FeedHandler", __webpack_require__(422));
194
+ },
195
+ get Stream(){
196
+ return defineProp("Stream", __webpack_require__(423));
197
+ },
198
+ get WritableStream(){
199
+ return defineProp("WritableStream", __webpack_require__(263));
200
+ },
201
+ get ProxyHandler(){
202
+ return defineProp("ProxyHandler", __webpack_require__(437));
203
+ },
204
+ get DomUtils(){
205
+ return defineProp("DomUtils", __webpack_require__(438));
206
+ },
207
+ get CollectingHandler(){
208
+ return defineProp("CollectingHandler", __webpack_require__(450));
209
+ },
210
+ // For legacy support
211
+ DefaultHandler: DomHandler,
212
+ get RssHandler(){
213
+ return defineProp("RssHandler", this.FeedHandler);
214
+ },
215
+ //helper methods
216
+ parseDOM: function(data, options){
217
+ var handler = new DomHandler(options);
218
+ new Parser(handler, options).end(data);
219
+ return handler.dom;
220
+ },
221
+ parseFeed: function(feed, options){
222
+ var handler = new module.exports.FeedHandler(options);
223
+ new Parser(handler, options).end(feed);
224
+ return handler.dom;
225
+ },
226
+ createDomStream: function(cb, options, elementCb){
227
+ var handler = new DomHandler(cb, options, elementCb);
228
+ return new Parser(handler, options);
229
+ },
230
+ // List of all events that the parser emits
231
+ EVENTS: { /* Format: eventname: number of arguments */
232
+ attribute: 2,
233
+ cdatastart: 0,
234
+ cdataend: 0,
235
+ text: 1,
236
+ processinginstruction: 2,
237
+ comment: 1,
238
+ commentend: 0,
239
+ closetag: 1,
240
+ opentag: 2,
241
+ opentagname: 1,
242
+ error: 1,
243
+ end: 0
244
+ }
245
+ };
246
 
 
 
247
 
248
+ /***/ }),
249
+ /* 39 */
250
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
251
 
252
+ /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["Backbone"] = __webpack_require__(483);
253
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9)))
 
 
254
 
255
+ /***/ }),
256
+ /* 40 */,
257
+ /* 41 */,
258
+ /* 42 */,
259
+ /* 43 */,
260
+ /* 44 */,
261
+ /* 45 */
262
+ /***/ (function(module, exports) {
263
 
264
+ //Types of elements found in the DOM
265
+ module.exports = {
266
+ Text: "text", //Text
267
+ Directive: "directive", //<? ... ?>
268
+ Comment: "comment", //<!-- ... -->
269
+ Script: "script", //<script> tags
270
+ Style: "style", //<style> tags
271
+ Tag: "tag", //Any tag
272
+ CDATA: "cdata", //<![CDATA[ ... ]]>
273
+ Doctype: "doctype",
274
 
275
+ isTag: function(elem){
276
+ return elem.type === "tag" || elem.type === "script" || elem.type === "style";
 
 
 
 
 
277
  }
 
 
278
  };
279
 
 
 
 
 
 
 
 
280
 
281
+ /***/ }),
282
+ /* 46 */
283
+ /***/ (function(module, exports, __webpack_require__) {
 
284
 
285
+ /* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.
286
+ //
287
+ // Permission is hereby granted, free of charge, to any person obtaining a
288
+ // copy of this software and associated documentation files (the
289
+ // "Software"), to deal in the Software without restriction, including
290
+ // without limitation the rights to use, copy, modify, merge, publish,
291
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
292
+ // persons to whom the Software is furnished to do so, subject to the
293
+ // following conditions:
294
+ //
295
+ // The above copyright notice and this permission notice shall be included
296
+ // in all copies or substantial portions of the Software.
297
+ //
298
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
299
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
300
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
301
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
302
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
303
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
304
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
305
 
306
+ // NOTE: These type checking functions intentionally don't use `instanceof`
307
+ // because it is fragile and can be easily faked with `Object.create()`.
 
 
 
 
 
308
 
309
+ function isArray(arg) {
310
+ if (Array.isArray) {
311
+ return Array.isArray(arg);
312
+ }
313
+ return objectToString(arg) === '[object Array]';
314
+ }
315
+ exports.isArray = isArray;
316
 
317
+ function isBoolean(arg) {
318
+ return typeof arg === 'boolean';
319
+ }
320
+ exports.isBoolean = isBoolean;
321
 
322
+ function isNull(arg) {
323
+ return arg === null;
324
+ }
325
+ exports.isNull = isNull;
326
 
327
+ function isNullOrUndefined(arg) {
328
+ return arg == null;
329
+ }
330
+ exports.isNullOrUndefined = isNullOrUndefined;
331
 
332
+ function isNumber(arg) {
333
+ return typeof arg === 'number';
334
+ }
335
+ exports.isNumber = isNumber;
336
 
337
+ function isString(arg) {
338
+ return typeof arg === 'string';
339
+ }
340
+ exports.isString = isString;
341
 
342
+ function isSymbol(arg) {
343
+ return typeof arg === 'symbol';
344
+ }
345
+ exports.isSymbol = isSymbol;
346
 
347
+ function isUndefined(arg) {
348
+ return arg === void 0;
349
+ }
350
+ exports.isUndefined = isUndefined;
351
 
352
+ function isRegExp(re) {
353
+ return objectToString(re) === '[object RegExp]';
354
+ }
355
+ exports.isRegExp = isRegExp;
 
 
 
 
 
 
 
 
 
 
 
 
 
356
 
357
+ function isObject(arg) {
358
+ return typeof arg === 'object' && arg !== null;
359
+ }
360
+ exports.isObject = isObject;
 
 
 
361
 
362
+ function isDate(d) {
363
+ return objectToString(d) === '[object Date]';
364
+ }
365
+ exports.isDate = isDate;
366
 
367
+ function isError(e) {
368
+ return (objectToString(e) === '[object Error]' || e instanceof Error);
369
+ }
370
+ exports.isError = isError;
371
 
372
+ function isFunction(arg) {
373
+ return typeof arg === 'function';
374
+ }
375
+ exports.isFunction = isFunction;
 
 
 
 
 
 
 
 
 
 
 
 
376
 
377
+ function isPrimitive(arg) {
378
+ return arg === null ||
379
+ typeof arg === 'boolean' ||
380
+ typeof arg === 'number' ||
381
+ typeof arg === 'string' ||
382
+ typeof arg === 'symbol' || // ES6 symbol
383
+ typeof arg === 'undefined';
384
+ }
385
+ exports.isPrimitive = isPrimitive;
386
 
387
+ exports.isBuffer = Buffer.isBuffer;
 
 
 
 
 
 
 
 
 
 
388
 
389
+ function objectToString(o) {
390
+ return Object.prototype.toString.call(o);
391
+ }
392
 
393
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89).Buffer))
 
 
394
 
395
+ /***/ }),
396
+ /* 47 */,
397
+ /* 48 */,
398
+ /* 49 */,
399
+ /* 50 */,
400
+ /* 51 */,
401
+ /* 52 */,
402
+ /* 53 */,
403
+ /* 54 */,
404
+ /* 55 */
405
+ /***/ (function(module, exports) {
406
 
407
+ // Copyright Joyent, Inc. and other Node contributors.
408
+ //
409
+ // Permission is hereby granted, free of charge, to any person obtaining a
410
+ // copy of this software and associated documentation files (the
411
+ // "Software"), to deal in the Software without restriction, including
412
+ // without limitation the rights to use, copy, modify, merge, publish,
413
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
414
+ // persons to whom the Software is furnished to do so, subject to the
415
+ // following conditions:
416
+ //
417
+ // The above copyright notice and this permission notice shall be included
418
+ // in all copies or substantial portions of the Software.
419
+ //
420
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
421
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
422
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
423
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
424
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
425
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
426
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
427
 
428
+ function EventEmitter() {
429
+ this._events = this._events || {};
430
+ this._maxListeners = this._maxListeners || undefined;
431
+ }
432
+ module.exports = EventEmitter;
 
433
 
434
+ // Backwards-compat with node 0.10.x
435
+ EventEmitter.EventEmitter = EventEmitter;
436
 
437
+ EventEmitter.prototype._events = undefined;
438
+ EventEmitter.prototype._maxListeners = undefined;
 
439
 
440
+ // By default EventEmitters will print a warning if more than 10 listeners are
441
+ // added to it. This is a useful default which helps finding memory leaks.
442
+ EventEmitter.defaultMaxListeners = 10;
443
 
444
+ // Obviously not all Emitters should be limited to 10. This function allows
445
+ // that to be increased. Set to zero for unlimited.
446
+ EventEmitter.prototype.setMaxListeners = function(n) {
447
+ if (!isNumber(n) || n < 0 || isNaN(n))
448
+ throw TypeError('n must be a positive number');
449
+ this._maxListeners = n;
450
+ return this;
451
  };
452
 
453
+ EventEmitter.prototype.emit = function(type) {
454
+ var er, handler, len, args, i, listeners;
 
455
 
456
+ if (!this._events)
457
+ this._events = {};
 
 
 
 
 
 
 
 
458
 
459
+ // If there is no 'error' event listener then throw.
460
+ if (type === 'error') {
461
+ if (!this._events.error ||
462
+ (isObject(this._events.error) && !this._events.error.length)) {
463
+ er = arguments[1];
464
+ if (er instanceof Error) {
465
+ throw er; // Unhandled 'error' event
466
+ } else {
467
+ // At least give some kind of context to the user
468
+ var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
469
+ err.context = er;
470
+ throw err;
471
+ }
472
+ }
473
+ }
474
 
475
+ handler = this._events[type];
 
 
 
476
 
477
+ if (isUndefined(handler))
478
+ return false;
 
 
479
 
480
+ if (isFunction(handler)) {
481
+ switch (arguments.length) {
482
+ // fast cases
483
+ case 1:
484
+ handler.call(this);
485
+ break;
486
+ case 2:
487
+ handler.call(this, arguments[1]);
488
+ break;
489
+ case 3:
490
+ handler.call(this, arguments[1], arguments[2]);
491
+ break;
492
+ // slower
493
+ default:
494
+ args = Array.prototype.slice.call(arguments, 1);
495
+ handler.apply(this, args);
496
+ }
497
+ } else if (isObject(handler)) {
498
+ args = Array.prototype.slice.call(arguments, 1);
499
+ listeners = handler.slice();
500
+ len = listeners.length;
501
+ for (i = 0; i < len; i++)
502
+ listeners[i].apply(this, args);
503
+ }
504
 
505
+ return true;
 
 
 
506
  };
507
 
508
+ EventEmitter.prototype.addListener = function(type, listener) {
509
+ var m;
 
510
 
511
+ if (!isFunction(listener))
512
+ throw TypeError('listener must be a function');
 
513
 
514
+ if (!this._events)
515
+ this._events = {};
 
516
 
517
+ // To avoid recursion in the case that type === "newListener"! Before
518
+ // adding it to the listeners, first emit "newListener".
519
+ if (this._events.newListener)
520
+ this.emit('newListener', type,
521
+ isFunction(listener.listener) ?
522
+ listener.listener : listener);
523
 
524
+ if (!this._events[type])
525
+ // Optimize the case of one listener. Don't need the extra array object.
526
+ this._events[type] = listener;
527
+ else if (isObject(this._events[type]))
528
+ // If we've already got an array, just append.
529
+ this._events[type].push(listener);
530
+ else
531
+ // Adding the second element, need to change to array.
532
+ this._events[type] = [this._events[type], listener];
533
 
534
+ // Check for listener leak
535
+ if (isObject(this._events[type]) && !this._events[type].warned) {
536
+ if (!isUndefined(this._maxListeners)) {
537
+ m = this._maxListeners;
538
+ } else {
539
+ m = EventEmitter.defaultMaxListeners;
540
+ }
541
 
542
+ if (m && m > 0 && this._events[type].length > m) {
543
+ this._events[type].warned = true;
544
+ console.error('(node) warning: possible EventEmitter memory ' +
545
+ 'leak detected. %d listeners added. ' +
546
+ 'Use emitter.setMaxListeners() to increase limit.',
547
+ this._events[type].length);
548
+ if (typeof console.trace === 'function') {
549
+ // not supported in IE 10
550
+ console.trace();
551
+ }
552
+ }
553
+ }
554
 
555
+ return this;
556
+ };
557
 
558
+ EventEmitter.prototype.on = EventEmitter.prototype.addListener;
 
559
 
560
+ EventEmitter.prototype.once = function(type, listener) {
561
+ if (!isFunction(listener))
562
+ throw TypeError('listener must be a function');
563
 
564
+ var fired = false;
 
 
 
565
 
566
+ function g() {
567
+ this.removeListener(type, g);
568
 
569
+ if (!fired) {
570
+ fired = true;
571
+ listener.apply(this, arguments);
572
+ }
573
+ }
 
 
574
 
575
+ g.listener = listener;
576
+ this.on(type, g);
 
 
 
 
 
 
577
 
578
+ return this;
579
+ };
 
580
 
581
+ // emits a 'removeListener' event iff the listener was removed
582
+ EventEmitter.prototype.removeListener = function(type, listener) {
583
+ var list, position, length, i;
584
 
585
+ if (!isFunction(listener))
586
+ throw TypeError('listener must be a function');
 
 
 
587
 
588
+ if (!this._events || !this._events[type])
589
+ return this;
 
 
 
 
 
 
 
 
590
 
591
+ list = this._events[type];
592
+ length = list.length;
593
+ position = -1;
594
 
595
+ if (list === listener ||
596
+ (isFunction(list.listener) && list.listener === listener)) {
597
+ delete this._events[type];
598
+ if (this._events.removeListener)
599
+ this.emit('removeListener', type, listener);
 
 
 
 
 
600
 
601
+ } else if (isObject(list)) {
602
+ for (i = length; i-- > 0;) {
603
+ if (list[i] === listener ||
604
+ (list[i].listener && list[i].listener === listener)) {
605
+ position = i;
606
+ break;
607
+ }
608
+ }
609
 
610
+ if (position < 0)
611
+ return this;
 
 
 
612
 
613
+ if (list.length === 1) {
614
+ list.length = 0;
615
+ delete this._events[type];
616
+ } else {
617
+ list.splice(position, 1);
618
+ }
619
 
620
+ if (this._events.removeListener)
621
+ this.emit('removeListener', type, listener);
622
+ }
623
 
624
+ return this;
625
+ };
 
626
 
627
+ EventEmitter.prototype.removeAllListeners = function(type) {
628
+ var key, listeners;
 
 
 
629
 
630
+ if (!this._events)
631
+ return this;
632
 
633
+ // not listening for removeListener, no need to emit
634
+ if (!this._events.removeListener) {
635
+ if (arguments.length === 0)
636
+ this._events = {};
637
+ else if (this._events[type])
638
+ delete this._events[type];
639
+ return this;
640
+ }
 
 
 
 
 
 
 
 
 
 
 
 
641
 
642
+ // emit removeListener for all listeners on all events
643
+ if (arguments.length === 0) {
644
+ for (key in this._events) {
645
+ if (key === 'removeListener') continue;
646
+ this.removeAllListeners(key);
647
+ }
648
+ this.removeAllListeners('removeListener');
649
+ this._events = {};
650
+ return this;
651
+ }
652
 
653
+ listeners = this._events[type];
 
 
 
 
 
 
 
 
654
 
655
+ if (isFunction(listeners)) {
656
+ this.removeListener(type, listeners);
657
+ } else if (listeners) {
658
+ // LIFO order
659
+ while (listeners.length)
660
+ this.removeListener(type, listeners[listeners.length - 1]);
661
+ }
662
+ delete this._events[type];
 
 
 
 
 
 
663
 
664
+ return this;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
665
  };
666
 
667
+ EventEmitter.prototype.listeners = function(type) {
668
+ var ret;
669
+ if (!this._events || !this._events[type])
670
+ ret = [];
671
+ else if (isFunction(this._events[type]))
672
+ ret = [this._events[type]];
673
+ else
674
+ ret = this._events[type].slice();
675
+ return ret;
 
 
 
 
 
 
 
 
 
 
676
  };
677
 
678
+ EventEmitter.prototype.listenerCount = function(type) {
679
+ if (this._events) {
680
+ var evlistener = this._events[type];
 
 
 
 
681
 
682
+ if (isFunction(evlistener))
683
+ return 1;
684
+ else if (evlistener)
685
+ return evlistener.length;
686
+ }
687
+ return 0;
 
 
 
 
 
 
 
 
 
688
  };
689
 
690
+ EventEmitter.listenerCount = function(emitter, type) {
691
+ return emitter.listenerCount(type);
 
 
 
 
692
  };
693
 
694
+ function isFunction(arg) {
695
+ return typeof arg === 'function';
696
+ }
 
 
 
 
697
 
698
+ function isNumber(arg) {
699
+ return typeof arg === 'number';
700
+ }
 
 
 
 
 
 
 
 
 
701
 
702
+ function isObject(arg) {
703
+ return typeof arg === 'object' && arg !== null;
704
+ }
 
 
 
 
 
 
 
705
 
706
+ function isUndefined(arg) {
707
+ return arg === void 0;
708
+ }
 
 
 
 
 
709
 
 
 
 
 
 
 
 
 
 
 
 
 
 
710
 
711
+ /***/ }),
712
+ /* 56 */
713
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
714
 
715
+ "use strict";
716
+ /* WEBPACK VAR INJECTION */(function(process) {
 
 
 
 
 
 
 
 
 
 
717
 
718
+ if (!process.version ||
719
+ process.version.indexOf('v0.') === 0 ||
720
+ process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
721
+ module.exports = nextTick;
722
+ } else {
723
+ module.exports = process.nextTick;
724
+ }
 
 
 
 
 
725
 
726
+ function nextTick(fn, arg1, arg2, arg3) {
727
+ if (typeof fn !== 'function') {
728
+ throw new TypeError('"callback" argument must be a function');
729
+ }
730
+ var len = arguments.length;
731
+ var args, i;
732
+ switch (len) {
733
+ case 0:
734
+ case 1:
735
+ return process.nextTick(fn);
736
+ case 2:
737
+ return process.nextTick(function afterTickOne() {
738
+ fn.call(null, arg1);
739
+ });
740
+ case 3:
741
+ return process.nextTick(function afterTickTwo() {
742
+ fn.call(null, arg1, arg2);
743
+ });
744
+ case 4:
745
+ return process.nextTick(function afterTickThree() {
746
+ fn.call(null, arg1, arg2, arg3);
747
+ });
748
+ default:
749
+ args = new Array(len - 1);
750
+ i = 0;
751
+ while (i < args.length) {
752
+ args[i++] = arguments[i];
753
+ }
754
+ return process.nextTick(function afterTick() {
755
+ fn.apply(null, args);
756
+ });
757
+ }
758
+ }
759
 
760
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
 
 
 
 
761
 
762
+ /***/ }),
763
+ /* 57 */
764
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
765
 
766
+ /* eslint-disable node/no-deprecated-api */
767
+ var buffer = __webpack_require__(89)
768
+ var Buffer = buffer.Buffer
 
 
 
 
769
 
770
+ // alternative to using Object.keys for old browsers
771
+ function copyProps (src, dst) {
772
+ for (var key in src) {
773
+ dst[key] = src[key]
774
+ }
775
+ }
776
+ if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
777
+ module.exports = buffer
778
+ } else {
779
+ // Copy properties from require('buffer')
780
+ copyProps(buffer, exports)
781
+ exports.Buffer = SafeBuffer
782
+ }
783
 
784
+ function SafeBuffer (arg, encodingOrOffset, length) {
785
+ return Buffer(arg, encodingOrOffset, length)
786
+ }
787
 
788
+ // Copy static methods from Buffer
789
+ copyProps(Buffer, SafeBuffer)
 
 
 
 
 
790
 
791
+ SafeBuffer.from = function (arg, encodingOrOffset, length) {
792
+ if (typeof arg === 'number') {
793
+ throw new TypeError('Argument must not be a number')
794
+ }
795
+ return Buffer(arg, encodingOrOffset, length)
796
+ }
 
 
 
 
 
797
 
798
+ SafeBuffer.alloc = function (size, fill, encoding) {
799
+ if (typeof size !== 'number') {
800
+ throw new TypeError('Argument must be a number')
801
+ }
802
+ var buf = Buffer(size)
803
+ if (fill !== undefined) {
804
+ if (typeof encoding === 'string') {
805
+ buf.fill(fill, encoding)
806
+ } else {
807
+ buf.fill(fill)
808
+ }
809
+ } else {
810
+ buf.fill(0)
811
+ }
812
+ return buf
813
+ }
814
 
815
+ SafeBuffer.allocUnsafe = function (size) {
816
+ if (typeof size !== 'number') {
817
+ throw new TypeError('Argument must be a number')
818
+ }
819
+ return Buffer(size)
820
+ }
 
 
 
821
 
822
+ SafeBuffer.allocUnsafeSlow = function (size) {
823
+ if (typeof size !== 'number') {
824
+ throw new TypeError('Argument must be a number')
825
+ }
826
+ return buffer.SlowBuffer(size)
827
+ }
828
 
 
829
 
830
+ /***/ }),
831
+ /* 58 */,
832
+ /* 59 */,
833
+ /* 60 */,
834
+ /* 61 */,
835
+ /* 62 */,
836
+ /* 63 */,
837
+ /* 64 */,
838
+ /* 65 */,
839
+ /* 66 */,
840
+ /* 67 */,
841
+ /* 68 */,
842
+ /* 69 */,
843
+ /* 70 */,
844
+ /* 71 */,
845
+ /* 72 */,
846
+ /* 73 */,
847
+ /* 74 */,
848
+ /* 75 */,
849
+ /* 76 */,
850
+ /* 77 */,
851
+ /* 78 */,
852
+ /* 79 */,
853
+ /* 80 */,
854
+ /* 81 */,
855
+ /* 82 */,
856
+ /* 83 */,
857
+ /* 84 */,
858
+ /* 85 */,
859
+ /* 86 */
860
+ /***/ (function(module, exports) {
861
 
862
+ module.exports = {"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\"","QUOT":"\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}
 
 
 
 
 
 
 
 
 
863
 
864
+ /***/ }),
865
+ /* 87 */
866
+ /***/ (function(module, exports) {
 
 
 
 
 
867
 
868
+ module.exports = {"amp":"&","apos":"'","gt":">","lt":"<","quot":"\""}
 
 
 
869
 
870
+ /***/ }),
871
+ /* 88 */
872
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
873
 
874
+ exports = module.exports = __webpack_require__(264);
875
+ exports.Stream = exports;
876
+ exports.Readable = exports;
877
+ exports.Writable = __webpack_require__(90);
878
+ exports.Duplex = __webpack_require__(32);
879
+ exports.Transform = __webpack_require__(269);
880
+ exports.PassThrough = __webpack_require__(431);
881
 
 
 
 
 
 
 
 
 
 
882
 
883
+ /***/ }),
884
+ /* 89 */
885
+ /***/ (function(module, exports, __webpack_require__) {
886
 
887
+ "use strict";
888
+ /* WEBPACK VAR INJECTION */(function(global) {/*!
889
+ * The buffer module from node.js, for the browser.
890
+ *
891
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
892
+ * @license MIT
893
+ */
894
+ /* eslint-disable no-proto */
895
 
 
 
 
896
 
 
 
 
 
 
 
 
 
 
897
 
898
+ var base64 = __webpack_require__(425)
899
+ var ieee754 = __webpack_require__(426)
900
+ var isArray = __webpack_require__(265)
901
 
902
+ exports.Buffer = Buffer
903
+ exports.SlowBuffer = SlowBuffer
904
+ exports.INSPECT_MAX_BYTES = 50
 
 
 
905
 
906
+ /**
907
+ * If `Buffer.TYPED_ARRAY_SUPPORT`:
908
+ * === true Use Uint8Array implementation (fastest)
909
+ * === false Use Object implementation (most compatible, even IE6)
910
+ *
911
+ * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
912
+ * Opera 11.6+, iOS 4.2+.
913
+ *
914
+ * Due to various browser bugs, sometimes the Object implementation will be used even
915
+ * when the browser supports typed arrays.
916
+ *
917
+ * Note:
918
+ *
919
+ * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
920
+ * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
921
+ *
922
+ * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
923
+ *
924
+ * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
925
+ * incorrect length in some situations.
926
 
927
+ * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
928
+ * get the Object implementation, which is slower but behaves correctly.
929
+ */
930
+ Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
931
+ ? global.TYPED_ARRAY_SUPPORT
932
+ : typedArraySupport()
933
 
934
+ /*
935
+ * Export kMaxLength after typed array support is determined.
936
+ */
937
+ exports.kMaxLength = kMaxLength()
938
 
939
+ function typedArraySupport () {
940
+ try {
941
+ var arr = new Uint8Array(1)
942
+ arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
943
+ return arr.foo() === 42 && // typed array instances can be augmented
944
+ typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
945
+ arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
946
+ } catch (e) {
947
+ return false
948
+ }
949
+ }
950
 
951
+ function kMaxLength () {
952
+ return Buffer.TYPED_ARRAY_SUPPORT
953
+ ? 0x7fffffff
954
+ : 0x3fffffff
955
+ }
956
 
957
+ function createBuffer (that, length) {
958
+ if (kMaxLength() < length) {
959
+ throw new RangeError('Invalid typed array length')
960
+ }
961
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
962
+ // Return an augmented `Uint8Array` instance, for best performance
963
+ that = new Uint8Array(length)
964
+ that.__proto__ = Buffer.prototype
965
+ } else {
966
+ // Fallback: Return an object instance of the Buffer class
967
+ if (that === null) {
968
+ that = new Buffer(length)
969
+ }
970
+ that.length = length
971
+ }
972
 
973
+ return that
974
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
975
 
976
+ /**
977
+ * The Buffer constructor returns instances of `Uint8Array` that have their
978
+ * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
979
+ * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
980
+ * and the `Uint8Array` methods. Square bracket notation works as expected -- it
981
+ * returns a single octet.
982
+ *
983
+ * The `Uint8Array` prototype remains unmodified.
984
+ */
985
 
986
+ function Buffer (arg, encodingOrOffset, length) {
987
+ if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
988
+ return new Buffer(arg, encodingOrOffset, length)
989
+ }
990
 
991
+ // Common case.
992
+ if (typeof arg === 'number') {
993
+ if (typeof encodingOrOffset === 'string') {
994
+ throw new Error(
995
+ 'If encoding is specified then the first argument must be a string'
996
+ )
997
+ }
998
+ return allocUnsafe(this, arg)
999
+ }
1000
+ return from(this, arg, encodingOrOffset, length)
1001
+ }
1002
 
1003
+ Buffer.poolSize = 8192 // not used by this implementation
 
1004
 
1005
+ // TODO: Legacy, not needed anymore. Remove in next major version.
1006
+ Buffer._augment = function (arr) {
1007
+ arr.__proto__ = Buffer.prototype
1008
+ return arr
1009
+ }
 
 
 
 
 
 
 
 
1010
 
1011
+ function from (that, value, encodingOrOffset, length) {
1012
+ if (typeof value === 'number') {
1013
+ throw new TypeError('"value" argument must not be a number')
1014
+ }
 
 
 
 
 
 
 
 
 
1015
 
1016
+ if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
1017
+ return fromArrayBuffer(that, value, encodingOrOffset, length)
1018
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1019
 
1020
+ if (typeof value === 'string') {
1021
+ return fromString(that, value, encodingOrOffset)
1022
+ }
1023
 
1024
+ return fromObject(that, value)
1025
+ }
 
1026
 
1027
+ /**
1028
+ * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
1029
+ * if value is a number.
1030
+ * Buffer.from(str[, encoding])
1031
+ * Buffer.from(array)
1032
+ * Buffer.from(buffer)
1033
+ * Buffer.from(arrayBuffer[, byteOffset[, length]])
1034
+ **/
1035
+ Buffer.from = function (value, encodingOrOffset, length) {
1036
+ return from(null, value, encodingOrOffset, length)
1037
+ }
1038
 
1039
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
1040
+ Buffer.prototype.__proto__ = Uint8Array.prototype
1041
+ Buffer.__proto__ = Uint8Array
1042
+ if (typeof Symbol !== 'undefined' && Symbol.species &&
1043
+ Buffer[Symbol.species] === Buffer) {
1044
+ // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
1045
+ Object.defineProperty(Buffer, Symbol.species, {
1046
+ value: null,
1047
+ configurable: true
1048
+ })
1049
+ }
1050
+ }
 
 
 
 
 
 
1051
 
1052
+ function assertSize (size) {
1053
+ if (typeof size !== 'number') {
1054
+ throw new TypeError('"size" argument must be a number')
1055
+ } else if (size < 0) {
1056
+ throw new RangeError('"size" argument must not be negative')
1057
+ }
1058
+ }
 
 
 
 
 
 
 
 
 
 
 
1059
 
1060
+ function alloc (that, size, fill, encoding) {
1061
+ assertSize(size)
1062
+ if (size <= 0) {
1063
+ return createBuffer(that, size)
1064
+ }
1065
+ if (fill !== undefined) {
1066
+ // Only pay attention to encoding if it's a string. This
1067
+ // prevents accidentally sending in a number that would
1068
+ // be interpretted as a start offset.
1069
+ return typeof encoding === 'string'
1070
+ ? createBuffer(that, size).fill(fill, encoding)
1071
+ : createBuffer(that, size).fill(fill)
1072
+ }
1073
+ return createBuffer(that, size)
1074
+ }
1075
 
1076
+ /**
1077
+ * Creates a new filled Buffer instance.
1078
+ * alloc(size[, fill[, encoding]])
1079
+ **/
1080
+ Buffer.alloc = function (size, fill, encoding) {
1081
+ return alloc(null, size, fill, encoding)
1082
+ }
1083
 
1084
+ function allocUnsafe (that, size) {
1085
+ assertSize(size)
1086
+ that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
1087
+ if (!Buffer.TYPED_ARRAY_SUPPORT) {
1088
+ for (var i = 0; i < size; ++i) {
1089
+ that[i] = 0
1090
+ }
1091
+ }
1092
+ return that
1093
+ }
 
 
1094
 
1095
+ /**
1096
+ * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
1097
+ * */
1098
+ Buffer.allocUnsafe = function (size) {
1099
+ return allocUnsafe(null, size)
1100
+ }
1101
+ /**
1102
+ * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
1103
+ */
1104
+ Buffer.allocUnsafeSlow = function (size) {
1105
+ return allocUnsafe(null, size)
1106
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1107
 
1108
+ function fromString (that, string, encoding) {
1109
+ if (typeof encoding !== 'string' || encoding === '') {
1110
+ encoding = 'utf8'
1111
+ }
 
 
 
 
 
 
 
 
 
 
1112
 
1113
+ if (!Buffer.isEncoding(encoding)) {
1114
+ throw new TypeError('"encoding" must be a valid string encoding')
1115
+ }
 
 
 
 
 
 
 
 
1116
 
1117
+ var length = byteLength(string, encoding) | 0
1118
+ that = createBuffer(that, length)
 
 
 
 
 
 
 
 
 
 
1119
 
1120
+ var actual = that.write(string, encoding)
 
 
 
 
 
 
 
 
1121
 
1122
+ if (actual !== length) {
1123
+ // Writing a hex string, for example, that contains invalid characters will
1124
+ // cause everything after the first invalid character to be ignored. (e.g.
1125
+ // 'abxxcd' will be treated as 'ab')
1126
+ that = that.slice(0, actual)
1127
+ }
 
 
 
 
 
 
 
 
1128
 
1129
+ return that
1130
+ }
 
1131
 
1132
+ function fromArrayLike (that, array) {
1133
+ var length = array.length < 0 ? 0 : checked(array.length) | 0
1134
+ that = createBuffer(that, length)
1135
+ for (var i = 0; i < length; i += 1) {
1136
+ that[i] = array[i] & 255
1137
+ }
1138
+ return that
1139
+ }
1140
 
1141
+ function fromArrayBuffer (that, array, byteOffset, length) {
1142
+ array.byteLength // this throws if `array` is not a valid ArrayBuffer
1143
 
1144
+ if (byteOffset < 0 || array.byteLength < byteOffset) {
1145
+ throw new RangeError('\'offset\' is out of bounds')
1146
+ }
 
 
1147
 
1148
+ if (array.byteLength < byteOffset + (length || 0)) {
1149
+ throw new RangeError('\'length\' is out of bounds')
1150
+ }
 
 
 
 
1151
 
1152
+ if (byteOffset === undefined && length === undefined) {
1153
+ array = new Uint8Array(array)
1154
+ } else if (length === undefined) {
1155
+ array = new Uint8Array(array, byteOffset)
1156
+ } else {
1157
+ array = new Uint8Array(array, byteOffset, length)
1158
+ }
1159
 
1160
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
1161
+ // Return an augmented `Uint8Array` instance, for best performance
1162
+ that = array
1163
+ that.__proto__ = Buffer.prototype
1164
+ } else {
1165
+ // Fallback: Return an object instance of the Buffer class
1166
+ that = fromArrayLike(that, array)
1167
+ }
1168
+ return that
1169
+ }
1170
 
1171
+ function fromObject (that, obj) {
1172
+ if (Buffer.isBuffer(obj)) {
1173
+ var len = checked(obj.length) | 0
1174
+ that = createBuffer(that, len)
1175
 
1176
+ if (that.length === 0) {
1177
+ return that
1178
+ }
 
 
1179
 
1180
+ obj.copy(that, 0, 0, len)
1181
+ return that
1182
+ }
1183
 
1184
+ if (obj) {
1185
+ if ((typeof ArrayBuffer !== 'undefined' &&
1186
+ obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
1187
+ if (typeof obj.length !== 'number' || isnan(obj.length)) {
1188
+ return createBuffer(that, 0)
1189
+ }
1190
+ return fromArrayLike(that, obj)
1191
+ }
1192
 
1193
+ if (obj.type === 'Buffer' && isArray(obj.data)) {
1194
+ return fromArrayLike(that, obj.data)
1195
+ }
1196
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1197
 
1198
+ throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
1199
+ }
 
1200
 
1201
+ function checked (length) {
1202
+ // Note: cannot use `length < kMaxLength()` here because that fails when
1203
+ // length is NaN (which is otherwise coerced to zero.)
1204
+ if (length >= kMaxLength()) {
1205
+ throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
1206
+ 'size: 0x' + kMaxLength().toString(16) + ' bytes')
1207
+ }
1208
+ return length | 0
1209
+ }
 
 
 
1210
 
1211
+ function SlowBuffer (length) {
1212
+ if (+length != length) { // eslint-disable-line eqeqeq
1213
+ length = 0
1214
+ }
1215
+ return Buffer.alloc(+length)
1216
+ }
 
1217
 
1218
+ Buffer.isBuffer = function isBuffer (b) {
1219
+ return !!(b != null && b._isBuffer)
1220
+ }
1221
 
1222
+ Buffer.compare = function compare (a, b) {
1223
+ if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
1224
+ throw new TypeError('Arguments must be Buffers')
1225
+ }
1226
 
1227
+ if (a === b) return 0
 
1228
 
1229
+ var x = a.length
1230
+ var y = b.length
1231
 
1232
+ for (var i = 0, len = Math.min(x, y); i < len; ++i) {
1233
+ if (a[i] !== b[i]) {
1234
+ x = a[i]
1235
+ y = b[i]
1236
+ break
1237
+ }
1238
+ }
1239
 
1240
+ if (x < y) return -1
1241
+ if (y < x) return 1
1242
+ return 0
1243
+ }
1244
 
1245
+ Buffer.isEncoding = function isEncoding (encoding) {
1246
+ switch (String(encoding).toLowerCase()) {
1247
+ case 'hex':
1248
+ case 'utf8':
1249
+ case 'utf-8':
1250
+ case 'ascii':
1251
+ case 'latin1':
1252
+ case 'binary':
1253
+ case 'base64':
1254
+ case 'ucs2':
1255
+ case 'ucs-2':
1256
+ case 'utf16le':
1257
+ case 'utf-16le':
1258
+ return true
1259
+ default:
1260
+ return false
1261
+ }
1262
+ }
1263
 
1264
+ Buffer.concat = function concat (list, length) {
1265
+ if (!isArray(list)) {
1266
+ throw new TypeError('"list" argument must be an Array of Buffers')
1267
+ }
1268
 
1269
+ if (list.length === 0) {
1270
+ return Buffer.alloc(0)
1271
+ }
1272
 
1273
+ var i
1274
+ if (length === undefined) {
1275
+ length = 0
1276
+ for (i = 0; i < list.length; ++i) {
1277
+ length += list[i].length
1278
+ }
1279
+ }
1280
 
1281
+ var buffer = Buffer.allocUnsafe(length)
1282
+ var pos = 0
1283
+ for (i = 0; i < list.length; ++i) {
1284
+ var buf = list[i]
1285
+ if (!Buffer.isBuffer(buf)) {
1286
+ throw new TypeError('"list" argument must be an Array of Buffers')
1287
+ }
1288
+ buf.copy(buffer, pos)
1289
+ pos += buf.length
1290
+ }
1291
+ return buffer
1292
  }
1293
 
1294
+ function byteLength (string, encoding) {
1295
+ if (Buffer.isBuffer(string)) {
1296
+ return string.length
1297
+ }
1298
+ if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
1299
+ (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
1300
+ return string.byteLength
1301
+ }
1302
+ if (typeof string !== 'string') {
1303
+ string = '' + string
1304
+ }
1305
 
1306
+ var len = string.length
1307
+ if (len === 0) return 0
 
 
1308
 
1309
+ // Use a for loop to avoid recursion
1310
+ var loweredCase = false
1311
+ for (;;) {
1312
+ switch (encoding) {
1313
+ case 'ascii':
1314
+ case 'latin1':
1315
+ case 'binary':
1316
+ return len
1317
+ case 'utf8':
1318
+ case 'utf-8':
1319
+ case undefined:
1320
+ return utf8ToBytes(string).length
1321
+ case 'ucs2':
1322
+ case 'ucs-2':
1323
+ case 'utf16le':
1324
+ case 'utf-16le':
1325
+ return len * 2
1326
+ case 'hex':
1327
+ return len >>> 1
1328
+ case 'base64':
1329
+ return base64ToBytes(string).length
1330
+ default:
1331
+ if (loweredCase) return utf8ToBytes(string).length // assume utf8
1332
+ encoding = ('' + encoding).toLowerCase()
1333
+ loweredCase = true
1334
+ }
1335
+ }
1336
+ }
1337
+ Buffer.byteLength = byteLength
1338
 
1339
+ function slowToString (encoding, start, end) {
1340
+ var loweredCase = false
1341
 
1342
+ // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
1343
+ // property of a typed array.
1344
 
1345
+ // This behaves neither like String nor Uint8Array in that we set start/end
1346
+ // to their upper/lower bounds if the value passed is out of range.
1347
+ // undefined is handled specially as per ECMA-262 6th Edition,
1348
+ // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
1349
+ if (start === undefined || start < 0) {
1350
+ start = 0
1351
+ }
1352
+ // Return early if start > this.length. Done here to prevent potential uint32
1353
+ // coercion fail below.
1354
+ if (start > this.length) {
1355
+ return ''
1356
+ }
 
 
 
1357
 
1358
+ if (end === undefined || end > this.length) {
1359
+ end = this.length
1360
+ }
 
 
 
 
 
1361
 
1362
+ if (end <= 0) {
1363
+ return ''
1364
+ }
 
 
 
1365
 
1366
+ // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
1367
+ end >>>= 0
1368
+ start >>>= 0
 
 
 
 
 
 
 
 
 
1369
 
1370
+ if (end <= start) {
1371
+ return ''
1372
+ }
1373
 
1374
+ if (!encoding) encoding = 'utf8'
1375
 
1376
+ while (true) {
1377
+ switch (encoding) {
1378
+ case 'hex':
1379
+ return hexSlice(this, start, end)
1380
 
1381
+ case 'utf8':
1382
+ case 'utf-8':
1383
+ return utf8Slice(this, start, end)
1384
 
1385
+ case 'ascii':
1386
+ return asciiSlice(this, start, end)
 
 
1387
 
1388
+ case 'latin1':
1389
+ case 'binary':
1390
+ return latin1Slice(this, start, end)
1391
 
1392
+ case 'base64':
1393
+ return base64Slice(this, start, end)
1394
 
1395
+ case 'ucs2':
1396
+ case 'ucs-2':
1397
+ case 'utf16le':
1398
+ case 'utf-16le':
1399
+ return utf16leSlice(this, start, end)
1400
 
1401
+ default:
1402
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
1403
+ encoding = (encoding + '').toLowerCase()
1404
+ loweredCase = true
1405
+ }
1406
+ }
1407
+ }
1408
 
1409
+ // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
1410
+ // Buffer instances.
1411
+ Buffer.prototype._isBuffer = true
 
 
1412
 
1413
+ function swap (b, n, m) {
1414
+ var i = b[n]
1415
+ b[n] = b[m]
1416
+ b[m] = i
1417
+ }
1418
 
1419
+ Buffer.prototype.swap16 = function swap16 () {
1420
+ var len = this.length
1421
+ if (len % 2 !== 0) {
1422
+ throw new RangeError('Buffer size must be a multiple of 16-bits')
1423
+ }
1424
+ for (var i = 0; i < len; i += 2) {
1425
+ swap(this, i, i + 1)
1426
+ }
1427
+ return this
1428
+ }
1429
 
1430
+ Buffer.prototype.swap32 = function swap32 () {
1431
+ var len = this.length
1432
+ if (len % 4 !== 0) {
1433
+ throw new RangeError('Buffer size must be a multiple of 32-bits')
1434
+ }
1435
+ for (var i = 0; i < len; i += 4) {
1436
+ swap(this, i, i + 3)
1437
+ swap(this, i + 1, i + 2)
1438
+ }
1439
+ return this
1440
+ }
 
 
 
 
 
 
 
 
 
 
1441
 
1442
+ Buffer.prototype.swap64 = function swap64 () {
1443
+ var len = this.length
1444
+ if (len % 8 !== 0) {
1445
+ throw new RangeError('Buffer size must be a multiple of 64-bits')
1446
+ }
1447
+ for (var i = 0; i < len; i += 8) {
1448
+ swap(this, i, i + 7)
1449
+ swap(this, i + 1, i + 6)
1450
+ swap(this, i + 2, i + 5)
1451
+ swap(this, i + 3, i + 4)
1452
+ }
1453
+ return this
1454
+ }
1455
 
1456
+ Buffer.prototype.toString = function toString () {
1457
+ var length = this.length | 0
1458
+ if (length === 0) return ''
1459
+ if (arguments.length === 0) return utf8Slice(this, 0, length)
1460
+ return slowToString.apply(this, arguments)
1461
+ }
1462
 
1463
+ Buffer.prototype.equals = function equals (b) {
1464
+ if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
1465
+ if (this === b) return true
1466
+ return Buffer.compare(this, b) === 0
1467
+ }
1468
 
1469
+ Buffer.prototype.inspect = function inspect () {
1470
+ var str = ''
1471
+ var max = exports.INSPECT_MAX_BYTES
1472
+ if (this.length > 0) {
1473
+ str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
1474
+ if (this.length > max) str += ' ... '
1475
+ }
1476
+ return '<Buffer ' + str + '>'
1477
+ }
1478
 
1479
+ Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
1480
+ if (!Buffer.isBuffer(target)) {
1481
+ throw new TypeError('Argument must be a Buffer')
1482
+ }
1483
 
1484
+ if (start === undefined) {
1485
+ start = 0
1486
+ }
1487
+ if (end === undefined) {
1488
+ end = target ? target.length : 0
1489
+ }
1490
+ if (thisStart === undefined) {
1491
+ thisStart = 0
1492
+ }
1493
+ if (thisEnd === undefined) {
1494
+ thisEnd = this.length
1495
+ }
1496
 
1497
+ if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
1498
+ throw new RangeError('out of range index')
1499
+ }
1500
 
1501
+ if (thisStart >= thisEnd && start >= end) {
1502
+ return 0
1503
+ }
1504
+ if (thisStart >= thisEnd) {
1505
+ return -1
1506
+ }
1507
+ if (start >= end) {
1508
+ return 1
1509
+ }
1510
 
1511
+ start >>>= 0
1512
+ end >>>= 0
1513
+ thisStart >>>= 0
1514
+ thisEnd >>>= 0
1515
 
1516
+ if (this === target) return 0
 
 
 
1517
 
1518
+ var x = thisEnd - thisStart
1519
+ var y = end - start
1520
+ var len = Math.min(x, y)
1521
 
1522
+ var thisCopy = this.slice(thisStart, thisEnd)
1523
+ var targetCopy = target.slice(start, end)
 
 
 
 
 
 
 
 
 
 
1524
 
1525
+ for (var i = 0; i < len; ++i) {
1526
+ if (thisCopy[i] !== targetCopy[i]) {
1527
+ x = thisCopy[i]
1528
+ y = targetCopy[i]
1529
+ break
1530
+ }
1531
+ }
1532
 
1533
+ if (x < y) return -1
1534
+ if (y < x) return 1
1535
+ return 0
 
 
 
 
1536
  }
 
 
 
 
 
 
 
1537
 
1538
+ // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
1539
+ // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
1540
+ //
1541
+ // Arguments:
1542
+ // - buffer - a Buffer to search
1543
+ // - val - a string, Buffer, or number
1544
+ // - byteOffset - an index into `buffer`; will be clamped to an int32
1545
+ // - encoding - an optional encoding, relevant is val is a string
1546
+ // - dir - true for indexOf, false for lastIndexOf
1547
+ function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
1548
+ // Empty buffer means no match
1549
+ if (buffer.length === 0) return -1
1550
 
1551
+ // Normalize byteOffset
1552
+ if (typeof byteOffset === 'string') {
1553
+ encoding = byteOffset
1554
+ byteOffset = 0
1555
+ } else if (byteOffset > 0x7fffffff) {
1556
+ byteOffset = 0x7fffffff
1557
+ } else if (byteOffset < -0x80000000) {
1558
+ byteOffset = -0x80000000
1559
+ }
1560
+ byteOffset = +byteOffset // Coerce to Number.
1561
+ if (isNaN(byteOffset)) {
1562
+ // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
1563
+ byteOffset = dir ? 0 : (buffer.length - 1)
1564
  }
 
1565
 
1566
+ // Normalize byteOffset: negative offsets start from the end of the buffer
1567
+ if (byteOffset < 0) byteOffset = buffer.length + byteOffset
1568
+ if (byteOffset >= buffer.length) {
1569
+ if (dir) return -1
1570
+ else byteOffset = buffer.length - 1
1571
+ } else if (byteOffset < 0) {
1572
+ if (dir) byteOffset = 0
1573
+ else return -1
1574
+ }
1575
 
1576
+ // Normalize val
1577
+ if (typeof val === 'string') {
1578
+ val = Buffer.from(val, encoding)
1579
+ }
1580
 
1581
+ // Finally, search either indexOf (if dir is true) or lastIndexOf
1582
+ if (Buffer.isBuffer(val)) {
1583
+ // Special case: looking for empty string/buffer always fails
1584
+ if (val.length === 0) {
1585
+ return -1
1586
+ }
1587
+ return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
1588
+ } else if (typeof val === 'number') {
1589
+ val = val & 0xFF // Search for a byte value [0-255]
1590
+ if (Buffer.TYPED_ARRAY_SUPPORT &&
1591
+ typeof Uint8Array.prototype.indexOf === 'function') {
1592
+ if (dir) {
1593
+ return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
1594
+ } else {
1595
+ return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
1596
+ }
1597
+ }
1598
+ return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
1599
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1600
 
1601
+ throw new TypeError('val must be string, number or Buffer')
1602
+ }
1603
 
1604
+ function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
1605
+ var indexSize = 1
1606
+ var arrLength = arr.length
1607
+ var valLength = val.length
1608
 
1609
+ if (encoding !== undefined) {
1610
+ encoding = String(encoding).toLowerCase()
1611
+ if (encoding === 'ucs2' || encoding === 'ucs-2' ||
1612
+ encoding === 'utf16le' || encoding === 'utf-16le') {
1613
+ if (arr.length < 2 || val.length < 2) {
1614
+ return -1
1615
+ }
1616
+ indexSize = 2
1617
+ arrLength /= 2
1618
+ valLength /= 2
1619
+ byteOffset /= 2
1620
+ }
1621
+ }
1622
 
1623
+ function read (buf, i) {
1624
+ if (indexSize === 1) {
1625
+ return buf[i]
1626
+ } else {
1627
+ return buf.readUInt16BE(i * indexSize)
1628
+ }
1629
+ }
1630
 
1631
+ var i
1632
+ if (dir) {
1633
+ var foundIndex = -1
1634
+ for (i = byteOffset; i < arrLength; i++) {
1635
+ if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
1636
+ if (foundIndex === -1) foundIndex = i
1637
+ if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
1638
+ } else {
1639
+ if (foundIndex !== -1) i -= i - foundIndex
1640
+ foundIndex = -1
1641
+ }
1642
+ }
1643
+ } else {
1644
+ if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
1645
+ for (i = byteOffset; i >= 0; i--) {
1646
+ var found = true
1647
+ for (var j = 0; j < valLength; j++) {
1648
+ if (read(arr, i + j) !== read(val, j)) {
1649
+ found = false
1650
+ break
1651
+ }
1652
+ }
1653
+ if (found) return i
1654
+ }
1655
  }
1656
+
1657
+ return -1
1658
  }
1659
 
1660
+ Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
1661
+ return this.indexOf(val, byteOffset, encoding) !== -1
1662
+ }
1663
 
1664
+ Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
1665
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
1666
+ }
1667
 
1668
+ Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
1669
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
1670
+ }
1671
 
1672
+ function hexWrite (buf, string, offset, length) {
1673
+ offset = Number(offset) || 0
1674
+ var remaining = buf.length - offset
1675
+ if (!length) {
1676
+ length = remaining
1677
+ } else {
1678
+ length = Number(length)
1679
+ if (length > remaining) {
1680
+ length = remaining
1681
+ }
1682
+ }
1683
 
1684
+ // must be an even number of digits
1685
+ var strLen = string.length
1686
+ if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
1687
 
1688
+ if (length > strLen / 2) {
1689
+ length = strLen / 2
1690
+ }
1691
+ for (var i = 0; i < length; ++i) {
1692
+ var parsed = parseInt(string.substr(i * 2, 2), 16)
1693
+ if (isNaN(parsed)) return i
1694
+ buf[offset + i] = parsed
1695
  }
1696
+ return i
1697
+ }
1698
 
1699
+ function utf8Write (buf, string, offset, length) {
1700
+ return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
1701
  }
1702
 
1703
+ function asciiWrite (buf, string, offset, length) {
1704
+ return blitBuffer(asciiToBytes(string), buf, offset, length)
1705
+ }
 
 
 
 
 
 
 
 
 
 
1706
 
1707
+ function latin1Write (buf, string, offset, length) {
1708
+ return asciiWrite(buf, string, offset, length)
1709
+ }
 
 
1710
 
1711
+ function base64Write (buf, string, offset, length) {
1712
+ return blitBuffer(base64ToBytes(string), buf, offset, length)
1713
+ }
 
 
 
1714
 
1715
+ function ucs2Write (buf, string, offset, length) {
1716
+ return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
1717
+ }
 
 
 
 
1718
 
1719
+ Buffer.prototype.write = function write (string, offset, length, encoding) {
1720
+ // Buffer#write(string)
1721
+ if (offset === undefined) {
1722
+ encoding = 'utf8'
1723
+ length = this.length
1724
+ offset = 0
1725
+ // Buffer#write(string, encoding)
1726
+ } else if (length === undefined && typeof offset === 'string') {
1727
+ encoding = offset
1728
+ length = this.length
1729
+ offset = 0
1730
+ // Buffer#write(string, offset[, length][, encoding])
1731
+ } else if (isFinite(offset)) {
1732
+ offset = offset | 0
1733
+ if (isFinite(length)) {
1734
+ length = length | 0
1735
+ if (encoding === undefined) encoding = 'utf8'
1736
+ } else {
1737
+ encoding = length
1738
+ length = undefined
1739
  }
1740
+ // legacy write(string, encoding, offset, length) - remove in v0.13
1741
  } else {
1742
+ throw new Error(
1743
+ 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
1744
+ )
1745
  }
1746
 
1747
+ var remaining = this.length - offset
1748
+ if (length === undefined || length > remaining) length = remaining
1749
 
1750
+ if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
1751
+ throw new RangeError('Attempt to write outside buffer bounds')
1752
+ }
 
1753
 
1754
+ if (!encoding) encoding = 'utf8'
 
 
 
 
 
 
 
 
 
 
 
 
 
1755
 
1756
+ var loweredCase = false
1757
+ for (;;) {
1758
+ switch (encoding) {
1759
+ case 'hex':
1760
+ return hexWrite(this, string, offset, length)
 
 
 
 
 
 
 
 
 
 
 
 
1761
 
1762
+ case 'utf8':
1763
+ case 'utf-8':
1764
+ return utf8Write(this, string, offset, length)
1765
 
1766
+ case 'ascii':
1767
+ return asciiWrite(this, string, offset, length)
 
 
 
 
 
 
1768
 
1769
+ case 'latin1':
1770
+ case 'binary':
1771
+ return latin1Write(this, string, offset, length)
1772
+
1773
+ case 'base64':
1774
+ // Warning: maxLength not taken into account in base64Write
1775
+ return base64Write(this, string, offset, length)
1776
+
1777
+ case 'ucs2':
1778
+ case 'ucs-2':
1779
+ case 'utf16le':
1780
+ case 'utf-16le':
1781
+ return ucs2Write(this, string, offset, length)
1782
+
1783
+ default:
1784
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
1785
+ encoding = ('' + encoding).toLowerCase()
1786
+ loweredCase = true
1787
+ }
1788
  }
 
1789
  }
1790
 
1791
+ Buffer.prototype.toJSON = function toJSON () {
1792
+ return {
1793
+ type: 'Buffer',
1794
+ data: Array.prototype.slice.call(this._arr || this, 0)
1795
  }
 
1796
  }
1797
 
1798
+ function base64Slice (buf, start, end) {
1799
+ if (start === 0 && end === buf.length) {
1800
+ return base64.fromByteArray(buf)
1801
+ } else {
1802
+ return base64.fromByteArray(buf.slice(start, end))
1803
+ }
 
 
 
1804
  }
1805
 
1806
+ function utf8Slice (buf, start, end) {
1807
+ end = Math.min(buf.length, end)
1808
+ var res = []
1809
 
1810
+ var i = start
1811
+ while (i < end) {
1812
+ var firstByte = buf[i]
1813
+ var codePoint = null
1814
+ var bytesPerSequence = (firstByte > 0xEF) ? 4
1815
+ : (firstByte > 0xDF) ? 3
1816
+ : (firstByte > 0xBF) ? 2
1817
+ : 1
1818
 
1819
+ if (i + bytesPerSequence <= end) {
1820
+ var secondByte, thirdByte, fourthByte, tempCodePoint
1821
+
1822
+ switch (bytesPerSequence) {
1823
+ case 1:
1824
+ if (firstByte < 0x80) {
1825
+ codePoint = firstByte
1826
+ }
1827
+ break
1828
+ case 2:
1829
+ secondByte = buf[i + 1]
1830
+ if ((secondByte & 0xC0) === 0x80) {
1831
+ tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
1832
+ if (tempCodePoint > 0x7F) {
1833
+ codePoint = tempCodePoint
1834
+ }
1835
+ }
1836
+ break
1837
+ case 3:
1838
+ secondByte = buf[i + 1]
1839
+ thirdByte = buf[i + 2]
1840
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
1841
+ tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
1842
+ if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
1843
+ codePoint = tempCodePoint
1844
+ }
1845
+ }
1846
+ break
1847
+ case 4:
1848
+ secondByte = buf[i + 1]
1849
+ thirdByte = buf[i + 2]
1850
+ fourthByte = buf[i + 3]
1851
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
1852
+ tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
1853
+ if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
1854
+ codePoint = tempCodePoint
1855
+ }
1856
+ }
1857
+ }
1858
+ }
1859
+
1860
+ if (codePoint === null) {
1861
+ // we did not generate a valid codePoint so insert a
1862
+ // replacement char (U+FFFD) and advance only 1 byte
1863
+ codePoint = 0xFFFD
1864
+ bytesPerSequence = 1
1865
+ } else if (codePoint > 0xFFFF) {
1866
+ // encode to utf16 (surrogate pair dance)
1867
+ codePoint -= 0x10000
1868
+ res.push(codePoint >>> 10 & 0x3FF | 0xD800)
1869
+ codePoint = 0xDC00 | codePoint & 0x3FF
1870
+ }
1871
+
1872
+ res.push(codePoint)
1873
+ i += bytesPerSequence
1874
  }
1875
+
1876
+ return decodeCodePointsArray(res)
1877
  }
1878
 
1879
+ // Based on http://stackoverflow.com/a/22747272/680742, the browser with
1880
+ // the lowest limit is Chrome, with 0x10000 args.
1881
+ // We go 1 magnitude less, for safety
1882
+ var MAX_ARGUMENTS_LENGTH = 0x1000
1883
+
1884
+ function decodeCodePointsArray (codePoints) {
1885
+ var len = codePoints.length
1886
+ if (len <= MAX_ARGUMENTS_LENGTH) {
1887
+ return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
1888
  }
1889
+
1890
+ // Decode in chunks to avoid "call stack size exceeded".
1891
+ var res = ''
1892
+ var i = 0
1893
+ while (i < len) {
1894
+ res += String.fromCharCode.apply(
1895
+ String,
1896
+ codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
1897
+ )
1898
  }
1899
+ return res
1900
  }
1901
 
1902
+ function asciiSlice (buf, start, end) {
1903
+ var ret = ''
1904
+ end = Math.min(buf.length, end)
 
 
 
 
 
1905
 
1906
+ for (var i = start; i < end; ++i) {
1907
+ ret += String.fromCharCode(buf[i] & 0x7F)
 
 
 
 
 
1908
  }
1909
+ return ret
1910
+ }
1911
 
1912
+ function latin1Slice (buf, start, end) {
1913
+ var ret = ''
1914
+ end = Math.min(buf.length, end)
1915
 
1916
+ for (var i = start; i < end; ++i) {
1917
+ ret += String.fromCharCode(buf[i])
 
 
1918
  }
1919
+ return ret
1920
+ }
1921
 
1922
+ function hexSlice (buf, start, end) {
1923
+ var len = buf.length
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1924
 
1925
+ if (!start || start < 0) start = 0
1926
+ if (!end || end < 0 || end > len) end = len
 
1927
 
1928
+ var out = ''
1929
+ for (var i = start; i < end; ++i) {
1930
+ out += toHex(buf[i])
 
1931
  }
1932
+ return out
1933
+ }
1934
 
1935
+ function utf16leSlice (buf, start, end) {
1936
+ var bytes = buf.slice(start, end)
1937
+ var res = ''
1938
+ for (var i = 0; i < bytes.length; i += 2) {
1939
+ res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
 
 
 
 
 
 
 
 
 
 
 
 
1940
  }
1941
+ return res
1942
+ }
1943
 
1944
+ Buffer.prototype.slice = function slice (start, end) {
1945
+ var len = this.length
1946
+ start = ~~start
1947
+ end = end === undefined ? len : ~~end
1948
 
1949
+ if (start < 0) {
1950
+ start += len
1951
+ if (start < 0) start = 0
1952
+ } else if (start > len) {
1953
+ start = len
1954
  }
1955
 
1956
+ if (end < 0) {
1957
+ end += len
1958
+ if (end < 0) end = 0
1959
+ } else if (end > len) {
1960
+ end = len
1961
+ }
1962
 
1963
+ if (end < start) end = start
1964
+
1965
+ var newBuf
1966
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
1967
+ newBuf = this.subarray(start, end)
1968
+ newBuf.__proto__ = Buffer.prototype
1969
+ } else {
1970
+ var sliceLen = end - start
1971
+ newBuf = new Buffer(sliceLen, undefined)
1972
+ for (var i = 0; i < sliceLen; ++i) {
1973
+ newBuf[i] = this[i + start]
1974
+ }
1975
  }
1976
 
1977
+ return newBuf
1978
+ }
1979
 
1980
+ /*
1981
+ * Need to make sure that buffer isn't trying to write out of bounds.
1982
+ */
1983
+ function checkOffset (offset, ext, length) {
1984
+ if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
1985
+ if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
1986
+ }
1987
 
1988
+ Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
1989
+ offset = offset | 0
1990
+ byteLength = byteLength | 0
1991
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
1992
+
1993
+ var val = this[offset]
1994
+ var mul = 1
1995
+ var i = 0
1996
+ while (++i < byteLength && (mul *= 0x100)) {
1997
+ val += this[offset + i] * mul
1998
  }
 
1999
 
2000
+ return val
 
2001
  }
2002
 
2003
+ Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
2004
+ offset = offset | 0
2005
+ byteLength = byteLength | 0
2006
+ if (!noAssert) {
2007
+ checkOffset(offset, byteLength, this.length)
 
 
 
 
 
2008
  }
2009
+
2010
+ var val = this[offset + --byteLength]
2011
+ var mul = 1
2012
+ while (byteLength > 0 && (mul *= 0x100)) {
2013
+ val += this[offset + --byteLength] * mul
2014
+ }
2015
+
2016
+ return val
2017
  }
2018
 
2019
+ Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
2020
+ if (!noAssert) checkOffset(offset, 1, this.length)
2021
+ return this[offset]
 
2022
  }
2023
 
2024
+ Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
2025
+ if (!noAssert) checkOffset(offset, 2, this.length)
2026
+ return this[offset] | (this[offset + 1] << 8)
 
 
 
 
 
 
 
 
2027
  }
2028
 
2029
+ Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
2030
+ if (!noAssert) checkOffset(offset, 2, this.length)
2031
+ return (this[offset] << 8) | this[offset + 1]
 
 
 
 
 
 
 
2032
  }
2033
 
2034
+ Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
2035
+ if (!noAssert) checkOffset(offset, 4, this.length)
 
 
 
 
 
2036
 
2037
+ return ((this[offset]) |
2038
+ (this[offset + 1] << 8) |
2039
+ (this[offset + 2] << 16)) +
2040
+ (this[offset + 3] * 0x1000000)
2041
+ }
2042
 
2043
+ Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
2044
+ if (!noAssert) checkOffset(offset, 4, this.length)
 
 
 
 
 
 
 
 
 
 
 
2045
 
2046
+ return (this[offset] * 0x1000000) +
2047
+ ((this[offset + 1] << 16) |
2048
+ (this[offset + 2] << 8) |
2049
+ this[offset + 3])
2050
+ }
2051
 
2052
+ Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
2053
+ offset = offset | 0
2054
+ byteLength = byteLength | 0
2055
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
2056
 
2057
+ var val = this[offset]
2058
+ var mul = 1
2059
+ var i = 0
2060
+ while (++i < byteLength && (mul *= 0x100)) {
2061
+ val += this[offset + i] * mul
 
 
 
 
2062
  }
2063
+ mul *= 0x80
2064
 
2065
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2066
 
2067
+ return val
2068
+ }
 
 
 
 
 
2069
 
2070
+ Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
2071
+ offset = offset | 0
2072
+ byteLength = byteLength | 0
2073
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2074
 
2075
+ var i = byteLength
2076
+ var mul = 1
2077
+ var val = this[offset + --i]
2078
+ while (i > 0 && (mul *= 0x100)) {
2079
+ val += this[offset + --i] * mul
 
 
2080
  }
2081
+ mul *= 0x80
2082
 
2083
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength)
 
2084
 
2085
+ return val
2086
+ }
 
 
 
 
 
 
 
 
 
 
2087
 
2088
+ Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
2089
+ if (!noAssert) checkOffset(offset, 1, this.length)
2090
+ if (!(this[offset] & 0x80)) return (this[offset])
2091
+ return ((0xff - this[offset] + 1) * -1)
2092
+ }
2093
 
2094
+ Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
2095
+ if (!noAssert) checkOffset(offset, 2, this.length)
2096
+ var val = this[offset] | (this[offset + 1] << 8)
2097
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
2098
+ }
2099
 
2100
+ Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
2101
+ if (!noAssert) checkOffset(offset, 2, this.length)
2102
+ var val = this[offset + 1] | (this[offset] << 8)
2103
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
2104
+ }
2105
 
2106
+ Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
2107
+ if (!noAssert) checkOffset(offset, 4, this.length)
2108
 
2109
+ return (this[offset]) |
2110
+ (this[offset + 1] << 8) |
2111
+ (this[offset + 2] << 16) |
2112
+ (this[offset + 3] << 24)
 
 
 
 
 
 
2113
  }
2114
 
2115
+ Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
2116
+ if (!noAssert) checkOffset(offset, 4, this.length)
 
2117
 
2118
+ return (this[offset] << 24) |
2119
+ (this[offset + 1] << 16) |
2120
+ (this[offset + 2] << 8) |
2121
+ (this[offset + 3])
2122
+ }
2123
 
2124
+ Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
2125
+ if (!noAssert) checkOffset(offset, 4, this.length)
2126
+ return ieee754.read(this, offset, true, 23, 4)
2127
+ }
2128
 
2129
+ Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
2130
+ if (!noAssert) checkOffset(offset, 4, this.length)
2131
+ return ieee754.read(this, offset, false, 23, 4)
2132
+ }
2133
 
2134
+ Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
2135
+ if (!noAssert) checkOffset(offset, 8, this.length)
2136
+ return ieee754.read(this, offset, true, 52, 8)
2137
+ }
 
 
 
2138
 
2139
+ Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
2140
+ if (!noAssert) checkOffset(offset, 8, this.length)
2141
+ return ieee754.read(this, offset, false, 52, 8)
2142
+ }
2143
 
2144
+ function checkInt (buf, value, offset, ext, max, min) {
2145
+ if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
2146
+ if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
2147
+ if (offset + ext > buf.length) throw new RangeError('Index out of range')
2148
+ }
 
 
2149
 
2150
+ Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
2151
+ value = +value
2152
+ offset = offset | 0
2153
+ byteLength = byteLength | 0
2154
+ if (!noAssert) {
2155
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1
2156
+ checkInt(this, value, offset, byteLength, maxBytes, 0)
2157
  }
2158
 
2159
+ var mul = 1
2160
+ var i = 0
2161
+ this[offset] = value & 0xFF
2162
+ while (++i < byteLength && (mul *= 0x100)) {
2163
+ this[offset + i] = (value / mul) & 0xFF
2164
+ }
 
 
 
 
 
 
2165
 
2166
+ return offset + byteLength
2167
+ }
 
 
2168
 
2169
+ Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
2170
+ value = +value
2171
+ offset = offset | 0
2172
+ byteLength = byteLength | 0
2173
+ if (!noAssert) {
2174
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1
2175
+ checkInt(this, value, offset, byteLength, maxBytes, 0)
 
 
 
 
 
 
 
2176
  }
2177
 
2178
+ var i = byteLength - 1
2179
+ var mul = 1
2180
+ this[offset + i] = value & 0xFF
2181
+ while (--i >= 0 && (mul *= 0x100)) {
2182
+ this[offset + i] = (value / mul) & 0xFF
2183
+ }
2184
 
2185
+ return offset + byteLength
 
 
2186
  }
2187
 
2188
+ Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
2189
+ value = +value
2190
+ offset = offset | 0
2191
+ if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
2192
+ if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
2193
+ this[offset] = (value & 0xff)
2194
+ return offset + 1
2195
+ }
 
 
 
2196
 
2197
+ function objectWriteUInt16 (buf, value, offset, littleEndian) {
2198
+ if (value < 0) value = 0xffff + value + 1
2199
+ for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
2200
+ buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
2201
+ (littleEndian ? i : 1 - i) * 8
2202
  }
2203
  }
2204
 
2205
+ Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
2206
+ value = +value
2207
+ offset = offset | 0
2208
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
2209
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
2210
+ this[offset] = (value & 0xff)
2211
+ this[offset + 1] = (value >>> 8)
2212
+ } else {
2213
+ objectWriteUInt16(this, value, offset, true)
2214
  }
2215
+ return offset + 2
 
 
 
 
 
2216
  }
2217
 
2218
+ Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
2219
+ value = +value
2220
+ offset = offset | 0
2221
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
2222
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
2223
+ this[offset] = (value >>> 8)
2224
+ this[offset + 1] = (value & 0xff)
2225
+ } else {
2226
+ objectWriteUInt16(this, value, offset, false)
2227
  }
2228
+ return offset + 2
 
 
 
 
 
 
2229
  }
2230
 
2231
+ function objectWriteUInt32 (buf, value, offset, littleEndian) {
2232
+ if (value < 0) value = 0xffffffff + value + 1
2233
+ for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
2234
+ buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
2235
+ }
2236
+ }
 
 
 
 
 
 
 
 
2237
 
2238
+ Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
2239
+ value = +value
2240
+ offset = offset | 0
2241
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
2242
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
2243
+ this[offset + 3] = (value >>> 24)
2244
+ this[offset + 2] = (value >>> 16)
2245
+ this[offset + 1] = (value >>> 8)
2246
+ this[offset] = (value & 0xff)
2247
+ } else {
2248
+ objectWriteUInt32(this, value, offset, true)
2249
+ }
2250
+ return offset + 4
2251
+ }
2252
 
2253
+ Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
2254
+ value = +value
2255
+ offset = offset | 0
2256
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
2257
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
2258
+ this[offset] = (value >>> 24)
2259
+ this[offset + 1] = (value >>> 16)
2260
+ this[offset + 2] = (value >>> 8)
2261
+ this[offset + 3] = (value & 0xff)
2262
+ } else {
2263
+ objectWriteUInt32(this, value, offset, false)
2264
+ }
2265
+ return offset + 4
2266
+ }
2267
 
2268
+ Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
2269
+ value = +value
2270
+ offset = offset | 0
2271
+ if (!noAssert) {
2272
+ var limit = Math.pow(2, 8 * byteLength - 1)
2273
 
2274
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
2275
+ }
 
 
 
 
2276
 
2277
+ var i = 0
2278
+ var mul = 1
2279
+ var sub = 0
2280
+ this[offset] = value & 0xFF
2281
+ while (++i < byteLength && (mul *= 0x100)) {
2282
+ if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
2283
+ sub = 1
 
 
2284
  }
2285
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
2286
  }
2287
 
2288
+ return offset + byteLength
2289
+ }
2290
+
2291
+ Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
2292
+ value = +value
2293
+ offset = offset | 0
2294
+ if (!noAssert) {
2295
+ var limit = Math.pow(2, 8 * byteLength - 1)
2296
+
2297
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
2298
  }
2299
 
2300
+ var i = byteLength - 1
2301
+ var mul = 1
2302
+ var sub = 0
2303
+ this[offset + i] = value & 0xFF
2304
+ while (--i >= 0 && (mul *= 0x100)) {
2305
+ if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
2306
+ sub = 1
2307
  }
2308
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
2309
+ }
 
 
2310
 
2311
+ return offset + byteLength
2312
+ }
2313
 
2314
+ Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
2315
+ value = +value
2316
+ offset = offset | 0
2317
+ if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
2318
+ if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
2319
+ if (value < 0) value = 0xff + value + 1
2320
+ this[offset] = (value & 0xff)
2321
+ return offset + 1
2322
+ }
2323
 
2324
+ Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
2325
+ value = +value
2326
+ offset = offset | 0
2327
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
2328
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
2329
+ this[offset] = (value & 0xff)
2330
+ this[offset + 1] = (value >>> 8)
2331
  } else {
2332
+ objectWriteUInt16(this, value, offset, true)
 
2333
  }
2334
+ return offset + 2
 
2335
  }
2336
 
2337
+ Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
2338
+ value = +value
2339
+ offset = offset | 0
2340
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
2341
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
2342
+ this[offset] = (value >>> 8)
2343
+ this[offset + 1] = (value & 0xff)
 
 
 
 
 
2344
  } else {
2345
+ objectWriteUInt16(this, value, offset, false)
 
2346
  }
2347
+ return offset + 2
2348
  }
2349
 
2350
+ Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
2351
+ value = +value
2352
+ offset = offset | 0
2353
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
2354
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
2355
+ this[offset] = (value & 0xff)
2356
+ this[offset + 1] = (value >>> 8)
2357
+ this[offset + 2] = (value >>> 16)
2358
+ this[offset + 3] = (value >>> 24)
2359
+ } else {
2360
+ objectWriteUInt32(this, value, offset, true)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2361
  }
2362
+ return offset + 4
 
2363
  }
2364
 
2365
+ Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
2366
+ value = +value
2367
+ offset = offset | 0
2368
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
2369
+ if (value < 0) value = 0xffffffff + value + 1
2370
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
2371
+ this[offset] = (value >>> 24)
2372
+ this[offset + 1] = (value >>> 16)
2373
+ this[offset + 2] = (value >>> 8)
2374
+ this[offset + 3] = (value & 0xff)
2375
+ } else {
2376
+ objectWriteUInt32(this, value, offset, false)
 
 
 
 
 
 
 
 
 
 
 
 
 
2377
  }
2378
+ return offset + 4
 
2379
  }
2380
 
2381
+ function checkIEEE754 (buf, value, offset, ext, max, min) {
2382
+ if (offset + ext > buf.length) throw new RangeError('Index out of range')
2383
+ if (offset < 0) throw new RangeError('Index out of range')
2384
+ }
 
 
2385
 
2386
+ function writeFloat (buf, value, offset, littleEndian, noAssert) {
2387
+ if (!noAssert) {
2388
+ checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
2389
  }
2390
+ ieee754.write(buf, value, offset, littleEndian, 23, 4)
2391
+ return offset + 4
2392
  }
2393
 
2394
+ Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
2395
+ return writeFloat(this, value, offset, true, noAssert)
 
 
 
 
 
2396
  }
2397
 
2398
+ Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
2399
+ return writeFloat(this, value, offset, false, noAssert)
 
 
2400
  }
2401
 
2402
+ function writeDouble (buf, value, offset, littleEndian, noAssert) {
2403
+ if (!noAssert) {
2404
+ checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
2405
  }
2406
+ ieee754.write(buf, value, offset, littleEndian, 52, 8)
2407
+ return offset + 8
2408
  }
 
 
 
 
 
 
2409
 
2410
+ Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
2411
+ return writeDouble(this, value, offset, true, noAssert)
2412
+ }
 
 
2413
 
2414
+ Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
2415
+ return writeDouble(this, value, offset, false, noAssert)
2416
+ }
2417
 
2418
+ // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
2419
+ Buffer.prototype.copy = function copy (target, targetStart, start, end) {
2420
+ if (!start) start = 0
2421
+ if (!end && end !== 0) end = this.length
2422
+ if (targetStart >= target.length) targetStart = target.length
2423
+ if (!targetStart) targetStart = 0
2424
+ if (end > 0 && end < start) end = start
2425
 
2426
+ // Copy 0 bytes; we're done
2427
+ if (end === start) return 0
2428
+ if (target.length === 0 || this.length === 0) return 0
2429
 
2430
+ // Fatal error conditions
2431
+ if (targetStart < 0) {
2432
+ throw new RangeError('targetStart out of bounds')
2433
+ }
2434
+ if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
2435
+ if (end < 0) throw new RangeError('sourceEnd out of bounds')
2436
 
2437
+ // Are we oob?
2438
+ if (end > this.length) end = this.length
2439
+ if (target.length - targetStart < end - start) {
2440
+ end = target.length - targetStart + start
2441
+ }
2442
 
2443
+ var len = end - start
2444
+ var i
2445
 
2446
+ if (this === target && start < targetStart && targetStart < end) {
2447
+ // descending copy from end
2448
+ for (i = len - 1; i >= 0; --i) {
2449
+ target[i + targetStart] = this[i + start]
2450
+ }
2451
+ } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
2452
+ // ascending copy from start
2453
+ for (i = 0; i < len; ++i) {
2454
+ target[i + targetStart] = this[i + start]
2455
+ }
2456
+ } else {
2457
+ Uint8Array.prototype.set.call(
2458
+ target,
2459
+ this.subarray(start, start + len),
2460
+ targetStart
2461
+ )
2462
+ }
2463
 
2464
+ return len
2465
+ }
2466
 
2467
+ // Usage:
2468
+ // buffer.fill(number[, offset[, end]])
2469
+ // buffer.fill(buffer[, offset[, end]])
2470
+ // buffer.fill(string[, offset[, end]][, encoding])
2471
+ Buffer.prototype.fill = function fill (val, start, end, encoding) {
2472
+ // Handle string cases:
2473
+ if (typeof val === 'string') {
2474
+ if (typeof start === 'string') {
2475
+ encoding = start
2476
+ start = 0
2477
+ end = this.length
2478
+ } else if (typeof end === 'string') {
2479
+ encoding = end
2480
+ end = this.length
2481
+ }
2482
+ if (val.length === 1) {
2483
+ var code = val.charCodeAt(0)
2484
+ if (code < 256) {
2485
+ val = code
2486
+ }
2487
+ }
2488
+ if (encoding !== undefined && typeof encoding !== 'string') {
2489
+ throw new TypeError('encoding must be a string')
2490
+ }
2491
+ if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
2492
+ throw new TypeError('Unknown encoding: ' + encoding)
2493
+ }
2494
+ } else if (typeof val === 'number') {
2495
+ val = val & 255
2496
+ }
2497
 
2498
+ // Invalid ranges are not set to a default, so can range check early.
2499
+ if (start < 0 || this.length < start || this.length < end) {
2500
+ throw new RangeError('Out of range index')
2501
+ }
2502
 
2503
+ if (end <= start) {
2504
+ return this
2505
+ }
2506
 
2507
+ start = start >>> 0
2508
+ end = end === undefined ? this.length : end >>> 0
 
2509
 
2510
+ if (!val) val = 0
 
2511
 
2512
+ var i
2513
+ if (typeof val === 'number') {
2514
+ for (i = start; i < end; ++i) {
2515
+ this[i] = val
2516
+ }
2517
+ } else {
2518
+ var bytes = Buffer.isBuffer(val)
2519
+ ? val
2520
+ : utf8ToBytes(new Buffer(val, encoding).toString())
2521
+ var len = bytes.length
2522
+ for (i = 0; i < end - start; ++i) {
2523
+ this[i + start] = bytes[i % len]
2524
  }
 
2525
  }
2526
 
2527
+ return this
2528
+ }
2529
 
2530
+ // HELPER FUNCTIONS
2531
+ // ================
 
2532
 
2533
+ var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
2534
+
2535
+ function base64clean (str) {
2536
+ // Node strips out invalid characters like \n and \t from the string, base64-js does not
2537
+ str = stringtrim(str).replace(INVALID_BASE64_RE, '')
2538
+ // Node converts strings with length < 2 to ''
2539
+ if (str.length < 2) return ''
2540
+ // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
2541
+ while (str.length % 4 !== 0) {
2542
+ str = str + '='
2543
  }
2544
+ return str
2545
+ }
2546
 
2547
+ function stringtrim (str) {
2548
+ if (str.trim) return str.trim()
2549
+ return str.replace(/^\s+|\s+$/g, '')
2550
+ }
2551
+
2552
+ function toHex (n) {
2553
+ if (n < 16) return '0' + n.toString(16)
2554
+ return n.toString(16)
2555
+ }
2556
+
2557
+ function utf8ToBytes (string, units) {
2558
+ units = units || Infinity
2559
+ var codePoint
2560
+ var length = string.length
2561
+ var leadSurrogate = null
2562
+ var bytes = []
2563
+
2564
+ for (var i = 0; i < length; ++i) {
2565
+ codePoint = string.charCodeAt(i)
2566
+
2567
+ // is surrogate component
2568
+ if (codePoint > 0xD7FF && codePoint < 0xE000) {
2569
+ // last char was a lead
2570
+ if (!leadSurrogate) {
2571
+ // no lead yet
2572
+ if (codePoint > 0xDBFF) {
2573
+ // unexpected trail
2574
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
2575
+ continue
2576
+ } else if (i + 1 === length) {
2577
+ // unpaired lead
2578
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
2579
+ continue
2580
+ }
2581
+
2582
+ // valid lead
2583
+ leadSurrogate = codePoint
2584
+
2585
+ continue
2586
  }
2587
+
2588
+ // 2 leads in a row
2589
+ if (codePoint < 0xDC00) {
2590
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
2591
+ leadSurrogate = codePoint
2592
+ continue
2593
+ }
2594
+
2595
+ // valid surrogate pair
2596
+ codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
2597
+ } else if (leadSurrogate) {
2598
+ // valid bmp char, but last char was a lead
2599
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
2600
  }
2601
+
2602
+ leadSurrogate = null
2603
+
2604
+ // encode utf8
2605
+ if (codePoint < 0x80) {
2606
+ if ((units -= 1) < 0) break
2607
+ bytes.push(codePoint)
2608
+ } else if (codePoint < 0x800) {
2609
+ if ((units -= 2) < 0) break
2610
+ bytes.push(
2611
+ codePoint >> 0x6 | 0xC0,
2612
+ codePoint & 0x3F | 0x80
2613
+ )
2614
+ } else if (codePoint < 0x10000) {
2615
+ if ((units -= 3) < 0) break
2616
+ bytes.push(
2617
+ codePoint >> 0xC | 0xE0,
2618
+ codePoint >> 0x6 & 0x3F | 0x80,
2619
+ codePoint & 0x3F | 0x80
2620
+ )
2621
+ } else if (codePoint < 0x110000) {
2622
+ if ((units -= 4) < 0) break
2623
+ bytes.push(
2624
+ codePoint >> 0x12 | 0xF0,
2625
+ codePoint >> 0xC & 0x3F | 0x80,
2626
+ codePoint >> 0x6 & 0x3F | 0x80,
2627
+ codePoint & 0x3F | 0x80
2628
+ )
2629
+ } else {
2630
+ throw new Error('Invalid code point')
2631
+ }
2632
+ }
2633
+
2634
+ return bytes
2635
  }
2636
 
2637
+ function asciiToBytes (str) {
2638
+ var byteArray = []
2639
+ for (var i = 0; i < str.length; ++i) {
2640
+ // Node's code seems to be doing this and not & 0x7F..
2641
+ byteArray.push(str.charCodeAt(i) & 0xFF)
 
2642
  }
2643
+ return byteArray
2644
+ }
2645
 
2646
+ function utf16leToBytes (str, units) {
2647
+ var c, hi, lo
2648
+ var byteArray = []
2649
+ for (var i = 0; i < str.length; ++i) {
2650
+ if ((units -= 2) < 0) break
2651
+
2652
+ c = str.charCodeAt(i)
2653
+ hi = c >> 8
2654
+ lo = c % 256
2655
+ byteArray.push(lo)
2656
+ byteArray.push(hi)
2657
  }
2658
+
2659
+ return byteArray
2660
  }
2661
 
2662
+ function base64ToBytes (str) {
2663
+ return base64.toByteArray(base64clean(str))
2664
  }
2665
 
2666
+ function blitBuffer (src, dst, offset, length) {
2667
+ for (var i = 0; i < length; ++i) {
2668
+ if ((i + offset >= dst.length) || (i >= src.length)) break
2669
+ dst[i + offset] = src[i]
2670
+ }
2671
+ return i
2672
+ }
2673
 
2674
+ function isnan (val) {
2675
+ return val !== val // eslint-disable-line no-self-compare
2676
+ }
2677
+
2678
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9)))
2679
 
2680
+ /***/ }),
2681
+ /* 90 */
2682
  /***/ (function(module, exports, __webpack_require__) {
2683
 
2684
  "use strict";
2685
+ /* WEBPACK VAR INJECTION */(function(process, setImmediate, global) {// Copyright Joyent, Inc. and other Node contributors.
2686
  //
2687
  // Permission is hereby granted, free of charge, to any person obtaining a
2688
  // copy of this software and associated documentation files (the
2703
  // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2704
  // USE OR OTHER DEALINGS IN THE SOFTWARE.
2705
 
2706
+ // A bit simpler than readable streams.
2707
+ // Implement an async ._write(chunk, encoding, cb), and it'll handle all
2708
+ // the drain event emission and buffering.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2709
 
 
2710
 
 
2711
 
2712
  /*<replacement>*/
 
 
 
2713
 
2714
+ var processNextTick = __webpack_require__(56);
2715
+ /*</replacement>*/
2716
 
2717
+ module.exports = Writable;
 
 
 
2718
 
2719
+ /* <replacement> */
2720
+ function WriteReq(chunk, encoding, cb) {
2721
+ this.chunk = chunk;
2722
+ this.encoding = encoding;
2723
+ this.callback = cb;
2724
+ this.next = null;
2725
  }
2726
 
2727
+ // It seems a linked list but it is not
2728
+ // there will be only 2 of these for each stream
2729
+ function CorkedRequest(state) {
2730
+ var _this = this;
2731
 
2732
+ this.next = null;
2733
+ this.entry = null;
2734
+ this.finish = function () {
2735
+ onCorkedFinish(_this, state);
2736
+ };
2737
+ }
2738
+ /* </replacement> */
2739
 
2740
+ /*<replacement>*/
2741
+ var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
2742
+ /*</replacement>*/
2743
 
2744
+ /*<replacement>*/
2745
+ var Duplex;
2746
+ /*</replacement>*/
2747
 
2748
+ Writable.WritableState = WritableState;
2749
 
2750
+ /*<replacement>*/
2751
+ var util = __webpack_require__(46);
2752
+ util.inherits = __webpack_require__(22);
2753
+ /*</replacement>*/
2754
 
2755
+ /*<replacement>*/
2756
+ var internalUtil = {
2757
+ deprecate: __webpack_require__(430)
2758
+ };
2759
+ /*</replacement>*/
 
2760
 
2761
+ /*<replacement>*/
2762
+ var Stream = __webpack_require__(266);
2763
+ /*</replacement>*/
2764
 
2765
+ /*<replacement>*/
2766
+ var Buffer = __webpack_require__(57).Buffer;
2767
+ var OurUint8Array = global.Uint8Array || function () {};
2768
+ function _uint8ArrayToBuffer(chunk) {
2769
+ return Buffer.from(chunk);
2770
+ }
2771
+ function _isUint8Array(obj) {
2772
+ return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
2773
+ }
2774
+ /*</replacement>*/
2775
 
2776
+ var destroyImpl = __webpack_require__(267);
2777
 
2778
+ util.inherits(Writable, Stream);
2779
 
2780
+ function nop() {}
 
2781
 
2782
+ function WritableState(options, stream) {
2783
+ Duplex = Duplex || __webpack_require__(32);
 
 
2784
 
2785
+ options = options || {};
 
2786
 
2787
+ // object stream flag to indicate whether or not this stream
2788
+ // contains buffers or objects.
2789
+ this.objectMode = !!options.objectMode;
2790
 
2791
+ if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
 
 
 
 
 
 
2792
 
2793
+ // the point at which write() starts returning false
2794
+ // Note: 0 is a valid value, means that we always return false if
2795
+ // the entire buffer is not flushed immediately on write()
2796
+ var hwm = options.highWaterMark;
2797
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
2798
+ this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
2799
 
2800
+ // cast to ints.
2801
+ this.highWaterMark = Math.floor(this.highWaterMark);
 
 
 
 
 
 
 
 
 
 
 
2802
 
2803
+ // if _final has been called
2804
+ this.finalCalled = false;
 
 
 
 
 
 
 
 
2805
 
2806
+ // drain event flag.
2807
+ this.needDrain = false;
2808
+ // at the start of calling end()
2809
+ this.ending = false;
2810
+ // when end() has been called, and returned
2811
+ this.ended = false;
2812
+ // when 'finish' is emitted
2813
+ this.finished = false;
2814
 
2815
+ // has it been destroyed
2816
+ this.destroyed = false;
 
 
 
 
 
 
 
2817
 
2818
+ // should we decode strings into buffers before passing to _write?
2819
+ // this is here so that some node-core streams can optimize string
2820
+ // handling at a lower level.
2821
+ var noDecode = options.decodeStrings === false;
2822
+ this.decodeStrings = !noDecode;
2823
 
2824
+ // Crypto is kind of old and crusty. Historically, its default string
2825
+ // encoding is 'binary' so we have to make this configurable.
2826
+ // Everything else in the universe uses 'utf8', though.
2827
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
 
2828
 
2829
+ // not an actual buffer we keep track of, but a measurement
2830
+ // of how much we're waiting to get pushed to some underlying
2831
+ // socket or file.
2832
+ this.length = 0;
2833
 
2834
+ // a flag to see when we're in the middle of a write.
2835
+ this.writing = false;
2836
 
2837
+ // when true all writes will be buffered until .uncork() call
2838
+ this.corked = 0;
 
 
2839
 
2840
+ // a flag to be able to tell if the onwrite cb is called immediately,
2841
+ // or on a later tick. We set this to true at first, because any
2842
+ // actions that shouldn't happen until "later" should generally also
2843
+ // not happen before the first write call.
2844
+ this.sync = true;
2845
 
2846
+ // a flag to know if we're processing previously buffered items, which
2847
+ // may call the _write() callback in the same tick, so that we don't
2848
+ // end up in an overlapped onwrite situation.
2849
+ this.bufferProcessing = false;
2850
 
2851
+ // the callback that's passed to _write(chunk,cb)
2852
+ this.onwrite = function (er) {
2853
+ onwrite(stream, er);
2854
+ };
2855
 
2856
+ // the callback that the user supplies to write(chunk,encoding,cb)
2857
+ this.writecb = null;
2858
 
2859
+ // the amount that is being written when _write is called.
2860
+ this.writelen = 0;
2861
 
2862
+ this.bufferedRequest = null;
2863
+ this.lastBufferedRequest = null;
2864
 
2865
+ // number of pending user-supplied write callbacks
2866
+ // this must be 0 before 'finish' can be emitted
2867
+ this.pendingcb = 0;
2868
 
2869
+ // emit prefinish if the only thing we're waiting for is _write cbs
2870
+ // This is relevant for synchronous Transform streams
2871
+ this.prefinished = false;
 
2872
 
2873
+ // True if the error was already emitted and should not be thrown again
2874
+ this.errorEmitted = false;
2875
 
2876
+ // count buffered requests
2877
+ this.bufferedRequestCount = 0;
2878
 
2879
+ // allocate the first CorkedRequest, there is always
2880
+ // one allocated and free to use, and we maintain at most two
2881
+ this.corkedRequestsFree = new CorkedRequest(this);
2882
+ }
2883
 
2884
+ WritableState.prototype.getBuffer = function getBuffer() {
2885
+ var current = this.bufferedRequest;
2886
+ var out = [];
2887
+ while (current) {
2888
+ out.push(current);
2889
+ current = current.next;
2890
+ }
2891
+ return out;
 
2892
  };
2893
 
2894
+ (function () {
2895
+ try {
2896
+ Object.defineProperty(WritableState.prototype, 'buffer', {
2897
+ get: internalUtil.deprecate(function () {
2898
+ return this.getBuffer();
2899
+ }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
2900
+ });
2901
+ } catch (_) {}
2902
+ })();
 
 
2903
 
2904
+ // Test _writableState for inheritance to account for Duplex streams,
2905
+ // whose prototype chain only points to Readable.
2906
+ var realHasInstance;
2907
+ if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
2908
+ realHasInstance = Function.prototype[Symbol.hasInstance];
2909
+ Object.defineProperty(Writable, Symbol.hasInstance, {
2910
+ value: function (object) {
2911
+ if (realHasInstance.call(this, object)) return true;
2912
 
2913
+ return object && object._writableState instanceof WritableState;
2914
+ }
2915
  });
2916
+ } else {
2917
+ realHasInstance = function (object) {
2918
+ return object instanceof this;
2919
+ };
2920
  }
2921
 
2922
+ function Writable(options) {
2923
+ Duplex = Duplex || __webpack_require__(32);
 
 
2924
 
2925
+ // Writable ctor is applied to Duplexes, too.
2926
+ // `realHasInstance` is necessary because using plain `instanceof`
2927
+ // would return false, as no `_writableState` property is attached.
2928
 
2929
+ // Trying to use the custom `instanceof` for Writable here will also break the
2930
+ // Node.js LazyTransform implementation, which has a non-trivial getter for
2931
+ // `_writableState` that would lead to infinite recursion.
2932
+ if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
2933
+ return new Writable(options);
2934
+ }
2935
 
2936
+ this._writableState = new WritableState(options, this);
 
 
2937
 
2938
+ // legacy.
2939
+ this.writable = true;
2940
 
2941
+ if (options) {
2942
+ if (typeof options.write === 'function') this._write = options.write;
2943
 
2944
+ if (typeof options.writev === 'function') this._writev = options.writev;
2945
 
2946
+ if (typeof options.destroy === 'function') this._destroy = options.destroy;
2947
 
2948
+ if (typeof options.final === 'function') this._final = options.final;
2949
+ }
2950
 
2951
+ Stream.call(this);
2952
+ }
2953
 
2954
+ // Otherwise people can pipe Writable streams, which is just wrong.
2955
+ Writable.prototype.pipe = function () {
2956
+ this.emit('error', new Error('Cannot pipe, not readable'));
2957
+ };
2958
 
2959
+ function writeAfterEnd(stream, cb) {
2960
+ var er = new Error('write after end');
2961
+ // TODO: defer error events consistently everywhere, not just the cb
2962
+ stream.emit('error', er);
2963
+ processNextTick(cb, er);
2964
+ }
 
2965
 
2966
+ // Checks that a user-supplied chunk is valid, especially for the particular
2967
+ // mode the stream is in. Currently this means that `null` is never accepted
2968
+ // and undefined/non-string values are only allowed in object mode.
2969
+ function validChunk(stream, state, chunk, cb) {
2970
+ var valid = true;
2971
+ var er = false;
2972
 
2973
+ if (chunk === null) {
2974
+ er = new TypeError('May not write null values to stream');
2975
+ } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
2976
+ er = new TypeError('Invalid non-string/buffer chunk');
2977
  }
2978
+ if (er) {
2979
+ stream.emit('error', er);
2980
+ processNextTick(cb, er);
2981
+ valid = false;
2982
+ }
2983
+ return valid;
2984
  }
2985
 
2986
+ Writable.prototype.write = function (chunk, encoding, cb) {
2987
+ var state = this._writableState;
2988
+ var ret = false;
2989
+ var isBuf = _isUint8Array(chunk) && !state.objectMode;
2990
 
2991
+ if (isBuf && !Buffer.isBuffer(chunk)) {
2992
+ chunk = _uint8ArrayToBuffer(chunk);
2993
+ }
2994
 
2995
+ if (typeof encoding === 'function') {
2996
+ cb = encoding;
2997
+ encoding = null;
2998
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2999
 
3000
+ if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
 
 
 
3001
 
3002
+ if (typeof cb !== 'function') cb = nop;
3003
 
3004
+ if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
3005
+ state.pendingcb++;
3006
+ ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
3007
+ }
3008
 
3009
+ return ret;
3010
+ };
3011
 
3012
+ Writable.prototype.cork = function () {
3013
+ var state = this._writableState;
3014
 
3015
+ state.corked++;
 
 
 
 
 
3016
  };
 
3017
 
3018
+ Writable.prototype.uncork = function () {
3019
+ var state = this._writableState;
3020
 
3021
+ if (state.corked) {
3022
+ state.corked--;
 
 
3023
 
3024
+ if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
3025
+ }
3026
+ };
3027
 
3028
+ Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
3029
+ // node::ParseEncoding() requires lower case.
3030
+ if (typeof encoding === 'string') encoding = encoding.toLowerCase();
3031
+ if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
3032
+ this._writableState.defaultEncoding = encoding;
3033
+ return this;
3034
+ };
3035
 
3036
+ function decodeChunk(state, chunk, encoding) {
3037
+ if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
3038
+ chunk = Buffer.from(chunk, encoding);
3039
+ }
3040
+ return chunk;
3041
  }
3042
 
3043
+ // if we're already writing something, then just put this
3044
+ // in the queue, and wait our turn. Otherwise, call _write
3045
+ // If we return false, then we need a drain event, so set that flag.
3046
+ function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
3047
+ if (!isBuf) {
3048
+ var newChunk = decodeChunk(state, chunk, encoding);
3049
+ if (chunk !== newChunk) {
3050
+ isBuf = true;
3051
+ encoding = 'buffer';
3052
+ chunk = newChunk;
3053
+ }
3054
+ }
3055
+ var len = state.objectMode ? 1 : chunk.length;
3056
 
3057
+ state.length += len;
3058
 
3059
+ var ret = state.length < state.highWaterMark;
3060
+ // we must ensure that previous needDrain will not be reset to false.
3061
+ if (!ret) state.needDrain = true;
3062
 
3063
+ if (state.writing || state.corked) {
3064
+ var last = state.lastBufferedRequest;
3065
+ state.lastBufferedRequest = {
3066
+ chunk: chunk,
3067
+ encoding: encoding,
3068
+ isBuf: isBuf,
3069
+ callback: cb,
3070
+ next: null
3071
+ };
3072
+ if (last) {
3073
+ last.next = state.lastBufferedRequest;
3074
+ } else {
3075
+ state.bufferedRequest = state.lastBufferedRequest;
3076
+ }
3077
+ state.bufferedRequestCount += 1;
3078
+ } else {
3079
+ doWrite(stream, state, false, len, chunk, encoding, cb);
3080
+ }
3081
 
3082
+ return ret;
3083
  }
3084
 
3085
+ function doWrite(stream, state, writev, len, chunk, encoding, cb) {
3086
+ state.writelen = len;
3087
+ state.writecb = cb;
3088
+ state.writing = true;
3089
+ state.sync = true;
3090
+ if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
3091
+ state.sync = false;
 
 
3092
  }
3093
 
3094
+ function onwriteError(stream, state, sync, er, cb) {
3095
+ --state.pendingcb;
3096
+
3097
+ if (sync) {
3098
+ // defer the callback if we are being called synchronously
3099
+ // to avoid piling up things on the stack
3100
+ processNextTick(cb, er);
3101
+ // this can emit finish, and it will always happen
3102
+ // after error
3103
+ processNextTick(finishMaybe, stream, state);
3104
+ stream._writableState.errorEmitted = true;
3105
+ stream.emit('error', er);
3106
+ } else {
3107
+ // the caller expect this to happen before if
3108
+ // it is async
3109
+ cb(er);
3110
+ stream._writableState.errorEmitted = true;
3111
+ stream.emit('error', er);
3112
+ // this can emit finish, but finish must
3113
+ // always follow error
3114
+ finishMaybe(stream, state);
3115
+ }
3116
  }
3117
 
3118
+ function onwriteStateUpdate(state) {
3119
+ state.writing = false;
3120
+ state.writecb = null;
3121
+ state.length -= state.writelen;
3122
+ state.writelen = 0;
3123
+ }
 
 
 
 
 
 
 
3124
 
3125
+ function onwrite(stream, er) {
3126
+ var state = stream._writableState;
3127
+ var sync = state.sync;
3128
+ var cb = state.writecb;
 
 
3129
 
3130
+ onwriteStateUpdate(state);
 
 
3131
 
3132
+ if (er) onwriteError(stream, state, sync, er, cb);else {
3133
+ // Check if we're actually ready to finish, but don't emit yet
3134
+ var finished = needFinish(state);
3135
 
3136
+ if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
3137
+ clearBuffer(stream, state);
3138
+ }
3139
+
3140
+ if (sync) {
3141
+ /*<replacement>*/
3142
+ asyncWrite(afterWrite, stream, state, finished, cb);
3143
+ /*</replacement>*/
3144
+ } else {
3145
+ afterWrite(stream, state, finished, cb);
3146
+ }
3147
  }
3148
  }
3149
 
3150
+ function afterWrite(stream, state, finished, cb) {
3151
+ if (!finished) onwriteDrain(stream, state);
3152
+ state.pendingcb--;
3153
+ cb();
3154
+ finishMaybe(stream, state);
 
 
 
 
 
 
 
3155
  }
3156
 
3157
+ // Must force callback to be called on nextTick, so that we don't
3158
+ // emit 'drain' before the write() consumer gets the 'false' return
3159
+ // value, and has a chance to attach a 'drain' listener.
3160
+ function onwriteDrain(stream, state) {
3161
+ if (state.length === 0 && state.needDrain) {
3162
+ state.needDrain = false;
3163
+ stream.emit('drain');
3164
+ }
3165
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3166
 
3167
+ // if there's something in the buffer waiting, then process it
3168
+ function clearBuffer(stream, state) {
3169
+ state.bufferProcessing = true;
3170
+ var entry = state.bufferedRequest;
3171
 
3172
+ if (stream._writev && entry && entry.next) {
3173
+ // Fast case, write everything using _writev()
3174
+ var l = state.bufferedRequestCount;
3175
+ var buffer = new Array(l);
3176
+ var holder = state.corkedRequestsFree;
3177
+ holder.entry = entry;
3178
 
3179
+ var count = 0;
3180
+ var allBuffers = true;
3181
+ while (entry) {
3182
+ buffer[count] = entry;
3183
+ if (!entry.isBuf) allBuffers = false;
3184
+ entry = entry.next;
3185
+ count += 1;
3186
+ }
3187
+ buffer.allBuffers = allBuffers;
3188
 
3189
+ doWrite(stream, state, true, state.length, buffer, '', holder.finish);
3190
 
3191
+ // doWrite is almost always async, defer these to save a bit of time
3192
+ // as the hot path ends with doWrite
3193
+ state.pendingcb++;
3194
+ state.lastBufferedRequest = null;
3195
+ if (holder.next) {
3196
+ state.corkedRequestsFree = holder.next;
3197
+ holder.next = null;
3198
+ } else {
3199
+ state.corkedRequestsFree = new CorkedRequest(state);
3200
+ }
3201
+ } else {
3202
+ // Slow case, write chunks one-by-one
3203
+ while (entry) {
3204
+ var chunk = entry.chunk;
3205
+ var encoding = entry.encoding;
3206
+ var cb = entry.callback;
3207
+ var len = state.objectMode ? 1 : chunk.length;
3208
 
3209
+ doWrite(stream, state, false, len, chunk, encoding, cb);
3210
+ entry = entry.next;
3211
+ // if we didn't call the onwrite immediately, then
3212
+ // it means that we need to wait until it does.
3213
+ // also, that means that the chunk and cb are currently
3214
+ // being processed, so move the buffer counter past them.
3215
+ if (state.writing) {
3216
+ break;
3217
+ }
3218
+ }
3219
 
3220
+ if (entry === null) state.lastBufferedRequest = null;
3221
+ }
3222
 
3223
+ state.bufferedRequestCount = 0;
3224
+ state.bufferedRequest = entry;
3225
+ state.bufferProcessing = false;
3226
+ }
3227
 
3228
+ Writable.prototype._write = function (chunk, encoding, cb) {
3229
+ cb(new Error('_write() is not implemented'));
3230
+ };
3231
 
3232
+ Writable.prototype._writev = null;
 
 
 
3233
 
3234
+ Writable.prototype.end = function (chunk, encoding, cb) {
3235
+ var state = this._writableState;
3236
 
3237
+ if (typeof chunk === 'function') {
3238
+ cb = chunk;
3239
+ chunk = null;
3240
+ encoding = null;
3241
+ } else if (typeof encoding === 'function') {
3242
+ cb = encoding;
3243
+ encoding = null;
3244
+ }
3245
 
3246
+ if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
3247
 
3248
+ // .end() fully uncorks
3249
+ if (state.corked) {
3250
+ state.corked = 1;
3251
+ this.uncork();
3252
+ }
3253
 
3254
+ // ignore unnecessary end() calls.
3255
+ if (!state.ending && !state.finished) endWritable(this, state, cb);
3256
+ };
3257
 
3258
+ function needFinish(state) {
3259
+ return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
3260
+ }
3261
+ function callFinal(stream, state) {
3262
+ stream._final(function (err) {
3263
+ state.pendingcb--;
3264
+ if (err) {
3265
+ stream.emit('error', err);
3266
+ }
3267
+ state.prefinished = true;
3268
+ stream.emit('prefinish');
3269
+ finishMaybe(stream, state);
3270
+ });
3271
+ }
3272
+ function prefinish(stream, state) {
3273
+ if (!state.prefinished && !state.finalCalled) {
3274
+ if (typeof stream._final === 'function') {
3275
+ state.pendingcb++;
3276
+ state.finalCalled = true;
3277
+ processNextTick(callFinal, stream, state);
3278
+ } else {
3279
+ state.prefinished = true;
3280
+ stream.emit('prefinish');
3281
+ }
3282
+ }
3283
  }
3284
 
3285
+ function finishMaybe(stream, state) {
3286
+ var need = needFinish(state);
3287
+ if (need) {
3288
+ prefinish(stream, state);
3289
+ if (state.pendingcb === 0) {
3290
+ state.finished = true;
3291
+ stream.emit('finish');
3292
+ }
3293
+ }
3294
+ return need;
3295
+ }
 
 
3296
 
3297
+ function endWritable(stream, state, cb) {
3298
+ state.ending = true;
3299
+ finishMaybe(stream, state);
3300
+ if (cb) {
3301
+ if (state.finished) processNextTick(cb);else stream.once('finish', cb);
3302
+ }
3303
+ state.ended = true;
3304
+ stream.writable = false;
3305
+ }
3306
 
3307
+ function onCorkedFinish(corkReq, state, err) {
3308
+ var entry = corkReq.entry;
3309
+ corkReq.entry = null;
3310
+ while (entry) {
3311
+ var cb = entry.callback;
3312
+ state.pendingcb--;
3313
+ cb(err);
3314
+ entry = entry.next;
3315
+ }
3316
+ if (state.corkedRequestsFree) {
3317
+ state.corkedRequestsFree.next = corkReq;
3318
+ } else {
3319
+ state.corkedRequestsFree = corkReq;
3320
+ }
 
 
3321
  }
3322
 
3323
+ Object.defineProperty(Writable.prototype, 'destroyed', {
3324
+ get: function () {
3325
+ if (this._writableState === undefined) {
3326
+ return false;
3327
+ }
3328
+ return this._writableState.destroyed;
3329
+ },
3330
+ set: function (value) {
3331
+ // we ignore the value if the stream
3332
+ // has not been initialized yet
3333
+ if (!this._writableState) {
3334
+ return;
3335
+ }
3336
 
3337
+ // backward compatibility, the user is explicitly
3338
+ // managing destroyed
3339
+ this._writableState.destroyed = value;
3340
+ }
3341
+ });
3342
 
3343
+ Writable.prototype.destroy = destroyImpl.destroy;
3344
+ Writable.prototype._undestroy = destroyImpl.undestroy;
3345
+ Writable.prototype._destroy = function (err, cb) {
3346
+ this.end();
3347
+ cb(err);
3348
  };
3349
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(268).setImmediate, __webpack_require__(9)))
3350
 
3351
+ /***/ }),
3352
+ /* 91 */
3353
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
3354
 
3355
+ "use strict";
 
 
 
 
 
 
 
3356
 
 
 
 
 
3357
 
3358
+ var Buffer = __webpack_require__(57).Buffer;
 
 
3359
 
3360
+ var isEncoding = Buffer.isEncoding || function (encoding) {
3361
+ encoding = '' + encoding;
3362
+ switch (encoding && encoding.toLowerCase()) {
3363
+ case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
3364
+ return true;
3365
+ default:
3366
+ return false;
3367
+ }
3368
  };
3369
 
3370
+ function _normalizeEncoding(enc) {
3371
+ if (!enc) return 'utf8';
3372
+ var retried;
3373
+ while (true) {
3374
+ switch (enc) {
3375
+ case 'utf8':
3376
+ case 'utf-8':
3377
+ return 'utf8';
3378
+ case 'ucs2':
3379
+ case 'ucs-2':
3380
+ case 'utf16le':
3381
+ case 'utf-16le':
3382
+ return 'utf16le';
3383
+ case 'latin1':
3384
+ case 'binary':
3385
+ return 'latin1';
3386
+ case 'base64':
3387
+ case 'ascii':
3388
+ case 'hex':
3389
+ return enc;
3390
+ default:
3391
+ if (retried) return; // undefined
3392
+ enc = ('' + enc).toLowerCase();
3393
+ retried = true;
3394
+ }
3395
+ }
3396
+ };
3397
 
3398
+ // Do not cache `Buffer.isEncoding` when checking encoding names as some
3399
+ // modules monkey-patch it to support additional encodings
3400
+ function normalizeEncoding(enc) {
3401
+ var nenc = _normalizeEncoding(enc);
3402
+ if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
3403
+ return nenc || enc;
3404
+ }
3405
 
3406
+ // StringDecoder provides an interface for efficiently splitting a series of
3407
+ // buffers into a series of JS strings without breaking apart multi-byte
3408
+ // characters.
3409
+ exports.StringDecoder = StringDecoder;
3410
+ function StringDecoder(encoding) {
3411
+ this.encoding = normalizeEncoding(encoding);
3412
+ var nb;
3413
+ switch (this.encoding) {
3414
+ case 'utf16le':
3415
+ this.text = utf16Text;
3416
+ this.end = utf16End;
3417
+ nb = 4;
3418
+ break;
3419
+ case 'utf8':
3420
+ this.fillLast = utf8FillLast;
3421
+ nb = 4;
3422
+ break;
3423
+ case 'base64':
3424
+ this.text = base64Text;
3425
+ this.end = base64End;
3426
+ nb = 3;
3427
+ break;
3428
+ default:
3429
+ this.write = simpleWrite;
3430
+ this.end = simpleEnd;
3431
+ return;
3432
+ }
3433
+ this.lastNeed = 0;
3434
+ this.lastTotal = 0;
3435
+ this.lastChar = Buffer.allocUnsafe(nb);
3436
+ }
3437
 
3438
+ StringDecoder.prototype.write = function (buf) {
3439
+ if (buf.length === 0) return '';
3440
+ var r;
3441
+ var i;
3442
+ if (this.lastNeed) {
3443
+ r = this.fillLast(buf);
3444
+ if (r === undefined) return '';
3445
+ i = this.lastNeed;
3446
+ this.lastNeed = 0;
3447
+ } else {
3448
+ i = 0;
3449
+ }
3450
+ if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
3451
+ return r || '';
3452
  };
3453
 
3454
+ StringDecoder.prototype.end = utf8End;
 
 
 
3455
 
3456
+ // Returns only complete characters in a Buffer
3457
+ StringDecoder.prototype.text = utf8Text;
3458
 
3459
+ // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
3460
+ StringDecoder.prototype.fillLast = function (buf) {
3461
+ if (this.lastNeed <= buf.length) {
3462
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
3463
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
3464
+ }
3465
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
3466
+ this.lastNeed -= buf.length;
 
 
 
 
 
 
 
 
3467
  };
3468
 
3469
+ // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
3470
+ // continuation byte.
3471
+ function utf8CheckByte(byte) {
3472
+ if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
3473
+ return -1;
3474
+ }
 
3475
 
3476
+ // Checks at most 3 bytes at the end of a Buffer in order to detect an
3477
+ // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
3478
+ // needed to complete the UTF-8 character (if applicable) are returned.
3479
+ function utf8CheckIncomplete(self, buf, i) {
3480
+ var j = buf.length - 1;
3481
+ if (j < i) return 0;
3482
+ var nb = utf8CheckByte(buf[j]);
3483
+ if (nb >= 0) {
3484
+ if (nb > 0) self.lastNeed = nb - 1;
3485
+ return nb;
3486
+ }
3487
+ if (--j < i) return 0;
3488
+ nb = utf8CheckByte(buf[j]);
3489
+ if (nb >= 0) {
3490
+ if (nb > 0) self.lastNeed = nb - 2;
3491
+ return nb;
3492
+ }
3493
+ if (--j < i) return 0;
3494
+ nb = utf8CheckByte(buf[j]);
3495
+ if (nb >= 0) {
3496
+ if (nb > 0) {
3497
+ if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
3498
+ }
3499
+ return nb;
3500
+ }
3501
+ return 0;
3502
+ }
3503
 
3504
+ // Validates as many continuation bytes for a multi-byte UTF-8 character as
3505
+ // needed or are available. If we see a non-continuation byte where we expect
3506
+ // one, we "replace" the validated continuation bytes we've seen so far with
3507
+ // UTF-8 replacement characters ('\ufffd'), to match v8's UTF-8 decoding
3508
+ // behavior. The continuation byte check is included three times in the case
3509
+ // where all of the continuation bytes for a character exist in the same buffer.
3510
+ // It is also done this way as a slight performance increase instead of using a
3511
+ // loop.
3512
+ function utf8CheckExtraBytes(self, buf, p) {
3513
+ if ((buf[0] & 0xC0) !== 0x80) {
3514
+ self.lastNeed = 0;
3515
+ return '\ufffd'.repeat(p);
3516
+ }
3517
+ if (self.lastNeed > 1 && buf.length > 1) {
3518
+ if ((buf[1] & 0xC0) !== 0x80) {
3519
+ self.lastNeed = 1;
3520
+ return '\ufffd'.repeat(p + 1);
3521
+ }
3522
+ if (self.lastNeed > 2 && buf.length > 2) {
3523
+ if ((buf[2] & 0xC0) !== 0x80) {
3524
+ self.lastNeed = 2;
3525
+ return '\ufffd'.repeat(p + 2);
3526
+ }
3527
+ }
3528
+ }
3529
+ }
3530
 
3531
+ // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
3532
+ function utf8FillLast(buf) {
3533
+ var p = this.lastTotal - this.lastNeed;
3534
+ var r = utf8CheckExtraBytes(this, buf, p);
3535
+ if (r !== undefined) return r;
3536
+ if (this.lastNeed <= buf.length) {
3537
+ buf.copy(this.lastChar, p, 0, this.lastNeed);
3538
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
3539
+ }
3540
+ buf.copy(this.lastChar, p, 0, buf.length);
3541
+ this.lastNeed -= buf.length;
3542
+ }
3543
 
3544
+ // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
3545
+ // partial character, the character's bytes are buffered until the required
3546
+ // number of bytes are available.
3547
+ function utf8Text(buf, i) {
3548
+ var total = utf8CheckIncomplete(this, buf, i);
3549
+ if (!this.lastNeed) return buf.toString('utf8', i);
3550
+ this.lastTotal = total;
3551
+ var end = buf.length - (total - this.lastNeed);
3552
+ buf.copy(this.lastChar, 0, end);
3553
+ return buf.toString('utf8', i, end);
3554
+ }
3555
 
3556
+ // For UTF-8, a replacement character for each buffered byte of a (partial)
3557
+ // character needs to be added to the output.
3558
+ function utf8End(buf) {
3559
+ var r = buf && buf.length ? this.write(buf) : '';
3560
+ if (this.lastNeed) return r + '\ufffd'.repeat(this.lastTotal - this.lastNeed);
3561
+ return r;
3562
+ }
3563
 
3564
+ // UTF-16LE typically needs two bytes per character, but even if we have an even
3565
+ // number of bytes available, we need to check if we end on a leading/high
3566
+ // surrogate. In that case, we need to wait for the next two bytes in order to
3567
+ // decode the last character properly.
3568
+ function utf16Text(buf, i) {
3569
+ if ((buf.length - i) % 2 === 0) {
3570
+ var r = buf.toString('utf16le', i);
3571
+ if (r) {
3572
+ var c = r.charCodeAt(r.length - 1);
3573
+ if (c >= 0xD800 && c <= 0xDBFF) {
3574
+ this.lastNeed = 2;
3575
+ this.lastTotal = 4;
3576
+ this.lastChar[0] = buf[buf.length - 2];
3577
+ this.lastChar[1] = buf[buf.length - 1];
3578
+ return r.slice(0, -1);
3579
+ }
3580
+ }
3581
+ return r;
3582
+ }
3583
+ this.lastNeed = 1;
3584
+ this.lastTotal = 2;
3585
+ this.lastChar[0] = buf[buf.length - 1];
3586
+ return buf.toString('utf16le', i, buf.length - 1);
3587
+ }
3588
 
3589
+ // For UTF-16LE we do not explicitly append special replacement characters if we
3590
+ // end on a partial character, we simply let v8 handle that.
3591
+ function utf16End(buf) {
3592
+ var r = buf && buf.length ? this.write(buf) : '';
3593
+ if (this.lastNeed) {
3594
+ var end = this.lastTotal - this.lastNeed;
3595
+ return r + this.lastChar.toString('utf16le', 0, end);
3596
+ }
3597
+ return r;
3598
+ }
3599
 
3600
+ function base64Text(buf, i) {
3601
+ var n = (buf.length - i) % 3;
3602
+ if (n === 0) return buf.toString('base64', i);
3603
+ this.lastNeed = 3 - n;
3604
+ this.lastTotal = 3;
3605
+ if (n === 1) {
3606
+ this.lastChar[0] = buf[buf.length - 1];
3607
+ } else {
3608
+ this.lastChar[0] = buf[buf.length - 2];
3609
+ this.lastChar[1] = buf[buf.length - 1];
3610
+ }
3611
+ return buf.toString('base64', i, buf.length - n);
3612
+ }
3613
 
3614
+ function base64End(buf) {
3615
+ var r = buf && buf.length ? this.write(buf) : '';
3616
+ if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
3617
+ return r;
3618
+ }
3619
 
3620
+ // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
3621
+ function simpleWrite(buf) {
3622
+ return buf.toString(this.encoding);
3623
+ }
3624
 
3625
+ function simpleEnd(buf) {
3626
+ return buf && buf.length ? this.write(buf) : '';
3627
+ }
 
3628
 
3629
+ /***/ }),
3630
+ /* 92 */,
3631
+ /* 93 */,
3632
+ /* 94 */,
3633
+ /* 95 */,
3634
+ /* 96 */,
3635
+ /* 97 */,
3636
+ /* 98 */,
3637
+ /* 99 */,
3638
+ /* 100 */,
3639
+ /* 101 */,
3640
+ /* 102 */,
3641
+ /* 103 */,
3642
+ /* 104 */,
3643
+ /* 105 */,
3644
+ /* 106 */,
3645
+ /* 107 */,
3646
+ /* 108 */,
3647
+ /* 109 */,
3648
+ /* 110 */,
3649
+ /* 111 */,
3650
+ /* 112 */,
3651
+ /* 113 */,
3652
+ /* 114 */,
3653
+ /* 115 */,
3654
+ /* 116 */,
3655
+ /* 117 */,
3656
+ /* 118 */,
3657
+ /* 119 */,
3658
+ /* 120 */,
3659
+ /* 121 */,
3660
+ /* 122 */,
3661
+ /* 123 */,
3662
+ /* 124 */,
3663
+ /* 125 */,
3664
+ /* 126 */,
3665
+ /* 127 */,
3666
+ /* 128 */,
3667
+ /* 129 */,
3668
+ /* 130 */,
3669
+ /* 131 */,
3670
+ /* 132 */,
3671
+ /* 133 */,
3672
+ /* 134 */,
3673
+ /* 135 */,
3674
+ /* 136 */,
3675
+ /* 137 */,
3676
+ /* 138 */,
3677
+ /* 139 */,
3678
+ /* 140 */,
3679
+ /* 141 */,
3680
+ /* 142 */,
3681
+ /* 143 */,
3682
+ /* 144 */,
3683
+ /* 145 */,
3684
+ /* 146 */,
3685
+ /* 147 */,
3686
+ /* 148 */,
3687
+ /* 149 */,
3688
+ /* 150 */,
3689
+ /* 151 */,
3690
+ /* 152 */,
3691
+ /* 153 */,
3692
+ /* 154 */,
3693
+ /* 155 */,
3694
+ /* 156 */,
3695
+ /* 157 */,
3696
+ /* 158 */,
3697
+ /* 159 */,
3698
+ /* 160 */,
3699
+ /* 161 */,
3700
+ /* 162 */,
3701
+ /* 163 */,
3702
+ /* 164 */,
3703
+ /* 165 */,
3704
+ /* 166 */,
3705
+ /* 167 */,
3706
+ /* 168 */,
3707
+ /* 169 */,
3708
+ /* 170 */,
3709
+ /* 171 */,
3710
+ /* 172 */,
3711
+ /* 173 */,
3712
+ /* 174 */,
3713
+ /* 175 */,
3714
+ /* 176 */,
3715
+ /* 177 */,
3716
+ /* 178 */,
3717
+ /* 179 */,
3718
+ /* 180 */,
3719
+ /* 181 */,
3720
+ /* 182 */,
3721
+ /* 183 */,
3722
+ /* 184 */,
3723
+ /* 185 */,
3724
+ /* 186 */,
3725
+ /* 187 */,
3726
+ /* 188 */,
3727
+ /* 189 */,
3728
+ /* 190 */,
3729
+ /* 191 */,
3730
+ /* 192 */,
3731
+ /* 193 */,
3732
+ /* 194 */,
3733
+ /* 195 */,
3734
+ /* 196 */,
3735
+ /* 197 */,
3736
+ /* 198 */,
3737
+ /* 199 */,
3738
+ /* 200 */,
3739
+ /* 201 */,
3740
+ /* 202 */,
3741
+ /* 203 */,
3742
+ /* 204 */,
3743
+ /* 205 */,
3744
+ /* 206 */,
3745
+ /* 207 */,
3746
+ /* 208 */,
3747
+ /* 209 */,
3748
+ /* 210 */,
3749
+ /* 211 */,
3750
+ /* 212 */,
3751
+ /* 213 */,
3752
+ /* 214 */,
3753
+ /* 215 */,
3754
+ /* 216 */,
3755
+ /* 217 */,
3756
+ /* 218 */,
3757
+ /* 219 */,
3758
+ /* 220 */,
3759
+ /* 221 */,
3760
+ /* 222 */,
3761
+ /* 223 */,
3762
+ /* 224 */,
3763
+ /* 225 */,
3764
+ /* 226 */
3765
+ /***/ (function(module, exports, __webpack_require__) {
3766
 
3767
+ "use strict";
 
 
3768
 
 
 
 
 
 
 
 
 
3769
 
3770
+ var _propTypes = __webpack_require__(3);
3771
 
3772
+ var _propTypes2 = _interopRequireDefault(_propTypes);
 
 
3773
 
3774
+ var _react = __webpack_require__(2);
 
 
3775
 
3776
+ var _react2 = _interopRequireDefault(_react);
 
 
 
 
 
3777
 
3778
+ var _reactTooltip = __webpack_require__(232);
 
3779
 
3780
+ var _reactTooltip2 = _interopRequireDefault(_reactTooltip);
3781
 
3782
+ var _reactHtmlParser = __webpack_require__(417);
3783
 
3784
+ var _reactHtmlParser2 = _interopRequireDefault(_reactHtmlParser);
3785
 
3786
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
3787
 
3788
+ function Tooltip(props) {
3789
+ var tooltipId = props.tooltipId;
3790
+ var tooltip = props.tooltip;
3791
+ // tooltip ID must be unique, defaults to tooltip text
3792
+ if (!props.tooltipId && typeof props.tooltip === 'string') {
3793
+ tooltipId = props.tooltip;
3794
+ }
3795
 
3796
+ if (typeof props.tooltip === 'string') {
3797
+ tooltip = _react2.default.createElement(
3798
+ 'span',
3799
+ {
3800
+ style: {
3801
+ pointerEvents: 'all',
3802
+ maxWidth: '400px',
3803
+ display: 'inline-block'
3804
+ }
3805
+ },
3806
+ (0, _reactHtmlParser2.default)(props.tooltip)
3807
+ );
3808
+ }
3809
+
3810
+ return _react2.default.createElement(
3811
+ 'span',
3812
+ { className: props.className },
3813
+ _react2.default.createElement('span', {
3814
+ style: {
3815
+ cursor: 'pointer'
3816
+ },
3817
+ className: 'tooltip dashicons dashicons-editor-help',
3818
+ 'data-event': 'click',
3819
+ 'data-tip': true,
3820
+ 'data-for': tooltipId
3821
+ }),
3822
+ _react2.default.createElement(
3823
+ _reactTooltip2.default,
3824
+ {
3825
+ globalEventOff: 'click',
3826
+ multiline: true,
3827
+ id: tooltipId,
3828
+ efect: 'solid',
3829
+ place: props.place
3830
+ },
3831
+ tooltip
3832
+ )
3833
+ );
3834
+ }
3835
+
3836
+ Tooltip.propTypes = {
3837
+ tooltipId: _propTypes2.default.string,
3838
+ tooltip: _propTypes2.default.node.isRequired,
3839
+ place: _propTypes2.default.string,
3840
+ className: _propTypes2.default.string
3841
  };
3842
 
3843
+ Tooltip.defaultProps = {
3844
+ tooltipId: undefined,
3845
+ place: undefined,
3846
+ className: undefined
3847
+ };
 
 
 
 
 
 
 
3848
 
3849
+ module.exports = Tooltip;
3850
 
3851
  /***/ }),
3852
+ /* 227 */,
3853
+ /* 228 */,
3854
+ /* 229 */,
3855
+ /* 230 */,
3856
+ /* 231 */,
3857
+ /* 232 */,
3858
+ /* 233 */,
3859
+ /* 234 */,
3860
+ /* 235 */,
3861
+ /* 236 */,
3862
+ /* 237 */,
3863
+ /* 238 */,
3864
+ /* 239 */,
3865
+ /* 240 */,
3866
+ /* 241 */,
3867
+ /* 242 */,
3868
+ /* 243 */,
3869
+ /* 244 */,
3870
+ /* 245 */,
3871
+ /* 246 */,
3872
+ /* 247 */,
3873
+ /* 248 */,
3874
+ /* 249 */,
3875
+ /* 250 */,
3876
+ /* 251 */,
3877
+ /* 252 */,
3878
+ /* 253 */,
3879
+ /* 254 */,
3880
+ /* 255 */,
3881
+ /* 256 */,
3882
+ /* 257 */,
3883
+ /* 258 */
3884
  /***/ (function(module, exports, __webpack_require__) {
3885
 
3886
+ var Tokenizer = __webpack_require__(259);
 
 
3887
 
3888
+ /*
3889
+ Options:
 
 
3890
 
3891
+ xmlMode: Disables the special behavior for script/style tags (false by default)
3892
+ lowerCaseAttributeNames: call .toLowerCase for each attribute name (true if xmlMode is `false`)
3893
+ lowerCaseTags: call .toLowerCase for each tag name (true if xmlMode is `false`)
3894
+ */
3895
 
3896
+ /*
3897
+ Callbacks:
3898
 
3899
+ oncdataend,
3900
+ oncdatastart,
3901
+ onclosetag,
3902
+ oncomment,
3903
+ oncommentend,
3904
+ onerror,
3905
+ onopentag,
3906
+ onprocessinginstruction,
3907
+ onreset,
3908
+ ontext
3909
+ */
3910
 
3911
+ var formTags = {
3912
+ input: true,
3913
+ option: true,
3914
+ optgroup: true,
3915
+ select: true,
3916
+ button: true,
3917
+ datalist: true,
3918
+ textarea: true
3919
+ };
3920
 
3921
+ var openImpliesClose = {
3922
+ tr : { tr:true, th:true, td:true },
3923
+ th : { th:true },
3924
+ td : { thead:true, th:true, td:true },
3925
+ body : { head:true, link:true, script:true },
3926
+ li : { li:true },
3927
+ p : { p:true },
3928
+ h1 : { p:true },
3929
+ h2 : { p:true },
3930
+ h3 : { p:true },
3931
+ h4 : { p:true },
3932
+ h5 : { p:true },
3933
+ h6 : { p:true },
3934
+ select : formTags,
3935
+ input : formTags,
3936
+ output : formTags,
3937
+ button : formTags,
3938
+ datalist: formTags,
3939
+ textarea: formTags,
3940
+ option : { option:true },
3941
+ optgroup: { optgroup:true }
3942
  };
3943
 
3944
+ var voidElements = {
3945
+ __proto__: null,
3946
+ area: true,
3947
+ base: true,
3948
+ basefont: true,
3949
+ br: true,
3950
+ col: true,
3951
+ command: true,
3952
+ embed: true,
3953
+ frame: true,
3954
+ hr: true,
3955
+ img: true,
3956
+ input: true,
3957
+ isindex: true,
3958
+ keygen: true,
3959
+ link: true,
3960
+ meta: true,
3961
+ param: true,
3962
+ source: true,
3963
+ track: true,
3964
+ wbr: true,
3965
 
3966
+ //common self closing svg elements
3967
+ path: true,
3968
+ circle: true,
3969
+ ellipse: true,
3970
+ line: true,
3971
+ rect: true,
3972
+ use: true,
3973
+ stop: true,
3974
+ polyline: true,
3975
+ polygon: true
3976
+ };
3977
 
3978
+ var re_nameEnd = /\s|\//;
 
 
 
 
 
 
3979
 
3980
+ function Parser(cbs, options){
3981
+ this._options = options || {};
3982
+ this._cbs = cbs || {};
3983
 
3984
+ this._tagname = "";
3985
+ this._attribname = "";
3986
+ this._attribvalue = "";
3987
+ this._attribs = null;
3988
+ this._stack = [];
3989
 
3990
+ this.startIndex = 0;
3991
+ this.endIndex = null;
 
 
 
 
 
 
 
3992
 
3993
+ this._lowerCaseTagNames = "lowerCaseTags" in this._options ?
3994
+ !!this._options.lowerCaseTags :
3995
+ !this._options.xmlMode;
3996
+ this._lowerCaseAttributeNames = "lowerCaseAttributeNames" in this._options ?
3997
+ !!this._options.lowerCaseAttributeNames :
3998
+ !this._options.xmlMode;
 
3999
 
4000
+ if(this._options.Tokenizer) {
4001
+ Tokenizer = this._options.Tokenizer;
4002
+ }
4003
+ this._tokenizer = new Tokenizer(this._options, this);
4004
 
4005
+ if(this._cbs.onparserinit) this._cbs.onparserinit(this);
4006
+ }
4007
 
4008
+ __webpack_require__(22)(Parser, __webpack_require__(55).EventEmitter);
4009
+
4010
+ Parser.prototype._updatePosition = function(initialOffset){
4011
+ if(this.endIndex === null){
4012
+ if(this._tokenizer._sectionStart <= initialOffset){
4013
+ this.startIndex = 0;
4014
+ } else {
4015
+ this.startIndex = this._tokenizer._sectionStart - initialOffset;
4016
  }
4017
  }
4018
+ else this.startIndex = this.endIndex + 1;
4019
+ this.endIndex = this._tokenizer.getAbsoluteIndex();
 
 
4020
  };
4021
 
4022
+ //Tokenizer event handlers
4023
+ Parser.prototype.ontext = function(data){
4024
+ this._updatePosition(1);
4025
+ this.endIndex--;
4026
 
4027
+ if(this._cbs.ontext) this._cbs.ontext(data);
4028
+ };
4029
 
4030
+ Parser.prototype.onopentagname = function(name){
4031
+ if(this._lowerCaseTagNames){
4032
+ name = name.toLowerCase();
4033
+ }
4034
 
4035
+ this._tagname = name;
 
4036
 
4037
+ if(!this._options.xmlMode && name in openImpliesClose) {
4038
+ for(
4039
+ var el;
4040
+ (el = this._stack[this._stack.length - 1]) in openImpliesClose[name];
4041
+ this.onclosetag(el)
4042
+ );
4043
+ }
4044
 
4045
+ if(this._options.xmlMode || !(name in voidElements)){
4046
+ this._stack.push(name);
4047
+ }
4048
 
4049
+ if(this._cbs.onopentagname) this._cbs.onopentagname(name);
4050
+ if(this._cbs.onopentag) this._attribs = {};
4051
+ };
4052
 
4053
+ Parser.prototype.onopentagend = function(){
4054
+ this._updatePosition(1);
4055
 
4056
+ if(this._attribs){
4057
+ if(this._cbs.onopentag) this._cbs.onopentag(this._tagname, this._attribs);
4058
+ this._attribs = null;
4059
+ }
4060
 
4061
+ if(!this._options.xmlMode && this._cbs.onclosetag && this._tagname in voidElements){
4062
+ this._cbs.onclosetag(this._tagname);
4063
+ }
4064
 
4065
+ this._tagname = "";
4066
+ };
4067
 
4068
+ Parser.prototype.onclosetag = function(name){
4069
+ this._updatePosition(1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4070
 
4071
+ if(this._lowerCaseTagNames){
4072
+ name = name.toLowerCase();
4073
+ }
4074
 
4075
+ if(this._stack.length && (!(name in voidElements) || this._options.xmlMode)){
4076
+ var pos = this._stack.lastIndexOf(name);
4077
+ if(pos !== -1){
4078
+ if(this._cbs.onclosetag){
4079
+ pos = this._stack.length - pos;
4080
+ while(pos--) this._cbs.onclosetag(this._stack.pop());
4081
+ }
4082
+ else this._stack.length = pos;
4083
+ } else if(name === "p" && !this._options.xmlMode){
4084
+ this.onopentagname(name);
4085
+ this._closeCurrentTag();
4086
+ }
4087
+ } else if(!this._options.xmlMode && (name === "br" || name === "p")){
4088
+ this.onopentagname(name);
4089
+ this._closeCurrentTag();
4090
+ }
4091
+ };
4092
 
4093
+ Parser.prototype.onselfclosingtag = function(){
4094
+ if(this._options.xmlMode || this._options.recognizeSelfClosing){
4095
+ this._closeCurrentTag();
4096
+ } else {
4097
+ this.onopentagend();
4098
+ }
4099
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
4100
 
4101
+ Parser.prototype._closeCurrentTag = function(){
4102
+ var name = this._tagname;
4103
 
4104
+ this.onopentagend();
 
4105
 
4106
+ //self-closing tags will be on the top of the stack
4107
+ //(cheaper check than in onclosetag)
4108
+ if(this._stack[this._stack.length - 1] === name){
4109
+ if(this._cbs.onclosetag){
4110
+ this._cbs.onclosetag(name);
4111
+ }
4112
+ this._stack.pop();
4113
+ }
4114
+ };
4115
 
4116
+ Parser.prototype.onattribname = function(name){
4117
+ if(this._lowerCaseAttributeNames){
4118
+ name = name.toLowerCase();
4119
+ }
4120
+ this._attribname = name;
4121
+ };
4122
 
4123
+ Parser.prototype.onattribdata = function(value){
4124
+ this._attribvalue += value;
4125
+ };
4126
 
4127
+ Parser.prototype.onattribend = function(){
4128
+ if(this._cbs.onattribute) this._cbs.onattribute(this._attribname, this._attribvalue);
4129
+ if(
4130
+ this._attribs &&
4131
+ !Object.prototype.hasOwnProperty.call(this._attribs, this._attribname)
4132
+ ){
4133
+ this._attribs[this._attribname] = this._attribvalue;
4134
+ }
4135
+ this._attribname = "";
4136
+ this._attribvalue = "";
4137
+ };
4138
 
4139
+ Parser.prototype._getInstructionName = function(value){
4140
+ var idx = value.search(re_nameEnd),
4141
+ name = idx < 0 ? value : value.substr(0, idx);
4142
 
4143
+ if(this._lowerCaseTagNames){
4144
+ name = name.toLowerCase();
4145
+ }
4146
 
4147
+ return name;
4148
+ };
4149
 
4150
+ Parser.prototype.ondeclaration = function(value){
4151
+ if(this._cbs.onprocessinginstruction){
4152
+ var name = this._getInstructionName(value);
4153
+ this._cbs.onprocessinginstruction("!" + name, "!" + value);
4154
+ }
4155
+ };
 
4156
 
4157
+ Parser.prototype.onprocessinginstruction = function(value){
4158
+ if(this._cbs.onprocessinginstruction){
4159
+ var name = this._getInstructionName(value);
4160
+ this._cbs.onprocessinginstruction("?" + name, "?" + value);
4161
+ }
4162
+ };
4163
 
4164
+ Parser.prototype.oncomment = function(value){
4165
+ this._updatePosition(4);
 
 
 
4166
 
4167
+ if(this._cbs.oncomment) this._cbs.oncomment(value);
4168
+ if(this._cbs.oncommentend) this._cbs.oncommentend();
4169
+ };
4170
 
4171
+ Parser.prototype.oncdata = function(value){
4172
+ this._updatePosition(1);
 
 
 
 
4173
 
4174
+ if(this._options.xmlMode || this._options.recognizeCDATA){
4175
+ if(this._cbs.oncdatastart) this._cbs.oncdatastart();
4176
+ if(this._cbs.ontext) this._cbs.ontext(value);
4177
+ if(this._cbs.oncdataend) this._cbs.oncdataend();
4178
+ } else {
4179
+ this.oncomment("[CDATA[" + value + "]]");
4180
+ }
4181
+ };
4182
 
4183
+ Parser.prototype.onerror = function(err){
4184
+ if(this._cbs.onerror) this._cbs.onerror(err);
4185
+ };
4186
 
4187
+ Parser.prototype.onend = function(){
4188
+ if(this._cbs.onclosetag){
4189
+ for(
4190
+ var i = this._stack.length;
4191
+ i > 0;
4192
+ this._cbs.onclosetag(this._stack[--i])
4193
+ );
4194
+ }
4195
+ if(this._cbs.onend) this._cbs.onend();
4196
+ };
4197
 
 
 
 
4198
 
4199
+ //Resets the parser to a blank state, ready to parse a new HTML document
4200
+ Parser.prototype.reset = function(){
4201
+ if(this._cbs.onreset) this._cbs.onreset();
4202
+ this._tokenizer.reset();
 
 
 
 
 
 
 
 
 
4203
 
4204
+ this._tagname = "";
4205
+ this._attribname = "";
4206
+ this._attribs = null;
4207
+ this._stack = [];
4208
 
4209
+ if(this._cbs.onparserinit) this._cbs.onparserinit(this);
4210
+ };
4211
 
4212
+ //Parses a complete HTML document and pushes it to the handler
4213
+ Parser.prototype.parseComplete = function(data){
4214
+ this.reset();
4215
+ this.end(data);
4216
+ };
4217
 
4218
+ Parser.prototype.write = function(chunk){
4219
+ this._tokenizer.write(chunk);
4220
+ };
4221
 
4222
+ Parser.prototype.end = function(chunk){
4223
+ this._tokenizer.end(chunk);
4224
+ };
4225
 
4226
+ Parser.prototype.pause = function(){
4227
+ this._tokenizer.pause();
4228
+ };
4229
 
4230
+ Parser.prototype.resume = function(){
4231
+ this._tokenizer.resume();
4232
+ };
4233
 
4234
+ //alias for backwards compat
4235
+ Parser.prototype.parseChunk = Parser.prototype.write;
4236
+ Parser.prototype.done = Parser.prototype.end;
4237
 
4238
+ module.exports = Parser;
 
 
4239
 
4240
 
4241
  /***/ }),
4242
+ /* 259 */
 
4243
  /***/ (function(module, exports, __webpack_require__) {
4244
 
4245
+ module.exports = Tokenizer;
 
4246
 
4247
+ var decodeCodePoint = __webpack_require__(260),
4248
+ entityMap = __webpack_require__(86),
4249
+ legacyMap = __webpack_require__(261),
4250
+ xmlMap = __webpack_require__(87),
4251
 
4252
+ i = 0,
 
 
4253
 
4254
+ TEXT = i++,
4255
+ BEFORE_TAG_NAME = i++, //after <
4256
+ IN_TAG_NAME = i++,
4257
+ IN_SELF_CLOSING_TAG = i++,
4258
+ BEFORE_CLOSING_TAG_NAME = i++,
4259
+ IN_CLOSING_TAG_NAME = i++,
4260
+ AFTER_CLOSING_TAG_NAME = i++,
4261
 
4262
+ //attributes
4263
+ BEFORE_ATTRIBUTE_NAME = i++,
4264
+ IN_ATTRIBUTE_NAME = i++,
4265
+ AFTER_ATTRIBUTE_NAME = i++,
4266
+ BEFORE_ATTRIBUTE_VALUE = i++,
4267
+ IN_ATTRIBUTE_VALUE_DQ = i++, // "
4268
+ IN_ATTRIBUTE_VALUE_SQ = i++, // '
4269
+ IN_ATTRIBUTE_VALUE_NQ = i++,
4270
 
4271
+ //declarations
4272
+ BEFORE_DECLARATION = i++, // !
4273
+ IN_DECLARATION = i++,
 
 
4274
 
4275
+ //processing instructions
4276
+ IN_PROCESSING_INSTRUCTION = i++, // ?
 
 
 
 
 
4277
 
4278
+ //comments
4279
+ BEFORE_COMMENT = i++,
4280
+ IN_COMMENT = i++,
4281
+ AFTER_COMMENT_1 = i++,
4282
+ AFTER_COMMENT_2 = i++,
4283
 
4284
+ //cdata
4285
+ BEFORE_CDATA_1 = i++, // [
4286
+ BEFORE_CDATA_2 = i++, // C
4287
+ BEFORE_CDATA_3 = i++, // D
4288
+ BEFORE_CDATA_4 = i++, // A
4289
+ BEFORE_CDATA_5 = i++, // T
4290
+ BEFORE_CDATA_6 = i++, // A
4291
+ IN_CDATA = i++, // [
4292
+ AFTER_CDATA_1 = i++, // ]
4293
+ AFTER_CDATA_2 = i++, // ]
4294
 
4295
+ //special tags
4296
+ BEFORE_SPECIAL = i++, //S
4297
+ BEFORE_SPECIAL_END = i++, //S
4298
 
4299
+ BEFORE_SCRIPT_1 = i++, //C
4300
+ BEFORE_SCRIPT_2 = i++, //R
4301
+ BEFORE_SCRIPT_3 = i++, //I
4302
+ BEFORE_SCRIPT_4 = i++, //P
4303
+ BEFORE_SCRIPT_5 = i++, //T
4304
+ AFTER_SCRIPT_1 = i++, //C
4305
+ AFTER_SCRIPT_2 = i++, //R
4306
+ AFTER_SCRIPT_3 = i++, //I
4307
+ AFTER_SCRIPT_4 = i++, //P
4308
+ AFTER_SCRIPT_5 = i++, //T
4309
 
4310
+ BEFORE_STYLE_1 = i++, //T
4311
+ BEFORE_STYLE_2 = i++, //Y
4312
+ BEFORE_STYLE_3 = i++, //L
4313
+ BEFORE_STYLE_4 = i++, //E
4314
+ AFTER_STYLE_1 = i++, //T
4315
+ AFTER_STYLE_2 = i++, //Y
4316
+ AFTER_STYLE_3 = i++, //L
4317
+ AFTER_STYLE_4 = i++, //E
4318
 
4319
+ BEFORE_ENTITY = i++, //&
4320
+ BEFORE_NUMERIC_ENTITY = i++, //#
4321
+ IN_NAMED_ENTITY = i++,
4322
+ IN_NUMERIC_ENTITY = i++,
4323
+ IN_HEX_ENTITY = i++, //X
 
4324
 
4325
+ j = 0,
 
 
 
 
 
 
 
4326
 
4327
+ SPECIAL_NONE = j++,
4328
+ SPECIAL_SCRIPT = j++,
4329
+ SPECIAL_STYLE = j++;
4330
 
4331
+ function whitespace(c){
4332
+ return c === " " || c === "\n" || c === "\t" || c === "\f" || c === "\r";
4333
  }
4334
 
4335
+ function characterState(char, SUCCESS){
4336
+ return function(c){
4337
+ if(c === char) this._state = SUCCESS;
4338
+ };
 
 
 
 
4339
  }
4340
 
4341
+ function ifElseState(upper, SUCCESS, FAILURE){
4342
+ var lower = upper.toLowerCase();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4343
 
4344
+ if(upper === lower){
4345
+ return function(c){
4346
+ if(c === lower){
4347
+ this._state = SUCCESS;
4348
+ } else {
4349
+ this._state = FAILURE;
4350
+ this._index--;
4351
+ }
4352
+ };
4353
+ } else {
4354
+ return function(c){
4355
+ if(c === lower || c === upper){
4356
+ this._state = SUCCESS;
4357
+ } else {
4358
+ this._state = FAILURE;
4359
+ this._index--;
4360
+ }
4361
+ };
4362
+ }
4363
  }
4364
 
4365
+ function consumeSpecialNameChar(upper, NEXT_STATE){
4366
+ var lower = upper.toLowerCase();
4367
 
4368
+ return function(c){
4369
+ if(c === lower || c === upper){
4370
+ this._state = NEXT_STATE;
4371
+ } else {
4372
+ this._state = IN_TAG_NAME;
4373
+ this._index--; //consume the token again
4374
+ }
4375
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4376
  }
4377
 
4378
+ function Tokenizer(options, cbs){
4379
+ this._state = TEXT;
4380
+ this._buffer = "";
4381
+ this._sectionStart = 0;
4382
+ this._index = 0;
4383
+ this._bufferOffset = 0; //chars removed from _buffer
4384
+ this._baseState = TEXT;
4385
+ this._special = SPECIAL_NONE;
4386
+ this._cbs = cbs;
4387
+ this._running = true;
4388
+ this._ended = false;
4389
+ this._xmlMode = !!(options && options.xmlMode);
4390
+ this._decodeEntities = !!(options && options.decodeEntities);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4391
  }
4392
 
4393
+ Tokenizer.prototype._stateText = function(c){
4394
+ if(c === "<"){
4395
+ if(this._index > this._sectionStart){
4396
+ this._cbs.ontext(this._getSection());
4397
+ }
4398
+ this._state = BEFORE_TAG_NAME;
4399
+ this._sectionStart = this._index;
4400
+ } else if(this._decodeEntities && this._special === SPECIAL_NONE && c === "&"){
4401
+ if(this._index > this._sectionStart){
4402
+ this._cbs.ontext(this._getSection());
4403
+ }
4404
+ this._baseState = TEXT;
4405
+ this._state = BEFORE_ENTITY;
4406
+ this._sectionStart = this._index;
4407
+ }
4408
+ };
4409
 
4410
+ Tokenizer.prototype._stateBeforeTagName = function(c){
4411
+ if(c === "/"){
4412
+ this._state = BEFORE_CLOSING_TAG_NAME;
4413
+ } else if(c === "<"){
4414
+ this._cbs.ontext(this._getSection());
4415
+ this._sectionStart = this._index;
4416
+ } else if(c === ">" || this._special !== SPECIAL_NONE || whitespace(c)) {
4417
+ this._state = TEXT;
4418
+ } else if(c === "!"){
4419
+ this._state = BEFORE_DECLARATION;
4420
+ this._sectionStart = this._index + 1;
4421
+ } else if(c === "?"){
4422
+ this._state = IN_PROCESSING_INSTRUCTION;
4423
+ this._sectionStart = this._index + 1;
4424
+ } else {
4425
+ this._state = (!this._xmlMode && (c === "s" || c === "S")) ?
4426
+ BEFORE_SPECIAL : IN_TAG_NAME;
4427
+ this._sectionStart = this._index;
4428
+ }
4429
+ };
4430
 
4431
+ Tokenizer.prototype._stateInTagName = function(c){
4432
+ if(c === "/" || c === ">" || whitespace(c)){
4433
+ this._emitToken("onopentagname");
4434
+ this._state = BEFORE_ATTRIBUTE_NAME;
4435
+ this._index--;
4436
+ }
4437
+ };
4438
 
4439
+ Tokenizer.prototype._stateBeforeCloseingTagName = function(c){
4440
+ if(whitespace(c));
4441
+ else if(c === ">"){
4442
+ this._state = TEXT;
4443
+ } else if(this._special !== SPECIAL_NONE){
4444
+ if(c === "s" || c === "S"){
4445
+ this._state = BEFORE_SPECIAL_END;
4446
+ } else {
4447
+ this._state = TEXT;
4448
+ this._index--;
4449
+ }
4450
+ } else {
4451
+ this._state = IN_CLOSING_TAG_NAME;
4452
+ this._sectionStart = this._index;
4453
+ }
4454
+ };
4455
 
4456
+ Tokenizer.prototype._stateInCloseingTagName = function(c){
4457
+ if(c === ">" || whitespace(c)){
4458
+ this._emitToken("onclosetag");
4459
+ this._state = AFTER_CLOSING_TAG_NAME;
4460
+ this._index--;
4461
+ }
4462
+ };
4463
 
4464
+ Tokenizer.prototype._stateAfterCloseingTagName = function(c){
4465
+ //skip everything until ">"
4466
+ if(c === ">"){
4467
+ this._state = TEXT;
4468
+ this._sectionStart = this._index + 1;
4469
+ }
4470
+ };
4471
 
4472
+ Tokenizer.prototype._stateBeforeAttributeName = function(c){
4473
+ if(c === ">"){
4474
+ this._cbs.onopentagend();
4475
+ this._state = TEXT;
4476
+ this._sectionStart = this._index + 1;
4477
+ } else if(c === "/"){
4478
+ this._state = IN_SELF_CLOSING_TAG;
4479
+ } else if(!whitespace(c)){
4480
+ this._state = IN_ATTRIBUTE_NAME;
4481
+ this._sectionStart = this._index;
4482
+ }
4483
+ };
4484
 
4485
+ Tokenizer.prototype._stateInSelfClosingTag = function(c){
4486
+ if(c === ">"){
4487
+ this._cbs.onselfclosingtag();
4488
+ this._state = TEXT;
4489
+ this._sectionStart = this._index + 1;
4490
+ } else if(!whitespace(c)){
4491
+ this._state = BEFORE_ATTRIBUTE_NAME;
4492
+ this._index--;
4493
+ }
4494
+ };
4495
 
4496
+ Tokenizer.prototype._stateInAttributeName = function(c){
4497
+ if(c === "=" || c === "/" || c === ">" || whitespace(c)){
4498
+ this._cbs.onattribname(this._getSection());
4499
+ this._sectionStart = -1;
4500
+ this._state = AFTER_ATTRIBUTE_NAME;
4501
+ this._index--;
4502
+ }
4503
+ };
4504
 
4505
+ Tokenizer.prototype._stateAfterAttributeName = function(c){
4506
+ if(c === "="){
4507
+ this._state = BEFORE_ATTRIBUTE_VALUE;
4508
+ } else if(c === "/" || c === ">"){
4509
+ this._cbs.onattribend();
4510
+ this._state = BEFORE_ATTRIBUTE_NAME;
4511
+ this._index--;
4512
+ } else if(!whitespace(c)){
4513
+ this._cbs.onattribend();
4514
+ this._state = IN_ATTRIBUTE_NAME;
4515
+ this._sectionStart = this._index;
4516
+ }
4517
+ };
4518
 
4519
+ Tokenizer.prototype._stateBeforeAttributeValue = function(c){
4520
+ if(c === "\""){
4521
+ this._state = IN_ATTRIBUTE_VALUE_DQ;
4522
+ this._sectionStart = this._index + 1;
4523
+ } else if(c === "'"){
4524
+ this._state = IN_ATTRIBUTE_VALUE_SQ;
4525
+ this._sectionStart = this._index + 1;
4526
+ } else if(!whitespace(c)){
4527
+ this._state = IN_ATTRIBUTE_VALUE_NQ;
4528
+ this._sectionStart = this._index;
4529
+ this._index--; //reconsume token
4530
+ }
4531
+ };
4532
 
4533
+ Tokenizer.prototype._stateInAttributeValueDoubleQuotes = function(c){
4534
+ if(c === "\""){
4535
+ this._emitToken("onattribdata");
4536
+ this._cbs.onattribend();
4537
+ this._state = BEFORE_ATTRIBUTE_NAME;
4538
+ } else if(this._decodeEntities && c === "&"){
4539
+ this._emitToken("onattribdata");
4540
+ this._baseState = this._state;
4541
+ this._state = BEFORE_ENTITY;
4542
+ this._sectionStart = this._index;
4543
+ }
4544
+ };
 
 
 
 
 
 
4545
 
4546
+ Tokenizer.prototype._stateInAttributeValueSingleQuotes = function(c){
4547
+ if(c === "'"){
4548
+ this._emitToken("onattribdata");
4549
+ this._cbs.onattribend();
4550
+ this._state = BEFORE_ATTRIBUTE_NAME;
4551
+ } else if(this._decodeEntities && c === "&"){
4552
+ this._emitToken("onattribdata");
4553
+ this._baseState = this._state;
4554
+ this._state = BEFORE_ENTITY;
4555
+ this._sectionStart = this._index;
4556
+ }
4557
+ };
4558
 
4559
+ Tokenizer.prototype._stateInAttributeValueNoQuotes = function(c){
4560
+ if(whitespace(c) || c === ">"){
4561
+ this._emitToken("onattribdata");
4562
+ this._cbs.onattribend();
4563
+ this._state = BEFORE_ATTRIBUTE_NAME;
4564
+ this._index--;
4565
+ } else if(this._decodeEntities && c === "&"){
4566
+ this._emitToken("onattribdata");
4567
+ this._baseState = this._state;
4568
+ this._state = BEFORE_ENTITY;
4569
+ this._sectionStart = this._index;
4570
+ }
4571
+ };
4572
 
4573
+ Tokenizer.prototype._stateBeforeDeclaration = function(c){
4574
+ this._state = c === "[" ? BEFORE_CDATA_1 :
4575
+ c === "-" ? BEFORE_COMMENT :
4576
+ IN_DECLARATION;
4577
+ };
 
 
 
4578
 
4579
+ Tokenizer.prototype._stateInDeclaration = function(c){
4580
+ if(c === ">"){
4581
+ this._cbs.ondeclaration(this._getSection());
4582
+ this._state = TEXT;
4583
+ this._sectionStart = this._index + 1;
4584
+ }
4585
+ };
 
 
 
 
 
 
4586
 
4587
+ Tokenizer.prototype._stateInProcessingInstruction = function(c){
4588
+ if(c === ">"){
4589
+ this._cbs.onprocessinginstruction(this._getSection());
4590
+ this._state = TEXT;
4591
+ this._sectionStart = this._index + 1;
4592
+ }
4593
+ };
4594
 
4595
+ Tokenizer.prototype._stateBeforeComment = function(c){
4596
+ if(c === "-"){
4597
+ this._state = IN_COMMENT;
4598
+ this._sectionStart = this._index + 1;
4599
+ } else {
4600
+ this._state = IN_DECLARATION;
4601
+ }
4602
+ };
4603
 
4604
+ Tokenizer.prototype._stateInComment = function(c){
4605
+ if(c === "-") this._state = AFTER_COMMENT_1;
4606
+ };
4607
 
4608
+ Tokenizer.prototype._stateAfterComment1 = function(c){
4609
+ if(c === "-"){
4610
+ this._state = AFTER_COMMENT_2;
4611
+ } else {
4612
+ this._state = IN_COMMENT;
4613
+ }
4614
+ };
4615
 
4616
+ Tokenizer.prototype._stateAfterComment2 = function(c){
4617
+ if(c === ">"){
4618
+ //remove 2 trailing chars
4619
+ this._cbs.oncomment(this._buffer.substring(this._sectionStart, this._index - 2));
4620
+ this._state = TEXT;
4621
+ this._sectionStart = this._index + 1;
4622
+ } else if(c !== "-"){
4623
+ this._state = IN_COMMENT;
4624
+ }
4625
+ // else: stay in AFTER_COMMENT_2 (`--->`)
4626
+ };
4627
 
4628
+ Tokenizer.prototype._stateBeforeCdata1 = ifElseState("C", BEFORE_CDATA_2, IN_DECLARATION);
4629
+ Tokenizer.prototype._stateBeforeCdata2 = ifElseState("D", BEFORE_CDATA_3, IN_DECLARATION);
4630
+ Tokenizer.prototype._stateBeforeCdata3 = ifElseState("A", BEFORE_CDATA_4, IN_DECLARATION);
4631
+ Tokenizer.prototype._stateBeforeCdata4 = ifElseState("T", BEFORE_CDATA_5, IN_DECLARATION);
4632
+ Tokenizer.prototype._stateBeforeCdata5 = ifElseState("A", BEFORE_CDATA_6, IN_DECLARATION);
 
 
 
 
 
 
 
 
 
 
 
 
4633
 
4634
+ Tokenizer.prototype._stateBeforeCdata6 = function(c){
4635
+ if(c === "["){
4636
+ this._state = IN_CDATA;
4637
+ this._sectionStart = this._index + 1;
4638
+ } else {
4639
+ this._state = IN_DECLARATION;
4640
+ this._index--;
4641
+ }
4642
+ };
4643
 
4644
+ Tokenizer.prototype._stateInCdata = function(c){
4645
+ if(c === "]") this._state = AFTER_CDATA_1;
4646
+ };
 
 
 
 
 
 
 
 
 
 
 
4647
 
4648
+ Tokenizer.prototype._stateAfterCdata1 = characterState("]", AFTER_CDATA_2);
 
4649
 
4650
+ Tokenizer.prototype._stateAfterCdata2 = function(c){
4651
+ if(c === ">"){
4652
+ //remove 2 trailing chars
4653
+ this._cbs.oncdata(this._buffer.substring(this._sectionStart, this._index - 2));
4654
+ this._state = TEXT;
4655
+ this._sectionStart = this._index + 1;
4656
+ } else if(c !== "]") {
4657
+ this._state = IN_CDATA;
4658
+ }
4659
+ //else: stay in AFTER_CDATA_2 (`]]]>`)
4660
+ };
4661
 
4662
+ Tokenizer.prototype._stateBeforeSpecial = function(c){
4663
+ if(c === "c" || c === "C"){
4664
+ this._state = BEFORE_SCRIPT_1;
4665
+ } else if(c === "t" || c === "T"){
4666
+ this._state = BEFORE_STYLE_1;
4667
+ } else {
4668
+ this._state = IN_TAG_NAME;
4669
+ this._index--; //consume the token again
4670
+ }
4671
+ };
 
4672
 
4673
+ Tokenizer.prototype._stateBeforeSpecialEnd = function(c){
4674
+ if(this._special === SPECIAL_SCRIPT && (c === "c" || c === "C")){
4675
+ this._state = AFTER_SCRIPT_1;
4676
+ } else if(this._special === SPECIAL_STYLE && (c === "t" || c === "T")){
4677
+ this._state = AFTER_STYLE_1;
4678
+ }
4679
+ else this._state = TEXT;
4680
+ };
4681
 
4682
+ Tokenizer.prototype._stateBeforeScript1 = consumeSpecialNameChar("R", BEFORE_SCRIPT_2);
4683
+ Tokenizer.prototype._stateBeforeScript2 = consumeSpecialNameChar("I", BEFORE_SCRIPT_3);
4684
+ Tokenizer.prototype._stateBeforeScript3 = consumeSpecialNameChar("P", BEFORE_SCRIPT_4);
4685
+ Tokenizer.prototype._stateBeforeScript4 = consumeSpecialNameChar("T", BEFORE_SCRIPT_5);
4686
 
4687
+ Tokenizer.prototype._stateBeforeScript5 = function(c){
4688
+ if(c === "/" || c === ">" || whitespace(c)){
4689
+ this._special = SPECIAL_SCRIPT;
4690
+ }
4691
+ this._state = IN_TAG_NAME;
4692
+ this._index--; //consume the token again
4693
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4694
 
4695
+ Tokenizer.prototype._stateAfterScript1 = ifElseState("R", AFTER_SCRIPT_2, TEXT);
4696
+ Tokenizer.prototype._stateAfterScript2 = ifElseState("I", AFTER_SCRIPT_3, TEXT);
4697
+ Tokenizer.prototype._stateAfterScript3 = ifElseState("P", AFTER_SCRIPT_4, TEXT);
4698
+ Tokenizer.prototype._stateAfterScript4 = ifElseState("T", AFTER_SCRIPT_5, TEXT);
4699
 
4700
+ Tokenizer.prototype._stateAfterScript5 = function(c){
4701
+ if(c === ">" || whitespace(c)){
4702
+ this._special = SPECIAL_NONE;
4703
+ this._state = IN_CLOSING_TAG_NAME;
4704
+ this._sectionStart = this._index - 6;
4705
+ this._index--; //reconsume the token
4706
+ }
4707
+ else this._state = TEXT;
4708
+ };
4709
 
4710
+ Tokenizer.prototype._stateBeforeStyle1 = consumeSpecialNameChar("Y", BEFORE_STYLE_2);
4711
+ Tokenizer.prototype._stateBeforeStyle2 = consumeSpecialNameChar("L", BEFORE_STYLE_3);
4712
+ Tokenizer.prototype._stateBeforeStyle3 = consumeSpecialNameChar("E", BEFORE_STYLE_4);
4713
 
4714
+ Tokenizer.prototype._stateBeforeStyle4 = function(c){
4715
+ if(c === "/" || c === ">" || whitespace(c)){
4716
+ this._special = SPECIAL_STYLE;
4717
+ }
4718
+ this._state = IN_TAG_NAME;
4719
+ this._index--; //consume the token again
4720
+ };
4721
 
4722
+ Tokenizer.prototype._stateAfterStyle1 = ifElseState("Y", AFTER_STYLE_2, TEXT);
4723
+ Tokenizer.prototype._stateAfterStyle2 = ifElseState("L", AFTER_STYLE_3, TEXT);
4724
+ Tokenizer.prototype._stateAfterStyle3 = ifElseState("E", AFTER_STYLE_4, TEXT);
 
4725
 
4726
+ Tokenizer.prototype._stateAfterStyle4 = function(c){
4727
+ if(c === ">" || whitespace(c)){
4728
+ this._special = SPECIAL_NONE;
4729
+ this._state = IN_CLOSING_TAG_NAME;
4730
+ this._sectionStart = this._index - 5;
4731
+ this._index--; //reconsume the token
4732
+ }
4733
+ else this._state = TEXT;
4734
+ };
4735
 
4736
+ Tokenizer.prototype._stateBeforeEntity = ifElseState("#", BEFORE_NUMERIC_ENTITY, IN_NAMED_ENTITY);
4737
+ Tokenizer.prototype._stateBeforeNumericEntity = ifElseState("X", IN_HEX_ENTITY, IN_NUMERIC_ENTITY);
4738
 
4739
+ //for entities terminated with a semicolon
4740
+ Tokenizer.prototype._parseNamedEntityStrict = function(){
4741
+ //offset = 1
4742
+ if(this._sectionStart + 1 < this._index){
4743
+ var entity = this._buffer.substring(this._sectionStart + 1, this._index),
4744
+ map = this._xmlMode ? xmlMap : entityMap;
4745
 
4746
+ if(map.hasOwnProperty(entity)){
4747
+ this._emitPartial(map[entity]);
4748
+ this._sectionStart = this._index + 1;
4749
+ }
4750
+ }
4751
  };
4752
 
 
 
 
 
4753
 
4754
+ //parses legacy entities (without trailing semicolon)
4755
+ Tokenizer.prototype._parseLegacyEntity = function(){
4756
+ var start = this._sectionStart + 1,
4757
+ limit = this._index - start;
4758
 
4759
+ if(limit > 6) limit = 6; //the max length of legacy entities is 6
4760
 
4761
+ while(limit >= 2){ //the min length of legacy entities is 2
4762
+ var entity = this._buffer.substr(start, limit);
4763
 
4764
+ if(legacyMap.hasOwnProperty(entity)){
4765
+ this._emitPartial(legacyMap[entity]);
4766
+ this._sectionStart += limit + 1;
4767
+ return;
4768
+ } else {
4769
+ limit--;
4770
+ }
4771
+ }
4772
+ };
4773
 
4774
+ Tokenizer.prototype._stateInNamedEntity = function(c){
4775
+ if(c === ";"){
4776
+ this._parseNamedEntityStrict();
4777
+ if(this._sectionStart + 1 < this._index && !this._xmlMode){
4778
+ this._parseLegacyEntity();
4779
+ }
4780
+ this._state = this._baseState;
4781
+ } else if((c < "a" || c > "z") && (c < "A" || c > "Z") && (c < "0" || c > "9")){
4782
+ if(this._xmlMode);
4783
+ else if(this._sectionStart + 1 === this._index);
4784
+ else if(this._baseState !== TEXT){
4785
+ if(c !== "="){
4786
+ this._parseNamedEntityStrict();
4787
+ }
4788
+ } else {
4789
+ this._parseLegacyEntity();
4790
+ }
4791
 
4792
+ this._state = this._baseState;
4793
+ this._index--;
4794
+ }
4795
+ };
4796
 
4797
+ Tokenizer.prototype._decodeNumericEntity = function(offset, base){
4798
+ var sectionStart = this._sectionStart + offset;
4799
 
4800
+ if(sectionStart !== this._index){
4801
+ //parse entity
4802
+ var entity = this._buffer.substring(sectionStart, this._index);
4803
+ var parsed = parseInt(entity, base);
4804
 
4805
+ this._emitPartial(decodeCodePoint(parsed));
4806
+ this._sectionStart = this._index;
4807
+ } else {
4808
+ this._sectionStart--;
4809
+ }
4810
 
4811
+ this._state = this._baseState;
4812
+ };
4813
 
4814
+ Tokenizer.prototype._stateInNumericEntity = function(c){
4815
+ if(c === ";"){
4816
+ this._decodeNumericEntity(2, 10);
4817
+ this._sectionStart++;
4818
+ } else if(c < "0" || c > "9"){
4819
+ if(!this._xmlMode){
4820
+ this._decodeNumericEntity(2, 10);
4821
+ } else {
4822
+ this._state = this._baseState;
4823
+ }
4824
+ this._index--;
4825
+ }
4826
+ };
4827
 
4828
+ Tokenizer.prototype._stateInHexEntity = function(c){
4829
+ if(c === ";"){
4830
+ this._decodeNumericEntity(3, 16);
4831
+ this._sectionStart++;
4832
+ } else if((c < "a" || c > "f") && (c < "A" || c > "F") && (c < "0" || c > "9")){
4833
+ if(!this._xmlMode){
4834
+ this._decodeNumericEntity(3, 16);
4835
+ } else {
4836
+ this._state = this._baseState;
4837
+ }
4838
+ this._index--;
4839
+ }
4840
+ };
4841
 
4842
+ Tokenizer.prototype._cleanup = function (){
4843
+ if(this._sectionStart < 0){
4844
+ this._buffer = "";
4845
+ this._bufferOffset += this._index;
4846
+ this._index = 0;
4847
+ } else if(this._running){
4848
+ if(this._state === TEXT){
4849
+ if(this._sectionStart !== this._index){
4850
+ this._cbs.ontext(this._buffer.substr(this._sectionStart));
4851
+ }
4852
+ this._buffer = "";
4853
+ this._bufferOffset += this._index;
4854
+ this._index = 0;
4855
+ } else if(this._sectionStart === this._index){
4856
+ //the section just started
4857
+ this._buffer = "";
4858
+ this._bufferOffset += this._index;
4859
+ this._index = 0;
4860
+ } else {
4861
+ //remove everything unnecessary
4862
+ this._buffer = this._buffer.substr(this._sectionStart);
4863
+ this._index -= this._sectionStart;
4864
+ this._bufferOffset += this._sectionStart;
4865
+ }
4866
 
4867
+ this._sectionStart = 0;
4868
+ }
4869
+ };
4870
 
4871
+ //TODO make events conditional
4872
+ Tokenizer.prototype.write = function(chunk){
4873
+ if(this._ended) this._cbs.onerror(Error(".write() after done!"));
4874
 
4875
+ this._buffer += chunk;
4876
+ this._parse();
4877
+ };
4878
 
4879
+ Tokenizer.prototype._parse = function(){
4880
+ while(this._index < this._buffer.length && this._running){
4881
+ var c = this._buffer.charAt(this._index);
4882
+ if(this._state === TEXT) {
4883
+ this._stateText(c);
4884
+ } else if(this._state === BEFORE_TAG_NAME){
4885
+ this._stateBeforeTagName(c);
4886
+ } else if(this._state === IN_TAG_NAME) {
4887
+ this._stateInTagName(c);
4888
+ } else if(this._state === BEFORE_CLOSING_TAG_NAME){
4889
+ this._stateBeforeCloseingTagName(c);
4890
+ } else if(this._state === IN_CLOSING_TAG_NAME){
4891
+ this._stateInCloseingTagName(c);
4892
+ } else if(this._state === AFTER_CLOSING_TAG_NAME){
4893
+ this._stateAfterCloseingTagName(c);
4894
+ } else if(this._state === IN_SELF_CLOSING_TAG){
4895
+ this._stateInSelfClosingTag(c);
4896
+ }
4897
 
4898
+ /*
4899
+ * attributes
4900
+ */
4901
+ else if(this._state === BEFORE_ATTRIBUTE_NAME){
4902
+ this._stateBeforeAttributeName(c);
4903
+ } else if(this._state === IN_ATTRIBUTE_NAME){
4904
+ this._stateInAttributeName(c);
4905
+ } else if(this._state === AFTER_ATTRIBUTE_NAME){
4906
+ this._stateAfterAttributeName(c);
4907
+ } else if(this._state === BEFORE_ATTRIBUTE_VALUE){
4908
+ this._stateBeforeAttributeValue(c);
4909
+ } else if(this._state === IN_ATTRIBUTE_VALUE_DQ){
4910
+ this._stateInAttributeValueDoubleQuotes(c);
4911
+ } else if(this._state === IN_ATTRIBUTE_VALUE_SQ){
4912
+ this._stateInAttributeValueSingleQuotes(c);
4913
+ } else if(this._state === IN_ATTRIBUTE_VALUE_NQ){
4914
+ this._stateInAttributeValueNoQuotes(c);
4915
+ }
4916
 
4917
+ /*
4918
+ * declarations
4919
+ */
4920
+ else if(this._state === BEFORE_DECLARATION){
4921
+ this._stateBeforeDeclaration(c);
4922
+ } else if(this._state === IN_DECLARATION){
4923
+ this._stateInDeclaration(c);
4924
+ }
4925
 
4926
+ /*
4927
+ * processing instructions
4928
+ */
4929
+ else if(this._state === IN_PROCESSING_INSTRUCTION){
4930
+ this._stateInProcessingInstruction(c);
4931
+ }
4932
 
4933
+ /*
4934
+ * comments
4935
+ */
4936
+ else if(this._state === BEFORE_COMMENT){
4937
+ this._stateBeforeComment(c);
4938
+ } else if(this._state === IN_COMMENT){
4939
+ this._stateInComment(c);
4940
+ } else if(this._state === AFTER_COMMENT_1){
4941
+ this._stateAfterComment1(c);
4942
+ } else if(this._state === AFTER_COMMENT_2){
4943
+ this._stateAfterComment2(c);
4944
+ }
4945
 
4946
+ /*
4947
+ * cdata
4948
+ */
4949
+ else if(this._state === BEFORE_CDATA_1){
4950
+ this._stateBeforeCdata1(c);
4951
+ } else if(this._state === BEFORE_CDATA_2){
4952
+ this._stateBeforeCdata2(c);
4953
+ } else if(this._state === BEFORE_CDATA_3){
4954
+ this._stateBeforeCdata3(c);
4955
+ } else if(this._state === BEFORE_CDATA_4){
4956
+ this._stateBeforeCdata4(c);
4957
+ } else if(this._state === BEFORE_CDATA_5){
4958
+ this._stateBeforeCdata5(c);
4959
+ } else if(this._state === BEFORE_CDATA_6){
4960
+ this._stateBeforeCdata6(c);
4961
+ } else if(this._state === IN_CDATA){
4962
+ this._stateInCdata(c);
4963
+ } else if(this._state === AFTER_CDATA_1){
4964
+ this._stateAfterCdata1(c);
4965
+ } else if(this._state === AFTER_CDATA_2){
4966
+ this._stateAfterCdata2(c);
4967
+ }
4968
 
4969
+ /*
4970
+ * special tags
4971
+ */
4972
+ else if(this._state === BEFORE_SPECIAL){
4973
+ this._stateBeforeSpecial(c);
4974
+ } else if(this._state === BEFORE_SPECIAL_END){
4975
+ this._stateBeforeSpecialEnd(c);
4976
+ }
4977
 
4978
+ /*
4979
+ * script
4980
+ */
4981
+ else if(this._state === BEFORE_SCRIPT_1){
4982
+ this._stateBeforeScript1(c);
4983
+ } else if(this._state === BEFORE_SCRIPT_2){
4984
+ this._stateBeforeScript2(c);
4985
+ } else if(this._state === BEFORE_SCRIPT_3){
4986
+ this._stateBeforeScript3(c);
4987
+ } else if(this._state === BEFORE_SCRIPT_4){
4988
+ this._stateBeforeScript4(c);
4989
+ } else if(this._state === BEFORE_SCRIPT_5){
4990
+ this._stateBeforeScript5(c);
4991
+ }
4992
 
4993
+ else if(this._state === AFTER_SCRIPT_1){
4994
+ this._stateAfterScript1(c);
4995
+ } else if(this._state === AFTER_SCRIPT_2){
4996
+ this._stateAfterScript2(c);
4997
+ } else if(this._state === AFTER_SCRIPT_3){
4998
+ this._stateAfterScript3(c);
4999
+ } else if(this._state === AFTER_SCRIPT_4){
5000
+ this._stateAfterScript4(c);
5001
+ } else if(this._state === AFTER_SCRIPT_5){
5002
+ this._stateAfterScript5(c);
5003
+ }
5004
 
5005
+ /*
5006
+ * style
5007
+ */
5008
+ else if(this._state === BEFORE_STYLE_1){
5009
+ this._stateBeforeStyle1(c);
5010
+ } else if(this._state === BEFORE_STYLE_2){
5011
+ this._stateBeforeStyle2(c);
5012
+ } else if(this._state === BEFORE_STYLE_3){
5013
+ this._stateBeforeStyle3(c);
5014
+ } else if(this._state === BEFORE_STYLE_4){
5015
+ this._stateBeforeStyle4(c);
5016
+ }
5017
 
5018
+ else if(this._state === AFTER_STYLE_1){
5019
+ this._stateAfterStyle1(c);
5020
+ } else if(this._state === AFTER_STYLE_2){
5021
+ this._stateAfterStyle2(c);
5022
+ } else if(this._state === AFTER_STYLE_3){
5023
+ this._stateAfterStyle3(c);
5024
+ } else if(this._state === AFTER_STYLE_4){
5025
+ this._stateAfterStyle4(c);
5026
+ }
5027
 
5028
+ /*
5029
+ * entities
5030
+ */
5031
+ else if(this._state === BEFORE_ENTITY){
5032
+ this._stateBeforeEntity(c);
5033
+ } else if(this._state === BEFORE_NUMERIC_ENTITY){
5034
+ this._stateBeforeNumericEntity(c);
5035
+ } else if(this._state === IN_NAMED_ENTITY){
5036
+ this._stateInNamedEntity(c);
5037
+ } else if(this._state === IN_NUMERIC_ENTITY){
5038
+ this._stateInNumericEntity(c);
5039
+ } else if(this._state === IN_HEX_ENTITY){
5040
+ this._stateInHexEntity(c);
5041
+ }
5042
 
5043
+ else {
5044
+ this._cbs.onerror(Error("unknown _state"), this._state);
5045
+ }
5046
 
5047
+ this._index++;
5048
+ }
 
5049
 
5050
+ this._cleanup();
 
 
 
5051
  };
5052
 
5053
+ Tokenizer.prototype.pause = function(){
5054
+ this._running = false;
5055
+ };
5056
+ Tokenizer.prototype.resume = function(){
5057
+ this._running = true;
 
 
 
 
 
 
 
 
 
 
 
5058
 
5059
+ if(this._index < this._buffer.length){
5060
+ this._parse();
5061
+ }
5062
+ if(this._ended){
5063
+ this._finish();
5064
+ }
5065
+ };
5066
 
5067
+ Tokenizer.prototype.end = function(chunk){
5068
+ if(this._ended) this._cbs.onerror(Error(".end() after done!"));
5069
+ if(chunk) this.write(chunk);
 
 
5070
 
5071
+ this._ended = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5072
 
5073
+ if(this._running) this._finish();
 
 
 
 
 
 
 
 
 
5074
  };
5075
 
5076
+ Tokenizer.prototype._finish = function(){
5077
+ //if there is remaining data, emit it in a reasonable way
5078
+ if(this._sectionStart < this._index){
5079
+ this._handleTrailingData();
5080
+ }
5081
 
5082
+ this._cbs.onend();
5083
+ };
5084
 
5085
+ Tokenizer.prototype._handleTrailingData = function(){
5086
+ var data = this._buffer.substr(this._sectionStart);
 
 
 
 
5087
 
5088
+ if(this._state === IN_CDATA || this._state === AFTER_CDATA_1 || this._state === AFTER_CDATA_2){
5089
+ this._cbs.oncdata(data);
5090
+ } else if(this._state === IN_COMMENT || this._state === AFTER_COMMENT_1 || this._state === AFTER_COMMENT_2){
5091
+ this._cbs.oncomment(data);
5092
+ } else if(this._state === IN_NAMED_ENTITY && !this._xmlMode){
5093
+ this._parseLegacyEntity();
5094
+ if(this._sectionStart < this._index){
5095
+ this._state = this._baseState;
5096
+ this._handleTrailingData();
5097
+ }
5098
+ } else if(this._state === IN_NUMERIC_ENTITY && !this._xmlMode){
5099
+ this._decodeNumericEntity(2, 10);
5100
+ if(this._sectionStart < this._index){
5101
+ this._state = this._baseState;
5102
+ this._handleTrailingData();
5103
+ }
5104
+ } else if(this._state === IN_HEX_ENTITY && !this._xmlMode){
5105
+ this._decodeNumericEntity(3, 16);
5106
+ if(this._sectionStart < this._index){
5107
+ this._state = this._baseState;
5108
+ this._handleTrailingData();
5109
+ }
5110
+ } else if(
5111
+ this._state !== IN_TAG_NAME &&
5112
+ this._state !== BEFORE_ATTRIBUTE_NAME &&
5113
+ this._state !== BEFORE_ATTRIBUTE_VALUE &&
5114
+ this._state !== AFTER_ATTRIBUTE_NAME &&
5115
+ this._state !== IN_ATTRIBUTE_NAME &&
5116
+ this._state !== IN_ATTRIBUTE_VALUE_SQ &&
5117
+ this._state !== IN_ATTRIBUTE_VALUE_DQ &&
5118
+ this._state !== IN_ATTRIBUTE_VALUE_NQ &&
5119
+ this._state !== IN_CLOSING_TAG_NAME
5120
+ ){
5121
+ this._cbs.ontext(data);
5122
+ }
5123
+ //else, ignore remaining data
5124
+ //TODO add a way to remove current tag
5125
  };
5126
 
5127
+ Tokenizer.prototype.reset = function(){
5128
+ Tokenizer.call(this, {xmlMode: this._xmlMode, decodeEntities: this._decodeEntities}, this._cbs);
5129
+ };
5130
 
5131
+ Tokenizer.prototype.getAbsoluteIndex = function(){
5132
+ return this._bufferOffset + this._index;
5133
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5134
 
5135
+ Tokenizer.prototype._getSection = function(){
5136
+ return this._buffer.substring(this._sectionStart, this._index);
5137
  };
5138
 
5139
+ Tokenizer.prototype._emitToken = function(name){
5140
+ this._cbs[name](this._getSection());
5141
+ this._sectionStart = -1;
5142
+ };
5143
 
5144
+ Tokenizer.prototype._emitPartial = function(value){
5145
+ if(this._baseState !== TEXT){
5146
+ this._cbs.onattribdata(value); //TODO implement the new event
5147
+ } else {
5148
+ this._cbs.ontext(value);
5149
+ }
5150
+ };
5151
 
 
 
 
5152
 
5153
+ /***/ }),
5154
+ /* 260 */
5155
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
5156
 
5157
+ var decodeMap = __webpack_require__(419);
 
 
 
5158
 
5159
+ module.exports = decodeCodePoint;
 
5160
 
5161
+ // modified version of https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119
5162
+ function decodeCodePoint(codePoint){
 
5163
 
5164
+ if((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF){
5165
+ return "\uFFFD";
5166
+ }
5167
 
5168
+ if(codePoint in decodeMap){
5169
+ codePoint = decodeMap[codePoint];
5170
+ }
 
5171
 
5172
+ var output = "";
 
5173
 
5174
+ if(codePoint > 0xFFFF){
5175
+ codePoint -= 0x10000;
5176
+ output += String.fromCharCode(codePoint >>> 10 & 0x3FF | 0xD800);
5177
+ codePoint = 0xDC00 | codePoint & 0x3FF;
5178
+ }
5179
 
5180
+ output += String.fromCharCode(codePoint);
5181
+ return output;
5182
  }
5183
 
5184
 
5185
  /***/ }),
5186
+ /* 261 */
 
5187
  /***/ (function(module, exports) {
5188
 
5189
+ module.exports = {"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\"","QUOT":"\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}
 
 
 
 
 
 
 
 
 
 
 
 
 
5190
 
5191
  /***/ }),
5192
+ /* 262 */
5193
+ /***/ (function(module, exports) {
5194
 
5195
+ // This object will be used as the prototype for Nodes when creating a
5196
+ // DOM-Level-1-compliant structure.
5197
+ var NodePrototype = module.exports = {
5198
+ get firstChild() {
5199
+ var children = this.children;
5200
+ return children && children[0] || null;
5201
+ },
5202
+ get lastChild() {
5203
+ var children = this.children;
5204
+ return children && children[children.length - 1] || null;
5205
+ },
5206
+ get nodeType() {
5207
+ return nodeTypes[this.type] || nodeTypes.element;
5208
+ }
5209
  };
5210
 
5211
+ var domLvl1 = {
5212
+ tagName: "name",
5213
+ childNodes: "children",
5214
+ parentNode: "parent",
5215
+ previousSibling: "prev",
5216
+ nextSibling: "next",
5217
+ nodeValue: "data"
5218
  };
5219
 
5220
+ var nodeTypes = {
5221
+ element: 1,
5222
+ text: 3,
5223
+ cdata: 4,
5224
+ comment: 8
5225
  };
5226
 
5227
+ Object.keys(domLvl1).forEach(function(key) {
5228
+ var shorthand = domLvl1[key];
5229
+ Object.defineProperty(NodePrototype, key, {
5230
+ get: function() {
5231
+ return this[shorthand] || null;
5232
+ },
5233
+ set: function(val) {
5234
+ this[shorthand] = val;
5235
+ return val;
5236
+ }
5237
+ });
5238
+ });
5239
 
 
 
 
5240
 
5241
+ /***/ }),
5242
+ /* 263 */
5243
+ /***/ (function(module, exports, __webpack_require__) {
5244
 
5245
+ module.exports = Stream;
 
 
5246
 
5247
+ var Parser = __webpack_require__(258),
5248
+ WritableStream = __webpack_require__(424).Writable || __webpack_require__(436).Writable,
5249
+ StringDecoder = __webpack_require__(91).StringDecoder,
5250
+ Buffer = __webpack_require__(89).Buffer;
5251
 
5252
+ function Stream(cbs, options){
5253
+ var parser = this._parser = new Parser(cbs, options);
5254
+ var decoder = this._decoder = new StringDecoder();
5255
 
5256
+ WritableStream.call(this, {decodeStrings: false});
5257
 
5258
+ this.once("finish", function(){
5259
+ parser.end(decoder.end());
5260
+ });
5261
+ }
5262
+
5263
+ __webpack_require__(22)(Stream, WritableStream);
5264
+
5265
+ WritableStream.prototype._write = function(chunk, encoding, cb){
5266
+ if(chunk instanceof Buffer) chunk = this._decoder.write(chunk);
5267
+ this._parser.write(chunk);
5268
+ cb();
5269
+ };
5270
 
5271
+ /***/ }),
5272
+ /* 264 */
5273
  /***/ (function(module, exports, __webpack_require__) {
5274
 
5275
+ "use strict";
5276
+ /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
5277
+ //
5278
+ // Permission is hereby granted, free of charge, to any person obtaining a
5279
+ // copy of this software and associated documentation files (the
5280
+ // "Software"), to deal in the Software without restriction, including
5281
+ // without limitation the rights to use, copy, modify, merge, publish,
5282
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
5283
+ // persons to whom the Software is furnished to do so, subject to the
5284
+ // following conditions:
5285
+ //
5286
+ // The above copyright notice and this permission notice shall be included
5287
+ // in all copies or substantial portions of the Software.
5288
+ //
5289
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5290
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5291
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5292
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5293
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5294
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5295
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
5296
 
 
5297
 
 
 
5298
 
5299
+ /*<replacement>*/
5300
 
5301
+ var processNextTick = __webpack_require__(56);
5302
+ /*</replacement>*/
 
 
 
 
5303
 
5304
+ module.exports = Readable;
 
 
5305
 
5306
+ /*<replacement>*/
5307
+ var isArray = __webpack_require__(265);
5308
+ /*</replacement>*/
 
 
 
 
5309
 
5310
+ /*<replacement>*/
5311
+ var Duplex;
5312
+ /*</replacement>*/
5313
 
5314
+ Readable.ReadableState = ReadableState;
 
5315
 
5316
+ /*<replacement>*/
5317
+ var EE = __webpack_require__(55).EventEmitter;
5318
 
5319
+ var EElistenerCount = function (emitter, type) {
5320
+ return emitter.listeners(type).length;
5321
+ };
5322
+ /*</replacement>*/
5323
 
5324
+ /*<replacement>*/
5325
+ var Stream = __webpack_require__(266);
5326
+ /*</replacement>*/
5327
+
5328
+ // TODO(bmeurer): Change this back to const once hole checks are
5329
+ // properly optimized away early in Ignition+TurboFan.
5330
+ /*<replacement>*/
5331
+ var Buffer = __webpack_require__(57).Buffer;
5332
+ var OurUint8Array = global.Uint8Array || function () {};
5333
+ function _uint8ArrayToBuffer(chunk) {
5334
+ return Buffer.from(chunk);
5335
+ }
5336
+ function _isUint8Array(obj) {
5337
+ return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
5338
  }
5339
+ /*</replacement>*/
5340
 
5341
+ /*<replacement>*/
5342
+ var util = __webpack_require__(46);
5343
+ util.inherits = __webpack_require__(22);
5344
+ /*</replacement>*/
5345
 
5346
+ /*<replacement>*/
5347
+ var debugUtil = __webpack_require__(427);
5348
+ var debug = void 0;
5349
+ if (debugUtil && debugUtil.debuglog) {
5350
+ debug = debugUtil.debuglog('stream');
5351
+ } else {
5352
+ debug = function () {};
5353
  }
5354
+ /*</replacement>*/
5355
 
5356
+ var BufferList = __webpack_require__(428);
5357
+ var destroyImpl = __webpack_require__(267);
5358
+ var StringDecoder;
5359
 
5360
+ util.inherits(Readable, Stream);
5361
+
5362
+ var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
5363
+
5364
+ function prependListener(emitter, event, fn) {
5365
+ // Sadly this is not cacheable as some libraries bundle their own
5366
+ // event emitter implementation with them.
5367
+ if (typeof emitter.prependListener === 'function') {
5368
+ return emitter.prependListener(event, fn);
5369
+ } else {
5370
+ // This is a hack to make sure that our error handler is attached before any
5371
+ // userland ones. NEVER DO THIS. This is here only because this code needs
5372
+ // to continue to work with older versions of Node.js that do not include
5373
+ // the prependListener() method. The goal is to eventually remove this hack.
5374
+ if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
5375
+ }
5376
  }
5377
 
5378
+ function ReadableState(options, stream) {
5379
+ Duplex = Duplex || __webpack_require__(32);
5380
 
5381
+ options = options || {};
5382
 
5383
+ // object stream flag. Used to make read(n) ignore n and to
5384
+ // make all the buffer merging and length checks go away
5385
+ this.objectMode = !!options.objectMode;
5386
 
5387
+ if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
 
5388
 
5389
+ // the point at which it stops calling _read() to fill the buffer
5390
+ // Note: 0 is a valid value, means "don't call _read preemptively ever"
5391
+ var hwm = options.highWaterMark;
5392
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
5393
+ this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
5394
 
5395
+ // cast to ints.
5396
+ this.highWaterMark = Math.floor(this.highWaterMark);
5397
 
5398
+ // A linked list is used to store data chunks instead of an array because the
5399
+ // linked list can remove elements from the beginning faster than
5400
+ // array.shift()
5401
+ this.buffer = new BufferList();
5402
+ this.length = 0;
5403
+ this.pipes = null;
5404
+ this.pipesCount = 0;
5405
+ this.flowing = null;
5406
+ this.ended = false;
5407
+ this.endEmitted = false;
5408
+ this.reading = false;
5409
 
5410
+ // a flag to be able to tell if the event 'readable'/'data' is emitted
5411
+ // immediately, or on a later tick. We set this to true at first, because
5412
+ // any actions that shouldn't happen until "later" should generally also
5413
+ // not happen before the first read call.
5414
+ this.sync = true;
5415
 
5416
+ // whenever we return null, then we set a flag to say
5417
+ // that we're awaiting a 'readable' event emission.
5418
+ this.needReadable = false;
5419
+ this.emittedReadable = false;
5420
+ this.readableListening = false;
5421
+ this.resumeScheduled = false;
5422
 
5423
+ // has it been destroyed
5424
+ this.destroyed = false;
5425
+
5426
+ // Crypto is kind of old and crusty. Historically, its default string
5427
+ // encoding is 'binary' so we have to make this configurable.
5428
+ // Everything else in the universe uses 'utf8', though.
5429
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
5430
+
5431
+ // the number of writers that are awaiting a drain event in .pipe()s
5432
+ this.awaitDrain = 0;
5433
+
5434
+ // if true, a maybeReadMore has been scheduled
5435
+ this.readingMore = false;
5436
+
5437
+ this.decoder = null;
5438
+ this.encoding = null;
5439
+ if (options.encoding) {
5440
+ if (!StringDecoder) StringDecoder = __webpack_require__(91).StringDecoder;
5441
+ this.decoder = new StringDecoder(options.encoding);
5442
+ this.encoding = options.encoding;
5443
+ }
5444
  }
5445
 
5446
+ function Readable(options) {
5447
+ Duplex = Duplex || __webpack_require__(32);
 
5448
 
5449
+ if (!(this instanceof Readable)) return new Readable(options);
 
5450
 
5451
+ this._readableState = new ReadableState(options, this);
 
 
 
 
 
 
 
5452
 
5453
+ // legacy
5454
+ this.readable = true;
5455
 
5456
+ if (options) {
5457
+ if (typeof options.read === 'function') this._read = options.read;
 
 
5458
 
5459
+ if (typeof options.destroy === 'function') this._destroy = options.destroy;
5460
+ }
 
 
 
5461
 
5462
+ Stream.call(this);
 
5463
  }
5464
 
5465
+ Object.defineProperty(Readable.prototype, 'destroyed', {
5466
+ get: function () {
5467
+ if (this._readableState === undefined) {
5468
+ return false;
5469
+ }
5470
+ return this._readableState.destroyed;
5471
+ },
5472
+ set: function (value) {
5473
+ // we ignore the value if the stream
5474
+ // has not been initialized yet
5475
+ if (!this._readableState) {
5476
+ return;
5477
+ }
5478
 
5479
+ // backward compatibility, the user is explicitly
5480
+ // managing destroyed
5481
+ this._readableState.destroyed = value;
5482
+ }
5483
+ });
5484
+
5485
+ Readable.prototype.destroy = destroyImpl.destroy;
5486
+ Readable.prototype._undestroy = destroyImpl.undestroy;
5487
+ Readable.prototype._destroy = function (err, cb) {
5488
+ this.push(null);
5489
+ cb(err);
5490
  };
5491
 
5492
+ // Manually shove something into the read() buffer.
5493
+ // This returns true if the highWaterMark has not been hit yet,
5494
+ // similar to how Writable.write() returns true if you should
5495
+ // write() some more.
5496
+ Readable.prototype.push = function (chunk, encoding) {
5497
+ var state = this._readableState;
5498
+ var skipChunkCheck;
5499
 
5500
+ if (!state.objectMode) {
5501
+ if (typeof chunk === 'string') {
5502
+ encoding = encoding || state.defaultEncoding;
5503
+ if (encoding !== state.encoding) {
5504
+ chunk = Buffer.from(chunk, encoding);
5505
+ encoding = '';
5506
+ }
5507
+ skipChunkCheck = true;
5508
+ }
5509
+ } else {
5510
+ skipChunkCheck = true;
5511
+ }
5512
 
5513
+ return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
 
5514
  };
5515
 
5516
+ // Unshift should *always* be something directly out of read()
5517
+ Readable.prototype.unshift = function (chunk) {
5518
+ return readableAddChunk(this, chunk, null, true, false);
5519
  };
5520
 
5521
+ function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
5522
+ var state = stream._readableState;
5523
+ if (chunk === null) {
5524
+ state.reading = false;
5525
+ onEofChunk(stream, state);
5526
+ } else {
5527
+ var er;
5528
+ if (!skipChunkCheck) er = chunkInvalid(state, chunk);
5529
+ if (er) {
5530
+ stream.emit('error', er);
5531
+ } else if (state.objectMode || chunk && chunk.length > 0) {
5532
+ if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
5533
+ chunk = _uint8ArrayToBuffer(chunk);
5534
+ }
5535
 
5536
+ if (addToFront) {
5537
+ if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
5538
+ } else if (state.ended) {
5539
+ stream.emit('error', new Error('stream.push() after EOF'));
5540
+ } else {
5541
+ state.reading = false;
5542
+ if (state.decoder && !encoding) {
5543
+ chunk = state.decoder.write(chunk);
5544
+ if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
5545
+ } else {
5546
+ addChunk(stream, state, chunk, false);
5547
+ }
5548
+ }
5549
+ } else if (!addToFront) {
5550
+ state.reading = false;
5551
+ }
5552
+ }
5553
 
5554
+ return needMoreData(state);
5555
+ }
 
5556
 
5557
+ function addChunk(stream, state, chunk, addToFront) {
5558
+ if (state.flowing && state.length === 0 && !state.sync) {
5559
+ stream.emit('data', chunk);
5560
+ stream.read(0);
5561
+ } else {
5562
+ // update the buffer info.
5563
+ state.length += state.objectMode ? 1 : chunk.length;
5564
+ if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
5565
 
5566
+ if (state.needReadable) emitReadable(stream);
5567
+ }
5568
+ maybeReadMore(stream, state);
5569
+ }
5570
 
5571
+ function chunkInvalid(state, chunk) {
5572
+ var er;
5573
+ if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
5574
+ er = new TypeError('Invalid non-string/buffer chunk');
5575
+ }
5576
+ return er;
5577
+ }
5578
 
5579
+ // if it's past the high water mark, we can push in some more.
5580
+ // Also, if we have no data yet, we can stand some
5581
+ // more bytes. This is to work around cases where hwm=0,
5582
+ // such as the repl. Also, if the push() triggered a
5583
+ // readable event, and the user called read(largeNumber) such that
5584
+ // needReadable was set, then we ought to push more, so that another
5585
+ // 'readable' event will be triggered.
5586
+ function needMoreData(state) {
5587
+ return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
5588
+ }
5589
 
5590
+ Readable.prototype.isPaused = function () {
5591
+ return this._readableState.flowing === false;
5592
+ };
5593
 
5594
+ // backwards compatibility.
5595
+ Readable.prototype.setEncoding = function (enc) {
5596
+ if (!StringDecoder) StringDecoder = __webpack_require__(91).StringDecoder;
5597
+ this._readableState.decoder = new StringDecoder(enc);
5598
+ this._readableState.encoding = enc;
5599
+ return this;
5600
  };
5601
 
5602
+ // Don't raise the hwm > 8MB
5603
+ var MAX_HWM = 0x800000;
5604
+ function computeNewHighWaterMark(n) {
5605
+ if (n >= MAX_HWM) {
5606
+ n = MAX_HWM;
5607
+ } else {
5608
+ // Get the next highest power of 2 to prevent increasing hwm excessively in
5609
+ // tiny amounts
5610
+ n--;
5611
+ n |= n >>> 1;
5612
+ n |= n >>> 2;
5613
+ n |= n >>> 4;
5614
+ n |= n >>> 8;
5615
+ n |= n >>> 16;
5616
+ n++;
5617
+ }
5618
+ return n;
5619
+ }
5620
 
5621
+ // This function is designed to be inlinable, so please take care when making
5622
+ // changes to the function body.
5623
+ function howMuchToRead(n, state) {
5624
+ if (n <= 0 || state.length === 0 && state.ended) return 0;
5625
+ if (state.objectMode) return 1;
5626
+ if (n !== n) {
5627
+ // Only flow one buffer at a time
5628
+ if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
5629
+ }
5630
+ // If we're asking for more than the current hwm, then raise the hwm.
5631
+ if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
5632
+ if (n <= state.length) return n;
5633
+ // Don't have enough
5634
+ if (!state.ended) {
5635
+ state.needReadable = true;
5636
+ return 0;
5637
+ }
5638
+ return state.length;
5639
+ }
5640
 
5641
+ // you can override either this method, or the async _read(n) below.
5642
+ Readable.prototype.read = function (n) {
5643
+ debug('read', n);
5644
+ n = parseInt(n, 10);
5645
+ var state = this._readableState;
5646
+ var nOrig = n;
5647
 
5648
+ if (n !== 0) state.emittedReadable = false;
 
5649
 
5650
+ // if we're doing read(0) to trigger a readable event, but we
5651
+ // already have a bunch of data in the buffer, then just trigger
5652
+ // the 'readable' event and move on.
5653
+ if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
5654
+ debug('read: emitReadable', state.length, state.ended);
5655
+ if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
5656
+ return null;
5657
+ }
5658
 
5659
+ n = howMuchToRead(n, state);
 
 
5660
 
5661
+ // if we've ended, and we're now clear, then finish it up.
5662
+ if (n === 0 && state.ended) {
5663
+ if (state.length === 0) endReadable(this);
5664
+ return null;
5665
+ }
5666
 
5667
+ // All the actual chunk generation logic needs to be
5668
+ // *below* the call to _read. The reason is that in certain
5669
+ // synthetic stream cases, such as passthrough streams, _read
5670
+ // may be a completely synchronous operation which may change
5671
+ // the state of the read buffer, providing enough data when
5672
+ // before there was *not* enough.
5673
+ //
5674
+ // So, the steps are:
5675
+ // 1. Figure out what the state of things will be after we do
5676
+ // a read from the buffer.
5677
+ //
5678
+ // 2. If that resulting state will trigger a _read, then call _read.
5679
+ // Note that this may be asynchronous, or synchronous. Yes, it is
5680
+ // deeply ugly to write APIs this way, but that still doesn't mean
5681
+ // that the Readable class should behave improperly, as streams are
5682
+ // designed to be sync/async agnostic.
5683
+ // Take note if the _read call is sync or async (ie, if the read call
5684
+ // has returned yet), so that we know whether or not it's safe to emit
5685
+ // 'readable' etc.
5686
+ //
5687
+ // 3. Actually pull the requested chunks out of the buffer and return.
5688
 
5689
+ // if we need a readable event, then we need to do some reading.
5690
+ var doRead = state.needReadable;
5691
+ debug('need readable', doRead);
 
 
 
5692
 
5693
+ // if we currently have less than the highWaterMark, then also read some
5694
+ if (state.length === 0 || state.length - n < state.highWaterMark) {
5695
+ doRead = true;
5696
+ debug('length less than watermark', doRead);
5697
+ }
 
 
 
 
5698
 
5699
+ // however, if we've ended, then there's no point, and if we're already
5700
+ // reading, then it's unnecessary.
5701
+ if (state.ended || state.reading) {
5702
+ doRead = false;
5703
+ debug('reading or ended', doRead);
5704
+ } else if (doRead) {
5705
+ debug('do read');
5706
+ state.reading = true;
5707
+ state.sync = true;
5708
+ // if the length is currently zero, then we *need* a readable event.
5709
+ if (state.length === 0) state.needReadable = true;
5710
+ // call internal read method
5711
+ this._read(state.highWaterMark);
5712
+ state.sync = false;
5713
+ // If _read pushed data synchronously, then `reading` will be false,
5714
+ // and we need to re-evaluate how much data we can return to the user.
5715
+ if (!state.reading) n = howMuchToRead(nOrig, state);
5716
+ }
5717
 
5718
+ var ret;
5719
+ if (n > 0) ret = fromList(n, state);else ret = null;
5720
 
5721
+ if (ret === null) {
5722
+ state.needReadable = true;
5723
+ n = 0;
5724
+ } else {
5725
+ state.length -= n;
5726
+ }
5727
 
5728
+ if (state.length === 0) {
5729
+ // If we have nothing in the buffer, then we want to know
5730
+ // as soon as we *do* get something into the buffer.
5731
+ if (!state.ended) state.needReadable = true;
5732
 
5733
+ // If we tried to read() past the EOF, then emit end on the next tick.
5734
+ if (nOrig !== n && state.ended) endReadable(this);
5735
+ }
5736
 
5737
+ if (ret !== null) this.emit('data', ret);
5738
 
5739
+ return ret;
 
 
 
 
 
 
5740
  };
5741
 
5742
+ function onEofChunk(stream, state) {
5743
+ if (state.ended) return;
5744
+ if (state.decoder) {
5745
+ var chunk = state.decoder.end();
5746
+ if (chunk && chunk.length) {
5747
+ state.buffer.push(chunk);
5748
+ state.length += state.objectMode ? 1 : chunk.length;
5749
+ }
5750
+ }
5751
+ state.ended = true;
5752
 
5753
+ // emit 'readable' now to make sure it gets picked up.
5754
+ emitReadable(stream);
 
 
5755
  }
5756
 
5757
+ // Don't emit readable right away in sync mode, because this can trigger
5758
+ // another read() call => stack overflow. This way, it might trigger
5759
+ // a nextTick recursion warning, but that's not so bad.
5760
+ function emitReadable(stream) {
5761
+ var state = stream._readableState;
5762
+ state.needReadable = false;
5763
+ if (!state.emittedReadable) {
5764
+ debug('emitReadable', state.flowing);
5765
+ state.emittedReadable = true;
5766
+ if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);
5767
+ }
 
 
 
 
 
 
 
 
5768
  }
5769
 
5770
+ function emitReadable_(stream) {
5771
+ debug('emit readable');
5772
+ stream.emit('readable');
5773
+ flow(stream);
 
 
5774
  }
5775
 
5776
+ // at this point, the user has presumably seen the 'readable' event,
5777
+ // and called read() to consume some data. that may have triggered
5778
+ // in turn another _read(n) call, in which case reading = true if
5779
+ // it's in progress.
5780
+ // However, if we're not ended, or reading, and the length < hwm,
5781
+ // then go ahead and try to read some more preemptively.
5782
+ function maybeReadMore(stream, state) {
5783
+ if (!state.readingMore) {
5784
+ state.readingMore = true;
5785
+ processNextTick(maybeReadMore_, stream, state);
5786
+ }
 
 
 
5787
  }
5788
 
5789
+ function maybeReadMore_(stream, state) {
5790
+ var len = state.length;
5791
+ while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
5792
+ debug('maybeReadMore read 0');
5793
+ stream.read(0);
5794
+ if (len === state.length)
5795
+ // didn't get any data, stop spinning.
5796
+ break;else len = state.length;
5797
+ }
5798
+ state.readingMore = false;
 
 
 
 
 
5799
  }
5800
 
5801
+ // abstract method. to be overridden in specific implementation classes.
5802
+ // call cb(er, data) where data is <= n in length.
5803
+ // for virtual (non-string, non-buffer) streams, "length" is somewhat
5804
+ // arbitrary, and perhaps not very meaningful.
5805
+ Readable.prototype._read = function (n) {
5806
+ this.emit('error', new Error('_read() is not implemented'));
5807
+ };
 
 
 
 
 
 
 
 
 
 
5808
 
5809
+ Readable.prototype.pipe = function (dest, pipeOpts) {
5810
+ var src = this;
5811
+ var state = this._readableState;
5812
 
5813
+ switch (state.pipesCount) {
5814
+ case 0:
5815
+ state.pipes = dest;
5816
+ break;
5817
+ case 1:
5818
+ state.pipes = [state.pipes, dest];
5819
+ break;
5820
+ default:
5821
+ state.pipes.push(dest);
5822
+ break;
5823
+ }
5824
+ state.pipesCount += 1;
5825
+ debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
5826
 
5827
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
 
5828
 
5829
+ var endFn = doEnd ? onend : unpipe;
5830
+ if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);
5831
 
5832
+ dest.on('unpipe', onunpipe);
5833
+ function onunpipe(readable, unpipeInfo) {
5834
+ debug('onunpipe');
5835
+ if (readable === src) {
5836
+ if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
5837
+ unpipeInfo.hasUnpiped = true;
5838
+ cleanup();
5839
+ }
5840
+ }
5841
+ }
 
 
 
 
 
 
 
 
 
5842
 
5843
+ function onend() {
5844
+ debug('onend');
5845
+ dest.end();
5846
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5847
 
5848
+ // when the dest drains, it reduces the awaitDrain counter
5849
+ // on the source. This would be more elegant with a .once()
5850
+ // handler in flow(), but adding and removing repeatedly is
5851
+ // too slow.
5852
+ var ondrain = pipeOnDrain(src);
5853
+ dest.on('drain', ondrain);
 
5854
 
5855
+ var cleanedUp = false;
5856
+ function cleanup() {
5857
+ debug('cleanup');
5858
+ // cleanup event handlers once the pipe is broken
5859
+ dest.removeListener('close', onclose);
5860
+ dest.removeListener('finish', onfinish);
5861
+ dest.removeListener('drain', ondrain);
5862
+ dest.removeListener('error', onerror);
5863
+ dest.removeListener('unpipe', onunpipe);
5864
+ src.removeListener('end', onend);
5865
+ src.removeListener('end', unpipe);
5866
+ src.removeListener('data', ondata);
5867
 
5868
+ cleanedUp = true;
 
 
 
 
5869
 
5870
+ // if the reader is waiting for a drain event from this
5871
+ // specific writer, then it would cause it to never start
5872
+ // flowing again.
5873
+ // So, if this is awaiting a drain, then we just call it now.
5874
+ // If we don't know, then assume that we are waiting for one.
5875
+ if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
5876
+ }
5877
 
5878
+ // If the user pushes more data while we're writing to dest then we'll end up
5879
+ // in ondata again. However, we only want to increase awaitDrain once because
5880
+ // dest will only emit one 'drain' event for the multiple writes.
5881
+ // => Introduce a guard on increasing awaitDrain.
5882
+ var increasedAwaitDrain = false;
5883
+ src.on('data', ondata);
5884
+ function ondata(chunk) {
5885
+ debug('ondata');
5886
+ increasedAwaitDrain = false;
5887
+ var ret = dest.write(chunk);
5888
+ if (false === ret && !increasedAwaitDrain) {
5889
+ // If the user unpiped during `dest.write()`, it is possible
5890
+ // to get stuck in a permanently paused state if that write
5891
+ // also returned false.
5892
+ // => Check whether `dest` is still a piping destination.
5893
+ if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
5894
+ debug('false write response, pause', src._readableState.awaitDrain);
5895
+ src._readableState.awaitDrain++;
5896
+ increasedAwaitDrain = true;
5897
+ }
5898
+ src.pause();
5899
+ }
5900
+ }
5901
 
5902
+ // if the dest has an error, then stop piping into it.
5903
+ // however, don't suppress the throwing behavior for this.
5904
+ function onerror(er) {
5905
+ debug('onerror', er);
5906
+ unpipe();
5907
+ dest.removeListener('error', onerror);
5908
+ if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
5909
+ }
5910
 
5911
+ // Make sure our error handler is attached before userland ones.
5912
+ prependListener(dest, 'error', onerror);
5913
+
5914
+ // Both close and finish should trigger unpipe, but only once.
5915
+ function onclose() {
5916
+ dest.removeListener('finish', onfinish);
5917
+ unpipe();
5918
+ }
5919
+ dest.once('close', onclose);
5920
+ function onfinish() {
5921
+ debug('onfinish');
5922
+ dest.removeListener('close', onclose);
5923
+ unpipe();
5924
+ }
5925
+ dest.once('finish', onfinish);
5926
+
5927
+ function unpipe() {
5928
+ debug('unpipe');
5929
+ src.unpipe(dest);
5930
+ }
5931
+
5932
+ // tell the dest that it's being piped to
5933
+ dest.emit('pipe', src);
5934
+
5935
+ // start the flow if it hasn't been started already.
5936
+ if (!state.flowing) {
5937
+ debug('pipe resume');
5938
+ src.resume();
5939
+ }
5940
+
5941
+ return dest;
5942
  };
5943
 
5944
+ function pipeOnDrain(src) {
5945
+ return function () {
5946
+ var state = src._readableState;
5947
+ debug('pipeOnDrain', state.awaitDrain);
5948
+ if (state.awaitDrain) state.awaitDrain--;
5949
+ if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
5950
+ state.flowing = true;
5951
+ flow(src);
5952
+ }
5953
+ };
5954
+ }
5955
 
5956
+ Readable.prototype.unpipe = function (dest) {
5957
+ var state = this._readableState;
5958
+ var unpipeInfo = { hasUnpiped: false };
5959
 
5960
+ // if we're not piping anywhere, then do nothing.
5961
+ if (state.pipesCount === 0) return this;
5962
 
5963
+ // just one destination. most common case.
5964
+ if (state.pipesCount === 1) {
5965
+ // passed in one, but it's not the right one.
5966
+ if (dest && dest !== state.pipes) return this;
5967
 
5968
+ if (!dest) dest = state.pipes;
 
 
 
5969
 
5970
+ // got a match.
5971
+ state.pipes = null;
5972
+ state.pipesCount = 0;
5973
+ state.flowing = false;
5974
+ if (dest) dest.emit('unpipe', this, unpipeInfo);
5975
+ return this;
5976
+ }
5977
 
5978
+ // slow case. multiple pipe destinations.
 
 
 
 
 
 
 
5979
 
5980
+ if (!dest) {
5981
+ // remove all.
5982
+ var dests = state.pipes;
5983
+ var len = state.pipesCount;
5984
+ state.pipes = null;
5985
+ state.pipesCount = 0;
5986
+ state.flowing = false;
5987
 
5988
+ for (var i = 0; i < len; i++) {
5989
+ dests[i].emit('unpipe', this, unpipeInfo);
5990
+ }return this;
5991
+ }
5992
 
5993
+ // try to find the right one.
5994
+ var index = indexOf(state.pipes, dest);
5995
+ if (index === -1) return this;
5996
+
5997
+ state.pipes.splice(index, 1);
5998
+ state.pipesCount -= 1;
5999
+ if (state.pipesCount === 1) state.pipes = state.pipes[0];
6000
+
6001
+ dest.emit('unpipe', this, unpipeInfo);
6002
+
6003
+ return this;
6004
  };
6005
 
6006
+ // set up data events if they are asked for
6007
+ // Ensure readable listeners eventually get something
6008
+ Readable.prototype.on = function (ev, fn) {
6009
+ var res = Stream.prototype.on.call(this, ev, fn);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6010
 
6011
+ if (ev === 'data') {
6012
+ // Start flowing on next tick if stream isn't explicitly paused
6013
+ if (this._readableState.flowing !== false) this.resume();
6014
+ } else if (ev === 'readable') {
6015
+ var state = this._readableState;
6016
+ if (!state.endEmitted && !state.readableListening) {
6017
+ state.readableListening = state.needReadable = true;
6018
+ state.emittedReadable = false;
6019
+ if (!state.reading) {
6020
+ processNextTick(nReadingNextTick, this);
6021
+ } else if (state.length) {
6022
+ emitReadable(this);
6023
+ }
6024
+ }
6025
+ }
6026
 
6027
+ return res;
6028
+ };
6029
+ Readable.prototype.addListener = Readable.prototype.on;
6030
 
6031
+ function nReadingNextTick(self) {
6032
+ debug('readable nexttick read 0');
6033
+ self.read(0);
6034
+ }
6035
 
6036
+ // pause() and resume() are remnants of the legacy readable stream API
6037
+ // If the user uses them, then switch into old mode.
6038
+ Readable.prototype.resume = function () {
6039
+ var state = this._readableState;
6040
+ if (!state.flowing) {
6041
+ debug('resume');
6042
+ state.flowing = true;
6043
+ resume(this, state);
6044
+ }
6045
+ return this;
 
6046
  };
6047
 
6048
+ function resume(stream, state) {
6049
+ if (!state.resumeScheduled) {
6050
+ state.resumeScheduled = true;
6051
+ processNextTick(resume_, stream, state);
6052
+ }
6053
+ }
 
 
 
6054
 
6055
+ function resume_(stream, state) {
6056
+ if (!state.reading) {
6057
+ debug('resume read 0');
6058
+ stream.read(0);
6059
+ }
6060
 
6061
+ state.resumeScheduled = false;
6062
+ state.awaitDrain = 0;
6063
+ stream.emit('resume');
6064
+ flow(stream);
6065
+ if (state.flowing && !state.reading) stream.read(0);
6066
+ }
 
 
 
 
 
 
 
 
 
 
6067
 
6068
+ Readable.prototype.pause = function () {
6069
+ debug('call pause flowing=%j', this._readableState.flowing);
6070
+ if (false !== this._readableState.flowing) {
6071
+ debug('pause');
6072
+ this._readableState.flowing = false;
6073
+ this.emit('pause');
6074
+ }
6075
+ return this;
6076
  };
6077
 
6078
+ function flow(stream) {
6079
+ var state = stream._readableState;
6080
+ debug('flow', state.flowing);
6081
+ while (state.flowing && stream.read() !== null) {}
6082
+ }
6083
 
6084
+ // wrap an old-style stream as the async data source.
6085
+ // This is *not* part of the readable stream interface.
6086
+ // It is an ugly unfortunate mess of history.
6087
+ Readable.prototype.wrap = function (stream) {
6088
+ var state = this._readableState;
6089
+ var paused = false;
6090
 
6091
+ var self = this;
6092
+ stream.on('end', function () {
6093
+ debug('wrapped end');
6094
+ if (state.decoder && !state.ended) {
6095
+ var chunk = state.decoder.end();
6096
+ if (chunk && chunk.length) self.push(chunk);
6097
+ }
6098
 
6099
+ self.push(null);
6100
+ });
6101
 
6102
+ stream.on('data', function (chunk) {
6103
+ debug('wrapped data');
6104
+ if (state.decoder) chunk = state.decoder.write(chunk);
 
6105
 
6106
+ // don't skip over falsy values in objectMode
6107
+ if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6108
 
6109
+ var ret = self.push(chunk);
6110
+ if (!ret) {
6111
+ paused = true;
6112
+ stream.pause();
6113
+ }
6114
+ });
6115
 
6116
+ // proxy all the other methods.
6117
+ // important when wrapping filters and duplexes.
6118
+ for (var i in stream) {
6119
+ if (this[i] === undefined && typeof stream[i] === 'function') {
6120
+ this[i] = function (method) {
6121
+ return function () {
6122
+ return stream[method].apply(stream, arguments);
6123
+ };
6124
+ }(i);
6125
+ }
6126
+ }
6127
 
6128
+ // proxy certain important events.
6129
+ for (var n = 0; n < kProxyEvents.length; n++) {
6130
+ stream.on(kProxyEvents[n], self.emit.bind(self, kProxyEvents[n]));
6131
+ }
6132
 
6133
+ // when we try to consume some more bytes, simply unpause the
6134
+ // underlying stream.
6135
+ self._read = function (n) {
6136
+ debug('wrapped _read', n);
6137
+ if (paused) {
6138
+ paused = false;
6139
+ stream.resume();
6140
+ }
6141
+ };
6142
 
6143
+ return self;
 
 
 
 
 
 
 
 
6144
  };
6145
 
6146
+ // exposed for testing purposes only.
6147
+ Readable._fromList = fromList;
6148
 
6149
+ // Pluck off n bytes from an array of buffers.
6150
+ // Length is the combined lengths of all the buffers in the list.
6151
+ // This function is designed to be inlinable, so please take care when making
6152
+ // changes to the function body.
6153
+ function fromList(n, state) {
6154
+ // nothing buffered
6155
+ if (state.length === 0) return null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6156
 
6157
+ var ret;
6158
+ if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
6159
+ // read it all, truncate the list
6160
+ if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
6161
+ state.buffer.clear();
6162
+ } else {
6163
+ // read part of list
6164
+ ret = fromListPartial(n, state.buffer, state.decoder);
6165
+ }
6166
 
6167
+ return ret;
6168
+ }
 
6169
 
6170
+ // Extracts only enough buffered data to satisfy the amount requested.
6171
+ // This function is designed to be inlinable, so please take care when making
6172
+ // changes to the function body.
6173
+ function fromListPartial(n, list, hasStrings) {
6174
+ var ret;
6175
+ if (n < list.head.data.length) {
6176
+ // slice is the same for buffers and strings
6177
+ ret = list.head.data.slice(0, n);
6178
+ list.head.data = list.head.data.slice(n);
6179
+ } else if (n === list.head.data.length) {
6180
+ // first chunk is a perfect match
6181
+ ret = list.shift();
6182
+ } else {
6183
+ // result spans more than one buffer
6184
+ ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
6185
+ }
6186
+ return ret;
6187
+ }
6188
 
6189
+ // Copies a specified amount of characters from the list of buffered data
6190
+ // chunks.
6191
+ // This function is designed to be inlinable, so please take care when making
6192
+ // changes to the function body.
6193
+ function copyFromBufferString(n, list) {
6194
+ var p = list.head;
6195
+ var c = 1;
6196
+ var ret = p.data;
6197
+ n -= ret.length;
6198
+ while (p = p.next) {
6199
+ var str = p.data;
6200
+ var nb = n > str.length ? str.length : n;
6201
+ if (nb === str.length) ret += str;else ret += str.slice(0, n);
6202
+ n -= nb;
6203
+ if (n === 0) {
6204
+ if (nb === str.length) {
6205
+ ++c;
6206
+ if (p.next) list.head = p.next;else list.head = list.tail = null;
6207
+ } else {
6208
+ list.head = p;
6209
+ p.data = str.slice(nb);
6210
+ }
6211
+ break;
6212
+ }
6213
+ ++c;
6214
+ }
6215
+ list.length -= c;
6216
+ return ret;
6217
+ }
6218
 
6219
+ // Copies a specified amount of bytes from the list of buffered data chunks.
6220
+ // This function is designed to be inlinable, so please take care when making
6221
+ // changes to the function body.
6222
+ function copyFromBuffer(n, list) {
6223
+ var ret = Buffer.allocUnsafe(n);
6224
+ var p = list.head;
6225
+ var c = 1;
6226
+ p.data.copy(ret);
6227
+ n -= p.data.length;
6228
+ while (p = p.next) {
6229
+ var buf = p.data;
6230
+ var nb = n > buf.length ? buf.length : n;
6231
+ buf.copy(ret, ret.length - n, 0, nb);
6232
+ n -= nb;
6233
+ if (n === 0) {
6234
+ if (nb === buf.length) {
6235
+ ++c;
6236
+ if (p.next) list.head = p.next;else list.head = list.tail = null;
6237
+ } else {
6238
+ list.head = p;
6239
+ p.data = buf.slice(nb);
6240
+ }
6241
+ break;
6242
+ }
6243
+ ++c;
6244
+ }
6245
+ list.length -= c;
6246
+ return ret;
6247
+ }
6248
 
6249
+ function endReadable(stream) {
6250
+ var state = stream._readableState;
6251
 
6252
+ // If we get here before consuming all the bytes, then that is a
6253
+ // bug in node. Should never happen.
6254
+ if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
6255
 
6256
+ if (!state.endEmitted) {
6257
+ state.ended = true;
6258
+ processNextTick(endReadableNT, state, stream);
6259
+ }
6260
+ }
6261
 
6262
+ function endReadableNT(state, stream) {
6263
+ // Check that we didn't get one last unshift.
6264
+ if (!state.endEmitted && state.length === 0) {
6265
+ state.endEmitted = true;
6266
+ stream.readable = false;
6267
+ stream.emit('end');
6268
+ }
6269
+ }
6270
 
6271
+ function forEach(xs, f) {
6272
+ for (var i = 0, l = xs.length; i < l; i++) {
6273
+ f(xs[i], i);
6274
+ }
6275
+ }
6276
 
6277
+ function indexOf(xs, x) {
6278
+ for (var i = 0, l = xs.length; i < l; i++) {
6279
+ if (xs[i] === x) return i;
6280
+ }
6281
+ return -1;
6282
+ }
6283
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9), __webpack_require__(1)))
6284
 
6285
+ /***/ }),
6286
+ /* 265 */
6287
+ /***/ (function(module, exports) {
6288
 
6289
+ var toString = {}.toString;
6290
 
6291
+ module.exports = Array.isArray || function (arr) {
6292
+ return toString.call(arr) == '[object Array]';
6293
+ };
 
 
6294
 
 
6295
 
6296
  /***/ }),
6297
+ /* 266 */
 
6298
  /***/ (function(module, exports, __webpack_require__) {
6299
 
6300
+ module.exports = __webpack_require__(55).EventEmitter;
 
 
 
 
 
 
 
 
 
 
 
 
 
6301
 
 
 
 
6302
 
6303
  /***/ }),
6304
+ /* 267 */
 
6305
  /***/ (function(module, exports, __webpack_require__) {
6306
 
6307
  "use strict";
6308
 
6309
 
6310
+ /*<replacement>*/
 
 
 
 
 
6311
 
6312
+ var processNextTick = __webpack_require__(56);
6313
+ /*</replacement>*/
6314
 
6315
+ // undocumented cb() API, needed for core, not for public API
6316
+ function destroy(err, cb) {
6317
+ var _this = this;
6318
 
6319
+ var readableDestroyed = this._readableState && this._readableState.destroyed;
6320
+ var writableDestroyed = this._writableState && this._writableState.destroyed;
6321
 
6322
+ if (readableDestroyed || writableDestroyed) {
6323
+ if (cb) {
6324
+ cb(err);
6325
+ } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
6326
+ processNextTick(emitErrorNT, this, err);
6327
+ }
6328
+ return;
6329
+ }
6330
 
6331
+ // we set destroyed to true before firing error callbacks in order
6332
+ // to make it re-entrance safe in case destroy() is called within callbacks
6333
 
6334
+ if (this._readableState) {
6335
+ this._readableState.destroyed = true;
6336
+ }
6337
 
6338
+ // if this is a duplex stream mark the writable part as destroyed as well
6339
+ if (this._writableState) {
6340
+ this._writableState.destroyed = true;
6341
+ }
6342
 
6343
+ this._destroy(err || null, function (err) {
6344
+ if (!cb && err) {
6345
+ processNextTick(emitErrorNT, _this, err);
6346
+ if (_this._writableState) {
6347
+ _this._writableState.errorEmitted = true;
6348
+ }
6349
+ } else if (cb) {
6350
+ cb(err);
6351
+ }
6352
+ });
6353
+ }
6354
 
6355
+ function undestroy() {
6356
+ if (this._readableState) {
6357
+ this._readableState.destroyed = false;
6358
+ this._readableState.reading = false;
6359
+ this._readableState.ended = false;
6360
+ this._readableState.endEmitted = false;
6361
+ }
6362
 
6363
+ if (this._writableState) {
6364
+ this._writableState.destroyed = false;
6365
+ this._writableState.ended = false;
6366
+ this._writableState.ending = false;
6367
+ this._writableState.finished = false;
6368
+ this._writableState.errorEmitted = false;
6369
+ }
6370
+ }
6371
 
6372
+ function emitErrorNT(self, err) {
6373
+ self.emit('error', err);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6374
  }
6375
 
6376
+ module.exports = {
6377
+ destroy: destroy,
6378
+ undestroy: undestroy
6379
+ };
6380
 
6381
+ /***/ }),
6382
+ /* 268 */,
6383
+ /* 269 */
6384
  /***/ (function(module, exports, __webpack_require__) {
6385
 
6386
  "use strict";
6387
+ // Copyright Joyent, Inc. and other Node contributors.
6388
+ //
6389
+ // Permission is hereby granted, free of charge, to any person obtaining a
6390
+ // copy of this software and associated documentation files (the
6391
+ // "Software"), to deal in the Software without restriction, including
6392
+ // without limitation the rights to use, copy, modify, merge, publish,
6393
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
6394
+ // persons to whom the Software is furnished to do so, subject to the
6395
+ // following conditions:
6396
+ //
6397
+ // The above copyright notice and this permission notice shall be included
6398
+ // in all copies or substantial portions of the Software.
6399
+ //
6400
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
6401
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
6402
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
6403
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
6404
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
6405
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
6406
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
6407
 
6408
+ // a transform stream is a readable/writable stream where you do
6409
+ // something with the data. Sometimes it's called a "filter",
6410
+ // but that's not a great name for it, since that implies a thing where
6411
+ // some bits pass through, and others are simply ignored. (That would
6412
+ // be a valid example of a transform, of course.)
6413
+ //
6414
+ // While the output is causally related to the input, it's not a
6415
+ // necessarily symmetric or synchronous transformation. For example,
6416
+ // a zlib stream might take multiple plain-text writes(), and then
6417
+ // emit a single compressed chunk some time in the future.
6418
+ //
6419
+ // Here's how this works:
6420
+ //
6421
+ // The Transform stream has all the aspects of the readable and writable
6422
+ // stream classes. When you write(chunk), that calls _write(chunk,cb)
6423
+ // internally, and returns false if there's a lot of pending writes
6424
+ // buffered up. When you call read(), that calls _read(n) until
6425
+ // there's enough pending readable data buffered up.
6426
+ //
6427
+ // In a transform stream, the written data is placed in a buffer. When
6428
+ // _read(n) is called, it transforms the queued up data, calling the
6429
+ // buffered _write cb's as it consumes chunks. If consuming a single
6430
+ // written chunk would result in multiple output chunks, then the first
6431
+ // outputted bit calls the readcb, and subsequent chunks just go into
6432
+ // the read buffer, and will cause it to emit 'readable' if necessary.
6433
+ //
6434
+ // This way, back-pressure is actually determined by the reading side,
6435
+ // since _read has to be called to start processing a new chunk. However,
6436
+ // a pathological inflate type of transform can cause excessive buffering
6437
+ // here. For example, imagine a stream where every byte of input is
6438
+ // interpreted as an integer from 0-255, and then results in that many
6439
+ // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
6440
+ // 1kb of data being output. In this case, you could write a very small
6441
+ // amount of input, and end up with a very large amount of output. In
6442
+ // such a pathological inflating mechanism, there'd be no way to tell
6443
+ // the system to stop doing the transform. A single 4MB write could
6444
+ // cause the system to run out of memory.
6445
+ //
6446
+ // However, even in such a pathological case, only a single written chunk
6447
+ // would be consumed, and then the rest would wait (un-transformed) until
6448
+ // the results of the previous transformed chunk were consumed.
6449
 
 
 
 
 
6450
 
 
6451
 
6452
+ module.exports = Transform;
6453
 
6454
+ var Duplex = __webpack_require__(32);
6455
 
6456
+ /*<replacement>*/
6457
+ var util = __webpack_require__(46);
6458
+ util.inherits = __webpack_require__(22);
6459
+ /*</replacement>*/
6460
 
6461
+ util.inherits(Transform, Duplex);
6462
 
6463
+ function TransformState(stream) {
6464
+ this.afterTransform = function (er, data) {
6465
+ return afterTransform(stream, er, data);
6466
+ };
 
 
 
 
6467
 
6468
+ this.needTransform = false;
6469
+ this.transforming = false;
6470
+ this.writecb = null;
6471
+ this.writechunk = null;
6472
+ this.writeencoding = null;
6473
+ }
 
 
6474
 
6475
+ function afterTransform(stream, er, data) {
6476
+ var ts = stream._transformState;
6477
+ ts.transforming = false;
6478
 
6479
+ var cb = ts.writecb;
 
 
 
 
 
 
 
6480
 
6481
+ if (!cb) {
6482
+ return stream.emit('error', new Error('write callback called multiple times'));
6483
+ }
6484
 
6485
+ ts.writechunk = null;
6486
+ ts.writecb = null;
6487
 
6488
+ if (data !== null && data !== undefined) stream.push(data);
 
6489
 
6490
+ cb(er);
 
6491
 
6492
+ var rs = stream._readableState;
6493
+ rs.reading = false;
6494
+ if (rs.needReadable || rs.length < rs.highWaterMark) {
6495
+ stream._read(rs.highWaterMark);
6496
+ }
6497
  }
6498
 
6499
+ function Transform(options) {
6500
+ if (!(this instanceof Transform)) return new Transform(options);
6501
 
6502
+ Duplex.call(this, options);
 
6503
 
6504
+ this._transformState = new TransformState(this);
6505
 
6506
+ var stream = this;
6507
 
6508
+ // start out asking for a readable event once data is transformed.
6509
+ this._readableState.needReadable = true;
 
 
 
 
 
 
 
 
 
 
6510
 
6511
+ // we have implemented the _read method, and done the other things
6512
+ // that Readable wants before the first _read call, so unset the
6513
+ // sync guard flag.
6514
+ this._readableState.sync = false;
6515
 
6516
+ if (options) {
6517
+ if (typeof options.transform === 'function') this._transform = options.transform;
6518
 
6519
+ if (typeof options.flush === 'function') this._flush = options.flush;
6520
+ }
6521
 
6522
+ // When the writable side finishes, then flush out anything remaining.
6523
+ this.once('prefinish', function () {
6524
+ if (typeof this._flush === 'function') this._flush(function (er, data) {
6525
+ done(stream, er, data);
6526
+ });else done(stream);
6527
+ });
6528
+ }
6529
 
6530
+ Transform.prototype.push = function (chunk, encoding) {
6531
+ this._transformState.needTransform = false;
6532
+ return Duplex.prototype.push.call(this, chunk, encoding);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6533
  };
6534
 
6535
+ // This is the part where you do stuff!
6536
+ // override this function in implementation classes.
6537
+ // 'chunk' is an input chunk.
6538
+ //
6539
+ // Call `push(newChunk)` to pass along transformed output
6540
+ // to the readable side. You may call 'push' zero or more times.
6541
+ //
6542
+ // Call `cb(err)` when you are done with this chunk. If you pass
6543
+ // an error, then that'll put the hurt on the whole operation. If you
6544
+ // never call cb(), then you'll never get another chunk.
6545
+ Transform.prototype._transform = function (chunk, encoding, cb) {
6546
+ throw new Error('_transform() is not implemented');
6547
+ };
 
 
 
 
 
 
 
 
 
 
 
6548
 
6549
+ Transform.prototype._write = function (chunk, encoding, cb) {
6550
+ var ts = this._transformState;
6551
+ ts.writecb = cb;
6552
+ ts.writechunk = chunk;
6553
+ ts.writeencoding = encoding;
6554
+ if (!ts.transforming) {
6555
+ var rs = this._readableState;
6556
+ if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
6557
  }
6558
+ };
6559
 
6560
+ // Doesn't matter what the args are here.
6561
+ // _transform does all the work.
6562
+ // That we got here means that the readable side wants more data.
6563
+ Transform.prototype._read = function (n) {
6564
+ var ts = this._transformState;
6565
 
6566
+ if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
6567
+ ts.transforming = true;
6568
+ this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
6569
+ } else {
6570
+ // mark that we need a transform, so that any data that comes in
6571
+ // will get processed, now that we've asked for it.
6572
+ ts.needTransform = true;
6573
+ }
6574
+ };
6575
 
6576
+ Transform.prototype._destroy = function (err, cb) {
6577
+ var _this = this;
 
6578
 
6579
+ Duplex.prototype._destroy.call(this, err, function (err2) {
6580
+ cb(err2);
6581
+ _this.emit('close');
6582
+ });
6583
+ };
6584
 
6585
+ function done(stream, er, data) {
6586
+ if (er) return stream.emit('error', er);
6587
 
6588
+ if (data !== null && data !== undefined) stream.push(data);
6589
 
6590
+ // if there's nothing in the write buffer, then that means
6591
+ // that nothing more will ever be provided
6592
+ var ws = stream._writableState;
6593
+ var ts = stream._transformState;
6594
 
6595
+ if (ws.length) throw new Error('Calling transform done when ws.length != 0');
 
 
 
 
 
 
 
6596
 
6597
+ if (ts.transforming) throw new Error('Calling transform done when still transforming');
 
6598
 
6599
+ return stream.push(null);
 
6600
  }
6601
 
6602
  /***/ }),
6603
+ /* 270 */
 
6604
  /***/ (function(module, exports, __webpack_require__) {
6605
 
6606
  "use strict";
6609
  Object.defineProperty(exports, "__esModule", {
6610
  value: true
6611
  });
6612
+ exports.default = ProcessNodes;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6613
 
6614
+ var _elementTypes = __webpack_require__(451);
 
6615
 
6616
+ var _elementTypes2 = _interopRequireDefault(_elementTypes);
6617
 
6618
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6619
 
 
 
 
6620
  /**
6621
+ * Tests a htmlparser2 node and returns whether is it a text node at the start and end of the line containing only
6622
+ * white space. This allows these node types to be excluded from the rendering because they are unnecessary.
6623
+ *
6624
+ * @param {Object} node The element object as created by htmlparser2
6625
+ * @returns {boolean} Whether
6626
  */
6627
+ var filterOutEmptyTextNodes = function filterOutEmptyTextNodes(node) {
6628
+ return !(node.type === 'text' && /\r?\n/.test(node.data) && node.data.trim() === '');
6629
+ };
6630
 
6631
+ /**
6632
+ * Converts a htmlparser2 node to a React element
6633
+ *
6634
+ * @param {Object} node The htmlparser2 node to convert
6635
+ * @param {Number} index The index of the current node
6636
+ * @returns {React.Element}
6637
+ */
6638
+ var convertNodeToElement = function convertNodeToElement(node, index) {
6639
+ var key = 'rhp-' + index;
6640
+ return _elementTypes2.default[node.type](node, key);
6641
+ };
6642
 
6643
+ /**
6644
+ * Processes the nodes generated by htmlparser2 and convert them all into React elements
6645
+ *
6646
+ * @param {Object[]} nodes List of nodes to process
6647
+ * @returns {React.Element[]} The list of processed React elements
6648
+ */
6649
+ function ProcessNodes(nodes) {
6650
+
6651
+ return nodes.filter(filterOutEmptyTextNodes).map(function (node, index) {
6652
+ return convertNodeToElement(node, index);
6653
+ });
6654
+ }
6655
+
6656
+ /***/ }),
6657
+ /* 271 */
6658
  /***/ (function(module, exports, __webpack_require__) {
6659
 
6660
  "use strict";
6663
  Object.defineProperty(exports, "__esModule", {
6664
  value: true
6665
  });
 
6666
 
6667
+ var _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; };
6668
 
6669
+ exports.default = GeneratePropsFromAttributes;
6670
 
6671
+ var _HtmlAttributesToReact = __webpack_require__(454);
6672
 
6673
+ var _HtmlAttributesToReact2 = _interopRequireDefault(_HtmlAttributesToReact);
6674
+
6675
+ var _InlineStyleToObject = __webpack_require__(457);
6676
+
6677
+ var _InlineStyleToObject2 = _interopRequireDefault(_InlineStyleToObject);
6678
 
6679
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6680
 
6681
  /**
6682
+ * Generates props for a React element from an object of HTML attributes
6683
  *
6684
+ * @param {Object} attributes The HTML attributes
6685
+ * @param {String} key The key to give the react element
 
6686
  */
6687
+ function GeneratePropsFromAttributes(attributes, key) {
 
 
 
 
 
 
 
6688
 
6689
  // generate props
6690
+ var props = _extends({}, (0, _HtmlAttributesToReact2.default)(attributes), { key: key });
6691
 
6692
+ // if there is a style prop then convert it to a React style object
6693
+ if (props.style) {
6694
+ props.style = (0, _InlineStyleToObject2.default)(props.style);
6695
+ }
6696
+
6697
+ return props;
6698
  }
6699
 
6700
  /***/ }),
6701
+ /* 272 */,
6702
+ /* 273 */,
6703
+ /* 274 */,
6704
+ /* 275 */,
6705
+ /* 276 */,
6706
+ /* 277 */,
6707
+ /* 278 */,
6708
+ /* 279 */,
6709
+ /* 280 */,
6710
+ /* 281 */,
6711
+ /* 282 */,
6712
+ /* 283 */,
6713
+ /* 284 */,
6714
+ /* 285 */,
6715
+ /* 286 */,
6716
+ /* 287 */,
6717
+ /* 288 */,
6718
+ /* 289 */,
6719
+ /* 290 */,
6720
+ /* 291 */,
6721
+ /* 292 */,
6722
+ /* 293 */,
6723
+ /* 294 */
6724
  /***/ (function(module, exports, __webpack_require__) {
6725
 
6726
+ "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6727
 
 
 
6728
 
6729
+ var _propTypes = __webpack_require__(3);
 
 
 
 
 
 
6730
 
6731
+ var _propTypes2 = _interopRequireDefault(_propTypes);
 
 
 
6732
 
6733
+ var _react = __webpack_require__(2);
 
 
 
6734
 
6735
+ var _react2 = _interopRequireDefault(_react);
 
 
 
6736
 
6737
+ var _reactRouter = __webpack_require__(26);
 
 
 
6738
 
6739
+ var _classnames = __webpack_require__(18);
 
 
 
6740
 
6741
+ var _classnames2 = _interopRequireDefault(_classnames);
 
 
 
6742
 
6743
+ var _mailpoet = __webpack_require__(4);
 
 
 
6744
 
6745
+ var _mailpoet2 = _interopRequireDefault(_mailpoet);
 
 
 
6746
 
6747
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
6748
 
6749
+ var tabs = [{
6750
+ name: 'knowledgeBase',
6751
+ label: _mailpoet2.default.I18n.t('tabKnowledgeBaseTitle'),
6752
+ link: '/knowledgeBase'
6753
+ }, {
6754
+ name: 'systemStatus',
6755
+ label: _mailpoet2.default.I18n.t('tabSystemStatusTitle'),
6756
+ link: '/systemStatus'
6757
+ }, {
6758
+ name: 'systemInfo',
6759
+ label: _mailpoet2.default.I18n.t('tabSystemInfoTitle'),
6760
+ link: '/systemInfo'
6761
+ }, {
6762
+ name: 'yourPrivacy',
6763
+ label: _mailpoet2.default.I18n.t('tabYourPrivacyTitle'),
6764
+ link: '/yourPrivacy'
6765
+ }];
6766
 
6767
+ function Tabs(props) {
6768
+ var tabLinks = tabs.map(function (tab) {
6769
+ var tabClasses = (0, _classnames2.default)('nav-tab', { 'nav-tab-active': props.tab === tab.name });
 
6770
 
6771
+ return _react2.default.createElement(
6772
+ _reactRouter.Link,
6773
+ {
6774
+ key: 'tab-' + tab.name,
6775
+ className: tabClasses,
6776
+ to: tab.link
6777
+ },
6778
+ tab.label
6779
+ );
6780
+ });
6781
 
6782
+ return _react2.default.createElement(
6783
+ 'h2',
6784
+ { className: 'nav-tab-wrapper' },
6785
+ tabLinks
6786
+ );
 
 
6787
  }
 
6788
 
6789
+ Tabs.propTypes = { tab: _propTypes2.default.string };
6790
+ Tabs.defaultProps = { tab: 'knowledgeBase' };
 
 
 
6791
 
6792
+ module.exports = Tabs;
6793
 
6794
  /***/ }),
6795
+ /* 295 */,
6796
+ /* 296 */,
6797
+ /* 297 */,
6798
+ /* 298 */,
6799
+ /* 299 */,
6800
+ /* 300 */,
6801
+ /* 301 */,
6802
+ /* 302 */,
6803
+ /* 303 */,
6804
+ /* 304 */,
6805
+ /* 305 */,
6806
+ /* 306 */,
6807
+ /* 307 */,
6808
+ /* 308 */,
6809
+ /* 309 */,
6810
+ /* 310 */,
6811
+ /* 311 */,
6812
+ /* 312 */,
6813
+ /* 313 */,
6814
+ /* 314 */,
6815
+ /* 315 */,
6816
+ /* 316 */,
6817
+ /* 317 */,
6818
+ /* 318 */,
6819
+ /* 319 */,
6820
+ /* 320 */,
6821
+ /* 321 */,
6822
+ /* 322 */,
6823
+ /* 323 */,
6824
+ /* 324 */,
6825
+ /* 325 */,
6826
+ /* 326 */,
6827
+ /* 327 */,
6828
+ /* 328 */,
6829
+ /* 329 */,
6830
+ /* 330 */,
6831
+ /* 331 */,
6832
+ /* 332 */,
6833
+ /* 333 */,
6834
+ /* 334 */,
6835
+ /* 335 */,
6836
+ /* 336 */,
6837
+ /* 337 */,
6838
+ /* 338 */,
6839
+ /* 339 */,
6840
+ /* 340 */,
6841
+ /* 341 */,
6842
+ /* 342 */,
6843
+ /* 343 */,
6844
+ /* 344 */,
6845
+ /* 345 */,
6846
+ /* 346 */,
6847
+ /* 347 */,
6848
+ /* 348 */,
6849
+ /* 349 */,
6850
+ /* 350 */,
6851
+ /* 351 */,
6852
+ /* 352 */,
6853
+ /* 353 */,
6854
+ /* 354 */,
6855
+ /* 355 */,
6856
+ /* 356 */,
6857
+ /* 357 */,
6858
+ /* 358 */,
6859
+ /* 359 */,
6860
+ /* 360 */,
6861
+ /* 361 */,
6862
+ /* 362 */,
6863
+ /* 363 */,
6864
+ /* 364 */,
6865
+ /* 365 */,
6866
+ /* 366 */,
6867
+ /* 367 */,
6868
+ /* 368 */,
6869
+ /* 369 */,
6870
+ /* 370 */,
6871
+ /* 371 */,
6872
+ /* 372 */,
6873
+ /* 373 */,
6874
+ /* 374 */,
6875
+ /* 375 */,
6876
+ /* 376 */,
6877
+ /* 377 */,
6878
+ /* 378 */,
6879
+ /* 379 */,
6880
+ /* 380 */,
6881
+ /* 381 */,
6882
+ /* 382 */,
6883
+ /* 383 */,
6884
+ /* 384 */,
6885
+ /* 385 */,
6886
+ /* 386 */,
6887
+ /* 387 */,
6888
+ /* 388 */,
6889
+ /* 389 */,
6890
+ /* 390 */,
6891
+ /* 391 */,
6892
+ /* 392 */,
6893
+ /* 393 */,
6894
+ /* 394 */,
6895
+ /* 395 */,
6896
+ /* 396 */,
6897
+ /* 397 */,
6898
+ /* 398 */,
6899
+ /* 399 */,
6900
+ /* 400 */,
6901
+ /* 401 */,
6902
+ /* 402 */,
6903
+ /* 403 */,
6904
+ /* 404 */,
6905
+ /* 405 */,
6906
+ /* 406 */,
6907
+ /* 407 */,
6908
+ /* 408 */,
6909
+ /* 409 */,
6910
+ /* 410 */,
6911
+ /* 411 */,
6912
+ /* 412 */,
6913
+ /* 413 */,
6914
+ /* 414 */,
6915
+ /* 415 */,
6916
+ /* 416 */,
6917
+ /* 417 */
6918
  /***/ (function(module, exports, __webpack_require__) {
6919
 
6920
  "use strict";
6923
  Object.defineProperty(exports, "__esModule", {
6924
  value: true
6925
  });
 
 
 
 
 
 
6926
 
6927
+ var _HtmlParser = __webpack_require__(418);
 
 
 
6928
 
6929
+ var _HtmlParser2 = _interopRequireDefault(_HtmlParser);
6930
+
6931
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6932
+
6933
+ exports.default = _HtmlParser2.default;
6934
 
6935
+ /***/ }),
6936
+ /* 418 */
6937
  /***/ (function(module, exports, __webpack_require__) {
6938
 
6939
  "use strict";
6942
  Object.defineProperty(exports, "__esModule", {
6943
  value: true
6944
  });
6945
+ exports.default = HtmlParser;
 
 
 
 
6946
 
6947
+ var _htmlparser = __webpack_require__(38);
6948
 
6949
+ var _htmlparser2 = _interopRequireDefault(_htmlparser);
6950
 
6951
+ var _ProcessNodes = __webpack_require__(270);
6952
 
6953
+ var _ProcessNodes2 = _interopRequireDefault(_ProcessNodes);
6954
 
6955
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6956
 
6957
  /**
6958
+ * Parses a HTML string and returns a list of React components generated from it
6959
  *
6960
+ * @param {String} html The HTML to convert into React components
6961
+ * @returns {Array} List of top level React elements
6962
  */
6963
+ function HtmlParser(html) {
6964
+ var nodes = _htmlparser2.default.parseDOM(html);
6965
+ return (0, _ProcessNodes2.default)(nodes);
6966
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6967
 
6968
  /***/ }),
6969
+ /* 419 */
6970
+ /***/ (function(module, exports) {
6971
 
6972
+ module.exports = {"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}
 
 
 
 
6973
 
6974
  /***/ }),
6975
+ /* 420 */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6976
  /***/ (function(module, exports, __webpack_require__) {
6977
 
6978
+ var ElementType = __webpack_require__(45);
 
 
 
 
 
 
 
 
 
6979
 
6980
+ var re_whitespace = /\s+/g;
6981
+ var NodePrototype = __webpack_require__(262);
6982
+ var ElementPrototype = __webpack_require__(421);
6983
 
6984
+ function DomHandler(callback, options, elementCB){
6985
+ if(typeof callback === "object"){
6986
+ elementCB = options;
6987
+ options = callback;
6988
+ callback = null;
6989
+ } else if(typeof options === "function"){
6990
+ elementCB = options;
6991
+ options = defaultOpts;
6992
+ }
6993
+ this._callback = callback;
6994
+ this._options = options || defaultOpts;
6995
+ this._elementCB = elementCB;
6996
+ this.dom = [];
6997
+ this._done = false;
6998
+ this._tagStack = [];
6999
+ this._parser = this._parser || null;
7000
+ }
7001
 
7002
+ //default options
7003
+ var defaultOpts = {
7004
+ normalizeWhitespace: false, //Replace all whitespace with single spaces
7005
+ withStartIndices: false, //Add startIndex properties to nodes
7006
+ withEndIndices: false, //Add endIndex properties to nodes
 
 
7007
  };
7008
 
7009
+ DomHandler.prototype.onparserinit = function(parser){
7010
+ this._parser = parser;
 
 
 
 
 
7011
  };
7012
 
7013
+ //Resets the handler back to starting state
7014
+ DomHandler.prototype.onreset = function(){
7015
+ DomHandler.call(this, this._callback, this._options, this._elementCB);
 
 
 
 
7016
  };
7017
 
7018
+ //Signals the handler that parsing is done
7019
+ DomHandler.prototype.onend = function(){
7020
+ if(this._done) return;
7021
+ this._done = true;
7022
+ this._parser = null;
7023
+ this._handleCallback(null);
 
7024
  };
7025
 
7026
+ DomHandler.prototype._handleCallback =
7027
+ DomHandler.prototype.onerror = function(error){
7028
+ if(typeof this._callback === "function"){
7029
+ this._callback(error, this.dom);
7030
+ } else {
7031
+ if(error) throw error;
7032
+ }
7033
  };
7034
 
7035
+ DomHandler.prototype.onclosetag = function(){
7036
+ //if(this._tagStack.pop().name !== name) this._handleCallback(Error("Tagname didn't match!"));
7037
+
7038
+ var elem = this._tagStack.pop();
7039
 
7040
+ if(this._options.withEndIndices){
7041
+ elem.endIndex = this._parser.endIndex;
7042
+ }
7043
 
7044
+ if(this._elementCB) this._elementCB(elem);
7045
+ };
 
 
 
 
7046
 
7047
+ DomHandler.prototype._createDomElement = function(properties){
7048
+ if (!this._options.withDomLvl1) return properties;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7049
 
7050
+ var element;
7051
+ if (properties.type === "tag") {
7052
+ element = Object.create(ElementPrototype);
7053
+ } else {
7054
+ element = Object.create(NodePrototype);
7055
+ }
7056
 
7057
+ for (var key in properties) {
7058
+ if (properties.hasOwnProperty(key)) {
7059
+ element[key] = properties[key];
7060
+ }
7061
+ }
7062
 
7063
+ return element;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7064
  };
7065
 
7066
+ DomHandler.prototype._addDomElement = function(element){
7067
+ var parent = this._tagStack[this._tagStack.length - 1];
7068
+ var siblings = parent ? parent.children : this.dom;
7069
+ var previousSibling = siblings[siblings.length - 1];
 
 
 
 
7070
 
7071
+ element.next = null;
 
 
 
7072
 
7073
+ if(this._options.withStartIndices){
7074
+ element.startIndex = this._parser.startIndex;
7075
+ }
7076
+ if(this._options.withEndIndices){
7077
+ element.endIndex = this._parser.endIndex;
7078
+ }
7079
 
7080
+ if(previousSibling){
7081
+ element.prev = previousSibling;
7082
+ previousSibling.next = element;
7083
+ } else {
7084
+ element.prev = null;
7085
+ }
7086
 
7087
+ siblings.push(element);
7088
+ element.parent = parent || null;
7089
+ };
7090
 
7091
+ DomHandler.prototype.onopentag = function(name, attribs){
7092
+ var properties = {
7093
+ type: name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag,
7094
+ name: name,
7095
+ attribs: attribs,
7096
+ children: []
7097
+ };
7098
 
7099
+ var element = this._createDomElement(properties);
7100
 
7101
+ this._addDomElement(element);
7102
 
7103
+ this._tagStack.push(element);
 
 
7104
  };
7105
 
7106
+ DomHandler.prototype.ontext = function(data){
7107
+ //the ignoreWhitespace is officially dropped, but for now,
7108
+ //it's an alias for normalizeWhitespace
7109
+ var normalize = this._options.normalizeWhitespace || this._options.ignoreWhitespace;
7110
 
7111
+ var lastTag;
 
 
 
 
 
 
7112
 
7113
+ if(!this._tagStack.length && this.dom.length && (lastTag = this.dom[this.dom.length-1]).type === ElementType.Text){
7114
+ if(normalize){
7115
+ lastTag.data = (lastTag.data + data).replace(re_whitespace, " ");
7116
+ } else {
7117
+ lastTag.data += data;
7118
+ }
7119
+ } else {
7120
+ if(
7121
+ this._tagStack.length &&
7122
+ (lastTag = this._tagStack[this._tagStack.length - 1]) &&
7123
+ (lastTag = lastTag.children[lastTag.children.length - 1]) &&
7124
+ lastTag.type === ElementType.Text
7125
+ ){
7126
+ if(normalize){
7127
+ lastTag.data = (lastTag.data + data).replace(re_whitespace, " ");
7128
+ } else {
7129
+ lastTag.data += data;
7130
+ }
7131
+ } else {
7132
+ if(normalize){
7133
+ data = data.replace(re_whitespace, " ");
7134
+ }
7135
 
7136
+ var element = this._createDomElement({
7137
+ data: data,
7138
+ type: ElementType.Text
7139
+ });
7140
 
7141
+ this._addDomElement(element);
7142
+ }
7143
+ }
7144
  };
7145
 
7146
+ DomHandler.prototype.oncomment = function(data){
7147
+ var lastTag = this._tagStack[this._tagStack.length - 1];
 
 
 
 
 
 
 
 
 
 
 
 
 
7148
 
7149
+ if(lastTag && lastTag.type === ElementType.Comment){
7150
+ lastTag.data += data;
7151
+ return;
7152
+ }
7153
 
7154
+ var properties = {
7155
+ data: data,
7156
+ type: ElementType.Comment
7157
+ };
7158
 
7159
+ var element = this._createDomElement(properties);
7160
 
7161
+ this._addDomElement(element);
7162
+ this._tagStack.push(element);
7163
+ };
 
7164
 
7165
+ DomHandler.prototype.oncdatastart = function(){
7166
+ var properties = {
7167
+ children: [{
7168
+ data: "",
7169
+ type: ElementType.Text
7170
+ }],
7171
+ type: ElementType.CDATA
7172
+ };
7173
 
7174
+ var element = this._createDomElement(properties);
7175
 
7176
+ this._addDomElement(element);
7177
+ this._tagStack.push(element);
7178
+ };
7179
 
7180
+ DomHandler.prototype.oncommentend = DomHandler.prototype.oncdataend = function(){
7181
+ this._tagStack.pop();
7182
+ };
7183
 
7184
+ DomHandler.prototype.onprocessinginstruction = function(name, data){
7185
+ var element = this._createDomElement({
7186
+ name: name,
7187
+ data: data,
7188
+ type: ElementType.Directive
7189
+ });
7190
 
7191
+ this._addDomElement(element);
7192
+ };
7193
 
7194
+ module.exports = DomHandler;
7195
 
 
 
 
 
7196
 
7197
+ /***/ }),
7198
+ /* 421 */
7199
+ /***/ (function(module, exports, __webpack_require__) {
7200
 
7201
+ // DOM-Level-1-compliant structure
7202
+ var NodePrototype = __webpack_require__(262);
7203
+ var ElementPrototype = module.exports = Object.create(NodePrototype);
7204
 
7205
+ var domLvl1 = {
7206
+ tagName: "name"
7207
+ };
 
 
7208
 
7209
+ Object.keys(domLvl1).forEach(function(key) {
7210
+ var shorthand = domLvl1[key];
7211
+ Object.defineProperty(ElementPrototype, key, {
7212
+ get: function() {
7213
+ return this[shorthand] || null;
7214
+ },
7215
+ set: function(val) {
7216
+ this[shorthand] = val;
7217
+ return val;
7218
+ }
7219
+ });
7220
+ });
7221
 
 
 
7222
 
7223
+ /***/ }),
7224
+ /* 422 */
7225
+ /***/ (function(module, exports, __webpack_require__) {
7226
 
7227
+ var index = __webpack_require__(38),
7228
+ DomHandler = index.DomHandler,
7229
+ DomUtils = index.DomUtils;
7230
 
7231
+ //TODO: make this a streamable handler
7232
+ function FeedHandler(callback, options){
7233
+ this.init(callback, options);
7234
+ }
 
 
7235
 
7236
+ __webpack_require__(22)(FeedHandler, DomHandler);
 
7237
 
7238
+ FeedHandler.prototype.init = DomHandler;
 
 
7239
 
7240
+ function getElements(what, where){
7241
+ return DomUtils.getElementsByTagName(what, where, true);
7242
+ }
7243
+ function getOneElement(what, where){
7244
+ return DomUtils.getElementsByTagName(what, where, true, 1)[0];
7245
+ }
7246
+ function fetch(what, where, recurse){
7247
+ return DomUtils.getText(
7248
+ DomUtils.getElementsByTagName(what, where, recurse, 1)
7249
+ ).trim();
7250
+ }
7251
 
7252
+ function addConditionally(obj, prop, what, where, recurse){
7253
+ var tmp = fetch(what, where, recurse);
7254
+ if(tmp) obj[prop] = tmp;
7255
+ }
7256
 
7257
+ var isValidFeed = function(value){
7258
+ return value === "rss" || value === "feed" || value === "rdf:RDF";
7259
  };
7260
 
7261
+ FeedHandler.prototype.onend = function(){
7262
+ var feed = {},
7263
+ feedRoot = getOneElement(isValidFeed, this.dom),
7264
+ tmp, childs;
 
 
 
 
 
 
 
 
 
7265
 
7266
+ if(feedRoot){
7267
+ if(feedRoot.name === "feed"){
7268
+ childs = feedRoot.children;
 
 
 
 
7269
 
7270
+ feed.type = "atom";
7271
+ addConditionally(feed, "id", "id", childs);
7272
+ addConditionally(feed, "title", "title", childs);
7273
+ if((tmp = getOneElement("link", childs)) && (tmp = tmp.attribs) && (tmp = tmp.href)) feed.link = tmp;
7274
+ addConditionally(feed, "description", "subtitle", childs);
7275
+ if((tmp = fetch("updated", childs))) feed.updated = new Date(tmp);
7276
+ addConditionally(feed, "author", "email", childs, true);
7277
 
7278
+ feed.items = getElements("entry", childs).map(function(item){
7279
+ var entry = {}, tmp;
 
 
 
7280
 
7281
+ item = item.children;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7282
 
7283
+ addConditionally(entry, "id", "id", item);
7284
+ addConditionally(entry, "title", "title", item);
7285
+ if((tmp = getOneElement("link", item)) && (tmp = tmp.attribs) && (tmp = tmp.href)) entry.link = tmp;
7286
+ if((tmp = fetch("summary", item) || fetch("content", item))) entry.description = tmp;
7287
+ if((tmp = fetch("updated", item))) entry.pubDate = new Date(tmp);
7288
+ return entry;
7289
+ });
7290
+ } else {
7291
+ childs = getOneElement("channel", feedRoot.children).children;
7292
 
7293
+ feed.type = feedRoot.name.substr(0, 3);
7294
+ feed.id = "";
7295
+ addConditionally(feed, "title", "title", childs);
7296
+ addConditionally(feed, "link", "link", childs);
7297
+ addConditionally(feed, "description", "description", childs);
7298
+ if((tmp = fetch("lastBuildDate", childs))) feed.updated = new Date(tmp);
7299
+ addConditionally(feed, "author", "managingEditor", childs, true);
 
 
 
7300
 
7301
+ feed.items = getElements("item", feedRoot.children).map(function(item){
7302
+ var entry = {}, tmp;
 
 
7303
 
7304
+ item = item.children;
 
 
 
 
 
 
 
 
 
 
7305
 
7306
+ addConditionally(entry, "id", "guid", item);
7307
+ addConditionally(entry, "title", "title", item);
7308
+ addConditionally(entry, "link", "link", item);
7309
+ addConditionally(entry, "description", "description", item);
7310
+ if((tmp = fetch("pubDate", item))) entry.pubDate = new Date(tmp);
7311
+ return entry;
7312
+ });
7313
+ }
7314
+ }
7315
+ this.dom = feed;
7316
+ DomHandler.prototype._handleCallback.call(
7317
+ this, feedRoot ? null : Error("couldn't find root of feed")
7318
+ );
7319
  };
7320
 
7321
+ module.exports = FeedHandler;
 
 
 
 
 
7322
 
 
 
 
 
 
 
 
 
 
 
 
 
7323
 
7324
  /***/ }),
7325
+ /* 423 */
7326
  /***/ (function(module, exports, __webpack_require__) {
7327
 
7328
+ module.exports = Stream;
7329
 
7330
+ var Parser = __webpack_require__(263);
7331
 
7332
+ function Stream(options){
7333
+ Parser.call(this, new Cbs(this), options);
7334
+ }
7335
 
7336
+ __webpack_require__(22)(Stream, Parser);
7337
 
7338
+ Stream.prototype.readable = true;
7339
 
7340
+ function Cbs(scope){
7341
+ this.scope = scope;
7342
+ }
7343
 
7344
+ var EVENTS = __webpack_require__(38).EVENTS;
7345
 
7346
+ Object.keys(EVENTS).forEach(function(name){
7347
+ if(EVENTS[name] === 0){
7348
+ Cbs.prototype["on" + name] = function(){
7349
+ this.scope.emit(name);
7350
+ };
7351
+ } else if(EVENTS[name] === 1){
7352
+ Cbs.prototype["on" + name] = function(a){
7353
+ this.scope.emit(name, a);
7354
+ };
7355
+ } else if(EVENTS[name] === 2){
7356
+ Cbs.prototype["on" + name] = function(a, b){
7357
+ this.scope.emit(name, a, b);
7358
+ };
7359
+ } else {
7360
+ throw Error("wrong number of arguments!");
7361
+ }
7362
+ });
7363
 
7364
+ /***/ }),
7365
+ /* 424 */
7366
+ /***/ (function(module, exports, __webpack_require__) {
7367
 
7368
+ // Copyright Joyent, Inc. and other Node contributors.
7369
+ //
7370
+ // Permission is hereby granted, free of charge, to any person obtaining a
7371
+ // copy of this software and associated documentation files (the
7372
+ // "Software"), to deal in the Software without restriction, including
7373
+ // without limitation the rights to use, copy, modify, merge, publish,
7374
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
7375
+ // persons to whom the Software is furnished to do so, subject to the
7376
+ // following conditions:
7377
+ //
7378
+ // The above copyright notice and this permission notice shall be included
7379
+ // in all copies or substantial portions of the Software.
7380
+ //
7381
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
7382
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
7383
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
7384
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
7385
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
7386
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
7387
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
7388
 
7389
+ module.exports = Stream;
7390
 
7391
+ var EE = __webpack_require__(55).EventEmitter;
7392
+ var inherits = __webpack_require__(22);
7393
 
7394
+ inherits(Stream, EE);
7395
+ Stream.Readable = __webpack_require__(88);
7396
+ Stream.Writable = __webpack_require__(432);
7397
+ Stream.Duplex = __webpack_require__(433);
7398
+ Stream.Transform = __webpack_require__(434);
7399
+ Stream.PassThrough = __webpack_require__(435);
7400
 
7401
+ // Backwards-compat with node 0.4.x
7402
+ Stream.Stream = Stream;
7403
 
 
7404
 
 
7405
 
7406
+ // old-style streams. Note that the pipe method (the only relevant
7407
+ // part of this class) is overridden in the Readable class.
7408
 
7409
+ function Stream() {
7410
+ EE.call(this);
7411
+ }
7412
 
7413
+ Stream.prototype.pipe = function(dest, options) {
7414
+ var source = this;
7415
 
7416
+ function ondata(chunk) {
7417
+ if (dest.writable) {
7418
+ if (false === dest.write(chunk) && source.pause) {
7419
+ source.pause();
7420
+ }
7421
+ }
7422
+ }
7423
 
7424
+ source.on('data', ondata);
7425
 
7426
+ function ondrain() {
7427
+ if (source.readable && source.resume) {
7428
+ source.resume();
7429
+ }
7430
+ }
7431
 
7432
+ dest.on('drain', ondrain);
7433
 
7434
+ // If the 'end' option is not supplied, dest.end() will be called when
7435
+ // source gets the 'end' or 'close' events. Only dest.end() once.
7436
+ if (!dest._isStdio && (!options || options.end !== false)) {
7437
+ source.on('end', onend);
7438
+ source.on('close', onclose);
7439
+ }
7440
 
7441
+ var didOnEnd = false;
7442
+ function onend() {
7443
+ if (didOnEnd) return;
7444
+ didOnEnd = true;
7445
 
7446
+ dest.end();
7447
+ }
7448
 
 
7449
 
7450
+ function onclose() {
7451
+ if (didOnEnd) return;
7452
+ didOnEnd = true;
7453
 
7454
+ if (typeof dest.destroy === 'function') dest.destroy();
7455
+ }
7456
 
7457
+ // don't leave dangling pipes when there are errors.
7458
+ function onerror(er) {
7459
+ cleanup();
7460
+ if (EE.listenerCount(this, 'error') === 0) {
7461
+ throw er; // Unhandled stream error in pipe.
7462
+ }
7463
+ }
7464
 
7465
+ source.on('error', onerror);
7466
+ dest.on('error', onerror);
7467
 
7468
+ // remove all the event listeners that were added.
7469
+ function cleanup() {
7470
+ source.removeListener('data', ondata);
7471
+ dest.removeListener('drain', ondrain);
7472
 
7473
+ source.removeListener('end', onend);
7474
+ source.removeListener('close', onclose);
7475
 
7476
+ source.removeListener('error', onerror);
7477
+ dest.removeListener('error', onerror);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7478
 
7479
+ source.removeListener('end', cleanup);
7480
+ source.removeListener('close', cleanup);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7481
 
7482
+ dest.removeListener('close', cleanup);
7483
+ }
7484
 
7485
+ source.on('end', cleanup);
7486
+ source.on('close', cleanup);
7487
 
7488
+ dest.on('close', cleanup);
7489
 
7490
+ dest.emit('pipe', source);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7491
 
7492
+ // Allow for unix-like usage: A.pipe(B).pipe(C)
7493
+ return dest;
7494
  };
7495
 
7496
+
7497
  /***/ }),
7498
+ /* 425 */
7499
  /***/ (function(module, exports, __webpack_require__) {
7500
 
7501
  "use strict";
7502
 
7503
 
7504
+ exports.byteLength = byteLength
7505
+ exports.toByteArray = toByteArray
7506
+ exports.fromByteArray = fromByteArray
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7507
 
7508
+ var lookup = []
7509
+ var revLookup = []
7510
+ var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
7511
 
7512
+ var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
7513
+ for (var i = 0, len = code.length; i < len; ++i) {
7514
+ lookup[i] = code[i]
7515
+ revLookup[code.charCodeAt(i)] = i
7516
+ }
7517
 
7518
+ revLookup['-'.charCodeAt(0)] = 62
7519
+ revLookup['_'.charCodeAt(0)] = 63
7520
 
7521
+ function placeHoldersCount (b64) {
7522
+ var len = b64.length
7523
+ if (len % 4 > 0) {
7524
+ throw new Error('Invalid string. Length must be a multiple of 4')
7525
+ }
7526
 
7527
+ // the number of equal signs (place holders)
7528
+ // if there are two placeholders, than the two characters before it
7529
+ // represent one byte
7530
+ // if there is only one, then the three characters before it represent 2 bytes
7531
+ // this is just a cheap hack to not do indexOf twice
7532
+ return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
7533
+ }
7534
 
7535
+ function byteLength (b64) {
7536
+ // base64 is 4/3 + up to two characters of the original data
7537
+ return (b64.length * 3 / 4) - placeHoldersCount(b64)
7538
+ }
7539
 
7540
+ function toByteArray (b64) {
7541
+ var i, l, tmp, placeHolders, arr
7542
+ var len = b64.length
7543
+ placeHolders = placeHoldersCount(b64)
7544
 
7545
+ arr = new Arr((len * 3 / 4) - placeHolders)
7546
 
7547
+ // if there are placeholders, only get up to the last complete 4 chars
7548
+ l = placeHolders > 0 ? len - 4 : len
7549
 
7550
+ var L = 0
7551
 
7552
+ for (i = 0; i < l; i += 4) {
7553
+ tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
7554
+ arr[L++] = (tmp >> 16) & 0xFF
7555
+ arr[L++] = (tmp >> 8) & 0xFF
7556
+ arr[L++] = tmp & 0xFF
7557
+ }
7558
 
7559
+ if (placeHolders === 2) {
7560
+ tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
7561
+ arr[L++] = tmp & 0xFF
7562
+ } else if (placeHolders === 1) {
7563
+ tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
7564
+ arr[L++] = (tmp >> 8) & 0xFF
7565
+ arr[L++] = tmp & 0xFF
7566
+ }
7567
 
7568
+ return arr
7569
+ }
7570
 
7571
+ function tripletToBase64 (num) {
7572
+ return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
7573
+ }
7574
 
7575
+ function encodeChunk (uint8, start, end) {
7576
+ var tmp
7577
+ var output = []
7578
+ for (var i = start; i < end; i += 3) {
7579
+ tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
7580
+ output.push(tripletToBase64(tmp))
7581
+ }
7582
+ return output.join('')
7583
+ }
7584
 
7585
+ function fromByteArray (uint8) {
7586
+ var tmp
7587
+ var len = uint8.length
7588
+ var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
7589
+ var output = ''
7590
+ var parts = []
7591
+ var maxChunkLength = 16383 // must be multiple of 3
7592
 
7593
+ // go through the array every three bytes, we'll deal with trailing stuff later
7594
+ for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
7595
+ parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
7596
+ }
 
 
7597
 
7598
+ // pad the end with zeros, but make sure to not forget the extra bytes
7599
+ if (extraBytes === 1) {
7600
+ tmp = uint8[len - 1]
7601
+ output += lookup[tmp >> 2]
7602
+ output += lookup[(tmp << 4) & 0x3F]
7603
+ output += '=='
7604
+ } else if (extraBytes === 2) {
7605
+ tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
7606
+ output += lookup[tmp >> 10]
7607
+ output += lookup[(tmp >> 4) & 0x3F]
7608
+ output += lookup[(tmp << 2) & 0x3F]
7609
+ output += '='
7610
+ }
7611
 
7612
+ parts.push(output)
 
 
 
 
7613
 
7614
+ return parts.join('')
7615
+ }
7616
 
 
7617
 
7618
+ /***/ }),
7619
+ /* 426 */
7620
+ /***/ (function(module, exports) {
7621
 
7622
+ exports.read = function (buffer, offset, isLE, mLen, nBytes) {
7623
+ var e, m
7624
+ var eLen = nBytes * 8 - mLen - 1
7625
+ var eMax = (1 << eLen) - 1
7626
+ var eBias = eMax >> 1
7627
+ var nBits = -7
7628
+ var i = isLE ? (nBytes - 1) : 0
7629
+ var d = isLE ? -1 : 1
7630
+ var s = buffer[offset + i]
 
 
 
 
 
7631
 
7632
+ i += d
 
 
 
 
 
 
 
 
7633
 
7634
+ e = s & ((1 << (-nBits)) - 1)
7635
+ s >>= (-nBits)
7636
+ nBits += eLen
7637
+ for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
7638
 
7639
+ m = e & ((1 << (-nBits)) - 1)
7640
+ e >>= (-nBits)
7641
+ nBits += mLen
7642
+ for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
7643
+
7644
+ if (e === 0) {
7645
+ e = 1 - eBias
7646
+ } else if (e === eMax) {
7647
+ return m ? NaN : ((s ? -1 : 1) * Infinity)
7648
+ } else {
7649
+ m = m + Math.pow(2, mLen)
7650
+ e = e - eBias
7651
+ }
7652
+ return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
7653
+ }
7654
+
7655
+ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
7656
+ var e, m, c
7657
+ var eLen = nBytes * 8 - mLen - 1
7658
+ var eMax = (1 << eLen) - 1
7659
+ var eBias = eMax >> 1
7660
+ var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
7661
+ var i = isLE ? 0 : (nBytes - 1)
7662
+ var d = isLE ? 1 : -1
7663
+ var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
7664
+
7665
+ value = Math.abs(value)
7666
+
7667
+ if (isNaN(value) || value === Infinity) {
7668
+ m = isNaN(value) ? 1 : 0
7669
+ e = eMax
7670
+ } else {
7671
+ e = Math.floor(Math.log(value) / Math.LN2)
7672
+ if (value * (c = Math.pow(2, -e)) < 1) {
7673
+ e--
7674
+ c *= 2
7675
+ }
7676
+ if (e + eBias >= 1) {
7677
+ value += rt / c
7678
+ } else {
7679
+ value += rt * Math.pow(2, 1 - eBias)
7680
+ }
7681
+ if (value * c >= 2) {
7682
+ e++
7683
+ c /= 2
7684
  }
7685
 
7686
+ if (e + eBias >= eMax) {
7687
+ m = 0
7688
+ e = eMax
7689
+ } else if (e + eBias >= 1) {
7690
+ m = (value * c - 1) * Math.pow(2, mLen)
7691
+ e = e + eBias
7692
+ } else {
7693
+ m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
7694
+ e = 0
7695
  }
7696
+ }
7697
 
7698
+ for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
 
7699
 
7700
+ e = (e << mLen) | m
7701
+ eLen += mLen
7702
+ for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
 
7703
 
7704
+ buffer[offset + i - d] |= s * 128
7705
+ }
7706
 
 
7707
 
7708
+ /***/ }),
7709
+ /* 427 */
7710
+ /***/ (function(module, exports) {
 
 
 
 
 
 
7711
 
7712
+ /* (ignored) */
 
7713
 
7714
+ /***/ }),
7715
+ /* 428 */
7716
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
7717
 
7718
+ "use strict";
 
 
7719
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7720
 
7721
+ /*<replacement>*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7722
 
7723
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
 
7724
 
7725
+ var Buffer = __webpack_require__(57).Buffer;
7726
+ /*</replacement>*/
 
7727
 
7728
+ function copyBuffer(src, target, offset) {
7729
+ src.copy(target, offset);
7730
+ }
 
 
 
 
 
 
 
 
 
 
7731
 
7732
+ module.exports = function () {
7733
+ function BufferList() {
7734
+ _classCallCheck(this, BufferList);
7735
 
7736
+ this.head = null;
7737
+ this.tail = null;
7738
+ this.length = 0;
7739
+ }
 
 
7740
 
7741
+ BufferList.prototype.push = function push(v) {
7742
+ var entry = { data: v, next: null };
7743
+ if (this.length > 0) this.tail.next = entry;else this.head = entry;
7744
+ this.tail = entry;
7745
+ ++this.length;
7746
+ };
7747
 
7748
+ BufferList.prototype.unshift = function unshift(v) {
7749
+ var entry = { data: v, next: this.head };
7750
+ if (this.length === 0) this.tail = entry;
7751
+ this.head = entry;
7752
+ ++this.length;
7753
+ };
7754
 
7755
+ BufferList.prototype.shift = function shift() {
7756
+ if (this.length === 0) return;
7757
+ var ret = this.head.data;
7758
+ if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
7759
+ --this.length;
7760
+ return ret;
7761
+ };
 
 
 
 
 
 
 
 
 
 
7762
 
7763
+ BufferList.prototype.clear = function clear() {
7764
+ this.head = this.tail = null;
7765
+ this.length = 0;
7766
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7767
 
7768
+ BufferList.prototype.join = function join(s) {
7769
+ if (this.length === 0) return '';
7770
+ var p = this.head;
7771
+ var ret = '' + p.data;
7772
+ while (p = p.next) {
7773
+ ret += s + p.data;
7774
+ }return ret;
7775
+ };
 
 
 
 
 
 
 
7776
 
7777
+ BufferList.prototype.concat = function concat(n) {
7778
+ if (this.length === 0) return Buffer.alloc(0);
7779
+ if (this.length === 1) return this.head.data;
7780
+ var ret = Buffer.allocUnsafe(n >>> 0);
7781
+ var p = this.head;
7782
+ var i = 0;
7783
+ while (p) {
7784
+ copyBuffer(p.data, ret, i);
7785
+ i += p.data.length;
7786
+ p = p.next;
7787
+ }
7788
+ return ret;
7789
+ };
7790
 
7791
+ return BufferList;
7792
+ }();
 
7793
 
7794
  /***/ }),
7795
+ /* 429 */,
7796
+ /* 430 */
7797
  /***/ (function(module, exports, __webpack_require__) {
7798
 
7799
+ /* WEBPACK VAR INJECTION */(function(global) {
7800
+ /**
7801
+ * Module exports.
7802
+ */
 
 
 
 
 
 
 
7803
 
7804
+ module.exports = deprecate;
7805
+
7806
+ /**
7807
+ * Mark that a method should not be used.
7808
+ * Returns a modified function which warns once by default.
7809
+ *
7810
+ * If `localStorage.noDeprecation = true` is set, then it is a no-op.
7811
+ *
7812
+ * If `localStorage.throwDeprecation = true` is set, then deprecated functions
7813
+ * will throw an Error when invoked.
7814
+ *
7815
+ * If `localStorage.traceDeprecation = true` is set, then deprecated functions
7816
+ * will invoke `console.trace()` instead of `console.error()`.
7817
+ *
7818
+ * @param {Function} fn - the function to deprecate
7819
+ * @param {String} msg - the string to print to the console when `fn` is invoked
7820
+ * @returns {Function} a new "deprecated" version of `fn`
7821
+ * @api public
7822
+ */
7823
+
7824
+ function deprecate (fn, msg) {
7825
+ if (config('noDeprecation')) {
7826
+ return fn;
7827
+ }
7828
+
7829
+ var warned = false;
7830
+ function deprecated() {
7831
+ if (!warned) {
7832
+ if (config('throwDeprecation')) {
7833
+ throw new Error(msg);
7834
+ } else if (config('traceDeprecation')) {
7835
+ console.trace(msg);
7836
+ } else {
7837
+ console.warn(msg);
7838
+ }
7839
+ warned = true;
7840
+ }
7841
+ return fn.apply(this, arguments);
7842
+ }
7843
+
7844
+ return deprecated;
7845
+ }
7846
+
7847
+ /**
7848
+ * Checks `localStorage` for boolean values for the given `name`.
7849
+ *
7850
+ * @param {String} name
7851
+ * @returns {Boolean}
7852
+ * @api private
7853
+ */
7854
+
7855
+ function config (name) {
7856
+ // accessing global.localStorage can trigger a DOMException in sandboxed iframes
7857
+ try {
7858
+ if (!global.localStorage) return false;
7859
+ } catch (_) {
7860
+ return false;
7861
+ }
7862
+ var val = global.localStorage[name];
7863
+ if (null == val) return false;
7864
+ return String(val).toLowerCase() === 'true';
7865
+ }
7866
+
7867
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9)))
7868
+
7869
+ /***/ }),
7870
+ /* 431 */
7871
+ /***/ (function(module, exports, __webpack_require__) {
7872
 
7873
  "use strict";
7874
+ // Copyright Joyent, Inc. and other Node contributors.
7875
+ //
7876
+ // Permission is hereby granted, free of charge, to any person obtaining a
7877
+ // copy of this software and associated documentation files (the
7878
+ // "Software"), to deal in the Software without restriction, including
7879
+ // without limitation the rights to use, copy, modify, merge, publish,
7880
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
7881
+ // persons to whom the Software is furnished to do so, subject to the
7882
+ // following conditions:
7883
+ //
7884
+ // The above copyright notice and this permission notice shall be included
7885
+ // in all copies or substantial portions of the Software.
7886
+ //
7887
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
7888
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
7889
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
7890
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
7891
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
7892
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
7893
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
7894
 
7895
+ // a passthrough stream.
7896
+ // basically just the most minimal sort of Transform stream.
7897
+ // Every written chunk gets output as-is.
7898
 
 
 
 
7899
 
 
7900
 
7901
+ module.exports = PassThrough;
7902
 
7903
+ var Transform = __webpack_require__(269);
 
7904
 
7905
+ /*<replacement>*/
7906
+ var util = __webpack_require__(46);
7907
+ util.inherits = __webpack_require__(22);
7908
+ /*</replacement>*/
7909
+
7910
+ util.inherits(PassThrough, Transform);
7911
+
7912
+ function PassThrough(options) {
7913
+ if (!(this instanceof PassThrough)) return new PassThrough(options);
7914
+
7915
+ Transform.call(this, options);
7916
+ }
7917
+
7918
+ PassThrough.prototype._transform = function (chunk, encoding, cb) {
7919
+ cb(null, chunk);
7920
  };
7921
 
7922
+ /***/ }),
7923
+ /* 432 */
7924
+ /***/ (function(module, exports, __webpack_require__) {
7925
+
7926
+ module.exports = __webpack_require__(90);
7927
+
7928
 
7929
  /***/ }),
7930
+ /* 433 */
7931
  /***/ (function(module, exports, __webpack_require__) {
7932
 
7933
+ module.exports = __webpack_require__(32);
7934
 
7935
 
7936
+ /***/ }),
7937
+ /* 434 */
7938
+ /***/ (function(module, exports, __webpack_require__) {
7939
+
7940
+ module.exports = __webpack_require__(88).Transform
7941
+
7942
+
7943
+ /***/ }),
7944
+ /* 435 */
7945
+ /***/ (function(module, exports, __webpack_require__) {
7946
+
7947
+ module.exports = __webpack_require__(88).PassThrough
7948
+
7949
+
7950
+ /***/ }),
7951
+ /* 436 */
7952
+ /***/ (function(module, exports) {
7953
+
7954
+ /* (ignored) */
7955
+
7956
+ /***/ }),
7957
+ /* 437 */
7958
+ /***/ (function(module, exports, __webpack_require__) {
7959
+
7960
+ module.exports = ProxyHandler;
7961
+
7962
+ function ProxyHandler(cbs){
7963
+ this._cbs = cbs || {};
7964
+ }
7965
+
7966
+ var EVENTS = __webpack_require__(38).EVENTS;
7967
+ Object.keys(EVENTS).forEach(function(name){
7968
+ if(EVENTS[name] === 0){
7969
+ name = "on" + name;
7970
+ ProxyHandler.prototype[name] = function(){
7971
+ if(this._cbs[name]) this._cbs[name]();
7972
+ };
7973
+ } else if(EVENTS[name] === 1){
7974
+ name = "on" + name;
7975
+ ProxyHandler.prototype[name] = function(a){
7976
+ if(this._cbs[name]) this._cbs[name](a);
7977
+ };
7978
+ } else if(EVENTS[name] === 2){
7979
+ name = "on" + name;
7980
+ ProxyHandler.prototype[name] = function(a, b){
7981
+ if(this._cbs[name]) this._cbs[name](a, b);
7982
+ };
7983
+ } else {
7984
+ throw Error("wrong number of arguments");
7985
+ }
7986
  });
 
7987
 
7988
+ /***/ }),
7989
+ /* 438 */
7990
+ /***/ (function(module, exports, __webpack_require__) {
7991
 
7992
+ var DomUtils = module.exports;
 
 
 
7993
 
7994
+ [
7995
+ __webpack_require__(439),
7996
+ __webpack_require__(445),
7997
+ __webpack_require__(446),
7998
+ __webpack_require__(447),
7999
+ __webpack_require__(448),
8000
+ __webpack_require__(449)
8001
+ ].forEach(function(ext){
8002
+ Object.keys(ext).forEach(function(key){
8003
+ DomUtils[key] = ext[key].bind(DomUtils);
8004
+ });
8005
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8006
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8007
 
8008
  /***/ }),
8009
+ /* 439 */
8010
  /***/ (function(module, exports, __webpack_require__) {
8011
 
8012
+ var ElementType = __webpack_require__(45),
8013
+ getOuterHTML = __webpack_require__(440),
8014
+ isTag = ElementType.isTag;
 
 
 
 
 
8015
 
8016
+ module.exports = {
8017
+ getInnerHTML: getInnerHTML,
8018
+ getOuterHTML: getOuterHTML,
8019
+ getText: getText
8020
+ };
8021
 
8022
+ function getInnerHTML(elem, opts){
8023
+ return elem.children ? elem.children.map(function(elem){
8024
+ return getOuterHTML(elem, opts);
8025
+ }).join("") : "";
8026
+ }
8027
 
8028
+ function getText(elem){
8029
+ if(Array.isArray(elem)) return elem.map(getText).join("");
8030
+ if(isTag(elem)) return elem.name === "br" ? "\n" : getText(elem.children);
8031
+ if(elem.type === ElementType.CDATA) return getText(elem.children);
8032
+ if(elem.type === ElementType.Text) return elem.data;
8033
+ return "";
8034
+ }
8035
 
 
 
 
8036
 
8037
+ /***/ }),
8038
+ /* 440 */
8039
+ /***/ (function(module, exports, __webpack_require__) {
 
8040
 
8041
+ /*
8042
+ Module dependencies
8043
+ */
8044
+ var ElementType = __webpack_require__(441);
8045
+ var entities = __webpack_require__(442);
 
 
8046
 
8047
+ /*
8048
+ Boolean Attributes
8049
+ */
8050
+ var booleanAttributes = {
8051
+ __proto__: null,
8052
+ allowfullscreen: true,
8053
+ async: true,
8054
+ autofocus: true,
8055
+ autoplay: true,
8056
+ checked: true,
8057
+ controls: true,
8058
+ default: true,
8059
+ defer: true,
8060
+ disabled: true,
8061
+ hidden: true,
8062
+ ismap: true,
8063
+ loop: true,
8064
+ multiple: true,
8065
+ muted: true,
8066
+ open: true,
8067
+ readonly: true,
8068
+ required: true,
8069
+ reversed: true,
8070
+ scoped: true,
8071
+ seamless: true,
8072
+ selected: true,
8073
+ typemustmatch: true
8074
+ };
8075
 
8076
+ var unencodedElements = {
8077
+ __proto__: null,
8078
+ style: true,
8079
+ script: true,
8080
+ xmp: true,
8081
+ iframe: true,
8082
+ noembed: true,
8083
+ noframes: true,
8084
+ plaintext: true,
8085
+ noscript: true
8086
+ };
8087
 
8088
+ /*
8089
+ Format attributes
8090
+ */
8091
+ function formatAttrs(attributes, opts) {
8092
+ if (!attributes) return;
8093
 
8094
+ var output = '',
8095
+ value;
8096
 
8097
+ // Loop through the attributes
8098
+ for (var key in attributes) {
8099
+ value = attributes[key];
8100
+ if (output) {
8101
+ output += ' ';
 
 
 
 
 
8102
  }
 
8103
 
8104
+ if (!value && booleanAttributes[key]) {
8105
+ output += key;
8106
+ } else {
8107
+ output += key + '="' + (opts.decodeEntities ? entities.encodeXML(value) : value) + '"';
8108
  }
8109
+ }
8110
 
8111
+ return output;
8112
  }
8113
 
8114
+ /*
8115
+ Self-enclosing tags (stolen from node-htmlparser)
8116
+ */
8117
+ var singleTag = {
8118
+ __proto__: null,
8119
+ area: true,
8120
+ base: true,
8121
+ basefont: true,
8122
+ br: true,
8123
+ col: true,
8124
+ command: true,
8125
+ embed: true,
8126
+ frame: true,
8127
+ hr: true,
8128
+ img: true,
8129
+ input: true,
8130
+ isindex: true,
8131
+ keygen: true,
8132
+ link: true,
8133
+ meta: true,
8134
+ param: true,
8135
+ source: true,
8136
+ track: true,
8137
+ wbr: true,
8138
+ };
8139
 
 
8140
 
8141
+ var render = module.exports = function(dom, opts) {
8142
+ if (!Array.isArray(dom) && !dom.cheerio) dom = [dom];
8143
+ opts = opts || {};
8144
 
8145
+ var output = '';
 
 
8146
 
8147
+ for(var i = 0; i < dom.length; i++){
8148
+ var elem = dom[i];
8149
 
8150
+ if (elem.type === 'root')
8151
+ output += render(elem.children, opts);
8152
+ else if (ElementType.isTag(elem))
8153
+ output += renderTag(elem, opts);
8154
+ else if (elem.type === ElementType.Directive)
8155
+ output += renderDirective(elem);
8156
+ else if (elem.type === ElementType.Comment)
8157
+ output += renderComment(elem);
8158
+ else if (elem.type === ElementType.CDATA)
8159
+ output += renderCdata(elem);
8160
+ else
8161
+ output += renderText(elem, opts);
8162
+ }
8163
 
8164
+ return output;
8165
+ };
 
 
 
 
 
8166
 
8167
+ function renderTag(elem, opts) {
8168
+ // Handle SVG
8169
+ if (elem.name === "svg") opts = {decodeEntities: opts.decodeEntities, xmlMode: true};
8170
+
8171
+ var tag = '<' + elem.name,
8172
+ attribs = formatAttrs(elem.attribs, opts);
8173
+
8174
+ if (attribs) {
8175
+ tag += ' ' + attribs;
8176
+ }
8177
+
8178
+ if (
8179
+ opts.xmlMode
8180
+ && (!elem.children || elem.children.length === 0)
8181
+ ) {
8182
+ tag += '/>';
8183
+ } else {
8184
+ tag += '>';
8185
+ if (elem.children) {
8186
+ tag += render(elem.children, opts);
8187
  }
8188
 
8189
+ if (!singleTag[elem.name] || opts.xmlMode) {
8190
+ tag += '</' + elem.name + '>';
8191
+ }
8192
+ }
8193
 
8194
+ return tag;
8195
+ }
 
 
 
8196
 
8197
+ function renderDirective(elem) {
8198
+ return '<' + elem.data + '>';
8199
+ }
8200
 
8201
+ function renderText(elem, opts) {
8202
+ var data = elem.data || '';
 
 
 
 
 
8203
 
8204
+ // if entities weren't decoded, no need to encode them back
8205
+ if (opts.decodeEntities && !(elem.parent && elem.parent.name in unencodedElements)) {
8206
+ data = entities.encodeXML(data);
8207
+ }
8208
 
8209
+ return data;
8210
+ }
 
 
8211
 
8212
+ function renderCdata(elem) {
8213
+ return '<![CDATA[' + elem.children[0].data + ']]>';
8214
+ }
 
 
 
 
8215
 
8216
+ function renderComment(elem) {
8217
+ return '<!--' + elem.data + '-->';
8218
+ }
8219
 
 
 
 
8220
 
8221
+ /***/ }),
8222
+ /* 441 */
8223
+ /***/ (function(module, exports) {
 
 
8224
 
8225
+ //Types of elements found in the DOM
8226
+ module.exports = {
8227
+ Text: "text", //Text
8228
+ Directive: "directive", //<? ... ?>
8229
+ Comment: "comment", //<!-- ... -->
8230
+ Script: "script", //<script> tags
8231
+ Style: "style", //<style> tags
8232
+ Tag: "tag", //Any tag
8233
+ CDATA: "cdata", //<![CDATA[ ... ]]>
8234
 
8235
+ isTag: function(elem){
8236
+ return elem.type === "tag" || elem.type === "script" || elem.type === "style";
8237
+ }
8238
  };
8239
 
8240
+ /***/ }),
8241
+ /* 442 */
8242
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
8243
 
8244
+ var encode = __webpack_require__(443),
8245
+ decode = __webpack_require__(444);
 
 
 
 
8246
 
8247
+ exports.decode = function(data, level){
8248
+ return (!level || level <= 0 ? decode.XML : decode.HTML)(data);
8249
+ };
 
 
8250
 
8251
+ exports.decodeStrict = function(data, level){
8252
+ return (!level || level <= 0 ? decode.XML : decode.HTMLStrict)(data);
 
 
 
 
 
 
 
 
 
 
8253
  };
8254
 
8255
+ exports.encode = function(data, level){
8256
+ return (!level || level <= 0 ? encode.XML : encode.HTML)(data);
8257
+ };
 
8258
 
8259
+ exports.encodeXML = encode.XML;
 
 
 
 
 
 
8260
 
8261
+ exports.encodeHTML4 =
8262
+ exports.encodeHTML5 =
8263
+ exports.encodeHTML = encode.HTML;
 
 
 
 
8264
 
8265
+ exports.decodeXML =
8266
+ exports.decodeXMLStrict = decode.XML;
 
 
 
 
 
 
 
 
 
8267
 
8268
+ exports.decodeHTML4 =
8269
+ exports.decodeHTML5 =
8270
+ exports.decodeHTML = decode.HTML;
 
 
 
 
 
 
 
 
 
 
 
 
8271
 
8272
+ exports.decodeHTML4Strict =
8273
+ exports.decodeHTML5Strict =
8274
+ exports.decodeHTMLStrict = decode.HTMLStrict;
 
 
 
 
8275
 
8276
+ exports.escape = encode.escape;
 
 
 
 
8277
 
 
8278
 
8279
  /***/ }),
8280
+ /* 443 */
8281
  /***/ (function(module, exports, __webpack_require__) {
8282
 
8283
+ var inverseXML = getInverseObj(__webpack_require__(87)),
8284
+ xmlReplacer = getInverseReplacer(inverseXML);
8285
 
8286
+ exports.XML = getInverse(inverseXML, xmlReplacer);
8287
 
8288
+ var inverseHTML = getInverseObj(__webpack_require__(86)),
8289
+ htmlReplacer = getInverseReplacer(inverseHTML);
 
 
8290
 
8291
+ exports.HTML = getInverse(inverseHTML, htmlReplacer);
8292
 
8293
+ function getInverseObj(obj){
8294
+ return Object.keys(obj).sort().reduce(function(inverse, name){
8295
+ inverse[obj[name]] = "&" + name + ";";
8296
+ return inverse;
8297
+ }, {});
8298
+ }
8299
 
8300
+ function getInverseReplacer(inverse){
8301
+ var single = [],
8302
+ multiple = [];
8303
 
8304
+ Object.keys(inverse).forEach(function(k){
8305
+ if(k.length === 1){
8306
+ single.push("\\" + k);
8307
+ } else {
8308
+ multiple.push(k);
8309
+ }
8310
+ });
8311
 
8312
+ //TODO add ranges
8313
+ multiple.unshift("[" + single.join("") + "]");
 
8314
 
8315
+ return new RegExp(multiple.join("|"), "g");
8316
+ }
 
 
 
 
8317
 
8318
+ var re_nonASCII = /[^\0-\x7F]/g,
8319
+ re_astralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
 
 
 
 
 
 
 
 
 
8320
 
8321
+ function singleCharReplacer(c){
8322
+ return "&#x" + c.charCodeAt(0).toString(16).toUpperCase() + ";";
8323
+ }
 
8324
 
8325
+ function astralReplacer(c){
8326
+ // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
8327
+ var high = c.charCodeAt(0);
8328
+ var low = c.charCodeAt(1);
8329
+ var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000;
8330
+ return "&#x" + codePoint.toString(16).toUpperCase() + ";";
8331
+ }
8332
 
8333
+ function getInverse(inverse, re){
8334
+ function func(name){
8335
+ return inverse[name];
8336
+ }
 
 
 
 
 
 
 
 
 
8337
 
8338
+ return function(data){
8339
+ return data
8340
+ .replace(re, func)
8341
+ .replace(re_astralSymbols, astralReplacer)
8342
+ .replace(re_nonASCII, singleCharReplacer);
8343
+ };
8344
+ }
8345
 
8346
+ var re_xmlChars = getInverseReplacer(inverseXML);
8347
+
8348
+ function escapeXML(data){
8349
+ return data
8350
+ .replace(re_xmlChars, singleCharReplacer)
8351
+ .replace(re_astralSymbols, astralReplacer)
8352
+ .replace(re_nonASCII, singleCharReplacer);
8353
+ }
8354
+
8355
+ exports.escape = escapeXML;
8356
 
 
 
 
 
 
 
8357
 
8358
  /***/ }),
8359
+ /* 444 */
8360
  /***/ (function(module, exports, __webpack_require__) {
8361
 
8362
+ var entityMap = __webpack_require__(86),
8363
+ legacyMap = __webpack_require__(261),
8364
+ xmlMap = __webpack_require__(87),
8365
+ decodeCodePoint = __webpack_require__(260);
8366
 
8367
+ var decodeXMLStrict = getStrictDecoder(xmlMap),
8368
+ decodeHTMLStrict = getStrictDecoder(entityMap);
8369
 
8370
+ function getStrictDecoder(map){
8371
+ var keys = Object.keys(map).join("|"),
8372
+ replace = getReplacer(map);
 
8373
 
8374
+ keys += "|#[xX][\\da-fA-F]+|#\\d+";
8375
 
8376
+ var re = new RegExp("&(?:" + keys + ");", "g");
8377
 
8378
+ return function(str){
8379
+ return String(str).replace(re, replace);
8380
+ };
8381
+ }
8382
 
8383
+ var decodeHTML = (function(){
8384
+ var legacy = Object.keys(legacyMap)
8385
+ .sort(sorter);
 
8386
 
8387
+ var keys = Object.keys(entityMap)
8388
+ .sort(sorter);
 
 
 
 
8389
 
8390
+ for(var i = 0, j = 0; i < keys.length; i++){
8391
+ if(legacy[j] === keys[i]){
8392
+ keys[i] += ";?";
8393
+ j++;
8394
+ } else {
8395
+ keys[i] += ";";
8396
+ }
8397
+ }
8398
 
8399
+ var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"),
8400
+ replace = getReplacer(entityMap);
 
 
 
 
 
8401
 
8402
+ function replacer(str){
8403
+ if(str.substr(-1) !== ";") str += ";";
8404
+ return replace(str);
8405
+ }
 
 
 
 
 
 
 
 
8406
 
8407
+ //TODO consider creating a merged map
8408
+ return function(str){
8409
+ return String(str).replace(re, replacer);
8410
+ };
8411
+ }());
8412
 
8413
+ function sorter(a, b){
8414
+ return a < b ? 1 : -1;
8415
+ }
8416
 
8417
+ function getReplacer(map){
8418
+ return function replace(str){
8419
+ if(str.charAt(1) === "#"){
8420
+ if(str.charAt(2) === "X" || str.charAt(2) === "x"){
8421
+ return decodeCodePoint(parseInt(str.substr(3), 16));
8422
+ }
8423
+ return decodeCodePoint(parseInt(str.substr(2), 10));
8424
+ }
8425
+ return map[str.slice(1, -1)];
8426
+ };
8427
+ }
8428
 
8429
+ module.exports = {
8430
+ XML: decodeXMLStrict,
8431
+ HTML: decodeHTML,
8432
+ HTMLStrict: decodeHTMLStrict
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8433
  };
8434
 
8435
+ /***/ }),
8436
+ /* 445 */
8437
+ /***/ (function(module, exports) {
 
 
 
 
 
 
8438
 
8439
+ var getChildren = exports.getChildren = function(elem){
8440
+ return elem.children;
8441
+ };
8442
 
8443
+ var getParent = exports.getParent = function(elem){
8444
+ return elem.parent;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8445
  };
8446
 
8447
+ exports.getSiblings = function(elem){
8448
+ var parent = getParent(elem);
8449
+ return parent ? getChildren(parent) : [elem];
8450
+ };
8451
 
8452
+ exports.getAttributeValue = function(elem, name){
8453
+ return elem.attribs && elem.attribs[name];
8454
+ };
 
 
8455
 
8456
+ exports.hasAttrib = function(elem, name){
8457
+ return !!elem.attribs && hasOwnProperty.call(elem.attribs, name);
8458
+ };
 
 
 
 
 
 
8459
 
8460
+ exports.getName = function(elem){
8461
+ return elem.name;
8462
+ };
 
 
 
8463
 
 
 
8464
 
8465
+ /***/ }),
8466
+ /* 446 */
8467
+ /***/ (function(module, exports) {
 
 
8468
 
8469
+ exports.removeElement = function(elem){
8470
+ if(elem.prev) elem.prev.next = elem.next;
8471
+ if(elem.next) elem.next.prev = elem.prev;
 
8472
 
8473
+ if(elem.parent){
8474
+ var childs = elem.parent.children;
8475
+ childs.splice(childs.lastIndexOf(elem), 1);
8476
+ }
8477
  };
8478
 
8479
+ exports.replaceElement = function(elem, replacement){
8480
+ var prev = replacement.prev = elem.prev;
8481
+ if(prev){
8482
+ prev.next = replacement;
8483
+ }
 
 
 
8484
 
8485
+ var next = replacement.next = elem.next;
8486
+ if(next){
8487
+ next.prev = replacement;
8488
+ }
8489
+
8490
+ var parent = replacement.parent = elem.parent;
8491
+ if(parent){
8492
+ var childs = parent.children;
8493
+ childs[childs.lastIndexOf(elem)] = replacement;
8494
+ }
8495
  };
8496
 
8497
+ exports.appendChild = function(elem, child){
8498
+ child.parent = elem;
 
8499
 
8500
+ if(elem.children.push(child) !== 1){
8501
+ var sibling = elem.children[elem.children.length - 2];
8502
+ sibling.next = child;
8503
+ child.prev = sibling;
8504
+ child.next = null;
8505
+ }
8506
+ };
8507
 
8508
+ exports.append = function(elem, next){
8509
+ var parent = elem.parent,
8510
+ currNext = elem.next;
8511
 
8512
+ next.next = currNext;
8513
+ next.prev = elem;
8514
+ elem.next = next;
8515
+ next.parent = parent;
8516
 
8517
+ if(currNext){
8518
+ currNext.prev = next;
8519
+ if(parent){
8520
+ var childs = parent.children;
8521
+ childs.splice(childs.lastIndexOf(currNext), 0, next);
8522
+ }
8523
+ } else if(parent){
8524
+ parent.children.push(next);
8525
+ }
8526
+ };
8527
 
8528
+ exports.prepend = function(elem, prev){
8529
+ var parent = elem.parent;
8530
+ if(parent){
8531
+ var childs = parent.children;
8532
+ childs.splice(childs.lastIndexOf(elem), 0, prev);
8533
+ }
8534
 
8535
+ if(elem.prev){
8536
+ elem.prev.next = prev;
8537
+ }
8538
+
8539
+ prev.parent = parent;
8540
+ prev.prev = elem.prev;
8541
+ prev.next = elem;
8542
+ elem.prev = prev;
8543
+ };
8544
 
 
8545
 
 
8546
 
 
8547
 
8548
+ /***/ }),
8549
+ /* 447 */
8550
+ /***/ (function(module, exports, __webpack_require__) {
8551
 
8552
+ var isTag = __webpack_require__(45).isTag;
8553
 
8554
+ module.exports = {
8555
+ filter: filter,
8556
+ find: find,
8557
+ findOneChild: findOneChild,
8558
+ findOne: findOne,
8559
+ existsOne: existsOne,
8560
+ findAll: findAll
8561
+ };
8562
 
8563
+ function filter(test, element, recurse, limit){
8564
+ if(!Array.isArray(element)) element = [element];
8565
 
8566
+ if(typeof limit !== "number" || !isFinite(limit)){
8567
+ limit = Infinity;
8568
+ }
8569
+ return find(test, element, recurse !== false, limit);
8570
+ }
8571
 
8572
+ function find(test, elems, recurse, limit){
8573
+ var result = [], childs;
 
 
 
 
 
8574
 
8575
+ for(var i = 0, j = elems.length; i < j; i++){
8576
+ if(test(elems[i])){
8577
+ result.push(elems[i]);
8578
+ if(--limit <= 0) break;
8579
+ }
8580
 
8581
+ childs = elems[i].children;
8582
+ if(recurse && childs && childs.length > 0){
8583
+ childs = find(test, childs, recurse, limit);
8584
+ result = result.concat(childs);
8585
+ limit -= childs.length;
8586
+ if(limit <= 0) break;
8587
+ }
8588
+ }
8589
 
8590
+ return result;
8591
+ }
 
8592
 
8593
+ function findOneChild(test, elems){
8594
+ for(var i = 0, l = elems.length; i < l; i++){
8595
+ if(test(elems[i])) return elems[i];
8596
+ }
8597
 
8598
+ return null;
8599
+ }
 
 
8600
 
8601
+ function findOne(test, elems){
8602
+ var elem = null;
 
 
 
 
 
 
 
 
 
 
8603
 
8604
+ for(var i = 0, l = elems.length; i < l && !elem; i++){
8605
+ if(!isTag(elems[i])){
8606
+ continue;
8607
+ } else if(test(elems[i])){
8608
+ elem = elems[i];
8609
+ } else if(elems[i].children.length > 0){
8610
+ elem = findOne(test, elems[i].children);
8611
+ }
8612
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8613
 
8614
+ return elem;
8615
+ }
 
8616
 
8617
+ function existsOne(test, elems){
8618
+ for(var i = 0, l = elems.length; i < l; i++){
8619
+ if(
8620
+ isTag(elems[i]) && (
8621
+ test(elems[i]) || (
8622
+ elems[i].children.length > 0 &&
8623
+ existsOne(test, elems[i].children)
8624
+ )
8625
+ )
8626
+ ){
8627
+ return true;
8628
+ }
8629
+ }
8630
 
8631
+ return false;
8632
+ }
 
 
8633
 
8634
+ function findAll(test, rootElems){
8635
+ var result = [];
8636
+ var stack = [rootElems];
8637
+ while(stack.length){
8638
+ var elems = stack.pop();
8639
+ for(var i = 0, j = elems.length; i < j; i++){
8640
+ if(!isTag(elems[i])) continue;
8641
+ if(test(elems[i])) result.push(elems[i]);
8642
+ }
8643
+ while(j-- > 0){
8644
+ if(elems[j].children && elems[j].children.length > 0){
8645
+ stack.push(elems[j].children);
8646
+ }
8647
+ }
8648
+ }
8649
+ return result;
8650
+ }
8651
 
 
 
 
 
8652
 
8653
+ /***/ }),
8654
+ /* 448 */
8655
+ /***/ (function(module, exports, __webpack_require__) {
 
8656
 
8657
+ var ElementType = __webpack_require__(45);
8658
+ var isTag = exports.isTag = ElementType.isTag;
 
 
8659
 
8660
+ exports.testElement = function(options, element){
8661
+ for(var key in options){
8662
+ if(!options.hasOwnProperty(key));
8663
+ else if(key === "tag_name"){
8664
+ if(!isTag(element) || !options.tag_name(element.name)){
8665
+ return false;
8666
+ }
8667
+ } else if(key === "tag_type"){
8668
+ if(!options.tag_type(element.type)) return false;
8669
+ } else if(key === "tag_contains"){
8670
+ if(isTag(element) || !options.tag_contains(element.data)){
8671
+ return false;
8672
+ }
8673
+ } else if(!element.attribs || !options[key](element.attribs[key])){
8674
+ return false;
8675
+ }
8676
+ }
8677
+ return true;
8678
  };
8679
 
8680
+ var Checks = {
8681
+ tag_name: function(name){
8682
+ if(typeof name === "function"){
8683
+ return function(elem){ return isTag(elem) && name(elem.name); };
8684
+ } else if(name === "*"){
8685
+ return isTag;
8686
+ } else {
8687
+ return function(elem){ return isTag(elem) && elem.name === name; };
8688
+ }
8689
+ },
8690
+ tag_type: function(type){
8691
+ if(typeof type === "function"){
8692
+ return function(elem){ return type(elem.type); };
8693
+ } else {
8694
+ return function(elem){ return elem.type === type; };
8695
+ }
8696
+ },
8697
+ tag_contains: function(data){
8698
+ if(typeof data === "function"){
8699
+ return function(elem){ return !isTag(elem) && data(elem.data); };
8700
+ } else {
8701
+ return function(elem){ return !isTag(elem) && elem.data === data; };
8702
+ }
8703
+ }
8704
+ };
8705
 
8706
+ function getAttribCheck(attrib, value){
8707
+ if(typeof value === "function"){
8708
+ return function(elem){ return elem.attribs && value(elem.attribs[attrib]); };
8709
+ } else {
8710
+ return function(elem){ return elem.attribs && elem.attribs[attrib] === value; };
8711
+ }
8712
+ }
8713
 
8714
+ function combineFuncs(a, b){
8715
+ return function(elem){
8716
+ return a(elem) || b(elem);
8717
+ };
8718
+ }
8719
 
8720
+ exports.getElements = function(options, element, recurse, limit){
8721
+ var funcs = Object.keys(options).map(function(key){
8722
+ var value = options[key];
8723
+ return key in Checks ? Checks[key](value) : getAttribCheck(key, value);
8724
+ });
8725
 
8726
+ return funcs.length === 0 ? [] : this.filter(
8727
+ funcs.reduce(combineFuncs),
8728
+ element, recurse, limit
8729
+ );
8730
  };
8731
 
8732
+ exports.getElementById = function(id, element, recurse){
8733
+ if(!Array.isArray(element)) element = [element];
8734
+ return this.findOne(getAttribCheck("id", id), element, recurse !== false);
8735
+ };
8736
 
8737
+ exports.getElementsByTagName = function(name, element, recurse, limit){
8738
+ return this.filter(Checks.tag_name(name), element, recurse, limit);
 
 
8739
  };
8740
 
8741
+ exports.getElementsByTagType = function(type, element, recurse, limit){
8742
+ return this.filter(Checks.tag_type(type), element, recurse, limit);
8743
+ };
 
8744
 
 
 
 
 
 
 
8745
 
8746
+ /***/ }),
8747
+ /* 449 */
8748
+ /***/ (function(module, exports) {
8749
 
8750
+ // removeSubsets
8751
+ // Given an array of nodes, remove any member that is contained by another.
8752
+ exports.removeSubsets = function(nodes) {
8753
+ var idx = nodes.length, node, ancestor, replace;
8754
 
8755
+ // Check if each node (or one of its ancestors) is already contained in the
8756
+ // array.
8757
+ while (--idx > -1) {
8758
+ node = ancestor = nodes[idx];
 
 
 
 
 
8759
 
8760
+ // Temporarily remove the node under consideration
8761
+ nodes[idx] = null;
8762
+ replace = true;
8763
 
8764
+ while (ancestor) {
8765
+ if (nodes.indexOf(ancestor) > -1) {
8766
+ replace = false;
8767
+ nodes.splice(idx, 1);
8768
+ break;
8769
+ }
8770
+ ancestor = ancestor.parent;
8771
+ }
8772
 
8773
+ // If the node has been found to be unique, re-insert it.
8774
+ if (replace) {
8775
+ nodes[idx] = node;
8776
+ }
8777
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8778
 
8779
+ return nodes;
8780
+ };
 
8781
 
8782
+ // Source: http://dom.spec.whatwg.org/#dom-node-comparedocumentposition
8783
+ var POSITION = {
8784
+ DISCONNECTED: 1,
8785
+ PRECEDING: 2,
8786
+ FOLLOWING: 4,
8787
+ CONTAINS: 8,
8788
+ CONTAINED_BY: 16
8789
+ };
8790
 
8791
+ // Compare the position of one node against another node in any other document.
8792
+ // The return value is a bitmask with the following values:
8793
+ //
8794
+ // document order:
8795
+ // > There is an ordering, document order, defined on all the nodes in the
8796
+ // > document corresponding to the order in which the first character of the
8797
+ // > XML representation of each node occurs in the XML representation of the
8798
+ // > document after expansion of general entities. Thus, the document element
8799
+ // > node will be the first node. Element nodes occur before their children.
8800
+ // > Thus, document order orders element nodes in order of the occurrence of
8801
+ // > their start-tag in the XML (after expansion of entities). The attribute
8802
+ // > nodes of an element occur after the element and before its children. The
8803
+ // > relative order of attribute nodes is implementation-dependent./
8804
+ // Source:
8805
+ // http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order
8806
+ //
8807
+ // @argument {Node} nodaA The first node to use in the comparison
8808
+ // @argument {Node} nodeB The second node to use in the comparison
8809
+ //
8810
+ // @return {Number} A bitmask describing the input nodes' relative position.
8811
+ // See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for
8812
+ // a description of these values.
8813
+ var comparePos = exports.compareDocumentPosition = function(nodeA, nodeB) {
8814
+ var aParents = [];
8815
+ var bParents = [];
8816
+ var current, sharedParent, siblings, aSibling, bSibling, idx;
8817
 
8818
+ if (nodeA === nodeB) {
8819
+ return 0;
8820
+ }
8821
 
8822
+ current = nodeA;
8823
+ while (current) {
8824
+ aParents.unshift(current);
8825
+ current = current.parent;
8826
+ }
8827
+ current = nodeB;
8828
+ while (current) {
8829
+ bParents.unshift(current);
8830
+ current = current.parent;
8831
+ }
8832
 
8833
+ idx = 0;
8834
+ while (aParents[idx] === bParents[idx]) {
8835
+ idx++;
8836
+ }
8837
 
8838
+ if (idx === 0) {
8839
+ return POSITION.DISCONNECTED;
8840
+ }
8841
 
8842
+ sharedParent = aParents[idx - 1];
8843
+ siblings = sharedParent.children;
8844
+ aSibling = aParents[idx];
8845
+ bSibling = bParents[idx];
8846
 
8847
+ if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {
8848
+ if (sharedParent === nodeB) {
8849
+ return POSITION.FOLLOWING | POSITION.CONTAINED_BY;
8850
+ }
8851
+ return POSITION.FOLLOWING;
8852
+ } else {
8853
+ if (sharedParent === nodeA) {
8854
+ return POSITION.PRECEDING | POSITION.CONTAINS;
8855
+ }
8856
+ return POSITION.PRECEDING;
8857
+ }
8858
  };
8859
 
8860
+ // Sort an array of nodes based on their relative position in the document and
8861
+ // remove any duplicate nodes. If the array contains nodes that do not belong
8862
+ // to the same document, sort order is unspecified.
8863
+ //
8864
+ // @argument {Array} nodes Array of DOM nodes
8865
+ //
8866
+ // @returns {Array} collection of unique nodes, sorted in document order
8867
+ exports.uniqueSort = function(nodes) {
8868
+ var idx = nodes.length, node, position;
8869
 
8870
+ nodes = nodes.slice();
 
 
 
 
 
 
 
 
8871
 
8872
+ while (--idx > -1) {
8873
+ node = nodes[idx];
8874
+ position = nodes.indexOf(node);
8875
+ if (position > -1 && position < idx) {
8876
+ nodes.splice(idx, 1);
8877
+ }
8878
+ }
8879
+ nodes.sort(function(a, b) {
8880
+ var relative = comparePos(a, b);
8881
+ if (relative & POSITION.PRECEDING) {
8882
+ return -1;
8883
+ } else if (relative & POSITION.FOLLOWING) {
8884
+ return 1;
8885
+ }
8886
+ return 0;
8887
+ });
8888
 
8889
+ return nodes;
8890
+ };
 
 
 
 
 
8891
 
 
8892
 
8893
+ /***/ }),
8894
+ /* 450 */
8895
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8896
 
8897
+ module.exports = CollectingHandler;
 
 
 
 
 
 
 
 
8898
 
8899
+ function CollectingHandler(cbs){
8900
+ this._cbs = cbs || {};
8901
+ this.events = [];
8902
+ }
 
 
 
8903
 
8904
+ var EVENTS = __webpack_require__(38).EVENTS;
8905
+ Object.keys(EVENTS).forEach(function(name){
8906
+ if(EVENTS[name] === 0){
8907
+ name = "on" + name;
8908
+ CollectingHandler.prototype[name] = function(){
8909
+ this.events.push([name]);
8910
+ if(this._cbs[name]) this._cbs[name]();
8911
+ };
8912
+ } else if(EVENTS[name] === 1){
8913
+ name = "on" + name;
8914
+ CollectingHandler.prototype[name] = function(a){
8915
+ this.events.push([name, a]);
8916
+ if(this._cbs[name]) this._cbs[name](a);
8917
+ };
8918
+ } else if(EVENTS[name] === 2){
8919
+ name = "on" + name;
8920
+ CollectingHandler.prototype[name] = function(a, b){
8921
+ this.events.push([name, a, b]);
8922
+ if(this._cbs[name]) this._cbs[name](a, b);
8923
+ };
8924
+ } else {
8925
+ throw Error("wrong number of arguments");
8926
+ }
8927
+ });
8928
 
8929
+ CollectingHandler.prototype.onreset = function(){
8930
+ this.events = [];
8931
+ if(this._cbs.onreset) this._cbs.onreset();
8932
+ };
 
 
 
 
8933
 
8934
+ CollectingHandler.prototype.restart = function(){
8935
+ if(this._cbs.onreset) this._cbs.onreset();
8936
 
8937
+ for(var i = 0, len = this.events.length; i < len; i++){
8938
+ if(this._cbs[this.events[i][0]]){
 
 
8939
 
8940
+ var num = this.events[i].length;
 
8941
 
8942
+ if(num === 1){
8943
+ this._cbs[this.events[i][0]]();
8944
+ } else if(num === 2){
8945
+ this._cbs[this.events[i][0]](this.events[i][1]);
8946
+ } else {
8947
+ this._cbs[this.events[i][0]](this.events[i][1], this.events[i][2]);
8948
+ }
8949
+ }
8950
+ }
8951
+ };
8952
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8953
 
8954
+ /***/ }),
8955
+ /* 451 */
8956
+ /***/ (function(module, exports, __webpack_require__) {
8957
 
8958
+ "use strict";
 
 
 
 
 
 
 
8959
 
 
 
 
 
 
8960
 
8961
+ Object.defineProperty(exports, "__esModule", {
8962
+ value: true
8963
+ });
 
 
 
 
 
 
 
8964
 
8965
+ var _ElementType$Text$Ele;
 
 
 
 
 
 
 
 
8966
 
8967
+ var _htmlparser = __webpack_require__(38);
 
 
 
 
 
 
 
 
 
 
 
 
8968
 
8969
+ var _TextElementType = __webpack_require__(452);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8970
 
8971
+ var _TextElementType2 = _interopRequireDefault(_TextElementType);
8972
 
8973
+ var _TagElementType = __webpack_require__(453);
 
 
8974
 
8975
+ var _TagElementType2 = _interopRequireDefault(_TagElementType);
 
8976
 
8977
+ var _StyleElementType = __webpack_require__(460);
8978
+
8979
+ var _StyleElementType2 = _interopRequireDefault(_StyleElementType);
8980
+
8981
+ var _UnsupportedElementType = __webpack_require__(461);
8982
+
8983
+ var _UnsupportedElementType2 = _interopRequireDefault(_UnsupportedElementType);
8984
+
8985
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8986
+
8987
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /*
8988
+ * Map each htmlparser2 element type to a function which will convert that element type to a React element
8989
+ * Not all of the element types are supported so the UnsupportedElementType is used for them which will not return any
8990
+ * value
8991
+ */
8992
+
8993
+ exports.default = (_ElementType$Text$Ele = {}, _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Text, _TextElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Tag, _TagElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Style, _StyleElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Directive, _UnsupportedElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Comment, _UnsupportedElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Script, _UnsupportedElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.CDATA, _UnsupportedElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Doctype, _UnsupportedElementType2.default), _ElementType$Text$Ele);
8994
 
8995
  /***/ }),
8996
+ /* 452 */
8997
  /***/ (function(module, exports, __webpack_require__) {
8998
 
8999
  "use strict";
9000
 
9001
 
9002
  Object.defineProperty(exports, "__esModule", {
9003
+ value: true
9004
  });
9005
+ exports.default = TextElementType;
9006
+ /**
9007
+ * Converts a text node to a React text element
9008
+ *
9009
+ * @param {Object} node The text node
9010
+ * @returns {String} The text
9011
+ */
9012
+ function TextElementType(node) {
9013
 
9014
+ // React will accept plain text for rendering so just return the node data
9015
+ return node.data;
9016
+ }
 
 
 
 
9017
 
9018
+ /***/ }),
9019
+ /* 453 */
9020
+ /***/ (function(module, exports, __webpack_require__) {
 
9021
 
9022
+ "use strict";
 
 
 
 
9023
 
 
9024
 
9025
+ Object.defineProperty(exports, "__esModule", {
9026
+ value: true
9027
+ });
9028
+ exports.default = TagElementType;
 
 
 
9029
 
9030
+ var _react = __webpack_require__(2);
 
 
9031
 
9032
+ var _react2 = _interopRequireDefault(_react);
9033
 
9034
+ var _ProcessNodes = __webpack_require__(270);
 
 
 
 
 
 
9035
 
9036
+ var _ProcessNodes2 = _interopRequireDefault(_ProcessNodes);
 
 
 
9037
 
9038
+ var _GeneratePropsFromAttributes = __webpack_require__(271);
 
9039
 
9040
+ var _GeneratePropsFromAttributes2 = _interopRequireDefault(_GeneratePropsFromAttributes);
9041
 
9042
+ var _TransformTagName = __webpack_require__(458);
 
 
9043
 
9044
+ var _TransformTagName2 = _interopRequireDefault(_TransformTagName);
9045
 
9046
+ var _VoidElements = __webpack_require__(459);
9047
 
9048
+ var _VoidElements2 = _interopRequireDefault(_VoidElements);
 
 
 
9049
 
9050
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9051
 
9052
+ /**
9053
+ * Converts any element (excluding style - see StyleElementType - and script) to a react element.
9054
+ *
9055
+ * @param {Object} node The tag node
9056
+ * @param {String} key The key to give the React element
9057
+ * @returns {React.Element} The React tag element
9058
+ */
9059
+ function TagElementType(node, key) {
9060
 
9061
+ // generate props
9062
+ var props = (0, _GeneratePropsFromAttributes2.default)(node.attribs, key);
9063
 
9064
+ // transform the tag name if needed
9065
+ var tagName = (0, _TransformTagName2.default)(node.name);
 
 
 
 
9066
 
9067
+ // If the node is not a void element and has children then process them
9068
+ var children = null;
9069
+ if (_VoidElements2.default.indexOf(tagName) === -1) {
9070
+ children = (0, _ProcessNodes2.default)(node.children);
9071
+ }
9072
 
9073
+ // create and return the element
9074
+ return _react2.default.createElement(tagName, props, children);
9075
+ }
 
 
9076
 
9077
  /***/ }),
9078
+ /* 454 */
9079
  /***/ (function(module, exports, __webpack_require__) {
9080
 
9081
  "use strict";
9082
 
9083
 
9084
  Object.defineProperty(exports, "__esModule", {
9085
+ value: true
9086
  });
9087
+ exports.default = HtmlAttributesToReact;
 
 
 
9088
 
9089
+ var _BooleanAttributes = __webpack_require__(455);
 
 
 
 
 
 
 
 
9090
 
9091
+ var _BooleanAttributes2 = _interopRequireDefault(_BooleanAttributes);
 
 
9092
 
9093
+ var _ReactAttributes = __webpack_require__(456);
9094
 
9095
+ var _ReactAttributes2 = _interopRequireDefault(_ReactAttributes);
9096
 
9097
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
 
 
 
 
9098
 
9099
+ /**
9100
+ * Returns the parsed attribute value taking into account things like boolean attributes
9101
+ *
9102
+ * @param {String} attribute The name of the attribute
9103
+ * @param {*} value The value of the attribute from the HTML
9104
+ * @returns {*} The parsed attribute value
9105
+ */
9106
+ var getParsedAttributeValue = function getParsedAttributeValue(attribute, value) {
 
 
 
9107
 
9108
+ // if the attribute if a boolean then it's value should be the same as it's name
9109
+ // e.g. disabled="disabled"
9110
+ var lowerBooleanAttributes = _BooleanAttributes2.default.map(function (attr) {
9111
+ return attr.toLowerCase();
9112
+ });
9113
+ if (lowerBooleanAttributes.indexOf(attribute.toLowerCase()) >= 0) {
9114
+ value = attribute;
9115
+ }
9116
+
9117
+ return value;
9118
  };
9119
 
9120
+ /**
9121
+ * Takes an object of standard HTML property names and converts them to their React counterpart. If the react
9122
+ * version does not exist for an attribute then just use it as it is
9123
+ *
9124
+ * @param {Object} attributes The HTML attributes to convert
9125
+ * @returns {Object} The React attributes
9126
+ */
9127
+ function HtmlAttributesToReact(attributes) {
9128
+
9129
+ return Object.keys(attributes).reduce(function (mappedAttributes, attribute) {
9130
+
9131
+ // lowercase the attribute name and find it in the react attribute map
9132
+ var lowerCaseAttribute = attribute.toLowerCase();
9133
+
9134
+ // format the attribute name
9135
+ var name = _ReactAttributes2.default[lowerCaseAttribute] || lowerCaseAttribute;
9136
+
9137
+ // add the parsed attribute value to the mapped attributes
9138
+ mappedAttributes[name] = getParsedAttributeValue(name, attributes[attribute]);
9139
+
9140
+ return mappedAttributes;
9141
+ }, {});
9142
+ }
9143
+
9144
  /***/ }),
9145
+ /* 455 */
9146
  /***/ (function(module, exports, __webpack_require__) {
9147
 
9148
  "use strict";
9149
 
9150
 
9151
  Object.defineProperty(exports, "__esModule", {
9152
+ value: true
9153
  });
9154
+ /**
9155
+ * List of boolean attributes
9156
+ * These attributes should have their React attribute value set to be the same as their name
9157
+ * E.g. <input disabled> = <input disabled>
9158
+ * <input disabled=""> = <input disabled>
9159
+ * <input disabled="disabled"> = <input disabled>
9160
+ * @type {Array}
9161
+ */
9162
+ exports.default = ['allowfullScreen', 'async', 'autoplay', 'capture', 'checked', 'controls', 'default', 'defer', 'disabled', 'formnovalidate', 'hidden', 'loop', 'multiple', 'muted', 'novalidate', 'open', 'readonly', 'required', 'reversed', 'scoped', 'seamless', 'selected', 'itemscope'];
 
 
 
 
 
 
 
 
 
 
9163
 
9164
  /***/ }),
9165
+ /* 456 */
9166
  /***/ (function(module, exports, __webpack_require__) {
9167
 
9168
  "use strict";
9169
 
9170
 
9171
  Object.defineProperty(exports, "__esModule", {
9172
+ value: true
9173
  });
9174
+ /**
9175
+ * Mapping of standard HTML attributes to their React counterparts
9176
+ * List taken and reversed from react/src/renderers/dom/shared/HTMLDOMPropertyConfig.js
9177
+ * https://github.com/facebook/react/blob/c9c3c339b757682f1154f1c915eb55e6a8766933/src/renderers/dom/shared/HTMLDOMPropertyConfig.js
9178
+ * @type {Object}
9179
+ */
9180
+ exports.default = {
9181
+ /**
9182
+ * Standard Properties
9183
+ */
9184
+ accept: 'accept',
9185
+ 'accept-charset': 'acceptCharset',
9186
+ accesskey: 'accessKey',
9187
+ action: 'action',
9188
+ allowfullscreen: 'allowFullScreen',
9189
+ allowtransparency: 'allowTransparency',
9190
+ alt: 'alt',
9191
+ async: 'async',
9192
+ autocomplete: 'autoComplete',
9193
+ autoplay: 'autoPlay',
9194
+ capture: 'capture',
9195
+ cellpadding: 'cellPadding',
9196
+ cellspacing: 'cellSpacing',
9197
+ charset: 'charSet',
9198
+ challenge: 'challenge',
9199
+ checked: 'checked',
9200
+ classid: 'classID',
9201
+ class: 'className',
9202
+ cols: 'cols',
9203
+ colspan: 'colSpan',
9204
+ content: 'content',
9205
+ contenteditable: 'contentEditable',
9206
+ contextmenu: 'contextMenu',
9207
+ controls: 'controls',
9208
+ coords: 'coords',
9209
+ crossorigin: 'crossOrigin',
9210
+ data: 'data',
9211
+ datetime: 'dateTime',
9212
+ default: 'default',
9213
+ defer: 'defer',
9214
+ dir: 'dir',
9215
+ disabled: 'disabled',
9216
+ download: 'download',
9217
+ draggable: 'draggable',
9218
+ enctype: 'encType',
9219
+ form: 'form',
9220
+ formaction: 'formAction',
9221
+ formenctype: 'formEncType',
9222
+ formmethod: 'formMethod',
9223
+ formnovalidate: 'formNoValidate',
9224
+ formtarget: 'formTarget',
9225
+ frameborder: 'frameBorder',
9226
+ headers: 'headers',
9227
+ height: 'height',
9228
+ hidden: 'hidden',
9229
+ high: 'high',
9230
+ href: 'href',
9231
+ hreflang: 'hrefLang',
9232
+ for: 'htmlFor',
9233
+ 'http-equiv': 'httpEquiv',
9234
+ icon: 'icon',
9235
+ id: 'id',
9236
+ inputmode: 'inputMode',
9237
+ integrity: 'integrity',
9238
+ is: 'is',
9239
+ keyparams: 'keyParams',
9240
+ keytype: 'keyType',
9241
+ kind: 'kind',
9242
+ label: 'label',
9243
+ lang: 'lang',
9244
+ list: 'list',
9245
+ loop: 'loop',
9246
+ low: 'low',
9247
+ manifest: 'manifest',
9248
+ marginheight: 'marginHeight',
9249
+ marginwidth: 'marginWidth',
9250
+ max: 'max',
9251
+ maxlength: 'maxLength',
9252
+ media: 'media',
9253
+ mediagroup: 'mediaGroup',
9254
+ method: 'method',
9255
+ min: 'min',
9256
+ minlength: 'minLength',
9257
+ multiple: 'multiple',
9258
+ muted: 'muted',
9259
+ name: 'name',
9260
+ nonce: 'nonce',
9261
+ novalidate: 'noValidate',
9262
+ open: 'open',
9263
+ optimum: 'optimum',
9264
+ pattern: 'pattern',
9265
+ placeholder: 'placeholder',
9266
+ poster: 'poster',
9267
+ preload: 'preload',
9268
+ radiogroup: 'radioGroup',
9269
+ readonly: 'readOnly',
9270
+ rel: 'rel',
9271
+ required: 'required',
9272
+ reversed: 'reversed',
9273
+ role: 'role',
9274
+ rows: 'rows',
9275
+ rowspan: 'rowSpan',
9276
+ sandbox: 'sandbox',
9277
+ scope: 'scope',
9278
+ scoped: 'scoped',
9279
+ scrolling: 'scrolling',
9280
+ seamless: 'seamless',
9281
+ selected: 'selected',
9282
+ shape: 'shape',
9283
+ size: 'size',
9284
+ sizes: 'sizes',
9285
+ span: 'span',
9286
+ spellcheck: 'spellCheck',
9287
+ src: 'src',
9288
+ srcdoc: 'srcDoc',
9289
+ srclang: 'srcLang',
9290
+ srcset: 'srcSet',
9291
+ start: 'start',
9292
+ step: 'step',
9293
+ style: 'style',
9294
+ summary: 'summary',
9295
+ tabindex: 'tabIndex',
9296
+ target: 'target',
9297
+ title: 'title',
9298
+ type: 'type',
9299
+ usemap: 'useMap',
9300
+ value: 'value',
9301
+ width: 'width',
9302
+ wmode: 'wmode',
9303
+ wrap: 'wrap',
9304
+ /**
9305
+ * RDFa Properties
9306
+ */
9307
+ about: 'about',
9308
+ datatype: 'datatype',
9309
+ inlist: 'inlist',
9310
+ prefix: 'prefix',
9311
+ property: 'property',
9312
+ resource: 'resource',
9313
+ typeof: 'typeof',
9314
+ vocab: 'vocab',
9315
+ /**
9316
+ * Non-standard Properties
9317
+ */
9318
+ autocapitalize: 'autoCapitalize',
9319
+ autocorrect: 'autoCorrect',
9320
+ autosave: 'autoSave',
9321
+ color: 'color',
9322
+ itemprop: 'itemProp',
9323
+ itemscope: 'itemScope',
9324
+ itemtype: 'itemType',
9325
+ itemid: 'itemID',
9326
+ itemref: 'itemRef',
9327
+ results: 'results',
9328
+ security: 'security',
9329
+ unselectable: 'unselectable',
9330
+ autofocus: 'autoFocus'
9331
+ };
9332
 
9333
+ /***/ }),
9334
+ /* 457 */
9335
+ /***/ (function(module, exports, __webpack_require__) {
9336
 
9337
+ "use strict";
9338
 
 
9339
 
9340
+ Object.defineProperty(exports, "__esModule", {
9341
+ value: true
9342
+ });
9343
 
9344
+ var _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"); } }; }();
9345
 
9346
+ exports.default = InlineStyleToObject;
9347
+ /**
9348
+ * Converts an inline style string into an object of React style properties
9349
+ *
9350
+ * @param {String} inlineStyle='' The inline style to convert
9351
+ * @returns {Object} The converted style
9352
+ */
9353
+ function InlineStyleToObject() {
9354
+ var inlineStyle = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
9355
 
 
9356
 
9357
+ // just return empty object if the inlineStyle is empty
9358
+ if (inlineStyle === '') {
9359
+ return {};
9360
+ }
9361
 
9362
+ return inlineStyle.split(';').reduce(function (styleObject, stylePropertyValue) {
9363
 
9364
+ // extract the style property name and value
9365
 
9366
+ var _stylePropertyValue$s = stylePropertyValue.split(':').map(function (item) {
9367
+ return item.trim().toLowerCase();
9368
+ });
9369
 
9370
+ var _stylePropertyValue$s2 = _slicedToArray(_stylePropertyValue$s, 2);
9371
 
9372
+ var property = _stylePropertyValue$s2[0];
9373
+ var value = _stylePropertyValue$s2[1];
9374
 
9375
+ // if there is no value (i.e. no : in the style) then ignore it
9376
 
9377
+ if (value === undefined) {
9378
+ return styleObject;
9379
+ }
9380
 
9381
+ // convert the property name into the correct React format
9382
+ // remove all hyphens and convert the letter immediately after each hyphen to upper case
9383
+ // additionally don't uppercase any -ms- prefix
9384
+ // e.g. -ms-style-property = msStyleProperty
9385
+ // -webkit-style-property = WebkitStyleProperty
9386
+ property = property.replace(/^-ms-/, 'ms-').replace(/-(.)/g, function (_, character) {
9387
+ return character.toUpperCase();
9388
+ });
9389
 
9390
+ // add the new style property and value to the style object
9391
+ styleObject[property] = value;
 
 
 
 
 
 
 
 
 
 
 
 
 
9392
 
9393
+ return styleObject;
9394
+ }, {});
9395
+ }
9396
 
9397
+ /***/ }),
9398
+ /* 458 */
9399
+ /***/ (function(module, exports, __webpack_require__) {
9400
 
9401
+ "use strict";
 
 
9402
 
 
 
 
 
 
 
 
 
 
 
9403
 
9404
+ Object.defineProperty(exports, "__esModule", {
9405
+ value: true
9406
+ });
9407
+ exports.default = TransformTagName;
9408
+ var TAGS_TO_TRANSFORM = {
9409
+ 'html': 'div',
9410
+ 'head': 'div',
9411
+ 'body': 'div'
9412
  };
9413
 
9414
+ /**
9415
+ * Transforms the specified tag name to another tag name if needed
9416
+ *
9417
+ * @param {String} tagName The name of the tag
9418
+ * @returns {String} The transformed tag name or the original if it doesn't need to be transformed
9419
+ */
9420
+ function TransformTagName(tagName) {
9421
+ if (TAGS_TO_TRANSFORM.hasOwnProperty(tagName)) {
9422
+ return TAGS_TO_TRANSFORM[tagName];
9423
+ } else {
9424
+ return tagName;
9425
+ }
9426
+ }
9427
 
9428
+ /***/ }),
9429
+ /* 459 */
9430
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
9431
 
9432
+ "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9433
 
 
 
9434
 
9435
+ Object.defineProperty(exports, "__esModule", {
9436
+ value: true
9437
+ });
9438
+ /**
9439
+ * List of void elements
9440
+ * These elements are not allowed to have children
9441
+ * @type {Array}
9442
+ */
9443
+ exports.default = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
9444
 
9445
  /***/ }),
9446
+ /* 460 */
9447
  /***/ (function(module, exports, __webpack_require__) {
9448
 
9449
  "use strict";
9450
 
9451
 
9452
  Object.defineProperty(exports, "__esModule", {
9453
+ value: true
9454
  });
9455
+ exports.default = StyleElementType;
 
 
9456
 
9457
+ var _react = __webpack_require__(2);
9458
 
9459
+ var _react2 = _interopRequireDefault(_react);
9460
 
9461
+ var _GeneratePropsFromAttributes = __webpack_require__(271);
9462
 
9463
+ var _GeneratePropsFromAttributes2 = _interopRequireDefault(_GeneratePropsFromAttributes);
9464
 
9465
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9466
 
9467
+ /**
9468
+ * Converts a <style> element to a React element
9469
+ *
9470
+ * @param {Object} node The style node
9471
+ * @param {String} key The key to give the React element
9472
+ * @returns {React.Element} The React style element
9473
+ */
9474
+ function StyleElementType(node, key) {
9475
 
9476
+ // The style element only ever has a single child which is the styles so try and find this to add as
9477
+ // a child to the style element that will be created
9478
+ var styles = void 0;
9479
+ if (node.children.length > 0) {
9480
+ styles = node.children[0].data;
9481
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9482
 
9483
+ // generate props
9484
+ var props = (0, _GeneratePropsFromAttributes2.default)(node.attribs, key);
 
 
 
 
 
 
 
 
 
 
 
 
9485
 
9486
+ // create and return the element
9487
+ return _react2.default.createElement('style', props, styles);
9488
+ }
 
 
 
9489
 
9490
  /***/ }),
9491
+ /* 461 */
9492
  /***/ (function(module, exports, __webpack_require__) {
9493
 
9494
  "use strict";
9495
 
9496
 
9497
  Object.defineProperty(exports, "__esModule", {
9498
+ value: true
9499
  });
9500
+ exports.default = UnsupportedElementType;
9501
+ /**
9502
+ * Handles an unsupported element type by returning null so nothing is rendered
9503
+ * @returns {null}
9504
+ */
9505
+ function UnsupportedElementType() {
9506
 
9507
+ // do nothing because the element type is unsupported
9508
+ // comment, directive, script, cdata, doctype are all currently unsupported
9509
+ return null;
9510
+ }
9511
 
9512
+ /***/ }),
9513
+ /* 462 */,
9514
+ /* 463 */,
9515
+ /* 464 */,
9516
+ /* 465 */,
9517
+ /* 466 */,
9518
+ /* 467 */,
9519
+ /* 468 */,
9520
+ /* 469 */,
9521
+ /* 470 */,
9522
+ /* 471 */,
9523
+ /* 472 */,
9524
+ /* 473 */,
9525
+ /* 474 */,
9526
+ /* 475 */,
9527
+ /* 476 */,
9528
+ /* 477 */,
9529
+ /* 478 */,
9530
+ /* 479 */,
9531
+ /* 480 */
9532
+ /***/ (function(module, exports, __webpack_require__) {
9533
 
9534
+ "use strict";
 
9535
 
 
 
 
 
9536
 
9537
+ Object.defineProperty(exports, "__esModule", {
9538
+ value: true
9539
+ });
9540
+ exports.fromNewsletter = exports.fromUrl = exports.fromDom = undefined;
 
 
 
9541
 
9542
+ var _underscore = __webpack_require__(8);
 
9543
 
9544
+ var _underscore2 = _interopRequireDefault(_underscore);
 
 
 
 
9545
 
9546
+ var _mailpoet = __webpack_require__(4);
 
 
 
 
9547
 
9548
+ var _mailpoet2 = _interopRequireDefault(_mailpoet);
 
9549
 
9550
+ var _html2canvas = __webpack_require__(481);
 
 
 
 
 
 
9551
 
9552
+ var _html2canvas2 = _interopRequireDefault(_html2canvas);
 
 
 
 
 
9553
 
9554
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9555
 
9556
+ /**
9557
+ * Generates a thumbnail from a DOM element.
9558
+ *
9559
+ * @param {DOMElement} element
9560
+ * @return {Promise<String>} DataURL of the generated image.
9561
+ */
9562
+ var fromDom = exports.fromDom = function fromDom(element) {
9563
+ return (0, _html2canvas2.default)(element, {
9564
+ logging: false
9565
+ }).then(function (canvas) {
9566
+ return canvas.toDataURL('image/jpeg');
9567
+ });
9568
  };
9569
 
9570
+ /**
9571
+ * Generates a thumbnail from an URL.
9572
+ *
9573
+ * @param {String} url
9574
+ * @return {Promise<String>} DataURL of the generated image.
9575
+ */
9576
+ var fromUrl = exports.fromUrl = function fromUrl(url) {
9577
+ return new Promise(function (resolve, reject) {
9578
+ var iframe = document.createElement('iframe');
9579
+ var protocol = location.href.startsWith('https://') ? 'https:' : 'http:';
9580
+ iframe.src = protocol + url.replace(/^https?:/, '');
9581
+ iframe.style.opacity = 0;
9582
+ iframe.scrolling = 'no';
9583
+ iframe.onload = function () {
9584
+ fromDom(iframe.contentDocument.documentElement).then(function (image) {
9585
+ document.body.removeChild(iframe);
9586
+ resolve(image);
9587
+ }).catch(function () {
9588
+ document.body.removeChild(iframe);
9589
+ reject(_mailpoet2.default.I18n.t('errorWhileTakingScreenshot'));
9590
+ });
9591
+ };
9592
+ var onError = function onError() {
9593
+ document.body.removeChild(iframe);
9594
+ reject(_mailpoet2.default.I18n.t('errorWhileTakingScreenshot'));
9595
+ };
9596
+ iframe.onerror = onError;
9597
+ iframe.onError = onError;
9598
+ iframe.className = 'mailpoet_template_iframe';
9599
+ try {
9600
+ document.body.appendChild(iframe);
9601
+ } catch (err) {
9602
+ onError();
9603
+ }
9604
+ });
9605
+ };
9606
 
9607
+ /**
9608
+ * Generates a thumbnail from a newsletter's data.
9609
+ *
9610
+ * @param {Object} data
9611
+ * @return {Promise<String>} DataURL of the generated image.
9612
+ */
9613
+ var fromNewsletter = exports.fromNewsletter = function fromNewsletter(data) {
9614
+ return new Promise(function (resolve, reject) {
9615
+ var json = data;
9616
+ if (!_underscore2.default.isUndefined(json.body)) {
9617
+ json.body = JSON.stringify(json.body);
9618
+ }
9619
+ _mailpoet2.default.Ajax.post({
9620
+ api_version: window.mailpoet_api_version,
9621
+ endpoint: 'newsletters',
9622
+ action: 'showPreview',
9623
+ data: json
9624
+ }).done(function (response) {
9625
+ return fromUrl(response.meta.preview_url).then(resolve).catch(reject);
9626
+ }).fail(function (response) {
9627
+ return reject(response.errors);
9628
  });
9629
+ });
9630
  };
9631
 
9632
  /***/ }),
9633
+ /* 481 */
9634
+ /***/ (function(module, exports, __webpack_require__) {
9635
+
9636
+ /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["html2canvas"] = __webpack_require__(482);
9637
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9)))
9638
+
9639
+ /***/ }),
9640
+ /* 482 */
9641
+ /***/ (function(module, exports, __webpack_require__) {
9642
+
9643
+ /*!
9644
+ * html2canvas 1.0.0-alpha.12 <https://html2canvas.hertzen.com>
9645
+ * Copyright (c) 2018 Niklas von Hertzen <https://hertzen.com>
9646
+ * Released under MIT License
9647
+ */
9648
+ (function webpackUniversalModuleDefinition(root, factory) {
9649
+ if(true)
9650
+ module.exports = factory();
9651
+ else if(typeof define === 'function' && define.amd)
9652
+ define([], factory);
9653
+ else if(typeof exports === 'object')
9654
+ exports["html2canvas"] = factory();
9655
+ else
9656
+ root["html2canvas"] = factory();
9657
+ })(this, function() {
9658
+ return /******/ (function(modules) { // webpackBootstrap
9659
+ /******/ // The module cache
9660
+ /******/ var installedModules = {};
9661
+ /******/
9662
+ /******/ // The require function
9663
+ /******/ function __webpack_require__(moduleId) {
9664
+ /******/
9665
+ /******/ // Check if module is in cache
9666
+ /******/ if(installedModules[moduleId]) {
9667
+ /******/ return installedModules[moduleId].exports;
9668
+ /******/ }
9669
+ /******/ // Create a new module (and put it into the cache)
9670
+ /******/ var module = installedModules[moduleId] = {
9671
+ /******/ i: moduleId,
9672
+ /******/ l: false,
9673
+ /******/ exports: {}
9674
+ /******/ };
9675
+ /******/
9676
+ /******/ // Execute the module function
9677
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
9678
+ /******/
9679
+ /******/ // Flag the module as loaded
9680
+ /******/ module.l = true;
9681
+ /******/
9682
+ /******/ // Return the exports of the module
9683
+ /******/ return module.exports;
9684
+ /******/ }
9685
+ /******/
9686
+ /******/
9687
+ /******/ // expose the modules object (__webpack_modules__)
9688
+ /******/ __webpack_require__.m = modules;
9689
+ /******/
9690
+ /******/ // expose the module cache
9691
+ /******/ __webpack_require__.c = installedModules;
9692
+ /******/
9693
+ /******/ // define getter function for harmony exports
9694
+ /******/ __webpack_require__.d = function(exports, name, getter) {
9695
+ /******/ if(!__webpack_require__.o(exports, name)) {
9696
+ /******/ Object.defineProperty(exports, name, {
9697
+ /******/ configurable: false,
9698
+ /******/ enumerable: true,
9699
+ /******/ get: getter
9700
+ /******/ });
9701
+ /******/ }
9702
+ /******/ };
9703
+ /******/
9704
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
9705
+ /******/ __webpack_require__.n = function(module) {
9706
+ /******/ var getter = module && module.__esModule ?
9707
+ /******/ function getDefault() { return module['default']; } :
9708
+ /******/ function getModuleExports() { return module; };
9709
+ /******/ __webpack_require__.d(getter, 'a', getter);
9710
+ /******/ return getter;
9711
+ /******/ };
9712
+ /******/
9713
+ /******/ // Object.prototype.hasOwnProperty.call
9714
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
9715
+ /******/
9716
+ /******/ // __webpack_public_path__
9717
+ /******/ __webpack_require__.p = "";
9718
+ /******/
9719
+ /******/ // Load entry module and return exports
9720
+ /******/ return __webpack_require__(__webpack_require__.s = 27);
9721
+ /******/ })
9722
+ /************************************************************************/
9723
+ /******/ ([
9724
+ /* 0 */
9725
  /***/ (function(module, exports, __webpack_require__) {
9726
 
9727
  "use strict";
9728
 
9729
 
9730
+ // http://dev.w3.org/csswg/css-color/
9731
+
9732
  Object.defineProperty(exports, "__esModule", {
9733
  value: true
9734
  });
 
9735
 
9736
+ var _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"); } }; }();
9737
 
9738
+ var _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; }; }();
9739
+
9740
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9741
+
9742
+ var HEX3 = /^#([a-f0-9]{3})$/i;
9743
+ var hex3 = function hex3(value) {
9744
+ var match = value.match(HEX3);
9745
+ if (match) {
9746
+ 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];
9747
  }
9748
+ return false;
9749
+ };
9750
+
9751
+ var HEX6 = /^#([a-f0-9]{6})$/i;
9752
+ var hex6 = function hex6(value) {
9753
+ var match = value.match(HEX6);
9754
+ if (match) {
9755
+ return [parseInt(match[1].substring(0, 2), 16), parseInt(match[1].substring(2, 4), 16), parseInt(match[1].substring(4, 6), 16), null];
9756
  }
9757
+ return false;
9758
+ };
9759
 
9760
+ var RGB = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;
9761
+ var rgb = function rgb(value) {
9762
+ var match = value.match(RGB);
9763
+ if (match) {
9764
+ return [Number(match[1]), Number(match[2]), Number(match[3]), null];
9765
+ }
9766
+ return false;
9767
+ };
9768
 
9769
+ var RGBA = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/;
9770
+ var rgba = function rgba(value) {
9771
+ var match = value.match(RGBA);
9772
+ if (match && match.length > 4) {
9773
+ return [Number(match[1]), Number(match[2]), Number(match[3]), Number(match[4])];
9774
+ }
9775
+ return false;
9776
+ };
9777
 
9778
+ var fromArray = function fromArray(array) {
9779
+ return [Math.min(array[0], 255), Math.min(array[1], 255), Math.min(array[2], 255), array.length > 3 ? array[3] : null];
9780
+ };
9781
 
9782
+ var namedColor = function namedColor(name) {
9783
+ var color = NAMED_COLORS[name.toLowerCase()];
9784
+ return color ? color : false;
9785
+ };
9786
 
9787
+ var Color = function () {
9788
+ function Color(value) {
9789
+ _classCallCheck(this, Color);
 
 
9790
 
9791
+ var _ref = Array.isArray(value) ? fromArray(value) : hex3(value) || rgb(value) || rgba(value) || namedColor(value) || hex6(value) || [0, 0, 0, null],
9792
+ _ref2 = _slicedToArray(_ref, 4),
9793
+ r = _ref2[0],
9794
+ g = _ref2[1],
9795
+ b = _ref2[2],
9796
+ a = _ref2[3];
9797
 
9798
+ this.r = r;
9799
+ this.g = g;
9800
+ this.b = b;
9801
+ this.a = a;
9802
  }
9803
 
9804
+ _createClass(Color, [{
9805
+ key: 'isTransparent',
9806
+ value: function isTransparent() {
9807
+ return this.a === 0;
9808
+ }
9809
+ }, {
9810
+ key: 'toString',
9811
+ value: function toString() {
9812
+ return this.a !== null && this.a !== 1 ? 'rgba(' + this.r + ',' + this.g + ',' + this.b + ',' + this.a + ')' : 'rgb(' + this.r + ',' + this.g + ',' + this.b + ')';
9813
+ }
9814
+ }]);
9815
 
9816
+ return Color;
9817
+ }();
 
9818
 
9819
+ exports.default = Color;
9820
 
9821
 
9822
+ var NAMED_COLORS = {
9823
+ transparent: [0, 0, 0, 0],
9824
+ aliceblue: [240, 248, 255, null],
9825
+ antiquewhite: [250, 235, 215, null],
9826
+ aqua: [0, 255, 255, null],
9827
+ aquamarine: [127, 255, 212, null],
9828
+ azure: [240, 255, 255, null],
9829
+ beige: [245, 245, 220, null],
9830
+ bisque: [255, 228, 196, null],
9831
+ black: [0, 0, 0, null],
9832
+ blanchedalmond: [255, 235, 205, null],
9833
+ blue: [0, 0, 255, null],
9834
+ blueviolet: [138, 43, 226, null],
9835
+ brown: [165, 42, 42, null],
9836
+ burlywood: [222, 184, 135, null],
9837
+ cadetblue: [95, 158, 160, null],
9838
+ chartreuse: [127, 255, 0, null],
9839
+ chocolate: [210, 105, 30, null],
9840
+ coral: [255, 127, 80, null],
9841
+ cornflowerblue: [100, 149, 237, null],
9842
+ cornsilk: [255, 248, 220, null],
9843
+ crimson: [220, 20, 60, null],
9844
+ cyan: [0, 255, 255, null],
9845
+ darkblue: [0, 0, 139, null],
9846
+ darkcyan: [0, 139, 139, null],
9847
+ darkgoldenrod: [184, 134, 11, null],
9848
+ darkgray: [169, 169, 169, null],
9849
+ darkgreen: [0, 100, 0, null],
9850
+ darkgrey: [169, 169, 169, null],
9851
+ darkkhaki: [189, 183, 107, null],
9852
+ darkmagenta: [139, 0, 139, null],
9853
+ darkolivegreen: [85, 107, 47, null],
9854
+ darkorange: [255, 140, 0, null],
9855
+ darkorchid: [153, 50, 204, null],
9856
+ darkred: [139, 0, 0, null],
9857
+ darksalmon: [233, 150, 122, null],
9858
+ darkseagreen: [143, 188, 143, null],
9859
+ darkslateblue: [72, 61, 139, null],
9860
+ darkslategray: [47, 79, 79, null],
9861
+ darkslategrey: [47, 79, 79, null],
9862
+ darkturquoise: [0, 206, 209, null],
9863
+ darkviolet: [148, 0, 211, null],
9864
+ deeppink: [255, 20, 147, null],
9865
+ deepskyblue: [0, 191, 255, null],
9866
+ dimgray: [105, 105, 105, null],
9867
+ dimgrey: [105, 105, 105, null],
9868
+ dodgerblue: [30, 144, 255, null],
9869
+ firebrick: [178, 34, 34, null],
9870
+ floralwhite: [255, 250, 240, null],
9871
+ forestgreen: [34, 139, 34, null],
9872
+ fuchsia: [255, 0, 255, null],
9873
+ gainsboro: [220, 220, 220, null],
9874
+ ghostwhite: [248, 248, 255, null],
9875
+ gold: [255, 215, 0, null],
9876
+ goldenrod: [218, 165, 32, null],
9877
+ gray: [128, 128, 128, null],
9878
+ green: [0, 128, 0, null],
9879
+ greenyellow: [173, 255, 47, null],
9880
+ grey: [128, 128, 128, null],
9881
+ honeydew: [240, 255, 240, null],
9882
+ hotpink: [255, 105, 180, null],
9883
+ indianred: [205, 92, 92, null],
9884
+ indigo: [75, 0, 130, null],
9885
+ ivory: [255, 255, 240, null],
9886
+ khaki: [240, 230, 140, null],
9887
+ lavender: [230, 230, 250, null],
9888
+ lavenderblush: [255, 240, 245, null],
9889
+ lawngreen: [124, 252, 0, null],
9890
+ lemonchiffon: [255, 250, 205, null],
9891
+ lightblue: [173, 216, 230, null],
9892
+ lightcoral: [240, 128, 128, null],
9893
+ lightcyan: [224, 255, 255, null],
9894
+ lightgoldenrodyellow: [250, 250, 210, null],
9895
+ lightgray: [211, 211, 211, null],
9896
+ lightgreen: [144, 238, 144, null],
9897
+ lightgrey: [211, 211, 211, null],
9898
+ lightpink: [255, 182, 193, null],
9899
+ lightsalmon: [255, 160, 122, null],
9900
+ lightseagreen: [32, 178, 170, null],
9901
+ lightskyblue: [135, 206, 250, null],
9902
+ lightslategray: [119, 136, 153, null],
9903
+ lightslategrey: [119, 136, 153, null],
9904
+ lightsteelblue: [176, 196, 222, null],
9905
+ lightyellow: [255, 255, 224, null],
9906
+ lime: [0, 255, 0, null],
9907
+ limegreen: [50, 205, 50, null],
9908
+ linen: [250, 240, 230, null],
9909
+ magenta: [255, 0, 255, null],
9910
+ maroon: [128, 0, 0, null],
9911
+ mediumaquamarine: [102, 205, 170, null],
9912
+ mediumblue: [0, 0, 205, null],
9913
+ mediumorchid: [186, 85, 211, null],
9914
+ mediumpurple: [147, 112, 219, null],
9915
+ mediumseagreen: [60, 179, 113, null],
9916
+ mediumslateblue: [123, 104, 238, null],
9917
+ mediumspringgreen: [0, 250, 154, null],
9918
+ mediumturquoise: [72, 209, 204, null],
9919
+ mediumvioletred: [199, 21, 133, null],
9920
+ midnightblue: [25, 25, 112, null],
9921
+ mintcream: [245, 255, 250, null],
9922
+ mistyrose: [255, 228, 225, null],
9923
+ moccasin: [255, 228, 181, null],
9924
+ navajowhite: [255, 222, 173, null],
9925
+ navy: [0, 0, 128, null],
9926
+ oldlace: [253, 245, 230, null],
9927
+ olive: [128, 128, 0, null],
9928
+ olivedrab: [107, 142, 35, null],
9929
+ orange: [255, 165, 0, null],
9930
+ orangered: [255, 69, 0, null],
9931
+ orchid: [218, 112, 214, null],
9932
+ palegoldenrod: [238, 232, 170, null],
9933
+ palegreen: [152, 251, 152, null],
9934
+ paleturquoise: [175, 238, 238, null],
9935
+ palevioletred: [219, 112, 147, null],
9936
+ papayawhip: [255, 239, 213, null],
9937
+ peachpuff: [255, 218, 185, null],
9938
+ peru: [205, 133, 63, null],
9939
+ pink: [255, 192, 203, null],
9940
+ plum: [221, 160, 221, null],
9941
+ powderblue: [176, 224, 230, null],
9942
+ purple: [128, 0, 128, null],
9943
+ rebeccapurple: [102, 51, 153, null],
9944
+ red: [255, 0, 0, null],
9945
+ rosybrown: [188, 143, 143, null],
9946
+ royalblue: [65, 105, 225, null],
9947
+ saddlebrown: [139, 69, 19, null],
9948
+ salmon: [250, 128, 114, null],
9949
+ sandybrown: [244, 164, 96, null],
9950
+ seagreen: [46, 139, 87, null],
9951
+ seashell: [255, 245, 238, null],
9952
+ sienna: [160, 82, 45, null],
9953
+ silver: [192, 192, 192, null],
9954
+ skyblue: [135, 206, 235, null],
9955
+ slateblue: [106, 90, 205, null],
9956
+ slategray: [112, 128, 144, null],
9957
+ slategrey: [112, 128, 144, null],
9958
+ snow: [255, 250, 250, null],
9959
+ springgreen: [0, 255, 127, null],
9960
+ steelblue: [70, 130, 180, null],
9961
+ tan: [210, 180, 140, null],
9962
+ teal: [0, 128, 128, null],
9963
+ thistle: [216, 191, 216, null],
9964
+ tomato: [255, 99, 71, null],
9965
+ turquoise: [64, 224, 208, null],
9966
+ violet: [238, 130, 238, null],
9967
+ wheat: [245, 222, 179, null],
9968
+ white: [255, 255, 255, null],
9969
+ whitesmoke: [245, 245, 245, null],
9970
+ yellow: [255, 255, 0, null],
9971
+ yellowgreen: [154, 205, 50, null]
9972
+ };
9973
 
9974
+ var TRANSPARENT = exports.TRANSPARENT = new Color([0, 0, 0, 0]);
 
 
9975
 
9976
+ /***/ }),
9977
+ /* 1 */
9978
+ /***/ (function(module, exports, __webpack_require__) {
9979
 
9980
+ "use strict";
 
 
 
 
 
9981
 
 
 
 
 
9982
 
9983
+ Object.defineProperty(exports, "__esModule", {
9984
+ value: true
9985
+ });
9986
+ exports.calculateLengthFromValueWithUnit = exports.LENGTH_TYPE = undefined;
 
9987
 
9988
+ var _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; }; }();
9989
 
9990
+ var _NodeContainer = __webpack_require__(3);
 
 
9991
 
9992
+ var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
 
 
9993
 
9994
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
9995
 
9996
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
9997
 
9998
+ var LENGTH_WITH_UNIT = /([\d.]+)(px|r?em|%)/i;
 
9999
 
10000
+ var LENGTH_TYPE = exports.LENGTH_TYPE = {
10001
+ PX: 0,
10002
+ PERCENTAGE: 1
10003
+ };
10004
 
10005
+ var Length = function () {
10006
+ function Length(value) {
10007
+ _classCallCheck(this, Length);
10008
 
10009
+ this.type = value.substr(value.length - 1) === '%' ? LENGTH_TYPE.PERCENTAGE : LENGTH_TYPE.PX;
10010
+ var parsedValue = parseFloat(value);
10011
+ if (true && isNaN(parsedValue)) {
10012
+ console.error('Invalid value given for Length: "' + value + '"');
10013
+ }
10014
+ this.value = isNaN(parsedValue) ? 0 : parsedValue;
10015
+ }
10016
 
10017
+ _createClass(Length, [{
10018
+ key: 'isPercentage',
10019
+ value: function isPercentage() {
10020
+ return this.type === LENGTH_TYPE.PERCENTAGE;
10021
  }
10022
  }, {
10023
+ key: 'getAbsoluteValue',
10024
+ value: function getAbsoluteValue(parentLength) {
10025
+ return this.isPercentage() ? parentLength * (this.value / 100) : this.value;
10026
+ }
10027
+ }], [{
10028
+ key: 'create',
10029
+ value: function create(v) {
10030
+ return new Length(v);
10031
  }
10032
  }]);
10033
 
10034
+ return Length;
10035
  }();
10036
 
10037
+ exports.default = Length;
 
 
 
 
 
 
 
 
 
 
 
 
10038
 
 
10039
 
10040
+ var getRootFontSize = function getRootFontSize(container) {
10041
+ var parent = container.parent;
10042
+ return parent ? getRootFontSize(parent) : parseFloat(container.style.font.fontSize);
10043
+ };
10044
 
10045
+ var calculateLengthFromValueWithUnit = exports.calculateLengthFromValueWithUnit = function calculateLengthFromValueWithUnit(container, value, unit) {
10046
+ switch (unit) {
10047
+ case 'px':
10048
+ case '%':
10049
+ return new Length(value + unit);
10050
+ case 'em':
10051
+ case 'rem':
10052
+ var length = new Length(value);
10053
+ length.value *= unit === 'em' ? parseFloat(container.style.font.fontSize) : getRootFontSize(container);
10054
+ return length;
10055
+ default:
10056
+ // TODO: handle correctly if unknown unit is used
10057
+ return new Length('0');
10058
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10059
  };
10060
 
10061
  /***/ }),
10062
+ /* 2 */
10063
  /***/ (function(module, exports, __webpack_require__) {
10064
 
10065
  "use strict";
10066
 
10067
 
10068
+ Object.defineProperty(exports, "__esModule", {
10069
+ value: true
10070
+ });
10071
+ exports.parseBoundCurves = exports.calculatePaddingBoxPath = exports.calculateBorderBoxPath = exports.parsePathForBorder = exports.parseDocumentSize = exports.calculateContentBox = exports.calculatePaddingBox = exports.parseBounds = exports.Bounds = undefined;
10072
 
10073
+ var _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; }; }();
10074
 
10075
+ var _Vector = __webpack_require__(7);
10076
 
10077
+ var _Vector2 = _interopRequireDefault(_Vector);
10078
 
10079
+ var _BezierCurve = __webpack_require__(32);
10080
 
10081
+ var _BezierCurve2 = _interopRequireDefault(_BezierCurve);
10082
 
10083
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10084
 
10085
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
 
10086
 
10087
+ var TOP = 0;
10088
+ var RIGHT = 1;
10089
+ var BOTTOM = 2;
10090
+ var LEFT = 3;
 
10091
 
10092
+ var H = 0;
10093
+ var V = 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10094
 
10095
+ var Bounds = exports.Bounds = function () {
10096
+ function Bounds(x, y, w, h) {
10097
+ _classCallCheck(this, Bounds);
10098
 
10099
+ this.left = x;
10100
+ this.top = y;
10101
+ this.width = w;
10102
+ this.height = h;
 
10103
  }
 
 
10104
 
10105
+ _createClass(Bounds, null, [{
10106
+ key: 'fromClientRect',
10107
+ value: function fromClientRect(clientRect, scrollX, scrollY) {
10108
+ return new Bounds(clientRect.left + scrollX, clientRect.top + scrollY, clientRect.width, clientRect.height);
10109
+ }
10110
+ }]);
10111
 
10112
+ return Bounds;
10113
+ }();
10114
 
10115
+ var parseBounds = exports.parseBounds = function parseBounds(node, scrollX, scrollY) {
10116
+ return Bounds.fromClientRect(node.getBoundingClientRect(), scrollX, scrollY);
10117
+ };
10118
 
10119
+ var calculatePaddingBox = exports.calculatePaddingBox = function calculatePaddingBox(bounds, borders) {
10120
+ 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));
10121
+ };
10122
 
10123
+ var calculateContentBox = exports.calculateContentBox = function calculateContentBox(bounds, padding, borders) {
10124
+ // TODO support percentage paddings
10125
+ var paddingTop = padding[TOP].value;
10126
+ var paddingRight = padding[RIGHT].value;
10127
+ var paddingBottom = padding[BOTTOM].value;
10128
+ var paddingLeft = padding[LEFT].value;
10129
 
10130
+ 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));
10131
+ };
 
 
10132
 
10133
+ var parseDocumentSize = exports.parseDocumentSize = function parseDocumentSize(document) {
10134
+ var body = document.body;
10135
+ var documentElement = document.documentElement;
10136
 
10137
+ if (!body || !documentElement) {
10138
+ throw new Error( true ? 'Unable to get document size' : '');
10139
+ }
10140
+ var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));
10141
 
10142
+ var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));
10143
 
10144
+ return new Bounds(0, 0, width, height);
10145
+ };
10146
 
10147
+ var parsePathForBorder = exports.parsePathForBorder = function parsePathForBorder(curves, borderSide) {
10148
+ switch (borderSide) {
10149
+ case TOP:
10150
+ return createPathFromCurves(curves.topLeftOuter, curves.topLeftInner, curves.topRightOuter, curves.topRightInner);
10151
+ case RIGHT:
10152
+ return createPathFromCurves(curves.topRightOuter, curves.topRightInner, curves.bottomRightOuter, curves.bottomRightInner);
10153
+ case BOTTOM:
10154
+ return createPathFromCurves(curves.bottomRightOuter, curves.bottomRightInner, curves.bottomLeftOuter, curves.bottomLeftInner);
10155
+ case LEFT:
10156
+ default:
10157
+ return createPathFromCurves(curves.bottomLeftOuter, curves.bottomLeftInner, curves.topLeftOuter, curves.topLeftInner);
10158
+ }
10159
+ };
10160
 
10161
+ var createPathFromCurves = function createPathFromCurves(outer1, inner1, outer2, inner2) {
10162
+ var path = [];
10163
+ if (outer1 instanceof _BezierCurve2.default) {
10164
+ path.push(outer1.subdivide(0.5, false));
10165
+ } else {
10166
+ path.push(outer1);
10167
+ }
10168
 
10169
+ if (outer2 instanceof _BezierCurve2.default) {
10170
+ path.push(outer2.subdivide(0.5, true));
10171
+ } else {
10172
+ path.push(outer2);
10173
+ }
10174
 
10175
+ if (inner2 instanceof _BezierCurve2.default) {
10176
+ path.push(inner2.subdivide(0.5, true).reverse());
10177
+ } else {
10178
+ path.push(inner2);
10179
+ }
10180
 
10181
+ if (inner1 instanceof _BezierCurve2.default) {
10182
+ path.push(inner1.subdivide(0.5, false).reverse());
10183
+ } else {
10184
+ path.push(inner1);
10185
+ }
10186
 
10187
+ return path;
10188
+ };
10189
 
10190
+ var calculateBorderBoxPath = exports.calculateBorderBoxPath = function calculateBorderBoxPath(curves) {
10191
+ return [curves.topLeftOuter, curves.topRightOuter, curves.bottomRightOuter, curves.bottomLeftOuter];
10192
+ };
10193
 
10194
+ var calculatePaddingBoxPath = exports.calculatePaddingBoxPath = function calculatePaddingBoxPath(curves) {
10195
+ return [curves.topLeftInner, curves.topRightInner, curves.bottomRightInner, curves.bottomLeftInner];
10196
+ };
10197
 
10198
+ var parseBoundCurves = exports.parseBoundCurves = function parseBoundCurves(bounds, borders, borderRadius) {
10199
+ var tlh = borderRadius[CORNER.TOP_LEFT][H].getAbsoluteValue(bounds.width);
10200
+ var tlv = borderRadius[CORNER.TOP_LEFT][V].getAbsoluteValue(bounds.height);
10201
+ var trh = borderRadius[CORNER.TOP_RIGHT][H].getAbsoluteValue(bounds.width);
10202
+ var trv = borderRadius[CORNER.TOP_RIGHT][V].getAbsoluteValue(bounds.height);
10203
+ var brh = borderRadius[CORNER.BOTTOM_RIGHT][H].getAbsoluteValue(bounds.width);
10204
+ var brv = borderRadius[CORNER.BOTTOM_RIGHT][V].getAbsoluteValue(bounds.height);
10205
+ var blh = borderRadius[CORNER.BOTTOM_LEFT][H].getAbsoluteValue(bounds.width);
10206
+ var blv = borderRadius[CORNER.BOTTOM_LEFT][V].getAbsoluteValue(bounds.height);
10207
 
10208
+ var factors = [];
10209
+ factors.push((tlh + trh) / bounds.width);
10210
+ factors.push((blh + brh) / bounds.width);
10211
+ factors.push((tlv + blv) / bounds.height);
10212
+ factors.push((trv + brv) / bounds.height);
10213
+ var maxFactor = Math.max.apply(Math, factors);
10214
 
10215
+ if (maxFactor > 1) {
10216
+ tlh /= maxFactor;
10217
+ tlv /= maxFactor;
10218
+ trh /= maxFactor;
10219
+ trv /= maxFactor;
10220
+ brh /= maxFactor;
10221
+ brv /= maxFactor;
10222
+ blh /= maxFactor;
10223
+ blv /= maxFactor;
10224
+ }
10225
 
10226
+ var topWidth = bounds.width - trh;
10227
+ var rightHeight = bounds.height - brv;
10228
+ var bottomWidth = bounds.width - brh;
10229
+ var leftHeight = bounds.height - blv;
10230
 
10231
+ return {
10232
+ topLeftOuter: tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT) : new _Vector2.default(bounds.left, bounds.top),
10233
+ 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),
10234
+ 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),
10235
+ 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),
10236
+ 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),
10237
+ 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),
10238
+ 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),
10239
+ 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)
10240
+ };
10241
+ };
10242
 
10243
+ var CORNER = {
10244
+ TOP_LEFT: 0,
10245
+ TOP_RIGHT: 1,
10246
+ BOTTOM_RIGHT: 2,
10247
+ BOTTOM_LEFT: 3
10248
+ };
10249
 
10250
+ var getCurvePoints = function getCurvePoints(x, y, r1, r2, position) {
10251
+ var kappa = 4 * ((Math.sqrt(2) - 1) / 3);
10252
+ var ox = r1 * kappa; // control point offset horizontal
10253
+ var oy = r2 * kappa; // control point offset vertical
10254
+ var xm = x + r1; // x-middle
10255
+ var ym = y + r2; // y-middle
10256
 
10257
+ switch (position) {
10258
+ case CORNER.TOP_LEFT:
10259
+ 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));
10260
+ case CORNER.TOP_RIGHT:
10261
+ 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));
10262
+ case CORNER.BOTTOM_RIGHT:
10263
+ 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));
10264
+ case CORNER.BOTTOM_LEFT:
10265
+ default:
10266
+ 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));
10267
+ }
10268
+ };
10269
 
10270
+ /***/ }),
10271
+ /* 3 */
10272
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
10273
 
10274
+ "use strict";
 
 
 
10275
 
 
 
 
10276
 
10277
+ Object.defineProperty(exports, "__esModule", {
10278
+ value: true
10279
+ });
10280
 
10281
+ var _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; }; }();
 
 
 
 
10282
 
10283
+ var _Color = __webpack_require__(0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10284
 
10285
+ var _Color2 = _interopRequireDefault(_Color);
 
 
10286
 
10287
+ var _Util = __webpack_require__(4);
 
10288
 
10289
+ var _background = __webpack_require__(5);
 
 
10290
 
10291
+ var _border = __webpack_require__(12);
 
 
 
 
10292
 
10293
+ var _borderRadius = __webpack_require__(33);
 
 
10294
 
10295
+ var _display = __webpack_require__(34);
10296
 
10297
+ var _float = __webpack_require__(35);
 
 
 
 
10298
 
10299
+ var _font = __webpack_require__(36);
 
 
 
 
 
 
 
 
 
 
10300
 
10301
+ var _letterSpacing = __webpack_require__(37);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10302
 
10303
+ var _lineBreak = __webpack_require__(38);
 
 
 
 
 
10304
 
10305
+ var _listStyle = __webpack_require__(8);
 
 
10306
 
10307
+ var _margin = __webpack_require__(39);
10308
 
10309
+ var _overflow = __webpack_require__(40);
10310
 
10311
+ var _overflowWrap = __webpack_require__(18);
 
 
 
10312
 
10313
+ var _padding = __webpack_require__(17);
10314
 
10315
+ var _position = __webpack_require__(19);
10316
 
10317
+ var _textDecoration = __webpack_require__(11);
10318
 
10319
+ var _textShadow = __webpack_require__(41);
10320
 
10321
+ var _textTransform = __webpack_require__(20);
10322
 
10323
+ var _transform = __webpack_require__(42);
10324
+
10325
+ var _visibility = __webpack_require__(43);
10326
+
10327
+ var _wordBreak = __webpack_require__(44);
10328
+
10329
+ var _zIndex = __webpack_require__(45);
10330
+
10331
+ var _Bounds = __webpack_require__(2);
10332
 
10333
  var _Input = __webpack_require__(21);
10334
 
10335
  var _ListItem = __webpack_require__(14);
10336
 
 
 
10337
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10338
 
10339
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
10340
 
10341
+ var INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];
 
10342
 
10343
+ var NodeContainer = function () {
10344
+ function NodeContainer(node, parent, resourceLoader, index) {
10345
+ var _this = this;
10346
 
10347
+ _classCallCheck(this, NodeContainer);
 
 
10348
 
10349
+ this.parent = parent;
10350
+ this.tagName = node.tagName;
10351
+ this.index = index;
10352
+ this.childNodes = [];
10353
+ this.listItems = [];
10354
+ if (typeof node.start === 'number') {
10355
+ this.listStart = node.start;
10356
+ }
10357
+ var defaultView = node.ownerDocument.defaultView;
10358
+ var scrollX = defaultView.pageXOffset;
10359
+ var scrollY = defaultView.pageYOffset;
10360
+ var style = defaultView.getComputedStyle(node, null);
10361
+ var display = (0, _display.parseDisplay)(style.display);
10362
 
10363
+ var IS_INPUT = node.type === 'radio' || node.type === 'checkbox';
10364
 
10365
+ var position = (0, _position.parsePosition)(style.position);
 
 
 
10366
 
10367
+ this.style = {
10368
+ background: IS_INPUT ? _Input.INPUT_BACKGROUND : (0, _background.parseBackground)(style, resourceLoader),
10369
+ border: IS_INPUT ? _Input.INPUT_BORDERS : (0, _border.parseBorder)(style),
10370
+ borderRadius: (node instanceof defaultView.HTMLInputElement || node instanceof HTMLInputElement) && IS_INPUT ? (0, _Input.getInputBorderRadius)(node) : (0, _borderRadius.parseBorderRadius)(style),
10371
+ color: IS_INPUT ? _Input.INPUT_COLOR : new _Color2.default(style.color),
10372
+ display: display,
10373
+ float: (0, _float.parseCSSFloat)(style.float),
10374
+ font: (0, _font.parseFont)(style),
10375
+ letterSpacing: (0, _letterSpacing.parseLetterSpacing)(style.letterSpacing),
10376
+ listStyle: display === _display.DISPLAY.LIST_ITEM ? (0, _listStyle.parseListStyle)(style) : null,
10377
+ lineBreak: (0, _lineBreak.parseLineBreak)(style.lineBreak),
10378
+ margin: (0, _margin.parseMargin)(style),
10379
+ opacity: parseFloat(style.opacity),
10380
+ overflow: INPUT_TAGS.indexOf(node.tagName) === -1 ? (0, _overflow.parseOverflow)(style.overflow) : _overflow.OVERFLOW.HIDDEN,
10381
+ overflowWrap: (0, _overflowWrap.parseOverflowWrap)(style.overflowWrap ? style.overflowWrap : style.wordWrap),
10382
+ padding: (0, _padding.parsePadding)(style),
10383
+ position: position,
10384
+ textDecoration: (0, _textDecoration.parseTextDecoration)(style),
10385
+ textShadow: (0, _textShadow.parseTextShadow)(style.textShadow),
10386
+ textTransform: (0, _textTransform.parseTextTransform)(style.textTransform),
10387
+ transform: (0, _transform.parseTransform)(style),
10388
+ visibility: (0, _visibility.parseVisibility)(style.visibility),
10389
+ wordBreak: (0, _wordBreak.parseWordBreak)(style.wordBreak),
10390
+ zIndex: (0, _zIndex.parseZIndex)(position !== _position.POSITION.STATIC ? style.zIndex : 'auto')
10391
+ };
10392
 
10393
+ if (this.isTransformed()) {
10394
+ // getBoundingClientRect provides values post-transform, we want them without the transformation
10395
+ node.style.transform = 'matrix(1,0,0,1,0,0)';
10396
+ }
10397
+
10398
+ if (display === _display.DISPLAY.LIST_ITEM) {
10399
+ var listOwner = (0, _ListItem.getListOwner)(this);
10400
+ if (listOwner) {
10401
+ var listIndex = listOwner.listItems.length;
10402
+ listOwner.listItems.push(this);
10403
+ 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;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10404
  }
10405
  }
10406
+
10407
+ // TODO move bound retrieval for all nodes to a later stage?
10408
+ if (node.tagName === 'IMG') {
10409
+ node.addEventListener('load', function () {
10410
+ _this.bounds = (0, _Bounds.parseBounds)(node, scrollX, scrollY);
10411
+ _this.curvedBounds = (0, _Bounds.parseBoundCurves)(_this.bounds, _this.style.border, _this.style.borderRadius);
10412
+ });
10413
+ }
10414
+ this.image = getImage(node, resourceLoader);
10415
+ this.bounds = IS_INPUT ? (0, _Input.reformatInputBounds)((0, _Bounds.parseBounds)(node, scrollX, scrollY)) : (0, _Bounds.parseBounds)(node, scrollX, scrollY);
10416
+ this.curvedBounds = (0, _Bounds.parseBoundCurves)(this.bounds, this.style.border, this.style.borderRadius);
10417
+
10418
+ if (true) {
10419
+ this.name = '' + node.tagName.toLowerCase() + (node.id ? '#' + node.id : '') + node.className.toString().split(' ').map(function (s) {
10420
+ return s.length ? '.' + s : '';
10421
+ }).join('');
10422
+ }
10423
  }
 
10424
 
10425
+ _createClass(NodeContainer, [{
10426
+ key: 'getClipPaths',
10427
+ value: function getClipPaths() {
10428
+ var parentClips = this.parent ? this.parent.getClipPaths() : [];
10429
+ var isClipped = this.style.overflow !== _overflow.OVERFLOW.VISIBLE;
10430
 
10431
+ return isClipped ? parentClips.concat([(0, _Bounds.calculatePaddingBoxPath)(this.curvedBounds)]) : parentClips;
10432
+ }
10433
+ }, {
10434
+ key: 'isInFlow',
10435
+ value: function isInFlow() {
10436
+ return this.isRootElement() && !this.isFloating() && !this.isAbsolutelyPositioned();
10437
+ }
10438
+ }, {
10439
+ key: 'isVisible',
10440
+ value: function isVisible() {
10441
+ return !(0, _Util.contains)(this.style.display, _display.DISPLAY.NONE) && this.style.opacity > 0 && this.style.visibility === _visibility.VISIBILITY.VISIBLE;
10442
+ }
10443
+ }, {
10444
+ key: 'isAbsolutelyPositioned',
10445
+ value: function isAbsolutelyPositioned() {
10446
+ return this.style.position !== _position.POSITION.STATIC && this.style.position !== _position.POSITION.RELATIVE;
10447
+ }
10448
+ }, {
10449
+ key: 'isPositioned',
10450
+ value: function isPositioned() {
10451
+ return this.style.position !== _position.POSITION.STATIC;
10452
+ }
10453
+ }, {
10454
+ key: 'isFloating',
10455
+ value: function isFloating() {
10456
+ return this.style.float !== _float.FLOAT.NONE;
10457
+ }
10458
+ }, {
10459
+ key: 'isRootElement',
10460
+ value: function isRootElement() {
10461
+ return this.parent === null;
10462
+ }
10463
+ }, {
10464
+ key: 'isTransformed',
10465
+ value: function isTransformed() {
10466
+ return this.style.transform !== null;
10467
+ }
10468
+ }, {
10469
+ key: 'isPositionedWithZIndex',
10470
+ value: function isPositionedWithZIndex() {
10471
+ return this.isPositioned() && !this.style.zIndex.auto;
10472
+ }
10473
+ }, {
10474
+ key: 'isInlineLevel',
10475
+ value: function isInlineLevel() {
10476
+ 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);
10477
+ }
10478
+ }, {
10479
+ key: 'isInlineBlockOrInlineTable',
10480
+ value: function isInlineBlockOrInlineTable() {
10481
+ return (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_BLOCK) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_TABLE);
10482
+ }
10483
+ }]);
10484
 
10485
+ return NodeContainer;
10486
+ }();
10487
+
10488
+ exports.default = NodeContainer;
10489
+
10490
+
10491
+ var getImage = function getImage(node, resourceLoader) {
10492
+ if (node instanceof node.ownerDocument.defaultView.SVGSVGElement || node instanceof SVGSVGElement) {
10493
+ var s = new XMLSerializer();
10494
+ return resourceLoader.loadImage('data:image/svg+xml,' + encodeURIComponent(s.serializeToString(node)));
10495
+ }
10496
+ switch (node.tagName) {
10497
+ case 'IMG':
10498
+ // $FlowFixMe
10499
+ var img = node;
10500
+ return resourceLoader.loadImage(img.currentSrc || img.src);
10501
+ case 'CANVAS':
10502
+ // $FlowFixMe
10503
+ var canvas = node;
10504
+ return resourceLoader.loadCanvas(canvas);
10505
+ case 'IFRAME':
10506
+ var iframeKey = node.getAttribute('data-html2canvas-internal-iframe-key');
10507
+ if (iframeKey) {
10508
+ return iframeKey;
10509
+ }
10510
+ break;
10511
+ }
10512
+
10513
+ return null;
10514
  };
10515
 
10516
  /***/ }),
10517
+ /* 4 */
10518
  /***/ (function(module, exports, __webpack_require__) {
10519
 
10520
  "use strict";
10523
  Object.defineProperty(exports, "__esModule", {
10524
  value: true
10525
  });
10526
+ var contains = exports.contains = function contains(bit, value) {
10527
+ return (bit & value) !== 0;
10528
+ };
10529
 
10530
+ var distance = exports.distance = function distance(a, b) {
10531
+ return Math.sqrt(a * a + b * b);
10532
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10533
 
10534
+ var copyCSSStyles = exports.copyCSSStyles = function copyCSSStyles(style, target) {
10535
+ // Edge does not provide value for cssText
10536
+ for (var i = style.length - 1; i >= 0; i--) {
10537
+ var property = style.item(i);
10538
+ // Safari shows pseudoelements if content is set
10539
+ if (property !== 'content') {
10540
+ target.style.setProperty(property, style.getPropertyValue(property));
 
 
10541
  }
10542
+ }
10543
+ return target;
10544
+ };
 
10545
 
10546
+ var SMALL_IMAGE = exports.SMALL_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
10547
 
10548
  /***/ }),
10549
+ /* 5 */
10550
  /***/ (function(module, exports, __webpack_require__) {
10551
 
10552
  "use strict";
10555
  Object.defineProperty(exports, "__esModule", {
10556
  value: true
10557
  });
10558
+ exports.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;
10559
 
10560
+ var _Color = __webpack_require__(0);
10561
 
10562
+ var _Color2 = _interopRequireDefault(_Color);
 
 
 
 
 
 
 
 
 
 
 
 
 
10563
 
10564
+ var _Length = __webpack_require__(1);
10565
 
10566
+ var _Length2 = _interopRequireDefault(_Length);
 
 
10567
 
10568
+ var _Size = __webpack_require__(31);
10569
 
10570
+ var _Size2 = _interopRequireDefault(_Size);
10571
 
10572
  var _Vector = __webpack_require__(7);
10573
 
10574
  var _Vector2 = _interopRequireDefault(_Vector);
10575
 
10576
+ var _Bounds = __webpack_require__(2);
10577
+
10578
+ var _padding = __webpack_require__(17);
10579
+
10580
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10581
 
10582
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10583
 
10584
+ var BACKGROUND_REPEAT = exports.BACKGROUND_REPEAT = {
10585
+ REPEAT: 0,
10586
+ NO_REPEAT: 1,
10587
+ REPEAT_X: 2,
10588
+ REPEAT_Y: 3
10589
  };
10590
 
10591
+ var BACKGROUND_SIZE = exports.BACKGROUND_SIZE = {
10592
+ AUTO: 0,
10593
+ CONTAIN: 1,
10594
+ COVER: 2,
10595
+ LENGTH: 3
10596
+ };
10597
 
10598
+ var BACKGROUND_CLIP = exports.BACKGROUND_CLIP = {
10599
+ BORDER_BOX: 0,
10600
+ PADDING_BOX: 1,
10601
+ CONTENT_BOX: 2
10602
+ };
 
10603
 
10604
+ var BACKGROUND_ORIGIN = exports.BACKGROUND_ORIGIN = BACKGROUND_CLIP;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10605
 
10606
+ var AUTO = 'auto';
 
10607
 
10608
+ var BackgroundSize = function BackgroundSize(size) {
10609
+ _classCallCheck(this, BackgroundSize);
10610
 
10611
+ switch (size) {
10612
+ case 'contain':
10613
+ this.size = BACKGROUND_SIZE.CONTAIN;
10614
+ break;
10615
+ case 'cover':
10616
+ this.size = BACKGROUND_SIZE.COVER;
10617
+ break;
10618
+ case 'auto':
10619
+ this.size = BACKGROUND_SIZE.AUTO;
10620
+ break;
10621
+ default:
10622
+ this.value = new _Length2.default(size);
10623
+ }
10624
+ };
10625
 
10626
+ var calculateBackgroundSize = exports.calculateBackgroundSize = function calculateBackgroundSize(backgroundImage, image, bounds) {
10627
+ var width = 0;
10628
+ var height = 0;
10629
+ var size = backgroundImage.size;
10630
+ if (size[0].size === BACKGROUND_SIZE.CONTAIN || size[0].size === BACKGROUND_SIZE.COVER) {
10631
+ var targetRatio = bounds.width / bounds.height;
10632
+ var currentRatio = image.width / image.height;
10633
+ 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);
10634
+ }
10635
 
10636
+ if (size[0].value) {
10637
+ width = size[0].value.getAbsoluteValue(bounds.width);
10638
+ }
10639
 
10640
+ if (size[0].size === BACKGROUND_SIZE.AUTO && size[1].size === BACKGROUND_SIZE.AUTO) {
10641
+ height = image.height;
10642
+ } else if (size[1].size === BACKGROUND_SIZE.AUTO) {
10643
+ height = width / image.width * image.height;
10644
+ } else if (size[1].value) {
10645
+ height = size[1].value.getAbsoluteValue(bounds.height);
10646
+ }
10647
 
10648
+ if (size[0].size === BACKGROUND_SIZE.AUTO) {
10649
+ width = height / image.height * image.width;
10650
+ }
10651
 
10652
+ return new _Size2.default(width, height);
10653
+ };
10654
 
10655
+ var calculateGradientBackgroundSize = exports.calculateGradientBackgroundSize = function calculateGradientBackgroundSize(backgroundImage, bounds) {
10656
+ var size = backgroundImage.size;
10657
+ var width = size[0].value ? size[0].value.getAbsoluteValue(bounds.width) : bounds.width;
10658
+ var height = size[1].value ? size[1].value.getAbsoluteValue(bounds.height) : size[0].value ? width : bounds.height;
10659
 
10660
+ return new _Size2.default(width, height);
10661
+ };
10662
 
10663
+ var AUTO_SIZE = new BackgroundSize(AUTO);
10664
 
10665
+ var calculateBackgroungPaintingArea = exports.calculateBackgroungPaintingArea = function calculateBackgroungPaintingArea(curves, clip) {
10666
+ switch (clip) {
10667
+ case BACKGROUND_CLIP.BORDER_BOX:
10668
+ return (0, _Bounds.calculateBorderBoxPath)(curves);
10669
+ case BACKGROUND_CLIP.PADDING_BOX:
10670
+ default:
10671
+ return (0, _Bounds.calculatePaddingBoxPath)(curves);
10672
+ }
10673
+ };
10674
 
10675
+ var calculateBackgroungPositioningArea = exports.calculateBackgroungPositioningArea = function calculateBackgroungPositioningArea(backgroundOrigin, bounds, padding, border) {
10676
+ var paddingBox = (0, _Bounds.calculatePaddingBox)(bounds, border);
 
 
10677
 
10678
+ switch (backgroundOrigin) {
10679
+ case BACKGROUND_ORIGIN.BORDER_BOX:
10680
+ return bounds;
10681
+ case BACKGROUND_ORIGIN.CONTENT_BOX:
10682
+ var paddingLeft = padding[_padding.PADDING_SIDES.LEFT].getAbsoluteValue(bounds.width);
10683
+ var paddingRight = padding[_padding.PADDING_SIDES.RIGHT].getAbsoluteValue(bounds.width);
10684
+ var paddingTop = padding[_padding.PADDING_SIDES.TOP].getAbsoluteValue(bounds.width);
10685
+ var paddingBottom = padding[_padding.PADDING_SIDES.BOTTOM].getAbsoluteValue(bounds.width);
10686
+ return new _Bounds.Bounds(paddingBox.left + paddingLeft, paddingBox.top + paddingTop, paddingBox.width - paddingLeft - paddingRight, paddingBox.height - paddingTop - paddingBottom);
10687
+ case BACKGROUND_ORIGIN.PADDING_BOX:
10688
+ default:
10689
+ return paddingBox;
10690
+ }
10691
  };
10692
 
10693
+ var calculateBackgroundPosition = exports.calculateBackgroundPosition = function calculateBackgroundPosition(position, size, bounds) {
10694
+ return new _Vector2.default(position[0].getAbsoluteValue(bounds.width - size.width), position[1].getAbsoluteValue(bounds.height - size.height));
10695
+ };
10696
 
10697
+ var calculateBackgroundRepeatPath = exports.calculateBackgroundRepeatPath = function calculateBackgroundRepeatPath(background, position, size, backgroundPositioningArea, bounds) {
10698
+ var repeat = background.repeat;
10699
+ switch (repeat) {
10700
+ case BACKGROUND_REPEAT.REPEAT_X:
10701
+ 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))];
10702
+ case BACKGROUND_REPEAT.REPEAT_Y:
10703
+ 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))];
10704
+ case BACKGROUND_REPEAT.NO_REPEAT:
10705
+ 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))];
10706
+ default:
10707
+ 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))];
10708
+ }
10709
+ };
10710
 
10711
+ var parseBackground = exports.parseBackground = function parseBackground(style, resourceLoader) {
10712
+ return {
10713
+ backgroundColor: new _Color2.default(style.backgroundColor),
10714
+ backgroundImage: parseBackgroundImages(style, resourceLoader),
10715
+ backgroundClip: parseBackgroundClip(style.backgroundClip),
10716
+ backgroundOrigin: parseBackgroundOrigin(style.backgroundOrigin)
10717
+ };
10718
+ };
10719
 
10720
+ var parseBackgroundClip = function parseBackgroundClip(backgroundClip) {
10721
+ switch (backgroundClip) {
10722
+ case 'padding-box':
10723
+ return BACKGROUND_CLIP.PADDING_BOX;
10724
+ case 'content-box':
10725
+ return BACKGROUND_CLIP.CONTENT_BOX;
10726
+ }
10727
+ return BACKGROUND_CLIP.BORDER_BOX;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10728
  };
10729
 
10730
+ var parseBackgroundOrigin = function parseBackgroundOrigin(backgroundOrigin) {
10731
+ switch (backgroundOrigin) {
10732
+ case 'padding-box':
10733
+ return BACKGROUND_ORIGIN.PADDING_BOX;
10734
+ case 'content-box':
10735
+ return BACKGROUND_ORIGIN.CONTENT_BOX;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10736
  }
10737
+ return BACKGROUND_ORIGIN.BORDER_BOX;
10738
+ };
10739
 
10740
+ var parseBackgroundRepeat = function parseBackgroundRepeat(backgroundRepeat) {
10741
+ switch (backgroundRepeat.trim()) {
10742
+ case 'no-repeat':
10743
+ return BACKGROUND_REPEAT.NO_REPEAT;
10744
+ case 'repeat-x':
10745
+ case 'repeat no-repeat':
10746
+ return BACKGROUND_REPEAT.REPEAT_X;
10747
+ case 'repeat-y':
10748
+ case 'no-repeat repeat':
10749
+ return BACKGROUND_REPEAT.REPEAT_Y;
10750
+ case 'repeat':
10751
+ return BACKGROUND_REPEAT.REPEAT;
10752
+ }
10753
+
10754
+ if (true) {
10755
+ console.error('Invalid background-repeat value "' + backgroundRepeat + '"');
10756
+ }
10757
+
10758
+ return BACKGROUND_REPEAT.REPEAT;
10759
  };
10760
 
10761
+ var parseBackgroundImages = function parseBackgroundImages(style, resourceLoader) {
10762
+ var sources = parseBackgroundImage(style.backgroundImage).map(function (backgroundImage) {
10763
+ if (backgroundImage.method === 'url') {
10764
+ var key = resourceLoader.loadImage(backgroundImage.args[0]);
10765
+ backgroundImage.args = key ? [key] : [];
10766
+ }
10767
+ return backgroundImage;
10768
+ });
10769
+ var positions = style.backgroundPosition.split(',');
10770
+ var repeats = style.backgroundRepeat.split(',');
10771
+ var sizes = style.backgroundSize.split(',');
10772
+
10773
+ return sources.map(function (source, index) {
10774
+ var size = (sizes[index] || AUTO).trim().split(' ').map(parseBackgroundSize);
10775
+ var position = (positions[index] || AUTO).trim().split(' ').map(parseBackgoundPosition);
10776
+
10777
+ return {
10778
+ source: source,
10779
+ repeat: parseBackgroundRepeat(typeof repeats[index] === 'string' ? repeats[index] : repeats[0]),
10780
+ size: size.length < 2 ? [size[0], AUTO_SIZE] : [size[0], size[1]],
10781
+ position: position.length < 2 ? [position[0], position[0]] : [position[0], position[1]]
10782
+ };
10783
+ });
10784
  };
10785
 
10786
+ var parseBackgroundSize = function parseBackgroundSize(size) {
10787
+ return size === 'auto' ? AUTO_SIZE : new BackgroundSize(size);
10788
+ };
10789
+
10790
+ var parseBackgoundPosition = function parseBackgoundPosition(position) {
10791
+ switch (position) {
10792
+ case 'bottom':
10793
+ case 'right':
10794
+ return new _Length2.default('100%');
10795
+ case 'left':
10796
+ case 'top':
10797
+ return new _Length2.default('0%');
10798
+ case 'auto':
10799
+ return new _Length2.default('0');
10800
+ }
10801
+ return new _Length2.default(position);
10802
+ };
10803
+
10804
+ var parseBackgroundImage = exports.parseBackgroundImage = function parseBackgroundImage(image) {
10805
+ var whitespace = /^\s$/;
10806
+ var results = [];
10807
+
10808
+ var args = [];
10809
+ var method = '';
10810
+ var quote = null;
10811
+ var definition = '';
10812
+ var mode = 0;
10813
+ var numParen = 0;
10814
+
10815
+ var appendResult = function appendResult() {
10816
+ var prefix = '';
10817
+ if (method) {
10818
+ if (definition.substr(0, 1) === '"') {
10819
+ definition = definition.substr(1, definition.length - 2);
10820
+ }
10821
+
10822
+ if (definition) {
10823
+ args.push(definition.trim());
10824
+ }
10825
+
10826
+ var prefix_i = method.indexOf('-', 1) + 1;
10827
+ if (method.substr(0, 1) === '-' && prefix_i > 0) {
10828
+ prefix = method.substr(0, prefix_i).toLowerCase();
10829
+ method = method.substr(prefix_i);
10830
+ }
10831
+ method = method.toLowerCase();
10832
+ if (method !== 'none') {
10833
+ results.push({
10834
+ prefix: prefix,
10835
+ method: method,
10836
+ args: args
10837
+ });
10838
+ }
10839
+ }
10840
+ args = [];
10841
+ method = definition = '';
10842
+ };
10843
+
10844
+ image.split('').forEach(function (c) {
10845
+ if (mode === 0 && whitespace.test(c)) {
10846
+ return;
10847
+ }
10848
+ switch (c) {
10849
+ case '"':
10850
+ if (!quote) {
10851
+ quote = c;
10852
+ } else if (quote === c) {
10853
+ quote = null;
10854
+ }
10855
+ break;
10856
+ case '(':
10857
+ if (quote) {
10858
+ break;
10859
+ } else if (mode === 0) {
10860
+ mode = 1;
10861
+ return;
10862
+ } else {
10863
+ numParen++;
10864
+ }
10865
+ break;
10866
+ case ')':
10867
+ if (quote) {
10868
+ break;
10869
+ } else if (mode === 1) {
10870
+ if (numParen === 0) {
10871
+ mode = 0;
10872
+ appendResult();
10873
+ return;
10874
+ } else {
10875
+ numParen--;
10876
+ }
10877
+ }
10878
+ break;
10879
+
10880
+ case ',':
10881
+ if (quote) {
10882
+ break;
10883
+ } else if (mode === 0) {
10884
+ appendResult();
10885
+ return;
10886
+ } else if (mode === 1) {
10887
+ if (numParen === 0 && !method.match(/^url$/i)) {
10888
+ args.push(definition.trim());
10889
+ definition = '';
10890
+ return;
10891
+ }
10892
+ }
10893
+ break;
10894
+ }
10895
+
10896
+ if (mode === 0) {
10897
+ method += c;
10898
+ } else {
10899
+ definition += c;
10900
+ }
10901
+ });
10902
+
10903
+ appendResult();
10904
+ return results;
10905
  };
10906
 
10907
  /***/ }),
10908
+ /* 6 */
10909
  /***/ (function(module, exports, __webpack_require__) {
10910
 
10911
  "use strict";
10914
  Object.defineProperty(exports, "__esModule", {
10915
  value: true
10916
  });
10917
+ var PATH = exports.PATH = {
10918
+ VECTOR: 0,
10919
+ BEZIER_CURVE: 1,
10920
+ CIRCLE: 2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10921
  };
10922
 
10923
  /***/ }),
10924
+ /* 7 */
10925
  /***/ (function(module, exports, __webpack_require__) {
10926
 
10927
  "use strict";
10931
  value: true
10932
  });
10933
 
10934
+ var _Path = __webpack_require__(6);
10935
 
10936
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
10937
 
10938
+ var Vector = function Vector(x, y) {
10939
+ _classCallCheck(this, Vector);
 
 
 
 
 
 
 
 
10940
 
10941
+ this.type = _Path.PATH.VECTOR;
10942
+ this.x = x;
10943
+ this.y = y;
10944
+ if (true) {
10945
+ if (isNaN(x)) {
10946
+ console.error('Invalid x value given for Vector');
10947
+ }
10948
+ if (isNaN(y)) {
10949
+ console.error('Invalid y value given for Vector');
10950
+ }
10951
+ }
10952
  };
10953
 
10954
+ exports.default = Vector;
10955
+
10956
  /***/ }),
10957
+ /* 8 */
10958
  /***/ (function(module, exports, __webpack_require__) {
10959
 
10960
  "use strict";
10963
  Object.defineProperty(exports, "__esModule", {
10964
  value: true
10965
  });
10966
+ exports.parseListStyle = exports.parseListStyleType = exports.LIST_STYLE_TYPE = exports.LIST_STYLE_POSITION = undefined;
 
 
 
 
 
 
10967
 
10968
+ var _background = __webpack_require__(5);
 
 
10969
 
10970
+ var LIST_STYLE_POSITION = exports.LIST_STYLE_POSITION = {
10971
+ INSIDE: 0,
10972
+ OUTSIDE: 1
10973
+ };
10974
 
10975
+ var LIST_STYLE_TYPE = exports.LIST_STYLE_TYPE = {
10976
+ NONE: -1,
10977
+ DISC: 0,
10978
+ CIRCLE: 1,
10979
+ SQUARE: 2,
10980
+ DECIMAL: 3,
10981
+ CJK_DECIMAL: 4,
10982
+ DECIMAL_LEADING_ZERO: 5,
10983
+ LOWER_ROMAN: 6,
10984
+ UPPER_ROMAN: 7,
10985
+ LOWER_GREEK: 8,
10986
+ LOWER_ALPHA: 9,
10987
+ UPPER_ALPHA: 10,
10988
+ ARABIC_INDIC: 11,
10989
+ ARMENIAN: 12,
10990
+ BENGALI: 13,
10991
+ CAMBODIAN: 14,
10992
+ CJK_EARTHLY_BRANCH: 15,
10993
+ CJK_HEAVENLY_STEM: 16,
10994
+ CJK_IDEOGRAPHIC: 17,
10995
+ DEVANAGARI: 18,
10996
+ ETHIOPIC_NUMERIC: 19,
10997
+ GEORGIAN: 20,
10998
+ GUJARATI: 21,
10999
+ GURMUKHI: 22,
11000
+ HEBREW: 22,
11001
+ HIRAGANA: 23,
11002
+ HIRAGANA_IROHA: 24,
11003
+ JAPANESE_FORMAL: 25,
11004
+ JAPANESE_INFORMAL: 26,
11005
+ KANNADA: 27,
11006
+ KATAKANA: 28,
11007
+ KATAKANA_IROHA: 29,
11008
+ KHMER: 30,
11009
+ KOREAN_HANGUL_FORMAL: 31,
11010
+ KOREAN_HANJA_FORMAL: 32,
11011
+ KOREAN_HANJA_INFORMAL: 33,
11012
+ LAO: 34,
11013
+ LOWER_ARMENIAN: 35,
11014
+ MALAYALAM: 36,
11015
+ MONGOLIAN: 37,
11016
+ MYANMAR: 38,
11017
+ ORIYA: 39,
11018
+ PERSIAN: 40,
11019
+ SIMP_CHINESE_FORMAL: 41,
11020
+ SIMP_CHINESE_INFORMAL: 42,
11021
+ TAMIL: 43,
11022
+ TELUGU: 44,
11023
+ THAI: 45,
11024
+ TIBETAN: 46,
11025
+ TRAD_CHINESE_FORMAL: 47,
11026
+ TRAD_CHINESE_INFORMAL: 48,
11027
+ UPPER_ARMENIAN: 49,
11028
+ DISCLOSURE_OPEN: 50,
11029
+ DISCLOSURE_CLOSED: 51
11030
+ };
11031
 
11032
+ var parseListStyleType = exports.parseListStyleType = function parseListStyleType(type) {
11033
+ switch (type) {
11034
+ case 'disc':
11035
+ return LIST_STYLE_TYPE.DISC;
11036
+ case 'circle':
11037
+ return LIST_STYLE_TYPE.CIRCLE;
11038
+ case 'square':
11039
+ return LIST_STYLE_TYPE.SQUARE;
11040
+ case 'decimal':
11041
+ return LIST_STYLE_TYPE.DECIMAL;
11042
+ case 'cjk-decimal':
11043
+ return LIST_STYLE_TYPE.CJK_DECIMAL;
11044
+ case 'decimal-leading-zero':
11045
+ return LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO;
11046
+ case 'lower-roman':
11047
+ return LIST_STYLE_TYPE.LOWER_ROMAN;
11048
+ case 'upper-roman':
11049
+ return LIST_STYLE_TYPE.UPPER_ROMAN;
11050
+ case 'lower-greek':
11051
+ return LIST_STYLE_TYPE.LOWER_GREEK;
11052
+ case 'lower-alpha':
11053
+ return LIST_STYLE_TYPE.LOWER_ALPHA;
11054
+ case 'upper-alpha':
11055
+ return LIST_STYLE_TYPE.UPPER_ALPHA;
11056
+ case 'arabic-indic':
11057
+ return LIST_STYLE_TYPE.ARABIC_INDIC;
11058
+ case 'armenian':
11059
+ return LIST_STYLE_TYPE.ARMENIAN;
11060
+ case 'bengali':
11061
+ return LIST_STYLE_TYPE.BENGALI;
11062
+ case 'cambodian':
11063
+ return LIST_STYLE_TYPE.CAMBODIAN;
11064
+ case 'cjk-earthly-branch':
11065
+ return LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH;
11066
+ case 'cjk-heavenly-stem':
11067
+ return LIST_STYLE_TYPE.CJK_HEAVENLY_STEM;
11068
+ case 'cjk-ideographic':
11069
+ return LIST_STYLE_TYPE.CJK_IDEOGRAPHIC;
11070
+ case 'devanagari':
11071
+ return LIST_STYLE_TYPE.DEVANAGARI;
11072
+ case 'ethiopic-numeric':
11073
+ return LIST_STYLE_TYPE.ETHIOPIC_NUMERIC;
11074
+ case 'georgian':
11075
+ return LIST_STYLE_TYPE.GEORGIAN;
11076
+ case 'gujarati':
11077
+ return LIST_STYLE_TYPE.GUJARATI;
11078
+ case 'gurmukhi':
11079
+ return LIST_STYLE_TYPE.GURMUKHI;
11080
+ case 'hebrew':
11081
+ return LIST_STYLE_TYPE.HEBREW;
11082
+ case 'hiragana':
11083
+ return LIST_STYLE_TYPE.HIRAGANA;
11084
+ case 'hiragana-iroha':
11085
+ return LIST_STYLE_TYPE.HIRAGANA_IROHA;
11086
+ case 'japanese-formal':
11087
+ return LIST_STYLE_TYPE.JAPANESE_FORMAL;
11088
+ case 'japanese-informal':
11089
+ return LIST_STYLE_TYPE.JAPANESE_INFORMAL;
11090
+ case 'kannada':
11091
+ return LIST_STYLE_TYPE.KANNADA;
11092
+ case 'katakana':
11093
+ return LIST_STYLE_TYPE.KATAKANA;
11094
+ case 'katakana-iroha':
11095
+ return LIST_STYLE_TYPE.KATAKANA_IROHA;
11096
+ case 'khmer':
11097
+ return LIST_STYLE_TYPE.KHMER;
11098
+ case 'korean-hangul-formal':
11099
+ return LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL;
11100
+ case 'korean-hanja-formal':
11101
+ return LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL;
11102
+ case 'korean-hanja-informal':
11103
+ return LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL;
11104
+ case 'lao':
11105
+ return LIST_STYLE_TYPE.LAO;
11106
+ case 'lower-armenian':
11107
+ return LIST_STYLE_TYPE.LOWER_ARMENIAN;
11108
+ case 'malayalam':
11109
+ return LIST_STYLE_TYPE.MALAYALAM;
11110
+ case 'mongolian':
11111
+ return LIST_STYLE_TYPE.MONGOLIAN;
11112
+ case 'myanmar':
11113
+ return LIST_STYLE_TYPE.MYANMAR;
11114
+ case 'oriya':
11115
+ return LIST_STYLE_TYPE.ORIYA;
11116
+ case 'persian':
11117
+ return LIST_STYLE_TYPE.PERSIAN;
11118
+ case 'simp-chinese-formal':
11119
+ return LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL;
11120
+ case 'simp-chinese-informal':
11121
+ return LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL;
11122
+ case 'tamil':
11123
+ return LIST_STYLE_TYPE.TAMIL;
11124
+ case 'telugu':
11125
+ return LIST_STYLE_TYPE.TELUGU;
11126
+ case 'thai':
11127
+ return LIST_STYLE_TYPE.THAI;
11128
+ case 'tibetan':
11129
+ return LIST_STYLE_TYPE.TIBETAN;
11130
+ case 'trad-chinese-formal':
11131
+ return LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL;
11132
+ case 'trad-chinese-informal':
11133
+ return LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL;
11134
+ case 'upper-armenian':
11135
+ return LIST_STYLE_TYPE.UPPER_ARMENIAN;
11136
+ case 'disclosure-open':
11137
+ return LIST_STYLE_TYPE.DISCLOSURE_OPEN;
11138
+ case 'disclosure-closed':
11139
+ return LIST_STYLE_TYPE.DISCLOSURE_CLOSED;
11140
+ case 'none':
11141
+ default:
11142
+ return LIST_STYLE_TYPE.NONE;
11143
+ }
11144
  };
11145
 
11146
+ var parseListStyle = exports.parseListStyle = function parseListStyle(style) {
11147
+ var listStyleImage = (0, _background.parseBackgroundImage)(style.getPropertyValue('list-style-image'));
11148
+ return {
11149
+ listStyleType: parseListStyleType(style.getPropertyValue('list-style-type')),
11150
+ listStyleImage: listStyleImage.length ? listStyleImage[0] : null,
11151
+ listStylePosition: parseListStylePosition(style.getPropertyValue('list-style-position'))
11152
+ };
11153
+ };
11154
+
11155
+ var parseListStylePosition = function parseListStylePosition(position) {
11156
+ switch (position) {
11157
+ case 'inside':
11158
+ return LIST_STYLE_POSITION.INSIDE;
11159
+ case 'outside':
11160
  default:
11161
+ return LIST_STYLE_POSITION.OUTSIDE;
11162
  }
11163
  };
11164
 
11165
  /***/ }),
11166
+ /* 9 */
11167
  /***/ (function(module, exports, __webpack_require__) {
11168
 
11169
  "use strict";
11172
  Object.defineProperty(exports, "__esModule", {
11173
  value: true
11174
  });
 
11175
 
11176
+ var _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; }; }();
11177
 
11178
+ var _textTransform = __webpack_require__(20);
11179
 
11180
+ var _TextBounds = __webpack_require__(22);
11181
 
11182
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11183
 
11184
+ var TextContainer = function () {
11185
+ function TextContainer(text, parent, bounds) {
11186
+ _classCallCheck(this, TextContainer);
 
 
11187
 
11188
+ this.text = text;
11189
+ this.parent = parent;
11190
+ this.bounds = bounds;
11191
+ }
11192
 
11193
+ _createClass(TextContainer, null, [{
11194
+ key: 'fromTextNode',
11195
+ value: function fromTextNode(node, parent) {
11196
+ var text = transform(node.data, parent.style.textTransform);
11197
+ return new TextContainer(text, parent, (0, _TextBounds.parseTextBounds)(text, parent, node));
11198
+ }
11199
+ }]);
11200
 
11201
+ return TextContainer;
11202
+ }();
11203
 
11204
+ exports.default = TextContainer;
 
 
 
 
 
 
 
 
11205
 
11206
+
11207
+ var CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g;
11208
+
11209
+ var transform = function transform(text, _transform) {
11210
+ switch (_transform) {
11211
+ case _textTransform.TEXT_TRANSFORM.LOWERCASE:
11212
+ return text.toLowerCase();
11213
+ case _textTransform.TEXT_TRANSFORM.CAPITALIZE:
11214
+ return text.replace(CAPITALIZE, capitalize);
11215
+ case _textTransform.TEXT_TRANSFORM.UPPERCASE:
11216
+ return text.toUpperCase();
11217
  default:
11218
+ return text;
11219
  }
11220
  };
11221
 
11222
+ function capitalize(m, p1, p2) {
11223
+ if (m.length > 0) {
11224
+ return p1 + p2.toUpperCase();
11225
+ }
11226
+
11227
+ return m;
11228
+ }
11229
+
11230
  /***/ }),
11231
+ /* 10 */
11232
  /***/ (function(module, exports, __webpack_require__) {
11233
 
11234
  "use strict";
11237
  Object.defineProperty(exports, "__esModule", {
11238
  value: true
11239
  });
 
 
 
 
 
11240
 
11241
+ var _ForeignObjectRenderer = __webpack_require__(23);
 
 
11242
 
11243
+ var testRangeBounds = function testRangeBounds(document) {
11244
+ var TEST_HEIGHT = 123;
 
 
11245
 
11246
+ if (document.createRange) {
11247
+ var range = document.createRange();
11248
+ if (range.getBoundingClientRect) {
11249
+ var testElement = document.createElement('boundtest');
11250
+ testElement.style.height = TEST_HEIGHT + 'px';
11251
+ testElement.style.display = 'block';
11252
+ document.body.appendChild(testElement);
11253
 
11254
+ range.selectNode(testElement);
11255
+ var rangeBounds = range.getBoundingClientRect();
11256
+ var rangeHeight = Math.round(rangeBounds.height);
11257
+ document.body.removeChild(testElement);
11258
+ if (rangeHeight === TEST_HEIGHT) {
11259
+ return true;
11260
  }
11261
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11262
  }
11263
 
11264
+ return false;
11265
  };
11266
 
11267
+ // iOS 10.3 taints canvas with base64 images unless crossOrigin = 'anonymous'
11268
+ var testBase64 = function testBase64(document, src) {
11269
+ var img = new Image();
11270
+ var canvas = document.createElement('canvas');
11271
+ var ctx = canvas.getContext('2d');
11272
 
11273
+ return new Promise(function (resolve) {
11274
+ // Single pixel base64 image renders fine on iOS 10.3???
11275
+ img.src = src;
11276
 
11277
+ var onload = function onload() {
11278
+ try {
11279
+ ctx.drawImage(img, 0, 0);
11280
+ canvas.toDataURL();
11281
+ } catch (e) {
11282
+ return resolve(false);
11283
+ }
11284
 
11285
+ return resolve(true);
11286
+ };
 
 
11287
 
11288
+ img.onload = onload;
11289
+ img.onerror = function () {
11290
+ return resolve(false);
11291
+ };
11292
 
11293
+ if (img.complete === true) {
11294
+ setTimeout(function () {
11295
+ onload();
11296
+ }, 500);
11297
+ }
11298
+ });
11299
+ };
11300
 
11301
+ var testCORS = function testCORS() {
11302
+ return typeof new Image().crossOrigin !== 'undefined';
11303
+ };
11304
 
11305
+ var testResponseType = function testResponseType() {
11306
+ return typeof new XMLHttpRequest().responseType === 'string';
11307
  };
11308
 
11309
+ var testSVG = function testSVG(document) {
11310
+ var img = new Image();
11311
+ var canvas = document.createElement('canvas');
11312
+ var ctx = canvas.getContext('2d');
11313
+ img.src = 'data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\'></svg>';
11314
 
11315
+ try {
11316
+ ctx.drawImage(img, 0, 0);
11317
+ canvas.toDataURL();
11318
+ } catch (e) {
11319
+ return false;
 
 
 
11320
  }
11321
+ return true;
 
 
 
 
 
 
 
 
11322
  };
11323
 
11324
+ var isGreenPixel = function isGreenPixel(data) {
11325
+ return data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255;
 
 
 
 
 
 
11326
  };
11327
 
11328
+ var testForeignObject = function testForeignObject(document) {
11329
+ var canvas = document.createElement('canvas');
11330
+ var size = 100;
11331
+ canvas.width = size;
11332
+ canvas.height = size;
11333
+ var ctx = canvas.getContext('2d');
11334
+ ctx.fillStyle = 'rgb(0, 255, 0)';
11335
+ ctx.fillRect(0, 0, size, size);
11336
+
11337
+ var img = new Image();
11338
+ var greenImageSrc = canvas.toDataURL();
11339
+ img.src = greenImageSrc;
11340
+ var svg = (0, _ForeignObjectRenderer.createForeignObjectSVG)(size, size, 0, 0, img);
11341
+ ctx.fillStyle = 'red';
11342
+ ctx.fillRect(0, 0, size, size);
11343
+
11344
+ return (0, _ForeignObjectRenderer.loadSerializedSVG)(svg).then(function (img) {
11345
+ ctx.drawImage(img, 0, 0);
11346
+ var data = ctx.getImageData(0, 0, size, size).data;
11347
+ ctx.fillStyle = 'red';
11348
+ ctx.fillRect(0, 0, size, size);
11349
+
11350
+ var node = document.createElement('div');
11351
+ node.style.backgroundImage = 'url(' + greenImageSrc + ')';
11352
+ node.style.height = size + 'px';
11353
+ // Firefox 55 does not render inline <img /> tags
11354
+ return isGreenPixel(data) ? (0, _ForeignObjectRenderer.loadSerializedSVG)((0, _ForeignObjectRenderer.createForeignObjectSVG)(size, size, 0, 0, node)) : Promise.reject(false);
11355
+ }).then(function (img) {
11356
+ ctx.drawImage(img, 0, 0);
11357
+ // Edge does not render background-images
11358
+ return isGreenPixel(ctx.getImageData(0, 0, size, size).data);
11359
+ }).catch(function (e) {
11360
+ return false;
11361
+ });
11362
  };
11363
 
11364
+ var FEATURES = {
11365
+ // $FlowFixMe - get/set properties not yet supported
11366
+ get SUPPORT_RANGE_BOUNDS() {
11367
+ 'use strict';
11368
 
11369
+ var value = testRangeBounds(document);
11370
+ Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });
11371
+ return value;
11372
+ },
11373
+ // $FlowFixMe - get/set properties not yet supported
11374
+ get SUPPORT_SVG_DRAWING() {
11375
+ 'use strict';
11376
+
11377
+ var value = testSVG(document);
11378
+ Object.defineProperty(FEATURES, 'SUPPORT_SVG_DRAWING', { value: value });
11379
+ return value;
11380
+ },
11381
+ // $FlowFixMe - get/set properties not yet supported
11382
+ get SUPPORT_BASE64_DRAWING() {
11383
+ 'use strict';
11384
 
11385
+ return function (src) {
11386
+ var _value = testBase64(document, src);
11387
+ Object.defineProperty(FEATURES, 'SUPPORT_BASE64_DRAWING', { value: function value() {
11388
+ return _value;
11389
+ } });
11390
+ return _value;
11391
+ };
11392
+ },
11393
+ // $FlowFixMe - get/set properties not yet supported
11394
+ get SUPPORT_FOREIGNOBJECT_DRAWING() {
11395
+ 'use strict';
11396
 
11397
+ var value = typeof Array.from === 'function' && typeof window.fetch === 'function' ? testForeignObject(document) : Promise.resolve(false);
11398
+ Object.defineProperty(FEATURES, 'SUPPORT_FOREIGNOBJECT_DRAWING', { value: value });
11399
+ return value;
11400
+ },
11401
+ // $FlowFixMe - get/set properties not yet supported
11402
+ get SUPPORT_CORS_IMAGES() {
11403
+ 'use strict';
 
11404
 
11405
+ var value = testCORS();
11406
+ Object.defineProperty(FEATURES, 'SUPPORT_CORS_IMAGES', { value: value });
11407
+ return value;
11408
+ },
11409
+ // $FlowFixMe - get/set properties not yet supported
11410
+ get SUPPORT_RESPONSE_TYPE() {
11411
+ 'use strict';
11412
+
11413
+ var value = testResponseType();
11414
+ Object.defineProperty(FEATURES, 'SUPPORT_RESPONSE_TYPE', { value: value });
11415
+ return value;
11416
+ },
11417
+ // $FlowFixMe - get/set properties not yet supported
11418
+ get SUPPORT_CORS_XHR() {
11419
+ 'use strict';
11420
+
11421
+ var value = 'withCredentials' in new XMLHttpRequest();
11422
+ Object.defineProperty(FEATURES, 'SUPPORT_CORS_XHR', { value: value });
11423
+ return value;
11424
  }
11425
  };
11426
 
11427
+ exports.default = FEATURES;
11428
+
11429
  /***/ }),
11430
+ /* 11 */
11431
  /***/ (function(module, exports, __webpack_require__) {
11432
 
11433
  "use strict";
11436
  Object.defineProperty(exports, "__esModule", {
11437
  value: true
11438
  });
11439
+ exports.parseTextDecoration = exports.TEXT_DECORATION_LINE = exports.TEXT_DECORATION = exports.TEXT_DECORATION_STYLE = undefined;
 
 
 
 
11440
 
11441
+ var _Color = __webpack_require__(0);
 
 
 
 
 
 
 
 
 
 
11442
 
11443
+ var _Color2 = _interopRequireDefault(_Color);
 
 
11444
 
11445
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11446
 
11447
+ var TEXT_DECORATION_STYLE = exports.TEXT_DECORATION_STYLE = {
11448
+ SOLID: 0,
11449
+ DOUBLE: 1,
11450
+ DOTTED: 2,
11451
+ DASHED: 3,
11452
+ WAVY: 4
11453
+ };
11454
 
11455
+ var TEXT_DECORATION = exports.TEXT_DECORATION = {
11456
+ NONE: null
 
 
 
 
 
 
 
11457
  };
11458
 
11459
+ var TEXT_DECORATION_LINE = exports.TEXT_DECORATION_LINE = {
11460
+ UNDERLINE: 1,
11461
+ OVERLINE: 2,
11462
+ LINE_THROUGH: 3,
11463
+ BLINK: 4
11464
+ };
11465
 
11466
+ var parseLine = function parseLine(line) {
11467
+ switch (line) {
11468
+ case 'underline':
11469
+ return TEXT_DECORATION_LINE.UNDERLINE;
11470
+ case 'overline':
11471
+ return TEXT_DECORATION_LINE.OVERLINE;
11472
+ case 'line-through':
11473
+ return TEXT_DECORATION_LINE.LINE_THROUGH;
11474
+ }
11475
+ return TEXT_DECORATION_LINE.BLINK;
11476
+ };
11477
 
11478
+ var parseTextDecorationLine = function parseTextDecorationLine(line) {
11479
+ if (line === 'none') {
11480
+ return null;
11481
+ }
11482
 
11483
+ return line.split(' ').map(parseLine);
11484
+ };
 
11485
 
11486
+ var parseTextDecorationStyle = function parseTextDecorationStyle(style) {
11487
+ switch (style) {
11488
+ case 'double':
11489
+ return TEXT_DECORATION_STYLE.DOUBLE;
11490
+ case 'dotted':
11491
+ return TEXT_DECORATION_STYLE.DOTTED;
11492
+ case 'dashed':
11493
+ return TEXT_DECORATION_STYLE.DASHED;
11494
+ case 'wavy':
11495
+ return TEXT_DECORATION_STYLE.WAVY;
11496
+ }
11497
+ return TEXT_DECORATION_STYLE.SOLID;
11498
+ };
11499
 
11500
+ var parseTextDecoration = exports.parseTextDecoration = function parseTextDecoration(style) {
11501
+ var textDecorationLine = parseTextDecorationLine(style.textDecorationLine ? style.textDecorationLine : style.textDecoration);
11502
+ if (textDecorationLine === null) {
11503
+ return TEXT_DECORATION.NONE;
11504
+ }
 
 
 
 
 
 
 
11505
 
11506
+ var textDecorationColor = style.textDecorationColor ? new _Color2.default(style.textDecorationColor) : null;
11507
+ var textDecorationStyle = parseTextDecorationStyle(style.textDecorationStyle);
11508
 
11509
+ return {
11510
+ textDecorationLine: textDecorationLine,
11511
+ textDecorationColor: textDecorationColor,
11512
+ textDecorationStyle: textDecorationStyle
11513
+ };
11514
+ };
11515
 
11516
  /***/ }),
11517
+ /* 12 */
11518
  /***/ (function(module, exports, __webpack_require__) {
11519
 
11520
  "use strict";
11523
  Object.defineProperty(exports, "__esModule", {
11524
  value: true
11525
  });
11526
+ exports.parseBorder = exports.BORDER_SIDES = exports.BORDER_STYLE = undefined;
 
 
11527
 
11528
+ var _Color = __webpack_require__(0);
11529
 
11530
+ var _Color2 = _interopRequireDefault(_Color);
11531
 
11532
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11533
 
11534
+ var BORDER_STYLE = exports.BORDER_STYLE = {
11535
+ NONE: 0,
11536
+ SOLID: 1
11537
+ };
11538
 
11539
+ var BORDER_SIDES = exports.BORDER_SIDES = {
11540
+ TOP: 0,
11541
+ RIGHT: 1,
11542
+ BOTTOM: 2,
11543
+ LEFT: 3
11544
+ };
11545
 
11546
+ var SIDES = Object.keys(BORDER_SIDES).map(function (s) {
11547
+ return s.toLowerCase();
11548
+ });
11549
 
11550
+ var parseBorderStyle = function parseBorderStyle(style) {
11551
+ switch (style) {
11552
+ case 'none':
11553
+ return BORDER_STYLE.NONE;
11554
+ }
11555
+ return BORDER_STYLE.SOLID;
11556
+ };
11557
 
11558
+ var parseBorder = exports.parseBorder = function parseBorder(style) {
11559
+ return SIDES.map(function (side) {
11560
+ var borderColor = new _Color2.default(style.getPropertyValue('border-' + side + '-color'));
11561
+ var borderStyle = parseBorderStyle(style.getPropertyValue('border-' + side + '-style'));
11562
+ var borderWidth = parseFloat(style.getPropertyValue('border-' + side + '-width'));
11563
+ return {
11564
+ borderColor: borderColor,
11565
+ borderStyle: borderStyle,
11566
+ borderWidth: isNaN(borderWidth) ? 0 : borderWidth
11567
+ };
11568
+ });
11569
+ };
11570
 
11571
+ /***/ }),
11572
+ /* 13 */
11573
+ /***/ (function(module, exports, __webpack_require__) {
11574
 
11575
+ "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11576
 
11577
+
11578
+ Object.defineProperty(exports, "__esModule", {
11579
+ value: true
11580
+ });
11581
+ var toCodePoints = exports.toCodePoints = function toCodePoints(str) {
11582
+ var codePoints = [];
11583
+ var i = 0;
11584
+ var length = str.length;
11585
+ while (i < length) {
11586
+ var value = str.charCodeAt(i++);
11587
+ if (value >= 0xd800 && value <= 0xdbff && i < length) {
11588
+ var extra = str.charCodeAt(i++);
11589
+ if ((extra & 0xfc00) === 0xdc00) {
11590
+ codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);
11591
+ } else {
11592
+ codePoints.push(value);
11593
+ i--;
11594
+ }
11595
+ } else {
11596
+ codePoints.push(value);
11597
+ }
11598
+ }
11599
+ return codePoints;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11600
  };
11601
 
11602
+ var fromCodePoint = exports.fromCodePoint = function fromCodePoint() {
11603
+ if (String.fromCodePoint) {
11604
+ return String.fromCodePoint.apply(String, arguments);
11605
+ }
11606
 
11607
+ var length = arguments.length;
11608
+ if (!length) {
11609
+ return '';
11610
+ }
 
 
 
11611
 
11612
+ var codeUnits = [];
 
11613
 
11614
+ var index = -1;
11615
+ var result = '';
11616
+ while (++index < length) {
11617
+ var codePoint = arguments.length <= index ? undefined : arguments[index];
11618
+ if (codePoint <= 0xffff) {
11619
+ codeUnits.push(codePoint);
 
 
11620
  } else {
11621
+ codePoint -= 0x10000;
11622
+ codeUnits.push((codePoint >> 10) + 0xd800, codePoint % 0x400 + 0xdc00);
11623
  }
11624
+ if (index + 1 === length || codeUnits.length > 0x4000) {
11625
+ result += String.fromCharCode.apply(String, codeUnits);
11626
+ codeUnits.length = 0;
 
 
 
 
11627
  }
11628
+ }
11629
+ return result;
11630
+ };
11631
 
11632
+ var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
 
 
 
 
 
11633
 
11634
+ // Use a lookup table to find the index.
11635
+ var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
11636
+ for (var i = 0; i < chars.length; i++) {
11637
+ lookup[chars.charCodeAt(i)] = i;
11638
+ }
 
 
 
 
 
11639
 
11640
+ var decode = exports.decode = function decode(base64) {
11641
+ var bufferLength = base64.length * 0.75,
11642
+ len = base64.length,
11643
+ i = void 0,
11644
+ p = 0,
11645
+ encoded1 = void 0,
11646
+ encoded2 = void 0,
11647
+ encoded3 = void 0,
11648
+ encoded4 = void 0;
11649
 
11650
+ if (base64[base64.length - 1] === '=') {
11651
+ bufferLength--;
11652
+ if (base64[base64.length - 2] === '=') {
11653
+ bufferLength--;
11654
  }
11655
+ }
11656
 
11657
+ var buffer = typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint8Array.prototype.slice !== 'undefined' ? new ArrayBuffer(bufferLength) : new Array(bufferLength);
11658
+ var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
 
11659
 
11660
+ for (i = 0; i < len; i += 4) {
11661
+ encoded1 = lookup[base64.charCodeAt(i)];
11662
+ encoded2 = lookup[base64.charCodeAt(i + 1)];
11663
+ encoded3 = lookup[base64.charCodeAt(i + 2)];
11664
+ encoded4 = lookup[base64.charCodeAt(i + 3)];
 
 
 
 
 
 
 
 
 
11665
 
11666
+ bytes[p++] = encoded1 << 2 | encoded2 >> 4;
11667
+ bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
11668
+ bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
11669
+ }
11670
 
11671
+ return buffer;
11672
  };
11673
 
11674
+ var polyUint16Array = exports.polyUint16Array = function polyUint16Array(buffer) {
11675
+ var length = buffer.length;
11676
+ var bytes = [];
11677
+ for (var _i = 0; _i < length; _i += 2) {
11678
+ bytes.push(buffer[_i + 1] << 8 | buffer[_i]);
 
 
 
 
 
 
 
 
 
 
 
11679
  }
11680
+ return bytes;
11681
+ };
11682
 
11683
+ var polyUint32Array = exports.polyUint32Array = function polyUint32Array(buffer) {
11684
+ var length = buffer.length;
11685
+ var bytes = [];
11686
+ for (var _i2 = 0; _i2 < length; _i2 += 4) {
11687
+ bytes.push(buffer[_i2 + 3] << 24 | buffer[_i2 + 2] << 16 | buffer[_i2 + 1] << 8 | buffer[_i2]);
11688
+ }
11689
+ return bytes;
11690
+ };
11691
 
11692
+ /***/ }),
11693
+ /* 14 */
11694
+ /***/ (function(module, exports, __webpack_require__) {
11695
 
11696
+ "use strict";
 
 
 
 
11697
 
 
 
 
11698
 
11699
+ Object.defineProperty(exports, "__esModule", {
11700
+ value: true
11701
+ });
11702
+ exports.createCounterText = exports.inlineListItemElement = exports.getListOwner = undefined;
 
11703
 
11704
+ var _Util = __webpack_require__(4);
 
 
 
 
 
 
11705
 
11706
+ var _NodeContainer = __webpack_require__(3);
 
 
 
 
 
 
 
 
 
 
 
11707
 
11708
+ var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
 
 
 
11709
 
11710
+ var _TextContainer = __webpack_require__(9);
 
 
 
11711
 
11712
+ var _TextContainer2 = _interopRequireDefault(_TextContainer);
 
 
11713
 
11714
+ var _listStyle = __webpack_require__(8);
 
 
 
11715
 
11716
+ var _Unicode = __webpack_require__(24);
 
 
11717
 
11718
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
11719
 
11720
+ // Margin between the enumeration and the list item content
11721
+ var MARGIN_RIGHT = 7;
 
 
11722
 
11723
+ var ancestorTypes = ['OL', 'UL', 'MENU'];
 
 
 
11724
 
11725
+ var getListOwner = exports.getListOwner = function getListOwner(container) {
11726
+ var parent = container.parent;
11727
+ if (!parent) {
11728
+ return null;
11729
  }
11730
 
11731
+ do {
11732
+ var isAncestor = ancestorTypes.indexOf(parent.tagName) !== -1;
11733
+ if (isAncestor) {
11734
+ return parent;
11735
+ }
11736
+ parent = parent.parent;
11737
+ } while (parent);
11738
 
11739
+ return container.parent;
11740
+ };
 
 
11741
 
11742
+ var inlineListItemElement = exports.inlineListItemElement = function inlineListItemElement(node, container, resourceLoader) {
11743
+ var listStyle = container.style.listStyle;
 
 
11744
 
11745
+ if (!listStyle) {
11746
+ return;
 
11747
  }
11748
 
11749
+ var style = node.ownerDocument.defaultView.getComputedStyle(node, null);
11750
+ var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
11751
+ (0, _Util.copyCSSStyles)(style, wrapper);
 
11752
 
11753
+ wrapper.style.position = 'absolute';
11754
+ wrapper.style.bottom = 'auto';
11755
+ wrapper.style.display = 'block';
11756
+ wrapper.style.letterSpacing = 'normal';
11757
 
11758
+ switch (listStyle.listStylePosition) {
11759
+ case _listStyle.LIST_STYLE_POSITION.OUTSIDE:
11760
+ wrapper.style.left = 'auto';
11761
+ wrapper.style.right = node.ownerDocument.defaultView.innerWidth - container.bounds.left - container.style.margin[1].getAbsoluteValue(container.bounds.width) + MARGIN_RIGHT + 'px';
11762
+ wrapper.style.textAlign = 'right';
11763
+ break;
11764
+ case _listStyle.LIST_STYLE_POSITION.INSIDE:
11765
+ wrapper.style.left = container.bounds.left - container.style.margin[3].getAbsoluteValue(container.bounds.width) + 'px';
11766
+ wrapper.style.right = 'auto';
11767
+ wrapper.style.textAlign = 'left';
11768
+ break;
11769
  }
11770
 
11771
+ var text = void 0;
11772
+ var MARGIN_TOP = container.style.margin[0].getAbsoluteValue(container.bounds.width);
11773
+ var styleImage = listStyle.listStyleImage;
11774
+ if (styleImage) {
11775
+ if (styleImage.method === 'url') {
11776
+ var image = node.ownerDocument.createElement('img');
11777
+ image.src = styleImage.args[0];
11778
+ wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px';
11779
+ wrapper.style.width = 'auto';
11780
+ wrapper.style.height = 'auto';
11781
+ wrapper.appendChild(image);
11782
+ } else {
11783
+ var size = parseFloat(container.style.font.fontSize) * 0.5;
11784
+ wrapper.style.top = container.bounds.top - MARGIN_TOP + container.bounds.height - 1.5 * size + 'px';
11785
+ wrapper.style.width = size + 'px';
11786
+ wrapper.style.height = size + 'px';
11787
+ wrapper.style.backgroundImage = style.listStyleImage;
11788
+ }
11789
+ } else if (typeof container.listIndex === 'number') {
11790
+ text = node.ownerDocument.createTextNode(createCounterText(container.listIndex, listStyle.listStyleType, true));
11791
+ wrapper.appendChild(text);
11792
+ wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px';
11793
  }
11794
 
11795
+ // $FlowFixMe
11796
+ var body = node.ownerDocument.body;
11797
+ body.appendChild(wrapper);
 
11798
 
11799
+ if (text) {
11800
+ container.childNodes.push(_TextContainer2.default.fromTextNode(text, container));
11801
+ body.removeChild(wrapper);
11802
+ } else {
11803
+ // $FlowFixMe
11804
+ container.childNodes.push(new _NodeContainer2.default(wrapper, container, resourceLoader, 0));
11805
  }
11806
+ };
11807
 
11808
+ var ROMAN_UPPER = {
11809
+ integers: [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],
11810
+ values: ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
11811
+ };
11812
 
11813
+ var ARMENIAN = {
11814
+ 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],
11815
+ values: ['Ք', 'Փ', 'Ւ', 'Ց', 'Ր', 'Տ', 'Վ', 'Ս', 'Ռ', 'Ջ', 'Պ', 'Չ', 'Ո', 'Շ', 'Ն', 'Յ', 'Մ', 'Ճ', 'Ղ', 'Ձ', 'Հ', 'Կ', 'Ծ', 'Խ', 'Լ', 'Ի', 'Ժ', 'Թ', 'Ը', 'Է', 'Զ', 'Ե', 'Դ', 'Գ', 'Բ', 'Ա']
11816
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11817
 
11818
+ var HEBREW = {
11819
+ 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],
11820
+ values: ['י׳', 'ט׳', 'ח׳', 'ז׳', 'ו׳', 'ה׳', 'ד׳', 'ג׳', 'ב׳', 'א׳', 'ת', 'ש', 'ר', 'ק', 'צ', 'פ', 'ע', 'ס', 'נ', 'מ', 'ל', 'כ', 'יט', 'יח', 'יז', 'טז', 'טו', 'י', 'ט', 'ח', 'ז', 'ו', 'ה', 'ד', 'ג', 'ב', 'א']
11821
+ };
11822
 
11823
+ var GEORGIAN = {
11824
+ 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],
11825
+ values: ['ჵ', 'ჰ', 'ჯ', 'ჴ', 'ხ', 'ჭ', 'წ', 'ძ', 'ც', 'ჩ', 'შ', 'ყ', 'ღ', 'ქ', 'ფ', 'ჳ', 'ტ', 'ს', 'რ', 'ჟ', 'პ', 'ო', 'ჲ', 'ნ', 'მ', 'ლ', 'კ', 'ი', 'თ', 'ჱ', 'ზ', 'ვ', 'ე', 'დ', 'გ', 'ბ', 'ა']
11826
+ };
 
 
 
 
 
 
11827
 
11828
+ var createAdditiveCounter = function createAdditiveCounter(value, min, max, symbols, fallback, suffix) {
11829
+ if (value < min || value > max) {
11830
+ return createCounterText(value, fallback, suffix.length > 0);
 
 
 
 
 
 
 
 
 
 
11831
  }
11832
 
11833
+ return symbols.integers.reduce(function (string, integer, index) {
11834
+ while (value >= integer) {
11835
+ value -= integer;
11836
+ string += symbols.values[index];
 
 
 
 
 
 
 
 
11837
  }
11838
+ return string;
11839
+ }, '') + suffix;
11840
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11841
 
11842
+ var createCounterStyleWithSymbolResolver = function createCounterStyleWithSymbolResolver(value, codePointRangeLength, isNumeric, resolver) {
11843
+ var string = '';
 
 
11844
 
11845
+ do {
11846
+ if (!isNumeric) {
11847
+ value--;
 
 
 
 
 
 
 
 
 
 
 
 
11848
  }
11849
+ string = resolver(value) + string;
11850
+ value /= codePointRangeLength;
11851
+ } while (value * codePointRangeLength >= codePointRangeLength);
 
 
 
11852
 
11853
+ return string;
11854
  };
11855
 
11856
+ var createCounterStyleFromRange = function createCounterStyleFromRange(value, codePointRangeStart, codePointRangeEnd, isNumeric, suffix) {
11857
+ var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
11858
 
11859
+ return (value < 0 ? '-' : '') + (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, function (codePoint) {
11860
+ return (0, _Unicode.fromCodePoint)(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart);
11861
+ }) + suffix);
11862
  };
11863
 
11864
+ var createCounterStyleFromSymbols = function createCounterStyleFromSymbols(value, symbols) {
11865
+ var suffix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '. ';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11866
 
11867
+ var codePointRangeLength = symbols.length;
11868
+ return createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function (codePoint) {
11869
+ return symbols[Math.floor(codePoint % codePointRangeLength)];
11870
+ }) + suffix;
11871
  };
11872
 
11873
+ var CJK_ZEROS = 1 << 0;
11874
+ var CJK_TEN_COEFFICIENTS = 1 << 1;
11875
+ var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;
11876
+ var CJK_HUNDRED_COEFFICIENTS = 1 << 3;
 
 
 
 
 
11877
 
11878
+ var createCJKCounter = function createCJKCounter(value, numbers, multipliers, negativeSign, suffix, flags) {
11879
+ if (value < -9999 || value > 9999) {
11880
+ return createCounterText(value, _listStyle.LIST_STYLE_TYPE.CJK_DECIMAL, suffix.length > 0);
11881
+ }
11882
+ var tmp = Math.abs(value);
11883
+ var string = suffix;
11884
 
11885
+ if (tmp === 0) {
11886
+ return numbers[0] + string;
11887
+ }
11888
 
11889
+ for (var digit = 0; tmp > 0 && digit <= 4; digit++) {
11890
+ var coefficient = tmp % 10;
 
11891
 
11892
+ if (coefficient === 0 && (0, _Util.contains)(flags, CJK_ZEROS) && string !== '') {
11893
+ string = numbers[coefficient] + string;
11894
+ } 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)) {
11895
+ string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : '') + string;
11896
+ } else if (coefficient === 1 && digit > 0) {
11897
+ string = multipliers[digit - 1] + string;
11898
+ }
11899
+ tmp = Math.floor(tmp / 10);
11900
  }
11901
 
11902
+ return (value < 0 ? negativeSign : '') + string;
11903
+ };
 
 
 
 
11904
 
11905
+ var CHINESE_INFORMAL_MULTIPLIERS = '十百千萬';
11906
+ var CHINESE_FORMAL_MULTIPLIERS = '拾佰仟萬';
11907
+ var JAPANESE_NEGATIVE = 'マイナス';
11908
+ var KOREAN_NEGATIVE = '마이너스 ';
11909
 
11910
+ var createCounterText = exports.createCounterText = function createCounterText(value, type, appendSuffix) {
11911
+ var defaultSuffix = appendSuffix ? '. ' : '';
11912
+ var cjkSuffix = appendSuffix ? '、' : '';
11913
+ var koreanSuffix = appendSuffix ? ', ' : '';
11914
+ switch (type) {
11915
+ case _listStyle.LIST_STYLE_TYPE.DISC:
11916
+ return '•';
11917
+ case _listStyle.LIST_STYLE_TYPE.CIRCLE:
11918
+ return '◦';
11919
+ case _listStyle.LIST_STYLE_TYPE.SQUARE:
11920
+ return '◾';
11921
+ case _listStyle.LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:
11922
+ var string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
11923
+ return string.length < 4 ? '0' + string : string;
11924
+ case _listStyle.LIST_STYLE_TYPE.CJK_DECIMAL:
11925
+ return createCounterStyleFromSymbols(value, '〇一二三四五六七八九', cjkSuffix);
11926
+ case _listStyle.LIST_STYLE_TYPE.LOWER_ROMAN:
11927
+ return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
11928
+ case _listStyle.LIST_STYLE_TYPE.UPPER_ROMAN:
11929
+ return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
11930
+ case _listStyle.LIST_STYLE_TYPE.LOWER_GREEK:
11931
+ return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);
11932
+ case _listStyle.LIST_STYLE_TYPE.LOWER_ALPHA:
11933
+ return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);
11934
+ case _listStyle.LIST_STYLE_TYPE.UPPER_ALPHA:
11935
+ return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);
11936
+ case _listStyle.LIST_STYLE_TYPE.ARABIC_INDIC:
11937
+ return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);
11938
+ case _listStyle.LIST_STYLE_TYPE.ARMENIAN:
11939
+ case _listStyle.LIST_STYLE_TYPE.UPPER_ARMENIAN:
11940
+ return createAdditiveCounter(value, 1, 9999, ARMENIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
11941
+ case _listStyle.LIST_STYLE_TYPE.LOWER_ARMENIAN:
11942
+ return createAdditiveCounter(value, 1, 9999, ARMENIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
11943
+ case _listStyle.LIST_STYLE_TYPE.BENGALI:
11944
+ return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);
11945
+ case _listStyle.LIST_STYLE_TYPE.CAMBODIAN:
11946
+ case _listStyle.LIST_STYLE_TYPE.KHMER:
11947
+ return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);
11948
+ case _listStyle.LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:
11949
+ return createCounterStyleFromSymbols(value, '子丑寅卯辰巳午未申酉戌亥', cjkSuffix);
11950
+ case _listStyle.LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:
11951
+ return createCounterStyleFromSymbols(value, '甲乙丙丁戊己庚辛壬癸', cjkSuffix);
11952
+ case _listStyle.LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:
11953
+ case _listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:
11954
+ return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
11955
+ case _listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:
11956
+ return createCJKCounter(value, '零壹貳參肆伍陸柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
11957
+ case _listStyle.LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL:
11958
+ return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
11959
+ case _listStyle.LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL:
11960
+ return createCJKCounter(value, '零壹贰叁肆伍陆柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
11961
+ case _listStyle.LIST_STYLE_TYPE.JAPANESE_INFORMAL:
11962
+ return createCJKCounter(value, '〇一二三四五六七八九', '十百千万', JAPANESE_NEGATIVE, cjkSuffix, 0);
11963
+ case _listStyle.LIST_STYLE_TYPE.JAPANESE_FORMAL:
11964
+ return createCJKCounter(value, '零壱弐参四伍六七八九', '拾百千万', JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
11965
+ case _listStyle.LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:
11966
+ return createCJKCounter(value, '영일이삼사오육칠팔구', '십백천만', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
11967
+ case _listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:
11968
+ return createCJKCounter(value, '零一二三四五六七八九', '十百千萬', KOREAN_NEGATIVE, koreanSuffix, 0);
11969
+ case _listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:
11970
+ return createCJKCounter(value, '零壹貳參四五六七八九', '拾百千', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
11971
+ case _listStyle.LIST_STYLE_TYPE.DEVANAGARI:
11972
+ return createCounterStyleFromRange(value, 0x966, 0x96f, true, defaultSuffix);
11973
+ case _listStyle.LIST_STYLE_TYPE.GEORGIAN:
11974
+ return createAdditiveCounter(value, 1, 19999, GEORGIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
11975
+ case _listStyle.LIST_STYLE_TYPE.GUJARATI:
11976
+ return createCounterStyleFromRange(value, 0xae6, 0xaef, true, defaultSuffix);
11977
+ case _listStyle.LIST_STYLE_TYPE.GURMUKHI:
11978
+ return createCounterStyleFromRange(value, 0xa66, 0xa6f, true, defaultSuffix);
11979
+ case _listStyle.LIST_STYLE_TYPE.HEBREW:
11980
+ return createAdditiveCounter(value, 1, 10999, HEBREW, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
11981
+ case _listStyle.LIST_STYLE_TYPE.HIRAGANA:
11982
+ return createCounterStyleFromSymbols(value, 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん');
11983
+ case _listStyle.LIST_STYLE_TYPE.HIRAGANA_IROHA:
11984
+ return createCounterStyleFromSymbols(value, 'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす');
11985
+ case _listStyle.LIST_STYLE_TYPE.KANNADA:
11986
+ return createCounterStyleFromRange(value, 0xce6, 0xcef, true, defaultSuffix);
11987
+ case _listStyle.LIST_STYLE_TYPE.KATAKANA:
11988
+ return createCounterStyleFromSymbols(value, 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン', cjkSuffix);
11989
+ case _listStyle.LIST_STYLE_TYPE.KATAKANA_IROHA:
11990
+ return createCounterStyleFromSymbols(value, 'イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス', cjkSuffix);
11991
+ case _listStyle.LIST_STYLE_TYPE.LAO:
11992
+ return createCounterStyleFromRange(value, 0xed0, 0xed9, true, defaultSuffix);
11993
+ case _listStyle.LIST_STYLE_TYPE.MONGOLIAN:
11994
+ return createCounterStyleFromRange(value, 0x1810, 0x1819, true, defaultSuffix);
11995
+ case _listStyle.LIST_STYLE_TYPE.MYANMAR:
11996
+ return createCounterStyleFromRange(value, 0x1040, 0x1049, true, defaultSuffix);
11997
+ case _listStyle.LIST_STYLE_TYPE.ORIYA:
11998
+ return createCounterStyleFromRange(value, 0xb66, 0xb6f, true, defaultSuffix);
11999
+ case _listStyle.LIST_STYLE_TYPE.PERSIAN:
12000
+ return createCounterStyleFromRange(value, 0x6f0, 0x6f9, true, defaultSuffix);
12001
+ case _listStyle.LIST_STYLE_TYPE.TAMIL:
12002
+ return createCounterStyleFromRange(value, 0xbe6, 0xbef, true, defaultSuffix);
12003
+ case _listStyle.LIST_STYLE_TYPE.TELUGU:
12004
+ return createCounterStyleFromRange(value, 0xc66, 0xc6f, true, defaultSuffix);
12005
+ case _listStyle.LIST_STYLE_TYPE.THAI:
12006
+ return createCounterStyleFromRange(value, 0xe50, 0xe59, true, defaultSuffix);
12007
+ case _listStyle.LIST_STYLE_TYPE.TIBETAN:
12008
+ return createCounterStyleFromRange(value, 0xf20, 0xf29, true, defaultSuffix);
12009
+ case _listStyle.LIST_STYLE_TYPE.DECIMAL:
12010
+ default:
12011
+ return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
12012
+ }
12013
  };
12014
 
12015
  /***/ }),
12016
+ /* 15 */
12017
  /***/ (function(module, exports, __webpack_require__) {
12018
 
12019
  "use strict";
12022
  Object.defineProperty(exports, "__esModule", {
12023
  value: true
12024
  });
 
12025
 
12026
  var _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; }; }();
12027
 
12028
+ var _Path = __webpack_require__(6);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12029
 
12030
+ var _textDecoration = __webpack_require__(11);
 
 
 
 
 
 
12031
 
12032
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
12033
 
12034
+ var addColorStops = function addColorStops(gradient, canvasGradient) {
12035
+ var maxStop = Math.max.apply(null, gradient.colorStops.map(function (colorStop) {
12036
+ return colorStop.stop;
12037
+ }));
12038
+ var f = 1 / Math.max(1, maxStop);
12039
+ gradient.colorStops.forEach(function (colorStop) {
12040
+ canvasGradient.addColorStop(f * colorStop.stop, colorStop.color.toString());
12041
+ });
12042
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
12043
 
12044
+ var CanvasRenderer = function () {
12045
+ function CanvasRenderer(canvas) {
12046
+ _classCallCheck(this, CanvasRenderer);
 
 
12047
 
12048
+ this.canvas = canvas ? canvas : document.createElement('canvas');
12049
+ }
 
 
12050
 
12051
+ _createClass(CanvasRenderer, [{
12052
+ key: 'render',
12053
+ value: function render(options) {
12054
+ this.ctx = this.canvas.getContext('2d');
12055
+ this.options = options;
12056
+ this.canvas.width = Math.floor(options.width * options.scale);
12057
+ this.canvas.height = Math.floor(options.height * options.scale);
12058
+ this.canvas.style.width = options.width + 'px';
12059
+ this.canvas.style.height = options.height + 'px';
12060
 
12061
+ this.ctx.scale(this.options.scale, this.options.scale);
12062
+ this.ctx.translate(-options.x, -options.y);
12063
+ this.ctx.textBaseline = 'bottom';
12064
+ options.logger.log('Canvas renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + this.options.scale);
12065
+ }
12066
+ }, {
12067
+ key: 'clip',
12068
+ value: function clip(clipPaths, callback) {
12069
+ var _this = this;
12070
 
12071
+ if (clipPaths.length) {
12072
+ this.ctx.save();
12073
+ clipPaths.forEach(function (path) {
12074
+ _this.path(path);
12075
+ _this.ctx.clip();
12076
+ });
12077
+ }
12078
 
12079
+ callback();
 
 
12080
 
12081
+ if (clipPaths.length) {
12082
+ this.ctx.restore();
12083
+ }
12084
+ }
12085
+ }, {
12086
+ key: 'drawImage',
12087
+ value: function drawImage(image, source, destination) {
12088
+ this.ctx.drawImage(image, source.left, source.top, source.width, source.height, destination.left, destination.top, destination.width, destination.height);
12089
+ }
12090
+ }, {
12091
+ key: 'drawShape',
12092
+ value: function drawShape(path, color) {
12093
+ this.path(path);
12094
+ this.ctx.fillStyle = color.toString();
12095
+ this.ctx.fill();
12096
+ }
12097
+ }, {
12098
+ key: 'fill',
12099
+ value: function fill(color) {
12100
+ this.ctx.fillStyle = color.toString();
12101
+ this.ctx.fill();
12102
+ }
12103
+ }, {
12104
+ key: 'getTarget',
12105
+ value: function getTarget() {
12106
+ this.canvas.getContext('2d').setTransform(1, 0, 0, 1, 0, 0);
12107
+ return Promise.resolve(this.canvas);
12108
+ }
12109
+ }, {
12110
+ key: 'path',
12111
+ value: function path(_path) {
12112
+ var _this2 = this;
12113
 
12114
+ this.ctx.beginPath();
12115
+ if (Array.isArray(_path)) {
12116
+ _path.forEach(function (point, index) {
12117
+ var start = point.type === _Path.PATH.VECTOR ? point : point.start;
12118
+ if (index === 0) {
12119
+ _this2.ctx.moveTo(start.x, start.y);
12120
+ } else {
12121
+ _this2.ctx.lineTo(start.x, start.y);
12122
+ }
12123
 
12124
+ if (point.type === _Path.PATH.BEZIER_CURVE) {
12125
+ _this2.ctx.bezierCurveTo(point.startControl.x, point.startControl.y, point.endControl.x, point.endControl.y, point.end.x, point.end.y);
12126
+ }
12127
+ });
12128
+ } else {
12129
+ this.ctx.arc(_path.x + _path.radius, _path.y + _path.radius, _path.radius, 0, Math.PI * 2, true);
12130
+ }
12131
 
12132
+ this.ctx.closePath();
12133
+ }
12134
+ }, {
12135
+ key: 'rectangle',
12136
+ value: function rectangle(x, y, width, height, color) {
12137
+ this.ctx.fillStyle = color.toString();
12138
+ this.ctx.fillRect(x, y, width, height);
12139
+ }
12140
+ }, {
12141
+ key: 'renderLinearGradient',
12142
+ value: function renderLinearGradient(bounds, gradient) {
12143
+ 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);
 
12144
 
12145
+ addColorStops(gradient, linearGradient);
12146
+ this.ctx.fillStyle = linearGradient;
12147
+ this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height);
12148
+ }
12149
+ }, {
12150
+ key: 'renderRadialGradient',
12151
+ value: function renderRadialGradient(bounds, gradient) {
12152
+ var _this3 = this;
 
 
 
12153
 
12154
+ var x = bounds.left + gradient.center.x;
12155
+ var y = bounds.top + gradient.center.y;
12156
+
12157
+ var radialGradient = this.ctx.createRadialGradient(x, y, 0, x, y, gradient.radius.x);
12158
+ if (!radialGradient) {
12159
+ return;
12160
+ }
12161
+
12162
+ addColorStops(gradient, radialGradient);
12163
+ this.ctx.fillStyle = radialGradient;
12164
+
12165
+ if (gradient.radius.x !== gradient.radius.y) {
12166
+ // transforms for elliptical radial gradient
12167
+ var midX = bounds.left + 0.5 * bounds.width;
12168
+ var midY = bounds.top + 0.5 * bounds.height;
12169
+ var f = gradient.radius.y / gradient.radius.x;
12170
+ var invF = 1 / f;
12171
+
12172
+ this.transform(midX, midY, [1, 0, 0, f, 0, 0], function () {
12173
+ return _this3.ctx.fillRect(bounds.left, invF * (bounds.top - midY) + midY, bounds.width, bounds.height * invF);
12174
+ });
12175
+ } else {
12176
+ this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height);
12177
+ }
12178
+ }
12179
+ }, {
12180
+ key: 'renderRepeat',
12181
+ value: function renderRepeat(path, image, imageSize, offsetX, offsetY) {
12182
+ this.path(path);
12183
+ this.ctx.fillStyle = this.ctx.createPattern(this.resizeImage(image, imageSize), 'repeat');
12184
+ this.ctx.translate(offsetX, offsetY);
12185
+ this.ctx.fill();
12186
+ this.ctx.translate(-offsetX, -offsetY);
12187
+ }
12188
+ }, {
12189
+ key: 'renderTextNode',
12190
+ value: function renderTextNode(textBounds, color, font, textDecoration, textShadows) {
12191
+ var _this4 = this;
12192
+
12193
+ this.ctx.font = [font.fontStyle, font.fontVariant, font.fontWeight, font.fontSize, font.fontFamily].join(' ');
12194
+
12195
+ textBounds.forEach(function (text) {
12196
+ _this4.ctx.fillStyle = color.toString();
12197
+ if (textShadows && text.text.trim().length) {
12198
+ textShadows.slice(0).reverse().forEach(function (textShadow) {
12199
+ _this4.ctx.shadowColor = textShadow.color.toString();
12200
+ _this4.ctx.shadowOffsetX = textShadow.offsetX * _this4.options.scale;
12201
+ _this4.ctx.shadowOffsetY = textShadow.offsetY * _this4.options.scale;
12202
+ _this4.ctx.shadowBlur = textShadow.blur;
12203
+
12204
+ _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
12205
+ });
12206
+ } else {
12207
+ _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
12208
  }
12209
+
12210
+ if (textDecoration !== null) {
12211
+ var textDecorationColor = textDecoration.textDecorationColor || color;
12212
+ textDecoration.textDecorationLine.forEach(function (textDecorationLine) {
12213
+ switch (textDecorationLine) {
12214
+ case _textDecoration.TEXT_DECORATION_LINE.UNDERLINE:
12215
+ // Draws a line at the baseline of the font
12216
+ // TODO As some browsers display the line as more than 1px if the font-size is big,
12217
+ // need to take that into account both in position and size
12218
+ var _options$fontMetrics$ = _this4.options.fontMetrics.getMetrics(font),
12219
+ baseline = _options$fontMetrics$.baseline;
12220
+
12221
+ _this4.rectangle(text.bounds.left, Math.round(text.bounds.top + baseline), text.bounds.width, 1, textDecorationColor);
12222
+ break;
12223
+ case _textDecoration.TEXT_DECORATION_LINE.OVERLINE:
12224
+ _this4.rectangle(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1, textDecorationColor);
12225
+ break;
12226
+ case _textDecoration.TEXT_DECORATION_LINE.LINE_THROUGH:
12227
+ // TODO try and find exact position for line-through
12228
+ var _options$fontMetrics$2 = _this4.options.fontMetrics.getMetrics(font),
12229
+ middle = _options$fontMetrics$2.middle;
12230
+
12231
+ _this4.rectangle(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1, textDecorationColor);
12232
+ break;
12233
+ }
12234
+ });
12235
  }
12236
+ });
12237
+ }
12238
+ }, {
12239
+ key: 'resizeImage',
12240
+ value: function resizeImage(image, size) {
12241
+ if (image.width === size.width && image.height === size.height) {
12242
+ return image;
12243
  }
12244
 
12245
+ var canvas = this.canvas.ownerDocument.createElement('canvas');
12246
+ canvas.width = size.width;
12247
+ canvas.height = size.height;
12248
+ var ctx = canvas.getContext('2d');
12249
+ ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, size.width, size.height);
12250
+ return canvas;
12251
  }
12252
+ }, {
12253
+ key: 'setOpacity',
12254
+ value: function setOpacity(opacity) {
12255
+ this.ctx.globalAlpha = opacity;
12256
+ }
12257
+ }, {
12258
+ key: 'transform',
12259
+ value: function transform(offsetX, offsetY, matrix, callback) {
12260
+ this.ctx.save();
12261
+ this.ctx.translate(offsetX, offsetY);
12262
+ this.ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
12263
+ this.ctx.translate(-offsetX, -offsetY);
12264
 
12265
+ callback();
 
 
12266
 
12267
+ this.ctx.restore();
12268
+ }
12269
+ }]);
12270
 
12271
+ return CanvasRenderer;
12272
+ }();
12273
 
12274
+ exports.default = CanvasRenderer;
12275
 
12276
  /***/ }),
12277
+ /* 16 */
12278
  /***/ (function(module, exports, __webpack_require__) {
12279
 
12280
  "use strict";
12284
  value: true
12285
  });
12286
 
12287
+ var _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; }; }();
12288
 
12289
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12290
 
12291
+ var Logger = function () {
12292
+ function Logger(enabled, id, start) {
12293
+ _classCallCheck(this, Logger);
12294
 
12295
+ this.enabled = typeof window !== 'undefined' && enabled;
12296
+ this.start = start ? start : Date.now();
12297
+ this.id = id;
12298
+ }
12299
+
12300
+ _createClass(Logger, [{
12301
+ key: 'child',
12302
+ value: function child(id) {
12303
+ return new Logger(this.enabled, id, this.start);
 
12304
  }
12305
+
12306
+ // eslint-disable-next-line flowtype/no-weak-types
12307
+
12308
+ }, {
12309
+ key: 'log',
12310
+ value: function log() {
12311
+ if (this.enabled && window.console && window.console.log) {
12312
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
12313
+ args[_key] = arguments[_key];
12314
+ }
12315
+
12316
+ 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)));
12317
+ }
12318
+ }
12319
+
12320
+ // eslint-disable-next-line flowtype/no-weak-types
12321
+
12322
+ }, {
12323
+ key: 'error',
12324
+ value: function error() {
12325
+ if (this.enabled && window.console && window.console.error) {
12326
+ for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
12327
+ args[_key2] = arguments[_key2];
12328
+ }
12329
+
12330
+ 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)));
12331
+ }
12332
  }
12333
+ }]);
12334
+
12335
+ return Logger;
12336
+ }();
12337
+
12338
+ exports.default = Logger;
12339
+
12340
+ /***/ }),
12341
+ /* 17 */
12342
+ /***/ (function(module, exports, __webpack_require__) {
12343
+
12344
+ "use strict";
12345
+
12346
+
12347
+ Object.defineProperty(exports, "__esModule", {
12348
+ value: true
12349
+ });
12350
+ exports.parsePadding = exports.PADDING_SIDES = undefined;
12351
+
12352
+ var _Length = __webpack_require__(1);
12353
+
12354
+ var _Length2 = _interopRequireDefault(_Length);
12355
+
12356
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12357
+
12358
+ var PADDING_SIDES = exports.PADDING_SIDES = {
12359
+ TOP: 0,
12360
+ RIGHT: 1,
12361
+ BOTTOM: 2,
12362
+ LEFT: 3
12363
+ };
12364
+
12365
+ var SIDES = ['top', 'right', 'bottom', 'left'];
12366
+
12367
+ var parsePadding = exports.parsePadding = function parsePadding(style) {
12368
+ return SIDES.map(function (side) {
12369
+ return new _Length2.default(style.getPropertyValue('padding-' + side));
12370
+ });
12371
+ };
12372
+
12373
+ /***/ }),
12374
+ /* 18 */
12375
+ /***/ (function(module, exports, __webpack_require__) {
12376
+
12377
+ "use strict";
12378
+
12379
+
12380
+ Object.defineProperty(exports, "__esModule", {
12381
+ value: true
12382
+ });
12383
+ var OVERFLOW_WRAP = exports.OVERFLOW_WRAP = {
12384
+ NORMAL: 0,
12385
+ BREAK_WORD: 1
12386
+ };
12387
+
12388
+ var parseOverflowWrap = exports.parseOverflowWrap = function parseOverflowWrap(overflow) {
12389
+ switch (overflow) {
12390
+ case 'break-word':
12391
+ return OVERFLOW_WRAP.BREAK_WORD;
12392
+ case 'normal':
12393
+ default:
12394
+ return OVERFLOW_WRAP.NORMAL;
12395
  }
12396
  };
12397
 
12398
+ /***/ }),
12399
+ /* 19 */
12400
+ /***/ (function(module, exports, __webpack_require__) {
12401
+
12402
+ "use strict";
12403
+
12404
+
12405
+ Object.defineProperty(exports, "__esModule", {
12406
+ value: true
12407
+ });
12408
+ var POSITION = exports.POSITION = {
12409
+ STATIC: 0,
12410
+ RELATIVE: 1,
12411
+ ABSOLUTE: 2,
12412
+ FIXED: 3,
12413
+ STICKY: 4
12414
+ };
12415
+
12416
+ var parsePosition = exports.parsePosition = function parsePosition(position) {
12417
+ switch (position) {
12418
+ case 'relative':
12419
+ return POSITION.RELATIVE;
12420
+ case 'absolute':
12421
+ return POSITION.ABSOLUTE;
12422
+ case 'fixed':
12423
+ return POSITION.FIXED;
12424
+ case 'sticky':
12425
+ return POSITION.STICKY;
12426
+ }
12427
+
12428
+ return POSITION.STATIC;
12429
+ };
12430
 
12431
  /***/ }),
12432
+ /* 20 */
12433
  /***/ (function(module, exports, __webpack_require__) {
12434
 
12435
  "use strict";
12438
  Object.defineProperty(exports, "__esModule", {
12439
  value: true
12440
  });
12441
+ var TEXT_TRANSFORM = exports.TEXT_TRANSFORM = {
12442
+ NONE: 0,
12443
+ LOWERCASE: 1,
12444
+ UPPERCASE: 2,
12445
+ CAPITALIZE: 3
12446
+ };
12447
 
12448
+ var parseTextTransform = exports.parseTextTransform = function parseTextTransform(textTransform) {
12449
+ switch (textTransform) {
12450
+ case 'uppercase':
12451
+ return TEXT_TRANSFORM.UPPERCASE;
12452
+ case 'lowercase':
12453
+ return TEXT_TRANSFORM.LOWERCASE;
12454
+ case 'capitalize':
12455
+ return TEXT_TRANSFORM.CAPITALIZE;
12456
+ }
12457
 
12458
+ return TEXT_TRANSFORM.NONE;
12459
+ };
12460
 
12461
+ /***/ }),
12462
+ /* 21 */
12463
+ /***/ (function(module, exports, __webpack_require__) {
12464
 
12465
+ "use strict";
12466
 
12467
+
12468
+ Object.defineProperty(exports, "__esModule", {
12469
+ value: true
12470
+ });
12471
+ exports.reformatInputBounds = exports.inlineSelectElement = exports.inlineTextAreaElement = exports.inlineInputElement = exports.getInputBorderRadius = exports.INPUT_BACKGROUND = exports.INPUT_BORDERS = exports.INPUT_COLOR = undefined;
12472
 
12473
  var _TextContainer = __webpack_require__(9);
12474
 
12478
 
12479
  var _border = __webpack_require__(12);
12480
 
12481
+ var _Circle = __webpack_require__(50);
 
 
12482
 
12483
+ var _Circle2 = _interopRequireDefault(_Circle);
 
 
12484
 
12485
+ var _Vector = __webpack_require__(7);
 
 
 
12486
 
12487
+ var _Vector2 = _interopRequireDefault(_Vector);
 
 
 
 
 
 
 
 
 
 
 
12488
 
12489
+ var _Color = __webpack_require__(0);
 
 
 
 
 
 
 
 
 
 
12490
 
12491
+ var _Color2 = _interopRequireDefault(_Color);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12492
 
12493
+ var _Length = __webpack_require__(1);
12494
 
12495
+ var _Length2 = _interopRequireDefault(_Length);
 
 
12496
 
12497
+ var _Bounds = __webpack_require__(2);
 
12498
 
12499
+ var _TextBounds = __webpack_require__(22);
 
 
 
 
12500
 
12501
+ var _Util = __webpack_require__(4);
 
 
12502
 
12503
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
12504
 
12505
+ var INPUT_COLOR = exports.INPUT_COLOR = new _Color2.default([42, 42, 42]);
12506
+ var INPUT_BORDER_COLOR = new _Color2.default([165, 165, 165]);
12507
+ var INPUT_BACKGROUND_COLOR = new _Color2.default([222, 222, 222]);
12508
+ var INPUT_BORDER = {
12509
+ borderWidth: 1,
12510
+ borderColor: INPUT_BORDER_COLOR,
12511
+ borderStyle: _border.BORDER_STYLE.SOLID
12512
+ };
12513
+ var INPUT_BORDERS = exports.INPUT_BORDERS = [INPUT_BORDER, INPUT_BORDER, INPUT_BORDER, INPUT_BORDER];
12514
+ var INPUT_BACKGROUND = exports.INPUT_BACKGROUND = {
12515
+ backgroundColor: INPUT_BACKGROUND_COLOR,
12516
+ backgroundImage: [],
12517
+ backgroundClip: _background.BACKGROUND_CLIP.PADDING_BOX,
12518
+ backgroundOrigin: _background.BACKGROUND_ORIGIN.PADDING_BOX
12519
+ };
12520
 
12521
+ var RADIO_BORDER_RADIUS = new _Length2.default('50%');
12522
+ var RADIO_BORDER_RADIUS_TUPLE = [RADIO_BORDER_RADIUS, RADIO_BORDER_RADIUS];
12523
+ var INPUT_RADIO_BORDER_RADIUS = [RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12524
 
12525
+ var CHECKBOX_BORDER_RADIUS = new _Length2.default('3px');
12526
+ var CHECKBOX_BORDER_RADIUS_TUPLE = [CHECKBOX_BORDER_RADIUS, CHECKBOX_BORDER_RADIUS];
12527
+ var INPUT_CHECKBOX_BORDER_RADIUS = [CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE];
 
 
 
 
 
 
 
 
 
12528
 
12529
+ var getInputBorderRadius = exports.getInputBorderRadius = function getInputBorderRadius(node) {
12530
+ return node.type === 'radio' ? INPUT_RADIO_BORDER_RADIUS : INPUT_CHECKBOX_BORDER_RADIUS;
12531
+ };
12532
+
12533
+ var inlineInputElement = exports.inlineInputElement = function inlineInputElement(node, container) {
12534
+ if (node.type === 'radio' || node.type === 'checkbox') {
12535
+ if (node.checked) {
12536
+ var size = Math.min(container.bounds.width, container.bounds.height);
12537
+ 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));
 
 
 
 
 
 
 
 
 
12538
  }
12539
+ } else {
12540
+ inlineFormElement(getInputValue(node), node, container, false);
12541
+ }
12542
+ };
12543
 
12544
+ var inlineTextAreaElement = exports.inlineTextAreaElement = function inlineTextAreaElement(node, container) {
12545
+ inlineFormElement(node.value, node, container, true);
12546
+ };
 
 
 
12547
 
12548
+ var inlineSelectElement = exports.inlineSelectElement = function inlineSelectElement(node, container) {
12549
+ var option = node.options[node.selectedIndex || 0];
12550
+ inlineFormElement(option ? option.text || '' : '', node, container, false);
12551
+ };
12552
+
12553
+ var reformatInputBounds = exports.reformatInputBounds = function reformatInputBounds(bounds) {
12554
+ if (bounds.width > bounds.height) {
12555
+ bounds.left += (bounds.width - bounds.height) / 2;
12556
+ bounds.width = bounds.height;
12557
+ } else if (bounds.width < bounds.height) {
12558
+ bounds.top += (bounds.height - bounds.width) / 2;
12559
+ bounds.height = bounds.width;
12560
+ }
12561
+ return bounds;
12562
+ };
12563
+
12564
+ var inlineFormElement = function inlineFormElement(value, node, container, allowLinebreak) {
12565
+ var body = node.ownerDocument.body;
12566
+ if (value.length > 0 && body) {
12567
+ var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
12568
+ (0, _Util.copyCSSStyles)(node.ownerDocument.defaultView.getComputedStyle(node, null), wrapper);
12569
+ wrapper.style.position = 'absolute';
12570
+ wrapper.style.left = container.bounds.left + 'px';
12571
+ wrapper.style.top = container.bounds.top + 'px';
12572
+ if (!allowLinebreak) {
12573
+ wrapper.style.whiteSpace = 'nowrap';
12574
  }
12575
+ var text = node.ownerDocument.createTextNode(value);
12576
+ wrapper.appendChild(text);
12577
+ body.appendChild(wrapper);
12578
+ container.childNodes.push(_TextContainer2.default.fromTextNode(text, container));
12579
+ body.removeChild(wrapper);
12580
+ }
12581
+ };
 
 
 
12582
 
12583
+ var getInputValue = function getInputValue(node) {
12584
+ var value = node.type === 'password' ? new Array(node.value.length + 1).join('\u2022') : node.value;
 
 
12585
 
12586
+ return value.length === 0 ? node.placeholder || '' : value;
12587
+ };
12588
 
12589
+ /***/ }),
12590
+ /* 22 */
12591
+ /***/ (function(module, exports, __webpack_require__) {
12592
 
12593
+ "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12594
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12595
 
12596
+ Object.defineProperty(exports, "__esModule", {
12597
+ value: true
12598
+ });
12599
+ exports.parseTextBounds = exports.TextBounds = undefined;
12600
 
12601
+ var _Bounds = __webpack_require__(2);
12602
 
12603
+ var _textDecoration = __webpack_require__(11);
12604
 
12605
+ var _Feature = __webpack_require__(10);
 
 
12606
 
12607
+ var _Feature2 = _interopRequireDefault(_Feature);
12608
+
12609
+ var _Unicode = __webpack_require__(24);
12610
+
12611
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12612
+
12613
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12614
+
12615
+ var TextBounds = exports.TextBounds = function TextBounds(text, bounds) {
12616
+ _classCallCheck(this, TextBounds);
12617
+
12618
+ this.text = text;
12619
+ this.bounds = bounds;
12620
  };
12621
 
12622
+ var parseTextBounds = exports.parseTextBounds = function parseTextBounds(value, parent, node) {
12623
+ var letterRendering = parent.style.letterSpacing !== 0;
12624
+ var textList = letterRendering ? (0, _Unicode.toCodePoints)(value).map(function (i) {
12625
+ return (0, _Unicode.fromCodePoint)(i);
12626
+ }) : (0, _Unicode.breakWords)(value, parent);
12627
+ var length = textList.length;
12628
+ var defaultView = node.parentNode ? node.parentNode.ownerDocument.defaultView : null;
12629
+ var scrollX = defaultView ? defaultView.pageXOffset : 0;
12630
+ var scrollY = defaultView ? defaultView.pageYOffset : 0;
12631
+ var textBounds = [];
12632
+ var offset = 0;
12633
  for (var i = 0; i < length; i++) {
12634
+ var text = textList[i];
12635
+ if (parent.style.textDecoration !== _textDecoration.TEXT_DECORATION.NONE || text.trim().length > 0) {
12636
+ if (_Feature2.default.SUPPORT_RANGE_BOUNDS) {
12637
+ textBounds.push(new TextBounds(text, getRangeBounds(node, offset, text.length, scrollX, scrollY)));
 
 
 
 
 
 
 
 
12638
  } else {
12639
+ var replacementNode = node.splitText(text.length);
12640
+ textBounds.push(new TextBounds(text, getWrapperBounds(node, scrollX, scrollY)));
12641
+ node = replacementNode;
12642
  }
12643
+ } else if (!_Feature2.default.SUPPORT_RANGE_BOUNDS) {
12644
+ node = node.splitText(text.length);
12645
  }
12646
+ offset += text.length;
12647
  }
12648
+ return textBounds;
12649
  };
12650
 
12651
+ var getWrapperBounds = function getWrapperBounds(node, scrollX, scrollY) {
12652
+ var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
12653
+ wrapper.appendChild(node.cloneNode(true));
12654
+ var parentNode = node.parentNode;
12655
+ if (parentNode) {
12656
+ parentNode.replaceChild(wrapper, node);
12657
+ var bounds = (0, _Bounds.parseBounds)(wrapper, scrollX, scrollY);
12658
+ if (wrapper.firstChild) {
12659
+ parentNode.replaceChild(wrapper.firstChild, wrapper);
12660
+ }
12661
+ return bounds;
12662
  }
12663
+ return new _Bounds.Bounds(0, 0, 0, 0);
12664
+ };
12665
 
12666
+ var getRangeBounds = function getRangeBounds(node, offset, length, scrollX, scrollY) {
12667
+ var range = node.ownerDocument.createRange();
12668
+ range.setStart(node, offset);
12669
+ range.setEnd(node, offset + length);
12670
+ return _Bounds.Bounds.fromClientRect(range.getBoundingClientRect(), scrollX, scrollY);
12671
  };
12672
 
12673
  /***/ }),
12674
+ /* 23 */
12675
  /***/ (function(module, exports, __webpack_require__) {
12676
 
12677
  "use strict";
12680
  Object.defineProperty(exports, "__esModule", {
12681
  value: true
12682
  });
 
12683
 
12684
+ var _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; }; }();
12685
 
12686
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12687
 
12688
+ var ForeignObjectRenderer = function () {
12689
+ function ForeignObjectRenderer(element) {
12690
+ _classCallCheck(this, ForeignObjectRenderer);
12691
 
12692
+ this.element = element;
12693
+ }
12694
 
12695
+ _createClass(ForeignObjectRenderer, [{
12696
+ key: 'render',
12697
+ value: function render(options) {
12698
+ var _this = this;
12699
 
12700
+ this.options = options;
12701
+ this.canvas = document.createElement('canvas');
12702
+ this.ctx = this.canvas.getContext('2d');
12703
+ this.canvas.width = Math.floor(options.width) * options.scale;
12704
+ this.canvas.height = Math.floor(options.height) * options.scale;
12705
+ this.canvas.style.width = options.width + 'px';
12706
+ this.canvas.style.height = options.height + 'px';
12707
 
12708
+ options.logger.log('ForeignObject renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + options.scale);
12709
+ 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);
12710
 
12711
+ return loadSerializedSVG(svg).then(function (img) {
12712
+ if (options.backgroundColor) {
12713
+ _this.ctx.fillStyle = options.backgroundColor.toString();
12714
+ _this.ctx.fillRect(0, 0, options.width * options.scale, options.height * options.scale);
12715
+ }
12716
 
12717
+ _this.ctx.drawImage(img, -options.x * options.scale, -options.y * options.scale);
12718
+ return _this.canvas;
12719
+ });
12720
+ }
12721
+ }]);
12722
 
12723
+ return ForeignObjectRenderer;
12724
+ }();
12725
 
12726
+ exports.default = ForeignObjectRenderer;
12727
+ var createForeignObjectSVG = exports.createForeignObjectSVG = function createForeignObjectSVG(width, height, x, y, node) {
12728
+ var xmlns = 'http://www.w3.org/2000/svg';
12729
+ var svg = document.createElementNS(xmlns, 'svg');
12730
+ var foreignObject = document.createElementNS(xmlns, 'foreignObject');
12731
+ svg.setAttributeNS(null, 'width', width);
12732
+ svg.setAttributeNS(null, 'height', height);
12733
 
12734
+ foreignObject.setAttributeNS(null, 'width', '100%');
12735
+ foreignObject.setAttributeNS(null, 'height', '100%');
12736
+ foreignObject.setAttributeNS(null, 'x', x);
12737
+ foreignObject.setAttributeNS(null, 'y', y);
12738
+ foreignObject.setAttributeNS(null, 'externalResourcesRequired', 'true');
12739
+ svg.appendChild(foreignObject);
12740
 
12741
+ foreignObject.appendChild(node);
 
 
 
12742
 
12743
+ return svg;
 
 
12744
  };
12745
 
12746
+ var loadSerializedSVG = exports.loadSerializedSVG = function loadSerializedSVG(svg) {
12747
+ return new Promise(function (resolve, reject) {
12748
+ var img = new Image();
12749
+ img.onload = function () {
12750
+ return resolve(img);
12751
+ };
12752
+ img.onerror = reject;
12753
+
12754
+ img.src = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(new XMLSerializer().serializeToString(svg));
12755
+ });
12756
  };
12757
 
12758
+ /***/ }),
12759
+ /* 24 */
12760
+ /***/ (function(module, exports, __webpack_require__) {
12761
 
12762
+ "use strict";
 
 
 
12763
 
 
 
12764
 
12765
+ Object.defineProperty(exports, "__esModule", {
12766
+ value: true
12767
+ });
12768
+ exports.breakWords = exports.fromCodePoint = exports.toCodePoints = undefined;
 
 
12769
 
12770
+ var _cssLineBreak = __webpack_require__(46);
 
 
 
12771
 
12772
+ Object.defineProperty(exports, 'toCodePoints', {
12773
+ enumerable: true,
12774
+ get: function get() {
12775
+ return _cssLineBreak.toCodePoints;
 
 
 
 
 
12776
  }
12777
+ });
12778
+ Object.defineProperty(exports, 'fromCodePoint', {
12779
+ enumerable: true,
12780
+ get: function get() {
12781
+ return _cssLineBreak.fromCodePoint;
12782
+ }
12783
+ });
12784
 
12785
+ var _NodeContainer = __webpack_require__(3);
 
12786
 
12787
+ var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
 
 
 
 
 
 
 
12788
 
12789
+ var _overflowWrap = __webpack_require__(18);
 
 
12790
 
12791
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12792
 
12793
+ var breakWords = exports.breakWords = function breakWords(str, parent) {
12794
+ var breaker = (0, _cssLineBreak.LineBreaker)(str, {
12795
+ lineBreak: parent.style.lineBreak,
12796
+ wordBreak: parent.style.overflowWrap === _overflowWrap.OVERFLOW_WRAP.BREAK_WORD ? 'break-word' : parent.style.wordBreak
 
12797
  });
12798
 
12799
+ var words = [];
12800
+ var bk = void 0;
12801
+
12802
+ while (!(bk = breaker.next()).done) {
12803
+ words.push(bk.value.slice());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12804
  }
12805
 
12806
+ return words;
12807
  };
12808
 
12809
+ /***/ }),
12810
+ /* 25 */
12811
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
12812
 
12813
+ "use strict";
 
12814
 
 
 
12815
 
12816
+ Object.defineProperty(exports, "__esModule", {
12817
+ value: true
12818
+ });
12819
+ exports.FontMetrics = undefined;
 
 
 
12820
 
12821
+ var _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; }; }();
 
 
 
 
12822
 
12823
+ var _Util = __webpack_require__(4);
 
 
12824
 
12825
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
12826
 
12827
+ var SAMPLE_TEXT = 'Hidden Text';
12828
+
12829
+ var FontMetrics = exports.FontMetrics = function () {
12830
+ function FontMetrics(document) {
12831
+ _classCallCheck(this, FontMetrics);
12832
+
12833
+ this._data = {};
12834
+ this._document = document;
12835
  }
12836
 
12837
+ _createClass(FontMetrics, [{
12838
+ key: '_parseMetrics',
12839
+ value: function _parseMetrics(font) {
12840
+ var container = this._document.createElement('div');
12841
+ var img = this._document.createElement('img');
12842
+ var span = this._document.createElement('span');
12843
 
12844
+ var body = this._document.body;
12845
+ if (!body) {
12846
+ throw new Error( true ? 'No document found for font metrics' : '');
12847
+ }
12848
 
12849
+ container.style.visibility = 'hidden';
12850
+ container.style.fontFamily = font.fontFamily;
12851
+ container.style.fontSize = font.fontSize;
12852
+ container.style.margin = '0';
12853
+ container.style.padding = '0';
 
 
12854
 
12855
+ body.appendChild(container);
 
 
 
12856
 
12857
+ img.src = _Util.SMALL_IMAGE;
12858
+ img.width = 1;
12859
+ img.height = 1;
12860
 
12861
+ img.style.margin = '0';
12862
+ img.style.padding = '0';
12863
+ img.style.verticalAlign = 'baseline';
12864
 
12865
+ span.style.fontFamily = font.fontFamily;
12866
+ span.style.fontSize = font.fontSize;
12867
+ span.style.margin = '0';
12868
+ span.style.padding = '0';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12869
 
12870
+ span.appendChild(this._document.createTextNode(SAMPLE_TEXT));
12871
+ container.appendChild(span);
12872
+ container.appendChild(img);
12873
+ var baseline = img.offsetTop - span.offsetTop + 2;
 
12874
 
12875
+ container.removeChild(span);
12876
+ container.appendChild(this._document.createTextNode(SAMPLE_TEXT));
12877
 
12878
+ container.style.lineHeight = 'normal';
12879
+ img.style.verticalAlign = 'super';
12880
 
12881
+ var middle = img.offsetTop - container.offsetTop + 2;
 
12882
 
12883
+ body.removeChild(container);
 
 
 
 
 
 
 
 
12884
 
12885
+ return { baseline: baseline, middle: middle };
12886
+ }
12887
  }, {
12888
+ key: 'getMetrics',
12889
+ value: function getMetrics(font) {
12890
+ var key = font.fontFamily + ' ' + font.fontSize;
12891
+ if (this._data[key] === undefined) {
12892
+ this._data[key] = this._parseMetrics(font);
12893
+ }
12894
 
12895
+ return this._data[key];
12896
+ }
12897
+ }]);
 
 
12898
 
12899
+ return FontMetrics;
12900
+ }();
 
 
 
 
 
 
 
 
 
12901
 
12902
+ /***/ }),
12903
+ /* 26 */
12904
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
12905
 
12906
+ "use strict";
 
 
 
 
 
 
 
 
12907
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12908
 
12909
+ Object.defineProperty(exports, "__esModule", {
12910
+ value: true
12911
+ });
12912
+ exports.Proxy = undefined;
 
 
12913
 
12914
+ var _Feature = __webpack_require__(10);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12915
 
12916
+ var _Feature2 = _interopRequireDefault(_Feature);
 
 
 
 
 
 
 
 
 
 
12917
 
12918
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
12919
 
12920
+ var Proxy = exports.Proxy = function Proxy(src, options) {
12921
+ if (!options.proxy) {
12922
+ return Promise.reject( true ? 'No proxy defined' : null);
12923
  }
12924
+ var proxy = options.proxy;
12925
 
12926
+ return new Promise(function (resolve, reject) {
12927
+ var responseType = _Feature2.default.SUPPORT_CORS_XHR && _Feature2.default.SUPPORT_RESPONSE_TYPE ? 'blob' : 'text';
12928
+ var xhr = _Feature2.default.SUPPORT_CORS_XHR ? new XMLHttpRequest() : new XDomainRequest();
12929
+ xhr.onload = function () {
12930
+ if (xhr instanceof XMLHttpRequest) {
12931
+ if (xhr.status === 200) {
12932
+ if (responseType === 'text') {
12933
+ resolve(xhr.response);
12934
+ } else {
12935
+ var reader = new FileReader();
12936
+ // $FlowFixMe
12937
+ reader.addEventListener('load', function () {
12938
+ return resolve(reader.result);
12939
+ }, false);
12940
+ // $FlowFixMe
12941
+ reader.addEventListener('error', function (e) {
12942
+ return reject(e);
12943
+ }, false);
12944
+ reader.readAsDataURL(xhr.response);
12945
+ }
12946
+ } else {
12947
+ reject( true ? 'Failed to proxy resource ' + src.substring(0, 256) + ' with status code ' + xhr.status : '');
12948
+ }
12949
+ } else {
12950
+ resolve(xhr.responseText);
12951
+ }
12952
+ };
12953
 
12954
+ xhr.onerror = reject;
12955
+ xhr.open('GET', proxy + '?url=' + encodeURIComponent(src) + '&responseType=' + responseType);
 
 
 
 
 
12956
 
12957
+ if (responseType !== 'text' && xhr instanceof XMLHttpRequest) {
12958
+ xhr.responseType = responseType;
 
 
 
12959
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12960
 
12961
+ if (options.imageTimeout) {
12962
+ var timeout = options.imageTimeout;
12963
+ xhr.timeout = timeout;
12964
+ xhr.ontimeout = function () {
12965
+ return reject( true ? 'Timed out (' + timeout + 'ms) proxying ' + src.substring(0, 256) : '');
12966
+ };
 
 
12967
  }
12968
 
12969
+ xhr.send();
 
 
 
 
 
 
 
 
 
 
12970
  });
12971
  };
12972
 
12973
  /***/ }),
12974
+ /* 27 */
12975
  /***/ (function(module, exports, __webpack_require__) {
12976
 
12977
  "use strict";
12978
 
12979
 
12980
+ var _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; };
 
 
 
12981
 
12982
+ var _CanvasRenderer = __webpack_require__(15);
 
12983
 
12984
+ var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);
12985
+
12986
+ var _Logger = __webpack_require__(16);
12987
+
12988
+ var _Logger2 = _interopRequireDefault(_Logger);
12989
+
12990
+ var _Window = __webpack_require__(28);
12991
+
12992
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12993
+
12994
+ var html2canvas = function html2canvas(element, conf) {
12995
+ var config = conf || {};
12996
+ var logger = new _Logger2.default(typeof config.logging === 'boolean' ? config.logging : true);
12997
+ logger.log('html2canvas ' + "1.0.0-alpha.12");
12998
+
12999
+ if (true && typeof config.onrendered === 'function') {
13000
+ logger.error('onrendered option is deprecated, html2canvas returns a Promise with the canvas as the value');
13001
  }
13002
 
13003
+ var ownerDocument = element.ownerDocument;
13004
+ if (!ownerDocument) {
13005
+ return Promise.reject('Provided element is not within a Document');
13006
+ }
13007
+ var defaultView = ownerDocument.defaultView;
13008
+
13009
+ var defaultOptions = {
13010
+ async: true,
13011
+ allowTaint: false,
13012
+ backgroundColor: '#ffffff',
13013
+ imageTimeout: 15000,
13014
+ logging: true,
13015
+ proxy: null,
13016
+ removeContainer: true,
13017
+ foreignObjectRendering: false,
13018
+ scale: defaultView.devicePixelRatio || 1,
13019
+ target: new _CanvasRenderer2.default(config.canvas),
13020
+ useCORS: false,
13021
+ windowWidth: defaultView.innerWidth,
13022
+ windowHeight: defaultView.innerHeight,
13023
+ scrollX: defaultView.pageXOffset,
13024
+ scrollY: defaultView.pageYOffset
13025
+ };
13026
+
13027
+ var result = (0, _Window.renderElement)(element, _extends({}, defaultOptions, config), logger);
13028
+
13029
+ if (true) {
13030
+ return result.catch(function (e) {
13031
+ logger.error(e);
13032
+ throw e;
13033
+ });
13034
+ }
13035
+ return result;
13036
  };
13037
 
13038
+ html2canvas.CanvasRenderer = _CanvasRenderer2.default;
13039
+
13040
+ module.exports = html2canvas;
13041
+
13042
  /***/ }),
13043
+ /* 28 */
13044
  /***/ (function(module, exports, __webpack_require__) {
13045
 
13046
  "use strict";
13049
  Object.defineProperty(exports, "__esModule", {
13050
  value: true
13051
  });
13052
+ exports.renderElement = undefined;
13053
 
13054
  var _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"); } }; }();
13055
 
13056
+ var _Logger = __webpack_require__(16);
13057
 
13058
+ var _Logger2 = _interopRequireDefault(_Logger);
13059
 
13060
+ var _NodeParser = __webpack_require__(29);
13061
 
13062
+ var _Renderer = __webpack_require__(51);
13063
 
13064
+ var _Renderer2 = _interopRequireDefault(_Renderer);
13065
 
13066
+ var _ForeignObjectRenderer = __webpack_require__(23);
13067
 
13068
+ var _ForeignObjectRenderer2 = _interopRequireDefault(_ForeignObjectRenderer);
13069
 
13070
+ var _Feature = __webpack_require__(10);
13071
 
13072
+ var _Feature2 = _interopRequireDefault(_Feature);
13073
 
13074
+ var _Bounds = __webpack_require__(2);
13075
+
13076
+ var _Clone = __webpack_require__(54);
13077
+
13078
+ var _Font = __webpack_require__(25);
13079
+
13080
+ var _Color = __webpack_require__(0);
13081
+
13082
+ var _Color2 = _interopRequireDefault(_Color);
13083
 
13084
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13085
 
13086
+ var renderElement = exports.renderElement = function renderElement(element, options, logger) {
13087
+ var ownerDocument = element.ownerDocument;
13088
 
13089
+ var windowBounds = new _Bounds.Bounds(options.scrollX, options.scrollY, options.windowWidth, options.windowHeight);
13090
 
13091
+ // http://www.w3.org/TR/css3-background/#special-backgrounds
13092
+ var documentBackgroundColor = ownerDocument.documentElement ? new _Color2.default(getComputedStyle(ownerDocument.documentElement).backgroundColor) : _Color.TRANSPARENT;
13093
+ var bodyBackgroundColor = ownerDocument.body ? new _Color2.default(getComputedStyle(ownerDocument.body).backgroundColor) : _Color.TRANSPARENT;
13094
 
13095
+ var backgroundColor = element === ownerDocument.documentElement ? documentBackgroundColor.isTransparent() ? bodyBackgroundColor.isTransparent() ? options.backgroundColor ? new _Color2.default(options.backgroundColor) : null : bodyBackgroundColor : documentBackgroundColor : options.backgroundColor ? new _Color2.default(options.backgroundColor) : null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13096
 
13097
+ return (options.foreignObjectRendering ? // $FlowFixMe
13098
+ _Feature2.default.SUPPORT_FOREIGNOBJECT_DRAWING : Promise.resolve(false)).then(function (supportForeignObject) {
13099
+ return supportForeignObject ? function (cloner) {
13100
+ if (true) {
13101
+ logger.log('Document cloned, using foreignObject rendering');
 
 
 
 
 
 
 
 
13102
  }
 
 
 
 
 
13103
 
13104
+ return cloner.inlineFonts(ownerDocument).then(function () {
13105
+ return cloner.resourceLoader.ready();
13106
+ }).then(function () {
13107
+ var renderer = new _ForeignObjectRenderer2.default(cloner.documentElement);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13108
 
13109
+ var defaultView = ownerDocument.defaultView;
13110
+ var scrollX = defaultView.pageXOffset;
13111
+ var scrollY = defaultView.pageYOffset;
 
 
 
 
 
 
 
 
13112
 
13113
+ var isDocument = element.tagName === 'HTML' || element.tagName === 'BODY';
 
 
 
13114
 
13115
+ var _ref = isDocument ? (0, _Bounds.parseDocumentSize)(ownerDocument) : (0, _Bounds.parseBounds)(element, scrollX, scrollY),
13116
+ width = _ref.width,
13117
+ height = _ref.height,
13118
+ left = _ref.left,
13119
+ top = _ref.top;
13120
 
13121
+ return renderer.render({
13122
+ backgroundColor: backgroundColor,
13123
+ logger: logger,
13124
+ scale: options.scale,
13125
+ x: typeof options.x === 'number' ? options.x : left,
13126
+ y: typeof options.y === 'number' ? options.y : top,
13127
+ width: typeof options.width === 'number' ? options.width : Math.ceil(width),
13128
+ height: typeof options.height === 'number' ? options.height : Math.ceil(height),
13129
+ windowWidth: options.windowWidth,
13130
+ windowHeight: options.windowHeight,
13131
+ scrollX: options.scrollX,
13132
+ scrollY: options.scrollY
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13133
  });
13134
+ });
13135
+ }(new _Clone.DocumentCloner(element, options, logger, true, renderElement)) : (0, _Clone.cloneWindow)(ownerDocument, windowBounds, element, options, logger, renderElement).then(function (_ref2) {
13136
+ var _ref3 = _slicedToArray(_ref2, 3),
13137
+ container = _ref3[0],
13138
+ clonedElement = _ref3[1],
13139
+ resourceLoader = _ref3[2];
13140
 
13141
+ if (true) {
13142
+ logger.log('Document cloned, using computed rendering');
 
 
 
 
 
 
 
 
 
 
 
 
 
13143
  }
13144
 
13145
+ var stack = (0, _NodeParser.NodeParser)(clonedElement, resourceLoader, logger);
13146
+ var clonedDocument = clonedElement.ownerDocument;
 
 
 
 
 
 
 
 
 
13147
 
13148
+ if (backgroundColor === stack.container.style.background.backgroundColor) {
13149
+ stack.container.style.background.backgroundColor = _Color.TRANSPARENT;
13150
  }
13151
 
13152
+ return resourceLoader.ready().then(function (imageStore) {
13153
+ var fontMetrics = new _Font.FontMetrics(clonedDocument);
13154
+ if (true) {
13155
+ logger.log('Starting renderer');
13156
+ }
13157
 
13158
+ var defaultView = clonedDocument.defaultView;
13159
+ var scrollX = defaultView.pageXOffset;
13160
+ var scrollY = defaultView.pageYOffset;
13161
 
13162
+ var isDocument = clonedElement.tagName === 'HTML' || clonedElement.tagName === 'BODY';
 
 
 
 
 
 
 
 
 
 
13163
 
13164
+ var _ref4 = isDocument ? (0, _Bounds.parseDocumentSize)(ownerDocument) : (0, _Bounds.parseBounds)(clonedElement, scrollX, scrollY),
13165
+ width = _ref4.width,
13166
+ height = _ref4.height,
13167
+ left = _ref4.left,
13168
+ top = _ref4.top;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13169
 
13170
+ var renderOptions = {
13171
+ backgroundColor: backgroundColor,
13172
+ fontMetrics: fontMetrics,
13173
+ imageStore: imageStore,
13174
+ logger: logger,
13175
+ scale: options.scale,
13176
+ x: typeof options.x === 'number' ? options.x : left,
13177
+ y: typeof options.y === 'number' ? options.y : top,
13178
+ width: typeof options.width === 'number' ? options.width : Math.ceil(width),
13179
+ height: typeof options.height === 'number' ? options.height : Math.ceil(height)
13180
  };
 
 
 
13181
 
13182
+ if (Array.isArray(options.target)) {
13183
+ return Promise.all(options.target.map(function (target) {
13184
+ var renderer = new _Renderer2.default(target, renderOptions);
13185
+ return renderer.render(stack);
13186
+ }));
13187
+ } else {
13188
+ var renderer = new _Renderer2.default(options.target, renderOptions);
13189
+ var canvas = renderer.render(stack);
13190
+ if (options.removeContainer === true) {
13191
+ if (container.parentNode) {
13192
+ container.parentNode.removeChild(container);
13193
+ } else if (true) {
13194
+ logger.log('Cannot detach cloned iframe as it is not in the DOM anymore');
13195
+ }
13196
+ }
13197
 
13198
+ return canvas;
13199
+ }
13200
+ });
13201
+ });
 
 
 
 
13202
  });
13203
  };
13204
 
13205
+ /***/ }),
13206
+ /* 29 */
13207
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
13208
 
13209
+ "use strict";
 
 
 
 
 
 
13210
 
 
 
13211
 
13212
+ Object.defineProperty(exports, "__esModule", {
13213
+ value: true
13214
+ });
13215
+ exports.NodeParser = undefined;
 
13216
 
13217
+ var _StackingContext = __webpack_require__(30);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13218
 
13219
+ var _StackingContext2 = _interopRequireDefault(_StackingContext);
 
 
 
13220
 
13221
+ var _NodeContainer = __webpack_require__(3);
 
13222
 
13223
+ var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13224
 
13225
+ var _TextContainer = __webpack_require__(9);
 
 
 
 
 
 
13226
 
13227
+ var _TextContainer2 = _interopRequireDefault(_TextContainer);
 
13228
 
13229
+ var _Input = __webpack_require__(21);
 
 
 
 
13230
 
13231
+ var _ListItem = __webpack_require__(14);
13232
 
13233
+ var _listStyle = __webpack_require__(8);
 
 
13234
 
13235
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
13236
 
13237
+ var NodeParser = exports.NodeParser = function NodeParser(node, resourceLoader, logger) {
13238
+ if (true) {
13239
+ logger.log('Starting node parsing');
13240
+ }
 
13241
 
13242
+ var index = 0;
 
 
13243
 
13244
+ var container = new _NodeContainer2.default(node, null, resourceLoader, index++);
13245
+ var stack = new _StackingContext2.default(container, null, true);
 
13246
 
13247
+ parseNodeTree(node, container, stack, resourceLoader, index);
13248
 
13249
+ if (true) {
13250
+ logger.log('Finished parsing node tree');
13251
+ }
 
 
 
 
 
 
13252
 
13253
+ return stack;
13254
+ };
 
 
 
13255
 
13256
+ var IGNORED_NODE_NAMES = ['SCRIPT', 'HEAD', 'TITLE', 'OBJECT', 'BR', 'OPTION'];
 
 
 
 
13257
 
13258
+ var parseNodeTree = function parseNodeTree(node, parent, stack, resourceLoader, index) {
13259
+ if (true && index > 50000) {
13260
+ throw new Error('Recursion error while parsing node tree');
 
13261
  }
 
13262
 
13263
+ for (var childNode = node.firstChild, nextNode; childNode; childNode = nextNode) {
13264
+ nextNode = childNode.nextSibling;
13265
+ var defaultView = childNode.ownerDocument.defaultView;
13266
+ if (childNode instanceof defaultView.Text || childNode instanceof Text || defaultView.parent && childNode instanceof defaultView.parent.Text) {
13267
+ if (childNode.data.trim().length > 0) {
13268
+ parent.childNodes.push(_TextContainer2.default.fromTextNode(childNode, parent));
13269
+ }
13270
+ } else if (childNode instanceof defaultView.HTMLElement || childNode instanceof HTMLElement || defaultView.parent && childNode instanceof defaultView.parent.HTMLElement) {
13271
+ if (IGNORED_NODE_NAMES.indexOf(childNode.nodeName) === -1) {
13272
+ var container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++);
13273
+ if (container.isVisible()) {
13274
+ if (childNode.tagName === 'INPUT') {
13275
+ // $FlowFixMe
13276
+ (0, _Input.inlineInputElement)(childNode, container);
13277
+ } else if (childNode.tagName === 'TEXTAREA') {
13278
+ // $FlowFixMe
13279
+ (0, _Input.inlineTextAreaElement)(childNode, container);
13280
+ } else if (childNode.tagName === 'SELECT') {
13281
+ // $FlowFixMe
13282
+ (0, _Input.inlineSelectElement)(childNode, container);
13283
+ } else if (container.style.listStyle && container.style.listStyle.listStyleType !== _listStyle.LIST_STYLE_TYPE.NONE) {
13284
+ (0, _ListItem.inlineListItemElement)(childNode, container, resourceLoader);
13285
+ }
13286
 
13287
+ var SHOULD_TRAVERSE_CHILDREN = childNode.tagName !== 'TEXTAREA';
13288
+ var treatAsRealStackingContext = createsRealStackingContext(container, childNode);
13289
+ if (treatAsRealStackingContext || createsStackingContext(container)) {
13290
+ // for treatAsRealStackingContext:false, any positioned descendants and descendants
13291
+ // which actually create a new stacking context should be considered part of the parent stacking context
13292
+ var parentStack = treatAsRealStackingContext || container.isPositioned() ? stack.getRealParentStackingContext() : stack;
13293
+ var childStack = new _StackingContext2.default(container, parentStack, treatAsRealStackingContext);
13294
+ parentStack.contexts.push(childStack);
13295
+ if (SHOULD_TRAVERSE_CHILDREN) {
13296
+ parseNodeTree(childNode, container, childStack, resourceLoader, index);
13297
+ }
13298
+ } else {
13299
+ stack.children.push(container);
13300
+ if (SHOULD_TRAVERSE_CHILDREN) {
13301
+ parseNodeTree(childNode, container, stack, resourceLoader, index);
13302
+ }
13303
+ }
13304
+ }
13305
+ }
13306
+ } else if (childNode instanceof defaultView.SVGSVGElement || childNode instanceof SVGSVGElement || defaultView.parent && childNode instanceof defaultView.parent.SVGSVGElement) {
13307
+ var _container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++);
13308
+ var _treatAsRealStackingContext = createsRealStackingContext(_container, childNode);
13309
+ if (_treatAsRealStackingContext || createsStackingContext(_container)) {
13310
+ // for treatAsRealStackingContext:false, any positioned descendants and descendants
13311
+ // which actually create a new stacking context should be considered part of the parent stacking context
13312
+ var _parentStack = _treatAsRealStackingContext || _container.isPositioned() ? stack.getRealParentStackingContext() : stack;
13313
+ var _childStack = new _StackingContext2.default(_container, _parentStack, _treatAsRealStackingContext);
13314
+ _parentStack.contexts.push(_childStack);
13315
+ } else {
13316
+ stack.children.push(_container);
13317
+ }
13318
+ }
13319
+ }
13320
+ };
13321
 
13322
+ var createsRealStackingContext = function createsRealStackingContext(container, node) {
13323
+ return container.isRootElement() || container.isPositionedWithZIndex() || container.style.opacity < 1 || container.isTransformed() || isBodyWithTransparentRoot(container, node);
13324
  };
13325
 
13326
+ var createsStackingContext = function createsStackingContext(container) {
13327
+ return container.isPositioned() || container.isFloating();
13328
+ };
13329
 
13330
+ var isBodyWithTransparentRoot = function isBodyWithTransparentRoot(container, node) {
13331
+ return node.nodeName === 'BODY' && container.parent instanceof _NodeContainer2.default && container.parent.style.background.backgroundColor.isTransparent();
 
 
 
 
 
 
 
 
13332
  };
13333
 
13334
+ /***/ }),
13335
+ /* 30 */
13336
+ /***/ (function(module, exports, __webpack_require__) {
 
13337
 
13338
+ "use strict";
 
 
13339
 
 
 
 
13340
 
13341
+ Object.defineProperty(exports, "__esModule", {
13342
+ value: true
13343
+ });
 
 
 
 
 
13344
 
13345
+ var _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; }; }();
13346
 
13347
+ var _NodeContainer = __webpack_require__(3);
13348
 
13349
+ var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
 
 
 
 
 
13350
 
13351
+ var _position = __webpack_require__(19);
 
 
 
 
 
13352
 
13353
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
13354
 
13355
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
13356
 
13357
+ var StackingContext = function () {
13358
+ function StackingContext(container, parent, treatAsRealStackingContext) {
13359
+ _classCallCheck(this, StackingContext);
13360
 
13361
+ this.container = container;
13362
+ this.parent = parent;
13363
+ this.contexts = [];
13364
+ this.children = [];
13365
+ this.treatAsRealStackingContext = treatAsRealStackingContext;
13366
+ }
13367
 
13368
+ _createClass(StackingContext, [{
13369
+ key: 'getOpacity',
13370
+ value: function getOpacity() {
13371
+ return this.parent ? this.container.style.opacity * this.parent.getOpacity() : this.container.style.opacity;
13372
+ }
13373
+ }, {
13374
+ key: 'getRealParentStackingContext',
13375
+ value: function getRealParentStackingContext() {
13376
+ return !this.parent || this.treatAsRealStackingContext ? this : this.parent.getRealParentStackingContext();
13377
  }
13378
+ }]);
13379
 
13380
+ return StackingContext;
13381
+ }();
13382
 
13383
+ exports.default = StackingContext;
13384
+
13385
+ /***/ }),
13386
+ /* 31 */
13387
+ /***/ (function(module, exports, __webpack_require__) {
13388
+
13389
+ "use strict";
13390
+
13391
+
13392
+ Object.defineProperty(exports, "__esModule", {
13393
+ value: true
13394
+ });
13395
+
13396
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13397
+
13398
+ var Size = function Size(width, height) {
13399
+ _classCallCheck(this, Size);
13400
+
13401
+ this.width = width;
13402
+ this.height = height;
13403
  };
13404
 
13405
+ exports.default = Size;
13406
+
13407
  /***/ }),
13408
+ /* 32 */
13409
  /***/ (function(module, exports, __webpack_require__) {
13410
 
13411
  "use strict";
13414
  Object.defineProperty(exports, "__esModule", {
13415
  value: true
13416
  });
 
13417
 
13418
  var _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; }; }();
13419
 
13420
+ var _Path = __webpack_require__(6);
13421
 
13422
+ var _Vector = __webpack_require__(7);
13423
 
13424
+ var _Vector2 = _interopRequireDefault(_Vector);
13425
 
13426
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13427
 
13428
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13429
 
13430
+ var lerp = function lerp(a, b, t) {
13431
+ return new _Vector2.default(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t);
13432
+ };
13433
 
13434
+ var BezierCurve = function () {
13435
+ function BezierCurve(start, startControl, endControl, end) {
13436
+ _classCallCheck(this, BezierCurve);
13437
+
13438
+ this.type = _Path.PATH.BEZIER_CURVE;
13439
+ this.start = start;
13440
+ this.startControl = startControl;
13441
+ this.endControl = endControl;
13442
+ this.end = end;
13443
  }
13444
 
13445
+ _createClass(BezierCurve, [{
13446
+ key: 'subdivide',
13447
+ value: function subdivide(t, firstHalf) {
13448
+ var ab = lerp(this.start, this.startControl, t);
13449
+ var bc = lerp(this.startControl, this.endControl, t);
13450
+ var cd = lerp(this.endControl, this.end, t);
13451
+ var abbc = lerp(ab, bc, t);
13452
+ var bccd = lerp(bc, cd, t);
13453
+ var dest = lerp(abbc, bccd, t);
13454
+ return firstHalf ? new BezierCurve(this.start, ab, abbc, dest) : new BezierCurve(dest, bccd, cd, this.end);
13455
+ }
13456
+ }, {
13457
+ key: 'reverse',
13458
+ value: function reverse() {
13459
+ return new BezierCurve(this.end, this.endControl, this.startControl, this.start);
13460
+ }
13461
+ }]);
13462
 
13463
+ return BezierCurve;
13464
+ }();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13465
 
13466
+ exports.default = BezierCurve;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13467
 
13468
+ /***/ }),
13469
+ /* 33 */
13470
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13471
 
13472
+ "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13473
 
 
 
13474
 
13475
+ Object.defineProperty(exports, "__esModule", {
13476
+ value: true
13477
+ });
13478
+ exports.parseBorderRadius = undefined;
13479
 
13480
+ var _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"); } }; }();
 
 
13481
 
13482
+ var _Length = __webpack_require__(1);
 
 
13483
 
13484
+ var _Length2 = _interopRequireDefault(_Length);
 
 
 
 
 
 
13485
 
13486
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
13487
 
13488
+ var SIDES = ['top-left', 'top-right', 'bottom-right', 'bottom-left'];
 
 
13489
 
13490
+ var parseBorderRadius = exports.parseBorderRadius = function parseBorderRadius(style) {
13491
+ return SIDES.map(function (side) {
13492
+ var value = style.getPropertyValue('border-' + side + '-radius');
 
 
 
 
 
 
13493
 
13494
+ var _value$split$map = value.split(' ').map(_Length2.default.create),
13495
+ _value$split$map2 = _slicedToArray(_value$split$map, 2),
13496
+ horizontal = _value$split$map2[0],
13497
+ vertical = _value$split$map2[1];
13498
 
13499
+ return typeof vertical === 'undefined' ? [horizontal, horizontal] : [horizontal, vertical];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13500
  });
13501
  };
13502
 
13503
  /***/ }),
13504
+ /* 34 */
13505
  /***/ (function(module, exports, __webpack_require__) {
13506
 
13507
  "use strict";
13510
  Object.defineProperty(exports, "__esModule", {
13511
  value: true
13512
  });
13513
+ var DISPLAY = exports.DISPLAY = {
13514
+ NONE: 1 << 0,
13515
+ BLOCK: 1 << 1,
13516
+ INLINE: 1 << 2,
13517
+ RUN_IN: 1 << 3,
13518
+ FLOW: 1 << 4,
13519
+ FLOW_ROOT: 1 << 5,
13520
+ TABLE: 1 << 6,
13521
+ FLEX: 1 << 7,
13522
+ GRID: 1 << 8,
13523
+ RUBY: 1 << 9,
13524
+ SUBGRID: 1 << 10,
13525
+ LIST_ITEM: 1 << 11,
13526
+ TABLE_ROW_GROUP: 1 << 12,
13527
+ TABLE_HEADER_GROUP: 1 << 13,
13528
+ TABLE_FOOTER_GROUP: 1 << 14,
13529
+ TABLE_ROW: 1 << 15,
13530
+ TABLE_CELL: 1 << 16,
13531
+ TABLE_COLUMN_GROUP: 1 << 17,
13532
+ TABLE_COLUMN: 1 << 18,
13533
+ TABLE_CAPTION: 1 << 19,
13534
+ RUBY_BASE: 1 << 20,
13535
+ RUBY_TEXT: 1 << 21,
13536
+ RUBY_BASE_CONTAINER: 1 << 22,
13537
+ RUBY_TEXT_CONTAINER: 1 << 23,
13538
+ CONTENTS: 1 << 24,
13539
+ INLINE_BLOCK: 1 << 25,
13540
+ INLINE_LIST_ITEM: 1 << 26,
13541
+ INLINE_TABLE: 1 << 27,
13542
+ INLINE_FLEX: 1 << 28,
13543
+ INLINE_GRID: 1 << 29
13544
  };
13545
 
13546
+ var parseDisplayValue = function parseDisplayValue(display) {
13547
+ switch (display) {
13548
+ case 'block':
13549
+ return DISPLAY.BLOCK;
13550
+ case 'inline':
13551
+ return DISPLAY.INLINE;
13552
+ case 'run-in':
13553
+ return DISPLAY.RUN_IN;
13554
+ case 'flow':
13555
+ return DISPLAY.FLOW;
13556
+ case 'flow-root':
13557
+ return DISPLAY.FLOW_ROOT;
13558
+ case 'table':
13559
+ return DISPLAY.TABLE;
13560
+ case 'flex':
13561
+ return DISPLAY.FLEX;
13562
+ case 'grid':
13563
+ return DISPLAY.GRID;
13564
+ case 'ruby':
13565
+ return DISPLAY.RUBY;
13566
+ case 'subgrid':
13567
+ return DISPLAY.SUBGRID;
13568
+ case 'list-item':
13569
+ return DISPLAY.LIST_ITEM;
13570
+ case 'table-row-group':
13571
+ return DISPLAY.TABLE_ROW_GROUP;
13572
+ case 'table-header-group':
13573
+ return DISPLAY.TABLE_HEADER_GROUP;
13574
+ case 'table-footer-group':
13575
+ return DISPLAY.TABLE_FOOTER_GROUP;
13576
+ case 'table-row':
13577
+ return DISPLAY.TABLE_ROW;
13578
+ case 'table-cell':
13579
+ return DISPLAY.TABLE_CELL;
13580
+ case 'table-column-group':
13581
+ return DISPLAY.TABLE_COLUMN_GROUP;
13582
+ case 'table-column':
13583
+ return DISPLAY.TABLE_COLUMN;
13584
+ case 'table-caption':
13585
+ return DISPLAY.TABLE_CAPTION;
13586
+ case 'ruby-base':
13587
+ return DISPLAY.RUBY_BASE;
13588
+ case 'ruby-text':
13589
+ return DISPLAY.RUBY_TEXT;
13590
+ case 'ruby-base-container':
13591
+ return DISPLAY.RUBY_BASE_CONTAINER;
13592
+ case 'ruby-text-container':
13593
+ return DISPLAY.RUBY_TEXT_CONTAINER;
13594
+ case 'contents':
13595
+ return DISPLAY.CONTENTS;
13596
+ case 'inline-block':
13597
+ return DISPLAY.INLINE_BLOCK;
13598
+ case 'inline-list-item':
13599
+ return DISPLAY.INLINE_LIST_ITEM;
13600
+ case 'inline-table':
13601
+ return DISPLAY.INLINE_TABLE;
13602
+ case 'inline-flex':
13603
+ return DISPLAY.INLINE_FLEX;
13604
+ case 'inline-grid':
13605
+ return DISPLAY.INLINE_GRID;
13606
  }
13607
 
13608
+ return DISPLAY.NONE;
13609
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13610
 
13611
+ var setDisplayBit = function setDisplayBit(bit, display) {
13612
+ return bit | parseDisplayValue(display);
13613
  };
13614
 
13615
+ var parseDisplay = exports.parseDisplay = function parseDisplay(display) {
13616
+ return display.split(' ').reduce(setDisplayBit, 0);
 
 
 
13617
  };
13618
 
13619
+ /***/ }),
13620
+ /* 35 */
13621
+ /***/ (function(module, exports, __webpack_require__) {
 
13622
 
13623
+ "use strict";
13624
 
 
 
 
13625
 
13626
+ Object.defineProperty(exports, "__esModule", {
13627
+ value: true
13628
+ });
13629
+ var FLOAT = exports.FLOAT = {
13630
+ NONE: 0,
13631
+ LEFT: 1,
13632
+ RIGHT: 2,
13633
+ INLINE_START: 3,
13634
+ INLINE_END: 4
13635
+ };
13636
 
13637
+ var parseCSSFloat = exports.parseCSSFloat = function parseCSSFloat(float) {
13638
+ switch (float) {
13639
+ case 'left':
13640
+ return FLOAT.LEFT;
13641
+ case 'right':
13642
+ return FLOAT.RIGHT;
13643
+ case 'inline-start':
13644
+ return FLOAT.INLINE_START;
13645
+ case 'inline-end':
13646
+ return FLOAT.INLINE_END;
13647
  }
13648
+ return FLOAT.NONE;
13649
+ };
13650
 
13651
+ /***/ }),
13652
+ /* 36 */
13653
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13654
 
13655
+ "use strict";
 
 
 
 
 
13656
 
 
 
 
 
13657
 
13658
+ Object.defineProperty(exports, "__esModule", {
13659
+ value: true
13660
+ });
 
13661
 
 
 
 
 
 
 
 
 
 
13662
 
13663
+ var parseFontWeight = function parseFontWeight(weight) {
13664
+ switch (weight) {
13665
+ case 'normal':
13666
+ return 400;
13667
+ case 'bold':
13668
+ return 700;
13669
  }
13670
 
13671
+ var value = parseInt(weight, 10);
13672
+ return isNaN(value) ? 400 : value;
13673
  };
13674
 
13675
+ var parseFont = exports.parseFont = function parseFont(style) {
13676
+ var fontFamily = style.fontFamily;
13677
+ var fontSize = style.fontSize;
13678
+ var fontStyle = style.fontStyle;
13679
+ var fontVariant = style.fontVariant;
13680
+ var fontWeight = parseFontWeight(style.fontWeight);
13681
 
13682
+ return {
13683
+ fontFamily: fontFamily,
13684
+ fontSize: fontSize,
13685
+ fontStyle: fontStyle,
13686
+ fontVariant: fontVariant,
13687
+ fontWeight: fontWeight
13688
+ };
13689
+ };
13690
 
13691
+ /***/ }),
13692
+ /* 37 */
13693
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
13694
 
13695
+ "use strict";
 
13696
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13697
 
13698
+ Object.defineProperty(exports, "__esModule", {
13699
+ value: true
13700
+ });
13701
+ var parseLetterSpacing = exports.parseLetterSpacing = function parseLetterSpacing(letterSpacing) {
13702
+ if (letterSpacing === 'normal') {
13703
+ return 0;
13704
+ }
13705
+ var value = parseFloat(letterSpacing);
13706
+ return isNaN(value) ? 0 : value;
13707
+ };
13708
 
13709
+ /***/ }),
13710
+ /* 38 */
13711
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
13712
 
13713
+ "use strict";
 
 
 
 
 
 
13714
 
 
 
 
 
 
 
13715
 
13716
+ Object.defineProperty(exports, "__esModule", {
13717
+ value: true
13718
+ });
13719
+ var LINE_BREAK = exports.LINE_BREAK = {
13720
+ NORMAL: 'normal',
13721
+ STRICT: 'strict'
13722
+ };
 
 
 
 
 
13723
 
13724
+ var parseLineBreak = exports.parseLineBreak = function parseLineBreak(wordBreak) {
13725
+ switch (wordBreak) {
13726
+ case 'strict':
13727
+ return LINE_BREAK.STRICT;
13728
+ case 'normal':
13729
+ default:
13730
+ return LINE_BREAK.NORMAL;
13731
+ }
13732
+ };
 
 
 
 
 
 
13733
 
13734
+ /***/ }),
13735
+ /* 39 */
13736
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
13737
 
13738
+ "use strict";
 
 
 
13739
 
 
 
 
 
 
 
 
 
13740
 
13741
+ Object.defineProperty(exports, "__esModule", {
13742
+ value: true
13743
+ });
13744
+ exports.parseMargin = undefined;
 
 
 
 
 
13745
 
13746
+ var _Length = __webpack_require__(1);
 
 
13747
 
13748
+ var _Length2 = _interopRequireDefault(_Length);
 
 
 
13749
 
13750
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
13751
 
13752
+ var SIDES = ['top', 'right', 'bottom', 'left'];
 
 
13753
 
13754
+ var parseMargin = exports.parseMargin = function parseMargin(style) {
13755
+ return SIDES.map(function (side) {
13756
+ return new _Length2.default(style.getPropertyValue('margin-' + side));
13757
+ });
13758
  };
13759
 
13760
+ /***/ }),
13761
+ /* 40 */
13762
+ /***/ (function(module, exports, __webpack_require__) {
13763
+
13764
+ "use strict";
13765
+
13766
+
13767
+ Object.defineProperty(exports, "__esModule", {
13768
+ value: true
13769
+ });
13770
+ var OVERFLOW = exports.OVERFLOW = {
13771
+ VISIBLE: 0,
13772
+ HIDDEN: 1,
13773
+ SCROLL: 2,
13774
+ AUTO: 3
13775
  };
13776
 
13777
+ var parseOverflow = exports.parseOverflow = function parseOverflow(overflow) {
13778
+ switch (overflow) {
13779
+ case 'hidden':
13780
+ return OVERFLOW.HIDDEN;
13781
+ case 'scroll':
13782
+ return OVERFLOW.SCROLL;
13783
+ case 'auto':
13784
+ return OVERFLOW.AUTO;
13785
+ case 'visible':
13786
+ default:
13787
+ return OVERFLOW.VISIBLE;
13788
  }
 
13789
  };
13790
 
13791
+ /***/ }),
13792
+ /* 41 */
13793
+ /***/ (function(module, exports, __webpack_require__) {
13794
 
13795
+ "use strict";
 
 
 
 
 
13796
 
 
 
13797
 
13798
+ Object.defineProperty(exports, "__esModule", {
13799
+ value: true
13800
  });
13801
+ exports.parseTextShadow = undefined;
13802
 
13803
+ var _Color = __webpack_require__(0);
 
 
 
13804
 
13805
+ var _Color2 = _interopRequireDefault(_Color);
13806
 
13807
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
13808
 
13809
+ var NUMBER = /^([+-]|\d|\.)$/i;
13810
 
13811
+ var parseTextShadow = exports.parseTextShadow = function parseTextShadow(textShadow) {
13812
+ if (textShadow === 'none' || typeof textShadow !== 'string') {
13813
+ return null;
13814
+ }
13815
 
13816
+ var currentValue = '';
13817
+ var isLength = false;
13818
+ var values = [];
13819
+ var shadows = [];
13820
+ var numParens = 0;
13821
+ var color = null;
 
 
 
 
 
 
 
 
13822
 
13823
+ var appendValue = function appendValue() {
13824
+ if (currentValue.length) {
13825
+ if (isLength) {
13826
+ values.push(parseFloat(currentValue));
13827
+ } else {
13828
+ color = new _Color2.default(currentValue);
13829
+ }
13830
+ }
13831
+ isLength = false;
13832
+ currentValue = '';
13833
+ };
13834
 
13835
+ var appendShadow = function appendShadow() {
13836
+ if (values.length && color !== null) {
13837
+ shadows.push({
13838
+ color: color,
13839
+ offsetX: values[0] || 0,
13840
+ offsetY: values[1] || 0,
13841
+ blur: values[2] || 0
13842
+ });
13843
+ }
13844
+ values.splice(0, values.length);
13845
+ color = null;
13846
+ };
13847
 
13848
+ for (var i = 0; i < textShadow.length; i++) {
13849
+ var c = textShadow[i];
13850
+ switch (c) {
13851
+ case '(':
13852
+ currentValue += c;
13853
+ numParens++;
13854
+ break;
13855
+ case ')':
13856
+ currentValue += c;
13857
+ numParens--;
13858
+ break;
13859
+ case ',':
13860
+ if (numParens === 0) {
13861
+ appendValue();
13862
+ appendShadow();
13863
+ } else {
13864
+ currentValue += c;
13865
+ }
13866
+ break;
13867
+ case ' ':
13868
+ if (numParens === 0) {
13869
+ appendValue();
13870
+ } else {
13871
+ currentValue += c;
13872
+ }
13873
+ break;
13874
+ default:
13875
+ if (currentValue.length === 0 && NUMBER.test(c)) {
13876
+ isLength = true;
13877
+ }
13878
+ currentValue += c;
13879
+ }
13880
+ }
13881
 
13882
+ appendValue();
13883
+ appendShadow();
 
13884
 
13885
+ if (shadows.length === 0) {
13886
+ return null;
13887
+ }
13888
 
13889
+ return shadows;
13890
+ };
13891
 
13892
+ /***/ }),
13893
+ /* 42 */
13894
+ /***/ (function(module, exports, __webpack_require__) {
13895
 
13896
+ "use strict";
 
 
 
 
 
13897
 
 
 
 
 
13898
 
13899
+ Object.defineProperty(exports, "__esModule", {
13900
+ value: true
13901
+ });
13902
+ exports.parseTransform = undefined;
 
13903
 
13904
+ var _Length = __webpack_require__(1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13905
 
13906
+ var _Length2 = _interopRequireDefault(_Length);
 
 
 
 
 
 
 
 
 
 
 
 
13907
 
13908
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
13909
 
13910
+ var toFloat = function toFloat(s) {
13911
+ return parseFloat(s.trim());
13912
+ };
 
 
 
 
 
 
 
 
13913
 
13914
+ var MATRIX = /(matrix|matrix3d)\((.+)\)/;
 
13915
 
13916
+ var parseTransform = exports.parseTransform = function parseTransform(style) {
13917
+ var transform = parseTransformMatrix(style.transform || style.webkitTransform || style.mozTransform ||
13918
+ // $FlowFixMe
13919
+ style.msTransform ||
13920
+ // $FlowFixMe
13921
+ style.oTransform);
13922
+ if (transform === null) {
13923
+ return null;
 
 
 
 
 
 
 
 
 
 
 
13924
  }
 
 
13925
 
13926
+ return {
13927
+ transform: transform,
13928
+ transformOrigin: parseTransformOrigin(style.transformOrigin || style.webkitTransformOrigin || style.mozTransformOrigin ||
13929
+ // $FlowFixMe
13930
+ style.msTransformOrigin ||
13931
+ // $FlowFixMe
13932
+ style.oTransformOrigin)
13933
+ };
13934
+ };
13935
 
13936
+ // $FlowFixMe
13937
+ var parseTransformOrigin = function parseTransformOrigin(origin) {
13938
+ if (typeof origin !== 'string') {
13939
+ var v = new _Length2.default('0');
13940
+ return [v, v];
13941
+ }
13942
+ var values = origin.split(' ').map(_Length2.default.create);
13943
+ return [values[0], values[1]];
13944
+ };
13945
 
13946
+ // $FlowFixMe
13947
+ var parseTransformMatrix = function parseTransformMatrix(transform) {
13948
+ if (transform === 'none' || typeof transform !== 'string') {
13949
+ return null;
13950
  }
13951
 
13952
+ var match = transform.match(MATRIX);
13953
+ if (match) {
13954
+ if (match[1] === 'matrix') {
13955
+ var matrix = match[2].split(',').map(toFloat);
13956
+ return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]];
13957
+ } else {
13958
+ var matrix3d = match[2].split(',').map(toFloat);
13959
+ return [matrix3d[0], matrix3d[1], matrix3d[4], matrix3d[5], matrix3d[12], matrix3d[13]];
13960
+ }
13961
+ }
13962
+ return null;
13963
+ };
13964
 
13965
+ /***/ }),
13966
+ /* 43 */
13967
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
13968
 
13969
+ "use strict";
 
 
 
 
 
13970
 
 
 
 
 
13971
 
13972
+ Object.defineProperty(exports, "__esModule", {
13973
+ value: true
13974
+ });
13975
+ var VISIBILITY = exports.VISIBILITY = {
13976
+ VISIBLE: 0,
13977
+ HIDDEN: 1,
13978
+ COLLAPSE: 2
13979
+ };
13980
 
13981
+ var parseVisibility = exports.parseVisibility = function parseVisibility(visibility) {
13982
+ switch (visibility) {
13983
+ case 'hidden':
13984
+ return VISIBILITY.HIDDEN;
13985
+ case 'collapse':
13986
+ return VISIBILITY.COLLAPSE;
13987
+ case 'visible':
13988
+ default:
13989
+ return VISIBILITY.VISIBLE;
13990
  }
13991
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13992
 
13993
+ /***/ }),
13994
+ /* 44 */
13995
+ /***/ (function(module, exports, __webpack_require__) {
 
 
13996
 
13997
+ "use strict";
13998
 
 
 
13999
 
14000
+ Object.defineProperty(exports, "__esModule", {
14001
+ value: true
14002
+ });
14003
+ var WORD_BREAK = exports.WORD_BREAK = {
14004
+ NORMAL: 'normal',
14005
+ BREAK_ALL: 'break-all',
14006
+ KEEP_ALL: 'keep-all'
14007
+ };
14008
 
14009
+ var parseWordBreak = exports.parseWordBreak = function parseWordBreak(wordBreak) {
14010
+ switch (wordBreak) {
14011
+ case 'break-all':
14012
+ return WORD_BREAK.BREAK_ALL;
14013
+ case 'keep-all':
14014
+ return WORD_BREAK.KEEP_ALL;
14015
+ case 'normal':
14016
+ default:
14017
+ return WORD_BREAK.NORMAL;
14018
  }
14019
+ };
14020
 
14021
+ /***/ }),
14022
+ /* 45 */
14023
+ /***/ (function(module, exports, __webpack_require__) {
14024
 
14025
+ "use strict";
 
 
14026
 
 
 
14027
 
14028
+ Object.defineProperty(exports, "__esModule", {
14029
+ value: true
14030
+ });
14031
+ var parseZIndex = exports.parseZIndex = function parseZIndex(zIndex) {
14032
+ var auto = zIndex === 'auto';
14033
+ return {
14034
+ auto: auto,
14035
+ order: auto ? 0 : parseInt(zIndex, 10)
14036
+ };
14037
+ };
14038
 
14039
+ /***/ }),
14040
+ /* 46 */
14041
+ /***/ (function(module, exports, __webpack_require__) {
 
14042
 
14043
+ "use strict";
 
14044
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14045
 
14046
+ Object.defineProperty(exports, "__esModule", {
14047
+ value: true
14048
+ });
 
 
 
 
 
 
14049
 
14050
+ var _Util = __webpack_require__(13);
 
 
 
 
 
 
 
 
 
14051
 
14052
+ Object.defineProperty(exports, 'toCodePoints', {
14053
+ enumerable: true,
14054
+ get: function get() {
14055
+ return _Util.toCodePoints;
14056
+ }
14057
+ });
14058
+ Object.defineProperty(exports, 'fromCodePoint', {
14059
+ enumerable: true,
14060
+ get: function get() {
14061
+ return _Util.fromCodePoint;
14062
+ }
14063
+ });
14064
 
14065
+ var _LineBreak = __webpack_require__(47);
 
 
 
 
 
 
 
 
 
 
 
14066
 
14067
+ Object.defineProperty(exports, 'LineBreaker', {
14068
+ enumerable: true,
14069
+ get: function get() {
14070
+ return _LineBreak.LineBreaker;
14071
+ }
14072
+ });
14073
 
14074
+ /***/ }),
14075
+ /* 47 */
14076
+ /***/ (function(module, exports, __webpack_require__) {
14077
 
14078
+ "use strict";
 
 
14079
 
 
 
 
 
 
 
 
 
 
 
 
14080
 
14081
+ Object.defineProperty(exports, "__esModule", {
14082
+ value: true
14083
+ });
14084
+ exports.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;
 
 
 
 
 
 
 
 
 
14085
 
14086
+ var _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; }; }();
 
 
14087
 
14088
+ var _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"); } }; }();
 
 
14089
 
14090
+ var _Trie = __webpack_require__(48);
 
14091
 
14092
+ var _linebreakTrie = __webpack_require__(49);
 
 
 
14093
 
14094
+ var _linebreakTrie2 = _interopRequireDefault(_linebreakTrie);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14095
 
14096
+ var _Util = __webpack_require__(13);
 
14097
 
14098
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
14099
 
14100
+ function _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); } }
 
14101
 
14102
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
14103
 
14104
+ var LETTER_NUMBER_MODIFIER = exports.LETTER_NUMBER_MODIFIER = 50;
 
 
14105
 
14106
+ // Non-tailorable Line Breaking Classes
14107
+ var BK = 1; // Cause a line break (after)
14108
+ var CR = 2; // Cause a line break (after), except between CR and LF
14109
+ var LF = 3; // Cause a line break (after)
14110
+ var CM = 4; // Prohibit a line break between the character and the preceding character
14111
+ var NL = 5; // Cause a line break (after)
14112
+ var SG = 6; // Do not occur in well-formed text
14113
+ var WJ = 7; // Prohibit line breaks before and after
14114
+ var ZW = 8; // Provide a break opportunity
14115
+ var GL = 9; // Prohibit line breaks before and after
14116
+ var SP = 10; // Enable indirect line breaks
14117
+ var ZWJ = 11; // Prohibit line breaks within joiner sequences
14118
+ // Break Opportunities
14119
+ var B2 = 12; // Provide a line break opportunity before and after the character
14120
+ var BA = 13; // Generally provide a line break opportunity after the character
14121
+ var BB = 14; // Generally provide a line break opportunity before the character
14122
+ var HY = 15; // Provide a line break opportunity after the character, except in numeric context
14123
+ var CB = 16; // Provide a line break opportunity contingent on additional information
14124
+ // Characters Prohibiting Certain Breaks
14125
+ var CL = 17; // Prohibit line breaks before
14126
+ var CP = 18; // Prohibit line breaks before
14127
+ var EX = 19; // Prohibit line breaks before
14128
+ var IN = 20; // Allow only indirect line breaks between pairs
14129
+ var NS = 21; // Allow only indirect line breaks before
14130
+ var OP = 22; // Prohibit line breaks after
14131
+ var QU = 23; // Act like they are both opening and closing
14132
+ // Numeric Context
14133
+ var IS = 24; // Prevent breaks after any and before numeric
14134
+ var NU = 25; // Form numeric expressions for line breaking purposes
14135
+ var PO = 26; // Do not break following a numeric expression
14136
+ var PR = 27; // Do not break in front of a numeric expression
14137
+ var SY = 28; // Prevent a break before; and allow a break after
14138
+ // Other Characters
14139
+ var AI = 29; // Act like AL when the resolvedEAW is N; otherwise; act as ID
14140
+ var AL = 30; // Are alphabetic characters or symbols that are used with alphabetic characters
14141
+ var CJ = 31; // Treat as NS or ID for strict or normal breaking.
14142
+ var EB = 32; // Do not break from following Emoji Modifier
14143
+ var EM = 33; // Do not break from preceding Emoji Base
14144
+ var H2 = 34; // Form Korean syllable blocks
14145
+ var H3 = 35; // Form Korean syllable blocks
14146
+ var HL = 36; // Do not break around a following hyphen; otherwise act as Alphabetic
14147
+ var ID = 37; // Break before or after; except in some numeric context
14148
+ var JL = 38; // Form Korean syllable blocks
14149
+ var JV = 39; // Form Korean syllable blocks
14150
+ var JT = 40; // Form Korean syllable blocks
14151
+ var RI = 41; // Keep pairs together. For pairs; break before and after other classes
14152
+ var SA = 42; // Provide a line break opportunity contingent on additional, language-specific context analysis
14153
+ var XX = 43; // Have as yet unknown line breaking behavior or unassigned code positions
14154
 
14155
+ var classes = exports.classes = {
14156
+ BK: BK,
14157
+ CR: CR,
14158
+ LF: LF,
14159
+ CM: CM,
14160
+ NL: NL,
14161
+ SG: SG,
14162
+ WJ: WJ,
14163
+ ZW: ZW,
14164
+ GL: GL,
14165
+ SP: SP,
14166
+ ZWJ: ZWJ,
14167
+ B2: B2,
14168
+ BA: BA,
14169
+ BB: BB,
14170
+ HY: HY,
14171
+ CB: CB,
14172
+ CL: CL,
14173
+ CP: CP,
14174
+ EX: EX,
14175
+ IN: IN,
14176
+ NS: NS,
14177
+ OP: OP,
14178
+ QU: QU,
14179
+ IS: IS,
14180
+ NU: NU,
14181
+ PO: PO,
14182
+ PR: PR,
14183
+ SY: SY,
14184
+ AI: AI,
14185
+ AL: AL,
14186
+ CJ: CJ,
14187
+ EB: EB,
14188
+ EM: EM,
14189
+ H2: H2,
14190
+ H3: H3,
14191
+ HL: HL,
14192
+ ID: ID,
14193
+ JL: JL,
14194
+ JV: JV,
14195
+ JT: JT,
14196
+ RI: RI,
14197
+ SA: SA,
14198
+ XX: XX
14199
+ };
14200
 
14201
+ var BREAK_MANDATORY = exports.BREAK_MANDATORY = '!';
14202
+ var BREAK_NOT_ALLOWED = exports.BREAK_NOT_ALLOWED = '×';
14203
+ var BREAK_ALLOWED = exports.BREAK_ALLOWED = '÷';
14204
+ var UnicodeTrie = exports.UnicodeTrie = (0, _Trie.createTrieFromBase64)(_linebreakTrie2.default);
 
14205
 
14206
+ var ALPHABETICS = [AL, HL];
14207
+ var HARD_LINE_BREAKS = [BK, CR, LF, NL];
14208
+ var SPACE = [SP, ZW];
14209
+ var PREFIX_POSTFIX = [PR, PO];
14210
+ var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE);
14211
+ var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];
14212
+ var HYPHEN = [HY, BA];
14213
 
14214
+ var codePointsToCharacterClasses = exports.codePointsToCharacterClasses = function codePointsToCharacterClasses(codePoints) {
14215
+ var lineBreak = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'strict';
 
 
14216
 
14217
+ var types = [];
14218
+ var indicies = [];
14219
+ var categories = [];
14220
+ codePoints.forEach(function (codePoint, index) {
14221
+ var classType = UnicodeTrie.get(codePoint);
14222
+ if (classType > LETTER_NUMBER_MODIFIER) {
14223
+ categories.push(true);
14224
+ classType -= LETTER_NUMBER_MODIFIER;
14225
+ } else {
14226
+ categories.push(false);
14227
+ }
14228
 
14229
+ if (['normal', 'auto', 'loose'].indexOf(lineBreak) !== -1) {
14230
+ // U+2010, – U+2013, 〜 U+301C, ゠ U+30A0
14231
+ if ([0x2010, 0x2013, 0x301c, 0x30a0].indexOf(codePoint) !== -1) {
14232
+ indicies.push(index);
14233
+ return types.push(CB);
14234
+ }
14235
+ }
14236
 
14237
+ if (classType === CM || classType === ZWJ) {
14238
+ // LB10 Treat any remaining combining mark or ZWJ as AL.
14239
+ if (index === 0) {
14240
+ indicies.push(index);
14241
+ return types.push(AL);
14242
+ }
14243
 
14244
+ // LB9 Do not break a combining character sequence; treat it as if it has the line breaking class of
14245
+ // the base character in all of the following rules. Treat ZWJ as if it were CM.
14246
+ var prev = types[index - 1];
14247
+ if (LINE_BREAKS.indexOf(prev) === -1) {
14248
+ indicies.push(indicies[index - 1]);
14249
+ return types.push(prev);
14250
+ }
14251
+ indicies.push(index);
14252
+ return types.push(AL);
14253
+ }
14254
 
14255
+ indicies.push(index);
14256
 
14257
+ if (classType === CJ) {
14258
+ return types.push(lineBreak === 'strict' ? NS : ID);
14259
+ }
14260
 
14261
+ if (classType === SA) {
14262
+ return types.push(AL);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14263
  }
 
 
 
 
 
14264
 
14265
+ if (classType === AI) {
14266
+ return types.push(AL);
 
 
 
14267
  }
 
14268
 
14269
+ // For supplementary characters, a useful default is to treat characters in the range 10000..1FFFD as AL
14270
+ // and characters in the ranges 20000..2FFFD and 30000..3FFFD as ID, until the implementation can be revised
14271
+ // to take into account the actual line breaking properties for these characters.
14272
+ if (classType === XX) {
14273
+ if (codePoint >= 0x20000 && codePoint <= 0x2fffd || codePoint >= 0x30000 && codePoint <= 0x3fffd) {
14274
+ return types.push(ID);
14275
+ } else {
14276
+ return types.push(AL);
14277
+ }
14278
  }
 
 
 
 
 
14279
 
14280
+ types.push(classType);
14281
+ });
 
 
 
14282
 
14283
+ return [indicies, types, categories];
14284
+ };
 
 
 
 
14285
 
14286
+ var isAdjacentWithSpaceIgnored = function isAdjacentWithSpaceIgnored(a, b, currentIndex, classTypes) {
14287
+ var current = classTypes[currentIndex];
14288
+ if (Array.isArray(a) ? a.indexOf(current) !== -1 : a === current) {
14289
+ var i = currentIndex;
14290
+ while (i <= classTypes.length) {
14291
+ i++;
14292
+ var next = classTypes[i];
14293
 
14294
+ if (next === b) {
14295
+ return true;
14296
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14297
 
14298
+ if (next !== SP) {
14299
+ break;
14300
+ }
14301
+ }
14302
+ }
 
14303
 
14304
+ if (current === SP) {
14305
+ var _i = currentIndex;
 
 
 
14306
 
14307
+ while (_i > 0) {
14308
+ _i--;
14309
+ var prev = classTypes[_i];
 
 
 
 
 
 
 
 
 
 
 
 
14310
 
14311
+ if (Array.isArray(a) ? a.indexOf(prev) !== -1 : a === prev) {
14312
+ var n = currentIndex;
14313
+ while (n <= classTypes.length) {
14314
+ n++;
14315
+ var _next = classTypes[n];
 
 
 
 
 
 
 
14316
 
14317
+ if (_next === b) {
14318
+ return true;
14319
+ }
14320
 
14321
+ if (_next !== SP) {
14322
+ break;
14323
+ }
14324
+ }
14325
+ }
 
 
 
14326
 
14327
+ if (prev !== SP) {
14328
+ break;
14329
+ }
14330
+ }
14331
+ }
14332
+ return false;
14333
+ };
 
 
 
 
 
 
 
 
14334
 
14335
+ var previousNonSpaceClassType = function previousNonSpaceClassType(currentIndex, classTypes) {
14336
+ var i = currentIndex;
14337
+ while (i >= 0) {
14338
+ var type = classTypes[i];
14339
+ if (type === SP) {
14340
+ i--;
14341
+ } else {
14342
+ return type;
14343
+ }
14344
+ }
14345
+ return 0;
14346
+ };
14347
 
14348
+ var _lineBreakAtIndex = function _lineBreakAtIndex(codePoints, classTypes, indicies, index, forbiddenBreaks) {
14349
+ if (indicies[index] === 0) {
14350
+ return BREAK_NOT_ALLOWED;
14351
+ }
14352
 
14353
+ var currentIndex = index - 1;
14354
+ if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {
14355
+ return BREAK_NOT_ALLOWED;
14356
+ }
14357
 
14358
+ var beforeIndex = currentIndex - 1;
14359
+ var afterIndex = currentIndex + 1;
14360
+ var current = classTypes[currentIndex];
14361
 
14362
+ // LB4 Always break after hard line breaks.
14363
+ // LB5 Treat CR followed by LF, as well as CR, LF, and NL as hard line breaks.
14364
+ var before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;
14365
+ var next = classTypes[afterIndex];
 
 
 
 
14366
 
14367
+ if (current === CR && next === LF) {
14368
+ return BREAK_NOT_ALLOWED;
14369
+ }
 
14370
 
14371
+ if (HARD_LINE_BREAKS.indexOf(current) !== -1) {
14372
+ return BREAK_MANDATORY;
14373
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14374
 
14375
+ // LB6 Do not break before hard line breaks.
14376
+ if (HARD_LINE_BREAKS.indexOf(next) !== -1) {
14377
+ return BREAK_NOT_ALLOWED;
14378
+ }
 
14379
 
14380
+ // LB7 Do not break before spaces or zero width space.
14381
+ if (SPACE.indexOf(next) !== -1) {
14382
+ return BREAK_NOT_ALLOWED;
14383
+ }
14384
 
14385
+ // LB8 Break before any character following a zero-width space, even if one or more spaces intervene.
14386
+ if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {
14387
+ return BREAK_ALLOWED;
14388
+ }
14389
 
14390
+ // LB8a Do not break between a zero width joiner and an ideograph, emoji base or emoji modifier.
14391
+ if (UnicodeTrie.get(codePoints[currentIndex]) === ZWJ && (next === ID || next === EB || next === EM)) {
14392
+ return BREAK_NOT_ALLOWED;
14393
+ }
14394
 
14395
+ // LB11 Do not break before or after Word joiner and related characters.
14396
+ if (current === WJ || next === WJ) {
14397
+ return BREAK_NOT_ALLOWED;
 
 
 
 
 
 
14398
  }
14399
 
14400
+ // LB12 Do not break after NBSP and related characters.
14401
+ if (current === GL) {
14402
+ return BREAK_NOT_ALLOWED;
14403
+ }
14404
 
14405
+ // LB12a Do not break before NBSP and related characters, except after spaces and hyphens.
14406
+ if ([SP, BA, HY].indexOf(current) === -1 && next === GL) {
14407
+ return BREAK_NOT_ALLOWED;
14408
+ }
14409
 
14410
+ // LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces.
14411
+ if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) {
14412
+ return BREAK_NOT_ALLOWED;
14413
+ }
14414
 
14415
+ // LB14 Do not break after ‘[’, even after spaces.
14416
+ if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {
14417
+ return BREAK_NOT_ALLOWED;
14418
+ }
14419
 
14420
+ // LB15 Do not break within ‘”[’, even with intervening spaces.
14421
+ if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {
14422
+ return BREAK_NOT_ALLOWED;
14423
+ }
 
 
14424
 
14425
+ // LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with intervening spaces.
14426
+ if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {
14427
+ return BREAK_NOT_ALLOWED;
14428
+ }
 
 
 
 
 
 
 
14429
 
14430
+ // LB17 Do not break within ‘——’, even with intervening spaces.
14431
+ if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {
14432
+ return BREAK_NOT_ALLOWED;
14433
+ }
14434
 
14435
+ // LB18 Break after spaces.
14436
+ if (current === SP) {
14437
+ return BREAK_ALLOWED;
14438
+ }
 
 
 
 
 
 
14439
 
14440
+ // LB19 Do not break before or after quotation marks, such as ‘ ” ’.
14441
+ if (current === QU || next === QU) {
14442
+ return BREAK_NOT_ALLOWED;
14443
+ }
14444
 
14445
+ // LB20 Break before and after unresolved CB.
14446
+ if (next === CB || current === CB) {
14447
+ return BREAK_ALLOWED;
14448
+ }
14449
 
14450
+ // LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small kana, and other non-starters, or after acute accents.
14451
+ if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) {
14452
+ return BREAK_NOT_ALLOWED;
14453
+ }
14454
 
14455
+ // LB21a Don't break after Hebrew + Hyphen.
14456
+ if (before === HL && HYPHEN.indexOf(current) !== -1) {
14457
+ return BREAK_NOT_ALLOWED;
14458
+ }
 
14459
 
14460
+ // LB21b Don’t break between Solidus and Hebrew letters.
14461
+ if (current === SY && next === HL) {
14462
+ return BREAK_NOT_ALLOWED;
14463
+ }
14464
 
14465
+ // LB22 Do not break between two ellipses, or between letters, numbers or exclamations and ellipsis.
14466
+ if (next === IN && ALPHABETICS.concat(IN, EX, NU, ID, EB, EM).indexOf(current) !== -1) {
14467
+ return BREAK_NOT_ALLOWED;
14468
+ }
 
 
14469
 
14470
+ // LB23 Do not break between digits and letters.
14471
+ if (ALPHABETICS.indexOf(next) !== -1 && current === NU || ALPHABETICS.indexOf(current) !== -1 && next === NU) {
14472
+ return BREAK_NOT_ALLOWED;
14473
+ }
 
 
 
 
 
 
 
 
14474
 
14475
+ // LB23a Do not break between numeric prefixes and ideographs, or between ideographs and numeric postfixes.
14476
+ if (current === PR && [ID, EB, EM].indexOf(next) !== -1 || [ID, EB, EM].indexOf(current) !== -1 && next === PO) {
14477
+ return BREAK_NOT_ALLOWED;
14478
+ }
 
 
14479
 
14480
+ // LB24 Do not break between numeric prefix/postfix and letters, or between letters and prefix/postfix.
14481
+ if (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1 || PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
14482
+ return BREAK_NOT_ALLOWED;
14483
+ }
14484
 
14485
+ // LB25 Do not break between the following pairs of classes relevant to numbers:
14486
+ if (
14487
+ // (PR | PO) × ( OP | HY )? NU
14488
+ [PR, PO].indexOf(current) !== -1 && (next === NU || [OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU) ||
14489
+ // ( OP | HY ) × NU
14490
+ [OP, HY].indexOf(current) !== -1 && next === NU ||
14491
+ // NU × (NU | SY | IS)
14492
+ current === NU && [NU, SY, IS].indexOf(next) !== -1) {
14493
+ return BREAK_NOT_ALLOWED;
14494
+ }
14495
 
14496
+ // NU (NU | SY | IS)* × (NU | SY | IS | CL | CP)
14497
+ if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) {
14498
+ var prevIndex = currentIndex;
14499
+ while (prevIndex >= 0) {
14500
+ var type = classTypes[prevIndex];
14501
+ if (type === NU) {
14502
+ return BREAK_NOT_ALLOWED;
14503
+ } else if ([SY, IS].indexOf(type) !== -1) {
14504
+ prevIndex--;
14505
+ } else {
14506
+ break;
14507
+ }
14508
+ }
14509
+ }
14510
 
14511
+ // NU (NU | SY | IS)* (CL | CP)? × (PO | PR))
14512
+ if ([PR, PO].indexOf(next) !== -1) {
14513
+ var _prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;
14514
+ while (_prevIndex >= 0) {
14515
+ var _type = classTypes[_prevIndex];
14516
+ if (_type === NU) {
14517
+ return BREAK_NOT_ALLOWED;
14518
+ } else if ([SY, IS].indexOf(_type) !== -1) {
14519
+ _prevIndex--;
14520
+ } else {
14521
+ break;
14522
+ }
14523
+ }
14524
+ }
14525
 
14526
+ // LB26 Do not break a Korean syllable.
14527
+ 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) {
14528
+ return BREAK_NOT_ALLOWED;
14529
+ }
14530
 
14531
+ // LB27 Treat a Korean Syllable Block the same as ID.
14532
+ if (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1 || KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR) {
14533
+ return BREAK_NOT_ALLOWED;
14534
+ }
14535
 
14536
+ // LB28 Do not break between alphabetics (“at”).
14537
+ if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
14538
+ return BREAK_NOT_ALLOWED;
14539
+ }
 
14540
 
14541
+ // LB29 Do not break between numeric punctuation and alphabetics (“e.g.”).
14542
+ if (current === IS && ALPHABETICS.indexOf(next) !== -1) {
14543
+ return BREAK_NOT_ALLOWED;
14544
+ }
 
 
 
 
 
 
 
 
 
 
 
 
14545
 
14546
+ // LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses.
14547
+ if (ALPHABETICS.concat(NU).indexOf(current) !== -1 && next === OP || ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP) {
14548
+ return BREAK_NOT_ALLOWED;
14549
+ }
 
 
 
 
 
 
 
14550
 
14551
+ // LB30a Break between two regional indicator symbols if and only if there are an even number of regional
14552
+ // indicators preceding the position of the break.
14553
+ if (current === RI && next === RI) {
14554
+ var i = indicies[currentIndex];
14555
+ var count = 1;
14556
+ while (i > 0) {
14557
+ i--;
14558
+ if (classTypes[i] === RI) {
14559
+ count++;
14560
+ } else {
14561
+ break;
14562
+ }
14563
  }
14564
+ if (count % 2 !== 0) {
14565
+ return BREAK_NOT_ALLOWED;
14566
+ }
14567
+ }
14568
 
14569
+ // LB30b Do not break between an emoji base and an emoji modifier.
14570
+ if (current === EB && next === EM) {
14571
+ return BREAK_NOT_ALLOWED;
14572
+ }
 
 
 
 
 
 
 
 
 
 
 
14573
 
14574
+ return BREAK_ALLOWED;
14575
+ };
14576
 
14577
+ var lineBreakAtIndex = exports.lineBreakAtIndex = function lineBreakAtIndex(codePoints, index) {
14578
+ // LB2 Never break at the start of text.
14579
+ if (index === 0) {
14580
+ return BREAK_NOT_ALLOWED;
14581
+ }
 
 
 
 
 
 
 
 
 
 
 
 
14582
 
14583
+ // LB3 Always break at the end of text.
14584
+ if (index >= codePoints.length) {
14585
+ return BREAK_MANDATORY;
14586
+ }
14587
 
14588
+ var _codePointsToCharacte = codePointsToCharacterClasses(codePoints),
14589
+ _codePointsToCharacte2 = _slicedToArray(_codePointsToCharacte, 2),
14590
+ indicies = _codePointsToCharacte2[0],
14591
+ classTypes = _codePointsToCharacte2[1];
 
 
 
 
 
 
 
 
 
 
 
14592
 
14593
+ return _lineBreakAtIndex(codePoints, classTypes, indicies, index);
14594
+ };
 
 
14595
 
14596
+ var cssFormattedClasses = function cssFormattedClasses(codePoints, options) {
14597
+ if (!options) {
14598
+ options = { lineBreak: 'normal', wordBreak: 'normal' };
14599
+ }
 
14600
 
14601
+ var _codePointsToCharacte3 = codePointsToCharacterClasses(codePoints, options.lineBreak),
14602
+ _codePointsToCharacte4 = _slicedToArray(_codePointsToCharacte3, 3),
14603
+ indicies = _codePointsToCharacte4[0],
14604
+ classTypes = _codePointsToCharacte4[1],
14605
+ isLetterNumber = _codePointsToCharacte4[2];
14606
 
14607
+ if (options.wordBreak === 'break-all' || options.wordBreak === 'break-word') {
14608
+ classTypes = classTypes.map(function (type) {
14609
+ return [NU, AL, SA].indexOf(type) !== -1 ? ID : type;
14610
+ });
14611
+ }
14612
 
14613
+ var forbiddenBreakpoints = options.wordBreak === 'keep-all' ? isLetterNumber.map(function (isLetterNumber, i) {
14614
+ return isLetterNumber && codePoints[i] >= 0x4e00 && codePoints[i] <= 0x9fff;
14615
+ }) : null;
 
14616
 
14617
+ return [indicies, classTypes, forbiddenBreakpoints];
14618
+ };
 
 
 
 
 
 
14619
 
14620
+ var inlineBreakOpportunities = exports.inlineBreakOpportunities = function inlineBreakOpportunities(str, options) {
14621
+ var codePoints = (0, _Util.toCodePoints)(str);
14622
+ var output = BREAK_NOT_ALLOWED;
 
14623
 
14624
+ var _cssFormattedClasses = cssFormattedClasses(codePoints, options),
14625
+ _cssFormattedClasses2 = _slicedToArray(_cssFormattedClasses, 3),
14626
+ indicies = _cssFormattedClasses2[0],
14627
+ classTypes = _cssFormattedClasses2[1],
14628
+ forbiddenBreakpoints = _cssFormattedClasses2[2];
14629
 
14630
+ codePoints.forEach(function (codePoint, i) {
14631
+ output += (0, _Util.fromCodePoint)(codePoint) + (i >= codePoints.length - 1 ? BREAK_MANDATORY : _lineBreakAtIndex(codePoints, classTypes, indicies, i + 1, forbiddenBreakpoints));
14632
+ });
 
 
14633
 
14634
+ return output;
14635
+ };
 
 
 
14636
 
14637
+ var Break = function () {
14638
+ function Break(codePoints, lineBreak, start, end) {
14639
+ _classCallCheck(this, Break);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14640
 
14641
+ this._codePoints = codePoints;
14642
+ this.required = lineBreak === BREAK_MANDATORY;
14643
+ this.start = start;
14644
+ this.end = end;
14645
+ }
14646
 
14647
+ _createClass(Break, [{
14648
+ key: 'slice',
14649
+ value: function slice() {
14650
+ return _Util.fromCodePoint.apply(undefined, _toConsumableArray(this._codePoints.slice(this.start, this.end)));
14651
+ }
14652
+ }]);
 
 
 
 
 
 
 
 
 
 
14653
 
14654
+ return Break;
14655
+ }();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14656
 
14657
+ var LineBreaker = exports.LineBreaker = function LineBreaker(str, options) {
14658
+ var codePoints = (0, _Util.toCodePoints)(str);
 
 
 
14659
 
14660
+ var _cssFormattedClasses3 = cssFormattedClasses(codePoints, options),
14661
+ _cssFormattedClasses4 = _slicedToArray(_cssFormattedClasses3, 3),
14662
+ indicies = _cssFormattedClasses4[0],
14663
+ classTypes = _cssFormattedClasses4[1],
14664
+ forbiddenBreakpoints = _cssFormattedClasses4[2];
 
 
14665
 
14666
+ var length = codePoints.length;
14667
+ var lastEnd = 0;
14668
+ var nextIndex = 0;
 
14669
 
14670
+ return {
14671
+ next: function next() {
14672
+ if (nextIndex >= length) {
14673
+ return { done: true };
14674
+ }
14675
+ var lineBreak = BREAK_NOT_ALLOWED;
14676
+ while (nextIndex < length && (lineBreak = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) === BREAK_NOT_ALLOWED) {}
14677
 
14678
+ if (lineBreak !== BREAK_NOT_ALLOWED || nextIndex === length) {
14679
+ var value = new Break(codePoints, lineBreak, lastEnd, nextIndex);
14680
+ lastEnd = nextIndex;
14681
+ return { value: value, done: false };
14682
+ }
 
 
 
 
 
 
 
 
 
14683
 
14684
+ return { done: true };
14685
+ }
14686
+ };
14687
+ };
 
 
14688
 
14689
+ /***/ }),
14690
+ /* 48 */
14691
+ /***/ (function(module, exports, __webpack_require__) {
14692
 
14693
+ "use strict";
 
 
 
 
14694
 
 
 
 
 
14695
 
14696
+ Object.defineProperty(exports, "__esModule", {
14697
+ value: true
14698
+ });
14699
+ exports.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;
 
14700
 
14701
+ var _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; }; }();
 
 
 
 
14702
 
14703
+ var _Util = __webpack_require__(13);
 
 
 
 
 
 
14704
 
14705
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
 
14706
 
14707
+ /** Shift size for getting the index-2 table offset. */
14708
+ var UTRIE2_SHIFT_2 = exports.UTRIE2_SHIFT_2 = 5;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14709
 
14710
+ /** Shift size for getting the index-1 table offset. */
14711
+ var UTRIE2_SHIFT_1 = exports.UTRIE2_SHIFT_1 = 6 + 5;
14712
 
14713
+ /**
14714
+ * Shift size for shifting left the index array values.
14715
+ * Increases possible data size with 16-bit index values at the cost
14716
+ * of compactability.
14717
+ * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.
14718
+ */
14719
+ var UTRIE2_INDEX_SHIFT = exports.UTRIE2_INDEX_SHIFT = 2;
 
 
 
 
14720
 
14721
+ /**
14722
+ * Difference between the two shift sizes,
14723
+ * for getting an index-1 offset from an index-2 offset. 6=11-5
14724
+ */
14725
+ var UTRIE2_SHIFT_1_2 = exports.UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;
14726
 
14727
+ /**
14728
+ * The part of the index-2 table for U+D800..U+DBFF stores values for
14729
+ * lead surrogate code _units_ not code _points_.
14730
+ * Values for lead surrogate code _points_ are indexed with this portion of the table.
14731
+ * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)
14732
+ */
14733
+ var UTRIE2_LSCP_INDEX_2_OFFSET = exports.UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2;
14734
 
14735
+ /** Number of entries in a data block. 32=0x20 */
14736
+ var UTRIE2_DATA_BLOCK_LENGTH = exports.UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;
14737
+ /** Mask for getting the lower bits for the in-data-block offset. */
14738
+ var UTRIE2_DATA_MASK = exports.UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;
 
 
 
14739
 
14740
+ var UTRIE2_LSCP_INDEX_2_LENGTH = exports.UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2;
14741
+ /** Count the lengths of both BMP pieces. 2080=0x820 */
14742
+ var UTRIE2_INDEX_2_BMP_LENGTH = exports.UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;
14743
+ /**
14744
+ * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.
14745
+ * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.
14746
+ */
14747
+ var UTRIE2_UTF8_2B_INDEX_2_OFFSET = exports.UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;
14748
+ var 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 */
14749
+ /**
14750
+ * The index-1 table, only used for supplementary code points, at offset 2112=0x840.
14751
+ * Variable length, for code points up to highStart, where the last single-value range starts.
14752
+ * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.
14753
+ * (For 0x100000 supplementary code points U+10000..U+10ffff.)
14754
+ *
14755
+ * The part of the index-2 table for supplementary code points starts
14756
+ * after this index-1 table.
14757
+ *
14758
+ * Both the index-1 table and the following part of the index-2 table
14759
+ * are omitted completely if there is only BMP data.
14760
+ */
14761
+ var UTRIE2_INDEX_1_OFFSET = exports.UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;
14762
 
14763
+ /**
14764
+ * Number of index-1 entries for the BMP. 32=0x20
14765
+ * This part of the index-1 table is omitted from the serialized form.
14766
+ */
14767
+ var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = exports.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1;
14768
 
14769
+ /** Number of entries in an index-2 block. 64=0x40 */
14770
+ var UTRIE2_INDEX_2_BLOCK_LENGTH = exports.UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;
14771
+ /** Mask for getting the lower bits for the in-index-2-block offset. */
14772
+ var UTRIE2_INDEX_2_MASK = exports.UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;
14773
 
14774
+ var createTrieFromBase64 = exports.createTrieFromBase64 = function createTrieFromBase64(base64) {
14775
+ var buffer = (0, _Util.decode)(base64);
14776
+ var view32 = Array.isArray(buffer) ? (0, _Util.polyUint32Array)(buffer) : new Uint32Array(buffer);
14777
+ var view16 = Array.isArray(buffer) ? (0, _Util.polyUint16Array)(buffer) : new Uint16Array(buffer);
14778
+ var headerLength = 24;
14779
 
14780
+ var index = view16.slice(headerLength / 2, view32[4] / 2);
14781
+ var data = view32[5] === 2 ? view16.slice((headerLength + view32[4]) / 2) : view32.slice(Math.ceil((headerLength + view32[4]) / 4));
14782
 
14783
+ return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);
14784
+ };
 
 
 
14785
 
14786
+ var Trie = exports.Trie = function () {
14787
+ function Trie(initialValue, errorValue, highStart, highValueIndex, index, data) {
14788
+ _classCallCheck(this, Trie);
14789
 
14790
+ this.initialValue = initialValue;
14791
+ this.errorValue = errorValue;
14792
+ this.highStart = highStart;
14793
+ this.highValueIndex = highValueIndex;
14794
+ this.index = index;
14795
+ this.data = data;
14796
+ }
14797
 
14798
+ /**
14799
+ * Get the value for a code point as stored in the Trie.
14800
+ *
14801
+ * @param codePoint the code point
14802
+ * @return the value
14803
+ */
 
14804
 
 
 
 
 
 
 
14805
 
14806
+ _createClass(Trie, [{
14807
+ key: 'get',
14808
+ value: function get(codePoint) {
14809
+ var ix = void 0;
14810
+ if (codePoint >= 0) {
14811
+ if (codePoint < 0x0d800 || codePoint > 0x0dbff && codePoint <= 0x0ffff) {
14812
+ // Ordinary BMP code point, excluding leading surrogates.
14813
+ // BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.
14814
+ // 16 bit data is stored in the index array itself.
14815
+ ix = this.index[codePoint >> UTRIE2_SHIFT_2];
14816
+ ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
14817
+ return this.data[ix];
14818
+ }
14819
 
14820
+ if (codePoint <= 0xffff) {
14821
+ // Lead Surrogate Code Point. A Separate index section is stored for
14822
+ // lead surrogate code units and code points.
14823
+ // The main index has the code unit data.
14824
+ // For this function, we need the code point data.
14825
+ // Note: this expression could be refactored for slightly improved efficiency, but
14826
+ // surrogate code points will be so rare in practice that it's not worth it.
14827
+ ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + (codePoint - 0xd800 >> UTRIE2_SHIFT_2)];
14828
+ ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
14829
+ return this.data[ix];
14830
+ }
14831
 
14832
+ if (codePoint < this.highStart) {
14833
+ // Supplemental code point, use two-level lookup.
14834
+ ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);
14835
+ ix = this.index[ix];
14836
+ ix += codePoint >> UTRIE2_SHIFT_2 & UTRIE2_INDEX_2_MASK;
14837
+ ix = this.index[ix];
14838
+ ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
14839
+