-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgohome.html
544 lines (261 loc) · 476 KB
/
gohome.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
<title>gohome</title>
<style title="Twine CSS">@keyframes appear{0%{opacity:0}to{opacity:1}}@keyframes fade-in-out{0%,to{opacity:0}50%{opacity:1}}@keyframes rumble{25%{top:-0.1em}75%{top:.1em}0%,to{top:0px}}@keyframes shudder{25%{left:.1em}75%{left:-0.1em}0%,to{left:0px}}@keyframes buoy{25%{top:.25em}75%{top:-0.25em}0%,to{top:0px}}@keyframes sway{25%{left:.25em}75%{left:-0.25em}0%,to{left:0px}}@keyframes pulse{0%{transform:scale(0, 0)}20%{transform:scale(1.2, 1.2)}40%{transform:scale(0.9, 0.9)}60%{transform:scale(1.05, 1.05)}80%{transform:scale(0.925, 0.925)}to{transform:scale(1, 1)}}@keyframes zoom-in{0%{transform:scale(0, 0)}to{transform:scale(1, 1)}}@keyframes shudder-in{0%,to{transform:translateX(0em)}5%,25%,45%{transform:translateX(-1em)}15%,35%,55%{transform:translateX(1em)}65%{transform:translateX(-0.6em)}75%{transform:translateX(0.6em)}85%{transform:translateX(-0.2em)}95%{transform:translateX(0.2em)}}@keyframes rumble-in{0%,to{transform:translateY(0em)}5%,25%,45%{transform:translateY(-1em)}15%,35%,55%{transform:translateY(1em)}65%{transform:translateY(-0.6em)}75%{transform:translateY(0.6em)}85%{transform:translateY(-0.2em)}95%{transform:translateY(0.2em)}}@keyframes fidget{0%,8.1%,82.1%,31.1%,38.1%,44.1%,40.1%,47.1%,74.1%,16.1%,27.1%,72.1%,24.1%,95.1%,6.1%,36.1%,20.1%,4.1%,91.1%,14.1%,87.1%,to{left:0px;top:0px}8%,82%,31%,38%,44%{left:-1px}40%,47%,74%,16%,27%{left:1px}72%,24%,95%,6%,36%{top:-1px}20%,4%,91%,14%,87%{top:1px}}@keyframes slide-right{0%{transform:translateX(-100vw)}}@keyframes slide-left{0%{transform:translateX(100vw)}}@keyframes slide-up{0%{transform:translateY(100vh)}}@keyframes slide-down{0%{transform:translateY(-100vh)}}@keyframes fade-right{0%{opacity:0;transform:translateX(-1em)}to{opacity:1}}@keyframes fade-left{0%{opacity:0;transform:translateX(1em)}to{opacity:1}}@keyframes fade-up{0%{opacity:0;transform:translateY(1em)}to{opacity:1}}@keyframes fade-down{0%{opacity:0;transform:translateY(-1em)}to{opacity:1}}@keyframes flicker{0%,29%,31%,63%,65%,77%,79%,86%,88%,91%,93%{opacity:0}30%{opacity:.2}64%{opacity:.4}78%{opacity:.6}87%{opacity:.8}92%,to{opacity:1}}@keyframes blur{0%{filter:blur(2rem);opacity:0}25%{opacity:1}to{filter:blur(0rem);opacity:1}}.dom-debug-mode tw-story,.dom-debug-mode tw-passage,.dom-debug-mode tw-sidebar,.dom-debug-mode tw-include,.dom-debug-mode tw-hook,.dom-debug-mode tw-expression,.dom-debug-mode tw-link,.dom-debug-mode tw-dialog,.dom-debug-mode tw-columns,.dom-debug-mode tw-column,.dom-debug-mode tw-align{outline:1px solid #f5a3da;min-height:32px;display:block !important}.dom-debug-mode tw-story::before,.dom-debug-mode tw-passage::before,.dom-debug-mode tw-sidebar::before,.dom-debug-mode tw-include::before,.dom-debug-mode tw-hook::before,.dom-debug-mode tw-expression::before,.dom-debug-mode tw-link::before,.dom-debug-mode tw-dialog::before,.dom-debug-mode tw-columns::before,.dom-debug-mode tw-column::before,.dom-debug-mode tw-align::before{position:absolute;top:0;left:0;height:16px;background-color:#f5a3da;color:#000;font-size:16px;font-weight:normal;font-style:normal;font-family:monospace;display:inline-block;line-height:100%;white-space:pre;z-index:999997}.dom-debug-mode tw-story:hover,.dom-debug-mode tw-passage:hover,.dom-debug-mode tw-sidebar:hover,.dom-debug-mode tw-include:hover,.dom-debug-mode tw-hook:hover,.dom-debug-mode tw-expression:hover,.dom-debug-mode tw-link:hover,.dom-debug-mode tw-dialog:hover,.dom-debug-mode tw-columns:hover,.dom-debug-mode tw-column:hover,.dom-debug-mode tw-align:hover{outline:1px solid #fc9}.dom-debug-mode tw-story:hover::before,.dom-debug-mode tw-passage:hover::before,.dom-debug-mode tw-sidebar:hover::before,.dom-debug-mode tw-include:hover::before,.dom-debug-mode tw-hook:hover::before,.dom-debug-mode tw-expression:hover::before,.dom-debug-mode tw-link:hover::before,.dom-debug-mode tw-dialog:hover::before,.dom-debug-mode tw-columns:hover::before,.dom-debug-mode tw-column:hover::before,.dom-debug-mode tw-align:hover::before{background-color:#fc9;transition:background-color 1s}.dom-debug-mode tw-passage,.dom-debug-mode tw-include,.dom-debug-mode tw-hook,.dom-debug-mode tw-expression,.dom-debug-mode tw-link,.dom-debug-mode tw-dialog,.dom-debug-mode tw-columns,.dom-debug-mode tw-column,.dom-debug-mode tw-align{padding:1em;margin:0}.dom-debug-mode tw-story::before{content:'<tw-story tags="' attr(tags) '">'}.dom-debug-mode tw-passage::before{top:-16px;content:'<tw-passage tags="' attr(tags) '">'}.dom-debug-mode tw-sidebar::before{top:-16px;content:"<tw-sidebar>"}.dom-debug-mode tw-hook::before{content:'<tw-hook name="' attr(name) '">'}.dom-debug-mode tw-expression::before{content:'<tw-expression name="' attr(name) '">'}.dom-debug-mode tw-link::before{content:'<tw-link name="' attr(name) '">'}.dom-debug-mode tw-dialog::before{content:"<tw-dialog>"}.dom-debug-mode tw-columns::before{content:"<tw-columns>"}.dom-debug-mode tw-column::before{content:"<tw-column>"}.dom-debug-mode tw-align::before{content:"<tw-align>"}.dom-debug-mode tw-include::before{content:'<tw-include type="' attr(type) '" name="' attr(name) '">'}.debug-mode tw-open-button[replay]{display:inline}.debug-mode tw-expression{display:inline-block !important}.debug-mode tw-expression[type=variable]::after{font-size:.8rem;padding-left:.2rem;padding-right:.2rem;vertical-align:top;content:"$" attr(name)}.debug-mode tw-expression[type=tempVariable]::after{font-size:.8rem;padding-left:.2rem;padding-right:.2rem;vertical-align:top;content:"_" attr(name)}.debug-mode tw-expression[return=boolean]{background-color:rgba(179,179,179,.2)}.debug-mode tw-expression[return=array]{background-color:rgba(255,102,102,.2)}.debug-mode tw-expression[return=dataset]{background-color:rgba(255,128,0,.2)}.debug-mode tw-expression[return=number]{background-color:rgba(255,179,102,.2)}.debug-mode tw-expression[return=datamap]{background-color:rgba(255,255,102,.2)}.debug-mode tw-expression[return=changer]{background-color:rgba(179,255,102,.2)}.debug-mode tw-expression[return=lambda]{background-color:rgba(102,255,102,.2)}.debug-mode tw-expression[return=hookname]{background-color:rgba(102,255,204,.2)}.debug-mode tw-expression[return=string]{background-color:rgba(102,255,255,.2)}.debug-mode tw-expression[return=datatype]{background-color:rgba(102,153,255,.2)}.debug-mode tw-expression[return=gradient],.debug-mode tw-expression[return=colour]{background-color:rgba(204,102,255,.2)}.debug-mode tw-expression[return=instant],.debug-mode tw-expression[return=macro]{background-color:rgba(240,117,199,.2)}.debug-mode tw-expression[return=command]{background-color:rgba(153,153,255,.2)}.debug-mode tw-expression.false{background-color:rgba(255,0,0,.2) !important}.debug-mode tw-expression[type=macro]::before{content:"(" attr(name) ":)";padding:0 .5rem;font-size:1rem;vertical-align:middle;line-height:normal;background-color:inherit;border:1px solid rgba(255,255,255,.5)}.debug-mode tw-expression[title]:not([title=""]){cursor:help}.debug-mode tw-hook{background-color:rgba(0,85,255,.1) !important}.debug-mode tw-hook::before{font-size:.8rem;padding-left:.2rem;padding-right:.2rem;vertical-align:top;content:"["}.debug-mode tw-hook::after{font-size:.8rem;padding-left:.2rem;padding-right:.2rem;vertical-align:top;content:"]"}.debug-mode tw-hook[name]::after{font-size:.8rem;padding-left:.2rem;padding-right:.2rem;vertical-align:top;content:"]<" attr(name) "|"}.debug-mode tw-pseudo-hook{background-color:rgba(255,170,0,.1) !important}.debug-mode tw-collapsed::before{font-size:.8rem;padding-left:.2rem;padding-right:.2rem;vertical-align:top;content:"{"}.debug-mode tw-collapsed::after{font-size:.8rem;padding-left:.2rem;padding-right:.2rem;vertical-align:top;content:"}"}.debug-mode tw-verbatim::before,.debug-mode tw-verbatim::after{font-size:.8rem;padding-left:.2rem;padding-right:.2rem;vertical-align:top;content:"`"}.debug-mode tw-align[style*="text-align: center"]{background:linear-gradient(to right, hsla(14deg, 100%, 87%, 0) 0%, hsla(14deg, 100%, 87%, 0.25) 50%, hsla(14deg, 100%, 87%, 0) 100%)}.debug-mode tw-align[style*="text-align: left"]{background:linear-gradient(to right, hsla(14deg, 100%, 87%, 0.25) 0%, hsla(14deg, 100%, 87%, 0) 100%)}.debug-mode tw-align[style*="text-align: right"]{background:linear-gradient(to right, hsla(14deg, 100%, 87%, 0) 0%, hsla(14deg, 100%, 87%, 0.25) 100%)}.debug-mode tw-column{background-color:rgba(189,228,255,.2)}.debug-mode tw-enchantment{animation:enchantment .5s infinite;border:1px solid}.debug-mode tw-link::after,.debug-mode tw-broken-link::after{font-size:.8rem;padding-left:.2rem;padding-right:.2rem;vertical-align:top;content:attr(passage-name)}.debug-mode tw-include{background-color:rgba(204,128,51,.1)}.debug-mode tw-include::before{font-size:.8rem;padding-left:.2rem;padding-right:.2rem;vertical-align:top;content:attr(type) ' "' attr(name) '"'}tw-eval-replay tw-eval-code,tw-eval-replay tw-eval-explanation{max-height:20vh;overflow:auto;margin:10px auto}tw-eval-replay tw-eval-code{display:block;font-family:monospace;padding-bottom:1ex;border-bottom:2px solid gray}tw-eval-replay tw-eval-explanation{display:block;text-align:center}tw-eval-replay tw-eval-explanation>code{white-space:pre-wrap}tw-eval-replay tw-eval-explanation>code.from-block{width:40%;display:inline-block;text-align:left;max-height:4em;overflow-wrap:anywhere;overflow-y:scroll}tw-eval-replay tw-eval-explanation>code.from-block~.to-desc{width:calc(40% - 2em);margin-left:2em;display:inline-block}tw-eval-replay tw-eval-explanation>code.from-block+span::after{content:"..."}tw-eval-replay tw-eval-explanation>code.from-inline{text-align:right}tw-eval-replay tw-eval-explanation>:nth-child(2){white-space:pre}tw-eval-replay tw-eval-explanation>.to-desc{text-align:left}tw-eval-replay tw-eval-explanation>table{width:100%;margin-top:1em}tw-eval-replay tw-eval-explanation>table td{white-space:pre-wrap !important;word-wrap:anywhere}tw-eval-replay tw-eval-reason{text-align:center;font-size:80%;font-style:italic;display:block}tw-eval-replay tw-eval-it{text-align:center;font-size:80%;display:block}tw-eval-replay tw-dialog-links{display:-ms-flexbox;display:flex;-ms-flex-pack:distribute;justify-content:space-around}@keyframes enchantment{0%,to{border-color:#ffb366}50%{border-color:#6fc}}tw-debugger{position:fixed;box-sizing:border-box;bottom:0;right:0;z-index:999999;min-width:10em;min-height:1em;padding:0em .5em .5em 1em;font-size:1.25em;font-family:sans-serif;color:#262626;background-color:#fff;border-left:solid #262626 2px;border-top:solid #262626 2px;border-top-left-radius:.5em;opacity:1}tw-debugger.fade-panel:not(:hover){opacity:.33}tw-debugger.theme-dark{color:#d9d9d9;background-color:#000}tw-debugger.theme-dark{border-color:#d9d9d9 rgba(0,0,0,0) rgba(0,0,0,0) #d9d9d9}tw-debugger select{margin-right:1em;width:12em}tw-debugger button,tw-debugger tw-link{border-radius:3px;border:solid #999 1px;margin:auto 4px;color:#262626;background-color:#fff;cursor:pointer}tw-debugger button.enabled,tw-debugger tw-link.enabled{color:#000;background-color:#d9d9d9;box-shadow:inset #999 3px 5px .5em}tw-debugger.theme-dark button,tw-debugger.theme-dark tw-link{color:#d9d9d9;background-color:#000;border-color:#666}tw-debugger.theme-dark button.enabled,tw-debugger.theme-dark tw-link.enabled{color:#e6e6e6;background-color:#424242;box-shadow:inset #666 3px 5px .5em}tw-debugger button{font-size:1em;overflow-x:hidden;text-overflow:ellipsis;white-space:pre}tw-debugger tw-link{font-size:1.25em;border-radius:16px;border-style:solid;border-width:2px;text-align:center;padding:0px 8px;display:block}tw-debugger tw-link:hover{border-color:#262626;color:#262626}tw-debugger.theme-dark tw-link:hover{border-color:#d9d9d9;color:#d9d9d9}tw-debugger tw-dialog{background-color:#fff;color:#000;font-size:1.25em}tw-debugger.theme-dark tw-dialog{background-color:#000;color:#e6e6e6}tw-debugger .panel{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:absolute;bottom:100%;left:-2px;right:0;padding:1em;overflow-y:scroll;overflow-x:hidden;border:inherit;box-sizing:content-box;background-color:#fff;border-bottom:solid #999 2px;border-top-left-radius:.5em;border-bottom-left-radius:.5em;font-size:.8em}tw-debugger .panel:empty,tw-debugger .panel[hidden]{display:none}tw-debugger.theme-dark .panel{background-color:#000;border-bottom-color:#666}tw-debugger .panel-source .panel-row-buttons{width:2rem}tw-debugger .panel-source .source-tags{width:20%;font-style:italic}tw-debugger .panel-row-source td{font-family:monospace;font-size:1rem;white-space:pre-wrap;overflow-wrap:anywhere;max-height:8rem;padding:1rem}tw-debugger .panel-rows{width:100%;overflow-x:scroll}tw-debugger .panel-rows>*{display:table-row}tw-debugger .panel-rows>div:nth-of-type(2n){background-color:#e6e6e6}tw-debugger.theme-dark .panel-rows>div:nth-of-type(2n){background-color:#212121}tw-debugger .panel-row-buttons{text-align:right}tw-debugger .panel-variables .panel-rows:empty::before{content:"~ No variables ~";font-style:italic;color:#575757;text-align:center}tw-debugger .panel-enchantments .panel-rows:empty::before{content:"~ No enchantments ~";font-style:italic;color:#575757;text-align:center}tw-debugger .panel-errors .panel-rows:empty::before{content:"~ No errors... for now. ~";font-style:italic;color:#575757;text-align:center}tw-debugger .panel-errors .panel-rows:empty+.panel-errors-bottom{display:none}tw-debugger.theme-dark .panel-variables .panel-rows:empty::before,tw-debugger.theme-dark .panel-enchantments .panel-rows:empty::before,tw-debugger.theme-dark .panel-errors .panel-rows:empty::before{color:#a8a8a8}tw-debugger .panel-rows:empty+.panel-variables-bottom{display:none}tw-debugger th[data-col]{text-decoration:underline;cursor:pointer}tw-debugger th[data-col][data-order=asc]::after{content:"↓"}tw-debugger th[data-col][data-order=desc]::after{content:"↑"}tw-debugger .panel-storylets:not(.panel-exclusive) .storylet-exclusive,tw-debugger .panel-storylets:not(.panel-urgent) .storylet-urgent{display:none}tw-debugger .storylet-exclusive,tw-debugger .storylet-urgent,tw-debugger .storylet-open{text-align:center}tw-debugger .panel-variables-bottom{padding-top:5px}tw-debugger .enchantment-row{min-height:1.5em}tw-debugger .variable-path{opacity:.4}tw-debugger .temporary-variable-scope,tw-debugger .enchantment-local{font-family:sans-serif;font-weight:normal;opacity:.8;font-size:.75em}tw-debugger .temporary-variable-scope:not(:empty)::before,tw-debugger .enchantment-local:not(:empty)::before{content:" in "}tw-debugger .variable-name,tw-debugger .enchantment-name{font-family:monospace;font-weight:bold}tw-debugger .variable-type{color:#575757;font-weight:normal;text-overflow:ellipsis;overflow:hidden;max-width:10em}tw-debugger.theme-dark .variable-type{color:#a8a8a8}tw-debugger .error-row{display:table-row;background-color:rgba(230,101,204,.3)}tw-debugger .error-row:nth-of-type(2n){background-color:rgba(237,145,219,.3)}tw-debugger .error-row>*{display:table-cell;padding:.25em .5em}tw-debugger .error-row .error-message[title]:not([title=""]){cursor:help}tw-debugger .error-row .error-passage{color:#575757}tw-debugger.theme-dark .error-row .error-passage{color:#a8a8a8}tw-debugger .storylet-row{background-color:rgba(193,240,225,.3)}tw-debugger .storylet-row:nth-child(2n){background-color:rgba(152,231,204,.3)}tw-debugger .storylet-row.storylet-closed{font-style:italic;background-color:#fff}tw-debugger .storylet-row.storylet-closed:nth-child(2n){background-color:#e6e6e6}tw-debugger .storylet-row.storylet-closed>:not(.storylet-lambda){opacity:.6}.storylet-error tw-debugger .storylet-row{background-color:rgba(230,101,204,.3)}.storylet-error tw-debugger .storylet-row:nth-child(2n){background-color:rgba(237,145,219,.3)}tw-debugger .storylet-row .storylet-name,tw-debugger .storylet-row .storylet-value{display:inline-block;width:50%}tw-debugger .storylet-row .storylet-lambda{font-family:monospace;font-size:1rem;white-space:pre-wrap;overflow-wrap:anywhere}tw-debugger.theme-dark .storylet-row.storylet-closed{background-color:#000}tw-debugger.theme-dark .storylet-row.storylet-closed:nth-child(2n){background-color:#212121}tw-debugger .tabs{padding-bottom:.5em}tw-debugger .tab{border-radius:0px 0px .5em .5em;border-top:none}tw-debugger .resizer-h{position:absolute;height:14em;border-left:2px solid #999;border-right:2px solid #999;top:10px;left:4px;width:8px;cursor:ew-resize}tw-debugger.theme-dark .resizer-h{border-color:rgba(0,0,0,0) #666}tw-debugger .resizer-v{position:absolute;height:8px;border-top:2px solid #999;border-bottom:2px solid #999;margin-bottom:4px;top:4px;left:10px;width:95%;cursor:ns-resize;box-sizing:border-box}tw-debugger.theme-dark .resizer-v{border-color:#666 rgba(0,0,0,0)}tw-debugger mark{color:inherit;background-color:rgba(101,230,230,.3) !important}tw-dialog{z-index:999997;border:#fff solid 2px;padding:2em;color:#fff;background-color:#000;display:block}@media(min-width: 576px){tw-dialog{max-width:50vw}}tw-dialog input[type=text]{font-size:inherit;width:100%}tw-dialog-links{text-align:right;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end}tw-backdrop{z-index:999996;position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.8);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}tw-backdrop~tw-backdrop{display:none}tw-link,.enchantment-link{cursor:pointer;color:#4169e1;font-weight:bold;text-decoration:none;transition:color .2s ease-in-out}tw-passage [style^=color] tw-link:not(:hover),tw-passage [style*=" color"] tw-link:not(:hover),tw-passage [style^=color][hover=true] tw-link:hover,tw-passage [style*=" color"][hover=true] tw-link:hover,tw-passage [style^=color] .enchantment-link:not(:hover),tw-passage [style*=" color"] .enchantment-link:not(:hover),tw-passage [style^=color][hover=true] .enchantment-link:hover,tw-passage [style*=" color"][hover=true] .enchantment-link:hover{color:inherit}tw-link:hover,.enchantment-link:hover{color:#00bfff}tw-link:active,.enchantment-link:active{color:#dd4b39}.visited{color:#6941e1}tw-passage [style^=color] .visited:not(:hover),tw-passage [style*=" color"] .visited:not(:hover),tw-passage [style^=color][hover=true] .visited:hover,tw-passage [style*=" color"][hover=true] .visited:hover{color:inherit}.visited:hover{color:#e3e}tw-broken-link{color:#933;border-bottom:2px solid #933;cursor:not-allowed}tw-passage [style^=color] tw-broken-link:not(:hover),tw-passage [style*=" color"] tw-broken-link:not(:hover),tw-passage [style^=color][hover=true] tw-broken-link:hover,tw-passage [style*=" color"][hover=true] tw-broken-link:hover{color:inherit}tw-link.enchantment-mouseover,.link.enchantment-mouseover,tw-expression.enchantment-mouseover>tw-link{color:inherit;font-weight:inherit;transition:none;cursor:inherit;border-bottom:2px dashed #999}tw-link.enchantment-mouseover:hover,tw-link.enchantment-mouseover:active,.link.enchantment-mouseover:hover,.link.enchantment-mouseover:active,tw-expression.enchantment-mouseover>tw-link:hover,tw-expression.enchantment-mouseover>tw-link:active{color:inherit}tw-link.enchantment-mouseover.enchantment-button,.link.enchantment-mouseover.enchantment-button,tw-expression.enchantment-mouseover>tw-link.enchantment-button{border-style:dashed}tw-link.enchantment-mouseout,.link.enchantment-mouseout,tw-expression.enchantment-mouseout>tw-link{color:inherit;font-weight:inherit;transition:none;cursor:inherit;border:rgba(64,149,191,.6) 1px solid;border-radius:.2em}tw-link.enchantment-mouseout:hover,tw-link.enchantment-mouseout:active,.link.enchantment-mouseout:hover,.link.enchantment-mouseout:active,tw-expression.enchantment-mouseout>tw-link:hover,tw-expression.enchantment-mouseout>tw-link:active{color:inherit}tw-link.enchantment-mouseout:hover,.link.enchantment-mouseout:hover,tw-expression.enchantment-mouseout>tw-link:hover{background-color:rgba(175,197,207,.75);border:rgba(0,0,0,0) 1px solid}tw-link.enchantment-dblclick,.link.enchantment-dblclick,tw-expression.enchantment-dblclick>tw-link{color:inherit;font-weight:inherit;transition:none;cursor:inherit;cursor:pointer;border:2px solid #999;border-radius:0}tw-link.enchantment-dblclick:hover,tw-link.enchantment-dblclick:active,.link.enchantment-dblclick:hover,.link.enchantment-dblclick:active,tw-expression.enchantment-dblclick>tw-link:hover,tw-expression.enchantment-dblclick>tw-link:active{color:inherit}tw-link.enchantment-dblclick:active,.link.enchantment-dblclick:active,tw-expression.enchantment-dblclick>tw-link:active{background-color:#999}tw-link.enchantment-button,.link.enchantment-button,.enchantment-button:not(.link) tw-link,.enchantment-button:not(.link) .link{border-radius:16px;border-style:solid;border-width:2px;text-align:center;padding:0px 8px;display:block}.enchantment-button{display:block}.enchantment-clickblock{cursor:pointer;width:100%;height:100%;display:block}.enchantment-clickblock>:not(tw-enchantment)::after{content:"";width:100%;height:100%;top:0;left:0;display:block;box-sizing:border-box;position:absolute;pointer-events:none;color:rgba(65,105,225,.5);transition:color .2s ease-in-out}.enchantment-clickblock>:not(tw-enchantment):hover::after{color:rgba(0,191,255,.5)}.enchantment-clickblock>:not(tw-enchantment):active::after{color:rgba(222,78,59,.5)}.enchantment-clickblock>:not(tw-enchantment)::after{box-shadow:inset 0 0 0 .5vmax}.enchantment-clickblock>tw-passage::after,.enchantment-clickblock>tw-sidebar::after{box-shadow:0 0 0 .5vmax}.enchantment-mouseoverblock>:not(tw-enchantment)::after{content:"";width:100%;height:100%;top:0;left:0;display:block;box-sizing:border-box;position:absolute;pointer-events:none;border:2px dashed #999}.enchantment-mouseoutblock>:not(tw-enchantment)::after{content:"";width:100%;height:100%;top:0;left:0;display:block;box-sizing:border-box;position:absolute;pointer-events:none;border:rgba(64,149,191,.6) 2px solid}.enchantment-mouseoutblock:hover>:not(tw-enchantment)::after{content:"";width:100%;height:100%;top:0;left:0;display:block;box-sizing:border-box;position:absolute;pointer-events:none;background-color:rgba(175,197,207,.75);border:rgba(0,0,0,0) 2px solid;border-radius:.2em}.enchantment-dblclickblock>:not(tw-enchantment)::after{content:"";width:100%;height:100%;top:0;left:0;display:block;box-sizing:border-box;position:absolute;pointer-events:none;cursor:pointer;border:2px solid #999}tw-dialog-links{padding-top:1.5em}tw-dialog-links tw-link{border-radius:16px;border-style:solid;border-width:2px;text-align:center;padding:0px 8px;display:block;display:inline-block}html{margin:0;height:100%;overflow-x:hidden}*,:before,:after{position:relative;box-sizing:inherit}body{margin:0;height:100%}tw-storydata{display:none}tw-story{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font:100% Georgia,serif;box-sizing:border-box;width:100%;min-height:100%;font-size:1.5em;line-height:1.5em;padding:5% 5%;overflow:hidden;background-color:#000;color:#fff}tw-story [style*=content-box] *{box-sizing:border-box}@media(min-width: 576px){tw-story{padding:5% 20%}}tw-story tw-consecutive-br{display:block;height:1.6ex;visibility:hidden}tw-story select{background-color:rgba(0,0,0,0);font:inherit;border-style:solid;padding:2px}tw-story select:not([disabled]){color:inherit}tw-story textarea{resize:none;background-color:rgba(0,0,0,0);font:inherit;color:inherit;border-style:none;padding:2px}tw-story input[type=text]{background-color:rgba(0,0,0,0);font:inherit;color:inherit;border-style:none}tw-story input[type=checkbox]{transform:scale(1.5);margin:0 .5em .5em .5em;vertical-align:middle}tw-story tw-noscript{animation:appear .8s}tw-passage{display:block}tw-sidebar{text-align:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}@media(min-width: 576px){tw-sidebar{left:-5em;width:3em;position:absolute;-ms-flex-direction:column;flex-direction:column}tw-enchantment[style*=width]>tw-sidebar{width:inherit}}tw-icon{display:inline-block;margin:.5em 0;font-size:66px;font-family:"Verdana",sans-serif}tw-icon[alt]{opacity:.2;cursor:pointer}tw-icon[alt]:hover{opacity:.4}tw-icon[data-label]::after{font-weight:bold;content:attr(data-label);font-size:20px;bottom:-20px;left:-50%;white-space:nowrap}tw-meter{display:block}tw-hook:empty,tw-expression:empty{display:none}tw-error{display:inline-block;border-radius:.2em;padding:.2em;font-size:1rem;cursor:help;white-space:pre-wrap}tw-error.error{background-color:rgba(223,58,190,.6);color:#fff}tw-error.warning{background-color:rgba(223,140,58,.6);color:#fff;display:none}.debug-mode tw-error.warning{display:inline}tw-error-explanation{display:block;font-size:.8rem;line-height:1rem}tw-open-button,tw-folddown{cursor:pointer;line-height:0em;border-radius:4px;border:1px solid rgba(255,255,255,.5);font-size:.8rem;margin:0 .4rem;padding:3px;white-space:pre}tw-folddown::after{content:"▶"}tw-folddown.open::after{content:"▼"}tw-open-button[replay]{display:none}tw-error tw-open-button,tw-eval-replay tw-open-button{display:inline !important}tw-open-button::after{content:attr(label)}tw-notifier{border-radius:.2em;padding:.2em;font-size:1rem;background-color:rgba(223,182,58,.4);display:none}.debug-mode tw-notifier{display:inline}tw-notifier::before{content:attr(message)}tw-colour{border:1px solid #000;display:inline-block;width:1em;height:1em}tw-enchantment:empty{display:none}h1{font-size:3em}h2{font-size:2.25em}h3{font-size:1.75em}h1,h2,h3,h4,h5,h6{line-height:1em;margin:.3em 0 .6em 0}pre{font-size:1rem;line-height:initial}small{font-size:70%}big{font-size:120%}mark{color:rgba(0,0,0,.6);background-color:#ff9}ins{color:rgba(0,0,0,.6);background-color:rgba(255,242,204,.5);border-radius:.5em;box-shadow:0em 0em .2em #ffe699;text-decoration:none}center{text-align:center;margin:0 auto;width:60%}blink{text-decoration:none;animation:fade-in-out 1s steps(1, end) infinite alternate}tw-align{display:block}tw-columns{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between}.transition-in{animation:appear 0ms step-start}.transition-out{animation:appear 0ms step-end}[data-t8n^=dissolve].transition-in,[data-t8n=fade].transition-in{animation:appear .8s}[data-t8n^=dissolve].transition-out,[data-t8n=fade].transition-out{animation:appear .8s reverse}[data-t8n^=shudder].transition-in{display:inline-block !important;animation:shudder-in .8s}[data-t8n^=shudder].transition-out{display:inline-block !important;animation:shudder-in .8s reverse}[data-t8n^=rumble].transition-in{display:inline-block !important;animation:rumble-in .8s}[data-t8n^=rumble].transition-out{display:inline-block !important;animation:rumble-in .8s reverse}[data-t8n^=pulse].transition-in{animation:pulse .8s;display:inline-block !important}[data-t8n^=pulse].transition-out{animation:pulse .8s reverse;display:inline-block !important}[data-t8n^=zoom].transition-in{animation:zoom-in .8s;display:inline-block !important}[data-t8n^=zoom].transition-out{animation:zoom-in .8s reverse;display:inline-block !important}[data-t8n^=blur].transition-in{animation:blur .8s;display:inline-block !important}[data-t8n^=blur].transition-out{animation:blur .8s reverse;display:inline-block !important}[data-t8n^=slideleft].transition-in{animation:slide-left .8s;display:inline-block !important}[data-t8n^=slideleft].transition-out{animation:slide-right .8s reverse;display:inline-block !important}[data-t8n^=slideright].transition-in{animation:slide-right .8s;display:inline-block !important}[data-t8n^=slideright].transition-out{animation:slide-left .8s reverse;display:inline-block !important}[data-t8n^=slideup].transition-in{animation:slide-up .8s;display:inline-block !important}[data-t8n^=slideup].transition-out{animation:slide-down .8s reverse;display:inline-block !important}[data-t8n^=slidedown].transition-in{animation:slide-down .8s;display:inline-block !important}[data-t8n^=slidedown].transition-out{animation:slide-up .8s reverse;display:inline-block !important}[data-t8n^=fadeleft].transition-in{animation:fade-left .8s;display:inline-block !important}[data-t8n^=fadeleft].transition-out{animation:fade-right .8s reverse;display:inline-block !important}[data-t8n^=faderight].transition-in{animation:fade-right .8s;display:inline-block !important}[data-t8n^=faderight].transition-out{animation:fade-left .8s reverse;display:inline-block !important}[data-t8n^=fadeup].transition-in{animation:fade-up .8s;display:inline-block !important}[data-t8n^=fadeup].transition-out{animation:fade-down .8s reverse;display:inline-block !important}[data-t8n^=fadedown].transition-in{animation:fade-down .8s;display:inline-block !important}[data-t8n^=fadedown].transition-out{animation:fade-up .8s reverse;display:inline-block !important}[data-t8n^=flicker].transition-in{animation:flicker .8s}[data-t8n^=flicker].transition-out{animation:flicker .8s reverse}
</style>
</head>
<body>
<tw-story><noscript><tw-noscript>JavaScript needs to be enabled to play gohome.</tw-noscript></noscript></tw-story>
<tw-storydata name="gohome" startnode="1" creator="Twine" creator-version="2.4.1" format="Harlowe" format-version="3.3.1" ifid="AA0ABED2-A9C4-44C8-B0D1-55A29811DC88" options="" tags="" zoom="1" hidden><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style><script role="script" id="twine-user-script" type="text/twine-javascript"></script><tw-passagedata pid="1" name="Versuchs nochmal" tags="" position="625,175" size="100,100"> |=
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.pinimg.com%2F736x%2F3c%2F4f%2F1b%2F3c4f1b80c0a66f26c0a700e89a188cb5.jpg&f=1&nofb=1">
=|
(bg:black)[=
Leicht benommen von der gestrigen Nacht taumelst du durch die Tür des Clubs.
Du bist bist zum Schluss geblieben, denn der letzte DJ hat echt nochmal brutal abgerissen.
// “Jetzt ist es aber wirklich Zeit nach Hause zu gehen”//, sagst du zu dem überhaupt nicht mehr gesund aussehenden Typen, den du vorne links auf der Tanzfläche kennengelernt hast.
//“Das war geisteskrank”// lallt er dir entgegen während er fast über die kleine Stufe am Ausgang stolpert. [[Weiterlesen]]
</tw-passagedata><tw-passagedata pid="2" name="Weiterlesen" tags="" position="725,175" size="100,100">|=
Larry, den du ein wenig stützen musst, damit er nicht umkippt, streckt dir seine halbleere Wasserflasche entgegen.
Als du ihn fragend anschaust sagt er: //“Hier, du musst Trinken- stay Hydrated weisste?”//
[[dankend annehmen]] oder [[Ablehnen]]
=|
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2F66.media.tumblr.com%2F1562737ff37ec39f4ce5269e35368803%2Ftumblr_n34tvwVB5h1qza1qzo1_500.gif&f=1&nofb=1">
</tw-passagedata><tw-passagedata pid="3" name="Ablehnen" tags="" position="825,175" size="100,100">|=
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.ytimg.com%2Fvi%2FLJZT1kVREPc%2Fhqdefault.jpg&f=1&nofb=1">
=|
Du lehnst ab.// “Was weiß ich was der da rein gemischt hat”//, denkst du, obwohl du einen immens großen Durst verspürst. Es dauert nicht lange bis dein Mund sich so trocken anfühlt, dass du dich schließlich dazu entscheidest das Wasser anzunehmen.
|==|
Du trinkst einen großen Schluck. Wie sehr du etwas zu trinken gebraucht hast, scheint dir jetzt bewusst zu werden. Deine Sicht klärt sich und du fühlst dich gar nicht mehr so vernebelt und benommen. Du schließt kurz die Augen- um zu genießen, dass sich in diesem Moment nicht alles dreht und entspannst dich. Das nächste was du bewusst wahrnimmst ist das Gefühl einer warmen Bettdecke die dich umschließt. Als du die Augen öffnest, findest du dich[[ in einem Bett wieder.]]
|==|
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.redd.it%2F8qxnbzir3dp31.png&f=1&nofb=1"></tw-passagedata><tw-passagedata pid="4" name="dankend annehmen" tags="" position="925,275" size="100,100">=|
Du trinkst einen großen Schluck aus der Flasche.
//“Das tut wirklich gut, echt lange nichts mehr getrunken”// entgegnest du Larry.
Aber als du dich umschaust ist Larry auf einmal verschwunden, obwohl du dir sicher bist dass er gerade mit //“Ja man, Wasser ballert am meisten”// geantwortet hat.
Du beschließt ihn zu suchen.
//“Vielleicht hat er ja seine Jacke im Club vergessen”//, denkst du, als du dich auf den Weg die Treppe herunter zur Garderobe machst.
[[Du läufst weiter.]]
|==
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.pinimg.com%2Foriginals%2F8f%2Fef%2F71%2F8fef71420ef34ea573df508655d2a96e.jpg&f=1&nofb=1"></tw-passagedata><tw-passagedata pid="5" name="Du läufst weiter." tags="" position="625,375" size="100,100">Du betrittst den großen, spärlich beleuchteten Kellerraum.
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fjooinn.com%2Fimages%2Ffloating-dust.jpg&f=1&nofb=1">
|=
Du betrittst den großen, spärlich beleuchteten Kellerraum. Es ist alles so sehr vernebelt, dass du deine Füße kaum sehen kannst. Im nächsten Moment bemerkst du ein leichtes ziehen im Magen und dir wird schwindelig. Du überlegst ob du dich übergeben musst.
Sollst du [[zur Toilette gehen]] oder [[weiter nach Larry suchen]]?
</tw-passagedata><tw-passagedata pid="6" name="zur Toilette gehen" tags="" position="625,275" size="100,100"><img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.blendernation.com%2Fwp-content%2Fuploads%2F2019%2F04%2Fimage4-1-1-728x336.jpg&f=1&nofb=1">
Du gehst straight zur Klokabine weil das Gefühl stärker wird, dass du dich übergeben musst. Der Gestank nach Pisse und abgestandenem Bier macht es auch nicht besser. Im Vorbeigehen wirfst du einen Blick in den Spiegel und fragst dich unterbewusst, seit wann dein Gesicht so eigenartige Proportionen hat. Aber du hast keine Zeit dir darüber Gedanken zu machen und beugst dich über die [[Kloschüssel.]]
</tw-passagedata><tw-passagedata pid="7" name="weiter nach Larry suchen" tags="" position="725,375" size="100,100">|=
Du beschließt weiter zu suchen. Das flaue Gefühl wird schon wieder weggehen. Du bahnst dir deinen Weg durch den Club und er kommt dir auf einmal endlos groß vor. Irgendwie hast du es schwer dich zu Orientieren.
Immer wieder meinst du, durch den Nebel die Silhouette von Larry zu sehen. Aber wenn du dich näherst ist er auf einmal verschwunden.
Aus der Ferne hörst du seine Stimme die immer wieder //“Trink!”// sagt. Seine Betonung wird von mal zu mal immer eindringlicher.
|=
<img src="https://external-content.duckduckgo.com/iu/?u=http%3A%2F%2Fpixelartmaker.com%2Fart%2F6eb7e6f39df33c5.png&f=1&nofb=1">
|==|
=><=
(text-style:"bold")["Trink!"
"Trink!"
"TRINK!"
"T R I N K !"
(text-style:"bold","smear")["T R I N K !"]]
<==
|=
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fart.ngfiles.com%2Fimages%2F182000%2F182838_gimmick_pixel-hand.jpg%3Ff1319357070&f=1&nofb=1">
==|
Larrys Stimme wird lauter und du hast fast das Gefühl er würde dich anschreien. Aber du kannst ihn einfach nicht finden.
Auf einmal spürst du einen schweren Griff der dich nach hinten zieht.
Du fragst dich einen Moment lang ob du [[wild um dich schlagen]] oder [[cool bleiben]] sollst.
</tw-passagedata><tw-passagedata pid="8" name="Kloschüssel." tags="" position="725,275" size="100,100">Du blickst in die Kloschüssel und da wo eigentlich das Wasser sein sollte, tut sich eine bodenlose Tiefe auf. Du verspürst einen starken Sog an deinem Hinterkopf und alles wird schwarz.
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Forig00.deviantart.net%2F7b27%2Ff%2F2017%2F092%2F9%2Fa%2Fhanako_san_bathroom__gif__by_juli12355-db4i1op.gif&f=1&nofb=1">
Du hast verloren.
[[Versuchs nochmal]] </tw-passagedata><tw-passagedata pid="9" name="wild um dich schlagen" tags="" position="925,375" size="100,100">Du erschreckst dich so sehr vor dem Griff auf deine Schulter, dass sich dein kompletter Körper auf Kämpfen einstellt.
Du schlägst wild um dich und versuchst dich aus dem Griff der dir unbekannten Person zu befreien.
Mit jedem Schlag, mit jedem Tritt und mit jeder schnellen Bewegung hält die Person dich ein wenig stärker fest. Als du komplett Bewegungsunfähig bist, spürst du, wie dir der [[Boden unter den Füßen]] weggerissen wird.
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fpre00.deviantart.net%2F1b27%2Fth%2Fpre%2Fi%2F2016%2F295%2F5%2Fe%2Fsans_punching_sprite_by_adjtheartist-dalvadf.png&f=1&nofb=1">
</tw-passagedata><tw-passagedata pid="10" name="cool bleiben" tags="" position="625,975" size="100,100">Du beschließt cool zu bleiben und drehst dich langsam zu der Hand um, die dich an der Schulter hält. Vor dir steht jetzt der Security und bittet dich zu gehen, weil die Party vorbei ist. Du willst ihm erklären, dass du auf der Suche nach deinem Freund Larry bist, der vermutlich gerade an der Garderobe ist.
|=
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.kindpng.com%2Fpicc%2Fm%2F6-65065_question-face-clipart-png-download-spreadsheet-pixel-art.png&f=1&nofb=1">
===|
(bg:black)[Aber egal wie sehr du es versuchst, keine Worte verlassen deinen Mund. Du versuchst dich mit Händen und Füßen zu verständigen. Der Security schaut dich fragend und ein wenig mitleidig an. Dann zückt er sein Funkgerät aber du verstehst nicht was er sagt. Anstatt Worte scheinen die Laute von Trompeten den Raum zu durchdringen. (text-style:"blur")[Dein Blick wird schwammig und alles fängt an zu rauschen. [[Du schließt die Augen]].]]
</tw-passagedata><tw-passagedata pid="11" name="Du schließt die Augen" tags="" position="725,975" size="100,100">|=
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fimage.shutterstock.com%2Fimage-vector%2Fcartoon-ambulance-car-islated-on-260nw-1403415098.jpg&f=1&nofb=1">
=|
(bg:black)[Als du sie wieder öffnest, blicken dich fremde Gesichter in einem grell erleuchteten Raum an. Du bist im Krankenwagen.
Du hast verloren. [[Versuchs nochmal]] ]</tw-passagedata><tw-passagedata pid="12" name="Einschlafen" tags="" position="825,375" size="100,100">|=
Du schließt die Augen und schon bist du weg.
Wie lange?
Keine Ahnung.
Der überraschend erholsame Schlaf wird von einer dezenten Vibration unterbrochen.
Du lässt deine Augen geschlossen und versucht das Geräusch zu deuten.
Die Vibration wird von einem tiefen bassigen geräusch untermalt, klingt aber sehr sinnlich. Zuerst dachtest du, dass in der Ferne ein schweres Fahrzeug vorbeifährt, aber mit fortschreitender Zeit bemerkst du, dass das Geräusch ganz [[nah]] ist.
=|
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fthumbs.dreamstime.com%2Fb%2Fvector-pixel-art-truck-front-vector-pixel-art-truck-front-isolated-102309029.jpg&f=1&nofb=1"></tw-passagedata><tw-passagedata pid="13" name="nach Hause gehen" tags="" position="725,475" size="100,100">|=
Du raffst dich auf, entfernst dich leicht taumelnd vom Club und blickst dabei auf eine endlos wirkende Straße. Am Horizont geht die Sonne auf. Du siehst wie alle Farben miteinander verschmelzen und doch für sich allein, ganz besonders strahlen. Es ist das schönste was du seit langem gesehen hast. Aus Gründen, die dir komplett unbekannt sind, rollt dir eine kleine Freudenträne über die Wange.
=|
<img src="https://external-content.duckduckgo.com/iu/?u=http%3A%2F%2Fpm1.narvii.com%2F6743%2F63e46e09509b418b803136bfdfc91422dd22172dv2_00.jpg&f=1&nofb=1">
|==|
//“Schöner könnte ein Morgen nicht sein”// denkst du als dir keine einzige Sache einfällt, die diesen Moment toppen könnte.
|=
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.pinimg.com%2F736x%2Fa1%2Fcb%2Fa6%2Fa1cba67d13a9bb16822261d0ffa656f7.jpg&f=1&nofb=1">
=|
(bg:black)[Du läufst diese Straße bestimmt schon 25 Minuten entlang und genießt das morgendliche Vogelgezwitscher als du von einer alten Dame angesprochen wirst, die auf einmal von der Seite in deinem Blickfeld auftaucht. Sie lächelt dich an und sagt //“Schönen Guten Morgen”.//
[[Freundlich Grüßen]] oder [[Omi umboxen]]
]
</tw-passagedata><tw-passagedata pid="14" name="Freundlich Grüßen" tags="" position="925,975" size="100,100">|=
Du entgegnest der Omi ein nettes //“Ich wünsche Ihnen auch einen schönes Guten Morgen”//.
Als nächstes fragt sie dich, ob du ihr ein Feuerzeug leihen kannst, sie habe ihres gestern beim Abendbrot mit ihren Enkeln wohl in der Gartenlaube von der Großtante des Neffen liegen gelassen.
Du suchst in deinen viel zu vielen Hosentaschen deiner Cargojeans.
Plötzlich hörst du ein leises
[[“Click”]]
=|
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fthumbs.dreamstime.com%2Fb%2Fvector-pixel-art-lighter-isolated-cartoon-vector-pixel-art-lighter-125492072.jpg&f=1&nofb=1">
</tw-passagedata><tw-passagedata pid="15" name="Omi umboxen" tags="" position="825,975" size="100,100">|=
Du gibst der Omi einen Highkick mitten ins Gesicht und sie fällt wie ein Stein nach hinten um.
Bevor sie auf dem Boden angekommen ist, springt sie mit einem Backflip auf ihre jetzt gar nicht mehr klapprig wirkenden Beine und kontert deinen Angriff mit einem Roundhousekick mit deinem Gesicht als Ziel.
Du wirst ohnmächtig-
instant Knock-Out.
Du hast Verloren. [[Versuchs nochmal]]
=|
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fthumbs.dreamstime.com%2Fb%2Fvector-pixel-art-boxing-girl-vector-pixel-art-boxing-girl-isolated-cartoon-131383758.jpg&f=1&nofb=1"></tw-passagedata><tw-passagedata pid="16" name="Katze streichelst" tags="" position="725,575" size="100,100">
Du streckst die Hand in Richtung Katze. Sie reibt sich daran und schmust. Schnell entwickelt ihr eine Symbiose. Du streichelst ihren flauschigen Nacken und merkst durch das immer intensiver werdende schnurren, dass es ihr gefällt. Du streichelst die Katze ewig, aber es kommt dir vor als würde keine Zeit vergehen. Sie dreht sich auf den Bauch und du interpretierst das als Aufforderung diesen zu [[kraulen]].
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.pinimg.com%2F736x%2F85%2Fbe%2F94%2F85be94350b6cefd78140c8c8232c75e5.jpg&f=1&nofb=1"></tw-passagedata><tw-passagedata pid="17" name="aufstehst und gehst" tags="" position="825,475" size="100,100">|=
//“Mama hat gesagt, man soll keine fremden Katzen streicheln”//, denkst du als du den Blick von der Katze abwendest.
Jetzt willst du aber wirklich nach Hause. //“Aber…. Wo bin ich hier überhaupt?”// fragst du dich, während du ohne Ziel deinen schlecht gewählten Schlafplatz verlässt. Du würdest dir gern ein Taxi rufen aber als du dein Handy aus der Tasche ziehst, blinkt nur die rote Batterieanzeige. Dein Akku ist leer.
=|
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fmedia.istockphoto.com%2Fvectors%2Fpixel-art-phone-in-hand-vector-8-bit-web-icon-isolated-on-white-vector-id1038703762%3Fk%3D6%26m%3D1038703762%26s%3D170667a%26w%3D0%26h%3Dc8HxfM5P3ErTEJHwqxwTmfljOSO-RAqJZABttLC57AE%3D&f=1&nofb=1">
|==|
|=
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2F2%2F24%2FRottweil%252C_gelbe_Telefonzelle.JPG%2F360px-Rottweil%252C_gelbe_Telefonzelle.JPG&f=1&nofb=1">
=|
(text-style:"bold","italic")[//“TELEFONZELLEN”//] denkst du laut, absolut begeitert davon, dass die Dinger ja sicherlich noch existieren. Du beschließt dich auf die Suche nach einer Telefonzelle zu begeben um dir ein Taxi zu rufen und gehst los. nach einigen Metern gabelt sich der Weg. Links verläuft eine [[Hauptstraße]] und rechts scheint sich ein [[Wohngebiet]] zu eröffnen.
</tw-passagedata><tw-passagedata pid="18" name="Hauptstraße" tags="" position="925,575" size="100,100">Du beschließt der Hauptstraße zu folgen. Logisch, da wird bestimmt eine Telefonzelle zu finden sein. Der Straßenzug wirkt ausgestorben.
//“Vermutlich ist es auch erst 6Uhr morgens. An einem Sonntag. Wer ist da schon unterwegs.”//, erschließt du dir.
So durchgefeiert wie du bist ist es anstrengend zu laufen, ohne ständig fast das Gleichgewicht zu verlieren.
=====|
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.ytimg.com%2Fvi%2F20CochufQWE%2Fhqdefault.jpg&f=1&nofb=1">
|=|
Du läufst über eine Ampel, ohne darauf zu achten ob rot oder grün ist. Du willst bloß endlich nach Hause. Offensichtlich war es rot. Denn in dem Moment als du die Straße betrittst spürst du nur einen [[dumpfen Schlag auf deine Seite.]] </tw-passagedata><tw-passagedata pid="19" name="Wohngebiet" tags="" position="625,675" size="100,100"><img src="https://external-content.duckduckgo.com/iu/?u=http%3A%2F%2Fwww.pixeljoint.com%2Ffiles%2Ficons%2Ffull%2Fvillagething.png&f=1&nofb=1">
Du betrittst das Wohngebiet.
Du bist so fertig von der Nacht und noch immer
fühlst du dich etwas benommen.
Jeder Schritt ist unglaublich anstrengend.
Deine Kräfte verlassen dich langsam.
Du wägst deine Möglichkeiten ab.
// “Wie wahrscheinlich ist es,
dass hier irgendwo eine Telefonzelle ist?”//.
Langsam bist du verzweifelt.
Jeder Schritt lässt dich weiter an deiner
Entscheidung zweifeln, hier noch eine
Telefonzelle zu finden.
[[Weiterlaufen]]</tw-passagedata><tw-passagedata pid="20" name="dumpfen Schlag auf deine Seite." tags="" position="825,575" size="100,100">Bevor deine Wahrnehmung dich verlässt siehst du was geschehen ist.
Du wurdest von einem Taxi überfahren.
=|
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fthumbs.dreamstime.com%2Ft%2Fvoiture-de-taxi-d-art-pixel-vecteur-125894716.jpg&f=1&nofb=1">
=|||=
Du hast Verloren.
[[Versuchs nochmal]]</tw-passagedata><tw-passagedata pid="21" name="blau" tags="" position="825,675" size="100,100">//“Leute mit Hunden sind doch eigentlich immer ganz nett”//, denkst du, als du die Klingel des blauen Hauses betätigst.
Noch bevor du den Knopf ganz durchgedrückt hast, hörst du aggressives bellen hinter der Tür. Es dauert eine gefühlte Ewigkeit bis sich die Tür öffnet.
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fstatic.planetminecraft.com%2Ffiles%2Fresource_media%2Fscreenshot%2F1328%2F2013-07-11_004707_5911345_lrg.jpg&f=1&nofb=1">
In der Zeit hinterfragst du die Entscheidung bei einer fremden Person geklingelt zu haben.
Dann öffnet sich die Tür.
Ein volltätowierter großer Typ steht vor dir und schaut dich verschlafen an. Du erklärst ihm deine Situation aber er scheint dich nicht zu verstehen. Mit einem überraschend Mitfühlenden Blick bittet er dich herein und zeigt auf die [[Couch.]] </tw-passagedata><tw-passagedata pid="22" name="gelb" tags="" position="625,775" size="100,100">|=
Du läufst zum gelben Haus und klingelst.
Es passiert nichts.
Als du gerade wieder gehen willst, öffnet sich die Tür.
Eine junge brünette Frau öffnet die Tür. Bevor du etwas sagen kannst beginnt sie dich anzuschreien.
// ''“Was wollen sie hier? Es ist früh am Morgen. Was fällt ihnen ein zu dieser unchristlichen Uhrzeit hier zu klingen? Verpissen sie sich SOFORT.''”//
Nachdem ihre Hasstirade ein Ende hat, blickt sie dich weiter an. Du beschließt, dennoch um Hilfe zu bitten, denn du weißt wirklich nicht, was du sonst machen sollst.
[[Fragen ob die Frau dir ein Taxi rufen kann]]
[[Fragen ob du ein Glas Wasser bekommst]]
=|
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fcdn4.vectorstock.com%2Fi%2F1000x1000%2F39%2F58%2Fangry-woman-pop-art-vector-15253958.jpg&f=1&nofb=1">
</tw-passagedata><tw-passagedata pid="23" name="Couch." tags="" position="925,675" size="100,100">|=
Du setzt dich wortlos hin.
Er blickt dich sorgenvoll an.
Du willst den Blick erwidern aber bemerkst, dass deine Wahrnehmung irgendwie Spielchen mit dir zu spielen scheint. Das Gesicht des Typen in dessen Haus du sitzt nimmt eigenartige Formen an.
Auch der Hintergrund wird schwummrig. Du gibst alles um dich zu konzentrieren aber deine Augen lassen das nicht zu. Aufeinmal steht der Typ auf und geht. Du bekommst Angst und überlegst ob du schnell rausrennen sollst. Doch bevor du den Gedanken zu Ende denken kannst, kommt er wieder und hält dir ein Glas Wasser hin. [[Ablehnen]]
=|
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fimage.spreadshirtmedia.com%2Fimage-server%2Fv1%2Fcompositions%2F1000973737%2Fviews%2F1%2Cwidth%3D650%2Cheight%3D650%2CappearanceId%3D2%2Cversion%3D1485256808.jpg&f=1&nofb=1">
</tw-passagedata><tw-passagedata pid="24" name="Fragen ob die Frau dir ein Taxi rufen kann" tags="" position="725,775" size="100,100">
|=
Du stotterst //“TAXI”// und der Blick der Frau entspannt sich. Sie zückt ihr Telefon und gibt eine Nummer ein. Mit einer Geste zeigt sie dir, dass du warten sollst und schließt die Tür. [[Du setzt dich auf die Eingangsstufe]] und durch die geschlossene Tür hörst du, dass sie Telefoniert.
=|
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.pinimg.com%2Foriginals%2F40%2Fc8%2F5a%2F40c85a6e70ab9cbf2c845f28fd53e02a.jpg&f=1&nofb=1"></tw-passagedata><tw-passagedata pid="25" name="Fragen ob du ein Glas Wasser bekommst" tags="" position="725,875" size="100,100">|=
Du stotterst //“Wasser”//. Noch bevor du das Wort zu Ende gesprochen hast, knallt auch schon die Tür zu. Komplett verzweifelt entfernst du dich von dem Haus um weiter nach einer Telefonzelle zu suchen. [[Du läufst weiter]]
=|
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.kindpng.com%2Fpicc%2Fm%2F106-1062032_pixel-question-mark-png-question-mark-pixel-art.png&f=1&nofb=1"></tw-passagedata><tw-passagedata pid="26" name="Du setzt dich auf die Eingangsstufe" tags="" position="825,775" size="100,100">|=
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fopenclipart.org%2Fimage%2F800px%2F264198&f=1&nofb=1">
=|
(bg:black)[Nach einiger Zeit öffnet sich die Tür einen kleinen Spalt und die Frau sagt //“Kommt gleich wer”//, bevor sie die Tür wieder schließt. Es dauert eine ganze Weile bis ein Wagen vorfhrt. Dir fällt ein Stein vom Herzen, denn langsam hattest du schon fast nicht mehr daran geglaubt, dass dich noch jemand abholt. Der Wagen stoppt vor der Tür. Es ist kein gewöhnliches Taxi, sondern ein weißer Transporter. Du hinterfragst das nicht und [[steigst hinten ein. ]]]</tw-passagedata><tw-passagedata pid="27" name="steigst hinten ein. " tags="" position="925,775" size="100,100">Es ist angenehm dunkel im Taxi. Nachdem du dem Fahrer deine Adresse gesagt hast und er losfährt schläfst du sofort ein. Du schläfst eine ganze Weile bis du durch eine heftige Bodenwelle aus dem Schlaf gerissen wirst. Verschlafen blickst du aus dem Fenster und traust deinen Augen kaum.
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.pinimg.com%2Foriginals%2Fb3%2F6f%2F7b%2Fb36f7b1cd7eed729cef8e321e85679b8.jpg&f=1&nofb=1">
Alles was du siehst ist dir gänzlich unbekannt. Auf den Schildern sind buchstaben die du nicht kennst und auch die Landschaft ist dir nicht vertraut.
[[den Taxifahrer fragen wo du bist]]</tw-passagedata><tw-passagedata pid="28" name="Du läufst weiter" tags="" position="825,875" size="100,100"> //“Was bin ich nur für ein Versager”//, fragst du dich während die langsam aufgehende Sonne in dein Gesicht blendet. Du quälst dich Schritt für Schritt weiter. Jeder deiner Schritte sticht in deinem Magen und dein Gleichgewicht lässt auch langsam nach.
Es zieht sich eine halbe Ewigkeit und du hast das Gefühl, nie wieder aus diesem Wohngebiet heraus zu finden.
|=
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fart.ngfiles.com%2Fimages%2F1152000%2F1152275_hacerng_rising-sun.png%3Ff1579805512&f=1&nofb=1">
=|
(bg:black)[Du läufst und läufst, wankst und taumelst bis auch dein letzter Funken Kraft dich verlässt. Dann kippst du einfach um.
Du hast Verloren. [[Versuchs nochmal]] ]
</tw-passagedata><tw-passagedata pid="29" name=" in einem Bett wieder." tags="" position="925,175" size="100,100">
=|
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.redd.it%2Fbfiq4iux52n41.png&f=1&nofb=1"
|=
(bg:black)[=
Doch irgendwas ist hier komisch. Du erkennst dich nicht wie sonst aus der Egoperspektive. So, wie sich jeder normale Mensch halt sieht. Du siehst dich von oben. Von außen. Du bekommst Panik. Doch du spürst kein herzrasen, wie sonst wenn du Panik bekommst. Du spürst gar nichts. Du bist tot.
Du hast Verloren. [[Versuchs nochmal]] ]
</tw-passagedata><tw-passagedata pid="30" name="Boden unter den Füßen" tags="" position="625,475" size="100,100">|=
Jetzt erkennst du, dass du von einem Security festgehalten wirst. Er trägt dich die Treppe hoch und lässt dich unsanft vor die Tür des Clubs fallen. //“Jetzt ist Schicht im Schacht! Feierabend! Geh nach Hause!”// wirft dir der Security entgegen und knallt mit einem Schwung die schwere Clubtür zu.
=|
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fcdn.dribbble.com%2Fusers%2F677502%2Fscreenshots%2F2151934%2Fsecurity.gif&f=1&nofb=1">
<==
Du liegst auf dem kalten Asphaltboden und weißt ehrlich gesagt gar nicht mehr so richtig wo du bist und wie du eigentlich dahin gekommen bist. Dich übermannt ein starkes Gefühl der Müdigkeit. [[Einschlafen]] oder [[nach Hause gehen]]</tw-passagedata><tw-passagedata pid="31" name="nah" tags="" position="825,275" size="100,100">|=
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.pinimg.com%2Foriginals%2F9a%2Fea%2F56%2F9aea561e8ffe7f891fdbfe73a94016a8.gif&f=1&nofb=1">
==|
Als du das feststellst spürst du an deinem Unterarm etwas kitzeliges und weiches. Du erschreckst dich ein wenig und öffnest schlagartig deine Augen. Vor dir siehst du aber gar nichts gruseliges, wie du zuerst erwartest, als du die zwei riesigen schwarzen Augen siehst, die dich [[anstarren]].
</tw-passagedata><tw-passagedata pid="32" name="anstarren" tags="" position="625,575" size="100,100">|=
Als sich dein schlaftrunkener Blick langsam aufklärt, siehst du eine unglaublich süße, weiße Katze, die sich schnurrend an deinem Arm reibt.
Du beobachtest sie und entdeckst, dass ihre Nase von einem total putzigen schwarzen Fleck in Form von einem Herz geziert wird.
Du rappelst dich ein wenig auf. Du und die Katze halten Blickkontakt.
Du überlegst ob du die [[Katze streichelst]] oder [[aufstehst und gehst]]
=|
<img src="https://www.watson.ch/imgdb/0052/Qx,B,0,0,550,728,229,319,91,127/7691881488430880"></tw-passagedata><tw-passagedata pid="33" name="kraulen" tags="" position="925,475" size="100,100">Doch sofort als du den Bauch berührst, rollt sich die Katze, mit deiner Hand in ihrer Mitte ein und gräbt ihre Krallen tief in deine Hand. Bevor du reagieren kannst, denn eigentlich möchtest du deine Hand jetzt schnell wegziehen, spürst du einen kräftigen Biss.
“AUA” schreist du erschrocken.
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.redd.it%2Fngr3idv9a4r31.jpg&f=1&nofb=1">
Viel schlimmer als die physischen Schmerzen an der Bisswunde ist aber das brennende ziehen, welches sich deinen Arm herauf, durch deine Adern pulsierend, richtung Körpermitte brennt. Langsam steigt das Gefühl auf, bis es dein Herz erreicht. Jetzt geht alles sehr schnell. Weißer Schaum beginnt aus deinem Mund zu quellen. Das letzte was du spürst ist ein quälender Stich in deinem Herzen.
Du hast Verloren. [[Versuchs nochmal]] </tw-passagedata><tw-passagedata pid="34" name="Weiterlaufen" tags="" position="725,675" size="100,100"><img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fstatic.dribbble.com%2Fusers%2F1061842%2Fscreenshots%2F6728890%2Fhouse-copy-1.gif&f=1&nofb=11">
Du überlegst, ob du einfach an einem der Einfamilienhäuser hältst und klingelst. Vielleicht kann dir jemand ein Taxi rufen oder dir zumindest sagen wo du gerade bist.
Selbst wenn nicht, du hast auch so unglaublich großen Durst.
Vielleicht bekommst du ja auch einfach ein Glas Wasser.
//“Stay hydrated”// bildest du dir ein von Larrys Stimme zu hören.
Du schaust dich um, um die Vertrauenswürdigkeit der Hauseingänge zu analysieren. zwei Häuser fallen dir ins Auge.
Das eine [[blau]]- mit einem Schild mit der Aufschrift //“Achtung! bissiger Hund”//.
Das andere Haus ist strahlend [[gelb]] und hat eine süße Fußmatte auf der dich das Foto eines Hundewelpen herzlich willkommen heißt.</tw-passagedata><tw-passagedata pid="35" name="den Taxifahrer fragen wo du bist" tags="" position="625,875" size="100,100">|=
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fcdn.dribbble.com%2Fusers%2F144140%2Fscreenshots%2F1463476%2Fmatthew-douglas-pixel.png&f=1&nofb=1">
=|
(bg:black)[Du willst den Taxifahrer fragen wo du bist und drehst deinen Kopf zum Autoinneren. Jetzt erkennst du neben dir einen vermummten Mann, der eine Waffe auf dich richtet.
Du hast Verloren. [[Versuchs nochmal]] ]
</tw-passagedata><tw-passagedata pid="36" name="“Click”" tags="" position="925,875" size="100,100">Der Verschluss deiner Bauchtasche hat sich geöffnet. Du traust deinen Augen kaum, als du siehst, dass die Omi, mit deiner Bauchtasche in der Hand einen preiswürdigen Sprint hinlegt. Du rennst los. //“Kann ja nicht so schwer sein ne Omi einzuholen denkst du”//.
|=
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.pinimg.com%2F736x%2F35%2F27%2F48%2F3527483c885942abf09ecae95b6e2ff5--pixel-roses.jpg&f=1&nofb=1">
=|
Doch du schaffst keine 50 Meter bis du stolperst und so ungünstig fällst, dass du dir den Kopf aufschlägst. Dir wird schwarz vor Augen.
Du hast Verloren. [[Versuchs nochmal]]
</tw-passagedata></tw-storydata>
<script title="Twine engine code" data-main="harlowe">"use strict";function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _createForOfIteratorHelper(e,t){var n,r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return r&&(e=r),n=0,{s:t=function(){},n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){i=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(i)throw a}}}}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(){
/**
* @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
* Released under MIT license, http://github.com/requirejs/almond/LICENSE
*/var requirejs,require,define;!function(f){var o,i,d,h,m={},y={},g={},v={},n=Object.prototype.hasOwnProperty,r=[].slice,b=/\.js$/;function w(e,t){return n.call(e,t)}function s(e,t){var n,r,a,o,i,s,c,u,l,p,f=t&&t.split("/"),d=g.map,h=d&&d["*"]||{};if(e){for(t=(e=e.split("/")).length-1,g.nodeIdCompat&&b.test(e[t])&&(e[t]=e[t].replace(b,"")),"."===e[0].charAt(0)&&f&&(e=f.slice(0,f.length-1).concat(e)),u=0;u<e.length;u++)"."===(p=e[u])?(e.splice(u,1),--u):".."!==p||0===u||1===u&&".."===e[2]||".."===e[u-1]||0<u&&(e.splice(u-1,2),u-=2);e=e.join("/")}if((f||h)&&d){for(u=(n=e.split("/")).length;0<u;--u){if(r=n.slice(0,u).join("/"),f)for(l=f.length;0<l;--l)if(a=(a=d[f.slice(0,l).join("/")])&&a[r]){o=a,i=u;break}if(o)break;!s&&h&&h[r]&&(s=h[r],c=u)}!o&&s&&(o=s,i=c),o&&(n.splice(0,i,o),e=n.join("/"))}return e}function T(t,n){return function(){var e=r.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),i.apply(f,e.concat([t,n]))}}function k(e){var t;if(w(y,e)&&(t=y[e],delete y[e],v[e]=!0,o.apply(f,t)),w(m,e)||w(v,e))return m[e];throw new Error("No "+e)}function c(e){var t,n=e?e.indexOf("!"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function S(e){return e?c(e):[]}d=function(e,t){var n,r,a=c(e),o=a[0],t=t[1];return e=a[1],o&&(n=k(o=s(o,t))),o?e=n&&n.normalize?n.normalize(e,(r=t,function(e){return s(e,r)})):s(e,t):(o=(a=c(e=s(e,t)))[0],e=a[1],o&&(n=k(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},h={require:function(e){return T(e)},exports:function(e){var t=m[e];return void 0!==t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:(t=e,function(){return g&&g.config&&g.config[t]||{}})};var t}},o=function(e,t,n,r){var a,o,i,s,c,u=[],l=_typeof(n),p=S(r=r||e);if("undefined"===l||"function"===l){for(t=!t.length&&n.length?["require","exports","module"]:t,s=0;s<t.length;s+=1)if("require"===(o=(i=d(t[s],p)).f))u[s]=h.require(e);else if("exports"===o)u[s]=h.exports(e),c=!0;else if("module"===o)a=u[s]=h.module(e);else if(w(m,o)||w(y,o)||w(v,o))u[s]=k(o);else{if(!i.p)throw new Error(e+" missing "+o);i.p.load(i.n,T(r,!0),function(t){return function(e){m[t]=e}}(o),{}),u[s]=m[o]}l=n?n.apply(m[e],u):void 0,e&&(a&&a.exports!==f&&a.exports!==m[e]?m[e]=a.exports:l===f&&c||(m[e]=l))}else e&&(m[e]=n)},requirejs=require=i=function(e,t,n,r,a){if("string"==typeof e)return h[e]?h[e](t):k(d(e,S(t)).f);if(!e.splice){if((g=e).deps&&i(g.deps,g.callback),!t)return;t.splice?(e=t,t=n,n=null):e=f}return t=t||function(){},"function"==typeof n&&(n=r,r=a),r?o(f,e,t,n):setTimeout(function(){o(f,e,t,n)},4),i},i.config=function(e){return i(e)},requirejs._defined=m,(define=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),w(m,e)||w(y,e)||(y[e]=[e,t,n])}).amd={jQuery:!0}}(),define("almond",function(){}),
/*!
* https://github.com/paulmillr/es6-shim
* @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com)
* and contributors, MIT License
* es6-shim: v0.35.4
* see https://github.com/paulmillr/es6-shim/blob/0.35.3/LICENSE
* Details and documentation:
* https://github.com/paulmillr/es6-shim/
*/
!function(e,t){"function"==typeof define&&define.amd?define("es6-shim",t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?module.exports=t():e.returnExports=t()}(this,function(){function t(e){try{return e(),!1}catch(e){return!0}}function r(e){try{return e()}catch(e){return!1}}function w(n,r,a){c(i(r),function(e){var t=r[e];u(n,e,t,!!a)})}function D(n,e){return!!Object.setPrototypeOf&&r(function(){function t(e){return e=new n(e),Object.setPrototypeOf(e,t.prototype),e}return Object.setPrototypeOf(t,n),t.prototype=ge(n.prototype,{constructor:{value:t}}),e(t)})}function V(){}function L(e){return(e=Number(e))<-1||m(e)?NaN:0===e||e===1/0?e:-1===e?-1/0:1+e-1==0?e:e*(Ne(1+e)/(1+e-1))}function F(e){return"[object Arguments]"===l(e)}function a(e,t,n){var r=e[t];u(e,t,n,!0),p(e[t],r)}function q(t,n,r){p(n,t),Object.setPrototypeOf&&Object.setPrototypeOf(t,n),s?c(Object.getOwnPropertyNames(t),function(e){e in V||r[e]||he(t,e,n)}):c(Object.keys(t),function(e){e in V||r[e]||(n[e]=t[e])}),n.prototype=t.prototype,me(t.prototype,"constructor",n)}function H(){return this}function z(e){s&&!Ie(e,Le)&&de(e,Le,H)}function e(e,t){u(e,g,t=t||function(){return this}),!e[g]&&y.symbol(g)&&(e[g]=t)}function W(e,t,n){var r,a,o;if(r=e,a=t,o=n,s?Object.defineProperty(r,a,{configurable:!0,enumerable:!0,writable:!0,value:o}):r[a]=o,!S.SameValue(e[t],n))throw new TypeError("property is nonconfigurable")}function B(e,t,n,r){if(!S.TypeIsObject(e))throw new TypeError("Constructor requires `new`: "+t.name);var a,o,e=t.prototype,i=(S.TypeIsObject(e)||(e=n),ge(e));for(a in r)Ie(r,a)&&(o=r[a],u(i,a,o,!0));return i}function $(e,t){return t<1?"":t%2?$(e,t-1)+e:(e=$(e,t/2))+e}function U(){return S.ToString(S.RequireObjectCoercible(this)).replace(Ue,"")}function G(e){return{value:e,done:0===arguments.length}}function X(e){S.RequireObjectCoercible(e),this._s=S.ToString(e),this._i=0}var Y,o,J,K,Z,Q,ee,te,ne,re,ae,oe,ie=Function.call.bind(Function.apply),T=Function.call.bind(Function.call),se=Array.isArray,i=Object.keys,ce=(Y=t,function(){return!ie(Y,this,arguments)}),s=!!Object.defineProperty&&!t(function(){Object.defineProperty({},"x",{get:function(){}})}),ue="foo"===function(){}.name,c=Function.call.bind(Array.prototype.forEach),le=Function.call.bind(Array.prototype.reduce),pe=Function.call.bind(Array.prototype.filter),n=Function.call.bind(Array.prototype.some),u=function(e,t,n,r){!r&&t in e||(s?Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:n}):e[t]=n)},l=Function.call.bind(Object.prototype.toString),fe="function"==typeof/abc/?function(e){return"function"==typeof e&&"[object Function]"===l(e)}:function(e){return"function"==typeof e},de=function(e,t,n){if(!s)throw new TypeError("getters require true ES5 support");Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get:n})},he=function(t,n,e){if(!s)throw new TypeError("getters require true ES5 support");var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,{configurable:r.configurable,enumerable:r.enumerable,get:function(){return t[n]},set:function(e){t[n]=e}})},me=function(e,t,n){var r;s?((r=Object.getOwnPropertyDescriptor(e,t)).value=n,Object.defineProperty(e,t,r)):e[t]=n},ye=function(e,t,n){s?Object.defineProperty(e,t,n):"value"in n&&(e[t]=n.value)},p=function(e,t){t&&fe(t.toString)&&u(e,"toString",t.toString.bind(t),!0)},ge=Object.create||function(e,t){function n(){}n.prototype=e;var r=new n;return void 0!==t&&i(t).forEach(function(e){ye(r,e,t[e])}),r},k=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}(),ve=k.isFinite,be=Function.call.bind(String.prototype.indexOf),we=Function.apply.bind(Array.prototype.indexOf),Te=Function.call.bind(Array.prototype.concat),ke=Function.call.bind(String.prototype.slice),Se=Function.call.bind(Array.prototype.push),xe=Function.apply.bind(Array.prototype.push),Oe=Function.call.bind(Array.prototype.join),_e=Function.call.bind(Array.prototype.shift),Ce=Math.max,Ee=Math.min,Ae=Math.floor,f=Math.abs,je=Math.exp,Ne=Math.log,Pe=Math.sqrt,Ie=Function.call.bind(Object.prototype.hasOwnProperty),d=k.Map,Re=d&&d.prototype.delete,Me=d&&d.prototype.get,De=d&&d.prototype.has,Ve=d&&d.prototype.set,h=k.Symbol||{},Le=h.species||"@@species",m=Number.isNaN||function(e){return e!=e},Fe=Number.isFinite||function(e){return"number"==typeof e&&ve(e)},qe=fe(Math.sign)?Math.sign:function(e){e=Number(e);return 0===e||m(e)?e:e<0?-1:1},He=F(arguments)?F:function(e){return null!==e&&"object"===_typeof(e)&&"number"==typeof e.length&&0<=e.length&&"[object Array]"!==l(e)&&"[object Function]"===l(e.callee)},y={primitive:function(e){return null===e||"function"!=typeof e&&"object"!==_typeof(e)},string:function(e){return"[object String]"===l(e)},regex:function(e){return"[object RegExp]"===l(e)},symbol:function(e){return"function"==typeof k.Symbol&&"symbol"===_typeof(e)}},ze="function"==typeof h&&"function"==typeof h.for&&y.symbol(h()),g=y.symbol(h.iterator)?h.iterator:"_es6-shim iterator_",We=(k.Set&&"function"==typeof(new k.Set)["@@iterator"]&&(g="@@iterator"),k.Reflect||u(k,"Reflect",{},!0),k.Reflect),Be=String,$e="undefined"!=typeof document&&document?document.all:null,v=null==$e?function(e){return null==e}:function(e){return null==e&&e!==$e},S={Call:function(e,t){var n=2<arguments.length?arguments[2]:[];if(S.IsCallable(e))return ie(e,t,n);throw new TypeError(e+" is not a function")},RequireObjectCoercible:function(e,t){if(v(e))throw new TypeError(t||"Cannot call method on "+e);return e},TypeIsObject:function(e){return null!=e&&!0!==e&&!1!==e&&("function"==typeof e||"object"===_typeof(e)||e===$e)},ToObject:function(e,t){return Object(S.RequireObjectCoercible(e,t))},IsCallable:fe,IsConstructor:function(e){return S.IsCallable(e)},ToInt32:function(e){return S.ToNumber(e)>>0},ToUint32:function(e){return S.ToNumber(e)>>>0},ToNumber:function(e){if(ze&&"[object Symbol]"===l(e))throw new TypeError("Cannot convert a Symbol value to a number");return+e},ToInteger:function(e){e=S.ToNumber(e);return m(e)?0:0!==e&&Fe(e)?(0<e?1:-1)*Ae(f(e)):e},ToLength:function(e){e=S.ToInteger(e);return e<=0?0:e>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e},SameValue:function(e,t){return e===t?0!==e||1/e==1/t:m(e)&&m(t)},SameValueZero:function(e,t){return e===t||m(e)&&m(t)},IsIterable:function(e){return S.TypeIsObject(e)&&(void 0!==e[g]||He(e))},GetIterator:function(e){if(He(e))return new o(e,"value");var t=S.GetMethod(e,g);if(!S.IsCallable(t))throw new TypeError("value is not an iterable");t=S.Call(t,e);if(S.TypeIsObject(t))return t;throw new TypeError("bad iterator")},GetMethod:function(e,t){e=S.ToObject(e)[t];if(!v(e)){if(S.IsCallable(e))return e;throw new TypeError("Method not callable: "+t)}},IteratorComplete:function(e){return!!e.done},IteratorClose:function(e,t){var n,r,a=S.GetMethod(e,"return");if(void 0!==a){try{n=S.Call(a,e)}catch(e){r=e}if(!t){if(r)throw r;if(!S.TypeIsObject(n))throw new TypeError("Iterator's return method returned a non-object.")}}},IteratorNext:function(e){e=1<arguments.length?e.next(arguments[1]):e.next();if(S.TypeIsObject(e))return e;throw new TypeError("bad iterator")},IteratorStep:function(e){e=S.IteratorNext(e);return!S.IteratorComplete(e)&&e},Construct:function(e,t,n,r){n=void 0===n?e:n;if(!r&&We.construct)return We.construct(e,t,n);r=n.prototype,S.TypeIsObject(r)||(r=Object.prototype),n=ge(r),r=S.Call(e,n,t);return S.TypeIsObject(r)?r:n},SpeciesConstructor:function(e,t){e=e.constructor;if(void 0===e)return t;if(!S.TypeIsObject(e))throw new TypeError("Bad constructor");e=e[Le];if(v(e))return t;if(S.IsConstructor(e))return e;throw new TypeError("Bad @@species")},CreateHTML:function(e,t,n,r){var e=S.ToString(e),a="<"+t;return""!==n&&(a+=" "+n+'="'+S.ToString(r).replace(/"/g,""")+'"'),a+">"+e+"</"+t+">"},IsRegExp:function(e){if(!S.TypeIsObject(e))return!1;var t=e[h.match];return void 0!==t?!!t:y.regex(e)},ToString:function(e){if(ze&&"[object Symbol]"===l(e))throw new TypeError("Cannot convert a Symbol value to a number");return Be(e)}},b=(s&&ze&&(x=function(e){if(y.symbol(h[e]))return h[e];var t=h.for("Symbol."+e);return Object.defineProperty(h,e,{configurable:!1,enumerable:!1,writable:!1,value:t}),t},y.symbol(h.search)||(J=x("search"),K=String.prototype.search,u(RegExp.prototype,J,function(e){return S.Call(K,e,[this])}),a(String.prototype,"search",function(e){var t=S.RequireObjectCoercible(this);if(!v(e)){var n=S.GetMethod(e,J);if(void 0!==n)return S.Call(n,e,[t])}return S.Call(K,t,[S.ToString(e)])})),y.symbol(h.replace)||(Z=x("replace"),Q=String.prototype.replace,u(RegExp.prototype,Z,function(e,t){return S.Call(Q,e,[this,t])}),a(String.prototype,"replace",function(e,t){var n=S.RequireObjectCoercible(this);if(!v(e)){var r=S.GetMethod(e,Z);if(void 0!==r)return S.Call(r,e,[n,t])}return S.Call(Q,n,[S.ToString(e),t])})),y.symbol(h.split)||(ee=x("split"),te=String.prototype.split,u(RegExp.prototype,ee,function(e,t){return S.Call(te,e,[this,t])}),a(String.prototype,"split",function(e,t){var n=S.RequireObjectCoercible(this);if(!v(e)){var r=S.GetMethod(e,ee);if(void 0!==r)return S.Call(r,e,[n,t])}return S.Call(te,n,[S.ToString(e),t])})),ae=(b=y.symbol(h.match))&&((ae={})[h.match]=function(){return 42},42!=="a".match(ae)),b&&!ae||(ne=x("match"),re=String.prototype.match,u(RegExp.prototype,ne,function(e){return S.Call(re,e,[this])}),a(String.prototype,"match",function(e){var t=S.RequireObjectCoercible(this);if(!v(e)){var n=S.GetMethod(e,ne);if(void 0!==n)return S.Call(n,e,[t])}return S.Call(re,t,[S.ToString(e)])}))),String.fromCodePoint&&1!==String.fromCodePoint.length&&(oe=String.fromCodePoint,a(String,"fromCodePoint",function(e){return S.Call(oe,this,arguments)})),{fromCodePoint:function(e){for(var t,n=[],r=0,a=arguments.length;r<a;r++){if(t=Number(arguments[r]),!S.SameValue(t,S.ToInteger(t))||t<0||1114111<t)throw new RangeError("Invalid code point "+t);t<65536?Se(n,String.fromCharCode(t)):(t-=65536,Se(n,String.fromCharCode(55296+(t>>10))),Se(n,String.fromCharCode(t%1024+56320)))}return Oe(n,"")},raw:function(e){var t,e=S.ToObject(e,"bad template"),e=(t=S.ToObject(e.raw,"bad raw value")).length,n=S.ToLength(e);if(n<=0)return"";for(var r,a=[],o=0;o<n&&(r=S.ToString(o),r=S.ToString(t[r]),Se(a,r),!(n<=o+1));)r=S.ToString(o+1<arguments.length?arguments[o+1]:""),Se(a,r),o+=1;return Oe(a,"")}}),x=(String.raw&&"xy"!==String.raw({raw:{0:"x",1:"y",length:2}})&&a(String,"raw",b.raw),w(String,b),{repeat:function(e){var t=S.ToString(S.RequireObjectCoercible(this)),e=S.ToInteger(e);if(e<0||1/0<=e)throw new RangeError("repeat count must be less than infinity and not overflow maximum string size");return $(t,e)},startsWith:function(e){var t=S.ToString(S.RequireObjectCoercible(this));if(S.IsRegExp(e))throw new TypeError('Cannot call method "startsWith" with a regex');var e=S.ToString(e),n=Ce(S.ToInteger(n=1<arguments.length?arguments[1]:n),0);return ke(t,n,n+e.length)===e},endsWith:function(e){var t=S.ToString(S.RequireObjectCoercible(this));if(S.IsRegExp(e))throw new TypeError('Cannot call method "endsWith" with a regex');var e=S.ToString(e),n=t.length,r=void 0===(r=1<arguments.length?arguments[1]:r)?n:S.ToInteger(r),r=Ee(Ce(r,0),n);return ke(t,r-e.length,r)===e},includes:function(e){if(S.IsRegExp(e))throw new TypeError('"includes" does not accept a RegExp');var t,e=S.ToString(e);return-1!==be(this,e,t=1<arguments.length?arguments[1]:t)},codePointAt:function(e){var t=S.ToString(S.RequireObjectCoercible(this)),e=S.ToInteger(e),n=t.length;if(0<=e&&e<n){var r=t.charCodeAt(e);if(r<55296||56319<r||e+1===n)return r;n=t.charCodeAt(e+1);return n<56320||57343<n?r:1024*(r-55296)+(n-56320)+65536}}}),b=(String.prototype.includes&&!1!=="a".includes("a",1/0)&&a(String.prototype,"includes",x.includes),String.prototype.startsWith&&String.prototype.endsWith&&(b=t(function(){"/a/".startsWith(/a/)}),O=r(function(){return!1==="abc".startsWith("a",1/0)}),b&&O||(a(String.prototype,"startsWith",x.startsWith),a(String.prototype,"endsWith",x.endsWith))),ze&&(r(function(){var e=/a/;return e[h.match]=!1,"/a/".startsWith(e)})||a(String.prototype,"startsWith",x.startsWith),r(function(){var e=/a/;return e[h.match]=!1,"/a/".endsWith(e)})||a(String.prototype,"endsWith",x.endsWith),r(function(){var e=/a/;return e[h.match]=!1,"/a/".includes(e)})||a(String.prototype,"includes",x.includes)),w(String.prototype,x),["\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003","\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028","\u2029\ufeff"].join("")),Ue=new RegExp("(^["+b+"]+)|(["+b+"]+$)","g"),O=["\x85","\u200b","\ufffe"].join(""),x=new RegExp("["+O+"]","g"),b=/^[-+]0x[0-9a-f]+$/i,_=O.trim().length!==O.length,_=(u(String.prototype,"trim",U,_),X.prototype.next=function(){var e=this._s,t=this._i;if(void 0===e||t>=e.length)return this._s=void 0,G();var n=e.charCodeAt(t),n=n<55296||56319<n||t+1===e.length||(n=e.charCodeAt(t+1))<56320||57343<n?1:2;return this._i=t+n,G(e.substr(t,n))},e(X.prototype),e(String.prototype,function(){return new X(this)}),{from:function(e){var t,n,r;if(void 0===(t=1<arguments.length?arguments[1]:t))n=!1;else{if(!S.IsCallable(t))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(r=arguments[2]),n=!0}if(void 0!==(He(e)||S.GetMethod(e,g))){for(var a,o=S.IsConstructor(this)?Object(new this):[],i=S.GetIterator(e),s=0;;){if(!1===(a=S.IteratorStep(i)))break;a=a.value;try{n&&(a=void 0===r?t(a,s):T(t,r,a,s)),o[s]=a}catch(e){throw S.IteratorClose(i,!0),e}s+=1}l=s}else{var c,u=S.ToObject(e),l=S.ToLength(u.length);for(o=S.IsConstructor(this)?Object(new this(l)):new Array(l),s=0;s<l;++s)c=u[s],n&&(c=void 0===r?t(c,s):T(t,r,c,s)),W(o,s,c)}return o.length=l,o},of:function(){for(var e=arguments.length,t=se(this)||!S.IsCallable(this)?new Array(e):S.Construct(this,[e]),n=0;n<e;++n)W(t,n,arguments[n]);return t.length=e,t}});function Ge(e){this.length=e}w(Array,_),z(Array),w((o=function(e,t){this.i=0,this.array=e,this.kind=t}).prototype,{next:function(){var e,t,n=this.i,r=this.array;if(!(this instanceof o))throw new TypeError("Not an ArrayIterator");if(void 0!==r&&n<S.ToLength(r.length))return"key"===(e=this.kind)?t=n:"value"===e?t=r[n]:"entry"===e&&(t=[n,r[n]]),this.i=n+1,G(t);return this.array=void 0,G()}}),e(o.prototype),Array.of===_.of||(Ge.prototype=[],(Ye=Array.of.apply(Ge,[1,2]))instanceof Ge&&2===Ye.length)||a(Array,"of",_.of);var Xe,Ye={copyWithin:function(e,t){var n,r=S.ToObject(this),a=S.ToLength(r.length),e=S.ToInteger(e),t=S.ToInteger(t),o=e<0?Ce(a+e,0):Ee(e,a),i=t<0?Ce(a+t,0):Ee(t,a),e=void 0===(n=2<arguments.length?arguments[2]:n)?a:S.ToInteger(n),t=e<0?Ce(a+e,0):Ee(e,a),s=Ee(t-i,a-o),c=1;for(i<o&&o<i+s&&(c=-1,i+=s-1,o+=s-1);0<s;)i in r?r[o]=r[i]:delete r[o],i+=c,o+=c,--s;return r},fill:function(e){1<arguments.length&&(r=arguments[1]),2<arguments.length&&(a=arguments[2]);for(var t=S.ToObject(this),n=S.ToLength(t.length),r=S.ToInteger(void 0===r?0:r),a=S.ToInteger(void 0===a?n:a),o=a<0?n+a:a,i=r<0?Ce(n+r,0):Ee(r,n);i<n&&i<o;++i)t[i]=e;return t},find:function(e){var t=S.ToObject(this),n=S.ToLength(t.length);if(!S.IsCallable(e))throw new TypeError("Array#find: predicate must be a function");for(var r,a=1<arguments.length?arguments[1]:null,o=0;o<n;o++)if(r=t[o],a){if(T(e,a,r,o,t))return r}else if(e(r,o,t))return r},findIndex:function(e){var t=S.ToObject(this),n=S.ToLength(t.length);if(!S.IsCallable(e))throw new TypeError("Array#findIndex: predicate must be a function");for(var r=1<arguments.length?arguments[1]:null,a=0;a<n;a++)if(r){if(T(e,r,t[a],a,t))return a}else if(e(t[a],a,t))return a;return-1},keys:function(){return new o(this,"key")},values:function(){return new o(this,"value")},entries:function(){return new o(this,"entry")}},C=(Array.prototype.keys&&!S.IsCallable([1].keys().next)&&delete Array.prototype.keys,Array.prototype.entries&&!S.IsCallable([1].entries().next)&&delete Array.prototype.entries,Array.prototype.keys&&Array.prototype.entries&&!Array.prototype.values&&Array.prototype[g]&&(w(Array.prototype,{values:Array.prototype[g]}),y.symbol(h.unscopables)&&(Array.prototype[h.unscopables].values=!0)),ue&&Array.prototype.values&&"values"!==Array.prototype.values.name&&(Xe=Array.prototype.values,a(Array.prototype,"values",function(){return S.Call(Xe,this,arguments)}),u(Array.prototype,g,Array.prototype.values,!0)),w(Array.prototype,Ye),1/[!0].indexOf(!0,-0)<0&&u(Array.prototype,"indexOf",function(e){var t=we(this,arguments);return 0===t&&1/t<0?0:t},!0),e(Array.prototype,function(){return this.values()}),Object.getPrototypeOf&&e(Object.getPrototypeOf([].values())),r(function(){return 0===Array.from({length:-1}).length})),E=1===(E=Array.from([0].entries())).length&&se(E[0])&&0===E[0][0]&&0===E[0][1];C&&E||a(Array,"from",_.from);function Je(e,t){var n={length:ut};return n[t?(n.length>>>0)-1:0]=!0,r(function(){return T(e,n,function(){throw new RangeError("should not reach here")},[]),!0})}r(function(){return Array.from([0],void 0)})||(Ke=Array.from,a(Array,"from",function(e){return 1<arguments.length&&void 0!==arguments[1]?S.Call(Ke,this,arguments):T(Ke,this,e)}));var Ke,Ze,Qe,et,tt,nt,rt,at,A,ot,it,st,ct,ut=-(Math.pow(2,32)-1),C=(Je(Array.prototype.forEach)||(Ze=Array.prototype.forEach,a(Array.prototype,"forEach",function(e){return S.Call(Ze,0<=this.length?this:[],arguments)})),Je(Array.prototype.map)||(Qe=Array.prototype.map,a(Array.prototype,"map",function(e){return S.Call(Qe,0<=this.length?this:[],arguments)})),Je(Array.prototype.filter)||(et=Array.prototype.filter,a(Array.prototype,"filter",function(e){return S.Call(et,0<=this.length?this:[],arguments)})),Je(Array.prototype.some)||(tt=Array.prototype.some,a(Array.prototype,"some",function(e){return S.Call(tt,0<=this.length?this:[],arguments)})),Je(Array.prototype.every)||(nt=Array.prototype.every,a(Array.prototype,"every",function(e){return S.Call(nt,0<=this.length?this:[],arguments)})),Je(Array.prototype.reduce)||(rt=Array.prototype.reduce,a(Array.prototype,"reduce",function(e){return S.Call(rt,0<=this.length?this:[],arguments)})),Je(Array.prototype.reduceRight,!0)||(at=Array.prototype.reduceRight,a(Array.prototype,"reduceRight",function(e){return S.Call(at,0<=this.length?this:[],arguments)})),8!==Number("0o10")),E=2!==Number("0b10"),_=n(O,function(e){return 0===Number(e+0+e)});function lt(e){var e=0<arguments.length?y.primitive(e)?e:function(e){var t;if("function"==typeof e.valueOf&&(t=e.valueOf(),y.primitive(t)))return t;if("function"==typeof e.toString&&(t=e.toString(),y.primitive(t)))return t;throw new TypeError("No default value")}(e):0,t=("string"==typeof e&&(e=S.Call(U,e),ot(e)?e=parseInt(ke(e,2),2):it(e)?e=parseInt(ke(e,2),8):(st(e)||ct(e))&&(e=NaN)),this),n=r(function(){return A.prototype.valueOf.call(t),!0});return t instanceof lt&&!n?new A(e):A(e)}(C||E||_)&&(A=Number,n=/^0o[0-7]+$/i,ot=(O=/^0b[01]+$/i).test.bind(O),it=n.test.bind(n),st=x.test.bind(x),ct=b.test.bind(b),q(A,C=lt,{}),w(C,{NaN:A.NaN,MAX_VALUE:A.MAX_VALUE,MIN_VALUE:A.MIN_VALUE,NEGATIVE_INFINITY:A.NEGATIVE_INFINITY,POSITIVE_INFINITY:A.POSITIVE_INFINITY}),Number=C,me(k,"Number",C));function pt(e,t){s&&bt(e,t)&&Object.defineProperty(e,t,{enumerable:!1})}function ft(){for(var e=Number(this),t=arguments.length,n=t-e,r=new Array(n<0?0:n),a=e;a<t;++a)r[a-e]=arguments[a];return r}function dt(n){return function(e,t){return e[t]=n[t],e}}function ht(e,t){var n,r=i(Object(t));return S.IsCallable(Object.getOwnPropertySymbols)&&(n=pe(Object.getOwnPropertySymbols(Object(t)),bt(t))),le(Te(r,n||[]),dt(t),e)}var mt,yt,gt,vt,E=Math.pow(2,53)-1,bt=(w(Number,{MAX_SAFE_INTEGER:E,MIN_SAFE_INTEGER:-E,EPSILON:2220446049250313e-31,parseInt:k.parseInt,parseFloat:k.parseFloat,isFinite:Fe,isInteger:function(e){return Fe(e)&&S.ToInteger(e)===e},isSafeInteger:function(e){return Number.isInteger(e)&&f(e)<=Number.MAX_SAFE_INTEGER},isNaN:m}),u(Number,"parseInt",k.parseInt,Number.parseInt!==k.parseInt),1===[,1].find(function(){return!0})&&a(Array.prototype,"find",Ye.find),0!==[,1].findIndex(function(){return!0})&&a(Array.prototype,"findIndex",Ye.findIndex),Function.bind.call(Function.bind,Object.prototype.propertyIsEnumerable)),_={assign:function(e,t){e=S.ToObject(e,"Cannot convert undefined or null to object");return le(S.Call(ft,1,arguments),ht,e)},is:function(e,t){return S.SameValue(e,t)}};Object.assign&&Object.preventExtensions&&function(){var t=Object.preventExtensions({1:2});try{Object.assign(t,"xy")}catch(e){return"y"===t[1]}}()&&a(Object,"assign",_.assign),w(Object,_),s&&(O={setPrototypeOf:function(t,n){function r(e,t){var n=e,r=t;if(!S.TypeIsObject(n))throw new TypeError("cannot set prototype on a non-object");if(null===r||S.TypeIsObject(r))return T(a,e,t),e;throw new TypeError("can only set prototype to an object or null"+r)}var a;try{a=t.getOwnPropertyDescriptor(t.prototype,n).set,T(a,{},null)}catch(e){if(t.prototype!=={}[n])return;a=function(e){this[n]=e},r.polyfill=r(r({},null),t.prototype)instanceof t}return r}(Object,"__proto__")},w(Object,O)),Object.setPrototypeOf&&Object.getPrototypeOf&&null!==Object.getPrototypeOf(Object.setPrototypeOf({},null))&&null===Object.getPrototypeOf(Object.create(null))&&(mt=Object.create(null),yt=Object.getPrototypeOf,gt=Object.setPrototypeOf,Object.getPrototypeOf=function(e){e=yt(e);return e===mt?null:e},Object.setPrototypeOf=function(e,t){return gt(e,null===t?mt:t)},Object.setPrototypeOf.polyfill=!1),t(function(){Object.keys("foo")})&&(vt=Object.keys,a(Object,"keys",function(e){return vt(S.ToObject(e))}),i=Object.keys);function wt(e,t,n){return f(1-e/t)/Number.EPSILON<(n||8)}function Tt(e){var t=i(le(e,function(e,t){return e[t]=!0,e},{}));return e.join(":")===t.join(":")}t(function(){Object.keys(/a/g)})&&(kt=Object.keys,a(Object,"keys",function(e){if(y.regex(e)){var t,n=[];for(t in e)Ie(e,t)&&Se(n,t);return n}return kt(e)}),i=Object.keys),Object.getOwnPropertyNames&&t(function(){Object.getOwnPropertyNames("foo")})&&(St="object"===("undefined"==typeof window?"undefined":_typeof(window))?Object.getOwnPropertyNames(window):[],xt=Object.getOwnPropertyNames,a(Object,"getOwnPropertyNames",function(e){e=S.ToObject(e);if("[object Window]"===l(e))try{return xt(e)}catch(e){return Te([],St)}return xt(e)})),Object.getOwnPropertyDescriptor&&t(function(){Object.getOwnPropertyDescriptor("foo","bar")})&&(Ot=Object.getOwnPropertyDescriptor,a(Object,"getOwnPropertyDescriptor",function(e,t){return Ot(S.ToObject(e),t)})),Object.seal&&t(function(){Object.seal("foo")})&&(_t=Object.seal,a(Object,"seal",function(e){return S.TypeIsObject(e)?_t(e):e})),Object.isSealed&&t(function(){Object.isSealed("foo")})&&(Ct=Object.isSealed,a(Object,"isSealed",function(e){return!S.TypeIsObject(e)||Ct(e)})),Object.freeze&&t(function(){Object.freeze("foo")})&&(Et=Object.freeze,a(Object,"freeze",function(e){return S.TypeIsObject(e)?Et(e):e})),Object.isFrozen&&t(function(){Object.isFrozen("foo")})&&(At=Object.isFrozen,a(Object,"isFrozen",function(e){return!S.TypeIsObject(e)||At(e)})),Object.preventExtensions&&t(function(){Object.preventExtensions("foo")})&&(jt=Object.preventExtensions,a(Object,"preventExtensions",function(e){return S.TypeIsObject(e)?jt(e):e})),Object.isExtensible&&t(function(){Object.isExtensible("foo")})&&(Nt=Object.isExtensible,a(Object,"isExtensible",function(e){return!!S.TypeIsObject(e)&&Nt(e)})),Object.getPrototypeOf&&t(function(){Object.getPrototypeOf("foo")})&&(Pt=Object.getPrototypeOf,a(Object,"getPrototypeOf",function(e){return Pt(S.ToObject(e))}));var kt,St,xt,Ot,_t,Ct,Et,At,jt,Nt,Pt,It,Rt,Mt,Dt,Vt,Lt,Ft,qt,Ht,zt,Wt,j,Bt,$t,Ut,Gt,Xt,Yt,Jt,Kt,Zt,Qt,en,tn,nn,rn,an,on,x=s&&((n=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))&&S.IsCallable(n.get)),b=(s&&!x&&de(RegExp.prototype,"flags",function(){if(!S.TypeIsObject(this))throw new TypeError("Method called on incompatible type: must be an object.");var e="";return this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.unicode&&(e+="u"),this.sticky&&(e+="y"),e}),s&&r(function(){return"/a/i"===String(new RegExp(/a/g,"i"))})),E=ze&&s&&((C=/./)[h.match]=!1,RegExp(C)===C),_=r(function(){return"/abc/"===RegExp.prototype.toString.call({source:"abc"})}),O=_&&r(function(){return"/a/b"===RegExp.prototype.toString.call({source:"a",flags:"b"})}),sn=(_&&O||(It=RegExp.prototype.toString,u(RegExp.prototype,"toString",function(){var e=S.RequireObjectCoercible(this);return y.regex(e)?T(It,e):"/"+Be(e.source)+"/"+Be(e.flags)},!0),p(RegExp.prototype.toString,It)),!s||b&&!E||(Rt=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags").get,n=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")||{},Mt=S.IsCallable(n.get)?n.get:function(){return this.source},q(Dt=RegExp,x=function e(t,n){var r=S.IsRegExp(t);if(!(this instanceof e)&&r&&void 0===n&&t.constructor===e)return t;return y.regex(t)?new e(S.Call(Mt,t),void 0===n?S.Call(Rt,t):n):(r&&(t.source,void 0===n&&t.flags),new Dt(t,n))},{$input:!0}),RegExp=x,me(k,"RegExp",x)),s&&c(i(Vt={input:"$_",lastMatch:"$&",lastParen:"$+",leftContext:"$`",rightContext:"$'"}),function(e){e in RegExp&&!(Vt[e]in RegExp)&&de(RegExp,Vt[e],function(){return RegExp[e]})}),z(RegExp),1/Number.EPSILON),cn=Math.pow(2,-23),un=Math.pow(2,127)*(2-cn),ln=Math.pow(2,-126),pn=Math.E,fn=Math.LOG2E,dn=Math.LOG10E,hn=Number.prototype.clz,C=(delete Number.prototype.clz,{acosh:function(e){var t=Number(e);if(m(t)||e<1)return NaN;if(1===t)return 0;if(t===1/0)return t;e=1/(t*t);if(t<2)return L(t-1+Pe(1-e)*t);t/=2;return L(t+Pe(1-e)*t-1)+1/fn},asinh:function(e){e=Number(e);if(0===e||!ve(e))return e;var t=f(e),n=t*t,e=qe(e);return t<1?e*L(t+n/(Pe(1+n)+1)):e*(L(t/2+Pe(1+1/n)*t/2-1)+1/fn)},atanh:function(e){e=Number(e);if(0===e)return e;if(-1===e)return-1/0;if(1===e)return 1/0;if(m(e)||e<-1||1<e)return NaN;var t=f(e);return qe(e)*L(2*t/(1-t))/2},cbrt:function(e){e=Number(e);if(0===e)return e;var t=e<0,n=(e=t?-e:e)===1/0?1/0:(e/((n=je(Ne(e)/3))*n)+2*n)/3;return t?-n:n},clz32:function(e){e=Number(e),e=S.ToUint32(e);return 0===e?32:hn?S.Call(hn,e):31-Ae(Ne(e+.5)*fn)},cosh:function(e){e=Number(e);if(0===e)return 1;if(m(e))return NaN;if(!ve(e))return 1/0;e=je(f(e)-1);return(e+1/(e*pn*pn))*(pn/2)},expm1:function(e){var t=Number(e);if(t===-1/0)return-1;if(!ve(t)||0===t)return t;if(.5<f(t))return je(t)-1;for(var n=t,r=0,a=1;r+n!==r;)r+=n,n*=t/(a+=1);return r},hypot:function(e,t){for(var n=0,r=0,a=0;a<arguments.length;++a){var o=f(Number(arguments[a]));r<o?(n=n*(r/o*(r/o))+1,r=o):n+=0<o?o/r*(o/r):o}return r===1/0?1/0:r*Pe(n)},log2:function(e){return Ne(e)*fn},log10:function(e){return Ne(e)*dn},log1p:L,sign:qe,sinh:function(e){e=Number(e);if(!ve(e)||0===e)return e;var t=f(e);if(t<1)return n=Math.expm1(t),qe(e)*n*(1+1/(n+1))/2;var n=je(t-1);return qe(e)*(n-1/(n*pn*pn))*(pn/2)},tanh:function(e){e=Number(e);return m(e)||0===e?e:20<=e?1:e<=-20?-1:(Math.expm1(e)-Math.expm1(-e))/(je(e)+je(-e))},trunc:function(e){e=Number(e);return e<0?-Ae(-e):Ae(e)},imul:function(e,t){var e=S.ToUint32(e),t=S.ToUint32(t),n=65535&e,r=65535&t;return n*r+((e>>>16&65535)*r+n*(t>>>16&65535)<<16>>>0)|0},fround:function(e){e=Number(e);if(0===e||e===1/0||e===-1/0||m(e))return e;var t=qe(e),e=f(e);if(e<ln)return t*(e/ln/cn+sn-sn)*ln*cn;var n=(1+cn/Number.EPSILON)*e,n=n-(n-e);return un<n||m(n)?t*(1/0):t*n}}),_=(w(Math,C),u(Math,"sinh",C.sinh,Math.sinh(710)===1/0),u(Math,"cosh",C.cosh,Math.cosh(710)===1/0),u(Math,"log1p",C.log1p,-1e-17!==Math.log1p(-1e-17)),u(Math,"asinh",C.asinh,Math.asinh(-1e7)!==-Math.asinh(1e7)),u(Math,"asinh",C.asinh,Math.asinh(1e300)===1/0),u(Math,"atanh",C.atanh,0===Math.atanh(1e-300)),u(Math,"tanh",C.tanh,-2e-17!==Math.tanh(-2e-17)),u(Math,"acosh",C.acosh,Math.acosh(Number.MAX_VALUE)===1/0),u(Math,"acosh",C.acosh,!wt(Math.acosh(1+Number.EPSILON),Math.sqrt(2*Number.EPSILON))),u(Math,"cbrt",C.cbrt,!wt(Math.cbrt(1e-300),1e-100)),u(Math,"sinh",C.sinh,-2e-17!==Math.sinh(-2e-17)),Math.expm1(10)),O=(u(Math,"expm1",C.expm1,22025.465794806718<_||_<22025.465794806718),u(Math,"hypot",C.hypot,Math.hypot(1/0,NaN)!==1/0),Math.round),b=0===Math.round(.5-Number.EPSILON/4)&&1===Math.round(Number.EPSILON/3.99-.5),E=[1+sn,2*sn-1].every(function(e){return Math.round(e)===e}),mn=(u(Math,"round",function(e){var t=Ae(e);return e-t<.5?t:-1===t?-0:t+1},!b||!E),p(Math.round,O),Math.imul),n=(-5!==Math.imul(4294967295,5)&&(Math.imul=C.imul,p(Math.imul,mn)),2!==Math.imul.length&&a(Math,"imul",function(e,t){return S.Call(mn,Math,arguments)}),function(){var m,e,a,t,n,i,s,c,u,r,o,l,p,y,f,d,h,g,v=k.setTimeout;if("function"==typeof v||"object"===_typeof(v))return S.IsPromise=function(e){return!!S.TypeIsObject(e)&&void 0!==e._promise},m=function(e){if(!S.IsConstructor(e))throw new TypeError("Bad promise constructor");var n=this;if(n.resolve=void 0,n.reject=void 0,n.promise=new e(function(e,t){if(void 0!==n.resolve||void 0!==n.reject)throw new TypeError("Bad Promise implementation!");n.resolve=e,n.reject=t}),!S.IsCallable(n.resolve)||!S.IsCallable(n.reject))throw new TypeError("Bad promise constructor")},"undefined"!=typeof window&&S.IsCallable(window.postMessage)&&(e=function(){var t=[],n="zero-timeout-message";return window.addEventListener("message",function(e){e.source===window&&e.data===n&&(e.stopPropagation(),0!==t.length&&_e(t)())},!0),function(e){Se(t,e),window.postMessage(n,"*")}}),a=S.IsCallable(k.setImmediate)?k.setImmediate:"object"===("undefined"==typeof process?"undefined":_typeof(process))&&process.nextTick?process.nextTick:(t=k.Promise,(n=t&&t.resolve&&t.resolve())?function(e){return n.then(e)}:S.IsCallable(e)?e():function(e){v(e,0)}),i=function(e){return e},s=function(e){throw e},c={},u=function(e,t,n){a(function(){r(e,t,n)})},r=function(e,t,n){var r,a;if(t===c)return e(n);try{r=e(n),a=t.resolve}catch(e){r=e,a=t.reject}a(r)},o=function(e,t){var n=e._promise,r=n.reactionLength;if(0<r&&(u(n.fulfillReactionHandler0,n.reactionCapability0,t),n.fulfillReactionHandler0=void 0,n.rejectReactions0=void 0,n.reactionCapability0=void 0,1<r))for(var a=1,o=0;a<r;a++,o+=3)u(n[o+0],n[o+2],t),e[o+0]=void 0,e[o+1]=void 0,e[o+2]=void 0;n.result=t,n.state=1,n.reactionLength=0},l=function(e,t){var n=e._promise,r=n.reactionLength;if(0<r&&(u(n.rejectReactionHandler0,n.reactionCapability0,t),n.fulfillReactionHandler0=void 0,n.rejectReactions0=void 0,n.reactionCapability0=void 0,1<r))for(var a=1,o=0;a<r;a++,o+=3)u(n[o+1],n[o+2],t),e[o+0]=void 0,e[o+1]=void 0,e[o+2]=void 0;n.result=t,n.state=2,n.reactionLength=0},p=function(n){var r=!1;return{resolve:function(e){var t;if(!r){if(r=!0,e===n)return l(n,new TypeError("Self resolution"));if(!S.TypeIsObject(e))return o(n,e);try{t=e.then}catch(e){return l(n,e)}if(!S.IsCallable(t))return o(n,e);a(function(){f(n,e,t)})}},reject:function(e){if(!r)return r=!0,l(n,e)}}},y=function(e,t,n,r){e===d?T(e,t,n,r,c):T(e,t,n,r)},f=function(t,e,n){var t=p(t),r=t.resolve,t=t.reject;try{y(n,e,r,t)}catch(e){t(e)}},h=b,g=h.prototype,w(h,{all:function(t){if(!S.TypeIsObject(this))throw new TypeError("Promise is not object");var n,r=new m(this);try{for(var a,e,o,i=a={iterator:n=S.GetIterator(t),done:!1},s=this,c=r,u=i.iterator,l=[],p={count:1},f=0;;){try{if(!1===(e=S.IteratorStep(u))){i.done=!0;break}o=e.value}catch(e){throw i.done=!0,e}l[f]=void 0;var d=s.resolve(o),h=function(t,n,r,a){var o=!1;return function(e){o||(o=!0,n[t]=e,0==--a.count&&(0,r.resolve)(n))}}(f,l,c,p);p.count+=1,y(d.then,d,h,c.reject),f+=1}return 0==--p.count&&(0,c.resolve)(l),c.promise}catch(e){t=e;if(a&&!a.done)try{S.IteratorClose(n,!0)}catch(e){t=e}return(0,r.reject)(t),r.promise}},race:function(t){if(!S.TypeIsObject(this))throw new TypeError("Promise is not object");var n,r=new m(this);try{for(var a,e,o,i,s=a={iterator:n=S.GetIterator(t),done:!1},c=this,u=r,l=s.iterator;;){try{if(!1===(e=S.IteratorStep(l))){s.done=!0;break}o=e.value}catch(e){throw s.done=!0,e}i=c.resolve(o),y(i.then,i,u.resolve,u.reject)}return u.promise}catch(e){t=e;if(a&&!a.done)try{S.IteratorClose(n,!0)}catch(e){t=e}return(0,r.reject)(t),r.promise}},reject:function(e){if(!S.TypeIsObject(this))throw new TypeError("Bad promise constructor");var t=new m(this);return(0,t.reject)(e),t.promise},resolve:function(e){if(!S.TypeIsObject(this))throw new TypeError("Bad promise constructor");if(S.IsPromise(e)&&e.constructor===this)return e;var t=new m(this);return(0,t.resolve)(e),t.promise}}),w(g,{catch:function(e){return this.then(null,e)},then:function(e,t){if(!S.IsPromise(this))throw new TypeError("not a promise");var n,r,a=S.SpeciesConstructor(this,h),a=2<arguments.length&&arguments[2]===c&&a===h?c:new m(a),e=S.IsCallable(e)?e:i,t=S.IsCallable(t)?t:s,o=this._promise;if(0===o.state)0===o.reactionLength?(o.fulfillReactionHandler0=e,o.rejectReactionHandler0=t,o.reactionCapability0=a):(o[0+(r=3*(o.reactionLength-1))]=e,o[1+r]=t,o[2+r]=a),o.reactionLength+=1;else if(1===o.state)n=o.result,u(e,a,n);else{if(2!==o.state)throw new TypeError("unexpected Promise state");n=o.result,u(t,a,n)}return a.promise}}),c=new m(h),d=g.then,h;function b(e){if(!(this instanceof b))throw new TypeError('Constructor Promise requires "new"');if(this&&this._promise)throw new TypeError("Bad construction");if(!S.IsCallable(e))throw new TypeError("not a valid resolver");var t=B(this,b,g,{_promise:{result:void 0,state:0,reactionLength:0,fulfillReactionHandler0:void 0,rejectReactionHandler0:void 0,reactionCapability0:void 0}}),n=p(t),r=n.reject;try{e(n.resolve,r)}catch(e){r(e)}return t}}()),yn=(k.Promise&&(delete k.Promise.accept,delete k.Promise.defer,delete k.Promise.prototype.chain),"function"==typeof n&&(w(k,{Promise:n}),x=D(k.Promise,function(e){return e.resolve(42).then(function(){})instanceof e}),_=!t(function(){k.Promise.reject(42).then(null,5).then(null,V)}),b=t(function(){k.Promise.call(3,V)}),E=function(e){var t=e.resolve(5),e=(t.constructor={},e.resolve(t));try{e.then(null,V).then(null,V)}catch(e){return!0}return t===e}(k.Promise),C=s&&(Wt=0,O=Object.defineProperty({},"then",{get:function(){Wt+=1}}),Promise.resolve(O),1===Wt),(Lt=function e(t){var n=new Promise(t);t(3,function(){}),this.then=n.then,this.constructor=e}).prototype=Promise.prototype,Lt.all=Promise.all,en=r(function(){return!!Lt.all([1,2])}),x&&_&&b&&!E&&C&&!en||(Promise=n,a(k,"Promise",n)),1!==Promise.all.length&&(Ft=Promise.all,a(Promise,"all",function(e){return S.Call(Ft,this,arguments)})),1!==Promise.race.length&&(qt=Promise.race,a(Promise,"race",function(e){return S.Call(qt,this,arguments)})),1!==Promise.resolve.length&&(Ht=Promise.resolve,a(Promise,"resolve",function(e){return S.Call(Ht,this,arguments)})),1!==Promise.reject.length&&(zt=Promise.reject,a(Promise,"reject",function(e){return S.Call(zt,this,arguments)})),pt(Promise,"all"),pt(Promise,"race"),pt(Promise,"resolve"),pt(Promise,"reject"),z(Promise)),Tt(["z","a","bb"])),gn=Tt(["z",1,"a","3",2]);function N(e,t){if(!S.TypeIsObject(e)||(!(n=e)._es6set||void 0===n._storage))throw new TypeError("Set.prototype."+t+" called on incompatible receiver "+S.ToString(e));var n}function P(){if(!(this instanceof P))throw new TypeError('Constructor Set requires "new"');if(this&&this._es6set)throw new TypeError("Bad construction");var e=B(this,P,tn,{_es6set:!0,"[[SetData]]":null,_storage:Bt()});if(e._es6set)return 0<arguments.length&&Ut(P,e,arguments[0]),e;throw new TypeError("bad set")}function vn(e){var t;e["[[SetData]]"]||(t=new Gt.Map,e["[[SetData]]"]=t,c(i(e._storage),function(e){e=function(e){var t;if("^null"===e)return null;if("^undefined"!==e)return t=e.charAt(0),"$"===t?ke(e,1):"n"===t?+ke(e,1):"b"===t?"btrue"===e:+e}(e);t.set(e,e)}),e["[[SetData]]"]=t),e._storage=null}function bn(e,t){this.key=e,this.value=t,this.next=null,this.prev=null}function I(e,t){if(!S.TypeIsObject(e)||!an(e))throw new TypeError("Method Map.prototype."+t+" called on incompatible receiver "+S.ToString(e))}function wn(e,t){I(e,"[[MapIterator]]"),this.head=e._head,this.i=this.head,this.kind=t}function Tn(){if(!(this instanceof Tn))throw new TypeError('Constructor Map requires "new"');if(this&&this._es6map)throw new TypeError("Bad construction");var e=B(this,Tn,on,{_es6map:!0,_head:null,_map:d?new d:null,_size:0,_storage:Bt()}),t=new bn(null,null);return t.next=t.prev=t,e._head=t,0<arguments.length&&$t(Tn,e,arguments[0]),e}s&&(j=function(e,t){return t||yn?v(e)?"^"+S.ToString(e):"string"==typeof e?"$"+e:"number"==typeof e?gn?e:"n"+e:"boolean"==typeof e?"b"+e:null:null},Bt=function(){return Object.create?Object.create(null):{}},$t=function(e,n,t){if(se(t)||y.string(t))c(t,function(e){if(!S.TypeIsObject(e))throw new TypeError("Iterator value "+e+" is not an entry object");n.set(e[0],e[1])});else if(t instanceof e)T(e.prototype.forEach,t,function(e,t){n.set(t,e)});else{var r,a;if(!v(t)){if(a=n.set,!S.IsCallable(a))throw new TypeError("bad map");r=S.GetIterator(t)}if(void 0!==r)for(;;){var o=S.IteratorStep(r);if(!1===o)break;o=o.value;try{if(!S.TypeIsObject(o))throw new TypeError("Iterator value "+o+" is not an entry object");T(a,n,o[0],o[1])}catch(e){throw S.IteratorClose(r,!0),e}}}},Ut=function(e,t,n){if(se(n)||y.string(n))c(n,function(e){t.add(e)});else if(n instanceof e)T(e.prototype.forEach,n,function(e){t.add(e)});else{var r,a;if(!v(n)){if(a=t.add,!S.IsCallable(a))throw new TypeError("bad set");r=S.GetIterator(n)}if(void 0!==r)for(;;){var o=S.IteratorStep(r);if(!1===o)break;o=o.value;try{T(a,t,o)}catch(e){throw S.IteratorClose(r,!0),e}}}},Gt={Map:(rn={},bn.prototype.isRemoved=function(){return this.key===rn},an=function(e){return!!e._es6map},e(wn.prototype={isMapIterator:!0,next:function(){if(!this.isMapIterator)throw new TypeError("Not a MapIterator");var e,t=this.i,n=this.kind,r=this.head;if(void 0!==this.i){for(;t.isRemoved()&&t!==r;)t=t.prev;for(;t.next!==r;)if(!(t=t.next).isRemoved())return e="key"===n?t.key:"value"===n?t.value:[t.key,t.value],this.i=t,G(e);this.i=void 0}return G()}}),de(on=Tn.prototype,"size",function(){if(void 0===this._size)throw new TypeError("size method called on incompatible Map");return this._size}),w(on,{get:function(e){I(this,"get");var t,n=j(e,!0);if(null!==n)return(t=this._storage[n])?t.value:void 0;if(this._map)return(t=Me.call(this._map,e))?t.value:void 0;for(var r=this._head,a=r;(a=a.next)!==r;)if(S.SameValueZero(a.key,e))return a.value},has:function(e){I(this,"has");var t=j(e,!0);if(null!==t)return void 0!==this._storage[t];if(this._map)return De.call(this._map,e);for(var n=this._head,r=n;(r=r.next)!==n;)if(S.SameValueZero(r.key,e))return!0;return!1},set:function(e,t){I(this,"set");var n,r=this._head,a=r,o=j(e,!0);if(null!==o){if(void 0!==this._storage[o])return this._storage[o].value=t,this;n=this._storage[o]=new bn(e,t),a=r.prev}else this._map&&(De.call(this._map,e)?Me.call(this._map,e).value=t:(n=new bn(e,t),Ve.call(this._map,e,n),a=r.prev));for(;(a=a.next)!==r;)if(S.SameValueZero(a.key,e))return a.value=t,this;return n=n||new bn(e,t),S.SameValue(-0,e)&&(n.key=0),n.next=this._head,n.prev=this._head.prev,(n.prev.next=n).next.prev=n,this._size+=1,this},delete:function(e){I(this,"delete");var t=this._head,n=t,r=j(e,!0);if(null!==r){if(void 0===this._storage[r])return!1;n=this._storage[r].prev,delete this._storage[r]}else if(this._map){if(!De.call(this._map,e))return!1;n=Me.call(this._map,e).prev,Re.call(this._map,e)}for(;(n=n.next)!==t;)if(S.SameValueZero(n.key,e))return n.key=rn,n.value=rn,n.prev.next=n.next,n.next.prev=n.prev,--this._size,!0;return!1},clear:function(){I(this,"clear"),this._map=d?new d:null,this._size=0,this._storage=Bt();for(var e=this._head,t=e,n=t.next;(t=n)!==e;)t.key=rn,t.value=rn,n=t.next,t.next=t.prev=e;e.next=e.prev=e},keys:function(){return I(this,"keys"),new wn(this,"key")},values:function(){return I(this,"values"),new wn(this,"value")},entries:function(){return I(this,"entries"),new wn(this,"key+value")},forEach:function(e){I(this,"forEach");for(var t=1<arguments.length?arguments[1]:null,n=this.entries(),r=n.next();!r.done;r=n.next())t?T(e,t,r.value[1],r.value[0],this):e(r.value[1],r.value[0],this)}}),e(on,on.entries),Tn),Set:(de(tn=P.prototype,"size",function(){return N(this,"size"),this._storage?i(this._storage).length:(vn(this),this["[[SetData]]"].size)}),w(P.prototype,{has:function(e){var t;return N(this,"has"),this._storage&&null!==(t=j(e))?!!this._storage[t]:(vn(this),this["[[SetData]]"].has(e))},add:function(e){var t;return N(this,"add"),this._storage&&null!==(t=j(e))?this._storage[t]=!0:(vn(this),this["[[SetData]]"].set(e,e)),this},delete:function(e){var t,n;return N(this,"delete"),this._storage&&null!==(t=j(e))?(n=Ie(this._storage,t),delete this._storage[t]&&n):(vn(this),this["[[SetData]]"].delete(e))},clear:function(){N(this,"clear"),this._storage&&(this._storage=Bt()),this["[[SetData]]"]&&this["[[SetData]]"].clear()},values:function(){return N(this,"values"),vn(this),new nn(this["[[SetData]]"].values())},entries:function(){return N(this,"entries"),vn(this),new nn(this["[[SetData]]"].entries())},forEach:function(n){N(this,"forEach");var r=1<arguments.length?arguments[1]:null,a=this;vn(a),this["[[SetData]]"].forEach(function(e,t){r?T(n,r,t,t,a):n(t,t,a)})}}),u(P.prototype,"keys",P.prototype.values,!0),e(P.prototype,P.prototype.values),(nn=function(e){this.it=e}).prototype={isSetIterator:!0,next:function(){if(this.isSetIterator)return this.it.next();throw new TypeError("Not a SetIterator")}},e(nn.prototype),P)},k.Set&&!Set.prototype.delete&&Set.prototype.remove&&Set.prototype.items&&Set.prototype.map&&Array.isArray((new Set).keys)&&(k.Set=Gt.Set),(k.Map||k.Set)&&(r(function(){return 2===new Map([[1,2]]).get(1)})||(k.Map=function e(){if(!(this instanceof e))throw new TypeError('Constructor Map requires "new"');var t=new d;return 0<arguments.length&&$t(e,t,arguments[0]),delete t.constructor,Object.setPrototypeOf(t,k.Map.prototype),t},k.Map.prototype=ge(d.prototype),u(k.Map.prototype,"constructor",k.Map,!0),p(k.Map,d)),x=new Map,(_=new Map([[1,0],[2,0],[3,0],[4,0]])).set(-0,_),b=_.get(0)===_&&_.get(-0)===_&&_.has(0)&&_.has(-0),E=x.set(1,2)===x,b&&E||a(Map.prototype,"set",function(e,t){return T(Ve,this,0===e?0:e,t),this}),b||(w(Map.prototype,{get:function(e){return T(Me,this,0===e?0:e)},has:function(e){return T(De,this,0===e?0:e)}},!0),p(Map.prototype.get,Me),p(Map.prototype.has,De)),C=new Set,n=Set.prototype.delete&&Set.prototype.add&&Set.prototype.has&&((en=C).delete(0),en.add(-0),!en.has(0)),_=C.add(1)===C,n&&_||(Xt=Set.prototype.add,Set.prototype.add=function(e){return T(Xt,this,0===e?0:e),this},p(Set.prototype.add,Xt)),n||(Yt=Set.prototype.has,Set.prototype.has=function(e){return T(Yt,this,0===e?0:e)},p(Set.prototype.has,Yt),Jt=Set.prototype.delete,Set.prototype.delete=function(e){return T(Jt,this,0===e?0:e)},p(Set.prototype.delete,Jt)),x=D(k.Map,function(e){var t=new e([]);return t.set(42,42),t instanceof e}),E=Object.setPrototypeOf&&!x,b=function(){try{return!(k.Map()instanceof k.Map)}catch(e){return e instanceof TypeError}}(),0===k.Map.length&&!E&&b||(k.Map=function e(){if(!(this instanceof e))throw new TypeError('Constructor Map requires "new"');var t=new d;return 0<arguments.length&&$t(e,t,arguments[0]),delete t.constructor,Object.setPrototypeOf(t,e.prototype),t},k.Map.prototype=d.prototype,u(k.Map.prototype,"constructor",k.Map,!0),p(k.Map,d)),C=D(k.Set,function(e){var t=new e([]);return t.add(42,42),t instanceof e}),_=Object.setPrototypeOf&&!C,n=function(){try{return!(k.Set()instanceof k.Set)}catch(e){return e instanceof TypeError}}(),0===k.Set.length&&!_&&n||(Kt=k.Set,k.Set=function e(){if(!(this instanceof e))throw new TypeError('Constructor Set requires "new"');var t=new Kt;return 0<arguments.length&&Ut(e,t,arguments[0]),delete t.constructor,Object.setPrototypeOf(t,e.prototype),t},k.Set.prototype=Kt.prototype,u(k.Set.prototype,"constructor",k.Set,!0),p(k.Set,Kt)),Zt=new k.Map,E=!r(function(){return Zt.keys().next().done}),("function"!=typeof k.Map.prototype.clear||0!==(new k.Set).size||0!==Zt.size||"function"!=typeof k.Map.prototype.keys||"function"!=typeof k.Set.prototype.keys||"function"!=typeof k.Map.prototype.forEach||"function"!=typeof k.Set.prototype.forEach||ce(k.Map)||ce(k.Set)||"function"!=typeof Zt.keys().next||E||!x)&&w(k,{Map:Gt.Map,Set:Gt.Set},!0),k.Set.prototype.keys!==k.Set.prototype.values&&u(k.Set.prototype,"keys",k.Set.prototype.values,!0),e(Object.getPrototypeOf((new k.Map).keys())),e(Object.getPrototypeOf((new k.Set).keys())),ue&&"has"!==k.Set.prototype.has.name&&(Qt=k.Set.prototype.has,a(k.Set.prototype,"has",function(e){return T(Qt,this,e)}))),w(k,Gt),z(k.Map),z(k.Set));function R(e){if(!S.TypeIsObject(e))throw new TypeError("target must be an object")}function kn(e){return!t(e)}var Sn,xn,On,_n,Cn,M={apply:function(){return S.Call(S.Call,null,arguments)},construct:function(e,t){if(!S.IsConstructor(e))throw new TypeError("First argument must be a constructor.");var n=2<arguments.length?arguments[2]:e;if(S.IsConstructor(n))return S.Construct(e,t,n,"internal");throw new TypeError("new.target must be a constructor.")},deleteProperty:function(e,t){if(R(e),s){var n=Object.getOwnPropertyDescriptor(e,t);if(n&&!n.configurable)return!1}return delete e[t]},has:function(e,t){return R(e),t in e}},En=(Object.getOwnPropertyNames&&Object.assign(M,{ownKeys:function(e){R(e);var t=Object.getOwnPropertyNames(e);return S.IsCallable(Object.getOwnPropertySymbols)&&xe(t,Object.getOwnPropertySymbols(e)),t}}),Object.preventExtensions&&Object.assign(M,{isExtensible:function(e){return R(e),Object.isExtensible(e)},preventExtensions:function(e){return R(e),kn(function(){return Object.preventExtensions(e)})}}),s&&(Sn=function(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);return r?"value"in r?r.value:r.get?S.Call(r.get,n):void 0:null===(r=Object.getPrototypeOf(e))?void 0:Sn(r,t,n)},xn=function(e,t,n,r){var a=Object.getOwnPropertyDescriptor(e,t);if(!a){e=Object.getPrototypeOf(e);if(null!==e)return xn(e,t,n,r);a={value:void 0,writable:!0,enumerable:!0,configurable:!0}}return"value"in a?!!a.writable&&(!!S.TypeIsObject(r)&&(Object.getOwnPropertyDescriptor(r,t)?We.defineProperty(r,t,{value:n}):We.defineProperty(r,t,{value:n,writable:!0,enumerable:!0,configurable:!0}))):!!a.set&&(T(a.set,r,n),!0)},Object.assign(M,{defineProperty:function(e,t,n){return R(e),kn(function(){return Object.defineProperty(e,t,n)})},getOwnPropertyDescriptor:function(e,t){return R(e),Object.getOwnPropertyDescriptor(e,t)},get:function(e,t){return R(e),Sn(e,t,2<arguments.length?arguments[2]:e)},set:function(e,t,n){return R(e),xn(e,t,n,3<arguments.length?arguments[3]:e)}})),Object.getPrototypeOf&&(On=Object.getPrototypeOf,M.getPrototypeOf=function(e){return R(e),On(e)}),Object.setPrototypeOf&&M.getPrototypeOf&&Object.assign(M,{setPrototypeOf:function(e,t){if(R(e),null!==t&&!S.TypeIsObject(t))throw new TypeError("proto must be an object or null");if(t!==We.getPrototypeOf(e)){if(We.isExtensible&&!We.isExtensible(e))return!1;if(function(e,t){for(var n=t;n;){if(e===n)return!0;n=M.getPrototypeOf(n)}return!1}(e,t))return!1;Object.setPrototypeOf(e,t)}return!0}}),Object.keys(M).forEach(function(e){var t;e=M[t=e],S.IsCallable(k.Reflect[t])?r(function(){return k.Reflect[t](1),k.Reflect[t](NaN),k.Reflect[t](!0),!0})&&a(k.Reflect,t,e):u(k.Reflect,t,e)}),k.Reflect.getPrototypeOf),An=(ue&&En&&"getPrototypeOf"!==En.name&&a(k.Reflect,"getPrototypeOf",function(e){return T(En,k.Reflect,e)}),k.Reflect.setPrototypeOf&&r(function(){return k.Reflect.setPrototypeOf(1,{}),!0})&&a(k.Reflect,"setPrototypeOf",M.setPrototypeOf),!k.Reflect.defineProperty||r(function(){var e=!k.Reflect.defineProperty(1,"test",{value:1}),t="function"!=typeof Object.preventExtensions||!k.Reflect.defineProperty(Object.preventExtensions({}),"test",{});return e&&t})||a(k.Reflect,"defineProperty",M.defineProperty),!k.Reflect.construct||r(function(){function e(){}return k.Reflect.construct(function(){},[],e)instanceof e})||a(k.Reflect,"construct",M.construct),"Invalid Date"!==String(new Date(NaN))&&(_n=Date.prototype.toString,a(Date.prototype,"toString",function(){var e=+this;return e!=e?"Invalid Date":S.Call(_n,this)})),{anchor:function(e){return S.CreateHTML(this,"a","name",e)},big:function(){return S.CreateHTML(this,"big","","")},blink:function(){return S.CreateHTML(this,"blink","","")},bold:function(){return S.CreateHTML(this,"b","","")},fixed:function(){return S.CreateHTML(this,"tt","","")},fontcolor:function(e){return S.CreateHTML(this,"font","color",e)},fontsize:function(e){return S.CreateHTML(this,"font","size",e)},italics:function(){return S.CreateHTML(this,"i","","")},link:function(e){return S.CreateHTML(this,"a","href",e)},small:function(){return S.CreateHTML(this,"small","","")},strike:function(){return S.CreateHTML(this,"strike","","")},sub:function(){return S.CreateHTML(this,"sub","","")},sup:function(){return S.CreateHTML(this,"sup","","")}}),b=(c(Object.keys(An),function(e){var t,n=String.prototype[e];(!S.IsCallable(n)||(n=T(n,"",' " '),t=Te([],n.match(/"/g)).length,n!==n.toLowerCase()||2<t))&&a(String.prototype,e,An[e])}),function(){if(!ze)return!1;var e="object"===("undefined"==typeof JSON?"undefined":_typeof(JSON))&&"function"==typeof JSON.stringify?JSON.stringify:null;if(!e)return!1;if(void 0!==e(h()))return!0;if("[null]"!==e([h()]))return!0;var t={a:h()};return t[h()]=!0,"{}"!==e(t)}()),C=r(function(){return!ze||"{}"===JSON.stringify(Object(h()))&&"[{}]"===JSON.stringify([Object(h())])});return!b&&C||(Cn=JSON.stringify,a(JSON,"stringify",function(e){var t,n;if("symbol"!==_typeof(e))return e=[e],se(t=1<arguments.length?arguments[1]:t)?e.push(t):(n=S.IsCallable(t)?t:null,e.push(function(e,t){e=n?T(n,this,e,t):t;if("symbol"!==_typeof(e))return y.symbol(e)?dt({})(e):e})),2<arguments.length&&e.push(arguments[2]),Cn.apply(this,e)})),k}),!function(e,t){"object"===("undefined"==typeof module?"undefined":_typeof(module))&&"object"===_typeof(module.exports)?module.exports=e.document?t(e,!0):function(e){if(e.document)return t(e);throw new Error("jQuery requires a window with a document")}:t(e)}("undefined"!=typeof window?window:this,function(T,D){function v(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item}function m(e){return null!=e&&e===e.window}var t=[],V=Object.getPrototypeOf,s=t.slice,L=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},F=t.push,q=t.indexOf,H={},z=H.toString,W=H.hasOwnProperty,B=W.toString,$=B.call(Object),y={},k=T.document,U={type:!0,src:!0,nonce:!0,noModule:!0};function G(e,t,n){var r,a,o=(n=n||k).createElement("script");if(o.text=e,t)for(r in U)(a=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,a);n.head.appendChild(o).parentNode.removeChild(o)}function h(e){return null==e?e+"":"object"===_typeof(e)||"function"==typeof e?H[z.call(e)]||"object":_typeof(e)}var S=function e(t,n){return new e.fn.init(t,n)};function X(e){var t=!!e&&"length"in e&&e.length,n=h(e);return!v(e)&&!m(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:"3.6.0",constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){e=S.merge(this.constructor(),e);return e.prevObject=this,e},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,e=+e+(e<0?t:0);return this.pushStack(0<=e&&e<t?[this[e]]:[])},end:function(){return this.prevObject||this.constructor()},push:F,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,a,o=arguments[0]||{},i=1,s=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[i]||{},i++),"object"===_typeof(o)||v(o)||(o={}),i===s&&(o=this,i--);i<s;i++)if(null!=(e=arguments[i]))for(t in e)n=e[t],"__proto__"!==t&&o!==n&&(c&&n&&(S.isPlainObject(n)||(r=Array.isArray(n)))?(a=o[t],a=r&&!Array.isArray(a)?[]:r||S.isPlainObject(a)?a:{},r=!1,o[t]=S.extend(c,a,n)):void 0!==n&&(o[t]=n));return o},S.extend({expando:"jQuery"+("3.6.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){return!(!e||"[object Object]"!==z.call(e))&&(!(e=V(e))||"function"==typeof(e=W.call(e,"constructor")&&e.constructor)&&B.call(e)===$)},isEmptyObject:function(e){for(var t in e)return!1;return!0},globalEval:function(e,t,n){G(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(X(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){t=t||[];return null!=e&&(X(Object(e))?S.merge(t,"string"==typeof e?[e]:e):F.call(t,e)),t},inArray:function(e,t,n){return null==t?-1:q.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,a=e.length;r<n;r++)e[a++]=t[r];return e.length=a,e},grep:function(e,t,n){for(var r=[],a=0,o=e.length,i=!n;a<o;a++)!t(e[a],a)!=i&&r.push(e[a]);return r},map:function(e,t,n){var r,a,o=0,i=[];if(X(e))for(r=e.length;o<r;o++)null!=(a=t(e[o],o,n))&&i.push(a);else for(o in e)null!=(a=t(e[o],o,n))&&i.push(a);return L(i)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){H["[object "+t+"]"]=t.toLowerCase()});function r(e,t,n){for(var r=[],a=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(a&&S(e).is(n))break;r.push(e)}return r}function Y(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}var e=function(D){function p(e,t){return e="0x"+e.slice(1)-65536,t||(e<0?String.fromCharCode(65536+e):String.fromCharCode(e>>10|55296,1023&e|56320))}function V(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}function L(){k()}var e,f,w,o,F,d,q,H,T,c,u,k,S,n,x,h,r,a,m,O="sizzle"+ +new Date,l=D.document,_=0,z=0,W=N(),B=N(),$=N(),y=N(),U=function(e,t){return e===t&&(u=!0),0},G={}.hasOwnProperty,t=[],X=t.pop,Y=t.push,C=t.push,J=t.slice,v=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",i="[\\x20\\t\\r\\n\\f]",s="(?:\\\\[\\da-fA-F]{1,6}"+i+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",Z="\\["+i+"*("+s+")(?:"+i+"*([*^$|!~]?=)"+i+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+s+"))|)"+i+"*\\]",Q=":("+s+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+Z+")*)|.*)\\)|)",ee=new RegExp(i+"+","g"),g=new RegExp("^"+i+"+|((?:^|[^\\\\])(?:\\\\.)*)"+i+"+$","g"),te=new RegExp("^"+i+"*,"+i+"*"),ne=new RegExp("^"+i+"*([>+~]|"+i+")"+i+"*"),re=new RegExp(i+"|>"),ae=new RegExp(Q),oe=new RegExp("^"+s+"$"),b={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),TAG:new RegExp("^("+s+"|[*])"),ATTR:new RegExp("^"+Z),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+i+"*(even|odd|(([+-]|)(\\d*)n|)"+i+"*(?:([+-]|)"+i+"*(\\d+)|))"+i+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+i+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+i+"*((?:-\\d)?\\d*)"+i+"*\\)|)(?=[^-]|$)","i")},ie=/HTML$/i,se=/^(?:input|select|textarea|button)$/i,ce=/^h\d$/i,E=/^[^{]+\{\s*\[native \w/,ue=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,le=/[+~]/,A=new RegExp("\\\\[\\da-fA-F]{1,6}"+i+"?|\\\\([^\\r\\n\\f])","g"),pe=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,fe=ve(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{C.apply(t=J.call(l.childNodes),l.childNodes),t[l.childNodes.length].nodeType}catch(e){C={apply:t.length?function(e,t){Y.apply(e,J.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function j(t,e,n,r){var a,o,i,s,c,u,l=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(k(e),e=e||S,x)){if(11!==p&&(s=ue.exec(t)))if(a=s[1]){if(9===p){if(!(u=e.getElementById(a)))return n;if(u.id===a)return n.push(u),n}else if(l&&(u=l.getElementById(a))&&m(e,u)&&u.id===a)return n.push(u),n}else{if(s[2])return C.apply(n,e.getElementsByTagName(t)),n;if((a=s[3])&&f.getElementsByClassName&&e.getElementsByClassName)return C.apply(n,e.getElementsByClassName(a)),n}if(f.qsa&&!y[t+" "]&&(!h||!h.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(u=t,l=e,1===p&&(re.test(t)||ne.test(t))){for((l=le.test(t)&&ye(e.parentNode)||e)===e&&f.scope||((i=e.getAttribute("id"))?i=i.replace(pe,V):e.setAttribute("id",i=O)),o=(c=d(t)).length;o--;)c[o]=(i?"#"+i:":scope")+" "+M(c[o]);u=c.join(",")}try{return C.apply(n,l.querySelectorAll(u)),n}catch(e){y(t,!0)}finally{i===O&&e.removeAttribute("id")}}}return H(t.replace(g,"$1"),e,n,r)}function N(){var n=[];function r(e,t){return n.push(e+" ")>w.cacheLength&&delete r[n.shift()],r[e+" "]=t}return r}function P(e){return e[O]=!0,e}function I(e){var t=S.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t)}}function de(e,t){for(var n=e.split("|"),r=n.length;r--;)w.attrHandle[n[r]]=t}function he(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function me(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&fe(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function R(i){return P(function(o){return o=+o,P(function(e,t){for(var n,r=i([],e.length,o),a=r.length;a--;)e[n=r[a]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&void 0!==e.getElementsByTagName&&e}for(e in f=j.support={},F=j.isXML=function(e){var t=e&&e.namespaceURI,e=e&&(e.ownerDocument||e).documentElement;return!ie.test(t||e&&e.nodeName||"HTML")},k=j.setDocument=function(e){var e=e?e.ownerDocument||e:l;return e!=S&&9===e.nodeType&&e.documentElement&&(n=(S=e).documentElement,x=!F(S),l!=S&&(e=S.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",L,!1):e.attachEvent&&e.attachEvent("onunload",L)),f.scope=I(function(e){return n.appendChild(e).appendChild(S.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),f.attributes=I(function(e){return e.className="i",!e.getAttribute("className")}),f.getElementsByTagName=I(function(e){return e.appendChild(S.createComment("")),!e.getElementsByTagName("*").length}),f.getElementsByClassName=E.test(S.getElementsByClassName),f.getById=I(function(e){return n.appendChild(e).id=O,!S.getElementsByName||!S.getElementsByName(O).length}),f.getById?(w.filter.ID=function(e){var t=e.replace(A,p);return function(e){return e.getAttribute("id")===t}},w.find.ID=function(e,t){if(void 0!==t.getElementById&&x)return(t=t.getElementById(e))?[t]:[]}):(w.filter.ID=function(e){var t=e.replace(A,p);return function(e){e=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return e&&e.value===t}},w.find.ID=function(e,t){if(void 0!==t.getElementById&&x){var n,r,a,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(a=t.getElementsByName(e),r=0;o=a[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),w.find.TAG=f.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):f.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],a=0,o=t.getElementsByTagName(e);if("*"!==e)return o;for(;n=o[a++];)1===n.nodeType&&r.push(n);return r},w.find.CLASS=f.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&x)return t.getElementsByClassName(e)},r=[],h=[],(f.qsa=E.test(S.querySelectorAll))&&(I(function(e){var t;n.appendChild(e).innerHTML="<a id='"+O+"'></a><select id='"+O+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&h.push("[*^$]="+i+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||h.push("\\["+i+"*(?:value|"+K+")"),e.querySelectorAll("[id~="+O+"-]").length||h.push("~="),(t=S.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+i+"*name"+i+"*="+i+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||h.push(":checked"),e.querySelectorAll("a#"+O+"+*").length||h.push(".#.+[+~]"),e.querySelectorAll("\\\f"),h.push("[\\r\\n\\f]")}),I(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=S.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&h.push("name"+i+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&h.push(":enabled",":disabled"),n.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(f.matchesSelector=E.test(a=n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.oMatchesSelector||n.msMatchesSelector))&&I(function(e){f.disconnectedMatch=a.call(e,"*"),a.call(e,"[s!='']:x"),r.push("!=",Q)}),h=h.length&&new RegExp(h.join("|")),r=r.length&&new RegExp(r.join("|")),e=E.test(n.compareDocumentPosition),m=e||E.test(n.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,t=t&&t.parentNode;return e===t||!(!t||1!==t.nodeType||!(n.contains?n.contains(t):e.compareDocumentPosition&&16&e.compareDocumentPosition(t)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},U=e?function(e,t){if(e===t)return u=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!f.sortDetached&&t.compareDocumentPosition(e)===n?e==S||e.ownerDocument==l&&m(l,e)?-1:t==S||t.ownerDocument==l&&m(l,t)?1:c?v(c,e)-v(c,t):0:4&n?-1:1)}:function(e,t){if(e===t)return u=!0,0;var n,r=0,a=e.parentNode,o=t.parentNode,i=[e],s=[t];if(!a||!o)return e==S?-1:t==S?1:a?-1:o?1:c?v(c,e)-v(c,t):0;if(a===o)return he(e,t);for(n=e;n=n.parentNode;)i.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;i[r]===s[r];)r++;return r?he(i[r],s[r]):i[r]==l?-1:s[r]==l?1:0}),S},j.matches=function(e,t){return j(e,null,null,t)},j.matchesSelector=function(e,t){if(k(e),f.matchesSelector&&x&&!y[t+" "]&&(!r||!r.test(t))&&(!h||!h.test(t)))try{var n=a.call(e,t);if(n||f.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){y(t,!0)}return 0<j(t,S,null,[e]).length},j.contains=function(e,t){return(e.ownerDocument||e)!=S&&k(e),m(e,t)},j.attr=function(e,t){(e.ownerDocument||e)!=S&&k(e);var n=w.attrHandle[t.toLowerCase()],n=n&&G.call(w.attrHandle,t.toLowerCase())?n(e,t,!x):void 0;return void 0!==n?n:f.attributes||!x?e.getAttribute(t):(n=e.getAttributeNode(t))&&n.specified?n.value:null},j.escape=function(e){return(e+"").replace(pe,V)},j.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},j.uniqueSort=function(e){var t,n=[],r=0,a=0;if(u=!f.detectDuplicates,c=!f.sortStable&&e.slice(0),e.sort(U),u){for(;t=e[a++];)t===e[a]&&(r=n.push(a));for(;r--;)e.splice(n[r],1)}return c=null,e},o=j.getText=function(e){var t,n="",r=0,a=e.nodeType;if(a){if(1===a||9===a||11===a){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===a||4===a)return e.nodeValue}else for(;t=e[r++];)n+=o(t);return n},(w=j.selectors={cacheLength:50,createPseudo:P,match:b,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(A,p),e[3]=(e[3]||e[4]||e[5]||"").replace(A,p),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||j.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&j.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return b.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&ae.test(n)&&(t=d(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(A,p).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=W[e+" "];return t||(t=new RegExp("(^|"+i+")"+e+"("+i+"|$)"))&&W(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(e){e=j.attr(e,t);return null==e?"!="===n:!n||(e+="","="===n?e===r:"!="===n?e!==r:"^="===n?r&&0===e.indexOf(r):"*="===n?r&&-1<e.indexOf(r):"$="===n?r&&e.slice(-r.length)===r:"~="===n?-1<(" "+e.replace(ee," ")+" ").indexOf(r):"|="===n&&(e===r||e.slice(0,r.length+1)===r+"-"))}},CHILD:function(h,e,t,m,y){var g="nth"!==h.slice(0,3),v="last"!==h.slice(-4),b="of-type"===e;return 1===m&&0===y?function(e){return!!e.parentNode}:function(e,t,n){var r,a,o,i,s,c,u=g!=v?"nextSibling":"previousSibling",l=e.parentNode,p=b&&e.nodeName.toLowerCase(),f=!n&&!b,d=!1;if(l){if(g){for(;u;){for(i=e;i=i[u];)if(b?i.nodeName.toLowerCase()===p:1===i.nodeType)return!1;c=u="only"===h&&!c&&"nextSibling"}return!0}if(c=[v?l.firstChild:l.lastChild],v&&f){for(d=(s=(r=(a=(o=(i=l)[O]||(i[O]={}))[i.uniqueID]||(o[i.uniqueID]={}))[h]||[])[0]===_&&r[1])&&r[2],i=s&&l.childNodes[s];i=++s&&i&&i[u]||(d=s=0)||c.pop();)if(1===i.nodeType&&++d&&i===e){a[h]=[_,s,d];break}}else if(!1===(d=f?s=(r=(a=(o=(i=e)[O]||(i[O]={}))[i.uniqueID]||(o[i.uniqueID]={}))[h]||[])[0]===_&&r[1]:d))for(;(i=++s&&i&&i[u]||(d=s=0)||c.pop())&&((b?i.nodeName.toLowerCase()!==p:1!==i.nodeType)||!++d||(f&&((a=(o=i[O]||(i[O]={}))[i.uniqueID]||(o[i.uniqueID]={}))[h]=[_,d]),i!==e)););return(d-=y)===m||d%m==0&&0<=d/m}}},PSEUDO:function(e,o){var t,i=w.pseudos[e]||w.setFilters[e.toLowerCase()]||j.error("unsupported pseudo: "+e);return i[O]?i(o):1<i.length?(t=[e,e,"",o],w.setFilters.hasOwnProperty(e.toLowerCase())?P(function(e,t){for(var n,r=i(e,o),a=r.length;a--;)e[n=v(e,r[a])]=!(t[n]=r[a])}):function(e){return i(e,0,t)}):i}},pseudos:{not:P(function(e){var r=[],a=[],s=q(e.replace(g,"$1"));return s[O]?P(function(e,t,n,r){for(var a,o=s(e,null,r,[]),i=e.length;i--;)(a=o[i])&&(e[i]=!(t[i]=a))}):function(e,t,n){return r[0]=e,s(r,null,n,a),r[0]=null,!a.pop()}}),has:P(function(t){return function(e){return 0<j(t,e).length}}),contains:P(function(t){return t=t.replace(A,p),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:P(function(n){return oe.test(n||"")||j.error("unsupported lang: "+n),n=n.replace(A,p).toLowerCase(),function(e){var t;do{if(t=x?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=D.location&&D.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===n},focus:function(e){return e===S.activeElement&&(!S.hasFocus||S.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return ce.test(e.nodeName)},input:function(e){return se.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(e=e.getAttribute("type"))||"text"===e.toLowerCase())},first:R(function(){return[0]}),last:R(function(e,t){return[t-1]}),eq:R(function(e,t,n){return[n<0?n+t:n]}),even:R(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:R(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:R(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:R(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=w.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})w.pseudos[e]=function(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}(e);for(e in{submit:!0,reset:!0})w.pseudos[e]=function(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}(e);function ge(){}function M(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function ve(i,e,t){var s=e.dir,c=e.next,u=c||s,l=t&&"parentNode"===u,p=z++;return e.first?function(e,t,n){for(;e=e[s];)if(1===e.nodeType||l)return i(e,t,n);return!1}:function(e,t,n){var r,a,o=[_,p];if(n){for(;e=e[s];)if((1===e.nodeType||l)&&i(e,t,n))return!0}else for(;e=e[s];)if(1===e.nodeType||l)if(a=(a=e[O]||(e[O]={}))[e.uniqueID]||(a[e.uniqueID]={}),c&&c===e.nodeName.toLowerCase())e=e[s]||e;else{if((r=a[u])&&r[0]===_&&r[1]===p)return o[2]=r[2];if((a[u]=o)[2]=i(e,t,n))return!0}return!1}}function be(a){return 1<a.length?function(e,t,n){for(var r=a.length;r--;)if(!a[r](e,t,n))return!1;return!0}:a[0]}function we(e,t,n,r,a){for(var o,i=[],s=0,c=e.length,u=null!=t;s<c;s++)!(o=e[s])||n&&!n(o,r,a)||(i.push(o),u&&t.push(s));return i}function Te(d,h,m,y,g,e){return y&&!y[O]&&(y=Te(y)),g&&!g[O]&&(g=Te(g,e)),P(function(e,t,n,r){var a,o,i,s=[],c=[],u=t.length,l=e||function(e,t,n){for(var r=0,a=t.length;r<a;r++)j(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),p=!d||!e&&h?l:we(l,s,d,n,r),f=m?g||(e?d:u||y)?[]:t:p;if(m&&m(p,f,n,r),y)for(a=we(f,c),y(a,[],n,r),o=a.length;o--;)(i=a[o])&&(f[c[o]]=!(p[c[o]]=i));if(e){if(g||d){if(g){for(a=[],o=f.length;o--;)(i=f[o])&&a.push(p[o]=i);g(null,f=[],a,r)}for(o=f.length;o--;)(i=f[o])&&-1<(a=g?v(e,i):s[o])&&(e[a]=!(t[a]=i))}}else f=we(f===t?f.splice(u,f.length):f),g?g(null,t,f,r):C.apply(t,f)})}function ke(y,g){function e(e,t,n,r,a){var o,i,s,c=0,u="0",l=e&&[],p=[],f=T,d=e||b&&w.find.TAG("*",a),h=_+=null==f?1:Math.random()||.1,m=d.length;for(a&&(T=t==S||t||a);u!==m&&null!=(o=d[u]);u++){if(b&&o){for(i=0,t||o.ownerDocument==S||(k(o),n=!x);s=y[i++];)if(s(o,t||S,n)){r.push(o);break}a&&(_=h)}v&&((o=!s&&o)&&c--,e&&l.push(o))}if(c+=u,v&&u!==c){for(i=0;s=g[i++];)s(l,p,t,n);if(e){if(0<c)for(;u--;)l[u]||p[u]||(p[u]=X.call(r));p=we(p)}C.apply(r,p),a&&!e&&0<p.length&&1<c+g.length&&j.uniqueSort(r)}return a&&(_=h,T=f),l}var v=0<g.length,b=0<y.length;return v?P(e):e}return ge.prototype=w.filters=w.pseudos,w.setFilters=new ge,d=j.tokenize=function(e,t){var n,r,a,o,i,s,c,u=B[e+" "];if(u)return t?0:u.slice(0);for(i=e,s=[],c=w.preFilter;i;){for(o in n&&!(r=te.exec(i))||(r&&(i=i.slice(r[0].length)||i),s.push(a=[])),n=!1,(r=ne.exec(i))&&(n=r.shift(),a.push({value:n,type:r[0].replace(g," ")}),i=i.slice(n.length)),w.filter)!(r=b[o].exec(i))||c[o]&&!(r=c[o](r))||(n=r.shift(),a.push({value:n,type:o,matches:r}),i=i.slice(n.length));if(!n)break}return t?i.length:i?j.error(e):B(e,s).slice(0)},q=j.compile=function(e,t){var n,r=[],a=[],o=$[e+" "];if(!o){for(n=(t=t||d(e)).length;n--;)((o=function e(t){for(var r,n,a,o=t.length,i=w.relative[t[0].type],s=i||w.relative[" "],c=i?1:0,u=ve(function(e){return e===r},s,!0),l=ve(function(e){return-1<v(r,e)},s,!0),p=[function(e,t,n){return e=!i&&(n||t!==T)||((r=t).nodeType?u:l)(e,t,n),r=null,e}];c<o;c++)if(n=w.relative[t[c].type])p=[ve(be(p),n)];else{if((n=w.filter[t[c].type].apply(null,t[c].matches))[O]){for(a=++c;a<o&&!w.relative[t[a].type];a++);return Te(1<c&&be(p),1<c&&M(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(g,"$1"),n,c<a&&e(t.slice(c,a)),a<o&&e(t=t.slice(a)),a<o&&M(t))}p.push(n)}return be(p)}(t[n]))[O]?r:a).push(o);(o=$(e,ke(a,r))).selector=e}return o},H=j.select=function(e,t,n,r){var a,o,i,s,c,u="function"==typeof e&&e,l=!r&&d(e=u.selector||e);if(n=n||[],1===l.length){if(2<(o=l[0]=l[0].slice(0)).length&&"ID"===(i=o[0]).type&&9===t.nodeType&&x&&w.relative[o[1].type]){if(!(t=(w.find.ID(i.matches[0].replace(A,p),t)||[])[0]))return n;u&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(a=b.needsContext.test(e)?0:o.length;a--&&(i=o[a],!w.relative[s=i.type]);)if((c=w.find[s])&&(r=c(i.matches[0].replace(A,p),le.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(a,1),e=r.length&&M(o))break;return C.apply(n,r),n}}return(u||q(e,l))(r,t,!x,n,!t||le.test(e)&&ye(t.parentNode)||t),n},f.sortStable=O.split("").sort(U).join("")===O,f.detectDuplicates=!!u,k(),f.sortDetached=I(function(e){return 1&e.compareDocumentPosition(S.createElement("fieldset"))}),I(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),f.attributes&&I(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),I(function(e){return null==e.getAttribute("disabled")})||de(K,function(e,t,n){if(!n)return!0===e[t]?t.toLowerCase():(n=e.getAttributeNode(t))&&n.specified?n.value:null}),j}(T),J=(S.find=e,S.expr=e.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=e.uniqueSort,S.text=e.getText,S.isXMLDoc=e.isXML,S.contains=e.contains,S.escapeSelector=e.escape,S.expr.match.needsContext);function c(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var K=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function Z(e,n,r){return v(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<q.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,a=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(a[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,a[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(Z(this,e||[],!1))},not:function(e){return this.pushStack(Z(this,e||[],!0))},is:function(e){return!!Z(this,"string"==typeof e&&J.test(e)?S(e):e||[],!1).length}});var Q,ee=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,te=((S.fn.init=function(e,t,n){if(!e)return this;if(n=n||Q,"string"!=typeof e)return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this);if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:ee.exec(e))||!r[1]&&t)return(!t||t.jquery?t||n:this.constructor(t)).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:k,!0)),K.test(r[1])&&S.isPlainObject(t))for(var r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(n=k.getElementById(r[2]))&&(this[0]=n,this.length=1),this}).prototype=S.fn,Q=S(k),/^(?:parents|prev(?:Until|All))/),ne={children:!0,contents:!0,next:!0,prev:!0};function re(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,a=this.length,o=[],i="string"!=typeof e&&S(e);if(!J.test(e))for(;r<a;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(i?-1<i.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?q.call(S(e),this[0]):q.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){return(e=e.parentNode)&&11!==e.nodeType?e:null},parents:function(e){return r(e,"parentNode")},parentsUntil:function(e,t,n){return r(e,"parentNode",n)},next:function(e){return re(e,"nextSibling")},prev:function(e){return re(e,"previousSibling")},nextAll:function(e){return r(e,"nextSibling")},prevAll:function(e){return r(e,"previousSibling")},nextUntil:function(e,t,n){return r(e,"nextSibling",n)},prevUntil:function(e,t,n){return r(e,"previousSibling",n)},siblings:function(e){return Y((e.parentNode||{}).firstChild,e)},children:function(e){return Y(e.firstChild)},contents:function(e){return null!=e.contentDocument&&V(e.contentDocument)?e.contentDocument:(c(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,a){S.fn[r]=function(e,t){var n=S.map(this,a,e);return(t="Until"!==r.slice(-5)?e:t)&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(ne[r]||S.uniqueSort(n),te.test(r)&&n.reverse()),this.pushStack(n)}});var x=/[^\x20\t\r\n\f]+/g;function l(e){return e}function ae(e){throw e}function oe(e,t,n,r){var a;try{e&&v(a=e.promise)?a.call(e).done(t).fail(n):e&&v(a=e.then)?a.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(x)||[],function(e,t){n[t]=!0}),n):S.extend({},r);function a(){for(s=s||r.once,i=o=!0;u.length;l=-1)for(t=u.shift();++l<c.length;)!1===c[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=c.length,t=!1);r.memory||(t=!1),o=!1,s&&(c=t?[]:"")}var o,t,i,s,c=[],u=[],l=-1,p={add:function(){return c&&(t&&!o&&(l=c.length-1,u.push(t)),function n(e){S.each(e,function(e,t){v(t)?r.unique&&p.has(t)||c.push(t):t&&t.length&&"string"!==h(t)&&n(t)})}(arguments),t&&!o&&a()),this},remove:function(){return S.each(arguments,function(e,t){for(var n;-1<(n=S.inArray(t,c,n));)c.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,c):0<c.length},empty:function(){return c=c&&[],this},disable:function(){return s=u=[],c=t="",this},disabled:function(){return!c},lock:function(){return s=u=[],t||o||(c=t=""),this},locked:function(){return!!s},fireWith:function(e,t){return s||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),o||a()),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],a="pending",i={state:function(){return a},always:function(){return s.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var a=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=v(a[t[4]])&&a[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&v(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),a=null}).promise()},then:function(t,n,r){var c=0;function u(a,o,i,s){return function(){function e(){var e,t;if(!(a<c)){if((e=i.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"===_typeof(e)||"function"==typeof e)&&e.then,v(t)?s?t.call(e,u(c,o,l,s),u(c,o,ae,s)):(c++,t.call(e,u(c,o,l,s),u(c,o,ae,s),u(c,o,l,o.notifyWith))):(i!==l&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}}var n=this,r=arguments,t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),c<=a+1&&(i!==ae&&(n=void 0,r=[e]),o.rejectWith(n,r))}};a?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),T.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(u(0,e,v(r)?r:l,e.notifyWith)),o[1][3].add(u(0,e,v(t)?t:l)),o[2][3].add(u(0,e,v(n)?n:ae))}).promise()},promise:function(e){return null!=e?S.extend(e,i):i}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];i[t[1]]=n.add,r&&n.add(function(){a=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),i.promise(s),e&&e.call(s,s),s},when:function(e){function t(t){return function(e){a[t]=this,o[t]=1<arguments.length?s.call(arguments):e,--n||i.resolveWith(a,o)}}var n=arguments.length,r=n,a=Array(r),o=s.call(arguments),i=S.Deferred();if(n<=1&&(oe(e,i.done(t(r)).resolve,i.reject,!n),"pending"===i.state()||v(o[r]&&o[r].then)))return i.then();for(;r--;)oe(o[r],t(r),i.reject);return i.promise()}});var ie=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/,se=(S.Deferred.exceptionHook=function(e,t){T.console&&T.console.warn&&e&&ie.test(e.name)&&T.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){T.setTimeout(function(){throw e})},S.Deferred());function ce(){k.removeEventListener("DOMContentLoaded",ce),T.removeEventListener("load",ce),S.ready()}S.fn.ready=function(e){return se.then(e).catch(function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||se.resolveWith(k,[S])}}),S.ready.then=se.then,"complete"===k.readyState||"loading"!==k.readyState&&!k.documentElement.doScroll?T.setTimeout(S.ready):(k.addEventListener("DOMContentLoaded",ce),T.addEventListener("load",ce));function p(e,t,n,r,a,o,i){var s=0,c=e.length,u=null==n;if("object"===h(n))for(s in a=!0,n)p(e,t,s,n[s],!0,o,i);else if(void 0!==r&&(a=!0,v(r)||(i=!0),t=u?i?(t.call(e,r),null):(u=t,function(e,t,n){return u.call(S(e),n)}):t))for(;s<c;s++)t(e[s],n,i?r:r.call(e[s],s,t(e[s],n)));return a?e:u?t.call(e):c?t(e[0],n):o}var ue=/^-ms-/,le=/-([a-z])/g;function pe(e,t){return t.toUpperCase()}function b(e){return e.replace(ue,"ms-").replace(le,pe)}function g(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType}function fe(){this.expando=S.expando+fe.uid++}fe.uid=1,fe.prototype={cache:function(e){var t=e[this.expando];return t||(t={},g(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,a=this.cache(e);if("string"==typeof t)a[b(t)]=n;else for(r in t)a[b(r)]=t[r];return a},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][b(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(b):(t=b(t))in r?[t]:t.match(x)||[]).length;for(;n--;)delete r[t[n]]}void 0!==t&&!S.isEmptyObject(r)||(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){e=e[this.expando];return void 0!==e&&!S.isEmptyObject(e)}};var w=new fe,u=new fe,de=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,he=/[A-Z]/g;function me(e,t,n){var r,a;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(he,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(a=n)||"false"!==a&&("null"===a?null:a===+a+""?+a:de.test(a)?JSON.parse(a):a)}catch(e){}u.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return u.hasData(e)||w.hasData(e)},data:function(e,t,n){return u.access(e,t,n)},removeData:function(e,t){u.remove(e,t)},_data:function(e,t,n){return w.access(e,t,n)},_removeData:function(e,t){w.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,a,o=this[0],i=o&&o.attributes;if(void 0!==n)return"object"===_typeof(n)?this.each(function(){u.set(this,n)}):p(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=u.get(o,n))||void 0!==(t=me(o,n))?t:void 0;this.each(function(){u.set(this,n,e)})},null,e,1<arguments.length,null,!0);if(this.length&&(a=u.get(o),1===o.nodeType&&!w.get(o,"hasDataAttrs"))){for(t=i.length;t--;)i[t]&&0===(r=i[t].name).indexOf("data-")&&(r=b(r.slice(5)),me(o,r,a[r]));w.set(o,"hasDataAttrs",!0)}return a},removeData:function(e){return this.each(function(){u.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return r=w.get(e,t=(t||"fx")+"queue"),n&&(!r||Array.isArray(n)?r=w.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,a=n.shift(),o=S._queueHooks(e,t);"inprogress"===a&&(a=n.shift(),r--),a&&("fx"===t&&n.unshift("inprogress"),delete o.stop,a.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return w.get(e,n)||w.access(e,n,{empty:S.Callbacks("once memory").add(function(){w.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){function n(){--a||o.resolveWith(i,[i])}var r,a=1,o=S.Deferred(),i=this,s=this.length;for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(r=w.get(i[s],e+"queueHooks"))&&r.empty&&(a++,r.empty.add(n));return n(),o.promise(t)}});function ye(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&_(e)&&"none"===S.css(e,"display")}var e=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ge=new RegExp("^(?:([+-])=|)("+e+")([a-z%]*)$","i"),f=["Top","Right","Bottom","Left"],O=k.documentElement,_=function(e){return S.contains(e.ownerDocument,e)},ve={composed:!0};O.getRootNode&&(_=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(ve)===e.ownerDocument});function be(e,t,n,r){var a,o,i=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},c=s(),u=n&&n[3]||(S.cssNumber[t]?"":"px"),l=e.nodeType&&(S.cssNumber[t]||"px"!==u&&+c)&&ge.exec(S.css(e,t));if(l&&l[3]!==u){for(u=u||l[3],l=+(c/=2)||1;i--;)S.style(e,t,l+u),(1-o)*(1-(o=s()/c||.5))<=0&&(i=0),l/=o;S.style(e,t,(l*=2)+u),n=n||[]}return n&&(l=+l||+c||0,a=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=l,r.end=a)),a}var we={};function C(e,t){for(var n,r,a,o,i,s=[],c=0,u=e.length;c<u;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(s[c]=w.get(r,"display")||null,s[c]||(r.style.display="")),""===r.style.display&&ye(r)&&(s[c]=(i=o=void 0,o=(a=r).ownerDocument,a=a.nodeName,(i=we[a])||(o=o.body.appendChild(o.createElement(a)),i=S.css(o,"display"),o.parentNode.removeChild(o),we[a]=i="none"===i?"block":i),i))):"none"!==n&&(s[c]="none",w.set(r,"display",n)));for(c=0;c<u;c++)null!=s[c]&&(e[c].style.display=s[c]);return e}S.fn.extend({show:function(){return C(this,!0)},hide:function(){return C(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ye(this)?S(this).show():S(this).hide()})}});var Te=/^(?:checkbox|radio)$/i,ke=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Se=/^$|^module$|\/(?:java|ecma)script/i,E=(P=k.createDocumentFragment().appendChild(k.createElement("div")),(i=k.createElement("input")).setAttribute("type","radio"),i.setAttribute("checked","checked"),i.setAttribute("name","t"),P.appendChild(i),y.checkClone=P.cloneNode(!0).cloneNode(!0).lastChild.checked,P.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!P.cloneNode(!0).lastChild.defaultValue,P.innerHTML="<option></option>",y.option=!!P.lastChild,{thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]});function A(e,t){var n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&c(e,t)?S.merge([e],n):n}function xe(e,t){for(var n=0,r=e.length;n<r;n++)w.set(e[n],"globalEval",!t||w.get(t[n],"globalEval"))}E.tbody=E.tfoot=E.colgroup=E.caption=E.thead,E.th=E.td,y.option||(E.optgroup=E.option=[1,"<select multiple='multiple'>","</select>"]);var Oe=/<|&#?\w+;/;function _e(e,t,n,r,a){for(var o,i,s,c,u,l=t.createDocumentFragment(),p=[],f=0,d=e.length;f<d;f++)if((o=e[f])||0===o)if("object"===h(o))S.merge(p,o.nodeType?[o]:o);else if(Oe.test(o)){for(i=i||l.appendChild(t.createElement("div")),s=(ke.exec(o)||["",""])[1].toLowerCase(),s=E[s]||E._default,i.innerHTML=s[1]+S.htmlPrefilter(o)+s[2],u=s[0];u--;)i=i.lastChild;S.merge(p,i.childNodes),(i=l.firstChild).textContent=""}else p.push(t.createTextNode(o));for(l.textContent="",f=0;o=p[f++];)if(r&&-1<S.inArray(o,r))a&&a.push(o);else if(c=_(o),i=A(l.appendChild(o),"script"),c&&xe(i),n)for(u=0;o=i[u++];)Se.test(o.type||"")&&n.push(o);return l}var Ce=/^([^.]*)(?:\.(.+)|)/;function n(){return!0}function d(){return!1}function Ee(e,t){return e===function(){try{return k.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,a,o){var i,s;if("object"===_typeof(t)){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==a?(a=n,r=n=void 0):null==a&&("string"==typeof n?(a=r,r=void 0):(a=r,r=n,n=void 0)),!1===a)a=d;else if(!a)return e;return 1===o&&(i=a,(a=function(e){return S().off(e),i.apply(this,arguments)}).guid=i.guid||(i.guid=S.guid++)),e.each(function(){S.event.add(this,t,a,r,n)})}function je(e,a,o){o?(w.set(e,a,!1),S.event.add(e,a,{namespace:!1,handler:function(e){var t,n,r=w.get(this,a);if(1&e.isTrigger&&this[a]){if(r.length)(S.event.special[a]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),w.set(this,a,r),t=o(this,a),this[a](),r!==(n=w.get(this,a))||t?w.set(this,a,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n&&n.value}else r.length&&(w.set(this,a,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===w.get(e,a)&&S.event.add(e,a,n)}S.event={global:{},add:function(t,e,n,r,a){var o,i,s,c,u,l,p,f,d,h=w.get(t);if(g(t))for(n.handler&&(n=(o=n).handler,a=o.selector),a&&S.find.matchesSelector(O,a),n.guid||(n.guid=S.guid++),(s=h.events)||(s=h.events=Object.create(null)),(i=h.handle)||(i=h.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(x)||[""]).length;c--;)p=d=(f=Ce.exec(e[c])||[])[1],f=(f[2]||"").split(".").sort(),p&&(u=S.event.special[p]||{},p=(a?u.delegateType:u.bindType)||p,u=S.event.special[p]||{},d=S.extend({type:p,origType:d,data:r,handler:n,guid:n.guid,selector:a,needsContext:a&&S.expr.match.needsContext.test(a),namespace:f.join(".")},o),(l=s[p])||((l=s[p]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(t,r,f,i)||t.addEventListener&&t.addEventListener(p,i)),u.add&&(u.add.call(t,d),d.handler.guid||(d.handler.guid=n.guid)),a?l.splice(l.delegateCount++,0,d):l.push(d),S.event.global[p]=!0)},remove:function(e,t,n,r,a){var o,i,s,c,u,l,p,f,d,h,m,y=w.hasData(e)&&w.get(e);if(y&&(c=y.events)){for(u=(t=(t||"").match(x)||[""]).length;u--;)if(d=m=(s=Ce.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),d){for(p=S.event.special[d]||{},f=c[d=(r?p.delegateType:p.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=o=f.length;o--;)l=f[o],!a&&m!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(f.splice(o,1),l.selector&&f.delegateCount--,p.remove&&p.remove.call(e,l));i&&!f.length&&(p.teardown&&!1!==p.teardown.call(e,h,y.handle)||S.removeEvent(e,d,y.handle),delete c[d])}else for(d in c)S.event.remove(e,d+t[u],n,r,!0);S.isEmptyObject(c)&&w.remove(e,"handle events")}},dispatch:function(e){var t,n,r,a,o,i=new Array(arguments.length),s=S.event.fix(e),e=(w.get(this,"events")||Object.create(null))[s.type]||[],c=S.event.special[s.type]||{};for(i[0]=s,t=1;t<arguments.length;t++)i[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){for(o=S.event.handlers.call(this,s,e),t=0;(r=o[t++])&&!s.isPropagationStopped();)for(s.currentTarget=r.elem,n=0;(a=r.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!1!==a.namespace&&!s.rnamespace.test(a.namespace)||(s.handleObj=a,s.data=a.data,void 0!==(a=((S.event.special[a.origType]||{}).handle||a.handler).apply(r.elem,i))&&!1===(s.result=a)&&(s.preventDefault(),s.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,a,o,i,s=[],c=t.delegateCount,u=e.target;if(c&&u.nodeType&&!("click"===e.type&&1<=e.button))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],i={},n=0;n<c;n++)void 0===i[a=(r=t[n]).selector+" "]&&(i[a]=r.needsContext?-1<S(a,this).index(u):S.find(a,this,null,[u]).length),i[a]&&o.push(r);o.length&&s.push({elem:u,handlers:o})}return u=this,c<t.length&&s.push({elem:u,handlers:t.slice(c)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){e=this||e;return Te.test(e.type)&&e.click&&c(e,"input")&&je(e,"click",n),!1},trigger:function(e){e=this||e;return Te.test(e.type)&&e.click&&c(e,"input")&&je(e,"click"),!0},_default:function(e){e=e.target;return Te.test(e.type)&&e.click&&c(e,"input")&&w.get(e,"click")||c(e,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?n:d,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:d,isPropagationStopped:d,isImmediatePropagationStopped:d,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=n,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=n,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=n,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return je(this,e,Ee),!1},trigger:function(){return je(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,a){S.event.special[e]={delegateType:a,bindType:a,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=a),t}}}),S.fn.extend({on:function(e,t,n,r){return Ae(this,e,t,n,r)},one:function(e,t,n,r){return Ae(this,e,t,n,r,1)},off:function(e,t,n){var r,a;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"!==_typeof(e))return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=d),this.each(function(){S.event.remove(this,e,n,t)});for(a in e)this.off(a,t,e[a]);return this}});var Ne=/<script|<style|<link/i,Pe=/checked\s*(?:[^=]|=\s*.checked.)/i,Ie=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Re(e,t){return c(e,"table")&&c(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Me(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function De(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ve(e,t){var n,r,a,o;if(1===t.nodeType){if(w.hasData(e)&&(o=w.get(e).events))for(a in w.remove(t,"handle events"),o)for(n=0,r=o[a].length;n<r;n++)S.event.add(t,a,o[a][n]);u.hasData(e)&&(e=u.access(e),e=S.extend({},e),u.set(t,e))}}function j(n,r,a,o){r=L(r);var e,t,i,s,c,u,l=0,p=n.length,f=p-1,d=r[0],h=v(d);if(h||1<p&&"string"==typeof d&&!y.checkClone&&Pe.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),j(t,r,a,o)});if(p&&(t=(e=_e(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(i=S.map(A(e,"script"),Me)).length;l<p;l++)c=e,l!==f&&(c=S.clone(c,!0,!0),s&&S.merge(i,A(c,"script"))),a.call(n[l],c,l);if(s)for(u=i[i.length-1].ownerDocument,S.map(i,De),l=0;l<s;l++)c=i[l],Se.test(c.type||"")&&!w.access(c,"globalEval")&&S.contains(u,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?S._evalUrl&&!c.noModule&&S._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},u):G(c.textContent.replace(Ie,""),c,u))}return n}function Le(e,t,n){for(var r,a=t?S.filter(t,e):e,o=0;null!=(r=a[o]);o++)n||1!==r.nodeType||S.cleanData(A(r)),r.parentNode&&(n&&_(r)&&xe(A(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,a,o,i,s,c,u,l=e.cloneNode(!0),p=_(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(i=A(l),r=0,a=(o=A(e)).length;r<a;r++)s=o[r],c=i[r],u=void 0,"input"===(u=c.nodeName.toLowerCase())&&Te.test(s.type)?c.checked=s.checked:"input"!==u&&"textarea"!==u||(c.defaultValue=s.defaultValue);if(t)if(n)for(o=o||A(e),i=i||A(l),r=0,a=o.length;r<a;r++)Ve(o[r],i[r]);else Ve(e,l);return 0<(i=A(l,"script")).length&&xe(i,!p&&A(e,"script")),l},cleanData:function(e){for(var t,n,r,a=S.event.special,o=0;void 0!==(n=e[o]);o++)if(g(n)){if(t=n[w.expando]){if(t.events)for(r in t.events)a[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[w.expando]=void 0}n[u.expando]&&(n[u.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Le(this,e,!0)},remove:function(e){return Le(this,e)},text:function(e){return p(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return j(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Re(this,e).appendChild(e)})},prepend:function(){return j(this,arguments,function(e){var t;1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(t=Re(this,e)).insertBefore(e,t.firstChild)})},before:function(){return j(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return j(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(A(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return p(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!E[(ke.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(A(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return j(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(A(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,i){S.fn[e]=function(e){for(var t,n=[],r=S(e),a=r.length-1,o=0;o<=a;o++)t=o===a?this:this.clone(!0),S(r[o])[i](t),F.apply(n,t.get());return this.pushStack(n)}});function Fe(e){var t=e.ownerDocument.defaultView;return(t=t&&t.opener?t:T).getComputedStyle(e)}function qe(e,t,n){var r,a={};for(r in t)a[r]=e.style[r],e.style[r]=t[r];for(r in n=n.call(e),t)e.style[r]=a[r];return n}var He,ze,We,Be,$e,Ue,Ge,a,Xe=new RegExp("^("+e+")(?!px)[a-z%]+$","i"),Ye=new RegExp(f.join("|"),"i");function Je(){var e;a&&(Ge.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",a.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",O.appendChild(Ge).appendChild(a),e=T.getComputedStyle(a),He="1%"!==e.top,Ue=12===Ke(e.marginLeft),a.style.right="60%",Be=36===Ke(e.right),ze=36===Ke(e.width),a.style.position="absolute",We=12===Ke(a.offsetWidth/3),O.removeChild(Ge),a=null)}function Ke(e){return Math.round(parseFloat(e))}function Ze(e,t,n){var r,a,o=e.style;return(n=n||Fe(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||_(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Xe.test(a)&&Ye.test(t)&&(e=o.width,t=o.minWidth,r=o.maxWidth,o.minWidth=o.maxWidth=o.width=a,a=n.width,o.width=e,o.minWidth=t,o.maxWidth=r)),void 0!==a?a+"":a}function Qe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}Ge=k.createElement("div"),(a=k.createElement("div")).style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===a.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return Je(),ze},pixelBoxStyles:function(){return Je(),Be},pixelPosition:function(){return Je(),He},reliableMarginLeft:function(){return Je(),Ue},scrollboxSize:function(){return Je(),We},reliableTrDimensions:function(){var e,t,n;return null==$e&&(e=k.createElement("table"),t=k.createElement("tr"),n=k.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",O.appendChild(e).appendChild(t).appendChild(n),n=T.getComputedStyle(t),$e=parseInt(n.height,10)+parseInt(n.borderTopWidth,10)+parseInt(n.borderBottomWidth,10)===t.offsetHeight,O.removeChild(e)),$e}}));var et=["Webkit","Moz","ms"],tt=k.createElement("div").style,nt={};function rt(e){var t=S.cssProps[e]||nt[e];return t||(e in tt?e:nt[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=et.length;n--;)if((e=et[n]+t)in tt)return e}(e)||e)}var at=/^(none|table(?!-c[ea]).+)/,ot=/^--/,it={position:"absolute",visibility:"hidden",display:"block"},st={letterSpacing:"0",fontWeight:"400"};function ct(e,t,n){var r=ge.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function ut(e,t,n,r,a,o){var i="width"===t?1:0,s=0,c=0;if(n===(r?"border":"content"))return 0;for(;i<4;i+=2)"margin"===n&&(c+=S.css(e,n+f[i],!0,a)),r?("content"===n&&(c-=S.css(e,"padding"+f[i],!0,a)),"margin"!==n&&(c-=S.css(e,"border"+f[i]+"Width",!0,a))):(c+=S.css(e,"padding"+f[i],!0,a),"padding"!==n?c+=S.css(e,"border"+f[i]+"Width",!0,a):s+=S.css(e,"border"+f[i]+"Width",!0,a));return!r&&0<=o&&(c+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-c-s-.5))||0),c}function lt(e,t,n){var r=Fe(e),a=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=a,i=Ze(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Xe.test(i)){if(!n)return i;i="auto"}return(!y.boxSizingReliable()&&a||!y.reliableTrDimensions()&&c(e,"tr")||"auto"===i||!parseFloat(i)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(a="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(i=e[s])),(i=parseFloat(i)||0)+ut(e,t,n||(a?"border":"content"),o,r,i)+"px"}function o(e,t,n,r,a){return new o.prototype.init(e,t,n,r,a)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t)return""===(t=Ze(e,"opacity"))?"1":t}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var a,o,i,s=b(t),c=ot.test(t),u=e.style;if(c||(t=rt(s)),i=S.cssHooks[t]||S.cssHooks[s],void 0===n)return i&&"get"in i&&void 0!==(a=i.get(e,!1,r))?a:u[t];"string"===(o=_typeof(n))&&(a=ge.exec(n))&&a[1]&&(n=be(e,t,a),o="number"),null!=n&&n==n&&("number"!==o||c||(n+=a&&a[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),i&&"set"in i&&void 0===(n=i.set(e,n,r))||(c?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var a,o=b(t);return ot.test(t)||(t=rt(o)),"normal"===(a=void 0===(a=(o=S.cssHooks[t]||S.cssHooks[o])&&"get"in o?o.get(e,!0,n):a)?Ze(e,t,r):a)&&t in st&&(a=st[t]),""===n||n?(o=parseFloat(a),!0===n||isFinite(o)?o||0:a):a}}),S.each(["height","width"],function(e,i){S.cssHooks[i]={get:function(e,t,n){if(t)return!at.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?lt(e,i,n):qe(e,it,function(){return lt(e,i,n)})},set:function(e,t,n){var r=Fe(e),a=!y.scrollboxSize()&&"absolute"===r.position,o=(a||n)&&"border-box"===S.css(e,"boxSizing",!1,r),n=n?ut(e,i,n,o,r):0;return o&&a&&(n-=Math.ceil(e["offset"+i[0].toUpperCase()+i.slice(1)]-parseFloat(r[i])-ut(e,i,"border",!1,r)-.5)),n&&(o=ge.exec(t))&&"px"!==(o[3]||"px")&&(e.style[i]=t,t=S.css(e,i)),ct(0,t,n)}}}),S.cssHooks.marginLeft=Qe(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ze(e,"marginLeft"))||e.getBoundingClientRect().left-qe(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(a,o){S.cssHooks[a+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[a+f[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==a&&(S.cssHooks[a+o].set=ct)}),S.fn.extend({css:function(e,t){return p(this,function(e,t,n){var r,a,o={},i=0;if(Array.isArray(t)){for(r=Fe(e),a=t.length;i<a;i++)o[t[i]]=S.css(e,t[i],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=o).prototype={constructor:o,init:function(e,t,n,r,a,o){this.elem=e,this.prop=n,this.easing=a||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=o.propHooks[this.prop];return(e&&e.get?e:o.propHooks._default).get(this)},run:function(e){var t,n=o.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),(n&&n.set?n:o.propHooks._default).set(this),this}}).init.prototype=o.prototype,(o.propHooks={_default:{get:function(e){return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(e=S.css(e.elem,e.prop,""))&&"auto"!==e?e:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[rt(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=o.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=o.prototype.init,S.fx.step={};var N,pt,i,P,ft=/^(?:toggle|show|hide)$/,dt=/queueHooks$/;function ht(){pt&&(!1===k.hidden&&T.requestAnimationFrame?T.requestAnimationFrame(ht):T.setTimeout(ht,S.fx.interval),S.fx.tick())}function mt(){return T.setTimeout(function(){N=void 0}),N=Date.now()}function yt(e,t){var n,r=0,a={height:e};for(t=t?1:0;r<4;r+=2-t)a["margin"+(n=f[r])]=a["padding"+n]=e;return t&&(a.opacity=a.width=e),a}function gt(e,t,n){for(var r,a=(I.tweeners[t]||[]).concat(I.tweeners["*"]),o=0,i=a.length;o<i;o++)if(r=a[o].call(n,t,e))return r}function I(a,e,t){var n,o,r,i,s,c,u,l=0,p=I.prefilters.length,f=S.Deferred().always(function(){delete d.elem}),d=function(){if(!o){for(var e=N||mt(),e=Math.max(0,h.startTime+h.duration-e),t=1-(e/h.duration||0),n=0,r=h.tweens.length;n<r;n++)h.tweens[n].run(t);if(f.notifyWith(a,[h,t,e]),t<1&&r)return e;r||f.notifyWith(a,[h,1,0]),f.resolveWith(a,[h])}return!1},h=f.promise({elem:a,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:N||mt(),duration:t.duration,tweens:[],createTween:function(e,t){t=S.Tween(a,h.opts,e,t,h.opts.specialEasing[e]||h.opts.easing);return h.tweens.push(t),t},stop:function(e){var t=0,n=e?h.tweens.length:0;if(!o){for(o=!0;t<n;t++)h.tweens[t].run(1);e?(f.notifyWith(a,[h,1,0]),f.resolveWith(a,[h,e])):f.rejectWith(a,[h,e])}return this}}),m=h.props,y=m,g=h.opts.specialEasing;for(r in y)if(s=g[i=b(r)],c=y[r],Array.isArray(c)&&(s=c[1],c=y[r]=c[0]),r!==i&&(y[i]=c,delete y[r]),(u=S.cssHooks[i])&&"expand"in u)for(r in c=u.expand(c),delete y[i],c)r in y||(y[r]=c[r],g[r]=s);else g[i]=s;for(;l<p;l++)if(n=I.prefilters[l].call(h,a,m,h.opts))return v(n.stop)&&(S._queueHooks(h.elem,h.opts.queue).stop=n.stop.bind(n)),n;return S.map(m,gt,h),v(h.opts.start)&&h.opts.start.call(a,h),h.progress(h.opts.progress).done(h.opts.done,h.opts.complete).fail(h.opts.fail).always(h.opts.always),S.fx.timer(S.extend(d,{elem:a,anim:h,queue:h.opts.queue})),h}S.Animation=S.extend(I,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return be(n.elem,e,ge.exec(t),n),n}]},tweener:function(e,t){for(var n,r=0,a=(e=v(e)?(t=e,["*"]):e.match(x)).length;r<a;r++)n=e[r],I.tweeners[n]=I.tweeners[n]||[],I.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,a,o,i,s,c,u,l="width"in t||"height"in t,p=this,f={},d=e.style,h=e.nodeType&&ye(e),m=w.get(e,"fxshow");for(r in n.queue||(null==(i=S._queueHooks(e,"fx")).unqueued&&(i.unqueued=0,s=i.empty.fire,i.empty.fire=function(){i.unqueued||s()}),i.unqueued++,p.always(function(){p.always(function(){i.unqueued--,S.queue(e,"fx").length||i.empty.fire()})})),t)if(a=t[r],ft.test(a)){if(delete t[r],o=o||"toggle"===a,a===(h?"hide":"show")){if("show"!==a||!m||void 0===m[r])continue;h=!0}f[r]=m&&m[r]||S.style(e,r)}if((c=!S.isEmptyObject(t))||!S.isEmptyObject(f))for(r in l&&1===e.nodeType&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],null==(u=m&&m.display)&&(u=w.get(e,"display")),"none"===(l=S.css(e,"display"))&&(u?l=u:(C([e],!0),u=e.style.display||u,l=S.css(e,"display"),C([e]))),("inline"===l||"inline-block"===l&&null!=u)&&"none"===S.css(e,"float")&&(c||(p.done(function(){d.display=u}),null==u&&(l=d.display,u="none"===l?"":l)),d.display="inline-block")),n.overflow&&(d.overflow="hidden",p.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]})),c=!1,f)c||(m?"hidden"in m&&(h=m.hidden):m=w.access(e,"fxshow",{display:u}),o&&(m.hidden=!h),h&&C([e],!0),p.done(function(){for(r in h||C([e]),w.remove(e,"fxshow"),f)S.style(e,r,f[r])})),c=gt(h?m[r]:0,r,p),r in m||(m[r]=c.start,h&&(c.end=c.start,c.start=0))}],prefilter:function(e,t){t?I.prefilters.unshift(e):I.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"===_typeof(e)?S.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ye).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){function a(){var e=I(this,S.extend({},t),i);(o||w.get(this,"finish"))&&e.stop(!0)}var o=S.isEmptyObject(t),i=S.speed(e,n,r);return a.finish=a,o||!1===i.queue?this.each(a):this.queue(i.queue,a)},stop:function(a,e,o){function i(e){var t=e.stop;delete e.stop,t(o)}return"string"!=typeof a&&(o=e,e=a,a=void 0),e&&this.queue(a||"fx",[]),this.each(function(){var e=!0,t=null!=a&&a+"queueHooks",n=S.timers,r=w.get(this);if(t)r[t]&&r[t].stop&&i(r[t]);else for(t in r)r[t]&&r[t].stop&&dt.test(t)&&i(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=a&&n[t].queue!==a||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,a)})},finish:function(i){return!1!==i&&(i=i||"fx"),this.each(function(){var e,t=w.get(this),n=t[i+"queue"],r=t[i+"queueHooks"],a=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,i,[]),r&&r.stop&&r.stop.call(this,!0),e=a.length;e--;)a[e].elem===this&&a[e].queue===i&&(a[e].anim.stop(!0),a.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var a=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?a.apply(this,arguments):this.animate(yt(r,!0),e,t,n)}}),S.each({slideDown:yt("show"),slideUp:yt("hide"),slideToggle:yt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(N=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),N=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){pt||(pt=!0,ht())},S.fx.stop=function(){pt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,this.queue(e=e||"fx",function(e,t){var n=T.setTimeout(e,r);t.stop=function(){T.clearTimeout(n)}})},i=k.createElement("input"),P=k.createElement("select").appendChild(k.createElement("option")),i.type="checkbox",y.checkOn=""!==i.value,y.optSelected=P.selected,(i=k.createElement("input")).value="t",i.type="radio",y.radioValue="t"===i.value;var vt,bt=S.expr.attrHandle,wt=(S.fn.extend({attr:function(e,t){return p(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,a,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(a=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?vt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):a&&"set"in a&&void 0!==(r=a.set(e,n,t))?r:(e.setAttribute(t,n+""),n):!(a&&"get"in a&&null!==(r=a.get(e,t)))&&null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){var n;if(!y.radioValue&&"radio"===t&&c(e,"input"))return n=e.value,e.setAttribute("type",t),n&&(e.value=n),t}}},removeAttr:function(e,t){var n,r=0,a=t&&t.match(x);if(a&&1===e.nodeType)for(;n=a[r++];)e.removeAttribute(n)}}),vt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var i=bt[t]||S.find.attr;bt[t]=function(e,t,n){var r,a,o=t.toLowerCase();return n||(a=bt[o],bt[o]=r,r=null!=i(e,t,n)?o:null,bt[o]=a),r}}),/^(?:input|select|textarea|button)$/i),Tt=/^(?:a|area)$/i;function R(e){return(e.match(x)||[]).join(" ")}function M(e){return e.getAttribute&&e.getAttribute("class")||""}function kt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(x)||[]}S.fn.extend({prop:function(e,t){return p(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,a,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,a=S.propHooks[t]),void 0!==n?a&&"set"in a&&void 0!==(r=a.set(e,n,t))?r:e[t]=n:a&&"get"in a&&null!==(r=a.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):wt.test(e.nodeName)||Tt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),y.optSelected||(S.propHooks.selected={get:function(e){e=e.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(e){e=e.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,a,o,i,s=0;if(v(t))return this.each(function(e){S(this).addClass(t.call(this,e,M(this)))});if((e=kt(t)).length)for(;n=this[s++];)if(i=M(n),r=1===n.nodeType&&" "+R(i)+" "){for(o=0;a=e[o++];)r.indexOf(" "+a+" ")<0&&(r+=a+" ");i!==(i=R(r))&&n.setAttribute("class",i)}return this},removeClass:function(t){var e,n,r,a,o,i,s=0;if(v(t))return this.each(function(e){S(this).removeClass(t.call(this,e,M(this)))});if(!arguments.length)return this.attr("class","");if((e=kt(t)).length)for(;n=this[s++];)if(i=M(n),r=1===n.nodeType&&" "+R(i)+" "){for(o=0;a=e[o++];)for(;-1<r.indexOf(" "+a+" ");)r=r.replace(" "+a+" "," ");i!==(i=R(r))&&n.setAttribute("class",i)}return this},toggleClass:function(a,t){var o=_typeof(a),i="string"===o||Array.isArray(a);return"boolean"==typeof t&&i?t?this.addClass(a):this.removeClass(a):v(a)?this.each(function(e){S(this).toggleClass(a.call(this,e,M(this),t),t)}):this.each(function(){var e,t,n,r;if(i)for(t=0,n=S(this),r=kt(a);e=r[t++];)n.hasClass(e)?n.removeClass(e):n.addClass(e);else void 0!==a&&"boolean"!==o||((e=M(this))&&w.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==a&&w.get(this,"__className__")||""))})},hasClass:function(e){for(var t,n=0,r=" "+e+" ";t=this[n++];)if(1===t.nodeType&&-1<(" "+R(M(t))+" ").indexOf(r))return!0;return!1}});function St(e){e.stopPropagation()}var xt=/\r/g,Ot=(S.fn.extend({val:function(t){var n,e,r,a=this[0];return arguments.length?(r=v(t),this.each(function(e){1===this.nodeType&&(null==(e=r?t.call(this,e,S(this).val()):t)?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=S.map(e,function(e){return null==e?"":e+""})),(n=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in n&&void 0!==n.set(this,e,"value")||(this.value=e))})):a?(n=S.valHooks[a.type]||S.valHooks[a.nodeName.toLowerCase()])&&"get"in n&&void 0!==(e=n.get(a,"value"))?e:"string"==typeof(e=a.value)?e.replace(xt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:R(S.text(e))}},select:{get:function(e){for(var t,n=e.options,r=e.selectedIndex,a="select-one"===e.type,o=a?null:[],i=a?r+1:n.length,s=r<0?i:a?r:0;s<i;s++)if(((t=n[s]).selected||s===r)&&!t.disabled&&(!t.parentNode.disabled||!c(t.parentNode,"optgroup"))){if(t=S(t).val(),a)return t;o.push(t)}return o},set:function(e,t){for(var n,r,a=e.options,o=S.makeArray(t),i=a.length;i--;)((r=a[i]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in T,/^(?:focusinfocus|focusoutblur)$/),_t=(S.extend(S.event,{trigger:function(e,t,n,r){var a,o,i,s,c,u,l,p=[n||k],f=W.call(e,"type")?e.type:e,d=W.call(e,"namespace")?e.namespace.split("."):[],h=l=o=n=n||k;if(3!==n.nodeType&&8!==n.nodeType&&!Ot.test(f+S.event.triggered)&&(-1<f.indexOf(".")&&(f=(d=f.split(".")).shift(),d.sort()),s=f.indexOf(":")<0&&"on"+f,(e=e[S.expando]?e:new S.Event(f,"object"===_typeof(e)&&e)).isTrigger=r?2:3,e.namespace=d.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),u=S.event.special[f]||{},r||!u.trigger||!1!==u.trigger.apply(n,t))){if(!r&&!u.noBubble&&!m(n)){for(i=u.delegateType||f,Ot.test(i+f)||(h=h.parentNode);h;h=h.parentNode)p.push(h),o=h;o===(n.ownerDocument||k)&&p.push(o.defaultView||o.parentWindow||T)}for(a=0;(h=p[a++])&&!e.isPropagationStopped();)l=h,e.type=1<a?i:u.bindType||f,(c=(w.get(h,"events")||Object.create(null))[e.type]&&w.get(h,"handle"))&&c.apply(h,t),(c=s&&h[s])&&c.apply&&g(h)&&(e.result=c.apply(h,t),!1===e.result&&e.preventDefault());return e.type=f,r||e.isDefaultPrevented()||u._default&&!1!==u._default.apply(p.pop(),t)||!g(n)||s&&v(n[f])&&!m(n)&&((o=n[s])&&(n[s]=null),S.event.triggered=f,e.isPropagationStopped()&&l.addEventListener(f,St),n[f](),e.isPropagationStopped()&&l.removeEventListener(f,St),S.event.triggered=void 0,o&&(n[s]=o)),e.result}},simulate:function(e,t,n){n=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(n,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){function a(e){S.event.simulate(r,e.target,S.event.fix(e))}S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=w.access(e,r);t||e.addEventListener(n,a,!0),w.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=w.access(e,r)-1;t?w.access(e,r,t):(e.removeEventListener(n,a,!0),w.remove(e,r))}}}),T.location),Ct={guid:Date.now()},Et=/\?/,At=(S.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new T.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t},/\[\]$/),jt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,Pt=/^(?:input|select|textarea|keygen)/i;S.param=function(e,t){function n(e,t){t=v(t)?t():t,a[a.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==t?"":t)}var r,a=[];if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){n(this.name,this.value)});else for(r in e)!function n(r,e,a,o){if(Array.isArray(e))S.each(e,function(e,t){a||At.test(r)?o(r,t):n(r+"["+("object"===_typeof(t)&&null!=t?e:"")+"]",t,a,o)});else if(a||"object"!==h(e))o(r,e);else for(var t in e)n(r+"["+t+"]",e[t],a,o)}(r,e[r],t,n);return a.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Pt.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!Te.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(jt,"\r\n")}}):{name:t.name,value:n.replace(jt,"\r\n")}}).get()}});var It=/%20/g,Rt=/#.*$/,Mt=/([?&])_=[^&]*/,Dt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Vt=/^(?:GET|HEAD)$/,Lt=/^\/\//,Ft={},qt={},Ht="*/".concat("*"),zt=k.createElement("a");function Wt(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,a=e.toLowerCase().match(x)||[];if(v(t))for(;n=a[r++];)"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Bt(t,r,a,o){var i={},s=t===qt;function c(e){var n;return i[e]=!0,S.each(t[e]||[],function(e,t){t=t(r,a,o);return"string"!=typeof t||s||i[t]?s?!(n=t):void 0:(r.dataTypes.unshift(t),c(t),!1)}),n}return c(r.dataTypes[0])||!i["*"]&&c("*")}function $t(e,t){var n,r,a=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((a[n]?e:r=r||{})[n]=t[n]);return r&&S.extend(!0,e,r),e}zt.href=_t.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:_t.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(_t.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ht,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?$t($t(e,S.ajaxSettings),t):$t(S.ajaxSettings,e)},ajaxPrefilter:Wt(Ft),ajaxTransport:Wt(qt),ajax:function(e,t){"object"===_typeof(e)&&(t=e,e=void 0);var c,u,l,n,p,f,d,r,h=S.ajaxSetup({},t=t||{}),m=h.context||h,y=h.context&&(m.nodeType||m.jquery)?S(m):S.event,g=S.Deferred(),v=S.Callbacks("once memory"),b=h.statusCode||{},a={},o={},i="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(f){if(!n)for(n={};t=Dt.exec(l);)n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return f?l:null},setRequestHeader:function(e,t){return null==f&&(e=o[e.toLowerCase()]=o[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==f&&(h.mimeType=e),this},statusCode:function(e){if(e)if(f)w.always(e[w.status]);else for(var t in e)b[t]=[b[t],e[t]];return this},abort:function(e){e=e||i;return c&&c.abort(e),s(0,e),this}};if(g.promise(w),h.url=((e||h.url||_t.href)+"").replace(Lt,_t.protocol+"//"),h.type=t.method||t.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(x)||[""],null==h.crossDomain){e=k.createElement("a");try{e.href=h.url,e.href=e.href,h.crossDomain=zt.protocol+"//"+zt.host!=e.protocol+"//"+e.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=S.param(h.data,h.traditional)),Bt(Ft,h,t,w),!f){for(r in(d=S.event&&h.global)&&0==S.active++&&S.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Vt.test(h.type),u=h.url.replace(Rt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(It,"+")):(e=h.url.slice(u.length),h.data&&(h.processData||"string"==typeof h.data)&&(u+=(Et.test(u)?"&":"?")+h.data,delete h.data),!1===h.cache&&(u=u.replace(Mt,"$1"),e=(Et.test(u)?"&":"?")+"_="+Ct.guid+++e),h.url=u+e),h.ifModified&&(S.lastModified[u]&&w.setRequestHeader("If-Modified-Since",S.lastModified[u]),S.etag[u]&&w.setRequestHeader("If-None-Match",S.etag[u])),(h.data&&h.hasContent&&!1!==h.contentType||t.contentType)&&w.setRequestHeader("Content-Type",h.contentType),w.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Ht+"; q=0.01":""):h.accepts["*"]),h.headers)w.setRequestHeader(r,h.headers[r]);if(h.beforeSend&&(!1===h.beforeSend.call(m,w,h)||f))return w.abort();if(i="abort",v.add(h.complete),w.done(h.success),w.fail(h.error),c=Bt(qt,h,t,w)){if(w.readyState=1,d&&y.trigger("ajaxSend",[w,h]),f)return w;h.async&&0<h.timeout&&(p=T.setTimeout(function(){w.abort("timeout")},h.timeout));try{f=!1,c.send(a,s)}catch(e){if(f)throw e;s(-1,e)}}else s(-1,"No Transport")}return w;function s(e,t,n,r){var a,o,i,s=t;f||(f=!0,p&&T.clearTimeout(p),c=void 0,l=r||"",w.readyState=0<e?4:0,r=200<=e&&e<300||304===e,n&&(i=function(e,t,n){for(var r,a,o,i,s=e.contents,c=e.dataTypes;"*"===c[0];)c.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(a in s)if(s[a]&&s[a].test(r)){c.unshift(a);break}if(c[0]in n)o=c[0];else{for(a in n){if(!c[0]||e.converters[a+" "+c[0]]){o=a;break}i=i||a}o=o||i}if(o)return o!==c[0]&&c.unshift(o),n[o]}(h,w,n)),!r&&-1<S.inArray("script",h.dataTypes)&&S.inArray("json",h.dataTypes)<0&&(h.converters["text script"]=function(){}),i=function(e,t,n,r){var a,o,i,s,c,u={},l=e.dataTypes.slice();if(l[1])for(i in e.converters)u[i.toLowerCase()]=e.converters[i];for(o=l.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!c&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),c=o,o=l.shift())if("*"===o)o=c;else if("*"!==c&&c!==o){if(!(i=u[c+" "+o]||u["* "+o]))for(a in u)if((s=a.split(" "))[1]===o&&(i=u[c+" "+s[0]]||u["* "+s[0]])){!0===i?i=u[a]:!0!==u[a]&&(o=s[0],l.unshift(s[1]));break}if(!0!==i)if(i&&e.throws)t=i(t);else try{t=i(t)}catch(e){return{state:"parsererror",error:i?e:"No conversion from "+c+" to "+o}}}return{state:"success",data:t}}(h,i,w,r),r?(h.ifModified&&((n=w.getResponseHeader("Last-Modified"))&&(S.lastModified[u]=n),(n=w.getResponseHeader("etag"))&&(S.etag[u]=n)),204===e||"HEAD"===h.type?s="nocontent":304===e?s="notmodified":(s=i.state,a=i.data,r=!(o=i.error))):(o=s,!e&&s||(s="error",e<0&&(e=0))),w.status=e,w.statusText=(t||s)+"",r?g.resolveWith(m,[a,s,w]):g.rejectWith(m,[w,s,o]),w.statusCode(b),b=void 0,d&&y.trigger(r?"ajaxSuccess":"ajaxError",[w,h,r?a:o]),v.fireWith(m,[w,s]),d&&(y.trigger("ajaxComplete",[w,h]),--S.active||S.event.trigger("ajaxStop")))}},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,a){S[a]=function(e,t,n,r){return v(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:a,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){for(var t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){return this[0]&&(v(e)&&(e=e.call(this[0])),e=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return v(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=v(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new T.XMLHttpRequest}catch(e){}};var Ut={0:200,1223:204},Gt=S.ajaxSettings.xhr(),Xt=(y.cors=!!Gt&&"withCredentials"in Gt,y.ajax=Gt=!!Gt,S.ajaxTransport(function(a){var o,i;if(y.cors||Gt&&!a.crossDomain)return{send:function(e,t){var n,r=a.xhr();if(r.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(n in a.xhrFields)r[n]=a.xhrFields[n];for(n in a.mimeType&&r.overrideMimeType&&r.overrideMimeType(a.mimeType),a.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=i=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Ut[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),i=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=i:r.onreadystatechange=function(){4===r.readyState&&T.setTimeout(function(){o&&i()})},o=o("abort");try{r.send(a.hasContent&&a.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,a;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",a=function(e){r.remove(),a=null,e&&t("error"===e.type?404:200,e.type)}),k.head.appendChild(r[0])},abort:function(){a&&a()}}}),[]),Yt=/(=)\?(?=&|$)|\?\?/,Jt=(S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,a,o,i=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(i||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,i?e[i]=e[i].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",a=T[r],T[r]=function(){o=arguments},n.always(function(){void 0===a?S(T).removeProp(r):T[r]=a,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&v(a)&&a(o[0]),o=a=void 0}),"script"}),y.createHTMLDocument=((e=k.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===e.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=k.implementation.createHTMLDocument("")).createElement("base")).href=k.location.href,t.head.appendChild(r)):t=k),r=!n&&[],(n=K.exec(e))?[t.createElement(n[1])]:(n=_e([e],t,r),r&&r.length&&S(r).remove(),S.merge([],n.childNodes)));var r},S.fn.load=function(e,t,n){var r,a,o,i=this,s=e.indexOf(" ");return-1<s&&(r=R(e.slice(s)),e=e.slice(0,s)),v(t)?(n=t,t=void 0):t&&"object"===_typeof(t)&&(a="POST"),0<i.length&&S.ajax({url:e,type:a||"GET",dataType:"html",data:t}).done(function(e){o=arguments,i.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){i.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,a,o,i,s=S.css(e,"position"),c=S(e),u={};"static"===s&&(e.style.position="relative"),o=c.offset(),r=S.css(e,"top"),i=S.css(e,"left"),s=("absolute"===s||"fixed"===s)&&-1<(r+i).indexOf("auto")?(a=(s=c.position()).top,s.left):(a=parseFloat(r)||0,parseFloat(i)||0),null!=(t=v(t)?t.call(e,n,S.extend({},o)):t).top&&(u.top=t.top-o.top+a),null!=t.left&&(u.left=t.left-o.left+s),"using"in t?t.using.call(e,u):c.css(u)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n=this[0];return n?n.getClientRects().length?(e=n.getBoundingClientRect(),n=n.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],a={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((a=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),a.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-a.top-S.css(r,"marginTop",!0),left:t.left-a.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||O})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,a){var o="pageYOffset"===a;S.fn[t]=function(e){return p(this,function(e,t,n){var r;if(m(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[a]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Qe(y.pixelPosition,function(e,t){if(t)return t=Ze(e,n),Xe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(i,s){S.each({padding:"inner"+i,content:s,"":"outer"+i},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),a=r||(!0===e||!0===t?"margin":"border");return p(this,function(e,t,n){var r;return m(e)?0===o.indexOf("outer")?e["inner"+i]:e.document.documentElement["client"+i]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+i],r["scroll"+i],e.body["offset"+i],r["offset"+i],r["client"+i])):void 0===n?S.css(e,t,a):S.style(e,t,n,a)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}}),/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g),Kt=(S.proxy=function(e,t){var n,r;if("string"==typeof t&&(r=e[t],t=e,e=r),v(e))return n=s.call(arguments,2),(r=function(){return e.apply(t||this,n.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,r},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=c,S.isFunction=v,S.isWindow=m,S.camelCase=b,S.type=h,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Jt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S}),T.jQuery),Zt=T.$;return S.noConflict=function(e){return T.$===S&&(T.$=Zt),e&&T.jQuery===S&&(T.jQuery=Kt),S},void 0===D&&(T.jQuery=T.$=S),S}),define("utils/jqueryplugins",["jquery"],function(e){e.prototype.extend({popAttr:function(e){var t=this.attr(e);return this.removeAttr(e),t},popData:function(e){var t=this.data(e);return this.removeData(e),t},tag:function(){return this[0]&&this[0].tagName&&this[0].tagName.toLowerCase()},textNodes:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"*";return 1===this.length&&this[0]&&this[0].nodeType===Node.TEXT_NODE?[this[0]]:this.get().concat(this.contents().get(),this.find(e).contents().get()).filter(function(e,t,n){return e&&e.nodeType===Node.TEXT_NODE&&n.indexOf(e)===t}).sort(function(e,t){return 2&e.compareDocumentPosition(t)?1:-1})},findAndFilter:function(e){var t=this.find(e),e=this.filter(e);return e.length?t.add(e):t}})}),!function(){var a,v={};function o(e){for(var t in e)this[t]=e[t]}function i(e,t){for(var n=e.innerText,r=null,a=0,o=a,i=n.length,s=null;a<i;){for(var c=n.slice(a),u=(r&&r.length?r[0]:e).innerMode,l=0,p=u.length;l<p;l+=1){var f=v[u[l]];if(!(f.constraint&&!f.constraint(s)||f.cannotFollowText&&(s&&"text"===s.type||o<a))&&(f.plainCompare?c.startsWith(f.pattern):f.pattern.test(c))){var d=f.fn(f.plainCompare?f.pattern:f.pattern.exec(c)),h=!1,m=0;if(d.matches){for(;r&&m<r.length;m+=1){var y=r[m],g=y.type,y=y.aka;if(g in d.matches){h=!0;break}y&&(g=y),d.cannotCross&&-1<d.cannotCross.indexOf(g)&&(m=r.length-1)}if((!r||m>=r.length)&&!d.isFront)continue}o<a&&e.addChild({type:"text",text:n.slice(o,a),innerMode:u});o=a+=(s=e.addChild(d)).text.length,f=!1;h&&(t&&b(e,s,r[m]),r=r.slice(m+1),f=!0),!f&&s.isFront&&(r?r.unshift(s):r=[s]);break}}l===p&&(a+=1,null===s&&(s={type:"text"}))}for(o<a&&e.addChild({type:"text",text:n.slice(o,a),innerMode:(r&&r.length?r[0]:e).innerMode});r&&0<r.length;)r.shift().demote();return e}function b(e,t,n){var r=e.children.indexOf(t),a=e.children.indexOf(n);t.children=e.children.splice(a+1,r-(a+1)),t.type=t.matches[n.type],t.innerText="";for(var o,i=0,s=t.children.length;i<s;i++)t.innerText+=t.children[i].text;for(o in t.start=n.start,t.text=n.text+t.innerText+t.text,n)hasOwnProperty.call(n,o)&&!hasOwnProperty.call(t,o)&&(t[o]=n[o]);t.isFront&&(t.isFront=!1),e.children.splice(a,1)}o.prototype={constructor:o,addChild:function(e){var t=this.lastChildEnd(),n=new o(e);return n.start=t,n.end=e.text&&t+e.text.length,n.place=this.place,n.children=[],n.innerText&&i(n),this.children.push(n),n},lastChildEnd:function(){var e=this.children&&this.children[this.children.length-1]||null;return e?e.end:this.start+Math.max(0,this.text.indexOf(this.innerText))},tokenAt:function(e){if(e<this.start||e>=this.end)return null;if(this.children.length)for(var t=0;t<this.children.length;t+=1){var n=this.children[t].tokenAt(e);if(n)return n}return this},pathAt:function(e){if(e<this.start||e>=this.end)return[];var t=[];if(this.children.length)for(var n=0;n<this.children.length;n+=1){var r=this.children[n].pathAt(e);if(r.length){t=t.concat(r);break}}return t.concat(this)},nearestTokenAt:function(n){return n<this.start||n>=this.end?null:this.children?this.children.reduce(function(e,t){return e||(n>=t.start&&n<t.end?t:null)},null):this},everyLeaf:function(n){return this.children&&0!==this.children.length?this.children.reduce(function(e,t){return e&&t.everyLeaf(n)},!0):!!n(this)},demote:function(){this.type="text"},error:function(e){this.type="error",this.message=e},toString:function(){var e=this.type+"("+this.start+"\u2192"+this.end+")";return this.children&&0<this.children.length&&(e+="["+this.children+"]"),e},copy:function(){var e=new o(this);return e.children=e.children.slice(),e},foldChildren:function(){for(var e=[],t=this.children.slice(),n=0;n<t.length;n+=1){var r=t[n],a=!1;if(r.matches)for(var o=0;o<e.length;o+=1)e[o].type in r.matches&&(b(this,r,e[o]),e=e.slice(o+1),a=!0);!a&&r.isFront&&e.unshift(r)}}},a={lex:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"start",r=3<arguments.length&&void 0!==arguments[3]&&arguments[3];return i(new o({type:"root",place:t,start:0,end:e.length,text:e,innerText:e,children:[],innerMode:a.modes[n]}),!r)},rules:v,modes:{}},"object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports=a:"function"==typeof define&&define.amd?define("lexer",[],function(){return a}):this&&this.loaded?(this.modules||(this.modules={}),this.modules.Lexer=a):this.Lexer=a}.call(eval("this")||("undefined"!=typeof global?global:window)),!function(){var e;function n(t){return t&&"object"===_typeof(t)?(Object.keys(t).forEach(function(e){t[e]=n(t[e])}),t):(t+"").replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function t(e){return function(){return"("+e+Array.apply(0,arguments).join("|")+")"}}var r=t("?:"),a=t("?!"),o=t("?="),i="[ \\f\\t\\v\\u00a0\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000]*",s=i.replace("*","+"),c="\\b",u="[\\w\\-\\u00c0-\\u00de\\u00df-\\u00ff\\u0150\\u0170\\u0151\\u0171\\uD800-\\uDFFF]",l=u.replace("\\-",""),p=r("\\n","$"),f=i+"(\\*+)"+s,d=i+"((?:0\\.)+)"+s,h=i+"-{3,}"+i+p,m=i+"(==+>|<=+|=+><=+|<==+>)"+i+p,p=i+"(=+\\|+|\\|+=+|=+\\|+=+|\\|=+\\|)"+i+p,y={opener:"\\[\\[(?!\\[)",text:"("+function(){return"[^"+Array.apply(0,arguments).map(n).join("")+"]*"}("]")+")",rightSeparator:r("\\->","\\|"),leftSeparator:"<\\-",closer:"\\]\\]",legacySeparator:"\\|",legacyText:"("+r("[^\\|\\]]","\\]"+a("\\]"))+"+)"},g=l+"*"+l.replace("\\w","a-zA-Z")+l+"*",v="\\$("+g+")",b="_("+g+")",w="'s"+s+"("+g+")",T="("+g+")"+s+"of"+c+a("it\\b"),k="'s"+s,S=r("it","time","turns?","visits?","exits?","pos")+c,x="its"+s+"("+g+")",O="("+g+")"+s+"of"+s+"it"+c,_="of"+s+"it"+c,C={opener:"\\(",name:"("+r("\\$","_")+"?"+u+"+):"+a("\\/"),closer:"\\)"},E=r("=<","=>","[gl]te?\\b","n?eq\\b","isnot\\b","are\\b","x\\b","isa\\b","or"+s+"a"+c),A="[a-zA-Z][\\w\\-]*",j="(?:\"[^\"]*\"|'[^']*'|[^'\">])*?",N="\\|("+u+"+)(>|\\))",P="(<|\\()("+u+"+)\\|",I="((?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?)"+a("m?s")+c;y.main=y.opener+r(y.text+y.rightSeparator,y.text.replace("*","*?")+y.leftSeparator)+y.text,e={upperLetter:"[A-Z\\u00c0-\\u00de\\u0150\\u0170]",lowerLetter:"[a-z0-9_\\-\\u00df-\\u00ff\\u0151\\u0171]",anyLetter:u,anyLetterStrict:l,whitespace:s.replace("[","[\\n\\r"),escapedLine:"\\\\\\n\\\\?|\\n\\\\",br:"\\n(?!\\\\)",tag:"<\\/?"+A+j+">",scriptStyleTag:"<("+r("script","style","textarea")+")"+j+">[^]*?<\\/\\1>",scriptStyleTagOpener:"<",url:"("+r("https?","mailto","javascript","ftp","data")+":\\/\\/[^\\s<]+[^<.,:;\"')\\]\\s])",bullet:"\\*",hr:h,heading:"[ \\f\\t\\v\\u00a0\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000]*(#{1,6})[ \\f\\t\\v\\u00a0\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000]*",align:m,column:p,bulleted:f,numbered:d,verbatimOpener:"`+",hookAppendedFront:"\\["+a("=+"),hookPrependedFront:N+"\\["+a("=+"),hookFront:"\\["+a("=+"),hookBack:"\\]"+a(P),hookAppendedBack:"\\]"+P,unclosedHook:"\\[=+",unclosedHookPrepended:N+"\\[=+",unclosedCollapsed:"\\{=+",passageLink:y.main+y.closer,legacyLink:y.opener+y.legacyText+y.legacySeparator+y.legacyText+y.closer,simpleLink:y.opener+y.legacyText+y.closer,macroFront:C.opener+o(C.name),macroName:C.name,groupingFront:"\\("+a(C.name),twine1Macro:"<<[^>\\s]+\\s*(?:\\\\.|'(?:[^'\\\\]*\\\\.)*[^'\\\\]*'|\"(?:[^\"\\\\]*\\\\.)*[^\"\\\\]*\"|[^'\"\\\\>]|>(?!>))*>>",validPropertyName:g,property:w,belongingProperty:T,possessiveOperator:k,belongingOperator:"of\\b",itsOperator:"its\\b",belongingItOperator:_,variable:v,tempVariable:b,hookName:"\\?("+u+"+)\\b",cssTime:"(\\d+\\.?\\d*|\\d*\\.?\\d+)(m?s)\\b",colour:r(r("Red","Orange","Yellow","Lime","Green","Cyan","Aqua","Blue","Navy","Purple","Fuchsia","Magenta","White","Gray","Grey","Black","Transparent"),"#[\\dA-Fa-f]{3}(?:[\\dA-Fa-f]{3})?"),datatype:r("alnum","alphanumeric","any(?:case)?","array","bool(?:ean)?","changer","codehook","colou?r","const","command","dm","data"+r("map","type","set"),"ds","digit","gradient","empty","even","int"+a("o")+"(?:eger)?","lambda","lowercase","macro","linebreak","newline","num(?:ber)?","odd","str(?:ing)?","uppercase","whitespace")+c,number:I,boolean:r("true","false")+c,identifier:S,itsProperty:x,belongingItProperty:O,escapedStringChar:"\\\\[^\\n]",singleStringOpener:"'",doubleStringOpener:'"',singleStringCloser:"'",doubleStringCloser:'"',is:"is"+a(s+"not"+c,s+"an?"+c,s+"in"+c,s+"<",s+">")+c,isNot:"is"+s+"not"+a(s+r("an?","in")+c)+c,isA:"is"+s+"an?"+c,isNotA:"is"+s+"not"+s+"an?"+c,matches:"matches\\b",doesNotMatch:"does"+s+"not"+s+"match"+c,and:"and\\b",or:"or\\b",not:"not\\b",inequality:"((?:is(?:"+s+"not)?"+i+")*)("+r("<(?!=)","<=",">(?!=)",">=")+")",isIn:"is"+s+"in"+c,contains:"contains\\b",doesNotContain:"does"+s+"not"+s+"contain"+c,isNotIn:"is"+s+"not"+s+"in"+c,addition:n("+")+a("="),subtraction:n("-")+a("=","type"),multiplication:n("*")+a("="),division:r("/","%")+a("="),spread:"\\.\\.\\."+a("\\."),to:r("to\\b","="),into:"into\\b",making:"making\\b",where:"where\\b",when:"when\\b",via:"via\\b",each:"each\\b",augmentedAssign:r("\\+","\\-","\\*","\\/","%")+"=",bind:"2?bind\\b",typeSignature:n("-type")+c,incorrectOperator:E,PlainCompare:{comma:",",commentFront:"\x3c!--",commentBack:"--\x3e",strikeOpener:"~~",italicOpener:"//",boldOpener:"''",supOpener:"^^",strongFront:"**",strongBack:"**",emFront:"*",emBack:"*",collapsedFront:"{",collapsedBack:"}",groupingBack:")"}},"object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports=e:"function"==typeof define&&define.amd?define("patterns",[],function(){return e}):this&&this.loaded?(this.modules||(this.modules={}),this.modules.Patterns=e):this.Patterns=e}.call(eval("this")||("undefined"!=typeof global?global:window)),!function(){Object.assign=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};var m,y=Object.keys,g=Object.assign;function t(e){function t(n){return n=n||"innerText",function(e){var e=e.reduceRight(function(e,t,n){return e||(n?t:"")},""),t={};return t[n]=e,t}}function n(e,t){var n={};return n[e]=t,function(){return{isFront:!0,matches:n,cannotCross:["verbatimOpener"]}}}var r=Object.bind(0,null);function a(a,e){return Object.keys(e).forEach(function(n){var r=e[n].fn;e[n].fn=function(e){var t=r(e);return t.text||(t.text="string"==typeof e?e:e[0]),t.type||(t.type=n),t.innerMode||(t.innerMode=a),t}}),e}function o(e){switch(e&&e.type){case null:case"br":case"hr":case"bulleted":case"numbered":case"heading":case"align":case"column":case"escapedLine":return!0}return!1}var i=[],s=[],c=[],u=a(i,{hr:{fn:r},bulleted:{fn:function(e){return{depth:e[1].length}}},numbered:{fn:function(e){return{depth:e[1].length/2}}},heading:{fn:function(e){return{depth:e[1].length}}},align:{fn:function(e){var t,e=e[1],n=e.indexOf("><");return~n?25===(t=Math.round(n/(e.length-2)*50))&&(t="center"):"<"===e[0]&&">"===e.slice(-1)?t="justify":-1<e.indexOf(">")?t="right":-1<e.indexOf("<")&&(t="left"),{align:t}}},column:{fn:function(e){var t,e=e[1],n=e.indexOf("|");return n&&n<e.length-1?t="center":"|"===e[0]&&"|"===e.slice(-1)?t="none":n===e.length-1?t="right":n||(t="left"),{column:t,width:/\|+/.exec(e)[0].length,marginLeft:/^=*/.exec(e)[0].length,marginRight:/=*$/.exec(e)[0].length}}}}),l=(y(u).forEach(function(e){u[e].constraint=o,u[e].cannotFollowText=!0}),a(i,{twine1Macro:{fn:function(){return{type:"error",message:"Harlowe macros use a different syntax to Twine 1, SugarCube, and Yarn macros."}}},emBack:{fn:function(){return{matches:{emFront:"em"},cannotCross:["verbatimOpener"]}}},strongBack:{fn:function(){return{matches:{strongFront:"strong"},cannotCross:["verbatimOpener"]}}},strongFront:{fn:function(){return{isFront:!0}}},emFront:{fn:function(){return{isFront:!0}}},boldOpener:{fn:n("boldOpener","bold")},italicOpener:{fn:n("italicOpener","italic")},strikeOpener:{fn:n("strikeOpener","strike")},supOpener:{fn:n("supOpener","sup")},commentFront:{fn:function(){return{isFront:!0}}},commentBack:{fn:function(){return{matches:{commentFront:"comment"}}}},scriptStyleTag:{fn:r},tag:{fn:r},url:{fn:r},hookPrependedFront:{fn:function(e){return{name:e[1],hidden:")"===e[2],isFront:!0,tagPosition:"prepended"}}},hookFront:{fn:function(){return{isFront:!0}}},hookBack:{fn:function(){return{matches:{hookPrependedFront:"hook",hookFront:"hook"},cannotCross:["verbatimOpener"]}}},hookAppendedBack:{fn:function(e){return{name:e[2],hidden:"("===e[1],tagPosition:"appended",matches:{hookFront:"hook"},cannotCross:["verbatimOpener"]}}},unclosedHook:{fn:r},unclosedHookPrepended:{fn:function(e){return{type:"unclosedHook",name:e[1],hidden:")"===e[2]}}},verbatimOpener:{fn:function(e){var e=e[0].length,t={};return{type:(t["verbatim"+e]="verbatim")+e,isFront:!0,matches:t,aka:"verbatimOpener"}}},unclosedCollapsed:{fn:r},collapsedFront:{fn:function(){return{isFront:!0}}},collapsedBack:{fn:function(){return{matches:{collapsedFront:"collapsed"},cannotCross:["verbatimOpener"]}}},escapedLine:{fn:r},legacyLink:{fn:function(e){return{type:"twineLink",innerText:e[1],passage:e[2],innerMode:i}}},br:{fn:r}})),p=g(a(s,{macroFront:{fn:function(e){return{isFront:!0,name:e[1]}}},groupingBack:{fn:function(){return{matches:{groupingFront:"grouping",macroFront:"macro"},cannotCross:["singleStringOpener","doubleStringOpener"]}}},passageLink:{fn:function(e){var t=e[1]||"",n=e[2]||"",e=e[3]||"";return{type:"twineLink",innerText:n?e:t,passage:t?e:n,innerMode:i}}},simpleLink:{fn:function(e){return{type:"twineLink",innerText:e[1]||"",passage:e[1]||"",innerMode:i}}},variable:{constraint:function(e){return!e||"macroFront"!==e.type},fn:t("name")},tempVariable:{constraint:function(e){return!e||"macroFront"!==e.type},fn:t("name")}}),{hookFront:l.hookFront,hookBack:l.hookBack}),f=a(s,g({macroName:{constraint:function(e){return e&&"macroFront"===e.type},fn:t("name")},groupingFront:{fn:function(){return{isFront:!0}}},property:{fn:t("name"),constraint:function(e){if(e)switch(e.type){case"variable":case"hookName":case"property":case"tempVariable":case"colour":case"itsProperty":case"belongingItProperty":case"macro":case"grouping":case"string":case"datatype":case"hook":case"boolean":case"number":return!0}}},possessiveOperator:{fn:r},itsProperty:{cannotFollowText:!0,fn:t("name")},itsOperator:{cannotFollowText:!0,fn:r},belongingItProperty:{cannotFollowText:!0,fn:t("name")},belongingItOperator:{cannotFollowText:!0,fn:r},belongingProperty:{cannotFollowText:!0,fn:t("name")},belongingOperator:{cannotFollowText:!0,fn:r},escapedStringChar:{fn:function(){return{type:"text"}}},singleStringOpener:{fn:function(){return{isFront:!0,matches:{singleStringOpener:"string"},innerMode:c}}},doubleStringOpener:{fn:function(){return{isFront:!0,matches:{doubleStringOpener:"string"},innerMode:c}}},hookName:{fn:t("name")},cssTime:{fn:function(e){return{value:+e[1]*("s"===e[2].toLowerCase()?1e3:1)}}},datatype:{cannotFollowText:!0,fn:function(e){return{name:e[0].toLowerCase()}}},colour:{cannotFollowText:!0,fn:function(e){var e=e[0].toLowerCase(),t={red:"e61919",orange:"e68019",yellow:"e5e619",lime:"80e619",green:"19e619",cyan:"19e5e6",aqua:"19e5e6",blue:"197fe6",navy:"1919e6",purple:"7f19e6",fuchsia:"e619e5",magenta:"e619e5",white:"fff",black:"000",gray:"888",grey:"888"},t=hasOwnProperty.call(t,e)?"#"+t[e]:e;return{colour:t}}},number:{fn:function(e){return{value:parseFloat(e[0])}}},inequality:{fn:function(e){return{operator:e[2],negate:-1<e[1].indexOf("not")}}},augmentedAssign:{fn:function(e){return{operator:e[0][0]}}},identifier:{fn:t("name"),cannotFollowText:!0},whitespace:{fn:r,cannotFollowText:!0},incorrectOperator:{fn:function(e){var t={"=>":">=","=<":"<=",gte:">=",lte:"<=",gt:">",lt:"<",eq:"is",isnot:"is not",neq:"is not",isa:"is a",are:"is",x:"*","or a":"or"}[e[0].toLowerCase().replace(/\s+/g," ")];return{type:"error",message:"Please say "+(t?"'"+t+"'":"something else")+" instead of '"+e[0]+"'.",explanation:"In the interests of readability, I want certain operators to be in a specific form."}},cannotFollowText:!0}},["boolean","is","to","into","where","when","via","making","each","and","or","not","isNot","contains","doesNotContain","isIn","isA","isNotA","isNotIn","matches","doesNotMatch","bind"].reduce(function(e,t){return e[t]={fn:r,cannotFollowText:!0},e},{}),["comma","spread","typeSignature","addition","subtraction","multiplication","division"].reduce(function(e,t){return e[t]={fn:r},e},{}))),d=a(c,{singleStringCloser:f.singleStringOpener,doubleStringCloser:f.doubleStringOpener,escapedStringChar:f.escapedStringChar}),h=(i.push.apply(i,_toConsumableArray(y(u)).concat(_toConsumableArray(y(p)),_toConsumableArray(y(l)))),s.push.apply(s,_toConsumableArray(y(p)).concat(_toConsumableArray(y(f)))),c.push.apply(c,_toConsumableArray(y(d))),g({},u,l,p,f,d)),l=(y(h).forEach(function(e){m.PlainCompare[e]?(h[e].pattern=m.PlainCompare[e],h[e].plainCompare=!0):h[e].pattern=RegExp("^(?:"+m[e]+")","i")}),g(e.rules,h),e.modes);return l.start=l.markup=i,l.macro=s,l.string=c,e}function n(e){return Object.freeze({lex:t(e).lex,Patterns:m})}"object"===("undefined"==typeof module?"undefined":_typeof(module))?(m=require("./patterns"),module.exports=n(require("./lexer"))):"function"==typeof define&&define.amd?define("markup",["lexer","patterns"],function(e,t){return m=t,n(e)}):this&&this.loaded&&this.modules?(m=this.modules.Patterns,this.modules.Markup=n(this.modules.Lexer)):(m=this.Patterns,this.Markup=n(this.Lexer))}.call(eval("this")||("undefined"!=typeof global?global:window)),define("utils/polyfills",[],function(){var o=Array.prototype;"function"!=typeof o.includes&&(o.includes=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;if(!Number.isNaN(e)&&Number.isFinite(t)&&void 0!==e)return-1<o.indexOf.call(this,e,t);var n=Object(this),r=parseInt(n.length);if(!(r<=0))for(var a=0<=t?t:Math.max(0,r+t);a<r;){if(Object.is(e,n[a]))return!0;a+=1}return!1}),window.Symbol||(window.Symbol={iterator:"_es6-shim iterator_"})}),define("utils",["jquery","markup","utils/polyfills"],function(f){var r=String.fromCharCode,n="audio,blockquote,canvas,div,h1,h2,h3,h4,h5,hr,ol,p,pre,table,ul,video,tw-align,tw-story,tw-passage,tw-sidebar,tw-columns,tw-column,tw-meter".split(","),a="a,b,i,em,strong,sup,sub,abbr,acronym,s,strike,del,big,small,script,img,button,input,tw-link,tw-broken-link,tw-verbatim,tw-collapsed,tw-error,tw-colour,tw-icon".split(","),d=["audio"],e=_slicedToArray([function(e){return r(e)!==r(e).toLowerCase()},function(e){return r(e)!==r(e).toUpperCase()},function(e){return r(e).toLowerCase()!==r(e).toUpperCase()}].map(function(e){return"["+Array.from(Array(57343)).map(function(e,t){return t}).filter(e).map(function(e,t,n){return e===n[t-1]+1&&e===n[t+1]-1?"-":r(e)}).join("").replace(/\-+/g,"-")+"]"}),3),t=e[0],o=e[1],e=e[2];function s(e){return"instant"===e?0:800}var i,c,u=[],l={},p=0,h={},m=0,y={};function g(n,r,e,a,o){var i=null,s=0,c=r+e;function u(e){var t;1&n[0].compareDocumentPosition(document)&&(c=0),i&&(c-=t=e-i),i=e,0<a&&0<p+m&&n.data("expediteAnim")(a),c<=r&&(s+=t||0,"paused"===n.css("animation-play-state")&&n.css({visibility:"","animation-play-state":"running"})),c<=0?(n.removeData("expediteAnim"),o()):requestAnimationFrame(u)}n.data("expediteAnim",function(e){var t;c-=e=void 0===e?s:e,"running"===n.css("animation-play-state")&&n.css("animation-delay",(("ms"===(t=(t=n.css("animation-delay")).toLowerCase()).slice(-2)?+t.slice(0,-2)||0:"s"===t.slice(-1)&&1e3*+t.slice(0,-1)||0)||0)-e+"ms")}),c?requestAnimationFrame(u):u()}f(document.documentElement).on("keydown keyup mousedown mouseup",function(e){var t=e.key,n=e.button,e=e.type.includes("down"),r=t?l:h,n=t&&b.insensitiveName(t)||n;r[n]&&!e?t?p=Math.max(p-1,0):m=Math.max(m-1,0):!r[n]&&e&&(t?p+=1:m+=1),r[n]=e}).on("mousemove",function(e){var t=e.pageX,e=e.pageY;y.x=t,y.y=e});var v=/-|_/g,b={permutations:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r,a,o=t.length,i=[[].concat(t)],s=Array(o).fill(0),c=1;c<o;)s[c]<c?(r=c%2&&s[c],a=t[c],t[c]=t[r],t[r]=a,++s[c],c=1,i.push([].concat(t))):(s[c]=0,++c);return i},nth:function(e){var t=(+e+"").slice(-1);return e+("1"===t?"st":"2"===t?"nd":"3"===t?"rd":"th")},plural:function(e,t,n){return e+" "+(1!==Math.abs(e)?n||t+"s":t)},andList:function(e){return e.length<=1?e[0]:e.slice(0,-1).join(", ")+" and "+e[e.length-1]},realWhitespace:"[ \\n\\r\\f\\t\\v\\u00a0\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000]",anyRealLetter:"[\\dA-Za-z\\u00c0-\\u00de\\u00df-\\u00ff\\u0150\\u0170\\u0151\\u0171\\uD800-\\uDFFF]",anyUppercase:t,anyLowercase:o,anyCasedLetter:e,anyNewline:"(?:\\n|\\r|\\r\\n)",unescape:function(e){return e.replace(/&(?:amp|lt|gt|quot|nbsp|zwnj|#39|#96);/g,function(e){return{"&":"&",">":">","<":"<",""":'"',"'":"'"," ":String.fromCharCode(160),"‌":String.fromCharCode(8204)}[e]})},escape:function(e){return e.replace(/[&><"']/g,function(e){return{"&":"&",">":">","<":"<",'"':""","'":"'"}[e]})},insensitiveName:function(e){return(e+"").toLowerCase().replace(v,"")},allKeysDown:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.every(function(e){return l[e]})},someKeysDown:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.some(function(e){return l[e]})},buttonsDown:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.every(function(e){return h[e]})},anyInputDown:function(){return 0<p+m},mouseCoords:y,parentColours:function(e){for(var t,n={colour:null,backgroundColour:null},r=/^\w+a\(.+?,\s*0\s*\)$|^transparent$/;e.length&&e[0]!==document;e=e.parent())if(n.backgroundColour||((t=e.css("background-color")).match(r)||(n.backgroundColour=t)),n.colour||((t=e.css("color")).match(r)||(n.colour=t)),n.colour&&n.backgroundColour)return n;return{colour:"#fff",backgroundColour:"#000"}},childrenProbablyInline:function(e){var t=[];return[].every.call(e.findAndFilter("*"),function(e){if(!(e.hidden||/none|inline/.test(e.style.display)||/display: (none|inline)/.test(e.getAttribute("style")))){if(n.includes(e.tagName.toLowerCase())||/display: (?!none|inline|inherit|unset)/.test(e.getAttribute("style")))return!1;a.includes(e.tagName.toLowerCase())||t.push(e)}return!0})&&t.every(function(e){return window.getComputedStyle(e).display.includes("inline")})},transitionOut:function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,a=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0,i=6<arguments.length&&void 0!==arguments[6]?arguments[6]:void 0;0!==e.length&&(n=n||s(t),!(1<e.length)&&b.childrenProbablyInline(e)&&["tw-hook","tw-passage","tw-sidebar","tw-expression"].includes(e.tag())||(e=e.wrapAll("<tw-transition-container>").parent()),i&&e.css("transform-origin",i),e.attr("data-t8n",t).addClass("transition-out").css({"animation-duration":"".concat(n,"ms"),"animation-delay":"".concat(-o,"ms"),"animation-play-state":"paused"}),requestAnimationFrame(function(){b.childrenProbablyInline(e)?e.css("display","inline"):e.parent().is("tw-backdrop,tw-story")||e[0].setAttribute("style",e[0].getAttribute("style")+"display:block !important;width:100%")}),g(e,n,r-o,a,function(){e.remove()}))},transitionIn:function(l,e,t){var p,n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,r=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,a=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0,o=6<arguments.length&&void 0!==arguments[6]?arguments[6]:void 0;0!==l.length&&(t=t||s(e),(p=1<l.length||!b.childrenProbablyInline(l)||!["tw-hook","tw-passage","tw-sidebar","tw-expression"].includes(l.tag()))&&(l=l.wrapAll("<tw-transition-container>").parent()),o&&l.css("transform-origin",o),l.attr("data-t8n",e).addClass("transition-in").css(Object.assign({"animation-duration":"".concat(t,"ms"),"animation-delay":"".concat(-a,"ms")},n-a?{visibility:"hidden","animation-play-state":"paused"}:{})),requestAnimationFrame(function(){b.childrenProbablyInline(l)?l.css("display","inline"):l.parent().is("tw-backdrop,tw-story")||l[0].setAttribute("style",l[0].getAttribute("style")+"display:block !important;width:100%")}),g(l,t,n-a,r,function(){var e=0===l.filter(d.join(",")).length;if(p&&e){l.find("tw-transition-container, .transition-in, .transition-out").each(function(e,t){((t=f(t)).data("expediteAnim")||Object)()});for(var t=[],n=l.find("*"),r=0;r<n.length;r+=1){var a=n[r];0===a.scrollTop&&0===a.scrollLeft||t.push([a,a.scrollLeft,a.scrollTop])}l.contents().unwrap();for(var o=0,i=t;o<i.length;o++){var s=_slicedToArray(i[o],3),c=s[0],u=s[1],s=s[2];c.scrollLeft=u,c.scrollTop=s}}else l.removeClass("transition-in").removeAttr("data-t8n")}))},debounce:function(e){function t(){300<Date.now()-c?(n=0,u=!i,o?(e(s),s=[]):e.apply(void 0,_toConsumableArray(s)),u=!1):n=requestAnimationFrame(t)}var n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},a=r.batch,o=void 0!==a&&a,a=r.recur,i=void 0!==a&&a,s=[],c=0,u=!1;return function(){u||(c=Date.now(),o?s.push(arguments):s=arguments,n&&cancelAnimationFrame(n),n=requestAnimationFrame(t))}},impossible:function(e,t){window.console&&console.error(e+"(): "+t)},onStartup:function(e){u?u.push(e):e()},get storyElement(){return i},detachStoryElement:function(){document.documentElement.contains(i[0])&&(c=i.parent(),i.detach())},reattachStoryElement:function(){document.documentElement.contains(i[0])||(c||f(document.body)).append(i.parents().length?i.parents().last():i)},options:{}};return f(function(){i=f("tw-story"),u.forEach(function(e){return e()}),u=null}),Object.freeze(b)}),define("utils/naturalsort",[],function(){return function(h){var m=1<arguments.length&&void 0!==arguments[1]?arguments[1]:String;return function(e,t){var n,r,a,o,i=/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=/^0x[0-9a-f]+$/i,u=/^0/,e=m(e).trim(),t=m(t).trim(),l=e.replace(i,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=t.replace(i,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),i=parseInt(e.match(c))||1!==l.length&&e.match(s)&&Date.parse(e),e=parseInt(t.match(c))||i&&t.match(s)&&Date.parse(t)||null;if(h&&window.Intl&&window.Intl.Collator&&(a=window.Intl.Collator(h)),e){if(i<e)return-1;if(e<i)return 1}for(var f=0,d=Math.max(l.length,p.length);f<d;f++){if(n=!(l[f]||"").match(u)&&parseFloat(l[f])||l[f]||0,r=!(p[f]||"").match(u)&&parseFloat(p[f])||p[f]||0,isNaN(n)!==isNaN(r))return isNaN(n)?1:-1;if(_typeof(n)!==_typeof(r))n+="",r+="";else if("string"==typeof n&&a&&0!==(o=a.compare(n,r)))return o;if(n<r)return-1;if(r<n)return 1}return 0}}}),define("internaltypes/twineerror",["jquery","utils"],function(i,s){var a=s.impossible,c=s.escape,u=(i(document.documentElement).on("click","tw-folddown",function(e){var t=e.target,e=((t=i(t)).toggleClass("open"),t.popData("folddown"));for("function"==typeof e&&e(t);t&&!t.next().length;)t=t.parent();t&&t.next().toggle()}),{syntax:"The markup seems to contain a mistake.",saving:"I tried to save or load the game, but I couldn't do it.",operation:"I tried to perform an operation on some data, but the data's type was incorrect.",macrocall:"I tried to use a macro, but its call wasn't written correctly.",datatype:"I tried to use a macro, but was given the wrong type of data to it.",custommacro:"I tried to use a custom macro, but its code hook had a mistake in it.",infinite:"I almost ended up doing the same thing over and over, forever.",property:"I tried to access a value in a string/array/datamap, but I couldn't find it.",unimplemented:"I currently don't have this particular feature. I'm sorry.",propagated:"Click the 'Open' button to see the code hook as it was executed.",user:"This is a custom error created by (error:). It usually means you used a custom macro incorrectly.",assertion:"This command exists to provide a helpful error if a certain important condition wasn't true.",debugonly:"This macro is not meant to be used outside of debugging your story."}),l=[],n={TwineError:!0,create:function(e,t,n,r){return t&&"string"==typeof t||a("TwineError.create","has a bad message string"),n||e in u||a("TwineError.create","no error explanation given"),"user"!==e&&(t=t[0].toUpperCase()+t.slice(1)),Object.assign(Object.create(this),{type:e,message:t,explanation:n,source:void 0,innerDOM:r,appendTitleText:!1})},containsError:function(){for(var e=0;e<arguments.length;e+=1){var t=arguments[e];if(n.isPrototypeOf(t))return t;if(Array.isArray(t)){t=n.containsError.apply(n,t);if(t)return t}}return!1},createWarning:function(e,t){return Object.assign(this.create(e,t),{warning:!0})},render:function(t){var n=this,e=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=(t="string"==typeof t?t:this.source||"",i("<tw-error class='"+(this.warning?"warning":"error")+"' title='"+c(t)+"'>"+c(this.message+(this.appendTitleText?" "+t:""))+"</tw-error>")),a=i("<tw-error-explanation>").text(this.explanation||u[this.type]).hide(),o=i("<tw-folddown tabindex=0>");return this.innerDOM&&i("<tw-open-button label='Open'>").on("click",function(){var e=i("<tw-backdrop><tw-dialog></tw-backdrop>");e.find("tw-dialog").prepend(n.innerDOM,i("<tw-link tabindex=0>OK</tw-link>").on("click",function(){n.innerDOM.detach(),e.remove()}).wrap("<tw-dialog-links>").parent()),s.storyElement.prepend(e)}).appendTo(r),r.append(o).append(a),r.data("TwineError",this),e||l.forEach(function(e){return e(n,t)}),r},on:function(e){return"function"!=typeof e||l.includes(e)||l.push(e),n}};return Object.preventExtensions(n)}),define("passages",["jquery","utils/naturalsort","utils","markup","internaltypes/twineerror"],function(t,s,e,i,c){var u=e.insensitiveName,a=e.unescape,n=e.onStartup,o=e.impossible,l=Object.assign,p=RegExp(i.Patterns.macroFront+i.Patterns.macroName,"ig");function r(e){var t=e.attr("name"),n=a(e.html()),r=function(e,t){var r=["metadata","storylet","exclusivity","urgency"];if(!(e.match(p)||[]).some(function(t){return r.some(function(e){return u(t.slice(1,-1))===e})}))return{};var a=!1,o={};return i.lex(e,t).children.forEach(function e(t){if("macro"===t.type){var n=u(t.name);if(r.some(function(e){return n===e})){if(c.isPrototypeOf(o[n]))return;if(a)return void(o[n]=c.create("syntax","The (".concat(t.name,":) macro can't appear after non-metadata macros.")));if(o[n])return void(o[n]=c.create("syntax","There is more than one (".concat(t.name,":) macro.")));o[n]=t}else a=!0;t.children.forEach(function e(t){var n=u(t.name);"macro"===t.type&&r.some(function(e){return n===e})?o[n]=c.create("syntax","The (".concat(t.name,":) macro can't be inside another macro.")):t.children.forEach(e)})}else t.children.forEach(e)}),o}(n,t);return l(new Map([["source",n],["tags",(e.attr("tags")||"").split(/\s/)||[]],["name",t]]),{TwineScript_TypeName:"a passage datamap",TwineScript_ObjectName:"a passage datamap",metadata:r,tree:null})}var f=Object.create(null),d=[],h=null,m=l(new Map,{TwineScript_ObjectName:"the Passages datamap",getTagged:function(n){if(f[n])return f[n];var e=s("en",function(e){return e.get("name")}),r=[];return this.forEach(function(e){var t=e instanceof Map&&e.get("tags");Array.isArray(t)&&t.includes(n)&&r.push(e)}),r.sort(e),f[n]=r},clearTagCache:function(){f=Object.create(null)},clear:function(){Map.prototype.clear.call(this),this.clearTagCache(),this.clearTreeCache(),this.clearStoryletCache()},delete:function(){var e;(e=Map.prototype.delete).call.apply(e,[this].concat(Array.prototype.slice.call(arguments))),this.clearTagCache(),this.clearTreeCache(),this.clearStoryletCache()},getTree:function(e){if(!this.has(e))return o("Passages.getTree","No passage name?"),[];var t=this.get(e),n=t.get("tags");if(n.includes("header")||n.includes("footer")||n.includes("debug-header")||n.includes("debug-footer"))return t.tree||(t.tree=i.lex(t.get("source"),e)),t.tree;for(var r,a=0;a<d.length;a+=1)if(d[a]&&d[a].place===e)return r=d.splice(a,1)[0],d.unshift(r),r;n=i.lex(t.get("source"),e);return d.unshift(n),16<d.length&&d.pop(),n},clearTreeCache:function(){d=[]},getStorylets:function(r,e){e=e?e.filter(r,_toConsumableArray(m.values())):_toConsumableArray(m.values());if(c.containsError(e))return e;var a=[],o=-1/0,e=e.reduce(function(e,t){if(e)return e;e=t.get("storylet");if(e){var n=r.speculate(e,t.get("name"),"a (storylet:) macro");if(c.containsError(n))return n.message="There's an error in the storylet passage \""+t.get("name")+'":\n'+n.message,n.source=e.TwineScript_ToSource(),n;n&&(e=t.get("exclusivity"),o=Math.max(o,"number"==typeof e?e:0),a.push(t))}},void 0);if(e)return e;var i=s("en");return a.filter(function(e){e=e.get("exclusivity");return(e="number"==typeof e?e:0)===o}).sort(function(e,t){var n=e.get("urgency"),r=t.get("urgency");return(n="number"==typeof n?n:0)!==(r="number"==typeof r?r:0)?r-n:i(e.get("name"),t.get("name"))})},allStorylets:function(){return h=h||_toConsumableArray(m.values()).filter(function(e){return e.get("storylet")})},clearStoryletCache:function(){h=null},loadMetadata:function(i){var s=[];return m.forEach(function(o){o.metadata&&Object.keys(o.metadata).forEach(function(e){var t,n,r;{if(!c.containsError(o.metadata[e]))return t=o.metadata[e],n=i.speculate(t,o.get("name"),"a ("+e+":) macro"),r='In "'+o.get("name")+'":\n',c.containsError(n)?(n.message=r+n.message,n.source=t.text,void s.push(n)):void(n instanceof Map?n.forEach(function(e,t){return a(t,e)}):a(e,n));s.push(o.metadata[e])}function a(e,t){o.has(e)?s.push(c.create("syntax","This passage's datamap already has a '"+JSON.stringify(e)+"' data name.")):o.set(e,t)}}),o.metadata=void 0}),s},hasValid:function(e){e=this.get(e);return e&&e instanceof Map&&e.has("source")},create:r});return n(function(){t("tw-storydata > tw-passagedata").get().forEach(function(e){e=t(e),m.set(e.attr("name"),new r(e))})}),m}),define("renderer",["jquery","utils","markup","internaltypes/twineerror"],function(a,e,w,T){var k=e.escape,S=e.insensitiveName,x=e.options;function O(e,t,n){n=2<arguments.length&&void 0!==n?n:"";return"<"+t+(n?" "+n:"")+">"+e+"</"+t+">"}var _="text-align: center; max-width:50%; ";return Object.freeze({exec:function(e){var r={code:[],blockers:[],source:[]},e=function r(e,o){function t(e,t,n){return(e=r(e.children,o))&&O(e,t,n)}var n="",a=[];if(e)for(var i=(e=Array.isArray(e)?e:[e]).length,s=0;s<i;s+=1){var c=e[s];switch(c.type){case"include":n+=t(c,"tw-"+c.type,'type="'.concat(c.tag,'" name="').concat(c.name,'"'));break;case"error":n+=T.create("syntax",c.message,c.explanation).render(k(c.text))[0].outerHTML;break;case"numbered":case"bulleted":for(var u="numbered"===c.type?"ol":"ul",l=(n+="<"+u+">",1);s<i&&e[s];){if("br"===e[s].type){if(n+="</li>",!e[s+1]||e[s+1].type!==c.type)break}else e[s].type===c.type?(n=(n+=("<"+u+">").repeat(Math.max(0,e[s].depth-l)))+("</"+u+">").repeat(Math.max(0,l-e[s].depth))+"<li>",l=e[s].depth):n+=r([e[s]],o);s+=1}n+=("</"+u+">").repeat(l+1);break;case"align":for(;c&&"align"===c.type;){var p=c.align,f=s+=1;if("left"===p){--s;break}for(;s<i&&e[s]&&"align"!==e[s].type;)s+=1;var f=r(e.slice(f,s),o),d="";switch(p){case"center":d+=_+"margin-left: auto; margin-right: auto;";break;case"justify":case"right":d+="text-align: "+p+";";break;default:+p&&(d+=_+"margin-left: "+p+"%;")}n+="<tw-align "+(d?'style="'+d+'"':"")+">"+f+"</tw-align>\n",c=e[s]}break;case"column":for(var h=[];c&&"column"===c.type;){var m=c.column,y=s+=1;if("none"===m){--s;break}for(;s<i&&e[s]&&"column"!==e[s].type;)s+=1;h.push({text:c.text,type:m,body:r(e.slice(y,s),o),width:c.width,marginLeft:c.marginLeft,marginRight:c.marginRight}),c=e[s]}h.length&&!function(){var t=h.reduce(function(e,t){return e+t.width},0);n+="<tw-columns>"+h.map(function(e){return"<tw-column type=".concat(e.type," ",' style="width:').concat(e.width/t*100,"%; margin-left: ").concat(e.marginLeft,"em; margin-right: ").concat(e.marginRight,'em;">').concat(e.body,"</tw-column>\n")}).join("")+"</tw-columns>"}();break;case"heading":for(n+="<h"+c.depth+">";++s<i&&e[s];){if("br"===e[s].type){n+="</h"+c.depth+">";break}n+=r([e[s]],o)}break;case"br":if(!a.length||/td|th/.test(a[0])){n+="<br>";for(var g=e[s+1];g&&("br"===g.type||"tag"===g.type&&/^<br\b/i.test(g.text));)n+="<tw-consecutive-br"+("tag"===g.type?" data-raw":"")+"></tw-consecutive-br>",g=e[(s+=1)+1]}break;case"hr":n+="<hr>";break;case"escapedLine":case"comment":break;case"inlineUrl":n+='<a class="link" href="'+k(c.text)+'">'+c.text+"</a>";break;case"scriptStyleTag":case"tag":var v=c.text.toLowerCase();/^<\/?(?:table|thead|tbody|tr|tfoot|td|th|svg)\b/.test(v)&&a[c.text.startsWith("</")?"shift":"unshift"](v),n+=c.text.startsWith("</")?c.text:c.text.replace(/>$/," data-raw>");break;case"sub":case"sup":case"strong":case"em":n+=t(c,c.type);break;case"strike":n+=t(c,"s");break;case"bold":n+=t(c,"b");break;case"italic":n+=t(c,"i");break;case"twineLink":v=_slicedToArray(w.lex("(link-goto:"+JSON.stringify(c.innerText)+","+JSON.stringify(c.passage)+")").children,1)[0],n+='<tw-expression type="macro" name="link-goto"'+(x.debug?' title="'+k(c.text)+'"':"")+' code="'+o.code.length+'"></tw-expression>',o.code.push(v);break;case"hook":n+="<tw-hook "+(c.hidden?"hidden ":"")+(c.name?'name="'+S(c.name)+'"':"")+(x.debug&&c.name?' title="Hook: ?'+c.name+'"':"")+' source="'+o.source.length+'"></tw-hook>',o.source.push(c.children);break;case"unclosedHook":return n+="<tw-hook "+(c.hidden?"hidden ":"")+(c.name?'name="'+S(c.name)+'"':"")+'source="'+o.source.length+'"></tw-hook>',o.source.push(e.slice(s+1,i)),n;case"verbatim":n+=O(k(c.innerText).replace(/\n/g,"<br>"),"tw-verbatim");break;case"collapsed":n+=t(c,"tw-collapsed");break;case"unclosedCollapsed":return n+="<tw-collapsed>"+r(e.slice(s+1,i),o)+"</tw-collapsed>";case"variable":case"tempVariable":case"macro":var b=function(){var r=[],a=[];if("macro"===c.type&&function e(t){"string"!==t.type&&"hook"!==t.type&&t.children.every(e);var n=S(t.name);if("macro"!==t.type||"prompt"!==n&&"confirm"!==n){if("hook"===t.type&&!t.everyLeaf(function(e){return"error"!==e.type||(a.push(e),!1)}))return!1}else r.push(t);return!0}(c),a.length)return{v:T.create("syntax","This code hook's markup contained "+a.length+" error"+(a.length?"s":"")+":<br>\u2014"+a.map(function(e){return e.message}).join("<br>\u2014")).render(k(c.text))[0].outerHTML};var e=r.map(function(e){return e.blockerTree=o.blockers.length,o.blockers.push(e),e.blockerTree});n+='<tw-expression type="'+c.type+'" name="'+k(c.name||c.text)+'"'+(x.debug?' title="'+k(c.text)+'"':"")+(e.length?' blockers="'+e+'"':"")+' code="'+o.code.length+'"></tw-expression>',o.code.push(c)}();if("object"===_typeof(b))return b.v;break;default:n+=c.children&&c.children.length?r(c.children,o):c.text}}return n}("string"==typeof e?w.lex(e).children:e,r),e=a(a.parseHTML(e,document,!0));return e.findAndFilter("script:not([src])").each(function(e,t){var n=t.getAttribute("type");n&&"text/javascript"!==n.toLowerCase()||t.setAttribute("type","application/x-harlowe")}),r.blockers=r.blockers.map(function(e){e.blockedValue=!0;e=Object.create(e);return e.blockedValue=!1,e}),e.findAndFilter("tw-expression[code]:not([data-raw]), tw-expression[blockers]:not([data-raw]), tw-hook[source]:not([data-raw])").each(function(e,t){var n;(t=a(t)).attr("blockers")&&(n=t.popAttr("blockers").split(",").map(function(e){return r.blockers[e]}),t.data("blockers",n)),t.attr("source")&&t.data("source",r.source[t.popAttr("source")]),t.attr("code")&&t.data("code",r.code[t.popAttr("code")])}),e}})}),define("utils/renderutils",["jquery","utils","renderer"],function(u,l,p){var n=RegExp(l.realWhitespace+"+"),s=RegExp(l.realWhitespace+"+","g");function f(e,t,n){var r,a=e.textContent.length;if(!(a<=t))return r=[e=0===t?e:e.splitText(t)],n&&(n=n<=0?a-n:n)<a&&r.push(e.splitText(n-t)),r}var t,c=function(){if(void 0!==t)return t;var e=u("<p>");return t=!!e[0].normalize&&(e.append(document.createTextNode("0-"),document.createTextNode("2"),document.createTextNode(""))[0].normalize(),1===e.contents().length)};var d="tw-collapsed,[collapsing=true]";var o=/^(=*)([^=]+)=*$/;return Object.freeze({dialog:function(){var e,t=(c=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).section,n=void 0===(n=c.parent)?l.storyElement:n,r=c.cd,a=void 0===(a=c.message)?"":a,o=c.defaultValue,i=void 0===(c=c.buttons)?[{name:"OK",confirm:!0,callback:Object}]:c,s=("a code hook"===a.TwineScript_TypeName&&(a=a.code),u("<tw-backdrop><tw-dialog>"+(o||""===o?"<input type=text style='display:block;margin:0 auto'></input>\n":"")+"<tw-dialog-links>"+(i.length?i.reduce(function(e,t,n){t=t.name;return e+"<tw-link style='margin:0 "+(n===i.length-1?"0 0 0.5em":0===n?"0.5em 0 0":"0.5em")+"' tabindex=0>"+t+"</tw-link>"},""):"<tw-link tabindex=0>"+i[0].name+"</tw-link>")+"</tw-dialog-links></tw-dialog></tw-backdrop>")),c=s.find("tw-dialog");return n.append(s),t?(t.renderInto(a,c,Object.assign({},r,{append:"prepend"})),(n=r&&r.transition&&s.find("tw-dialog > tw-transition-container"))&&n.length&&n.appendTo(s).append(c.prepend(n.contents().detach()))):c.prepend(p.exec(a)),o&&((e=s.find("input").last()).val(o).on("keypress",function(e){13===e.which&&(s.remove(),i.filter(function(e){return e.confirm}).forEach(function(e){return e.callback()}))}),setTimeout(function(){return e.focus()},100)),i.reverse().forEach(function(e,t){u(s.find("tw-link").get(-t-1)).on("click",function(){s.remove(),e.callback()})}),s},realWhitespace:n,textNodeToChars:function(r){var e=_toConsumableArray(r.textContent);return 1===e.length?[r]:e.reduce(function(e,t){return t.match(n)&&e.length&&e[e.length-1].match(n)?e[e.length-1]+=t:e.push(t),e},[]).reduce(function(e,t){var n=r;return t.length<r.textContent.length&&(r=r.splitText(t.length)),e.concat(n)},[])},findTextInNodes:function e(t,n){var r=[],a="",o=[];if(!t.length||!n)return o;for(;0<t.length;){r.push(t[0]),a+=t[0].textContent,t.shift();var i=a.indexOf(n);if(-1<i){for(var s=a.length-(i+n.length);i>=r[0].textContent.length;)i-=r[0].textContent.length,r.shift();if(1===r.length){var c=f(r[0],i,i+n.length);o.push(c[0]),c[1]&&t.unshift(c[1]);break}o.push(f(r[0],i,r[0].length)[0]),o.push.apply(o,_toConsumableArray(r.slice(1,-1))),c=f(r[r.length-1],0,r[r.length-1].textContent.length-s),o.push(c[0]),c[1]&&t.unshift(c[1]),o=o.filter(Boolean);break}}return[o].concat(_toConsumableArray(e(t,n)))},collapse:function(e){function n(e){return 0===u(this||e).parentsUntil(d).filter("tw-verbatim, tw-expression, [collapsing=false]").length}var t=function e(t){var n=t[0],r=t.parent();if(!r.length||t.findAndFilter("tw-story").length)return null;t=r.textNodes().filter(function(e){return 4&(e=e.compareDocumentPosition(n))&&!(8&e)});return t[t.length-1]||e(r)}(e),r=(u(t).parents(d).length||(t=null),function e(t){var n=t[0],r=t.parent();if(!r.length||t.findAndFilter("tw-story").length)return null;t=r.textNodes().filter(function(e){return 2&(e=e.compareDocumentPosition(n))&&!(8&e)})[0];return t||e(r)}(e)),a=(u(r).parents(d).length||(r=null),"br:not([data-raw]),tw-consecutive-br:not([data-raw])"),o=(e.find(a).filter(n).replaceWith(document.createTextNode(" ")),(e=u(e.get().map(function(e){return u(e).filter(n).is(a)?u(document.createTextNode(" ")).replaceAll(e)[0]:e}))).textNodes()),i=0;o.reduce(function(e,t){return n(t)?(t.textContent=t.textContent.replace(s," ")," "!==t.textContent[0]||e&&e.textContent&&!(-1<e.textContent.search(/\s$/))||(t.textContent=t.textContent.slice(1)),t):document.createTextNode("A")},t),_toConsumableArray(o).reverse().every(function(e){return!!n(e)&&(e.textContent.match(/^\s*$/)?(i+=e.textContent.length,!(e.textContent="")):(e.textContent=e.textContent.replace(/\s+$/,function(e){return i+=e.length,""}),!1))}),0<i&&r&&(o[o.length-1].textContent+=" "),e[0]&&c()&&e[0].normalize()},geomStringRegExp:o,geomParse:function(e){if(!e)return{marginLeft:0,size:0};var t=e.length,n=(a=_slicedToArray(o.exec(e)||[],3))[0],r=a[1],a=a[2];return!n||a===e&&1<a.length?{marginLeft:0,size:0}:{marginLeft:r.length/t*100,size:a.length/t*100}}})}),define("utils/operationutils",["utils/naturalsort","utils","internaltypes/twineerror","patterns"],function(d,e,h,t){var m=e.impossible,y=e.nth,l=e.permutations,s=e.plural,g=t.validPropertyName,r="object",n="boolean",v="string",b="number",w="function";function a(e){return!!e&&(_typeof(e)===r||_typeof(e)===w)}var T=Array.isArray;function k(e){return e&&Object.getPrototypeOf(e)===Object.prototype}function o(e){return T(e)?"array":e instanceof Map?"datamap":e instanceof Set?"dataset":_typeof(e)===v?v:e&&_typeof(e)===r?r:""}function i(e){if(a(e)){if(_typeof(e.TwineScript_Clone)===w)return e.TwineScript_Clone();if(T(e))return _toConsumableArray(e);if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(_typeof(e)===w)return Object.assign(e.bind(),e);switch(Object.getPrototypeOf(e)){case Object.prototype:return Object.assign({},e);case null:return Object.assign(Object.create(null),e)}m("OperationUtils.clone","The value "+e+" cannot be cloned!")}return e}function c(e,t,n,r){for(var a="",o=0;a.length<=t&&o<e.length;){var i=r(e[o]);if(!(i.length+a.length<=t)){a+=(0<o?" and ":"")+s(e.length-o,(0<o?"other ":"")+n);break}a+=(0<o&&o===e.length-1?" and ":"")+i+(o<e.length-1?", ":""),o+=1}return a}function u(e){if(a(e)&&"TwineScript_ObjectName"in e)return e.TwineScript_ObjectName;if(T(e))return 0===e.length?"an empty array":"an array (with "+c(e,48,"item",u)+")";if(e instanceof Map)return 0===e.size?"an empty datamap":"a datamap (with "+c(_toConsumableArray(e.keys()),48,"dataname",x)+")";if(e instanceof Set)return 0===e.size?"an empty dataset":"a dataset (with "+c(_toConsumableArray(e.values()),48,"item",u)+")";if(_typeof(e)!==v)return _typeof(e)===n?"the boolean value '"+e+"'":_typeof(e)===b?"the number "+JSON.stringify(e):void 0===e?"an empty variable":"...whatever this is";if(0===e.length)return"an empty string";var t=_toConsumableArray(e);return 48<t.length?"a ".concat(t.length,"-character string starting with ").concat(JSON.stringify(t.slice(0,48).join(""))):"the string ".concat(JSON.stringify(e))}function S(e,t){return[e[0],t[0]].sort(d("en"))[0]===e[0]?-1:1}function x(e,t){var n=h.containsError(e);if(n&&m("toSource","received a TwineError: "+n.message),_typeof(e.TwineScript_ToSource)===w)return e.TwineScript_ToSource();if(k(e)&&"first"in e&&"last"in e)return(e.first<0?(-1!==e.first?y(-e.first):"")+"last":y(e.first+1))+"to"+(e.last<0?(-1!==e.last?y(-e.last):"")+"last":y(e.last+1));if(T(e)){var r,a="",o=_createForOfIteratorHelper(e);try{for(o.s();!(r=o.n()).done;)var i=r.value,a=(a+=a?",":"(a:")+("property"===t?i+(0<i):x(i))}catch(e){o.e(e)}finally{o.f()}return a+(a?")":"(a:)")}if(e instanceof Map){var s,c="",u=_createForOfIteratorHelper(Array.from(e.entries()).sort(S));try{for(u.s();!(s=u.n()).done;){var l=_slicedToArray(s.value,2),p=l[0],f=l[1];c+=(c?",":"(dm:")+x(p)+","+x(f)}}catch(e){u.e(e)}finally{u.f()}return c+(c?")":"(dm:)")}return e instanceof Set?"(ds:"+Array.from(e).sort(d("en")).map(x)+")":_typeof(e)===b&&"property"===t?e<0?-1===e?"last":y(-e)+"last":y(e+1):_typeof(e)===v&&"property"===t?RegExp(g).test(e)?e:"("+JSON.stringify(e)+")":JSON.stringify(e)}function p(t,n){return _typeof(t)!==r&&_typeof(n)!==r?t===n:T(t)&&T(n)?t.length===n.length&&t.every(function(e,t){return p(n[t],e)}):t instanceof Map&&n instanceof Map?p(Array.from(t.entries()).sort(),Array.from(n.entries()).sort()):t instanceof Set&&n instanceof Set?p(_toConsumableArray(t),_toConsumableArray(n)):t&&_typeof(t.TwineScript_is)===w?t.TwineScript_is(n):t&&_typeof(t)===r&&n&&_typeof(n)===r&&k(t)&&k(n)?p(Object.getOwnPropertyNames(t).map(function(e){return[e,t[e]]}),Object.getOwnPropertyNames(n).map(function(e){return[e,n[e]]})):Object.is(t,n)}return Object.freeze({isObject:a,isValidDatamapName:function(e,t){if(e instanceof Map||m("isValidDatamapName","called with non-Map"),h.containsError(t))return t;if(_typeof(t)!==v&&_typeof(t)!==b)return h.create("property","Only strings and numbers can be used as data names for "+u(e)+", not "+u(t)+".");var n=_typeof(t)===v?+t:""+t;return!(!Number.isNaN(n)&&e.has(n))||h.create("property","You mustn't use both "+u(t)+" and "+u(n)+" as data names in the same datamap.")},collectionType:o,isSequential:function(e){return _typeof(e)===v||T(e)||_typeof(e.hooks)===w},unstorableValue:function e(t){return t&&t.TwineScript_Unstorable&&t||T(t)&&t.find(e)||t instanceof Map&&_toConsumableArray(t.values()).find(e)||t instanceof Set&&_toConsumableArray(t).find(e)},isHarloweJSValue:function e(t){return _typeof(t)===v||_typeof(t)===n||_typeof(t)===b&&!Number.isNaN(t)&&Math.abs(t)!==1/0||Array.isArray(t)&&t.every(e)||t instanceof Set&&_toConsumableArray(t).every(e)||t instanceof Map&&_toConsumableArray(t.values()).every(e)&&_toConsumableArray(t.keys()).every(function(e){return _typeof(e)===v})},clone:i,objectName:u,typeName:function e(t){var n=k(t);if(n&&t.innerType)return t.typeName||("insensitive set"===t.pattern?"a case-insensitive string name":"either"===t.pattern?(T(t.innerType)||m("typeName",'"either" pattern had non-array inner type'),t.innerType.map(e).join(" or ")):"optional"===t.pattern?"(optional) "+e(t.innerType):e(t.innerType));if(n&&"range"===t.pattern){if(t.name)return t.name;var n=t.min,r=t.max;return"a"+(0<n?" positive":"")+(t.integer?" whole":"")+" number"+(0===n?" between 0 and "+r:r<1/0?" up to "+r:"")}return t===String||t===Number||t===Boolean?"a "+_typeof(t()):t===parseInt?"a whole number":t===Map?"a datamap":t===Set?"a dataset":t===Array?"an array":a(t)&&"TwineScript_TypeName"in t?t.TwineScript_TypeName:u(t)},typeID:function(e){var t=_typeof(e);return[n,v,b].includes(t)?t:T(e)?"array":e instanceof Map?"datamap":e instanceof Set?"dataset":e.TwineScript_TypeID||""},toSource:x,is:p,contains:function(e,t){if(e||""===e){if(_typeof(e)===v)return _typeof(t)!==v?h.create("operation",u(e)+" can only contain strings, not "+u(t)+"."):e.includes(t);if(T(e))return e.some(function(e){return p(e,t)});if(e instanceof Set||e instanceof Map)return Array.from(e.keys()).some(function(e){return p(e,t)})}return h.create("operation",u(e)+" cannot contain any values, let alone "+u(t))},isA:function(e,t){return _typeof(t.TwineScript_IsTypeOf)===w?t.TwineScript_IsTypeOf(e):h.create("operation",'"is a" should only be used to compare type names, not '+u(t)+".")},matches:function t(n,e){var r=!1;if(n&&_typeof(n.TwineScript_IsTypeOf)===w){var a=n.TwineScript_IsTypeOf(e);if(h.containsError(a))return a;r|=a}if(e&&_typeof(e.TwineScript_IsTypeOf)===w){if(a=e.TwineScript_IsTypeOf(n),h.containsError(a))return a;r|=a}if(r)return!0;if(T(n)&&T(e)){for(var o=0,i=0,s=!0;s&&o<n.length&&i<e.length;){var c=n[o],u=e[i];if(c.rest){for(;i<e.length&&t(c,u);)u=e[i+=1];o+=1}else if(u.rest){for(;o<n.length&&t(c,u);)c=n[o+=1];i+=1}else t(c,u)?(o+=1,i+=1):s=!1}return s&&o>=n.length&&i>=e.length}return n instanceof Map&&e instanceof Map?t(Array.from(n.entries()).sort(),Array.from(e.entries()).sort()):n instanceof Set&&e instanceof Set?(n=_toConsumableArray(n),l.apply(void 0,_toConsumableArray(e)).some(function(e){return t(n,e)})):p(n,e)},subset:function e(t,n,r){if(!n||!r)return h.create("macrocall","The sub"+o(t)+" index value must not be "+(n&&r)+".");var a=_typeof(t)===v;if(a&&(t=Array.from(t)),n<0&&(n=Math.max(0,t.length+n+1)),(r=r<0?Math.max(0,t.length+r+1):r)<n)return e(arguments[0],r,n);t=t.slice(0<n?n-1:n,r).map(i);return a?t.join(""):t},range:function e(t,n){if(n<t)return e(n,t);var r=[t];for(n-=t;0<n--;)r.push(++t);return r},printBuiltinValue:function r(e){return h.containsError(e)?e:e&&_typeof(e.TwineScript_Print)===w?e.TwineScript_Print():e instanceof Map?(e=Array.from(e.entries()),h.containsError(e)?e:e.reduce(function(e,t){var n=(t=_slicedToArray(t,2))[0],t=t[1];return e+"<tr><td>`"+r(n)+"`</td><td>`"+r(t)+"`</td></tr>"},"<table class=datamap>")+"</table>"):e instanceof Set?Array.from(e.values()).map(r)+"":T(e)?e.map(r)+"":e&&_typeof(e.jquery)===v?e:a(e)?h.create("unimplemented","I don't know how to print this value yet."):e+""},unique:function(t,e,n){return n.findIndex(function(e){return p(t,e)})===e}})}),define("datatypes/hookset",["jquery","utils","utils/renderutils","utils/operationutils"],function(y,s,e,t){var g=e.textNodeToChars,v=e.realWhitespace,c=e.findTextInNodes,r=t.toSource;function u(e){function t(n,e){if(Array.isArray(e))return e.reduce(function(e,t){return e.add(n.get(t))},y());if(e&&"object"===_typeof(e)&&"first"in e&&"last"in e){for(var t=e.first,r=e.last,a=n.length,o=(t<0&&(t+=a),r<0&&(r+=a),[n.get(t)]);t!==r;)t+=Math.sign(r-t),o.push(n.get(t));return y(o)}if("string"==typeof e){if("chars"===e){var i,s=[],c=_createForOfIteratorHelper(n.textNodes(m));try{for(c.s();!(i=c.n()).done;){var u,l=i.value,p=_createForOfIteratorHelper(g(l));try{for(p.s();!(u=p.n()).done;){var f=u.value;f.textContent.match(v)||s.push(f)}}catch(e){p.e(e)}finally{p.f()}}}catch(e){c.e(e)}finally{c.f()}return y(s)}if("links"===e)return n.findAndFilter("tw-link, .enchantment-link");if("visited"===e)return n.findAndFilter("tw-link.visited");var d,h;if("lines"===e)return d=n.findAndFilter("br:not(tw-sidebar *),tw-consecutive-br:not(tw-sidebar *)").get(),h=[[]],n.contents().each(function e(t,n){var r=(n.tagName||"").toLowerCase();if("tw-sidebar"!==r)if("tw-passage"===r||"tw-transition-container"===r)y(n).contents().each(e);else{if(d.length){if(n===d[0])return d.shift(),void h.push([]);if(16&n.compareDocumentPosition(d[0]))return h.push([]),y(n).contents().each(e),void h.push([])}h[h.length-1].push(n)}}),y(h.map(function(e){return!!e.length&&y(e).wrapAll("<tw-pseudo-hook>").parent()[0]}).filter(Boolean))}return y(n.get(e))}var n,r,a=e.dom,m=":not(tw-error, tw-error *)",o=y();this.next&&(o=o.add(u.call(this.next,e)));if(this.selector){if("string"===this.selector.type)i=this.selector.data,n=c((n=a).textNodes(),i),r=y(),n.forEach(function(e){r=r.add(y(e).wrapAll("<tw-pseudo-hook>").parent())}),i=r;else{if("base"===this.selector.type)return o.add(t(u.call(this.selector.data,e),this.property));n=this.selector.data,e='tw-hook[name="'+(n=s.insensitiveName(n).replace(/"/g,"""))+'"],tw-enchantment[name="'+n+'"]';var e=e+={page:", tw-story",passage:", tw-passage",sidebar:", tw-sidebar",link:", tw-link, .enchantment-link"}[n]||"",i=a.findAndFilter(e).add(a.parentsUntil(s.storyElement.parent())).filter(e)}o=this.property?o.add(t(i,this.property)):o.add(i)}return o=o.get().reduce(function(e,t){return t=y(t),e.add(t.is("tw-enchantment")&&t.contents().length<=1?t.contents():t)},y())}function a(e){if(!e)return[];var t=e.selector,n=e.property,e=e.next;return[JSON.stringify(["base"===t.type?a(t.data):s.insensitiveName(t.data),n])].concat(_toConsumableArray(a(e))).sort()}var o=Object.freeze({forEach:function(e,n){var t=u.call(this,e).each(function(e,t){return n(y(t),e)});return e.dom.findAndFilter("tw-pseudo-hook").contents().unwrap(),t},hooks:function(e){return u.call(this,e)},get TwineScript_ObjectName(){return"the hook name ".concat(this.TwineScript_ToSource())},TwineScript_TypeID:"hookName",TwineScript_TypeName:"a hook name (like ?this)",TwineScript_Unstorable:!0,TwineScript_ToSource:function(){var e="",t=this.selector,n=t.type,t=t.data;return"name"===n?t.match(RegExp("^"+s.anyRealLetter+"+$"))?e+="?"+t:e+="(hooks-named:"+JSON.stringify(t)+")":"string"===n?e+=JSON.stringify(t):"base"===n&&(e+=t.TwineScript_ToSource()+"'s "+r(this.property,"property")),this.next&&(e+=" + "+this.next.TwineScript_ToSource()),e},"TwineScript_+":function(e){for(var t=this.TwineScript_Clone(),n=t;n.next;)n=n.next;return n.next=e,t},TwineScript_is:function(e){return a(this)+""==a(e)+""},TwineScript_GetProperty:function(e){return o.create({type:"base",data:this},e,void 0)},TwineScript_Properties:["chars","links","lines","visited"],TwineScript_Clone:function(){return o.create(this.selector,this.property,this.next)},create:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0;return Object.assign(Object.create(this||o),{selector:Object.freeze(e),property:t,next:n})},from:function(e){return o.isPrototypeOf(e)||"string"==typeof e||s.impossible("HookSet.from() was given a non-HookSet non-string."),o.isPrototypeOf(e)?e:o.create({type:"string",data:e})}});return o}),define("internaltypes/changedescriptor",["jquery","utils","renderer","datatypes/hookset","internaltypes/twineerror"],function(v,e,t,b,n){function w(e){return("string"==typeof e?e:e.map(function(e){return e.text}).join("")).split(/\n/g).reduce(function(e,t,n,r){r=r.length;return e.concat(document.createTextNode(t),n!==r-1&&document.createElement(t.length?"br":"tw-consecutive-br"))},[])}var T=e.impossible,k=e.transitionIn,S=t.exec,x=Object.assign,p=Object.keys,r=Object.create,e=Object.seal,O=Array.isArray,_={source:"",appendSource:null,enabled:!0,enablers:null,verbatim:!1,target:null,append:"",newTargets:null,transition:"",transitionTime:null,transitionDeferred:!1,transitionDelay:0,transitionSkip:0,transitionOrigin:null,loopVars:null,styles:null,attr:null,data:null,innerEnchantments:null,section:null,timestamp:0,output:!1,summary:function(){var t=this;return["source","appendSource","enabled","verbatim","target","append","newTargets","transition","transitionTime","transitionDeferred","transitionDelay","transitionSkip","transitionOrigin","innerEnchantments","enablers","output"].filter(function(e){return hasOwnProperty.call(t,e)}).concat([this.attr.length&&"attr",this.styles.length&&"styles",p(this.loopVars).length&&"loopVars",p(this.data).length&&"data"].filter(Boolean))},create:function(e,t){e=x(r(this),{attr:this.attr?this.attr.slice():[],styles:this.styles?this.styles.slice():[],loopVars:this.loopVars||{},data:this.data||{}},e);if(t){t=t.run(e);if(n.containsError(t))return t}return e},update:function(){function e(t){var e,n,r;O(a.styles)&&0<a.styles.length&&(n=(e=_slicedToArray(a.styles.reduce(function(n,r){return p(r).forEach(function(e){var t=r[e];n[+("function"==typeof t)].push(_defineProperty({},e,t))}),n},[[],[]]),2))[0],r=e[1],n.forEach(function(e){return t.css(e)}),setTimeout(function(){r.forEach(function(e){return t.css(e)})})),a.attr&&a.attr.forEach(function(e){return t.attr(e)}),a.data&&t.data(a.data)}var a=this,t=this.section,n=this.newTargets,r=this.transition,o=this.transitionDeferred,i=this.append,s=this.target;"function"==typeof s&&(s=s());if(O(n)&&n.length&&(s=n.map(function(e){return e.target})),O(s))for(var c=0;c<s.length;c+=1)b.isPrototypeOf(s[c])?s[c].forEach(t,e):e(s[c]);else b.isPrototypeOf(s)?s.forEach(t,e):e(s);if(r&&!o&&!i){for(var u,l=s;(u=l.data("timestamp"))||(l=l.parent()),!u&&l.length;);k(s,r,this.transitionTime,this.transitionDelay,this.transitionSkip,u?Date.now()-u:0,this.transitionOrigin)}},render:function(){var e,r=this,t=this.source,n=this.transition,a=this.transitionTime,o=this.transitionDeferred,i=this.enabled,s=this.enablers,c=this.data,u=this.section,l=this.newTargets,p=this.innerEnchantments,f=this.appendSource,d=this.output,h=this.target,m=this.target,y=this.append;if("function"==typeof h&&(h=h()),!y)return T("ChangeDescriptor.render","This doesn't have an 'append' method chosen."),v();if(d)return v();if(s&&s.length)return s=(d=s[0]).descriptor,d=d.changer,s=s.render(),d&&(e=_.create({section:u,target:s}),d.run(e),e.update()),s;if(!i||void 0!==h.attr("hidden"))return _.create({target:h,attr:this.attr.filter(function(e){return!("style"in e)}),data:x({},c,{originalSource:t,hidden:!0})}).update(),v();if(!(h=O(l)&&l.length?l:h))return T("ChangeDescriptor.render","ChangeDescriptor has source but not a target!"),v();var g=v();if([].concat(h).filter(function(e){return!e.jquery}).map(function(e){var t,n,r=y;return e.target&&e.append&&(r=(t=e).append,n=t.before,e=e.target),{elements:e.hooks(u,m).filter(function(){return!(n&&1&this.compareDocumentPosition(document)&&2&this.compareDocumentPosition(m[0]))}),append:r}},[]).forEach(function(e){var t=e.elements,n=e.append;t.each(function(e,t){t=v(t),g=g.add(r.create({target:t,append:n,newTargets:null}).render()),t.filter("tw-pseudo-hook").contents().unwrap()})}),!(g.length||O(h)||b.isPrototypeOf(h))){d=y;if(!(d in h)){if("replace"!==d)return T("ChangeDescriptor.render","The target doesn't have a '"+d+"' method."),v();d=h[0]instanceof Text?"replaceWith":(h.empty(),"append")}h[0]instanceof Text&&"prepend"===(d="append"===d?"after":d)&&(d="before"),g=v(t&&(this.verbatim?w:S)(t)),O(f)&&f.forEach(function(e){var t=e.source,e=e.append,t=v((r.verbatim?w:S)(t));g="append"===e?g.add(t):"prepend"===e?t.add(g):t}),h[d](g.length?g:void 0),h.data("timestamp",Date.now()),this.update(),n&&!o&&k("replace"===y?h:g,n,a,this.transitionDelay,this.transitionSkip,this.expedite,this.transitionOrigin),p&&p.map(function(e){return e(h)}).forEach(function(e){return u.addEnchantment(e)})}return g}};return e(_)}),define("datatypes/customcommand",["internaltypes/changedescriptor","internaltypes/twineerror"],function(u,l){var p=Object.assign,f=Object.create;return Object.seal({TwineScript_TypeID:"command",TwineScript_ObjectName:"a custom command",TwineScript_TypeName:"a custom command",TwineScript_Print:function(){return"`[a custom command]`"},create:function(e){var t,n=e.toSource,r=e.changer,a=e.hook,o=e.variables,i={};for(t in o)i[t]=[o[t]];var s=u.create({source:a,loopVars:i},r);if(l.containsError(s))return s;var c=p(f(this),{TwineScript_Attach:function(e,t){s.section=e;e=t.run(s);return l.containsError(e)?e:c},TwineScript_Run:function(e){s.section=e;e=s;return s=u.create({source:a,loopVars:i},r),e},TwineScript_ToSource:function(){return n},TwineScript_CustomCommand:function(){return e}});return c}})}),define("state",["jquery","utils","passages","datatypes/customcommand","utils/operationutils","markup"],function(n,f,d,h,e,t){var i,m,E=e.toSource,A=e.is,y=t.lex,o=Object.assign,g=Object.create,e=Object.defineProperty,j=Array.isArray,s=Math.imul,t=(e(Map.prototype,"toJSON",{value:void 0}),e(Set.prototype,"toJSON",{value:void 0}),["localStorage","sessionStorage"].map(function(e){try{return!!window[e]&&(window[e].setItem("test","1"),window[e].removeItem("test"),!0)}catch(e){return!1}}));function v(e,t){var n=0<arguments.length&&void 0!==e?e:String.fromCodePoint(Date.now()%1114112),e=1<arguments.length&&void 0!==t?t:0;i.seedIter=e,i.seed=n;for(var r,a=0,o=2166136261;a<n.length;a+=1)r=s(n.charCodeAt(a),3432918353),o^=s(r<<15|r>>>17,461845907),o=s(o=o<<13|o>>>19,5)+3864292196|0;return o^=n.length,o=s(o^=o>>>16,2246822507),o=s(o^=o>>>13,3266489909),o=((o^=o>>>16)>>>0)+1831565813*e,function(){i.seedIter+=1;var e=o+=1831565813,e=s(e^e>>>15,1|e);return(((e^=e+s(e^e>>>7,61|e))^e>>>14)>>>0)/4294967296}}function r(e,t){for(var n,r=t.variables,a=g(null),o=e.length-1;0<=o;--o){for(var i,s,c=e[o],u=0,l=["mockVisits","mockTurns","seed","seedIter"];u<l.length;u++){var p=l[u];hasOwnProperty.call(c,p)&&!hasOwnProperty.call(t,p)&&(t[p]=c[p])}for(i in c.forgetVisits&&(t.forgetVisits=Math.max(t.forgetVisits||0,c.forgetVisits)),void 0!==c.turns&&(t.turns=(t.turns||0)+c.turns),t.pastVisits||(t.pastVisits=[]),o!==e.length-1&&(void 0!==e[o+1].visits&&Array.isArray(t.pastVisits[0])?t.pastVisits[0]:t.pastVisits).unshift(c.passage),void 0!==c.pastVisits&&t.pastVisits.unshift(c.pastVisits),void 0!==c.visits&&t.pastVisits.unshift(c.visits),c.variables)if("TwineScript_TypeDefs"===i)for(var f in r[i]||(r[i]=g(null)),c.variables[i])r[i][f]||(r[i][f]=c.variables[i][f]);else i.startsWith("TwineScript_")||i in r||(null===c.variables[i]&&(a[i]=!0),a[i]||(r[i]=c.variables[i],!(s=c.valueRefs[i])||"via"in s||t.valueRefs[i]||(t.valueRefs[i]=s)))}for(n in t.valueRefs){var d=t.valueRefs[n];d&&"via"in d&&delete t.valueRefs[n]}}var a,c={passage:"",variables:g(null),visits:void 0,turns:void 0,seed:void 0,seedIter:void 0,mockVisits:void 0,mockTurns:void 0,forgetVisits:void 0,create:function(e){var t=g(c);return t.passage=e||"",t.variables=g(null),t.valueRefs=g(null),t}},u={forward:[],back:[],load:[],beforeForward:[],beforeBack:[],beforeLoad:[],forgetUndos:[]},l=[],p=-1,b=c.create(),w="";function T(){i.history=i.pastVisits.slice(i.forgetVisits).reduce(function(e,t){return e.concat(t)},[]),i.mockVisits&&(i.history=i.mockVisits.concat(i.history))}function k(){var e=c.create();e.pastVisits=[],o(e.variables,{TwineScript_ObjectName:"this story's variables",TwineScript_TypeDefs:g(null),TwineScript_VariableStore:"global",TwineScript_Delete:function(e){delete this[e],b.variables[e]=null,delete b.valueRefs[e]},TwineScript_Set:function(e,t,n){if(this[e]=t,b.variables[e]=t,n)b.valueRefs[e]=n;else if(j(t)||t instanceof Map||t instanceof Set||"string"==typeof t)for(var r=p;0<=r;--r){var a=l[r].variables[e];if(void 0!==a){a=function e(t,n,r){var a="it"===r?"its":r+"'s",o="";if(j(n)&&j(t)&&n.length){for(var i=n.length===t.length,o="(a:",s=0;s<n.length;s+=1){var c,u,l,p=n[s];A(p,t[s])?(c=E(p),u="".concat(a," ").concat(s+1,"th"),o+=(c.length<u.length?c:u)+","):(i=!1,-1<(c=t.indexOf(p))?(u=E(p),l="".concat(a," ").concat(c+1,"th"),o+=(u.length<l.length?u:l)+","):o+=e(t[s],p,"".concat(a," ").concat(s+1,"th"))+",")}o=i?r:o.slice(0,-1)+")"}else if(n instanceof Map&&t instanceof Map&&n.size){var f,d=n.size===t.size,h=(o="(dm:",_createForOfIteratorHelper(n.entries()));try{for(h.s();!(f=h.n()).done;){var m,y,g=_slicedToArray(f.value,2),v=g[0],b=g[1];o+="".concat(E(v),","),A(b,t.get(v))?(m=E(b),y="".concat(a," (").concat(E(v),")"),o+=(m.length<y.length?m:y)+","):(d=!1,o+=e(t.get(v),b,"".concat(a," (").concat(E(v),")"))+",")}}catch(e){h.e(e)}finally{h.f()}o=d?r:o.slice(0,-1)+")"}else if(n instanceof Set&&t instanceof Set&&n.size){var w,T=new Set,k=new Set,S=_createForOfIteratorHelper(t);try{for(S.s();!(w=S.n()).done;){var x=w.value;n.has(x)||T.add(x)}}catch(e){S.e(e)}finally{S.f()}var O,_=_createForOfIteratorHelper(n);try{for(_.s();!(O=_.n()).done;){var C=O.value;t.has(C)||k.add(C)}}catch(e){_.e(e)}finally{_.f()}T.size||k.size||(o=r),o=T.size+k.size>n.size?E(n):r+(k.size?"+"+E(k):"")+(T.size?"-"+E(T):"")}else"string"==typeof n&&"string"==typeof t&&n&&(n.startsWith(t)?o=r+"+"+E(n.slice(t.length)):n.endsWith(t)&&(o=E(n.slice(0,n.length-t.length))+"+"+r));return o?"it"===r?{via:o}:o:"it"===r?void 0:E(n)}(a,t,"it");a&&("it"===a.via?delete b.variables[e]:b.valueRefs[e]=a);break}}},TwineScript_GetProperty:function(e){return this[e]},TwineScript_DefineType:function(e,t){this.TwineScript_TypeDefs[e]=t,hasOwnProperty.call(b.variables,"TwineScript_TypeDefs")||(b.variables.TwineScript_TypeDefs=g(null)),b.variables.TwineScript_TypeDefs[e]=t}}),r(l.slice(0,p+1),e),i=e,T(),m=v(e.seed,e.seedIter)}function S(e){b=c.create(e);e=a.serialise(!0),w=e.past,e=e.pastAndPresent;if(a.hasSessionStorage&&"string"==typeof e)try{sessionStorage.setItem("Saved Session",e)}catch(e){return}}function x(e,t,n,r){for(var a in r)if(hasOwnProperty.call(r,a)&&!a.startsWith("TwineScript_"))if("object"===_typeof(r[a]))if(hasOwnProperty.call(r[a],"at")){n.valueRefs[a]=r[a];var o=r[a],i=o.at,s=o.from,c=o.to,u=o.seed,l=o.seedIter,o=o.blockedValues,i=d.get(i).get("source"),i=y(i.slice(s,c),"","macro");void 0!==u&&void 0!==l&&(m=v(u,l)),void 0!==o&&(e.stackTop.blockedValues=o,i.forEach(function e(t){var n;"string"!==t.type&&"hook"!==t.type&&t.children.every(e),"macro"!==t.type||"prompt"!==(n=f.insensitiveName(t.name))&&"confirm"!==n||(t.blockedValue=!0)})),r[a]=e.eval(i)}else if(hasOwnProperty.call(r[a],"via")){for(var p=t.length-1;0<=p;--p)if(hasOwnProperty.call(t[p].variables,a)){e.Identifiers.it=t[p].variables[a];break}r[a]=e.eval(y(r[a].via,"","macro")),e.Identifiers.it=0}else hasOwnProperty.call(r[a],"changer")&&(r[a].changer=e.eval(y(r[a].changer,"","macro")),r[a].hook=e.eval(y(r[a].hook,"","macro")),x(e,t,n,r[a].variables),r[a]=h.create(r[a]));else r[a]=e.eval(y(r[a],"","macro"));else"TwineScript_MockVisits"===a&&(n.mockVisits=r[a])}return k(),b.seed=i.seed,b.seedIter=0,(a={get passage(){return b.passage},get variables(){return i.variables},get pastLength(){return p},get turns(){return p+1+(i.turns||0)+(i.mockTurns||0)},get futureLength(){return l.length-1-p},get mockVisits(){return i.mockVisits||[]},set mockVisits(e){i.mockVisits=e,b.mockVisits=e,T()},get mockTurns(){return i.mockTurns||0},set mockTurns(e){i.mockTurns=e,b.mockTurns=e},history:function(){return i.history},forgetUndos:function(e){e<0&&(e=l.length+e);var t,e=l.splice(0,Math.min(l.length-1,e));e.length&&(p=l.length-1,t=l[0],r(e,t),t.pastVisits.push(e[e.length-1].passage),t.turns=(t.turns||0)+e.length,i.turns=(i.turns||0)+e.length,t.forgetVisits&&(t.pastVisits=t.pastVisits.slice(t.forgetVisits-t.turns),t.forgetVisits-=t.turns),w="",0===p&&n("tw-link[undo], tw-icon[alt='Undo']",f.storyElement).each(function(e,t){(n(t).closest("tw-expression, tw-hook").data("forgetUndosEvent")||Object)(t)}),u.forgetUndos.forEach(function(e){return e()}))},forgetVisits:function(e){(e=e<0?l.length+e:e)>p+i.turns&&(e=p+i.turns),b.forgetVisits=i.forgetVisits=Math.max(i.forgetVisits||0,e),T()},passageNameVisited:function(e){var t=0;if(!d.get(e))return 0;for(var n=0;n<i.history.length;n++)t+=+(e===i.history[n]);return t},get timeline(){return l},play:function(t){b||f.impossible("State.play","present is undefined!"),u.beforeForward.forEach(function(e){return e()}),b.passage&&((b.visits&&b.visits.length&&Array.isArray(i.pastVisits[i.pastVisits.length-1])?i.pastVisits[i.pastVisits.length-1]:i.pastVisits).push(b.passage),i.history.push(b.passage)),b.passage=t,l=l.slice(0,p+1).concat(b),p+=1,S(t),u.forward.forEach(function(e){return e(t)})},redirect:function(e){b||f.impossible("State.redirect","present is undefined!"),b.passage&&(b.visits&&b.visits.length&&Array.isArray(i.pastVisits[i.pastVisits.length-1])?i.pastVisits[i.pastVisits.length-1].push(b.passage):i.pastVisits.push([b.passage]),i.history.push(b.passage)),b.visits=(b.visits||[]).concat(e),b.passage=e},rewind:function(e){for(var t=void 0!==e?e:1,n=!1;0<t&&0<p;t--)n=!0,--p;return n&&(u.beforeBack.forEach(function(e){return e()}),w="",S(l[p].passage),k(),u.back.forEach(function(e){return e()})),n},fastForward:function(e){var t=1,n=!1;for("number"==typeof e&&(t=e);0<t&&0<l.length;t--)n=!0,p+=1;return n&&(u.beforeForward.forEach(function(e){return e()}),S(l[p].passage),k(),u.forward.forEach(function(e){return e(l[p].passage,"fastForward")})),n},on:function(e,t){if(e in u)return"function"!=typeof t||u[e].includes(t)||u[e].push(t),a;f.impossible("State.on","invalid event name")},reset:function(){u.beforeLoad.forEach(function(e){return e()}),l=[],p=-1,k(),(b=c.create()).seed=i.seed,b.seedIter=0,w="",m=v(),u.load.forEach(function(e){return e(l)})},hasStorage:t[0],hasSessionStorage:t[1],setSeed:function(e){m=v(e),b.seed=i.seed,b.seedIter=0},get seed(){return i.seed},get seedIter(){return i.seedIter},random:function(){var e=m();return b.seedIter=i.seedIter,e},shuffled:function(){for(var a=this,e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.reduce(function(e,t,n){var r=a.random()*(n+1)|0;return r===n?e.push(t):(e.push(e[r]),e[r]=t),e},[]);return b.seedIter=i.seedIter,r}}).serialise=function(e){function o(e,t){if("TwineScript_TypeDefs"!==t)return null===e[t]?null:e[t]&&hasOwnProperty.call(e[t],"TwineScript_CustomCommand")?(r=e[t].TwineScript_CustomCommand(),{changer:E(r.changer),toSource:r.toSource,hook:E(r.hook),variables:Object.keys(r.variables).reduce(function(e,t){return e[t]=o(r.variables,t),e},{})}):E(e[t]);var n,r,a={};for(n in e[t])a[n]=E(e[t][n]);return a}function t(e,t){if(c.isPrototypeOf(t)&&void 0===t.visits&&void 0===t.turns&&void 0===t.mockVisits&&void 0===t.forgetVisits&&void 0===t.pastVisits&&void 0===t.mockTurns&&void 0===t.seed&&void 0===t.seedIter&&Object.keys(t.variables).every(function(e){return e.startsWith("TwineScript_")}))return t.passage;if(!c.isPrototypeOf(this)||"valueRefs"!==e){if(c.isPrototypeOf(this)&&"variables"===e){var n,r={};for(n in this.variables)this.valueRefs[n]?r[n]=this.valueRefs[n]:r[n]=o(this.variables,n);return r}return t}}var e=l.slice(w?e?p-1:p:0,p+1),n=e.slice(0,-1),r=w;try{return{past:r=n.length?(r?r.slice(0,-1)+",":"[")+JSON.stringify(n,t).slice(1):r,pastAndPresent:r.slice(0,-1)+(r?",":"[")+JSON.stringify(e.slice(-1),t).slice(1)}}catch(e){return{past:!1,pastAndPresent:!1}}},a.deserialise=function(e,t){var n;try{n=JSON.parse(t)}catch(e){return Error("The save data is unintelligible.")}if(!j(n))return Error("The save data isn't a sequence of past turns.");for(var r=0;r<n.length;r+=1){var a=n[r];if("string"==typeof a)a={passage:a,variables:{}};else if("object"!==_typeof(a)||!hasOwnProperty.call(a,"variables")){n.splice(r--,1);continue}if(a.valueRefs=g(null),a.variables=o(g(null),a.variables),!d.hasValid(a.passage))return Error("The data refers to a passage named '".concat(a.passage,"', but it isn't in this story."));if(hasOwnProperty.call(a.variables,"TwineScript_TypeDefs"))try{x(e,n.slice(0,r),a,a.variables.TwineScript_TypeDefs)}catch(e){return Error("The variable types on turn ".concat(r+1," couldn't be reconstructed."))}try{x(e,n.slice(0,r),a,a.variables)}catch(e){return Error("The variables on turn ".concat(r+1," couldn't be reconstructed."))}n[r]=o(g(c),a)}return p=(l=n).length-1,u.load.forEach(function(e){return e(l)}),w="",k(),S(l[p].passage),!0},Object.seal(c),Object.freeze(a)}),define("datatypes/changercommand",["utils","utils/operationutils","internaltypes/changedescriptor","internaltypes/twineerror"],function(e,t,n,r){var i=e.plural,a=e.impossible,o=t.is,s=t.toSource,c={},u={TwineScript_TypeID:"changer",TwineScript_TypeName:"a changer",TwineScript_Print:function(){return"`[A ("+this.macroName+":) changer]`"},TwineScript_ToSource:function(){return"("+this.macroName+":"+("else"===this.name?"":this.params.map(s))+")"+(this.next?"+"+this.next.TwineScript_ToSource():"")},get TwineScript_ObjectName(){1===this.params.length&&36<(e=s(this.params[0])).length&&(e=void 0);for(var e,t="a (".concat(this.macroName,":").concat(e||"",") changer"),n=this.next,r=(n&&(t+=" combined with "),0);n&&t.length<48;){var a="(".concat(n.macroName,":)");t+=(0<r&&!n.next?" and ":"")+a+(n.next?", ":""),n=n.next,r+=1}for(var o=0;n&&o<99;)n=n.next,o+=1;return 0<o&&(t+="".concat(0<r?" and ":"").concat(i(o,"other changer"))),t},summary:function(){var e=n.create();return this.run(e),e.summary()},create:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=!(3<arguments.length&&void 0!==arguments[3])||arguments[3];return Array.isArray(t)||a("ChangerCommand.create","params was not an array but "+t),Object.assign(Object.create(this),{macroName:e,params:t,next:n,canEnchant:r})},"TwineScript_+":function(e){for(var t=this.TwineScript_Clone(),n=t;n.next;)n=n.next;return n.next=e,t.canEnchant=this.canEnchant&&e.canEnchant,t},TwineScript_is:function(e){if(u.isPrototypeOf(e))return this.macroName===e.macroName&&o(this.params,e.params)&&o(this.next,e.next)},TwineScript_Clone:function(){for(var e=u.create(this.macroName,this.params,this.next),t=e;t.next;)t=t.next=t.next.TwineScript_Clone();return e.canEnchant=this.canEnchant,e},run:function(e,t){var n="output"===this.macroName?[t||this]:this.params,n=c[this.macroName].apply(c,[e].concat(_toConsumableArray(n)));if(r.containsError(n))return n;this.next&&this.next.run(e,t||this)},register:function(e,t){c[e]=t}};return Object.freeze(u)}),define("internaltypes/varref",["state","internaltypes/twineerror","utils","utils/operationutils","datatypes/hookset"],function(u,l,e,t,i){var c,n=e.impossible,s=e.andList,r=e.nth,o=t.is,p=t.isObject,f=t.toSource,d=t.isSequential,h=t.objectName,m=t.typeName,y=t.clone,g=t.isValidDatamapName,v=t.subset,b=t.collectionType,w=t.unstorableValue,a=t.matches,T=Array.isArray,k={set:[],delete:[]},S="You can only access position strings/numbers ('4th', 'last', '2ndlast', (2), etc.), slices ('1stTo2ndlast', '3rdTo5th'), ",x="You can't access the '0th' or '0thlast' position of ";function O(e,t){if(l.containsError(t))return n;if(e instanceof Map&&(n=l.containsError(g(e,t))))return n;if(d(e))if("number"==typeof t){if(0===t)return l.create("property","You can't access elements at position 0 of ".concat(h(e),"."),"Only positive and negative position values exist.");0<t&&--t}else if("string"==typeof t&&(r=/^(\d+)(?:st|[nr]d|th)last$/i.exec(t))){if("0"===r[1])return l.create("property",x+h(e)+".");t=-r[1]}else if("string"==typeof t&&(r=/^(\d+)(?:st|[nr]d|th)$/i.exec(t))){if("0"===r[1])return l.create("property",x+h(e)+".");t=r[1]-1}else if("string"==typeof t&&(r=/^(?:(\d+)(?:st|[nr]d|th)(last)?|last)to(?:(\d+)(?:st|[nr]d|th)(last)?|last)$/i.exec(t))){var n=_slicedToArray(r,5),r=n[1],r=void 0===r?0:r,a=n[2],o=n[3],o=void 0===o?0:o;t={last:o=n[4]?-o:o-1,first:r=a?-r:r-1}}else if("last"===t)t=-1;else if("random"===t){if(!e.length)return l.create("property","I can't get a random value from ".concat(h(e),", because it's empty."));t=u.random()*Array.from(e).length|0}else{if(i.isPrototypeOf(e)&&!i.TwineScript_Properties.includes(t))return l.create("property","".concat(S+s(i.TwineScript_Properties.map(function(e){return"'"+e+"'"}))," of ").concat(h(e),", not ").concat(("string"==typeof t?f:h)(t),"."));if(!["length","some","any","all","start","end","random"].includes(t)&&!i.isPrototypeOf(e))return l.create("property","".concat(S,"'length', 'some', 'any', 'all', 'start', 'end', and 'random' of ").concat(h(e),", not ").concat(("string"==typeof t?f:h)(t),"."))}else if(e instanceof Set){if(!["length","some","any","all"].includes(t))return l.create("property","".concat(S,"'length', 'some', 'any', and 'all' of ").concat(h(e),"."),"You can't access specific individual data values from datasets.");"length"===t&&(t="size")}else{if(T(e.TwineScript_Properties)&&!e.TwineScript_Properties.includes(t))return l.create("property","You can only get the ".concat(s(e.TwineScript_Properties.map(function(e){return"'"+e+"'"}))," of ").concat(h(e),", not ").concat(("string"==typeof t?f:h)(t),"."));if("number"==typeof e||"boolean"==typeof e)return l.create("property","You can't get any data values, let alone ".concat(h(t),", from ").concat(h(e)))}return t}function _(e,t){return+t<0&&Math.abs(t)<=e.length?e.length+ +t:t}var C=/[^\x0000-\xFFFF]/,E=new Map;function A(e,t){if(void 0===e)return e;if(e instanceof Map)return e.get(t);if(("some"===t||"any"===t||"all"===t||"start"===t||"end"===t)&&!e.TwineScript_VariableStoreName)return n=e,r=t,a='"'.concat(r," value").concat("any"===r?"":"s",'" of '),{determiner:r,determined:n,array:_toConsumableArray(n),string:"string"==typeof n&&n,TwineScript_ObjectName:a+h(n),TwineScript_ToSource:function(){return"".concat(r," of ").concat(f(n))},TwineScript_TypeName:a+"a data structure",TwineScript_Unstorable:!0,TwineScript_Print:function(){return"`["+this.TwineScript_TypeName+"]`"}};var n,r,a;if("string"==typeof e&&(E.has(e)?e=E.get(e):C.test(e)?(a=_toConsumableArray(e),E.set(e,a),e=a):E.set(e,e)),d(e)&&Number.isFinite(t)&&(t=_(e,t)),e.TwineScript_GetProperty)return e.TwineScript_GetProperty(t);e=e[t];return"function"!=typeof e?e:void 0}function j(e){var t;return e.computed?(t=e.value,"string"==typeof(t=c.isPrototypeOf(t)?t.get():t)?"('"+t+"')":"("+t+")"):"number"==typeof e?r(e):"'"+e+"'"}function N(t,e,n){if(t.TwineScript_VariableStore){if(t.TwineScript_TypeDefs&&e in t.TwineScript_TypeDefs){var r=t.TwineScript_TypeDefs[e];if("const"===r.name){if(void 0!==t[e])return l.create("operation","I can't alter ".concat(t===u.variables?"$":"_").concat(e," because it's been restricted to a constant value."),"This variable can't be changed for the rest of the story.")}else if(!a(r,n))return l.create("operation","I can't set ".concat(t===u.variables?"$":"_").concat(e," to ").concat(m(n)," because it's been restricted to ").concat(f(r),"-type data."),"You can restrict a variable or data name by giving a typed variable to (set:) or (put:).")}return!0}return T(e)?e.map(function(e){return N(t,e)}):t instanceof Map?"string"==typeof e||l.create("operation","".concat(h(t)," can only have string data names, not ").concat(h(e),".")):d(t)?["length","random","some","any","all","start","end"].includes(e)?l.create("operation","I can't forcibly alter the '"+e+"' of "+h(t)+".","start"===e||"end"===e?"Alter the values at actual positions, like 1st or 2ndlast, rather than just the '"+e+"'.":void 0):+e==(0|e)||l.create("property",h(t)+" can only have position keys ('3rd', '1st', (5), etc.), not "+j(e)+"."):t.TwineScript_Identifiers&&e in t?l.create("keyword","I can't alter the value of the '"+e+"' identifier.","You can only alter data in variables, not fixed identifiers."):l.create("operation","I can't modify "+h(t),t instanceof Set?"You should use an (array:) if you need to modify the data inside this dataset.":i.isPrototypeOf(t)?"You should alter hooks indirectly using macros like (replace:) or (enchant:).":void 0)}function P(t,e,n,r){var a=e;t instanceof Map?t.set(e,n):(d(t)&&(e=_(t,e)),t.TwineScript_Set?t.TwineScript_Set(e,n,r):t[e]=n),k.set.forEach(function(e){return e(t,a,n)})}function I(t,e){var n=e;d(t)&&(e=_(t,e)),T(t)&&/^(?:[1-9]\d*|0)$/.exec(e)?t.splice(e,1):t instanceof Map||t instanceof Set?t.delete(e):t.TwineScript_Delete?t.TwineScript_Delete(e):delete t[e],k.delete.forEach(function(e){return e(t,n)})}function R(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:e,r=3<arguments.length&&void 0!==arguments[3]&&arguments[3];if(e&&"object"===_typeof(e)&&"last"in e&&"first"in e){if(i.isPrototypeOf(t))return t.TwineScript_GetProperty(e);var a=e.first,o=e.last;return v(t,a+(0<=a),o+(0<=o))}if(T(e))return i.isPrototypeOf(t)?t.TwineScript_GetProperty(e):e.map(function(e){return R(t,e,e)})["string"==typeof t?"join":"valueOf"]("");a=A(t,e);if(void 0!==a||r)return a;if(t===u.variables)return 0;if(t.TwineScript_VariableStore)return l.create("property","There isn't a temp variable named _".concat(n," in this place."),"Temp variables only exist inside the same passage, hook, or lambda in which they're created.");if(T(t)&&"number"==typeof e)return l.create("property","This array of ".concat(t.length," elements doesn't have a ").concat(j(n+("number"==typeof n?1:""))," element."),t.length?"It contains: ".concat(s(t.map(h)),"."):"The array is empty.");o=Array.from("function"==typeof t.keys&&t.keys());return l.create("property","I can't find a ".concat(j(n)," data name in ").concat(h(t)),t instanceof Map&&o.length?"Its names include: ".concat(s(o),"."):void 0)}function M(e,t){var r=this,e=this.compiledPropertyChain.reduce(function(e,t){var n=0===e.length?r.object:R.apply(void 0,_toConsumableArray(e[e.length-1]));return e.push([n,t])&&e},[]).reduceRight(e,t);return l.containsError(e)?e:void 0}return c=Object.freeze({get:function(){for(var e=this.object,t=0;t<this.compiledPropertyChain.length-1;t+=1)if(e=R(e,this.compiledPropertyChain[t]),l.containsError(e))return e;return R(e,this.compiledPropertyChain.slice(-1)[0],this.propertyChain.slice(-1)[0])},has:function(){for(var e=this.object,t=0;t<this.compiledPropertyChain.length-1;t+=1)if(void 0===(e=R(e,this.compiledPropertyChain[t],void 0,!0))||l.containsError(e))return!1;return void 0!==R(e,this.compiledPropertyChain.slice(-1)[0],void 0,!0)},set:function(e,s){var c=this;return!this.object||this.object.TwineScript_VariableStore||this.object.TwineScript_Identifiers?M.call(this,function(n,e,t){var e=_slicedToArray(e,2),r=e[0],a=e[1];if(e=l.containsError(n,r,a)||l.containsError(N(r,a,n)))return e;if(e=w(n))return l.create("operation","".concat(h(n)," can't be stored").concat(!n.TwineScript_Unstorable&&b(n)?" because it holds ".concat(h(e)):"","."));if(0<t)r=y(r);else if(r.TwineScript_VariableStore&&r!==u.variables){for(var o=r;o.TwineScript_VariableStore&&!hasOwnProperty.call(o,a);)o=Object.getPrototypeOf(o);o.TwineScript_VariableStore&&(r=o)}if("string"==typeof r){if("string"!=typeof n)return l.create("datatype","I can't put this non-string value, ".concat(h(n),", in a string."));if(n.length!==(T(a)?a.length:1))return l.create("datatype","".concat(h(n),"is not the right length to fit into this string location."));var r=_toConsumableArray(r),i=_toConsumableArray(n);[].concat(a).forEach(function(e){0+e<0&&(e=r.length+(0+e)),r=[].concat(_toConsumableArray(r.slice(0,e)),[i.shift()],_toConsumableArray(r.slice(e+1)))}),r=r.join("")}else p(r)&&(void 0!==n.TwineScript_KnownName&&((n=""!==n.TwineScript_KnownName?y(n):n).TwineScript_KnownName=f(c)),T(a)&&d(n)?("string"==typeof n&&(n=_toConsumableArray(n)),a.map(function(e,t){return[e,n[t]]}).forEach(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];return P(r,t,e,s)})):P(r,a,n,s));return r},e):l.create("macrocall","I can't (set:) ".concat(h(this),", if the ").concat((h(this.object).match(/ (.+$)/)||["","value"])[1]," isn't stored in a variable."),"Modifying data structures that aren't in variables won't change the game state at all.")},delete:function(){return M.call(this,function(e,t,n){var r,t=_slicedToArray(t,2),a=t[0],t=t[1];return(r=l.containsError(e,a,t)||l.containsError(N(a,t)))?r:(0<n&&(a=y(a)),null===e?((r="string"==typeof a)&&(a=_toConsumableArray(a)),T(t)?(d(a)&&(t=_toConsumableArray(new Set(t))).sort(function(e,t){return _(a,t)-_(a,e)}),t.forEach(function(e){return I(a,e)})):I(a,t),r&&(a=a.join(""))):P(a,t,e,!1),a)},null)},defineType:function(e){var t=this.object,n=this.compiledPropertyChain[0],r=(hasOwnProperty.call(t,"TwineScript_TypeDefs")||(t.TwineScript_TypeDefs=Object.create(t.TwineScript_TypeDefs||null)),t.TwineScript_TypeDefs),a=r[n];if(a&&!o(a,e))return l.create("operation","I can't redefine the type of "+h(this)+" to "+(e.TwineScript_ObjectName||m(e))+", as it is already "+(a.TwineScript_ObjectName||m(a))+".");t.TwineScript_DefineType?t.TwineScript_DefineType(n,e):r[n]=e,"const"===e.name&&(t[n]=void 0)},matches:function(e,t){return this.object===e&&this.compiledPropertyChain[0]===t},getName:function(){return this.compiledPropertyChain[0]},create:function(e,t){var n;if(n=l.containsError(e))return n;Array.isArray(t)||(t=[].concat(t)),c.isPrototypeOf(e)&&(t=e.propertyChain.concat(t),e=e.object);var r=function(e,t){for(var n,r=[],a=0;a<t.length;a+=1){var o=t[a];if(o.computed&&(o=o.value),c.isPrototypeOf(o)&&(o=o.get()),T(o)){for(var i=[],s=0;s<o.length;s+=1)i[s]=O(e,o[s]);o=i}else o=O(e,o);if(n=l.containsError(o))return n;a<t.length-1&&(e=R(e,o)),r.push(o)}return r}(e,t);return(n=l.containsError(r))?n:Object.assign(Object.create(c),{object:e,propertyChain:t,compiledPropertyChain:r})},TwineScript_ToSource:function(){function r(e,t){return!t&&n.object.TwineScript_VariableStore?e:j(e)}var n=this;return(this.object===u.variables?"$":this.object.TwineScript_VariableStore?"_":f(this.object)+"'s ")+(1===this.propertyChain.length?r(this.propertyChain[0]):this.propertyChain.reduce(function(e,t,n){return e+"'s "+r(t,n)}))},get TwineScript_ObjectName(){return this.object.TwineScript_VariableStore?"the ".concat(this.object.TwineScript_VariableStoreName?"temp ":"","variable ").concat(this.TwineScript_ToSource()):h(this.object)+"'s "+(1===this.propertyChain.length?j(this.propertyChain[0]):this.propertyChain.reduce(function(e,t,n){return e+"'s "+j(t)}))},on:function(e,t){if(e in k)return"function"!=typeof t||k[e].includes(t)||k[e].push(t),c;n("VarRef.on","invalid event name")}})}),define("internaltypes/varscope",[],function(){return Object.seal({TwineScript_ObjectName:"the temporary variables",TwineScript_VariableStore:!0,TwineScript_TypeDefs:Object.create(null)})}),define("internaltypes/twinenotifier",["jquery","utils"],function(e,t){var n=t.impossible,r={create:function(e){return e||n("TwineNotifier.create","called with only 1 string."),Object.assign(Object.create(r),{message:e})},render:function(){return e("<tw-notifier>").attr("message",this.message)}};return Object.preventExtensions(r)}),define("datatypes/custommacro",["jquery","utils","renderer","utils/operationutils","datatypes/customcommand","internaltypes/varref","internaltypes/varscope","internaltypes/twineerror","internaltypes/twinenotifier"],function(b,e,w,t,T,k,S,x,O){function n(v){return function(e){v.called+=1;for(var t=v.varNames,n=v.params,r=v.body,a=E(A(S),{TwineScript_VariableStoreName:v.TwineScript_ObjectName+" call #"+v.called,TwineScript_TypeDefs:A(null)}),o=[],i=0,s=arguments.length,c=new Array(1<s?s-1:0),u=1;u<s;u++)c[u-1]=arguments[u];for(var l=0;l<c.length;l+=1){var p=c[l],f=t[i],d=(a.TwineScript_TypeDefs[f]=n[i].datatype.rest?n[i].datatype.create("array"):n[i].datatype,k.create(a,f));if(x.containsError(d))return d;if(n[i].datatype.rest){var h=(a[f]||[]).concat([p]);if(l<c.length-1){a[f]=h;continue}d.set(h)}else d.set(p),i+=1;o.push(O.create(_(d)+" is now "+_(a[f])))}if(c.length&&(i+=1),n[i]&&n[i].datatype.rest){var m=k.create(a,t[i]);if(x.containsError(m))return m;m.set([]),a.TwineScript_TypeDefs[name]=n[i].datatype.create("array")}var y,m=b("<p>").append(w.exec(r.code)),g=e.stack.length,r=(e.stack.unshift({tempVariables:a,dom:m,output:function(e){y=e}}),e.evalReplay);for(e.evalReplay=null,e.execute();e.stack.length>g;)e.stack.shift();e.evalReplay=r;r=m.find("tw-error");return r.length?(m.prepend(o.map(function(e){return e.render()}),"<br>"),x.create("propagated","".concat(r.length," error").concat(1<r.length?"s":""," occurred when running ").concat(v.TwineScript_ObjectName,"."),void 0,m)):void 0===y?x.create("custommacro","".concat(v.TwineScript_ObjectName," didn't output any data or hooks using (output:) or (output-data:).")):"object"===_typeof(y)&&"changer"in y?T.create(E(y,{toSource:"(".concat(v.TwineScript_KnownName||"unnamed",":").concat(c.map(C),")")})):y}}var r=e.andList,_=t.objectName,a=t.typeName,o=t.matches,C=t.toSource,E=Object.assign,A=Object.create,i=Object.seal({TwineScript_TypeID:"macro",TwineScript_TypeName:"a custom macro",TwineScript_GetProperty:function(e){if("params"===e)return _toConsumableArray(this.params)},TwineScript_Properties:["params"],TwineScript_Print:function(){return"`["+this.TwineScript_ObjectName+"]`"},TwineScript_Clone:function(){var e=E(A(i),this);return e.fn=n(e),e},TwineScript_ToSource:function(){return"(macro:"+this.params.map(function(e){return e.TwineScript_ToSource()}).concat("")+this.body.TwineScript_ToSource()+")"},createFromFn:function(e,t,n,r){return E(A(i),{params:[],fn:e,typeSignature:r,TwineScript_ObjectName:t,TwineScript_ToSource:n,TwineScript_KnownName:""})},create:function(e,t){t=E(A(i),{params:e,called:0,varNames:e.map(function(e){return e.varRef.propertyChain[0]}),typeSignature:e.map(function(t){var e=t.datatype.toTypeSignatureObject?t.datatype.toTypeSignatureObject({rest:t.rest}):{pattern:"range",range:function(e){return o(t.datatype,e)},name:a(t.datatype)};return t.rest?{pattern:"zero or more",innerType:e}:e}),body:t,TwineScript_KnownName:"",TwineScript_ObjectName:"a custom macro (with ".concat(e.length?r(e.map(C)):"no params",")")});return t.fn=n(t),t}});return i}),define("datatypes/lambda",["utils","utils/operationutils","internaltypes/varscope","internaltypes/varref","internaltypes/twineerror"],function(e,t,m,s,y){e.nth;var g=t.objectName;var c=Object.freeze({TwineScript_TypeID:"lambda",TwineScript_TypeName:"a lambda",get TwineScript_ObjectName(){return'a "'+("making"in this?"making ... ":"")+("each"in this?"each ... ":"")+("where"in this?"where ... ":"")+("when"in this?"when ... ":"")+("via"in this?"via ... ":"")+'" lambda'},TwineScript_Print:function(){return"`[A lambda]`"},TwineScript_is:function(e){return e===this},TwineScript_ToSource:function(){return this.source},TypeSignature:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{pattern:"lambda",innerType:c,clauses:t,typeName:'a "'+t.concat("").join(" ...")+'" lambda'}},TwineScript_Clone:function(){return Object.assign(Object.create(c),this)},create:function(e,t,n,r){var a,o="temp variable, or typed temp variable";function i(e){e=e&&e.varRef?e.varRef:e;return void 0===e||e&&s.isPrototypeOf(e)&&m.isPrototypeOf(e.object)&&1===e.propertyChain.length}if(y.containsError(n))return n;if("making"===t&&!i(n))return y.create("syntax","I need a "+o+", to the right of '"+t+"', not "+g(n)+".");if(y.containsError(e))return e;if(c.isPrototypeOf(e)){if("when"===t||"when"in e)return y.create("syntax","A 'when' lambda cannot have any other clauses, such as '"+t+"'.");if(t in e)return y.create("syntax","This lambda has two '"+t+"' clauses.");a=e}else{if("when"===t&&void 0!==e)return y.create("syntax","A 'when' lambda shouldn't begin with a temp variable (just use 'when' followed by the condition).");if(!i(e))return y.create("syntax","This lambda needs to start with a single "+o+", not "+g(e)+".");(a=Object.create(this)).loop=e||""}return a.source=r.trim(),a[t]=n,a.making&&a.making.getName()===(a.loop&&a.loop.getName())?y.create("syntax","This lambda has two variables named '"+a.loop.getName()+"'.","Lambdas should have all-unique parameter names."):a},apply:function(e,t){var n=t.loop,r=t.pos,a=t.making,o=t.ignoreVia;function i(e,t){if(e){if("datatype"in e&&"varRef"in e){var n=e.varRef.create(s,e.varRef.propertyChain);if(y.containsError(n))return n;var r=n.defineType(e.datatype);return y.containsError(r)?r:(r=n.set(t),y.containsError(r)?r:void 0)}s[e.getName()]=t}}var s=(s=t.tempVariables)||Object.create(e.stack.length?e.stackTop.tempVariables:m),t=i(this.loop,n)||i(this.making,a);if(y.containsError(t))return t;e.stack.unshift(Object.assign(Object.create(e.stackTop||null),{tempVariables:s,lambdaPos:this.when?void 0:r})),!n||this.making||this.when?e.Identifiers.it=y.create("operation","I can't use 'it', or an implied 'it', in "+this.TwineScript_ObjectName):e.Identifiers.it=n;var c,u,l,p,f,d,t=!o&&this.via,o="where"in this||"when"in this,h=e.evalReplay;return e.evalReplay=h?[]:null,o?(c=e.eval(this.where||this.when),u=e.evalReplay,e.evalReplay=u&&t?[]:null,!n||this.making||this.when||(e.Identifiers.it=n),l=c,d=!t||e.eval(t),p=null,f=(f=y.containsError(l))?f:"boolean"!=typeof l?y.create("operation","This lambda's 'where' clause must evaluate to true or false, not "+g(l)+"."):l?d:p):c=f=!t||e.eval(t),l=t?e.evalReplay:null,e.stack.shift(),(e.evalReplay=h)&&(o||t)&&(((d=h[h.length-1])||{}).lambda&&d.lambda.obj===this||((d={lambda:{obj:this,loops:[]},code:(h[h.length-1]||{}).code||""}).fromCode=d.code,h.push(d)),d.lambda.loops.push(Object.assign({it:n,pos:r},void 0!==a&&{making:a},t&&{viaReplay:l,viaResult:f},o&&{whereReplay:u,whereResult:null!==c&&c}))),f},filter:function(r,e){var a,o=this,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,e=e.reduce(function(e,t,n){if(a=y.containsError(e))return a;n=o.apply(r,{loop:t,pos:n+1,ignoreVia:!0,tempVariables:i});return(a=y.containsError(n))?a:e.concat(n?[t]:[])},[]);return(a=y.containsError(e))?a:e}});return c}),define("datatypes/codehook",[],function(){var t=Object.freeze({TwineScript_TypeName:"a code hook",TwineScript_ObjectName:"a code hook",TwineScript_ToSource:function(){return this.source},TwineScript_Print:function(){return this.code},TwineScript_toString:function(){return this.source},TwineScript_is:function(e){return t.isPrototypeOf(e)&&this.source===e.source},TwineScript_Clone:function(){return t.create(this.code,this.source)},create:function(e,t){return Object.assign(Object.create(this),{code:e,source:t})}});return t}),define("macros",["utils/naturalsort","utils","utils/operationutils","datatypes/changercommand","datatypes/custommacro","datatypes/lambda","datatypes/codehook","internaltypes/changedescriptor","internaltypes/twineerror"],function(y,e,t,o,r,g,v,p,b){var w=e.insensitiveName,T=e.nth,k=e.andList,S=t.objectName,x=t.typeName,f=t.toSource,O=Array.isArray,i={};function _(e){return e===s.TypeSignature.Any||(O(e.innerType)?e.innerType.some(_):!!e.innerType&&_(e.innerType))}function a(e,t,n,r){var a,o,i,s,c,u,l,p,f=t.fn,d=t.typeSignature,h=t.returnType,m=(r=function(e){for(var t,n,r,a=[],o=0;o<e.length;o+=1)o in e&&((t=e[o])&&!0===t.spreader?(n=t.value,(r=b.containsError(n))?a.push(r):O(n)||"string"==typeof n?a.push.apply(a,_toConsumableArray(n)):n instanceof Set?a.push.apply(a,_toConsumableArray(Array.from(n).sort(y("en")))):a.push(b.create("operation","I can't spread out "+S(n)+", because it is not a string, dataset, or array."))):a.push(t));return a}(r),"string"!=typeof e&&(a=e,e=""),a?"":"("+(O(e)&&1<e.length?e[0]:e)+":)");for(e=a?a.TwineScript_KnownName?"the custom macro, ".concat(a.TwineScript_KnownName):"an unnamed custom macro":"the ".concat(m," macro"),o=0<d.length?1===d.length&&_(d[0])?1===r.length?"That value can't be given to macros as-is.":"Give only a single value to this macro.":e+" must only be given "+k(d.map(x))+(1<d.length?", in that order":"."):e+" must not be given any data."+(a?"":" Just write "+m),s=0,c=Math.max(r.length,d.length);s<c;s+=1){if(u=d[s],l=r[s],b.containsError(l))return l;if(s>=d.length&&!i)return b.create("datatype",r.length-d.length+" too many values were given to "+e+".",o);if(!(u=u||i).innerType||"rest"!==u.pattern&&"zero or more"!==u.pattern||(i=u.innerType,"rest"===u.pattern&&(u=u.innerType)),!function e(t,n){if(null===n)return void 0===t;var r=_typeof(t);if("function"!=typeof n&&n.pattern){if("optional"===n.pattern||"zero or more"===n.pattern)return void 0===t||e(t,n.innerType);if("either"===n.pattern){for(var a=0;a<n.innerType.length;a+=1)if(e(t,n.innerType[a]))return!0;return!1}if("lambda"===n.pattern&&e(t,n.innerType))return n.clauses.includes("where")===("where"in t||"each"in t)&&n.clauses.includes("making")==="making"in t&&n.clauses.includes("via")==="via"in t&&n.clauses.includes("with")==="with"in t;if("insensitive set"===n.pattern)return n.innerType.includes(w(t));if("range"===n.pattern)return n.range(t);if("wrapped"===n.pattern)return e(t,n.innerType)}return(void 0===n||void 0!==t)&&("anything"===n.TwineScript_TypeName&&void 0!==t&&!t.TwineScript_Unstorable||"everything"===n.TwineScript_TypeName&&void 0!==t||(n===String?"string"===r:n===Boolean?"boolean"===r:n===parseInt?"number"===r&&!Number.isNaN(t)&&!(t+"").includes("."):n===Number?"number"===r&&!Number.isNaN(t):n===Array?O(t):n===Map||n===Set?t instanceof n:Object.isPrototypeOf.call(n,t)))}(l,u))return void 0===l?(p=d.filter(function(e){return!("optional"===e.pattern||"zero or more"===e.pattern)}).length,b.create("datatype","".concat(e," was given ").concat(r.length?k(r.map(S)):"nothing",", but needs ").concat(p-s," more value").concat(1<p-s?"s":"","."),o)):l&&l.TwineScript_Unstorable&&_(u)?b.create("datatype",e+"'s "+T(s+1)+" value, "+S(l)+", is not valid data for this macro.",o):v.isPrototypeOf(l)&&"Changer"===h?b.create("syntax","Please put this hook outside the parentheses of "+e+", not inside it.","Hooks should appear after a macro"+(a?".":": "+m+"[Some text]")):l&&g.isPrototypeOf(l)&&"lambda"===u.pattern?b.create("datatype",e+"'s "+T(s+1)+" value (a lambda) should have "+k(["where","when","making","via","with"].filter(function(e){return u.clauses.includes(e)}).map(function(e){return"a '"+e+"' clause"}))+", not "+k(["where","when","making","via","with"].filter(function(e){return e in l}).map(function(e){return"a '"+e+"' clause"}))+"."):"insensitive set"===u.pattern?b.create("datatype",S(l)+" is not a valid name string for "+e+".","Only the following names are recognised (capitalisation and hyphens ignored): "+k(u.innerType)+"."):b.create("datatype","".concat(e,"'s ").concat(T(s+1)," value is ").concat(S(l),", but should be ").concat(x(u),"."),u.message||o)}return f.apply(null,[n].concat(r))}function d(e,t,n,r){var a={fn:n,typeSignature:r=[].concat(r||[]),returnType:t};Object.freeze(a),[].concat(e).forEach(function(e){return Object.defineProperty(i,w(e),{value:a})})}var s={has:function(e){return e=w(e),hasOwnProperty.call(i,e)},get:function(e){return e=w(e),hasOwnProperty.call(i,e)&&i[e]},add:function e(t,n,r,a){return d(t,n,r,a),e},addChanger:function e(t,n,r,a){return d(t,"Changer",n,a),o.register(O(t)?t[0]:t,r),e},addCommand:function e(t,n,r,a){var s,c,u,l,o=!(4<arguments.length&&void 0!==arguments[4])||arguments[4],i=[].concat(t)[0];return d(t,"Command",(s=i,c=n,u=r,l=o,function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var a=c.apply(void 0,n);if(a)return a;var o=p.create(),i=Object.assign({TwineScript_TypeID:"command",TwineScript_ObjectName:"a ("+s+":) command",TwineScript_TypeName:"a ("+s+":) command",TwineScript_Print:function(){return"`[A ("+s+":) command]`"},TwineScript_ToSource:function(){return"("+s+":"+n.map(f)+")"},TwineScript_is:function(e){return f(this)===f(e)}},l?{TwineScript_Attach:function(e,t){return o.section=e,t.run(o),i},TwineScript_Run:function(e){e=u.apply(void 0,[o,e].concat(n));return o=p.create(),e}}:{TwineScript_Run:function(e){return u.apply(void 0,[e].concat(n))}});return i}),a),e},TypeSignature:{optional:function(e){return{pattern:"optional",innerType:e}},zeroOrMore:function(e){return{pattern:"zero or more",innerType:e}},either:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{pattern:"either",innerType:t}},rest:function(e){return{pattern:"rest",innerType:e}},insensitiveSet:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{pattern:"insensitive set",innerType:t}},numberRange:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1/0;return{pattern:"range",min:t,max:n,range:function(e){return"number"==typeof e&&!Number.isNaN(e)&&t<=e&&e<=n}}},nonNegativeInteger:{pattern:"range",integer:!0,min:0,max:1/0,range:function(e){return"number"==typeof e&&!Number.isNaN(e)&&0<=e&&!(e+"").includes(".")}},positiveInteger:{pattern:"range",integer:!0,min:1,max:1/0,range:function(e){return"number"==typeof e&&!Number.isNaN(e)&&1<=e&&!(e+"").includes(".")}},wrapped:function(e,t){return{pattern:"wrapped",innerType:e,message:t}},Any:{TwineScript_TypeName:"anything"},Everything:{TwineScript_TypeName:"everything"}},run:function(e,t,n){return s.has(e)?a(e,s.get(e),t,n):b.create("macrocall","I can't run the macro '"+e+"' because it doesn't exist.","Did you mean to run a macro? If you have a word written like (this:), it is regarded as a macro name.")},runCustom:function(e,t,n){return r.isPrototypeOf(e)?a(e,e,t,n):b.containsError(e)?e:b.create("macrocall","I can't call ".concat(S(e)," because it isn't a custom macro."))}};return Object.assign(s.TypeSignature,{positiveNumber:s.TypeSignature.numberRange(Math.pow(2,-52),1/0),nonNegativeNumber:s.TypeSignature.numberRange(0,1/0),percent:s.TypeSignature.numberRange(0,1)}),Object.freeze(s)}),define("datatypes/typedvar",["utils/operationutils","internaltypes/varref","internaltypes/twineerror"],function(e,a,o){var i=e.typeName,t=e.matches,n=e.toSource,s=e.unstorableValue,e=Object.freeze,c=Object.assign,u=Object.create,l=e({TwineScript_TypeName:"a TypedVar (typed variable name)",get TwineScript_ObjectName(){var e=n(this.datatype);return"the ".concat(e.length<24?e+"-":"","typed variable name, ").concat(this.varRef.TwineScript_ToSource())},TwineScript_Print:function(){return"`[A typed variable name]`"},TwineScript_Unstorable:!0,TwineScript_Clone:function(){return c(u(l),{datatype:this.datatype.TwineScript_Clone(),varRef:this.varRef})},TwineScript_ToSource:function(){return n(this.datatype)+"-type "+this.varRef.TwineScript_ToSource()},TwineScript_GetProperty:function(e){return"name"===e?this.getName():this[e]},TwineScript_Properties:["datatype","name"],TwineScript_IsTypeOf:function(e){return t(this.datatype,e)},get:function(){var e;return(e=this.varRef).get.apply(e,arguments)},getName:function(){return this.varRef.getName()},defineType:function(){if("any"!==this.datatype.name)return this.varRef.defineType(this.datatype)},create:function(e,t){if(n=o.containsError(t)||o.containsError(e)||t.error)return n;if(!a.isPrototypeOf(t))return o.create("syntax","The -type syntax must have a variable to its right.");var n=t.object,r=t.compiledPropertyChain;if(!n||!n.TwineScript_VariableStore||1!==r.length||!n.TwineScript_TypeDefs)return o.create("unimplemented","I can only restrict the datatypes of variables, not data names or anything else.");r=s(e);return r&&!l.isPrototypeOf(r)?o.create("syntax","The -type syntax can't have "+i(r)+" to its left."):c(u(this),{datatype:e,varRef:t})}});return l}),define("datatypes/colour",["jquery"],function(n){var u=Math.max,l=Math.min,a=Math.sin,o=Math.cos,i=Math.pow,p=Math.round,c=Math.floor,s=Math.atan2,f=Math.cbrt,d=Math.sqrt,h=Math.PI,m=Object.assign,t=Object.create,r=/^([\da-fA-F])([\da-fA-F])([\da-fA-F])$/,y=/^([\da-fA-F])([\da-fA-F])([\da-fA-F])([\da-fA-F])([\da-fA-F])([\da-fA-F])$/,g=t(null);function v(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];if(0<r.length)return v.apply(void 0,[v(e,t)].concat(r));if(!t)return e;for(var o=[],i=0;i<e.length;i++){o[i]=[];for(var s=0;s<t[0].length;s++){for(var c=0,u=0;u<e[0].length;u++)c+=e[i][u]*t[u][s];o[i][s]=c}}return o}function b(e){var t,n=e.r,r=e.g,a=e.b,e=e.a,o=u(n/=255,r/=255,a/=255),i=l(n,r,a),s=(o+i)/2,c=o-i;if(o===i)return{h:0,s:0,l:s};switch(o){case n:t=(r-a)/c+(r<a?6:0);break;case r:t=(a-n)/c+2;break;case a:t=(n-r)/c+4}return{h:t=p(60*t),s:.5<s?c/(2-o-i):c/(o+i),l:s,a:e}}var w=[.9642956764295677,1,.8251046025104602],T=24389/27,k=216/24389,S=function(e){return e.map(function(e){return[e]})},x=function(e){return e.map(function(e){return e[0]})};function O(e){var t=e.l,n=e.c,r=e.h,e=e.a,n=[t*=100,n*o(r*h/180),n*a(r*h/180)],r=[];r[1]=(n[0]+16)/116,r[0]=n[1]/500+r[1],r[2]=r[1]-n[2]/200;n=[i(r[0],3)>k?i(r[0],3):(116*r[0]-16)/T,T*k<t?i((16+t)/116,3):t/T,i(r[2],3)>k?i(r[2],3):(116*r[2]-16)/T].map(function(e,t){return e*w[t]}),t=_slicedToArray(x(v([[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],v([[.9554734527042182,-.023098536874261423,.0632593086610217],[-.028369706963208136,1.0099954580058226,.021041398966943008],[.012314001688319899,-.020507696433477912,1.3303659366080753]],S(n)))).map(function(e){return l(255,u(0,255*(.0031308<(e=e)?1.055*i(e,1/2.4)-.055:12.92*e)))}),3);return{r:t[0],g:t[1],b:t[2],a:e}}function e(e){function t(e){return 1e-5<=n[e]&&n[e]<=255-1e-5}var n=O(e);if(Object.keys(n).every(t))return n;var r=(e=m({},e)).c,a=0;for(e.c/=2;1e-5<r-a;)n=O(e),Object.keys(n).every(t)?a=e.c:r=e.c,e.c=(r+a)/2;return O(e)}var _=Object.freeze({TwineScript_TypeID:"colour",TwineScript_TypeName:"a colour",TwineScript_ObjectName:"a colour",TwineScript_DebugName:function(){return"a colour "+this.TwineScript_Print()},"TwineScript_+":function(e){var t=this.toRGBA(),e=e.toRGBA();return _.create({r:l(p(.6*(t.r+e.r)),255),g:l(p(.6*(t.g+e.g)),255),b:l(p(.6*(t.b+e.b)),255),a:(t.a+e.a)/2})},TwineScript_Print:function(){var e=this.toRGBA();return"<tw-colour style='background-color:rgba("+[e.r,e.g,e.b,e.a]+");'></tw-colour>"},TwineScript_is:function(e){if(!_.isPrototypeOf(e))return!1;if(e.lcha&&this.lcha)return e.lcha.l===this.lcha.l&&e.lcha.c===this.lcha.c&&e.lcha.h===this.lcha.h&&e.a===this.a;var t=this.toRGBA();return(e=e.toRGBA()).r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a},TwineScript_Clone:function(){return _.create(this)},toRGBAString:function(){var e=this.toRGBA(),t=e.r,n=e.g,r=e.b,e=e.a;return"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(e,")")},toHSLA:function(){return b(this.toRGBA())},toRGBA:function(){return this.lch?e(m({a:this.a},this.lch)):this},toLCHA:function(){return this.lch?m({a:this.a},this.lch):(t=(e=this).r,n=e.g,r=e.b,e=e.a,n=[116*(t=x(v([[1.0479298208405488,.022946793341019088,-.05019222954313557],[.029627815688159344,.990434484573249,-.01707382502938514],[-.009243058152591178,.015055144896577895,.7518742899580008]],v([[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],S([t/255,n/255,r/255].map(function(e){return e<.04045?e/12.92:i((e+.055)/1.055,2.4)}))))).map(function(e,t){return e/w[t]}).map(function(e){return k<e?f(e):(T*e+16)/116}))[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])],r=180*s(n[2],n[1])/h,{l:n[0]/100,c:d(i(n[1],2)+i(n[2],2)),h:0<=r?r:360+r,a:e});var e,t,n,r},LCHRotate:function(e){e<0&&(e=360+e);var t=this.toLCHA();return t.h=(t.h+e)%360,_.create(t)},TwineScript_GetProperty:function(e){if("lch"===e)return t=this.toLCHA(),new Map([["l",t.l],["c",t.c],["h",t.h]]);var t=this.toRGBA();return"h"===e||"s"===e||"l"===e?b(t)[e]:"r"===e||"g"===e||"b"===e||"a"===e?t[e]:void 0},TwineScript_Properties:["h","s","l","r","g","b","a","lch"],TwineScript_ToSource:function(){if(0===this.a)return"transparent";var e=!this.lch&&b(this);if(1===e.l&&!e.h&&!e.s)return"white";if(0===e.l&&!e.h&&!e.s)return"black";if(.5<=e.l&&e.l<.5334&&0===e.s)return"gray";if(.5===e.l&&.8<=e.s&&e.s<.804){var t={0:"red",30:"orange",60:"yellow",90:"lime",120:"green",180:"cyan",210:"blue",240:"navy",270:"purple",300:"magenta"}[e.h];if(t)return t}return"(".concat(this.lch?"lch":"hsl",":").concat(this.lch?[this.lch.l,this.lch.c,this.lch.h]:[e.h,e.s,e.l]).concat(1!==this.a?","+this.a:"",")")},create:function(e){return"string"==typeof e?this.create((_.isHexString(e)?function(e){return"string"!=typeof e?e:(e=(e=e.replace("#","")).replace(r,"$1$1$2$2$3$3"),{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16)})}:function(e){if(e in g)return g[e];var t="transparent"===(t=n("<p>").css("background-color",e).css("background-color"))?{r:0,g:0,b:0,a:0}:t.startsWith("rgb")?t.match(/\d+/g).reduce(function(e,t,n){return e["rgb"[n]]=+t,e},{}):{r:192,g:192,b:192};return g[e]=t})(e)):!("h"in e&&"s"in e&&"l"in e)||"r"in e||"g"in e||"b"in e?("a"in e&&"number"==typeof e.a||(e.a=1),"h"in e&&"c"in e&&!("s"in e)&&"l"in e?m(t(this),{a:e.a,lch:{l:e.l,c:e.c,h:e.h}}):m(t(this),e)):this.create(function(e){var t,n=e.h,r=e.s,a=e.l,e=e.a;if(0===r)return{r:t=c(255*a),g:t,b:t};var o=a<.5?a*(1+r):a+r-a*r,i=2*a-o;function s(e){return e<0&&(e+=1),1<e&&--e,e<1/6?i+6*(o-i)*e:e<.5?o:e<2/3?i+(o-i)*(2/3-e)*6:i}return{r:c(255*s((n/=360)+1/3)),g:c(255*s(n)),b:c(255*s(n-1/3)),a:e}}(e))},isHexString:function(e){return"string"==typeof e&&"#"===e[0]&&(e.slice(1).match(r)||e.slice(1).match(y))},isCSS3Function:function(e){return"string"==typeof e&&/^(?:rgb|hsl)a?\(\s*\d+(?:\.\d+)?\s*,\s*\d+(?:\.\d+)?%?\s*,\s*\d+(?:\.\d+)?%?(?:,\s*\d+(?:\.\d+)?\s*)?\)$/.test(e)}});return _}),define("datatypes/gradient",["utils/operationutils"],function(e){var t=e.toSource,n=Object.freeze({TwineScript_TypeID:"gradient",TwineScript_TypeName:"a gradient",TwineScript_ObjectName:"a gradient",TwineScript_DebugName:function(){return"a gradient "+this.TwineScript_Print()},TwineScript_GetProperty:function(e){var t=this;return"angle"===e?this.angle:"stops"===e?this.stops.map(function(e){return new Map([[t.repeating?"pixels":"percent",e.stop],["colour",e.colour.TwineScript_Clone()]])}):void 0},TwineScript_Properties:["angle","stops"],TwineScript_ToSource:function(){return"(gradient:"+this.angle+","+this.stops.map(function(e){return t(e.stop)+","+t(e.colour)})+")"},TwineScript_is:function(e){var r=this;return e.angle===this.angle&&e.stops.length===this.stops.length&&e.stops.every(function(e,t){var n=e.colour,e=e.stop;return r.stops[t].stop===e&&r.stops[t].colour.TwineScript_is(n)})},TwineScript_Clone:function(){return n.create(this.angle,_toConsumableArray(this.stops))},TwineScript_Print:function(){return"<tw-colour style='background:"+this.toLinearGradientString()+"'></tw-colour>"},create:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];return Object.assign(Object.create(this),{angle:e,stops:t.sort(function(e,t){return e.stop-t.stop}),repeating:n})},multiply:function(t){return n.create(this.angle,this.stops.map(function(e){return{colour:e.colour,stop:e.stop*t}}))},toLinearGradientString:function(){var r=this;return(this.repeating?"repeating-":"")+"linear-gradient(".concat(this.angle,"deg, ").concat(this.stops.reduce(function(e,t){var n=t.colour,t=t.stop;return e+n.toRGBAString()+" "+t*(r.repeating?1:100)+(r.repeating?"px,":"%,")},"").slice(0,-1),")")}});return n}),define("datatypes/datatype",["utils","utils/operationutils","datatypes/changercommand","datatypes/colour","datatypes/gradient","datatypes/lambda","datatypes/custommacro","datatypes/codehook","internaltypes/twineerror"],function(e,t,n,r,a,o,i,s,c){var u=e.realWhitespace,l=e.anyRealLetter,p=e.anyCasedLetter,f=e.anyNewline,d=t.objectName,e=Object.assign,t=Object.seal,h=Object.keys,m=Math.floor,y=Math.abs,g={TwineScript_TypeID:"datatype",TwineScript_TypeName:"a datatype",TwineScript_Print:function(){return"`["+this.TwineScript_ObjectName+"]`"},get TwineScript_ObjectName(){return"the "+(this.rest?"...":"")+this.name+" datatype"},TwineScript_is:function(e){return g.isPrototypeOf(e)&&e.name===this.name},TwineScript_Clone:function(){return this.rest?this:Object.create(this)},TwineScript_ToSource:function(){return(this.rest?"...":"")+this.name},TwineScript_IsTypeOf:function(e){var t=this.name,n=this.rest;return!!b[t]&&b[t](e,n)},toTypeSignatureObject:function(){var e=this.name,e={pattern:"range",range:b[e],name:"a "+("dm"===e?"datamap":"ds"===e?"dataset":"num"===e?e+"ber":"str"===e?e+"ing":"color"===e?"colour":"bool"===e?e+"ean":"alnum"===e?"alphanumeric character":"int"===e?e+"eger":"even"===e||"odd"===e?e+" number":e.endsWith("case")||"whitespace"===e?e+" character":"empty"===e?e+" value":e)};return this.rest?{pattern:"zero or more",innerType:e}:e},create:function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=(e="datamap"===e?"dm":"dataset"===e?"ds":"number"===e?"num":"string"===e?"str":"color"===e?"colour":"boolean"===e?"bool":"alphanumeric"===e?"alnum":"integer"===e?"int":"newline"===e?"linebreak":e,Object.create(this));return n.name=e,n.rest=t,n},from:function(t){var e=h(v).find(function(e){return v[e](t)});return e?g.create(e):c.create("datatype",d(t)+" doesn't correspond to a datatype value.")}},v={array:Array.isArray,dm:function(e){return e instanceof Map},ds:function(e){return e instanceof Set},datatype:function(e){return g.isPrototypeOf(e)},changer:function(e){return n.isPrototypeOf(e)},colour:function(e){return r.isPrototypeOf(e)},gradient:function(e){return a.isPrototypeOf(e)},lambda:function(e){return o.isPrototypeOf(e)},macro:function(e){return i.isPrototypeOf(e)},codehook:function(e){return s.isPrototypeOf(e)},command:function(e){return e&&"command"===e.TwineScript_TypeID},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},bool:function(e){return"boolean"==typeof e}},b=e({},v,{even:function(e){return!isNaN(e)&&m(y(e))%2==0},odd:function(e){return!isNaN(e)&&m(y(e))%2==1},empty:function(e){return e instanceof Map||e instanceof Set?!e.size:!(!Array.isArray(e)&&"string"!=typeof e)&&!e.length},int:function(e){return"number"==typeof e&&e===(0|e)},uppercase:function(e){return"string"==typeof e&&1===_toConsumableArray(e).length&&_toConsumableArray(e).every(function(e){return e!==e.toLowerCase()})},lowercase:function(e){return"string"==typeof e&&1===_toConsumableArray(e).length&&_toConsumableArray(e).every(function(e){return e!==e.toUpperCase()})},whitespace:function(e){return"string"==typeof e&&!!e.match("^"+u+"$")},digit:function(e){return"string"==typeof e&&!!e.match("^\\d$")},alnum:function(e){return"string"==typeof e&&!!e.match("^"+l+"$")},anycase:function(e){return"string"==typeof e&&!!e.match("^"+p+"$")},linebreak:function(e){return"string"==typeof e&&!!e.match("^"+f+"$")},any:function(){return!0},const:function(){return!0}});return t(g)}),define("twinescript/operations",["utils","utils/operationutils","datatypes/typedvar","datatypes/datatype","internaltypes/twineerror"],function(e,t,n,r,m){var a=e.plural,o=t.isObject,i=t.collectionType,s=t.is,c=t.isA,u=t.clone,l=t.unique,p=t.contains,e=t.matches,y=t.objectName,f=t.toSource;function d(r,a,o,i){return o=o||"do this to",function(e,t){var n;return 1===a.length&&(t=e),(n=m.containsError(e,t))?n:_typeof(e)!==r||_typeof(t)!==r?m.create("operation","I can only ".concat(o," ").concat(r,"s, not ").concat(y(_typeof(e)!==r?e:t),"."),i):a(e,t)}}function h(a){return function(e,t){var n,r;return(n=m.containsError(e,t))?n:_typeof(e)!==_typeof(t)||o(e)&&"TwineScript_TypeName"in e&&o(t)&&"TwineScript_TypeName"in t&&e.TwineScript_TypeName!==t.TwineScript_TypeName||i(e)!==i(t)?(n="".concat(y(e)," isn't the same type of data as ").concat(y(t)),_typeof(e)+_typeof(t)!=="stringnumber"&&_typeof(e)+_typeof(t)!=="numberstring"||(r="You might want to convert one side to a number using (num:), or to a string using (str:)."),m.create("operation",n[0].toUpperCase()+n.slice(1),r)):a(e,t)}}function g(f,d,e){var h=2<arguments.length&&void 0!==e&&e;return function r(a,o){var e;if(e=m.containsError(a,o))return e;var t=_slicedToArray(a.determiner?[a,o]:o.determiner?[o,a]:[],2),i=t[0],t=t[1];if(i){var n=i,s=n.determiner,n=n.determined;if("start"===s||"end"===s){if(d)return m.create("operation","I can't use '".concat(d,"' with the 'start' or 'end' of ").concat(y(n),"."));if(t.determiner){if("start"===t.determiner||"end"===t.determiner)return m.create("operation","I can't compare one value's 'start' or 'end' with another value's 'start' or 'end'.","Please change one of them to use an exact range, such as '1stto4th' or '2ndlasttolast'.");n=[t,i],i=n[0],t=n[1]}for(var c=i.string||i.array,u=0;u<c.length+1;u+=1){var l=u?"end"===s?c.slice(-u):c.slice(0,u):c.constructor(),l=i===a?r(l,o):r(a,l);if(e=m.containsError(l))return e;if(l!==h)return l}return h}var p="all"===s;return i.array.reduce(function(e,t){var n,t=i===a?r(t,o):r(a,t);return(n=m.containsError(e,t))?n:p?e&&t:e||t},p)}return f(a,o)}}function v(n,e){return g(function(e,t){e=n(e,t);return m.containsError(e)?e:!e},e,!0)}t="If one of these values is a number, you may want to write a check that it 'is not 0'. Also, if one is a string, you may want to write a check that it 'is not \"\" '.",t={and:d("boolean",h(function(e,t){return e&&t}),"use 'and' to join",t),or:d("boolean",h(function(e,t){return e||t}),"use 'or' to join",t),not:d("boolean",function(e){return!e},"use 'not' to invert",t),"+":h(function(e,t){return Array.isArray(e)?[].concat(_toConsumableArray(e),_toConsumableArray(t)):e instanceof Map?(n=new Map(e),t.forEach(function(e,t){return n.set(t,e)}),n):e instanceof Set?new Set([].concat(_toConsumableArray(e),_toConsumableArray(t)).filter(l).map(u)):"function"==typeof e["TwineScript_+"]?e["TwineScript_+"](t):"string|number|boolean".includes(_typeof(e))?e+t:m.create("operation","I can't use + on ".concat(y(e),"."));var n}),"-":h(function(e,n){return Array.isArray(e)?e.filter(function(t){return!n.some(function(e){return s(t,e)})}):e instanceof Set?(r=_toConsumableArray(n),new Set(_toConsumableArray(e).filter(function(t){return!r.some(function(e){return s(t,e)})}))):"string"==typeof e?e.split(n).join(""):"number"==typeof e?e-n:m.create("operation","I can't use - on ".concat(y(e),"."));var r}),"*":d("number",h(function(e,t){return e*t}),"multiply"),"/":d("number",h(function(e,t){return 0===t?m.create("operation","I can't divide ".concat(y(e)," by zero.")):e/t}),"divide"),"%":d("number",h(function(e,t){return 0===t?m.create("operation","I can't modulo ".concat(y(e)," by zero.")):e%t}),"modulus"),"<":g(d("number",h(function(e,t){return e<t}),"do < to"),"<"),">":g(d("number",h(function(e,t){return t<e}),"do > to"),">"),"<=":g(d("number",h(function(e,t){return e<=t}),"do <= to"),"<="),">=":g(d("number",h(function(e,t){return t<=e}),"do >= to"),">="),is:g(s),isNot:v(s),contains:g(p,"contains"),doesNotContain:v(p,"does not contain"),isIn:g(function(e,t){return p(t,e)},"is in"),isNotIn:v(function(e,t){return p(t,e)},"is not in"),isA:g(c,"is a"),isNotA:v(c,"is not a"),typifies:g(function(e,t){return c(t,e)}),untypifies:v(function(e,t){return c(t,e)}),matches:g(e),doesNotMatch:v(e),makeSpreader:function(e){return m.containsError(e)?e:n.isPrototypeOf(e)||r.isPrototypeOf(e)?(t=u(e),(n.isPrototypeOf(e)?t.datatype:t).rest=!0,t):{value:e,spreader:!0,TwineScript_TypeName:"a spreaded '...' value",TwineScript_ObjectName:a("string"==typeof e||Array.isArray(e)?_toConsumableArray(e).length:1,"spreaded '...' value"),TwineScript_Unstorable:!0,TwineScript_ToSource:function(){return""+_toConsumableArray(e).map(f)}};var t}};return Object.freeze(t)}),define("datatypes/varbind",["jquery","utils","utils/operationutils","internaltypes/varref","internaltypes/twineerror"],function(o,e,t,n,r){var a=t.objectName;return n.on("set",function(r,a){r.TwineScript_VariableStore&&e.storyElement.find("[data-2bind]").each(function(e,t){var n=(t=o(t)).data("twoWayBindEvent");"function"==typeof n&&n(t,r,a)})}),Object.freeze({TwineScript_TypeName:"a VarBind (bound variable name)",get TwineScript_ObjectName(){return"a ".concat(this.bind," bind to ").concat(this.varRef.TwineScript_ToSource())},TwineScript_Print:function(){return"`[A bound variable name]`"},TwineScript_Unstorable:!0,TwineScript_ToSource:function(){return("two way"===this.bind?"2":"")+"bind "+this.varRef.TwineScript_ToSource()},set:function(e){var e=this.varRef.set(e);if(e=r.containsError(e))return e},create:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"one way";return r.containsError(e)?e:n.isPrototypeOf(e)?e.error||Object.assign(Object.create(this),{varRef:e,bind:t}):r.create("operation","I can only 'bind' a variable, not "+a(e)+".")}})}),define("datatypes/assignmentrequest",["utils/operationutils","datatypes/typedvar","datatypes/datatype","internaltypes/varref","internaltypes/twineerror"],function(e,g,v,b,w){var T=e.objectName,k=e.matches,t=e.toSource;return Object.freeze({assignmentRequest:!0,TwineScript_TypeName:"a VariableToValue (a 'to' or 'into' expression)",TwineScript_ObjectName:"a VariableToValue (a 'to' or 'into' expression)",TwineScript_ToSource:function(){return"into"===this.operator?"".concat(t(this.src)," ").concat(this.operator," ").concat(t(this.dest)):"".concat(t(this.dest)," ").concat(this.operator," ").concat(t(this.src))},TwineScript_Unstorable:!0,set:function(){var e,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],n=[],r=function e(t,n,r){var a=!(2<arguments.length&&void 0!==r)||r,o=[],i=n&&b.isPrototypeOf(n)?n.get():n;if(w.containsError(i))return i;if(Array.isArray(i)&&Array.isArray(t)){for(var s=0,c=0;s<t.length&&c<i.length;){var u=t[s],l=i[c];if(g.isPrototypeOf(u)&&u.datatype.rest||v.isPrototypeOf(u)&&u.rest){for(var p=c;c<i.length&&k(u,l);)l=i[c+=1];g.isPrototypeOf(u)?u.datatype=[u.datatype]:v.isPrototypeOf(u)&&(u=v.create("array")),o=o.concat(e(u,b.isPrototypeOf(n)?b.create(n,{first:p+1,last:c+1}):i.slice(p,c)))}else o=o.concat(e(u,b.isPrototypeOf(n)?b.create(n,c+1):l)),c+=1;s+=1}return s<t.length?a&&w.create("operation","I can't unpack this array because it needs ".concat(t.length-s," more value").concat(0<t.length-s?"s":"",".")):o}if(t instanceof Map&&i instanceof Map){var f,d=_createForOfIteratorHelper(t.entries());try{for(d.s();!(f=d.n()).done;){var h=_slicedToArray(f.value,2),m=h[0],y=h[1];if(!i.has(m))return a&&w.create("operation","I can't unpack this datamap because it needs a '"+m+"' data name.");o=o.concat(e(y,b.isPrototypeOf(n)?b.create(n,m):i.get(m)))}}catch(e){d.e(e)}finally{d.f()}return o}if(g.isPrototypeOf(t)){if("function"==typeof t.datatype.destructure)return[{dest:t,value:i,src:n}].concat(t.datatype.destructure(i));if(!k(i,t.datatype))return a&&w.create("operation","I can't put ".concat(T(i)," into ").concat(t.varRef.TwineScript_ToSource()," because it doesn't match ").concat(t.varRef.TwineScript_ToSource(),"'s datatype, ").concat(T(t.datatype),"."));o=o.concat(e(t.datatype,i))}return b.isPrototypeOf(t)||g.isPrototypeOf(t)?o.concat({dest:t,value:i,src:n}):"function"==typeof t.destructure?o.concat(t.destructure(i)):k(i,t)?o:a&&w.create("operation","I tried to unpack, but "+T(t)+" in the pattern didn't match "+T(i)+".")}(this.dest,this.src);if(e=w.containsError(r))return e;if(!r.length)return w.create("operation","I can't store a new value inside "+T(this.dest)+" that isn't in a variable.","You need a variable, or a data structure containing variables at certain positions, to store the value.");var a,o=_createForOfIteratorHelper(r.reverse());try{for(o.s();!(a=o.n()).done;){var i=a.value,s=i.dest,c=i.value,u=i.src;if(g.isPrototypeOf(s)){if(e=w.containsError(s.defineType()))return e;s=s.varRef}if(e=s.set(c,this.srcRef),w.isPrototypeOf(e))return e;t&&u&&u.delete(),n.shift(T(s)+" is now "+T(c))}}catch(e){o.e(e)}finally{o.f()}return n.join("; ")},create:function(e,t,n,r){return w.containsError(e)?e:w.containsError(t)?t:Object.assign(Object.create(this),{dest:e,src:t,operator:n,srcRef:r})}})}),define("twinescript/runner",["macros","state","utils","utils/operationutils","twinescript/operations","datatypes/colour","datatypes/hookset","datatypes/lambda","datatypes/datatype","datatypes/varbind","datatypes/codehook","datatypes/typedvar","datatypes/assignmentrequest","internaltypes/varref","internaltypes/twineerror"],function(Macros,State,_ref64,_ref65,Operations,Colour,HookSet,Lambda,Datatype,VarBind,CodeHook,TypedVar,AssignmentRequest,VarRef,TwineError){var insensitiveName=_ref64.insensitiveName,impossible=_ref64.impossible,toSource=_ref65.toSource,typeName=_ref65.typeName,objectName=_ref65.objectName;function addFreeVariable(e,t){var n,r=e.freeVariables;"macro"===t.type?"current-time"===(n=insensitiveName(t.name))||"current-date"===n||"monthday"===n||"weekday"===n||"history"===n||"visited"===n||"passage"===n?e.freeVariables=!0:t.blockedValue&&!r.blockedValues?r.blockedValues=e.stackTop.blockedValues.concat():"random"!==n&&"either"!==n&&"shuffled"!==n||r.seed||(r.seed=State.seed,r.seedIter=State.seedIter):"identifier"===t.type?"time"!==(n=insensitiveName(t.text))&&"exits"!==n&&"it"!==n&&"visits"!==n&&"turns"!==n||(e.freeVariables=!0):"property"===t.type||"belongingProperty"===t.type?"random"!==insensitiveName(t.name)||r.seed||(r.seed=State.seed,r.seedIter=State.seedIter):"variable"!==t.type&&"tempVariable"!==t.type||(e.freeVariables=!0)}var precedenceTable=[["error","text"],["comma"],["to","into"],["where","when","via","making","each"],["typeSignature"],["augmentedAssign"],["and","or"],["is","isNot"],["contains","doesNotContain","isIn","isNotIn"],["isA","isNotA","matches","doesNotMatch"],["inequality"],["addition","subtraction"],["multiplication","division"],{rightAssociative:["spread","bind"]},{rightAssociative:["not","positive","negative"]},{rightAssociative:["belongingProperty","belongingItProperty","belongingOperator","belongingItOperator"]},["property","itsProperty","possessiveOperator","itsOperator"],["twineLink","macro","identifier","variable","tempVariable","hookName","number","cssTime","boolean","string","hook","colour","datatype","root"],["grouping"]];function precedentToken(e,t){var n,r,a,o=[];if(e.length)for("most"===t?(n=precedenceTable.length-1,r=a=-1):(n=0,r=precedenceTable.length,a=1);n!==r;n+=a){var i=precedenceTable[n],s=NaN;if(i.rightAssociative){for(var c=0;c<e.length;c+=1)if(i.rightAssociative.includes(e[c].type)){s=c;break}}else for(var u=e.length-1;0<=u;--u)if(i.includes(e[u].type)){s=u;break}if(!Number.isNaN(s)&&-1<s){o=[e[s],s];break}}return o}var comparisonOpTypes=["inequality","is","isNot","isIn","contains","doesNotContain","isNotIn","isA","typifies","isNotA","untypifies","matches","doesNotMatch"],inequalityNegator={">":"<=","<":">=",">=":"<","<=":">"};function compileComparisonOperator(e){return"inequality"===e.type?e.negate?inequalityNegator[e.operator]:e.operator:e.type}var comparisonReverser={">":"<","<":">",">=":"<=","<=":">=",contains:"isIn",doesNotContain:"isNotIn",isIn:"contains",isA:"typifies",typifies:"isA",isNotA:"untypifies",untypifies:"isNotA"};function reverseComparisonOperator(e){e=compileComparisonOperator(e);return comparisonReverser[e]||e}var tokenSides={error:"neither",identifier:"neither",variable:"neither",tempVariable:"neither",hookName:"neither",number:"neither",boolean:"neither",string:"neither",hook:"neither",colour:"neither",datatype:"neither",root:"neither",twineLink:"neither",macro:"neither",grouping:"neither",itsProperty:"neither",belongingItProperty:"neither",to:"both",into:"both",typeSignature:"both",augmentedAssign:"both",and:"both",or:"both",belongingOperator:"both",possessiveOperator:"both",multiplication:"both",division:"both",spread:"after",bind:"after",not:"after",belongingProperty:"after",each:"after",itsOperator:"after",positive:"after",negative:"after",belongingItOperator:"before",property:"before"};function missingSideError(e,t,n){return TwineError.create("syntax","I need usable code to be ".concat(e?"left ":"").concat(e&&t?"and ":"").concat(t?"right ":"","of ").concat(n.text,"."))}function wrongSideError(e,t,n){return TwineError.create("syntax","There can't be a ".concat(e&&t?e.map(function(e){return e.text}).join("")+" or "+t.map(function(e){return e.text}).join(""):(e||t).map(function(e){return e.text}).join("")," to the ").concat(e?"left ":"").concat(e&&t?"or ":"").concat(t?"right ":"","of ").concat(n.text,"."),"There could be a comma missing between them.")}function makeEvalReplayFrame(e,t){var n=t.val,r=t.fromCode,a=t.toCode,o=t.toDesc,i=t.reason,s=t.it,c=t.tokens,t=t.i,u=c[t],l=c.slice(0,t),t=c.slice(t+1);if(1===c.length&&(l=t=!1,u=c[0]),!e[e.length-1].error){var p,f,c=TwineError.containsError(n),d=e[e.length-1].code,h=e[0].basis,m=(l&&l.length&&t&&t.length&&l[0].start>t[0].start&&(l=(p=[t,l])[0],t=p[1]),p=a||"".concat(l&&l.length&&"whitespace"===l[l.length-1].type?" ":"").concat(c?" \ud83d\udc1e ":(n&&!n.TwineScript_ToSource&&n.TwineScript_Unstorable?objectName:toSource)(n)).concat(t&&t.length&&("whitespace"===t[0].type||"addition"===u.type||"subtraction"===u.type)?" ":""),(l.length?l[0]:u).start-h),y=(t.length?t[t.length-1]:u).end-h,g=_createForOfIteratorHelper(e);try{for(g.s();!(f=g.n()).done;){var v=f.value;v.start<m?(m+=v.diff,y+=v.diff):v.start<y&&(y+=v.diff)}}catch(e){g.e(e)}finally{g.f()}!r&&(r=d.slice(m,y),a&&a.trim()===r.trim())||(l=p.length-(y-m),e.push({code:d.slice(0,m)+p+d.slice(y),fromCode:r,toCode:!c&&a,toDesc:!c&&!a&&(o||objectName(n)),start:m,end:y,diff:l,reason:i,itIdentifier:void 0!==s&&objectName(s),error:c&&c.render(d.slice(m,y),!0)}))}}function setIt(e,t){return(VarRef.isPrototypeOf(t)||TypedVar.isPrototypeOf(t))&&(e.Identifiers.it=t.get()),t}return function run(section,tokens){var isVarRef=2<arguments.length&&void 0!==arguments[2]&&arguments[2],isTypedVar=3<arguments.length&&void 0!==arguments[3]&&arguments[3],evalReplay=section.evalReplay,hasEvalReplay=evalReplay&&evalReplay.length,evalReplayReason,evalReplaySkip=!1,evalReplayIt,ops=Operations,token,ret,i,before,after,_precedentToken,_precedentToken2,token,i,before,after;if(Array.isArray(tokens)||(tokens=[tokens]),!tokens.length||!tokens[0])return impossible("Runner.run","No tokens to run!"),0;1===tokens.length?token=tokens[0]:(_precedentToken=precedentToken(tokens,"least"),_precedentToken2=_slicedToArray(_precedentToken,2),token=_precedentToken2[0],i=_precedentToken2[1],before=tokens.slice(0,i),after=tokens.slice(i+1),before.length&&(1!==before.length||"whitespace"!==before[0].type)||(before=!1),after.length&&(1!==after.length||"whitespace"!==after[0].type)||(after=!1));var type=token.type;if(!type)return impossible("Runner.run","Token has no type!"),0;var sides=tokenSides[type]||"",VARREF=("both"!==sides||before&&after?"neither"===sides&&(before||after)?ret=wrongSideError(before,after,token):"before"===sides?before?after&&(ret=wrongSideError(null,after,token)):ret=missingSideError(!0,!1,token):"after"===sides&&(after?before&&(ret=wrongSideError(before,null,token)):ret=missingSideError(!1,!0,token)):ret=missingSideError(!before,!after,token),section.freeVariables&&"object"===_typeof(section.freeVariables)&&addFreeVariable(section,token),!0),TYPEDVAR=!0,val,evalReplayReason,ret,source,_source3,_value,msg;if(!ret){if("comma"===type)return impossible("Section.run","a comma token was run() somehow."),0;if("root"===type)ret=run(section,token.children);else if("identifier"===type)ret=isVarRef?VarRef.create(section.Identifiers,token.text.toLowerCase()):section.Identifiers[token.text.toLowerCase()];else if("variable"===type||"tempVariable"===type){ret=VarRef.create("tempVariable"===type?section.stackTop.tempVariables:State.variables,token.name),isTypedVar?(ret=TypedVar.create(Datatype.create("any"),ret),evalReplayReason=hasEvalReplay&&"Variables in 'to' or 'into' expressions with no -type to their left are considered to be 'any-type' variables that can store any storable value."):isVarRef||TwineError.containsError(ret)?evalReplaySkip=!0:(val=ret.get(),evalReplayReason=hasEvalReplay&&(ret&&ret.object===State.variables&&!hasOwnProperty.call(ret.object,ret.compiledPropertyChain[0])?"This variable didn't exist; for story-wide $ variables, a default value of 0 is used if they don't exist.":""),ret=val)}else if("hookName"===type)ret=HookSet.create({type:"name",data:token.name}),evalReplaySkip=!0;else if("number"===type||"cssTime"===type)ret=token.value,evalReplayReason=hasEvalReplay&&"cssTime"===type&&(token.text.endsWith("ms")?"The letters 'ms' at the end of numbers are ignored, so you can use them to indicate that a number represents milliseconds.":"The letter 's' at the end of numbers represents 'seconds'. Harlowe converts them to milliseconds (multiplies them by 1000)."),evalReplaySkip=!evalReplayReason;else if("boolean"===type)ret="true"===token.text.toLowerCase(),evalReplaySkip=!0;else if("string"===type){var t=token.text.replace(/(.?)\n/g,function(e,t){return("\\"===t?"\\\\":"\n"===t?"\\n":t)+"\\n"}).replace(/(\\*)\\0/g,function(e,t){return(t?"\\".repeat(2*t.length):"")+"0"});ret=eval(t),evalReplaySkip=!0}else if("hook"===type)ret=CodeHook.create(token.children,token.text),evalReplaySkip=!0;else if("colour"===type)ret=Colour.create(token.colour),evalReplaySkip=!0;else if("datatype"===type)ret=Datatype.create(token.name),evalReplaySkip=!0;else if("spread"===type)ret=ops.makeSpreader(run(section,after,!1,isTypedVar));else if("bind"===type)ret=VarBind.create(run(section,after,VARREF),token.text.startsWith("2")?"two way":""),evalReplaySkip=!0;else if("to"===type||"into"===type){var dest="to"===type?setIt(section,run(section,before,VARREF,TYPEDVAR)):run(section,after,VARREF,TYPEDVAR);if(TwineError.containsError(dest))ret=dest;else{(VarRef.isPrototypeOf(dest)&&dest.propertyChain.length<=1||TypedVar.isPrototypeOf(dest)&&dest.varRef.propertyChain.length<=1)&&(section.freeVariables=Object.create(null));var src="to"===type?run(section,after,VARREF):setIt(section,run(section,before,VARREF));if(TwineError.containsError(src))return src;var freeVariables=section.freeVariables,srcRef;section.freeVariables=null,token.place&&freeVariables&&"object"===_typeof(freeVariables)&&"boolean"!=typeof src&&"number"!=typeof src&&(srcRef=freeVariables,srcRef.at=token.place,srcRef.from=after[0].start,srcRef.to=after[after.length-1].end,JSON.stringify(srcRef).length>=toSource(src).length&&(srcRef=void 0)),ret=AssignmentRequest.create(dest,src,type,srcRef),evalReplaySkip=!0,evalReplayIt=section.Identifiers.it}}else if("typeSignature"===type){var datatype=run(section,before),free=section.freeVariables,variable=(section.freeVariables=null,run(section,after,VARREF));section.freeVariables=free,ret=TypedVar.create(datatype,variable),evalReplaySkip=!0}else if("where"===type||"when"===type||"via"===type){after?(source=tokens.map(function(e){return e.text}).join(""),ret=Lambda.create(before?run(section,before,VARREF):void 0,token.type,after,source),evalReplaySkip=!0):ret=missingSideError(!1,!0,token)}else if("making"===type||"each"===type){after?(_source3=[].concat(tokens).map(function(e){return e.text}).join(""),ret="each"===type?Lambda.create(run(section,after,VARREF),"each",null,_source3):Lambda.create(before?run(section,before,VARREF):void 0,token.type,run(section,after,VARREF),_source3),evalReplaySkip=!0):ret=missingSideError(!1,!0,token)}else if("augmentedAssign"===type)ret=ops.makeAssignmentRequest(run(section,before,VARREF),ops[token.operator](run(section,before),run(section,after)),token.operator),evalReplaySkip=!0;else if("and"===type||"or"===type){var isComparisonOp=function e(t){var n=_slicedToArray(precedentToken(t,"least"),2),r=n[0],n=n[1];if(r&&"whitespace"!==r.type)return comparisonOpTypes.includes(r.type)?r:r.type===type?e(t.slice(0,n))||e(t.slice(n+1)):void 0},leftIsComparison=isComparisonOp(before),rightIsComparison=isComparisonOp(after),ambiguityError=TwineError.create("operation",'This use of "is not" and "'.concat(type,'" is grammatically ambiguous.'),'Maybe try rewriting this as "__ is not __ '.concat(type,' __ is not __"')),operator,getElisionOperands=function e(t){var n=_slicedToArray(precedentToken(t,"least"),2),r=n[0],n=n[1];if(!r||"whitespace"===r.type)return[];if(r.type===type)return[].concat(_toConsumableArray(e(t.slice(0,n))),_toConsumableArray(e(t.slice(n+1))));var a,r=run(section,t);return hasEvalReplay&&"boolean"!=typeof r&&(a=operator.replace(/[A-Z]/g,function(e){return" "+e.toLowerCase()}),makeEvalReplayFrame(evalReplay,{toCode:" it ".concat(a," ").concat(toSource(r)," "),reason:"A missing 'it ".concat(a,"' was inferred to correct the '").concat(type,"' operation."),tokens:t,i:n}),makeEvalReplayFrame(evalReplay,{toCode:" ".concat(toSource(section.Identifiers.it)," ").concat(a," ").concat(toSource(r)," "),tokens:t,i:n})),[{val:r,tokens:t,i:n}]},elidedComparisonOperator=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(function(e,t){var n=t.val,r=t.tokens,t=t.i;if("boolean"==typeof n)return n;e=Operations[token.type](e,Operations[operator](section.Identifiers.it,n));return hasEvalReplay&&makeEvalReplayFrame(evalReplay,{val:e,tokens:r,i:t}),e},"and"===token.type)},leftSide,evalBefore,operator,rightSide,rightIndex,swappedSides,evalAfter;ret=leftIsComparison&&!rightIsComparison?(leftSide=leftIsComparison,operator=compileComparisonOperator(leftSide),"isNot"===leftSide.type||"isNotA"===leftSide.type||"untypifies"===leftSide.type?ambiguityError:(evalBefore=run(section,before),ops[type](evalBefore,elidedComparisonOperator.apply(void 0,_toConsumableArray(getElisionOperands(after)))))):!leftIsComparison&&rightIsComparison?(rightSide=rightIsComparison,rightIndex=tokens.indexOf(rightSide),operator=reverseComparisonOperator(rightSide),"isNot"===rightSide.type||"isNotA"===rightSide.type||"untypifies"===rightSide.type?ambiguityError:(swappedSides=[].concat(_toConsumableArray(tokens.slice(rightIndex+1)),[Object.assign(Object.create(rightSide),_defineProperty({},"inequality"===rightSide.type?"operator":"type",reverseComparisonOperator(rightSide)))],_toConsumableArray(tokens.slice(i+1,rightIndex))),evalAfter=run(section,swappedSides),ops[type](evalAfter,elidedComparisonOperator.apply(void 0,_toConsumableArray(getElisionOperands(before)))))):ops[type](run(section,before),run(section,after))}else if(comparisonOpTypes.includes(type)){after||missingSideError(!1,!0,token);var leftOp=before?run(section,before):section.Identifiers.it;ret=ops[compileComparisonOperator(token)](leftOp,run(section,after)),section.Identifiers.it=leftOp,evalReplayIt=leftOp,evalReplayReason=hasEvalReplay&&!before&&"A missing 'it' was inferred to complete the operation."}else if("addition"===type||"subtraction"===type){after||missingSideError(!1,!0,token);var convert=!before,_precedentToken7,_precedentToken8,previousPrecedentToken,_i7,_sides,pType,convert;before&&(_precedentToken7=precedentToken(before,"least"),_precedentToken8=_slicedToArray(_precedentToken7,2),previousPrecedentToken=_precedentToken8[0],_i7=_precedentToken8[1],_sides=tokenSides[previousPrecedentToken.type],pType=previousPrecedentToken.type,convert=("both"===_sides||"after"===_sides||"addition"===pType||"subtraction"===pType)&&(_i7===before.length-1||_i7===before.length-2&&"whitespace"===before[before.length-1].type)),convert?(token.type="addition"===type?"positive":"negative",ret=run(section,tokens),token.type=type,evalReplaySkip=!0):ret=ops[token.text](run(section,before),run(section,after))}else if("multiplication"===type||"division"===type)ret=ops[token.text](run(section,before),run(section,after));else if("positive"===type||"negative"===type)ret=ops["*"]("negative"===type?-1:1,run(section,after)),evalReplaySkip=!0;else if("not"===type)ret=ops.not(run(section,after));else if("belongingProperty"===type){var container=run(section,after,isVarRef),isRef=(ret=VarRef.create(container,token.name),isVarRef||TwineError.containsError(ret));ret=isRef?ret:ret.get(),isRef=isVarRef||TwineError.containsError(ret),hasEvalReplay&&!isRef?makeEvalReplayFrame(evalReplay,{toCode:" ".concat(token.name," of ").concat(toSource(VarRef.isPrototypeOf(container)?container.get():container)," "),tokens:tokens,i:i}):isRef||(evalReplayReason="The value to the right of 'of', ".concat(typeName(container),', had a "').concat(token.name,'" data name corresponding to that data value.'))}else if("belongingOperator"===type||"belongingItOperator"===type){var value=run(section,before);"random"===value&§ion.freeVariables&&"object"===_typeof(section.freeVariables)&&!section.freeVariables.seed&&(section.freeVariables.seed=State.seed,section.freeVariables.seedIter=State.seedIter),ret=VarRef.create("belongingItOperator"===type?section.Identifiers.it:run(section,after,isVarRef),{computed:!0,value:value}),ret=isVarRef||TwineError.containsError(ret)?ret:ret.get(),"belongingItOperator"===type&&hasEvalReplay&&makeEvalReplayFrame(evalReplay,{toCode:" ".concat(toSource(value)," of ").concat(toSource(section.Identifiers.it)," "),tokens:tokens,i:i})}else if("property"===type){var _container=run(section,before,VARREF),_isRef=(ret=VarRef.create(_container,token.name),isVarRef||TwineError.containsError(ret));ret=_isRef?ret:ret.get(),_isRef=isVarRef||TwineError.containsError(ret),hasEvalReplay&&VarRef.isPrototypeOf(_container)&&!_isRef?makeEvalReplayFrame(evalReplay,{toCode:" ".concat(toSource(_container.get()),"'s ").concat(token.name," "),tokens:tokens,i:i}):_isRef||(evalReplayReason="The value to the left of 's, ".concat(typeName(_container),', had a "').concat(token.name,'" data name corresponding to that data value.'))}else if("itsProperty"===type||"belongingItProperty"===type)ret=VarRef.create(section.Identifiers.it,token.name),ret=isVarRef||TwineError.containsError(ret)?ret:ret.get(),hasEvalReplay&&makeEvalReplayFrame(evalReplay,{toCode:"itsProperty"===type?" ".concat(toSource(section.Identifiers.it),"'s ").concat(token.name," "):" ".concat(token.name," of ").concat(toSource(section.Identifiers.it)," "),tokens:tokens,i:i});else if("possessiveOperator"===type||"itsOperator"===type){!after||!before&&"itsOperator"!==token.type?ret=missingSideError(!before,!after,token):(_value=run(section,after),"random"===_value&§ion.freeVariables&&"object"===_typeof(section.freeVariables)&&!section.freeVariables.seed&&(section.freeVariables.seed=State.seed,section.freeVariables.seedIter=State.seedIter),ret=VarRef.create("itsOperator"===token.type?section.Identifiers.it:run(section,before,isVarRef),{computed:!0,value:_value}),ret=isVarRef||TwineError.containsError(ret)?ret:ret.get(),"itsOperator"===type&&hasEvalReplay&&makeEvalReplayFrame(evalReplay,{toCode:" ".concat(toSource(section.Identifiers.it),"'s ").concat(toSource(_value)," "),tokens:tokens,i:i}))}else if("twineLink"===type)ret=Macros.run("link-goto",section,[token.innerText,token.passage]),evalReplayReason=hasEvalReplay&&"Passage links are the same as (link-goto:) macro calls.";else if("macro"===type)if(token.blockedValue&&!section.blocked){if(ret=section.blockedValue(),void 0===ret)return impossible("Runner.run","section.blockedValue() returned undefined"),0}else{var macroNameToken=token.children[0],variableCall="$"===macroNameToken.text[0]||"_"===macroNameToken.text[0],macroRef;if("macroName"!==macroNameToken.type&&!variableCall)return impossible("Runner.run","macro token had no macroName child token"),0;variableCall?(macroRef=VarRef.create("_"===macroNameToken.text[0]?section.stackTop.tempVariables:State.variables,macroNameToken.text.trim().slice(1,-1)),TwineError.containsError(macroRef)||(macroRef=macroRef.get())):macroRef=token.name,ret=Macros[variableCall?"runCustom":"run"](macroRef,section,token.children.slice(1).reduce(function(e,t){return"comma"===t.type?e.push([]):e[e.length-1].push(t),e},[[]]).filter(function(e){return e.length&&(1<e.length||"whitespace"!==e[0].type)}).map(function(e){return run(section,e,!1,isTypedVar)})),evalReplayReason=hasEvalReplay&&variableCall&&"I called ".concat(objectName(macroRef),".")}else if("grouping"===type)ret=run(section,token.children,isVarRef),evalReplaySkip=!0;else if("error"===type)ret=TwineError.create("syntax",token.message,token.explanation||"");else{if("text"!==type)return impossible("Section.run","unknown syntax token type: ".concat(type,"!!")),0;token.text.trim().match(/^\d+(?:th|nd|st|rd)(?:last)?(?:to\d+(?:nth|nd|st|rd)(?:last)?)?$/g)&&(msg='Position data names like "'.concat(token.text,'" need to be either left of "of" or right of "\'s".')),ret=TwineError.create("syntax",msg||'"'.concat(token.text,"\" isn't valid Harlowe syntax for the inside of a macro call."),"Maybe you misspelled something? Also, as of 3.3.0, Javascript syntax is not allowed inside macro calls.")}}return void 0===ret?(impossible("Section.run","token ".concat(type).concat(token.name?" (".concat(token.name,":)"):""," produced undefined")),0):ret===section?(impossible("Section.run","token ".concat(type).concat(token.name?" (".concat(token.name,":)"):""," produced the section")),0):(hasEvalReplay&&!evalReplaySkip&&makeEvalReplayFrame(evalReplay,{val:ret,reason:evalReplayReason,it:evalReplayIt,tokens:tokens,i:i}),ret)}}),define("utils/scripttag",["state","utils/operationutils","internaltypes/varref","internaltypes/twineerror"],function(a,o,i,s){return function(e,r){Function("script","scope","with(scope){var scope=void 0,arguments=void 0;eval([script,script=void 0][0]);}")(e,Object.create(null,Object.keys(a.variables).map(function(e){return!e.startsWith("TwineScript_")&&"$"+e}).concat(Object.keys(r).map(function(e){return!e.startsWith("TwineScript_")&&"_"+e})).reduce(function(e,n){return n&&(e[n]={get:function(){var e=("$"===n[0]?a.variables:r)[n.slice(1)];if(o.isHarloweJSValue(e))return o.clone(e);throw s.create("","The contents of the variable ".concat(n,", ").concat(o.objectName(e),", couldn't be converted to a Javascript value."),"Only booleans, strings, numbers, datamaps, datasets and arrays can be converted to Javascript values.")},set:function(e){var t="$"===n[0]?a.variables:r;if(!o.isHarloweJSValue(e))throw s.create("","The Javascript value, ".concat(e,", couldn't be converted to a Harlowe value and assigned to the variable ").concat(n,"."),"Only booleans, strings, numbers (except NaN and Infinity), Maps, Sets and Arrays can be converted to Harlowe values.");e=o.clone(e);t=i.create(t,n.slice(1)).set(e);if(s.containsError(t))throw t}}),e},{})))}}),define("section",["jquery","utils","twinescript/runner","twinescript/operations","state","utils/operationutils","utils/renderutils","utils/scripttag","datatypes/changercommand","datatypes/colour","datatypes/lambda","datatypes/codehook","internaltypes/changedescriptor","internaltypes/varscope","internaltypes/twineerror","internaltypes/twinenotifier"],function(p,l,a,f,r,e,t,i,d,h,o,m,y,g,v,b){var w=e.printBuiltinValue,T=e.objectName,k=e.typeID,S=e.isObject,s=t.collapse,x=Object.assign;function O(e,t,n){if(t&&"object"===_typeof(t)&&d.isPrototypeOf(t)){var r=n.popData("source"),a=(n.data("originalSource",r),y.create({target:n,source:r,section:this,append:"append"})),o=t.run(a);if(v.containsError(o)&&e.replaceWith(o.render(e.attr("title"))),!this.renderInto(r,null,a))return o=l.insensitiveName(e.attr("name")),["if","elseif","unless","else","testfalse"].includes(o)&&(e.addClass("false"),"elseif"!==o&&(this.stackTop.lastHookShown=!1)),n.data("live")&&function(t,n,r){function a(e){p&&(f-=e-p),p=e,0<f?requestAnimationFrame(a):(f=s,o())}var o,i=this,e=r.data("live"),s=e.delay,c=e.event,u=((n=x({},n,{append:"replace",transitionDeferred:!1,enabled:!0})).data=x({},n.data,{live:void 0}),r.data("originalSource")||""),l=this.stackTop.tempVariables,p=null,f=s;o=this.whenUnblocked.bind(this,function(){var e;i.inDOM()&&(e=c&&c.filter(i,[!0],l),v.containsError(e)?e.render(i,t.attr("title")).replaceAll(t):c&&!e[0]?requestAnimationFrame(a):(i.renderInto(u,r,n,l),e||r.find("tw-expression[name='stop']").length||i.inDOM()&&requestAnimationFrame(a)))}),requestAnimationFrame(a)}.call(this,e,a,n),!0}else{if(!1===t)return n.data("source")&&(n.data("originalSource",n.popData("source")),n.data("hidden",!0)),e.addClass("false"),!(this.stackTop.lastHookShown=!1);if(!0!==t)return!1}return this.stackTop.lastHookShown=!0}function _(e){var t,n,e=(e instanceof p?e[0]:e).nextSibling;return e&&(e instanceof Text&&!e.textContent.trim()||["br","tw-consecutive-br"].includes((e.tagName||"").toLowerCase()))?(t=(n=_(e)).whitespace,n=n.nextElem,{whitespace:p(e).add(t),nextElem:n}):{whitespace:p(),nextElem:p(e)}}function C(e){if(e&&e.length)return p("<tw-open-button replay label='\ud83d\udd0d'>").data("evalReplay",e)}var c={add:[],remove:[]};return Object.preventExtensions({create:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:l.storyElement,n=Object.assign(Object.create(this),{timestamp:Date.now(),dom:e,stack:[],enchantments:[],unblockCallbacks:[],freeVariables:null,evalReplay:null,loadedGame:!1,Identifiers:{TwineScript_Identifiers:!0,it:0,get time(){return n.stackTop&&n.stackTop.evaluateOnly?v.create("operation","'time' can't be used in ".concat(n.stackTop.evaluateOnly,".")):Date.now()-n.timestamp},get turns(){return r.turns},get turn(){return r.turns},get visits(){var t=n.stackTop.speculativePassage;return r.history().filter(function(e){return e===(t||r.passage)}).length+(!t||t===r.passage)},get visit(){return n.Identifiers.visits},get exits(){return n.stackTop&&n.stackTop.evaluateOnly?v.create("operation","'exit' and 'exits' can't be used in ".concat(n.stackTop.evaluateOnly,".")):n.dom.find("tw-enchantment, tw-link").filter(function(e,t){return(t=p(t)).data("enchantmentEvent")||t.parent().data("linkPassageName")||t.parent().data("clickEvent")}).length},get exit(){return n.Identifiers.exits},get pos(){return n.stackTop&&!n.stackTop.evaluateOnly&&n.stackTop.lambdaPos?+n.stackTop.lambdaPos||1:v.create("operation","'pos' can only be used in lambdas that aren't 'when' lambdas.")}}});return n},eval:function(t){var e,n;l.options.debug&&l.options.evalReplay&&(e=Array.isArray(t)?t.reduce(function(e,t){return e+t.text},""):t.text||"",this.evalReplay=[{code:e,fromCode:e,basis:(Array.isArray(t)?t[0]:t).start,start:0,end:e.length,diff:0}]);try{n=a(this,t)}catch(e){return window.console&&window.console.error(e),this.evalReplay=null,v.create("","An internal error occurred while trying to run ".concat([].concat(t).map(function(e){return e.text}).join(""),"."),'The error was "'.concat(e.message,'".\nIf this is the latest version of Harlowe, please consider reporting a bug (see the documentation).'))}return this.evalReplay&&2===this.evalReplay.length&&this.evalReplay.shift(),n},get stackTop(){return this.stack[0]},inDOM:function(){return 0<l.storyElement.find(this.dom).length},evaluateTwineMarkup:function(e,t){var n=p("<p>");return this.stack.unshift({desc:y.create({target:n,source:e,section:this,append:"append"}),tempVariables:this.stackTop.tempVariables,evaluateOnly:t,finalIter:!0}),this.execute(),0<(e=n.find("tw-error")).length?e:n},speculate:function(e,t,n){this.stack.unshift({evaluateOnly:n,finalIter:!0,tempVariables:Object.assign(Object.create(g),{TwineScript_VariableStoreName:n}),speculativePassage:t});var r,n=this.evalReplay;return this.evalReplay=null,o.isPrototypeOf(e)?r=e.apply(this,{fail:!1,pass:!0}):e&&(r=a(this,e)),this.stack.shift(),this.evalReplay=n,r},renderInto:function(e,a,t){var o=this,r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,i=y.create({target:a,source:e,section:this,append:"append"});if(t)if(d.isPrototypeOf(t)){e=t.run(i);if(v.containsError(e))return e.render(a.attr("title")).replaceAll(a),!1}else Object.assign(i,t);if((a=i.target,50<=this.stack.length)&&50<=this.stack.reduce(function(e,t){return e+!!t.finalIter},0))return v.create("infinite","Printing this expression may have trapped me in an infinite loop.").render(a.attr("title")).replaceAll(a),!1;function s(e,t,n){var r=a instanceof p&&a.is("tw-hook")&&0<a.parents("tw-collapsed,[collapsing=true]").length;o.stack.unshift({desc:e,finalIter:n,tempVariables:t,collapses:r,evaluateOnly:o.stackTop&&o.stackTop.evaluateOnly})}r=r||Object.create(this.stack.length?this.stackTop.tempVariables:g);if(hasOwnProperty.call(r,"TwineScript_VariableStoreName")||(e=a&&a.tag(),r.TwineScript_VariableStoreName="tw-hook"===e?a.attr("name")?"?"+a.attr("name"):"an unnamed hook":"tw-expression"===e?"a "+a.attr("type")+" expression":"tw-passage"===e?"this passage":"an unknown scope"),Object.keys(i.loopVars).length){var c=Object.assign({},i.loopVars),u=Math.min.apply(Math,_toConsumableArray(Object.keys(c).map(function(e){return c[e].length})));if(b.create(u+" loop"+(1!==u?"s":"")).render().prependTo(a),u){for(var n=u-1;0<=n;--n)!function(n){s(i,Object.keys(c).reduce(function(e,t){return e[t]=c[t][n],e},Object.create(r),n===u-1))}(n);for(var l=u-1;0<=l&&!o.stackTop.blocked;--l)o.execute()}}else s(i,r,!0),this.execute();return 0===this.stack.length&&this.updateEnchantments(),i.enabled},execute:function(){var r=this,e=this.stackTop,t=e.desc,n=e.dom,a=e.collapses,o=e.evaluateOnly;t&&!n&&(n=t.render(),this.stackTop.dom=n,this.stackTop.desc=void 0),n.findAndFilter('tw-hook,tw-expression,script[type="application/x-harlowe"]').each(function(e,t){if(r.stackTop.blocked)return!1;switch((t=p(t)).tag()){case"tw-hook":var n=t.popData("source");if(n&&t.data("originalSource",n),t.data("tempVariables",r.stackTop.tempVariables),t.popAttr("hidden")){t.data("hidden",!0);break}n&&r.renderInto(n,t);break;case"tw-expression":if(t.data("blockers")){if(o)return void t.removeData("blockers").removeData("code").replaceWith(v.create("syntax","I can't use a macro like (prompt:) or (confirm:) in ".concat(o,"."),"Please rewrite this without putting such macros here.").render(t.attr("title"),t));var n=t.data("blockers");if(n.length)return r.stackTop.blocked=!0,n=r.eval(n.shift()),v.containsError(n)&&(r.stackTop.blocked=!1,t.removeData("blockers").replaceWith(n.render(t.attr("title"),t))),!1;t.removeData("blockers")}t.data("code")&&!function(e){var t=this.eval(e.popData("code"));e.append(C(this.evalReplay)),this.stackTop.evaluateOnly&&t&&(d.isPrototypeOf(t)||"function"==typeof t.TwineScript_Run)&&(t=v.create("syntax","I can't work out what ".concat(this.stackTop.evaluateOnly," should evaluate to, because it contains a ").concat(d.isPrototypeOf(t)?"changer.":"command."),"Please rewrite this without putting changers or commands here."));var n,r=p();for(i=e;d.isPrototypeOf(t);){var a=_(i),o=a.whitespace;if((i=a.nextElem)[0]&&i[0].nodeType===Node.TEXT_NODE&&"+"===i[0].textContent.trim()){var i,a=i,s=_(a),c=s.whitespace;if((i=s.nextElem).is("tw-expression")){s=this.eval(i.popData("code"));if(v.containsError(s)){t=s;break}var u=f["+"](t,s);p(o).add(a).add(c).remove(),t=v.containsError(u)?v.create("operation","I can't combine "+T(t)+" with "+T(s)+".","function"==typeof s.TwineScript_Run?"If you want to attach this changer to ".concat(T(s),", remove the + between them."):"Changers can only be added to other changers."):u;continue}}if(i.is("tw-expression")){a=this.eval(i.popData("code"));if(i.append(C(this.evalReplay)),v.containsError(a)){t=a;break}if(a&&"object"===_typeof(a)&&"function"==typeof a.TwineScript_Attach){t=a.TwineScript_Attach(this,t);break}return d.isPrototypeOf(a)?void e.replaceWith(v.create("operation","Changers like (".concat(t.macroName,":) need to be combined using + between them."),"Place the + between the changer macros, or the variables holding them. The + is absent only between a changer and its attached hook or command.").render(e.attr("title"))):void e.replaceWith(v.create("operation","".concat(T(a)," can't have changers like (").concat(t.macroName,":) attached."),"Changers placed just before hooks, links and commands will attempt to attach, but in this case it didn't work.").render(e.attr("title")))}if(i.is("tw-hook")){o.remove(),r=i;break}t.macroName||l.impossible("Section.runExpression","changer has no macroName");c=e.attr("title")||"("+t.macroName+": ...)";return void e.replaceWith(v.create("syntax","The (".concat(t.macroName,":) changer should be stored in a variable or attached to a hook."),"Macros like this should appear before a hook: ".concat(c,"[Some text]")).render(e.attr("title")))}e.attr("return",k(t)),r=r.length?r:_(e).nextElem.filter("tw-hook"),(n=v.containsError(t))?e.replaceWith(n.render(e.attr("title")).append(C(this.evalReplay))):b.isPrototypeOf(t)?e.append(t.render()):t&&"function"==typeof t.TwineScript_Run?(t=t.TwineScript_Run(this),v.containsError(t)?e.replaceWith(t.render(e.attr("title"))):y.isPrototypeOf(t)?t.data&&t.data.live?e.replaceWith(v.create("unimplemented","I currently can't attach (live:) or (event:) macros to commands - only hooks.").render(e.attr("title"))):(t.section=this,t.target=i,this.renderInto("",i,t)):S(t)&&t.blocked?(this.stackTop.blocked=t.blocked,e.data("code",{type:"macro",blockedValue:!0,text:e.attr("title")||"",start:0,end:(e.attr("title")||"").length})):t&&l.impossible("Section.runExpression","TwineScript_Run() returned a non-ChangeDescriptor ".concat(_typeof(t),': "').concat(t,'"'))):r.length&&O.call(this,e,t,r)||("string"==typeof t||"number"==typeof t||t instanceof Map||t instanceof Set||Array.isArray(t)||h.isPrototypeOf(t)||m.isPrototypeOf(t)||t&&"function"==typeof t.TwineScript_Print&&!d.isPrototypeOf(t)?(t=w(t),v.containsError(t)?e.replaceWith(t.render(e.attr("title"))):"string"==typeof t||Array.isArray(t)?this.renderInto(t,e):l.impossible("printBuiltinValue() produced a non-string non-array ".concat(_typeof(t)))):d.isPrototypeOf(t)||"boolean"==typeof t||l.impossible("Section.runExpression","The expression evaluated to an unknown value: ".concat(t)))}.call(r,t);break;case"script":if(l.reattachStoryElement(),!t.text())break;try{i(t.text(),r.stackTop.tempVariables)}catch(e){v.isPrototypeOf(e)?t.replaceWith(e.render(t.text(),t)):(window.console&&window.console.error(e),t.replaceWith(v.create("","A Javascript error occurred while running this <script> element.",'The error was "'.concat(e,'". Check the browser console for more details.')).render(t.text(),t)))}}}),this.stackTop.blocked||(n.length&&a&&s(n),n.findAndFilter("tw-collapsed,[collapsing=true]").each(function(){s(p(this))}),this.stack.shift())},updateEnchantments:function(){this.enchantments.forEach(function(e){e.disenchant(),e.enchantScope()})},on:function(e,t){return c[e].push(t),this},addEnchantment:function(t){var n=this;this.enchantments.push(t),c.add.forEach(function(e){return e(n,t)})},removeEnchantment:function(t){var n=this,e=this.enchantments.indexOf(t);this.enchantments.splice(e,1),t.disenchant(),c.remove.forEach(function(e){return e(n,t)})},unblock:function(e){for(this.stack.length||l.impossible("Section.unblock","stack is empty"),this.stackTop.blocked=!1,void 0!==e&&(this.stackTop.blockedValues=(this.stackTop.blockedValues||[]).concat(e));this.stack.length&&!this.stackTop.blocked;)this.execute();if(!this.stack.length)for(;0<this.unblockCallbacks.length;)if(this.unblockCallbacks.shift()(),this.stackTop&&this.stackTop.blocked)return},whenUnblocked:function(e,t){this.stack.length&&this.stackTop.blocked?this.unblockCallbacks=this.unblockCallbacks.concat(e):(t||e)()},blockedValue:function(){var e=this.stackTop;return e?e.blockedValues&&e.blockedValues.length?e.blockedValues.shift():(l.impossible("Section.blockedValue","blockedValues is missing or empty"),0):(l.impossible("Section.blockedValue","stack is empty"),0)}})}),define("engine",["jquery","utils","state","section","passages"],function(A,j,N,P,I){var t,R=j.impossible,M=j.passageSelector,D=j.transitionOut,V=j.options;function L(e,t,n){var r,a,o;for(n?(n=n.get("name"),(a=I.getTree(n))&&a.children.length&&(r={type:"include",tag:t,name:n,children:a.children,text:a.text})):r=I.getTree(t);(o=e[e.length-1])&&("root"===o.type||"include"===o.type)&&o.children.some(function(e){return e.type.startsWith("unclosed")});)e[e.length-1]=Object.create(o),e=o.children=o.children.slice();e.push(r)}function n(e){var t,n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},a=r.loadedGame,o=I.get(e),i=j.storyElement,s=i.parent(),c=r.stretch,r=r.transition,u=(r=void 0===r?{}:r).depart,u=void 0===u?"instant":u,l=r.arrive,l=void 0===l?"dissolve":l,p=r.departOrigin,f=r.arriveOrigin,r=r.time,d=(s.findAndFilter("tw-enchantment").each(function(e,t){var n=(t=A(t)).data("enchantedProperties");n&&i.css(n.reduce(function(e,t){return e[t]="",e},{})),t[0]===s[0]&&(s=i.unwrap().parent())}),I.hasValid(e)||R("Engine.showPassage","There's no passage with the name \""+e+'"!'),i.children(M).not(".transition-out, .transition-out *")),o=(o.get("tags")||[]).join(" "),h=(t=A("<tw-passage><tw-sidebar>"),h=t.children("tw-sidebar"),m=A('<tw-icon tabindex=0 alt="Undo" title="Undo">↶</tw-icon>'),n=A('<tw-icon tabindex=0 alt="Redo" title="Redo">↷</tw-icon>'),N.pastLength<=0&&m.css("visibility","hidden"),N.futureLength<=0&&n.css("visibility","hidden"),h.append(m,n),t),m=("function"==typeof p&&(p=p.call(d)),"function"==typeof f&&(f=f.call(h)),j.detachStoryElement(),h.appendTo(i).attr({tags:o}),!c&&u&&(D(d,u,r,0,0,0,p),d.css("position","absolute")),i.attr({tags:o}),P.create(h)),y=(a&&(m.loadedGame=!0),[]);if(N.pastLength<=0&&1===N.turns){var g,v=_createForOfIteratorHelper(I.getTagged("startup"));try{for(v.s();!(g=v.n()).done;)L(y,"startup",g.value)}catch(e){v.e(e)}finally{v.f()}if(V.debug){var b,w=_createForOfIteratorHelper(I.getTagged("debug-startup"));try{for(w.s();!(b=w.n()).done;)L(y,"debug-startup",b.value)}catch(e){w.e(e)}finally{w.f()}}}var T,k=_createForOfIteratorHelper(I.getTagged("header"));try{for(k.s();!(T=k.n()).done;)L(y,"header",T.value)}catch(e){k.e(e)}finally{k.f()}if(V.debug){var S,x=_createForOfIteratorHelper(I.getTagged("debug-header"));try{for(x.s();!(S=x.n()).done;)L(y,"debug-header",S.value)}catch(e){x.e(e)}finally{x.f()}}L(y,e);var O,_=_createForOfIteratorHelper(I.getTagged("footer"));try{for(_.s();!(O=_.n()).done;)L(y,"footer",O.value)}catch(e){_.e(e)}finally{_.f()}if(V.debug){var C,E=_createForOfIteratorHelper(I.getTagged("debug-footer"));try{for(E.s();!(C=E.n()).done;)L(y,"debug-footer",C.value)}catch(e){E.e(e)}finally{E.f()}}m.renderInto(y,h,{transition:l,transitionTime:r,transitionOrigin:f}),m.loadedGame=!1,j.reattachStoryElement(),scroll(0,c?h.offset().top-.05*A(window).height():i[0].getBoundingClientRect().top+document.body.scrollTop)}return Object.freeze({goBack:function(e){N.rewind()&&n(N.passage,e)},goForward:function(e){N.fastForward()&&n(N.passage,e)},goToPassage:function(e,t){N.play(e),n(e,t)},redirect:function(e,t){N.redirect(e),n(e,t)},toggleFullscreen:function(){var e=document.documentElement;document.fullscreenElement?document.exitFullscreen():document.msFullscreenElement?document.msExitFullscreen():(e.msRequestFullscreen||e.requestFullscreen).call(e)},showPassage:n,enableDebugMode:function(){t&&t()},registerDebugMode:function(e){t=t||e}})}),define("debugmode/panel",["jquery","utils/naturalsort"],function(f,e){var i=e();return Object.seal({create:function(e){var n,t=e.className,r=e.rowWrite,a=e.rowCheck,o=e.rowSort,i=e.columnHead,s=e.tabName,c=e.tabNameCounter,u=void 0===c||c,c=e.tabUpdate,l=f("<div class='panel panel-".concat(t,"' style='").concat(this.defaultMaxHeight?"max-height:"+this.defaultMaxHeight+"px":"","' hidden><div class=\"resizer-v\"></div><table class='panel-rows'></table></div>")),p=f("<button class='tab tab-".concat(t,"'>").concat(u?"0 ".concat(s,"s"):s,"</button>"));return p.click(function(){p.toggleClass("enabled"),p.parent().siblings(".panel").attr("hidden",""),p.is(".enabled")&&(p.siblings(".tab:not(.tab-"+t+")").removeClass("enabled"),l.removeAttr("hidden"))}),l.on("click","th",function(e){var e=e.target,t="desc"===(e=f(e)).attr("data-order")?"asc":"desc";n.sort(e.attr("data-col"),t),l.find("th[data-order]").removeAttr("data-order"),e.attr("data-order",t)}),c=c||function(e){return p.text(u?"".concat(e," ").concat(s).concat(1!==e?"s":""):s)},n=Object.assign(Object.create(this),{tabName:s,tab:p,panel:l,panelRows:l.find(".panel-rows"),rowWrite:r,rowSort:o,rowCheck:a,columnHead:i,tabUpdate:c})},sort:function(r,a){var o=this;this.panelRows.children(":not(.panel-head, .panel-row-source)").get().sort(function(e,t){var n;return"desc"===a&&(e=(n=[t,e])[0],t=n[1]),e=e.querySelector("."+r),t=t.querySelector("."+r),o.rowSort&&o.rowSort(r,f(e),f(t))||i(e.textContent,t.textContent)}).forEach(function(e){var t=f(e).next(".panel-row-source").get();o.panelRows.append(e,t)})},update:function(e,t){var r=this.rowCheck,a=this.rowWrite,o=this.panelRows,n=this.columnHead,i=this.panel,s=[],c=o.children(),e=(e.forEach(function(n){var e=c.filter(function(e,t){return r(n,f(t))}),t=a(n,e.length&&e);e.length||o.append(t),s.push.apply(s,_toConsumableArray(t.get()))}),c.filter(function(e,t){return!s.includes(t)&&!t.className.includes("panel-head")}).remove(),this.tabUpdate(t),0<t&&!o.find(".panel-head").length?o.prepend(n()):0===t&&o.find(".panel-head").remove(),i.find("th[data-order]"));e.length&&this.sort(e.attr("data-col"),e.attr("data-order"))},defaultMaxHeight:300})}),!function(){function e(t,n,r){return function(e){return"background-color: hsla(".concat(t,",").concat(n,"%,").concat(r,"%,").concat(e,");")}}var t={boolean:"color:hsla(0,0%,30%,1.0)",array:"color:hsla(0,100%,30%,1.0)",dataset:"color:hsla(30,100%,40%,1.0)",number:"color:hsla(30,100%,30%,1.0)",datamap:"color:hsla(60,100%,30%,1.0)",changer:"color:hsla(90,100%,30%,1.0)",lambda:"color:hsla(120,100%,40%,1.0)",hookName:"color:hsla(160,100%,30%,1.0)",string:"color:hsla(180,100%,30%,1.0)",identifier:"color:hsla(200,80%,40%,1.0)",variable:"color:hsla(200,100%,30%,1.0)",tempVariable:"color:hsla(200,70%,20%,1.0)",datatype:"color:hsla(220,100%,30%,1.0)",colour:"color:hsla(280,100%,30%,1.0)",macro:"color:hsla(320,80%,30%,1.0)",twineLink:"color:hsla(240,100%,20%,1.0)"},o=(t.gradient=t.colour,t.command=t.twineLink,t.instant=t.metadata=t.any=t.customMacro=t.macro,Math.min),n=e(40,100,50),r=e(220,100,50),i=/hsla\((\d+),\s*(\d+)%,\s*(\d+)%,\s*(\d+\.\d+)\)/g,s="cm-harlowe-3-",a=(_defineProperty(n={root:"box-sizing:border-box;",hook:n(.05),"hook-2":n(.1),"hook-3":n(.15),"hook-4":n(.2),"hook-5":n(.25),"hook-6":n(.3),"hook-7":n(.35),"hook-8":n(.4),"^=hook , ^=hook-":"font-weight:bold;",unclosedHook:n(.05)+"font-weight:bold;"},"error:not([class*='"+s+"string'])","background-color: hsla(17,100%,50%,0.5) !important;"),_defineProperty(n,"^=macroName","font-style:italic;"),_defineProperty(n,"macroName-boolean",t.boolean),_defineProperty(n,"macroName-array",t.array),_defineProperty(n,"macroName-dataset",t.dataset),_defineProperty(n,"macroName-datatype",t.datatype),_defineProperty(n,"macroName-number",t.number),_defineProperty(n,"macroName-datamap",t.datamap),_defineProperty(n,"macroName-changer",t.changer),_defineProperty(n,"macroName-string",t.string),_defineProperty(n,"macroName-colour, macroName-gradient",t.colour),_defineProperty(n,"macroName-command, macroName-instant, macroName-metadata",t.command),_defineProperty(n,"macroName-custommacro, macroName-macro, macroName-any",t.macro),_defineProperty(n,"^=macro ","font-weight:bold;"+t.macro),_defineProperty(n,"comma, spread",t.macro),_defineProperty(n,"addition",t.any),_defineProperty(n,"subtraction, multiplication, division",t.number),_defineProperty(n,"is, and, or, not, isNot, contains, doesNotContain, isIn, isA, isNotA, isNotIn, matches, doesNotMatch",t.boolean),_defineProperty(n,"bold, strong","font-weight:bold;"),_defineProperty(n,"italic, em","font-style:italic;"),_defineProperty(n,"sup","vertical-align: super;font-size:0.8em;"),_defineProperty(n,"strike","text-decoration: line-through;"),_defineProperty(n,"verbatim","background-color: hsla(0,0%,50%,0.1);font:var(--font-monospaced)"),_defineProperty(n,"^=bold, ^=strong, ^=italic, ^=em, ^=sup, ^=verbatim, ^=strike","font-weight:100; color: hsla(0,0%,0%,0.5)"),_defineProperty(n,"^=collapsed","font-weight:bold; color: hsla(201,100%,30%,1.0);"),_defineProperty(n,"unclosedCollapsed",r(.025)+"font-weight:bold; color: hsla(201,100%,30%,1.0);"),_defineProperty(n,"collapsed",r(.025)),_defineProperty(n,"collapsed.hook",r(.05)),_defineProperty(n,"collapsed.hook-2",r(.1)),_defineProperty(n,"collapsed.hook-3",r(.15)),_defineProperty(n,"collapsed.hook-4",r(.2)),_defineProperty(n,"collapsed.hook-5",r(.25)),_defineProperty(n,"collapsed.hook-6",r(.3)),_defineProperty(n,"collapsed.hook-7",r(.35)),_defineProperty(n,"collapsed.hook-8",r(.4)),_defineProperty(n,"twineLink:not(.text)",t.twineLink),_defineProperty(n,"tag, scriptStyleTag, comment","color: hsla(240,34%,25%,1.0);"),_defineProperty(n,"boolean",t.boolean),_defineProperty(n,"string",t.string),_defineProperty(n,"number",t.number),_defineProperty(n,"variable",t.variable),_defineProperty(n,"tempVariable",t.tempVariable),_defineProperty(n,"hookName",t.hookName),_defineProperty(n,"datatype",t.datatype),_defineProperty(n,"colour",t.colour),_defineProperty(n,"cssTime",t.number),_defineProperty(n,"passageString",t.variable+";text-decoration:underline 1px;"),_defineProperty(n,"tagString",t.variable+";text-decoration:underline 1px dotted;"),_defineProperty(n,"variableOccurrence, hookOccurrence","background: hsla(159,50%,75%,1.0) !important;"),_defineProperty(n,"^=where, ^=via, ^=with, ^=making, ^=each, ^=when",t.lambda+"; font-style:italic;"),_defineProperty(n,"heading","font-weight:bold;"),_defineProperty(n,"hr","background-image: linear-gradient(0deg, transparent, transparent 45%, hsla(0,0%,75%,1.0) 45%, transparent 55%, transparent);"),_defineProperty(n,"align","color: hsla(14,99%,37%,1.0); background-color: hsla(14,99%,87%,0.1);"),_defineProperty(n,"column","color: hsla(204,99%,37%,1.0); background-color: hsla(204,99%,87%,0.1);"),_defineProperty(n,"escapedLine","font-weight:bold; color: hsla(51,100%,30%,1.0);"),_defineProperty(n,"identifier, property, belongingProperty, itsProperty, belongingItProperty, belongingItOperator, possessiveOperator, belongingOperator",t.identifier),_defineProperty(n,"toString",function(){var a=this;return Object.keys(this).reduce(function(e,n){var r;return"toString"!==n&&(r=n.split(", ").map(function e(t){return-1<t.indexOf(".")?t.split(/\./g).map(e).join(""):0===t.indexOf("^=")?"[class^='"+s+t.slice(2)+"']":"."+s+t}),e+=r.join(", ")+"{"+a[n]+"}",a[n].match(i)&&[".theme-dark","[data-app-theme=dark]"].forEach(function(t){e+=r.map(function(e){return t+" "+e}).join(", ")+"{"+a[n].replace(i,function(e,t,n,r,a){return"hsla("+t+","+o(100,1.5*+n)+"%,"+(100-r)+"%,"+a+")"})+"}"})),e},"")}),n+"");"object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports={Colours:t,CSS:a,versionClass:s}:"function"==typeof define&&define.amd&&define("utils/typecolours",[],function(){return{Colours:t,CSS:a,versionClass:s}})}.call(this),define("debugmode/highlight",["jquery","utils","utils/typecolours","macros","lexer"],function(l,e,t,p,n){var f=e.insensitiveName,d=t.versionClass,h=n.lex;return function(e,t,n,r){for(var a=h(e,"",t||"macro"),o=[],i="",s=a,c=a.start;c<a.end;c+=1){var u=a.pathAt(c);u[0]!==s[0]&&(o.length&&(o[o.length-1].textContent=i),i="",s=u,o.push(l("<".concat(r&&n<=c&&c<r?"mark":"span",' class="').concat(function(e){for(var t={},n="",r=0;r<e.length;r+=1){var a=e[r],o=a.type,i=a.text,s=("verbatim"!==o&&"comment"!==o||(n=""),d+o);switch(t[s]=(t[s]||0)+1,1<t[s]&&(s+="-"+t[s]),o){case"text":i.trim()&&e.slice(r+1).reduce(function(e,t){return void 0===e?"macro"===t.type||"hook"!==t.type&&e:e},void 0)&&(s+=" ".concat(d,"error"));break;case"macroName":var c=e[r].text[0];if("_"===c||"$"===c){s+=" ".concat(d,"customMacro ").concat(d+("_"===c?"tempV":"v"),"ariable");break}c=f(e[r].text.slice(0,-1));p.has(c)?s+="-"+p.get(c).returnType.toLowerCase():s+=" ".concat(d,"error")}n+=s+" "}return n}(s),'">'))[0])),i+=a.text[c-a.start]}return o.length&&(o[o.length-1].textContent=i),o}}),define("debugmode/mode",["jquery","utils","utils/naturalsort","state","engine","internaltypes/varref","internaltypes/twineerror","utils/operationutils","utils/renderutils","passages","section","debugmode/panel","debugmode/highlight","utils/typecolours"],function(I,R,M,D,V,L,F,e,t,q,H,z,W,n){var B=e.objectName,$=e.isObject,U=e.toSource,G=e.typeID,X=t.dialog,Y=n.CSS,J=function(e,t){var d=R.escape,i=R.nth,n=R.debounce,r=I(document.documentElement),a=M(),o={darkMode:!0,fadePanel:!0,evalReplay:!0,width:null,maxHeight:400};if(D.hasStorage)try{var s=localStorage.getItem("(Debug Options "+R.options.ifid+")");s&&(o=JSON.parse(s))}catch(e){}function c(){if(D.hasStorage)try{localStorage.setItem("(Debug Options "+R.options.ifid+")",JSON.stringify(o))}catch(e){}}z.defaultMaxHeight=o.maxHeight;function u(e){return n(function(){if(R.options.debug)return e.apply(this,arguments)})}var h=I('<tw-debugger class="'.concat([o.darkMode?"theme-dark":"",o.fadePanel?"fade-panel":""].join(" "),'" style="').concat(o.width?"width:"+o.width+"px":"","\">\n<div class='panel panel-errors' hidden><table></table></div>\n<div class='tabs'></div>\n<label style='user-select:none'>Turns: </label><select class='turns' disabled></select>\n<button class='show-invisibles'>\ud83d\udd0d Debug View</button>\n<button class='show-dom'><span style=\"vertical-align:text-top\"><</span><span style=\"vertical-align:text-bottom\">></span> DOM View</button>\n<button class='close'>\u2716</button>\n<div class='resizer-h'>\n</tw-debugger>")),s=h.find(".tabs"),l=h.find(".show-dom"),p=h.find(".show-invisibles"),f=h.find(".close"),m=h.find(".turns");I(document.documentElement).on("click","tw-expression, tw-error, tw-eval-explanation",n(function(e){var r,a,o,i,u,l,p,f,t=I(e.target).data("evalReplay");function n(){var e,s,c=r[a],t=o.find("tw-eval-explanation").empty(),n=o.find("tw-eval-code");c.toCode||c.toDesc||c.error||c.lambda?(o.find("tw-eval-code").empty().append(W(c.code,"macro",0<a&&c.start,0<a&&c.end+c.diff)),t.append(c.lambda?"":"<code class='".concat(56<c.fromCode.length?"from-block":"from-inline","'></code>"),c.error?"<span> caused an error: </span>":c.lambda?"<span>The lambda <code class='to-lambda'></code> was run, producing these results.</span>":"<span> became".concat(c.ToDesc?"\u2026":""," </span>").concat(c.toDesc?"<span class='to-desc'>".concat(d(c.toDesc),".</span>"):"<code class='to-code'></code>")),c.error?t.append(c.error):c.lambda?(s=function(e,t){return I("<".concat(e,"><code></").concat(e,">")).find("code").append(W(t,"macro")).end()},t.find(".to-lambda").append(W(c.lambda.obj.source,"macro")).end().append((e=I("<table>")).append.apply(e,[I("<tr>").append(s("th","pos"),c.lambda.obj.loop?s("th","_"+c.lambda.obj.loop.getName()).append(" / ",I("<code>").append(W("it","macro"))):s("th","it"),c.lambda.obj.making&&s("th","_"+c.lambda.obj.making.getName()),c.lambda.obj.where&&s("th","where").append(" result"),c.lambda.obj.via&&s("th","via").append(" result"))].concat(_toConsumableArray(c.lambda.loops.map(function(e){var t=e.it,n=e.pos,r=e.making,a=e.whereResult,o=e.whereReplay,i=e.viaResult,e=e.viaReplay;return I("<tr>").append(s("td",U(n)),s("td",U(t)),void 0!==r&&s("td",U(r)),null!=a&&(F.containsError(a)?I("<td>").append(a.render(c.lambda.obj.source,!0)):s("td",U(a))).append(o&&I("<tw-open-button replay label='\ud83d\udd0d'>").data("evalReplay",o)),null!=i&&(F.containsError(i)?I("<td>").append(i.render(c.lambda.obj.source,!0)):s("td",U(i))).append(e&&I("<tw-open-button replay label='\ud83d\udd0d'>").data("evalReplay",e)))})))))):c.toDesc||t.find(".to-code").append(W(c.toCode,"macro")),t.next().html(c.itIdentifier?'(The <code class="cm-harlowe-3-identifier">it</code> identifier now refers to '.concat(d(c.itIdentifier),".)"):"").next().text(c.reason||"")):(n.html(W(c.code,"macro")),t.html("<center>First, there was <code></code>.</center>").next().empty().next().empty()),c.lambda||t.find("code").first().append(W(c.fromCode,"macro")),o.find("mark").each(function(e,t){t.scrollIntoView()}),i.css("visibility",a<=9?"hidden":"visible"),u.css("visibility",a<=0?"hidden":"visible"),p.css("visibility",a>=r.length-1?"hidden":"visible"),f.css("visibility",a>=r.length-10?"hidden":"visible"),l.html("( ".concat(a+1,"/").concat(r.length," )"))}t&&(r=t,t=X({buttons:[{name:"Understood",confirm:!(a=0),callback:function(){return!h.find("tw-backdrop").length&&h.removeClass("show-dialog")}}]}),o=I("<tw-eval-replay>".concat(1===r.length?"":"<tw-eval-code></tw-eval-code>","<tw-eval-explanation></tw-eval-explanation><tw-eval-it></tw-eval-it><tw-eval-reason></tw-eval-reason>").concat(1===r.length?"":"<tw-dialog-links><tw-link style='visibility:hidden'>\u2190 10</tw-link><tw-link style='visibility:hidden'>\u2190 \u2190</tw-link><b></b><tw-link>\u2192 \u2192</tw-link><tw-link>10 \u2192</tw-link></tw-dialog-links>","</tw-eval-replay>")),t.find("tw-dialog").css({width:"75vw","max-width":"75vw"}).prepend(o),i=o.find("tw-link:first-of-type"),u=i.next(),l=u.next(),p=l.next(),f=p.next(),n(),i.on("click",function(){a=Math.max(0,a-10),n()}),u.on("click",function(){a=Math.max(0,a-1),n()}),p.on("click",function(){a=Math.min(r.length-1,a+1),n()}),f.on("click",function(){a=Math.min(r.length-1,a+10),n()}),h.find("tw-backdrop").length?h.find("tw-backdrop").before(t):h.addClass("show-dialog").append(t)),e.stopPropagation()})),h.find(".resizer-h").mousedown(function(e){if(1!==e.which)return!0;e.stopPropagation();var t=e.pageX,n=h.width();r.on("mousemove.debugger-resizer-h",function(e){e=e.pageX;h.width("".concat(n+t-e|0,"px"))}).on("mouseup.debugger-resizer-h",function(){r.off(".debugger-resizer-h"),o.width=h.width(),c()})}),h.on("mousedown",".resizer-v",function(e){if(1!==e.which)return!0;e.stopPropagation();var t=e.pageY,n=I(e.target.parentNode).height();r.on("mousemove.debugger-resizer-v",function(e){e=e.pageY;h.find(".panel").css("maxHeight","".concat(n+t-(0|e),"px"))}).on("mouseup.debugger-resizer-v",function(){r.off(".debugger-resizer-v"),o.maxHeight=h.find(".panel").css("maxHeight"),c()})}),p.click(function(){r.toggleClass("debug-mode").removeClass("dom-debug-mode"),p.toggleClass("enabled"),l.removeClass("enabled")}),l.click(function(){r.toggleClass("dom-debug-mode").removeClass("debug-mode"),l.toggleClass("enabled"),p.removeClass("enabled")}),f.click(function(){r.removeClass("debug-mode dom-debug-mode"),h.detach(),R.options.debug=!1});function y(e){(e=e.parents(".variable-row, .enchantment-row, .source-row")).next(".panel-row-source").find("td").empty().append(W(e.data("value")||U(e.data("enchantment").changer),e.is("source-row")?"markup":"macro"))}function g(){return T=new Set}function v(){I(document.body).append(h),R.options.debug=!0,R.options.evalReplay=o.evalReplay,P()}var b,w=u(function(){var r=m.children().get(),e=D.timeline,a=0;e.forEach(function(e,t){var n=e.turns,e=e.passage,n=(a+=1+(void 0===n?0:n))+": "+e;r[t]?r[t].textContent=n:m.append("<option value='"+t+"'>"+n+"</option>")}),e.length<r.length&&I(r.slice(e.length)).remove(),m[1<=e.length?"removeAttr":"attr"]("disabled"),m.val(D.pastLength)}),T=(m.change(function(e){e=e.target.value-D.pastLength;0!=e&&(D[e<0?"rewind":"fastForward"](Math.abs(e)),V.showPassage(D.passage))}),w(),D.on("forward",w).on("load",w).on("forgetUndos",function(){return w}).on("back",function(){D.pastLength<=1&&m.attr("disabled"),m.find("[selected]").removeAttr("selected"),m.val(D.pastLength)}),new Set),k=z.create({className:"variables",tabName:"Variable",rowWrite:function(e,t){var n=e.name,r=e.dataset,a=e.path,o=e.value,i=e.tempScope,e=e.type,s=o&&48<o.length&&!o.TwineScript_DebugName,c=$(o)&&o.TwineScript_DebugName?o.TwineScript_DebugName():d(B(o)),u="",r=(a.length&&(u=a.reduce(function(e,t){return e+t+"'s "},"")),r&&(n="???"),e?U(e):""),e="object"===_typeof(o)||s;return t?(t.find(".variable-type").html(r||""),u&&t.find(".variable-path").html((i?"_":"$")+d(u)),t.find(".variable-name").contents().last().replaceWith(I.parseHTML((u?"":i?"_":"$")+d(n+""))),t.find(".temporary-variable-scope").html(i||""),t.find(".variable-value").html(c),t.find("tw-folddown")[e?"show":"hide"](),(s=t.next(".panel-row-source")).is(":visible")&&s.find("td").empty().append(W(U(o))),t.data("value",U(o)),t.add(s)):I('<div class="variable-row">').attr("data-name",n).attr("data-path",a+"").attr("data-scope",i||"").css("padding-left",Math.min(5,a.length)+"em").append("<td class='variable-type'>"+(r||"")+"</td>","<td class='variable-name cm-harlowe-3-"+(i?"tempV":"v")+"ariable'><span class='variable-path'>"+(u?(i?"_":"$")+d(u):"")+"</span> "+(u?"":i?"_":"$")+d(n+"")+"</td>","<td class='temporary-variable-scope'>"+(i||"")+"</td>","<td class='variable-value cm-harlowe-3-macroName-"+G(o)+"'>"+c+"</td><td class='panel-row-buttons'><tw-folddown tabindex=0 style='display:"+(e?"visible":"none")+"'>(source:) </tw-folddown></td>").data("value",U(o)).find("tw-folddown").data("folddown",y).end().add("<tr class='variable-row panel-row-source' style='display:none'><td colspan='5'></td></tr>")},rowCheck:function(e,t){var n=e.name,r=e.path,e=e.tempScope;return t.attr("data-name")===n&&t.attr("data-path")===r+""&&t.attr("data-scope")===e},columnHead:function(){return'<tr class="panel-head"><th data-col="variable-type">Type</th><th data-col="variable-name">Name</th><th data-col="temporary-variable-scope">Scope</th><th data-col="variable-value">Value</th></tr>'},rowSort:function(e,t,n){if("variable-value"===e)return a(t.attr("class"),n.attr("class"))||a(t.parent().data("value"),n.parent().data("value"))}}),S=u(function(){var e,o=[],t=D.variables,n=o.length;for(e in t)e.startsWith("TwineScript")||(n+=1,function n(e){var r,t,a;500<o.length||(o.push(e),r=e.path.concat(e.name),t=e.value,a=e.tempScope,r.length<=4&&(Array.isArray(t)?t.forEach(function(e,t){return n({name:i(t+1),path:r,value:e,tempScope:a})}):t instanceof Map?_toConsumableArray(t).forEach(function(e){var t=(e=_slicedToArray(e,2))[0],e=e[1];return n({name:t,path:r,value:e,tempScope:a})}):t instanceof Set&&_toConsumableArray(t).forEach(function(e,t){return n({name:t,dataset:!0,path:r,value:e,tempScope:a})})))}({name:e,path:[],value:t[e],tempScope:"",type:t.TwineScript_TypeDefs&&t.TwineScript_TypeDefs[e]}));o.push.apply(o,_toConsumableArray(T)),n+=T.size,k.update(o,n),k.panel[(n?"remove":"add")+"Class"]("panel-variables-empty")}),x=(L.on("set",function(e,t,n){var r,a;e!==D.variables&&e.TwineScript_VariableStoreName&&!e.TwineScript_VariableStoreName.match(/#\d+$/)&&(r=e.TwineScript_VariableStoreName,e=e.TwineScript_TypeDefs&&e.TwineScript_TypeDefs[t],(a=_toConsumableArray(T).find(function(e){return e.name===t&&e.tempScope===r}))?a.value=n:T.add({name:t,path:[],value:n,tempScope:r,type:e})),S(),b()}).on("delete",function(){S(),b()}),k.panel.append("<div class='panel-variables-bottom'>\n\t\t\t<button class='panel-variables-copy'>Copy $ variables as (set:) call</button>\n\t\t\t<input class='clipboard' type=\"text\" style='opacity:0;pointer-events:none;position:absolute;'></input>\n\t\t</div>").removeAttr("hidden"),k.tab.addClass("enabled"),k.panel.find(".clipboard")),O=(r.on("click",".panel-variables-copy",function(){var e,t=[];for(e in D.variables)e.startsWith("TwineScript")||t.push("$"+e+" to "+U(D.variables[e]));x.val("(set:"+t+")")[0].select(),document.execCommand("copy")}),z.create({className:"enchantments",tabName:"Enchantment",rowWrite:function(e,t){var n=e.scope,r=e.changer,a=e.name,o=e.localHook,a=r?d(B(r)):"<em>enchanted via ("+a+":)</em>";return t||I('<div class="enchantment-row">').data("enchantment",e).append("<td><span class='enchantment-name'>"+U(n)+(o?"</span><span class='enchantment-local cm-harlowe-3-hookName'>"+("function"==typeof o.TwineScript_ToSource?o.TwineScript_ToSource():o.attr("name")?"?"+o.attr("name"):"an unnamed hook"):"")+"</span></td><td class='enchantment-value cm-harlowe-3-macroName-"+(r?"changer":"command")+" '>"+a+"</td>"+(r?"<td class='panel-row-buttons'><tw-folddown tabindex=0>(source:)</tw-folddown></td>":"")).find("tw-folddown").data("folddown",y).end().add(r?I("<tr class='panel-row-source' style='display:none'><td colspan='3'></td></tr>"):"")},rowCheck:function(e,t){return t.data("enchantment")===e},columnHead:function(){return'<tr class="panel-head"><th data-col="enchantment-name">Scope</th><th data-col="enchantment-value">Value</th></div>'}})),f=u(function(e){O.update(e.enchantments,e.enchantments.length)}),_=(H.on("add",f).on("remove",f),H.create()),C=z.create({className:"storylets",tabName:"Storylet",rowWrite:function(e,t){var n=e.name,r=e.active,a=e.storyletSource,o=e.exclusive,e=e.urgent;if(t)return t[(r?"remove":"add")+"Class"]("storylet-closed"),t.find(".storylet-open").text(r?"\u2713":""),t;t=I('<tr class="storylet-row '.concat(r?"":"storylet-closed",'">')).attr("data-name",n).append("<td class='storylet-open'>"+(r?"\u2713":"")+"</td><td class='storylet-name'>"+n+"</td><td class='storylet-lambda'></td><td class='storylet-exclusive'>"+o+"</td><td class='storylet-urgent'>"+e+"</td>");return t.find(".storylet-lambda").append(W(a.replace(/^when\s+/i,""))),t},rowCheck:function(e,t){e=e.name;return t.attr("data-name")===d(e+"")},columnHead:function(){return'<tr class="panel-head"><th data-col="storylet-open" data-order="desc">Open</th><th data-col="storylet-name">Name</th><th data-col="storylet-lambda">Condition</th><th data-col="storylet-exclusive" class=\'storylet-exclusive\'>Exclusivity</th><th data-col="storylet-urgent" class=\'storylet-urgent\'>Urgency</th></tr>'}}),E=(C.tab.hide(),b=u(function(){var r,a,o=q.getStorylets(_),i=F.containsError(o),e=q.allStorylets();C.update(e.map(function(t){var e="number"==typeof t.get("exclusivity")?t.get("exclusivity"):0,n="number"==typeof t.get("urgency")?t.get("urgency"):0;return r=r||e,a=a||e,{name:t.get("name"),storyletSource:t.get("storylet").TwineScript_ToSource(),active:!i&&o.some(function(e){return e.get("name")===t.get("name")}),exclusive:e,urgent:n}}),i?0:o.length),C.panel[(i?"add":"remove")+"Class"]("storylet-error"),C.panel[(r?"add":"remove")+"Class"]("panel-exclusive"),C.panel[(a?"add":"remove")+"Class"]("panel-urgent"),e.length&&C.tab.show()}),z.create({className:"source",tabName:"Source",tabNameCounter:!1,rowWrite:function(e,t){var n=e.name,e=e.tag;if(t)return t.add(t.next(".panel-row-source"));t=q.get(n).get("source");return I('<div class="source-row" data-tag="'.concat(e,'">')).data("value",t).append('<td class="source-name">'.concat(n,'</td><td class="source-tags">').concat(e,"</td><td class='panel-row-buttons'><tw-folddown class='").concat(e?"":"open","' tabindex=0></tw-folddown></td>")).find("tw-folddown").data("folddown",y).end().add(I("<tr class='panel-row-source' style='".concat(e?"display:none":"","'><td colspan='3'></td></tr>")).find("td").append(!e&&W(t,"markup")).end())},rowCheck:function(e,t){e=e.name;return t.find(".source-name").text()===d(e+"")},tabUpdate:I.noop,columnHead:I.noop})),A=["debug-startup","startup","header","debug-header","footer","debug-footer"].reduce(function(e,t){return e.concat(q.getTagged(t).map(function(e){return{name:e.get("name"),tag:t}}))},[]),j=z.create({className:"errors",tabName:"Error",rowWrite:I.noop,rowCheck:I.noop,columnHead:I.noop,tabUpdate:function(e){return j.tab.css({background:e?"rgba(230,101,204,0.3)":""}).text("".concat(e," Error").concat(1!==e?"s":""))}}),f=n(function(e){var t;R.options.debug&&(j.panelRows.append(e.reduce(function(e,t){var t=_slicedToArray(t,2),n=t[0],t=t[1];return"propagated"===n.type?e:e+'<tr class="error-row"><td class="error-passage">'+D.passage+'</td><td class="error-message" title="'+d(t)+'">'+n.message+"</td></tr>"},"")),500<(t=(e=j.panelRows.children()).length)&&I(Array.prototype.slice.call(j.panelRows[0].childNodes,0,t-500)).remove(),j.tabUpdate(Math.min(500,e.length)))},{batch:!0}),N=(F.on(f),j.panel.append("<div class='panel-errors-bottom'>\n\t\t\t<button class='panel-errors-clean'>\ud83e\uddf9 Clear this panel</button>\n\t\t</div>"),r.on("click",".panel-errors-clean",function(){j.panelRows.empty(),j.tabUpdate(0)}),z.create({className:"options",tabName:"\u2699\ufe0f",tabNameCounter:!1,rowWrite:function(e,t){var n=e.name,e=e.label,r={darkMode:o.darkMode,fadePanel:o.fadePanel,evalReplay:o.evalReplay}[n];return t?t.find("input").prop("checked",r):I('<span><input id="debug-'.concat(n,'" type="checkbox" ').concat(r?"checked":"",'></input><label for="debug-').concat(n,'">').concat(e,"</label></span>"))},rowCheck:I.noop,tabUpdate:I.noop,columnHead:I.noop})),P=(r.on("click",'.panel-options [type="checkbox"]',function(e){var e=e.target,t=(e=I(e)).attr("id"),e=e.is(":checked");"debug-darkMode"===t&&(o.darkMode=e,h[(e?"add":"remove")+"Class"]("theme-dark")),"debug-fadePanel"===t&&(o.fadePanel=e,h[(e?"add":"remove")+"Class"]("fade-panel")),"debug-evalReplay"===t&&(R.options.evalReplay=o.evalReplay=e),c()}),N.update([{name:"darkMode",label:"Debug panel is dark"},{name:"fadePanel",label:"Debug panel is transparent unless the cursor is over it"},{name:"evalReplay",label:"Record expression replays (viewable via \ud83d\udd0d buttons in Debug View; slower)"}]),h.prepend(k.panel,O.panel,j.panel,C.panel,E.panel,N.panel),s.prepend(k.tab,O.tab,j.tab,C.tab,E.tab,N.tab),D.on("beforeForward",g).on("beforeBack",g).on("beforeLoad",g),u(function(){S(),b(),O.panelRows.empty(),O.tabUpdate(0),D.passage&&q.get(D.passage)&&(E.update(A.concat({name:D.passage,tag:""})),E.panel.find('[data-tag=""], [data-tag=""] + .panel-row-source').insertBefore(E.panel.find('[data-tag="footer"]').first()))}));D.on("forward",P).on("back",P).on("load",P);J=v,I(document.head).append(I("<style>").html(Y)),v(),e&&f(e,t)};return V.registerDebugMode(function(e,t){return!R.options.debug&&J(e,t)}),J}),define("macrolib/values",["macros","state","utils","utils/operationutils","datatypes/colour","datatypes/gradient","datatypes/datatype","datatypes/hookset","datatypes/codehook","internaltypes/twineerror"],function(t,r,e,n,u,c,a,o,i,d){var s=e.realWhitespace,l=e.nth,p=e.anyRealLetter,f=e.plural,h=n.subset,m=n.objectName,y=n.clone,g=n.toSource,e=t.TypeSignature,n=e.rest,v=e.zeroOrMore,b=e.either,w=e.optional,T=e.insensitiveSet,k=e.numberRange,S=e.percent,x=e.nonNegativeInteger,O=e.positiveInteger,e=e.Any,_=Math.max,C=Math.min,E=Math.round,A=Math.floor,j=Math.ceil;function N(t){return function(){var e=t.apply(void 0,arguments);return"number"!=typeof e||isNaN(e)?d.create("macrocall","This mathematical expression doesn't compute!"):e}}t.add(["str","string","text"],"String",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.map(function(e){return i.isPrototypeOf(e)?e.source:e}).join("")},[v(t.TypeSignature.either(String,Number,Boolean,Array,i))])("source","String",function(e,t){return t&&"command"===t.TwineScript_TypeID&&!t.TwineScript_ToSource?d.create("datatype","I can't construct the source code of a command created by a custom macro."):g(t)},[e])("substring","String",function(e,t,n,r){return h(t,n,r)},[String,parseInt,parseInt])("lowercase","String",function(e,t){return t.toLowerCase()},[String])("uppercase","String",function(e,t){return t.toUpperCase()},[String])("lowerfirst","String",function(e,t){return t.replace(RegExp(p+"+"),function(e){return(e=Array.from(e))[0].toLowerCase()+e.slice(1).join("").toLowerCase()})},[String])("upperfirst","String",function(e,t){return t.replace(RegExp(p+"+"),function(e){return(e=Array.from(e))[0].toUpperCase()+e.slice(1).join("").toLowerCase()})},[String])("words","Array",function(e,t){return t.split(RegExp(s+"+")).filter(Boolean)},[String])(["str-repeated","string-repeated"],"String",function(e,t,n){return 0===n.length?d.create("macrocall","I can't repeat an empty string."):n.repeat(t)},[x,String])(["str-reversed","string-reversed"],"String",function(e,t){return _toConsumableArray(t).reverse().join("")},[String])("joined","String",function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];return r.join(t)},[n(String)])("plural","String",function(e,t,n,r){return n&&""!==r?f(t,n,r):d.create("macrocall","The (plural:) macro can't be given empty strings.")},[parseInt,String,w(String)])(["str-nth","string-nth"],"String",function(e,t){return l(t)},[parseInt])("digit-format","String",function(e,t,n){if(1e21<=Math.abs(n))return d.create("macrocall","The number given to (digit-format:) is too big.");for(var r=/([^#0])(?=[#0]*$)/g,a=(r.exec(t)||[])[1],o=(/^[#0]*([^#0])/g.exec(t)||[])[1],i=(t=_toConsumableArray(t)).length,s=(a&&(","!==a||o&&","!==o)&&(i=r.lastIndex-1),Math.abs(n).toFixed(16).replace(/(\.\d*?)0+$/,function(e,t){return t}).replace(/^0+/,"")),c=s.includes(".")?s.indexOf("."):s.length,u=0,l="",p=t.length-1;0<=p;--p){var f=t[p];"0"===f||"#"===f?l=(s[c-i+p+u]||("0"===f?"0":""))+l:p<t.length-1&&0<p&&(l=f+l,u+=p===i?0:1)}return(n<0?"-":"")+l},[String,Number])(["num","number"],"Number",function(e,t){return Number.isNaN(+t)?d.create("macrocall","I couldn't convert "+m(t)+" to a number."):+t},[String])("datatype","Datatype",function(e,t){return a.from(t)},[e])("datapattern","Any",function(e,t){return function n(e){var r;return Array.isArray(e)?r=e.map(n):e instanceof Map?(r=new Map,_toConsumableArray(e).forEach(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];return r.set(t,n(e))})):r=a.from(e),(e=d.containsError(r))?e:r}(t)},[e])(["rgb","rgba"],"Colour",function(e){return u.create({r:arguments.length<=1?void 0:arguments[1],g:arguments.length<=2?void 0:arguments[2],b:arguments.length<=3?void 0:arguments[3],a:arguments.length<=4?void 0:arguments[4]})},[k(0,255),k(0,255),k(0,255),w(S)])(["hsl","hsla"],"Colour",function(e,t,n,r,a){return(t=E(t)%360)<0&&(t+=360),u.create({h:t,s:n,l:r,a:a})},[Number,S,S,w(S)])(["lch","lcha"],"Colour",function(e,t,n,r,a){return(r=E(r)%360)<0&&(r+=360),u.create({l:t,c:n,h:r,a:a})},[S,k(0,132),Number,w(S)])("complement","Colour",function(e,t){return t.LCHRotate(180)},[u])("mix","Colour",function(e,t,n,r,a){n=n.toLCHA(),a=a.toLCHA();var o=1,i=(t+r!==1&&(t+r<1&&(o=t+r),t=(i=[t/(t+r),r/(t+r)])[0],r=i[1]),n.c<2||n.l<.01||.99<n.l?n.h=a.h:(a.c<2||a.l<.01||.99<a.l)&&(a.h=n.h),n.l*=n.a,n.c*=n.a,a.l*=a.a,a.c*=a.a,180<a.h-n.h?n.h+=360:a.h-n.h<-180&&(a.h+=360),n.a*t+a.a*r),s=(n.l*t+a.l*r)/i,c=(n.c*t+a.c*r)/i,n=(n.h*t+a.h*r)/i;return u.create({l:s,c:c,h:n,a:i*o})},[S,u,S,u])("palette","Array",function(e,t,n){var r,a=n.toLCHA(),o=a.l,a={l:o<=.75?.75+o/3:.75-3*(1-o),c:80,h:a.h,a:1},i=u.create(a);return a.l+=o<=.75?-.1:.1,a.l<.5&&(a.l*=.5/a.l),r=u.create(a),a.l+=o<=.85?.15:-.15,o=u.create(a),"adjacent"===t?(r=(i=i.LCHRotate(-30)).LCHRotate(30),o=i.LCHRotate(60)):"triad"===t&&(o=i.LCHRotate(180),r=i.LCHRotate(140),i=i.LCHRotate(-140)),[n,i,r,o]},[T("mono","adjacent","triad"),u])("gradient","Gradient",function(e,t){(t=E(t)%360)<0&&(t+=360);for(var n,r=arguments.length,a=new Array(2<r?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];if(a.length<4)return d.create("datatype","(gradient:) must be given at least 2 colour-stop pairs of numbers and colours.");var i=[],s=a.reduce(function(e,t){if(!d.containsError(e))if(void 0===n)n=t;else{if("number"!=typeof n||!u.isPrototypeOf(t))return d.create("datatype","(gradient:) colour-stops should be pairs of numbers and colours, not colours and numbers.");i.push({stop:n,colour:y(t)}),n=void 0}return e},!0);return d.containsError(s)?s:void 0!==n?d.create("macrocall","This gradient has a colour-stop percent without a colour."):c.create(t,i)},[Number,n(b(S,u))])("stripes","Gradient",function(e,t,n){(t=E(t)%360)<0&&(t+=360);for(var r=0,a=[],o=arguments.length,i=new Array(3<o?o-3:0),s=3;s<o;s++)i[s-3]=arguments[s];return i.forEach(function(e){a.push({stop:r,colour:y(e)}),r+=n,a.push({stop:r,colour:y(e)})}),c.create(t,a,!0)},[Number,O,u,n(u)])("hooks-named","HookName",function(e,t){return t?o.create({type:"name",data:t}):d.create("datatype","(hooks-named:) can't be given an empty string.")},[String])("cond","Any",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var a=0;a<n.length;a+=2){var o=n[a];if(a===n.length-1||d.containsError(o))return o;if("boolean"!=typeof o)return d.create("datatype","(cond:)'s "+l(a+1)+" value is "+m(o)+", but should be a boolean.");if(o)return n[a+1]}return d.create("macrocall","An odd number of values must be given to (cond:), not "+n.length,"(cond:) must be given one or more pairs of booleans and values, as well as one final value.")},[Boolean,e,n(e)]);({weekday:[function(){return["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"][(new Date).getDay()]+"day"},null],monthday:[function(){return(new Date).getDate()},null],currenttime:[function(){var e=new Date,t=e.getHours()<12;return(e.getHours()%12||12)+":"+((e.getMinutes()<10?"0":"")+e.getMinutes())+" "+(t?"A":"P")+"M"},null],currentdate:[function(){return(new Date).toDateString()},null],min:[C,n(Number)],max:[_,n(Number)],abs:[Math.abs,Number],sign:[Math.sign,Number],sin:[Math.sin,Number],cos:[Math.cos,Number],tan:[Math.tan,Number],floor:[A,Number],round:[E,Number],trunc:[function(e){return(0<e?A:j)(e)},Number],ceil:[j,Number],pow:[N(Math.pow),[Number,Number]],exp:[Math.exp,Number],sqrt:[N(Math.sqrt),Number],log:[N(Math.log),Number],log10:[N(Math.log10),Number],log2:[N(Math.log2),Number],random:[function(e,t){var n,t=t?(n=C(e,t),_(e,t)):(n=0,e);return t+=1,~~(r.random()*(t-n))+n},[parseInt,t.TypeSignature.optional(parseInt)]],"":function(){for(var e in this)e&&hasOwnProperty.call(this,e)&&t.add(e,"Number",function(a){return function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return a.apply(void 0,n)}}(this[e][0]),this[e][1])}})[""](),t.add("either","Any",function(e){var t=1+~~(r.random()*(arguments.length<=1?0:arguments.length-1));return t<1||arguments.length<=t?void 0:arguments[t]},n(e))("nth","Any",function(e,t){return t<=0?d.create("datatype","(nth:)'s first value should be a positive whole number, not "+t):(t=(t-1)%(arguments.length<=2?0:arguments.length-2)+2)<2||arguments.length<=t?void 0:arguments[t]},[parseInt,n(e)])}),define("macrolib/commands",["jquery","macros","utils","state","passages","engine","internaltypes/twineerror","internaltypes/twinenotifier","datatypes/assignmentrequest","datatypes/hookset","datatypes/codehook","datatypes/colour","datatypes/gradient","internaltypes/varref","datatypes/typedvar","datatypes/varbind","utils/operationutils","utils/renderutils"],function(l,n,g,c,u,a,v,D,e,o,t,p,f,i,s,b,r,d){var h=r.printBuiltinValue,m=r.objectName,y=r.clone,w=r.toSource,T=d.dialog,k=d.geomParse,V=d.geomStringRegExp,r=n.TypeSignature,d=r.Any,L=r.Everything,S=r.rest,x=r.either,O=r.optional,_=r.zeroOrMore,F=r.percent,q=r.nonNegativeInteger,C=r.positiveInteger,r=r.positiveNumber,E=Object.assign,A=Math.floor,j=Math.ceil,N=Math.abs,H=Math.max,z=Math.min,P=l.noop;function I(e){return"("+e+" "+g.options.ifid+") "}["set","put","unpack"].forEach(function(r){return n.add(r,"Instant",function(e){for(var t=0;t<(arguments.length<=1?0:arguments.length-1);t+=1){var n=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];if("into"===n.operator&&"set"===r)return v.create("macrocall","Please say 'to' when using the (set:) macro.");if("to"===n.operator&&"set"!==r)return v.create("macrocall","Please say 'into' when using the (put:) or (unpack:) macro.");if((i.isPrototypeOf(n.dest)||s.isPrototypeOf(n.dest))===("unpack"===r))return v.create("macrocall","unpack"===r?"Please use the (unpack:) macro with arrays, datamaps or (p:) patterns containing variables to the right of 'into'.":"Please use the ("+r+":) macro with just single variables and typed variables to the "+("set"===r?"left of 'to'.":"right of 'into'."),"You may wish to change this to the (".concat("unpack"!==r?"unpack":"to"===n.operator?"set":"put",":) macro."));n=n.set();if(v.containsError(n))return n}return{TwineScript_TypeID:"instant",TwineScript_TypeName:"a ("+r+":) operation",TwineScript_ObjectName:"a ("+r+":) operation",TwineScript_Unstorable:!0,TwineScript_Print:function(){return g.options.debug,""}}},[S(e)])}),n.add("move","Instant",function(e){for(var t=0;t<(arguments.length<=1?0:arguments.length-1);t+=1){var n=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];if("into"!==n.operator)return v.create("macrocall","Please say 'into' when using the (move:) macro.");n=n.set(!0);if(v.containsError(n))return n}return{TwineScript_TypeID:"instant",TwineScript_TypeName:"a (move:) operation",TwineScript_ObjectName:"a (move:) operation",TwineScript_Unstorable:!0,TwineScript_Print:function(){return g.options.debug,""}}},[S(e)]),n.addCommand("display",function(e){if(!u.hasValid(e))return v.create("macrocall","I can't (display:) the passage '"+e+"' because it doesn't exist.")},function(e,t,n){return e.source=u.getTree(n),e},[String])("print",P,function(e,t,n){return E(e,{source:h(n)})},[d])(["verbatim-print","v6m-print"],P,function(e,t,n){return E(e,{verbatim:!0,source:h(n)})},[d])(["verbatim-source","v6m-source"],function(e){if(e&&"command"===e.TwineScript_TypeID&&!e.TwineScript_ToSource)return v.create("datatype","I can't construct the source code of a command created by a custom macro.")},function(e,t,n){return E(e,{verbatim:!0,source:h(w(n))})},[d])("go-to",function(e){if(!u.hasValid(e))return v.create("macrocall","I can't (go-to:) to the passage '".concat(e,"' because it doesn't exist."),"Check that you didn't mistype the passage name, or rename the passage to something else.")},function(e,t,n){return requestAnimationFrame(function(){return a.goToPassage(n,{transition:e.data.passageT8n})}),{blocked:!0}},[String])("redirect",function(e){if(!u.hasValid(e))return v.create("macrocall","I can't (redirect:) to the passage '".concat(e,"' because it doesn't exist."),"Check that you didn't mistype the passage name, or rename the passage to something else.")},function(e,t,n){return requestAnimationFrame(function(){return a.redirect(n,{transition:e.data.passageT8n})}),{blocked:!0}},[String])("undo",P,function(e,t,n){return c.pastLength<1?E(e,{source:n}):(requestAnimationFrame(function(){return a.goBack({transition:e.data.passageT8n})}),{blocked:!0})},[O(String)])("debug",P,a.enableDebugMode,[],!1),g.onStartup(function(){return g.storyElement.on("click.icon","tw-icon",function(e){var t=l(this),n=t.data("clickEvent"),r=t.attr("alt");n&&n(t),"Undo"===r&&(e.stopPropagation(),a.goBack()),"Redo"===r&&(e.stopPropagation(),a.goForward()),"Fullscreen"===r&&(e.stopPropagation(),a.toggleFullscreen()),"Restart"===r&&(c.hasSessionStorage&&sessionStorage.removeItem("Saved Session"),window.location.reload())})}),[["Undo","↶",function(){return 0<c.pastLength}],["Redo","↷",function(){return 0<c.futureLength}],["Fullscreen","⛶",function(){return document.fullscreenEnabled||document.msFullscreenEnabled}],["Restart","⟲",Object]].forEach(function(e){var e=_slicedToArray(e,3),o=e[0],i=e[1],s=e[2];n.addCommand("icon-".concat(o.toLowerCase()),function(e,t){if("string"==typeof e&&"string"==typeof t)return e=_toConsumableArray(e).length,t=_toConsumableArray(t).length,1<e&&1<t?v.create("datatype","One of the two strings given to (icon-".concat(o.toLowerCase(),":) should be 1 character long, for its icon.")):1===e&&1===t?v.create("datatype","One of the two strings given to (icon-".concat(o.toLowerCase(),":) should be 2 or more characters long, for its label.")):void 0},function(t,e,n,r){var a;return("string"==typeof r&&1===_toConsumableArray(r).length||"string"==typeof n&&1<_toConsumableArray(n).length)&&(n=(a=[r,n])[0],r=a[1]),"Undo"===o&&(t.data.forgetUndosEvent=function(e){t.section.whenUnblocked(function(){return l(e).css("visibility","hidden")})}),E(t,{source:'<tw-icon tabindex=0 alt="'.concat(o,'" ').concat(r?'data-label="'.concat(r.replace('"',"""),'"'):"",' title="').concat(o,'" ').concat(s()?"":'style="visibility:hidden"',">").concat(n||i,"</tw-icon>")})},[O(String),O(String)])}),n.addCommand("icon-counter",function(e,t,n){var r=" label string given to (icon-counter:) can't be empty or only whitespace.";return t&&t.trim()?"string"!=typeof n||n.trim()?void 0:v.create("datatype","The 2nd "+r):v.create("datatype","The 1st "+r)},function(r,e,a,o,i){r.attr.push({"data-2bind":!0}),r.data.twoWayBindEvent=function(e,t,n){a.varRef.matches(t,n)&&"number"==typeof(t=a.varRef.get())&&r.target.children("tw-icon").text((0<t?A:j)(t)).attr("data-label",1!==N(t)&&void 0!==i?i:o)};var t=a.varRef.get();return"number"!=typeof t?v.create("datatype","(icon-counter:) can only be bound to a variable holding a number, not ".concat(m(t),".")):E(r,{source:'<tw-icon data-label="'.concat(g.escape(1!==N(t)&&void 0!==i?i:o),'">').concat((0<t?A:j)(t),"</tw-icon>")})},[b,String,O(String)]),n.addCommand("meter",function(e,t,n,r){return"two way"===e.bind?v.create("datatype","(meter:) shouldn't be given two-way bound variables.",'Change the "2bind" keyword to just "bind".'):"string"!=typeof r||r.trim()?-1===n.search(V)||!n.includes("=")&&1<n.length?v.create("datatype",'The (meter:) macro requires a sizing line("==X==", "==X", "=XXXX=" etc.) be provided, not '+JSON.stringify(n)+"."):void 0:v.create("datatype","The label string given to (meter:) can't be empty or only whitespace.")},function(r,e,a,n,t,o,i){o&&"string"!=typeof o&&(i=o,o=void 0),i=i||p.create({h:0,s:0,l:.5,a:.5}),p.isPrototypeOf(i)&&(i=f.create(90,[{colour:i,stop:0},{colour:i,stop:1}]));function s(e){var t=H(0,z(1,e/n)),e=i.repeating?i:i.multiply(n/e);return"height:100%;background-repeat:no-repeat;background-image:".concat((u?E(e,e.repeating?{}:{angle:270}).toLinearGradientString()+", ":"")+E(e,e.repeating?{}:{angle:u||0===c?90:270}).toLinearGradientString(),";background-size:").concat(u?Array(2).fill(50*t+"%"):100*t+"%",";background-position-x:").concat(u?-100/(2-t)+100+"%,"+100/(2-t)+"%":0===c?"left":"right",";text-align:").concat(u?"center":0===c?"left":"right")}var t=k(t),c=t.marginLeft,t=t.size,u=0<c&&Math.ceil(c+t)<100,l=(r.styles.push({"margin-left":c+"%",width:t+"%",height:"1.5em",display:"block"}),r.attr.push({"data-2bind":!0}),o&&e.stackTop.tempVariables),t=(r.data.twoWayBindEvent=function(e,t,n){a.varRef.matches(t,n)&&"number"==typeof(t=a.varRef.get())&&((n=r.target.children("tw-meter")).attr("style",s(t)),o&&r.section.renderInto("",null,{source:o,target:n,append:"replace",transitionDeferred:!1},l))},a.varRef.get());return"number"!=typeof t?v.create("datatype","(meter:) can only be bound to a variable holding a number, not ".concat(m(t),".")):E(r,{source:'<tw-meter style="'.concat(s(t),'">').concat(o||"","</tw-meter>")})},[b,r,String,O(x(String,p,f)),O(x(p,f))]),[["cycling-link"],["seq-link","sequence-link"]].forEach(function(t,l){return n.addCommand(t,function(){return""===(arguments.length<=0?void 0:arguments[0])?v.create("datatype","The first string in a ("+t[0]+":) can't be empty."):arguments.length<=(b.isPrototypeOf(arguments.length<=0?void 0:arguments[0])?2:1)?v.create("datatype","I need two or more strings to "+(l?"sequence":"cycle")+" through, not just '"+((e=arguments.length-1)<0||arguments.length<=e?void 0:arguments[e])+"'."):void 0;var e},function(a,e){for(var o,t=arguments.length,i=new Array(2<t?t-2:0),n=2;n<t;n++)i[n-2]=arguments[n];b.isPrototypeOf(i[0])&&(o=i.shift());var s=0,c=(o&&"two way"===o.bind&&(a.attr.push({"data-2bind":!0}),-1<(u=i.indexOf(o.varRef.get()))&&(s=u)),e.stackTop.tempVariables);function r(e,t){var n=s>=i.length-1&&l,r=""===i[s]?"":n?i[s]:"<tw-link>"+i[s]+"</tw-link>";if(n&&(a.data.clickEvent=void 0),o&&!t){n=o.set(i[s]);if(v.containsError(n))return void e.replaceWith(n.render(i[s]))}t=E({},a,{source:r,transitionDeferred:!1});a.section.renderInto("",null,t,c)}i[s]&&(a.data.clickEvent=function(e){s=(s+1)%i.length,r(e,!1)})&&(a.data.twoWayBindEvent=function(e,t,n){o.varRef.matches(t,n)&&(t=o.varRef.get(),-1<(n=i.indexOf(t))&&n!==s&&(s=n,r(e,!0)))});var u="<tw-link>"+i[s]+"</tw-link>";if(o){e=o.set(i[s]);if(v.containsError(e))return e}return E(a,{source:u,append:"replace",transitionDeferred:!0})},[x(b,String),S(String)])}),g.onStartup(function(){return g.storyElement.on("change.dropdown-macro","select",function(){var e=l(this),t=e.closest("tw-expression, tw-hook").data("dropdownEvent");t&&t(e)})}),n.addCommand("dropdown",function(e){var t;return""===(arguments.length<=1?void 0:arguments[1])||""===((t=(arguments.length<=1?0:arguments.length-1)-1+1)<1||arguments.length<=t?void 0:arguments[t])?v.create("datatype","The first or last strings in a (dropdown:) can't be empty.","Because empty strings create separators within (dropdown:)s, having them at the start or end doesn't make sense."):(arguments.length<=1?0:arguments.length-1)<=1?v.create("datatype","I need two or more strings to create a (dropdown:) menu, not just "+(arguments.length<=1?0:arguments.length-1)+"."):void 0},function(e,t,r){for(var n=arguments.length,a=new Array(3<n?n-3:0),o=3;o<n;o++)a[o-3]=arguments[o];var i=0,s=("two way"===r.bind&&(e.attr.push({"data-2bind":!0}),-1<(c=a.indexOf(r.varRef.get()))&&(i=c)),Math.max.apply(Math,_toConsumableArray(a.map(function(e){return _toConsumableArray(e).length})))),c="<select>"+a.map(function(e,t){return"<option"+(t===i?" selected":"")+(""===e?" disabled":"")+">"+g.escape(e||"\u2500".repeat(s))+"</option>"}).join("\n")+"</select>",u=(e.data.dropdownEvent=function(e){var t=e.val(),n=r.set(t);v.containsError(n)&&e.replaceWith(n.render(t))},e.data.twoWayBindEvent=function(e,t,n){r.varRef.matches(t,n)&&(t=r.varRef.get(),-1<(n=a.indexOf(t))&&n!==i&&(e.find("select").val(t),i=n))},e.styles.push({"background-color":function(){return g.parentColours(l(this)).backgroundColour}}),r.set(a[i]));return v.containsError(u)?u:E(e,{source:c,append:"replace"})},[b,String,S(String)]),g.onStartup(function(){return g.storyElement.on("input.checkbox-macro","input[type=checkbox]",function(){var e=l(this),t=e.closest("tw-expression").data("checkboxEvent");t&&t(e)})});function R(e){return["I can't use a dialog macro in "+e+".","Please rewrite this without putting such macros here."]}var M=1;n.addCommand("checkbox",function(){},function(e,t,r,n){var a=!1,o="checkbox-"+ ++M,i=("two way"===r.bind&&(e.attr.push({"data-2bind":!0}),"boolean"==typeof(i=r.varRef.get())&&(a=i),e.data.twoWayBindEvent=function(e,t,n){r.varRef.matches(t,n)&&"boolean"==typeof(t=r.varRef.get())&&e.children("input[type=checkbox]").prop("checked",t)}),e.data.checkboxEvent=function(e){var t=e.is(":checked"),t=r.set(t);v.containsError(t)&&e.replaceWith(t.render(""))},r.set(a));return v.containsError(i)?i:E(e,{source:'<input id="'.concat(o,'" type="checkbox" ').concat(a?"checked":"",'><label for="').concat(o,'">').concat(n,"</label>"),append:"replace"})},[b,String]),g.onStartup(function(){return l(document).on("fullscreenchange",function(){l("input[type=checkbox][id^=fullscreen]",g.storyElement).each(function(e,t){(l(t).closest("tw-expression").data("fullscreenEvent")||Object)(t)})})}),n.addCommand("checkbox-fullscreen",function(){},function(e,t,n){var r="fullscreenCheckbox-"+ ++M;return e.data.fullscreenEvent=function(e){return l(e).prop("checked",!(!document.fullscreenElement&&!document.msFullscreenElement))},e.data.checkboxEvent=function(){return a.toggleFullscreen()},E(e,{source:'<input id="'.concat(r,'" type="checkbox" ').concat(document.fullscreenEnabled||document.msFullscreenEnabled?" ":"disabled ").concat(document.fullscreenElement||document.msFullscreenElement?"checked":"",'><label for="').concat(r,'">').concat(n,"</label>"),append:"replace"})},[String]),g.onStartup(function(){return g.storyElement.on("input.input-box-macro","textarea, input[type=text]",function(){var e=l(this),t=e.closest("tw-expression").data("inputBoxEvent");t&&t(e)})}),["input","force-input","input-box","force-input-box"].forEach(function(y){return n.addCommand(y,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=y.endsWith("box"),a=b.isPrototypeOf(t[0]),o="string"==typeof t[+a],r=r&&"number"==typeof t[o+a],i=o?t[+a]:t[a+r],s=0<k(i).size,o=s?t[a+r+o]:i;return y.startsWith("force")&&"string"!=typeof o?v.create("datatype","The (".concat(y,":) macro requires a string of text to forcibly input.")):t.length>a+r+s+("string"==typeof o)?v.create("datatype","An incorrect combination of values was given to this (".concat(y,":) macro.")):void 0},function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];var o=y.startsWith("force"),i=y.endsWith("box"),s=b.isPrototypeOf(r[0]),c="string"==typeof r[+s],u=i&&"number"==typeof r[c+s],l=s&&r[0],p=u?r[1+s]:3,f=c?k(r[+s]):{},d=f.marginLeft,f=f.size,h=(f?r[s+u+c]:c&&r[+s])||"",u=o?"":h,c=!1;if("two way"===l.bind){e.attr.push({"data-2bind":!0});s=l.varRef.get();if("string"==typeof s){u=o?h.slice(0,s.length):s,s=l.set(u),c=!0;if(v.containsError(s))return s}e.data.twoWayBindEvent=function(e,t,n){l.varRef.matches(t,n)&&"string"==typeof(t=l.varRef.get())&&e.find(i?"textarea":"input").val(o?h.slice(0,t.length):t)}}if(l&&!c){s=l.set(o?"":h);if(v.containsError(s))return s}!o&&l&&(e.data.inputBoxEvent=function(e){var t=e.val(),t=l.set(t);v.containsError(t)&&e.replaceWith(t.render(""))});var m,c="<".concat(i?"textarea":"input type=text",' style="width:100%" ').concat(i?"rows=".concat(p,">"):'value="').concat(g.escape(u)).concat(i?"</textarea>":'">');return o&&(m=Array.from(h),e.data.inputBoxEvent=function(e){var t=e.val().length,t=m.slice(0,t).join("");return e.val(t),l&&(t=l.set(t),v.containsError(t)&&e.replaceWith(t.render(""))),!0}),e.styles.push({display:"block","margin-left":f?d+"%":void 0,width:f?f+"%":"100%","border-style":function(){return this.style.borderStyle||"solid"}}),E(e,{source:c,append:"replace"})},y.endsWith("box")?[x(b,String),O(x(C,String)),O(x(C,String)),O(String)]:[O(x(b,String)),O(String),O(String)])}),["show","rerun"].forEach(function(s){return n.addCommand(s,function(){for(var r,e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.some(function e(t){var n=t.selector,t=t.next;return"name"===n.type&&"page"===n.data?(r=v.create("macrocall","You can't (hide:) the ?page. Sorry."),!0):!!("base"===n.type&&e(n.data)||t&&e(t))||void 0}),r},function(o,i){for(var e=arguments.length,t=new Array(2<e?e-2:0),n=2;n<e;n++)t[n-2]=arguments[n];return t.forEach(function(e){return e.forEach(i,function(e){var t,n,r,a=e.data("hidden");void 0!==a!=("rerun"===s)&&(e.removeData("hidden"),a instanceof l?e.empty().append(a):(a=e.data("tempVariables"),n=(t="tw-passage"===e.tag())?u.getTree(c.passage):e.data("originalSource")||"",t&&(r=e.find("tw-sidebar").detach()),i.renderInto("",null,E({},o,{append:"replace",source:n,target:e}),a&&Object.create(a)),r&&e.prepend(r)))})}),o},[S(o)])});n.addCommand("hide",function(){for(var r,e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.some(function e(t){var n=t.selector,t=t.next;return"name"===n.type&&"page"===n.data?(r=v.create("macrocall","You can't (hide:) the ?page. Sorry."),!0):!!("base"===n.type&&e(n.data)||t&&e(t))||void 0}),r},function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var a=0,o=n;a<o.length;a++)o[a].forEach(e,function(e){Boolean(e.data("hidden"))||e.data("hidden",e.contents().detach())})},[S(o)],!1)("scroll",P,function(f,e,d){var h="number"==typeof d&&d;requestAnimationFrame(function(){e.forEach(f,function(e){if(!1!==h)e[0].scrollTo&&e[0].scrollTo(0,(e[0].scrollHeight-e[0].clientHeight)*h);else{var t,n=_createForOfIteratorHelper(d.hooks(f).get());try{for(n.s();!(t=n.n()).done;){var r=t.value;if(e.find(r)){for(var a=[],o=e[0];o=o.parentNode;)a.push([o,o.scrollLeft,o.scrollTop]);r.scrollIntoView();for(var i=0,s=a;i<s.length;i++){var c=_slicedToArray(s[i],3),u=c[0],l=c[1],p=c[2];u.scrollLeft=l,u.scrollTop=p}break}}}catch(e){n.e(e)}finally{n.f()}}})})},[o,x(F,o)],!1)("stop",P,P,[],!1)("load-game",P,function(e,t){if(e.loadedGame)return v.create("infinite","I can't use (load-game:) immediately after loading a game.");var n,r=localStorage.getItem(I("Saved Game")+t);return r?(r=c.deserialise(e,r))instanceof Error?{blocked:n=T({message:"Sorry to interrupt... The story tried to load saved data, but there was a problem.\n"+r.message+"\n\nThat data might have been saved from a different version of this story. Should I delete it?\n(Type 'delete' and choose Yes to delete it.)\n\nEither way, the story will now continue without loading the data.",defaultValue:"",buttons:[{name:"Yes",confirm:!0,callback:function(){"delete"===n.find("input").last().val()&&localStorage.removeItem(I("Saved Game")+t),e.unblock("")}},{name:"No",cancel:!0,callback:function(){return e.unblock()}}]})}:void requestAnimationFrame(a.showPassage.bind(a,c.passage,{loadedGame:!0})):v.create("saving","I can't find a save slot named '"+t+"'!")},[String],!1)("forget-undos",P,function(e,t){c.futureLength||c.forgetUndos(t)},[parseInt],!1)("forget-visits",P,function(e,t){c.forgetVisits(t)},[parseInt],!1)("mock-visits",function(){if(!g.options.debug)return v.create("debugonly","(mock-visits:) cannot be used outside of debug mode.");for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.find(function(e){return!u.hasValid(e)});return r?v.create("datatype","I can't mock-visit '"+r+"' because no passage with that name exists."):void 0},function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];c.mockVisits=y(n)},[S(String)],!1)("mock-turns",function(){if(!g.options.debug)return v.create("debugonly","(mock-turns:) cannot be used outside of debug mode.")},function(e,t){c.mockTurns=t},[q],!1)("seed",P,function(e,t){c.setSeed(t)},[String],!1)(["dialog","alert"],function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];if(b.isPrototypeOf(e)){if("two way"===e.bind)return v.create("datatype","(dialog:) shouldn't be given two-way bound variables.",'Change the "2bind" keyword to just "bind".');if(void 0===t)return v.create("datatype","(dialog:) needs a message string or codehook to display.")}else void 0!==t&&r.unshift(t);e=r.findIndex(function(e){return""===e});if(-1<e)return v.create("datatype","(dialog:)'s ".concat(g.nth(e+1)," link text shouldn't be an empty string."))},function(e,t,n,r){for(var a=arguments.length,o=new Array(4<a?a-4:0),i=4;i<a;i++)o[i-4]=arguments[i];return b.isPrototypeOf(n)||(void 0!==r&&o.unshift(r),r=n,n=void 0),o.length||(o=["OK"]),{blocked:T({section:t,message:r,cd:e,buttons:o.map(function(e){return{name:e,callback:function(){t.unblock(n&&n.set(e)||"")}}})})}},[x(b,String,t),O(x(t,String)),_(String)])("open-url",P,function(e,t){window.open(t,"")},[String],!1)(["restart","reload"],P,function(){if(c.turns<=1)return v.create("infinite","I mustn't (restart:) the story in the starting passage.");c.hasSessionStorage&&sessionStorage.removeItem("Saved Session"),window.location.reload()},[],!1)("goto-url",P,function(e,t){window.location.assign(t)},[String],!1)("ignore",P,P,[_(L)])("assert-exists",function(e){if(""===e)return v.create("datatype","(assert-exists:) mustn't be given an empty string.")},function(e,t,n){var r=0;return("string"==typeof n?o.create({type:"string",data:n}):n).forEach(t,function(){++r}),r?e:v.create("assertion","I didn't see any ".concat("string"==typeof n?"text occurrences of":"hooks matching"," ").concat(w(n)," in this passage."))},[x(o,String)]),n.add("assert","Instant",function(e,t){return t?{TwineScript_TypeID:"instant",TwineScript_TypeName:"an (assert:) operation",TwineScript_ObjectName:"an (assert:) operation",TwineScript_Unstorable:!0,TwineScript_Print:function(){return""}}:E(v.create("assertion","An assertion failed: "),{appendTitleText:!0})},[Boolean])("save-game","Boolean",function(e,t,n){if(n=n||"",!c.hasStorage)return!1;var r=c.serialise(!1).pastAndPresent;if(v.containsError(r))return r;if(!1===r)return!1;try{return localStorage.setItem(I("Saved Game")+t,r),localStorage.setItem(I("Saved Game Filename")+t,n),!0}catch(e){return!1}},[String,O(String)])("prompt","String",function(e,t,n,r,a){if(e.stackTop&&e.stackTop.evaluateOnly)return v.create.apply(v,["macrocall"].concat(_toConsumableArray(R(e.stackTop.evaluateOnly))));if(""===a)return v.create("datatype","The text for (prompt:)'s confirm link can't be blank.");var o=T({section:e,message:t,defaultValue:n,buttons:[{name:a||"OK",confirm:!0,callback:function(){return e.unblock(o.find("input").last().val())}}].concat(""===r?[]:{name:r||"Cancel",cancel:!0,callback:function(){return e.unblock(n)}})});return e.stackTop.blocked=o,setTimeout(function(){return o.find("input").last().focus()},100),0},[x(String,t),String,O(String),O(String)])("confirm","Boolean",function(e,t,n,r){if(e.stackTop&&e.stackTop.evaluateOnly)return v.create.apply(v,["macrocall"].concat(_toConsumableArray(R(e.stackTop.evaluateOnly))));if(""===r)return v.create("datatype","The text for (confirm:)'s confirm link can't be blank.");t=T({section:e,message:t,defaultValue:!1,buttons:[{name:r||"OK",confirm:!0,callback:function(){return e.unblock(!0)}}].concat(""===n?[]:{name:n||"Cancel",cancel:!0,callback:function(){return e.unblock(!1)}})});return e.stackTop.blocked=t,0},[x(String,t),O(String),O(String)])("page-url","String",function(){return window.location.href},[])}),define("macrolib/datastructures",["utils","utils/naturalsort","macros","utils/operationutils","state","engine","passages","datatypes/lambda","datatypes/typedvar","internaltypes/twineerror"],function(e,i,t,n,o,r,a,c,s,u){var l=e.permutations,p=e.options,f=n.objectName,d=n.subset,h=n.collectionType,m=n.isValidDatamapName,y=n.is,g=n.unique,v=n.clone,b=n.range,e=t.TypeSignature,n=e.optional,w=e.rest,T=e.either,k=e.zeroOrMore,S=e.Any,e=e.nonNegativeInteger,x=i("en");t.add(["a","array"],"Array",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n},k(T(s,S)))("range","Array",function(e,t,n){return b(t,n)},[parseInt,parseInt])("subarray","Array",function(e,t,n,r){return d(t,n,r)},[Array,parseInt,parseInt])("reversed","Array",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reverse().map(v)},k(S))("shuffled","Array",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return o.shuffled.apply(o,n).map(v)},[k(S)])("sorted","Array",function(e){for(var t,n=arguments.length,r=new Array(1<n?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];if(!c.isPrototypeOf(r[0]))return(t=r.filter(function(e){return"string"!=typeof e&&"number"!=typeof e}))&&t.length?1===t.length&&Array.isArray(t[0])?u.create("macrocall","Please give multiple numbers or strings to (sorted:), not a single array.","You can use the spread ... syntax to spread out the array's values into (sorted:)."):u.create("datatype","If (sorted:) isn't given a 'via' lambda, it must be given only numbers and strings, not ".concat(f(t[0]),".")):r.sort(x);var o=r.shift();if("making"in o||"where"in o||"when"in o||!("via"in o))return u.create("datatype","The optional lambda given to (sorted:) must be a 'via' lambda, not ".concat(f(o),"."));for(var i=0;i<r.length;i+=1){var s=o.apply(e,{loop:r[i],pos:i+1});if(u.containsError(s))return s;if("string"!=typeof s&&"number"!=typeof s)return u.create("datatype",'The "via" lambda given to (sorted:) couldn\'t convert '.concat(f(r[i])," into a string or number."));r[i]=[r[i],s]}return r.sort(function(e,t){return x(e[1],t[1])}).map(function(e){return e[0]})},[k(S)])("rotated","Array",function(e,t){if(0===t)return u.create("macrocall","I can't rotate these values by 0 positions.");for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];t=-1*(t=Math.abs(t)%r.length*Math.sign(t));return r.slice(t).concat(r.slice(0,t)).map(v)},[parseInt,k(S)])("rotated-to","Array",function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];t=t.filter(e,r);if(u.containsError(t))return t;if(!t.length)return u.create("macrocall","None of these "+r.length+" values matched the lambda, so I can't rotate them.");e=r.indexOf(t[0]);return r.slice(e).concat(r.slice(0,e)).map(v)},[c.TypeSignature("where"),w(S)])("repeated","Array",function(e,t){for(var n=[],r=arguments.length,a=new Array(2<r?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];if(!a.length)return n;for(;0<t--;)n.push.apply(n,a);return n.map(v)},[e,w(S)])("interlaced","Array",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var a=Math.min.apply(Math,_toConsumableArray(n.map(function(e){return e.length}))),o=[],i=0;i<a;i+=1)for(var s=0;s<n.length;s+=1)o.push(v(n[s][i]));return o},[Array,w(Array)])("permutations","Array",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.length?l.apply(void 0,n):[]},[k(S)])("unique","Array",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.filter(g)},[k(S)])("altered","Array",function(n,r){for(var e=arguments.length,t=new Array(2<e?e-2:0),a=2;a<e;a++)t[a-2]=arguments[a];return t.map(function(e,t){t=r.apply(n,{loop:e,pos:t+1});return null===t?e:t})},[T(c.TypeSignature("via"),c.TypeSignature("where","via")),k(S)])("find","Array",function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];return t.filter(e,r)},[c.TypeSignature("where"),k(S)])(["all-pass","pass"],"Boolean",function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];t=t.filter(e,r);return u.containsError(t)||t.length===r.length},[c.TypeSignature("where"),k(S)])("some-pass","Boolean",function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];t=t.filter(e,r);return u.containsError(t)||0<t.length},[c.TypeSignature("where"),k(S)])("none-pass","Boolean",function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];t=t.filter(e,r);return u.containsError(t)||0===t.length},[c.TypeSignature("where"),k(S)])("folded","Any",function(r,a){for(var e=arguments.length,t=new Array(2<e?e-2:0),n=2;n<e;n++)t[n-2]=arguments[n];return"where"in a&&(t=a.filter(r,t)),u.containsError(t)||t.reduce(function(e,t,n){return a.apply(r,{making:e,loop:t,pos:n+1})})},[T(c.TypeSignature("where","via","making"),c.TypeSignature("via","making")),w(S)])(["dm-names","datamap-names","datanames"],"Array",function(e,t){return Array.from(t.keys()).sort(i("en"))},[Map])(["dm-values","datamap-values","datavalues"],"Array",function(e,t){return Array.from(t.entries()).sort(i("en",function(e){return String(e[0])})).map(function(e){return v(e[1])})},[Map])(["dm-entries","datamap-entries","dataentries"],"Array",function(e,t){return Array.from(t.entries()).sort(function(e,t){return[e[0],t[0]].sort(i("en"))[0]===e[0]?-1:1}).map(function(e){return new Map([["name",e[0]],["value",v(e[1])]])})},[Map])(["dm-altered","datamap-altered"],"Datamap",function(a,o,e){return Array.from(e.entries()).sort(function(e,t){return[e[0],t[0]].sort(i("en"))[0]===e[0]?-1:1}).reduce(function(e,t,n){if(!u.containsError(e)){var r=new Map([["name",t[0]],["value",v(t[1])]]),r=o.apply(a,{loop:r,pos:n+1});if(u.containsError(r))return r;e.set(t[0],null===r?t[1]:r)}return e},new Map)},[T(c.TypeSignature("via"),c.TypeSignature("where","via")),Map])("history","Array",function(e,t){var n=o.history();if(!t)return n;t=t.filter(e,n.map(function(e){return a.get(e)}));return u.containsError(t)?t:t.map(function(e){return e.get("name")})},[n(c.TypeSignature("where"))])("visited","Boolean",function(e,t){if("string"==typeof t)return a.has(t)?0<o.passageNameVisited(t)||o.passage===t:u.create("macrocall","There's no passage named '"+t+"' in this story.");var n=o.history(),n=t.filter(e,n.concat(o.passage).map(function(e){return a.get(e)}));return u.containsError(n)?n:0<n.length},[T(String,c.TypeSignature("where"))])("passage","Datamap",function(e,t){return v(a.get(t||o.passage))||u.create("macrocall","There's no passage named '"+t+"' in this story.")},[n(String)])("passages","Array",function(e,t){var n=i("en"),r=_toConsumableArray(a.values()).map(function(e){return v(e)}),t=t?t.filter(e,r):r,e=u.containsError(t);return e||t.sort(function(e,t){return n(e.get("name"),t.get("name"))})},[n(c.TypeSignature("where"))])("open-storylets","Array",function(e,t){if(e.stackTop.evaluateOnly)return u.create("macrocall","(open-storylets:) can't be used in "+e.stackTop.evaluateOnly+".");e=a.getStorylets(e,t),t=u.containsError(e);return t||e.map(v)},[n(c.TypeSignature("where"))])("savedgames","Datamap",function(){function e(e){return"("+e+" "+p.ifid+") "}var t,n=0,r=new Map;do{if(!o.hasStorage)break;t=localStorage.key(n),n+=1;var a=e("Saved Game")}while(t&&t.startsWith(a)&&(t=t.slice(a.length),r.set(t,localStorage.getItem(e("Saved Game Filename")+t))),t);return r},[])(["datamap","dm"],"Datamap",function(e){for(var r,a=new Map,t=arguments.length,n=new Array(1<t?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=n.reduce(function(e,t){var n;if(!u.containsError(e))if(void 0===r)r=t;else{if(n=u.containsError(m(a,r)))return n;if(a.has(r))return u.create("macrocall","You used the same data name ("+f(r)+") twice in the same (datamap:) call.");a.set(r,v(t)),r=void 0}return e},!0);return u.containsError(i)?i:void 0!==r?u.create("macrocall","This datamap has a data name without a value."):a},k(T(s,S)))(["dataset","ds"],"Dataset",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new Set(n.filter(g).map(v))},k(S))("count","Number",function t(n,r){for(var e,a,o=arguments.length,i=new Array(2<o?o-2:0),s=2;s<o;s++)i[s-2]=arguments[s];if(1<i.length)return a=i.map(function(e){return t(n,r,e)}),(e=u.containsError(a))?e:a.reduce(function(e,t){return e+t},0);var c=i[0];switch(h(r)){case"dataset":case"datamap":return u.create("macrocall","(count:) shouldn't be given a datamap or dataset.","You should use the 'contains' operator instead. For instance, write: $variable contains 'value'.");case"string":return"string"!=typeof c?u.create("macrocall",f(r)+" can't contain "+f(c)+" because it isn't also a string."):c?r.split(c).length-1:0;case"array":return r.reduce(function(e,t){return e+y(t,c)},0);default:return u.create("macrocall",f(r)+" can't contain values, let alone "+f(c)+".")}},[S,w(S)])}),define("macrolib/stylechangers",["jquery","macros","utils","utils/renderutils","datatypes/colour","datatypes/hookset","datatypes/gradient","datatypes/changercommand","datatypes/lambda","internaltypes/changedescriptor","internaltypes/twineerror"],function(s,e,c,t,a,n,r,o,i,u,l){var p,f,d=t.geomParse,h=t.geomStringRegExp,m=Object.assign,t=e.TypeSignature,y=t.either,g=t.wrapped,v=t.optional,b=t.Any,w=t.Everything,T=t.zeroOrMore,k=t.rest,S=t.insensitiveSet,x=t.positiveNumber,O=t.positiveInteger,_=t.nonNegativeNumber,t=t.percent,g=[g(Boolean,'If you gave a number, you may instead want to check that the number is not 0. If you gave a string, you may instead want to check that the string is not "".')],C=(c.onStartup(function(){return c.storyElement.on("mouseenter.hover-macro","[hover=false]",function(){var e=s(this),t=e.data("hoverChanger");e.data({mouseoutStyle:e.attr("style")||""}),u.create({target:e},t).update(),e.attr("hover",!0)}).on("mouseleave.hover-macro","[hover=true]",function(){var e=s(this),t=e.data("mouseoutStyle");e.attr("style",t).removeData("mouseoutStyle").attr("hover",!1)})}),l.on(function(){s("tw-expression, tw-hook",c.storyElement).each(function(e,t){((t=s(t)).data("errorEvent")||Object)(t)})}),S("instant","dissolve","fade","rumble","shudder","pulse","zoom","flicker","slideleft","slideright","slideup","slidedown","fadeleft","faderight","fadeup","fadedown","blur")),E=S("dotted","dashed","solid","double","groove","ridge","inset","outset","none");e.addChanger("if",function(e,t){return o.create("if",[t])},function(e,t){return e.enabled=e.enabled&&t},g)("unless",function(e,t){return o.create("unless",[t])},function(e,t){return e.enabled=e.enabled&&!t},g)("elseif",function(e,t){return"lastHookShown"in e.stack[0]?o.create("elseif",[!1===e.stack[0].lastHookShown&&!!t]):l.create("macrocall","There's no (if:) or something else before this to do (else-if:) with.")},function(e,t){return e.enabled=e.enabled&&t},g)("else",function(e){return"lastHookShown"in e.stack[0]?o.create("else",[!1===e.stack[0].lastHookShown]):l.create("macrocall","There's nothing before this to do (else:) with.")},function(e,t){return e.enabled=e.enabled&&t},null)("hidden",function(){return o.create("hidden")},function(e){return e.enabled=!1},null)(["verbatim","v6m"],function(){return o.create("verbatim")},function(e){return e.verbatim=!0},null)("live",function(e,t){return o.create("live",t?[t]:[])},function(e,t){e.enabled=!1,e.transitionDeferred=!0,e.data.live={delay:t}},v(Number))("event",function(e,t){return o.create("event",[t])},function(e,t){e.enabled=!1,e.transitionDeferred=!0,e.data.live={event:t}},i.TypeSignature("when"))("more",function(){return o.create("more")},function(e){e.enabled=!1,e.transitionDeferred=!0,e.data.live={event:{when:!0,filter:function(e){return 0!==e.Identifiers.exits?[]:[!0]}}}},null)("after",function(e,t,n){return o.create("after",[t].concat(void 0!==n?[n]:[]))},function(e,t,n){e.enabled=!1,e.transitionDeferred=!0,e.data.live={event:{when:!0,filter:function(e){return c.anyInputDown()&&n&&(t-=n),e.Identifiers.time>t?[!0]:[]}}}},[x,v(_)])("after-error",function(){return o.create("after-error",[])},function(n){n.enabled=!1,n.transitionDeferred=!0;var r=n.section.stackTop.tempVariables;n.data.errorEvent=function(e){e.removeData("errorEvent");var t=m({},n,{enabled:!0,transitionDeferred:!1});t.data&&(t.data.errorEvent=void 0),n.section.whenUnblocked(function(){return n.section.renderInto("",null,t,r)})}},[])("hook",function(e,t){if(!t)return l.create("datatype","The string given to (hook:) was empty.");var n=c.insensitiveName(t);return n?o.create("hook",[n]):l.create("datatype",'The string given to (hook:), "'.concat(t,'", contained only dashes and underscores.'))},function(e,t){return e.attr.push({name:t})},[String])(["for","loop"],function(e,t){if(!t.loop)return l.create("datatype","The lambda provided to (for:) must refer to a temp variable, not just 'it'.");for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];return o.create("for",[t].concat(r))},function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];var o,i=t.filter(e.section,r);if(o=l.containsError(i))return o;e.loopVars[t.loop.getName()]=i||[]},[i.TypeSignature("where"),T(b)])(["transition","t8n"],function(e,t){return o.create("transition",[c.insensitiveName(t)])},function(e,t){return"zoom"===(e.transition=t)&&(e.transitionOrigin=function(){var e=s(this).offset(),t=e.left,e=e.top;return c.mouseCoords.x-t+"px "+(c.mouseCoords.y-e)+"px"}),e},[C])(["transition-time","t8n-time"],function(e,t){return o.create("transition-time",[t])},function(e,t){return e.transitionTime=t,e.data.passageT8n=m(e.data.passageT8n||{},{time:t}),e},[x])(["transition-delay","t8n-delay"],function(e,t){return o.create("transition-delay",[t])},function(e,t){return e.transitionDelay=t,e},[_])(["transition-skip","t8n-skip"],function(e,t){return o.create("transition-skip",[t])},function(e,t){return e.transitionSkip=t,e},[x])(["transition-depart","t8n-depart"],function(e,t){return o.create("transition-depart",[c.insensitiveName(t)])},function(e,t){return e.data.passageT8n=m(e.data.passageT8n||{},{depart:t}),"zoom"===t&&(e.data.passageT8n.departOrigin=function(){var e=s(this).offset(),t=e.left,e=e.top;return c.mouseCoords.x-t+"px "+(c.mouseCoords.y-e)+"px"}),e},[C])(["transition-arrive","t8n-arrive"],function(e,t){return o.create("transition-arrive",[c.insensitiveName(t)])},function(e,t){return e.data.passageT8n=m(e.data.passageT8n||{},{arrive:t}),"zoom"===t&&(e.data.passageT8n.arriveOrigin=function(){var e=s(this),t=e.offset(),n=t.left,t=t.top,r=e.height();return{"transform-origin":100*(c.mouseCoords.x-n)/e.width()+"% "+100*(c.mouseCoords.y-t)/r+"%",height:r+"px"}}),e},[C])("button",function(e,t){return void 0===t||d(t).size?o.create("button",t?[t]:[]):l.create("datatype",'The string given to (button:) should be a sizing line ("==X==", "==X", "=XXXX=" etc.), not '.concat(JSON.stringify(t),"."))},function(e,t){var t=d(t),n=t.marginLeft,t=t.size;return e.attr.push({class:function(){return this.className+(this.classList.contains("enchantment-button")?"":" ".repeat(0<this.className.length)+"enchantment-button")}}),e.styles.push({"margin-left":t?n+"%":void 0,width:t?t+"%":"100%"}),e},[v(String)]).apply(void 0,_toConsumableArray((f={click:{className:"enchantment-link",blockClassName:"enchantment-clickblock"},doubleclick:{className:"enchantment-dblclick",blockClassName:"enchantment-dblclickblock"},mouseover:{className:"enchantment-mouseover",blockClassName:"enchantment-mouseoverblock"},mouseout:{className:"enchantment-mouseout",blockClassName:"enchantment-mouseoutblock"}},["action",function(e,t){return o.create("action",[c.insensitiveName(t)])},function(e,t){return e.attr.push({class:function(){var e=function e(t){return(t=s(t)).is("tw-story, tw-sidebar, tw-passage")||["block","flex"].includes(t.css("display"))||t.children().get().some(e)}(this);return Array.from(this.classList).filter(function(t){return!Object.keys(f).some(function(e){return f[e].className===t||f[e].blockClassName===t})}).concat(f[t][e?"blockClassName":"className"]).join(" ")}}),e},[S.apply(void 0,_toConsumableArray(Object.keys(f)))]])))(["border","b4r"],function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return o.create("border",n.map(c.insensitiveName))},function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.styles.push({display:function(){var e=s(this).css("display");return n.every(function(e){return"none"===e})||!e.includes("inline")?e:"inline-block"},"border-style":n.join(" "),"border-width":function(){return this.style.borderWidth||"2px"}}),e},[E].concat(_toConsumableArray(Array(3).fill(v(E)))))(["border-size","b4r-size"],function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return o.create("border-size",n)},function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.styles.push({"border-width":n.map(function(e){return e+"px"}).join(" ")}),e},[_].concat(_toConsumableArray(Array(3).fill(v(_)))))("corner-radius",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return o.create("corner-radius",n)},function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.styles.push({"border-radius":n.map(function(e){return e+"px"}).join(" "),padding:function(){return this.style.padding||n.map(function(e){return e+"px"}).join(" ")}}),e},[_].concat(_toConsumableArray(Array(3).fill(v(_)))))(["border-colour","b4r-colour","border-color","b4r-color"],function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return o.create("border-colour",n.map(function(e){return a.isPrototypeOf(e)?e.toRGBAString(e):e}))},function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.styles.push({"border-color":n.join(" ")}),e},[y(String,a)].concat(_toConsumableArray(Array(3).fill(v(y(String,a))))))("opacity",function(e,t){return o.create("opacity",[t])},function(e,t){return e.styles.push({opacity:t})},[t])("font",function(e,t){return o.create("font",[t])},function(e,t){return e.styles.push({"font-family":t}),e},[String])("align",function(e,t){var n=t.indexOf("><");return/^(==+>|<=+|=+><=+|<==+>)$/.test(t)?((n=~n?(n=Math.round(n/(t.length-2)*50),m({"text-align":"center","max-width":"50%"},25===n?{"margin-left":"auto","margin-right":"auto"}:{"margin-left":n+"%"})):"<"===t[0]&&">"===t.slice(-1)?{"text-align":"justify","max-width":"50%"}:t.includes(">")?{"text-align":"right"}:{"text-align":"left"}).display="inline-block",o.create("align",[n])):l.create("datatype",'The (align:) macro requires an alignment arrow ("==>", "<==", "==><=" etc.) be provided, not "'+t+'"')},function(e,t){e.styles.push(t)},[String])(["text-colour","text-color","color","colour"],function(e,t){return o.create("text-colour",[t])},function(e,t){return a.isPrototypeOf(t)&&(t=t.toRGBAString(t)),e.styles.push({color:t}),e},[y(String,a)])(["text-size","size"],function(e,t){return o.create("text-size",[t])},function(e,t){return e.styles.push({"font-size":24*t+"px","line-height":36*t+"px"}),e},[_])("text-indent",function(e,t){return o.create("text-indent",[t])},function(e,t){return e.styles.push({"text-indent":t+"px",display:"inline-block"}),e},[_])(["text-rotate-z","text-rotate"],function(e,t){return o.create("text-rotate-z",[t])},function(e,t){return e.styles.push({display:"inline-block",transform:function(){var e=s(this).css("transform")||"";return(e="none"===e?"":e)+" rotate("+t+"deg)"}}),e},[Number])("text-rotate-y",function(e,t){return o.create("text-rotate-y",[t])},function(e,t){return e.styles.push({display:"inline-block",transform:function(){var e=s(this).css("transform")||"";return(e="none"===e?"":e)+" perspective(50vw) rotateY("+t+"deg)"}}),e},[Number])("text-rotate-x",function(e,t){return o.create("text-rotate-x",[t])},function(e,t){return e.styles.push({display:"inline-block",transform:function(){var e=s(this).css("transform")||"";return(e="none"===e?"":e)+" perspective(50vw) rotateX("+t+"deg)"}}),e},[Number])(["background","bg"],function(e,t){return o.create("background",[t])},function(e,t){return a.isPrototypeOf(t)?t=t.toRGBAString():r.isPrototypeOf(t)&&(t=t.toLinearGradientString()),t=a.isHexString(t)||a.isCSS3Function(t)?{"background-color":t}:t.startsWith("linear-gradient(")||t.startsWith("repeating-linear-gradient(")?{"background-image":t}:{"background-size":"cover","background-image":"url(".concat(t,")"),"background-attachment":"fixed"},e.styles.push(t,{display:function(){var e=s(this);return!e.children().length||c.childrenProbablyInline(e)?s(this).css("display"):"block"}}),e},[y(String,a,r)]).apply(void 0,_toConsumableArray((g={color:function(){return"transparent"}},p=m(Object.create(null),{none:{},bold:{"font-weight":"bold"},italic:{"font-style":"italic"},underline:{"text-decoration":"underline"},doubleunderline:{"text-decoration":"underline","text-decoration-style":"double"},wavyunderline:{"text-decoration":"underline","text-decoration-style":"wavy"},strike:{"text-decoration":"line-through"},doublestrike:{"text-decoration":"line-through","text-decoration-style":"double"},wavystrike:{"text-decoration":"line-through","text-decoration-style":"wavy"},superscript:{"vertical-align":"super","font-size":".83em"},subscript:{"vertical-align":"sub","font-size":".83em"},blink:{animation:"fade-in-out 1s steps(1,end) infinite alternate"},shudder:{animation:"shudder linear 0.1s 0s infinite"},mark:{"background-color":"hsla(60, 100%, 50%, 0.6)"},condense:{"letter-spacing":"-0.08em"},expand:{"letter-spacing":"0.1em"},outline:[{"text-shadow":function(){var e=s(this).css("color");return"-1px -1px 0 "+e+", 1px -1px 0 "+e+",-1px 1px 0 "+e+", 1px 1px 0 "+e}},{color:function(){return c.parentColours(s(this)).backgroundColour}}],shadow:{"text-shadow":function(){return"0.08em 0.08em 0.08em "+s(this).css("color")}},emboss:{"text-shadow":function(){return"0.04em 0.04em 0em "+s(this).css("color")}},smear:[{"text-shadow":function(){var e=s(this).css("color");return"0em 0em 0.02em "+e+",-0.2em 0em 0.5em "+e+", 0.2em 0em 0.5em "+e}},g],blur:[{"text-shadow":function(){return"0em 0em 0.08em "+s(this).css("color")}},g],blurrier:[{"text-shadow":function(){return"0em 0em 0.2em "+s(this).css("color")},"user-select":"none"},g],mirror:{display:"inline-block",transform:"scaleX(-1)"},upsidedown:{display:"inline-block",transform:"scaleY(-1)"},tall:{display:"inline-block",transform:"scaleY(1.5) translateY(-0.25ex)"},flat:{display:"inline-block",transform:"scaleY(0.5) translateY(0.25ex)"},fadeinout:{animation:"fade-in-out 2s ease-in-out infinite alternate"},rumble:{animation:"rumble linear 0.1s 0s infinite"},sway:{animation:"sway linear 2.5s 0s infinite"},buoy:{animation:"buoy linear 2.5s 0s infinite"},fidget:{animation:function(){return"fidget step-end 60s "+60*-Math.random()+"s infinite"+(Math.random()<.5?" reverse":"")}}}),["text-style",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return o.create("text-style",n.map(c.insensitiveName))},function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var a=0;a<n.length;a+=1)"none"===n[a]?e.styles=[]:e.styles=e.styles.concat(p[n[a]]);return e},[k(S.apply(void 0,_toConsumableArray(Object.keys(p))))]])))("collapse",function(){return o.create("collapse")},function(e){return e.attr.push({collapsing:!0}),e},[])("hover-style",function(e,t){var n=u.create(),r=(t.run(n),n.summary());return r+""=="styles"||r.every(function(e){return"styles"===e||"attr"===e})&&n.attr.every(function(e){return Object.keys(e)+""=="style"})?o.create("hover-style",[t]):l.create("datatype","The changer given to (hover-style:) must only change the hook's style.")},function(e,t){return e.data.hoverChanger=t,e.attr.push({hover:function(e,t){return void 0!==t&&t}}),e},[o])("css",function(e,t){return t.trim().endsWith(";")||(t+=";"),o.create("css",[t])},function(e,t){return e.attr.push({style:function(){return(s(this).attr("style")||"")+t}}),e},[String])("test-true",function(){return o.create("test-true",[])},function(e){return e.enabled=!0},T(w))("test-false",function(){return o.create("test-false",[])},function(e){return e.enabled=!1},T(w)),e.addCommand("animate",s.noop,function(r,e,t,a,o){t.forEach(e,function(e){var t,n;"zoom"===name&&(n=(t=e.offset()).left,t=t.top,n=c.mouseCoords.x-n+"px "+(c.mouseCoords.y-t)+"px"),c.transitionIn(e,a,r.transitionTime||o,r.transitionDelay,r.transitionSkip,0,n)})},[k(n),S.apply(void 0,_toConsumableArray(C.innerType.filter(function(e){return"instant"!==e}))),v(x)]),["box","float-box"].forEach(function(i){return e.addChanger(i,function(e,t,n){var r=-1===t.search(h)||1<t.length&&!t.includes("="),a="float-box"===i&&(-1===n.search(h)||1<n.length&&!n.includes("="));return r||a?l.create("datatype","The ("+i+':) macro requires a sizing line("==X==", "==X", "=XXXX=" etc.) be provided, not "'+(r?t:n)+'".'):o.create(i,[t,n].filter(function(e){return void 0!==e}))},function(e,t,n){var r,t=d(t),a=t.marginLeft,t=t.size,o=("float-box"===i&&(r=(o=d(n)).marginLeft,n=o.size),"box"===i?"%":"vw"),a=(_defineProperty(t={display:"block",width:t+o,"max-width":t+o},"box"===i?"margin-left":"left",a+o),_defineProperty(t,"box-sizing","content-box"),_defineProperty(t,"overflow-y","auto"),_defineProperty(t,"padding",function(){var e=s(this).css("padding");return e&&"0px"!==e?e:"1em"}),t);return void 0!==n&&(a.height=n+("box"===i?"em":"vh")),"float-box"===i&&m(a,{position:"fixed",top:r+"vh","background-color":function(){return c.parentColours(s(this)).backgroundColour}}),e.styles.push(a),e},[String,"box"===i?v(O):String])})}),define("internaltypes/enchantment",["jquery","utils","internaltypes/changedescriptor","datatypes/changercommand","utils/operationutils","internaltypes/twineerror","utils/renderutils"],function(y,g,v,b,e,w,t){var T=e.objectName,k=e.toSource,S=t.collapse;return Object.freeze({create:function(e){return Object.assign(Object.create(this),{enchantments:y()},e)},enchantScope:function(){var i=this,s=this.attr,c=this.data,u=this.functions,l=this.section,p=this.scope,f=this.localHook,d=this.lambda,h=[],m=0;p.forEach(l,function(e,t){if(f){f=f.jquery?f:f.hooks(l);var n=e.find(f);if(n.length)e=n;else if(!f.has(e[0]).length)return}var r,a,o;(!e.is(":empty")||e.data("source")&&e.data("source").length)&&(m+=1,d?(o=d.apply(l,{loop:p.TwineScript_GetProperty(t),pos:m}),w.containsError(o)?(e.replaceWith(o.render()),d=o=null):b.isPrototypeOf(o)?o.canEnchant||(e.replaceWith(w.create("macrocall",'The lambda "'.concat(k(d),"\" can't be or include a revision, enchantment, or interaction changer like (replace:), (click:), or (link:).")).render()),d=o=null):(e.replaceWith(w.create("macrocall",'The lambda "'.concat(k(d),'" must return a changer, not ').concat(T(o),".")).render()),d=o=null)):o=i.changer,n=!s&&!c&&(!o||o.summary().every(function(e){return e.startsWith("transition")})),r=n?e:e.wrap("<tw-enchantment>").parent(),s&&r.attr(s),c&&r.data(c),u&&u.forEach(function(e){return e(r)}),o&&(t=v.create({section:l,target:r}),o.run(t),t.update(),e.is(g.storyElement)?(a=Object.keys(Object.assign.apply(Object,[{}].concat(_toConsumableArray(t.styles)))),e.css(a.reduce(function(e,t){return"background-color"===t||"background-image"===t?(e["background-color"]="transparent",e["background-image"]="none",a.push("background-".concat("background-color"===t?"image":"color"))):e[t]="inherit",e},{})),r.data({enchantedProperties:a})):e.is("tw-passage")&&t.styles.some(function(e){return"margin-left"in e||"margin"in e||"margin-right"in e})&&(o="padding-right",g.storyElement.css(t="padding-left","0px").css(o,"0px"),r.data({enchantedProperties:[t,o]}))),e.is(g.storyElement)&&r.css({"min-width":"100%","min-height":"100%"}),"true"===r.attr("collapsing")&&(r.find("[collapsing=false]").each(function(){y(this).removeAttr("collapsing")}),S(r)),n||h.push(r))}),this.enchantments=y(h)},disenchant:function(){this.enchantments.each(function(e,t){(t=y(t)).contents().unwrap();t=t.data("enchantedProperties");t&&g.storyElement.css(t.reduce(function(e,t){return e[t]="",e},{}))})}})}),define("macrolib/enchantments",["jquery","utils","utils/operationutils","engine","state","passages","macros","datatypes/hookset","datatypes/codehook","datatypes/changercommand","datatypes/lambda","internaltypes/changedescriptor","internaltypes/enchantment","internaltypes/twineerror"],function(s,r,e,c,u,n,l,p,a,f,t,i,d,h){var m=e.is,e=l.TypeSignature,y=e.either,g=e.rest,v=e.optional,b=Object.assign;function w(e,t){if(f.isPrototypeOf(t)&&!t.canEnchant)return h.create("datatype","The changer given to (".concat(e,":) can't include a revision, enchantment, or interaction changer like (replace:), (click:), or (link:)."))}["enchant","change"].forEach(function(o){l.addCommand(o,function(e,t){t=w(o,t);if(t)return t},function(t,n,e){n=p.from(n);var r,a=[];return f.isPrototypeOf(e)&&(r=i.create({section:t}),e.run(r),0<(r.innerEnchantments||[]).length&&(r=r.innerEnchantments.map(function(e){return e(n)}),a.push.apply(a,_toConsumableArray(r)))),a.push(d.create((_defineProperty(r={scope:n},f.isPrototypeOf(e)?"changer":"lambda",e),_defineProperty(r,"section",t),r))),a.forEach(function(e){"enchant"===o?(t.addEnchantment(e),t.updateEnchantments()):e.enchantScope()}),""},[y(p,String),y(f,t.TypeSignature("via"))],!1)}),l.addChanger("enchant-in",function(e,t,n){var r=w("enchant-in",n);return r||f.create("enchant-in",[t,n])},function(t,n,r){return t.innerEnchantments=(t.innerEnchantments||[]).concat(function(e){return d.create((_defineProperty(e={scope:p.from(n),localHook:e},f.isPrototypeOf(r)?"changer":"lambda",r),_defineProperty(e,"section",t.section),e))}),t},[y(p,String),y(f,t.TypeSignature("via"))]),[["link-style",p.create({type:"name",data:"link"})],["line-style",p.create({type:"base",data:p.create({type:"name",data:"page"})},"lines",void 0)],["char-style",p.create({type:"base",data:p.create({type:"name",data:"page"})},"chars",void 0)]].forEach(function(e){var e=_slicedToArray(e,2),r=e[0],a=e[1];l.addChanger(r,function(e,t){var n=w(r,t);return n||f.create(r,[t])},function(t,n){return t.innerEnchantments=(t.innerEnchantments||[]).concat(function(e){return d.create((_defineProperty(e={scope:a,localHook:e},f.isPrototypeOf(n)?"changer":"lambda",n),_defineProperty(e,"section",t.section),e))}),t},[y(f,t.TypeSignature("via"))])});e=["replace","append","prepend"];function T(o,i){return r.onStartup(function(){var e=o.classList.replace(/ /g,"."),t=o.blockClassList?o.blockClassList.replace(/ /g,"."):"",n="."+e+(t?",."+t:"");r.storyElement.on(o.event.map(function(e){return e+".enchantment"}).join(" "),n,function(e){var t;s(e.target).is("tw-open-button")||(t=(e=s(Array.from(s(this).parents(n).add(this)).sort(function(e,t){return 8&e.compareDocumentPosition(t)?1:-1})[0])).data("enchantmentEvent"))&&t(e)})}),[function(e,t,n){if(!t)return h.create("datatype","A string given to this ("+i+":) macro was empty.");if(n){var r=w(i,n);if(r)return r}return f.create(i,[p.from(t)].concat(n?[n]:[]))},function(e,t,n){e.enabled=!1,e.transitionDeferred=!0,o.rerender&&(e.newTargets=(e.newTargets||[]).concat({target:t,append:o.rerender}));var r=e.section&&e.section.stackTop?e.section.stackTop.tempVariables:Object.create(null),a=d.create(_defineProperty({functions:[function(e){e.attr("class",e.children().is("tw-story, tw-sidebar, tw-passage")||["block","flex"].includes(e.children().css("display"))?o.blockClassList:o.classList),e.attr({tabIndex:"0"})}],data:{enchantmentEvent:function(){e.section.stackTop&&e.section.stackTop.blocked||(o.once&&e.section.removeEnchantment(a),o.goto?c.goToPassage(o.goto,{transition:o.transition}):o.undo?c.goBack({transition:o.transition}):e.section.renderInto(e.source,null,b({},e,{append:o.once?"append":"replace",enabled:!0,transitionDeferred:!1}),r))}},scope:t,section:e.section,name:i},f.isPrototypeOf(n)?"changer":"lambda",n));return e.section&&(e.section.addEnchantment(a),a.enchantScope()),e},[y(p,String),v(y(f,t.TypeSignature("via")))]]}e.forEach(function(o){l.addChanger(o,function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.every(Boolean)?f.create(o,n.map(p.from),null,!1):h.create("datatype","A string given to this (".concat(o,":) macro was empty."))},function(e){var t;0<s(e.target).parents().filter("tw-collapsed,[collapsing=true]").length||e.attr.some(function(e){return e.collapsing})||(e.attr=[].concat(_toConsumableArray(e.attr),[{collapsing:!1}])),e.newTargets=e.newTargets||[];for(var n=arguments.length,r=new Array(1<n?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return(t=e.newTargets).push.apply(t,_toConsumableArray(r.filter(function(n){return!e.newTargets.some(function(e){var t=e.target,e=e.append;return m(n,t)&&o===e})}).map(function(e){return{target:e,append:o,before:!0}}))),e},g(y(p,String)))(o+"-with",function(e,t){return f.create(o+"-with",[t],null,!1)},function(e,t){return a.isPrototypeOf(t)&&(t=t.code),e.appendSource=(e.appendSource||[]).concat({source:t,append:o}),e},y(a,String))});var o="ontouchstart"in window||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints,k=[{name:"click",enchantDesc:{event:["click"],once:!0,rerender:"",classList:"link enchantment-link",blockClassList:"enchantment-clickblock"}},{name:"mouseover",enchantDesc:{event:["mouseenter",o?"click":""].filter(Boolean),once:!0,rerender:"",classList:"link enchantment-mouseover",blockClassList:"enchantment-mouseoverblock"}},{name:"mouseout",enchantDesc:{event:["mouseleave",o?"click":""].filter(Boolean),once:!0,rerender:"",classList:"link enchantment-mouseout",blockClassList:"enchantment-mouseoutblock"}},{name:"doubleclick",enchantDesc:{event:["dblclick"],once:!0,rerender:"",classList:"link enchantment-dblclick",blockClassList:"enchantment-dblclickblock"}}];k.forEach(function(e){"doubleclick"!==e.name&&(l.addChanger.apply(l,[e.name].concat(_toConsumableArray(T(e.enchantDesc,e.name)))),"click"===e.name&&l.addChanger.apply(l,[e.name+"-rerun"].concat(_toConsumableArray(T(b({},e.enchantDesc,{once:!1}),e.name+"-rerun")))))}),r.onStartup(function(){k.forEach(function(e){var n=e.enchantDesc;n.blockClassList&&r.storyElement.on(n.event.map(function(e){return e+".enchantment"}).join(" "),function(e){var t;s(e.target).is("tw-open-button")||(t=(e=s(Array.from(s(this).parents("."+n.blockClassList.replace(/ /g,"."))).sort(function(e,t){return 8&e.compareDocumentPosition(t)?1:-1})[0])).data("enchantmentEvent"))&&t(e)})})}),e.forEach(function(n){k.forEach(function(e){var t;"doubleclick"!==e&&(t=b({},e.enchantDesc,{rerender:n}),e=e.name+"-"+n,l.addChanger.apply(l,[e].concat(_toConsumableArray(T(t,e)))))})}),k.forEach(function(i){"doubleclick"!==i&&["goto","undo"].forEach(function(a){var o=i.name+"-"+a;l.addCommand(o,function(e,t){return!e||!t&&"goto"===a?h.create("datatype","A string given to this ("+o+":) macro was empty."):"goto"!==a||n.hasValid(t)?void 0:h.create("macrocall","I can't ("+o+":) the passage '"+t+"' because it doesn't exist.")},function(e,t,n,r){return"undo"===a&&u.pastLength<1?h.create("macrocall","I can't (undo:) on the first turn."):((0,_slicedToArray(T(b({},i.enchantDesc,{transition:e.data.passageT8n},"undo"===a?{undo:!0}:{goto:r}),o),2)[1])({section:t},p.from(n)),b(e,{source:""}))},[y(p,String)].concat("undo"===a?[]:String))})})}),define("macrolib/metadata",["macros","utils/operationutils","datatypes/lambda","internaltypes/twineerror"],function(t,e,n,s){function c(e){return{TwineScript_TypeName:"a ("+e+":) macro",TwineScript_ObjectName:"a ("+e+":) macro",TwineScript_Unstorable:!0,TwineScript_Print:function(){return""}}}var u=e.clone,l=e.objectName,p=e.isValidDatamapName,e=t.TypeSignature,r=e.zeroOrMore,e=e.Any;[["storylet",n.TypeSignature("when")],["urgency",Number],["exclusivity",Number]].forEach(function(e){var e=_slicedToArray(e,2),n=e[0],e=e[1];t.add(n,"Metadata",function(e,t){return e.stackTop.speculativePassage?t:c(n)},e)}),t.add("metadata","Metadata",function(e){for(var r,a=new Map,t=arguments.length,n=new Array(1<t?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=n.reduce(function(e,t){var n;if(!s.containsError(e))if(void 0===r)r=t;else{if(n=s.containsError(p(a,r)))return n;if(a.has(r))return s.create("macrocall","You used the same data name ("+l(r)+") twice in the same (metadata:) call.");a.set(r,u(t)),r=void 0}return e},!0);return s.containsError(i)?i:void 0!==r?s.create("macrocall","This (metadata:) macro has a data name without a value."):e.stackTop.speculativePassage?a:c("metadata")},r(e))}),define("macrolib/patterns",["macros","utils","utils/operationutils","datatypes/lambda","datatypes/datatype","datatypes/typedvar","internaltypes/twineerror","internaltypes/varscope"],function(e,t,n,g,v,h,b,w){function T(e){var a=e.name,t=e.fullArgs,n=e.args,r=e.makeRegExpString,o=void 0===r?function(e){return e.join("")}:r,i=void 0!==(r=e.insensitive)&&r,s=void 0===(r=e.canContainTypedVars)||r,c=void 0===(r=e.canBeUsedAlone)||r,u=void 0===(r=e.canContainTypedGlobals)||r,l=n||t,p=A(null),e=l.map(function e(t){if(h.isPrototypeOf(t)){var n=t.varRef;if(!s)return b.create("operation","Optional string patterns, like (".concat(a,":)").concat("p-many"===a?" with a minimum of 0 matches":"",", can't have typed variables inside them."));if(!u&&!w.isPrototypeOf(n.object))return b.create("operation","Only typed temp variables can be used in patterns given to (".concat(a,":)"));n=n.getName();if(n in p)return b.create("operation","There's already a typed temp variable named _".concat(n," inside this (").concat(a,":) call."));p[n]=!0;n=e(t.datatype);return b.containsError(n)?n:"("+n+")"}if(v.isPrototypeOf(t)){if(!(s&&u||"function"!=typeof t.typedVars)){n=t.typedVars();if(!s&&n.length)return b.create("operation","(".concat(a,":) can't have typed variables inside its pattern."));if(!u&&n.some(function(e){return!w.isPrototypeOf(e.varRef.object)}))return b.create("operation","Only typed temp variables can be used in patterns given to (".concat(a,":)"))}if(t.regExp)return(t.rest?"(?:":"")+(i?t.insensitive():t).regExp+(t.rest?")*":"");var n=t.name,r=t.rest?"*":"";return"alnum"===n?m+r:"whitespace"===n?x+r:"uppercase"===n?(i?S:y)+r:"lowercase"===n?(i?S:k)+r:"anycase"===n?S+r:"digit"===n?"\\d"+r:"linebreak"===n?"(?:\\r|\\n|\\r\\n)"+r:"str"===n?".*?":["even","odd","int","num"].includes(n)?b.create("datatype","Please use string datatypes like 'digit' in (".concat(a,":) instead of number datatypes.")):b.create("datatype","The (".concat(a,":) macro must only be given string-related datatypes, not ").concat(_(t),"."))}return"string"==typeof t?(t=t.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&"),i?t.replace(RegExp("(".concat(y,"|").concat(k,")"),"g"),function(e){return"["+e.toUpperCase()+e.toLowerCase()+"]"}):t):(O("createPattern","mapper() was given a non-string non-datatype "+t),"")});if(r=b.containsError(e))return r;var f=o(e),d=E(A(v),{name:a,regExp:f,insensitive:function(){return i?d:T({name:a,fullArgs:t,args:l.map(function(e){return v.isPrototypeOf(e)&&"function"==typeof e.insensitive?e.insensitive():e}),makeRegExpString:o,insensitive:!0,canContainTypedVars:s,canBeUsedAlone:c})},typedVars:function(){return l.reduce(function(e,t){return h.isPrototypeOf(t)&&(e=e.concat(i?h.create(T({name:"p-ins",fullArgs:[t.datatype],insensitive:!0}),t.varRef):t),t=t.datatype),e=v.isPrototypeOf(t)&&"function"==typeof t.typedVars?e.concat(t.typedVars()):e},[])},destructure:function(e){if("string"!=typeof e)return[b.create("operation","I can't put ".concat(_(e)," into ").concat(this.TwineScript_ToSource()," because it isn't a string."))];var n=this.typedVars();if(!n.length)return[];var t=(RegExp("^"+(this.rest?"(?:":"")+f+(this.rest?")*":"")+"$").exec(e)||[]).slice(1);return t.length?t.map(function(e,t){t=n[t];if(t)return t.datatype.rest&&!t.datatype.regExp&&((t=t.TwineScript_Clone()).datatype=T({name:"p",fullArgs:[t.datatype]})),{dest:t,value:e||"",src:void 0}}).filter(Boolean):[b.create("operation","I can't put ".concat(_(e)," because it doesn't match the pattern ").concat(this.TwineScript_ToSource(),"."))]},TwineScript_IsTypeOf:function(e){return c?"string"==typeof e&&!!e.match("^"+(this.rest?"(?:":"")+f+(this.rest?")*":"")+"$"):b.create("operation","A (".concat(a,":) datatype must only be used with a (p:) macro."))},TwineScript_toTypeSignatureObject:function(){var t=this;return{pattern:"range",name:a,range:function(e){return t.TwineScript_IsTypeOf(e)}}},TwineScript_ToSource:function(){return(this.rest?"...":"")+"("+a+":"+t.map(C)+")"}});return Object.defineProperty(d,"TwineScript_ObjectName",{get:function(){return"a (".concat(a,":) datatype")}}),d}var m=t.anyRealLetter,y=t.anyUppercase,k=t.anyLowercase,S=t.anyCasedLetter,x=t.realWhitespace,O=t.impossible,_=n.objectName,C=n.toSource,t=e.TypeSignature,n=t.rest,r=t.either,a=t.optional,t=t.nonNegativeInteger,E=Object.assign,A=Object.create,o=n(r(String,v,h));e.add(["p","pattern"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return T({name:"p",fullArgs:n})},o)(["p-either","pattern-either"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return T({name:"p-either",fullArgs:n,canContainTypedVars:!1,makeRegExpString:function(e){return"(?:"+e.join("|")+")"}})},o)(["p-opt","pattern-opt","p-optional","pattern-optional"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return T({name:"p-opt",fullArgs:n,canContainTypedVars:!1,makeRegExpString:function(e){return"(?:"+e.join("")+")?"}})},o)(["p-not","pattern-not"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.find(function(e){return"string"==typeof e?1!==_toConsumableArray(e).length:e.rest||e.regExp||["str","empty"].includes(e.name)})?b.create("datatype","(p-not:) should only be given single characters, or datatypes that match single characters"):T({name:"p-not",fullArgs:n,canContainTypedVars:!1,makeRegExpString:function(e){return"[^"+e.map(function(e){return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e}).join("")+"]"}})},o)(["p-not-before","pattern-not-before"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return T({name:"p-not-before",fullArgs:n,canContainTypedVars:!1,makeRegExpString:function(e){return"(?!"+e.join("")+")"}})},o)(["p-before","pattern-before"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return T({name:"p-before",fullArgs:n,canContainTypedVars:!1,makeRegExpString:function(e){return"(?="+e.join("")+")"}})},o)(["p-start","pattern-start"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return T({name:"p-start",fullArgs:n,makeRegExpString:function(e){return"^(?:"+e.join("")+")"}})},o)(["p-end","pattern-end"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return T({name:"p-end",fullArgs:n,makeRegExpString:function(e){return"(?:"+e.join("")+")$"}})},o)(["p-many","pattern-many"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var a,o,i=n.slice();if("number"==typeof n[0]&&(a=n.shift(),o="number"==typeof n[0]?n.shift():1/0),void 0!==o&&o<a)return b.create("datatype","The (p-many:) macro needs to be given string patterns, not just min and max numbers.");if(!n.length)return b.create("datatype","The (p-many:) macro needs to be given string patterns, not just min and max numbers.");var s=n.find(function(e){return"string"!=typeof e&&!v.isPrototypeOf(e)&&!h.isPrototypeOf(e)});return s?b.create("datatype","This (p-many:) macro can only be given a min and max number followed by datatypes or strings, but was also given "+_(s)+"."):T({name:"p-many",args:n,fullArgs:i,canContainTypedVars:0<a,makeRegExpString:function(e){return"(?:"+e.join("")+")"+(void 0!==a?"{"+a+(o===1/0?",":o!==a?","+o:"")+"}":"+")}})},[n(r(t,String,v,h))])(["p-ins","pattern-ins","p-insensitive","pattern-insensitive"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return T({name:"p-ins",fullArgs:n,insensitive:!0})},o)(["split","splitted"],"Array",function(e,t,n){if(t=T({name:"split",fullArgs:[t],canContainTypedVars:!1}),b.containsError(t))return t;if(!n)return[""];if(!t.regExp)return _toConsumableArray(n);for(var r,a=RegExp(t.regExp),o=[];n&&(r=a.exec(n));){if(r.index+r[0].length===0)return o;o.push(n.slice(0,r.index)),n=n.slice(r.index+r[0].length)}return o.concat(n||[])},[r(String,v),String])("trimmed","String",function(e,t,n){return void 0===n||v.isPrototypeOf(t)&&"whitespace"===t.name?t.trim():(t=T({name:"trimmed",fullArgs:[t],canContainTypedVars:!1}),b.containsError(t)?t:t.regExp?n.replace(RegExp("^("+t.regExp+")*|("+t.regExp+")*$","g"),""):n)},[r(String,v),a(String)])(["str-find","string-find"],"String",function(e,t,n){if(t=T({name:"str-find",fullArgs:[t],canContainTypedGlobals:!1}),b.containsError(t))return t;for(var r,a=t.typedVars(),o=RegExp(t.regExp,"g"),i=[],s=o.lastIndex;(r=o.exec(n))&&s!==o.lastIndex;)if(s=o.lastIndex,a.length){for(var c=new Map,u=0;u<a.length;u+=1){if("match"===a[u].varRef.getName())return b.create("macrocall","There was a typed temp variable named _match in the pattern given to (str-find:)","The variable _match is reserved, and can't be used inside (str-find:)'s pattern.");c.set(a[u].varRef.getName(),r[u+1]),c.set("match",r[0])}i.push(c)}else i.push(r[0]);return i},[v,String])(["str-replaced","string-replaced","replaced"],"String",function(e,t,n,r,a){if("number"!=typeof t){if(void 0!==a)return b.create("macrocall","1 too many values were given to (str-replaced:).","If this is given 5 values, the first value must be a number of replacements.");a=r,r=n,n=t,t=1/0}else if(void 0===a)return b.create("macrocall","The (str-replaced:) macro needs 1 more value.","The final string seems to be missing.");if(v.isPrototypeOf(r))return b.create("datatype","The replacement value for (str-replaced:) must be a string or lambda, not ".concat(_(r)));if(g.isPrototypeOf(a)||g.isPrototypeOf(n))return b.create("datatype","The ".concat(g.isPrototypeOf(a)?"final string":"search pattern"," given to (str-replaced:) can't be a lambda."),"Only the replacement value (after the search pattern) can be a 'via' lambda.");if(n=T({name:"str-replaced",fullArgs:[n],canContainTypedGlobals:!1}),b.containsError(n))return n;if(!n.regExp)return a;for(var o,i=RegExp(n.regExp,"g"),s=g.isPrototypeOf(r)?n.typedVars():[],c=1,u=0,l="",p=i.lastIndex;a&&(o=i.exec(a))&&0<t&&p!==i.lastIndex;){for(var p=i.lastIndex,f=Object.create(e.stack.length?e.stackTop.tempVariables:w),d=0;d<s.length;d+=1){var h=s[d],m=h.varRef.create(f,h.varRef.propertyChain);if(b.containsError(m))return m;h=m.defineType(h.datatype);if(b.containsError(h))return h;m.set(o[d+1])}var y=g.isPrototypeOf(r)?r.apply(e,{loop:o[0],pos:c,tempVariables:f}):r;if(b.containsError(y))return y;if("string"!=typeof y)return b.create("datatype","(str-replaced:)'s lambda must produce a string, but it produced ".concat(_(y),' when given "').concat(o[0],'".'));l+=a.slice(u,o.index)+y,c+=1,--t,u=o.index+o[0].length}return l+=a.slice(u)},[r(t,String,v),r(v,String,g.TypeSignature("via")),r(String,g.TypeSignature("via")),a(String)])}),define("macrolib/links",["jquery","macros","utils","state","passages","engine","datatypes/changercommand","internaltypes/changedescriptor","datatypes/hookset","datatypes/lambda","internaltypes/twineerror"],function(i,e,s,u,l,c,a,p,t,f,d){var n=e.TypeSignature,r=n.optional,o=n.rest,n=n.either,h=["Links can't have empty strings for their displayed text.","In the link syntax, a link's displayed text is inside the [[ and ]], and on the non-pointy side of the -> or <- arrow if it's there."],m=Object.assign;function y(e,t,n){n=n||t;var r,a=l.hasValid(t)&&t===n,e=e.evaluateTwineMarkup(s.unescape(n),"a link's passage name");return a?t=(a=0<e.children().length?"`".repeat((n.match(/`+/)||[]).reduce(function(e,t){return Math.max(e,t.length+1)},1)):"")+"\0".repeat(!!a)+t+"\0".repeat(!!a)+a:(e.findAndFilter("tw-error").length&&(r=e.findAndFilter("tw-error").data("TwineError")),n=e.text()),{text:t,passage:n,error:r}}s.onStartup(function(){var e="ontouchstart"in window||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints;function t(e){var n,t=i(this),r=t.closest("tw-expression"),a=t.closest("tw-expression, tw-hook"),o=a.data("clickEvent"),a=a.data("section");if(!t.is("tw-open-button")&&(!(a&&a.stackTop&&a.stackTop.blocked)||a.stackTop.blocked instanceof i&&a.stackTop.blocked.find(t).length)){if(!o)return a=r.data("linkPassageName"),n=Object.assign({},r.data("passageT8n")||{}),r.find("tw-enchantment").each(function(e,t){Object.assign(n,i(t).data("passageT8n")||{})}),a?(e.stopPropagation(),void c.goToPassage(a,{transition:n})):t.is("[undo]")?(e.stopPropagation(),void c.goBack({transition:n})):void(t.is("[fullscreen]")&&(e.stopPropagation(),c.toggleFullscreen()));0<t.find("tw-error").length||(e.stopPropagation(),o(t))}}s.storyElement.on("click.passage-link","tw-link"+(e?"":":not(.enchantment-mouseover):not(.enchantment-mouseout):not(.enchantment-dblclick)"),t).on("mouseover.passage-link","tw-link.enchantment-mouseover, tw-expression.enchantment-mouseover > tw-link",t).on("mouseout.passage-link","tw-link.enchantment-mouseout, tw-expression.enchantment-mouseout > tw-link",t).on("dblclick.passage-link","tw-link.enchantment-dblclick, tw-expression.enchantment-dblclick > tw-link",t),i(document).on("fullscreenchange",function(){i("tw-link[fullscreen]",s.storyElement).each(function(e,t){(i(t).closest("tw-expression, tw-hook").data("fullscreenEvent")||Object)(t)})})}),[["link","link-replace"],["link-reveal","link-append"],["link-repeat"],["link-rerun"]].forEach(function(s){return e.addChanger(s,function(e,t,n){return t?n&&!n.canEnchant?d.create("datatype","The changer given to (".concat(s[0],":) can't be or include a revision, enchantment, or interaction changer like (replace:), (click:), or (link:).")):a.create(s[0],[t].concat(n||[]),null,!0):d.create("datatype",h[0])},function(r,e,t){var a=s[0],o=r.section&&r.section.stackTop?r.section.stackTop.tempVariables:Object.create(null),i=p.create({source:"<tw-link tabindex=0>"+e+"</tw-link>",target:function(){return r.target},append:"replace",data:{section:r.section,clickEvent:function(e){r.enablers=r.enablers.filter(function(e){return e.descriptor!==i}),"link-reveal"===a&&e.contents().unwrap();var t,n=e.parentsUntil(":not(tw-enchantment)").parent();n.length||(n=e.parent()),"link-rerun"===a&&(t=e.parentsUntil(":not(tw-enchantment)"),e.detach(),t.remove()),"link"!==a&&"link-rerun"!==a||n.empty(),r.section.renderInto("",null,r,o),"link-rerun"===a&&n.prepend(e)}}});return r.enablers=(r.enablers||[]).concat({descriptor:i,changer:t}),r},[String,r(a)])}),e.addCommand("link-goto",function(e){if(!e)return d.create.apply(d,["datatype"].concat(h))},function(e,t,n,r){var a,o=y(t,n,r);return n=o.text,r=o.passage,(o=o.error)?o:e.transition?d.create("datatype","Please attach ("+(o="transition")+"-depart:) or ("+o+"-arrive:) to a passage link, not ("+o+":)."):(a=(a=l.hasValid(r)?a:'<tw-broken-link passage-name="'+s.escape(r)+'">'+n+"</tw-broken-link>")||"<tw-link tabindex=0 "+(0<u.passageNameVisited(r)?'class="visited" ':"")+">"+n+"</tw-link>",e.data.linkPassageName=r,e.data.section=t,m(e,{source:a,transitionDeferred:!0}))},[String,r(String)])("link-storylet",function(){var e=(e=1===arguments.length||"string"!=typeof(arguments.length<=0?void 0:arguments[0])?0:1)<0||arguments.length<=e?void 0:arguments[e];if(!e||"string"==typeof e)return d.create("datatype","(link-storylet:) should be given one index number or one 'where' lambda, after the optional link text string.")},function(e,t){var n=(n=2+(1==(arguments.length<=2?0:arguments.length-2)?0:3==(arguments.length<=2?0:arguments.length-2)||"string"==typeof(arguments.length<=2?void 0:arguments[2])?1:2))<2||arguments.length<=n?void 0:arguments[n],r="string"==typeof(arguments.length<=2?void 0:arguments[2])&&(arguments.length<=2?void 0:arguments[2]),a=((a=(arguments.length<=2?0:arguments.length-2)-1+2)<2||arguments.length<=a?void 0:arguments[a])!==n&&((a=(arguments.length<=2?0:arguments.length-2)-1+2)<2||arguments.length<=a?void 0:arguments[a]);if(e.transition)return d.create("datatype","Please attach ("+(o="transition")+"-depart:) or ("+o+"-arrive:) to (link-storylet:), not ("+o+":).");var o=f.isPrototypeOf(n),i=l.getStorylets(t,o&&n),s=d.containsError(i);if(s)return s;var c,s=i[o?0:n<0?i.length+n:n-1];if(s)s=s.get("name"),r=r||s,c=c||"<tw-link tabindex=0 "+(0<u.passageNameVisited(s)?'class="visited" ':"")+">"+r+"</tw-link>",e.data.linkPassageName=s,e.data.section=t;else{if(!a)return e;c=a}return m(e,{source:c,transitionDeferred:!0})},[n(parseInt,String,f.TypeSignature("where")),r(n(parseInt,String,f.TypeSignature("where"))),r(String)])("link-undo",function(e){if(!e)return d.create("datatype",h[0])},function(t,e,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"";if(u.pastLength<1)return m(t,{source:r});var a=(t.data.section=e).stackTop.tempVariables;return t.data.forgetUndosEvent=function(){return t.data.section.whenUnblocked(function(){var e=m({},t,{append:"replace",source:r,transitionDeferred:!1});t.section.renderInto("",null,e,a)})},m(t,{source:"<tw-link tabindex=0 undo>"+n+"</tw-link>",transitionDeferred:!0})},[String,r(String)])("link-show",function(e){if(!e)return d.create("datatype",h[0])},function(r,a,e){for(var t=arguments.length,n=new Array(3<t?t-3:0),o=3;o<t;o++)n[o-3]=arguments[o];return r.data.section=a,r.data.clickEvent=function(e){e.contents().unwrap(),n.forEach(function(e){return e.forEach(a,function(e){var t=e.data("originalSource")||"",n=e.data("hidden");n&&(e.removeData("hidden"),n instanceof i?e.empty().append(n):(n=e.data("tempVariables"),a.renderInto("",null,m({},r,{source:t,target:e,transitionDeferred:!1}),n&&Object.create(n))))})})},m(r,{source:"<tw-link tabindex=0>"+e+"</tw-link>",transitionDeferred:!0})},[String,o(t)])("link-fullscreen",function(e,t){if(!e||!t)return d.create("datatype",h[0])},function(t,e,n,r){function a(){return document.fullscreenEnabled||document.msFullscreenEnabled?"<tw-link tabindex=0 fullscreen>"+(document.fullscreenElement||document.msFullscreenElement?r:n)+"</tw-link>":r?"<tw-broken-link>"+r+"</tw-broken-link>":""}var o=e.stackTop.tempVariables;return t.data.section=e,t.data.fullscreenEvent=function(){(document.fullscreenEnabled||document.msFullscreenEnabled)&&t.data.section.whenUnblocked(function(){var e=m({},t,{append:"replace",source:a(),transitionDeferred:!1});t.section.renderInto("",null,e,o)})},m(t,{source:a(),transitionDeferred:!0})},[String,String,r(String)]),e.addChanger(["link-reveal-goto"],function(e,t,n,r){if(!t)return d.create.apply(d,["datatype"].concat(h));if(a.isPrototypeOf(n)){if(a.isPrototypeOf(r))return d.create("datatype","You mustn't give two changers to (link-reveal-goto:)");r=n,n=void 0}if(r&&!r.canEnchant)return d.create("datatype","The changer given to (link-reveal-goto:) can't include a revision, enchantment, or interaction changer like (replace:), (click:), or (link:).");var e=y(e,t,n);return t=e.text,n=e.passage,(e=e.error)?e:a.create("link-reveal-goto",[t,n,r].filter(function(e){return void 0!==e}),null,!1)},function(t,e,n,r){var a,o,i;{if(l.hasValid(n))return a=u.passageNameVisited(n),o=t.section&&t.section.stackTop?t.section.stackTop.tempVariables:Object.create(null),i=p.create({source:"<tw-link tabindex=0 "+(0<a?'class="visited" ':"")+">"+e+"</tw-link>",target:t.target,append:"replace",data:{section:t.section,append:"replace",clickEvent:function(e){t.enablers=t.enablers.filter(function(e){return e.descriptor!==i}),e.contents().unwrap(),t.section.renderInto("",null,t,o),t.section.whenUnblocked(function(){return c.goToPassage(n,{transition:t.data.passageT8n})})}}}),t.enablers=(t.enablers||[]).concat({descriptor:i,changer:r}),t;t.source='<tw-broken-link passage-name="'+s.escape(n)+'">'+e+"</tw-broken-link>"}},[String,r(n(a,String)),r(a)])}),define("macrolib/custommacros",["utils","macros","state","utils/operationutils","datatypes/changercommand","datatypes/custommacro","datatypes/codehook","datatypes/typedvar","internaltypes/twineerror"],function(c,u,l,e,t,p,n,f,d){function s(e,t,n){if(!t.some(function(e){if("function"==typeof e.output)return e.output(n),!0}))return d.create("macrocall","("+e+":) should only be used inside a code hook passed to (macro:).")}var h=e.objectName,m=e.toSource,e=u.add,r=u.addChanger,a=u.addCommand,o=u.TypeSignature,i=o.rest,y=o.either,g=o.Any,v=o.Everything,o=o.zeroOrMore;e("macro","CustomMacro",function(e){for(var t,n=[],r=arguments.length,a=new Array(1<r?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];for(t=0;t<a.length;t+=1){var i=t===a.length-1;if(f.isPrototypeOf(a[t])===i)return d.create("datatype","The "+(i?"":c.nth(a.length-t+1)+"-")+"last value given to (macro:) should be a "+(i?"code hook":"datatyped variable")+", not "+h(a[t]));if(!i){i="A custom macro";if(a[t].varRef.object===l.variables)return d.create("datatype",i+"'s typed variables must be temp variables (with a '_'), not global variables (with a '$').","Write them with a _ symbol at the start instead of a $ symbol.");if(1<a[t].varRef.propertyChain.length)return d.create("datatype",i+"'s typed variables can't be properties inside a data structure.");if(a[t].datatype.rest&&t!==a.length-2)return d.create("datatype",i+" can only have one spread variable, and it must be its last variable.");var s=a[t].varRef.propertyChain[0];if(n.includes(s))return d.create("datatype",i+"'s typed variables can't both be named '"+s+"'.");n.push(s)}}return p.create(a.slice(0,-1),a[a.length-1])},[i(y(f,n))]);a(["output-data","out-data"],function(){},function(e,t){e=e.stack;return s("output-data",e,t)||{blocked:!0}},[g],!1),r(["output","out"],function(){return Object.assign(t.create("output",[]))},function(e,t){if(e.section){var n,r=e.section,a=r.stack,o=r.stackTop,i={};for(n in o.tempVariables)n.startsWith("TwineScript_")||(i[n]=o.tempVariables[n]);s("output",a,{changer:t,variables:i,hook:Array.isArray(e.source)?"["+e.source.map(function(e){return e.text}).join("")+"]":e.source}),e.output=!0,o.blocked=!0}},[]),a("error",function(e){if(!e)return d.create("datatype","This (error:) macro was given an empty string.")},function(e,t){e=e.stack;return s("error",e,d.create("user",t))||{blocked:!0}},[String],!1),e("partial","CustomMacro",function(e,a){for(var t=arguments.length,o=new Array(2<t?t-2:0),n=2;n<t;n++)o[n-2]=arguments[n];var r="string"!=typeof a&&a,i=!r&&a;if(!r){if(!u.has(i))return d.create("macrocall",'The macro name given to (partial:), "'.concat(a,"\", isn't the name of a built-in macro."));if("Metadata"===u.get(i).returnType)return d.create("macrocall","(partial:) can't be used with metadata macros such as (".concat(a,":)"))}var s="(partial:".concat(m(a),",").concat(o.map(function(e){return m(e)}),")"),c=p.createFromFn(function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e=u["string"==typeof a?"run":"runCustom"](a,e,o.concat(n));return d.containsError(e)&&(e.message="An error occurred while running the (partial:)-created macro, ".concat(c.TwineScript_ObjectName,":\n")+e.message),e},"a (partial:) custom macro of ".concat(i||r.TwineScript_KnownName?"(".concat(i||r.TwineScript_KnownName,":").concat(o.map(function(e){return m(e)}),")"):"another unnamed custom macro"),function(){return s},(i?u.get(i):r).typeSignature.filter(function(e,t){return t>=o.length||"rest"===e.pattern||"zero or more"===e.pattern}));return c},[y(String,p),o(v)])}),define("repl",["utils","engine","markup","section"],function(e,t,n){e.onStartup(function(){return setTimeout(function(){e.options.debug&&(window.REPL=function(e){e=n.create().eval(t.lex("(print:"+e+")"));return e.TwineScript_Run?e.TwineScript_Run().source:e},window.LEX=function(e){e=t.lex(e);return 1===e.length?e[0]:e})})})}),require.config({paths:{jquery:"../node_modules/jquery/dist/jquery",almond:"../node_modules/almond/almond","es6-shim":"../node_modules/es6-shim/es6-shim",markup:"./markup/markup",lexer:"./markup/lexer",patterns:"./markup/patterns"},deps:["es6-shim","utils/jqueryplugins"]}),require(["jquery","debugmode/mode","renderer","state","section","engine","passages","utils","utils/renderutils","internaltypes/varscope","internaltypes/twineerror","macros","macrolib/values","macrolib/commands","macrolib/datastructures","macrolib/stylechangers","macrolib/enchantments","macrolib/metadata","macrolib/patterns","macrolib/links","macrolib/custommacros","repl"],function($,DebugMode,Renderer,State,Section,Engine,Passages,Utils,_ref140,VarScope){var dialog=_ref140.dialog;function __HarloweEval(text){eval(text+"")}function printJSError(e){var t,n=e.name+": "+e.message;return e.stack&&(t=(e=e.stack.split("\n")).findIndex(function(e){return e.includes("__HarloweEval")}),n+="\n"+e.slice(0,t).join("\n").replace(/\([^\)]+\)/g,"")),"<div style='font-family:monospace;overflow-y:scroll;max-height:30vh'>```"+n+"```</div>"}!function(o){window.onerror=function(e,t,n,r,a){window.onerror=o,Utils.storyElement.parent().append(dialog({message:"Sorry to interrupt, but this page's code has got itself in a mess.\n\n"+printJSError(a)+"\n(This is probably due to a bug in the Harlowe game engine.)"})),"function"==typeof o&&o.apply(void 0,arguments)}}(window.onerror),Utils.onStartup(function(){var n,e,t,r,a=$("tw-storydata");0!==a.length&&(Utils.options.ifid=a.attr("ifid"),(a.attr("options")||"").split(/\s/).forEach(function(e){e&&(Utils.options[e]=!0),"debug"===e&&DebugMode()}),a=(a=a.attr("startnode"))||[].reduce.call($("tw-passagedata"),function(e,t){t=t.getAttribute("pid");return t<e?t:e},1/0),a=$("tw-passagedata[pid='"+a+"']").attr("name"),$(document.documentElement).on("keydown",function(e){13===e.which&&"0"===e.target.getAttribute("tabindex")&&$(e.target).trigger("click")}),n=!1,$("[role=script]").each(function(t){try{__HarloweEval($(this).html())}catch(e){n||(n=!0,dialog({parent:Utils.storyElement.parent(),message:"There is a problem with this story's "+Utils.nth(t+1)+" script:\n\n"+printJSError(e)}))}}),$("[role=stylesheet]").each(function(e,t){$(document.head).append("<style data-title=\"Story stylesheet '".concat(e+1,"'\">").concat($(t).html()))}),(e=Section.create()).stack=[{tempVariables:Object.create(VarScope)}],(r=Passages.loadMetadata(e)).length&&(t=dialog({parent:Utils.storyElement.parent(),message:"These errors occurred when running the `(metadata:)` macro calls in this story's passages:<p></p>"}),r.forEach(function(e){return t.find("p").append(e.render())})),(r=!Utils.options.debug&&State.hasSessionStorage&&sessionStorage.getItem("Saved Session"))&&!0===State.deserialise(e,r)?Engine.showPassage(State.passage):Engine.goToPassage(a))})}),define("harlowe",function(){}),require(["harlowe"])}();
</script>
</body>
</html>