MailPoet Newsletters (New) - Version 3.11.0

Version Description

  • 2018-09-25 =
  • Added: notice for users who've migrated from MP2 to MP3;
  • Added: many new templates for newsletters, welcome emails, notifications, and Woo Commerce;
  • Added: improved sending method error handling;
  • Improved: onboarding user experience tweaks and improvements;
  • Fixed: JS warning in the emails section;
  • Fixed: minor translation issues;
  • Fixed: welcome emails removed from Premium page, as they're free now.
Download this release

Release Info

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

Code changes from version 3.10.1 to 3.11.0

assets/css/{admin.e82a71e2.css → admin.86751c85.css} RENAMED
@@ -3485,6 +3485,12 @@ textarea.parsley-error {
3485
  list-style-type: disc;
3486
  margin-left: 40px;
3487
  }
 
 
 
 
 
 
3488
  #logger {
3489
  width: 100%;
3490
  height: 300px;
@@ -4400,3 +4406,121 @@ tr.introjs-showElement > th {
4400
  border-bottom-left-radius: 0;
4401
  margin-left: -1px;
4402
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3485
  list-style-type: disc;
3486
  margin-left: 40px;
3487
  }
3488
+ .mailpoet-about-wrap .half-width-centered {
3489
+ display: block;
3490
+ max-width: 50%;
3491
+ margin-left: auto;
3492
+ margin-right: auto;
3493
+ }
3494
  #logger {
3495
  width: 100%;
3496
  height: 300px;
4406
  border-bottom-left-radius: 0;
4407
  margin-left: -1px;
4408
  }
4409
+ .mailpoet_in_app_announcement_pulsing_dot {
4410
+ display: inline-block;
4411
+ width: 10px;
4412
+ height: 10px;
4413
+ border-radius: 50%;
4414
+ background: #ff5301;
4415
+ cursor: pointer;
4416
+ -webkit-box-shadow: 0 0 0 rgba(255,83,1,0.4);
4417
+ box-shadow: 0 0 0 rgba(255,83,1,0.4);
4418
+ -webkit-animation: mailpoet_in_app_dot_pulse 2s infinite;
4419
+ -moz-animation: mailpoet_in_app_dot_pulse 2s infinite;
4420
+ -o-animation: mailpoet_in_app_dot_pulse 2s infinite;
4421
+ -ms-animation: mailpoet_in_app_dot_pulse 2s infinite;
4422
+ animation: mailpoet_in_app_dot_pulse 2s infinite;
4423
+ }
4424
+ @-webkit-keyframes mailpoet_in_app_dot_pulse {
4425
+ 0% {
4426
+ -webkit-box-shadow: 0 0 0 0 rgba(255,83,1,0.4);
4427
+ }
4428
+ 70% {
4429
+ -webkit-box-shadow: 0 0 0 10px rgba(255,83,1,0);
4430
+ }
4431
+ 100% {
4432
+ -webkit-box-shadow: 0 0 0 0 rgba(255,83,1,0);
4433
+ }
4434
+ }
4435
+ .mailpoet_in_app_announcement_free_welcome_emails {
4436
+ text-align: center;
4437
+ }
4438
+ .mailpoet_in_app_announcement_free_welcome_emails h2 {
4439
+ font-size: 28px;
4440
+ }
4441
+ .mailpoet_in_app_announcement_free_welcome_emails img {
4442
+ width: 640px;
4443
+ margin-top: -20px;
4444
+ }
4445
+ .mailpoet_in_app_announcement_free_welcome_emails_dot {
4446
+ position: relative;
4447
+ top: -3px;
4448
+ left: 8px;
4449
+ }
4450
+ .mailpoet_in_app_announcement_background_videos {
4451
+ text-align: center;
4452
+ }
4453
+ .mailpoet_in_app_announcement_background_videos h2 {
4454
+ font-size: 28px;
4455
+ }
4456
+ .mailpoet_in_app_announcement_background_videos video {
4457
+ margin-top: 20px;
4458
+ }
4459
+ @-moz-keyframes mailpoet_in_app_dot_pulse {
4460
+ 0% {
4461
+ -moz-box-shadow: 0 0 0 0 rgba(255,83,1,0.4);
4462
+ -webkit-box-shadow: 0 0 0 0 rgba(255,83,1,0.4);
4463
+ box-shadow: 0 0 0 0 rgba(255,83,1,0.4);
4464
+ }
4465
+ 70% {
4466
+ -moz-box-shadow: 0 0 0 10px rgba(255,83,1,0);
4467
+ -webkit-box-shadow: 0 0 0 10px rgba(255,83,1,0);
4468
+ box-shadow: 0 0 0 10px rgba(255,83,1,0);
4469
+ }
4470
+ 100% {
4471
+ -moz-box-shadow: 0 0 0 0 rgba(255,83,1,0);
4472
+ -webkit-box-shadow: 0 0 0 0 rgba(255,83,1,0);
4473
+ box-shadow: 0 0 0 0 rgba(255,83,1,0);
4474
+ }
4475
+ }
4476
+ @-webkit-keyframes mailpoet_in_app_dot_pulse {
4477
+ 0% {
4478
+ -moz-box-shadow: 0 0 0 0 rgba(255,83,1,0.4);
4479
+ -webkit-box-shadow: 0 0 0 0 rgba(255,83,1,0.4);
4480
+ box-shadow: 0 0 0 0 rgba(255,83,1,0.4);
4481
+ }
4482
+ 70% {
4483
+ -moz-box-shadow: 0 0 0 10px rgba(255,83,1,0);
4484
+ -webkit-box-shadow: 0 0 0 10px rgba(255,83,1,0);
4485
+ box-shadow: 0 0 0 10px rgba(255,83,1,0);
4486
+ }
4487
+ 100% {
4488
+ -moz-box-shadow: 0 0 0 0 rgba(255,83,1,0);
4489
+ -webkit-box-shadow: 0 0 0 0 rgba(255,83,1,0);
4490
+ box-shadow: 0 0 0 0 rgba(255,83,1,0);
4491
+ }
4492
+ }
4493
+ @-o-keyframes mailpoet_in_app_dot_pulse {
4494
+ 0% {
4495
+ -moz-box-shadow: 0 0 0 0 rgba(255,83,1,0.4);
4496
+ -webkit-box-shadow: 0 0 0 0 rgba(255,83,1,0.4);
4497
+ box-shadow: 0 0 0 0 rgba(255,83,1,0.4);
4498
+ }
4499
+ 70% {
4500
+ -moz-box-shadow: 0 0 0 10px rgba(255,83,1,0);
4501
+ -webkit-box-shadow: 0 0 0 10px rgba(255,83,1,0);
4502
+ box-shadow: 0 0 0 10px rgba(255,83,1,0);
4503
+ }
4504
+ 100% {
4505
+ -moz-box-shadow: 0 0 0 0 rgba(255,83,1,0);
4506
+ -webkit-box-shadow: 0 0 0 0 rgba(255,83,1,0);
4507
+ box-shadow: 0 0 0 0 rgba(255,83,1,0);
4508
+ }
4509
+ }
4510
+ @keyframes mailpoet_in_app_dot_pulse {
4511
+ 0% {
4512
+ -moz-box-shadow: 0 0 0 0 rgba(255,83,1,0.4);
4513
+ -webkit-box-shadow: 0 0 0 0 rgba(255,83,1,0.4);
4514
+ box-shadow: 0 0 0 0 rgba(255,83,1,0.4);
4515
+ }
4516
+ 70% {
4517
+ -moz-box-shadow: 0 0 0 10px rgba(255,83,1,0);
4518
+ -webkit-box-shadow: 0 0 0 10px rgba(255,83,1,0);
4519
+ box-shadow: 0 0 0 10px rgba(255,83,1,0);
4520
+ }
4521
+ 100% {
4522
+ -moz-box-shadow: 0 0 0 0 rgba(255,83,1,0);
4523
+ -webkit-box-shadow: 0 0 0 0 rgba(255,83,1,0);
4524
+ box-shadow: 0 0 0 0 rgba(255,83,1,0);
4525
+ }
4526
+ }
assets/css/manifest.json CHANGED
@@ -1,8 +1,8 @@
1
  {
2
  "admin-global.css": "admin-global.673373a1.css",
3
- "admin.css": "admin.e82a71e2.css",
4
  "importExport.css": "importExport.b3745466.css",
5
- "newsletter_editor.css": "newsletter_editor.196d744e.css",
6
  "public.css": "public.cae357df.css",
7
  "rtl.css": "rtl.58324dad.css"
8
  }
1
  {
2
  "admin-global.css": "admin-global.673373a1.css",
3
+ "admin.css": "admin.86751c85.css",
4
  "importExport.css": "importExport.b3745466.css",
5
+ "newsletter_editor.css": "newsletter_editor.4555a028.css",
6
  "public.css": "public.cae357df.css",
7
  "rtl.css": "rtl.58324dad.css"
8
  }
assets/css/{newsletter_editor.196d744e.css → newsletter_editor.4555a028.css} RENAMED
@@ -1274,6 +1274,7 @@ input.mailpoet_option_offset_left_small {
1274
  #mailpoet_editor {
1275
  width: 100%;
1276
  clear: both;
 
1277
  }
1278
  #mailpoet_editor_heading {
1279
  padding-left: 15px;
@@ -1369,6 +1370,11 @@ input.mailpoet_option_offset_left_small {
1369
  .mailpoet_breadcrumbs p {
1370
  margin: 0;
1371
  }
 
 
 
 
 
1372
  #mailpoet_editor_sidebar {
1373
  border-left: #ddd;
1374
  border-bottom: #ddd;
1274
  #mailpoet_editor {
1275
  width: 100%;
1276
  clear: both;
1277
+ position: relative;
1278
  }
1279
  #mailpoet_editor_heading {
1280
  padding-left: 15px;
1370
  .mailpoet_breadcrumbs p {
1371
  margin: 0;
1372
  }
1373
+ .mailpoet_editor_announcement {
1374
+ position: absolute;
1375
+ right: 20px;
1376
+ top: 90px;
1377
+ }
1378
  #mailpoet_editor_sidebar {
1379
  border-left: #ddd;
1380
  border-bottom: #ddd;
assets/img/in_app_announcements/hello-illustration-for-welcome-emails.png ADDED
Binary file
assets/img/in_app_announcements/index.php ADDED
File without changes
assets/img/newsletter_editor/background-image-demo.mp4 ADDED
Binary file
assets/js/{admin.0a9d9de7.js → admin.a37c2a73.js} RENAMED
@@ -1,36 +1,6 @@
1
  webpackJsonp([2],{
2
 
3
- /***/ 21:
4
- /***/ (function(module, exports) {
5
-
6
- if (typeof Object.create === 'function') {
7
- // implementation from standard node.js 'util' module
8
- module.exports = function inherits(ctor, superCtor) {
9
- ctor.super_ = superCtor
10
- ctor.prototype = Object.create(superCtor.prototype, {
11
- constructor: {
12
- value: ctor,
13
- enumerable: false,
14
- writable: true,
15
- configurable: true
16
- }
17
- });
18
- };
19
- } else {
20
- // old school shim for old browsers
21
- module.exports = function inherits(ctor, superCtor) {
22
- ctor.super_ = superCtor
23
- var TempCtor = function () {}
24
- TempCtor.prototype = superCtor.prototype
25
- ctor.prototype = new TempCtor()
26
- ctor.prototype.constructor = ctor
27
- }
28
- }
29
-
30
-
31
- /***/ }),
32
-
33
- /***/ 227:
34
  /***/ (function(module, exports, __webpack_require__) {
35
 
36
  "use strict";
@@ -40,11 +10,11 @@ var _react = __webpack_require__(2);
40
 
41
  var _react2 = _interopRequireDefault(_react);
42
 
43
- var _reactTooltip = __webpack_require__(231);
44
 
45
  var _reactTooltip2 = _interopRequireDefault(_reactTooltip);
46
 
47
- var _reactHtmlParser = __webpack_require__(409);
48
 
49
  var _reactHtmlParser2 = _interopRequireDefault(_reactHtmlParser);
50
 
@@ -115,6360 +85,3799 @@ module.exports = Tooltip;
115
 
116
  /***/ }),
117
 
118
- /***/ 257:
119
  /***/ (function(module, exports, __webpack_require__) {
120
 
121
- var Tokenizer = __webpack_require__(258);
122
 
123
- /*
124
- Options:
125
 
126
- xmlMode: Disables the special behavior for script/style tags (false by default)
127
- lowerCaseAttributeNames: call .toLowerCase for each attribute name (true if xmlMode is `false`)
128
- lowerCaseTags: call .toLowerCase for each tag name (true if xmlMode is `false`)
129
- */
130
 
131
- /*
132
- Callbacks:
133
-
134
- oncdataend,
135
- oncdatastart,
136
- onclosetag,
137
- oncomment,
138
- oncommentend,
139
- onerror,
140
- onopentag,
141
- onprocessinginstruction,
142
- onreset,
143
- ontext
144
- */
145
 
146
- var formTags = {
147
- input: true,
148
- option: true,
149
- optgroup: true,
150
- select: true,
151
- button: true,
152
- datalist: true,
153
- textarea: true
154
- };
155
-
156
- var openImpliesClose = {
157
- tr : { tr:true, th:true, td:true },
158
- th : { th:true },
159
- td : { thead:true, th:true, td:true },
160
- body : { head:true, link:true, script:true },
161
- li : { li:true },
162
- p : { p:true },
163
- h1 : { p:true },
164
- h2 : { p:true },
165
- h3 : { p:true },
166
- h4 : { p:true },
167
- h5 : { p:true },
168
- h6 : { p:true },
169
- select : formTags,
170
- input : formTags,
171
- output : formTags,
172
- button : formTags,
173
- datalist: formTags,
174
- textarea: formTags,
175
- option : { option:true },
176
- optgroup: { optgroup:true }
177
- };
178
-
179
- var voidElements = {
180
- __proto__: null,
181
- area: true,
182
- base: true,
183
- basefont: true,
184
- br: true,
185
- col: true,
186
- command: true,
187
- embed: true,
188
- frame: true,
189
- hr: true,
190
- img: true,
191
- input: true,
192
- isindex: true,
193
- keygen: true,
194
- link: true,
195
- meta: true,
196
- param: true,
197
- source: true,
198
- track: true,
199
- wbr: true,
200
-
201
- //common self closing svg elements
202
- path: true,
203
- circle: true,
204
- ellipse: true,
205
- line: true,
206
- rect: true,
207
- use: true,
208
- stop: true,
209
- polyline: true,
210
- polygon: true
211
- };
212
-
213
- var re_nameEnd = /\s|\//;
214
-
215
- function Parser(cbs, options){
216
- this._options = options || {};
217
- this._cbs = cbs || {};
218
-
219
- this._tagname = "";
220
- this._attribname = "";
221
- this._attribvalue = "";
222
- this._attribs = null;
223
- this._stack = [];
224
-
225
- this.startIndex = 0;
226
- this.endIndex = null;
227
-
228
- this._lowerCaseTagNames = "lowerCaseTags" in this._options ?
229
- !!this._options.lowerCaseTags :
230
- !this._options.xmlMode;
231
- this._lowerCaseAttributeNames = "lowerCaseAttributeNames" in this._options ?
232
- !!this._options.lowerCaseAttributeNames :
233
- !this._options.xmlMode;
234
-
235
- if(this._options.Tokenizer) {
236
- Tokenizer = this._options.Tokenizer;
237
- }
238
- this._tokenizer = new Tokenizer(this._options, this);
239
-
240
- if(this._cbs.onparserinit) this._cbs.onparserinit(this);
241
- }
242
 
243
- __webpack_require__(21)(Parser, __webpack_require__(54).EventEmitter);
244
 
245
- Parser.prototype._updatePosition = function(initialOffset){
246
- if(this.endIndex === null){
247
- if(this._tokenizer._sectionStart <= initialOffset){
248
- this.startIndex = 0;
249
- } else {
250
- this.startIndex = this._tokenizer._sectionStart - initialOffset;
251
- }
252
- }
253
- else this.startIndex = this.endIndex + 1;
254
- this.endIndex = this._tokenizer.getAbsoluteIndex();
255
  };
256
 
257
- //Tokenizer event handlers
258
- Parser.prototype.ontext = function(data){
259
- this._updatePosition(1);
260
- this.endIndex--;
261
-
262
- if(this._cbs.ontext) this._cbs.ontext(data);
 
 
 
 
263
  };
264
 
265
- Parser.prototype.onopentagname = function(name){
266
- if(this._lowerCaseTagNames){
267
- name = name.toLowerCase();
268
- }
269
-
270
- this._tagname = name;
 
271
 
272
- if(!this._options.xmlMode && name in openImpliesClose) {
273
- for(
274
- var el;
275
- (el = this._stack[this._stack.length - 1]) in openImpliesClose[name];
276
- this.onclosetag(el)
277
- );
278
- }
279
 
280
- if(this._options.xmlMode || !(name in voidElements)){
281
- this._stack.push(name);
282
- }
283
 
284
- if(this._cbs.onopentagname) this._cbs.onopentagname(name);
285
- if(this._cbs.onopentag) this._attribs = {};
286
- };
287
 
288
- Parser.prototype.onopentagend = function(){
289
- this._updatePosition(1);
290
 
291
- if(this._attribs){
292
- if(this._cbs.onopentag) this._cbs.onopentag(this._tagname, this._attribs);
293
- this._attribs = null;
294
- }
295
 
296
- if(!this._options.xmlMode && this._cbs.onclosetag && this._tagname in voidElements){
297
- this._cbs.onclosetag(this._tagname);
298
- }
299
 
300
- this._tagname = "";
301
- };
302
 
303
- Parser.prototype.onclosetag = function(name){
304
- this._updatePosition(1);
305
 
306
- if(this._lowerCaseTagNames){
307
- name = name.toLowerCase();
308
- }
309
 
310
- if(this._stack.length && (!(name in voidElements) || this._options.xmlMode)){
311
- var pos = this._stack.lastIndexOf(name);
312
- if(pos !== -1){
313
- if(this._cbs.onclosetag){
314
- pos = this._stack.length - pos;
315
- while(pos--) this._cbs.onclosetag(this._stack.pop());
316
- }
317
- else this._stack.length = pos;
318
- } else if(name === "p" && !this._options.xmlMode){
319
- this.onopentagname(name);
320
- this._closeCurrentTag();
321
- }
322
- } else if(!this._options.xmlMode && (name === "br" || name === "p")){
323
- this.onopentagname(name);
324
- this._closeCurrentTag();
325
- }
326
- };
327
 
328
- Parser.prototype.onselfclosingtag = function(){
329
- if(this._options.xmlMode || this._options.recognizeSelfClosing){
330
- this._closeCurrentTag();
331
- } else {
332
- this.onopentagend();
333
- }
334
- };
335
 
336
- Parser.prototype._closeCurrentTag = function(){
337
- var name = this._tagname;
338
 
339
- this.onopentagend();
340
 
341
- //self-closing tags will be on the top of the stack
342
- //(cheaper check than in onclosetag)
343
- if(this._stack[this._stack.length - 1] === name){
344
- if(this._cbs.onclosetag){
345
- this._cbs.onclosetag(name);
346
- }
347
- this._stack.pop();
348
- }
349
- };
350
 
351
- Parser.prototype.onattribname = function(name){
352
- if(this._lowerCaseAttributeNames){
353
- name = name.toLowerCase();
354
- }
355
- this._attribname = name;
356
- };
357
 
358
- Parser.prototype.onattribdata = function(value){
359
- this._attribvalue += value;
360
- };
 
361
 
362
- Parser.prototype.onattribend = function(){
363
- if(this._cbs.onattribute) this._cbs.onattribute(this._attribname, this._attribvalue);
364
- if(
365
- this._attribs &&
366
- !Object.prototype.hasOwnProperty.call(this._attribs, this._attribname)
367
- ){
368
- this._attribs[this._attribname] = this._attribvalue;
369
- }
370
- this._attribname = "";
371
- this._attribvalue = "";
372
- };
373
 
374
- Parser.prototype._getInstructionName = function(value){
375
- var idx = value.search(re_nameEnd),
376
- name = idx < 0 ? value : value.substr(0, idx);
377
 
378
- if(this._lowerCaseTagNames){
379
- name = name.toLowerCase();
380
- }
381
 
382
- return name;
383
- };
384
 
385
- Parser.prototype.ondeclaration = function(value){
386
- if(this._cbs.onprocessinginstruction){
387
- var name = this._getInstructionName(value);
388
- this._cbs.onprocessinginstruction("!" + name, "!" + value);
389
- }
390
- };
391
 
392
- Parser.prototype.onprocessinginstruction = function(value){
393
- if(this._cbs.onprocessinginstruction){
394
- var name = this._getInstructionName(value);
395
- this._cbs.onprocessinginstruction("?" + name, "?" + value);
396
- }
397
- };
398
 
399
- Parser.prototype.oncomment = function(value){
400
- this._updatePosition(4);
401
 
402
- if(this._cbs.oncomment) this._cbs.oncomment(value);
403
- if(this._cbs.oncommentend) this._cbs.oncommentend();
404
- };
405
 
406
- Parser.prototype.oncdata = function(value){
407
- this._updatePosition(1);
 
408
 
409
- if(this._options.xmlMode || this._options.recognizeCDATA){
410
- if(this._cbs.oncdatastart) this._cbs.oncdatastart();
411
- if(this._cbs.ontext) this._cbs.ontext(value);
412
- if(this._cbs.oncdataend) this._cbs.oncdataend();
413
- } else {
414
- this.oncomment("[CDATA[" + value + "]]");
415
- }
416
- };
417
 
418
- Parser.prototype.onerror = function(err){
419
- if(this._cbs.onerror) this._cbs.onerror(err);
420
- };
421
 
422
- Parser.prototype.onend = function(){
423
- if(this._cbs.onclosetag){
424
- for(
425
- var i = this._stack.length;
426
- i > 0;
427
- this._cbs.onclosetag(this._stack[--i])
428
- );
429
- }
430
- if(this._cbs.onend) this._cbs.onend();
431
- };
432
 
 
433
 
434
- //Resets the parser to a blank state, ready to parse a new HTML document
435
- Parser.prototype.reset = function(){
436
- if(this._cbs.onreset) this._cbs.onreset();
437
- this._tokenizer.reset();
438
 
439
- this._tagname = "";
440
- this._attribname = "";
441
- this._attribs = null;
442
- this._stack = [];
443
 
444
- if(this._cbs.onparserinit) this._cbs.onparserinit(this);
445
- };
446
 
447
- //Parses a complete HTML document and pushes it to the handler
448
- Parser.prototype.parseComplete = function(data){
449
- this.reset();
450
- this.end(data);
451
- };
452
 
453
- Parser.prototype.write = function(chunk){
454
- this._tokenizer.write(chunk);
455
- };
 
456
 
457
- Parser.prototype.end = function(chunk){
458
- this._tokenizer.end(chunk);
459
- };
460
 
461
- Parser.prototype.pause = function(){
462
- this._tokenizer.pause();
463
- };
464
 
465
- Parser.prototype.resume = function(){
466
- this._tokenizer.resume();
467
- };
468
 
469
- //alias for backwards compat
470
- Parser.prototype.parseChunk = Parser.prototype.write;
471
- Parser.prototype.done = Parser.prototype.end;
472
 
473
- module.exports = Parser;
474
 
 
 
 
 
 
 
 
 
 
 
475
 
476
  /***/ }),
477
 
478
- /***/ 258:
479
  /***/ (function(module, exports, __webpack_require__) {
480
 
481
- module.exports = Tokenizer;
482
-
483
- var decodeCodePoint = __webpack_require__(259),
484
- entityMap = __webpack_require__(87),
485
- legacyMap = __webpack_require__(260),
486
- xmlMap = __webpack_require__(88),
487
-
488
- i = 0,
489
-
490
- TEXT = i++,
491
- BEFORE_TAG_NAME = i++, //after <
492
- IN_TAG_NAME = i++,
493
- IN_SELF_CLOSING_TAG = i++,
494
- BEFORE_CLOSING_TAG_NAME = i++,
495
- IN_CLOSING_TAG_NAME = i++,
496
- AFTER_CLOSING_TAG_NAME = i++,
497
-
498
- //attributes
499
- BEFORE_ATTRIBUTE_NAME = i++,
500
- IN_ATTRIBUTE_NAME = i++,
501
- AFTER_ATTRIBUTE_NAME = i++,
502
- BEFORE_ATTRIBUTE_VALUE = i++,
503
- IN_ATTRIBUTE_VALUE_DQ = i++, // "
504
- IN_ATTRIBUTE_VALUE_SQ = i++, // '
505
- IN_ATTRIBUTE_VALUE_NQ = i++,
506
-
507
- //declarations
508
- BEFORE_DECLARATION = i++, // !
509
- IN_DECLARATION = i++,
510
-
511
- //processing instructions
512
- IN_PROCESSING_INSTRUCTION = i++, // ?
513
-
514
- //comments
515
- BEFORE_COMMENT = i++,
516
- IN_COMMENT = i++,
517
- AFTER_COMMENT_1 = i++,
518
- AFTER_COMMENT_2 = i++,
519
-
520
- //cdata
521
- BEFORE_CDATA_1 = i++, // [
522
- BEFORE_CDATA_2 = i++, // C
523
- BEFORE_CDATA_3 = i++, // D
524
- BEFORE_CDATA_4 = i++, // A
525
- BEFORE_CDATA_5 = i++, // T
526
- BEFORE_CDATA_6 = i++, // A
527
- IN_CDATA = i++, // [
528
- AFTER_CDATA_1 = i++, // ]
529
- AFTER_CDATA_2 = i++, // ]
530
-
531
- //special tags
532
- BEFORE_SPECIAL = i++, //S
533
- BEFORE_SPECIAL_END = i++, //S
534
-
535
- BEFORE_SCRIPT_1 = i++, //C
536
- BEFORE_SCRIPT_2 = i++, //R
537
- BEFORE_SCRIPT_3 = i++, //I
538
- BEFORE_SCRIPT_4 = i++, //P
539
- BEFORE_SCRIPT_5 = i++, //T
540
- AFTER_SCRIPT_1 = i++, //C
541
- AFTER_SCRIPT_2 = i++, //R
542
- AFTER_SCRIPT_3 = i++, //I
543
- AFTER_SCRIPT_4 = i++, //P
544
- AFTER_SCRIPT_5 = i++, //T
545
-
546
- BEFORE_STYLE_1 = i++, //T
547
- BEFORE_STYLE_2 = i++, //Y
548
- BEFORE_STYLE_3 = i++, //L
549
- BEFORE_STYLE_4 = i++, //E
550
- AFTER_STYLE_1 = i++, //T
551
- AFTER_STYLE_2 = i++, //Y
552
- AFTER_STYLE_3 = i++, //L
553
- AFTER_STYLE_4 = i++, //E
554
-
555
- BEFORE_ENTITY = i++, //&
556
- BEFORE_NUMERIC_ENTITY = i++, //#
557
- IN_NAMED_ENTITY = i++,
558
- IN_NUMERIC_ENTITY = i++,
559
- IN_HEX_ENTITY = i++, //X
560
-
561
- j = 0,
562
-
563
- SPECIAL_NONE = j++,
564
- SPECIAL_SCRIPT = j++,
565
- SPECIAL_STYLE = j++;
566
-
567
- function whitespace(c){
568
- return c === " " || c === "\n" || c === "\t" || c === "\f" || c === "\r";
569
- }
570
 
571
- function characterState(char, SUCCESS){
572
- return function(c){
573
- if(c === char) this._state = SUCCESS;
574
- };
575
- }
576
 
577
- function ifElseState(upper, SUCCESS, FAILURE){
578
- var lower = upper.toLowerCase();
579
-
580
- if(upper === lower){
581
- return function(c){
582
- if(c === lower){
583
- this._state = SUCCESS;
584
- } else {
585
- this._state = FAILURE;
586
- this._index--;
587
- }
588
- };
589
- } else {
590
- return function(c){
591
- if(c === lower || c === upper){
592
- this._state = SUCCESS;
593
- } else {
594
- this._state = FAILURE;
595
- this._index--;
596
- }
597
- };
598
- }
599
- }
600
 
601
- function consumeSpecialNameChar(upper, NEXT_STATE){
602
- var lower = upper.toLowerCase();
603
-
604
- return function(c){
605
- if(c === lower || c === upper){
606
- this._state = NEXT_STATE;
607
- } else {
608
- this._state = IN_TAG_NAME;
609
- this._index--; //consume the token again
610
- }
611
- };
612
- }
613
 
614
- function Tokenizer(options, cbs){
615
- this._state = TEXT;
616
- this._buffer = "";
617
- this._sectionStart = 0;
618
- this._index = 0;
619
- this._bufferOffset = 0; //chars removed from _buffer
620
- this._baseState = TEXT;
621
- this._special = SPECIAL_NONE;
622
- this._cbs = cbs;
623
- this._running = true;
624
- this._ended = false;
625
- this._xmlMode = !!(options && options.xmlMode);
626
- this._decodeEntities = !!(options && options.decodeEntities);
627
- }
628
 
629
- Tokenizer.prototype._stateText = function(c){
630
- if(c === "<"){
631
- if(this._index > this._sectionStart){
632
- this._cbs.ontext(this._getSection());
633
- }
634
- this._state = BEFORE_TAG_NAME;
635
- this._sectionStart = this._index;
636
- } else if(this._decodeEntities && this._special === SPECIAL_NONE && c === "&"){
637
- if(this._index > this._sectionStart){
638
- this._cbs.ontext(this._getSection());
639
- }
640
- this._baseState = TEXT;
641
- this._state = BEFORE_ENTITY;
642
- this._sectionStart = this._index;
643
- }
644
- };
645
-
646
- Tokenizer.prototype._stateBeforeTagName = function(c){
647
- if(c === "/"){
648
- this._state = BEFORE_CLOSING_TAG_NAME;
649
- } else if(c === "<"){
650
- this._cbs.ontext(this._getSection());
651
- this._sectionStart = this._index;
652
- } else if(c === ">" || this._special !== SPECIAL_NONE || whitespace(c)) {
653
- this._state = TEXT;
654
- } else if(c === "!"){
655
- this._state = BEFORE_DECLARATION;
656
- this._sectionStart = this._index + 1;
657
- } else if(c === "?"){
658
- this._state = IN_PROCESSING_INSTRUCTION;
659
- this._sectionStart = this._index + 1;
660
- } else {
661
- this._state = (!this._xmlMode && (c === "s" || c === "S")) ?
662
- BEFORE_SPECIAL : IN_TAG_NAME;
663
- this._sectionStart = this._index;
664
- }
665
- };
666
-
667
- Tokenizer.prototype._stateInTagName = function(c){
668
- if(c === "/" || c === ">" || whitespace(c)){
669
- this._emitToken("onopentagname");
670
- this._state = BEFORE_ATTRIBUTE_NAME;
671
- this._index--;
672
- }
673
- };
674
-
675
- Tokenizer.prototype._stateBeforeCloseingTagName = function(c){
676
- if(whitespace(c));
677
- else if(c === ">"){
678
- this._state = TEXT;
679
- } else if(this._special !== SPECIAL_NONE){
680
- if(c === "s" || c === "S"){
681
- this._state = BEFORE_SPECIAL_END;
682
- } else {
683
- this._state = TEXT;
684
- this._index--;
685
- }
686
- } else {
687
- this._state = IN_CLOSING_TAG_NAME;
688
- this._sectionStart = this._index;
689
- }
690
- };
691
-
692
- Tokenizer.prototype._stateInCloseingTagName = function(c){
693
- if(c === ">" || whitespace(c)){
694
- this._emitToken("onclosetag");
695
- this._state = AFTER_CLOSING_TAG_NAME;
696
- this._index--;
697
- }
698
- };
699
-
700
- Tokenizer.prototype._stateAfterCloseingTagName = function(c){
701
- //skip everything until ">"
702
- if(c === ">"){
703
- this._state = TEXT;
704
- this._sectionStart = this._index + 1;
705
- }
706
- };
707
-
708
- Tokenizer.prototype._stateBeforeAttributeName = function(c){
709
- if(c === ">"){
710
- this._cbs.onopentagend();
711
- this._state = TEXT;
712
- this._sectionStart = this._index + 1;
713
- } else if(c === "/"){
714
- this._state = IN_SELF_CLOSING_TAG;
715
- } else if(!whitespace(c)){
716
- this._state = IN_ATTRIBUTE_NAME;
717
- this._sectionStart = this._index;
718
- }
719
- };
720
-
721
- Tokenizer.prototype._stateInSelfClosingTag = function(c){
722
- if(c === ">"){
723
- this._cbs.onselfclosingtag();
724
- this._state = TEXT;
725
- this._sectionStart = this._index + 1;
726
- } else if(!whitespace(c)){
727
- this._state = BEFORE_ATTRIBUTE_NAME;
728
- this._index--;
729
- }
730
- };
731
-
732
- Tokenizer.prototype._stateInAttributeName = function(c){
733
- if(c === "=" || c === "/" || c === ">" || whitespace(c)){
734
- this._cbs.onattribname(this._getSection());
735
- this._sectionStart = -1;
736
- this._state = AFTER_ATTRIBUTE_NAME;
737
- this._index--;
738
- }
739
- };
740
-
741
- Tokenizer.prototype._stateAfterAttributeName = function(c){
742
- if(c === "="){
743
- this._state = BEFORE_ATTRIBUTE_VALUE;
744
- } else if(c === "/" || c === ">"){
745
- this._cbs.onattribend();
746
- this._state = BEFORE_ATTRIBUTE_NAME;
747
- this._index--;
748
- } else if(!whitespace(c)){
749
- this._cbs.onattribend();
750
- this._state = IN_ATTRIBUTE_NAME;
751
- this._sectionStart = this._index;
752
- }
753
- };
754
-
755
- Tokenizer.prototype._stateBeforeAttributeValue = function(c){
756
- if(c === "\""){
757
- this._state = IN_ATTRIBUTE_VALUE_DQ;
758
- this._sectionStart = this._index + 1;
759
- } else if(c === "'"){
760
- this._state = IN_ATTRIBUTE_VALUE_SQ;
761
- this._sectionStart = this._index + 1;
762
- } else if(!whitespace(c)){
763
- this._state = IN_ATTRIBUTE_VALUE_NQ;
764
- this._sectionStart = this._index;
765
- this._index--; //reconsume token
766
- }
767
- };
768
-
769
- Tokenizer.prototype._stateInAttributeValueDoubleQuotes = function(c){
770
- if(c === "\""){
771
- this._emitToken("onattribdata");
772
- this._cbs.onattribend();
773
- this._state = BEFORE_ATTRIBUTE_NAME;
774
- } else if(this._decodeEntities && c === "&"){
775
- this._emitToken("onattribdata");
776
- this._baseState = this._state;
777
- this._state = BEFORE_ENTITY;
778
- this._sectionStart = this._index;
779
- }
780
- };
781
-
782
- Tokenizer.prototype._stateInAttributeValueSingleQuotes = function(c){
783
- if(c === "'"){
784
- this._emitToken("onattribdata");
785
- this._cbs.onattribend();
786
- this._state = BEFORE_ATTRIBUTE_NAME;
787
- } else if(this._decodeEntities && c === "&"){
788
- this._emitToken("onattribdata");
789
- this._baseState = this._state;
790
- this._state = BEFORE_ENTITY;
791
- this._sectionStart = this._index;
792
- }
793
- };
794
-
795
- Tokenizer.prototype._stateInAttributeValueNoQuotes = function(c){
796
- if(whitespace(c) || c === ">"){
797
- this._emitToken("onattribdata");
798
- this._cbs.onattribend();
799
- this._state = BEFORE_ATTRIBUTE_NAME;
800
- this._index--;
801
- } else if(this._decodeEntities && c === "&"){
802
- this._emitToken("onattribdata");
803
- this._baseState = this._state;
804
- this._state = BEFORE_ENTITY;
805
- this._sectionStart = this._index;
806
- }
807
- };
808
-
809
- Tokenizer.prototype._stateBeforeDeclaration = function(c){
810
- this._state = c === "[" ? BEFORE_CDATA_1 :
811
- c === "-" ? BEFORE_COMMENT :
812
- IN_DECLARATION;
813
- };
814
-
815
- Tokenizer.prototype._stateInDeclaration = function(c){
816
- if(c === ">"){
817
- this._cbs.ondeclaration(this._getSection());
818
- this._state = TEXT;
819
- this._sectionStart = this._index + 1;
820
- }
821
- };
822
-
823
- Tokenizer.prototype._stateInProcessingInstruction = function(c){
824
- if(c === ">"){
825
- this._cbs.onprocessinginstruction(this._getSection());
826
- this._state = TEXT;
827
- this._sectionStart = this._index + 1;
828
- }
829
- };
830
-
831
- Tokenizer.prototype._stateBeforeComment = function(c){
832
- if(c === "-"){
833
- this._state = IN_COMMENT;
834
- this._sectionStart = this._index + 1;
835
- } else {
836
- this._state = IN_DECLARATION;
837
- }
838
- };
839
-
840
- Tokenizer.prototype._stateInComment = function(c){
841
- if(c === "-") this._state = AFTER_COMMENT_1;
842
- };
843
-
844
- Tokenizer.prototype._stateAfterComment1 = function(c){
845
- if(c === "-"){
846
- this._state = AFTER_COMMENT_2;
847
- } else {
848
- this._state = IN_COMMENT;
849
- }
850
- };
851
-
852
- Tokenizer.prototype._stateAfterComment2 = function(c){
853
- if(c === ">"){
854
- //remove 2 trailing chars
855
- this._cbs.oncomment(this._buffer.substring(this._sectionStart, this._index - 2));
856
- this._state = TEXT;
857
- this._sectionStart = this._index + 1;
858
- } else if(c !== "-"){
859
- this._state = IN_COMMENT;
860
- }
861
- // else: stay in AFTER_COMMENT_2 (`--->`)
862
- };
863
-
864
- Tokenizer.prototype._stateBeforeCdata1 = ifElseState("C", BEFORE_CDATA_2, IN_DECLARATION);
865
- Tokenizer.prototype._stateBeforeCdata2 = ifElseState("D", BEFORE_CDATA_3, IN_DECLARATION);
866
- Tokenizer.prototype._stateBeforeCdata3 = ifElseState("A", BEFORE_CDATA_4, IN_DECLARATION);
867
- Tokenizer.prototype._stateBeforeCdata4 = ifElseState("T", BEFORE_CDATA_5, IN_DECLARATION);
868
- Tokenizer.prototype._stateBeforeCdata5 = ifElseState("A", BEFORE_CDATA_6, IN_DECLARATION);
869
-
870
- Tokenizer.prototype._stateBeforeCdata6 = function(c){
871
- if(c === "["){
872
- this._state = IN_CDATA;
873
- this._sectionStart = this._index + 1;
874
- } else {
875
- this._state = IN_DECLARATION;
876
- this._index--;
877
- }
878
- };
879
-
880
- Tokenizer.prototype._stateInCdata = function(c){
881
- if(c === "]") this._state = AFTER_CDATA_1;
882
- };
883
-
884
- Tokenizer.prototype._stateAfterCdata1 = characterState("]", AFTER_CDATA_2);
885
-
886
- Tokenizer.prototype._stateAfterCdata2 = function(c){
887
- if(c === ">"){
888
- //remove 2 trailing chars
889
- this._cbs.oncdata(this._buffer.substring(this._sectionStart, this._index - 2));
890
- this._state = TEXT;
891
- this._sectionStart = this._index + 1;
892
- } else if(c !== "]") {
893
- this._state = IN_CDATA;
894
- }
895
- //else: stay in AFTER_CDATA_2 (`]]]>`)
896
- };
897
-
898
- Tokenizer.prototype._stateBeforeSpecial = function(c){
899
- if(c === "c" || c === "C"){
900
- this._state = BEFORE_SCRIPT_1;
901
- } else if(c === "t" || c === "T"){
902
- this._state = BEFORE_STYLE_1;
903
- } else {
904
- this._state = IN_TAG_NAME;
905
- this._index--; //consume the token again
906
- }
907
- };
908
-
909
- Tokenizer.prototype._stateBeforeSpecialEnd = function(c){
910
- if(this._special === SPECIAL_SCRIPT && (c === "c" || c === "C")){
911
- this._state = AFTER_SCRIPT_1;
912
- } else if(this._special === SPECIAL_STYLE && (c === "t" || c === "T")){
913
- this._state = AFTER_STYLE_1;
914
- }
915
- else this._state = TEXT;
916
- };
917
-
918
- Tokenizer.prototype._stateBeforeScript1 = consumeSpecialNameChar("R", BEFORE_SCRIPT_2);
919
- Tokenizer.prototype._stateBeforeScript2 = consumeSpecialNameChar("I", BEFORE_SCRIPT_3);
920
- Tokenizer.prototype._stateBeforeScript3 = consumeSpecialNameChar("P", BEFORE_SCRIPT_4);
921
- Tokenizer.prototype._stateBeforeScript4 = consumeSpecialNameChar("T", BEFORE_SCRIPT_5);
922
-
923
- Tokenizer.prototype._stateBeforeScript5 = function(c){
924
- if(c === "/" || c === ">" || whitespace(c)){
925
- this._special = SPECIAL_SCRIPT;
926
- }
927
- this._state = IN_TAG_NAME;
928
- this._index--; //consume the token again
929
- };
930
-
931
- Tokenizer.prototype._stateAfterScript1 = ifElseState("R", AFTER_SCRIPT_2, TEXT);
932
- Tokenizer.prototype._stateAfterScript2 = ifElseState("I", AFTER_SCRIPT_3, TEXT);
933
- Tokenizer.prototype._stateAfterScript3 = ifElseState("P", AFTER_SCRIPT_4, TEXT);
934
- Tokenizer.prototype._stateAfterScript4 = ifElseState("T", AFTER_SCRIPT_5, TEXT);
935
-
936
- Tokenizer.prototype._stateAfterScript5 = function(c){
937
- if(c === ">" || whitespace(c)){
938
- this._special = SPECIAL_NONE;
939
- this._state = IN_CLOSING_TAG_NAME;
940
- this._sectionStart = this._index - 6;
941
- this._index--; //reconsume the token
942
- }
943
- else this._state = TEXT;
944
- };
945
-
946
- Tokenizer.prototype._stateBeforeStyle1 = consumeSpecialNameChar("Y", BEFORE_STYLE_2);
947
- Tokenizer.prototype._stateBeforeStyle2 = consumeSpecialNameChar("L", BEFORE_STYLE_3);
948
- Tokenizer.prototype._stateBeforeStyle3 = consumeSpecialNameChar("E", BEFORE_STYLE_4);
949
-
950
- Tokenizer.prototype._stateBeforeStyle4 = function(c){
951
- if(c === "/" || c === ">" || whitespace(c)){
952
- this._special = SPECIAL_STYLE;
953
- }
954
- this._state = IN_TAG_NAME;
955
- this._index--; //consume the token again
956
- };
957
-
958
- Tokenizer.prototype._stateAfterStyle1 = ifElseState("Y", AFTER_STYLE_2, TEXT);
959
- Tokenizer.prototype._stateAfterStyle2 = ifElseState("L", AFTER_STYLE_3, TEXT);
960
- Tokenizer.prototype._stateAfterStyle3 = ifElseState("E", AFTER_STYLE_4, TEXT);
961
-
962
- Tokenizer.prototype._stateAfterStyle4 = function(c){
963
- if(c === ">" || whitespace(c)){
964
- this._special = SPECIAL_NONE;
965
- this._state = IN_CLOSING_TAG_NAME;
966
- this._sectionStart = this._index - 5;
967
- this._index--; //reconsume the token
968
- }
969
- else this._state = TEXT;
970
- };
971
-
972
- Tokenizer.prototype._stateBeforeEntity = ifElseState("#", BEFORE_NUMERIC_ENTITY, IN_NAMED_ENTITY);
973
- Tokenizer.prototype._stateBeforeNumericEntity = ifElseState("X", IN_HEX_ENTITY, IN_NUMERIC_ENTITY);
974
-
975
- //for entities terminated with a semicolon
976
- Tokenizer.prototype._parseNamedEntityStrict = function(){
977
- //offset = 1
978
- if(this._sectionStart + 1 < this._index){
979
- var entity = this._buffer.substring(this._sectionStart + 1, this._index),
980
- map = this._xmlMode ? xmlMap : entityMap;
981
-
982
- if(map.hasOwnProperty(entity)){
983
- this._emitPartial(map[entity]);
984
- this._sectionStart = this._index + 1;
985
- }
986
- }
987
- };
988
-
989
-
990
- //parses legacy entities (without trailing semicolon)
991
- Tokenizer.prototype._parseLegacyEntity = function(){
992
- var start = this._sectionStart + 1,
993
- limit = this._index - start;
994
-
995
- if(limit > 6) limit = 6; //the max length of legacy entities is 6
996
-
997
- while(limit >= 2){ //the min length of legacy entities is 2
998
- var entity = this._buffer.substr(start, limit);
999
-
1000
- if(legacyMap.hasOwnProperty(entity)){
1001
- this._emitPartial(legacyMap[entity]);
1002
- this._sectionStart += limit + 1;
1003
- return;
1004
- } else {
1005
- limit--;
1006
- }
1007
- }
1008
- };
1009
-
1010
- Tokenizer.prototype._stateInNamedEntity = function(c){
1011
- if(c === ";"){
1012
- this._parseNamedEntityStrict();
1013
- if(this._sectionStart + 1 < this._index && !this._xmlMode){
1014
- this._parseLegacyEntity();
1015
- }
1016
- this._state = this._baseState;
1017
- } else if((c < "a" || c > "z") && (c < "A" || c > "Z") && (c < "0" || c > "9")){
1018
- if(this._xmlMode);
1019
- else if(this._sectionStart + 1 === this._index);
1020
- else if(this._baseState !== TEXT){
1021
- if(c !== "="){
1022
- this._parseNamedEntityStrict();
1023
- }
1024
- } else {
1025
- this._parseLegacyEntity();
1026
- }
1027
-
1028
- this._state = this._baseState;
1029
- this._index--;
1030
- }
1031
- };
1032
-
1033
- Tokenizer.prototype._decodeNumericEntity = function(offset, base){
1034
- var sectionStart = this._sectionStart + offset;
1035
-
1036
- if(sectionStart !== this._index){
1037
- //parse entity
1038
- var entity = this._buffer.substring(sectionStart, this._index);
1039
- var parsed = parseInt(entity, base);
1040
-
1041
- this._emitPartial(decodeCodePoint(parsed));
1042
- this._sectionStart = this._index;
1043
- } else {
1044
- this._sectionStart--;
1045
- }
1046
-
1047
- this._state = this._baseState;
1048
- };
1049
-
1050
- Tokenizer.prototype._stateInNumericEntity = function(c){
1051
- if(c === ";"){
1052
- this._decodeNumericEntity(2, 10);
1053
- this._sectionStart++;
1054
- } else if(c < "0" || c > "9"){
1055
- if(!this._xmlMode){
1056
- this._decodeNumericEntity(2, 10);
1057
- } else {
1058
- this._state = this._baseState;
1059
- }
1060
- this._index--;
1061
- }
1062
- };
1063
-
1064
- Tokenizer.prototype._stateInHexEntity = function(c){
1065
- if(c === ";"){
1066
- this._decodeNumericEntity(3, 16);
1067
- this._sectionStart++;
1068
- } else if((c < "a" || c > "f") && (c < "A" || c > "F") && (c < "0" || c > "9")){
1069
- if(!this._xmlMode){
1070
- this._decodeNumericEntity(3, 16);
1071
- } else {
1072
- this._state = this._baseState;
1073
- }
1074
- this._index--;
1075
- }
1076
- };
1077
-
1078
- Tokenizer.prototype._cleanup = function (){
1079
- if(this._sectionStart < 0){
1080
- this._buffer = "";
1081
- this._bufferOffset += this._index;
1082
- this._index = 0;
1083
- } else if(this._running){
1084
- if(this._state === TEXT){
1085
- if(this._sectionStart !== this._index){
1086
- this._cbs.ontext(this._buffer.substr(this._sectionStart));
1087
- }
1088
- this._buffer = "";
1089
- this._bufferOffset += this._index;
1090
- this._index = 0;
1091
- } else if(this._sectionStart === this._index){
1092
- //the section just started
1093
- this._buffer = "";
1094
- this._bufferOffset += this._index;
1095
- this._index = 0;
1096
- } else {
1097
- //remove everything unnecessary
1098
- this._buffer = this._buffer.substr(this._sectionStart);
1099
- this._index -= this._sectionStart;
1100
- this._bufferOffset += this._sectionStart;
1101
- }
1102
-
1103
- this._sectionStart = 0;
1104
- }
1105
- };
1106
-
1107
- //TODO make events conditional
1108
- Tokenizer.prototype.write = function(chunk){
1109
- if(this._ended) this._cbs.onerror(Error(".write() after done!"));
1110
-
1111
- this._buffer += chunk;
1112
- this._parse();
1113
- };
1114
-
1115
- Tokenizer.prototype._parse = function(){
1116
- while(this._index < this._buffer.length && this._running){
1117
- var c = this._buffer.charAt(this._index);
1118
- if(this._state === TEXT) {
1119
- this._stateText(c);
1120
- } else if(this._state === BEFORE_TAG_NAME){
1121
- this._stateBeforeTagName(c);
1122
- } else if(this._state === IN_TAG_NAME) {
1123
- this._stateInTagName(c);
1124
- } else if(this._state === BEFORE_CLOSING_TAG_NAME){
1125
- this._stateBeforeCloseingTagName(c);
1126
- } else if(this._state === IN_CLOSING_TAG_NAME){
1127
- this._stateInCloseingTagName(c);
1128
- } else if(this._state === AFTER_CLOSING_TAG_NAME){
1129
- this._stateAfterCloseingTagName(c);
1130
- } else if(this._state === IN_SELF_CLOSING_TAG){
1131
- this._stateInSelfClosingTag(c);
1132
- }
1133
-
1134
- /*
1135
- * attributes
1136
- */
1137
- else if(this._state === BEFORE_ATTRIBUTE_NAME){
1138
- this._stateBeforeAttributeName(c);
1139
- } else if(this._state === IN_ATTRIBUTE_NAME){
1140
- this._stateInAttributeName(c);
1141
- } else if(this._state === AFTER_ATTRIBUTE_NAME){
1142
- this._stateAfterAttributeName(c);
1143
- } else if(this._state === BEFORE_ATTRIBUTE_VALUE){
1144
- this._stateBeforeAttributeValue(c);
1145
- } else if(this._state === IN_ATTRIBUTE_VALUE_DQ){
1146
- this._stateInAttributeValueDoubleQuotes(c);
1147
- } else if(this._state === IN_ATTRIBUTE_VALUE_SQ){
1148
- this._stateInAttributeValueSingleQuotes(c);
1149
- } else if(this._state === IN_ATTRIBUTE_VALUE_NQ){
1150
- this._stateInAttributeValueNoQuotes(c);
1151
- }
1152
-
1153
- /*
1154
- * declarations
1155
- */
1156
- else if(this._state === BEFORE_DECLARATION){
1157
- this._stateBeforeDeclaration(c);
1158
- } else if(this._state === IN_DECLARATION){
1159
- this._stateInDeclaration(c);
1160
- }
1161
-
1162
- /*
1163
- * processing instructions
1164
- */
1165
- else if(this._state === IN_PROCESSING_INSTRUCTION){
1166
- this._stateInProcessingInstruction(c);
1167
- }
1168
-
1169
- /*
1170
- * comments
1171
- */
1172
- else if(this._state === BEFORE_COMMENT){
1173
- this._stateBeforeComment(c);
1174
- } else if(this._state === IN_COMMENT){
1175
- this._stateInComment(c);
1176
- } else if(this._state === AFTER_COMMENT_1){
1177
- this._stateAfterComment1(c);
1178
- } else if(this._state === AFTER_COMMENT_2){
1179
- this._stateAfterComment2(c);
1180
- }
1181
-
1182
- /*
1183
- * cdata
1184
- */
1185
- else if(this._state === BEFORE_CDATA_1){
1186
- this._stateBeforeCdata1(c);
1187
- } else if(this._state === BEFORE_CDATA_2){
1188
- this._stateBeforeCdata2(c);
1189
- } else if(this._state === BEFORE_CDATA_3){
1190
- this._stateBeforeCdata3(c);
1191
- } else if(this._state === BEFORE_CDATA_4){
1192
- this._stateBeforeCdata4(c);
1193
- } else if(this._state === BEFORE_CDATA_5){
1194
- this._stateBeforeCdata5(c);
1195
- } else if(this._state === BEFORE_CDATA_6){
1196
- this._stateBeforeCdata6(c);
1197
- } else if(this._state === IN_CDATA){
1198
- this._stateInCdata(c);
1199
- } else if(this._state === AFTER_CDATA_1){
1200
- this._stateAfterCdata1(c);
1201
- } else if(this._state === AFTER_CDATA_2){
1202
- this._stateAfterCdata2(c);
1203
- }
1204
-
1205
- /*
1206
- * special tags
1207
- */
1208
- else if(this._state === BEFORE_SPECIAL){
1209
- this._stateBeforeSpecial(c);
1210
- } else if(this._state === BEFORE_SPECIAL_END){
1211
- this._stateBeforeSpecialEnd(c);
1212
- }
1213
-
1214
- /*
1215
- * script
1216
- */
1217
- else if(this._state === BEFORE_SCRIPT_1){
1218
- this._stateBeforeScript1(c);
1219
- } else if(this._state === BEFORE_SCRIPT_2){
1220
- this._stateBeforeScript2(c);
1221
- } else if(this._state === BEFORE_SCRIPT_3){
1222
- this._stateBeforeScript3(c);
1223
- } else if(this._state === BEFORE_SCRIPT_4){
1224
- this._stateBeforeScript4(c);
1225
- } else if(this._state === BEFORE_SCRIPT_5){
1226
- this._stateBeforeScript5(c);
1227
- }
1228
-
1229
- else if(this._state === AFTER_SCRIPT_1){
1230
- this._stateAfterScript1(c);
1231
- } else if(this._state === AFTER_SCRIPT_2){
1232
- this._stateAfterScript2(c);
1233
- } else if(this._state === AFTER_SCRIPT_3){
1234
- this._stateAfterScript3(c);
1235
- } else if(this._state === AFTER_SCRIPT_4){
1236
- this._stateAfterScript4(c);
1237
- } else if(this._state === AFTER_SCRIPT_5){
1238
- this._stateAfterScript5(c);
1239
- }
1240
-
1241
- /*
1242
- * style
1243
- */
1244
- else if(this._state === BEFORE_STYLE_1){
1245
- this._stateBeforeStyle1(c);
1246
- } else if(this._state === BEFORE_STYLE_2){
1247
- this._stateBeforeStyle2(c);
1248
- } else if(this._state === BEFORE_STYLE_3){
1249
- this._stateBeforeStyle3(c);
1250
- } else if(this._state === BEFORE_STYLE_4){
1251
- this._stateBeforeStyle4(c);
1252
- }
1253
-
1254
- else if(this._state === AFTER_STYLE_1){
1255
- this._stateAfterStyle1(c);
1256
- } else if(this._state === AFTER_STYLE_2){
1257
- this._stateAfterStyle2(c);
1258
- } else if(this._state === AFTER_STYLE_3){
1259
- this._stateAfterStyle3(c);
1260
- } else if(this._state === AFTER_STYLE_4){
1261
- this._stateAfterStyle4(c);
1262
- }
1263
-
1264
- /*
1265
- * entities
1266
- */
1267
- else if(this._state === BEFORE_ENTITY){
1268
- this._stateBeforeEntity(c);
1269
- } else if(this._state === BEFORE_NUMERIC_ENTITY){
1270
- this._stateBeforeNumericEntity(c);
1271
- } else if(this._state === IN_NAMED_ENTITY){
1272
- this._stateInNamedEntity(c);
1273
- } else if(this._state === IN_NUMERIC_ENTITY){
1274
- this._stateInNumericEntity(c);
1275
- } else if(this._state === IN_HEX_ENTITY){
1276
- this._stateInHexEntity(c);
1277
- }
1278
-
1279
- else {
1280
- this._cbs.onerror(Error("unknown _state"), this._state);
1281
- }
1282
-
1283
- this._index++;
1284
- }
1285
-
1286
- this._cleanup();
1287
- };
1288
-
1289
- Tokenizer.prototype.pause = function(){
1290
- this._running = false;
1291
- };
1292
- Tokenizer.prototype.resume = function(){
1293
- this._running = true;
1294
-
1295
- if(this._index < this._buffer.length){
1296
- this._parse();
1297
- }
1298
- if(this._ended){
1299
- this._finish();
1300
- }
1301
- };
1302
-
1303
- Tokenizer.prototype.end = function(chunk){
1304
- if(this._ended) this._cbs.onerror(Error(".end() after done!"));
1305
- if(chunk) this.write(chunk);
1306
-
1307
- this._ended = true;
1308
-
1309
- if(this._running) this._finish();
1310
- };
1311
-
1312
- Tokenizer.prototype._finish = function(){
1313
- //if there is remaining data, emit it in a reasonable way
1314
- if(this._sectionStart < this._index){
1315
- this._handleTrailingData();
1316
- }
1317
-
1318
- this._cbs.onend();
1319
- };
1320
-
1321
- Tokenizer.prototype._handleTrailingData = function(){
1322
- var data = this._buffer.substr(this._sectionStart);
1323
-
1324
- if(this._state === IN_CDATA || this._state === AFTER_CDATA_1 || this._state === AFTER_CDATA_2){
1325
- this._cbs.oncdata(data);
1326
- } else if(this._state === IN_COMMENT || this._state === AFTER_COMMENT_1 || this._state === AFTER_COMMENT_2){
1327
- this._cbs.oncomment(data);
1328
- } else if(this._state === IN_NAMED_ENTITY && !this._xmlMode){
1329
- this._parseLegacyEntity();
1330
- if(this._sectionStart < this._index){
1331
- this._state = this._baseState;
1332
- this._handleTrailingData();
1333
- }
1334
- } else if(this._state === IN_NUMERIC_ENTITY && !this._xmlMode){
1335
- this._decodeNumericEntity(2, 10);
1336
- if(this._sectionStart < this._index){
1337
- this._state = this._baseState;
1338
- this._handleTrailingData();
1339
- }
1340
- } else if(this._state === IN_HEX_ENTITY && !this._xmlMode){
1341
- this._decodeNumericEntity(3, 16);
1342
- if(this._sectionStart < this._index){
1343
- this._state = this._baseState;
1344
- this._handleTrailingData();
1345
- }
1346
- } else if(
1347
- this._state !== IN_TAG_NAME &&
1348
- this._state !== BEFORE_ATTRIBUTE_NAME &&
1349
- this._state !== BEFORE_ATTRIBUTE_VALUE &&
1350
- this._state !== AFTER_ATTRIBUTE_NAME &&
1351
- this._state !== IN_ATTRIBUTE_NAME &&
1352
- this._state !== IN_ATTRIBUTE_VALUE_SQ &&
1353
- this._state !== IN_ATTRIBUTE_VALUE_DQ &&
1354
- this._state !== IN_ATTRIBUTE_VALUE_NQ &&
1355
- this._state !== IN_CLOSING_TAG_NAME
1356
- ){
1357
- this._cbs.ontext(data);
1358
- }
1359
- //else, ignore remaining data
1360
- //TODO add a way to remove current tag
1361
- };
1362
 
1363
- Tokenizer.prototype.reset = function(){
1364
- Tokenizer.call(this, {xmlMode: this._xmlMode, decodeEntities: this._decodeEntities}, this._cbs);
1365
- };
1366
 
1367
- Tokenizer.prototype.getAbsoluteIndex = function(){
1368
- return this._bufferOffset + this._index;
1369
- };
1370
 
1371
- Tokenizer.prototype._getSection = function(){
1372
- return this._buffer.substring(this._sectionStart, this._index);
1373
- };
1374
 
1375
- Tokenizer.prototype._emitToken = function(name){
1376
- this._cbs[name](this._getSection());
1377
- this._sectionStart = -1;
1378
- };
1379
 
1380
- Tokenizer.prototype._emitPartial = function(value){
1381
- if(this._baseState !== TEXT){
1382
- this._cbs.onattribdata(value); //TODO implement the new event
1383
- } else {
1384
- this._cbs.ontext(value);
1385
- }
1386
- };
1387
 
 
1388
 
1389
- /***/ }),
1390
 
1391
- /***/ 259:
1392
- /***/ (function(module, exports, __webpack_require__) {
1393
 
1394
- var decodeMap = __webpack_require__(411);
 
 
 
 
1395
 
1396
- module.exports = decodeCodePoint;
1397
 
1398
- // modified version of https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119
1399
- function decodeCodePoint(codePoint){
1400
 
1401
- if((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF){
1402
- return "\uFFFD";
1403
- }
1404
 
1405
- if(codePoint in decodeMap){
1406
- codePoint = decodeMap[codePoint];
1407
- }
1408
 
1409
- var output = "";
1410
 
1411
- if(codePoint > 0xFFFF){
1412
- codePoint -= 0x10000;
1413
- output += String.fromCharCode(codePoint >>> 10 & 0x3FF | 0xD800);
1414
- codePoint = 0xDC00 | codePoint & 0x3FF;
1415
- }
 
 
 
 
 
 
1416
 
1417
- output += String.fromCharCode(codePoint);
1418
- return output;
1419
  }
1420
 
1421
-
1422
  /***/ }),
1423
 
1424
- /***/ 260:
1425
- /***/ (function(module, exports) {
1426
-
1427
- 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":"ÿ"}
1428
 
1429
- /***/ }),
1430
 
1431
- /***/ 261:
1432
- /***/ (function(module, exports) {
1433
 
1434
- // This object will be used as the prototype for Nodes when creating a
1435
- // DOM-Level-1-compliant structure.
1436
- var NodePrototype = module.exports = {
1437
- get firstChild() {
1438
- var children = this.children;
1439
- return children && children[0] || null;
1440
- },
1441
- get lastChild() {
1442
- var children = this.children;
1443
- return children && children[children.length - 1] || null;
1444
- },
1445
- get nodeType() {
1446
- return nodeTypes[this.type] || nodeTypes.element;
1447
- }
1448
- };
1449
-
1450
- var domLvl1 = {
1451
- tagName: "name",
1452
- childNodes: "children",
1453
- parentNode: "parent",
1454
- previousSibling: "prev",
1455
- nextSibling: "next",
1456
- nodeValue: "data"
1457
- };
1458
-
1459
- var nodeTypes = {
1460
- element: 1,
1461
- text: 3,
1462
- cdata: 4,
1463
- comment: 8
1464
- };
1465
-
1466
- Object.keys(domLvl1).forEach(function(key) {
1467
- var shorthand = domLvl1[key];
1468
- Object.defineProperty(NodePrototype, key, {
1469
- get: function() {
1470
- return this[shorthand] || null;
1471
- },
1472
- set: function(val) {
1473
- this[shorthand] = val;
1474
- return val;
1475
- }
1476
- });
1477
  });
 
1478
 
 
1479
 
1480
- /***/ }),
1481
-
1482
- /***/ 262:
1483
- /***/ (function(module, exports, __webpack_require__) {
1484
-
1485
- module.exports = Stream;
1486
 
1487
- var Parser = __webpack_require__(257),
1488
- WritableStream = __webpack_require__(416).Writable || __webpack_require__(428).Writable,
1489
- StringDecoder = __webpack_require__(92).StringDecoder,
1490
- Buffer = __webpack_require__(90).Buffer;
1491
 
1492
- function Stream(cbs, options){
1493
- var parser = this._parser = new Parser(cbs, options);
1494
- var decoder = this._decoder = new StringDecoder();
1495
 
1496
- WritableStream.call(this, {decodeStrings: false});
1497
 
1498
- this.once("finish", function(){
1499
- parser.end(decoder.end());
1500
- });
1501
- }
1502
 
1503
- __webpack_require__(21)(Stream, WritableStream);
1504
 
1505
- WritableStream.prototype._write = function(chunk, encoding, cb){
1506
- if(chunk instanceof Buffer) chunk = this._decoder.write(chunk);
1507
- this._parser.write(chunk);
1508
- cb();
1509
- };
1510
 
1511
- /***/ }),
1512
 
1513
- /***/ 263:
1514
- /***/ (function(module, exports, __webpack_require__) {
1515
 
1516
- "use strict";
1517
- /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
1518
- //
1519
- // Permission is hereby granted, free of charge, to any person obtaining a
1520
- // copy of this software and associated documentation files (the
1521
- // "Software"), to deal in the Software without restriction, including
1522
- // without limitation the rights to use, copy, modify, merge, publish,
1523
- // distribute, sublicense, and/or sell copies of the Software, and to permit
1524
- // persons to whom the Software is furnished to do so, subject to the
1525
- // following conditions:
1526
- //
1527
- // The above copyright notice and this permission notice shall be included
1528
- // in all copies or substantial portions of the Software.
1529
- //
1530
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1531
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1532
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
1533
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
1534
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1535
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
1536
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
1537
-
1538
-
1539
-
1540
- /*<replacement>*/
1541
-
1542
- var processNextTick = __webpack_require__(55);
1543
- /*</replacement>*/
1544
-
1545
- module.exports = Readable;
1546
-
1547
- /*<replacement>*/
1548
- var isArray = __webpack_require__(264);
1549
- /*</replacement>*/
1550
-
1551
- /*<replacement>*/
1552
- var Duplex;
1553
- /*</replacement>*/
1554
-
1555
- Readable.ReadableState = ReadableState;
1556
-
1557
- /*<replacement>*/
1558
- var EE = __webpack_require__(54).EventEmitter;
1559
-
1560
- var EElistenerCount = function (emitter, type) {
1561
- return emitter.listeners(type).length;
1562
- };
1563
- /*</replacement>*/
1564
-
1565
- /*<replacement>*/
1566
- var Stream = __webpack_require__(265);
1567
- /*</replacement>*/
1568
-
1569
- // TODO(bmeurer): Change this back to const once hole checks are
1570
- // properly optimized away early in Ignition+TurboFan.
1571
- /*<replacement>*/
1572
- var Buffer = __webpack_require__(56).Buffer;
1573
- var OurUint8Array = global.Uint8Array || function () {};
1574
- function _uint8ArrayToBuffer(chunk) {
1575
- return Buffer.from(chunk);
1576
- }
1577
- function _isUint8Array(obj) {
1578
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
1579
- }
1580
- /*</replacement>*/
1581
-
1582
- /*<replacement>*/
1583
- var util = __webpack_require__(46);
1584
- util.inherits = __webpack_require__(21);
1585
- /*</replacement>*/
1586
-
1587
- /*<replacement>*/
1588
- var debugUtil = __webpack_require__(419);
1589
- var debug = void 0;
1590
- if (debugUtil && debugUtil.debuglog) {
1591
- debug = debugUtil.debuglog('stream');
1592
- } else {
1593
- debug = function () {};
1594
- }
1595
- /*</replacement>*/
1596
 
1597
- var BufferList = __webpack_require__(420);
1598
- var destroyImpl = __webpack_require__(266);
1599
- var StringDecoder;
 
 
 
 
 
1600
 
1601
- util.inherits(Readable, Stream);
 
1602
 
1603
- var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
 
1604
 
1605
- function prependListener(emitter, event, fn) {
1606
- // Sadly this is not cacheable as some libraries bundle their own
1607
- // event emitter implementation with them.
1608
- if (typeof emitter.prependListener === 'function') {
1609
- return emitter.prependListener(event, fn);
1610
- } else {
1611
- // This is a hack to make sure that our error handler is attached before any
1612
- // userland ones. NEVER DO THIS. This is here only because this code needs
1613
- // to continue to work with older versions of Node.js that do not include
1614
- // the prependListener() method. The goal is to eventually remove this hack.
1615
- 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]];
1616
  }
1617
- }
1618
 
1619
- function ReadableState(options, stream) {
1620
- Duplex = Duplex || __webpack_require__(32);
1621
-
1622
- options = options || {};
1623
-
1624
- // object stream flag. Used to make read(n) ignore n and to
1625
- // make all the buffer merging and length checks go away
1626
- this.objectMode = !!options.objectMode;
1627
-
1628
- if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
1629
-
1630
- // the point at which it stops calling _read() to fill the buffer
1631
- // Note: 0 is a valid value, means "don't call _read preemptively ever"
1632
- var hwm = options.highWaterMark;
1633
- var defaultHwm = this.objectMode ? 16 : 16 * 1024;
1634
- this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
1635
-
1636
- // cast to ints.
1637
- this.highWaterMark = Math.floor(this.highWaterMark);
1638
-
1639
- // A linked list is used to store data chunks instead of an array because the
1640
- // linked list can remove elements from the beginning faster than
1641
- // array.shift()
1642
- this.buffer = new BufferList();
1643
- this.length = 0;
1644
- this.pipes = null;
1645
- this.pipesCount = 0;
1646
- this.flowing = null;
1647
- this.ended = false;
1648
- this.endEmitted = false;
1649
- this.reading = false;
1650
-
1651
- // a flag to be able to tell if the event 'readable'/'data' is emitted
1652
- // immediately, or on a later tick. We set this to true at first, because
1653
- // any actions that shouldn't happen until "later" should generally also
1654
- // not happen before the first read call.
1655
- this.sync = true;
1656
-
1657
- // whenever we return null, then we set a flag to say
1658
- // that we're awaiting a 'readable' event emission.
1659
- this.needReadable = false;
1660
- this.emittedReadable = false;
1661
- this.readableListening = false;
1662
- this.resumeScheduled = false;
1663
-
1664
- // has it been destroyed
1665
- this.destroyed = false;
1666
-
1667
- // Crypto is kind of old and crusty. Historically, its default string
1668
- // encoding is 'binary' so we have to make this configurable.
1669
- // Everything else in the universe uses 'utf8', though.
1670
- this.defaultEncoding = options.defaultEncoding || 'utf8';
1671
-
1672
- // the number of writers that are awaiting a drain event in .pipe()s
1673
- this.awaitDrain = 0;
1674
-
1675
- // if true, a maybeReadMore has been scheduled
1676
- this.readingMore = false;
1677
-
1678
- this.decoder = null;
1679
- this.encoding = null;
1680
- if (options.encoding) {
1681
- if (!StringDecoder) StringDecoder = __webpack_require__(92).StringDecoder;
1682
- this.decoder = new StringDecoder(options.encoding);
1683
- this.encoding = options.encoding;
1684
- }
1685
  }
1686
 
1687
- function Readable(options) {
1688
- Duplex = Duplex || __webpack_require__(32);
1689
 
1690
- if (!(this instanceof Readable)) return new Readable(options);
 
1691
 
1692
- this._readableState = new ReadableState(options, this);
1693
 
1694
- // legacy
1695
- this.readable = true;
1696
 
1697
- if (options) {
1698
- if (typeof options.read === 'function') this._read = options.read;
 
 
1699
 
1700
- if (typeof options.destroy === 'function') this._destroy = options.destroy;
1701
- }
1702
 
1703
- Stream.call(this);
1704
- }
1705
 
1706
- Object.defineProperty(Readable.prototype, 'destroyed', {
1707
- get: function () {
1708
- if (this._readableState === undefined) {
1709
- return false;
1710
- }
1711
- return this._readableState.destroyed;
1712
- },
1713
- set: function (value) {
1714
- // we ignore the value if the stream
1715
- // has not been initialized yet
1716
- if (!this._readableState) {
1717
- return;
1718
- }
1719
 
1720
- // backward compatibility, the user is explicitly
1721
- // managing destroyed
1722
- this._readableState.destroyed = value;
1723
- }
1724
- });
1725
 
1726
- Readable.prototype.destroy = destroyImpl.destroy;
1727
- Readable.prototype._undestroy = destroyImpl.undestroy;
1728
- Readable.prototype._destroy = function (err, cb) {
1729
- this.push(null);
1730
- cb(err);
1731
- };
1732
-
1733
- // Manually shove something into the read() buffer.
1734
- // This returns true if the highWaterMark has not been hit yet,
1735
- // similar to how Writable.write() returns true if you should
1736
- // write() some more.
1737
- Readable.prototype.push = function (chunk, encoding) {
1738
- var state = this._readableState;
1739
- var skipChunkCheck;
1740
-
1741
- if (!state.objectMode) {
1742
- if (typeof chunk === 'string') {
1743
- encoding = encoding || state.defaultEncoding;
1744
- if (encoding !== state.encoding) {
1745
- chunk = Buffer.from(chunk, encoding);
1746
- encoding = '';
1747
- }
1748
- skipChunkCheck = true;
1749
- }
1750
- } else {
1751
- skipChunkCheck = true;
1752
  }
1753
 
1754
- return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
1755
  };
1756
 
1757
- // Unshift should *always* be something directly out of read()
1758
- Readable.prototype.unshift = function (chunk) {
1759
- return readableAddChunk(this, chunk, null, true, false);
1760
- };
 
 
 
 
1761
 
1762
- function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
1763
- var state = stream._readableState;
1764
- if (chunk === null) {
1765
- state.reading = false;
1766
- onEofChunk(stream, state);
1767
- } else {
1768
- var er;
1769
- if (!skipChunkCheck) er = chunkInvalid(state, chunk);
1770
- if (er) {
1771
- stream.emit('error', er);
1772
- } else if (state.objectMode || chunk && chunk.length > 0) {
1773
- if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
1774
- chunk = _uint8ArrayToBuffer(chunk);
1775
- }
1776
 
1777
- if (addToFront) {
1778
- if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
1779
- } else if (state.ended) {
1780
- stream.emit('error', new Error('stream.push() after EOF'));
1781
- } else {
1782
- state.reading = false;
1783
- if (state.decoder && !encoding) {
1784
- chunk = state.decoder.write(chunk);
1785
- if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
1786
- } else {
1787
- addChunk(stream, state, chunk, false);
1788
- }
1789
- }
1790
- } else if (!addToFront) {
1791
- state.reading = false;
1792
- }
1793
- }
1794
 
1795
- return needMoreData(state);
1796
- }
1797
 
1798
- function addChunk(stream, state, chunk, addToFront) {
1799
- if (state.flowing && state.length === 0 && !state.sync) {
1800
- stream.emit('data', chunk);
1801
- stream.read(0);
1802
- } else {
1803
- // update the buffer info.
1804
- state.length += state.objectMode ? 1 : chunk.length;
1805
- if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
1806
 
1807
- if (state.needReadable) emitReadable(stream);
1808
- }
1809
- maybeReadMore(stream, state);
1810
  }
1811
 
1812
- function chunkInvalid(state, chunk) {
1813
- var er;
1814
- if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
1815
- er = new TypeError('Invalid non-string/buffer chunk');
1816
- }
1817
- return er;
1818
- }
1819
 
1820
- // if it's past the high water mark, we can push in some more.
1821
- // Also, if we have no data yet, we can stand some
1822
- // more bytes. This is to work around cases where hwm=0,
1823
- // such as the repl. Also, if the push() triggered a
1824
- // readable event, and the user called read(largeNumber) such that
1825
- // needReadable was set, then we ought to push more, so that another
1826
- // 'readable' event will be triggered.
1827
- function needMoreData(state) {
1828
- return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
1829
- }
1830
 
1831
- Readable.prototype.isPaused = function () {
1832
- return this._readableState.flowing === false;
1833
- };
1834
 
1835
- // backwards compatibility.
1836
- Readable.prototype.setEncoding = function (enc) {
1837
- if (!StringDecoder) StringDecoder = __webpack_require__(92).StringDecoder;
1838
- this._readableState.decoder = new StringDecoder(enc);
1839
- this._readableState.encoding = enc;
1840
- return this;
1841
- };
1842
 
1843
- // Don't raise the hwm > 8MB
1844
- var MAX_HWM = 0x800000;
1845
- function computeNewHighWaterMark(n) {
1846
- if (n >= MAX_HWM) {
1847
- n = MAX_HWM;
1848
- } else {
1849
- // Get the next highest power of 2 to prevent increasing hwm excessively in
1850
- // tiny amounts
1851
- n--;
1852
- n |= n >>> 1;
1853
- n |= n >>> 2;
1854
- n |= n >>> 4;
1855
- n |= n >>> 8;
1856
- n |= n >>> 16;
1857
- n++;
1858
- }
1859
- return n;
1860
- }
1861
 
1862
- // This function is designed to be inlinable, so please take care when making
1863
- // changes to the function body.
1864
- function howMuchToRead(n, state) {
1865
- if (n <= 0 || state.length === 0 && state.ended) return 0;
1866
- if (state.objectMode) return 1;
1867
- if (n !== n) {
1868
- // Only flow one buffer at a time
1869
- if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
1870
- }
1871
- // If we're asking for more than the current hwm, then raise the hwm.
1872
- if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
1873
- if (n <= state.length) return n;
1874
- // Don't have enough
1875
- if (!state.ended) {
1876
- state.needReadable = true;
1877
- return 0;
1878
- }
1879
- return state.length;
1880
- }
1881
 
1882
- // you can override either this method, or the async _read(n) below.
1883
- Readable.prototype.read = function (n) {
1884
- debug('read', n);
1885
- n = parseInt(n, 10);
1886
- var state = this._readableState;
1887
- var nOrig = n;
1888
-
1889
- if (n !== 0) state.emittedReadable = false;
1890
-
1891
- // if we're doing read(0) to trigger a readable event, but we
1892
- // already have a bunch of data in the buffer, then just trigger
1893
- // the 'readable' event and move on.
1894
- if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
1895
- debug('read: emitReadable', state.length, state.ended);
1896
- if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
1897
- return null;
1898
- }
1899
 
1900
- n = howMuchToRead(n, state);
1901
 
1902
- // if we've ended, and we're now clear, then finish it up.
1903
- if (n === 0 && state.ended) {
1904
- if (state.length === 0) endReadable(this);
1905
- return null;
1906
- }
1907
 
1908
- // All the actual chunk generation logic needs to be
1909
- // *below* the call to _read. The reason is that in certain
1910
- // synthetic stream cases, such as passthrough streams, _read
1911
- // may be a completely synchronous operation which may change
1912
- // the state of the read buffer, providing enough data when
1913
- // before there was *not* enough.
1914
- //
1915
- // So, the steps are:
1916
- // 1. Figure out what the state of things will be after we do
1917
- // a read from the buffer.
1918
- //
1919
- // 2. If that resulting state will trigger a _read, then call _read.
1920
- // Note that this may be asynchronous, or synchronous. Yes, it is
1921
- // deeply ugly to write APIs this way, but that still doesn't mean
1922
- // that the Readable class should behave improperly, as streams are
1923
- // designed to be sync/async agnostic.
1924
- // Take note if the _read call is sync or async (ie, if the read call
1925
- // has returned yet), so that we know whether or not it's safe to emit
1926
- // 'readable' etc.
1927
- //
1928
- // 3. Actually pull the requested chunks out of the buffer and return.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1929
 
1930
- // if we need a readable event, then we need to do some reading.
1931
- var doRead = state.needReadable;
1932
- debug('need readable', doRead);
1933
 
1934
- // if we currently have less than the highWaterMark, then also read some
1935
- if (state.length === 0 || state.length - n < state.highWaterMark) {
1936
- doRead = true;
1937
- debug('length less than watermark', doRead);
1938
- }
1939
 
1940
- // however, if we've ended, then there's no point, and if we're already
1941
- // reading, then it's unnecessary.
1942
- if (state.ended || state.reading) {
1943
- doRead = false;
1944
- debug('reading or ended', doRead);
1945
- } else if (doRead) {
1946
- debug('do read');
1947
- state.reading = true;
1948
- state.sync = true;
1949
- // if the length is currently zero, then we *need* a readable event.
1950
- if (state.length === 0) state.needReadable = true;
1951
- // call internal read method
1952
- this._read(state.highWaterMark);
1953
- state.sync = false;
1954
- // If _read pushed data synchronously, then `reading` will be false,
1955
- // and we need to re-evaluate how much data we can return to the user.
1956
- if (!state.reading) n = howMuchToRead(nOrig, state);
1957
- }
1958
-
1959
- var ret;
1960
- if (n > 0) ret = fromList(n, state);else ret = null;
1961
-
1962
- if (ret === null) {
1963
- state.needReadable = true;
1964
- n = 0;
1965
- } else {
1966
- state.length -= n;
1967
- }
1968
-
1969
- if (state.length === 0) {
1970
- // If we have nothing in the buffer, then we want to know
1971
- // as soon as we *do* get something into the buffer.
1972
- if (!state.ended) state.needReadable = true;
1973
-
1974
- // If we tried to read() past the EOF, then emit end on the next tick.
1975
- if (nOrig !== n && state.ended) endReadable(this);
1976
- }
1977
-
1978
- if (ret !== null) this.emit('data', ret);
1979
-
1980
- return ret;
1981
- };
1982
 
1983
- function onEofChunk(stream, state) {
1984
- if (state.ended) return;
1985
- if (state.decoder) {
1986
- var chunk = state.decoder.end();
1987
- if (chunk && chunk.length) {
1988
- state.buffer.push(chunk);
1989
- state.length += state.objectMode ? 1 : chunk.length;
1990
- }
1991
- }
1992
- state.ended = true;
1993
 
1994
- // emit 'readable' now to make sure it gets picked up.
1995
- emitReadable(stream);
1996
- }
1997
 
1998
- // Don't emit readable right away in sync mode, because this can trigger
1999
- // another read() call => stack overflow. This way, it might trigger
2000
- // a nextTick recursion warning, but that's not so bad.
2001
- function emitReadable(stream) {
2002
- var state = stream._readableState;
2003
- state.needReadable = false;
2004
- if (!state.emittedReadable) {
2005
- debug('emitReadable', state.flowing);
2006
- state.emittedReadable = true;
2007
- if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);
2008
- }
2009
- }
2010
 
2011
- function emitReadable_(stream) {
2012
- debug('emit readable');
2013
- stream.emit('readable');
2014
- flow(stream);
2015
- }
 
 
 
 
2016
 
2017
- // at this point, the user has presumably seen the 'readable' event,
2018
- // and called read() to consume some data. that may have triggered
2019
- // in turn another _read(n) call, in which case reading = true if
2020
- // it's in progress.
2021
- // However, if we're not ended, or reading, and the length < hwm,
2022
- // then go ahead and try to read some more preemptively.
2023
- function maybeReadMore(stream, state) {
2024
- if (!state.readingMore) {
2025
- state.readingMore = true;
2026
- processNextTick(maybeReadMore_, stream, state);
2027
- }
2028
- }
2029
 
2030
- function maybeReadMore_(stream, state) {
2031
- var len = state.length;
2032
- while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
2033
- debug('maybeReadMore read 0');
2034
- stream.read(0);
2035
- if (len === state.length)
2036
- // didn't get any data, stop spinning.
2037
- break;else len = state.length;
2038
  }
2039
- state.readingMore = false;
2040
- }
2041
 
2042
- // abstract method. to be overridden in specific implementation classes.
2043
- // call cb(er, data) where data is <= n in length.
2044
- // for virtual (non-string, non-buffer) streams, "length" is somewhat
2045
- // arbitrary, and perhaps not very meaningful.
2046
- Readable.prototype._read = function (n) {
2047
- this.emit('error', new Error('_read() is not implemented'));
2048
- };
2049
-
2050
- Readable.prototype.pipe = function (dest, pipeOpts) {
2051
- var src = this;
2052
- var state = this._readableState;
2053
-
2054
- switch (state.pipesCount) {
2055
- case 0:
2056
- state.pipes = dest;
2057
- break;
2058
- case 1:
2059
- state.pipes = [state.pipes, dest];
2060
- break;
2061
- default:
2062
- state.pipes.push(dest);
2063
- break;
2064
- }
2065
- state.pipesCount += 1;
2066
- debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
2067
 
2068
- var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
2069
 
2070
- var endFn = doEnd ? onend : unpipe;
2071
- if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);
 
2072
 
2073
- dest.on('unpipe', onunpipe);
2074
- function onunpipe(readable, unpipeInfo) {
2075
- debug('onunpipe');
2076
- if (readable === src) {
2077
- if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
2078
- unpipeInfo.hasUnpiped = true;
2079
- cleanup();
2080
- }
2081
- }
2082
- }
2083
 
2084
- function onend() {
2085
- debug('onend');
2086
- dest.end();
2087
- }
2088
 
2089
- // when the dest drains, it reduces the awaitDrain counter
2090
- // on the source. This would be more elegant with a .once()
2091
- // handler in flow(), but adding and removing repeatedly is
2092
- // too slow.
2093
- var ondrain = pipeOnDrain(src);
2094
- dest.on('drain', ondrain);
2095
-
2096
- var cleanedUp = false;
2097
- function cleanup() {
2098
- debug('cleanup');
2099
- // cleanup event handlers once the pipe is broken
2100
- dest.removeListener('close', onclose);
2101
- dest.removeListener('finish', onfinish);
2102
- dest.removeListener('drain', ondrain);
2103
- dest.removeListener('error', onerror);
2104
- dest.removeListener('unpipe', onunpipe);
2105
- src.removeListener('end', onend);
2106
- src.removeListener('end', unpipe);
2107
- src.removeListener('data', ondata);
2108
-
2109
- cleanedUp = true;
2110
-
2111
- // if the reader is waiting for a drain event from this
2112
- // specific writer, then it would cause it to never start
2113
- // flowing again.
2114
- // So, if this is awaiting a drain, then we just call it now.
2115
- // If we don't know, then assume that we are waiting for one.
2116
- if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
2117
- }
2118
 
2119
- // If the user pushes more data while we're writing to dest then we'll end up
2120
- // in ondata again. However, we only want to increase awaitDrain once because
2121
- // dest will only emit one 'drain' event for the multiple writes.
2122
- // => Introduce a guard on increasing awaitDrain.
2123
- var increasedAwaitDrain = false;
2124
- src.on('data', ondata);
2125
- function ondata(chunk) {
2126
- debug('ondata');
2127
- increasedAwaitDrain = false;
2128
- var ret = dest.write(chunk);
2129
- if (false === ret && !increasedAwaitDrain) {
2130
- // If the user unpiped during `dest.write()`, it is possible
2131
- // to get stuck in a permanently paused state if that write
2132
- // also returned false.
2133
- // => Check whether `dest` is still a piping destination.
2134
- if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
2135
- debug('false write response, pause', src._readableState.awaitDrain);
2136
- src._readableState.awaitDrain++;
2137
- increasedAwaitDrain = true;
2138
- }
2139
- src.pause();
2140
  }
2141
- }
2142
-
2143
- // if the dest has an error, then stop piping into it.
2144
- // however, don't suppress the throwing behavior for this.
2145
- function onerror(er) {
2146
- debug('onerror', er);
2147
- unpipe();
2148
- dest.removeListener('error', onerror);
2149
- if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
2150
- }
2151
 
2152
- // Make sure our error handler is attached before userland ones.
2153
- prependListener(dest, 'error', onerror);
2154
-
2155
- // Both close and finish should trigger unpipe, but only once.
2156
- function onclose() {
2157
- dest.removeListener('finish', onfinish);
2158
- unpipe();
2159
- }
2160
- dest.once('close', onclose);
2161
- function onfinish() {
2162
- debug('onfinish');
2163
- dest.removeListener('close', onclose);
2164
- unpipe();
2165
- }
2166
- dest.once('finish', onfinish);
2167
-
2168
- function unpipe() {
2169
- debug('unpipe');
2170
- src.unpipe(dest);
2171
- }
2172
-
2173
- // tell the dest that it's being piped to
2174
- dest.emit('pipe', src);
2175
-
2176
- // start the flow if it hasn't been started already.
2177
- if (!state.flowing) {
2178
- debug('pipe resume');
2179
- src.resume();
2180
- }
2181
 
2182
- return dest;
2183
- };
2184
 
2185
- function pipeOnDrain(src) {
2186
- return function () {
2187
- var state = src._readableState;
2188
- debug('pipeOnDrain', state.awaitDrain);
2189
- if (state.awaitDrain) state.awaitDrain--;
2190
- if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
2191
- state.flowing = true;
2192
- flow(src);
2193
- }
2194
- };
2195
  }
2196
 
2197
- Readable.prototype.unpipe = function (dest) {
2198
- var state = this._readableState;
2199
- var unpipeInfo = { hasUnpiped: false };
2200
-
2201
- // if we're not piping anywhere, then do nothing.
2202
- if (state.pipesCount === 0) return this;
2203
-
2204
- // just one destination. most common case.
2205
- if (state.pipesCount === 1) {
2206
- // passed in one, but it's not the right one.
2207
- if (dest && dest !== state.pipes) return this;
2208
-
2209
- if (!dest) dest = state.pipes;
2210
-
2211
- // got a match.
2212
- state.pipes = null;
2213
- state.pipesCount = 0;
2214
- state.flowing = false;
2215
- if (dest) dest.emit('unpipe', this, unpipeInfo);
2216
- return this;
2217
- }
2218
-
2219
- // slow case. multiple pipe destinations.
2220
-
2221
- if (!dest) {
2222
- // remove all.
2223
- var dests = state.pipes;
2224
- var len = state.pipesCount;
2225
- state.pipes = null;
2226
- state.pipesCount = 0;
2227
- state.flowing = false;
2228
-
2229
- for (var i = 0; i < len; i++) {
2230
- dests[i].emit('unpipe', this, unpipeInfo);
2231
- }return this;
2232
- }
2233
-
2234
- // try to find the right one.
2235
- var index = indexOf(state.pipes, dest);
2236
- if (index === -1) return this;
2237
-
2238
- state.pipes.splice(index, 1);
2239
- state.pipesCount -= 1;
2240
- if (state.pipesCount === 1) state.pipes = state.pipes[0];
2241
-
2242
- dest.emit('unpipe', this, unpipeInfo);
2243
-
2244
- return this;
2245
- };
2246
-
2247
- // set up data events if they are asked for
2248
- // Ensure readable listeners eventually get something
2249
- Readable.prototype.on = function (ev, fn) {
2250
- var res = Stream.prototype.on.call(this, ev, fn);
2251
 
2252
- if (ev === 'data') {
2253
- // Start flowing on next tick if stream isn't explicitly paused
2254
- if (this._readableState.flowing !== false) this.resume();
2255
- } else if (ev === 'readable') {
2256
- var state = this._readableState;
2257
- if (!state.endEmitted && !state.readableListening) {
2258
- state.readableListening = state.needReadable = true;
2259
- state.emittedReadable = false;
2260
- if (!state.reading) {
2261
- processNextTick(nReadingNextTick, this);
2262
- } else if (state.length) {
2263
- emitReadable(this);
2264
- }
2265
- }
2266
- }
2267
 
2268
- return res;
2269
- };
2270
- Readable.prototype.addListener = Readable.prototype.on;
2271
 
2272
- function nReadingNextTick(self) {
2273
- debug('readable nexttick read 0');
2274
- self.read(0);
2275
- }
2276
 
2277
- // pause() and resume() are remnants of the legacy readable stream API
2278
- // If the user uses them, then switch into old mode.
2279
- Readable.prototype.resume = function () {
2280
- var state = this._readableState;
2281
- if (!state.flowing) {
2282
- debug('resume');
2283
- state.flowing = true;
2284
- resume(this, state);
2285
- }
2286
- return this;
2287
  };
2288
 
2289
- function resume(stream, state) {
2290
- if (!state.resumeScheduled) {
2291
- state.resumeScheduled = true;
2292
- processNextTick(resume_, stream, state);
2293
- }
2294
- }
2295
-
2296
- function resume_(stream, state) {
2297
- if (!state.reading) {
2298
- debug('resume read 0');
2299
- stream.read(0);
2300
  }
2301
-
2302
- state.resumeScheduled = false;
2303
- state.awaitDrain = 0;
2304
- stream.emit('resume');
2305
- flow(stream);
2306
- if (state.flowing && !state.reading) stream.read(0);
2307
  }
2308
 
2309
- Readable.prototype.pause = function () {
2310
- debug('call pause flowing=%j', this._readableState.flowing);
2311
- if (false !== this._readableState.flowing) {
2312
- debug('pause');
2313
- this._readableState.flowing = false;
2314
- this.emit('pause');
2315
- }
2316
- return this;
2317
- };
2318
 
2319
- function flow(stream) {
2320
- var state = stream._readableState;
2321
- debug('flow', state.flowing);
2322
- while (state.flowing && stream.read() !== null) {}
2323
- }
2324
 
2325
- // wrap an old-style stream as the async data source.
2326
- // This is *not* part of the readable stream interface.
2327
- // It is an ugly unfortunate mess of history.
2328
- Readable.prototype.wrap = function (stream) {
2329
- var state = this._readableState;
2330
- var paused = false;
2331
 
2332
- var self = this;
2333
- stream.on('end', function () {
2334
- debug('wrapped end');
2335
- if (state.decoder && !state.ended) {
2336
- var chunk = state.decoder.end();
2337
- if (chunk && chunk.length) self.push(chunk);
2338
- }
2339
 
2340
- self.push(null);
2341
- });
 
 
 
 
 
 
 
2342
 
2343
- stream.on('data', function (chunk) {
2344
- debug('wrapped data');
2345
- if (state.decoder) chunk = state.decoder.write(chunk);
2346
 
2347
- // don't skip over falsy values in objectMode
2348
- if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
2349
 
2350
- var ret = self.push(chunk);
2351
- if (!ret) {
2352
- paused = true;
2353
- stream.pause();
2354
- }
2355
- });
2356
 
2357
- // proxy all the other methods.
2358
- // important when wrapping filters and duplexes.
2359
- for (var i in stream) {
2360
- if (this[i] === undefined && typeof stream[i] === 'function') {
2361
- this[i] = function (method) {
2362
- return function () {
2363
- return stream[method].apply(stream, arguments);
2364
- };
2365
- }(i);
2366
- }
2367
- }
2368
 
2369
- // proxy certain important events.
2370
- for (var n = 0; n < kProxyEvents.length; n++) {
2371
- stream.on(kProxyEvents[n], self.emit.bind(self, kProxyEvents[n]));
2372
- }
2373
 
2374
- // when we try to consume some more bytes, simply unpause the
2375
- // underlying stream.
2376
- self._read = function (n) {
2377
- debug('wrapped _read', n);
2378
- if (paused) {
2379
- paused = false;
2380
- stream.resume();
2381
- }
2382
- };
2383
 
2384
- return self;
2385
- };
2386
 
2387
- // exposed for testing purposes only.
2388
- Readable._fromList = fromList;
2389
 
2390
- // Pluck off n bytes from an array of buffers.
2391
- // Length is the combined lengths of all the buffers in the list.
2392
- // This function is designed to be inlinable, so please take care when making
2393
- // changes to the function body.
2394
- function fromList(n, state) {
2395
- // nothing buffered
2396
- if (state.length === 0) return null;
2397
 
2398
- var ret;
2399
- if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
2400
- // read it all, truncate the list
2401
- 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);
2402
- state.buffer.clear();
2403
- } else {
2404
- // read part of list
2405
- ret = fromListPartial(n, state.buffer, state.decoder);
2406
- }
2407
 
2408
- return ret;
2409
- }
 
 
 
 
 
 
2410
 
2411
- // Extracts only enough buffered data to satisfy the amount requested.
2412
- // This function is designed to be inlinable, so please take care when making
2413
- // changes to the function body.
2414
- function fromListPartial(n, list, hasStrings) {
2415
- var ret;
2416
- if (n < list.head.data.length) {
2417
- // slice is the same for buffers and strings
2418
- ret = list.head.data.slice(0, n);
2419
- list.head.data = list.head.data.slice(n);
2420
- } else if (n === list.head.data.length) {
2421
- // first chunk is a perfect match
2422
- ret = list.shift();
2423
- } else {
2424
- // result spans more than one buffer
2425
- ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
2426
  }
2427
- return ret;
2428
- }
2429
 
2430
- // Copies a specified amount of characters from the list of buffered data
2431
- // chunks.
2432
- // This function is designed to be inlinable, so please take care when making
2433
- // changes to the function body.
2434
- function copyFromBufferString(n, list) {
2435
- var p = list.head;
2436
- var c = 1;
2437
- var ret = p.data;
2438
- n -= ret.length;
2439
- while (p = p.next) {
2440
- var str = p.data;
2441
- var nb = n > str.length ? str.length : n;
2442
- if (nb === str.length) ret += str;else ret += str.slice(0, n);
2443
- n -= nb;
2444
- if (n === 0) {
2445
- if (nb === str.length) {
2446
- ++c;
2447
- if (p.next) list.head = p.next;else list.head = list.tail = null;
2448
- } else {
2449
- list.head = p;
2450
- p.data = str.slice(nb);
2451
- }
2452
- break;
2453
- }
2454
- ++c;
2455
- }
2456
- list.length -= c;
2457
- return ret;
2458
- }
2459
 
2460
- // Copies a specified amount of bytes from the list of buffered data chunks.
2461
- // This function is designed to be inlinable, so please take care when making
2462
- // changes to the function body.
2463
- function copyFromBuffer(n, list) {
2464
- var ret = Buffer.allocUnsafe(n);
2465
- var p = list.head;
2466
- var c = 1;
2467
- p.data.copy(ret);
2468
- n -= p.data.length;
2469
- while (p = p.next) {
2470
- var buf = p.data;
2471
- var nb = n > buf.length ? buf.length : n;
2472
- buf.copy(ret, ret.length - n, 0, nb);
2473
- n -= nb;
2474
- if (n === 0) {
2475
- if (nb === buf.length) {
2476
- ++c;
2477
- if (p.next) list.head = p.next;else list.head = list.tail = null;
2478
- } else {
2479
- list.head = p;
2480
- p.data = buf.slice(nb);
2481
- }
2482
- break;
2483
- }
2484
- ++c;
2485
- }
2486
- list.length -= c;
2487
- return ret;
2488
  }
2489
 
2490
- function endReadable(stream) {
2491
- var state = stream._readableState;
2492
 
2493
- // If we get here before consuming all the bytes, then that is a
2494
- // bug in node. Should never happen.
2495
- if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
2496
 
2497
- if (!state.endEmitted) {
2498
- state.ended = true;
2499
- processNextTick(endReadableNT, state, stream);
2500
- }
2501
- }
2502
 
2503
- function endReadableNT(state, stream) {
2504
- // Check that we didn't get one last unshift.
2505
- if (!state.endEmitted && state.length === 0) {
2506
- state.endEmitted = true;
2507
- stream.readable = false;
2508
- stream.emit('end');
2509
- }
2510
- }
2511
 
2512
- function forEach(xs, f) {
2513
- for (var i = 0, l = xs.length; i < l; i++) {
2514
- f(xs[i], i);
2515
- }
2516
- }
 
 
 
 
2517
 
2518
- function indexOf(xs, x) {
2519
- for (var i = 0, l = xs.length; i < l; i++) {
2520
- if (xs[i] === x) return i;
2521
- }
2522
- return -1;
2523
  }
2524
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8), __webpack_require__(1)))
2525
-
2526
- /***/ }),
2527
-
2528
- /***/ 264:
2529
- /***/ (function(module, exports) {
2530
-
2531
- var toString = {}.toString;
2532
-
2533
- module.exports = Array.isArray || function (arr) {
2534
- return toString.call(arr) == '[object Array]';
2535
- };
2536
-
2537
 
2538
  /***/ }),
2539
 
2540
- /***/ 265:
2541
  /***/ (function(module, exports, __webpack_require__) {
2542
 
2543
- module.exports = __webpack_require__(54).EventEmitter;
2544
-
2545
 
2546
- /***/ }),
2547
 
2548
- /***/ 266:
2549
- /***/ (function(module, exports, __webpack_require__) {
 
 
2550
 
2551
- "use strict";
2552
 
 
2553
 
2554
- /*<replacement>*/
2555
 
2556
- var processNextTick = __webpack_require__(55);
2557
- /*</replacement>*/
2558
 
2559
- // undocumented cb() API, needed for core, not for public API
2560
- function destroy(err, cb) {
2561
- var _this = this;
2562
 
2563
- var readableDestroyed = this._readableState && this._readableState.destroyed;
2564
- var writableDestroyed = this._writableState && this._writableState.destroyed;
2565
 
2566
- if (readableDestroyed || writableDestroyed) {
2567
- if (cb) {
2568
- cb(err);
2569
- } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
2570
- processNextTick(emitErrorNT, this, err);
2571
- }
2572
- return;
2573
- }
2574
 
2575
- // we set destroyed to true before firing error callbacks in order
2576
- // to make it re-entrance safe in case destroy() is called within callbacks
2577
-
2578
- if (this._readableState) {
2579
- this._readableState.destroyed = true;
2580
- }
2581
-
2582
- // if this is a duplex stream mark the writable part as destroyed as well
2583
- if (this._writableState) {
2584
- this._writableState.destroyed = true;
2585
- }
 
 
2586
 
2587
- this._destroy(err || null, function (err) {
2588
- if (!cb && err) {
2589
- processNextTick(emitErrorNT, _this, err);
2590
- if (_this._writableState) {
2591
- _this._writableState.errorEmitted = true;
2592
- }
2593
- } else if (cb) {
2594
- cb(err);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2595
  }
2596
  });
2597
- }
2598
-
2599
- function undestroy() {
2600
- if (this._readableState) {
2601
- this._readableState.destroyed = false;
2602
- this._readableState.reading = false;
2603
- this._readableState.ended = false;
2604
- this._readableState.endEmitted = false;
2605
- }
2606
-
2607
- if (this._writableState) {
2608
- this._writableState.destroyed = false;
2609
- this._writableState.ended = false;
2610
- this._writableState.ending = false;
2611
- this._writableState.finished = false;
2612
- this._writableState.errorEmitted = false;
2613
- }
2614
- }
2615
-
2616
- function emitErrorNT(self, err) {
2617
- self.emit('error', err);
2618
- }
2619
 
2620
- module.exports = {
2621
- destroy: destroy,
2622
- undestroy: undestroy
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2623
  };
2624
 
2625
  /***/ }),
2626
 
2627
- /***/ 267:
2628
  /***/ (function(module, exports, __webpack_require__) {
2629
 
2630
- "use strict";
2631
- // Copyright Joyent, Inc. and other Node contributors.
2632
- //
2633
- // Permission is hereby granted, free of charge, to any person obtaining a
2634
- // copy of this software and associated documentation files (the
2635
- // "Software"), to deal in the Software without restriction, including
2636
- // without limitation the rights to use, copy, modify, merge, publish,
2637
- // distribute, sublicense, and/or sell copies of the Software, and to permit
2638
- // persons to whom the Software is furnished to do so, subject to the
2639
- // following conditions:
2640
- //
2641
- // The above copyright notice and this permission notice shall be included
2642
- // in all copies or substantial portions of the Software.
2643
- //
2644
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2645
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2646
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2647
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2648
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2649
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2650
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
2651
-
2652
- // a transform stream is a readable/writable stream where you do
2653
- // something with the data. Sometimes it's called a "filter",
2654
- // but that's not a great name for it, since that implies a thing where
2655
- // some bits pass through, and others are simply ignored. (That would
2656
- // be a valid example of a transform, of course.)
2657
- //
2658
- // While the output is causally related to the input, it's not a
2659
- // necessarily symmetric or synchronous transformation. For example,
2660
- // a zlib stream might take multiple plain-text writes(), and then
2661
- // emit a single compressed chunk some time in the future.
2662
- //
2663
- // Here's how this works:
2664
- //
2665
- // The Transform stream has all the aspects of the readable and writable
2666
- // stream classes. When you write(chunk), that calls _write(chunk,cb)
2667
- // internally, and returns false if there's a lot of pending writes
2668
- // buffered up. When you call read(), that calls _read(n) until
2669
- // there's enough pending readable data buffered up.
2670
- //
2671
- // In a transform stream, the written data is placed in a buffer. When
2672
- // _read(n) is called, it transforms the queued up data, calling the
2673
- // buffered _write cb's as it consumes chunks. If consuming a single
2674
- // written chunk would result in multiple output chunks, then the first
2675
- // outputted bit calls the readcb, and subsequent chunks just go into
2676
- // the read buffer, and will cause it to emit 'readable' if necessary.
2677
- //
2678
- // This way, back-pressure is actually determined by the reading side,
2679
- // since _read has to be called to start processing a new chunk. However,
2680
- // a pathological inflate type of transform can cause excessive buffering
2681
- // here. For example, imagine a stream where every byte of input is
2682
- // interpreted as an integer from 0-255, and then results in that many
2683
- // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
2684
- // 1kb of data being output. In this case, you could write a very small
2685
- // amount of input, and end up with a very large amount of output. In
2686
- // such a pathological inflating mechanism, there'd be no way to tell
2687
- // the system to stop doing the transform. A single 4MB write could
2688
- // cause the system to run out of memory.
2689
- //
2690
- // However, even in such a pathological case, only a single written chunk
2691
- // would be consumed, and then the rest would wait (un-transformed) until
2692
- // the results of the previous transformed chunk were consumed.
2693
-
2694
-
2695
-
2696
- module.exports = Transform;
2697
-
2698
- var Duplex = __webpack_require__(32);
2699
-
2700
- /*<replacement>*/
2701
- var util = __webpack_require__(46);
2702
- util.inherits = __webpack_require__(21);
2703
- /*</replacement>*/
2704
-
2705
- util.inherits(Transform, Duplex);
2706
-
2707
- function TransformState(stream) {
2708
- this.afterTransform = function (er, data) {
2709
- return afterTransform(stream, er, data);
2710
- };
2711
-
2712
- this.needTransform = false;
2713
- this.transforming = false;
2714
- this.writecb = null;
2715
- this.writechunk = null;
2716
- this.writeencoding = null;
2717
- }
2718
-
2719
- function afterTransform(stream, er, data) {
2720
- var ts = stream._transformState;
2721
- ts.transforming = false;
2722
-
2723
- var cb = ts.writecb;
2724
-
2725
- if (!cb) {
2726
- return stream.emit('error', new Error('write callback called multiple times'));
2727
- }
2728
-
2729
- ts.writechunk = null;
2730
- ts.writecb = null;
2731
-
2732
- if (data !== null && data !== undefined) stream.push(data);
2733
-
2734
- cb(er);
2735
 
2736
- var rs = stream._readableState;
2737
- rs.reading = false;
2738
- if (rs.needReadable || rs.length < rs.highWaterMark) {
2739
- stream._read(rs.highWaterMark);
2740
- }
2741
- }
2742
 
2743
- function Transform(options) {
2744
- if (!(this instanceof Transform)) return new Transform(options);
2745
 
2746
- Duplex.call(this, options);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2747
 
2748
- this._transformState = new TransformState(this);
2749
 
2750
- var stream = this;
2751
 
2752
- // start out asking for a readable event once data is transformed.
2753
- this._readableState.needReadable = true;
2754
 
2755
- // we have implemented the _read method, and done the other things
2756
- // that Readable wants before the first _read call, so unset the
2757
- // sync guard flag.
2758
- this._readableState.sync = false;
2759
 
2760
- if (options) {
2761
- if (typeof options.transform === 'function') this._transform = options.transform;
2762
 
2763
- if (typeof options.flush === 'function') this._flush = options.flush;
2764
- }
2765
 
2766
- // When the writable side finishes, then flush out anything remaining.
2767
- this.once('prefinish', function () {
2768
- if (typeof this._flush === 'function') this._flush(function (er, data) {
2769
- done(stream, er, data);
2770
- });else done(stream);
2771
- });
2772
- }
2773
 
2774
- Transform.prototype.push = function (chunk, encoding) {
2775
- this._transformState.needTransform = false;
2776
- return Duplex.prototype.push.call(this, chunk, encoding);
2777
- };
2778
-
2779
- // This is the part where you do stuff!
2780
- // override this function in implementation classes.
2781
- // 'chunk' is an input chunk.
2782
- //
2783
- // Call `push(newChunk)` to pass along transformed output
2784
- // to the readable side. You may call 'push' zero or more times.
2785
- //
2786
- // Call `cb(err)` when you are done with this chunk. If you pass
2787
- // an error, then that'll put the hurt on the whole operation. If you
2788
- // never call cb(), then you'll never get another chunk.
2789
- Transform.prototype._transform = function (chunk, encoding, cb) {
2790
- throw new Error('_transform() is not implemented');
2791
- };
2792
-
2793
- Transform.prototype._write = function (chunk, encoding, cb) {
2794
- var ts = this._transformState;
2795
- ts.writecb = cb;
2796
- ts.writechunk = chunk;
2797
- ts.writeencoding = encoding;
2798
- if (!ts.transforming) {
2799
- var rs = this._readableState;
2800
- if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
2801
- }
2802
  };
2803
 
2804
- // Doesn't matter what the args are here.
2805
- // _transform does all the work.
2806
- // That we got here means that the readable side wants more data.
2807
- Transform.prototype._read = function (n) {
2808
- var ts = this._transformState;
2809
-
2810
- if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
2811
- ts.transforming = true;
2812
- this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
2813
- } else {
2814
- // mark that we need a transform, so that any data that comes in
2815
- // will get processed, now that we've asked for it.
2816
- ts.needTransform = true;
2817
- }
2818
  };
2819
 
2820
- Transform.prototype._destroy = function (err, cb) {
2821
- var _this = this;
2822
-
2823
- Duplex.prototype._destroy.call(this, err, function (err2) {
2824
- cb(err2);
2825
- _this.emit('close');
2826
- });
2827
  };
2828
 
2829
- function done(stream, er, data) {
2830
- if (er) return stream.emit('error', er);
2831
-
2832
- if (data !== null && data !== undefined) stream.push(data);
2833
-
2834
- // if there's nothing in the write buffer, then that means
2835
- // that nothing more will ever be provided
2836
- var ws = stream._writableState;
2837
- var ts = stream._transformState;
2838
 
2839
- if (ws.length) throw new Error('Calling transform done when ws.length != 0');
 
 
2840
 
2841
- if (ts.transforming) throw new Error('Calling transform done when still transforming');
 
 
 
2842
 
2843
- return stream.push(null);
2844
- }
 
2845
 
2846
- /***/ }),
 
 
 
 
 
2847
 
2848
- /***/ 268:
2849
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
2850
 
2851
- "use strict";
2852
-
2853
-
2854
- Object.defineProperty(exports, "__esModule", {
2855
- value: true
2856
- });
2857
- exports.default = ProcessNodes;
2858
-
2859
- var _elementTypes = __webpack_require__(443);
 
 
2860
 
2861
- var _elementTypes2 = _interopRequireDefault(_elementTypes);
 
2862
 
2863
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2864
 
2865
- /**
2866
- * Tests a htmlparser2 node and returns whether is it a text node at the start and end of the line containing only
2867
- * white space. This allows these node types to be excluded from the rendering because they are unnecessary.
2868
- *
2869
- * @param {Object} node The element object as created by htmlparser2
2870
- * @returns {boolean} Whether
2871
- */
2872
- var filterOutEmptyTextNodes = function filterOutEmptyTextNodes(node) {
2873
- return !(node.type === 'text' && /\r?\n/.test(node.data) && node.data.trim() === '');
2874
- };
2875
 
2876
- /**
2877
- * Converts a htmlparser2 node to a React element
2878
- *
2879
- * @param {Object} node The htmlparser2 node to convert
2880
- * @param {Number} index The index of the current node
2881
- * @returns {React.Element}
2882
- */
2883
- var convertNodeToElement = function convertNodeToElement(node, index) {
2884
- var key = 'rhp-' + index;
2885
- return _elementTypes2.default[node.type](node, key);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2886
  };
2887
 
2888
- /**
2889
- * Processes the nodes generated by htmlparser2 and convert them all into React elements
2890
- *
2891
- * @param {Object[]} nodes List of nodes to process
2892
- * @returns {React.Element[]} The list of processed React elements
2893
- */
2894
- function ProcessNodes(nodes) {
2895
-
2896
- return nodes.filter(filterOutEmptyTextNodes).map(function (node, index) {
2897
- return convertNodeToElement(node, index);
2898
- });
2899
- }
2900
 
2901
  /***/ }),
2902
-
2903
- /***/ 269:
2904
  /***/ (function(module, exports, __webpack_require__) {
2905
 
2906
  "use strict";
2907
 
2908
 
2909
  Object.defineProperty(exports, "__esModule", {
2910
- value: true
2911
  });
 
2912
 
2913
- 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; };
2914
-
2915
- exports.default = GeneratePropsFromAttributes;
2916
-
2917
- var _HtmlAttributesToReact = __webpack_require__(446);
2918
-
2919
- var _HtmlAttributesToReact2 = _interopRequireDefault(_HtmlAttributesToReact);
2920
 
2921
- var _InlineStyleToObject = __webpack_require__(449);
2922
 
2923
- var _InlineStyleToObject2 = _interopRequireDefault(_InlineStyleToObject);
2924
 
2925
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2926
 
2927
- /**
2928
- * Generates props for a React element from an object of HTML attributes
2929
- *
2930
- * @param {Object} attributes The HTML attributes
2931
- * @param {String} key The key to give the react element
2932
- */
2933
- function GeneratePropsFromAttributes(attributes, key) {
2934
 
2935
- // generate props
2936
- var props = _extends({}, (0, _HtmlAttributesToReact2.default)(attributes), { key: key });
2937
 
2938
- // if there is a style prop then convert it to a React style object
2939
- if (props.style) {
2940
- props.style = (0, _InlineStyleToObject2.default)(props.style);
2941
- }
2942
 
2943
- return props;
2944
- }
 
2945
 
2946
- /***/ }),
 
 
 
 
 
 
2947
 
2948
- /***/ 32:
2949
- /***/ (function(module, exports, __webpack_require__) {
2950
-
2951
- "use strict";
2952
- // Copyright Joyent, Inc. and other Node contributors.
2953
- //
2954
- // Permission is hereby granted, free of charge, to any person obtaining a
2955
- // copy of this software and associated documentation files (the
2956
- // "Software"), to deal in the Software without restriction, including
2957
- // without limitation the rights to use, copy, modify, merge, publish,
2958
- // distribute, sublicense, and/or sell copies of the Software, and to permit
2959
- // persons to whom the Software is furnished to do so, subject to the
2960
- // following conditions:
2961
- //
2962
- // The above copyright notice and this permission notice shall be included
2963
- // in all copies or substantial portions of the Software.
2964
- //
2965
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2966
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2967
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2968
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2969
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2970
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2971
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
2972
-
2973
- // a duplex stream is just a stream that is both readable and writable.
2974
- // Since JS doesn't have multiple prototypal inheritance, this class
2975
- // prototypally inherits from Readable, and then parasitically from
2976
- // Writable.
2977
-
2978
-
2979
-
2980
- /*<replacement>*/
2981
-
2982
- var processNextTick = __webpack_require__(55);
2983
- /*</replacement>*/
2984
-
2985
- /*<replacement>*/
2986
- var objectKeys = Object.keys || function (obj) {
2987
- var keys = [];
2988
- for (var key in obj) {
2989
- keys.push(key);
2990
- }return keys;
2991
- };
2992
- /*</replacement>*/
2993
-
2994
- module.exports = Duplex;
2995
-
2996
- /*<replacement>*/
2997
- var util = __webpack_require__(46);
2998
- util.inherits = __webpack_require__(21);
2999
- /*</replacement>*/
3000
-
3001
- var Readable = __webpack_require__(263);
3002
- var Writable = __webpack_require__(91);
3003
-
3004
- util.inherits(Duplex, Readable);
3005
-
3006
- var keys = objectKeys(Writable.prototype);
3007
- for (var v = 0; v < keys.length; v++) {
3008
- var method = keys[v];
3009
- if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
3010
- }
3011
-
3012
- function Duplex(options) {
3013
- if (!(this instanceof Duplex)) return new Duplex(options);
3014
-
3015
- Readable.call(this, options);
3016
- Writable.call(this, options);
3017
-
3018
- if (options && options.readable === false) this.readable = false;
3019
-
3020
- if (options && options.writable === false) this.writable = false;
3021
-
3022
- this.allowHalfOpen = true;
3023
- if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
3024
-
3025
- this.once('end', onend);
3026
- }
3027
-
3028
- // the no-half-open enforcer
3029
- function onend() {
3030
- // if we allow half-open state, or if the writable side ended,
3031
- // then we're ok.
3032
- if (this.allowHalfOpen || this._writableState.ended) return;
3033
-
3034
- // no more data can be written.
3035
- // But allow more writes to happen in this tick.
3036
- processNextTick(onEndNT, this);
3037
- }
3038
-
3039
- function onEndNT(self) {
3040
- self.end();
3041
- }
3042
 
3043
- Object.defineProperty(Duplex.prototype, 'destroyed', {
3044
- get: function () {
3045
- if (this._readableState === undefined || this._writableState === undefined) {
3046
- return false;
3047
- }
3048
- return this._readableState.destroyed && this._writableState.destroyed;
3049
- },
3050
- set: function (value) {
3051
- // we ignore the value if the stream
3052
- // has not been initialized yet
3053
- if (this._readableState === undefined || this._writableState === undefined) {
3054
- return;
3055
- }
3056
 
3057
- // backward compatibility, the user is explicitly
3058
- // managing destroyed
3059
- this._readableState.destroyed = value;
3060
- this._writableState.destroyed = value;
3061
- }
3062
- });
3063
 
3064
- Duplex.prototype._destroy = function (err, cb) {
3065
- this.push(null);
3066
- this.end();
3067
 
3068
- processNextTick(cb, err);
 
 
3069
  };
3070
 
3071
- function forEach(xs, f) {
3072
- for (var i = 0, l = xs.length; i < l; i++) {
3073
- f(xs[i], i);
3074
- }
3075
- }
3076
-
3077
- /***/ }),
3078
-
3079
- /***/ 37:
3080
- /***/ (function(module, exports, __webpack_require__) {
3081
-
3082
- var Parser = __webpack_require__(257),
3083
- DomHandler = __webpack_require__(412);
3084
-
3085
- function defineProp(name, value){
3086
- delete module.exports[name];
3087
- module.exports[name] = value;
3088
- return value;
3089
- }
3090
-
3091
- module.exports = {
3092
- Parser: Parser,
3093
- Tokenizer: __webpack_require__(258),
3094
- ElementType: __webpack_require__(45),
3095
- DomHandler: DomHandler,
3096
- get FeedHandler(){
3097
- return defineProp("FeedHandler", __webpack_require__(414));
3098
- },
3099
- get Stream(){
3100
- return defineProp("Stream", __webpack_require__(415));
3101
- },
3102
- get WritableStream(){
3103
- return defineProp("WritableStream", __webpack_require__(262));
3104
- },
3105
- get ProxyHandler(){
3106
- return defineProp("ProxyHandler", __webpack_require__(429));
3107
- },
3108
- get DomUtils(){
3109
- return defineProp("DomUtils", __webpack_require__(430));
3110
- },
3111
- get CollectingHandler(){
3112
- return defineProp("CollectingHandler", __webpack_require__(442));
3113
- },
3114
- // For legacy support
3115
- DefaultHandler: DomHandler,
3116
- get RssHandler(){
3117
- return defineProp("RssHandler", this.FeedHandler);
3118
- },
3119
- //helper methods
3120
- parseDOM: function(data, options){
3121
- var handler = new DomHandler(options);
3122
- new Parser(handler, options).end(data);
3123
- return handler.dom;
3124
- },
3125
- parseFeed: function(feed, options){
3126
- var handler = new module.exports.FeedHandler(options);
3127
- new Parser(handler, options).end(feed);
3128
- return handler.dom;
3129
- },
3130
- createDomStream: function(cb, options, elementCb){
3131
- var handler = new DomHandler(cb, options, elementCb);
3132
- return new Parser(handler, options);
3133
- },
3134
- // List of all events that the parser emits
3135
- EVENTS: { /* Format: eventname: number of arguments */
3136
- attribute: 2,
3137
- cdatastart: 0,
3138
- cdataend: 0,
3139
- text: 1,
3140
- processinginstruction: 2,
3141
- comment: 1,
3142
- commentend: 0,
3143
- closetag: 1,
3144
- opentag: 2,
3145
- opentagname: 1,
3146
- error: 1,
3147
- end: 0
3148
- }
3149
  };
3150
 
3151
-
3152
- /***/ }),
3153
-
3154
- /***/ 38:
3155
- /***/ (function(module, exports, __webpack_require__) {
3156
-
3157
- /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["Backbone"] = __webpack_require__(474);
3158
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
3159
-
3160
  /***/ }),
3161
-
3162
- /***/ 409:
3163
  /***/ (function(module, exports, __webpack_require__) {
3164
 
3165
  "use strict";
3166
 
3167
 
3168
  Object.defineProperty(exports, "__esModule", {
3169
- value: true
3170
  });
 
3171
 
3172
- var _HtmlParser = __webpack_require__(410);
3173
-
3174
- var _HtmlParser2 = _interopRequireDefault(_HtmlParser);
3175
-
3176
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3177
-
3178
- exports.default = _HtmlParser2.default;
3179
-
3180
- /***/ }),
3181
-
3182
- /***/ 410:
3183
- /***/ (function(module, exports, __webpack_require__) {
3184
-
3185
- "use strict";
3186
-
3187
-
3188
- Object.defineProperty(exports, "__esModule", {
3189
- value: true
3190
- });
3191
- exports.default = HtmlParser;
3192
 
3193
- var _htmlparser = __webpack_require__(37);
3194
 
3195
- var _htmlparser2 = _interopRequireDefault(_htmlparser);
3196
 
3197
- var _ProcessNodes = __webpack_require__(268);
3198
 
3199
- var _ProcessNodes2 = _interopRequireDefault(_ProcessNodes);
3200
 
3201
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3202
 
3203
- /**
3204
- * Parses a HTML string and returns a list of React components generated from it
3205
- *
3206
- * @param {String} html The HTML to convert into React components
3207
- * @returns {Array} List of top level React elements
3208
- */
3209
- function HtmlParser(html) {
3210
- var nodes = _htmlparser2.default.parseDOM(html);
3211
- return (0, _ProcessNodes2.default)(nodes);
3212
- }
3213
 
3214
- /***/ }),
 
 
 
3215
 
3216
- /***/ 411:
3217
- /***/ (function(module, exports) {
3218
 
3219
- 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}
 
 
3220
 
3221
- /***/ }),
 
 
 
 
3222
 
3223
- /***/ 412:
3224
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
3225
 
3226
- var ElementType = __webpack_require__(45);
3227
-
3228
- var re_whitespace = /\s+/g;
3229
- var NodePrototype = __webpack_require__(261);
3230
- var ElementPrototype = __webpack_require__(413);
3231
-
3232
- function DomHandler(callback, options, elementCB){
3233
- if(typeof callback === "object"){
3234
- elementCB = options;
3235
- options = callback;
3236
- callback = null;
3237
- } else if(typeof options === "function"){
3238
- elementCB = options;
3239
- options = defaultOpts;
3240
- }
3241
- this._callback = callback;
3242
- this._options = options || defaultOpts;
3243
- this._elementCB = elementCB;
3244
- this.dom = [];
3245
- this._done = false;
3246
- this._tagStack = [];
3247
- this._parser = this._parser || null;
3248
- }
3249
 
3250
- //default options
3251
- var defaultOpts = {
3252
- normalizeWhitespace: false, //Replace all whitespace with single spaces
3253
- withStartIndices: false, //Add startIndex properties to nodes
3254
- withEndIndices: false, //Add endIndex properties to nodes
3255
  };
3256
 
3257
- DomHandler.prototype.onparserinit = function(parser){
3258
- this._parser = parser;
3259
  };
3260
 
3261
- //Resets the handler back to starting state
3262
- DomHandler.prototype.onreset = function(){
3263
- DomHandler.call(this, this._callback, this._options, this._elementCB);
3264
- };
 
 
3265
 
3266
- //Signals the handler that parsing is done
3267
- DomHandler.prototype.onend = function(){
3268
- if(this._done) return;
3269
- this._done = true;
3270
- this._parser = null;
3271
- this._handleCallback(null);
3272
  };
3273
 
3274
- DomHandler.prototype._handleCallback =
3275
- DomHandler.prototype.onerror = function(error){
3276
- if(typeof this._callback === "function"){
3277
- this._callback(error, this.dom);
3278
- } else {
3279
- if(error) throw error;
3280
- }
3281
- };
3282
 
3283
- DomHandler.prototype.onclosetag = function(){
3284
- //if(this._tagStack.pop().name !== name) this._handleCallback(Error("Tagname didn't match!"));
3285
-
3286
- var elem = this._tagStack.pop();
3287
 
3288
- if(this._options.withEndIndices){
3289
- elem.endIndex = this._parser.endIndex;
3290
- }
3291
 
3292
- if(this._elementCB) this._elementCB(elem);
3293
  };
3294
 
3295
- DomHandler.prototype._createDomElement = function(properties){
3296
- if (!this._options.withDomLvl1) return properties;
3297
-
3298
- var element;
3299
- if (properties.type === "tag") {
3300
- element = Object.create(ElementPrototype);
3301
- } else {
3302
- element = Object.create(NodePrototype);
3303
- }
3304
-
3305
- for (var key in properties) {
3306
- if (properties.hasOwnProperty(key)) {
3307
- element[key] = properties[key];
3308
- }
3309
- }
3310
-
3311
- return element;
3312
  };
3313
 
3314
- DomHandler.prototype._addDomElement = function(element){
3315
- var parent = this._tagStack[this._tagStack.length - 1];
3316
- var siblings = parent ? parent.children : this.dom;
3317
- var previousSibling = siblings[siblings.length - 1];
 
 
 
3318
 
3319
- element.next = null;
 
 
 
 
3320
 
3321
- if(this._options.withStartIndices){
3322
- element.startIndex = this._parser.startIndex;
3323
- }
3324
- if(this._options.withEndIndices){
3325
- element.endIndex = this._parser.endIndex;
3326
- }
3327
 
3328
- if(previousSibling){
3329
- element.prev = previousSibling;
3330
- previousSibling.next = element;
3331
- } else {
3332
- element.prev = null;
3333
- }
3334
 
3335
- siblings.push(element);
3336
- element.parent = parent || null;
3337
  };
3338
 
3339
- DomHandler.prototype.onopentag = function(name, attribs){
3340
- var properties = {
3341
- type: name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag,
3342
- name: name,
3343
- attribs: attribs,
3344
- children: []
3345
- };
3346
-
3347
- var element = this._createDomElement(properties);
3348
-
3349
- this._addDomElement(element);
3350
-
3351
- this._tagStack.push(element);
3352
  };
3353
 
3354
- DomHandler.prototype.ontext = function(data){
3355
- //the ignoreWhitespace is officially dropped, but for now,
3356
- //it's an alias for normalizeWhitespace
3357
- var normalize = this._options.normalizeWhitespace || this._options.ignoreWhitespace;
3358
-
3359
- var lastTag;
3360
-
3361
- if(!this._tagStack.length && this.dom.length && (lastTag = this.dom[this.dom.length-1]).type === ElementType.Text){
3362
- if(normalize){
3363
- lastTag.data = (lastTag.data + data).replace(re_whitespace, " ");
3364
- } else {
3365
- lastTag.data += data;
3366
- }
3367
- } else {
3368
- if(
3369
- this._tagStack.length &&
3370
- (lastTag = this._tagStack[this._tagStack.length - 1]) &&
3371
- (lastTag = lastTag.children[lastTag.children.length - 1]) &&
3372
- lastTag.type === ElementType.Text
3373
- ){
3374
- if(normalize){
3375
- lastTag.data = (lastTag.data + data).replace(re_whitespace, " ");
3376
- } else {
3377
- lastTag.data += data;
3378
- }
3379
- } else {
3380
- if(normalize){
3381
- data = data.replace(re_whitespace, " ");
3382
- }
3383
-
3384
- var element = this._createDomElement({
3385
- data: data,
3386
- type: ElementType.Text
3387
- });
3388
-
3389
- this._addDomElement(element);
3390
- }
3391
- }
3392
  };
3393
 
3394
- DomHandler.prototype.oncomment = function(data){
3395
- var lastTag = this._tagStack[this._tagStack.length - 1];
 
 
 
 
 
 
 
3396
 
3397
- if(lastTag && lastTag.type === ElementType.Comment){
3398
- lastTag.data += data;
3399
- return;
3400
- }
 
 
3401
 
3402
- var properties = {
3403
- data: data,
3404
- type: ElementType.Comment
3405
- };
 
 
 
 
 
 
3406
 
3407
- var element = this._createDomElement(properties);
 
 
 
3408
 
3409
- this._addDomElement(element);
3410
- this._tagStack.push(element);
 
 
 
 
 
 
 
 
3411
  };
3412
 
3413
- DomHandler.prototype.oncdatastart = function(){
3414
- var properties = {
3415
- children: [{
3416
- data: "",
3417
- type: ElementType.Text
3418
- }],
3419
- type: ElementType.CDATA
3420
- };
3421
-
3422
- var element = this._createDomElement(properties);
3423
-
3424
- this._addDomElement(element);
3425
- this._tagStack.push(element);
3426
  };
3427
 
3428
- DomHandler.prototype.oncommentend = DomHandler.prototype.oncdataend = function(){
3429
- this._tagStack.pop();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3430
  };
3431
 
3432
- DomHandler.prototype.onprocessinginstruction = function(name, data){
3433
- var element = this._createDomElement({
3434
- name: name,
3435
- data: data,
3436
- type: ElementType.Directive
3437
- });
3438
 
3439
- this._addDomElement(element);
3440
- };
3441
 
3442
- module.exports = DomHandler;
3443
 
 
 
 
3444
 
3445
- /***/ }),
3446
 
3447
- /***/ 413:
3448
- /***/ (function(module, exports, __webpack_require__) {
3449
 
3450
- // DOM-Level-1-compliant structure
3451
- var NodePrototype = __webpack_require__(261);
3452
- var ElementPrototype = module.exports = Object.create(NodePrototype);
3453
-
3454
- var domLvl1 = {
3455
- tagName: "name"
3456
- };
3457
-
3458
- Object.keys(domLvl1).forEach(function(key) {
3459
- var shorthand = domLvl1[key];
3460
- Object.defineProperty(ElementPrototype, key, {
3461
- get: function() {
3462
- return this[shorthand] || null;
3463
- },
3464
- set: function(val) {
3465
- this[shorthand] = val;
3466
- return val;
3467
- }
3468
- });
3469
- });
3470
 
 
3471
 
3472
- /***/ }),
3473
 
3474
- /***/ 414:
3475
- /***/ (function(module, exports, __webpack_require__) {
3476
 
3477
- var index = __webpack_require__(37),
3478
- DomHandler = index.DomHandler,
3479
- DomUtils = index.DomUtils;
3480
 
3481
- //TODO: make this a streamable handler
3482
- function FeedHandler(callback, options){
3483
- this.init(callback, options);
3484
- }
3485
 
3486
- __webpack_require__(21)(FeedHandler, DomHandler);
3487
 
3488
- FeedHandler.prototype.init = DomHandler;
3489
 
3490
- function getElements(what, where){
3491
- return DomUtils.getElementsByTagName(what, where, true);
3492
- }
3493
- function getOneElement(what, where){
3494
- return DomUtils.getElementsByTagName(what, where, true, 1)[0];
3495
- }
3496
- function fetch(what, where, recurse){
3497
- return DomUtils.getText(
3498
- DomUtils.getElementsByTagName(what, where, recurse, 1)
3499
- ).trim();
3500
- }
3501
 
3502
- function addConditionally(obj, prop, what, where, recurse){
3503
- var tmp = fetch(what, where, recurse);
3504
- if(tmp) obj[prop] = tmp;
3505
- }
3506
 
3507
- var isValidFeed = function(value){
3508
- return value === "rss" || value === "feed" || value === "rdf:RDF";
3509
- };
3510
-
3511
- FeedHandler.prototype.onend = function(){
3512
- var feed = {},
3513
- feedRoot = getOneElement(isValidFeed, this.dom),
3514
- tmp, childs;
3515
-
3516
- if(feedRoot){
3517
- if(feedRoot.name === "feed"){
3518
- childs = feedRoot.children;
3519
-
3520
- feed.type = "atom";
3521
- addConditionally(feed, "id", "id", childs);
3522
- addConditionally(feed, "title", "title", childs);
3523
- if((tmp = getOneElement("link", childs)) && (tmp = tmp.attribs) && (tmp = tmp.href)) feed.link = tmp;
3524
- addConditionally(feed, "description", "subtitle", childs);
3525
- if((tmp = fetch("updated", childs))) feed.updated = new Date(tmp);
3526
- addConditionally(feed, "author", "email", childs, true);
3527
-
3528
- feed.items = getElements("entry", childs).map(function(item){
3529
- var entry = {}, tmp;
3530
-
3531
- item = item.children;
3532
-
3533
- addConditionally(entry, "id", "id", item);
3534
- addConditionally(entry, "title", "title", item);
3535
- if((tmp = getOneElement("link", item)) && (tmp = tmp.attribs) && (tmp = tmp.href)) entry.link = tmp;
3536
- if((tmp = fetch("summary", item) || fetch("content", item))) entry.description = tmp;
3537
- if((tmp = fetch("updated", item))) entry.pubDate = new Date(tmp);
3538
- return entry;
3539
- });
3540
- } else {
3541
- childs = getOneElement("channel", feedRoot.children).children;
3542
-
3543
- feed.type = feedRoot.name.substr(0, 3);
3544
- feed.id = "";
3545
- addConditionally(feed, "title", "title", childs);
3546
- addConditionally(feed, "link", "link", childs);
3547
- addConditionally(feed, "description", "description", childs);
3548
- if((tmp = fetch("lastBuildDate", childs))) feed.updated = new Date(tmp);
3549
- addConditionally(feed, "author", "managingEditor", childs, true);
3550
-
3551
- feed.items = getElements("item", feedRoot.children).map(function(item){
3552
- var entry = {}, tmp;
3553
-
3554
- item = item.children;
3555
-
3556
- addConditionally(entry, "id", "guid", item);
3557
- addConditionally(entry, "title", "title", item);
3558
- addConditionally(entry, "link", "link", item);
3559
- addConditionally(entry, "description", "description", item);
3560
- if((tmp = fetch("pubDate", item))) entry.pubDate = new Date(tmp);
3561
- return entry;
3562
- });
3563
- }
3564
- }
3565
- this.dom = feed;
3566
- DomHandler.prototype._handleCallback.call(
3567
- this, feedRoot ? null : Error("couldn't find root of feed")
3568
- );
3569
- };
3570
-
3571
- module.exports = FeedHandler;
3572
 
 
3573
 
3574
- /***/ }),
3575
 
3576
- /***/ 415:
3577
- /***/ (function(module, exports, __webpack_require__) {
3578
 
3579
- module.exports = Stream;
3580
 
3581
- var Parser = __webpack_require__(262);
3582
 
3583
- function Stream(options){
3584
- Parser.call(this, new Cbs(this), options);
3585
- }
3586
 
3587
- __webpack_require__(21)(Stream, Parser);
3588
 
3589
- Stream.prototype.readable = true;
3590
 
3591
- function Cbs(scope){
3592
- this.scope = scope;
3593
- }
3594
 
3595
- var EVENTS = __webpack_require__(37).EVENTS;
3596
-
3597
- Object.keys(EVENTS).forEach(function(name){
3598
- if(EVENTS[name] === 0){
3599
- Cbs.prototype["on" + name] = function(){
3600
- this.scope.emit(name);
3601
- };
3602
- } else if(EVENTS[name] === 1){
3603
- Cbs.prototype["on" + name] = function(a){
3604
- this.scope.emit(name, a);
3605
- };
3606
- } else if(EVENTS[name] === 2){
3607
- Cbs.prototype["on" + name] = function(a, b){
3608
- this.scope.emit(name, a, b);
3609
- };
3610
- } else {
3611
- throw Error("wrong number of arguments!");
3612
- }
3613
- });
3614
 
3615
- /***/ }),
3616
 
3617
- /***/ 416:
3618
- /***/ (function(module, exports, __webpack_require__) {
3619
 
3620
- // Copyright Joyent, Inc. and other Node contributors.
3621
- //
3622
- // Permission is hereby granted, free of charge, to any person obtaining a
3623
- // copy of this software and associated documentation files (the
3624
- // "Software"), to deal in the Software without restriction, including
3625
- // without limitation the rights to use, copy, modify, merge, publish,
3626
- // distribute, sublicense, and/or sell copies of the Software, and to permit
3627
- // persons to whom the Software is furnished to do so, subject to the
3628
- // following conditions:
3629
- //
3630
- // The above copyright notice and this permission notice shall be included
3631
- // in all copies or substantial portions of the Software.
3632
- //
3633
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
3634
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3635
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
3636
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
3637
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
3638
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
3639
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
3640
-
3641
- module.exports = Stream;
3642
-
3643
- var EE = __webpack_require__(54).EventEmitter;
3644
- var inherits = __webpack_require__(21);
3645
-
3646
- inherits(Stream, EE);
3647
- Stream.Readable = __webpack_require__(89);
3648
- Stream.Writable = __webpack_require__(424);
3649
- Stream.Duplex = __webpack_require__(425);
3650
- Stream.Transform = __webpack_require__(426);
3651
- Stream.PassThrough = __webpack_require__(427);
3652
-
3653
- // Backwards-compat with node 0.4.x
3654
- Stream.Stream = Stream;
3655
-
3656
-
3657
-
3658
- // old-style streams. Note that the pipe method (the only relevant
3659
- // part of this class) is overridden in the Readable class.
3660
-
3661
- function Stream() {
3662
- EE.call(this);
3663
- }
3664
 
3665
- Stream.prototype.pipe = function(dest, options) {
3666
- var source = this;
3667
 
3668
- function ondata(chunk) {
3669
- if (dest.writable) {
3670
- if (false === dest.write(chunk) && source.pause) {
3671
- source.pause();
3672
- }
3673
- }
3674
- }
3675
 
3676
- source.on('data', ondata);
3677
 
3678
- function ondrain() {
3679
- if (source.readable && source.resume) {
3680
- source.resume();
3681
- }
3682
- }
3683
 
3684
- dest.on('drain', ondrain);
3685
 
3686
- // If the 'end' option is not supplied, dest.end() will be called when
3687
- // source gets the 'end' or 'close' events. Only dest.end() once.
3688
- if (!dest._isStdio && (!options || options.end !== false)) {
3689
- source.on('end', onend);
3690
- source.on('close', onclose);
3691
- }
3692
 
3693
- var didOnEnd = false;
3694
- function onend() {
3695
- if (didOnEnd) return;
3696
- didOnEnd = true;
3697
 
3698
- dest.end();
3699
- }
 
 
 
 
 
 
 
 
 
 
 
3700
 
 
3701
 
3702
- function onclose() {
3703
- if (didOnEnd) return;
3704
- didOnEnd = true;
3705
 
3706
- if (typeof dest.destroy === 'function') dest.destroy();
3707
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3708
 
3709
- // don't leave dangling pipes when there are errors.
3710
- function onerror(er) {
3711
- cleanup();
3712
- if (EE.listenerCount(this, 'error') === 0) {
3713
- throw er; // Unhandled stream error in pipe.
3714
- }
3715
- }
3716
 
3717
- source.on('error', onerror);
3718
- dest.on('error', onerror);
 
 
 
 
 
 
3719
 
3720
- // remove all the event listeners that were added.
3721
- function cleanup() {
3722
- source.removeListener('data', ondata);
3723
- dest.removeListener('drain', ondrain);
 
 
 
 
 
 
3724
 
3725
- source.removeListener('end', onend);
3726
- source.removeListener('close', onclose);
 
 
 
 
3727
 
3728
- source.removeListener('error', onerror);
3729
- dest.removeListener('error', onerror);
 
 
 
3730
 
3731
- source.removeListener('end', cleanup);
3732
- source.removeListener('close', cleanup);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3733
 
3734
- dest.removeListener('close', cleanup);
3735
- }
3736
 
3737
- source.on('end', cleanup);
3738
- source.on('close', cleanup);
3739
 
3740
- dest.on('close', cleanup);
3741
 
3742
- dest.emit('pipe', source);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3743
 
3744
- // Allow for unix-like usage: A.pipe(B).pipe(C)
3745
- return dest;
3746
  };
3747
 
3748
-
3749
  /***/ }),
3750
-
3751
- /***/ 417:
3752
  /***/ (function(module, exports, __webpack_require__) {
3753
 
3754
  "use strict";
3755
 
3756
 
3757
- exports.byteLength = byteLength
3758
- exports.toByteArray = toByteArray
3759
- exports.fromByteArray = fromByteArray
 
 
 
3760
 
3761
- var lookup = []
3762
- var revLookup = []
3763
- var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
3764
 
3765
- var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
3766
- for (var i = 0, len = code.length; i < len; ++i) {
3767
- lookup[i] = code[i]
3768
- revLookup[code.charCodeAt(i)] = i
3769
- }
 
 
 
 
 
 
3770
 
3771
- revLookup['-'.charCodeAt(0)] = 62
3772
- revLookup['_'.charCodeAt(0)] = 63
3773
 
3774
- function placeHoldersCount (b64) {
3775
- var len = b64.length
3776
- if (len % 4 > 0) {
3777
- throw new Error('Invalid string. Length must be a multiple of 4')
3778
- }
3779
 
3780
- // the number of equal signs (place holders)
3781
- // if there are two placeholders, than the two characters before it
3782
- // represent one byte
3783
- // if there is only one, then the three characters before it represent 2 bytes
3784
- // this is just a cheap hack to not do indexOf twice
3785
- return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
3786
- }
3787
 
3788
- function byteLength (b64) {
3789
- // base64 is 4/3 + up to two characters of the original data
3790
- return (b64.length * 3 / 4) - placeHoldersCount(b64)
3791
- }
3792
 
3793
- function toByteArray (b64) {
3794
- var i, l, tmp, placeHolders, arr
3795
- var len = b64.length
3796
- placeHolders = placeHoldersCount(b64)
3797
 
3798
- arr = new Arr((len * 3 / 4) - placeHolders)
3799
 
3800
- // if there are placeholders, only get up to the last complete 4 chars
3801
- l = placeHolders > 0 ? len - 4 : len
3802
 
3803
- var L = 0
3804
 
3805
- for (i = 0; i < l; i += 4) {
3806
- tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
3807
- arr[L++] = (tmp >> 16) & 0xFF
3808
- arr[L++] = (tmp >> 8) & 0xFF
3809
- arr[L++] = tmp & 0xFF
3810
- }
3811
 
3812
- if (placeHolders === 2) {
3813
- tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
3814
- arr[L++] = tmp & 0xFF
3815
- } else if (placeHolders === 1) {
3816
- tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
3817
- arr[L++] = (tmp >> 8) & 0xFF
3818
- arr[L++] = tmp & 0xFF
3819
- }
3820
 
3821
- return arr
3822
- }
3823
 
3824
- function tripletToBase64 (num) {
3825
- return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
3826
- }
3827
 
3828
- function encodeChunk (uint8, start, end) {
3829
- var tmp
3830
- var output = []
3831
- for (var i = start; i < end; i += 3) {
3832
- tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
3833
- output.push(tripletToBase64(tmp))
3834
- }
3835
- return output.join('')
3836
- }
3837
 
3838
- function fromByteArray (uint8) {
3839
- var tmp
3840
- var len = uint8.length
3841
- var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
3842
- var output = ''
3843
- var parts = []
3844
- var maxChunkLength = 16383 // must be multiple of 3
3845
-
3846
- // go through the array every three bytes, we'll deal with trailing stuff later
3847
- for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
3848
- parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
3849
- }
3850
 
3851
- // pad the end with zeros, but make sure to not forget the extra bytes
3852
- if (extraBytes === 1) {
3853
- tmp = uint8[len - 1]
3854
- output += lookup[tmp >> 2]
3855
- output += lookup[(tmp << 4) & 0x3F]
3856
- output += '=='
3857
- } else if (extraBytes === 2) {
3858
- tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
3859
- output += lookup[tmp >> 10]
3860
- output += lookup[(tmp >> 4) & 0x3F]
3861
- output += lookup[(tmp << 2) & 0x3F]
3862
- output += '='
3863
- }
3864
 
3865
- parts.push(output)
3866
 
3867
- return parts.join('')
3868
- }
3869
 
 
 
 
 
 
 
3870
 
3871
- /***/ }),
 
 
 
 
 
3872
 
3873
- /***/ 418:
3874
- /***/ (function(module, exports) {
 
 
 
3875
 
3876
- exports.read = function (buffer, offset, isLE, mLen, nBytes) {
3877
- var e, m
3878
- var eLen = nBytes * 8 - mLen - 1
3879
- var eMax = (1 << eLen) - 1
3880
- var eBias = eMax >> 1
3881
- var nBits = -7
3882
- var i = isLE ? (nBytes - 1) : 0
3883
- var d = isLE ? -1 : 1
3884
- var s = buffer[offset + i]
3885
-
3886
- i += d
3887
-
3888
- e = s & ((1 << (-nBits)) - 1)
3889
- s >>= (-nBits)
3890
- nBits += eLen
3891
- for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
3892
-
3893
- m = e & ((1 << (-nBits)) - 1)
3894
- e >>= (-nBits)
3895
- nBits += mLen
3896
- for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
3897
-
3898
- if (e === 0) {
3899
- e = 1 - eBias
3900
- } else if (e === eMax) {
3901
- return m ? NaN : ((s ? -1 : 1) * Infinity)
3902
- } else {
3903
- m = m + Math.pow(2, mLen)
3904
- e = e - eBias
3905
- }
3906
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
3907
- }
3908
 
3909
- exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
3910
- var e, m, c
3911
- var eLen = nBytes * 8 - mLen - 1
3912
- var eMax = (1 << eLen) - 1
3913
- var eBias = eMax >> 1
3914
- var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
3915
- var i = isLE ? 0 : (nBytes - 1)
3916
- var d = isLE ? 1 : -1
3917
- var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
3918
-
3919
- value = Math.abs(value)
3920
-
3921
- if (isNaN(value) || value === Infinity) {
3922
- m = isNaN(value) ? 1 : 0
3923
- e = eMax
3924
- } else {
3925
- e = Math.floor(Math.log(value) / Math.LN2)
3926
- if (value * (c = Math.pow(2, -e)) < 1) {
3927
- e--
3928
- c *= 2
3929
- }
3930
- if (e + eBias >= 1) {
3931
- value += rt / c
3932
- } else {
3933
- value += rt * Math.pow(2, 1 - eBias)
3934
- }
3935
- if (value * c >= 2) {
3936
- e++
3937
- c /= 2
3938
- }
3939
 
3940
- if (e + eBias >= eMax) {
3941
- m = 0
3942
- e = eMax
3943
- } else if (e + eBias >= 1) {
3944
- m = (value * c - 1) * Math.pow(2, mLen)
3945
- e = e + eBias
3946
- } else {
3947
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
3948
- e = 0
3949
- }
3950
- }
3951
 
3952
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
 
 
 
 
 
 
 
 
 
 
 
 
 
3953
 
3954
- e = (e << mLen) | m
3955
- eLen += mLen
3956
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
 
 
 
 
 
 
3957
 
3958
- buffer[offset + i - d] |= s * 128
3959
- }
 
3960
 
 
 
 
 
 
 
 
3961
 
3962
- /***/ }),
 
 
3963
 
3964
- /***/ 419:
3965
- /***/ (function(module, exports) {
3966
 
3967
- /* (ignored) */
 
 
 
3968
 
3969
- /***/ }),
 
3970
 
3971
- /***/ 420:
3972
- /***/ (function(module, exports, __webpack_require__) {
3973
 
3974
- "use strict";
 
 
 
 
 
 
 
 
3975
 
 
 
3976
 
3977
- /*<replacement>*/
 
 
 
 
 
 
 
 
 
 
 
 
 
3978
 
3979
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
3980
 
3981
- var Buffer = __webpack_require__(56).Buffer;
3982
- /*</replacement>*/
 
 
 
 
 
 
 
 
 
 
 
3983
 
3984
- function copyBuffer(src, target, offset) {
3985
- src.copy(target, offset);
3986
- }
 
 
 
 
 
3987
 
3988
- module.exports = function () {
3989
- function BufferList() {
3990
- _classCallCheck(this, BufferList);
 
 
 
 
 
 
3991
 
3992
- this.head = null;
3993
- this.tail = null;
3994
- this.length = 0;
3995
- }
 
 
 
 
 
3996
 
3997
- BufferList.prototype.push = function push(v) {
3998
- var entry = { data: v, next: null };
3999
- if (this.length > 0) this.tail.next = entry;else this.head = entry;
4000
- this.tail = entry;
4001
- ++this.length;
4002
- };
 
 
 
 
 
 
 
4003
 
4004
- BufferList.prototype.unshift = function unshift(v) {
4005
- var entry = { data: v, next: this.head };
4006
- if (this.length === 0) this.tail = entry;
4007
- this.head = entry;
4008
- ++this.length;
4009
- };
4010
 
4011
- BufferList.prototype.shift = function shift() {
4012
- if (this.length === 0) return;
4013
- var ret = this.head.data;
4014
- if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
4015
- --this.length;
4016
- return ret;
4017
- };
4018
 
4019
- BufferList.prototype.clear = function clear() {
4020
- this.head = this.tail = null;
4021
- this.length = 0;
4022
- };
 
 
 
 
 
 
 
4023
 
4024
- BufferList.prototype.join = function join(s) {
4025
- if (this.length === 0) return '';
4026
- var p = this.head;
4027
- var ret = '' + p.data;
4028
- while (p = p.next) {
4029
- ret += s + p.data;
4030
- }return ret;
4031
- };
4032
 
4033
- BufferList.prototype.concat = function concat(n) {
4034
- if (this.length === 0) return Buffer.alloc(0);
4035
- if (this.length === 1) return this.head.data;
4036
- var ret = Buffer.allocUnsafe(n >>> 0);
4037
- var p = this.head;
4038
- var i = 0;
4039
- while (p) {
4040
- copyBuffer(p.data, ret, i);
4041
- i += p.data.length;
4042
- p = p.next;
4043
- }
4044
- return ret;
4045
- };
4046
 
4047
- return BufferList;
4048
- }();
 
4049
 
4050
- /***/ }),
4051
-
4052
- /***/ 422:
4053
- /***/ (function(module, exports, __webpack_require__) {
4054
-
4055
- /* WEBPACK VAR INJECTION */(function(global) {
4056
- /**
4057
- * Module exports.
4058
- */
4059
-
4060
- module.exports = deprecate;
4061
-
4062
- /**
4063
- * Mark that a method should not be used.
4064
- * Returns a modified function which warns once by default.
4065
- *
4066
- * If `localStorage.noDeprecation = true` is set, then it is a no-op.
4067
- *
4068
- * If `localStorage.throwDeprecation = true` is set, then deprecated functions
4069
- * will throw an Error when invoked.
4070
- *
4071
- * If `localStorage.traceDeprecation = true` is set, then deprecated functions
4072
- * will invoke `console.trace()` instead of `console.error()`.
4073
- *
4074
- * @param {Function} fn - the function to deprecate
4075
- * @param {String} msg - the string to print to the console when `fn` is invoked
4076
- * @returns {Function} a new "deprecated" version of `fn`
4077
- * @api public
4078
- */
4079
-
4080
- function deprecate (fn, msg) {
4081
- if (config('noDeprecation')) {
4082
- return fn;
4083
- }
4084
-
4085
- var warned = false;
4086
- function deprecated() {
4087
- if (!warned) {
4088
- if (config('throwDeprecation')) {
4089
- throw new Error(msg);
4090
- } else if (config('traceDeprecation')) {
4091
- console.trace(msg);
4092
- } else {
4093
- console.warn(msg);
4094
- }
4095
- warned = true;
4096
  }
4097
- return fn.apply(this, arguments);
4098
- }
4099
-
4100
- return deprecated;
4101
- }
4102
-
4103
- /**
4104
- * Checks `localStorage` for boolean values for the given `name`.
4105
- *
4106
- * @param {String} name
4107
- * @returns {Boolean}
4108
- * @api private
4109
- */
4110
-
4111
- function config (name) {
4112
- // accessing global.localStorage can trigger a DOMException in sandboxed iframes
4113
- try {
4114
- if (!global.localStorage) return false;
4115
- } catch (_) {
4116
- return false;
4117
- }
4118
- var val = global.localStorage[name];
4119
- if (null == val) return false;
4120
- return String(val).toLowerCase() === 'true';
4121
- }
4122
-
4123
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
4124
-
4125
- /***/ }),
4126
-
4127
- /***/ 423:
4128
- /***/ (function(module, exports, __webpack_require__) {
4129
-
4130
- "use strict";
4131
- // Copyright Joyent, Inc. and other Node contributors.
4132
- //
4133
- // Permission is hereby granted, free of charge, to any person obtaining a
4134
- // copy of this software and associated documentation files (the
4135
- // "Software"), to deal in the Software without restriction, including
4136
- // without limitation the rights to use, copy, modify, merge, publish,
4137
- // distribute, sublicense, and/or sell copies of the Software, and to permit
4138
- // persons to whom the Software is furnished to do so, subject to the
4139
- // following conditions:
4140
- //
4141
- // The above copyright notice and this permission notice shall be included
4142
- // in all copies or substantial portions of the Software.
4143
- //
4144
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
4145
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
4146
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
4147
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
4148
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
4149
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
4150
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
4151
-
4152
- // a passthrough stream.
4153
- // basically just the most minimal sort of Transform stream.
4154
- // Every written chunk gets output as-is.
4155
-
4156
-
4157
-
4158
- module.exports = PassThrough;
4159
-
4160
- var Transform = __webpack_require__(267);
4161
-
4162
- /*<replacement>*/
4163
- var util = __webpack_require__(46);
4164
- util.inherits = __webpack_require__(21);
4165
- /*</replacement>*/
4166
-
4167
- util.inherits(PassThrough, Transform);
4168
-
4169
- function PassThrough(options) {
4170
- if (!(this instanceof PassThrough)) return new PassThrough(options);
4171
-
4172
- Transform.call(this, options);
4173
- }
4174
-
4175
- PassThrough.prototype._transform = function (chunk, encoding, cb) {
4176
- cb(null, chunk);
4177
  };
4178
 
4179
- /***/ }),
4180
-
4181
- /***/ 424:
4182
- /***/ (function(module, exports, __webpack_require__) {
4183
-
4184
- module.exports = __webpack_require__(91);
4185
-
4186
 
4187
- /***/ }),
 
 
 
 
 
4188
 
4189
- /***/ 425:
4190
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
4191
 
4192
- module.exports = __webpack_require__(32);
 
 
4193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4194
 
4195
- /***/ }),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4196
 
4197
- /***/ 426:
4198
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
4199
 
4200
- module.exports = __webpack_require__(89).Transform
 
 
 
 
 
4201
 
 
 
 
4202
 
4203
  /***/ }),
4204
-
4205
- /***/ 427:
4206
  /***/ (function(module, exports, __webpack_require__) {
4207
 
4208
- module.exports = __webpack_require__(89).PassThrough
4209
-
4210
-
4211
- /***/ }),
4212
 
4213
- /***/ 428:
4214
- /***/ (function(module, exports) {
4215
 
4216
- /* (ignored) */
 
 
 
 
 
 
 
4217
 
4218
  /***/ }),
4219
-
4220
- /***/ 429:
4221
  /***/ (function(module, exports, __webpack_require__) {
4222
 
4223
- module.exports = ProxyHandler;
4224
-
4225
- function ProxyHandler(cbs){
4226
- this._cbs = cbs || {};
4227
- }
4228
-
4229
- var EVENTS = __webpack_require__(37).EVENTS;
4230
- Object.keys(EVENTS).forEach(function(name){
4231
- if(EVENTS[name] === 0){
4232
- name = "on" + name;
4233
- ProxyHandler.prototype[name] = function(){
4234
- if(this._cbs[name]) this._cbs[name]();
4235
- };
4236
- } else if(EVENTS[name] === 1){
4237
- name = "on" + name;
4238
- ProxyHandler.prototype[name] = function(a){
4239
- if(this._cbs[name]) this._cbs[name](a);
4240
- };
4241
- } else if(EVENTS[name] === 2){
4242
- name = "on" + name;
4243
- ProxyHandler.prototype[name] = function(a, b){
4244
- if(this._cbs[name]) this._cbs[name](a, b);
4245
- };
4246
- } else {
4247
- throw Error("wrong number of arguments");
4248
- }
4249
- });
4250
-
4251
- /***/ }),
4252
 
4253
- /***/ 430:
4254
- /***/ (function(module, exports, __webpack_require__) {
4255
 
4256
- var DomUtils = module.exports;
4257
-
4258
- [
4259
- __webpack_require__(431),
4260
- __webpack_require__(437),
4261
- __webpack_require__(438),
4262
- __webpack_require__(439),
4263
- __webpack_require__(440),
4264
- __webpack_require__(441)
4265
- ].forEach(function(ext){
4266
- Object.keys(ext).forEach(function(key){
4267
- DomUtils[key] = ext[key].bind(DomUtils);
4268
- });
4269
  });
4270
 
 
4271
 
4272
- /***/ }),
4273
-
4274
- /***/ 431:
4275
- /***/ (function(module, exports, __webpack_require__) {
4276
 
4277
- var ElementType = __webpack_require__(45),
4278
- getOuterHTML = __webpack_require__(432),
4279
- isTag = ElementType.isTag;
4280
 
4281
- module.exports = {
4282
- getInnerHTML: getInnerHTML,
4283
- getOuterHTML: getOuterHTML,
4284
- getText: getText
 
 
 
 
 
 
 
4285
  };
4286
 
4287
- function getInnerHTML(elem, opts){
4288
- return elem.children ? elem.children.map(function(elem){
4289
- return getOuterHTML(elem, opts);
4290
- }).join("") : "";
4291
- }
4292
-
4293
- function getText(elem){
4294
- if(Array.isArray(elem)) return elem.map(getText).join("");
4295
- if(isTag(elem)) return elem.name === "br" ? "\n" : getText(elem.children);
4296
- if(elem.type === ElementType.CDATA) return getText(elem.children);
4297
- if(elem.type === ElementType.Text) return elem.data;
4298
- return "";
4299
- }
4300
-
4301
 
4302
  /***/ }),
4303
-
4304
- /***/ 432:
4305
  /***/ (function(module, exports, __webpack_require__) {
4306
 
4307
- /*
4308
- Module dependencies
4309
- */
4310
- var ElementType = __webpack_require__(433);
4311
- var entities = __webpack_require__(434);
4312
-
4313
- /*
4314
- Boolean Attributes
4315
- */
4316
- var booleanAttributes = {
4317
- __proto__: null,
4318
- allowfullscreen: true,
4319
- async: true,
4320
- autofocus: true,
4321
- autoplay: true,
4322
- checked: true,
4323
- controls: true,
4324
- default: true,
4325
- defer: true,
4326
- disabled: true,
4327
- hidden: true,
4328
- ismap: true,
4329
- loop: true,
4330
- multiple: true,
4331
- muted: true,
4332
- open: true,
4333
- readonly: true,
4334
- required: true,
4335
- reversed: true,
4336
- scoped: true,
4337
- seamless: true,
4338
- selected: true,
4339
- typemustmatch: true
4340
- };
4341
-
4342
- var unencodedElements = {
4343
- __proto__: null,
4344
- style: true,
4345
- script: true,
4346
- xmp: true,
4347
- iframe: true,
4348
- noembed: true,
4349
- noframes: true,
4350
- plaintext: true,
4351
- noscript: true
4352
- };
4353
-
4354
- /*
4355
- Format attributes
4356
- */
4357
- function formatAttrs(attributes, opts) {
4358
- if (!attributes) return;
4359
-
4360
- var output = '',
4361
- value;
4362
-
4363
- // Loop through the attributes
4364
- for (var key in attributes) {
4365
- value = attributes[key];
4366
- if (output) {
4367
- output += ' ';
4368
- }
4369
 
4370
- if (!value && booleanAttributes[key]) {
4371
- output += key;
4372
- } else {
4373
- output += key + '="' + (opts.decodeEntities ? entities.encodeXML(value) : value) + '"';
4374
- }
4375
- }
4376
 
4377
- return output;
4378
- }
 
 
4379
 
4380
- /*
4381
- Self-enclosing tags (stolen from node-htmlparser)
4382
- */
4383
- var singleTag = {
4384
- __proto__: null,
4385
- area: true,
4386
- base: true,
4387
- basefont: true,
4388
- br: true,
4389
- col: true,
4390
- command: true,
4391
- embed: true,
4392
- frame: true,
4393
- hr: true,
4394
- img: true,
4395
- input: true,
4396
- isindex: true,
4397
- keygen: true,
4398
- link: true,
4399
- meta: true,
4400
- param: true,
4401
- source: true,
4402
- track: true,
4403
- wbr: true,
4404
- };
4405
-
4406
-
4407
- var render = module.exports = function(dom, opts) {
4408
- if (!Array.isArray(dom) && !dom.cheerio) dom = [dom];
4409
- opts = opts || {};
4410
-
4411
- var output = '';
4412
-
4413
- for(var i = 0; i < dom.length; i++){
4414
- var elem = dom[i];
4415
-
4416
- if (elem.type === 'root')
4417
- output += render(elem.children, opts);
4418
- else if (ElementType.isTag(elem))
4419
- output += renderTag(elem, opts);
4420
- else if (elem.type === ElementType.Directive)
4421
- output += renderDirective(elem);
4422
- else if (elem.type === ElementType.Comment)
4423
- output += renderComment(elem);
4424
- else if (elem.type === ElementType.CDATA)
4425
- output += renderCdata(elem);
4426
- else
4427
- output += renderText(elem, opts);
4428
- }
4429
 
4430
- return output;
 
 
4431
  };
4432
 
4433
- function renderTag(elem, opts) {
4434
- // Handle SVG
4435
- if (elem.name === "svg") opts = {decodeEntities: opts.decodeEntities, xmlMode: true};
4436
-
4437
- var tag = '<' + elem.name,
4438
- attribs = formatAttrs(elem.attribs, opts);
4439
-
4440
- if (attribs) {
4441
- tag += ' ' + attribs;
4442
- }
4443
-
4444
- if (
4445
- opts.xmlMode
4446
- && (!elem.children || elem.children.length === 0)
4447
- ) {
4448
- tag += '/>';
4449
- } else {
4450
- tag += '>';
4451
- if (elem.children) {
4452
- tag += render(elem.children, opts);
4453
- }
4454
-
4455
- if (!singleTag[elem.name] || opts.xmlMode) {
4456
- tag += '</' + elem.name + '>';
4457
- }
4458
- }
4459
-
4460
- return tag;
4461
- }
4462
-
4463
- function renderDirective(elem) {
4464
- return '<' + elem.data + '>';
4465
- }
4466
-
4467
- function renderText(elem, opts) {
4468
- var data = elem.data || '';
4469
-
4470
- // if entities weren't decoded, no need to encode them back
4471
- if (opts.decodeEntities && !(elem.parent && elem.parent.name in unencodedElements)) {
4472
- data = entities.encodeXML(data);
4473
- }
4474
-
4475
- return data;
4476
- }
4477
-
4478
- function renderCdata(elem) {
4479
- return '<![CDATA[' + elem.children[0].data + ']]>';
4480
- }
4481
-
4482
- function renderComment(elem) {
4483
- return '<!--' + elem.data + '-->';
4484
- }
4485
-
4486
-
4487
- /***/ }),
 
4488
 
4489
- /***/ 433:
4490
- /***/ (function(module, exports) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4491
 
4492
- //Types of elements found in the DOM
4493
- module.exports = {
4494
- Text: "text", //Text
4495
- Directive: "directive", //<? ... ?>
4496
- Comment: "comment", //<!-- ... -->
4497
- Script: "script", //<script> tags
4498
- Style: "style", //<style> tags
4499
- Tag: "tag", //Any tag
4500
- CDATA: "cdata", //<![CDATA[ ... ]]>
4501
 
4502
- isTag: function(elem){
4503
- return elem.type === "tag" || elem.type === "script" || elem.type === "style";
4504
- }
 
 
 
 
 
4505
  };
4506
 
4507
  /***/ }),
4508
-
4509
- /***/ 434:
4510
  /***/ (function(module, exports, __webpack_require__) {
4511
 
4512
- var encode = __webpack_require__(435),
4513
- decode = __webpack_require__(436);
4514
-
4515
- exports.decode = function(data, level){
4516
- return (!level || level <= 0 ? decode.XML : decode.HTML)(data);
4517
- };
4518
 
4519
- exports.decodeStrict = function(data, level){
4520
- return (!level || level <= 0 ? decode.XML : decode.HTMLStrict)(data);
4521
- };
4522
 
4523
- exports.encode = function(data, level){
4524
- return (!level || level <= 0 ? encode.XML : encode.HTML)(data);
4525
- };
4526
 
4527
- exports.encodeXML = encode.XML;
4528
 
4529
- exports.encodeHTML4 =
4530
- exports.encodeHTML5 =
4531
- exports.encodeHTML = encode.HTML;
4532
 
4533
- exports.decodeXML =
4534
- exports.decodeXMLStrict = decode.XML;
4535
 
4536
- exports.decodeHTML4 =
4537
- exports.decodeHTML5 =
4538
- exports.decodeHTML = decode.HTML;
4539
 
4540
- exports.decodeHTML4Strict =
4541
- exports.decodeHTML5Strict =
4542
- exports.decodeHTMLStrict = decode.HTMLStrict;
4543
 
4544
- exports.escape = encode.escape;
 
 
 
4545
 
 
 
 
 
 
 
 
4546
 
4547
- /***/ }),
 
4548
 
4549
- /***/ 435:
4550
- /***/ (function(module, exports, __webpack_require__) {
4551
 
4552
- var inverseXML = getInverseObj(__webpack_require__(88)),
4553
- xmlReplacer = getInverseReplacer(inverseXML);
4554
 
4555
- exports.XML = getInverse(inverseXML, xmlReplacer);
4556
 
4557
- var inverseHTML = getInverseObj(__webpack_require__(87)),
4558
- htmlReplacer = getInverseReplacer(inverseHTML);
 
 
 
 
 
 
 
 
 
 
4559
 
4560
- exports.HTML = getInverse(inverseHTML, htmlReplacer);
 
 
 
4561
 
4562
- function getInverseObj(obj){
4563
- return Object.keys(obj).sort().reduce(function(inverse, name){
4564
- inverse[obj[name]] = "&" + name + ";";
4565
- return inverse;
4566
- }, {});
4567
  }
4568
 
4569
- function getInverseReplacer(inverse){
4570
- var single = [],
4571
- multiple = [];
4572
 
4573
- Object.keys(inverse).forEach(function(k){
4574
- if(k.length === 1){
4575
- single.push("\\" + k);
4576
- } else {
4577
- multiple.push(k);
4578
- }
4579
- });
4580
 
4581
- //TODO add ranges
4582
- multiple.unshift("[" + single.join("") + "]");
4583
 
4584
- return new RegExp(multiple.join("|"), "g");
4585
- }
 
4586
 
4587
- var re_nonASCII = /[^\0-\x7F]/g,
4588
- re_astralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
4589
 
4590
- function singleCharReplacer(c){
4591
- return "&#x" + c.charCodeAt(0).toString(16).toUpperCase() + ";";
4592
- }
4593
 
4594
- function astralReplacer(c){
4595
- // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
4596
- var high = c.charCodeAt(0);
4597
- var low = c.charCodeAt(1);
4598
- var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000;
4599
- return "&#x" + codePoint.toString(16).toUpperCase() + ";";
4600
- }
4601
 
4602
- function getInverse(inverse, re){
4603
- function func(name){
4604
- return inverse[name];
4605
- }
4606
-
4607
- return function(data){
4608
- return data
4609
- .replace(re, func)
4610
- .replace(re_astralSymbols, astralReplacer)
4611
- .replace(re_nonASCII, singleCharReplacer);
4612
- };
4613
- }
4614
 
4615
- var re_xmlChars = getInverseReplacer(inverseXML);
 
4616
 
4617
- function escapeXML(data){
4618
- return data
4619
- .replace(re_xmlChars, singleCharReplacer)
4620
- .replace(re_astralSymbols, astralReplacer)
4621
- .replace(re_nonASCII, singleCharReplacer);
4622
- }
 
 
 
4623
 
4624
- exports.escape = escapeXML;
 
 
 
 
 
 
4625
 
 
 
4626
 
4627
- /***/ }),
 
 
 
4628
 
4629
- /***/ 436:
4630
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
4631
 
4632
- var entityMap = __webpack_require__(87),
4633
- legacyMap = __webpack_require__(260),
4634
- xmlMap = __webpack_require__(88),
4635
- decodeCodePoint = __webpack_require__(259);
4636
 
4637
- var decodeXMLStrict = getStrictDecoder(xmlMap),
4638
- decodeHTMLStrict = getStrictDecoder(entityMap);
 
4639
 
4640
- function getStrictDecoder(map){
4641
- var keys = Object.keys(map).join("|"),
4642
- replace = getReplacer(map);
 
 
4643
 
4644
- keys += "|#[xX][\\da-fA-F]+|#\\d+";
 
 
 
 
 
 
 
4645
 
4646
- var re = new RegExp("&(?:" + keys + ");", "g");
 
 
4647
 
4648
- return function(str){
4649
- return String(str).replace(re, replace);
4650
- };
4651
- }
 
 
 
 
4652
 
4653
- var decodeHTML = (function(){
4654
- var legacy = Object.keys(legacyMap)
4655
- .sort(sorter);
4656
-
4657
- var keys = Object.keys(entityMap)
4658
- .sort(sorter);
4659
-
4660
- for(var i = 0, j = 0; i < keys.length; i++){
4661
- if(legacy[j] === keys[i]){
4662
- keys[i] += ";?";
4663
- j++;
4664
- } else {
4665
- keys[i] += ";";
4666
- }
4667
- }
4668
-
4669
- var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"),
4670
- replace = getReplacer(entityMap);
4671
-
4672
- function replacer(str){
4673
- if(str.substr(-1) !== ";") str += ";";
4674
- return replace(str);
4675
- }
4676
-
4677
- //TODO consider creating a merged map
4678
- return function(str){
4679
- return String(str).replace(re, replacer);
4680
- };
4681
- }());
4682
-
4683
- function sorter(a, b){
4684
- return a < b ? 1 : -1;
4685
- }
4686
 
4687
- function getReplacer(map){
4688
- return function replace(str){
4689
- if(str.charAt(1) === "#"){
4690
- if(str.charAt(2) === "X" || str.charAt(2) === "x"){
4691
- return decodeCodePoint(parseInt(str.substr(3), 16));
4692
- }
4693
- return decodeCodePoint(parseInt(str.substr(2), 10));
4694
- }
4695
- return map[str.slice(1, -1)];
4696
- };
4697
- }
4698
 
4699
- module.exports = {
4700
- XML: decodeXMLStrict,
4701
- HTML: decodeHTML,
4702
- HTMLStrict: decodeHTMLStrict
 
 
 
 
 
 
 
 
4703
  };
4704
 
4705
- /***/ }),
 
 
 
4706
 
4707
- /***/ 437:
4708
- /***/ (function(module, exports) {
 
 
 
 
 
4709
 
4710
- var getChildren = exports.getChildren = function(elem){
4711
- return elem.children;
4712
- };
 
 
 
 
4713
 
4714
- var getParent = exports.getParent = function(elem){
4715
- return elem.parent;
4716
- };
 
 
 
 
 
 
 
 
4717
 
4718
- exports.getSiblings = function(elem){
4719
- var parent = getParent(elem);
4720
- return parent ? getChildren(parent) : [elem];
4721
- };
 
 
 
4722
 
4723
- exports.getAttributeValue = function(elem, name){
4724
- return elem.attribs && elem.attribs[name];
4725
- };
 
 
 
 
4726
 
4727
- exports.hasAttrib = function(elem, name){
4728
- return !!elem.attribs && hasOwnProperty.call(elem.attribs, name);
4729
- };
 
 
 
 
4730
 
4731
- exports.getName = function(elem){
4732
- return elem.name;
 
 
4733
  };
4734
 
 
4735
 
4736
  /***/ }),
 
 
4737
 
4738
- /***/ 438:
4739
- /***/ (function(module, exports) {
4740
 
4741
- exports.removeElement = function(elem){
4742
- if(elem.prev) elem.prev.next = elem.next;
4743
- if(elem.next) elem.next.prev = elem.prev;
4744
 
4745
- if(elem.parent){
4746
- var childs = elem.parent.children;
4747
- childs.splice(childs.lastIndexOf(elem), 1);
4748
- }
4749
- };
4750
 
4751
- exports.replaceElement = function(elem, replacement){
4752
- var prev = replacement.prev = elem.prev;
4753
- if(prev){
4754
- prev.next = replacement;
4755
- }
4756
 
4757
- var next = replacement.next = elem.next;
4758
- if(next){
4759
- next.prev = replacement;
4760
- }
4761
 
4762
- var parent = replacement.parent = elem.parent;
4763
- if(parent){
4764
- var childs = parent.children;
4765
- childs[childs.lastIndexOf(elem)] = replacement;
4766
- }
 
4767
  };
4768
 
4769
- exports.appendChild = function(elem, child){
4770
- child.parent = elem;
 
4771
 
4772
- if(elem.children.push(child) !== 1){
4773
- var sibling = elem.children[elem.children.length - 2];
4774
- sibling.next = child;
4775
- child.prev = sibling;
4776
- child.next = null;
4777
- }
4778
  };
4779
 
4780
- exports.append = function(elem, next){
4781
- var parent = elem.parent,
4782
- currNext = elem.next;
 
 
 
 
 
 
 
 
4783
 
4784
- next.next = currNext;
4785
- next.prev = elem;
4786
- elem.next = next;
4787
- next.parent = parent;
4788
 
4789
- if(currNext){
4790
- currNext.prev = next;
4791
- if(parent){
4792
- var childs = parent.children;
4793
- childs.splice(childs.lastIndexOf(currNext), 0, next);
4794
- }
4795
- } else if(parent){
4796
- parent.children.push(next);
4797
- }
4798
  };
4799
 
4800
- exports.prepend = function(elem, prev){
4801
- var parent = elem.parent;
4802
- if(parent){
4803
- var childs = parent.children;
4804
- childs.splice(childs.lastIndexOf(elem), 0, prev);
4805
- }
4806
-
4807
- if(elem.prev){
4808
- elem.prev.next = prev;
4809
- }
4810
-
4811
- prev.parent = parent;
4812
- prev.prev = elem.prev;
4813
- prev.next = elem;
4814
- elem.prev = prev;
4815
  };
4816
 
 
 
 
 
 
4817
 
 
 
4818
 
 
 
 
 
 
 
4819
 
4820
  /***/ }),
4821
-
4822
- /***/ 439:
4823
  /***/ (function(module, exports, __webpack_require__) {
4824
 
4825
- var isTag = __webpack_require__(45).isTag;
4826
-
4827
- module.exports = {
4828
- filter: filter,
4829
- find: find,
4830
- findOneChild: findOneChild,
4831
- findOne: findOne,
4832
- existsOne: existsOne,
4833
- findAll: findAll
4834
- };
4835
 
4836
- function filter(test, element, recurse, limit){
4837
- if(!Array.isArray(element)) element = [element];
4838
 
4839
- if(typeof limit !== "number" || !isFinite(limit)){
4840
- limit = Infinity;
4841
- }
4842
- return find(test, element, recurse !== false, limit);
4843
- }
4844
 
4845
- function find(test, elems, recurse, limit){
4846
- var result = [], childs;
4847
-
4848
- for(var i = 0, j = elems.length; i < j; i++){
4849
- if(test(elems[i])){
4850
- result.push(elems[i]);
4851
- if(--limit <= 0) break;
4852
- }
4853
-
4854
- childs = elems[i].children;
4855
- if(recurse && childs && childs.length > 0){
4856
- childs = find(test, childs, recurse, limit);
4857
- result = result.concat(childs);
4858
- limit -= childs.length;
4859
- if(limit <= 0) break;
4860
- }
4861
- }
4862
-
4863
- return result;
4864
- }
4865
 
4866
- function findOneChild(test, elems){
4867
- for(var i = 0, l = elems.length; i < l; i++){
4868
- if(test(elems[i])) return elems[i];
4869
- }
4870
 
4871
- return null;
4872
- }
4873
 
4874
- function findOne(test, elems){
4875
- var elem = null;
4876
-
4877
- for(var i = 0, l = elems.length; i < l && !elem; i++){
4878
- if(!isTag(elems[i])){
4879
- continue;
4880
- } else if(test(elems[i])){
4881
- elem = elems[i];
4882
- } else if(elems[i].children.length > 0){
4883
- elem = findOne(test, elems[i].children);
4884
- }
4885
- }
4886
-
4887
- return elem;
4888
- }
4889
-
4890
- function existsOne(test, elems){
4891
- for(var i = 0, l = elems.length; i < l; i++){
4892
- if(
4893
- isTag(elems[i]) && (
4894
- test(elems[i]) || (
4895
- elems[i].children.length > 0 &&
4896
- existsOne(test, elems[i].children)
4897
- )
4898
- )
4899
- ){
4900
- return true;
4901
- }
4902
- }
4903
-
4904
- return false;
4905
- }
4906
-
4907
- function findAll(test, rootElems){
4908
- var result = [];
4909
- var stack = [rootElems];
4910
- while(stack.length){
4911
- var elems = stack.pop();
4912
- for(var i = 0, j = elems.length; i < j; i++){
4913
- if(!isTag(elems[i])) continue;
4914
- if(test(elems[i])) result.push(elems[i]);
4915
- }
4916
- while(j-- > 0){
4917
- if(elems[j].children && elems[j].children.length > 0){
4918
- stack.push(elems[j].children);
4919
- }
4920
- }
4921
- }
4922
- return result;
4923
- }
4924
-
4925
-
4926
- /***/ }),
4927
-
4928
- /***/ 440:
4929
- /***/ (function(module, exports, __webpack_require__) {
4930
-
4931
- var ElementType = __webpack_require__(45);
4932
- var isTag = exports.isTag = ElementType.isTag;
4933
-
4934
- exports.testElement = function(options, element){
4935
- for(var key in options){
4936
- if(!options.hasOwnProperty(key));
4937
- else if(key === "tag_name"){
4938
- if(!isTag(element) || !options.tag_name(element.name)){
4939
- return false;
4940
- }
4941
- } else if(key === "tag_type"){
4942
- if(!options.tag_type(element.type)) return false;
4943
- } else if(key === "tag_contains"){
4944
- if(isTag(element) || !options.tag_contains(element.data)){
4945
- return false;
4946
- }
4947
- } else if(!element.attribs || !options[key](element.attribs[key])){
4948
- return false;
4949
- }
4950
- }
4951
- return true;
4952
- };
4953
-
4954
- var Checks = {
4955
- tag_name: function(name){
4956
- if(typeof name === "function"){
4957
- return function(elem){ return isTag(elem) && name(elem.name); };
4958
- } else if(name === "*"){
4959
- return isTag;
4960
- } else {
4961
- return function(elem){ return isTag(elem) && elem.name === name; };
4962
- }
4963
- },
4964
- tag_type: function(type){
4965
- if(typeof type === "function"){
4966
- return function(elem){ return type(elem.type); };
4967
- } else {
4968
- return function(elem){ return elem.type === type; };
4969
- }
4970
- },
4971
- tag_contains: function(data){
4972
- if(typeof data === "function"){
4973
- return function(elem){ return !isTag(elem) && data(elem.data); };
4974
- } else {
4975
- return function(elem){ return !isTag(elem) && elem.data === data; };
4976
- }
4977
- }
4978
- };
4979
-
4980
- function getAttribCheck(attrib, value){
4981
- if(typeof value === "function"){
4982
- return function(elem){ return elem.attribs && value(elem.attribs[attrib]); };
4983
- } else {
4984
- return function(elem){ return elem.attribs && elem.attribs[attrib] === value; };
4985
- }
4986
- }
4987
-
4988
- function combineFuncs(a, b){
4989
- return function(elem){
4990
- return a(elem) || b(elem);
4991
- };
4992
- }
4993
-
4994
- exports.getElements = function(options, element, recurse, limit){
4995
- var funcs = Object.keys(options).map(function(key){
4996
- var value = options[key];
4997
- return key in Checks ? Checks[key](value) : getAttribCheck(key, value);
4998
- });
4999
-
5000
- return funcs.length === 0 ? [] : this.filter(
5001
- funcs.reduce(combineFuncs),
5002
- element, recurse, limit
5003
- );
5004
- };
5005
-
5006
- exports.getElementById = function(id, element, recurse){
5007
- if(!Array.isArray(element)) element = [element];
5008
- return this.findOne(getAttribCheck("id", id), element, recurse !== false);
5009
- };
5010
-
5011
- exports.getElementsByTagName = function(name, element, recurse, limit){
5012
- return this.filter(Checks.tag_name(name), element, recurse, limit);
5013
- };
5014
-
5015
- exports.getElementsByTagType = function(type, element, recurse, limit){
5016
- return this.filter(Checks.tag_type(type), element, recurse, limit);
5017
  };
5018
 
5019
-
5020
- /***/ }),
5021
-
5022
- /***/ 441:
5023
- /***/ (function(module, exports) {
5024
-
5025
- // removeSubsets
5026
- // Given an array of nodes, remove any member that is contained by another.
5027
- exports.removeSubsets = function(nodes) {
5028
- var idx = nodes.length, node, ancestor, replace;
5029
-
5030
- // Check if each node (or one of its ancestors) is already contained in the
5031
- // array.
5032
- while (--idx > -1) {
5033
- node = ancestor = nodes[idx];
5034
-
5035
- // Temporarily remove the node under consideration
5036
- nodes[idx] = null;
5037
- replace = true;
5038
-
5039
- while (ancestor) {
5040
- if (nodes.indexOf(ancestor) > -1) {
5041
- replace = false;
5042
- nodes.splice(idx, 1);
5043
- break;
5044
- }
5045
- ancestor = ancestor.parent;
5046
- }
5047
-
5048
- // If the node has been found to be unique, re-insert it.
5049
- if (replace) {
5050
- nodes[idx] = node;
5051
- }
5052
- }
5053
-
5054
- return nodes;
5055
- };
5056
-
5057
- // Source: http://dom.spec.whatwg.org/#dom-node-comparedocumentposition
5058
- var POSITION = {
5059
- DISCONNECTED: 1,
5060
- PRECEDING: 2,
5061
- FOLLOWING: 4,
5062
- CONTAINS: 8,
5063
- CONTAINED_BY: 16
5064
- };
5065
-
5066
- // Compare the position of one node against another node in any other document.
5067
- // The return value is a bitmask with the following values:
5068
- //
5069
- // document order:
5070
- // > There is an ordering, document order, defined on all the nodes in the
5071
- // > document corresponding to the order in which the first character of the
5072
- // > XML representation of each node occurs in the XML representation of the
5073
- // > document after expansion of general entities. Thus, the document element
5074
- // > node will be the first node. Element nodes occur before their children.
5075
- // > Thus, document order orders element nodes in order of the occurrence of
5076
- // > their start-tag in the XML (after expansion of entities). The attribute
5077
- // > nodes of an element occur after the element and before its children. The
5078
- // > relative order of attribute nodes is implementation-dependent./
5079
- // Source:
5080
- // http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order
5081
- //
5082
- // @argument {Node} nodaA The first node to use in the comparison
5083
- // @argument {Node} nodeB The second node to use in the comparison
5084
- //
5085
- // @return {Number} A bitmask describing the input nodes' relative position.
5086
- // See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for
5087
- // a description of these values.
5088
- var comparePos = exports.compareDocumentPosition = function(nodeA, nodeB) {
5089
- var aParents = [];
5090
- var bParents = [];
5091
- var current, sharedParent, siblings, aSibling, bSibling, idx;
5092
-
5093
- if (nodeA === nodeB) {
5094
- return 0;
5095
- }
5096
-
5097
- current = nodeA;
5098
- while (current) {
5099
- aParents.unshift(current);
5100
- current = current.parent;
5101
- }
5102
- current = nodeB;
5103
- while (current) {
5104
- bParents.unshift(current);
5105
- current = current.parent;
5106
- }
5107
-
5108
- idx = 0;
5109
- while (aParents[idx] === bParents[idx]) {
5110
- idx++;
5111
- }
5112
-
5113
- if (idx === 0) {
5114
- return POSITION.DISCONNECTED;
5115
- }
5116
-
5117
- sharedParent = aParents[idx - 1];
5118
- siblings = sharedParent.children;
5119
- aSibling = aParents[idx];
5120
- bSibling = bParents[idx];
5121
-
5122
- if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {
5123
- if (sharedParent === nodeB) {
5124
- return POSITION.FOLLOWING | POSITION.CONTAINED_BY;
5125
- }
5126
- return POSITION.FOLLOWING;
5127
- } else {
5128
- if (sharedParent === nodeA) {
5129
- return POSITION.PRECEDING | POSITION.CONTAINS;
5130
- }
5131
- return POSITION.PRECEDING;
5132
- }
5133
- };
5134
-
5135
- // Sort an array of nodes based on their relative position in the document and
5136
- // remove any duplicate nodes. If the array contains nodes that do not belong
5137
- // to the same document, sort order is unspecified.
5138
- //
5139
- // @argument {Array} nodes Array of DOM nodes
5140
- //
5141
- // @returns {Array} collection of unique nodes, sorted in document order
5142
- exports.uniqueSort = function(nodes) {
5143
- var idx = nodes.length, node, position;
5144
-
5145
- nodes = nodes.slice();
5146
-
5147
- while (--idx > -1) {
5148
- node = nodes[idx];
5149
- position = nodes.indexOf(node);
5150
- if (position > -1 && position < idx) {
5151
- nodes.splice(idx, 1);
5152
- }
5153
- }
5154
- nodes.sort(function(a, b) {
5155
- var relative = comparePos(a, b);
5156
- if (relative & POSITION.PRECEDING) {
5157
- return -1;
5158
- } else if (relative & POSITION.FOLLOWING) {
5159
- return 1;
5160
- }
5161
- return 0;
5162
- });
5163
-
5164
- return nodes;
5165
  };
5166
 
5167
-
5168
- /***/ }),
5169
-
5170
- /***/ 442:
5171
- /***/ (function(module, exports, __webpack_require__) {
5172
-
5173
- module.exports = CollectingHandler;
5174
-
5175
- function CollectingHandler(cbs){
5176
- this._cbs = cbs || {};
5177
- this.events = [];
5178
- }
5179
-
5180
- var EVENTS = __webpack_require__(37).EVENTS;
5181
- Object.keys(EVENTS).forEach(function(name){
5182
- if(EVENTS[name] === 0){
5183
- name = "on" + name;
5184
- CollectingHandler.prototype[name] = function(){
5185
- this.events.push([name]);
5186
- if(this._cbs[name]) this._cbs[name]();
5187
- };
5188
- } else if(EVENTS[name] === 1){
5189
- name = "on" + name;
5190
- CollectingHandler.prototype[name] = function(a){
5191
- this.events.push([name, a]);
5192
- if(this._cbs[name]) this._cbs[name](a);
5193
- };
5194
- } else if(EVENTS[name] === 2){
5195
- name = "on" + name;
5196
- CollectingHandler.prototype[name] = function(a, b){
5197
- this.events.push([name, a, b]);
5198
- if(this._cbs[name]) this._cbs[name](a, b);
5199
- };
5200
- } else {
5201
- throw Error("wrong number of arguments");
5202
- }
5203
  });
5204
 
5205
- CollectingHandler.prototype.onreset = function(){
5206
- this.events = [];
5207
- if(this._cbs.onreset) this._cbs.onreset();
 
 
 
5208
  };
5209
 
5210
- CollectingHandler.prototype.restart = function(){
5211
- if(this._cbs.onreset) this._cbs.onreset();
5212
-
5213
- for(var i = 0, len = this.events.length; i < len; i++){
5214
- if(this._cbs[this.events[i][0]]){
5215
-
5216
- var num = this.events[i].length;
5217
-
5218
- if(num === 1){
5219
- this._cbs[this.events[i][0]]();
5220
- } else if(num === 2){
5221
- this._cbs[this.events[i][0]](this.events[i][1]);
5222
- } else {
5223
- this._cbs[this.events[i][0]](this.events[i][1], this.events[i][2]);
5224
- }
5225
- }
5226
- }
5227
  };
5228
 
5229
-
5230
  /***/ }),
5231
-
5232
- /***/ 443:
5233
  /***/ (function(module, exports, __webpack_require__) {
5234
 
5235
  "use strict";
5236
 
5237
 
5238
  Object.defineProperty(exports, "__esModule", {
5239
- value: true
5240
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5241
 
5242
- var _ElementType$Text$Ele;
 
 
 
5243
 
5244
- var _htmlparser = __webpack_require__(37);
 
 
 
5245
 
5246
- var _TextElementType = __webpack_require__(444);
5247
 
5248
- var _TextElementType2 = _interopRequireDefault(_TextElementType);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5249
 
5250
- var _TagElementType = __webpack_require__(445);
5251
 
5252
- var _TagElementType2 = _interopRequireDefault(_TagElementType);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5253
 
5254
- var _StyleElementType = __webpack_require__(452);
 
 
 
 
 
5255
 
5256
- var _StyleElementType2 = _interopRequireDefault(_StyleElementType);
 
5257
 
5258
- var _UnsupportedElementType = __webpack_require__(453);
 
 
 
 
5259
 
5260
- var _UnsupportedElementType2 = _interopRequireDefault(_UnsupportedElementType);
 
 
 
5261
 
5262
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
5263
 
5264
- 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; } /*
5265
- * Map each htmlparser2 element type to a function which will convert that element type to a React element
5266
- * Not all of the element types are supported so the UnsupportedElementType is used for them which will not return any
5267
- * value
5268
- */
 
 
 
5269
 
5270
- 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);
 
 
 
 
 
 
 
5271
 
5272
  /***/ }),
5273
-
5274
- /***/ 444:
5275
  /***/ (function(module, exports, __webpack_require__) {
5276
 
5277
  "use strict";
5278
 
5279
 
5280
  Object.defineProperty(exports, "__esModule", {
5281
- value: true
5282
  });
5283
- exports.default = TextElementType;
5284
- /**
5285
- * Converts a text node to a React text element
5286
- *
5287
- * @param {Object} node The text node
5288
- * @returns {String} The text
5289
- */
5290
- function TextElementType(node) {
5291
 
5292
- // React will accept plain text for rendering so just return the node data
5293
- return node.data;
5294
- }
5295
 
5296
- /***/ }),
5297
 
5298
- /***/ 445:
5299
- /***/ (function(module, exports, __webpack_require__) {
5300
 
5301
- "use strict";
5302
 
 
5303
 
5304
- Object.defineProperty(exports, "__esModule", {
5305
- value: true
5306
- });
5307
- exports.default = TagElementType;
5308
 
5309
- var _react = __webpack_require__(2);
5310
 
5311
- var _react2 = _interopRequireDefault(_react);
5312
 
5313
- var _ProcessNodes = __webpack_require__(268);
 
5314
 
5315
- var _ProcessNodes2 = _interopRequireDefault(_ProcessNodes);
5316
 
5317
- var _GeneratePropsFromAttributes = __webpack_require__(269);
 
 
 
 
5318
 
5319
- var _GeneratePropsFromAttributes2 = _interopRequireDefault(_GeneratePropsFromAttributes);
 
 
 
 
 
 
5320
 
5321
- var _TransformTagName = __webpack_require__(450);
 
5322
 
5323
- var _TransformTagName2 = _interopRequireDefault(_TransformTagName);
 
5324
 
5325
- var _VoidElements = __webpack_require__(451);
 
 
5326
 
5327
- var _VoidElements2 = _interopRequireDefault(_VoidElements);
 
 
5328
 
5329
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5330
-
5331
- /**
5332
- * Converts any element (excluding style - see StyleElementType - and script) to a react element.
5333
- *
5334
- * @param {Object} node The tag node
5335
- * @param {String} key The key to give the React element
5336
- * @returns {React.Element} The React tag element
5337
- */
5338
- function TagElementType(node, key) {
5339
-
5340
- // generate props
5341
- var props = (0, _GeneratePropsFromAttributes2.default)(node.attribs, key);
5342
-
5343
- // transform the tag name if needed
5344
- var tagName = (0, _TransformTagName2.default)(node.name);
5345
-
5346
- // If the node is not a void element and has children then process them
5347
- var children = null;
5348
- if (_VoidElements2.default.indexOf(tagName) === -1) {
5349
- children = (0, _ProcessNodes2.default)(node.children);
5350
- }
5351
-
5352
- // create and return the element
5353
- return _react2.default.createElement(tagName, props, children);
5354
- }
5355
-
5356
- /***/ }),
5357
-
5358
- /***/ 446:
5359
- /***/ (function(module, exports, __webpack_require__) {
5360
-
5361
- "use strict";
5362
 
 
 
 
 
 
 
 
 
 
 
 
 
5363
 
5364
- Object.defineProperty(exports, "__esModule", {
5365
- value: true
5366
- });
5367
- exports.default = HtmlAttributesToReact;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5368
 
5369
- var _BooleanAttributes = __webpack_require__(447);
 
 
5370
 
5371
- var _BooleanAttributes2 = _interopRequireDefault(_BooleanAttributes);
 
 
 
 
 
 
 
5372
 
5373
- var _ReactAttributes = __webpack_require__(448);
 
 
 
5374
 
5375
- var _ReactAttributes2 = _interopRequireDefault(_ReactAttributes);
 
 
 
5376
 
5377
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
5378
 
5379
- /**
5380
- * Returns the parsed attribute value taking into account things like boolean attributes
5381
- *
5382
- * @param {String} attribute The name of the attribute
5383
- * @param {*} value The value of the attribute from the HTML
5384
- * @returns {*} The parsed attribute value
5385
- */
5386
- var getParsedAttributeValue = function getParsedAttributeValue(attribute, value) {
5387
 
5388
- // if the attribute if a boolean then it's value should be the same as it's name
5389
- // e.g. disabled="disabled"
5390
- var lowerBooleanAttributes = _BooleanAttributes2.default.map(function (attr) {
5391
- return attr.toLowerCase();
5392
- });
5393
- if (lowerBooleanAttributes.indexOf(attribute.toLowerCase()) >= 0) {
5394
- value = attribute;
5395
- }
5396
 
5397
- return value;
 
 
 
 
 
 
5398
  };
5399
 
5400
- /**
5401
- * Takes an object of standard HTML property names and converts them to their React counterpart. If the react
5402
- * version does not exist for an attribute then just use it as it is
5403
- *
5404
- * @param {Object} attributes The HTML attributes to convert
5405
- * @returns {Object} The React attributes
5406
- */
5407
- function HtmlAttributesToReact(attributes) {
5408
-
5409
- return Object.keys(attributes).reduce(function (mappedAttributes, attribute) {
5410
 
5411
- // lowercase the attribute name and find it in the react attribute map
5412
- var lowerCaseAttribute = attribute.toLowerCase();
 
 
 
 
 
5413
 
5414
- // format the attribute name
5415
- var name = _ReactAttributes2.default[lowerCaseAttribute] || lowerCaseAttribute;
5416
 
5417
- // add the parsed attribute value to the mapped attributes
5418
- mappedAttributes[name] = getParsedAttributeValue(name, attributes[attribute]);
5419
 
5420
- return mappedAttributes;
5421
- }, {});
5422
- }
 
5423
 
5424
- /***/ }),
 
5425
 
5426
- /***/ 447:
5427
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
5428
 
5429
- "use strict";
 
 
 
5430
 
 
 
 
 
 
 
5431
 
5432
- Object.defineProperty(exports, "__esModule", {
5433
- value: true
5434
- });
5435
- /**
5436
- * List of boolean attributes
5437
- * These attributes should have their React attribute value set to be the same as their name
5438
- * E.g. <input disabled> = <input disabled>
5439
- * <input disabled=""> = <input disabled>
5440
- * <input disabled="disabled"> = <input disabled>
5441
- * @type {Array}
5442
- */
5443
- 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'];
5444
 
5445
- /***/ }),
 
5446
 
5447
- /***/ 448:
5448
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
5449
 
5450
- "use strict";
 
5451
 
 
 
 
 
5452
 
5453
- Object.defineProperty(exports, "__esModule", {
5454
- value: true
5455
- });
5456
- /**
5457
- * Mapping of standard HTML attributes to their React counterparts
5458
- * List taken and reversed from react/src/renderers/dom/shared/HTMLDOMPropertyConfig.js
5459
- * https://github.com/facebook/react/blob/c9c3c339b757682f1154f1c915eb55e6a8766933/src/renderers/dom/shared/HTMLDOMPropertyConfig.js
5460
- * @type {Object}
5461
- */
5462
- exports.default = {
5463
- /**
5464
- * Standard Properties
5465
- */
5466
- accept: 'accept',
5467
- 'accept-charset': 'acceptCharset',
5468
- accesskey: 'accessKey',
5469
- action: 'action',
5470
- allowfullscreen: 'allowFullScreen',
5471
- allowtransparency: 'allowTransparency',
5472
- alt: 'alt',
5473
- async: 'async',
5474
- autocomplete: 'autoComplete',
5475
- autoplay: 'autoPlay',
5476
- capture: 'capture',
5477
- cellpadding: 'cellPadding',
5478
- cellspacing: 'cellSpacing',
5479
- charset: 'charSet',
5480
- challenge: 'challenge',
5481
- checked: 'checked',
5482
- classid: 'classID',
5483
- class: 'className',
5484
- cols: 'cols',
5485
- colspan: 'colSpan',
5486
- content: 'content',
5487
- contenteditable: 'contentEditable',
5488
- contextmenu: 'contextMenu',
5489
- controls: 'controls',
5490
- coords: 'coords',
5491
- crossorigin: 'crossOrigin',
5492
- data: 'data',
5493
- datetime: 'dateTime',
5494
- default: 'default',
5495
- defer: 'defer',
5496
- dir: 'dir',
5497
- disabled: 'disabled',
5498
- download: 'download',
5499
- draggable: 'draggable',
5500
- enctype: 'encType',
5501
- form: 'form',
5502
- formaction: 'formAction',
5503
- formenctype: 'formEncType',
5504
- formmethod: 'formMethod',
5505
- formnovalidate: 'formNoValidate',
5506
- formtarget: 'formTarget',
5507
- frameborder: 'frameBorder',
5508
- headers: 'headers',
5509
- height: 'height',
5510
- hidden: 'hidden',
5511
- high: 'high',
5512
- href: 'href',
5513
- hreflang: 'hrefLang',
5514
- for: 'htmlFor',
5515
- 'http-equiv': 'httpEquiv',
5516
- icon: 'icon',
5517
- id: 'id',
5518
- inputmode: 'inputMode',
5519
- integrity: 'integrity',
5520
- is: 'is',
5521
- keyparams: 'keyParams',
5522
- keytype: 'keyType',
5523
- kind: 'kind',
5524
- label: 'label',
5525
- lang: 'lang',
5526
- list: 'list',
5527
- loop: 'loop',
5528
- low: 'low',
5529
- manifest: 'manifest',
5530
- marginheight: 'marginHeight',
5531
- marginwidth: 'marginWidth',
5532
- max: 'max',
5533
- maxlength: 'maxLength',
5534
- media: 'media',
5535
- mediagroup: 'mediaGroup',
5536
- method: 'method',
5537
- min: 'min',
5538
- minlength: 'minLength',
5539
- multiple: 'multiple',
5540
- muted: 'muted',
5541
- name: 'name',
5542
- nonce: 'nonce',
5543
- novalidate: 'noValidate',
5544
- open: 'open',
5545
- optimum: 'optimum',
5546
- pattern: 'pattern',
5547
- placeholder: 'placeholder',
5548
- poster: 'poster',
5549
- preload: 'preload',
5550
- radiogroup: 'radioGroup',
5551
- readonly: 'readOnly',
5552
- rel: 'rel',
5553
- required: 'required',
5554
- reversed: 'reversed',
5555
- role: 'role',
5556
- rows: 'rows',
5557
- rowspan: 'rowSpan',
5558
- sandbox: 'sandbox',
5559
- scope: 'scope',
5560
- scoped: 'scoped',
5561
- scrolling: 'scrolling',
5562
- seamless: 'seamless',
5563
- selected: 'selected',
5564
- shape: 'shape',
5565
- size: 'size',
5566
- sizes: 'sizes',
5567
- span: 'span',
5568
- spellcheck: 'spellCheck',
5569
- src: 'src',
5570
- srcdoc: 'srcDoc',
5571
- srclang: 'srcLang',
5572
- srcset: 'srcSet',
5573
- start: 'start',
5574
- step: 'step',
5575
- style: 'style',
5576
- summary: 'summary',
5577
- tabindex: 'tabIndex',
5578
- target: 'target',
5579
- title: 'title',
5580
- type: 'type',
5581
- usemap: 'useMap',
5582
- value: 'value',
5583
- width: 'width',
5584
- wmode: 'wmode',
5585
- wrap: 'wrap',
5586
- /**
5587
- * RDFa Properties
5588
- */
5589
- about: 'about',
5590
- datatype: 'datatype',
5591
- inlist: 'inlist',
5592
- prefix: 'prefix',
5593
- property: 'property',
5594
- resource: 'resource',
5595
- typeof: 'typeof',
5596
- vocab: 'vocab',
5597
- /**
5598
- * Non-standard Properties
5599
- */
5600
- autocapitalize: 'autoCapitalize',
5601
- autocorrect: 'autoCorrect',
5602
- autosave: 'autoSave',
5603
- color: 'color',
5604
- itemprop: 'itemProp',
5605
- itemscope: 'itemScope',
5606
- itemtype: 'itemType',
5607
- itemid: 'itemID',
5608
- itemref: 'itemRef',
5609
- results: 'results',
5610
- security: 'security',
5611
- unselectable: 'unselectable',
5612
- autofocus: 'autoFocus'
5613
  };
5614
 
5615
  /***/ }),
5616
-
5617
- /***/ 449:
5618
  /***/ (function(module, exports, __webpack_require__) {
5619
 
5620
  "use strict";
5621
 
5622
 
5623
  Object.defineProperty(exports, "__esModule", {
5624
- value: true
5625
  });
5626
 
5627
- 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"); } }; }();
5628
-
5629
- exports.default = InlineStyleToObject;
5630
- /**
5631
- * Converts an inline style string into an object of React style properties
5632
- *
5633
- * @param {String} inlineStyle='' The inline style to convert
5634
- * @returns {Object} The converted style
5635
- */
5636
- function InlineStyleToObject() {
5637
- var inlineStyle = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
5638
-
5639
-
5640
- // just return empty object if the inlineStyle is empty
5641
- if (inlineStyle === '') {
5642
- return {};
5643
- }
5644
 
5645
- return inlineStyle.split(';').reduce(function (styleObject, stylePropertyValue) {
5646
 
5647
- // extract the style property name and value
5648
 
5649
- var _stylePropertyValue$s = stylePropertyValue.split(':').map(function (item) {
5650
- return item.trim().toLowerCase();
5651
- });
5652
 
5653
- var _stylePropertyValue$s2 = _slicedToArray(_stylePropertyValue$s, 2);
5654
-
5655
- var property = _stylePropertyValue$s2[0];
5656
- var value = _stylePropertyValue$s2[1];
5657
-
5658
- // if there is no value (i.e. no : in the style) then ignore it
5659
-
5660
- if (value === undefined) {
5661
- return styleObject;
5662
- }
5663
-
5664
- // convert the property name into the correct React format
5665
- // remove all hyphens and convert the letter immediately after each hyphen to upper case
5666
- // additionally don't uppercase any -ms- prefix
5667
- // e.g. -ms-style-property = msStyleProperty
5668
- // -webkit-style-property = WebkitStyleProperty
5669
- property = property.replace(/^-ms-/, 'ms-').replace(/-(.)/g, function (_, character) {
5670
- return character.toUpperCase();
5671
  });
5672
-
5673
- // add the new style property and value to the style object
5674
- styleObject[property] = value;
5675
-
5676
- return styleObject;
5677
- }, {});
5678
- }
5679
-
5680
- /***/ }),
5681
-
5682
- /***/ 45:
5683
- /***/ (function(module, exports) {
5684
-
5685
- //Types of elements found in the DOM
5686
- module.exports = {
5687
- Text: "text", //Text
5688
- Directive: "directive", //<? ... ?>
5689
- Comment: "comment", //<!-- ... -->
5690
- Script: "script", //<script> tags
5691
- Style: "style", //<style> tags
5692
- Tag: "tag", //Any tag
5693
- CDATA: "cdata", //<![CDATA[ ... ]]>
5694
- Doctype: "doctype",
5695
-
5696
- isTag: function(elem){
5697
- return elem.type === "tag" || elem.type === "script" || elem.type === "style";
5698
- }
5699
  };
5700
 
 
 
 
5701
 
5702
- /***/ }),
 
5703
 
5704
- /***/ 450:
5705
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
5706
 
5707
- "use strict";
 
 
 
 
 
 
 
 
5708
 
 
 
 
 
 
 
 
5709
 
5710
- Object.defineProperty(exports, "__esModule", {
5711
- value: true
5712
- });
5713
- exports.default = TransformTagName;
5714
- var TAGS_TO_TRANSFORM = {
5715
- 'html': 'div',
5716
- 'head': 'div',
5717
- 'body': 'div'
5718
- };
5719
 
5720
- /**
5721
- * Transforms the specified tag name to another tag name if needed
5722
- *
5723
- * @param {String} tagName The name of the tag
5724
- * @returns {String} The transformed tag name or the original if it doesn't need to be transformed
5725
- */
5726
- function TransformTagName(tagName) {
5727
- if (TAGS_TO_TRANSFORM.hasOwnProperty(tagName)) {
5728
- return TAGS_TO_TRANSFORM[tagName];
5729
- } else {
5730
- return tagName;
5731
- }
5732
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5733
 
5734
- /***/ }),
 
 
 
 
 
 
 
 
5735
 
5736
- /***/ 451:
5737
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
5738
 
5739
- "use strict";
 
 
 
 
 
 
 
 
 
 
 
5740
 
 
 
 
 
 
 
 
 
5741
 
5742
- Object.defineProperty(exports, "__esModule", {
5743
- value: true
5744
- });
5745
- /**
5746
- * List of void elements
5747
- * These elements are not allowed to have children
5748
- * @type {Array}
5749
- */
5750
- exports.default = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
5751
 
5752
- /***/ }),
 
 
 
5753
 
5754
- /***/ 452:
5755
- /***/ (function(module, exports, __webpack_require__) {
5756
 
5757
- "use strict";
 
 
 
 
 
5758
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5759
 
5760
- Object.defineProperty(exports, "__esModule", {
5761
- value: true
5762
- });
5763
- exports.default = StyleElementType;
5764
 
5765
- var _react = __webpack_require__(2);
 
 
 
 
 
 
 
5766
 
5767
- var _react2 = _interopRequireDefault(_react);
 
 
 
 
5768
 
5769
- var _GeneratePropsFromAttributes = __webpack_require__(269);
 
 
 
 
 
 
 
 
 
5770
 
5771
- var _GeneratePropsFromAttributes2 = _interopRequireDefault(_GeneratePropsFromAttributes);
 
 
 
 
 
 
 
 
5772
 
5773
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
 
 
 
 
 
 
 
5774
 
5775
- /**
5776
- * Converts a <style> element to a React element
5777
- *
5778
- * @param {Object} node The style node
5779
- * @param {String} key The key to give the React element
5780
- * @returns {React.Element} The React style element
5781
- */
5782
- function StyleElementType(node, key) {
 
 
 
 
 
 
 
 
 
 
 
5783
 
5784
- // The style element only ever has a single child which is the styles so try and find this to add as
5785
- // a child to the style element that will be created
5786
- var styles = void 0;
5787
- if (node.children.length > 0) {
5788
- styles = node.children[0].data;
5789
- }
5790
 
5791
- // generate props
5792
- var props = (0, _GeneratePropsFromAttributes2.default)(node.attribs, key);
 
5793
 
5794
- // create and return the element
5795
- return _react2.default.createElement('style', props, styles);
5796
- }
5797
 
5798
- /***/ }),
5799
 
5800
- /***/ 453:
 
5801
  /***/ (function(module, exports, __webpack_require__) {
5802
 
5803
  "use strict";
5804
 
5805
 
5806
  Object.defineProperty(exports, "__esModule", {
5807
- value: true
5808
  });
5809
- exports.default = UnsupportedElementType;
5810
- /**
5811
- * Handles an unsupported element type by returning null so nothing is rendered
5812
- * @returns {null}
5813
- */
5814
- function UnsupportedElementType() {
5815
-
5816
- // do nothing because the element type is unsupported
5817
- // comment, directive, script, cdata, doctype are all currently unsupported
5818
- return null;
5819
- }
5820
-
5821
- /***/ }),
5822
-
5823
- /***/ 46:
5824
- /***/ (function(module, exports, __webpack_require__) {
5825
-
5826
- /* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.
5827
- //
5828
- // Permission is hereby granted, free of charge, to any person obtaining a
5829
- // copy of this software and associated documentation files (the
5830
- // "Software"), to deal in the Software without restriction, including
5831
- // without limitation the rights to use, copy, modify, merge, publish,
5832
- // distribute, sublicense, and/or sell copies of the Software, and to permit
5833
- // persons to whom the Software is furnished to do so, subject to the
5834
- // following conditions:
5835
- //
5836
- // The above copyright notice and this permission notice shall be included
5837
- // in all copies or substantial portions of the Software.
5838
- //
5839
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5840
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5841
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5842
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5843
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5844
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5845
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
5846
-
5847
- // NOTE: These type checking functions intentionally don't use `instanceof`
5848
- // because it is fragile and can be easily faked with `Object.create()`.
5849
-
5850
- function isArray(arg) {
5851
- if (Array.isArray) {
5852
- return Array.isArray(arg);
5853
- }
5854
- return objectToString(arg) === '[object Array]';
5855
- }
5856
- exports.isArray = isArray;
5857
-
5858
- function isBoolean(arg) {
5859
- return typeof arg === 'boolean';
5860
- }
5861
- exports.isBoolean = isBoolean;
5862
 
5863
- function isNull(arg) {
5864
- return arg === null;
5865
- }
5866
- exports.isNull = isNull;
5867
-
5868
- function isNullOrUndefined(arg) {
5869
- return arg == null;
5870
- }
5871
- exports.isNullOrUndefined = isNullOrUndefined;
5872
 
5873
- function isNumber(arg) {
5874
- return typeof arg === 'number';
5875
- }
5876
- exports.isNumber = isNumber;
5877
 
5878
- function isString(arg) {
5879
- return typeof arg === 'string';
5880
- }
5881
- exports.isString = isString;
5882
 
5883
- function isSymbol(arg) {
5884
- return typeof arg === 'symbol';
5885
- }
5886
- exports.isSymbol = isSymbol;
5887
 
5888
- function isUndefined(arg) {
5889
- return arg === void 0;
5890
- }
5891
- exports.isUndefined = isUndefined;
 
5892
 
5893
- function isRegExp(re) {
5894
- return objectToString(re) === '[object RegExp]';
5895
- }
5896
- exports.isRegExp = isRegExp;
5897
 
5898
- function isObject(arg) {
5899
- return typeof arg === 'object' && arg !== null;
5900
- }
5901
- exports.isObject = isObject;
 
 
 
5902
 
5903
- function isDate(d) {
5904
- return objectToString(d) === '[object Date]';
5905
- }
5906
- exports.isDate = isDate;
5907
 
5908
- function isError(e) {
5909
- return (objectToString(e) === '[object Error]' || e instanceof Error);
5910
- }
5911
- exports.isError = isError;
5912
 
5913
- function isFunction(arg) {
5914
- return typeof arg === 'function';
5915
- }
5916
- exports.isFunction = isFunction;
5917
-
5918
- function isPrimitive(arg) {
5919
- return arg === null ||
5920
- typeof arg === 'boolean' ||
5921
- typeof arg === 'number' ||
5922
- typeof arg === 'string' ||
5923
- typeof arg === 'symbol' || // ES6 symbol
5924
- typeof arg === 'undefined';
5925
- }
5926
- exports.isPrimitive = isPrimitive;
5927
 
5928
- exports.isBuffer = Buffer.isBuffer;
 
 
 
5929
 
5930
- function objectToString(o) {
5931
- return Object.prototype.toString.call(o);
5932
- }
5933
 
5934
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(90).Buffer))
5935
 
5936
  /***/ }),
5937
-
5938
- /***/ 471:
5939
  /***/ (function(module, exports, __webpack_require__) {
5940
 
5941
  "use strict";
5942
 
5943
 
5944
  Object.defineProperty(exports, "__esModule", {
5945
- value: true
5946
  });
5947
- exports.fromNewsletter = exports.fromUrl = exports.fromDom = undefined;
5948
-
5949
- var _underscore = __webpack_require__(7);
5950
-
5951
- var _underscore2 = _interopRequireDefault(_underscore);
5952
-
5953
- var _mailpoet = __webpack_require__(3);
5954
-
5955
- var _mailpoet2 = _interopRequireDefault(_mailpoet);
5956
 
5957
- var _html2canvas = __webpack_require__(472);
5958
 
5959
- var _html2canvas2 = _interopRequireDefault(_html2canvas);
5960
 
5961
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5962
 
5963
- /**
5964
- * Generates a thumbnail from a DOM element.
5965
- *
5966
- * @param {DOMElement} element
5967
- * @return {Promise<String>} DataURL of the generated image.
5968
- */
5969
- var fromDom = exports.fromDom = function fromDom(element) {
5970
- return (0, _html2canvas2.default)(element, {
5971
- logging: false
5972
- }).then(function (canvas) {
5973
- return canvas.toDataURL('image/jpeg');
5974
- });
5975
  };
5976
 
5977
- /**
5978
- * Generates a thumbnail from an URL.
5979
- *
5980
- * @param {String} url
5981
- * @return {Promise<String>} DataURL of the generated image.
5982
- */
5983
- var fromUrl = exports.fromUrl = function fromUrl(url) {
5984
- return new Promise(function (resolve, reject) {
5985
- var iframe = document.createElement('iframe');
5986
- var protocol = location.href.startsWith('https://') ? 'https:' : 'http:';
5987
- iframe.src = protocol + url.replace(/^https?:/, '');
5988
- iframe.style.opacity = 0;
5989
- iframe.scrolling = 'no';
5990
- iframe.onload = function () {
5991
- fromDom(iframe.contentDocument.documentElement).then(function (image) {
5992
- document.body.removeChild(iframe);
5993
- resolve(image);
5994
- }).catch(function () {
5995
- document.body.removeChild(iframe);
5996
- reject(_mailpoet2.default.I18n.t('errorWhileTakingScreenshot'));
5997
- });
5998
- };
5999
- var onError = function onError() {
6000
- document.body.removeChild(iframe);
6001
- reject(_mailpoet2.default.I18n.t('errorWhileTakingScreenshot'));
6002
- };
6003
- iframe.onerror = onError;
6004
- iframe.onError = onError;
6005
- iframe.className = 'mailpoet_template_iframe';
6006
- try {
6007
- document.body.appendChild(iframe);
6008
- } catch (err) {
6009
- onError();
6010
- }
6011
- });
6012
- };
6013
 
6014
- /**
6015
- * Generates a thumbnail from a newsletter's data.
6016
- *
6017
- * @param {Object} data
6018
- * @return {Promise<String>} DataURL of the generated image.
6019
- */
6020
- var fromNewsletter = exports.fromNewsletter = function fromNewsletter(data) {
6021
- return new Promise(function (resolve, reject) {
6022
- var json = data;
6023
- if (!_underscore2.default.isUndefined(json.body)) {
6024
- json.body = JSON.stringify(json.body);
6025
- }
6026
- _mailpoet2.default.Ajax.post({
6027
- api_version: window.mailpoet_api_version,
6028
- endpoint: 'newsletters',
6029
- action: 'showPreview',
6030
- data: json
6031
- }).done(function (response) {
6032
- return fromUrl(response.meta.preview_url).then(resolve).catch(reject);
6033
- }).fail(function (response) {
6034
- return reject(response.errors);
6035
  });
6036
- });
6037
  };
6038
 
6039
  /***/ }),
6040
-
6041
- /***/ 472:
6042
  /***/ (function(module, exports, __webpack_require__) {
6043
 
6044
- /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["html2canvas"] = __webpack_require__(473);
6045
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
6046
 
6047
- /***/ }),
6048
 
6049
- /***/ 473:
6050
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
6051
 
6052
- /*!
6053
- * html2canvas 1.0.0-alpha.12 <https://html2canvas.hertzen.com>
6054
- * Copyright (c) 2018 Niklas von Hertzen <https://hertzen.com>
6055
- * Released under MIT License
6056
- */
6057
- (function webpackUniversalModuleDefinition(root, factory) {
6058
- if(true)
6059
- module.exports = factory();
6060
- else if(typeof define === 'function' && define.amd)
6061
- define([], factory);
6062
- else if(typeof exports === 'object')
6063
- exports["html2canvas"] = factory();
6064
- else
6065
- root["html2canvas"] = factory();
6066
- })(this, function() {
6067
- return /******/ (function(modules) { // webpackBootstrap
6068
- /******/ // The module cache
6069
- /******/ var installedModules = {};
6070
- /******/
6071
- /******/ // The require function
6072
- /******/ function __webpack_require__(moduleId) {
6073
- /******/
6074
- /******/ // Check if module is in cache
6075
- /******/ if(installedModules[moduleId]) {
6076
- /******/ return installedModules[moduleId].exports;
6077
- /******/ }
6078
- /******/ // Create a new module (and put it into the cache)
6079
- /******/ var module = installedModules[moduleId] = {
6080
- /******/ i: moduleId,
6081
- /******/ l: false,
6082
- /******/ exports: {}
6083
- /******/ };
6084
- /******/
6085
- /******/ // Execute the module function
6086
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
6087
- /******/
6088
- /******/ // Flag the module as loaded
6089
- /******/ module.l = true;
6090
- /******/
6091
- /******/ // Return the exports of the module
6092
- /******/ return module.exports;
6093
- /******/ }
6094
- /******/
6095
- /******/
6096
- /******/ // expose the modules object (__webpack_modules__)
6097
- /******/ __webpack_require__.m = modules;
6098
- /******/
6099
- /******/ // expose the module cache
6100
- /******/ __webpack_require__.c = installedModules;
6101
- /******/
6102
- /******/ // define getter function for harmony exports
6103
- /******/ __webpack_require__.d = function(exports, name, getter) {
6104
- /******/ if(!__webpack_require__.o(exports, name)) {
6105
- /******/ Object.defineProperty(exports, name, {
6106
- /******/ configurable: false,
6107
- /******/ enumerable: true,
6108
- /******/ get: getter
6109
- /******/ });
6110
- /******/ }
6111
- /******/ };
6112
- /******/
6113
- /******/ // getDefaultExport function for compatibility with non-harmony modules
6114
- /******/ __webpack_require__.n = function(module) {
6115
- /******/ var getter = module && module.__esModule ?
6116
- /******/ function getDefault() { return module['default']; } :
6117
- /******/ function getModuleExports() { return module; };
6118
- /******/ __webpack_require__.d(getter, 'a', getter);
6119
- /******/ return getter;
6120
- /******/ };
6121
- /******/
6122
- /******/ // Object.prototype.hasOwnProperty.call
6123
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
6124
- /******/
6125
- /******/ // __webpack_public_path__
6126
- /******/ __webpack_require__.p = "";
6127
- /******/
6128
- /******/ // Load entry module and return exports
6129
- /******/ return __webpack_require__(__webpack_require__.s = 27);
6130
- /******/ })
6131
- /************************************************************************/
6132
- /******/ ([
6133
- /* 0 */
6134
  /***/ (function(module, exports, __webpack_require__) {
6135
 
6136
  "use strict";
6137
 
6138
 
6139
- // http://dev.w3.org/csswg/css-color/
6140
-
6141
  Object.defineProperty(exports, "__esModule", {
6142
  value: true
6143
  });
 
 
 
 
 
 
 
6144
 
6145
- 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"); } }; }();
 
 
 
 
 
 
 
 
 
 
6146
 
6147
- 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; }; }();
 
6148
 
6149
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
6150
 
6151
- var HEX3 = /^#([a-f0-9]{3})$/i;
6152
- var hex3 = function hex3(value) {
6153
- var match = value.match(HEX3);
6154
- if (match) {
6155
- 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];
6156
- }
6157
- return false;
6158
- };
6159
 
6160
- var HEX6 = /^#([a-f0-9]{6})$/i;
6161
- var hex6 = function hex6(value) {
6162
- var match = value.match(HEX6);
6163
- if (match) {
6164
- return [parseInt(match[1].substring(0, 2), 16), parseInt(match[1].substring(2, 4), 16), parseInt(match[1].substring(4, 6), 16), null];
6165
- }
6166
- return false;
6167
- };
6168
 
6169
- var RGB = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;
6170
- var rgb = function rgb(value) {
6171
- var match = value.match(RGB);
6172
- if (match) {
6173
- return [Number(match[1]), Number(match[2]), Number(match[3]), null];
6174
- }
6175
- return false;
 
6176
  };
6177
 
6178
- var RGBA = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/;
6179
- var rgba = function rgba(value) {
6180
- var match = value.match(RGBA);
6181
- if (match && match.length > 4) {
6182
- return [Number(match[1]), Number(match[2]), Number(match[3]), Number(match[4])];
 
 
 
6183
  }
6184
- return false;
6185
- };
6186
 
6187
- var fromArray = function fromArray(array) {
6188
- return [Math.min(array[0], 255), Math.min(array[1], 255), Math.min(array[2], 255), array.length > 3 ? array[3] : null];
6189
  };
6190
 
6191
- var namedColor = function namedColor(name) {
6192
- var color = NAMED_COLORS[name.toLowerCase()];
6193
- return color ? color : false;
6194
- };
6195
 
6196
- var Color = function () {
6197
- function Color(value) {
6198
- _classCallCheck(this, Color);
6199
 
6200
- var _ref = Array.isArray(value) ? fromArray(value) : hex3(value) || rgb(value) || rgba(value) || namedColor(value) || hex6(value) || [0, 0, 0, null],
6201
- _ref2 = _slicedToArray(_ref, 4),
6202
- r = _ref2[0],
6203
- g = _ref2[1],
6204
- b = _ref2[2],
6205
- a = _ref2[3];
6206
 
6207
- this.r = r;
6208
- this.g = g;
6209
- this.b = b;
6210
- this.a = a;
6211
- }
6212
 
6213
- _createClass(Color, [{
6214
- key: 'isTransparent',
6215
- value: function isTransparent() {
6216
- return this.a === 0;
6217
- }
6218
- }, {
6219
- key: 'toString',
6220
- value: function toString() {
6221
- return this.a !== null && this.a !== 1 ? 'rgba(' + this.r + ',' + this.g + ',' + this.b + ',' + this.a + ')' : 'rgb(' + this.r + ',' + this.g + ',' + this.b + ')';
6222
- }
6223
- }]);
6224
 
6225
- return Color;
6226
- }();
6227
 
6228
- exports.default = Color;
6229
 
 
6230
 
6231
- var NAMED_COLORS = {
6232
- transparent: [0, 0, 0, 0],
6233
- aliceblue: [240, 248, 255, null],
6234
- antiquewhite: [250, 235, 215, null],
6235
- aqua: [0, 255, 255, null],
6236
- aquamarine: [127, 255, 212, null],
6237
- azure: [240, 255, 255, null],
6238
- beige: [245, 245, 220, null],
6239
- bisque: [255, 228, 196, null],
6240
- black: [0, 0, 0, null],
6241
- blanchedalmond: [255, 235, 205, null],
6242
- blue: [0, 0, 255, null],
6243
- blueviolet: [138, 43, 226, null],
6244
- brown: [165, 42, 42, null],
6245
- burlywood: [222, 184, 135, null],
6246
- cadetblue: [95, 158, 160, null],
6247
- chartreuse: [127, 255, 0, null],
6248
- chocolate: [210, 105, 30, null],
6249
- coral: [255, 127, 80, null],
6250
- cornflowerblue: [100, 149, 237, null],
6251
- cornsilk: [255, 248, 220, null],
6252
- crimson: [220, 20, 60, null],
6253
- cyan: [0, 255, 255, null],
6254
- darkblue: [0, 0, 139, null],
6255
- darkcyan: [0, 139, 139, null],
6256
- darkgoldenrod: [184, 134, 11, null],
6257
- darkgray: [169, 169, 169, null],
6258
- darkgreen: [0, 100, 0, null],
6259
- darkgrey: [169, 169, 169, null],
6260
- darkkhaki: [189, 183, 107, null],
6261
- darkmagenta: [139, 0, 139, null],
6262
- darkolivegreen: [85, 107, 47, null],
6263
- darkorange: [255, 140, 0, null],
6264
- darkorchid: [153, 50, 204, null],
6265
- darkred: [139, 0, 0, null],
6266
- darksalmon: [233, 150, 122, null],
6267
- darkseagreen: [143, 188, 143, null],
6268
- darkslateblue: [72, 61, 139, null],
6269
- darkslategray: [47, 79, 79, null],
6270
- darkslategrey: [47, 79, 79, null],
6271
- darkturquoise: [0, 206, 209, null],
6272
- darkviolet: [148, 0, 211, null],
6273
- deeppink: [255, 20, 147, null],
6274
- deepskyblue: [0, 191, 255, null],
6275
- dimgray: [105, 105, 105, null],
6276
- dimgrey: [105, 105, 105, null],
6277
- dodgerblue: [30, 144, 255, null],
6278
- firebrick: [178, 34, 34, null],
6279
- floralwhite: [255, 250, 240, null],
6280
- forestgreen: [34, 139, 34, null],
6281
- fuchsia: [255, 0, 255, null],
6282
- gainsboro: [220, 220, 220, null],
6283
- ghostwhite: [248, 248, 255, null],
6284
- gold: [255, 215, 0, null],
6285
- goldenrod: [218, 165, 32, null],
6286
- gray: [128, 128, 128, null],
6287
- green: [0, 128, 0, null],
6288
- greenyellow: [173, 255, 47, null],
6289
- grey: [128, 128, 128, null],
6290
- honeydew: [240, 255, 240, null],
6291
- hotpink: [255, 105, 180, null],
6292
- indianred: [205, 92, 92, null],
6293
- indigo: [75, 0, 130, null],
6294
- ivory: [255, 255, 240, null],
6295
- khaki: [240, 230, 140, null],
6296
- lavender: [230, 230, 250, null],
6297
- lavenderblush: [255, 240, 245, null],
6298
- lawngreen: [124, 252, 0, null],
6299
- lemonchiffon: [255, 250, 205, null],
6300
- lightblue: [173, 216, 230, null],
6301
- lightcoral: [240, 128, 128, null],
6302
- lightcyan: [224, 255, 255, null],
6303
- lightgoldenrodyellow: [250, 250, 210, null],
6304
- lightgray: [211, 211, 211, null],
6305
- lightgreen: [144, 238, 144, null],
6306
- lightgrey: [211, 211, 211, null],
6307
- lightpink: [255, 182, 193, null],
6308
- lightsalmon: [255, 160, 122, null],
6309
- lightseagreen: [32, 178, 170, null],
6310
- lightskyblue: [135, 206, 250, null],
6311
- lightslategray: [119, 136, 153, null],
6312
- lightslategrey: [119, 136, 153, null],
6313
- lightsteelblue: [176, 196, 222, null],
6314
- lightyellow: [255, 255, 224, null],
6315
- lime: [0, 255, 0, null],
6316
- limegreen: [50, 205, 50, null],
6317
- linen: [250, 240, 230, null],
6318
- magenta: [255, 0, 255, null],
6319
- maroon: [128, 0, 0, null],
6320
- mediumaquamarine: [102, 205, 170, null],
6321
- mediumblue: [0, 0, 205, null],
6322
- mediumorchid: [186, 85, 211, null],
6323
- mediumpurple: [147, 112, 219, null],
6324
- mediumseagreen: [60, 179, 113, null],
6325
- mediumslateblue: [123, 104, 238, null],
6326
- mediumspringgreen: [0, 250, 154, null],
6327
- mediumturquoise: [72, 209, 204, null],
6328
- mediumvioletred: [199, 21, 133, null],
6329
- midnightblue: [25, 25, 112, null],
6330
- mintcream: [245, 255, 250, null],
6331
- mistyrose: [255, 228, 225, null],
6332
- moccasin: [255, 228, 181, null],
6333
- navajowhite: [255, 222, 173, null],
6334
- navy: [0, 0, 128, null],
6335
- oldlace: [253, 245, 230, null],
6336
- olive: [128, 128, 0, null],
6337
- olivedrab: [107, 142, 35, null],
6338
- orange: [255, 165, 0, null],
6339
- orangered: [255, 69, 0, null],
6340
- orchid: [218, 112, 214, null],
6341
- palegoldenrod: [238, 232, 170, null],
6342
- palegreen: [152, 251, 152, null],
6343
- paleturquoise: [175, 238, 238, null],
6344
- palevioletred: [219, 112, 147, null],
6345
- papayawhip: [255, 239, 213, null],
6346
- peachpuff: [255, 218, 185, null],
6347
- peru: [205, 133, 63, null],
6348
- pink: [255, 192, 203, null],
6349
- plum: [221, 160, 221, null],
6350
- powderblue: [176, 224, 230, null],
6351
- purple: [128, 0, 128, null],
6352
- rebeccapurple: [102, 51, 153, null],
6353
- red: [255, 0, 0, null],
6354
- rosybrown: [188, 143, 143, null],
6355
- royalblue: [65, 105, 225, null],
6356
- saddlebrown: [139, 69, 19, null],
6357
- salmon: [250, 128, 114, null],
6358
- sandybrown: [244, 164, 96, null],
6359
- seagreen: [46, 139, 87, null],
6360
- seashell: [255, 245, 238, null],
6361
- sienna: [160, 82, 45, null],
6362
- silver: [192, 192, 192, null],
6363
- skyblue: [135, 206, 235, null],
6364
- slateblue: [106, 90, 205, null],
6365
- slategray: [112, 128, 144, null],
6366
- slategrey: [112, 128, 144, null],
6367
- snow: [255, 250, 250, null],
6368
- springgreen: [0, 255, 127, null],
6369
- steelblue: [70, 130, 180, null],
6370
- tan: [210, 180, 140, null],
6371
- teal: [0, 128, 128, null],
6372
- thistle: [216, 191, 216, null],
6373
- tomato: [255, 99, 71, null],
6374
- turquoise: [64, 224, 208, null],
6375
- violet: [238, 130, 238, null],
6376
- wheat: [245, 222, 179, null],
6377
- white: [255, 255, 255, null],
6378
- whitesmoke: [245, 245, 245, null],
6379
- yellow: [255, 255, 0, null],
6380
- yellowgreen: [154, 205, 50, null]
6381
- };
6382
 
6383
- var TRANSPARENT = exports.TRANSPARENT = new Color([0, 0, 0, 0]);
6384
 
6385
- /***/ }),
6386
- /* 1 */
6387
- /***/ (function(module, exports, __webpack_require__) {
6388
 
6389
- "use strict";
6390
 
 
6391
 
6392
- Object.defineProperty(exports, "__esModule", {
6393
- value: true
6394
- });
6395
- exports.calculateLengthFromValueWithUnit = exports.LENGTH_TYPE = undefined;
6396
 
6397
- 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; }; }();
6398
 
6399
- var _NodeContainer = __webpack_require__(3);
6400
 
6401
- var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
6402
 
6403
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6404
 
6405
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6406
 
6407
- var LENGTH_WITH_UNIT = /([\d.]+)(px|r?em|%)/i;
6408
 
6409
- var LENGTH_TYPE = exports.LENGTH_TYPE = {
6410
- PX: 0,
6411
- PERCENTAGE: 1
 
 
 
 
 
 
 
 
 
 
 
6412
  };
6413
 
6414
- var Length = function () {
6415
- function Length(value) {
6416
- _classCallCheck(this, Length);
6417
 
6418
- this.type = value.substr(value.length - 1) === '%' ? LENGTH_TYPE.PERCENTAGE : LENGTH_TYPE.PX;
6419
- var parsedValue = parseFloat(value);
6420
- if (true && isNaN(parsedValue)) {
6421
- console.error('Invalid value given for Length: "' + value + '"');
6422
- }
6423
- this.value = isNaN(parsedValue) ? 0 : parsedValue;
6424
- }
6425
 
6426
- _createClass(Length, [{
6427
- key: 'isPercentage',
6428
- value: function isPercentage() {
6429
- return this.type === LENGTH_TYPE.PERCENTAGE;
6430
- }
6431
- }, {
6432
- key: 'getAbsoluteValue',
6433
- value: function getAbsoluteValue(parentLength) {
6434
- return this.isPercentage() ? parentLength * (this.value / 100) : this.value;
6435
- }
6436
- }], [{
6437
- key: 'create',
6438
- value: function create(v) {
6439
- return new Length(v);
6440
- }
6441
- }]);
6442
 
6443
- return Length;
6444
- }();
 
 
 
 
 
 
 
 
6445
 
6446
- exports.default = Length;
 
 
6447
 
 
 
 
 
6448
 
6449
- var getRootFontSize = function getRootFontSize(container) {
6450
- var parent = container.parent;
6451
- return parent ? getRootFontSize(parent) : parseFloat(container.style.font.fontSize);
 
 
 
 
 
 
6452
  };
6453
 
6454
- var calculateLengthFromValueWithUnit = exports.calculateLengthFromValueWithUnit = function calculateLengthFromValueWithUnit(container, value, unit) {
6455
- switch (unit) {
6456
- case 'px':
6457
- case '%':
6458
- return new Length(value + unit);
6459
- case 'em':
6460
- case 'rem':
6461
- var length = new Length(value);
6462
- length.value *= unit === 'em' ? parseFloat(container.style.font.fontSize) : getRootFontSize(container);
6463
- return length;
6464
- default:
6465
- // TODO: handle correctly if unknown unit is used
6466
- return new Length('0');
 
 
 
6467
  }
6468
  };
6469
 
 
 
 
 
 
 
6470
  /***/ }),
6471
- /* 2 */
6472
  /***/ (function(module, exports, __webpack_require__) {
6473
 
6474
  "use strict";
@@ -6477,207 +3886,218 @@ var calculateLengthFromValueWithUnit = exports.calculateLengthFromValueWithUnit
6477
  Object.defineProperty(exports, "__esModule", {
6478
  value: true
6479
  });
6480
- exports.parseBoundCurves = exports.calculatePaddingBoxPath = exports.calculateBorderBoxPath = exports.parsePathForBorder = exports.parseDocumentSize = exports.calculateContentBox = exports.calculatePaddingBox = exports.parseBounds = exports.Bounds = undefined;
6481
 
6482
- 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; }; }();
6483
 
6484
- var _Vector = __webpack_require__(7);
6485
 
6486
- var _Vector2 = _interopRequireDefault(_Vector);
6487
 
6488
- var _BezierCurve = __webpack_require__(32);
6489
 
6490
- var _BezierCurve2 = _interopRequireDefault(_BezierCurve);
6491
 
6492
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6493
 
6494
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6495
 
6496
- var TOP = 0;
6497
- var RIGHT = 1;
6498
- var BOTTOM = 2;
6499
- var LEFT = 3;
6500
-
6501
- var H = 0;
6502
- var V = 1;
6503
 
6504
- var Bounds = exports.Bounds = function () {
6505
- function Bounds(x, y, w, h) {
6506
- _classCallCheck(this, Bounds);
6507
 
6508
- this.left = x;
6509
- this.top = y;
6510
- this.width = w;
6511
- this.height = h;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6512
  }
 
 
6513
 
6514
- _createClass(Bounds, null, [{
6515
- key: 'fromClientRect',
6516
- value: function fromClientRect(clientRect, scrollX, scrollY) {
6517
- return new Bounds(clientRect.left + scrollX, clientRect.top + scrollY, clientRect.width, clientRect.height);
 
 
 
 
 
6518
  }
6519
- }]);
6520
-
6521
- return Bounds;
6522
- }();
6523
-
6524
- var parseBounds = exports.parseBounds = function parseBounds(node, scrollX, scrollY) {
6525
- return Bounds.fromClientRect(node.getBoundingClientRect(), scrollX, scrollY);
6526
  };
6527
 
6528
- var calculatePaddingBox = exports.calculatePaddingBox = function calculatePaddingBox(bounds, borders) {
6529
- 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));
 
 
 
6530
  };
6531
 
6532
- var calculateContentBox = exports.calculateContentBox = function calculateContentBox(bounds, padding, borders) {
6533
- // TODO support percentage paddings
6534
- var paddingTop = padding[TOP].value;
6535
- var paddingRight = padding[RIGHT].value;
6536
- var paddingBottom = padding[BOTTOM].value;
6537
- var paddingLeft = padding[LEFT].value;
6538
-
6539
- 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));
6540
- };
6541
 
6542
- var parseDocumentSize = exports.parseDocumentSize = function parseDocumentSize(document) {
6543
- var body = document.body;
6544
- var documentElement = document.documentElement;
6545
 
6546
- if (!body || !documentElement) {
6547
- throw new Error( true ? 'Unable to get document size' : '');
6548
- }
6549
- var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));
6550
 
6551
- var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));
 
 
6552
 
6553
- return new Bounds(0, 0, width, height);
6554
- };
6555
 
6556
- var parsePathForBorder = exports.parsePathForBorder = function parsePathForBorder(curves, borderSide) {
6557
- switch (borderSide) {
6558
- case TOP:
6559
- return createPathFromCurves(curves.topLeftOuter, curves.topLeftInner, curves.topRightOuter, curves.topRightInner);
6560
- case RIGHT:
6561
- return createPathFromCurves(curves.topRightOuter, curves.topRightInner, curves.bottomRightOuter, curves.bottomRightInner);
6562
- case BOTTOM:
6563
- return createPathFromCurves(curves.bottomRightOuter, curves.bottomRightInner, curves.bottomLeftOuter, curves.bottomLeftInner);
6564
- case LEFT:
6565
- default:
6566
- return createPathFromCurves(curves.bottomLeftOuter, curves.bottomLeftInner, curves.topLeftOuter, curves.topLeftInner);
6567
- }
6568
- };
6569
 
6570
- var createPathFromCurves = function createPathFromCurves(outer1, inner1, outer2, inner2) {
6571
- var path = [];
6572
- if (outer1 instanceof _BezierCurve2.default) {
6573
- path.push(outer1.subdivide(0.5, false));
6574
- } else {
6575
- path.push(outer1);
6576
- }
6577
 
6578
- if (outer2 instanceof _BezierCurve2.default) {
6579
- path.push(outer2.subdivide(0.5, true));
6580
- } else {
6581
- path.push(outer2);
6582
  }
6583
 
6584
- if (inner2 instanceof _BezierCurve2.default) {
6585
- path.push(inner2.subdivide(0.5, true).reverse());
6586
- } else {
6587
- path.push(inner2);
6588
- }
6589
 
6590
- if (inner1 instanceof _BezierCurve2.default) {
6591
- path.push(inner1.subdivide(0.5, false).reverse());
6592
- } else {
6593
- path.push(inner1);
6594
- }
 
 
6595
 
6596
- return path;
6597
- };
6598
 
6599
- var calculateBorderBoxPath = exports.calculateBorderBoxPath = function calculateBorderBoxPath(curves) {
6600
- return [curves.topLeftOuter, curves.topRightOuter, curves.bottomRightOuter, curves.bottomLeftOuter];
6601
- };
 
 
6602
 
6603
- var calculatePaddingBoxPath = exports.calculatePaddingBoxPath = function calculatePaddingBoxPath(curves) {
6604
- return [curves.topLeftInner, curves.topRightInner, curves.bottomRightInner, curves.bottomLeftInner];
6605
- };
 
 
6606
 
6607
- var parseBoundCurves = exports.parseBoundCurves = function parseBoundCurves(bounds, borders, borderRadius) {
6608
- var tlh = borderRadius[CORNER.TOP_LEFT][H].getAbsoluteValue(bounds.width);
6609
- var tlv = borderRadius[CORNER.TOP_LEFT][V].getAbsoluteValue(bounds.height);
6610
- var trh = borderRadius[CORNER.TOP_RIGHT][H].getAbsoluteValue(bounds.width);
6611
- var trv = borderRadius[CORNER.TOP_RIGHT][V].getAbsoluteValue(bounds.height);
6612
- var brh = borderRadius[CORNER.BOTTOM_RIGHT][H].getAbsoluteValue(bounds.width);
6613
- var brv = borderRadius[CORNER.BOTTOM_RIGHT][V].getAbsoluteValue(bounds.height);
6614
- var blh = borderRadius[CORNER.BOTTOM_LEFT][H].getAbsoluteValue(bounds.width);
6615
- var blv = borderRadius[CORNER.BOTTOM_LEFT][V].getAbsoluteValue(bounds.height);
6616
 
6617
- var factors = [];
6618
- factors.push((tlh + trh) / bounds.width);
6619
- factors.push((blh + brh) / bounds.width);
6620
- factors.push((tlv + blv) / bounds.height);
6621
- factors.push((trv + brv) / bounds.height);
6622
- var maxFactor = Math.max.apply(Math, factors);
 
6623
 
6624
- if (maxFactor > 1) {
6625
- tlh /= maxFactor;
6626
- tlv /= maxFactor;
6627
- trh /= maxFactor;
6628
- trv /= maxFactor;
6629
- brh /= maxFactor;
6630
- brv /= maxFactor;
6631
- blh /= maxFactor;
6632
- blv /= maxFactor;
6633
- }
6634
 
6635
- var topWidth = bounds.width - trh;
6636
- var rightHeight = bounds.height - brv;
6637
- var bottomWidth = bounds.width - brh;
6638
- var leftHeight = bounds.height - blv;
6639
 
6640
- return {
6641
- topLeftOuter: tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT) : new _Vector2.default(bounds.left, bounds.top),
6642
- 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),
6643
- 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),
6644
- 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),
6645
- 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),
6646
- 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),
6647
- 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),
6648
- 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)
6649
- };
6650
  };
6651
 
6652
- var CORNER = {
6653
- TOP_LEFT: 0,
6654
- TOP_RIGHT: 1,
6655
- BOTTOM_RIGHT: 2,
6656
- BOTTOM_LEFT: 3
 
 
 
 
 
6657
  };
6658
 
6659
- var getCurvePoints = function getCurvePoints(x, y, r1, r2, position) {
6660
- var kappa = 4 * ((Math.sqrt(2) - 1) / 3);
6661
- var ox = r1 * kappa; // control point offset horizontal
6662
- var oy = r2 * kappa; // control point offset vertical
6663
- var xm = x + r1; // x-middle
6664
- var ym = y + r2; // y-middle
6665
 
6666
- switch (position) {
6667
- case CORNER.TOP_LEFT:
6668
- 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));
6669
- case CORNER.TOP_RIGHT:
6670
- 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));
6671
- case CORNER.BOTTOM_RIGHT:
6672
- 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));
6673
- case CORNER.BOTTOM_LEFT:
6674
- default:
6675
- 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));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6676
  }
 
 
6677
  };
6678
 
6679
  /***/ }),
6680
- /* 3 */
6681
  /***/ (function(module, exports, __webpack_require__) {
6682
 
6683
  "use strict";
@@ -6686,276 +4106,231 @@ var getCurvePoints = function getCurvePoints(x, y, r1, r2, position) {
6686
  Object.defineProperty(exports, "__esModule", {
6687
  value: true
6688
  });
 
6689
 
6690
  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; }; }();
6691
 
6692
- var _Color = __webpack_require__(0);
6693
-
6694
- var _Color2 = _interopRequireDefault(_Color);
6695
-
6696
  var _Util = __webpack_require__(4);
6697
 
6698
- var _background = __webpack_require__(5);
6699
 
6700
- var _border = __webpack_require__(12);
6701
 
6702
- var _borderRadius = __webpack_require__(33);
 
 
6703
 
6704
- var _display = __webpack_require__(34);
 
 
6705
 
6706
- var _float = __webpack_require__(35);
 
 
 
 
 
6707
 
6708
- var _font = __webpack_require__(36);
 
 
 
6709
 
6710
- var _letterSpacing = __webpack_require__(37);
 
 
 
 
6711
 
6712
- var _lineBreak = __webpack_require__(38);
6713
 
6714
- var _listStyle = __webpack_require__(8);
 
 
6715
 
6716
- var _margin = __webpack_require__(39);
 
 
6717
 
6718
- var _overflow = __webpack_require__(40);
 
 
 
6719
 
6720
- var _overflowWrap = __webpack_require__(18);
 
 
 
6721
 
6722
- var _padding = __webpack_require__(17);
 
6723
 
6724
- var _position = __webpack_require__(19);
 
6725
 
6726
- var _textDecoration = __webpack_require__(11);
6727
 
6728
- var _textShadow = __webpack_require__(41);
6729
 
6730
- var _textTransform = __webpack_require__(20);
 
 
 
 
 
 
 
 
6731
 
6732
- var _transform = __webpack_require__(42);
 
 
6733
 
6734
- var _visibility = __webpack_require__(43);
 
6735
 
6736
- var _wordBreak = __webpack_require__(44);
 
 
6737
 
6738
- var _zIndex = __webpack_require__(45);
6739
 
6740
- var _Bounds = __webpack_require__(2);
6741
 
6742
- var _Input = __webpack_require__(21);
 
 
 
6743
 
6744
- var _ListItem = __webpack_require__(14);
 
 
6745
 
6746
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6747
 
6748
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
6749
 
6750
- var INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6751
 
6752
- var NodeContainer = function () {
6753
- function NodeContainer(node, parent, resourceLoader, index) {
6754
- var _this = this;
6755
 
6756
- _classCallCheck(this, NodeContainer);
 
 
6757
 
6758
- this.parent = parent;
6759
- this.tagName = node.tagName;
6760
- this.index = index;
6761
- this.childNodes = [];
6762
- this.listItems = [];
6763
- if (typeof node.start === 'number') {
6764
- this.listStart = node.start;
6765
  }
6766
- var defaultView = node.ownerDocument.defaultView;
6767
- var scrollX = defaultView.pageXOffset;
6768
- var scrollY = defaultView.pageYOffset;
6769
- var style = defaultView.getComputedStyle(node, null);
6770
- var display = (0, _display.parseDisplay)(style.display);
6771
 
6772
- var IS_INPUT = node.type === 'radio' || node.type === 'checkbox';
 
 
6773
 
6774
- var position = (0, _position.parsePosition)(style.position);
 
 
6775
 
6776
- this.style = {
6777
- background: IS_INPUT ? _Input.INPUT_BACKGROUND : (0, _background.parseBackground)(style, resourceLoader),
6778
- border: IS_INPUT ? _Input.INPUT_BORDERS : (0, _border.parseBorder)(style),
6779
- borderRadius: (node instanceof defaultView.HTMLInputElement || node instanceof HTMLInputElement) && IS_INPUT ? (0, _Input.getInputBorderRadius)(node) : (0, _borderRadius.parseBorderRadius)(style),
6780
- color: IS_INPUT ? _Input.INPUT_COLOR : new _Color2.default(style.color),
6781
- display: display,
6782
- float: (0, _float.parseCSSFloat)(style.float),
6783
- font: (0, _font.parseFont)(style),
6784
- letterSpacing: (0, _letterSpacing.parseLetterSpacing)(style.letterSpacing),
6785
- listStyle: display === _display.DISPLAY.LIST_ITEM ? (0, _listStyle.parseListStyle)(style) : null,
6786
- lineBreak: (0, _lineBreak.parseLineBreak)(style.lineBreak),
6787
- margin: (0, _margin.parseMargin)(style),
6788
- opacity: parseFloat(style.opacity),
6789
- overflow: INPUT_TAGS.indexOf(node.tagName) === -1 ? (0, _overflow.parseOverflow)(style.overflow) : _overflow.OVERFLOW.HIDDEN,
6790
- overflowWrap: (0, _overflowWrap.parseOverflowWrap)(style.overflowWrap ? style.overflowWrap : style.wordWrap),
6791
- padding: (0, _padding.parsePadding)(style),
6792
- position: position,
6793
- textDecoration: (0, _textDecoration.parseTextDecoration)(style),
6794
- textShadow: (0, _textShadow.parseTextShadow)(style.textShadow),
6795
- textTransform: (0, _textTransform.parseTextTransform)(style.textTransform),
6796
- transform: (0, _transform.parseTransform)(style),
6797
- visibility: (0, _visibility.parseVisibility)(style.visibility),
6798
- wordBreak: (0, _wordBreak.parseWordBreak)(style.wordBreak),
6799
- zIndex: (0, _zIndex.parseZIndex)(position !== _position.POSITION.STATIC ? style.zIndex : 'auto')
6800
- };
6801
 
6802
- if (this.isTransformed()) {
6803
- // getBoundingClientRect provides values post-transform, we want them without the transformation
6804
- node.style.transform = 'matrix(1,0,0,1,0,0)';
6805
- }
6806
 
6807
- if (display === _display.DISPLAY.LIST_ITEM) {
6808
- var listOwner = (0, _ListItem.getListOwner)(this);
6809
- if (listOwner) {
6810
- var listIndex = listOwner.listItems.length;
6811
- listOwner.listItems.push(this);
6812
- 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;
6813
- }
6814
- }
6815
 
6816
- // TODO move bound retrieval for all nodes to a later stage?
6817
- if (node.tagName === 'IMG') {
6818
- node.addEventListener('load', function () {
6819
- _this.bounds = (0, _Bounds.parseBounds)(node, scrollX, scrollY);
6820
- _this.curvedBounds = (0, _Bounds.parseBoundCurves)(_this.bounds, _this.style.border, _this.style.borderRadius);
6821
- });
6822
- }
6823
- this.image = getImage(node, resourceLoader);
6824
- this.bounds = IS_INPUT ? (0, _Input.reformatInputBounds)((0, _Bounds.parseBounds)(node, scrollX, scrollY)) : (0, _Bounds.parseBounds)(node, scrollX, scrollY);
6825
- this.curvedBounds = (0, _Bounds.parseBoundCurves)(this.bounds, this.style.border, this.style.borderRadius);
6826
 
6827
- if (true) {
6828
- this.name = '' + node.tagName.toLowerCase() + (node.id ? '#' + node.id : '') + node.className.toString().split(' ').map(function (s) {
6829
- return s.length ? '.' + s : '';
6830
- }).join('');
6831
- }
6832
- }
6833
 
6834
- _createClass(NodeContainer, [{
6835
- key: 'getClipPaths',
6836
- value: function getClipPaths() {
6837
- var parentClips = this.parent ? this.parent.getClipPaths() : [];
6838
- var isClipped = this.style.overflow !== _overflow.OVERFLOW.VISIBLE;
6839
 
6840
- return isClipped ? parentClips.concat([(0, _Bounds.calculatePaddingBoxPath)(this.curvedBounds)]) : parentClips;
6841
- }
6842
- }, {
6843
- key: 'isInFlow',
6844
- value: function isInFlow() {
6845
- return this.isRootElement() && !this.isFloating() && !this.isAbsolutelyPositioned();
6846
- }
6847
- }, {
6848
- key: 'isVisible',
6849
- value: function isVisible() {
6850
- return !(0, _Util.contains)(this.style.display, _display.DISPLAY.NONE) && this.style.opacity > 0 && this.style.visibility === _visibility.VISIBILITY.VISIBLE;
6851
- }
6852
- }, {
6853
- key: 'isAbsolutelyPositioned',
6854
- value: function isAbsolutelyPositioned() {
6855
- return this.style.position !== _position.POSITION.STATIC && this.style.position !== _position.POSITION.RELATIVE;
6856
- }
6857
- }, {
6858
- key: 'isPositioned',
6859
- value: function isPositioned() {
6860
- return this.style.position !== _position.POSITION.STATIC;
6861
- }
6862
- }, {
6863
- key: 'isFloating',
6864
- value: function isFloating() {
6865
- return this.style.float !== _float.FLOAT.NONE;
6866
- }
6867
- }, {
6868
- key: 'isRootElement',
6869
- value: function isRootElement() {
6870
- return this.parent === null;
6871
- }
6872
- }, {
6873
- key: 'isTransformed',
6874
- value: function isTransformed() {
6875
- return this.style.transform !== null;
6876
- }
6877
- }, {
6878
- key: 'isPositionedWithZIndex',
6879
- value: function isPositionedWithZIndex() {
6880
- return this.isPositioned() && !this.style.zIndex.auto;
6881
- }
6882
- }, {
6883
- key: 'isInlineLevel',
6884
- value: function isInlineLevel() {
6885
- 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);
6886
- }
6887
- }, {
6888
- key: 'isInlineBlockOrInlineTable',
6889
- value: function isInlineBlockOrInlineTable() {
6890
- return (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_BLOCK) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_TABLE);
6891
- }
6892
- }]);
6893
 
6894
- return NodeContainer;
6895
- }();
6896
 
6897
- exports.default = NodeContainer;
6898
 
 
 
 
 
6899
 
6900
- var getImage = function getImage(node, resourceLoader) {
6901
- if (node instanceof node.ownerDocument.defaultView.SVGSVGElement || node instanceof SVGSVGElement) {
6902
- var s = new XMLSerializer();
6903
- return resourceLoader.loadImage('data:image/svg+xml,' + encodeURIComponent(s.serializeToString(node)));
6904
- }
6905
- switch (node.tagName) {
6906
- case 'IMG':
6907
- // $FlowFixMe
6908
- var img = node;
6909
- return resourceLoader.loadImage(img.currentSrc || img.src);
6910
- case 'CANVAS':
6911
- // $FlowFixMe
6912
- var canvas = node;
6913
- return resourceLoader.loadCanvas(canvas);
6914
- case 'IFRAME':
6915
- var iframeKey = node.getAttribute('data-html2canvas-internal-iframe-key');
6916
- if (iframeKey) {
6917
- return iframeKey;
6918
- }
6919
- break;
6920
  }
6921
 
6922
- return null;
6923
- };
6924
-
6925
- /***/ }),
6926
- /* 4 */
6927
- /***/ (function(module, exports, __webpack_require__) {
6928
-
6929
- "use strict";
6930
-
6931
 
6932
- Object.defineProperty(exports, "__esModule", {
6933
- value: true
6934
- });
6935
- var contains = exports.contains = function contains(bit, value) {
6936
- return (bit & value) !== 0;
6937
- };
 
 
 
 
 
 
 
 
 
 
 
6938
 
6939
- var distance = exports.distance = function distance(a, b) {
6940
- return Math.sqrt(a * a + b * b);
6941
- };
6942
 
6943
- var copyCSSStyles = exports.copyCSSStyles = function copyCSSStyles(style, target) {
6944
- // Edge does not provide value for cssText
6945
- for (var i = style.length - 1; i >= 0; i--) {
6946
- var property = style.item(i);
6947
- // Safari shows pseudoelements if content is set
6948
- if (property !== 'content') {
6949
- target.style.setProperty(property, style.getPropertyValue(property));
6950
- }
6951
  }
6952
- return target;
6953
  };
6954
 
6955
- var SMALL_IMAGE = exports.SMALL_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
 
 
6956
 
6957
  /***/ }),
6958
- /* 5 */
6959
  /***/ (function(module, exports, __webpack_require__) {
6960
 
6961
  "use strict";
@@ -6964,357 +4339,290 @@ var SMALL_IMAGE = exports.SMALL_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAA
6964
  Object.defineProperty(exports, "__esModule", {
6965
  value: true
6966
  });
6967
- 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;
6968
 
6969
- var _Color = __webpack_require__(0);
6970
 
6971
- var _Color2 = _interopRequireDefault(_Color);
6972
 
6973
- var _Length = __webpack_require__(1);
6974
 
6975
- var _Length2 = _interopRequireDefault(_Length);
6976
 
6977
- var _Size = __webpack_require__(31);
6978
 
6979
- var _Size2 = _interopRequireDefault(_Size);
6980
 
6981
- var _Vector = __webpack_require__(7);
6982
 
6983
- var _Vector2 = _interopRequireDefault(_Vector);
 
 
 
 
6984
 
6985
  var _Bounds = __webpack_require__(2);
6986
 
6987
- var _padding = __webpack_require__(17);
 
 
 
 
 
 
6988
 
6989
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6990
 
6991
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
6992
 
6993
- var BACKGROUND_REPEAT = exports.BACKGROUND_REPEAT = {
6994
- REPEAT: 0,
6995
- NO_REPEAT: 1,
6996
- REPEAT_X: 2,
6997
- REPEAT_Y: 3
6998
- };
6999
 
7000
- var BACKGROUND_SIZE = exports.BACKGROUND_SIZE = {
7001
- AUTO: 0,
7002
- CONTAIN: 1,
7003
- COVER: 2,
7004
- LENGTH: 3
7005
- };
7006
 
7007
- var BACKGROUND_CLIP = exports.BACKGROUND_CLIP = {
7008
- BORDER_BOX: 0,
7009
- PADDING_BOX: 1,
7010
- CONTENT_BOX: 2
7011
- };
7012
 
7013
- var BACKGROUND_ORIGIN = exports.BACKGROUND_ORIGIN = BACKGROUND_CLIP;
 
 
 
 
 
7014
 
7015
- var AUTO = 'auto';
 
 
 
7016
 
7017
- var BackgroundSize = function BackgroundSize(size) {
7018
- _classCallCheck(this, BackgroundSize);
 
7019
 
7020
- switch (size) {
7021
- case 'contain':
7022
- this.size = BACKGROUND_SIZE.CONTAIN;
7023
- break;
7024
- case 'cover':
7025
- this.size = BACKGROUND_SIZE.COVER;
7026
- break;
7027
- case 'auto':
7028
- this.size = BACKGROUND_SIZE.AUTO;
7029
- break;
7030
- default:
7031
- this.value = new _Length2.default(size);
7032
- }
7033
- };
7034
 
7035
- var calculateBackgroundSize = exports.calculateBackgroundSize = function calculateBackgroundSize(backgroundImage, image, bounds) {
7036
- var width = 0;
7037
- var height = 0;
7038
- var size = backgroundImage.size;
7039
- if (size[0].size === BACKGROUND_SIZE.CONTAIN || size[0].size === BACKGROUND_SIZE.COVER) {
7040
- var targetRatio = bounds.width / bounds.height;
7041
- var currentRatio = image.width / image.height;
7042
- 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);
7043
- }
7044
 
7045
- if (size[0].value) {
7046
- width = size[0].value.getAbsoluteValue(bounds.width);
7047
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7048
 
7049
- if (size[0].size === BACKGROUND_SIZE.AUTO && size[1].size === BACKGROUND_SIZE.AUTO) {
7050
- height = image.height;
7051
- } else if (size[1].size === BACKGROUND_SIZE.AUTO) {
7052
- height = width / image.width * image.height;
7053
- } else if (size[1].value) {
7054
- height = size[1].value.getAbsoluteValue(bounds.height);
7055
- }
7056
 
7057
- if (size[0].size === BACKGROUND_SIZE.AUTO) {
7058
- width = height / image.height * image.width;
7059
- }
7060
 
7061
- return new _Size2.default(width, height);
7062
- };
 
7063
 
7064
- var calculateGradientBackgroundSize = exports.calculateGradientBackgroundSize = function calculateGradientBackgroundSize(backgroundImage, bounds) {
7065
- var size = backgroundImage.size;
7066
- var width = size[0].value ? size[0].value.getAbsoluteValue(bounds.width) : bounds.width;
7067
- var height = size[1].value ? size[1].value.getAbsoluteValue(bounds.height) : size[0].value ? width : bounds.height;
 
7068
 
7069
- return new _Size2.default(width, height);
7070
- };
 
7071
 
7072
- var AUTO_SIZE = new BackgroundSize(AUTO);
7073
 
7074
- var calculateBackgroungPaintingArea = exports.calculateBackgroungPaintingArea = function calculateBackgroungPaintingArea(curves, clip) {
7075
- switch (clip) {
7076
- case BACKGROUND_CLIP.BORDER_BOX:
7077
- return (0, _Bounds.calculateBorderBoxPath)(curves);
7078
- case BACKGROUND_CLIP.PADDING_BOX:
7079
- default:
7080
- return (0, _Bounds.calculatePaddingBoxPath)(curves);
7081
- }
7082
- };
7083
 
7084
- var calculateBackgroungPositioningArea = exports.calculateBackgroungPositioningArea = function calculateBackgroungPositioningArea(backgroundOrigin, bounds, padding, border) {
7085
- var paddingBox = (0, _Bounds.calculatePaddingBox)(bounds, border);
 
 
 
 
 
 
 
 
 
7086
 
7087
- switch (backgroundOrigin) {
7088
- case BACKGROUND_ORIGIN.BORDER_BOX:
7089
- return bounds;
7090
- case BACKGROUND_ORIGIN.CONTENT_BOX:
7091
- var paddingLeft = padding[_padding.PADDING_SIDES.LEFT].getAbsoluteValue(bounds.width);
7092
- var paddingRight = padding[_padding.PADDING_SIDES.RIGHT].getAbsoluteValue(bounds.width);
7093
- var paddingTop = padding[_padding.PADDING_SIDES.TOP].getAbsoluteValue(bounds.width);
7094
- var paddingBottom = padding[_padding.PADDING_SIDES.BOTTOM].getAbsoluteValue(bounds.width);
7095
- return new _Bounds.Bounds(paddingBox.left + paddingLeft, paddingBox.top + paddingTop, paddingBox.width - paddingLeft - paddingRight, paddingBox.height - paddingTop - paddingBottom);
7096
- case BACKGROUND_ORIGIN.PADDING_BOX:
7097
- default:
7098
- return paddingBox;
7099
- }
7100
- };
 
7101
 
7102
- var calculateBackgroundPosition = exports.calculateBackgroundPosition = function calculateBackgroundPosition(position, size, bounds) {
7103
- return new _Vector2.default(position[0].getAbsoluteValue(bounds.width - size.width), position[1].getAbsoluteValue(bounds.height - size.height));
 
 
 
7104
  };
7105
 
7106
- var calculateBackgroundRepeatPath = exports.calculateBackgroundRepeatPath = function calculateBackgroundRepeatPath(background, position, size, backgroundPositioningArea, bounds) {
7107
- var repeat = background.repeat;
7108
- switch (repeat) {
7109
- case BACKGROUND_REPEAT.REPEAT_X:
7110
- 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))];
7111
- case BACKGROUND_REPEAT.REPEAT_Y:
7112
- 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))];
7113
- case BACKGROUND_REPEAT.NO_REPEAT:
7114
- 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))];
7115
- default:
7116
- 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))];
7117
- }
7118
- };
7119
 
7120
- var parseBackground = exports.parseBackground = function parseBackground(style, resourceLoader) {
7121
- return {
7122
- backgroundColor: new _Color2.default(style.backgroundColor),
7123
- backgroundImage: parseBackgroundImages(style, resourceLoader),
7124
- backgroundClip: parseBackgroundClip(style.backgroundClip),
7125
- backgroundOrigin: parseBackgroundOrigin(style.backgroundOrigin)
7126
- };
7127
- };
7128
 
7129
- var parseBackgroundClip = function parseBackgroundClip(backgroundClip) {
7130
- switch (backgroundClip) {
7131
- case 'padding-box':
7132
- return BACKGROUND_CLIP.PADDING_BOX;
7133
- case 'content-box':
7134
- return BACKGROUND_CLIP.CONTENT_BOX;
7135
- }
7136
- return BACKGROUND_CLIP.BORDER_BOX;
7137
- };
7138
 
7139
- var parseBackgroundOrigin = function parseBackgroundOrigin(backgroundOrigin) {
7140
- switch (backgroundOrigin) {
7141
- case 'padding-box':
7142
- return BACKGROUND_ORIGIN.PADDING_BOX;
7143
- case 'content-box':
7144
- return BACKGROUND_ORIGIN.CONTENT_BOX;
7145
- }
7146
- return BACKGROUND_ORIGIN.BORDER_BOX;
7147
- };
7148
 
7149
- var parseBackgroundRepeat = function parseBackgroundRepeat(backgroundRepeat) {
7150
- switch (backgroundRepeat.trim()) {
7151
- case 'no-repeat':
7152
- return BACKGROUND_REPEAT.NO_REPEAT;
7153
- case 'repeat-x':
7154
- case 'repeat no-repeat':
7155
- return BACKGROUND_REPEAT.REPEAT_X;
7156
- case 'repeat-y':
7157
- case 'no-repeat repeat':
7158
- return BACKGROUND_REPEAT.REPEAT_Y;
7159
- case 'repeat':
7160
- return BACKGROUND_REPEAT.REPEAT;
 
 
 
 
 
 
 
 
 
 
 
7161
  }
7162
 
 
 
 
 
 
 
 
7163
  if (true) {
7164
- console.error('Invalid background-repeat value "' + backgroundRepeat + '"');
7165
  }
7166
 
7167
- return BACKGROUND_REPEAT.REPEAT;
7168
  };
7169
 
7170
- var parseBackgroundImages = function parseBackgroundImages(style, resourceLoader) {
7171
- var sources = parseBackgroundImage(style.backgroundImage).map(function (backgroundImage) {
7172
- if (backgroundImage.method === 'url') {
7173
- var key = resourceLoader.loadImage(backgroundImage.args[0]);
7174
- backgroundImage.args = key ? [key] : [];
7175
- }
7176
- return backgroundImage;
7177
- });
7178
- var positions = style.backgroundPosition.split(',');
7179
- var repeats = style.backgroundRepeat.split(',');
7180
- var sizes = style.backgroundSize.split(',');
7181
-
7182
- return sources.map(function (source, index) {
7183
- var size = (sizes[index] || AUTO).trim().split(' ').map(parseBackgroundSize);
7184
- var position = (positions[index] || AUTO).trim().split(' ').map(parseBackgoundPosition);
7185
 
7186
- return {
7187
- source: source,
7188
- repeat: parseBackgroundRepeat(typeof repeats[index] === 'string' ? repeats[index] : repeats[0]),
7189
- size: size.length < 2 ? [size[0], AUTO_SIZE] : [size[0], size[1]],
7190
- position: position.length < 2 ? [position[0], position[0]] : [position[0], position[1]]
7191
- };
7192
- });
7193
- };
7194
-
7195
- var parseBackgroundSize = function parseBackgroundSize(size) {
7196
- return size === 'auto' ? AUTO_SIZE : new BackgroundSize(size);
7197
- };
7198
-
7199
- var parseBackgoundPosition = function parseBackgoundPosition(position) {
7200
- switch (position) {
7201
- case 'bottom':
7202
- case 'right':
7203
- return new _Length2.default('100%');
7204
- case 'left':
7205
- case 'top':
7206
- return new _Length2.default('0%');
7207
- case 'auto':
7208
- return new _Length2.default('0');
7209
  }
7210
- return new _Length2.default(position);
7211
- };
7212
-
7213
- var parseBackgroundImage = exports.parseBackgroundImage = function parseBackgroundImage(image) {
7214
- var whitespace = /^\s$/;
7215
- var results = [];
7216
-
7217
- var args = [];
7218
- var method = '';
7219
- var quote = null;
7220
- var definition = '';
7221
- var mode = 0;
7222
- var numParen = 0;
7223
-
7224
- var appendResult = function appendResult() {
7225
- var prefix = '';
7226
- if (method) {
7227
- if (definition.substr(0, 1) === '"') {
7228
- definition = definition.substr(1, definition.length - 2);
7229
- }
7230
-
7231
- if (definition) {
7232
- args.push(definition.trim());
7233
- }
7234
 
7235
- var prefix_i = method.indexOf('-', 1) + 1;
7236
- if (method.substr(0, 1) === '-' && prefix_i > 0) {
7237
- prefix = method.substr(0, prefix_i).toLowerCase();
7238
- method = method.substr(prefix_i);
7239
- }
7240
- method = method.toLowerCase();
7241
- if (method !== 'none') {
7242
- results.push({
7243
- prefix: prefix,
7244
- method: method,
7245
- args: args
7246
- });
7247
  }
7248
- }
7249
- args = [];
7250
- method = definition = '';
7251
- };
7252
-
7253
- image.split('').forEach(function (c) {
7254
- if (mode === 0 && whitespace.test(c)) {
7255
- return;
7256
- }
7257
- switch (c) {
7258
- case '"':
7259
- if (!quote) {
7260
- quote = c;
7261
- } else if (quote === c) {
7262
- quote = null;
7263
- }
7264
- break;
7265
- case '(':
7266
- if (quote) {
7267
- break;
7268
- } else if (mode === 0) {
7269
- mode = 1;
7270
- return;
7271
- } else {
7272
- numParen++;
7273
- }
7274
- break;
7275
- case ')':
7276
- if (quote) {
7277
- break;
7278
- } else if (mode === 1) {
7279
- if (numParen === 0) {
7280
- mode = 0;
7281
- appendResult();
7282
- return;
7283
- } else {
7284
- numParen--;
7285
  }
7286
- }
7287
- break;
7288
 
7289
- case ',':
7290
- if (quote) {
7291
- break;
7292
- } else if (mode === 0) {
7293
- appendResult();
7294
- return;
7295
- } else if (mode === 1) {
7296
- if (numParen === 0 && !method.match(/^url$/i)) {
7297
- args.push(definition.trim());
7298
- definition = '';
7299
- return;
 
 
 
 
 
7300
  }
7301
  }
7302
- break;
 
 
 
 
 
 
 
 
 
 
 
 
7303
  }
 
 
7304
 
7305
- if (mode === 0) {
7306
- method += c;
7307
- } else {
7308
- definition += c;
7309
- }
7310
- });
7311
 
7312
- appendResult();
7313
- return results;
 
 
 
 
7314
  };
7315
 
7316
  /***/ }),
7317
- /* 6 */
7318
  /***/ (function(module, exports, __webpack_require__) {
7319
 
7320
  "use strict";
@@ -7323,14 +4631,49 @@ var parseBackgroundImage = exports.parseBackgroundImage = function parseBackgrou
7323
  Object.defineProperty(exports, "__esModule", {
7324
  value: true
7325
  });
7326
- var PATH = exports.PATH = {
7327
- VECTOR: 0,
7328
- BEZIER_CURVE: 1,
7329
- CIRCLE: 2
7330
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7331
 
7332
  /***/ }),
7333
- /* 7 */
7334
  /***/ (function(module, exports, __webpack_require__) {
7335
 
7336
  "use strict";
@@ -7340,30 +4683,19 @@ Object.defineProperty(exports, "__esModule", {
7340
  value: true
7341
  });
7342
 
7343
- var _Path = __webpack_require__(6);
7344
-
7345
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7346
 
7347
- var Vector = function Vector(x, y) {
7348
- _classCallCheck(this, Vector);
7349
 
7350
- this.type = _Path.PATH.VECTOR;
7351
- this.x = x;
7352
- this.y = y;
7353
- if (true) {
7354
- if (isNaN(x)) {
7355
- console.error('Invalid x value given for Vector');
7356
- }
7357
- if (isNaN(y)) {
7358
- console.error('Invalid y value given for Vector');
7359
- }
7360
- }
7361
  };
7362
 
7363
- exports.default = Vector;
7364
 
7365
  /***/ }),
7366
- /* 8 */
7367
  /***/ (function(module, exports, __webpack_require__) {
7368
 
7369
  "use strict";
@@ -7372,207 +4704,59 @@ exports.default = Vector;
7372
  Object.defineProperty(exports, "__esModule", {
7373
  value: true
7374
  });
7375
- exports.parseListStyle = exports.parseListStyleType = exports.LIST_STYLE_TYPE = exports.LIST_STYLE_POSITION = undefined;
7376
 
7377
- var _background = __webpack_require__(5);
7378
 
7379
- var LIST_STYLE_POSITION = exports.LIST_STYLE_POSITION = {
7380
- INSIDE: 0,
7381
- OUTSIDE: 1
7382
- };
7383
 
7384
- var LIST_STYLE_TYPE = exports.LIST_STYLE_TYPE = {
7385
- NONE: -1,
7386
- DISC: 0,
7387
- CIRCLE: 1,
7388
- SQUARE: 2,
7389
- DECIMAL: 3,
7390
- CJK_DECIMAL: 4,
7391
- DECIMAL_LEADING_ZERO: 5,
7392
- LOWER_ROMAN: 6,
7393
- UPPER_ROMAN: 7,
7394
- LOWER_GREEK: 8,
7395
- LOWER_ALPHA: 9,
7396
- UPPER_ALPHA: 10,
7397
- ARABIC_INDIC: 11,
7398
- ARMENIAN: 12,
7399
- BENGALI: 13,
7400
- CAMBODIAN: 14,
7401
- CJK_EARTHLY_BRANCH: 15,
7402
- CJK_HEAVENLY_STEM: 16,
7403
- CJK_IDEOGRAPHIC: 17,
7404
- DEVANAGARI: 18,
7405
- ETHIOPIC_NUMERIC: 19,
7406
- GEORGIAN: 20,
7407
- GUJARATI: 21,
7408
- GURMUKHI: 22,
7409
- HEBREW: 22,
7410
- HIRAGANA: 23,
7411
- HIRAGANA_IROHA: 24,
7412
- JAPANESE_FORMAL: 25,
7413
- JAPANESE_INFORMAL: 26,
7414
- KANNADA: 27,
7415
- KATAKANA: 28,
7416
- KATAKANA_IROHA: 29,
7417
- KHMER: 30,
7418
- KOREAN_HANGUL_FORMAL: 31,
7419
- KOREAN_HANJA_FORMAL: 32,
7420
- KOREAN_HANJA_INFORMAL: 33,
7421
- LAO: 34,
7422
- LOWER_ARMENIAN: 35,
7423
- MALAYALAM: 36,
7424
- MONGOLIAN: 37,
7425
- MYANMAR: 38,
7426
- ORIYA: 39,
7427
- PERSIAN: 40,
7428
- SIMP_CHINESE_FORMAL: 41,
7429
- SIMP_CHINESE_INFORMAL: 42,
7430
- TAMIL: 43,
7431
- TELUGU: 44,
7432
- THAI: 45,
7433
- TIBETAN: 46,
7434
- TRAD_CHINESE_FORMAL: 47,
7435
- TRAD_CHINESE_INFORMAL: 48,
7436
- UPPER_ARMENIAN: 49,
7437
- DISCLOSURE_OPEN: 50,
7438
- DISCLOSURE_CLOSED: 51
7439
- };
7440
 
7441
- var parseListStyleType = exports.parseListStyleType = function parseListStyleType(type) {
7442
- switch (type) {
7443
- case 'disc':
7444
- return LIST_STYLE_TYPE.DISC;
7445
- case 'circle':
7446
- return LIST_STYLE_TYPE.CIRCLE;
7447
- case 'square':
7448
- return LIST_STYLE_TYPE.SQUARE;
7449
- case 'decimal':
7450
- return LIST_STYLE_TYPE.DECIMAL;
7451
- case 'cjk-decimal':
7452
- return LIST_STYLE_TYPE.CJK_DECIMAL;
7453
- case 'decimal-leading-zero':
7454
- return LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO;
7455
- case 'lower-roman':
7456
- return LIST_STYLE_TYPE.LOWER_ROMAN;
7457
- case 'upper-roman':
7458
- return LIST_STYLE_TYPE.UPPER_ROMAN;
7459
- case 'lower-greek':
7460
- return LIST_STYLE_TYPE.LOWER_GREEK;
7461
- case 'lower-alpha':
7462
- return LIST_STYLE_TYPE.LOWER_ALPHA;
7463
- case 'upper-alpha':
7464
- return LIST_STYLE_TYPE.UPPER_ALPHA;
7465
- case 'arabic-indic':
7466
- return LIST_STYLE_TYPE.ARABIC_INDIC;
7467
- case 'armenian':
7468
- return LIST_STYLE_TYPE.ARMENIAN;
7469
- case 'bengali':
7470
- return LIST_STYLE_TYPE.BENGALI;
7471
- case 'cambodian':
7472
- return LIST_STYLE_TYPE.CAMBODIAN;
7473
- case 'cjk-earthly-branch':
7474
- return LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH;
7475
- case 'cjk-heavenly-stem':
7476
- return LIST_STYLE_TYPE.CJK_HEAVENLY_STEM;
7477
- case 'cjk-ideographic':
7478
- return LIST_STYLE_TYPE.CJK_IDEOGRAPHIC;
7479
- case 'devanagari':
7480
- return LIST_STYLE_TYPE.DEVANAGARI;
7481
- case 'ethiopic-numeric':
7482
- return LIST_STYLE_TYPE.ETHIOPIC_NUMERIC;
7483
- case 'georgian':
7484
- return LIST_STYLE_TYPE.GEORGIAN;
7485
- case 'gujarati':
7486
- return LIST_STYLE_TYPE.GUJARATI;
7487
- case 'gurmukhi':
7488
- return LIST_STYLE_TYPE.GURMUKHI;
7489
- case 'hebrew':
7490
- return LIST_STYLE_TYPE.HEBREW;
7491
- case 'hiragana':
7492
- return LIST_STYLE_TYPE.HIRAGANA;
7493
- case 'hiragana-iroha':
7494
- return LIST_STYLE_TYPE.HIRAGANA_IROHA;
7495
- case 'japanese-formal':
7496
- return LIST_STYLE_TYPE.JAPANESE_FORMAL;
7497
- case 'japanese-informal':
7498
- return LIST_STYLE_TYPE.JAPANESE_INFORMAL;
7499
- case 'kannada':
7500
- return LIST_STYLE_TYPE.KANNADA;
7501
- case 'katakana':
7502
- return LIST_STYLE_TYPE.KATAKANA;
7503
- case 'katakana-iroha':
7504
- return LIST_STYLE_TYPE.KATAKANA_IROHA;
7505
- case 'khmer':
7506
- return LIST_STYLE_TYPE.KHMER;
7507
- case 'korean-hangul-formal':
7508
- return LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL;
7509
- case 'korean-hanja-formal':
7510
- return LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL;
7511
- case 'korean-hanja-informal':
7512
- return LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL;
7513
- case 'lao':
7514
- return LIST_STYLE_TYPE.LAO;
7515
- case 'lower-armenian':
7516
- return LIST_STYLE_TYPE.LOWER_ARMENIAN;
7517
- case 'malayalam':
7518
- return LIST_STYLE_TYPE.MALAYALAM;
7519
- case 'mongolian':
7520
- return LIST_STYLE_TYPE.MONGOLIAN;
7521
- case 'myanmar':
7522
- return LIST_STYLE_TYPE.MYANMAR;
7523
- case 'oriya':
7524
- return LIST_STYLE_TYPE.ORIYA;
7525
- case 'persian':
7526
- return LIST_STYLE_TYPE.PERSIAN;
7527
- case 'simp-chinese-formal':
7528
- return LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL;
7529
- case 'simp-chinese-informal':
7530
- return LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL;
7531
- case 'tamil':
7532
- return LIST_STYLE_TYPE.TAMIL;
7533
- case 'telugu':
7534
- return LIST_STYLE_TYPE.TELUGU;
7535
- case 'thai':
7536
- return LIST_STYLE_TYPE.THAI;
7537
- case 'tibetan':
7538
- return LIST_STYLE_TYPE.TIBETAN;
7539
- case 'trad-chinese-formal':
7540
- return LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL;
7541
- case 'trad-chinese-informal':
7542
- return LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL;
7543
- case 'upper-armenian':
7544
- return LIST_STYLE_TYPE.UPPER_ARMENIAN;
7545
- case 'disclosure-open':
7546
- return LIST_STYLE_TYPE.DISCLOSURE_OPEN;
7547
- case 'disclosure-closed':
7548
- return LIST_STYLE_TYPE.DISCLOSURE_CLOSED;
7549
- case 'none':
7550
- default:
7551
- return LIST_STYLE_TYPE.NONE;
7552
- }
7553
- };
7554
 
7555
- var parseListStyle = exports.parseListStyle = function parseListStyle(style) {
7556
- var listStyleImage = (0, _background.parseBackgroundImage)(style.getPropertyValue('list-style-image'));
7557
- return {
7558
- listStyleType: parseListStyleType(style.getPropertyValue('list-style-type')),
7559
- listStyleImage: listStyleImage.length ? listStyleImage[0] : null,
7560
- listStylePosition: parseListStylePosition(style.getPropertyValue('list-style-position'))
7561
- };
7562
  };
7563
 
7564
- var parseListStylePosition = function parseListStylePosition(position) {
7565
- switch (position) {
7566
- case 'inside':
7567
- return LIST_STYLE_POSITION.INSIDE;
7568
- case 'outside':
7569
- default:
7570
- return LIST_STYLE_POSITION.OUTSIDE;
 
 
7571
  }
7572
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7573
 
7574
  /***/ }),
7575
- /* 9 */
7576
  /***/ (function(module, exports, __webpack_require__) {
7577
 
7578
  "use strict";
@@ -7581,63 +4765,149 @@ var parseListStylePosition = function parseListStylePosition(position) {
7581
  Object.defineProperty(exports, "__esModule", {
7582
  value: true
7583
  });
 
7584
 
7585
- 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; }; }();
7586
 
7587
- var _textTransform = __webpack_require__(20);
7588
 
7589
- var _TextBounds = __webpack_require__(22);
7590
 
7591
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7592
 
7593
- var TextContainer = function () {
7594
- function TextContainer(text, parent, bounds) {
7595
- _classCallCheck(this, TextContainer);
7596
 
7597
- this.text = text;
7598
- this.parent = parent;
7599
- this.bounds = bounds;
7600
- }
7601
 
7602
- _createClass(TextContainer, null, [{
7603
- key: 'fromTextNode',
7604
- value: function fromTextNode(node, parent) {
7605
- var text = transform(node.data, parent.style.textTransform);
7606
- return new TextContainer(text, parent, (0, _TextBounds.parseTextBounds)(text, parent, node));
7607
- }
7608
- }]);
7609
 
7610
- return TextContainer;
7611
- }();
 
7612
 
7613
- exports.default = TextContainer;
 
 
7614
 
 
7615
 
7616
- var CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g;
7617
 
7618
- var transform = function transform(text, _transform) {
7619
- switch (_transform) {
7620
- case _textTransform.TEXT_TRANSFORM.LOWERCASE:
7621
- return text.toLowerCase();
7622
- case _textTransform.TEXT_TRANSFORM.CAPITALIZE:
7623
- return text.replace(CAPITALIZE, capitalize);
7624
- case _textTransform.TEXT_TRANSFORM.UPPERCASE:
7625
- return text.toUpperCase();
7626
- default:
7627
- return text;
7628
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7629
  };
7630
 
7631
- function capitalize(m, p1, p2) {
7632
- if (m.length > 0) {
7633
- return p1 + p2.toUpperCase();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7634
  }
7635
 
7636
- return m;
7637
- }
 
 
 
 
 
 
 
 
7638
 
7639
  /***/ }),
7640
- /* 10 */
7641
  /***/ (function(module, exports, __webpack_require__) {
7642
 
7643
  "use strict";
@@ -7646,197 +4916,113 @@ function capitalize(m, p1, p2) {
7646
  Object.defineProperty(exports, "__esModule", {
7647
  value: true
7648
  });
 
 
 
 
 
 
 
7649
 
7650
- var _ForeignObjectRenderer = __webpack_require__(23);
 
 
 
 
 
 
 
 
 
 
 
 
7651
 
7652
- var testRangeBounds = function testRangeBounds(document) {
7653
- var TEST_HEIGHT = 123;
 
7654
 
7655
- if (document.createRange) {
7656
- var range = document.createRange();
7657
- if (range.getBoundingClientRect) {
7658
- var testElement = document.createElement('boundtest');
7659
- testElement.style.height = TEST_HEIGHT + 'px';
7660
- testElement.style.display = 'block';
7661
- document.body.appendChild(testElement);
7662
 
7663
- range.selectNode(testElement);
7664
- var rangeBounds = range.getBoundingClientRect();
7665
- var rangeHeight = Math.round(rangeBounds.height);
7666
- document.body.removeChild(testElement);
7667
- if (rangeHeight === TEST_HEIGHT) {
7668
- return true;
7669
- }
7670
- }
 
 
 
 
7671
  }
7672
 
7673
- return false;
 
7674
  };
7675
 
7676
- // iOS 10.3 taints canvas with base64 images unless crossOrigin = 'anonymous'
7677
- var testBase64 = function testBase64(document, src) {
7678
- var img = new Image();
7679
- var canvas = document.createElement('canvas');
7680
- var ctx = canvas.getContext('2d');
 
7681
 
7682
- return new Promise(function (resolve) {
7683
- // Single pixel base64 image renders fine on iOS 10.3???
7684
- img.src = src;
 
 
 
 
 
7685
 
7686
- var onload = function onload() {
7687
- try {
7688
- ctx.drawImage(img, 0, 0);
7689
- canvas.toDataURL();
7690
- } catch (e) {
7691
- return resolve(false);
7692
- }
7693
 
7694
- return resolve(true);
7695
- };
7696
 
7697
- img.onload = onload;
7698
- img.onerror = function () {
7699
- return resolve(false);
7700
- };
7701
 
7702
- if (img.complete === true) {
7703
- setTimeout(function () {
7704
- onload();
7705
- }, 500);
7706
- }
7707
- });
 
 
 
7708
  };
7709
 
7710
- var testCORS = function testCORS() {
7711
- return typeof new Image().crossOrigin !== 'undefined';
7712
- };
7713
 
7714
- var testResponseType = function testResponseType() {
7715
- return typeof new XMLHttpRequest().responseType === 'string';
7716
- };
7717
-
7718
- var testSVG = function testSVG(document) {
7719
- var img = new Image();
7720
- var canvas = document.createElement('canvas');
7721
- var ctx = canvas.getContext('2d');
7722
- img.src = 'data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\'></svg>';
7723
-
7724
- try {
7725
- ctx.drawImage(img, 0, 0);
7726
- canvas.toDataURL();
7727
- } catch (e) {
7728
- return false;
7729
- }
7730
- return true;
7731
- };
7732
-
7733
- var isGreenPixel = function isGreenPixel(data) {
7734
- return data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255;
7735
- };
7736
-
7737
- var testForeignObject = function testForeignObject(document) {
7738
- var canvas = document.createElement('canvas');
7739
- var size = 100;
7740
- canvas.width = size;
7741
- canvas.height = size;
7742
- var ctx = canvas.getContext('2d');
7743
- ctx.fillStyle = 'rgb(0, 255, 0)';
7744
- ctx.fillRect(0, 0, size, size);
7745
-
7746
- var img = new Image();
7747
- var greenImageSrc = canvas.toDataURL();
7748
- img.src = greenImageSrc;
7749
- var svg = (0, _ForeignObjectRenderer.createForeignObjectSVG)(size, size, 0, 0, img);
7750
- ctx.fillStyle = 'red';
7751
- ctx.fillRect(0, 0, size, size);
7752
 
7753
- return (0, _ForeignObjectRenderer.loadSerializedSVG)(svg).then(function (img) {
7754
- ctx.drawImage(img, 0, 0);
7755
- var data = ctx.getImageData(0, 0, size, size).data;
7756
- ctx.fillStyle = 'red';
7757
- ctx.fillRect(0, 0, size, size);
7758
 
7759
- var node = document.createElement('div');
7760
- node.style.backgroundImage = 'url(' + greenImageSrc + ')';
7761
- node.style.height = size + 'px';
7762
- // Firefox 55 does not render inline <img /> tags
7763
- return isGreenPixel(data) ? (0, _ForeignObjectRenderer.loadSerializedSVG)((0, _ForeignObjectRenderer.createForeignObjectSVG)(size, size, 0, 0, node)) : Promise.reject(false);
7764
- }).then(function (img) {
7765
- ctx.drawImage(img, 0, 0);
7766
- // Edge does not render background-images
7767
- return isGreenPixel(ctx.getImageData(0, 0, size, size).data);
7768
- }).catch(function (e) {
7769
- return false;
7770
- });
7771
  };
7772
 
7773
- var FEATURES = {
7774
- // $FlowFixMe - get/set properties not yet supported
7775
- get SUPPORT_RANGE_BOUNDS() {
7776
- 'use strict';
7777
-
7778
- var value = testRangeBounds(document);
7779
- Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });
7780
- return value;
7781
- },
7782
- // $FlowFixMe - get/set properties not yet supported
7783
- get SUPPORT_SVG_DRAWING() {
7784
- 'use strict';
7785
-
7786
- var value = testSVG(document);
7787
- Object.defineProperty(FEATURES, 'SUPPORT_SVG_DRAWING', { value: value });
7788
- return value;
7789
- },
7790
- // $FlowFixMe - get/set properties not yet supported
7791
- get SUPPORT_BASE64_DRAWING() {
7792
- 'use strict';
7793
-
7794
- return function (src) {
7795
- var _value = testBase64(document, src);
7796
- Object.defineProperty(FEATURES, 'SUPPORT_BASE64_DRAWING', { value: function value() {
7797
- return _value;
7798
- } });
7799
- return _value;
7800
- };
7801
- },
7802
- // $FlowFixMe - get/set properties not yet supported
7803
- get SUPPORT_FOREIGNOBJECT_DRAWING() {
7804
- 'use strict';
7805
-
7806
- var value = typeof Array.from === 'function' && typeof window.fetch === 'function' ? testForeignObject(document) : Promise.resolve(false);
7807
- Object.defineProperty(FEATURES, 'SUPPORT_FOREIGNOBJECT_DRAWING', { value: value });
7808
- return value;
7809
- },
7810
- // $FlowFixMe - get/set properties not yet supported
7811
- get SUPPORT_CORS_IMAGES() {
7812
- 'use strict';
7813
-
7814
- var value = testCORS();
7815
- Object.defineProperty(FEATURES, 'SUPPORT_CORS_IMAGES', { value: value });
7816
- return value;
7817
- },
7818
- // $FlowFixMe - get/set properties not yet supported
7819
- get SUPPORT_RESPONSE_TYPE() {
7820
- 'use strict';
7821
-
7822
- var value = testResponseType();
7823
- Object.defineProperty(FEATURES, 'SUPPORT_RESPONSE_TYPE', { value: value });
7824
- return value;
7825
- },
7826
- // $FlowFixMe - get/set properties not yet supported
7827
- get SUPPORT_CORS_XHR() {
7828
- 'use strict';
7829
-
7830
- var value = 'withCredentials' in new XMLHttpRequest();
7831
- Object.defineProperty(FEATURES, 'SUPPORT_CORS_XHR', { value: value });
7832
- return value;
7833
  }
7834
  };
7835
 
7836
- exports.default = FEATURES;
7837
-
7838
  /***/ }),
7839
- /* 11 */
7840
  /***/ (function(module, exports, __webpack_require__) {
7841
 
7842
  "use strict";
@@ -7845,85 +5031,55 @@ exports.default = FEATURES;
7845
  Object.defineProperty(exports, "__esModule", {
7846
  value: true
7847
  });
7848
- exports.parseTextDecoration = exports.TEXT_DECORATION_LINE = exports.TEXT_DECORATION = exports.TEXT_DECORATION_STYLE = undefined;
7849
 
7850
- var _Color = __webpack_require__(0);
7851
 
7852
- var _Color2 = _interopRequireDefault(_Color);
7853
 
7854
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7855
 
7856
- var TEXT_DECORATION_STYLE = exports.TEXT_DECORATION_STYLE = {
7857
- SOLID: 0,
7858
- DOUBLE: 1,
7859
- DOTTED: 2,
7860
- DASHED: 3,
7861
- WAVY: 4
7862
- };
7863
-
7864
- var TEXT_DECORATION = exports.TEXT_DECORATION = {
7865
- NONE: null
7866
- };
7867
 
7868
- var TEXT_DECORATION_LINE = exports.TEXT_DECORATION_LINE = {
7869
- UNDERLINE: 1,
7870
- OVERLINE: 2,
7871
- LINE_THROUGH: 3,
7872
- BLINK: 4
7873
  };
7874
 
7875
- var parseLine = function parseLine(line) {
7876
- switch (line) {
7877
- case 'underline':
7878
- return TEXT_DECORATION_LINE.UNDERLINE;
7879
- case 'overline':
7880
- return TEXT_DECORATION_LINE.OVERLINE;
7881
- case 'line-through':
7882
- return TEXT_DECORATION_LINE.LINE_THROUGH;
7883
- }
7884
- return TEXT_DECORATION_LINE.BLINK;
7885
- };
7886
 
7887
- var parseTextDecorationLine = function parseTextDecorationLine(line) {
7888
- if (line === 'none') {
7889
- return null;
7890
- }
7891
 
7892
- return line.split(' ').map(parseLine);
7893
- };
7894
 
7895
- var parseTextDecorationStyle = function parseTextDecorationStyle(style) {
7896
- switch (style) {
7897
- case 'double':
7898
- return TEXT_DECORATION_STYLE.DOUBLE;
7899
- case 'dotted':
7900
- return TEXT_DECORATION_STYLE.DOTTED;
7901
- case 'dashed':
7902
- return TEXT_DECORATION_STYLE.DASHED;
7903
- case 'wavy':
7904
- return TEXT_DECORATION_STYLE.WAVY;
7905
- }
7906
- return TEXT_DECORATION_STYLE.SOLID;
7907
  };
7908
 
7909
- var parseTextDecoration = exports.parseTextDecoration = function parseTextDecoration(style) {
7910
- var textDecorationLine = parseTextDecorationLine(style.textDecorationLine ? style.textDecorationLine : style.textDecoration);
7911
- if (textDecorationLine === null) {
7912
- return TEXT_DECORATION.NONE;
 
 
 
 
 
 
 
7913
  }
7914
-
7915
- var textDecorationColor = style.textDecorationColor ? new _Color2.default(style.textDecorationColor) : null;
7916
- var textDecorationStyle = parseTextDecorationStyle(style.textDecorationStyle);
7917
-
7918
- return {
7919
- textDecorationLine: textDecorationLine,
7920
- textDecorationColor: textDecorationColor,
7921
- textDecorationStyle: textDecorationStyle
7922
- };
7923
  };
7924
 
7925
  /***/ }),
7926
- /* 12 */
7927
  /***/ (function(module, exports, __webpack_require__) {
7928
 
7929
  "use strict";
@@ -7932,7 +5088,7 @@ var parseTextDecoration = exports.parseTextDecoration = function parseTextDecora
7932
  Object.defineProperty(exports, "__esModule", {
7933
  value: true
7934
  });
7935
- exports.parseBorder = exports.BORDER_SIDES = exports.BORDER_STYLE = undefined;
7936
 
7937
  var _Color = __webpack_require__(0);
7938
 
@@ -7940,45 +5096,91 @@ var _Color2 = _interopRequireDefault(_Color);
7940
 
7941
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7942
 
7943
- var BORDER_STYLE = exports.BORDER_STYLE = {
7944
- NONE: 0,
7945
- SOLID: 1
7946
- };
7947
-
7948
- var BORDER_SIDES = exports.BORDER_SIDES = {
7949
- TOP: 0,
7950
- RIGHT: 1,
7951
- BOTTOM: 2,
7952
- LEFT: 3
7953
- };
7954
-
7955
- var SIDES = Object.keys(BORDER_SIDES).map(function (s) {
7956
- return s.toLowerCase();
7957
- });
7958
 
7959
- var parseBorderStyle = function parseBorderStyle(style) {
7960
- switch (style) {
7961
- case 'none':
7962
- return BORDER_STYLE.NONE;
7963
  }
7964
- return BORDER_STYLE.SOLID;
7965
- };
7966
 
7967
- var parseBorder = exports.parseBorder = function parseBorder(style) {
7968
- return SIDES.map(function (side) {
7969
- var borderColor = new _Color2.default(style.getPropertyValue('border-' + side + '-color'));
7970
- var borderStyle = parseBorderStyle(style.getPropertyValue('border-' + side + '-style'));
7971
- var borderWidth = parseFloat(style.getPropertyValue('border-' + side + '-width'));
7972
- return {
7973
- borderColor: borderColor,
7974
- borderStyle: borderStyle,
7975
- borderWidth: isNaN(borderWidth) ? 0 : borderWidth
7976
- };
7977
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7978
  };
7979
 
7980
  /***/ }),
7981
- /* 13 */
7982
  /***/ (function(module, exports, __webpack_require__) {
7983
 
7984
  "use strict";
@@ -7987,119 +5189,71 @@ var parseBorder = exports.parseBorder = function parseBorder(style) {
7987
  Object.defineProperty(exports, "__esModule", {
7988
  value: true
7989
  });
7990
- var toCodePoints = exports.toCodePoints = function toCodePoints(str) {
7991
- var codePoints = [];
7992
- var i = 0;
7993
- var length = str.length;
7994
- while (i < length) {
7995
- var value = str.charCodeAt(i++);
7996
- if (value >= 0xd800 && value <= 0xdbff && i < length) {
7997
- var extra = str.charCodeAt(i++);
7998
- if ((extra & 0xfc00) === 0xdc00) {
7999
- codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);
8000
- } else {
8001
- codePoints.push(value);
8002
- i--;
8003
- }
8004
- } else {
8005
- codePoints.push(value);
8006
- }
8007
- }
8008
- return codePoints;
8009
- };
8010
 
8011
- var fromCodePoint = exports.fromCodePoint = function fromCodePoint() {
8012
- if (String.fromCodePoint) {
8013
- return String.fromCodePoint.apply(String, arguments);
8014
- }
8015
 
8016
- var length = arguments.length;
8017
- if (!length) {
8018
- return '';
8019
- }
8020
 
8021
- var codeUnits = [];
8022
 
8023
- var index = -1;
8024
- var result = '';
8025
- while (++index < length) {
8026
- var codePoint = arguments.length <= index ? undefined : arguments[index];
8027
- if (codePoint <= 0xffff) {
8028
- codeUnits.push(codePoint);
8029
- } else {
8030
- codePoint -= 0x10000;
8031
- codeUnits.push((codePoint >> 10) + 0xd800, codePoint % 0x400 + 0xdc00);
8032
- }
8033
- if (index + 1 === length || codeUnits.length > 0x4000) {
8034
- result += String.fromCharCode.apply(String, codeUnits);
8035
- codeUnits.length = 0;
8036
- }
8037
- }
8038
- return result;
8039
  };
8040
 
8041
- var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
8042
-
8043
- // Use a lookup table to find the index.
8044
- var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
8045
- for (var i = 0; i < chars.length; i++) {
8046
- lookup[chars.charCodeAt(i)] = i;
8047
- }
8048
-
8049
- var decode = exports.decode = function decode(base64) {
8050
- var bufferLength = base64.length * 0.75,
8051
- len = base64.length,
8052
- i = void 0,
8053
- p = 0,
8054
- encoded1 = void 0,
8055
- encoded2 = void 0,
8056
- encoded3 = void 0,
8057
- encoded4 = void 0;
8058
 
8059
- if (base64[base64.length - 1] === '=') {
8060
- bufferLength--;
8061
- if (base64[base64.length - 2] === '=') {
8062
- bufferLength--;
8063
- }
 
 
 
8064
  }
8065
 
8066
- var buffer = typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint8Array.prototype.slice !== 'undefined' ? new ArrayBuffer(bufferLength) : new Array(bufferLength);
8067
- var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
8068
-
8069
- for (i = 0; i < len; i += 4) {
8070
- encoded1 = lookup[base64.charCodeAt(i)];
8071
- encoded2 = lookup[base64.charCodeAt(i + 1)];
8072
- encoded3 = lookup[base64.charCodeAt(i + 2)];
8073
- encoded4 = lookup[base64.charCodeAt(i + 3)];
 
8074
 
8075
- bytes[p++] = encoded1 << 2 | encoded2 >> 4;
8076
- bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
8077
- bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
 
 
8078
  }
8079
-
8080
- return buffer;
8081
  };
8082
 
8083
- var polyUint16Array = exports.polyUint16Array = function polyUint16Array(buffer) {
8084
- var length = buffer.length;
8085
- var bytes = [];
8086
- for (var _i = 0; _i < length; _i += 2) {
8087
- bytes.push(buffer[_i + 1] << 8 | buffer[_i]);
8088
  }
8089
- return bytes;
8090
- };
8091
 
8092
- var polyUint32Array = exports.polyUint32Array = function polyUint32Array(buffer) {
8093
- var length = buffer.length;
8094
- var bytes = [];
8095
- for (var _i2 = 0; _i2 < length; _i2 += 4) {
8096
- bytes.push(buffer[_i2 + 3] << 24 | buffer[_i2 + 2] << 16 | buffer[_i2 + 1] << 8 | buffer[_i2]);
 
 
 
 
8097
  }
8098
- return bytes;
8099
  };
8100
 
8101
  /***/ }),
8102
- /* 14 */
8103
  /***/ (function(module, exports, __webpack_require__) {
8104
 
8105
  "use strict";
@@ -8108,767 +5262,722 @@ var polyUint32Array = exports.polyUint32Array = function polyUint32Array(buffer)
8108
  Object.defineProperty(exports, "__esModule", {
8109
  value: true
8110
  });
8111
- exports.createCounterText = exports.inlineListItemElement = exports.getListOwner = undefined;
8112
-
8113
- var _Util = __webpack_require__(4);
8114
-
8115
- var _NodeContainer = __webpack_require__(3);
8116
-
8117
- var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
8118
 
8119
- var _TextContainer = __webpack_require__(9);
 
 
 
 
 
 
 
 
 
 
8120
 
8121
- var _TextContainer2 = _interopRequireDefault(_TextContainer);
 
 
8122
 
8123
- var _listStyle = __webpack_require__(8);
8124
 
8125
- var _Unicode = __webpack_require__(24);
8126
 
8127
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8128
-
8129
- // Margin between the enumeration and the list item content
8130
- var MARGIN_RIGHT = 7;
8131
-
8132
- var ancestorTypes = ['OL', 'UL', 'MENU'];
8133
-
8134
- var getListOwner = exports.getListOwner = function getListOwner(container) {
8135
- var parent = container.parent;
8136
- if (!parent) {
8137
- return null;
8138
- }
8139
-
8140
- do {
8141
- var isAncestor = ancestorTypes.indexOf(parent.tagName) !== -1;
8142
- if (isAncestor) {
8143
- return parent;
8144
- }
8145
- parent = parent.parent;
8146
- } while (parent);
8147
-
8148
- return container.parent;
8149
  };
8150
 
8151
- var inlineListItemElement = exports.inlineListItemElement = function inlineListItemElement(node, container, resourceLoader) {
8152
- var listStyle = container.style.listStyle;
8153
-
8154
- if (!listStyle) {
8155
- return;
 
 
 
 
8156
  }
 
8157
 
8158
- var style = node.ownerDocument.defaultView.getComputedStyle(node, null);
8159
- var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
8160
- (0, _Util.copyCSSStyles)(style, wrapper);
8161
 
8162
- wrapper.style.position = 'absolute';
8163
- wrapper.style.bottom = 'auto';
8164
- wrapper.style.display = 'block';
8165
- wrapper.style.letterSpacing = 'normal';
8166
 
8167
- switch (listStyle.listStylePosition) {
8168
- case _listStyle.LIST_STYLE_POSITION.OUTSIDE:
8169
- wrapper.style.left = 'auto';
8170
- wrapper.style.right = node.ownerDocument.defaultView.innerWidth - container.bounds.left - container.style.margin[1].getAbsoluteValue(container.bounds.width) + MARGIN_RIGHT + 'px';
8171
- wrapper.style.textAlign = 'right';
8172
- break;
8173
- case _listStyle.LIST_STYLE_POSITION.INSIDE:
8174
- wrapper.style.left = container.bounds.left - container.style.margin[3].getAbsoluteValue(container.bounds.width) + 'px';
8175
- wrapper.style.right = 'auto';
8176
- wrapper.style.textAlign = 'left';
8177
- break;
8178
- }
8179
 
8180
- var text = void 0;
8181
- var MARGIN_TOP = container.style.margin[0].getAbsoluteValue(container.bounds.width);
8182
- var styleImage = listStyle.listStyleImage;
8183
- if (styleImage) {
8184
- if (styleImage.method === 'url') {
8185
- var image = node.ownerDocument.createElement('img');
8186
- image.src = styleImage.args[0];
8187
- wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px';
8188
- wrapper.style.width = 'auto';
8189
- wrapper.style.height = 'auto';
8190
- wrapper.appendChild(image);
8191
- } else {
8192
- var size = parseFloat(container.style.font.fontSize) * 0.5;
8193
- wrapper.style.top = container.bounds.top - MARGIN_TOP + container.bounds.height - 1.5 * size + 'px';
8194
- wrapper.style.width = size + 'px';
8195
- wrapper.style.height = size + 'px';
8196
- wrapper.style.backgroundImage = style.listStyleImage;
8197
- }
8198
- } else if (typeof container.listIndex === 'number') {
8199
- text = node.ownerDocument.createTextNode(createCounterText(container.listIndex, listStyle.listStyleType, true));
8200
- wrapper.appendChild(text);
8201
- wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px';
8202
- }
8203
 
8204
- // $FlowFixMe
8205
- var body = node.ownerDocument.body;
8206
- body.appendChild(wrapper);
8207
 
8208
- if (text) {
8209
- container.childNodes.push(_TextContainer2.default.fromTextNode(text, container));
8210
- body.removeChild(wrapper);
8211
- } else {
8212
- // $FlowFixMe
8213
- container.childNodes.push(new _NodeContainer2.default(wrapper, container, resourceLoader, 0));
8214
- }
8215
- };
8216
 
8217
- var ROMAN_UPPER = {
8218
- integers: [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],
8219
- values: ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
8220
- };
8221
 
8222
- var ARMENIAN = {
8223
- 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],
8224
- values: ['Ք', 'Փ', 'Ւ', 'Ց', 'Ր', 'Տ', 'Վ', 'Ս', 'Ռ', 'Ջ', 'Պ', 'Չ', 'Ո', 'Շ', 'Ն', 'Յ', 'Մ', 'Ճ', 'Ղ', 'Ձ', 'Հ', 'Կ', 'Ծ', 'Խ', 'Լ', 'Ի', 'Ժ', 'Թ', 'Ը', 'Է', 'Զ', 'Ե', 'Դ', 'Գ', 'Բ', 'Ա']
8225
- };
8226
 
8227
- var HEBREW = {
8228
- 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],
8229
- values: ['י׳', 'ט׳', 'ח׳', 'ז׳', 'ו׳', 'ה׳', 'ד׳', 'ג׳', 'ב׳', 'א׳', 'ת', 'ש', 'ר', 'ק', 'צ', 'פ', 'ע', 'ס', 'נ', 'מ', 'ל', 'כ', 'יט', 'יח', 'יז', 'טז', 'טו', 'י', 'ט', 'ח', 'ז', 'ו', 'ה', 'ד', 'ג', 'ב', 'א']
8230
- };
8231
 
8232
- var GEORGIAN = {
8233
- 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],
8234
- values: ['ჵ', 'ჰ', 'ჯ', 'ჴ', 'ხ', 'ჭ', 'წ', 'ძ', 'ც', 'ჩ', 'შ', 'ყ', 'ღ', 'ქ', 'ფ', 'ჳ', 'ტ', 'ს', 'რ', 'ჟ', 'პ', 'ო', 'ჲ', 'ნ', 'მ', 'ლ', 'კ', 'ი', 'თ', 'ჱ', 'ზ', 'ვ', 'ე', 'დ', 'გ', 'ბ', 'ა']
8235
- };
 
 
 
 
 
 
 
 
8236
 
8237
- var createAdditiveCounter = function createAdditiveCounter(value, min, max, symbols, fallback, suffix) {
8238
- if (value < min || value > max) {
8239
- return createCounterText(value, fallback, suffix.length > 0);
8240
- }
8241
 
8242
- return symbols.integers.reduce(function (string, integer, index) {
8243
- while (value >= integer) {
8244
- value -= integer;
8245
- string += symbols.values[index];
8246
- }
8247
- return string;
8248
- }, '') + suffix;
8249
- };
8250
 
8251
- var createCounterStyleWithSymbolResolver = function createCounterStyleWithSymbolResolver(value, codePointRangeLength, isNumeric, resolver) {
8252
- var string = '';
 
8253
 
8254
- do {
8255
- if (!isNumeric) {
8256
- value--;
8257
- }
8258
- string = resolver(value) + string;
8259
- value /= codePointRangeLength;
8260
- } while (value * codePointRangeLength >= codePointRangeLength);
8261
 
8262
- return string;
8263
- };
8264
 
8265
- var createCounterStyleFromRange = function createCounterStyleFromRange(value, codePointRangeStart, codePointRangeEnd, isNumeric, suffix) {
8266
- var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;
 
 
8267
 
8268
- return (value < 0 ? '-' : '') + (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, function (codePoint) {
8269
- return (0, _Unicode.fromCodePoint)(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart);
8270
- }) + suffix);
8271
- };
8272
 
8273
- var createCounterStyleFromSymbols = function createCounterStyleFromSymbols(value, symbols) {
8274
- var suffix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '. ';
8275
 
8276
- var codePointRangeLength = symbols.length;
8277
- return createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function (codePoint) {
8278
- return symbols[Math.floor(codePoint % codePointRangeLength)];
8279
- }) + suffix;
8280
- };
8281
 
8282
- var CJK_ZEROS = 1 << 0;
8283
- var CJK_TEN_COEFFICIENTS = 1 << 1;
8284
- var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;
8285
- var CJK_HUNDRED_COEFFICIENTS = 1 << 3;
8286
 
8287
- var createCJKCounter = function createCJKCounter(value, numbers, multipliers, negativeSign, suffix, flags) {
8288
- if (value < -9999 || value > 9999) {
8289
- return createCounterText(value, _listStyle.LIST_STYLE_TYPE.CJK_DECIMAL, suffix.length > 0);
8290
- }
8291
- var tmp = Math.abs(value);
8292
- var string = suffix;
8293
 
8294
- if (tmp === 0) {
8295
- return numbers[0] + string;
8296
- }
8297
 
8298
- for (var digit = 0; tmp > 0 && digit <= 4; digit++) {
8299
- var coefficient = tmp % 10;
8300
 
8301
- if (coefficient === 0 && (0, _Util.contains)(flags, CJK_ZEROS) && string !== '') {
8302
- string = numbers[coefficient] + string;
8303
- } 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)) {
8304
- string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : '') + string;
8305
- } else if (coefficient === 1 && digit > 0) {
8306
- string = multipliers[digit - 1] + string;
8307
- }
8308
- tmp = Math.floor(tmp / 10);
8309
- }
8310
 
8311
- return (value < 0 ? negativeSign : '') + string;
8312
- };
8313
 
8314
- var CHINESE_INFORMAL_MULTIPLIERS = '十百千萬';
8315
- var CHINESE_FORMAL_MULTIPLIERS = '拾佰仟萬';
8316
- var JAPANESE_NEGATIVE = 'マイナス';
8317
- var KOREAN_NEGATIVE = '마이너스 ';
8318
 
8319
- var createCounterText = exports.createCounterText = function createCounterText(value, type, appendSuffix) {
8320
- var defaultSuffix = appendSuffix ? '. ' : '';
8321
- var cjkSuffix = appendSuffix ? '、' : '';
8322
- var koreanSuffix = appendSuffix ? ', ' : '';
8323
- switch (type) {
8324
- case _listStyle.LIST_STYLE_TYPE.DISC:
8325
- return '•';
8326
- case _listStyle.LIST_STYLE_TYPE.CIRCLE:
8327
- return '◦';
8328
- case _listStyle.LIST_STYLE_TYPE.SQUARE:
8329
- return '◾';
8330
- case _listStyle.LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:
8331
- var string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
8332
- return string.length < 4 ? '0' + string : string;
8333
- case _listStyle.LIST_STYLE_TYPE.CJK_DECIMAL:
8334
- return createCounterStyleFromSymbols(value, '〇一二三四五六七八九', cjkSuffix);
8335
- case _listStyle.LIST_STYLE_TYPE.LOWER_ROMAN:
8336
- return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
8337
- case _listStyle.LIST_STYLE_TYPE.UPPER_ROMAN:
8338
- return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
8339
- case _listStyle.LIST_STYLE_TYPE.LOWER_GREEK:
8340
- return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);
8341
- case _listStyle.LIST_STYLE_TYPE.LOWER_ALPHA:
8342
- return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);
8343
- case _listStyle.LIST_STYLE_TYPE.UPPER_ALPHA:
8344
- return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);
8345
- case _listStyle.LIST_STYLE_TYPE.ARABIC_INDIC:
8346
- return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);
8347
- case _listStyle.LIST_STYLE_TYPE.ARMENIAN:
8348
- case _listStyle.LIST_STYLE_TYPE.UPPER_ARMENIAN:
8349
- return createAdditiveCounter(value, 1, 9999, ARMENIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
8350
- case _listStyle.LIST_STYLE_TYPE.LOWER_ARMENIAN:
8351
- return createAdditiveCounter(value, 1, 9999, ARMENIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
8352
- case _listStyle.LIST_STYLE_TYPE.BENGALI:
8353
- return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);
8354
- case _listStyle.LIST_STYLE_TYPE.CAMBODIAN:
8355
- case _listStyle.LIST_STYLE_TYPE.KHMER:
8356
- return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);
8357
- case _listStyle.LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:
8358
- return createCounterStyleFromSymbols(value, '子丑寅卯辰巳午未申酉戌亥', cjkSuffix);
8359
- case _listStyle.LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:
8360
- return createCounterStyleFromSymbols(value, '甲乙丙丁戊己庚辛壬癸', cjkSuffix);
8361
- case _listStyle.LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:
8362
- case _listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:
8363
- return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
8364
- case _listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:
8365
- return createCJKCounter(value, '零壹貳參肆伍陸柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
8366
- case _listStyle.LIST_STYLE_TYPE.SIMP_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.SIMP_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.JAPANESE_INFORMAL:
8371
- return createCJKCounter(value, '〇一二三四五六七八九', '十百千万', JAPANESE_NEGATIVE, cjkSuffix, 0);
8372
- case _listStyle.LIST_STYLE_TYPE.JAPANESE_FORMAL:
8373
- return createCJKCounter(value, '零壱弐参四伍六七八九', '拾百千万', JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
8374
- case _listStyle.LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:
8375
- return createCJKCounter(value, '영일이삼사오육칠팔구', '십백천만', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
8376
- case _listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:
8377
- return createCJKCounter(value, '零一二三四五六七八九', '十百千萬', KOREAN_NEGATIVE, koreanSuffix, 0);
8378
- case _listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:
8379
- return createCJKCounter(value, '零壹貳參四五六七八九', '拾百千', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
8380
- case _listStyle.LIST_STYLE_TYPE.DEVANAGARI:
8381
- return createCounterStyleFromRange(value, 0x966, 0x96f, true, defaultSuffix);
8382
- case _listStyle.LIST_STYLE_TYPE.GEORGIAN:
8383
- return createAdditiveCounter(value, 1, 19999, GEORGIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
8384
- case _listStyle.LIST_STYLE_TYPE.GUJARATI:
8385
- return createCounterStyleFromRange(value, 0xae6, 0xaef, true, defaultSuffix);
8386
- case _listStyle.LIST_STYLE_TYPE.GURMUKHI:
8387
- return createCounterStyleFromRange(value, 0xa66, 0xa6f, true, defaultSuffix);
8388
- case _listStyle.LIST_STYLE_TYPE.HEBREW:
8389
- return createAdditiveCounter(value, 1, 10999, HEBREW, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
8390
- case _listStyle.LIST_STYLE_TYPE.HIRAGANA:
8391
- return createCounterStyleFromSymbols(value, 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん');
8392
- case _listStyle.LIST_STYLE_TYPE.HIRAGANA_IROHA:
8393
- return createCounterStyleFromSymbols(value, 'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす');
8394
- case _listStyle.LIST_STYLE_TYPE.KANNADA:
8395
- return createCounterStyleFromRange(value, 0xce6, 0xcef, true, defaultSuffix);
8396
- case _listStyle.LIST_STYLE_TYPE.KATAKANA:
8397
- return createCounterStyleFromSymbols(value, 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン', cjkSuffix);
8398
- case _listStyle.LIST_STYLE_TYPE.KATAKANA_IROHA:
8399
- return createCounterStyleFromSymbols(value, 'イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス', cjkSuffix);
8400
- case _listStyle.LIST_STYLE_TYPE.LAO:
8401
- return createCounterStyleFromRange(value, 0xed0, 0xed9, true, defaultSuffix);
8402
- case _listStyle.LIST_STYLE_TYPE.MONGOLIAN:
8403
- return createCounterStyleFromRange(value, 0x1810, 0x1819, true, defaultSuffix);
8404
- case _listStyle.LIST_STYLE_TYPE.MYANMAR:
8405
- return createCounterStyleFromRange(value, 0x1040, 0x1049, true, defaultSuffix);
8406
- case _listStyle.LIST_STYLE_TYPE.ORIYA:
8407
- return createCounterStyleFromRange(value, 0xb66, 0xb6f, true, defaultSuffix);
8408
- case _listStyle.LIST_STYLE_TYPE.PERSIAN:
8409
- return createCounterStyleFromRange(value, 0x6f0, 0x6f9, true, defaultSuffix);
8410
- case _listStyle.LIST_STYLE_TYPE.TAMIL:
8411
- return createCounterStyleFromRange(value, 0xbe6, 0xbef, true, defaultSuffix);
8412
- case _listStyle.LIST_STYLE_TYPE.TELUGU:
8413
- return createCounterStyleFromRange(value, 0xc66, 0xc6f, true, defaultSuffix);
8414
- case _listStyle.LIST_STYLE_TYPE.THAI:
8415
- return createCounterStyleFromRange(value, 0xe50, 0xe59, true, defaultSuffix);
8416
- case _listStyle.LIST_STYLE_TYPE.TIBETAN:
8417
- return createCounterStyleFromRange(value, 0xf20, 0xf29, true, defaultSuffix);
8418
- case _listStyle.LIST_STYLE_TYPE.DECIMAL:
8419
- default:
8420
- return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
8421
- }
8422
  };
8423
 
8424
- /***/ }),
8425
- /* 15 */
8426
- /***/ (function(module, exports, __webpack_require__) {
 
8427
 
8428
- "use strict";
 
 
 
 
 
 
8429
 
 
 
8430
 
8431
- Object.defineProperty(exports, "__esModule", {
8432
- value: true
8433
- });
 
 
 
 
 
 
 
 
8434
 
8435
- 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; }; }();
 
 
 
 
 
 
8436
 
8437
- var _Path = __webpack_require__(6);
 
 
 
 
 
8438
 
8439
- var _textDecoration = __webpack_require__(11);
 
 
 
 
 
 
 
 
 
8440
 
8441
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8442
 
8443
- var addColorStops = function addColorStops(gradient, canvasGradient) {
8444
- var maxStop = Math.max.apply(null, gradient.colorStops.map(function (colorStop) {
8445
- return colorStop.stop;
8446
- }));
8447
- var f = 1 / Math.max(1, maxStop);
8448
- gradient.colorStops.forEach(function (colorStop) {
8449
- canvasGradient.addColorStop(f * colorStop.stop, colorStop.color.toString());
8450
- });
8451
- };
8452
 
8453
- var CanvasRenderer = function () {
8454
- function CanvasRenderer(canvas) {
8455
- _classCallCheck(this, CanvasRenderer);
8456
 
8457
- this.canvas = canvas ? canvas : document.createElement('canvas');
8458
- }
8459
-
8460
- _createClass(CanvasRenderer, [{
8461
- key: 'render',
8462
- value: function render(options) {
8463
- this.ctx = this.canvas.getContext('2d');
8464
- this.options = options;
8465
- this.canvas.width = Math.floor(options.width * options.scale);
8466
- this.canvas.height = Math.floor(options.height * options.scale);
8467
- this.canvas.style.width = options.width + 'px';
8468
- this.canvas.style.height = options.height + 'px';
8469
-
8470
- this.ctx.scale(this.options.scale, this.options.scale);
8471
- this.ctx.translate(-options.x, -options.y);
8472
- this.ctx.textBaseline = 'bottom';
8473
- options.logger.log('Canvas renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + this.options.scale);
8474
  }
8475
- }, {
8476
- key: 'clip',
8477
- value: function clip(clipPaths, callback) {
8478
- var _this = this;
8479
 
8480
- if (clipPaths.length) {
8481
- this.ctx.save();
8482
- clipPaths.forEach(function (path) {
8483
- _this.path(path);
8484
- _this.ctx.clip();
8485
- });
 
 
8486
  }
 
8487
 
8488
- callback();
 
8489
 
8490
- if (clipPaths.length) {
8491
- this.ctx.restore();
8492
- }
8493
- }
8494
- }, {
8495
- key: 'drawImage',
8496
- value: function drawImage(image, source, destination) {
8497
- this.ctx.drawImage(image, source.left, source.top, source.width, source.height, destination.left, destination.top, destination.width, destination.height);
8498
- }
8499
- }, {
8500
- key: 'drawShape',
8501
- value: function drawShape(path, color) {
8502
- this.path(path);
8503
- this.ctx.fillStyle = color.toString();
8504
- this.ctx.fill();
8505
- }
8506
- }, {
8507
- key: 'fill',
8508
- value: function fill(color) {
8509
- this.ctx.fillStyle = color.toString();
8510
- this.ctx.fill();
8511
- }
8512
- }, {
8513
- key: 'getTarget',
8514
- value: function getTarget() {
8515
- this.canvas.getContext('2d').setTransform(1, 0, 0, 1, 0, 0);
8516
- return Promise.resolve(this.canvas);
8517
- }
8518
- }, {
8519
- key: 'path',
8520
- value: function path(_path) {
8521
- var _this2 = this;
8522
 
8523
- this.ctx.beginPath();
8524
- if (Array.isArray(_path)) {
8525
- _path.forEach(function (point, index) {
8526
- var start = point.type === _Path.PATH.VECTOR ? point : point.start;
8527
- if (index === 0) {
8528
- _this2.ctx.moveTo(start.x, start.y);
8529
- } else {
8530
- _this2.ctx.lineTo(start.x, start.y);
8531
- }
8532
 
8533
- if (point.type === _Path.PATH.BEZIER_CURVE) {
8534
- _this2.ctx.bezierCurveTo(point.startControl.x, point.startControl.y, point.endControl.x, point.endControl.y, point.end.x, point.end.y);
8535
- }
8536
- });
8537
- } else {
8538
- this.ctx.arc(_path.x + _path.radius, _path.y + _path.radius, _path.radius, 0, Math.PI * 2, true);
8539
  }
8540
 
8541
- this.ctx.closePath();
8542
- }
8543
- }, {
8544
- key: 'rectangle',
8545
- value: function rectangle(x, y, width, height, color) {
8546
- this.ctx.fillStyle = color.toString();
8547
- this.ctx.fillRect(x, y, width, height);
8548
  }
8549
- }, {
8550
- key: 'renderLinearGradient',
8551
- value: function renderLinearGradient(bounds, gradient) {
8552
- 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);
8553
 
8554
- addColorStops(gradient, linearGradient);
8555
- this.ctx.fillStyle = linearGradient;
8556
- this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height);
8557
- }
8558
- }, {
8559
- key: 'renderRadialGradient',
8560
- value: function renderRadialGradient(bounds, gradient) {
8561
- var _this3 = this;
8562
 
8563
- var x = bounds.left + gradient.center.x;
8564
- var y = bounds.top + gradient.center.y;
 
8565
 
8566
- var radialGradient = this.ctx.createRadialGradient(x, y, 0, x, y, gradient.radius.x);
8567
- if (!radialGradient) {
8568
- return;
8569
- }
 
8570
 
8571
- addColorStops(gradient, radialGradient);
8572
- this.ctx.fillStyle = radialGradient;
 
8573
 
8574
- if (gradient.radius.x !== gradient.radius.y) {
8575
- // transforms for elliptical radial gradient
8576
- var midX = bounds.left + 0.5 * bounds.width;
8577
- var midY = bounds.top + 0.5 * bounds.height;
8578
- var f = gradient.radius.y / gradient.radius.x;
8579
- var invF = 1 / f;
8580
 
8581
- this.transform(midX, midY, [1, 0, 0, f, 0, 0], function () {
8582
- return _this3.ctx.fillRect(bounds.left, invF * (bounds.top - midY) + midY, bounds.width, bounds.height * invF);
8583
- });
8584
- } else {
8585
- this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height);
8586
  }
8587
  }
8588
- }, {
8589
- key: 'renderRepeat',
8590
- value: function renderRepeat(path, image, imageSize, offsetX, offsetY) {
8591
- this.path(path);
8592
- this.ctx.fillStyle = this.ctx.createPattern(this.resizeImage(image, imageSize), 'repeat');
8593
- this.ctx.translate(offsetX, offsetY);
8594
- this.ctx.fill();
8595
- this.ctx.translate(-offsetX, -offsetY);
 
 
 
 
8596
  }
8597
- }, {
8598
- key: 'renderTextNode',
8599
- value: function renderTextNode(textBounds, color, font, textDecoration, textShadows) {
8600
- var _this4 = this;
8601
 
8602
- this.ctx.font = [font.fontStyle, font.fontVariant, font.fontWeight, font.fontSize, font.fontFamily].join(' ');
 
 
 
8603
 
8604
- textBounds.forEach(function (text) {
8605
- _this4.ctx.fillStyle = color.toString();
8606
- if (textShadows && text.text.trim().length) {
8607
- textShadows.slice(0).reverse().forEach(function (textShadow) {
8608
- _this4.ctx.shadowColor = textShadow.color.toString();
8609
- _this4.ctx.shadowOffsetX = textShadow.offsetX * _this4.options.scale;
8610
- _this4.ctx.shadowOffsetY = textShadow.offsetY * _this4.options.scale;
8611
- _this4.ctx.shadowBlur = textShadow.blur;
8612
 
8613
- _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
8614
- });
8615
- } else {
8616
- _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
8617
- }
8618
 
8619
- if (textDecoration !== null) {
8620
- var textDecorationColor = textDecoration.textDecorationColor || color;
8621
- textDecoration.textDecorationLine.forEach(function (textDecorationLine) {
8622
- switch (textDecorationLine) {
8623
- case _textDecoration.TEXT_DECORATION_LINE.UNDERLINE:
8624
- // Draws a line at the baseline of the font
8625
- // TODO As some browsers display the line as more than 1px if the font-size is big,
8626
- // need to take that into account both in position and size
8627
- var _options$fontMetrics$ = _this4.options.fontMetrics.getMetrics(font),
8628
- baseline = _options$fontMetrics$.baseline;
8629
 
8630
- _this4.rectangle(text.bounds.left, Math.round(text.bounds.top + baseline), text.bounds.width, 1, textDecorationColor);
8631
- break;
8632
- case _textDecoration.TEXT_DECORATION_LINE.OVERLINE:
8633
- _this4.rectangle(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1, textDecorationColor);
8634
- break;
8635
- case _textDecoration.TEXT_DECORATION_LINE.LINE_THROUGH:
8636
- // TODO try and find exact position for line-through
8637
- var _options$fontMetrics$2 = _this4.options.fontMetrics.getMetrics(font),
8638
- middle = _options$fontMetrics$2.middle;
8639
 
8640
- _this4.rectangle(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1, textDecorationColor);
8641
- break;
8642
- }
8643
- });
8644
- }
8645
- });
8646
- }
8647
- }, {
8648
- key: 'resizeImage',
8649
- value: function resizeImage(image, size) {
8650
- if (image.width === size.width && image.height === size.height) {
8651
- return image;
8652
- }
8653
 
8654
- var canvas = this.canvas.ownerDocument.createElement('canvas');
8655
- canvas.width = size.width;
8656
- canvas.height = size.height;
8657
- var ctx = canvas.getContext('2d');
8658
- ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, size.width, size.height);
8659
- return canvas;
8660
- }
8661
- }, {
8662
- key: 'setOpacity',
8663
- value: function setOpacity(opacity) {
8664
- this.ctx.globalAlpha = opacity;
8665
- }
8666
- }, {
8667
- key: 'transform',
8668
- value: function transform(offsetX, offsetY, matrix, callback) {
8669
- this.ctx.save();
8670
- this.ctx.translate(offsetX, offsetY);
8671
- this.ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
8672
- this.ctx.translate(-offsetX, -offsetY);
8673
 
8674
- callback();
 
 
 
8675
 
8676
- this.ctx.restore();
8677
- }
8678
- }]);
 
8679
 
8680
- return CanvasRenderer;
8681
- }();
 
 
8682
 
8683
- exports.default = CanvasRenderer;
 
 
 
8684
 
8685
- /***/ }),
8686
- /* 16 */
8687
- /***/ (function(module, exports, __webpack_require__) {
 
8688
 
8689
- "use strict";
 
 
 
8690
 
 
 
 
 
8691
 
8692
- Object.defineProperty(exports, "__esModule", {
8693
- value: true
8694
- });
 
8695
 
8696
- 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; }; }();
 
 
 
8697
 
8698
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
8699
 
8700
- var Logger = function () {
8701
- function Logger(enabled, id, start) {
8702
- _classCallCheck(this, Logger);
 
8703
 
8704
- this.enabled = typeof window !== 'undefined' && enabled;
8705
- this.start = start ? start : Date.now();
8706
- this.id = id;
8707
  }
8708
 
8709
- _createClass(Logger, [{
8710
- key: 'child',
8711
- value: function child(id) {
8712
- return new Logger(this.enabled, id, this.start);
8713
- }
8714
 
8715
- // eslint-disable-next-line flowtype/no-weak-types
 
 
 
8716
 
8717
- }, {
8718
- key: 'log',
8719
- value: function log() {
8720
- if (this.enabled && window.console && window.console.log) {
8721
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
8722
- args[_key] = arguments[_key];
8723
- }
8724
 
8725
- 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)));
8726
- }
8727
- }
 
8728
 
8729
- // eslint-disable-next-line flowtype/no-weak-types
 
 
 
8730
 
8731
- }, {
8732
- key: 'error',
8733
- value: function error() {
8734
- if (this.enabled && window.console && window.console.error) {
8735
- for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
8736
- args[_key2] = arguments[_key2];
8737
- }
8738
 
8739
- 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)));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8740
  }
8741
  }
8742
- }]);
8743
-
8744
- return Logger;
8745
- }();
8746
 
8747
- exports.default = Logger;
 
 
 
 
 
 
 
 
 
 
 
 
 
8748
 
8749
- /***/ }),
8750
- /* 17 */
8751
- /***/ (function(module, exports, __webpack_require__) {
 
8752
 
8753
- "use strict";
 
 
 
8754
 
 
 
 
 
8755
 
8756
- Object.defineProperty(exports, "__esModule", {
8757
- value: true
8758
- });
8759
- exports.parsePadding = exports.PADDING_SIDES = undefined;
8760
 
8761
- var _Length = __webpack_require__(1);
 
 
 
8762
 
8763
- var _Length2 = _interopRequireDefault(_Length);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8764
 
8765
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
8766
 
8767
- var PADDING_SIDES = exports.PADDING_SIDES = {
8768
- TOP: 0,
8769
- RIGHT: 1,
8770
- BOTTOM: 2,
8771
- LEFT: 3
8772
  };
8773
 
8774
- var SIDES = ['top', 'right', 'bottom', 'left'];
8775
-
8776
- var parsePadding = exports.parsePadding = function parsePadding(style) {
8777
- return SIDES.map(function (side) {
8778
- return new _Length2.default(style.getPropertyValue('padding-' + side));
8779
- });
8780
- };
8781
-
8782
- /***/ }),
8783
- /* 18 */
8784
- /***/ (function(module, exports, __webpack_require__) {
8785
 
8786
- "use strict";
 
 
 
8787
 
 
 
 
 
8788
 
8789
- Object.defineProperty(exports, "__esModule", {
8790
- value: true
8791
- });
8792
- var OVERFLOW_WRAP = exports.OVERFLOW_WRAP = {
8793
- NORMAL: 0,
8794
- BREAK_WORD: 1
8795
  };
8796
 
8797
- var parseOverflowWrap = exports.parseOverflowWrap = function parseOverflowWrap(overflow) {
8798
- switch (overflow) {
8799
- case 'break-word':
8800
- return OVERFLOW_WRAP.BREAK_WORD;
8801
- case 'normal':
8802
- default:
8803
- return OVERFLOW_WRAP.NORMAL;
 
 
 
 
 
 
 
 
8804
  }
 
 
 
 
 
 
8805
  };
8806
 
8807
- /***/ }),
8808
- /* 19 */
8809
- /***/ (function(module, exports, __webpack_require__) {
8810
 
8811
- "use strict";
 
 
 
 
8812
 
 
 
 
8813
 
8814
- Object.defineProperty(exports, "__esModule", {
8815
- value: true
8816
- });
8817
- var POSITION = exports.POSITION = {
8818
- STATIC: 0,
8819
- RELATIVE: 1,
8820
- ABSOLUTE: 2,
8821
- FIXED: 3,
8822
- STICKY: 4
8823
  };
8824
 
8825
- var parsePosition = exports.parsePosition = function parsePosition(position) {
8826
- switch (position) {
8827
- case 'relative':
8828
- return POSITION.RELATIVE;
8829
- case 'absolute':
8830
- return POSITION.ABSOLUTE;
8831
- case 'fixed':
8832
- return POSITION.FIXED;
8833
- case 'sticky':
8834
- return POSITION.STICKY;
8835
  }
8836
 
8837
- return POSITION.STATIC;
8838
- };
 
 
 
 
8839
 
8840
- /***/ }),
8841
- /* 20 */
8842
- /***/ (function(module, exports, __webpack_require__) {
8843
 
8844
- "use strict";
 
8845
 
 
 
 
 
 
8846
 
8847
- Object.defineProperty(exports, "__esModule", {
8848
- value: true
8849
- });
8850
- var TEXT_TRANSFORM = exports.TEXT_TRANSFORM = {
8851
- NONE: 0,
8852
- LOWERCASE: 1,
8853
- UPPERCASE: 2,
8854
- CAPITALIZE: 3
8855
- };
8856
 
8857
- var parseTextTransform = exports.parseTextTransform = function parseTextTransform(textTransform) {
8858
- switch (textTransform) {
8859
- case 'uppercase':
8860
- return TEXT_TRANSFORM.UPPERCASE;
8861
- case 'lowercase':
8862
- return TEXT_TRANSFORM.LOWERCASE;
8863
- case 'capitalize':
8864
- return TEXT_TRANSFORM.CAPITALIZE;
8865
- }
8866
 
8867
- return TEXT_TRANSFORM.NONE;
 
 
 
 
 
 
 
 
8868
  };
8869
 
8870
  /***/ }),
8871
- /* 21 */
8872
  /***/ (function(module, exports, __webpack_require__) {
8873
 
8874
  "use strict";
@@ -8877,126 +5986,172 @@ var parseTextTransform = exports.parseTextTransform = function parseTextTransfor
8877
  Object.defineProperty(exports, "__esModule", {
8878
  value: true
8879
  });
8880
- exports.reformatInputBounds = exports.inlineSelectElement = exports.inlineTextAreaElement = exports.inlineInputElement = exports.getInputBorderRadius = exports.INPUT_BACKGROUND = exports.INPUT_BORDERS = exports.INPUT_COLOR = undefined;
8881
 
8882
- var _TextContainer = __webpack_require__(9);
8883
 
8884
- var _TextContainer2 = _interopRequireDefault(_TextContainer);
8885
 
8886
- var _background = __webpack_require__(5);
8887
 
8888
- var _border = __webpack_require__(12);
 
8889
 
8890
- var _Circle = __webpack_require__(50);
 
8891
 
8892
- var _Circle2 = _interopRequireDefault(_Circle);
 
 
 
 
 
 
8893
 
8894
- var _Vector = __webpack_require__(7);
 
 
 
 
8895
 
8896
- var _Vector2 = _interopRequireDefault(_Vector);
 
 
 
 
 
 
8897
 
8898
- var _Color = __webpack_require__(0);
 
 
 
8899
 
8900
- var _Color2 = _interopRequireDefault(_Color);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8901
 
8902
- var _Length = __webpack_require__(1);
 
 
 
 
8903
 
8904
- var _Length2 = _interopRequireDefault(_Length);
 
 
 
8905
 
8906
- var _Bounds = __webpack_require__(2);
 
 
 
 
8907
 
8908
- var _TextBounds = __webpack_require__(22);
 
8909
 
8910
- var _Util = __webpack_require__(4);
 
8911
 
8912
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
8913
 
8914
- var INPUT_COLOR = exports.INPUT_COLOR = new _Color2.default([42, 42, 42]);
8915
- var INPUT_BORDER_COLOR = new _Color2.default([165, 165, 165]);
8916
- var INPUT_BACKGROUND_COLOR = new _Color2.default([222, 222, 222]);
8917
- var INPUT_BORDER = {
8918
- borderWidth: 1,
8919
- borderColor: INPUT_BORDER_COLOR,
8920
- borderStyle: _border.BORDER_STYLE.SOLID
8921
- };
8922
- var INPUT_BORDERS = exports.INPUT_BORDERS = [INPUT_BORDER, INPUT_BORDER, INPUT_BORDER, INPUT_BORDER];
8923
- var INPUT_BACKGROUND = exports.INPUT_BACKGROUND = {
8924
- backgroundColor: INPUT_BACKGROUND_COLOR,
8925
- backgroundImage: [],
8926
- backgroundClip: _background.BACKGROUND_CLIP.PADDING_BOX,
8927
- backgroundOrigin: _background.BACKGROUND_ORIGIN.PADDING_BOX
8928
- };
8929
 
8930
- var RADIO_BORDER_RADIUS = new _Length2.default('50%');
8931
- var RADIO_BORDER_RADIUS_TUPLE = [RADIO_BORDER_RADIUS, RADIO_BORDER_RADIUS];
8932
- var INPUT_RADIO_BORDER_RADIUS = [RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE];
 
 
 
8933
 
8934
- var CHECKBOX_BORDER_RADIUS = new _Length2.default('3px');
8935
- var CHECKBOX_BORDER_RADIUS_TUPLE = [CHECKBOX_BORDER_RADIUS, CHECKBOX_BORDER_RADIUS];
8936
- var INPUT_CHECKBOX_BORDER_RADIUS = [CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE];
8937
 
8938
- var getInputBorderRadius = exports.getInputBorderRadius = function getInputBorderRadius(node) {
8939
- return node.type === 'radio' ? INPUT_RADIO_BORDER_RADIUS : INPUT_CHECKBOX_BORDER_RADIUS;
8940
- };
 
 
 
 
 
 
 
 
 
 
8941
 
8942
- var inlineInputElement = exports.inlineInputElement = function inlineInputElement(node, container) {
8943
- if (node.type === 'radio' || node.type === 'checkbox') {
8944
- if (node.checked) {
8945
- var size = Math.min(container.bounds.width, container.bounds.height);
8946
- 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));
8947
- }
8948
- } else {
8949
- inlineFormElement(getInputValue(node), node, container, false);
8950
- }
8951
- };
 
8952
 
8953
- var inlineTextAreaElement = exports.inlineTextAreaElement = function inlineTextAreaElement(node, container) {
8954
- inlineFormElement(node.value, node, container, true);
8955
- };
 
 
 
 
 
 
 
 
 
 
8956
 
8957
- var inlineSelectElement = exports.inlineSelectElement = function inlineSelectElement(node, container) {
8958
- var option = node.options[node.selectedIndex || 0];
8959
- inlineFormElement(option ? option.text || '' : '', node, container, false);
8960
- };
8961
 
8962
- var reformatInputBounds = exports.reformatInputBounds = function reformatInputBounds(bounds) {
8963
- if (bounds.width > bounds.height) {
8964
- bounds.left += (bounds.width - bounds.height) / 2;
8965
- bounds.width = bounds.height;
8966
- } else if (bounds.width < bounds.height) {
8967
- bounds.top += (bounds.height - bounds.width) / 2;
8968
- bounds.height = bounds.width;
8969
- }
8970
- return bounds;
8971
- };
8972
 
8973
- var inlineFormElement = function inlineFormElement(value, node, container, allowLinebreak) {
8974
- var body = node.ownerDocument.body;
8975
- if (value.length > 0 && body) {
8976
- var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
8977
- (0, _Util.copyCSSStyles)(node.ownerDocument.defaultView.getComputedStyle(node, null), wrapper);
8978
- wrapper.style.position = 'absolute';
8979
- wrapper.style.left = container.bounds.left + 'px';
8980
- wrapper.style.top = container.bounds.top + 'px';
8981
- if (!allowLinebreak) {
8982
- wrapper.style.whiteSpace = 'nowrap';
8983
- }
8984
- var text = node.ownerDocument.createTextNode(value);
8985
- wrapper.appendChild(text);
8986
- body.appendChild(wrapper);
8987
- container.childNodes.push(_TextContainer2.default.fromTextNode(text, container));
8988
- body.removeChild(wrapper);
8989
- }
8990
- };
8991
 
8992
- var getInputValue = function getInputValue(node) {
8993
- var value = node.type === 'password' ? new Array(node.value.length + 1).join('\u2022') : node.value;
8994
 
8995
- return value.length === 0 ? node.placeholder || '' : value;
8996
- };
8997
 
8998
  /***/ }),
8999
- /* 22 */
9000
  /***/ (function(module, exports, __webpack_require__) {
9001
 
9002
  "use strict";
@@ -9005,82 +6160,35 @@ var getInputValue = function getInputValue(node) {
9005
  Object.defineProperty(exports, "__esModule", {
9006
  value: true
9007
  });
9008
- exports.parseTextBounds = exports.TextBounds = undefined;
9009
-
9010
- var _Bounds = __webpack_require__(2);
9011
-
9012
- var _textDecoration = __webpack_require__(11);
9013
-
9014
- var _Feature = __webpack_require__(10);
9015
-
9016
- var _Feature2 = _interopRequireDefault(_Feature);
9017
-
9018
- var _Unicode = __webpack_require__(24);
9019
 
9020
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9021
 
9022
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9023
 
9024
- var TextBounds = exports.TextBounds = function TextBounds(text, bounds) {
9025
- _classCallCheck(this, TextBounds);
9026
-
9027
- this.text = text;
9028
- this.bounds = bounds;
9029
- };
9030
 
9031
- var parseTextBounds = exports.parseTextBounds = function parseTextBounds(value, parent, node) {
9032
- var letterRendering = parent.style.letterSpacing !== 0;
9033
- var textList = letterRendering ? (0, _Unicode.toCodePoints)(value).map(function (i) {
9034
- return (0, _Unicode.fromCodePoint)(i);
9035
- }) : (0, _Unicode.breakWords)(value, parent);
9036
- var length = textList.length;
9037
- var defaultView = node.parentNode ? node.parentNode.ownerDocument.defaultView : null;
9038
- var scrollX = defaultView ? defaultView.pageXOffset : 0;
9039
- var scrollY = defaultView ? defaultView.pageYOffset : 0;
9040
- var textBounds = [];
9041
- var offset = 0;
9042
- for (var i = 0; i < length; i++) {
9043
- var text = textList[i];
9044
- if (parent.style.textDecoration !== _textDecoration.TEXT_DECORATION.NONE || text.trim().length > 0) {
9045
- if (_Feature2.default.SUPPORT_RANGE_BOUNDS) {
9046
- textBounds.push(new TextBounds(text, getRangeBounds(node, offset, text.length, scrollX, scrollY)));
9047
- } else {
9048
- var replacementNode = node.splitText(text.length);
9049
- textBounds.push(new TextBounds(text, getWrapperBounds(node, scrollX, scrollY)));
9050
- node = replacementNode;
9051
- }
9052
- } else if (!_Feature2.default.SUPPORT_RANGE_BOUNDS) {
9053
- node = node.splitText(text.length);
9054
  }
9055
- offset += text.length;
9056
- }
9057
- return textBounds;
9058
- };
9059
-
9060
- var getWrapperBounds = function getWrapperBounds(node, scrollX, scrollY) {
9061
- var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
9062
- wrapper.appendChild(node.cloneNode(true));
9063
- var parentNode = node.parentNode;
9064
- if (parentNode) {
9065
- parentNode.replaceChild(wrapper, node);
9066
- var bounds = (0, _Bounds.parseBounds)(wrapper, scrollX, scrollY);
9067
- if (wrapper.firstChild) {
9068
- parentNode.replaceChild(wrapper.firstChild, wrapper);
9069
  }
9070
- return bounds;
9071
  }
9072
- return new _Bounds.Bounds(0, 0, 0, 0);
9073
  };
9074
 
9075
- var getRangeBounds = function getRangeBounds(node, offset, length, scrollX, scrollY) {
9076
- var range = node.ownerDocument.createRange();
9077
- range.setStart(node, offset);
9078
- range.setEnd(node, offset + length);
9079
- return _Bounds.Bounds.fromClientRect(range.getBoundingClientRect(), scrollX, scrollY);
9080
- };
9081
 
9082
  /***/ }),
9083
- /* 23 */
9084
  /***/ (function(module, exports, __webpack_require__) {
9085
 
9086
  "use strict";
@@ -9090,226 +6198,331 @@ Object.defineProperty(exports, "__esModule", {
9090
  value: true
9091
  });
9092
 
 
 
9093
  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; }; }();
9094
 
9095
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9096
 
9097
- var ForeignObjectRenderer = function () {
9098
- function ForeignObjectRenderer(element) {
9099
- _classCallCheck(this, ForeignObjectRenderer);
9100
 
9101
- this.element = element;
9102
- }
9103
 
9104
- _createClass(ForeignObjectRenderer, [{
9105
- key: 'render',
9106
- value: function render(options) {
9107
- var _this = this;
9108
 
9109
- this.options = options;
9110
- this.canvas = document.createElement('canvas');
9111
- this.ctx = this.canvas.getContext('2d');
9112
- this.canvas.width = Math.floor(options.width) * options.scale;
9113
- this.canvas.height = Math.floor(options.height) * options.scale;
9114
- this.canvas.style.width = options.width + 'px';
9115
- this.canvas.style.height = options.height + 'px';
9116
 
9117
- options.logger.log('ForeignObject renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + options.scale);
9118
- 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);
9119
 
9120
- return loadSerializedSVG(svg).then(function (img) {
9121
- if (options.backgroundColor) {
9122
- _this.ctx.fillStyle = options.backgroundColor.toString();
9123
- _this.ctx.fillRect(0, 0, options.width * options.scale, options.height * options.scale);
9124
- }
9125
 
9126
- _this.ctx.drawImage(img, -options.x * options.scale, -options.y * options.scale);
9127
- return _this.canvas;
9128
- });
9129
- }
9130
- }]);
9131
 
9132
- return ForeignObjectRenderer;
9133
- }();
9134
-
9135
- exports.default = ForeignObjectRenderer;
9136
- var createForeignObjectSVG = exports.createForeignObjectSVG = function createForeignObjectSVG(width, height, x, y, node) {
9137
- var xmlns = 'http://www.w3.org/2000/svg';
9138
- var svg = document.createElementNS(xmlns, 'svg');
9139
- var foreignObject = document.createElementNS(xmlns, 'foreignObject');
9140
- svg.setAttributeNS(null, 'width', width);
9141
- svg.setAttributeNS(null, 'height', height);
9142
-
9143
- foreignObject.setAttributeNS(null, 'width', '100%');
9144
- foreignObject.setAttributeNS(null, 'height', '100%');
9145
- foreignObject.setAttributeNS(null, 'x', x);
9146
- foreignObject.setAttributeNS(null, 'y', y);
9147
- foreignObject.setAttributeNS(null, 'externalResourcesRequired', 'true');
9148
- svg.appendChild(foreignObject);
9149
-
9150
- foreignObject.appendChild(node);
9151
-
9152
- return svg;
9153
- };
9154
-
9155
- var loadSerializedSVG = exports.loadSerializedSVG = function loadSerializedSVG(svg) {
9156
- return new Promise(function (resolve, reject) {
9157
- var img = new Image();
9158
- img.onload = function () {
9159
- return resolve(img);
9160
- };
9161
- img.onerror = reject;
9162
-
9163
- img.src = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(new XMLSerializer().serializeToString(svg));
9164
- });
9165
- };
9166
-
9167
- /***/ }),
9168
- /* 24 */
9169
- /***/ (function(module, exports, __webpack_require__) {
9170
-
9171
- "use strict";
9172
 
 
 
 
9173
 
9174
- Object.defineProperty(exports, "__esModule", {
9175
- value: true
9176
- });
9177
- exports.breakWords = exports.fromCodePoint = exports.toCodePoints = undefined;
9178
 
9179
- var _cssLineBreak = __webpack_require__(46);
 
 
 
 
 
 
 
 
 
 
 
9180
 
9181
- Object.defineProperty(exports, 'toCodePoints', {
9182
- enumerable: true,
9183
- get: function get() {
9184
- return _cssLineBreak.toCodePoints;
9185
- }
9186
- });
9187
- Object.defineProperty(exports, 'fromCodePoint', {
9188
- enumerable: true,
9189
- get: function get() {
9190
- return _cssLineBreak.fromCodePoint;
9191
- }
9192
- });
9193
 
9194
- var _NodeContainer = __webpack_require__(3);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9195
 
9196
- var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
9197
 
9198
- var _overflowWrap = __webpack_require__(18);
 
 
9199
 
9200
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
9201
 
9202
- var breakWords = exports.breakWords = function breakWords(str, parent) {
9203
- var breaker = (0, _cssLineBreak.LineBreaker)(str, {
9204
- lineBreak: parent.style.lineBreak,
9205
- wordBreak: parent.style.overflowWrap === _overflowWrap.OVERFLOW_WRAP.BREAK_WORD ? 'break-word' : parent.style.wordBreak
9206
- });
9207
 
9208
- var words = [];
9209
- var bk = void 0;
 
9210
 
9211
- while (!(bk = breaker.next()).done) {
9212
- words.push(bk.value.slice());
9213
- }
 
 
 
9214
 
9215
- return words;
9216
- };
 
 
 
 
 
 
 
 
 
 
 
9217
 
9218
- /***/ }),
9219
- /* 25 */
9220
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9221
 
9222
- "use strict";
 
 
 
 
 
 
 
 
 
 
 
9223
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9224
 
9225
- Object.defineProperty(exports, "__esModule", {
9226
- value: true
9227
- });
9228
- exports.FontMetrics = undefined;
 
 
9229
 
9230
- 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; }; }();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9231
 
9232
- var _Util = __webpack_require__(4);
 
 
 
9233
 
9234
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
9235
 
9236
- var SAMPLE_TEXT = 'Hidden Text';
9237
 
9238
- var FontMetrics = exports.FontMetrics = function () {
9239
- function FontMetrics(document) {
9240
- _classCallCheck(this, FontMetrics);
9241
-
9242
- this._data = {};
9243
- this._document = document;
9244
- }
9245
-
9246
- _createClass(FontMetrics, [{
9247
- key: '_parseMetrics',
9248
- value: function _parseMetrics(font) {
9249
- var container = this._document.createElement('div');
9250
- var img = this._document.createElement('img');
9251
- var span = this._document.createElement('span');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9252
 
9253
- var body = this._document.body;
9254
- if (!body) {
9255
- throw new Error( true ? 'No document found for font metrics' : '');
9256
  }
 
 
 
 
 
 
 
 
 
 
 
9257
 
9258
- container.style.visibility = 'hidden';
9259
- container.style.fontFamily = font.fontFamily;
9260
- container.style.fontSize = font.fontSize;
9261
- container.style.margin = '0';
9262
- container.style.padding = '0';
9263
-
9264
- body.appendChild(container);
9265
-
9266
- img.src = _Util.SMALL_IMAGE;
9267
- img.width = 1;
9268
- img.height = 1;
9269
-
9270
- img.style.margin = '0';
9271
- img.style.padding = '0';
9272
- img.style.verticalAlign = 'baseline';
9273
-
9274
- span.style.fontFamily = font.fontFamily;
9275
- span.style.fontSize = font.fontSize;
9276
- span.style.margin = '0';
9277
- span.style.padding = '0';
9278
-
9279
- span.appendChild(this._document.createTextNode(SAMPLE_TEXT));
9280
- container.appendChild(span);
9281
- container.appendChild(img);
9282
- var baseline = img.offsetTop - span.offsetTop + 2;
9283
-
9284
- container.removeChild(span);
9285
- container.appendChild(this._document.createTextNode(SAMPLE_TEXT));
9286
 
9287
- container.style.lineHeight = 'normal';
9288
- img.style.verticalAlign = 'super';
9289
 
9290
- var middle = img.offsetTop - container.offsetTop + 2;
9291
 
9292
- body.removeChild(container);
 
 
9293
 
9294
- return { baseline: baseline, middle: middle };
 
 
 
 
 
 
9295
  }
9296
- }, {
9297
- key: 'getMetrics',
9298
- value: function getMetrics(font) {
9299
- var key = font.fontFamily + ' ' + font.fontSize;
9300
- if (this._data[key] === undefined) {
9301
- this._data[key] = this._parseMetrics(font);
9302
- }
9303
 
9304
- return this._data[key];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9305
  }
9306
- }]);
 
 
9307
 
9308
- return FontMetrics;
9309
- }();
 
 
 
 
 
 
 
9310
 
9311
  /***/ }),
9312
- /* 26 */
9313
  /***/ (function(module, exports, __webpack_require__) {
9314
 
9315
  "use strict";
@@ -9318,301 +6531,451 @@ var FontMetrics = exports.FontMetrics = function () {
9318
  Object.defineProperty(exports, "__esModule", {
9319
  value: true
9320
  });
9321
- exports.Proxy = undefined;
9322
-
9323
- var _Feature = __webpack_require__(10);
9324
 
9325
- var _Feature2 = _interopRequireDefault(_Feature);
9326
 
9327
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9328
 
9329
- var Proxy = exports.Proxy = function Proxy(src, options) {
9330
- if (!options.proxy) {
9331
- return Promise.reject( true ? 'No proxy defined' : null);
9332
- }
9333
- var proxy = options.proxy;
9334
 
9335
- return new Promise(function (resolve, reject) {
9336
- var responseType = _Feature2.default.SUPPORT_CORS_XHR && _Feature2.default.SUPPORT_RESPONSE_TYPE ? 'blob' : 'text';
9337
- var xhr = _Feature2.default.SUPPORT_CORS_XHR ? new XMLHttpRequest() : new XDomainRequest();
9338
- xhr.onload = function () {
9339
- if (xhr instanceof XMLHttpRequest) {
9340
- if (xhr.status === 200) {
9341
- if (responseType === 'text') {
9342
- resolve(xhr.response);
9343
- } else {
9344
- var reader = new FileReader();
9345
- // $FlowFixMe
9346
- reader.addEventListener('load', function () {
9347
- return resolve(reader.result);
9348
- }, false);
9349
- // $FlowFixMe
9350
- reader.addEventListener('error', function (e) {
9351
- return reject(e);
9352
- }, false);
9353
- reader.readAsDataURL(xhr.response);
9354
- }
9355
- } else {
9356
- reject( true ? 'Failed to proxy resource ' + src.substring(0, 256) + ' with status code ' + xhr.status : '');
9357
- }
9358
- } else {
9359
- resolve(xhr.responseText);
9360
- }
9361
- };
9362
 
9363
- xhr.onerror = reject;
9364
- xhr.open('GET', proxy + '?url=' + encodeURIComponent(src) + '&responseType=' + responseType);
9365
 
9366
- if (responseType !== 'text' && xhr instanceof XMLHttpRequest) {
9367
- xhr.responseType = responseType;
9368
- }
9369
 
9370
- if (options.imageTimeout) {
9371
- var timeout = options.imageTimeout;
9372
- xhr.timeout = timeout;
9373
- xhr.ontimeout = function () {
9374
- return reject( true ? 'Timed out (' + timeout + 'ms) proxying ' + src.substring(0, 256) : '');
9375
- };
9376
- }
9377
 
9378
- xhr.send();
9379
- });
9380
- };
9381
 
9382
- /***/ }),
9383
- /* 27 */
9384
- /***/ (function(module, exports, __webpack_require__) {
9385
 
9386
- "use strict";
9387
 
 
9388
 
9389
- 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; };
 
 
 
 
9390
 
9391
- var _CanvasRenderer = __webpack_require__(15);
 
 
 
9392
 
9393
- var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);
 
 
 
9394
 
9395
- var _Logger = __webpack_require__(16);
 
 
 
 
 
 
9396
 
9397
- var _Logger2 = _interopRequireDefault(_Logger);
 
9398
 
9399
- var _Window = __webpack_require__(28);
 
 
 
9400
 
9401
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
9402
 
9403
- var html2canvas = function html2canvas(element, conf) {
9404
- var config = conf || {};
9405
- var logger = new _Logger2.default(typeof config.logging === 'boolean' ? config.logging : true);
9406
- logger.log('html2canvas ' + "1.0.0-alpha.12");
 
 
9407
 
9408
- if (true && typeof config.onrendered === 'function') {
9409
- logger.error('onrendered option is deprecated, html2canvas returns a Promise with the canvas as the value');
9410
- }
 
9411
 
9412
- var ownerDocument = element.ownerDocument;
9413
- if (!ownerDocument) {
9414
- return Promise.reject('Provided element is not within a Document');
 
 
 
 
 
 
9415
  }
9416
- var defaultView = ownerDocument.defaultView;
9417
-
9418
- var defaultOptions = {
9419
- async: true,
9420
- allowTaint: false,
9421
- backgroundColor: '#ffffff',
9422
- imageTimeout: 15000,
9423
- logging: true,
9424
- proxy: null,
9425
- removeContainer: true,
9426
- foreignObjectRendering: false,
9427
- scale: defaultView.devicePixelRatio || 1,
9428
- target: new _CanvasRenderer2.default(config.canvas),
9429
- useCORS: false,
9430
- windowWidth: defaultView.innerWidth,
9431
- windowHeight: defaultView.innerHeight,
9432
- scrollX: defaultView.pageXOffset,
9433
- scrollY: defaultView.pageYOffset
9434
- };
9435
 
9436
- var result = (0, _Window.renderElement)(element, _extends({}, defaultOptions, config), logger);
 
9437
 
9438
- if (true) {
9439
- return result.catch(function (e) {
9440
- logger.error(e);
9441
- throw e;
9442
- });
 
 
9443
  }
9444
- return result;
9445
- };
9446
 
9447
- html2canvas.CanvasRenderer = _CanvasRenderer2.default;
 
 
9448
 
9449
- module.exports = html2canvas;
9450
 
9451
- /***/ }),
9452
- /* 28 */
9453
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
9454
 
9455
- "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9456
 
 
 
9457
 
9458
- Object.defineProperty(exports, "__esModule", {
9459
- value: true
9460
- });
9461
- exports.renderElement = undefined;
 
 
 
 
9462
 
9463
- 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"); } }; }();
 
9464
 
9465
- var _Logger = __webpack_require__(16);
 
9466
 
9467
- var _Logger2 = _interopRequireDefault(_Logger);
 
 
 
 
 
 
9468
 
9469
- var _NodeParser = __webpack_require__(29);
 
 
 
 
9470
 
9471
- var _Renderer = __webpack_require__(51);
 
 
9472
 
9473
- var _Renderer2 = _interopRequireDefault(_Renderer);
 
 
 
 
 
9474
 
9475
- var _ForeignObjectRenderer = __webpack_require__(23);
 
 
 
 
 
9476
 
9477
- var _ForeignObjectRenderer2 = _interopRequireDefault(_ForeignObjectRenderer);
 
 
 
 
9478
 
9479
- var _Feature = __webpack_require__(10);
 
9480
 
9481
- var _Feature2 = _interopRequireDefault(_Feature);
 
 
 
 
 
 
9482
 
9483
- var _Bounds = __webpack_require__(2);
 
 
 
9484
 
9485
- var _Clone = __webpack_require__(54);
 
9486
 
9487
- var _Font = __webpack_require__(25);
 
 
9488
 
9489
- var _Color = __webpack_require__(0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9490
 
9491
- var _Color2 = _interopRequireDefault(_Color);
 
 
 
 
9492
 
9493
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9494
 
9495
- var renderElement = exports.renderElement = function renderElement(element, options, logger) {
9496
- var ownerDocument = element.ownerDocument;
9497
 
9498
- var windowBounds = new _Bounds.Bounds(options.scrollX, options.scrollY, options.windowWidth, options.windowHeight);
 
9499
 
9500
- // http://www.w3.org/TR/css3-background/#special-backgrounds
9501
- var documentBackgroundColor = ownerDocument.documentElement ? new _Color2.default(getComputedStyle(ownerDocument.documentElement).backgroundColor) : _Color.TRANSPARENT;
9502
- var bodyBackgroundColor = ownerDocument.body ? new _Color2.default(getComputedStyle(ownerDocument.body).backgroundColor) : _Color.TRANSPARENT;
 
 
 
 
 
 
9503
 
9504
- 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;
 
 
 
 
 
9505
 
9506
- return (options.foreignObjectRendering ? // $FlowFixMe
9507
- _Feature2.default.SUPPORT_FOREIGNOBJECT_DRAWING : Promise.resolve(false)).then(function (supportForeignObject) {
9508
- return supportForeignObject ? function (cloner) {
9509
- if (true) {
9510
- logger.log('Document cloned, using foreignObject rendering');
 
 
 
 
 
 
 
 
 
 
9511
  }
 
9512
 
9513
- return cloner.inlineFonts(ownerDocument).then(function () {
9514
- return cloner.resourceLoader.ready();
9515
- }).then(function () {
9516
- var renderer = new _ForeignObjectRenderer2.default(cloner.documentElement);
 
 
 
 
 
 
 
 
 
9517
 
9518
- var defaultView = ownerDocument.defaultView;
9519
- var scrollX = defaultView.pageXOffset;
9520
- var scrollY = defaultView.pageYOffset;
 
 
 
 
 
 
9521
 
9522
- var isDocument = element.tagName === 'HTML' || element.tagName === 'BODY';
 
 
 
 
 
 
 
 
 
 
 
 
9523
 
9524
- var _ref = isDocument ? (0, _Bounds.parseDocumentSize)(ownerDocument) : (0, _Bounds.parseBounds)(element, scrollX, scrollY),
9525
- width = _ref.width,
9526
- height = _ref.height,
9527
- left = _ref.left,
9528
- top = _ref.top;
 
9529
 
9530
- return renderer.render({
9531
- backgroundColor: backgroundColor,
9532
- logger: logger,
9533
- scale: options.scale,
9534
- x: typeof options.x === 'number' ? options.x : left,
9535
- y: typeof options.y === 'number' ? options.y : top,
9536
- width: typeof options.width === 'number' ? options.width : Math.ceil(width),
9537
- height: typeof options.height === 'number' ? options.height : Math.ceil(height),
9538
- windowWidth: options.windowWidth,
9539
- windowHeight: options.windowHeight,
9540
- scrollX: options.scrollX,
9541
- scrollY: options.scrollY
9542
- });
9543
- });
9544
- }(new _Clone.DocumentCloner(element, options, logger, true, renderElement)) : (0, _Clone.cloneWindow)(ownerDocument, windowBounds, element, options, logger, renderElement).then(function (_ref2) {
9545
- var _ref3 = _slicedToArray(_ref2, 3),
9546
- container = _ref3[0],
9547
- clonedElement = _ref3[1],
9548
- resourceLoader = _ref3[2];
9549
 
9550
- if (true) {
9551
- logger.log('Document cloned, using computed rendering');
9552
- }
 
 
 
9553
 
9554
- var stack = (0, _NodeParser.NodeParser)(clonedElement, resourceLoader, logger);
9555
- var clonedDocument = clonedElement.ownerDocument;
 
9556
 
9557
- if (backgroundColor === stack.container.style.background.backgroundColor) {
9558
- stack.container.style.background.backgroundColor = _Color.TRANSPARENT;
9559
- }
 
9560
 
9561
- return resourceLoader.ready().then(function (imageStore) {
9562
- var fontMetrics = new _Font.FontMetrics(clonedDocument);
9563
- if (true) {
9564
- logger.log('Starting renderer');
9565
- }
 
 
 
 
 
 
9566
 
9567
- var defaultView = clonedDocument.defaultView;
9568
- var scrollX = defaultView.pageXOffset;
9569
- var scrollY = defaultView.pageYOffset;
 
9570
 
9571
- var isDocument = clonedElement.tagName === 'HTML' || clonedElement.tagName === 'BODY';
 
 
 
9572
 
9573
- var _ref4 = isDocument ? (0, _Bounds.parseDocumentSize)(ownerDocument) : (0, _Bounds.parseBounds)(clonedElement, scrollX, scrollY),
9574
- width = _ref4.width,
9575
- height = _ref4.height,
9576
- left = _ref4.left,
9577
- top = _ref4.top;
9578
 
9579
- var renderOptions = {
9580
- backgroundColor: backgroundColor,
9581
- fontMetrics: fontMetrics,
9582
- imageStore: imageStore,
9583
- logger: logger,
9584
- scale: options.scale,
9585
- x: typeof options.x === 'number' ? options.x : left,
9586
- y: typeof options.y === 'number' ? options.y : top,
9587
- width: typeof options.width === 'number' ? options.width : Math.ceil(width),
9588
- height: typeof options.height === 'number' ? options.height : Math.ceil(height)
9589
- };
9590
 
9591
- if (Array.isArray(options.target)) {
9592
- return Promise.all(options.target.map(function (target) {
9593
- var renderer = new _Renderer2.default(target, renderOptions);
9594
- return renderer.render(stack);
9595
- }));
9596
- } else {
9597
- var renderer = new _Renderer2.default(options.target, renderOptions);
9598
- var canvas = renderer.render(stack);
9599
- if (options.removeContainer === true) {
9600
- if (container.parentNode) {
9601
- container.parentNode.removeChild(container);
9602
- } else if (true) {
9603
- logger.log('Cannot detach cloned iframe as it is not in the DOM anymore');
9604
- }
9605
- }
9606
 
9607
- return canvas;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9608
  }
9609
- });
9610
- });
9611
  });
9612
  };
9613
 
9614
  /***/ }),
9615
- /* 29 */
9616
  /***/ (function(module, exports, __webpack_require__) {
9617
 
9618
  "use strict";
@@ -9621,178 +6984,30 @@ var renderElement = exports.renderElement = function renderElement(element, opti
9621
  Object.defineProperty(exports, "__esModule", {
9622
  value: true
9623
  });
9624
- exports.NodeParser = undefined;
9625
-
9626
- var _StackingContext = __webpack_require__(30);
9627
-
9628
- var _StackingContext2 = _interopRequireDefault(_StackingContext);
9629
-
9630
- var _NodeContainer = __webpack_require__(3);
9631
-
9632
- var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
9633
 
9634
- var _TextContainer = __webpack_require__(9);
 
9635
 
9636
- var _TextContainer2 = _interopRequireDefault(_TextContainer);
9637
-
9638
- var _Input = __webpack_require__(21);
9639
-
9640
- var _ListItem = __webpack_require__(14);
9641
-
9642
- var _listStyle = __webpack_require__(8);
9643
-
9644
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9645
-
9646
- var NodeParser = exports.NodeParser = function NodeParser(node, resourceLoader, logger) {
9647
- if (true) {
9648
- logger.log('Starting node parsing');
9649
- }
9650
-
9651
- var index = 0;
9652
-
9653
- var container = new _NodeContainer2.default(node, null, resourceLoader, index++);
9654
- var stack = new _StackingContext2.default(container, null, true);
9655
-
9656
- parseNodeTree(node, container, stack, resourceLoader, index);
9657
-
9658
- if (true) {
9659
- logger.log('Finished parsing node tree');
9660
- }
9661
-
9662
- return stack;
9663
- };
9664
-
9665
- var IGNORED_NODE_NAMES = ['SCRIPT', 'HEAD', 'TITLE', 'OBJECT', 'BR', 'OPTION'];
9666
-
9667
- var parseNodeTree = function parseNodeTree(node, parent, stack, resourceLoader, index) {
9668
- if (true && index > 50000) {
9669
- throw new Error('Recursion error while parsing node tree');
9670
- }
9671
-
9672
- for (var childNode = node.firstChild, nextNode; childNode; childNode = nextNode) {
9673
- nextNode = childNode.nextSibling;
9674
- var defaultView = childNode.ownerDocument.defaultView;
9675
- if (childNode instanceof defaultView.Text || childNode instanceof Text || defaultView.parent && childNode instanceof defaultView.parent.Text) {
9676
- if (childNode.data.trim().length > 0) {
9677
- parent.childNodes.push(_TextContainer2.default.fromTextNode(childNode, parent));
9678
- }
9679
- } else if (childNode instanceof defaultView.HTMLElement || childNode instanceof HTMLElement || defaultView.parent && childNode instanceof defaultView.parent.HTMLElement) {
9680
- if (IGNORED_NODE_NAMES.indexOf(childNode.nodeName) === -1) {
9681
- var container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++);
9682
- if (container.isVisible()) {
9683
- if (childNode.tagName === 'INPUT') {
9684
- // $FlowFixMe
9685
- (0, _Input.inlineInputElement)(childNode, container);
9686
- } else if (childNode.tagName === 'TEXTAREA') {
9687
- // $FlowFixMe
9688
- (0, _Input.inlineTextAreaElement)(childNode, container);
9689
- } else if (childNode.tagName === 'SELECT') {
9690
- // $FlowFixMe
9691
- (0, _Input.inlineSelectElement)(childNode, container);
9692
- } else if (container.style.listStyle && container.style.listStyle.listStyleType !== _listStyle.LIST_STYLE_TYPE.NONE) {
9693
- (0, _ListItem.inlineListItemElement)(childNode, container, resourceLoader);
9694
- }
9695
-
9696
- var SHOULD_TRAVERSE_CHILDREN = childNode.tagName !== 'TEXTAREA';
9697
- var treatAsRealStackingContext = createsRealStackingContext(container, childNode);
9698
- if (treatAsRealStackingContext || createsStackingContext(container)) {
9699
- // for treatAsRealStackingContext:false, any positioned descendants and descendants
9700
- // which actually create a new stacking context should be considered part of the parent stacking context
9701
- var parentStack = treatAsRealStackingContext || container.isPositioned() ? stack.getRealParentStackingContext() : stack;
9702
- var childStack = new _StackingContext2.default(container, parentStack, treatAsRealStackingContext);
9703
- parentStack.contexts.push(childStack);
9704
- if (SHOULD_TRAVERSE_CHILDREN) {
9705
- parseNodeTree(childNode, container, childStack, resourceLoader, index);
9706
- }
9707
- } else {
9708
- stack.children.push(container);
9709
- if (SHOULD_TRAVERSE_CHILDREN) {
9710
- parseNodeTree(childNode, container, stack, resourceLoader, index);
9711
- }
9712
- }
9713
- }
9714
- }
9715
- } else if (childNode instanceof defaultView.SVGSVGElement || childNode instanceof SVGSVGElement || defaultView.parent && childNode instanceof defaultView.parent.SVGSVGElement) {
9716
- var _container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++);
9717
- var _treatAsRealStackingContext = createsRealStackingContext(_container, childNode);
9718
- if (_treatAsRealStackingContext || createsStackingContext(_container)) {
9719
- // for treatAsRealStackingContext:false, any positioned descendants and descendants
9720
- // which actually create a new stacking context should be considered part of the parent stacking context
9721
- var _parentStack = _treatAsRealStackingContext || _container.isPositioned() ? stack.getRealParentStackingContext() : stack;
9722
- var _childStack = new _StackingContext2.default(_container, _parentStack, _treatAsRealStackingContext);
9723
- _parentStack.contexts.push(_childStack);
9724
- } else {
9725
- stack.children.push(_container);
9726
- }
9727
  }
9728
  }
9729
- };
9730
-
9731
- var createsRealStackingContext = function createsRealStackingContext(container, node) {
9732
- return container.isRootElement() || container.isPositionedWithZIndex() || container.style.opacity < 1 || container.isTransformed() || isBodyWithTransparentRoot(container, node);
9733
- };
9734
-
9735
- var createsStackingContext = function createsStackingContext(container) {
9736
- return container.isPositioned() || container.isFloating();
9737
- };
9738
 
9739
- var isBodyWithTransparentRoot = function isBodyWithTransparentRoot(container, node) {
9740
- return node.nodeName === 'BODY' && container.parent instanceof _NodeContainer2.default && container.parent.style.background.backgroundColor.isTransparent();
9741
  };
9742
 
9743
  /***/ }),
9744
- /* 30 */
9745
- /***/ (function(module, exports, __webpack_require__) {
9746
-
9747
- "use strict";
9748
-
9749
-
9750
- Object.defineProperty(exports, "__esModule", {
9751
- value: true
9752
- });
9753
-
9754
- 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; }; }();
9755
-
9756
- var _NodeContainer = __webpack_require__(3);
9757
-
9758
- var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
9759
-
9760
- var _position = __webpack_require__(19);
9761
-
9762
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9763
-
9764
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9765
-
9766
- var StackingContext = function () {
9767
- function StackingContext(container, parent, treatAsRealStackingContext) {
9768
- _classCallCheck(this, StackingContext);
9769
-
9770
- this.container = container;
9771
- this.parent = parent;
9772
- this.contexts = [];
9773
- this.children = [];
9774
- this.treatAsRealStackingContext = treatAsRealStackingContext;
9775
- }
9776
-
9777
- _createClass(StackingContext, [{
9778
- key: 'getOpacity',
9779
- value: function getOpacity() {
9780
- return this.parent ? this.container.style.opacity * this.parent.getOpacity() : this.container.style.opacity;
9781
- }
9782
- }, {
9783
- key: 'getRealParentStackingContext',
9784
- value: function getRealParentStackingContext() {
9785
- return !this.parent || this.treatAsRealStackingContext ? this : this.parent.getRealParentStackingContext();
9786
- }
9787
- }]);
9788
-
9789
- return StackingContext;
9790
- }();
9791
-
9792
- exports.default = StackingContext;
9793
-
9794
- /***/ }),
9795
- /* 31 */
9796
  /***/ (function(module, exports, __webpack_require__) {
9797
 
9798
  "use strict";
@@ -9801,404 +7016,586 @@ exports.default = StackingContext;
9801
  Object.defineProperty(exports, "__esModule", {
9802
  value: true
9803
  });
 
9804
 
9805
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9806
-
9807
- var Size = function Size(width, height) {
9808
- _classCallCheck(this, Size);
9809
 
9810
- this.width = width;
9811
- this.height = height;
9812
- };
9813
 
9814
- exports.default = Size;
9815
 
9816
- /***/ }),
9817
- /* 32 */
9818
- /***/ (function(module, exports, __webpack_require__) {
9819
 
9820
- "use strict";
9821
 
 
9822
 
9823
- Object.defineProperty(exports, "__esModule", {
9824
- value: true
9825
- });
9826
 
9827
- 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; }; }();
9828
 
9829
- var _Path = __webpack_require__(6);
9830
 
9831
- var _Vector = __webpack_require__(7);
9832
 
9833
- var _Vector2 = _interopRequireDefault(_Vector);
9834
 
9835
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9836
 
9837
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9838
 
9839
- var lerp = function lerp(a, b, t) {
9840
- return new _Vector2.default(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t);
9841
- };
9842
 
9843
- var BezierCurve = function () {
9844
- function BezierCurve(start, startControl, endControl, end) {
9845
- _classCallCheck(this, BezierCurve);
9846
 
9847
- this.type = _Path.PATH.BEZIER_CURVE;
9848
- this.start = start;
9849
- this.startControl = startControl;
9850
- this.endControl = endControl;
9851
- this.end = end;
 
 
 
 
 
 
 
 
 
9852
  }
9853
 
9854
- _createClass(BezierCurve, [{
9855
- key: 'subdivide',
9856
- value: function subdivide(t, firstHalf) {
9857
- var ab = lerp(this.start, this.startControl, t);
9858
- var bc = lerp(this.startControl, this.endControl, t);
9859
- var cd = lerp(this.endControl, this.end, t);
9860
- var abbc = lerp(ab, bc, t);
9861
- var bccd = lerp(bc, cd, t);
9862
- var dest = lerp(abbc, bccd, t);
9863
- return firstHalf ? new BezierCurve(this.start, ab, abbc, dest) : new BezierCurve(dest, bccd, cd, this.end);
9864
- }
9865
- }, {
9866
- key: 'reverse',
9867
- value: function reverse() {
9868
- return new BezierCurve(this.end, this.endControl, this.startControl, this.start);
9869
- }
9870
- }]);
9871
-
9872
- return BezierCurve;
9873
- }();
9874
-
9875
- exports.default = BezierCurve;
9876
-
9877
- /***/ }),
9878
- /* 33 */
9879
- /***/ (function(module, exports, __webpack_require__) {
9880
 
9881
- "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9882
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9883
 
9884
- Object.defineProperty(exports, "__esModule", {
9885
- value: true
9886
- });
9887
- exports.parseBorderRadius = undefined;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9888
 
9889
- 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"); } }; }();
 
 
 
 
 
 
 
 
 
 
9890
 
9891
- var _Length = __webpack_require__(1);
 
 
 
9892
 
9893
- var _Length2 = _interopRequireDefault(_Length);
 
 
9894
 
9895
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9896
 
9897
- var SIDES = ['top-left', 'top-right', 'bottom-right', 'bottom-left'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9898
 
9899
- var parseBorderRadius = exports.parseBorderRadius = function parseBorderRadius(style) {
9900
- return SIDES.map(function (side) {
9901
- var value = style.getPropertyValue('border-' + side + '-radius');
 
 
 
9902
 
9903
- var _value$split$map = value.split(' ').map(_Length2.default.create),
9904
- _value$split$map2 = _slicedToArray(_value$split$map, 2),
9905
- horizontal = _value$split$map2[0],
9906
- vertical = _value$split$map2[1];
9907
 
9908
- return typeof vertical === 'undefined' ? [horizontal, horizontal] : [horizontal, vertical];
9909
- });
9910
- };
9911
 
9912
- /***/ }),
9913
- /* 34 */
9914
- /***/ (function(module, exports, __webpack_require__) {
9915
 
9916
- "use strict";
 
9917
 
 
 
 
 
 
 
 
 
 
 
 
9918
 
9919
- Object.defineProperty(exports, "__esModule", {
9920
- value: true
9921
- });
9922
- var DISPLAY = exports.DISPLAY = {
9923
- NONE: 1 << 0,
9924
- BLOCK: 1 << 1,
9925
- INLINE: 1 << 2,
9926
- RUN_IN: 1 << 3,
9927
- FLOW: 1 << 4,
9928
- FLOW_ROOT: 1 << 5,
9929
- TABLE: 1 << 6,
9930
- FLEX: 1 << 7,
9931
- GRID: 1 << 8,
9932
- RUBY: 1 << 9,
9933
- SUBGRID: 1 << 10,
9934
- LIST_ITEM: 1 << 11,
9935
- TABLE_ROW_GROUP: 1 << 12,
9936
- TABLE_HEADER_GROUP: 1 << 13,
9937
- TABLE_FOOTER_GROUP: 1 << 14,
9938
- TABLE_ROW: 1 << 15,
9939
- TABLE_CELL: 1 << 16,
9940
- TABLE_COLUMN_GROUP: 1 << 17,
9941
- TABLE_COLUMN: 1 << 18,
9942
- TABLE_CAPTION: 1 << 19,
9943
- RUBY_BASE: 1 << 20,
9944
- RUBY_TEXT: 1 << 21,
9945
- RUBY_BASE_CONTAINER: 1 << 22,
9946
- RUBY_TEXT_CONTAINER: 1 << 23,
9947
- CONTENTS: 1 << 24,
9948
- INLINE_BLOCK: 1 << 25,
9949
- INLINE_LIST_ITEM: 1 << 26,
9950
- INLINE_TABLE: 1 << 27,
9951
- INLINE_FLEX: 1 << 28,
9952
- INLINE_GRID: 1 << 29
9953
- };
9954
 
9955
- var parseDisplayValue = function parseDisplayValue(display) {
9956
- switch (display) {
9957
- case 'block':
9958
- return DISPLAY.BLOCK;
9959
- case 'inline':
9960
- return DISPLAY.INLINE;
9961
- case 'run-in':
9962
- return DISPLAY.RUN_IN;
9963
- case 'flow':
9964
- return DISPLAY.FLOW;
9965
- case 'flow-root':
9966
- return DISPLAY.FLOW_ROOT;
9967
- case 'table':
9968
- return DISPLAY.TABLE;
9969
- case 'flex':
9970
- return DISPLAY.FLEX;
9971
- case 'grid':
9972
- return DISPLAY.GRID;
9973
- case 'ruby':
9974
- return DISPLAY.RUBY;
9975
- case 'subgrid':
9976
- return DISPLAY.SUBGRID;
9977
- case 'list-item':
9978
- return DISPLAY.LIST_ITEM;
9979
- case 'table-row-group':
9980
- return DISPLAY.TABLE_ROW_GROUP;
9981
- case 'table-header-group':
9982
- return DISPLAY.TABLE_HEADER_GROUP;
9983
- case 'table-footer-group':
9984
- return DISPLAY.TABLE_FOOTER_GROUP;
9985
- case 'table-row':
9986
- return DISPLAY.TABLE_ROW;
9987
- case 'table-cell':
9988
- return DISPLAY.TABLE_CELL;
9989
- case 'table-column-group':
9990
- return DISPLAY.TABLE_COLUMN_GROUP;
9991
- case 'table-column':
9992
- return DISPLAY.TABLE_COLUMN;
9993
- case 'table-caption':
9994
- return DISPLAY.TABLE_CAPTION;
9995
- case 'ruby-base':
9996
- return DISPLAY.RUBY_BASE;
9997
- case 'ruby-text':
9998
- return DISPLAY.RUBY_TEXT;
9999
- case 'ruby-base-container':
10000
- return DISPLAY.RUBY_BASE_CONTAINER;
10001
- case 'ruby-text-container':
10002
- return DISPLAY.RUBY_TEXT_CONTAINER;
10003
- case 'contents':
10004
- return DISPLAY.CONTENTS;
10005
- case 'inline-block':
10006
- return DISPLAY.INLINE_BLOCK;
10007
- case 'inline-list-item':
10008
- return DISPLAY.INLINE_LIST_ITEM;
10009
- case 'inline-table':
10010
- return DISPLAY.INLINE_TABLE;
10011
- case 'inline-flex':
10012
- return DISPLAY.INLINE_FLEX;
10013
- case 'inline-grid':
10014
- return DISPLAY.INLINE_GRID;
10015
- }
10016
 
10017
- return DISPLAY.NONE;
10018
- };
10019
 
10020
- var setDisplayBit = function setDisplayBit(bit, display) {
10021
- return bit | parseDisplayValue(display);
10022
- };
 
 
 
 
 
 
 
 
 
 
 
10023
 
10024
- var parseDisplay = exports.parseDisplay = function parseDisplay(display) {
10025
- return display.split(' ').reduce(setDisplayBit, 0);
10026
- };
 
 
 
 
10027
 
10028
- /***/ }),
10029
- /* 35 */
10030
- /***/ (function(module, exports, __webpack_require__) {
10031
 
10032
- "use strict";
 
 
 
 
 
 
 
 
 
10033
 
 
 
 
 
 
 
10034
 
10035
- Object.defineProperty(exports, "__esModule", {
10036
- value: true
10037
- });
10038
- var FLOAT = exports.FLOAT = {
10039
- NONE: 0,
10040
- LEFT: 1,
10041
- RIGHT: 2,
10042
- INLINE_START: 3,
10043
- INLINE_END: 4
10044
  };
10045
 
10046
- var parseCSSFloat = exports.parseCSSFloat = function parseCSSFloat(float) {
10047
- switch (float) {
10048
- case 'left':
10049
- return FLOAT.LEFT;
10050
- case 'right':
10051
- return FLOAT.RIGHT;
10052
- case 'inline-start':
10053
- return FLOAT.INLINE_START;
10054
- case 'inline-end':
10055
- return FLOAT.INLINE_END;
10056
  }
10057
- return FLOAT.NONE;
10058
  };
10059
 
10060
- /***/ }),
10061
- /* 36 */
10062
- /***/ (function(module, exports, __webpack_require__) {
10063
-
10064
- "use strict";
 
 
 
 
 
 
 
 
 
 
10065
 
 
 
 
 
10066
 
10067
- Object.defineProperty(exports, "__esModule", {
10068
- value: true
10069
- });
10070
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10071
 
10072
- var parseFontWeight = function parseFontWeight(weight) {
10073
- switch (weight) {
10074
- case 'normal':
10075
- return 400;
10076
- case 'bold':
10077
- return 700;
10078
  }
10079
 
10080
- var value = parseInt(weight, 10);
10081
- return isNaN(value) ? 400 : value;
10082
  };
10083
 
10084
- var parseFont = exports.parseFont = function parseFont(style) {
10085
- var fontFamily = style.fontFamily;
10086
- var fontSize = style.fontSize;
10087
- var fontStyle = style.fontStyle;
10088
- var fontVariant = style.fontVariant;
10089
- var fontWeight = parseFontWeight(style.fontWeight);
10090
 
10091
- return {
10092
- fontFamily: fontFamily,
10093
- fontSize: fontSize,
10094
- fontStyle: fontStyle,
10095
- fontVariant: fontVariant,
10096
- fontWeight: fontWeight
10097
- };
10098
- };
10099
 
10100
- /***/ }),
10101
- /* 37 */
10102
- /***/ (function(module, exports, __webpack_require__) {
10103
 
10104
- "use strict";
 
 
 
 
10105
 
 
 
 
 
 
10106
 
10107
- Object.defineProperty(exports, "__esModule", {
10108
- value: true
10109
- });
10110
- var parseLetterSpacing = exports.parseLetterSpacing = function parseLetterSpacing(letterSpacing) {
10111
- if (letterSpacing === 'normal') {
10112
- return 0;
10113
- }
10114
- var value = parseFloat(letterSpacing);
10115
- return isNaN(value) ? 0 : value;
10116
  };
10117
 
10118
- /***/ }),
10119
- /* 38 */
10120
- /***/ (function(module, exports, __webpack_require__) {
10121
 
10122
- "use strict";
 
 
 
 
 
 
 
 
 
 
10123
 
 
 
 
 
 
10124
 
10125
- Object.defineProperty(exports, "__esModule", {
10126
- value: true
10127
- });
10128
- var LINE_BREAK = exports.LINE_BREAK = {
10129
- NORMAL: 'normal',
10130
- STRICT: 'strict'
 
 
 
 
 
10131
  };
10132
 
10133
- var parseLineBreak = exports.parseLineBreak = function parseLineBreak(wordBreak) {
10134
- switch (wordBreak) {
10135
- case 'strict':
10136
- return LINE_BREAK.STRICT;
10137
- case 'normal':
10138
- default:
10139
- return LINE_BREAK.NORMAL;
 
 
 
 
 
 
 
 
10140
  }
 
 
 
 
10141
  };
10142
 
10143
- /***/ }),
10144
- /* 39 */
10145
- /***/ (function(module, exports, __webpack_require__) {
10146
 
10147
- "use strict";
 
 
 
 
 
 
 
 
 
 
10148
 
 
 
 
 
10149
 
10150
- Object.defineProperty(exports, "__esModule", {
10151
- value: true
10152
- });
10153
- exports.parseMargin = undefined;
10154
 
10155
- var _Length = __webpack_require__(1);
 
 
10156
 
10157
- var _Length2 = _interopRequireDefault(_Length);
 
 
 
 
 
 
 
10158
 
10159
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10160
 
10161
- var SIDES = ['top', 'right', 'bottom', 'left'];
10162
 
10163
- var parseMargin = exports.parseMargin = function parseMargin(style) {
10164
- return SIDES.map(function (side) {
10165
- return new _Length2.default(style.getPropertyValue('margin-' + side));
 
 
 
 
 
 
 
 
 
 
 
 
10166
  });
10167
  };
10168
 
10169
- /***/ }),
10170
- /* 40 */
10171
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
10172
 
10173
- "use strict";
 
 
10174
 
 
 
 
10175
 
10176
- Object.defineProperty(exports, "__esModule", {
10177
- value: true
10178
- });
10179
- var OVERFLOW = exports.OVERFLOW = {
10180
- VISIBLE: 0,
10181
- HIDDEN: 1,
10182
- SCROLL: 2,
10183
- AUTO: 3
10184
- };
10185
 
10186
- var parseOverflow = exports.parseOverflow = function parseOverflow(overflow) {
10187
- switch (overflow) {
10188
- case 'hidden':
10189
- return OVERFLOW.HIDDEN;
10190
- case 'scroll':
10191
- return OVERFLOW.SCROLL;
10192
- case 'auto':
10193
- return OVERFLOW.AUTO;
10194
- case 'visible':
10195
- default:
10196
- return OVERFLOW.VISIBLE;
10197
  }
 
 
10198
  };
10199
 
10200
  /***/ }),
10201
- /* 41 */
10202
  /***/ (function(module, exports, __webpack_require__) {
10203
 
10204
  "use strict";
@@ -10207,172 +7604,275 @@ var parseOverflow = exports.parseOverflow = function parseOverflow(overflow) {
10207
  Object.defineProperty(exports, "__esModule", {
10208
  value: true
10209
  });
10210
- exports.parseTextShadow = undefined;
10211
 
10212
- var _Color = __webpack_require__(0);
10213
 
10214
- var _Color2 = _interopRequireDefault(_Color);
 
 
 
 
10215
 
10216
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10217
 
10218
- var NUMBER = /^([+-]|\d|\.)$/i;
10219
 
10220
- var parseTextShadow = exports.parseTextShadow = function parseTextShadow(textShadow) {
10221
- if (textShadow === 'none' || typeof textShadow !== 'string') {
10222
- return null;
 
 
 
 
 
 
 
10223
  }
10224
 
10225
- var currentValue = '';
10226
- var isLength = false;
10227
- var values = [];
10228
- var shadows = [];
10229
- var numParens = 0;
10230
- var color = null;
10231
 
10232
- var appendValue = function appendValue() {
10233
- if (currentValue.length) {
10234
- if (isLength) {
10235
- values.push(parseFloat(currentValue));
10236
- } else {
10237
- color = new _Color2.default(currentValue);
10238
  }
10239
- }
10240
- isLength = false;
10241
- currentValue = '';
10242
- };
10243
 
10244
- var appendShadow = function appendShadow() {
10245
- if (values.length && color !== null) {
10246
- shadows.push({
10247
- color: color,
10248
- offsetX: values[0] || 0,
10249
- offsetY: values[1] || 0,
10250
- blur: values[2] || 0
10251
- });
10252
- }
10253
- values.splice(0, values.length);
10254
- color = null;
10255
- };
10256
-
10257
- for (var i = 0; i < textShadow.length; i++) {
10258
- var c = textShadow[i];
10259
- switch (c) {
10260
- case '(':
10261
- currentValue += c;
10262
- numParens++;
10263
- break;
10264
- case ')':
10265
- currentValue += c;
10266
- numParens--;
10267
- break;
10268
- case ',':
10269
- if (numParens === 0) {
10270
- appendValue();
10271
- appendShadow();
10272
- } else {
10273
- currentValue += c;
10274
- }
10275
- break;
10276
- case ' ':
10277
- if (numParens === 0) {
10278
- appendValue();
10279
- } else {
10280
- currentValue += c;
10281
- }
10282
- break;
10283
- default:
10284
- if (currentValue.length === 0 && NUMBER.test(c)) {
10285
- isLength = true;
10286
  }
10287
- currentValue += c;
10288
  }
10289
- }
 
 
 
10290
 
10291
- appendValue();
10292
- appendShadow();
 
 
 
 
 
 
 
 
 
10293
 
10294
- if (shadows.length === 0) {
10295
- return null;
10296
- }
 
 
 
10297
 
10298
- return shadows;
10299
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10300
 
10301
- /***/ }),
10302
- /* 42 */
10303
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10304
 
10305
- "use strict";
 
 
10306
 
 
 
 
 
 
 
 
 
 
 
10307
 
10308
- Object.defineProperty(exports, "__esModule", {
10309
- value: true
10310
- });
10311
- exports.parseTransform = undefined;
 
 
 
 
 
 
 
 
 
 
 
 
10312
 
10313
- var _Length = __webpack_require__(1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10314
 
10315
- var _Length2 = _interopRequireDefault(_Length);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10316
 
10317
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
10318
 
10319
- var toFloat = function toFloat(s) {
10320
- return parseFloat(s.trim());
10321
- };
10322
 
10323
- var MATRIX = /(matrix|matrix3d)\((.+)\)/;
 
 
10324
 
10325
- var parseTransform = exports.parseTransform = function parseTransform(style) {
10326
- var transform = parseTransformMatrix(style.transform || style.webkitTransform || style.mozTransform ||
10327
- // $FlowFixMe
10328
- style.msTransform ||
10329
- // $FlowFixMe
10330
- style.oTransform);
10331
- if (transform === null) {
10332
- return null;
10333
  }
10334
 
10335
- return {
10336
- transform: transform,
10337
- transformOrigin: parseTransformOrigin(style.transformOrigin || style.webkitTransformOrigin || style.mozTransformOrigin ||
10338
- // $FlowFixMe
10339
- style.msTransformOrigin ||
10340
- // $FlowFixMe
10341
- style.oTransformOrigin)
10342
- };
10343
- };
10344
 
10345
- // $FlowFixMe
10346
- var parseTransformOrigin = function parseTransformOrigin(origin) {
10347
- if (typeof origin !== 'string') {
10348
- var v = new _Length2.default('0');
10349
- return [v, v];
10350
- }
10351
- var values = origin.split(' ').map(_Length2.default.create);
10352
- return [values[0], values[1]];
10353
- };
10354
 
10355
- // $FlowFixMe
10356
- var parseTransformMatrix = function parseTransformMatrix(transform) {
10357
- if (transform === 'none' || typeof transform !== 'string') {
10358
- return null;
10359
- }
10360
 
10361
- var match = transform.match(MATRIX);
10362
- if (match) {
10363
- if (match[1] === 'matrix') {
10364
- var matrix = match[2].split(',').map(toFloat);
10365
- return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]];
10366
- } else {
10367
- var matrix3d = match[2].split(',').map(toFloat);
10368
- return [matrix3d[0], matrix3d[1], matrix3d[4], matrix3d[5], matrix3d[12], matrix3d[13]];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10369
  }
10370
- }
10371
- return null;
 
 
 
 
10372
  };
10373
 
10374
  /***/ }),
10375
- /* 43 */
10376
  /***/ (function(module, exports, __webpack_require__) {
10377
 
10378
  "use strict";
@@ -10381,5325 +7881,4865 @@ var parseTransformMatrix = function parseTransformMatrix(transform) {
10381
  Object.defineProperty(exports, "__esModule", {
10382
  value: true
10383
  });
10384
- var VISIBILITY = exports.VISIBILITY = {
10385
- VISIBLE: 0,
10386
- HIDDEN: 1,
10387
- COLLAPSE: 2
10388
- };
10389
 
10390
- var parseVisibility = exports.parseVisibility = function parseVisibility(visibility) {
10391
- switch (visibility) {
10392
- case 'hidden':
10393
- return VISIBILITY.HIDDEN;
10394
- case 'collapse':
10395
- return VISIBILITY.COLLAPSE;
10396
- case 'visible':
10397
- default:
10398
- return VISIBILITY.VISIBLE;
10399
- }
10400
- };
10401
 
10402
- /***/ }),
10403
- /* 44 */
10404
- /***/ (function(module, exports, __webpack_require__) {
10405
 
10406
- "use strict";
10407
 
 
 
 
 
10408
 
10409
- Object.defineProperty(exports, "__esModule", {
10410
- value: true
10411
- });
10412
- var WORD_BREAK = exports.WORD_BREAK = {
10413
- NORMAL: 'normal',
10414
- BREAK_ALL: 'break-all',
10415
- KEEP_ALL: 'keep-all'
 
10416
  };
10417
 
10418
- var parseWordBreak = exports.parseWordBreak = function parseWordBreak(wordBreak) {
10419
- switch (wordBreak) {
10420
- case 'break-all':
10421
- return WORD_BREAK.BREAK_ALL;
10422
- case 'keep-all':
10423
- return WORD_BREAK.KEEP_ALL;
10424
- case 'normal':
10425
- default:
10426
- return WORD_BREAK.NORMAL;
10427
  }
10428
- };
10429
 
10430
- /***/ }),
10431
- /* 45 */
10432
- /***/ (function(module, exports, __webpack_require__) {
10433
 
10434
- "use strict";
 
 
 
 
10435
 
 
 
 
 
 
 
 
10436
 
10437
- Object.defineProperty(exports, "__esModule", {
10438
- value: true
10439
- });
10440
- var parseZIndex = exports.parseZIndex = function parseZIndex(zIndex) {
10441
- var auto = zIndex === 'auto';
10442
- return {
10443
- auto: auto,
10444
- order: auto ? 0 : parseInt(zIndex, 10)
10445
- };
10446
  };
10447
 
10448
- /***/ }),
10449
- /* 46 */
10450
- /***/ (function(module, exports, __webpack_require__) {
10451
-
10452
- "use strict";
10453
-
10454
 
10455
- Object.defineProperty(exports, "__esModule", {
10456
- value: true
10457
- });
 
10458
 
10459
- var _Util = __webpack_require__(13);
10460
 
10461
- Object.defineProperty(exports, 'toCodePoints', {
10462
- enumerable: true,
10463
- get: function get() {
10464
- return _Util.toCodePoints;
10465
- }
10466
- });
10467
- Object.defineProperty(exports, 'fromCodePoint', {
10468
- enumerable: true,
10469
- get: function get() {
10470
- return _Util.fromCodePoint;
10471
- }
10472
- });
10473
 
10474
- var _LineBreak = __webpack_require__(47);
 
 
 
 
 
 
10475
 
10476
- Object.defineProperty(exports, 'LineBreaker', {
10477
- enumerable: true,
10478
- get: function get() {
10479
- return _LineBreak.LineBreaker;
10480
- }
10481
- });
10482
 
10483
- /***/ }),
10484
- /* 47 */
10485
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
10486
 
10487
- "use strict";
 
 
 
 
10488
 
 
 
 
 
 
 
10489
 
10490
- Object.defineProperty(exports, "__esModule", {
10491
- value: true
10492
- });
10493
- 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;
 
 
10494
 
10495
- 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; }; }();
 
 
 
10496
 
10497
- 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"); } }; }();
 
 
 
10498
 
10499
- var _Trie = __webpack_require__(48);
 
 
 
 
 
 
 
 
10500
 
10501
- var _linebreakTrie = __webpack_require__(49);
 
 
10502
 
10503
- var _linebreakTrie2 = _interopRequireDefault(_linebreakTrie);
 
10504
 
10505
- var _Util = __webpack_require__(13);
 
 
 
10506
 
10507
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
10508
 
10509
- 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); } }
 
 
 
 
 
10510
 
10511
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
10512
 
10513
- var LETTER_NUMBER_MODIFIER = exports.LETTER_NUMBER_MODIFIER = 50;
 
 
 
 
 
 
 
 
 
 
 
 
10514
 
10515
- // Non-tailorable Line Breaking Classes
10516
- var BK = 1; // Cause a line break (after)
10517
- var CR = 2; // Cause a line break (after), except between CR and LF
10518
- var LF = 3; // Cause a line break (after)
10519
- var CM = 4; // Prohibit a line break between the character and the preceding character
10520
- var NL = 5; // Cause a line break (after)
10521
- var SG = 6; // Do not occur in well-formed text
10522
- var WJ = 7; // Prohibit line breaks before and after
10523
- var ZW = 8; // Provide a break opportunity
10524
- var GL = 9; // Prohibit line breaks before and after
10525
- var SP = 10; // Enable indirect line breaks
10526
- var ZWJ = 11; // Prohibit line breaks within joiner sequences
10527
- // Break Opportunities
10528
- var B2 = 12; // Provide a line break opportunity before and after the character
10529
- var BA = 13; // Generally provide a line break opportunity after the character
10530
- var BB = 14; // Generally provide a line break opportunity before the character
10531
- var HY = 15; // Provide a line break opportunity after the character, except in numeric context
10532
- var CB = 16; // Provide a line break opportunity contingent on additional information
10533
- // Characters Prohibiting Certain Breaks
10534
- var CL = 17; // Prohibit line breaks before
10535
- var CP = 18; // Prohibit line breaks before
10536
- var EX = 19; // Prohibit line breaks before
10537
- var IN = 20; // Allow only indirect line breaks between pairs
10538
- var NS = 21; // Allow only indirect line breaks before
10539
- var OP = 22; // Prohibit line breaks after
10540
- var QU = 23; // Act like they are both opening and closing
10541
- // Numeric Context
10542
- var IS = 24; // Prevent breaks after any and before numeric
10543
- var NU = 25; // Form numeric expressions for line breaking purposes
10544
- var PO = 26; // Do not break following a numeric expression
10545
- var PR = 27; // Do not break in front of a numeric expression
10546
- var SY = 28; // Prevent a break before; and allow a break after
10547
- // Other Characters
10548
- var AI = 29; // Act like AL when the resolvedEAW is N; otherwise; act as ID
10549
- var AL = 30; // Are alphabetic characters or symbols that are used with alphabetic characters
10550
- var CJ = 31; // Treat as NS or ID for strict or normal breaking.
10551
- var EB = 32; // Do not break from following Emoji Modifier
10552
- var EM = 33; // Do not break from preceding Emoji Base
10553
- var H2 = 34; // Form Korean syllable blocks
10554
- var H3 = 35; // Form Korean syllable blocks
10555
- var HL = 36; // Do not break around a following hyphen; otherwise act as Alphabetic
10556
- var ID = 37; // Break before or after; except in some numeric context
10557
- var JL = 38; // Form Korean syllable blocks
10558
- var JV = 39; // Form Korean syllable blocks
10559
- var JT = 40; // Form Korean syllable blocks
10560
- var RI = 41; // Keep pairs together. For pairs; break before and after other classes
10561
- var SA = 42; // Provide a line break opportunity contingent on additional, language-specific context analysis
10562
- var XX = 43; // Have as yet unknown line breaking behavior or unassigned code positions
10563
 
10564
- var classes = exports.classes = {
10565
- BK: BK,
10566
- CR: CR,
10567
- LF: LF,
10568
- CM: CM,
10569
- NL: NL,
10570
- SG: SG,
10571
- WJ: WJ,
10572
- ZW: ZW,
10573
- GL: GL,
10574
- SP: SP,
10575
- ZWJ: ZWJ,
10576
- B2: B2,
10577
- BA: BA,
10578
- BB: BB,
10579
- HY: HY,
10580
- CB: CB,
10581
- CL: CL,
10582
- CP: CP,
10583
- EX: EX,
10584
- IN: IN,
10585
- NS: NS,
10586
- OP: OP,
10587
- QU: QU,
10588
- IS: IS,
10589
- NU: NU,
10590
- PO: PO,
10591
- PR: PR,
10592
- SY: SY,
10593
- AI: AI,
10594
- AL: AL,
10595
- CJ: CJ,
10596
- EB: EB,
10597
- EM: EM,
10598
- H2: H2,
10599
- H3: H3,
10600
- HL: HL,
10601
- ID: ID,
10602
- JL: JL,
10603
- JV: JV,
10604
- JT: JT,
10605
- RI: RI,
10606
- SA: SA,
10607
- XX: XX
10608
- };
10609
 
10610
- var BREAK_MANDATORY = exports.BREAK_MANDATORY = '!';
10611
- var BREAK_NOT_ALLOWED = exports.BREAK_NOT_ALLOWED = '×';
10612
- var BREAK_ALLOWED = exports.BREAK_ALLOWED = '÷';
10613
- var UnicodeTrie = exports.UnicodeTrie = (0, _Trie.createTrieFromBase64)(_linebreakTrie2.default);
 
 
 
10614
 
10615
- var ALPHABETICS = [AL, HL];
10616
- var HARD_LINE_BREAKS = [BK, CR, LF, NL];
10617
- var SPACE = [SP, ZW];
10618
- var PREFIX_POSTFIX = [PR, PO];
10619
- var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE);
10620
- var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];
10621
- var HYPHEN = [HY, BA];
10622
 
10623
- var codePointsToCharacterClasses = exports.codePointsToCharacterClasses = function codePointsToCharacterClasses(codePoints) {
10624
- var lineBreak = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'strict';
 
 
 
 
 
 
 
 
 
 
10625
 
10626
- var types = [];
10627
- var indicies = [];
10628
- var categories = [];
10629
- codePoints.forEach(function (codePoint, index) {
10630
- var classType = UnicodeTrie.get(codePoint);
10631
- if (classType > LETTER_NUMBER_MODIFIER) {
10632
- categories.push(true);
10633
- classType -= LETTER_NUMBER_MODIFIER;
10634
- } else {
10635
- categories.push(false);
10636
- }
 
 
 
 
10637
 
10638
- if (['normal', 'auto', 'loose'].indexOf(lineBreak) !== -1) {
10639
- // U+2010, U+2013, 〜 U+301C, ゠ U+30A0
10640
- if ([0x2010, 0x2013, 0x301c, 0x30a0].indexOf(codePoint) !== -1) {
10641
- indicies.push(index);
10642
- return types.push(CB);
10643
- }
10644
- }
10645
 
10646
- if (classType === CM || classType === ZWJ) {
10647
- // LB10 Treat any remaining combining mark or ZWJ as AL.
10648
- if (index === 0) {
10649
- indicies.push(index);
10650
- return types.push(AL);
10651
- }
10652
 
10653
- // LB9 Do not break a combining character sequence; treat it as if it has the line breaking class of
10654
- // the base character in all of the following rules. Treat ZWJ as if it were CM.
10655
- var prev = types[index - 1];
10656
- if (LINE_BREAKS.indexOf(prev) === -1) {
10657
- indicies.push(indicies[index - 1]);
10658
- return types.push(prev);
10659
- }
10660
- indicies.push(index);
10661
- return types.push(AL);
10662
- }
10663
 
10664
- indicies.push(index);
 
 
 
 
 
 
 
 
10665
 
10666
- if (classType === CJ) {
10667
- return types.push(lineBreak === 'strict' ? NS : ID);
10668
  }
10669
 
10670
- if (classType === SA) {
10671
- return types.push(AL);
10672
- }
10673
-
10674
- if (classType === AI) {
10675
- return types.push(AL);
10676
- }
10677
-
10678
- // For supplementary characters, a useful default is to treat characters in the range 10000..1FFFD as AL
10679
- // and characters in the ranges 20000..2FFFD and 30000..3FFFD as ID, until the implementation can be revised
10680
- // to take into account the actual line breaking properties for these characters.
10681
- if (classType === XX) {
10682
- if (codePoint >= 0x20000 && codePoint <= 0x2fffd || codePoint >= 0x30000 && codePoint <= 0x3fffd) {
10683
- return types.push(ID);
10684
- } else {
10685
- return types.push(AL);
10686
- }
10687
- }
10688
-
10689
- types.push(classType);
10690
- });
10691
-
10692
- return [indicies, types, categories];
10693
- };
10694
-
10695
- var isAdjacentWithSpaceIgnored = function isAdjacentWithSpaceIgnored(a, b, currentIndex, classTypes) {
10696
- var current = classTypes[currentIndex];
10697
- if (Array.isArray(a) ? a.indexOf(current) !== -1 : a === current) {
10698
- var i = currentIndex;
10699
- while (i <= classTypes.length) {
10700
- i++;
10701
- var next = classTypes[i];
10702
-
10703
- if (next === b) {
10704
- return true;
10705
- }
10706
-
10707
- if (next !== SP) {
10708
- break;
10709
- }
10710
  }
10711
  }
10712
 
10713
- if (current === SP) {
10714
- var _i = currentIndex;
10715
-
10716
- while (_i > 0) {
10717
- _i--;
10718
- var prev = classTypes[_i];
10719
-
10720
- if (Array.isArray(a) ? a.indexOf(prev) !== -1 : a === prev) {
10721
- var n = currentIndex;
10722
- while (n <= classTypes.length) {
10723
- n++;
10724
- var _next = classTypes[n];
10725
 
10726
- if (_next === b) {
10727
- return true;
10728
- }
10729
 
10730
- if (_next !== SP) {
10731
- break;
10732
- }
10733
- }
10734
- }
10735
 
10736
- if (prev !== SP) {
10737
- break;
10738
- }
10739
- }
 
 
 
 
10740
  }
10741
- return false;
10742
  };
10743
 
10744
- var previousNonSpaceClassType = function previousNonSpaceClassType(currentIndex, classTypes) {
10745
- var i = currentIndex;
10746
- while (i >= 0) {
10747
- var type = classTypes[i];
10748
- if (type === SP) {
10749
- i--;
10750
- } else {
10751
- return type;
10752
- }
10753
  }
10754
- return 0;
 
 
 
10755
  };
10756
 
10757
- var _lineBreakAtIndex = function _lineBreakAtIndex(codePoints, classTypes, indicies, index, forbiddenBreaks) {
10758
- if (indicies[index] === 0) {
10759
- return BREAK_NOT_ALLOWED;
10760
- }
10761
 
10762
- var currentIndex = index - 1;
10763
- if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {
10764
- return BREAK_NOT_ALLOWED;
 
 
10765
  }
10766
 
10767
- var beforeIndex = currentIndex - 1;
10768
- var afterIndex = currentIndex + 1;
10769
- var current = classTypes[currentIndex];
10770
 
10771
- // LB4 Always break after hard line breaks.
10772
- // LB5 Treat CR followed by LF, as well as CR, LF, and NL as hard line breaks.
10773
- var before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;
10774
- var next = classTypes[afterIndex];
10775
 
10776
- if (current === CR && next === LF) {
10777
- return BREAK_NOT_ALLOWED;
10778
- }
10779
 
10780
- if (HARD_LINE_BREAKS.indexOf(current) !== -1) {
10781
- return BREAK_MANDATORY;
10782
- }
10783
 
10784
- // LB6 Do not break before hard line breaks.
10785
- if (HARD_LINE_BREAKS.indexOf(next) !== -1) {
10786
- return BREAK_NOT_ALLOWED;
10787
- }
10788
 
10789
- // LB7 Do not break before spaces or zero width space.
10790
- if (SPACE.indexOf(next) !== -1) {
10791
- return BREAK_NOT_ALLOWED;
10792
- }
10793
 
10794
- // LB8 Break before any character following a zero-width space, even if one or more spaces intervene.
10795
- if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {
10796
- return BREAK_ALLOWED;
10797
- }
10798
 
10799
- // LB8a Do not break between a zero width joiner and an ideograph, emoji base or emoji modifier.
10800
- if (UnicodeTrie.get(codePoints[currentIndex]) === ZWJ && (next === ID || next === EB || next === EM)) {
10801
- return BREAK_NOT_ALLOWED;
10802
- }
10803
 
10804
- // LB11 Do not break before or after Word joiner and related characters.
10805
- if (current === WJ || next === WJ) {
10806
- return BREAK_NOT_ALLOWED;
10807
- }
 
 
 
 
10808
 
10809
- // LB12 Do not break after NBSP and related characters.
10810
- if (current === GL) {
10811
- return BREAK_NOT_ALLOWED;
10812
- }
 
10813
 
10814
- // LB12a Do not break before NBSP and related characters, except after spaces and hyphens.
10815
- if ([SP, BA, HY].indexOf(current) === -1 && next === GL) {
10816
- return BREAK_NOT_ALLOWED;
10817
- }
10818
 
10819
- // LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces.
10820
- if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) {
10821
- return BREAK_NOT_ALLOWED;
10822
- }
10823
 
10824
- // LB14 Do not break after ‘[’, even after spaces.
10825
- if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {
10826
- return BREAK_NOT_ALLOWED;
10827
- }
10828
 
10829
- // LB15 Do not break within ‘”[’, even with intervening spaces.
10830
- if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {
10831
- return BREAK_NOT_ALLOWED;
10832
- }
10833
 
10834
- // LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with intervening spaces.
10835
- if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {
10836
- return BREAK_NOT_ALLOWED;
10837
- }
10838
 
10839
- // LB17 Do not break within ‘——’, even with intervening spaces.
10840
- if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {
10841
- return BREAK_NOT_ALLOWED;
10842
- }
10843
 
10844
- // LB18 Break after spaces.
10845
- if (current === SP) {
10846
- return BREAK_ALLOWED;
10847
- }
10848
 
10849
- // LB19 Do not break before or after quotation marks, such as ” ’.
10850
- if (current === QU || next === QU) {
10851
- return BREAK_NOT_ALLOWED;
10852
- }
 
 
10853
 
10854
- // LB20 Break before and after unresolved CB.
10855
- if (next === CB || current === CB) {
10856
- return BREAK_ALLOWED;
10857
- }
10858
 
10859
- // LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small kana, and other non-starters, or after acute accents.
10860
- if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) {
10861
- return BREAK_NOT_ALLOWED;
10862
- }
 
10863
 
10864
- // LB21a Don't break after Hebrew + Hyphen.
10865
- if (before === HL && HYPHEN.indexOf(current) !== -1) {
10866
- return BREAK_NOT_ALLOWED;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10867
  }
 
 
 
 
 
 
10868
 
10869
- // LB21b Don’t break between Solidus and Hebrew letters.
10870
- if (current === SY && next === HL) {
10871
- return BREAK_NOT_ALLOWED;
10872
- }
 
 
 
 
 
 
 
 
 
10873
 
10874
- // LB22 Do not break between two ellipses, or between letters, numbers or exclamations and ellipsis.
10875
- if (next === IN && ALPHABETICS.concat(IN, EX, NU, ID, EB, EM).indexOf(current) !== -1) {
10876
- return BREAK_NOT_ALLOWED;
10877
- }
10878
 
10879
- // LB23 Do not break between digits and letters.
10880
- if (ALPHABETICS.indexOf(next) !== -1 && current === NU || ALPHABETICS.indexOf(current) !== -1 && next === NU) {
10881
- return BREAK_NOT_ALLOWED;
10882
- }
 
 
 
 
 
 
 
10883
 
10884
- // LB23a Do not break between numeric prefixes and ideographs, or between ideographs and numeric postfixes.
10885
- if (current === PR && [ID, EB, EM].indexOf(next) !== -1 || [ID, EB, EM].indexOf(current) !== -1 && next === PO) {
10886
- return BREAK_NOT_ALLOWED;
10887
- }
10888
 
10889
- // LB24 Do not break between numeric prefix/postfix and letters, or between letters and prefix/postfix.
10890
- if (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1 || PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
10891
- return BREAK_NOT_ALLOWED;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10892
  }
 
 
10893
 
10894
- // LB25 Do not break between the following pairs of classes relevant to numbers:
10895
- if (
10896
- // (PR | PO) × ( OP | HY )? NU
10897
- [PR, PO].indexOf(current) !== -1 && (next === NU || [OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU) ||
10898
- // ( OP | HY ) × NU
10899
- [OP, HY].indexOf(current) !== -1 && next === NU ||
10900
- // NU × (NU | SY | IS)
10901
- current === NU && [NU, SY, IS].indexOf(next) !== -1) {
10902
- return BREAK_NOT_ALLOWED;
10903
- }
10904
 
10905
- // NU (NU | SY | IS)* × (NU | SY | IS | CL | CP)
10906
- if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) {
10907
- var prevIndex = currentIndex;
10908
- while (prevIndex >= 0) {
10909
- var type = classTypes[prevIndex];
10910
- if (type === NU) {
10911
- return BREAK_NOT_ALLOWED;
10912
- } else if ([SY, IS].indexOf(type) !== -1) {
10913
- prevIndex--;
10914
- } else {
10915
- break;
10916
- }
10917
- }
10918
- }
10919
 
10920
- // NU (NU | SY | IS)* (CL | CP)? × (PO | PR))
10921
- if ([PR, PO].indexOf(next) !== -1) {
10922
- var _prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;
10923
- while (_prevIndex >= 0) {
10924
- var _type = classTypes[_prevIndex];
10925
- if (_type === NU) {
10926
- return BREAK_NOT_ALLOWED;
10927
- } else if ([SY, IS].indexOf(_type) !== -1) {
10928
- _prevIndex--;
10929
- } else {
10930
- break;
10931
- }
10932
- }
10933
  }
10934
 
10935
- // LB26 Do not break a Korean syllable.
10936
- 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) {
10937
- return BREAK_NOT_ALLOWED;
10938
- }
10939
 
10940
- // LB27 Treat a Korean Syllable Block the same as ID.
10941
- if (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1 || KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR) {
10942
- return BREAK_NOT_ALLOWED;
10943
- }
 
 
 
 
10944
 
10945
- // LB28 Do not break between alphabetics (“at”).
10946
- if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
10947
- return BREAK_NOT_ALLOWED;
 
 
10948
  }
10949
 
10950
- // LB29 Do not break between numeric punctuation and alphabetics (“e.g.”).
10951
- if (current === IS && ALPHABETICS.indexOf(next) !== -1) {
10952
- return BREAK_NOT_ALLOWED;
10953
- }
10954
 
10955
- // LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses.
10956
- if (ALPHABETICS.concat(NU).indexOf(current) !== -1 && next === OP || ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP) {
10957
- return BREAK_NOT_ALLOWED;
10958
- }
 
 
10959
 
10960
- // LB30a Break between two regional indicator symbols if and only if there are an even number of regional
10961
- // indicators preceding the position of the break.
10962
- if (current === RI && next === RI) {
10963
- var i = indicies[currentIndex];
10964
- var count = 1;
10965
- while (i > 0) {
10966
- i--;
10967
- if (classTypes[i] === RI) {
10968
- count++;
10969
- } else {
10970
- break;
10971
- }
10972
- }
10973
- if (count % 2 !== 0) {
10974
- return BREAK_NOT_ALLOWED;
10975
- }
10976
  }
 
 
10977
 
10978
- // LB30b Do not break between an emoji base and an emoji modifier.
10979
- if (current === EB && next === EM) {
10980
- return BREAK_NOT_ALLOWED;
10981
- }
 
 
 
 
 
 
 
 
10982
 
10983
- return BREAK_ALLOWED;
10984
- };
 
 
 
10985
 
10986
- var lineBreakAtIndex = exports.lineBreakAtIndex = function lineBreakAtIndex(codePoints, index) {
10987
- // LB2 Never break at the start of text.
10988
- if (index === 0) {
10989
- return BREAK_NOT_ALLOWED;
10990
- }
10991
 
10992
- // LB3 Always break at the end of text.
10993
- if (index >= codePoints.length) {
10994
- return BREAK_MANDATORY;
 
 
 
 
 
10995
  }
10996
 
10997
- var _codePointsToCharacte = codePointsToCharacterClasses(codePoints),
10998
- _codePointsToCharacte2 = _slicedToArray(_codePointsToCharacte, 2),
10999
- indicies = _codePointsToCharacte2[0],
11000
- classTypes = _codePointsToCharacte2[1];
11001
-
11002
- return _lineBreakAtIndex(codePoints, classTypes, indicies, index);
11003
- };
11004
 
11005
- var cssFormattedClasses = function cssFormattedClasses(codePoints, options) {
11006
- if (!options) {
11007
- options = { lineBreak: 'normal', wordBreak: 'normal' };
11008
- }
11009
 
11010
- var _codePointsToCharacte3 = codePointsToCharacterClasses(codePoints, options.lineBreak),
11011
- _codePointsToCharacte4 = _slicedToArray(_codePointsToCharacte3, 3),
11012
- indicies = _codePointsToCharacte4[0],
11013
- classTypes = _codePointsToCharacte4[1],
11014
- isLetterNumber = _codePointsToCharacte4[2];
11015
 
11016
- if (options.wordBreak === 'break-all' || options.wordBreak === 'break-word') {
11017
- classTypes = classTypes.map(function (type) {
11018
- return [NU, AL, SA].indexOf(type) !== -1 ? ID : type;
11019
- });
 
 
 
 
 
11020
  }
11021
 
11022
- var forbiddenBreakpoints = options.wordBreak === 'keep-all' ? isLetterNumber.map(function (isLetterNumber, i) {
11023
- return isLetterNumber && codePoints[i] >= 0x4e00 && codePoints[i] <= 0x9fff;
11024
- }) : null;
11025
-
11026
- return [indicies, classTypes, forbiddenBreakpoints];
11027
- };
11028
 
11029
- var inlineBreakOpportunities = exports.inlineBreakOpportunities = function inlineBreakOpportunities(str, options) {
11030
- var codePoints = (0, _Util.toCodePoints)(str);
11031
- var output = BREAK_NOT_ALLOWED;
11032
 
11033
- var _cssFormattedClasses = cssFormattedClasses(codePoints, options),
11034
- _cssFormattedClasses2 = _slicedToArray(_cssFormattedClasses, 3),
11035
- indicies = _cssFormattedClasses2[0],
11036
- classTypes = _cssFormattedClasses2[1],
11037
- forbiddenBreakpoints = _cssFormattedClasses2[2];
 
 
 
 
 
 
 
 
 
 
 
 
 
11038
 
11039
- codePoints.forEach(function (codePoint, i) {
11040
- output += (0, _Util.fromCodePoint)(codePoint) + (i >= codePoints.length - 1 ? BREAK_MANDATORY : _lineBreakAtIndex(codePoints, classTypes, indicies, i + 1, forbiddenBreakpoints));
11041
- });
 
 
 
 
 
 
11042
 
11043
- return output;
11044
- };
 
 
 
 
 
 
 
 
11045
 
11046
- var Break = function () {
11047
- function Break(codePoints, lineBreak, start, end) {
11048
- _classCallCheck(this, Break);
 
 
 
11049
 
11050
- this._codePoints = codePoints;
11051
- this.required = lineBreak === BREAK_MANDATORY;
11052
- this.start = start;
11053
- this.end = end;
 
 
 
 
 
11054
  }
 
 
11055
 
11056
- _createClass(Break, [{
11057
- key: 'slice',
11058
- value: function slice() {
11059
- return _Util.fromCodePoint.apply(undefined, _toConsumableArray(this._codePoints.slice(this.start, this.end)));
11060
- }
11061
- }]);
11062
 
11063
- return Break;
11064
- }();
 
11065
 
11066
- var LineBreaker = exports.LineBreaker = function LineBreaker(str, options) {
11067
- var codePoints = (0, _Util.toCodePoints)(str);
 
11068
 
11069
- var _cssFormattedClasses3 = cssFormattedClasses(codePoints, options),
11070
- _cssFormattedClasses4 = _slicedToArray(_cssFormattedClasses3, 3),
11071
- indicies = _cssFormattedClasses4[0],
11072
- classTypes = _cssFormattedClasses4[1],
11073
- forbiddenBreakpoints = _cssFormattedClasses4[2];
 
 
 
 
 
 
11074
 
11075
- var length = codePoints.length;
11076
- var lastEnd = 0;
11077
- var nextIndex = 0;
 
 
 
 
 
 
 
 
 
 
11078
 
11079
- return {
11080
- next: function next() {
11081
- if (nextIndex >= length) {
11082
- return { done: true };
11083
- }
11084
- var lineBreak = BREAK_NOT_ALLOWED;
11085
- while (nextIndex < length && (lineBreak = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) === BREAK_NOT_ALLOWED) {}
11086
 
11087
- if (lineBreak !== BREAK_NOT_ALLOWED || nextIndex === length) {
11088
- var value = new Break(codePoints, lineBreak, lastEnd, nextIndex);
11089
- lastEnd = nextIndex;
11090
- return { value: value, done: false };
11091
- }
11092
 
11093
- return { done: true };
11094
- }
11095
- };
11096
- };
11097
 
11098
- /***/ }),
11099
- /* 48 */
11100
- /***/ (function(module, exports, __webpack_require__) {
 
11101
 
11102
- "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11103
 
 
 
11104
 
11105
- Object.defineProperty(exports, "__esModule", {
11106
- value: true
11107
- });
11108
- 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;
11109
 
11110
- 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; }; }();
 
11111
 
11112
- var _Util = __webpack_require__(13);
 
 
11113
 
11114
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
11115
 
11116
- /** Shift size for getting the index-2 table offset. */
11117
- var UTRIE2_SHIFT_2 = exports.UTRIE2_SHIFT_2 = 5;
 
11118
 
11119
- /** Shift size for getting the index-1 table offset. */
11120
- var UTRIE2_SHIFT_1 = exports.UTRIE2_SHIFT_1 = 6 + 5;
 
 
11121
 
11122
- /**
11123
- * Shift size for shifting left the index array values.
11124
- * Increases possible data size with 16-bit index values at the cost
11125
- * of compactability.
11126
- * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.
11127
- */
11128
- var UTRIE2_INDEX_SHIFT = exports.UTRIE2_INDEX_SHIFT = 2;
11129
-
11130
- /**
11131
- * Difference between the two shift sizes,
11132
- * for getting an index-1 offset from an index-2 offset. 6=11-5
11133
- */
11134
- var UTRIE2_SHIFT_1_2 = exports.UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;
11135
-
11136
- /**
11137
- * The part of the index-2 table for U+D800..U+DBFF stores values for
11138
- * lead surrogate code _units_ not code _points_.
11139
- * Values for lead surrogate code _points_ are indexed with this portion of the table.
11140
- * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)
11141
- */
11142
- var UTRIE2_LSCP_INDEX_2_OFFSET = exports.UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2;
11143
-
11144
- /** Number of entries in a data block. 32=0x20 */
11145
- var UTRIE2_DATA_BLOCK_LENGTH = exports.UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;
11146
- /** Mask for getting the lower bits for the in-data-block offset. */
11147
- var UTRIE2_DATA_MASK = exports.UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;
11148
-
11149
- var UTRIE2_LSCP_INDEX_2_LENGTH = exports.UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2;
11150
- /** Count the lengths of both BMP pieces. 2080=0x820 */
11151
- var UTRIE2_INDEX_2_BMP_LENGTH = exports.UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;
11152
- /**
11153
- * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.
11154
- * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.
11155
- */
11156
- var UTRIE2_UTF8_2B_INDEX_2_OFFSET = exports.UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;
11157
- 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 */
11158
- /**
11159
- * The index-1 table, only used for supplementary code points, at offset 2112=0x840.
11160
- * Variable length, for code points up to highStart, where the last single-value range starts.
11161
- * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.
11162
- * (For 0x100000 supplementary code points U+10000..U+10ffff.)
11163
- *
11164
- * The part of the index-2 table for supplementary code points starts
11165
- * after this index-1 table.
11166
- *
11167
- * Both the index-1 table and the following part of the index-2 table
11168
- * are omitted completely if there is only BMP data.
11169
- */
11170
- var UTRIE2_INDEX_1_OFFSET = exports.UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;
11171
-
11172
- /**
11173
- * Number of index-1 entries for the BMP. 32=0x20
11174
- * This part of the index-1 table is omitted from the serialized form.
11175
- */
11176
- var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = exports.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1;
11177
 
11178
- /** Number of entries in an index-2 block. 64=0x40 */
11179
- var UTRIE2_INDEX_2_BLOCK_LENGTH = exports.UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;
11180
- /** Mask for getting the lower bits for the in-index-2-block offset. */
11181
- var UTRIE2_INDEX_2_MASK = exports.UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;
11182
 
11183
- var createTrieFromBase64 = exports.createTrieFromBase64 = function createTrieFromBase64(base64) {
11184
- var buffer = (0, _Util.decode)(base64);
11185
- var view32 = Array.isArray(buffer) ? (0, _Util.polyUint32Array)(buffer) : new Uint32Array(buffer);
11186
- var view16 = Array.isArray(buffer) ? (0, _Util.polyUint16Array)(buffer) : new Uint16Array(buffer);
11187
- var headerLength = 24;
11188
 
11189
- var index = view16.slice(headerLength / 2, view32[4] / 2);
11190
- var data = view32[5] === 2 ? view16.slice((headerLength + view32[4]) / 2) : view32.slice(Math.ceil((headerLength + view32[4]) / 4));
 
 
 
11191
 
11192
- return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);
11193
- };
 
 
11194
 
11195
- var Trie = exports.Trie = function () {
11196
- function Trie(initialValue, errorValue, highStart, highValueIndex, index, data) {
11197
- _classCallCheck(this, Trie);
 
 
11198
 
11199
- this.initialValue = initialValue;
11200
- this.errorValue = errorValue;
11201
- this.highStart = highStart;
11202
- this.highValueIndex = highValueIndex;
11203
- this.index = index;
11204
- this.data = data;
11205
- }
 
11206
 
11207
- /**
11208
- * Get the value for a code point as stored in the Trie.
11209
- *
11210
- * @param codePoint the code point
11211
- * @return the value
11212
- */
11213
 
 
 
11214
 
11215
- _createClass(Trie, [{
11216
- key: 'get',
11217
- value: function get(codePoint) {
11218
- var ix = void 0;
11219
- if (codePoint >= 0) {
11220
- if (codePoint < 0x0d800 || codePoint > 0x0dbff && codePoint <= 0x0ffff) {
11221
- // Ordinary BMP code point, excluding leading surrogates.
11222
- // BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.
11223
- // 16 bit data is stored in the index array itself.
11224
- ix = this.index[codePoint >> UTRIE2_SHIFT_2];
11225
- ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
11226
- return this.data[ix];
11227
- }
11228
 
11229
- if (codePoint <= 0xffff) {
11230
- // Lead Surrogate Code Point. A Separate index section is stored for
11231
- // lead surrogate code units and code points.
11232
- // The main index has the code unit data.
11233
- // For this function, we need the code point data.
11234
- // Note: this expression could be refactored for slightly improved efficiency, but
11235
- // surrogate code points will be so rare in practice that it's not worth it.
11236
- ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + (codePoint - 0xd800 >> UTRIE2_SHIFT_2)];
11237
- ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
11238
- return this.data[ix];
11239
- }
11240
 
11241
- if (codePoint < this.highStart) {
11242
- // Supplemental code point, use two-level lookup.
11243
- ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);
11244
- ix = this.index[ix];
11245
- ix += codePoint >> UTRIE2_SHIFT_2 & UTRIE2_INDEX_2_MASK;
11246
- ix = this.index[ix];
11247
- ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
11248
- return this.data[ix];
11249
- }
11250
- if (codePoint <= 0x10ffff) {
11251
- return this.data[this.highValueIndex];
11252
- }
11253
- }
11254
 
11255
- // Fall through. The code point is outside of the legal range of 0..0x10ffff.
11256
- return this.errorValue;
 
 
 
 
 
 
11257
  }
11258
- }]);
 
11259
 
11260
- return Trie;
11261
- }();
11262
 
11263
- /***/ }),
11264
- /* 49 */
11265
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
11266
 
11267
- "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
11268
 
 
 
 
 
 
11269
 
11270
- module.exports = 'KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5wPsA/QD/AOAAIAABAQMBBIEgAAWBB4EJgQuBDMEIAM7BEEEXgBJBCADUQRZBGEEaQQwADAAcQQ+AXkEgQSJBJEEgACYBIAAoASoBK8EtwQwAL8ExQSAAIAAgACAAIAAgACgAM0EXgBeAF4AXgBeAF4AXgBeANUEXgDZBOEEXgDpBPEE+QQBBQkFEQUZBSEFKQUxBTUFPQVFBUwFVAVcBV4AYwVeAGsFcwV7BYMFiwWSBV4AmgWgBacFXgBeAF4AXgBeAKsFXgCyBbEFugW7BcIFwgXIBcIFwgXQBdQF3AXkBesF8wX7BQMGCwYTBhsGIwYrBjMGOwZeAD8GRwZNBl4AVAZbBl4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAGMGXgBqBnEGXgBeAF4AXgBeAF4AXgBeAF4AXgB5BoAG4wSGBo4GkwaAAIADHgR5AF4AXgBeAJsGgABGA4AAowarBrMGswagALsGwwbLBjAA0wbaBtoG3QbaBtoG2gbaBtoG2gblBusG8wb7BgMHCwcTBxsHCwcjBysHMAc1BzUHOgdCB9oGSgdSB1oHYAfaBloHaAfaBlIH2gbaBtoG2gbaBtoG2gbaBjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHbQdeAF4ANQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQd1B30HNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B4MH2gaKB68EgACAAIAAgACAAIAAgACAAI8HlwdeAJ8HpweAAIAArwe3B14AXgC/B8UHygcwANAH2AfgB4AA6AfwBz4B+AcACFwBCAgPCBcIogEYAR8IJwiAAC8INwg/CCADRwhPCFcIXwhnCEoDGgSAAIAAgABvCHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIhAiLCI4IMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANQc1BzUHNQc1BzUHNQc1BzUHNQc1B54INQc1B6II2gaqCLIIugiAAIAAvgjGCIAAgACAAIAAgACAAIAAgACAAIAAywiHAYAA0wiAANkI3QjlCO0I9Aj8CIAAgACAAAIJCgkSCRoJIgknCTYHLwk3CZYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACJCR4E6AswADAAhwHwC4AA+AsADAgMEAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMACAAIAAGAwdDCUMMAAwAC0MNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQw1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHPQwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADUHNQc1BzUHNQc1BzUHNQc2BzAAMAA5DDUHNQc1BzUHNQc1BzUHNQc1BzUHNQdFDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAATQxSDFoMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAF4AXgBeAF4AXgBeAF4AYgxeAGoMXgBxDHkMfwxeAIUMXgBeAI0MMAAwADAAMAAwAF4AXgCVDJ0MMAAwADAAMABeAF4ApQxeAKsMswy7DF4Awgy9DMoMXgBeAF4AXgBeAF4AXgBeAF4AXgDRDNkMeQBqCeAM3Ax8AOYM7Az0DPgMXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgCgAAANoAAHDQ4NFg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAeDSYNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAC4NMABeAF4ANg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAD4NRg1ODVYNXg1mDTAAbQ0wADAAMAAwADAAMAAwADAA2gbaBtoG2gbaBtoG2gbaBnUNeg3CBYANwgWFDdoGjA3aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gaUDZwNpA2oDdoG2gawDbcNvw3HDdoG2gbPDdYN3A3fDeYN2gbsDfMN2gbaBvoN/g3aBgYODg7aBl4AXgBeABYOXgBeACUG2gYeDl4AJA5eACwO2w3aBtoGMQ45DtoG2gbaBtoGQQ7aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B1EO2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQdZDjUHNQc1BzUHNQc1B2EONQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHaA41BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B3AO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B2EO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBkkOeA6gAKAAoAAwADAAMAAwAKAAoACgAKAAoACgAKAAgA4wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAD//wQABAAEAAQABAAEAAQABAAEAA0AAwABAAEAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAKABMAFwAeABsAGgAeABcAFgASAB4AGwAYAA8AGAAcAEsASwBLAEsASwBLAEsASwBLAEsAGAAYAB4AHgAeABMAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAFgAbABIAHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYADQARAB4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkAFgAaABsAGwAbAB4AHQAdAB4ATwAXAB4ADQAeAB4AGgAbAE8ATwAOAFAAHQAdAB0ATwBPABcATwBPAE8AFgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAABABQAFAAUABQAAQABAAEAFAAUAAEAAQABAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAKwBQACsAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAKwArAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAKwAeAB4AHgAeAB4AHgAeAA4AHgArAA0ADQANAA0ADQANAA0ACQANAA0ADQAIAAQACwAEAAQADQAJAA0ADQAMAB0AHQAeABcAFwAWABcAFwAXABYAFwAdAB0AHgAeABQAFAAUAA0AAQABAAQABAAEAAQABAAJABoAGgAaABoAGgAaABoAGgAeABcAFwAdABUAFQAeAB4AHgAeAB4AHgAYABYAEQAVABUAFQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgANAB4ADQANAA0ADQAeAA0ADQANAAcAHgAeAB4AHgArAAQABAAEAAQABAAEAAQABAAEAAQAUABQACsAKwBPAFAAUABQAFAAUAAeAB4AHgAWABEATwBQAE8ATwBPAE8AUABQAFAAUABQAB4AHgAeABYAEQArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGgAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgBQABoAHgAdAB4AUAAeABoAHgAeAB4AHgAeAB4AHgAeAB4ATwAeAFAAGwAeAB4AUABQAFAAUABQAB4AHgAeAB0AHQAeAFAAHgBQAB4AUAAeAFAATwBQAFAAHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AUABQAFAAUABPAE8AUABQAFAAUABQAE8AUABQAE8AUABPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAE8ATwBPAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAATwAeAB4AKwArACsAKwAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB0AHQAeAB4AHgAdAB0AHgAeAB0AHgAeAB4AHQAeAB0AGwAbAB4AHQAeAB4AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB0AHgAdAB4AHQAdAB0AHQAdAB0AHgAdAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAdAB0AHQAdAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAlACUAHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB0AHQAeAB4AHgAeAB0AHQAdAB4AHgAdAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB0AHQAeAB4AHQAeAB4AHgAeAB0AHQAeAB4AHgAeACUAJQAdAB0AJQAeACUAJQAlACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHQAdAB0AHgAdACUAHQAdAB4AHQAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHQAdAB0AHQAlAB4AJQAlACUAHQAlACUAHQAdAB0AJQAlAB0AHQAlAB0AHQAlACUAJQAeAB0AHgAeAB4AHgAdAB0AJQAdAB0AHQAdAB0AHQAlACUAJQAlACUAHQAlACUAIAAlAB0AHQAlACUAJQAlACUAJQAlACUAHgAeAB4AJQAlACAAIAAgACAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeABcAFwAXABcAFwAXAB4AEwATACUAHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACUAJQBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwArACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAE8ATwBPAE8ATwBPAE8ATwAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFwAXABcAFQAVABUAHgAeAB4AHgAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAlACAAIAAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA';
 
 
 
 
 
11271
 
11272
- /***/ }),
11273
- /* 50 */
11274
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
11275
 
11276
- "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11277
 
 
 
 
 
 
 
11278
 
11279
- Object.defineProperty(exports, "__esModule", {
11280
- value: true
11281
- });
11282
-
11283
- var _Path = __webpack_require__(6);
11284
-
11285
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11286
-
11287
- var Circle = function Circle(x, y, radius) {
11288
- _classCallCheck(this, Circle);
11289
 
11290
- this.type = _Path.PATH.CIRCLE;
11291
- this.x = x;
11292
- this.y = y;
11293
- this.radius = radius;
11294
- if (true) {
11295
- if (isNaN(x)) {
11296
- console.error('Invalid x value given for Circle');
11297
- }
11298
- if (isNaN(y)) {
11299
- console.error('Invalid y value given for Circle');
11300
- }
11301
- if (isNaN(radius)) {
11302
- console.error('Invalid radius value given for Circle');
11303
- }
11304
- }
11305
- };
11306
 
11307
- exports.default = Circle;
 
 
 
 
 
 
 
 
 
 
 
11308
 
11309
- /***/ }),
11310
- /* 51 */
11311
- /***/ (function(module, exports, __webpack_require__) {
11312
 
11313
- "use strict";
 
 
 
 
 
 
 
11314
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11315
 
11316
- Object.defineProperty(exports, "__esModule", {
11317
- value: true
11318
- });
11319
 
11320
- 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"); } }; }();
 
 
11321
 
11322
- 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; }; }();
 
11323
 
11324
- var _Bounds = __webpack_require__(2);
 
11325
 
11326
- var _Font = __webpack_require__(25);
 
 
 
 
 
 
 
11327
 
11328
- var _Gradient = __webpack_require__(52);
 
 
 
11329
 
11330
- var _TextContainer = __webpack_require__(9);
 
 
 
 
11331
 
11332
- var _TextContainer2 = _interopRequireDefault(_TextContainer);
 
 
 
 
 
 
 
 
 
11333
 
11334
- var _background = __webpack_require__(5);
 
 
 
 
 
 
 
 
 
 
 
11335
 
11336
- var _border = __webpack_require__(12);
 
 
 
 
11337
 
11338
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
11339
 
11340
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
11341
 
11342
- var Renderer = function () {
11343
- function Renderer(target, options) {
11344
- _classCallCheck(this, Renderer);
 
11345
 
11346
- this.target = target;
11347
- this.options = options;
11348
- target.render(options);
 
 
 
 
 
 
11349
  }
11350
 
11351
- _createClass(Renderer, [{
11352
- key: 'renderNode',
11353
- value: function renderNode(container) {
11354
- if (container.isVisible()) {
11355
- this.renderNodeBackgroundAndBorders(container);
11356
- this.renderNodeContent(container);
11357
- }
11358
- }
11359
- }, {
11360
- key: 'renderNodeContent',
11361
- value: function renderNodeContent(container) {
11362
- var _this = this;
11363
-
11364
- var callback = function callback() {
11365
- if (container.childNodes.length) {
11366
- container.childNodes.forEach(function (child) {
11367
- if (child instanceof _TextContainer2.default) {
11368
- var style = child.parent.style;
11369
- _this.target.renderTextNode(child.bounds, style.color, style.font, style.textDecoration, style.textShadow);
11370
- } else {
11371
- _this.target.drawShape(child, container.style.color);
11372
- }
11373
- });
11374
- }
11375
 
11376
- if (container.image) {
11377
- var _image = _this.options.imageStore.get(container.image);
11378
- if (_image) {
11379
- var contentBox = (0, _Bounds.calculateContentBox)(container.bounds, container.style.padding, container.style.border);
11380
- var _width = typeof _image.width === 'number' && _image.width > 0 ? _image.width : contentBox.width;
11381
- var _height = typeof _image.height === 'number' && _image.height > 0 ? _image.height : contentBox.height;
11382
- if (_width > 0 && _height > 0) {
11383
- _this.target.clip([(0, _Bounds.calculatePaddingBoxPath)(container.curvedBounds)], function () {
11384
- _this.target.drawImage(_image, new _Bounds.Bounds(0, 0, _width, _height), contentBox);
11385
- });
11386
- }
11387
- }
11388
- }
11389
- };
11390
- var paths = container.getClipPaths();
11391
- if (paths.length) {
11392
- this.target.clip(paths, callback);
11393
- } else {
11394
- callback();
11395
- }
11396
- }
11397
- }, {
11398
- key: 'renderNodeBackgroundAndBorders',
11399
- value: function renderNodeBackgroundAndBorders(container) {
11400
- var _this2 = this;
11401
 
11402
- var HAS_BACKGROUND = !container.style.background.backgroundColor.isTransparent() || container.style.background.backgroundImage.length;
 
11403
 
11404
- var hasRenderableBorders = container.style.border.some(function (border) {
11405
- return border.borderStyle !== _border.BORDER_STYLE.NONE && !border.borderColor.isTransparent();
11406
- });
11407
 
11408
- var callback = function callback() {
11409
- var backgroundPaintingArea = (0, _background.calculateBackgroungPaintingArea)(container.curvedBounds, container.style.background.backgroundClip);
 
 
 
 
11410
 
11411
- if (HAS_BACKGROUND) {
11412
- _this2.target.clip([backgroundPaintingArea], function () {
11413
- if (!container.style.background.backgroundColor.isTransparent()) {
11414
- _this2.target.fill(container.style.background.backgroundColor);
11415
- }
 
 
 
 
 
 
11416
 
11417
- _this2.renderBackgroundImage(container);
11418
- });
11419
- }
11420
 
11421
- container.style.border.forEach(function (border, side) {
11422
- if (border.borderStyle !== _border.BORDER_STYLE.NONE && !border.borderColor.isTransparent()) {
11423
- _this2.renderBorder(border, side, container.curvedBounds);
11424
- }
11425
- });
11426
- };
 
 
 
 
11427
 
11428
- if (HAS_BACKGROUND || hasRenderableBorders) {
11429
- var paths = container.parent ? container.parent.getClipPaths() : [];
11430
- if (paths.length) {
11431
- this.target.clip(paths, callback);
11432
- } else {
11433
- callback();
11434
- }
11435
- }
11436
- }
11437
- }, {
11438
- key: 'renderBackgroundImage',
11439
- value: function renderBackgroundImage(container) {
11440
- var _this3 = this;
11441
 
11442
- container.style.background.backgroundImage.slice(0).reverse().forEach(function (backgroundImage) {
11443
- if (backgroundImage.source.method === 'url' && backgroundImage.source.args.length) {
11444
- _this3.renderBackgroundRepeat(container, backgroundImage);
11445
- } else if (/gradient/i.test(backgroundImage.source.method)) {
11446
- _this3.renderBackgroundGradient(container, backgroundImage);
11447
- }
11448
- });
11449
- }
11450
- }, {
11451
- key: 'renderBackgroundRepeat',
11452
- value: function renderBackgroundRepeat(container, background) {
11453
- var image = this.options.imageStore.get(background.source.args[0]);
11454
- if (image) {
11455
- var backgroundPositioningArea = (0, _background.calculateBackgroungPositioningArea)(container.style.background.backgroundOrigin, container.bounds, container.style.padding, container.style.border);
11456
- var backgroundImageSize = (0, _background.calculateBackgroundSize)(background, image, backgroundPositioningArea);
11457
- var position = (0, _background.calculateBackgroundPosition)(background.position, backgroundImageSize, backgroundPositioningArea);
11458
- var _path = (0, _background.calculateBackgroundRepeatPath)(background, position, backgroundImageSize, backgroundPositioningArea, container.bounds);
11459
 
11460
- var _offsetX = Math.round(backgroundPositioningArea.left + position.x);
11461
- var _offsetY = Math.round(backgroundPositioningArea.top + position.y);
11462
- this.target.renderRepeat(_path, image, backgroundImageSize, _offsetX, _offsetY);
11463
- }
11464
- }
11465
- }, {
11466
- key: 'renderBackgroundGradient',
11467
- value: function renderBackgroundGradient(container, background) {
11468
- var backgroundPositioningArea = (0, _background.calculateBackgroungPositioningArea)(container.style.background.backgroundOrigin, container.bounds, container.style.padding, container.style.border);
11469
- var backgroundImageSize = (0, _background.calculateGradientBackgroundSize)(background, backgroundPositioningArea);
11470
- var position = (0, _background.calculateBackgroundPosition)(background.position, backgroundImageSize, backgroundPositioningArea);
11471
- var gradientBounds = new _Bounds.Bounds(Math.round(backgroundPositioningArea.left + position.x), Math.round(backgroundPositioningArea.top + position.y), backgroundImageSize.width, backgroundImageSize.height);
11472
 
11473
- var gradient = (0, _Gradient.parseGradient)(container, background.source, gradientBounds);
11474
- if (gradient) {
11475
- switch (gradient.type) {
11476
- case _Gradient.GRADIENT_TYPE.LINEAR_GRADIENT:
11477
- // $FlowFixMe
11478
- this.target.renderLinearGradient(gradientBounds, gradient);
11479
- break;
11480
- case _Gradient.GRADIENT_TYPE.RADIAL_GRADIENT:
11481
- // $FlowFixMe
11482
- this.target.renderRadialGradient(gradientBounds, gradient);
11483
- break;
11484
- }
11485
- }
11486
- }
11487
- }, {
11488
- key: 'renderBorder',
11489
- value: function renderBorder(border, side, curvePoints) {
11490
- this.target.drawShape((0, _Bounds.parsePathForBorder)(curvePoints, side), border.borderColor);
11491
- }
11492
- }, {
11493
- key: 'renderStack',
11494
- value: function renderStack(stack) {
11495
- var _this4 = this;
11496
 
11497
- if (stack.container.isVisible()) {
11498
- var _opacity = stack.getOpacity();
11499
- if (_opacity !== this._opacity) {
11500
- this.target.setOpacity(stack.getOpacity());
11501
- this._opacity = _opacity;
11502
- }
11503
 
11504
- var _transform = stack.container.style.transform;
11505
- if (_transform !== null) {
11506
- this.target.transform(stack.container.bounds.left + _transform.transformOrigin[0].value, stack.container.bounds.top + _transform.transformOrigin[1].value, _transform.transform, function () {
11507
- return _this4.renderStackContent(stack);
11508
- });
11509
- } else {
11510
- this.renderStackContent(stack);
11511
- }
11512
- }
11513
- }
11514
- }, {
11515
- key: 'renderStackContent',
11516
- value: function renderStackContent(stack) {
11517
- var _splitStackingContext = splitStackingContexts(stack),
11518
- _splitStackingContext2 = _slicedToArray(_splitStackingContext, 5),
11519
- negativeZIndex = _splitStackingContext2[0],
11520
- zeroOrAutoZIndexOrTransformedOrOpacity = _splitStackingContext2[1],
11521
- positiveZIndex = _splitStackingContext2[2],
11522
- nonPositionedFloats = _splitStackingContext2[3],
11523
- nonPositionedInlineLevel = _splitStackingContext2[4];
11524
 
11525
- var _splitDescendants = splitDescendants(stack),
11526
- _splitDescendants2 = _slicedToArray(_splitDescendants, 2),
11527
- inlineLevel = _splitDescendants2[0],
11528
- nonInlineLevel = _splitDescendants2[1];
 
 
 
 
 
 
 
 
11529
 
11530
- // https://www.w3.org/TR/css-position-3/#painting-order
11531
- // 1. the background and borders of the element forming the stacking context.
 
 
 
 
11532
 
 
 
 
 
11533
 
11534
- this.renderNodeBackgroundAndBorders(stack.container);
11535
- // 2. the child stacking contexts with negative stack levels (most negative first).
11536
- negativeZIndex.sort(sortByZIndex).forEach(this.renderStack, this);
11537
- // 3. For all its in-flow, non-positioned, block-level descendants in tree order:
11538
- this.renderNodeContent(stack.container);
11539
- nonInlineLevel.forEach(this.renderNode, this);
11540
- // 4. All non-positioned floating descendants, in tree order. For each one of these,
11541
- // treat the element as if it created a new stacking context, but any positioned descendants and descendants
11542
- // which actually create a new stacking context should be considered part of the parent stacking context,
11543
- // not this new one.
11544
- nonPositionedFloats.forEach(this.renderStack, this);
11545
- // 5. the in-flow, inline-level, non-positioned descendants, including inline tables and inline blocks.
11546
- nonPositionedInlineLevel.forEach(this.renderStack, this);
11547
- inlineLevel.forEach(this.renderNode, this);
11548
- // 6. All positioned, opacity or transform descendants, in tree order that fall into the following categories:
11549
- // All positioned descendants with 'z-index: auto' or 'z-index: 0', in tree order.
11550
- // For those with 'z-index: auto', treat the element as if it created a new stacking context,
11551
- // but any positioned descendants and descendants which actually create a new stacking context should be
11552
- // considered part of the parent stacking context, not this new one. For those with 'z-index: 0',
11553
- // treat the stacking context generated atomically.
11554
- //
11555
- // All opacity descendants with opacity less than 1
11556
- //
11557
- // All transform descendants with transform other than none
11558
- zeroOrAutoZIndexOrTransformedOrOpacity.forEach(this.renderStack, this);
11559
- // 7. Stacking contexts formed by positioned descendants with z-indices greater than or equal to 1 in z-index
11560
- // order (smallest first) then tree order.
11561
- positiveZIndex.sort(sortByZIndex).forEach(this.renderStack, this);
11562
- }
11563
- }, {
11564
- key: 'render',
11565
- value: function render(stack) {
11566
- var _this5 = this;
11567
 
11568
- if (this.options.backgroundColor) {
11569
- this.target.rectangle(this.options.x, this.options.y, this.options.width, this.options.height, this.options.backgroundColor);
11570
- }
11571
- this.renderStack(stack);
11572
- var target = this.target.getTarget();
11573
- if (true) {
11574
- return target.then(function (output) {
11575
- _this5.options.logger.log('Render completed');
11576
- return output;
11577
- });
11578
- }
11579
- return target;
11580
- }
11581
- }]);
11582
 
11583
- return Renderer;
11584
- }();
 
 
 
11585
 
11586
- exports.default = Renderer;
 
 
11587
 
 
 
 
11588
 
11589
- var splitDescendants = function splitDescendants(stack) {
11590
- var inlineLevel = [];
11591
- var nonInlineLevel = [];
 
 
11592
 
11593
- var length = stack.children.length;
11594
- for (var i = 0; i < length; i++) {
11595
- var child = stack.children[i];
11596
- if (child.isInlineLevel()) {
11597
- inlineLevel.push(child);
11598
- } else {
11599
- nonInlineLevel.push(child);
11600
- }
11601
- }
11602
- return [inlineLevel, nonInlineLevel];
11603
- };
 
 
 
 
 
11604
 
11605
- var splitStackingContexts = function splitStackingContexts(stack) {
11606
- var negativeZIndex = [];
11607
- var zeroOrAutoZIndexOrTransformedOrOpacity = [];
11608
- var positiveZIndex = [];
11609
- var nonPositionedFloats = [];
11610
- var nonPositionedInlineLevel = [];
11611
- var length = stack.contexts.length;
11612
- for (var i = 0; i < length; i++) {
11613
- var child = stack.contexts[i];
11614
- if (child.container.isPositioned() || child.container.style.opacity < 1 || child.container.isTransformed()) {
11615
- if (child.container.style.zIndex.order < 0) {
11616
- negativeZIndex.push(child);
11617
- } else if (child.container.style.zIndex.order > 0) {
11618
- positiveZIndex.push(child);
11619
- } else {
11620
- zeroOrAutoZIndexOrTransformedOrOpacity.push(child);
11621
- }
11622
- } else {
11623
- if (child.container.isFloating()) {
11624
- nonPositionedFloats.push(child);
11625
- } else {
11626
- nonPositionedInlineLevel.push(child);
11627
- }
11628
  }
11629
- }
11630
- return [negativeZIndex, zeroOrAutoZIndexOrTransformedOrOpacity, positiveZIndex, nonPositionedFloats, nonPositionedInlineLevel];
11631
- };
11632
-
11633
- var sortByZIndex = function sortByZIndex(a, b) {
11634
- if (a.container.style.zIndex.order > b.container.style.zIndex.order) {
11635
- return 1;
11636
- } else if (a.container.style.zIndex.order < b.container.style.zIndex.order) {
11637
- return -1;
11638
- }
11639
 
11640
- return a.container.index > b.container.index ? 1 : -1;
11641
- };
 
 
 
 
 
 
11642
 
11643
- /***/ }),
11644
- /* 52 */
11645
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
11646
 
11647
- "use strict";
 
11648
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11649
 
11650
- Object.defineProperty(exports, "__esModule", {
11651
- value: true
11652
- });
11653
- exports.transformWebkitRadialGradientArgs = exports.parseGradient = exports.RadialGradient = exports.LinearGradient = exports.RADIAL_GRADIENT_SHAPE = exports.GRADIENT_TYPE = undefined;
11654
 
11655
- 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"); } }; }();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11656
 
11657
- var _NodeContainer = __webpack_require__(3);
 
 
 
11658
 
11659
- var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
 
 
 
 
11660
 
11661
- var _Angle = __webpack_require__(53);
 
 
 
11662
 
11663
- var _Color = __webpack_require__(0);
 
 
 
 
11664
 
11665
- var _Color2 = _interopRequireDefault(_Color);
 
 
 
11666
 
11667
- var _Length = __webpack_require__(1);
 
 
 
 
 
 
 
11668
 
11669
- var _Length2 = _interopRequireDefault(_Length);
 
 
 
11670
 
11671
- var _Util = __webpack_require__(4);
 
 
 
 
11672
 
11673
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
11674
 
11675
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
11676
 
11677
- var SIDE_OR_CORNER = /^(to )?(left|top|right|bottom)( (left|top|right|bottom))?$/i;
11678
- var PERCENTAGE_ANGLES = /^([+-]?\d*\.?\d+)% ([+-]?\d*\.?\d+)%$/i;
11679
- var ENDS_WITH_LENGTH = /(px)|%|( 0)$/i;
11680
- var FROM_TO_COLORSTOP = /^(from|to|color-stop)\((?:([\d.]+)(%)?,\s*)?(.+?)\)$/i;
11681
- 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;
 
 
11682
 
11683
- var GRADIENT_TYPE = exports.GRADIENT_TYPE = {
11684
- LINEAR_GRADIENT: 0,
11685
- RADIAL_GRADIENT: 1
11686
- };
11687
 
11688
- var RADIAL_GRADIENT_SHAPE = exports.RADIAL_GRADIENT_SHAPE = {
11689
- CIRCLE: 0,
11690
- ELLIPSE: 1
11691
- };
 
 
 
 
 
11692
 
11693
- var LENGTH_FOR_POSITION = {
11694
- left: new _Length2.default('0%'),
11695
- top: new _Length2.default('0%'),
11696
- center: new _Length2.default('50%'),
11697
- right: new _Length2.default('100%'),
11698
- bottom: new _Length2.default('100%')
11699
- };
11700
 
11701
- var LinearGradient = exports.LinearGradient = function LinearGradient(colorStops, direction) {
11702
- _classCallCheck(this, LinearGradient);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11703
 
11704
- this.type = GRADIENT_TYPE.LINEAR_GRADIENT;
11705
- this.colorStops = colorStops;
11706
- this.direction = direction;
11707
- };
11708
-
11709
- var RadialGradient = exports.RadialGradient = function RadialGradient(colorStops, shape, center, radius) {
11710
- _classCallCheck(this, RadialGradient);
 
 
 
 
 
 
 
 
 
 
 
11711
 
11712
- this.type = GRADIENT_TYPE.RADIAL_GRADIENT;
11713
- this.colorStops = colorStops;
11714
- this.shape = shape;
11715
- this.center = center;
11716
- this.radius = radius;
11717
- };
11718
 
11719
- var parseGradient = exports.parseGradient = function parseGradient(container, _ref, bounds) {
11720
- var args = _ref.args,
11721
- method = _ref.method,
11722
- prefix = _ref.prefix;
 
 
 
11723
 
11724
- if (method === 'linear-gradient') {
11725
- return parseLinearGradient(args, bounds, !!prefix);
11726
- } else if (method === 'gradient' && args[0] === 'linear') {
11727
- // TODO handle correct angle
11728
- return parseLinearGradient(['to bottom'].concat(transformObsoleteColorStops(args.slice(3))), bounds, !!prefix);
11729
- } else if (method === 'radial-gradient') {
11730
- return parseRadialGradient(container, prefix === '-webkit-' ? transformWebkitRadialGradientArgs(args) : args, bounds);
11731
- } else if (method === 'gradient' && args[0] === 'radial') {
11732
- return parseRadialGradient(container, transformObsoleteColorStops(transformWebkitRadialGradientArgs(args.slice(1))), bounds);
11733
- }
11734
- };
11735
 
11736
- var parseColorStops = function parseColorStops(args, firstColorStopIndex, lineLength) {
11737
- var colorStops = [];
 
 
 
 
 
11738
 
11739
- for (var i = firstColorStopIndex; i < args.length; i++) {
11740
- var value = args[i];
11741
- var HAS_LENGTH = ENDS_WITH_LENGTH.test(value);
11742
- var lastSpaceIndex = value.lastIndexOf(' ');
11743
- var _color = new _Color2.default(HAS_LENGTH ? value.substring(0, lastSpaceIndex) : value);
11744
- 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;
11745
- colorStops.push({ color: _color, stop: _stop });
11746
- }
 
 
 
 
 
 
11747
 
11748
- var absoluteValuedColorStops = colorStops.map(function (_ref2) {
11749
- var color = _ref2.color,
11750
- stop = _ref2.stop;
 
 
 
11751
 
11752
- var absoluteStop = lineLength === 0 ? 0 : stop ? stop.getAbsoluteValue(lineLength) / lineLength : null;
 
 
11753
 
11754
- return {
11755
- color: color,
11756
- // $FlowFixMe
11757
- stop: absoluteStop
11758
- };
11759
- });
11760
 
11761
- var previousColorStop = absoluteValuedColorStops[0].stop;
11762
- for (var _i = 0; _i < absoluteValuedColorStops.length; _i++) {
11763
- if (previousColorStop !== null) {
11764
- var _stop2 = absoluteValuedColorStops[_i].stop;
11765
- if (_stop2 === null) {
11766
- var n = _i;
11767
- while (absoluteValuedColorStops[n].stop === null) {
11768
- n++;
11769
- }
11770
- var steps = n - _i + 1;
11771
- var nextColorStep = absoluteValuedColorStops[n].stop;
11772
- var stepSize = (nextColorStep - previousColorStop) / steps;
11773
- for (; _i < n; _i++) {
11774
- previousColorStop = absoluteValuedColorStops[_i].stop = previousColorStop + stepSize;
11775
- }
11776
- } else {
11777
- previousColorStop = _stop2;
11778
- }
11779
  }
11780
- }
11781
-
11782
- return absoluteValuedColorStops;
11783
- };
11784
 
11785
- var parseLinearGradient = function parseLinearGradient(args, bounds, hasPrefix) {
11786
- var angle = (0, _Angle.parseAngle)(args[0]);
11787
- var HAS_SIDE_OR_CORNER = SIDE_OR_CORNER.test(args[0]);
11788
- var HAS_DIRECTION = HAS_SIDE_OR_CORNER || angle !== null || PERCENTAGE_ANGLES.test(args[0]);
11789
- var direction = HAS_DIRECTION ? angle !== null ? calculateGradientDirection(
11790
- // if there is a prefix, the 0° angle points due East (instead of North per W3C)
11791
- hasPrefix ? angle - Math.PI * 0.5 : angle, bounds) : HAS_SIDE_OR_CORNER ? parseSideOrCorner(args[0], bounds) : parsePercentageAngle(args[0], bounds) : calculateGradientDirection(Math.PI, bounds);
11792
- var firstColorStopIndex = HAS_DIRECTION ? 1 : 0;
11793
 
11794
- // TODO: Fix some inaccuracy with color stops with px values
11795
- 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);
 
 
 
11796
 
11797
- return new LinearGradient(parseColorStops(args, firstColorStopIndex, lineLength), direction);
11798
- };
 
 
 
 
 
11799
 
11800
- var parseRadialGradient = function parseRadialGradient(container, args, bounds) {
11801
- var m = args[0].match(RADIAL_SHAPE_DEFINITION);
11802
- var shape = m && (m[1] === 'circle' || // explicit shape specification
11803
- m[3] !== undefined && m[5] === undefined) // only one radius coordinate
11804
- ? RADIAL_GRADIENT_SHAPE.CIRCLE : RADIAL_GRADIENT_SHAPE.ELLIPSE;
11805
- var radius = {};
11806
- var center = {};
 
11807
 
11808
- if (m) {
11809
- // Radius
11810
- if (m[3] !== undefined) {
11811
- radius.x = (0, _Length.calculateLengthFromValueWithUnit)(container, m[3], m[4]).getAbsoluteValue(bounds.width);
 
 
 
 
 
 
 
 
 
 
 
11812
  }
 
 
 
11813
 
11814
- if (m[5] !== undefined) {
11815
- radius.y = (0, _Length.calculateLengthFromValueWithUnit)(container, m[5], m[6]).getAbsoluteValue(bounds.height);
11816
- }
11817
 
11818
- // Position
11819
- if (m[7]) {
11820
- center.x = LENGTH_FOR_POSITION[m[7].toLowerCase()];
11821
- } else if (m[8] !== undefined) {
11822
- center.x = (0, _Length.calculateLengthFromValueWithUnit)(container, m[8], m[9]);
11823
- }
 
 
 
 
 
11824
 
11825
- if (m[10]) {
11826
- center.y = LENGTH_FOR_POSITION[m[10].toLowerCase()];
11827
- } else if (m[11] !== undefined) {
11828
- center.y = (0, _Length.calculateLengthFromValueWithUnit)(container, m[11], m[12]);
11829
- }
11830
- }
11831
 
11832
- var gradientCenter = {
11833
- x: center.x === undefined ? bounds.width / 2 : center.x.getAbsoluteValue(bounds.width),
11834
- y: center.y === undefined ? bounds.height / 2 : center.y.getAbsoluteValue(bounds.height)
11835
- };
11836
- var gradientRadius = calculateRadius(m && m[2] || 'farthest-corner', shape, gradientCenter, radius, bounds);
11837
 
11838
- return new RadialGradient(parseColorStops(args, m ? 1 : 0, Math.min(gradientRadius.x, gradientRadius.y)), shape, gradientCenter, gradientRadius);
11839
- };
 
 
 
 
 
11840
 
11841
- var calculateGradientDirection = function calculateGradientDirection(radian, bounds) {
11842
- var width = bounds.width;
11843
- var height = bounds.height;
11844
- var HALF_WIDTH = width * 0.5;
11845
- var HALF_HEIGHT = height * 0.5;
11846
- var lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian));
11847
- var HALF_LINE_LENGTH = lineLength / 2;
11848
-
11849
- var x0 = HALF_WIDTH + Math.sin(radian) * HALF_LINE_LENGTH;
11850
- var y0 = HALF_HEIGHT - Math.cos(radian) * HALF_LINE_LENGTH;
11851
- var x1 = width - x0;
11852
- var y1 = height - y0;
11853
-
11854
- return { x0: x0, x1: x1, y0: y0, y1: y1 };
11855
- };
11856
 
11857
- var parseTopRight = function parseTopRight(bounds) {
11858
- return Math.acos(bounds.width / 2 / ((0, _Util.distance)(bounds.width, bounds.height) / 2));
11859
- };
11860
 
11861
- var parseSideOrCorner = function parseSideOrCorner(side, bounds) {
11862
- switch (side) {
11863
- case 'bottom':
11864
- case 'to top':
11865
- return calculateGradientDirection(0, bounds);
11866
- case 'left':
11867
- case 'to right':
11868
- return calculateGradientDirection(Math.PI / 2, bounds);
11869
- case 'right':
11870
- case 'to left':
11871
- return calculateGradientDirection(3 * Math.PI / 2, bounds);
11872
- case 'top right':
11873
- case 'right top':
11874
- case 'to bottom left':
11875
- case 'to left bottom':
11876
- return calculateGradientDirection(Math.PI + parseTopRight(bounds), bounds);
11877
- case 'top left':
11878
- case 'left top':
11879
- case 'to bottom right':
11880
- case 'to right bottom':
11881
- return calculateGradientDirection(Math.PI - parseTopRight(bounds), bounds);
11882
- case 'bottom left':
11883
- case 'left bottom':
11884
- case 'to top right':
11885
- case 'to right top':
11886
- return calculateGradientDirection(parseTopRight(bounds), bounds);
11887
- case 'bottom right':
11888
- case 'right bottom':
11889
- case 'to top left':
11890
- case 'to left top':
11891
- return calculateGradientDirection(2 * Math.PI - parseTopRight(bounds), bounds);
11892
- case 'top':
11893
- case 'to bottom':
11894
- default:
11895
- return calculateGradientDirection(Math.PI, bounds);
11896
- }
11897
- };
11898
 
11899
- var parsePercentageAngle = function parsePercentageAngle(angle, bounds) {
11900
- var _angle$split$map = angle.split(' ').map(parseFloat),
11901
- _angle$split$map2 = _slicedToArray(_angle$split$map, 2),
11902
- left = _angle$split$map2[0],
11903
- top = _angle$split$map2[1];
11904
 
11905
- var ratio = left / 100 * bounds.width / (top / 100 * bounds.height);
 
11906
 
11907
- return calculateGradientDirection(Math.atan(isNaN(ratio) ? 1 : ratio) + Math.PI / 2, bounds);
11908
- };
 
 
 
11909
 
11910
- var findCorner = function findCorner(bounds, x, y, closest) {
11911
- var corners = [{ x: 0, y: 0 }, { x: 0, y: bounds.height }, { x: bounds.width, y: 0 }, { x: bounds.width, y: bounds.height }];
 
11912
 
11913
- // $FlowFixMe
11914
- return corners.reduce(function (stat, corner) {
11915
- var d = (0, _Util.distance)(x - corner.x, y - corner.y);
11916
- if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {
11917
- return {
11918
- optimumCorner: corner,
11919
- optimumDistance: d
11920
- };
11921
- }
11922
 
11923
- return stat;
11924
- }, {
11925
- optimumDistance: closest ? Infinity : -Infinity,
11926
- optimumCorner: null
11927
- }).optimumCorner;
11928
- };
 
11929
 
11930
- var calculateRadius = function calculateRadius(extent, shape, center, radius, bounds) {
11931
- var x = center.x;
11932
- var y = center.y;
11933
- var rx = 0;
11934
- var ry = 0;
 
11935
 
11936
- switch (extent) {
11937
- case 'closest-side':
11938
- // The ending shape is sized so that that it exactly meets the side of the gradient box closest to the gradient’s center.
11939
- // If the shape is an ellipse, it exactly meets the closest side in each dimension.
11940
- if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
11941
- rx = ry = Math.min(Math.abs(x), Math.abs(x - bounds.width), Math.abs(y), Math.abs(y - bounds.height));
11942
- } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
11943
- rx = Math.min(Math.abs(x), Math.abs(x - bounds.width));
11944
- ry = Math.min(Math.abs(y), Math.abs(y - bounds.height));
11945
- }
11946
- break;
11947
 
11948
- case 'closest-corner':
11949
- // The ending shape is sized so that that it passes through the corner of the gradient box closest to the gradient’s center.
11950
- // If the shape is an ellipse, the ending shape is given the same aspect-ratio it would have if closest-side were specified.
11951
- if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
11952
- 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));
11953
- } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
11954
- // Compute the ratio ry/rx (which is to be the same as for "closest-side")
11955
- var c = Math.min(Math.abs(y), Math.abs(y - bounds.height)) / Math.min(Math.abs(x), Math.abs(x - bounds.width));
11956
- var corner = findCorner(bounds, x, y, true);
11957
- rx = (0, _Util.distance)(corner.x - x, (corner.y - y) / c);
11958
- ry = c * rx;
11959
- }
11960
- break;
11961
 
11962
- case 'farthest-side':
11963
- // Same as closest-side, except the ending shape is sized based on the farthest side(s)
11964
- if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
11965
- rx = ry = Math.max(Math.abs(x), Math.abs(x - bounds.width), Math.abs(y), Math.abs(y - bounds.height));
11966
- } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
11967
- rx = Math.max(Math.abs(x), Math.abs(x - bounds.width));
11968
- ry = Math.max(Math.abs(y), Math.abs(y - bounds.height));
11969
- }
11970
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11971
 
11972
- case 'farthest-corner':
11973
- // Same as closest-corner, except the ending shape is sized based on the farthest corner.
11974
- // If the shape is an ellipse, the ending shape is given the same aspect ratio it would have if farthest-side were specified.
11975
- if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
11976
- 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));
11977
- } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
11978
- // Compute the ratio ry/rx (which is to be the same as for "farthest-side")
11979
- var _c = Math.max(Math.abs(y), Math.abs(y - bounds.height)) / Math.max(Math.abs(x), Math.abs(x - bounds.width));
11980
- var _corner = findCorner(bounds, x, y, false);
11981
- rx = (0, _Util.distance)(_corner.x - x, (_corner.y - y) / _c);
11982
- ry = _c * rx;
11983
- }
11984
- break;
11985
 
11986
- default:
11987
- // pixel or percentage values
11988
- rx = radius.x || 0;
11989
- ry = radius.y !== undefined ? radius.y : rx;
11990
- break;
11991
- }
 
11992
 
11993
- return {
11994
- x: rx,
11995
- y: ry
11996
- };
11997
- };
 
11998
 
11999
- var transformWebkitRadialGradientArgs = exports.transformWebkitRadialGradientArgs = function transformWebkitRadialGradientArgs(args) {
12000
- var shape = '';
12001
- var radius = '';
12002
- var extent = '';
12003
- var position = '';
12004
- var idx = 0;
12005
 
12006
- var POSITION = /^(left|center|right|\d+(?:px|r?em|%)?)(?:\s+(top|center|bottom|\d+(?:px|r?em|%)?))?$/i;
12007
- var SHAPE_AND_EXTENT = /^(circle|ellipse)?\s*(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)?$/i;
12008
- var RADIUS = /^\d+(px|r?em|%)?(?:\s+\d+(px|r?em|%)?)?$/i;
 
 
 
 
 
 
 
 
 
 
 
 
12009
 
12010
- var matchStartPosition = args[idx].match(POSITION);
12011
- if (matchStartPosition) {
12012
- idx++;
 
12013
  }
12014
 
12015
- var matchShapeExtent = args[idx].match(SHAPE_AND_EXTENT);
12016
- if (matchShapeExtent) {
12017
- shape = matchShapeExtent[1] || '';
12018
- extent = matchShapeExtent[2] || '';
12019
- if (extent === 'contain') {
12020
- extent = 'closest-side';
12021
- } else if (extent === 'cover') {
12022
- extent = 'farthest-corner';
12023
- }
12024
- idx++;
12025
- }
12026
 
12027
- var matchStartRadius = args[idx].match(RADIUS);
12028
- if (matchStartRadius) {
12029
- idx++;
12030
- }
12031
 
12032
- var matchEndPosition = args[idx].match(POSITION);
12033
- if (matchEndPosition) {
12034
- idx++;
12035
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
12036
 
12037
- var matchEndRadius = args[idx].match(RADIUS);
12038
- if (matchEndRadius) {
12039
- idx++;
12040
- }
 
12041
 
12042
- var matchPosition = matchEndPosition || matchStartPosition;
12043
- if (matchPosition && matchPosition[1]) {
12044
- position = matchPosition[1] + (/^\d+$/.test(matchPosition[1]) ? 'px' : '');
12045
- if (matchPosition[2]) {
12046
- position += ' ' + matchPosition[2] + (/^\d+$/.test(matchPosition[2]) ? 'px' : '');
12047
- }
12048
  }
12049
 
12050
- var matchRadius = matchEndRadius || matchStartRadius;
12051
- if (matchRadius) {
12052
- radius = matchRadius[0];
12053
- if (!matchRadius[1]) {
12054
- radius += 'px';
12055
- }
12056
  }
12057
 
12058
- if (position && !shape && !radius && !extent) {
12059
- radius = position;
12060
- position = '';
 
12061
  }
12062
 
12063
- if (position) {
12064
- position = 'at ' + position;
 
 
 
 
 
 
 
 
12065
  }
12066
 
12067
- return [[shape, extent, radius, position].filter(function (s) {
12068
- return !!s;
12069
- }).join(' ')].concat(args.slice(idx));
12070
- };
12071
 
12072
- var transformObsoleteColorStops = function transformObsoleteColorStops(args) {
12073
- return args.map(function (color) {
12074
- return color.match(FROM_TO_COLORSTOP);
12075
- })
12076
- // $FlowFixMe
12077
- .map(function (v, index) {
12078
- if (!v) {
12079
- return args[index];
12080
- }
12081
 
12082
- switch (v[1]) {
12083
- case 'from':
12084
- return v[4] + ' 0%';
12085
- case 'to':
12086
- return v[4] + ' 100%';
12087
- case 'color-stop':
12088
- if (v[3] === '%') {
12089
- return v[4] + ' ' + v[2];
12090
- }
12091
- return v[4] + ' ' + parseFloat(v[2]) * 100 + '%';
12092
- }
12093
- });
12094
- };
12095
 
12096
- /***/ }),
12097
- /* 53 */
12098
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
12099
 
12100
- "use strict";
 
 
 
 
12101
 
 
 
12102
 
12103
- Object.defineProperty(exports, "__esModule", {
12104
- value: true
12105
- });
12106
- var ANGLE = /([+-]?\d*\.?\d+)(deg|grad|rad|turn)/i;
 
 
 
 
12107
 
12108
- var parseAngle = exports.parseAngle = function parseAngle(angle) {
12109
- var match = angle.match(ANGLE);
 
 
 
 
12110
 
12111
- if (match) {
12112
- var value = parseFloat(match[1]);
12113
- switch (match[2].toLowerCase()) {
12114
- case 'deg':
12115
- return Math.PI * value / 180;
12116
- case 'grad':
12117
- return Math.PI / 200 * value;
12118
- case 'rad':
12119
- return value;
12120
- case 'turn':
12121
- return Math.PI * 2 * value;
12122
- }
12123
- }
12124
 
12125
- return null;
12126
- };
 
12127
 
12128
- /***/ }),
12129
- /* 54 */
12130
- /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12131
 
12132
- "use strict";
 
 
 
 
12133
 
 
 
 
 
 
12134
 
12135
- Object.defineProperty(exports, "__esModule", {
12136
- value: true
12137
- });
12138
- exports.cloneWindow = exports.DocumentCloner = undefined;
12139
-
12140
- 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"); } }; }();
 
 
 
 
 
12141
 
12142
- 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; }; }();
 
 
 
 
 
 
 
 
 
 
12143
 
12144
- var _Bounds = __webpack_require__(2);
 
 
 
 
 
 
 
 
 
 
12145
 
12146
- var _Proxy = __webpack_require__(26);
12147
 
12148
- var _ResourceLoader = __webpack_require__(55);
 
12149
 
12150
- var _ResourceLoader2 = _interopRequireDefault(_ResourceLoader);
 
 
 
 
 
 
 
12151
 
12152
- var _Util = __webpack_require__(4);
 
 
 
 
 
12153
 
12154
- var _background = __webpack_require__(5);
 
12155
 
12156
- var _CanvasRenderer = __webpack_require__(15);
 
12157
 
12158
- var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);
 
12159
 
12160
- var _PseudoNodeContent = __webpack_require__(56);
 
12161
 
12162
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
12163
 
12164
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
12165
 
12166
- var IGNORE_ATTRIBUTE = 'data-html2canvas-ignore';
 
 
 
 
12167
 
12168
- var DocumentCloner = exports.DocumentCloner = function () {
12169
- function DocumentCloner(element, options, logger, copyInline, renderer) {
12170
- _classCallCheck(this, DocumentCloner);
 
 
 
12171
 
12172
- this.referenceElement = element;
12173
- this.scrolledElements = [];
12174
- this.copyStyles = copyInline;
12175
- this.inlineImages = copyInline;
12176
- this.logger = logger;
12177
- this.options = options;
12178
- this.renderer = renderer;
12179
- this.resourceLoader = new _ResourceLoader2.default(options, logger, window);
12180
- this.pseudoContentData = {
12181
- counters: {},
12182
- quoteDepth: 0
12183
- };
12184
- // $FlowFixMe
12185
- this.documentElement = this.cloneNode(element.ownerDocument.documentElement);
12186
- }
12187
 
12188
- _createClass(DocumentCloner, [{
12189
- key: 'inlineAllImages',
12190
- value: function inlineAllImages(node) {
12191
- var _this = this;
 
 
12192
 
12193
- if (this.inlineImages && node) {
12194
- var style = node.style;
12195
- Promise.all((0, _background.parseBackgroundImage)(style.backgroundImage).map(function (backgroundImage) {
12196
- if (backgroundImage.method === 'url') {
12197
- return _this.resourceLoader.inlineImage(backgroundImage.args[0]).then(function (img) {
12198
- return img && typeof img.src === 'string' ? 'url("' + img.src + '")' : 'none';
12199
- }).catch(function (e) {
12200
- if (true) {
12201
- _this.logger.log('Unable to load image', e);
12202
- }
12203
- });
12204
- }
12205
- return Promise.resolve('' + backgroundImage.prefix + backgroundImage.method + '(' + backgroundImage.args.join(',') + ')');
12206
- })).then(function (backgroundImages) {
12207
- if (backgroundImages.length > 1) {
12208
- // TODO Multiple backgrounds somehow broken in Chrome
12209
- style.backgroundColor = '';
12210
- }
12211
- style.backgroundImage = backgroundImages.join(',');
12212
- });
12213
 
12214
- if (node instanceof HTMLImageElement) {
12215
- this.resourceLoader.inlineImage(node.src).then(function (img) {
12216
- if (img && node instanceof HTMLImageElement && node.parentNode) {
12217
- var parentNode = node.parentNode;
12218
- var clonedChild = (0, _Util.copyCSSStyles)(node.style, img.cloneNode(false));
12219
- parentNode.replaceChild(clonedChild, node);
12220
- }
12221
- }).catch(function (e) {
12222
- if (true) {
12223
- _this.logger.log('Unable to load image', e);
12224
- }
12225
- });
12226
- }
12227
- }
12228
- }
12229
- }, {
12230
- key: 'inlineFonts',
12231
- value: function inlineFonts(document) {
12232
- var _this2 = this;
12233
 
12234
- return Promise.all(Array.from(document.styleSheets).map(function (sheet) {
12235
- if (sheet.href) {
12236
- return fetch(sheet.href).then(function (res) {
12237
- return res.text();
12238
- }).then(function (text) {
12239
- return createStyleSheetFontsFromText(text, sheet.href);
12240
- }).catch(function (e) {
12241
- if (true) {
12242
- _this2.logger.log('Unable to load stylesheet', e);
12243
- }
12244
- return [];
12245
- });
12246
- }
12247
- return getSheetFonts(sheet, document);
12248
- })).then(function (fonts) {
12249
- return fonts.reduce(function (acc, font) {
12250
- return acc.concat(font);
12251
- }, []);
12252
- }).then(function (fonts) {
12253
- return Promise.all(fonts.map(function (font) {
12254
- return fetch(font.formats[0].src).then(function (response) {
12255
- return response.blob();
12256
- }).then(function (blob) {
12257
- return new Promise(function (resolve, reject) {
12258
- var reader = new FileReader();
12259
- reader.onerror = reject;
12260
- reader.onload = function () {
12261
- // $FlowFixMe
12262
- var result = reader.result;
12263
- resolve(result);
12264
- };
12265
- reader.readAsDataURL(blob);
12266
- });
12267
- }).then(function (dataUri) {
12268
- font.fontFace.setProperty('src', 'url("' + dataUri + '")');
12269
- return '@font-face {' + font.fontFace.cssText + ' ';
12270
- });
12271
- }));
12272
- }).then(function (fontCss) {
12273
- var style = document.createElement('style');
12274
- style.textContent = fontCss.join('\n');
12275
- _this2.documentElement.appendChild(style);
12276
- });
12277
  }
12278
- }, {
12279
- key: 'createElementClone',
12280
- value: function createElementClone(node) {
12281
- var _this3 = this;
12282
-
12283
- if (this.copyStyles && node instanceof HTMLCanvasElement) {
12284
- var img = node.ownerDocument.createElement('img');
12285
- try {
12286
- img.src = node.toDataURL();
12287
- return img;
12288
- } catch (e) {
12289
- if (true) {
12290
- this.logger.log('Unable to clone canvas contents, canvas is tainted');
12291
- }
12292
- }
12293
- }
12294
 
12295
- if (node instanceof HTMLIFrameElement) {
12296
- var tempIframe = node.cloneNode(false);
12297
- var iframeKey = generateIframeKey();
12298
- tempIframe.setAttribute('data-html2canvas-internal-iframe-key', iframeKey);
 
12299
 
12300
- var _parseBounds = (0, _Bounds.parseBounds)(node, 0, 0),
12301
- width = _parseBounds.width,
12302
- height = _parseBounds.height;
 
 
 
 
 
 
 
 
12303
 
12304
- this.resourceLoader.cache[iframeKey] = getIframeDocumentElement(node, this.options).then(function (documentElement) {
12305
- return _this3.renderer(documentElement, {
12306
- async: _this3.options.async,
12307
- allowTaint: _this3.options.allowTaint,
12308
- backgroundColor: '#ffffff',
12309
- canvas: null,
12310
- imageTimeout: _this3.options.imageTimeout,
12311
- logging: _this3.options.logging,
12312
- proxy: _this3.options.proxy,
12313
- removeContainer: _this3.options.removeContainer,
12314
- scale: _this3.options.scale,
12315
- foreignObjectRendering: _this3.options.foreignObjectRendering,
12316
- useCORS: _this3.options.useCORS,
12317
- target: new _CanvasRenderer2.default(),
12318
- width: width,
12319
- height: height,
12320
- x: 0,
12321
- y: 0,
12322
- windowWidth: documentElement.ownerDocument.defaultView.innerWidth,
12323
- windowHeight: documentElement.ownerDocument.defaultView.innerHeight,
12324
- scrollX: documentElement.ownerDocument.defaultView.pageXOffset,
12325
- scrollY: documentElement.ownerDocument.defaultView.pageYOffset
12326
- }, _this3.logger.child(iframeKey));
12327
- }).then(function (canvas) {
12328
- return new Promise(function (resolve, reject) {
12329
- var iframeCanvas = document.createElement('img');
12330
- iframeCanvas.onload = function () {
12331
- return resolve(canvas);
12332
- };
12333
- iframeCanvas.onerror = reject;
12334
- iframeCanvas.src = canvas.toDataURL();
12335
- if (tempIframe.parentNode) {
12336
- tempIframe.parentNode.replaceChild((0, _Util.copyCSSStyles)(node.ownerDocument.defaultView.getComputedStyle(node), iframeCanvas), tempIframe);
12337
- }
12338
- });
12339
- });
12340
- return tempIframe;
12341
- }
12342
 
12343
- if (node instanceof HTMLStyleElement && node.sheet && node.sheet.cssRules) {
12344
- var css = [].slice.call(node.sheet.cssRules, 0).reduce(function (css, rule) {
12345
- try {
12346
- if (rule && rule.cssText) {
12347
- return css + rule.cssText;
12348
- }
12349
- return css;
12350
- } catch (err) {
12351
- _this3.logger.log('Unable to access cssText property', rule.name);
12352
- return css;
12353
- }
12354
- }, '');
12355
- var style = node.cloneNode(false);
12356
- style.textContent = css;
12357
- return style;
12358
- }
12359
 
12360
- return node.cloneNode(false);
 
 
 
 
 
 
 
 
 
 
 
12361
  }
12362
- }, {
12363
- key: 'cloneNode',
12364
- value: function cloneNode(node) {
12365
- var clone = node.nodeType === Node.TEXT_NODE ? document.createTextNode(node.nodeValue) : this.createElementClone(node);
12366
 
12367
- var window = node.ownerDocument.defaultView;
12368
- var style = node instanceof window.HTMLElement ? window.getComputedStyle(node) : null;
12369
- var styleBefore = node instanceof window.HTMLElement ? window.getComputedStyle(node, ':before') : null;
12370
- var styleAfter = node instanceof window.HTMLElement ? window.getComputedStyle(node, ':after') : null;
12371
 
12372
- if (this.referenceElement === node && clone instanceof window.HTMLElement) {
12373
- this.clonedReferenceElement = clone;
12374
- }
 
 
 
 
 
 
 
 
 
 
 
 
12375
 
12376
- if (clone instanceof window.HTMLBodyElement) {
12377
- createPseudoHideStyles(clone);
12378
- }
 
12379
 
12380
- var counters = (0, _PseudoNodeContent.parseCounterReset)(style, this.pseudoContentData);
12381
- var contentBefore = (0, _PseudoNodeContent.resolvePseudoContent)(node, styleBefore, this.pseudoContentData);
 
 
 
 
 
 
 
12382
 
12383
- for (var child = node.firstChild; child; child = child.nextSibling) {
12384
- if (child.nodeType !== Node.ELEMENT_NODE || child.nodeName !== 'SCRIPT' &&
12385
- // $FlowFixMe
12386
- !child.hasAttribute(IGNORE_ATTRIBUTE) && (typeof this.options.ignoreElements !== 'function' ||
12387
- // $FlowFixMe
12388
- !this.options.ignoreElements(child))) {
12389
- if (!this.copyStyles || child.nodeName !== 'STYLE') {
12390
- clone.appendChild(this.cloneNode(child));
12391
- }
12392
- }
12393
- }
12394
 
12395
- var contentAfter = (0, _PseudoNodeContent.resolvePseudoContent)(node, styleAfter, this.pseudoContentData);
12396
- (0, _PseudoNodeContent.popCounters)(counters, this.pseudoContentData);
 
 
 
 
 
12397
 
12398
- if (node instanceof window.HTMLElement && clone instanceof window.HTMLElement) {
12399
- if (styleBefore) {
12400
- this.inlineAllImages(inlinePseudoElement(node, clone, styleBefore, contentBefore, PSEUDO_BEFORE));
12401
- }
12402
- if (styleAfter) {
12403
- this.inlineAllImages(inlinePseudoElement(node, clone, styleAfter, contentAfter, PSEUDO_AFTER));
12404
- }
12405
- if (style && this.copyStyles && !(node instanceof HTMLIFrameElement)) {
12406
- (0, _Util.copyCSSStyles)(style, clone);
12407
- }
12408
- this.inlineAllImages(clone);
12409
- if (node.scrollTop !== 0 || node.scrollLeft !== 0) {
12410
- this.scrolledElements.push([clone, node.scrollLeft, node.scrollTop]);
12411
- }
12412
- switch (node.nodeName) {
12413
- case 'CANVAS':
12414
- if (!this.copyStyles) {
12415
- cloneCanvasContents(node, clone);
12416
- }
12417
- break;
12418
- case 'TEXTAREA':
12419
- case 'SELECT':
12420
- clone.value = node.value;
12421
- break;
12422
- }
12423
- }
12424
- return clone;
12425
- }
12426
- }]);
12427
 
12428
- return DocumentCloner;
12429
- }();
 
 
 
12430
 
12431
- var getSheetFonts = function getSheetFonts(sheet, document) {
12432
- // $FlowFixMe
12433
- return (sheet.cssRules ? Array.from(sheet.cssRules) : []).filter(function (rule) {
12434
- return rule.type === CSSRule.FONT_FACE_RULE;
12435
- }).map(function (rule) {
12436
- var src = (0, _background.parseBackgroundImage)(rule.style.getPropertyValue('src'));
12437
- var formats = [];
12438
- for (var i = 0; i < src.length; i++) {
12439
- if (src[i].method === 'url' && src[i + 1] && src[i + 1].method === 'format') {
12440
- var a = document.createElement('a');
12441
- a.href = src[i].args[0];
12442
- if (document.body) {
12443
- document.body.appendChild(a);
12444
- }
12445
 
12446
- var font = {
12447
- src: a.href,
12448
- format: src[i + 1].args[0]
12449
- };
12450
- formats.push(font);
12451
- }
12452
- }
12453
 
12454
- return {
12455
- // TODO select correct format for browser),
 
 
12456
 
12457
- formats: formats.filter(function (font) {
12458
- return (/^woff/i.test(font.format)
12459
- );
12460
- }),
12461
- fontFace: rule.style
12462
- };
12463
- }).filter(function (font) {
12464
- return font.formats.length;
12465
- });
12466
- };
12467
 
12468
- var createStyleSheetFontsFromText = function createStyleSheetFontsFromText(text, baseHref) {
12469
- var doc = document.implementation.createHTMLDocument('');
12470
- var base = document.createElement('base');
12471
- // $FlowFixMe
12472
- base.href = baseHref;
12473
- var style = document.createElement('style');
12474
 
12475
- style.textContent = text;
12476
- if (doc.head) {
12477
- doc.head.appendChild(base);
12478
- }
12479
- if (doc.body) {
12480
- doc.body.appendChild(style);
12481
- }
 
 
 
 
 
 
 
12482
 
12483
- return style.sheet ? getSheetFonts(style.sheet, doc) : [];
12484
- };
 
 
 
 
 
 
 
 
12485
 
12486
- var restoreOwnerScroll = function restoreOwnerScroll(ownerDocument, x, y) {
12487
- if (ownerDocument.defaultView && (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)) {
12488
- ownerDocument.defaultView.scrollTo(x, y);
12489
- }
12490
- };
12491
 
12492
- var cloneCanvasContents = function cloneCanvasContents(canvas, clonedCanvas) {
12493
- try {
12494
- if (clonedCanvas) {
12495
- clonedCanvas.width = canvas.width;
12496
- clonedCanvas.height = canvas.height;
12497
- var ctx = canvas.getContext('2d');
12498
- var clonedCtx = clonedCanvas.getContext('2d');
12499
- if (ctx) {
12500
- clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
12501
- } else {
12502
- clonedCtx.drawImage(canvas, 0, 0);
12503
- }
12504
- }
12505
- } catch (e) {}
12506
- };
12507
 
12508
- var inlinePseudoElement = function inlinePseudoElement(node, clone, style, contentItems, pseudoElt) {
12509
- if (!style || !style.content || style.content === 'none' || style.content === '-moz-alt-content' || style.display === 'none') {
12510
- return;
12511
- }
12512
 
12513
- var anonymousReplacedElement = clone.ownerDocument.createElement('html2canvaspseudoelement');
12514
- (0, _Util.copyCSSStyles)(style, anonymousReplacedElement);
12515
 
12516
- if (contentItems) {
12517
- var len = contentItems.length;
12518
- for (var i = 0; i < len; i++) {
12519
- var item = contentItems[i];
12520
- switch (item.type) {
12521
- case _PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE.IMAGE:
12522
- var img = clone.ownerDocument.createElement('img');
12523
- img.src = (0, _background.parseBackgroundImage)('url(' + item.value + ')')[0].args[0];
12524
- img.style.opacity = '1';
12525
- anonymousReplacedElement.appendChild(img);
12526
- break;
12527
- case _PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE.TEXT:
12528
- anonymousReplacedElement.appendChild(clone.ownerDocument.createTextNode(item.value));
12529
- break;
12530
- }
 
 
 
 
 
12531
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12532
  }
12533
 
12534
- anonymousReplacedElement.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + ' ' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
12535
- clone.className += pseudoElt === PSEUDO_BEFORE ? ' ' + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE : ' ' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
12536
- if (pseudoElt === PSEUDO_BEFORE) {
12537
- clone.insertBefore(anonymousReplacedElement, clone.firstChild);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12538
  } else {
12539
- clone.appendChild(anonymousReplacedElement);
12540
  }
12541
 
12542
- return anonymousReplacedElement;
12543
- };
12544
 
12545
- var URL_REGEXP = /^url\((.+)\)$/i;
12546
- var PSEUDO_BEFORE = ':before';
12547
- var PSEUDO_AFTER = ':after';
12548
- var PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = '___html2canvas___pseudoelement_before';
12549
- var PSEUDO_HIDE_ELEMENT_CLASS_AFTER = '___html2canvas___pseudoelement_after';
12550
 
12551
- var PSEUDO_HIDE_ELEMENT_STYLE = '{\n content: "" !important;\n display: none !important;\n}';
 
 
12552
 
12553
- var createPseudoHideStyles = function createPseudoHideStyles(body) {
12554
- 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);
12555
- };
12556
 
12557
- var createStyles = function createStyles(body, styles) {
12558
- var style = body.ownerDocument.createElement('style');
12559
- style.innerHTML = styles;
12560
- body.appendChild(style);
12561
- };
12562
 
12563
- var initNode = function initNode(_ref) {
12564
- var _ref2 = _slicedToArray(_ref, 3),
12565
- element = _ref2[0],
12566
- x = _ref2[1],
12567
- y = _ref2[2];
12568
 
12569
- element.scrollLeft = x;
12570
- element.scrollTop = y;
12571
- };
 
 
 
 
 
12572
 
12573
- var generateIframeKey = function generateIframeKey() {
12574
- return Math.ceil(Date.now() + Math.random() * 10000000).toString(16);
12575
- };
12576
 
12577
- var DATA_URI_REGEXP = /^data:text\/(.+);(base64)?,(.*)$/i;
12578
 
12579
- var getIframeDocumentElement = function getIframeDocumentElement(node, options) {
12580
- try {
12581
- return Promise.resolve(node.contentWindow.document.documentElement);
12582
- } catch (e) {
12583
- return options.proxy ? (0, _Proxy.Proxy)(node.src, options).then(function (html) {
12584
- var match = html.match(DATA_URI_REGEXP);
12585
- if (!match) {
12586
- return Promise.reject();
12587
- }
12588
 
12589
- return match[2] === 'base64' ? window.atob(decodeURIComponent(match[3])) : decodeURIComponent(match[3]);
12590
- }).then(function (html) {
12591
- return createIframeContainer(node.ownerDocument, (0, _Bounds.parseBounds)(node, 0, 0)).then(function (cloneIframeContainer) {
12592
- var cloneWindow = cloneIframeContainer.contentWindow;
12593
- var documentClone = cloneWindow.document;
12594
 
12595
- documentClone.open();
12596
- documentClone.write(html);
12597
- var iframeLoad = iframeLoader(cloneIframeContainer).then(function () {
12598
- return documentClone.documentElement;
12599
- });
12600
 
12601
- documentClone.close();
12602
- return iframeLoad;
12603
- });
12604
- }) : Promise.reject();
12605
- }
12606
- };
12607
 
12608
- var createIframeContainer = function createIframeContainer(ownerDocument, bounds) {
12609
- var cloneIframeContainer = ownerDocument.createElement('iframe');
12610
 
12611
- cloneIframeContainer.className = 'html2canvas-container';
12612
- cloneIframeContainer.style.visibility = 'hidden';
12613
- cloneIframeContainer.style.position = 'fixed';
12614
- cloneIframeContainer.style.left = '-10000px';
12615
- cloneIframeContainer.style.top = '0px';
12616
- cloneIframeContainer.style.border = '0';
12617
- cloneIframeContainer.width = bounds.width.toString();
12618
- cloneIframeContainer.height = bounds.height.toString();
12619
- cloneIframeContainer.scrolling = 'no'; // ios won't scroll without it
12620
- cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, 'true');
12621
- if (!ownerDocument.body) {
12622
- return Promise.reject( true ? 'Body element not found in Document that is getting rendered' : '');
12623
- }
12624
 
12625
- ownerDocument.body.appendChild(cloneIframeContainer);
12626
 
12627
- return Promise.resolve(cloneIframeContainer);
12628
- };
12629
 
12630
- var iframeLoader = function iframeLoader(cloneIframeContainer) {
12631
- var cloneWindow = cloneIframeContainer.contentWindow;
12632
- var documentClone = cloneWindow.document;
12633
 
12634
- return new Promise(function (resolve, reject) {
12635
- cloneWindow.onload = cloneIframeContainer.onload = documentClone.onreadystatechange = function () {
12636
- var interval = setInterval(function () {
12637
- if (documentClone.body.childNodes.length > 0 && documentClone.readyState === 'complete') {
12638
- clearInterval(interval);
12639
- resolve(cloneIframeContainer);
12640
- }
12641
- }, 50);
12642
- };
12643
- });
12644
- };
12645
 
12646
- var cloneWindow = exports.cloneWindow = function cloneWindow(ownerDocument, bounds, referenceElement, options, logger, renderer) {
12647
- var cloner = new DocumentCloner(referenceElement, options, logger, false, renderer);
12648
- var scrollX = ownerDocument.defaultView.pageXOffset;
12649
- var scrollY = ownerDocument.defaultView.pageYOffset;
12650
 
12651
- return createIframeContainer(ownerDocument, bounds).then(function (cloneIframeContainer) {
12652
- var cloneWindow = cloneIframeContainer.contentWindow;
12653
- var documentClone = cloneWindow.document;
12654
 
12655
- /* Chrome doesn't detect relative background-images assigned in inline <style> sheets when fetched through getComputedStyle
12656
- if window url is about:blank, we can assign the url to current by writing onto the document
12657
- */
 
 
 
 
 
 
 
 
 
 
12658
 
12659
- var iframeLoad = iframeLoader(cloneIframeContainer).then(function () {
12660
- cloner.scrolledElements.forEach(initNode);
12661
- cloneWindow.scrollTo(bounds.left, bounds.top);
12662
- if (/(iPad|iPhone|iPod)/g.test(navigator.userAgent) && (cloneWindow.scrollY !== bounds.top || cloneWindow.scrollX !== bounds.left)) {
12663
- documentClone.documentElement.style.top = -bounds.top + 'px';
12664
- documentClone.documentElement.style.left = -bounds.left + 'px';
12665
- documentClone.documentElement.style.position = 'absolute';
12666
- }
12667
 
12668
- var result = Promise.resolve([cloneIframeContainer, cloner.clonedReferenceElement, cloner.resourceLoader]);
 
 
 
 
 
 
 
 
 
12669
 
12670
- var onclone = options.onclone;
 
 
 
 
 
12671
 
12672
- return cloner.clonedReferenceElement instanceof cloneWindow.HTMLElement || cloner.clonedReferenceElement instanceof ownerDocument.defaultView.HTMLElement || cloner.clonedReferenceElement instanceof HTMLElement ? typeof onclone === 'function' ? Promise.resolve().then(function () {
12673
- return onclone(documentClone);
12674
- }).then(function () {
12675
- return result;
12676
- }) : result : Promise.reject( true ? 'Error finding the ' + referenceElement.nodeName + ' in the cloned document' : '');
12677
- });
12678
 
12679
- documentClone.open();
12680
- documentClone.write(serializeDoctype(document.doctype) + '<html></html>');
12681
- // Chrome scrolls the parent document for some reason after the write to the cloned window???
12682
- restoreOwnerScroll(referenceElement.ownerDocument, scrollX, scrollY);
12683
- documentClone.replaceChild(documentClone.adoptNode(cloner.documentElement), documentClone.documentElement);
12684
- documentClone.close();
12685
 
12686
- return iframeLoad;
12687
- });
12688
- };
12689
 
12690
- var serializeDoctype = function serializeDoctype(doctype) {
12691
- var str = '';
12692
- if (doctype) {
12693
- str += '<!DOCTYPE ';
12694
- if (doctype.name) {
12695
- str += doctype.name;
12696
- }
12697
 
12698
- if (doctype.internalSubset) {
12699
- str += doctype.internalSubset;
12700
- }
12701
 
12702
- if (doctype.publicId) {
12703
- str += '"' + doctype.publicId + '"';
12704
- }
12705
 
12706
- if (doctype.systemId) {
12707
- str += '"' + doctype.systemId + '"';
12708
- }
12709
 
12710
- str += '>';
12711
- }
12712
 
12713
- return str;
12714
- };
12715
 
12716
- /***/ }),
12717
- /* 55 */
12718
- /***/ (function(module, exports, __webpack_require__) {
12719
 
12720
- "use strict";
12721
 
 
12722
 
12723
- Object.defineProperty(exports, "__esModule", {
12724
- value: true
12725
- });
12726
- exports.ResourceStore = undefined;
12727
 
12728
- 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; }; }();
12729
 
12730
- var _Feature = __webpack_require__(10);
12731
 
12732
- var _Feature2 = _interopRequireDefault(_Feature);
12733
 
12734
- var _Proxy = __webpack_require__(26);
12735
 
12736
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
12737
 
12738
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
12739
 
12740
- var ResourceLoader = function () {
12741
- function ResourceLoader(options, logger, window) {
12742
- _classCallCheck(this, ResourceLoader);
12743
 
12744
- this.options = options;
12745
- this._window = window;
12746
- this.origin = this.getOrigin(window.location.href);
12747
- this.cache = {};
12748
- this.logger = logger;
12749
- this._index = 0;
12750
- }
12751
 
12752
- _createClass(ResourceLoader, [{
12753
- key: 'loadImage',
12754
- value: function loadImage(src) {
12755
- var _this = this;
12756
 
12757
- if (this.hasResourceInCache(src)) {
12758
- return src;
12759
- }
12760
- if (isBlobImage(src)) {
12761
- this.cache[src] = _loadImage(src, this.options.imageTimeout || 0);
12762
- return src;
12763
- }
12764
 
12765
- if (!isSVG(src) || _Feature2.default.SUPPORT_SVG_DRAWING) {
12766
- if (this.options.allowTaint === true || isInlineImage(src) || this.isSameOrigin(src)) {
12767
- return this.addImage(src, src, false);
12768
- } else if (!this.isSameOrigin(src)) {
12769
- if (typeof this.options.proxy === 'string') {
12770
- this.cache[src] = (0, _Proxy.Proxy)(src, this.options).then(function (src) {
12771
- return _loadImage(src, _this.options.imageTimeout || 0);
12772
- });
12773
- return src;
12774
- } else if (this.options.useCORS === true && _Feature2.default.SUPPORT_CORS_IMAGES) {
12775
- return this.addImage(src, src, true);
12776
- }
12777
- }
12778
- }
12779
- }
12780
- }, {
12781
- key: 'inlineImage',
12782
- value: function inlineImage(src) {
12783
- var _this2 = this;
12784
 
12785
- if (isInlineImage(src)) {
12786
- return _loadImage(src, this.options.imageTimeout || 0);
12787
- }
12788
- if (this.hasResourceInCache(src)) {
12789
- return this.cache[src];
12790
- }
12791
- if (!this.isSameOrigin(src) && typeof this.options.proxy === 'string') {
12792
- return this.cache[src] = (0, _Proxy.Proxy)(src, this.options).then(function (src) {
12793
- return _loadImage(src, _this2.options.imageTimeout || 0);
12794
- });
12795
- }
12796
 
12797
- return this.xhrImage(src);
12798
- }
12799
- }, {
12800
- key: 'xhrImage',
12801
- value: function xhrImage(src) {
12802
- var _this3 = this;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12803
 
12804
- this.cache[src] = new Promise(function (resolve, reject) {
12805
- var xhr = new XMLHttpRequest();
12806
- xhr.onreadystatechange = function () {
12807
- if (xhr.readyState === 4) {
12808
- if (xhr.status !== 200) {
12809
- reject('Failed to fetch image ' + src.substring(0, 256) + ' with status code ' + xhr.status);
12810
- } else {
12811
- var reader = new FileReader();
12812
- reader.addEventListener('load', function () {
12813
- // $FlowFixMe
12814
- var result = reader.result;
12815
- resolve(result);
12816
- }, false);
12817
- reader.addEventListener('error', function (e) {
12818
- return reject(e);
12819
- }, false);
12820
- reader.readAsDataURL(xhr.response);
12821
- }
12822
- }
12823
- };
12824
- xhr.responseType = 'blob';
12825
- if (_this3.options.imageTimeout) {
12826
- var timeout = _this3.options.imageTimeout;
12827
- xhr.timeout = timeout;
12828
- xhr.ontimeout = function () {
12829
- return reject( true ? 'Timed out (' + timeout + 'ms) fetching ' + src.substring(0, 256) : '');
12830
- };
12831
- }
12832
- xhr.open('GET', src, true);
12833
- xhr.send();
12834
- }).then(function (src) {
12835
- return _loadImage(src, _this3.options.imageTimeout || 0);
12836
- });
12837
-
12838
- return this.cache[src];
12839
- }
12840
- }, {
12841
- key: 'loadCanvas',
12842
- value: function loadCanvas(node) {
12843
- var key = String(this._index++);
12844
- this.cache[key] = Promise.resolve(node);
12845
- return key;
12846
- }
12847
- }, {
12848
- key: 'hasResourceInCache',
12849
- value: function hasResourceInCache(key) {
12850
- return typeof this.cache[key] !== 'undefined';
12851
- }
12852
- }, {
12853
- key: 'addImage',
12854
- value: function addImage(key, src, useCORS) {
12855
- var _this4 = this;
12856
 
12857
- if (true) {
12858
- this.logger.log('Added image ' + key.substring(0, 256));
12859
- }
12860
 
12861
- var imageLoadHandler = function imageLoadHandler(supportsDataImages) {
12862
- return new Promise(function (resolve, reject) {
12863
- var img = new Image();
12864
- img.onload = function () {
12865
- return resolve(img);
12866
- };
12867
- //ios safari 10.3 taints canvas with data urls unless crossOrigin is set to anonymous
12868
- if (!supportsDataImages || useCORS) {
12869
- img.crossOrigin = 'anonymous';
12870
- }
12871
 
12872
- img.onerror = reject;
12873
- img.src = src;
12874
- if (img.complete === true) {
12875
- // Inline XML images may fail to parse, throwing an Error later on
12876
- setTimeout(function () {
12877
- resolve(img);
12878
- }, 500);
12879
- }
12880
- if (_this4.options.imageTimeout) {
12881
- var timeout = _this4.options.imageTimeout;
12882
- setTimeout(function () {
12883
- return reject( true ? 'Timed out (' + timeout + 'ms) fetching ' + src.substring(0, 256) : '');
12884
- }, timeout);
12885
- }
12886
- });
12887
- };
12888
 
12889
- this.cache[key] = isInlineBase64Image(src) && !isSVG(src) ? // $FlowFixMe
12890
- _Feature2.default.SUPPORT_BASE64_DRAWING(src).then(imageLoadHandler) : imageLoadHandler(true);
12891
- return key;
12892
- }
12893
- }, {
12894
- key: 'isSameOrigin',
12895
- value: function isSameOrigin(url) {
12896
- return this.getOrigin(url) === this.origin;
12897
- }
12898
- }, {
12899
- key: 'getOrigin',
12900
- value: function getOrigin(url) {
12901
- var link = this._link || (this._link = this._window.document.createElement('a'));
12902
- link.href = url;
12903
- link.href = link.href; // IE9, LOL! - http://jsfiddle.net/niklasvh/2e48b/
12904
- return link.protocol + link.hostname + link.port;
12905
- }
12906
- }, {
12907
- key: 'ready',
12908
- value: function ready() {
12909
- var _this5 = this;
12910
 
12911
- var keys = Object.keys(this.cache);
12912
- var values = keys.map(function (str) {
12913
- return _this5.cache[str].catch(function (e) {
12914
- if (true) {
12915
- _this5.logger.log('Unable to load image', e);
12916
- }
12917
- return null;
12918
- });
12919
- });
12920
- return Promise.all(values).then(function (images) {
12921
- if (true) {
12922
- _this5.logger.log('Finished loading ' + images.length + ' images', images);
12923
- }
12924
- return new ResourceStore(keys, images);
12925
- });
12926
- }
12927
- }]);
12928
 
12929
- return ResourceLoader;
12930
- }();
12931
 
12932
- exports.default = ResourceLoader;
 
 
 
 
12933
 
12934
- var ResourceStore = exports.ResourceStore = function () {
12935
- function ResourceStore(keys, resources) {
12936
- _classCallCheck(this, ResourceStore);
 
 
 
 
12937
 
12938
- this._keys = keys;
12939
- this._resources = resources;
12940
- }
 
 
12941
 
12942
- _createClass(ResourceStore, [{
12943
- key: 'get',
12944
- value: function get(key) {
12945
- var index = this._keys.indexOf(key);
12946
- return index === -1 ? null : this._resources[index];
12947
- }
12948
- }]);
12949
 
12950
- return ResourceStore;
12951
- }();
12952
 
12953
- var INLINE_SVG = /^data:image\/svg\+xml/i;
12954
- var INLINE_BASE64 = /^data:image\/.*;base64,/i;
12955
- var INLINE_IMG = /^data:image\/.*/i;
12956
 
12957
- var isInlineImage = function isInlineImage(src) {
12958
- return INLINE_IMG.test(src);
12959
- };
12960
- var isInlineBase64Image = function isInlineBase64Image(src) {
12961
- return INLINE_BASE64.test(src);
12962
- };
12963
- var isBlobImage = function isBlobImage(src) {
12964
- return src.substr(0, 4) === 'blob';
12965
- };
12966
 
12967
- var isSVG = function isSVG(src) {
12968
- return src.substr(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src);
12969
- };
12970
 
12971
- var _loadImage = function _loadImage(src, timeout) {
12972
- return new Promise(function (resolve, reject) {
12973
- var img = new Image();
12974
- img.onload = function () {
12975
- return resolve(img);
12976
- };
12977
- img.onerror = reject;
12978
- img.src = src;
12979
- if (img.complete === true) {
12980
- // Inline XML images may fail to parse, throwing an Error later on
12981
- setTimeout(function () {
12982
- resolve(img);
12983
- }, 500);
12984
- }
12985
- if (timeout) {
12986
- setTimeout(function () {
12987
- return reject( true ? 'Timed out (' + timeout + 'ms) loading image' : '');
12988
- }, timeout);
12989
- }
12990
- });
12991
- };
12992
 
12993
- /***/ }),
12994
- /* 56 */
12995
- /***/ (function(module, exports, __webpack_require__) {
12996
 
12997
- "use strict";
12998
 
 
12999
 
13000
- Object.defineProperty(exports, "__esModule", {
13001
- value: true
13002
- });
13003
- exports.parseContent = exports.resolvePseudoContent = exports.popCounters = exports.parseCounterReset = exports.TOKEN_TYPE = exports.PSEUDO_CONTENT_ITEM_TYPE = undefined;
13004
 
13005
- 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"); } }; }();
13006
 
13007
- var _ListItem = __webpack_require__(14);
13008
 
13009
- var _listStyle = __webpack_require__(8);
13010
 
13011
- var PSEUDO_CONTENT_ITEM_TYPE = exports.PSEUDO_CONTENT_ITEM_TYPE = {
13012
- TEXT: 0,
13013
- IMAGE: 1
13014
  };
13015
 
13016
- var TOKEN_TYPE = exports.TOKEN_TYPE = {
13017
- STRING: 0,
13018
- ATTRIBUTE: 1,
13019
- URL: 2,
13020
- COUNTER: 3,
13021
- COUNTERS: 4,
13022
- OPENQUOTE: 5,
13023
- CLOSEQUOTE: 6
13024
  };
13025
 
13026
- var parseCounterReset = exports.parseCounterReset = function parseCounterReset(style, data) {
13027
- if (!style || !style.counterReset || style.counterReset === 'none') {
13028
- return [];
13029
- }
13030
 
13031
- var counterNames = [];
13032
- var counterResets = style.counterReset.split(/\s*,\s*/);
13033
- var lenCounterResets = counterResets.length;
 
13034
 
13035
- for (var i = 0; i < lenCounterResets; i++) {
13036
- var _counterResets$i$spli = counterResets[i].split(/\s+/),
13037
- _counterResets$i$spli2 = _slicedToArray(_counterResets$i$spli, 2),
13038
- counterName = _counterResets$i$spli2[0],
13039
- initialValue = _counterResets$i$spli2[1];
13040
 
13041
- counterNames.push(counterName);
13042
- var counter = data.counters[counterName];
13043
- if (!counter) {
13044
- counter = data.counters[counterName] = [];
13045
- }
13046
- counter.push(parseInt(initialValue || 0, 10));
13047
- }
13048
 
13049
- return counterNames;
13050
- };
 
 
 
 
13051
 
13052
- var popCounters = exports.popCounters = function popCounters(counterNames, data) {
13053
- var lenCounters = counterNames.length;
13054
- for (var i = 0; i < lenCounters; i++) {
13055
- data.counters[counterNames[i]].pop();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13056
  }
13057
- };
13058
 
13059
- var resolvePseudoContent = exports.resolvePseudoContent = function resolvePseudoContent(node, style, data) {
13060
- if (!style || !style.content || style.content === 'none' || style.content === '-moz-alt-content' || style.display === 'none') {
13061
- return null;
 
 
 
13062
  }
13063
 
13064
- var tokens = parseContent(style.content);
 
 
 
 
 
 
13065
 
13066
- var len = tokens.length;
13067
- var contentItems = [];
13068
- var s = '';
 
 
 
 
13069
 
13070
- // increment the counter (if there is a "counter-increment" declaration)
13071
- var counterIncrement = style.counterIncrement;
13072
- if (counterIncrement && counterIncrement !== 'none') {
13073
- var _counterIncrement$spl = counterIncrement.split(/\s+/),
13074
- _counterIncrement$spl2 = _slicedToArray(_counterIncrement$spl, 2),
13075
- counterName = _counterIncrement$spl2[0],
13076
- incrementValue = _counterIncrement$spl2[1];
 
 
 
 
 
 
 
 
 
13077
 
13078
- var counter = data.counters[counterName];
13079
- if (counter) {
13080
- counter[counter.length - 1] += incrementValue === undefined ? 1 : parseInt(incrementValue, 10);
13081
- }
13082
- }
13083
 
13084
- // build the content string
13085
- for (var i = 0; i < len; i++) {
13086
- var token = tokens[i];
13087
- switch (token.type) {
13088
- case TOKEN_TYPE.STRING:
13089
- s += token.value || '';
13090
- break;
13091
 
13092
- case TOKEN_TYPE.ATTRIBUTE:
13093
- if (node instanceof HTMLElement && token.value) {
13094
- s += node.getAttribute(token.value) || '';
13095
- }
13096
- break;
13097
 
13098
- case TOKEN_TYPE.COUNTER:
13099
- var _counter = data.counters[token.name || ''];
13100
- if (_counter) {
13101
- s += formatCounterValue([_counter[_counter.length - 1]], '', token.format);
13102
- }
13103
- break;
13104
 
13105
- case TOKEN_TYPE.COUNTERS:
13106
- var _counters = data.counters[token.name || ''];
13107
- if (_counters) {
13108
- s += formatCounterValue(_counters, token.glue, token.format);
13109
- }
13110
- break;
13111
 
13112
- case TOKEN_TYPE.OPENQUOTE:
13113
- s += getQuote(style, true, data.quoteDepth);
13114
- data.quoteDepth++;
13115
- break;
13116
 
13117
- case TOKEN_TYPE.CLOSEQUOTE:
13118
- data.quoteDepth--;
13119
- s += getQuote(style, false, data.quoteDepth);
13120
- break;
13121
 
13122
- case TOKEN_TYPE.URL:
13123
- if (s) {
13124
- contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.TEXT, value: s });
13125
- s = '';
13126
- }
13127
- contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.IMAGE, value: token.value || '' });
13128
- break;
13129
- }
13130
- }
13131
 
13132
- if (s) {
13133
- contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.TEXT, value: s });
13134
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13135
 
13136
- return contentItems;
 
 
 
 
 
13137
  };
13138
 
13139
- var parseContent = exports.parseContent = function parseContent(content, cache) {
13140
- if (cache && cache[content]) {
13141
- return cache[content];
13142
- }
13143
 
13144
- var tokens = [];
13145
- var len = content.length;
13146
 
13147
- var isString = false;
13148
- var isEscaped = false;
13149
- var isFunction = false;
13150
- var str = '';
13151
- var functionName = '';
13152
- var args = [];
13153
 
13154
- for (var i = 0; i < len; i++) {
13155
- var c = content.charAt(i);
13156
 
13157
- switch (c) {
13158
- case "'":
13159
- case '"':
13160
- if (isEscaped) {
13161
- str += c;
13162
- } else {
13163
- isString = !isString;
13164
- if (!isFunction && !isString) {
13165
- tokens.push({ type: TOKEN_TYPE.STRING, value: str });
13166
- str = '';
13167
- }
13168
- }
13169
- break;
13170
 
13171
- case '\\':
13172
- if (isEscaped) {
13173
- str += c;
13174
- isEscaped = false;
13175
- } else {
13176
- isEscaped = true;
13177
- }
13178
- break;
13179
 
13180
- case '(':
13181
- if (isString) {
13182
- str += c;
13183
- } else {
13184
- isFunction = true;
13185
- functionName = str;
13186
- str = '';
13187
- args = [];
13188
- }
13189
- break;
13190
 
13191
- case ')':
13192
- if (isString) {
13193
- str += c;
13194
- } else if (isFunction) {
13195
- if (str) {
13196
- args.push(str);
13197
- }
13198
 
13199
- switch (functionName) {
13200
- case 'attr':
13201
- if (args.length > 0) {
13202
- tokens.push({ type: TOKEN_TYPE.ATTRIBUTE, value: args[0] });
13203
- }
13204
- break;
13205
 
13206
- case 'counter':
13207
- if (args.length > 0) {
13208
- var counter = {
13209
- type: TOKEN_TYPE.COUNTER,
13210
- name: args[0]
13211
- };
13212
- if (args.length > 1) {
13213
- counter.format = args[1];
13214
- }
13215
- tokens.push(counter);
13216
- }
13217
- break;
13218
 
13219
- case 'counters':
13220
- if (args.length > 0) {
13221
- var _counters2 = {
13222
- type: TOKEN_TYPE.COUNTERS,
13223
- name: args[0]
13224
- };
13225
- if (args.length > 1) {
13226
- _counters2.glue = args[1];
13227
- }
13228
- if (args.length > 2) {
13229
- _counters2.format = args[2];
13230
- }
13231
- tokens.push(_counters2);
13232
- }
13233
- break;
13234
 
13235
- case 'url':
13236
- if (args.length > 0) {
13237
- tokens.push({ type: TOKEN_TYPE.URL, value: args[0] });
13238
- }
13239
- break;
13240
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13241
 
13242
- isFunction = false;
13243
- str = '';
13244
- }
13245
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
13246
 
13247
- case ',':
13248
- if (isString) {
13249
- str += c;
13250
- } else if (isFunction) {
13251
- args.push(str);
13252
- str = '';
13253
- }
13254
- break;
13255
 
13256
- case ' ':
13257
- case '\t':
13258
- if (isString) {
13259
- str += c;
13260
- } else if (str) {
13261
- addOtherToken(tokens, str);
13262
- str = '';
13263
- }
13264
- break;
13265
 
13266
- default:
13267
- str += c;
13268
- }
13269
 
13270
- if (c !== '\\') {
13271
- isEscaped = false;
13272
- }
13273
- }
13274
 
13275
- if (str) {
13276
- addOtherToken(tokens, str);
13277
- }
 
 
 
 
 
 
 
 
13278
 
13279
- if (cache) {
13280
- cache[content] = tokens;
13281
- }
13282
 
13283
- return tokens;
13284
- };
13285
 
13286
- var addOtherToken = function addOtherToken(tokens, identifier) {
13287
- switch (identifier) {
13288
- case 'open-quote':
13289
- tokens.push({ type: TOKEN_TYPE.OPENQUOTE });
13290
- break;
13291
- case 'close-quote':
13292
- tokens.push({ type: TOKEN_TYPE.CLOSEQUOTE });
13293
- break;
13294
- }
13295
- };
13296
 
13297
- var getQuote = function getQuote(style, isOpening, quoteDepth) {
13298
- var quotes = style.quotes ? style.quotes.split(/\s+/) : ["'\"'", "'\"'"];
13299
- var idx = quoteDepth * 2;
13300
- if (idx >= quotes.length) {
13301
- idx = quotes.length - 2;
13302
- }
13303
- if (!isOpening) {
13304
- ++idx;
13305
- }
13306
- return quotes[idx].replace(/^["']|["']$/g, '');
13307
- };
13308
 
13309
- var formatCounterValue = function formatCounterValue(counter, glue, format) {
13310
- var len = counter.length;
13311
- var result = '';
13312
 
13313
- for (var i = 0; i < len; i++) {
13314
- if (i > 0) {
13315
- result += glue || '';
13316
- }
13317
- result += (0, _ListItem.createCounterText)(counter[i], (0, _listStyle.parseListStyleType)(format || 'decimal'), false);
13318
- }
13319
 
13320
- return result;
13321
- };
13322
 
13323
- /***/ })
13324
- /******/ ]);
13325
- });
13326
 
13327
- /***/ }),
13328
 
13329
- /***/ 474:
13330
- /***/ (function(module, exports, __webpack_require__) {
13331
 
13332
- /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Backbone.js 1.3.3
13333
 
13334
- // (c) 2010-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
13335
- // Backbone may be freely distributed under the MIT license.
13336
- // For all details and documentation:
13337
- // http://backbonejs.org
13338
 
13339
- (function(factory) {
13340
 
13341
- // Establish the root object, `window` (`self`) in the browser, or `global` on the server.
13342
- // We use `self` instead of `window` for `WebWorker` support.
13343
- var root = (typeof self == 'object' && self.self === self && self) ||
13344
- (typeof global == 'object' && global.global === global && global);
13345
 
13346
- // Set up Backbone appropriately for the environment. Start with AMD.
13347
- if (true) {
13348
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(7), __webpack_require__(9), exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function(_, $, exports) {
13349
- // Export global even in AMD case in case this script is loaded with
13350
- // others that may still expect a global Backbone.
13351
- root.Backbone = factory(root, exports, _, $);
13352
- }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
13353
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
13354
 
13355
- // Next for Node.js or CommonJS. jQuery may not be needed as a module.
13356
- } else if (typeof exports !== 'undefined') {
13357
- var _ = require('underscore'), $;
13358
- try { $ = require('jquery'); } catch (e) {}
13359
- factory(root, exports, _, $);
13360
 
13361
- // Finally, as a browser global.
13362
- } else {
13363
- root.Backbone = factory(root, {}, root._, (root.jQuery || root.Zepto || root.ender || root.$));
13364
- }
13365
 
13366
- })(function(root, Backbone, _, $) {
 
 
 
 
 
13367
 
13368
- // Initial Setup
13369
- // -------------
13370
 
13371
- // Save the previous value of the `Backbone` variable, so that it can be
13372
- // restored later on, if `noConflict` is used.
13373
- var previousBackbone = root.Backbone;
 
 
 
 
 
 
 
 
 
 
 
13374
 
13375
- // Create a local reference to a common array method we'll want to use later.
13376
- var slice = Array.prototype.slice;
13377
 
13378
- // Current version of the library. Keep in sync with `package.json`.
13379
- Backbone.VERSION = '1.3.3';
13380
 
13381
- // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
13382
- // the `$` variable.
13383
- Backbone.$ = $;
13384
 
13385
- // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
13386
- // to its previous owner. Returns a reference to this Backbone object.
13387
- Backbone.noConflict = function() {
13388
- root.Backbone = previousBackbone;
13389
- return this;
13390
- };
13391
 
13392
- // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
13393
- // will fake `"PATCH"`, `"PUT"` and `"DELETE"` requests via the `_method` parameter and
13394
- // set a `X-Http-Method-Override` header.
13395
- Backbone.emulateHTTP = false;
13396
 
13397
- // Turn on `emulateJSON` to support legacy servers that can't deal with direct
13398
- // `application/json` requests ... this will encode the body as
13399
- // `application/x-www-form-urlencoded` instead and will send the model in a
13400
- // form param named `model`.
13401
- Backbone.emulateJSON = false;
13402
 
13403
- // Proxy Backbone class methods to Underscore functions, wrapping the model's
13404
- // `attributes` object or collection's `models` array behind the scenes.
13405
- //
13406
- // collection.filter(function(model) { return model.get('age') > 10 });
13407
- // collection.each(this.addView);
13408
- //
13409
- // `Function#apply` can be slow so we use the method's arg count, if we know it.
13410
- var addMethod = function(length, method, attribute) {
13411
- switch (length) {
13412
- case 1: return function() {
13413
- return _[method](this[attribute]);
13414
- };
13415
- case 2: return function(value) {
13416
- return _[method](this[attribute], value);
13417
- };
13418
- case 3: return function(iteratee, context) {
13419
- return _[method](this[attribute], cb(iteratee, this), context);
13420
- };
13421
- case 4: return function(iteratee, defaultVal, context) {
13422
- return _[method](this[attribute], cb(iteratee, this), defaultVal, context);
13423
- };
13424
- default: return function() {
13425
- var args = slice.call(arguments);
13426
- args.unshift(this[attribute]);
13427
- return _[method].apply(_, args);
13428
- };
13429
- }
13430
- };
13431
- var addUnderscoreMethods = function(Class, methods, attribute) {
13432
- _.each(methods, function(length, method) {
13433
- if (_[method]) Class.prototype[method] = addMethod(length, method, attribute);
13434
- });
13435
- };
13436
 
13437
- // Support `collection.sortBy('attr')` and `collection.findWhere({id: 1})`.
13438
- var cb = function(iteratee, instance) {
13439
- if (_.isFunction(iteratee)) return iteratee;
13440
- if (_.isObject(iteratee) && !instance._isModel(iteratee)) return modelMatcher(iteratee);
13441
- if (_.isString(iteratee)) return function(model) { return model.get(iteratee); };
13442
- return iteratee;
13443
- };
13444
- var modelMatcher = function(attrs) {
13445
- var matcher = _.matches(attrs);
13446
- return function(model) {
13447
- return matcher(model.attributes);
13448
- };
13449
- };
13450
 
13451
- // Backbone.Events
13452
- // ---------------
13453
 
13454
- // A module that can be mixed in to *any object* in order to provide it with
13455
- // a custom event channel. You may bind a callback to an event with `on` or
13456
- // remove with `off`; `trigger`-ing an event fires all callbacks in
13457
- // succession.
13458
- //
13459
- // var object = {};
13460
- // _.extend(object, Backbone.Events);
13461
- // object.on('expand', function(){ alert('expanded'); });
13462
- // object.trigger('expand');
13463
- //
13464
- var Events = Backbone.Events = {};
13465
 
13466
- // Regular expression used to split event strings.
13467
- var eventSplitter = /\s+/;
13468
 
13469
- // Iterates over the standard `event, callback` (as well as the fancy multiple
13470
- // space-separated events `"change blur", callback` and jQuery-style event
13471
- // maps `{event: callback}`).
13472
- var eventsApi = function(iteratee, events, name, callback, opts) {
13473
- var i = 0, names;
13474
- if (name && typeof name === 'object') {
13475
- // Handle event maps.
13476
- if (callback !== void 0 && 'context' in opts && opts.context === void 0) opts.context = callback;
13477
- for (names = _.keys(name); i < names.length ; i++) {
13478
- events = eventsApi(iteratee, events, names[i], name[names[i]], opts);
13479
- }
13480
- } else if (name && eventSplitter.test(name)) {
13481
- // Handle space-separated event names by delegating them individually.
13482
- for (names = name.split(eventSplitter); i < names.length; i++) {
13483
- events = iteratee(events, names[i], callback, opts);
13484
- }
13485
- } else {
13486
- // Finally, standard events.
13487
- events = iteratee(events, name, callback, opts);
13488
- }
13489
- return events;
13490
- };
13491
 
13492
- // Bind an event to a `callback` function. Passing `"all"` will bind
13493
- // the callback to all events fired.
13494
- Events.on = function(name, callback, context) {
13495
- return internalOn(this, name, callback, context);
13496
- };
13497
 
13498
- // Guard the `listening` argument from the public API.
13499
- var internalOn = function(obj, name, callback, context, listening) {
13500
- obj._events = eventsApi(onApi, obj._events || {}, name, callback, {
13501
- context: context,
13502
- ctx: obj,
13503
- listening: listening
13504
- });
13505
 
13506
- if (listening) {
13507
- var listeners = obj._listeners || (obj._listeners = {});
13508
- listeners[listening.id] = listening;
13509
- }
13510
 
13511
- return obj;
13512
- };
13513
 
13514
- // Inversion-of-control versions of `on`. Tell *this* object to listen to
13515
- // an event in another object... keeping track of what it's listening to
13516
- // for easier unbinding later.
13517
- Events.listenTo = function(obj, name, callback) {
13518
- if (!obj) return this;
13519
- var id = obj._listenId || (obj._listenId = _.uniqueId('l'));
13520
- var listeningTo = this._listeningTo || (this._listeningTo = {});
13521
- var listening = listeningTo[id];
13522
 
13523
- // This object is not listening to any other events on `obj` yet.
13524
- // Setup the necessary references to track the listening callbacks.
13525
- if (!listening) {
13526
- var thisId = this._listenId || (this._listenId = _.uniqueId('l'));
13527
- listening = listeningTo[id] = {obj: obj, objId: id, id: thisId, listeningTo: listeningTo, count: 0};
13528
- }
13529
 
13530
- // Bind callbacks on obj, and keep track of them on listening.
13531
- internalOn(obj, name, callback, this, listening);
13532
- return this;
13533
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13534
 
13535
- // The reducing API that adds a callback to the `events` object.
13536
- var onApi = function(events, name, callback, options) {
13537
- if (callback) {
13538
- var handlers = events[name] || (events[name] = []);
13539
- var context = options.context, ctx = options.ctx, listening = options.listening;
13540
- if (listening) listening.count++;
13541
 
13542
- handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening});
 
 
 
13543
  }
13544
- return events;
13545
- };
 
 
 
13546
 
13547
- // Remove one or many callbacks. If `context` is null, removes all
13548
- // callbacks with that function. If `callback` is null, removes all
13549
- // callbacks for the event. If `name` is null, removes all bound
13550
- // callbacks for all events.
13551
- Events.off = function(name, callback, context) {
13552
- if (!this._events) return this;
13553
- this._events = eventsApi(offApi, this._events, name, callback, {
13554
- context: context,
13555
- listeners: this._listeners
13556
- });
13557
- return this;
13558
- };
13559
-
13560
- // Tell this object to stop listening to either specific events ... or
13561
- // to every object it's currently listening to.
13562
- Events.stopListening = function(obj, name, callback) {
13563
- var listeningTo = this._listeningTo;
13564
- if (!listeningTo) return this;
13565
 
13566
- var ids = obj ? [obj._listenId] : _.keys(listeningTo);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13567
 
13568
- for (var i = 0; i < ids.length; i++) {
13569
- var listening = listeningTo[ids[i]];
 
 
 
 
 
 
 
 
 
 
13570
 
13571
- // If listening doesn't exist, this object is not currently
13572
- // listening to obj. Break out early.
13573
- if (!listening) break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13574
 
13575
- listening.obj.off(name, callback, this);
13576
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13577
 
13578
- return this;
13579
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13580
 
13581
- // The reducing API that removes a callback from the `events` object.
13582
- var offApi = function(events, name, callback, options) {
13583
- if (!events) return;
 
 
 
 
 
 
 
 
 
 
 
 
 
13584
 
13585
- var i = 0, listening;
13586
- var context = options.context, listeners = options.listeners;
13587
 
13588
- // Delete all events listeners and "drop" events.
13589
- if (!name && !callback && !context) {
13590
- var ids = _.keys(listeners);
13591
- for (; i < ids.length; i++) {
13592
- listening = listeners[ids[i]];
13593
- delete listeners[listening.id];
13594
- delete listening.listeningTo[listening.objId];
13595
  }
13596
- return;
13597
- }
 
 
 
13598
 
13599
- var names = name ? [name] : _.keys(events);
13600
- for (; i < names.length; i++) {
13601
- name = names[i];
13602
- var handlers = events[name];
13603
 
13604
- // Bail out if there are no events stored.
13605
- if (!handlers) break;
13606
 
13607
- // Replace events if there are any remaining. Otherwise, clean up.
13608
- var remaining = [];
13609
- for (var j = 0; j < handlers.length; j++) {
13610
- var handler = handlers[j];
13611
- if (
13612
- callback && callback !== handler.callback &&
13613
- callback !== handler.callback._callback ||
13614
- context && context !== handler.context
13615
- ) {
13616
- remaining.push(handler);
13617
- } else {
13618
- listening = handler.listening;
13619
- if (listening && --listening.count === 0) {
13620
- delete listeners[listening.id];
13621
- delete listening.listeningTo[listening.objId];
13622
- }
13623
- }
13624
- }
13625
 
13626
- // Update tail event if the list has any events. Otherwise, clean up.
13627
- if (remaining.length) {
13628
- events[name] = remaining;
13629
- } else {
13630
- delete events[name];
13631
- }
13632
- }
13633
- return events;
13634
- };
13635
 
13636
- // Bind an event to only be triggered a single time. After the first time
13637
- // the callback is invoked, its listener will be removed. If multiple events
13638
- // are passed in using the space-separated syntax, the handler will fire
13639
- // once for each event, not once for a combination of all events.
13640
- Events.once = function(name, callback, context) {
13641
- // Map the event into a `{event: once}` object.
13642
- var events = eventsApi(onceMap, {}, name, callback, _.bind(this.off, this));
13643
- if (typeof name === 'string' && context == null) callback = void 0;
13644
- return this.on(events, callback, context);
13645
- };
13646
 
13647
- // Inversion-of-control versions of `once`.
13648
- Events.listenToOnce = function(obj, name, callback) {
13649
- // Map the event into a `{event: once}` object.
13650
- var events = eventsApi(onceMap, {}, name, callback, _.bind(this.stopListening, this, obj));
13651
- return this.listenTo(obj, events);
13652
- };
13653
 
13654
- // Reduces the event callbacks into a map of `{event: onceWrapper}`.
13655
- // `offer` unbinds the `onceWrapper` after it has been called.
13656
- var onceMap = function(map, name, callback, offer) {
13657
- if (callback) {
13658
- var once = map[name] = _.once(function() {
13659
- offer(name, once);
13660
- callback.apply(this, arguments);
13661
- });
13662
- once._callback = callback;
13663
  }
13664
- return map;
13665
- };
13666
 
13667
- // Trigger one or many events, firing all bound callbacks. Callbacks are
13668
- // passed the same arguments as `trigger` is, apart from the event name
13669
- // (unless you're listening on `"all"`, which will cause your callback to
13670
- // receive the true name of the event as the first argument).
13671
- Events.trigger = function(name) {
13672
- if (!this._events) return this;
13673
 
13674
- var length = Math.max(0, arguments.length - 1);
13675
- var args = Array(length);
13676
- for (var i = 0; i < length; i++) args[i] = arguments[i + 1];
13677
 
13678
- eventsApi(triggerApi, this._events, name, void 0, args);
13679
- return this;
13680
- };
 
 
 
 
13681
 
13682
- // Handles triggering the appropriate event callbacks.
13683
- var triggerApi = function(objEvents, name, callback, args) {
13684
- if (objEvents) {
13685
- var events = objEvents[name];
13686
- var allEvents = objEvents.all;
13687
- if (events && allEvents) allEvents = allEvents.slice();
13688
- if (events) triggerEvents(events, args);
13689
- if (allEvents) triggerEvents(allEvents, [name].concat(args));
13690
  }
13691
- return objEvents;
13692
- };
13693
 
13694
- // A difficult-to-believe, but optimized internal dispatch function for
13695
- // triggering events. Tries to keep the usual cases speedy (most internal
13696
- // Backbone events have 3 arguments).
13697
- var triggerEvents = function(events, args) {
13698
- var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
13699
- switch (args.length) {
13700
- case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;
13701
- case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;
13702
- case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;
13703
- case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;
13704
- default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;
13705
- }
13706
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13707
 
13708
- // Aliases for backwards compatibility.
13709
- Events.bind = Events.on;
13710
- Events.unbind = Events.off;
13711
 
13712
- // Allow the `Backbone` object to serve as a global event bus, for folks who
13713
- // want global "pubsub" in a convenient place.
13714
- _.extend(Backbone, Events);
13715
 
13716
- // Backbone.Model
13717
- // --------------
13718
 
13719
- // Backbone **Models** are the basic data object in the framework --
13720
- // frequently representing a row in a table in a database on your server.
13721
- // A discrete chunk of data and a bunch of useful, related methods for
13722
- // performing computations and transformations on that data.
13723
 
13724
- // Create a new model with the specified attributes. A client id (`cid`)
13725
- // is automatically generated and assigned for you.
13726
- var Model = Backbone.Model = function(attributes, options) {
13727
- var attrs = attributes || {};
13728
- options || (options = {});
13729
- this.cid = _.uniqueId(this.cidPrefix);
13730
- this.attributes = {};
13731
- if (options.collection) this.collection = options.collection;
13732
- if (options.parse) attrs = this.parse(attrs, options) || {};
13733
- var defaults = _.result(this, 'defaults');
13734
- attrs = _.defaults(_.extend({}, defaults, attrs), defaults);
13735
- this.set(attrs, options);
13736
- this.changed = {};
13737
- this.initialize.apply(this, arguments);
13738
- };
13739
 
13740
- // Attach all inheritable methods to the Model prototype.
13741
- _.extend(Model.prototype, Events, {
13742
 
13743
- // A hash of attributes whose current and previous value differ.
13744
- changed: null,
13745
 
13746
- // The value returned during the last failed validation.
13747
- validationError: null,
13748
 
13749
- // The default name for the JSON `id` attribute is `"id"`. MongoDB and
13750
- // CouchDB users may want to set this to `"_id"`.
13751
- idAttribute: 'id',
13752
 
13753
- // The prefix is used to create the client id which is used to identify models locally.
13754
- // You may want to override this if you're experiencing name clashes with model ids.
13755
- cidPrefix: 'c',
13756
 
13757
- // Initialize is an empty function by default. Override it with your own
13758
- // initialization logic.
13759
- initialize: function(){},
13760
 
13761
- // Return a copy of the model's `attributes` object.
13762
- toJSON: function(options) {
13763
- return _.clone(this.attributes);
13764
- },
13765
 
13766
- // Proxy `Backbone.sync` by default -- but override this if you need
13767
- // custom syncing semantics for *this* particular model.
13768
- sync: function() {
13769
- return Backbone.sync.apply(this, arguments);
13770
- },
13771
 
13772
- // Get the value of an attribute.
13773
- get: function(attr) {
13774
- return this.attributes[attr];
13775
- },
13776
 
13777
- // Get the HTML-escaped value of an attribute.
13778
- escape: function(attr) {
13779
- return _.escape(this.get(attr));
13780
- },
13781
 
13782
- // Returns `true` if the attribute contains a value that is not null
13783
- // or undefined.
13784
- has: function(attr) {
13785
- return this.get(attr) != null;
13786
- },
13787
 
13788
- // Special-cased proxy to underscore's `_.matches` method.
13789
- matches: function(attrs) {
13790
- return !!_.iteratee(attrs, this)(this.attributes);
13791
- },
13792
-
13793
- // Set a hash of model attributes on the object, firing `"change"`. This is
13794
- // the core primitive operation of a model, updating the data and notifying
13795
- // anyone who needs to know about the change in state. The heart of the beast.
13796
- set: function(key, val, options) {
13797
- if (key == null) return this;
13798
-
13799
- // Handle both `"key", value` and `{key: value}` -style arguments.
13800
- var attrs;
13801
- if (typeof key === 'object') {
13802
- attrs = key;
13803
- options = val;
13804
- } else {
13805
- (attrs = {})[key] = val;
13806
- }
13807
 
13808
- options || (options = {});
13809
 
13810
- // Run validation.
13811
- if (!this._validate(attrs, options)) return false;
13812
 
13813
- // Extract attributes and options.
13814
- var unset = options.unset;
13815
- var silent = options.silent;
13816
- var changes = [];
13817
- var changing = this._changing;
13818
- this._changing = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13819
 
13820
- if (!changing) {
13821
- this._previousAttributes = _.clone(this.attributes);
13822
- this.changed = {};
13823
- }
 
 
 
 
 
 
 
 
 
 
13824
 
13825
- var current = this.attributes;
13826
- var changed = this.changed;
13827
- var prev = this._previousAttributes;
 
13828
 
13829
- // For each `set` attribute, update or delete the current value.
13830
- for (var attr in attrs) {
13831
- val = attrs[attr];
13832
- if (!_.isEqual(current[attr], val)) changes.push(attr);
13833
- if (!_.isEqual(prev[attr], val)) {
13834
- changed[attr] = val;
13835
- } else {
13836
- delete changed[attr];
13837
  }
13838
- unset ? delete current[attr] : current[attr] = val;
13839
- }
13840
-
13841
- // Update the `id`.
13842
- if (this.idAttribute in attrs) this.id = this.get(this.idAttribute);
13843
 
13844
- // Trigger all relevant attribute changes.
13845
- if (!silent) {
13846
- if (changes.length) this._pending = options;
13847
- for (var i = 0; i < changes.length; i++) {
13848
- this.trigger('change:' + changes[i], this, current[changes[i]], options);
13849
- }
13850
- }
 
 
 
13851
 
13852
- // You might be wondering why there's a `while` loop here. Changes can
13853
- // be recursively nested within `"change"` events.
13854
- if (changing) return this;
13855
- if (!silent) {
13856
- while (this._pending) {
13857
- options = this._pending;
13858
- this._pending = false;
13859
- this.trigger('change', this, options);
13860
- }
13861
- }
13862
- this._pending = false;
13863
- this._changing = false;
13864
- return this;
13865
- },
13866
 
13867
- // Remove an attribute from the model, firing `"change"`. `unset` is a noop
13868
- // if the attribute doesn't exist.
13869
- unset: function(attr, options) {
13870
- return this.set(attr, void 0, _.extend({}, options, {unset: true}));
13871
- },
 
 
13872
 
13873
- // Clear all attributes on the model, firing `"change"`.
13874
- clear: function(options) {
13875
- var attrs = {};
13876
- for (var key in this.attributes) attrs[key] = void 0;
13877
- return this.set(attrs, _.extend({}, options, {unset: true}));
13878
- },
13879
 
13880
- // Determine if the model has changed since the last `"change"` event.
13881
- // If you specify an attribute name, determine if that attribute has changed.
13882
- hasChanged: function(attr) {
13883
- if (attr == null) return !_.isEmpty(this.changed);
13884
- return _.has(this.changed, attr);
13885
- },
13886
 
13887
- // Return an object containing all the attributes that have changed, or
13888
- // false if there are no changed attributes. Useful for determining what
13889
- // parts of a view need to be updated and/or what attributes need to be
13890
- // persisted to the server. Unset attributes will be set to undefined.
13891
- // You can also pass an attributes object to diff against the model,
13892
- // determining if there *would be* a change.
13893
- changedAttributes: function(diff) {
13894
- if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
13895
- var old = this._changing ? this._previousAttributes : this.attributes;
13896
- var changed = {};
13897
- for (var attr in diff) {
13898
- var val = diff[attr];
13899
- if (_.isEqual(old[attr], val)) continue;
13900
- changed[attr] = val;
13901
- }
13902
- return _.size(changed) ? changed : false;
13903
- },
13904
 
13905
- // Get the previous value of an attribute, recorded at the time the last
13906
- // `"change"` event was fired.
13907
- previous: function(attr) {
13908
- if (attr == null || !this._previousAttributes) return null;
13909
- return this._previousAttributes[attr];
13910
- },
 
 
 
 
 
13911
 
13912
- // Get all of the attributes of the model at the time of the previous
13913
- // `"change"` event.
13914
- previousAttributes: function() {
13915
- return _.clone(this._previousAttributes);
13916
- },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13917
 
13918
- // Fetch the model from the server, merging the response with the model's
13919
- // local attributes. Any changed attributes will trigger a "change" event.
13920
- fetch: function(options) {
13921
- options = _.extend({parse: true}, options);
13922
- var model = this;
13923
- var success = options.success;
13924
- options.success = function(resp) {
13925
- var serverAttrs = options.parse ? model.parse(resp, options) : resp;
13926
- if (!model.set(serverAttrs, options)) return false;
13927
- if (success) success.call(options.context, model, resp, options);
13928
- model.trigger('sync', model, resp, options);
13929
- };
13930
- wrapError(this, options);
13931
- return this.sync('read', this, options);
13932
- },
13933
 
13934
- // Set a hash of model attributes, and sync the model to the server.
13935
- // If the server returns an attributes hash that differs, the model's
13936
- // state will be `set` again.
13937
- save: function(key, val, options) {
13938
- // Handle both `"key", value` and `{key: value}` -style arguments.
13939
- var attrs;
13940
- if (key == null || typeof key === 'object') {
13941
- attrs = key;
13942
- options = val;
13943
- } else {
13944
- (attrs = {})[key] = val;
13945
- }
13946
 
13947
- options = _.extend({validate: true, parse: true}, options);
13948
- var wait = options.wait;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13949
 
13950
- // If we're not waiting and attributes exist, save acts as
13951
- // `set(attr).save(null, opts)` with validation. Otherwise, check if
13952
- // the model will be valid when the attributes, if any, are set.
13953
- if (attrs && !wait) {
13954
- if (!this.set(attrs, options)) return false;
13955
- } else if (!this._validate(attrs, options)) {
13956
- return false;
13957
- }
13958
 
13959
- // After a successful server-side save, the client is (optionally)
13960
- // updated with the server-side state.
13961
- var model = this;
13962
- var success = options.success;
13963
- var attributes = this.attributes;
13964
- options.success = function(resp) {
13965
- // Ensure attributes are restored during synchronous saves.
13966
- model.attributes = attributes;
13967
- var serverAttrs = options.parse ? model.parse(resp, options) : resp;
13968
- if (wait) serverAttrs = _.extend({}, attrs, serverAttrs);
13969
- if (serverAttrs && !model.set(serverAttrs, options)) return false;
13970
- if (success) success.call(options.context, model, resp, options);
13971
- model.trigger('sync', model, resp, options);
13972
- };
13973
- wrapError(this, options);
13974
 
13975
- // Set temporary attributes if `{wait: true}` to properly find new ids.
13976
- if (attrs && wait) this.attributes = _.extend({}, attributes, attrs);
13977
 
13978
- var method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
13979
- if (method === 'patch' && !options.attrs) options.attrs = attrs;
13980
- var xhr = this.sync(method, this, options);
13981
 
13982
- // Restore attributes.
13983
- this.attributes = attributes;
13984
 
13985
- return xhr;
13986
- },
13987
 
13988
- // Destroy this model on the server if it was already persisted.
13989
- // Optimistically removes the model from its collection, if it has one.
13990
- // If `wait: true` is passed, waits for the server to respond before removal.
13991
- destroy: function(options) {
13992
- options = options ? _.clone(options) : {};
13993
- var model = this;
13994
- var success = options.success;
13995
- var wait = options.wait;
13996
 
13997
- var destroy = function() {
13998
- model.stopListening();
13999
- model.trigger('destroy', model, model.collection, options);
14000
- };
14001
 
14002
- options.success = function(resp) {
14003
- if (wait) destroy();
14004
- if (success) success.call(options.context, model, resp, options);
14005
- if (!model.isNew()) model.trigger('sync', model, resp, options);
14006
- };
14007
 
14008
- var xhr = false;
14009
- if (this.isNew()) {
14010
- _.defer(options.success);
14011
- } else {
14012
- wrapError(this, options);
14013
- xhr = this.sync('delete', this, options);
14014
- }
14015
- if (!wait) destroy();
14016
- return xhr;
14017
- },
14018
 
14019
- // Default URL for the model's representation on the server -- if you're
14020
- // using Backbone's restful methods, override this to change the endpoint
14021
- // that will be called.
14022
- url: function() {
14023
- var base =
14024
- _.result(this, 'urlRoot') ||
14025
- _.result(this.collection, 'url') ||
14026
- urlError();
14027
- if (this.isNew()) return base;
14028
- var id = this.get(this.idAttribute);
14029
- return base.replace(/[^\/]$/, '$&/') + encodeURIComponent(id);
14030
- },
14031
 
14032
- // **parse** converts a response into the hash of attributes to be `set` on
14033
- // the model. The default implementation is just to pass the response along.
14034
- parse: function(resp, options) {
14035
- return resp;
14036
- },
14037
 
14038
- // Create a new model with identical attributes to this one.
14039
- clone: function() {
14040
- return new this.constructor(this.attributes);
14041
- },
14042
 
14043
- // A model is new if it has never been saved to the server, and lacks an id.
14044
- isNew: function() {
14045
- return !this.has(this.idAttribute);
14046
- },
14047
 
14048
- // Check if the model is currently in a valid state.
14049
- isValid: function(options) {
14050
- return this._validate({}, _.extend({}, options, {validate: true}));
14051
- },
14052
 
14053
- // Run validation against the next complete set of model attributes,
14054
- // returning `true` if all is well. Otherwise, fire an `"invalid"` event.
14055
- _validate: function(attrs, options) {
14056
- if (!options.validate || !this.validate) return true;
14057
- attrs = _.extend({}, this.attributes, attrs);
14058
- var error = this.validationError = this.validate(attrs, options) || null;
14059
- if (!error) return true;
14060
- this.trigger('invalid', this, error, _.extend(options, {validationError: error}));
14061
- return false;
14062
- }
14063
 
14064
- });
14065
 
14066
- // Underscore methods that we want to implement on the Model, mapped to the
14067
- // number of arguments they take.
14068
- var modelMethods = {keys: 1, values: 1, pairs: 1, invert: 1, pick: 0,
14069
- omit: 0, chain: 1, isEmpty: 1};
14070
 
14071
- // Mix in each Underscore method as a proxy to `Model#attributes`.
14072
- addUnderscoreMethods(Model, modelMethods, 'attributes');
14073
 
14074
- // Backbone.Collection
14075
- // -------------------
14076
 
14077
- // If models tend to represent a single row of data, a Backbone Collection is
14078
- // more analogous to a table full of data ... or a small slice or page of that
14079
- // table, or a collection of rows that belong together for a particular reason
14080
- // -- all of the messages in this particular folder, all of the documents
14081
- // belonging to this particular author, and so on. Collections maintain
14082
- // indexes of their models, both in order, and for lookup by `id`.
14083
 
14084
- // Create a new **Collection**, perhaps to contain a specific type of `model`.
14085
- // If a `comparator` is specified, the Collection will maintain
14086
- // its models in sort order, as they're added and removed.
14087
- var Collection = Backbone.Collection = function(models, options) {
14088
- options || (options = {});
14089
- if (options.model) this.model = options.model;
14090
- if (options.comparator !== void 0) this.comparator = options.comparator;
14091
- this._reset();
14092
- this.initialize.apply(this, arguments);
14093
- if (models) this.reset(models, _.extend({silent: true}, options));
14094
- };
14095
 
14096
- // Default options for `Collection#set`.
14097
- var setOptions = {add: true, remove: true, merge: true};
14098
- var addOptions = {add: true, remove: false};
14099
 
14100
- // Splices `insert` into `array` at index `at`.
14101
- var splice = function(array, insert, at) {
14102
- at = Math.min(Math.max(at, 0), array.length);
14103
- var tail = Array(array.length - at);
14104
- var length = insert.length;
14105
- var i;
14106
- for (i = 0; i < tail.length; i++) tail[i] = array[i + at];
14107
- for (i = 0; i < length; i++) array[i + at] = insert[i];
14108
- for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i];
14109
- };
14110
 
14111
- // Define the Collection's inheritable methods.
14112
- _.extend(Collection.prototype, Events, {
14113
 
14114
- // The default model for a collection is just a **Backbone.Model**.
14115
- // This should be overridden in most cases.
14116
- model: Model,
14117
 
14118
- // Initialize is an empty function by default. Override it with your own
14119
- // initialization logic.
14120
- initialize: function(){},
14121
 
14122
- // The JSON representation of a Collection is an array of the
14123
- // models' attributes.
14124
- toJSON: function(options) {
14125
- return this.map(function(model) { return model.toJSON(options); });
14126
- },
14127
 
14128
- // Proxy `Backbone.sync` by default.
14129
- sync: function() {
14130
- return Backbone.sync.apply(this, arguments);
14131
- },
14132
 
14133
- // Add a model, or list of models to the set. `models` may be Backbone
14134
- // Models or raw JavaScript objects to be converted to Models, or any
14135
- // combination of the two.
14136
- add: function(models, options) {
14137
- return this.set(models, _.extend({merge: false}, options, addOptions));
14138
- },
14139
 
14140
- // Remove a model, or a list of models from the set.
14141
- remove: function(models, options) {
14142
- options = _.extend({}, options);
14143
- var singular = !_.isArray(models);
14144
- models = singular ? [models] : models.slice();
14145
- var removed = this._removeModels(models, options);
14146
- if (!options.silent && removed.length) {
14147
- options.changes = {added: [], merged: [], removed: removed};
14148
- this.trigger('update', this, options);
14149
- }
14150
- return singular ? removed[0] : removed;
14151
- },
14152
 
14153
- // Update a collection by `set`-ing a new list of models, adding new ones,
14154
- // removing models that are no longer present, and merging models that
14155
- // already exist in the collection, as necessary. Similar to **Model#set**,
14156
- // the core operation for updating the data contained by the collection.
14157
- set: function(models, options) {
14158
- if (models == null) return;
14159
 
14160
- options = _.extend({}, setOptions, options);
14161
- if (options.parse && !this._isModel(models)) {
14162
- models = this.parse(models, options) || [];
14163
- }
14164
 
14165
- var singular = !_.isArray(models);
14166
- models = singular ? [models] : models.slice();
14167
 
14168
- var at = options.at;
14169
- if (at != null) at = +at;
14170
- if (at > this.length) at = this.length;
14171
- if (at < 0) at += this.length + 1;
14172
 
14173
- var set = [];
14174
- var toAdd = [];
14175
- var toMerge = [];
14176
- var toRemove = [];
14177
- var modelMap = {};
14178
 
14179
- var add = options.add;
14180
- var merge = options.merge;
14181
- var remove = options.remove;
14182
 
14183
- var sort = false;
14184
- var sortable = this.comparator && at == null && options.sort !== false;
14185
- var sortAttr = _.isString(this.comparator) ? this.comparator : null;
14186
 
14187
- // Turn bare objects into model references, and prevent invalid models
14188
- // from being added.
14189
- var model, i;
14190
- for (i = 0; i < models.length; i++) {
14191
- model = models[i];
14192
 
14193
- // If a duplicate is found, prevent it from being added and
14194
- // optionally merge it into the existing model.
14195
- var existing = this.get(model);
14196
- if (existing) {
14197
- if (merge && model !== existing) {
14198
- var attrs = this._isModel(model) ? model.attributes : model;
14199
- if (options.parse) attrs = existing.parse(attrs, options);
14200
- existing.set(attrs, options);
14201
- toMerge.push(existing);
14202
- if (sortable && !sort) sort = existing.hasChanged(sortAttr);
14203
- }
14204
- if (!modelMap[existing.cid]) {
14205
- modelMap[existing.cid] = true;
14206
- set.push(existing);
14207
- }
14208
- models[i] = existing;
14209
 
14210
- // If this is a new, valid model, push it to the `toAdd` list.
14211
- } else if (add) {
14212
- model = models[i] = this._prepareModel(model, options);
14213
- if (model) {
14214
- toAdd.push(model);
14215
- this._addReference(model, options);
14216
- modelMap[model.cid] = true;
14217
- set.push(model);
14218
- }
14219
- }
14220
- }
14221
 
14222
- // Remove stale models.
14223
- if (remove) {
14224
- for (i = 0; i < this.length; i++) {
14225
- model = this.models[i];
14226
- if (!modelMap[model.cid]) toRemove.push(model);
14227
- }
14228
- if (toRemove.length) this._removeModels(toRemove, options);
14229
- }
14230
 
14231
- // See if sorting is needed, update `length` and splice in new models.
14232
- var orderChanged = false;
14233
- var replace = !sortable && add && remove;
14234
- if (set.length && replace) {
14235
- orderChanged = this.length !== set.length || _.some(this.models, function(m, index) {
14236
- return m !== set[index];
14237
- });
14238
- this.models.length = 0;
14239
- splice(this.models, set, 0);
14240
- this.length = this.models.length;
14241
- } else if (toAdd.length) {
14242
- if (sortable) sort = true;
14243
- splice(this.models, toAdd, at == null ? this.length : at);
14244
- this.length = this.models.length;
14245
  }
 
 
 
14246
 
14247
- // Silently sort the collection if appropriate.
14248
- if (sort) this.sort({silent: true});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14249
 
14250
- // Unless silenced, it's time to fire all appropriate add/sort/update events.
14251
- if (!options.silent) {
14252
- for (i = 0; i < toAdd.length; i++) {
14253
- if (at != null) options.index = at + i;
14254
- model = toAdd[i];
14255
- model.trigger('add', model, this, options);
14256
- }
14257
- if (sort || orderChanged) this.trigger('sort', this, options);
14258
- if (toAdd.length || toRemove.length || toMerge.length) {
14259
- options.changes = {
14260
- added: toAdd,
14261
- removed: toRemove,
14262
- merged: toMerge
14263
- };
14264
- this.trigger('update', this, options);
14265
- }
14266
- }
14267
 
14268
- // Return the added (or merged) model (or models).
14269
- return singular ? models[0] : models;
14270
- },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14271
 
14272
- // When you have more items than you want to add or remove individually,
14273
- // you can reset the entire set with a new list of models, without firing
14274
- // any granular `add` or `remove` events. Fires `reset` when finished.
14275
- // Useful for bulk operations and optimizations.
14276
- reset: function(models, options) {
14277
- options = options ? _.clone(options) : {};
14278
- for (var i = 0; i < this.models.length; i++) {
14279
- this._removeReference(this.models[i], options);
14280
- }
14281
- options.previousModels = this.models;
14282
- this._reset();
14283
- models = this.add(models, _.extend({silent: true}, options));
14284
- if (!options.silent) this.trigger('reset', this, options);
14285
- return models;
14286
- },
14287
 
14288
- // Add a model to the end of the collection.
14289
- push: function(model, options) {
14290
- return this.add(model, _.extend({at: this.length}, options));
14291
- },
14292
 
14293
- // Remove a model from the end of the collection.
14294
- pop: function(options) {
14295
- var model = this.at(this.length - 1);
14296
- return this.remove(model, options);
14297
- },
14298
 
14299
- // Add a model to the beginning of the collection.
14300
- unshift: function(model, options) {
14301
- return this.add(model, _.extend({at: 0}, options));
14302
- },
14303
 
14304
- // Remove a model from the beginning of the collection.
14305
- shift: function(options) {
14306
- var model = this.at(0);
14307
- return this.remove(model, options);
14308
- },
14309
 
14310
- // Slice out a sub-array of models from the collection.
14311
- slice: function() {
14312
- return slice.apply(this.models, arguments);
14313
- },
14314
 
14315
- // Get a model from the set by id, cid, model object with id or cid
14316
- // properties, or an attributes object that is transformed through modelId.
14317
- get: function(obj) {
14318
- if (obj == null) return void 0;
14319
- return this._byId[obj] ||
14320
- this._byId[this.modelId(obj.attributes || obj)] ||
14321
- obj.cid && this._byId[obj.cid];
14322
- },
14323
 
14324
- // Returns `true` if the model is in the collection.
14325
- has: function(obj) {
14326
- return this.get(obj) != null;
14327
- },
14328
 
14329
- // Get the model at the given index.
14330
- at: function(index) {
14331
- if (index < 0) index += this.length;
14332
- return this.models[index];
14333
- },
14334
-
14335
- // Return models with matching attributes. Useful for simple cases of
14336
- // `filter`.
14337
- where: function(attrs, first) {
14338
- return this[first ? 'find' : 'filter'](attrs);
14339
- },
14340
-
14341
- // Return the first model with matching attributes. Useful for simple cases
14342
- // of `find`.
14343
- findWhere: function(attrs) {
14344
- return this.where(attrs, true);
14345
- },
14346
-
14347
- // Force the collection to re-sort itself. You don't need to call this under
14348
- // normal circumstances, as the set will maintain sort order as each item
14349
- // is added.
14350
- sort: function(options) {
14351
- var comparator = this.comparator;
14352
- if (!comparator) throw new Error('Cannot sort a set without a comparator');
14353
- options || (options = {});
14354
-
14355
- var length = comparator.length;
14356
- if (_.isFunction(comparator)) comparator = _.bind(comparator, this);
14357
-
14358
- // Run sort based on type of `comparator`.
14359
- if (length === 1 || _.isString(comparator)) {
14360
- this.models = this.sortBy(comparator);
14361
- } else {
14362
- this.models.sort(comparator);
14363
- }
14364
- if (!options.silent) this.trigger('sort', this, options);
14365
- return this;
14366
- },
14367
-
14368
- // Pluck an attribute from each model in the collection.
14369
- pluck: function(attr) {
14370
- return this.map(attr + '');
14371
- },
14372
 
14373
- // Fetch the default set of models for this collection, resetting the
14374
- // collection when they arrive. If `reset: true` is passed, the response
14375
- // data will be passed through the `reset` method instead of `set`.
14376
- fetch: function(options) {
14377
- options = _.extend({parse: true}, options);
14378
- var success = options.success;
14379
- var collection = this;
14380
- options.success = function(resp) {
14381
- var method = options.reset ? 'reset' : 'set';
14382
- collection[method](resp, options);
14383
- if (success) success.call(options.context, collection, resp, options);
14384
- collection.trigger('sync', collection, resp, options);
14385
- };
14386
- wrapError(this, options);
14387
- return this.sync('read', this, options);
14388
- },
14389
 
14390
- // Create a new instance of a model in this collection. Add the model to the
14391
- // collection immediately, unless `wait: true` is passed, in which case we
14392
- // wait for the server to agree.
14393
- create: function(model, options) {
14394
- options = options ? _.clone(options) : {};
14395
- var wait = options.wait;
14396
- model = this._prepareModel(model, options);
14397
- if (!model) return false;
14398
- if (!wait) this.add(model, options);
14399
- var collection = this;
14400
- var success = options.success;
14401
- options.success = function(m, resp, callbackOpts) {
14402
- if (wait) collection.add(m, callbackOpts);
14403
- if (success) success.call(callbackOpts.context, m, resp, callbackOpts);
14404
- };
14405
- model.save(null, options);
14406
- return model;
14407
- },
14408
 
14409
- // **parse** converts a response into a list of models to be added to the
14410
- // collection. The default implementation is just to pass it through.
14411
- parse: function(resp, options) {
14412
- return resp;
14413
- },
14414
 
14415
- // Create a new collection with an identical list of models as this one.
14416
- clone: function() {
14417
- return new this.constructor(this.models, {
14418
- model: this.model,
14419
- comparator: this.comparator
14420
- });
14421
- },
14422
 
14423
- // Define how to uniquely identify models in the collection.
14424
- modelId: function(attrs) {
14425
- return attrs[this.model.prototype.idAttribute || 'id'];
14426
- },
14427
 
14428
- // Private method to reset all internal state. Called when the collection
14429
- // is first initialized or reset.
14430
- _reset: function() {
14431
- this.length = 0;
14432
- this.models = [];
14433
- this._byId = {};
14434
- },
14435
 
14436
- // Prepare a hash of attributes (or other model) to be added to this
14437
- // collection.
14438
- _prepareModel: function(attrs, options) {
14439
- if (this._isModel(attrs)) {
14440
- if (!attrs.collection) attrs.collection = this;
14441
- return attrs;
14442
- }
14443
- options = options ? _.clone(options) : {};
14444
- options.collection = this;
14445
- var model = new this.model(attrs, options);
14446
- if (!model.validationError) return model;
14447
- this.trigger('invalid', this, model.validationError, options);
14448
- return false;
14449
- },
14450
 
14451
- // Internal method called by both remove and set.
14452
- _removeModels: function(models, options) {
14453
- var removed = [];
14454
- for (var i = 0; i < models.length; i++) {
14455
- var model = this.get(models[i]);
14456
- if (!model) continue;
14457
 
14458
- var index = this.indexOf(model);
14459
- this.models.splice(index, 1);
14460
- this.length--;
14461
 
14462
- // Remove references before triggering 'remove' event to prevent an
14463
- // infinite loop. #3693
14464
- delete this._byId[model.cid];
14465
- var id = this.modelId(model.attributes);
14466
- if (id != null) delete this._byId[id];
14467
 
14468
- if (!options.silent) {
14469
- options.index = index;
14470
- model.trigger('remove', model, this, options);
14471
- }
 
 
 
 
 
 
 
 
 
 
14472
 
14473
- removed.push(model);
14474
- this._removeReference(model, options);
 
 
 
 
 
 
 
 
 
14475
  }
14476
- return removed;
14477
- },
14478
-
14479
- // Method for checking whether an object should be considered a model for
14480
- // the purposes of adding to the collection.
14481
- _isModel: function(model) {
14482
- return model instanceof Model;
14483
- },
14484
-
14485
- // Internal method to create a model's ties to a collection.
14486
- _addReference: function(model, options) {
14487
- this._byId[model.cid] = model;
14488
- var id = this.modelId(model.attributes);
14489
- if (id != null) this._byId[id] = model;
14490
- model.on('all', this._onModelEvent, this);
14491
- },
14492
-
14493
- // Internal method to sever a model's ties to a collection.
14494
- _removeReference: function(model, options) {
14495
- delete this._byId[model.cid];
14496
- var id = this.modelId(model.attributes);
14497
- if (id != null) delete this._byId[id];
14498
- if (this === model.collection) delete model.collection;
14499
- model.off('all', this._onModelEvent, this);
14500
- },
14501
-
14502
- // Internal method called every time a model in the set fires an event.
14503
- // Sets need to update their indexes when models change ids. All other
14504
- // events simply proxy through. "add" and "remove" events that originate
14505
- // in other collections are ignored.
14506
- _onModelEvent: function(event, model, collection, options) {
14507
- if (model) {
14508
- if ((event === 'add' || event === 'remove') && collection !== this) return;
14509
- if (event === 'destroy') this.remove(model, options);
14510
- if (event === 'change') {
14511
- var prevId = this.modelId(model.previousAttributes());
14512
- var id = this.modelId(model.attributes);
14513
- if (prevId !== id) {
14514
- if (prevId != null) delete this._byId[prevId];
14515
- if (id != null) this._byId[id] = model;
14516
- }
14517
- }
14518
  }
14519
- this.trigger.apply(this, arguments);
14520
- }
 
 
14521
 
14522
- });
14523
 
14524
- // Underscore methods that we want to implement on the Collection.
14525
- // 90% of the core usefulness of Backbone Collections is actually implemented
14526
- // right here:
14527
- var collectionMethods = {forEach: 3, each: 3, map: 3, collect: 3, reduce: 0,
14528
- foldl: 0, inject: 0, reduceRight: 0, foldr: 0, find: 3, detect: 3, filter: 3,
14529
- select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 3, includes: 3,
14530
- contains: 3, invoke: 0, max: 3, min: 3, toArray: 1, size: 1, first: 3,
14531
- head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3,
14532
- without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3,
14533
- isEmpty: 1, chain: 1, sample: 3, partition: 3, groupBy: 3, countBy: 3,
14534
- sortBy: 3, indexBy: 3, findIndex: 3, findLastIndex: 3};
 
 
 
 
 
 
 
 
14535
 
14536
- // Mix in each Underscore method as a proxy to `Collection#models`.
14537
- addUnderscoreMethods(Collection, collectionMethods, 'models');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14538
 
14539
- // Backbone.View
14540
- // -------------
14541
 
14542
- // Backbone Views are almost more convention than they are actual code. A View
14543
- // is simply a JavaScript object that represents a logical chunk of UI in the
14544
- // DOM. This might be a single item, an entire list, a sidebar or panel, or
14545
- // even the surrounding frame which wraps your whole app. Defining a chunk of
14546
- // UI as a **View** allows you to define your DOM events declaratively, without
14547
- // having to worry about render order ... and makes it easy for the view to
14548
- // react to specific changes in the state of your models.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14549
 
14550
- // Creating a Backbone.View creates its initial element outside of the DOM,
14551
- // if an existing element is not provided...
14552
- var View = Backbone.View = function(options) {
14553
- this.cid = _.uniqueId('view');
14554
- _.extend(this, _.pick(options, viewOptions));
14555
- this._ensureElement();
14556
- this.initialize.apply(this, arguments);
14557
- };
14558
 
14559
- // Cached regex to split keys for `delegate`.
14560
- var delegateEventSplitter = /^(\S+)\s*(.*)$/;
14561
 
14562
- // List of view options to be set as properties.
14563
- var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
14564
 
14565
- // Set up all inheritable **Backbone.View** properties and methods.
14566
- _.extend(View.prototype, Events, {
14567
 
14568
- // The default `tagName` of a View's element is `"div"`.
14569
- tagName: 'div',
14570
 
14571
- // jQuery delegate for element lookup, scoped to DOM elements within the
14572
- // current view. This should be preferred to global lookups where possible.
14573
- $: function(selector) {
14574
- return this.$el.find(selector);
14575
- },
14576
 
14577
- // Initialize is an empty function by default. Override it with your own
14578
- // initialization logic.
14579
- initialize: function(){},
14580
 
14581
- // **render** is the core function that your view should override, in order
14582
- // to populate its element (`this.el`), with the appropriate HTML. The
14583
- // convention is for **render** to always return `this`.
14584
- render: function() {
14585
- return this;
14586
- },
14587
 
14588
- // Remove this view by taking the element out of the DOM, and removing any
14589
- // applicable Backbone.Events listeners.
14590
- remove: function() {
14591
- this._removeElement();
14592
- this.stopListening();
14593
- return this;
14594
- },
14595
 
14596
- // Remove this view's element from the document and all event listeners
14597
- // attached to it. Exposed for subclasses using an alternative DOM
14598
- // manipulation API.
14599
- _removeElement: function() {
14600
- this.$el.remove();
14601
- },
14602
 
14603
- // Change the view's element (`this.el` property) and re-delegate the
14604
- // view's events on the new element.
14605
- setElement: function(element) {
14606
- this.undelegateEvents();
14607
- this._setElement(element);
14608
- this.delegateEvents();
14609
- return this;
14610
- },
14611
 
14612
- // Creates the `this.el` and `this.$el` references for this view using the
14613
- // given `el`. `el` can be a CSS selector or an HTML string, a jQuery
14614
- // context or an element. Subclasses can override this to utilize an
14615
- // alternative DOM manipulation API and are only required to set the
14616
- // `this.el` property.
14617
- _setElement: function(el) {
14618
- this.$el = el instanceof Backbone.$ ? el : Backbone.$(el);
14619
- this.el = this.$el[0];
14620
- },
14621
 
14622
- // Set callbacks, where `this.events` is a hash of
14623
- //
14624
- // *{"event selector": "callback"}*
14625
- //
14626
- // {
14627
- // 'mousedown .title': 'edit',
14628
- // 'click .button': 'save',
14629
- // 'click .open': function(e) { ... }
14630
- // }
14631
- //
14632
- // pairs. Callbacks will be bound to the view, with `this` set properly.
14633
- // Uses event delegation for efficiency.
14634
- // Omitting the selector binds the event to `this.el`.
14635
- delegateEvents: function(events) {
14636
- events || (events = _.result(this, 'events'));
14637
- if (!events) return this;
14638
- this.undelegateEvents();
14639
- for (var key in events) {
14640
- var method = events[key];
14641
- if (!_.isFunction(method)) method = this[method];
14642
- if (!method) continue;
14643
- var match = key.match(delegateEventSplitter);
14644
- this.delegate(match[1], match[2], _.bind(method, this));
14645
- }
14646
- return this;
14647
- },
14648
 
14649
- // Add a single event listener to the view's element (or a child element
14650
- // using `selector`). This only works for delegate-able events: not `focus`,
14651
- // `blur`, and not `change`, `submit`, and `reset` in Internet Explorer.
14652
- delegate: function(eventName, selector, listener) {
14653
- this.$el.on(eventName + '.delegateEvents' + this.cid, selector, listener);
14654
- return this;
14655
- },
14656
 
14657
- // Clears all callbacks previously bound to the view by `delegateEvents`.
14658
- // You usually don't need to use this, but may wish to if you have multiple
14659
- // Backbone views attached to the same DOM element.
14660
- undelegateEvents: function() {
14661
- if (this.$el) this.$el.off('.delegateEvents' + this.cid);
14662
- return this;
14663
- },
14664
 
14665
- // A finer-grained `undelegateEvents` for removing a single delegated event.
14666
- // `selector` and `listener` are both optional.
14667
- undelegate: function(eventName, selector, listener) {
14668
- this.$el.off(eventName + '.delegateEvents' + this.cid, selector, listener);
14669
- return this;
14670
- },
14671
 
14672
- // Produces a DOM element to be assigned to your view. Exposed for
14673
- // subclasses using an alternative DOM manipulation API.
14674
- _createElement: function(tagName) {
14675
- return document.createElement(tagName);
14676
- },
14677
 
14678
- // Ensure that the View has a DOM element to render into.
14679
- // If `this.el` is a string, pass it through `$()`, take the first
14680
- // matching element, and re-assign it to `el`. Otherwise, create
14681
- // an element from the `id`, `className` and `tagName` properties.
14682
- _ensureElement: function() {
14683
- if (!this.el) {
14684
- var attrs = _.extend({}, _.result(this, 'attributes'));
14685
- if (this.id) attrs.id = _.result(this, 'id');
14686
- if (this.className) attrs['class'] = _.result(this, 'className');
14687
- this.setElement(this._createElement(_.result(this, 'tagName')));
14688
- this._setAttributes(attrs);
14689
- } else {
14690
- this.setElement(_.result(this, 'el'));
14691
- }
14692
- },
14693
 
14694
- // Set attributes from a hash on this view's element. Exposed for
14695
- // subclasses using an alternative DOM manipulation API.
14696
- _setAttributes: function(attributes) {
14697
- this.$el.attr(attributes);
14698
- }
14699
 
14700
- });
14701
 
14702
- // Backbone.sync
14703
- // -------------
14704
 
14705
- // Override this function to change the manner in which Backbone persists
14706
- // models to the server. You will be passed the type of request, and the
14707
- // model in question. By default, makes a RESTful Ajax request
14708
- // to the model's `url()`. Some possible customizations could be:
14709
- //
14710
- // * Use `setTimeout` to batch rapid-fire updates into a single request.
14711
- // * Send up the models as XML instead of JSON.
14712
- // * Persist models via WebSockets instead of Ajax.
14713
- //
14714
- // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
14715
- // as `POST`, with a `_method` parameter containing the true HTTP method,
14716
- // as well as all requests with the body as `application/x-www-form-urlencoded`
14717
- // instead of `application/json` with the model in a param named `model`.
14718
- // Useful when interfacing with server-side languages like **PHP** that make
14719
- // it difficult to read the body of `PUT` requests.
14720
- Backbone.sync = function(method, model, options) {
14721
- var type = methodMap[method];
14722
 
14723
- // Default options, unless specified.
14724
- _.defaults(options || (options = {}), {
14725
- emulateHTTP: Backbone.emulateHTTP,
14726
- emulateJSON: Backbone.emulateJSON
14727
- });
14728
 
14729
- // Default JSON-request options.
14730
- var params = {type: type, dataType: 'json'};
14731
 
14732
- // Ensure that we have a URL.
14733
- if (!options.url) {
14734
- params.url = _.result(model, 'url') || urlError();
14735
- }
14736
 
14737
- // Ensure that we have the appropriate request data.
14738
- if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
14739
- params.contentType = 'application/json';
14740
- params.data = JSON.stringify(options.attrs || model.toJSON(options));
14741
- }
14742
 
14743
- // For older servers, emulate JSON by encoding the request into an HTML-form.
14744
- if (options.emulateJSON) {
14745
- params.contentType = 'application/x-www-form-urlencoded';
14746
- params.data = params.data ? {model: params.data} : {};
14747
- }
14748
 
14749
- // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
14750
- // And an `X-HTTP-Method-Override` header.
14751
- if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
14752
- params.type = 'POST';
14753
- if (options.emulateJSON) params.data._method = type;
14754
- var beforeSend = options.beforeSend;
14755
- options.beforeSend = function(xhr) {
14756
- xhr.setRequestHeader('X-HTTP-Method-Override', type);
14757
- if (beforeSend) return beforeSend.apply(this, arguments);
14758
- };
14759
- }
14760
 
14761
- // Don't process data on a non-GET request.
14762
- if (params.type !== 'GET' && !options.emulateJSON) {
14763
- params.processData = false;
14764
- }
14765
 
14766
- // Pass along `textStatus` and `errorThrown` from jQuery.
14767
- var error = options.error;
14768
- options.error = function(xhr, textStatus, errorThrown) {
14769
- options.textStatus = textStatus;
14770
- options.errorThrown = errorThrown;
14771
- if (error) error.call(options.context, xhr, textStatus, errorThrown);
14772
- };
14773
 
14774
- // Make the request, allowing the user to override any Ajax options.
14775
- var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
14776
- model.trigger('request', model, xhr, options);
14777
- return xhr;
14778
- };
14779
 
14780
- // Map from CRUD to HTTP for our default `Backbone.sync` implementation.
14781
- var methodMap = {
14782
- 'create': 'POST',
14783
- 'update': 'PUT',
14784
- 'patch': 'PATCH',
14785
- 'delete': 'DELETE',
14786
- 'read': 'GET'
14787
- };
14788
 
14789
- // Set the default implementation of `Backbone.ajax` to proxy through to `$`.
14790
- // Override this if you'd like to use a different library.
14791
- Backbone.ajax = function() {
14792
- return Backbone.$.ajax.apply(Backbone.$, arguments);
14793
- };
14794
 
14795
- // Backbone.Router
14796
- // ---------------
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14797
 
14798
- // Routers map faux-URLs to actions, and fire events when routes are
14799
- // matched. Creating a new one sets its `routes` hash, if not set statically.
14800
- var Router = Backbone.Router = function(options) {
14801
- options || (options = {});
14802
- if (options.routes) this.routes = options.routes;
14803
- this._bindRoutes();
14804
- this.initialize.apply(this, arguments);
14805
- };
14806
 
14807
- // Cached regular expressions for matching named param parts and splatted
14808
- // parts of route strings.
14809
- var optionalParam = /\((.*?)\)/g;
14810
- var namedParam = /(\(\?)?:\w+/g;
14811
- var splatParam = /\*\w+/g;
14812
- var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
14813
 
14814
- // Set up all inheritable **Backbone.Router** properties and methods.
14815
- _.extend(Router.prototype, Events, {
14816
 
14817
- // Initialize is an empty function by default. Override it with your own
14818
- // initialization logic.
14819
- initialize: function(){},
 
 
 
 
14820
 
14821
- // Manually bind a single named route to a callback. For example:
14822
- //
14823
- // this.route('search/:query/p:num', 'search', function(query, num) {
14824
- // ...
14825
- // });
14826
- //
14827
- route: function(route, name, callback) {
14828
- if (!_.isRegExp(route)) route = this._routeToRegExp(route);
14829
- if (_.isFunction(name)) {
14830
- callback = name;
14831
- name = '';
14832
- }
14833
- if (!callback) callback = this[name];
14834
- var router = this;
14835
- Backbone.history.route(route, function(fragment) {
14836
- var args = router._extractParameters(route, fragment);
14837
- if (router.execute(callback, args, name) !== false) {
14838
- router.trigger.apply(router, ['route:' + name].concat(args));
14839
- router.trigger('route', name, args);
14840
- Backbone.history.trigger('route', router, name, args);
1
  webpackJsonp([2],{
2
 
3
+ /***/ 228:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  /***/ (function(module, exports, __webpack_require__) {
5
 
6
  "use strict";
10
 
11
  var _react2 = _interopRequireDefault(_react);
12
 
13
+ var _reactTooltip = __webpack_require__(232);
14
 
15
  var _reactTooltip2 = _interopRequireDefault(_reactTooltip);
16
 
17
+ var _reactHtmlParser = __webpack_require__(445);
18
 
19
  var _reactHtmlParser2 = _interopRequireDefault(_reactHtmlParser);
20
 
85
 
86
  /***/ }),
87
 
88
+ /***/ 268:
89
  /***/ (function(module, exports, __webpack_require__) {
90
 
91
+ "use strict";
92
 
 
 
93
 
94
+ Object.defineProperty(exports, "__esModule", {
95
+ value: true
96
+ });
97
+ exports.default = ProcessNodes;
98
 
99
+ var _elementTypes = __webpack_require__(447);
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
+ var _elementTypes2 = _interopRequireDefault(_elementTypes);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
 
103
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
104
 
105
+ /**
106
+ * Tests a htmlparser2 node and returns whether is it a text node at the start and end of the line containing only
107
+ * white space. This allows these node types to be excluded from the rendering because they are unnecessary.
108
+ *
109
+ * @param {Object} node The element object as created by htmlparser2
110
+ * @returns {boolean} Whether
111
+ */
112
+ var filterOutEmptyTextNodes = function filterOutEmptyTextNodes(node) {
113
+ return !(node.type === 'text' && /\r?\n/.test(node.data) && node.data.trim() === '');
 
114
  };
115
 
116
+ /**
117
+ * Converts a htmlparser2 node to a React element
118
+ *
119
+ * @param {Object} node The htmlparser2 node to convert
120
+ * @param {Number} index The index of the current node
121
+ * @returns {React.Element}
122
+ */
123
+ var convertNodeToElement = function convertNodeToElement(node, index) {
124
+ var key = 'rhp-' + index;
125
+ return _elementTypes2.default[node.type](node, key);
126
  };
127
 
128
+ /**
129
+ * Processes the nodes generated by htmlparser2 and convert them all into React elements
130
+ *
131
+ * @param {Object[]} nodes List of nodes to process
132
+ * @returns {React.Element[]} The list of processed React elements
133
+ */
134
+ function ProcessNodes(nodes) {
135
 
136
+ return nodes.filter(filterOutEmptyTextNodes).map(function (node, index) {
137
+ return convertNodeToElement(node, index);
138
+ });
139
+ }
 
 
 
140
 
141
+ /***/ }),
 
 
142
 
143
+ /***/ 269:
144
+ /***/ (function(module, exports, __webpack_require__) {
 
145
 
146
+ "use strict";
 
147
 
 
 
 
 
148
 
149
+ Object.defineProperty(exports, "__esModule", {
150
+ value: true
151
+ });
152
 
153
+ 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; };
 
154
 
155
+ exports.default = GeneratePropsFromAttributes;
 
156
 
157
+ var _HtmlAttributesToReact = __webpack_require__(450);
 
 
158
 
159
+ var _HtmlAttributesToReact2 = _interopRequireDefault(_HtmlAttributesToReact);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
 
161
+ var _InlineStyleToObject = __webpack_require__(453);
 
 
 
 
 
 
162
 
163
+ var _InlineStyleToObject2 = _interopRequireDefault(_InlineStyleToObject);
 
164
 
165
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
166
 
167
+ /**
168
+ * Generates props for a React element from an object of HTML attributes
169
+ *
170
+ * @param {Object} attributes The HTML attributes
171
+ * @param {String} key The key to give the react element
172
+ */
173
+ function GeneratePropsFromAttributes(attributes, key) {
 
 
174
 
175
+ // generate props
176
+ var props = _extends({}, (0, _HtmlAttributesToReact2.default)(attributes), { key: key });
 
 
 
 
177
 
178
+ // if there is a style prop then convert it to a React style object
179
+ if (props.style) {
180
+ props.style = (0, _InlineStyleToObject2.default)(props.style);
181
+ }
182
 
183
+ return props;
184
+ }
 
 
 
 
 
 
 
 
 
185
 
186
+ /***/ }),
 
 
187
 
188
+ /***/ 39:
189
+ /***/ (function(module, exports, __webpack_require__) {
 
190
 
191
+ /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["Backbone"] = __webpack_require__(478);
192
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
193
 
194
+ /***/ }),
 
 
 
 
 
195
 
196
+ /***/ 445:
197
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
198
 
199
+ "use strict";
 
200
 
 
 
 
201
 
202
+ Object.defineProperty(exports, "__esModule", {
203
+ value: true
204
+ });
205
 
206
+ var _HtmlParser = __webpack_require__(446);
 
 
 
 
 
 
 
207
 
208
+ var _HtmlParser2 = _interopRequireDefault(_HtmlParser);
 
 
209
 
210
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
 
 
 
 
211
 
212
+ exports.default = _HtmlParser2.default;
213
 
214
+ /***/ }),
 
 
 
215
 
216
+ /***/ 446:
217
+ /***/ (function(module, exports, __webpack_require__) {
 
 
218
 
219
+ "use strict";
 
220
 
 
 
 
 
 
221
 
222
+ Object.defineProperty(exports, "__esModule", {
223
+ value: true
224
+ });
225
+ exports.default = HtmlParser;
226
 
227
+ var _htmlparser = __webpack_require__(32);
 
 
228
 
229
+ var _htmlparser2 = _interopRequireDefault(_htmlparser);
 
 
230
 
231
+ var _ProcessNodes = __webpack_require__(268);
 
 
232
 
233
+ var _ProcessNodes2 = _interopRequireDefault(_ProcessNodes);
 
 
234
 
235
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
236
 
237
+ /**
238
+ * Parses a HTML string and returns a list of React components generated from it
239
+ *
240
+ * @param {String} html The HTML to convert into React components
241
+ * @returns {Array} List of top level React elements
242
+ */
243
+ function HtmlParser(html) {
244
+ var nodes = _htmlparser2.default.parseDOM(html);
245
+ return (0, _ProcessNodes2.default)(nodes);
246
+ }
247
 
248
  /***/ }),
249
 
250
+ /***/ 447:
251
  /***/ (function(module, exports, __webpack_require__) {
252
 
253
+ "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
 
 
 
 
 
 
255
 
256
+ Object.defineProperty(exports, "__esModule", {
257
+ value: true
258
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
 
260
+ var _ElementType$Text$Ele;
 
 
 
 
 
 
 
 
 
 
 
261
 
262
+ var _htmlparser = __webpack_require__(32);
 
 
 
 
 
 
 
 
 
 
 
 
 
263
 
264
+ var _TextElementType = __webpack_require__(448);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
 
266
+ var _TextElementType2 = _interopRequireDefault(_TextElementType);
 
 
267
 
268
+ var _TagElementType = __webpack_require__(449);
 
 
269
 
270
+ var _TagElementType2 = _interopRequireDefault(_TagElementType);
 
 
271
 
272
+ var _StyleElementType = __webpack_require__(456);
 
 
 
273
 
274
+ var _StyleElementType2 = _interopRequireDefault(_StyleElementType);
 
 
 
 
 
 
275
 
276
+ var _UnsupportedElementType = __webpack_require__(457);
277
 
278
+ var _UnsupportedElementType2 = _interopRequireDefault(_UnsupportedElementType);
279
 
280
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
281
 
282
+ 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; } /*
283
+ * Map each htmlparser2 element type to a function which will convert that element type to a React element
284
+ * Not all of the element types are supported so the UnsupportedElementType is used for them which will not return any
285
+ * value
286
+ */
287
 
288
+ 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);
289
 
290
+ /***/ }),
 
291
 
292
+ /***/ 448:
293
+ /***/ (function(module, exports, __webpack_require__) {
 
294
 
295
+ "use strict";
 
 
296
 
 
297
 
298
+ Object.defineProperty(exports, "__esModule", {
299
+ value: true
300
+ });
301
+ exports.default = TextElementType;
302
+ /**
303
+ * Converts a text node to a React text element
304
+ *
305
+ * @param {Object} node The text node
306
+ * @returns {String} The text
307
+ */
308
+ function TextElementType(node) {
309
 
310
+ // React will accept plain text for rendering so just return the node data
311
+ return node.data;
312
  }
313
 
 
314
  /***/ }),
315
 
316
+ /***/ 449:
317
+ /***/ (function(module, exports, __webpack_require__) {
 
 
318
 
319
+ "use strict";
320
 
 
 
321
 
322
+ Object.defineProperty(exports, "__esModule", {
323
+ value: true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  });
325
+ exports.default = TagElementType;
326
 
327
+ var _react = __webpack_require__(2);
328
 
329
+ var _react2 = _interopRequireDefault(_react);
 
 
 
 
 
330
 
331
+ var _ProcessNodes = __webpack_require__(268);
 
 
 
332
 
333
+ var _ProcessNodes2 = _interopRequireDefault(_ProcessNodes);
 
 
334
 
335
+ var _GeneratePropsFromAttributes = __webpack_require__(269);
336
 
337
+ var _GeneratePropsFromAttributes2 = _interopRequireDefault(_GeneratePropsFromAttributes);
 
 
 
338
 
339
+ var _TransformTagName = __webpack_require__(454);
340
 
341
+ var _TransformTagName2 = _interopRequireDefault(_TransformTagName);
 
 
 
 
342
 
343
+ var _VoidElements = __webpack_require__(455);
344
 
345
+ var _VoidElements2 = _interopRequireDefault(_VoidElements);
 
346
 
347
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
 
349
+ /**
350
+ * Converts any element (excluding style - see StyleElementType - and script) to a react element.
351
+ *
352
+ * @param {Object} node The tag node
353
+ * @param {String} key The key to give the React element
354
+ * @returns {React.Element} The React tag element
355
+ */
356
+ function TagElementType(node, key) {
357
 
358
+ // generate props
359
+ var props = (0, _GeneratePropsFromAttributes2.default)(node.attribs, key);
360
 
361
+ // transform the tag name if needed
362
+ var tagName = (0, _TransformTagName2.default)(node.name);
363
 
364
+ // If the node is not a void element and has children then process them
365
+ var children = null;
366
+ if (_VoidElements2.default.indexOf(tagName) === -1) {
367
+ children = (0, _ProcessNodes2.default)(node.children);
 
 
 
 
 
 
 
368
  }
 
369
 
370
+ // create and return the element
371
+ return _react2.default.createElement(tagName, props, children);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
372
  }
373
 
374
+ /***/ }),
 
375
 
376
+ /***/ 450:
377
+ /***/ (function(module, exports, __webpack_require__) {
378
 
379
+ "use strict";
380
 
 
 
381
 
382
+ Object.defineProperty(exports, "__esModule", {
383
+ value: true
384
+ });
385
+ exports.default = HtmlAttributesToReact;
386
 
387
+ var _BooleanAttributes = __webpack_require__(451);
 
388
 
389
+ var _BooleanAttributes2 = _interopRequireDefault(_BooleanAttributes);
 
390
 
391
+ var _ReactAttributes = __webpack_require__(452);
 
 
 
 
 
 
 
 
 
 
 
 
392
 
393
+ var _ReactAttributes2 = _interopRequireDefault(_ReactAttributes);
 
 
 
 
394
 
395
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
396
+
397
+ /**
398
+ * Returns the parsed attribute value taking into account things like boolean attributes
399
+ *
400
+ * @param {String} attribute The name of the attribute
401
+ * @param {*} value The value of the attribute from the HTML
402
+ * @returns {*} The parsed attribute value
403
+ */
404
+ var getParsedAttributeValue = function getParsedAttributeValue(attribute, value) {
405
+
406
+ // if the attribute if a boolean then it's value should be the same as it's name
407
+ // e.g. disabled="disabled"
408
+ var lowerBooleanAttributes = _BooleanAttributes2.default.map(function (attr) {
409
+ return attr.toLowerCase();
410
+ });
411
+ if (lowerBooleanAttributes.indexOf(attribute.toLowerCase()) >= 0) {
412
+ value = attribute;
 
 
 
 
 
 
 
 
413
  }
414
 
415
+ return value;
416
  };
417
 
418
+ /**
419
+ * Takes an object of standard HTML property names and converts them to their React counterpart. If the react
420
+ * version does not exist for an attribute then just use it as it is
421
+ *
422
+ * @param {Object} attributes The HTML attributes to convert
423
+ * @returns {Object} The React attributes
424
+ */
425
+ function HtmlAttributesToReact(attributes) {
426
 
427
+ return Object.keys(attributes).reduce(function (mappedAttributes, attribute) {
 
 
 
 
 
 
 
 
 
 
 
 
 
428
 
429
+ // lowercase the attribute name and find it in the react attribute map
430
+ var lowerCaseAttribute = attribute.toLowerCase();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
431
 
432
+ // format the attribute name
433
+ var name = _ReactAttributes2.default[lowerCaseAttribute] || lowerCaseAttribute;
434
 
435
+ // add the parsed attribute value to the mapped attributes
436
+ mappedAttributes[name] = getParsedAttributeValue(name, attributes[attribute]);
 
 
 
 
 
 
437
 
438
+ return mappedAttributes;
439
+ }, {});
 
440
  }
441
 
442
+ /***/ }),
 
 
 
 
 
 
443
 
444
+ /***/ 451:
445
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
446
 
447
+ "use strict";
 
 
448
 
 
 
 
 
 
 
 
449
 
450
+ Object.defineProperty(exports, "__esModule", {
451
+ value: true
452
+ });
453
+ /**
454
+ * List of boolean attributes
455
+ * These attributes should have their React attribute value set to be the same as their name
456
+ * E.g. <input disabled> = <input disabled>
457
+ * <input disabled=""> = <input disabled>
458
+ * <input disabled="disabled"> = <input disabled>
459
+ * @type {Array}
460
+ */
461
+ 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'];
 
 
 
 
 
 
462
 
463
+ /***/ }),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
 
465
+ /***/ 452:
466
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
 
468
+ "use strict";
469
 
 
 
 
 
 
470
 
471
+ Object.defineProperty(exports, "__esModule", {
472
+ value: true
473
+ });
474
+ /**
475
+ * Mapping of standard HTML attributes to their React counterparts
476
+ * List taken and reversed from react/src/renderers/dom/shared/HTMLDOMPropertyConfig.js
477
+ * https://github.com/facebook/react/blob/c9c3c339b757682f1154f1c915eb55e6a8766933/src/renderers/dom/shared/HTMLDOMPropertyConfig.js
478
+ * @type {Object}
479
+ */
480
+ exports.default = {
481
+ /**
482
+ * Standard Properties
483
+ */
484
+ accept: 'accept',
485
+ 'accept-charset': 'acceptCharset',
486
+ accesskey: 'accessKey',
487
+ action: 'action',
488
+ allowfullscreen: 'allowFullScreen',
489
+ allowtransparency: 'allowTransparency',
490
+ alt: 'alt',
491
+ async: 'async',
492
+ autocomplete: 'autoComplete',
493
+ autoplay: 'autoPlay',
494
+ capture: 'capture',
495
+ cellpadding: 'cellPadding',
496
+ cellspacing: 'cellSpacing',
497
+ charset: 'charSet',
498
+ challenge: 'challenge',
499
+ checked: 'checked',
500
+ classid: 'classID',
501
+ class: 'className',
502
+ cols: 'cols',
503
+ colspan: 'colSpan',
504
+ content: 'content',
505
+ contenteditable: 'contentEditable',
506
+ contextmenu: 'contextMenu',
507
+ controls: 'controls',
508
+ coords: 'coords',
509
+ crossorigin: 'crossOrigin',
510
+ data: 'data',
511
+ datetime: 'dateTime',
512
+ default: 'default',
513
+ defer: 'defer',
514
+ dir: 'dir',
515
+ disabled: 'disabled',
516
+ download: 'download',
517
+ draggable: 'draggable',
518
+ enctype: 'encType',
519
+ form: 'form',
520
+ formaction: 'formAction',
521
+ formenctype: 'formEncType',
522
+ formmethod: 'formMethod',
523
+ formnovalidate: 'formNoValidate',
524
+ formtarget: 'formTarget',
525
+ frameborder: 'frameBorder',
526
+ headers: 'headers',
527
+ height: 'height',
528
+ hidden: 'hidden',
529
+ high: 'high',
530
+ href: 'href',
531
+ hreflang: 'hrefLang',
532
+ for: 'htmlFor',
533
+ 'http-equiv': 'httpEquiv',
534
+ icon: 'icon',
535
+ id: 'id',
536
+ inputmode: 'inputMode',
537
+ integrity: 'integrity',
538
+ is: 'is',
539
+ keyparams: 'keyParams',
540
+ keytype: 'keyType',
541
+ kind: 'kind',
542
+ label: 'label',
543
+ lang: 'lang',
544
+ list: 'list',
545
+ loop: 'loop',
546
+ low: 'low',
547
+ manifest: 'manifest',
548
+ marginheight: 'marginHeight',
549
+ marginwidth: 'marginWidth',
550
+ max: 'max',
551
+ maxlength: 'maxLength',
552
+ media: 'media',
553
+ mediagroup: 'mediaGroup',
554
+ method: 'method',
555
+ min: 'min',
556
+ minlength: 'minLength',
557
+ multiple: 'multiple',
558
+ muted: 'muted',
559
+ name: 'name',
560
+ nonce: 'nonce',
561
+ novalidate: 'noValidate',
562
+ open: 'open',
563
+ optimum: 'optimum',
564
+ pattern: 'pattern',
565
+ placeholder: 'placeholder',
566
+ poster: 'poster',
567
+ preload: 'preload',
568
+ radiogroup: 'radioGroup',
569
+ readonly: 'readOnly',
570
+ rel: 'rel',
571
+ required: 'required',
572
+ reversed: 'reversed',
573
+ role: 'role',
574
+ rows: 'rows',
575
+ rowspan: 'rowSpan',
576
+ sandbox: 'sandbox',
577
+ scope: 'scope',
578
+ scoped: 'scoped',
579
+ scrolling: 'scrolling',
580
+ seamless: 'seamless',
581
+ selected: 'selected',
582
+ shape: 'shape',
583
+ size: 'size',
584
+ sizes: 'sizes',
585
+ span: 'span',
586
+ spellcheck: 'spellCheck',
587
+ src: 'src',
588
+ srcdoc: 'srcDoc',
589
+ srclang: 'srcLang',
590
+ srcset: 'srcSet',
591
+ start: 'start',
592
+ step: 'step',
593
+ style: 'style',
594
+ summary: 'summary',
595
+ tabindex: 'tabIndex',
596
+ target: 'target',
597
+ title: 'title',
598
+ type: 'type',
599
+ usemap: 'useMap',
600
+ value: 'value',
601
+ width: 'width',
602
+ wmode: 'wmode',
603
+ wrap: 'wrap',
604
+ /**
605
+ * RDFa Properties
606
+ */
607
+ about: 'about',
608
+ datatype: 'datatype',
609
+ inlist: 'inlist',
610
+ prefix: 'prefix',
611
+ property: 'property',
612
+ resource: 'resource',
613
+ typeof: 'typeof',
614
+ vocab: 'vocab',
615
+ /**
616
+ * Non-standard Properties
617
+ */
618
+ autocapitalize: 'autoCapitalize',
619
+ autocorrect: 'autoCorrect',
620
+ autosave: 'autoSave',
621
+ color: 'color',
622
+ itemprop: 'itemProp',
623
+ itemscope: 'itemScope',
624
+ itemtype: 'itemType',
625
+ itemid: 'itemID',
626
+ itemref: 'itemRef',
627
+ results: 'results',
628
+ security: 'security',
629
+ unselectable: 'unselectable',
630
+ autofocus: 'autoFocus'
631
+ };
632
 
633
+ /***/ }),
 
 
634
 
635
+ /***/ 453:
636
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
637
 
638
+ "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
639
 
 
 
 
 
 
 
 
 
 
 
640
 
641
+ Object.defineProperty(exports, "__esModule", {
642
+ value: true
643
+ });
644
 
645
+ 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"); } }; }();
 
 
 
 
 
 
 
 
 
 
 
646
 
647
+ exports.default = InlineStyleToObject;
648
+ /**
649
+ * Converts an inline style string into an object of React style properties
650
+ *
651
+ * @param {String} inlineStyle='' The inline style to convert
652
+ * @returns {Object} The converted style
653
+ */
654
+ function InlineStyleToObject() {
655
+ var inlineStyle = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
656
 
 
 
 
 
 
 
 
 
 
 
 
 
657
 
658
+ // just return empty object if the inlineStyle is empty
659
+ if (inlineStyle === '') {
660
+ return {};
 
 
 
 
 
661
  }
 
 
662
 
663
+ return inlineStyle.split(';').reduce(function (styleObject, stylePropertyValue) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
664
 
665
+ // extract the style property name and value
666
 
667
+ var _stylePropertyValue$s = stylePropertyValue.split(':').map(function (item) {
668
+ return item.trim().toLowerCase();
669
+ });
670
 
671
+ var _stylePropertyValue$s2 = _slicedToArray(_stylePropertyValue$s, 2);
 
 
 
 
 
 
 
 
 
672
 
673
+ var property = _stylePropertyValue$s2[0];
674
+ var value = _stylePropertyValue$s2[1];
 
 
675
 
676
+ // if there is no value (i.e. no : in the style) then ignore it
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
677
 
678
+ if (value === undefined) {
679
+ return styleObject;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
680
  }
 
 
 
 
 
 
 
 
 
 
681
 
682
+ // convert the property name into the correct React format
683
+ // remove all hyphens and convert the letter immediately after each hyphen to upper case
684
+ // additionally don't uppercase any -ms- prefix
685
+ // e.g. -ms-style-property = msStyleProperty
686
+ // -webkit-style-property = WebkitStyleProperty
687
+ property = property.replace(/^-ms-/, 'ms-').replace(/-(.)/g, function (_, character) {
688
+ return character.toUpperCase();
689
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
690
 
691
+ // add the new style property and value to the style object
692
+ styleObject[property] = value;
693
 
694
+ return styleObject;
695
+ }, {});
 
 
 
 
 
 
 
 
696
  }
697
 
698
+ /***/ }),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
699
 
700
+ /***/ 454:
701
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
702
 
703
+ "use strict";
 
 
704
 
 
 
 
 
705
 
706
+ Object.defineProperty(exports, "__esModule", {
707
+ value: true
708
+ });
709
+ exports.default = TransformTagName;
710
+ var TAGS_TO_TRANSFORM = {
711
+ 'html': 'div',
712
+ 'head': 'div',
713
+ 'body': 'div'
 
 
714
  };
715
 
716
+ /**
717
+ * Transforms the specified tag name to another tag name if needed
718
+ *
719
+ * @param {String} tagName The name of the tag
720
+ * @returns {String} The transformed tag name or the original if it doesn't need to be transformed
721
+ */
722
+ function TransformTagName(tagName) {
723
+ if (TAGS_TO_TRANSFORM.hasOwnProperty(tagName)) {
724
+ return TAGS_TO_TRANSFORM[tagName];
725
+ } else {
726
+ return tagName;
727
  }
 
 
 
 
 
 
728
  }
729
 
730
+ /***/ }),
 
 
 
 
 
 
 
 
731
 
732
+ /***/ 455:
733
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
734
 
735
+ "use strict";
 
 
 
 
 
736
 
 
 
 
 
 
 
 
737
 
738
+ Object.defineProperty(exports, "__esModule", {
739
+ value: true
740
+ });
741
+ /**
742
+ * List of void elements
743
+ * These elements are not allowed to have children
744
+ * @type {Array}
745
+ */
746
+ exports.default = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
747
 
748
+ /***/ }),
 
 
749
 
750
+ /***/ 456:
751
+ /***/ (function(module, exports, __webpack_require__) {
752
 
753
+ "use strict";
 
 
 
 
 
754
 
 
 
 
 
 
 
 
 
 
 
 
755
 
756
+ Object.defineProperty(exports, "__esModule", {
757
+ value: true
758
+ });
759
+ exports.default = StyleElementType;
760
 
761
+ var _react = __webpack_require__(2);
 
 
 
 
 
 
 
 
762
 
763
+ var _react2 = _interopRequireDefault(_react);
 
764
 
765
+ var _GeneratePropsFromAttributes = __webpack_require__(269);
 
766
 
767
+ var _GeneratePropsFromAttributes2 = _interopRequireDefault(_GeneratePropsFromAttributes);
 
 
 
 
 
 
768
 
769
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
 
 
 
770
 
771
+ /**
772
+ * Converts a <style> element to a React element
773
+ *
774
+ * @param {Object} node The style node
775
+ * @param {String} key The key to give the React element
776
+ * @returns {React.Element} The React style element
777
+ */
778
+ function StyleElementType(node, key) {
779
 
780
+ // The style element only ever has a single child which is the styles so try and find this to add as
781
+ // a child to the style element that will be created
782
+ var styles = void 0;
783
+ if (node.children.length > 0) {
784
+ styles = node.children[0].data;
 
 
 
 
 
 
 
 
 
 
785
  }
 
 
786
 
787
+ // generate props
788
+ var props = (0, _GeneratePropsFromAttributes2.default)(node.attribs, key);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
789
 
790
+ // create and return the element
791
+ return _react2.default.createElement('style', props, styles);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
792
  }
793
 
794
+ /***/ }),
 
795
 
796
+ /***/ 457:
797
+ /***/ (function(module, exports, __webpack_require__) {
 
798
 
799
+ "use strict";
 
 
 
 
800
 
 
 
 
 
 
 
 
 
801
 
802
+ Object.defineProperty(exports, "__esModule", {
803
+ value: true
804
+ });
805
+ exports.default = UnsupportedElementType;
806
+ /**
807
+ * Handles an unsupported element type by returning null so nothing is rendered
808
+ * @returns {null}
809
+ */
810
+ function UnsupportedElementType() {
811
 
812
+ // do nothing because the element type is unsupported
813
+ // comment, directive, script, cdata, doctype are all currently unsupported
814
+ return null;
 
 
815
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
816
 
817
  /***/ }),
818
 
819
+ /***/ 475:
820
  /***/ (function(module, exports, __webpack_require__) {
821
 
822
+ "use strict";
 
823
 
 
824
 
825
+ Object.defineProperty(exports, "__esModule", {
826
+ value: true
827
+ });
828
+ exports.fromNewsletter = exports.fromUrl = exports.fromDom = undefined;
829
 
830
+ var _underscore = __webpack_require__(7);
831
 
832
+ var _underscore2 = _interopRequireDefault(_underscore);
833
 
834
+ var _mailpoet = __webpack_require__(3);
835
 
836
+ var _mailpoet2 = _interopRequireDefault(_mailpoet);
 
837
 
838
+ var _html2canvas = __webpack_require__(476);
 
 
839
 
840
+ var _html2canvas2 = _interopRequireDefault(_html2canvas);
 
841
 
842
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
 
 
843
 
844
+ /**
845
+ * Generates a thumbnail from a DOM element.
846
+ *
847
+ * @param {DOMElement} element
848
+ * @return {Promise<String>} DataURL of the generated image.
849
+ */
850
+ var fromDom = exports.fromDom = function fromDom(element) {
851
+ return (0, _html2canvas2.default)(element, {
852
+ logging: false
853
+ }).then(function (canvas) {
854
+ return canvas.toDataURL('image/jpeg');
855
+ });
856
+ };
857
 
858
+ /**
859
+ * Generates a thumbnail from an URL.
860
+ *
861
+ * @param {String} url
862
+ * @return {Promise<String>} DataURL of the generated image.
863
+ */
864
+ var fromUrl = exports.fromUrl = function fromUrl(url) {
865
+ return new Promise(function (resolve, reject) {
866
+ var iframe = document.createElement('iframe');
867
+ var protocol = location.href.startsWith('https://') ? 'https:' : 'http:';
868
+ iframe.src = protocol + url.replace(/^https?:/, '');
869
+ iframe.style.opacity = 0;
870
+ iframe.scrolling = 'no';
871
+ iframe.onload = function () {
872
+ fromDom(iframe.contentDocument.documentElement).then(function (image) {
873
+ document.body.removeChild(iframe);
874
+ resolve(image);
875
+ }).catch(function () {
876
+ document.body.removeChild(iframe);
877
+ reject(_mailpoet2.default.I18n.t('errorWhileTakingScreenshot'));
878
+ });
879
+ };
880
+ var onError = function onError() {
881
+ document.body.removeChild(iframe);
882
+ reject(_mailpoet2.default.I18n.t('errorWhileTakingScreenshot'));
883
+ };
884
+ iframe.onerror = onError;
885
+ iframe.onError = onError;
886
+ iframe.className = 'mailpoet_template_iframe';
887
+ try {
888
+ document.body.appendChild(iframe);
889
+ } catch (err) {
890
+ onError();
891
  }
892
  });
893
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
894
 
895
+ /**
896
+ * Generates a thumbnail from a newsletter's data.
897
+ *
898
+ * @param {Object} data
899
+ * @return {Promise<String>} DataURL of the generated image.
900
+ */
901
+ var fromNewsletter = exports.fromNewsletter = function fromNewsletter(data) {
902
+ return new Promise(function (resolve, reject) {
903
+ var json = data;
904
+ if (!_underscore2.default.isUndefined(json.body)) {
905
+ json.body = JSON.stringify(json.body);
906
+ }
907
+ _mailpoet2.default.Ajax.post({
908
+ api_version: window.mailpoet_api_version,
909
+ endpoint: 'newsletters',
910
+ action: 'showPreview',
911
+ data: json
912
+ }).done(function (response) {
913
+ return fromUrl(response.meta.preview_url).then(resolve).catch(reject);
914
+ }).fail(function (response) {
915
+ return reject(response.errors);
916
+ });
917
+ });
918
  };
919
 
920
  /***/ }),
921
 
922
+ /***/ 476:
923
  /***/ (function(module, exports, __webpack_require__) {
924
 
925
+ /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["html2canvas"] = __webpack_require__(477);
926
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
927
 
928
+ /***/ }),
 
 
 
 
 
929
 
930
+ /***/ 477:
931
+ /***/ (function(module, exports, __webpack_require__) {
932
 
933
+ /*!
934
+ * html2canvas 1.0.0-alpha.12 <https://html2canvas.hertzen.com>
935
+ * Copyright (c) 2018 Niklas von Hertzen <https://hertzen.com>
936
+ * Released under MIT License
937
+ */
938
+ (function webpackUniversalModuleDefinition(root, factory) {
939
+ if(true)
940
+ module.exports = factory();
941
+ else if(typeof define === 'function' && define.amd)
942
+ define([], factory);
943
+ else if(typeof exports === 'object')
944
+ exports["html2canvas"] = factory();
945
+ else
946
+ root["html2canvas"] = factory();
947
+ })(this, function() {
948
+ return /******/ (function(modules) { // webpackBootstrap
949
+ /******/ // The module cache
950
+ /******/ var installedModules = {};
951
+ /******/
952
+ /******/ // The require function
953
+ /******/ function __webpack_require__(moduleId) {
954
+ /******/
955
+ /******/ // Check if module is in cache
956
+ /******/ if(installedModules[moduleId]) {
957
+ /******/ return installedModules[moduleId].exports;
958
+ /******/ }
959
+ /******/ // Create a new module (and put it into the cache)
960
+ /******/ var module = installedModules[moduleId] = {
961
+ /******/ i: moduleId,
962
+ /******/ l: false,
963
+ /******/ exports: {}
964
+ /******/ };
965
+ /******/
966
+ /******/ // Execute the module function
967
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
968
+ /******/
969
+ /******/ // Flag the module as loaded
970
+ /******/ module.l = true;
971
+ /******/
972
+ /******/ // Return the exports of the module
973
+ /******/ return module.exports;
974
+ /******/ }
975
+ /******/
976
+ /******/
977
+ /******/ // expose the modules object (__webpack_modules__)
978
+ /******/ __webpack_require__.m = modules;
979
+ /******/
980
+ /******/ // expose the module cache
981
+ /******/ __webpack_require__.c = installedModules;
982
+ /******/
983
+ /******/ // define getter function for harmony exports
984
+ /******/ __webpack_require__.d = function(exports, name, getter) {
985
+ /******/ if(!__webpack_require__.o(exports, name)) {
986
+ /******/ Object.defineProperty(exports, name, {
987
+ /******/ configurable: false,
988
+ /******/ enumerable: true,
989
+ /******/ get: getter
990
+ /******/ });
991
+ /******/ }
992
+ /******/ };
993
+ /******/
994
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
995
+ /******/ __webpack_require__.n = function(module) {
996
+ /******/ var getter = module && module.__esModule ?
997
+ /******/ function getDefault() { return module['default']; } :
998
+ /******/ function getModuleExports() { return module; };
999
+ /******/ __webpack_require__.d(getter, 'a', getter);
1000
+ /******/ return getter;
1001
+ /******/ };
1002
+ /******/
1003
+ /******/ // Object.prototype.hasOwnProperty.call
1004
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
1005
+ /******/
1006
+ /******/ // __webpack_public_path__
1007
+ /******/ __webpack_require__.p = "";
1008
+ /******/
1009
+ /******/ // Load entry module and return exports
1010
+ /******/ return __webpack_require__(__webpack_require__.s = 27);
1011
+ /******/ })
1012
+ /************************************************************************/
1013
+ /******/ ([
1014
+ /* 0 */
1015
+ /***/ (function(module, exports, __webpack_require__) {
1016
 
1017
+ "use strict";
1018
 
 
1019
 
1020
+ // http://dev.w3.org/csswg/css-color/
 
1021
 
1022
+ Object.defineProperty(exports, "__esModule", {
1023
+ value: true
1024
+ });
 
1025
 
1026
+ 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"); } }; }();
 
1027
 
1028
+ 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; }; }();
 
1029
 
1030
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
1031
 
1032
+ var HEX3 = /^#([a-f0-9]{3})$/i;
1033
+ var hex3 = function hex3(value) {
1034
+ var match = value.match(HEX3);
1035
+ if (match) {
1036
+ 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];
1037
+ }
1038
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1039
  };
1040
 
1041
+ var HEX6 = /^#([a-f0-9]{6})$/i;
1042
+ var hex6 = function hex6(value) {
1043
+ var match = value.match(HEX6);
1044
+ if (match) {
1045
+ return [parseInt(match[1].substring(0, 2), 16), parseInt(match[1].substring(2, 4), 16), parseInt(match[1].substring(4, 6), 16), null];
1046
+ }
1047
+ return false;
 
 
 
 
 
 
 
1048
  };
1049
 
1050
+ var RGB = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;
1051
+ var rgb = function rgb(value) {
1052
+ var match = value.match(RGB);
1053
+ if (match) {
1054
+ return [Number(match[1]), Number(match[2]), Number(match[3]), null];
1055
+ }
1056
+ return false;
1057
  };
1058
 
1059
+ var RGBA = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/;
1060
+ var rgba = function rgba(value) {
1061
+ var match = value.match(RGBA);
1062
+ if (match && match.length > 4) {
1063
+ return [Number(match[1]), Number(match[2]), Number(match[3]), Number(match[4])];
1064
+ }
1065
+ return false;
1066
+ };
 
1067
 
1068
+ var fromArray = function fromArray(array) {
1069
+ return [Math.min(array[0], 255), Math.min(array[1], 255), Math.min(array[2], 255), array.length > 3 ? array[3] : null];
1070
+ };
1071
 
1072
+ var namedColor = function namedColor(name) {
1073
+ var color = NAMED_COLORS[name.toLowerCase()];
1074
+ return color ? color : false;
1075
+ };
1076
 
1077
+ var Color = function () {
1078
+ function Color(value) {
1079
+ _classCallCheck(this, Color);
1080
 
1081
+ var _ref = Array.isArray(value) ? fromArray(value) : hex3(value) || rgb(value) || rgba(value) || namedColor(value) || hex6(value) || [0, 0, 0, null],
1082
+ _ref2 = _slicedToArray(_ref, 4),
1083
+ r = _ref2[0],
1084
+ g = _ref2[1],
1085
+ b = _ref2[2],
1086
+ a = _ref2[3];
1087
 
1088
+ this.r = r;
1089
+ this.g = g;
1090
+ this.b = b;
1091
+ this.a = a;
1092
+ }
1093
 
1094
+ _createClass(Color, [{
1095
+ key: 'isTransparent',
1096
+ value: function isTransparent() {
1097
+ return this.a === 0;
1098
+ }
1099
+ }, {
1100
+ key: 'toString',
1101
+ value: function toString() {
1102
+ return this.a !== null && this.a !== 1 ? 'rgba(' + this.r + ',' + this.g + ',' + this.b + ',' + this.a + ')' : 'rgb(' + this.r + ',' + this.g + ',' + this.b + ')';
1103
+ }
1104
+ }]);
1105
 
1106
+ return Color;
1107
+ }();
1108
 
1109
+ exports.default = Color;
1110
 
 
 
 
 
 
 
 
 
 
 
1111
 
1112
+ var NAMED_COLORS = {
1113
+ transparent: [0, 0, 0, 0],
1114
+ aliceblue: [240, 248, 255, null],
1115
+ antiquewhite: [250, 235, 215, null],
1116
+ aqua: [0, 255, 255, null],
1117
+ aquamarine: [127, 255, 212, null],
1118
+ azure: [240, 255, 255, null],
1119
+ beige: [245, 245, 220, null],
1120
+ bisque: [255, 228, 196, null],
1121
+ black: [0, 0, 0, null],
1122
+ blanchedalmond: [255, 235, 205, null],
1123
+ blue: [0, 0, 255, null],
1124
+ blueviolet: [138, 43, 226, null],
1125
+ brown: [165, 42, 42, null],
1126
+ burlywood: [222, 184, 135, null],
1127
+ cadetblue: [95, 158, 160, null],
1128
+ chartreuse: [127, 255, 0, null],
1129
+ chocolate: [210, 105, 30, null],
1130
+ coral: [255, 127, 80, null],
1131
+ cornflowerblue: [100, 149, 237, null],
1132
+ cornsilk: [255, 248, 220, null],
1133
+ crimson: [220, 20, 60, null],
1134
+ cyan: [0, 255, 255, null],
1135
+ darkblue: [0, 0, 139, null],
1136
+ darkcyan: [0, 139, 139, null],
1137
+ darkgoldenrod: [184, 134, 11, null],
1138
+ darkgray: [169, 169, 169, null],
1139
+ darkgreen: [0, 100, 0, null],
1140
+ darkgrey: [169, 169, 169, null],
1141
+ darkkhaki: [189, 183, 107, null],
1142
+ darkmagenta: [139, 0, 139, null],
1143
+ darkolivegreen: [85, 107, 47, null],
1144
+ darkorange: [255, 140, 0, null],
1145
+ darkorchid: [153, 50, 204, null],
1146
+ darkred: [139, 0, 0, null],
1147
+ darksalmon: [233, 150, 122, null],
1148
+ darkseagreen: [143, 188, 143, null],
1149
+ darkslateblue: [72, 61, 139, null],
1150
+ darkslategray: [47, 79, 79, null],
1151
+ darkslategrey: [47, 79, 79, null],
1152
+ darkturquoise: [0, 206, 209, null],
1153
+ darkviolet: [148, 0, 211, null],
1154
+ deeppink: [255, 20, 147, null],
1155
+ deepskyblue: [0, 191, 255, null],
1156
+ dimgray: [105, 105, 105, null],
1157
+ dimgrey: [105, 105, 105, null],
1158
+ dodgerblue: [30, 144, 255, null],
1159
+ firebrick: [178, 34, 34, null],
1160
+ floralwhite: [255, 250, 240, null],
1161
+ forestgreen: [34, 139, 34, null],
1162
+ fuchsia: [255, 0, 255, null],
1163
+ gainsboro: [220, 220, 220, null],
1164
+ ghostwhite: [248, 248, 255, null],
1165
+ gold: [255, 215, 0, null],
1166
+ goldenrod: [218, 165, 32, null],
1167
+ gray: [128, 128, 128, null],
1168
+ green: [0, 128, 0, null],
1169
+ greenyellow: [173, 255, 47, null],
1170
+ grey: [128, 128, 128, null],
1171
+ honeydew: [240, 255, 240, null],
1172
+ hotpink: [255, 105, 180, null],
1173
+ indianred: [205, 92, 92, null],
1174
+ indigo: [75, 0, 130, null],
1175
+ ivory: [255, 255, 240, null],
1176
+ khaki: [240, 230, 140, null],
1177
+ lavender: [230, 230, 250, null],
1178
+ lavenderblush: [255, 240, 245, null],
1179
+ lawngreen: [124, 252, 0, null],
1180
+ lemonchiffon: [255, 250, 205, null],
1181
+ lightblue: [173, 216, 230, null],
1182
+ lightcoral: [240, 128, 128, null],
1183
+ lightcyan: [224, 255, 255, null],
1184
+ lightgoldenrodyellow: [250, 250, 210, null],
1185
+ lightgray: [211, 211, 211, null],
1186
+ lightgreen: [144, 238, 144, null],
1187
+ lightgrey: [211, 211, 211, null],
1188
+ lightpink: [255, 182, 193, null],
1189
+ lightsalmon: [255, 160, 122, null],
1190
+ lightseagreen: [32, 178, 170, null],
1191
+ lightskyblue: [135, 206, 250, null],
1192
+ lightslategray: [119, 136, 153, null],
1193
+ lightslategrey: [119, 136, 153, null],
1194
+ lightsteelblue: [176, 196, 222, null],
1195
+ lightyellow: [255, 255, 224, null],
1196
+ lime: [0, 255, 0, null],
1197
+ limegreen: [50, 205, 50, null],
1198
+ linen: [250, 240, 230, null],
1199
+ magenta: [255, 0, 255, null],
1200
+ maroon: [128, 0, 0, null],
1201
+ mediumaquamarine: [102, 205, 170, null],
1202
+ mediumblue: [0, 0, 205, null],
1203
+ mediumorchid: [186, 85, 211, null],
1204
+ mediumpurple: [147, 112, 219, null],
1205
+ mediumseagreen: [60, 179, 113, null],
1206
+ mediumslateblue: [123, 104, 238, null],
1207
+ mediumspringgreen: [0, 250, 154, null],
1208
+ mediumturquoise: [72, 209, 204, null],
1209
+ mediumvioletred: [199, 21, 133, null],
1210
+ midnightblue: [25, 25, 112, null],
1211
+ mintcream: [245, 255, 250, null],
1212
+ mistyrose: [255, 228, 225, null],
1213
+ moccasin: [255, 228, 181, null],
1214
+ navajowhite: [255, 222, 173, null],
1215
+ navy: [0, 0, 128, null],
1216
+ oldlace: [253, 245, 230, null],
1217
+ olive: [128, 128, 0, null],
1218
+ olivedrab: [107, 142, 35, null],
1219
+ orange: [255, 165, 0, null],
1220
+ orangered: [255, 69, 0, null],
1221
+ orchid: [218, 112, 214, null],
1222
+ palegoldenrod: [238, 232, 170, null],
1223
+ palegreen: [152, 251, 152, null],
1224
+ paleturquoise: [175, 238, 238, null],
1225
+ palevioletred: [219, 112, 147, null],
1226
+ papayawhip: [255, 239, 213, null],
1227
+ peachpuff: [255, 218, 185, null],
1228
+ peru: [205, 133, 63, null],
1229
+ pink: [255, 192, 203, null],
1230
+ plum: [221, 160, 221, null],
1231
+ powderblue: [176, 224, 230, null],
1232
+ purple: [128, 0, 128, null],
1233
+ rebeccapurple: [102, 51, 153, null],
1234
+ red: [255, 0, 0, null],
1235
+ rosybrown: [188, 143, 143, null],
1236
+ royalblue: [65, 105, 225, null],
1237
+ saddlebrown: [139, 69, 19, null],
1238
+ salmon: [250, 128, 114, null],
1239
+ sandybrown: [244, 164, 96, null],
1240
+ seagreen: [46, 139, 87, null],
1241
+ seashell: [255, 245, 238, null],
1242
+ sienna: [160, 82, 45, null],
1243
+ silver: [192, 192, 192, null],
1244
+ skyblue: [135, 206, 235, null],
1245
+ slateblue: [106, 90, 205, null],
1246
+ slategray: [112, 128, 144, null],
1247
+ slategrey: [112, 128, 144, null],
1248
+ snow: [255, 250, 250, null],
1249
+ springgreen: [0, 255, 127, null],
1250
+ steelblue: [70, 130, 180, null],
1251
+ tan: [210, 180, 140, null],
1252
+ teal: [0, 128, 128, null],
1253
+ thistle: [216, 191, 216, null],
1254
+ tomato: [255, 99, 71, null],
1255
+ turquoise: [64, 224, 208, null],
1256
+ violet: [238, 130, 238, null],
1257
+ wheat: [245, 222, 179, null],
1258
+ white: [255, 255, 255, null],
1259
+ whitesmoke: [245, 245, 245, null],
1260
+ yellow: [255, 255, 0, null],
1261
+ yellowgreen: [154, 205, 50, null]
1262
  };
1263
 
1264
+ var TRANSPARENT = exports.TRANSPARENT = new Color([0, 0, 0, 0]);
 
 
 
 
 
 
 
 
 
 
 
1265
 
1266
  /***/ }),
1267
+ /* 1 */
 
1268
  /***/ (function(module, exports, __webpack_require__) {
1269
 
1270
  "use strict";
1271
 
1272
 
1273
  Object.defineProperty(exports, "__esModule", {
1274
+ value: true
1275
  });
1276
+ exports.calculateLengthFromValueWithUnit = exports.LENGTH_TYPE = undefined;
1277
 
1278
+ 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; }; }();
 
 
 
 
 
 
1279
 
1280
+ var _NodeContainer = __webpack_require__(3);
1281
 
1282
+ var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
1283
 
1284
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1285
 
1286
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
1287
 
1288
+ var LENGTH_WITH_UNIT = /([\d.]+)(px|r?em|%)/i;
 
1289
 
1290
+ var LENGTH_TYPE = exports.LENGTH_TYPE = {
1291
+ PX: 0,
1292
+ PERCENTAGE: 1
1293
+ };
1294
 
1295
+ var Length = function () {
1296
+ function Length(value) {
1297
+ _classCallCheck(this, Length);
1298
 
1299
+ this.type = value.substr(value.length - 1) === '%' ? LENGTH_TYPE.PERCENTAGE : LENGTH_TYPE.PX;
1300
+ var parsedValue = parseFloat(value);
1301
+ if (true && isNaN(parsedValue)) {
1302
+ console.error('Invalid value given for Length: "' + value + '"');
1303
+ }
1304
+ this.value = isNaN(parsedValue) ? 0 : parsedValue;
1305
+ }
1306
 
1307
+ _createClass(Length, [{
1308
+ key: 'isPercentage',
1309
+ value: function isPercentage() {
1310
+ return this.type === LENGTH_TYPE.PERCENTAGE;
1311
+ }
1312
+ }, {
1313
+ key: 'getAbsoluteValue',
1314
+ value: function getAbsoluteValue(parentLength) {
1315
+ return this.isPercentage() ? parentLength * (this.value / 100) : this.value;
1316
+ }
1317
+ }], [{
1318
+ key: 'create',
1319
+ value: function create(v) {
1320
+ return new Length(v);
1321
+ }
1322
+ }]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1323
 
1324
+ return Length;
1325
+ }();
 
 
 
 
 
 
 
 
 
 
 
1326
 
1327
+ exports.default = Length;
 
 
 
 
 
1328
 
 
 
 
1329
 
1330
+ var getRootFontSize = function getRootFontSize(container) {
1331
+ var parent = container.parent;
1332
+ return parent ? getRootFontSize(parent) : parseFloat(container.style.font.fontSize);
1333
  };
1334
 
1335
+ var calculateLengthFromValueWithUnit = exports.calculateLengthFromValueWithUnit = function calculateLengthFromValueWithUnit(container, value, unit) {
1336
+ switch (unit) {
1337
+ case 'px':
1338
+ case '%':
1339
+ return new Length(value + unit);
1340
+ case 'em':
1341
+ case 'rem':
1342
+ var length = new Length(value);
1343
+ length.value *= unit === 'em' ? parseFloat(container.style.font.fontSize) : getRootFontSize(container);
1344
+ return length;
1345
+ default:
1346
+ // TODO: handle correctly if unknown unit is used
1347
+ return new Length('0');
1348
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1349
  };
1350
 
 
 
 
 
 
 
 
 
 
1351
  /***/ }),
1352
+ /* 2 */
 
1353
  /***/ (function(module, exports, __webpack_require__) {
1354
 
1355
  "use strict";
1356
 
1357
 
1358
  Object.defineProperty(exports, "__esModule", {
1359
+ value: true
1360
  });
1361
+ exports.parseBoundCurves = exports.calculatePaddingBoxPath = exports.calculateBorderBoxPath = exports.parsePathForBorder = exports.parseDocumentSize = exports.calculateContentBox = exports.calculatePaddingBox = exports.parseBounds = exports.Bounds = undefined;
1362
 
1363
+ 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; }; }();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1364
 
1365
+ var _Vector = __webpack_require__(7);
1366
 
1367
+ var _Vector2 = _interopRequireDefault(_Vector);
1368
 
1369
+ var _BezierCurve = __webpack_require__(32);
1370
 
1371
+ var _BezierCurve2 = _interopRequireDefault(_BezierCurve);
1372
 
1373
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1374
 
1375
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
 
 
 
1376
 
1377
+ var TOP = 0;
1378
+ var RIGHT = 1;
1379
+ var BOTTOM = 2;
1380
+ var LEFT = 3;
1381
 
1382
+ var H = 0;
1383
+ var V = 1;
1384
 
1385
+ var Bounds = exports.Bounds = function () {
1386
+ function Bounds(x, y, w, h) {
1387
+ _classCallCheck(this, Bounds);
1388
 
1389
+ this.left = x;
1390
+ this.top = y;
1391
+ this.width = w;
1392
+ this.height = h;
1393
+ }
1394
 
1395
+ _createClass(Bounds, null, [{
1396
+ key: 'fromClientRect',
1397
+ value: function fromClientRect(clientRect, scrollX, scrollY) {
1398
+ return new Bounds(clientRect.left + scrollX, clientRect.top + scrollY, clientRect.width, clientRect.height);
1399
+ }
1400
+ }]);
1401
 
1402
+ return Bounds;
1403
+ }();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1404
 
1405
+ var parseBounds = exports.parseBounds = function parseBounds(node, scrollX, scrollY) {
1406
+ return Bounds.fromClientRect(node.getBoundingClientRect(), scrollX, scrollY);
 
 
 
1407
  };
1408
 
1409
+ var calculatePaddingBox = exports.calculatePaddingBox = function calculatePaddingBox(bounds, borders) {
1410
+ 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));
1411
  };
1412
 
1413
+ var calculateContentBox = exports.calculateContentBox = function calculateContentBox(bounds, padding, borders) {
1414
+ // TODO support percentage paddings
1415
+ var paddingTop = padding[TOP].value;
1416
+ var paddingRight = padding[RIGHT].value;
1417
+ var paddingBottom = padding[BOTTOM].value;
1418
+ var paddingLeft = padding[LEFT].value;
1419
 
1420
+ 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));
 
 
 
 
 
1421
  };
1422
 
1423
+ var parseDocumentSize = exports.parseDocumentSize = function parseDocumentSize(document) {
1424
+ var body = document.body;
1425
+ var documentElement = document.documentElement;
 
 
 
 
 
1426
 
1427
+ if (!body || !documentElement) {
1428
+ throw new Error( true ? 'Unable to get document size' : '');
1429
+ }
1430
+ var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));
1431
 
1432
+ var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));
 
 
1433
 
1434
+ return new Bounds(0, 0, width, height);
1435
  };
1436
 
1437
+ var parsePathForBorder = exports.parsePathForBorder = function parsePathForBorder(curves, borderSide) {
1438
+ switch (borderSide) {
1439
+ case TOP:
1440
+ return createPathFromCurves(curves.topLeftOuter, curves.topLeftInner, curves.topRightOuter, curves.topRightInner);
1441
+ case RIGHT:
1442
+ return createPathFromCurves(curves.topRightOuter, curves.topRightInner, curves.bottomRightOuter, curves.bottomRightInner);
1443
+ case BOTTOM:
1444
+ return createPathFromCurves(curves.bottomRightOuter, curves.bottomRightInner, curves.bottomLeftOuter, curves.bottomLeftInner);
1445
+ case LEFT:
1446
+ default:
1447
+ return createPathFromCurves(curves.bottomLeftOuter, curves.bottomLeftInner, curves.topLeftOuter, curves.topLeftInner);
1448
+ }
 
 
 
 
 
1449
  };
1450
 
1451
+ var createPathFromCurves = function createPathFromCurves(outer1, inner1, outer2, inner2) {
1452
+ var path = [];
1453
+ if (outer1 instanceof _BezierCurve2.default) {
1454
+ path.push(outer1.subdivide(0.5, false));
1455
+ } else {
1456
+ path.push(outer1);
1457
+ }
1458
 
1459
+ if (outer2 instanceof _BezierCurve2.default) {
1460
+ path.push(outer2.subdivide(0.5, true));
1461
+ } else {
1462
+ path.push(outer2);
1463
+ }
1464
 
1465
+ if (inner2 instanceof _BezierCurve2.default) {
1466
+ path.push(inner2.subdivide(0.5, true).reverse());
1467
+ } else {
1468
+ path.push(inner2);
1469
+ }
 
1470
 
1471
+ if (inner1 instanceof _BezierCurve2.default) {
1472
+ path.push(inner1.subdivide(0.5, false).reverse());
1473
+ } else {
1474
+ path.push(inner1);
1475
+ }
 
1476
 
1477
+ return path;
 
1478
  };
1479
 
1480
+ var calculateBorderBoxPath = exports.calculateBorderBoxPath = function calculateBorderBoxPath(curves) {
1481
+ return [curves.topLeftOuter, curves.topRightOuter, curves.bottomRightOuter, curves.bottomLeftOuter];
 
 
 
 
 
 
 
 
 
 
 
1482
  };
1483
 
1484
+ var calculatePaddingBoxPath = exports.calculatePaddingBoxPath = function calculatePaddingBoxPath(curves) {
1485
+ return [curves.topLeftInner, curves.topRightInner, curves.bottomRightInner, curves.bottomLeftInner];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1486
  };
1487
 
1488
+ var parseBoundCurves = exports.parseBoundCurves = function parseBoundCurves(bounds, borders, borderRadius) {
1489
+ var tlh = borderRadius[CORNER.TOP_LEFT][H].getAbsoluteValue(bounds.width);
1490
+ var tlv = borderRadius[CORNER.TOP_LEFT][V].getAbsoluteValue(bounds.height);
1491
+ var trh = borderRadius[CORNER.TOP_RIGHT][H].getAbsoluteValue(bounds.width);
1492
+ var trv = borderRadius[CORNER.TOP_RIGHT][V].getAbsoluteValue(bounds.height);
1493
+ var brh = borderRadius[CORNER.BOTTOM_RIGHT][H].getAbsoluteValue(bounds.width);
1494
+ var brv = borderRadius[CORNER.BOTTOM_RIGHT][V].getAbsoluteValue(bounds.height);
1495
+ var blh = borderRadius[CORNER.BOTTOM_LEFT][H].getAbsoluteValue(bounds.width);
1496
+ var blv = borderRadius[CORNER.BOTTOM_LEFT][V].getAbsoluteValue(bounds.height);
1497
 
1498
+ var factors = [];
1499
+ factors.push((tlh + trh) / bounds.width);
1500
+ factors.push((blh + brh) / bounds.width);
1501
+ factors.push((tlv + blv) / bounds.height);
1502
+ factors.push((trv + brv) / bounds.height);
1503
+ var maxFactor = Math.max.apply(Math, factors);
1504
 
1505
+ if (maxFactor > 1) {
1506
+ tlh /= maxFactor;
1507
+ tlv /= maxFactor;
1508
+ trh /= maxFactor;
1509
+ trv /= maxFactor;
1510
+ brh /= maxFactor;
1511
+ brv /= maxFactor;
1512
+ blh /= maxFactor;
1513
+ blv /= maxFactor;
1514
+ }
1515
 
1516
+ var topWidth = bounds.width - trh;
1517
+ var rightHeight = bounds.height - brv;
1518
+ var bottomWidth = bounds.width - brh;
1519
+ var leftHeight = bounds.height - blv;
1520
 
1521
+ return {
1522
+ topLeftOuter: tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT) : new _Vector2.default(bounds.left, bounds.top),
1523
+ 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),
1524
+ 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),
1525
+ 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),
1526
+ 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),
1527
+ 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),
1528
+ 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),
1529
+ 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)
1530
+ };
1531
  };
1532
 
1533
+ var CORNER = {
1534
+ TOP_LEFT: 0,
1535
+ TOP_RIGHT: 1,
1536
+ BOTTOM_RIGHT: 2,
1537
+ BOTTOM_LEFT: 3
 
 
 
 
 
 
 
 
1538
  };
1539
 
1540
+ var getCurvePoints = function getCurvePoints(x, y, r1, r2, position) {
1541
+ var kappa = 4 * ((Math.sqrt(2) - 1) / 3);
1542
+ var ox = r1 * kappa; // control point offset horizontal
1543
+ var oy = r2 * kappa; // control point offset vertical
1544
+ var xm = x + r1; // x-middle
1545
+ var ym = y + r2; // y-middle
1546
+
1547
+ switch (position) {
1548
+ case CORNER.TOP_LEFT:
1549
+ 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));
1550
+ case CORNER.TOP_RIGHT:
1551
+ 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));
1552
+ case CORNER.BOTTOM_RIGHT:
1553
+ 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));
1554
+ case CORNER.BOTTOM_LEFT:
1555
+ default:
1556
+ 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));
1557
+ }
1558
  };
1559
 
1560
+ /***/ }),
1561
+ /* 3 */
1562
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
1563
 
1564
+ "use strict";
 
1565
 
 
1566
 
1567
+ Object.defineProperty(exports, "__esModule", {
1568
+ value: true
1569
+ });
1570
 
1571
+ 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; }; }();
1572
 
1573
+ var _Color = __webpack_require__(0);
 
1574
 
1575
+ var _Color2 = _interopRequireDefault(_Color);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1576
 
1577
+ var _Util = __webpack_require__(4);
1578
 
1579
+ var _background = __webpack_require__(5);
1580
 
1581
+ var _border = __webpack_require__(12);
 
1582
 
1583
+ var _borderRadius = __webpack_require__(33);
 
 
1584
 
1585
+ var _display = __webpack_require__(34);
 
 
 
1586
 
1587
+ var _float = __webpack_require__(35);
1588
 
1589
+ var _font = __webpack_require__(36);
1590
 
1591
+ var _letterSpacing = __webpack_require__(37);
 
 
 
 
 
 
 
 
 
 
1592
 
1593
+ var _lineBreak = __webpack_require__(38);
 
 
 
1594
 
1595
+ var _listStyle = __webpack_require__(8);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1596
 
1597
+ var _margin = __webpack_require__(39);
1598
 
1599
+ var _overflow = __webpack_require__(40);
1600
 
1601
+ var _overflowWrap = __webpack_require__(18);
 
1602
 
1603
+ var _padding = __webpack_require__(17);
1604
 
1605
+ var _position = __webpack_require__(19);
1606
 
1607
+ var _textDecoration = __webpack_require__(11);
 
 
1608
 
1609
+ var _textShadow = __webpack_require__(41);
1610
 
1611
+ var _textTransform = __webpack_require__(20);
1612
 
1613
+ var _transform = __webpack_require__(42);
 
 
1614
 
1615
+ var _visibility = __webpack_require__(43);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1616
 
1617
+ var _wordBreak = __webpack_require__(44);
1618
 
1619
+ var _zIndex = __webpack_require__(45);
 
1620
 
1621
+ var _Bounds = __webpack_require__(2);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1622
 
1623
+ var _Input = __webpack_require__(21);
 
1624
 
1625
+ var _ListItem = __webpack_require__(14);
 
 
 
 
 
 
1626
 
1627
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1628
 
1629
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
1630
 
1631
+ var INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];
1632
 
1633
+ var NodeContainer = function () {
1634
+ function NodeContainer(node, parent, resourceLoader, index) {
1635
+ var _this = this;
 
 
 
1636
 
1637
+ _classCallCheck(this, NodeContainer);
 
 
 
1638
 
1639
+ this.parent = parent;
1640
+ this.tagName = node.tagName;
1641
+ this.index = index;
1642
+ this.childNodes = [];
1643
+ this.listItems = [];
1644
+ if (typeof node.start === 'number') {
1645
+ this.listStart = node.start;
1646
+ }
1647
+ var defaultView = node.ownerDocument.defaultView;
1648
+ var scrollX = defaultView.pageXOffset;
1649
+ var scrollY = defaultView.pageYOffset;
1650
+ var style = defaultView.getComputedStyle(node, null);
1651
+ var display = (0, _display.parseDisplay)(style.display);
1652
 
1653
+ var IS_INPUT = node.type === 'radio' || node.type === 'checkbox';
1654
 
1655
+ var position = (0, _position.parsePosition)(style.position);
 
 
1656
 
1657
+ this.style = {
1658
+ background: IS_INPUT ? _Input.INPUT_BACKGROUND : (0, _background.parseBackground)(style, resourceLoader),
1659
+ border: IS_INPUT ? _Input.INPUT_BORDERS : (0, _border.parseBorder)(style),
1660
+ borderRadius: (node instanceof defaultView.HTMLInputElement || node instanceof HTMLInputElement) && IS_INPUT ? (0, _Input.getInputBorderRadius)(node) : (0, _borderRadius.parseBorderRadius)(style),
1661
+ color: IS_INPUT ? _Input.INPUT_COLOR : new _Color2.default(style.color),
1662
+ display: display,
1663
+ float: (0, _float.parseCSSFloat)(style.float),
1664
+ font: (0, _font.parseFont)(style),
1665
+ letterSpacing: (0, _letterSpacing.parseLetterSpacing)(style.letterSpacing),
1666
+ listStyle: display === _display.DISPLAY.LIST_ITEM ? (0, _listStyle.parseListStyle)(style) : null,
1667
+ lineBreak: (0, _lineBreak.parseLineBreak)(style.lineBreak),
1668
+ margin: (0, _margin.parseMargin)(style),
1669
+ opacity: parseFloat(style.opacity),
1670
+ overflow: INPUT_TAGS.indexOf(node.tagName) === -1 ? (0, _overflow.parseOverflow)(style.overflow) : _overflow.OVERFLOW.HIDDEN,
1671
+ overflowWrap: (0, _overflowWrap.parseOverflowWrap)(style.overflowWrap ? style.overflowWrap : style.wordWrap),
1672
+ padding: (0, _padding.parsePadding)(style),
1673
+ position: position,
1674
+ textDecoration: (0, _textDecoration.parseTextDecoration)(style),
1675
+ textShadow: (0, _textShadow.parseTextShadow)(style.textShadow),
1676
+ textTransform: (0, _textTransform.parseTextTransform)(style.textTransform),
1677
+ transform: (0, _transform.parseTransform)(style),
1678
+ visibility: (0, _visibility.parseVisibility)(style.visibility),
1679
+ wordBreak: (0, _wordBreak.parseWordBreak)(style.wordBreak),
1680
+ zIndex: (0, _zIndex.parseZIndex)(position !== _position.POSITION.STATIC ? style.zIndex : 'auto')
1681
+ };
1682
 
1683
+ if (this.isTransformed()) {
1684
+ // getBoundingClientRect provides values post-transform, we want them without the transformation
1685
+ node.style.transform = 'matrix(1,0,0,1,0,0)';
1686
+ }
 
 
 
1687
 
1688
+ if (display === _display.DISPLAY.LIST_ITEM) {
1689
+ var listOwner = (0, _ListItem.getListOwner)(this);
1690
+ if (listOwner) {
1691
+ var listIndex = listOwner.listItems.length;
1692
+ listOwner.listItems.push(this);
1693
+ 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;
1694
+ }
1695
+ }
1696
 
1697
+ // TODO move bound retrieval for all nodes to a later stage?
1698
+ if (node.tagName === 'IMG') {
1699
+ node.addEventListener('load', function () {
1700
+ _this.bounds = (0, _Bounds.parseBounds)(node, scrollX, scrollY);
1701
+ _this.curvedBounds = (0, _Bounds.parseBoundCurves)(_this.bounds, _this.style.border, _this.style.borderRadius);
1702
+ });
1703
+ }
1704
+ this.image = getImage(node, resourceLoader);
1705
+ this.bounds = IS_INPUT ? (0, _Input.reformatInputBounds)((0, _Bounds.parseBounds)(node, scrollX, scrollY)) : (0, _Bounds.parseBounds)(node, scrollX, scrollY);
1706
+ this.curvedBounds = (0, _Bounds.parseBoundCurves)(this.bounds, this.style.border, this.style.borderRadius);
1707
 
1708
+ if (true) {
1709
+ this.name = '' + node.tagName.toLowerCase() + (node.id ? '#' + node.id : '') + node.className.toString().split(' ').map(function (s) {
1710
+ return s.length ? '.' + s : '';
1711
+ }).join('');
1712
+ }
1713
+ }
1714
 
1715
+ _createClass(NodeContainer, [{
1716
+ key: 'getClipPaths',
1717
+ value: function getClipPaths() {
1718
+ var parentClips = this.parent ? this.parent.getClipPaths() : [];
1719
+ var isClipped = this.style.overflow !== _overflow.OVERFLOW.VISIBLE;
1720
 
1721
+ return isClipped ? parentClips.concat([(0, _Bounds.calculatePaddingBoxPath)(this.curvedBounds)]) : parentClips;
1722
+ }
1723
+ }, {
1724
+ key: 'isInFlow',
1725
+ value: function isInFlow() {
1726
+ return this.isRootElement() && !this.isFloating() && !this.isAbsolutelyPositioned();
1727
+ }
1728
+ }, {
1729
+ key: 'isVisible',
1730
+ value: function isVisible() {
1731
+ return !(0, _Util.contains)(this.style.display, _display.DISPLAY.NONE) && this.style.opacity > 0 && this.style.visibility === _visibility.VISIBILITY.VISIBLE;
1732
+ }
1733
+ }, {
1734
+ key: 'isAbsolutelyPositioned',
1735
+ value: function isAbsolutelyPositioned() {
1736
+ return this.style.position !== _position.POSITION.STATIC && this.style.position !== _position.POSITION.RELATIVE;
1737
+ }
1738
+ }, {
1739
+ key: 'isPositioned',
1740
+ value: function isPositioned() {
1741
+ return this.style.position !== _position.POSITION.STATIC;
1742
+ }
1743
+ }, {
1744
+ key: 'isFloating',
1745
+ value: function isFloating() {
1746
+ return this.style.float !== _float.FLOAT.NONE;
1747
+ }
1748
+ }, {
1749
+ key: 'isRootElement',
1750
+ value: function isRootElement() {
1751
+ return this.parent === null;
1752
+ }
1753
+ }, {
1754
+ key: 'isTransformed',
1755
+ value: function isTransformed() {
1756
+ return this.style.transform !== null;
1757
+ }
1758
+ }, {
1759
+ key: 'isPositionedWithZIndex',
1760
+ value: function isPositionedWithZIndex() {
1761
+ return this.isPositioned() && !this.style.zIndex.auto;
1762
+ }
1763
+ }, {
1764
+ key: 'isInlineLevel',
1765
+ value: function isInlineLevel() {
1766
+ 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);
1767
+ }
1768
+ }, {
1769
+ key: 'isInlineBlockOrInlineTable',
1770
+ value: function isInlineBlockOrInlineTable() {
1771
+ return (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_BLOCK) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_TABLE);
1772
+ }
1773
+ }]);
1774
 
1775
+ return NodeContainer;
1776
+ }();
1777
 
1778
+ exports.default = NodeContainer;
 
1779
 
 
1780
 
1781
+ var getImage = function getImage(node, resourceLoader) {
1782
+ if (node instanceof node.ownerDocument.defaultView.SVGSVGElement || node instanceof SVGSVGElement) {
1783
+ var s = new XMLSerializer();
1784
+ return resourceLoader.loadImage('data:image/svg+xml,' + encodeURIComponent(s.serializeToString(node)));
1785
+ }
1786
+ switch (node.tagName) {
1787
+ case 'IMG':
1788
+ // $FlowFixMe
1789
+ var img = node;
1790
+ return resourceLoader.loadImage(img.currentSrc || img.src);
1791
+ case 'CANVAS':
1792
+ // $FlowFixMe
1793
+ var canvas = node;
1794
+ return resourceLoader.loadCanvas(canvas);
1795
+ case 'IFRAME':
1796
+ var iframeKey = node.getAttribute('data-html2canvas-internal-iframe-key');
1797
+ if (iframeKey) {
1798
+ return iframeKey;
1799
+ }
1800
+ break;
1801
+ }
1802
 
1803
+ return null;
 
1804
  };
1805
 
 
1806
  /***/ }),
1807
+ /* 4 */
 
1808
  /***/ (function(module, exports, __webpack_require__) {
1809
 
1810
  "use strict";
1811
 
1812
 
1813
+ Object.defineProperty(exports, "__esModule", {
1814
+ value: true
1815
+ });
1816
+ var contains = exports.contains = function contains(bit, value) {
1817
+ return (bit & value) !== 0;
1818
+ };
1819
 
1820
+ var distance = exports.distance = function distance(a, b) {
1821
+ return Math.sqrt(a * a + b * b);
1822
+ };
1823
 
1824
+ var copyCSSStyles = exports.copyCSSStyles = function copyCSSStyles(style, target) {
1825
+ // Edge does not provide value for cssText
1826
+ for (var i = style.length - 1; i >= 0; i--) {
1827
+ var property = style.item(i);
1828
+ // Safari shows pseudoelements if content is set
1829
+ if (property !== 'content') {
1830
+ target.style.setProperty(property, style.getPropertyValue(property));
1831
+ }
1832
+ }
1833
+ return target;
1834
+ };
1835
 
1836
+ var SMALL_IMAGE = exports.SMALL_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
 
1837
 
1838
+ /***/ }),
1839
+ /* 5 */
1840
+ /***/ (function(module, exports, __webpack_require__) {
 
 
1841
 
1842
+ "use strict";
 
 
 
 
 
 
1843
 
 
 
 
 
1844
 
1845
+ Object.defineProperty(exports, "__esModule", {
1846
+ value: true
1847
+ });
1848
+ 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;
1849
 
1850
+ var _Color = __webpack_require__(0);
1851
 
1852
+ var _Color2 = _interopRequireDefault(_Color);
 
1853
 
1854
+ var _Length = __webpack_require__(1);
1855
 
1856
+ var _Length2 = _interopRequireDefault(_Length);
 
 
 
 
 
1857
 
1858
+ var _Size = __webpack_require__(31);
 
 
 
 
 
 
 
1859
 
1860
+ var _Size2 = _interopRequireDefault(_Size);
 
1861
 
1862
+ var _Vector = __webpack_require__(7);
 
 
1863
 
1864
+ var _Vector2 = _interopRequireDefault(_Vector);
 
 
 
 
 
 
 
 
1865
 
1866
+ var _Bounds = __webpack_require__(2);
 
 
 
 
 
 
 
 
 
 
 
1867
 
1868
+ var _padding = __webpack_require__(17);
 
 
 
 
 
 
 
 
 
 
 
 
1869
 
1870
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1871
 
1872
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
1873
 
1874
+ var BACKGROUND_REPEAT = exports.BACKGROUND_REPEAT = {
1875
+ REPEAT: 0,
1876
+ NO_REPEAT: 1,
1877
+ REPEAT_X: 2,
1878
+ REPEAT_Y: 3
1879
+ };
1880
 
1881
+ var BACKGROUND_SIZE = exports.BACKGROUND_SIZE = {
1882
+ AUTO: 0,
1883
+ CONTAIN: 1,
1884
+ COVER: 2,
1885
+ LENGTH: 3
1886
+ };
1887
 
1888
+ var BACKGROUND_CLIP = exports.BACKGROUND_CLIP = {
1889
+ BORDER_BOX: 0,
1890
+ PADDING_BOX: 1,
1891
+ CONTENT_BOX: 2
1892
+ };
1893
 
1894
+ var BACKGROUND_ORIGIN = exports.BACKGROUND_ORIGIN = BACKGROUND_CLIP;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1895
 
1896
+ var AUTO = 'auto';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1897
 
1898
+ var BackgroundSize = function BackgroundSize(size) {
1899
+ _classCallCheck(this, BackgroundSize);
 
 
 
 
 
 
 
 
 
1900
 
1901
+ switch (size) {
1902
+ case 'contain':
1903
+ this.size = BACKGROUND_SIZE.CONTAIN;
1904
+ break;
1905
+ case 'cover':
1906
+ this.size = BACKGROUND_SIZE.COVER;
1907
+ break;
1908
+ case 'auto':
1909
+ this.size = BACKGROUND_SIZE.AUTO;
1910
+ break;
1911
+ default:
1912
+ this.value = new _Length2.default(size);
1913
+ }
1914
+ };
1915
 
1916
+ var calculateBackgroundSize = exports.calculateBackgroundSize = function calculateBackgroundSize(backgroundImage, image, bounds) {
1917
+ var width = 0;
1918
+ var height = 0;
1919
+ var size = backgroundImage.size;
1920
+ if (size[0].size === BACKGROUND_SIZE.CONTAIN || size[0].size === BACKGROUND_SIZE.COVER) {
1921
+ var targetRatio = bounds.width / bounds.height;
1922
+ var currentRatio = image.width / image.height;
1923
+ 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);
1924
+ }
1925
 
1926
+ if (size[0].value) {
1927
+ width = size[0].value.getAbsoluteValue(bounds.width);
1928
+ }
1929
 
1930
+ if (size[0].size === BACKGROUND_SIZE.AUTO && size[1].size === BACKGROUND_SIZE.AUTO) {
1931
+ height = image.height;
1932
+ } else if (size[1].size === BACKGROUND_SIZE.AUTO) {
1933
+ height = width / image.width * image.height;
1934
+ } else if (size[1].value) {
1935
+ height = size[1].value.getAbsoluteValue(bounds.height);
1936
+ }
1937
 
1938
+ if (size[0].size === BACKGROUND_SIZE.AUTO) {
1939
+ width = height / image.height * image.width;
1940
+ }
1941
 
1942
+ return new _Size2.default(width, height);
1943
+ };
1944
 
1945
+ var calculateGradientBackgroundSize = exports.calculateGradientBackgroundSize = function calculateGradientBackgroundSize(backgroundImage, bounds) {
1946
+ var size = backgroundImage.size;
1947
+ var width = size[0].value ? size[0].value.getAbsoluteValue(bounds.width) : bounds.width;
1948
+ var height = size[1].value ? size[1].value.getAbsoluteValue(bounds.height) : size[0].value ? width : bounds.height;
1949
 
1950
+ return new _Size2.default(width, height);
1951
+ };
1952
 
1953
+ var AUTO_SIZE = new BackgroundSize(AUTO);
 
1954
 
1955
+ var calculateBackgroungPaintingArea = exports.calculateBackgroungPaintingArea = function calculateBackgroungPaintingArea(curves, clip) {
1956
+ switch (clip) {
1957
+ case BACKGROUND_CLIP.BORDER_BOX:
1958
+ return (0, _Bounds.calculateBorderBoxPath)(curves);
1959
+ case BACKGROUND_CLIP.PADDING_BOX:
1960
+ default:
1961
+ return (0, _Bounds.calculatePaddingBoxPath)(curves);
1962
+ }
1963
+ };
1964
 
1965
+ var calculateBackgroungPositioningArea = exports.calculateBackgroungPositioningArea = function calculateBackgroungPositioningArea(backgroundOrigin, bounds, padding, border) {
1966
+ var paddingBox = (0, _Bounds.calculatePaddingBox)(bounds, border);
1967
 
1968
+ switch (backgroundOrigin) {
1969
+ case BACKGROUND_ORIGIN.BORDER_BOX:
1970
+ return bounds;
1971
+ case BACKGROUND_ORIGIN.CONTENT_BOX:
1972
+ var paddingLeft = padding[_padding.PADDING_SIDES.LEFT].getAbsoluteValue(bounds.width);
1973
+ var paddingRight = padding[_padding.PADDING_SIDES.RIGHT].getAbsoluteValue(bounds.width);
1974
+ var paddingTop = padding[_padding.PADDING_SIDES.TOP].getAbsoluteValue(bounds.width);
1975
+ var paddingBottom = padding[_padding.PADDING_SIDES.BOTTOM].getAbsoluteValue(bounds.width);
1976
+ return new _Bounds.Bounds(paddingBox.left + paddingLeft, paddingBox.top + paddingTop, paddingBox.width - paddingLeft - paddingRight, paddingBox.height - paddingTop - paddingBottom);
1977
+ case BACKGROUND_ORIGIN.PADDING_BOX:
1978
+ default:
1979
+ return paddingBox;
1980
+ }
1981
+ };
1982
 
1983
+ var calculateBackgroundPosition = exports.calculateBackgroundPosition = function calculateBackgroundPosition(position, size, bounds) {
1984
+ return new _Vector2.default(position[0].getAbsoluteValue(bounds.width - size.width), position[1].getAbsoluteValue(bounds.height - size.height));
1985
+ };
1986
 
1987
+ var calculateBackgroundRepeatPath = exports.calculateBackgroundRepeatPath = function calculateBackgroundRepeatPath(background, position, size, backgroundPositioningArea, bounds) {
1988
+ var repeat = background.repeat;
1989
+ switch (repeat) {
1990
+ case BACKGROUND_REPEAT.REPEAT_X:
1991
+ 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))];
1992
+ case BACKGROUND_REPEAT.REPEAT_Y:
1993
+ 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))];
1994
+ case BACKGROUND_REPEAT.NO_REPEAT:
1995
+ 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))];
1996
+ default:
1997
+ 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))];
1998
+ }
1999
+ };
2000
 
2001
+ var parseBackground = exports.parseBackground = function parseBackground(style, resourceLoader) {
2002
+ return {
2003
+ backgroundColor: new _Color2.default(style.backgroundColor),
2004
+ backgroundImage: parseBackgroundImages(style, resourceLoader),
2005
+ backgroundClip: parseBackgroundClip(style.backgroundClip),
2006
+ backgroundOrigin: parseBackgroundOrigin(style.backgroundOrigin)
2007
+ };
2008
+ };
2009
 
2010
+ var parseBackgroundClip = function parseBackgroundClip(backgroundClip) {
2011
+ switch (backgroundClip) {
2012
+ case 'padding-box':
2013
+ return BACKGROUND_CLIP.PADDING_BOX;
2014
+ case 'content-box':
2015
+ return BACKGROUND_CLIP.CONTENT_BOX;
2016
+ }
2017
+ return BACKGROUND_CLIP.BORDER_BOX;
2018
+ };
2019
 
2020
+ var parseBackgroundOrigin = function parseBackgroundOrigin(backgroundOrigin) {
2021
+ switch (backgroundOrigin) {
2022
+ case 'padding-box':
2023
+ return BACKGROUND_ORIGIN.PADDING_BOX;
2024
+ case 'content-box':
2025
+ return BACKGROUND_ORIGIN.CONTENT_BOX;
2026
+ }
2027
+ return BACKGROUND_ORIGIN.BORDER_BOX;
2028
+ };
2029
 
2030
+ var parseBackgroundRepeat = function parseBackgroundRepeat(backgroundRepeat) {
2031
+ switch (backgroundRepeat.trim()) {
2032
+ case 'no-repeat':
2033
+ return BACKGROUND_REPEAT.NO_REPEAT;
2034
+ case 'repeat-x':
2035
+ case 'repeat no-repeat':
2036
+ return BACKGROUND_REPEAT.REPEAT_X;
2037
+ case 'repeat-y':
2038
+ case 'no-repeat repeat':
2039
+ return BACKGROUND_REPEAT.REPEAT_Y;
2040
+ case 'repeat':
2041
+ return BACKGROUND_REPEAT.REPEAT;
2042
+ }
2043
 
2044
+ if (true) {
2045
+ console.error('Invalid background-repeat value "' + backgroundRepeat + '"');
2046
+ }
 
 
 
2047
 
2048
+ return BACKGROUND_REPEAT.REPEAT;
2049
+ };
 
 
 
 
 
2050
 
2051
+ var parseBackgroundImages = function parseBackgroundImages(style, resourceLoader) {
2052
+ var sources = parseBackgroundImage(style.backgroundImage).map(function (backgroundImage) {
2053
+ if (backgroundImage.method === 'url') {
2054
+ var key = resourceLoader.loadImage(backgroundImage.args[0]);
2055
+ backgroundImage.args = key ? [key] : [];
2056
+ }
2057
+ return backgroundImage;
2058
+ });
2059
+ var positions = style.backgroundPosition.split(',');
2060
+ var repeats = style.backgroundRepeat.split(',');
2061
+ var sizes = style.backgroundSize.split(',');
2062
 
2063
+ return sources.map(function (source, index) {
2064
+ var size = (sizes[index] || AUTO).trim().split(' ').map(parseBackgroundSize);
2065
+ var position = (positions[index] || AUTO).trim().split(' ').map(parseBackgoundPosition);
 
 
 
 
 
2066
 
2067
+ return {
2068
+ source: source,
2069
+ repeat: parseBackgroundRepeat(typeof repeats[index] === 'string' ? repeats[index] : repeats[0]),
2070
+ size: size.length < 2 ? [size[0], AUTO_SIZE] : [size[0], size[1]],
2071
+ position: position.length < 2 ? [position[0], position[0]] : [position[0], position[1]]
2072
+ };
2073
+ });
2074
+ };
 
 
 
 
 
2075
 
2076
+ var parseBackgroundSize = function parseBackgroundSize(size) {
2077
+ return size === 'auto' ? AUTO_SIZE : new BackgroundSize(size);
2078
+ };
2079
 
2080
+ var parseBackgoundPosition = function parseBackgoundPosition(position) {
2081
+ switch (position) {
2082
+ case 'bottom':
2083
+ case 'right':
2084
+ return new _Length2.default('100%');
2085
+ case 'left':
2086
+ case 'top':
2087
+ return new _Length2.default('0%');
2088
+ case 'auto':
2089
+ return new _Length2.default('0');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2090
  }
2091
+ return new _Length2.default(position);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2092
  };
2093
 
2094
+ var parseBackgroundImage = exports.parseBackgroundImage = function parseBackgroundImage(image) {
2095
+ var whitespace = /^\s$/;
2096
+ var results = [];
 
 
 
 
2097
 
2098
+ var args = [];
2099
+ var method = '';
2100
+ var quote = null;
2101
+ var definition = '';
2102
+ var mode = 0;
2103
+ var numParen = 0;
2104
 
2105
+ var appendResult = function appendResult() {
2106
+ var prefix = '';
2107
+ if (method) {
2108
+ if (definition.substr(0, 1) === '"') {
2109
+ definition = definition.substr(1, definition.length - 2);
2110
+ }
2111
 
2112
+ if (definition) {
2113
+ args.push(definition.trim());
2114
+ }
2115
 
2116
+ var prefix_i = method.indexOf('-', 1) + 1;
2117
+ if (method.substr(0, 1) === '-' && prefix_i > 0) {
2118
+ prefix = method.substr(0, prefix_i).toLowerCase();
2119
+ method = method.substr(prefix_i);
2120
+ }
2121
+ method = method.toLowerCase();
2122
+ if (method !== 'none') {
2123
+ results.push({
2124
+ prefix: prefix,
2125
+ method: method,
2126
+ args: args
2127
+ });
2128
+ }
2129
+ }
2130
+ args = [];
2131
+ method = definition = '';
2132
+ };
2133
 
2134
+ image.split('').forEach(function (c) {
2135
+ if (mode === 0 && whitespace.test(c)) {
2136
+ return;
2137
+ }
2138
+ switch (c) {
2139
+ case '"':
2140
+ if (!quote) {
2141
+ quote = c;
2142
+ } else if (quote === c) {
2143
+ quote = null;
2144
+ }
2145
+ break;
2146
+ case '(':
2147
+ if (quote) {
2148
+ break;
2149
+ } else if (mode === 0) {
2150
+ mode = 1;
2151
+ return;
2152
+ } else {
2153
+ numParen++;
2154
+ }
2155
+ break;
2156
+ case ')':
2157
+ if (quote) {
2158
+ break;
2159
+ } else if (mode === 1) {
2160
+ if (numParen === 0) {
2161
+ mode = 0;
2162
+ appendResult();
2163
+ return;
2164
+ } else {
2165
+ numParen--;
2166
+ }
2167
+ }
2168
+ break;
2169
 
2170
+ case ',':
2171
+ if (quote) {
2172
+ break;
2173
+ } else if (mode === 0) {
2174
+ appendResult();
2175
+ return;
2176
+ } else if (mode === 1) {
2177
+ if (numParen === 0 && !method.match(/^url$/i)) {
2178
+ args.push(definition.trim());
2179
+ definition = '';
2180
+ return;
2181
+ }
2182
+ }
2183
+ break;
2184
+ }
2185
 
2186
+ if (mode === 0) {
2187
+ method += c;
2188
+ } else {
2189
+ definition += c;
2190
+ }
2191
+ });
2192
 
2193
+ appendResult();
2194
+ return results;
2195
+ };
2196
 
2197
  /***/ }),
2198
+ /* 6 */
 
2199
  /***/ (function(module, exports, __webpack_require__) {
2200
 
2201
+ "use strict";
 
 
 
2202
 
 
 
2203
 
2204
+ Object.defineProperty(exports, "__esModule", {
2205
+ value: true
2206
+ });
2207
+ var PATH = exports.PATH = {
2208
+ VECTOR: 0,
2209
+ BEZIER_CURVE: 1,
2210
+ CIRCLE: 2
2211
+ };
2212
 
2213
  /***/ }),
2214
+ /* 7 */
 
2215
  /***/ (function(module, exports, __webpack_require__) {
2216
 
2217
+ "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2218
 
 
 
2219
 
2220
+ Object.defineProperty(exports, "__esModule", {
2221
+ value: true
 
 
 
 
 
 
 
 
 
 
 
2222
  });
2223
 
2224
+ var _Path = __webpack_require__(6);
2225
 
2226
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
2227
 
2228
+ var Vector = function Vector(x, y) {
2229
+ _classCallCheck(this, Vector);
 
2230
 
2231
+ this.type = _Path.PATH.VECTOR;
2232
+ this.x = x;
2233
+ this.y = y;
2234
+ if (true) {
2235
+ if (isNaN(x)) {
2236
+ console.error('Invalid x value given for Vector');
2237
+ }
2238
+ if (isNaN(y)) {
2239
+ console.error('Invalid y value given for Vector');
2240
+ }
2241
+ }
2242
  };
2243
 
2244
+ exports.default = Vector;
 
 
 
 
 
 
 
 
 
 
 
 
 
2245
 
2246
  /***/ }),
2247
+ /* 8 */
 
2248
  /***/ (function(module, exports, __webpack_require__) {
2249
 
2250
+ "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2251
 
 
 
 
 
 
 
2252
 
2253
+ Object.defineProperty(exports, "__esModule", {
2254
+ value: true
2255
+ });
2256
+ exports.parseListStyle = exports.parseListStyleType = exports.LIST_STYLE_TYPE = exports.LIST_STYLE_POSITION = undefined;
2257
 
2258
+ var _background = __webpack_require__(5);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2259
 
2260
+ var LIST_STYLE_POSITION = exports.LIST_STYLE_POSITION = {
2261
+ INSIDE: 0,
2262
+ OUTSIDE: 1
2263
  };
2264
 
2265
+ var LIST_STYLE_TYPE = exports.LIST_STYLE_TYPE = {
2266
+ NONE: -1,
2267
+ DISC: 0,
2268
+ CIRCLE: 1,
2269
+ SQUARE: 2,
2270
+ DECIMAL: 3,
2271
+ CJK_DECIMAL: 4,
2272
+ DECIMAL_LEADING_ZERO: 5,
2273
+ LOWER_ROMAN: 6,
2274
+ UPPER_ROMAN: 7,
2275
+ LOWER_GREEK: 8,
2276
+ LOWER_ALPHA: 9,
2277
+ UPPER_ALPHA: 10,
2278
+ ARABIC_INDIC: 11,
2279
+ ARMENIAN: 12,
2280
+ BENGALI: 13,
2281
+ CAMBODIAN: 14,
2282
+ CJK_EARTHLY_BRANCH: 15,
2283
+ CJK_HEAVENLY_STEM: 16,
2284
+ CJK_IDEOGRAPHIC: 17,
2285
+ DEVANAGARI: 18,
2286
+ ETHIOPIC_NUMERIC: 19,
2287
+ GEORGIAN: 20,
2288
+ GUJARATI: 21,
2289
+ GURMUKHI: 22,
2290
+ HEBREW: 22,
2291
+ HIRAGANA: 23,
2292
+ HIRAGANA_IROHA: 24,
2293
+ JAPANESE_FORMAL: 25,
2294
+ JAPANESE_INFORMAL: 26,
2295
+ KANNADA: 27,
2296
+ KATAKANA: 28,
2297
+ KATAKANA_IROHA: 29,
2298
+ KHMER: 30,
2299
+ KOREAN_HANGUL_FORMAL: 31,
2300
+ KOREAN_HANJA_FORMAL: 32,
2301
+ KOREAN_HANJA_INFORMAL: 33,
2302
+ LAO: 34,
2303
+ LOWER_ARMENIAN: 35,
2304
+ MALAYALAM: 36,
2305
+ MONGOLIAN: 37,
2306
+ MYANMAR: 38,
2307
+ ORIYA: 39,
2308
+ PERSIAN: 40,
2309
+ SIMP_CHINESE_FORMAL: 41,
2310
+ SIMP_CHINESE_INFORMAL: 42,
2311
+ TAMIL: 43,
2312
+ TELUGU: 44,
2313
+ THAI: 45,
2314
+ TIBETAN: 46,
2315
+ TRAD_CHINESE_FORMAL: 47,
2316
+ TRAD_CHINESE_INFORMAL: 48,
2317
+ UPPER_ARMENIAN: 49,
2318
+ DISCLOSURE_OPEN: 50,
2319
+ DISCLOSURE_CLOSED: 51
2320
+ };
2321
 
2322
+ var parseListStyleType = exports.parseListStyleType = function parseListStyleType(type) {
2323
+ switch (type) {
2324
+ case 'disc':
2325
+ return LIST_STYLE_TYPE.DISC;
2326
+ case 'circle':
2327
+ return LIST_STYLE_TYPE.CIRCLE;
2328
+ case 'square':
2329
+ return LIST_STYLE_TYPE.SQUARE;
2330
+ case 'decimal':
2331
+ return LIST_STYLE_TYPE.DECIMAL;
2332
+ case 'cjk-decimal':
2333
+ return LIST_STYLE_TYPE.CJK_DECIMAL;
2334
+ case 'decimal-leading-zero':
2335
+ return LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO;
2336
+ case 'lower-roman':
2337
+ return LIST_STYLE_TYPE.LOWER_ROMAN;
2338
+ case 'upper-roman':
2339
+ return LIST_STYLE_TYPE.UPPER_ROMAN;
2340
+ case 'lower-greek':
2341
+ return LIST_STYLE_TYPE.LOWER_GREEK;
2342
+ case 'lower-alpha':
2343
+ return LIST_STYLE_TYPE.LOWER_ALPHA;
2344
+ case 'upper-alpha':
2345
+ return LIST_STYLE_TYPE.UPPER_ALPHA;
2346
+ case 'arabic-indic':
2347
+ return LIST_STYLE_TYPE.ARABIC_INDIC;
2348
+ case 'armenian':
2349
+ return LIST_STYLE_TYPE.ARMENIAN;
2350
+ case 'bengali':
2351
+ return LIST_STYLE_TYPE.BENGALI;
2352
+ case 'cambodian':
2353
+ return LIST_STYLE_TYPE.CAMBODIAN;
2354
+ case 'cjk-earthly-branch':
2355
+ return LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH;
2356
+ case 'cjk-heavenly-stem':
2357
+ return LIST_STYLE_TYPE.CJK_HEAVENLY_STEM;
2358
+ case 'cjk-ideographic':
2359
+ return LIST_STYLE_TYPE.CJK_IDEOGRAPHIC;
2360
+ case 'devanagari':
2361
+ return LIST_STYLE_TYPE.DEVANAGARI;
2362
+ case 'ethiopic-numeric':
2363
+ return LIST_STYLE_TYPE.ETHIOPIC_NUMERIC;
2364
+ case 'georgian':
2365
+ return LIST_STYLE_TYPE.GEORGIAN;
2366
+ case 'gujarati':
2367
+ return LIST_STYLE_TYPE.GUJARATI;
2368
+ case 'gurmukhi':
2369
+ return LIST_STYLE_TYPE.GURMUKHI;
2370
+ case 'hebrew':
2371
+ return LIST_STYLE_TYPE.HEBREW;
2372
+ case 'hiragana':
2373
+ return LIST_STYLE_TYPE.HIRAGANA;
2374
+ case 'hiragana-iroha':
2375
+ return LIST_STYLE_TYPE.HIRAGANA_IROHA;
2376
+ case 'japanese-formal':
2377
+ return LIST_STYLE_TYPE.JAPANESE_FORMAL;
2378
+ case 'japanese-informal':
2379
+ return LIST_STYLE_TYPE.JAPANESE_INFORMAL;
2380
+ case 'kannada':
2381
+ return LIST_STYLE_TYPE.KANNADA;
2382
+ case 'katakana':
2383
+ return LIST_STYLE_TYPE.KATAKANA;
2384
+ case 'katakana-iroha':
2385
+ return LIST_STYLE_TYPE.KATAKANA_IROHA;
2386
+ case 'khmer':
2387
+ return LIST_STYLE_TYPE.KHMER;
2388
+ case 'korean-hangul-formal':
2389
+ return LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL;
2390
+ case 'korean-hanja-formal':
2391
+ return LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL;
2392
+ case 'korean-hanja-informal':
2393
+ return LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL;
2394
+ case 'lao':
2395
+ return LIST_STYLE_TYPE.LAO;
2396
+ case 'lower-armenian':
2397
+ return LIST_STYLE_TYPE.LOWER_ARMENIAN;
2398
+ case 'malayalam':
2399
+ return LIST_STYLE_TYPE.MALAYALAM;
2400
+ case 'mongolian':
2401
+ return LIST_STYLE_TYPE.MONGOLIAN;
2402
+ case 'myanmar':
2403
+ return LIST_STYLE_TYPE.MYANMAR;
2404
+ case 'oriya':
2405
+ return LIST_STYLE_TYPE.ORIYA;
2406
+ case 'persian':
2407
+ return LIST_STYLE_TYPE.PERSIAN;
2408
+ case 'simp-chinese-formal':
2409
+ return LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL;
2410
+ case 'simp-chinese-informal':
2411
+ return LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL;
2412
+ case 'tamil':
2413
+ return LIST_STYLE_TYPE.TAMIL;
2414
+ case 'telugu':
2415
+ return LIST_STYLE_TYPE.TELUGU;
2416
+ case 'thai':
2417
+ return LIST_STYLE_TYPE.THAI;
2418
+ case 'tibetan':
2419
+ return LIST_STYLE_TYPE.TIBETAN;
2420
+ case 'trad-chinese-formal':
2421
+ return LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL;
2422
+ case 'trad-chinese-informal':
2423
+ return LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL;
2424
+ case 'upper-armenian':
2425
+ return LIST_STYLE_TYPE.UPPER_ARMENIAN;
2426
+ case 'disclosure-open':
2427
+ return LIST_STYLE_TYPE.DISCLOSURE_OPEN;
2428
+ case 'disclosure-closed':
2429
+ return LIST_STYLE_TYPE.DISCLOSURE_CLOSED;
2430
+ case 'none':
2431
+ default:
2432
+ return LIST_STYLE_TYPE.NONE;
2433
+ }
2434
+ };
2435
 
2436
+ var parseListStyle = exports.parseListStyle = function parseListStyle(style) {
2437
+ var listStyleImage = (0, _background.parseBackgroundImage)(style.getPropertyValue('list-style-image'));
2438
+ return {
2439
+ listStyleType: parseListStyleType(style.getPropertyValue('list-style-type')),
2440
+ listStyleImage: listStyleImage.length ? listStyleImage[0] : null,
2441
+ listStylePosition: parseListStylePosition(style.getPropertyValue('list-style-position'))
2442
+ };
2443
+ };
 
2444
 
2445
+ var parseListStylePosition = function parseListStylePosition(position) {
2446
+ switch (position) {
2447
+ case 'inside':
2448
+ return LIST_STYLE_POSITION.INSIDE;
2449
+ case 'outside':
2450
+ default:
2451
+ return LIST_STYLE_POSITION.OUTSIDE;
2452
+ }
2453
  };
2454
 
2455
  /***/ }),
2456
+ /* 9 */
 
2457
  /***/ (function(module, exports, __webpack_require__) {
2458
 
2459
+ "use strict";
 
 
 
 
 
2460
 
 
 
 
2461
 
2462
+ Object.defineProperty(exports, "__esModule", {
2463
+ value: true
2464
+ });
2465
 
2466
+ 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; }; }();
2467
 
2468
+ var _textTransform = __webpack_require__(20);
 
 
2469
 
2470
+ var _TextBounds = __webpack_require__(22);
 
2471
 
2472
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
2473
 
2474
+ var TextContainer = function () {
2475
+ function TextContainer(text, parent, bounds) {
2476
+ _classCallCheck(this, TextContainer);
2477
 
2478
+ this.text = text;
2479
+ this.parent = parent;
2480
+ this.bounds = bounds;
2481
+ }
2482
 
2483
+ _createClass(TextContainer, null, [{
2484
+ key: 'fromTextNode',
2485
+ value: function fromTextNode(node, parent) {
2486
+ var text = transform(node.data, parent.style.textTransform);
2487
+ return new TextContainer(text, parent, (0, _TextBounds.parseTextBounds)(text, parent, node));
2488
+ }
2489
+ }]);
2490
 
2491
+ return TextContainer;
2492
+ }();
2493
 
2494
+ exports.default = TextContainer;
 
2495
 
 
 
2496
 
2497
+ var CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g;
2498
 
2499
+ var transform = function transform(text, _transform) {
2500
+ switch (_transform) {
2501
+ case _textTransform.TEXT_TRANSFORM.LOWERCASE:
2502
+ return text.toLowerCase();
2503
+ case _textTransform.TEXT_TRANSFORM.CAPITALIZE:
2504
+ return text.replace(CAPITALIZE, capitalize);
2505
+ case _textTransform.TEXT_TRANSFORM.UPPERCASE:
2506
+ return text.toUpperCase();
2507
+ default:
2508
+ return text;
2509
+ }
2510
+ };
2511
 
2512
+ function capitalize(m, p1, p2) {
2513
+ if (m.length > 0) {
2514
+ return p1 + p2.toUpperCase();
2515
+ }
2516
 
2517
+ return m;
 
 
 
 
2518
  }
2519
 
2520
+ /***/ }),
2521
+ /* 10 */
2522
+ /***/ (function(module, exports, __webpack_require__) {
2523
 
2524
+ "use strict";
 
 
 
 
 
 
2525
 
 
 
2526
 
2527
+ Object.defineProperty(exports, "__esModule", {
2528
+ value: true
2529
+ });
2530
 
2531
+ var _ForeignObjectRenderer = __webpack_require__(23);
 
2532
 
2533
+ var testRangeBounds = function testRangeBounds(document) {
2534
+ var TEST_HEIGHT = 123;
 
2535
 
2536
+ if (document.createRange) {
2537
+ var range = document.createRange();
2538
+ if (range.getBoundingClientRect) {
2539
+ var testElement = document.createElement('boundtest');
2540
+ testElement.style.height = TEST_HEIGHT + 'px';
2541
+ testElement.style.display = 'block';
2542
+ document.body.appendChild(testElement);
2543
 
2544
+ range.selectNode(testElement);
2545
+ var rangeBounds = range.getBoundingClientRect();
2546
+ var rangeHeight = Math.round(rangeBounds.height);
2547
+ document.body.removeChild(testElement);
2548
+ if (rangeHeight === TEST_HEIGHT) {
2549
+ return true;
2550
+ }
2551
+ }
2552
+ }
 
 
 
2553
 
2554
+ return false;
2555
+ };
2556
 
2557
+ // iOS 10.3 taints canvas with base64 images unless crossOrigin = 'anonymous'
2558
+ var testBase64 = function testBase64(document, src) {
2559
+ var img = new Image();
2560
+ var canvas = document.createElement('canvas');
2561
+ var ctx = canvas.getContext('2d');
2562
+
2563
+ return new Promise(function (resolve) {
2564
+ // Single pixel base64 image renders fine on iOS 10.3???
2565
+ img.src = src;
2566
 
2567
+ var onload = function onload() {
2568
+ try {
2569
+ ctx.drawImage(img, 0, 0);
2570
+ canvas.toDataURL();
2571
+ } catch (e) {
2572
+ return resolve(false);
2573
+ }
2574
 
2575
+ return resolve(true);
2576
+ };
2577
 
2578
+ img.onload = onload;
2579
+ img.onerror = function () {
2580
+ return resolve(false);
2581
+ };
2582
 
2583
+ if (img.complete === true) {
2584
+ setTimeout(function () {
2585
+ onload();
2586
+ }, 500);
2587
+ }
2588
+ });
2589
+ };
2590
 
2591
+ var testCORS = function testCORS() {
2592
+ return typeof new Image().crossOrigin !== 'undefined';
2593
+ };
 
2594
 
2595
+ var testResponseType = function testResponseType() {
2596
+ return typeof new XMLHttpRequest().responseType === 'string';
2597
+ };
2598
 
2599
+ var testSVG = function testSVG(document) {
2600
+ var img = new Image();
2601
+ var canvas = document.createElement('canvas');
2602
+ var ctx = canvas.getContext('2d');
2603
+ img.src = 'data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\'></svg>';
2604
 
2605
+ try {
2606
+ ctx.drawImage(img, 0, 0);
2607
+ canvas.toDataURL();
2608
+ } catch (e) {
2609
+ return false;
2610
+ }
2611
+ return true;
2612
+ };
2613
 
2614
+ var isGreenPixel = function isGreenPixel(data) {
2615
+ return data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255;
2616
+ };
2617
 
2618
+ var testForeignObject = function testForeignObject(document) {
2619
+ var canvas = document.createElement('canvas');
2620
+ var size = 100;
2621
+ canvas.width = size;
2622
+ canvas.height = size;
2623
+ var ctx = canvas.getContext('2d');
2624
+ ctx.fillStyle = 'rgb(0, 255, 0)';
2625
+ ctx.fillRect(0, 0, size, size);
2626
 
2627
+ var img = new Image();
2628
+ var greenImageSrc = canvas.toDataURL();
2629
+ img.src = greenImageSrc;
2630
+ var svg = (0, _ForeignObjectRenderer.createForeignObjectSVG)(size, size, 0, 0, img);
2631
+ ctx.fillStyle = 'red';
2632
+ ctx.fillRect(0, 0, size, size);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2633
 
2634
+ return (0, _ForeignObjectRenderer.loadSerializedSVG)(svg).then(function (img) {
2635
+ ctx.drawImage(img, 0, 0);
2636
+ var data = ctx.getImageData(0, 0, size, size).data;
2637
+ ctx.fillStyle = 'red';
2638
+ ctx.fillRect(0, 0, size, size);
 
 
 
 
 
 
2639
 
2640
+ var node = document.createElement('div');
2641
+ node.style.backgroundImage = 'url(' + greenImageSrc + ')';
2642
+ node.style.height = size + 'px';
2643
+ // Firefox 55 does not render inline <img /> tags
2644
+ return isGreenPixel(data) ? (0, _ForeignObjectRenderer.loadSerializedSVG)((0, _ForeignObjectRenderer.createForeignObjectSVG)(size, size, 0, 0, node)) : Promise.reject(false);
2645
+ }).then(function (img) {
2646
+ ctx.drawImage(img, 0, 0);
2647
+ // Edge does not render background-images
2648
+ return isGreenPixel(ctx.getImageData(0, 0, size, size).data);
2649
+ }).catch(function (e) {
2650
+ return false;
2651
+ });
2652
  };
2653
 
2654
+ var FEATURES = {
2655
+ // $FlowFixMe - get/set properties not yet supported
2656
+ get SUPPORT_RANGE_BOUNDS() {
2657
+ 'use strict';
2658
 
2659
+ var value = testRangeBounds(document);
2660
+ Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });
2661
+ return value;
2662
+ },
2663
+ // $FlowFixMe - get/set properties not yet supported
2664
+ get SUPPORT_SVG_DRAWING() {
2665
+ 'use strict';
2666
 
2667
+ var value = testSVG(document);
2668
+ Object.defineProperty(FEATURES, 'SUPPORT_SVG_DRAWING', { value: value });
2669
+ return value;
2670
+ },
2671
+ // $FlowFixMe - get/set properties not yet supported
2672
+ get SUPPORT_BASE64_DRAWING() {
2673
+ 'use strict';
2674
 
2675
+ return function (src) {
2676
+ var _value = testBase64(document, src);
2677
+ Object.defineProperty(FEATURES, 'SUPPORT_BASE64_DRAWING', { value: function value() {
2678
+ return _value;
2679
+ } });
2680
+ return _value;
2681
+ };
2682
+ },
2683
+ // $FlowFixMe - get/set properties not yet supported
2684
+ get SUPPORT_FOREIGNOBJECT_DRAWING() {
2685
+ 'use strict';
2686
 
2687
+ var value = typeof Array.from === 'function' && typeof window.fetch === 'function' ? testForeignObject(document) : Promise.resolve(false);
2688
+ Object.defineProperty(FEATURES, 'SUPPORT_FOREIGNOBJECT_DRAWING', { value: value });
2689
+ return value;
2690
+ },
2691
+ // $FlowFixMe - get/set properties not yet supported
2692
+ get SUPPORT_CORS_IMAGES() {
2693
+ 'use strict';
2694
 
2695
+ var value = testCORS();
2696
+ Object.defineProperty(FEATURES, 'SUPPORT_CORS_IMAGES', { value: value });
2697
+ return value;
2698
+ },
2699
+ // $FlowFixMe - get/set properties not yet supported
2700
+ get SUPPORT_RESPONSE_TYPE() {
2701
+ 'use strict';
2702
 
2703
+ var value = testResponseType();
2704
+ Object.defineProperty(FEATURES, 'SUPPORT_RESPONSE_TYPE', { value: value });
2705
+ return value;
2706
+ },
2707
+ // $FlowFixMe - get/set properties not yet supported
2708
+ get SUPPORT_CORS_XHR() {
2709
+ 'use strict';
2710
 
2711
+ var value = 'withCredentials' in new XMLHttpRequest();
2712
+ Object.defineProperty(FEATURES, 'SUPPORT_CORS_XHR', { value: value });
2713
+ return value;
2714
+ }
2715
  };
2716
 
2717
+ exports.default = FEATURES;
2718
 
2719
  /***/ }),
2720
+ /* 11 */
2721
+ /***/ (function(module, exports, __webpack_require__) {
2722
 
2723
+ "use strict";
 
2724
 
 
 
 
2725
 
2726
+ Object.defineProperty(exports, "__esModule", {
2727
+ value: true
2728
+ });
2729
+ exports.parseTextDecoration = exports.TEXT_DECORATION_LINE = exports.TEXT_DECORATION = exports.TEXT_DECORATION_STYLE = undefined;
 
2730
 
2731
+ var _Color = __webpack_require__(0);
2732
+
2733
+ var _Color2 = _interopRequireDefault(_Color);
 
 
2734
 
2735
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
2736
 
2737
+ var TEXT_DECORATION_STYLE = exports.TEXT_DECORATION_STYLE = {
2738
+ SOLID: 0,
2739
+ DOUBLE: 1,
2740
+ DOTTED: 2,
2741
+ DASHED: 3,
2742
+ WAVY: 4
2743
  };
2744
 
2745
+ var TEXT_DECORATION = exports.TEXT_DECORATION = {
2746
+ NONE: null
2747
+ };
2748
 
2749
+ var TEXT_DECORATION_LINE = exports.TEXT_DECORATION_LINE = {
2750
+ UNDERLINE: 1,
2751
+ OVERLINE: 2,
2752
+ LINE_THROUGH: 3,
2753
+ BLINK: 4
 
2754
  };
2755
 
2756
+ var parseLine = function parseLine(line) {
2757
+ switch (line) {
2758
+ case 'underline':
2759
+ return TEXT_DECORATION_LINE.UNDERLINE;
2760
+ case 'overline':
2761
+ return TEXT_DECORATION_LINE.OVERLINE;
2762
+ case 'line-through':
2763
+ return TEXT_DECORATION_LINE.LINE_THROUGH;
2764
+ }
2765
+ return TEXT_DECORATION_LINE.BLINK;
2766
+ };
2767
 
2768
+ var parseTextDecorationLine = function parseTextDecorationLine(line) {
2769
+ if (line === 'none') {
2770
+ return null;
2771
+ }
2772
 
2773
+ return line.split(' ').map(parseLine);
 
 
 
 
 
 
 
 
2774
  };
2775
 
2776
+ var parseTextDecorationStyle = function parseTextDecorationStyle(style) {
2777
+ switch (style) {
2778
+ case 'double':
2779
+ return TEXT_DECORATION_STYLE.DOUBLE;
2780
+ case 'dotted':
2781
+ return TEXT_DECORATION_STYLE.DOTTED;
2782
+ case 'dashed':
2783
+ return TEXT_DECORATION_STYLE.DASHED;
2784
+ case 'wavy':
2785
+ return TEXT_DECORATION_STYLE.WAVY;
2786
+ }
2787
+ return TEXT_DECORATION_STYLE.SOLID;
 
 
 
2788
  };
2789
 
2790
+ var parseTextDecoration = exports.parseTextDecoration = function parseTextDecoration(style) {
2791
+ var textDecorationLine = parseTextDecorationLine(style.textDecorationLine ? style.textDecorationLine : style.textDecoration);
2792
+ if (textDecorationLine === null) {
2793
+ return TEXT_DECORATION.NONE;
2794
+ }
2795
 
2796
+ var textDecorationColor = style.textDecorationColor ? new _Color2.default(style.textDecorationColor) : null;
2797
+ var textDecorationStyle = parseTextDecorationStyle(style.textDecorationStyle);
2798
 
2799
+ return {
2800
+ textDecorationLine: textDecorationLine,
2801
+ textDecorationColor: textDecorationColor,
2802
+ textDecorationStyle: textDecorationStyle
2803
+ };
2804
+ };
2805
 
2806
  /***/ }),
2807
+ /* 12 */
 
2808
  /***/ (function(module, exports, __webpack_require__) {
2809
 
2810
+ "use strict";
 
 
 
 
 
 
 
 
 
2811
 
 
 
2812
 
2813
+ Object.defineProperty(exports, "__esModule", {
2814
+ value: true
2815
+ });
2816
+ exports.parseBorder = exports.BORDER_SIDES = exports.BORDER_STYLE = undefined;
 
2817
 
2818
+ var _Color = __webpack_require__(0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2819
 
2820
+ var _Color2 = _interopRequireDefault(_Color);
 
 
 
2821
 
2822
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
2823
 
2824
+ var BORDER_STYLE = exports.BORDER_STYLE = {
2825
+ NONE: 0,
2826
+ SOLID: 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2827
  };
2828
 
2829
+ var BORDER_SIDES = exports.BORDER_SIDES = {
2830
+ TOP: 0,
2831
+ RIGHT: 1,
2832
+ BOTTOM: 2,
2833
+ LEFT: 3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2834
  };
2835
 
2836
+ var SIDES = Object.keys(BORDER_SIDES).map(function (s) {
2837
+ return s.toLowerCase();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2838
  });
2839
 
2840
+ var parseBorderStyle = function parseBorderStyle(style) {
2841
+ switch (style) {
2842
+ case 'none':
2843
+ return BORDER_STYLE.NONE;
2844
+ }
2845
+ return BORDER_STYLE.SOLID;
2846
  };
2847
 
2848
+ var parseBorder = exports.parseBorder = function parseBorder(style) {
2849
+ return SIDES.map(function (side) {
2850
+ var borderColor = new _Color2.default(style.getPropertyValue('border-' + side + '-color'));
2851
+ var borderStyle = parseBorderStyle(style.getPropertyValue('border-' + side + '-style'));
2852
+ var borderWidth = parseFloat(style.getPropertyValue('border-' + side + '-width'));
2853
+ return {
2854
+ borderColor: borderColor,
2855
+ borderStyle: borderStyle,
2856
+ borderWidth: isNaN(borderWidth) ? 0 : borderWidth
2857
+ };
2858
+ });
 
 
 
 
 
 
2859
  };
2860
 
 
2861
  /***/ }),
2862
+ /* 13 */
 
2863
  /***/ (function(module, exports, __webpack_require__) {
2864
 
2865
  "use strict";
2866
 
2867
 
2868
  Object.defineProperty(exports, "__esModule", {
2869
+ value: true
2870
  });
2871
+ var toCodePoints = exports.toCodePoints = function toCodePoints(str) {
2872
+ var codePoints = [];
2873
+ var i = 0;
2874
+ var length = str.length;
2875
+ while (i < length) {
2876
+ var value = str.charCodeAt(i++);
2877
+ if (value >= 0xd800 && value <= 0xdbff && i < length) {
2878
+ var extra = str.charCodeAt(i++);
2879
+ if ((extra & 0xfc00) === 0xdc00) {
2880
+ codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);
2881
+ } else {
2882
+ codePoints.push(value);
2883
+ i--;
2884
+ }
2885
+ } else {
2886
+ codePoints.push(value);
2887
+ }
2888
+ }
2889
+ return codePoints;
2890
+ };
2891
 
2892
+ var fromCodePoint = exports.fromCodePoint = function fromCodePoint() {
2893
+ if (String.fromCodePoint) {
2894
+ return String.fromCodePoint.apply(String, arguments);
2895
+ }
2896
 
2897
+ var length = arguments.length;
2898
+ if (!length) {
2899
+ return '';
2900
+ }
2901
 
2902
+ var codeUnits = [];
2903
 
2904
+ var index = -1;
2905
+ var result = '';
2906
+ while (++index < length) {
2907
+ var codePoint = arguments.length <= index ? undefined : arguments[index];
2908
+ if (codePoint <= 0xffff) {
2909
+ codeUnits.push(codePoint);
2910
+ } else {
2911
+ codePoint -= 0x10000;
2912
+ codeUnits.push((codePoint >> 10) + 0xd800, codePoint % 0x400 + 0xdc00);
2913
+ }
2914
+ if (index + 1 === length || codeUnits.length > 0x4000) {
2915
+ result += String.fromCharCode.apply(String, codeUnits);
2916
+ codeUnits.length = 0;
2917
+ }
2918
+ }
2919
+ return result;
2920
+ };
2921
 
2922
+ var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
2923
 
2924
+ // Use a lookup table to find the index.
2925
+ var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
2926
+ for (var i = 0; i < chars.length; i++) {
2927
+ lookup[chars.charCodeAt(i)] = i;
2928
+ }
2929
+
2930
+ var decode = exports.decode = function decode(base64) {
2931
+ var bufferLength = base64.length * 0.75,
2932
+ len = base64.length,
2933
+ i = void 0,
2934
+ p = 0,
2935
+ encoded1 = void 0,
2936
+ encoded2 = void 0,
2937
+ encoded3 = void 0,
2938
+ encoded4 = void 0;
2939
 
2940
+ if (base64[base64.length - 1] === '=') {
2941
+ bufferLength--;
2942
+ if (base64[base64.length - 2] === '=') {
2943
+ bufferLength--;
2944
+ }
2945
+ }
2946
 
2947
+ var buffer = typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint8Array.prototype.slice !== 'undefined' ? new ArrayBuffer(bufferLength) : new Array(bufferLength);
2948
+ var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
2949
 
2950
+ for (i = 0; i < len; i += 4) {
2951
+ encoded1 = lookup[base64.charCodeAt(i)];
2952
+ encoded2 = lookup[base64.charCodeAt(i + 1)];
2953
+ encoded3 = lookup[base64.charCodeAt(i + 2)];
2954
+ encoded4 = lookup[base64.charCodeAt(i + 3)];
2955
 
2956
+ bytes[p++] = encoded1 << 2 | encoded2 >> 4;
2957
+ bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
2958
+ bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
2959
+ }
2960
 
2961
+ return buffer;
2962
+ };
2963
 
2964
+ var polyUint16Array = exports.polyUint16Array = function polyUint16Array(buffer) {
2965
+ var length = buffer.length;
2966
+ var bytes = [];
2967
+ for (var _i = 0; _i < length; _i += 2) {
2968
+ bytes.push(buffer[_i + 1] << 8 | buffer[_i]);
2969
+ }
2970
+ return bytes;
2971
+ };
2972
 
2973
+ var polyUint32Array = exports.polyUint32Array = function polyUint32Array(buffer) {
2974
+ var length = buffer.length;
2975
+ var bytes = [];
2976
+ for (var _i2 = 0; _i2 < length; _i2 += 4) {
2977
+ bytes.push(buffer[_i2 + 3] << 24 | buffer[_i2 + 2] << 16 | buffer[_i2 + 1] << 8 | buffer[_i2]);
2978
+ }
2979
+ return bytes;
2980
+ };
2981
 
2982
  /***/ }),
2983
+ /* 14 */
 
2984
  /***/ (function(module, exports, __webpack_require__) {
2985
 
2986
  "use strict";
2987
 
2988
 
2989
  Object.defineProperty(exports, "__esModule", {
2990
+ value: true
2991
  });
2992
+ exports.createCounterText = exports.inlineListItemElement = exports.getListOwner = undefined;
 
 
 
 
 
 
 
2993
 
2994
+ var _Util = __webpack_require__(4);
 
 
2995
 
2996
+ var _NodeContainer = __webpack_require__(3);
2997
 
2998
+ var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
 
2999
 
3000
+ var _TextContainer = __webpack_require__(9);
3001
 
3002
+ var _TextContainer2 = _interopRequireDefault(_TextContainer);
3003
 
3004
+ var _listStyle = __webpack_require__(8);
 
 
 
3005
 
3006
+ var _Unicode = __webpack_require__(24);
3007
 
3008
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3009
 
3010
+ // Margin between the enumeration and the list item content
3011
+ var MARGIN_RIGHT = 7;
3012
 
3013
+ var ancestorTypes = ['OL', 'UL', 'MENU'];
3014
 
3015
+ var getListOwner = exports.getListOwner = function getListOwner(container) {
3016
+ var parent = container.parent;
3017
+ if (!parent) {
3018
+ return null;
3019
+ }
3020
 
3021
+ do {
3022
+ var isAncestor = ancestorTypes.indexOf(parent.tagName) !== -1;
3023
+ if (isAncestor) {
3024
+ return parent;
3025
+ }
3026
+ parent = parent.parent;
3027
+ } while (parent);
3028
 
3029
+ return container.parent;
3030
+ };
3031
 
3032
+ var inlineListItemElement = exports.inlineListItemElement = function inlineListItemElement(node, container, resourceLoader) {
3033
+ var listStyle = container.style.listStyle;
3034
 
3035
+ if (!listStyle) {
3036
+ return;
3037
+ }
3038
 
3039
+ var style = node.ownerDocument.defaultView.getComputedStyle(node, null);
3040
+ var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
3041
+ (0, _Util.copyCSSStyles)(style, wrapper);
3042
 
3043
+ wrapper.style.position = 'absolute';
3044
+ wrapper.style.bottom = 'auto';
3045
+ wrapper.style.display = 'block';
3046
+ wrapper.style.letterSpacing = 'normal';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3047
 
3048
+ switch (listStyle.listStylePosition) {
3049
+ case _listStyle.LIST_STYLE_POSITION.OUTSIDE:
3050
+ wrapper.style.left = 'auto';
3051
+ wrapper.style.right = node.ownerDocument.defaultView.innerWidth - container.bounds.left - container.style.margin[1].getAbsoluteValue(container.bounds.width) + MARGIN_RIGHT + 'px';
3052
+ wrapper.style.textAlign = 'right';
3053
+ break;
3054
+ case _listStyle.LIST_STYLE_POSITION.INSIDE:
3055
+ wrapper.style.left = container.bounds.left - container.style.margin[3].getAbsoluteValue(container.bounds.width) + 'px';
3056
+ wrapper.style.right = 'auto';
3057
+ wrapper.style.textAlign = 'left';
3058
+ break;
3059
+ }
3060
 
3061
+ var text = void 0;
3062
+ var MARGIN_TOP = container.style.margin[0].getAbsoluteValue(container.bounds.width);
3063
+ var styleImage = listStyle.listStyleImage;
3064
+ if (styleImage) {
3065
+ if (styleImage.method === 'url') {
3066
+ var image = node.ownerDocument.createElement('img');
3067
+ image.src = styleImage.args[0];
3068
+ wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px';
3069
+ wrapper.style.width = 'auto';
3070
+ wrapper.style.height = 'auto';
3071
+ wrapper.appendChild(image);
3072
+ } else {
3073
+ var size = parseFloat(container.style.font.fontSize) * 0.5;
3074
+ wrapper.style.top = container.bounds.top - MARGIN_TOP + container.bounds.height - 1.5 * size + 'px';
3075
+ wrapper.style.width = size + 'px';
3076
+ wrapper.style.height = size + 'px';
3077
+ wrapper.style.backgroundImage = style.listStyleImage;
3078
+ }
3079
+ } else if (typeof container.listIndex === 'number') {
3080
+ text = node.ownerDocument.createTextNode(createCounterText(container.listIndex, listStyle.listStyleType, true));
3081
+ wrapper.appendChild(text);
3082
+ wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px';
3083
+ }
3084
 
3085
+ // $FlowFixMe
3086
+ var body = node.ownerDocument.body;
3087
+ body.appendChild(wrapper);
3088
 
3089
+ if (text) {
3090
+ container.childNodes.push(_TextContainer2.default.fromTextNode(text, container));
3091
+ body.removeChild(wrapper);
3092
+ } else {
3093
+ // $FlowFixMe
3094
+ container.childNodes.push(new _NodeContainer2.default(wrapper, container, resourceLoader, 0));
3095
+ }
3096
+ };
3097
 
3098
+ var ROMAN_UPPER = {
3099
+ integers: [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],
3100
+ values: ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
3101
+ };
3102
 
3103
+ var ARMENIAN = {
3104
+ 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],
3105
+ values: ['Ք', 'Փ', 'Ւ', 'Ց', 'Ր', 'Տ', 'Վ', 'Ս', 'Ռ', 'Ջ', 'Պ', 'Չ', 'Ո', 'Շ', 'Ն', 'Յ', 'Մ', 'Ճ', 'Ղ', 'Ձ', 'Հ', 'Կ', 'Ծ', 'Խ', 'Լ', 'Ի', 'Ժ', 'Թ', 'Ը', 'Է', 'Զ', 'Ե', 'Դ', 'Գ', 'Բ', 'Ա']
3106
+ };
3107
 
3108
+ var HEBREW = {
3109
+ 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],
3110
+ values: ['י׳', 'ט׳', 'ח׳', 'ז׳', 'ו׳', 'ה׳', 'ד׳', 'ג׳', 'ב׳', 'א׳', 'ת', 'ש', 'ר', 'ק', 'צ', 'פ', 'ע', 'ס', 'נ', 'מ', 'ל', 'כ', 'יט', 'יח', 'יז', 'טז', 'טו', 'י', 'ט', 'ח', 'ז', 'ו', 'ה', 'ד', 'ג', 'ב', 'א']
3111
+ };
3112
 
3113
+ var GEORGIAN = {
3114
+ 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],
3115
+ values: ['ჵ', 'ჰ', 'ჯ', 'ჴ', 'ხ', 'ჭ', 'წ', 'ძ', 'ც', 'ჩ', 'შ', 'ყ', 'ღ', 'ქ', 'ფ', 'ჳ', 'ტ', 'ს', 'რ', 'ჟ', 'პ', 'ო', 'ჲ', 'ნ', 'მ', 'ლ', 'კ', 'ი', 'თ', 'ჱ', 'ზ', 'ვ', 'ე', 'დ', 'გ', 'ბ', 'ა']
3116
+ };
 
 
 
 
3117
 
3118
+ var createAdditiveCounter = function createAdditiveCounter(value, min, max, symbols, fallback, suffix) {
3119
+ if (value < min || value > max) {
3120
+ return createCounterText(value, fallback, suffix.length > 0);
3121
+ }
 
 
 
 
3122
 
3123
+ return symbols.integers.reduce(function (string, integer, index) {
3124
+ while (value >= integer) {
3125
+ value -= integer;
3126
+ string += symbols.values[index];
3127
+ }
3128
+ return string;
3129
+ }, '') + suffix;
3130
  };
3131
 
3132
+ var createCounterStyleWithSymbolResolver = function createCounterStyleWithSymbolResolver(value, codePointRangeLength, isNumeric, resolver) {
3133
+ var string = '';
 
 
 
 
 
 
 
 
3134
 
3135
+ do {
3136
+ if (!isNumeric) {
3137
+ value--;
3138
+ }
3139
+ string = resolver(value) + string;
3140
+ value /= codePointRangeLength;
3141
+ } while (value * codePointRangeLength >= codePointRangeLength);
3142
 
3143
+ return string;
3144
+ };
3145
 
3146
+ var createCounterStyleFromRange = function createCounterStyleFromRange(value, codePointRangeStart, codePointRangeEnd, isNumeric, suffix) {
3147
+ var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;
3148
 
3149
+ return (value < 0 ? '-' : '') + (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, function (codePoint) {
3150
+ return (0, _Unicode.fromCodePoint)(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart);
3151
+ }) + suffix);
3152
+ };
3153
 
3154
+ var createCounterStyleFromSymbols = function createCounterStyleFromSymbols(value, symbols) {
3155
+ var suffix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '. ';
3156
 
3157
+ var codePointRangeLength = symbols.length;
3158
+ return createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function (codePoint) {
3159
+ return symbols[Math.floor(codePoint % codePointRangeLength)];
3160
+ }) + suffix;
3161
+ };
3162
 
3163
+ var CJK_ZEROS = 1 << 0;
3164
+ var CJK_TEN_COEFFICIENTS = 1 << 1;
3165
+ var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;
3166
+ var CJK_HUNDRED_COEFFICIENTS = 1 << 3;
3167
 
3168
+ var createCJKCounter = function createCJKCounter(value, numbers, multipliers, negativeSign, suffix, flags) {
3169
+ if (value < -9999 || value > 9999) {
3170
+ return createCounterText(value, _listStyle.LIST_STYLE_TYPE.CJK_DECIMAL, suffix.length > 0);
3171
+ }
3172
+ var tmp = Math.abs(value);
3173
+ var string = suffix;
3174
 
3175
+ if (tmp === 0) {
3176
+ return numbers[0] + string;
3177
+ }
 
 
 
 
 
 
 
 
 
3178
 
3179
+ for (var digit = 0; tmp > 0 && digit <= 4; digit++) {
3180
+ var coefficient = tmp % 10;
3181
 
3182
+ if (coefficient === 0 && (0, _Util.contains)(flags, CJK_ZEROS) && string !== '') {
3183
+ string = numbers[coefficient] + string;
3184
+ } 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)) {
3185
+ string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : '') + string;
3186
+ } else if (coefficient === 1 && digit > 0) {
3187
+ string = multipliers[digit - 1] + string;
3188
+ }
3189
+ tmp = Math.floor(tmp / 10);
3190
+ }
3191
 
3192
+ return (value < 0 ? negativeSign : '') + string;
3193
+ };
3194
 
3195
+ var CHINESE_INFORMAL_MULTIPLIERS = '十百千萬';
3196
+ var CHINESE_FORMAL_MULTIPLIERS = '拾佰仟萬';
3197
+ var JAPANESE_NEGATIVE = 'マイナス';
3198
+ var KOREAN_NEGATIVE = '마이너스 ';
3199
 
3200
+ var createCounterText = exports.createCounterText = function createCounterText(value, type, appendSuffix) {
3201
+ var defaultSuffix = appendSuffix ? '. ' : '';
3202
+ var cjkSuffix = appendSuffix ? '、' : '';
3203
+ var koreanSuffix = appendSuffix ? ', ' : '';
3204
+ switch (type) {
3205
+ case _listStyle.LIST_STYLE_TYPE.DISC:
3206
+ return '•';
3207
+ case _listStyle.LIST_STYLE_TYPE.CIRCLE:
3208
+ return '◦';
3209
+ case _listStyle.LIST_STYLE_TYPE.SQUARE:
3210
+ return '◾';
3211
+ case _listStyle.LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:
3212
+ var string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
3213
+ return string.length < 4 ? '0' + string : string;
3214
+ case _listStyle.LIST_STYLE_TYPE.CJK_DECIMAL:
3215
+ return createCounterStyleFromSymbols(value, '〇一二三四五六七八九', cjkSuffix);
3216
+ case _listStyle.LIST_STYLE_TYPE.LOWER_ROMAN:
3217
+ return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
3218
+ case _listStyle.LIST_STYLE_TYPE.UPPER_ROMAN:
3219
+ return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
3220
+ case _listStyle.LIST_STYLE_TYPE.LOWER_GREEK:
3221
+ return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);
3222
+ case _listStyle.LIST_STYLE_TYPE.LOWER_ALPHA:
3223
+ return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);
3224
+ case _listStyle.LIST_STYLE_TYPE.UPPER_ALPHA:
3225
+ return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);
3226
+ case _listStyle.LIST_STYLE_TYPE.ARABIC_INDIC:
3227
+ return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);
3228
+ case _listStyle.LIST_STYLE_TYPE.ARMENIAN:
3229
+ case _listStyle.LIST_STYLE_TYPE.UPPER_ARMENIAN:
3230
+ return createAdditiveCounter(value, 1, 9999, ARMENIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
3231
+ case _listStyle.LIST_STYLE_TYPE.LOWER_ARMENIAN:
3232
+ return createAdditiveCounter(value, 1, 9999, ARMENIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
3233
+ case _listStyle.LIST_STYLE_TYPE.BENGALI:
3234
+ return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);
3235
+ case _listStyle.LIST_STYLE_TYPE.CAMBODIAN:
3236
+ case _listStyle.LIST_STYLE_TYPE.KHMER:
3237
+ return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);
3238
+ case _listStyle.LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:
3239
+ return createCounterStyleFromSymbols(value, '子丑寅卯辰巳午未申酉戌亥', cjkSuffix);
3240
+ case _listStyle.LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:
3241
+ return createCounterStyleFromSymbols(value, '甲乙丙丁戊己庚辛壬癸', cjkSuffix);
3242
+ case _listStyle.LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:
3243
+ case _listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:
3244
+ return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
3245
+ case _listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:
3246
+ return createCJKCounter(value, '零壹貳參肆伍陸柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
3247
+ case _listStyle.LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL:
3248
+ return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
3249
+ case _listStyle.LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL:
3250
+ return createCJKCounter(value, '零壹贰叁肆伍陆柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
3251
+ case _listStyle.LIST_STYLE_TYPE.JAPANESE_INFORMAL:
3252
+ return createCJKCounter(value, '〇一二三四五六七八九', '十百千万', JAPANESE_NEGATIVE, cjkSuffix, 0);
3253
+ case _listStyle.LIST_STYLE_TYPE.JAPANESE_FORMAL:
3254
+ return createCJKCounter(value, '零壱弐参四伍六七八九', '拾百千万', JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
3255
+ case _listStyle.LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:
3256
+ return createCJKCounter(value, '영일이삼사오육칠팔구', '십백천만', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
3257
+ case _listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:
3258
+ return createCJKCounter(value, '零一二三四五六七八九', '十百千萬', KOREAN_NEGATIVE, koreanSuffix, 0);
3259
+ case _listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:
3260
+ return createCJKCounter(value, '零壹貳參四五六七八九', '拾百千', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
3261
+ case _listStyle.LIST_STYLE_TYPE.DEVANAGARI:
3262
+ return createCounterStyleFromRange(value, 0x966, 0x96f, true, defaultSuffix);
3263
+ case _listStyle.LIST_STYLE_TYPE.GEORGIAN:
3264
+ return createAdditiveCounter(value, 1, 19999, GEORGIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
3265
+ case _listStyle.LIST_STYLE_TYPE.GUJARATI:
3266
+ return createCounterStyleFromRange(value, 0xae6, 0xaef, true, defaultSuffix);
3267
+ case _listStyle.LIST_STYLE_TYPE.GURMUKHI:
3268
+ return createCounterStyleFromRange(value, 0xa66, 0xa6f, true, defaultSuffix);
3269
+ case _listStyle.LIST_STYLE_TYPE.HEBREW:
3270
+ return createAdditiveCounter(value, 1, 10999, HEBREW, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
3271
+ case _listStyle.LIST_STYLE_TYPE.HIRAGANA:
3272
+ return createCounterStyleFromSymbols(value, 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん');
3273
+ case _listStyle.LIST_STYLE_TYPE.HIRAGANA_IROHA:
3274
+ return createCounterStyleFromSymbols(value, 'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす');
3275
+ case _listStyle.LIST_STYLE_TYPE.KANNADA:
3276
+ return createCounterStyleFromRange(value, 0xce6, 0xcef, true, defaultSuffix);
3277
+ case _listStyle.LIST_STYLE_TYPE.KATAKANA:
3278
+ return createCounterStyleFromSymbols(value, 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン', cjkSuffix);
3279
+ case _listStyle.LIST_STYLE_TYPE.KATAKANA_IROHA:
3280
+ return createCounterStyleFromSymbols(value, 'イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス', cjkSuffix);
3281
+ case _listStyle.LIST_STYLE_TYPE.LAO:
3282
+ return createCounterStyleFromRange(value, 0xed0, 0xed9, true, defaultSuffix);
3283
+ case _listStyle.LIST_STYLE_TYPE.MONGOLIAN:
3284
+ return createCounterStyleFromRange(value, 0x1810, 0x1819, true, defaultSuffix);
3285
+ case _listStyle.LIST_STYLE_TYPE.MYANMAR:
3286
+ return createCounterStyleFromRange(value, 0x1040, 0x1049, true, defaultSuffix);
3287
+ case _listStyle.LIST_STYLE_TYPE.ORIYA:
3288
+ return createCounterStyleFromRange(value, 0xb66, 0xb6f, true, defaultSuffix);
3289
+ case _listStyle.LIST_STYLE_TYPE.PERSIAN:
3290
+ return createCounterStyleFromRange(value, 0x6f0, 0x6f9, true, defaultSuffix);
3291
+ case _listStyle.LIST_STYLE_TYPE.TAMIL:
3292
+ return createCounterStyleFromRange(value, 0xbe6, 0xbef, true, defaultSuffix);
3293
+ case _listStyle.LIST_STYLE_TYPE.TELUGU:
3294
+ return createCounterStyleFromRange(value, 0xc66, 0xc6f, true, defaultSuffix);
3295
+ case _listStyle.LIST_STYLE_TYPE.THAI:
3296
+ return createCounterStyleFromRange(value, 0xe50, 0xe59, true, defaultSuffix);
3297
+ case _listStyle.LIST_STYLE_TYPE.TIBETAN:
3298
+ return createCounterStyleFromRange(value, 0xf20, 0xf29, true, defaultSuffix);
3299
+ case _listStyle.LIST_STYLE_TYPE.DECIMAL:
3300
+ default:
3301
+ return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
3302
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3303
  };
3304
 
3305
  /***/ }),
3306
+ /* 15 */
 
3307
  /***/ (function(module, exports, __webpack_require__) {
3308
 
3309
  "use strict";
3310
 
3311
 
3312
  Object.defineProperty(exports, "__esModule", {
3313
+ value: true
3314
  });
3315
 
3316
+ 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; }; }();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3317
 
3318
+ var _Path = __webpack_require__(6);
3319
 
3320
+ var _textDecoration = __webpack_require__(11);
3321
 
3322
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
3323
 
3324
+ var addColorStops = function addColorStops(gradient, canvasGradient) {
3325
+ var maxStop = Math.max.apply(null, gradient.colorStops.map(function (colorStop) {
3326
+ return colorStop.stop;
3327
+ }));
3328
+ var f = 1 / Math.max(1, maxStop);
3329
+ gradient.colorStops.forEach(function (colorStop) {
3330
+ canvasGradient.addColorStop(f * colorStop.stop, colorStop.color.toString());
 
 
 
 
 
 
 
 
 
 
 
3331
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3332
  };
3333
 
3334
+ var CanvasRenderer = function () {
3335
+ function CanvasRenderer(canvas) {
3336
+ _classCallCheck(this, CanvasRenderer);
3337
 
3338
+ this.canvas = canvas ? canvas : document.createElement('canvas');
3339
+ }
3340
 
3341
+ _createClass(CanvasRenderer, [{
3342
+ key: 'render',
3343
+ value: function render(options) {
3344
+ this.ctx = this.canvas.getContext('2d');
3345
+ this.options = options;
3346
+ this.canvas.width = Math.floor(options.width * options.scale);
3347
+ this.canvas.height = Math.floor(options.height * options.scale);
3348
+ this.canvas.style.width = options.width + 'px';
3349
+ this.canvas.style.height = options.height + 'px';
3350
 
3351
+ this.ctx.scale(this.options.scale, this.options.scale);
3352
+ this.ctx.translate(-options.x, -options.y);
3353
+ this.ctx.textBaseline = 'bottom';
3354
+ options.logger.log('Canvas renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + this.options.scale);
3355
+ }
3356
+ }, {
3357
+ key: 'clip',
3358
+ value: function clip(clipPaths, callback) {
3359
+ var _this = this;
3360
 
3361
+ if (clipPaths.length) {
3362
+ this.ctx.save();
3363
+ clipPaths.forEach(function (path) {
3364
+ _this.path(path);
3365
+ _this.ctx.clip();
3366
+ });
3367
+ }
3368
 
3369
+ callback();
 
 
 
 
 
 
 
 
3370
 
3371
+ if (clipPaths.length) {
3372
+ this.ctx.restore();
3373
+ }
3374
+ }
3375
+ }, {
3376
+ key: 'drawImage',
3377
+ value: function drawImage(image, source, destination) {
3378
+ this.ctx.drawImage(image, source.left, source.top, source.width, source.height, destination.left, destination.top, destination.width, destination.height);
3379
+ }
3380
+ }, {
3381
+ key: 'drawShape',
3382
+ value: function drawShape(path, color) {
3383
+ this.path(path);
3384
+ this.ctx.fillStyle = color.toString();
3385
+ this.ctx.fill();
3386
+ }
3387
+ }, {
3388
+ key: 'fill',
3389
+ value: function fill(color) {
3390
+ this.ctx.fillStyle = color.toString();
3391
+ this.ctx.fill();
3392
+ }
3393
+ }, {
3394
+ key: 'getTarget',
3395
+ value: function getTarget() {
3396
+ this.canvas.getContext('2d').setTransform(1, 0, 0, 1, 0, 0);
3397
+ return Promise.resolve(this.canvas);
3398
+ }
3399
+ }, {
3400
+ key: 'path',
3401
+ value: function path(_path) {
3402
+ var _this2 = this;
3403
 
3404
+ this.ctx.beginPath();
3405
+ if (Array.isArray(_path)) {
3406
+ _path.forEach(function (point, index) {
3407
+ var start = point.type === _Path.PATH.VECTOR ? point : point.start;
3408
+ if (index === 0) {
3409
+ _this2.ctx.moveTo(start.x, start.y);
3410
+ } else {
3411
+ _this2.ctx.lineTo(start.x, start.y);
3412
+ }
3413
 
3414
+ if (point.type === _Path.PATH.BEZIER_CURVE) {
3415
+ _this2.ctx.bezierCurveTo(point.startControl.x, point.startControl.y, point.endControl.x, point.endControl.y, point.end.x, point.end.y);
3416
+ }
3417
+ });
3418
+ } else {
3419
+ this.ctx.arc(_path.x + _path.radius, _path.y + _path.radius, _path.radius, 0, Math.PI * 2, true);
3420
+ }
3421
 
3422
+ this.ctx.closePath();
3423
+ }
3424
+ }, {
3425
+ key: 'rectangle',
3426
+ value: function rectangle(x, y, width, height, color) {
3427
+ this.ctx.fillStyle = color.toString();
3428
+ this.ctx.fillRect(x, y, width, height);
3429
+ }
3430
+ }, {
3431
+ key: 'renderLinearGradient',
3432
+ value: function renderLinearGradient(bounds, gradient) {
3433
+ 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);
3434
 
3435
+ addColorStops(gradient, linearGradient);
3436
+ this.ctx.fillStyle = linearGradient;
3437
+ this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height);
3438
+ }
3439
+ }, {
3440
+ key: 'renderRadialGradient',
3441
+ value: function renderRadialGradient(bounds, gradient) {
3442
+ var _this3 = this;
3443
 
3444
+ var x = bounds.left + gradient.center.x;
3445
+ var y = bounds.top + gradient.center.y;
 
 
 
 
 
 
 
3446
 
3447
+ var radialGradient = this.ctx.createRadialGradient(x, y, 0, x, y, gradient.radius.x);
3448
+ if (!radialGradient) {
3449
+ return;
3450
+ }
3451
 
3452
+ addColorStops(gradient, radialGradient);
3453
+ this.ctx.fillStyle = radialGradient;
3454
 
3455
+ if (gradient.radius.x !== gradient.radius.y) {
3456
+ // transforms for elliptical radial gradient
3457
+ var midX = bounds.left + 0.5 * bounds.width;
3458
+ var midY = bounds.top + 0.5 * bounds.height;
3459
+ var f = gradient.radius.y / gradient.radius.x;
3460
+ var invF = 1 / f;
3461
 
3462
+ this.transform(midX, midY, [1, 0, 0, f, 0, 0], function () {
3463
+ return _this3.ctx.fillRect(bounds.left, invF * (bounds.top - midY) + midY, bounds.width, bounds.height * invF);
3464
+ });
3465
+ } else {
3466
+ this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height);
3467
+ }
3468
+ }
3469
+ }, {
3470
+ key: 'renderRepeat',
3471
+ value: function renderRepeat(path, image, imageSize, offsetX, offsetY) {
3472
+ this.path(path);
3473
+ this.ctx.fillStyle = this.ctx.createPattern(this.resizeImage(image, imageSize), 'repeat');
3474
+ this.ctx.translate(offsetX, offsetY);
3475
+ this.ctx.fill();
3476
+ this.ctx.translate(-offsetX, -offsetY);
3477
+ }
3478
+ }, {
3479
+ key: 'renderTextNode',
3480
+ value: function renderTextNode(textBounds, color, font, textDecoration, textShadows) {
3481
+ var _this4 = this;
3482
 
3483
+ this.ctx.font = [font.fontStyle, font.fontVariant, font.fontWeight, font.fontSize, font.fontFamily].join(' ');
 
 
 
3484
 
3485
+ textBounds.forEach(function (text) {
3486
+ _this4.ctx.fillStyle = color.toString();
3487
+ if (textShadows && text.text.trim().length) {
3488
+ textShadows.slice(0).reverse().forEach(function (textShadow) {
3489
+ _this4.ctx.shadowColor = textShadow.color.toString();
3490
+ _this4.ctx.shadowOffsetX = textShadow.offsetX * _this4.options.scale;
3491
+ _this4.ctx.shadowOffsetY = textShadow.offsetY * _this4.options.scale;
3492
+ _this4.ctx.shadowBlur = textShadow.blur;
3493
 
3494
+ _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
3495
+ });
3496
+ } else {
3497
+ _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
3498
+ }
3499
 
3500
+ if (textDecoration !== null) {
3501
+ var textDecorationColor = textDecoration.textDecorationColor || color;
3502
+ textDecoration.textDecorationLine.forEach(function (textDecorationLine) {
3503
+ switch (textDecorationLine) {
3504
+ case _textDecoration.TEXT_DECORATION_LINE.UNDERLINE:
3505
+ // Draws a line at the baseline of the font
3506
+ // TODO As some browsers display the line as more than 1px if the font-size is big,
3507
+ // need to take that into account both in position and size
3508
+ var _options$fontMetrics$ = _this4.options.fontMetrics.getMetrics(font),
3509
+ baseline = _options$fontMetrics$.baseline;
3510
 
3511
+ _this4.rectangle(text.bounds.left, Math.round(text.bounds.top + baseline), text.bounds.width, 1, textDecorationColor);
3512
+ break;
3513
+ case _textDecoration.TEXT_DECORATION_LINE.OVERLINE:
3514
+ _this4.rectangle(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1, textDecorationColor);
3515
+ break;
3516
+ case _textDecoration.TEXT_DECORATION_LINE.LINE_THROUGH:
3517
+ // TODO try and find exact position for line-through
3518
+ var _options$fontMetrics$2 = _this4.options.fontMetrics.getMetrics(font),
3519
+ middle = _options$fontMetrics$2.middle;
3520
 
3521
+ _this4.rectangle(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1, textDecorationColor);
3522
+ break;
3523
+ }
3524
+ });
3525
+ }
3526
+ });
3527
+ }
3528
+ }, {
3529
+ key: 'resizeImage',
3530
+ value: function resizeImage(image, size) {
3531
+ if (image.width === size.width && image.height === size.height) {
3532
+ return image;
3533
+ }
3534
 
3535
+ var canvas = this.canvas.ownerDocument.createElement('canvas');
3536
+ canvas.width = size.width;
3537
+ canvas.height = size.height;
3538
+ var ctx = canvas.getContext('2d');
3539
+ ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, size.width, size.height);
3540
+ return canvas;
3541
+ }
3542
+ }, {
3543
+ key: 'setOpacity',
3544
+ value: function setOpacity(opacity) {
3545
+ this.ctx.globalAlpha = opacity;
3546
+ }
3547
+ }, {
3548
+ key: 'transform',
3549
+ value: function transform(offsetX, offsetY, matrix, callback) {
3550
+ this.ctx.save();
3551
+ this.ctx.translate(offsetX, offsetY);
3552
+ this.ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
3553
+ this.ctx.translate(-offsetX, -offsetY);
3554
 
3555
+ callback();
 
 
 
 
 
3556
 
3557
+ this.ctx.restore();
3558
+ }
3559
+ }]);
3560
 
3561
+ return CanvasRenderer;
3562
+ }();
 
3563
 
3564
+ exports.default = CanvasRenderer;
3565
 
3566
+ /***/ }),
3567
+ /* 16 */
3568
  /***/ (function(module, exports, __webpack_require__) {
3569
 
3570
  "use strict";
3571
 
3572
 
3573
  Object.defineProperty(exports, "__esModule", {
3574
+ value: true
3575
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3576
 
3577
+ 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; }; }();
 
 
 
 
 
 
 
 
3578
 
3579
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
3580
 
3581
+ var Logger = function () {
3582
+ function Logger(enabled, id, start) {
3583
+ _classCallCheck(this, Logger);
 
3584
 
3585
+ this.enabled = typeof window !== 'undefined' && enabled;
3586
+ this.start = start ? start : Date.now();
3587
+ this.id = id;
3588
+ }
3589
 
3590
+ _createClass(Logger, [{
3591
+ key: 'child',
3592
+ value: function child(id) {
3593
+ return new Logger(this.enabled, id, this.start);
3594
+ }
3595
 
3596
+ // eslint-disable-next-line flowtype/no-weak-types
 
 
 
3597
 
3598
+ }, {
3599
+ key: 'log',
3600
+ value: function log() {
3601
+ if (this.enabled && window.console && window.console.log) {
3602
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
3603
+ args[_key] = arguments[_key];
3604
+ }
3605
 
3606
+ 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)));
3607
+ }
3608
+ }
 
3609
 
3610
+ // eslint-disable-next-line flowtype/no-weak-types
 
 
 
3611
 
3612
+ }, {
3613
+ key: 'error',
3614
+ value: function error() {
3615
+ if (this.enabled && window.console && window.console.error) {
3616
+ for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3617
+ args[_key2] = arguments[_key2];
3618
+ }
 
 
 
 
 
 
 
3619
 
3620
+ 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)));
3621
+ }
3622
+ }
3623
+ }]);
3624
 
3625
+ return Logger;
3626
+ }();
 
3627
 
3628
+ exports.default = Logger;
3629
 
3630
  /***/ }),
3631
+ /* 17 */
 
3632
  /***/ (function(module, exports, __webpack_require__) {
3633
 
3634
  "use strict";
3635
 
3636
 
3637
  Object.defineProperty(exports, "__esModule", {
3638
+ value: true
3639
  });
3640
+ exports.parsePadding = exports.PADDING_SIDES = undefined;
 
 
 
 
 
 
 
 
3641
 
3642
+ var _Length = __webpack_require__(1);
3643
 
3644
+ var _Length2 = _interopRequireDefault(_Length);
3645
 
3646
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3647
 
3648
+ var PADDING_SIDES = exports.PADDING_SIDES = {
3649
+ TOP: 0,
3650
+ RIGHT: 1,
3651
+ BOTTOM: 2,
3652
+ LEFT: 3
 
 
 
 
 
 
 
3653
  };
3654
 
3655
+ var SIDES = ['top', 'right', 'bottom', 'left'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3656
 
3657
+ var parsePadding = exports.parsePadding = function parsePadding(style) {
3658
+ return SIDES.map(function (side) {
3659
+ return new _Length2.default(style.getPropertyValue('padding-' + side));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3660
  });
 
3661
  };
3662
 
3663
  /***/ }),
3664
+ /* 18 */
 
3665
  /***/ (function(module, exports, __webpack_require__) {
3666
 
3667
+ "use strict";
 
3668
 
 
3669
 
3670
+ Object.defineProperty(exports, "__esModule", {
3671
+ value: true
3672
+ });
3673
+ var OVERFLOW_WRAP = exports.OVERFLOW_WRAP = {
3674
+ NORMAL: 0,
3675
+ BREAK_WORD: 1
3676
+ };
3677
 
3678
+ var parseOverflowWrap = exports.parseOverflowWrap = function parseOverflowWrap(overflow) {
3679
+ switch (overflow) {
3680
+ case 'break-word':
3681
+ return OVERFLOW_WRAP.BREAK_WORD;
3682
+ case 'normal':
3683
+ default:
3684
+ return OVERFLOW_WRAP.NORMAL;
3685
+ }
3686
+ };
3687
+
3688
+ /***/ }),
3689
+ /* 19 */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3690
  /***/ (function(module, exports, __webpack_require__) {
3691
 
3692
  "use strict";
3693
 
3694
 
 
 
3695
  Object.defineProperty(exports, "__esModule", {
3696
  value: true
3697
  });
3698
+ var POSITION = exports.POSITION = {
3699
+ STATIC: 0,
3700
+ RELATIVE: 1,
3701
+ ABSOLUTE: 2,
3702
+ FIXED: 3,
3703
+ STICKY: 4
3704
+ };
3705
 
3706
+ var parsePosition = exports.parsePosition = function parsePosition(position) {
3707
+ switch (position) {
3708
+ case 'relative':
3709
+ return POSITION.RELATIVE;
3710
+ case 'absolute':
3711
+ return POSITION.ABSOLUTE;
3712
+ case 'fixed':
3713
+ return POSITION.FIXED;
3714
+ case 'sticky':
3715
+ return POSITION.STICKY;
3716
+ }
3717
 
3718
+ return POSITION.STATIC;
3719
+ };
3720
 
3721
+ /***/ }),
3722
+ /* 20 */
3723
+ /***/ (function(module, exports, __webpack_require__) {
3724
 
3725
+ "use strict";
 
 
 
 
 
 
 
3726
 
 
 
 
 
 
 
 
 
3727
 
3728
+ Object.defineProperty(exports, "__esModule", {
3729
+ value: true
3730
+ });
3731
+ var TEXT_TRANSFORM = exports.TEXT_TRANSFORM = {
3732
+ NONE: 0,
3733
+ LOWERCASE: 1,
3734
+ UPPERCASE: 2,
3735
+ CAPITALIZE: 3
3736
  };
3737
 
3738
+ var parseTextTransform = exports.parseTextTransform = function parseTextTransform(textTransform) {
3739
+ switch (textTransform) {
3740
+ case 'uppercase':
3741
+ return TEXT_TRANSFORM.UPPERCASE;
3742
+ case 'lowercase':
3743
+ return TEXT_TRANSFORM.LOWERCASE;
3744
+ case 'capitalize':
3745
+ return TEXT_TRANSFORM.CAPITALIZE;
3746
  }
 
 
3747
 
3748
+ return TEXT_TRANSFORM.NONE;
 
3749
  };
3750
 
3751
+ /***/ }),
3752
+ /* 21 */
3753
+ /***/ (function(module, exports, __webpack_require__) {
 
3754
 
3755
+ "use strict";
 
 
3756
 
 
 
 
 
 
 
3757
 
3758
+ Object.defineProperty(exports, "__esModule", {
3759
+ value: true
3760
+ });
3761
+ exports.reformatInputBounds = exports.inlineSelectElement = exports.inlineTextAreaElement = exports.inlineInputElement = exports.getInputBorderRadius = exports.INPUT_BACKGROUND = exports.INPUT_BORDERS = exports.INPUT_COLOR = undefined;
 
3762
 
3763
+ var _TextContainer = __webpack_require__(9);
 
 
 
 
 
 
 
 
 
 
3764
 
3765
+ var _TextContainer2 = _interopRequireDefault(_TextContainer);
 
3766
 
3767
+ var _background = __webpack_require__(5);
3768
 
3769
+ var _border = __webpack_require__(12);
3770
 
3771
+ var _Circle = __webpack_require__(50);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3772
 
3773
+ var _Circle2 = _interopRequireDefault(_Circle);
3774
 
3775
+ var _Vector = __webpack_require__(7);
 
 
3776
 
3777
+ var _Vector2 = _interopRequireDefault(_Vector);
3778
 
3779
+ var _Color = __webpack_require__(0);
3780
 
3781
+ var _Color2 = _interopRequireDefault(_Color);
 
 
 
3782
 
3783
+ var _Length = __webpack_require__(1);
3784
 
3785
+ var _Length2 = _interopRequireDefault(_Length);
3786
 
3787
+ var _Bounds = __webpack_require__(2);
3788
 
3789
+ var _TextBounds = __webpack_require__(22);
3790
 
3791
+ var _Util = __webpack_require__(4);
3792
 
3793
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3794
 
3795
+ var INPUT_COLOR = exports.INPUT_COLOR = new _Color2.default([42, 42, 42]);
3796
+ var INPUT_BORDER_COLOR = new _Color2.default([165, 165, 165]);
3797
+ var INPUT_BACKGROUND_COLOR = new _Color2.default([222, 222, 222]);
3798
+ var INPUT_BORDER = {
3799
+ borderWidth: 1,
3800
+ borderColor: INPUT_BORDER_COLOR,
3801
+ borderStyle: _border.BORDER_STYLE.SOLID
3802
+ };
3803
+ var INPUT_BORDERS = exports.INPUT_BORDERS = [INPUT_BORDER, INPUT_BORDER, INPUT_BORDER, INPUT_BORDER];
3804
+ var INPUT_BACKGROUND = exports.INPUT_BACKGROUND = {
3805
+ backgroundColor: INPUT_BACKGROUND_COLOR,
3806
+ backgroundImage: [],
3807
+ backgroundClip: _background.BACKGROUND_CLIP.PADDING_BOX,
3808
+ backgroundOrigin: _background.BACKGROUND_ORIGIN.PADDING_BOX
3809
  };
3810
 
3811
+ var RADIO_BORDER_RADIUS = new _Length2.default('50%');
3812
+ var RADIO_BORDER_RADIUS_TUPLE = [RADIO_BORDER_RADIUS, RADIO_BORDER_RADIUS];
3813
+ var INPUT_RADIO_BORDER_RADIUS = [RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE];
3814
 
3815
+ var CHECKBOX_BORDER_RADIUS = new _Length2.default('3px');
3816
+ var CHECKBOX_BORDER_RADIUS_TUPLE = [CHECKBOX_BORDER_RADIUS, CHECKBOX_BORDER_RADIUS];
3817
+ var INPUT_CHECKBOX_BORDER_RADIUS = [CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE];
 
 
 
 
3818
 
3819
+ var getInputBorderRadius = exports.getInputBorderRadius = function getInputBorderRadius(node) {
3820
+ return node.type === 'radio' ? INPUT_RADIO_BORDER_RADIUS : INPUT_CHECKBOX_BORDER_RADIUS;
3821
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
3822
 
3823
+ var inlineInputElement = exports.inlineInputElement = function inlineInputElement(node, container) {
3824
+ if (node.type === 'radio' || node.type === 'checkbox') {
3825
+ if (node.checked) {
3826
+ var size = Math.min(container.bounds.width, container.bounds.height);
3827
+ 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));
3828
+ }
3829
+ } else {
3830
+ inlineFormElement(getInputValue(node), node, container, false);
3831
+ }
3832
+ };
3833
 
3834
+ var inlineTextAreaElement = exports.inlineTextAreaElement = function inlineTextAreaElement(node, container) {
3835
+ inlineFormElement(node.value, node, container, true);
3836
+ };
3837
 
3838
+ var inlineSelectElement = exports.inlineSelectElement = function inlineSelectElement(node, container) {
3839
+ var option = node.options[node.selectedIndex || 0];
3840
+ inlineFormElement(option ? option.text || '' : '', node, container, false);
3841
+ };
3842
 
3843
+ var reformatInputBounds = exports.reformatInputBounds = function reformatInputBounds(bounds) {
3844
+ if (bounds.width > bounds.height) {
3845
+ bounds.left += (bounds.width - bounds.height) / 2;
3846
+ bounds.width = bounds.height;
3847
+ } else if (bounds.width < bounds.height) {
3848
+ bounds.top += (bounds.height - bounds.width) / 2;
3849
+ bounds.height = bounds.width;
3850
+ }
3851
+ return bounds;
3852
  };
3853
 
3854
+ var inlineFormElement = function inlineFormElement(value, node, container, allowLinebreak) {
3855
+ var body = node.ownerDocument.body;
3856
+ if (value.length > 0 && body) {
3857
+ var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
3858
+ (0, _Util.copyCSSStyles)(node.ownerDocument.defaultView.getComputedStyle(node, null), wrapper);
3859
+ wrapper.style.position = 'absolute';
3860
+ wrapper.style.left = container.bounds.left + 'px';
3861
+ wrapper.style.top = container.bounds.top + 'px';
3862
+ if (!allowLinebreak) {
3863
+ wrapper.style.whiteSpace = 'nowrap';
3864
+ }
3865
+ var text = node.ownerDocument.createTextNode(value);
3866
+ wrapper.appendChild(text);
3867
+ body.appendChild(wrapper);
3868
+ container.childNodes.push(_TextContainer2.default.fromTextNode(text, container));
3869
+ body.removeChild(wrapper);
3870
  }
3871
  };
3872
 
3873
+ var getInputValue = function getInputValue(node) {
3874
+ var value = node.type === 'password' ? new Array(node.value.length + 1).join('\u2022') : node.value;
3875
+
3876
+ return value.length === 0 ? node.placeholder || '' : value;
3877
+ };
3878
+
3879
  /***/ }),
3880
+ /* 22 */
3881
  /***/ (function(module, exports, __webpack_require__) {
3882
 
3883
  "use strict";
3886
  Object.defineProperty(exports, "__esModule", {
3887
  value: true
3888
  });
3889
+ exports.parseTextBounds = exports.TextBounds = undefined;
3890
 
3891
+ var _Bounds = __webpack_require__(2);
3892
 
3893
+ var _textDecoration = __webpack_require__(11);
3894
 
3895
+ var _Feature = __webpack_require__(10);
3896
 
3897
+ var _Feature2 = _interopRequireDefault(_Feature);
3898
 
3899
+ var _Unicode = __webpack_require__(24);
3900
 
3901
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3902
 
3903
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3904
 
3905
+ var TextBounds = exports.TextBounds = function TextBounds(text, bounds) {
3906
+ _classCallCheck(this, TextBounds);
 
 
 
 
 
3907
 
3908
+ this.text = text;
3909
+ this.bounds = bounds;
3910
+ };
3911
 
3912
+ var parseTextBounds = exports.parseTextBounds = function parseTextBounds(value, parent, node) {
3913
+ var letterRendering = parent.style.letterSpacing !== 0;
3914
+ var textList = letterRendering ? (0, _Unicode.toCodePoints)(value).map(function (i) {
3915
+ return (0, _Unicode.fromCodePoint)(i);
3916
+ }) : (0, _Unicode.breakWords)(value, parent);
3917
+ var length = textList.length;
3918
+ var defaultView = node.parentNode ? node.parentNode.ownerDocument.defaultView : null;
3919
+ var scrollX = defaultView ? defaultView.pageXOffset : 0;
3920
+ var scrollY = defaultView ? defaultView.pageYOffset : 0;
3921
+ var textBounds = [];
3922
+ var offset = 0;
3923
+ for (var i = 0; i < length; i++) {
3924
+ var text = textList[i];
3925
+ if (parent.style.textDecoration !== _textDecoration.TEXT_DECORATION.NONE || text.trim().length > 0) {
3926
+ if (_Feature2.default.SUPPORT_RANGE_BOUNDS) {
3927
+ textBounds.push(new TextBounds(text, getRangeBounds(node, offset, text.length, scrollX, scrollY)));
3928
+ } else {
3929
+ var replacementNode = node.splitText(text.length);
3930
+ textBounds.push(new TextBounds(text, getWrapperBounds(node, scrollX, scrollY)));
3931
+ node = replacementNode;
3932
+ }
3933
+ } else if (!_Feature2.default.SUPPORT_RANGE_BOUNDS) {
3934
+ node = node.splitText(text.length);
3935
+ }
3936
+ offset += text.length;
3937
  }
3938
+ return textBounds;
3939
+ };
3940
 
3941
+ var getWrapperBounds = function getWrapperBounds(node, scrollX, scrollY) {
3942
+ var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
3943
+ wrapper.appendChild(node.cloneNode(true));
3944
+ var parentNode = node.parentNode;
3945
+ if (parentNode) {
3946
+ parentNode.replaceChild(wrapper, node);
3947
+ var bounds = (0, _Bounds.parseBounds)(wrapper, scrollX, scrollY);
3948
+ if (wrapper.firstChild) {
3949
+ parentNode.replaceChild(wrapper.firstChild, wrapper);
3950
  }
3951
+ return bounds;
3952
+ }
3953
+ return new _Bounds.Bounds(0, 0, 0, 0);
 
 
 
 
3954
  };
3955
 
3956
+ var getRangeBounds = function getRangeBounds(node, offset, length, scrollX, scrollY) {
3957
+ var range = node.ownerDocument.createRange();
3958
+ range.setStart(node, offset);
3959
+ range.setEnd(node, offset + length);
3960
+ return _Bounds.Bounds.fromClientRect(range.getBoundingClientRect(), scrollX, scrollY);
3961
  };
3962
 
3963
+ /***/ }),
3964
+ /* 23 */
3965
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
3966
 
3967
+ "use strict";
 
 
3968
 
 
 
 
 
3969
 
3970
+ Object.defineProperty(exports, "__esModule", {
3971
+ value: true
3972
+ });
3973
 
3974
+ 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; }; }();
 
3975
 
3976
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
 
 
 
 
 
 
3977
 
3978
+ var ForeignObjectRenderer = function () {
3979
+ function ForeignObjectRenderer(element) {
3980
+ _classCallCheck(this, ForeignObjectRenderer);
 
 
 
 
3981
 
3982
+ this.element = element;
 
 
 
3983
  }
3984
 
3985
+ _createClass(ForeignObjectRenderer, [{
3986
+ key: 'render',
3987
+ value: function render(options) {
3988
+ var _this = this;
 
3989
 
3990
+ this.options = options;
3991
+ this.canvas = document.createElement('canvas');
3992
+ this.ctx = this.canvas.getContext('2d');
3993
+ this.canvas.width = Math.floor(options.width) * options.scale;
3994
+ this.canvas.height = Math.floor(options.height) * options.scale;
3995
+ this.canvas.style.width = options.width + 'px';
3996
+ this.canvas.style.height = options.height + 'px';
3997
 
3998
+ options.logger.log('ForeignObject renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + options.scale);
3999
+ 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);
4000
 
4001
+ return loadSerializedSVG(svg).then(function (img) {
4002
+ if (options.backgroundColor) {
4003
+ _this.ctx.fillStyle = options.backgroundColor.toString();
4004
+ _this.ctx.fillRect(0, 0, options.width * options.scale, options.height * options.scale);
4005
+ }
4006
 
4007
+ _this.ctx.drawImage(img, -options.x * options.scale, -options.y * options.scale);
4008
+ return _this.canvas;
4009
+ });
4010
+ }
4011
+ }]);
4012
 
4013
+ return ForeignObjectRenderer;
4014
+ }();
 
 
 
 
 
 
 
4015
 
4016
+ exports.default = ForeignObjectRenderer;
4017
+ var createForeignObjectSVG = exports.createForeignObjectSVG = function createForeignObjectSVG(width, height, x, y, node) {
4018
+ var xmlns = 'http://www.w3.org/2000/svg';
4019
+ var svg = document.createElementNS(xmlns, 'svg');
4020
+ var foreignObject = document.createElementNS(xmlns, 'foreignObject');
4021
+ svg.setAttributeNS(null, 'width', width);
4022
+ svg.setAttributeNS(null, 'height', height);
4023
 
4024
+ foreignObject.setAttributeNS(null, 'width', '100%');
4025
+ foreignObject.setAttributeNS(null, 'height', '100%');
4026
+ foreignObject.setAttributeNS(null, 'x', x);
4027
+ foreignObject.setAttributeNS(null, 'y', y);
4028
+ foreignObject.setAttributeNS(null, 'externalResourcesRequired', 'true');
4029
+ svg.appendChild(foreignObject);
 
 
 
 
4030
 
4031
+ foreignObject.appendChild(node);
 
 
 
4032
 
4033
+ return svg;
 
 
 
 
 
 
 
 
 
4034
  };
4035
 
4036
+ var loadSerializedSVG = exports.loadSerializedSVG = function loadSerializedSVG(svg) {
4037
+ return new Promise(function (resolve, reject) {
4038
+ var img = new Image();
4039
+ img.onload = function () {
4040
+ return resolve(img);
4041
+ };
4042
+ img.onerror = reject;
4043
+
4044
+ img.src = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(new XMLSerializer().serializeToString(svg));
4045
+ });
4046
  };
4047
 
4048
+ /***/ }),
4049
+ /* 24 */
4050
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
4051
 
4052
+ "use strict";
4053
+
4054
+
4055
+ Object.defineProperty(exports, "__esModule", {
4056
+ value: true
4057
+ });
4058
+ exports.breakWords = exports.fromCodePoint = exports.toCodePoints = undefined;
4059
+
4060
+ var _cssLineBreak = __webpack_require__(46);
4061
+
4062
+ Object.defineProperty(exports, 'toCodePoints', {
4063
+ enumerable: true,
4064
+ get: function get() {
4065
+ return _cssLineBreak.toCodePoints;
4066
+ }
4067
+ });
4068
+ Object.defineProperty(exports, 'fromCodePoint', {
4069
+ enumerable: true,
4070
+ get: function get() {
4071
+ return _cssLineBreak.fromCodePoint;
4072
+ }
4073
+ });
4074
+
4075
+ var _NodeContainer = __webpack_require__(3);
4076
+
4077
+ var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
4078
+
4079
+ var _overflowWrap = __webpack_require__(18);
4080
+
4081
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4082
+
4083
+ var breakWords = exports.breakWords = function breakWords(str, parent) {
4084
+ var breaker = (0, _cssLineBreak.LineBreaker)(str, {
4085
+ lineBreak: parent.style.lineBreak,
4086
+ wordBreak: parent.style.overflowWrap === _overflowWrap.OVERFLOW_WRAP.BREAK_WORD ? 'break-word' : parent.style.wordBreak
4087
+ });
4088
+
4089
+ var words = [];
4090
+ var bk = void 0;
4091
+
4092
+ while (!(bk = breaker.next()).done) {
4093
+ words.push(bk.value.slice());
4094
  }
4095
+
4096
+ return words;
4097
  };
4098
 
4099
  /***/ }),
4100
+ /* 25 */
4101
  /***/ (function(module, exports, __webpack_require__) {
4102
 
4103
  "use strict";
4106
  Object.defineProperty(exports, "__esModule", {
4107
  value: true
4108
  });
4109
+ exports.FontMetrics = undefined;
4110
 
4111
  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; }; }();
4112
 
 
 
 
 
4113
  var _Util = __webpack_require__(4);
4114
 
4115
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4116
 
4117
+ var SAMPLE_TEXT = 'Hidden Text';
4118
 
4119
+ var FontMetrics = exports.FontMetrics = function () {
4120
+ function FontMetrics(document) {
4121
+ _classCallCheck(this, FontMetrics);
4122
 
4123
+ this._data = {};
4124
+ this._document = document;
4125
+ }
4126
 
4127
+ _createClass(FontMetrics, [{
4128
+ key: '_parseMetrics',
4129
+ value: function _parseMetrics(font) {
4130
+ var container = this._document.createElement('div');
4131
+ var img = this._document.createElement('img');
4132
+ var span = this._document.createElement('span');
4133
 
4134
+ var body = this._document.body;
4135
+ if (!body) {
4136
+ throw new Error( true ? 'No document found for font metrics' : '');
4137
+ }
4138
 
4139
+ container.style.visibility = 'hidden';
4140
+ container.style.fontFamily = font.fontFamily;
4141
+ container.style.fontSize = font.fontSize;
4142
+ container.style.margin = '0';
4143
+ container.style.padding = '0';
4144
 
4145
+ body.appendChild(container);
4146
 
4147
+ img.src = _Util.SMALL_IMAGE;
4148
+ img.width = 1;
4149
+ img.height = 1;
4150
 
4151
+ img.style.margin = '0';
4152
+ img.style.padding = '0';
4153
+ img.style.verticalAlign = 'baseline';
4154
 
4155
+ span.style.fontFamily = font.fontFamily;
4156
+ span.style.fontSize = font.fontSize;
4157
+ span.style.margin = '0';
4158
+ span.style.padding = '0';
4159
 
4160
+ span.appendChild(this._document.createTextNode(SAMPLE_TEXT));
4161
+ container.appendChild(span);
4162
+ container.appendChild(img);
4163
+ var baseline = img.offsetTop - span.offsetTop + 2;
4164
 
4165
+ container.removeChild(span);
4166
+ container.appendChild(this._document.createTextNode(SAMPLE_TEXT));
4167
 
4168
+ container.style.lineHeight = 'normal';
4169
+ img.style.verticalAlign = 'super';
4170
 
4171
+ var middle = img.offsetTop - container.offsetTop + 2;
4172
 
4173
+ body.removeChild(container);
4174
 
4175
+ return { baseline: baseline, middle: middle };
4176
+ }
4177
+ }, {
4178
+ key: 'getMetrics',
4179
+ value: function getMetrics(font) {
4180
+ var key = font.fontFamily + ' ' + font.fontSize;
4181
+ if (this._data[key] === undefined) {
4182
+ this._data[key] = this._parseMetrics(font);
4183
+ }
4184
 
4185
+ return this._data[key];
4186
+ }
4187
+ }]);
4188
 
4189
+ return FontMetrics;
4190
+ }();
4191
 
4192
+ /***/ }),
4193
+ /* 26 */
4194
+ /***/ (function(module, exports, __webpack_require__) {
4195
 
4196
+ "use strict";
4197
 
 
4198
 
4199
+ Object.defineProperty(exports, "__esModule", {
4200
+ value: true
4201
+ });
4202
+ exports.Proxy = undefined;
4203
 
4204
+ var _Feature = __webpack_require__(10);
4205
+
4206
+ var _Feature2 = _interopRequireDefault(_Feature);
4207
 
4208
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4209
 
4210
+ var Proxy = exports.Proxy = function Proxy(src, options) {
4211
+ if (!options.proxy) {
4212
+ return Promise.reject( true ? 'No proxy defined' : null);
4213
+ }
4214
+ var proxy = options.proxy;
4215
 
4216
+ return new Promise(function (resolve, reject) {
4217
+ var responseType = _Feature2.default.SUPPORT_CORS_XHR && _Feature2.default.SUPPORT_RESPONSE_TYPE ? 'blob' : 'text';
4218
+ var xhr = _Feature2.default.SUPPORT_CORS_XHR ? new XMLHttpRequest() : new XDomainRequest();
4219
+ xhr.onload = function () {
4220
+ if (xhr instanceof XMLHttpRequest) {
4221
+ if (xhr.status === 200) {
4222
+ if (responseType === 'text') {
4223
+ resolve(xhr.response);
4224
+ } else {
4225
+ var reader = new FileReader();
4226
+ // $FlowFixMe
4227
+ reader.addEventListener('load', function () {
4228
+ return resolve(reader.result);
4229
+ }, false);
4230
+ // $FlowFixMe
4231
+ reader.addEventListener('error', function (e) {
4232
+ return reject(e);
4233
+ }, false);
4234
+ reader.readAsDataURL(xhr.response);
4235
+ }
4236
+ } else {
4237
+ reject( true ? 'Failed to proxy resource ' + src.substring(0, 256) + ' with status code ' + xhr.status : '');
4238
+ }
4239
+ } else {
4240
+ resolve(xhr.responseText);
4241
+ }
4242
+ };
4243
 
4244
+ xhr.onerror = reject;
4245
+ xhr.open('GET', proxy + '?url=' + encodeURIComponent(src) + '&responseType=' + responseType);
 
4246
 
4247
+ if (responseType !== 'text' && xhr instanceof XMLHttpRequest) {
4248
+ xhr.responseType = responseType;
4249
+ }
4250
 
4251
+ if (options.imageTimeout) {
4252
+ var timeout = options.imageTimeout;
4253
+ xhr.timeout = timeout;
4254
+ xhr.ontimeout = function () {
4255
+ return reject( true ? 'Timed out (' + timeout + 'ms) proxying ' + src.substring(0, 256) : '');
4256
+ };
 
4257
  }
 
 
 
 
 
4258
 
4259
+ xhr.send();
4260
+ });
4261
+ };
4262
 
4263
+ /***/ }),
4264
+ /* 27 */
4265
+ /***/ (function(module, exports, __webpack_require__) {
4266
 
4267
+ "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4268
 
 
 
 
 
4269
 
4270
+ 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; };
 
 
 
 
 
 
 
4271
 
4272
+ var _CanvasRenderer = __webpack_require__(15);
 
 
 
 
 
 
 
 
 
4273
 
4274
+ var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);
 
 
 
 
 
4275
 
4276
+ var _Logger = __webpack_require__(16);
 
 
 
 
4277
 
4278
+ var _Logger2 = _interopRequireDefault(_Logger);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4279
 
4280
+ var _Window = __webpack_require__(28);
 
4281
 
4282
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4283
 
4284
+ var html2canvas = function html2canvas(element, conf) {
4285
+ var config = conf || {};
4286
+ var logger = new _Logger2.default(typeof config.logging === 'boolean' ? config.logging : true);
4287
+ logger.log('html2canvas ' + "1.0.0-alpha.12");
4288
 
4289
+ if (true && typeof config.onrendered === 'function') {
4290
+ logger.error('onrendered option is deprecated, html2canvas returns a Promise with the canvas as the value');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4291
  }
4292
 
4293
+ var ownerDocument = element.ownerDocument;
4294
+ if (!ownerDocument) {
4295
+ return Promise.reject('Provided element is not within a Document');
4296
+ }
4297
+ var defaultView = ownerDocument.defaultView;
 
 
 
 
4298
 
4299
+ var defaultOptions = {
4300
+ async: true,
4301
+ allowTaint: false,
4302
+ backgroundColor: '#ffffff',
4303
+ imageTimeout: 15000,
4304
+ logging: true,
4305
+ proxy: null,
4306
+ removeContainer: true,
4307
+ foreignObjectRendering: false,
4308
+ scale: defaultView.devicePixelRatio || 1,
4309
+ target: new _CanvasRenderer2.default(config.canvas),
4310
+ useCORS: false,
4311
+ windowWidth: defaultView.innerWidth,
4312
+ windowHeight: defaultView.innerHeight,
4313
+ scrollX: defaultView.pageXOffset,
4314
+ scrollY: defaultView.pageYOffset
4315
+ };
4316
 
4317
+ var result = (0, _Window.renderElement)(element, _extends({}, defaultOptions, config), logger);
 
 
4318
 
4319
+ if (true) {
4320
+ return result.catch(function (e) {
4321
+ logger.error(e);
4322
+ throw e;
4323
+ });
 
 
 
4324
  }
4325
+ return result;
4326
  };
4327
 
4328
+ html2canvas.CanvasRenderer = _CanvasRenderer2.default;
4329
+
4330
+ module.exports = html2canvas;
4331
 
4332
  /***/ }),
4333
+ /* 28 */
4334
  /***/ (function(module, exports, __webpack_require__) {
4335
 
4336
  "use strict";
4339
  Object.defineProperty(exports, "__esModule", {
4340
  value: true
4341
  });
4342
+ exports.renderElement = undefined;
4343
 
4344
+ 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"); } }; }();
4345
 
4346
+ var _Logger = __webpack_require__(16);
4347
 
4348
+ var _Logger2 = _interopRequireDefault(_Logger);
4349
 
4350
+ var _NodeParser = __webpack_require__(29);
4351
 
4352
+ var _Renderer = __webpack_require__(51);
4353
 
4354
+ var _Renderer2 = _interopRequireDefault(_Renderer);
4355
 
4356
+ var _ForeignObjectRenderer = __webpack_require__(23);
4357
 
4358
+ var _ForeignObjectRenderer2 = _interopRequireDefault(_ForeignObjectRenderer);
4359
+
4360
+ var _Feature = __webpack_require__(10);
4361
+
4362
+ var _Feature2 = _interopRequireDefault(_Feature);
4363
 
4364
  var _Bounds = __webpack_require__(2);
4365
 
4366
+ var _Clone = __webpack_require__(54);
4367
+
4368
+ var _Font = __webpack_require__(25);
4369
+
4370
+ var _Color = __webpack_require__(0);
4371
+
4372
+ var _Color2 = _interopRequireDefault(_Color);
4373
 
4374
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4375
 
4376
+ var renderElement = exports.renderElement = function renderElement(element, options, logger) {
4377
+ var ownerDocument = element.ownerDocument;
4378
 
4379
+ var windowBounds = new _Bounds.Bounds(options.scrollX, options.scrollY, options.windowWidth, options.windowHeight);
 
 
 
 
 
4380
 
4381
+ // http://www.w3.org/TR/css3-background/#special-backgrounds
4382
+ var documentBackgroundColor = ownerDocument.documentElement ? new _Color2.default(getComputedStyle(ownerDocument.documentElement).backgroundColor) : _Color.TRANSPARENT;
4383
+ var bodyBackgroundColor = ownerDocument.body ? new _Color2.default(getComputedStyle(ownerDocument.body).backgroundColor) : _Color.TRANSPARENT;
 
 
 
4384
 
4385
+ 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;
 
 
 
 
4386
 
4387
+ return (options.foreignObjectRendering ? // $FlowFixMe
4388
+ _Feature2.default.SUPPORT_FOREIGNOBJECT_DRAWING : Promise.resolve(false)).then(function (supportForeignObject) {
4389
+ return supportForeignObject ? function (cloner) {
4390
+ if (true) {
4391
+ logger.log('Document cloned, using foreignObject rendering');
4392
+ }
4393
 
4394
+ return cloner.inlineFonts(ownerDocument).then(function () {
4395
+ return cloner.resourceLoader.ready();
4396
+ }).then(function () {
4397
+ var renderer = new _ForeignObjectRenderer2.default(cloner.documentElement);
4398
 
4399
+ var defaultView = ownerDocument.defaultView;
4400
+ var scrollX = defaultView.pageXOffset;
4401
+ var scrollY = defaultView.pageYOffset;
4402
 
4403
+ var isDocument = element.tagName === 'HTML' || element.tagName === 'BODY';
 
 
 
 
 
 
 
 
 
 
 
 
 
4404
 
4405
+ var _ref = isDocument ? (0, _Bounds.parseDocumentSize)(ownerDocument) : (0, _Bounds.parseBounds)(element, scrollX, scrollY),
4406
+ width = _ref.width,
4407
+ height = _ref.height,
4408
+ left = _ref.left,
4409
+ top = _ref.top;
 
 
 
 
4410
 
4411
+ return renderer.render({
4412
+ backgroundColor: backgroundColor,
4413
+ logger: logger,
4414
+ scale: options.scale,
4415
+ x: typeof options.x === 'number' ? options.x : left,
4416
+ y: typeof options.y === 'number' ? options.y : top,
4417
+ width: typeof options.width === 'number' ? options.width : Math.ceil(width),
4418
+ height: typeof options.height === 'number' ? options.height : Math.ceil(height),
4419
+ windowWidth: options.windowWidth,
4420
+ windowHeight: options.windowHeight,
4421
+ scrollX: options.scrollX,
4422
+ scrollY: options.scrollY
4423
+ });
4424
+ });
4425
+ }(new _Clone.DocumentCloner(element, options, logger, true, renderElement)) : (0, _Clone.cloneWindow)(ownerDocument, windowBounds, element, options, logger, renderElement).then(function (_ref2) {
4426
+ var _ref3 = _slicedToArray(_ref2, 3),
4427
+ container = _ref3[0],
4428
+ clonedElement = _ref3[1],
4429
+ resourceLoader = _ref3[2];
4430
 
4431
+ if (true) {
4432
+ logger.log('Document cloned, using computed rendering');
4433
+ }
 
 
 
 
4434
 
4435
+ var stack = (0, _NodeParser.NodeParser)(clonedElement, resourceLoader, logger);
4436
+ var clonedDocument = clonedElement.ownerDocument;
 
4437
 
4438
+ if (backgroundColor === stack.container.style.background.backgroundColor) {
4439
+ stack.container.style.background.backgroundColor = _Color.TRANSPARENT;
4440
+ }
4441
 
4442
+ return resourceLoader.ready().then(function (imageStore) {
4443
+ var fontMetrics = new _Font.FontMetrics(clonedDocument);
4444
+ if (true) {
4445
+ logger.log('Starting renderer');
4446
+ }
4447
 
4448
+ var defaultView = clonedDocument.defaultView;
4449
+ var scrollX = defaultView.pageXOffset;
4450
+ var scrollY = defaultView.pageYOffset;
4451
 
4452
+ var isDocument = clonedElement.tagName === 'HTML' || clonedElement.tagName === 'BODY';
4453
 
4454
+ var _ref4 = isDocument ? (0, _Bounds.parseDocumentSize)(ownerDocument) : (0, _Bounds.parseBounds)(clonedElement, scrollX, scrollY),
4455
+ width = _ref4.width,
4456
+ height = _ref4.height,
4457
+ left = _ref4.left,
4458
+ top = _ref4.top;
 
 
 
 
4459
 
4460
+ var renderOptions = {
4461
+ backgroundColor: backgroundColor,
4462
+ fontMetrics: fontMetrics,
4463
+ imageStore: imageStore,
4464
+ logger: logger,
4465
+ scale: options.scale,
4466
+ x: typeof options.x === 'number' ? options.x : left,
4467
+ y: typeof options.y === 'number' ? options.y : top,
4468
+ width: typeof options.width === 'number' ? options.width : Math.ceil(width),
4469
+ height: typeof options.height === 'number' ? options.height : Math.ceil(height)
4470
+ };
4471
 
4472
+ if (Array.isArray(options.target)) {
4473
+ return Promise.all(options.target.map(function (target) {
4474
+ var renderer = new _Renderer2.default(target, renderOptions);
4475
+ return renderer.render(stack);
4476
+ }));
4477
+ } else {
4478
+ var renderer = new _Renderer2.default(options.target, renderOptions);
4479
+ var canvas = renderer.render(stack);
4480
+ if (options.removeContainer === true) {
4481
+ if (container.parentNode) {
4482
+ container.parentNode.removeChild(container);
4483
+ } else if (true) {
4484
+ logger.log('Cannot detach cloned iframe as it is not in the DOM anymore');
4485
+ }
4486
+ }
4487
 
4488
+ return canvas;
4489
+ }
4490
+ });
4491
+ });
4492
+ });
4493
  };
4494
 
4495
+ /***/ }),
4496
+ /* 29 */
4497
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
4498
 
4499
+ "use strict";
 
 
 
 
 
 
 
4500
 
 
 
 
 
 
 
 
 
 
4501
 
4502
+ Object.defineProperty(exports, "__esModule", {
4503
+ value: true
4504
+ });
4505
+ exports.NodeParser = undefined;
 
 
 
 
 
4506
 
4507
+ var _StackingContext = __webpack_require__(30);
4508
+
4509
+ var _StackingContext2 = _interopRequireDefault(_StackingContext);
4510
+
4511
+ var _NodeContainer = __webpack_require__(3);
4512
+
4513
+ var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
4514
+
4515
+ var _TextContainer = __webpack_require__(9);
4516
+
4517
+ var _TextContainer2 = _interopRequireDefault(_TextContainer);
4518
+
4519
+ var _Input = __webpack_require__(21);
4520
+
4521
+ var _ListItem = __webpack_require__(14);
4522
+
4523
+ var _listStyle = __webpack_require__(8);
4524
+
4525
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4526
+
4527
+ var NodeParser = exports.NodeParser = function NodeParser(node, resourceLoader, logger) {
4528
+ if (true) {
4529
+ logger.log('Starting node parsing');
4530
  }
4531
 
4532
+ var index = 0;
4533
+
4534
+ var container = new _NodeContainer2.default(node, null, resourceLoader, index++);
4535
+ var stack = new _StackingContext2.default(container, null, true);
4536
+
4537
+ parseNodeTree(node, container, stack, resourceLoader, index);
4538
+
4539
  if (true) {
4540
+ logger.log('Finished parsing node tree');
4541
  }
4542
 
4543
+ return stack;
4544
  };
4545
 
4546
+ var IGNORED_NODE_NAMES = ['SCRIPT', 'HEAD', 'TITLE', 'OBJECT', 'BR', 'OPTION'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4547
 
4548
+ var parseNodeTree = function parseNodeTree(node, parent, stack, resourceLoader, index) {
4549
+ if (true && index > 50000) {
4550
+ throw new Error('Recursion error while parsing node tree');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4551
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4552
 
4553
+ for (var childNode = node.firstChild, nextNode; childNode; childNode = nextNode) {
4554
+ nextNode = childNode.nextSibling;
4555
+ var defaultView = childNode.ownerDocument.defaultView;
4556
+ if (childNode instanceof defaultView.Text || childNode instanceof Text || defaultView.parent && childNode instanceof defaultView.parent.Text) {
4557
+ if (childNode.data.trim().length > 0) {
4558
+ parent.childNodes.push(_TextContainer2.default.fromTextNode(childNode, parent));
 
 
 
 
 
 
4559
  }
4560
+ } else if (childNode instanceof defaultView.HTMLElement || childNode instanceof HTMLElement || defaultView.parent && childNode instanceof defaultView.parent.HTMLElement) {
4561
+ if (IGNORED_NODE_NAMES.indexOf(childNode.nodeName) === -1) {
4562
+ var container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++);
4563
+ if (container.isVisible()) {
4564
+ if (childNode.tagName === 'INPUT') {
4565
+ // $FlowFixMe
4566
+ (0, _Input.inlineInputElement)(childNode, container);
4567
+ } else if (childNode.tagName === 'TEXTAREA') {
4568
+ // $FlowFixMe
4569
+ (0, _Input.inlineTextAreaElement)(childNode, container);
4570
+ } else if (childNode.tagName === 'SELECT') {
4571
+ // $FlowFixMe
4572
+ (0, _Input.inlineSelectElement)(childNode, container);
4573
+ } else if (container.style.listStyle && container.style.listStyle.listStyleType !== _listStyle.LIST_STYLE_TYPE.NONE) {
4574
+ (0, _ListItem.inlineListItemElement)(childNode, container, resourceLoader);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4575
  }
 
 
4576
 
4577
+ var SHOULD_TRAVERSE_CHILDREN = childNode.tagName !== 'TEXTAREA';
4578
+ var treatAsRealStackingContext = createsRealStackingContext(container, childNode);
4579
+ if (treatAsRealStackingContext || createsStackingContext(container)) {
4580
+ // for treatAsRealStackingContext:false, any positioned descendants and descendants
4581
+ // which actually create a new stacking context should be considered part of the parent stacking context
4582
+ var parentStack = treatAsRealStackingContext || container.isPositioned() ? stack.getRealParentStackingContext() : stack;
4583
+ var childStack = new _StackingContext2.default(container, parentStack, treatAsRealStackingContext);
4584
+ parentStack.contexts.push(childStack);
4585
+ if (SHOULD_TRAVERSE_CHILDREN) {
4586
+ parseNodeTree(childNode, container, childStack, resourceLoader, index);
4587
+ }
4588
+ } else {
4589
+ stack.children.push(container);
4590
+ if (SHOULD_TRAVERSE_CHILDREN) {
4591
+ parseNodeTree(childNode, container, stack, resourceLoader, index);
4592
+ }
4593
  }
4594
  }
4595
+ }
4596
+ } else if (childNode instanceof defaultView.SVGSVGElement || childNode instanceof SVGSVGElement || defaultView.parent && childNode instanceof defaultView.parent.SVGSVGElement) {
4597
+ var _container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++);
4598
+ var _treatAsRealStackingContext = createsRealStackingContext(_container, childNode);
4599
+ if (_treatAsRealStackingContext || createsStackingContext(_container)) {
4600
+ // for treatAsRealStackingContext:false, any positioned descendants and descendants
4601
+ // which actually create a new stacking context should be considered part of the parent stacking context
4602
+ var _parentStack = _treatAsRealStackingContext || _container.isPositioned() ? stack.getRealParentStackingContext() : stack;
4603
+ var _childStack = new _StackingContext2.default(_container, _parentStack, _treatAsRealStackingContext);
4604
+ _parentStack.contexts.push(_childStack);
4605
+ } else {
4606
+ stack.children.push(_container);
4607
+ }
4608
  }
4609
+ }
4610
+ };
4611
 
4612
+ var createsRealStackingContext = function createsRealStackingContext(container, node) {
4613
+ return container.isRootElement() || container.isPositionedWithZIndex() || container.style.opacity < 1 || container.isTransformed() || isBodyWithTransparentRoot(container, node);
4614
+ };
 
 
 
4615
 
4616
+ var createsStackingContext = function createsStackingContext(container) {
4617
+ return container.isPositioned() || container.isFloating();
4618
+ };
4619
+
4620
+ var isBodyWithTransparentRoot = function isBodyWithTransparentRoot(container, node) {
4621
+ return node.nodeName === 'BODY' && container.parent instanceof _NodeContainer2.default && container.parent.style.background.backgroundColor.isTransparent();
4622
  };
4623
 
4624
  /***/ }),
4625
+ /* 30 */
4626
  /***/ (function(module, exports, __webpack_require__) {
4627
 
4628
  "use strict";
4631
  Object.defineProperty(exports, "__esModule", {
4632
  value: true
4633
  });
4634
+
4635
+ 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; }; }();
4636
+
4637
+ var _NodeContainer = __webpack_require__(3);
4638
+
4639
+ var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
4640
+
4641
+ var _position = __webpack_require__(19);
4642
+
4643
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4644
+
4645
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4646
+
4647
+ var StackingContext = function () {
4648
+ function StackingContext(container, parent, treatAsRealStackingContext) {
4649
+ _classCallCheck(this, StackingContext);
4650
+
4651
+ this.container = container;
4652
+ this.parent = parent;
4653
+ this.contexts = [];
4654
+ this.children = [];
4655
+ this.treatAsRealStackingContext = treatAsRealStackingContext;
4656
+ }
4657
+
4658
+ _createClass(StackingContext, [{
4659
+ key: 'getOpacity',
4660
+ value: function getOpacity() {
4661
+ return this.parent ? this.container.style.opacity * this.parent.getOpacity() : this.container.style.opacity;
4662
+ }
4663
+ }, {
4664
+ key: 'getRealParentStackingContext',
4665
+ value: function getRealParentStackingContext() {
4666
+ return !this.parent || this.treatAsRealStackingContext ? this : this.parent.getRealParentStackingContext();
4667
+ }
4668
+ }]);
4669
+
4670
+ return StackingContext;
4671
+ }();
4672
+
4673
+ exports.default = StackingContext;
4674
 
4675
  /***/ }),
4676
+ /* 31 */
4677
  /***/ (function(module, exports, __webpack_require__) {
4678
 
4679
  "use strict";
4683
  value: true
4684
  });
4685
 
 
 
4686
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4687
 
4688
+ var Size = function Size(width, height) {
4689
+ _classCallCheck(this, Size);
4690
 
4691
+ this.width = width;
4692
+ this.height = height;
 
 
 
 
 
 
 
 
 
4693
  };
4694
 
4695
+ exports.default = Size;
4696
 
4697
  /***/ }),
4698
+ /* 32 */
4699
  /***/ (function(module, exports, __webpack_require__) {
4700
 
4701
  "use strict";
4704
  Object.defineProperty(exports, "__esModule", {
4705
  value: true
4706
  });
 
4707
 
4708
+ 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; }; }();
4709
 
4710
+ var _Path = __webpack_require__(6);
 
 
 
4711
 
4712
+ var _Vector = __webpack_require__(7);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4713
 
4714
+ var _Vector2 = _interopRequireDefault(_Vector);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4715
 
4716
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4717
+
4718
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4719
+
4720
+ var lerp = function lerp(a, b, t) {
4721
+ return new _Vector2.default(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t);
 
4722
  };
4723
 
4724
+ var BezierCurve = function () {
4725
+ function BezierCurve(start, startControl, endControl, end) {
4726
+ _classCallCheck(this, BezierCurve);
4727
+
4728
+ this.type = _Path.PATH.BEZIER_CURVE;
4729
+ this.start = start;
4730
+ this.startControl = startControl;
4731
+ this.endControl = endControl;
4732
+ this.end = end;
4733
  }
4734
+
4735
+ _createClass(BezierCurve, [{
4736
+ key: 'subdivide',
4737
+ value: function subdivide(t, firstHalf) {
4738
+ var ab = lerp(this.start, this.startControl, t);
4739
+ var bc = lerp(this.startControl, this.endControl, t);
4740
+ var cd = lerp(this.endControl, this.end, t);
4741
+ var abbc = lerp(ab, bc, t);
4742
+ var bccd = lerp(bc, cd, t);
4743
+ var dest = lerp(abbc, bccd, t);
4744
+ return firstHalf ? new BezierCurve(this.start, ab, abbc, dest) : new BezierCurve(dest, bccd, cd, this.end);
4745
+ }
4746
+ }, {
4747
+ key: 'reverse',
4748
+ value: function reverse() {
4749
+ return new BezierCurve(this.end, this.endControl, this.startControl, this.start);
4750
+ }
4751
+ }]);
4752
+
4753
+ return BezierCurve;
4754
+ }();
4755
+
4756
+ exports.default = BezierCurve;
4757
 
4758
  /***/ }),
4759
+ /* 33 */
4760
  /***/ (function(module, exports, __webpack_require__) {
4761
 
4762
  "use strict";
4765
  Object.defineProperty(exports, "__esModule", {
4766
  value: true
4767
  });
4768
+ exports.parseBorderRadius = undefined;
4769
 
4770
+ 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"); } }; }();
4771
 
4772
+ var _Length = __webpack_require__(1);
4773
 
4774
+ var _Length2 = _interopRequireDefault(_Length);
4775
 
4776
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4777
 
4778
+ var SIDES = ['top-left', 'top-right', 'bottom-right', 'bottom-left'];
 
 
4779
 
4780
+ var parseBorderRadius = exports.parseBorderRadius = function parseBorderRadius(style) {
4781
+ return SIDES.map(function (side) {
4782
+ var value = style.getPropertyValue('border-' + side + '-radius');
 
4783
 
4784
+ var _value$split$map = value.split(' ').map(_Length2.default.create),
4785
+ _value$split$map2 = _slicedToArray(_value$split$map, 2),
4786
+ horizontal = _value$split$map2[0],
4787
+ vertical = _value$split$map2[1];
 
 
 
4788
 
4789
+ return typeof vertical === 'undefined' ? [horizontal, horizontal] : [horizontal, vertical];
4790
+ });
4791
+ };
4792
 
4793
+ /***/ }),
4794
+ /* 34 */
4795
+ /***/ (function(module, exports, __webpack_require__) {
4796
 
4797
+ "use strict";
4798
 
 
4799
 
4800
+ Object.defineProperty(exports, "__esModule", {
4801
+ value: true
4802
+ });
4803
+ var DISPLAY = exports.DISPLAY = {
4804
+ NONE: 1 << 0,
4805
+ BLOCK: 1 << 1,
4806
+ INLINE: 1 << 2,
4807
+ RUN_IN: 1 << 3,
4808
+ FLOW: 1 << 4,
4809
+ FLOW_ROOT: 1 << 5,
4810
+ TABLE: 1 << 6,
4811
+ FLEX: 1 << 7,
4812
+ GRID: 1 << 8,
4813
+ RUBY: 1 << 9,
4814
+ SUBGRID: 1 << 10,
4815
+ LIST_ITEM: 1 << 11,
4816
+ TABLE_ROW_GROUP: 1 << 12,
4817
+ TABLE_HEADER_GROUP: 1 << 13,
4818
+ TABLE_FOOTER_GROUP: 1 << 14,
4819
+ TABLE_ROW: 1 << 15,
4820
+ TABLE_CELL: 1 << 16,
4821
+ TABLE_COLUMN_GROUP: 1 << 17,
4822
+ TABLE_COLUMN: 1 << 18,
4823
+ TABLE_CAPTION: 1 << 19,
4824
+ RUBY_BASE: 1 << 20,
4825
+ RUBY_TEXT: 1 << 21,
4826
+ RUBY_BASE_CONTAINER: 1 << 22,
4827
+ RUBY_TEXT_CONTAINER: 1 << 23,
4828
+ CONTENTS: 1 << 24,
4829
+ INLINE_BLOCK: 1 << 25,
4830
+ INLINE_LIST_ITEM: 1 << 26,
4831
+ INLINE_TABLE: 1 << 27,
4832
+ INLINE_FLEX: 1 << 28,
4833
+ INLINE_GRID: 1 << 29
4834
  };
4835
 
4836
+ var parseDisplayValue = function parseDisplayValue(display) {
4837
+ switch (display) {
4838
+ case 'block':
4839
+ return DISPLAY.BLOCK;
4840
+ case 'inline':
4841
+ return DISPLAY.INLINE;
4842
+ case 'run-in':
4843
+ return DISPLAY.RUN_IN;
4844
+ case 'flow':
4845
+ return DISPLAY.FLOW;
4846
+ case 'flow-root':
4847
+ return DISPLAY.FLOW_ROOT;
4848
+ case 'table':
4849
+ return DISPLAY.TABLE;
4850
+ case 'flex':
4851
+ return DISPLAY.FLEX;
4852
+ case 'grid':
4853
+ return DISPLAY.GRID;
4854
+ case 'ruby':
4855
+ return DISPLAY.RUBY;
4856
+ case 'subgrid':
4857
+ return DISPLAY.SUBGRID;
4858
+ case 'list-item':
4859
+ return DISPLAY.LIST_ITEM;
4860
+ case 'table-row-group':
4861
+ return DISPLAY.TABLE_ROW_GROUP;
4862
+ case 'table-header-group':
4863
+ return DISPLAY.TABLE_HEADER_GROUP;
4864
+ case 'table-footer-group':
4865
+ return DISPLAY.TABLE_FOOTER_GROUP;
4866
+ case 'table-row':
4867
+ return DISPLAY.TABLE_ROW;
4868
+ case 'table-cell':
4869
+ return DISPLAY.TABLE_CELL;
4870
+ case 'table-column-group':
4871
+ return DISPLAY.TABLE_COLUMN_GROUP;
4872
+ case 'table-column':
4873
+ return DISPLAY.TABLE_COLUMN;
4874
+ case 'table-caption':
4875
+ return DISPLAY.TABLE_CAPTION;
4876
+ case 'ruby-base':
4877
+ return DISPLAY.RUBY_BASE;
4878
+ case 'ruby-text':
4879
+ return DISPLAY.RUBY_TEXT;
4880
+ case 'ruby-base-container':
4881
+ return DISPLAY.RUBY_BASE_CONTAINER;
4882
+ case 'ruby-text-container':
4883
+ return DISPLAY.RUBY_TEXT_CONTAINER;
4884
+ case 'contents':
4885
+ return DISPLAY.CONTENTS;
4886
+ case 'inline-block':
4887
+ return DISPLAY.INLINE_BLOCK;
4888
+ case 'inline-list-item':
4889
+ return DISPLAY.INLINE_LIST_ITEM;
4890
+ case 'inline-table':
4891
+ return DISPLAY.INLINE_TABLE;
4892
+ case 'inline-flex':
4893
+ return DISPLAY.INLINE_FLEX;
4894
+ case 'inline-grid':
4895
+ return DISPLAY.INLINE_GRID;
4896
  }
4897
 
4898
+ return DISPLAY.NONE;
4899
+ };
4900
+
4901
+ var setDisplayBit = function setDisplayBit(bit, display) {
4902
+ return bit | parseDisplayValue(display);
4903
+ };
4904
+
4905
+ var parseDisplay = exports.parseDisplay = function parseDisplay(display) {
4906
+ return display.split(' ').reduce(setDisplayBit, 0);
4907
+ };
4908
 
4909
  /***/ }),
4910
+ /* 35 */
4911
  /***/ (function(module, exports, __webpack_require__) {
4912
 
4913
  "use strict";
4916
  Object.defineProperty(exports, "__esModule", {
4917
  value: true
4918
  });
4919
+ var FLOAT = exports.FLOAT = {
4920
+ NONE: 0,
4921
+ LEFT: 1,
4922
+ RIGHT: 2,
4923
+ INLINE_START: 3,
4924
+ INLINE_END: 4
4925
+ };
4926
 
4927
+ var parseCSSFloat = exports.parseCSSFloat = function parseCSSFloat(float) {
4928
+ switch (float) {
4929
+ case 'left':
4930
+ return FLOAT.LEFT;
4931
+ case 'right':
4932
+ return FLOAT.RIGHT;
4933
+ case 'inline-start':
4934
+ return FLOAT.INLINE_START;
4935
+ case 'inline-end':
4936
+ return FLOAT.INLINE_END;
4937
+ }
4938
+ return FLOAT.NONE;
4939
+ };
4940
 
4941
+ /***/ }),
4942
+ /* 36 */
4943
+ /***/ (function(module, exports, __webpack_require__) {
4944
 
4945
+ "use strict";
 
 
 
 
 
 
4946
 
4947
+
4948
+ Object.defineProperty(exports, "__esModule", {
4949
+ value: true
4950
+ });
4951
+
4952
+
4953
+ var parseFontWeight = function parseFontWeight(weight) {
4954
+ switch (weight) {
4955
+ case 'normal':
4956
+ return 400;
4957
+ case 'bold':
4958
+ return 700;
4959
  }
4960
 
4961
+ var value = parseInt(weight, 10);
4962
+ return isNaN(value) ? 400 : value;
4963
  };
4964
 
4965
+ var parseFont = exports.parseFont = function parseFont(style) {
4966
+ var fontFamily = style.fontFamily;
4967
+ var fontSize = style.fontSize;
4968
+ var fontStyle = style.fontStyle;
4969
+ var fontVariant = style.fontVariant;
4970
+ var fontWeight = parseFontWeight(style.fontWeight);
4971
 
4972
+ return {
4973
+ fontFamily: fontFamily,
4974
+ fontSize: fontSize,
4975
+ fontStyle: fontStyle,
4976
+ fontVariant: fontVariant,
4977
+ fontWeight: fontWeight
4978
+ };
4979
+ };
4980
 
4981
+ /***/ }),
4982
+ /* 37 */
4983
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
4984
 
4985
+ "use strict";
 
4986
 
 
 
 
 
4987
 
4988
+ Object.defineProperty(exports, "__esModule", {
4989
+ value: true
4990
+ });
4991
+ var parseLetterSpacing = exports.parseLetterSpacing = function parseLetterSpacing(letterSpacing) {
4992
+ if (letterSpacing === 'normal') {
4993
+ return 0;
4994
+ }
4995
+ var value = parseFloat(letterSpacing);
4996
+ return isNaN(value) ? 0 : value;
4997
  };
4998
 
4999
+ /***/ }),
5000
+ /* 38 */
5001
+ /***/ (function(module, exports, __webpack_require__) {
5002
 
5003
+ "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5004
 
 
 
 
 
 
5005
 
5006
+ Object.defineProperty(exports, "__esModule", {
5007
+ value: true
5008
+ });
5009
+ var LINE_BREAK = exports.LINE_BREAK = {
5010
+ NORMAL: 'normal',
5011
+ STRICT: 'strict'
 
 
 
 
 
 
5012
  };
5013
 
5014
+ var parseLineBreak = exports.parseLineBreak = function parseLineBreak(wordBreak) {
5015
+ switch (wordBreak) {
5016
+ case 'strict':
5017
+ return LINE_BREAK.STRICT;
5018
+ case 'normal':
5019
+ default:
5020
+ return LINE_BREAK.NORMAL;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5021
  }
5022
  };
5023
 
 
 
5024
  /***/ }),
5025
+ /* 39 */
5026
  /***/ (function(module, exports, __webpack_require__) {
5027
 
5028
  "use strict";
5031
  Object.defineProperty(exports, "__esModule", {
5032
  value: true
5033
  });
5034
+ exports.parseMargin = undefined;
5035
 
5036
+ var _Length = __webpack_require__(1);
5037
 
5038
+ var _Length2 = _interopRequireDefault(_Length);
5039
 
5040
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5041
 
5042
+ var SIDES = ['top', 'right', 'bottom', 'left'];
 
 
 
 
 
 
 
 
 
 
5043
 
5044
+ var parseMargin = exports.parseMargin = function parseMargin(style) {
5045
+ return SIDES.map(function (side) {
5046
+ return new _Length2.default(style.getPropertyValue('margin-' + side));
5047
+ });
 
5048
  };
5049
 
5050
+ /***/ }),
5051
+ /* 40 */
5052
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
5053
 
5054
+ "use strict";
 
 
 
5055
 
 
 
5056
 
5057
+ Object.defineProperty(exports, "__esModule", {
5058
+ value: true
5059
+ });
5060
+ var OVERFLOW = exports.OVERFLOW = {
5061
+ VISIBLE: 0,
5062
+ HIDDEN: 1,
5063
+ SCROLL: 2,
5064
+ AUTO: 3
 
 
 
 
5065
  };
5066
 
5067
+ var parseOverflow = exports.parseOverflow = function parseOverflow(overflow) {
5068
+ switch (overflow) {
5069
+ case 'hidden':
5070
+ return OVERFLOW.HIDDEN;
5071
+ case 'scroll':
5072
+ return OVERFLOW.SCROLL;
5073
+ case 'auto':
5074
+ return OVERFLOW.AUTO;
5075
+ case 'visible':
5076
+ default:
5077
+ return OVERFLOW.VISIBLE;
5078
  }
 
 
 
 
 
 
 
 
 
5079
  };
5080
 
5081
  /***/ }),
5082
+ /* 41 */
5083
  /***/ (function(module, exports, __webpack_require__) {
5084
 
5085
  "use strict";
5088
  Object.defineProperty(exports, "__esModule", {
5089
  value: true
5090
  });
5091
+ exports.parseTextShadow = undefined;
5092
 
5093
  var _Color = __webpack_require__(0);
5094
 
5096
 
5097
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5098
 
5099
+ var NUMBER = /^([+-]|\d|\.)$/i;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5100
 
5101
+ var parseTextShadow = exports.parseTextShadow = function parseTextShadow(textShadow) {
5102
+ if (textShadow === 'none' || typeof textShadow !== 'string') {
5103
+ return null;
 
5104
  }
 
 
5105
 
5106
+ var currentValue = '';
5107
+ var isLength = false;
5108
+ var values = [];
5109
+ var shadows = [];
5110
+ var numParens = 0;
5111
+ var color = null;
5112
+
5113
+ var appendValue = function appendValue() {
5114
+ if (currentValue.length) {
5115
+ if (isLength) {
5116
+ values.push(parseFloat(currentValue));
5117
+ } else {
5118
+ color = new _Color2.default(currentValue);
5119
+ }
5120
+ }
5121
+ isLength = false;
5122
+ currentValue = '';
5123
+ };
5124
+
5125
+ var appendShadow = function appendShadow() {
5126
+ if (values.length && color !== null) {
5127
+ shadows.push({
5128
+ color: color,
5129
+ offsetX: values[0] || 0,
5130
+ offsetY: values[1] || 0,
5131
+ blur: values[2] || 0
5132
+ });
5133
+ }
5134
+ values.splice(0, values.length);
5135
+ color = null;
5136
+ };
5137
+
5138
+ for (var i = 0; i < textShadow.length; i++) {
5139
+ var c = textShadow[i];
5140
+ switch (c) {
5141
+ case '(':
5142
+ currentValue += c;
5143
+ numParens++;
5144
+ break;
5145
+ case ')':
5146
+ currentValue += c;
5147
+ numParens--;
5148
+ break;
5149
+ case ',':
5150
+ if (numParens === 0) {
5151
+ appendValue();
5152
+ appendShadow();
5153
+ } else {
5154
+ currentValue += c;
5155
+ }
5156
+ break;
5157
+ case ' ':
5158
+ if (numParens === 0) {
5159
+ appendValue();
5160
+ } else {
5161
+ currentValue += c;
5162
+ }
5163
+ break;
5164
+ default:
5165
+ if (currentValue.length === 0 && NUMBER.test(c)) {
5166
+ isLength = true;
5167
+ }
5168
+ currentValue += c;
5169
+ }
5170
+ }
5171
+
5172
+ appendValue();
5173
+ appendShadow();
5174
+
5175
+ if (shadows.length === 0) {
5176
+ return null;
5177
+ }
5178
+
5179
+ return shadows;
5180
  };
5181
 
5182
  /***/ }),
5183
+ /* 42 */
5184
  /***/ (function(module, exports, __webpack_require__) {
5185
 
5186
  "use strict";
5189
  Object.defineProperty(exports, "__esModule", {
5190
  value: true
5191
  });
5192
+ exports.parseTransform = undefined;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5193
 
5194
+ var _Length = __webpack_require__(1);
 
 
 
5195
 
5196
+ var _Length2 = _interopRequireDefault(_Length);
 
 
 
5197
 
5198
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5199
 
5200
+ var toFloat = function toFloat(s) {
5201
+ return parseFloat(s.trim());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5202
  };
5203
 
5204
+ var MATRIX = /(matrix|matrix3d)\((.+)\)/;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5205
 
5206
+ var parseTransform = exports.parseTransform = function parseTransform(style) {
5207
+ var transform = parseTransformMatrix(style.transform || style.webkitTransform || style.mozTransform ||
5208
+ // $FlowFixMe
5209
+ style.msTransform ||
5210
+ // $FlowFixMe
5211
+ style.oTransform);
5212
+ if (transform === null) {
5213
+ return null;
5214
  }
5215
 
5216
+ return {
5217
+ transform: transform,
5218
+ transformOrigin: parseTransformOrigin(style.transformOrigin || style.webkitTransformOrigin || style.mozTransformOrigin ||
5219
+ // $FlowFixMe
5220
+ style.msTransformOrigin ||
5221
+ // $FlowFixMe
5222
+ style.oTransformOrigin)
5223
+ };
5224
+ };
5225
 
5226
+ // $FlowFixMe
5227
+ var parseTransformOrigin = function parseTransformOrigin(origin) {
5228
+ if (typeof origin !== 'string') {
5229
+ var v = new _Length2.default('0');
5230
+ return [v, v];
5231
  }
5232
+ var values = origin.split(' ').map(_Length2.default.create);
5233
+ return [values[0], values[1]];
5234
  };
5235
 
5236
+ // $FlowFixMe
5237
+ var parseTransformMatrix = function parseTransformMatrix(transform) {
5238
+ if (transform === 'none' || typeof transform !== 'string') {
5239
+ return null;
 
5240
  }
 
 
5241
 
5242
+ var match = transform.match(MATRIX);
5243
+ if (match) {
5244
+ if (match[1] === 'matrix') {
5245
+ var matrix = match[2].split(',').map(toFloat);
5246
+ return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]];
5247
+ } else {
5248
+ var matrix3d = match[2].split(',').map(toFloat);
5249
+ return [matrix3d[0], matrix3d[1], matrix3d[4], matrix3d[5], matrix3d[12], matrix3d[13]];
5250
+ }
5251
  }
5252
+ return null;
5253
  };
5254
 
5255
  /***/ }),
5256
+ /* 43 */
5257
  /***/ (function(module, exports, __webpack_require__) {
5258
 
5259
  "use strict";
5262
  Object.defineProperty(exports, "__esModule", {
5263
  value: true
5264
  });
5265
+ var VISIBILITY = exports.VISIBILITY = {
5266
+ VISIBLE: 0,
5267
+ HIDDEN: 1,
5268
+ COLLAPSE: 2
5269
+ };
 
 
5270
 
5271
+ var parseVisibility = exports.parseVisibility = function parseVisibility(visibility) {
5272
+ switch (visibility) {
5273
+ case 'hidden':
5274
+ return VISIBILITY.HIDDEN;
5275
+ case 'collapse':
5276
+ return VISIBILITY.COLLAPSE;
5277
+ case 'visible':
5278
+ default:
5279
+ return VISIBILITY.VISIBLE;
5280
+ }
5281
+ };
5282
 
5283
+ /***/ }),
5284
+ /* 44 */
5285
+ /***/ (function(module, exports, __webpack_require__) {
5286
 
5287
+ "use strict";
5288
 
 
5289
 
5290
+ Object.defineProperty(exports, "__esModule", {
5291
+ value: true
5292
+ });
5293
+ var WORD_BREAK = exports.WORD_BREAK = {
5294
+ NORMAL: 'normal',
5295
+ BREAK_ALL: 'break-all',
5296
+ KEEP_ALL: 'keep-all'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5297
  };
5298
 
5299
+ var parseWordBreak = exports.parseWordBreak = function parseWordBreak(wordBreak) {
5300
+ switch (wordBreak) {
5301
+ case 'break-all':
5302
+ return WORD_BREAK.BREAK_ALL;
5303
+ case 'keep-all':
5304
+ return WORD_BREAK.KEEP_ALL;
5305
+ case 'normal':
5306
+ default:
5307
+ return WORD_BREAK.NORMAL;
5308
  }
5309
+ };
5310
 
5311
+ /***/ }),
5312
+ /* 45 */
5313
+ /***/ (function(module, exports, __webpack_require__) {
5314
 
5315
+ "use strict";
 
 
 
5316
 
 
 
 
 
 
 
 
 
 
 
 
 
5317
 
5318
+ Object.defineProperty(exports, "__esModule", {
5319
+ value: true
5320
+ });
5321
+ var parseZIndex = exports.parseZIndex = function parseZIndex(zIndex) {
5322
+ var auto = zIndex === 'auto';
5323
+ return {
5324
+ auto: auto,
5325
+ order: auto ? 0 : parseInt(zIndex, 10)
5326
+ };
5327
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
5328
 
5329
+ /***/ }),
5330
+ /* 46 */
5331
+ /***/ (function(module, exports, __webpack_require__) {
5332
 
5333
+ "use strict";
 
 
 
 
 
 
 
5334
 
 
 
 
 
5335
 
5336
+ Object.defineProperty(exports, "__esModule", {
5337
+ value: true
5338
+ });
 
5339
 
5340
+ var _Util = __webpack_require__(13);
 
 
 
5341
 
5342
+ Object.defineProperty(exports, 'toCodePoints', {
5343
+ enumerable: true,
5344
+ get: function get() {
5345
+ return _Util.toCodePoints;
5346
+ }
5347
+ });
5348
+ Object.defineProperty(exports, 'fromCodePoint', {
5349
+ enumerable: true,
5350
+ get: function get() {
5351
+ return _Util.fromCodePoint;
5352
+ }
5353
+ });
5354
 
5355
+ var _LineBreak = __webpack_require__(47);
 
 
 
5356
 
5357
+ Object.defineProperty(exports, 'LineBreaker', {
5358
+ enumerable: true,
5359
+ get: function get() {
5360
+ return _LineBreak.LineBreaker;
5361
+ }
5362
+ });
 
 
5363
 
5364
+ /***/ }),
5365
+ /* 47 */
5366
+ /***/ (function(module, exports, __webpack_require__) {
5367
 
5368
+ "use strict";
 
 
 
 
 
 
5369
 
 
 
5370
 
5371
+ Object.defineProperty(exports, "__esModule", {
5372
+ value: true
5373
+ });
5374
+ 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;
5375
 
5376
+ 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; }; }();
 
 
 
5377
 
5378
+ 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"); } }; }();
 
5379
 
5380
+ var _Trie = __webpack_require__(48);
 
 
 
 
5381
 
5382
+ var _linebreakTrie = __webpack_require__(49);
 
 
 
5383
 
5384
+ var _linebreakTrie2 = _interopRequireDefault(_linebreakTrie);
 
 
 
 
 
5385
 
5386
+ var _Util = __webpack_require__(13);
 
 
5387
 
5388
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
5389
 
5390
+ 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); } }
 
 
 
 
 
 
 
 
5391
 
5392
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
5393
 
5394
+ var LETTER_NUMBER_MODIFIER = exports.LETTER_NUMBER_MODIFIER = 50;
 
 
 
5395
 
5396
+ // Non-tailorable Line Breaking Classes
5397
+ var BK = 1; // Cause a line break (after)
5398
+ var CR = 2; // Cause a line break (after), except between CR and LF
5399
+ var LF = 3; // Cause a line break (after)
5400
+ var CM = 4; // Prohibit a line break between the character and the preceding character
5401
+ var NL = 5; // Cause a line break (after)
5402
+ var SG = 6; // Do not occur in well-formed text
5403
+ var WJ = 7; // Prohibit line breaks before and after
5404
+ var ZW = 8; // Provide a break opportunity
5405
+ var GL = 9; // Prohibit line breaks before and after
5406
+ var SP = 10; // Enable indirect line breaks
5407
+ var ZWJ = 11; // Prohibit line breaks within joiner sequences
5408
+ // Break Opportunities
5409
+ var B2 = 12; // Provide a line break opportunity before and after the character
5410
+ var BA = 13; // Generally provide a line break opportunity after the character
5411
+ var BB = 14; // Generally provide a line break opportunity before the character
5412
+ var HY = 15; // Provide a line break opportunity after the character, except in numeric context
5413
+ var CB = 16; // Provide a line break opportunity contingent on additional information
5414
+ // Characters Prohibiting Certain Breaks
5415
+ var CL = 17; // Prohibit line breaks before
5416
+ var CP = 18; // Prohibit line breaks before
5417
+ var EX = 19; // Prohibit line breaks before
5418
+ var IN = 20; // Allow only indirect line breaks between pairs
5419
+ var NS = 21; // Allow only indirect line breaks before
5420
+ var OP = 22; // Prohibit line breaks after
5421
+ var QU = 23; // Act like they are both opening and closing
5422
+ // Numeric Context
5423
+ var IS = 24; // Prevent breaks after any and before numeric
5424
+ var NU = 25; // Form numeric expressions for line breaking purposes
5425
+ var PO = 26; // Do not break following a numeric expression
5426
+ var PR = 27; // Do not break in front of a numeric expression
5427
+ var SY = 28; // Prevent a break before; and allow a break after
5428
+ // Other Characters
5429
+ var AI = 29; // Act like AL when the resolvedEAW is N; otherwise; act as ID
5430
+ var AL = 30; // Are alphabetic characters or symbols that are used with alphabetic characters
5431
+ var CJ = 31; // Treat as NS or ID for strict or normal breaking.
5432
+ var EB = 32; // Do not break from following Emoji Modifier
5433
+ var EM = 33; // Do not break from preceding Emoji Base
5434
+ var H2 = 34; // Form Korean syllable blocks
5435
+ var H3 = 35; // Form Korean syllable blocks
5436
+ var HL = 36; // Do not break around a following hyphen; otherwise act as Alphabetic
5437
+ var ID = 37; // Break before or after; except in some numeric context
5438
+ var JL = 38; // Form Korean syllable blocks
5439
+ var JV = 39; // Form Korean syllable blocks
5440
+ var JT = 40; // Form Korean syllable blocks
5441
+ var RI = 41; // Keep pairs together. For pairs; break before and after other classes
5442
+ var SA = 42; // Provide a line break opportunity contingent on additional, language-specific context analysis
5443
+ var XX = 43; // Have as yet unknown line breaking behavior or unassigned code positions
5444
+
5445
+ var classes = exports.classes = {
5446
+ BK: BK,
5447
+ CR: CR,
5448
+ LF: LF,
5449
+ CM: CM,
5450
+ NL: NL,
5451
+ SG: SG,
5452
+ WJ: WJ,
5453
+ ZW: ZW,
5454
+ GL: GL,
5455
+ SP: SP,
5456
+ ZWJ: ZWJ,
5457
+ B2: B2,
5458
+ BA: BA,
5459
+ BB: BB,
5460
+ HY: HY,
5461
+ CB: CB,
5462
+ CL: CL,
5463
+ CP: CP,
5464
+ EX: EX,
5465
+ IN: IN,
5466
+ NS: NS,
5467
+ OP: OP,
5468
+ QU: QU,
5469
+ IS: IS,
5470
+ NU: NU,
5471
+ PO: PO,
5472
+ PR: PR,
5473
+ SY: SY,
5474
+ AI: AI,
5475
+ AL: AL,
5476
+ CJ: CJ,
5477
+ EB: EB,
5478
+ EM: EM,
5479
+ H2: H2,
5480
+ H3: H3,
5481
+ HL: HL,
5482
+ ID: ID,
5483
+ JL: JL,
5484
+ JV: JV,
5485
+ JT: JT,
5486
+ RI: RI,
5487
+ SA: SA,
5488
+ XX: XX
 
 
 
 
 
 
 
 
 
 
5489
  };
5490
 
5491
+ var BREAK_MANDATORY = exports.BREAK_MANDATORY = '!';
5492
+ var BREAK_NOT_ALLOWED = exports.BREAK_NOT_ALLOWED = '×';
5493
+ var BREAK_ALLOWED = exports.BREAK_ALLOWED = '÷';
5494
+ var UnicodeTrie = exports.UnicodeTrie = (0, _Trie.createTrieFromBase64)(_linebreakTrie2.default);
5495
 
5496
+ var ALPHABETICS = [AL, HL];
5497
+ var HARD_LINE_BREAKS = [BK, CR, LF, NL];
5498
+ var SPACE = [SP, ZW];
5499
+ var PREFIX_POSTFIX = [PR, PO];
5500
+ var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE);
5501
+ var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];
5502
+ var HYPHEN = [HY, BA];
5503
 
5504
+ var codePointsToCharacterClasses = exports.codePointsToCharacterClasses = function codePointsToCharacterClasses(codePoints) {
5505
+ var lineBreak = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'strict';
5506
 
5507
+ var types = [];
5508
+ var indicies = [];
5509
+ var categories = [];
5510
+ codePoints.forEach(function (codePoint, index) {
5511
+ var classType = UnicodeTrie.get(codePoint);
5512
+ if (classType > LETTER_NUMBER_MODIFIER) {
5513
+ categories.push(true);
5514
+ classType -= LETTER_NUMBER_MODIFIER;
5515
+ } else {
5516
+ categories.push(false);
5517
+ }
5518
 
5519
+ if (['normal', 'auto', 'loose'].indexOf(lineBreak) !== -1) {
5520
+ // U+2010, – U+2013, 〜 U+301C, ゠ U+30A0
5521
+ if ([0x2010, 0x2013, 0x301c, 0x30a0].indexOf(codePoint) !== -1) {
5522
+ indicies.push(index);
5523
+ return types.push(CB);
5524
+ }
5525
+ }
5526
 
5527
+ if (classType === CM || classType === ZWJ) {
5528
+ // LB10 Treat any remaining combining mark or ZWJ as AL.
5529
+ if (index === 0) {
5530
+ indicies.push(index);
5531
+ return types.push(AL);
5532
+ }
5533
 
5534
+ // LB9 Do not break a combining character sequence; treat it as if it has the line breaking class of
5535
+ // the base character in all of the following rules. Treat ZWJ as if it were CM.
5536
+ var prev = types[index - 1];
5537
+ if (LINE_BREAKS.indexOf(prev) === -1) {
5538
+ indicies.push(indicies[index - 1]);
5539
+ return types.push(prev);
5540
+ }
5541
+ indicies.push(index);
5542
+ return types.push(AL);
5543
+ }
5544
 
5545
+ indicies.push(index);
5546
 
5547
+ if (classType === CJ) {
5548
+ return types.push(lineBreak === 'strict' ? NS : ID);
5549
+ }
 
 
 
 
 
 
5550
 
5551
+ if (classType === SA) {
5552
+ return types.push(AL);
5553
+ }
5554
 
5555
+ if (classType === AI) {
5556
+ return types.push(AL);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5557
  }
 
 
 
 
5558
 
5559
+ // For supplementary characters, a useful default is to treat characters in the range 10000..1FFFD as AL
5560
+ // and characters in the ranges 20000..2FFFD and 30000..3FFFD as ID, until the implementation can be revised
5561
+ // to take into account the actual line breaking properties for these characters.
5562
+ if (classType === XX) {
5563
+ if (codePoint >= 0x20000 && codePoint <= 0x2fffd || codePoint >= 0x30000 && codePoint <= 0x3fffd) {
5564
+ return types.push(ID);
5565
+ } else {
5566
+ return types.push(AL);
5567
  }
5568
+ }
5569
 
5570
+ types.push(classType);
5571
+ });
5572
 
5573
+ return [indicies, types, categories];
5574
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5575
 
5576
+ var isAdjacentWithSpaceIgnored = function isAdjacentWithSpaceIgnored(a, b, currentIndex, classTypes) {
5577
+ var current = classTypes[currentIndex];
5578
+ if (Array.isArray(a) ? a.indexOf(current) !== -1 : a === current) {
5579
+ var i = currentIndex;
5580
+ while (i <= classTypes.length) {
5581
+ i++;
5582
+ var next = classTypes[i];
 
 
5583
 
5584
+ if (next === b) {
5585
+ return true;
 
 
 
 
5586
  }
5587
 
5588
+ if (next !== SP) {
5589
+ break;
5590
+ }
 
 
 
 
5591
  }
5592
+ }
 
 
 
5593
 
5594
+ if (current === SP) {
5595
+ var _i = currentIndex;
 
 
 
 
 
 
5596
 
5597
+ while (_i > 0) {
5598
+ _i--;
5599
+ var prev = classTypes[_i];
5600
 
5601
+ if (Array.isArray(a) ? a.indexOf(prev) !== -1 : a === prev) {
5602
+ var n = currentIndex;
5603
+ while (n <= classTypes.length) {
5604
+ n++;
5605
+ var _next = classTypes[n];
5606
 
5607
+ if (_next === b) {
5608
+ return true;
5609
+ }
5610
 
5611
+ if (_next !== SP) {
5612
+ break;
5613
+ }
5614
+ }
5615
+ }
 
5616
 
5617
+ if (prev !== SP) {
5618
+ break;
 
 
 
5619
  }
5620
  }
5621
+ }
5622
+ return false;
5623
+ };
5624
+
5625
+ var previousNonSpaceClassType = function previousNonSpaceClassType(currentIndex, classTypes) {
5626
+ var i = currentIndex;
5627
+ while (i >= 0) {
5628
+ var type = classTypes[i];
5629
+ if (type === SP) {
5630
+ i--;
5631
+ } else {
5632
+ return type;
5633
  }
5634
+ }
5635
+ return 0;
5636
+ };
 
5637
 
5638
+ var _lineBreakAtIndex = function _lineBreakAtIndex(codePoints, classTypes, indicies, index, forbiddenBreaks) {
5639
+ if (indicies[index] === 0) {
5640
+ return BREAK_NOT_ALLOWED;
5641
+ }
5642
 
5643
+ var currentIndex = index - 1;
5644
+ if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {
5645
+ return BREAK_NOT_ALLOWED;
5646
+ }
 
 
 
 
5647
 
5648
+ var beforeIndex = currentIndex - 1;
5649
+ var afterIndex = currentIndex + 1;
5650
+ var current = classTypes[currentIndex];
 
 
5651
 
5652
+ // LB4 Always break after hard line breaks.
5653
+ // LB5 Treat CR followed by LF, as well as CR, LF, and NL as hard line breaks.
5654
+ var before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;
5655
+ var next = classTypes[afterIndex];
 
 
 
 
 
 
5656
 
5657
+ if (current === CR && next === LF) {
5658
+ return BREAK_NOT_ALLOWED;
5659
+ }
 
 
 
 
 
 
5660
 
5661
+ if (HARD_LINE_BREAKS.indexOf(current) !== -1) {
5662
+ return BREAK_MANDATORY;
5663
+ }
 
 
 
 
 
 
 
 
 
 
5664
 
5665
+ // LB6 Do not break before hard line breaks.
5666
+ if (HARD_LINE_BREAKS.indexOf(next) !== -1) {
5667
+ return BREAK_NOT_ALLOWED;
5668
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5669
 
5670
+ // LB7 Do not break before spaces or zero width space.
5671
+ if (SPACE.indexOf(next) !== -1) {
5672
+ return BREAK_NOT_ALLOWED;
5673
+ }
5674
 
5675
+ // LB8 Break before any character following a zero-width space, even if one or more spaces intervene.
5676
+ if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {
5677
+ return BREAK_ALLOWED;
5678
+ }
5679
 
5680
+ // LB8a Do not break between a zero width joiner and an ideograph, emoji base or emoji modifier.
5681
+ if (UnicodeTrie.get(codePoints[currentIndex]) === ZWJ && (next === ID || next === EB || next === EM)) {
5682
+ return BREAK_NOT_ALLOWED;
5683
+ }
5684
 
5685
+ // LB11 Do not break before or after Word joiner and related characters.
5686
+ if (current === WJ || next === WJ) {
5687
+ return BREAK_NOT_ALLOWED;
5688
+ }
5689
 
5690
+ // LB12 Do not break after NBSP and related characters.
5691
+ if (current === GL) {
5692
+ return BREAK_NOT_ALLOWED;
5693
+ }
5694
 
5695
+ // LB12a Do not break before NBSP and related characters, except after spaces and hyphens.
5696
+ if ([SP, BA, HY].indexOf(current) === -1 && next === GL) {
5697
+ return BREAK_NOT_ALLOWED;
5698
+ }
5699
 
5700
+ // LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces.
5701
+ if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) {
5702
+ return BREAK_NOT_ALLOWED;
5703
+ }
5704
 
5705
+ // LB14 Do not break after ‘[’, even after spaces.
5706
+ if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {
5707
+ return BREAK_NOT_ALLOWED;
5708
+ }
5709
 
5710
+ // LB15 Do not break within ‘”[’, even with intervening spaces.
5711
+ if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {
5712
+ return BREAK_NOT_ALLOWED;
5713
+ }
5714
 
5715
+ // LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with intervening spaces.
5716
+ if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {
5717
+ return BREAK_NOT_ALLOWED;
5718
+ }
5719
 
5720
+ // LB17 Do not break within ‘——’, even with intervening spaces.
5721
+ if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {
5722
+ return BREAK_NOT_ALLOWED;
5723
+ }
5724
 
5725
+ // LB18 Break after spaces.
5726
+ if (current === SP) {
5727
+ return BREAK_ALLOWED;
5728
  }
5729
 
5730
+ // LB19 Do not break before or after quotation marks, such as ‘ ” ’.
5731
+ if (current === QU || next === QU) {
5732
+ return BREAK_NOT_ALLOWED;
5733
+ }
 
5734
 
5735
+ // LB20 Break before and after unresolved CB.
5736
+ if (next === CB || current === CB) {
5737
+ return BREAK_ALLOWED;
5738
+ }
5739
 
5740
+ // LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small kana, and other non-starters, or after acute accents.
5741
+ if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) {
5742
+ return BREAK_NOT_ALLOWED;
5743
+ }
 
 
 
5744
 
5745
+ // LB21a Don't break after Hebrew + Hyphen.
5746
+ if (before === HL && HYPHEN.indexOf(current) !== -1) {
5747
+ return BREAK_NOT_ALLOWED;
5748
+ }
5749
 
5750
+ // LB21b Don’t break between Solidus and Hebrew letters.
5751
+ if (current === SY && next === HL) {
5752
+ return BREAK_NOT_ALLOWED;
5753
+ }
5754
 
5755
+ // LB22 Do not break between two ellipses, or between letters, numbers or exclamations and ellipsis.
5756
+ if (next === IN && ALPHABETICS.concat(IN, EX, NU, ID, EB, EM).indexOf(current) !== -1) {
5757
+ return BREAK_NOT_ALLOWED;
5758
+ }
 
 
 
5759
 
5760
+ // LB23 Do not break between digits and letters.
5761
+ if (ALPHABETICS.indexOf(next) !== -1 && current === NU || ALPHABETICS.indexOf(current) !== -1 && next === NU) {
5762
+ return BREAK_NOT_ALLOWED;
5763
+ }
5764
+
5765
+ // LB23a Do not break between numeric prefixes and ideographs, or between ideographs and numeric postfixes.
5766
+ if (current === PR && [ID, EB, EM].indexOf(next) !== -1 || [ID, EB, EM].indexOf(current) !== -1 && next === PO) {
5767
+ return BREAK_NOT_ALLOWED;
5768
+ }
5769
+
5770
+ // LB24 Do not break between numeric prefix/postfix and letters, or between letters and prefix/postfix.
5771
+ if (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1 || PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
5772
+ return BREAK_NOT_ALLOWED;
5773
+ }
5774
+
5775
+ // LB25 Do not break between the following pairs of classes relevant to numbers:
5776
+ if (
5777
+ // (PR | PO) × ( OP | HY )? NU
5778
+ [PR, PO].indexOf(current) !== -1 && (next === NU || [OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU) ||
5779
+ // ( OP | HY ) × NU
5780
+ [OP, HY].indexOf(current) !== -1 && next === NU ||
5781
+ // NU × (NU | SY | IS)
5782
+ current === NU && [NU, SY, IS].indexOf(next) !== -1) {
5783
+ return BREAK_NOT_ALLOWED;
5784
+ }
5785
+
5786
+ // NU (NU | SY | IS)* × (NU | SY | IS | CL | CP)
5787
+ if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) {
5788
+ var prevIndex = currentIndex;
5789
+ while (prevIndex >= 0) {
5790
+ var type = classTypes[prevIndex];
5791
+ if (type === NU) {
5792
+ return BREAK_NOT_ALLOWED;
5793
+ } else if ([SY, IS].indexOf(type) !== -1) {
5794
+ prevIndex--;
5795
+ } else {
5796
+ break;
5797
  }
5798
  }
5799
+ }
 
 
 
5800
 
5801
+ // NU (NU | SY | IS)* (CL | CP)? × (PO | PR))
5802
+ if ([PR, PO].indexOf(next) !== -1) {
5803
+ var _prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;
5804
+ while (_prevIndex >= 0) {
5805
+ var _type = classTypes[_prevIndex];
5806
+ if (_type === NU) {
5807
+ return BREAK_NOT_ALLOWED;
5808
+ } else if ([SY, IS].indexOf(_type) !== -1) {
5809
+ _prevIndex--;
5810
+ } else {
5811
+ break;
5812
+ }
5813
+ }
5814
+ }
5815
 
5816
+ // LB26 Do not break a Korean syllable.
5817
+ 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) {
5818
+ return BREAK_NOT_ALLOWED;
5819
+ }
5820
 
5821
+ // LB27 Treat a Korean Syllable Block the same as ID.
5822
+ if (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1 || KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR) {
5823
+ return BREAK_NOT_ALLOWED;
5824
+ }
5825
 
5826
+ // LB28 Do not break between alphabetics (“at”).
5827
+ if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
5828
+ return BREAK_NOT_ALLOWED;
5829
+ }
5830
 
5831
+ // LB29 Do not break between numeric punctuation and alphabetics (“e.g.”).
5832
+ if (current === IS && ALPHABETICS.indexOf(next) !== -1) {
5833
+ return BREAK_NOT_ALLOWED;
5834
+ }
5835
 
5836
+ // LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses.
5837
+ if (ALPHABETICS.concat(NU).indexOf(current) !== -1 && next === OP || ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP) {
5838
+ return BREAK_NOT_ALLOWED;
5839
+ }
5840
 
5841
+ // LB30a Break between two regional indicator symbols if and only if there are an even number of regional
5842
+ // indicators preceding the position of the break.
5843
+ if (current === RI && next === RI) {
5844
+ var i = indicies[currentIndex];
5845
+ var count = 1;
5846
+ while (i > 0) {
5847
+ i--;
5848
+ if (classTypes[i] === RI) {
5849
+ count++;
5850
+ } else {
5851
+ break;
5852
+ }
5853
+ }
5854
+ if (count % 2 !== 0) {
5855
+ return BREAK_NOT_ALLOWED;
5856
+ }
5857
+ }
5858
 
5859
+ // LB30b Do not break between an emoji base and an emoji modifier.
5860
+ if (current === EB && next === EM) {
5861
+ return BREAK_NOT_ALLOWED;
5862
+ }
5863
 
5864
+ return BREAK_ALLOWED;
 
 
 
 
5865
  };
5866
 
5867
+ var lineBreakAtIndex = exports.lineBreakAtIndex = function lineBreakAtIndex(codePoints, index) {
5868
+ // LB2 Never break at the start of text.
5869
+ if (index === 0) {
5870
+ return BREAK_NOT_ALLOWED;
5871
+ }
 
 
 
 
 
 
5872
 
5873
+ // LB3 Always break at the end of text.
5874
+ if (index >= codePoints.length) {
5875
+ return BREAK_MANDATORY;
5876
+ }
5877
 
5878
+ var _codePointsToCharacte = codePointsToCharacterClasses(codePoints),
5879
+ _codePointsToCharacte2 = _slicedToArray(_codePointsToCharacte, 2),
5880
+ indicies = _codePointsToCharacte2[0],
5881
+ classTypes = _codePointsToCharacte2[1];
5882
 
5883
+ return _lineBreakAtIndex(codePoints, classTypes, indicies, index);
 
 
 
 
 
5884
  };
5885
 
5886
+ var cssFormattedClasses = function cssFormattedClasses(codePoints, options) {
5887
+ if (!options) {
5888
+ options = { lineBreak: 'normal', wordBreak: 'normal' };
5889
+ }
5890
+
5891
+ var _codePointsToCharacte3 = codePointsToCharacterClasses(codePoints, options.lineBreak),
5892
+ _codePointsToCharacte4 = _slicedToArray(_codePointsToCharacte3, 3),
5893
+ indicies = _codePointsToCharacte4[0],
5894
+ classTypes = _codePointsToCharacte4[1],
5895
+ isLetterNumber = _codePointsToCharacte4[2];
5896
+
5897
+ if (options.wordBreak === 'break-all' || options.wordBreak === 'break-word') {
5898
+ classTypes = classTypes.map(function (type) {
5899
+ return [NU, AL, SA].indexOf(type) !== -1 ? ID : type;
5900
+ });
5901
  }
5902
+
5903
+ var forbiddenBreakpoints = options.wordBreak === 'keep-all' ? isLetterNumber.map(function (isLetterNumber, i) {
5904
+ return isLetterNumber && codePoints[i] >= 0x4e00 && codePoints[i] <= 0x9fff;
5905
+ }) : null;
5906
+
5907
+ return [indicies, classTypes, forbiddenBreakpoints];
5908
  };
5909
 
5910
+ var inlineBreakOpportunities = exports.inlineBreakOpportunities = function inlineBreakOpportunities(str, options) {
5911
+ var codePoints = (0, _Util.toCodePoints)(str);
5912
+ var output = BREAK_NOT_ALLOWED;
5913
 
5914
+ var _cssFormattedClasses = cssFormattedClasses(codePoints, options),
5915
+ _cssFormattedClasses2 = _slicedToArray(_cssFormattedClasses, 3),
5916
+ indicies = _cssFormattedClasses2[0],
5917
+ classTypes = _cssFormattedClasses2[1],
5918
+ forbiddenBreakpoints = _cssFormattedClasses2[2];
5919
 
5920
+ codePoints.forEach(function (codePoint, i) {
5921
+ output += (0, _Util.fromCodePoint)(codePoint) + (i >= codePoints.length - 1 ? BREAK_MANDATORY : _lineBreakAtIndex(codePoints, classTypes, indicies, i + 1, forbiddenBreakpoints));
5922
+ });
5923
 
5924
+ return output;
 
 
 
 
 
 
 
 
5925
  };
5926
 
5927
+ var Break = function () {
5928
+ function Break(codePoints, lineBreak, start, end) {
5929
+ _classCallCheck(this, Break);
5930
+
5931
+ this._codePoints = codePoints;
5932
+ this.required = lineBreak === BREAK_MANDATORY;
5933
+ this.start = start;
5934
+ this.end = end;
 
 
5935
  }
5936
 
5937
+ _createClass(Break, [{
5938
+ key: 'slice',
5939
+ value: function slice() {
5940
+ return _Util.fromCodePoint.apply(undefined, _toConsumableArray(this._codePoints.slice(this.start, this.end)));
5941
+ }
5942
+ }]);
5943
 
5944
+ return Break;
5945
+ }();
 
5946
 
5947
+ var LineBreaker = exports.LineBreaker = function LineBreaker(str, options) {
5948
+ var codePoints = (0, _Util.toCodePoints)(str);
5949
 
5950
+ var _cssFormattedClasses3 = cssFormattedClasses(codePoints, options),
5951
+ _cssFormattedClasses4 = _slicedToArray(_cssFormattedClasses3, 3),
5952
+ indicies = _cssFormattedClasses4[0],
5953
+ classTypes = _cssFormattedClasses4[1],
5954
+ forbiddenBreakpoints = _cssFormattedClasses4[2];
5955
 
5956
+ var length = codePoints.length;
5957
+ var lastEnd = 0;
5958
+ var nextIndex = 0;
 
 
 
 
 
 
5959
 
5960
+ return {
5961
+ next: function next() {
5962
+ if (nextIndex >= length) {
5963
+ return { done: true };
5964
+ }
5965
+ var lineBreak = BREAK_NOT_ALLOWED;
5966
+ while (nextIndex < length && (lineBreak = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) === BREAK_NOT_ALLOWED) {}
 
 
5967
 
5968
+ if (lineBreak !== BREAK_NOT_ALLOWED || nextIndex === length) {
5969
+ var value = new Break(codePoints, lineBreak, lastEnd, nextIndex);
5970
+ lastEnd = nextIndex;
5971
+ return { value: value, done: false };
5972
+ }
5973
+
5974
+ return { done: true };
5975
+ }
5976
+ };
5977
  };
5978
 
5979
  /***/ }),
5980
+ /* 48 */
5981
  /***/ (function(module, exports, __webpack_require__) {
5982
 
5983
  "use strict";
5986
  Object.defineProperty(exports, "__esModule", {
5987
  value: true
5988
  });
5989
+ 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;
5990
 
5991
+ 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; }; }();
5992
 
5993
+ var _Util = __webpack_require__(13);
5994
 
5995
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5996
 
5997
+ /** Shift size for getting the index-2 table offset. */
5998
+ var UTRIE2_SHIFT_2 = exports.UTRIE2_SHIFT_2 = 5;
5999
 
6000
+ /** Shift size for getting the index-1 table offset. */
6001
+ var UTRIE2_SHIFT_1 = exports.UTRIE2_SHIFT_1 = 6 + 5;
6002
 
6003
+ /**
6004
+ * Shift size for shifting left the index array values.
6005
+ * Increases possible data size with 16-bit index values at the cost
6006
+ * of compactability.
6007
+ * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.
6008
+ */
6009
+ var UTRIE2_INDEX_SHIFT = exports.UTRIE2_INDEX_SHIFT = 2;
6010
 
6011
+ /**
6012
+ * Difference between the two shift sizes,
6013
+ * for getting an index-1 offset from an index-2 offset. 6=11-5
6014
+ */
6015
+ var UTRIE2_SHIFT_1_2 = exports.UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;
6016
 
6017
+ /**
6018
+ * The part of the index-2 table for U+D800..U+DBFF stores values for
6019
+ * lead surrogate code _units_ not code _points_.
6020
+ * Values for lead surrogate code _points_ are indexed with this portion of the table.
6021
+ * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)
6022
+ */
6023
+ var UTRIE2_LSCP_INDEX_2_OFFSET = exports.UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2;
6024
 
6025
+ /** Number of entries in a data block. 32=0x20 */
6026
+ var UTRIE2_DATA_BLOCK_LENGTH = exports.UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;
6027
+ /** Mask for getting the lower bits for the in-data-block offset. */
6028
+ var UTRIE2_DATA_MASK = exports.UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;
6029
 
6030
+ var UTRIE2_LSCP_INDEX_2_LENGTH = exports.UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2;
6031
+ /** Count the lengths of both BMP pieces. 2080=0x820 */
6032
+ var UTRIE2_INDEX_2_BMP_LENGTH = exports.UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;
6033
+ /**
6034
+ * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.
6035
+ * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.
6036
+ */
6037
+ var UTRIE2_UTF8_2B_INDEX_2_OFFSET = exports.UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;
6038
+ 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 */
6039
+ /**
6040
+ * The index-1 table, only used for supplementary code points, at offset 2112=0x840.
6041
+ * Variable length, for code points up to highStart, where the last single-value range starts.
6042
+ * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.
6043
+ * (For 0x100000 supplementary code points U+10000..U+10ffff.)
6044
+ *
6045
+ * The part of the index-2 table for supplementary code points starts
6046
+ * after this index-1 table.
6047
+ *
6048
+ * Both the index-1 table and the following part of the index-2 table
6049
+ * are omitted completely if there is only BMP data.
6050
+ */
6051
+ var UTRIE2_INDEX_1_OFFSET = exports.UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;
6052
 
6053
+ /**
6054
+ * Number of index-1 entries for the BMP. 32=0x20
6055
+ * This part of the index-1 table is omitted from the serialized form.
6056
+ */
6057
+ var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = exports.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1;
6058
 
6059
+ /** Number of entries in an index-2 block. 64=0x40 */
6060
+ var UTRIE2_INDEX_2_BLOCK_LENGTH = exports.UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;
6061
+ /** Mask for getting the lower bits for the in-index-2-block offset. */
6062
+ var UTRIE2_INDEX_2_MASK = exports.UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;
6063
 
6064
+ var createTrieFromBase64 = exports.createTrieFromBase64 = function createTrieFromBase64(base64) {
6065
+ var buffer = (0, _Util.decode)(base64);
6066
+ var view32 = Array.isArray(buffer) ? (0, _Util.polyUint32Array)(buffer) : new Uint32Array(buffer);
6067
+ var view16 = Array.isArray(buffer) ? (0, _Util.polyUint16Array)(buffer) : new Uint16Array(buffer);
6068
+ var headerLength = 24;
6069
 
6070
+ var index = view16.slice(headerLength / 2, view32[4] / 2);
6071
+ var data = view32[5] === 2 ? view16.slice((headerLength + view32[4]) / 2) : view32.slice(Math.ceil((headerLength + view32[4]) / 4));
6072
 
6073
+ return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);
6074
+ };
6075
 
6076
+ var Trie = exports.Trie = function () {
6077
+ function Trie(initialValue, errorValue, highStart, highValueIndex, index, data) {
6078
+ _classCallCheck(this, Trie);
6079
 
6080
+ this.initialValue = initialValue;
6081
+ this.errorValue = errorValue;
6082
+ this.highStart = highStart;
6083
+ this.highValueIndex = highValueIndex;
6084
+ this.index = index;
6085
+ this.data = data;
6086
+ }
 
 
 
 
 
 
 
 
6087
 
6088
+ /**
6089
+ * Get the value for a code point as stored in the Trie.
6090
+ *
6091
+ * @param codePoint the code point
6092
+ * @return the value
6093
+ */
6094
 
 
 
 
6095
 
6096
+ _createClass(Trie, [{
6097
+ key: 'get',
6098
+ value: function get(codePoint) {
6099
+ var ix = void 0;
6100
+ if (codePoint >= 0) {
6101
+ if (codePoint < 0x0d800 || codePoint > 0x0dbff && codePoint <= 0x0ffff) {
6102
+ // Ordinary BMP code point, excluding leading surrogates.
6103
+ // BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.
6104
+ // 16 bit data is stored in the index array itself.
6105
+ ix = this.index[codePoint >> UTRIE2_SHIFT_2];
6106
+ ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
6107
+ return this.data[ix];
6108
+ }
6109
 
6110
+ if (codePoint <= 0xffff) {
6111
+ // Lead Surrogate Code Point. A Separate index section is stored for
6112
+ // lead surrogate code units and code points.
6113
+ // The main index has the code unit data.
6114
+ // For this function, we need the code point data.
6115
+ // Note: this expression could be refactored for slightly improved efficiency, but
6116
+ // surrogate code points will be so rare in practice that it's not worth it.
6117
+ ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + (codePoint - 0xd800 >> UTRIE2_SHIFT_2)];
6118
+ ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
6119
+ return this.data[ix];
6120
+ }
6121
 
6122
+ if (codePoint < this.highStart) {
6123
+ // Supplemental code point, use two-level lookup.
6124
+ ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);
6125
+ ix = this.index[ix];
6126
+ ix += codePoint >> UTRIE2_SHIFT_2 & UTRIE2_INDEX_2_MASK;
6127
+ ix = this.index[ix];
6128
+ ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
6129
+ return this.data[ix];
6130
+ }
6131
+ if (codePoint <= 0x10ffff) {
6132
+ return this.data[this.highValueIndex];
6133
+ }
6134
+ }
6135
 
6136
+ // Fall through. The code point is outside of the legal range of 0..0x10ffff.
6137
+ return this.errorValue;
6138
+ }
6139
+ }]);
6140
 
6141
+ return Trie;
6142
+ }();
 
 
 
 
 
 
 
 
6143
 
6144
+ /***/ }),
6145
+ /* 49 */
6146
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6147
 
6148
+ "use strict";
 
6149
 
6150
+
6151
+ module.exports = 'KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5wPsA/QD/AOAAIAABAQMBBIEgAAWBB4EJgQuBDMEIAM7BEEEXgBJBCADUQRZBGEEaQQwADAAcQQ+AXkEgQSJBJEEgACYBIAAoASoBK8EtwQwAL8ExQSAAIAAgACAAIAAgACgAM0EXgBeAF4AXgBeAF4AXgBeANUEXgDZBOEEXgDpBPEE+QQBBQkFEQUZBSEFKQUxBTUFPQVFBUwFVAVcBV4AYwVeAGsFcwV7BYMFiwWSBV4AmgWgBacFXgBeAF4AXgBeAKsFXgCyBbEFugW7BcIFwgXIBcIFwgXQBdQF3AXkBesF8wX7BQMGCwYTBhsGIwYrBjMGOwZeAD8GRwZNBl4AVAZbBl4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAGMGXgBqBnEGXgBeAF4AXgBeAF4AXgBeAF4AXgB5BoAG4wSGBo4GkwaAAIADHgR5AF4AXgBeAJsGgABGA4AAowarBrMGswagALsGwwbLBjAA0wbaBtoG3QbaBtoG2gbaBtoG2gblBusG8wb7BgMHCwcTBxsHCwcjBysHMAc1BzUHOgdCB9oGSgdSB1oHYAfaBloHaAfaBlIH2gbaBtoG2gbaBtoG2gbaBjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHbQdeAF4ANQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQd1B30HNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B4MH2gaKB68EgACAAIAAgACAAIAAgACAAI8HlwdeAJ8HpweAAIAArwe3B14AXgC/B8UHygcwANAH2AfgB4AA6AfwBz4B+AcACFwBCAgPCBcIogEYAR8IJwiAAC8INwg/CCADRwhPCFcIXwhnCEoDGgSAAIAAgABvCHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIhAiLCI4IMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANQc1BzUHNQc1BzUHNQc1BzUHNQc1B54INQc1B6II2gaqCLIIugiAAIAAvgjGCIAAgACAAIAAgACAAIAAgACAAIAAywiHAYAA0wiAANkI3QjlCO0I9Aj8CIAAgACAAAIJCgkSCRoJIgknCTYHLwk3CZYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACJCR4E6AswADAAhwHwC4AA+AsADAgMEAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMACAAIAAGAwdDCUMMAAwAC0MNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQw1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHPQwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADUHNQc1BzUHNQc1BzUHNQc2BzAAMAA5DDUHNQc1BzUHNQc1BzUHNQc1BzUHNQdFDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAATQxSDFoMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAF4AXgBeAF4AXgBeAF4AYgxeAGoMXgBxDHkMfwxeAIUMXgBeAI0MMAAwADAAMAAwAF4AXgCVDJ0MMAAwADAAMABeAF4ApQxeAKsMswy7DF4Awgy9DMoMXgBeAF4AXgBeAF4AXgBeAF4AXgDRDNkMeQBqCeAM3Ax8AOYM7Az0DPgMXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgCgAAANoAAHDQ4NFg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAeDSYNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAC4NMABeAF4ANg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAD4NRg1ODVYNXg1mDTAAbQ0wADAAMAAwADAAMAAwADAA2gbaBtoG2gbaBtoG2gbaBnUNeg3CBYANwgWFDdoGjA3aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gaUDZwNpA2oDdoG2gawDbcNvw3HDdoG2gbPDdYN3A3fDeYN2gbsDfMN2gbaBvoN/g3aBgYODg7aBl4AXgBeABYOXgBeACUG2gYeDl4AJA5eACwO2w3aBtoGMQ45DtoG2gbaBtoGQQ7aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B1EO2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQdZDjUHNQc1BzUHNQc1B2EONQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHaA41BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B3AO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B2EO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBkkOeA6gAKAAoAAwADAAMAAwAKAAoACgAKAAoACgAKAAgA4wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAD//wQABAAEAAQABAAEAAQABAAEAA0AAwABAAEAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAKABMAFwAeABsAGgAeABcAFgASAB4AGwAYAA8AGAAcAEsASwBLAEsASwBLAEsASwBLAEsAGAAYAB4AHgAeABMAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAFgAbABIAHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYADQARAB4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkAFgAaABsAGwAbAB4AHQAdAB4ATwAXAB4ADQAeAB4AGgAbAE8ATwAOAFAAHQAdAB0ATwBPABcATwBPAE8AFgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAABABQAFAAUABQAAQABAAEAFAAUAAEAAQABAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAKwBQACsAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAKwArAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAKwAeAB4AHgAeAB4AHgAeAA4AHgArAA0ADQANAA0ADQANAA0ACQANAA0ADQAIAAQACwAEAAQADQAJAA0ADQAMAB0AHQAeABcAFwAWABcAFwAXABYAFwAdAB0AHgAeABQAFAAUAA0AAQABAAQABAAEAAQABAAJABoAGgAaABoAGgAaABoAGgAeABcAFwAdABUAFQAeAB4AHgAeAB4AHgAYABYAEQAVABUAFQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgANAB4ADQANAA0ADQAeAA0ADQANAAcAHgAeAB4AHgArAAQABAAEAAQABAAEAAQABAAEAAQAUABQACsAKwBPAFAAUABQAFAAUAAeAB4AHgAWABEATwBQAE8ATwBPAE8AUABQAFAAUABQAB4AHgAeABYAEQArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGgAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgBQABoAHgAdAB4AUAAeABoAHgAeAB4AHgAeAB4AHgAeAB4ATwAeAFAAGwAeAB4AUABQAFAAUABQAB4AHgAeAB0AHQAeAFAAHgBQAB4AUAAeAFAATwBQAFAAHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AUABQAFAAUABPAE8AUABQAFAAUABQAE8AUABQAE8AUABPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAE8ATwBPAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAATwAeAB4AKwArACsAKwAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB0AHQAeAB4AHgAdAB0AHgAeAB0AHgAeAB4AHQAeAB0AGwAbAB4AHQAeAB4AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB0AHgAdAB4AHQAdAB0AHQAdAB0AHgAdAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAdAB0AHQAdAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAlACUAHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB0AHQAeAB4AHgAeAB0AHQAdAB4AHgAdAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB0AHQAeAB4AHQAeAB4AHgAeAB0AHQAeAB4AHgAeACUAJQAdAB0AJQAeACUAJQAlACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHQAdAB0AHgAdACUAHQAdAB4AHQAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHQAdAB0AHQAlAB4AJQAlACUAHQAlACUAHQAdAB0AJQAlAB0AHQAlAB0AHQAlACUAJQAeAB0AHgAeAB4AHgAdAB0AJQAdAB0AHQAdAB0AHQAlACUAJQAlACUAHQAlACUAIAAlAB0AHQAlACUAJQAlACUAJQAlACUAHgAeAB4AJQAlACAAIAAgACAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeABcAFwAXABcAFwAXAB4AEwATACUAHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACUAJQBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwArACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAE8ATwBPAE8ATwBPAE8ATwAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFwAXABcAFQAVABUAHgAeAB4AHgAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAlACAAIAAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA';
6152
 
6153
  /***/ }),
6154
+ /* 50 */
6155
  /***/ (function(module, exports, __webpack_require__) {
6156
 
6157
  "use strict";
6160
  Object.defineProperty(exports, "__esModule", {
6161
  value: true
6162
  });
 
 
 
 
 
 
 
 
 
 
 
6163
 
6164
+ var _Path = __webpack_require__(6);
6165
 
6166
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6167
 
6168
+ var Circle = function Circle(x, y, radius) {
6169
+ _classCallCheck(this, Circle);
 
 
 
 
6170
 
6171
+ this.type = _Path.PATH.CIRCLE;
6172
+ this.x = x;
6173
+ this.y = y;
6174
+ this.radius = radius;
6175
+ if (true) {
6176
+ if (isNaN(x)) {
6177
+ console.error('Invalid x value given for Circle');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6178
  }
6179
+ if (isNaN(y)) {
6180
+ console.error('Invalid y value given for Circle');
6181
+ }
6182
+ if (isNaN(radius)) {
6183
+ console.error('Invalid radius value given for Circle');
 
 
 
 
 
 
 
 
 
6184
  }
 
6185
  }
 
6186
  };
6187
 
6188
+ exports.default = Circle;
 
 
 
 
 
6189
 
6190
  /***/ }),
6191
+ /* 51 */
6192
  /***/ (function(module, exports, __webpack_require__) {
6193
 
6194
  "use strict";
6198
  value: true
6199
  });
6200
 
6201
+ 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"); } }; }();
6202
+
6203
  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; }; }();
6204
 
6205
+ var _Bounds = __webpack_require__(2);
6206
 
6207
+ var _Font = __webpack_require__(25);
 
 
6208
 
6209
+ var _Gradient = __webpack_require__(52);
 
6210
 
6211
+ var _TextContainer = __webpack_require__(9);
 
 
 
6212
 
6213
+ var _TextContainer2 = _interopRequireDefault(_TextContainer);
 
 
 
 
 
 
6214
 
6215
+ var _background = __webpack_require__(5);
 
6216
 
6217
+ var _border = __webpack_require__(12);
 
 
 
 
6218
 
6219
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
6220
 
6221
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6222
 
6223
+ var Renderer = function () {
6224
+ function Renderer(target, options) {
6225
+ _classCallCheck(this, Renderer);
6226
 
6227
+ this.target = target;
6228
+ this.options = options;
6229
+ target.render(options);
6230
+ }
6231
 
6232
+ _createClass(Renderer, [{
6233
+ key: 'renderNode',
6234
+ value: function renderNode(container) {
6235
+ if (container.isVisible()) {
6236
+ this.renderNodeBackgroundAndBorders(container);
6237
+ this.renderNodeContent(container);
6238
+ }
6239
+ }
6240
+ }, {
6241
+ key: 'renderNodeContent',
6242
+ value: function renderNodeContent(container) {
6243
+ var _this = this;
6244
 
6245
+ var callback = function callback() {
6246
+ if (container.childNodes.length) {
6247
+ container.childNodes.forEach(function (child) {
6248
+ if (child instanceof _TextContainer2.default) {
6249
+ var style = child.parent.style;
6250
+ _this.target.renderTextNode(child.bounds, style.color, style.font, style.textDecoration, style.textShadow);
6251
+ } else {
6252
+ _this.target.drawShape(child, container.style.color);
6253
+ }
6254
+ });
6255
+ }
 
6256
 
6257
+ if (container.image) {
6258
+ var _image = _this.options.imageStore.get(container.image);
6259
+ if (_image) {
6260
+ var contentBox = (0, _Bounds.calculateContentBox)(container.bounds, container.style.padding, container.style.border);
6261
+ var _width = typeof _image.width === 'number' && _image.width > 0 ? _image.width : contentBox.width;
6262
+ var _height = typeof _image.height === 'number' && _image.height > 0 ? _image.height : contentBox.height;
6263
+ if (_width > 0 && _height > 0) {
6264
+ _this.target.clip([(0, _Bounds.calculatePaddingBoxPath)(container.curvedBounds)], function () {
6265
+ _this.target.drawImage(_image, new _Bounds.Bounds(0, 0, _width, _height), contentBox);
6266
+ });
6267
+ }
6268
+ }
6269
+ }
6270
+ };
6271
+ var paths = container.getClipPaths();
6272
+ if (paths.length) {
6273
+ this.target.clip(paths, callback);
6274
+ } else {
6275
+ callback();
6276
+ }
6277
+ }
6278
+ }, {
6279
+ key: 'renderNodeBackgroundAndBorders',
6280
+ value: function renderNodeBackgroundAndBorders(container) {
6281
+ var _this2 = this;
6282
 
6283
+ var HAS_BACKGROUND = !container.style.background.backgroundColor.isTransparent() || container.style.background.backgroundImage.length;
6284
 
6285
+ var hasRenderableBorders = container.style.border.some(function (border) {
6286
+ return border.borderStyle !== _border.BORDER_STYLE.NONE && !border.borderColor.isTransparent();
6287
+ });
6288
 
6289
+ var callback = function callback() {
6290
+ var backgroundPaintingArea = (0, _background.calculateBackgroungPaintingArea)(container.curvedBounds, container.style.background.backgroundClip);
6291
 
6292
+ if (HAS_BACKGROUND) {
6293
+ _this2.target.clip([backgroundPaintingArea], function () {
6294
+ if (!container.style.background.backgroundColor.isTransparent()) {
6295
+ _this2.target.fill(container.style.background.backgroundColor);
6296
+ }
6297
 
6298
+ _this2.renderBackgroundImage(container);
6299
+ });
6300
+ }
6301
 
6302
+ container.style.border.forEach(function (border, side) {
6303
+ if (border.borderStyle !== _border.BORDER_STYLE.NONE && !border.borderColor.isTransparent()) {
6304
+ _this2.renderBorder(border, side, container.curvedBounds);
6305
+ }
6306
+ });
6307
+ };
6308
 
6309
+ if (HAS_BACKGROUND || hasRenderableBorders) {
6310
+ var paths = container.parent ? container.parent.getClipPaths() : [];
6311
+ if (paths.length) {
6312
+ this.target.clip(paths, callback);
6313
+ } else {
6314
+ callback();
6315
+ }
6316
+ }
6317
+ }
6318
+ }, {
6319
+ key: 'renderBackgroundImage',
6320
+ value: function renderBackgroundImage(container) {
6321
+ var _this3 = this;
6322
 
6323
+ container.style.background.backgroundImage.slice(0).reverse().forEach(function (backgroundImage) {
6324
+ if (backgroundImage.source.method === 'url' && backgroundImage.source.args.length) {
6325
+ _this3.renderBackgroundRepeat(container, backgroundImage);
6326
+ } else if (/gradient/i.test(backgroundImage.source.method)) {
6327
+ _this3.renderBackgroundGradient(container, backgroundImage);
6328
+ }
6329
+ });
6330
+ }
6331
+ }, {
6332
+ key: 'renderBackgroundRepeat',
6333
+ value: function renderBackgroundRepeat(container, background) {
6334
+ var image = this.options.imageStore.get(background.source.args[0]);
6335
+ if (image) {
6336
+ var backgroundPositioningArea = (0, _background.calculateBackgroungPositioningArea)(container.style.background.backgroundOrigin, container.bounds, container.style.padding, container.style.border);
6337
+ var backgroundImageSize = (0, _background.calculateBackgroundSize)(background, image, backgroundPositioningArea);
6338
+ var position = (0, _background.calculateBackgroundPosition)(background.position, backgroundImageSize, backgroundPositioningArea);
6339
+ var _path = (0, _background.calculateBackgroundRepeatPath)(background, position, backgroundImageSize, backgroundPositioningArea, container.bounds);
6340
 
6341
+ var _offsetX = Math.round(backgroundPositioningArea.left + position.x);
6342
+ var _offsetY = Math.round(backgroundPositioningArea.top + position.y);
6343
+ this.target.renderRepeat(_path, image, backgroundImageSize, _offsetX, _offsetY);
6344
+ }
6345
+ }
6346
+ }, {
6347
+ key: 'renderBackgroundGradient',
6348
+ value: function renderBackgroundGradient(container, background) {
6349
+ var backgroundPositioningArea = (0, _background.calculateBackgroungPositioningArea)(container.style.background.backgroundOrigin, container.bounds, container.style.padding, container.style.border);
6350
+ var backgroundImageSize = (0, _background.calculateGradientBackgroundSize)(background, backgroundPositioningArea);
6351
+ var position = (0, _background.calculateBackgroundPosition)(background.position, backgroundImageSize, backgroundPositioningArea);
6352
+ var gradientBounds = new _Bounds.Bounds(Math.round(backgroundPositioningArea.left + position.x), Math.round(backgroundPositioningArea.top + position.y), backgroundImageSize.width, backgroundImageSize.height);
6353
 
6354
+ var gradient = (0, _Gradient.parseGradient)(container, background.source, gradientBounds);
6355
+ if (gradient) {
6356
+ switch (gradient.type) {
6357
+ case _Gradient.GRADIENT_TYPE.LINEAR_GRADIENT:
6358
+ // $FlowFixMe
6359
+ this.target.renderLinearGradient(gradientBounds, gradient);
6360
+ break;
6361
+ case _Gradient.GRADIENT_TYPE.RADIAL_GRADIENT:
6362
+ // $FlowFixMe
6363
+ this.target.renderRadialGradient(gradientBounds, gradient);
6364
+ break;
6365
+ }
6366
+ }
6367
+ }
6368
+ }, {
6369
+ key: 'renderBorder',
6370
+ value: function renderBorder(border, side, curvePoints) {
6371
+ this.target.drawShape((0, _Bounds.parsePathForBorder)(curvePoints, side), border.borderColor);
6372
+ }
6373
+ }, {
6374
+ key: 'renderStack',
6375
+ value: function renderStack(stack) {
6376
+ var _this4 = this;
6377
 
6378
+ if (stack.container.isVisible()) {
6379
+ var _opacity = stack.getOpacity();
6380
+ if (_opacity !== this._opacity) {
6381
+ this.target.setOpacity(stack.getOpacity());
6382
+ this._opacity = _opacity;
6383
+ }
6384
 
6385
+ var _transform = stack.container.style.transform;
6386
+ if (_transform !== null) {
6387
+ this.target.transform(stack.container.bounds.left + _transform.transformOrigin[0].value, stack.container.bounds.top + _transform.transformOrigin[1].value, _transform.transform, function () {
6388
+ return _this4.renderStackContent(stack);
6389
+ });
6390
+ } else {
6391
+ this.renderStackContent(stack);
6392
+ }
6393
+ }
6394
+ }
6395
+ }, {
6396
+ key: 'renderStackContent',
6397
+ value: function renderStackContent(stack) {
6398
+ var _splitStackingContext = splitStackingContexts(stack),
6399
+ _splitStackingContext2 = _slicedToArray(_splitStackingContext, 5),
6400
+ negativeZIndex = _splitStackingContext2[0],
6401
+ zeroOrAutoZIndexOrTransformedOrOpacity = _splitStackingContext2[1],
6402
+ positiveZIndex = _splitStackingContext2[2],
6403
+ nonPositionedFloats = _splitStackingContext2[3],
6404
+ nonPositionedInlineLevel = _splitStackingContext2[4];
6405
 
6406
+ var _splitDescendants = splitDescendants(stack),
6407
+ _splitDescendants2 = _slicedToArray(_splitDescendants, 2),
6408
+ inlineLevel = _splitDescendants2[0],
6409
+ nonInlineLevel = _splitDescendants2[1];
6410
 
6411
+ // https://www.w3.org/TR/css-position-3/#painting-order
6412
+ // 1. the background and borders of the element forming the stacking context.
6413
 
 
6414
 
6415
+ this.renderNodeBackgroundAndBorders(stack.container);
6416
+ // 2. the child stacking contexts with negative stack levels (most negative first).
6417
+ negativeZIndex.sort(sortByZIndex).forEach(this.renderStack, this);
6418
+ // 3. For all its in-flow, non-positioned, block-level descendants in tree order:
6419
+ this.renderNodeContent(stack.container);
6420
+ nonInlineLevel.forEach(this.renderNode, this);
6421
+ // 4. All non-positioned floating descendants, in tree order. For each one of these,
6422
+ // treat the element as if it created a new stacking context, but any positioned descendants and descendants
6423
+ // which actually create a new stacking context should be considered part of the parent stacking context,
6424
+ // not this new one.
6425
+ nonPositionedFloats.forEach(this.renderStack, this);
6426
+ // 5. the in-flow, inline-level, non-positioned descendants, including inline tables and inline blocks.
6427
+ nonPositionedInlineLevel.forEach(this.renderStack, this);
6428
+ inlineLevel.forEach(this.renderNode, this);
6429
+ // 6. All positioned, opacity or transform descendants, in tree order that fall into the following categories:
6430
+ // All positioned descendants with 'z-index: auto' or 'z-index: 0', in tree order.
6431
+ // For those with 'z-index: auto', treat the element as if it created a new stacking context,
6432
+ // but any positioned descendants and descendants which actually create a new stacking context should be
6433
+ // considered part of the parent stacking context, not this new one. For those with 'z-index: 0',
6434
+ // treat the stacking context generated atomically.
6435
+ //
6436
+ // All opacity descendants with opacity less than 1
6437
+ //
6438
+ // All transform descendants with transform other than none
6439
+ zeroOrAutoZIndexOrTransformedOrOpacity.forEach(this.renderStack, this);
6440
+ // 7. Stacking contexts formed by positioned descendants with z-indices greater than or equal to 1 in z-index
6441
+ // order (smallest first) then tree order.
6442
+ positiveZIndex.sort(sortByZIndex).forEach(this.renderStack, this);
6443
+ }
6444
+ }, {
6445
+ key: 'render',
6446
+ value: function render(stack) {
6447
+ var _this5 = this;
6448
 
6449
+ if (this.options.backgroundColor) {
6450
+ this.target.rectangle(this.options.x, this.options.y, this.options.width, this.options.height, this.options.backgroundColor);
 
6451
  }
6452
+ this.renderStack(stack);
6453
+ var target = this.target.getTarget();
6454
+ if (true) {
6455
+ return target.then(function (output) {
6456
+ _this5.options.logger.log('Render completed');
6457
+ return output;
6458
+ });
6459
+ }
6460
+ return target;
6461
+ }
6462
+ }]);
6463
 
6464
+ return Renderer;
6465
+ }();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6466
 
6467
+ exports.default = Renderer;
 
6468
 
 
6469
 
6470
+ var splitDescendants = function splitDescendants(stack) {
6471
+ var inlineLevel = [];
6472
+ var nonInlineLevel = [];
6473
 
6474
+ var length = stack.children.length;
6475
+ for (var i = 0; i < length; i++) {
6476
+ var child = stack.children[i];
6477
+ if (child.isInlineLevel()) {
6478
+ inlineLevel.push(child);
6479
+ } else {
6480
+ nonInlineLevel.push(child);
6481
  }
6482
+ }
6483
+ return [inlineLevel, nonInlineLevel];
6484
+ };
 
 
 
 
6485
 
6486
+ var splitStackingContexts = function splitStackingContexts(stack) {
6487
+ var negativeZIndex = [];
6488
+ var zeroOrAutoZIndexOrTransformedOrOpacity = [];
6489
+ var positiveZIndex = [];
6490
+ var nonPositionedFloats = [];
6491
+ var nonPositionedInlineLevel = [];
6492
+ var length = stack.contexts.length;
6493
+ for (var i = 0; i < length; i++) {
6494
+ var child = stack.contexts[i];
6495
+ if (child.container.isPositioned() || child.container.style.opacity < 1 || child.container.isTransformed()) {
6496
+ if (child.container.style.zIndex.order < 0) {
6497
+ negativeZIndex.push(child);
6498
+ } else if (child.container.style.zIndex.order > 0) {
6499
+ positiveZIndex.push(child);
6500
+ } else {
6501
+ zeroOrAutoZIndexOrTransformedOrOpacity.push(child);
6502
+ }
6503
+ } else {
6504
+ if (child.container.isFloating()) {
6505
+ nonPositionedFloats.push(child);
6506
+ } else {
6507
+ nonPositionedInlineLevel.push(child);
6508
+ }
6509
  }
6510
+ }
6511
+ return [negativeZIndex, zeroOrAutoZIndexOrTransformedOrOpacity, positiveZIndex, nonPositionedFloats, nonPositionedInlineLevel];
6512
+ };
6513
 
6514
+ var sortByZIndex = function sortByZIndex(a, b) {
6515
+ if (a.container.style.zIndex.order > b.container.style.zIndex.order) {
6516
+ return 1;
6517
+ } else if (a.container.style.zIndex.order < b.container.style.zIndex.order) {
6518
+ return -1;
6519
+ }
6520
+
6521
+ return a.container.index > b.container.index ? 1 : -1;
6522
+ };
6523
 
6524
  /***/ }),
6525
+ /* 52 */
6526
  /***/ (function(module, exports, __webpack_require__) {
6527
 
6528
  "use strict";
6531
  Object.defineProperty(exports, "__esModule", {
6532
  value: true
6533
  });
6534
+ exports.transformWebkitRadialGradientArgs = exports.parseGradient = exports.RadialGradient = exports.LinearGradient = exports.RADIAL_GRADIENT_SHAPE = exports.GRADIENT_TYPE = undefined;
 
 
6535
 
6536
+ 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"); } }; }();
6537
 
6538
+ var _NodeContainer = __webpack_require__(3);
6539
 
6540
+ var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
 
 
 
 
6541
 
6542
+ var _Angle = __webpack_require__(53);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6543
 
6544
+ var _Color = __webpack_require__(0);
 
6545
 
6546
+ var _Color2 = _interopRequireDefault(_Color);
 
 
6547
 
6548
+ var _Length = __webpack_require__(1);
 
 
 
 
 
 
6549
 
6550
+ var _Length2 = _interopRequireDefault(_Length);
 
 
6551
 
6552
+ var _Util = __webpack_require__(4);
 
 
6553
 
6554
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6555
 
6556
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6557
 
6558
+ var SIDE_OR_CORNER = /^(to )?(left|top|right|bottom)( (left|top|right|bottom))?$/i;
6559
+ var PERCENTAGE_ANGLES = /^([+-]?\d*\.?\d+)% ([+-]?\d*\.?\d+)%$/i;
6560
+ var ENDS_WITH_LENGTH = /(px)|%|( 0)$/i;
6561
+ var FROM_TO_COLORSTOP = /^(from|to|color-stop)\((?:([\d.]+)(%)?,\s*)?(.+?)\)$/i;
6562
+ 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;
6563
 
6564
+ var GRADIENT_TYPE = exports.GRADIENT_TYPE = {
6565
+ LINEAR_GRADIENT: 0,
6566
+ RADIAL_GRADIENT: 1
6567
+ };
6568
 
6569
+ var RADIAL_GRADIENT_SHAPE = exports.RADIAL_GRADIENT_SHAPE = {
6570
+ CIRCLE: 0,
6571
+ ELLIPSE: 1
6572
+ };
6573
 
6574
+ var LENGTH_FOR_POSITION = {
6575
+ left: new _Length2.default('0%'),
6576
+ top: new _Length2.default('0%'),
6577
+ center: new _Length2.default('50%'),
6578
+ right: new _Length2.default('100%'),
6579
+ bottom: new _Length2.default('100%')
6580
+ };
6581
 
6582
+ var LinearGradient = exports.LinearGradient = function LinearGradient(colorStops, direction) {
6583
+ _classCallCheck(this, LinearGradient);
6584
 
6585
+ this.type = GRADIENT_TYPE.LINEAR_GRADIENT;
6586
+ this.colorStops = colorStops;
6587
+ this.direction = direction;
6588
+ };
6589
 
6590
+ var RadialGradient = exports.RadialGradient = function RadialGradient(colorStops, shape, center, radius) {
6591
+ _classCallCheck(this, RadialGradient);
6592
 
6593
+ this.type = GRADIENT_TYPE.RADIAL_GRADIENT;
6594
+ this.colorStops = colorStops;
6595
+ this.shape = shape;
6596
+ this.center = center;
6597
+ this.radius = radius;
6598
+ };
6599
 
6600
+ var parseGradient = exports.parseGradient = function parseGradient(container, _ref, bounds) {
6601
+ var args = _ref.args,
6602
+ method = _ref.method,
6603
+ prefix = _ref.prefix;
6604
 
6605
+ if (method === 'linear-gradient') {
6606
+ return parseLinearGradient(args, bounds, !!prefix);
6607
+ } else if (method === 'gradient' && args[0] === 'linear') {
6608
+ // TODO handle correct angle
6609
+ return parseLinearGradient(['to bottom'].concat(transformObsoleteColorStops(args.slice(3))), bounds, !!prefix);
6610
+ } else if (method === 'radial-gradient') {
6611
+ return parseRadialGradient(container, prefix === '-webkit-' ? transformWebkitRadialGradientArgs(args) : args, bounds);
6612
+ } else if (method === 'gradient' && args[0] === 'radial') {
6613
+ return parseRadialGradient(container, transformObsoleteColorStops(transformWebkitRadialGradientArgs(args.slice(1))), bounds);
6614
  }
6615
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6616
 
6617
+ var parseColorStops = function parseColorStops(args, firstColorStopIndex, lineLength) {
6618
+ var colorStops = [];
6619
 
6620
+ for (var i = firstColorStopIndex; i < args.length; i++) {
6621
+ var value = args[i];
6622
+ var HAS_LENGTH = ENDS_WITH_LENGTH.test(value);
6623
+ var lastSpaceIndex = value.lastIndexOf(' ');
6624
+ var _color = new _Color2.default(HAS_LENGTH ? value.substring(0, lastSpaceIndex) : value);
6625
+ 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;
6626
+ colorStops.push({ color: _color, stop: _stop });
6627
  }
 
 
6628
 
6629
+ var absoluteValuedColorStops = colorStops.map(function (_ref2) {
6630
+ var color = _ref2.color,
6631
+ stop = _ref2.stop;
6632
 
6633
+ var absoluteStop = lineLength === 0 ? 0 : stop ? stop.getAbsoluteValue(lineLength) / lineLength : null;
6634
 
6635
+ return {
6636
+ color: color,
6637
+ // $FlowFixMe
6638
+ stop: absoluteStop
6639
+ };
6640
+ });
6641
 
6642
+ var previousColorStop = absoluteValuedColorStops[0].stop;
6643
+ for (var _i = 0; _i < absoluteValuedColorStops.length; _i++) {
6644
+ if (previousColorStop !== null) {
6645
+ var _stop2 = absoluteValuedColorStops[_i].stop;
6646
+ if (_stop2 === null) {
6647
+ var n = _i;
6648
+ while (absoluteValuedColorStops[n].stop === null) {
6649
+ n++;
6650
+ }
6651
+ var steps = n - _i + 1;
6652
+ var nextColorStep = absoluteValuedColorStops[n].stop;
6653
+ var stepSize = (nextColorStep - previousColorStop) / steps;
6654
+ for (; _i < n; _i++) {
6655
+ previousColorStop = absoluteValuedColorStops[_i].stop = previousColorStop + stepSize;
6656
+ }
6657
+ } else {
6658
+ previousColorStop = _stop2;
6659
+ }
6660
+ }
6661
+ }
6662
 
6663
+ return absoluteValuedColorStops;
6664
+ };
6665
 
6666
+ var parseLinearGradient = function parseLinearGradient(args, bounds, hasPrefix) {
6667
+ var angle = (0, _Angle.parseAngle)(args[0]);
6668
+ var HAS_SIDE_OR_CORNER = SIDE_OR_CORNER.test(args[0]);
6669
+ var HAS_DIRECTION = HAS_SIDE_OR_CORNER || angle !== null || PERCENTAGE_ANGLES.test(args[0]);
6670
+ var direction = HAS_DIRECTION ? angle !== null ? calculateGradientDirection(
6671
+ // if there is a prefix, the 0° angle points due East (instead of North per W3C)
6672
+ hasPrefix ? angle - Math.PI * 0.5 : angle, bounds) : HAS_SIDE_OR_CORNER ? parseSideOrCorner(args[0], bounds) : parsePercentageAngle(args[0], bounds) : calculateGradientDirection(Math.PI, bounds);
6673
+ var firstColorStopIndex = HAS_DIRECTION ? 1 : 0;
6674
 
6675
+ // TODO: Fix some inaccuracy with color stops with px values
6676
+ 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);
6677
 
6678
+ return new LinearGradient(parseColorStops(args, firstColorStopIndex, lineLength), direction);
6679
+ };
6680
 
6681
+ var parseRadialGradient = function parseRadialGradient(container, args, bounds) {
6682
+ var m = args[0].match(RADIAL_SHAPE_DEFINITION);
6683
+ var shape = m && (m[1] === 'circle' || // explicit shape specification
6684
+ m[3] !== undefined && m[5] === undefined) // only one radius coordinate
6685
+ ? RADIAL_GRADIENT_SHAPE.CIRCLE : RADIAL_GRADIENT_SHAPE.ELLIPSE;
6686
+ var radius = {};
6687
+ var center = {};
6688
 
6689
+ if (m) {
6690
+ // Radius
6691
+ if (m[3] !== undefined) {
6692
+ radius.x = (0, _Length.calculateLengthFromValueWithUnit)(container, m[3], m[4]).getAbsoluteValue(bounds.width);
6693
+ }
6694
 
6695
+ if (m[5] !== undefined) {
6696
+ radius.y = (0, _Length.calculateLengthFromValueWithUnit)(container, m[5], m[6]).getAbsoluteValue(bounds.height);
6697
+ }
6698
 
6699
+ // Position
6700
+ if (m[7]) {
6701
+ center.x = LENGTH_FOR_POSITION[m[7].toLowerCase()];
6702
+ } else if (m[8] !== undefined) {
6703
+ center.x = (0, _Length.calculateLengthFromValueWithUnit)(container, m[8], m[9]);
6704
+ }
6705
 
6706
+ if (m[10]) {
6707
+ center.y = LENGTH_FOR_POSITION[m[10].toLowerCase()];
6708
+ } else if (m[11] !== undefined) {
6709
+ center.y = (0, _Length.calculateLengthFromValueWithUnit)(container, m[11], m[12]);
6710
+ }
6711
+ }
6712
 
6713
+ var gradientCenter = {
6714
+ x: center.x === undefined ? bounds.width / 2 : center.x.getAbsoluteValue(bounds.width),
6715
+ y: center.y === undefined ? bounds.height / 2 : center.y.getAbsoluteValue(bounds.height)
6716
+ };
6717
+ var gradientRadius = calculateRadius(m && m[2] || 'farthest-corner', shape, gradientCenter, radius, bounds);
6718
 
6719
+ return new RadialGradient(parseColorStops(args, m ? 1 : 0, Math.min(gradientRadius.x, gradientRadius.y)), shape, gradientCenter, gradientRadius);
6720
+ };
6721
 
6722
+ var calculateGradientDirection = function calculateGradientDirection(radian, bounds) {
6723
+ var width = bounds.width;
6724
+ var height = bounds.height;
6725
+ var HALF_WIDTH = width * 0.5;
6726
+ var HALF_HEIGHT = height * 0.5;
6727
+ var lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian));
6728
+ var HALF_LINE_LENGTH = lineLength / 2;
6729
 
6730
+ var x0 = HALF_WIDTH + Math.sin(radian) * HALF_LINE_LENGTH;
6731
+ var y0 = HALF_HEIGHT - Math.cos(radian) * HALF_LINE_LENGTH;
6732
+ var x1 = width - x0;
6733
+ var y1 = height - y0;
6734
 
6735
+ return { x0: x0, x1: x1, y0: y0, y1: y1 };
6736
+ };
6737
 
6738
+ var parseTopRight = function parseTopRight(bounds) {
6739
+ return Math.acos(bounds.width / 2 / ((0, _Util.distance)(bounds.width, bounds.height) / 2));
6740
+ };
6741
 
6742
+ var parseSideOrCorner = function parseSideOrCorner(side, bounds) {
6743
+ switch (side) {
6744
+ case 'bottom':
6745
+ case 'to top':
6746
+ return calculateGradientDirection(0, bounds);
6747
+ case 'left':
6748
+ case 'to right':
6749
+ return calculateGradientDirection(Math.PI / 2, bounds);
6750
+ case 'right':
6751
+ case 'to left':
6752
+ return calculateGradientDirection(3 * Math.PI / 2, bounds);
6753
+ case 'top right':
6754
+ case 'right top':
6755
+ case 'to bottom left':
6756
+ case 'to left bottom':
6757
+ return calculateGradientDirection(Math.PI + parseTopRight(bounds), bounds);
6758
+ case 'top left':
6759
+ case 'left top':
6760
+ case 'to bottom right':
6761
+ case 'to right bottom':
6762
+ return calculateGradientDirection(Math.PI - parseTopRight(bounds), bounds);
6763
+ case 'bottom left':
6764
+ case 'left bottom':
6765
+ case 'to top right':
6766
+ case 'to right top':
6767
+ return calculateGradientDirection(parseTopRight(bounds), bounds);
6768
+ case 'bottom right':
6769
+ case 'right bottom':
6770
+ case 'to top left':
6771
+ case 'to left top':
6772
+ return calculateGradientDirection(2 * Math.PI - parseTopRight(bounds), bounds);
6773
+ case 'top':
6774
+ case 'to bottom':
6775
+ default:
6776
+ return calculateGradientDirection(Math.PI, bounds);
6777
+ }
6778
+ };
6779
 
6780
+ var parsePercentageAngle = function parsePercentageAngle(angle, bounds) {
6781
+ var _angle$split$map = angle.split(' ').map(parseFloat),
6782
+ _angle$split$map2 = _slicedToArray(_angle$split$map, 2),
6783
+ left = _angle$split$map2[0],
6784
+ top = _angle$split$map2[1];
6785
 
6786
+ var ratio = left / 100 * bounds.width / (top / 100 * bounds.height);
6787
 
6788
+ return calculateGradientDirection(Math.atan(isNaN(ratio) ? 1 : ratio) + Math.PI / 2, bounds);
6789
+ };
6790
 
6791
+ var findCorner = function findCorner(bounds, x, y, closest) {
6792
+ var corners = [{ x: 0, y: 0 }, { x: 0, y: bounds.height }, { x: bounds.width, y: 0 }, { x: bounds.width, y: bounds.height }];
6793
 
6794
+ // $FlowFixMe
6795
+ return corners.reduce(function (stat, corner) {
6796
+ var d = (0, _Util.distance)(x - corner.x, y - corner.y);
6797
+ if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {
6798
+ return {
6799
+ optimumCorner: corner,
6800
+ optimumDistance: d
6801
+ };
6802
+ }
6803
 
6804
+ return stat;
6805
+ }, {
6806
+ optimumDistance: closest ? Infinity : -Infinity,
6807
+ optimumCorner: null
6808
+ }).optimumCorner;
6809
+ };
6810
 
6811
+ var calculateRadius = function calculateRadius(extent, shape, center, radius, bounds) {
6812
+ var x = center.x;
6813
+ var y = center.y;
6814
+ var rx = 0;
6815
+ var ry = 0;
6816
+
6817
+ switch (extent) {
6818
+ case 'closest-side':
6819
+ // The ending shape is sized so that that it exactly meets the side of the gradient box closest to the gradient’s center.
6820
+ // If the shape is an ellipse, it exactly meets the closest side in each dimension.
6821
+ if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
6822
+ rx = ry = Math.min(Math.abs(x), Math.abs(x - bounds.width), Math.abs(y), Math.abs(y - bounds.height));
6823
+ } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
6824
+ rx = Math.min(Math.abs(x), Math.abs(x - bounds.width));
6825
+ ry = Math.min(Math.abs(y), Math.abs(y - bounds.height));
6826
  }
6827
+ break;
6828
 
6829
+ case 'closest-corner':
6830
+ // The ending shape is sized so that that it passes through the corner of the gradient box closest to the gradient’s center.
6831
+ // If the shape is an ellipse, the ending shape is given the same aspect-ratio it would have if closest-side were specified.
6832
+ if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
6833
+ 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));
6834
+ } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
6835
+ // Compute the ratio ry/rx (which is to be the same as for "closest-side")
6836
+ var c = Math.min(Math.abs(y), Math.abs(y - bounds.height)) / Math.min(Math.abs(x), Math.abs(x - bounds.width));
6837
+ var corner = findCorner(bounds, x, y, true);
6838
+ rx = (0, _Util.distance)(corner.x - x, (corner.y - y) / c);
6839
+ ry = c * rx;
6840
+ }
6841
+ break;
6842
 
6843
+ case 'farthest-side':
6844
+ // Same as closest-side, except the ending shape is sized based on the farthest side(s)
6845
+ if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
6846
+ rx = ry = Math.max(Math.abs(x), Math.abs(x - bounds.width), Math.abs(y), Math.abs(y - bounds.height));
6847
+ } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
6848
+ rx = Math.max(Math.abs(x), Math.abs(x - bounds.width));
6849
+ ry = Math.max(Math.abs(y), Math.abs(y - bounds.height));
6850
+ }
6851
+ break;
6852
 
6853
+ case 'farthest-corner':
6854
+ // Same as closest-corner, except the ending shape is sized based on the farthest corner.
6855
+ // If the shape is an ellipse, the ending shape is given the same aspect ratio it would have if farthest-side were specified.
6856
+ if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
6857
+ 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));
6858
+ } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
6859
+ // Compute the ratio ry/rx (which is to be the same as for "farthest-side")
6860
+ var _c = Math.max(Math.abs(y), Math.abs(y - bounds.height)) / Math.max(Math.abs(x), Math.abs(x - bounds.width));
6861
+ var _corner = findCorner(bounds, x, y, false);
6862
+ rx = (0, _Util.distance)(_corner.x - x, (_corner.y - y) / _c);
6863
+ ry = _c * rx;
6864
+ }
6865
+ break;
6866
 
6867
+ default:
6868
+ // pixel or percentage values
6869
+ rx = radius.x || 0;
6870
+ ry = radius.y !== undefined ? radius.y : rx;
6871
+ break;
6872
+ }
6873
 
6874
+ return {
6875
+ x: rx,
6876
+ y: ry
6877
+ };
6878
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6879
 
6880
+ var transformWebkitRadialGradientArgs = exports.transformWebkitRadialGradientArgs = function transformWebkitRadialGradientArgs(args) {
6881
+ var shape = '';
6882
+ var radius = '';
6883
+ var extent = '';
6884
+ var position = '';
6885
+ var idx = 0;
6886
 
6887
+ var POSITION = /^(left|center|right|\d+(?:px|r?em|%)?)(?:\s+(top|center|bottom|\d+(?:px|r?em|%)?))?$/i;
6888
+ var SHAPE_AND_EXTENT = /^(circle|ellipse)?\s*(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)?$/i;
6889
+ var RADIUS = /^\d+(px|r?em|%)?(?:\s+\d+(px|r?em|%)?)?$/i;
6890
 
6891
+ var matchStartPosition = args[idx].match(POSITION);
6892
+ if (matchStartPosition) {
6893
+ idx++;
6894
+ }
6895
 
6896
+ var matchShapeExtent = args[idx].match(SHAPE_AND_EXTENT);
6897
+ if (matchShapeExtent) {
6898
+ shape = matchShapeExtent[1] || '';
6899
+ extent = matchShapeExtent[2] || '';
6900
+ if (extent === 'contain') {
6901
+ extent = 'closest-side';
6902
+ } else if (extent === 'cover') {
6903
+ extent = 'farthest-corner';
6904
+ }
6905
+ idx++;
6906
+ }
6907
 
6908
+ var matchStartRadius = args[idx].match(RADIUS);
6909
+ if (matchStartRadius) {
6910
+ idx++;
6911
+ }
6912
 
6913
+ var matchEndPosition = args[idx].match(POSITION);
6914
+ if (matchEndPosition) {
6915
+ idx++;
6916
+ }
6917
 
6918
+ var matchEndRadius = args[idx].match(RADIUS);
6919
+ if (matchEndRadius) {
6920
+ idx++;
6921
+ }
 
6922
 
6923
+ var matchPosition = matchEndPosition || matchStartPosition;
6924
+ if (matchPosition && matchPosition[1]) {
6925
+ position = matchPosition[1] + (/^\d+$/.test(matchPosition[1]) ? 'px' : '');
6926
+ if (matchPosition[2]) {
6927
+ position += ' ' + matchPosition[2] + (/^\d+$/.test(matchPosition[2]) ? 'px' : '');
6928
+ }
6929
+ }
 
 
 
 
6930
 
6931
+ var matchRadius = matchEndRadius || matchStartRadius;
6932
+ if (matchRadius) {
6933
+ radius = matchRadius[0];
6934
+ if (!matchRadius[1]) {
6935
+ radius += 'px';
6936
+ }
6937
+ }
 
 
 
 
 
 
 
 
6938
 
6939
+ if (position && !shape && !radius && !extent) {
6940
+ radius = position;
6941
+ position = '';
6942
+ }
6943
+
6944
+ if (position) {
6945
+ position = 'at ' + position;
6946
+ }
6947
+
6948
+ return [[shape, extent, radius, position].filter(function (s) {
6949
+ return !!s;
6950
+ }).join(' ')].concat(args.slice(idx));
6951
+ };
6952
+
6953
+ var transformObsoleteColorStops = function transformObsoleteColorStops(args) {
6954
+ return args.map(function (color) {
6955
+ return color.match(FROM_TO_COLORSTOP);
6956
+ })
6957
+ // $FlowFixMe
6958
+ .map(function (v, index) {
6959
+ if (!v) {
6960
+ return args[index];
6961
+ }
6962
+
6963
+ switch (v[1]) {
6964
+ case 'from':
6965
+ return v[4] + ' 0%';
6966
+ case 'to':
6967
+ return v[4] + ' 100%';
6968
+ case 'color-stop':
6969
+ if (v[3] === '%') {
6970
+ return v[4] + ' ' + v[2];
6971
  }
6972
+ return v[4] + ' ' + parseFloat(v[2]) * 100 + '%';
6973
+ }
6974
  });
6975
  };
6976
 
6977
  /***/ }),
6978
+ /* 53 */
6979
  /***/ (function(module, exports, __webpack_require__) {
6980
 
6981
  "use strict";
6984
  Object.defineProperty(exports, "__esModule", {
6985
  value: true
6986
  });
6987
+ var ANGLE = /([+-]?\d*\.?\d+)(deg|grad|rad|turn)/i;
 
 
 
 
 
 
 
 
6988
 
6989
+ var parseAngle = exports.parseAngle = function parseAngle(angle) {
6990
+ var match = angle.match(ANGLE);
6991
 
6992
+ if (match) {
6993
+ var value = parseFloat(match[1]);
6994
+ switch (match[2].toLowerCase()) {
6995
+ case 'deg':
6996
+ return Math.PI * value / 180;
6997
+ case 'grad':
6998
+ return Math.PI / 200 * value;
6999
+ case 'rad':
7000
+ return value;
7001
+ case 'turn':
7002
+ return Math.PI * 2 * value;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7003
  }
7004
  }
 
 
 
 
 
 
 
 
 
7005
 
7006
+ return null;
 
7007
  };
7008
 
7009
  /***/ }),
7010
+ /* 54 */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7011
  /***/ (function(module, exports, __webpack_require__) {
7012
 
7013
  "use strict";
7016
  Object.defineProperty(exports, "__esModule", {
7017
  value: true
7018
  });
7019
+ exports.cloneWindow = exports.DocumentCloner = undefined;
7020
 
7021
+ 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"); } }; }();
 
 
 
7022
 
7023
+ 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; }; }();
 
 
7024
 
7025
+ var _Bounds = __webpack_require__(2);
7026
 
7027
+ var _Proxy = __webpack_require__(26);
 
 
7028
 
7029
+ var _ResourceLoader = __webpack_require__(55);
7030
 
7031
+ var _ResourceLoader2 = _interopRequireDefault(_ResourceLoader);
7032
 
7033
+ var _Util = __webpack_require__(4);
 
 
7034
 
7035
+ var _background = __webpack_require__(5);
7036
 
7037
+ var _CanvasRenderer = __webpack_require__(15);
7038
 
7039
+ var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);
7040
 
7041
+ var _PseudoNodeContent = __webpack_require__(56);
7042
 
7043
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7044
 
7045
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7046
 
7047
+ var IGNORE_ATTRIBUTE = 'data-html2canvas-ignore';
 
 
7048
 
7049
+ var DocumentCloner = exports.DocumentCloner = function () {
7050
+ function DocumentCloner(element, options, logger, copyInline, renderer) {
7051
+ _classCallCheck(this, DocumentCloner);
7052
 
7053
+ this.referenceElement = element;
7054
+ this.scrolledElements = [];
7055
+ this.copyStyles = copyInline;
7056
+ this.inlineImages = copyInline;
7057
+ this.logger = logger;
7058
+ this.options = options;
7059
+ this.renderer = renderer;
7060
+ this.resourceLoader = new _ResourceLoader2.default(options, logger, window);
7061
+ this.pseudoContentData = {
7062
+ counters: {},
7063
+ quoteDepth: 0
7064
+ };
7065
+ // $FlowFixMe
7066
+ this.documentElement = this.cloneNode(element.ownerDocument.documentElement);
7067
  }
7068
 
7069
+ _createClass(DocumentCloner, [{
7070
+ key: 'inlineAllImages',
7071
+ value: function inlineAllImages(node) {
7072
+ var _this = this;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7073
 
7074
+ if (this.inlineImages && node) {
7075
+ var style = node.style;
7076
+ Promise.all((0, _background.parseBackgroundImage)(style.backgroundImage).map(function (backgroundImage) {
7077
+ if (backgroundImage.method === 'url') {
7078
+ return _this.resourceLoader.inlineImage(backgroundImage.args[0]).then(function (img) {
7079
+ return img && typeof img.src === 'string' ? 'url("' + img.src + '")' : 'none';
7080
+ }).catch(function (e) {
7081
+ if (true) {
7082
+ _this.logger.log('Unable to load image', e);
7083
+ }
7084
+ });
7085
+ }
7086
+ return Promise.resolve('' + backgroundImage.prefix + backgroundImage.method + '(' + backgroundImage.args.join(',') + ')');
7087
+ })).then(function (backgroundImages) {
7088
+ if (backgroundImages.length > 1) {
7089
+ // TODO Multiple backgrounds somehow broken in Chrome
7090
+ style.backgroundColor = '';
7091
+ }
7092
+ style.backgroundImage = backgroundImages.join(',');
7093
+ });
7094
 
7095
+ if (node instanceof HTMLImageElement) {
7096
+ this.resourceLoader.inlineImage(node.src).then(function (img) {
7097
+ if (img && node instanceof HTMLImageElement && node.parentNode) {
7098
+ var parentNode = node.parentNode;
7099
+ var clonedChild = (0, _Util.copyCSSStyles)(node.style, img.cloneNode(false));
7100
+ parentNode.replaceChild(clonedChild, node);
7101
+ }
7102
+ }).catch(function (e) {
7103
+ if (true) {
7104
+ _this.logger.log('Unable to load image', e);
7105
+ }
7106
+ });
7107
+ }
7108
+ }
7109
+ }
7110
+ }, {
7111
+ key: 'inlineFonts',
7112
+ value: function inlineFonts(document) {
7113
+ var _this2 = this;
7114
 
7115
+ return Promise.all(Array.from(document.styleSheets).map(function (sheet) {
7116
+ if (sheet.href) {
7117
+ return fetch(sheet.href).then(function (res) {
7118
+ return res.text();
7119
+ }).then(function (text) {
7120
+ return createStyleSheetFontsFromText(text, sheet.href);
7121
+ }).catch(function (e) {
7122
+ if (true) {
7123
+ _this2.logger.log('Unable to load stylesheet', e);
7124
+ }
7125
+ return [];
7126
+ });
7127
+ }
7128
+ return getSheetFonts(sheet, document);
7129
+ })).then(function (fonts) {
7130
+ return fonts.reduce(function (acc, font) {
7131
+ return acc.concat(font);
7132
+ }, []);
7133
+ }).then(function (fonts) {
7134
+ return Promise.all(fonts.map(function (font) {
7135
+ return fetch(font.formats[0].src).then(function (response) {
7136
+ return response.blob();
7137
+ }).then(function (blob) {
7138
+ return new Promise(function (resolve, reject) {
7139
+ var reader = new FileReader();
7140
+ reader.onerror = reject;
7141
+ reader.onload = function () {
7142
+ // $FlowFixMe
7143
+ var result = reader.result;
7144
+ resolve(result);
7145
+ };
7146
+ reader.readAsDataURL(blob);
7147
+ });
7148
+ }).then(function (dataUri) {
7149
+ font.fontFace.setProperty('src', 'url("' + dataUri + '")');
7150
+ return '@font-face {' + font.fontFace.cssText + ' ';
7151
+ });
7152
+ }));
7153
+ }).then(function (fontCss) {
7154
+ var style = document.createElement('style');
7155
+ style.textContent = fontCss.join('\n');
7156
+ _this2.documentElement.appendChild(style);
7157
+ });
7158
+ }
7159
+ }, {
7160
+ key: 'createElementClone',
7161
+ value: function createElementClone(node) {
7162
+ var _this3 = this;
7163
 
7164
+ if (this.copyStyles && node instanceof HTMLCanvasElement) {
7165
+ var img = node.ownerDocument.createElement('img');
7166
+ try {
7167
+ img.src = node.toDataURL();
7168
+ return img;
7169
+ } catch (e) {
7170
+ if (true) {
7171
+ this.logger.log('Unable to clone canvas contents, canvas is tainted');
7172
+ }
7173
+ }
7174
+ }
7175
 
7176
+ if (node instanceof HTMLIFrameElement) {
7177
+ var tempIframe = node.cloneNode(false);
7178
+ var iframeKey = generateIframeKey();
7179
+ tempIframe.setAttribute('data-html2canvas-internal-iframe-key', iframeKey);
7180
 
7181
+ var _parseBounds = (0, _Bounds.parseBounds)(node, 0, 0),
7182
+ width = _parseBounds.width,
7183
+ height = _parseBounds.height;
7184
 
7185
+ this.resourceLoader.cache[iframeKey] = getIframeDocumentElement(node, this.options).then(function (documentElement) {
7186
+ return _this3.renderer(documentElement, {
7187
+ async: _this3.options.async,
7188
+ allowTaint: _this3.options.allowTaint,
7189
+ backgroundColor: '#ffffff',
7190
+ canvas: null,
7191
+ imageTimeout: _this3.options.imageTimeout,
7192
+ logging: _this3.options.logging,
7193
+ proxy: _this3.options.proxy,
7194
+ removeContainer: _this3.options.removeContainer,
7195
+ scale: _this3.options.scale,
7196
+ foreignObjectRendering: _this3.options.foreignObjectRendering,
7197
+ useCORS: _this3.options.useCORS,
7198
+ target: new _CanvasRenderer2.default(),
7199
+ width: width,
7200
+ height: height,
7201
+ x: 0,
7202
+ y: 0,
7203
+ windowWidth: documentElement.ownerDocument.defaultView.innerWidth,
7204
+ windowHeight: documentElement.ownerDocument.defaultView.innerHeight,
7205
+ scrollX: documentElement.ownerDocument.defaultView.pageXOffset,
7206
+ scrollY: documentElement.ownerDocument.defaultView.pageYOffset
7207
+ }, _this3.logger.child(iframeKey));
7208
+ }).then(function (canvas) {
7209
+ return new Promise(function (resolve, reject) {
7210
+ var iframeCanvas = document.createElement('img');
7211
+ iframeCanvas.onload = function () {
7212
+ return resolve(canvas);
7213
+ };
7214
+ iframeCanvas.onerror = reject;
7215
+ iframeCanvas.src = canvas.toDataURL();
7216
+ if (tempIframe.parentNode) {
7217
+ tempIframe.parentNode.replaceChild((0, _Util.copyCSSStyles)(node.ownerDocument.defaultView.getComputedStyle(node), iframeCanvas), tempIframe);
7218
+ }
7219
+ });
7220
+ });
7221
+ return tempIframe;
7222
+ }
7223
 
7224
+ if (node instanceof HTMLStyleElement && node.sheet && node.sheet.cssRules) {
7225
+ var css = [].slice.call(node.sheet.cssRules, 0).reduce(function (css, rule) {
7226
+ try {
7227
+ if (rule && rule.cssText) {
7228
+ return css + rule.cssText;
7229
+ }
7230
+ return css;
7231
+ } catch (err) {
7232
+ _this3.logger.log('Unable to access cssText property', rule.name);
7233
+ return css;
7234
+ }
7235
+ }, '');
7236
+ var style = node.cloneNode(false);
7237
+ style.textContent = css;
7238
+ return style;
7239
+ }
7240
 
7241
+ return node.cloneNode(false);
7242
+ }
7243
+ }, {
7244
+ key: 'cloneNode',
7245
+ value: function cloneNode(node) {
7246
+ var clone = node.nodeType === Node.TEXT_NODE ? document.createTextNode(node.nodeValue) : this.createElementClone(node);
7247
 
7248
+ var window = node.ownerDocument.defaultView;
7249
+ var style = node instanceof window.HTMLElement ? window.getComputedStyle(node) : null;
7250
+ var styleBefore = node instanceof window.HTMLElement ? window.getComputedStyle(node, ':before') : null;
7251
+ var styleAfter = node instanceof window.HTMLElement ? window.getComputedStyle(node, ':after') : null;
7252
 
7253
+ if (this.referenceElement === node && clone instanceof window.HTMLElement) {
7254
+ this.clonedReferenceElement = clone;
7255
+ }
7256
 
7257
+ if (clone instanceof window.HTMLBodyElement) {
7258
+ createPseudoHideStyles(clone);
7259
+ }
7260
 
7261
+ var counters = (0, _PseudoNodeContent.parseCounterReset)(style, this.pseudoContentData);
7262
+ var contentBefore = (0, _PseudoNodeContent.resolvePseudoContent)(node, styleBefore, this.pseudoContentData);
7263
 
7264
+ for (var child = node.firstChild; child; child = child.nextSibling) {
7265
+ if (child.nodeType !== Node.ELEMENT_NODE || child.nodeName !== 'SCRIPT' &&
7266
+ // $FlowFixMe
7267
+ !child.hasAttribute(IGNORE_ATTRIBUTE) && (typeof this.options.ignoreElements !== 'function' ||
7268
+ // $FlowFixMe
7269
+ !this.options.ignoreElements(child))) {
7270
+ if (!this.copyStyles || child.nodeName !== 'STYLE') {
7271
+ clone.appendChild(this.cloneNode(child));
7272
+ }
7273
+ }
7274
+ }
7275
 
7276
+ var contentAfter = (0, _PseudoNodeContent.resolvePseudoContent)(node, styleAfter, this.pseudoContentData);
7277
+ (0, _PseudoNodeContent.popCounters)(counters, this.pseudoContentData);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7278
 
7279
+ if (node instanceof window.HTMLElement && clone instanceof window.HTMLElement) {
7280
+ if (styleBefore) {
7281
+ this.inlineAllImages(inlinePseudoElement(node, clone, styleBefore, contentBefore, PSEUDO_BEFORE));
7282
+ }
7283
+ if (styleAfter) {
7284
+ this.inlineAllImages(inlinePseudoElement(node, clone, styleAfter, contentAfter, PSEUDO_AFTER));
7285
+ }
7286
+ if (style && this.copyStyles && !(node instanceof HTMLIFrameElement)) {
7287
+ (0, _Util.copyCSSStyles)(style, clone);
7288
+ }
7289
+ this.inlineAllImages(clone);
7290
+ if (node.scrollTop !== 0 || node.scrollLeft !== 0) {
7291
+ this.scrolledElements.push([clone, node.scrollLeft, node.scrollTop]);
7292
+ }
7293
+ switch (node.nodeName) {
7294
+ case 'CANVAS':
7295
+ if (!this.copyStyles) {
7296
+ cloneCanvasContents(node, clone);
7297
+ }
7298
+ break;
7299
+ case 'TEXTAREA':
7300
+ case 'SELECT':
7301
+ clone.value = node.value;
7302
+ break;
7303
+ }
7304
+ }
7305
+ return clone;
7306
+ }
7307
+ }]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7308
 
7309
+ return DocumentCloner;
7310
+ }();
7311
 
7312
+ var getSheetFonts = function getSheetFonts(sheet, document) {
7313
+ // $FlowFixMe
7314
+ return (sheet.cssRules ? Array.from(sheet.cssRules) : []).filter(function (rule) {
7315
+ return rule.type === CSSRule.FONT_FACE_RULE;
7316
+ }).map(function (rule) {
7317
+ var src = (0, _background.parseBackgroundImage)(rule.style.getPropertyValue('src'));
7318
+ var formats = [];
7319
+ for (var i = 0; i < src.length; i++) {
7320
+ if (src[i].method === 'url' && src[i + 1] && src[i + 1].method === 'format') {
7321
+ var a = document.createElement('a');
7322
+ a.href = src[i].args[0];
7323
+ if (document.body) {
7324
+ document.body.appendChild(a);
7325
+ }
7326
 
7327
+ var font = {
7328
+ src: a.href,
7329
+ format: src[i + 1].args[0]
7330
+ };
7331
+ formats.push(font);
7332
+ }
7333
+ }
7334
 
7335
+ return {
7336
+ // TODO select correct format for browser),
 
7337
 
7338
+ formats: formats.filter(function (font) {
7339
+ return (/^woff/i.test(font.format)
7340
+ );
7341
+ }),
7342
+ fontFace: rule.style
7343
+ };
7344
+ }).filter(function (font) {
7345
+ return font.formats.length;
7346
+ });
7347
+ };
7348
 
7349
+ var createStyleSheetFontsFromText = function createStyleSheetFontsFromText(text, baseHref) {
7350
+ var doc = document.implementation.createHTMLDocument('');
7351
+ var base = document.createElement('base');
7352
+ // $FlowFixMe
7353
+ base.href = baseHref;
7354
+ var style = document.createElement('style');
7355
 
7356
+ style.textContent = text;
7357
+ if (doc.head) {
7358
+ doc.head.appendChild(base);
7359
+ }
7360
+ if (doc.body) {
7361
+ doc.body.appendChild(style);
7362
+ }
7363
+
7364
+ return style.sheet ? getSheetFonts(style.sheet, doc) : [];
7365
  };
7366
 
7367
+ var restoreOwnerScroll = function restoreOwnerScroll(ownerDocument, x, y) {
7368
+ if (ownerDocument.defaultView && (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)) {
7369
+ ownerDocument.defaultView.scrollTo(x, y);
 
 
 
 
 
 
 
7370
  }
 
7371
  };
7372
 
7373
+ var cloneCanvasContents = function cloneCanvasContents(canvas, clonedCanvas) {
7374
+ try {
7375
+ if (clonedCanvas) {
7376
+ clonedCanvas.width = canvas.width;
7377
+ clonedCanvas.height = canvas.height;
7378
+ var ctx = canvas.getContext('2d');
7379
+ var clonedCtx = clonedCanvas.getContext('2d');
7380
+ if (ctx) {
7381
+ clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
7382
+ } else {
7383
+ clonedCtx.drawImage(canvas, 0, 0);
7384
+ }
7385
+ }
7386
+ } catch (e) {}
7387
+ };
7388
 
7389
+ var inlinePseudoElement = function inlinePseudoElement(node, clone, style, contentItems, pseudoElt) {
7390
+ if (!style || !style.content || style.content === 'none' || style.content === '-moz-alt-content' || style.display === 'none') {
7391
+ return;
7392
+ }
7393
 
7394
+ var anonymousReplacedElement = clone.ownerDocument.createElement('html2canvaspseudoelement');
7395
+ (0, _Util.copyCSSStyles)(style, anonymousReplacedElement);
 
7396
 
7397
+ if (contentItems) {
7398
+ var len = contentItems.length;
7399
+ for (var i = 0; i < len; i++) {
7400
+ var item = contentItems[i];
7401
+ switch (item.type) {
7402
+ case _PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE.IMAGE:
7403
+ var img = clone.ownerDocument.createElement('img');
7404
+ img.src = (0, _background.parseBackgroundImage)('url(' + item.value + ')')[0].args[0];
7405
+ img.style.opacity = '1';
7406
+ anonymousReplacedElement.appendChild(img);
7407
+ break;
7408
+ case _PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE.TEXT:
7409
+ anonymousReplacedElement.appendChild(clone.ownerDocument.createTextNode(item.value));
7410
+ break;
7411
+ }
7412
+ }
7413
+ }
7414
 
7415
+ anonymousReplacedElement.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + ' ' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
7416
+ clone.className += pseudoElt === PSEUDO_BEFORE ? ' ' + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE : ' ' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
7417
+ if (pseudoElt === PSEUDO_BEFORE) {
7418
+ clone.insertBefore(anonymousReplacedElement, clone.firstChild);
7419
+ } else {
7420
+ clone.appendChild(anonymousReplacedElement);
7421
  }
7422
 
7423
+ return anonymousReplacedElement;
 
7424
  };
7425
 
7426
+ var URL_REGEXP = /^url\((.+)\)$/i;
7427
+ var PSEUDO_BEFORE = ':before';
7428
+ var PSEUDO_AFTER = ':after';
7429
+ var PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = '___html2canvas___pseudoelement_before';
7430
+ var PSEUDO_HIDE_ELEMENT_CLASS_AFTER = '___html2canvas___pseudoelement_after';
 
7431
 
7432
+ var PSEUDO_HIDE_ELEMENT_STYLE = '{\n content: "" !important;\n display: none !important;\n}';
 
 
 
 
 
 
 
7433
 
7434
+ var createPseudoHideStyles = function createPseudoHideStyles(body) {
7435
+ 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);
7436
+ };
7437
 
7438
+ var createStyles = function createStyles(body, styles) {
7439
+ var style = body.ownerDocument.createElement('style');
7440
+ style.innerHTML = styles;
7441
+ body.appendChild(style);
7442
+ };
7443
 
7444
+ var initNode = function initNode(_ref) {
7445
+ var _ref2 = _slicedToArray(_ref, 3),
7446
+ element = _ref2[0],
7447
+ x = _ref2[1],
7448
+ y = _ref2[2];
7449
 
7450
+ element.scrollLeft = x;
7451
+ element.scrollTop = y;
 
 
 
 
 
 
 
7452
  };
7453
 
7454
+ var generateIframeKey = function generateIframeKey() {
7455
+ return Math.ceil(Date.now() + Math.random() * 10000000).toString(16);
7456
+ };
7457
 
7458
+ var DATA_URI_REGEXP = /^data:text\/(.+);(base64)?,(.*)$/i;
7459
+
7460
+ var getIframeDocumentElement = function getIframeDocumentElement(node, options) {
7461
+ try {
7462
+ return Promise.resolve(node.contentWindow.document.documentElement);
7463
+ } catch (e) {
7464
+ return options.proxy ? (0, _Proxy.Proxy)(node.src, options).then(function (html) {
7465
+ var match = html.match(DATA_URI_REGEXP);
7466
+ if (!match) {
7467
+ return Promise.reject();
7468
+ }
7469
 
7470
+ return match[2] === 'base64' ? window.atob(decodeURIComponent(match[3])) : decodeURIComponent(match[3]);
7471
+ }).then(function (html) {
7472
+ return createIframeContainer(node.ownerDocument, (0, _Bounds.parseBounds)(node, 0, 0)).then(function (cloneIframeContainer) {
7473
+ var cloneWindow = cloneIframeContainer.contentWindow;
7474
+ var documentClone = cloneWindow.document;
7475
 
7476
+ documentClone.open();
7477
+ documentClone.write(html);
7478
+ var iframeLoad = iframeLoader(cloneIframeContainer).then(function () {
7479
+ return documentClone.documentElement;
7480
+ });
7481
+
7482
+ documentClone.close();
7483
+ return iframeLoad;
7484
+ });
7485
+ }) : Promise.reject();
7486
+ }
7487
  };
7488
 
7489
+ var createIframeContainer = function createIframeContainer(ownerDocument, bounds) {
7490
+ var cloneIframeContainer = ownerDocument.createElement('iframe');
7491
+
7492
+ cloneIframeContainer.className = 'html2canvas-container';
7493
+ cloneIframeContainer.style.visibility = 'hidden';
7494
+ cloneIframeContainer.style.position = 'fixed';
7495
+ cloneIframeContainer.style.left = '-10000px';
7496
+ cloneIframeContainer.style.top = '0px';
7497
+ cloneIframeContainer.style.border = '0';
7498
+ cloneIframeContainer.width = bounds.width.toString();
7499
+ cloneIframeContainer.height = bounds.height.toString();
7500
+ cloneIframeContainer.scrolling = 'no'; // ios won't scroll without it
7501
+ cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, 'true');
7502
+ if (!ownerDocument.body) {
7503
+ return Promise.reject( true ? 'Body element not found in Document that is getting rendered' : '');
7504
  }
7505
+
7506
+ ownerDocument.body.appendChild(cloneIframeContainer);
7507
+
7508
+ return Promise.resolve(cloneIframeContainer);
7509
  };
7510
 
7511
+ var iframeLoader = function iframeLoader(cloneIframeContainer) {
7512
+ var cloneWindow = cloneIframeContainer.contentWindow;
7513
+ var documentClone = cloneWindow.document;
7514
 
7515
+ return new Promise(function (resolve, reject) {
7516
+ cloneWindow.onload = cloneIframeContainer.onload = documentClone.onreadystatechange = function () {
7517
+ var interval = setInterval(function () {
7518
+ if (documentClone.body.childNodes.length > 0 && documentClone.readyState === 'complete') {
7519
+ clearInterval(interval);
7520
+ resolve(cloneIframeContainer);
7521
+ }
7522
+ }, 50);
7523
+ };
7524
+ });
7525
+ };
7526
 
7527
+ var cloneWindow = exports.cloneWindow = function cloneWindow(ownerDocument, bounds, referenceElement, options, logger, renderer) {
7528
+ var cloner = new DocumentCloner(referenceElement, options, logger, false, renderer);
7529
+ var scrollX = ownerDocument.defaultView.pageXOffset;
7530
+ var scrollY = ownerDocument.defaultView.pageYOffset;
7531
 
7532
+ return createIframeContainer(ownerDocument, bounds).then(function (cloneIframeContainer) {
7533
+ var cloneWindow = cloneIframeContainer.contentWindow;
7534
+ var documentClone = cloneWindow.document;
 
7535
 
7536
+ /* Chrome doesn't detect relative background-images assigned in inline <style> sheets when fetched through getComputedStyle
7537
+ if window url is about:blank, we can assign the url to current by writing onto the document
7538
+ */
7539
 
7540
+ var iframeLoad = iframeLoader(cloneIframeContainer).then(function () {
7541
+ cloner.scrolledElements.forEach(initNode);
7542
+ cloneWindow.scrollTo(bounds.left, bounds.top);
7543
+ if (/(iPad|iPhone|iPod)/g.test(navigator.userAgent) && (cloneWindow.scrollY !== bounds.top || cloneWindow.scrollX !== bounds.left)) {
7544
+ documentClone.documentElement.style.top = -bounds.top + 'px';
7545
+ documentClone.documentElement.style.left = -bounds.left + 'px';
7546
+ documentClone.documentElement.style.position = 'absolute';
7547
+ }
7548
 
7549
+ var result = Promise.resolve([cloneIframeContainer, cloner.clonedReferenceElement, cloner.resourceLoader]);
7550
 
7551
+ var onclone = options.onclone;
7552
 
7553
+ return cloner.clonedReferenceElement instanceof cloneWindow.HTMLElement || cloner.clonedReferenceElement instanceof ownerDocument.defaultView.HTMLElement || cloner.clonedReferenceElement instanceof HTMLElement ? typeof onclone === 'function' ? Promise.resolve().then(function () {
7554
+ return onclone(documentClone);
7555
+ }).then(function () {
7556
+ return result;
7557
+ }) : result : Promise.reject( true ? 'Error finding the ' + referenceElement.nodeName + ' in the cloned document' : '');
7558
+ });
7559
+
7560
+ documentClone.open();
7561
+ documentClone.write(serializeDoctype(document.doctype) + '<html></html>');
7562
+ // Chrome scrolls the parent document for some reason after the write to the cloned window???
7563
+ restoreOwnerScroll(referenceElement.ownerDocument, scrollX, scrollY);
7564
+ documentClone.replaceChild(documentClone.adoptNode(cloner.documentElement), documentClone.documentElement);
7565
+ documentClone.close();
7566
+
7567
+ return iframeLoad;
7568
  });
7569
  };
7570
 
7571
+ var serializeDoctype = function serializeDoctype(doctype) {
7572
+ var str = '';
7573
+ if (doctype) {
7574
+ str += '<!DOCTYPE ';
7575
+ if (doctype.name) {
7576
+ str += doctype.name;
7577
+ }
7578
 
7579
+ if (doctype.internalSubset) {
7580
+ str += doctype.internalSubset;
7581
+ }
7582
 
7583
+ if (doctype.publicId) {
7584
+ str += '"' + doctype.publicId + '"';
7585
+ }
7586
 
7587
+ if (doctype.systemId) {
7588
+ str += '"' + doctype.systemId + '"';
7589
+ }
 
 
 
 
 
 
7590
 
7591
+ str += '>';
 
 
 
 
 
 
 
 
 
 
7592
  }
7593
+
7594
+ return str;
7595
  };
7596
 
7597
  /***/ }),
7598
+ /* 55 */
7599
  /***/ (function(module, exports, __webpack_require__) {
7600
 
7601
  "use strict";
7604
  Object.defineProperty(exports, "__esModule", {
7605
  value: true
7606
  });
7607
+ exports.ResourceStore = undefined;
7608
 
7609
+ 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; }; }();
7610
 
7611
+ var _Feature = __webpack_require__(10);
7612
+
7613
+ var _Feature2 = _interopRequireDefault(_Feature);
7614
+
7615
+ var _Proxy = __webpack_require__(26);
7616
 
7617
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7618
 
7619
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7620
 
7621
+ var ResourceLoader = function () {
7622
+ function ResourceLoader(options, logger, window) {
7623
+ _classCallCheck(this, ResourceLoader);
7624
+
7625
+ this.options = options;
7626
+ this._window = window;
7627
+ this.origin = this.getOrigin(window.location.href);
7628
+ this.cache = {};
7629
+ this.logger = logger;
7630
+ this._index = 0;
7631
  }
7632
 
7633
+ _createClass(ResourceLoader, [{
7634
+ key: 'loadImage',
7635
+ value: function loadImage(src) {
7636
+ var _this = this;
 
 
7637
 
7638
+ if (this.hasResourceInCache(src)) {
7639
+ return src;
7640
+ }
7641
+ if (isBlobImage(src)) {
7642
+ this.cache[src] = _loadImage(src, this.options.imageTimeout || 0);
7643
+ return src;
7644
  }
 
 
 
 
7645
 
7646
+ if (!isSVG(src) || _Feature2.default.SUPPORT_SVG_DRAWING) {
7647
+ if (this.options.allowTaint === true || isInlineImage(src) || this.isSameOrigin(src)) {
7648
+ return this.addImage(src, src, false);
7649
+ } else if (!this.isSameOrigin(src)) {
7650
+ if (typeof this.options.proxy === 'string') {
7651
+ this.cache[src] = (0, _Proxy.Proxy)(src, this.options).then(function (src) {
7652
+ return _loadImage(src, _this.options.imageTimeout || 0);
7653
+ });
7654
+ return src;
7655
+ } else if (this.options.useCORS === true && _Feature2.default.SUPPORT_CORS_IMAGES) {
7656
+ return this.addImage(src, src, true);
7657
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7658
  }
7659
+ }
7660
  }
7661
+ }, {
7662
+ key: 'inlineImage',
7663
+ value: function inlineImage(src) {
7664
+ var _this2 = this;
7665
 
7666
+ if (isInlineImage(src)) {
7667
+ return _loadImage(src, this.options.imageTimeout || 0);
7668
+ }
7669
+ if (this.hasResourceInCache(src)) {
7670
+ return this.cache[src];
7671
+ }
7672
+ if (!this.isSameOrigin(src) && typeof this.options.proxy === 'string') {
7673
+ return this.cache[src] = (0, _Proxy.Proxy)(src, this.options).then(function (src) {
7674
+ return _loadImage(src, _this2.options.imageTimeout || 0);
7675
+ });
7676
+ }
7677
 
7678
+ return this.xhrImage(src);
7679
+ }
7680
+ }, {
7681
+ key: 'xhrImage',
7682
+ value: function xhrImage(src) {
7683
+ var _this3 = this;
7684
 
7685
+ this.cache[src] = new Promise(function (resolve, reject) {
7686
+ var xhr = new XMLHttpRequest();
7687
+ xhr.onreadystatechange = function () {
7688
+ if (xhr.readyState === 4) {
7689
+ if (xhr.status !== 200) {
7690
+ reject('Failed to fetch image ' + src.substring(0, 256) + ' with status code ' + xhr.status);
7691
+ } else {
7692
+ var reader = new FileReader();
7693
+ reader.addEventListener('load', function () {
7694
+ // $FlowFixMe
7695
+ var result = reader.result;
7696
+ resolve(result);
7697
+ }, false);
7698
+ reader.addEventListener('error', function (e) {
7699
+ return reject(e);
7700
+ }, false);
7701
+ reader.readAsDataURL(xhr.response);
7702
+ }
7703
+ }
7704
+ };
7705
+ xhr.responseType = 'blob';
7706
+ if (_this3.options.imageTimeout) {
7707
+ var timeout = _this3.options.imageTimeout;
7708
+ xhr.timeout = timeout;
7709
+ xhr.ontimeout = function () {
7710
+ return reject( true ? 'Timed out (' + timeout + 'ms) fetching ' + src.substring(0, 256) : '');
7711
+ };
7712
+ }
7713
+ xhr.open('GET', src, true);
7714
+ xhr.send();
7715
+ }).then(function (src) {
7716
+ return _loadImage(src, _this3.options.imageTimeout || 0);
7717
+ });
7718
 
7719
+ return this.cache[src];
7720
+ }
7721
+ }, {
7722
+ key: 'loadCanvas',
7723
+ value: function loadCanvas(node) {
7724
+ var key = String(this._index++);
7725
+ this.cache[key] = Promise.resolve(node);
7726
+ return key;
7727
+ }
7728
+ }, {
7729
+ key: 'hasResourceInCache',
7730
+ value: function hasResourceInCache(key) {
7731
+ return typeof this.cache[key] !== 'undefined';
7732
+ }
7733
+ }, {
7734
+ key: 'addImage',
7735
+ value: function addImage(key, src, useCORS) {
7736
+ var _this4 = this;
7737
 
7738
+ if (true) {
7739
+ this.logger.log('Added image ' + key.substring(0, 256));
7740
+ }
7741
 
7742
+ var imageLoadHandler = function imageLoadHandler(supportsDataImages) {
7743
+ return new Promise(function (resolve, reject) {
7744
+ var img = new Image();
7745
+ img.onload = function () {
7746
+ return resolve(img);
7747
+ };
7748
+ //ios safari 10.3 taints canvas with data urls unless crossOrigin is set to anonymous
7749
+ if (!supportsDataImages || useCORS) {
7750
+ img.crossOrigin = 'anonymous';
7751
+ }
7752
 
7753
+ img.onerror = reject;
7754
+ img.src = src;
7755
+ if (img.complete === true) {
7756
+ // Inline XML images may fail to parse, throwing an Error later on
7757
+ setTimeout(function () {
7758
+ resolve(img);
7759
+ }, 500);
7760
+ }
7761
+ if (_this4.options.imageTimeout) {
7762
+ var timeout = _this4.options.imageTimeout;
7763
+ setTimeout(function () {
7764
+ return reject( true ? 'Timed out (' + timeout + 'ms) fetching ' + src.substring(0, 256) : '');
7765
+ }, timeout);
7766
+ }
7767
+ });
7768
+ };
7769
 
7770
+ this.cache[key] = isInlineBase64Image(src) && !isSVG(src) ? // $FlowFixMe
7771
+ _Feature2.default.SUPPORT_BASE64_DRAWING(src).then(imageLoadHandler) : imageLoadHandler(true);
7772
+ return key;
7773
+ }
7774
+ }, {
7775
+ key: 'isSameOrigin',
7776
+ value: function isSameOrigin(url) {
7777
+ return this.getOrigin(url) === this.origin;
7778
+ }
7779
+ }, {
7780
+ key: 'getOrigin',
7781
+ value: function getOrigin(url) {
7782
+ var link = this._link || (this._link = this._window.document.createElement('a'));
7783
+ link.href = url;
7784
+ link.href = link.href; // IE9, LOL! - http://jsfiddle.net/niklasvh/2e48b/
7785
+ return link.protocol + link.hostname + link.port;
7786
+ }
7787
+ }, {
7788
+ key: 'ready',
7789
+ value: function ready() {
7790
+ var _this5 = this;
7791
 
7792
+ var keys = Object.keys(this.cache);
7793
+ var values = keys.map(function (str) {
7794
+ return _this5.cache[str].catch(function (e) {
7795
+ if (true) {
7796
+ _this5.logger.log('Unable to load image', e);
7797
+ }
7798
+ return null;
7799
+ });
7800
+ });
7801
+ return Promise.all(values).then(function (images) {
7802
+ if (true) {
7803
+ _this5.logger.log('Finished loading ' + images.length + ' images', images);
7804
+ }
7805
+ return new ResourceStore(keys, images);
7806
+ });
7807
+ }
7808
+ }]);
7809
 
7810
+ return ResourceLoader;
7811
+ }();
7812
 
7813
+ exports.default = ResourceLoader;
 
 
7814
 
7815
+ var ResourceStore = exports.ResourceStore = function () {
7816
+ function ResourceStore(keys, resources) {
7817
+ _classCallCheck(this, ResourceStore);
7818
 
7819
+ this._keys = keys;
7820
+ this._resources = resources;
 
 
 
 
 
 
7821
  }
7822
 
7823
+ _createClass(ResourceStore, [{
7824
+ key: 'get',
7825
+ value: function get(key) {
7826
+ var index = this._keys.indexOf(key);
7827
+ return index === -1 ? null : this._resources[index];
7828
+ }
7829
+ }]);
 
 
7830
 
7831
+ return ResourceStore;
7832
+ }();
 
 
 
 
 
 
 
7833
 
7834
+ var INLINE_SVG = /^data:image\/svg\+xml/i;
7835
+ var INLINE_BASE64 = /^data:image\/.*;base64,/i;
7836
+ var INLINE_IMG = /^data:image\/.*/i;
 
 
7837
 
7838
+ var isInlineImage = function isInlineImage(src) {
7839
+ return INLINE_IMG.test(src);
7840
+ };
7841
+ var isInlineBase64Image = function isInlineBase64Image(src) {
7842
+ return INLINE_BASE64.test(src);
7843
+ };
7844
+ var isBlobImage = function isBlobImage(src) {
7845
+ return src.substr(0, 4) === 'blob';
7846
+ };
7847
+
7848
+ var isSVG = function isSVG(src) {
7849
+ return src.substr(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src);
7850
+ };
7851
+
7852
+ var _loadImage = function _loadImage(src, timeout) {
7853
+ return new Promise(function (resolve, reject) {
7854
+ var img = new Image();
7855
+ img.onload = function () {
7856
+ return resolve(img);
7857
+ };
7858
+ img.onerror = reject;
7859
+ img.src = src;
7860
+ if (img.complete === true) {
7861
+ // Inline XML images may fail to parse, throwing an Error later on
7862
+ setTimeout(function () {
7863
+ resolve(img);
7864
+ }, 500);
7865
  }
7866
+ if (timeout) {
7867
+ setTimeout(function () {
7868
+ return reject( true ? 'Timed out (' + timeout + 'ms) loading image' : '');
7869
+ }, timeout);
7870
+ }
7871
+ });
7872
  };
7873
 
7874
  /***/ }),
7875
+ /* 56 */
7876
  /***/ (function(module, exports, __webpack_require__) {
7877
 
7878
  "use strict";
7881
  Object.defineProperty(exports, "__esModule", {
7882
  value: true
7883
  });
7884
+ exports.parseContent = exports.resolvePseudoContent = exports.popCounters = exports.parseCounterReset = exports.TOKEN_TYPE = exports.PSEUDO_CONTENT_ITEM_TYPE = undefined;
 
 
 
 
7885
 
7886
+ 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"); } }; }();
 
 
 
 
 
 
 
 
 
 
7887
 
7888
+ var _ListItem = __webpack_require__(14);
 
 
7889
 
7890
+ var _listStyle = __webpack_require__(8);
7891
 
7892
+ var PSEUDO_CONTENT_ITEM_TYPE = exports.PSEUDO_CONTENT_ITEM_TYPE = {
7893
+ TEXT: 0,
7894
+ IMAGE: 1
7895
+ };
7896
 
7897
+ var TOKEN_TYPE = exports.TOKEN_TYPE = {
7898
+ STRING: 0,
7899
+ ATTRIBUTE: 1,
7900
+ URL: 2,
7901
+ COUNTER: 3,
7902
+ COUNTERS: 4,
7903
+ OPENQUOTE: 5,
7904
+ CLOSEQUOTE: 6
7905
  };
7906
 
7907
+ var parseCounterReset = exports.parseCounterReset = function parseCounterReset(style, data) {
7908
+ if (!style || !style.counterReset || style.counterReset === 'none') {
7909
+ return [];
 
 
 
 
 
 
7910
  }
 
7911
 
7912
+ var counterNames = [];
7913
+ var counterResets = style.counterReset.split(/\s*,\s*/);
7914
+ var lenCounterResets = counterResets.length;
7915
 
7916
+ for (var i = 0; i < lenCounterResets; i++) {
7917
+ var _counterResets$i$spli = counterResets[i].split(/\s+/),
7918
+ _counterResets$i$spli2 = _slicedToArray(_counterResets$i$spli, 2),
7919
+ counterName = _counterResets$i$spli2[0],
7920
+ initialValue = _counterResets$i$spli2[1];
7921
 
7922
+ counterNames.push(counterName);
7923
+ var counter = data.counters[counterName];
7924
+ if (!counter) {
7925
+ counter = data.counters[counterName] = [];
7926
+ }
7927
+ counter.push(parseInt(initialValue || 0, 10));
7928
+ }
7929
 
7930
+ return counterNames;
 
 
 
 
 
 
 
 
7931
  };
7932
 
7933
+ var popCounters = exports.popCounters = function popCounters(counterNames, data) {
7934
+ var lenCounters = counterNames.length;
7935
+ for (var i = 0; i < lenCounters; i++) {
7936
+ data.counters[counterNames[i]].pop();
7937
+ }
7938
+ };
7939
 
7940
+ var resolvePseudoContent = exports.resolvePseudoContent = function resolvePseudoContent(node, style, data) {
7941
+ if (!style || !style.content || style.content === 'none' || style.content === '-moz-alt-content' || style.display === 'none') {
7942
+ return null;
7943
+ }
7944
 
7945
+ var tokens = parseContent(style.content);
7946
 
7947
+ var len = tokens.length;
7948
+ var contentItems = [];
7949
+ var s = '';
 
 
 
 
 
 
 
 
 
7950
 
7951
+ // increment the counter (if there is a "counter-increment" declaration)
7952
+ var counterIncrement = style.counterIncrement;
7953
+ if (counterIncrement && counterIncrement !== 'none') {
7954
+ var _counterIncrement$spl = counterIncrement.split(/\s+/),
7955
+ _counterIncrement$spl2 = _slicedToArray(_counterIncrement$spl, 2),
7956
+ counterName = _counterIncrement$spl2[0],
7957
+ incrementValue = _counterIncrement$spl2[1];
7958
 
7959
+ var counter = data.counters[counterName];
7960
+ if (counter) {
7961
+ counter[counter.length - 1] += incrementValue === undefined ? 1 : parseInt(incrementValue, 10);
7962
+ }
7963
+ }
 
7964
 
7965
+ // build the content string
7966
+ for (var i = 0; i < len; i++) {
7967
+ var token = tokens[i];
7968
+ switch (token.type) {
7969
+ case TOKEN_TYPE.STRING:
7970
+ s += token.value || '';
7971
+ break;
7972
 
7973
+ case TOKEN_TYPE.ATTRIBUTE:
7974
+ if (node instanceof HTMLElement && token.value) {
7975
+ s += node.getAttribute(token.value) || '';
7976
+ }
7977
+ break;
7978
 
7979
+ case TOKEN_TYPE.COUNTER:
7980
+ var _counter = data.counters[token.name || ''];
7981
+ if (_counter) {
7982
+ s += formatCounterValue([_counter[_counter.length - 1]], '', token.format);
7983
+ }
7984
+ break;
7985
 
7986
+ case TOKEN_TYPE.COUNTERS:
7987
+ var _counters = data.counters[token.name || ''];
7988
+ if (_counters) {
7989
+ s += formatCounterValue(_counters, token.glue, token.format);
7990
+ }
7991
+ break;
7992
 
7993
+ case TOKEN_TYPE.OPENQUOTE:
7994
+ s += getQuote(style, true, data.quoteDepth);
7995
+ data.quoteDepth++;
7996
+ break;
7997
 
7998
+ case TOKEN_TYPE.CLOSEQUOTE:
7999
+ data.quoteDepth--;
8000
+ s += getQuote(style, false, data.quoteDepth);
8001
+ break;
8002
 
8003
+ case TOKEN_TYPE.URL:
8004
+ if (s) {
8005
+ contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.TEXT, value: s });
8006
+ s = '';
8007
+ }
8008
+ contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.IMAGE, value: token.value || '' });
8009
+ break;
8010
+ }
8011
+ }
8012
 
8013
+ if (s) {
8014
+ contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.TEXT, value: s });
8015
+ }
8016
 
8017
+ return contentItems;
8018
+ };
8019
 
8020
+ var parseContent = exports.parseContent = function parseContent(content, cache) {
8021
+ if (cache && cache[content]) {
8022
+ return cache[content];
8023
+ }
8024
 
8025
+ var tokens = [];
8026
+ var len = content.length;
8027
 
8028
+ var isString = false;
8029
+ var isEscaped = false;
8030
+ var isFunction = false;
8031
+ var str = '';
8032
+ var functionName = '';
8033
+ var args = [];
8034
 
8035
+ for (var i = 0; i < len; i++) {
8036
+ var c = content.charAt(i);
8037
 
8038
+ switch (c) {
8039
+ case "'":
8040
+ case '"':
8041
+ if (isEscaped) {
8042
+ str += c;
8043
+ } else {
8044
+ isString = !isString;
8045
+ if (!isFunction && !isString) {
8046
+ tokens.push({ type: TOKEN_TYPE.STRING, value: str });
8047
+ str = '';
8048
+ }
8049
+ }
8050
+ break;
8051
 
8052
+ case '\\':
8053
+ if (isEscaped) {
8054
+ str += c;
8055
+ isEscaped = false;
8056
+ } else {
8057
+ isEscaped = true;
8058
+ }
8059
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8060
 
8061
+ case '(':
8062
+ if (isString) {
8063
+ str += c;
8064
+ } else {
8065
+ isFunction = true;
8066
+ functionName = str;
8067
+ str = '';
8068
+ args = [];
8069
+ }
8070
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8071
 
8072
+ case ')':
8073
+ if (isString) {
8074
+ str += c;
8075
+ } else if (isFunction) {
8076
+ if (str) {
8077
+ args.push(str);
8078
+ }
8079
 
8080
+ switch (functionName) {
8081
+ case 'attr':
8082
+ if (args.length > 0) {
8083
+ tokens.push({ type: TOKEN_TYPE.ATTRIBUTE, value: args[0] });
8084
+ }
8085
+ break;
 
8086
 
8087
+ case 'counter':
8088
+ if (args.length > 0) {
8089
+ var counter = {
8090
+ type: TOKEN_TYPE.COUNTER,
8091
+ name: args[0]
8092
+ };
8093
+ if (args.length > 1) {
8094
+ counter.format = args[1];
8095
+ }
8096
+ tokens.push(counter);
8097
+ }
8098
+ break;
8099
 
8100
+ case 'counters':
8101
+ if (args.length > 0) {
8102
+ var _counters2 = {
8103
+ type: TOKEN_TYPE.COUNTERS,
8104
+ name: args[0]
8105
+ };
8106
+ if (args.length > 1) {
8107
+ _counters2.glue = args[1];
8108
+ }
8109
+ if (args.length > 2) {
8110
+ _counters2.format = args[2];
8111
+ }
8112
+ tokens.push(_counters2);
8113
+ }
8114
+ break;
8115
 
8116
+ case 'url':
8117
+ if (args.length > 0) {
8118
+ tokens.push({ type: TOKEN_TYPE.URL, value: args[0] });
8119
+ }
8120
+ break;
8121
+ }
 
8122
 
8123
+ isFunction = false;
8124
+ str = '';
8125
+ }
8126
+ break;
 
 
8127
 
8128
+ case ',':
8129
+ if (isString) {
8130
+ str += c;
8131
+ } else if (isFunction) {
8132
+ args.push(str);
8133
+ str = '';
8134
+ }
8135
+ break;
 
 
8136
 
8137
+ case ' ':
8138
+ case '\t':
8139
+ if (isString) {
8140
+ str += c;
8141
+ } else if (str) {
8142
+ addOtherToken(tokens, str);
8143
+ str = '';
8144
+ }
8145
+ break;
8146
 
8147
+ default:
8148
+ str += c;
8149
  }
8150
 
8151
+ if (c !== '\\') {
8152
+ isEscaped = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8153
  }
8154
  }
8155
 
8156
+ if (str) {
8157
+ addOtherToken(tokens, str);
8158
+ }
 
 
 
 
 
 
 
 
 
8159
 
8160
+ if (cache) {
8161
+ cache[content] = tokens;
8162
+ }
8163
 
8164
+ return tokens;
8165
+ };
 
 
 
8166
 
8167
+ var addOtherToken = function addOtherToken(tokens, identifier) {
8168
+ switch (identifier) {
8169
+ case 'open-quote':
8170
+ tokens.push({ type: TOKEN_TYPE.OPENQUOTE });
8171
+ break;
8172
+ case 'close-quote':
8173
+ tokens.push({ type: TOKEN_TYPE.CLOSEQUOTE });
8174
+ break;
8175
  }
 
8176
  };
8177
 
8178
+ var getQuote = function getQuote(style, isOpening, quoteDepth) {
8179
+ var quotes = style.quotes ? style.quotes.split(/\s+/) : ["'\"'", "'\"'"];
8180
+ var idx = quoteDepth * 2;
8181
+ if (idx >= quotes.length) {
8182
+ idx = quotes.length - 2;
 
 
 
 
8183
  }
8184
+ if (!isOpening) {
8185
+ ++idx;
8186
+ }
8187
+ return quotes[idx].replace(/^["']|["']$/g, '');
8188
  };
8189
 
8190
+ var formatCounterValue = function formatCounterValue(counter, glue, format) {
8191
+ var len = counter.length;
8192
+ var result = '';
 
8193
 
8194
+ for (var i = 0; i < len; i++) {
8195
+ if (i > 0) {
8196
+ result += glue || '';
8197
+ }
8198
+ result += (0, _ListItem.createCounterText)(counter[i], (0, _listStyle.parseListStyleType)(format || 'decimal'), false);
8199
  }
8200
 
8201
+ return result;
8202
+ };
 
8203
 
8204
+ /***/ })
8205
+ /******/ ]);
8206
+ });
 
8207
 
8208
+ /***/ }),
 
 
8209
 
8210
+ /***/ 478:
8211
+ /***/ (function(module, exports, __webpack_require__) {
 
8212
 
8213
+ /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Backbone.js 1.3.3
 
 
 
8214
 
8215
+ // (c) 2010-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
8216
+ // Backbone may be freely distributed under the MIT license.
8217
+ // For all details and documentation:
8218
+ // http://backbonejs.org
8219
 
8220
+ (function(factory) {
 
 
 
8221
 
8222
+ // Establish the root object, `window` (`self`) in the browser, or `global` on the server.
8223
+ // We use `self` instead of `window` for `WebWorker` support.
8224
+ var root = (typeof self == 'object' && self.self === self && self) ||
8225
+ (typeof global == 'object' && global.global === global && global);
8226
 
8227
+ // Set up Backbone appropriately for the environment. Start with AMD.
8228
+ if (true) {
8229
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(7), __webpack_require__(9), exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function(_, $, exports) {
8230
+ // Export global even in AMD case in case this script is loaded with
8231
+ // others that may still expect a global Backbone.
8232
+ root.Backbone = factory(root, exports, _, $);
8233
+ }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
8234
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
8235
 
8236
+ // Next for Node.js or CommonJS. jQuery may not be needed as a module.
8237
+ } else if (typeof exports !== 'undefined') {
8238
+ var _ = require('underscore'), $;
8239
+ try { $ = require('jquery'); } catch (e) {}
8240
+ factory(root, exports, _, $);
8241
 
8242
+ // Finally, as a browser global.
8243
+ } else {
8244
+ root.Backbone = factory(root, {}, root._, (root.jQuery || root.Zepto || root.ender || root.$));
8245
+ }
8246
 
8247
+ })(function(root, Backbone, _, $) {
 
 
 
8248
 
8249
+ // Initial Setup
8250
+ // -------------
 
 
8251
 
8252
+ // Save the previous value of the `Backbone` variable, so that it can be
8253
+ // restored later on, if `noConflict` is used.
8254
+ var previousBackbone = root.Backbone;
 
8255
 
8256
+ // Create a local reference to a common array method we'll want to use later.
8257
+ var slice = Array.prototype.slice;
 
 
8258
 
8259
+ // Current version of the library. Keep in sync with `package.json`.
8260
+ Backbone.VERSION = '1.3.3';
 
 
8261
 
8262
+ // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
8263
+ // the `$` variable.
8264
+ Backbone.$ = $;
 
8265
 
8266
+ // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
8267
+ // to its previous owner. Returns a reference to this Backbone object.
8268
+ Backbone.noConflict = function() {
8269
+ root.Backbone = previousBackbone;
8270
+ return this;
8271
+ };
8272
 
8273
+ // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
8274
+ // will fake `"PATCH"`, `"PUT"` and `"DELETE"` requests via the `_method` parameter and
8275
+ // set a `X-Http-Method-Override` header.
8276
+ Backbone.emulateHTTP = false;
8277
 
8278
+ // Turn on `emulateJSON` to support legacy servers that can't deal with direct
8279
+ // `application/json` requests ... this will encode the body as
8280
+ // `application/x-www-form-urlencoded` instead and will send the model in a
8281
+ // form param named `model`.
8282
+ Backbone.emulateJSON = false;
8283
 
8284
+ // Proxy Backbone class methods to Underscore functions, wrapping the model's
8285
+ // `attributes` object or collection's `models` array behind the scenes.
8286
+ //
8287
+ // collection.filter(function(model) { return model.get('age') > 10 });
8288
+ // collection.each(this.addView);
8289
+ //
8290
+ // `Function#apply` can be slow so we use the method's arg count, if we know it.
8291
+ var addMethod = function(length, method, attribute) {
8292
+ switch (length) {
8293
+ case 1: return function() {
8294
+ return _[method](this[attribute]);
8295
+ };
8296
+ case 2: return function(value) {
8297
+ return _[method](this[attribute], value);
8298
+ };
8299
+ case 3: return function(iteratee, context) {
8300
+ return _[method](this[attribute], cb(iteratee, this), context);
8301
+ };
8302
+ case 4: return function(iteratee, defaultVal, context) {
8303
+ return _[method](this[attribute], cb(iteratee, this), defaultVal, context);
8304
+ };
8305
+ default: return function() {
8306
+ var args = slice.call(arguments);
8307
+ args.unshift(this[attribute]);
8308
+ return _[method].apply(_, args);
8309
+ };
8310
  }
8311
+ };
8312
+ var addUnderscoreMethods = function(Class, methods, attribute) {
8313
+ _.each(methods, function(length, method) {
8314
+ if (_[method]) Class.prototype[method] = addMethod(length, method, attribute);
8315
+ });
8316
+ };
8317
 
8318
+ // Support `collection.sortBy('attr')` and `collection.findWhere({id: 1})`.
8319
+ var cb = function(iteratee, instance) {
8320
+ if (_.isFunction(iteratee)) return iteratee;
8321
+ if (_.isObject(iteratee) && !instance._isModel(iteratee)) return modelMatcher(iteratee);
8322
+ if (_.isString(iteratee)) return function(model) { return model.get(iteratee); };
8323
+ return iteratee;
8324
+ };
8325
+ var modelMatcher = function(attrs) {
8326
+ var matcher = _.matches(attrs);
8327
+ return function(model) {
8328
+ return matcher(model.attributes);
8329
+ };
8330
+ };
8331
 
8332
+ // Backbone.Events
8333
+ // ---------------
 
 
8334
 
8335
+ // A module that can be mixed in to *any object* in order to provide it with
8336
+ // a custom event channel. You may bind a callback to an event with `on` or
8337
+ // remove with `off`; `trigger`-ing an event fires all callbacks in
8338
+ // succession.
8339
+ //
8340
+ // var object = {};
8341
+ // _.extend(object, Backbone.Events);
8342
+ // object.on('expand', function(){ alert('expanded'); });
8343
+ // object.trigger('expand');
8344
+ //
8345
+ var Events = Backbone.Events = {};
8346
 
8347
+ // Regular expression used to split event strings.
8348
+ var eventSplitter = /\s+/;
 
 
8349
 
8350
+ // Iterates over the standard `event, callback` (as well as the fancy multiple
8351
+ // space-separated events `"change blur", callback` and jQuery-style event
8352
+ // maps `{event: callback}`).
8353
+ var eventsApi = function(iteratee, events, name, callback, opts) {
8354
+ var i = 0, names;
8355
+ if (name && typeof name === 'object') {
8356
+ // Handle event maps.
8357
+ if (callback !== void 0 && 'context' in opts && opts.context === void 0) opts.context = callback;
8358
+ for (names = _.keys(name); i < names.length ; i++) {
8359
+ events = eventsApi(iteratee, events, names[i], name[names[i]], opts);
8360
+ }
8361
+ } else if (name && eventSplitter.test(name)) {
8362
+ // Handle space-separated event names by delegating them individually.
8363
+ for (names = name.split(eventSplitter); i < names.length; i++) {
8364
+ events = iteratee(events, names[i], callback, opts);
8365
+ }
8366
+ } else {
8367
+ // Finally, standard events.
8368
+ events = iteratee(events, name, callback, opts);
8369
  }
8370
+ return events;
8371
+ };
8372
 
8373
+ // Bind an event to a `callback` function. Passing `"all"` will bind
8374
+ // the callback to all events fired.
8375
+ Events.on = function(name, callback, context) {
8376
+ return internalOn(this, name, callback, context);
8377
+ };
 
 
 
 
 
8378
 
8379
+ // Guard the `listening` argument from the public API.
8380
+ var internalOn = function(obj, name, callback, context, listening) {
8381
+ obj._events = eventsApi(onApi, obj._events || {}, name, callback, {
8382
+ context: context,
8383
+ ctx: obj,
8384
+ listening: listening
8385
+ });
 
 
 
 
 
 
 
8386
 
8387
+ if (listening) {
8388
+ var listeners = obj._listeners || (obj._listeners = {});
8389
+ listeners[listening.id] = listening;
 
 
 
 
 
 
 
 
 
 
8390
  }
8391
 
8392
+ return obj;
8393
+ };
 
 
8394
 
8395
+ // Inversion-of-control versions of `on`. Tell *this* object to listen to
8396
+ // an event in another object... keeping track of what it's listening to
8397
+ // for easier unbinding later.
8398
+ Events.listenTo = function(obj, name, callback) {
8399
+ if (!obj) return this;
8400
+ var id = obj._listenId || (obj._listenId = _.uniqueId('l'));
8401
+ var listeningTo = this._listeningTo || (this._listeningTo = {});
8402
+ var listening = listeningTo[id];
8403
 
8404
+ // This object is not listening to any other events on `obj` yet.
8405
+ // Setup the necessary references to track the listening callbacks.
8406
+ if (!listening) {
8407
+ var thisId = this._listenId || (this._listenId = _.uniqueId('l'));
8408
+ listening = listeningTo[id] = {obj: obj, objId: id, id: thisId, listeningTo: listeningTo, count: 0};
8409
  }
8410
 
8411
+ // Bind callbacks on obj, and keep track of them on listening.
8412
+ internalOn(obj, name, callback, this, listening);
8413
+ return this;
8414
+ };
8415
 
8416
+ // The reducing API that adds a callback to the `events` object.
8417
+ var onApi = function(events, name, callback, options) {
8418
+ if (callback) {
8419
+ var handlers = events[name] || (events[name] = []);
8420
+ var context = options.context, ctx = options.ctx, listening = options.listening;
8421
+ if (listening) listening.count++;
8422
 
8423
+ handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8424
  }
8425
+ return events;
8426
+ };
8427
 
8428
+ // Remove one or many callbacks. If `context` is null, removes all
8429
+ // callbacks with that function. If `callback` is null, removes all
8430
+ // callbacks for the event. If `name` is null, removes all bound
8431
+ // callbacks for all events.
8432
+ Events.off = function(name, callback, context) {
8433
+ if (!this._events) return this;
8434
+ this._events = eventsApi(offApi, this._events, name, callback, {
8435
+ context: context,
8436
+ listeners: this._listeners
8437
+ });
8438
+ return this;
8439
+ };
8440
 
8441
+ // Tell this object to stop listening to either specific events ... or
8442
+ // to every object it's currently listening to.
8443
+ Events.stopListening = function(obj, name, callback) {
8444
+ var listeningTo = this._listeningTo;
8445
+ if (!listeningTo) return this;
8446
 
8447
+ var ids = obj ? [obj._listenId] : _.keys(listeningTo);
 
 
 
 
8448
 
8449
+ for (var i = 0; i < ids.length; i++) {
8450
+ var listening = listeningTo[ids[i]];
8451
+
8452
+ // If listening doesn't exist, this object is not currently
8453
+ // listening to obj. Break out early.
8454
+ if (!listening) break;
8455
+
8456
+ listening.obj.off(name, callback, this);
8457
  }
8458
 
8459
+ return this;
8460
+ };
 
 
 
 
 
8461
 
8462
+ // The reducing API that removes a callback from the `events` object.
8463
+ var offApi = function(events, name, callback, options) {
8464
+ if (!events) return;
 
8465
 
8466
+ var i = 0, listening;
8467
+ var context = options.context, listeners = options.listeners;
 
 
 
8468
 
8469
+ // Delete all events listeners and "drop" events.
8470
+ if (!name && !callback && !context) {
8471
+ var ids = _.keys(listeners);
8472
+ for (; i < ids.length; i++) {
8473
+ listening = listeners[ids[i]];
8474
+ delete listeners[listening.id];
8475
+ delete listening.listeningTo[listening.objId];
8476
+ }
8477
+ return;
8478
  }
8479
 
8480
+ var names = name ? [name] : _.keys(events);
8481
+ for (; i < names.length; i++) {
8482
+ name = names[i];
8483
+ var handlers = events[name];
 
 
8484
 
8485
+ // Bail out if there are no events stored.
8486
+ if (!handlers) break;
 
8487
 
8488
+ // Replace events if there are any remaining. Otherwise, clean up.
8489
+ var remaining = [];
8490
+ for (var j = 0; j < handlers.length; j++) {
8491
+ var handler = handlers[j];
8492
+ if (
8493
+ callback && callback !== handler.callback &&
8494
+ callback !== handler.callback._callback ||
8495
+ context && context !== handler.context
8496
+ ) {
8497
+ remaining.push(handler);
8498
+ } else {
8499
+ listening = handler.listening;
8500
+ if (listening && --listening.count === 0) {
8501
+ delete listeners[listening.id];
8502
+ delete listening.listeningTo[listening.objId];
8503
+ }
8504
+ }
8505
+ }
8506
 
8507
+ // Update tail event if the list has any events. Otherwise, clean up.
8508
+ if (remaining.length) {
8509
+ events[name] = remaining;
8510
+ } else {
8511
+ delete events[name];
8512
+ }
8513
+ }
8514
+ return events;
8515
+ };
8516
 
8517
+ // Bind an event to only be triggered a single time. After the first time
8518
+ // the callback is invoked, its listener will be removed. If multiple events
8519
+ // are passed in using the space-separated syntax, the handler will fire
8520
+ // once for each event, not once for a combination of all events.
8521
+ Events.once = function(name, callback, context) {
8522
+ // Map the event into a `{event: once}` object.
8523
+ var events = eventsApi(onceMap, {}, name, callback, _.bind(this.off, this));
8524
+ if (typeof name === 'string' && context == null) callback = void 0;
8525
+ return this.on(events, callback, context);
8526
+ };
8527
 
8528
+ // Inversion-of-control versions of `once`.
8529
+ Events.listenToOnce = function(obj, name, callback) {
8530
+ // Map the event into a `{event: once}` object.
8531
+ var events = eventsApi(onceMap, {}, name, callback, _.bind(this.stopListening, this, obj));
8532
+ return this.listenTo(obj, events);
8533
+ };
8534
 
8535
+ // Reduces the event callbacks into a map of `{event: onceWrapper}`.
8536
+ // `offer` unbinds the `onceWrapper` after it has been called.
8537
+ var onceMap = function(map, name, callback, offer) {
8538
+ if (callback) {
8539
+ var once = map[name] = _.once(function() {
8540
+ offer(name, once);
8541
+ callback.apply(this, arguments);
8542
+ });
8543
+ once._callback = callback;
8544
  }
8545
+ return map;
8546
+ };
8547
 
8548
+ // Trigger one or many events, firing all bound callbacks. Callbacks are
8549
+ // passed the same arguments as `trigger` is, apart from the event name
8550
+ // (unless you're listening on `"all"`, which will cause your callback to
8551
+ // receive the true name of the event as the first argument).
8552
+ Events.trigger = function(name) {
8553
+ if (!this._events) return this;
8554
 
8555
+ var length = Math.max(0, arguments.length - 1);
8556
+ var args = Array(length);
8557
+ for (var i = 0; i < length; i++) args[i] = arguments[i + 1];
8558
 
8559
+ eventsApi(triggerApi, this._events, name, void 0, args);
8560
+ return this;
8561
+ };
8562
 
8563
+ // Handles triggering the appropriate event callbacks.
8564
+ var triggerApi = function(objEvents, name, callback, args) {
8565
+ if (objEvents) {
8566
+ var events = objEvents[name];
8567
+ var allEvents = objEvents.all;
8568
+ if (events && allEvents) allEvents = allEvents.slice();
8569
+ if (events) triggerEvents(events, args);
8570
+ if (allEvents) triggerEvents(allEvents, [name].concat(args));
8571
+ }
8572
+ return objEvents;
8573
+ };
8574
 
8575
+ // A difficult-to-believe, but optimized internal dispatch function for
8576
+ // triggering events. Tries to keep the usual cases speedy (most internal
8577
+ // Backbone events have 3 arguments).
8578
+ var triggerEvents = function(events, args) {
8579
+ var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
8580
+ switch (args.length) {
8581
+ case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;
8582
+ case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;
8583
+ case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;
8584
+ case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;
8585
+ default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;
8586
+ }
8587
+ };
8588
 
8589
+ // Aliases for backwards compatibility.
8590
+ Events.bind = Events.on;
8591
+ Events.unbind = Events.off;
 
 
 
 
8592
 
8593
+ // Allow the `Backbone` object to serve as a global event bus, for folks who
8594
+ // want global "pubsub" in a convenient place.
8595
+ _.extend(Backbone, Events);
 
 
8596
 
8597
+ // Backbone.Model
8598
+ // --------------
 
 
8599
 
8600
+ // Backbone **Models** are the basic data object in the framework --
8601
+ // frequently representing a row in a table in a database on your server.
8602
+ // A discrete chunk of data and a bunch of useful, related methods for
8603
+ // performing computations and transformations on that data.
8604
 
8605
+ // Create a new model with the specified attributes. A client id (`cid`)
8606
+ // is automatically generated and assigned for you.
8607
+ var Model = Backbone.Model = function(attributes, options) {
8608
+ var attrs = attributes || {};
8609
+ options || (options = {});
8610
+ this.cid = _.uniqueId(this.cidPrefix);
8611
+ this.attributes = {};
8612
+ if (options.collection) this.collection = options.collection;
8613
+ if (options.parse) attrs = this.parse(attrs, options) || {};
8614
+ var defaults = _.result(this, 'defaults');
8615
+ attrs = _.defaults(_.extend({}, defaults, attrs), defaults);
8616
+ this.set(attrs, options);
8617
+ this.changed = {};
8618
+ this.initialize.apply(this, arguments);
8619
+ };
8620
 
8621
+ // Attach all inheritable methods to the Model prototype.
8622
+ _.extend(Model.prototype, Events, {
8623
 
8624
+ // A hash of attributes whose current and previous value differ.
8625
+ changed: null,
 
 
8626
 
8627
+ // The value returned during the last failed validation.
8628
+ validationError: null,
8629
 
8630
+ // The default name for the JSON `id` attribute is `"id"`. MongoDB and
8631
+ // CouchDB users may want to set this to `"_id"`.
8632
+ idAttribute: 'id',
8633
 
8634
+ // The prefix is used to create the client id which is used to identify models locally.
8635
+ // You may want to override this if you're experiencing name clashes with model ids.
8636
+ cidPrefix: 'c',
8637
 
8638
+ // Initialize is an empty function by default. Override it with your own
8639
+ // initialization logic.
8640
+ initialize: function(){},
8641
 
8642
+ // Return a copy of the model's `attributes` object.
8643
+ toJSON: function(options) {
8644
+ return _.clone(this.attributes);
8645
+ },
8646
 
8647
+ // Proxy `Backbone.sync` by default -- but override this if you need
8648
+ // custom syncing semantics for *this* particular model.
8649
+ sync: function() {
8650
+ return Backbone.sync.apply(this, arguments);
8651
+ },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8652
 
8653
+ // Get the value of an attribute.
8654
+ get: function(attr) {
8655
+ return this.attributes[attr];
8656
+ },
8657
 
8658
+ // Get the HTML-escaped value of an attribute.
8659
+ escape: function(attr) {
8660
+ return _.escape(this.get(attr));
8661
+ },
 
8662
 
8663
+ // Returns `true` if the attribute contains a value that is not null
8664
+ // or undefined.
8665
+ has: function(attr) {
8666
+ return this.get(attr) != null;
8667
+ },
8668
 
8669
+ // Special-cased proxy to underscore's `_.matches` method.
8670
+ matches: function(attrs) {
8671
+ return !!_.iteratee(attrs, this)(this.attributes);
8672
+ },
8673
 
8674
+ // Set a hash of model attributes on the object, firing `"change"`. This is
8675
+ // the core primitive operation of a model, updating the data and notifying
8676
+ // anyone who needs to know about the change in state. The heart of the beast.
8677
+ set: function(key, val, options) {
8678
+ if (key == null) return this;
8679
 
8680
+ // Handle both `"key", value` and `{key: value}` -style arguments.
8681
+ var attrs;
8682
+ if (typeof key === 'object') {
8683
+ attrs = key;
8684
+ options = val;
8685
+ } else {
8686
+ (attrs = {})[key] = val;
8687
+ }
8688
 
8689
+ options || (options = {});
 
 
 
 
 
8690
 
8691
+ // Run validation.
8692
+ if (!this._validate(attrs, options)) return false;
8693
 
8694
+ // Extract attributes and options.
8695
+ var unset = options.unset;
8696
+ var silent = options.silent;
8697
+ var changes = [];
8698
+ var changing = this._changing;
8699
+ this._changing = true;
 
 
 
 
 
 
 
8700
 
8701
+ if (!changing) {
8702
+ this._previousAttributes = _.clone(this.attributes);
8703
+ this.changed = {};
8704
+ }
 
 
 
 
 
 
 
8705
 
8706
+ var current = this.attributes;
8707
+ var changed = this.changed;
8708
+ var prev = this._previousAttributes;
 
 
 
 
 
 
 
 
 
 
8709
 
8710
+ // For each `set` attribute, update or delete the current value.
8711
+ for (var attr in attrs) {
8712
+ val = attrs[attr];
8713
+ if (!_.isEqual(current[attr], val)) changes.push(attr);
8714
+ if (!_.isEqual(prev[attr], val)) {
8715
+ changed[attr] = val;
8716
+ } else {
8717
+ delete changed[attr];
8718
  }
8719
+ unset ? delete current[attr] : current[attr] = val;
8720
+ }
8721
 
8722
+ // Update the `id`.
8723
+ if (this.idAttribute in attrs) this.id = this.get(this.idAttribute);
8724
 
8725
+ // Trigger all relevant attribute changes.
8726
+ if (!silent) {
8727
+ if (changes.length) this._pending = options;
8728
+ for (var i = 0; i < changes.length; i++) {
8729
+ this.trigger('change:' + changes[i], this, current[changes[i]], options);
8730
+ }
8731
+ }
8732
 
8733
+ // You might be wondering why there's a `while` loop here. Changes can
8734
+ // be recursively nested within `"change"` events.
8735
+ if (changing) return this;
8736
+ if (!silent) {
8737
+ while (this._pending) {
8738
+ options = this._pending;
8739
+ this._pending = false;
8740
+ this.trigger('change', this, options);
8741
+ }
8742
+ }
8743
+ this._pending = false;
8744
+ this._changing = false;
8745
+ return this;
8746
+ },
8747
 
8748
+ // Remove an attribute from the model, firing `"change"`. `unset` is a noop
8749
+ // if the attribute doesn't exist.
8750
+ unset: function(attr, options) {
8751
+ return this.set(attr, void 0, _.extend({}, options, {unset: true}));
8752
+ },
8753
 
8754
+ // Clear all attributes on the model, firing `"change"`.
8755
+ clear: function(options) {
8756
+ var attrs = {};
8757
+ for (var key in this.attributes) attrs[key] = void 0;
8758
+ return this.set(attrs, _.extend({}, options, {unset: true}));
8759
+ },
8760
 
8761
+ // Determine if the model has changed since the last `"change"` event.
8762
+ // If you specify an attribute name, determine if that attribute has changed.
8763
+ hasChanged: function(attr) {
8764
+ if (attr == null) return !_.isEmpty(this.changed);
8765
+ return _.has(this.changed, attr);
8766
+ },
8767
 
8768
+ // Return an object containing all the attributes that have changed, or
8769
+ // false if there are no changed attributes. Useful for determining what
8770
+ // parts of a view need to be updated and/or what attributes need to be
8771
+ // persisted to the server. Unset attributes will be set to undefined.
8772
+ // You can also pass an attributes object to diff against the model,
8773
+ // determining if there *would be* a change.
8774
+ changedAttributes: function(diff) {
8775
+ if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
8776
+ var old = this._changing ? this._previousAttributes : this.attributes;
8777
+ var changed = {};
8778
+ for (var attr in diff) {
8779
+ var val = diff[attr];
8780
+ if (_.isEqual(old[attr], val)) continue;
8781
+ changed[attr] = val;
8782
+ }
8783
+ return _.size(changed) ? changed : false;
8784
+ },
8785
 
8786
+ // Get the previous value of an attribute, recorded at the time the last
8787
+ // `"change"` event was fired.
8788
+ previous: function(attr) {
8789
+ if (attr == null || !this._previousAttributes) return null;
8790
+ return this._previousAttributes[attr];
8791
+ },
8792
 
8793
+ // Get all of the attributes of the model at the time of the previous
8794
+ // `"change"` event.
8795
+ previousAttributes: function() {
8796
+ return _.clone(this._previousAttributes);
8797
+ },
 
 
 
 
 
8798
 
8799
+ // Fetch the model from the server, merging the response with the model's
8800
+ // local attributes. Any changed attributes will trigger a "change" event.
8801
+ fetch: function(options) {
8802
+ options = _.extend({parse: true}, options);
8803
+ var model = this;
8804
+ var success = options.success;
8805
+ options.success = function(resp) {
8806
+ var serverAttrs = options.parse ? model.parse(resp, options) : resp;
8807
+ if (!model.set(serverAttrs, options)) return false;
8808
+ if (success) success.call(options.context, model, resp, options);
8809
+ model.trigger('sync', model, resp, options);
8810
+ };
8811
+ wrapError(this, options);
8812
+ return this.sync('read', this, options);
8813
+ },
 
8814
 
8815
+ // Set a hash of model attributes, and sync the model to the server.
8816
+ // If the server returns an attributes hash that differs, the model's
8817
+ // state will be `set` again.
8818
+ save: function(key, val, options) {
8819
+ // Handle both `"key", value` and `{key: value}` -style arguments.
8820
+ var attrs;
8821
+ if (key == null || typeof key === 'object') {
8822
+ attrs = key;
8823
+ options = val;
8824
+ } else {
8825
+ (attrs = {})[key] = val;
8826
+ }
8827
 
8828
+ options = _.extend({validate: true, parse: true}, options);
8829
+ var wait = options.wait;
 
8830
 
8831
+ // If we're not waiting and attributes exist, save acts as
8832
+ // `set(attr).save(null, opts)` with validation. Otherwise, check if
8833
+ // the model will be valid when the attributes, if any, are set.
8834
+ if (attrs && !wait) {
8835
+ if (!this.set(attrs, options)) return false;
8836
+ } else if (!this._validate(attrs, options)) {
8837
+ return false;
8838
+ }
8839
 
8840
+ // After a successful server-side save, the client is (optionally)
8841
+ // updated with the server-side state.
8842
+ var model = this;
8843
+ var success = options.success;
8844
+ var attributes = this.attributes;
8845
+ options.success = function(resp) {
8846
+ // Ensure attributes are restored during synchronous saves.
8847
+ model.attributes = attributes;
8848
+ var serverAttrs = options.parse ? model.parse(resp, options) : resp;
8849
+ if (wait) serverAttrs = _.extend({}, attrs, serverAttrs);
8850
+ if (serverAttrs && !model.set(serverAttrs, options)) return false;
8851
+ if (success) success.call(options.context, model, resp, options);
8852
+ model.trigger('sync', model, resp, options);
8853
+ };
8854
+ wrapError(this, options);
8855
 
8856
+ // Set temporary attributes if `{wait: true}` to properly find new ids.
8857
+ if (attrs && wait) this.attributes = _.extend({}, attributes, attrs);
 
8858
 
8859
+ var method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
8860
+ if (method === 'patch' && !options.attrs) options.attrs = attrs;
8861
+ var xhr = this.sync(method, this, options);
8862
 
8863
+ // Restore attributes.
8864
+ this.attributes = attributes;
8865
 
8866
+ return xhr;
8867
+ },
8868
 
8869
+ // Destroy this model on the server if it was already persisted.
8870
+ // Optimistically removes the model from its collection, if it has one.
8871
+ // If `wait: true` is passed, waits for the server to respond before removal.
8872
+ destroy: function(options) {
8873
+ options = options ? _.clone(options) : {};
8874
+ var model = this;
8875
+ var success = options.success;
8876
+ var wait = options.wait;
8877
 
8878
+ var destroy = function() {
8879
+ model.stopListening();
8880
+ model.trigger('destroy', model, model.collection, options);
8881
+ };
8882
 
8883
+ options.success = function(resp) {
8884
+ if (wait) destroy();
8885
+ if (success) success.call(options.context, model, resp, options);
8886
+ if (!model.isNew()) model.trigger('sync', model, resp, options);
8887
+ };
8888
 
8889
+ var xhr = false;
8890
+ if (this.isNew()) {
8891
+ _.defer(options.success);
8892
+ } else {
8893
+ wrapError(this, options);
8894
+ xhr = this.sync('delete', this, options);
8895
+ }
8896
+ if (!wait) destroy();
8897
+ return xhr;
8898
+ },
8899
 
8900
+ // Default URL for the model's representation on the server -- if you're
8901
+ // using Backbone's restful methods, override this to change the endpoint
8902
+ // that will be called.
8903
+ url: function() {
8904
+ var base =
8905
+ _.result(this, 'urlRoot') ||
8906
+ _.result(this.collection, 'url') ||
8907
+ urlError();
8908
+ if (this.isNew()) return base;
8909
+ var id = this.get(this.idAttribute);
8910
+ return base.replace(/[^\/]$/, '$&/') + encodeURIComponent(id);
8911
+ },
8912
 
8913
+ // **parse** converts a response into the hash of attributes to be `set` on
8914
+ // the model. The default implementation is just to pass the response along.
8915
+ parse: function(resp, options) {
8916
+ return resp;
8917
+ },
8918
 
8919
+ // Create a new model with identical attributes to this one.
8920
+ clone: function() {
8921
+ return new this.constructor(this.attributes);
8922
+ },
8923
 
8924
+ // A model is new if it has never been saved to the server, and lacks an id.
8925
+ isNew: function() {
8926
+ return !this.has(this.idAttribute);
8927
+ },
8928
 
8929
+ // Check if the model is currently in a valid state.
8930
+ isValid: function(options) {
8931
+ return this._validate({}, _.extend({}, options, {validate: true}));
8932
+ },
8933
 
8934
+ // Run validation against the next complete set of model attributes,
8935
+ // returning `true` if all is well. Otherwise, fire an `"invalid"` event.
8936
+ _validate: function(attrs, options) {
8937
+ if (!options.validate || !this.validate) return true;
8938
+ attrs = _.extend({}, this.attributes, attrs);
8939
+ var error = this.validationError = this.validate(attrs, options) || null;
8940
+ if (!error) return true;
8941
+ this.trigger('invalid', this, error, _.extend(options, {validationError: error}));
8942
+ return false;
8943
  }
8944
 
8945
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8946
 
8947
+ // Underscore methods that we want to implement on the Model, mapped to the
8948
+ // number of arguments they take.
8949
+ var modelMethods = {keys: 1, values: 1, pairs: 1, invert: 1, pick: 0,
8950
+ omit: 0, chain: 1, isEmpty: 1};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8951
 
8952
+ // Mix in each Underscore method as a proxy to `Model#attributes`.
8953
+ addUnderscoreMethods(Model, modelMethods, 'attributes');
8954
 
8955
+ // Backbone.Collection
8956
+ // -------------------
 
8957
 
8958
+ // If models tend to represent a single row of data, a Backbone Collection is
8959
+ // more analogous to a table full of data ... or a small slice or page of that
8960
+ // table, or a collection of rows that belong together for a particular reason
8961
+ // -- all of the messages in this particular folder, all of the documents
8962
+ // belonging to this particular author, and so on. Collections maintain
8963
+ // indexes of their models, both in order, and for lookup by `id`.
8964
 
8965
+ // Create a new **Collection**, perhaps to contain a specific type of `model`.
8966
+ // If a `comparator` is specified, the Collection will maintain
8967
+ // its models in sort order, as they're added and removed.
8968
+ var Collection = Backbone.Collection = function(models, options) {
8969
+ options || (options = {});
8970
+ if (options.model) this.model = options.model;
8971
+ if (options.comparator !== void 0) this.comparator = options.comparator;
8972
+ this._reset();
8973
+ this.initialize.apply(this, arguments);
8974
+ if (models) this.reset(models, _.extend({silent: true}, options));
8975
+ };
8976
 
8977
+ // Default options for `Collection#set`.
8978
+ var setOptions = {add: true, remove: true, merge: true};
8979
+ var addOptions = {add: true, remove: false};
8980
 
8981
+ // Splices `insert` into `array` at index `at`.
8982
+ var splice = function(array, insert, at) {
8983
+ at = Math.min(Math.max(at, 0), array.length);
8984
+ var tail = Array(array.length - at);
8985
+ var length = insert.length;
8986
+ var i;
8987
+ for (i = 0; i < tail.length; i++) tail[i] = array[i + at];
8988
+ for (i = 0; i < length; i++) array[i + at] = insert[i];
8989
+ for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i];
8990
+ };
8991
 
8992
+ // Define the Collection's inheritable methods.
8993
+ _.extend(Collection.prototype, Events, {
 
 
 
 
 
 
 
 
 
 
 
8994
 
8995
+ // The default model for a collection is just a **Backbone.Model**.
8996
+ // This should be overridden in most cases.
8997
+ model: Model,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8998
 
8999
+ // Initialize is an empty function by default. Override it with your own
9000
+ // initialization logic.
9001
+ initialize: function(){},
 
 
 
 
 
 
 
 
 
9002
 
9003
+ // The JSON representation of a Collection is an array of the
9004
+ // models' attributes.
9005
+ toJSON: function(options) {
9006
+ return this.map(function(model) { return model.toJSON(options); });
9007
+ },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9008
 
9009
+ // Proxy `Backbone.sync` by default.
9010
+ sync: function() {
9011
+ return Backbone.sync.apply(this, arguments);
9012
+ },
 
 
9013
 
9014
+ // Add a model, or list of models to the set. `models` may be Backbone
9015
+ // Models or raw JavaScript objects to be converted to Models, or any
9016
+ // combination of the two.
9017
+ add: function(models, options) {
9018
+ return this.set(models, _.extend({merge: false}, options, addOptions));
9019
+ },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9020
 
9021
+ // Remove a model, or a list of models from the set.
9022
+ remove: function(models, options) {
9023
+ options = _.extend({}, options);
9024
+ var singular = !_.isArray(models);
9025
+ models = singular ? [models] : models.slice();
9026
+ var removed = this._removeModels(models, options);
9027
+ if (!options.silent && removed.length) {
9028
+ options.changes = {added: [], merged: [], removed: removed};
9029
+ this.trigger('update', this, options);
9030
+ }
9031
+ return singular ? removed[0] : removed;
9032
+ },
9033
 
9034
+ // Update a collection by `set`-ing a new list of models, adding new ones,
9035
+ // removing models that are no longer present, and merging models that
9036
+ // already exist in the collection, as necessary. Similar to **Model#set**,
9037
+ // the core operation for updating the data contained by the collection.
9038
+ set: function(models, options) {
9039
+ if (models == null) return;
9040
 
9041
+ options = _.extend({}, setOptions, options);
9042
+ if (options.parse && !this._isModel(models)) {
9043
+ models = this.parse(models, options) || [];
9044
+ }
9045
 
9046
+ var singular = !_.isArray(models);
9047
+ models = singular ? [models] : models.slice();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9048
 
9049
+ var at = options.at;
9050
+ if (at != null) at = +at;
9051
+ if (at > this.length) at = this.length;
9052
+ if (at < 0) at += this.length + 1;
 
 
 
 
 
 
 
 
 
 
9053
 
9054
+ var set = [];
9055
+ var toAdd = [];
9056
+ var toMerge = [];
9057
+ var toRemove = [];
9058
+ var modelMap = {};
9059
 
9060
+ var add = options.add;
9061
+ var merge = options.merge;
9062
+ var remove = options.remove;
9063
 
9064
+ var sort = false;
9065
+ var sortable = this.comparator && at == null && options.sort !== false;
9066
+ var sortAttr = _.isString(this.comparator) ? this.comparator : null;
9067
 
9068
+ // Turn bare objects into model references, and prevent invalid models
9069
+ // from being added.
9070
+ var model, i;
9071
+ for (i = 0; i < models.length; i++) {
9072
+ model = models[i];
9073
 
9074
+ // If a duplicate is found, prevent it from being added and
9075
+ // optionally merge it into the existing model.
9076
+ var existing = this.get(model);
9077
+ if (existing) {
9078
+ if (merge && model !== existing) {
9079
+ var attrs = this._isModel(model) ? model.attributes : model;
9080
+ if (options.parse) attrs = existing.parse(attrs, options);
9081
+ existing.set(attrs, options);
9082
+ toMerge.push(existing);
9083
+ if (sortable && !sort) sort = existing.hasChanged(sortAttr);
9084
+ }
9085
+ if (!modelMap[existing.cid]) {
9086
+ modelMap[existing.cid] = true;
9087
+ set.push(existing);
9088
+ }
9089
+ models[i] = existing;
9090
 
9091
+ // If this is a new, valid model, push it to the `toAdd` list.
9092
+ } else if (add) {
9093
+ model = models[i] = this._prepareModel(model, options);
9094
+ if (model) {
9095
+ toAdd.push(model);
9096
+ this._addReference(model, options);
9097
+ modelMap[model.cid] = true;
9098
+ set.push(model);
9099
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9100
  }
9101
+ }
 
 
 
 
 
 
 
 
 
9102
 
9103
+ // Remove stale models.
9104
+ if (remove) {
9105
+ for (i = 0; i < this.length; i++) {
9106
+ model = this.models[i];
9107
+ if (!modelMap[model.cid]) toRemove.push(model);
9108
+ }
9109
+ if (toRemove.length) this._removeModels(toRemove, options);
9110
+ }
9111
 
9112
+ // See if sorting is needed, update `length` and splice in new models.
9113
+ var orderChanged = false;
9114
+ var replace = !sortable && add && remove;
9115
+ if (set.length && replace) {
9116
+ orderChanged = this.length !== set.length || _.some(this.models, function(m, index) {
9117
+ return m !== set[index];
9118
+ });
9119
+ this.models.length = 0;
9120
+ splice(this.models, set, 0);
9121
+ this.length = this.models.length;
9122
+ } else if (toAdd.length) {
9123
+ if (sortable) sort = true;
9124
+ splice(this.models, toAdd, at == null ? this.length : at);
9125
+ this.length = this.models.length;
9126
+ }
9127
 
9128
+ // Silently sort the collection if appropriate.
9129
+ if (sort) this.sort({silent: true});
9130
 
9131
+ // Unless silenced, it's time to fire all appropriate add/sort/update events.
9132
+ if (!options.silent) {
9133
+ for (i = 0; i < toAdd.length; i++) {
9134
+ if (at != null) options.index = at + i;
9135
+ model = toAdd[i];
9136
+ model.trigger('add', model, this, options);
9137
+ }
9138
+ if (sort || orderChanged) this.trigger('sort', this, options);
9139
+ if (toAdd.length || toRemove.length || toMerge.length) {
9140
+ options.changes = {
9141
+ added: toAdd,
9142
+ removed: toRemove,
9143
+ merged: toMerge
9144
+ };
9145
+ this.trigger('update', this, options);
9146
+ }
9147
+ }
9148
 
9149
+ // Return the added (or merged) model (or models).
9150
+ return singular ? models[0] : models;
9151
+ },
 
9152
 
9153
+ // When you have more items than you want to add or remove individually,
9154
+ // you can reset the entire set with a new list of models, without firing
9155
+ // any granular `add` or `remove` events. Fires `reset` when finished.
9156
+ // Useful for bulk operations and optimizations.
9157
+ reset: function(models, options) {
9158
+ options = options ? _.clone(options) : {};
9159
+ for (var i = 0; i < this.models.length; i++) {
9160
+ this._removeReference(this.models[i], options);
9161
+ }
9162
+ options.previousModels = this.models;
9163
+ this._reset();
9164
+ models = this.add(models, _.extend({silent: true}, options));
9165
+ if (!options.silent) this.trigger('reset', this, options);
9166
+ return models;
9167
+ },
9168
 
9169
+ // Add a model to the end of the collection.
9170
+ push: function(model, options) {
9171
+ return this.add(model, _.extend({at: this.length}, options));
9172
+ },
9173
 
9174
+ // Remove a model from the end of the collection.
9175
+ pop: function(options) {
9176
+ var model = this.at(this.length - 1);
9177
+ return this.remove(model, options);
9178
+ },
9179
 
9180
+ // Add a model to the beginning of the collection.
9181
+ unshift: function(model, options) {
9182
+ return this.add(model, _.extend({at: 0}, options));
9183
+ },
9184
 
9185
+ // Remove a model from the beginning of the collection.
9186
+ shift: function(options) {
9187
+ var model = this.at(0);
9188
+ return this.remove(model, options);
9189
+ },
9190
 
9191
+ // Slice out a sub-array of models from the collection.
9192
+ slice: function() {
9193
+ return slice.apply(this.models, arguments);
9194
+ },
9195
 
9196
+ // Get a model from the set by id, cid, model object with id or cid
9197
+ // properties, or an attributes object that is transformed through modelId.
9198
+ get: function(obj) {
9199
+ if (obj == null) return void 0;
9200
+ return this._byId[obj] ||
9201
+ this._byId[this.modelId(obj.attributes || obj)] ||
9202
+ obj.cid && this._byId[obj.cid];
9203
+ },
9204
 
9205
+ // Returns `true` if the model is in the collection.
9206
+ has: function(obj) {
9207
+ return this.get(obj) != null;
9208
+ },
9209
 
9210
+ // Get the model at the given index.
9211
+ at: function(index) {
9212
+ if (index < 0) index += this.length;
9213
+ return this.models[index];
9214
+ },
9215
 
9216
+ // Return models with matching attributes. Useful for simple cases of
9217
+ // `filter`.
9218
+ where: function(attrs, first) {
9219
+ return this[first ? 'find' : 'filter'](attrs);
9220
+ },
9221
 
9222
+ // Return the first model with matching attributes. Useful for simple cases
9223
+ // of `find`.
9224
+ findWhere: function(attrs) {
9225
+ return this.where(attrs, true);
9226
+ },
9227
 
9228
+ // Force the collection to re-sort itself. You don't need to call this under
9229
+ // normal circumstances, as the set will maintain sort order as each item
9230
+ // is added.
9231
+ sort: function(options) {
9232
+ var comparator = this.comparator;
9233
+ if (!comparator) throw new Error('Cannot sort a set without a comparator');
9234
+ options || (options = {});
9235
 
9236
+ var length = comparator.length;
9237
+ if (_.isFunction(comparator)) comparator = _.bind(comparator, this);
 
 
9238
 
9239
+ // Run sort based on type of `comparator`.
9240
+ if (length === 1 || _.isString(comparator)) {
9241
+ this.models = this.sortBy(comparator);
9242
+ } else {
9243
+ this.models.sort(comparator);
9244
+ }
9245
+ if (!options.silent) this.trigger('sort', this, options);
9246
+ return this;
9247
+ },
9248
 
9249
+ // Pluck an attribute from each model in the collection.
9250
+ pluck: function(attr) {
9251
+ return this.map(attr + '');
9252
+ },
 
 
 
9253
 
9254
+ // Fetch the default set of models for this collection, resetting the
9255
+ // collection when they arrive. If `reset: true` is passed, the response
9256
+ // data will be passed through the `reset` method instead of `set`.
9257
+ fetch: function(options) {
9258
+ options = _.extend({parse: true}, options);
9259
+ var success = options.success;
9260
+ var collection = this;
9261
+ options.success = function(resp) {
9262
+ var method = options.reset ? 'reset' : 'set';
9263
+ collection[method](resp, options);
9264
+ if (success) success.call(options.context, collection, resp, options);
9265
+ collection.trigger('sync', collection, resp, options);
9266
+ };
9267
+ wrapError(this, options);
9268
+ return this.sync('read', this, options);
9269
+ },
9270
 
9271
+ // Create a new instance of a model in this collection. Add the model to the
9272
+ // collection immediately, unless `wait: true` is passed, in which case we
9273
+ // wait for the server to agree.
9274
+ create: function(model, options) {
9275
+ options = options ? _.clone(options) : {};
9276
+ var wait = options.wait;
9277
+ model = this._prepareModel(model, options);
9278
+ if (!model) return false;
9279
+ if (!wait) this.add(model, options);
9280
+ var collection = this;
9281
+ var success = options.success;
9282
+ options.success = function(m, resp, callbackOpts) {
9283
+ if (wait) collection.add(m, callbackOpts);
9284
+ if (success) success.call(callbackOpts.context, m, resp, callbackOpts);
9285
+ };
9286
+ model.save(null, options);
9287
+ return model;
9288
+ },
9289
 
9290
+ // **parse** converts a response into a list of models to be added to the
9291
+ // collection. The default implementation is just to pass it through.
9292
+ parse: function(resp, options) {
9293
+ return resp;
9294
+ },
 
9295
 
9296
+ // Create a new collection with an identical list of models as this one.
9297
+ clone: function() {
9298
+ return new this.constructor(this.models, {
9299
+ model: this.model,
9300
+ comparator: this.comparator
9301
+ });
9302
+ },
9303
 
9304
+ // Define how to uniquely identify models in the collection.
9305
+ modelId: function(attrs) {
9306
+ return attrs[this.model.prototype.idAttribute || 'id'];
9307
+ },
 
 
 
 
 
 
 
9308
 
9309
+ // Private method to reset all internal state. Called when the collection
9310
+ // is first initialized or reset.
9311
+ _reset: function() {
9312
+ this.length = 0;
9313
+ this.models = [];
9314
+ this._byId = {};
9315
+ },
9316
 
9317
+ // Prepare a hash of attributes (or other model) to be added to this
9318
+ // collection.
9319
+ _prepareModel: function(attrs, options) {
9320
+ if (this._isModel(attrs)) {
9321
+ if (!attrs.collection) attrs.collection = this;
9322
+ return attrs;
9323
+ }
9324
+ options = options ? _.clone(options) : {};
9325
+ options.collection = this;
9326
+ var model = new this.model(attrs, options);
9327
+ if (!model.validationError) return model;
9328
+ this.trigger('invalid', this, model.validationError, options);
9329
+ return false;
9330
+ },
9331
 
9332
+ // Internal method called by both remove and set.
9333
+ _removeModels: function(models, options) {
9334
+ var removed = [];
9335
+ for (var i = 0; i < models.length; i++) {
9336
+ var model = this.get(models[i]);
9337
+ if (!model) continue;
9338
 
9339
+ var index = this.indexOf(model);
9340
+ this.models.splice(index, 1);
9341
+ this.length--;
9342
 
9343
+ // Remove references before triggering 'remove' event to prevent an
9344
+ // infinite loop. #3693
9345
+ delete this._byId[model.cid];
9346
+ var id = this.modelId(model.attributes);
9347
+ if (id != null) delete this._byId[id];
 
9348
 
9349
+ if (!options.silent) {
9350
+ options.index = index;
9351
+ model.trigger('remove', model, this, options);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9352
  }
 
 
 
 
9353
 
9354
+ removed.push(model);
9355
+ this._removeReference(model, options);
9356
+ }
9357
+ return removed;
9358
+ },
 
 
 
9359
 
9360
+ // Method for checking whether an object should be considered a model for
9361
+ // the purposes of adding to the collection.
9362
+ _isModel: function(model) {
9363
+ return model instanceof Model;
9364
+ },
9365
 
9366
+ // Internal method to create a model's ties to a collection.
9367
+ _addReference: function(model, options) {
9368
+ this._byId[model.cid] = model;
9369
+ var id = this.modelId(model.attributes);
9370
+ if (id != null) this._byId[id] = model;
9371
+ model.on('all', this._onModelEvent, this);
9372
+ },
9373
 
9374
+ // Internal method to sever a model's ties to a collection.
9375
+ _removeReference: function(model, options) {
9376
+ delete this._byId[model.cid];
9377
+ var id = this.modelId(model.attributes);
9378
+ if (id != null) delete this._byId[id];
9379
+ if (this === model.collection) delete model.collection;
9380
+ model.off('all', this._onModelEvent, this);
9381
+ },
9382
 
9383
+ // Internal method called every time a model in the set fires an event.
9384
+ // Sets need to update their indexes when models change ids. All other
9385
+ // events simply proxy through. "add" and "remove" events that originate
9386
+ // in other collections are ignored.
9387
+ _onModelEvent: function(event, model, collection, options) {
9388
+ if (model) {
9389
+ if ((event === 'add' || event === 'remove') && collection !== this) return;
9390
+ if (event === 'destroy') this.remove(model, options);
9391
+ if (event === 'change') {
9392
+ var prevId = this.modelId(model.previousAttributes());
9393
+ var id = this.modelId(model.attributes);
9394
+ if (prevId !== id) {
9395
+ if (prevId != null) delete this._byId[prevId];
9396
+ if (id != null) this._byId[id] = model;
9397
+ }
9398
  }
9399
+ }
9400
+ this.trigger.apply(this, arguments);
9401
+ }
9402
 
9403
+ });
 
 
9404
 
9405
+ // Underscore methods that we want to implement on the Collection.
9406
+ // 90% of the core usefulness of Backbone Collections is actually implemented
9407
+ // right here:
9408
+ var collectionMethods = {forEach: 3, each: 3, map: 3, collect: 3, reduce: 0,
9409
+ foldl: 0, inject: 0, reduceRight: 0, foldr: 0, find: 3, detect: 3, filter: 3,
9410
+ select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 3, includes: 3,
9411
+ contains: 3, invoke: 0, max: 3, min: 3, toArray: 1, size: 1, first: 3,
9412
+ head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3,
9413
+ without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3,
9414
+ isEmpty: 1, chain: 1, sample: 3, partition: 3, groupBy: 3, countBy: 3,
9415
+ sortBy: 3, indexBy: 3, findIndex: 3, findLastIndex: 3};
9416
 
9417
+ // Mix in each Underscore method as a proxy to `Collection#models`.
9418
+ addUnderscoreMethods(Collection, collectionMethods, 'models');
 
 
 
 
9419
 
9420
+ // Backbone.View
9421
+ // -------------
 
 
 
9422
 
9423
+ // Backbone Views are almost more convention than they are actual code. A View
9424
+ // is simply a JavaScript object that represents a logical chunk of UI in the
9425
+ // DOM. This might be a single item, an entire list, a sidebar or panel, or
9426
+ // even the surrounding frame which wraps your whole app. Defining a chunk of
9427
+ // UI as a **View** allows you to define your DOM events declaratively, without
9428
+ // having to worry about render order ... and makes it easy for the view to
9429
+ // react to specific changes in the state of your models.
9430
 
9431
+ // Creating a Backbone.View creates its initial element outside of the DOM,
9432
+ // if an existing element is not provided...
9433
+ var View = Backbone.View = function(options) {
9434
+ this.cid = _.uniqueId('view');
9435
+ _.extend(this, _.pick(options, viewOptions));
9436
+ this._ensureElement();
9437
+ this.initialize.apply(this, arguments);
9438
+ };
 
 
 
 
 
 
 
9439
 
9440
+ // Cached regex to split keys for `delegate`.
9441
+ var delegateEventSplitter = /^(\S+)\s*(.*)$/;
 
9442
 
9443
+ // List of view options to be set as properties.
9444
+ var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9445
 
9446
+ // Set up all inheritable **Backbone.View** properties and methods.
9447
+ _.extend(View.prototype, Events, {
 
 
 
9448
 
9449
+ // The default `tagName` of a View's element is `"div"`.
9450
+ tagName: 'div',
9451
 
9452
+ // jQuery delegate for element lookup, scoped to DOM elements within the
9453
+ // current view. This should be preferred to global lookups where possible.
9454
+ $: function(selector) {
9455
+ return this.$el.find(selector);
9456
+ },
9457
 
9458
+ // Initialize is an empty function by default. Override it with your own
9459
+ // initialization logic.
9460
+ initialize: function(){},
9461
 
9462
+ // **render** is the core function that your view should override, in order
9463
+ // to populate its element (`this.el`), with the appropriate HTML. The
9464
+ // convention is for **render** to always return `this`.
9465
+ render: function() {
9466
+ return this;
9467
+ },
 
 
 
9468
 
9469
+ // Remove this view by taking the element out of the DOM, and removing any
9470
+ // applicable Backbone.Events listeners.
9471
+ remove: function() {
9472
+ this._removeElement();
9473
+ this.stopListening();
9474
+ return this;
9475
+ },
9476
 
9477
+ // Remove this view's element from the document and all event listeners
9478
+ // attached to it. Exposed for subclasses using an alternative DOM
9479
+ // manipulation API.
9480
+ _removeElement: function() {
9481
+ this.$el.remove();
9482
+ },
9483
 
9484
+ // Change the view's element (`this.el` property) and re-delegate the
9485
+ // view's events on the new element.
9486
+ setElement: function(element) {
9487
+ this.undelegateEvents();
9488
+ this._setElement(element);
9489
+ this.delegateEvents();
9490
+ return this;
9491
+ },
 
 
 
9492
 
9493
+ // Creates the `this.el` and `this.$el` references for this view using the
9494
+ // given `el`. `el` can be a CSS selector or an HTML string, a jQuery
9495
+ // context or an element. Subclasses can override this to utilize an
9496
+ // alternative DOM manipulation API and are only required to set the
9497
+ // `this.el` property.
9498
+ _setElement: function(el) {
9499
+ this.$el = el instanceof Backbone.$ ? el : Backbone.$(el);
9500
+ this.el = this.$el[0];
9501
+ },
 
 
 
 
9502
 
9503
+ // Set callbacks, where `this.events` is a hash of
9504
+ //
9505
+ // *{"event selector": "callback"}*
9506
+ //
9507
+ // {
9508
+ // 'mousedown .title': 'edit',
9509
+ // 'click .button': 'save',
9510
+ // 'click .open': function(e) { ... }
9511
+ // }
9512
+ //
9513
+ // pairs. Callbacks will be bound to the view, with `this` set properly.
9514
+ // Uses event delegation for efficiency.
9515
+ // Omitting the selector binds the event to `this.el`.
9516
+ delegateEvents: function(events) {
9517
+ events || (events = _.result(this, 'events'));
9518
+ if (!events) return this;
9519
+ this.undelegateEvents();
9520
+ for (var key in events) {
9521
+ var method = events[key];
9522
+ if (!_.isFunction(method)) method = this[method];
9523
+ if (!method) continue;
9524
+ var match = key.match(delegateEventSplitter);
9525
+ this.delegate(match[1], match[2], _.bind(method, this));
9526
+ }
9527
+ return this;
9528
+ },
9529
 
9530
+ // Add a single event listener to the view's element (or a child element
9531
+ // using `selector`). This only works for delegate-able events: not `focus`,
9532
+ // `blur`, and not `change`, `submit`, and `reset` in Internet Explorer.
9533
+ delegate: function(eventName, selector, listener) {
9534
+ this.$el.on(eventName + '.delegateEvents' + this.cid, selector, listener);
9535
+ return this;
9536
+ },
 
 
 
 
 
 
9537
 
9538
+ // Clears all callbacks previously bound to the view by `delegateEvents`.
9539
+ // You usually don't need to use this, but may wish to if you have multiple
9540
+ // Backbone views attached to the same DOM element.
9541
+ undelegateEvents: function() {
9542
+ if (this.$el) this.$el.off('.delegateEvents' + this.cid);
9543
+ return this;
9544
+ },
9545
 
9546
+ // A finer-grained `undelegateEvents` for removing a single delegated event.
9547
+ // `selector` and `listener` are both optional.
9548
+ undelegate: function(eventName, selector, listener) {
9549
+ this.$el.off(eventName + '.delegateEvents' + this.cid, selector, listener);
9550
+ return this;
9551
+ },
9552
 
9553
+ // Produces a DOM element to be assigned to your view. Exposed for
9554
+ // subclasses using an alternative DOM manipulation API.
9555
+ _createElement: function(tagName) {
9556
+ return document.createElement(tagName);
9557
+ },
 
9558
 
9559
+ // Ensure that the View has a DOM element to render into.
9560
+ // If `this.el` is a string, pass it through `$()`, take the first
9561
+ // matching element, and re-assign it to `el`. Otherwise, create
9562
+ // an element from the `id`, `className` and `tagName` properties.
9563
+ _ensureElement: function() {
9564
+ if (!this.el) {
9565
+ var attrs = _.extend({}, _.result(this, 'attributes'));
9566
+ if (this.id) attrs.id = _.result(this, 'id');
9567
+ if (this.className) attrs['class'] = _.result(this, 'className');
9568
+ this.setElement(this._createElement(_.result(this, 'tagName')));
9569
+ this._setAttributes(attrs);
9570
+ } else {
9571
+ this.setElement(_.result(this, 'el'));
9572
+ }
9573
+ },
9574
 
9575
+ // Set attributes from a hash on this view's element. Exposed for
9576
+ // subclasses using an alternative DOM manipulation API.
9577
+ _setAttributes: function(attributes) {
9578
+ this.$el.attr(attributes);
9579
  }
9580
 
9581
+ });
 
 
 
 
 
 
 
 
 
 
9582
 
9583
+ // Backbone.sync
9584
+ // -------------
 
 
9585
 
9586
+ // Override this function to change the manner in which Backbone persists
9587
+ // models to the server. You will be passed the type of request, and the
9588
+ // model in question. By default, makes a RESTful Ajax request
9589
+ // to the model's `url()`. Some possible customizations could be:
9590
+ //
9591
+ // * Use `setTimeout` to batch rapid-fire updates into a single request.
9592
+ // * Send up the models as XML instead of JSON.
9593
+ // * Persist models via WebSockets instead of Ajax.
9594
+ //
9595
+ // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
9596
+ // as `POST`, with a `_method` parameter containing the true HTTP method,
9597
+ // as well as all requests with the body as `application/x-www-form-urlencoded`
9598
+ // instead of `application/json` with the model in a param named `model`.
9599
+ // Useful when interfacing with server-side languages like **PHP** that make
9600
+ // it difficult to read the body of `PUT` requests.
9601
+ Backbone.sync = function(method, model, options) {
9602
+ var type = methodMap[method];
9603
 
9604
+ // Default options, unless specified.
9605
+ _.defaults(options || (options = {}), {
9606
+ emulateHTTP: Backbone.emulateHTTP,
9607
+ emulateJSON: Backbone.emulateJSON
9608
+ });
9609
 
9610
+ // Default JSON-request options.
9611
+ var params = {type: type, dataType: 'json'};
9612
+
9613
+ // Ensure that we have a URL.
9614
+ if (!options.url) {
9615
+ params.url = _.result(model, 'url') || urlError();
9616
  }
9617
 
9618
+ // Ensure that we have the appropriate request data.
9619
+ if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
9620
+ params.contentType = 'application/json';
9621
+ params.data = JSON.stringify(options.attrs || model.toJSON(options));
 
 
9622
  }
9623
 
9624
+ // For older servers, emulate JSON by encoding the request into an HTML-form.
9625
+ if (options.emulateJSON) {
9626
+ params.contentType = 'application/x-www-form-urlencoded';
9627
+ params.data = params.data ? {model: params.data} : {};
9628
  }
9629
 
9630
+ // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
9631
+ // And an `X-HTTP-Method-Override` header.
9632
+ if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
9633
+ params.type = 'POST';
9634
+ if (options.emulateJSON) params.data._method = type;
9635
+ var beforeSend = options.beforeSend;
9636
+ options.beforeSend = function(xhr) {
9637
+ xhr.setRequestHeader('X-HTTP-Method-Override', type);
9638
+ if (beforeSend) return beforeSend.apply(this, arguments);
9639
+ };
9640
  }
9641
 
9642
+ // Don't process data on a non-GET request.
9643
+ if (params.type !== 'GET' && !options.emulateJSON) {
9644
+ params.processData = false;
9645
+ }
9646
 
9647
+ // Pass along `textStatus` and `errorThrown` from jQuery.
9648
+ var error = options.error;
9649
+ options.error = function(xhr, textStatus, errorThrown) {
9650
+ options.textStatus = textStatus;
9651
+ options.errorThrown = errorThrown;
9652
+ if (error) error.call(options.context, xhr, textStatus, errorThrown);
9653
+ };
 
 
9654
 
9655
+ // Make the request, allowing the user to override any Ajax options.
9656
+ var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
9657
+ model.trigger('request', model, xhr, options);
9658
+ return xhr;
9659
+ };
 
 
 
 
 
 
 
 
9660
 
9661
+ // Map from CRUD to HTTP for our default `Backbone.sync` implementation.
9662
+ var methodMap = {
9663
+ 'create': 'POST',
9664
+ 'update': 'PUT',
9665
+ 'patch': 'PATCH',
9666
+ 'delete': 'DELETE',
9667
+ 'read': 'GET'
9668
+ };
9669
 
9670
+ // Set the default implementation of `Backbone.ajax` to proxy through to `$`.
9671
+ // Override this if you'd like to use a different library.
9672
+ Backbone.ajax = function() {
9673
+ return Backbone.$.ajax.apply(Backbone.$, arguments);
9674
+ };
9675
 
9676
+ // Backbone.Router
9677
+ // ---------------
9678
 
9679
+ // Routers map faux-URLs to actions, and fire events when routes are
9680
+ // matched. Creating a new one sets its `routes` hash, if not set statically.
9681
+ var Router = Backbone.Router = function(options) {
9682
+ options || (options = {});
9683
+ if (options.routes) this.routes = options.routes;
9684
+ this._bindRoutes();
9685
+ this.initialize.apply(this, arguments);
9686
+ };
9687
 
9688
+ // Cached regular expressions for matching named param parts and splatted
9689
+ // parts of route strings.
9690
+ var optionalParam = /\((.*?)\)/g;
9691
+ var namedParam = /(\(\?)?:\w+/g;
9692
+ var splatParam = /\*\w+/g;
9693
+ var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
9694
 
9695
+ // Set up all inheritable **Backbone.Router** properties and methods.
9696
+ _.extend(Router.prototype, Events, {
 
 
 
 
 
 
 
 
 
 
 
9697
 
9698
+ // Initialize is an empty function by default. Override it with your own
9699
+ // initialization logic.
9700
+ initialize: function(){},
9701
 
9702
+ // Manually bind a single named route to a callback. For example:
9703
+ //
9704
+ // this.route('search/:query/p:num', 'search', function(query, num) {
9705
+ // ...
9706
+ // });
9707
+ //
9708
+ route: function(route, name, callback) {
9709
+ if (!_.isRegExp(route)) route = this._routeToRegExp(route);
9710
+ if (_.isFunction(name)) {
9711
+ callback = name;
9712
+ name = '';
9713
+ }
9714
+ if (!callback) callback = this[name];
9715
+ var router = this;
9716
+ Backbone.history.route(route, function(fragment) {
9717
+ var args = router._extractParameters(route, fragment);
9718
+ if (router.execute(callback, args, name) !== false) {
9719
+ router.trigger.apply(router, ['route:' + name].concat(args));
9720
+ router.trigger('route', name, args);
9721
+ Backbone.history.trigger('route', router, name, args);
9722
+ }
9723
+ });
9724
+ return this;
9725
+ },
9726
 
9727
+ // Execute a route handler with the provided parameters. This is an
9728
+ // excellent place to do pre-route setup or post-route cleanup.
9729
+ execute: function(callback, args, name) {
9730
+ if (callback) callback.apply(this, args);
9731
+ },
9732
 
9733
+ // Simple proxy to `Backbone.history` to save a fragment into the history.
9734
+ navigate: function(fragment, options) {
9735
+ Backbone.history.navigate(fragment, options);
9736
+ return this;
9737
+ },
9738
 
9739
+ // Bind all defined routes to `Backbone.history`. We have to reverse the
9740
+ // order of the routes here to support behavior where the most general
9741
+ // routes can be defined at the bottom of the route map.
9742
+ _bindRoutes: function() {
9743
+ if (!this.routes) return;
9744
+ this.routes = _.result(this, 'routes');
9745
+ var route, routes = _.keys(this.routes);
9746
+ while ((route = routes.pop()) != null) {
9747
+ this.route(route, this.routes[route]);
9748
+ }
9749
+ },
9750
 
9751
+ // Convert a route string into a regular expression, suitable for matching
9752
+ // against the current location hash.
9753
+ _routeToRegExp: function(route) {
9754
+ route = route.replace(escapeRegExp, '\\$&')
9755
+ .replace(optionalParam, '(?:$1)?')
9756
+ .replace(namedParam, function(match, optional) {
9757
+ return optional ? match : '([^/?]+)';
9758
+ })
9759
+ .replace(splatParam, '([^?]*?)');
9760
+ return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$');
9761
+ },
9762
 
9763
+ // Given a route, and a URL fragment that it matches, return the array of
9764
+ // extracted decoded parameters. Empty or unmatched parameters will be
9765
+ // treated as `null` to normalize cross-browser behavior.
9766
+ _extractParameters: function(route, fragment) {
9767
+ var params = route.exec(fragment).slice(1);
9768
+ return _.map(params, function(param, i) {
9769
+ // Don't decode the search params.
9770
+ if (i === params.length - 1) return param || null;
9771
+ return param ? decodeURIComponent(param) : null;
9772
+ });
9773
+ }
9774
 
9775
+ });
9776
 
9777
+ // Backbone.History
9778
+ // ----------------
9779
 
9780
+ // Handles cross-browser history management, based on either
9781
+ // [pushState](http://diveintohtml5.info/history.html) and real URLs, or
9782
+ // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
9783
+ // and URL fragments. If the browser supports neither (old IE, natch),
9784
+ // falls back to polling.
9785
+ var History = Backbone.History = function() {
9786
+ this.handlers = [];
9787
+ this.checkUrl = _.bind(this.checkUrl, this);
9788
 
9789
+ // Ensure that `History` can be used outside of the browser.
9790
+ if (typeof window !== 'undefined') {
9791
+ this.location = window.location;
9792
+ this.history = window.history;
9793
+ }
9794
+ };
9795
 
9796
+ // Cached regex for stripping a leading hash/slash and trailing space.
9797
+ var routeStripper = /^[#\/]|\s+$/g;
9798
 
9799
+ // Cached regex for stripping leading and trailing slashes.
9800
+ var rootStripper = /^\/+|\/+$/g;
9801
 
9802
+ // Cached regex for stripping urls of hash.
9803
+ var pathStripper = /#.*$/;
9804
 
9805
+ // Has the history handling already been started?
9806
+ History.started = false;
9807
 
9808
+ // Set up all inheritable **Backbone.History** properties and methods.
9809
+ _.extend(History.prototype, Events, {
9810
 
9811
+ // The default interval to poll for hash changes, if necessary, is
9812
+ // twenty times a second.
9813
+ interval: 50,
9814
 
9815
+ // Are we at the app root?
9816
+ atRoot: function() {
9817
+ var path = this.location.pathname.replace(/[^\/]$/, '$&/');
9818
+ return path === this.root && !this.getSearch();
9819
+ },
9820
 
9821
+ // Does the pathname match the root?
9822
+ matchRoot: function() {
9823
+ var path = this.decodeFragment(this.location.pathname);
9824
+ var rootPath = path.slice(0, this.root.length - 1) + '/';
9825
+ return rootPath === this.root;
9826
+ },
9827
 
9828
+ // Unicode characters in `location.pathname` are percent encoded so they're
9829
+ // decoded for comparison. `%25` should not be decoded since it may be part
9830
+ // of an encoded parameter.
9831
+ decodeFragment: function(fragment) {
9832
+ return decodeURI(fragment.replace(/%25/g, '%2525'));
9833
+ },
 
 
 
 
 
 
 
 
 
9834
 
9835
+ // In IE6, the hash fragment and search params are incorrect if the
9836
+ // fragment contains `?`.
9837
+ getSearch: function() {
9838
+ var match = this.location.href.replace(/#.*/, '').match(/\?.+/);
9839
+ return match ? match[0] : '';
9840
+ },
9841
 
9842
+ // Gets the true hash value. Cannot use location.hash directly due to bug
9843
+ // in Firefox where location.hash will always be decoded.
9844
+ getHash: function(window) {
9845
+ var match = (window || this).location.href.match(/#(.*)$/);
9846
+ return match ? match[1] : '';
9847
+ },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9848
 
9849
+ // Get the pathname and search params, without the root.
9850
+ getPath: function() {
9851
+ var path = this.decodeFragment(
9852
+ this.location.pathname + this.getSearch()
9853
+ ).slice(this.root.length - 1);
9854
+ return path.charAt(0) === '/' ? path.slice(1) : path;
9855
+ },
 
 
 
 
 
 
 
 
 
 
 
 
9856
 
9857
+ // Get the cross-browser normalized URL fragment from the path or hash.
9858
+ getFragment: function(fragment) {
9859
+ if (fragment == null) {
9860
+ if (this._usePushState || !this._wantsHashChange) {
9861
+ fragment = this.getPath();
9862
+ } else {
9863
+ fragment = this.getHash();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9864
  }
9865
+ }
9866
+ return fragment.replace(routeStripper, '');
9867
+ },
 
 
 
 
 
 
 
 
 
 
 
 
 
9868
 
9869
+ // Start the hash change handling, returning `true` if the current URL matches
9870
+ // an existing route, and `false` otherwise.
9871
+ start: function(options) {
9872
+ if (History.started) throw new Error('Backbone.history has already been started');
9873
+ History.started = true;
9874
 
9875
+ // Figure out the initial configuration. Do we need an iframe?
9876
+ // Is pushState desired ... is it available?
9877
+ this.options = _.extend({root: '/'}, this.options, options);
9878
+ this.root = this.options.root;
9879
+ this._wantsHashChange = this.options.hashChange !== false;
9880
+ this._hasHashChange = 'onhashchange' in window && (document.documentMode === void 0 || document.documentMode > 7);
9881
+ this._useHashChange = this._wantsHashChange && this._hasHashChange;
9882
+ this._wantsPushState = !!this.options.pushState;
9883
+ this._hasPushState = !!(this.history && this.history.pushState);
9884
+ this._usePushState = this._wantsPushState && this._hasPushState;
9885
+ this.fragment = this.getFragment();
9886
 
9887
+ // Normalize root to always include a leading and trailing slash.
9888
+ this.root = ('/' + this.root + '/').replace(rootStripper, '/');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9889
 
9890
+ // Transition from hashChange to pushState or vice versa if both are
9891
+ // requested.
9892
+ if (this._wantsHashChange && this._wantsPushState) {
 
 
 
 
 
 
 
 
 
 
 
 
 
9893
 
9894
+ // If we've started off with a route from a `pushState`-enabled
9895
+ // browser, but we're currently in a browser that doesn't support it...
9896
+ if (!this._hasPushState && !this.atRoot()) {
9897
+ var rootPath = this.root.slice(0, -1) || '/';
9898
+ this.location.replace(rootPath + '#' + this.getPath());
9899
+ // Return immediately as browser will do redirect to new url
9900
+ return true;
9901
+
9902
+ // Or if we've started out with a hash-based route, but we're currently
9903
+ // in a browser where it could be `pushState`-based instead...
9904
+ } else if (this._hasPushState && this.atRoot()) {
9905
+ this.navigate(this.getHash(), {replace: true});
9906
  }
 
 
 
 
9907
 
9908
+ }
 
 
 
9909
 
9910
+ // Proxy an iframe to handle location events if the browser doesn't
9911
+ // support the `hashchange` event, HTML5 history, or the user wants
9912
+ // `hashChange` but not `pushState`.
9913
+ if (!this._hasHashChange && this._wantsHashChange && !this._usePushState) {
9914
+ this.iframe = document.createElement('iframe');
9915
+ this.iframe.src = 'javascript:0';
9916
+ this.iframe.style.display = 'none';
9917
+ this.iframe.tabIndex = -1;
9918
+ var body = document.body;
9919
+ // Using `appendChild` will throw on IE < 9 if the document is not ready.
9920
+ var iWindow = body.insertBefore(this.iframe, body.firstChild).contentWindow;
9921
+ iWindow.document.open();
9922
+ iWindow.document.close();
9923
+ iWindow.location.hash = '#' + this.fragment;
9924
+ }
9925
 
9926
+ // Add a cross-platform `addEventListener` shim for older browsers.
9927
+ var addEventListener = window.addEventListener || function(eventName, listener) {
9928
+ return attachEvent('on' + eventName, listener);
9929
+ };
9930
 
9931
+ // Depending on whether we're using pushState or hashes, and whether
9932
+ // 'onhashchange' is supported, determine how we check the URL state.
9933
+ if (this._usePushState) {
9934
+ addEventListener('popstate', this.checkUrl, false);
9935
+ } else if (this._useHashChange && !this.iframe) {
9936
+ addEventListener('hashchange', this.checkUrl, false);
9937
+ } else if (this._wantsHashChange) {
9938
+ this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
9939
+ }
9940
 
9941
+ if (!this.options.silent) return this.loadUrl();
9942
+ },
 
 
 
 
 
 
 
 
 
9943
 
9944
+ // Disable Backbone.history, perhaps temporarily. Not useful in a real app,
9945
+ // but possibly useful for unit testing Routers.
9946
+ stop: function() {
9947
+ // Add a cross-platform `removeEventListener` shim for older browsers.
9948
+ var removeEventListener = window.removeEventListener || function(eventName, listener) {
9949
+ return detachEvent('on' + eventName, listener);
9950
+ };
9951
 
9952
+ // Remove window listeners.
9953
+ if (this._usePushState) {
9954
+ removeEventListener('popstate', this.checkUrl, false);
9955
+ } else if (this._useHashChange && !this.iframe) {
9956
+ removeEventListener('hashchange', this.checkUrl, false);
9957
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9958
 
9959
+ // Clean up the iframe if necessary.
9960
+ if (this.iframe) {
9961
+ document.body.removeChild(this.iframe);
9962
+ this.iframe = null;
9963
+ }
9964
 
9965
+ // Some environments will throw when clearing an undefined interval.
9966
+ if (this._checkUrlInterval) clearInterval(this._checkUrlInterval);
9967
+ History.started = false;
9968
+ },
 
 
 
 
 
 
 
 
 
 
9969
 
9970
+ // Add a route to be tested when the fragment changes. Routes added later
9971
+ // may override previous routes.
9972
+ route: function(route, callback) {
9973
+ this.handlers.unshift({route: route, callback: callback});
9974
+ },
 
 
9975
 
9976
+ // Checks the current URL to see if it has changed, and if it has,
9977
+ // calls `loadUrl`, normalizing across the hidden iframe.
9978
+ checkUrl: function(e) {
9979
+ var current = this.getFragment();
9980
 
9981
+ // If the user pressed the back button, the iframe's hash will have
9982
+ // changed and we should use that for comparison.
9983
+ if (current === this.fragment && this.iframe) {
9984
+ current = this.getHash(this.iframe.contentWindow);
9985
+ }
 
 
 
 
 
9986
 
9987
+ if (current === this.fragment) return false;
9988
+ if (this.iframe) this.navigate(current);
9989
+ this.loadUrl();
9990
+ },
 
 
9991
 
9992
+ // Attempt to load the current URL fragment. If a route succeeds with a
9993
+ // match, returns `true`. If no defined routes matches the fragment,
9994
+ // returns `false`.
9995
+ loadUrl: function(fragment) {
9996
+ // If the root doesn't match, no routes can match either.
9997
+ if (!this.matchRoot()) return false;
9998
+ fragment = this.fragment = this.getFragment(fragment);
9999
+ return _.some(this.handlers, function(handler) {
10000
+ if (handler.route.test(fragment)) {
10001
+ handler.callback(fragment);
10002
+ return true;
10003
+ }
10004
+ });
10005
+ },
10006
 
10007
+ // Save a fragment into the hash history, or replace the URL state if the
10008
+ // 'replace' option is passed. You are responsible for properly URL-encoding
10009
+ // the fragment in advance.
10010
+ //
10011
+ // The options object can contain `trigger: true` if you wish to have the
10012
+ // route callback be fired (not usually desirable), or `replace: true`, if
10013
+ // you wish to modify the current URL without adding an entry to the history.
10014
+ navigate: function(fragment, options) {
10015
+ if (!History.started) return false;
10016
+ if (!options || options === true) options = {trigger: !!options};
10017
 
10018
+ // Normalize the fragment.
10019
+ fragment = this.getFragment(fragment || '');
 
 
 
10020
 
10021
+ // Don't include a trailing slash on the root.
10022
+ var rootPath = this.root;
10023
+ if (fragment === '' || fragment.charAt(0) === '?') {
10024
+ rootPath = rootPath.slice(0, -1) || '/';
10025
+ }
10026
+ var url = rootPath + fragment;
 
 
 
 
 
 
 
 
 
10027
 
10028
+ // Strip the hash and decode for matching.
10029
+ fragment = this.decodeFragment(fragment.replace(pathStripper, ''));
 
 
10030
 
10031
+ if (this.fragment === fragment) return;
10032
+ this.fragment = fragment;
10033
 
10034
+ // If pushState is available, we use it to set the fragment as a real URL.
10035
+ if (this._usePushState) {
10036
+ this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);
10037
+
10038
+ // If hash changes haven't been explicitly disabled, update the hash
10039
+ // fragment to store history.
10040
+ } else if (this._wantsHashChange) {
10041
+ this._updateHash(this.location, fragment, options.replace);
10042
+ if (this.iframe && fragment !== this.getHash(this.iframe.contentWindow)) {
10043
+ var iWindow = this.iframe.contentWindow;
10044
+
10045
+ // Opening and closing the iframe tricks IE7 and earlier to push a
10046
+ // history entry on hash-tag change. When replace is true, we don't
10047
+ // want this.
10048
+ if (!options.replace) {
10049
+ iWindow.document.open();
10050
+ iWindow.document.close();
10051
+ }
10052
+
10053
+ this._updateHash(iWindow.location, fragment, options.replace);
10054
  }
10055
+
10056
+ // If you've told us that you explicitly don't want fallback hashchange-
10057
+ // based history, then `navigate` becomes a page refresh.
10058
+ } else {
10059
+ return this.location.assign(url);
10060
+ }
10061
+ if (options.trigger) return this.loadUrl(fragment);
10062
+ },
10063
+
10064
+ // Update the hash location, either replacing the current entry, or adding
10065
+ // a new one to the browser history.
10066
+ _updateHash: function(location, fragment, replace) {
10067
+ if (replace) {
10068
+ var href = location.href.replace(/(javascript:|#).*$/, '');
10069
+ location.replace(href + '#' + fragment);
10070
+ } else {
10071
+ // Some browsers require that `hash` contains a leading #.
10072
+ location.hash = '#' + fragment;
10073
+ }
10074
  }
10075
 
10076
+ });
10077
+
10078
+ // Create the default Backbone.history.
10079
+ Backbone.history = new History;
10080
+
10081
+ // Helpers
10082
+ // -------
10083
+
10084
+ // Helper function to correctly set up the prototype chain for subclasses.
10085
+ // Similar to `goog.inherits`, but uses a hash of prototype properties and
10086
+ // class properties to be extended.
10087
+ var extend = function(protoProps, staticProps) {
10088
+ var parent = this;
10089
+ var child;
10090
+
10091
+ // The constructor function for the new subclass is either defined by you
10092
+ // (the "constructor" property in your `extend` definition), or defaulted
10093
+ // by us to simply call the parent constructor.
10094
+ if (protoProps && _.has(protoProps, 'constructor')) {
10095
+ child = protoProps.constructor;
10096
  } else {
10097
+ child = function(){ return parent.apply(this, arguments); };
10098
  }
10099
 
10100
+ // Add static properties to the constructor function, if supplied.
10101
+ _.extend(child, parent, staticProps);
10102
 
10103
+ // Set the prototype chain to inherit from `parent`, without calling
10104
+ // `parent`'s constructor function and add the prototype properties.
10105
+ child.prototype = _.create(parent.prototype, protoProps);
10106
+ child.prototype.constructor = child;
 
10107
 
10108
+ // Set a convenience property in case the parent's prototype is needed
10109
+ // later.
10110
+ child.__super__ = parent.prototype;
10111
 
10112
+ return child;
10113
+ };
 
10114
 
10115
+ // Set up inheritance for the model, collection, router, view and history.
10116
+ Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
 
 
 
10117
 
10118
+ // Throw an error when a URL is needed, and none is supplied.
10119
+ var urlError = function() {
10120
+ throw new Error('A "url" property or function must be specified');
10121
+ };
 
10122
 
10123
+ // Wrap an optional error callback with a fallback error event.
10124
+ var wrapError = function(model, options) {
10125
+ var error = options.error;
10126
+ options.error = function(resp) {
10127
+ if (error) error.call(options.context, model, resp, options);
10128
+ model.trigger('error', model, resp, options);
10129
+ };
10130
+ };
10131
 
10132
+ return Backbone;
10133
+ });
 
10134
 
10135
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
10136
 
10137
+ /***/ }),
 
 
 
 
 
 
 
 
10138
 
10139
+ /***/ 479:
10140
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
10141
 
10142
+ "use strict";
 
 
 
 
10143
 
 
 
 
 
 
 
10144
 
10145
+ var _react = __webpack_require__(2);
 
10146
 
10147
+ var _react2 = _interopRequireDefault(_react);
 
 
 
 
 
 
 
 
 
 
 
 
10148
 
10149
+ var _reactRouter = __webpack_require__(25);
10150
 
10151
+ var _classnames = __webpack_require__(19);
 
10152
 
10153
+ var _classnames2 = _interopRequireDefault(_classnames);
 
 
10154
 
10155
+ var _mailpoet = __webpack_require__(3);
 
 
 
 
 
 
 
 
 
 
10156
 
10157
+ var _mailpoet2 = _interopRequireDefault(_mailpoet);
 
 
 
10158
 
10159
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
10160
 
10161
+ var tabs = [{
10162
+ name: 'knowledgeBase',
10163
+ label: _mailpoet2.default.I18n.t('tabKnowledgeBaseTitle'),
10164
+ link: '/knowledgeBase'
10165
+ }, {
10166
+ name: 'systemStatus',
10167
+ label: _mailpoet2.default.I18n.t('tabSystemStatusTitle'),
10168
+ link: '/systemStatus'
10169
+ }, {
10170
+ name: 'systemInfo',
10171
+ label: _mailpoet2.default.I18n.t('tabSystemInfoTitle'),
10172
+ link: '/systemInfo'
10173
+ }];
10174
 
10175
+ function Tabs(props) {
10176
+ var tabLinks = tabs.map(function (tab) {
10177
+ var tabClasses = (0, _classnames2.default)('nav-tab', { 'nav-tab-active': props.tab === tab.name });
 
 
 
 
 
10178
 
10179
+ return _react2.default.createElement(
10180
+ _reactRouter.Link,
10181
+ {
10182
+ key: 'tab-' + tab.name,
10183
+ className: tabClasses,
10184
+ to: tab.link
10185
+ },
10186
+ tab.label
10187
+ );
10188
+ });
10189
 
10190
+ return _react2.default.createElement(
10191
+ 'h2',
10192
+ { className: 'nav-tab-wrapper' },
10193
+ tabLinks
10194
+ );
10195
+ }
10196
 
10197
+ Tabs.propTypes = { tab: _react2.default.PropTypes.string };
10198
+ Tabs.defaultProps = { tab: 'knowledgeBase' };
 
 
 
 
10199
 
10200
+ module.exports = Tabs;
 
 
 
 
 
10201
 
10202
+ /***/ }),
 
 
10203
 
10204
+ /***/ 516:
10205
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
10206
 
10207
+ "use strict";
 
 
10208
 
 
 
 
10209
 
10210
+ exports.__esModule = true;
 
 
10211
 
10212
+ 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; }; })();
 
10213
 
10214
+ exports.confirmAlert = confirmAlert;
 
10215
 
10216
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
 
 
10217
 
10218
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
10219
 
10220
+ function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
10221
 
10222
+ var _react = __webpack_require__(2);
 
 
 
10223
 
10224
+ var _react2 = _interopRequireDefault(_react);
10225
 
10226
+ var _propTypes = __webpack_require__(12);
10227
 
10228
+ var _propTypes2 = _interopRequireDefault(_propTypes);
10229
 
10230
+ var _reactDom = __webpack_require__(30);
10231
 
10232
+ var ReactConfirmAlert = (function (_Component) {
10233
+ _inherits(ReactConfirmAlert, _Component);
10234
 
10235
+ function ReactConfirmAlert() {
10236
+ var _this = this;
10237
 
10238
+ _classCallCheck(this, ReactConfirmAlert);
 
 
10239
 
10240
+ _Component.apply(this, arguments);
 
 
 
 
 
 
10241
 
10242
+ this.onClickConfirm = function () {
10243
+ _this.props.onConfirm();
10244
+ _this.close();
10245
+ };
10246
 
10247
+ this.onClickCancel = function () {
10248
+ _this.props.onCancel();
10249
+ _this.close();
10250
+ };
 
 
 
10251
 
10252
+ this.close = function () {
10253
+ removeElementReconfirm();
10254
+ removeSVGBlurReconfirm();
10255
+ };
10256
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10257
 
10258
+ ReactConfirmAlert.prototype.render = function render() {
10259
+ var _props = this.props;
10260
+ var title = _props.title;
10261
+ var message = _props.message;
10262
+ var confirmLabel = _props.confirmLabel;
10263
+ var cancelLabel = _props.cancelLabel;
10264
+ var childrenElement = _props.childrenElement;
 
 
 
 
10265
 
10266
+ return _react2['default'].createElement(
10267
+ 'div',
10268
+ { className: 'react-confirm-alert-overlay' },
10269
+ _react2['default'].createElement(
10270
+ 'div',
10271
+ { className: 'react-confirm-alert' },
10272
+ title && _react2['default'].createElement(
10273
+ 'h1',
10274
+ null,
10275
+ title
10276
+ ),
10277
+ message && _react2['default'].createElement(
10278
+ 'h3',
10279
+ null,
10280
+ message
10281
+ ),
10282
+ childrenElement(),
10283
+ _react2['default'].createElement(
10284
+ 'div',
10285
+ { className: 'react-confirm-alert-button-group' },
10286
+ cancelLabel && _react2['default'].createElement(
10287
+ 'button',
10288
+ { onClick: this.onClickCancel },
10289
+ cancelLabel
10290
+ ),
10291
+ confirmLabel && _react2['default'].createElement(
10292
+ 'button',
10293
+ { onClick: this.onClickConfirm },
10294
+ confirmLabel
10295
+ )
10296
+ )
10297
+ )
10298
+ );
10299
+ };
10300
 
10301
+ _createClass(ReactConfirmAlert, null, [{
10302
+ key: 'propTypes',
10303
+ value: {
10304
+ title: _propTypes2['default'].string,
10305
+ message: _propTypes2['default'].string,
10306
+ confirmLabel: _propTypes2['default'].string,
10307
+ cancelLabel: _propTypes2['default'].string,
10308
+ onConfirm: _propTypes2['default'].func,
10309
+ onCancel: _propTypes2['default'].func,
10310
+ children: _propTypes2['default'].node
10311
+ },
10312
+ enumerable: true
10313
+ }, {
10314
+ key: 'defaultProps',
10315
+ value: {
10316
+ title: false,
10317
+ message: false,
10318
+ childrenElement: function childrenElement() {
10319
+ return null;
10320
+ },
10321
+ confirmLabel: false,
10322
+ cancelLabel: false,
10323
+ onConfirm: function onConfirm() {
10324
+ return null;
10325
+ },
10326
+ onCancel: function onCancel() {
10327
+ return null;
10328
+ }
10329
+ },
10330
+ enumerable: true
10331
+ }]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10332
 
10333
+ return ReactConfirmAlert;
10334
+ })(_react.Component);
 
10335
 
10336
+ exports['default'] = ReactConfirmAlert;
 
 
 
 
 
 
 
 
 
10337
 
10338
+ function createSVGBlurReconfirm() {
10339
+ var svgNS = 'http://www.w3.org/2000/svg';
10340
+ var feGaussianBlur = document.createElementNS(svgNS, 'feGaussianBlur');
10341
+ feGaussianBlur.setAttribute('stdDeviation', '0.7');
 
 
 
 
 
 
 
 
 
 
 
 
10342
 
10343
+ var filter = document.createElementNS(svgNS, 'filter');
10344
+ filter.setAttribute('id', 'gaussian-blur');
10345
+ filter.appendChild(feGaussianBlur);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10346
 
10347
+ var svgElem = document.createElementNS(svgNS, 'svg');
10348
+ svgElem.setAttribute('id', 'react-confirm-alert-firm-svg');
10349
+ svgElem.setAttribute('class', 'react-confirm-alert-svg');
10350
+ svgElem.appendChild(filter);
 
 
 
 
 
 
 
 
 
 
 
 
 
10351
 
10352
+ document.body.appendChild(svgElem);
10353
+ }
10354
 
10355
+ function removeSVGBlurReconfirm() {
10356
+ var svg = document.getElementById('react-confirm-alert-firm-svg');
10357
+ svg.parentNode.removeChild(svg);
10358
+ document.body.children[0].classList.remove('react-confirm-alert-blur');
10359
+ }
10360
 
10361
+ function createElementReconfirm(properties) {
10362
+ document.body.children[0].classList.add('react-confirm-alert-blur');
10363
+ var divTarget = document.createElement('div');
10364
+ divTarget.id = 'react-confirm-alert';
10365
+ document.body.appendChild(divTarget);
10366
+ _reactDom.render(_react2['default'].createElement(ReactConfirmAlert, properties), divTarget);
10367
+ }
10368
 
10369
+ function removeElementReconfirm() {
10370
+ var target = document.getElementById('react-confirm-alert');
10371
+ _reactDom.unmountComponentAtNode(target);
10372
+ target.parentNode.removeChild(target);
10373
+ }
10374
 
10375
+ function confirmAlert(properties) {
10376
+ createSVGBlurReconfirm();
10377
+ createElementReconfirm(properties);
10378
+ }
 
 
 
10379
 
10380
+ /***/ }),
 
10381
 
10382
+ /***/ 517:
10383
+ /***/ (function(module, exports, __webpack_require__) {
 
10384
 
10385
+ "use strict";
 
 
 
 
 
 
 
 
10386
 
 
 
 
10387
 
10388
+ var _underscore = __webpack_require__(7);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10389
 
10390
+ var _underscore2 = _interopRequireDefault(_underscore);
 
 
10391
 
10392
+ var _react = __webpack_require__(2);
10393
 
10394
+ var _react2 = _interopRequireDefault(_react);
10395
 
10396
+ var _select = __webpack_require__(470);
 
 
 
10397
 
10398
+ var _select2 = _interopRequireDefault(_select);
10399
 
10400
+ var _common = __webpack_require__(472);
10401
 
10402
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10403
 
10404
+ var intervalField = {
10405
+ name: 'intervalType',
10406
+ values: _common.intervalValues
10407
  };
10408
 
10409
+ var timeOfDayField = {
10410
+ name: 'timeOfDay',
10411
+ values: _common.timeOfDayValues
 
 
 
 
 
10412
  };
10413
 
10414
+ var weekDayField = {
10415
+ name: 'weekDay',
10416
+ values: _common.weekDayValues
10417
+ };
10418
 
10419
+ var monthDayField = {
10420
+ name: 'monthDay',
10421
+ values: _common.monthDayValues
10422
+ };
10423
 
10424
+ var nthWeekDayField = {
10425
+ name: 'nthWeekDay',
10426
+ values: _common.nthWeekDayValues
10427
+ };
 
10428
 
10429
+ var NotificationScheduling = _react2.default.createClass({
10430
+ displayName: 'NotificationScheduling',
 
 
 
 
 
10431
 
10432
+ getCurrentValue: function getCurrentValue() {
10433
+ return this.props.item[this.props.field.name] || {};
10434
+ },
10435
+ handleValueChange: function handleValueChange(name, value) {
10436
+ var oldValue = this.getCurrentValue();
10437
+ var newValue = {};
10438
 
10439
+ newValue[name] = value;
10440
+
10441
+ return this.props.onValueChange({
10442
+ target: {
10443
+ name: this.props.field.name,
10444
+ value: _underscore2.default.extend({}, oldValue, newValue)
10445
+ }
10446
+ });
10447
+ },
10448
+ handleIntervalChange: function handleIntervalChange(event) {
10449
+ return this.handleValueChange('intervalType', event.target.value);
10450
+ },
10451
+ handleTimeOfDayChange: function handleTimeOfDayChange(event) {
10452
+ return this.handleValueChange('timeOfDay', event.target.value);
10453
+ },
10454
+ handleWeekDayChange: function handleWeekDayChange(event) {
10455
+ return this.handleValueChange('weekDay', event.target.value);
10456
+ },
10457
+ handleMonthDayChange: function handleMonthDayChange(event) {
10458
+ return this.handleValueChange('monthDay', event.target.value);
10459
+ },
10460
+ handleNthWeekDayChange: function handleNthWeekDayChange(event) {
10461
+ return this.handleValueChange('nthWeekDay', event.target.value);
10462
+ },
10463
+ render: function render() {
10464
+ var value = this.getCurrentValue();
10465
+ var timeOfDaySelection = void 0;
10466
+ var weekDaySelection = void 0;
10467
+ var monthDaySelection = void 0;
10468
+ var nthWeekDaySelection = void 0;
10469
+
10470
+ if (value.intervalType !== 'immediately') {
10471
+ timeOfDaySelection = _react2.default.createElement(_select2.default, {
10472
+ field: timeOfDayField,
10473
+ item: this.getCurrentValue(),
10474
+ onValueChange: this.handleTimeOfDayChange
10475
+ });
10476
  }
 
10477
 
10478
+ if (value.intervalType === 'weekly' || value.intervalType === 'nthWeekDay') {
10479
+ weekDaySelection = _react2.default.createElement(_select2.default, {
10480
+ field: weekDayField,
10481
+ item: this.getCurrentValue(),
10482
+ onValueChange: this.handleWeekDayChange
10483
+ });
10484
  }
10485
 
10486
+ if (value.intervalType === 'monthly') {
10487
+ monthDaySelection = _react2.default.createElement(_select2.default, {
10488
+ field: monthDayField,
10489
+ item: this.getCurrentValue(),
10490
+ onValueChange: this.handleMonthDayChange
10491
+ });
10492
+ }
10493
 
10494
+ if (value.intervalType === 'nthWeekDay') {
10495
+ nthWeekDaySelection = _react2.default.createElement(_select2.default, {
10496
+ field: nthWeekDayField,
10497
+ item: this.getCurrentValue(),
10498
+ onValueChange: this.handleNthWeekDayChange
10499
+ });
10500
+ }
10501
 
10502
+ return _react2.default.createElement(
10503
+ 'div',
10504
+ null,
10505
+ _react2.default.createElement(_select2.default, {
10506
+ field: intervalField,
10507
+ item: this.getCurrentValue(),
10508
+ onValueChange: this.handleIntervalChange,
10509
+ automationId: 'newsletter_interval_type'
10510
+ }),
10511
+ nthWeekDaySelection,
10512
+ monthDaySelection,
10513
+ weekDaySelection,
10514
+ timeOfDaySelection
10515
+ );
10516
+ }
10517
+ });
10518
 
10519
+ module.exports = NotificationScheduling;
 
 
 
 
10520
 
10521
+ /***/ }),
 
 
 
 
 
 
10522
 
10523
+ /***/ 518:
10524
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
10525
 
10526
+ "use strict";
 
 
 
 
 
10527
 
 
 
 
 
 
 
10528
 
10529
+ var _react = __webpack_require__(2);
 
 
 
10530
 
10531
+ var _react2 = _interopRequireDefault(_react);
 
 
 
10532
 
10533
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
 
 
 
10534
 
10535
+ var KeyValueTable = function KeyValueTable(props) {
10536
+ return _react2.default.createElement(
10537
+ 'table',
10538
+ { className: 'widefat fixed', style: { maxWidth: props.max_width } },
10539
+ _react2.default.createElement(
10540
+ 'tbody',
10541
+ null,
10542
+ props.rows.map(function (row) {
10543
+ return _react2.default.createElement(
10544
+ 'tr',
10545
+ { key: 'row_' + row.key },
10546
+ _react2.default.createElement(
10547
+ 'td',
10548
+ { className: 'row-title' },
10549
+ row.key
10550
+ ),
10551
+ _react2.default.createElement(
10552
+ 'td',
10553
+ null,
10554
+ row.value
10555
+ )
10556
+ );
10557
+ })
10558
+ )
10559
+ );
10560
+ };
10561
 
10562
+ KeyValueTable.propTypes = {
10563
+ max_width: _react2.default.PropTypes.string,
10564
+ rows: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.shape({
10565
+ key: _react2.default.PropTypes.string.isRequired,
10566
+ value: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.number, _react2.default.PropTypes.element]).isRequired
10567
+ })).isRequired
10568
  };
10569
 
10570
+ KeyValueTable.defaultProps = {
10571
+ max_width: 'auto'
10572
+ };
 
10573
 
10574
+ module.exports = KeyValueTable;
 
10575
 
10576
+ /***/ }),
 
 
 
 
 
10577
 
10578
+ /***/ 519:
10579
+ /***/ (function(module, exports, __webpack_require__) {
10580
 
10581
+ "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
10582
 
 
 
 
 
 
 
 
 
10583
 
10584
+ var _react = __webpack_require__(2);
 
 
 
 
 
 
 
 
 
10585
 
10586
+ var _react2 = _interopRequireDefault(_react);
 
 
 
 
 
 
10587
 
10588
+ var _mailpoet = __webpack_require__(3);
 
 
 
 
 
10589
 
10590
+ var _mailpoet2 = _interopRequireDefault(_mailpoet);
 
 
 
 
 
 
 
 
 
 
 
10591
 
10592
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10593
 
10594
+ var TasksListDataRow = function TasksListDataRow(props) {
10595
+ return _react2.default.createElement(
10596
+ 'tr',
10597
+ null,
10598
+ _react2.default.createElement(
10599
+ 'td',
10600
+ { className: 'column column-primary' },
10601
+ props.task.id
10602
+ ),
10603
+ _react2.default.createElement(
10604
+ 'td',
10605
+ { className: 'column' },
10606
+ props.task.type
10607
+ ),
10608
+ _react2.default.createElement(
10609
+ 'td',
10610
+ { className: 'column' },
10611
+ props.task.newsletter ? _react2.default.createElement(
10612
+ 'a',
10613
+ {
10614
+ href: props.task.newsletter.preview_url,
10615
+ 'data-newsletter-id': props.task.newsletter.newsletter_id,
10616
+ 'data-queue-id': props.task.newsletter.queue_id,
10617
+ target: '_blank'
10618
+ },
10619
+ props.task.newsletter.subject || _mailpoet2.default.I18n.t('preview')
10620
+ ) : _mailpoet2.default.I18n.t('none')
10621
+ ),
10622
+ _react2.default.createElement(
10623
+ 'td',
10624
+ { className: 'column' },
10625
+ props.task.priority
10626
+ ),
10627
+ props.show_scheduled_at ? _react2.default.createElement(
10628
+ 'td',
10629
+ { className: 'column-date' },
10630
+ _react2.default.createElement(
10631
+ 'abbr',
10632
+ null,
10633
+ _mailpoet2.default.Date.format(props.task.scheduled_at * 1000)
10634
+ )
10635
+ ) : null,
10636
+ _react2.default.createElement(
10637
+ 'td',
10638
+ { className: 'column-date' },
10639
+ _react2.default.createElement(
10640
+ 'abbr',
10641
+ null,
10642
+ _mailpoet2.default.Date.format(props.task.updated_at * 1000)
10643
+ )
10644
+ )
10645
+ );
10646
+ };
10647
 
10648
+ TasksListDataRow.propTypes = {
10649
+ show_scheduled_at: _react2.default.PropTypes.bool,
10650
+ task: _react2.default.PropTypes.shape({
10651
+ id: _react2.default.PropTypes.number.isRequired,
10652
+ type: _react2.default.PropTypes.string.isRequired,
10653
+ priority: _react2.default.PropTypes.number.isRequired,
10654
+ updated_at: _react2.default.PropTypes.number.isRequired,
10655
+ scheduled_at: _react2.default.PropTypes.number,
10656
+ status: _react2.default.PropTypes.string,
10657
+ newsletter: _react2.default.PropTypes.shape({
10658
+ newsletter_id: _react2.default.PropTypes.number.isRequired,
10659
+ queue_id: _react2.default.PropTypes.number.isRequired,
10660
+ preview_url: _react2.default.PropTypes.string.isRequired,
10661
+ subject: _react2.default.PropTypes.string
10662
+ })
10663
+ }).isRequired
10664
+ };
10665
 
10666
+ TasksListDataRow.defaultProps = {
10667
+ show_scheduled_at: false,
10668
+ task: {
10669
+ newsletter: null
10670
+ }
10671
+ };
 
 
10672
 
10673
+ module.exports = TasksListDataRow;
 
 
 
 
 
 
 
 
10674
 
10675
+ /***/ }),
 
 
10676
 
10677
+ /***/ 629:
10678
+ /***/ (function(module, exports, __webpack_require__) {
 
 
10679
 
10680
+ __webpack_require__(630);
10681
+ __webpack_require__(634);
10682
+ __webpack_require__(652);
10683
+ __webpack_require__(656);
10684
+ __webpack_require__(658);
10685
+ __webpack_require__(659);
10686
+ __webpack_require__(668);
10687
+ __webpack_require__(669);
10688
+ __webpack_require__(670);
10689
+ __webpack_require__(673);
10690
+ module.exports = __webpack_require__(674);
10691
 
 
 
 
10692
 
10693
+ /***/ }),
 
10694
 
10695
+ /***/ 630:
10696
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
 
 
 
 
 
10697
 
10698
+ "use strict";
 
 
 
 
 
 
 
 
 
 
10699
 
 
 
 
10700
 
10701
+ var _react = __webpack_require__(2);
 
 
 
 
 
10702
 
10703
+ var _react2 = _interopRequireDefault(_react);
 
10704
 
10705
+ var _reactDom = __webpack_require__(30);
 
 
10706
 
10707
+ var _reactDom2 = _interopRequireDefault(_reactDom);
10708
 
10709
+ var _reactRouter = __webpack_require__(25);
 
10710
 
10711
+ var _history = __webpack_require__(94);
10712
 
10713
+ var _list = __webpack_require__(631);
 
 
 
10714
 
10715
+ var _list2 = _interopRequireDefault(_list);
10716
 
10717
+ var _form = __webpack_require__(632);
 
 
 
10718
 
10719
+ var _form2 = _interopRequireDefault(_form);
 
 
 
 
 
 
 
10720
 
10721
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
10722
 
10723
+ var history = (0, _reactRouter.useRouterHistory)(_history.createHashHistory)({ queryKey: false });
 
 
 
10724
 
10725
+ var App = _react2.default.createClass({
10726
+ displayName: 'App',
10727
+ render: function render() {
10728
+ return this.props.children;
10729
+ }
10730
+ });
10731
 
10732
+ var container = document.getElementById('subscribers_container');
 
10733
 
10734
+ if (container) {
10735
+ _reactDom2.default.render(_react2.default.createElement(
10736
+ _reactRouter.Router,
10737
+ { history: history },
10738
+ _react2.default.createElement(
10739
+ _reactRouter.Route,
10740
+ { path: '/', component: App },
10741
+ _react2.default.createElement(_reactRouter.IndexRoute, { component: _list2.default }),
10742
+ _react2.default.createElement(_reactRouter.Route, { path: 'new', component: _form2.default }),
10743
+ _react2.default.createElement(_reactRouter.Route, { path: 'edit/:id', component: _form2.default }),
10744
+ _react2.default.createElement(_reactRouter.Route, { path: '*', component: _list2.default })
10745
+ )
10746
+ ), container);
10747
+ }
10748
 
10749
+ /***/ }),
 
10750
 
10751
+ /***/ 631:
10752
+ /***/ (function(module, exports, __webpack_require__) {
10753
 
10754
+ "use strict";
 
 
10755
 
 
 
 
 
 
 
10756
 
10757
+ var _react = __webpack_require__(2);
 
 
 
10758
 
10759
+ var _react2 = _interopRequireDefault(_react);
 
 
 
 
10760
 
10761
+ var _reactRouter = __webpack_require__(25);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10762
 
10763
+ var _jquery = __webpack_require__(9);
 
 
 
 
 
 
 
 
 
 
 
 
10764
 
10765
+ var _jquery2 = _interopRequireDefault(_jquery);
 
10766
 
10767
+ var _mailpoet = __webpack_require__(3);
 
 
 
 
 
 
 
 
 
 
10768
 
10769
+ var _mailpoet2 = _interopRequireDefault(_mailpoet);
 
10770
 
10771
+ var _classnames = __webpack_require__(19);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10772
 
10773
+ var _classnames2 = _interopRequireDefault(_classnames);
 
 
 
 
10774
 
10775
+ var _listing = __webpack_require__(62);
 
 
 
 
 
 
10776
 
10777
+ var _listing2 = _interopRequireDefault(_listing);
 
 
 
10778
 
10779
+ var _selection = __webpack_require__(502);
 
10780
 
10781
+ var _selection2 = _interopRequireDefault(_selection);
 
 
 
 
 
 
 
10782
 
10783
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
10784
 
10785
+ var columns = [{
10786
+ name: 'email',
10787
+ label: _mailpoet2.default.I18n.t('subscriber'),
10788
+ sortable: true
10789
+ }, {
10790
+ name: 'status',
10791
+ label: _mailpoet2.default.I18n.t('status'),
10792
+ sortable: true
10793
+ }, {
10794
+ name: 'segments',
10795
+ label: _mailpoet2.default.I18n.t('lists')
10796
+ }, {
10797
+ name: 'created_at',
10798
+ label: _mailpoet2.default.I18n.t('subscribedOn'),
10799
+ sortable: true
10800
+ }, {
10801
+ name: 'updated_at',
10802
+ label: _mailpoet2.default.I18n.t('lastModifiedOn'),
10803
+ sortable: true
10804
+ }];
10805
 
10806
+ var messages = {
10807
+ onTrash: function onTrash(response) {
10808
+ var count = Number(response.meta.count);
10809
+ var message = null;
 
 
10810
 
10811
+ if (count === 1) {
10812
+ message = _mailpoet2.default.I18n.t('oneSubscriberTrashed');
10813
+ } else {
10814
+ message = _mailpoet2.default.I18n.t('multipleSubscribersTrashed').replace('%$1d', count.toLocaleString());
10815
  }
10816
+ _mailpoet2.default.Notice.success(message);
10817
+ },
10818
+ onDelete: function onDelete(response) {
10819
+ var count = Number(response.meta.count);
10820
+ var message = null;
10821
 
10822
+ if (count === 1) {
10823
+ message = _mailpoet2.default.I18n.t('oneSubscriberDeleted');
10824
+ } else {
10825
+ message = _mailpoet2.default.I18n.t('multipleSubscribersDeleted').replace('%$1d', count.toLocaleString());
10826
+ }
10827
+ _mailpoet2.default.Notice.success(message);
10828
+ },
10829
+ onRestore: function onRestore(response) {
10830
+ var count = Number(response.meta.count);
10831
+ var message = null;
 
 
 
 
 
 
 
 
10832
 
10833
+ if (count === 1) {
10834
+ message = _mailpoet2.default.I18n.t('oneSubscriberRestored');
10835
+ } else {
10836
+ message = _mailpoet2.default.I18n.t('multipleSubscribersRestored').replace('%$1d', count.toLocaleString());
10837
+ }
10838
+ _mailpoet2.default.Notice.success(message);
10839
+ },
10840
+ onNoItemsFound: function onNoItemsFound(group) {
10841
+ if (group === 'bounced' && !window.mailpoet_premium_active && !window.mss_active) {
10842
+ return _react2.default.createElement(
10843
+ 'div',
10844
+ null,
10845
+ _react2.default.createElement(
10846
+ 'p',
10847
+ null,
10848
+ _mailpoet2.default.I18n.t('bouncedSubscribersHelp')
10849
+ ),
10850
+ _react2.default.createElement(
10851
+ 'p',
10852
+ null,
10853
+ _react2.default.createElement(
10854
+ 'a',
10855
+ { href: 'admin.php?page=mailpoet-premium', className: 'button-primary' },
10856
+ _mailpoet2.default.I18n.t('bouncedSubscribersPremiumButtonText')
10857
+ )
10858
+ )
10859
+ );
10860
+ }
10861
+ // use default message
10862
+ return false;
10863
+ }
10864
+ };
10865
 
10866
+ var bulkActions = [{
10867
+ name: 'moveToList',
10868
+ label: _mailpoet2.default.I18n.t('moveToList'),
10869
+ onSelect: function onSelect() {
10870
+ var field = {
10871
+ id: 'move_to_segment',
10872
+ api_version: window.mailpoet_api_version,
10873
+ endpoint: 'segments',
10874
+ filter: function filter(segment) {
10875
+ return !!(!segment.deleted_at && segment.type === 'default');
10876
+ }
10877
+ };
10878
 
10879
+ return _react2.default.createElement(_selection2.default, { field: field });
10880
+ },
10881
+ getData: function getData() {
10882
+ return {
10883
+ segment_id: Number((0, _jquery2.default)('#move_to_segment').val())
10884
+ };
10885
+ },
10886
+ onSuccess: function onSuccess(response) {
10887
+ _mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t('multipleSubscribersMovedToList').replace('%$1d', Number(response.meta.count).toLocaleString()).replace('%$2s', response.meta.segment));
10888
+ }
10889
+ }, {
10890
+ name: 'addToList',
10891
+ label: _mailpoet2.default.I18n.t('addToList'),
10892
+ onSelect: function onSelect() {
10893
+ var field = {
10894
+ id: 'add_to_segment',
10895
+ api_version: window.mailpoet_api_version,
10896
+ endpoint: 'segments',
10897
+ filter: function filter(segment) {
10898
+ return !!(!segment.deleted_at && segment.type === 'default');
10899
+ }
10900
+ };
10901
 
10902
+ return _react2.default.createElement(_selection2.default, { field: field });
10903
+ },
10904
+ getData: function getData() {
10905
+ return {
10906
+ segment_id: Number((0, _jquery2.default)('#add_to_segment').val())
10907
+ };
10908
+ },
10909
+ onSuccess: function onSuccess(response) {
10910
+ _mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t('multipleSubscribersAddedToList').replace('%$1d', Number(response.meta.count).toLocaleString()).replace('%$2s', response.meta.segment));
10911
+ }
10912
+ }, {
10913
+ name: 'removeFromList',
10914
+ label: _mailpoet2.default.I18n.t('removeFromList'),
10915
+ onSelect: function onSelect() {
10916
+ var field = {
10917
+ id: 'remove_from_segment',
10918
+ api_version: window.mailpoet_api_version,
10919
+ endpoint: 'segments',
10920
+ filter: function filter(segment) {
10921
+ return !!(segment.type === 'default');
10922
+ }
10923
+ };
10924
 
10925
+ return _react2.default.createElement(_selection2.default, { field: field });
10926
+ },
10927
+ getData: function getData() {
10928
+ return {
10929
+ segment_id: Number((0, _jquery2.default)('#remove_from_segment').val())
10930
+ };
10931
+ },
10932
+ onSuccess: function onSuccess(response) {
10933
+ _mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t('multipleSubscribersRemovedFromList').replace('%$1d', Number(response.meta.count).toLocaleString()).replace('%$2s', response.meta.segment));
10934
+ }
10935
+ }, {
10936
+ name: 'removeFromAllLists',
10937
+ label: _mailpoet2.default.I18n.t('removeFromAllLists'),
10938
+ onSuccess: function onSuccess(response) {
10939
+ _mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t('multipleSubscribersRemovedFromAllLists').replace('%$1d', Number(response.meta.count).toLocaleString()));
10940
+ }
10941
+ }, {
10942
+ name: 'sendConfirmationEmail',
10943
+ label: _mailpoet2.default.I18n.t('resendConfirmationEmail'),
10944
+ onSuccess: function onSuccess(response) {
10945
+ _mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t('multipleConfirmationEmailsSent').replace('%$1d', Number(response.meta.count).toLocaleString()));
10946
+ }
10947
+ }, {
10948
+ name: 'trash',
10949
+ label: _mailpoet2.default.I18n.t('moveToTrash'),
10950
+ onSuccess: messages.onTrash
10951
+ }];
10952
 
10953
+ var itemActions = [{
10954
+ name: 'edit',
10955
+ label: _mailpoet2.default.I18n.t('edit'),
10956
+ link: function link(subscriber) {
10957
+ return _react2.default.createElement(
10958
+ _reactRouter.Link,
10959
+ { to: '/edit/' + subscriber.id },
10960
+ _mailpoet2.default.I18n.t('edit')
10961
+ );
10962
+ }
10963
+ }, {
10964
+ name: 'trash',
10965
+ display: function display(subscriber) {
10966
+ return Number(subscriber.wp_user_id) === 0;
10967
+ }
10968
+ }];
10969
 
10970
+ var SubscriberList = _react2.default.createClass({
10971
+ displayName: 'SubscriberList',
10972
 
10973
+ getSegmentFromId: function getSegmentFromId(segmentId) {
10974
+ var result = false;
10975
+ window.mailpoet_segments.forEach(function (segment) {
10976
+ if (segment.id === segmentId) {
10977
+ result = segment;
 
 
10978
  }
10979
+ });
10980
+ return result;
10981
+ },
10982
+ renderItem: function renderItem(subscriber, actions) {
10983
+ var _this = this;
10984
 
10985
+ var rowClasses = (0, _classnames2.default)('manage-column', 'column-primary', 'has-row-actions', 'column-username');
 
 
 
10986
 
10987
+ var status = '';
 
10988
 
10989
+ switch (subscriber.status) {
10990
+ case 'subscribed':
10991
+ status = _mailpoet2.default.I18n.t('subscribed');
10992
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10993
 
10994
+ case 'unconfirmed':
10995
+ status = _mailpoet2.default.I18n.t('unconfirmed');
10996
+ break;
 
 
 
 
 
 
10997
 
10998
+ case 'unsubscribed':
10999
+ status = _mailpoet2.default.I18n.t('unsubscribed');
11000
+ break;
 
 
 
 
 
 
 
11001
 
11002
+ case 'bounced':
11003
+ status = _mailpoet2.default.I18n.t('bounced');
11004
+ break;
 
 
 
11005
 
11006
+ default:
11007
+ status = 'Invalid';
11008
+ break;
 
 
 
 
 
 
11009
  }
 
 
11010
 
11011
+ var segments = false;
 
 
 
 
 
11012
 
11013
+ // Subscriptions
11014
+ if (subscriber.subscriptions.length > 0) {
11015
+ var subscribedSegments = [];
11016
 
11017
+ subscriber.subscriptions.forEach(function (subscription) {
11018
+ var segment = _this.getSegmentFromId(subscription.segment_id);
11019
+ if (segment === false) return;
11020
+ if (subscription.status === 'subscribed') {
11021
+ subscribedSegments.push(segment.name);
11022
+ }
11023
+ });
11024
 
11025
+ segments = _react2.default.createElement(
11026
+ 'span',
11027
+ null,
11028
+ subscribedSegments.join(', ')
11029
+ );
 
 
 
11030
  }
 
 
11031
 
11032
+ return _react2.default.createElement(
11033
+ 'div',
11034
+ null,
11035
+ _react2.default.createElement(
11036
+ 'td',
11037
+ { className: rowClasses },
11038
+ _react2.default.createElement(
11039
+ 'strong',
11040
+ null,
11041
+ _react2.default.createElement(
11042
+ _reactRouter.Link,
11043
+ {
11044
+ className: 'row-title',
11045
+ to: '/edit/' + subscriber.id
11046
+ },
11047
+ subscriber.email
11048
+ )
11049
+ ),
11050
+ _react2.default.createElement(
11051
+ 'p',
11052
+ { style: { margin: 0 } },
11053
+ subscriber.first_name,
11054
+ ' ',
11055
+ subscriber.last_name
11056
+ ),
11057
+ actions
11058
+ ),
11059
+ _react2.default.createElement(
11060
+ 'td',
11061
+ { className: 'column', 'data-colname': _mailpoet2.default.I18n.t('status') },
11062
+ status
11063
+ ),
11064
+ _react2.default.createElement(
11065
+ 'td',
11066
+ { className: 'column', 'data-colname': _mailpoet2.default.I18n.t('lists') },
11067
+ segments
11068
+ ),
11069
+ _react2.default.createElement(
11070
+ 'td',
11071
+ { className: 'column-date', 'data-colname': _mailpoet2.default.I18n.t('subscribedOn') },
11072
+ _react2.default.createElement(
11073
+ 'abbr',
11074
+ null,
11075
+ _mailpoet2.default.Date.format(subscriber.created_at)
11076
+ )
11077
+ ),
11078
+ _react2.default.createElement(
11079
+ 'td',
11080
+ { className: 'column-date', 'data-colname': _mailpoet2.default.I18n.t('lastModifiedOn') },
11081
+ _react2.default.createElement(
11082
+ 'abbr',
11083
+ null,
11084
+ _mailpoet2.default.Date.format(subscriber.updated_at)
11085
+ )
11086
+ )
11087
+ );
11088
+ },
11089
+ render: function render() {
11090
+ return _react2.default.createElement(
11091
+ 'div',
11092
+ null,
11093
+ _react2.default.createElement(
11094
+ 'h1',
11095
+ { className: 'title' },
11096
+ _mailpoet2.default.I18n.t('pageTitle'),
11097
+ ' ',
11098
+ _react2.default.createElement(
11099
+ _reactRouter.Link,
11100
+ {
11101
+ className: 'page-title-action',
11102
+ to: '/new'
11103
+ },
11104
+ _mailpoet2.default.I18n.t('new')
11105
+ ),
11106
+ _react2.default.createElement(
11107
+ 'a',
11108
+ {
11109
+ className: 'page-title-action',
11110
+ href: '?page=mailpoet-import#step1'
11111
+ },
11112
+ _mailpoet2.default.I18n.t('import')
11113
+ ),
11114
+ _react2.default.createElement(
11115
+ 'a',
11116
+ {
11117
+ id: 'mailpoet_export_button',
11118
+ className: 'page-title-action',
11119
+ href: '?page=mailpoet-export'
11120
+ },
11121
+ _mailpoet2.default.I18n.t('export')
11122
+ )
11123
+ ),
11124
+ _react2.default.createElement(_listing2.default, {
11125
+ limit: window.mailpoet_listing_per_page,
11126
+ location: this.props.location,
11127
+ params: this.props.params,
11128
+ endpoint: 'subscribers',
11129
+ onRenderItem: this.renderItem,
11130
+ columns: columns,
11131
+ bulk_actions: bulkActions,
11132
+ item_actions: itemActions,
11133
+ messages: messages,
11134
+ sort_by: 'created_at',
11135
+ sort_order: 'desc'
11136
+ })
11137
+ );
11138
+ }
11139
+ });
11140
 
11141
+ module.exports = SubscriberList;
 
 
11142
 
11143
+ /***/ }),
 
 
11144
 
11145
+ /***/ 632:
11146
+ /***/ (function(module, exports, __webpack_require__) {
11147
 
11148
+ "use strict";
11149
+ /* WEBPACK VAR INJECTION */(function(global) {
 
 
11150
 
11151
+ if (!global["MailPoetLib"]) global["MailPoetLib"] = {};
11152
+ module.exports = global["MailPoetLib"]["Form"] = __webpack_require__(633);
11153
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
 
 
 
 
 
 
 
 
 
 
 
 
11154
 
11155
+ /***/ }),
 
11156
 
11157
+ /***/ 633:
11158
+ /***/ (function(module, exports, __webpack_require__) {
11159
 
11160
+ "use strict";
 
11161
 
 
 
 
11162
 
11163
+ var _react = __webpack_require__(2);
 
 
11164
 
11165
+ var _react2 = _interopRequireDefault(_react);
 
 
11166
 
11167
+ var _reactRouter = __webpack_require__(25);
 
 
 
11168
 
11169
+ var _mailpoet = __webpack_require__(3);
 
 
 
 
11170
 
11171
+ var _mailpoet2 = _interopRequireDefault(_mailpoet);
 
 
 
11172
 
11173
+ var _form = __webpack_require__(289);
 
 
 
11174
 
11175
+ var _form2 = _interopRequireDefault(_form);
 
 
 
 
11176
 
11177
+ var _reactStringReplace = __webpack_require__(93);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11178
 
11179
+ var _reactStringReplace2 = _interopRequireDefault(_reactStringReplace);
11180
 
11181
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
11182
 
11183
+ var fields = [{
11184
+ name: 'email',
11185
+ label: _mailpoet2.default.I18n.t('email'),
11186
+ type: 'text',
11187
+ disabled: function disabled(subscriber) {
11188
+ return Number(subscriber.wp_user_id > 0);
11189
+ }
11190
+ }, {
11191
+ name: 'first_name',
11192
+ label: _mailpoet2.default.I18n.t('firstname'),
11193
+ type: 'text',
11194
+ disabled: function disabled(subscriber) {
11195
+ return Number(subscriber.wp_user_id > 0);
11196
+ }
11197
+ }, {
11198
+ name: 'last_name',
11199
+ label: _mailpoet2.default.I18n.t('lastname'),
11200
+ type: 'text',
11201
+ disabled: function disabled(subscriber) {
11202
+ return Number(subscriber.wp_user_id > 0);
11203
+ }
11204
+ }, {
11205
+ name: 'status',
11206
+ label: _mailpoet2.default.I18n.t('status'),
11207
+ type: 'select',
11208
+ values: {
11209
+ subscribed: _mailpoet2.default.I18n.t('subscribed'),
11210
+ unconfirmed: _mailpoet2.default.I18n.t('unconfirmed'),
11211
+ unsubscribed: _mailpoet2.default.I18n.t('unsubscribed'),
11212
+ bounced: _mailpoet2.default.I18n.t('bounced')
11213
+ },
11214
+ filter: function filter(subscriber, value) {
11215
+ if (Number(subscriber.wp_user_id) > 0 && value === 'unconfirmed') {
11216
+ return false;
11217
+ }
11218
+ return true;
11219
+ }
11220
+ }, {
11221
+ name: 'segments',
11222
+ label: _mailpoet2.default.I18n.t('lists'),
11223
+ type: 'selection',
11224
+ placeholder: _mailpoet2.default.I18n.t('selectList'),
11225
+ tip: _mailpoet2.default.I18n.t('welcomeEmailTip'),
11226
+ api_version: window.mailpoet_api_version,
11227
+ endpoint: 'segments',
11228
+ multiple: true,
11229
+ selected: function selected(subscriber) {
11230
+ if (Array.isArray(subscriber.subscriptions) === false) {
11231
+ return null;
11232
+ }
11233
 
11234
+ return subscriber.subscriptions.filter(function (subscription) {
11235
+ return subscription.status === 'subscribed';
11236
+ }).map(function (subscription) {
11237
+ return subscription.segment_id;
11238
+ });
11239
+ },
11240
+ filter: function filter(segment) {
11241
+ return !segment.deleted_at && segment.type === 'default';
11242
+ },
11243
+ getLabel: function getLabel(segment) {
11244
+ return segment.name + ' (' + segment.subscribers + ')';
11245
+ },
11246
+ getSearchLabel: function getSearchLabel(segment, subscriber) {
11247
+ var label = '';
11248
 
11249
+ if (subscriber.subscriptions !== undefined) {
11250
+ subscriber.subscriptions.forEach(function (subscription) {
11251
+ if (segment.id === subscription.segment_id) {
11252
+ label = segment.name;
11253
 
11254
+ if (subscription.status === 'unsubscribed') {
11255
+ var unsubscribedAt = _mailpoet2.default.Date.format(subscription.updated_at);
11256
+ label += ' (%$1s)'.replace('%$1s', _mailpoet2.default.I18n.t('unsubscribedOn').replace('%$1s', unsubscribedAt));
11257
+ }
 
 
 
 
11258
  }
11259
+ });
11260
+ }
11261
+ return label;
11262
+ }
11263
+ }];
11264
 
11265
+ var customFields = window.mailpoet_custom_fields || [];
11266
+ customFields.forEach(function (customField) {
11267
+ var field = {
11268
+ name: 'cf_' + customField.id,
11269
+ label: customField.name,
11270
+ type: customField.type
11271
+ };
11272
+ if (customField.params) {
11273
+ field.params = customField.params;
11274
+ }
11275
 
11276
+ if (customField.params.values) {
11277
+ field.values = customField.params.values;
11278
+ }
 
 
 
 
 
 
 
 
 
 
 
11279
 
11280
+ // add placeholders for selects (date, select)
11281
+ switch (customField.type) {
11282
+ case 'date':
11283
+ field.year_placeholder = _mailpoet2.default.I18n.t('year');
11284
+ field.month_placeholder = _mailpoet2.default.I18n.t('month');
11285
+ field.day_placeholder = _mailpoet2.default.I18n.t('day');
11286
+ break;
11287
 
11288
+ case 'select':
11289
+ field.placeholder = '-';
11290
+ break;
 
 
 
11291
 
11292
+ default:
11293
+ field.placeholder = '';
11294
+ break;
11295
+ }
 
 
11296
 
11297
+ fields.push(field);
11298
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11299
 
11300
+ var messages = {
11301
+ onUpdate: function onUpdate() {
11302
+ _mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t('subscriberUpdated'));
11303
+ },
11304
+ onCreate: function onCreate() {
11305
+ _mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t('subscriberAdded'));
11306
+ _mailpoet2.default.trackEvent('Subscribers > Add new', {
11307
+ 'MailPoet Free version': window.mailpoet_version
11308
+ });
11309
+ }
11310
+ };
11311
 
11312
+ function beforeFormContent(subscriber) {
11313
+ if (Number(subscriber.wp_user_id) > 0) {
11314
+ return _react2.default.createElement(
11315
+ 'p',
11316
+ { className: 'description' },
11317
+ (0, _reactStringReplace2.default)(_mailpoet2.default.I18n.t('WPUserEditNotice'), /\[link\](.*?)\[\/link\]/g, function (match, i) {
11318
+ return _react2.default.createElement(
11319
+ 'a',
11320
+ {
11321
+ key: i,
11322
+ href: 'user-edit.php?user_id=' + subscriber.wp_user_id
11323
+ },
11324
+ match
11325
+ );
11326
+ })
11327
+ );
11328
+ }
11329
+ return undefined;
11330
+ }
11331
 
11332
+ function afterFormContent() {
11333
+ return _react2.default.createElement(
11334
+ 'p',
11335
+ { className: 'description' },
11336
+ _react2.default.createElement(
11337
+ 'strong',
11338
+ null,
11339
+ _mailpoet2.default.I18n.t('tip')
11340
+ ),
11341
+ ' ',
11342
+ _mailpoet2.default.I18n.t('customFieldsTip')
11343
+ );
11344
+ }
 
 
11345
 
11346
+ var SubscriberForm = _react2.default.createClass({
11347
+ displayName: 'SubscriberForm',
 
 
 
 
 
 
 
 
 
 
11348
 
11349
+ render: function render() {
11350
+ return _react2.default.createElement(
11351
+ 'div',
11352
+ null,
11353
+ _react2.default.createElement(
11354
+ 'h1',
11355
+ { className: 'title' },
11356
+ _mailpoet2.default.I18n.t('subscriber'),
11357
+ _react2.default.createElement(
11358
+ _reactRouter.Link,
11359
+ { className: 'page-title-action', to: '/' },
11360
+ _mailpoet2.default.I18n.t('backToList')
11361
+ )
11362
+ ),
11363
+ _react2.default.createElement(_form2.default, {
11364
+ endpoint: 'subscribers',
11365
+ fields: fields,
11366
+ params: this.props.params,
11367
+ messages: messages,
11368
+ beforeFormContent: beforeFormContent,
11369
+ afterFormContent: afterFormContent
11370
+ })
11371
+ );
11372
+ }
11373
+ });
11374
 
11375
+ module.exports = SubscriberForm;
 
 
 
 
 
 
 
11376
 
11377
+ /***/ }),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11378
 
11379
+ /***/ 634:
11380
+ /***/ (function(module, exports, __webpack_require__) {
11381
 
11382
+ "use strict";
 
 
11383
 
 
 
11384
 
11385
+ var _react = __webpack_require__(2);
 
11386
 
11387
+ var _react2 = _interopRequireDefault(_react);
 
 
 
 
 
 
 
11388
 
11389
+ var _reactDom = __webpack_require__(30);
 
 
 
11390
 
11391
+ var _reactDom2 = _interopRequireDefault(_reactDom);
 
 
 
 
11392
 
11393
+ var _reactRouter = __webpack_require__(25);
 
 
 
 
 
 
 
 
 
11394
 
11395
+ var _history = __webpack_require__(94);
 
 
 
 
 
 
 
 
 
 
 
11396
 
11397
+ var _wpJsHooks = __webpack_require__(34);
 
 
 
 
11398
 
11399
+ var _wpJsHooks2 = _interopRequireDefault(_wpJsHooks);
 
 
 
11400
 
11401
+ var _underscore = __webpack_require__(7);
 
 
 
11402
 
11403
+ var _underscore2 = _interopRequireDefault(_underscore);
 
 
 
11404
 
11405
+ var _types = __webpack_require__(635);
 
 
 
 
 
 
 
 
 
11406
 
11407
+ var _types2 = _interopRequireDefault(_types);
11408
 
11409
+ var _templates = __webpack_require__(636);
 
 
 
11410
 
11411
+ var _templates2 = _interopRequireDefault(_templates);
 
11412
 
11413
+ var _send = __webpack_require__(641);
 
11414
 
11415
+ var _send2 = _interopRequireDefault(_send);
 
 
 
 
 
11416
 
11417
+ var _standard = __webpack_require__(645);
 
 
 
 
 
 
 
 
 
 
11418
 
11419
+ var _standard2 = _interopRequireDefault(_standard);
 
 
11420
 
11421
+ var _notification = __webpack_require__(646);
 
 
 
 
 
 
 
 
 
11422
 
11423
+ var _notification2 = _interopRequireDefault(_notification);
 
11424
 
11425
+ var _welcome = __webpack_require__(647);
 
 
11426
 
11427
+ var _welcome2 = _interopRequireDefault(_welcome);
 
 
11428
 
11429
+ var _events_list = __webpack_require__(506);
 
 
 
 
11430
 
11431
+ var _events_list2 = _interopRequireDefault(_events_list);
 
 
 
11432
 
11433
+ var _standard3 = __webpack_require__(648);
 
 
 
 
 
11434
 
11435
+ var _standard4 = _interopRequireDefault(_standard3);
 
 
 
 
 
 
 
 
 
 
 
11436
 
11437
+ var _welcome3 = __webpack_require__(649);
 
 
 
 
 
11438
 
11439
+ var _welcome4 = _interopRequireDefault(_welcome3);
 
 
 
11440
 
11441
+ var _notification3 = __webpack_require__(650);
 
11442
 
11443
+ var _notification4 = _interopRequireDefault(_notification3);
 
 
 
11444
 
11445
+ var _notification_history = __webpack_require__(651);
 
 
 
 
11446
 
11447
+ var _notification_history2 = _interopRequireDefault(_notification_history);
 
 
11448
 
11449
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
11450
 
11451
+ 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); } }
 
 
 
 
11452
 
11453
+ var history = (0, _reactRouter.useRouterHistory)(_history.createHashHistory)({ queryKey: false });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11454
 
11455
+ var App = _react2.default.createClass({
11456
+ displayName: 'App',
11457
+ render: function render() {
11458
+ return this.props.children;
11459
+ }
11460
+ });
 
 
 
 
 
11461
 
11462
+ var container = document.getElementById('newsletters_container');
 
 
 
 
 
 
 
11463
 
11464
+ var getAutomaticEmailsRoutes = function getAutomaticEmailsRoutes() {
11465
+ if (!window.mailpoet_automatic_emails) return null;
11466
+
11467
+ return _underscore2.default.map(window.mailpoet_automatic_emails, function (automaticEmail) {
11468
+ return {
11469
+ path: 'new/' + automaticEmail.slug,
11470
+ name: automaticEmail.slug,
11471
+ component: _events_list2.default,
11472
+ data: {
11473
+ email: automaticEmail
 
 
 
 
11474
  }
11475
+ };
11476
+ });
11477
+ };
11478
 
11479
+ if (container) {
11480
+ var routes = [
11481
+ /* Listings */
11482
+ {
11483
+ path: 'standard(/)**',
11484
+ params: { tab: 'standard' },
11485
+ component: _standard4.default
11486
+ }, {
11487
+ path: 'welcome(/)**',
11488
+ component: _welcome4.default
11489
+ }, {
11490
+ path: 'notification/history/:parent_id(/)**',
11491
+ component: _notification_history2.default
11492
+ }, {
11493
+ path: 'notification(/)**',
11494
+ component: _notification4.default
11495
+ },
11496
+ /* Newsletter: type selection */
11497
+ {
11498
+ path: 'new',
11499
+ component: _types2.default
11500
+ },
11501
+ /* New newsletter: types */
11502
+ {
11503
+ path: 'new/standard',
11504
+ component: _standard2.default
11505
+ }, {
11506
+ path: 'new/notification',
11507
+ component: _notification2.default
11508
+ }, {
11509
+ path: 'new/welcome',
11510
+ component: _welcome2.default
11511
+ },
11512
+ /* Template selection */
11513
+ {
11514
+ name: 'template',
11515
+ path: 'template/:id',
11516
+ component: _templates2.default
11517
+ },
11518
+ /* Sending options */
11519
+ {
11520
+ path: 'send/:id',
11521
+ component: _send2.default
11522
+ }];
11523
 
11524
+ routes = _wpJsHooks2.default.applyFilters('mailpoet_newsletters_before_router', [].concat(_toConsumableArray(routes), _toConsumableArray(getAutomaticEmailsRoutes())));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11525
 
11526
+ var mailpoetListing = _reactDom2.default.render( // eslint-disable-line react/no-render-return-value
11527
+ _react2.default.createElement(
11528
+ _reactRouter.Router,
11529
+ { history: history },
11530
+ _react2.default.createElement(
11531
+ _reactRouter.Route,
11532
+ { path: '/', component: App },
11533
+ _react2.default.createElement(_reactRouter.IndexRedirect, { to: 'standard' }),
11534
+ routes.map(function (route) {
11535
+ return _react2.default.createElement(_reactRouter.Route, {
11536
+ key: route.path,
11537
+ path: route.path,
11538
+ component: route.component,
11539
+ name: route.name || null,
11540
+ params: route.params || null,
11541
+ data: route.data || null
11542
+ });
11543
+ })
11544
+ )
11545
+ ), container);
11546
 
11547
+ window.mailpoet_listing = mailpoetListing;
11548
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
11549
 
11550
+ /***/ }),
 
 
 
11551
 
11552
+ /***/ 635:
11553
+ /***/ (function(module, exports, __webpack_require__) {
 
 
 
11554
 
11555
+ "use strict";
 
 
 
11556
 
 
 
 
 
 
11557
 
11558
+ var _react = __webpack_require__(2);
 
 
 
11559
 
11560
+ var _react2 = _interopRequireDefault(_react);
 
 
 
 
 
 
 
11561
 
11562
+ var _mailpoet = __webpack_require__(3);
 
 
 
11563
 
11564
+ var _mailpoet2 = _interopRequireDefault(_mailpoet);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11565
 
11566
+ var _breadcrumb = __webpack_require__(58);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11567
 
11568
+ var _breadcrumb2 = _interopRequireDefault(_breadcrumb);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11569
 
11570
+ var _wpJsHooks = __webpack_require__(34);
 
 
 
 
11571
 
11572
+ var _wpJsHooks2 = _interopRequireDefault(_wpJsHooks);
 
 
 
 
 
 
11573
 
11574
+ var _underscore = __webpack_require__(7);
 
 
 
11575
 
11576
+ var _underscore2 = _interopRequireDefault(_underscore);
 
 
 
 
 
 
11577
 
11578
+ __webpack_require__(25);
 
 
 
 
 
 
 
 
 
 
 
 
 
11579
 
11580
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
 
 
11581
 
11582
+ 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); } }
 
 
11583
 
11584
+ var NewsletterTypes = _react2.default.createClass({
11585
+ displayName: 'NewsletterTypes',
 
 
 
11586
 
11587
+ contextTypes: {
11588
+ router: _react2.default.PropTypes.object.isRequired
11589
+ },
11590
+ setupNewsletter: function setupNewsletter(type) {
11591
+ if (type !== undefined) {
11592
+ this.context.router.push('/new/' + type);
11593
+ _mailpoet2.default.trackEvent('Emails > Type selected', {
11594
+ 'MailPoet Free version': window.mailpoet_version,
11595
+ 'Email type': type
11596
+ });
11597
+ }
11598
+ },
11599
+ createNewsletter: function createNewsletter(type) {
11600
+ var _this = this;
11601
 
11602
+ _mailpoet2.default.trackEvent('Emails > Type selected', {
11603
+ 'MailPoet Free version': window.mailpoet_version,
11604
+ 'Email type': type
11605
+ });
11606
+ _mailpoet2.default.Ajax.post({
11607
+ api_version: window.mailpoet_api_version,
11608
+ endpoint: 'newsletters',
11609
+ action: 'create',
11610
+ data: {
11611
+ type: type,
11612
+ subject: _mailpoet2.default.I18n.t('draftNewsletterTitle')
11613
  }
11614
+ }).done(function (response) {
11615
+ _this.context.router.push('/template/' + response.data.id);
11616
+ }).fail(function (response) {
11617
+ if (response.errors.length > 0) {
11618
+ _mailpoet2.default.Notice.error(response.errors.map(function (error) {
11619
+ return error.message;
11620
+ }), { scroll: true });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11621
  }
11622
+ });
11623
+ },
11624
+ getAutomaticEmails: function getAutomaticEmails() {
11625
+ var _this2 = this;
11626
 
11627
+ if (!window.mailpoet_automatic_emails) return [];
11628
 
11629
+ return _underscore2.default.map(window.mailpoet_automatic_emails, function (automaticEmail) {
11630
+ var email = automaticEmail;
11631
+ var onClick = _underscore2.default.partial(_this2.setupNewsletter, automaticEmail.slug);
11632
+ email.action = function () {
11633
+ return _react2.default.createElement(
11634
+ 'div',
11635
+ null,
11636
+ _react2.default.createElement(
11637
+ 'a',
11638
+ {
11639
+ className: 'button button-primary',
11640
+ onClick: onClick,
11641
+ role: 'button',
11642
+ tabIndex: 0
11643
+ },
11644
+ _mailpoet2.default.I18n.t('setUp')
11645
+ )
11646
+ );
11647
+ }();
11648
 
11649
+ return email;
11650
+ });
11651
+ },
11652
+ render: function render() {
11653
+ var createStandardNewsletter = _underscore2.default.partial(this.createNewsletter, 'standard');
11654
+ var createNotificationNewsletter = _underscore2.default.partial(this.setupNewsletter, 'notification');
11655
+ var createWelcomeNewsletter = _underscore2.default.partial(this.setupNewsletter, 'welcome');
11656
+ var defaultTypes = [{
11657
+ slug: 'standard',
11658
+ title: _mailpoet2.default.I18n.t('regularNewsletterTypeTitle'),
11659
+ description: _mailpoet2.default.I18n.t('regularNewsletterTypeDescription'),
11660
+ action: function action() {
11661
+ return _react2.default.createElement(
11662
+ 'a',
11663
+ {
11664
+ className: 'button button-primary',
11665
+ 'data-automation-id': 'create_standard',
11666
+ onClick: createStandardNewsletter,
11667
+ role: 'button',
11668
+ tabIndex: 0
11669
+ },
11670
+ _mailpoet2.default.I18n.t('create')
11671
+ );
11672
+ }()
11673
+ }, {
11674
+ slug: 'welcome',
11675
+ title: _mailpoet2.default.I18n.t('welcomeNewsletterTypeTitle'),
11676
+ description: _mailpoet2.default.I18n.t('welcomeNewsletterTypeDescription'),
11677
+ videoGuide: 'https://beta.docs.mailpoet.com/article/254-video-guide-to-welcome-emails',
11678
+ action: function action() {
11679
+ return _react2.default.createElement(
11680
+ 'a',
11681
+ {
11682
+ className: 'button button-primary',
11683
+ onClick: createWelcomeNewsletter,
11684
+ 'data-automation-id': 'create_welcome',
11685
+ onKeyDown: function onKeyDown(event) {
11686
+ if (['keydown', 'keypress'].includes(event.type) && ['Enter', ' '].includes(event.key)) {
11687
+ event.preventDefault();
11688
+ createWelcomeNewsletter();
11689
+ }
11690
+ },
11691
+ role: 'button',
11692
+ tabIndex: 0
11693
+ },
11694
+ _mailpoet2.default.I18n.t('setUp')
11695
+ );
11696
+ }()
11697
+ }, {
11698
+ slug: 'notification',
11699
+ title: _mailpoet2.default.I18n.t('postNotificationNewsletterTypeTitle'),
11700
+ description: _mailpoet2.default.I18n.t('postNotificationNewsletterTypeDescription'),
11701
+ videoGuide: 'https://beta.docs.mailpoet.com/article/210-video-guide-to-post-notifications',
11702
+ action: function action() {
11703
+ return _react2.default.createElement(
11704
+ 'a',
11705
+ {
11706
+ className: 'button button-primary',
11707
+ 'data-automation-id': 'create_notification',
11708
+ onClick: createNotificationNewsletter,
11709
+ role: 'button',
11710
+ tabIndex: 0
11711
+ },
11712
+ _mailpoet2.default.I18n.t('setUp')
11713
+ );
11714
+ }()
11715
+ }];
11716
 
11717
+ var types = _wpJsHooks2.default.applyFilters('mailpoet_newsletters_types', [].concat(defaultTypes, _toConsumableArray(this.getAutomaticEmails())), this);
11718
+ var badgeClassName = window.mailpoet_is_new_user === true ? 'mailpoet_badge mailpoet_badge_video' : 'mailpoet_badge mailpoet_badge_video mailpoet_badge_video_grey';
11719
 
11720
+ return _react2.default.createElement(
11721
+ 'div',
11722
+ null,
11723
+ _react2.default.createElement(
11724
+ 'h1',
11725
+ null,
11726
+ _mailpoet2.default.I18n.t('pickCampaignType')
11727
+ ),
11728
+ _react2.default.createElement(_breadcrumb2.default, { step: 'type' }),
11729
+ _react2.default.createElement(
11730
+ 'ul',
11731
+ { className: 'mailpoet_boxes clearfix' },
11732
+ types.map(function (type) {
11733
+ return _react2.default.createElement(
11734
+ 'li',
11735
+ { key: type.slug, 'data-type': type.slug, className: 'mailpoet_newsletter_types' },
11736
+ _react2.default.createElement(
11737
+ 'div',
11738
+ null,
11739
+ _react2.default.createElement(
11740
+ 'div',
11741
+ { className: 'mailpoet_thumbnail' },
11742
+ type.thumbnailImage ? _react2.default.createElement('img', { src: type.thumbnailImage, alt: '' }) : null
11743
+ ),
11744
+ _react2.default.createElement(
11745
+ 'div',
11746
+ { className: 'mailpoet_description' },
11747
+ _react2.default.createElement(
11748
+ 'h3',
11749
+ null,
11750
+ type.title,
11751
+ ' ',
11752
+ type.beta ? '(' + _mailpoet2.default.I18n.t('beta') + ')' : ''
11753
+ ),
11754
+ _react2.default.createElement(
11755
+ 'p',
11756
+ null,
11757
+ type.description
11758
+ ),
11759
+ type.videoGuide && _react2.default.createElement(
11760
+ 'a',
11761
+ { className: badgeClassName, href: type.videoGuide, target: '_blank' },
11762
+ _react2.default.createElement('span', { className: 'dashicons dashicons-format-video' }),
11763
+ _mailpoet2.default.I18n.t('seeVideoGuide')
11764
+ )
11765
+ ),
11766
+ _react2.default.createElement(
11767
+ 'div',
11768
+ { className: 'mailpoet_actions' },
11769
+ type.action
11770
+ )
11771
+ )
11772
+ );
11773
+ }, this)
11774
+ )
11775
+ );
11776
+ }
11777
+ });
11778
 
11779
+ module.exports = NewsletterTypes;
 
 
 
 
 
 
 
11780
 
11781
+ /***/ }),
 
11782
 
11783
+ /***/ 636:
11784
+ /***/ (function(module, exports, __webpack_require__) {
11785
 
11786
+ "use strict";
 
11787
 
 
 
11788
 
11789
+ Object.defineProperty(exports, "__esModule", {
11790
+ value: true
11791
+ });
 
 
11792
 
11793
+ 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; };
 
 
11794
 
11795
+ 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; }; }();
 
 
 
 
 
11796
 
11797
+ var _react = __webpack_require__(2);
 
 
 
 
 
 
11798
 
11799
+ var _react2 = _interopRequireDefault(_react);
 
 
 
 
 
11800
 
11801
+ var _mailpoet = __webpack_require__(3);
 
 
 
 
 
 
 
11802
 
11803
+ var _mailpoet2 = _interopRequireDefault(_mailpoet);
 
 
 
 
 
 
 
 
11804
 
11805
+ var _breadcrumb = __webpack_require__(58);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11806
 
11807
+ var _breadcrumb2 = _interopRequireDefault(_breadcrumb);
 
 
 
 
 
 
11808
 
11809
+ var _loading = __webpack_require__(637);
 
 
 
 
 
 
11810
 
11811
+ var _loading2 = _interopRequireDefault(_loading);
 
 
 
 
 
11812
 
11813
+ var _tabs = __webpack_require__(638);
 
 
 
 
11814
 
11815
+ var _tabs2 = _interopRequireDefault(_tabs);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11816
 
11817
+ var _template_box = __webpack_require__(639);
 
 
 
 
11818
 
11819
+ var _template_box2 = _interopRequireDefault(_template_box);
11820
 
11821
+ var _import_template = __webpack_require__(640);
 
11822
 
11823
+ var _import_template2 = _interopRequireDefault(_import_template);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11824
 
11825
+ var _wpJsHooks = __webpack_require__(34);
 
 
 
 
11826
 
11827
+ var _wpJsHooks2 = _interopRequireDefault(_wpJsHooks);
 
11828
 
11829
+ var _underscore = __webpack_require__(7);
 
 
 
11830
 
11831
+ var _underscore2 = _interopRequireDefault(_underscore);
 
 
 
 
11832
 
11833
+ var _propTypes = __webpack_require__(12);
 
 
 
 
11834
 
11835
+ var _propTypes2 = _interopRequireDefault(_propTypes);
 
 
 
 
 
 
 
 
 
 
11836
 
11837
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 
 
11838
 
11839
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
 
 
 
 
11840
 
11841
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
 
 
 
 
11842
 
11843
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
 
 
 
 
 
 
 
11844
 
11845
+ var getEditorUrl = function getEditorUrl(id) {
11846
+ return 'admin.php?page=mailpoet-newsletter-editor&id=' + id;
11847
+ };
 
 
11848
 
11849
+ var templatesCategories = [{
11850
+ name: 'standard',
11851
+ label: _mailpoet2.default.I18n.t('tabStandardTitle')
11852
+ }, {
11853
+ name: 'welcome',
11854
+ label: _mailpoet2.default.I18n.t('tabWelcomeTitle')
11855
+ }, {
11856
+ name: 'notification',
11857
+ label: _mailpoet2.default.I18n.t('tabNotificationTitle')
11858
+ }, {
11859
+ name: 'woocommerce',
11860
+ label: _mailpoet2.default.I18n.t('tabWoocommerceTitle')
11861
+ }, {
11862
+ name: 'sample',
11863
+ label: _mailpoet2.default.I18n.t('sample')
11864
+ }, {
11865
+ name: 'blank',
11866
+ label: _mailpoet2.default.I18n.t('blank')
11867
+ }, {
11868
+ name: 'recent',
11869
+ label: _mailpoet2.default.I18n.t('recentlySent')
11870
+ }, {
11871
+ name: 'saved',
11872
+ label: _mailpoet2.default.I18n.t('savedTemplates')
11873
+ }];
11874
 
11875
+ var NewsletterTemplates = function (_React$Component) {
11876
+ _inherits(NewsletterTemplates, _React$Component);
 
 
 
 
 
 
11877
 
11878
+ function NewsletterTemplates(props) {
11879
+ _classCallCheck(this, NewsletterTemplates);
 
 
 
 
11880
 
11881
+ var _this = _possibleConstructorReturn(this, (NewsletterTemplates.__proto__ || Object.getPrototypeOf(NewsletterTemplates)).call(this, props));
 
11882
 
11883
+ _this.state = {
11884
+ loading: true,
11885
+ templates: {}, // {category1: [template11, template12, ..], category2: [template21, ...]}
11886
+ emailType: null,
11887
+ selectedTab: ''
11888
+ };
11889
+ _this.templates = {};
11890
 
11891
+ _this.addTemplate = _this.addTemplate.bind(_this);
11892
+ _this.afterTemplateDelete = _this.afterTemplateDelete.bind(_this);
11893
+ _this.afterTemplateSelect = _this.afterTemplateSelect.bind(_this);
11894
+ _this.afterTemplateImport = _this.afterTemplateImport.bind(_this);
11895
+ return _this;
11896
+ }
11897
+
11898
+ _createClass(NewsletterTemplates, [{
11899
+ key: 'componentWillMount',
11900
+ value: f