[add] client
Christian Fraß

Christian Fraß commited on 2021-03-08 23:52:24
Zeige 34 geänderte Dateien mit 25106 Einfügungen und 0 Löschungen.

... ...
@@ -0,0 +1,43 @@
1
+<!DOCTYPE HTML>
2
+<html>
3
+	<head>
4
+		<meta charset="utf-8"/>
5
+		<link rel="stylesheet" type="text/css" href="style.css"/>
6
+		<script type="text/javascript" src="logic.js"></script>
7
+	</head>
8
+	<body>
9
+		<select name="language_from">
10
+			<option value="_">*</option>
11
+			<option value="afr">afr</option>
12
+			<option value="dan">dan</option>
13
+			<option value="deu">deu</option>
14
+			<option value="eng">eng</option>
15
+			<option value="flk">flk</option>
16
+			<option value="gem">gem</option>
17
+			<option value="isl">isl</option>
18
+			<option value="nld">nld</option>
19
+			<option value="nob">nob</option>
20
+			<option value="swe">swe</option>
21
+			<option value="yid">yid</option>
22
+		</select>
23
+		<select name="language_to">
24
+			<option value="_">*</option>
25
+			<option value="afr">afr</option>
26
+			<option value="dan">dan</option>
27
+			<option value="deu">deu</option>
28
+			<option value="eng">eng</option>
29
+			<option value="flk">flk</option>
30
+			<option value="gem">gem</option>
31
+			<option value="isl">isl</option>
32
+			<option value="nld">nld</option>
33
+			<option value="nob">nob</option>
34
+			<option value="swe">swe</option>
35
+			<option value="yid">yid</option>
36
+		</select>
37
+		<input type="text" name="token"/>
38
+		<button>query</button>
39
+		<ul id="result">
40
+		</ul>
41
+	</body>
42
+</html>
43
+
... ...
@@ -0,0 +1,8076 @@
1
+var __extends = (this && this.__extends) || (function () {
2
+    var extendStatics = function (d, b) {
3
+        extendStatics = Object.setPrototypeOf ||
4
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+        return extendStatics(d, b);
7
+    };
8
+    return function (d, b) {
9
+        extendStatics(d, b);
10
+        function __() { this.constructor = d; }
11
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+    };
13
+})();
14
+/*
15
+This file is part of »bacterio-plankton:base«.
16
+
17
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
18
+<info@greenscale.de>
19
+
20
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
21
+it under the terms of the GNU Lesser General Public License as published by
22
+the Free Software Foundation, either version 3 of the License, or
23
+(at your option) any later version.
24
+
25
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
26
+but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
+GNU Lesser General Public License for more details.
29
+
30
+You should have received a copy of the GNU Lesser General Public License
31
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
32
+ */
33
+// }
34
+/*
35
+This file is part of »bacterio-plankton:base«.
36
+
37
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
38
+<info@greenscale.de>
39
+
40
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
41
+it under the terms of the GNU Lesser General Public License as published by
42
+the Free Software Foundation, either version 3 of the License, or
43
+(at your option) any later version.
44
+
45
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
46
+but WITHOUT ANY WARRANTY; without even the implied warranty of
47
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48
+GNU Lesser General Public License for more details.
49
+
50
+You should have received a copy of the GNU Lesser General Public License
51
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
52
+ */
53
+/**
54
+ * @author fenris
55
+ */
56
+/*export*/ function pseudopointer_null() {
57
+    return {
58
+        "value": null
59
+    };
60
+}
61
+/**
62
+ * @author fenris
63
+ */
64
+/*export*/ function pseudopointer_make(value) {
65
+    return {
66
+        "value": value
67
+    };
68
+}
69
+/**
70
+ * @author fenris
71
+ */
72
+/*export*/ function pseudopointer_isset(pseudopointer) {
73
+    return (pseudopointer.value != null);
74
+}
75
+/**
76
+ * @author fenris
77
+ */
78
+/*export*/ function pseudopointer_read(pseudopointer) {
79
+    if (pseudopointer.value != null) {
80
+        return pseudopointer.value;
81
+    }
82
+    else {
83
+        var message = "nullpointer dereferencation";
84
+        throw (new Error(message));
85
+    }
86
+}
87
+/**
88
+ * @author fenris
89
+ */
90
+/*export*/ function pseudopointer_write(pseudopointer, value) {
91
+    pseudopointer.value = value;
92
+}
93
+/*
94
+This file is part of »bacterio-plankton:base«.
95
+
96
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
97
+<info@greenscale.de>
98
+
99
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
100
+it under the terms of the GNU Lesser General Public License as published by
101
+the Free Software Foundation, either version 3 of the License, or
102
+(at your option) any later version.
103
+
104
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
105
+but WITHOUT ANY WARRANTY; without even the implied warranty of
106
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
107
+GNU Lesser General Public License for more details.
108
+
109
+You should have received a copy of the GNU Lesser General Public License
110
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
111
+ */
112
+;
113
+var lib_base;
114
+(function (lib_base) {
115
+    /**
116
+     * @author fenris
117
+     */
118
+    function environment() {
119
+        var entries = [
120
+            {
121
+                "id": "web",
122
+                "name": "Web",
123
+                "predicate": function () { return (typeof (document) !== "undefined"); },
124
+            },
125
+            {
126
+                "id": "node",
127
+                "name": "Node.js",
128
+                "predicate": function () { return (typeof (process) !== "undefined"); },
129
+            },
130
+            {
131
+                "id": "rhino",
132
+                "name": "Rhino",
133
+                "predicate": function () { return (typeof (java) !== "undefined"); },
134
+            },
135
+            {
136
+                "id": "webworker",
137
+                "name": "WebWorker",
138
+                "predicate": function () { return (typeof (self["WorkerNavigator"]) !== "undefined"); }
139
+            }
140
+        ];
141
+        var id;
142
+        var found = entries.some(function (entry) {
143
+            if (entry.predicate()) {
144
+                id = entry.id;
145
+                return true;
146
+            }
147
+            else {
148
+                return false;
149
+            }
150
+        });
151
+        if (found) {
152
+            return id;
153
+        }
154
+        else {
155
+            throw (new Error("unknown environment"));
156
+        }
157
+    }
158
+    lib_base.environment = environment;
159
+})(lib_base || (lib_base = {}));
160
+/*
161
+This file is part of »bacterio-plankton:base«.
162
+
163
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
164
+<info@greenscale.de>
165
+
166
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
167
+it under the terms of the GNU Lesser General Public License as published by
168
+the Free Software Foundation, either version 3 of the License, or
169
+(at your option) any later version.
170
+
171
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
172
+but WITHOUT ANY WARRANTY; without even the implied warranty of
173
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
174
+GNU Lesser General Public License for more details.
175
+
176
+You should have received a copy of the GNU Lesser General Public License
177
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
178
+ */
179
+/**
180
+ * @author fenris
181
+ */
182
+var instance_verbosity = 0;
183
+/**
184
+ * @author fenris
185
+ */
186
+function instance_collate(value1, value2) {
187
+    if (typeof (value1) === "object") {
188
+        if (value1 == null) {
189
+            return (value2 == null);
190
+        }
191
+        else {
192
+            if ("_collate" in value1) {
193
+                return value1["_collate"](value2);
194
+            }
195
+            else {
196
+                throw (new Error("[collate]" + " " + "object has no such method"));
197
+            }
198
+        }
199
+    }
200
+    else {
201
+        if (instance_verbosity >= 1) {
202
+            lib_log.warn("[collate]" + " " + "primitive value; using default implementation");
203
+        }
204
+        return (value1 === value2);
205
+    }
206
+}
207
+/**
208
+ * @author fenris
209
+ */
210
+function instance_compare(value1, value2) {
211
+    if (typeof (value1) === "object") {
212
+        if ("_compare" in value1) {
213
+            return value1["_compare"](value2);
214
+        }
215
+        else {
216
+            throw (new Error("[compare]" + " " + "object has no such method"));
217
+        }
218
+    }
219
+    else {
220
+        if (instance_verbosity >= 1) {
221
+            lib_log.warn("[compare]" + " " + "primitive value; using default implementation");
222
+        }
223
+        return (value1 <= value2);
224
+    }
225
+}
226
+/**
227
+ * @author fenris
228
+ */
229
+function instance_clone(value) {
230
+    if (typeof (value) === "object") {
231
+        if ("_clone" in value) {
232
+            return value["_clone"]();
233
+        }
234
+        else {
235
+            throw (new Error("[clone]" + " " + "object has no such method"));
236
+        }
237
+    }
238
+    else {
239
+        if (instance_verbosity >= 1) {
240
+            lib_log.warn("[clone]" + " " + "primitive value; using default implementation");
241
+        }
242
+        return value;
243
+    }
244
+}
245
+/**
246
+ * @desc the ability to generate a string out of the element, which identifies it to a high degree
247
+ * @author fenris
248
+ */
249
+function instance_hash(value) {
250
+    if (typeof (value) === "object") {
251
+        if ("_hash" in value) {
252
+            return value["_hash"]();
253
+        }
254
+        else {
255
+            throw (new Error("[hash]" + " " + "object has no such method"));
256
+        }
257
+    }
258
+    else {
259
+        if (instance_verbosity >= 1) {
260
+            lib_log.warn("[hash]" + " " + "primitive value; using default implementation");
261
+        }
262
+        return String(value);
263
+    }
264
+}
265
+/**
266
+ * @desc the ability to map the element to a textual representation (most likely not injective)
267
+ * @author fenris
268
+ */
269
+function instance_show(value) {
270
+    if (typeof (value) === "object") {
271
+        if (value == null) {
272
+            return "NULL";
273
+        }
274
+        else {
275
+            if ("_show" in value) {
276
+                return value["_show"]();
277
+            }
278
+            else {
279
+                // throw (new Error("[show]" + " " + "object has no such method"));
280
+                return JSON.stringify(value);
281
+            }
282
+        }
283
+    }
284
+    else {
285
+        if (instance_verbosity >= 1) {
286
+            lib_log.warn("[show]" + " " + "primitive value; using default implementation");
287
+        }
288
+        return String(value);
289
+    }
290
+}
291
+/*
292
+This file is part of »bacterio-plankton:base«.
293
+
294
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
295
+<info@greenscale.de>
296
+
297
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
298
+it under the terms of the GNU Lesser General Public License as published by
299
+the Free Software Foundation, either version 3 of the License, or
300
+(at your option) any later version.
301
+
302
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
303
+but WITHOUT ANY WARRANTY; without even the implied warranty of
304
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
305
+GNU Lesser General Public License for more details.
306
+
307
+You should have received a copy of the GNU Lesser General Public License
308
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
309
+ */
310
+/**
311
+ * @todo outsource to dedicated plankton-lib
312
+ */
313
+var lib_log;
314
+(function (lib_log) {
315
+    /**
316
+     * @author fenris
317
+     */
318
+    function log() {
319
+        var args = [];
320
+        for (var _i = 0; _i < arguments.length; _i++) {
321
+            args[_i] = arguments[_i];
322
+        }
323
+        /*window.*/ console.log.apply(console, args);
324
+    }
325
+    lib_log.log = log;
326
+    /**
327
+     * @author fenris
328
+     */
329
+    function info() {
330
+        var args = [];
331
+        for (var _i = 0; _i < arguments.length; _i++) {
332
+            args[_i] = arguments[_i];
333
+        }
334
+        /*window.*/ console.info.apply(console, args);
335
+    }
336
+    lib_log.info = info;
337
+    /**
338
+     * @author fenris
339
+     */
340
+    function warn() {
341
+        var args = [];
342
+        for (var _i = 0; _i < arguments.length; _i++) {
343
+            args[_i] = arguments[_i];
344
+        }
345
+        /*window.*/ console.warn.apply(console, args);
346
+    }
347
+    lib_log.warn = warn;
348
+    /**
349
+     * @author fenris
350
+     */
351
+    function error() {
352
+        var args = [];
353
+        for (var _i = 0; _i < arguments.length; _i++) {
354
+            args[_i] = arguments[_i];
355
+        }
356
+        /*window.*/ console.error.apply(console, args);
357
+    }
358
+    lib_log.error = error;
359
+})(lib_log || (lib_log = {}));
360
+/*
361
+This file is part of »bacterio-plankton:base«.
362
+
363
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
364
+<info@greenscale.de>
365
+
366
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
367
+it under the terms of the GNU Lesser General Public License as published by
368
+the Free Software Foundation, either version 3 of the License, or
369
+(at your option) any later version.
370
+
371
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
372
+but WITHOUT ANY WARRANTY; without even the implied warranty of
373
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
374
+GNU Lesser General Public License for more details.
375
+
376
+You should have received a copy of the GNU Lesser General Public License
377
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
378
+ */
379
+/**
380
+ * @author frac
381
+ */
382
+var class_observer = /** @class */ (function () {
383
+    /**
384
+     * @author frac
385
+     */
386
+    function class_observer() {
387
+        this.counter = 0;
388
+        this.actions = {};
389
+        this.buffer = [];
390
+    }
391
+    /**
392
+     * @author frac
393
+     */
394
+    class_observer.prototype.empty = function () {
395
+        return (Object.keys(this.actions).length == 0);
396
+    };
397
+    /**
398
+     * @author frac
399
+     */
400
+    class_observer.prototype.flush = function () {
401
+        this.actions = {};
402
+    };
403
+    /**
404
+     * @author frac
405
+     */
406
+    class_observer.prototype.set = function (id, action) {
407
+        this.actions[id] = action;
408
+    };
409
+    /**
410
+     * @author frac
411
+     */
412
+    class_observer.prototype.del = function (id) {
413
+        delete this.actions[id];
414
+    };
415
+    /**
416
+     * @author frac
417
+     */
418
+    class_observer.prototype.add = function (action) {
419
+        this.set((this.counter++).toString(), action);
420
+    };
421
+    /**
422
+     * @author frac
423
+     */
424
+    class_observer.prototype.notify = function (information, delayed) {
425
+        var _this = this;
426
+        if (information === void 0) { information = {}; }
427
+        if (delayed === void 0) { delayed = false; }
428
+        if (delayed) {
429
+            this.buffer.push(information);
430
+        }
431
+        else {
432
+            Object.keys(this.actions).forEach(function (id) { return _this.actions[id](information); });
433
+        }
434
+    };
435
+    /**
436
+     * @author frac
437
+     */
438
+    class_observer.prototype.rollout = function () {
439
+        var _this = this;
440
+        this.buffer.forEach(function (information) { return _this.notify(information, false); });
441
+        this.buffer = [];
442
+    };
443
+    return class_observer;
444
+}());
445
+/**
446
+ * @author frac
447
+ */
448
+/*
449
+export interface interface_readable<type_value> {
450
+
451
+    |**
452
+     * @author frac
453
+     *|
454
+    read() : type_executor<type_value, Error>;
455
+
456
+}
457
+ */
458
+/**
459
+ * @author frac
460
+ */
461
+/*
462
+export interface interface_writeable<type_value> {
463
+
464
+    |**
465
+     * @author frac
466
+     *|
467
+    write(value : type_value) : type_executor<void, Error>;
468
+
469
+}
470
+ */
471
+/*
472
+This file is part of »bacterio-plankton:base«.
473
+
474
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
475
+<info@greenscale.de>
476
+
477
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
478
+it under the terms of the GNU Lesser General Public License as published by
479
+the Free Software Foundation, either version 3 of the License, or
480
+(at your option) any later version.
481
+
482
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
483
+but WITHOUT ANY WARRANTY; without even the implied warranty of
484
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
485
+GNU Lesser General Public License for more details.
486
+
487
+You should have received a copy of the GNU Lesser General Public License
488
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
489
+ */
490
+var lib_maybe;
491
+(function (lib_maybe) {
492
+    /**
493
+     * @author fenris
494
+     */
495
+    function make_nothing() {
496
+        return {
497
+            "kind": "nothing",
498
+            "parameters": {}
499
+        };
500
+    }
501
+    lib_maybe.make_nothing = make_nothing;
502
+    /**
503
+     * @author fenris
504
+     */
505
+    function make_just(value) {
506
+        return {
507
+            "kind": "just",
508
+            "parameters": {
509
+                "value": value
510
+            }
511
+        };
512
+    }
513
+    lib_maybe.make_just = make_just;
514
+    /**
515
+     * @author fenris
516
+     */
517
+    function is_nothing(maybe) {
518
+        return (maybe.kind === "nothing");
519
+    }
520
+    lib_maybe.is_nothing = is_nothing;
521
+    /**
522
+     * @author fenris
523
+     */
524
+    function is_just(maybe) {
525
+        return (maybe.kind === "just");
526
+    }
527
+    lib_maybe.is_just = is_just;
528
+    /**
529
+     * @author fenris
530
+     */
531
+    function cull(maybe) {
532
+        if (!is_just(maybe)) {
533
+            var message = "cull from nothing";
534
+            throw (new Error(message));
535
+        }
536
+        else {
537
+            var value = maybe.parameters["value"];
538
+            return value;
539
+        }
540
+    }
541
+    lib_maybe.cull = cull;
542
+    /**
543
+     * @author fenris
544
+     */
545
+    function propagate(maybe, function_) {
546
+        if (!is_just(maybe)) {
547
+        }
548
+        else {
549
+            var value = maybe.parameters["value"];
550
+            var maybe_ = function_(value);
551
+            return maybe_;
552
+        }
553
+    }
554
+    lib_maybe.propagate = propagate;
555
+})(lib_maybe || (lib_maybe = {}));
556
+/**
557
+ * @author fenris
558
+ */
559
+/*export*/ var class_maybe = /** @class */ (function () {
560
+    function class_maybe() {
561
+    }
562
+    /**
563
+     * @desc whether the wrapper is nothing
564
+     * @author fenris
565
+     */
566
+    class_maybe.prototype.is_nothing = function () {
567
+        throw (new Error("not implemented: class_maybe.is_nothing"));
568
+    };
569
+    /**
570
+     * @desc whether the wrapper is just
571
+     * @author fenris
572
+     */
573
+    class_maybe.prototype.is_just = function () {
574
+        throw (new Error("not implemented: class_maybe.is_just"));
575
+    };
576
+    /**
577
+     * @desc return the value, stored in the maybe-wrapper
578
+     * @author fenris
579
+     */
580
+    class_maybe.prototype.cull = function () {
581
+        throw (new Error("not implemented: class_maybe.cull"));
582
+    };
583
+    /**
584
+     * @author fenris
585
+     */
586
+    class_maybe.prototype.toString = function () {
587
+        throw (new Error("not implemented: class_maybe.cull"));
588
+    };
589
+    /**
590
+     * @author fenris
591
+     */
592
+    class_maybe.prototype.distinguish = function (action_just, action_nothing) {
593
+        if (action_nothing === void 0) { action_nothing = function () { }; }
594
+        throw (new Error("not implemented: class_maybe.distinguish"));
595
+    };
596
+    /**
597
+     * @author fenris
598
+     */
599
+    class_maybe.prototype.propagate = function (action) {
600
+        throw (new Error("not implemented: class_maybe.propagate"));
601
+    };
602
+    /**
603
+     * @desc [implementation]
604
+     * @author fenris
605
+     */
606
+    class_maybe.prototype._show = function () {
607
+        return this.toString();
608
+    };
609
+    return class_maybe;
610
+}());
611
+/**
612
+ * @author fenris
613
+ */
614
+/*export*/ var class_nothing = /** @class */ (function (_super) {
615
+    __extends(class_nothing, _super);
616
+    /**
617
+     * @author fenris
618
+     */
619
+    function class_nothing(reason) {
620
+        if (reason === void 0) { reason = null; }
621
+        var _this = _super.call(this) || this;
622
+        _this.reason = reason;
623
+        return _this;
624
+    }
625
+    /**
626
+     * @author fenris
627
+     */
628
+    class_nothing.prototype.is_nothing = function () {
629
+        return true;
630
+    };
631
+    /**
632
+     * @author fenris
633
+     */
634
+    class_nothing.prototype.is_just = function () {
635
+        return false;
636
+    };
637
+    /**
638
+     * @author fenris
639
+     */
640
+    class_nothing.prototype.cull = function () {
641
+        var message = "you shouldn't cull a nothing-value …";
642
+        lib_log.warn(message);
643
+        return null;
644
+    };
645
+    /**
646
+     * @author fenris
647
+     */
648
+    class_nothing.prototype.toString = function () {
649
+        return "<\u00B7>";
650
+    };
651
+    /**
652
+     * @author fenris
653
+     */
654
+    class_nothing.prototype.reason_get = function () {
655
+        var content = ((this.reason == null) ? "·" : this.reason);
656
+        return "<- " + content + " ->";
657
+    };
658
+    /**
659
+     * @author fenris
660
+     */
661
+    class_nothing.prototype.distinguish = function (action_just, action_nothing) {
662
+        if (action_nothing === void 0) { action_nothing = function () { }; }
663
+        action_nothing(this.reason);
664
+    };
665
+    /**
666
+     * @author fenris
667
+     */
668
+    class_nothing.prototype.propagate = function (action) {
669
+        return (new class_nothing(this.reason));
670
+    };
671
+    return class_nothing;
672
+}(class_maybe));
673
+/**
674
+ * @author fenris
675
+ */
676
+/*export*/ var class_just = /** @class */ (function (_super) {
677
+    __extends(class_just, _super);
678
+    /**
679
+     * @author fenris
680
+     */
681
+    function class_just(value) {
682
+        var _this = _super.call(this) || this;
683
+        _this.value = value;
684
+        return _this;
685
+    }
686
+    /**
687
+     * @author fenris
688
+     */
689
+    class_just.prototype.is_nothing = function () {
690
+        return false;
691
+    };
692
+    /**
693
+     * @author fenris
694
+     */
695
+    class_just.prototype.is_just = function () {
696
+        return true;
697
+    };
698
+    /**
699
+     * @author fenris
700
+     */
701
+    class_just.prototype.cull = function () {
702
+        return this.value;
703
+    };
704
+    /**
705
+     * @author fenris
706
+     */
707
+    class_just.prototype.toString = function () {
708
+        var content = instance_show(this.value);
709
+        return "<+ " + content + " +>";
710
+    };
711
+    /**
712
+     * @author fenris
713
+     */
714
+    class_just.prototype.distinguish = function (action_just, action_nothing) {
715
+        if (action_nothing === void 0) { action_nothing = function () { }; }
716
+        action_just(this.value);
717
+    };
718
+    /**
719
+     * @author fenris
720
+     */
721
+    class_just.prototype.propagate = function (action) {
722
+        return action(this.value);
723
+    };
724
+    return class_just;
725
+}(class_maybe));
726
+/*
727
+This file is part of »bacterio-plankton:base«.
728
+
729
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
730
+<info@greenscale.de>
731
+
732
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
733
+it under the terms of the GNU Lesser General Public License as published by
734
+the Free Software Foundation, either version 3 of the License, or
735
+(at your option) any later version.
736
+
737
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
738
+but WITHOUT ANY WARRANTY; without even the implied warranty of
739
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
740
+GNU Lesser General Public License for more details.
741
+
742
+You should have received a copy of the GNU Lesser General Public License
743
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
744
+ */
745
+/**
746
+ * @author frac
747
+ */
748
+var class_error = /** @class */ (function (_super) {
749
+    __extends(class_error, _super);
750
+    /**
751
+     * @author frac
752
+     */
753
+    function class_error(message, suberrors) {
754
+        if (suberrors === void 0) { suberrors = []; }
755
+        var _this = _super.call(this, message) || this;
756
+        _this.suberrors = suberrors;
757
+        _this.mess = message;
758
+        return _this;
759
+    }
760
+    /**
761
+     * @override
762
+     * @author frac
763
+     */
764
+    class_error.prototype.toString = function () {
765
+        return ( /*super.toString()*/this.mess + " " + ("[" + this.suberrors.map(function (x) { return x.toString(); }).join(",") + "]"));
766
+    };
767
+    return class_error;
768
+}(Error));
769
+/*
770
+This file is part of »bacterio-plankton:object«.
771
+
772
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
773
+<info@greenscale.de>
774
+
775
+»bacterio-plankton:object« is free software: you can redistribute it and/or modify
776
+it under the terms of the GNU Lesser General Public License as published by
777
+the Free Software Foundation, either version 3 of the License, or
778
+(at your option) any later version.
779
+
780
+»bacterio-plankton:object« is distributed in the hope that it will be useful,
781
+but WITHOUT ANY WARRANTY; without even the implied warranty of
782
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
783
+GNU Lesser General Public License for more details.
784
+
785
+You should have received a copy of the GNU Lesser General Public License
786
+along with »bacterio-plankton:object«. If not, see <http://www.gnu.org/licenses/>.
787
+ */
788
+var lib_object;
789
+(function (lib_object) {
790
+    /**
791
+     * @author fenris
792
+     */
793
+    function fetch(object, fieldname, fallback, escalation) {
794
+        if (fallback === void 0) { fallback = null; }
795
+        if (escalation === void 0) { escalation = 1; }
796
+        if ((fieldname in object) && (object[fieldname] !== undefined)) {
797
+            return object[fieldname];
798
+        }
799
+        else {
800
+            switch (escalation) {
801
+                case 0: {
802
+                    return fallback;
803
+                    break;
804
+                }
805
+                case 1: {
806
+                    var message = ("field '" + fieldname + "' not in structure");
807
+                    message += ("; using fallback value '" + String(fallback) + "'");
808
+                    // console.warn(message);
809
+                    return fallback;
810
+                    break;
811
+                }
812
+                case 2: {
813
+                    var message = ("field '" + fieldname + "' not in structure");
814
+                    throw (new Error(message));
815
+                    break;
816
+                }
817
+                default: {
818
+                    throw (new Error("invalid escalation level " + escalation));
819
+                    break;
820
+                }
821
+            }
822
+        }
823
+    }
824
+    lib_object.fetch = fetch;
825
+    /**
826
+     * @author fenris
827
+     */
828
+    function map(object_from, transformator) {
829
+        var object_to = {};
830
+        Object.keys(object_from).forEach(function (key) { return (object_to[key] = transformator(object_from[key], key)); });
831
+        return object_to;
832
+    }
833
+    lib_object.map = map;
834
+    /**
835
+     * @desc gibt ein Objekt mit bestimmten Einträgen des Eingabe-Objekts zurück
836
+     * @author fenris
837
+     */
838
+    function filter(object_from, predicate) {
839
+        var object_to = {};
840
+        Object.keys(object_from).forEach(function (key) {
841
+            var value = object_from[key];
842
+            if (predicate(value, key)) {
843
+                object_to[key] = value;
844
+            }
845
+        });
846
+        return object_to;
847
+    }
848
+    lib_object.filter = filter;
849
+    /**
850
+     * @desc wandelt ein Array mit Einträgen der Form {key,value} in ein entsprechendes Objekt um
851
+     * @author fenris
852
+     */
853
+    function from_array(array) {
854
+        var object = {};
855
+        array.forEach(function (entry) { return (object[entry.key] = entry.value); });
856
+        return object;
857
+    }
858
+    lib_object.from_array = from_array;
859
+    /**
860
+     * @desc wandelt ein Objekt in ein entsprechendes Array mit Einträgen der Form {key,value} um
861
+     * @author fenris
862
+     */
863
+    function to_array(object) {
864
+        var array = [];
865
+        Object.keys(object).forEach(function (key) { return array.push({ "key": key, "value": object[key] }); });
866
+        return array;
867
+    }
868
+    lib_object.to_array = to_array;
869
+    /**
870
+     * @desc gibt eine Liste von Schlüsseln eines Objekts zurück
871
+     * @author fenris
872
+     */
873
+    function keys(object) {
874
+        return Object.keys(object);
875
+    }
876
+    lib_object.keys = keys;
877
+    /**
878
+     * @desc gibt eine Liste von Werten eines Objekts zurück
879
+     * @author fenris
880
+     */
881
+    function values(object) {
882
+        return to_array(object).map(function (entry) { return entry.value; });
883
+    }
884
+    lib_object.values = values;
885
+    /**
886
+     * @desc liest ein Baum-artiges Objekt an einer bestimmten Stelle aus
887
+     * @author fenris
888
+     */
889
+    function path_read(object, path, fallback, escalation) {
890
+        if (fallback === void 0) { fallback = null; }
891
+        if (escalation === void 0) { escalation = 1; }
892
+        var steps = ((path.length == 0) ? [] : path.split("."));
893
+        if (steps.length == 0) {
894
+            throw (new Error("empty path"));
895
+        }
896
+        else {
897
+            var position_1 = object;
898
+            var reachable = (position_1 != null) && steps.slice(0, steps.length - 1).every(function (step) {
899
+                position_1 = object_fetch(position_1, step, null, 0);
900
+                return (position_1 != null);
901
+            });
902
+            if (reachable) {
903
+                return object_fetch(position_1, steps[steps.length - 1], fallback, escalation);
904
+            }
905
+            else {
906
+                return object_fetch({}, "_dummy_", fallback, escalation);
907
+            }
908
+        }
909
+    }
910
+    lib_object.path_read = path_read;
911
+    /**
912
+     * @desc schreibt einen Wert an eine bestimmte Stelle in einem Baum-artigen Objekt
913
+     * @author fenris
914
+     */
915
+    function path_write(object, path, value, construct) {
916
+        if (construct === void 0) { construct = true; }
917
+        var steps = ((path.length == 0) ? [] : path.split("."));
918
+        if (steps.length == 0) {
919
+            throw (new Error("empty path"));
920
+        }
921
+        else {
922
+            var position_2 = object;
923
+            var reachable = steps.slice(0, steps.length - 1).every(function (step) {
924
+                var position_ = object_fetch(position_2, step, null, 0);
925
+                if (position_ == null) {
926
+                    if (construct) {
927
+                        position_2[step] = {};
928
+                        position_2 = position_2[step];
929
+                        return true;
930
+                    }
931
+                    else {
932
+                        return false;
933
+                    }
934
+                }
935
+                else {
936
+                    position_2 = position_;
937
+                    return true;
938
+                }
939
+            });
940
+            if (reachable) {
941
+                position_2[steps[steps.length - 1]] = value;
942
+            }
943
+            else {
944
+                var message = ("path '" + path + "' does not exist and may not be constructed");
945
+                throw (new Error(message));
946
+            }
947
+        }
948
+    }
949
+    lib_object.path_write = path_write;
950
+    /**
951
+     * @desc prüft ob ein Objekt einem bestimmten Muster entspricht
952
+     * @param {Object} object das zu prüfende Objekt
953
+     * @param {Object} pattern das einzuhaltende Muster
954
+     * @param {Function} connlate eine Funktion zum Feststellen der Gleichheit von Einzelwerten
955
+     * @author fenris
956
+     */
957
+    function matches(object, pattern, collate) {
958
+        if (collate === void 0) { collate = instance_collate; }
959
+        return Object.keys(pattern).every(function (key) { return collate(pattern[key], object[key]); });
960
+    }
961
+    lib_object.matches = matches;
962
+    /**
963
+     * @desc erzeugt eine Projektion eines Baum-artigen Objekts in ein Listen-artiges Objekt
964
+     * @param {string} [separator] welches Zeichen als Trenner zwischen zwei Pfad-Schritten verwendet werden soll
965
+     * @author fenris
966
+     */
967
+    function flatten(value, separator, key_for_element) {
968
+        if (separator === void 0) { separator = "."; }
969
+        if (key_for_element === void 0) { key_for_element = (function (index) { return ("element_" + index.toFixed(0)); }); }
970
+        var integrate = function (result, key_, value_) {
971
+            if (value_ == null) {
972
+                result[key_] = value_;
973
+            }
974
+            else {
975
+                // primitive Werte direkt übernehmen
976
+                if (typeof (value_) != "object") {
977
+                    result[key_] = value_;
978
+                }
979
+                // sonst durch rekursiven Aufruf die flache Variante des Wertes ermitteln und einarbeiten
980
+                else {
981
+                    var result_1 = flatten(value_);
982
+                    Object.keys(result_1)
983
+                        .forEach(function (key__) {
984
+                        var value__ = result_1[key__];
985
+                        var key_new = (key_ + separator + key__);
986
+                        result[key_new] = value__;
987
+                    });
988
+                }
989
+            }
990
+        };
991
+        if ((value === null) || (value === undefined)) {
992
+            return null;
993
+        }
994
+        else {
995
+            var result_2 = {};
996
+            if (typeof (value) != "object") {
997
+                result_2["value"] = value;
998
+            }
999
+            else {
1000
+                if (value instanceof Array) {
1001
+                    var array = (value);
1002
+                    array
1003
+                        .forEach(function (element, index) {
1004
+                        integrate(result_2, key_for_element(index), element);
1005
+                    });
1006
+                }
1007
+                else {
1008
+                    var object_1 = (value);
1009
+                    Object.keys(object_1)
1010
+                        .forEach(function (key) {
1011
+                        integrate(result_2, key, object_1[key]);
1012
+                    });
1013
+                }
1014
+            }
1015
+            return result_2;
1016
+        }
1017
+    }
1018
+    lib_object.flatten = flatten;
1019
+    /**
1020
+     * @author fenris
1021
+     */
1022
+    function clash(x, y, _a) {
1023
+        var _b = _a === void 0 ? {} : _a, _c = _b["overwrite"], overwrite = _c === void 0 ? true : _c, _d = _b["hooks"], _e = (_d === void 0 ? {} : _d)["existing"], hook_existing = _e === void 0 ? null : _e;
1024
+        if (hook_existing == null) {
1025
+            (function (key, value_old, value_new) { return console.warn("field " + key + " already defined"); });
1026
+        }
1027
+        var z = {};
1028
+        Object.keys(x).forEach(function (key) {
1029
+            z[key] = x[key];
1030
+        });
1031
+        Object.keys(y).forEach(function (key) {
1032
+            if (key in z) {
1033
+                if (hook_existing != null) {
1034
+                    hook_existing(key, z[key], y[key]);
1035
+                }
1036
+                if (overwrite) {
1037
+                    z[key] = y[key];
1038
+                }
1039
+            }
1040
+            else {
1041
+                z[key] = y[key];
1042
+            }
1043
+        });
1044
+        return z;
1045
+    }
1046
+    lib_object.clash = clash;
1047
+    /**
1048
+     * @author fenris
1049
+     */
1050
+    function patch(core, mantle, deep, path) {
1051
+        if (deep === void 0) { deep = true; }
1052
+        if (path === void 0) { path = null; }
1053
+        if (mantle == null) {
1054
+            console.warn("mantle is null; core was", core);
1055
+        }
1056
+        else {
1057
+            Object.keys(mantle).forEach(function (key) {
1058
+                var path_ = ((path == null) ? key : path + "." + key);
1059
+                var value_mantle = mantle[key];
1060
+                if (!(key in core)) {
1061
+                    if ((typeof (value_mantle) == "object") && (value_mantle != null) && deep) {
1062
+                        if (value_mantle instanceof Array) {
1063
+                            core[key] = [];
1064
+                            value_mantle.forEach(function (element) {
1065
+                                if ((typeof (element) == "object") && (element != null)) {
1066
+                                    var element_ = {};
1067
+                                    patch(element_, element);
1068
+                                    core[key].push(element_);
1069
+                                }
1070
+                                else {
1071
+                                    core[key].push(element);
1072
+                                }
1073
+                            });
1074
+                        }
1075
+                        else {
1076
+                            core[key] = {};
1077
+                            patch(core[key], value_mantle, deep, path_);
1078
+                        }
1079
+                    }
1080
+                    else {
1081
+                        core[key] = value_mantle;
1082
+                    }
1083
+                }
1084
+                else {
1085
+                    var value_core = core[key];
1086
+                    if (typeof (value_core) == typeof (value_mantle)) {
1087
+                        if ((typeof (value_mantle) == "object") && (value_mantle != null) && deep) {
1088
+                            patch(core[key], value_mantle, deep, path_);
1089
+                        }
1090
+                        else {
1091
+                            core[key] = value_mantle;
1092
+                        }
1093
+                    }
1094
+                    else {
1095
+                        if ((value_core != null) && (value_mantle != null)) {
1096
+                            var message = "objects have different shapes at path '" + path_ + "'; core has type '" + typeof (value_core) + "' and mantle has type '" + typeof (value_mantle) + "'";
1097
+                            console.warn(message);
1098
+                        }
1099
+                        core[key] = value_mantle;
1100
+                        // throw (new Error(message));
1101
+                    }
1102
+                }
1103
+            });
1104
+        }
1105
+    }
1106
+    lib_object.patch = patch;
1107
+    /**
1108
+     * @author fenris
1109
+     */
1110
+    function patched(core, mantle, deep) {
1111
+        if (deep === void 0) { deep = undefined; }
1112
+        var result = {};
1113
+        patch(result, core, deep);
1114
+        patch(result, mantle, deep);
1115
+        return result;
1116
+    }
1117
+    lib_object.patched = patched;
1118
+    /**
1119
+     * @author fenris
1120
+     */
1121
+    function attached(object, key, value) {
1122
+        var mantle = {};
1123
+        mantle[key] = value;
1124
+        return patched(object, mantle, false);
1125
+    }
1126
+    lib_object.attached = attached;
1127
+    /**
1128
+     * @author fenris
1129
+     */
1130
+    function copy(object) {
1131
+        return patched({}, object);
1132
+    }
1133
+    lib_object.copy = copy;
1134
+})(lib_object || (lib_object = {}));
1135
+/**
1136
+ * @desc adapters for old syntax
1137
+ * @author fenris
1138
+ */
1139
+var object_fetch = lib_object.fetch;
1140
+var object_map = lib_object.map;
1141
+var object_a2o = lib_object.from_array;
1142
+var object_o2a = lib_object.to_array;
1143
+var object_matches = lib_object.matches;
1144
+var object_clash = lib_object.clash;
1145
+/*
1146
+This file is part of »bacterio-plankton:shape«.
1147
+
1148
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1149
+<info@greenscale.de>
1150
+
1151
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1152
+it under the terms of the GNU Lesser General Public License as published by
1153
+the Free Software Foundation, either version 3 of the License, or
1154
+(at your option) any later version.
1155
+
1156
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1157
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1158
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1159
+GNU Lesser General Public License for more details.
1160
+
1161
+You should have received a copy of the GNU Lesser General Public License
1162
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1163
+ */
1164
+var lib_shape;
1165
+(function (lib_shape) {
1166
+    /**
1167
+     * @author fenris
1168
+     */
1169
+    var _pool = {};
1170
+    /**
1171
+     * @author fenris
1172
+     */
1173
+    var _aliases = {};
1174
+    /**
1175
+     * @author fenris
1176
+     */
1177
+    function list() {
1178
+        return [].concat(Object.keys(_pool)).concat(Object.keys(_aliases));
1179
+    }
1180
+    lib_shape.list = list;
1181
+    /**
1182
+     * @author fenris
1183
+     */
1184
+    function inspection_create() {
1185
+        return {
1186
+            "messages": []
1187
+        };
1188
+    }
1189
+    lib_shape.inspection_create = inspection_create;
1190
+    /**
1191
+     * @author fenris
1192
+     */
1193
+    function inspection_add(main, message) {
1194
+        main.messages.push(message);
1195
+    }
1196
+    lib_shape.inspection_add = inspection_add;
1197
+    /**
1198
+     * @author fenris
1199
+     */
1200
+    function inspection_extend(main, prefix, sub) {
1201
+        main.messages = main.messages.concat(sub.messages.map(message => `${prefix}: ${message}`));
1202
+    }
1203
+    lib_shape.inspection_extend = inspection_extend;
1204
+    /**
1205
+     * @author fenris
1206
+     * @todo check for existing
1207
+     */
1208
+    function register({ "name": name, "make": make, "inspect": _inspect, "stance": _stance, "show": _show, }) {
1209
+        const entry = {
1210
+            "name": name,
1211
+            "make": make,
1212
+            "inspect": _inspect,
1213
+            "stance": _stance,
1214
+            "show": _show,
1215
+        };
1216
+        _pool[name] = entry;
1217
+    }
1218
+    lib_shape.register = register;
1219
+    /**
1220
+     * @author fenris
1221
+     * @todo check for existing
1222
+     */
1223
+    function define_alias({ "name": name, "target": target, }) {
1224
+        const entry = {
1225
+            "name": "alias",
1226
+            "target": target,
1227
+        };
1228
+        _aliases[name] = entry;
1229
+    }
1230
+    lib_shape.define_alias = define_alias;
1231
+    /**
1232
+     * @author fenris
1233
+     * @todo check for existing
1234
+     */
1235
+    /*
1236
+    export function inspect_jstype(
1237
+        inspection,
1238
+        jstype_expected : string,
1239
+        value : any
1240
+    ) : void {
1241
+        let jstype_actual : string = typeof(value);
1242
+        if (jstype_actual === jstype_expected) {
1243
+            // all good
1244
+        }
1245
+        else {
1246
+            inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
1247
+        }
1248
+    }
1249
+     */
1250
+    /**
1251
+     * @author fenris
1252
+     */
1253
+    function make(raw) {
1254
+        const name = raw["name"];
1255
+        if (_aliases.hasOwnProperty(name)) {
1256
+            const alias = _aliases[name];
1257
+            return alias.target;
1258
+        }
1259
+        else {
1260
+            if (_pool.hasOwnProperty(name)) {
1261
+                const entry = _pool[name];
1262
+                const parameters = entry.make(raw["parameters"] || {}, make);
1263
+                return {
1264
+                    "name": name,
1265
+                    "parameters": parameters,
1266
+                };
1267
+            }
1268
+            else {
1269
+                const message = `no shape registered with name '${name}'`;
1270
+                throw (new Error(message));
1271
+            }
1272
+        }
1273
+    }
1274
+    lib_shape.make = make;
1275
+    /**
1276
+     * @author fenris
1277
+     */
1278
+    function inspect(shape, value) {
1279
+        if (_pool.hasOwnProperty(shape.name)) {
1280
+            const entry = _pool[shape.name];
1281
+            return entry.inspect(shape.parameters, value, inspect);
1282
+        }
1283
+        else {
1284
+            const message = `no shape registered with name '${shape.name}'`;
1285
+            throw (new Error(message));
1286
+        }
1287
+    }
1288
+    lib_shape.inspect = inspect;
1289
+    /**
1290
+     * @author fenris
1291
+     */
1292
+    function check(shape, value) {
1293
+        if (_pool.hasOwnProperty(shape.name)) {
1294
+            const entry = _pool[shape.name];
1295
+            const inspection = inspect(shape, value);
1296
+            inspection.messages
1297
+                .forEach((message) => { console.warn(message); });
1298
+            return (inspection.messages.length === 0);
1299
+        }
1300
+        else {
1301
+            const message = `no shape registered with name '${shape.name}'`;
1302
+            throw (new Error(message));
1303
+        }
1304
+    }
1305
+    lib_shape.check = check;
1306
+    /**
1307
+     * @author fenris
1308
+     */
1309
+    function stance(shape, bindings) {
1310
+        if (_pool.hasOwnProperty(shape.name)) {
1311
+            const entry = _pool[shape.name];
1312
+            return entry.stance(shape.parameters, bindings, stance);
1313
+        }
1314
+        else {
1315
+            const message = `no shape registered with name '${shape.name}'`;
1316
+            throw (new Error(message));
1317
+        }
1318
+    }
1319
+    lib_shape.stance = stance;
1320
+    /**
1321
+     * @author fenris
1322
+     */
1323
+    function show(shape) {
1324
+        if (_pool.hasOwnProperty(shape.name)) {
1325
+            const entry = _pool[shape.name];
1326
+            return entry.show(shape.parameters, show);
1327
+        }
1328
+        else {
1329
+            const message = `no shape registered with name '${shape.name}'`;
1330
+            throw (new Error(message));
1331
+        }
1332
+    }
1333
+    lib_shape.show = show;
1334
+})(lib_shape || (lib_shape = {}));
1335
+/*
1336
+This file is part of »bacterio-plankton:shape«.
1337
+
1338
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1339
+<info@greenscale.de>
1340
+
1341
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1342
+it under the terms of the GNU Lesser General Public License as published by
1343
+the Free Software Foundation, either version 3 of the License, or
1344
+(at your option) any later version.
1345
+
1346
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1347
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1348
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1349
+GNU Lesser General Public License for more details.
1350
+
1351
+You should have received a copy of the GNU Lesser General Public License
1352
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1353
+ */
1354
+var lib_shape;
1355
+(function (lib_shape) {
1356
+    /**
1357
+     * @author fenris
1358
+     */
1359
+    function variable_make({ "name": name }) {
1360
+        if (name == undefined) {
1361
+            let message = `mandatory parameter 'name' missing`;
1362
+            throw (new Error(message));
1363
+        }
1364
+        else {
1365
+            return {
1366
+                "name": name,
1367
+            };
1368
+        }
1369
+    }
1370
+    /**
1371
+     * @author fenris
1372
+     */
1373
+    function variable_inspect(parameters, value, _inspect) {
1374
+        let inspection = lib_shape.inspection_create();
1375
+        let message = "cannot inspect a value against a type variable";
1376
+        console.warn(message + "; will just pass ...");
1377
+        // throw (new Error(message));
1378
+        return inspection;
1379
+    }
1380
+    /**
1381
+     * @author fenris
1382
+     */
1383
+    function variable_stance(parameters, bindings, _stance) {
1384
+        if (parameters.name in bindings) {
1385
+            return bindings[parameters.name];
1386
+        }
1387
+        else {
1388
+            return {
1389
+                "name": "variable",
1390
+                "parameters": parameters
1391
+            };
1392
+        }
1393
+    }
1394
+    /**
1395
+     * @author fenris
1396
+     */
1397
+    function variable_show(parameters, _show) {
1398
+        let str;
1399
+        // core
1400
+        {
1401
+            str = ("$" + parameters.name);
1402
+        }
1403
+        return str;
1404
+    }
1405
+    /**
1406
+     * @author fenris
1407
+     */
1408
+    lib_shape.register({
1409
+        "name": "variable",
1410
+        "make": variable_make,
1411
+        "inspect": variable_inspect,
1412
+        "stance": variable_stance,
1413
+        "show": variable_show,
1414
+    });
1415
+})(lib_shape || (lib_shape = {}));
1416
+/*
1417
+This file is part of »bacterio-plankton:shape«.
1418
+
1419
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1420
+<info@greenscale.de>
1421
+
1422
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1423
+it under the terms of the GNU Lesser General Public License as published by
1424
+the Free Software Foundation, either version 3 of the License, or
1425
+(at your option) any later version.
1426
+
1427
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1428
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1429
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1430
+GNU Lesser General Public License for more details.
1431
+
1432
+You should have received a copy of the GNU Lesser General Public License
1433
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1434
+ */
1435
+var lib_shape;
1436
+(function (lib_shape) {
1437
+    /**
1438
+     * @author fenris
1439
+     */
1440
+    function function_make({ "soft": soft = false, "shape_input": shape_input, "shape_output": shape_output, "defaultvalue": defaultvalue = undefined, }, _make) {
1441
+        if (shape_input === undefined) {
1442
+            let message = `mandatory parameter 'shape_input' missing`;
1443
+            throw (new Error(message));
1444
+        }
1445
+        if (shape_output === undefined) {
1446
+            let message = `mandatory parameter 'shape_output' missing`;
1447
+            throw (new Error(message));
1448
+        }
1449
+        if (defaultvalue === undefined) {
1450
+            defaultvalue = (soft ? null : (x => x));
1451
+        }
1452
+        return {
1453
+            "soft": soft,
1454
+            "shape_input": _make(shape_input),
1455
+            "shape_output": _make(shape_output),
1456
+            "defaultvalue": defaultvalue,
1457
+        };
1458
+    }
1459
+    /**
1460
+     * @author fenris
1461
+     */
1462
+    function function_stance(parameters, bindings, _stance) {
1463
+        return {
1464
+            "name": "function",
1465
+            "parameters": {
1466
+                "soft": parameters.soft,
1467
+                "shape_input": _stance(parameters.shape_input, bindings),
1468
+                "shape_output": _stance(parameters.shape_output, bindings)
1469
+            }
1470
+        };
1471
+    }
1472
+    /**
1473
+     * @author fenris
1474
+     * @todo closer look not possible?
1475
+     */
1476
+    function function_inspect(parameters, value, _inspect) {
1477
+        let inspection = lib_shape.inspection_create();
1478
+        if (value == undefined) {
1479
+            if (parameters.soft) {
1480
+                // all good
1481
+            }
1482
+            else {
1483
+                lib_shape.inspection_add(inspection, "null is not allowed");
1484
+            }
1485
+        }
1486
+        else {
1487
+            let jstype_actual = typeof (value);
1488
+            let jstype_expected = "function";
1489
+            if (jstype_actual === jstype_expected) {
1490
+                // all good?
1491
+            }
1492
+            else {
1493
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
1494
+            }
1495
+        }
1496
+        return inspection;
1497
+    }
1498
+    /**
1499
+     * @author fenris
1500
+     */
1501
+    function function_show(parameters, _show) {
1502
+        let str;
1503
+        /*
1504
+        // core
1505
+        {
1506
+            str = "function";
1507
+        }
1508
+        // in/out
1509
+        {
1510
+            str += (
1511
+                "<"
1512
+                +
1513
+                [
1514
+                    _show(parameters.shape_input),
1515
+                    _show(parameters.shape_output),
1516
+                ].join(",")
1517
+                +
1518
+                ">"
1519
+            );
1520
+        }
1521
+         */
1522
+        str = "";
1523
+        str += ("(" + _show(parameters.shape_input) + " => " + _show(parameters.shape_output) + ")");
1524
+        // soft
1525
+        {
1526
+            if (parameters.soft) {
1527
+                str = `~${str}`;
1528
+            }
1529
+        }
1530
+        return str;
1531
+    }
1532
+    /**
1533
+     * @author fenris
1534
+     */
1535
+    lib_shape.register({
1536
+        "name": "function",
1537
+        "make": function_make,
1538
+        "inspect": function_inspect,
1539
+        "stance": function_stance,
1540
+        "show": function_show,
1541
+    });
1542
+})(lib_shape || (lib_shape = {}));
1543
+/*
1544
+This file is part of »bacterio-plankton:shape«.
1545
+
1546
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1547
+<info@greenscale.de>
1548
+
1549
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1550
+it under the terms of the GNU Lesser General Public License as published by
1551
+the Free Software Foundation, either version 3 of the License, or
1552
+(at your option) any later version.
1553
+
1554
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1555
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1556
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1557
+GNU Lesser General Public License for more details.
1558
+
1559
+You should have received a copy of the GNU Lesser General Public License
1560
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1561
+ */
1562
+var lib_shape;
1563
+(function (lib_shape) {
1564
+    /**
1565
+     * @author fenris
1566
+     */
1567
+    function void_make({ "soft": soft = true, }) {
1568
+        return {
1569
+            "soft": soft,
1570
+        };
1571
+    }
1572
+    /**
1573
+     * @author fenris
1574
+     */
1575
+    function void_inspect(parameters, value, _inspect) {
1576
+        let inspection = lib_shape.inspection_create();
1577
+        if (value == undefined) {
1578
+            if (parameters.soft) {
1579
+                // all good
1580
+            }
1581
+            else {
1582
+                lib_shape.inspection_add(inspection, "null is not allowed");
1583
+            }
1584
+        }
1585
+        else {
1586
+            // all good
1587
+        }
1588
+        return inspection;
1589
+    }
1590
+    /**
1591
+     * @author fenris
1592
+     */
1593
+    function void_stance(parameters, bindings, _stance) {
1594
+        return {
1595
+            "name": "void",
1596
+            "parameters": parameters
1597
+        };
1598
+    }
1599
+    /**
1600
+     * @author fenris
1601
+     */
1602
+    function void_show(parameters, _show) {
1603
+        let str;
1604
+        // core
1605
+        {
1606
+            str = "void";
1607
+        }
1608
+        // soft
1609
+        {
1610
+            if (parameters.soft) {
1611
+                str = `~${str}`;
1612
+            }
1613
+        }
1614
+        return str;
1615
+    }
1616
+    /**
1617
+     * @author fenris
1618
+     */
1619
+    lib_shape.register({
1620
+        "name": "void",
1621
+        "make": void_make,
1622
+        "inspect": void_inspect,
1623
+        "stance": void_stance,
1624
+        "show": void_show,
1625
+    });
1626
+})(lib_shape || (lib_shape = {}));
1627
+/*
1628
+This file is part of »bacterio-plankton:shape«.
1629
+
1630
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1631
+<info@greenscale.de>
1632
+
1633
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1634
+it under the terms of the GNU Lesser General Public License as published by
1635
+the Free Software Foundation, either version 3 of the License, or
1636
+(at your option) any later version.
1637
+
1638
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1639
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1640
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1641
+GNU Lesser General Public License for more details.
1642
+
1643
+You should have received a copy of the GNU Lesser General Public License
1644
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1645
+ */
1646
+var lib_shape;
1647
+(function (lib_shape) {
1648
+    /**
1649
+     * @author fenris
1650
+     */
1651
+    function any_make({ "soft": soft = true, "mutable": mutable = true, "defaultvalue": defaultvalue = null, }) {
1652
+        return {
1653
+            "soft": soft,
1654
+            "mutable": mutable,
1655
+            "defaultvalue": defaultvalue,
1656
+        };
1657
+    }
1658
+    /**
1659
+     * @author fenris
1660
+     */
1661
+    function any_inspect(parameters, value, _inspect) {
1662
+        let inspection = lib_shape.inspection_create();
1663
+        if (value == undefined) {
1664
+            if (parameters.soft) {
1665
+                // all good
1666
+            }
1667
+            else {
1668
+                lib_shape.inspection_add(inspection, "null is not allowed");
1669
+            }
1670
+        }
1671
+        else {
1672
+            // all good
1673
+        }
1674
+        return inspection;
1675
+    }
1676
+    /**
1677
+     * @author fenris
1678
+     */
1679
+    function any_stance(parameters, bindings, _stance) {
1680
+        return {
1681
+            "name": "any",
1682
+            "parameters": parameters
1683
+        };
1684
+    }
1685
+    /**
1686
+     * @author fenris
1687
+     */
1688
+    function any_show(parameters, _show) {
1689
+        let str;
1690
+        // core
1691
+        {
1692
+            str = "any";
1693
+        }
1694
+        // soft
1695
+        {
1696
+            if (parameters.soft) {
1697
+                str = `~${str}`;
1698
+            }
1699
+        }
1700
+        return str;
1701
+    }
1702
+    /**
1703
+     * @author fenris
1704
+     */
1705
+    lib_shape.register({
1706
+        "name": "any",
1707
+        "make": any_make,
1708
+        "inspect": any_inspect,
1709
+        "stance": any_stance,
1710
+        "show": any_show,
1711
+    });
1712
+})(lib_shape || (lib_shape = {}));
1713
+/*
1714
+This file is part of »bacterio-plankton:shape«.
1715
+
1716
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1717
+<info@greenscale.de>
1718
+
1719
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1720
+it under the terms of the GNU Lesser General Public License as published by
1721
+the Free Software Foundation, either version 3 of the License, or
1722
+(at your option) any later version.
1723
+
1724
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1725
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1726
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1727
+GNU Lesser General Public License for more details.
1728
+
1729
+You should have received a copy of the GNU Lesser General Public License
1730
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1731
+ */
1732
+var lib_shape;
1733
+(function (lib_shape) {
1734
+    /**
1735
+     * @author fenris
1736
+     */
1737
+    function boolean_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, }) {
1738
+        if (defaultvalue === undefined) {
1739
+            defaultvalue = (soft ? null : false);
1740
+        }
1741
+        return {
1742
+            "soft": soft,
1743
+            "mutable": mutable,
1744
+            "defaultvalue": defaultvalue,
1745
+        };
1746
+    }
1747
+    /**
1748
+     * @author fenris
1749
+     */
1750
+    function boolean_inspect(parameters, value, _inspect) {
1751
+        let inspection = lib_shape.inspection_create();
1752
+        if (value == undefined) {
1753
+            if (parameters.soft) {
1754
+                // all good
1755
+            }
1756
+            else {
1757
+                lib_shape.inspection_add(inspection, "null is not allowed");
1758
+            }
1759
+        }
1760
+        else {
1761
+            let jstype_actual = typeof (value);
1762
+            let jstype_expected = "boolean";
1763
+            if (jstype_actual === jstype_expected) {
1764
+                // all good
1765
+            }
1766
+            else {
1767
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
1768
+            }
1769
+        }
1770
+        return inspection;
1771
+    }
1772
+    /**
1773
+     * @author fenris
1774
+     */
1775
+    function boolean_stance(parameters, bindings, _stance) {
1776
+        return {
1777
+            "name": "boolean",
1778
+            "parameters": parameters
1779
+        };
1780
+    }
1781
+    /**
1782
+     * @author fenris
1783
+     */
1784
+    function boolean_show(parameters, _show) {
1785
+        let str;
1786
+        // core
1787
+        {
1788
+            str = "boolean";
1789
+        }
1790
+        // soft
1791
+        {
1792
+            if (parameters.soft) {
1793
+                str = `~${str}`;
1794
+            }
1795
+        }
1796
+        return str;
1797
+    }
1798
+    /**
1799
+     * @author fenris
1800
+     */
1801
+    lib_shape.register({
1802
+        "name": "boolean",
1803
+        "make": boolean_make,
1804
+        "inspect": boolean_inspect,
1805
+        "stance": boolean_stance,
1806
+        "show": boolean_show,
1807
+    });
1808
+})(lib_shape || (lib_shape = {}));
1809
+/*
1810
+This file is part of »bacterio-plankton:shape«.
1811
+
1812
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1813
+<info@greenscale.de>
1814
+
1815
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1816
+it under the terms of the GNU Lesser General Public License as published by
1817
+the Free Software Foundation, either version 3 of the License, or
1818
+(at your option) any later version.
1819
+
1820
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1821
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1822
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1823
+GNU Lesser General Public License for more details.
1824
+
1825
+You should have received a copy of the GNU Lesser General Public License
1826
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1827
+ */
1828
+var lib_shape;
1829
+(function (lib_shape) {
1830
+    /**
1831
+     * @author fenris
1832
+     */
1833
+    function int_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, "minimum": minimum = null, "maximum": maximum = null, }) {
1834
+        if (defaultvalue === undefined) {
1835
+            defaultvalue = (soft ? null : 0);
1836
+        }
1837
+        return {
1838
+            "soft": soft,
1839
+            "mutable": mutable,
1840
+            "defaultvalue": defaultvalue,
1841
+            "minimum": minimum,
1842
+            "maximum": maximum,
1843
+        };
1844
+    }
1845
+    /**
1846
+     * @author fenris
1847
+     */
1848
+    function int_inspect(parameters, value, _inspect) {
1849
+        let inspection = lib_shape.inspection_create();
1850
+        if (value == undefined) {
1851
+            if (parameters.soft) {
1852
+                // all good
1853
+            }
1854
+            else {
1855
+                lib_shape.inspection_add(inspection, "null is not allowed");
1856
+            }
1857
+        }
1858
+        else {
1859
+            let jstype_actual = typeof (value);
1860
+            let jstype_expected = "number";
1861
+            if (jstype_actual === jstype_expected) {
1862
+                if (!isNaN(parseInt(value))) {
1863
+                    if ((parameters.minimum === null) || (value >= parameters.minimum)) {
1864
+                        if ((parameters.maximum === null) || (value <= parameters.maximum)) {
1865
+                            // all good
1866
+                        }
1867
+                        else {
1868
+                            lib_shape.inspection_add(inspection, `value is beyond maximum`);
1869
+                        }
1870
+                    }
1871
+                    else {
1872
+                        lib_shape.inspection_add(inspection, `value is below minimum`);
1873
+                    }
1874
+                }
1875
+                else {
1876
+                    lib_shape.inspection_add(inspection, `value is not parsable into a valid int`);
1877
+                }
1878
+            }
1879
+            else {
1880
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
1881
+            }
1882
+        }
1883
+        return inspection;
1884
+    }
1885
+    /**
1886
+     * @author fenris
1887
+     */
1888
+    function int_stance(parameters, bindings, _stance) {
1889
+        return {
1890
+            "name": "int",
1891
+            "parameters": parameters
1892
+        };
1893
+    }
1894
+    /**
1895
+     * @author fenris
1896
+     */
1897
+    function int_show(parameters, _show) {
1898
+        let str;
1899
+        // core
1900
+        {
1901
+            str = "int";
1902
+        }
1903
+        // soft
1904
+        {
1905
+            if (parameters.soft) {
1906
+                str = `~${str}`;
1907
+            }
1908
+        }
1909
+        return str;
1910
+    }
1911
+    /**
1912
+     * @author fenris
1913
+     */
1914
+    lib_shape.register({
1915
+        "name": "int",
1916
+        "make": int_make,
1917
+        "inspect": int_inspect,
1918
+        "stance": int_stance,
1919
+        "show": int_show,
1920
+    });
1921
+})(lib_shape || (lib_shape = {}));
1922
+/*
1923
+This file is part of »bacterio-plankton:shape«.
1924
+
1925
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1926
+<info@greenscale.de>
1927
+
1928
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1929
+it under the terms of the GNU Lesser General Public License as published by
1930
+the Free Software Foundation, either version 3 of the License, or
1931
+(at your option) any later version.
1932
+
1933
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1934
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1935
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1936
+GNU Lesser General Public License for more details.
1937
+
1938
+You should have received a copy of the GNU Lesser General Public License
1939
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1940
+ */
1941
+var lib_shape;
1942
+(function (lib_shape) {
1943
+    /**
1944
+     * @author fenris
1945
+     */
1946
+    function float_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, }) {
1947
+        if (defaultvalue === undefined) {
1948
+            defaultvalue = (soft ? null : 0.0);
1949
+        }
1950
+        return {
1951
+            "soft": soft,
1952
+            "mutable": mutable,
1953
+            "defaultvalue": defaultvalue,
1954
+        };
1955
+    }
1956
+    /**
1957
+     * @author fenris
1958
+     */
1959
+    function float_inspect(parameters, value, _inspect) {
1960
+        let inspection = lib_shape.inspection_create();
1961
+        if (value == undefined) {
1962
+            if (parameters.soft) {
1963
+                // all good
1964
+            }
1965
+            else {
1966
+                lib_shape.inspection_add(inspection, "null is not allowed");
1967
+            }
1968
+        }
1969
+        else {
1970
+            let jstype_actual = typeof (value);
1971
+            let jstype_expected = "number";
1972
+            if (jstype_actual === jstype_expected) {
1973
+                if (!isNaN(parseFloat(value))) {
1974
+                    // all good
1975
+                }
1976
+                else {
1977
+                    lib_shape.inspection_add(inspection, `value is not parsable into a valid float`);
1978
+                }
1979
+            }
1980
+            else {
1981
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
1982
+            }
1983
+        }
1984
+        return inspection;
1985
+    }
1986
+    /**
1987
+     * @author fenris
1988
+     */
1989
+    function float_stance(parameters, bindings, _stance) {
1990
+        return {
1991
+            "name": "float",
1992
+            "parameters": parameters
1993
+        };
1994
+    }
1995
+    /**
1996
+     * @author fenris
1997
+     */
1998
+    function float_show(parameters, _show) {
1999
+        let str;
2000
+        // core
2001
+        {
2002
+            str = "float";
2003
+        }
2004
+        // soft
2005
+        {
2006
+            if (parameters.soft) {
2007
+                str = `~${str}`;
2008
+            }
2009
+        }
2010
+        return str;
2011
+    }
2012
+    /**
2013
+     * @author fenris
2014
+     */
2015
+    lib_shape.register({
2016
+        "name": "float",
2017
+        "make": float_make,
2018
+        "inspect": float_inspect,
2019
+        "stance": float_stance,
2020
+        "show": float_show,
2021
+    });
2022
+})(lib_shape || (lib_shape = {}));
2023
+/*
2024
+This file is part of »bacterio-plankton:shape«.
2025
+
2026
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2027
+<info@greenscale.de>
2028
+
2029
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
2030
+it under the terms of the GNU Lesser General Public License as published by
2031
+the Free Software Foundation, either version 3 of the License, or
2032
+(at your option) any later version.
2033
+
2034
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
2035
+but WITHOUT ANY WARRANTY; without even the implied warranty of
2036
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2037
+GNU Lesser General Public License for more details.
2038
+
2039
+You should have received a copy of the GNU Lesser General Public License
2040
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
2041
+ */
2042
+var lib_shape;
2043
+(function (lib_shape) {
2044
+    /**
2045
+     * @author fenris
2046
+     */
2047
+    function string_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, "long": long = false, }) {
2048
+        if (defaultvalue === undefined) {
2049
+            defaultvalue = (soft ? null : "");
2050
+        }
2051
+        return {
2052
+            "soft": soft,
2053
+            "mutable": mutable,
2054
+            "defaultvalue": defaultvalue,
2055
+            "long": long,
2056
+        };
2057
+    }
2058
+    /**
2059
+     * @author fenris
2060
+     */
2061
+    function string_inspect(parameters, value, _inspect) {
2062
+        let inspection = lib_shape.inspection_create();
2063
+        if (value == undefined) {
2064
+            if (parameters.soft) {
2065
+                // all good
2066
+            }
2067
+            else {
2068
+                lib_shape.inspection_add(inspection, "null is not allowed");
2069
+            }
2070
+        }
2071
+        else {
2072
+            let jstype_actual = typeof (value);
2073
+            let jstype_expected = "string";
2074
+            if (jstype_actual === jstype_expected) {
2075
+                // all good
2076
+            }
2077
+            else {
2078
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
2079
+            }
2080
+        }
2081
+        return inspection;
2082
+    }
2083
+    /**
2084
+     * @author fenris
2085
+     */
2086
+    function string_stance(parameters, bindings, _stance) {
2087
+        return {
2088
+            "name": "string",
2089
+            "parameters": parameters
2090
+        };
2091
+    }
2092
+    /**
2093
+     * @author fenris
2094
+     */
2095
+    function string_show(parameters, _show) {
2096
+        let str;
2097
+        // core
2098
+        {
2099
+            str = "string";
2100
+        }
2101
+        // soft
2102
+        {
2103
+            if (parameters.soft) {
2104
+                str = `~${str}`;
2105
+            }
2106
+        }
2107
+        return str;
2108
+    }
2109
+    /**
2110
+     * @author fenris
2111
+     */
2112
+    lib_shape.register({
2113
+        "name": "string",
2114
+        "make": string_make,
2115
+        "inspect": string_inspect,
2116
+        "stance": string_stance,
2117
+        "show": string_show,
2118
+    });
2119
+})(lib_shape || (lib_shape = {}));
2120
+/*
2121
+This file is part of »bacterio-plankton:shape«.
2122
+
2123
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2124
+<info@greenscale.de>
2125
+
2126
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
2127
+it under the terms of the GNU Lesser General Public License as published by
2128
+the Free Software Foundation, either version 3 of the License, or
2129
+(at your option) any later version.
2130
+
2131
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
2132
+but WITHOUT ANY WARRANTY; without even the implied warranty of
2133
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2134
+GNU Lesser General Public License for more details.
2135
+
2136
+You should have received a copy of the GNU Lesser General Public License
2137
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
2138
+ */
2139
+var lib_shape;
2140
+(function (lib_shape) {
2141
+    /**
2142
+     * @author fenris
2143
+     */
2144
+    function email_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, }) {
2145
+        if (defaultvalue === undefined) {
2146
+            defaultvalue = (soft ? null : "");
2147
+        }
2148
+        return {
2149
+            "soft": soft,
2150
+            "mutable": mutable,
2151
+            "defaultvalue": defaultvalue,
2152
+        };
2153
+    }
2154
+    /**
2155
+     * @author fenris
2156
+     */
2157
+    function email_inspect(parameters, value, _inspect) {
2158
+        let inspection = lib_shape.inspection_create();
2159
+        if (value == undefined) {
2160
+            if (parameters.soft) {
2161
+                // all good
2162
+            }
2163
+            else {
2164
+                lib_shape.inspection_add(inspection, "null is not allowed");
2165
+            }
2166
+        }
2167
+        else {
2168
+            let jstype_actual = typeof (value);
2169
+            let jstype_expected = "string";
2170
+            if (jstype_actual === jstype_expected) {
2171
+                // all good
2172
+            }
2173
+            else {
2174
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
2175
+            }
2176
+        }
2177
+        return inspection;
2178
+    }
2179
+    /**
2180
+     * @author fenris
2181
+     */
2182
+    function email_stance(parameters, bindings, _stance) {
2183
+        return {
2184
+            "name": "email",
2185
+            "parameters": parameters
2186
+        };
2187
+    }
2188
+    /**
2189
+     * @author fenris
2190
+     */
2191
+    function email_show(parameters, _show) {
2192
+        let str;
2193
+        // core
2194
+        {
2195
+            str = "email";
2196
+        }
2197
+        // soft
2198
+        {
2199
+            if (parameters.soft) {
2200
+                str = `~${str}`;
2201
+            }
2202
+        }
2203
+        return str;
2204
+    }
2205
+    /**
2206
+     * @author fenris
2207
+     */
2208
+    lib_shape.register({
2209
+        "name": "email",
2210
+        "make": email_make,
2211
+        "inspect": email_inspect,
2212
+        "stance": email_stance,
2213
+        "show": email_show,
2214
+    });
2215
+})(lib_shape || (lib_shape = {}));
2216
+/*
2217
+This file is part of »bacterio-plankton:shape«.
2218
+
2219
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2220
+<info@greenscale.de>
2221
+
2222
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
2223
+it under the terms of the GNU Lesser General Public License as published by
2224
+the Free Software Foundation, either version 3 of the License, or
2225
+(at your option) any later version.
2226
+
2227
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
2228
+but WITHOUT ANY WARRANTY; without even the implied warranty of
2229
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2230
+GNU Lesser General Public License for more details.
2231
+
2232
+You should have received a copy of the GNU Lesser General Public License
2233
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
2234
+ */
2235
+var lib_shape;
2236
+(function (lib_shape) {
2237
+    /**
2238
+     * @author fenris
2239
+     */
2240
+    function url_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, "type": type = "link", }) {
2241
+        if (defaultvalue === undefined) {
2242
+            defaultvalue = (soft ? null : "");
2243
+        }
2244
+        return {
2245
+            "soft": soft,
2246
+            "mutable": mutable,
2247
+            "defaultvalue": defaultvalue,
2248
+            "type": type,
2249
+        };
2250
+    }
2251
+    /**
2252
+     * @author fenris
2253
+     */
2254
+    function url_inspect(parameters, value, _inspect) {
2255
+        let inspection = lib_shape.inspection_create();
2256
+        if (value == undefined) {
2257
+            if (parameters.soft) {
2258
+                // all good
2259
+            }
2260
+            else {
2261
+                lib_shape.inspection_add(inspection, "null is not allowed");
2262
+            }
2263
+        }
2264
+        else {
2265
+            let jstype_actual = typeof (value);
2266
+            let jstype_expected = "string";
2267
+            if (jstype_actual === jstype_expected) {
2268
+                // all good
2269
+            }
2270
+            else {
2271
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
2272
+            }
2273
+        }
2274
+        return inspection;
2275
+    }
2276
+    /**
2277
+     * @author fenris
2278
+     */
2279
+    function url_stance(parameters, bindings, _stance) {
2280
+        return {
2281
+            "name": "url",
2282
+            "parameters": parameters
2283
+        };
2284
+    }
2285
+    /**
2286
+     * @author fenris
2287
+     */
2288
+    function url_show(parameters, _show) {
2289
+        let str;
2290
+        // core
2291
+        {
2292
+            str = "url";
2293
+        }
2294
+        // soft
2295
+        {
2296
+            if (parameters.soft) {
2297
+                str = `~${str}`;
2298
+            }
2299
+        }
2300
+        return str;
2301
+    }
2302
+    /**
2303
+     * @author fenris
2304
+     */
2305
+    lib_shape.register({
2306
+        "name": "url",
2307
+        "make": url_make,
2308
+        "inspect": url_inspect,
2309
+        "stance": url_stance,
2310
+        "show": url_show,
2311
+    });
2312
+})(lib_shape || (lib_shape = {}));
2313
+/*
2314
+This file is part of »bacterio-plankton:shape«.
2315
+
2316
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2317
+<info@greenscale.de>
2318
+
2319
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
2320
+it under the terms of the GNU Lesser General Public License as published by
2321
+the Free Software Foundation, either version 3 of the License, or
2322
+(at your option) any later version.
2323
+
2324
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
2325
+but WITHOUT ANY WARRANTY; without even the implied warranty of
2326
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2327
+GNU Lesser General Public License for more details.
2328
+
2329
+You should have received a copy of the GNU Lesser General Public License
2330
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
2331
+ */
2332
+var lib_shape;
2333
+(function (lib_shape) {
2334
+    /**
2335
+     * @author fenris
2336
+     */
2337
+    function markdown_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, "type": type = "link", }) {
2338
+        if (defaultvalue === undefined) {
2339
+            defaultvalue = (soft ? null : "");
2340
+        }
2341
+        return {
2342
+            "soft": soft,
2343
+            "mutable": mutable,
2344
+            "defaultvalue": defaultvalue,
2345
+            "type": type,
2346
+        };
2347
+    }
2348
+    /**
2349
+     * @author fenris
2350
+     */
2351
+    function markdown_inspect(parameters, value, _inspect) {
2352
+        let inspection = lib_shape.inspection_create();
2353
+        if (value == undefined) {
2354
+            if (parameters.soft) {
2355
+                // all good
2356
+            }
2357
+            else {
2358
+                lib_shape.inspection_add(inspection, "null is not allowed");
2359
+            }
2360
+        }
2361
+        else {
2362
+            let jstype_actual = typeof (value);
2363
+            let jstype_expected = "string";
2364
+            if (jstype_actual === jstype_expected) {
2365
+                // all good
2366
+            }
2367
+            else {
2368
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
2369
+            }
2370
+        }
2371
+        return inspection;
2372
+    }
2373
+    /**
2374
+     * @author fenris
2375
+     */
2376
+    function markdown_stance(parameters, bindings, _stance) {
2377
+        return {
2378
+            "name": "markdown",
2379
+            "parameters": parameters
2380
+        };
2381
+    }
2382
+    /**
2383
+     * @author fenris
2384
+     */
2385
+    function markdown_show(parameters, _show) {
2386
+        let str;
2387
+        // core
2388
+        {
2389
+            str = "markdown";
2390
+        }
2391
+        // soft
2392
+        {
2393
+            if (parameters.soft) {
2394
+                str = `~${str}`;
2395
+            }
2396
+        }
2397
+        return str;
2398
+    }
2399
+    /**
2400
+     * @author fenris
2401
+     */
2402
+    lib_shape.register({
2403
+        "name": "markdown",
2404
+        "make": markdown_make,
2405
+        "inspect": markdown_inspect,
2406
+        "stance": markdown_stance,
2407
+        "show": markdown_show,
2408
+    });
2409
+})(lib_shape || (lib_shape = {}));
2410
+/*
2411
+This file is part of »bacterio-plankton:shape«.
2412
+
2413
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2414
+<info@greenscale.de>
2415
+
2416
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
2417
+it under the terms of the GNU Lesser General Public License as published by
2418
+the Free Software Foundation, either version 3 of the License, or
2419
+(at your option) any later version.
2420
+
2421
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
2422
+but WITHOUT ANY WARRANTY; without even the implied warranty of
2423
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2424
+GNU Lesser General Public License for more details.
2425
+
2426
+You should have received a copy of the GNU Lesser General Public License
2427
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
2428
+ */
2429
+var lib_shape;
2430
+(function (lib_shape) {
2431
+    /**
2432
+     * @author fenris
2433
+     */
2434
+    function time_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, }) {
2435
+        if (defaultvalue === undefined) {
2436
+            defaultvalue = (soft ? null : "");
2437
+        }
2438
+        return {
2439
+            "soft": soft,
2440
+            "mutable": mutable,
2441
+            "defaultvalue": defaultvalue,
2442
+        };
2443
+    }
2444
+    /**
2445
+     * @author fenris
2446
+     */
2447
+    function time_inspect(parameters, value, _inspect) {
2448
+        let inspection = lib_shape.inspection_create();
2449
+        if (value == undefined) {
2450
+            if (parameters.soft) {
2451
+                // all good
2452
+            }
2453
+            else {
2454
+                lib_shape.inspection_add(inspection, "null is not allowed");
2455
+            }
2456
+        }
2457
+        else {
2458
+            let jstype_actual = typeof (value);
2459
+            let jstype_expected = "object";
2460
+            if (jstype_actual === jstype_expected) {
2461
+                // all good?
2462
+            }
2463
+            else {
2464
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
2465
+            }
2466
+        }
2467
+        return inspection;
2468
+    }
2469
+    /**
2470
+     * @author fenris
2471
+     */
2472
+    function time_stance(parameters, bindings, _stance) {
2473
+        return {
2474
+            "name": "time",
2475
+            "parameters": parameters
2476
+        };
2477
+    }
2478
+    /**
2479
+     * @author fenris
2480
+     */
2481
+    function time_show(parameters, _show) {
2482
+        let str;
2483
+        // core
2484
+        {
2485
+            str = "time";
2486
+        }
2487
+        // soft
2488
+        {
2489
+            if (parameters.soft) {
2490
+                str = `~${str}`;
2491
+            }
2492
+        }
2493
+        return str;
2494
+    }
2495
+    /**
2496
+     * @author fenris
2497
+     */
2498
+    lib_shape.register({
2499
+        "name": "time",
2500
+        "make": time_make,
2501
+        "inspect": time_inspect,
2502
+        "stance": time_stance,
2503
+        "show": time_show,
2504
+    });
2505
+})(lib_shape || (lib_shape = {}));
2506
+/*
2507
+This file is part of »bacterio-plankton:shape«.
2508
+
2509
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2510
+<info@greenscale.de>
2511
+
2512
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
2513
+it under the terms of the GNU Lesser General Public License as published by
2514
+the Free Software Foundation, either version 3 of the License, or
2515
+(at your option) any later version.
2516
+
2517
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
2518
+but WITHOUT ANY WARRANTY; without even the implied warranty of
2519
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2520
+GNU Lesser General Public License for more details.
2521
+
2522
+You should have received a copy of the GNU Lesser General Public License
2523
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
2524
+ */
2525
+var lib_shape;
2526
+(function (lib_shape) {
2527
+    /**
2528
+     * @author fenris
2529
+     */
2530
+    function array_make({ "soft": soft = false, "mutable": mutable = true, "shape_element": shape_element, "defaultvalue": defaultvalue = undefined, }, _make) {
2531
+        if (shape_element === undefined) {
2532
+            let message = `mandatory parameter 'shape_element' missing`;
2533
+            throw (new Error(message));
2534
+        }
2535
+        if (defaultvalue === undefined) {
2536
+            defaultvalue = (soft ? null : []);
2537
+        }
2538
+        return {
2539
+            "soft": soft,
2540
+            "mutable": mutable,
2541
+            "shape_element": _make(shape_element),
2542
+            "defaultvalue": defaultvalue,
2543
+        };
2544
+    }
2545
+    /**
2546
+     * @author fenris
2547
+     */
2548
+    function array_inspect(parameters, value, _inspect) {
2549
+        let inspection = lib_shape.inspection_create();
2550
+        if (value == undefined) {
2551
+            if (parameters.soft) {
2552
+                // all good
2553
+            }
2554
+            else {
2555
+                lib_shape.inspection_add(inspection, "null is not allowed");
2556
+            }
2557
+        }
2558
+        else {
2559
+            let jstype_actual = typeof (value);
2560
+            let jstype_expected = "object";
2561
+            if (jstype_actual === jstype_expected) {
2562
+                if (value instanceof Array) {
2563
+                    value.forEach((element, index) => {
2564
+                        lib_shape.inspection_extend(inspection, `element #${index.toFixed(0)}`, _inspect(parameters.shape_element, element));
2565
+                    });
2566
+                }
2567
+                else {
2568
+                    lib_shape.inspection_add(inspection, `value does not seem to be an array-instance`);
2569
+                }
2570
+            }
2571
+            else {
2572
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
2573
+            }
2574
+        }
2575
+        return inspection;
2576
+    }
2577
+    /**
2578
+     * @author fenris
2579
+     */
2580
+    function array_stance(parameters, bindings, _stance) {
2581
+        return {
2582
+            "name": "array",
2583
+            "parameters": {
2584
+                "soft": parameters.soft,
2585
+                "shape_element": _stance(parameters.shape_element, bindings)
2586
+            }
2587
+        };
2588
+    }
2589
+    /**
2590
+     * @author fenris
2591
+     */
2592
+    function array_show(parameters, _show) {
2593
+        let str;
2594
+        // core
2595
+        {
2596
+            str = "array";
2597
+        }
2598
+        // shape_element
2599
+        {
2600
+            str += ("<"
2601
+                +
2602
+                    _show(parameters.shape_element)
2603
+                +
2604
+                    ">");
2605
+        }
2606
+        // soft
2607
+        {
2608
+            if (parameters.soft) {
2609
+                str = `~${str}`;
2610
+            }
2611
+        }
2612
+        return str;
2613
+    }
2614
+    /**
2615
+     * @author fenris
2616
+     */
2617
+    lib_shape.register({
2618
+        "name": "array",
2619
+        "make": array_make,
2620
+        "inspect": array_inspect,
2621
+        "stance": array_stance,
2622
+        "show": array_show,
2623
+    });
2624
+})(lib_shape || (lib_shape = {}));
2625
+/*
2626
+This file is part of »bacterio-plankton:shape«.
2627
+
2628
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2629
+<info@greenscale.de>
2630
+
2631
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
2632
+it under the terms of the GNU Lesser General Public License as published by
2633
+the Free Software Foundation, either version 3 of the License, or
2634
+(at your option) any later version.
2635
+
2636
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
2637
+but WITHOUT ANY WARRANTY; without even the implied warranty of
2638
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2639
+GNU Lesser General Public License for more details.
2640
+
2641
+You should have received a copy of the GNU Lesser General Public License
2642
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
2643
+ */
2644
+var lib_shape;
2645
+(function (lib_shape) {
2646
+    /**
2647
+     * @author fenris
2648
+     */
2649
+    function enumeration_make({ "soft": soft = false, "mutable": mutable = true, "shape_option": shape_option, "options": options, "defaultvalue": defaultvalue = undefined, }, _make) {
2650
+        if (shape_option === undefined) {
2651
+            let message = `mandatory parameter 'shape_option' missing`;
2652
+            throw (new Error(message));
2653
+        }
2654
+        if (options === undefined) {
2655
+            let message = `mandatory parameter 'options' missing`;
2656
+            throw (new Error(message));
2657
+        }
2658
+        if (defaultvalue === undefined) {
2659
+            defaultvalue = (soft ? null : options[0].value);
2660
+        }
2661
+        return {
2662
+            "soft": soft,
2663
+            "mutable": mutable,
2664
+            "shape_option": _make(shape_option),
2665
+            "options": options,
2666
+            "defaultvalue": defaultvalue,
2667
+        };
2668
+    }
2669
+    /**
2670
+     * @author fenris
2671
+     */
2672
+    function enumeration_inspect(parameters, value, _inspect) {
2673
+        let inspection = lib_shape.inspection_create();
2674
+        if (value == undefined) {
2675
+            if (parameters.soft) {
2676
+                // all good
2677
+            }
2678
+            else {
2679
+                lib_shape.inspection_add(inspection, "null is not allowed");
2680
+            }
2681
+        }
2682
+        else {
2683
+            lib_shape.inspection_extend(inspection, `given value for enumeration`, _inspect(parameters.shape_option, value));
2684
+            // TODO: check if corresponding option exists
2685
+        }
2686
+        return inspection;
2687
+    }
2688
+    /**
2689
+     * @author fenris
2690
+     */
2691
+    function enumeration_stance(parameters, bindings, _stance) {
2692
+        return {
2693
+            "name": "enumeration",
2694
+            "parameters": {
2695
+                "soft": parameters.soft,
2696
+                "shape_option": _stance(parameters.shape_option, bindings),
2697
+                "options": parameters.options,
2698
+            }
2699
+        };
2700
+    }
2701
+    /**
2702
+     * @author fenris
2703
+     */
2704
+    function enumeration_show(parameters, _show) {
2705
+        let str;
2706
+        // core
2707
+        {
2708
+            str = "enumeration";
2709
+        }
2710
+        // shape_option
2711
+        {
2712
+            str += ("<"
2713
+                +
2714
+                    parameters.options.map(option => String(option)).join(",") + ":" + _show(parameters.shape_option)
2715
+                +
2716
+                    ">");
2717
+        }
2718
+        // soft
2719
+        {
2720
+            if (parameters.soft) {
2721
+                str = `~${str}`;
2722
+            }
2723
+        }
2724
+        return str;
2725
+    }
2726
+    /**
2727
+     * @author fenris
2728
+     */
2729
+    lib_shape.register({
2730
+        "name": "enumeration",
2731
+        "make": enumeration_make,
2732
+        "inspect": enumeration_inspect,
2733
+        "stance": enumeration_stance,
2734
+        "show": enumeration_show,
2735
+    });
2736
+})(lib_shape || (lib_shape = {}));
2737
+/*
2738
+This file is part of »bacterio-plankton:shape«.
2739
+
2740
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2741
+<info@greenscale.de>
2742
+
2743
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
2744
+it under the terms of the GNU Lesser General Public License as published by
2745
+the Free Software Foundation, either version 3 of the License, or
2746
+(at your option) any later version.
2747
+
2748
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
2749
+but WITHOUT ANY WARRANTY; without even the implied warranty of
2750
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2751
+GNU Lesser General Public License for more details.
2752
+
2753
+You should have received a copy of the GNU Lesser General Public License
2754
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
2755
+ */
2756
+var lib_shape;
2757
+(function (lib_shape) {
2758
+    /**
2759
+     * @author fenris
2760
+     */
2761
+    function date_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, }) {
2762
+        if (defaultvalue === undefined) {
2763
+            defaultvalue = (soft ? null : (new Date(Date.now())));
2764
+        }
2765
+        return {
2766
+            "soft": soft,
2767
+            "mutable": mutable,
2768
+            "defaultvalue": defaultvalue,
2769
+        };
2770
+    }
2771
+    /**
2772
+     * @author fenris
2773
+     */
2774
+    function date_inspect(parameters, value, _inspect) {
2775
+        let inspection = lib_shape.inspection_create();
2776
+        if (value == undefined) {
2777
+            if (parameters.soft) {
2778
+                // all good
2779
+            }
2780
+            else {
2781
+                lib_shape.inspection_add(inspection, "null is not allowed");
2782
+            }
2783
+        }
2784
+        else {
2785
+            let jstype_actual = typeof (value);
2786
+            let jstype_expected = "object";
2787
+            if (jstype_actual === jstype_expected) {
2788
+                if (value instanceof Date) {
2789
+                    // all gode
2790
+                }
2791
+                else {
2792
+                    lib_shape.inspection_add(inspection, `value does not seem to be a date-instance`);
2793
+                }
2794
+            }
2795
+            else {
2796
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
2797
+            }
2798
+        }
2799
+        return inspection;
2800
+    }
2801
+    /**
2802
+     * @author fenris
2803
+     */
2804
+    function date_stance(parameters, bindings, _stance) {
2805
+        return {
2806
+            "name": "date",
2807
+            "parameters": parameters
2808
+        };
2809
+    }
2810
+    /**
2811
+     * @author fenris
2812
+     */
2813
+    function date_show(parameters, _show) {
2814
+        let str;
2815
+        // core
2816
+        {
2817
+            str = "date";
2818
+        }
2819
+        // soft
2820
+        {
2821
+            if (parameters.soft) {
2822
+                str = `~${str}`;
2823
+            }
2824
+        }
2825
+        return str;
2826
+    }
2827
+    /**
2828
+     * @author fenris
2829
+     */
2830
+    lib_shape.register({
2831
+        "name": "date",
2832
+        "make": date_make,
2833
+        "inspect": date_inspect,
2834
+        "stance": date_stance,
2835
+        "show": date_show,
2836
+    });
2837
+})(lib_shape || (lib_shape = {}));
2838
+/*
2839
+This file is part of »bacterio-plankton:shape«.
2840
+
2841
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2842
+<info@greenscale.de>
2843
+
2844
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
2845
+it under the terms of the GNU Lesser General Public License as published by
2846
+the Free Software Foundation, either version 3 of the License, or
2847
+(at your option) any later version.
2848
+
2849
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
2850
+but WITHOUT ANY WARRANTY; without even the implied warranty of
2851
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2852
+GNU Lesser General Public License for more details.
2853
+
2854
+You should have received a copy of the GNU Lesser General Public License
2855
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
2856
+ */
2857
+var lib_shape;
2858
+(function (lib_shape) {
2859
+    /**
2860
+     * @author fenris
2861
+     */
2862
+    function record_make({ "soft": soft = false, "mutable": mutable = true, "fields": fields = [], "defaultvalue": defaultvalue = undefined, }, _make) {
2863
+        let fields_ = (fields
2864
+            .map((field) => ({ "name": field.name, "shape": _make(field.shape) })));
2865
+        if (defaultvalue === undefined) {
2866
+            if (soft) {
2867
+                defaultvalue = null;
2868
+            }
2869
+            else {
2870
+                defaultvalue = {};
2871
+                fields_.forEach(field => {
2872
+                    defaultvalue[field.name] = field.shape.parameters["defaultvalue"];
2873
+                });
2874
+            }
2875
+        }
2876
+        return {
2877
+            "soft": soft,
2878
+            "mutable": mutable,
2879
+            "fields": fields_,
2880
+            "defaultvalue": defaultvalue,
2881
+        };
2882
+    }
2883
+    /**
2884
+     * @author fenris
2885
+     */
2886
+    function record_inspect(parameters, value, _inspect) {
2887
+        let inspection = lib_shape.inspection_create();
2888
+        if (value == undefined) {
2889
+            if (parameters.soft) {
2890
+                // all good
2891
+            }
2892
+            else {
2893
+                lib_shape.inspection_add(inspection, "null is not allowed");
2894
+            }
2895
+        }
2896
+        else {
2897
+            let jstype_actual = typeof (value);
2898
+            let jstype_expected = "object";
2899
+            if (jstype_actual === jstype_expected) {
2900
+                parameters.fields.forEach(field => {
2901
+                    let value_ = value[field.name];
2902
+                    lib_shape.inspection_extend(inspection, `field '${field.name}'`, _inspect(field.shape, value_));
2903
+                });
2904
+            }
2905
+            else {
2906
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
2907
+            }
2908
+        }
2909
+        return inspection;
2910
+    }
2911
+    /**
2912
+     * @author fenris
2913
+     */
2914
+    function record_stance(parameters, bindings, _stance) {
2915
+        return {
2916
+            "name": "record",
2917
+            "parameters": {
2918
+                "soft": parameters.soft,
2919
+                "fields": parameters.fields.map(field => {
2920
+                    return {
2921
+                        "name": field.name,
2922
+                        "shape": _stance(field.shape, bindings)
2923
+                    };
2924
+                })
2925
+            }
2926
+        };
2927
+    }
2928
+    /**
2929
+     * @author fenris
2930
+     */
2931
+    function record_show(parameters, _show) {
2932
+        let str;
2933
+        // core
2934
+        {
2935
+            str = "record";
2936
+        }
2937
+        // fields
2938
+        {
2939
+            str += ("<"
2940
+                +
2941
+                    parameters.fields.map(field => (field.name + ":" + _show(field.shape))).join(",")
2942
+                +
2943
+                    ">");
2944
+        }
2945
+        // soft
2946
+        {
2947
+            if (parameters.soft) {
2948
+                str = `~${str}`;
2949
+            }
2950
+        }
2951
+        return str;
2952
+    }
2953
+    /**
2954
+     * @author fenris
2955
+     */
2956
+    lib_shape.register({
2957
+        "name": "record",
2958
+        "make": record_make,
2959
+        "inspect": record_inspect,
2960
+        "stance": record_stance,
2961
+        "show": record_show,
2962
+    });
2963
+})(lib_shape || (lib_shape = {}));
2964
+/*
2965
+This file is part of »bacterio-plankton:shape«.
2966
+
2967
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2968
+<info@greenscale.de>
2969
+
2970
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
2971
+it under the terms of the GNU Lesser General Public License as published by
2972
+the Free Software Foundation, either version 3 of the License, or
2973
+(at your option) any later version.
2974
+
2975
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
2976
+but WITHOUT ANY WARRANTY; without even the implied warranty of
2977
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2978
+GNU Lesser General Public License for more details.
2979
+
2980
+You should have received a copy of the GNU Lesser General Public License
2981
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
2982
+ */
2983
+var lib_shape;
2984
+(function (lib_shape) {
2985
+    /**
2986
+     * @author fenris
2987
+     */
2988
+    function map_make({ "soft": soft = false, "mutable": mutable = true, "shape_key": shape_key, "shape_value": shape_value, "defaultvalue": defaultvalue = undefined, }, _make) {
2989
+        if (shape_key === undefined) {
2990
+            let message = `mandatory parameter 'shape_key' missing`;
2991
+            throw (new Error(message));
2992
+        }
2993
+        if (shape_value === undefined) {
2994
+            let message = `mandatory parameter 'shape_value' missing`;
2995
+            throw (new Error(message));
2996
+        }
2997
+        if (defaultvalue === undefined) {
2998
+            defaultvalue = (soft ? null : {});
2999
+        }
3000
+        return {
3001
+            "soft": soft,
3002
+            "mutable": mutable,
3003
+            "shape_key": _make(shape_key),
3004
+            "shape_value": _make(shape_value),
3005
+            "defaultvalue": defaultvalue,
3006
+        };
3007
+    }
3008
+    /**
3009
+     * @author fenris
3010
+     */
3011
+    function map_stance(parameters, bindings, _stance) {
3012
+        return {
3013
+            "name": "map",
3014
+            "parameters": {
3015
+                "soft": parameters.soft,
3016
+                "shape_key": _stance(parameters.shape_key, bindings),
3017
+                "shape_value": _stance(parameters.shape_value, bindings)
3018
+            }
3019
+        };
3020
+    }
3021
+    /**
3022
+     * @author fenris
3023
+     * @todo closer look not possible?
3024
+     */
3025
+    function map_inspect(parameters, value, _inspect) {
3026
+        let inspection = lib_shape.inspection_create();
3027
+        if (value == undefined) {
3028
+            if (parameters.soft) {
3029
+                // all good
3030
+            }
3031
+            else {
3032
+                lib_shape.inspection_add(inspection, "null is not allowed");
3033
+            }
3034
+        }
3035
+        else {
3036
+            let jstype_actual = typeof (value);
3037
+            let jstype_expected = "object";
3038
+            if (jstype_actual === jstype_expected) {
3039
+                Object.keys(value).forEach(key => {
3040
+                    lib_shape.inspection_extend(inspection, `key '${key}'`, _inspect(parameters.shape_key, key));
3041
+                    let value_ = value[key];
3042
+                    lib_shape.inspection_extend(inspection, `value for key '${key}'`, _inspect(parameters.shape_value, value_));
3043
+                });
3044
+            }
3045
+            else {
3046
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
3047
+            }
3048
+        }
3049
+        return inspection;
3050
+    }
3051
+    /**
3052
+     * @author fenris
3053
+     */
3054
+    function map_show(parameters, _show) {
3055
+        let str;
3056
+        // core
3057
+        {
3058
+            str = "map";
3059
+        }
3060
+        // in/out
3061
+        {
3062
+            str += ("<"
3063
+                +
3064
+                    [
3065
+                        _show(parameters.shape_key),
3066
+                        _show(parameters.shape_value),
3067
+                    ].join(",")
3068
+                +
3069
+                    ">");
3070
+        }
3071
+        // soft
3072
+        {
3073
+            if (parameters.soft) {
3074
+                str = `~${str}`;
3075
+            }
3076
+        }
3077
+        return str;
3078
+    }
3079
+    /**
3080
+     * @author fenris
3081
+     */
3082
+    lib_shape.register({
3083
+        "name": "map",
3084
+        "make": map_make,
3085
+        "inspect": map_inspect,
3086
+        "stance": map_stance,
3087
+        "show": map_show,
3088
+    });
3089
+})(lib_shape || (lib_shape = {}));
3090
+/*
3091
+This file is part of »bacterio-plankton:shape«.
3092
+
3093
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
3094
+<info@greenscale.de>
3095
+
3096
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
3097
+it under the terms of the GNU Lesser General Public License as published by
3098
+the Free Software Foundation, either version 3 of the License, or
3099
+(at your option) any later version.
3100
+
3101
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
3102
+but WITHOUT ANY WARRANTY; without even the implied warranty of
3103
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3104
+GNU Lesser General Public License for more details.
3105
+
3106
+You should have received a copy of the GNU Lesser General Public License
3107
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
3108
+ */
3109
+var lib_shape;
3110
+(function (lib_shape) {
3111
+    /**
3112
+     * @author fenris
3113
+     */
3114
+    function maybe_make({ "soft": soft = false, "shape_value": shape_value, "defaultvalue": defaultvalue = undefined, }, _make) {
3115
+        if (shape_value === undefined) {
3116
+            let message = `mandatory parameter 'shape_value' missing`;
3117
+            throw (new Error(message));
3118
+        }
3119
+        if (defaultvalue === undefined) {
3120
+            defaultvalue = (soft ? null : { "kind": "nothing" });
3121
+        }
3122
+        return {
3123
+            "soft": soft,
3124
+            "shape_value": _make(shape_value),
3125
+            "defaultvalue": defaultvalue,
3126
+        };
3127
+    }
3128
+    /**
3129
+     * @author fenris
3130
+     */
3131
+    function maybe_inspect(parameters, value, _inspect) {
3132
+        let inspection = lib_shape.inspection_create();
3133
+        if (value == undefined) {
3134
+            if (parameters.soft) {
3135
+                // all good
3136
+            }
3137
+            else {
3138
+                lib_shape.inspection_add(inspection, "null is not allowed");
3139
+            }
3140
+        }
3141
+        else {
3142
+            let jstype_actual = typeof (value);
3143
+            let jstype_expected = "object";
3144
+            if (jstype_actual === jstype_expected) {
3145
+                if ("kind" in value) {
3146
+                    // all good?
3147
+                }
3148
+                else {
3149
+                    lib_shape.inspection_add(inspection, `field 'kind' missing`);
3150
+                }
3151
+            }
3152
+            else {
3153
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
3154
+            }
3155
+        }
3156
+        return inspection;
3157
+    }
3158
+    /**
3159
+     * @author fenris
3160
+     */
3161
+    function maybe_stance(parameters, bindings, _stance) {
3162
+        return {
3163
+            "name": "maybe",
3164
+            "parameters": {
3165
+                "soft": parameters.soft,
3166
+                "shape_value": _stance(parameters.shape_value, bindings)
3167
+            }
3168
+        };
3169
+    }
3170
+    /**
3171
+     * @author fenris
3172
+     */
3173
+    function maybe_show(parameters, _show) {
3174
+        let str;
3175
+        // core
3176
+        {
3177
+            str = "maybe";
3178
+        }
3179
+        // shape_value
3180
+        {
3181
+            str += ("<"
3182
+                +
3183
+                    _show(parameters.shape_value)
3184
+                +
3185
+                    ">");
3186
+        }
3187
+        // soft
3188
+        {
3189
+            if (parameters.soft) {
3190
+                str = `~${str}`;
3191
+            }
3192
+        }
3193
+        return str;
3194
+    }
3195
+    /**
3196
+     * @author fenris
3197
+     */
3198
+    lib_shape.register({
3199
+        "name": "maybe",
3200
+        "make": maybe_make,
3201
+        "inspect": maybe_inspect,
3202
+        "stance": maybe_stance,
3203
+        "show": maybe_show,
3204
+    });
3205
+})(lib_shape || (lib_shape = {}));
3206
+/*
3207
+This file is part of »bacterio-plankton:shape«.
3208
+
3209
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
3210
+<info@greenscale.de>
3211
+
3212
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
3213
+it under the terms of the GNU Lesser General Public License as published by
3214
+the Free Software Foundation, either version 3 of the License, or
3215
+(at your option) any later version.
3216
+
3217
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
3218
+but WITHOUT ANY WARRANTY; without even the implied warranty of
3219
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3220
+GNU Lesser General Public License for more details.
3221
+
3222
+You should have received a copy of the GNU Lesser General Public License
3223
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
3224
+ */
3225
+var lib_shape;
3226
+(function (lib_shape) {
3227
+    /**
3228
+     * @author fenris
3229
+     */
3230
+    function promise_make({ "soft": soft = false, "shape_result": shape_result, "shape_reason": shape_reason, "defaultvalue": defaultvalue = undefined, }, _make) {
3231
+        if (shape_result === undefined) {
3232
+            let message = `mandatory parameter 'shape_result' missing`;
3233
+            throw (new Error(message));
3234
+        }
3235
+        if (shape_reason === undefined) {
3236
+            let message = `mandatory parameter 'shape_reason' missing`;
3237
+            throw (new Error(message));
3238
+        }
3239
+        if (defaultvalue === undefined) {
3240
+            defaultvalue = (soft ? null : Promise.resolve(null));
3241
+        }
3242
+        return {
3243
+            "soft": soft,
3244
+            "shape_result": _make(shape_result),
3245
+            "shape_reason": _make(shape_reason),
3246
+            "defaultvalue": defaultvalue,
3247
+        };
3248
+    }
3249
+    /**
3250
+     * @author fenris
3251
+     */
3252
+    function promise_stance(parameters, bindings, _stance) {
3253
+        return {
3254
+            "name": "promise",
3255
+            "parameters": {
3256
+                "soft": parameters.soft,
3257
+                "shape_result": _stance(parameters.shape_result, bindings),
3258
+                "shape_reason": _stance(parameters.shape_reason, bindings)
3259
+            }
3260
+        };
3261
+    }
3262
+    /**
3263
+     * @author fenris
3264
+     * @todo closer look not possible?
3265
+     */
3266
+    function promise_inspect(parameters, value, _inspect) {
3267
+        let inspection = lib_shape.inspection_create();
3268
+        if (value == undefined) {
3269
+            if (parameters.soft) {
3270
+                // all good
3271
+            }
3272
+            else {
3273
+                lib_shape.inspection_add(inspection, "null is not allowed");
3274
+            }
3275
+        }
3276
+        else {
3277
+            let jstype_actual = typeof (value);
3278
+            let jstype_expected = "object";
3279
+            if (jstype_actual === jstype_expected) {
3280
+                if (value instanceof Promise /*<any, any>*/) {
3281
+                    // all good?
3282
+                }
3283
+                else {
3284
+                    lib_shape.inspection_add(inspection, `values is not an Promise-instance`);
3285
+                }
3286
+            }
3287
+            else {
3288
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
3289
+            }
3290
+        }
3291
+        return inspection;
3292
+    }
3293
+    /**
3294
+     * @author fenris
3295
+     */
3296
+    function promise_show(parameters, _show) {
3297
+        let str;
3298
+        // core
3299
+        {
3300
+            str = "promise";
3301
+        }
3302
+        // in/out
3303
+        {
3304
+            str += ("<"
3305
+                +
3306
+                    [
3307
+                        _show(parameters.shape_result),
3308
+                        _show(parameters.shape_reason),
3309
+                    ].join(",")
3310
+                +
3311
+                    ">");
3312
+        }
3313
+        // soft
3314
+        {
3315
+            if (parameters.soft) {
3316
+                str = `~${str}`;
3317
+            }
3318
+        }
3319
+        return str;
3320
+    }
3321
+    /**
3322
+     * @author fenris
3323
+     */
3324
+    lib_shape.register({
3325
+        "name": "promise",
3326
+        "make": promise_make,
3327
+        "inspect": promise_inspect,
3328
+        "stance": promise_stance,
3329
+        "show": promise_show,
3330
+    });
3331
+})(lib_shape || (lib_shape = {}));
3332
+/*
3333
+This file is part of »bacterio-plankton:shape«.
3334
+
3335
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
3336
+<info@greenscale.de>
3337
+
3338
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
3339
+it under the terms of the GNU Lesser General Public License as published by
3340
+the Free Software Foundation, either version 3 of the License, or
3341
+(at your option) any later version.
3342
+
3343
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
3344
+but WITHOUT ANY WARRANTY; without even the implied warranty of
3345
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3346
+GNU Lesser General Public License for more details.
3347
+
3348
+You should have received a copy of the GNU Lesser General Public License
3349
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
3350
+ */
3351
+var lib_shape;
3352
+(function (lib_shape) {
3353
+    /**
3354
+     * @author fenris
3355
+     * @todo use a treemap-function (but first make one :P)
3356
+     */
3357
+    function adjust_labels(shape, transformator) {
3358
+        if (false) {
3359
+        }
3360
+        else if (shape.name === "enumeration") {
3361
+            return {
3362
+                "name": "enumeration",
3363
+                "parameters": {
3364
+                    "soft": shape.parameters["soft"],
3365
+                    "shape_option": adjust_labels(shape.parameters["shape_option"], transformator),
3366
+                    "options": shape.parameters["options"].map(option => {
3367
+                        return {
3368
+                            "value": option.value,
3369
+                            "label": transformator(option.label),
3370
+                        };
3371
+                    }),
3372
+                    "defaultvalue": shape.parameters["defaultvalue"],
3373
+                }
3374
+            };
3375
+        }
3376
+        else if (shape.name === "array") {
3377
+            return {
3378
+                "name": "array",
3379
+                "parameters": {
3380
+                    "soft": shape.parameters["soft"],
3381
+                    "shape_element": adjust_labels(shape.parameters["shape_element"], transformator),
3382
+                    "defaultvalue": shape.parameters["defaultvalue"],
3383
+                }
3384
+            };
3385
+        }
3386
+        else if (shape.name === "record") {
3387
+            return {
3388
+                "name": "record",
3389
+                "parameters": {
3390
+                    "soft": shape.parameters["soft"],
3391
+                    "fields": shape.parameters["fields"].map(field => {
3392
+                        return {
3393
+                            "name": field.name,
3394
+                            "shape": adjust_labels(field.shape, transformator),
3395
+                            "label": transformator(field.label),
3396
+                        };
3397
+                    }),
3398
+                    "defaultvalue": shape.parameters["defaultvalue"],
3399
+                }
3400
+            };
3401
+        }
3402
+        // lil' hacky …
3403
+        else {
3404
+            // shape["label"] = ((shape["label"] == null) ? null : transformator(shape["label"]));
3405
+            return shape;
3406
+        }
3407
+    }
3408
+    lib_shape.adjust_labels = adjust_labels;
3409
+    /**
3410
+     * @author fenris
3411
+     */
3412
+    function register_(id, factory) {
3413
+        const message = "not implemented; dummy impl";
3414
+        console.warn(message);
3415
+    }
3416
+    lib_shape.register_ = register_;
3417
+    /**
3418
+     * @author fenris
3419
+     */
3420
+    function retrieve_(id) {
3421
+        const message = "not implemented; returning dummy";
3422
+        console.warn(message);
3423
+        return { "name": "any" };
3424
+    }
3425
+    lib_shape.retrieve_ = retrieve_;
3426
+})(lib_shape || (lib_shape = {}));
3427
+/*
3428
+This file is part of »bacterio-plankton:trait«.
3429
+
3430
+Copyright 2016-2018 greenscale <info@greenscale.de>
3431
+
3432
+»bacterio-plankton:trait« is free software: you can redistribute it and/or modify
3433
+it under the terms of the GNU Lesser General Public License as published by
3434
+the Free Software Foundation, either version 3 of the License, or
3435
+(at your option) any later version.
3436
+
3437
+»bacterio-plankton:trait« is distributed in the hope that it will be callful,
3438
+but WITHOUT ANY WARRANTY; without even the implied warranty of
3439
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3440
+GNU Lesser General Public License for more details.
3441
+
3442
+You should have received a copy of the GNU Lesser General Public License
3443
+along with »bacterio-plankton:trait«. If not, see <http://www.gnu.org/licenses/>.
3444
+ */
3445
+var lib_trait;
3446
+(function (lib_trait) {
3447
+    /**
3448
+     * @author fenris
3449
+     */
3450
+    function domain_make(_a, _make) {
3451
+        var _b = _a["soft"], soft = _b === void 0 ? false : _b, kind = _a["kind"];
3452
+        return {
3453
+            "soft": soft,
3454
+            "kind": kind
3455
+        };
3456
+    }
3457
+    /**
3458
+     * @author fenris
3459
+     */
3460
+    function domain_inspect(parameters, value, _inspect) {
3461
+        var inspection = lib_shape.inspection_create();
3462
+        if (value == undefined) {
3463
+            if (parameters.soft) {
3464
+                // all good
3465
+            }
3466
+            else {
3467
+                lib_shape.inspection_add(inspection, "null is not allowed");
3468
+            }
3469
+        }
3470
+        else {
3471
+            var jstype_actual = typeof (value);
3472
+            var jstype_expected = "object";
3473
+            if (jstype_actual === jstype_expected) {
3474
+                if ("domain" in value) {
3475
+                    var domain_actual = value["domain"]["kind"];
3476
+                    var domain_expected = parameters.kind;
3477
+                    if (domain_actual == domain_expected) {
3478
+                        // all good?
3479
+                    }
3480
+                    else {
3481
+                        lib_shape.inspection_add(inspection, "expected domain-kind '" + domain_expected + "' but got '" + domain_actual + "'");
3482
+                    }
3483
+                }
3484
+                else {
3485
+                    lib_shape.inspection_add(inspection, "field 'domain' missing");
3486
+                }
3487
+            }
3488
+            else {
3489
+                lib_shape.inspection_add(inspection, "expected JS-type '" + jstype_expected + "' but got '" + jstype_actual + "'");
3490
+            }
3491
+        }
3492
+        return inspection;
3493
+    }
3494
+    /**
3495
+     * @author fenris
3496
+     */
3497
+    function domain_stance(parameters, bindings, _stance) {
3498
+        return {
3499
+            "name": "domain",
3500
+            "parameters": {
3501
+                "soft": parameters.soft,
3502
+                "kind": parameters.kind
3503
+            }
3504
+        };
3505
+    }
3506
+    /**
3507
+     * @author fenris
3508
+     */
3509
+    function domain_show(parameters, _show) {
3510
+        var str;
3511
+        // core
3512
+        {
3513
+            str = ("#" + parameters.kind);
3514
+        }
3515
+        /*
3516
+        // parameters
3517
+        {
3518
+            str += (":" + JSON.stringify(parameters.parameters))
3519
+        }
3520
+         */
3521
+        // soft
3522
+        {
3523
+            if (parameters.soft) {
3524
+                str = "~" + str;
3525
+            }
3526
+        }
3527
+        return str;
3528
+    }
3529
+    /**
3530
+     * @author fenris
3531
+     */
3532
+    lib_shape.register({
3533
+        "name": "domain",
3534
+        "make": domain_make,
3535
+        "inspect": domain_inspect,
3536
+        "stance": domain_stance,
3537
+        "show": domain_show
3538
+    });
3539
+})(lib_trait || (lib_trait = {}));
3540
+/*
3541
+This file is part of »bacterio-plankton:trait«.
3542
+
3543
+Copyright 2016-2018 greenscale <info@greenscale.de>
3544
+
3545
+»bacterio-plankton:trait« is free software: you can redistribute it and/or modify
3546
+it under the terms of the GNU Lesser General Public License as published by
3547
+the Free Software Foundation, either version 3 of the License, or
3548
+(at your option) any later version.
3549
+
3550
+»bacterio-plankton:trait« is distributed in the hope that it will be callful,
3551
+but WITHOUT ANY WARRANTY; without even the implied warranty of
3552
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3553
+GNU Lesser General Public License for more details.
3554
+
3555
+You should have received a copy of the GNU Lesser General Public License
3556
+along with »bacterio-plankton:trait«. If not, see <http://www.gnu.org/licenses/>.
3557
+ */
3558
+/**
3559
+ * @author fenris
3560
+ */
3561
+var lib_trait;
3562
+(function (lib_trait) {
3563
+    /**
3564
+     * @author fenris
3565
+     */
3566
+    lib_trait._verbosity = 1;
3567
+    /**
3568
+     * @author fenris
3569
+     */
3570
+    lib_trait._logprefix = "[lib_trait] ";
3571
+    /**
3572
+     * @desc holds all defined traits
3573
+     * @author fenris
3574
+     */
3575
+    var _pool = {};
3576
+    /**
3577
+     * @author fenris
3578
+     */
3579
+    var _typechecker = function (value, shape, logger) {
3580
+        var messages = lib_shape.inspect(shape, value).messages;
3581
+        messages.forEach(logger);
3582
+        return (messages.length === 0);
3583
+    };
3584
+    /**
3585
+     * @author fenris
3586
+     */
3587
+    function log(_a) {
3588
+        var message = _a["message"], _b = _a["kind"], kind = _b === void 0 ? "log" : _b, _c = _a["level"], level = _c === void 0 ? 0 : _c;
3589
+        if (level <= lib_trait._verbosity) {
3590
+            var message_ = "" + lib_trait._logprefix + message;
3591
+            switch (kind) {
3592
+                default:
3593
+                case "log": {
3594
+                    console.log(message_);
3595
+                    break;
3596
+                }
3597
+                case "information":
3598
+                case "info": {
3599
+                    console.info(message_);
3600
+                    break;
3601
+                }
3602
+                case "warning":
3603
+                case "warn": {
3604
+                    console.warn(message_);
3605
+                    break;
3606
+                }
3607
+                case "error":
3608
+                case "err": {
3609
+                    console.error(message_);
3610
+                    break;
3611
+                }
3612
+            }
3613
+        }
3614
+    }
3615
+    /**
3616
+     * @author fenris
3617
+     */
3618
+    function set_typechecker(typechecker) {
3619
+        _typechecker = typechecker;
3620
+    }
3621
+    lib_trait.set_typechecker = set_typechecker;
3622
+    /**
3623
+     * @author fenris
3624
+     */
3625
+    function domain_instance(domain, value) {
3626
+        return { "domain": domain, "value": value };
3627
+    }
3628
+    lib_trait.domain_instance = domain_instance;
3629
+    /**
3630
+     * @desc adds a trait
3631
+     * @author fenris
3632
+     */
3633
+    function define(trait_id, variable_conditions, facets_raw) {
3634
+        if (trait_id in _pool) {
3635
+            var message = "trait '" + trait_id + "' already registered";
3636
+            throw (new Error(message));
3637
+        }
3638
+        else {
3639
+            var trait_1 = {
3640
+                "variables": {},
3641
+                "facets": {},
3642
+                "attendants": {}
3643
+            };
3644
+            Object.keys(variable_conditions).forEach(function (variable_name) {
3645
+                var variable = {
3646
+                    "conditions": variable_conditions[variable_name],
3647
+                    "bindings": {}
3648
+                };
3649
+                trait_1.variables[variable_name] = variable;
3650
+            });
3651
+            Object.keys(facets_raw).forEach(function (facet_name) {
3652
+                var facet_raw = facets_raw[facet_name];
3653
+                var facet = {
3654
+                    "shape": lib_shape.make(facet_raw.shape || { "name": "any" }),
3655
+                    "description": facet_raw.description,
3656
+                    "implementation": facet_raw.implementation,
3657
+                    "handlers": {}
3658
+                };
3659
+                trait_1.facets[facet_name] = facet;
3660
+            });
3661
+            _pool[trait_id] = trait_1;
3662
+        }
3663
+    }
3664
+    lib_trait.define = define;
3665
+    /**
3666
+     * @desc adhoc binding
3667
+     * @author fenris
3668
+     */
3669
+    function attend(trait_id, domain_kind, bindings, handlers, condition) {
3670
+        if (condition === void 0) { condition = null; }
3671
+        var strict_binding = true;
3672
+        var strict_handling = true;
3673
+        if (!_pool.hasOwnProperty(trait_id)) {
3674
+            var message = "no trait '" + trait_id + "'";
3675
+            throw (new Error(message));
3676
+        }
3677
+        else {
3678
+            var trait_2 = _pool[trait_id];
3679
+            // assignments
3680
+            {
3681
+                // variables
3682
+                {
3683
+                    Object.keys(bindings).forEach(function (variable_name) {
3684
+                        if (!trait_2.variables.hasOwnProperty(variable_name)) {
3685
+                            var message = "";
3686
+                            message += "no variable '" + variable_name + "'";
3687
+                            message += " to bind in trait '" + trait_id + "'";
3688
+                            log({ "message": message, "kind": "warning" });
3689
+                            // throw (new Error(message));
3690
+                        }
3691
+                        else {
3692
+                            var variable = trait_2.variables[variable_name];
3693
+                            if (variable.bindings.hasOwnProperty(domain_kind)) {
3694
+                                var message = "";
3695
+                                message += "variable '" + variable_name + "'";
3696
+                                message += " already bound for domain '" + domain_kind + "'";
3697
+                                message += " in trait '" + trait_id + "'";
3698
+                                throw (new Error(message));
3699
+                            }
3700
+                            else {
3701
+                                variable.bindings[domain_kind] = lib_shape.make(bindings[variable_name]);
3702
+                            }
3703
+                        }
3704
+                    });
3705
+                }
3706
+                // facets
3707
+                {
3708
+                    Object.keys(handlers).forEach(function (facet_name) {
3709
+                        if (!trait_2.facets.hasOwnProperty(facet_name)) {
3710
+                            var message = "";
3711
+                            message += "no facet '" + facet_name + "'";
3712
+                            message += " to implement at trait '" + trait_id + "'";
3713
+                            log({ "kind": "warning", "message": message });
3714
+                            // throw (new Error(message));
3715
+                        }
3716
+                        else {
3717
+                            var facet = trait_2.facets[facet_name];
3718
+                            var intrinsic = (facet.implementation != undefined);
3719
+                            if (intrinsic) {
3720
+                                var message = "shadowing intrinsic facet '" + facet_name + "'";
3721
+                                console.warn(message);
3722
+                            }
3723
+                            else {
3724
+                                // do nothing
3725
+                            }
3726
+                            if (facet.handlers.hasOwnProperty(domain_kind)) {
3727
+                                var message = "";
3728
+                                message += "facet '" + facet_name + "'";
3729
+                                message += " already implemented in domain '" + domain_kind + "'";
3730
+                                message += " at trait '" + trait_id + "'";
3731
+                                throw (new Error(message));
3732
+                            }
3733
+                            else {
3734
+                                facet.handlers[domain_kind] = handlers[facet_name];
3735
+                            }
3736
+                        }
3737
+                    });
3738
+                }
3739
+                // attendants
3740
+                {
3741
+                    trait_2.attendants[domain_kind] = {
3742
+                        "condition": condition
3743
+                    };
3744
+                }
3745
+            }
3746
+            // checks
3747
+            {
3748
+                var messages_1 = [];
3749
+                // variables
3750
+                {
3751
+                    if (strict_binding) {
3752
+                        var variable_names_given_1 = Object.keys(bindings);
3753
+                        var variable_names_present = Object.keys(trait_2.variables);
3754
+                        var variable_names_missing = variable_names_present.filter(function (variable_name) { return (!variable_names_given_1.some(function (variable_name_) { return (variable_name == variable_name_); })); });
3755
+                        variable_names_missing.forEach(function (variable_name) {
3756
+                            var message = "binding missing for variable '" + variable_name + "'";
3757
+                            messages_1.push(message);
3758
+                        });
3759
+                    }
3760
+                    else {
3761
+                        // do nothing
3762
+                    }
3763
+                }
3764
+                // facets
3765
+                {
3766
+                    if (strict_handling) {
3767
+                        var facet_names_given_1 = Object.keys(handlers);
3768
+                        var facet_names_needed = (Object.keys(trait_2.facets).filter(function (facet_name) { return (trait_2.facets[facet_name].implementation == undefined); }));
3769
+                        var facet_names_missing = (facet_names_needed.filter(function (facet_name) { return (!facet_names_given_1.some(function (facet_name_) { return (facet_name === facet_name_); })); }));
3770
+                        facet_names_missing.forEach(function (facet_name) {
3771
+                            var message = "implementation missing for the facet '" + facet_name + "'";
3772
+                            messages_1.push(message);
3773
+                        });
3774
+                    }
3775
+                    else {
3776
+                        // do nothing
3777
+                    }
3778
+                }
3779
+                if (messages_1.length > 0) {
3780
+                    var message = "";
3781
+                    message += "assignment of domain '" + domain_kind + "'";
3782
+                    message += " to trait '" + trait_id + "'";
3783
+                    message += " incomplete: " + messages_1.join(", ");
3784
+                    throw (new Error(message));
3785
+                }
3786
+            }
3787
+        }
3788
+    }
3789
+    lib_trait.attend = attend;
3790
+    /**
3791
+     * @desc calls a facet from a trait according to a given domain
3792
+     * @author fenris
3793
+     */
3794
+    function call(trait_id, facet_name, domain, check) {
3795
+        if (check === void 0) { check = true; }
3796
+        if (!_pool.hasOwnProperty(trait_id)) {
3797
+            var message = "no trait '" + trait_id + "'";
3798
+            throw (new Error(message));
3799
+        }
3800
+        else {
3801
+            var trait_3 = _pool[trait_id];
3802
+            if (!trait_3.facets.hasOwnProperty(facet_name)) {
3803
+                var message = "no facet '" + facet_name + "' in trait '" + trait_id + "'";
3804
+                throw (new Error(message));
3805
+            }
3806
+            else {
3807
+                var facet = trait_3.facets[facet_name];
3808
+                var intrinsic = (facet.implementation !== undefined);
3809
+                var result = void 0;
3810
+                if (intrinsic) {
3811
+                    result = facet.implementation(function (facet_name_) { return call(trait_id, facet_name_, domain, check); });
3812
+                }
3813
+                else {
3814
+                    if (!facet.handlers.hasOwnProperty(domain.kind)) {
3815
+                        var message = "";
3816
+                        message += "implementation missing";
3817
+                        message += " at trait '" + trait_id + "'";
3818
+                        message += " for facet '" + facet_name + "'";
3819
+                        message += " in domain '" + domain.kind + "'";
3820
+                        throw (new Error(message));
3821
+                    }
3822
+                    else {
3823
+                        var show_shape = (function (shape) { return lib_shape.show(shape); });
3824
+                        var handler = facet.handlers[domain.kind];
3825
+                        var bindings_1 = {};
3826
+                        Object.keys(trait_3.variables).forEach(function (variable_name) {
3827
+                            bindings_1[variable_name] = trait_3.variables[variable_name].bindings[domain.kind];
3828
+                        });
3829
+                        result = handler(domain.parameters);
3830
+                        if (check
3831
+                            &&
3832
+                                (_typechecker !== null)
3833
+                            &&
3834
+                                (facet.shape !== undefined)) {
3835
+                            var shape = lib_shape.stance(facet.shape, bindings_1);
3836
+                            // console.info("expected shape of result: " + lib_shape.show(shape)); console.info("result: ", result);
3837
+                            var valid = _typechecker(result, shape, function (message) { return log({ "kind": "warning", "message": "[typechecker] [result] " + message }); });
3838
+                            if (!valid) {
3839
+                                var message = "";
3840
+                                message += "result '" + instance_show(result) + "'";
3841
+                                message += " doesn't match the expected type '" + show_shape(shape) + "'";
3842
+                                message += " at trait '" + trait_id + "'";
3843
+                                message += " for facet '" + facet_name + "'";
3844
+                                message += " in domain '" + domain.kind + "'";
3845
+                                log({ "kind": "warning", "message": message });
3846
+                            }
3847
+                            {
3848
+                                var condition = trait_3.attendants[domain.kind].condition;
3849
+                                if (condition != null) {
3850
+                                    var attends = function (trait_id_, domain_) {
3851
+                                        return (_pool.hasOwnProperty(trait_id_) && _pool[trait_id_].attendants.hasOwnProperty(domain_.kind));
3852
+                                    };
3853
+                                    if (!condition(attends)(domain.parameters)) {
3854
+                                        var message = "";
3855
+                                        message += "condition not fulfilled";
3856
+                                        message += " at trait '" + trait_id + "'";
3857
+                                        message += " for facet '" + facet_name + "'";
3858
+                                        message += " in domain '" + domain.kind + "'";
3859
+                                        log({ "kind": "warning", "message": message });
3860
+                                    }
3861
+                                    else {
3862
+                                        // do nothing
3863
+                                    }
3864
+                                }
3865
+                                else {
3866
+                                    // do nothing
3867
+                                }
3868
+                            }
3869
+                        }
3870
+                    }
3871
+                }
3872
+                return result;
3873
+            }
3874
+        }
3875
+    }
3876
+    lib_trait.call = call;
3877
+    /**
3878
+     * @author fenris
3879
+     */
3880
+    function explain(trait_id) {
3881
+        if (!_pool.hasOwnProperty(trait_id)) {
3882
+            var message = "no trait '" + trait_id + "'";
3883
+            throw (new Error(message));
3884
+        }
3885
+        else {
3886
+            var trait_4 = _pool[trait_id];
3887
+            var str_1 = "";
3888
+            // head
3889
+            {
3890
+                str_1 += "<<" + trait_id + ">>";
3891
+                str_1 += (" "
3892
+                    +
3893
+                        "("
3894
+                    +
3895
+                        (Object.keys(trait_4.variables)
3896
+                            .map(function (variable_name) {
3897
+                            var shape = lib_shape.make({
3898
+                                "name": "variable",
3899
+                                "parameters": {
3900
+                                    "name": variable_name
3901
+                                }
3902
+                            });
3903
+                            return lib_shape.show(shape);
3904
+                        })
3905
+                            .join(","))
3906
+                    +
3907
+                        ")");
3908
+                str_1 += "\n";
3909
+            }
3910
+            // facets
3911
+            {
3912
+                Object.keys(trait_4.facets)
3913
+                    .forEach(function (facet_name) {
3914
+                    var facet = trait_4.facets[facet_name];
3915
+                    // str += "\t";
3916
+                    str_1 += "* ";
3917
+                    str_1 += ((facet.implementation != undefined) ? ("[" + facet_name + "]") : facet_name);
3918
+                    str_1 += (" : " + lib_shape.show(facet.shape));
3919
+                    if (facet.description !== undefined) {
3920
+                        str_1 += (" ~ " + "" + facet.description + "");
3921
+                    }
3922
+                    str_1 += "\n";
3923
+                });
3924
+            }
3925
+            return str_1;
3926
+        }
3927
+    }
3928
+    lib_trait.explain = explain;
3929
+    /**
3930
+     * @author fenris
3931
+     */
3932
+    function explain_all() {
3933
+        return Object.keys(_pool).map(function (trait_id) { return explain(trait_id); }).join("\n");
3934
+    }
3935
+    lib_trait.explain_all = explain_all;
3936
+})(lib_trait || (lib_trait = {}));
3937
+/*
3938
+This file is part of »bacterio-plankton:trait«.
3939
+
3940
+Copyright 2016-2018 greenscale <info@greenscale.de>
3941
+
3942
+»bacterio-plankton:trait« is free software: you can redistribute it and/or modify
3943
+it under the terms of the GNU Lesser General Public License as published by
3944
+the Free Software Foundation, either version 3 of the License, or
3945
+(at your option) any later version.
3946
+
3947
+»bacterio-plankton:trait« is distributed in the hope that it will be callful,
3948
+but WITHOUT ANY WARRANTY; without even the implied warranty of
3949
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3950
+GNU Lesser General Public License for more details.
3951
+
3952
+You should have received a copy of the GNU Lesser General Public License
3953
+along with »bacterio-plankton:trait«. If not, see <http://www.gnu.org/licenses/>.
3954
+ */
3955
+/**
3956
+ * @author fenris
3957
+ */
3958
+var lib_trait;
3959
+(function (lib_trait) {
3960
+    /**
3961
+     * @desc the ability to check for equality with another element of the same domain
3962
+     * @author fenris
3963
+     */
3964
+    function define_collatable() {
3965
+        lib_trait.define("collatable", {
3966
+            "value": []
3967
+        }, {
3968
+            "collate": {
3969
+                "shape": {
3970
+                    "name": "function",
3971
+                    "parameters": {
3972
+                        "shape_input": {
3973
+                            "name": "variable",
3974
+                            "parameters": {
3975
+                                "name": "value"
3976
+                            }
3977
+                        },
3978
+                        "shape_output": {
3979
+                            "name": "function",
3980
+                            "parameters": {
3981
+                                "shape_input": {
3982
+                                    "name": "variable",
3983
+                                    "parameters": {
3984
+                                        "name": "value"
3985
+                                    }
3986
+                                },
3987
+                                "shape_output": {
3988
+                                    "name": "boolean"
3989
+                                }
3990
+                            }
3991
+                        }
3992
+                    }
3993
+                }
3994
+            }
3995
+        });
3996
+        lib_trait.attend("collatable", "crude", {
3997
+            "value": {
3998
+                "name": "any"
3999
+            }
4000
+        }, {
4001
+            "collate": function () { return function (instance) { return function (other) {
4002
+                if (typeof (instance) === "object") {
4003
+                    if (instance == null) {
4004
+                        return (other == null);
4005
+                    }
4006
+                    else {
4007
+                        if ("_collate" in instance) {
4008
+                            return instance["_collate"](other);
4009
+                        }
4010
+                        else {
4011
+                            var message = ("[collate]" + " " + "object has no such method");
4012
+                            throw (new Error(message));
4013
+                        }
4014
+                    }
4015
+                }
4016
+                else {
4017
+                    if (lib_trait._verbosity >= 1) {
4018
+                        var message = ("[collate]" + " " + "primitive value; using default implementation");
4019
+                        console.warn(message);
4020
+                    }
4021
+                    return (instance === other);
4022
+                }
4023
+            }; }; }
4024
+        });
4025
+    }
4026
+    lib_trait.define_collatable = define_collatable;
4027
+    /**
4028
+     * @author fenris
4029
+     */
4030
+    function _collate(instance, other, domain) {
4031
+        if (domain === void 0) { domain = { "kind": "crude" }; }
4032
+        return lib_trait.call("collatable", "collate", domain)(instance)(other);
4033
+    }
4034
+    lib_trait._collate = _collate;
4035
+    define_collatable();
4036
+})(lib_trait || (lib_trait = {}));
4037
+/*
4038
+This file is part of »bacterio-plankton:trait«.
4039
+
4040
+Copyright 2016-2018 greenscale <info@greenscale.de>
4041
+
4042
+»bacterio-plankton:trait« is free software: you can redistribute it and/or modify
4043
+it under the terms of the GNU Lesser General Public License as published by
4044
+the Free Software Foundation, either version 3 of the License, or
4045
+(at your option) any later version.
4046
+
4047
+»bacterio-plankton:trait« is distributed in the hope that it will be callful,
4048
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4049
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4050
+GNU Lesser General Public License for more details.
4051
+
4052
+You should have received a copy of the GNU Lesser General Public License
4053
+along with »bacterio-plankton:trait«. If not, see <http://www.gnu.org/licenses/>.
4054
+ */
4055
+/**
4056
+ * @author fenris
4057
+ */
4058
+var lib_trait;
4059
+(function (lib_trait) {
4060
+    /**
4061
+     * @desc the ability to compare with another element of the same domain for determining if the first is "smaller than or equal to" the latter
4062
+     * @author fenris
4063
+     */
4064
+    function define_comparable() {
4065
+        lib_trait.define("comparable", {
4066
+            "value": []
4067
+        }, {
4068
+            "compare": {
4069
+                "shape": {
4070
+                    "name": "function",
4071
+                    "parameters": {
4072
+                        "shape_input": {
4073
+                            "name": "variable",
4074
+                            "parameters": {
4075
+                                "name": "value"
4076
+                            }
4077
+                        },
4078
+                        "shape_output": {
4079
+                            "name": "function",
4080
+                            "parameters": {
4081
+                                "shape_input": {
4082
+                                    "name": "variable",
4083
+                                    "parameters": {
4084
+                                        "name": "value"
4085
+                                    }
4086
+                                },
4087
+                                "shape_output": {
4088
+                                    "name": "boolean"
4089
+                                }
4090
+                            }
4091
+                        }
4092
+                    }
4093
+                }
4094
+            }
4095
+        });
4096
+        lib_trait.attend("comparable", "crude", {
4097
+            "value": {
4098
+                "name": "any"
4099
+            }
4100
+        }, {
4101
+            "compare": function () { return function (instance) { return function (other) {
4102
+                if (typeof (instance) === "object") {
4103
+                    if ("_compare" in instance) {
4104
+                        return instance["_compare"](other);
4105
+                    }
4106
+                    else {
4107
+                        throw (new Error("[compare]" + " " + "object has no such method"));
4108
+                    }
4109
+                }
4110
+                else {
4111
+                    if (lib_trait._verbosity >= 1) {
4112
+                        console.warn("[compare]" + " " + "primitive value; using default implementation");
4113
+                    }
4114
+                    return (instance <= other);
4115
+                }
4116
+            }; }; }
4117
+        });
4118
+    }
4119
+    lib_trait.define_comparable = define_comparable;
4120
+    /**
4121
+     * @author fenris
4122
+     */
4123
+    function _compare(instance, other, domain) {
4124
+        if (domain === void 0) { domain = { "kind": "crude" }; }
4125
+        return lib_trait.call("comparable", "compare", domain)(instance)(other);
4126
+    }
4127
+    lib_trait._compare = _compare;
4128
+    define_comparable();
4129
+})(lib_trait || (lib_trait = {}));
4130
+/*
4131
+This file is part of »bacterio-plankton:trait«.
4132
+
4133
+Copyright 2016-2018 greenscale <info@greenscale.de>
4134
+
4135
+»bacterio-plankton:trait« is free software: you can redistribute it and/or modify
4136
+it under the terms of the GNU Lesser General Public License as published by
4137
+the Free Software Foundation, either version 3 of the License, or
4138
+(at your option) any later version.
4139
+
4140
+»bacterio-plankton:trait« is distributed in the hope that it will be callful,
4141
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4142
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4143
+GNU Lesser General Public License for more details.
4144
+
4145
+You should have received a copy of the GNU Lesser General Public License
4146
+along with »bacterio-plankton:trait«. If not, see <http://www.gnu.org/licenses/>.
4147
+ */
4148
+/**
4149
+ * @author fenris
4150
+ */
4151
+var lib_trait;
4152
+(function (lib_trait) {
4153
+    /**
4154
+     * @desc the ability to create an exact copy
4155
+     * @author fenris
4156
+     */
4157
+    function define_clonable() {
4158
+        lib_trait.define("clonable", {
4159
+            "value": []
4160
+        }, {
4161
+            "clone": {
4162
+                "shape": {
4163
+                    "name": "function",
4164
+                    "parameters": {
4165
+                        "shape_input": {
4166
+                            "name": "variable",
4167
+                            "parameters": {
4168
+                                "name": "value"
4169
+                            }
4170
+                        },
4171
+                        "shape_output": {
4172
+                            "name": "variable",
4173
+                            "parameters": {
4174
+                                "name": "value"
4175
+                            }
4176
+                        }
4177
+                    }
4178
+                }
4179
+            }
4180
+        });
4181
+        lib_trait.attend("clonable", "crude", {
4182
+            "value": {
4183
+                "name": "any"
4184
+            }
4185
+        }, {
4186
+            "clone": function () { return function (instance) {
4187
+                if (typeof (instance) === "object") {
4188
+                    if ("_clone" in instance) {
4189
+                        return instance["_clone"]();
4190
+                    }
4191
+                    else {
4192
+                        throw (new Error("[clone]" + " " + "object has no such method"));
4193
+                    }
4194
+                }
4195
+                else {
4196
+                    if (lib_trait._verbosity >= 1) {
4197
+                        console.warn("[clone]" + " " + "primitive value; using default implementation");
4198
+                    }
4199
+                    return instance;
4200
+                }
4201
+            }; }
4202
+        });
4203
+    }
4204
+    lib_trait.define_clonable = define_clonable;
4205
+    /**
4206
+     * @author fenris
4207
+     */
4208
+    function _clone(instance, domain) {
4209
+        if (domain === void 0) { domain = { "kind": "crude" }; }
4210
+        return lib_trait.call("clonable", "clone", domain)(instance);
4211
+    }
4212
+    lib_trait._clone = _clone;
4213
+    define_clonable();
4214
+})(lib_trait || (lib_trait = {}));
4215
+/*
4216
+This file is part of »bacterio-plankton:trait«.
4217
+
4218
+Copyright 2016-2018 greenscale <info@greenscale.de>
4219
+
4220
+»bacterio-plankton:trait« is free software: you can redistribute it and/or modify
4221
+it under the terms of the GNU Lesser General Public License as published by
4222
+the Free Software Foundation, either version 3 of the License, or
4223
+(at your option) any later version.
4224
+
4225
+»bacterio-plankton:trait« is distributed in the hope that it will be callful,
4226
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4227
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4228
+GNU Lesser General Public License for more details.
4229
+
4230
+You should have received a copy of the GNU Lesser General Public License
4231
+along with »bacterio-plankton:trait«. If not, see <http://www.gnu.org/licenses/>.
4232
+ */
4233
+/**
4234
+ * @author fenris
4235
+ */
4236
+var lib_trait;
4237
+(function (lib_trait) {
4238
+    /**
4239
+     * @desc the ability to generate a string out of the element, which identifies it to a high degree
4240
+     * @author fenris
4241
+     */
4242
+    function define_hashable() {
4243
+        lib_trait.define("hashable", {
4244
+            "value": []
4245
+        }, {
4246
+            "hash": {
4247
+                "shape": {
4248
+                    "name": "function",
4249
+                    "parameters": {
4250
+                        "shape_input": {
4251
+                            "name": "variable",
4252
+                            "parameters": {
4253
+                                "name": "value"
4254
+                            }
4255
+                        },
4256
+                        "shape_output": {
4257
+                            "name": "string"
4258
+                        }
4259
+                    }
4260
+                }
4261
+            }
4262
+        });
4263
+        lib_trait.attend("hashable", "crude", {
4264
+            "value": {
4265
+                "name": "any"
4266
+            }
4267
+        }, {
4268
+            "hash": function () { return function (thing) {
4269
+                if (typeof (thing) === "object") {
4270
+                    if ("_hash" in thing) {
4271
+                        return thing["_hash"]();
4272
+                    }
4273
+                    else {
4274
+                        var message = ("[hash]" + " " + "object has no such method");
4275
+                        throw (new Error(message));
4276
+                    }
4277
+                }
4278
+                else {
4279
+                    if (lib_trait._verbosity >= 1) {
4280
+                        var message = ("[hash]" + " " + "primitive value; using default implementation");
4281
+                        console.warn(message);
4282
+                    }
4283
+                    return String(thing);
4284
+                }
4285
+            }; }
4286
+        });
4287
+    }
4288
+    lib_trait.define_hashable = define_hashable;
4289
+    /**
4290
+     * @author fenris
4291
+     */
4292
+    function _hash(instance, domain) {
4293
+        if (domain === void 0) { domain = { "kind": "crude" }; }
4294
+        return lib_trait.call("hashable", "hash", domain)(instance);
4295
+    }
4296
+    lib_trait._hash = _hash;
4297
+    define_hashable();
4298
+})(lib_trait || (lib_trait = {}));
4299
+/*
4300
+This file is part of »bacterio-plankton:trait«.
4301
+
4302
+Copyright 2016-2018 greenscale <info@greenscale.de>
4303
+
4304
+»bacterio-plankton:trait« is free software: you can redistribute it and/or modify
4305
+it under the terms of the GNU Lesser General Public License as published by
4306
+the Free Software Foundation, either version 3 of the License, or
4307
+(at your option) any later version.
4308
+
4309
+»bacterio-plankton:trait« is distributed in the hope that it will be callful,
4310
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4311
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4312
+GNU Lesser General Public License for more details.
4313
+
4314
+You should have received a copy of the GNU Lesser General Public License
4315
+along with »bacterio-plankton:trait«. If not, see <http://www.gnu.org/licenses/>.
4316
+ */
4317
+/**
4318
+ * @author fenris
4319
+ */
4320
+var lib_trait;
4321
+(function (lib_trait) {
4322
+    /**
4323
+     * @desc the ability to map the element to a textual representation (most likely not injective)
4324
+     * @author fenris
4325
+     */
4326
+    function define_showable() {
4327
+        lib_trait.define("showable", {
4328
+            "value": []
4329
+        }, {
4330
+            "show": {
4331
+                "shape": {
4332
+                    "name": "function",
4333
+                    "parameters": {
4334
+                        "shape_input": {
4335
+                            "name": "variable",
4336
+                            "parameters": {
4337
+                                "name": "value"
4338
+                            }
4339
+                        },
4340
+                        "shape_output": {
4341
+                            "name": "string",
4342
+                            "parameters": {
4343
+                                "soft": false
4344
+                            }
4345
+                        }
4346
+                    }
4347
+                }
4348
+            }
4349
+        });
4350
+        lib_trait.attend("showable", "crude", {
4351
+            "value": {
4352
+                "name": "any"
4353
+            }
4354
+        }, {
4355
+            "show": function () { return function (instance) {
4356
+                if (typeof (instance) === "object") {
4357
+                    if (instance == null) {
4358
+                        return "NULL";
4359
+                    }
4360
+                    else {
4361
+                        if ("_show" in instance) {
4362
+                            return instance["_show"]();
4363
+                        }
4364
+                        else {
4365
+                            // throw (new Error("[show]" + " " + "object has no such method"));
4366
+                            return JSON.stringify(instance);
4367
+                        }
4368
+                    }
4369
+                }
4370
+                else {
4371
+                    if (lib_trait._verbosity >= 1) {
4372
+                        var message = ("[show]" + " " + "primitive value; using default implementation");
4373
+                        // console.warn(message);
4374
+                    }
4375
+                    return String(instance);
4376
+                }
4377
+            }; }
4378
+        });
4379
+    }
4380
+    lib_trait.define_showable = define_showable;
4381
+    /**
4382
+     * @author fenris
4383
+     */
4384
+    function _show(instance, domain) {
4385
+        if (domain === void 0) { domain = { "kind": "crude" }; }
4386
+        return lib_trait.call("showable", "show", domain)(instance);
4387
+    }
4388
+    lib_trait._show = _show;
4389
+    define_showable();
4390
+})(lib_trait || (lib_trait = {}));
4391
+/*
4392
+This file is part of »bacterio-plankton:code«.
4393
+
4394
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
4395
+<info@greenscale.de>
4396
+
4397
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
4398
+it under the terms of the GNU Lesser General Public License as published by
4399
+the Free Software Foundation, either version 3 of the License, or
4400
+(at your option) any later version.
4401
+
4402
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
4403
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4404
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4405
+GNU Lesser General Public License for more details.
4406
+
4407
+You should have received a copy of the GNU Lesser General Public License
4408
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
4409
+ */
4410
+/*
4411
+This file is part of »bacterio-plankton:code«.
4412
+
4413
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
4414
+<info@greenscale.de>
4415
+
4416
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
4417
+it under the terms of the GNU Lesser General Public License as published by
4418
+the Free Software Foundation, either version 3 of the License, or
4419
+(at your option) any later version.
4420
+
4421
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
4422
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4423
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4424
+GNU Lesser General Public License for more details.
4425
+
4426
+You should have received a copy of the GNU Lesser General Public License
4427
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
4428
+ */
4429
+var lib_code;
4430
+(function (lib_code) {
4431
+    /**
4432
+     * @author fenris
4433
+     */
4434
+    lib_trait.define("code", {
4435
+        "from": null,
4436
+        "to": null
4437
+    }, {
4438
+        "encode": {
4439
+            "shape": {
4440
+                "name": "function",
4441
+                "parameters": {
4442
+                    "shape_input": {
4443
+                        "name": "variable",
4444
+                        "parameters": {
4445
+                            "name": "from"
4446
+                        }
4447
+                    },
4448
+                    "shape_output": {
4449
+                        "name": "variable",
4450
+                        "parameters": {
4451
+                            "name": "to"
4452
+                        }
4453
+                    }
4454
+                }
4455
+            }
4456
+        },
4457
+        "decode": {
4458
+            "shape": {
4459
+                "name": "function",
4460
+                "parameters": {
4461
+                    "shape_input": {
4462
+                        "name": "variable",
4463
+                        "parameters": {
4464
+                            "name": "to"
4465
+                        }
4466
+                    },
4467
+                    "shape_output": {
4468
+                        "name": "variable",
4469
+                        "parameters": {
4470
+                            "name": "from"
4471
+                        }
4472
+                    }
4473
+                }
4474
+            }
4475
+        }
4476
+    });
4477
+})(lib_code || (lib_code = {}));
4478
+/*
4479
+This file is part of »bacterio-plankton:code«.
4480
+
4481
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
4482
+<info@greenscale.de>
4483
+
4484
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
4485
+it under the terms of the GNU Lesser General Public License as published by
4486
+the Free Software Foundation, either version 3 of the License, or
4487
+(at your option) any later version.
4488
+
4489
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
4490
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4491
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4492
+GNU Lesser General Public License for more details.
4493
+
4494
+You should have received a copy of the GNU Lesser General Public License
4495
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
4496
+ */
4497
+var lib_code;
4498
+(function (lib_code) {
4499
+    /**
4500
+     * @author Christian Fraß <frass@greenscale.de>
4501
+     */
4502
+    function custom_encode(function_, from) {
4503
+        return function_(from);
4504
+    }
4505
+    lib_code.custom_encode = custom_encode;
4506
+    /**
4507
+     * @author Christian Fraß <frass@greenscale.de>
4508
+     */
4509
+    function custom_decode(function_, to) {
4510
+        return function_(to);
4511
+    }
4512
+    lib_code.custom_decode = custom_decode;
4513
+})(lib_code || (lib_code = {}));
4514
+/*
4515
+This file is part of »bacterio-plankton:code«.
4516
+
4517
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
4518
+<info@greenscale.de>
4519
+
4520
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
4521
+it under the terms of the GNU Lesser General Public License as published by
4522
+the Free Software Foundation, either version 3 of the License, or
4523
+(at your option) any later version.
4524
+
4525
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
4526
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4527
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4528
+GNU Lesser General Public License for more details.
4529
+
4530
+You should have received a copy of the GNU Lesser General Public License
4531
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
4532
+ */
4533
+var lib_code;
4534
+(function (lib_code) {
4535
+    /**
4536
+     * @author fenris
4537
+     */
4538
+    class class_code_custom {
4539
+        /**
4540
+         * @author fenris
4541
+         */
4542
+        constructor(encodefunc, decodefunc) {
4543
+            this.encodefunc = encodefunc;
4544
+            this.decodefunc = decodefunc;
4545
+        }
4546
+        /**
4547
+         * @implementation
4548
+         * @author fenris
4549
+         */
4550
+        encode(x) {
4551
+            return lib_code.custom_encode(this.encodefunc, x);
4552
+        }
4553
+        /**
4554
+         * @implementation
4555
+         * @author fenris
4556
+         */
4557
+        decode(x) {
4558
+            return lib_code.custom_decode(this.decodefunc, x);
4559
+        }
4560
+    }
4561
+    lib_code.class_code_custom = class_code_custom;
4562
+})(lib_code || (lib_code = {}));
4563
+/*
4564
+This file is part of »bacterio-plankton:code«.
4565
+
4566
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
4567
+<info@greenscale.de>
4568
+
4569
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
4570
+it under the terms of the GNU Lesser General Public License as published by
4571
+the Free Software Foundation, either version 3 of the License, or
4572
+(at your option) any later version.
4573
+
4574
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
4575
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4576
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4577
+GNU Lesser General Public License for more details.
4578
+
4579
+You should have received a copy of the GNU Lesser General Public License
4580
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
4581
+ */
4582
+var lib_code;
4583
+(function (lib_code) {
4584
+    /**
4585
+     * @author fenris
4586
+     */
4587
+    function inverse_encode(decode, to) {
4588
+        return decode(to);
4589
+    }
4590
+    lib_code.inverse_encode = inverse_encode;
4591
+    /**
4592
+     * @author fenris
4593
+     */
4594
+    function inverse_decode(encode, from) {
4595
+        return encode(from);
4596
+    }
4597
+    lib_code.inverse_decode = inverse_decode;
4598
+})(lib_code || (lib_code = {}));
4599
+/*
4600
+This file is part of »bacterio-plankton:code«.
4601
+
4602
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
4603
+<info@greenscale.de>
4604
+
4605
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
4606
+it under the terms of the GNU Lesser General Public License as published by
4607
+the Free Software Foundation, either version 3 of the License, or
4608
+(at your option) any later version.
4609
+
4610
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
4611
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4612
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4613
+GNU Lesser General Public License for more details.
4614
+
4615
+You should have received a copy of the GNU Lesser General Public License
4616
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
4617
+ */
4618
+var lib_code;
4619
+(function (lib_code) {
4620
+    /**
4621
+     * @author fenris
4622
+     */
4623
+    lib_trait.attend("code", "inverse", {
4624
+        "from": {
4625
+            "name": "any"
4626
+        },
4627
+        "to": {
4628
+            "name": "any"
4629
+        }
4630
+    }, {
4631
+        "encode": (domain_parameters) => (x) => {
4632
+            return (lib_code.inverse_encode(y_ => lib_trait.call("code", "decode", domain_parameters.domain_subject)(y_), x));
4633
+        },
4634
+        "decode": (domain_parameters) => (y) => {
4635
+            return (lib_code.inverse_decode(x_ => lib_trait.call("code", "encode", domain_parameters.domain_subject)(x_), y));
4636
+        }
4637
+    });
4638
+})(lib_code || (lib_code = {}));
4639
+/*
4640
+This file is part of »bacterio-plankton:code«.
4641
+
4642
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
4643
+<info@greenscale.de>
4644
+
4645
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
4646
+it under the terms of the GNU Lesser General Public License as published by
4647
+the Free Software Foundation, either version 3 of the License, or
4648
+(at your option) any later version.
4649
+
4650
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
4651
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4652
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4653
+GNU Lesser General Public License for more details.
4654
+
4655
+You should have received a copy of the GNU Lesser General Public License
4656
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
4657
+ */
4658
+var lib_code;
4659
+(function (lib_code) {
4660
+    /**
4661
+     * @author fenris
4662
+     */
4663
+    class class_code_inverse {
4664
+        /**
4665
+         * @author fenris
4666
+         */
4667
+        constructor(subject) {
4668
+            this.subject = subject;
4669
+        }
4670
+        /**
4671
+         * @implementation
4672
+         * @author fenris
4673
+         */
4674
+        encode(to) {
4675
+            return lib_code.inverse_encode(x => this.subject.decode(x), to);
4676
+        }
4677
+        /**
4678
+         * @implementation
4679
+         * @author fenris
4680
+         */
4681
+        decode(from) {
4682
+            return lib_code.inverse_decode(x => this.subject.encode(x), from);
4683
+        }
4684
+    }
4685
+    lib_code.class_code_inverse = class_code_inverse;
4686
+})(lib_code || (lib_code = {}));
4687
+/*
4688
+This file is part of »bacterio-plankton:code«.
4689
+
4690
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
4691
+<info@greenscale.de>
4692
+
4693
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
4694
+it under the terms of the GNU Lesser General Public License as published by
4695
+the Free Software Foundation, either version 3 of the License, or
4696
+(at your option) any later version.
4697
+
4698
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
4699
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4700
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4701
+GNU Lesser General Public License for more details.
4702
+
4703
+You should have received a copy of the GNU Lesser General Public License
4704
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
4705
+ */
4706
+var lib_code;
4707
+(function (lib_code) {
4708
+    /**
4709
+     * @author fenris
4710
+     */
4711
+    function pair_encode(encode_first, encode_second, from) {
4712
+        let between = encode_first(from);
4713
+        let to = encode_second(between);
4714
+        return to;
4715
+    }
4716
+    lib_code.pair_encode = pair_encode;
4717
+    /**
4718
+     * @author fenris
4719
+     */
4720
+    function pair_decode(decode_first, decode_second, to) {
4721
+        let between = decode_second(to);
4722
+        let from = decode_first(between);
4723
+        return from;
4724
+    }
4725
+    lib_code.pair_decode = pair_decode;
4726
+})(lib_code || (lib_code = {}));
4727
+/*
4728
+This file is part of »bacterio-plankton:code«.
4729
+
4730
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
4731
+<info@greenscale.de>
4732
+
4733
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
4734
+it under the terms of the GNU Lesser General Public License as published by
4735
+the Free Software Foundation, either version 3 of the License, or
4736
+(at your option) any later version.
4737
+
4738
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
4739
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4740
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4741
+GNU Lesser General Public License for more details.
4742
+
4743
+You should have received a copy of the GNU Lesser General Public License
4744
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
4745
+ */
4746
+var lib_code;
4747
+(function (lib_code) {
4748
+    /**
4749
+     * @author fenris
4750
+     */
4751
+    lib_trait.attend("code", "pair", {
4752
+        "from": {
4753
+            "name": "any"
4754
+        },
4755
+        "to": {
4756
+            "name": "any"
4757
+        }
4758
+    }, {
4759
+        "encode": (domain_parameters) => (x) => {
4760
+            return (lib_code.pair_encode(x_ => lib_trait.call("code", "encode", domain_parameters.domain_first)(x_), x_ => lib_trait.call("code", "encode", domain_parameters.domain_second)(x_), x));
4761
+        },
4762
+        "decode": (domain_parameters) => (y) => {
4763
+            return (lib_code.pair_decode(y_ => lib_trait.call("code", "decode", domain_parameters.domain_first)(y_), y_ => lib_trait.call("code", "decode", domain_parameters.domain_second)(y_), y));
4764
+        }
4765
+    });
4766
+})(lib_code || (lib_code = {}));
4767
+/*
4768
+This file is part of »bacterio-plankton:code«.
4769
+
4770
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
4771
+<info@greenscale.de>
4772
+
4773
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
4774
+it under the terms of the GNU Lesser General Public License as published by
4775
+the Free Software Foundation, either version 3 of the License, or
4776
+(at your option) any later version.
4777
+
4778
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
4779
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4780
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4781
+GNU Lesser General Public License for more details.
4782
+
4783
+You should have received a copy of the GNU Lesser General Public License
4784
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
4785
+ */
4786
+var lib_code;
4787
+(function (lib_code) {
4788
+    /**
4789
+     * @author fenris
4790
+     */
4791
+    class class_code_pair {
4792
+        /**
4793
+         * @author fenris
4794
+         */
4795
+        constructor(first, second) {
4796
+            this.first = first;
4797
+            this.second = second;
4798
+        }
4799
+        /**
4800
+         * @implementation
4801
+         * @author fenris
4802
+         */
4803
+        encode(from) {
4804
+            return lib_code.pair_encode(x => this.first.encode(x), x => this.second.encode(x), from);
4805
+        }
4806
+        /**
4807
+         * @implementation
4808
+         * @author fenris
4809
+         */
4810
+        decode(to) {
4811
+            return lib_code.pair_decode(x => this.first.decode(x), x => this.second.decode(x), to);
4812
+        }
4813
+    }
4814
+    lib_code.class_code_pair = class_code_pair;
4815
+})(lib_code || (lib_code = {}));
4816
+/*
4817
+This file is part of »bacterio-plankton:code«.
4818
+
4819
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
4820
+<info@greenscale.de>
4821
+
4822
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
4823
+it under the terms of the GNU Lesser General Public License as published by
4824
+the Free Software Foundation, either version 3 of the License, or
4825
+(at your option) any later version.
4826
+
4827
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
4828
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4829
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4830
+GNU Lesser General Public License for more details.
4831
+
4832
+You should have received a copy of the GNU Lesser General Public License
4833
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
4834
+ */
4835
+var lib_code;
4836
+(function (lib_code) {
4837
+    /**
4838
+     * @author fenris
4839
+     */
4840
+    function chain_encode(encode_links, from) {
4841
+        let value = from;
4842
+        encode_links
4843
+            .forEach((link) => {
4844
+            value = link(value);
4845
+        });
4846
+        return value;
4847
+    }
4848
+    lib_code.chain_encode = chain_encode;
4849
+    /**
4850
+     * @author fenris
4851
+     */
4852
+    function chain_decode(decode_links, to) {
4853
+        let value = to;
4854
+        decode_links
4855
+            .reverse()
4856
+            .forEach((link) => {
4857
+            value = link(value);
4858
+        });
4859
+        return value;
4860
+    }
4861
+    lib_code.chain_decode = chain_decode;
4862
+})(lib_code || (lib_code = {}));
4863
+/*
4864
+This file is part of »bacterio-plankton:code«.
4865
+
4866
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
4867
+<info@greenscale.de>
4868
+
4869
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
4870
+it under the terms of the GNU Lesser General Public License as published by
4871
+the Free Software Foundation, either version 3 of the License, or
4872
+(at your option) any later version.
4873
+
4874
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
4875
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4876
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4877
+GNU Lesser General Public License for more details.
4878
+
4879
+You should have received a copy of the GNU Lesser General Public License
4880
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
4881
+ */
4882
+var lib_code;
4883
+(function (lib_code) {
4884
+    /**
4885
+     * @author fenris
4886
+     */
4887
+    class class_code_chain {
4888
+        /**
4889
+         * @author fenris
4890
+         */
4891
+        constructor(links) {
4892
+            this.links = links;
4893
+        }
4894
+        /**
4895
+         * @implementation
4896
+         * @author fenris
4897
+         */
4898
+        encode(from) {
4899
+            return lib_code.chain_encode(this.links.map((link) => (x => link.encode(x))), from);
4900
+        }
4901
+        /**
4902
+         * @implementation
4903
+         * @author fenris
4904
+         */
4905
+        decode(to) {
4906
+            return lib_code.chain_decode(this.links.map((link) => (x => link.decode(x))), to);
4907
+        }
4908
+    }
4909
+    lib_code.class_code_chain = class_code_chain;
4910
+})(lib_code || (lib_code = {}));
4911
+/*
4912
+This file is part of »bacterio-plankton:code«.
4913
+
4914
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
4915
+<info@greenscale.de>
4916
+
4917
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
4918
+it under the terms of the GNU Lesser General Public License as published by
4919
+the Free Software Foundation, either version 3 of the License, or
4920
+(at your option) any later version.
4921
+
4922
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
4923
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4924
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4925
+GNU Lesser General Public License for more details.
4926
+
4927
+You should have received a copy of the GNU Lesser General Public License
4928
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
4929
+ */
4930
+var lib_code;
4931
+(function (lib_code) {
4932
+    /**
4933
+     * @author Christian Fraß <frass@greenscale.de>
4934
+     */
4935
+    function flatten_encode(from, keys = null) {
4936
+        if (keys === null) {
4937
+            if (from.length > 0) {
4938
+                keys = Object.keys(from[0]);
4939
+            }
4940
+            else {
4941
+                throw (new Error("encoding impossible"));
4942
+            }
4943
+        }
4944
+        return {
4945
+            "keys": keys,
4946
+            "data": from.map((line) => keys.map((name) => line[name])),
4947
+        };
4948
+    }
4949
+    lib_code.flatten_encode = flatten_encode;
4950
+    /**
4951
+     * @author Christian Fraß <frass@greenscale.de>
4952
+     */
4953
+    function flatten_decode(to) {
4954
+        return (to.data
4955
+            .map((dataset) => {
4956
+            let dataset_ = {};
4957
+            dataset
4958
+                .forEach((value, index) => {
4959
+                const name = to.keys[index];
4960
+                dataset_[name] = value;
4961
+            });
4962
+            return dataset_;
4963
+        }));
4964
+    }
4965
+    lib_code.flatten_decode = flatten_decode;
4966
+})(lib_code || (lib_code = {}));
4967
+/*
4968
+This file is part of »bacterio-plankton:code«.
4969
+
4970
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
4971
+<info@greenscale.de>
4972
+
4973
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
4974
+it under the terms of the GNU Lesser General Public License as published by
4975
+the Free Software Foundation, either version 3 of the License, or
4976
+(at your option) any later version.
4977
+
4978
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
4979
+but WITHOUT ANY WARRANTY; without even the implied warranty of
4980
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4981
+GNU Lesser General Public License for more details.
4982
+
4983
+You should have received a copy of the GNU Lesser General Public License
4984
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
4985
+ */
4986
+var lib_code;
4987
+(function (lib_code) {
4988
+    /**
4989
+     * @author fenris
4990
+     */
4991
+    class class_code_flatten {
4992
+        /**
4993
+         * @author fenris
4994
+         */
4995
+        constructor() {
4996
+        }
4997
+        /**
4998
+         * @implementation
4999
+         * @author fenris
5000
+         */
5001
+        encode(x) {
5002
+            return lib_code.flatten_encode(x);
5003
+        }
5004
+        /**
5005
+         * @implementation
5006
+         * @author fenris
5007
+         */
5008
+        decode(x) {
5009
+            return lib_code.flatten_decode(x);
5010
+        }
5011
+    }
5012
+    lib_code.class_code_flatten = class_code_flatten;
5013
+})(lib_code || (lib_code = {}));
5014
+/*
5015
+This file is part of »bacterio-plankton:code«.
5016
+
5017
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5018
+<info@greenscale.de>
5019
+
5020
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5021
+it under the terms of the GNU Lesser General Public License as published by
5022
+the Free Software Foundation, either version 3 of the License, or
5023
+(at your option) any later version.
5024
+
5025
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
5026
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5027
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5028
+GNU Lesser General Public License for more details.
5029
+
5030
+You should have received a copy of the GNU Lesser General Public License
5031
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
5032
+ */
5033
+var lib_code;
5034
+(function (lib_code) {
5035
+    /**
5036
+     * @author fenris
5037
+     */
5038
+    const _prefix = "DATE:";
5039
+    /**
5040
+     * @author fenris
5041
+     */
5042
+    function jsdate_encode(date) {
5043
+        let isostring = date.toISOString();
5044
+        let date_ = (_prefix + isostring);
5045
+        return date_;
5046
+    }
5047
+    lib_code.jsdate_encode = jsdate_encode;
5048
+    /**
5049
+     * @author fenris
5050
+     */
5051
+    function jsdate_decode(date_) {
5052
+        if ((typeof (date_) === "string") && (date_.startsWith(_prefix))) {
5053
+            let isostring = date_.slice(_prefix.length);
5054
+            let timestamp = Date.parse(isostring);
5055
+            if (!isNaN(timestamp)) {
5056
+                let date = (new Date(timestamp));
5057
+                return date;
5058
+            }
5059
+            else {
5060
+                let message = ("'" + isostring + "' does not seem to be an ISO-string of a date");
5061
+                throw (new Error(message));
5062
+            }
5063
+        }
5064
+        else {
5065
+            let message = ("expected an encoded date object to be a string starting with '" + _prefix + "'");
5066
+            throw (new Error(message));
5067
+        }
5068
+    }
5069
+    lib_code.jsdate_decode = jsdate_decode;
5070
+})(lib_code || (lib_code = {}));
5071
+/*
5072
+This file is part of »bacterio-plankton:code«.
5073
+
5074
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5075
+<info@greenscale.de>
5076
+
5077
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5078
+it under the terms of the GNU Lesser General Public License as published by
5079
+the Free Software Foundation, either version 3 of the License, or
5080
+(at your option) any later version.
5081
+
5082
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
5083
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5084
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5085
+GNU Lesser General Public License for more details.
5086
+
5087
+You should have received a copy of the GNU Lesser General Public License
5088
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
5089
+ */
5090
+var lib_code;
5091
+(function (lib_code) {
5092
+    /**
5093
+     * @author fenris
5094
+     */
5095
+    lib_trait.attend("code", "jsdate", {
5096
+        "from": {
5097
+            "name": "date"
5098
+        },
5099
+        "to": {
5100
+            "name": "string"
5101
+        }
5102
+    }, {
5103
+        "encode": () => (x) => {
5104
+            return lib_code.jsdate_encode(x);
5105
+        },
5106
+        "decode": () => (y) => {
5107
+            return lib_code.jsdate_decode(y);
5108
+        }
5109
+    });
5110
+})(lib_code || (lib_code = {}));
5111
+/*
5112
+This file is part of »bacterio-plankton:code«.
5113
+
5114
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5115
+<info@greenscale.de>
5116
+
5117
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5118
+it under the terms of the GNU Lesser General Public License as published by
5119
+the Free Software Foundation, either version 3 of the License, or
5120
+(at your option) any later version.
5121
+
5122
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
5123
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5124
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5125
+GNU Lesser General Public License for more details.
5126
+
5127
+You should have received a copy of the GNU Lesser General Public License
5128
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
5129
+ */
5130
+var lib_code;
5131
+(function (lib_code) {
5132
+    /**
5133
+     * @author fenris
5134
+     */
5135
+    class class_code_jsdate {
5136
+        /**
5137
+         * @author fenris
5138
+         */
5139
+        constructor() {
5140
+        }
5141
+        /**
5142
+         * @implementation
5143
+         * @author fenris
5144
+         */
5145
+        encode(x) {
5146
+            return lib_code.jsdate_encode(x);
5147
+        }
5148
+        /**
5149
+         * @implementation
5150
+         * @author fenris
5151
+         */
5152
+        decode(x) {
5153
+            return lib_code.jsdate_decode(x);
5154
+        }
5155
+    }
5156
+    lib_code.class_code_jsdate = class_code_jsdate;
5157
+})(lib_code || (lib_code = {}));
5158
+/*
5159
+This file is part of »bacterio-plankton:code«.
5160
+
5161
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5162
+<info@greenscale.de>
5163
+
5164
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5165
+it under the terms of the GNU Lesser General Public License as published by
5166
+the Free Software Foundation, either version 3 of the License, or
5167
+(at your option) any later version.
5168
+
5169
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
5170
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5171
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5172
+GNU Lesser General Public License for more details.
5173
+
5174
+You should have received a copy of the GNU Lesser General Public License
5175
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
5176
+ */
5177
+var lib_code;
5178
+(function (lib_code) {
5179
+    /**
5180
+     * @author fenris
5181
+     */
5182
+    function json_encode(x, formatted = false) {
5183
+        return JSON.stringify(x, undefined, formatted ? "\t" : undefined);
5184
+    }
5185
+    lib_code.json_encode = json_encode;
5186
+    /**
5187
+     * @author fenris
5188
+     */
5189
+    function json_decode(x) {
5190
+        return JSON.parse(x);
5191
+    }
5192
+    lib_code.json_decode = json_decode;
5193
+})(lib_code || (lib_code = {}));
5194
+/*
5195
+This file is part of »bacterio-plankton:code«.
5196
+
5197
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5198
+<info@greenscale.de>
5199
+
5200
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5201
+it under the terms of the GNU Lesser General Public License as published by
5202
+the Free Software Foundation, either version 3 of the License, or
5203
+(at your option) any later version.
5204
+
5205
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
5206
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5207
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5208
+GNU Lesser General Public License for more details.
5209
+
5210
+You should have received a copy of the GNU Lesser General Public License
5211
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
5212
+ */
5213
+var lib_code;
5214
+(function (lib_code) {
5215
+    /**
5216
+     * @author fenris
5217
+     */
5218
+    lib_trait.attend("code", "json", {
5219
+        "from": {
5220
+            "name": "any"
5221
+        },
5222
+        "to": {
5223
+            "name": "string"
5224
+        }
5225
+    }, {
5226
+        "encode": () => (x) => {
5227
+            return lib_code.json_encode(x);
5228
+        },
5229
+        "decode": () => (y) => {
5230
+            return lib_code.json_decode(y);
5231
+        }
5232
+    });
5233
+})(lib_code || (lib_code = {}));
5234
+/*
5235
+This file is part of »bacterio-plankton:code«.
5236
+
5237
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5238
+<info@greenscale.de>
5239
+
5240
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5241
+it under the terms of the GNU Lesser General Public License as published by
5242
+the Free Software Foundation, either version 3 of the License, or
5243
+(at your option) any later version.
5244
+
5245
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
5246
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5247
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5248
+GNU Lesser General Public License for more details.
5249
+
5250
+You should have received a copy of the GNU Lesser General Public License
5251
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
5252
+ */
5253
+var lib_code;
5254
+(function (lib_code) {
5255
+    /**
5256
+     * @author fenris
5257
+     */
5258
+    class class_code_json {
5259
+        /**
5260
+         * @author fenris
5261
+         */
5262
+        constructor() {
5263
+        }
5264
+        /**
5265
+         * @implementation
5266
+         * @author fenris
5267
+         */
5268
+        encode(x) {
5269
+            return lib_code.json_encode(x);
5270
+        }
5271
+        /**
5272
+         * @implementation
5273
+         * @author fenris
5274
+         */
5275
+        decode(x) {
5276
+            return lib_code.json_decode(x);
5277
+        }
5278
+    }
5279
+    lib_code.class_code_json = class_code_json;
5280
+})(lib_code || (lib_code = {}));
5281
+/*
5282
+This file is part of »bacterio-plankton:code«.
5283
+
5284
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5285
+<info@greenscale.de>
5286
+
5287
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5288
+it under the terms of the GNU Lesser General Public License as published by
5289
+the Free Software Foundation, either version 3 of the License, or
5290
+(at your option) any later version.
5291
+
5292
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
5293
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5294
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5295
+GNU Lesser General Public License for more details.
5296
+
5297
+You should have received a copy of the GNU Lesser General Public License
5298
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
5299
+ */
5300
+var lib_code;
5301
+(function (lib_code) {
5302
+    /**
5303
+     * @author Christian Fraß <frass@greenscale.de>
5304
+     * @todo escaping
5305
+     */
5306
+    function csv_encode(from, { "delimiter": delimiter = ",", "linebreak": linebreak = "\n", } = {}) {
5307
+        return (([]
5308
+            .concat((from.head !== null)
5309
+            ? [from.head]
5310
+            : [])
5311
+            .concat(from.data))
5312
+            .map((dataset) => dataset.join(delimiter))
5313
+            .join(linebreak));
5314
+    }
5315
+    lib_code.csv_encode = csv_encode;
5316
+    /**
5317
+     * @author Christian Fraß <frass@greenscale.de>
5318
+     */
5319
+    function csv_decode(to, { "delimiter": delimiter = ",", "linebreak": linebreak = "\n", "with_head": with_head = true, } = {}) {
5320
+        const array = (to.split(linebreak)
5321
+            .map((line) => line.split(delimiter)));
5322
+        return (with_head
5323
+            ? ({
5324
+                "head": array[0],
5325
+                "data": array.slice(1),
5326
+            })
5327
+            : ({
5328
+                "head": null,
5329
+                "data": array,
5330
+            }));
5331
+    }
5332
+    lib_code.csv_decode = csv_decode;
5333
+})(lib_code || (lib_code = {}));
5334
+/*
5335
+This file is part of »bacterio-plankton:code«.
5336
+
5337
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5338
+<info@greenscale.de>
5339
+
5340
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5341
+it under the terms of the GNU Lesser General Public License as published by
5342
+the Free Software Foundation, either version 3 of the License, or
5343
+(at your option) any later version.
5344
+
5345
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
5346
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5347
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5348
+GNU Lesser General Public License for more details.
5349
+
5350
+You should have received a copy of the GNU Lesser General Public License
5351
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
5352
+ */
5353
+var lib_code;
5354
+(function (lib_code) {
5355
+    /**
5356
+     * @author fenris
5357
+     */
5358
+    class class_code_csv {
5359
+        /**
5360
+         * @author fenris
5361
+         */
5362
+        constructor() {
5363
+        }
5364
+        /**
5365
+         * @implementation
5366
+         * @author fenris
5367
+         */
5368
+        encode(x) {
5369
+            return lib_code.csv_encode(x);
5370
+        }
5371
+        /**
5372
+         * @implementation
5373
+         * @author fenris
5374
+         */
5375
+        decode(x) {
5376
+            return lib_code.csv_decode(x);
5377
+        }
5378
+    }
5379
+    lib_code.class_code_csv = class_code_csv;
5380
+})(lib_code || (lib_code = {}));
5381
+/*
5382
+This file is part of »bacterio-plankton:code«.
5383
+
5384
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5385
+<info@greenscale.de>
5386
+
5387
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5388
+it under the terms of the GNU Lesser General Public License as published by
5389
+the Free Software Foundation, either version 3 of the License, or
5390
+(at your option) any later version.
5391
+
5392
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
5393
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5394
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5395
+GNU Lesser General Public License for more details.
5396
+
5397
+You should have received a copy of the GNU Lesser General Public License
5398
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
5399
+ */
5400
+var lib_code;
5401
+(function (lib_code) {
5402
+    /**
5403
+     * @author fenris
5404
+     */
5405
+    function uri_encode(x) {
5406
+        return encodeURIComponent(x);
5407
+    }
5408
+    lib_code.uri_encode = uri_encode;
5409
+    /**
5410
+     * @author fenris
5411
+     */
5412
+    function uri_decode(x) {
5413
+        return decodeURIComponent(x);
5414
+    }
5415
+    lib_code.uri_decode = uri_decode;
5416
+})(lib_code || (lib_code = {}));
5417
+/*
5418
+This file is part of »bacterio-plankton:code«.
5419
+
5420
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5421
+<info@greenscale.de>
5422
+
5423
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5424
+it under the terms of the GNU Lesser General Public License as published by
5425
+the Free Software Foundation, either version 3 of the License, or
5426
+(at your option) any later version.
5427
+
5428
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
5429
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5430
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5431
+GNU Lesser General Public License for more details.
5432
+
5433
+You should have received a copy of the GNU Lesser General Public License
5434
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
5435
+ */
5436
+var lib_code;
5437
+(function (lib_code) {
5438
+    /**
5439
+     * @author fenris
5440
+     */
5441
+    lib_trait.attend("code", "uri", {
5442
+        "from": {
5443
+            "name": "string"
5444
+        },
5445
+        "to": {
5446
+            "name": "string"
5447
+        }
5448
+    }, {
5449
+        "encode": () => (x) => {
5450
+            return lib_code.uri_encode(x);
5451
+        },
5452
+        "decode": () => (y) => {
5453
+            return lib_code.uri_decode(y);
5454
+        }
5455
+    });
5456
+})(lib_code || (lib_code = {}));
5457
+/*
5458
+This file is part of »bacterio-plankton:code«.
5459
+
5460
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5461
+<info@greenscale.de>
5462
+
5463
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5464
+it under the terms of the GNU Lesser General Public License as published by
5465
+the Free Software Foundation, either version 3 of the License, or
5466
+(at your option) any later version.
5467
+
5468
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
5469
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5470
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5471
+GNU Lesser General Public License for more details.
5472
+
5473
+You should have received a copy of the GNU Lesser General Public License
5474
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
5475
+ */
5476
+var lib_code;
5477
+(function (lib_code) {
5478
+    /**
5479
+     * @author fenris
5480
+     */
5481
+    class class_code_uri {
5482
+        /**
5483
+         * @author fenris
5484
+         */
5485
+        constructor() {
5486
+        }
5487
+        /**
5488
+         * @implementation
5489
+         * @author fenris
5490
+         */
5491
+        encode(x) {
5492
+            return lib_code.uri_encode(x);
5493
+        }
5494
+        /**
5495
+         * @implementation
5496
+         * @author fenris
5497
+         */
5498
+        decode(x) {
5499
+            return lib_code.uri_decode(x);
5500
+        }
5501
+    }
5502
+    lib_code.class_code_uri = class_code_uri;
5503
+})(lib_code || (lib_code = {}));
5504
+/*
5505
+This file is part of »bacterio-plankton:code«.
5506
+
5507
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5508
+<info@greenscale.de>
5509
+
5510
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5511
+it under the terms of the GNU Lesser General Public License as published by
5512
+the Free Software Foundation, either version 3 of the License, or
5513
+(at your option) any later version.
5514
+
5515
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
5516
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5517
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5518
+GNU Lesser General Public License for more details.
5519
+
5520
+You should have received a copy of the GNU Lesser General Public License
5521
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
5522
+ */
5523
+var lib_code;
5524
+(function (lib_code) {
5525
+    /**
5526
+     * @author fenris
5527
+     */
5528
+    function base64_encode(x) {
5529
+        return btoa(x);
5530
+    }
5531
+    lib_code.base64_encode = base64_encode;
5532
+    /**
5533
+     * @author fenris
5534
+     */
5535
+    function base64_decode(x) {
5536
+        return atob(x);
5537
+    }
5538
+    lib_code.base64_decode = base64_decode;
5539
+})(lib_code || (lib_code = {}));
5540
+/*
5541
+This file is part of »bacterio-plankton:code«.
5542
+
5543
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5544
+<info@greenscale.de>
5545
+
5546
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5547
+it under the terms of the GNU Lesser General Public License as published by
5548
+the Free Software Foundation, either version 3 of the License, or
5549
+(at your option) any later version.
5550
+
5551
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
5552
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5553
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5554
+GNU Lesser General Public License for more details.
5555
+
5556
+You should have received a copy of the GNU Lesser General Public License
5557
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
5558
+ */
5559
+var lib_code;
5560
+(function (lib_code) {
5561
+    /**
5562
+     * @author fenris
5563
+     */
5564
+    lib_trait.attend("code", "base64", {
5565
+        "from": {
5566
+            "name": "string"
5567
+        },
5568
+        "to": {
5569
+            "name": "string"
5570
+        }
5571
+    }, {
5572
+        "encode": () => (x) => {
5573
+            return lib_code.base64_encode(x);
5574
+        },
5575
+        "decode": () => (y) => {
5576
+            return lib_code.base64_decode(y);
5577
+        }
5578
+    });
5579
+})(lib_code || (lib_code = {}));
5580
+/*
5581
+This file is part of »bacterio-plankton:code«.
5582
+
5583
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5584
+<info@greenscale.de>
5585
+
5586
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5587
+it under the terms of the GNU Lesser General Public License as published by
5588
+the Free Software Foundation, either version 3 of the License, or
5589
+(at your option) any later version.
5590
+
5591
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
5592
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5593
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5594
+GNU Lesser General Public License for more details.
5595
+
5596
+You should have received a copy of the GNU Lesser General Public License
5597
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
5598
+ */
5599
+var lib_code;
5600
+(function (lib_code) {
5601
+    /**
5602
+     * @author fenris
5603
+     */
5604
+    class class_code_base64 {
5605
+        /**
5606
+         * @author fenris
5607
+         */
5608
+        constructor() {
5609
+        }
5610
+        /**
5611
+         * @implementation
5612
+         * @author fenris
5613
+         */
5614
+        encode(x) {
5615
+            return lib_code.base64_encode(x);
5616
+        }
5617
+        /**
5618
+         * @implementation
5619
+         * @author fenris
5620
+         */
5621
+        decode(x) {
5622
+            return lib_code.base64_decode(x);
5623
+        }
5624
+    }
5625
+    lib_code.class_code_base64 = class_code_base64;
5626
+})(lib_code || (lib_code = {}));
5627
+/*
5628
+This file is part of »bacterio-plankton:string«.
5629
+
5630
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5631
+<info@greenscale.de>
5632
+
5633
+»bacterio-plankton:string« is free software: you can redistribute it and/or modify
5634
+it under the terms of the GNU Lesser General Public License as published by
5635
+the Free Software Foundation, either version 3 of the License, or
5636
+(at your option) any later version.
5637
+
5638
+»bacterio-plankton:string« is distributed in the hope that it will be useful,
5639
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5640
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5641
+GNU Lesser General Public License for more details.
5642
+
5643
+You should have received a copy of the GNU Lesser General Public License
5644
+along with »bacterio-plankton:string«. If not, see <http://www.gnu.org/licenses/>.
5645
+ */
5646
+var plain_text_to_html = function (text) {
5647
+    var ret = text;
5648
+    ret = ret.replace(/  /g, "&nbsp;&nbsp;"); // convert multiple whitespace to forced ones
5649
+    ret = ret.split("\n").join("<br/>");
5650
+    return ret;
5651
+};
5652
+/**
5653
+ * @desc makes a valid
5654
+ */
5655
+var format_sentence = function (str, rtl, caseSense) {
5656
+    if (rtl === void 0) { rtl = false; }
5657
+    if (caseSense === void 0) { caseSense = true; }
5658
+    if (str === "") {
5659
+        return str;
5660
+    }
5661
+    else {
5662
+        var marks = {
5663
+            ".": true,
5664
+            "?": true,
5665
+            "!": true
5666
+        };
5667
+        var default_mark = ".";
5668
+        var ret = str.split("");
5669
+        if (!rtl) {
5670
+            ret[0] = ret[0].toLocaleUpperCase();
5671
+            if (!(ret[ret.length - 1] in marks)) {
5672
+                ret.push(default_mark);
5673
+            }
5674
+        }
5675
+        else {
5676
+            ret[ret.length - 1] = ret[ret.length - 1].toLocaleUpperCase();
5677
+            if (!(ret[0] in marks)) {
5678
+                ret.unshift(default_mark);
5679
+            }
5680
+        }
5681
+        return ret.join("");
5682
+    }
5683
+};
5684
+var fill_string_template = function (template_string, object, fabric, delimiter, default_string, sloppy) {
5685
+    if (fabric === void 0) { fabric = function (object, key) { return object[key]; }; }
5686
+    if (delimiter === void 0) { delimiter = "%"; }
5687
+    if (default_string === void 0) { default_string = null; }
5688
+    function get_tags(str) {
5689
+        var r = new RegExp(delimiter + "[^\\s^" + delimiter + "]+" + delimiter, "gi");
5690
+        return ((str.match(r) || []).map(function (e) {
5691
+            return e.slice(delimiter.length, e.length - delimiter.length);
5692
+        }));
5693
+    }
5694
+    function replace_tag(str, tag, value) {
5695
+        var r = new RegExp(delimiter + tag + delimiter, "gi");
5696
+        return str.replace(r, value);
5697
+    }
5698
+    function replace_tags(str, obj) {
5699
+        return (get_tags(str).reduce(function (ret, key) {
5700
+            var value = "";
5701
+            try {
5702
+                value = fabric(obj, key);
5703
+                if ((!sloppy && (value === void 0)) || (sloppy && (value == void 0))) {
5704
+                    value = default_string;
5705
+                }
5706
+            }
5707
+            catch (e) {
5708
+                console.warn("invalid placeholder " + key);
5709
+                value = default_string;
5710
+            }
5711
+            return replace_tag(ret, key, value);
5712
+        }, str));
5713
+    }
5714
+    return replace_tags(template_string, object);
5715
+};
5716
+var make_string_template = function (_template, _fabrics) {
5717
+    if (_fabrics === void 0) { _fabrics = {}; }
5718
+    function replace_tag(str, tag, value) {
5719
+        var r = new RegExp("%" + tag + "%", "gi");
5720
+        return str.replace(r, value);
5721
+    }
5722
+    function replace_tags(str, obj) {
5723
+        return (Object.keys(obj).reduce(function (ret, key) {
5724
+            return replace_tag(ret, key, _fabrics[key] || obj[key]);
5725
+        }, str));
5726
+    }
5727
+    return (function (tags) {
5728
+        return replace_tags(_template, tags);
5729
+    });
5730
+};
5731
+var make_eml_header = (function () {
5732
+    var _template = "";
5733
+    _template += "From: %from%\n";
5734
+    _template += "To: %recipient%\n";
5735
+    _template += "Subject: %subject%\n";
5736
+    _template += "X-Mailer: greenscale-plankton.emlgen\n";
5737
+    return make_string_template(_template);
5738
+})();
5739
+var make_eml_body = (function () {
5740
+    var exports = {};
5741
+    exports["simple_body"] = make_string_template("Content-Type: %contenttype%\n\n%body%\n\n");
5742
+    // very basic implementation
5743
+    // parts = [{contenttype:"text/html; charset=UTF-8", body: "<h1>foo</h1>" }, {...}]
5744
+    exports["body_boundrary"] = function (parts, boundrary) {
5745
+        var _template = "";
5746
+        _template += "--%boundrary%\n";
5747
+        _template += "Content-Type: %contenttype%\n\n%body%\n\n";
5748
+        //_template += "--%boundrary%--\n\n";
5749
+        var maker = make_string_template(_template);
5750
+        return (parts.reduce(function (prev, curr) {
5751
+            curr.boundrary = boundrary;
5752
+            return [prev, maker(curr)].join("");
5753
+        }, ""));
5754
+    };
5755
+    // body must be base64 encoded!
5756
+    exports["attachment_boundrary"] = function (parts, boundrary) {
5757
+        var _template = "";
5758
+        _template += "--%boundrary%\n";
5759
+        _template += "Content-Type: %contenttype%\n";
5760
+        _template += "Content-Transfer-Encoding: base64\n";
5761
+        _template += "Content-Disposition: %disposition%; filename=\"%name%\"\n\n";
5762
+        _template += "%body%\n\n";
5763
+        //_template += "--%boundrary%--\n\n";
5764
+        var maker = make_string_template(_template);
5765
+        return (parts.reduce(function (prev, curr) {
5766
+            curr.boundrary = boundrary;
5767
+            if (curr.disposition === void 0)
5768
+                curr.disposition = "inline";
5769
+            return [prev, maker(curr)].join("");
5770
+        }, ""));
5771
+    };
5772
+    exports["gen_boundrary"] = function () {
5773
+        return ("xxxxxxxxxxxxxxxxxxxxxx".replace(/[xy]/g, function (c) {
5774
+            var r = crypto.getRandomValues(new Uint8Array(1))[0] % 16 | 0, v = c == "x" ? r : (r & 0x3 | 0x8);
5775
+            return v.toString(16);
5776
+        }));
5777
+    };
5778
+    // simple implementation without alternatives (old rfc)
5779
+    exports["complete_boundrary"] = function (bodyparts, attachments) {
5780
+        var ret = "";
5781
+        var boundrary = exports["gen_boundrary"]();
5782
+        ret += exports["body_boundrary"](bodyparts, boundrary);
5783
+        ret += exports["attachment_boundrary"](attachments, boundrary);
5784
+        ret += "--" + boundrary + "--\n\nINVISIBLE!!!!";
5785
+        return (exports["simple_body"]({
5786
+            "contenttype": sprintf("multipart/mixed; boundary=%s", [boundrary]),
5787
+            "body": ret
5788
+        }));
5789
+    };
5790
+    return exports;
5791
+})();
5792
+/*
5793
+This file is part of »bacterio-plankton:string«.
5794
+
5795
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5796
+<info@greenscale.de>
5797
+
5798
+»bacterio-plankton:string« is free software: you can redistribute it and/or modify
5799
+it under the terms of the GNU Lesser General Public License as published by
5800
+the Free Software Foundation, either version 3 of the License, or
5801
+(at your option) any later version.
5802
+
5803
+»bacterio-plankton:string« is distributed in the hope that it will be useful,
5804
+but WITHOUT ANY WARRANTY; without even the implied warranty of
5805
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5806
+GNU Lesser General Public License for more details.
5807
+
5808
+You should have received a copy of the GNU Lesser General Public License
5809
+along with »bacterio-plankton:string«. If not, see <http://www.gnu.org/licenses/>.
5810
+ */
5811
+var lib_string;
5812
+(function (lib_string) {
5813
+    /**
5814
+     * @author fenris
5815
+     */
5816
+    var hexdigits = 4;
5817
+    /**
5818
+     * @author fenris
5819
+     */
5820
+    var index_max = (1 << (4 * hexdigits));
5821
+    /**
5822
+     * @author fenris
5823
+     */
5824
+    var index_is = 0;
5825
+    /**
5826
+     * @author neuc,frac
5827
+     */
5828
+    function empty(str) {
5829
+        return (str.trim() === "");
5830
+    }
5831
+    lib_string.empty = empty;
5832
+    /**
5833
+     * @desc returns a unique string
5834
+     * @param {string} prefix an optional prefix for the generated string
5835
+     * @return {string}
5836
+     * @author fenris
5837
+     */
5838
+    function generate(prefix) {
5839
+        if (prefix === void 0) { prefix = "string_"; }
5840
+        if (index_is > index_max) {
5841
+            throw (new Error("[string_generate] out of valid indices"));
5842
+        }
5843
+        else {
5844
+            return lib_string.sprintf(prefix + "%0" + hexdigits.toString() + "X", [index_is++]);
5845
+        }
5846
+    }
5847
+    lib_string.generate = generate;
5848
+    /**
5849
+     * @desc splits a string, but returns an empty list, if the string is empty
5850
+     * @param {string} chain
5851
+     * @param {string} separator
5852
+     * @return {Array<string>}
5853
+     * @author fenris
5854
+     */
5855
+    function split(chain, separator) {
5856
+        if (separator === void 0) { separator = " "; }
5857
+        if (chain.length == 0) {
5858
+            return [];
5859
+        }
5860
+        else {
5861
+            return chain.split(separator);
5862
+        }
5863
+    }
5864
+    lib_string.split = split;
5865
+    /**
5866
+     * @author neu3no
5867
+     */
5868
+    function explode(str, needle, max) {
5869
+        var temp = str.split(needle);
5870
+        var right = temp.splice(max - 1);
5871
+        temp.push(right.join(needle));
5872
+        return temp;
5873
+    }
5874
+    lib_string.explode = explode;
5875
+    /**
5876
+     * @desc concats a given word with itself n times
5877
+     * @param {string} word
5878
+     * @param {int}
5879
+     * @return {string}
5880
+     * @author fenris
5881
+     */
5882
+    function repeat(word, count) {
5883
+        // return ((count == 0) ? "" : (word + repeat(word, count-1)));
5884
+        var result = "";
5885
+        for (var n = 0; n < count; n += 1) {
5886
+            result += word;
5887
+        }
5888
+        return result;
5889
+    }
5890
+    lib_string.repeat = repeat;
5891
+    /**
5892
+     * @desc lengthens a string by repeatedly appending or prepending another string
5893
+     * @param {string} word the string to pad
5894
+     * @param {int} length the length, which the result shall have
5895
+     * @param {string} symbol the string, which will be added (multiple times)
5896
+     * @param {boolean} [prepend]; whether to prepend (~true) or append (~false); default: false
5897
+     * @return {string} the padded string
5898
+     * @author fenris
5899
+     */
5900
+    function pad(word, length, symbol, mode) {
5901
+        if (symbol === void 0) { symbol = " "; }
5902
+        if (mode === void 0) { mode = "append"; }
5903
+        switch (mode) {
5904
+            case "prepend": {
5905
+                // insert symbols only at the beginning
5906
+                while (word.length < length)
5907
+                    word = symbol + word;
5908
+                return word.substring(word.length - length);
5909
+                break;
5910
+            }
5911
+            case "append": {
5912
+                // insert symbols only at the end
5913
+                while (word.length < length)
5914
+                    word = word + symbol;
5915
+                return word.substring(0, length);
5916
+                break;
5917
+            }
5918
+            case "widen": {
5919
+                // insert symbols at both sides
5920
+                var left = (((length - word.length) & 1) === 0);
5921
+                while (word.length < length) {
5922
+                    word = (left
5923
+                        ? (symbol + word)
5924
+                        : (word + symbol));
5925
+                    left = (!left);
5926
+                }
5927
+                return word.substring(0, length);
5928
+                break;
5929
+            }
5930
+            default: {
5931
+                var message = ("unhandled mode '" + mode + "'");
5932
+                console.warn(message);
5933
+                return word;
5934
+                break;
5935
+            }
5936
+        }
5937
+    }
5938
+    lib_string.pad = pad;
5939
+    /**
5940
+     * @desc checks if a given string conttains a certain substring
5941
+     * @param {string} string
5942
+     * @param {string} part
5943
+     * @return {boolean}
5944
+     * @author fenris
5945
+     */
5946
+    function contains(chain, part) {
5947
+        if (typeof (chain) !== "string") {
5948
+            return false;
5949
+        }
5950
+        return (chain.indexOf(part) >= 0);
5951
+    }
5952
+    lib_string.contains = contains;
5953
+    /**
5954
+     * @desc checks if a given string starts with a certain substring
5955
+     * @param {string} string
5956
+     * @param {string} part
5957
+     * @return {boolean}
5958
+     * @author fenris
5959
+     */
5960
+    function startsWith(chain, part) {
5961
+        if (typeof (chain) !== "string") {
5962
+            return false;
5963
+        }
5964
+        // return (string.indexOf(part) === 0);
5965
+        return ((function (m, n) {
5966
+            if (n === 0) {
5967
+                return true;
5968
+            }
5969
+            else {
5970
+                if (m === 0) {
5971
+                    return false;
5972
+                }
5973
+                else {
5974
+                    return ((chain[0] == part[0])
5975
+                        &&
5976
+                            startsWith(chain.substring(1), part.substring(1)));
5977
+                }
5978
+            }
5979
+        })(chain.length, part.length));
5980
+    }
5981
+    lib_string.startsWith = startsWith;
5982
+    /**
5983
+     * @desc checks if a given string ends with a certain substring
5984
+     * @param {string} string
5985
+     * @param {string} part
5986
+     * @return {boolean}
5987
+     * @author fenris
5988
+     */
5989
+    function endsWith(chain, part) {
5990
+        if (typeof (chain) !== "string") {
5991
+            return false;
5992
+        }
5993
+        // return (string.lastIndexOf(part) === string.length-part.length);
5994
+        return ((function (m, n) {
5995
+            if (n === 0) {
5996
+                return true;
5997
+            }
5998
+            else {
5999
+                if (m === 0) {
6000
+                    return false;
6001
+                }
6002
+                else {
6003
+                    // console.info(("(" + string[m-1] + " == " + part[n-1] + ")") + " = " + String(string[m-1] == part[n-1]));
6004
+                    return ((chain[m - 1] === part[n - 1])
6005
+                        &&
6006
+                            endsWith(chain.substring(0, m - 1), part.substring(0, n - 1)));
6007
+                }
6008
+            }
6009
+        })(chain.length, part.length));
6010
+    }
6011
+    lib_string.endsWith = endsWith;
6012
+    /**
6013
+     * @desc count the occourrences of a string in a string
6014
+     * @param string haystack_string the string wich should be examined
6015
+     * @param string needle_string the string which should be counted
6016
+     * @author neuc
6017
+     */
6018
+    function count_occourrences(haystack_string, needle_string, check_escape) {
6019
+        var cnt = 0;
6020
+        var pos = -1;
6021
+        do {
6022
+            pos = haystack_string.indexOf(needle_string, pos + 1);
6023
+            if ((!check_escape) || (haystack_string[pos - 1] != "\\")) {
6024
+                cnt++;
6025
+            }
6026
+        } while (pos >= 0);
6027
+        return (cnt - 1);
6028
+    }
6029
+    lib_string.count_occourrences = count_occourrences;
6030
+    /**
6031
+     * @desc replaces occurences of "${name}" in a string by the corresponding values of an argument object
6032
+     * @author fenris
6033
+     */
6034
+    function coin(str, args) {
6035
+        Object.keys(args).forEach(function (key) {
6036
+            // old syntax
6037
+            {
6038
+                var value = args[key];
6039
+                var regexp_argument = new RegExp("\\${" + key + "}");
6040
+                str = str.replace(regexp_argument, value);
6041
+            }
6042
+            // new syntax
6043
+            {
6044
+                var value = args[key];
6045
+                var regexp_argument = new RegExp("{{" + key + "}}");
6046
+                str = str.replace(regexp_argument, value);
6047
+            }
6048
+        });
6049
+        return str;
6050
+    }
6051
+    lib_string.coin = coin;
6052
+    /**
6053
+     * @author fenris
6054
+     */
6055
+    lib_string.stance = coin;
6056
+    /**
6057
+     * @author fenris
6058
+     */
6059
+    function url_encode(_a) {
6060
+        var _b = _a === void 0 ? {} : _a, _c = _b["protocol"], protocol = _c === void 0 ? null : _c, _d = _b["host"], host = _d === void 0 ? null : _d, _e = _b["port"], port = _e === void 0 ? null : _e, _f = _b["path"], path = _f === void 0 ? null : _f, _g = _b["arguments"], arguments_ = _g === void 0 ? null : _g;
6061
+        var url = "";
6062
+        // protocol
6063
+        {
6064
+            if (protocol != null) {
6065
+                url = protocol + ":" + url;
6066
+            }
6067
+        }
6068
+        // host
6069
+        {
6070
+            if (host != null) {
6071
+                url = url + "//" + host;
6072
+            }
6073
+        }
6074
+        // port
6075
+        {
6076
+            if (port != null) {
6077
+                url = url + ":" + port.toString();
6078
+            }
6079
+        }
6080
+        // path
6081
+        {
6082
+            if (path != null) {
6083
+                var path_ = encodeURI(path);
6084
+                url = "" + url + path_;
6085
+            }
6086
+        }
6087
+        // arguments
6088
+        {
6089
+            if (arguments_ != null) {
6090
+                var suffix = Object.keys(arguments_).map(function (key) { return key + "=" + arguments_[key]; }).join("&");
6091
+                var suffix_ = encodeURI(suffix);
6092
+                url = url + "?" + suffix_;
6093
+            }
6094
+        }
6095
+        return url;
6096
+    }
6097
+    lib_string.url_encode = url_encode;
6098
+    /**
6099
+     * @author fenris
6100
+     */
6101
+    lib_string.make_url = url_encode;
6102
+    /**
6103
+     * @author fenris
6104
+     * @todo arguments
6105
+     */
6106
+    function url_decode(url) {
6107
+        var regexp = new RegExp("^([^:]*)://([^:]*):([^/]*)/(.*)$");
6108
+        var matching = regexp.exec(url);
6109
+        if (matching === null) {
6110
+            return null;
6111
+        }
6112
+        else {
6113
+            var components = {
6114
+                "protocol": matching[1],
6115
+                "host": matching[2],
6116
+                "port": parseInt(matching[3]),
6117
+                "path": ("/" + matching[4])
6118
+            };
6119
+            return components;
6120
+        }
6121
+    }
6122
+    lib_string.url_decode = url_decode;
6123
+    /**
6124
+     * @author fenris
6125
+     */
6126
+    function cut(str, length, delimiter) {
6127
+        if (delimiter === void 0) { delimiter = "…"; }
6128
+        if (str.length <= length) {
6129
+            return str;
6130
+        }
6131
+        else {
6132
+            return (str.slice(0, length - delimiter.length) + delimiter);
6133
+        }
6134
+    }
6135
+    lib_string.cut = cut;
6136
+})(lib_string || (lib_string = {}));
6137
+/*
6138
+This file is part of »bacterio-plankton:string«.
6139
+
6140
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
6141
+<info@greenscale.de>
6142
+
6143
+»bacterio-plankton:string« is free software: you can redistribute it and/or modify
6144
+it under the terms of the GNU Lesser General Public License as published by
6145
+the Free Software Foundation, either version 3 of the License, or
6146
+(at your option) any later version.
6147
+
6148
+»bacterio-plankton:string« is distributed in the hope that it will be useful,
6149
+but WITHOUT ANY WARRANTY; without even the implied warranty of
6150
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6151
+GNU Lesser General Public License for more details.
6152
+
6153
+You should have received a copy of the GNU Lesser General Public License
6154
+along with »bacterio-plankton:string«. If not, see <http://www.gnu.org/licenses/>.
6155
+ */
6156
+var lib_string;
6157
+(function (lib_string) {
6158
+    var pattern = /%([-+#0 ]*)([0-9]*)[\.]{0,1}([0-9]*)([\w]{1})/;
6159
+    var gpattern = /%([-+#0 ]*)([0-9]*)[\.]{0,1}([0-9]*)([\w]{1})/g;
6160
+    function split_format(format) {
6161
+        var tmp = format.match(pattern);
6162
+        if (tmp === null)
6163
+            return null;
6164
+        return {
6165
+            'flags': tmp[1].split(""),
6166
+            'width': Number(tmp[2]),
6167
+            'precision': tmp[3] === '' ? null : Number(tmp[3]),
6168
+            'specifier': tmp[4],
6169
+            'string': format
6170
+        };
6171
+    }
6172
+    function make_err(format, arg, should) {
6173
+        return ("[sprintf]" + " " + "argument for '" + format.string + "' has to be '" + should + "' but '" + arg + "' is '" + typeof arg + "'!");
6174
+    }
6175
+    function test_arg(format, arg, should) {
6176
+        if (typeof arg !== should) {
6177
+            console.warn(make_err(format, arg, should));
6178
+            return false;
6179
+        }
6180
+        return true;
6181
+    }
6182
+    function string_fill(str, char, len, left) {
6183
+        while (str.length < len) {
6184
+            if (left) {
6185
+                str += char;
6186
+            }
6187
+            else {
6188
+                str = char + str;
6189
+            }
6190
+        }
6191
+        return str;
6192
+    }
6193
+    /**
6194
+     * the known_parameters are used to parse the different identifiers for the welln known syntax:
6195
+     *          flag   width   precision   identifier
6196
+     *      %{[0#+- ]}{[0-9]*}.{[0-9]*}[fFdiueEgGsoxXaAsn]
6197
+     * flags:
6198
+     * 0    -   fill with '0' instead of ' ' if the string length < width
6199
+     * #    -   not implemented
6200
+     * -    -   left-justified -> fill on the right side to reach width
6201
+     * +    -   force using '+' on positive numbers
6202
+     * ' '  -   add a single space before positive numbers
6203
+     *
6204
+     * identifiers
6205
+     * %f, %F       -   interpret given number as float, width: the minimal total width (fill with ' ' or '0' if the
6206
+     *                  resulting string is too short, precision: cut more then given decimal places
6207
+     * %d, %i, %u   -   interpret number as integer, decimal places will be cut. width: like float, precision:
6208
+     *                  fill with '0' on right side until length given in precision is reached
6209
+     * %e           -   interpret as float and write as scientifical number, width & precision like in float
6210
+     * %E           -   same es %e but uppercase 'E'
6211
+     * %g           -   use the shortest string of %f or %e
6212
+     * %G           -   use the shortest string of %E or %E
6213
+     * %s           -   simply print a string
6214
+     * %o           -   print the given number in octal notation
6215
+     * %x           -   print the given number in hex notation
6216
+     * %X           -   same as %x but with uppercase characters
6217
+     * %a           -   alias to %x
6218
+     * %A           -   alias to %X
6219
+     * %n           -   just print nothing
6220
+     * @type {{}}
6221
+     */
6222
+    var known_params = {};
6223
+    known_params["f"] = function (format, arg) {
6224
+        if (!test_arg(format, arg, "number"))
6225
+            return "Ø";
6226
+        var tmp = Math.abs(arg);
6227
+        var sign = (arg < 0) ? -1 : 1;
6228
+        var tmp_result = null;
6229
+        if (format.precision !== null) {
6230
+            tmp = Math.floor(Math.pow(10, format.precision) * tmp) / Math.pow(10, format.precision);
6231
+            var tmp_ = (tmp * sign).toString().split(".");
6232
+            if (tmp_.length === 1)
6233
+                tmp_.push("");
6234
+            tmp_[1] = string_fill(tmp_[1], "0", format.precision, true);
6235
+            tmp_result = tmp_.join(".");
6236
+        }
6237
+        else {
6238
+            tmp_result = (sign * tmp).toString();
6239
+        }
6240
+        if ((format.flags.indexOf(" ") >= 0) && (arg >= 0)) {
6241
+            tmp_result = " " + tmp;
6242
+        }
6243
+        else if ((format.flags.indexOf("+") >= 0) && (arg >= 0)) {
6244
+            tmp_result = "+" + tmp;
6245
+        }
6246
+        tmp_result = string_fill(tmp, (format.flags.indexOf("0") >= 0) ? "0" : " ", format.width, (format.flags.indexOf("-") >= 0));
6247
+        return tmp_result;
6248
+    };
6249
+    known_params["F"] = known_params["f"];
6250
+    known_params["d"] = function (format, arg) {
6251
+        if (!test_arg(format, arg, 'number'))
6252
+            return 'Ø';
6253
+        var tmp = (((arg < 0 && format.specifier !== 'u') ? -1 : 1) * Math.floor(Math.abs(arg))).toString();
6254
+        if ((format.specifier === 'd' || format.specifier === 'i') && format.flags.indexOf(' ') >= 0 && arg >= 0) {
6255
+            tmp = ' ' + tmp;
6256
+        }
6257
+        else if ((format.specifier === 'd' || format.specifier === 'i') && format.flags.indexOf('+') >= 0 && arg >= 0) {
6258
+            tmp = '+' + tmp;
6259
+        }
6260
+        tmp = string_fill(tmp, format.flags.indexOf('0') >= 0 ? '0' : ' ', format.width, format.flags.indexOf('-') >= 0);
6261
+        tmp = string_fill(tmp, '0', format.precision === null ? 0 : format.precision, false);
6262
+        return tmp;
6263
+    };
6264
+    known_params["i"] = known_params["d"];
6265
+    known_params["u"] = known_params["d"];
6266
+    known_params["e"] = function (format, arg) {
6267
+        if (!test_arg(format, arg, 'number'))
6268
+            return 'Ø';
6269
+        var tmp = arg.toExponential(format.precision === null ? undefined : format.precision).toString();
6270
+        if (format.flags.indexOf(' ') >= 0 && arg >= 0) {
6271
+            tmp = ' ' + tmp;
6272
+        }
6273
+        else if (format.flags.indexOf('+') >= 0 && arg >= 0) {
6274
+            tmp = '+' + tmp;
6275
+        }
6276
+        tmp = string_fill(tmp, format.flags.indexOf('0') >= 0 ? '0' : ' ', format.width, format.flags.indexOf('-') >= 0);
6277
+        return tmp;
6278
+    };
6279
+    known_params["E"] = function (format, arg) {
6280
+        return known_params["e"](format, arg).toUpperCase();
6281
+    };
6282
+    known_params["g"] = function (format, arg) {
6283
+        if (!test_arg(format, arg, 'number'))
6284
+            return 'Ø';
6285
+        var tmpf = known_params["f"](format, arg);
6286
+        var tmpe = known_params["e"](format, arg);
6287
+        if (tmpf.length < tmpe.length) {
6288
+            return tmpf;
6289
+        }
6290
+        else {
6291
+            return tmpe;
6292
+        }
6293
+    };
6294
+    known_params["G"] = function (format, arg) {
6295
+        return known_params["g"](format, arg).toUpperCase();
6296
+    };
6297
+    known_params["s"] = function (format, arg) {
6298
+        if (!test_arg(format, arg, 'string'))
6299
+            return 'o.O';
6300
+        var tmp = format.precision !== null ? arg.substr(0, format.precision) : arg;
6301
+        tmp = string_fill(tmp, format.flags.indexOf('0') >= 0 ? '0' : ' ', format.width, format.flags.indexOf('-') >= 0);
6302
+        return tmp;
6303
+    };
6304
+    known_params["o"] = function (format, arg) {
6305
+        if (!test_arg(format, arg, 'number'))
6306
+            return 'Ø';
6307
+        var tmp = Math.floor(Math.round(Math.abs(arg))) * ((arg < 0) ? -1 : 1);
6308
+        return known_params["s"](format, tmp.toString(8));
6309
+    };
6310
+    known_params["x"] = function (format, arg) {
6311
+        if (!test_arg(format, arg, 'number'))
6312
+            return 'Ø';
6313
+        var tmp = Math.floor(Math.round(Math.abs(arg))) * ((arg < 0) ? -1 : 1);
6314
+        return known_params["s"](format, tmp.toString(16));
6315
+    };
6316
+    known_params["a"] = known_params["x"];
6317
+    known_params["X"] = function (format, arg) {
6318
+        if (!test_arg(format, arg, 'number'))
6319
+            return 'Ø';
6320
+        return known_params["x"](format, arg).toUpperCase();
6321
+    };
6322
+    known_params["A"] = known_params["X"];
6323
+    known_params["c"] = function (format, arg) {
6324
+        var tmp = "";
6325
+        if (typeof arg === "number") {
6326
+            tmp = String.fromCharCode(arg);
6327
+        }
6328
+        else if ((typeof arg === "string") && (arg.length === 1)) {
6329
+            tmp = arg[0];
6330
+        }
6331
+        else {
6332
+            console.warn(make_err(format, arg, "number|string") + " and if string it needs to have the length of 1!");
6333
+        }
6334
+        return known_params["s"](format, tmp);
6335
+    };
6336
+    known_params["n"] = function () {
6337
+        return "";
6338
+    };
6339
+    var decompose = function (chain, regexp) {
6340
+        var result = regexp.exec(chain);
6341
+        if (result == null) {
6342
+            return null;
6343
+        }
6344
+        else {
6345
+            var front = chain.substring(0, result.index);
6346
+            var back = chain.substring(result.index + result[0].length);
6347
+            return { "front": front, "match": result[0], "back": back };
6348
+        }
6349
+    };
6350
+    /**
6351
+     * an implementation of c sprintf
6352
+     * @param {string} string format string
6353
+     * @param {array} args arguments which should be filled into
6354
+     * @returns {string}
6355
+     */
6356
+    lib_string.sprintf = function (input, args, original) {
6357
+        if (args === void 0) { args = []; }
6358
+        if (original === void 0) { original = null; }
6359
+        if (original == null)
6360
+            original = input;
6361
+        var components = decompose(input, pattern);
6362
+        if (components == null) {
6363
+            if (args.length > 0) {
6364
+                console.warn("[sprintf] superfluous arguments while formatting '" + original + "': ", args);
6365
+            }
6366
+            return input;
6367
+        }
6368
+        else {
6369
+            var arg;
6370
+            var rest;
6371
+            if (args.length > 0) {
6372
+                arg = args[0];
6373
+                rest = args.slice(1);
6374
+            }
6375
+            else {
6376
+                console.warn("[sprintf] out of arguments while formatting '" + original + "'");
6377
+                arg = null;
6378
+                rest = [];
6379
+                return input;
6380
+            }
6381
+            var fmt = split_format(components["match"]);
6382
+            return (components["front"]
6383
+                + known_params[fmt.specifier](fmt, arg)
6384
+                + lib_string.sprintf(components["back"], rest, original));
6385
+        }
6386
+    };
6387
+    /**
6388
+     * an implementation of c printf
6389
+     * @param {string} string format string
6390
+     * @param {array} args arguments which should be filled into
6391
+     * @returns {string}
6392
+     */
6393
+    function printf(format, args) {
6394
+        console.log(lib_string.sprintf(format, args));
6395
+    }
6396
+    lib_string.printf = printf;
6397
+})(lib_string || (lib_string = {}));
6398
+var sprintf = lib_string.sprintf;
6399
+var printf = lib_string.printf;
6400
+/*
6401
+This file is part of »bacterio-plankton:string«.
6402
+
6403
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
6404
+<info@greenscale.de>
6405
+
6406
+»bacterio-plankton:string« is free software: you can redistribute it and/or modify
6407
+it under the terms of the GNU Lesser General Public License as published by
6408
+the Free Software Foundation, either version 3 of the License, or
6409
+(at your option) any later version.
6410
+
6411
+»bacterio-plankton:string« is distributed in the hope that it will be useful,
6412
+but WITHOUT ANY WARRANTY; without even the implied warranty of
6413
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6414
+GNU Lesser General Public License for more details.
6415
+
6416
+You should have received a copy of the GNU Lesser General Public License
6417
+along with »bacterio-plankton:string«. If not, see <http://www.gnu.org/licenses/>.
6418
+ */
6419
+var make_logger = (function () {
6420
+    var _loggers = {};
6421
+    var make_logger = function (prefix, current_loglevel) {
6422
+        var log = [];
6423
+        var level = [
6424
+            "LOG", "INFO", "WARNING", "DEBUG"
6425
+        ];
6426
+        var logger = function (obj, lvl) {
6427
+            var txt = obj.txt || obj;
6428
+            if (lvl == void 0)
6429
+                lvl = 0;
6430
+            var date = new Date();
6431
+            log.push({
6432
+                "message": sprintf("%s [%s:%s] %s", [date.toString(), level[lvl], prefix, txt]),
6433
+                "timeStamp": +(date)
6434
+            });
6435
+            if (lvl <= current_loglevel) {
6436
+                var msg = ["[" + prefix + "]", txt];
6437
+                if (obj.arg)
6438
+                    msg = ["[" + prefix + "]"].concat(Array.prototype.slice.call(obj.arg));
6439
+                if (lvl === 0)
6440
+                    console["_log"].apply(console, msg);
6441
+                else if (lvl === 1)
6442
+                    console["_info"].apply(console, msg);
6443
+                else if (lvl === 2)
6444
+                    console["_warn"].apply(console, msg);
6445
+                else if (lvl >= 3)
6446
+                    console["_log"].apply(console, msg);
6447
+            }
6448
+        };
6449
+        _loggers[prefix] = {
6450
+            "logger": logger,
6451
+            "log": log
6452
+        };
6453
+        return logger;
6454
+    };
6455
+    make_logger["loggers"] = _loggers;
6456
+    make_logger["complete_log"] = function () {
6457
+        var logs = Object.keys(_loggers)
6458
+            .reduce(function (p, c) {
6459
+            return [].concat(p, _loggers[c].log);
6460
+        }, []);
6461
+        logs.sort(function (x, y) {
6462
+            return ((x.timeStamp > y.timeStamp) ? -1 : +1);
6463
+        });
6464
+        return logs.map(function (x, i, a) {
6465
+            return x.message;
6466
+        });
6467
+    };
6468
+    if ( /*!track_exports*/true) {
6469
+        var _log_all = function (log, lvl, next) {
6470
+            if (next === void 0) { next = function () { }; }
6471
+            return function () {
6472
+                var msg = [];
6473
+                for (var i = 0; i < arguments.length; i++) {
6474
+                    if (typeof arguments[i] === "string") {
6475
+                        msg.push(arguments[i]);
6476
+                    }
6477
+                    else {
6478
+                        msg.push(JSON.stringify(arguments[i]));
6479
+                    }
6480
+                }
6481
+                var obj = {
6482
+                    txt: msg.join("\t"),
6483
+                    arg: arguments
6484
+                };
6485
+                log(obj, lvl);
6486
+                next();
6487
+            };
6488
+        };
6489
+        {
6490
+            var __warn = make_logger("deprecated console.warn", 99);
6491
+            var __error = make_logger("deprecated console.error", 99);
6492
+            var __log = make_logger("deprecated console.log", 99);
6493
+            var __info = make_logger("deprecated console.info", 99);
6494
+            // bad ass
6495
+            console["_log"] = console.log;
6496
+            console["_error"] = console.error;
6497
+            console["_warn"] = console.warn;
6498
+            console["_info"] = console.info;
6499
+            /*
6500
+            console["log"] = _log_all(__log, 0);
6501
+            console["error"] = _log_all(__error, 2);
6502
+            console["warn"] = _log_all(__warn, 2);
6503
+            console["info"] = _log_all(__info, 0);
6504
+             */
6505
+        }
6506
+        /*
6507
+        {
6508
+            make_logger["send_log"] = function(){
6509
+                eml_log(
6510
+                    function () {
6511
+                        alert("fehlerbericht wurde gesendet!");
6512
+                    }
6513
+                );
6514
+            };
6515
+            var error_log = make_logger("global.error", 99);
6516
+            window.onerror = _log_all(
6517
+                error_log,
6518
+                1,
6519
+                function(){
6520
+                    if (global_config == undefined) {
6521
+                        return false;
6522
+                    }
6523
+                    if (global_config.report_error) {
6524
+                        make_logger["send_log"]();
6525
+                    }
6526
+                }
6527
+            );
6528
+        }
6529
+         */
6530
+    }
6531
+    return make_logger;
6532
+})();
6533
+/*
6534
+This file is part of »bacterio-plankton:call«.
6535
+
6536
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
6537
+<info@greenscale.de>
6538
+
6539
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
6540
+it under the terms of the GNU Lesser General Public License as published by
6541
+the Free Software Foundation, either version 3 of the License, or
6542
+(at your option) any later version.
6543
+
6544
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
6545
+but WITHOUT ANY WARRANTY; without even the implied warranty of
6546
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6547
+GNU Lesser General Public License for more details.
6548
+
6549
+You should have received a copy of the GNU Lesser General Public License
6550
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
6551
+ */
6552
+"use strict";
6553
+/*
6554
+This file is part of »bacterio-plankton:call«.
6555
+
6556
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
6557
+<info@greenscale.de>
6558
+
6559
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
6560
+it under the terms of the GNU Lesser General Public License as published by
6561
+the Free Software Foundation, either version 3 of the License, or
6562
+(at your option) any later version.
6563
+
6564
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
6565
+but WITHOUT ANY WARRANTY; without even the implied warranty of
6566
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6567
+GNU Lesser General Public License for more details.
6568
+
6569
+You should have received a copy of the GNU Lesser General Public License
6570
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
6571
+ */
6572
+var lib_call;
6573
+(function (lib_call) {
6574
+    /**
6575
+     * @desc hacked class for postfix function application
6576
+     * @author fenris
6577
+     */
6578
+    class class_valuewrapper {
6579
+        /**
6580
+         * @desc [constructor]
6581
+         * @author fenris
6582
+         */
6583
+        constructor(value) {
6584
+            this.value = value;
6585
+        }
6586
+        /**
6587
+         * @desc [accessor] applies a function and returns a new valuewrapper
6588
+         * @author fenris
6589
+         */
6590
+        pass(function_) {
6591
+            return (new class_valuewrapper(function_(this.value)));
6592
+        }
6593
+        /**
6594
+         * @desc [accessor] gives the wrapped value
6595
+         * @author fenris
6596
+         */
6597
+        extract() {
6598
+            return this.value;
6599
+        }
6600
+    }
6601
+    lib_call.class_valuewrapper = class_valuewrapper;
6602
+    /**
6603
+     * @desc shortcut for constructing a valuewrapper-object
6604
+     * @author fenris
6605
+     */
6606
+    function vw(value) {
6607
+        return (new class_valuewrapper(value));
6608
+    }
6609
+    lib_call.vw = vw;
6610
+    /**
6611
+     * @author fenris
6612
+     */
6613
+    function use(input, function_) {
6614
+        return function_(input);
6615
+    }
6616
+    lib_call.use = use;
6617
+    /**
6618
+     * @desc just the identity; useful for some callbacks etc.
6619
+     * @author fenris
6620
+     */
6621
+    function id(x) {
6622
+        return x;
6623
+    }
6624
+    lib_call.id = id;
6625
+    /**
6626
+     * @desc composes two functions (i.e. returns a function that return the result of the successive execution of both input-functions)
6627
+     * @param {function} function_f
6628
+     * @param {function} function_g
6629
+     * @author fenris
6630
+     */
6631
+    function compose(function_f, function_g) {
6632
+        return (function (x) {
6633
+            // return function_g(function_f(x));
6634
+            return function_g(function_f.apply(function_f, lib_call.args2list(arguments)));
6635
+        });
6636
+    }
6637
+    lib_call.compose = compose;
6638
+    /**
6639
+     * @desc transforms a function with sequential input into a function with leveled input; example: add(2,3) = curryfy(add)(2)(3)
6640
+     * @param {function} f
6641
+     * @param {int} n (don't set manually)
6642
+     * @return {function} the currified version of the in put function
6643
+     * @author fenris
6644
+     */
6645
+    function curryfy(f, n = f.length) {
6646
+        switch (n) {
6647
+            case 0: {
6648
+                throw (new Error("[curryfy] impossible"));
6649
+                // break;
6650
+            }
6651
+            case 1: {
6652
+                return f;
6653
+                // break;
6654
+            }
6655
+            default: {
6656
+                return (function (x) {
6657
+                    return (curryfy(function () { return f.apply(f, [x].concat(lib_call.args2list(arguments))); }, n - 1));
6658
+                });
6659
+                // break;
6660
+            }
6661
+        }
6662
+    }
6663
+    lib_call.curryfy = curryfy;
6664
+})(lib_call || (lib_call = {}));
6665
+var lib_call;
6666
+(function (lib_call) {
6667
+    /**
6668
+     * @author fenris
6669
+     */
6670
+    function executor_resolve(result) {
6671
+        return ((resolve, reject) => resolve(result));
6672
+    }
6673
+    lib_call.executor_resolve = executor_resolve;
6674
+    /**
6675
+     * @author fenris
6676
+     */
6677
+    function executor_reject(reason) {
6678
+        return ((resolve, reject) => reject(reason));
6679
+    }
6680
+    lib_call.executor_reject = executor_reject;
6681
+    /**
6682
+     * @author fenris
6683
+     */
6684
+    function executor_transform(executor, transform_result, transform_reason) {
6685
+        return ((resolve, reject) => {
6686
+            executor(result => resolve(transform_result(result)), reason => reject(transform_reason(reason)));
6687
+        });
6688
+    }
6689
+    lib_call.executor_transform = executor_transform;
6690
+    /**
6691
+     * @author fenris
6692
+     */
6693
+    function executor_transform_default(executor, transform_result, wrap_string = null) {
6694
+        let transform_reason = (error => ((wrap_string == null) ? error : new class_error(wrap_string, [error])));
6695
+        return (executor_transform(executor, transform_result, transform_reason));
6696
+    }
6697
+    lib_call.executor_transform_default = executor_transform_default;
6698
+    /**
6699
+     * @author fenris
6700
+     */
6701
+    function executor_compose_sequential(first, second) {
6702
+        return ((resolve, reject) => {
6703
+            first(result => {
6704
+                second(result)(resolve, reject);
6705
+            }, reason => {
6706
+                reject(reason);
6707
+            });
6708
+        });
6709
+    }
6710
+    lib_call.executor_compose_sequential = executor_compose_sequential;
6711
+    /**
6712
+     * @author fenris
6713
+     */
6714
+    function executor_chain(state, executors) {
6715
+        return ((resolve, reject) => {
6716
+            if (executors.length == 0) {
6717
+                return resolve(state);
6718
+            }
6719
+            else {
6720
+                return executors[0](state)(result => {
6721
+                    executor_chain(result, executors.slice(1))(resolve, reject);
6722
+                }, reject);
6723
+            }
6724
+        });
6725
+        /*
6726
+         */
6727
+        /*
6728
+        if (executors.length == 0) {
6729
+            return executor_resolve<type_state, type_error>(state);
6730
+        }
6731
+        else if (executors.length == 1) {
6732
+            return executors[0](state);
6733
+        }
6734
+        else {
6735
+            return (
6736
+                executor_chain<type_state, type_error>(
6737
+                    state,
6738
+                    [
6739
+                        state => (resolve, reject) => executors[0](state)(result => executors[1](result)(resolve, reject), reject)
6740
+                    ].concat(executors.slice(2))
6741
+                )
6742
+            );
6743
+        }
6744
+         */
6745
+        /*
6746
+        return (
6747
+            executors.reduce(
6748
+                (chain, current) => executor_compose_sequential<type_state, type_state, type_error>(chain, current, deferred),
6749
+                executor_resolve<type_state, type_error>(state)
6750
+            )
6751
+        );
6752
+         */
6753
+    }
6754
+    lib_call.executor_chain = executor_chain;
6755
+    /**
6756
+     * @author fenris
6757
+     */
6758
+    function executor_first(executors) {
6759
+        /*
6760
+        return (
6761
+            (resolve, reject) => {
6762
+                if (executors.length == 0) {
6763
+                    reject(new Error("all failed"));
6764
+                }
6765
+                else {
6766
+                    executors[0](
6767
+                        result => {
6768
+                            resolve(result);
6769
+                        },
6770
+                        reason => {
6771
+                            executor_first<type_result, type_reason>(executors.slice(1))(resolve, reject);
6772
+                        }
6773
+                    )
6774
+                }
6775
+            }
6776
+        );
6777
+         */
6778
+        return ((resolve, reject) => {
6779
+            executor_chain([], executors.map(executor => reasons => (resolve_, reject_) => {
6780
+                executor(result => reject_(result), reason => resolve_(reasons.concat([reason])));
6781
+            }))(errors => reject(errors), result => resolve(result));
6782
+        });
6783
+    }
6784
+    lib_call.executor_first = executor_first;
6785
+    /**
6786
+     * @author fenris
6787
+     */
6788
+    function executor_condense(executors) {
6789
+        return (executor_chain([], executors.map(executor => result => (resolve, reject) => {
6790
+            executor(element => resolve(result.concat([element])), reject);
6791
+        })));
6792
+    }
6793
+    lib_call.executor_condense = executor_condense;
6794
+    /**
6795
+     * @author fenris
6796
+     * @deprecated use condense
6797
+     */
6798
+    function executor_filter(executors, predicate) {
6799
+        return (executor_chain([], executors.map(executor => result => (resolve, reject) => {
6800
+            executor(element => resolve(predicate(element) ? result.concat([element]) : result), reject);
6801
+        })));
6802
+    }
6803
+    lib_call.executor_filter = executor_filter;
6804
+    /**
6805
+     * @author fenris
6806
+     * @deprecated use condense
6807
+     */
6808
+    function executor_map(executors, transformator) {
6809
+        return (executor_chain([], executors.map(executor => result => (resolve, reject) => {
6810
+            executor(element1 => resolve(result.concat([transformator(element1)])), reject);
6811
+        })));
6812
+    }
6813
+    lib_call.executor_map = executor_map;
6814
+    /**
6815
+     * @author fenris
6816
+     * @deprecated use condense
6817
+     */
6818
+    function executor_reduce(executors, initial, accumulator) {
6819
+        return (executor_chain(initial, executors.map(executor => result => (resolve, reject) => {
6820
+            executor(element => resolve(accumulator(result, element)), reject);
6821
+        })));
6822
+    }
6823
+    lib_call.executor_reduce = executor_reduce;
6824
+})(lib_call || (lib_call = {}));
6825
+/*
6826
+This file is part of »bacterio-plankton:call«.
6827
+
6828
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
6829
+<info@greenscale.de>
6830
+
6831
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
6832
+it under the terms of the GNU Lesser General Public License as published by
6833
+the Free Software Foundation, either version 3 of the License, or
6834
+(at your option) any later version.
6835
+
6836
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
6837
+but WITHOUT ANY WARRANTY; without even the implied warranty of
6838
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6839
+GNU Lesser General Public License for more details.
6840
+
6841
+You should have received a copy of the GNU Lesser General Public License
6842
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
6843
+ */
6844
+var lib_call;
6845
+(function (lib_call) {
6846
+    /**
6847
+     * @author fenris
6848
+     */
6849
+    function promise_reject(reason) {
6850
+        return Promise.reject(reason);
6851
+    }
6852
+    lib_call.promise_reject = promise_reject;
6853
+    /**
6854
+     * @author fenris
6855
+     */
6856
+    function promise_resolve(result) {
6857
+        return Promise.resolve(result);
6858
+    }
6859
+    lib_call.promise_resolve = promise_resolve;
6860
+    /**
6861
+     * @author fenris
6862
+     */
6863
+    function promise_make(executor) {
6864
+        return (new Promise(executor));
6865
+    }
6866
+    lib_call.promise_make = promise_make;
6867
+    /**
6868
+     * @author fenris
6869
+     */
6870
+    function promise_then_close(promise, resolver, rejector) {
6871
+        promise.then(resolver, rejector);
6872
+    }
6873
+    lib_call.promise_then_close = promise_then_close;
6874
+    /**
6875
+     * @author fenris
6876
+     */
6877
+    function promise_then_append(promise, resolver, rejector = null) {
6878
+        if (rejector == null) {
6879
+            rejector = (reason) => promise_reject(reason);
6880
+        }
6881
+        return (promise.then(resolver, rejector));
6882
+    }
6883
+    lib_call.promise_then_append = promise_then_append;
6884
+    /**
6885
+     * @author fenris
6886
+     */
6887
+    function promise_all(promises) {
6888
+        return Promise.all(promises);
6889
+    }
6890
+    lib_call.promise_all = promise_all;
6891
+    /**
6892
+     * @author fenris
6893
+     */
6894
+    function promise_chain(promises, start = undefined) {
6895
+        return (promises.reduce((chain, promise) => promise_then_append(chain, promise), promise_resolve(start)));
6896
+    }
6897
+    lib_call.promise_chain = promise_chain;
6898
+    /**
6899
+     * @author fenris
6900
+     */
6901
+    function promise_condense(promises) {
6902
+        return (promise_chain(promises.map(promise => result => promise_then_append(promise(), element => promise_resolve(result.concat([element])))), []));
6903
+    }
6904
+    lib_call.promise_condense = promise_condense;
6905
+    /**
6906
+     * @author fenris
6907
+     */
6908
+    function promise_group(promises, serial = false) {
6909
+        const decorate = function (promise, name) {
6910
+            return (() => promise_then_append(promise(), value => promise_resolve({ "key": name, "value": value })));
6911
+        };
6912
+        const convert = function (array) {
6913
+            let object = {};
6914
+            array.forEach(({ "key": key, "value": value }) => { object[key] = value; });
6915
+            return object;
6916
+        };
6917
+        if (serial) {
6918
+            return (promise_then_append(promise_condense(Object.keys(promises)
6919
+                .map(name => decorate(promises[name], name))), list => promise_resolve(convert(list))));
6920
+        }
6921
+        else {
6922
+            return (promise_then_append(promise_all(Object.keys(promises)
6923
+                .map(name => decorate(promises[name], name))
6924
+                .map(promise => promise())), list => promise_resolve(convert(list))));
6925
+        }
6926
+    }
6927
+    lib_call.promise_group = promise_group;
6928
+    /**
6929
+     * @author fenris
6930
+     */
6931
+    function promise_wrap(promise, transformator_result, transformator_reason = lib_call.id) {
6932
+        return (promise_make((resolve, reject) => {
6933
+            promise_then_close(promise, result => resolve(transformator_result(result)), reason => reject(transformator_reason(reason)));
6934
+        }));
6935
+    }
6936
+    lib_call.promise_wrap = promise_wrap;
6937
+    /**
6938
+     * @author fenris
6939
+     */
6940
+    function promise_show(label) {
6941
+        return (result => promise_make((resolve, reject) => {
6942
+            lib_log.info(label + ": " + instance_show(result));
6943
+            resolve(result);
6944
+        }));
6945
+    }
6946
+    lib_call.promise_show = promise_show;
6947
+    /**
6948
+     * @author fenris
6949
+     */
6950
+    function promise_log(result) {
6951
+        return promise_show("log");
6952
+    }
6953
+    lib_call.promise_log = promise_log;
6954
+    /**
6955
+     * @author fenris
6956
+     */
6957
+    function promise_attach(state, promise, name) {
6958
+        return (promise_wrap(promise, result => {
6959
+            state[name] = result;
6960
+            return state;
6961
+        }));
6962
+    }
6963
+    lib_call.promise_attach = promise_attach;
6964
+    /**
6965
+     * @author fenris
6966
+     */
6967
+    function promise_delay(promise, delay) {
6968
+        return promise_make((resolve, reject) => {
6969
+            lib_call.timeout(() => {
6970
+                promise_then_close(promise, resolve, reject);
6971
+                return null;
6972
+            }, delay);
6973
+        });
6974
+    }
6975
+    lib_call.promise_delay = promise_delay;
6976
+    /**
6977
+     * @author fenris
6978
+     */
6979
+    function promise_to_executor(promise) {
6980
+        return ((resolve, reject) => promise.then(resolve, reject));
6981
+    }
6982
+    lib_call.promise_to_executor = promise_to_executor;
6983
+})(lib_call || (lib_call = {}));
6984
+/*
6985
+This file is part of »bacterio-plankton:call«.
6986
+
6987
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
6988
+<info@greenscale.de>
6989
+
6990
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
6991
+it under the terms of the GNU Lesser General Public License as published by
6992
+the Free Software Foundation, either version 3 of the License, or
6993
+(at your option) any later version.
6994
+
6995
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
6996
+but WITHOUT ANY WARRANTY; without even the implied warranty of
6997
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6998
+GNU Lesser General Public License for more details.
6999
+
7000
+You should have received a copy of the GNU Lesser General Public License
7001
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
7002
+ */
7003
+var lib_call;
7004
+(function (lib_call) {
7005
+    lib_call.initializer_state_initial = 0;
7006
+    lib_call.initializer_state_waiting = 1;
7007
+    lib_call.initializer_state_successful = 2;
7008
+    lib_call.initializer_state_failed = 3;
7009
+    /**
7010
+     * @author fenris
7011
+     */
7012
+    function initializer_make(fetcher) {
7013
+        let subject = {
7014
+            "fetcher": fetcher,
7015
+            "state": lib_call.initializer_state_initial,
7016
+            "queue": [],
7017
+            "result": undefined,
7018
+            "reason": undefined,
7019
+        };
7020
+        return subject;
7021
+    }
7022
+    lib_call.initializer_make = initializer_make;
7023
+    /**
7024
+     * @author fenris
7025
+     */
7026
+    function initializer_actuate(subject) {
7027
+        switch (subject.state) {
7028
+            case lib_call.initializer_state_successful: {
7029
+                subject.queue.forEach(entry => entry.resolve(subject.result));
7030
+                break;
7031
+            }
7032
+            case lib_call.initializer_state_failed: {
7033
+                subject.queue.forEach(entry => entry.reject(subject.reason));
7034
+                break;
7035
+            }
7036
+            default: {
7037
+                let message = `unhandled state ${subject.state}`;
7038
+                throw (new Error(message));
7039
+                break;
7040
+            }
7041
+        }
7042
+    }
7043
+    /**
7044
+     * @author fenris
7045
+     */
7046
+    function initializer_reset(subject) {
7047
+        subject.state = lib_call.initializer_state_initial;
7048
+        subject.queue = [];
7049
+    }
7050
+    lib_call.initializer_reset = initializer_reset;
7051
+    /**
7052
+     * @author fenris
7053
+     */
7054
+    function initializer_state(subject) {
7055
+        return subject.state;
7056
+    }
7057
+    lib_call.initializer_state = initializer_state;
7058
+    /**
7059
+     * @author fenris
7060
+     */
7061
+    function initializer_get(subject) {
7062
+        switch (subject.state) {
7063
+            case lib_call.initializer_state_initial: {
7064
+                subject.state = lib_call.initializer_state_waiting;
7065
+                return (lib_call.promise_make((resolve, reject) => {
7066
+                    subject.queue.push({ "resolve": resolve, "reject": reject });
7067
+                    subject.fetcher().then(result => {
7068
+                        subject.state = lib_call.initializer_state_successful;
7069
+                        subject.result = result;
7070
+                        initializer_actuate(subject);
7071
+                    }, reason => {
7072
+                        subject.state = lib_call.initializer_state_failed;
7073
+                        subject.reason = reason;
7074
+                        initializer_actuate(subject);
7075
+                    });
7076
+                }));
7077
+                break;
7078
+            }
7079
+            case lib_call.initializer_state_waiting: {
7080
+                return (lib_call.promise_make((resolve, reject) => {
7081
+                    subject.queue.push({ "resolve": resolve, "reject": reject });
7082
+                }));
7083
+                break;
7084
+            }
7085
+            case lib_call.initializer_state_successful: {
7086
+                return (lib_call.promise_resolve(subject.result));
7087
+                break;
7088
+            }
7089
+            case lib_call.initializer_state_failed: {
7090
+                return (lib_call.promise_reject(subject.reason));
7091
+                break;
7092
+            }
7093
+            default: {
7094
+                let message = `unhandled state ${subject.state}`;
7095
+                throw (new Error(message));
7096
+                break;
7097
+            }
7098
+        }
7099
+    }
7100
+    lib_call.initializer_get = initializer_get;
7101
+    /**
7102
+     * @author fenris
7103
+     */
7104
+    function initializer_get_sync(subject) {
7105
+        switch (subject.state) {
7106
+            case lib_call.initializer_state_successful: {
7107
+                return subject.result;
7108
+                break;
7109
+            }
7110
+            case lib_call.initializer_state_failed: {
7111
+                throw subject.reason;
7112
+                break;
7113
+            }
7114
+            default: {
7115
+                let message = `unhandled state ${subject.state}`;
7116
+                throw (new Error(message));
7117
+                break;
7118
+            }
7119
+        }
7120
+    }
7121
+    /**
7122
+     * @author fenris
7123
+     */
7124
+    function initializer_set_sync(subject, result) {
7125
+        switch (subject.state) {
7126
+            case lib_call.initializer_state_successful: {
7127
+                subject.result = result;
7128
+                break;
7129
+            }
7130
+            case lib_call.initializer_state_failed: {
7131
+                subject.state = lib_call.initializer_state_successful;
7132
+                subject.result = result;
7133
+                break;
7134
+            }
7135
+            default: {
7136
+                let message = `unhandled state ${subject.state}`;
7137
+                throw (new Error(message));
7138
+                break;
7139
+            }
7140
+        }
7141
+    }
7142
+})(lib_call || (lib_call = {}));
7143
+/*
7144
+This file is part of »bacterio-plankton:call«.
7145
+
7146
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
7147
+<info@greenscale.de>
7148
+
7149
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
7150
+it under the terms of the GNU Lesser General Public License as published by
7151
+the Free Software Foundation, either version 3 of the License, or
7152
+(at your option) any later version.
7153
+
7154
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
7155
+but WITHOUT ANY WARRANTY; without even the implied warranty of
7156
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7157
+GNU Lesser General Public License for more details.
7158
+
7159
+You should have received a copy of the GNU Lesser General Public License
7160
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
7161
+ */
7162
+var lib_call;
7163
+(function (lib_call) {
7164
+    /*
7165
+        The core idea of this library is to provide means for asynchronous program flow. The old-school way to do is,
7166
+        is to use callbacks. While this approach is simple and easy to understand, it has some disadvantages. As an
7167
+        attempt to relief and improve this, the promise-system was introduced. In principle it solves most of the
7168
+        problems found in the callback-approach; however it has some downsides as well:
7169
+            
7170
+        - Convolution of multiple principles
7171
+            Promises unite the ideas of asynchronous program flow and error handling.
7172
+        
7173
+        - Instant execution
7174
+            Creating a promise results in the instant execution of the given executor prodecure. While this might be
7175
+            convenient in some cases, it can be quite disturbing and counter-intuitive in others.
7176
+        
7177
+        - Broken typing
7178
+            The Promise system doesn't distinguish between an appending "then" (i.e. passing a function, which returns a
7179
+            new promise) and a closing "then" (i.e. passing a function, which has no return value). On top of that it
7180
+            allows returning simple values in an appending "then", which results in an implicit call of the executors
7181
+            "resolve"-function. The price for these "pragmatic" features is that the whole system can't be typed well.
7182
+            And even though JavaScript is not a strictly typed language, it was a quite questionable decision to design
7183
+            the promise system in a way, which breaks typing from the start.
7184
+        
7185
+        The deferral-system forseeks to solve these issues while retaining the advantages of the promise-system.
7186
+     */
7187
+    /**
7188
+     * @author fenris
7189
+     * @desc activates the deferral and handles its output according to a given procedure
7190
+     * @param {(value : type_value)=>void} procedure a function which receives the output of the deferral as argument
7191
+     */
7192
+    function deferral_use(deferral, input, procedure) {
7193
+        deferral.representation(input).then(value => {
7194
+            procedure(value);
7195
+        }, reason => {
7196
+            throw reason;
7197
+        });
7198
+    }
7199
+    lib_call.deferral_use = deferral_use;
7200
+    /**
7201
+     * @author fenris
7202
+     * @desc creates a deferral-subject (similar to "new Promise", where "convey" reflects "resolve"/"reject")
7203
+     */
7204
+    function deferral_make(handler) {
7205
+        return ({
7206
+            "representation": ((input) => (new Promise((resolve, reject) => {
7207
+                handler(input, resolve);
7208
+            })))
7209
+        });
7210
+    }
7211
+    lib_call.deferral_make = deferral_make;
7212
+    /**
7213
+     * @author fenris
7214
+     * @desc wraps a simple function into a deferral (similar to "Promise.resolve"/"Promise.reject")
7215
+     */
7216
+    function deferral_wrap(function_) {
7217
+        return (deferral_make((input, convey) => convey(function_(input))));
7218
+    }
7219
+    lib_call.deferral_wrap = deferral_wrap;
7220
+    /**
7221
+     * @author fenris
7222
+     */
7223
+    function deferral_id() {
7224
+        return (deferral_make((input, convey) => convey(input)));
7225
+    }
7226
+    lib_call.deferral_id = deferral_id;
7227
+    /**
7228
+     * @author fenris
7229
+     */
7230
+    function deferral_const(value) {
7231
+        return (deferral_make((input, convey) => convey(value)));
7232
+    }
7233
+    lib_call.deferral_const = deferral_const;
7234
+    /**
7235
+     * @author fenris
7236
+     */
7237
+    function deferral_delay(output, delay) {
7238
+        return (deferral_make((input, convey) => {
7239
+            setTimeout(() => convey(output), delay);
7240
+        }));
7241
+    }
7242
+    lib_call.deferral_delay = deferral_delay;
7243
+    /**
7244
+     * @author fenris
7245
+     * @desc connects two deferrals to form a new one; the output of the first is taken as input for the second
7246
+     *     (similar to "Promise.then" when passing a function which returns a new promise)
7247
+     * @param {type_deferral<type_value1>} first a simple deferral
7248
+     * @param {(value1 : type_value1)=>type_deferral<type_value2>} second a function depending from a value returning a deferral
7249
+     */
7250
+    function deferral_compose_serial(first, second) {
7251
+        return {
7252
+            "representation": ((input) => first.representation(input).then((between) => second.representation(between)))
7253
+        };
7254
+    }
7255
+    lib_call.deferral_compose_serial = deferral_compose_serial;
7256
+    /**
7257
+     * @author fenris
7258
+     */
7259
+    function deferral_compose_parallel({ "left": deferral_left, "right": deferral_right, }) {
7260
+        return (deferral_make((input, convey) => {
7261
+            let object = {
7262
+                "left": lib_maybe.make_nothing(),
7263
+                "right": lib_maybe.make_nothing(),
7264
+            };
7265
+            let finish = function () {
7266
+                if (lib_maybe.is_just(object.left)
7267
+                    &&
7268
+                        lib_maybe.is_just(object.right)) {
7269
+                    let result = {
7270
+                        "left": lib_maybe.cull(object.left),
7271
+                        "right": lib_maybe.cull(object.right),
7272
+                    };
7273
+                    convey(result);
7274
+                }
7275
+                else {
7276
+                    // do nothing
7277
+                }
7278
+            };
7279
+            deferral_use(deferral_left, input, output_left => {
7280
+                object.left = lib_maybe.make_just(output_left);
7281
+                finish();
7282
+            });
7283
+            deferral_use(deferral_right, input, output_right => {
7284
+                object.right = lib_maybe.make_just(output_right);
7285
+                finish();
7286
+            });
7287
+        }));
7288
+    }
7289
+    lib_call.deferral_compose_parallel = deferral_compose_parallel;
7290
+    /**
7291
+     * @author fenris
7292
+     * @desc repeatedly applied serial composition
7293
+     */
7294
+    function deferral_chain(members) {
7295
+        return (members.reduce(
7296
+        // (result, current) => deferral_compose_serial<type_value, type_value, type_value>(result, current),
7297
+        deferral_compose_serial, deferral_id()));
7298
+    }
7299
+    lib_call.deferral_chain = deferral_chain;
7300
+    /**
7301
+     * @author fenris
7302
+     */
7303
+    /*
7304
+    export function deferral_bunch<type_input, type_output>(
7305
+        members : {[name : string] : type_deferral<type_input, type_output>}
7306
+    ) : type_deferral<type_input, {[name : string] : type_output}> {
7307
+        
7308
+    }
7309
+     */
7310
+})(lib_call || (lib_call = {}));
7311
+/*
7312
+This file is part of »bacterio-plankton:call«.
7313
+
7314
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
7315
+<info@greenscale.de>
7316
+
7317
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
7318
+it under the terms of the GNU Lesser General Public License as published by
7319
+the Free Software Foundation, either version 3 of the License, or
7320
+(at your option) any later version.
7321
+
7322
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
7323
+but WITHOUT ANY WARRANTY; without even the implied warranty of
7324
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7325
+GNU Lesser General Public License for more details.
7326
+
7327
+You should have received a copy of the GNU Lesser General Public License
7328
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
7329
+ */
7330
+var lib_call;
7331
+(function (lib_call) {
7332
+    /**
7333
+     * @author fenris
7334
+     */
7335
+    class class_deferral {
7336
+        /**
7337
+         * @author fenris
7338
+         */
7339
+        constructor(subject) {
7340
+            this.subject = subject;
7341
+        }
7342
+        /**
7343
+         * @author fenris
7344
+         */
7345
+        static _cram(subject) {
7346
+            return (new class_deferral(subject));
7347
+        }
7348
+        /**
7349
+         * @author fenris
7350
+         */
7351
+        static _tear(instance) {
7352
+            return instance.subject;
7353
+        }
7354
+        /**
7355
+         * @author fenris
7356
+         */
7357
+        static make(handler) {
7358
+            return (class_deferral._cram(lib_call.deferral_make(handler)));
7359
+        }
7360
+        /**
7361
+         * @author fenris
7362
+         */
7363
+        use(input, procedure) {
7364
+            return (lib_call.deferral_use(class_deferral._tear(this), input, procedure));
7365
+        }
7366
+        /**
7367
+         * @author fenris
7368
+         */
7369
+        compose_serial(second) {
7370
+            return (class_deferral._cram(lib_call.deferral_compose_serial(class_deferral._tear(this), class_deferral._tear(second))));
7371
+        }
7372
+        /**
7373
+         * @author fenris
7374
+         */
7375
+        static chain(members) {
7376
+            return (class_deferral._cram(lib_call.deferral_chain(members.map(member => class_deferral._tear(member)))));
7377
+        }
7378
+        /**
7379
+         * @author fenris
7380
+         */
7381
+        static wrap(function_) {
7382
+            return (class_deferral._cram(lib_call.deferral_wrap(function_)));
7383
+        }
7384
+        /**
7385
+         * @author fenris
7386
+         */
7387
+        static const_(value) {
7388
+            return (class_deferral._cram(lib_call.deferral_const(value)));
7389
+        }
7390
+        /**
7391
+         * @author fenris
7392
+         */
7393
+        static delay(output, delay) {
7394
+            return (class_deferral._cram(lib_call.deferral_delay(output, delay)));
7395
+        }
7396
+    }
7397
+    lib_call.class_deferral = class_deferral;
7398
+})(lib_call || (lib_call = {}));
7399
+/*
7400
+This file is part of »bacterio-plankton:call«.
7401
+
7402
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
7403
+<info@greenscale.de>
7404
+
7405
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
7406
+it under the terms of the GNU Lesser General Public License as published by
7407
+the Free Software Foundation, either version 3 of the License, or
7408
+(at your option) any later version.
7409
+
7410
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
7411
+but WITHOUT ANY WARRANTY; without even the implied warranty of
7412
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7413
+GNU Lesser General Public License for more details.
7414
+
7415
+You should have received a copy of the GNU Lesser General Public License
7416
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
7417
+ */
7418
+var lib_call;
7419
+(function (lib_call) {
7420
+    /**
7421
+     * @author fenris
7422
+     */
7423
+    function timeout(function_, delay) {
7424
+        return (
7425
+        /*window.*/ setTimeout(function_, delay));
7426
+    }
7427
+    lib_call.timeout = timeout;
7428
+    /**
7429
+     * @desc a definition for a value being "defined"
7430
+     * @author neuc
7431
+     */
7432
+    function is_def(obj, null_is_valid = false) {
7433
+        return (!((typeof (obj) === "undefined")
7434
+            ||
7435
+                (!null_is_valid && (obj === null))));
7436
+    }
7437
+    lib_call.is_def = is_def;
7438
+    /**
7439
+     * @desc returns the value if set and, when a type is specified, if the type is correct, if not return default_value
7440
+     * @author neuc
7441
+     */
7442
+    function def_val(value, default_value, type = null, null_is_valid = false) {
7443
+        if (is_def(value, null_is_valid)
7444
+            &&
7445
+                (is_def(type)
7446
+                    ? ((typeof value === type)
7447
+                        ||
7448
+                            ((value === null)
7449
+                                &&
7450
+                                    null_is_valid))
7451
+                    : true)) {
7452
+            return value;
7453
+        }
7454
+        else {
7455
+            return default_value;
7456
+        }
7457
+    }
7458
+    lib_call.def_val = def_val;
7459
+    ;
7460
+    /**
7461
+     * @desc just the empty function; useful for some callbacks etc.
7462
+     * @author fenris
7463
+     */
7464
+    function nothing() {
7465
+    }
7466
+    lib_call.nothing = nothing;
7467
+    /**
7468
+     * @desc outputs
7469
+     * @author fenris
7470
+     */
7471
+    function output(...args) {
7472
+        lib_log.info.apply(lib_log, args);
7473
+    }
7474
+    lib_call.output = output;
7475
+    /**
7476
+     * @desc converts the "arguments"-map into an array
7477
+     * @param {Object} args
7478
+     * @author fenris
7479
+     */
7480
+    function args2list(args) {
7481
+        return Object.keys(args).map(key => args[key]);
7482
+    }
7483
+    lib_call.args2list = args2list;
7484
+    /**
7485
+     * @desc provides the call for an attribute of a class as a regular function
7486
+     * @param {string} name the name of the attribute
7487
+     * @return {*}
7488
+     * @author fenris
7489
+     */
7490
+    function attribute(name) {
7491
+        return ((object) => object[name]);
7492
+    }
7493
+    lib_call.attribute = attribute;
7494
+    /**
7495
+     * @desc provides a method of a class as a regular function
7496
+     * @param {string} name the name of the method
7497
+     * @return {function}
7498
+     * @author fenris
7499
+     */
7500
+    function method(name) {
7501
+        return (function (object) { return object[name].apply(object, args2list(arguments).slice(1)); });
7502
+    }
7503
+    lib_call.method = method;
7504
+    /**
7505
+     * @author fenris
7506
+     */
7507
+    function distinguish(unival, handlers, fallback = null) {
7508
+        if (unival.kind in handlers) {
7509
+            let handler = handlers[unival.kind];
7510
+            return handler(unival.data);
7511
+        }
7512
+        else {
7513
+            let message = ("unhandled kind '" + unival.kind + "'");
7514
+            if (fallback !== null) {
7515
+                console.warn(message);
7516
+                return fallback(unival);
7517
+            }
7518
+            else {
7519
+                throw (new Error(message));
7520
+            }
7521
+        }
7522
+    }
7523
+    lib_call.distinguish = distinguish;
7524
+})(lib_call || (lib_call = {}));
7525
+/*
7526
+This file is part of »bacterio-plankton:comm-client«.
7527
+
7528
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
7529
+<info@greenscale.de>
7530
+
7531
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
7532
+it under the terms of the GNU Lesser General Public License as published by
7533
+the Free Software Foundation, either version 3 of the License, or
7534
+(at your option) any later version.
7535
+
7536
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
7537
+but WITHOUT ANY WARRANTY; without even the implied warranty of
7538
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7539
+GNU Lesser General Public License for more details.
7540
+
7541
+You should have received a copy of the GNU Lesser General Public License
7542
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
7543
+ */
7544
+var lib_comm;
7545
+(function (lib_comm) {
7546
+    /**
7547
+     * @author fenris
7548
+     */
7549
+    lib_trait.define("comm-client", {
7550
+        "state": null,
7551
+        "message_in": null,
7552
+        "message_out": null
7553
+    }, {
7554
+        "setup": {
7555
+            "shape": {
7556
+                "name": "function",
7557
+                "parameters": {
7558
+                    "shape_input": {
7559
+                        "name": "variable",
7560
+                        "parameters": {
7561
+                            "name": "state"
7562
+                        }
7563
+                    },
7564
+                    "shape_output": {
7565
+                        "name": "promise",
7566
+                        "parameters": {
7567
+                            "shape_result": {
7568
+                                "name": "variable",
7569
+                                "parameters": {
7570
+                                    "name": "state"
7571
+                                }
7572
+                            },
7573
+                            "shape_reason": {
7574
+                                "name": "any"
7575
+                            }
7576
+                        }
7577
+                    }
7578
+                }
7579
+            }
7580
+        },
7581
+        "send": {
7582
+            "shape": {
7583
+                "name": "function",
7584
+                "parameters": {
7585
+                    "shape_input": {
7586
+                        "name": "variable",
7587
+                        "parameters": {
7588
+                            "name": "state"
7589
+                        }
7590
+                    },
7591
+                    "shape_output": {
7592
+                        "name": "function",
7593
+                        "parameters": {
7594
+                            "shape_input": {
7595
+                                "name": "variable",
7596
+                                "parameters": {
7597
+                                    "name": "message_out"
7598
+                                }
7599
+                            },
7600
+                            "shape_output": {
7601
+                                "name": "promise",
7602
+                                "parameters": {
7603
+                                    "shape_result": {
7604
+                                        "name": "variable",
7605
+                                        "parameters": {
7606
+                                            "name": "message_in"
7607
+                                        }
7608
+                                    },
7609
+                                    "shape_reason": {
7610
+                                        "name": "any"
7611
+                                    }
7612
+                                }
7613
+                            }
7614
+                        }
7615
+                    }
7616
+                }
7617
+            }
7618
+        }
7619
+    });
7620
+})(lib_comm || (lib_comm = {}));
7621
+/*
7622
+This file is part of »bacterio-plankton:comm-client«.
7623
+
7624
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
7625
+<info@greenscale.de>
7626
+
7627
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
7628
+it under the terms of the GNU Lesser General Public License as published by
7629
+the Free Software Foundation, either version 3 of the License, or
7630
+(at your option) any later version.
7631
+
7632
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
7633
+but WITHOUT ANY WARRANTY; without even the implied warranty of
7634
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7635
+GNU Lesser General Public License for more details.
7636
+
7637
+You should have received a copy of the GNU Lesser General Public License
7638
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
7639
+ */
7640
+/*
7641
+This file is part of »bacterio-plankton:comm-client«.
7642
+
7643
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
7644
+<info@greenscale.de>
7645
+
7646
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
7647
+it under the terms of the GNU Lesser General Public License as published by
7648
+the Free Software Foundation, either version 3 of the License, or
7649
+(at your option) any later version.
7650
+
7651
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
7652
+but WITHOUT ANY WARRANTY; without even the implied warranty of
7653
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7654
+GNU Lesser General Public License for more details.
7655
+
7656
+You should have received a copy of the GNU Lesser General Public License
7657
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
7658
+ */
7659
+var lib_comm;
7660
+(function (lib_comm) {
7661
+    /**
7662
+     * @author fenris
7663
+     */
7664
+    lib_comm.default_parameters_client_http = {
7665
+        "protocol": "http",
7666
+        "host": null,
7667
+        "port": null,
7668
+        "path": null,
7669
+        "omit_protocol": false,
7670
+        "content_type": "plain/text; charset=utf-8",
7671
+        "with_credentials": false,
7672
+    };
7673
+})(lib_comm || (lib_comm = {}));
7674
+/*
7675
+This file is part of »bacterio-plankton:comm-client«.
7676
+
7677
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
7678
+<info@greenscale.de>
7679
+
7680
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
7681
+it under the terms of the GNU Lesser General Public License as published by
7682
+the Free Software Foundation, either version 3 of the License, or
7683
+(at your option) any later version.
7684
+
7685
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
7686
+but WITHOUT ANY WARRANTY; without even the implied warranty of
7687
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7688
+GNU Lesser General Public License for more details.
7689
+
7690
+You should have received a copy of the GNU Lesser General Public License
7691
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
7692
+ */
7693
+var lib_comm;
7694
+(function (lib_comm) {
7695
+    /**
7696
+     * @author fenris
7697
+     */
7698
+    function client_http_construct(parameters = {}, method = "POST", headers = {}) {
7699
+        return {
7700
+            "parameters": lib_object.patched(lib_comm.default_parameters_client_http, parameters),
7701
+            "method": method.toLowerCase(),
7702
+            "headers": headers,
7703
+        };
7704
+    }
7705
+    lib_comm.client_http_construct = client_http_construct;
7706
+    /**
7707
+     * @author fenris
7708
+     */
7709
+    function client_http_setup(subject) {
7710
+        return (lib_call.promise_resolve(undefined));
7711
+    }
7712
+    lib_comm.client_http_setup = client_http_setup;
7713
+    /**
7714
+     * @author fenris
7715
+     */
7716
+    function client_http_send(subject, message) {
7717
+        return (lib_call.promise_make((resolve, reject) => {
7718
+            if ((subject.method === "get") && (message !== null)) {
7719
+                let message_ = "can not send data via GET";
7720
+                reject(new Error(message_));
7721
+            }
7722
+            else {
7723
+                let request = new XMLHttpRequest();
7724
+                let url = lib_string.make_url({
7725
+                    "protocol": (subject.parameters.omit_protocol ? null : subject.parameters.protocol),
7726
+                    "host": subject.parameters.host,
7727
+                    "port": subject.parameters.port,
7728
+                    "path": subject.parameters.path,
7729
+                });
7730
+                request.open(subject.method.toUpperCase(), url, true);
7731
+                lib_object.to_array(subject.headers).forEach(({ "key": key, "value": value }) => {
7732
+                    request.setRequestHeader(key, value);
7733
+                });
7734
+                request.setRequestHeader("Content-Type", subject.parameters.content_type);
7735
+                if (subject.parameters.with_credentials) {
7736
+                    request.withCredentials = true;
7737
+                }
7738
+                /*
7739
+                request.onerror = () => {
7740
+                    debugger;
7741
+                    reject(new Error("unhandled error"));
7742
+                };
7743
+                 */
7744
+                request.onreadystatechange = () => {
7745
+                    switch (request.readyState) {
7746
+                        case XMLHttpRequest.DONE: {
7747
+                            switch (request.status) {
7748
+                                case 0: {
7749
+                                    reject(new Error("XMLHttpRequest failed"));
7750
+                                    break;
7751
+                                }
7752
+                                default: {
7753
+                                    let answer = { "code": request.status, "text": request.responseText };
7754
+                                    resolve(answer);
7755
+                                    break;
7756
+                                }
7757
+                            }
7758
+                            break;
7759
+                        }
7760
+                        default: {
7761
+                            // console.warn(`unhandled readyState ${request.readyState}`);
7762
+                            break;
7763
+                        }
7764
+                    }
7765
+                };
7766
+                request.send(message);
7767
+            }
7768
+        }));
7769
+    }
7770
+    lib_comm.client_http_send = client_http_send;
7771
+    /**
7772
+     * @author Martin Springwald <springwald@greenscale.de>
7773
+     * @author Christian Neubauer <neubauer@greenscale.de>
7774
+     * @author Christian Fraß <frass@greenscale.de>
7775
+     */
7776
+    function http_get_blob({ "url": url, "mime": type }) {
7777
+        let request = new XMLHttpRequest();
7778
+        return new Promise((resolve, reject) => {
7779
+            request.open("GET", url, true);
7780
+            request.responseType = "arraybuffer";
7781
+            request.onload = function () {
7782
+                if (request.status === 200) {
7783
+                    resolve(new Blob([request.response], { "type": type }));
7784
+                }
7785
+                else {
7786
+                    reject(new Error("error on blob-load"));
7787
+                }
7788
+            };
7789
+            request.onerror = function () {
7790
+                reject(undefined);
7791
+            };
7792
+            request.send();
7793
+        });
7794
+    }
7795
+    lib_comm.http_get_blob = http_get_blob;
7796
+})(lib_comm || (lib_comm = {}));
7797
+/*
7798
+This file is part of »bacterio-plankton:comm-client«.
7799
+
7800
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
7801
+<info@greenscale.de>
7802
+
7803
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
7804
+it under the terms of the GNU Lesser General Public License as published by
7805
+the Free Software Foundation, either version 3 of the License, or
7806
+(at your option) any later version.
7807
+
7808
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
7809
+but WITHOUT ANY WARRANTY; without even the implied warranty of
7810
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7811
+GNU Lesser General Public License for more details.
7812
+
7813
+You should have received a copy of the GNU Lesser General Public License
7814
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
7815
+ */
7816
+var lib_comm;
7817
+(function (lib_comm) {
7818
+    /**
7819
+     * @author fenris
7820
+     */
7821
+    lib_trait.attend("comm-client", "http", {
7822
+        "state": {
7823
+            "name": "any"
7824
+        },
7825
+        "message_in": {
7826
+            "name": "string"
7827
+        },
7828
+        "message_out": {
7829
+            "name": "any" // type_response_http
7830
+        }
7831
+    }, {
7832
+        "setup": () => (state) => {
7833
+            return lib_comm.client_http_setup(state).then(_ => lib_call.promise_resolve(state));
7834
+        },
7835
+        "send": () => (state) => (message) => {
7836
+            return lib_comm.client_http_send(state, message);
7837
+        }
7838
+    });
7839
+})(lib_comm || (lib_comm = {}));
7840
+/*
7841
+This file is part of »bacterio-plankton:comm-client«.
7842
+
7843
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
7844
+<info@greenscale.de>
7845
+
7846
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
7847
+it under the terms of the GNU Lesser General Public License as published by
7848
+the Free Software Foundation, either version 3 of the License, or
7849
+(at your option) any later version.
7850
+
7851
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
7852
+but WITHOUT ANY WARRANTY; without even the implied warranty of
7853
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7854
+GNU Lesser General Public License for more details.
7855
+
7856
+You should have received a copy of the GNU Lesser General Public License
7857
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
7858
+ */
7859
+var lib_comm;
7860
+(function (lib_comm) {
7861
+    /**
7862
+     * @author fenris
7863
+     */
7864
+    class class_client_http {
7865
+        /**
7866
+         * @author fenris
7867
+         */
7868
+        constructor(parameters = lib_comm.default_parameters_client_http, method = "POST", headers = {}) {
7869
+            this.subject = lib_comm.client_http_construct(parameters, method, headers);
7870
+        }
7871
+        /**
7872
+         * @author fenris
7873
+         * @implementation
7874
+         */
7875
+        setup() {
7876
+            return lib_comm.client_http_setup(this.subject);
7877
+        }
7878
+        /**
7879
+         * @author fenris
7880
+         * @implementation
7881
+         */
7882
+        send(message) {
7883
+            return lib_comm.client_http_send(this.subject, message);
7884
+        }
7885
+    }
7886
+    lib_comm.class_client_http = class_client_http;
7887
+})(lib_comm || (lib_comm = {}));
7888
+/*
7889
+This file is part of »bacterio-plankton:comm-client«.
7890
+
7891
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
7892
+<info@greenscale.de>
7893
+
7894
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
7895
+it under the terms of the GNU Lesser General Public License as published by
7896
+the Free Software Foundation, either version 3 of the License, or
7897
+(at your option) any later version.
7898
+
7899
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
7900
+but WITHOUT ANY WARRANTY; without even the implied warranty of
7901
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7902
+GNU Lesser General Public License for more details.
7903
+
7904
+You should have received a copy of the GNU Lesser General Public License
7905
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
7906
+ */
7907
+var lib_comm;
7908
+(function (lib_comm) {
7909
+    /**
7910
+     * @author fenris
7911
+     */
7912
+    class class_client_mhttp {
7913
+        /**
7914
+         * @author fenris
7915
+         */
7916
+        constructor(parameters = lib_comm.default_parameters_client_http) {
7917
+            this.core = new lib_comm.class_client_http(parameters);
7918
+        }
7919
+        /**
7920
+         * @author fenris
7921
+         * @implementation
7922
+         */
7923
+        setup() {
7924
+            return this.core.setup();
7925
+        }
7926
+        /**
7927
+         * @author fenris
7928
+         * @implementation
7929
+         */
7930
+        send(message) {
7931
+            return (this.core.send(message)
7932
+                .then((answer) => {
7933
+                switch (answer.code) {
7934
+                    case 200: {
7935
+                        return lib_call.promise_resolve(answer.text /*.toString()*/);
7936
+                        break;
7937
+                    }
7938
+                    default: {
7939
+                        return lib_call.promise_reject(new Error(`XMLHttpRequest failed; status was ${answer.code.toFixed(0)}`));
7940
+                        break;
7941
+                    }
7942
+                }
7943
+            }));
7944
+        }
7945
+    }
7946
+    lib_comm.class_client_mhttp = class_client_mhttp;
7947
+})(lib_comm || (lib_comm = {}));
7948
+/*
7949
+This file is part of »bacterio-plankton:comm-client«.
7950
+
7951
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
7952
+<info@greenscale.de>
7953
+
7954
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
7955
+it under the terms of the GNU Lesser General Public License as published by
7956
+the Free Software Foundation, either version 3 of the License, or
7957
+(at your option) any later version.
7958
+
7959
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
7960
+but WITHOUT ANY WARRANTY; without even the implied warranty of
7961
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7962
+GNU Lesser General Public License for more details.
7963
+
7964
+You should have received a copy of the GNU Lesser General Public License
7965
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
7966
+ */
7967
+var lib_comm;
7968
+(function (lib_comm) {
7969
+    /**
7970
+     * @desc wrapper for string-based clients
7971
+     * @author fenris
7972
+     */
7973
+    class class_client_complex {
7974
+        /**
7975
+         * @author fenris
7976
+         */
7977
+        constructor(core, code = new lib_code.class_code_pair(new lib_code.class_code_json(), new lib_code.class_code_uri())) {
7978
+            this.core = core;
7979
+            this.code = code;
7980
+        }
7981
+        /**
7982
+         * @author fenris
7983
+         * @implementation
7984
+         */
7985
+        setup() {
7986
+            return this.core.setup();
7987
+        }
7988
+        /**
7989
+         * @author fenris
7990
+         * @implementation
7991
+         */
7992
+        send(message) {
7993
+            const message_out_raw = this.code.encode(message);
7994
+            return (this.core.send(message_out_raw)
7995
+                .then((message_in_raw) => {
7996
+                const message_in = this.code.decode(message_in_raw);
7997
+                return lib_call.promise_resolve(message_in);
7998
+            }));
7999
+        }
8000
+    }
8001
+    lib_comm.class_client_complex = class_client_complex;
8002
+})(lib_comm || (lib_comm = {}));
8003
+
8004
+async function api_query
8005
+(
8006
+	action_name,
8007
+	input
8008
+)
8009
+{
8010
+	const client = lib_comm.client_http_construct
8011
+	(
8012
+		{
8013
+			"protocol": "http",
8014
+			"host": "localhost",
8015
+			"port": 7777,
8016
+			"path": "/foo/bar",
8017
+		}
8018
+	);
8019
+	const message = JSON.stringify
8020
+	(
8021
+		{
8022
+			"action": action_name,
8023
+			"input": input,
8024
+		}
8025
+	);
8026
+	const answer = await lib_comm.client_http_send(client, message);
8027
+	if (! (answer.code === 200))
8028
+	{
8029
+		return Promise.reject("server side error");
8030
+	}
8031
+	else
8032
+	{
8033
+		const output = JSON.parse(answer.text);
8034
+		return Promise.resolve(output);
8035
+	}
8036
+}
8037
+
8038
+
8039
+/**
8040
+ */
8041
+function main
8042
+(
8043
+)
8044
+{
8045
+	document.querySelector("button").addEventListener
8046
+	(
8047
+		"click",
8048
+		async function ()
8049
+		{
8050
+			const language_from = document.querySelector("select[name=language_from]").value;
8051
+			const language_to = document.querySelector("select[name=language_to]").value;
8052
+			const token = document.querySelector("input[name=token]").value;
8053
+			const result = await api_query
8054
+			(
8055
+				"translate",
8056
+				{
8057
+					"language_from": language_from,
8058
+					"language_to": language_to,
8059
+					"token": token,
8060
+				}
8061
+			);
8062
+			const dom_ul = document.querySelector("#result");
8063
+			dom_ul.textContent = "";
8064
+			for (const entry of result)
8065
+			{
8066
+				let dom_li = document.createElement("li");
8067
+				dom_li.textContent = (`[${entry.language_from}] ${entry.value_from} ~ [${entry.language_to}] ${entry.value_to}`);
8068
+				dom_ul.appendChild(dom_li);
8069
+			}
8070
+		}
8071
+	);
8072
+}
8073
+
8074
+
8075
+document.addEventListener("DOMContentLoaded", function (event) {main();});
8076
+
... ...
@@ -0,0 +1,861 @@
1
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2
+<info@greenscale.de>
3
+
4
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
5
+it under the terms of the GNU Lesser General Public License as published by
6
+the Free Software Foundation, either version 3 of the License, or
7
+(at your option) any later version.
8
+
9
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
10
+but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+GNU Lesser General Public License for more details.
13
+
14
+You should have received a copy of the GNU Lesser General Public License
15
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+
18
+
19
+                    GNU GENERAL PUBLIC LICENSE
20
+                       Version 3, 29 June 2007
21
+
22
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
23
+ Everyone is permitted to copy and distribute verbatim copies
24
+ of this license document, but changing it is not allowed.
25
+
26
+                            Preamble
27
+
28
+  The GNU General Public License is a free, copyleft license for
29
+software and other kinds of works.
30
+
31
+  The licenses for most software and other practical works are designed
32
+to take away your freedom to share and change the works.  By contrast,
33
+the GNU General Public License is intended to guarantee your freedom to
34
+share and change all versions of a program--to make sure it remains free
35
+software for all its users.  We, the Free Software Foundation, use the
36
+GNU General Public License for most of our software; it applies also to
37
+any other work released this way by its authors.  You can apply it to
38
+your programs, too.
39
+
40
+  When we speak of free software, we are referring to freedom, not
41
+price.  Our General Public Licenses are designed to make sure that you
42
+have the freedom to distribute copies of free software (and charge for
43
+them if you wish), that you receive source code or can get it if you
44
+want it, that you can change the software or use pieces of it in new
45
+free programs, and that you know you can do these things.
46
+
47
+  To protect your rights, we need to prevent others from denying you
48
+these rights or asking you to surrender the rights.  Therefore, you have
49
+certain responsibilities if you distribute copies of the software, or if
50
+you modify it: responsibilities to respect the freedom of others.
51
+
52
+  For example, if you distribute copies of such a program, whether
53
+gratis or for a fee, you must pass on to the recipients the same
54
+freedoms that you received.  You must make sure that they, too, receive
55
+or can get the source code.  And you must show them these terms so they
56
+know their rights.
57
+
58
+  Developers that use the GNU GPL protect your rights with two steps:
59
+(1) assert copyright on the software, and (2) offer you this License
60
+giving you legal permission to copy, distribute and/or modify it.
61
+
62
+  For the developers' and authors' protection, the GPL clearly explains
63
+that there is no warranty for this free software.  For both users' and
64
+authors' sake, the GPL requires that modified versions be marked as
65
+changed, so that their problems will not be attributed erroneously to
66
+authors of previous versions.
67
+
68
+  Some devices are designed to deny users access to install or run
69
+modified versions of the software inside them, although the manufacturer
70
+can do so.  This is fundamentally incompatible with the aim of
71
+protecting users' freedom to change the software.  The systematic
72
+pattern of such abuse occurs in the area of products for individuals to
73
+use, which is precisely where it is most unacceptable.  Therefore, we
74
+have designed this version of the GPL to prohibit the practice for those
75
+products.  If such problems arise substantially in other domains, we
76
+stand ready to extend this provision to those domains in future versions
77
+of the GPL, as needed to protect the freedom of users.
78
+
79
+  Finally, every program is threatened constantly by software patents.
80
+States should not allow patents to restrict development and use of
81
+software on general-purpose computers, but in those that do, we wish to
82
+avoid the special danger that patents applied to a free program could
83
+make it effectively proprietary.  To prevent this, the GPL assures that
84
+patents cannot be used to render the program non-free.
85
+
86
+  The precise terms and conditions for copying, distribution and
87
+modification follow.
88
+
89
+                       TERMS AND CONDITIONS
90
+
91
+  0. Definitions.
92
+
93
+  "This License" refers to version 3 of the GNU General Public License.
94
+
95
+  "Copyright" also means copyright-like laws that apply to other kinds of
96
+works, such as semiconductor masks.
97
+
98
+  "The Program" refers to any copyrightable work licensed under this
99
+License.  Each licensee is addressed as "you".  "Licensees" and
100
+"recipients" may be individuals or organizations.
101
+
102
+  To "modify" a work means to copy from or adapt all or part of the work
103
+in a fashion requiring copyright permission, other than the making of an
104
+exact copy.  The resulting work is called a "modified version" of the
105
+earlier work or a work "based on" the earlier work.
106
+
107
+  A "covered work" means either the unmodified Program or a work based
108
+on the Program.
109
+
110
+  To "propagate" a work means to do anything with it that, without
111
+permission, would make you directly or secondarily liable for
112
+infringement under applicable copyright law, except executing it on a
113
+computer or modifying a private copy.  Propagation includes copying,
114
+distribution (with or without modification), making available to the
115
+public, and in some countries other activities as well.
116
+
117
+  To "convey" a work means any kind of propagation that enables other
118
+parties to make or receive copies.  Mere interaction with a user through
119
+a computer network, with no transfer of a copy, is not conveying.
120
+
121
+  An interactive user interface displays "Appropriate Legal Notices"
122
+to the extent that it includes a convenient and prominently visible
123
+feature that (1) displays an appropriate copyright notice, and (2)
124
+tells the user that there is no warranty for the work (except to the
125
+extent that warranties are provided), that licensees may convey the
126
+work under this License, and how to view a copy of this License.  If
127
+the interface presents a list of user commands or options, such as a
128
+menu, a prominent item in the list meets this criterion.
129
+
130
+  1. Source Code.
131
+
132
+  The "source code" for a work means the preferred form of the work
133
+for making modifications to it.  "Object code" means any non-source
134
+form of a work.
135
+
136
+  A "Standard Interface" means an interface that either is an official
137
+standard defined by a recognized standards body, or, in the case of
138
+interfaces specified for a particular programming language, one that
139
+is widely used among developers working in that language.
140
+
141
+  The "System Libraries" of an executable work include anything, other
142
+than the work as a whole, that (a) is included in the normal form of
143
+packaging a Major Component, but which is not part of that Major
144
+Component, and (b) serves only to enable use of the work with that
145
+Major Component, or to implement a Standard Interface for which an
146
+implementation is available to the public in source code form.  A
147
+"Major Component", in this context, means a major essential component
148
+(kernel, window system, and so on) of the specific operating system
149
+(if any) on which the executable work runs, or a compiler used to
150
+produce the work, or an object code interpreter used to run it.
151
+
152
+  The "Corresponding Source" for a work in object code form means all
153
+the source code needed to generate, install, and (for an executable
154
+work) run the object code and to modify the work, including scripts to
155
+control those activities.  However, it does not include the work's
156
+System Libraries, or general-purpose tools or generally available free
157
+programs which are used unmodified in performing those activities but
158
+which are not part of the work.  For example, Corresponding Source
159
+includes interface definition files associated with source files for
160
+the work, and the source code for shared libraries and dynamically
161
+linked subprograms that the work is specifically designed to require,
162
+such as by intimate data communication or control flow between those
163
+subprograms and other parts of the work.
164
+
165
+  The Corresponding Source need not include anything that users
166
+can regenerate automatically from other parts of the Corresponding
167
+Source.
168
+
169
+  The Corresponding Source for a work in source code form is that
170
+same work.
171
+
172
+  2. Basic Permissions.
173
+
174
+  All rights granted under this License are granted for the term of
175
+copyright on the Program, and are irrevocable provided the stated
176
+conditions are met.  This License explicitly affirms your unlimited
177
+permission to run the unmodified Program.  The output from running a
178
+covered work is covered by this License only if the output, given its
179
+content, constitutes a covered work.  This License acknowledges your
180
+rights of fair use or other equivalent, as provided by copyright law.
181
+
182
+  You may make, run and propagate covered works that you do not
183
+convey, without conditions so long as your license otherwise remains
184
+in force.  You may convey covered works to others for the sole purpose
185
+of having them make modifications exclusively for you, or provide you
186
+with facilities for running those works, provided that you comply with
187
+the terms of this License in conveying all material for which you do
188
+not control copyright.  Those thus making or running the covered works
189
+for you must do so exclusively on your behalf, under your direction
190
+and control, on terms that prohibit them from making any copies of
191
+your copyrighted material outside their relationship with you.
192
+
193
+  Conveying under any other circumstances is permitted solely under
194
+the conditions stated below.  Sublicensing is not allowed; section 10
195
+makes it unnecessary.
196
+
197
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
198
+
199
+  No covered work shall be deemed part of an effective technological
200
+measure under any applicable law fulfilling obligations under article
201
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
202
+similar laws prohibiting or restricting circumvention of such
203
+measures.
204
+
205
+  When you convey a covered work, you waive any legal power to forbid
206
+circumvention of technological measures to the extent such circumvention
207
+is effected by exercising rights under this License with respect to
208
+the covered work, and you disclaim any intention to limit operation or
209
+modification of the work as a means of enforcing, against the work's
210
+users, your or third parties' legal rights to forbid circumvention of
211
+technological measures.
212
+
213
+  4. Conveying Verbatim Copies.
214
+
215
+  You may convey verbatim copies of the Program's source code as you
216
+receive it, in any medium, provided that you conspicuously and
217
+appropriately publish on each copy an appropriate copyright notice;
218
+keep intact all notices stating that this License and any
219
+non-permissive terms added in accord with section 7 apply to the code;
220
+keep intact all notices of the absence of any warranty; and give all
221
+recipients a copy of this License along with the Program.
222
+
223
+  You may charge any price or no price for each copy that you convey,
224
+and you may offer support or warranty protection for a fee.
225
+
226
+  5. Conveying Modified Source Versions.
227
+
228
+  You may convey a work based on the Program, or the modifications to
229
+produce it from the Program, in the form of source code under the
230
+terms of section 4, provided that you also meet all of these conditions:
231
+
232
+    a) The work must carry prominent notices stating that you modified
233
+    it, and giving a relevant date.
234
+
235
+    b) The work must carry prominent notices stating that it is
236
+    released under this License and any conditions added under section
237
+    7.  This requirement modifies the requirement in section 4 to
238
+    "keep intact all notices".
239
+
240
+    c) You must license the entire work, as a whole, under this
241
+    License to anyone who comes into possession of a copy.  This
242
+    License will therefore apply, along with any applicable section 7
243
+    additional terms, to the whole of the work, and all its parts,
244
+    regardless of how they are packaged.  This License gives no
245
+    permission to license the work in any other way, but it does not
246
+    invalidate such permission if you have separately received it.
247
+
248
+    d) If the work has interactive user interfaces, each must display
249
+    Appropriate Legal Notices; however, if the Program has interactive
250
+    interfaces that do not display Appropriate Legal Notices, your
251
+    work need not make them do so.
252
+
253
+  A compilation of a covered work with other separate and independent
254
+works, which are not by their nature extensions of the covered work,
255
+and which are not combined with it such as to form a larger program,
256
+in or on a volume of a storage or distribution medium, is called an
257
+"aggregate" if the compilation and its resulting copyright are not
258
+used to limit the access or legal rights of the compilation's users
259
+beyond what the individual works permit.  Inclusion of a covered work
260
+in an aggregate does not cause this License to apply to the other
261
+parts of the aggregate.
262
+
263
+  6. Conveying Non-Source Forms.
264
+
265
+  You may convey a covered work in object code form under the terms
266
+of sections 4 and 5, provided that you also convey the
267
+machine-readable Corresponding Source under the terms of this License,
268
+in one of these ways:
269
+
270
+    a) Convey the object code in, or embodied in, a physical product
271
+    (including a physical distribution medium), accompanied by the
272
+    Corresponding Source fixed on a durable physical medium
273
+    customarily used for software interchange.
274
+
275
+    b) Convey the object code in, or embodied in, a physical product
276
+    (including a physical distribution medium), accompanied by a
277
+    written offer, valid for at least three years and valid for as
278
+    long as you offer spare parts or customer support for that product
279
+    model, to give anyone who possesses the object code either (1) a
280
+    copy of the Corresponding Source for all the software in the
281
+    product that is covered by this License, on a durable physical
282
+    medium customarily used for software interchange, for a price no
283
+    more than your reasonable cost of physically performing this
284
+    conveying of source, or (2) access to copy the
285
+    Corresponding Source from a network server at no charge.
286
+
287
+    c) Convey individual copies of the object code with a copy of the
288
+    written offer to provide the Corresponding Source.  This
289
+    alternative is allowed only occasionally and noncommercially, and
290
+    only if you received the object code with such an offer, in accord
291
+    with subsection 6b.
292
+
293
+    d) Convey the object code by offering access from a designated
294
+    place (gratis or for a charge), and offer equivalent access to the
295
+    Corresponding Source in the same way through the same place at no
296
+    further charge.  You need not require recipients to copy the
297
+    Corresponding Source along with the object code.  If the place to
298
+    copy the object code is a network server, the Corresponding Source
299
+    may be on a different server (operated by you or a third party)
300
+    that supports equivalent copying facilities, provided you maintain
301
+    clear directions next to the object code saying where to find the
302
+    Corresponding Source.  Regardless of what server hosts the
303
+    Corresponding Source, you remain obligated to ensure that it is
304
+    available for as long as needed to satisfy these requirements.
305
+
306
+    e) Convey the object code using peer-to-peer transmission, provided
307
+    you inform other peers where the object code and Corresponding
308
+    Source of the work are being offered to the general public at no
309
+    charge under subsection 6d.
310
+
311
+  A separable portion of the object code, whose source code is excluded
312
+from the Corresponding Source as a System Library, need not be
313
+included in conveying the object code work.
314
+
315
+  A "User Product" is either (1) a "consumer product", which means any
316
+tangible personal property which is normally used for personal, family,
317
+or household purposes, or (2) anything designed or sold for incorporation
318
+into a dwelling.  In determining whether a product is a consumer product,
319
+doubtful cases shall be resolved in favor of coverage.  For a particular
320
+product received by a particular user, "normally used" refers to a
321
+typical or common use of that class of product, regardless of the status
322
+of the particular user or of the way in which the particular user
323
+actually uses, or expects or is expected to use, the product.  A product
324
+is a consumer product regardless of whether the product has substantial
325
+commercial, industrial or non-consumer uses, unless such uses represent
326
+the only significant mode of use of the product.
327
+
328
+  "Installation Information" for a User Product means any methods,
329
+procedures, authorization keys, or other information required to install
330
+and execute modified versions of a covered work in that User Product from
331
+a modified version of its Corresponding Source.  The information must
332
+suffice to ensure that the continued functioning of the modified object
333
+code is in no case prevented or interfered with solely because
334
+modification has been made.
335
+
336
+  If you convey an object code work under this section in, or with, or
337
+specifically for use in, a User Product, and the conveying occurs as
338
+part of a transaction in which the right of possession and use of the
339
+User Product is transferred to the recipient in perpetuity or for a
340
+fixed term (regardless of how the transaction is characterized), the
341
+Corresponding Source conveyed under this section must be accompanied
342
+by the Installation Information.  But this requirement does not apply
343
+if neither you nor any third party retains the ability to install
344
+modified object code on the User Product (for example, the work has
345
+been installed in ROM).
346
+
347
+  The requirement to provide Installation Information does not include a
348
+requirement to continue to provide support service, warranty, or updates
349
+for a work that has been modified or installed by the recipient, or for
350
+the User Product in which it has been modified or installed.  Access to a
351
+network may be denied when the modification itself materially and
352
+adversely affects the operation of the network or violates the rules and
353
+protocols for communication across the network.
354
+
355
+  Corresponding Source conveyed, and Installation Information provided,
356
+in accord with this section must be in a format that is publicly
357
+documented (and with an implementation available to the public in
358
+source code form), and must require no special password or key for
359
+unpacking, reading or copying.
360
+
361
+  7. Additional Terms.
362
+
363
+  "Additional permissions" are terms that supplement the terms of this
364
+License by making exceptions from one or more of its conditions.
365
+Additional permissions that are applicable to the entire Program shall
366
+be treated as though they were included in this License, to the extent
367
+that they are valid under applicable law.  If additional permissions
368
+apply only to part of the Program, that part may be used separately
369
+under those permissions, but the entire Program remains governed by
370
+this License without regard to the additional permissions.
371
+
372
+  When you convey a copy of a covered work, you may at your option
373
+remove any additional permissions from that copy, or from any part of
374
+it.  (Additional permissions may be written to require their own
375
+removal in certain cases when you modify the work.)  You may place
376
+additional permissions on material, added by you to a covered work,
377
+for which you have or can give appropriate copyright permission.
378
+
379
+  Notwithstanding any other provision of this License, for material you
380
+add to a covered work, you may (if authorized by the copyright holders of
381
+that material) supplement the terms of this License with terms:
382
+
383
+    a) Disclaiming warranty or limiting liability differently from the
384
+    terms of sections 15 and 16 of this License; or
385
+
386
+    b) Requiring preservation of specified reasonable legal notices or
387
+    author attributions in that material or in the Appropriate Legal
388
+    Notices displayed by works containing it; or
389
+
390
+    c) Prohibiting misrepresentation of the origin of that material, or
391
+    requiring that modified versions of such material be marked in
392
+    reasonable ways as different from the original version; or
393
+
394
+    d) Limiting the use for publicity purposes of names of licensors or
395
+    authors of the material; or
396
+
397
+    e) Declining to grant rights under trademark law for use of some
398
+    trade names, trademarks, or service marks; or
399
+
400
+    f) Requiring indemnification of licensors and authors of that
401
+    material by anyone who conveys the material (or modified versions of
402
+    it) with contractual assumptions of liability to the recipient, for
403
+    any liability that these contractual assumptions directly impose on
404
+    those licensors and authors.
405
+
406
+  All other non-permissive additional terms are considered "further
407
+restrictions" within the meaning of section 10.  If the Program as you
408
+received it, or any part of it, contains a notice stating that it is
409
+governed by this License along with a term that is a further
410
+restriction, you may remove that term.  If a license document contains
411
+a further restriction but permits relicensing or conveying under this
412
+License, you may add to a covered work material governed by the terms
413
+of that license document, provided that the further restriction does
414
+not survive such relicensing or conveying.
415
+
416
+  If you add terms to a covered work in accord with this section, you
417
+must place, in the relevant source files, a statement of the
418
+additional terms that apply to those files, or a notice indicating
419
+where to find the applicable terms.
420
+
421
+  Additional terms, permissive or non-permissive, may be stated in the
422
+form of a separately written license, or stated as exceptions;
423
+the above requirements apply either way.
424
+
425
+  8. Termination.
426
+
427
+  You may not propagate or modify a covered work except as expressly
428
+provided under this License.  Any attempt otherwise to propagate or
429
+modify it is void, and will automatically terminate your rights under
430
+this License (including any patent licenses granted under the third
431
+paragraph of section 11).
432
+
433
+  However, if you cease all violation of this License, then your
434
+license from a particular copyright holder is reinstated (a)
435
+provisionally, unless and until the copyright holder explicitly and
436
+finally terminates your license, and (b) permanently, if the copyright
437
+holder fails to notify you of the violation by some reasonable means
438
+prior to 60 days after the cessation.
439
+
440
+  Moreover, your license from a particular copyright holder is
441
+reinstated permanently if the copyright holder notifies you of the
442
+violation by some reasonable means, this is the first time you have
443
+received notice of violation of this License (for any work) from that
444
+copyright holder, and you cure the violation prior to 30 days after
445
+your receipt of the notice.
446
+
447
+  Termination of your rights under this section does not terminate the
448
+licenses of parties who have received copies or rights from you under
449
+this License.  If your rights have been terminated and not permanently
450
+reinstated, you do not qualify to receive new licenses for the same
451
+material under section 10.
452
+
453
+  9. Acceptance Not Required for Having Copies.
454
+
455
+  You are not required to accept this License in order to receive or
456
+run a copy of the Program.  Ancillary propagation of a covered work
457
+occurring solely as a consequence of using peer-to-peer transmission
458
+to receive a copy likewise does not require acceptance.  However,
459
+nothing other than this License grants you permission to propagate or
460
+modify any covered work.  These actions infringe copyright if you do
461
+not accept this License.  Therefore, by modifying or propagating a
462
+covered work, you indicate your acceptance of this License to do so.
463
+
464
+  10. Automatic Licensing of Downstream Recipients.
465
+
466
+  Each time you convey a covered work, the recipient automatically
467
+receives a license from the original licensors, to run, modify and
468
+propagate that work, subject to this License.  You are not responsible
469
+for enforcing compliance by third parties with this License.
470
+
471
+  An "entity transaction" is a transaction transferring control of an
472
+organization, or substantially all assets of one, or subdividing an
473
+organization, or merging organizations.  If propagation of a covered
474
+work results from an entity transaction, each party to that
475
+transaction who receives a copy of the work also receives whatever
476
+licenses to the work the party's predecessor in interest had or could
477
+give under the previous paragraph, plus a right to possession of the
478
+Corresponding Source of the work from the predecessor in interest, if
479
+the predecessor has it or can get it with reasonable efforts.
480
+
481
+  You may not impose any further restrictions on the exercise of the
482
+rights granted or affirmed under this License.  For example, you may
483
+not impose a license fee, royalty, or other charge for exercise of
484
+rights granted under this License, and you may not initiate litigation
485
+(including a cross-claim or counterclaim in a lawsuit) alleging that
486
+any patent claim is infringed by making, using, selling, offering for
487
+sale, or importing the Program or any portion of it.
488
+
489
+  11. Patents.
490
+
491
+  A "contributor" is a copyright holder who authorizes use under this
492
+License of the Program or a work on which the Program is based.  The
493
+work thus licensed is called the contributor's "contributor version".
494
+
495
+  A contributor's "essential patent claims" are all patent claims
496
+owned or controlled by the contributor, whether already acquired or
497
+hereafter acquired, that would be infringed by some manner, permitted
498
+by this License, of making, using, or selling its contributor version,
499
+but do not include claims that would be infringed only as a
500
+consequence of further modification of the contributor version.  For
501
+purposes of this definition, "control" includes the right to grant
502
+patent sublicenses in a manner consistent with the requirements of
503
+this License.
504
+
505
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
506
+patent license under the contributor's essential patent claims, to
507
+make, use, sell, offer for sale, import and otherwise run, modify and
508
+propagate the contents of its contributor version.
509
+
510
+  In the following three paragraphs, a "patent license" is any express
511
+agreement or commitment, however denominated, not to enforce a patent
512
+(such as an express permission to practice a patent or covenant not to
513
+sue for patent infringement).  To "grant" such a patent license to a
514
+party means to make such an agreement or commitment not to enforce a
515
+patent against the party.
516
+
517
+  If you convey a covered work, knowingly relying on a patent license,
518
+and the Corresponding Source of the work is not available for anyone
519
+to copy, free of charge and under the terms of this License, through a
520
+publicly available network server or other readily accessible means,
521
+then you must either (1) cause the Corresponding Source to be so
522
+available, or (2) arrange to deprive yourself of the benefit of the
523
+patent license for this particular work, or (3) arrange, in a manner
524
+consistent with the requirements of this License, to extend the patent
525
+license to downstream recipients.  "Knowingly relying" means you have
526
+actual knowledge that, but for the patent license, your conveying the
527
+covered work in a country, or your recipient's use of the covered work
528
+in a country, would infringe one or more identifiable patents in that
529
+country that you have reason to believe are valid.
530
+
531
+  If, pursuant to or in connection with a single transaction or
532
+arrangement, you convey, or propagate by procuring conveyance of, a
533
+covered work, and grant a patent license to some of the parties
534
+receiving the covered work authorizing them to use, propagate, modify
535
+or convey a specific copy of the covered work, then the patent license
536
+you grant is automatically extended to all recipients of the covered
537
+work and works based on it.
538
+
539
+  A patent license is "discriminatory" if it does not include within
540
+the scope of its coverage, prohibits the exercise of, or is
541
+conditioned on the non-exercise of one or more of the rights that are
542
+specifically granted under this License.  You may not convey a covered
543
+work if you are a party to an arrangement with a third party that is
544
+in the business of distributing software, under which you make payment
545
+to the third party based on the extent of your activity of conveying
546
+the work, and under which the third party grants, to any of the
547
+parties who would receive the covered work from you, a discriminatory
548
+patent license (a) in connection with copies of the covered work
549
+conveyed by you (or copies made from those copies), or (b) primarily
550
+for and in connection with specific products or compilations that
551
+contain the covered work, unless you entered into that arrangement,
552
+or that patent license was granted, prior to 28 March 2007.
553
+
554
+  Nothing in this License shall be construed as excluding or limiting
555
+any implied license or other defenses to infringement that may
556
+otherwise be available to you under applicable patent law.
557
+
558
+  12. No Surrender of Others' Freedom.
559
+
560
+  If conditions are imposed on you (whether by court order, agreement or
561
+otherwise) that contradict the conditions of this License, they do not
562
+excuse you from the conditions of this License.  If you cannot convey a
563
+covered work so as to satisfy simultaneously your obligations under this
564
+License and any other pertinent obligations, then as a consequence you may
565
+not convey it at all.  For example, if you agree to terms that obligate you
566
+to collect a royalty for further conveying from those to whom you convey
567
+the Program, the only way you could satisfy both those terms and this
568
+License would be to refrain entirely from conveying the Program.
569
+
570
+  13. Use with the GNU Affero General Public License.
571
+
572
+  Notwithstanding any other provision of this License, you have
573
+permission to link or combine any covered work with a work licensed
574
+under version 3 of the GNU Affero General Public License into a single
575
+combined work, and to convey the resulting work.  The terms of this
576
+License will continue to apply to the part which is the covered work,
577
+but the special requirements of the GNU Affero General Public License,
578
+section 13, concerning interaction through a network will apply to the
579
+combination as such.
580
+
581
+  14. Revised Versions of this License.
582
+
583
+  The Free Software Foundation may publish revised and/or new versions of
584
+the GNU General Public License from time to time.  Such new versions will
585
+be similar in spirit to the present version, but may differ in detail to
586
+address new problems or concerns.
587
+
588
+  Each version is given a distinguishing version number.  If the
589
+Program specifies that a certain numbered version of the GNU General
590
+Public License "or any later version" applies to it, you have the
591
+option of following the terms and conditions either of that numbered
592
+version or of any later version published by the Free Software
593
+Foundation.  If the Program does not specify a version number of the
594
+GNU General Public License, you may choose any version ever published
595
+by the Free Software Foundation.
596
+
597
+  If the Program specifies that a proxy can decide which future
598
+versions of the GNU General Public License can be used, that proxy's
599
+public statement of acceptance of a version permanently authorizes you
600
+to choose that version for the Program.
601
+
602
+  Later license versions may give you additional or different
603
+permissions.  However, no additional obligations are imposed on any
604
+author or copyright holder as a result of your choosing to follow a
605
+later version.
606
+
607
+  15. Disclaimer of Warranty.
608
+
609
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
610
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
611
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
612
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
613
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
614
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
615
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
616
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
617
+
618
+  16. Limitation of Liability.
619
+
620
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
621
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
622
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
623
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
624
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
625
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
626
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
627
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
628
+SUCH DAMAGES.
629
+
630
+  17. Interpretation of Sections 15 and 16.
631
+
632
+  If the disclaimer of warranty and limitation of liability provided
633
+above cannot be given local legal effect according to their terms,
634
+reviewing courts shall apply local law that most closely approximates
635
+an absolute waiver of all civil liability in connection with the
636
+Program, unless a warranty or assumption of liability accompanies a
637
+copy of the Program in return for a fee.
638
+
639
+                     END OF TERMS AND CONDITIONS
640
+
641
+            How to Apply These Terms to Your New Programs
642
+
643
+  If you develop a new program, and you want it to be of the greatest
644
+possible use to the public, the best way to achieve this is to make it
645
+free software which everyone can redistribute and change under these terms.
646
+
647
+  To do so, attach the following notices to the program.  It is safest
648
+to attach them to the start of each source file to most effectively
649
+state the exclusion of warranty; and each file should have at least
650
+the "copyright" line and a pointer to where the full notice is found.
651
+
652
+    <one line to give the program's name and a brief idea of what it does.>
653
+    Copyright (C) <year>  <name of author>
654
+
655
+    This program is free software: you can redistribute it and/or modify
656
+    it under the terms of the GNU General Public License as published by
657
+    the Free Software Foundation, either version 3 of the License, or
658
+    (at your option) any later version.
659
+
660
+    This program is distributed in the hope that it will be useful,
661
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
662
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
663
+    GNU General Public License for more details.
664
+
665
+    You should have received a copy of the GNU General Public License
666
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
667
+
668
+Also add information on how to contact you by electronic and paper mail.
669
+
670
+  If the program does terminal interaction, make it output a short
671
+notice like this when it starts in an interactive mode:
672
+
673
+    <program>  Copyright (C) <year>  <name of author>
674
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
675
+    This is free software, and you are welcome to redistribute it
676
+    under certain conditions; type `show c' for details.
677
+
678
+The hypothetical commands `show w' and `show c' should show the appropriate
679
+parts of the General Public License.  Of course, your program's commands
680
+might be different; for a GUI interface, you would use an "about box".
681
+
682
+  You should also get your employer (if you work as a programmer) or school,
683
+if any, to sign a "copyright disclaimer" for the program, if necessary.
684
+For more information on this, and how to apply and follow the GNU GPL, see
685
+<https://www.gnu.org/licenses/>.
686
+
687
+  The GNU General Public License does not permit incorporating your program
688
+into proprietary programs.  If your program is a subroutine library, you
689
+may consider it more useful to permit linking proprietary applications with
690
+the library.  If this is what you want to do, use the GNU Lesser General
691
+Public License instead of this License.  But first, please read
692
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
693
+
694
+
695
+
696
+                   GNU LESSER GENERAL PUBLIC LICENSE
697
+                       Version 3, 29 June 2007
698
+
699
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
700
+ Everyone is permitted to copy and distribute verbatim copies
701
+ of this license document, but changing it is not allowed.
702
+
703
+
704
+  This version of the GNU Lesser General Public License incorporates
705
+the terms and conditions of version 3 of the GNU General Public
706
+License, supplemented by the additional permissions listed below.
707
+
708
+  0. Additional Definitions.
709
+
710
+  As used herein, "this License" refers to version 3 of the GNU Lesser
711
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
712
+General Public License.
713
+
714
+  "The Library" refers to a covered work governed by this License,
715
+other than an Application or a Combined Work as defined below.
716
+
717
+  An "Application" is any work that makes use of an interface provided
718
+by the Library, but which is not otherwise based on the Library.
719
+Defining a subclass of a class defined by the Library is deemed a mode
720
+of using an interface provided by the Library.
721
+
722
+  A "Combined Work" is a work produced by combining or linking an
723
+Application with the Library.  The particular version of the Library
724
+with which the Combined Work was made is also called the "Linked
725
+Version".
726
+
727
+  The "Minimal Corresponding Source" for a Combined Work means the
728
+Corresponding Source for the Combined Work, excluding any source code
729
+for portions of the Combined Work that, considered in isolation, are
730
+based on the Application, and not on the Linked Version.
731
+
732
+  The "Corresponding Application Code" for a Combined Work means the
733
+object code and/or source code for the Application, including any data
734
+and utility programs needed for reproducing the Combined Work from the
735
+Application, but excluding the System Libraries of the Combined Work.
736
+
737
+  1. Exception to Section 3 of the GNU GPL.
738
+
739
+  You may convey a covered work under sections 3 and 4 of this License
740
+without being bound by section 3 of the GNU GPL.
741
+
742
+  2. Conveying Modified Versions.
743
+
744
+  If you modify a copy of the Library, and, in your modifications, a
745
+facility refers to a function or data to be supplied by an Application
746
+that uses the facility (other than as an argument passed when the
747
+facility is invoked), then you may convey a copy of the modified
748
+version:
749
+
750
+   a) under this License, provided that you make a good faith effort to
751
+   ensure that, in the event an Application does not supply the
752
+   function or data, the facility still operates, and performs
753
+   whatever part of its purpose remains meaningful, or
754
+
755
+   b) under the GNU GPL, with none of the additional permissions of
756
+   this License applicable to that copy.
757
+
758
+  3. Object Code Incorporating Material from Library Header Files.
759
+
760
+  The object code form of an Application may incorporate material from
761
+a header file that is part of the Library.  You may convey such object
762
+code under terms of your choice, provided that, if the incorporated
763
+material is not limited to numerical parameters, data structure
764
+layouts and accessors, or small macros, inline functions and templates
765
+(ten or fewer lines in length), you do both of the following:
766
+
767
+   a) Give prominent notice with each copy of the object code that the
768
+   Library is used in it and that the Library and its use are
769
+   covered by this License.
770
+
771
+   b) Accompany the object code with a copy of the GNU GPL and this license
772
+   document.
773
+
774
+  4. Combined Works.
775
+
776
+  You may convey a Combined Work under terms of your choice that,
777
+taken together, effectively do not restrict modification of the
778
+portions of the Library contained in the Combined Work and reverse
779
+engineering for debugging such modifications, if you also do each of
780
+the following:
781
+
782
+   a) Give prominent notice with each copy of the Combined Work that
783
+   the Library is used in it and that the Library and its use are
784
+   covered by this License.
785
+
786
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
787
+   document.
788
+
789
+   c) For a Combined Work that displays copyright notices during
790
+   execution, include the copyright notice for the Library among
791
+   these notices, as well as a reference directing the user to the
792
+   copies of the GNU GPL and this license document.
793
+
794
+   d) Do one of the following:
795
+
796
+       0) Convey the Minimal Corresponding Source under the terms of this
797
+       License, and the Corresponding Application Code in a form
798
+       suitable for, and under terms that permit, the user to
799
+       recombine or relink the Application with a modified version of
800
+       the Linked Version to produce a modified Combined Work, in the
801
+       manner specified by section 6 of the GNU GPL for conveying
802
+       Corresponding Source.
803
+
804
+       1) Use a suitable shared library mechanism for linking with the
805
+       Library.  A suitable mechanism is one that (a) uses at run time
806
+       a copy of the Library already present on the user's computer
807
+       system, and (b) will operate properly with a modified version
808
+       of the Library that is interface-compatible with the Linked
809
+       Version.
810
+
811
+   e) Provide Installation Information, but only if you would otherwise
812
+   be required to provide such information under section 6 of the
813
+   GNU GPL, and only to the extent that such information is
814
+   necessary to install and execute a modified version of the
815
+   Combined Work produced by recombining or relinking the
816
+   Application with a modified version of the Linked Version. (If
817
+   you use option 4d0, the Installation Information must accompany
818
+   the Minimal Corresponding Source and Corresponding Application
819
+   Code. If you use option 4d1, you must provide the Installation
820
+   Information in the manner specified by section 6 of the GNU GPL
821
+   for conveying Corresponding Source.)
822
+
823
+  5. Combined Libraries.
824
+
825
+  You may place library facilities that are a work based on the
826
+Library side by side in a single library together with other library
827
+facilities that are not Applications and are not covered by this
828
+License, and convey such a combined library under terms of your
829
+choice, if you do both of the following:
830
+
831
+   a) Accompany the combined library with a copy of the same work based
832
+   on the Library, uncombined with any other library facilities,
833
+   conveyed under the terms of this License.
834
+
835
+   b) Give prominent notice with the combined library that part of it
836
+   is a work based on the Library, and explaining where to find the
837
+   accompanying uncombined form of the same work.
838
+
839
+  6. Revised Versions of the GNU Lesser General Public License.
840
+
841
+  The Free Software Foundation may publish revised and/or new versions
842
+of the GNU Lesser General Public License from time to time. Such new
843
+versions will be similar in spirit to the present version, but may
844
+differ in detail to address new problems or concerns.
845
+
846
+  Each version is given a distinguishing version number. If the
847
+Library as you received it specifies that a certain numbered version
848
+of the GNU Lesser General Public License "or any later version"
849
+applies to it, you have the option of following the terms and
850
+conditions either of that published version or of any later version
851
+published by the Free Software Foundation. If the Library as you
852
+received it does not specify a version number of the GNU Lesser
853
+General Public License, you may choose any version of the GNU Lesser
854
+General Public License ever published by the Free Software Foundation.
855
+
856
+  If the Library as you received it specifies that a proxy can decide
857
+whether future versions of the GNU Lesser General Public License shall
858
+apply, that proxy's public statement of acceptance of any version is
859
+permanent authorization for you to choose that version for the
860
+Library.
861
+
... ...
@@ -0,0 +1,386 @@
1
+/**
2
+ * @author fenris
3
+ */
4
+declare type int = number;
5
+/**
6
+ * @author fenris
7
+ */
8
+declare type float = number;
9
+/**
10
+ * @author fenris
11
+ */
12
+declare type type_time = {
13
+    hours: int;
14
+    minutes: int;
15
+    seconds: int;
16
+};
17
+/**
18
+ * @author fenris
19
+ */
20
+declare type type_pseudopointer<type_value> = {
21
+    value: type_value;
22
+};
23
+/**
24
+ * @author fenris
25
+ */
26
+declare function pseudopointer_null<type_value>(): type_pseudopointer<type_value>;
27
+/**
28
+ * @author fenris
29
+ */
30
+declare function pseudopointer_make<type_value>(value: type_value): type_pseudopointer<type_value>;
31
+/**
32
+ * @author fenris
33
+ */
34
+declare function pseudopointer_isset<type_value>(pseudopointer: type_pseudopointer<type_value>): boolean;
35
+/**
36
+ * @author fenris
37
+ */
38
+declare function pseudopointer_read<type_value>(pseudopointer: type_pseudopointer<type_value>): type_value;
39
+/**
40
+ * @author fenris
41
+ */
42
+declare function pseudopointer_write<type_value>(pseudopointer: type_pseudopointer<type_value>, value: type_value): void;
43
+declare var process: any;
44
+declare var require: any;
45
+declare class Buffer {
46
+    constructor(x: string, modifier?: string);
47
+    toString(modifier?: string): string;
48
+}
49
+declare var java: any;
50
+declare module lib_base {
51
+    /**
52
+     * @author fenris
53
+     */
54
+    function environment(): string;
55
+}
56
+/**
57
+ * @author fenris
58
+ */
59
+declare var instance_verbosity: int;
60
+/**
61
+ * @desc the ability to check for equality with another element of the same domain
62
+ * @author fenris
63
+ */
64
+interface interface_collatable<type_value> {
65
+    /**
66
+     * @author fenris
67
+     */
68
+    _collate(value: type_value): boolean;
69
+}
70
+/**
71
+ * @author fenris
72
+ */
73
+declare function instance_collate<type_value>(value1: type_value, value2: type_value): boolean;
74
+/**
75
+ * @desc the ability to compare with another element of the same domain for determining if the first is "smaller than or equal to" the latter
76
+ * @author fenris
77
+ */
78
+interface interface_comparable<type_value> {
79
+    /**
80
+     * @author fenris
81
+     */
82
+    _compare(value: type_value): boolean;
83
+}
84
+/**
85
+ * @author fenris
86
+ */
87
+declare function instance_compare<type_value>(value1: type_value, value2: type_value): boolean;
88
+/**
89
+ * @desc the ability to create an exact copy
90
+ * @author fenris
91
+ */
92
+interface interface_cloneable<type_value> {
93
+    /**
94
+     * @author fenris
95
+     */
96
+    _clone(): type_value;
97
+}
98
+/**
99
+ * @author fenris
100
+ */
101
+declare function instance_clone<type_value>(value: type_value): type_value;
102
+/**
103
+ * @author fenris
104
+ */
105
+interface interface_hashable {
106
+    /**
107
+     * @author fenris
108
+     */
109
+    _hash(): string;
110
+}
111
+/**
112
+ * @desc the ability to generate a string out of the element, which identifies it to a high degree
113
+ * @author fenris
114
+ */
115
+declare function instance_hash<type_value>(value: type_value): string;
116
+/**
117
+ * @author fenris
118
+ */
119
+interface interface_showable {
120
+    /**
121
+     * @author fenris
122
+     */
123
+    _show(): string;
124
+}
125
+/**
126
+ * @desc the ability to map the element to a textual representation (most likely not injective)
127
+ * @author fenris
128
+ */
129
+declare function instance_show<type_value>(value: type_value): string;
130
+/**
131
+ * @todo outsource to dedicated plankton-lib
132
+ */
133
+declare module lib_log {
134
+    /**
135
+     * @author fenris
136
+     */
137
+    function log(...args: Array<any>): void;
138
+    /**
139
+     * @author fenris
140
+     */
141
+    function info(...args: Array<any>): void;
142
+    /**
143
+     * @author fenris
144
+     */
145
+    function warn(...args: Array<any>): void;
146
+    /**
147
+     * @author fenris
148
+     */
149
+    function error(...args: Array<any>): void;
150
+}
151
+/**
152
+ * @author frac
153
+ */
154
+interface interface_decorator<type_core> {
155
+    /**
156
+     * @author frac
157
+     */
158
+    core: type_core;
159
+}
160
+/**
161
+ * @author frac
162
+ */
163
+declare class class_observer {
164
+    /**
165
+     * @author frac
166
+     */
167
+    protected counter: int;
168
+    /**
169
+     * @author frac
170
+     */
171
+    protected actions: {
172
+        [id: string]: (information: Object) => void;
173
+    };
174
+    /**
175
+     * @author frac
176
+     */
177
+    protected buffer: Array<Object>;
178
+    /**
179
+     * @author frac
180
+     */
181
+    constructor();
182
+    /**
183
+     * @author frac
184
+     */
185
+    empty(): boolean;
186
+    /**
187
+     * @author frac
188
+     */
189
+    flush(): void;
190
+    /**
191
+     * @author frac
192
+     */
193
+    set(id: string, action: (information: Object) => void): void;
194
+    /**
195
+     * @author frac
196
+     */
197
+    del(id: string): void;
198
+    /**
199
+     * @author frac
200
+     */
201
+    add(action: (information: Object) => void): void;
202
+    /**
203
+     * @author frac
204
+     */
205
+    notify(information?: Object, delayed?: boolean): void;
206
+    /**
207
+     * @author frac
208
+     */
209
+    rollout(): void;
210
+}
211
+/**
212
+ * @author frac
213
+ */
214
+/**
215
+ * @author frac
216
+ */
217
+declare module lib_maybe {
218
+    /**
219
+     * @author fenris
220
+     */
221
+    type type_maybe<type_value> = {
222
+        kind: string;
223
+        parameters: Object;
224
+    };
225
+    /**
226
+     * @author fenris
227
+     */
228
+    function make_nothing<type_value>(): type_maybe<type_value>;
229
+    /**
230
+     * @author fenris
231
+     */
232
+    function make_just<type_value>(value: type_value): type_maybe<type_value>;
233
+    /**
234
+     * @author fenris
235
+     */
236
+    function is_nothing<type_value>(maybe: type_maybe<type_value>): boolean;
237
+    /**
238
+     * @author fenris
239
+     */
240
+    function is_just<type_value>(maybe: type_maybe<type_value>): boolean;
241
+    /**
242
+     * @author fenris
243
+     */
244
+    function cull<type_value>(maybe: type_maybe<type_value>): type_value;
245
+    /**
246
+     * @author fenris
247
+     */
248
+    function propagate<type_value, type_value_>(maybe: type_maybe<type_value>, function_: (value: type_value) => type_maybe<type_value_>): type_maybe<type_value_>;
249
+}
250
+/**
251
+ * @author fenris
252
+ */
253
+declare class class_maybe<type_value> implements interface_showable {
254
+    /**
255
+     * @desc whether the wrapper is nothing
256
+     * @author fenris
257
+     */
258
+    is_nothing(): boolean;
259
+    /**
260
+     * @desc whether the wrapper is just
261
+     * @author fenris
262
+     */
263
+    is_just(): boolean;
264
+    /**
265
+     * @desc return the value, stored in the maybe-wrapper
266
+     * @author fenris
267
+     */
268
+    cull(): type_value;
269
+    /**
270
+     * @author fenris
271
+     */
272
+    toString(): string;
273
+    /**
274
+     * @author fenris
275
+     */
276
+    distinguish(action_just: (value?: type_value) => void, action_nothing?: (reason?: string) => void): void;
277
+    /**
278
+     * @author fenris
279
+     */
280
+    propagate<type_value_>(action: (value: type_value) => class_maybe<type_value_>): class_maybe<type_value_>;
281
+    /**
282
+     * @desc [implementation]
283
+     * @author fenris
284
+     */
285
+    _show(): string;
286
+}
287
+/**
288
+ * @author fenris
289
+ */
290
+declare class class_nothing<type_value> extends class_maybe<type_value> {
291
+    /**
292
+     * @author fenris
293
+     */
294
+    private reason;
295
+    /**
296
+     * @author fenris
297
+     */
298
+    constructor(reason?: string);
299
+    /**
300
+     * @author fenris
301
+     */
302
+    is_nothing(): boolean;
303
+    /**
304
+     * @author fenris
305
+     */
306
+    is_just(): boolean;
307
+    /**
308
+     * @author fenris
309
+     */
310
+    cull(): type_value;
311
+    /**
312
+     * @author fenris
313
+     */
314
+    toString(): string;
315
+    /**
316
+     * @author fenris
317
+     */
318
+    reason_get(): string;
319
+    /**
320
+     * @author fenris
321
+     */
322
+    distinguish(action_just: (value?: type_value) => void, action_nothing?: (reason?: string) => void): void;
323
+    /**
324
+     * @author fenris
325
+     */
326
+    propagate<type_value_>(action: (value: type_value) => class_maybe<type_value_>): class_maybe<type_value_>;
327
+}
328
+/**
329
+ * @author fenris
330
+ */
331
+declare class class_just<type_value> extends class_maybe<type_value> {
332
+    /**
333
+     * @author fenris
334
+     */
335
+    private value;
336
+    /**
337
+     * @author fenris
338
+     */
339
+    constructor(value: type_value);
340
+    /**
341
+     * @author fenris
342
+     */
343
+    is_nothing(): boolean;
344
+    /**
345
+     * @author fenris
346
+     */
347
+    is_just(): boolean;
348
+    /**
349
+     * @author fenris
350
+     */
351
+    cull(): type_value;
352
+    /**
353
+     * @author fenris
354
+     */
355
+    toString(): string;
356
+    /**
357
+     * @author fenris
358
+     */
359
+    distinguish(action_just: (value?: type_value) => void, action_nothing?: (reason?: string) => void): void;
360
+    /**
361
+     * @author fenris
362
+     */
363
+    propagate<type_value_>(action: (value: type_value) => class_maybe<type_value_>): class_maybe<type_value_>;
364
+}
365
+/**
366
+ * @author frac
367
+ */
368
+declare class class_error extends Error {
369
+    /**
370
+     * @author frac
371
+     */
372
+    protected suberrors: Array<Error>;
373
+    /**
374
+     * @author frac
375
+     */
376
+    protected mess: string;
377
+    /**
378
+     * @author frac
379
+     */
380
+    constructor(message: string, suberrors?: Array<Error>);
381
+    /**
382
+     * @override
383
+     * @author frac
384
+     */
385
+    toString(): string;
386
+}
... ...
@@ -0,0 +1,768 @@
1
+var __extends = (this && this.__extends) || (function () {
2
+    var extendStatics = function (d, b) {
3
+        extendStatics = Object.setPrototypeOf ||
4
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+        return extendStatics(d, b);
7
+    };
8
+    return function (d, b) {
9
+        extendStatics(d, b);
10
+        function __() { this.constructor = d; }
11
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+    };
13
+})();
14
+/*
15
+This file is part of »bacterio-plankton:base«.
16
+
17
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
18
+<info@greenscale.de>
19
+
20
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
21
+it under the terms of the GNU Lesser General Public License as published by
22
+the Free Software Foundation, either version 3 of the License, or
23
+(at your option) any later version.
24
+
25
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
26
+but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
+GNU Lesser General Public License for more details.
29
+
30
+You should have received a copy of the GNU Lesser General Public License
31
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
32
+ */
33
+// }
34
+/*
35
+This file is part of »bacterio-plankton:base«.
36
+
37
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
38
+<info@greenscale.de>
39
+
40
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
41
+it under the terms of the GNU Lesser General Public License as published by
42
+the Free Software Foundation, either version 3 of the License, or
43
+(at your option) any later version.
44
+
45
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
46
+but WITHOUT ANY WARRANTY; without even the implied warranty of
47
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48
+GNU Lesser General Public License for more details.
49
+
50
+You should have received a copy of the GNU Lesser General Public License
51
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
52
+ */
53
+/**
54
+ * @author fenris
55
+ */
56
+/*export*/ function pseudopointer_null() {
57
+    return {
58
+        "value": null
59
+    };
60
+}
61
+/**
62
+ * @author fenris
63
+ */
64
+/*export*/ function pseudopointer_make(value) {
65
+    return {
66
+        "value": value
67
+    };
68
+}
69
+/**
70
+ * @author fenris
71
+ */
72
+/*export*/ function pseudopointer_isset(pseudopointer) {
73
+    return (pseudopointer.value != null);
74
+}
75
+/**
76
+ * @author fenris
77
+ */
78
+/*export*/ function pseudopointer_read(pseudopointer) {
79
+    if (pseudopointer.value != null) {
80
+        return pseudopointer.value;
81
+    }
82
+    else {
83
+        var message = "nullpointer dereferencation";
84
+        throw (new Error(message));
85
+    }
86
+}
87
+/**
88
+ * @author fenris
89
+ */
90
+/*export*/ function pseudopointer_write(pseudopointer, value) {
91
+    pseudopointer.value = value;
92
+}
93
+/*
94
+This file is part of »bacterio-plankton:base«.
95
+
96
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
97
+<info@greenscale.de>
98
+
99
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
100
+it under the terms of the GNU Lesser General Public License as published by
101
+the Free Software Foundation, either version 3 of the License, or
102
+(at your option) any later version.
103
+
104
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
105
+but WITHOUT ANY WARRANTY; without even the implied warranty of
106
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
107
+GNU Lesser General Public License for more details.
108
+
109
+You should have received a copy of the GNU Lesser General Public License
110
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
111
+ */
112
+;
113
+var lib_base;
114
+(function (lib_base) {
115
+    /**
116
+     * @author fenris
117
+     */
118
+    function environment() {
119
+        var entries = [
120
+            {
121
+                "id": "web",
122
+                "name": "Web",
123
+                "predicate": function () { return (typeof (document) !== "undefined"); },
124
+            },
125
+            {
126
+                "id": "node",
127
+                "name": "Node.js",
128
+                "predicate": function () { return (typeof (process) !== "undefined"); },
129
+            },
130
+            {
131
+                "id": "rhino",
132
+                "name": "Rhino",
133
+                "predicate": function () { return (typeof (java) !== "undefined"); },
134
+            },
135
+            {
136
+                "id": "webworker",
137
+                "name": "WebWorker",
138
+                "predicate": function () { return (typeof (self["WorkerNavigator"]) !== "undefined"); }
139
+            }
140
+        ];
141
+        var id;
142
+        var found = entries.some(function (entry) {
143
+            if (entry.predicate()) {
144
+                id = entry.id;
145
+                return true;
146
+            }
147
+            else {
148
+                return false;
149
+            }
150
+        });
151
+        if (found) {
152
+            return id;
153
+        }
154
+        else {
155
+            throw (new Error("unknown environment"));
156
+        }
157
+    }
158
+    lib_base.environment = environment;
159
+})(lib_base || (lib_base = {}));
160
+/*
161
+This file is part of »bacterio-plankton:base«.
162
+
163
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
164
+<info@greenscale.de>
165
+
166
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
167
+it under the terms of the GNU Lesser General Public License as published by
168
+the Free Software Foundation, either version 3 of the License, or
169
+(at your option) any later version.
170
+
171
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
172
+but WITHOUT ANY WARRANTY; without even the implied warranty of
173
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
174
+GNU Lesser General Public License for more details.
175
+
176
+You should have received a copy of the GNU Lesser General Public License
177
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
178
+ */
179
+/**
180
+ * @author fenris
181
+ */
182
+var instance_verbosity = 0;
183
+/**
184
+ * @author fenris
185
+ */
186
+function instance_collate(value1, value2) {
187
+    if (typeof (value1) === "object") {
188
+        if (value1 == null) {
189
+            return (value2 == null);
190
+        }
191
+        else {
192
+            if ("_collate" in value1) {
193
+                return value1["_collate"](value2);
194
+            }
195
+            else {
196
+                throw (new Error("[collate]" + " " + "object has no such method"));
197
+            }
198
+        }
199
+    }
200
+    else {
201
+        if (instance_verbosity >= 1) {
202
+            lib_log.warn("[collate]" + " " + "primitive value; using default implementation");
203
+        }
204
+        return (value1 === value2);
205
+    }
206
+}
207
+/**
208
+ * @author fenris
209
+ */
210
+function instance_compare(value1, value2) {
211
+    if (typeof (value1) === "object") {
212
+        if ("_compare" in value1) {
213
+            return value1["_compare"](value2);
214
+        }
215
+        else {
216
+            throw (new Error("[compare]" + " " + "object has no such method"));
217
+        }
218
+    }
219
+    else {
220
+        if (instance_verbosity >= 1) {
221
+            lib_log.warn("[compare]" + " " + "primitive value; using default implementation");
222
+        }
223
+        return (value1 <= value2);
224
+    }
225
+}
226
+/**
227
+ * @author fenris
228
+ */
229
+function instance_clone(value) {
230
+    if (typeof (value) === "object") {
231
+        if ("_clone" in value) {
232
+            return value["_clone"]();
233
+        }
234
+        else {
235
+            throw (new Error("[clone]" + " " + "object has no such method"));
236
+        }
237
+    }
238
+    else {
239
+        if (instance_verbosity >= 1) {
240
+            lib_log.warn("[clone]" + " " + "primitive value; using default implementation");
241
+        }
242
+        return value;
243
+    }
244
+}
245
+/**
246
+ * @desc the ability to generate a string out of the element, which identifies it to a high degree
247
+ * @author fenris
248
+ */
249
+function instance_hash(value) {
250
+    if (typeof (value) === "object") {
251
+        if ("_hash" in value) {
252
+            return value["_hash"]();
253
+        }
254
+        else {
255
+            throw (new Error("[hash]" + " " + "object has no such method"));
256
+        }
257
+    }
258
+    else {
259
+        if (instance_verbosity >= 1) {
260
+            lib_log.warn("[hash]" + " " + "primitive value; using default implementation");
261
+        }
262
+        return String(value);
263
+    }
264
+}
265
+/**
266
+ * @desc the ability to map the element to a textual representation (most likely not injective)
267
+ * @author fenris
268
+ */
269
+function instance_show(value) {
270
+    if (typeof (value) === "object") {
271
+        if (value == null) {
272
+            return "NULL";
273
+        }
274
+        else {
275
+            if ("_show" in value) {
276
+                return value["_show"]();
277
+            }
278
+            else {
279
+                // throw (new Error("[show]" + " " + "object has no such method"));
280
+                return JSON.stringify(value);
281
+            }
282
+        }
283
+    }
284
+    else {
285
+        if (instance_verbosity >= 1) {
286
+            lib_log.warn("[show]" + " " + "primitive value; using default implementation");
287
+        }
288
+        return String(value);
289
+    }
290
+}
291
+/*
292
+This file is part of »bacterio-plankton:base«.
293
+
294
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
295
+<info@greenscale.de>
296
+
297
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
298
+it under the terms of the GNU Lesser General Public License as published by
299
+the Free Software Foundation, either version 3 of the License, or
300
+(at your option) any later version.
301
+
302
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
303
+but WITHOUT ANY WARRANTY; without even the implied warranty of
304
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
305
+GNU Lesser General Public License for more details.
306
+
307
+You should have received a copy of the GNU Lesser General Public License
308
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
309
+ */
310
+/**
311
+ * @todo outsource to dedicated plankton-lib
312
+ */
313
+var lib_log;
314
+(function (lib_log) {
315
+    /**
316
+     * @author fenris
317
+     */
318
+    function log() {
319
+        var args = [];
320
+        for (var _i = 0; _i < arguments.length; _i++) {
321
+            args[_i] = arguments[_i];
322
+        }
323
+        /*window.*/ console.log.apply(console, args);
324
+    }
325
+    lib_log.log = log;
326
+    /**
327
+     * @author fenris
328
+     */
329
+    function info() {
330
+        var args = [];
331
+        for (var _i = 0; _i < arguments.length; _i++) {
332
+            args[_i] = arguments[_i];
333
+        }
334
+        /*window.*/ console.info.apply(console, args);
335
+    }
336
+    lib_log.info = info;
337
+    /**
338
+     * @author fenris
339
+     */
340
+    function warn() {
341
+        var args = [];
342
+        for (var _i = 0; _i < arguments.length; _i++) {
343
+            args[_i] = arguments[_i];
344
+        }
345
+        /*window.*/ console.warn.apply(console, args);
346
+    }
347
+    lib_log.warn = warn;
348
+    /**
349
+     * @author fenris
350
+     */
351
+    function error() {
352
+        var args = [];
353
+        for (var _i = 0; _i < arguments.length; _i++) {
354
+            args[_i] = arguments[_i];
355
+        }
356
+        /*window.*/ console.error.apply(console, args);
357
+    }
358
+    lib_log.error = error;
359
+})(lib_log || (lib_log = {}));
360
+/*
361
+This file is part of »bacterio-plankton:base«.
362
+
363
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
364
+<info@greenscale.de>
365
+
366
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
367
+it under the terms of the GNU Lesser General Public License as published by
368
+the Free Software Foundation, either version 3 of the License, or
369
+(at your option) any later version.
370
+
371
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
372
+but WITHOUT ANY WARRANTY; without even the implied warranty of
373
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
374
+GNU Lesser General Public License for more details.
375
+
376
+You should have received a copy of the GNU Lesser General Public License
377
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
378
+ */
379
+/**
380
+ * @author frac
381
+ */
382
+var class_observer = /** @class */ (function () {
383
+    /**
384
+     * @author frac
385
+     */
386
+    function class_observer() {
387
+        this.counter = 0;
388
+        this.actions = {};
389
+        this.buffer = [];
390
+    }
391
+    /**
392
+     * @author frac
393
+     */
394
+    class_observer.prototype.empty = function () {
395
+        return (Object.keys(this.actions).length == 0);
396
+    };
397
+    /**
398
+     * @author frac
399
+     */
400
+    class_observer.prototype.flush = function () {
401
+        this.actions = {};
402
+    };
403
+    /**
404
+     * @author frac
405
+     */
406
+    class_observer.prototype.set = function (id, action) {
407
+        this.actions[id] = action;
408
+    };
409
+    /**
410
+     * @author frac
411
+     */
412
+    class_observer.prototype.del = function (id) {
413
+        delete this.actions[id];
414
+    };
415
+    /**
416
+     * @author frac
417
+     */
418
+    class_observer.prototype.add = function (action) {
419
+        this.set((this.counter++).toString(), action);
420
+    };
421
+    /**
422
+     * @author frac
423
+     */
424
+    class_observer.prototype.notify = function (information, delayed) {
425
+        var _this = this;
426
+        if (information === void 0) { information = {}; }
427
+        if (delayed === void 0) { delayed = false; }
428
+        if (delayed) {
429
+            this.buffer.push(information);
430
+        }
431
+        else {
432
+            Object.keys(this.actions).forEach(function (id) { return _this.actions[id](information); });
433
+        }
434
+    };
435
+    /**
436
+     * @author frac
437
+     */
438
+    class_observer.prototype.rollout = function () {
439
+        var _this = this;
440
+        this.buffer.forEach(function (information) { return _this.notify(information, false); });
441
+        this.buffer = [];
442
+    };
443
+    return class_observer;
444
+}());
445
+/**
446
+ * @author frac
447
+ */
448
+/*
449
+export interface interface_readable<type_value> {
450
+
451
+    |**
452
+     * @author frac
453
+     *|
454
+    read() : type_executor<type_value, Error>;
455
+
456
+}
457
+ */
458
+/**
459
+ * @author frac
460
+ */
461
+/*
462
+export interface interface_writeable<type_value> {
463
+
464
+    |**
465
+     * @author frac
466
+     *|
467
+    write(value : type_value) : type_executor<void, Error>;
468
+
469
+}
470
+ */
471
+/*
472
+This file is part of »bacterio-plankton:base«.
473
+
474
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
475
+<info@greenscale.de>
476
+
477
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
478
+it under the terms of the GNU Lesser General Public License as published by
479
+the Free Software Foundation, either version 3 of the License, or
480
+(at your option) any later version.
481
+
482
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
483
+but WITHOUT ANY WARRANTY; without even the implied warranty of
484
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
485
+GNU Lesser General Public License for more details.
486
+
487
+You should have received a copy of the GNU Lesser General Public License
488
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
489
+ */
490
+var lib_maybe;
491
+(function (lib_maybe) {
492
+    /**
493
+     * @author fenris
494
+     */
495
+    function make_nothing() {
496
+        return {
497
+            "kind": "nothing",
498
+            "parameters": {}
499
+        };
500
+    }
501
+    lib_maybe.make_nothing = make_nothing;
502
+    /**
503
+     * @author fenris
504
+     */
505
+    function make_just(value) {
506
+        return {
507
+            "kind": "just",
508
+            "parameters": {
509
+                "value": value
510
+            }
511
+        };
512
+    }
513
+    lib_maybe.make_just = make_just;
514
+    /**
515
+     * @author fenris
516
+     */
517
+    function is_nothing(maybe) {
518
+        return (maybe.kind === "nothing");
519
+    }
520
+    lib_maybe.is_nothing = is_nothing;
521
+    /**
522
+     * @author fenris
523
+     */
524
+    function is_just(maybe) {
525
+        return (maybe.kind === "just");
526
+    }
527
+    lib_maybe.is_just = is_just;
528
+    /**
529
+     * @author fenris
530
+     */
531
+    function cull(maybe) {
532
+        if (!is_just(maybe)) {
533
+            var message = "cull from nothing";
534
+            throw (new Error(message));
535
+        }
536
+        else {
537
+            var value = maybe.parameters["value"];
538
+            return value;
539
+        }
540
+    }
541
+    lib_maybe.cull = cull;
542
+    /**
543
+     * @author fenris
544
+     */
545
+    function propagate(maybe, function_) {
546
+        if (!is_just(maybe)) {
547
+        }
548
+        else {
549
+            var value = maybe.parameters["value"];
550
+            var maybe_ = function_(value);
551
+            return maybe_;
552
+        }
553
+    }
554
+    lib_maybe.propagate = propagate;
555
+})(lib_maybe || (lib_maybe = {}));
556
+/**
557
+ * @author fenris
558
+ */
559
+/*export*/ var class_maybe = /** @class */ (function () {
560
+    function class_maybe() {
561
+    }
562
+    /**
563
+     * @desc whether the wrapper is nothing
564
+     * @author fenris
565
+     */
566
+    class_maybe.prototype.is_nothing = function () {
567
+        throw (new Error("not implemented: class_maybe.is_nothing"));
568
+    };
569
+    /**
570
+     * @desc whether the wrapper is just
571
+     * @author fenris
572
+     */
573
+    class_maybe.prototype.is_just = function () {
574
+        throw (new Error("not implemented: class_maybe.is_just"));
575
+    };
576
+    /**
577
+     * @desc return the value, stored in the maybe-wrapper
578
+     * @author fenris
579
+     */
580
+    class_maybe.prototype.cull = function () {
581
+        throw (new Error("not implemented: class_maybe.cull"));
582
+    };
583
+    /**
584
+     * @author fenris
585
+     */
586
+    class_maybe.prototype.toString = function () {
587
+        throw (new Error("not implemented: class_maybe.cull"));
588
+    };
589
+    /**
590
+     * @author fenris
591
+     */
592
+    class_maybe.prototype.distinguish = function (action_just, action_nothing) {
593
+        if (action_nothing === void 0) { action_nothing = function () { }; }
594
+        throw (new Error("not implemented: class_maybe.distinguish"));
595
+    };
596
+    /**
597
+     * @author fenris
598
+     */
599
+    class_maybe.prototype.propagate = function (action) {
600
+        throw (new Error("not implemented: class_maybe.propagate"));
601
+    };
602
+    /**
603
+     * @desc [implementation]
604
+     * @author fenris
605
+     */
606
+    class_maybe.prototype._show = function () {
607
+        return this.toString();
608
+    };
609
+    return class_maybe;
610
+}());
611
+/**
612
+ * @author fenris
613
+ */
614
+/*export*/ var class_nothing = /** @class */ (function (_super) {
615
+    __extends(class_nothing, _super);
616
+    /**
617
+     * @author fenris
618
+     */
619
+    function class_nothing(reason) {
620
+        if (reason === void 0) { reason = null; }
621
+        var _this = _super.call(this) || this;
622
+        _this.reason = reason;
623
+        return _this;
624
+    }
625
+    /**
626
+     * @author fenris
627
+     */
628
+    class_nothing.prototype.is_nothing = function () {
629
+        return true;
630
+    };
631
+    /**
632
+     * @author fenris
633
+     */
634
+    class_nothing.prototype.is_just = function () {
635
+        return false;
636
+    };
637
+    /**
638
+     * @author fenris
639
+     */
640
+    class_nothing.prototype.cull = function () {
641
+        var message = "you shouldn't cull a nothing-value …";
642
+        lib_log.warn(message);
643
+        return null;
644
+    };
645
+    /**
646
+     * @author fenris
647
+     */
648
+    class_nothing.prototype.toString = function () {
649
+        return "<\u00B7>";
650
+    };
651
+    /**
652
+     * @author fenris
653
+     */
654
+    class_nothing.prototype.reason_get = function () {
655
+        var content = ((this.reason == null) ? "·" : this.reason);
656
+        return "<- " + content + " ->";
657
+    };
658
+    /**
659
+     * @author fenris
660
+     */
661
+    class_nothing.prototype.distinguish = function (action_just, action_nothing) {
662
+        if (action_nothing === void 0) { action_nothing = function () { }; }
663
+        action_nothing(this.reason);
664
+    };
665
+    /**
666
+     * @author fenris
667
+     */
668
+    class_nothing.prototype.propagate = function (action) {
669
+        return (new class_nothing(this.reason));
670
+    };
671
+    return class_nothing;
672
+}(class_maybe));
673
+/**
674
+ * @author fenris
675
+ */
676
+/*export*/ var class_just = /** @class */ (function (_super) {
677
+    __extends(class_just, _super);
678
+    /**
679
+     * @author fenris
680
+     */
681
+    function class_just(value) {
682
+        var _this = _super.call(this) || this;
683
+        _this.value = value;
684
+        return _this;
685
+    }
686
+    /**
687
+     * @author fenris
688
+     */
689
+    class_just.prototype.is_nothing = function () {
690
+        return false;
691
+    };
692
+    /**
693
+     * @author fenris
694
+     */
695
+    class_just.prototype.is_just = function () {
696
+        return true;
697
+    };
698
+    /**
699
+     * @author fenris
700
+     */
701
+    class_just.prototype.cull = function () {
702
+        return this.value;
703
+    };
704
+    /**
705
+     * @author fenris
706
+     */
707
+    class_just.prototype.toString = function () {
708
+        var content = instance_show(this.value);
709
+        return "<+ " + content + " +>";
710
+    };
711
+    /**
712
+     * @author fenris
713
+     */
714
+    class_just.prototype.distinguish = function (action_just, action_nothing) {
715
+        if (action_nothing === void 0) { action_nothing = function () { }; }
716
+        action_just(this.value);
717
+    };
718
+    /**
719
+     * @author fenris
720
+     */
721
+    class_just.prototype.propagate = function (action) {
722
+        return action(this.value);
723
+    };
724
+    return class_just;
725
+}(class_maybe));
726
+/*
727
+This file is part of »bacterio-plankton:base«.
728
+
729
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
730
+<info@greenscale.de>
731
+
732
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
733
+it under the terms of the GNU Lesser General Public License as published by
734
+the Free Software Foundation, either version 3 of the License, or
735
+(at your option) any later version.
736
+
737
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
738
+but WITHOUT ANY WARRANTY; without even the implied warranty of
739
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
740
+GNU Lesser General Public License for more details.
741
+
742
+You should have received a copy of the GNU Lesser General Public License
743
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
744
+ */
745
+/**
746
+ * @author frac
747
+ */
748
+var class_error = /** @class */ (function (_super) {
749
+    __extends(class_error, _super);
750
+    /**
751
+     * @author frac
752
+     */
753
+    function class_error(message, suberrors) {
754
+        if (suberrors === void 0) { suberrors = []; }
755
+        var _this = _super.call(this, message) || this;
756
+        _this.suberrors = suberrors;
757
+        _this.mess = message;
758
+        return _this;
759
+    }
760
+    /**
761
+     * @override
762
+     * @author frac
763
+     */
764
+    class_error.prototype.toString = function () {
765
+        return ( /*super.toString()*/this.mess + " " + ("[" + this.suberrors.map(function (x) { return x.toString(); }).join(",") + "]"));
766
+    };
767
+    return class_error;
768
+}(Error));
... ...
@@ -0,0 +1,861 @@
1
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2
+<info@greenscale.de>
3
+
4
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
5
+it under the terms of the GNU Lesser General Public License as published by
6
+the Free Software Foundation, either version 3 of the License, or
7
+(at your option) any later version.
8
+
9
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
10
+but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+GNU Lesser General Public License for more details.
13
+
14
+You should have received a copy of the GNU Lesser General Public License
15
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+
18
+
19
+                    GNU GENERAL PUBLIC LICENSE
20
+                       Version 3, 29 June 2007
21
+
22
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
23
+ Everyone is permitted to copy and distribute verbatim copies
24
+ of this license document, but changing it is not allowed.
25
+
26
+                            Preamble
27
+
28
+  The GNU General Public License is a free, copyleft license for
29
+software and other kinds of works.
30
+
31
+  The licenses for most software and other practical works are designed
32
+to take away your freedom to share and change the works.  By contrast,
33
+the GNU General Public License is intended to guarantee your freedom to
34
+share and change all versions of a program--to make sure it remains free
35
+software for all its users.  We, the Free Software Foundation, use the
36
+GNU General Public License for most of our software; it applies also to
37
+any other work released this way by its authors.  You can apply it to
38
+your programs, too.
39
+
40
+  When we speak of free software, we are referring to freedom, not
41
+price.  Our General Public Licenses are designed to make sure that you
42
+have the freedom to distribute copies of free software (and charge for
43
+them if you wish), that you receive source code or can get it if you
44
+want it, that you can change the software or use pieces of it in new
45
+free programs, and that you know you can do these things.
46
+
47
+  To protect your rights, we need to prevent others from denying you
48
+these rights or asking you to surrender the rights.  Therefore, you have
49
+certain responsibilities if you distribute copies of the software, or if
50
+you modify it: responsibilities to respect the freedom of others.
51
+
52
+  For example, if you distribute copies of such a program, whether
53
+gratis or for a fee, you must pass on to the recipients the same
54
+freedoms that you received.  You must make sure that they, too, receive
55
+or can get the source code.  And you must show them these terms so they
56
+know their rights.
57
+
58
+  Developers that use the GNU GPL protect your rights with two steps:
59
+(1) assert copyright on the software, and (2) offer you this License
60
+giving you legal permission to copy, distribute and/or modify it.
61
+
62
+  For the developers' and authors' protection, the GPL clearly explains
63
+that there is no warranty for this free software.  For both users' and
64
+authors' sake, the GPL requires that modified versions be marked as
65
+changed, so that their problems will not be attributed erroneously to
66
+authors of previous versions.
67
+
68
+  Some devices are designed to deny users access to install or run
69
+modified versions of the software inside them, although the manufacturer
70
+can do so.  This is fundamentally incompatible with the aim of
71
+protecting users' freedom to change the software.  The systematic
72
+pattern of such abuse occurs in the area of products for individuals to
73
+use, which is precisely where it is most unacceptable.  Therefore, we
74
+have designed this version of the GPL to prohibit the practice for those
75
+products.  If such problems arise substantially in other domains, we
76
+stand ready to extend this provision to those domains in future versions
77
+of the GPL, as needed to protect the freedom of users.
78
+
79
+  Finally, every program is threatened constantly by software patents.
80
+States should not allow patents to restrict development and use of
81
+software on general-purpose computers, but in those that do, we wish to
82
+avoid the special danger that patents applied to a free program could
83
+make it effectively proprietary.  To prevent this, the GPL assures that
84
+patents cannot be used to render the program non-free.
85
+
86
+  The precise terms and conditions for copying, distribution and
87
+modification follow.
88
+
89
+                       TERMS AND CONDITIONS
90
+
91
+  0. Definitions.
92
+
93
+  "This License" refers to version 3 of the GNU General Public License.
94
+
95
+  "Copyright" also means copyright-like laws that apply to other kinds of
96
+works, such as semiconductor masks.
97
+
98
+  "The Program" refers to any copyrightable work licensed under this
99
+License.  Each licensee is addressed as "you".  "Licensees" and
100
+"recipients" may be individuals or organizations.
101
+
102
+  To "modify" a work means to copy from or adapt all or part of the work
103
+in a fashion requiring copyright permission, other than the making of an
104
+exact copy.  The resulting work is called a "modified version" of the
105
+earlier work or a work "based on" the earlier work.
106
+
107
+  A "covered work" means either the unmodified Program or a work based
108
+on the Program.
109
+
110
+  To "propagate" a work means to do anything with it that, without
111
+permission, would make you directly or secondarily liable for
112
+infringement under applicable copyright law, except executing it on a
113
+computer or modifying a private copy.  Propagation includes copying,
114
+distribution (with or without modification), making available to the
115
+public, and in some countries other activities as well.
116
+
117
+  To "convey" a work means any kind of propagation that enables other
118
+parties to make or receive copies.  Mere interaction with a user through
119
+a computer network, with no transfer of a copy, is not conveying.
120
+
121
+  An interactive user interface displays "Appropriate Legal Notices"
122
+to the extent that it includes a convenient and prominently visible
123
+feature that (1) displays an appropriate copyright notice, and (2)
124
+tells the user that there is no warranty for the work (except to the
125
+extent that warranties are provided), that licensees may convey the
126
+work under this License, and how to view a copy of this License.  If
127
+the interface presents a list of user commands or options, such as a
128
+menu, a prominent item in the list meets this criterion.
129
+
130
+  1. Source Code.
131
+
132
+  The "source code" for a work means the preferred form of the work
133
+for making modifications to it.  "Object code" means any non-source
134
+form of a work.
135
+
136
+  A "Standard Interface" means an interface that either is an official
137
+standard defined by a recognized standards body, or, in the case of
138
+interfaces specified for a particular programming language, one that
139
+is widely used among developers working in that language.
140
+
141
+  The "System Libraries" of an executable work include anything, other
142
+than the work as a whole, that (a) is included in the normal form of
143
+packaging a Major Component, but which is not part of that Major
144
+Component, and (b) serves only to enable use of the work with that
145
+Major Component, or to implement a Standard Interface for which an
146
+implementation is available to the public in source code form.  A
147
+"Major Component", in this context, means a major essential component
148
+(kernel, window system, and so on) of the specific operating system
149
+(if any) on which the executable work runs, or a compiler used to
150
+produce the work, or an object code interpreter used to run it.
151
+
152
+  The "Corresponding Source" for a work in object code form means all
153
+the source code needed to generate, install, and (for an executable
154
+work) run the object code and to modify the work, including scripts to
155
+control those activities.  However, it does not include the work's
156
+System Libraries, or general-purpose tools or generally available free
157
+programs which are used unmodified in performing those activities but
158
+which are not part of the work.  For example, Corresponding Source
159
+includes interface definition files associated with source files for
160
+the work, and the source code for shared libraries and dynamically
161
+linked subprograms that the work is specifically designed to require,
162
+such as by intimate data communication or control flow between those
163
+subprograms and other parts of the work.
164
+
165
+  The Corresponding Source need not include anything that users
166
+can regenerate automatically from other parts of the Corresponding
167
+Source.
168
+
169
+  The Corresponding Source for a work in source code form is that
170
+same work.
171
+
172
+  2. Basic Permissions.
173
+
174
+  All rights granted under this License are granted for the term of
175
+copyright on the Program, and are irrevocable provided the stated
176
+conditions are met.  This License explicitly affirms your unlimited
177
+permission to run the unmodified Program.  The output from running a
178
+covered work is covered by this License only if the output, given its
179
+content, constitutes a covered work.  This License acknowledges your
180
+rights of fair use or other equivalent, as provided by copyright law.
181
+
182
+  You may make, run and propagate covered works that you do not
183
+convey, without conditions so long as your license otherwise remains
184
+in force.  You may convey covered works to others for the sole purpose
185
+of having them make modifications exclusively for you, or provide you
186
+with facilities for running those works, provided that you comply with
187
+the terms of this License in conveying all material for which you do
188
+not control copyright.  Those thus making or running the covered works
189
+for you must do so exclusively on your behalf, under your direction
190
+and control, on terms that prohibit them from making any copies of
191
+your copyrighted material outside their relationship with you.
192
+
193
+  Conveying under any other circumstances is permitted solely under
194
+the conditions stated below.  Sublicensing is not allowed; section 10
195
+makes it unnecessary.
196
+
197
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
198
+
199
+  No covered work shall be deemed part of an effective technological
200
+measure under any applicable law fulfilling obligations under article
201
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
202
+similar laws prohibiting or restricting circumvention of such
203
+measures.
204
+
205
+  When you convey a covered work, you waive any legal power to forbid
206
+circumvention of technological measures to the extent such circumvention
207
+is effected by exercising rights under this License with respect to
208
+the covered work, and you disclaim any intention to limit operation or
209
+modification of the work as a means of enforcing, against the work's
210
+users, your or third parties' legal rights to forbid circumvention of
211
+technological measures.
212
+
213
+  4. Conveying Verbatim Copies.
214
+
215
+  You may convey verbatim copies of the Program's source code as you
216
+receive it, in any medium, provided that you conspicuously and
217
+appropriately publish on each copy an appropriate copyright notice;
218
+keep intact all notices stating that this License and any
219
+non-permissive terms added in accord with section 7 apply to the code;
220
+keep intact all notices of the absence of any warranty; and give all
221
+recipients a copy of this License along with the Program.
222
+
223
+  You may charge any price or no price for each copy that you convey,
224
+and you may offer support or warranty protection for a fee.
225
+
226
+  5. Conveying Modified Source Versions.
227
+
228
+  You may convey a work based on the Program, or the modifications to
229
+produce it from the Program, in the form of source code under the
230
+terms of section 4, provided that you also meet all of these conditions:
231
+
232
+    a) The work must carry prominent notices stating that you modified
233
+    it, and giving a relevant date.
234
+
235
+    b) The work must carry prominent notices stating that it is
236
+    released under this License and any conditions added under section
237
+    7.  This requirement modifies the requirement in section 4 to
238
+    "keep intact all notices".
239
+
240
+    c) You must license the entire work, as a whole, under this
241
+    License to anyone who comes into possession of a copy.  This
242
+    License will therefore apply, along with any applicable section 7
243
+    additional terms, to the whole of the work, and all its parts,
244
+    regardless of how they are packaged.  This License gives no
245
+    permission to license the work in any other way, but it does not
246
+    invalidate such permission if you have separately received it.
247
+
248
+    d) If the work has interactive user interfaces, each must display
249
+    Appropriate Legal Notices; however, if the Program has interactive
250
+    interfaces that do not display Appropriate Legal Notices, your
251
+    work need not make them do so.
252
+
253
+  A compilation of a covered work with other separate and independent
254
+works, which are not by their nature extensions of the covered work,
255
+and which are not combined with it such as to form a larger program,
256
+in or on a volume of a storage or distribution medium, is called an
257
+"aggregate" if the compilation and its resulting copyright are not
258
+used to limit the access or legal rights of the compilation's users
259
+beyond what the individual works permit.  Inclusion of a covered work
260
+in an aggregate does not cause this License to apply to the other
261
+parts of the aggregate.
262
+
263
+  6. Conveying Non-Source Forms.
264
+
265
+  You may convey a covered work in object code form under the terms
266
+of sections 4 and 5, provided that you also convey the
267
+machine-readable Corresponding Source under the terms of this License,
268
+in one of these ways:
269
+
270
+    a) Convey the object code in, or embodied in, a physical product
271
+    (including a physical distribution medium), accompanied by the
272
+    Corresponding Source fixed on a durable physical medium
273
+    customarily used for software interchange.
274
+
275
+    b) Convey the object code in, or embodied in, a physical product
276
+    (including a physical distribution medium), accompanied by a
277
+    written offer, valid for at least three years and valid for as
278
+    long as you offer spare parts or customer support for that product
279
+    model, to give anyone who possesses the object code either (1) a
280
+    copy of the Corresponding Source for all the software in the
281
+    product that is covered by this License, on a durable physical
282
+    medium customarily used for software interchange, for a price no
283
+    more than your reasonable cost of physically performing this
284
+    conveying of source, or (2) access to copy the
285
+    Corresponding Source from a network server at no charge.
286
+
287
+    c) Convey individual copies of the object code with a copy of the
288
+    written offer to provide the Corresponding Source.  This
289
+    alternative is allowed only occasionally and noncommercially, and
290
+    only if you received the object code with such an offer, in accord
291
+    with subsection 6b.
292
+
293
+    d) Convey the object code by offering access from a designated
294
+    place (gratis or for a charge), and offer equivalent access to the
295
+    Corresponding Source in the same way through the same place at no
296
+    further charge.  You need not require recipients to copy the
297
+    Corresponding Source along with the object code.  If the place to
298
+    copy the object code is a network server, the Corresponding Source
299
+    may be on a different server (operated by you or a third party)
300
+    that supports equivalent copying facilities, provided you maintain
301
+    clear directions next to the object code saying where to find the
302
+    Corresponding Source.  Regardless of what server hosts the
303
+    Corresponding Source, you remain obligated to ensure that it is
304
+    available for as long as needed to satisfy these requirements.
305
+
306
+    e) Convey the object code using peer-to-peer transmission, provided
307
+    you inform other peers where the object code and Corresponding
308
+    Source of the work are being offered to the general public at no
309
+    charge under subsection 6d.
310
+
311
+  A separable portion of the object code, whose source code is excluded
312
+from the Corresponding Source as a System Library, need not be
313
+included in conveying the object code work.
314
+
315
+  A "User Product" is either (1) a "consumer product", which means any
316
+tangible personal property which is normally used for personal, family,
317
+or household purposes, or (2) anything designed or sold for incorporation
318
+into a dwelling.  In determining whether a product is a consumer product,
319
+doubtful cases shall be resolved in favor of coverage.  For a particular
320
+product received by a particular user, "normally used" refers to a
321
+typical or common use of that class of product, regardless of the status
322
+of the particular user or of the way in which the particular user
323
+actually uses, or expects or is expected to use, the product.  A product
324
+is a consumer product regardless of whether the product has substantial
325
+commercial, industrial or non-consumer uses, unless such uses represent
326
+the only significant mode of use of the product.
327
+
328
+  "Installation Information" for a User Product means any methods,
329
+procedures, authorization keys, or other information required to install
330
+and execute modified versions of a covered work in that User Product from
331
+a modified version of its Corresponding Source.  The information must
332
+suffice to ensure that the continued functioning of the modified object
333
+code is in no case prevented or interfered with solely because
334
+modification has been made.
335
+
336
+  If you convey an object code work under this section in, or with, or
337
+specifically for use in, a User Product, and the conveying occurs as
338
+part of a transaction in which the right of possession and use of the
339
+User Product is transferred to the recipient in perpetuity or for a
340
+fixed term (regardless of how the transaction is characterized), the
341
+Corresponding Source conveyed under this section must be accompanied
342
+by the Installation Information.  But this requirement does not apply
343
+if neither you nor any third party retains the ability to install
344
+modified object code on the User Product (for example, the work has
345
+been installed in ROM).
346
+
347
+  The requirement to provide Installation Information does not include a
348
+requirement to continue to provide support service, warranty, or updates
349
+for a work that has been modified or installed by the recipient, or for
350
+the User Product in which it has been modified or installed.  Access to a
351
+network may be denied when the modification itself materially and
352
+adversely affects the operation of the network or violates the rules and
353
+protocols for communication across the network.
354
+
355
+  Corresponding Source conveyed, and Installation Information provided,
356
+in accord with this section must be in a format that is publicly
357
+documented (and with an implementation available to the public in
358
+source code form), and must require no special password or key for
359
+unpacking, reading or copying.
360
+
361
+  7. Additional Terms.
362
+
363
+  "Additional permissions" are terms that supplement the terms of this
364
+License by making exceptions from one or more of its conditions.
365
+Additional permissions that are applicable to the entire Program shall
366
+be treated as though they were included in this License, to the extent
367
+that they are valid under applicable law.  If additional permissions
368
+apply only to part of the Program, that part may be used separately
369
+under those permissions, but the entire Program remains governed by
370
+this License without regard to the additional permissions.
371
+
372
+  When you convey a copy of a covered work, you may at your option
373
+remove any additional permissions from that copy, or from any part of
374
+it.  (Additional permissions may be written to require their own
375
+removal in certain cases when you modify the work.)  You may place
376
+additional permissions on material, added by you to a covered work,
377
+for which you have or can give appropriate copyright permission.
378
+
379
+  Notwithstanding any other provision of this License, for material you
380
+add to a covered work, you may (if authorized by the copyright holders of
381
+that material) supplement the terms of this License with terms:
382
+
383
+    a) Disclaiming warranty or limiting liability differently from the
384
+    terms of sections 15 and 16 of this License; or
385
+
386
+    b) Requiring preservation of specified reasonable legal notices or
387
+    author attributions in that material or in the Appropriate Legal
388
+    Notices displayed by works containing it; or
389
+
390
+    c) Prohibiting misrepresentation of the origin of that material, or
391
+    requiring that modified versions of such material be marked in
392
+    reasonable ways as different from the original version; or
393
+
394
+    d) Limiting the use for publicity purposes of names of licensors or
395
+    authors of the material; or
396
+
397
+    e) Declining to grant rights under trademark law for use of some
398
+    trade names, trademarks, or service marks; or
399
+
400
+    f) Requiring indemnification of licensors and authors of that
401
+    material by anyone who conveys the material (or modified versions of
402
+    it) with contractual assumptions of liability to the recipient, for
403
+    any liability that these contractual assumptions directly impose on
404
+    those licensors and authors.
405
+
406
+  All other non-permissive additional terms are considered "further
407
+restrictions" within the meaning of section 10.  If the Program as you
408
+received it, or any part of it, contains a notice stating that it is
409
+governed by this License along with a term that is a further
410
+restriction, you may remove that term.  If a license document contains
411
+a further restriction but permits relicensing or conveying under this
412
+License, you may add to a covered work material governed by the terms
413
+of that license document, provided that the further restriction does
414
+not survive such relicensing or conveying.
415
+
416
+  If you add terms to a covered work in accord with this section, you
417
+must place, in the relevant source files, a statement of the
418
+additional terms that apply to those files, or a notice indicating
419
+where to find the applicable terms.
420
+
421
+  Additional terms, permissive or non-permissive, may be stated in the
422
+form of a separately written license, or stated as exceptions;
423
+the above requirements apply either way.
424
+
425
+  8. Termination.
426
+
427
+  You may not propagate or modify a covered work except as expressly
428
+provided under this License.  Any attempt otherwise to propagate or
429
+modify it is void, and will automatically terminate your rights under
430
+this License (including any patent licenses granted under the third
431
+paragraph of section 11).
432
+
433
+  However, if you cease all violation of this License, then your
434
+license from a particular copyright holder is reinstated (a)
435
+provisionally, unless and until the copyright holder explicitly and
436
+finally terminates your license, and (b) permanently, if the copyright
437
+holder fails to notify you of the violation by some reasonable means
438
+prior to 60 days after the cessation.
439
+
440
+  Moreover, your license from a particular copyright holder is
441
+reinstated permanently if the copyright holder notifies you of the
442
+violation by some reasonable means, this is the first time you have
443
+received notice of violation of this License (for any work) from that
444
+copyright holder, and you cure the violation prior to 30 days after
445
+your receipt of the notice.
446
+
447
+  Termination of your rights under this section does not terminate the
448
+licenses of parties who have received copies or rights from you under
449
+this License.  If your rights have been terminated and not permanently
450
+reinstated, you do not qualify to receive new licenses for the same
451
+material under section 10.
452
+
453
+  9. Acceptance Not Required for Having Copies.
454
+
455
+  You are not required to accept this License in order to receive or
456
+run a copy of the Program.  Ancillary propagation of a covered work
457
+occurring solely as a consequence of using peer-to-peer transmission
458
+to receive a copy likewise does not require acceptance.  However,
459
+nothing other than this License grants you permission to propagate or
460
+modify any covered work.  These actions infringe copyright if you do
461
+not accept this License.  Therefore, by modifying or propagating a
462
+covered work, you indicate your acceptance of this License to do so.
463
+
464
+  10. Automatic Licensing of Downstream Recipients.
465
+
466
+  Each time you convey a covered work, the recipient automatically
467
+receives a license from the original licensors, to run, modify and
468
+propagate that work, subject to this License.  You are not responsible
469
+for enforcing compliance by third parties with this License.
470
+
471
+  An "entity transaction" is a transaction transferring control of an
472
+organization, or substantially all assets of one, or subdividing an
473
+organization, or merging organizations.  If propagation of a covered
474
+work results from an entity transaction, each party to that
475
+transaction who receives a copy of the work also receives whatever
476
+licenses to the work the party's predecessor in interest had or could
477
+give under the previous paragraph, plus a right to possession of the
478
+Corresponding Source of the work from the predecessor in interest, if
479
+the predecessor has it or can get it with reasonable efforts.
480
+
481
+  You may not impose any further restrictions on the exercise of the
482
+rights granted or affirmed under this License.  For example, you may
483
+not impose a license fee, royalty, or other charge for exercise of
484
+rights granted under this License, and you may not initiate litigation
485
+(including a cross-claim or counterclaim in a lawsuit) alleging that
486
+any patent claim is infringed by making, using, selling, offering for
487
+sale, or importing the Program or any portion of it.
488
+
489
+  11. Patents.
490
+
491
+  A "contributor" is a copyright holder who authorizes use under this
492
+License of the Program or a work on which the Program is based.  The
493
+work thus licensed is called the contributor's "contributor version".
494
+
495
+  A contributor's "essential patent claims" are all patent claims
496
+owned or controlled by the contributor, whether already acquired or
497
+hereafter acquired, that would be infringed by some manner, permitted
498
+by this License, of making, using, or selling its contributor version,
499
+but do not include claims that would be infringed only as a
500
+consequence of further modification of the contributor version.  For
501
+purposes of this definition, "control" includes the right to grant
502
+patent sublicenses in a manner consistent with the requirements of
503
+this License.
504
+
505
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
506
+patent license under the contributor's essential patent claims, to
507
+make, use, sell, offer for sale, import and otherwise run, modify and
508
+propagate the contents of its contributor version.
509
+
510
+  In the following three paragraphs, a "patent license" is any express
511
+agreement or commitment, however denominated, not to enforce a patent
512
+(such as an express permission to practice a patent or covenant not to
513
+sue for patent infringement).  To "grant" such a patent license to a
514
+party means to make such an agreement or commitment not to enforce a
515
+patent against the party.
516
+
517
+  If you convey a covered work, knowingly relying on a patent license,
518
+and the Corresponding Source of the work is not available for anyone
519
+to copy, free of charge and under the terms of this License, through a
520
+publicly available network server or other readily accessible means,
521
+then you must either (1) cause the Corresponding Source to be so
522
+available, or (2) arrange to deprive yourself of the benefit of the
523
+patent license for this particular work, or (3) arrange, in a manner
524
+consistent with the requirements of this License, to extend the patent
525
+license to downstream recipients.  "Knowingly relying" means you have
526
+actual knowledge that, but for the patent license, your conveying the
527
+covered work in a country, or your recipient's use of the covered work
528
+in a country, would infringe one or more identifiable patents in that
529
+country that you have reason to believe are valid.
530
+
531
+  If, pursuant to or in connection with a single transaction or
532
+arrangement, you convey, or propagate by procuring conveyance of, a
533
+covered work, and grant a patent license to some of the parties
534
+receiving the covered work authorizing them to use, propagate, modify
535
+or convey a specific copy of the covered work, then the patent license
536
+you grant is automatically extended to all recipients of the covered
537
+work and works based on it.
538
+
539
+  A patent license is "discriminatory" if it does not include within
540
+the scope of its coverage, prohibits the exercise of, or is
541
+conditioned on the non-exercise of one or more of the rights that are
542
+specifically granted under this License.  You may not convey a covered
543
+work if you are a party to an arrangement with a third party that is
544
+in the business of distributing software, under which you make payment
545
+to the third party based on the extent of your activity of conveying
546
+the work, and under which the third party grants, to any of the
547
+parties who would receive the covered work from you, a discriminatory
548
+patent license (a) in connection with copies of the covered work
549
+conveyed by you (or copies made from those copies), or (b) primarily
550
+for and in connection with specific products or compilations that
551
+contain the covered work, unless you entered into that arrangement,
552
+or that patent license was granted, prior to 28 March 2007.
553
+
554
+  Nothing in this License shall be construed as excluding or limiting
555
+any implied license or other defenses to infringement that may
556
+otherwise be available to you under applicable patent law.
557
+
558
+  12. No Surrender of Others' Freedom.
559
+
560
+  If conditions are imposed on you (whether by court order, agreement or
561
+otherwise) that contradict the conditions of this License, they do not
562
+excuse you from the conditions of this License.  If you cannot convey a
563
+covered work so as to satisfy simultaneously your obligations under this
564
+License and any other pertinent obligations, then as a consequence you may
565
+not convey it at all.  For example, if you agree to terms that obligate you
566
+to collect a royalty for further conveying from those to whom you convey
567
+the Program, the only way you could satisfy both those terms and this
568
+License would be to refrain entirely from conveying the Program.
569
+
570
+  13. Use with the GNU Affero General Public License.
571
+
572
+  Notwithstanding any other provision of this License, you have
573
+permission to link or combine any covered work with a work licensed
574
+under version 3 of the GNU Affero General Public License into a single
575
+combined work, and to convey the resulting work.  The terms of this
576
+License will continue to apply to the part which is the covered work,
577
+but the special requirements of the GNU Affero General Public License,
578
+section 13, concerning interaction through a network will apply to the
579
+combination as such.
580
+
581
+  14. Revised Versions of this License.
582
+
583
+  The Free Software Foundation may publish revised and/or new versions of
584
+the GNU General Public License from time to time.  Such new versions will
585
+be similar in spirit to the present version, but may differ in detail to
586
+address new problems or concerns.
587
+
588
+  Each version is given a distinguishing version number.  If the
589
+Program specifies that a certain numbered version of the GNU General
590
+Public License "or any later version" applies to it, you have the
591
+option of following the terms and conditions either of that numbered
592
+version or of any later version published by the Free Software
593
+Foundation.  If the Program does not specify a version number of the
594
+GNU General Public License, you may choose any version ever published
595
+by the Free Software Foundation.
596
+
597
+  If the Program specifies that a proxy can decide which future
598
+versions of the GNU General Public License can be used, that proxy's
599
+public statement of acceptance of a version permanently authorizes you
600
+to choose that version for the Program.
601
+
602
+  Later license versions may give you additional or different
603
+permissions.  However, no additional obligations are imposed on any
604
+author or copyright holder as a result of your choosing to follow a
605
+later version.
606
+
607
+  15. Disclaimer of Warranty.
608
+
609
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
610
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
611
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
612
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
613
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
614
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
615
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
616
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
617
+
618
+  16. Limitation of Liability.
619
+
620
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
621
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
622
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
623
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
624
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
625
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
626
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
627
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
628
+SUCH DAMAGES.
629
+
630
+  17. Interpretation of Sections 15 and 16.
631
+
632
+  If the disclaimer of warranty and limitation of liability provided
633
+above cannot be given local legal effect according to their terms,
634
+reviewing courts shall apply local law that most closely approximates
635
+an absolute waiver of all civil liability in connection with the
636
+Program, unless a warranty or assumption of liability accompanies a
637
+copy of the Program in return for a fee.
638
+
639
+                     END OF TERMS AND CONDITIONS
640
+
641
+            How to Apply These Terms to Your New Programs
642
+
643
+  If you develop a new program, and you want it to be of the greatest
644
+possible use to the public, the best way to achieve this is to make it
645
+free software which everyone can redistribute and change under these terms.
646
+
647
+  To do so, attach the following notices to the program.  It is safest
648
+to attach them to the start of each source file to most effectively
649
+state the exclusion of warranty; and each file should have at least
650
+the "copyright" line and a pointer to where the full notice is found.
651
+
652
+    <one line to give the program's name and a brief idea of what it does.>
653
+    Copyright (C) <year>  <name of author>
654
+
655
+    This program is free software: you can redistribute it and/or modify
656
+    it under the terms of the GNU General Public License as published by
657
+    the Free Software Foundation, either version 3 of the License, or
658
+    (at your option) any later version.
659
+
660
+    This program is distributed in the hope that it will be useful,
661
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
662
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
663
+    GNU General Public License for more details.
664
+
665
+    You should have received a copy of the GNU General Public License
666
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
667
+
668
+Also add information on how to contact you by electronic and paper mail.
669
+
670
+  If the program does terminal interaction, make it output a short
671
+notice like this when it starts in an interactive mode:
672
+
673
+    <program>  Copyright (C) <year>  <name of author>
674
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
675
+    This is free software, and you are welcome to redistribute it
676
+    under certain conditions; type `show c' for details.
677
+
678
+The hypothetical commands `show w' and `show c' should show the appropriate
679
+parts of the General Public License.  Of course, your program's commands
680
+might be different; for a GUI interface, you would use an "about box".
681
+
682
+  You should also get your employer (if you work as a programmer) or school,
683
+if any, to sign a "copyright disclaimer" for the program, if necessary.
684
+For more information on this, and how to apply and follow the GNU GPL, see
685
+<https://www.gnu.org/licenses/>.
686
+
687
+  The GNU General Public License does not permit incorporating your program
688
+into proprietary programs.  If your program is a subroutine library, you
689
+may consider it more useful to permit linking proprietary applications with
690
+the library.  If this is what you want to do, use the GNU Lesser General
691
+Public License instead of this License.  But first, please read
692
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
693
+
694
+
695
+
696
+                   GNU LESSER GENERAL PUBLIC LICENSE
697
+                       Version 3, 29 June 2007
698
+
699
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
700
+ Everyone is permitted to copy and distribute verbatim copies
701
+ of this license document, but changing it is not allowed.
702
+
703
+
704
+  This version of the GNU Lesser General Public License incorporates
705
+the terms and conditions of version 3 of the GNU General Public
706
+License, supplemented by the additional permissions listed below.
707
+
708
+  0. Additional Definitions.
709
+
710
+  As used herein, "this License" refers to version 3 of the GNU Lesser
711
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
712
+General Public License.
713
+
714
+  "The Library" refers to a covered work governed by this License,
715
+other than an Application or a Combined Work as defined below.
716
+
717
+  An "Application" is any work that makes use of an interface provided
718
+by the Library, but which is not otherwise based on the Library.
719
+Defining a subclass of a class defined by the Library is deemed a mode
720
+of using an interface provided by the Library.
721
+
722
+  A "Combined Work" is a work produced by combining or linking an
723
+Application with the Library.  The particular version of the Library
724
+with which the Combined Work was made is also called the "Linked
725
+Version".
726
+
727
+  The "Minimal Corresponding Source" for a Combined Work means the
728
+Corresponding Source for the Combined Work, excluding any source code
729
+for portions of the Combined Work that, considered in isolation, are
730
+based on the Application, and not on the Linked Version.
731
+
732
+  The "Corresponding Application Code" for a Combined Work means the
733
+object code and/or source code for the Application, including any data
734
+and utility programs needed for reproducing the Combined Work from the
735
+Application, but excluding the System Libraries of the Combined Work.
736
+
737
+  1. Exception to Section 3 of the GNU GPL.
738
+
739
+  You may convey a covered work under sections 3 and 4 of this License
740
+without being bound by section 3 of the GNU GPL.
741
+
742
+  2. Conveying Modified Versions.
743
+
744
+  If you modify a copy of the Library, and, in your modifications, a
745
+facility refers to a function or data to be supplied by an Application
746
+that uses the facility (other than as an argument passed when the
747
+facility is invoked), then you may convey a copy of the modified
748
+version:
749
+
750
+   a) under this License, provided that you make a good faith effort to
751
+   ensure that, in the event an Application does not supply the
752
+   function or data, the facility still operates, and performs
753
+   whatever part of its purpose remains meaningful, or
754
+
755
+   b) under the GNU GPL, with none of the additional permissions of
756
+   this License applicable to that copy.
757
+
758
+  3. Object Code Incorporating Material from Library Header Files.
759
+
760
+  The object code form of an Application may incorporate material from
761
+a header file that is part of the Library.  You may convey such object
762
+code under terms of your choice, provided that, if the incorporated
763
+material is not limited to numerical parameters, data structure
764
+layouts and accessors, or small macros, inline functions and templates
765
+(ten or fewer lines in length), you do both of the following:
766
+
767
+   a) Give prominent notice with each copy of the object code that the
768
+   Library is used in it and that the Library and its use are
769
+   covered by this License.
770
+
771
+   b) Accompany the object code with a copy of the GNU GPL and this license
772
+   document.
773
+
774
+  4. Combined Works.
775
+
776
+  You may convey a Combined Work under terms of your choice that,
777
+taken together, effectively do not restrict modification of the
778
+portions of the Library contained in the Combined Work and reverse
779
+engineering for debugging such modifications, if you also do each of
780
+the following:
781
+
782
+   a) Give prominent notice with each copy of the Combined Work that
783
+   the Library is used in it and that the Library and its use are
784
+   covered by this License.
785
+
786
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
787
+   document.
788
+
789
+   c) For a Combined Work that displays copyright notices during
790
+   execution, include the copyright notice for the Library among
791
+   these notices, as well as a reference directing the user to the
792
+   copies of the GNU GPL and this license document.
793
+
794
+   d) Do one of the following:
795
+
796
+       0) Convey the Minimal Corresponding Source under the terms of this
797
+       License, and the Corresponding Application Code in a form
798
+       suitable for, and under terms that permit, the user to
799
+       recombine or relink the Application with a modified version of
800
+       the Linked Version to produce a modified Combined Work, in the
801
+       manner specified by section 6 of the GNU GPL for conveying
802
+       Corresponding Source.
803
+
804
+       1) Use a suitable shared library mechanism for linking with the
805
+       Library.  A suitable mechanism is one that (a) uses at run time
806
+       a copy of the Library already present on the user's computer
807
+       system, and (b) will operate properly with a modified version
808
+       of the Library that is interface-compatible with the Linked
809
+       Version.
810
+
811
+   e) Provide Installation Information, but only if you would otherwise
812
+   be required to provide such information under section 6 of the
813
+   GNU GPL, and only to the extent that such information is
814
+   necessary to install and execute a modified version of the
815
+   Combined Work produced by recombining or relinking the
816
+   Application with a modified version of the Linked Version. (If
817
+   you use option 4d0, the Installation Information must accompany
818
+   the Minimal Corresponding Source and Corresponding Application
819
+   Code. If you use option 4d1, you must provide the Installation
820
+   Information in the manner specified by section 6 of the GNU GPL
821
+   for conveying Corresponding Source.)
822
+
823
+  5. Combined Libraries.
824
+
825
+  You may place library facilities that are a work based on the
826
+Library side by side in a single library together with other library
827
+facilities that are not Applications and are not covered by this
828
+License, and convey such a combined library under terms of your
829
+choice, if you do both of the following:
830
+
831
+   a) Accompany the combined library with a copy of the same work based
832
+   on the Library, uncombined with any other library facilities,
833
+   conveyed under the terms of this License.
834
+
835
+   b) Give prominent notice with the combined library that part of it
836
+   is a work based on the Library, and explaining where to find the
837
+   accompanying uncombined form of the same work.
838
+
839
+  6. Revised Versions of the GNU Lesser General Public License.
840
+
841
+  The Free Software Foundation may publish revised and/or new versions
842
+of the GNU Lesser General Public License from time to time. Such new
843
+versions will be similar in spirit to the present version, but may
844
+differ in detail to address new problems or concerns.
845
+
846
+  Each version is given a distinguishing version number. If the
847
+Library as you received it specifies that a certain numbered version
848
+of the GNU Lesser General Public License "or any later version"
849
+applies to it, you have the option of following the terms and
850
+conditions either of that published version or of any later version
851
+published by the Free Software Foundation. If the Library as you
852
+received it does not specify a version number of the GNU Lesser
853
+General Public License, you may choose any version of the GNU Lesser
854
+General Public License ever published by the Free Software Foundation.
855
+
856
+  If the Library as you received it specifies that a proxy can decide
857
+whether future versions of the GNU Lesser General Public License shall
858
+apply, that proxy's public statement of acceptance of any version is
859
+permanent authorization for you to choose that version for the
860
+Library.
861
+
... ...
@@ -0,0 +1,394 @@
1
+declare module lib_call {
2
+    /**
3
+     * @desc hacked class for postfix function application
4
+     * @author fenris
5
+     */
6
+    class class_valuewrapper<type_value> {
7
+        /**
8
+         * @author fenris
9
+         */
10
+        protected value: type_value;
11
+        /**
12
+         * @desc [constructor]
13
+         * @author fenris
14
+         */
15
+        constructor(value: type_value);
16
+        /**
17
+         * @desc [accessor] applies a function and returns a new valuewrapper
18
+         * @author fenris
19
+         */
20
+        pass<type_value_>(function_: (value: type_value) => type_value_): class_valuewrapper<type_value_>;
21
+        /**
22
+         * @desc [accessor] gives the wrapped value
23
+         * @author fenris
24
+         */
25
+        extract(): type_value;
26
+    }
27
+    /**
28
+     * @desc shortcut for constructing a valuewrapper-object
29
+     * @author fenris
30
+     */
31
+    function vw<type_value>(value: type_value): class_valuewrapper<type_value>;
32
+    /**
33
+     * @author fenris
34
+     */
35
+    function use<type_input, type_output>(input: type_input, function_: (input: type_input) => type_output): type_output;
36
+    /**
37
+     * @desc just the identity; useful for some callbacks etc.
38
+     * @author fenris
39
+     */
40
+    function id<type_value>(x: type_value): type_value;
41
+    /**
42
+     * @desc composes two functions (i.e. returns a function that return the result of the successive execution of both input-functions)
43
+     * @param {function} function_f
44
+     * @param {function} function_g
45
+     * @author fenris
46
+     */
47
+    function compose<type_x, type_y, type_z>(function_f: (type_x: any) => type_y, function_g: (type_y: any) => type_z): (value: type_x) => type_z;
48
+    /**
49
+     * @desc transforms a function with sequential input into a function with leveled input; example: add(2,3) = curryfy(add)(2)(3)
50
+     * @param {function} f
51
+     * @param {int} n (don't set manually)
52
+     * @return {function} the currified version of the in put function
53
+     * @author fenris
54
+     */
55
+    function curryfy(f: Function, n?: int): Function;
56
+}
57
+declare module lib_call {
58
+    /**
59
+     * @author fenris
60
+     */
61
+    type type_executor<type_result, type_reason> = ((resolve: (result?: type_result) => any, reject?: (reason?: type_reason) => void) => void);
62
+    /**
63
+     * @author fenris
64
+     */
65
+    function executor_resolve<type_result, type_reason>(result: type_result): type_executor<type_result, type_reason>;
66
+    /**
67
+     * @author fenris
68
+     */
69
+    function executor_reject<type_result, type_reason>(reason: type_reason): type_executor<type_result, type_reason>;
70
+    /**
71
+     * @author fenris
72
+     */
73
+    function executor_transform<type_result_from, type_error_from, type_result_to, type_error_to>(executor: type_executor<type_result_from, type_error_from>, transform_result: (result_from: type_result_from) => type_result_to, transform_reason: (error_from: type_error_from) => type_error_to): type_executor<type_result_to, type_error_to>;
74
+    /**
75
+     * @author fenris
76
+     */
77
+    function executor_transform_default<type_result_from, type_result_to>(executor: type_executor<type_result_from, Error>, transform_result: (result_from: type_result_from) => type_result_to, wrap_string?: string): type_executor<type_result_to, Error>;
78
+    /**
79
+     * @author fenris
80
+     */
81
+    function executor_compose_sequential<type_result_first, type_result_second, type_reason>(first: type_executor<type_result_first, type_reason>, second: (result: type_result_first) => type_executor<type_result_second, type_reason>): type_executor<type_result_second, type_reason>;
82
+    /**
83
+     * @author fenris
84
+     */
85
+    function executor_chain<type_state, type_error>(state: type_state, executors: Array<(state: type_state) => type_executor<type_state, type_error>>): type_executor<type_state, type_error>;
86
+    /**
87
+     * @author fenris
88
+     */
89
+    function executor_first<type_result, type_reason>(executors: Array<type_executor<type_result, type_reason>>): type_executor<type_result, Array<type_reason>>;
90
+    /**
91
+     * @author fenris
92
+     */
93
+    function executor_condense<type_element>(executors: Array<type_executor<type_element, Error>>): type_executor<Array<type_element>, Error>;
94
+    /**
95
+     * @author fenris
96
+     * @deprecated use condense
97
+     */
98
+    function executor_filter<type_element>(executors: Array<type_executor<type_element, Error>>, predicate: (element: type_element) => boolean): type_executor<Array<type_element>, Error>;
99
+    /**
100
+     * @author fenris
101
+     * @deprecated use condense
102
+     */
103
+    function executor_map<type_element1, type_element2>(executors: Array<type_executor<type_element1, Error>>, transformator: (element1: type_element1) => type_element2): type_executor<Array<type_element2>, Error>;
104
+    /**
105
+     * @author fenris
106
+     * @deprecated use condense
107
+     */
108
+    function executor_reduce<type_element, type_result>(executors: Array<type_executor<type_element, Error>>, initial: type_result, accumulator: (result: type_result, element: type_element) => type_result): type_executor<type_result, Error>;
109
+}
110
+declare module lib_call {
111
+    /**
112
+     * @author fenris
113
+     */
114
+    type type_promise<type_result, type_reason> = Promise<type_result>;
115
+    /**
116
+     * @author fenris
117
+     */
118
+    function promise_reject<type_result, type_reason>(reason: type_reason): type_promise<type_result, type_reason>;
119
+    /**
120
+     * @author fenris
121
+     */
122
+    function promise_resolve<type_result, type_reason>(result: type_result): type_promise<type_result, type_reason>;
123
+    /**
124
+     * @author fenris
125
+     */
126
+    function promise_make<type_result, type_reason>(executor: (resolve: (result?: type_result) => void, reject: (reason?: type_reason) => void) => void): type_promise<type_result, type_reason>;
127
+    /**
128
+     * @author fenris
129
+     */
130
+    function promise_then_close<type_result, type_reason>(promise: type_promise<type_result, type_reason>, resolver: (result: type_result) => void, rejector: (reason: type_reason) => void): void;
131
+    /**
132
+     * @author fenris
133
+     */
134
+    function promise_then_append<type_result, type_reason, type_result_>(promise: type_promise<type_result, type_reason>, resolver: (result: type_result) => type_promise<type_result_, type_reason>, rejector?: (reason: type_reason) => type_promise<type_result_, type_reason>): type_promise<type_result_, type_result>;
135
+    /**
136
+     * @author fenris
137
+     */
138
+    function promise_all<type_result, type_reason>(promises: Array<type_promise<type_result, type_reason>>): type_promise<Array<type_result>, type_reason>;
139
+    /**
140
+     * @author fenris
141
+     */
142
+    function promise_chain<type_result, type_reason>(promises: Array<(input: type_result) => type_promise<type_result, type_reason>>, start?: type_result): type_promise<type_result, type_reason>;
143
+    /**
144
+     * @author fenris
145
+     */
146
+    function promise_condense<type_element, type_reason>(promises: Array<() => type_promise<type_element, type_reason>>): type_promise<Array<type_element>, type_reason>;
147
+    /**
148
+     * @author fenris
149
+     */
150
+    function promise_group<type_reason>(promises: {
151
+        [name: string]: () => type_promise<any, type_reason>;
152
+    }, serial?: boolean): type_promise<{
153
+        [name: string]: any;
154
+    }, type_reason>;
155
+    /**
156
+     * @author fenris
157
+     */
158
+    function promise_wrap<type_result_inner, type_result_outer, type_reason>(promise: type_promise<type_result_inner, type_reason>, transformator_result: (reason: type_result_inner) => type_result_outer, transformator_reason?: (reason: type_reason) => type_reason): Promise<type_result_outer>;
159
+    /**
160
+     * @author fenris
161
+     */
162
+    function promise_show<type_result, type_reason>(label: string): (result: type_result) => type_promise<type_result, type_reason>;
163
+    /**
164
+     * @author fenris
165
+     */
166
+    function promise_log<type_result, type_reason>(result: type_result): (result: type_result) => type_promise<type_result, type_reason>;
167
+    /**
168
+     * @author fenris
169
+     */
170
+    function promise_attach<type_reason>(state: {
171
+        [name: string]: any;
172
+    }, promise: type_promise<any, type_reason>, name: string): type_promise<{
173
+        [name: string]: any;
174
+    }, type_reason>;
175
+    /**
176
+     * @author fenris
177
+     */
178
+    function promise_delay<type_result, type_reason>(promise: type_promise<type_result, type_reason>, delay: int): Promise<type_result>;
179
+    /**
180
+     * @author fenris
181
+     */
182
+    function promise_to_executor<type_result, type_reason>(promise: type_promise<type_result, type_reason>): type_executor<type_result, type_reason>;
183
+}
184
+declare module lib_call {
185
+    /**
186
+     * @author fenris
187
+     */
188
+    type type_initializer_state = int;
189
+    const initializer_state_initial: type_initializer_state;
190
+    const initializer_state_waiting: type_initializer_state;
191
+    const initializer_state_successful: type_initializer_state;
192
+    const initializer_state_failed: type_initializer_state;
193
+    /**
194
+     * @author fenris
195
+     */
196
+    type type_initializer<type_result, type_reason> = {
197
+        fetcher: () => type_promise<type_result, type_reason>;
198
+        state?: type_initializer_state;
199
+        queue: Array<{
200
+            resolve: (result?: type_result) => void;
201
+            reject: (reason?: type_reason) => void;
202
+        }>;
203
+        result?: type_result;
204
+        reason?: type_reason;
205
+    };
206
+    /**
207
+     * @author fenris
208
+     */
209
+    function initializer_make<type_result, type_reason>(fetcher: () => type_promise<type_result, type_reason>): type_initializer<type_result, type_reason>;
210
+    /**
211
+     * @author fenris
212
+     */
213
+    function initializer_reset<type_result, type_reason>(subject: type_initializer<type_result, type_reason>): void;
214
+    /**
215
+     * @author fenris
216
+     */
217
+    function initializer_state<type_result, type_reason>(subject: type_initializer<type_result, type_reason>): type_initializer_state;
218
+    /**
219
+     * @author fenris
220
+     */
221
+    function initializer_get<type_result, type_reason>(subject: type_initializer<type_result, type_reason>): type_promise<type_result, type_reason>;
222
+}
223
+declare module lib_call {
224
+    /**
225
+     * @author fenris
226
+     */
227
+    type type_deferral<type_input, type_output> = {
228
+        representation: (input: type_input) => Promise<type_output>;
229
+    };
230
+    /**
231
+     * @author fenris
232
+     * @desc activates the deferral and handles its output according to a given procedure
233
+     * @param {(value : type_value)=>void} procedure a function which receives the output of the deferral as argument
234
+     */
235
+    function deferral_use<type_input, type_output>(deferral: type_deferral<type_input, type_output>, input: type_input, procedure: (output: type_output) => void): void;
236
+    /**
237
+     * @author fenris
238
+     * @desc creates a deferral-subject (similar to "new Promise", where "convey" reflects "resolve"/"reject")
239
+     */
240
+    function deferral_make<type_input, type_output>(handler: (input: type_input, convey: (output: type_output) => void) => void): type_deferral<type_input, type_output>;
241
+    /**
242
+     * @author fenris
243
+     * @desc wraps a simple function into a deferral (similar to "Promise.resolve"/"Promise.reject")
244
+     */
245
+    function deferral_wrap<type_input, type_output>(function_: (input: type_input) => type_output): type_deferral<type_input, type_output>;
246
+    /**
247
+     * @author fenris
248
+     */
249
+    function deferral_id<type_value>(): type_deferral<type_value, type_value>;
250
+    /**
251
+     * @author fenris
252
+     */
253
+    function deferral_const<type_value>(value: type_value): type_deferral<type_value, type_value>;
254
+    /**
255
+     * @author fenris
256
+     */
257
+    function deferral_delay<type_output>(output: type_output, delay: int): type_deferral<any, type_output>;
258
+    /**
259
+     * @author fenris
260
+     * @desc connects two deferrals to form a new one; the output of the first is taken as input for the second
261
+     *     (similar to "Promise.then" when passing a function which returns a new promise)
262
+     * @param {type_deferral<type_value1>} first a simple deferral
263
+     * @param {(value1 : type_value1)=>type_deferral<type_value2>} second a function depending from a value returning a deferral
264
+     */
265
+    function deferral_compose_serial<type_input, type_between, type_output>(first: type_deferral<type_input, type_between>, second: type_deferral<type_between, type_output>): type_deferral<type_input, type_output>;
266
+    /**
267
+     * @author fenris
268
+     */
269
+    function deferral_compose_parallel<type_input, type_output_left, type_output_right>({ "left": deferral_left, "right": deferral_right, }: {
270
+        left: type_deferral<type_input, type_output_left>;
271
+        right: type_deferral<type_input, type_output_right>;
272
+    }): type_deferral<type_input, {
273
+        left: type_output_left;
274
+        right: type_output_right;
275
+    }>;
276
+    /**
277
+     * @author fenris
278
+     * @desc repeatedly applied serial composition
279
+     */
280
+    function deferral_chain<type_value>(members: Array<type_deferral<type_value, type_value>>): type_deferral<type_value, type_value>;
281
+    /**
282
+     * @author fenris
283
+     */
284
+}
285
+declare module lib_call {
286
+    /**
287
+     * @author fenris
288
+     */
289
+    class class_deferral<type_input, type_output> {
290
+        /**
291
+         * @author fenris
292
+         */
293
+        private subject;
294
+        /**
295
+         * @author fenris
296
+         */
297
+        private constructor();
298
+        /**
299
+         * @author fenris
300
+         */
301
+        private static _cram;
302
+        /**
303
+         * @author fenris
304
+         */
305
+        private static _tear;
306
+        /**
307
+         * @author fenris
308
+         */
309
+        static make<type_input, type_output>(handler: (input: type_input, convey: (value: type_output) => void) => void): class_deferral<type_input, type_output>;
310
+        /**
311
+         * @author fenris
312
+         */
313
+        use(input: type_input, procedure: (value: type_output) => void): void;
314
+        /**
315
+         * @author fenris
316
+         */
317
+        compose_serial<type_output_>(second: class_deferral<type_output, type_output_>): class_deferral<type_input, type_output_>;
318
+        /**
319
+         * @author fenris
320
+         */
321
+        static chain<type_value>(members: Array<class_deferral<type_value, type_value>>): class_deferral<type_value, type_value>;
322
+        /**
323
+         * @author fenris
324
+         */
325
+        static wrap<type_input, type_output>(function_: (input: type_input) => type_output): class_deferral<type_input, type_output>;
326
+        /**
327
+         * @author fenris
328
+         */
329
+        static const_<type_value>(value: type_value): class_deferral<type_value, type_value>;
330
+        /**
331
+         * @author fenris
332
+         */
333
+        static delay<type_output>(output: type_output, delay: int): class_deferral<any, type_output>;
334
+    }
335
+}
336
+declare module lib_call {
337
+    /**
338
+     * @author fenris
339
+     */
340
+    function timeout(function_: () => void, delay: int): int;
341
+    /**
342
+     * @desc a definition for a value being "defined"
343
+     * @author neuc
344
+     */
345
+    function is_def<type_value>(obj: type_value, null_is_valid?: boolean): boolean;
346
+    /**
347
+     * @desc returns the value if set and, when a type is specified, if the type is correct, if not return default_value
348
+     * @author neuc
349
+     */
350
+    function def_val(value: any, default_value: any, type?: string, null_is_valid?: boolean): any;
351
+    /**
352
+     * @desc just the empty function; useful for some callbacks etc.
353
+     * @author fenris
354
+     */
355
+    function nothing(): void;
356
+    /**
357
+     * @desc outputs
358
+     * @author fenris
359
+     */
360
+    function output(...args: Array<any>): void;
361
+    /**
362
+     * @desc converts the "arguments"-map into an array
363
+     * @param {Object} args
364
+     * @author fenris
365
+     */
366
+    function args2list(args: any): Array<any>;
367
+    /**
368
+     * @desc provides the call for an attribute of a class as a regular function
369
+     * @param {string} name the name of the attribute
370
+     * @return {*}
371
+     * @author fenris
372
+     */
373
+    function attribute<type_object, type_attribute>(name: string): (object: type_object) => type_attribute;
374
+    /**
375
+     * @desc provides a method of a class as a regular function
376
+     * @param {string} name the name of the method
377
+     * @return {function}
378
+     * @author fenris
379
+     */
380
+    function method<type_object, type_output>(name: string): (object: type_object) => type_output;
381
+    /**
382
+     * @author fenris
383
+     */
384
+    type type_unival = {
385
+        kind: string;
386
+        data?: any;
387
+    };
388
+    /**
389
+     * @author fenris
390
+     */
391
+    function distinguish(unival: type_unival, handlers: {
392
+        [kind: string]: (data?: any) => any;
393
+    }, fallback?: (unival?: type_unival) => any): any;
394
+}
... ...
@@ -0,0 +1,992 @@
1
+/*
2
+This file is part of »bacterio-plankton:call«.
3
+
4
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5
+<info@greenscale.de>
6
+
7
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
8
+it under the terms of the GNU Lesser General Public License as published by
9
+the Free Software Foundation, either version 3 of the License, or
10
+(at your option) any later version.
11
+
12
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
13
+but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+GNU Lesser General Public License for more details.
16
+
17
+You should have received a copy of the GNU Lesser General Public License
18
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+"use strict";
21
+/*
22
+This file is part of »bacterio-plankton:call«.
23
+
24
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
25
+<info@greenscale.de>
26
+
27
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
28
+it under the terms of the GNU Lesser General Public License as published by
29
+the Free Software Foundation, either version 3 of the License, or
30
+(at your option) any later version.
31
+
32
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
33
+but WITHOUT ANY WARRANTY; without even the implied warranty of
34
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35
+GNU Lesser General Public License for more details.
36
+
37
+You should have received a copy of the GNU Lesser General Public License
38
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
39
+ */
40
+var lib_call;
41
+(function (lib_call) {
42
+    /**
43
+     * @desc hacked class for postfix function application
44
+     * @author fenris
45
+     */
46
+    class class_valuewrapper {
47
+        /**
48
+         * @desc [constructor]
49
+         * @author fenris
50
+         */
51
+        constructor(value) {
52
+            this.value = value;
53
+        }
54
+        /**
55
+         * @desc [accessor] applies a function and returns a new valuewrapper
56
+         * @author fenris
57
+         */
58
+        pass(function_) {
59
+            return (new class_valuewrapper(function_(this.value)));
60
+        }
61
+        /**
62
+         * @desc [accessor] gives the wrapped value
63
+         * @author fenris
64
+         */
65
+        extract() {
66
+            return this.value;
67
+        }
68
+    }
69
+    lib_call.class_valuewrapper = class_valuewrapper;
70
+    /**
71
+     * @desc shortcut for constructing a valuewrapper-object
72
+     * @author fenris
73
+     */
74
+    function vw(value) {
75
+        return (new class_valuewrapper(value));
76
+    }
77
+    lib_call.vw = vw;
78
+    /**
79
+     * @author fenris
80
+     */
81
+    function use(input, function_) {
82
+        return function_(input);
83
+    }
84
+    lib_call.use = use;
85
+    /**
86
+     * @desc just the identity; useful for some callbacks etc.
87
+     * @author fenris
88
+     */
89
+    function id(x) {
90
+        return x;
91
+    }
92
+    lib_call.id = id;
93
+    /**
94
+     * @desc composes two functions (i.e. returns a function that return the result of the successive execution of both input-functions)
95
+     * @param {function} function_f
96
+     * @param {function} function_g
97
+     * @author fenris
98
+     */
99
+    function compose(function_f, function_g) {
100
+        return (function (x) {
101
+            // return function_g(function_f(x));
102
+            return function_g(function_f.apply(function_f, lib_call.args2list(arguments)));
103
+        });
104
+    }
105
+    lib_call.compose = compose;
106
+    /**
107
+     * @desc transforms a function with sequential input into a function with leveled input; example: add(2,3) = curryfy(add)(2)(3)
108
+     * @param {function} f
109
+     * @param {int} n (don't set manually)
110
+     * @return {function} the currified version of the in put function
111
+     * @author fenris
112
+     */
113
+    function curryfy(f, n = f.length) {
114
+        switch (n) {
115
+            case 0: {
116
+                throw (new Error("[curryfy] impossible"));
117
+                // break;
118
+            }
119
+            case 1: {
120
+                return f;
121
+                // break;
122
+            }
123
+            default: {
124
+                return (function (x) {
125
+                    return (curryfy(function () { return f.apply(f, [x].concat(lib_call.args2list(arguments))); }, n - 1));
126
+                });
127
+                // break;
128
+            }
129
+        }
130
+    }
131
+    lib_call.curryfy = curryfy;
132
+})(lib_call || (lib_call = {}));
133
+var lib_call;
134
+(function (lib_call) {
135
+    /**
136
+     * @author fenris
137
+     */
138
+    function executor_resolve(result) {
139
+        return ((resolve, reject) => resolve(result));
140
+    }
141
+    lib_call.executor_resolve = executor_resolve;
142
+    /**
143
+     * @author fenris
144
+     */
145
+    function executor_reject(reason) {
146
+        return ((resolve, reject) => reject(reason));
147
+    }
148
+    lib_call.executor_reject = executor_reject;
149
+    /**
150
+     * @author fenris
151
+     */
152
+    function executor_transform(executor, transform_result, transform_reason) {
153
+        return ((resolve, reject) => {
154
+            executor(result => resolve(transform_result(result)), reason => reject(transform_reason(reason)));
155
+        });
156
+    }
157
+    lib_call.executor_transform = executor_transform;
158
+    /**
159
+     * @author fenris
160
+     */
161
+    function executor_transform_default(executor, transform_result, wrap_string = null) {
162
+        let transform_reason = (error => ((wrap_string == null) ? error : new class_error(wrap_string, [error])));
163
+        return (executor_transform(executor, transform_result, transform_reason));
164
+    }
165
+    lib_call.executor_transform_default = executor_transform_default;
166
+    /**
167
+     * @author fenris
168
+     */
169
+    function executor_compose_sequential(first, second) {
170
+        return ((resolve, reject) => {
171
+            first(result => {
172
+                second(result)(resolve, reject);
173
+            }, reason => {
174
+                reject(reason);
175
+            });
176
+        });
177
+    }
178
+    lib_call.executor_compose_sequential = executor_compose_sequential;
179
+    /**
180
+     * @author fenris
181
+     */
182
+    function executor_chain(state, executors) {
183
+        return ((resolve, reject) => {
184
+            if (executors.length == 0) {
185
+                return resolve(state);
186
+            }
187
+            else {
188
+                return executors[0](state)(result => {
189
+                    executor_chain(result, executors.slice(1))(resolve, reject);
190
+                }, reject);
191
+            }
192
+        });
193
+        /*
194
+         */
195
+        /*
196
+        if (executors.length == 0) {
197
+            return executor_resolve<type_state, type_error>(state);
198
+        }
199
+        else if (executors.length == 1) {
200
+            return executors[0](state);
201
+        }
202
+        else {
203
+            return (
204
+                executor_chain<type_state, type_error>(
205
+                    state,
206
+                    [
207
+                        state => (resolve, reject) => executors[0](state)(result => executors[1](result)(resolve, reject), reject)
208
+                    ].concat(executors.slice(2))
209
+                )
210
+            );
211
+        }
212
+         */
213
+        /*
214
+        return (
215
+            executors.reduce(
216
+                (chain, current) => executor_compose_sequential<type_state, type_state, type_error>(chain, current, deferred),
217
+                executor_resolve<type_state, type_error>(state)
218
+            )
219
+        );
220
+         */
221
+    }
222
+    lib_call.executor_chain = executor_chain;
223
+    /**
224
+     * @author fenris
225
+     */
226
+    function executor_first(executors) {
227
+        /*
228
+        return (
229
+            (resolve, reject) => {
230
+                if (executors.length == 0) {
231
+                    reject(new Error("all failed"));
232
+                }
233
+                else {
234
+                    executors[0](
235
+                        result => {
236
+                            resolve(result);
237
+                        },
238
+                        reason => {
239
+                            executor_first<type_result, type_reason>(executors.slice(1))(resolve, reject);
240
+                        }
241
+                    )
242
+                }
243
+            }
244
+        );
245
+         */
246
+        return ((resolve, reject) => {
247
+            executor_chain([], executors.map(executor => reasons => (resolve_, reject_) => {
248
+                executor(result => reject_(result), reason => resolve_(reasons.concat([reason])));
249
+            }))(errors => reject(errors), result => resolve(result));
250
+        });
251
+    }
252
+    lib_call.executor_first = executor_first;
253
+    /**
254
+     * @author fenris
255
+     */
256
+    function executor_condense(executors) {
257
+        return (executor_chain([], executors.map(executor => result => (resolve, reject) => {
258
+            executor(element => resolve(result.concat([element])), reject);
259
+        })));
260
+    }
261
+    lib_call.executor_condense = executor_condense;
262
+    /**
263
+     * @author fenris
264
+     * @deprecated use condense
265
+     */
266
+    function executor_filter(executors, predicate) {
267
+        return (executor_chain([], executors.map(executor => result => (resolve, reject) => {
268
+            executor(element => resolve(predicate(element) ? result.concat([element]) : result), reject);
269
+        })));
270
+    }
271
+    lib_call.executor_filter = executor_filter;
272
+    /**
273
+     * @author fenris
274
+     * @deprecated use condense
275
+     */
276
+    function executor_map(executors, transformator) {
277
+        return (executor_chain([], executors.map(executor => result => (resolve, reject) => {
278
+            executor(element1 => resolve(result.concat([transformator(element1)])), reject);
279
+        })));
280
+    }
281
+    lib_call.executor_map = executor_map;
282
+    /**
283
+     * @author fenris
284
+     * @deprecated use condense
285
+     */
286
+    function executor_reduce(executors, initial, accumulator) {
287
+        return (executor_chain(initial, executors.map(executor => result => (resolve, reject) => {
288
+            executor(element => resolve(accumulator(result, element)), reject);
289
+        })));
290
+    }
291
+    lib_call.executor_reduce = executor_reduce;
292
+})(lib_call || (lib_call = {}));
293
+/*
294
+This file is part of »bacterio-plankton:call«.
295
+
296
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
297
+<info@greenscale.de>
298
+
299
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
300
+it under the terms of the GNU Lesser General Public License as published by
301
+the Free Software Foundation, either version 3 of the License, or
302
+(at your option) any later version.
303
+
304
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
305
+but WITHOUT ANY WARRANTY; without even the implied warranty of
306
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
307
+GNU Lesser General Public License for more details.
308
+
309
+You should have received a copy of the GNU Lesser General Public License
310
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
311
+ */
312
+var lib_call;
313
+(function (lib_call) {
314
+    /**
315
+     * @author fenris
316
+     */
317
+    function promise_reject(reason) {
318
+        return Promise.reject(reason);
319
+    }
320
+    lib_call.promise_reject = promise_reject;
321
+    /**
322
+     * @author fenris
323
+     */
324
+    function promise_resolve(result) {
325
+        return Promise.resolve(result);
326
+    }
327
+    lib_call.promise_resolve = promise_resolve;
328
+    /**
329
+     * @author fenris
330
+     */
331
+    function promise_make(executor) {
332
+        return (new Promise(executor));
333
+    }
334
+    lib_call.promise_make = promise_make;
335
+    /**
336
+     * @author fenris
337
+     */
338
+    function promise_then_close(promise, resolver, rejector) {
339
+        promise.then(resolver, rejector);
340
+    }
341
+    lib_call.promise_then_close = promise_then_close;
342
+    /**
343
+     * @author fenris
344
+     */
345
+    function promise_then_append(promise, resolver, rejector = null) {
346
+        if (rejector == null) {
347
+            rejector = (reason) => promise_reject(reason);
348
+        }
349
+        return (promise.then(resolver, rejector));
350
+    }
351
+    lib_call.promise_then_append = promise_then_append;
352
+    /**
353
+     * @author fenris
354
+     */
355
+    function promise_all(promises) {
356
+        return Promise.all(promises);
357
+    }
358
+    lib_call.promise_all = promise_all;
359
+    /**
360
+     * @author fenris
361
+     */
362
+    function promise_chain(promises, start = undefined) {
363
+        return (promises.reduce((chain, promise) => promise_then_append(chain, promise), promise_resolve(start)));
364
+    }
365
+    lib_call.promise_chain = promise_chain;
366
+    /**
367
+     * @author fenris
368
+     */
369
+    function promise_condense(promises) {
370
+        return (promise_chain(promises.map(promise => result => promise_then_append(promise(), element => promise_resolve(result.concat([element])))), []));
371
+    }
372
+    lib_call.promise_condense = promise_condense;
373
+    /**
374
+     * @author fenris
375
+     */
376
+    function promise_group(promises, serial = false) {
377
+        const decorate = function (promise, name) {
378
+            return (() => promise_then_append(promise(), value => promise_resolve({ "key": name, "value": value })));
379
+        };
380
+        const convert = function (array) {
381
+            let object = {};
382
+            array.forEach(({ "key": key, "value": value }) => { object[key] = value; });
383
+            return object;
384
+        };
385
+        if (serial) {
386
+            return (promise_then_append(promise_condense(Object.keys(promises)
387
+                .map(name => decorate(promises[name], name))), list => promise_resolve(convert(list))));
388
+        }
389
+        else {
390
+            return (promise_then_append(promise_all(Object.keys(promises)
391
+                .map(name => decorate(promises[name], name))
392
+                .map(promise => promise())), list => promise_resolve(convert(list))));
393
+        }
394
+    }
395
+    lib_call.promise_group = promise_group;
396
+    /**
397
+     * @author fenris
398
+     */
399
+    function promise_wrap(promise, transformator_result, transformator_reason = lib_call.id) {
400
+        return (promise_make((resolve, reject) => {
401
+            promise_then_close(promise, result => resolve(transformator_result(result)), reason => reject(transformator_reason(reason)));
402
+        }));
403
+    }
404
+    lib_call.promise_wrap = promise_wrap;
405
+    /**
406
+     * @author fenris
407
+     */
408
+    function promise_show(label) {
409
+        return (result => promise_make((resolve, reject) => {
410
+            lib_log.info(label + ": " + instance_show(result));
411
+            resolve(result);
412
+        }));
413
+    }
414
+    lib_call.promise_show = promise_show;
415
+    /**
416
+     * @author fenris
417
+     */
418
+    function promise_log(result) {
419
+        return promise_show("log");
420
+    }
421
+    lib_call.promise_log = promise_log;
422
+    /**
423
+     * @author fenris
424
+     */
425
+    function promise_attach(state, promise, name) {
426
+        return (promise_wrap(promise, result => {
427
+            state[name] = result;
428
+            return state;
429
+        }));
430
+    }
431
+    lib_call.promise_attach = promise_attach;
432
+    /**
433
+     * @author fenris
434
+     */
435
+    function promise_delay(promise, delay) {
436
+        return promise_make((resolve, reject) => {
437
+            lib_call.timeout(() => {
438
+                promise_then_close(promise, resolve, reject);
439
+                return null;
440
+            }, delay);
441
+        });
442
+    }
443
+    lib_call.promise_delay = promise_delay;
444
+    /**
445
+     * @author fenris
446
+     */
447
+    function promise_to_executor(promise) {
448
+        return ((resolve, reject) => promise.then(resolve, reject));
449
+    }
450
+    lib_call.promise_to_executor = promise_to_executor;
451
+})(lib_call || (lib_call = {}));
452
+/*
453
+This file is part of »bacterio-plankton:call«.
454
+
455
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
456
+<info@greenscale.de>
457
+
458
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
459
+it under the terms of the GNU Lesser General Public License as published by
460
+the Free Software Foundation, either version 3 of the License, or
461
+(at your option) any later version.
462
+
463
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
464
+but WITHOUT ANY WARRANTY; without even the implied warranty of
465
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
466
+GNU Lesser General Public License for more details.
467
+
468
+You should have received a copy of the GNU Lesser General Public License
469
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
470
+ */
471
+var lib_call;
472
+(function (lib_call) {
473
+    lib_call.initializer_state_initial = 0;
474
+    lib_call.initializer_state_waiting = 1;
475
+    lib_call.initializer_state_successful = 2;
476
+    lib_call.initializer_state_failed = 3;
477
+    /**
478
+     * @author fenris
479
+     */
480
+    function initializer_make(fetcher) {
481
+        let subject = {
482
+            "fetcher": fetcher,
483
+            "state": lib_call.initializer_state_initial,
484
+            "queue": [],
485
+            "result": undefined,
486
+            "reason": undefined,
487
+        };
488
+        return subject;
489
+    }
490
+    lib_call.initializer_make = initializer_make;
491
+    /**
492
+     * @author fenris
493
+     */
494
+    function initializer_actuate(subject) {
495
+        switch (subject.state) {
496
+            case lib_call.initializer_state_successful: {
497
+                subject.queue.forEach(entry => entry.resolve(subject.result));
498
+                break;
499
+            }
500
+            case lib_call.initializer_state_failed: {
501
+                subject.queue.forEach(entry => entry.reject(subject.reason));
502
+                break;
503
+            }
504
+            default: {
505
+                let message = `unhandled state ${subject.state}`;
506
+                throw (new Error(message));
507
+                break;
508
+            }
509
+        }
510
+    }
511
+    /**
512
+     * @author fenris
513
+     */
514
+    function initializer_reset(subject) {
515
+        subject.state = lib_call.initializer_state_initial;
516
+        subject.queue = [];
517
+    }
518
+    lib_call.initializer_reset = initializer_reset;
519
+    /**
520
+     * @author fenris
521
+     */
522
+    function initializer_state(subject) {
523
+        return subject.state;
524
+    }
525
+    lib_call.initializer_state = initializer_state;
526
+    /**
527
+     * @author fenris
528
+     */
529
+    function initializer_get(subject) {
530
+        switch (subject.state) {
531
+            case lib_call.initializer_state_initial: {
532
+                subject.state = lib_call.initializer_state_waiting;
533
+                return (lib_call.promise_make((resolve, reject) => {
534
+                    subject.queue.push({ "resolve": resolve, "reject": reject });
535
+                    subject.fetcher().then(result => {
536
+                        subject.state = lib_call.initializer_state_successful;
537
+                        subject.result = result;
538
+                        initializer_actuate(subject);
539
+                    }, reason => {
540
+                        subject.state = lib_call.initializer_state_failed;
541
+                        subject.reason = reason;
542
+                        initializer_actuate(subject);
543
+                    });
544
+                }));
545
+                break;
546
+            }
547
+            case lib_call.initializer_state_waiting: {
548
+                return (lib_call.promise_make((resolve, reject) => {
549
+                    subject.queue.push({ "resolve": resolve, "reject": reject });
550
+                }));
551
+                break;
552
+            }
553
+            case lib_call.initializer_state_successful: {
554
+                return (lib_call.promise_resolve(subject.result));
555
+                break;
556
+            }
557
+            case lib_call.initializer_state_failed: {
558
+                return (lib_call.promise_reject(subject.reason));
559
+                break;
560
+            }
561
+            default: {
562
+                let message = `unhandled state ${subject.state}`;
563
+                throw (new Error(message));
564
+                break;
565
+            }
566
+        }
567
+    }
568
+    lib_call.initializer_get = initializer_get;
569
+    /**
570
+     * @author fenris
571
+     */
572
+    function initializer_get_sync(subject) {
573
+        switch (subject.state) {
574
+            case lib_call.initializer_state_successful: {
575
+                return subject.result;
576
+                break;
577
+            }
578
+            case lib_call.initializer_state_failed: {
579
+                throw subject.reason;
580
+                break;
581
+            }
582
+            default: {
583
+                let message = `unhandled state ${subject.state}`;
584
+                throw (new Error(message));
585
+                break;
586
+            }
587
+        }
588
+    }
589
+    /**
590
+     * @author fenris
591
+     */
592
+    function initializer_set_sync(subject, result) {
593
+        switch (subject.state) {
594
+            case lib_call.initializer_state_successful: {
595
+                subject.result = result;
596
+                break;
597
+            }
598
+            case lib_call.initializer_state_failed: {
599
+                subject.state = lib_call.initializer_state_successful;
600
+                subject.result = result;
601
+                break;
602
+            }
603
+            default: {
604
+                let message = `unhandled state ${subject.state}`;
605
+                throw (new Error(message));
606
+                break;
607
+            }
608
+        }
609
+    }
610
+})(lib_call || (lib_call = {}));
611
+/*
612
+This file is part of »bacterio-plankton:call«.
613
+
614
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
615
+<info@greenscale.de>
616
+
617
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
618
+it under the terms of the GNU Lesser General Public License as published by
619
+the Free Software Foundation, either version 3 of the License, or
620
+(at your option) any later version.
621
+
622
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
623
+but WITHOUT ANY WARRANTY; without even the implied warranty of
624
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
625
+GNU Lesser General Public License for more details.
626
+
627
+You should have received a copy of the GNU Lesser General Public License
628
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
629
+ */
630
+var lib_call;
631
+(function (lib_call) {
632
+    /*
633
+        The core idea of this library is to provide means for asynchronous program flow. The old-school way to do is,
634
+        is to use callbacks. While this approach is simple and easy to understand, it has some disadvantages. As an
635
+        attempt to relief and improve this, the promise-system was introduced. In principle it solves most of the
636
+        problems found in the callback-approach; however it has some downsides as well:
637
+            
638
+        - Convolution of multiple principles
639
+            Promises unite the ideas of asynchronous program flow and error handling.
640
+        
641
+        - Instant execution
642
+            Creating a promise results in the instant execution of the given executor prodecure. While this might be
643
+            convenient in some cases, it can be quite disturbing and counter-intuitive in others.
644
+        
645
+        - Broken typing
646
+            The Promise system doesn't distinguish between an appending "then" (i.e. passing a function, which returns a
647
+            new promise) and a closing "then" (i.e. passing a function, which has no return value). On top of that it
648
+            allows returning simple values in an appending "then", which results in an implicit call of the executors
649
+            "resolve"-function. The price for these "pragmatic" features is that the whole system can't be typed well.
650
+            And even though JavaScript is not a strictly typed language, it was a quite questionable decision to design
651
+            the promise system in a way, which breaks typing from the start.
652
+        
653
+        The deferral-system forseeks to solve these issues while retaining the advantages of the promise-system.
654
+     */
655
+    /**
656
+     * @author fenris
657
+     * @desc activates the deferral and handles its output according to a given procedure
658
+     * @param {(value : type_value)=>void} procedure a function which receives the output of the deferral as argument
659
+     */
660
+    function deferral_use(deferral, input, procedure) {
661
+        deferral.representation(input).then(value => {
662
+            procedure(value);
663
+        }, reason => {
664
+            throw reason;
665
+        });
666
+    }
667
+    lib_call.deferral_use = deferral_use;
668
+    /**
669
+     * @author fenris
670
+     * @desc creates a deferral-subject (similar to "new Promise", where "convey" reflects "resolve"/"reject")
671
+     */
672
+    function deferral_make(handler) {
673
+        return ({
674
+            "representation": ((input) => (new Promise((resolve, reject) => {
675
+                handler(input, resolve);
676
+            })))
677
+        });
678
+    }
679
+    lib_call.deferral_make = deferral_make;
680
+    /**
681
+     * @author fenris
682
+     * @desc wraps a simple function into a deferral (similar to "Promise.resolve"/"Promise.reject")
683
+     */
684
+    function deferral_wrap(function_) {
685
+        return (deferral_make((input, convey) => convey(function_(input))));
686
+    }
687
+    lib_call.deferral_wrap = deferral_wrap;
688
+    /**
689
+     * @author fenris
690
+     */
691
+    function deferral_id() {
692
+        return (deferral_make((input, convey) => convey(input)));
693
+    }
694
+    lib_call.deferral_id = deferral_id;
695
+    /**
696
+     * @author fenris
697
+     */
698
+    function deferral_const(value) {
699
+        return (deferral_make((input, convey) => convey(value)));
700
+    }
701
+    lib_call.deferral_const = deferral_const;
702
+    /**
703
+     * @author fenris
704
+     */
705
+    function deferral_delay(output, delay) {
706
+        return (deferral_make((input, convey) => {
707
+            setTimeout(() => convey(output), delay);
708
+        }));
709
+    }
710
+    lib_call.deferral_delay = deferral_delay;
711
+    /**
712
+     * @author fenris
713
+     * @desc connects two deferrals to form a new one; the output of the first is taken as input for the second
714
+     *     (similar to "Promise.then" when passing a function which returns a new promise)
715
+     * @param {type_deferral<type_value1>} first a simple deferral
716
+     * @param {(value1 : type_value1)=>type_deferral<type_value2>} second a function depending from a value returning a deferral
717
+     */
718
+    function deferral_compose_serial(first, second) {
719
+        return {
720
+            "representation": ((input) => first.representation(input).then((between) => second.representation(between)))
721
+        };
722
+    }
723
+    lib_call.deferral_compose_serial = deferral_compose_serial;
724
+    /**
725
+     * @author fenris
726
+     */
727
+    function deferral_compose_parallel({ "left": deferral_left, "right": deferral_right, }) {
728
+        return (deferral_make((input, convey) => {
729
+            let object = {
730
+                "left": lib_maybe.make_nothing(),
731
+                "right": lib_maybe.make_nothing(),
732
+            };
733
+            let finish = function () {
734
+                if (lib_maybe.is_just(object.left)
735
+                    &&
736
+                        lib_maybe.is_just(object.right)) {
737
+                    let result = {
738
+                        "left": lib_maybe.cull(object.left),
739
+                        "right": lib_maybe.cull(object.right),
740
+                    };
741
+                    convey(result);
742
+                }
743
+                else {
744
+                    // do nothing
745
+                }
746
+            };
747
+            deferral_use(deferral_left, input, output_left => {
748
+                object.left = lib_maybe.make_just(output_left);
749
+                finish();
750
+            });
751
+            deferral_use(deferral_right, input, output_right => {
752
+                object.right = lib_maybe.make_just(output_right);
753
+                finish();
754
+            });
755
+        }));
756
+    }
757
+    lib_call.deferral_compose_parallel = deferral_compose_parallel;
758
+    /**
759
+     * @author fenris
760
+     * @desc repeatedly applied serial composition
761
+     */
762
+    function deferral_chain(members) {
763
+        return (members.reduce(
764
+        // (result, current) => deferral_compose_serial<type_value, type_value, type_value>(result, current),
765
+        deferral_compose_serial, deferral_id()));
766
+    }
767
+    lib_call.deferral_chain = deferral_chain;
768
+    /**
769
+     * @author fenris
770
+     */
771
+    /*
772
+    export function deferral_bunch<type_input, type_output>(
773
+        members : {[name : string] : type_deferral<type_input, type_output>}
774
+    ) : type_deferral<type_input, {[name : string] : type_output}> {
775
+        
776
+    }
777
+     */
778
+})(lib_call || (lib_call = {}));
779
+/*
780
+This file is part of »bacterio-plankton:call«.
781
+
782
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
783
+<info@greenscale.de>
784
+
785
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
786
+it under the terms of the GNU Lesser General Public License as published by
787
+the Free Software Foundation, either version 3 of the License, or
788
+(at your option) any later version.
789
+
790
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
791
+but WITHOUT ANY WARRANTY; without even the implied warranty of
792
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
793
+GNU Lesser General Public License for more details.
794
+
795
+You should have received a copy of the GNU Lesser General Public License
796
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
797
+ */
798
+var lib_call;
799
+(function (lib_call) {
800
+    /**
801
+     * @author fenris
802
+     */
803
+    class class_deferral {
804
+        /**
805
+         * @author fenris
806
+         */
807
+        constructor(subject) {
808
+            this.subject = subject;
809
+        }
810
+        /**
811
+         * @author fenris
812
+         */
813
+        static _cram(subject) {
814
+            return (new class_deferral(subject));
815
+        }
816
+        /**
817
+         * @author fenris
818
+         */
819
+        static _tear(instance) {
820
+            return instance.subject;
821
+        }
822
+        /**
823
+         * @author fenris
824
+         */
825
+        static make(handler) {
826
+            return (class_deferral._cram(lib_call.deferral_make(handler)));
827
+        }
828
+        /**
829
+         * @author fenris
830
+         */
831
+        use(input, procedure) {
832
+            return (lib_call.deferral_use(class_deferral._tear(this), input, procedure));
833
+        }
834
+        /**
835
+         * @author fenris
836
+         */
837
+        compose_serial(second) {
838
+            return (class_deferral._cram(lib_call.deferral_compose_serial(class_deferral._tear(this), class_deferral._tear(second))));
839
+        }
840
+        /**
841
+         * @author fenris
842
+         */
843
+        static chain(members) {
844
+            return (class_deferral._cram(lib_call.deferral_chain(members.map(member => class_deferral._tear(member)))));
845
+        }
846
+        /**
847
+         * @author fenris
848
+         */
849
+        static wrap(function_) {
850
+            return (class_deferral._cram(lib_call.deferral_wrap(function_)));
851
+        }
852
+        /**
853
+         * @author fenris
854
+         */
855
+        static const_(value) {
856
+            return (class_deferral._cram(lib_call.deferral_const(value)));
857
+        }
858
+        /**
859
+         * @author fenris
860
+         */
861
+        static delay(output, delay) {
862
+            return (class_deferral._cram(lib_call.deferral_delay(output, delay)));
863
+        }
864
+    }
865
+    lib_call.class_deferral = class_deferral;
866
+})(lib_call || (lib_call = {}));
867
+/*
868
+This file is part of »bacterio-plankton:call«.
869
+
870
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
871
+<info@greenscale.de>
872
+
873
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
874
+it under the terms of the GNU Lesser General Public License as published by
875
+the Free Software Foundation, either version 3 of the License, or
876
+(at your option) any later version.
877
+
878
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
879
+but WITHOUT ANY WARRANTY; without even the implied warranty of
880
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
881
+GNU Lesser General Public License for more details.
882
+
883
+You should have received a copy of the GNU Lesser General Public License
884
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
885
+ */
886
+var lib_call;
887
+(function (lib_call) {
888
+    /**
889
+     * @author fenris
890
+     */
891
+    function timeout(function_, delay) {
892
+        return (
893
+        /*window.*/ setTimeout(function_, delay));
894
+    }
895
+    lib_call.timeout = timeout;
896
+    /**
897
+     * @desc a definition for a value being "defined"
898
+     * @author neuc
899
+     */
900
+    function is_def(obj, null_is_valid = false) {
901
+        return (!((typeof (obj) === "undefined")
902
+            ||
903
+                (!null_is_valid && (obj === null))));
904
+    }
905
+    lib_call.is_def = is_def;
906
+    /**
907
+     * @desc returns the value if set and, when a type is specified, if the type is correct, if not return default_value
908
+     * @author neuc
909
+     */
910
+    function def_val(value, default_value, type = null, null_is_valid = false) {
911
+        if (is_def(value, null_is_valid)
912
+            &&
913
+                (is_def(type)
914
+                    ? ((typeof value === type)
915
+                        ||
916
+                            ((value === null)
917
+                                &&
918
+                                    null_is_valid))
919
+                    : true)) {
920
+            return value;
921
+        }
922
+        else {
923
+            return default_value;
924
+        }
925
+    }
926
+    lib_call.def_val = def_val;
927
+    ;
928
+    /**
929
+     * @desc just the empty function; useful for some callbacks etc.
930
+     * @author fenris
931
+     */
932
+    function nothing() {
933
+    }
934
+    lib_call.nothing = nothing;
935
+    /**
936
+     * @desc outputs
937
+     * @author fenris
938
+     */
939
+    function output(...args) {
940
+        lib_log.info.apply(lib_log, args);
941
+    }
942
+    lib_call.output = output;
943
+    /**
944
+     * @desc converts the "arguments"-map into an array
945
+     * @param {Object} args
946
+     * @author fenris
947
+     */
948
+    function args2list(args) {
949
+        return Object.keys(args).map(key => args[key]);
950
+    }
951
+    lib_call.args2list = args2list;
952
+    /**
953
+     * @desc provides the call for an attribute of a class as a regular function
954
+     * @param {string} name the name of the attribute
955
+     * @return {*}
956
+     * @author fenris
957
+     */
958
+    function attribute(name) {
959
+        return ((object) => object[name]);
960
+    }
961
+    lib_call.attribute = attribute;
962
+    /**
963
+     * @desc provides a method of a class as a regular function
964
+     * @param {string} name the name of the method
965
+     * @return {function}
966
+     * @author fenris
967
+     */
968
+    function method(name) {
969
+        return (function (object) { return object[name].apply(object, args2list(arguments).slice(1)); });
970
+    }
971
+    lib_call.method = method;
972
+    /**
973
+     * @author fenris
974
+     */
975
+    function distinguish(unival, handlers, fallback = null) {
976
+        if (unival.kind in handlers) {
977
+            let handler = handlers[unival.kind];
978
+            return handler(unival.data);
979
+        }
980
+        else {
981
+            let message = ("unhandled kind '" + unival.kind + "'");
982
+            if (fallback !== null) {
983
+                console.warn(message);
984
+                return fallback(unival);
985
+            }
986
+            else {
987
+                throw (new Error(message));
988
+            }
989
+        }
990
+    }
991
+    lib_call.distinguish = distinguish;
992
+})(lib_call || (lib_call = {}));
... ...
@@ -0,0 +1,861 @@
1
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2
+<info@greenscale.de>
3
+
4
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5
+it under the terms of the GNU Lesser General Public License as published by
6
+the Free Software Foundation, either version 3 of the License, or
7
+(at your option) any later version.
8
+
9
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
10
+but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+GNU Lesser General Public License for more details.
13
+
14
+You should have received a copy of the GNU Lesser General Public License
15
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+
18
+
19
+                    GNU GENERAL PUBLIC LICENSE
20
+                       Version 3, 29 June 2007
21
+
22
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
23
+ Everyone is permitted to copy and distribute verbatim copies
24
+ of this license document, but changing it is not allowed.
25
+
26
+                            Preamble
27
+
28
+  The GNU General Public License is a free, copyleft license for
29
+software and other kinds of works.
30
+
31
+  The licenses for most software and other practical works are designed
32
+to take away your freedom to share and change the works.  By contrast,
33
+the GNU General Public License is intended to guarantee your freedom to
34
+share and change all versions of a program--to make sure it remains free
35
+software for all its users.  We, the Free Software Foundation, use the
36
+GNU General Public License for most of our software; it applies also to
37
+any other work released this way by its authors.  You can apply it to
38
+your programs, too.
39
+
40
+  When we speak of free software, we are referring to freedom, not
41
+price.  Our General Public Licenses are designed to make sure that you
42
+have the freedom to distribute copies of free software (and charge for
43
+them if you wish), that you receive source code or can get it if you
44
+want it, that you can change the software or use pieces of it in new
45
+free programs, and that you know you can do these things.
46
+
47
+  To protect your rights, we need to prevent others from denying you
48
+these rights or asking you to surrender the rights.  Therefore, you have
49
+certain responsibilities if you distribute copies of the software, or if
50
+you modify it: responsibilities to respect the freedom of others.
51
+
52
+  For example, if you distribute copies of such a program, whether
53
+gratis or for a fee, you must pass on to the recipients the same
54
+freedoms that you received.  You must make sure that they, too, receive
55
+or can get the source code.  And you must show them these terms so they
56
+know their rights.
57
+
58
+  Developers that use the GNU GPL protect your rights with two steps:
59
+(1) assert copyright on the software, and (2) offer you this License
60
+giving you legal permission to copy, distribute and/or modify it.
61
+
62
+  For the developers' and authors' protection, the GPL clearly explains
63
+that there is no warranty for this free software.  For both users' and
64
+authors' sake, the GPL requires that modified versions be marked as
65
+changed, so that their problems will not be attributed erroneously to
66
+authors of previous versions.
67
+
68
+  Some devices are designed to deny users access to install or run
69
+modified versions of the software inside them, although the manufacturer
70
+can do so.  This is fundamentally incompatible with the aim of
71
+protecting users' freedom to change the software.  The systematic
72
+pattern of such abuse occurs in the area of products for individuals to
73
+use, which is precisely where it is most unacceptable.  Therefore, we
74
+have designed this version of the GPL to prohibit the practice for those
75
+products.  If such problems arise substantially in other domains, we
76
+stand ready to extend this provision to those domains in future versions
77
+of the GPL, as needed to protect the freedom of users.
78
+
79
+  Finally, every program is threatened constantly by software patents.
80
+States should not allow patents to restrict development and use of
81
+software on general-purpose computers, but in those that do, we wish to
82
+avoid the special danger that patents applied to a free program could
83
+make it effectively proprietary.  To prevent this, the GPL assures that
84
+patents cannot be used to render the program non-free.
85
+
86
+  The precise terms and conditions for copying, distribution and
87
+modification follow.
88
+
89
+                       TERMS AND CONDITIONS
90
+
91
+  0. Definitions.
92
+
93
+  "This License" refers to version 3 of the GNU General Public License.
94
+
95
+  "Copyright" also means copyright-like laws that apply to other kinds of
96
+works, such as semiconductor masks.
97
+
98
+  "The Program" refers to any copyrightable work licensed under this
99
+License.  Each licensee is addressed as "you".  "Licensees" and
100
+"recipients" may be individuals or organizations.
101
+
102
+  To "modify" a work means to copy from or adapt all or part of the work
103
+in a fashion requiring copyright permission, other than the making of an
104
+exact copy.  The resulting work is called a "modified version" of the
105
+earlier work or a work "based on" the earlier work.
106
+
107
+  A "covered work" means either the unmodified Program or a work based
108
+on the Program.
109
+
110
+  To "propagate" a work means to do anything with it that, without
111
+permission, would make you directly or secondarily liable for
112
+infringement under applicable copyright law, except executing it on a
113
+computer or modifying a private copy.  Propagation includes copying,
114
+distribution (with or without modification), making available to the
115
+public, and in some countries other activities as well.
116
+
117
+  To "convey" a work means any kind of propagation that enables other
118
+parties to make or receive copies.  Mere interaction with a user through
119
+a computer network, with no transfer of a copy, is not conveying.
120
+
121
+  An interactive user interface displays "Appropriate Legal Notices"
122
+to the extent that it includes a convenient and prominently visible
123
+feature that (1) displays an appropriate copyright notice, and (2)
124
+tells the user that there is no warranty for the work (except to the
125
+extent that warranties are provided), that licensees may convey the
126
+work under this License, and how to view a copy of this License.  If
127
+the interface presents a list of user commands or options, such as a
128
+menu, a prominent item in the list meets this criterion.
129
+
130
+  1. Source Code.
131
+
132
+  The "source code" for a work means the preferred form of the work
133
+for making modifications to it.  "Object code" means any non-source
134
+form of a work.
135
+
136
+  A "Standard Interface" means an interface that either is an official
137
+standard defined by a recognized standards body, or, in the case of
138
+interfaces specified for a particular programming language, one that
139
+is widely used among developers working in that language.
140
+
141
+  The "System Libraries" of an executable work include anything, other
142
+than the work as a whole, that (a) is included in the normal form of
143
+packaging a Major Component, but which is not part of that Major
144
+Component, and (b) serves only to enable use of the work with that
145
+Major Component, or to implement a Standard Interface for which an
146
+implementation is available to the public in source code form.  A
147
+"Major Component", in this context, means a major essential component
148
+(kernel, window system, and so on) of the specific operating system
149
+(if any) on which the executable work runs, or a compiler used to
150
+produce the work, or an object code interpreter used to run it.
151
+
152
+  The "Corresponding Source" for a work in object code form means all
153
+the source code needed to generate, install, and (for an executable
154
+work) run the object code and to modify the work, including scripts to
155
+control those activities.  However, it does not include the work's
156
+System Libraries, or general-purpose tools or generally available free
157
+programs which are used unmodified in performing those activities but
158
+which are not part of the work.  For example, Corresponding Source
159
+includes interface definition files associated with source files for
160
+the work, and the source code for shared libraries and dynamically
161
+linked subprograms that the work is specifically designed to require,
162
+such as by intimate data communication or control flow between those
163
+subprograms and other parts of the work.
164
+
165
+  The Corresponding Source need not include anything that users
166
+can regenerate automatically from other parts of the Corresponding
167
+Source.
168
+
169
+  The Corresponding Source for a work in source code form is that
170
+same work.
171
+
172
+  2. Basic Permissions.
173
+
174
+  All rights granted under this License are granted for the term of
175
+copyright on the Program, and are irrevocable provided the stated
176
+conditions are met.  This License explicitly affirms your unlimited
177
+permission to run the unmodified Program.  The output from running a
178
+covered work is covered by this License only if the output, given its
179
+content, constitutes a covered work.  This License acknowledges your
180
+rights of fair use or other equivalent, as provided by copyright law.
181
+
182
+  You may make, run and propagate covered works that you do not
183
+convey, without conditions so long as your license otherwise remains
184
+in force.  You may convey covered works to others for the sole purpose
185
+of having them make modifications exclusively for you, or provide you
186
+with facilities for running those works, provided that you comply with
187
+the terms of this License in conveying all material for which you do
188
+not control copyright.  Those thus making or running the covered works
189
+for you must do so exclusively on your behalf, under your direction
190
+and control, on terms that prohibit them from making any copies of
191
+your copyrighted material outside their relationship with you.
192
+
193
+  Conveying under any other circumstances is permitted solely under
194
+the conditions stated below.  Sublicensing is not allowed; section 10
195
+makes it unnecessary.
196
+
197
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
198
+
199
+  No covered work shall be deemed part of an effective technological
200
+measure under any applicable law fulfilling obligations under article
201
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
202
+similar laws prohibiting or restricting circumvention of such
203
+measures.
204
+
205
+  When you convey a covered work, you waive any legal power to forbid
206
+circumvention of technological measures to the extent such circumvention
207
+is effected by exercising rights under this License with respect to
208
+the covered work, and you disclaim any intention to limit operation or
209
+modification of the work as a means of enforcing, against the work's
210
+users, your or third parties' legal rights to forbid circumvention of
211
+technological measures.
212
+
213
+  4. Conveying Verbatim Copies.
214
+
215
+  You may convey verbatim copies of the Program's source code as you
216
+receive it, in any medium, provided that you conspicuously and
217
+appropriately publish on each copy an appropriate copyright notice;
218
+keep intact all notices stating that this License and any
219
+non-permissive terms added in accord with section 7 apply to the code;
220
+keep intact all notices of the absence of any warranty; and give all
221
+recipients a copy of this License along with the Program.
222
+
223
+  You may charge any price or no price for each copy that you convey,
224
+and you may offer support or warranty protection for a fee.
225
+
226
+  5. Conveying Modified Source Versions.
227
+
228
+  You may convey a work based on the Program, or the modifications to
229
+produce it from the Program, in the form of source code under the
230
+terms of section 4, provided that you also meet all of these conditions:
231
+
232
+    a) The work must carry prominent notices stating that you modified
233
+    it, and giving a relevant date.
234
+
235
+    b) The work must carry prominent notices stating that it is
236
+    released under this License and any conditions added under section
237
+    7.  This requirement modifies the requirement in section 4 to
238
+    "keep intact all notices".
239
+
240
+    c) You must license the entire work, as a whole, under this
241
+    License to anyone who comes into possession of a copy.  This
242
+    License will therefore apply, along with any applicable section 7
243
+    additional terms, to the whole of the work, and all its parts,
244
+    regardless of how they are packaged.  This License gives no
245
+    permission to license the work in any other way, but it does not
246
+    invalidate such permission if you have separately received it.
247
+
248
+    d) If the work has interactive user interfaces, each must display
249
+    Appropriate Legal Notices; however, if the Program has interactive
250
+    interfaces that do not display Appropriate Legal Notices, your
251
+    work need not make them do so.
252
+
253
+  A compilation of a covered work with other separate and independent
254
+works, which are not by their nature extensions of the covered work,
255
+and which are not combined with it such as to form a larger program,
256
+in or on a volume of a storage or distribution medium, is called an
257
+"aggregate" if the compilation and its resulting copyright are not
258
+used to limit the access or legal rights of the compilation's users
259
+beyond what the individual works permit.  Inclusion of a covered work
260
+in an aggregate does not cause this License to apply to the other
261
+parts of the aggregate.
262
+
263
+  6. Conveying Non-Source Forms.
264
+
265
+  You may convey a covered work in object code form under the terms
266
+of sections 4 and 5, provided that you also convey the
267
+machine-readable Corresponding Source under the terms of this License,
268
+in one of these ways:
269
+
270
+    a) Convey the object code in, or embodied in, a physical product
271
+    (including a physical distribution medium), accompanied by the
272
+    Corresponding Source fixed on a durable physical medium
273
+    customarily used for software interchange.
274
+
275
+    b) Convey the object code in, or embodied in, a physical product
276
+    (including a physical distribution medium), accompanied by a
277
+    written offer, valid for at least three years and valid for as
278
+    long as you offer spare parts or customer support for that product
279
+    model, to give anyone who possesses the object code either (1) a
280
+    copy of the Corresponding Source for all the software in the
281
+    product that is covered by this License, on a durable physical
282
+    medium customarily used for software interchange, for a price no
283
+    more than your reasonable cost of physically performing this
284
+    conveying of source, or (2) access to copy the
285
+    Corresponding Source from a network server at no charge.
286
+
287
+    c) Convey individual copies of the object code with a copy of the
288
+    written offer to provide the Corresponding Source.  This
289
+    alternative is allowed only occasionally and noncommercially, and
290
+    only if you received the object code with such an offer, in accord
291
+    with subsection 6b.
292
+
293
+    d) Convey the object code by offering access from a designated
294
+    place (gratis or for a charge), and offer equivalent access to the
295
+    Corresponding Source in the same way through the same place at no
296
+    further charge.  You need not require recipients to copy the
297
+    Corresponding Source along with the object code.  If the place to
298
+    copy the object code is a network server, the Corresponding Source
299
+    may be on a different server (operated by you or a third party)
300
+    that supports equivalent copying facilities, provided you maintain
301
+    clear directions next to the object code saying where to find the
302
+    Corresponding Source.  Regardless of what server hosts the
303
+    Corresponding Source, you remain obligated to ensure that it is
304
+    available for as long as needed to satisfy these requirements.
305
+
306
+    e) Convey the object code using peer-to-peer transmission, provided
307
+    you inform other peers where the object code and Corresponding
308
+    Source of the work are being offered to the general public at no
309
+    charge under subsection 6d.
310
+
311
+  A separable portion of the object code, whose source code is excluded
312
+from the Corresponding Source as a System Library, need not be
313
+included in conveying the object code work.
314
+
315
+  A "User Product" is either (1) a "consumer product", which means any
316
+tangible personal property which is normally used for personal, family,
317
+or household purposes, or (2) anything designed or sold for incorporation
318
+into a dwelling.  In determining whether a product is a consumer product,
319
+doubtful cases shall be resolved in favor of coverage.  For a particular
320
+product received by a particular user, "normally used" refers to a
321
+typical or common use of that class of product, regardless of the status
322
+of the particular user or of the way in which the particular user
323
+actually uses, or expects or is expected to use, the product.  A product
324
+is a consumer product regardless of whether the product has substantial
325
+commercial, industrial or non-consumer uses, unless such uses represent
326
+the only significant mode of use of the product.
327
+
328
+  "Installation Information" for a User Product means any methods,
329
+procedures, authorization keys, or other information required to install
330
+and execute modified versions of a covered work in that User Product from
331
+a modified version of its Corresponding Source.  The information must
332
+suffice to ensure that the continued functioning of the modified object
333
+code is in no case prevented or interfered with solely because
334
+modification has been made.
335
+
336
+  If you convey an object code work under this section in, or with, or
337
+specifically for use in, a User Product, and the conveying occurs as
338
+part of a transaction in which the right of possession and use of the
339
+User Product is transferred to the recipient in perpetuity or for a
340
+fixed term (regardless of how the transaction is characterized), the
341
+Corresponding Source conveyed under this section must be accompanied
342
+by the Installation Information.  But this requirement does not apply
343
+if neither you nor any third party retains the ability to install
344
+modified object code on the User Product (for example, the work has
345
+been installed in ROM).
346
+
347
+  The requirement to provide Installation Information does not include a
348
+requirement to continue to provide support service, warranty, or updates
349
+for a work that has been modified or installed by the recipient, or for
350
+the User Product in which it has been modified or installed.  Access to a
351
+network may be denied when the modification itself materially and
352
+adversely affects the operation of the network or violates the rules and
353
+protocols for communication across the network.
354
+
355
+  Corresponding Source conveyed, and Installation Information provided,
356
+in accord with this section must be in a format that is publicly
357
+documented (and with an implementation available to the public in
358
+source code form), and must require no special password or key for
359
+unpacking, reading or copying.
360
+
361
+  7. Additional Terms.
362
+
363
+  "Additional permissions" are terms that supplement the terms of this
364
+License by making exceptions from one or more of its conditions.
365
+Additional permissions that are applicable to the entire Program shall
366
+be treated as though they were included in this License, to the extent
367
+that they are valid under applicable law.  If additional permissions
368
+apply only to part of the Program, that part may be used separately
369
+under those permissions, but the entire Program remains governed by
370
+this License without regard to the additional permissions.
371
+
372
+  When you convey a copy of a covered work, you may at your option
373
+remove any additional permissions from that copy, or from any part of
374
+it.  (Additional permissions may be written to require their own
375
+removal in certain cases when you modify the work.)  You may place
376
+additional permissions on material, added by you to a covered work,
377
+for which you have or can give appropriate copyright permission.
378
+
379
+  Notwithstanding any other provision of this License, for material you
380
+add to a covered work, you may (if authorized by the copyright holders of
381
+that material) supplement the terms of this License with terms:
382
+
383
+    a) Disclaiming warranty or limiting liability differently from the
384
+    terms of sections 15 and 16 of this License; or
385
+
386
+    b) Requiring preservation of specified reasonable legal notices or
387
+    author attributions in that material or in the Appropriate Legal
388
+    Notices displayed by works containing it; or
389
+
390
+    c) Prohibiting misrepresentation of the origin of that material, or
391
+    requiring that modified versions of such material be marked in
392
+    reasonable ways as different from the original version; or
393
+
394
+    d) Limiting the use for publicity purposes of names of licensors or
395
+    authors of the material; or
396
+
397
+    e) Declining to grant rights under trademark law for use of some
398
+    trade names, trademarks, or service marks; or
399
+
400
+    f) Requiring indemnification of licensors and authors of that
401
+    material by anyone who conveys the material (or modified versions of
402
+    it) with contractual assumptions of liability to the recipient, for
403
+    any liability that these contractual assumptions directly impose on
404
+    those licensors and authors.
405
+
406
+  All other non-permissive additional terms are considered "further
407
+restrictions" within the meaning of section 10.  If the Program as you
408
+received it, or any part of it, contains a notice stating that it is
409
+governed by this License along with a term that is a further
410
+restriction, you may remove that term.  If a license document contains
411
+a further restriction but permits relicensing or conveying under this
412
+License, you may add to a covered work material governed by the terms
413
+of that license document, provided that the further restriction does
414
+not survive such relicensing or conveying.
415
+
416
+  If you add terms to a covered work in accord with this section, you
417
+must place, in the relevant source files, a statement of the
418
+additional terms that apply to those files, or a notice indicating
419
+where to find the applicable terms.
420
+
421
+  Additional terms, permissive or non-permissive, may be stated in the
422
+form of a separately written license, or stated as exceptions;
423
+the above requirements apply either way.
424
+
425
+  8. Termination.
426
+
427
+  You may not propagate or modify a covered work except as expressly
428
+provided under this License.  Any attempt otherwise to propagate or
429
+modify it is void, and will automatically terminate your rights under
430
+this License (including any patent licenses granted under the third
431
+paragraph of section 11).
432
+
433
+  However, if you cease all violation of this License, then your
434
+license from a particular copyright holder is reinstated (a)
435
+provisionally, unless and until the copyright holder explicitly and
436
+finally terminates your license, and (b) permanently, if the copyright
437
+holder fails to notify you of the violation by some reasonable means
438
+prior to 60 days after the cessation.
439
+
440
+  Moreover, your license from a particular copyright holder is
441
+reinstated permanently if the copyright holder notifies you of the
442
+violation by some reasonable means, this is the first time you have
443
+received notice of violation of this License (for any work) from that
444
+copyright holder, and you cure the violation prior to 30 days after
445
+your receipt of the notice.
446
+
447
+  Termination of your rights under this section does not terminate the
448
+licenses of parties who have received copies or rights from you under
449
+this License.  If your rights have been terminated and not permanently
450
+reinstated, you do not qualify to receive new licenses for the same
451
+material under section 10.
452
+
453
+  9. Acceptance Not Required for Having Copies.
454
+
455
+  You are not required to accept this License in order to receive or
456
+run a copy of the Program.  Ancillary propagation of a covered work
457
+occurring solely as a consequence of using peer-to-peer transmission
458
+to receive a copy likewise does not require acceptance.  However,
459
+nothing other than this License grants you permission to propagate or
460
+modify any covered work.  These actions infringe copyright if you do
461
+not accept this License.  Therefore, by modifying or propagating a
462
+covered work, you indicate your acceptance of this License to do so.
463
+
464
+  10. Automatic Licensing of Downstream Recipients.
465
+
466
+  Each time you convey a covered work, the recipient automatically
467
+receives a license from the original licensors, to run, modify and
468
+propagate that work, subject to this License.  You are not responsible
469
+for enforcing compliance by third parties with this License.
470
+
471
+  An "entity transaction" is a transaction transferring control of an
472
+organization, or substantially all assets of one, or subdividing an
473
+organization, or merging organizations.  If propagation of a covered
474
+work results from an entity transaction, each party to that
475
+transaction who receives a copy of the work also receives whatever
476
+licenses to the work the party's predecessor in interest had or could
477
+give under the previous paragraph, plus a right to possession of the
478
+Corresponding Source of the work from the predecessor in interest, if
479
+the predecessor has it or can get it with reasonable efforts.
480
+
481
+  You may not impose any further restrictions on the exercise of the
482
+rights granted or affirmed under this License.  For example, you may
483
+not impose a license fee, royalty, or other charge for exercise of
484
+rights granted under this License, and you may not initiate litigation
485
+(including a cross-claim or counterclaim in a lawsuit) alleging that
486
+any patent claim is infringed by making, using, selling, offering for
487
+sale, or importing the Program or any portion of it.
488
+
489
+  11. Patents.
490
+
491
+  A "contributor" is a copyright holder who authorizes use under this
492
+License of the Program or a work on which the Program is based.  The
493
+work thus licensed is called the contributor's "contributor version".
494
+
495
+  A contributor's "essential patent claims" are all patent claims
496
+owned or controlled by the contributor, whether already acquired or
497
+hereafter acquired, that would be infringed by some manner, permitted
498
+by this License, of making, using, or selling its contributor version,
499
+but do not include claims that would be infringed only as a
500
+consequence of further modification of the contributor version.  For
501
+purposes of this definition, "control" includes the right to grant
502
+patent sublicenses in a manner consistent with the requirements of
503
+this License.
504
+
505
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
506
+patent license under the contributor's essential patent claims, to
507
+make, use, sell, offer for sale, import and otherwise run, modify and
508
+propagate the contents of its contributor version.
509
+
510
+  In the following three paragraphs, a "patent license" is any express
511
+agreement or commitment, however denominated, not to enforce a patent
512
+(such as an express permission to practice a patent or covenant not to
513
+sue for patent infringement).  To "grant" such a patent license to a
514
+party means to make such an agreement or commitment not to enforce a
515
+patent against the party.
516
+
517
+  If you convey a covered work, knowingly relying on a patent license,
518
+and the Corresponding Source of the work is not available for anyone
519
+to copy, free of charge and under the terms of this License, through a
520
+publicly available network server or other readily accessible means,
521
+then you must either (1) cause the Corresponding Source to be so
522
+available, or (2) arrange to deprive yourself of the benefit of the
523
+patent license for this particular work, or (3) arrange, in a manner
524
+consistent with the requirements of this License, to extend the patent
525
+license to downstream recipients.  "Knowingly relying" means you have
526
+actual knowledge that, but for the patent license, your conveying the
527
+covered work in a country, or your recipient's use of the covered work
528
+in a country, would infringe one or more identifiable patents in that
529
+country that you have reason to believe are valid.
530
+
531
+  If, pursuant to or in connection with a single transaction or
532
+arrangement, you convey, or propagate by procuring conveyance of, a
533
+covered work, and grant a patent license to some of the parties
534
+receiving the covered work authorizing them to use, propagate, modify
535
+or convey a specific copy of the covered work, then the patent license
536
+you grant is automatically extended to all recipients of the covered
537
+work and works based on it.
538
+
539
+  A patent license is "discriminatory" if it does not include within
540
+the scope of its coverage, prohibits the exercise of, or is
541
+conditioned on the non-exercise of one or more of the rights that are
542
+specifically granted under this License.  You may not convey a covered
543
+work if you are a party to an arrangement with a third party that is
544
+in the business of distributing software, under which you make payment
545
+to the third party based on the extent of your activity of conveying
546
+the work, and under which the third party grants, to any of the
547
+parties who would receive the covered work from you, a discriminatory
548
+patent license (a) in connection with copies of the covered work
549
+conveyed by you (or copies made from those copies), or (b) primarily
550
+for and in connection with specific products or compilations that
551
+contain the covered work, unless you entered into that arrangement,
552
+or that patent license was granted, prior to 28 March 2007.
553
+
554
+  Nothing in this License shall be construed as excluding or limiting
555
+any implied license or other defenses to infringement that may
556
+otherwise be available to you under applicable patent law.
557
+
558
+  12. No Surrender of Others' Freedom.
559
+
560
+  If conditions are imposed on you (whether by court order, agreement or
561
+otherwise) that contradict the conditions of this License, they do not
562
+excuse you from the conditions of this License.  If you cannot convey a
563
+covered work so as to satisfy simultaneously your obligations under this
564
+License and any other pertinent obligations, then as a consequence you may
565
+not convey it at all.  For example, if you agree to terms that obligate you
566
+to collect a royalty for further conveying from those to whom you convey
567
+the Program, the only way you could satisfy both those terms and this
568
+License would be to refrain entirely from conveying the Program.
569
+
570
+  13. Use with the GNU Affero General Public License.
571
+
572
+  Notwithstanding any other provision of this License, you have
573
+permission to link or combine any covered work with a work licensed
574
+under version 3 of the GNU Affero General Public License into a single
575
+combined work, and to convey the resulting work.  The terms of this
576
+License will continue to apply to the part which is the covered work,
577
+but the special requirements of the GNU Affero General Public License,
578
+section 13, concerning interaction through a network will apply to the
579
+combination as such.
580
+
581
+  14. Revised Versions of this License.
582
+
583
+  The Free Software Foundation may publish revised and/or new versions of
584
+the GNU General Public License from time to time.  Such new versions will
585
+be similar in spirit to the present version, but may differ in detail to
586
+address new problems or concerns.
587
+
588
+  Each version is given a distinguishing version number.  If the
589
+Program specifies that a certain numbered version of the GNU General
590
+Public License "or any later version" applies to it, you have the
591
+option of following the terms and conditions either of that numbered
592
+version or of any later version published by the Free Software
593
+Foundation.  If the Program does not specify a version number of the
594
+GNU General Public License, you may choose any version ever published
595
+by the Free Software Foundation.
596
+
597
+  If the Program specifies that a proxy can decide which future
598
+versions of the GNU General Public License can be used, that proxy's
599
+public statement of acceptance of a version permanently authorizes you
600
+to choose that version for the Program.
601
+
602
+  Later license versions may give you additional or different
603
+permissions.  However, no additional obligations are imposed on any
604
+author or copyright holder as a result of your choosing to follow a
605
+later version.
606
+
607
+  15. Disclaimer of Warranty.
608
+
609
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
610
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
611
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
612
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
613
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
614
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
615
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
616
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
617
+
618
+  16. Limitation of Liability.
619
+
620
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
621
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
622
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
623
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
624
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
625
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
626
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
627
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
628
+SUCH DAMAGES.
629
+
630
+  17. Interpretation of Sections 15 and 16.
631
+
632
+  If the disclaimer of warranty and limitation of liability provided
633
+above cannot be given local legal effect according to their terms,
634
+reviewing courts shall apply local law that most closely approximates
635
+an absolute waiver of all civil liability in connection with the
636
+Program, unless a warranty or assumption of liability accompanies a
637
+copy of the Program in return for a fee.
638
+
639
+                     END OF TERMS AND CONDITIONS
640
+
641
+            How to Apply These Terms to Your New Programs
642
+
643
+  If you develop a new program, and you want it to be of the greatest
644
+possible use to the public, the best way to achieve this is to make it
645
+free software which everyone can redistribute and change under these terms.
646
+
647
+  To do so, attach the following notices to the program.  It is safest
648
+to attach them to the start of each source file to most effectively
649
+state the exclusion of warranty; and each file should have at least
650
+the "copyright" line and a pointer to where the full notice is found.
651
+
652
+    <one line to give the program's name and a brief idea of what it does.>
653
+    Copyright (C) <year>  <name of author>
654
+
655
+    This program is free software: you can redistribute it and/or modify
656
+    it under the terms of the GNU General Public License as published by
657
+    the Free Software Foundation, either version 3 of the License, or
658
+    (at your option) any later version.
659
+
660
+    This program is distributed in the hope that it will be useful,
661
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
662
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
663
+    GNU General Public License for more details.
664
+
665
+    You should have received a copy of the GNU General Public License
666
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
667
+
668
+Also add information on how to contact you by electronic and paper mail.
669
+
670
+  If the program does terminal interaction, make it output a short
671
+notice like this when it starts in an interactive mode:
672
+
673
+    <program>  Copyright (C) <year>  <name of author>
674
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
675
+    This is free software, and you are welcome to redistribute it
676
+    under certain conditions; type `show c' for details.
677
+
678
+The hypothetical commands `show w' and `show c' should show the appropriate
679
+parts of the General Public License.  Of course, your program's commands
680
+might be different; for a GUI interface, you would use an "about box".
681
+
682
+  You should also get your employer (if you work as a programmer) or school,
683
+if any, to sign a "copyright disclaimer" for the program, if necessary.
684
+For more information on this, and how to apply and follow the GNU GPL, see
685
+<https://www.gnu.org/licenses/>.
686
+
687
+  The GNU General Public License does not permit incorporating your program
688
+into proprietary programs.  If your program is a subroutine library, you
689
+may consider it more useful to permit linking proprietary applications with
690
+the library.  If this is what you want to do, use the GNU Lesser General
691
+Public License instead of this License.  But first, please read
692
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
693
+
694
+
695
+
696
+                   GNU LESSER GENERAL PUBLIC LICENSE
697
+                       Version 3, 29 June 2007
698
+
699
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
700
+ Everyone is permitted to copy and distribute verbatim copies
701
+ of this license document, but changing it is not allowed.
702
+
703
+
704
+  This version of the GNU Lesser General Public License incorporates
705
+the terms and conditions of version 3 of the GNU General Public
706
+License, supplemented by the additional permissions listed below.
707
+
708
+  0. Additional Definitions.
709
+
710
+  As used herein, "this License" refers to version 3 of the GNU Lesser
711
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
712
+General Public License.
713
+
714
+  "The Library" refers to a covered work governed by this License,
715
+other than an Application or a Combined Work as defined below.
716
+
717
+  An "Application" is any work that makes use of an interface provided
718
+by the Library, but which is not otherwise based on the Library.
719
+Defining a subclass of a class defined by the Library is deemed a mode
720
+of using an interface provided by the Library.
721
+
722
+  A "Combined Work" is a work produced by combining or linking an
723
+Application with the Library.  The particular version of the Library
724
+with which the Combined Work was made is also called the "Linked
725
+Version".
726
+
727
+  The "Minimal Corresponding Source" for a Combined Work means the
728
+Corresponding Source for the Combined Work, excluding any source code
729
+for portions of the Combined Work that, considered in isolation, are
730
+based on the Application, and not on the Linked Version.
731
+
732
+  The "Corresponding Application Code" for a Combined Work means the
733
+object code and/or source code for the Application, including any data
734
+and utility programs needed for reproducing the Combined Work from the
735
+Application, but excluding the System Libraries of the Combined Work.
736
+
737
+  1. Exception to Section 3 of the GNU GPL.
738
+
739
+  You may convey a covered work under sections 3 and 4 of this License
740
+without being bound by section 3 of the GNU GPL.
741
+
742
+  2. Conveying Modified Versions.
743
+
744
+  If you modify a copy of the Library, and, in your modifications, a
745
+facility refers to a function or data to be supplied by an Application
746
+that uses the facility (other than as an argument passed when the
747
+facility is invoked), then you may convey a copy of the modified
748
+version:
749
+
750
+   a) under this License, provided that you make a good faith effort to
751
+   ensure that, in the event an Application does not supply the
752
+   function or data, the facility still operates, and performs
753
+   whatever part of its purpose remains meaningful, or
754
+
755
+   b) under the GNU GPL, with none of the additional permissions of
756
+   this License applicable to that copy.
757
+
758
+  3. Object Code Incorporating Material from Library Header Files.
759
+
760
+  The object code form of an Application may incorporate material from
761
+a header file that is part of the Library.  You may convey such object
762
+code under terms of your choice, provided that, if the incorporated
763
+material is not limited to numerical parameters, data structure
764
+layouts and accessors, or small macros, inline functions and templates
765
+(ten or fewer lines in length), you do both of the following:
766
+
767
+   a) Give prominent notice with each copy of the object code that the
768
+   Library is used in it and that the Library and its use are
769
+   covered by this License.
770
+
771
+   b) Accompany the object code with a copy of the GNU GPL and this license
772
+   document.
773
+
774
+  4. Combined Works.
775
+
776
+  You may convey a Combined Work under terms of your choice that,
777
+taken together, effectively do not restrict modification of the
778
+portions of the Library contained in the Combined Work and reverse
779
+engineering for debugging such modifications, if you also do each of
780
+the following:
781
+
782
+   a) Give prominent notice with each copy of the Combined Work that
783
+   the Library is used in it and that the Library and its use are
784
+   covered by this License.
785
+
786
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
787
+   document.
788
+
789
+   c) For a Combined Work that displays copyright notices during
790
+   execution, include the copyright notice for the Library among
791
+   these notices, as well as a reference directing the user to the
792
+   copies of the GNU GPL and this license document.
793
+
794
+   d) Do one of the following:
795
+
796
+       0) Convey the Minimal Corresponding Source under the terms of this
797
+       License, and the Corresponding Application Code in a form
798
+       suitable for, and under terms that permit, the user to
799
+       recombine or relink the Application with a modified version of
800
+       the Linked Version to produce a modified Combined Work, in the
801
+       manner specified by section 6 of the GNU GPL for conveying
802
+       Corresponding Source.
803
+
804
+       1) Use a suitable shared library mechanism for linking with the
805
+       Library.  A suitable mechanism is one that (a) uses at run time
806
+       a copy of the Library already present on the user's computer
807
+       system, and (b) will operate properly with a modified version
808
+       of the Library that is interface-compatible with the Linked
809
+       Version.
810
+
811
+   e) Provide Installation Information, but only if you would otherwise
812
+   be required to provide such information under section 6 of the
813
+   GNU GPL, and only to the extent that such information is
814
+   necessary to install and execute a modified version of the
815
+   Combined Work produced by recombining or relinking the
816
+   Application with a modified version of the Linked Version. (If
817
+   you use option 4d0, the Installation Information must accompany
818
+   the Minimal Corresponding Source and Corresponding Application
819
+   Code. If you use option 4d1, you must provide the Installation
820
+   Information in the manner specified by section 6 of the GNU GPL
821
+   for conveying Corresponding Source.)
822
+
823
+  5. Combined Libraries.
824
+
825
+  You may place library facilities that are a work based on the
826
+Library side by side in a single library together with other library
827
+facilities that are not Applications and are not covered by this
828
+License, and convey such a combined library under terms of your
829
+choice, if you do both of the following:
830
+
831
+   a) Accompany the combined library with a copy of the same work based
832
+   on the Library, uncombined with any other library facilities,
833
+   conveyed under the terms of this License.
834
+
835
+   b) Give prominent notice with the combined library that part of it
836
+   is a work based on the Library, and explaining where to find the
837
+   accompanying uncombined form of the same work.
838
+
839
+  6. Revised Versions of the GNU Lesser General Public License.
840
+
841
+  The Free Software Foundation may publish revised and/or new versions
842
+of the GNU Lesser General Public License from time to time. Such new
843
+versions will be similar in spirit to the present version, but may
844
+differ in detail to address new problems or concerns.
845
+
846
+  Each version is given a distinguishing version number. If the
847
+Library as you received it specifies that a certain numbered version
848
+of the GNU Lesser General Public License "or any later version"
849
+applies to it, you have the option of following the terms and
850
+conditions either of that published version or of any later version
851
+published by the Free Software Foundation. If the Library as you
852
+received it does not specify a version number of the GNU Lesser
853
+General Public License, you may choose any version of the GNU Lesser
854
+General Public License ever published by the Free Software Foundation.
855
+
856
+  If the Library as you received it specifies that a proxy can decide
857
+whether future versions of the GNU Lesser General Public License shall
858
+apply, that proxy's public statement of acceptance of any version is
859
+permanent authorization for you to choose that version for the
860
+Library.
861
+
... ...
@@ -0,0 +1,391 @@
1
+declare module lib_code {
2
+    /**
3
+     * @author fenris
4
+     */
5
+    interface interface_code<type_from, type_to> {
6
+        /**
7
+         * @author fenris
8
+         */
9
+        encode(x: type_from): type_to;
10
+        /**
11
+         * @author fenris
12
+         */
13
+        decode(x: type_to): type_from;
14
+    }
15
+}
16
+declare module lib_code {
17
+}
18
+declare module lib_code {
19
+    /**
20
+     * @author Christian Fraß <frass@greenscale.de>
21
+     */
22
+    function custom_encode<type_from, type_to>(function_: (from: type_from) => type_to, from: type_from): type_to;
23
+    /**
24
+     * @author Christian Fraß <frass@greenscale.de>
25
+     */
26
+    function custom_decode<type_from, type_to>(function_: (to: type_to) => type_from, to: type_to): type_from;
27
+}
28
+declare module lib_code {
29
+    /**
30
+     * @author fenris
31
+     */
32
+    class class_code_custom<type_from, type_to> implements interface_code<type_from, type_to> {
33
+        /**
34
+         * @author fenris
35
+         */
36
+        private encodefunc;
37
+        /**
38
+         * @author fenris
39
+         */
40
+        private decodefunc;
41
+        /**
42
+         * @author fenris
43
+         */
44
+        constructor(encodefunc: (from: type_from) => type_to, decodefunc: (to: type_to) => type_from);
45
+        /**
46
+         * @implementation
47
+         * @author fenris
48
+         */
49
+        encode(x: type_from): type_to;
50
+        /**
51
+         * @implementation
52
+         * @author fenris
53
+         */
54
+        decode(x: type_to): type_from;
55
+    }
56
+}
57
+declare module lib_code {
58
+    /**
59
+     * @author fenris
60
+     */
61
+    function inverse_encode<type_from, type_to>(decode: (to: type_to) => type_from, to: type_to): type_from;
62
+    /**
63
+     * @author fenris
64
+     */
65
+    function inverse_decode<type_from, type_to>(encode: (from: type_from) => type_to, from: type_from): type_to;
66
+}
67
+declare module lib_code {
68
+}
69
+declare module lib_code {
70
+    /**
71
+     * @author fenris
72
+     */
73
+    class class_code_inverse<type_from, type_to> implements interface_code<type_to, type_from> {
74
+        /**
75
+         * @author fenris
76
+         */
77
+        protected subject: interface_code<type_from, type_to>;
78
+        /**
79
+         * @author fenris
80
+         */
81
+        constructor(subject: interface_code<type_from, type_to>);
82
+        /**
83
+         * @implementation
84
+         * @author fenris
85
+         */
86
+        encode(to: type_to): type_from;
87
+        /**
88
+         * @implementation
89
+         * @author fenris
90
+         */
91
+        decode(from: type_from): type_to;
92
+    }
93
+}
94
+declare module lib_code {
95
+    /**
96
+     * @author fenris
97
+     */
98
+    function pair_encode<type_from, type_between, type_to>(encode_first: (from: type_from) => type_between, encode_second: (between: type_between) => type_to, from: type_from): type_to;
99
+    /**
100
+     * @author fenris
101
+     */
102
+    function pair_decode<type_from, type_between, type_to>(decode_first: (between: type_between) => type_from, decode_second: (to: type_to) => type_between, to: type_to): type_from;
103
+}
104
+declare module lib_code {
105
+}
106
+declare module lib_code {
107
+    /**
108
+     * @author fenris
109
+     */
110
+    class class_code_pair<type_from, type_between, type_to> implements interface_code<type_from, type_to> {
111
+        /**
112
+         * @author fenris
113
+         */
114
+        protected first: interface_code<type_from, type_between>;
115
+        /**
116
+         * @author fenris
117
+         */
118
+        protected second: interface_code<type_between, type_to>;
119
+        /**
120
+         * @author fenris
121
+         */
122
+        constructor(first: interface_code<type_from, type_between>, second: interface_code<type_between, type_to>);
123
+        /**
124
+         * @implementation
125
+         * @author fenris
126
+         */
127
+        encode(from: type_from): type_to;
128
+        /**
129
+         * @implementation
130
+         * @author fenris
131
+         */
132
+        decode(to: type_to): type_from;
133
+    }
134
+}
135
+declare module lib_code {
136
+    /**
137
+     * @author fenris
138
+     */
139
+    function chain_encode(encode_links: Array<(from: any) => any>, from: any): any;
140
+    /**
141
+     * @author fenris
142
+     */
143
+    function chain_decode(decode_links: Array<(to: any) => any>, to: any): any;
144
+}
145
+declare module lib_code {
146
+    /**
147
+     * @author fenris
148
+     */
149
+    class class_code_chain implements interface_code<any, any> {
150
+        /**
151
+         * @author fenris
152
+         */
153
+        protected links: Array<interface_code<any, any>>;
154
+        /**
155
+         * @author fenris
156
+         */
157
+        constructor(links: Array<interface_code<any, any>>);
158
+        /**
159
+         * @implementation
160
+         * @author fenris
161
+         */
162
+        encode(from: any): any;
163
+        /**
164
+         * @implementation
165
+         * @author fenris
166
+         */
167
+        decode(to: any): any;
168
+    }
169
+}
170
+declare module lib_code {
171
+    /**
172
+     * @author Christian Fraß <frass@greenscale.de>
173
+     */
174
+    type type_flatten_from = Array<{
175
+        [name: string]: any;
176
+    }>;
177
+    /**
178
+     * @author Christian Fraß <frass@greenscale.de>
179
+     */
180
+    type type_flatten_to = {
181
+        keys: Array<string>;
182
+        data: Array<Array<any>>;
183
+    };
184
+    /**
185
+     * @author Christian Fraß <frass@greenscale.de>
186
+     */
187
+    function flatten_encode(from: type_flatten_from, keys?: Array<string>): type_flatten_to;
188
+    /**
189
+     * @author Christian Fraß <frass@greenscale.de>
190
+     */
191
+    function flatten_decode(to: type_flatten_to): type_flatten_from;
192
+}
193
+declare module lib_code {
194
+    /**
195
+     * @author fenris
196
+     */
197
+    class class_code_flatten implements interface_code<type_flatten_from, type_flatten_to> {
198
+        /**
199
+         * @author fenris
200
+         */
201
+        constructor();
202
+        /**
203
+         * @implementation
204
+         * @author fenris
205
+         */
206
+        encode(x: type_flatten_from): type_flatten_to;
207
+        /**
208
+         * @implementation
209
+         * @author fenris
210
+         */
211
+        decode(x: type_flatten_to): type_flatten_from;
212
+    }
213
+}
214
+declare module lib_code {
215
+    /**
216
+     * @author fenris
217
+     */
218
+    function jsdate_encode(date: Date): string;
219
+    /**
220
+     * @author fenris
221
+     */
222
+    function jsdate_decode(date_: string): Date;
223
+}
224
+declare module lib_code {
225
+}
226
+declare module lib_code {
227
+    /**
228
+     * @author fenris
229
+     */
230
+    class class_code_jsdate implements interface_code<Date, string> {
231
+        /**
232
+         * @author fenris
233
+         */
234
+        constructor();
235
+        /**
236
+         * @implementation
237
+         * @author fenris
238
+         */
239
+        encode(x: Date): string;
240
+        /**
241
+         * @implementation
242
+         * @author fenris
243
+         */
244
+        decode(x: string): Date;
245
+    }
246
+}
247
+declare module lib_code {
248
+    /**
249
+     * @author fenris
250
+     */
251
+    function json_encode(x: any, formatted?: boolean): string;
252
+    /**
253
+     * @author fenris
254
+     */
255
+    function json_decode(x: string): any;
256
+}
257
+declare module lib_code {
258
+}
259
+declare module lib_code {
260
+    /**
261
+     * @author fenris
262
+     */
263
+    class class_code_json implements interface_code<any, string> {
264
+        /**
265
+         * @author fenris
266
+         */
267
+        constructor();
268
+        /**
269
+         * @implementation
270
+         * @author fenris
271
+         */
272
+        encode(x: any): string;
273
+        /**
274
+         * @implementation
275
+         * @author fenris
276
+         */
277
+        decode(x: string): any;
278
+    }
279
+}
280
+declare module lib_code {
281
+    /**
282
+     * @author Christian Fraß <frass@greenscale.de>
283
+     */
284
+    type type_csv_from = {
285
+        head: Array<string>;
286
+        data: Array<Array<string>>;
287
+    };
288
+    /**
289
+     * @author Christian Fraß <frass@greenscale.de>
290
+     * @todo escaping
291
+     */
292
+    function csv_encode(from: type_csv_from, { "delimiter": delimiter, "linebreak": linebreak, }?: {
293
+        delimiter?: string;
294
+        linebreak?: string;
295
+    }): string;
296
+    /**
297
+     * @author Christian Fraß <frass@greenscale.de>
298
+     */
299
+    function csv_decode(to: string, { "delimiter": delimiter, "linebreak": linebreak, "with_head": with_head, }?: {
300
+        delimiter?: string;
301
+        linebreak?: string;
302
+        with_head?: boolean;
303
+    }): type_csv_from;
304
+}
305
+declare module lib_code {
306
+    /**
307
+     * @author fenris
308
+     */
309
+    class class_code_csv implements interface_code<type_csv_from, string> {
310
+        /**
311
+         * @author fenris
312
+         */
313
+        constructor();
314
+        /**
315
+         * @implementation
316
+         * @author fenris
317
+         */
318
+        encode(x: type_csv_from): string;
319
+        /**
320
+         * @implementation
321
+         * @author fenris
322
+         */
323
+        decode(x: string): type_csv_from;
324
+    }
325
+}
326
+declare module lib_code {
327
+    /**
328
+     * @author fenris
329
+     */
330
+    function uri_encode(x: string): string;
331
+    /**
332
+     * @author fenris
333
+     */
334
+    function uri_decode(x: string): string;
335
+}
336
+declare module lib_code {
337
+}
338
+declare module lib_code {
339
+    /**
340
+     * @author fenris
341
+     */
342
+    class class_code_uri implements interface_code<string, string> {
343
+        /**
344
+         * @author fenris
345
+         */
346
+        constructor();
347
+        /**
348
+         * @implementation
349
+         * @author fenris
350
+         */
351
+        encode(x: string): string;
352
+        /**
353
+         * @implementation
354
+         * @author fenris
355
+         */
356
+        decode(x: string): string;
357
+    }
358
+}
359
+declare module lib_code {
360
+    /**
361
+     * @author fenris
362
+     */
363
+    function base64_encode(x: string): string;
364
+    /**
365
+     * @author fenris
366
+     */
367
+    function base64_decode(x: string): string;
368
+}
369
+declare module lib_code {
370
+}
371
+declare module lib_code {
372
+    /**
373
+     * @author fenris
374
+     */
375
+    class class_code_base64 implements interface_code<string, string> {
376
+        /**
377
+         * @author fenris
378
+         */
379
+        constructor();
380
+        /**
381
+         * @implementation
382
+         * @author fenris
383
+         */
384
+        encode(x: string): string;
385
+        /**
386
+         * @implementation
387
+         * @author fenris
388
+         */
389
+        decode(x: string): string;
390
+    }
391
+}
... ...
@@ -0,0 +1,1236 @@
1
+/*
2
+This file is part of »bacterio-plankton:code«.
3
+
4
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5
+<info@greenscale.de>
6
+
7
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
8
+it under the terms of the GNU Lesser General Public License as published by
9
+the Free Software Foundation, either version 3 of the License, or
10
+(at your option) any later version.
11
+
12
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
13
+but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+GNU Lesser General Public License for more details.
16
+
17
+You should have received a copy of the GNU Lesser General Public License
18
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+/*
21
+This file is part of »bacterio-plankton:code«.
22
+
23
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
24
+<info@greenscale.de>
25
+
26
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
27
+it under the terms of the GNU Lesser General Public License as published by
28
+the Free Software Foundation, either version 3 of the License, or
29
+(at your option) any later version.
30
+
31
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
32
+but WITHOUT ANY WARRANTY; without even the implied warranty of
33
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34
+GNU Lesser General Public License for more details.
35
+
36
+You should have received a copy of the GNU Lesser General Public License
37
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
38
+ */
39
+var lib_code;
40
+(function (lib_code) {
41
+    /**
42
+     * @author fenris
43
+     */
44
+    lib_trait.define("code", {
45
+        "from": null,
46
+        "to": null
47
+    }, {
48
+        "encode": {
49
+            "shape": {
50
+                "name": "function",
51
+                "parameters": {
52
+                    "shape_input": {
53
+                        "name": "variable",
54
+                        "parameters": {
55
+                            "name": "from"
56
+                        }
57
+                    },
58
+                    "shape_output": {
59
+                        "name": "variable",
60
+                        "parameters": {
61
+                            "name": "to"
62
+                        }
63
+                    }
64
+                }
65
+            }
66
+        },
67
+        "decode": {
68
+            "shape": {
69
+                "name": "function",
70
+                "parameters": {
71
+                    "shape_input": {
72
+                        "name": "variable",
73
+                        "parameters": {
74
+                            "name": "to"
75
+                        }
76
+                    },
77
+                    "shape_output": {
78
+                        "name": "variable",
79
+                        "parameters": {
80
+                            "name": "from"
81
+                        }
82
+                    }
83
+                }
84
+            }
85
+        }
86
+    });
87
+})(lib_code || (lib_code = {}));
88
+/*
89
+This file is part of »bacterio-plankton:code«.
90
+
91
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
92
+<info@greenscale.de>
93
+
94
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
95
+it under the terms of the GNU Lesser General Public License as published by
96
+the Free Software Foundation, either version 3 of the License, or
97
+(at your option) any later version.
98
+
99
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
100
+but WITHOUT ANY WARRANTY; without even the implied warranty of
101
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
102
+GNU Lesser General Public License for more details.
103
+
104
+You should have received a copy of the GNU Lesser General Public License
105
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
106
+ */
107
+var lib_code;
108
+(function (lib_code) {
109
+    /**
110
+     * @author Christian Fraß <frass@greenscale.de>
111
+     */
112
+    function custom_encode(function_, from) {
113
+        return function_(from);
114
+    }
115
+    lib_code.custom_encode = custom_encode;
116
+    /**
117
+     * @author Christian Fraß <frass@greenscale.de>
118
+     */
119
+    function custom_decode(function_, to) {
120
+        return function_(to);
121
+    }
122
+    lib_code.custom_decode = custom_decode;
123
+})(lib_code || (lib_code = {}));
124
+/*
125
+This file is part of »bacterio-plankton:code«.
126
+
127
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
128
+<info@greenscale.de>
129
+
130
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
131
+it under the terms of the GNU Lesser General Public License as published by
132
+the Free Software Foundation, either version 3 of the License, or
133
+(at your option) any later version.
134
+
135
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
136
+but WITHOUT ANY WARRANTY; without even the implied warranty of
137
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
138
+GNU Lesser General Public License for more details.
139
+
140
+You should have received a copy of the GNU Lesser General Public License
141
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
142
+ */
143
+var lib_code;
144
+(function (lib_code) {
145
+    /**
146
+     * @author fenris
147
+     */
148
+    class class_code_custom {
149
+        /**
150
+         * @author fenris
151
+         */
152
+        constructor(encodefunc, decodefunc) {
153
+            this.encodefunc = encodefunc;
154
+            this.decodefunc = decodefunc;
155
+        }
156
+        /**
157
+         * @implementation
158
+         * @author fenris
159
+         */
160
+        encode(x) {
161
+            return lib_code.custom_encode(this.encodefunc, x);
162
+        }
163
+        /**
164
+         * @implementation
165
+         * @author fenris
166
+         */
167
+        decode(x) {
168
+            return lib_code.custom_decode(this.decodefunc, x);
169
+        }
170
+    }
171
+    lib_code.class_code_custom = class_code_custom;
172
+})(lib_code || (lib_code = {}));
173
+/*
174
+This file is part of »bacterio-plankton:code«.
175
+
176
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
177
+<info@greenscale.de>
178
+
179
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
180
+it under the terms of the GNU Lesser General Public License as published by
181
+the Free Software Foundation, either version 3 of the License, or
182
+(at your option) any later version.
183
+
184
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
185
+but WITHOUT ANY WARRANTY; without even the implied warranty of
186
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
187
+GNU Lesser General Public License for more details.
188
+
189
+You should have received a copy of the GNU Lesser General Public License
190
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
191
+ */
192
+var lib_code;
193
+(function (lib_code) {
194
+    /**
195
+     * @author fenris
196
+     */
197
+    function inverse_encode(decode, to) {
198
+        return decode(to);
199
+    }
200
+    lib_code.inverse_encode = inverse_encode;
201
+    /**
202
+     * @author fenris
203
+     */
204
+    function inverse_decode(encode, from) {
205
+        return encode(from);
206
+    }
207
+    lib_code.inverse_decode = inverse_decode;
208
+})(lib_code || (lib_code = {}));
209
+/*
210
+This file is part of »bacterio-plankton:code«.
211
+
212
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
213
+<info@greenscale.de>
214
+
215
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
216
+it under the terms of the GNU Lesser General Public License as published by
217
+the Free Software Foundation, either version 3 of the License, or
218
+(at your option) any later version.
219
+
220
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
221
+but WITHOUT ANY WARRANTY; without even the implied warranty of
222
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
223
+GNU Lesser General Public License for more details.
224
+
225
+You should have received a copy of the GNU Lesser General Public License
226
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
227
+ */
228
+var lib_code;
229
+(function (lib_code) {
230
+    /**
231
+     * @author fenris
232
+     */
233
+    lib_trait.attend("code", "inverse", {
234
+        "from": {
235
+            "name": "any"
236
+        },
237
+        "to": {
238
+            "name": "any"
239
+        }
240
+    }, {
241
+        "encode": (domain_parameters) => (x) => {
242
+            return (lib_code.inverse_encode(y_ => lib_trait.call("code", "decode", domain_parameters.domain_subject)(y_), x));
243
+        },
244
+        "decode": (domain_parameters) => (y) => {
245
+            return (lib_code.inverse_decode(x_ => lib_trait.call("code", "encode", domain_parameters.domain_subject)(x_), y));
246
+        }
247
+    });
248
+})(lib_code || (lib_code = {}));
249
+/*
250
+This file is part of »bacterio-plankton:code«.
251
+
252
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
253
+<info@greenscale.de>
254
+
255
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
256
+it under the terms of the GNU Lesser General Public License as published by
257
+the Free Software Foundation, either version 3 of the License, or
258
+(at your option) any later version.
259
+
260
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
261
+but WITHOUT ANY WARRANTY; without even the implied warranty of
262
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
263
+GNU Lesser General Public License for more details.
264
+
265
+You should have received a copy of the GNU Lesser General Public License
266
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
267
+ */
268
+var lib_code;
269
+(function (lib_code) {
270
+    /**
271
+     * @author fenris
272
+     */
273
+    class class_code_inverse {
274
+        /**
275
+         * @author fenris
276
+         */
277
+        constructor(subject) {
278
+            this.subject = subject;
279
+        }
280
+        /**
281
+         * @implementation
282
+         * @author fenris
283
+         */
284
+        encode(to) {
285
+            return lib_code.inverse_encode(x => this.subject.decode(x), to);
286
+        }
287
+        /**
288
+         * @implementation
289
+         * @author fenris
290
+         */
291
+        decode(from) {
292
+            return lib_code.inverse_decode(x => this.subject.encode(x), from);
293
+        }
294
+    }
295
+    lib_code.class_code_inverse = class_code_inverse;
296
+})(lib_code || (lib_code = {}));
297
+/*
298
+This file is part of »bacterio-plankton:code«.
299
+
300
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
301
+<info@greenscale.de>
302
+
303
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
304
+it under the terms of the GNU Lesser General Public License as published by
305
+the Free Software Foundation, either version 3 of the License, or
306
+(at your option) any later version.
307
+
308
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
309
+but WITHOUT ANY WARRANTY; without even the implied warranty of
310
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
311
+GNU Lesser General Public License for more details.
312
+
313
+You should have received a copy of the GNU Lesser General Public License
314
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
315
+ */
316
+var lib_code;
317
+(function (lib_code) {
318
+    /**
319
+     * @author fenris
320
+     */
321
+    function pair_encode(encode_first, encode_second, from) {
322
+        let between = encode_first(from);
323
+        let to = encode_second(between);
324
+        return to;
325
+    }
326
+    lib_code.pair_encode = pair_encode;
327
+    /**
328
+     * @author fenris
329
+     */
330
+    function pair_decode(decode_first, decode_second, to) {
331
+        let between = decode_second(to);
332
+        let from = decode_first(between);
333
+        return from;
334
+    }
335
+    lib_code.pair_decode = pair_decode;
336
+})(lib_code || (lib_code = {}));
337
+/*
338
+This file is part of »bacterio-plankton:code«.
339
+
340
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
341
+<info@greenscale.de>
342
+
343
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
344
+it under the terms of the GNU Lesser General Public License as published by
345
+the Free Software Foundation, either version 3 of the License, or
346
+(at your option) any later version.
347
+
348
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
349
+but WITHOUT ANY WARRANTY; without even the implied warranty of
350
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
351
+GNU Lesser General Public License for more details.
352
+
353
+You should have received a copy of the GNU Lesser General Public License
354
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
355
+ */
356
+var lib_code;
357
+(function (lib_code) {
358
+    /**
359
+     * @author fenris
360
+     */
361
+    lib_trait.attend("code", "pair", {
362
+        "from": {
363
+            "name": "any"
364
+        },
365
+        "to": {
366
+            "name": "any"
367
+        }
368
+    }, {
369
+        "encode": (domain_parameters) => (x) => {
370
+            return (lib_code.pair_encode(x_ => lib_trait.call("code", "encode", domain_parameters.domain_first)(x_), x_ => lib_trait.call("code", "encode", domain_parameters.domain_second)(x_), x));
371
+        },
372
+        "decode": (domain_parameters) => (y) => {
373
+            return (lib_code.pair_decode(y_ => lib_trait.call("code", "decode", domain_parameters.domain_first)(y_), y_ => lib_trait.call("code", "decode", domain_parameters.domain_second)(y_), y));
374
+        }
375
+    });
376
+})(lib_code || (lib_code = {}));
377
+/*
378
+This file is part of »bacterio-plankton:code«.
379
+
380
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
381
+<info@greenscale.de>
382
+
383
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
384
+it under the terms of the GNU Lesser General Public License as published by
385
+the Free Software Foundation, either version 3 of the License, or
386
+(at your option) any later version.
387
+
388
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
389
+but WITHOUT ANY WARRANTY; without even the implied warranty of
390
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
391
+GNU Lesser General Public License for more details.
392
+
393
+You should have received a copy of the GNU Lesser General Public License
394
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
395
+ */
396
+var lib_code;
397
+(function (lib_code) {
398
+    /**
399
+     * @author fenris
400
+     */
401
+    class class_code_pair {
402
+        /**
403
+         * @author fenris
404
+         */
405
+        constructor(first, second) {
406
+            this.first = first;
407
+            this.second = second;
408
+        }
409
+        /**
410
+         * @implementation
411
+         * @author fenris
412
+         */
413
+        encode(from) {
414
+            return lib_code.pair_encode(x => this.first.encode(x), x => this.second.encode(x), from);
415
+        }
416
+        /**
417
+         * @implementation
418
+         * @author fenris
419
+         */
420
+        decode(to) {
421
+            return lib_code.pair_decode(x => this.first.decode(x), x => this.second.decode(x), to);
422
+        }
423
+    }
424
+    lib_code.class_code_pair = class_code_pair;
425
+})(lib_code || (lib_code = {}));
426
+/*
427
+This file is part of »bacterio-plankton:code«.
428
+
429
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
430
+<info@greenscale.de>
431
+
432
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
433
+it under the terms of the GNU Lesser General Public License as published by
434
+the Free Software Foundation, either version 3 of the License, or
435
+(at your option) any later version.
436
+
437
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
438
+but WITHOUT ANY WARRANTY; without even the implied warranty of
439
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
440
+GNU Lesser General Public License for more details.
441
+
442
+You should have received a copy of the GNU Lesser General Public License
443
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
444
+ */
445
+var lib_code;
446
+(function (lib_code) {
447
+    /**
448
+     * @author fenris
449
+     */
450
+    function chain_encode(encode_links, from) {
451
+        let value = from;
452
+        encode_links
453
+            .forEach((link) => {
454
+            value = link(value);
455
+        });
456
+        return value;
457
+    }
458
+    lib_code.chain_encode = chain_encode;
459
+    /**
460
+     * @author fenris
461
+     */
462
+    function chain_decode(decode_links, to) {
463
+        let value = to;
464
+        decode_links
465
+            .reverse()
466
+            .forEach((link) => {
467
+            value = link(value);
468
+        });
469
+        return value;
470
+    }
471
+    lib_code.chain_decode = chain_decode;
472
+})(lib_code || (lib_code = {}));
473
+/*
474
+This file is part of »bacterio-plankton:code«.
475
+
476
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
477
+<info@greenscale.de>
478
+
479
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
480
+it under the terms of the GNU Lesser General Public License as published by
481
+the Free Software Foundation, either version 3 of the License, or
482
+(at your option) any later version.
483
+
484
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
485
+but WITHOUT ANY WARRANTY; without even the implied warranty of
486
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
487
+GNU Lesser General Public License for more details.
488
+
489
+You should have received a copy of the GNU Lesser General Public License
490
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
491
+ */
492
+var lib_code;
493
+(function (lib_code) {
494
+    /**
495
+     * @author fenris
496
+     */
497
+    class class_code_chain {
498
+        /**
499
+         * @author fenris
500
+         */
501
+        constructor(links) {
502
+            this.links = links;
503
+        }
504
+        /**
505
+         * @implementation
506
+         * @author fenris
507
+         */
508
+        encode(from) {
509
+            return lib_code.chain_encode(this.links.map((link) => (x => link.encode(x))), from);
510
+        }
511
+        /**
512
+         * @implementation
513
+         * @author fenris
514
+         */
515
+        decode(to) {
516
+            return lib_code.chain_decode(this.links.map((link) => (x => link.decode(x))), to);
517
+        }
518
+    }
519
+    lib_code.class_code_chain = class_code_chain;
520
+})(lib_code || (lib_code = {}));
521
+/*
522
+This file is part of »bacterio-plankton:code«.
523
+
524
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
525
+<info@greenscale.de>
526
+
527
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
528
+it under the terms of the GNU Lesser General Public License as published by
529
+the Free Software Foundation, either version 3 of the License, or
530
+(at your option) any later version.
531
+
532
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
533
+but WITHOUT ANY WARRANTY; without even the implied warranty of
534
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
535
+GNU Lesser General Public License for more details.
536
+
537
+You should have received a copy of the GNU Lesser General Public License
538
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
539
+ */
540
+var lib_code;
541
+(function (lib_code) {
542
+    /**
543
+     * @author Christian Fraß <frass@greenscale.de>
544
+     */
545
+    function flatten_encode(from, keys = null) {
546
+        if (keys === null) {
547
+            if (from.length > 0) {
548
+                keys = Object.keys(from[0]);
549
+            }
550
+            else {
551
+                throw (new Error("encoding impossible"));
552
+            }
553
+        }
554
+        return {
555
+            "keys": keys,
556
+            "data": from.map((line) => keys.map((name) => line[name])),
557
+        };
558
+    }
559
+    lib_code.flatten_encode = flatten_encode;
560
+    /**
561
+     * @author Christian Fraß <frass@greenscale.de>
562
+     */
563
+    function flatten_decode(to) {
564
+        return (to.data
565
+            .map((dataset) => {
566
+            let dataset_ = {};
567
+            dataset
568
+                .forEach((value, index) => {
569
+                const name = to.keys[index];
570
+                dataset_[name] = value;
571
+            });
572
+            return dataset_;
573
+        }));
574
+    }
575
+    lib_code.flatten_decode = flatten_decode;
576
+})(lib_code || (lib_code = {}));
577
+/*
578
+This file is part of »bacterio-plankton:code«.
579
+
580
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
581
+<info@greenscale.de>
582
+
583
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
584
+it under the terms of the GNU Lesser General Public License as published by
585
+the Free Software Foundation, either version 3 of the License, or
586
+(at your option) any later version.
587
+
588
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
589
+but WITHOUT ANY WARRANTY; without even the implied warranty of
590
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
591
+GNU Lesser General Public License for more details.
592
+
593
+You should have received a copy of the GNU Lesser General Public License
594
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
595
+ */
596
+var lib_code;
597
+(function (lib_code) {
598
+    /**
599
+     * @author fenris
600
+     */
601
+    class class_code_flatten {
602
+        /**
603
+         * @author fenris
604
+         */
605
+        constructor() {
606
+        }
607
+        /**
608
+         * @implementation
609
+         * @author fenris
610
+         */
611
+        encode(x) {
612
+            return lib_code.flatten_encode(x);
613
+        }
614
+        /**
615
+         * @implementation
616
+         * @author fenris
617
+         */
618
+        decode(x) {
619
+            return lib_code.flatten_decode(x);
620
+        }
621
+    }
622
+    lib_code.class_code_flatten = class_code_flatten;
623
+})(lib_code || (lib_code = {}));
624
+/*
625
+This file is part of »bacterio-plankton:code«.
626
+
627
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
628
+<info@greenscale.de>
629
+
630
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
631
+it under the terms of the GNU Lesser General Public License as published by
632
+the Free Software Foundation, either version 3 of the License, or
633
+(at your option) any later version.
634
+
635
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
636
+but WITHOUT ANY WARRANTY; without even the implied warranty of
637
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
638
+GNU Lesser General Public License for more details.
639
+
640
+You should have received a copy of the GNU Lesser General Public License
641
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
642
+ */
643
+var lib_code;
644
+(function (lib_code) {
645
+    /**
646
+     * @author fenris
647
+     */
648
+    const _prefix = "DATE:";
649
+    /**
650
+     * @author fenris
651
+     */
652
+    function jsdate_encode(date) {
653
+        let isostring = date.toISOString();
654
+        let date_ = (_prefix + isostring);
655
+        return date_;
656
+    }
657
+    lib_code.jsdate_encode = jsdate_encode;
658
+    /**
659
+     * @author fenris
660
+     */
661
+    function jsdate_decode(date_) {
662
+        if ((typeof (date_) === "string") && (date_.startsWith(_prefix))) {
663
+            let isostring = date_.slice(_prefix.length);
664
+            let timestamp = Date.parse(isostring);
665
+            if (!isNaN(timestamp)) {
666
+                let date = (new Date(timestamp));
667
+                return date;
668
+            }
669
+            else {
670
+                let message = ("'" + isostring + "' does not seem to be an ISO-string of a date");
671
+                throw (new Error(message));
672
+            }
673
+        }
674
+        else {
675
+            let message = ("expected an encoded date object to be a string starting with '" + _prefix + "'");
676
+            throw (new Error(message));
677
+        }
678
+    }
679
+    lib_code.jsdate_decode = jsdate_decode;
680
+})(lib_code || (lib_code = {}));
681
+/*
682
+This file is part of »bacterio-plankton:code«.
683
+
684
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
685
+<info@greenscale.de>
686
+
687
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
688
+it under the terms of the GNU Lesser General Public License as published by
689
+the Free Software Foundation, either version 3 of the License, or
690
+(at your option) any later version.
691
+
692
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
693
+but WITHOUT ANY WARRANTY; without even the implied warranty of
694
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
695
+GNU Lesser General Public License for more details.
696
+
697
+You should have received a copy of the GNU Lesser General Public License
698
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
699
+ */
700
+var lib_code;
701
+(function (lib_code) {
702
+    /**
703
+     * @author fenris
704
+     */
705
+    lib_trait.attend("code", "jsdate", {
706
+        "from": {
707
+            "name": "date"
708
+        },
709
+        "to": {
710
+            "name": "string"
711
+        }
712
+    }, {
713
+        "encode": () => (x) => {
714
+            return lib_code.jsdate_encode(x);
715
+        },
716
+        "decode": () => (y) => {
717
+            return lib_code.jsdate_decode(y);
718
+        }
719
+    });
720
+})(lib_code || (lib_code = {}));
721
+/*
722
+This file is part of »bacterio-plankton:code«.
723
+
724
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
725
+<info@greenscale.de>
726
+
727
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
728
+it under the terms of the GNU Lesser General Public License as published by
729
+the Free Software Foundation, either version 3 of the License, or
730
+(at your option) any later version.
731
+
732
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
733
+but WITHOUT ANY WARRANTY; without even the implied warranty of
734
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
735
+GNU Lesser General Public License for more details.
736
+
737
+You should have received a copy of the GNU Lesser General Public License
738
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
739
+ */
740
+var lib_code;
741
+(function (lib_code) {
742
+    /**
743
+     * @author fenris
744
+     */
745
+    class class_code_jsdate {
746
+        /**
747
+         * @author fenris
748
+         */
749
+        constructor() {
750
+        }
751
+        /**
752
+         * @implementation
753
+         * @author fenris
754
+         */
755
+        encode(x) {
756
+            return lib_code.jsdate_encode(x);
757
+        }
758
+        /**
759
+         * @implementation
760
+         * @author fenris
761
+         */
762
+        decode(x) {
763
+            return lib_code.jsdate_decode(x);
764
+        }
765
+    }
766
+    lib_code.class_code_jsdate = class_code_jsdate;
767
+})(lib_code || (lib_code = {}));
768
+/*
769
+This file is part of »bacterio-plankton:code«.
770
+
771
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
772
+<info@greenscale.de>
773
+
774
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
775
+it under the terms of the GNU Lesser General Public License as published by
776
+the Free Software Foundation, either version 3 of the License, or
777
+(at your option) any later version.
778
+
779
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
780
+but WITHOUT ANY WARRANTY; without even the implied warranty of
781
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
782
+GNU Lesser General Public License for more details.
783
+
784
+You should have received a copy of the GNU Lesser General Public License
785
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
786
+ */
787
+var lib_code;
788
+(function (lib_code) {
789
+    /**
790
+     * @author fenris
791
+     */
792
+    function json_encode(x, formatted = false) {
793
+        return JSON.stringify(x, undefined, formatted ? "\t" : undefined);
794
+    }
795
+    lib_code.json_encode = json_encode;
796
+    /**
797
+     * @author fenris
798
+     */
799
+    function json_decode(x) {
800
+        return JSON.parse(x);
801
+    }
802
+    lib_code.json_decode = json_decode;
803
+})(lib_code || (lib_code = {}));
804
+/*
805
+This file is part of »bacterio-plankton:code«.
806
+
807
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
808
+<info@greenscale.de>
809
+
810
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
811
+it under the terms of the GNU Lesser General Public License as published by
812
+the Free Software Foundation, either version 3 of the License, or
813
+(at your option) any later version.
814
+
815
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
816
+but WITHOUT ANY WARRANTY; without even the implied warranty of
817
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
818
+GNU Lesser General Public License for more details.
819
+
820
+You should have received a copy of the GNU Lesser General Public License
821
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
822
+ */
823
+var lib_code;
824
+(function (lib_code) {
825
+    /**
826
+     * @author fenris
827
+     */
828
+    lib_trait.attend("code", "json", {
829
+        "from": {
830
+            "name": "any"
831
+        },
832
+        "to": {
833
+            "name": "string"
834
+        }
835
+    }, {
836
+        "encode": () => (x) => {
837
+            return lib_code.json_encode(x);
838
+        },
839
+        "decode": () => (y) => {
840
+            return lib_code.json_decode(y);
841
+        }
842
+    });
843
+})(lib_code || (lib_code = {}));
844
+/*
845
+This file is part of »bacterio-plankton:code«.
846
+
847
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
848
+<info@greenscale.de>
849
+
850
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
851
+it under the terms of the GNU Lesser General Public License as published by
852
+the Free Software Foundation, either version 3 of the License, or
853
+(at your option) any later version.
854
+
855
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
856
+but WITHOUT ANY WARRANTY; without even the implied warranty of
857
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
858
+GNU Lesser General Public License for more details.
859
+
860
+You should have received a copy of the GNU Lesser General Public License
861
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
862
+ */
863
+var lib_code;
864
+(function (lib_code) {
865
+    /**
866
+     * @author fenris
867
+     */
868
+    class class_code_json {
869
+        /**
870
+         * @author fenris
871
+         */
872
+        constructor() {
873
+        }
874
+        /**
875
+         * @implementation
876
+         * @author fenris
877
+         */
878
+        encode(x) {
879
+            return lib_code.json_encode(x);
880
+        }
881
+        /**
882
+         * @implementation
883
+         * @author fenris
884
+         */
885
+        decode(x) {
886
+            return lib_code.json_decode(x);
887
+        }
888
+    }
889
+    lib_code.class_code_json = class_code_json;
890
+})(lib_code || (lib_code = {}));
891
+/*
892
+This file is part of »bacterio-plankton:code«.
893
+
894
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
895
+<info@greenscale.de>
896
+
897
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
898
+it under the terms of the GNU Lesser General Public License as published by
899
+the Free Software Foundation, either version 3 of the License, or
900
+(at your option) any later version.
901
+
902
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
903
+but WITHOUT ANY WARRANTY; without even the implied warranty of
904
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
905
+GNU Lesser General Public License for more details.
906
+
907
+You should have received a copy of the GNU Lesser General Public License
908
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
909
+ */
910
+var lib_code;
911
+(function (lib_code) {
912
+    /**
913
+     * @author Christian Fraß <frass@greenscale.de>
914
+     * @todo escaping
915
+     */
916
+    function csv_encode(from, { "delimiter": delimiter = ",", "linebreak": linebreak = "\n", } = {}) {
917
+        return (([]
918
+            .concat((from.head !== null)
919
+            ? [from.head]
920
+            : [])
921
+            .concat(from.data))
922
+            .map((dataset) => dataset.join(delimiter))
923
+            .join(linebreak));
924
+    }
925
+    lib_code.csv_encode = csv_encode;
926
+    /**
927
+     * @author Christian Fraß <frass@greenscale.de>
928
+     */
929
+    function csv_decode(to, { "delimiter": delimiter = ",", "linebreak": linebreak = "\n", "with_head": with_head = true, } = {}) {
930
+        const array = (to.split(linebreak)
931
+            .map((line) => line.split(delimiter)));
932
+        return (with_head
933
+            ? ({
934
+                "head": array[0],
935
+                "data": array.slice(1),
936
+            })
937
+            : ({
938
+                "head": null,
939
+                "data": array,
940
+            }));
941
+    }
942
+    lib_code.csv_decode = csv_decode;
943
+})(lib_code || (lib_code = {}));
944
+/*
945
+This file is part of »bacterio-plankton:code«.
946
+
947
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
948
+<info@greenscale.de>
949
+
950
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
951
+it under the terms of the GNU Lesser General Public License as published by
952
+the Free Software Foundation, either version 3 of the License, or
953
+(at your option) any later version.
954
+
955
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
956
+but WITHOUT ANY WARRANTY; without even the implied warranty of
957
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
958
+GNU Lesser General Public License for more details.
959
+
960
+You should have received a copy of the GNU Lesser General Public License
961
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
962
+ */
963
+var lib_code;
964
+(function (lib_code) {
965
+    /**
966
+     * @author fenris
967
+     */
968
+    class class_code_csv {
969
+        /**
970
+         * @author fenris
971
+         */
972
+        constructor() {
973
+        }
974
+        /**
975
+         * @implementation
976
+         * @author fenris
977
+         */
978
+        encode(x) {
979
+            return lib_code.csv_encode(x);
980
+        }
981
+        /**
982
+         * @implementation
983
+         * @author fenris
984
+         */
985
+        decode(x) {
986
+            return lib_code.csv_decode(x);
987
+        }
988
+    }
989
+    lib_code.class_code_csv = class_code_csv;
990
+})(lib_code || (lib_code = {}));
991
+/*
992
+This file is part of »bacterio-plankton:code«.
993
+
994
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
995
+<info@greenscale.de>
996
+
997
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
998
+it under the terms of the GNU Lesser General Public License as published by
999
+the Free Software Foundation, either version 3 of the License, or
1000
+(at your option) any later version.
1001
+
1002
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
1003
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1004
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1005
+GNU Lesser General Public License for more details.
1006
+
1007
+You should have received a copy of the GNU Lesser General Public License
1008
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
1009
+ */
1010
+var lib_code;
1011
+(function (lib_code) {
1012
+    /**
1013
+     * @author fenris
1014
+     */
1015
+    function uri_encode(x) {
1016
+        return encodeURIComponent(x);
1017
+    }
1018
+    lib_code.uri_encode = uri_encode;
1019
+    /**
1020
+     * @author fenris
1021
+     */
1022
+    function uri_decode(x) {
1023
+        return decodeURIComponent(x);
1024
+    }
1025
+    lib_code.uri_decode = uri_decode;
1026
+})(lib_code || (lib_code = {}));
1027
+/*
1028
+This file is part of »bacterio-plankton:code«.
1029
+
1030
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1031
+<info@greenscale.de>
1032
+
1033
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
1034
+it under the terms of the GNU Lesser General Public License as published by
1035
+the Free Software Foundation, either version 3 of the License, or
1036
+(at your option) any later version.
1037
+
1038
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
1039
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1040
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1041
+GNU Lesser General Public License for more details.
1042
+
1043
+You should have received a copy of the GNU Lesser General Public License
1044
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
1045
+ */
1046
+var lib_code;
1047
+(function (lib_code) {
1048
+    /**
1049
+     * @author fenris
1050
+     */
1051
+    lib_trait.attend("code", "uri", {
1052
+        "from": {
1053
+            "name": "string"
1054
+        },
1055
+        "to": {
1056
+            "name": "string"
1057
+        }
1058
+    }, {
1059
+        "encode": () => (x) => {
1060
+            return lib_code.uri_encode(x);
1061
+        },
1062
+        "decode": () => (y) => {
1063
+            return lib_code.uri_decode(y);
1064
+        }
1065
+    });
1066
+})(lib_code || (lib_code = {}));
1067
+/*
1068
+This file is part of »bacterio-plankton:code«.
1069
+
1070
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1071
+<info@greenscale.de>
1072
+
1073
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
1074
+it under the terms of the GNU Lesser General Public License as published by
1075
+the Free Software Foundation, either version 3 of the License, or
1076
+(at your option) any later version.
1077
+
1078
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
1079
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1080
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1081
+GNU Lesser General Public License for more details.
1082
+
1083
+You should have received a copy of the GNU Lesser General Public License
1084
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
1085
+ */
1086
+var lib_code;
1087
+(function (lib_code) {
1088
+    /**
1089
+     * @author fenris
1090
+     */
1091
+    class class_code_uri {
1092
+        /**
1093
+         * @author fenris
1094
+         */
1095
+        constructor() {
1096
+        }
1097
+        /**
1098
+         * @implementation
1099
+         * @author fenris
1100
+         */
1101
+        encode(x) {
1102
+            return lib_code.uri_encode(x);
1103
+        }
1104
+        /**
1105
+         * @implementation
1106
+         * @author fenris
1107
+         */
1108
+        decode(x) {
1109
+            return lib_code.uri_decode(x);
1110
+        }
1111
+    }
1112
+    lib_code.class_code_uri = class_code_uri;
1113
+})(lib_code || (lib_code = {}));
1114
+/*
1115
+This file is part of »bacterio-plankton:code«.
1116
+
1117
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1118
+<info@greenscale.de>
1119
+
1120
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
1121
+it under the terms of the GNU Lesser General Public License as published by
1122
+the Free Software Foundation, either version 3 of the License, or
1123
+(at your option) any later version.
1124
+
1125
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
1126
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1127
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1128
+GNU Lesser General Public License for more details.
1129
+
1130
+You should have received a copy of the GNU Lesser General Public License
1131
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
1132
+ */
1133
+var lib_code;
1134
+(function (lib_code) {
1135
+    /**
1136
+     * @author fenris
1137
+     */
1138
+    function base64_encode(x) {
1139
+        return btoa(x);
1140
+    }
1141
+    lib_code.base64_encode = base64_encode;
1142
+    /**
1143
+     * @author fenris
1144
+     */
1145
+    function base64_decode(x) {
1146
+        return atob(x);
1147
+    }
1148
+    lib_code.base64_decode = base64_decode;
1149
+})(lib_code || (lib_code = {}));
1150
+/*
1151
+This file is part of »bacterio-plankton:code«.
1152
+
1153
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1154
+<info@greenscale.de>
1155
+
1156
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
1157
+it under the terms of the GNU Lesser General Public License as published by
1158
+the Free Software Foundation, either version 3 of the License, or
1159
+(at your option) any later version.
1160
+
1161
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
1162
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1163
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1164
+GNU Lesser General Public License for more details.
1165
+
1166
+You should have received a copy of the GNU Lesser General Public License
1167
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
1168
+ */
1169
+var lib_code;
1170
+(function (lib_code) {
1171
+    /**
1172
+     * @author fenris
1173
+     */
1174
+    lib_trait.attend("code", "base64", {
1175
+        "from": {
1176
+            "name": "string"
1177
+        },
1178
+        "to": {
1179
+            "name": "string"
1180
+        }
1181
+    }, {
1182
+        "encode": () => (x) => {
1183
+            return lib_code.base64_encode(x);
1184
+        },
1185
+        "decode": () => (y) => {
1186
+            return lib_code.base64_decode(y);
1187
+        }
1188
+    });
1189
+})(lib_code || (lib_code = {}));
1190
+/*
1191
+This file is part of »bacterio-plankton:code«.
1192
+
1193
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1194
+<info@greenscale.de>
1195
+
1196
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
1197
+it under the terms of the GNU Lesser General Public License as published by
1198
+the Free Software Foundation, either version 3 of the License, or
1199
+(at your option) any later version.
1200
+
1201
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
1202
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1203
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1204
+GNU Lesser General Public License for more details.
1205
+
1206
+You should have received a copy of the GNU Lesser General Public License
1207
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
1208
+ */
1209
+var lib_code;
1210
+(function (lib_code) {
1211
+    /**
1212
+     * @author fenris
1213
+     */
1214
+    class class_code_base64 {
1215
+        /**
1216
+         * @author fenris
1217
+         */
1218
+        constructor() {
1219
+        }
1220
+        /**
1221
+         * @implementation
1222
+         * @author fenris
1223
+         */
1224
+        encode(x) {
1225
+            return lib_code.base64_encode(x);
1226
+        }
1227
+        /**
1228
+         * @implementation
1229
+         * @author fenris
1230
+         */
1231
+        decode(x) {
1232
+            return lib_code.base64_decode(x);
1233
+        }
1234
+    }
1235
+    lib_code.class_code_base64 = class_code_base64;
1236
+})(lib_code || (lib_code = {}));
... ...
@@ -0,0 +1,861 @@
1
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2
+<info@greenscale.de>
3
+
4
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
5
+it under the terms of the GNU Lesser General Public License as published by
6
+the Free Software Foundation, either version 3 of the License, or
7
+(at your option) any later version.
8
+
9
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
10
+but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+GNU Lesser General Public License for more details.
13
+
14
+You should have received a copy of the GNU Lesser General Public License
15
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+
18
+
19
+                    GNU GENERAL PUBLIC LICENSE
20
+                       Version 3, 29 June 2007
21
+
22
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
23
+ Everyone is permitted to copy and distribute verbatim copies
24
+ of this license document, but changing it is not allowed.
25
+
26
+                            Preamble
27
+
28
+  The GNU General Public License is a free, copyleft license for
29
+software and other kinds of works.
30
+
31
+  The licenses for most software and other practical works are designed
32
+to take away your freedom to share and change the works.  By contrast,
33
+the GNU General Public License is intended to guarantee your freedom to
34
+share and change all versions of a program--to make sure it remains free
35
+software for all its users.  We, the Free Software Foundation, use the
36
+GNU General Public License for most of our software; it applies also to
37
+any other work released this way by its authors.  You can apply it to
38
+your programs, too.
39
+
40
+  When we speak of free software, we are referring to freedom, not
41
+price.  Our General Public Licenses are designed to make sure that you
42
+have the freedom to distribute copies of free software (and charge for
43
+them if you wish), that you receive source code or can get it if you
44
+want it, that you can change the software or use pieces of it in new
45
+free programs, and that you know you can do these things.
46
+
47
+  To protect your rights, we need to prevent others from denying you
48
+these rights or asking you to surrender the rights.  Therefore, you have
49
+certain responsibilities if you distribute copies of the software, or if
50
+you modify it: responsibilities to respect the freedom of others.
51
+
52
+  For example, if you distribute copies of such a program, whether
53
+gratis or for a fee, you must pass on to the recipients the same
54
+freedoms that you received.  You must make sure that they, too, receive
55
+or can get the source code.  And you must show them these terms so they
56
+know their rights.
57
+
58
+  Developers that use the GNU GPL protect your rights with two steps:
59
+(1) assert copyright on the software, and (2) offer you this License
60
+giving you legal permission to copy, distribute and/or modify it.
61
+
62
+  For the developers' and authors' protection, the GPL clearly explains
63
+that there is no warranty for this free software.  For both users' and
64
+authors' sake, the GPL requires that modified versions be marked as
65
+changed, so that their problems will not be attributed erroneously to
66
+authors of previous versions.
67
+
68
+  Some devices are designed to deny users access to install or run
69
+modified versions of the software inside them, although the manufacturer
70
+can do so.  This is fundamentally incompatible with the aim of
71
+protecting users' freedom to change the software.  The systematic
72
+pattern of such abuse occurs in the area of products for individuals to
73
+use, which is precisely where it is most unacceptable.  Therefore, we
74
+have designed this version of the GPL to prohibit the practice for those
75
+products.  If such problems arise substantially in other domains, we
76
+stand ready to extend this provision to those domains in future versions
77
+of the GPL, as needed to protect the freedom of users.
78
+
79
+  Finally, every program is threatened constantly by software patents.
80
+States should not allow patents to restrict development and use of
81
+software on general-purpose computers, but in those that do, we wish to
82
+avoid the special danger that patents applied to a free program could
83
+make it effectively proprietary.  To prevent this, the GPL assures that
84
+patents cannot be used to render the program non-free.
85
+
86
+  The precise terms and conditions for copying, distribution and
87
+modification follow.
88
+
89
+                       TERMS AND CONDITIONS
90
+
91
+  0. Definitions.
92
+
93
+  "This License" refers to version 3 of the GNU General Public License.
94
+
95
+  "Copyright" also means copyright-like laws that apply to other kinds of
96
+works, such as semiconductor masks.
97
+
98
+  "The Program" refers to any copyrightable work licensed under this
99
+License.  Each licensee is addressed as "you".  "Licensees" and
100
+"recipients" may be individuals or organizations.
101
+
102
+  To "modify" a work means to copy from or adapt all or part of the work
103
+in a fashion requiring copyright permission, other than the making of an
104
+exact copy.  The resulting work is called a "modified version" of the
105
+earlier work or a work "based on" the earlier work.
106
+
107
+  A "covered work" means either the unmodified Program or a work based
108
+on the Program.
109
+
110
+  To "propagate" a work means to do anything with it that, without
111
+permission, would make you directly or secondarily liable for
112
+infringement under applicable copyright law, except executing it on a
113
+computer or modifying a private copy.  Propagation includes copying,
114
+distribution (with or without modification), making available to the
115
+public, and in some countries other activities as well.
116
+
117
+  To "convey" a work means any kind of propagation that enables other
118
+parties to make or receive copies.  Mere interaction with a user through
119
+a computer network, with no transfer of a copy, is not conveying.
120
+
121
+  An interactive user interface displays "Appropriate Legal Notices"
122
+to the extent that it includes a convenient and prominently visible
123
+feature that (1) displays an appropriate copyright notice, and (2)
124
+tells the user that there is no warranty for the work (except to the
125
+extent that warranties are provided), that licensees may convey the
126
+work under this License, and how to view a copy of this License.  If
127
+the interface presents a list of user commands or options, such as a
128
+menu, a prominent item in the list meets this criterion.
129
+
130
+  1. Source Code.
131
+
132
+  The "source code" for a work means the preferred form of the work
133
+for making modifications to it.  "Object code" means any non-source
134
+form of a work.
135
+
136
+  A "Standard Interface" means an interface that either is an official
137
+standard defined by a recognized standards body, or, in the case of
138
+interfaces specified for a particular programming language, one that
139
+is widely used among developers working in that language.
140
+
141
+  The "System Libraries" of an executable work include anything, other
142
+than the work as a whole, that (a) is included in the normal form of
143
+packaging a Major Component, but which is not part of that Major
144
+Component, and (b) serves only to enable use of the work with that
145
+Major Component, or to implement a Standard Interface for which an
146
+implementation is available to the public in source code form.  A
147
+"Major Component", in this context, means a major essential component
148
+(kernel, window system, and so on) of the specific operating system
149
+(if any) on which the executable work runs, or a compiler used to
150
+produce the work, or an object code interpreter used to run it.
151
+
152
+  The "Corresponding Source" for a work in object code form means all
153
+the source code needed to generate, install, and (for an executable
154
+work) run the object code and to modify the work, including scripts to
155
+control those activities.  However, it does not include the work's
156
+System Libraries, or general-purpose tools or generally available free
157
+programs which are used unmodified in performing those activities but
158
+which are not part of the work.  For example, Corresponding Source
159
+includes interface definition files associated with source files for
160
+the work, and the source code for shared libraries and dynamically
161
+linked subprograms that the work is specifically designed to require,
162
+such as by intimate data communication or control flow between those
163
+subprograms and other parts of the work.
164
+
165
+  The Corresponding Source need not include anything that users
166
+can regenerate automatically from other parts of the Corresponding
167
+Source.
168
+
169
+  The Corresponding Source for a work in source code form is that
170
+same work.
171
+
172
+  2. Basic Permissions.
173
+
174
+  All rights granted under this License are granted for the term of
175
+copyright on the Program, and are irrevocable provided the stated
176
+conditions are met.  This License explicitly affirms your unlimited
177
+permission to run the unmodified Program.  The output from running a
178
+covered work is covered by this License only if the output, given its
179
+content, constitutes a covered work.  This License acknowledges your
180
+rights of fair use or other equivalent, as provided by copyright law.
181
+
182
+  You may make, run and propagate covered works that you do not
183
+convey, without conditions so long as your license otherwise remains
184
+in force.  You may convey covered works to others for the sole purpose
185
+of having them make modifications exclusively for you, or provide you
186
+with facilities for running those works, provided that you comply with
187
+the terms of this License in conveying all material for which you do
188
+not control copyright.  Those thus making or running the covered works
189
+for you must do so exclusively on your behalf, under your direction
190
+and control, on terms that prohibit them from making any copies of
191
+your copyrighted material outside their relationship with you.
192
+
193
+  Conveying under any other circumstances is permitted solely under
194
+the conditions stated below.  Sublicensing is not allowed; section 10
195
+makes it unnecessary.
196
+
197
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
198
+
199
+  No covered work shall be deemed part of an effective technological
200
+measure under any applicable law fulfilling obligations under article
201
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
202
+similar laws prohibiting or restricting circumvention of such
203
+measures.
204
+
205
+  When you convey a covered work, you waive any legal power to forbid
206
+circumvention of technological measures to the extent such circumvention
207
+is effected by exercising rights under this License with respect to
208
+the covered work, and you disclaim any intention to limit operation or
209
+modification of the work as a means of enforcing, against the work's
210
+users, your or third parties' legal rights to forbid circumvention of
211
+technological measures.
212
+
213
+  4. Conveying Verbatim Copies.
214
+
215
+  You may convey verbatim copies of the Program's source code as you
216
+receive it, in any medium, provided that you conspicuously and
217
+appropriately publish on each copy an appropriate copyright notice;
218
+keep intact all notices stating that this License and any
219
+non-permissive terms added in accord with section 7 apply to the code;
220
+keep intact all notices of the absence of any warranty; and give all
221
+recipients a copy of this License along with the Program.
222
+
223
+  You may charge any price or no price for each copy that you convey,
224
+and you may offer support or warranty protection for a fee.
225
+
226
+  5. Conveying Modified Source Versions.
227
+
228
+  You may convey a work based on the Program, or the modifications to
229
+produce it from the Program, in the form of source code under the
230
+terms of section 4, provided that you also meet all of these conditions:
231
+
232
+    a) The work must carry prominent notices stating that you modified
233
+    it, and giving a relevant date.
234
+
235
+    b) The work must carry prominent notices stating that it is
236
+    released under this License and any conditions added under section
237
+    7.  This requirement modifies the requirement in section 4 to
238
+    "keep intact all notices".
239
+
240
+    c) You must license the entire work, as a whole, under this
241
+    License to anyone who comes into possession of a copy.  This
242
+    License will therefore apply, along with any applicable section 7
243
+    additional terms, to the whole of the work, and all its parts,
244
+    regardless of how they are packaged.  This License gives no
245
+    permission to license the work in any other way, but it does not
246
+    invalidate such permission if you have separately received it.
247
+
248
+    d) If the work has interactive user interfaces, each must display
249
+    Appropriate Legal Notices; however, if the Program has interactive
250
+    interfaces that do not display Appropriate Legal Notices, your
251
+    work need not make them do so.
252
+
253
+  A compilation of a covered work with other separate and independent
254
+works, which are not by their nature extensions of the covered work,
255
+and which are not combined with it such as to form a larger program,
256
+in or on a volume of a storage or distribution medium, is called an
257
+"aggregate" if the compilation and its resulting copyright are not
258
+used to limit the access or legal rights of the compilation's users
259
+beyond what the individual works permit.  Inclusion of a covered work
260
+in an aggregate does not cause this License to apply to the other
261
+parts of the aggregate.
262
+
263
+  6. Conveying Non-Source Forms.
264
+
265
+  You may convey a covered work in object code form under the terms
266
+of sections 4 and 5, provided that you also convey the
267
+machine-readable Corresponding Source under the terms of this License,
268
+in one of these ways:
269
+
270
+    a) Convey the object code in, or embodied in, a physical product
271
+    (including a physical distribution medium), accompanied by the
272
+    Corresponding Source fixed on a durable physical medium
273
+    customarily used for software interchange.
274
+
275
+    b) Convey the object code in, or embodied in, a physical product
276
+    (including a physical distribution medium), accompanied by a
277
+    written offer, valid for at least three years and valid for as
278
+    long as you offer spare parts or customer support for that product
279
+    model, to give anyone who possesses the object code either (1) a
280
+    copy of the Corresponding Source for all the software in the
281
+    product that is covered by this License, on a durable physical
282
+    medium customarily used for software interchange, for a price no
283
+    more than your reasonable cost of physically performing this
284
+    conveying of source, or (2) access to copy the
285
+    Corresponding Source from a network server at no charge.
286
+
287
+    c) Convey individual copies of the object code with a copy of the
288
+    written offer to provide the Corresponding Source.  This
289
+    alternative is allowed only occasionally and noncommercially, and
290
+    only if you received the object code with such an offer, in accord
291
+    with subsection 6b.
292
+
293
+    d) Convey the object code by offering access from a designated
294
+    place (gratis or for a charge), and offer equivalent access to the
295
+    Corresponding Source in the same way through the same place at no
296
+    further charge.  You need not require recipients to copy the
297
+    Corresponding Source along with the object code.  If the place to
298
+    copy the object code is a network server, the Corresponding Source
299
+    may be on a different server (operated by you or a third party)
300
+    that supports equivalent copying facilities, provided you maintain
301
+    clear directions next to the object code saying where to find the
302
+    Corresponding Source.  Regardless of what server hosts the
303
+    Corresponding Source, you remain obligated to ensure that it is
304
+    available for as long as needed to satisfy these requirements.
305
+
306
+    e) Convey the object code using peer-to-peer transmission, provided
307
+    you inform other peers where the object code and Corresponding
308
+    Source of the work are being offered to the general public at no
309
+    charge under subsection 6d.
310
+
311
+  A separable portion of the object code, whose source code is excluded
312
+from the Corresponding Source as a System Library, need not be
313
+included in conveying the object code work.
314
+
315
+  A "User Product" is either (1) a "consumer product", which means any
316
+tangible personal property which is normally used for personal, family,
317
+or household purposes, or (2) anything designed or sold for incorporation
318
+into a dwelling.  In determining whether a product is a consumer product,
319
+doubtful cases shall be resolved in favor of coverage.  For a particular
320
+product received by a particular user, "normally used" refers to a
321
+typical or common use of that class of product, regardless of the status
322
+of the particular user or of the way in which the particular user
323
+actually uses, or expects or is expected to use, the product.  A product
324
+is a consumer product regardless of whether the product has substantial
325
+commercial, industrial or non-consumer uses, unless such uses represent
326
+the only significant mode of use of the product.
327
+
328
+  "Installation Information" for a User Product means any methods,
329
+procedures, authorization keys, or other information required to install
330
+and execute modified versions of a covered work in that User Product from
331
+a modified version of its Corresponding Source.  The information must
332
+suffice to ensure that the continued functioning of the modified object
333
+code is in no case prevented or interfered with solely because
334
+modification has been made.
335
+
336
+  If you convey an object code work under this section in, or with, or
337
+specifically for use in, a User Product, and the conveying occurs as
338
+part of a transaction in which the right of possession and use of the
339
+User Product is transferred to the recipient in perpetuity or for a
340
+fixed term (regardless of how the transaction is characterized), the
341
+Corresponding Source conveyed under this section must be accompanied
342
+by the Installation Information.  But this requirement does not apply
343
+if neither you nor any third party retains the ability to install
344
+modified object code on the User Product (for example, the work has
345
+been installed in ROM).
346
+
347
+  The requirement to provide Installation Information does not include a
348
+requirement to continue to provide support service, warranty, or updates
349
+for a work that has been modified or installed by the recipient, or for
350
+the User Product in which it has been modified or installed.  Access to a
351
+network may be denied when the modification itself materially and
352
+adversely affects the operation of the network or violates the rules and
353
+protocols for communication across the network.
354
+
355
+  Corresponding Source conveyed, and Installation Information provided,
356
+in accord with this section must be in a format that is publicly
357
+documented (and with an implementation available to the public in
358
+source code form), and must require no special password or key for
359
+unpacking, reading or copying.
360
+
361
+  7. Additional Terms.
362
+
363
+  "Additional permissions" are terms that supplement the terms of this
364
+License by making exceptions from one or more of its conditions.
365
+Additional permissions that are applicable to the entire Program shall
366
+be treated as though they were included in this License, to the extent
367
+that they are valid under applicable law.  If additional permissions
368
+apply only to part of the Program, that part may be used separately
369
+under those permissions, but the entire Program remains governed by
370
+this License without regard to the additional permissions.
371
+
372
+  When you convey a copy of a covered work, you may at your option
373
+remove any additional permissions from that copy, or from any part of
374
+it.  (Additional permissions may be written to require their own
375
+removal in certain cases when you modify the work.)  You may place
376
+additional permissions on material, added by you to a covered work,
377
+for which you have or can give appropriate copyright permission.
378
+
379
+  Notwithstanding any other provision of this License, for material you
380
+add to a covered work, you may (if authorized by the copyright holders of
381
+that material) supplement the terms of this License with terms:
382
+
383
+    a) Disclaiming warranty or limiting liability differently from the
384
+    terms of sections 15 and 16 of this License; or
385
+
386
+    b) Requiring preservation of specified reasonable legal notices or
387
+    author attributions in that material or in the Appropriate Legal
388
+    Notices displayed by works containing it; or
389
+
390
+    c) Prohibiting misrepresentation of the origin of that material, or
391
+    requiring that modified versions of such material be marked in
392
+    reasonable ways as different from the original version; or
393
+
394
+    d) Limiting the use for publicity purposes of names of licensors or
395
+    authors of the material; or
396
+
397
+    e) Declining to grant rights under trademark law for use of some
398
+    trade names, trademarks, or service marks; or
399
+
400
+    f) Requiring indemnification of licensors and authors of that
401
+    material by anyone who conveys the material (or modified versions of
402
+    it) with contractual assumptions of liability to the recipient, for
403
+    any liability that these contractual assumptions directly impose on
404
+    those licensors and authors.
405
+
406
+  All other non-permissive additional terms are considered "further
407
+restrictions" within the meaning of section 10.  If the Program as you
408
+received it, or any part of it, contains a notice stating that it is
409
+governed by this License along with a term that is a further
410
+restriction, you may remove that term.  If a license document contains
411
+a further restriction but permits relicensing or conveying under this
412
+License, you may add to a covered work material governed by the terms
413
+of that license document, provided that the further restriction does
414
+not survive such relicensing or conveying.
415
+
416
+  If you add terms to a covered work in accord with this section, you
417
+must place, in the relevant source files, a statement of the
418
+additional terms that apply to those files, or a notice indicating
419
+where to find the applicable terms.
420
+
421
+  Additional terms, permissive or non-permissive, may be stated in the
422
+form of a separately written license, or stated as exceptions;
423
+the above requirements apply either way.
424
+
425
+  8. Termination.
426
+
427
+  You may not propagate or modify a covered work except as expressly
428
+provided under this License.  Any attempt otherwise to propagate or
429
+modify it is void, and will automatically terminate your rights under
430
+this License (including any patent licenses granted under the third
431
+paragraph of section 11).
432
+
433
+  However, if you cease all violation of this License, then your
434
+license from a particular copyright holder is reinstated (a)
435
+provisionally, unless and until the copyright holder explicitly and
436
+finally terminates your license, and (b) permanently, if the copyright
437
+holder fails to notify you of the violation by some reasonable means
438
+prior to 60 days after the cessation.
439
+
440
+  Moreover, your license from a particular copyright holder is
441
+reinstated permanently if the copyright holder notifies you of the
442
+violation by some reasonable means, this is the first time you have
443
+received notice of violation of this License (for any work) from that
444
+copyright holder, and you cure the violation prior to 30 days after
445
+your receipt of the notice.
446
+
447
+  Termination of your rights under this section does not terminate the
448
+licenses of parties who have received copies or rights from you under
449
+this License.  If your rights have been terminated and not permanently
450
+reinstated, you do not qualify to receive new licenses for the same
451
+material under section 10.
452
+
453
+  9. Acceptance Not Required for Having Copies.
454
+
455
+  You are not required to accept this License in order to receive or
456
+run a copy of the Program.  Ancillary propagation of a covered work
457
+occurring solely as a consequence of using peer-to-peer transmission
458
+to receive a copy likewise does not require acceptance.  However,
459
+nothing other than this License grants you permission to propagate or
460
+modify any covered work.  These actions infringe copyright if you do
461
+not accept this License.  Therefore, by modifying or propagating a
462
+covered work, you indicate your acceptance of this License to do so.
463
+
464
+  10. Automatic Licensing of Downstream Recipients.
465
+
466
+  Each time you convey a covered work, the recipient automatically
467
+receives a license from the original licensors, to run, modify and
468
+propagate that work, subject to this License.  You are not responsible
469
+for enforcing compliance by third parties with this License.
470
+
471
+  An "entity transaction" is a transaction transferring control of an
472
+organization, or substantially all assets of one, or subdividing an
473
+organization, or merging organizations.  If propagation of a covered
474
+work results from an entity transaction, each party to that
475
+transaction who receives a copy of the work also receives whatever
476
+licenses to the work the party's predecessor in interest had or could
477
+give under the previous paragraph, plus a right to possession of the
478
+Corresponding Source of the work from the predecessor in interest, if
479
+the predecessor has it or can get it with reasonable efforts.
480
+
481
+  You may not impose any further restrictions on the exercise of the
482
+rights granted or affirmed under this License.  For example, you may
483
+not impose a license fee, royalty, or other charge for exercise of
484
+rights granted under this License, and you may not initiate litigation
485
+(including a cross-claim or counterclaim in a lawsuit) alleging that
486
+any patent claim is infringed by making, using, selling, offering for
487
+sale, or importing the Program or any portion of it.
488
+
489
+  11. Patents.
490
+
491
+  A "contributor" is a copyright holder who authorizes use under this
492
+License of the Program or a work on which the Program is based.  The
493
+work thus licensed is called the contributor's "contributor version".
494
+
495
+  A contributor's "essential patent claims" are all patent claims
496
+owned or controlled by the contributor, whether already acquired or
497
+hereafter acquired, that would be infringed by some manner, permitted
498
+by this License, of making, using, or selling its contributor version,
499
+but do not include claims that would be infringed only as a
500
+consequence of further modification of the contributor version.  For
501
+purposes of this definition, "control" includes the right to grant
502
+patent sublicenses in a manner consistent with the requirements of
503
+this License.
504
+
505
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
506
+patent license under the contributor's essential patent claims, to
507
+make, use, sell, offer for sale, import and otherwise run, modify and
508
+propagate the contents of its contributor version.
509
+
510
+  In the following three paragraphs, a "patent license" is any express
511
+agreement or commitment, however denominated, not to enforce a patent
512
+(such as an express permission to practice a patent or covenant not to
513
+sue for patent infringement).  To "grant" such a patent license to a
514
+party means to make such an agreement or commitment not to enforce a
515
+patent against the party.
516
+
517
+  If you convey a covered work, knowingly relying on a patent license,
518
+and the Corresponding Source of the work is not available for anyone
519
+to copy, free of charge and under the terms of this License, through a
520
+publicly available network server or other readily accessible means,
521
+then you must either (1) cause the Corresponding Source to be so
522
+available, or (2) arrange to deprive yourself of the benefit of the
523
+patent license for this particular work, or (3) arrange, in a manner
524
+consistent with the requirements of this License, to extend the patent
525
+license to downstream recipients.  "Knowingly relying" means you have
526
+actual knowledge that, but for the patent license, your conveying the
527
+covered work in a country, or your recipient's use of the covered work
528
+in a country, would infringe one or more identifiable patents in that
529
+country that you have reason to believe are valid.
530
+
531
+  If, pursuant to or in connection with a single transaction or
532
+arrangement, you convey, or propagate by procuring conveyance of, a
533
+covered work, and grant a patent license to some of the parties
534
+receiving the covered work authorizing them to use, propagate, modify
535
+or convey a specific copy of the covered work, then the patent license
536
+you grant is automatically extended to all recipients of the covered
537
+work and works based on it.
538
+
539
+  A patent license is "discriminatory" if it does not include within
540
+the scope of its coverage, prohibits the exercise of, or is
541
+conditioned on the non-exercise of one or more of the rights that are
542
+specifically granted under this License.  You may not convey a covered
543
+work if you are a party to an arrangement with a third party that is
544
+in the business of distributing software, under which you make payment
545
+to the third party based on the extent of your activity of conveying
546
+the work, and under which the third party grants, to any of the
547
+parties who would receive the covered work from you, a discriminatory
548
+patent license (a) in connection with copies of the covered work
549
+conveyed by you (or copies made from those copies), or (b) primarily
550
+for and in connection with specific products or compilations that
551
+contain the covered work, unless you entered into that arrangement,
552
+or that patent license was granted, prior to 28 March 2007.
553
+
554
+  Nothing in this License shall be construed as excluding or limiting
555
+any implied license or other defenses to infringement that may
556
+otherwise be available to you under applicable patent law.
557
+
558
+  12. No Surrender of Others' Freedom.
559
+
560
+  If conditions are imposed on you (whether by court order, agreement or
561
+otherwise) that contradict the conditions of this License, they do not
562
+excuse you from the conditions of this License.  If you cannot convey a
563
+covered work so as to satisfy simultaneously your obligations under this
564
+License and any other pertinent obligations, then as a consequence you may
565
+not convey it at all.  For example, if you agree to terms that obligate you
566
+to collect a royalty for further conveying from those to whom you convey
567
+the Program, the only way you could satisfy both those terms and this
568
+License would be to refrain entirely from conveying the Program.
569
+
570
+  13. Use with the GNU Affero General Public License.
571
+
572
+  Notwithstanding any other provision of this License, you have
573
+permission to link or combine any covered work with a work licensed
574
+under version 3 of the GNU Affero General Public License into a single
575
+combined work, and to convey the resulting work.  The terms of this
576
+License will continue to apply to the part which is the covered work,
577
+but the special requirements of the GNU Affero General Public License,
578
+section 13, concerning interaction through a network will apply to the
579
+combination as such.
580
+
581
+  14. Revised Versions of this License.
582
+
583
+  The Free Software Foundation may publish revised and/or new versions of
584
+the GNU General Public License from time to time.  Such new versions will
585
+be similar in spirit to the present version, but may differ in detail to
586
+address new problems or concerns.
587
+
588
+  Each version is given a distinguishing version number.  If the
589
+Program specifies that a certain numbered version of the GNU General
590
+Public License "or any later version" applies to it, you have the
591
+option of following the terms and conditions either of that numbered
592
+version or of any later version published by the Free Software
593
+Foundation.  If the Program does not specify a version number of the
594
+GNU General Public License, you may choose any version ever published
595
+by the Free Software Foundation.
596
+
597
+  If the Program specifies that a proxy can decide which future
598
+versions of the GNU General Public License can be used, that proxy's
599
+public statement of acceptance of a version permanently authorizes you
600
+to choose that version for the Program.
601
+
602
+  Later license versions may give you additional or different
603
+permissions.  However, no additional obligations are imposed on any
604
+author or copyright holder as a result of your choosing to follow a
605
+later version.
606
+
607
+  15. Disclaimer of Warranty.
608
+
609
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
610
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
611
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
612
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
613
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
614
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
615
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
616
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
617
+
618
+  16. Limitation of Liability.
619
+
620
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
621
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
622
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
623
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
624
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
625
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
626
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
627
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
628
+SUCH DAMAGES.
629
+
630
+  17. Interpretation of Sections 15 and 16.
631
+
632
+  If the disclaimer of warranty and limitation of liability provided
633
+above cannot be given local legal effect according to their terms,
634
+reviewing courts shall apply local law that most closely approximates
635
+an absolute waiver of all civil liability in connection with the
636
+Program, unless a warranty or assumption of liability accompanies a
637
+copy of the Program in return for a fee.
638
+
639
+                     END OF TERMS AND CONDITIONS
640
+
641
+            How to Apply These Terms to Your New Programs
642
+
643
+  If you develop a new program, and you want it to be of the greatest
644
+possible use to the public, the best way to achieve this is to make it
645
+free software which everyone can redistribute and change under these terms.
646
+
647
+  To do so, attach the following notices to the program.  It is safest
648
+to attach them to the start of each source file to most effectively
649
+state the exclusion of warranty; and each file should have at least
650
+the "copyright" line and a pointer to where the full notice is found.
651
+
652
+    <one line to give the program's name and a brief idea of what it does.>
653
+    Copyright (C) <year>  <name of author>
654
+
655
+    This program is free software: you can redistribute it and/or modify
656
+    it under the terms of the GNU General Public License as published by
657
+    the Free Software Foundation, either version 3 of the License, or
658
+    (at your option) any later version.
659
+
660
+    This program is distributed in the hope that it will be useful,
661
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
662
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
663
+    GNU General Public License for more details.
664
+
665
+    You should have received a copy of the GNU General Public License
666
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
667
+
668
+Also add information on how to contact you by electronic and paper mail.
669
+
670
+  If the program does terminal interaction, make it output a short
671
+notice like this when it starts in an interactive mode:
672
+
673
+    <program>  Copyright (C) <year>  <name of author>
674
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
675
+    This is free software, and you are welcome to redistribute it
676
+    under certain conditions; type `show c' for details.
677
+
678
+The hypothetical commands `show w' and `show c' should show the appropriate
679
+parts of the General Public License.  Of course, your program's commands
680
+might be different; for a GUI interface, you would use an "about box".
681
+
682
+  You should also get your employer (if you work as a programmer) or school,
683
+if any, to sign a "copyright disclaimer" for the program, if necessary.
684
+For more information on this, and how to apply and follow the GNU GPL, see
685
+<https://www.gnu.org/licenses/>.
686
+
687
+  The GNU General Public License does not permit incorporating your program
688
+into proprietary programs.  If your program is a subroutine library, you
689
+may consider it more useful to permit linking proprietary applications with
690
+the library.  If this is what you want to do, use the GNU Lesser General
691
+Public License instead of this License.  But first, please read
692
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
693
+
694
+
695
+
696
+                   GNU LESSER GENERAL PUBLIC LICENSE
697
+                       Version 3, 29 June 2007
698
+
699
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
700
+ Everyone is permitted to copy and distribute verbatim copies
701
+ of this license document, but changing it is not allowed.
702
+
703
+
704
+  This version of the GNU Lesser General Public License incorporates
705
+the terms and conditions of version 3 of the GNU General Public
706
+License, supplemented by the additional permissions listed below.
707
+
708
+  0. Additional Definitions.
709
+
710
+  As used herein, "this License" refers to version 3 of the GNU Lesser
711
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
712
+General Public License.
713
+
714
+  "The Library" refers to a covered work governed by this License,
715
+other than an Application or a Combined Work as defined below.
716
+
717
+  An "Application" is any work that makes use of an interface provided
718
+by the Library, but which is not otherwise based on the Library.
719
+Defining a subclass of a class defined by the Library is deemed a mode
720
+of using an interface provided by the Library.
721
+
722
+  A "Combined Work" is a work produced by combining or linking an
723
+Application with the Library.  The particular version of the Library
724
+with which the Combined Work was made is also called the "Linked
725
+Version".
726
+
727
+  The "Minimal Corresponding Source" for a Combined Work means the
728
+Corresponding Source for the Combined Work, excluding any source code
729
+for portions of the Combined Work that, considered in isolation, are
730
+based on the Application, and not on the Linked Version.
731
+
732
+  The "Corresponding Application Code" for a Combined Work means the
733
+object code and/or source code for the Application, including any data
734
+and utility programs needed for reproducing the Combined Work from the
735
+Application, but excluding the System Libraries of the Combined Work.
736
+
737
+  1. Exception to Section 3 of the GNU GPL.
738
+
739
+  You may convey a covered work under sections 3 and 4 of this License
740
+without being bound by section 3 of the GNU GPL.
741
+
742
+  2. Conveying Modified Versions.
743
+
744
+  If you modify a copy of the Library, and, in your modifications, a
745
+facility refers to a function or data to be supplied by an Application
746
+that uses the facility (other than as an argument passed when the
747
+facility is invoked), then you may convey a copy of the modified
748
+version:
749
+
750
+   a) under this License, provided that you make a good faith effort to
751
+   ensure that, in the event an Application does not supply the
752
+   function or data, the facility still operates, and performs
753
+   whatever part of its purpose remains meaningful, or
754
+
755
+   b) under the GNU GPL, with none of the additional permissions of
756
+   this License applicable to that copy.
757
+
758
+  3. Object Code Incorporating Material from Library Header Files.
759
+
760
+  The object code form of an Application may incorporate material from
761
+a header file that is part of the Library.  You may convey such object
762
+code under terms of your choice, provided that, if the incorporated
763
+material is not limited to numerical parameters, data structure
764
+layouts and accessors, or small macros, inline functions and templates
765
+(ten or fewer lines in length), you do both of the following:
766
+
767
+   a) Give prominent notice with each copy of the object code that the
768
+   Library is used in it and that the Library and its use are
769
+   covered by this License.
770
+
771
+   b) Accompany the object code with a copy of the GNU GPL and this license
772
+   document.
773
+
774
+  4. Combined Works.
775
+
776
+  You may convey a Combined Work under terms of your choice that,
777
+taken together, effectively do not restrict modification of the
778
+portions of the Library contained in the Combined Work and reverse
779
+engineering for debugging such modifications, if you also do each of
780
+the following:
781
+
782
+   a) Give prominent notice with each copy of the Combined Work that
783
+   the Library is used in it and that the Library and its use are
784
+   covered by this License.
785
+
786
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
787
+   document.
788
+
789
+   c) For a Combined Work that displays copyright notices during
790
+   execution, include the copyright notice for the Library among
791
+   these notices, as well as a reference directing the user to the
792
+   copies of the GNU GPL and this license document.
793
+
794
+   d) Do one of the following:
795
+
796
+       0) Convey the Minimal Corresponding Source under the terms of this
797
+       License, and the Corresponding Application Code in a form
798
+       suitable for, and under terms that permit, the user to
799
+       recombine or relink the Application with a modified version of
800
+       the Linked Version to produce a modified Combined Work, in the
801
+       manner specified by section 6 of the GNU GPL for conveying
802
+       Corresponding Source.
803
+
804
+       1) Use a suitable shared library mechanism for linking with the
805
+       Library.  A suitable mechanism is one that (a) uses at run time
806
+       a copy of the Library already present on the user's computer
807
+       system, and (b) will operate properly with a modified version
808
+       of the Library that is interface-compatible with the Linked
809
+       Version.
810
+
811
+   e) Provide Installation Information, but only if you would otherwise
812
+   be required to provide such information under section 6 of the
813
+   GNU GPL, and only to the extent that such information is
814
+   necessary to install and execute a modified version of the
815
+   Combined Work produced by recombining or relinking the
816
+   Application with a modified version of the Linked Version. (If
817
+   you use option 4d0, the Installation Information must accompany
818
+   the Minimal Corresponding Source and Corresponding Application
819
+   Code. If you use option 4d1, you must provide the Installation
820
+   Information in the manner specified by section 6 of the GNU GPL
821
+   for conveying Corresponding Source.)
822
+
823
+  5. Combined Libraries.
824
+
825
+  You may place library facilities that are a work based on the
826
+Library side by side in a single library together with other library
827
+facilities that are not Applications and are not covered by this
828
+License, and convey such a combined library under terms of your
829
+choice, if you do both of the following:
830
+
831
+   a) Accompany the combined library with a copy of the same work based
832
+   on the Library, uncombined with any other library facilities,
833
+   conveyed under the terms of this License.
834
+
835
+   b) Give prominent notice with the combined library that part of it
836
+   is a work based on the Library, and explaining where to find the
837
+   accompanying uncombined form of the same work.
838
+
839
+  6. Revised Versions of the GNU Lesser General Public License.
840
+
841
+  The Free Software Foundation may publish revised and/or new versions
842
+of the GNU Lesser General Public License from time to time. Such new
843
+versions will be similar in spirit to the present version, but may
844
+differ in detail to address new problems or concerns.
845
+
846
+  Each version is given a distinguishing version number. If the
847
+Library as you received it specifies that a certain numbered version
848
+of the GNU Lesser General Public License "or any later version"
849
+applies to it, you have the option of following the terms and
850
+conditions either of that published version or of any later version
851
+published by the Free Software Foundation. If the Library as you
852
+received it does not specify a version number of the GNU Lesser
853
+General Public License, you may choose any version of the GNU Lesser
854
+General Public License ever published by the Free Software Foundation.
855
+
856
+  If the Library as you received it specifies that a proxy can decide
857
+whether future versions of the GNU Lesser General Public License shall
858
+apply, that proxy's public statement of acceptance of any version is
859
+permanent authorization for you to choose that version for the
860
+Library.
861
+
... ...
@@ -0,0 +1,163 @@
1
+declare module lib_comm {
2
+}
3
+declare module lib_comm {
4
+    /**
5
+     * @author fenris
6
+     */
7
+    interface interface_client<type_message_out, type_message_in> {
8
+        /**
9
+         * @desc prepare the client to a point where sending messages can be done without any more preparation
10
+         * @author fenris
11
+         */
12
+        setup(): lib_call.type_promise<void, Error>;
13
+        /**
14
+         * @desc send a message
15
+         * @author fenris
16
+         */
17
+        send(message: type_message_out): lib_call.type_promise<type_message_in, Error>;
18
+    }
19
+}
20
+declare module lib_comm {
21
+    /**
22
+     * @author fenris
23
+     */
24
+    type type_response_client_http = {
25
+        code: int;
26
+        text: string;
27
+    };
28
+    /**
29
+     * @author fenris
30
+     */
31
+    type type_parameters_client_http = {
32
+        protocol?: string;
33
+        host?: string;
34
+        port?: int;
35
+        path?: string;
36
+        omit_protocol?: boolean;
37
+        content_type?: string;
38
+        with_credentials?: boolean;
39
+    };
40
+    /**
41
+     * @author fenris
42
+     */
43
+    var default_parameters_client_http: type_parameters_client_http;
44
+}
45
+declare module lib_comm {
46
+    /**
47
+     * @author fenris
48
+     */
49
+    type type_client_http = {
50
+        parameters: type_parameters_client_http;
51
+        method: string;
52
+        headers: {
53
+            [key: string]: string;
54
+        };
55
+    };
56
+    /**
57
+     * @author fenris
58
+     */
59
+    function client_http_construct(parameters?: type_parameters_client_http, method?: string, headers?: {
60
+        [key: string]: string;
61
+    }): type_client_http;
62
+    /**
63
+     * @author fenris
64
+     */
65
+    function client_http_setup(subject: type_client_http): lib_call.type_promise<void, Error>;
66
+    /**
67
+     * @author fenris
68
+     */
69
+    function client_http_send(subject: type_client_http, message: string): lib_call.type_promise<type_response_client_http, Error>;
70
+    /**
71
+     * @author Martin Springwald <springwald@greenscale.de>
72
+     * @author Christian Neubauer <neubauer@greenscale.de>
73
+     * @author Christian Fraß <frass@greenscale.de>
74
+     */
75
+    function http_get_blob({ "url": url, "mime": type }: {
76
+        url: string;
77
+        mime: string;
78
+    }): lib_call.type_promise<Blob, void>;
79
+}
80
+declare module lib_comm {
81
+}
82
+declare module lib_comm {
83
+    /**
84
+     * @author fenris
85
+     */
86
+    class class_client_http implements interface_client<string, type_response_client_http> {
87
+        /**
88
+         * @author fenris
89
+         */
90
+        protected subject: type_client_http;
91
+        /**
92
+         * @author fenris
93
+         */
94
+        constructor(parameters?: type_parameters_client_http, method?: string, headers?: {
95
+            [key: string]: string;
96
+        });
97
+        /**
98
+         * @author fenris
99
+         * @implementation
100
+         */
101
+        setup(): lib_call.type_promise<void, Error>;
102
+        /**
103
+         * @author fenris
104
+         * @implementation
105
+         */
106
+        send(message: string): lib_call.type_promise<type_response_client_http, Error>;
107
+    }
108
+}
109
+declare module lib_comm {
110
+    /**
111
+     * @author fenris
112
+     */
113
+    class class_client_mhttp implements interface_client<string, string> {
114
+        /**
115
+         * @author fenris
116
+         */
117
+        protected core: class_client_http;
118
+        /**
119
+         * @author fenris
120
+         */
121
+        constructor(parameters?: type_parameters_client_http);
122
+        /**
123
+         * @author fenris
124
+         * @implementation
125
+         */
126
+        setup(): lib_call.type_promise<void, Error>;
127
+        /**
128
+         * @author fenris
129
+         * @implementation
130
+         */
131
+        send(message: string): lib_call.type_promise<string, Error>;
132
+    }
133
+}
134
+declare module lib_comm {
135
+    /**
136
+     * @desc wrapper for string-based clients
137
+     * @author fenris
138
+     */
139
+    class class_client_complex implements interface_client<any, any> {
140
+        /**
141
+         * @author fenris
142
+         */
143
+        protected core: interface_client<string, string>;
144
+        /**
145
+         * @author fenris
146
+         */
147
+        protected code: lib_code.interface_code<any, string>;
148
+        /**
149
+         * @author fenris
150
+         */
151
+        constructor(core: interface_client<string, string>, code?: lib_code.interface_code<any, string>);
152
+        /**
153
+         * @author fenris
154
+         * @implementation
155
+         */
156
+        setup(): lib_call.type_promise<void, Error>;
157
+        /**
158
+         * @author fenris
159
+         * @implementation
160
+         */
161
+        send(message: any): lib_call.type_promise<any, Error>;
162
+    }
163
+}
... ...
@@ -0,0 +1,478 @@
1
+/*
2
+This file is part of »bacterio-plankton:comm-client«.
3
+
4
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5
+<info@greenscale.de>
6
+
7
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
8
+it under the terms of the GNU Lesser General Public License as published by
9
+the Free Software Foundation, either version 3 of the License, or
10
+(at your option) any later version.
11
+
12
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
13
+but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+GNU Lesser General Public License for more details.
16
+
17
+You should have received a copy of the GNU Lesser General Public License
18
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+var lib_comm;
21
+(function (lib_comm) {
22
+    /**
23
+     * @author fenris
24
+     */
25
+    lib_trait.define("comm-client", {
26
+        "state": null,
27
+        "message_in": null,
28
+        "message_out": null
29
+    }, {
30
+        "setup": {
31
+            "shape": {
32
+                "name": "function",
33
+                "parameters": {
34
+                    "shape_input": {
35
+                        "name": "variable",
36
+                        "parameters": {
37
+                            "name": "state"
38
+                        }
39
+                    },
40
+                    "shape_output": {
41
+                        "name": "promise",
42
+                        "parameters": {
43
+                            "shape_result": {
44
+                                "name": "variable",
45
+                                "parameters": {
46
+                                    "name": "state"
47
+                                }
48
+                            },
49
+                            "shape_reason": {
50
+                                "name": "any"
51
+                            }
52
+                        }
53
+                    }
54
+                }
55
+            }
56
+        },
57
+        "send": {
58
+            "shape": {
59
+                "name": "function",
60
+                "parameters": {
61
+                    "shape_input": {
62
+                        "name": "variable",
63
+                        "parameters": {
64
+                            "name": "state"
65
+                        }
66
+                    },
67
+                    "shape_output": {
68
+                        "name": "function",
69
+                        "parameters": {
70
+                            "shape_input": {
71
+                                "name": "variable",
72
+                                "parameters": {
73
+                                    "name": "message_out"
74
+                                }
75
+                            },
76
+                            "shape_output": {
77
+                                "name": "promise",
78
+                                "parameters": {
79
+                                    "shape_result": {
80
+                                        "name": "variable",
81
+                                        "parameters": {
82
+                                            "name": "message_in"
83
+                                        }
84
+                                    },
85
+                                    "shape_reason": {
86
+                                        "name": "any"
87
+                                    }
88
+                                }
89
+                            }
90
+                        }
91
+                    }
92
+                }
93
+            }
94
+        }
95
+    });
96
+})(lib_comm || (lib_comm = {}));
97
+/*
98
+This file is part of »bacterio-plankton:comm-client«.
99
+
100
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
101
+<info@greenscale.de>
102
+
103
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
104
+it under the terms of the GNU Lesser General Public License as published by
105
+the Free Software Foundation, either version 3 of the License, or
106
+(at your option) any later version.
107
+
108
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
109
+but WITHOUT ANY WARRANTY; without even the implied warranty of
110
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
111
+GNU Lesser General Public License for more details.
112
+
113
+You should have received a copy of the GNU Lesser General Public License
114
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
115
+ */
116
+/*
117
+This file is part of »bacterio-plankton:comm-client«.
118
+
119
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
120
+<info@greenscale.de>
121
+
122
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
123
+it under the terms of the GNU Lesser General Public License as published by
124
+the Free Software Foundation, either version 3 of the License, or
125
+(at your option) any later version.
126
+
127
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
128
+but WITHOUT ANY WARRANTY; without even the implied warranty of
129
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
130
+GNU Lesser General Public License for more details.
131
+
132
+You should have received a copy of the GNU Lesser General Public License
133
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
134
+ */
135
+var lib_comm;
136
+(function (lib_comm) {
137
+    /**
138
+     * @author fenris
139
+     */
140
+    lib_comm.default_parameters_client_http = {
141
+        "protocol": "http",
142
+        "host": null,
143
+        "port": null,
144
+        "path": null,
145
+        "omit_protocol": false,
146
+        "content_type": "plain/text; charset=utf-8",
147
+        "with_credentials": false,
148
+    };
149
+})(lib_comm || (lib_comm = {}));
150
+/*
151
+This file is part of »bacterio-plankton:comm-client«.
152
+
153
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
154
+<info@greenscale.de>
155
+
156
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
157
+it under the terms of the GNU Lesser General Public License as published by
158
+the Free Software Foundation, either version 3 of the License, or
159
+(at your option) any later version.
160
+
161
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
162
+but WITHOUT ANY WARRANTY; without even the implied warranty of
163
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
164
+GNU Lesser General Public License for more details.
165
+
166
+You should have received a copy of the GNU Lesser General Public License
167
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
168
+ */
169
+var lib_comm;
170
+(function (lib_comm) {
171
+    /**
172
+     * @author fenris
173
+     */
174
+    function client_http_construct(parameters = {}, method = "POST", headers = {}) {
175
+        return {
176
+            "parameters": lib_object.patched(lib_comm.default_parameters_client_http, parameters),
177
+            "method": method.toLowerCase(),
178
+            "headers": headers,
179
+        };
180
+    }
181
+    lib_comm.client_http_construct = client_http_construct;
182
+    /**
183
+     * @author fenris
184
+     */
185
+    function client_http_setup(subject) {
186
+        return (lib_call.promise_resolve(undefined));
187
+    }
188
+    lib_comm.client_http_setup = client_http_setup;
189
+    /**
190
+     * @author fenris
191
+     */
192
+    function client_http_send(subject, message) {
193
+        return (lib_call.promise_make((resolve, reject) => {
194
+            if ((subject.method === "get") && (message !== null)) {
195
+                let message_ = "can not send data via GET";
196
+                reject(new Error(message_));
197
+            }
198
+            else {
199
+                let request = new XMLHttpRequest();
200
+                let url = lib_string.make_url({
201
+                    "protocol": (subject.parameters.omit_protocol ? null : subject.parameters.protocol),
202
+                    "host": subject.parameters.host,
203
+                    "port": subject.parameters.port,
204
+                    "path": subject.parameters.path,
205
+                });
206
+                request.open(subject.method.toUpperCase(), url, true);
207
+                lib_object.to_array(subject.headers).forEach(({ "key": key, "value": value }) => {
208
+                    request.setRequestHeader(key, value);
209
+                });
210
+                request.setRequestHeader("Content-Type", subject.parameters.content_type);
211
+                if (subject.parameters.with_credentials) {
212
+                    request.withCredentials = true;
213
+                }
214
+                /*
215
+                request.onerror = () => {
216
+                    debugger;
217
+                    reject(new Error("unhandled error"));
218
+                };
219
+                 */
220
+                request.onreadystatechange = () => {
221
+                    switch (request.readyState) {
222
+                        case XMLHttpRequest.DONE: {
223
+                            switch (request.status) {
224
+                                case 0: {
225
+                                    reject(new Error("XMLHttpRequest failed"));
226
+                                    break;
227
+                                }
228
+                                default: {
229
+                                    let answer = { "code": request.status, "text": request.responseText };
230
+                                    resolve(answer);
231
+                                    break;
232
+                                }
233
+                            }
234
+                            break;
235
+                        }
236
+                        default: {
237
+                            // console.warn(`unhandled readyState ${request.readyState}`);
238
+                            break;
239
+                        }
240
+                    }
241
+                };
242
+                request.send(message);
243
+            }
244
+        }));
245
+    }
246
+    lib_comm.client_http_send = client_http_send;
247
+    /**
248
+     * @author Martin Springwald <springwald@greenscale.de>
249
+     * @author Christian Neubauer <neubauer@greenscale.de>
250
+     * @author Christian Fraß <frass@greenscale.de>
251
+     */
252
+    function http_get_blob({ "url": url, "mime": type }) {
253
+        let request = new XMLHttpRequest();
254
+        return new Promise((resolve, reject) => {
255
+            request.open("GET", url, true);
256
+            request.responseType = "arraybuffer";
257
+            request.onload = function () {
258
+                if (request.status === 200) {
259
+                    resolve(new Blob([request.response], { "type": type }));
260
+                }
261
+                else {
262
+                    reject(new Error("error on blob-load"));
263
+                }
264
+            };
265
+            request.onerror = function () {
266
+                reject(undefined);
267
+            };
268
+            request.send();
269
+        });
270
+    }
271
+    lib_comm.http_get_blob = http_get_blob;
272
+})(lib_comm || (lib_comm = {}));
273
+/*
274
+This file is part of »bacterio-plankton:comm-client«.
275
+
276
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
277
+<info@greenscale.de>
278
+
279
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
280
+it under the terms of the GNU Lesser General Public License as published by
281
+the Free Software Foundation, either version 3 of the License, or
282
+(at your option) any later version.
283
+
284
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
285
+but WITHOUT ANY WARRANTY; without even the implied warranty of
286
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
287
+GNU Lesser General Public License for more details.
288
+
289
+You should have received a copy of the GNU Lesser General Public License
290
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
291
+ */
292
+var lib_comm;
293
+(function (lib_comm) {
294
+    /**
295
+     * @author fenris
296
+     */
297
+    lib_trait.attend("comm-client", "http", {
298
+        "state": {
299
+            "name": "any"
300
+        },
301
+        "message_in": {
302
+            "name": "string"
303
+        },
304
+        "message_out": {
305
+            "name": "any" // type_response_http
306
+        }
307
+    }, {
308
+        "setup": () => (state) => {
309
+            return lib_comm.client_http_setup(state).then(_ => lib_call.promise_resolve(state));
310
+        },
311
+        "send": () => (state) => (message) => {
312
+            return lib_comm.client_http_send(state, message);
313
+        }
314
+    });
315
+})(lib_comm || (lib_comm = {}));
316
+/*
317
+This file is part of »bacterio-plankton:comm-client«.
318
+
319
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
320
+<info@greenscale.de>
321
+
322
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
323
+it under the terms of the GNU Lesser General Public License as published by
324
+the Free Software Foundation, either version 3 of the License, or
325
+(at your option) any later version.
326
+
327
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
328
+but WITHOUT ANY WARRANTY; without even the implied warranty of
329
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
330
+GNU Lesser General Public License for more details.
331
+
332
+You should have received a copy of the GNU Lesser General Public License
333
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
334
+ */
335
+var lib_comm;
336
+(function (lib_comm) {
337
+    /**
338
+     * @author fenris
339
+     */
340
+    class class_client_http {
341
+        /**
342
+         * @author fenris
343
+         */
344
+        constructor(parameters = lib_comm.default_parameters_client_http, method = "POST", headers = {}) {
345
+            this.subject = lib_comm.client_http_construct(parameters, method, headers);
346
+        }
347
+        /**
348
+         * @author fenris
349
+         * @implementation
350
+         */
351
+        setup() {
352
+            return lib_comm.client_http_setup(this.subject);
353
+        }
354
+        /**
355
+         * @author fenris
356
+         * @implementation
357
+         */
358
+        send(message) {
359
+            return lib_comm.client_http_send(this.subject, message);
360
+        }
361
+    }
362
+    lib_comm.class_client_http = class_client_http;
363
+})(lib_comm || (lib_comm = {}));
364
+/*
365
+This file is part of »bacterio-plankton:comm-client«.
366
+
367
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
368
+<info@greenscale.de>
369
+
370
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
371
+it under the terms of the GNU Lesser General Public License as published by
372
+the Free Software Foundation, either version 3 of the License, or
373
+(at your option) any later version.
374
+
375
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
376
+but WITHOUT ANY WARRANTY; without even the implied warranty of
377
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
378
+GNU Lesser General Public License for more details.
379
+
380
+You should have received a copy of the GNU Lesser General Public License
381
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
382
+ */
383
+var lib_comm;
384
+(function (lib_comm) {
385
+    /**
386
+     * @author fenris
387
+     */
388
+    class class_client_mhttp {
389
+        /**
390
+         * @author fenris
391
+         */
392
+        constructor(parameters = lib_comm.default_parameters_client_http) {
393
+            this.core = new lib_comm.class_client_http(parameters);
394
+        }
395
+        /**
396
+         * @author fenris
397
+         * @implementation
398
+         */
399
+        setup() {
400
+            return this.core.setup();
401
+        }
402
+        /**
403
+         * @author fenris
404
+         * @implementation
405
+         */
406
+        send(message) {
407
+            return (this.core.send(message)
408
+                .then((answer) => {
409
+                switch (answer.code) {
410
+                    case 200: {
411
+                        return lib_call.promise_resolve(answer.text /*.toString()*/);
412
+                        break;
413
+                    }
414
+                    default: {
415
+                        return lib_call.promise_reject(new Error(`XMLHttpRequest failed; status was ${answer.code.toFixed(0)}`));
416
+                        break;
417
+                    }
418
+                }
419
+            }));
420
+        }
421
+    }
422
+    lib_comm.class_client_mhttp = class_client_mhttp;
423
+})(lib_comm || (lib_comm = {}));
424
+/*
425
+This file is part of »bacterio-plankton:comm-client«.
426
+
427
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
428
+<info@greenscale.de>
429
+
430
+»bacterio-plankton:comm-client« is free software: you can redistribute it and/or modify
431
+it under the terms of the GNU Lesser General Public License as published by
432
+the Free Software Foundation, either version 3 of the License, or
433
+(at your option) any later version.
434
+
435
+»bacterio-plankton:comm-client« is distributed in the hope that it will be useful,
436
+but WITHOUT ANY WARRANTY; without even the implied warranty of
437
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
438
+GNU Lesser General Public License for more details.
439
+
440
+You should have received a copy of the GNU Lesser General Public License
441
+along with »bacterio-plankton:comm-client«. If not, see <http://www.gnu.org/licenses/>.
442
+ */
443
+var lib_comm;
444
+(function (lib_comm) {
445
+    /**
446
+     * @desc wrapper for string-based clients
447
+     * @author fenris
448
+     */
449
+    class class_client_complex {
450
+        /**
451
+         * @author fenris
452
+         */
453
+        constructor(core, code = new lib_code.class_code_pair(new lib_code.class_code_json(), new lib_code.class_code_uri())) {
454
+            this.core = core;
455
+            this.code = code;
456
+        }
457
+        /**
458
+         * @author fenris
459
+         * @implementation
460
+         */
461
+        setup() {
462
+            return this.core.setup();
463
+        }
464
+        /**
465
+         * @author fenris
466
+         * @implementation
467
+         */
468
+        send(message) {
469
+            const message_out_raw = this.code.encode(message);
470
+            return (this.core.send(message_out_raw)
471
+                .then((message_in_raw) => {
472
+                const message_in = this.code.decode(message_in_raw);
473
+                return lib_call.promise_resolve(message_in);
474
+            }));
475
+        }
476
+    }
477
+    lib_comm.class_client_complex = class_client_complex;
478
+})(lib_comm || (lib_comm = {}));
... ...
@@ -0,0 +1,861 @@
1
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2
+<info@greenscale.de>
3
+
4
+»bacterio-plankton:object« is free software: you can redistribute it and/or modify
5
+it under the terms of the GNU Lesser General Public License as published by
6
+the Free Software Foundation, either version 3 of the License, or
7
+(at your option) any later version.
8
+
9
+»bacterio-plankton:object« is distributed in the hope that it will be useful,
10
+but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+GNU Lesser General Public License for more details.
13
+
14
+You should have received a copy of the GNU Lesser General Public License
15
+along with »bacterio-plankton:object«. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+
18
+
19
+                    GNU GENERAL PUBLIC LICENSE
20
+                       Version 3, 29 June 2007
21
+
22
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
23
+ Everyone is permitted to copy and distribute verbatim copies
24
+ of this license document, but changing it is not allowed.
25
+
26
+                            Preamble
27
+
28
+  The GNU General Public License is a free, copyleft license for
29
+software and other kinds of works.
30
+
31
+  The licenses for most software and other practical works are designed
32
+to take away your freedom to share and change the works.  By contrast,
33
+the GNU General Public License is intended to guarantee your freedom to
34
+share and change all versions of a program--to make sure it remains free
35
+software for all its users.  We, the Free Software Foundation, use the
36
+GNU General Public License for most of our software; it applies also to
37
+any other work released this way by its authors.  You can apply it to
38
+your programs, too.
39
+
40
+  When we speak of free software, we are referring to freedom, not
41
+price.  Our General Public Licenses are designed to make sure that you
42
+have the freedom to distribute copies of free software (and charge for
43
+them if you wish), that you receive source code or can get it if you
44
+want it, that you can change the software or use pieces of it in new
45
+free programs, and that you know you can do these things.
46
+
47
+  To protect your rights, we need to prevent others from denying you
48
+these rights or asking you to surrender the rights.  Therefore, you have
49
+certain responsibilities if you distribute copies of the software, or if
50
+you modify it: responsibilities to respect the freedom of others.
51
+
52
+  For example, if you distribute copies of such a program, whether
53
+gratis or for a fee, you must pass on to the recipients the same
54
+freedoms that you received.  You must make sure that they, too, receive
55
+or can get the source code.  And you must show them these terms so they
56
+know their rights.
57
+
58
+  Developers that use the GNU GPL protect your rights with two steps:
59
+(1) assert copyright on the software, and (2) offer you this License
60
+giving you legal permission to copy, distribute and/or modify it.
61
+
62
+  For the developers' and authors' protection, the GPL clearly explains
63
+that there is no warranty for this free software.  For both users' and
64
+authors' sake, the GPL requires that modified versions be marked as
65
+changed, so that their problems will not be attributed erroneously to
66
+authors of previous versions.
67
+
68
+  Some devices are designed to deny users access to install or run
69
+modified versions of the software inside them, although the manufacturer
70
+can do so.  This is fundamentally incompatible with the aim of
71
+protecting users' freedom to change the software.  The systematic
72
+pattern of such abuse occurs in the area of products for individuals to
73
+use, which is precisely where it is most unacceptable.  Therefore, we
74
+have designed this version of the GPL to prohibit the practice for those
75
+products.  If such problems arise substantially in other domains, we
76
+stand ready to extend this provision to those domains in future versions
77
+of the GPL, as needed to protect the freedom of users.
78
+
79
+  Finally, every program is threatened constantly by software patents.
80
+States should not allow patents to restrict development and use of
81
+software on general-purpose computers, but in those that do, we wish to
82
+avoid the special danger that patents applied to a free program could
83
+make it effectively proprietary.  To prevent this, the GPL assures that
84
+patents cannot be used to render the program non-free.
85
+
86
+  The precise terms and conditions for copying, distribution and
87
+modification follow.
88
+
89
+                       TERMS AND CONDITIONS
90
+
91
+  0. Definitions.
92
+
93
+  "This License" refers to version 3 of the GNU General Public License.
94
+
95
+  "Copyright" also means copyright-like laws that apply to other kinds of
96
+works, such as semiconductor masks.
97
+
98
+  "The Program" refers to any copyrightable work licensed under this
99
+License.  Each licensee is addressed as "you".  "Licensees" and
100
+"recipients" may be individuals or organizations.
101
+
102
+  To "modify" a work means to copy from or adapt all or part of the work
103
+in a fashion requiring copyright permission, other than the making of an
104
+exact copy.  The resulting work is called a "modified version" of the
105
+earlier work or a work "based on" the earlier work.
106
+
107
+  A "covered work" means either the unmodified Program or a work based
108
+on the Program.
109
+
110
+  To "propagate" a work means to do anything with it that, without
111
+permission, would make you directly or secondarily liable for
112
+infringement under applicable copyright law, except executing it on a
113
+computer or modifying a private copy.  Propagation includes copying,
114
+distribution (with or without modification), making available to the
115
+public, and in some countries other activities as well.
116
+
117
+  To "convey" a work means any kind of propagation that enables other
118
+parties to make or receive copies.  Mere interaction with a user through
119
+a computer network, with no transfer of a copy, is not conveying.
120
+
121
+  An interactive user interface displays "Appropriate Legal Notices"
122
+to the extent that it includes a convenient and prominently visible
123
+feature that (1) displays an appropriate copyright notice, and (2)
124
+tells the user that there is no warranty for the work (except to the
125
+extent that warranties are provided), that licensees may convey the
126
+work under this License, and how to view a copy of this License.  If
127
+the interface presents a list of user commands or options, such as a
128
+menu, a prominent item in the list meets this criterion.
129
+
130
+  1. Source Code.
131
+
132
+  The "source code" for a work means the preferred form of the work
133
+for making modifications to it.  "Object code" means any non-source
134
+form of a work.
135
+
136
+  A "Standard Interface" means an interface that either is an official
137
+standard defined by a recognized standards body, or, in the case of
138
+interfaces specified for a particular programming language, one that
139
+is widely used among developers working in that language.
140
+
141
+  The "System Libraries" of an executable work include anything, other
142
+than the work as a whole, that (a) is included in the normal form of
143
+packaging a Major Component, but which is not part of that Major
144
+Component, and (b) serves only to enable use of the work with that
145
+Major Component, or to implement a Standard Interface for which an
146
+implementation is available to the public in source code form.  A
147
+"Major Component", in this context, means a major essential component
148
+(kernel, window system, and so on) of the specific operating system
149
+(if any) on which the executable work runs, or a compiler used to
150
+produce the work, or an object code interpreter used to run it.
151
+
152
+  The "Corresponding Source" for a work in object code form means all
153
+the source code needed to generate, install, and (for an executable
154
+work) run the object code and to modify the work, including scripts to
155
+control those activities.  However, it does not include the work's
156
+System Libraries, or general-purpose tools or generally available free
157
+programs which are used unmodified in performing those activities but
158
+which are not part of the work.  For example, Corresponding Source
159
+includes interface definition files associated with source files for
160
+the work, and the source code for shared libraries and dynamically
161
+linked subprograms that the work is specifically designed to require,
162
+such as by intimate data communication or control flow between those
163
+subprograms and other parts of the work.
164
+
165
+  The Corresponding Source need not include anything that users
166
+can regenerate automatically from other parts of the Corresponding
167
+Source.
168
+
169
+  The Corresponding Source for a work in source code form is that
170
+same work.
171
+
172
+  2. Basic Permissions.
173
+
174
+  All rights granted under this License are granted for the term of
175
+copyright on the Program, and are irrevocable provided the stated
176
+conditions are met.  This License explicitly affirms your unlimited
177
+permission to run the unmodified Program.  The output from running a
178
+covered work is covered by this License only if the output, given its
179
+content, constitutes a covered work.  This License acknowledges your
180
+rights of fair use or other equivalent, as provided by copyright law.
181
+
182
+  You may make, run and propagate covered works that you do not
183
+convey, without conditions so long as your license otherwise remains
184
+in force.  You may convey covered works to others for the sole purpose
185
+of having them make modifications exclusively for you, or provide you
186
+with facilities for running those works, provided that you comply with
187
+the terms of this License in conveying all material for which you do
188
+not control copyright.  Those thus making or running the covered works
189
+for you must do so exclusively on your behalf, under your direction
190
+and control, on terms that prohibit them from making any copies of
191
+your copyrighted material outside their relationship with you.
192
+
193
+  Conveying under any other circumstances is permitted solely under
194
+the conditions stated below.  Sublicensing is not allowed; section 10
195
+makes it unnecessary.
196
+
197
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
198
+
199
+  No covered work shall be deemed part of an effective technological
200
+measure under any applicable law fulfilling obligations under article
201
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
202
+similar laws prohibiting or restricting circumvention of such
203
+measures.
204
+
205
+  When you convey a covered work, you waive any legal power to forbid
206
+circumvention of technological measures to the extent such circumvention
207
+is effected by exercising rights under this License with respect to
208
+the covered work, and you disclaim any intention to limit operation or
209
+modification of the work as a means of enforcing, against the work's
210
+users, your or third parties' legal rights to forbid circumvention of
211
+technological measures.
212
+
213
+  4. Conveying Verbatim Copies.
214
+
215
+  You may convey verbatim copies of the Program's source code as you
216
+receive it, in any medium, provided that you conspicuously and
217
+appropriately publish on each copy an appropriate copyright notice;
218
+keep intact all notices stating that this License and any
219
+non-permissive terms added in accord with section 7 apply to the code;
220
+keep intact all notices of the absence of any warranty; and give all
221
+recipients a copy of this License along with the Program.
222
+
223
+  You may charge any price or no price for each copy that you convey,
224
+and you may offer support or warranty protection for a fee.
225
+
226
+  5. Conveying Modified Source Versions.
227
+
228
+  You may convey a work based on the Program, or the modifications to
229
+produce it from the Program, in the form of source code under the
230
+terms of section 4, provided that you also meet all of these conditions:
231
+
232
+    a) The work must carry prominent notices stating that you modified
233
+    it, and giving a relevant date.
234
+
235
+    b) The work must carry prominent notices stating that it is
236
+    released under this License and any conditions added under section
237
+    7.  This requirement modifies the requirement in section 4 to
238
+    "keep intact all notices".
239
+
240
+    c) You must license the entire work, as a whole, under this
241
+    License to anyone who comes into possession of a copy.  This
242
+    License will therefore apply, along with any applicable section 7
243
+    additional terms, to the whole of the work, and all its parts,
244
+    regardless of how they are packaged.  This License gives no
245
+    permission to license the work in any other way, but it does not
246
+    invalidate such permission if you have separately received it.
247
+
248
+    d) If the work has interactive user interfaces, each must display
249
+    Appropriate Legal Notices; however, if the Program has interactive
250
+    interfaces that do not display Appropriate Legal Notices, your
251
+    work need not make them do so.
252
+
253
+  A compilation of a covered work with other separate and independent
254
+works, which are not by their nature extensions of the covered work,
255
+and which are not combined with it such as to form a larger program,
256
+in or on a volume of a storage or distribution medium, is called an
257
+"aggregate" if the compilation and its resulting copyright are not
258
+used to limit the access or legal rights of the compilation's users
259
+beyond what the individual works permit.  Inclusion of a covered work
260
+in an aggregate does not cause this License to apply to the other
261
+parts of the aggregate.
262
+
263
+  6. Conveying Non-Source Forms.
264
+
265
+  You may convey a covered work in object code form under the terms
266
+of sections 4 and 5, provided that you also convey the
267
+machine-readable Corresponding Source under the terms of this License,
268
+in one of these ways:
269
+
270
+    a) Convey the object code in, or embodied in, a physical product
271
+    (including a physical distribution medium), accompanied by the
272
+    Corresponding Source fixed on a durable physical medium
273
+    customarily used for software interchange.
274
+
275
+    b) Convey the object code in, or embodied in, a physical product
276
+    (including a physical distribution medium), accompanied by a
277
+    written offer, valid for at least three years and valid for as
278
+    long as you offer spare parts or customer support for that product
279
+    model, to give anyone who possesses the object code either (1) a
280
+    copy of the Corresponding Source for all the software in the
281
+    product that is covered by this License, on a durable physical
282
+    medium customarily used for software interchange, for a price no
283
+    more than your reasonable cost of physically performing this
284
+    conveying of source, or (2) access to copy the
285
+    Corresponding Source from a network server at no charge.
286
+
287
+    c) Convey individual copies of the object code with a copy of the
288
+    written offer to provide the Corresponding Source.  This
289
+    alternative is allowed only occasionally and noncommercially, and
290
+    only if you received the object code with such an offer, in accord
291
+    with subsection 6b.
292
+
293
+    d) Convey the object code by offering access from a designated
294
+    place (gratis or for a charge), and offer equivalent access to the
295
+    Corresponding Source in the same way through the same place at no
296
+    further charge.  You need not require recipients to copy the
297
+    Corresponding Source along with the object code.  If the place to
298
+    copy the object code is a network server, the Corresponding Source
299
+    may be on a different server (operated by you or a third party)
300
+    that supports equivalent copying facilities, provided you maintain
301
+    clear directions next to the object code saying where to find the
302
+    Corresponding Source.  Regardless of what server hosts the
303
+    Corresponding Source, you remain obligated to ensure that it is
304
+    available for as long as needed to satisfy these requirements.
305
+
306
+    e) Convey the object code using peer-to-peer transmission, provided
307
+    you inform other peers where the object code and Corresponding
308
+    Source of the work are being offered to the general public at no
309
+    charge under subsection 6d.
310
+
311
+  A separable portion of the object code, whose source code is excluded
312
+from the Corresponding Source as a System Library, need not be
313
+included in conveying the object code work.
314
+
315
+  A "User Product" is either (1) a "consumer product", which means any
316
+tangible personal property which is normally used for personal, family,
317
+or household purposes, or (2) anything designed or sold for incorporation
318
+into a dwelling.  In determining whether a product is a consumer product,
319
+doubtful cases shall be resolved in favor of coverage.  For a particular
320
+product received by a particular user, "normally used" refers to a
321
+typical or common use of that class of product, regardless of the status
322
+of the particular user or of the way in which the particular user
323
+actually uses, or expects or is expected to use, the product.  A product
324
+is a consumer product regardless of whether the product has substantial
325
+commercial, industrial or non-consumer uses, unless such uses represent
326
+the only significant mode of use of the product.
327
+
328
+  "Installation Information" for a User Product means any methods,
329
+procedures, authorization keys, or other information required to install
330
+and execute modified versions of a covered work in that User Product from
331
+a modified version of its Corresponding Source.  The information must
332
+suffice to ensure that the continued functioning of the modified object
333
+code is in no case prevented or interfered with solely because
334
+modification has been made.
335
+
336
+  If you convey an object code work under this section in, or with, or
337
+specifically for use in, a User Product, and the conveying occurs as
338
+part of a transaction in which the right of possession and use of the
339
+User Product is transferred to the recipient in perpetuity or for a
340
+fixed term (regardless of how the transaction is characterized), the
341
+Corresponding Source conveyed under this section must be accompanied
342
+by the Installation Information.  But this requirement does not apply
343
+if neither you nor any third party retains the ability to install
344
+modified object code on the User Product (for example, the work has
345
+been installed in ROM).
346
+
347
+  The requirement to provide Installation Information does not include a
348
+requirement to continue to provide support service, warranty, or updates
349
+for a work that has been modified or installed by the recipient, or for
350
+the User Product in which it has been modified or installed.  Access to a
351
+network may be denied when the modification itself materially and
352
+adversely affects the operation of the network or violates the rules and
353
+protocols for communication across the network.
354
+
355
+  Corresponding Source conveyed, and Installation Information provided,
356
+in accord with this section must be in a format that is publicly
357
+documented (and with an implementation available to the public in
358
+source code form), and must require no special password or key for
359
+unpacking, reading or copying.
360
+
361
+  7. Additional Terms.
362
+
363
+  "Additional permissions" are terms that supplement the terms of this
364
+License by making exceptions from one or more of its conditions.
365
+Additional permissions that are applicable to the entire Program shall
366
+be treated as though they were included in this License, to the extent
367
+that they are valid under applicable law.  If additional permissions
368
+apply only to part of the Program, that part may be used separately
369
+under those permissions, but the entire Program remains governed by
370
+this License without regard to the additional permissions.
371
+
372
+  When you convey a copy of a covered work, you may at your option
373
+remove any additional permissions from that copy, or from any part of
374
+it.  (Additional permissions may be written to require their own
375
+removal in certain cases when you modify the work.)  You may place
376
+additional permissions on material, added by you to a covered work,
377
+for which you have or can give appropriate copyright permission.
378
+
379
+  Notwithstanding any other provision of this License, for material you
380
+add to a covered work, you may (if authorized by the copyright holders of
381
+that material) supplement the terms of this License with terms:
382
+
383
+    a) Disclaiming warranty or limiting liability differently from the
384
+    terms of sections 15 and 16 of this License; or
385
+
386
+    b) Requiring preservation of specified reasonable legal notices or
387
+    author attributions in that material or in the Appropriate Legal
388
+    Notices displayed by works containing it; or
389
+
390
+    c) Prohibiting misrepresentation of the origin of that material, or
391
+    requiring that modified versions of such material be marked in
392
+    reasonable ways as different from the original version; or
393
+
394
+    d) Limiting the use for publicity purposes of names of licensors or
395
+    authors of the material; or
396
+
397
+    e) Declining to grant rights under trademark law for use of some
398
+    trade names, trademarks, or service marks; or
399
+
400
+    f) Requiring indemnification of licensors and authors of that
401
+    material by anyone who conveys the material (or modified versions of
402
+    it) with contractual assumptions of liability to the recipient, for
403
+    any liability that these contractual assumptions directly impose on
404
+    those licensors and authors.
405
+
406
+  All other non-permissive additional terms are considered "further
407
+restrictions" within the meaning of section 10.  If the Program as you
408
+received it, or any part of it, contains a notice stating that it is
409
+governed by this License along with a term that is a further
410
+restriction, you may remove that term.  If a license document contains
411
+a further restriction but permits relicensing or conveying under this
412
+License, you may add to a covered work material governed by the terms
413
+of that license document, provided that the further restriction does
414
+not survive such relicensing or conveying.
415
+
416
+  If you add terms to a covered work in accord with this section, you
417
+must place, in the relevant source files, a statement of the
418
+additional terms that apply to those files, or a notice indicating
419
+where to find the applicable terms.
420
+
421
+  Additional terms, permissive or non-permissive, may be stated in the
422
+form of a separately written license, or stated as exceptions;
423
+the above requirements apply either way.
424
+
425
+  8. Termination.
426
+
427
+  You may not propagate or modify a covered work except as expressly
428
+provided under this License.  Any attempt otherwise to propagate or
429
+modify it is void, and will automatically terminate your rights under
430
+this License (including any patent licenses granted under the third
431
+paragraph of section 11).
432
+
433
+  However, if you cease all violation of this License, then your
434
+license from a particular copyright holder is reinstated (a)
435
+provisionally, unless and until the copyright holder explicitly and
436
+finally terminates your license, and (b) permanently, if the copyright
437
+holder fails to notify you of the violation by some reasonable means
438
+prior to 60 days after the cessation.
439
+
440
+  Moreover, your license from a particular copyright holder is
441
+reinstated permanently if the copyright holder notifies you of the
442
+violation by some reasonable means, this is the first time you have
443
+received notice of violation of this License (for any work) from that
444
+copyright holder, and you cure the violation prior to 30 days after
445
+your receipt of the notice.
446
+
447
+  Termination of your rights under this section does not terminate the
448
+licenses of parties who have received copies or rights from you under
449
+this License.  If your rights have been terminated and not permanently
450
+reinstated, you do not qualify to receive new licenses for the same
451
+material under section 10.
452
+
453
+  9. Acceptance Not Required for Having Copies.
454
+
455
+  You are not required to accept this License in order to receive or
456
+run a copy of the Program.  Ancillary propagation of a covered work
457
+occurring solely as a consequence of using peer-to-peer transmission
458
+to receive a copy likewise does not require acceptance.  However,
459
+nothing other than this License grants you permission to propagate or
460
+modify any covered work.  These actions infringe copyright if you do
461
+not accept this License.  Therefore, by modifying or propagating a
462
+covered work, you indicate your acceptance of this License to do so.
463
+
464
+  10. Automatic Licensing of Downstream Recipients.
465
+
466
+  Each time you convey a covered work, the recipient automatically
467
+receives a license from the original licensors, to run, modify and
468
+propagate that work, subject to this License.  You are not responsible
469
+for enforcing compliance by third parties with this License.
470
+
471
+  An "entity transaction" is a transaction transferring control of an
472
+organization, or substantially all assets of one, or subdividing an
473
+organization, or merging organizations.  If propagation of a covered
474
+work results from an entity transaction, each party to that
475
+transaction who receives a copy of the work also receives whatever
476
+licenses to the work the party's predecessor in interest had or could
477
+give under the previous paragraph, plus a right to possession of the
478
+Corresponding Source of the work from the predecessor in interest, if
479
+the predecessor has it or can get it with reasonable efforts.
480
+
481
+  You may not impose any further restrictions on the exercise of the
482
+rights granted or affirmed under this License.  For example, you may
483
+not impose a license fee, royalty, or other charge for exercise of
484
+rights granted under this License, and you may not initiate litigation
485
+(including a cross-claim or counterclaim in a lawsuit) alleging that
486
+any patent claim is infringed by making, using, selling, offering for
487
+sale, or importing the Program or any portion of it.
488
+
489
+  11. Patents.
490
+
491
+  A "contributor" is a copyright holder who authorizes use under this
492
+License of the Program or a work on which the Program is based.  The
493
+work thus licensed is called the contributor's "contributor version".
494
+
495
+  A contributor's "essential patent claims" are all patent claims
496
+owned or controlled by the contributor, whether already acquired or
497
+hereafter acquired, that would be infringed by some manner, permitted
498
+by this License, of making, using, or selling its contributor version,
499
+but do not include claims that would be infringed only as a
500
+consequence of further modification of the contributor version.  For
501
+purposes of this definition, "control" includes the right to grant
502
+patent sublicenses in a manner consistent with the requirements of
503
+this License.
504
+
505
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
506
+patent license under the contributor's essential patent claims, to
507
+make, use, sell, offer for sale, import and otherwise run, modify and
508
+propagate the contents of its contributor version.
509
+
510
+  In the following three paragraphs, a "patent license" is any express
511
+agreement or commitment, however denominated, not to enforce a patent
512
+(such as an express permission to practice a patent or covenant not to
513
+sue for patent infringement).  To "grant" such a patent license to a
514
+party means to make such an agreement or commitment not to enforce a
515
+patent against the party.
516
+
517
+  If you convey a covered work, knowingly relying on a patent license,
518
+and the Corresponding Source of the work is not available for anyone
519
+to copy, free of charge and under the terms of this License, through a
520
+publicly available network server or other readily accessible means,
521
+then you must either (1) cause the Corresponding Source to be so
522
+available, or (2) arrange to deprive yourself of the benefit of the
523
+patent license for this particular work, or (3) arrange, in a manner
524
+consistent with the requirements of this License, to extend the patent
525
+license to downstream recipients.  "Knowingly relying" means you have
526
+actual knowledge that, but for the patent license, your conveying the
527
+covered work in a country, or your recipient's use of the covered work
528
+in a country, would infringe one or more identifiable patents in that
529
+country that you have reason to believe are valid.
530
+
531
+  If, pursuant to or in connection with a single transaction or
532
+arrangement, you convey, or propagate by procuring conveyance of, a
533
+covered work, and grant a patent license to some of the parties
534
+receiving the covered work authorizing them to use, propagate, modify
535
+or convey a specific copy of the covered work, then the patent license
536
+you grant is automatically extended to all recipients of the covered
537
+work and works based on it.
538
+
539
+  A patent license is "discriminatory" if it does not include within
540
+the scope of its coverage, prohibits the exercise of, or is
541
+conditioned on the non-exercise of one or more of the rights that are
542
+specifically granted under this License.  You may not convey a covered
543
+work if you are a party to an arrangement with a third party that is
544
+in the business of distributing software, under which you make payment
545
+to the third party based on the extent of your activity of conveying
546
+the work, and under which the third party grants, to any of the
547
+parties who would receive the covered work from you, a discriminatory
548
+patent license (a) in connection with copies of the covered work
549
+conveyed by you (or copies made from those copies), or (b) primarily
550
+for and in connection with specific products or compilations that
551
+contain the covered work, unless you entered into that arrangement,
552
+or that patent license was granted, prior to 28 March 2007.
553
+
554
+  Nothing in this License shall be construed as excluding or limiting
555
+any implied license or other defenses to infringement that may
556
+otherwise be available to you under applicable patent law.
557
+
558
+  12. No Surrender of Others' Freedom.
559
+
560
+  If conditions are imposed on you (whether by court order, agreement or
561
+otherwise) that contradict the conditions of this License, they do not
562
+excuse you from the conditions of this License.  If you cannot convey a
563
+covered work so as to satisfy simultaneously your obligations under this
564
+License and any other pertinent obligations, then as a consequence you may
565
+not convey it at all.  For example, if you agree to terms that obligate you
566
+to collect a royalty for further conveying from those to whom you convey
567
+the Program, the only way you could satisfy both those terms and this
568
+License would be to refrain entirely from conveying the Program.
569
+
570
+  13. Use with the GNU Affero General Public License.
571
+
572
+  Notwithstanding any other provision of this License, you have
573
+permission to link or combine any covered work with a work licensed
574
+under version 3 of the GNU Affero General Public License into a single
575
+combined work, and to convey the resulting work.  The terms of this
576
+License will continue to apply to the part which is the covered work,
577
+but the special requirements of the GNU Affero General Public License,
578
+section 13, concerning interaction through a network will apply to the
579
+combination as such.
580
+
581
+  14. Revised Versions of this License.
582
+
583
+  The Free Software Foundation may publish revised and/or new versions of
584
+the GNU General Public License from time to time.  Such new versions will
585
+be similar in spirit to the present version, but may differ in detail to
586
+address new problems or concerns.
587
+
588
+  Each version is given a distinguishing version number.  If the
589
+Program specifies that a certain numbered version of the GNU General
590
+Public License "or any later version" applies to it, you have the
591
+option of following the terms and conditions either of that numbered
592
+version or of any later version published by the Free Software
593
+Foundation.  If the Program does not specify a version number of the
594
+GNU General Public License, you may choose any version ever published
595
+by the Free Software Foundation.
596
+
597
+  If the Program specifies that a proxy can decide which future
598
+versions of the GNU General Public License can be used, that proxy's
599
+public statement of acceptance of a version permanently authorizes you
600
+to choose that version for the Program.
601
+
602
+  Later license versions may give you additional or different
603
+permissions.  However, no additional obligations are imposed on any
604
+author or copyright holder as a result of your choosing to follow a
605
+later version.
606
+
607
+  15. Disclaimer of Warranty.
608
+
609
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
610
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
611
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
612
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
613
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
614
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
615
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
616
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
617
+
618
+  16. Limitation of Liability.
619
+
620
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
621
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
622
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
623
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
624
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
625
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
626
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
627
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
628
+SUCH DAMAGES.
629
+
630
+  17. Interpretation of Sections 15 and 16.
631
+
632
+  If the disclaimer of warranty and limitation of liability provided
633
+above cannot be given local legal effect according to their terms,
634
+reviewing courts shall apply local law that most closely approximates
635
+an absolute waiver of all civil liability in connection with the
636
+Program, unless a warranty or assumption of liability accompanies a
637
+copy of the Program in return for a fee.
638
+
639
+                     END OF TERMS AND CONDITIONS
640
+
641
+            How to Apply These Terms to Your New Programs
642
+
643
+  If you develop a new program, and you want it to be of the greatest
644
+possible use to the public, the best way to achieve this is to make it
645
+free software which everyone can redistribute and change under these terms.
646
+
647
+  To do so, attach the following notices to the program.  It is safest
648
+to attach them to the start of each source file to most effectively
649
+state the exclusion of warranty; and each file should have at least
650
+the "copyright" line and a pointer to where the full notice is found.
651
+
652
+    <one line to give the program's name and a brief idea of what it does.>
653
+    Copyright (C) <year>  <name of author>
654
+
655
+    This program is free software: you can redistribute it and/or modify
656
+    it under the terms of the GNU General Public License as published by
657
+    the Free Software Foundation, either version 3 of the License, or
658
+    (at your option) any later version.
659
+
660
+    This program is distributed in the hope that it will be useful,
661
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
662
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
663
+    GNU General Public License for more details.
664
+
665
+    You should have received a copy of the GNU General Public License
666
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
667
+
668
+Also add information on how to contact you by electronic and paper mail.
669
+
670
+  If the program does terminal interaction, make it output a short
671
+notice like this when it starts in an interactive mode:
672
+
673
+    <program>  Copyright (C) <year>  <name of author>
674
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
675
+    This is free software, and you are welcome to redistribute it
676
+    under certain conditions; type `show c' for details.
677
+
678
+The hypothetical commands `show w' and `show c' should show the appropriate
679
+parts of the General Public License.  Of course, your program's commands
680
+might be different; for a GUI interface, you would use an "about box".
681
+
682
+  You should also get your employer (if you work as a programmer) or school,
683
+if any, to sign a "copyright disclaimer" for the program, if necessary.
684
+For more information on this, and how to apply and follow the GNU GPL, see
685
+<https://www.gnu.org/licenses/>.
686
+
687
+  The GNU General Public License does not permit incorporating your program
688
+into proprietary programs.  If your program is a subroutine library, you
689
+may consider it more useful to permit linking proprietary applications with
690
+the library.  If this is what you want to do, use the GNU Lesser General
691
+Public License instead of this License.  But first, please read
692
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
693
+
694
+
695
+
696
+                   GNU LESSER GENERAL PUBLIC LICENSE
697
+                       Version 3, 29 June 2007
698
+
699
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
700
+ Everyone is permitted to copy and distribute verbatim copies
701
+ of this license document, but changing it is not allowed.
702
+
703
+
704
+  This version of the GNU Lesser General Public License incorporates
705
+the terms and conditions of version 3 of the GNU General Public
706
+License, supplemented by the additional permissions listed below.
707
+
708
+  0. Additional Definitions.
709
+
710
+  As used herein, "this License" refers to version 3 of the GNU Lesser
711
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
712
+General Public License.
713
+
714
+  "The Library" refers to a covered work governed by this License,
715
+other than an Application or a Combined Work as defined below.
716
+
717
+  An "Application" is any work that makes use of an interface provided
718
+by the Library, but which is not otherwise based on the Library.
719
+Defining a subclass of a class defined by the Library is deemed a mode
720
+of using an interface provided by the Library.
721
+
722
+  A "Combined Work" is a work produced by combining or linking an
723
+Application with the Library.  The particular version of the Library
724
+with which the Combined Work was made is also called the "Linked
725
+Version".
726
+
727
+  The "Minimal Corresponding Source" for a Combined Work means the
728
+Corresponding Source for the Combined Work, excluding any source code
729
+for portions of the Combined Work that, considered in isolation, are
730
+based on the Application, and not on the Linked Version.
731
+
732
+  The "Corresponding Application Code" for a Combined Work means the
733
+object code and/or source code for the Application, including any data
734
+and utility programs needed for reproducing the Combined Work from the
735
+Application, but excluding the System Libraries of the Combined Work.
736
+
737
+  1. Exception to Section 3 of the GNU GPL.
738
+
739
+  You may convey a covered work under sections 3 and 4 of this License
740
+without being bound by section 3 of the GNU GPL.
741
+
742
+  2. Conveying Modified Versions.
743
+
744
+  If you modify a copy of the Library, and, in your modifications, a
745
+facility refers to a function or data to be supplied by an Application
746
+that uses the facility (other than as an argument passed when the
747
+facility is invoked), then you may convey a copy of the modified
748
+version:
749
+
750
+   a) under this License, provided that you make a good faith effort to
751
+   ensure that, in the event an Application does not supply the
752
+   function or data, the facility still operates, and performs
753
+   whatever part of its purpose remains meaningful, or
754
+
755
+   b) under the GNU GPL, with none of the additional permissions of
756
+   this License applicable to that copy.
757
+
758
+  3. Object Code Incorporating Material from Library Header Files.
759
+
760
+  The object code form of an Application may incorporate material from
761
+a header file that is part of the Library.  You may convey such object
762
+code under terms of your choice, provided that, if the incorporated
763
+material is not limited to numerical parameters, data structure
764
+layouts and accessors, or small macros, inline functions and templates
765
+(ten or fewer lines in length), you do both of the following:
766
+
767
+   a) Give prominent notice with each copy of the object code that the
768
+   Library is used in it and that the Library and its use are
769
+   covered by this License.
770
+
771
+   b) Accompany the object code with a copy of the GNU GPL and this license
772
+   document.
773
+
774
+  4. Combined Works.
775
+
776
+  You may convey a Combined Work under terms of your choice that,
777
+taken together, effectively do not restrict modification of the
778
+portions of the Library contained in the Combined Work and reverse
779
+engineering for debugging such modifications, if you also do each of
780
+the following:
781
+
782
+   a) Give prominent notice with each copy of the Combined Work that
783
+   the Library is used in it and that the Library and its use are
784
+   covered by this License.
785
+
786
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
787
+   document.
788
+
789
+   c) For a Combined Work that displays copyright notices during
790
+   execution, include the copyright notice for the Library among
791
+   these notices, as well as a reference directing the user to the
792
+   copies of the GNU GPL and this license document.
793
+
794
+   d) Do one of the following:
795
+
796
+       0) Convey the Minimal Corresponding Source under the terms of this
797
+       License, and the Corresponding Application Code in a form
798
+       suitable for, and under terms that permit, the user to
799
+       recombine or relink the Application with a modified version of
800
+       the Linked Version to produce a modified Combined Work, in the
801
+       manner specified by section 6 of the GNU GPL for conveying
802
+       Corresponding Source.
803
+
804
+       1) Use a suitable shared library mechanism for linking with the
805
+       Library.  A suitable mechanism is one that (a) uses at run time
806
+       a copy of the Library already present on the user's computer
807
+       system, and (b) will operate properly with a modified version
808
+       of the Library that is interface-compatible with the Linked
809
+       Version.
810
+
811
+   e) Provide Installation Information, but only if you would otherwise
812
+   be required to provide such information under section 6 of the
813
+   GNU GPL, and only to the extent that such information is
814
+   necessary to install and execute a modified version of the
815
+   Combined Work produced by recombining or relinking the
816
+   Application with a modified version of the Linked Version. (If
817
+   you use option 4d0, the Installation Information must accompany
818
+   the Minimal Corresponding Source and Corresponding Application
819
+   Code. If you use option 4d1, you must provide the Installation
820
+   Information in the manner specified by section 6 of the GNU GPL
821
+   for conveying Corresponding Source.)
822
+
823
+  5. Combined Libraries.
824
+
825
+  You may place library facilities that are a work based on the
826
+Library side by side in a single library together with other library
827
+facilities that are not Applications and are not covered by this
828
+License, and convey such a combined library under terms of your
829
+choice, if you do both of the following:
830
+
831
+   a) Accompany the combined library with a copy of the same work based
832
+   on the Library, uncombined with any other library facilities,
833
+   conveyed under the terms of this License.
834
+
835
+   b) Give prominent notice with the combined library that part of it
836
+   is a work based on the Library, and explaining where to find the
837
+   accompanying uncombined form of the same work.
838
+
839
+  6. Revised Versions of the GNU Lesser General Public License.
840
+
841
+  The Free Software Foundation may publish revised and/or new versions
842
+of the GNU Lesser General Public License from time to time. Such new
843
+versions will be similar in spirit to the present version, but may
844
+differ in detail to address new problems or concerns.
845
+
846
+  Each version is given a distinguishing version number. If the
847
+Library as you received it specifies that a certain numbered version
848
+of the GNU Lesser General Public License "or any later version"
849
+applies to it, you have the option of following the terms and
850
+conditions either of that published version or of any later version
851
+published by the Free Software Foundation. If the Library as you
852
+received it does not specify a version number of the GNU Lesser
853
+General Public License, you may choose any version of the GNU Lesser
854
+General Public License ever published by the Free Software Foundation.
855
+
856
+  If the Library as you received it specifies that a proxy can decide
857
+whether future versions of the GNU Lesser General Public License shall
858
+apply, that proxy's public statement of acceptance of any version is
859
+permanent authorization for you to choose that version for the
860
+Library.
861
+
... ...
@@ -0,0 +1,122 @@
1
+declare module lib_object {
2
+    /**
3
+     * @author fenris
4
+     */
5
+    function fetch<type_value>(object: Object, fieldname: string, fallback?: type_value, escalation?: int): type_value;
6
+    /**
7
+     * @author fenris
8
+     */
9
+    function map<type_from, type_to>(object_from: {
10
+        [key: string]: type_from;
11
+    }, transformator: (value_from: type_from, key?: string) => type_to): {
12
+        [key: string]: type_to;
13
+    };
14
+    /**
15
+     * @desc gibt ein Objekt mit bestimmten Einträgen des Eingabe-Objekts zurück
16
+     * @author fenris
17
+     */
18
+    function filter<type_value>(object_from: {
19
+        [key: string]: type_value;
20
+    }, predicate: (value_from: type_value, key?: string) => boolean): {
21
+        [key: string]: type_value;
22
+    };
23
+    /**
24
+     * @desc wandelt ein Array mit Einträgen der Form {key,value} in ein entsprechendes Objekt um
25
+     * @author fenris
26
+     */
27
+    function from_array<type_value>(array: Array<{
28
+        key: string;
29
+        value: type_value;
30
+    }>): {
31
+        [key: string]: type_value;
32
+    };
33
+    /**
34
+     * @desc wandelt ein Objekt in ein entsprechendes Array mit Einträgen der Form {key,value} um
35
+     * @author fenris
36
+     */
37
+    function to_array<type_value>(object: {
38
+        [key: string]: type_value;
39
+    }): Array<{
40
+        key: string;
41
+        value: type_value;
42
+    }>;
43
+    /**
44
+     * @desc gibt eine Liste von Schlüsseln eines Objekts zurück
45
+     * @author fenris
46
+     */
47
+    function keys(object: {
48
+        [key: string]: any;
49
+    }): Array<string>;
50
+    /**
51
+     * @desc gibt eine Liste von Werten eines Objekts zurück
52
+     * @author fenris
53
+     */
54
+    function values<type_value>(object: {
55
+        [key: string]: type_value;
56
+    }): Array<type_value>;
57
+    /**
58
+     * @desc liest ein Baum-artiges Objekt an einer bestimmten Stelle aus
59
+     * @author fenris
60
+     */
61
+    function path_read<type_value>(object: Object, path: string, fallback?: type_value, escalation?: int): type_value;
62
+    /**
63
+     * @desc schreibt einen Wert an eine bestimmte Stelle in einem Baum-artigen Objekt
64
+     * @author fenris
65
+     */
66
+    function path_write<type_value>(object: Object, path: string, value: type_value, construct?: boolean): void;
67
+    /**
68
+     * @desc prüft ob ein Objekt einem bestimmten Muster entspricht
69
+     * @param {Object} object das zu prüfende Objekt
70
+     * @param {Object} pattern das einzuhaltende Muster
71
+     * @param {Function} connlate eine Funktion zum Feststellen der Gleichheit von Einzelwerten
72
+     * @author fenris
73
+     */
74
+    function matches(object: Object, pattern: Object, collate?: typeof instance_collate): boolean;
75
+    /**
76
+     * @desc erzeugt eine Projektion eines Baum-artigen Objekts in ein Listen-artiges Objekt
77
+     * @param {string} [separator] welches Zeichen als Trenner zwischen zwei Pfad-Schritten verwendet werden soll
78
+     * @author fenris
79
+     */
80
+    function flatten(value: any, separator?: string, key_for_element?: (index: int) => string): Object;
81
+    /**
82
+     * @author fenris
83
+     */
84
+    function clash(x: {
85
+        [key: string]: any;
86
+    }, y: {
87
+        [key: string]: any;
88
+    }, { "overwrite": overwrite, "hooks": { "existing": hook_existing, }, }?: {
89
+        overwrite?: boolean;
90
+        hooks?: {
91
+            existing?: (key?: string, value_old?: any, value_new?: any) => void;
92
+        };
93
+    }): {
94
+        [key: string]: any;
95
+    };
96
+    /**
97
+     * @author fenris
98
+     */
99
+    function patch(core: Object, mantle: Object, deep?: boolean, path?: string): void;
100
+    /**
101
+     * @author fenris
102
+     */
103
+    function patched(core: Object, mantle: Object, deep?: boolean): Object;
104
+    /**
105
+     * @author fenris
106
+     */
107
+    function attached(object: Object, key: string, value: any): Object;
108
+    /**
109
+     * @author fenris
110
+     */
111
+    function copy(object: Object): Object;
112
+}
113
+/**
114
+ * @desc adapters for old syntax
115
+ * @author fenris
116
+ */
117
+declare var object_fetch: typeof lib_object.fetch;
118
+declare var object_map: typeof lib_object.map;
119
+declare var object_a2o: typeof lib_object.from_array;
120
+declare var object_o2a: typeof lib_object.to_array;
121
+declare var object_matches: typeof lib_object.matches;
122
+declare var object_clash: typeof lib_object.clash;
... ...
@@ -0,0 +1,376 @@
1
+/*
2
+This file is part of »bacterio-plankton:object«.
3
+
4
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5
+<info@greenscale.de>
6
+
7
+»bacterio-plankton:object« is free software: you can redistribute it and/or modify
8
+it under the terms of the GNU Lesser General Public License as published by
9
+the Free Software Foundation, either version 3 of the License, or
10
+(at your option) any later version.
11
+
12
+»bacterio-plankton:object« is distributed in the hope that it will be useful,
13
+but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+GNU Lesser General Public License for more details.
16
+
17
+You should have received a copy of the GNU Lesser General Public License
18
+along with »bacterio-plankton:object«. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+var lib_object;
21
+(function (lib_object) {
22
+    /**
23
+     * @author fenris
24
+     */
25
+    function fetch(object, fieldname, fallback, escalation) {
26
+        if (fallback === void 0) { fallback = null; }
27
+        if (escalation === void 0) { escalation = 1; }
28
+        if ((fieldname in object) && (object[fieldname] !== undefined)) {
29
+            return object[fieldname];
30
+        }
31
+        else {
32
+            switch (escalation) {
33
+                case 0: {
34
+                    return fallback;
35
+                    break;
36
+                }
37
+                case 1: {
38
+                    var message = ("field '" + fieldname + "' not in structure");
39
+                    message += ("; using fallback value '" + String(fallback) + "'");
40
+                    // console.warn(message);
41
+                    return fallback;
42
+                    break;
43
+                }
44
+                case 2: {
45
+                    var message = ("field '" + fieldname + "' not in structure");
46
+                    throw (new Error(message));
47
+                    break;
48
+                }
49
+                default: {
50
+                    throw (new Error("invalid escalation level " + escalation));
51
+                    break;
52
+                }
53
+            }
54
+        }
55
+    }
56
+    lib_object.fetch = fetch;
57
+    /**
58
+     * @author fenris
59
+     */
60
+    function map(object_from, transformator) {
61
+        var object_to = {};
62
+        Object.keys(object_from).forEach(function (key) { return (object_to[key] = transformator(object_from[key], key)); });
63
+        return object_to;
64
+    }
65
+    lib_object.map = map;
66
+    /**
67
+     * @desc gibt ein Objekt mit bestimmten Einträgen des Eingabe-Objekts zurück
68
+     * @author fenris
69
+     */
70
+    function filter(object_from, predicate) {
71
+        var object_to = {};
72
+        Object.keys(object_from).forEach(function (key) {
73
+            var value = object_from[key];
74
+            if (predicate(value, key)) {
75
+                object_to[key] = value;
76
+            }
77
+        });
78
+        return object_to;
79
+    }
80
+    lib_object.filter = filter;
81
+    /**
82
+     * @desc wandelt ein Array mit Einträgen der Form {key,value} in ein entsprechendes Objekt um
83
+     * @author fenris
84
+     */
85
+    function from_array(array) {
86
+        var object = {};
87
+        array.forEach(function (entry) { return (object[entry.key] = entry.value); });
88
+        return object;
89
+    }
90
+    lib_object.from_array = from_array;
91
+    /**
92
+     * @desc wandelt ein Objekt in ein entsprechendes Array mit Einträgen der Form {key,value} um
93
+     * @author fenris
94
+     */
95
+    function to_array(object) {
96
+        var array = [];
97
+        Object.keys(object).forEach(function (key) { return array.push({ "key": key, "value": object[key] }); });
98
+        return array;
99
+    }
100
+    lib_object.to_array = to_array;
101
+    /**
102
+     * @desc gibt eine Liste von Schlüsseln eines Objekts zurück
103
+     * @author fenris
104
+     */
105
+    function keys(object) {
106
+        return Object.keys(object);
107
+    }
108
+    lib_object.keys = keys;
109
+    /**
110
+     * @desc gibt eine Liste von Werten eines Objekts zurück
111
+     * @author fenris
112
+     */
113
+    function values(object) {
114
+        return to_array(object).map(function (entry) { return entry.value; });
115
+    }
116
+    lib_object.values = values;
117
+    /**
118
+     * @desc liest ein Baum-artiges Objekt an einer bestimmten Stelle aus
119
+     * @author fenris
120
+     */
121
+    function path_read(object, path, fallback, escalation) {
122
+        if (fallback === void 0) { fallback = null; }
123
+        if (escalation === void 0) { escalation = 1; }
124
+        var steps = ((path.length == 0) ? [] : path.split("."));
125
+        if (steps.length == 0) {
126
+            throw (new Error("empty path"));
127
+        }
128
+        else {
129
+            var position_1 = object;
130
+            var reachable = (position_1 != null) && steps.slice(0, steps.length - 1).every(function (step) {
131
+                position_1 = object_fetch(position_1, step, null, 0);
132
+                return (position_1 != null);
133
+            });
134
+            if (reachable) {
135
+                return object_fetch(position_1, steps[steps.length - 1], fallback, escalation);
136
+            }
137
+            else {
138
+                return object_fetch({}, "_dummy_", fallback, escalation);
139
+            }
140
+        }
141
+    }
142
+    lib_object.path_read = path_read;
143
+    /**
144
+     * @desc schreibt einen Wert an eine bestimmte Stelle in einem Baum-artigen Objekt
145
+     * @author fenris
146
+     */
147
+    function path_write(object, path, value, construct) {
148
+        if (construct === void 0) { construct = true; }
149
+        var steps = ((path.length == 0) ? [] : path.split("."));
150
+        if (steps.length == 0) {
151
+            throw (new Error("empty path"));
152
+        }
153
+        else {
154
+            var position_2 = object;
155
+            var reachable = steps.slice(0, steps.length - 1).every(function (step) {
156
+                var position_ = object_fetch(position_2, step, null, 0);
157
+                if (position_ == null) {
158
+                    if (construct) {
159
+                        position_2[step] = {};
160
+                        position_2 = position_2[step];
161
+                        return true;
162
+                    }
163
+                    else {
164
+                        return false;
165
+                    }
166
+                }
167
+                else {
168
+                    position_2 = position_;
169
+                    return true;
170
+                }
171
+            });
172
+            if (reachable) {
173
+                position_2[steps[steps.length - 1]] = value;
174
+            }
175
+            else {
176
+                var message = ("path '" + path + "' does not exist and may not be constructed");
177
+                throw (new Error(message));
178
+            }
179
+        }
180
+    }
181
+    lib_object.path_write = path_write;
182
+    /**
183
+     * @desc prüft ob ein Objekt einem bestimmten Muster entspricht
184
+     * @param {Object} object das zu prüfende Objekt
185
+     * @param {Object} pattern das einzuhaltende Muster
186
+     * @param {Function} connlate eine Funktion zum Feststellen der Gleichheit von Einzelwerten
187
+     * @author fenris
188
+     */
189
+    function matches(object, pattern, collate) {
190
+        if (collate === void 0) { collate = instance_collate; }
191
+        return Object.keys(pattern).every(function (key) { return collate(pattern[key], object[key]); });
192
+    }
193
+    lib_object.matches = matches;
194
+    /**
195
+     * @desc erzeugt eine Projektion eines Baum-artigen Objekts in ein Listen-artiges Objekt
196
+     * @param {string} [separator] welches Zeichen als Trenner zwischen zwei Pfad-Schritten verwendet werden soll
197
+     * @author fenris
198
+     */
199
+    function flatten(value, separator, key_for_element) {
200
+        if (separator === void 0) { separator = "."; }
201
+        if (key_for_element === void 0) { key_for_element = (function (index) { return ("element_" + index.toFixed(0)); }); }
202
+        var integrate = function (result, key_, value_) {
203
+            if (value_ == null) {
204
+                result[key_] = value_;
205
+            }
206
+            else {
207
+                // primitive Werte direkt übernehmen
208
+                if (typeof (value_) != "object") {
209
+                    result[key_] = value_;
210
+                }
211
+                // sonst durch rekursiven Aufruf die flache Variante des Wertes ermitteln und einarbeiten
212
+                else {
213
+                    var result_1 = flatten(value_);
214
+                    Object.keys(result_1)
215
+                        .forEach(function (key__) {
216
+                        var value__ = result_1[key__];
217
+                        var key_new = (key_ + separator + key__);
218
+                        result[key_new] = value__;
219
+                    });
220
+                }
221
+            }
222
+        };
223
+        if ((value === null) || (value === undefined)) {
224
+            return null;
225
+        }
226
+        else {
227
+            var result_2 = {};
228
+            if (typeof (value) != "object") {
229
+                result_2["value"] = value;
230
+            }
231
+            else {
232
+                if (value instanceof Array) {
233
+                    var array = (value);
234
+                    array
235
+                        .forEach(function (element, index) {
236
+                        integrate(result_2, key_for_element(index), element);
237
+                    });
238
+                }
239
+                else {
240
+                    var object_1 = (value);
241
+                    Object.keys(object_1)
242
+                        .forEach(function (key) {
243
+                        integrate(result_2, key, object_1[key]);
244
+                    });
245
+                }
246
+            }
247
+            return result_2;
248
+        }
249
+    }
250
+    lib_object.flatten = flatten;
251
+    /**
252
+     * @author fenris
253
+     */
254
+    function clash(x, y, _a) {
255
+        var _b = _a === void 0 ? {} : _a, _c = _b["overwrite"], overwrite = _c === void 0 ? true : _c, _d = _b["hooks"], _e = (_d === void 0 ? {} : _d)["existing"], hook_existing = _e === void 0 ? null : _e;
256
+        if (hook_existing == null) {
257
+            (function (key, value_old, value_new) { return console.warn("field " + key + " already defined"); });
258
+        }
259
+        var z = {};
260
+        Object.keys(x).forEach(function (key) {
261
+            z[key] = x[key];
262
+        });
263
+        Object.keys(y).forEach(function (key) {
264
+            if (key in z) {
265
+                if (hook_existing != null) {
266
+                    hook_existing(key, z[key], y[key]);
267
+                }
268
+                if (overwrite) {
269
+                    z[key] = y[key];
270
+                }
271
+            }
272
+            else {
273
+                z[key] = y[key];
274
+            }
275
+        });
276
+        return z;
277
+    }
278
+    lib_object.clash = clash;
279
+    /**
280
+     * @author fenris
281
+     */
282
+    function patch(core, mantle, deep, path) {
283
+        if (deep === void 0) { deep = true; }
284
+        if (path === void 0) { path = null; }
285
+        if (mantle == null) {
286
+            console.warn("mantle is null; core was", core);
287
+        }
288
+        else {
289
+            Object.keys(mantle).forEach(function (key) {
290
+                var path_ = ((path == null) ? key : path + "." + key);
291
+                var value_mantle = mantle[key];
292
+                if (!(key in core)) {
293
+                    if ((typeof (value_mantle) == "object") && (value_mantle != null) && deep) {
294
+                        if (value_mantle instanceof Array) {
295
+                            core[key] = [];
296
+                            value_mantle.forEach(function (element) {
297
+                                if ((typeof (element) == "object") && (element != null)) {
298
+                                    var element_ = {};
299
+                                    patch(element_, element);
300
+                                    core[key].push(element_);
301
+                                }
302
+                                else {
303
+                                    core[key].push(element);
304
+                                }
305
+                            });
306
+                        }
307
+                        else {
308
+                            core[key] = {};
309
+                            patch(core[key], value_mantle, deep, path_);
310
+                        }
311
+                    }
312
+                    else {
313
+                        core[key] = value_mantle;
314
+                    }
315
+                }
316
+                else {
317
+                    var value_core = core[key];
318
+                    if (typeof (value_core) == typeof (value_mantle)) {
319
+                        if ((typeof (value_mantle) == "object") && (value_mantle != null) && deep) {
320
+                            patch(core[key], value_mantle, deep, path_);
321
+                        }
322
+                        else {
323
+                            core[key] = value_mantle;
324
+                        }
325
+                    }
326
+                    else {
327
+                        if ((value_core != null) && (value_mantle != null)) {
328
+                            var message = "objects have different shapes at path '" + path_ + "'; core has type '" + typeof (value_core) + "' and mantle has type '" + typeof (value_mantle) + "'";
329
+                            console.warn(message);
330
+                        }
331
+                        core[key] = value_mantle;
332
+                        // throw (new Error(message));
333
+                    }
334
+                }
335
+            });
336
+        }
337
+    }
338
+    lib_object.patch = patch;
339
+    /**
340
+     * @author fenris
341
+     */
342
+    function patched(core, mantle, deep) {
343
+        if (deep === void 0) { deep = undefined; }
344
+        var result = {};
345
+        patch(result, core, deep);
346
+        patch(result, mantle, deep);
347
+        return result;
348
+    }
349
+    lib_object.patched = patched;
350
+    /**
351
+     * @author fenris
352
+     */
353
+    function attached(object, key, value) {
354
+        var mantle = {};
355
+        mantle[key] = value;
356
+        return patched(object, mantle, false);
357
+    }
358
+    lib_object.attached = attached;
359
+    /**
360
+     * @author fenris
361
+     */
362
+    function copy(object) {
363
+        return patched({}, object);
364
+    }
365
+    lib_object.copy = copy;
366
+})(lib_object || (lib_object = {}));
367
+/**
368
+ * @desc adapters for old syntax
369
+ * @author fenris
370
+ */
371
+var object_fetch = lib_object.fetch;
372
+var object_map = lib_object.map;
373
+var object_a2o = lib_object.from_array;
374
+var object_o2a = lib_object.to_array;
375
+var object_matches = lib_object.matches;
376
+var object_clash = lib_object.clash;
... ...
@@ -0,0 +1,22 @@
1
+{
2
+	"logic-decl": [
3
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./base/logic-decl.d.ts",
4
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./object/logic-decl.d.ts",
5
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./shape/logic-decl.d.ts",
6
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./trait/logic-decl.d.ts",
7
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./code/logic-decl.d.ts",
8
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./string/logic-decl.d.ts",
9
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./call/logic-decl.d.ts",
10
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./comm-client/logic-decl.d.ts"
11
+	],
12
+	"logic-impl": [
13
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./base/logic-impl.js",
14
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./object/logic-impl.js",
15
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./shape/logic-impl.js",
16
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./trait/logic-impl.js",
17
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./code/logic-impl.js",
18
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./string/logic-impl.js",
19
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./call/logic-impl.js",
20
+		"/home/fenris/projekte/folksprak/words/client/lib/plankton/./comm-client/logic-impl.js"
21
+	]
22
+}
... ...
@@ -0,0 +1,861 @@
1
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2
+<info@greenscale.de>
3
+
4
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
5
+it under the terms of the GNU Lesser General Public License as published by
6
+the Free Software Foundation, either version 3 of the License, or
7
+(at your option) any later version.
8
+
9
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
10
+but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+GNU Lesser General Public License for more details.
13
+
14
+You should have received a copy of the GNU Lesser General Public License
15
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+
18
+
19
+                    GNU GENERAL PUBLIC LICENSE
20
+                       Version 3, 29 June 2007
21
+
22
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
23
+ Everyone is permitted to copy and distribute verbatim copies
24
+ of this license document, but changing it is not allowed.
25
+
26
+                            Preamble
27
+
28
+  The GNU General Public License is a free, copyleft license for
29
+software and other kinds of works.
30
+
31
+  The licenses for most software and other practical works are designed
32
+to take away your freedom to share and change the works.  By contrast,
33
+the GNU General Public License is intended to guarantee your freedom to
34
+share and change all versions of a program--to make sure it remains free
35
+software for all its users.  We, the Free Software Foundation, use the
36
+GNU General Public License for most of our software; it applies also to
37
+any other work released this way by its authors.  You can apply it to
38
+your programs, too.
39
+
40
+  When we speak of free software, we are referring to freedom, not
41
+price.  Our General Public Licenses are designed to make sure that you
42
+have the freedom to distribute copies of free software (and charge for
43
+them if you wish), that you receive source code or can get it if you
44
+want it, that you can change the software or use pieces of it in new
45
+free programs, and that you know you can do these things.
46
+
47
+  To protect your rights, we need to prevent others from denying you
48
+these rights or asking you to surrender the rights.  Therefore, you have
49
+certain responsibilities if you distribute copies of the software, or if
50
+you modify it: responsibilities to respect the freedom of others.
51
+
52
+  For example, if you distribute copies of such a program, whether
53
+gratis or for a fee, you must pass on to the recipients the same
54
+freedoms that you received.  You must make sure that they, too, receive
55
+or can get the source code.  And you must show them these terms so they
56
+know their rights.
57
+
58
+  Developers that use the GNU GPL protect your rights with two steps:
59
+(1) assert copyright on the software, and (2) offer you this License
60
+giving you legal permission to copy, distribute and/or modify it.
61
+
62
+  For the developers' and authors' protection, the GPL clearly explains
63
+that there is no warranty for this free software.  For both users' and
64
+authors' sake, the GPL requires that modified versions be marked as
65
+changed, so that their problems will not be attributed erroneously to
66
+authors of previous versions.
67
+
68
+  Some devices are designed to deny users access to install or run
69
+modified versions of the software inside them, although the manufacturer
70
+can do so.  This is fundamentally incompatible with the aim of
71
+protecting users' freedom to change the software.  The systematic
72
+pattern of such abuse occurs in the area of products for individuals to
73
+use, which is precisely where it is most unacceptable.  Therefore, we
74
+have designed this version of the GPL to prohibit the practice for those
75
+products.  If such problems arise substantially in other domains, we
76
+stand ready to extend this provision to those domains in future versions
77
+of the GPL, as needed to protect the freedom of users.
78
+
79
+  Finally, every program is threatened constantly by software patents.
80
+States should not allow patents to restrict development and use of
81
+software on general-purpose computers, but in those that do, we wish to
82
+avoid the special danger that patents applied to a free program could
83
+make it effectively proprietary.  To prevent this, the GPL assures that
84
+patents cannot be used to render the program non-free.
85
+
86
+  The precise terms and conditions for copying, distribution and
87
+modification follow.
88
+
89
+                       TERMS AND CONDITIONS
90
+
91
+  0. Definitions.
92
+
93
+  "This License" refers to version 3 of the GNU General Public License.
94
+
95
+  "Copyright" also means copyright-like laws that apply to other kinds of
96
+works, such as semiconductor masks.
97
+
98
+  "The Program" refers to any copyrightable work licensed under this
99
+License.  Each licensee is addressed as "you".  "Licensees" and
100
+"recipients" may be individuals or organizations.
101
+
102
+  To "modify" a work means to copy from or adapt all or part of the work
103
+in a fashion requiring copyright permission, other than the making of an
104
+exact copy.  The resulting work is called a "modified version" of the
105
+earlier work or a work "based on" the earlier work.
106
+
107
+  A "covered work" means either the unmodified Program or a work based
108
+on the Program.
109
+
110
+  To "propagate" a work means to do anything with it that, without
111
+permission, would make you directly or secondarily liable for
112
+infringement under applicable copyright law, except executing it on a
113
+computer or modifying a private copy.  Propagation includes copying,
114
+distribution (with or without modification), making available to the
115
+public, and in some countries other activities as well.
116
+
117
+  To "convey" a work means any kind of propagation that enables other
118
+parties to make or receive copies.  Mere interaction with a user through
119
+a computer network, with no transfer of a copy, is not conveying.
120
+
121
+  An interactive user interface displays "Appropriate Legal Notices"
122
+to the extent that it includes a convenient and prominently visible
123
+feature that (1) displays an appropriate copyright notice, and (2)
124
+tells the user that there is no warranty for the work (except to the
125
+extent that warranties are provided), that licensees may convey the
126
+work under this License, and how to view a copy of this License.  If
127
+the interface presents a list of user commands or options, such as a
128
+menu, a prominent item in the list meets this criterion.
129
+
130
+  1. Source Code.
131
+
132
+  The "source code" for a work means the preferred form of the work
133
+for making modifications to it.  "Object code" means any non-source
134
+form of a work.
135
+
136
+  A "Standard Interface" means an interface that either is an official
137
+standard defined by a recognized standards body, or, in the case of
138
+interfaces specified for a particular programming language, one that
139
+is widely used among developers working in that language.
140
+
141
+  The "System Libraries" of an executable work include anything, other
142
+than the work as a whole, that (a) is included in the normal form of
143
+packaging a Major Component, but which is not part of that Major
144
+Component, and (b) serves only to enable use of the work with that
145
+Major Component, or to implement a Standard Interface for which an
146
+implementation is available to the public in source code form.  A
147
+"Major Component", in this context, means a major essential component
148
+(kernel, window system, and so on) of the specific operating system
149
+(if any) on which the executable work runs, or a compiler used to
150
+produce the work, or an object code interpreter used to run it.
151
+
152
+  The "Corresponding Source" for a work in object code form means all
153
+the source code needed to generate, install, and (for an executable
154
+work) run the object code and to modify the work, including scripts to
155
+control those activities.  However, it does not include the work's
156
+System Libraries, or general-purpose tools or generally available free
157
+programs which are used unmodified in performing those activities but
158
+which are not part of the work.  For example, Corresponding Source
159
+includes interface definition files associated with source files for
160
+the work, and the source code for shared libraries and dynamically
161
+linked subprograms that the work is specifically designed to require,
162
+such as by intimate data communication or control flow between those
163
+subprograms and other parts of the work.
164
+
165
+  The Corresponding Source need not include anything that users
166
+can regenerate automatically from other parts of the Corresponding
167
+Source.
168
+
169
+  The Corresponding Source for a work in source code form is that
170
+same work.
171
+
172
+  2. Basic Permissions.
173
+
174
+  All rights granted under this License are granted for the term of
175
+copyright on the Program, and are irrevocable provided the stated
176
+conditions are met.  This License explicitly affirms your unlimited
177
+permission to run the unmodified Program.  The output from running a
178
+covered work is covered by this License only if the output, given its
179
+content, constitutes a covered work.  This License acknowledges your
180
+rights of fair use or other equivalent, as provided by copyright law.
181
+
182
+  You may make, run and propagate covered works that you do not
183
+convey, without conditions so long as your license otherwise remains
184
+in force.  You may convey covered works to others for the sole purpose
185
+of having them make modifications exclusively for you, or provide you
186
+with facilities for running those works, provided that you comply with
187
+the terms of this License in conveying all material for which you do
188
+not control copyright.  Those thus making or running the covered works
189
+for you must do so exclusively on your behalf, under your direction
190
+and control, on terms that prohibit them from making any copies of
191
+your copyrighted material outside their relationship with you.
192
+
193
+  Conveying under any other circumstances is permitted solely under
194
+the conditions stated below.  Sublicensing is not allowed; section 10
195
+makes it unnecessary.
196
+
197
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
198
+
199
+  No covered work shall be deemed part of an effective technological
200
+measure under any applicable law fulfilling obligations under article
201
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
202
+similar laws prohibiting or restricting circumvention of such
203
+measures.
204
+
205
+  When you convey a covered work, you waive any legal power to forbid
206
+circumvention of technological measures to the extent such circumvention
207
+is effected by exercising rights under this License with respect to
208
+the covered work, and you disclaim any intention to limit operation or
209
+modification of the work as a means of enforcing, against the work's
210
+users, your or third parties' legal rights to forbid circumvention of
211
+technological measures.
212
+
213
+  4. Conveying Verbatim Copies.
214
+
215
+  You may convey verbatim copies of the Program's source code as you
216
+receive it, in any medium, provided that you conspicuously and
217
+appropriately publish on each copy an appropriate copyright notice;
218
+keep intact all notices stating that this License and any
219
+non-permissive terms added in accord with section 7 apply to the code;
220
+keep intact all notices of the absence of any warranty; and give all
221
+recipients a copy of this License along with the Program.
222
+
223
+  You may charge any price or no price for each copy that you convey,
224
+and you may offer support or warranty protection for a fee.
225
+
226
+  5. Conveying Modified Source Versions.
227
+
228
+  You may convey a work based on the Program, or the modifications to
229
+produce it from the Program, in the form of source code under the
230
+terms of section 4, provided that you also meet all of these conditions:
231
+
232
+    a) The work must carry prominent notices stating that you modified
233
+    it, and giving a relevant date.
234
+
235
+    b) The work must carry prominent notices stating that it is
236
+    released under this License and any conditions added under section
237
+    7.  This requirement modifies the requirement in section 4 to
238
+    "keep intact all notices".
239
+
240
+    c) You must license the entire work, as a whole, under this
241
+    License to anyone who comes into possession of a copy.  This
242
+    License will therefore apply, along with any applicable section 7
243
+    additional terms, to the whole of the work, and all its parts,
244
+    regardless of how they are packaged.  This License gives no
245
+    permission to license the work in any other way, but it does not
246
+    invalidate such permission if you have separately received it.
247
+
248
+    d) If the work has interactive user interfaces, each must display
249
+    Appropriate Legal Notices; however, if the Program has interactive
250
+    interfaces that do not display Appropriate Legal Notices, your
251
+    work need not make them do so.
252
+
253
+  A compilation of a covered work with other separate and independent
254
+works, which are not by their nature extensions of the covered work,
255
+and which are not combined with it such as to form a larger program,
256
+in or on a volume of a storage or distribution medium, is called an
257
+"aggregate" if the compilation and its resulting copyright are not
258
+used to limit the access or legal rights of the compilation's users
259
+beyond what the individual works permit.  Inclusion of a covered work
260
+in an aggregate does not cause this License to apply to the other
261
+parts of the aggregate.
262
+
263
+  6. Conveying Non-Source Forms.
264
+
265
+  You may convey a covered work in object code form under the terms
266
+of sections 4 and 5, provided that you also convey the
267
+machine-readable Corresponding Source under the terms of this License,
268
+in one of these ways:
269
+
270
+    a) Convey the object code in, or embodied in, a physical product
271
+    (including a physical distribution medium), accompanied by the
272
+    Corresponding Source fixed on a durable physical medium
273
+    customarily used for software interchange.
274
+
275
+    b) Convey the object code in, or embodied in, a physical product
276
+    (including a physical distribution medium), accompanied by a
277
+    written offer, valid for at least three years and valid for as
278
+    long as you offer spare parts or customer support for that product
279
+    model, to give anyone who possesses the object code either (1) a
280
+    copy of the Corresponding Source for all the software in the
281
+    product that is covered by this License, on a durable physical
282
+    medium customarily used for software interchange, for a price no
283
+    more than your reasonable cost of physically performing this
284
+    conveying of source, or (2) access to copy the
285
+    Corresponding Source from a network server at no charge.
286
+
287
+    c) Convey individual copies of the object code with a copy of the
288
+    written offer to provide the Corresponding Source.  This
289
+    alternative is allowed only occasionally and noncommercially, and
290
+    only if you received the object code with such an offer, in accord
291
+    with subsection 6b.
292
+
293
+    d) Convey the object code by offering access from a designated
294
+    place (gratis or for a charge), and offer equivalent access to the
295
+    Corresponding Source in the same way through the same place at no
296
+    further charge.  You need not require recipients to copy the
297
+    Corresponding Source along with the object code.  If the place to
298
+    copy the object code is a network server, the Corresponding Source
299
+    may be on a different server (operated by you or a third party)
300
+    that supports equivalent copying facilities, provided you maintain
301
+    clear directions next to the object code saying where to find the
302
+    Corresponding Source.  Regardless of what server hosts the
303
+    Corresponding Source, you remain obligated to ensure that it is
304
+    available for as long as needed to satisfy these requirements.
305
+
306
+    e) Convey the object code using peer-to-peer transmission, provided
307
+    you inform other peers where the object code and Corresponding
308
+    Source of the work are being offered to the general public at no
309
+    charge under subsection 6d.
310
+
311
+  A separable portion of the object code, whose source code is excluded
312
+from the Corresponding Source as a System Library, need not be
313
+included in conveying the object code work.
314
+
315
+  A "User Product" is either (1) a "consumer product", which means any
316
+tangible personal property which is normally used for personal, family,
317
+or household purposes, or (2) anything designed or sold for incorporation
318
+into a dwelling.  In determining whether a product is a consumer product,
319
+doubtful cases shall be resolved in favor of coverage.  For a particular
320
+product received by a particular user, "normally used" refers to a
321
+typical or common use of that class of product, regardless of the status
322
+of the particular user or of the way in which the particular user
323
+actually uses, or expects or is expected to use, the product.  A product
324
+is a consumer product regardless of whether the product has substantial
325
+commercial, industrial or non-consumer uses, unless such uses represent
326
+the only significant mode of use of the product.
327
+
328
+  "Installation Information" for a User Product means any methods,
329
+procedures, authorization keys, or other information required to install
330
+and execute modified versions of a covered work in that User Product from
331
+a modified version of its Corresponding Source.  The information must
332
+suffice to ensure that the continued functioning of the modified object
333
+code is in no case prevented or interfered with solely because
334
+modification has been made.
335
+
336
+  If you convey an object code work under this section in, or with, or
337
+specifically for use in, a User Product, and the conveying occurs as
338
+part of a transaction in which the right of possession and use of the
339
+User Product is transferred to the recipient in perpetuity or for a
340
+fixed term (regardless of how the transaction is characterized), the
341
+Corresponding Source conveyed under this section must be accompanied
342
+by the Installation Information.  But this requirement does not apply
343
+if neither you nor any third party retains the ability to install
344
+modified object code on the User Product (for example, the work has
345
+been installed in ROM).
346
+
347
+  The requirement to provide Installation Information does not include a
348
+requirement to continue to provide support service, warranty, or updates
349
+for a work that has been modified or installed by the recipient, or for
350
+the User Product in which it has been modified or installed.  Access to a
351
+network may be denied when the modification itself materially and
352
+adversely affects the operation of the network or violates the rules and
353
+protocols for communication across the network.
354
+
355
+  Corresponding Source conveyed, and Installation Information provided,
356
+in accord with this section must be in a format that is publicly
357
+documented (and with an implementation available to the public in
358
+source code form), and must require no special password or key for
359
+unpacking, reading or copying.
360
+
361
+  7. Additional Terms.
362
+
363
+  "Additional permissions" are terms that supplement the terms of this
364
+License by making exceptions from one or more of its conditions.
365
+Additional permissions that are applicable to the entire Program shall
366
+be treated as though they were included in this License, to the extent
367
+that they are valid under applicable law.  If additional permissions
368
+apply only to part of the Program, that part may be used separately
369
+under those permissions, but the entire Program remains governed by
370
+this License without regard to the additional permissions.
371
+
372
+  When you convey a copy of a covered work, you may at your option
373
+remove any additional permissions from that copy, or from any part of
374
+it.  (Additional permissions may be written to require their own
375
+removal in certain cases when you modify the work.)  You may place
376
+additional permissions on material, added by you to a covered work,
377
+for which you have or can give appropriate copyright permission.
378
+
379
+  Notwithstanding any other provision of this License, for material you
380
+add to a covered work, you may (if authorized by the copyright holders of
381
+that material) supplement the terms of this License with terms:
382
+
383
+    a) Disclaiming warranty or limiting liability differently from the
384
+    terms of sections 15 and 16 of this License; or
385
+
386
+    b) Requiring preservation of specified reasonable legal notices or
387
+    author attributions in that material or in the Appropriate Legal
388
+    Notices displayed by works containing it; or
389
+
390
+    c) Prohibiting misrepresentation of the origin of that material, or
391
+    requiring that modified versions of such material be marked in
392
+    reasonable ways as different from the original version; or
393
+
394
+    d) Limiting the use for publicity purposes of names of licensors or
395
+    authors of the material; or
396
+
397
+    e) Declining to grant rights under trademark law for use of some
398
+    trade names, trademarks, or service marks; or
399
+
400
+    f) Requiring indemnification of licensors and authors of that
401
+    material by anyone who conveys the material (or modified versions of
402
+    it) with contractual assumptions of liability to the recipient, for
403
+    any liability that these contractual assumptions directly impose on
404
+    those licensors and authors.
405
+
406
+  All other non-permissive additional terms are considered "further
407
+restrictions" within the meaning of section 10.  If the Program as you
408
+received it, or any part of it, contains a notice stating that it is
409
+governed by this License along with a term that is a further
410
+restriction, you may remove that term.  If a license document contains
411
+a further restriction but permits relicensing or conveying under this
412
+License, you may add to a covered work material governed by the terms
413
+of that license document, provided that the further restriction does
414
+not survive such relicensing or conveying.
415
+
416
+  If you add terms to a covered work in accord with this section, you
417
+must place, in the relevant source files, a statement of the
418
+additional terms that apply to those files, or a notice indicating
419
+where to find the applicable terms.
420
+
421
+  Additional terms, permissive or non-permissive, may be stated in the
422
+form of a separately written license, or stated as exceptions;
423
+the above requirements apply either way.
424
+
425
+  8. Termination.
426
+
427
+  You may not propagate or modify a covered work except as expressly
428
+provided under this License.  Any attempt otherwise to propagate or
429
+modify it is void, and will automatically terminate your rights under
430
+this License (including any patent licenses granted under the third
431
+paragraph of section 11).
432
+
433
+  However, if you cease all violation of this License, then your
434
+license from a particular copyright holder is reinstated (a)
435
+provisionally, unless and until the copyright holder explicitly and
436
+finally terminates your license, and (b) permanently, if the copyright
437
+holder fails to notify you of the violation by some reasonable means
438
+prior to 60 days after the cessation.
439
+
440
+  Moreover, your license from a particular copyright holder is
441
+reinstated permanently if the copyright holder notifies you of the
442
+violation by some reasonable means, this is the first time you have
443
+received notice of violation of this License (for any work) from that
444
+copyright holder, and you cure the violation prior to 30 days after
445
+your receipt of the notice.
446
+
447
+  Termination of your rights under this section does not terminate the
448
+licenses of parties who have received copies or rights from you under
449
+this License.  If your rights have been terminated and not permanently
450
+reinstated, you do not qualify to receive new licenses for the same
451
+material under section 10.
452
+
453
+  9. Acceptance Not Required for Having Copies.
454
+
455
+  You are not required to accept this License in order to receive or
456
+run a copy of the Program.  Ancillary propagation of a covered work
457
+occurring solely as a consequence of using peer-to-peer transmission
458
+to receive a copy likewise does not require acceptance.  However,
459
+nothing other than this License grants you permission to propagate or
460
+modify any covered work.  These actions infringe copyright if you do
461
+not accept this License.  Therefore, by modifying or propagating a
462
+covered work, you indicate your acceptance of this License to do so.
463
+
464
+  10. Automatic Licensing of Downstream Recipients.
465
+
466
+  Each time you convey a covered work, the recipient automatically
467
+receives a license from the original licensors, to run, modify and
468
+propagate that work, subject to this License.  You are not responsible
469
+for enforcing compliance by third parties with this License.
470
+
471
+  An "entity transaction" is a transaction transferring control of an
472
+organization, or substantially all assets of one, or subdividing an
473
+organization, or merging organizations.  If propagation of a covered
474
+work results from an entity transaction, each party to that
475
+transaction who receives a copy of the work also receives whatever
476
+licenses to the work the party's predecessor in interest had or could
477
+give under the previous paragraph, plus a right to possession of the
478
+Corresponding Source of the work from the predecessor in interest, if
479
+the predecessor has it or can get it with reasonable efforts.
480
+
481
+  You may not impose any further restrictions on the exercise of the
482
+rights granted or affirmed under this License.  For example, you may
483
+not impose a license fee, royalty, or other charge for exercise of
484
+rights granted under this License, and you may not initiate litigation
485
+(including a cross-claim or counterclaim in a lawsuit) alleging that
486
+any patent claim is infringed by making, using, selling, offering for
487
+sale, or importing the Program or any portion of it.
488
+
489
+  11. Patents.
490
+
491
+  A "contributor" is a copyright holder who authorizes use under this
492
+License of the Program or a work on which the Program is based.  The
493
+work thus licensed is called the contributor's "contributor version".
494
+
495
+  A contributor's "essential patent claims" are all patent claims
496
+owned or controlled by the contributor, whether already acquired or
497
+hereafter acquired, that would be infringed by some manner, permitted
498
+by this License, of making, using, or selling its contributor version,
499
+but do not include claims that would be infringed only as a
500
+consequence of further modification of the contributor version.  For
501
+purposes of this definition, "control" includes the right to grant
502
+patent sublicenses in a manner consistent with the requirements of
503
+this License.
504
+
505
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
506
+patent license under the contributor's essential patent claims, to
507
+make, use, sell, offer for sale, import and otherwise run, modify and
508
+propagate the contents of its contributor version.
509
+
510
+  In the following three paragraphs, a "patent license" is any express
511
+agreement or commitment, however denominated, not to enforce a patent
512
+(such as an express permission to practice a patent or covenant not to
513
+sue for patent infringement).  To "grant" such a patent license to a
514
+party means to make such an agreement or commitment not to enforce a
515
+patent against the party.
516
+
517
+  If you convey a covered work, knowingly relying on a patent license,
518
+and the Corresponding Source of the work is not available for anyone
519
+to copy, free of charge and under the terms of this License, through a
520
+publicly available network server or other readily accessible means,
521
+then you must either (1) cause the Corresponding Source to be so
522
+available, or (2) arrange to deprive yourself of the benefit of the
523
+patent license for this particular work, or (3) arrange, in a manner
524
+consistent with the requirements of this License, to extend the patent
525
+license to downstream recipients.  "Knowingly relying" means you have
526
+actual knowledge that, but for the patent license, your conveying the
527
+covered work in a country, or your recipient's use of the covered work
528
+in a country, would infringe one or more identifiable patents in that
529
+country that you have reason to believe are valid.
530
+
531
+  If, pursuant to or in connection with a single transaction or
532
+arrangement, you convey, or propagate by procuring conveyance of, a
533
+covered work, and grant a patent license to some of the parties
534
+receiving the covered work authorizing them to use, propagate, modify
535
+or convey a specific copy of the covered work, then the patent license
536
+you grant is automatically extended to all recipients of the covered
537
+work and works based on it.
538
+
539
+  A patent license is "discriminatory" if it does not include within
540
+the scope of its coverage, prohibits the exercise of, or is
541
+conditioned on the non-exercise of one or more of the rights that are
542
+specifically granted under this License.  You may not convey a covered
543
+work if you are a party to an arrangement with a third party that is
544
+in the business of distributing software, under which you make payment
545
+to the third party based on the extent of your activity of conveying
546
+the work, and under which the third party grants, to any of the
547
+parties who would receive the covered work from you, a discriminatory
548
+patent license (a) in connection with copies of the covered work
549
+conveyed by you (or copies made from those copies), or (b) primarily
550
+for and in connection with specific products or compilations that
551
+contain the covered work, unless you entered into that arrangement,
552
+or that patent license was granted, prior to 28 March 2007.
553
+
554
+  Nothing in this License shall be construed as excluding or limiting
555
+any implied license or other defenses to infringement that may
556
+otherwise be available to you under applicable patent law.
557
+
558
+  12. No Surrender of Others' Freedom.
559
+
560
+  If conditions are imposed on you (whether by court order, agreement or
561
+otherwise) that contradict the conditions of this License, they do not
562
+excuse you from the conditions of this License.  If you cannot convey a
563
+covered work so as to satisfy simultaneously your obligations under this
564
+License and any other pertinent obligations, then as a consequence you may
565
+not convey it at all.  For example, if you agree to terms that obligate you
566
+to collect a royalty for further conveying from those to whom you convey
567
+the Program, the only way you could satisfy both those terms and this
568
+License would be to refrain entirely from conveying the Program.
569
+
570
+  13. Use with the GNU Affero General Public License.
571
+
572
+  Notwithstanding any other provision of this License, you have
573
+permission to link or combine any covered work with a work licensed
574
+under version 3 of the GNU Affero General Public License into a single
575
+combined work, and to convey the resulting work.  The terms of this
576
+License will continue to apply to the part which is the covered work,
577
+but the special requirements of the GNU Affero General Public License,
578
+section 13, concerning interaction through a network will apply to the
579
+combination as such.
580
+
581
+  14. Revised Versions of this License.
582
+
583
+  The Free Software Foundation may publish revised and/or new versions of
584
+the GNU General Public License from time to time.  Such new versions will
585
+be similar in spirit to the present version, but may differ in detail to
586
+address new problems or concerns.
587
+
588
+  Each version is given a distinguishing version number.  If the
589
+Program specifies that a certain numbered version of the GNU General
590
+Public License "or any later version" applies to it, you have the
591
+option of following the terms and conditions either of that numbered
592
+version or of any later version published by the Free Software
593
+Foundation.  If the Program does not specify a version number of the
594
+GNU General Public License, you may choose any version ever published
595
+by the Free Software Foundation.
596
+
597
+  If the Program specifies that a proxy can decide which future
598
+versions of the GNU General Public License can be used, that proxy's
599
+public statement of acceptance of a version permanently authorizes you
600
+to choose that version for the Program.
601
+
602
+  Later license versions may give you additional or different
603
+permissions.  However, no additional obligations are imposed on any
604
+author or copyright holder as a result of your choosing to follow a
605
+later version.
606
+
607
+  15. Disclaimer of Warranty.
608
+
609
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
610
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
611
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
612
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
613
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
614
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
615
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
616
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
617
+
618
+  16. Limitation of Liability.
619
+
620
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
621
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
622
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
623
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
624
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
625
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
626
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
627
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
628
+SUCH DAMAGES.
629
+
630
+  17. Interpretation of Sections 15 and 16.
631
+
632
+  If the disclaimer of warranty and limitation of liability provided
633
+above cannot be given local legal effect according to their terms,
634
+reviewing courts shall apply local law that most closely approximates
635
+an absolute waiver of all civil liability in connection with the
636
+Program, unless a warranty or assumption of liability accompanies a
637
+copy of the Program in return for a fee.
638
+
639
+                     END OF TERMS AND CONDITIONS
640
+
641
+            How to Apply These Terms to Your New Programs
642
+
643
+  If you develop a new program, and you want it to be of the greatest
644
+possible use to the public, the best way to achieve this is to make it
645
+free software which everyone can redistribute and change under these terms.
646
+
647
+  To do so, attach the following notices to the program.  It is safest
648
+to attach them to the start of each source file to most effectively
649
+state the exclusion of warranty; and each file should have at least
650
+the "copyright" line and a pointer to where the full notice is found.
651
+
652
+    <one line to give the program's name and a brief idea of what it does.>
653
+    Copyright (C) <year>  <name of author>
654
+
655
+    This program is free software: you can redistribute it and/or modify
656
+    it under the terms of the GNU General Public License as published by
657
+    the Free Software Foundation, either version 3 of the License, or
658
+    (at your option) any later version.
659
+
660
+    This program is distributed in the hope that it will be useful,
661
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
662
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
663
+    GNU General Public License for more details.
664
+
665
+    You should have received a copy of the GNU General Public License
666
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
667
+
668
+Also add information on how to contact you by electronic and paper mail.
669
+
670
+  If the program does terminal interaction, make it output a short
671
+notice like this when it starts in an interactive mode:
672
+
673
+    <program>  Copyright (C) <year>  <name of author>
674
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
675
+    This is free software, and you are welcome to redistribute it
676
+    under certain conditions; type `show c' for details.
677
+
678
+The hypothetical commands `show w' and `show c' should show the appropriate
679
+parts of the General Public License.  Of course, your program's commands
680
+might be different; for a GUI interface, you would use an "about box".
681
+
682
+  You should also get your employer (if you work as a programmer) or school,
683
+if any, to sign a "copyright disclaimer" for the program, if necessary.
684
+For more information on this, and how to apply and follow the GNU GPL, see
685
+<https://www.gnu.org/licenses/>.
686
+
687
+  The GNU General Public License does not permit incorporating your program
688
+into proprietary programs.  If your program is a subroutine library, you
689
+may consider it more useful to permit linking proprietary applications with
690
+the library.  If this is what you want to do, use the GNU Lesser General
691
+Public License instead of this License.  But first, please read
692
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
693
+
694
+
695
+
696
+                   GNU LESSER GENERAL PUBLIC LICENSE
697
+                       Version 3, 29 June 2007
698
+
699
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
700
+ Everyone is permitted to copy and distribute verbatim copies
701
+ of this license document, but changing it is not allowed.
702
+
703
+
704
+  This version of the GNU Lesser General Public License incorporates
705
+the terms and conditions of version 3 of the GNU General Public
706
+License, supplemented by the additional permissions listed below.
707
+
708
+  0. Additional Definitions.
709
+
710
+  As used herein, "this License" refers to version 3 of the GNU Lesser
711
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
712
+General Public License.
713
+
714
+  "The Library" refers to a covered work governed by this License,
715
+other than an Application or a Combined Work as defined below.
716
+
717
+  An "Application" is any work that makes use of an interface provided
718
+by the Library, but which is not otherwise based on the Library.
719
+Defining a subclass of a class defined by the Library is deemed a mode
720
+of using an interface provided by the Library.
721
+
722
+  A "Combined Work" is a work produced by combining or linking an
723
+Application with the Library.  The particular version of the Library
724
+with which the Combined Work was made is also called the "Linked
725
+Version".
726
+
727
+  The "Minimal Corresponding Source" for a Combined Work means the
728
+Corresponding Source for the Combined Work, excluding any source code
729
+for portions of the Combined Work that, considered in isolation, are
730
+based on the Application, and not on the Linked Version.
731
+
732
+  The "Corresponding Application Code" for a Combined Work means the
733
+object code and/or source code for the Application, including any data
734
+and utility programs needed for reproducing the Combined Work from the
735
+Application, but excluding the System Libraries of the Combined Work.
736
+
737
+  1. Exception to Section 3 of the GNU GPL.
738
+
739
+  You may convey a covered work under sections 3 and 4 of this License
740
+without being bound by section 3 of the GNU GPL.
741
+
742
+  2. Conveying Modified Versions.
743
+
744
+  If you modify a copy of the Library, and, in your modifications, a
745
+facility refers to a function or data to be supplied by an Application
746
+that uses the facility (other than as an argument passed when the
747
+facility is invoked), then you may convey a copy of the modified
748
+version:
749
+
750
+   a) under this License, provided that you make a good faith effort to
751
+   ensure that, in the event an Application does not supply the
752
+   function or data, the facility still operates, and performs
753
+   whatever part of its purpose remains meaningful, or
754
+
755
+   b) under the GNU GPL, with none of the additional permissions of
756
+   this License applicable to that copy.
757
+
758
+  3. Object Code Incorporating Material from Library Header Files.
759
+
760
+  The object code form of an Application may incorporate material from
761
+a header file that is part of the Library.  You may convey such object
762
+code under terms of your choice, provided that, if the incorporated
763
+material is not limited to numerical parameters, data structure
764
+layouts and accessors, or small macros, inline functions and templates
765
+(ten or fewer lines in length), you do both of the following:
766
+
767
+   a) Give prominent notice with each copy of the object code that the
768
+   Library is used in it and that the Library and its use are
769
+   covered by this License.
770
+
771
+   b) Accompany the object code with a copy of the GNU GPL and this license
772
+   document.
773
+
774
+  4. Combined Works.
775
+
776
+  You may convey a Combined Work under terms of your choice that,
777
+taken together, effectively do not restrict modification of the
778
+portions of the Library contained in the Combined Work and reverse
779
+engineering for debugging such modifications, if you also do each of
780
+the following:
781
+
782
+   a) Give prominent notice with each copy of the Combined Work that
783
+   the Library is used in it and that the Library and its use are
784
+   covered by this License.
785
+
786
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
787
+   document.
788
+
789
+   c) For a Combined Work that displays copyright notices during
790
+   execution, include the copyright notice for the Library among
791
+   these notices, as well as a reference directing the user to the
792
+   copies of the GNU GPL and this license document.
793
+
794
+   d) Do one of the following:
795
+
796
+       0) Convey the Minimal Corresponding Source under the terms of this
797
+       License, and the Corresponding Application Code in a form
798
+       suitable for, and under terms that permit, the user to
799
+       recombine or relink the Application with a modified version of
800
+       the Linked Version to produce a modified Combined Work, in the
801
+       manner specified by section 6 of the GNU GPL for conveying
802
+       Corresponding Source.
803
+
804
+       1) Use a suitable shared library mechanism for linking with the
805
+       Library.  A suitable mechanism is one that (a) uses at run time
806
+       a copy of the Library already present on the user's computer
807
+       system, and (b) will operate properly with a modified version
808
+       of the Library that is interface-compatible with the Linked
809
+       Version.
810
+
811
+   e) Provide Installation Information, but only if you would otherwise
812
+   be required to provide such information under section 6 of the
813
+   GNU GPL, and only to the extent that such information is
814
+   necessary to install and execute a modified version of the
815
+   Combined Work produced by recombining or relinking the
816
+   Application with a modified version of the Linked Version. (If
817
+   you use option 4d0, the Installation Information must accompany
818
+   the Minimal Corresponding Source and Corresponding Application
819
+   Code. If you use option 4d1, you must provide the Installation
820
+   Information in the manner specified by section 6 of the GNU GPL
821
+   for conveying Corresponding Source.)
822
+
823
+  5. Combined Libraries.
824
+
825
+  You may place library facilities that are a work based on the
826
+Library side by side in a single library together with other library
827
+facilities that are not Applications and are not covered by this
828
+License, and convey such a combined library under terms of your
829
+choice, if you do both of the following:
830
+
831
+   a) Accompany the combined library with a copy of the same work based
832
+   on the Library, uncombined with any other library facilities,
833
+   conveyed under the terms of this License.
834
+
835
+   b) Give prominent notice with the combined library that part of it
836
+   is a work based on the Library, and explaining where to find the
837
+   accompanying uncombined form of the same work.
838
+
839
+  6. Revised Versions of the GNU Lesser General Public License.
840
+
841
+  The Free Software Foundation may publish revised and/or new versions
842
+of the GNU Lesser General Public License from time to time. Such new
843
+versions will be similar in spirit to the present version, but may
844
+differ in detail to address new problems or concerns.
845
+
846
+  Each version is given a distinguishing version number. If the
847
+Library as you received it specifies that a certain numbered version
848
+of the GNU Lesser General Public License "or any later version"
849
+applies to it, you have the option of following the terms and
850
+conditions either of that published version or of any later version
851
+published by the Free Software Foundation. If the Library as you
852
+received it does not specify a version number of the GNU Lesser
853
+General Public License, you may choose any version of the GNU Lesser
854
+General Public License ever published by the Free Software Foundation.
855
+
856
+  If the Library as you received it specifies that a proxy can decide
857
+whether future versions of the GNU Lesser General Public License shall
858
+apply, that proxy's public statement of acceptance of any version is
859
+permanent authorization for you to choose that version for the
860
+Library.
861
+
... ...
@@ -0,0 +1,133 @@
1
+declare module lib_shape {
2
+    /**
3
+     * @author fenris
4
+     */
5
+    type type_inspection = {
6
+        messages: Array<string>;
7
+    };
8
+    /**
9
+     * @author fenris
10
+     */
11
+    type type_shape = {
12
+        name: string;
13
+        parameters?: Object;
14
+    };
15
+    /**
16
+     * @author fenris
17
+     */
18
+    function list(): Array<string>;
19
+    /**
20
+     * @author fenris
21
+     */
22
+    function inspection_create(): type_inspection;
23
+    /**
24
+     * @author fenris
25
+     */
26
+    function inspection_add(main: type_inspection, message: string): void;
27
+    /**
28
+     * @author fenris
29
+     */
30
+    function inspection_extend(main: type_inspection, prefix: string, sub: type_inspection): void;
31
+    /**
32
+     * @author fenris
33
+     * @todo check for existing
34
+     */
35
+    function register({ "name": name, "make": make, "inspect": _inspect, "stance": _stance, "show": _show, }: {
36
+        name: string;
37
+        make: (raw: Object, _make?: (raw: Object) => type_shape) => Object;
38
+        inspect: (parameters: Object, value: any, _inspect?: (shape: type_shape, value: any) => type_inspection) => type_inspection;
39
+        stance: (parameters: Object, bindings: {
40
+            [name: string]: type_shape;
41
+        }, _stance?: (shape: type_shape, bindings: {
42
+            [name: string]: type_shape;
43
+        }) => type_shape) => type_shape;
44
+        show: (parameters: Object, _show?: (shape: type_shape) => string) => string;
45
+    }): void;
46
+    /**
47
+     * @author fenris
48
+     * @todo check for existing
49
+     */
50
+    function define_alias({ "name": name, "target": target, }: {
51
+        name: string;
52
+        target: type_shape;
53
+    }): void;
54
+    /**
55
+     * @author fenris
56
+     * @todo check for existing
57
+     */
58
+    /**
59
+     * @author fenris
60
+     */
61
+    function make(raw: Object): type_shape;
62
+    /**
63
+     * @author fenris
64
+     */
65
+    function inspect(shape: type_shape, value: any): type_inspection;
66
+    /**
67
+     * @author fenris
68
+     */
69
+    function check(shape: type_shape, value: any): boolean;
70
+    /**
71
+     * @author fenris
72
+     */
73
+    function stance(shape: type_shape, bindings: {
74
+        [name: string]: type_shape;
75
+    }): type_shape;
76
+    /**
77
+     * @author fenris
78
+     */
79
+    function show(shape: type_shape): string;
80
+}
81
+declare module lib_shape {
82
+}
83
+declare module lib_shape {
84
+}
85
+declare module lib_shape {
86
+}
87
+declare module lib_shape {
88
+}
89
+declare module lib_shape {
90
+}
91
+declare module lib_shape {
92
+}
93
+declare module lib_shape {
94
+}
95
+declare module lib_shape {
96
+}
97
+declare module lib_shape {
98
+}
99
+declare module lib_shape {
100
+}
101
+declare module lib_shape {
102
+}
103
+declare module lib_shape {
104
+}
105
+declare module lib_shape {
106
+}
107
+declare module lib_shape {
108
+}
109
+declare module lib_shape {
110
+}
111
+declare module lib_shape {
112
+}
113
+declare module lib_shape {
114
+}
115
+declare module lib_shape {
116
+}
117
+declare module lib_shape {
118
+}
119
+declare module lib_shape {
120
+    /**
121
+     * @author fenris
122
+     * @todo use a treemap-function (but first make one :P)
123
+     */
124
+    function adjust_labels(shape: type_shape, transformator: (label_old: string) => string): type_shape;
125
+    /**
126
+     * @author fenris
127
+     */
128
+    function register_(id: string, factory: (parameters: Object) => type_shape): void;
129
+    /**
130
+     * @author fenris
131
+     */
132
+    function retrieve_(id: string): type_shape;
133
+}
... ...
@@ -0,0 +1,2282 @@
1
+/*
2
+This file is part of »bacterio-plankton:shape«.
3
+
4
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5
+<info@greenscale.de>
6
+
7
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
8
+it under the terms of the GNU Lesser General Public License as published by
9
+the Free Software Foundation, either version 3 of the License, or
10
+(at your option) any later version.
11
+
12
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
13
+but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+GNU Lesser General Public License for more details.
16
+
17
+You should have received a copy of the GNU Lesser General Public License
18
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+var lib_shape;
21
+(function (lib_shape) {
22
+    /**
23
+     * @author fenris
24
+     */
25
+    var _pool = {};
26
+    /**
27
+     * @author fenris
28
+     */
29
+    var _aliases = {};
30
+    /**
31
+     * @author fenris
32
+     */
33
+    function list() {
34
+        return [].concat(Object.keys(_pool)).concat(Object.keys(_aliases));
35
+    }
36
+    lib_shape.list = list;
37
+    /**
38
+     * @author fenris
39
+     */
40
+    function inspection_create() {
41
+        return {
42
+            "messages": []
43
+        };
44
+    }
45
+    lib_shape.inspection_create = inspection_create;
46
+    /**
47
+     * @author fenris
48
+     */
49
+    function inspection_add(main, message) {
50
+        main.messages.push(message);
51
+    }
52
+    lib_shape.inspection_add = inspection_add;
53
+    /**
54
+     * @author fenris
55
+     */
56
+    function inspection_extend(main, prefix, sub) {
57
+        main.messages = main.messages.concat(sub.messages.map(message => `${prefix}: ${message}`));
58
+    }
59
+    lib_shape.inspection_extend = inspection_extend;
60
+    /**
61
+     * @author fenris
62
+     * @todo check for existing
63
+     */
64
+    function register({ "name": name, "make": make, "inspect": _inspect, "stance": _stance, "show": _show, }) {
65
+        const entry = {
66
+            "name": name,
67
+            "make": make,
68
+            "inspect": _inspect,
69
+            "stance": _stance,
70
+            "show": _show,
71
+        };
72
+        _pool[name] = entry;
73
+    }
74
+    lib_shape.register = register;
75
+    /**
76
+     * @author fenris
77
+     * @todo check for existing
78
+     */
79
+    function define_alias({ "name": name, "target": target, }) {
80
+        const entry = {
81
+            "name": "alias",
82
+            "target": target,
83
+        };
84
+        _aliases[name] = entry;
85
+    }
86
+    lib_shape.define_alias = define_alias;
87
+    /**
88
+     * @author fenris
89
+     * @todo check for existing
90
+     */
91
+    /*
92
+    export function inspect_jstype(
93
+        inspection,
94
+        jstype_expected : string,
95
+        value : any
96
+    ) : void {
97
+        let jstype_actual : string = typeof(value);
98
+        if (jstype_actual === jstype_expected) {
99
+            // all good
100
+        }
101
+        else {
102
+            inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
103
+        }
104
+    }
105
+     */
106
+    /**
107
+     * @author fenris
108
+     */
109
+    function make(raw) {
110
+        const name = raw["name"];
111
+        if (_aliases.hasOwnProperty(name)) {
112
+            const alias = _aliases[name];
113
+            return alias.target;
114
+        }
115
+        else {
116
+            if (_pool.hasOwnProperty(name)) {
117
+                const entry = _pool[name];
118
+                const parameters = entry.make(raw["parameters"] || {}, make);
119
+                return {
120
+                    "name": name,
121
+                    "parameters": parameters,
122
+                };
123
+            }
124
+            else {
125
+                const message = `no shape registered with name '${name}'`;
126
+                throw (new Error(message));
127
+            }
128
+        }
129
+    }
130
+    lib_shape.make = make;
131
+    /**
132
+     * @author fenris
133
+     */
134
+    function inspect(shape, value) {
135
+        if (_pool.hasOwnProperty(shape.name)) {
136
+            const entry = _pool[shape.name];
137
+            return entry.inspect(shape.parameters, value, inspect);
138
+        }
139
+        else {
140
+            const message = `no shape registered with name '${shape.name}'`;
141
+            throw (new Error(message));
142
+        }
143
+    }
144
+    lib_shape.inspect = inspect;
145
+    /**
146
+     * @author fenris
147
+     */
148
+    function check(shape, value) {
149
+        if (_pool.hasOwnProperty(shape.name)) {
150
+            const entry = _pool[shape.name];
151
+            const inspection = inspect(shape, value);
152
+            inspection.messages
153
+                .forEach((message) => { console.warn(message); });
154
+            return (inspection.messages.length === 0);
155
+        }
156
+        else {
157
+            const message = `no shape registered with name '${shape.name}'`;
158
+            throw (new Error(message));
159
+        }
160
+    }
161
+    lib_shape.check = check;
162
+    /**
163
+     * @author fenris
164
+     */
165
+    function stance(shape, bindings) {
166
+        if (_pool.hasOwnProperty(shape.name)) {
167
+            const entry = _pool[shape.name];
168
+            return entry.stance(shape.parameters, bindings, stance);
169
+        }
170
+        else {
171
+            const message = `no shape registered with name '${shape.name}'`;
172
+            throw (new Error(message));
173
+        }
174
+    }
175
+    lib_shape.stance = stance;
176
+    /**
177
+     * @author fenris
178
+     */
179
+    function show(shape) {
180
+        if (_pool.hasOwnProperty(shape.name)) {
181
+            const entry = _pool[shape.name];
182
+            return entry.show(shape.parameters, show);
183
+        }
184
+        else {
185
+            const message = `no shape registered with name '${shape.name}'`;
186
+            throw (new Error(message));
187
+        }
188
+    }
189
+    lib_shape.show = show;
190
+})(lib_shape || (lib_shape = {}));
191
+/*
192
+This file is part of »bacterio-plankton:shape«.
193
+
194
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
195
+<info@greenscale.de>
196
+
197
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
198
+it under the terms of the GNU Lesser General Public License as published by
199
+the Free Software Foundation, either version 3 of the License, or
200
+(at your option) any later version.
201
+
202
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
203
+but WITHOUT ANY WARRANTY; without even the implied warranty of
204
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
205
+GNU Lesser General Public License for more details.
206
+
207
+You should have received a copy of the GNU Lesser General Public License
208
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
209
+ */
210
+var lib_shape;
211
+(function (lib_shape) {
212
+    /**
213
+     * @author fenris
214
+     */
215
+    function variable_make({ "name": name }) {
216
+        if (name == undefined) {
217
+            let message = `mandatory parameter 'name' missing`;
218
+            throw (new Error(message));
219
+        }
220
+        else {
221
+            return {
222
+                "name": name,
223
+            };
224
+        }
225
+    }
226
+    /**
227
+     * @author fenris
228
+     */
229
+    function variable_inspect(parameters, value, _inspect) {
230
+        let inspection = lib_shape.inspection_create();
231
+        let message = "cannot inspect a value against a type variable";
232
+        console.warn(message + "; will just pass ...");
233
+        // throw (new Error(message));
234
+        return inspection;
235
+    }
236
+    /**
237
+     * @author fenris
238
+     */
239
+    function variable_stance(parameters, bindings, _stance) {
240
+        if (parameters.name in bindings) {
241
+            return bindings[parameters.name];
242
+        }
243
+        else {
244
+            return {
245
+                "name": "variable",
246
+                "parameters": parameters
247
+            };
248
+        }
249
+    }
250
+    /**
251
+     * @author fenris
252
+     */
253
+    function variable_show(parameters, _show) {
254
+        let str;
255
+        // core
256
+        {
257
+            str = ("$" + parameters.name);
258
+        }
259
+        return str;
260
+    }
261
+    /**
262
+     * @author fenris
263
+     */
264
+    lib_shape.register({
265
+        "name": "variable",
266
+        "make": variable_make,
267
+        "inspect": variable_inspect,
268
+        "stance": variable_stance,
269
+        "show": variable_show,
270
+    });
271
+})(lib_shape || (lib_shape = {}));
272
+/*
273
+This file is part of »bacterio-plankton:shape«.
274
+
275
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
276
+<info@greenscale.de>
277
+
278
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
279
+it under the terms of the GNU Lesser General Public License as published by
280
+the Free Software Foundation, either version 3 of the License, or
281
+(at your option) any later version.
282
+
283
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
284
+but WITHOUT ANY WARRANTY; without even the implied warranty of
285
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
286
+GNU Lesser General Public License for more details.
287
+
288
+You should have received a copy of the GNU Lesser General Public License
289
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
290
+ */
291
+var lib_shape;
292
+(function (lib_shape) {
293
+    /**
294
+     * @author fenris
295
+     */
296
+    function function_make({ "soft": soft = false, "shape_input": shape_input, "shape_output": shape_output, "defaultvalue": defaultvalue = undefined, }, _make) {
297
+        if (shape_input === undefined) {
298
+            let message = `mandatory parameter 'shape_input' missing`;
299
+            throw (new Error(message));
300
+        }
301
+        if (shape_output === undefined) {
302
+            let message = `mandatory parameter 'shape_output' missing`;
303
+            throw (new Error(message));
304
+        }
305
+        if (defaultvalue === undefined) {
306
+            defaultvalue = (soft ? null : (x => x));
307
+        }
308
+        return {
309
+            "soft": soft,
310
+            "shape_input": _make(shape_input),
311
+            "shape_output": _make(shape_output),
312
+            "defaultvalue": defaultvalue,
313
+        };
314
+    }
315
+    /**
316
+     * @author fenris
317
+     */
318
+    function function_stance(parameters, bindings, _stance) {
319
+        return {
320
+            "name": "function",
321
+            "parameters": {
322
+                "soft": parameters.soft,
323
+                "shape_input": _stance(parameters.shape_input, bindings),
324
+                "shape_output": _stance(parameters.shape_output, bindings)
325
+            }
326
+        };
327
+    }
328
+    /**
329
+     * @author fenris
330
+     * @todo closer look not possible?
331
+     */
332
+    function function_inspect(parameters, value, _inspect) {
333
+        let inspection = lib_shape.inspection_create();
334
+        if (value == undefined) {
335
+            if (parameters.soft) {
336
+                // all good
337
+            }
338
+            else {
339
+                lib_shape.inspection_add(inspection, "null is not allowed");
340
+            }
341
+        }
342
+        else {
343
+            let jstype_actual = typeof (value);
344
+            let jstype_expected = "function";
345
+            if (jstype_actual === jstype_expected) {
346
+                // all good?
347
+            }
348
+            else {
349
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
350
+            }
351
+        }
352
+        return inspection;
353
+    }
354
+    /**
355
+     * @author fenris
356
+     */
357
+    function function_show(parameters, _show) {
358
+        let str;
359
+        /*
360
+        // core
361
+        {
362
+            str = "function";
363
+        }
364
+        // in/out
365
+        {
366
+            str += (
367
+                "<"
368
+                +
369
+                [
370
+                    _show(parameters.shape_input),
371
+                    _show(parameters.shape_output),
372
+                ].join(",")
373
+                +
374
+                ">"
375
+            );
376
+        }
377
+         */
378
+        str = "";
379
+        str += ("(" + _show(parameters.shape_input) + " => " + _show(parameters.shape_output) + ")");
380
+        // soft
381
+        {
382
+            if (parameters.soft) {
383
+                str = `~${str}`;
384
+            }
385
+        }
386
+        return str;
387
+    }
388
+    /**
389
+     * @author fenris
390
+     */
391
+    lib_shape.register({
392
+        "name": "function",
393
+        "make": function_make,
394
+        "inspect": function_inspect,
395
+        "stance": function_stance,
396
+        "show": function_show,
397
+    });
398
+})(lib_shape || (lib_shape = {}));
399
+/*
400
+This file is part of »bacterio-plankton:shape«.
401
+
402
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
403
+<info@greenscale.de>
404
+
405
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
406
+it under the terms of the GNU Lesser General Public License as published by
407
+the Free Software Foundation, either version 3 of the License, or
408
+(at your option) any later version.
409
+
410
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
411
+but WITHOUT ANY WARRANTY; without even the implied warranty of
412
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
413
+GNU Lesser General Public License for more details.
414
+
415
+You should have received a copy of the GNU Lesser General Public License
416
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
417
+ */
418
+var lib_shape;
419
+(function (lib_shape) {
420
+    /**
421
+     * @author fenris
422
+     */
423
+    function void_make({ "soft": soft = true, }) {
424
+        return {
425
+            "soft": soft,
426
+        };
427
+    }
428
+    /**
429
+     * @author fenris
430
+     */
431
+    function void_inspect(parameters, value, _inspect) {
432
+        let inspection = lib_shape.inspection_create();
433
+        if (value == undefined) {
434
+            if (parameters.soft) {
435
+                // all good
436
+            }
437
+            else {
438
+                lib_shape.inspection_add(inspection, "null is not allowed");
439
+            }
440
+        }
441
+        else {
442
+            // all good
443
+        }
444
+        return inspection;
445
+    }
446
+    /**
447
+     * @author fenris
448
+     */
449
+    function void_stance(parameters, bindings, _stance) {
450
+        return {
451
+            "name": "void",
452
+            "parameters": parameters
453
+        };
454
+    }
455
+    /**
456
+     * @author fenris
457
+     */
458
+    function void_show(parameters, _show) {
459
+        let str;
460
+        // core
461
+        {
462
+            str = "void";
463
+        }
464
+        // soft
465
+        {
466
+            if (parameters.soft) {
467
+                str = `~${str}`;
468
+            }
469
+        }
470
+        return str;
471
+    }
472
+    /**
473
+     * @author fenris
474
+     */
475
+    lib_shape.register({
476
+        "name": "void",
477
+        "make": void_make,
478
+        "inspect": void_inspect,
479
+        "stance": void_stance,
480
+        "show": void_show,
481
+    });
482
+})(lib_shape || (lib_shape = {}));
483
+/*
484
+This file is part of »bacterio-plankton:shape«.
485
+
486
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
487
+<info@greenscale.de>
488
+
489
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
490
+it under the terms of the GNU Lesser General Public License as published by
491
+the Free Software Foundation, either version 3 of the License, or
492
+(at your option) any later version.
493
+
494
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
495
+but WITHOUT ANY WARRANTY; without even the implied warranty of
496
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
497
+GNU Lesser General Public License for more details.
498
+
499
+You should have received a copy of the GNU Lesser General Public License
500
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
501
+ */
502
+var lib_shape;
503
+(function (lib_shape) {
504
+    /**
505
+     * @author fenris
506
+     */
507
+    function any_make({ "soft": soft = true, "mutable": mutable = true, "defaultvalue": defaultvalue = null, }) {
508
+        return {
509
+            "soft": soft,
510
+            "mutable": mutable,
511
+            "defaultvalue": defaultvalue,
512
+        };
513
+    }
514
+    /**
515
+     * @author fenris
516
+     */
517
+    function any_inspect(parameters, value, _inspect) {
518
+        let inspection = lib_shape.inspection_create();
519
+        if (value == undefined) {
520
+            if (parameters.soft) {
521
+                // all good
522
+            }
523
+            else {
524
+                lib_shape.inspection_add(inspection, "null is not allowed");
525
+            }
526
+        }
527
+        else {
528
+            // all good
529
+        }
530
+        return inspection;
531
+    }
532
+    /**
533
+     * @author fenris
534
+     */
535
+    function any_stance(parameters, bindings, _stance) {
536
+        return {
537
+            "name": "any",
538
+            "parameters": parameters
539
+        };
540
+    }
541
+    /**
542
+     * @author fenris
543
+     */
544
+    function any_show(parameters, _show) {
545
+        let str;
546
+        // core
547
+        {
548
+            str = "any";
549
+        }
550
+        // soft
551
+        {
552
+            if (parameters.soft) {
553
+                str = `~${str}`;
554
+            }
555
+        }
556
+        return str;
557
+    }
558
+    /**
559
+     * @author fenris
560
+     */
561
+    lib_shape.register({
562
+        "name": "any",
563
+        "make": any_make,
564
+        "inspect": any_inspect,
565
+        "stance": any_stance,
566
+        "show": any_show,
567
+    });
568
+})(lib_shape || (lib_shape = {}));
569
+/*
570
+This file is part of »bacterio-plankton:shape«.
571
+
572
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
573
+<info@greenscale.de>
574
+
575
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
576
+it under the terms of the GNU Lesser General Public License as published by
577
+the Free Software Foundation, either version 3 of the License, or
578
+(at your option) any later version.
579
+
580
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
581
+but WITHOUT ANY WARRANTY; without even the implied warranty of
582
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
583
+GNU Lesser General Public License for more details.
584
+
585
+You should have received a copy of the GNU Lesser General Public License
586
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
587
+ */
588
+var lib_shape;
589
+(function (lib_shape) {
590
+    /**
591
+     * @author fenris
592
+     */
593
+    function boolean_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, }) {
594
+        if (defaultvalue === undefined) {
595
+            defaultvalue = (soft ? null : false);
596
+        }
597
+        return {
598
+            "soft": soft,
599
+            "mutable": mutable,
600
+            "defaultvalue": defaultvalue,
601
+        };
602
+    }
603
+    /**
604
+     * @author fenris
605
+     */
606
+    function boolean_inspect(parameters, value, _inspect) {
607
+        let inspection = lib_shape.inspection_create();
608
+        if (value == undefined) {
609
+            if (parameters.soft) {
610
+                // all good
611
+            }
612
+            else {
613
+                lib_shape.inspection_add(inspection, "null is not allowed");
614
+            }
615
+        }
616
+        else {
617
+            let jstype_actual = typeof (value);
618
+            let jstype_expected = "boolean";
619
+            if (jstype_actual === jstype_expected) {
620
+                // all good
621
+            }
622
+            else {
623
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
624
+            }
625
+        }
626
+        return inspection;
627
+    }
628
+    /**
629
+     * @author fenris
630
+     */
631
+    function boolean_stance(parameters, bindings, _stance) {
632
+        return {
633
+            "name": "boolean",
634
+            "parameters": parameters
635
+        };
636
+    }
637
+    /**
638
+     * @author fenris
639
+     */
640
+    function boolean_show(parameters, _show) {
641
+        let str;
642
+        // core
643
+        {
644
+            str = "boolean";
645
+        }
646
+        // soft
647
+        {
648
+            if (parameters.soft) {
649
+                str = `~${str}`;
650
+            }
651
+        }
652
+        return str;
653
+    }
654
+    /**
655
+     * @author fenris
656
+     */
657
+    lib_shape.register({
658
+        "name": "boolean",
659
+        "make": boolean_make,
660
+        "inspect": boolean_inspect,
661
+        "stance": boolean_stance,
662
+        "show": boolean_show,
663
+    });
664
+})(lib_shape || (lib_shape = {}));
665
+/*
666
+This file is part of »bacterio-plankton:shape«.
667
+
668
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
669
+<info@greenscale.de>
670
+
671
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
672
+it under the terms of the GNU Lesser General Public License as published by
673
+the Free Software Foundation, either version 3 of the License, or
674
+(at your option) any later version.
675
+
676
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
677
+but WITHOUT ANY WARRANTY; without even the implied warranty of
678
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
679
+GNU Lesser General Public License for more details.
680
+
681
+You should have received a copy of the GNU Lesser General Public License
682
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
683
+ */
684
+var lib_shape;
685
+(function (lib_shape) {
686
+    /**
687
+     * @author fenris
688
+     */
689
+    function int_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, "minimum": minimum = null, "maximum": maximum = null, }) {
690
+        if (defaultvalue === undefined) {
691
+            defaultvalue = (soft ? null : 0);
692
+        }
693
+        return {
694
+            "soft": soft,
695
+            "mutable": mutable,
696
+            "defaultvalue": defaultvalue,
697
+            "minimum": minimum,
698
+            "maximum": maximum,
699
+        };
700
+    }
701
+    /**
702
+     * @author fenris
703
+     */
704
+    function int_inspect(parameters, value, _inspect) {
705
+        let inspection = lib_shape.inspection_create();
706
+        if (value == undefined) {
707
+            if (parameters.soft) {
708
+                // all good
709
+            }
710
+            else {
711
+                lib_shape.inspection_add(inspection, "null is not allowed");
712
+            }
713
+        }
714
+        else {
715
+            let jstype_actual = typeof (value);
716
+            let jstype_expected = "number";
717
+            if (jstype_actual === jstype_expected) {
718
+                if (!isNaN(parseInt(value))) {
719
+                    if ((parameters.minimum === null) || (value >= parameters.minimum)) {
720
+                        if ((parameters.maximum === null) || (value <= parameters.maximum)) {
721
+                            // all good
722
+                        }
723
+                        else {
724
+                            lib_shape.inspection_add(inspection, `value is beyond maximum`);
725
+                        }
726
+                    }
727
+                    else {
728
+                        lib_shape.inspection_add(inspection, `value is below minimum`);
729
+                    }
730
+                }
731
+                else {
732
+                    lib_shape.inspection_add(inspection, `value is not parsable into a valid int`);
733
+                }
734
+            }
735
+            else {
736
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
737
+            }
738
+        }
739
+        return inspection;
740
+    }
741
+    /**
742
+     * @author fenris
743
+     */
744
+    function int_stance(parameters, bindings, _stance) {
745
+        return {
746
+            "name": "int",
747
+            "parameters": parameters
748
+        };
749
+    }
750
+    /**
751
+     * @author fenris
752
+     */
753
+    function int_show(parameters, _show) {
754
+        let str;
755
+        // core
756
+        {
757
+            str = "int";
758
+        }
759
+        // soft
760
+        {
761
+            if (parameters.soft) {
762
+                str = `~${str}`;
763
+            }
764
+        }
765
+        return str;
766
+    }
767
+    /**
768
+     * @author fenris
769
+     */
770
+    lib_shape.register({
771
+        "name": "int",
772
+        "make": int_make,
773
+        "inspect": int_inspect,
774
+        "stance": int_stance,
775
+        "show": int_show,
776
+    });
777
+})(lib_shape || (lib_shape = {}));
778
+/*
779
+This file is part of »bacterio-plankton:shape«.
780
+
781
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
782
+<info@greenscale.de>
783
+
784
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
785
+it under the terms of the GNU Lesser General Public License as published by
786
+the Free Software Foundation, either version 3 of the License, or
787
+(at your option) any later version.
788
+
789
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
790
+but WITHOUT ANY WARRANTY; without even the implied warranty of
791
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
792
+GNU Lesser General Public License for more details.
793
+
794
+You should have received a copy of the GNU Lesser General Public License
795
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
796
+ */
797
+var lib_shape;
798
+(function (lib_shape) {
799
+    /**
800
+     * @author fenris
801
+     */
802
+    function float_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, }) {
803
+        if (defaultvalue === undefined) {
804
+            defaultvalue = (soft ? null : 0.0);
805
+        }
806
+        return {
807
+            "soft": soft,
808
+            "mutable": mutable,
809
+            "defaultvalue": defaultvalue,
810
+        };
811
+    }
812
+    /**
813
+     * @author fenris
814
+     */
815
+    function float_inspect(parameters, value, _inspect) {
816
+        let inspection = lib_shape.inspection_create();
817
+        if (value == undefined) {
818
+            if (parameters.soft) {
819
+                // all good
820
+            }
821
+            else {
822
+                lib_shape.inspection_add(inspection, "null is not allowed");
823
+            }
824
+        }
825
+        else {
826
+            let jstype_actual = typeof (value);
827
+            let jstype_expected = "number";
828
+            if (jstype_actual === jstype_expected) {
829
+                if (!isNaN(parseFloat(value))) {
830
+                    // all good
831
+                }
832
+                else {
833
+                    lib_shape.inspection_add(inspection, `value is not parsable into a valid float`);
834
+                }
835
+            }
836
+            else {
837
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
838
+            }
839
+        }
840
+        return inspection;
841
+    }
842
+    /**
843
+     * @author fenris
844
+     */
845
+    function float_stance(parameters, bindings, _stance) {
846
+        return {
847
+            "name": "float",
848
+            "parameters": parameters
849
+        };
850
+    }
851
+    /**
852
+     * @author fenris
853
+     */
854
+    function float_show(parameters, _show) {
855
+        let str;
856
+        // core
857
+        {
858
+            str = "float";
859
+        }
860
+        // soft
861
+        {
862
+            if (parameters.soft) {
863
+                str = `~${str}`;
864
+            }
865
+        }
866
+        return str;
867
+    }
868
+    /**
869
+     * @author fenris
870
+     */
871
+    lib_shape.register({
872
+        "name": "float",
873
+        "make": float_make,
874
+        "inspect": float_inspect,
875
+        "stance": float_stance,
876
+        "show": float_show,
877
+    });
878
+})(lib_shape || (lib_shape = {}));
879
+/*
880
+This file is part of »bacterio-plankton:shape«.
881
+
882
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
883
+<info@greenscale.de>
884
+
885
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
886
+it under the terms of the GNU Lesser General Public License as published by
887
+the Free Software Foundation, either version 3 of the License, or
888
+(at your option) any later version.
889
+
890
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
891
+but WITHOUT ANY WARRANTY; without even the implied warranty of
892
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
893
+GNU Lesser General Public License for more details.
894
+
895
+You should have received a copy of the GNU Lesser General Public License
896
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
897
+ */
898
+var lib_shape;
899
+(function (lib_shape) {
900
+    /**
901
+     * @author fenris
902
+     */
903
+    function string_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, "long": long = false, }) {
904
+        if (defaultvalue === undefined) {
905
+            defaultvalue = (soft ? null : "");
906
+        }
907
+        return {
908
+            "soft": soft,
909
+            "mutable": mutable,
910
+            "defaultvalue": defaultvalue,
911
+            "long": long,
912
+        };
913
+    }
914
+    /**
915
+     * @author fenris
916
+     */
917
+    function string_inspect(parameters, value, _inspect) {
918
+        let inspection = lib_shape.inspection_create();
919
+        if (value == undefined) {
920
+            if (parameters.soft) {
921
+                // all good
922
+            }
923
+            else {
924
+                lib_shape.inspection_add(inspection, "null is not allowed");
925
+            }
926
+        }
927
+        else {
928
+            let jstype_actual = typeof (value);
929
+            let jstype_expected = "string";
930
+            if (jstype_actual === jstype_expected) {
931
+                // all good
932
+            }
933
+            else {
934
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
935
+            }
936
+        }
937
+        return inspection;
938
+    }
939
+    /**
940
+     * @author fenris
941
+     */
942
+    function string_stance(parameters, bindings, _stance) {
943
+        return {
944
+            "name": "string",
945
+            "parameters": parameters
946
+        };
947
+    }
948
+    /**
949
+     * @author fenris
950
+     */
951
+    function string_show(parameters, _show) {
952
+        let str;
953
+        // core
954
+        {
955
+            str = "string";
956
+        }
957
+        // soft
958
+        {
959
+            if (parameters.soft) {
960
+                str = `~${str}`;
961
+            }
962
+        }
963
+        return str;
964
+    }
965
+    /**
966
+     * @author fenris
967
+     */
968
+    lib_shape.register({
969
+        "name": "string",
970
+        "make": string_make,
971
+        "inspect": string_inspect,
972
+        "stance": string_stance,
973
+        "show": string_show,
974
+    });
975
+})(lib_shape || (lib_shape = {}));
976
+/*
977
+This file is part of »bacterio-plankton:shape«.
978
+
979
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
980
+<info@greenscale.de>
981
+
982
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
983
+it under the terms of the GNU Lesser General Public License as published by
984
+the Free Software Foundation, either version 3 of the License, or
985
+(at your option) any later version.
986
+
987
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
988
+but WITHOUT ANY WARRANTY; without even the implied warranty of
989
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
990
+GNU Lesser General Public License for more details.
991
+
992
+You should have received a copy of the GNU Lesser General Public License
993
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
994
+ */
995
+var lib_shape;
996
+(function (lib_shape) {
997
+    /**
998
+     * @author fenris
999
+     */
1000
+    function email_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, }) {
1001
+        if (defaultvalue === undefined) {
1002
+            defaultvalue = (soft ? null : "");
1003
+        }
1004
+        return {
1005
+            "soft": soft,
1006
+            "mutable": mutable,
1007
+            "defaultvalue": defaultvalue,
1008
+        };
1009
+    }
1010
+    /**
1011
+     * @author fenris
1012
+     */
1013
+    function email_inspect(parameters, value, _inspect) {
1014
+        let inspection = lib_shape.inspection_create();
1015
+        if (value == undefined) {
1016
+            if (parameters.soft) {
1017
+                // all good
1018
+            }
1019
+            else {
1020
+                lib_shape.inspection_add(inspection, "null is not allowed");
1021
+            }
1022
+        }
1023
+        else {
1024
+            let jstype_actual = typeof (value);
1025
+            let jstype_expected = "string";
1026
+            if (jstype_actual === jstype_expected) {
1027
+                // all good
1028
+            }
1029
+            else {
1030
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
1031
+            }
1032
+        }
1033
+        return inspection;
1034
+    }
1035
+    /**
1036
+     * @author fenris
1037
+     */
1038
+    function email_stance(parameters, bindings, _stance) {
1039
+        return {
1040
+            "name": "email",
1041
+            "parameters": parameters
1042
+        };
1043
+    }
1044
+    /**
1045
+     * @author fenris
1046
+     */
1047
+    function email_show(parameters, _show) {
1048
+        let str;
1049
+        // core
1050
+        {
1051
+            str = "email";
1052
+        }
1053
+        // soft
1054
+        {
1055
+            if (parameters.soft) {
1056
+                str = `~${str}`;
1057
+            }
1058
+        }
1059
+        return str;
1060
+    }
1061
+    /**
1062
+     * @author fenris
1063
+     */
1064
+    lib_shape.register({
1065
+        "name": "email",
1066
+        "make": email_make,
1067
+        "inspect": email_inspect,
1068
+        "stance": email_stance,
1069
+        "show": email_show,
1070
+    });
1071
+})(lib_shape || (lib_shape = {}));
1072
+/*
1073
+This file is part of »bacterio-plankton:shape«.
1074
+
1075
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1076
+<info@greenscale.de>
1077
+
1078
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1079
+it under the terms of the GNU Lesser General Public License as published by
1080
+the Free Software Foundation, either version 3 of the License, or
1081
+(at your option) any later version.
1082
+
1083
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1084
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1085
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1086
+GNU Lesser General Public License for more details.
1087
+
1088
+You should have received a copy of the GNU Lesser General Public License
1089
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1090
+ */
1091
+var lib_shape;
1092
+(function (lib_shape) {
1093
+    /**
1094
+     * @author fenris
1095
+     */
1096
+    function url_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, "type": type = "link", }) {
1097
+        if (defaultvalue === undefined) {
1098
+            defaultvalue = (soft ? null : "");
1099
+        }
1100
+        return {
1101
+            "soft": soft,
1102
+            "mutable": mutable,
1103
+            "defaultvalue": defaultvalue,
1104
+            "type": type,
1105
+        };
1106
+    }
1107
+    /**
1108
+     * @author fenris
1109
+     */
1110
+    function url_inspect(parameters, value, _inspect) {
1111
+        let inspection = lib_shape.inspection_create();
1112
+        if (value == undefined) {
1113
+            if (parameters.soft) {
1114
+                // all good
1115
+            }
1116
+            else {
1117
+                lib_shape.inspection_add(inspection, "null is not allowed");
1118
+            }
1119
+        }
1120
+        else {
1121
+            let jstype_actual = typeof (value);
1122
+            let jstype_expected = "string";
1123
+            if (jstype_actual === jstype_expected) {
1124
+                // all good
1125
+            }
1126
+            else {
1127
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
1128
+            }
1129
+        }
1130
+        return inspection;
1131
+    }
1132
+    /**
1133
+     * @author fenris
1134
+     */
1135
+    function url_stance(parameters, bindings, _stance) {
1136
+        return {
1137
+            "name": "url",
1138
+            "parameters": parameters
1139
+        };
1140
+    }
1141
+    /**
1142
+     * @author fenris
1143
+     */
1144
+    function url_show(parameters, _show) {
1145
+        let str;
1146
+        // core
1147
+        {
1148
+            str = "url";
1149
+        }
1150
+        // soft
1151
+        {
1152
+            if (parameters.soft) {
1153
+                str = `~${str}`;
1154
+            }
1155
+        }
1156
+        return str;
1157
+    }
1158
+    /**
1159
+     * @author fenris
1160
+     */
1161
+    lib_shape.register({
1162
+        "name": "url",
1163
+        "make": url_make,
1164
+        "inspect": url_inspect,
1165
+        "stance": url_stance,
1166
+        "show": url_show,
1167
+    });
1168
+})(lib_shape || (lib_shape = {}));
1169
+/*
1170
+This file is part of »bacterio-plankton:shape«.
1171
+
1172
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1173
+<info@greenscale.de>
1174
+
1175
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1176
+it under the terms of the GNU Lesser General Public License as published by
1177
+the Free Software Foundation, either version 3 of the License, or
1178
+(at your option) any later version.
1179
+
1180
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1181
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1182
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1183
+GNU Lesser General Public License for more details.
1184
+
1185
+You should have received a copy of the GNU Lesser General Public License
1186
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1187
+ */
1188
+var lib_shape;
1189
+(function (lib_shape) {
1190
+    /**
1191
+     * @author fenris
1192
+     */
1193
+    function markdown_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, "type": type = "link", }) {
1194
+        if (defaultvalue === undefined) {
1195
+            defaultvalue = (soft ? null : "");
1196
+        }
1197
+        return {
1198
+            "soft": soft,
1199
+            "mutable": mutable,
1200
+            "defaultvalue": defaultvalue,
1201
+            "type": type,
1202
+        };
1203
+    }
1204
+    /**
1205
+     * @author fenris
1206
+     */
1207
+    function markdown_inspect(parameters, value, _inspect) {
1208
+        let inspection = lib_shape.inspection_create();
1209
+        if (value == undefined) {
1210
+            if (parameters.soft) {
1211
+                // all good
1212
+            }
1213
+            else {
1214
+                lib_shape.inspection_add(inspection, "null is not allowed");
1215
+            }
1216
+        }
1217
+        else {
1218
+            let jstype_actual = typeof (value);
1219
+            let jstype_expected = "string";
1220
+            if (jstype_actual === jstype_expected) {
1221
+                // all good
1222
+            }
1223
+            else {
1224
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
1225
+            }
1226
+        }
1227
+        return inspection;
1228
+    }
1229
+    /**
1230
+     * @author fenris
1231
+     */
1232
+    function markdown_stance(parameters, bindings, _stance) {
1233
+        return {
1234
+            "name": "markdown",
1235
+            "parameters": parameters
1236
+        };
1237
+    }
1238
+    /**
1239
+     * @author fenris
1240
+     */
1241
+    function markdown_show(parameters, _show) {
1242
+        let str;
1243
+        // core
1244
+        {
1245
+            str = "markdown";
1246
+        }
1247
+        // soft
1248
+        {
1249
+            if (parameters.soft) {
1250
+                str = `~${str}`;
1251
+            }
1252
+        }
1253
+        return str;
1254
+    }
1255
+    /**
1256
+     * @author fenris
1257
+     */
1258
+    lib_shape.register({
1259
+        "name": "markdown",
1260
+        "make": markdown_make,
1261
+        "inspect": markdown_inspect,
1262
+        "stance": markdown_stance,
1263
+        "show": markdown_show,
1264
+    });
1265
+})(lib_shape || (lib_shape = {}));
1266
+/*
1267
+This file is part of »bacterio-plankton:shape«.
1268
+
1269
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1270
+<info@greenscale.de>
1271
+
1272
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1273
+it under the terms of the GNU Lesser General Public License as published by
1274
+the Free Software Foundation, either version 3 of the License, or
1275
+(at your option) any later version.
1276
+
1277
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1278
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1279
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1280
+GNU Lesser General Public License for more details.
1281
+
1282
+You should have received a copy of the GNU Lesser General Public License
1283
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1284
+ */
1285
+var lib_shape;
1286
+(function (lib_shape) {
1287
+    /**
1288
+     * @author fenris
1289
+     */
1290
+    function time_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, }) {
1291
+        if (defaultvalue === undefined) {
1292
+            defaultvalue = (soft ? null : "");
1293
+        }
1294
+        return {
1295
+            "soft": soft,
1296
+            "mutable": mutable,
1297
+            "defaultvalue": defaultvalue,
1298
+        };
1299
+    }
1300
+    /**
1301
+     * @author fenris
1302
+     */
1303
+    function time_inspect(parameters, value, _inspect) {
1304
+        let inspection = lib_shape.inspection_create();
1305
+        if (value == undefined) {
1306
+            if (parameters.soft) {
1307
+                // all good
1308
+            }
1309
+            else {
1310
+                lib_shape.inspection_add(inspection, "null is not allowed");
1311
+            }
1312
+        }
1313
+        else {
1314
+            let jstype_actual = typeof (value);
1315
+            let jstype_expected = "object";
1316
+            if (jstype_actual === jstype_expected) {
1317
+                // all good?
1318
+            }
1319
+            else {
1320
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
1321
+            }
1322
+        }
1323
+        return inspection;
1324
+    }
1325
+    /**
1326
+     * @author fenris
1327
+     */
1328
+    function time_stance(parameters, bindings, _stance) {
1329
+        return {
1330
+            "name": "time",
1331
+            "parameters": parameters
1332
+        };
1333
+    }
1334
+    /**
1335
+     * @author fenris
1336
+     */
1337
+    function time_show(parameters, _show) {
1338
+        let str;
1339
+        // core
1340
+        {
1341
+            str = "time";
1342
+        }
1343
+        // soft
1344
+        {
1345
+            if (parameters.soft) {
1346
+                str = `~${str}`;
1347
+            }
1348
+        }
1349
+        return str;
1350
+    }
1351
+    /**
1352
+     * @author fenris
1353
+     */
1354
+    lib_shape.register({
1355
+        "name": "time",
1356
+        "make": time_make,
1357
+        "inspect": time_inspect,
1358
+        "stance": time_stance,
1359
+        "show": time_show,
1360
+    });
1361
+})(lib_shape || (lib_shape = {}));
1362
+/*
1363
+This file is part of »bacterio-plankton:shape«.
1364
+
1365
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1366
+<info@greenscale.de>
1367
+
1368
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1369
+it under the terms of the GNU Lesser General Public License as published by
1370
+the Free Software Foundation, either version 3 of the License, or
1371
+(at your option) any later version.
1372
+
1373
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1374
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1375
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1376
+GNU Lesser General Public License for more details.
1377
+
1378
+You should have received a copy of the GNU Lesser General Public License
1379
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1380
+ */
1381
+var lib_shape;
1382
+(function (lib_shape) {
1383
+    /**
1384
+     * @author fenris
1385
+     */
1386
+    function array_make({ "soft": soft = false, "mutable": mutable = true, "shape_element": shape_element, "defaultvalue": defaultvalue = undefined, }, _make) {
1387
+        if (shape_element === undefined) {
1388
+            let message = `mandatory parameter 'shape_element' missing`;
1389
+            throw (new Error(message));
1390
+        }
1391
+        if (defaultvalue === undefined) {
1392
+            defaultvalue = (soft ? null : []);
1393
+        }
1394
+        return {
1395
+            "soft": soft,
1396
+            "mutable": mutable,
1397
+            "shape_element": _make(shape_element),
1398
+            "defaultvalue": defaultvalue,
1399
+        };
1400
+    }
1401
+    /**
1402
+     * @author fenris
1403
+     */
1404
+    function array_inspect(parameters, value, _inspect) {
1405
+        let inspection = lib_shape.inspection_create();
1406
+        if (value == undefined) {
1407
+            if (parameters.soft) {
1408
+                // all good
1409
+            }
1410
+            else {
1411
+                lib_shape.inspection_add(inspection, "null is not allowed");
1412
+            }
1413
+        }
1414
+        else {
1415
+            let jstype_actual = typeof (value);
1416
+            let jstype_expected = "object";
1417
+            if (jstype_actual === jstype_expected) {
1418
+                if (value instanceof Array) {
1419
+                    value.forEach((element, index) => {
1420
+                        lib_shape.inspection_extend(inspection, `element #${index.toFixed(0)}`, _inspect(parameters.shape_element, element));
1421
+                    });
1422
+                }
1423
+                else {
1424
+                    lib_shape.inspection_add(inspection, `value does not seem to be an array-instance`);
1425
+                }
1426
+            }
1427
+            else {
1428
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
1429
+            }
1430
+        }
1431
+        return inspection;
1432
+    }
1433
+    /**
1434
+     * @author fenris
1435
+     */
1436
+    function array_stance(parameters, bindings, _stance) {
1437
+        return {
1438
+            "name": "array",
1439
+            "parameters": {
1440
+                "soft": parameters.soft,
1441
+                "shape_element": _stance(parameters.shape_element, bindings)
1442
+            }
1443
+        };
1444
+    }
1445
+    /**
1446
+     * @author fenris
1447
+     */
1448
+    function array_show(parameters, _show) {
1449
+        let str;
1450
+        // core
1451
+        {
1452
+            str = "array";
1453
+        }
1454
+        // shape_element
1455
+        {
1456
+            str += ("<"
1457
+                +
1458
+                    _show(parameters.shape_element)
1459
+                +
1460
+                    ">");
1461
+        }
1462
+        // soft
1463
+        {
1464
+            if (parameters.soft) {
1465
+                str = `~${str}`;
1466
+            }
1467
+        }
1468
+        return str;
1469
+    }
1470
+    /**
1471
+     * @author fenris
1472
+     */
1473
+    lib_shape.register({
1474
+        "name": "array",
1475
+        "make": array_make,
1476
+        "inspect": array_inspect,
1477
+        "stance": array_stance,
1478
+        "show": array_show,
1479
+    });
1480
+})(lib_shape || (lib_shape = {}));
1481
+/*
1482
+This file is part of »bacterio-plankton:shape«.
1483
+
1484
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1485
+<info@greenscale.de>
1486
+
1487
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1488
+it under the terms of the GNU Lesser General Public License as published by
1489
+the Free Software Foundation, either version 3 of the License, or
1490
+(at your option) any later version.
1491
+
1492
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1493
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1494
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1495
+GNU Lesser General Public License for more details.
1496
+
1497
+You should have received a copy of the GNU Lesser General Public License
1498
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1499
+ */
1500
+var lib_shape;
1501
+(function (lib_shape) {
1502
+    /**
1503
+     * @author fenris
1504
+     */
1505
+    function enumeration_make({ "soft": soft = false, "mutable": mutable = true, "shape_option": shape_option, "options": options, "defaultvalue": defaultvalue = undefined, }, _make) {
1506
+        if (shape_option === undefined) {
1507
+            let message = `mandatory parameter 'shape_option' missing`;
1508
+            throw (new Error(message));
1509
+        }
1510
+        if (options === undefined) {
1511
+            let message = `mandatory parameter 'options' missing`;
1512
+            throw (new Error(message));
1513
+        }
1514
+        if (defaultvalue === undefined) {
1515
+            defaultvalue = (soft ? null : options[0].value);
1516
+        }
1517
+        return {
1518
+            "soft": soft,
1519
+            "mutable": mutable,
1520
+            "shape_option": _make(shape_option),
1521
+            "options": options,
1522
+            "defaultvalue": defaultvalue,
1523
+        };
1524
+    }
1525
+    /**
1526
+     * @author fenris
1527
+     */
1528
+    function enumeration_inspect(parameters, value, _inspect) {
1529
+        let inspection = lib_shape.inspection_create();
1530
+        if (value == undefined) {
1531
+            if (parameters.soft) {
1532
+                // all good
1533
+            }
1534
+            else {
1535
+                lib_shape.inspection_add(inspection, "null is not allowed");
1536
+            }
1537
+        }
1538
+        else {
1539
+            lib_shape.inspection_extend(inspection, `given value for enumeration`, _inspect(parameters.shape_option, value));
1540
+            // TODO: check if corresponding option exists
1541
+        }
1542
+        return inspection;
1543
+    }
1544
+    /**
1545
+     * @author fenris
1546
+     */
1547
+    function enumeration_stance(parameters, bindings, _stance) {
1548
+        return {
1549
+            "name": "enumeration",
1550
+            "parameters": {
1551
+                "soft": parameters.soft,
1552
+                "shape_option": _stance(parameters.shape_option, bindings),
1553
+                "options": parameters.options,
1554
+            }
1555
+        };
1556
+    }
1557
+    /**
1558
+     * @author fenris
1559
+     */
1560
+    function enumeration_show(parameters, _show) {
1561
+        let str;
1562
+        // core
1563
+        {
1564
+            str = "enumeration";
1565
+        }
1566
+        // shape_option
1567
+        {
1568
+            str += ("<"
1569
+                +
1570
+                    parameters.options.map(option => String(option)).join(",") + ":" + _show(parameters.shape_option)
1571
+                +
1572
+                    ">");
1573
+        }
1574
+        // soft
1575
+        {
1576
+            if (parameters.soft) {
1577
+                str = `~${str}`;
1578
+            }
1579
+        }
1580
+        return str;
1581
+    }
1582
+    /**
1583
+     * @author fenris
1584
+     */
1585
+    lib_shape.register({
1586
+        "name": "enumeration",
1587
+        "make": enumeration_make,
1588
+        "inspect": enumeration_inspect,
1589
+        "stance": enumeration_stance,
1590
+        "show": enumeration_show,
1591
+    });
1592
+})(lib_shape || (lib_shape = {}));
1593
+/*
1594
+This file is part of »bacterio-plankton:shape«.
1595
+
1596
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1597
+<info@greenscale.de>
1598
+
1599
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1600
+it under the terms of the GNU Lesser General Public License as published by
1601
+the Free Software Foundation, either version 3 of the License, or
1602
+(at your option) any later version.
1603
+
1604
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1605
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1606
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1607
+GNU Lesser General Public License for more details.
1608
+
1609
+You should have received a copy of the GNU Lesser General Public License
1610
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1611
+ */
1612
+var lib_shape;
1613
+(function (lib_shape) {
1614
+    /**
1615
+     * @author fenris
1616
+     */
1617
+    function date_make({ "soft": soft = false, "mutable": mutable = true, "defaultvalue": defaultvalue = undefined, }) {
1618
+        if (defaultvalue === undefined) {
1619
+            defaultvalue = (soft ? null : (new Date(Date.now())));
1620
+        }
1621
+        return {
1622
+            "soft": soft,
1623
+            "mutable": mutable,
1624
+            "defaultvalue": defaultvalue,
1625
+        };
1626
+    }
1627
+    /**
1628
+     * @author fenris
1629
+     */
1630
+    function date_inspect(parameters, value, _inspect) {
1631
+        let inspection = lib_shape.inspection_create();
1632
+        if (value == undefined) {
1633
+            if (parameters.soft) {
1634
+                // all good
1635
+            }
1636
+            else {
1637
+                lib_shape.inspection_add(inspection, "null is not allowed");
1638
+            }
1639
+        }
1640
+        else {
1641
+            let jstype_actual = typeof (value);
1642
+            let jstype_expected = "object";
1643
+            if (jstype_actual === jstype_expected) {
1644
+                if (value instanceof Date) {
1645
+                    // all gode
1646
+                }
1647
+                else {
1648
+                    lib_shape.inspection_add(inspection, `value does not seem to be a date-instance`);
1649
+                }
1650
+            }
1651
+            else {
1652
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
1653
+            }
1654
+        }
1655
+        return inspection;
1656
+    }
1657
+    /**
1658
+     * @author fenris
1659
+     */
1660
+    function date_stance(parameters, bindings, _stance) {
1661
+        return {
1662
+            "name": "date",
1663
+            "parameters": parameters
1664
+        };
1665
+    }
1666
+    /**
1667
+     * @author fenris
1668
+     */
1669
+    function date_show(parameters, _show) {
1670
+        let str;
1671
+        // core
1672
+        {
1673
+            str = "date";
1674
+        }
1675
+        // soft
1676
+        {
1677
+            if (parameters.soft) {
1678
+                str = `~${str}`;
1679
+            }
1680
+        }
1681
+        return str;
1682
+    }
1683
+    /**
1684
+     * @author fenris
1685
+     */
1686
+    lib_shape.register({
1687
+        "name": "date",
1688
+        "make": date_make,
1689
+        "inspect": date_inspect,
1690
+        "stance": date_stance,
1691
+        "show": date_show,
1692
+    });
1693
+})(lib_shape || (lib_shape = {}));
1694
+/*
1695
+This file is part of »bacterio-plankton:shape«.
1696
+
1697
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1698
+<info@greenscale.de>
1699
+
1700
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1701
+it under the terms of the GNU Lesser General Public License as published by
1702
+the Free Software Foundation, either version 3 of the License, or
1703
+(at your option) any later version.
1704
+
1705
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1706
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1707
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1708
+GNU Lesser General Public License for more details.
1709
+
1710
+You should have received a copy of the GNU Lesser General Public License
1711
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1712
+ */
1713
+var lib_shape;
1714
+(function (lib_shape) {
1715
+    /**
1716
+     * @author fenris
1717
+     */
1718
+    function record_make({ "soft": soft = false, "mutable": mutable = true, "fields": fields = [], "defaultvalue": defaultvalue = undefined, }, _make) {
1719
+        let fields_ = (fields
1720
+            .map((field) => ({ "name": field.name, "shape": _make(field.shape) })));
1721
+        if (defaultvalue === undefined) {
1722
+            if (soft) {
1723
+                defaultvalue = null;
1724
+            }
1725
+            else {
1726
+                defaultvalue = {};
1727
+                fields_.forEach(field => {
1728
+                    defaultvalue[field.name] = field.shape.parameters["defaultvalue"];
1729
+                });
1730
+            }
1731
+        }
1732
+        return {
1733
+            "soft": soft,
1734
+            "mutable": mutable,
1735
+            "fields": fields_,
1736
+            "defaultvalue": defaultvalue,
1737
+        };
1738
+    }
1739
+    /**
1740
+     * @author fenris
1741
+     */
1742
+    function record_inspect(parameters, value, _inspect) {
1743
+        let inspection = lib_shape.inspection_create();
1744
+        if (value == undefined) {
1745
+            if (parameters.soft) {
1746
+                // all good
1747
+            }
1748
+            else {
1749
+                lib_shape.inspection_add(inspection, "null is not allowed");
1750
+            }
1751
+        }
1752
+        else {
1753
+            let jstype_actual = typeof (value);
1754
+            let jstype_expected = "object";
1755
+            if (jstype_actual === jstype_expected) {
1756
+                parameters.fields.forEach(field => {
1757
+                    let value_ = value[field.name];
1758
+                    lib_shape.inspection_extend(inspection, `field '${field.name}'`, _inspect(field.shape, value_));
1759
+                });
1760
+            }
1761
+            else {
1762
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
1763
+            }
1764
+        }
1765
+        return inspection;
1766
+    }
1767
+    /**
1768
+     * @author fenris
1769
+     */
1770
+    function record_stance(parameters, bindings, _stance) {
1771
+        return {
1772
+            "name": "record",
1773
+            "parameters": {
1774
+                "soft": parameters.soft,
1775
+                "fields": parameters.fields.map(field => {
1776
+                    return {
1777
+                        "name": field.name,
1778
+                        "shape": _stance(field.shape, bindings)
1779
+                    };
1780
+                })
1781
+            }
1782
+        };
1783
+    }
1784
+    /**
1785
+     * @author fenris
1786
+     */
1787
+    function record_show(parameters, _show) {
1788
+        let str;
1789
+        // core
1790
+        {
1791
+            str = "record";
1792
+        }
1793
+        // fields
1794
+        {
1795
+            str += ("<"
1796
+                +
1797
+                    parameters.fields.map(field => (field.name + ":" + _show(field.shape))).join(",")
1798
+                +
1799
+                    ">");
1800
+        }
1801
+        // soft
1802
+        {
1803
+            if (parameters.soft) {
1804
+                str = `~${str}`;
1805
+            }
1806
+        }
1807
+        return str;
1808
+    }
1809
+    /**
1810
+     * @author fenris
1811
+     */
1812
+    lib_shape.register({
1813
+        "name": "record",
1814
+        "make": record_make,
1815
+        "inspect": record_inspect,
1816
+        "stance": record_stance,
1817
+        "show": record_show,
1818
+    });
1819
+})(lib_shape || (lib_shape = {}));
1820
+/*
1821
+This file is part of »bacterio-plankton:shape«.
1822
+
1823
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1824
+<info@greenscale.de>
1825
+
1826
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1827
+it under the terms of the GNU Lesser General Public License as published by
1828
+the Free Software Foundation, either version 3 of the License, or
1829
+(at your option) any later version.
1830
+
1831
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1832
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1833
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1834
+GNU Lesser General Public License for more details.
1835
+
1836
+You should have received a copy of the GNU Lesser General Public License
1837
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1838
+ */
1839
+var lib_shape;
1840
+(function (lib_shape) {
1841
+    /**
1842
+     * @author fenris
1843
+     */
1844
+    function map_make({ "soft": soft = false, "mutable": mutable = true, "shape_key": shape_key, "shape_value": shape_value, "defaultvalue": defaultvalue = undefined, }, _make) {
1845
+        if (shape_key === undefined) {
1846
+            let message = `mandatory parameter 'shape_key' missing`;
1847
+            throw (new Error(message));
1848
+        }
1849
+        if (shape_value === undefined) {
1850
+            let message = `mandatory parameter 'shape_value' missing`;
1851
+            throw (new Error(message));
1852
+        }
1853
+        if (defaultvalue === undefined) {
1854
+            defaultvalue = (soft ? null : {});
1855
+        }
1856
+        return {
1857
+            "soft": soft,
1858
+            "mutable": mutable,
1859
+            "shape_key": _make(shape_key),
1860
+            "shape_value": _make(shape_value),
1861
+            "defaultvalue": defaultvalue,
1862
+        };
1863
+    }
1864
+    /**
1865
+     * @author fenris
1866
+     */
1867
+    function map_stance(parameters, bindings, _stance) {
1868
+        return {
1869
+            "name": "map",
1870
+            "parameters": {
1871
+                "soft": parameters.soft,
1872
+                "shape_key": _stance(parameters.shape_key, bindings),
1873
+                "shape_value": _stance(parameters.shape_value, bindings)
1874
+            }
1875
+        };
1876
+    }
1877
+    /**
1878
+     * @author fenris
1879
+     * @todo closer look not possible?
1880
+     */
1881
+    function map_inspect(parameters, value, _inspect) {
1882
+        let inspection = lib_shape.inspection_create();
1883
+        if (value == undefined) {
1884
+            if (parameters.soft) {
1885
+                // all good
1886
+            }
1887
+            else {
1888
+                lib_shape.inspection_add(inspection, "null is not allowed");
1889
+            }
1890
+        }
1891
+        else {
1892
+            let jstype_actual = typeof (value);
1893
+            let jstype_expected = "object";
1894
+            if (jstype_actual === jstype_expected) {
1895
+                Object.keys(value).forEach(key => {
1896
+                    lib_shape.inspection_extend(inspection, `key '${key}'`, _inspect(parameters.shape_key, key));
1897
+                    let value_ = value[key];
1898
+                    lib_shape.inspection_extend(inspection, `value for key '${key}'`, _inspect(parameters.shape_value, value_));
1899
+                });
1900
+            }
1901
+            else {
1902
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
1903
+            }
1904
+        }
1905
+        return inspection;
1906
+    }
1907
+    /**
1908
+     * @author fenris
1909
+     */
1910
+    function map_show(parameters, _show) {
1911
+        let str;
1912
+        // core
1913
+        {
1914
+            str = "map";
1915
+        }
1916
+        // in/out
1917
+        {
1918
+            str += ("<"
1919
+                +
1920
+                    [
1921
+                        _show(parameters.shape_key),
1922
+                        _show(parameters.shape_value),
1923
+                    ].join(",")
1924
+                +
1925
+                    ">");
1926
+        }
1927
+        // soft
1928
+        {
1929
+            if (parameters.soft) {
1930
+                str = `~${str}`;
1931
+            }
1932
+        }
1933
+        return str;
1934
+    }
1935
+    /**
1936
+     * @author fenris
1937
+     */
1938
+    lib_shape.register({
1939
+        "name": "map",
1940
+        "make": map_make,
1941
+        "inspect": map_inspect,
1942
+        "stance": map_stance,
1943
+        "show": map_show,
1944
+    });
1945
+})(lib_shape || (lib_shape = {}));
1946
+/*
1947
+This file is part of »bacterio-plankton:shape«.
1948
+
1949
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1950
+<info@greenscale.de>
1951
+
1952
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
1953
+it under the terms of the GNU Lesser General Public License as published by
1954
+the Free Software Foundation, either version 3 of the License, or
1955
+(at your option) any later version.
1956
+
1957
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
1958
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1959
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1960
+GNU Lesser General Public License for more details.
1961
+
1962
+You should have received a copy of the GNU Lesser General Public License
1963
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
1964
+ */
1965
+var lib_shape;
1966
+(function (lib_shape) {
1967
+    /**
1968
+     * @author fenris
1969
+     */
1970
+    function maybe_make({ "soft": soft = false, "shape_value": shape_value, "defaultvalue": defaultvalue = undefined, }, _make) {
1971
+        if (shape_value === undefined) {
1972
+            let message = `mandatory parameter 'shape_value' missing`;
1973
+            throw (new Error(message));
1974
+        }
1975
+        if (defaultvalue === undefined) {
1976
+            defaultvalue = (soft ? null : { "kind": "nothing" });
1977
+        }
1978
+        return {
1979
+            "soft": soft,
1980
+            "shape_value": _make(shape_value),
1981
+            "defaultvalue": defaultvalue,
1982
+        };
1983
+    }
1984
+    /**
1985
+     * @author fenris
1986
+     */
1987
+    function maybe_inspect(parameters, value, _inspect) {
1988
+        let inspection = lib_shape.inspection_create();
1989
+        if (value == undefined) {
1990
+            if (parameters.soft) {
1991
+                // all good
1992
+            }
1993
+            else {
1994
+                lib_shape.inspection_add(inspection, "null is not allowed");
1995
+            }
1996
+        }
1997
+        else {
1998
+            let jstype_actual = typeof (value);
1999
+            let jstype_expected = "object";
2000
+            if (jstype_actual === jstype_expected) {
2001
+                if ("kind" in value) {
2002
+                    // all good?
2003
+                }
2004
+                else {
2005
+                    lib_shape.inspection_add(inspection, `field 'kind' missing`);
2006
+                }
2007
+            }
2008
+            else {
2009
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
2010
+            }
2011
+        }
2012
+        return inspection;
2013
+    }
2014
+    /**
2015
+     * @author fenris
2016
+     */
2017
+    function maybe_stance(parameters, bindings, _stance) {
2018
+        return {
2019
+            "name": "maybe",
2020
+            "parameters": {
2021
+                "soft": parameters.soft,
2022
+                "shape_value": _stance(parameters.shape_value, bindings)
2023
+            }
2024
+        };
2025
+    }
2026
+    /**
2027
+     * @author fenris
2028
+     */
2029
+    function maybe_show(parameters, _show) {
2030
+        let str;
2031
+        // core
2032
+        {
2033
+            str = "maybe";
2034
+        }
2035
+        // shape_value
2036
+        {
2037
+            str += ("<"
2038
+                +
2039
+                    _show(parameters.shape_value)
2040
+                +
2041
+                    ">");
2042
+        }
2043
+        // soft
2044
+        {
2045
+            if (parameters.soft) {
2046
+                str = `~${str}`;
2047
+            }
2048
+        }
2049
+        return str;
2050
+    }
2051
+    /**
2052
+     * @author fenris
2053
+     */
2054
+    lib_shape.register({
2055
+        "name": "maybe",
2056
+        "make": maybe_make,
2057
+        "inspect": maybe_inspect,
2058
+        "stance": maybe_stance,
2059
+        "show": maybe_show,
2060
+    });
2061
+})(lib_shape || (lib_shape = {}));
2062
+/*
2063
+This file is part of »bacterio-plankton:shape«.
2064
+
2065
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2066
+<info@greenscale.de>
2067
+
2068
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
2069
+it under the terms of the GNU Lesser General Public License as published by
2070
+the Free Software Foundation, either version 3 of the License, or
2071
+(at your option) any later version.
2072
+
2073
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
2074
+but WITHOUT ANY WARRANTY; without even the implied warranty of
2075
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2076
+GNU Lesser General Public License for more details.
2077
+
2078
+You should have received a copy of the GNU Lesser General Public License
2079
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
2080
+ */
2081
+var lib_shape;
2082
+(function (lib_shape) {
2083
+    /**
2084
+     * @author fenris
2085
+     */
2086
+    function promise_make({ "soft": soft = false, "shape_result": shape_result, "shape_reason": shape_reason, "defaultvalue": defaultvalue = undefined, }, _make) {
2087
+        if (shape_result === undefined) {
2088
+            let message = `mandatory parameter 'shape_result' missing`;
2089
+            throw (new Error(message));
2090
+        }
2091
+        if (shape_reason === undefined) {
2092
+            let message = `mandatory parameter 'shape_reason' missing`;
2093
+            throw (new Error(message));
2094
+        }
2095
+        if (defaultvalue === undefined) {
2096
+            defaultvalue = (soft ? null : Promise.resolve(null));
2097
+        }
2098
+        return {
2099
+            "soft": soft,
2100
+            "shape_result": _make(shape_result),
2101
+            "shape_reason": _make(shape_reason),
2102
+            "defaultvalue": defaultvalue,
2103
+        };
2104
+    }
2105
+    /**
2106
+     * @author fenris
2107
+     */
2108
+    function promise_stance(parameters, bindings, _stance) {
2109
+        return {
2110
+            "name": "promise",
2111
+            "parameters": {
2112
+                "soft": parameters.soft,
2113
+                "shape_result": _stance(parameters.shape_result, bindings),
2114
+                "shape_reason": _stance(parameters.shape_reason, bindings)
2115
+            }
2116
+        };
2117
+    }
2118
+    /**
2119
+     * @author fenris
2120
+     * @todo closer look not possible?
2121
+     */
2122
+    function promise_inspect(parameters, value, _inspect) {
2123
+        let inspection = lib_shape.inspection_create();
2124
+        if (value == undefined) {
2125
+            if (parameters.soft) {
2126
+                // all good
2127
+            }
2128
+            else {
2129
+                lib_shape.inspection_add(inspection, "null is not allowed");
2130
+            }
2131
+        }
2132
+        else {
2133
+            let jstype_actual = typeof (value);
2134
+            let jstype_expected = "object";
2135
+            if (jstype_actual === jstype_expected) {
2136
+                if (value instanceof Promise /*<any, any>*/) {
2137
+                    // all good?
2138
+                }
2139
+                else {
2140
+                    lib_shape.inspection_add(inspection, `values is not an Promise-instance`);
2141
+                }
2142
+            }
2143
+            else {
2144
+                lib_shape.inspection_add(inspection, `expected JS-type '${jstype_expected}' but got '${jstype_actual}'`);
2145
+            }
2146
+        }
2147
+        return inspection;
2148
+    }
2149
+    /**
2150
+     * @author fenris
2151
+     */
2152
+    function promise_show(parameters, _show) {
2153
+        let str;
2154
+        // core
2155
+        {
2156
+            str = "promise";
2157
+        }
2158
+        // in/out
2159
+        {
2160
+            str += ("<"
2161
+                +
2162
+                    [
2163
+                        _show(parameters.shape_result),
2164
+                        _show(parameters.shape_reason),
2165
+                    ].join(",")
2166
+                +
2167
+                    ">");
2168
+        }
2169
+        // soft
2170
+        {
2171
+            if (parameters.soft) {
2172
+                str = `~${str}`;
2173
+            }
2174
+        }
2175
+        return str;
2176
+    }
2177
+    /**
2178
+     * @author fenris
2179
+     */
2180
+    lib_shape.register({
2181
+        "name": "promise",
2182
+        "make": promise_make,
2183
+        "inspect": promise_inspect,
2184
+        "stance": promise_stance,
2185
+        "show": promise_show,
2186
+    });
2187
+})(lib_shape || (lib_shape = {}));
2188
+/*
2189
+This file is part of »bacterio-plankton:shape«.
2190
+
2191
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2192
+<info@greenscale.de>
2193
+
2194
+»bacterio-plankton:shape« is free software: you can redistribute it and/or modify
2195
+it under the terms of the GNU Lesser General Public License as published by
2196
+the Free Software Foundation, either version 3 of the License, or
2197
+(at your option) any later version.
2198
+
2199
+»bacterio-plankton:shape« is distributed in the hope that it will be useful,
2200
+but WITHOUT ANY WARRANTY; without even the implied warranty of
2201
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2202
+GNU Lesser General Public License for more details.
2203
+
2204
+You should have received a copy of the GNU Lesser General Public License
2205
+along with »bacterio-plankton:shape«. If not, see <http://www.gnu.org/licenses/>.
2206
+ */
2207
+var lib_shape;
2208
+(function (lib_shape) {
2209
+    /**
2210
+     * @author fenris
2211
+     * @todo use a treemap-function (but first make one :P)
2212
+     */
2213
+    function adjust_labels(shape, transformator) {
2214
+        if (false) {
2215
+        }
2216
+        else if (shape.name === "enumeration") {
2217
+            return {
2218
+                "name": "enumeration",
2219
+                "parameters": {
2220
+                    "soft": shape.parameters["soft"],
2221
+                    "shape_option": adjust_labels(shape.parameters["shape_option"], transformator),
2222
+                    "options": shape.parameters["options"].map(option => {
2223
+                        return {
2224
+                            "value": option.value,
2225
+                            "label": transformator(option.label),
2226
+                        };
2227
+                    }),
2228
+                    "defaultvalue": shape.parameters["defaultvalue"],
2229
+                }
2230
+            };
2231
+        }
2232
+        else if (shape.name === "array") {
2233
+            return {
2234
+                "name": "array",
2235
+                "parameters": {
2236
+                    "soft": shape.parameters["soft"],
2237
+                    "shape_element": adjust_labels(shape.parameters["shape_element"], transformator),
2238
+                    "defaultvalue": shape.parameters["defaultvalue"],
2239
+                }
2240
+            };
2241
+        }
2242
+        else if (shape.name === "record") {
2243
+            return {
2244
+                "name": "record",
2245
+                "parameters": {
2246
+                    "soft": shape.parameters["soft"],
2247
+                    "fields": shape.parameters["fields"].map(field => {
2248
+                        return {
2249
+                            "name": field.name,
2250
+                            "shape": adjust_labels(field.shape, transformator),
2251
+                            "label": transformator(field.label),
2252
+                        };
2253
+                    }),
2254
+                    "defaultvalue": shape.parameters["defaultvalue"],
2255
+                }
2256
+            };
2257
+        }
2258
+        // lil' hacky …
2259
+        else {
2260
+            // shape["label"] = ((shape["label"] == null) ? null : transformator(shape["label"]));
2261
+            return shape;
2262
+        }
2263
+    }
2264
+    lib_shape.adjust_labels = adjust_labels;
2265
+    /**
2266
+     * @author fenris
2267
+     */
2268
+    function register_(id, factory) {
2269
+        const message = "not implemented; dummy impl";
2270
+        console.warn(message);
2271
+    }
2272
+    lib_shape.register_ = register_;
2273
+    /**
2274
+     * @author fenris
2275
+     */
2276
+    function retrieve_(id) {
2277
+        const message = "not implemented; returning dummy";
2278
+        console.warn(message);
2279
+        return { "name": "any" };
2280
+    }
2281
+    lib_shape.retrieve_ = retrieve_;
2282
+})(lib_shape || (lib_shape = {}));
... ...
@@ -0,0 +1,861 @@
1
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2
+<info@greenscale.de>
3
+
4
+»bacterio-plankton:string« is free software: you can redistribute it and/or modify
5
+it under the terms of the GNU Lesser General Public License as published by
6
+the Free Software Foundation, either version 3 of the License, or
7
+(at your option) any later version.
8
+
9
+»bacterio-plankton:string« is distributed in the hope that it will be useful,
10
+but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+GNU Lesser General Public License for more details.
13
+
14
+You should have received a copy of the GNU Lesser General Public License
15
+along with »bacterio-plankton:string«. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+
18
+
19
+                    GNU GENERAL PUBLIC LICENSE
20
+                       Version 3, 29 June 2007
21
+
22
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
23
+ Everyone is permitted to copy and distribute verbatim copies
24
+ of this license document, but changing it is not allowed.
25
+
26
+                            Preamble
27
+
28
+  The GNU General Public License is a free, copyleft license for
29
+software and other kinds of works.
30
+
31
+  The licenses for most software and other practical works are designed
32
+to take away your freedom to share and change the works.  By contrast,
33
+the GNU General Public License is intended to guarantee your freedom to
34
+share and change all versions of a program--to make sure it remains free
35
+software for all its users.  We, the Free Software Foundation, use the
36
+GNU General Public License for most of our software; it applies also to
37
+any other work released this way by its authors.  You can apply it to
38
+your programs, too.
39
+
40
+  When we speak of free software, we are referring to freedom, not
41
+price.  Our General Public Licenses are designed to make sure that you
42
+have the freedom to distribute copies of free software (and charge for
43
+them if you wish), that you receive source code or can get it if you
44
+want it, that you can change the software or use pieces of it in new
45
+free programs, and that you know you can do these things.
46
+
47
+  To protect your rights, we need to prevent others from denying you
48
+these rights or asking you to surrender the rights.  Therefore, you have
49
+certain responsibilities if you distribute copies of the software, or if
50
+you modify it: responsibilities to respect the freedom of others.
51
+
52
+  For example, if you distribute copies of such a program, whether
53
+gratis or for a fee, you must pass on to the recipients the same
54
+freedoms that you received.  You must make sure that they, too, receive
55
+or can get the source code.  And you must show them these terms so they
56
+know their rights.
57
+
58
+  Developers that use the GNU GPL protect your rights with two steps:
59
+(1) assert copyright on the software, and (2) offer you this License
60
+giving you legal permission to copy, distribute and/or modify it.
61
+
62
+  For the developers' and authors' protection, the GPL clearly explains
63
+that there is no warranty for this free software.  For both users' and
64
+authors' sake, the GPL requires that modified versions be marked as
65
+changed, so that their problems will not be attributed erroneously to
66
+authors of previous versions.
67
+
68
+  Some devices are designed to deny users access to install or run
69
+modified versions of the software inside them, although the manufacturer
70
+can do so.  This is fundamentally incompatible with the aim of
71
+protecting users' freedom to change the software.  The systematic
72
+pattern of such abuse occurs in the area of products for individuals to
73
+use, which is precisely where it is most unacceptable.  Therefore, we
74
+have designed this version of the GPL to prohibit the practice for those
75
+products.  If such problems arise substantially in other domains, we
76
+stand ready to extend this provision to those domains in future versions
77
+of the GPL, as needed to protect the freedom of users.
78
+
79
+  Finally, every program is threatened constantly by software patents.
80
+States should not allow patents to restrict development and use of
81
+software on general-purpose computers, but in those that do, we wish to
82
+avoid the special danger that patents applied to a free program could
83
+make it effectively proprietary.  To prevent this, the GPL assures that
84
+patents cannot be used to render the program non-free.
85
+
86
+  The precise terms and conditions for copying, distribution and
87
+modification follow.
88
+
89
+                       TERMS AND CONDITIONS
90
+
91
+  0. Definitions.
92
+
93
+  "This License" refers to version 3 of the GNU General Public License.
94
+
95
+  "Copyright" also means copyright-like laws that apply to other kinds of
96
+works, such as semiconductor masks.
97
+
98
+  "The Program" refers to any copyrightable work licensed under this
99
+License.  Each licensee is addressed as "you".  "Licensees" and
100
+"recipients" may be individuals or organizations.
101
+
102
+  To "modify" a work means to copy from or adapt all or part of the work
103
+in a fashion requiring copyright permission, other than the making of an
104
+exact copy.  The resulting work is called a "modified version" of the
105
+earlier work or a work "based on" the earlier work.
106
+
107
+  A "covered work" means either the unmodified Program or a work based
108
+on the Program.
109
+
110
+  To "propagate" a work means to do anything with it that, without
111
+permission, would make you directly or secondarily liable for
112
+infringement under applicable copyright law, except executing it on a
113
+computer or modifying a private copy.  Propagation includes copying,
114
+distribution (with or without modification), making available to the
115
+public, and in some countries other activities as well.
116
+
117
+  To "convey" a work means any kind of propagation that enables other
118
+parties to make or receive copies.  Mere interaction with a user through
119
+a computer network, with no transfer of a copy, is not conveying.
120
+
121
+  An interactive user interface displays "Appropriate Legal Notices"
122
+to the extent that it includes a convenient and prominently visible
123
+feature that (1) displays an appropriate copyright notice, and (2)
124
+tells the user that there is no warranty for the work (except to the
125
+extent that warranties are provided), that licensees may convey the
126
+work under this License, and how to view a copy of this License.  If
127
+the interface presents a list of user commands or options, such as a
128
+menu, a prominent item in the list meets this criterion.
129
+
130
+  1. Source Code.
131
+
132
+  The "source code" for a work means the preferred form of the work
133
+for making modifications to it.  "Object code" means any non-source
134
+form of a work.
135
+
136
+  A "Standard Interface" means an interface that either is an official
137
+standard defined by a recognized standards body, or, in the case of
138
+interfaces specified for a particular programming language, one that
139
+is widely used among developers working in that language.
140
+
141
+  The "System Libraries" of an executable work include anything, other
142
+than the work as a whole, that (a) is included in the normal form of
143
+packaging a Major Component, but which is not part of that Major
144
+Component, and (b) serves only to enable use of the work with that
145
+Major Component, or to implement a Standard Interface for which an
146
+implementation is available to the public in source code form.  A
147
+"Major Component", in this context, means a major essential component
148
+(kernel, window system, and so on) of the specific operating system
149
+(if any) on which the executable work runs, or a compiler used to
150
+produce the work, or an object code interpreter used to run it.
151
+
152
+  The "Corresponding Source" for a work in object code form means all
153
+the source code needed to generate, install, and (for an executable
154
+work) run the object code and to modify the work, including scripts to
155
+control those activities.  However, it does not include the work's
156
+System Libraries, or general-purpose tools or generally available free
157
+programs which are used unmodified in performing those activities but
158
+which are not part of the work.  For example, Corresponding Source
159
+includes interface definition files associated with source files for
160
+the work, and the source code for shared libraries and dynamically
161
+linked subprograms that the work is specifically designed to require,
162
+such as by intimate data communication or control flow between those
163
+subprograms and other parts of the work.
164
+
165
+  The Corresponding Source need not include anything that users
166
+can regenerate automatically from other parts of the Corresponding
167
+Source.
168
+
169
+  The Corresponding Source for a work in source code form is that
170
+same work.
171
+
172
+  2. Basic Permissions.
173
+
174
+  All rights granted under this License are granted for the term of
175
+copyright on the Program, and are irrevocable provided the stated
176
+conditions are met.  This License explicitly affirms your unlimited
177
+permission to run the unmodified Program.  The output from running a
178
+covered work is covered by this License only if the output, given its
179
+content, constitutes a covered work.  This License acknowledges your
180
+rights of fair use or other equivalent, as provided by copyright law.
181
+
182
+  You may make, run and propagate covered works that you do not
183
+convey, without conditions so long as your license otherwise remains
184
+in force.  You may convey covered works to others for the sole purpose
185
+of having them make modifications exclusively for you, or provide you
186
+with facilities for running those works, provided that you comply with
187
+the terms of this License in conveying all material for which you do
188
+not control copyright.  Those thus making or running the covered works
189
+for you must do so exclusively on your behalf, under your direction
190
+and control, on terms that prohibit them from making any copies of
191
+your copyrighted material outside their relationship with you.
192
+
193
+  Conveying under any other circumstances is permitted solely under
194
+the conditions stated below.  Sublicensing is not allowed; section 10
195
+makes it unnecessary.
196
+
197
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
198
+
199
+  No covered work shall be deemed part of an effective technological
200
+measure under any applicable law fulfilling obligations under article
201
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
202
+similar laws prohibiting or restricting circumvention of such
203
+measures.
204
+
205
+  When you convey a covered work, you waive any legal power to forbid
206
+circumvention of technological measures to the extent such circumvention
207
+is effected by exercising rights under this License with respect to
208
+the covered work, and you disclaim any intention to limit operation or
209
+modification of the work as a means of enforcing, against the work's
210
+users, your or third parties' legal rights to forbid circumvention of
211
+technological measures.
212
+
213
+  4. Conveying Verbatim Copies.
214
+
215
+  You may convey verbatim copies of the Program's source code as you
216
+receive it, in any medium, provided that you conspicuously and
217
+appropriately publish on each copy an appropriate copyright notice;
218
+keep intact all notices stating that this License and any
219
+non-permissive terms added in accord with section 7 apply to the code;
220
+keep intact all notices of the absence of any warranty; and give all
221
+recipients a copy of this License along with the Program.
222
+
223
+  You may charge any price or no price for each copy that you convey,
224
+and you may offer support or warranty protection for a fee.
225
+
226
+  5. Conveying Modified Source Versions.
227
+
228
+  You may convey a work based on the Program, or the modifications to
229
+produce it from the Program, in the form of source code under the
230
+terms of section 4, provided that you also meet all of these conditions:
231
+
232
+    a) The work must carry prominent notices stating that you modified
233
+    it, and giving a relevant date.
234
+
235
+    b) The work must carry prominent notices stating that it is
236
+    released under this License and any conditions added under section
237
+    7.  This requirement modifies the requirement in section 4 to
238
+    "keep intact all notices".
239
+
240
+    c) You must license the entire work, as a whole, under this
241
+    License to anyone who comes into possession of a copy.  This
242
+    License will therefore apply, along with any applicable section 7
243
+    additional terms, to the whole of the work, and all its parts,
244
+    regardless of how they are packaged.  This License gives no
245
+    permission to license the work in any other way, but it does not
246
+    invalidate such permission if you have separately received it.
247
+
248
+    d) If the work has interactive user interfaces, each must display
249
+    Appropriate Legal Notices; however, if the Program has interactive
250
+    interfaces that do not display Appropriate Legal Notices, your
251
+    work need not make them do so.
252
+
253
+  A compilation of a covered work with other separate and independent
254
+works, which are not by their nature extensions of the covered work,
255
+and which are not combined with it such as to form a larger program,
256
+in or on a volume of a storage or distribution medium, is called an
257
+"aggregate" if the compilation and its resulting copyright are not
258
+used to limit the access or legal rights of the compilation's users
259
+beyond what the individual works permit.  Inclusion of a covered work
260
+in an aggregate does not cause this License to apply to the other
261
+parts of the aggregate.
262
+
263
+  6. Conveying Non-Source Forms.
264
+
265
+  You may convey a covered work in object code form under the terms
266
+of sections 4 and 5, provided that you also convey the
267
+machine-readable Corresponding Source under the terms of this License,
268
+in one of these ways:
269
+
270
+    a) Convey the object code in, or embodied in, a physical product
271
+    (including a physical distribution medium), accompanied by the
272
+    Corresponding Source fixed on a durable physical medium
273
+    customarily used for software interchange.
274
+
275
+    b) Convey the object code in, or embodied in, a physical product
276
+    (including a physical distribution medium), accompanied by a
277
+    written offer, valid for at least three years and valid for as
278
+    long as you offer spare parts or customer support for that product
279
+    model, to give anyone who possesses the object code either (1) a
280
+    copy of the Corresponding Source for all the software in the
281
+    product that is covered by this License, on a durable physical
282
+    medium customarily used for software interchange, for a price no
283
+    more than your reasonable cost of physically performing this
284
+    conveying of source, or (2) access to copy the
285
+    Corresponding Source from a network server at no charge.
286
+
287
+    c) Convey individual copies of the object code with a copy of the
288
+    written offer to provide the Corresponding Source.  This
289
+    alternative is allowed only occasionally and noncommercially, and
290
+    only if you received the object code with such an offer, in accord
291
+    with subsection 6b.
292
+
293
+    d) Convey the object code by offering access from a designated
294
+    place (gratis or for a charge), and offer equivalent access to the
295
+    Corresponding Source in the same way through the same place at no
296
+    further charge.  You need not require recipients to copy the
297
+    Corresponding Source along with the object code.  If the place to
298
+    copy the object code is a network server, the Corresponding Source
299
+    may be on a different server (operated by you or a third party)
300
+    that supports equivalent copying facilities, provided you maintain
301
+    clear directions next to the object code saying where to find the
302
+    Corresponding Source.  Regardless of what server hosts the
303
+    Corresponding Source, you remain obligated to ensure that it is
304
+    available for as long as needed to satisfy these requirements.
305
+
306
+    e) Convey the object code using peer-to-peer transmission, provided
307
+    you inform other peers where the object code and Corresponding
308
+    Source of the work are being offered to the general public at no
309
+    charge under subsection 6d.
310
+
311
+  A separable portion of the object code, whose source code is excluded
312
+from the Corresponding Source as a System Library, need not be
313
+included in conveying the object code work.
314
+
315
+  A "User Product" is either (1) a "consumer product", which means any
316
+tangible personal property which is normally used for personal, family,
317
+or household purposes, or (2) anything designed or sold for incorporation
318
+into a dwelling.  In determining whether a product is a consumer product,
319
+doubtful cases shall be resolved in favor of coverage.  For a particular
320
+product received by a particular user, "normally used" refers to a
321
+typical or common use of that class of product, regardless of the status
322
+of the particular user or of the way in which the particular user
323
+actually uses, or expects or is expected to use, the product.  A product
324
+is a consumer product regardless of whether the product has substantial
325
+commercial, industrial or non-consumer uses, unless such uses represent
326
+the only significant mode of use of the product.
327
+
328
+  "Installation Information" for a User Product means any methods,
329
+procedures, authorization keys, or other information required to install
330
+and execute modified versions of a covered work in that User Product from
331
+a modified version of its Corresponding Source.  The information must
332
+suffice to ensure that the continued functioning of the modified object
333
+code is in no case prevented or interfered with solely because
334
+modification has been made.
335
+
336
+  If you convey an object code work under this section in, or with, or
337
+specifically for use in, a User Product, and the conveying occurs as
338
+part of a transaction in which the right of possession and use of the
339
+User Product is transferred to the recipient in perpetuity or for a
340
+fixed term (regardless of how the transaction is characterized), the
341
+Corresponding Source conveyed under this section must be accompanied
342
+by the Installation Information.  But this requirement does not apply
343
+if neither you nor any third party retains the ability to install
344
+modified object code on the User Product (for example, the work has
345
+been installed in ROM).
346
+
347
+  The requirement to provide Installation Information does not include a
348
+requirement to continue to provide support service, warranty, or updates
349
+for a work that has been modified or installed by the recipient, or for
350
+the User Product in which it has been modified or installed.  Access to a
351
+network may be denied when the modification itself materially and
352
+adversely affects the operation of the network or violates the rules and
353
+protocols for communication across the network.
354
+
355
+  Corresponding Source conveyed, and Installation Information provided,
356
+in accord with this section must be in a format that is publicly
357
+documented (and with an implementation available to the public in
358
+source code form), and must require no special password or key for
359
+unpacking, reading or copying.
360
+
361
+  7. Additional Terms.
362
+
363
+  "Additional permissions" are terms that supplement the terms of this
364
+License by making exceptions from one or more of its conditions.
365
+Additional permissions that are applicable to the entire Program shall
366
+be treated as though they were included in this License, to the extent
367
+that they are valid under applicable law.  If additional permissions
368
+apply only to part of the Program, that part may be used separately
369
+under those permissions, but the entire Program remains governed by
370
+this License without regard to the additional permissions.
371
+
372
+  When you convey a copy of a covered work, you may at your option
373
+remove any additional permissions from that copy, or from any part of
374
+it.  (Additional permissions may be written to require their own
375
+removal in certain cases when you modify the work.)  You may place
376
+additional permissions on material, added by you to a covered work,
377
+for which you have or can give appropriate copyright permission.
378
+
379
+  Notwithstanding any other provision of this License, for material you
380
+add to a covered work, you may (if authorized by the copyright holders of
381
+that material) supplement the terms of this License with terms:
382
+
383
+    a) Disclaiming warranty or limiting liability differently from the
384
+    terms of sections 15 and 16 of this License; or
385
+
386
+    b) Requiring preservation of specified reasonable legal notices or
387
+    author attributions in that material or in the Appropriate Legal
388
+    Notices displayed by works containing it; or
389
+
390
+    c) Prohibiting misrepresentation of the origin of that material, or
391
+    requiring that modified versions of such material be marked in
392
+    reasonable ways as different from the original version; or
393
+
394
+    d) Limiting the use for publicity purposes of names of licensors or
395
+    authors of the material; or
396
+
397
+    e) Declining to grant rights under trademark law for use of some
398
+    trade names, trademarks, or service marks; or
399
+
400
+    f) Requiring indemnification of licensors and authors of that
401
+    material by anyone who conveys the material (or modified versions of
402
+    it) with contractual assumptions of liability to the recipient, for
403
+    any liability that these contractual assumptions directly impose on
404
+    those licensors and authors.
405
+
406
+  All other non-permissive additional terms are considered "further
407
+restrictions" within the meaning of section 10.  If the Program as you
408
+received it, or any part of it, contains a notice stating that it is
409
+governed by this License along with a term that is a further
410
+restriction, you may remove that term.  If a license document contains
411
+a further restriction but permits relicensing or conveying under this
412
+License, you may add to a covered work material governed by the terms
413
+of that license document, provided that the further restriction does
414
+not survive such relicensing or conveying.
415
+
416
+  If you add terms to a covered work in accord with this section, you
417
+must place, in the relevant source files, a statement of the
418
+additional terms that apply to those files, or a notice indicating
419
+where to find the applicable terms.
420
+
421
+  Additional terms, permissive or non-permissive, may be stated in the
422
+form of a separately written license, or stated as exceptions;
423
+the above requirements apply either way.
424
+
425
+  8. Termination.
426
+
427
+  You may not propagate or modify a covered work except as expressly
428
+provided under this License.  Any attempt otherwise to propagate or
429
+modify it is void, and will automatically terminate your rights under
430
+this License (including any patent licenses granted under the third
431
+paragraph of section 11).
432
+
433
+  However, if you cease all violation of this License, then your
434
+license from a particular copyright holder is reinstated (a)
435
+provisionally, unless and until the copyright holder explicitly and
436
+finally terminates your license, and (b) permanently, if the copyright
437
+holder fails to notify you of the violation by some reasonable means
438
+prior to 60 days after the cessation.
439
+
440
+  Moreover, your license from a particular copyright holder is
441
+reinstated permanently if the copyright holder notifies you of the
442
+violation by some reasonable means, this is the first time you have
443
+received notice of violation of this License (for any work) from that
444
+copyright holder, and you cure the violation prior to 30 days after
445
+your receipt of the notice.
446
+
447
+  Termination of your rights under this section does not terminate the
448
+licenses of parties who have received copies or rights from you under
449
+this License.  If your rights have been terminated and not permanently
450
+reinstated, you do not qualify to receive new licenses for the same
451
+material under section 10.
452
+
453
+  9. Acceptance Not Required for Having Copies.
454
+
455
+  You are not required to accept this License in order to receive or
456
+run a copy of the Program.  Ancillary propagation of a covered work
457
+occurring solely as a consequence of using peer-to-peer transmission
458
+to receive a copy likewise does not require acceptance.  However,
459
+nothing other than this License grants you permission to propagate or
460
+modify any covered work.  These actions infringe copyright if you do
461
+not accept this License.  Therefore, by modifying or propagating a
462
+covered work, you indicate your acceptance of this License to do so.
463
+
464
+  10. Automatic Licensing of Downstream Recipients.
465
+
466
+  Each time you convey a covered work, the recipient automatically
467
+receives a license from the original licensors, to run, modify and
468
+propagate that work, subject to this License.  You are not responsible
469
+for enforcing compliance by third parties with this License.
470
+
471
+  An "entity transaction" is a transaction transferring control of an
472
+organization, or substantially all assets of one, or subdividing an
473
+organization, or merging organizations.  If propagation of a covered
474
+work results from an entity transaction, each party to that
475
+transaction who receives a copy of the work also receives whatever
476
+licenses to the work the party's predecessor in interest had or could
477
+give under the previous paragraph, plus a right to possession of the
478
+Corresponding Source of the work from the predecessor in interest, if
479
+the predecessor has it or can get it with reasonable efforts.
480
+
481
+  You may not impose any further restrictions on the exercise of the
482
+rights granted or affirmed under this License.  For example, you may
483
+not impose a license fee, royalty, or other charge for exercise of
484
+rights granted under this License, and you may not initiate litigation
485
+(including a cross-claim or counterclaim in a lawsuit) alleging that
486
+any patent claim is infringed by making, using, selling, offering for
487
+sale, or importing the Program or any portion of it.
488
+
489
+  11. Patents.
490
+
491
+  A "contributor" is a copyright holder who authorizes use under this
492
+License of the Program or a work on which the Program is based.  The
493
+work thus licensed is called the contributor's "contributor version".
494
+
495
+  A contributor's "essential patent claims" are all patent claims
496
+owned or controlled by the contributor, whether already acquired or
497
+hereafter acquired, that would be infringed by some manner, permitted
498
+by this License, of making, using, or selling its contributor version,
499
+but do not include claims that would be infringed only as a
500
+consequence of further modification of the contributor version.  For
501
+purposes of this definition, "control" includes the right to grant
502
+patent sublicenses in a manner consistent with the requirements of
503
+this License.
504
+
505
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
506
+patent license under the contributor's essential patent claims, to
507
+make, use, sell, offer for sale, import and otherwise run, modify and
508
+propagate the contents of its contributor version.
509
+
510
+  In the following three paragraphs, a "patent license" is any express
511
+agreement or commitment, however denominated, not to enforce a patent
512
+(such as an express permission to practice a patent or covenant not to
513
+sue for patent infringement).  To "grant" such a patent license to a
514
+party means to make such an agreement or commitment not to enforce a
515
+patent against the party.
516
+
517
+  If you convey a covered work, knowingly relying on a patent license,
518
+and the Corresponding Source of the work is not available for anyone
519
+to copy, free of charge and under the terms of this License, through a
520
+publicly available network server or other readily accessible means,
521
+then you must either (1) cause the Corresponding Source to be so
522
+available, or (2) arrange to deprive yourself of the benefit of the
523
+patent license for this particular work, or (3) arrange, in a manner
524
+consistent with the requirements of this License, to extend the patent
525
+license to downstream recipients.  "Knowingly relying" means you have
526
+actual knowledge that, but for the patent license, your conveying the
527
+covered work in a country, or your recipient's use of the covered work
528
+in a country, would infringe one or more identifiable patents in that
529
+country that you have reason to believe are valid.
530
+
531
+  If, pursuant to or in connection with a single transaction or
532
+arrangement, you convey, or propagate by procuring conveyance of, a
533
+covered work, and grant a patent license to some of the parties
534
+receiving the covered work authorizing them to use, propagate, modify
535
+or convey a specific copy of the covered work, then the patent license
536
+you grant is automatically extended to all recipients of the covered
537
+work and works based on it.
538
+
539
+  A patent license is "discriminatory" if it does not include within
540
+the scope of its coverage, prohibits the exercise of, or is
541
+conditioned on the non-exercise of one or more of the rights that are
542
+specifically granted under this License.  You may not convey a covered
543
+work if you are a party to an arrangement with a third party that is
544
+in the business of distributing software, under which you make payment
545
+to the third party based on the extent of your activity of conveying
546
+the work, and under which the third party grants, to any of the
547
+parties who would receive the covered work from you, a discriminatory
548
+patent license (a) in connection with copies of the covered work
549
+conveyed by you (or copies made from those copies), or (b) primarily
550
+for and in connection with specific products or compilations that
551
+contain the covered work, unless you entered into that arrangement,
552
+or that patent license was granted, prior to 28 March 2007.
553
+
554
+  Nothing in this License shall be construed as excluding or limiting
555
+any implied license or other defenses to infringement that may
556
+otherwise be available to you under applicable patent law.
557
+
558
+  12. No Surrender of Others' Freedom.
559
+
560
+  If conditions are imposed on you (whether by court order, agreement or
561
+otherwise) that contradict the conditions of this License, they do not
562
+excuse you from the conditions of this License.  If you cannot convey a
563
+covered work so as to satisfy simultaneously your obligations under this
564
+License and any other pertinent obligations, then as a consequence you may
565
+not convey it at all.  For example, if you agree to terms that obligate you
566
+to collect a royalty for further conveying from those to whom you convey
567
+the Program, the only way you could satisfy both those terms and this
568
+License would be to refrain entirely from conveying the Program.
569
+
570
+  13. Use with the GNU Affero General Public License.
571
+
572
+  Notwithstanding any other provision of this License, you have
573
+permission to link or combine any covered work with a work licensed
574
+under version 3 of the GNU Affero General Public License into a single
575
+combined work, and to convey the resulting work.  The terms of this
576
+License will continue to apply to the part which is the covered work,
577
+but the special requirements of the GNU Affero General Public License,
578
+section 13, concerning interaction through a network will apply to the
579
+combination as such.
580
+
581
+  14. Revised Versions of this License.
582
+
583
+  The Free Software Foundation may publish revised and/or new versions of
584
+the GNU General Public License from time to time.  Such new versions will
585
+be similar in spirit to the present version, but may differ in detail to
586
+address new problems or concerns.
587
+
588
+  Each version is given a distinguishing version number.  If the
589
+Program specifies that a certain numbered version of the GNU General
590
+Public License "or any later version" applies to it, you have the
591
+option of following the terms and conditions either of that numbered
592
+version or of any later version published by the Free Software
593
+Foundation.  If the Program does not specify a version number of the
594
+GNU General Public License, you may choose any version ever published
595
+by the Free Software Foundation.
596
+
597
+  If the Program specifies that a proxy can decide which future
598
+versions of the GNU General Public License can be used, that proxy's
599
+public statement of acceptance of a version permanently authorizes you
600
+to choose that version for the Program.
601
+
602
+  Later license versions may give you additional or different
603
+permissions.  However, no additional obligations are imposed on any
604
+author or copyright holder as a result of your choosing to follow a
605
+later version.
606
+
607
+  15. Disclaimer of Warranty.
608
+
609
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
610
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
611
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
612
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
613
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
614
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
615
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
616
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
617
+
618
+  16. Limitation of Liability.
619
+
620
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
621
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
622
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
623
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
624
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
625
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
626
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
627
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
628
+SUCH DAMAGES.
629
+
630
+  17. Interpretation of Sections 15 and 16.
631
+
632
+  If the disclaimer of warranty and limitation of liability provided
633
+above cannot be given local legal effect according to their terms,
634
+reviewing courts shall apply local law that most closely approximates
635
+an absolute waiver of all civil liability in connection with the
636
+Program, unless a warranty or assumption of liability accompanies a
637
+copy of the Program in return for a fee.
638
+
639
+                     END OF TERMS AND CONDITIONS
640
+
641
+            How to Apply These Terms to Your New Programs
642
+
643
+  If you develop a new program, and you want it to be of the greatest
644
+possible use to the public, the best way to achieve this is to make it
645
+free software which everyone can redistribute and change under these terms.
646
+
647
+  To do so, attach the following notices to the program.  It is safest
648
+to attach them to the start of each source file to most effectively
649
+state the exclusion of warranty; and each file should have at least
650
+the "copyright" line and a pointer to where the full notice is found.
651
+
652
+    <one line to give the program's name and a brief idea of what it does.>
653
+    Copyright (C) <year>  <name of author>
654
+
655
+    This program is free software: you can redistribute it and/or modify
656
+    it under the terms of the GNU General Public License as published by
657
+    the Free Software Foundation, either version 3 of the License, or
658
+    (at your option) any later version.
659
+
660
+    This program is distributed in the hope that it will be useful,
661
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
662
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
663
+    GNU General Public License for more details.
664
+
665
+    You should have received a copy of the GNU General Public License
666
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
667
+
668
+Also add information on how to contact you by electronic and paper mail.
669
+
670
+  If the program does terminal interaction, make it output a short
671
+notice like this when it starts in an interactive mode:
672
+
673
+    <program>  Copyright (C) <year>  <name of author>
674
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
675
+    This is free software, and you are welcome to redistribute it
676
+    under certain conditions; type `show c' for details.
677
+
678
+The hypothetical commands `show w' and `show c' should show the appropriate
679
+parts of the General Public License.  Of course, your program's commands
680
+might be different; for a GUI interface, you would use an "about box".
681
+
682
+  You should also get your employer (if you work as a programmer) or school,
683
+if any, to sign a "copyright disclaimer" for the program, if necessary.
684
+For more information on this, and how to apply and follow the GNU GPL, see
685
+<https://www.gnu.org/licenses/>.
686
+
687
+  The GNU General Public License does not permit incorporating your program
688
+into proprietary programs.  If your program is a subroutine library, you
689
+may consider it more useful to permit linking proprietary applications with
690
+the library.  If this is what you want to do, use the GNU Lesser General
691
+Public License instead of this License.  But first, please read
692
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
693
+
694
+
695
+
696
+                   GNU LESSER GENERAL PUBLIC LICENSE
697
+                       Version 3, 29 June 2007
698
+
699
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
700
+ Everyone is permitted to copy and distribute verbatim copies
701
+ of this license document, but changing it is not allowed.
702
+
703
+
704
+  This version of the GNU Lesser General Public License incorporates
705
+the terms and conditions of version 3 of the GNU General Public
706
+License, supplemented by the additional permissions listed below.
707
+
708
+  0. Additional Definitions.
709
+
710
+  As used herein, "this License" refers to version 3 of the GNU Lesser
711
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
712
+General Public License.
713
+
714
+  "The Library" refers to a covered work governed by this License,
715
+other than an Application or a Combined Work as defined below.
716
+
717
+  An "Application" is any work that makes use of an interface provided
718
+by the Library, but which is not otherwise based on the Library.
719
+Defining a subclass of a class defined by the Library is deemed a mode
720
+of using an interface provided by the Library.
721
+
722
+  A "Combined Work" is a work produced by combining or linking an
723
+Application with the Library.  The particular version of the Library
724
+with which the Combined Work was made is also called the "Linked
725
+Version".
726
+
727
+  The "Minimal Corresponding Source" for a Combined Work means the
728
+Corresponding Source for the Combined Work, excluding any source code
729
+for portions of the Combined Work that, considered in isolation, are
730
+based on the Application, and not on the Linked Version.
731
+
732
+  The "Corresponding Application Code" for a Combined Work means the
733
+object code and/or source code for the Application, including any data
734
+and utility programs needed for reproducing the Combined Work from the
735
+Application, but excluding the System Libraries of the Combined Work.
736
+
737
+  1. Exception to Section 3 of the GNU GPL.
738
+
739
+  You may convey a covered work under sections 3 and 4 of this License
740
+without being bound by section 3 of the GNU GPL.
741
+
742
+  2. Conveying Modified Versions.
743
+
744
+  If you modify a copy of the Library, and, in your modifications, a
745
+facility refers to a function or data to be supplied by an Application
746
+that uses the facility (other than as an argument passed when the
747
+facility is invoked), then you may convey a copy of the modified
748
+version:
749
+
750
+   a) under this License, provided that you make a good faith effort to
751
+   ensure that, in the event an Application does not supply the
752
+   function or data, the facility still operates, and performs
753
+   whatever part of its purpose remains meaningful, or
754
+
755
+   b) under the GNU GPL, with none of the additional permissions of
756
+   this License applicable to that copy.
757
+
758
+  3. Object Code Incorporating Material from Library Header Files.
759
+
760
+  The object code form of an Application may incorporate material from
761
+a header file that is part of the Library.  You may convey such object
762
+code under terms of your choice, provided that, if the incorporated
763
+material is not limited to numerical parameters, data structure
764
+layouts and accessors, or small macros, inline functions and templates
765
+(ten or fewer lines in length), you do both of the following:
766
+
767
+   a) Give prominent notice with each copy of the object code that the
768
+   Library is used in it and that the Library and its use are
769
+   covered by this License.
770
+
771
+   b) Accompany the object code with a copy of the GNU GPL and this license
772
+   document.
773
+
774
+  4. Combined Works.
775
+
776
+  You may convey a Combined Work under terms of your choice that,
777
+taken together, effectively do not restrict modification of the
778
+portions of the Library contained in the Combined Work and reverse
779
+engineering for debugging such modifications, if you also do each of
780
+the following:
781
+
782
+   a) Give prominent notice with each copy of the Combined Work that
783
+   the Library is used in it and that the Library and its use are
784
+   covered by this License.
785
+
786
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
787
+   document.
788
+
789
+   c) For a Combined Work that displays copyright notices during
790
+   execution, include the copyright notice for the Library among
791
+   these notices, as well as a reference directing the user to the
792
+   copies of the GNU GPL and this license document.
793
+
794
+   d) Do one of the following:
795
+
796
+       0) Convey the Minimal Corresponding Source under the terms of this
797
+       License, and the Corresponding Application Code in a form
798
+       suitable for, and under terms that permit, the user to
799
+       recombine or relink the Application with a modified version of
800
+       the Linked Version to produce a modified Combined Work, in the
801
+       manner specified by section 6 of the GNU GPL for conveying
802
+       Corresponding Source.
803
+
804
+       1) Use a suitable shared library mechanism for linking with the
805
+       Library.  A suitable mechanism is one that (a) uses at run time
806
+       a copy of the Library already present on the user's computer
807
+       system, and (b) will operate properly with a modified version
808
+       of the Library that is interface-compatible with the Linked
809
+       Version.
810
+
811
+   e) Provide Installation Information, but only if you would otherwise
812
+   be required to provide such information under section 6 of the
813
+   GNU GPL, and only to the extent that such information is
814
+   necessary to install and execute a modified version of the
815
+   Combined Work produced by recombining or relinking the
816
+   Application with a modified version of the Linked Version. (If
817
+   you use option 4d0, the Installation Information must accompany
818
+   the Minimal Corresponding Source and Corresponding Application
819
+   Code. If you use option 4d1, you must provide the Installation
820
+   Information in the manner specified by section 6 of the GNU GPL
821
+   for conveying Corresponding Source.)
822
+
823
+  5. Combined Libraries.
824
+
825
+  You may place library facilities that are a work based on the
826
+Library side by side in a single library together with other library
827
+facilities that are not Applications and are not covered by this
828
+License, and convey such a combined library under terms of your
829
+choice, if you do both of the following:
830
+
831
+   a) Accompany the combined library with a copy of the same work based
832
+   on the Library, uncombined with any other library facilities,
833
+   conveyed under the terms of this License.
834
+
835
+   b) Give prominent notice with the combined library that part of it
836
+   is a work based on the Library, and explaining where to find the
837
+   accompanying uncombined form of the same work.
838
+
839
+  6. Revised Versions of the GNU Lesser General Public License.
840
+
841
+  The Free Software Foundation may publish revised and/or new versions
842
+of the GNU Lesser General Public License from time to time. Such new
843
+versions will be similar in spirit to the present version, but may
844
+differ in detail to address new problems or concerns.
845
+
846
+  Each version is given a distinguishing version number. If the
847
+Library as you received it specifies that a certain numbered version
848
+of the GNU Lesser General Public License "or any later version"
849
+applies to it, you have the option of following the terms and
850
+conditions either of that published version or of any later version
851
+published by the Free Software Foundation. If the Library as you
852
+received it does not specify a version number of the GNU Lesser
853
+General Public License, you may choose any version of the GNU Lesser
854
+General Public License ever published by the Free Software Foundation.
855
+
856
+  If the Library as you received it specifies that a proxy can decide
857
+whether future versions of the GNU Lesser General Public License shall
858
+apply, that proxy's public statement of acceptance of any version is
859
+permanent authorization for you to choose that version for the
860
+Library.
861
+
... ...
@@ -0,0 +1,144 @@
1
+declare var plain_text_to_html: (text: string) => string;
2
+/**
3
+ * @desc makes a valid
4
+ */
5
+declare var format_sentence: (str: string, rtl?: boolean, caseSense?: boolean) => string;
6
+declare var fill_string_template: (template_string: string, object: any, fabric: Function, delimiter: string, default_string: string, sloppy: boolean) => string;
7
+declare var make_string_template: (_template: string, _fabrics?: Object) => (object: {
8
+    [key: string]: string;
9
+}) => string;
10
+declare var make_eml_header: (object: {
11
+    [key: string]: string;
12
+}) => string;
13
+declare var make_eml_body: Object;
14
+declare module lib_string {
15
+    /**
16
+     * @author neuc,frac
17
+     */
18
+    function empty(str: string): boolean;
19
+    /**
20
+     * @desc returns a unique string
21
+     * @param {string} prefix an optional prefix for the generated string
22
+     * @return {string}
23
+     * @author fenris
24
+     */
25
+    function generate(prefix?: string): string;
26
+    /**
27
+     * @desc splits a string, but returns an empty list, if the string is empty
28
+     * @param {string} chain
29
+     * @param {string} separator
30
+     * @return {Array<string>}
31
+     * @author fenris
32
+     */
33
+    function split(chain: string, separator?: string): Array<string>;
34
+    /**
35
+     * @author neu3no
36
+     */
37
+    function explode(str: string, needle: string, max: int): Array<string>;
38
+    /**
39
+     * @desc concats a given word with itself n times
40
+     * @param {string} word
41
+     * @param {int}
42
+     * @return {string}
43
+     * @author fenris
44
+     */
45
+    function repeat(word: string, count: int): string;
46
+    /**
47
+     * @desc lengthens a string by repeatedly appending or prepending another string
48
+     * @param {string} word the string to pad
49
+     * @param {int} length the length, which the result shall have
50
+     * @param {string} symbol the string, which will be added (multiple times)
51
+     * @param {boolean} [prepend]; whether to prepend (~true) or append (~false); default: false
52
+     * @return {string} the padded string
53
+     * @author fenris
54
+     */
55
+    function pad(word: string, length: int, symbol?: string, mode?: string): string;
56
+    /**
57
+     * @desc checks if a given string conttains a certain substring
58
+     * @param {string} string
59
+     * @param {string} part
60
+     * @return {boolean}
61
+     * @author fenris
62
+     */
63
+    function contains(chain: string, part: string): boolean;
64
+    /**
65
+     * @desc checks if a given string starts with a certain substring
66
+     * @param {string} string
67
+     * @param {string} part
68
+     * @return {boolean}
69
+     * @author fenris
70
+     */
71
+    function startsWith(chain: string, part: string): boolean;
72
+    /**
73
+     * @desc checks if a given string ends with a certain substring
74
+     * @param {string} string
75
+     * @param {string} part
76
+     * @return {boolean}
77
+     * @author fenris
78
+     */
79
+    function endsWith(chain: string, part: string): boolean;
80
+    /**
81
+     * @desc count the occourrences of a string in a string
82
+     * @param string haystack_string the string wich should be examined
83
+     * @param string needle_string the string which should be counted
84
+     * @author neuc
85
+     */
86
+    function count_occourrences(haystack_string: string, needle_string: string, check_escape: boolean): int;
87
+    /**
88
+     * @desc replaces occurences of "${name}" in a string by the corresponding values of an argument object
89
+     * @author fenris
90
+     */
91
+    function coin(str: string, args: {
92
+        [id: string]: string;
93
+    }): string;
94
+    /**
95
+     * @author fenris
96
+     */
97
+    var stance: typeof coin;
98
+    /**
99
+     * @author fenris
100
+     */
101
+    function url_encode({ "protocol": protocol, "host": host, "port": port, "path": path, "arguments": arguments_, }?: {
102
+        protocol?: string;
103
+        host?: string;
104
+        port?: int;
105
+        path?: string;
106
+        arguments?: {
107
+            [key: string]: string;
108
+        };
109
+    }): string;
110
+    /**
111
+     * @author fenris
112
+     */
113
+    var make_url: typeof url_encode;
114
+    /**
115
+     * @author fenris
116
+     * @todo arguments
117
+     */
118
+    function url_decode(url: string): Object;
119
+    /**
120
+     * @author fenris
121
+     */
122
+    function cut(str: string, length: int, delimiter?: string): string;
123
+}
124
+declare module lib_string {
125
+    /**
126
+     * an implementation of c sprintf
127
+     * @param {string} string format string
128
+     * @param {array} args arguments which should be filled into
129
+     * @returns {string}
130
+     */
131
+    var sprintf: (input: string, args?: any[], original?: any) => string;
132
+    /**
133
+     * an implementation of c printf
134
+     * @param {string} string format string
135
+     * @param {array} args arguments which should be filled into
136
+     * @returns {string}
137
+     */
138
+    function printf(format: any, args: any): void;
139
+}
140
+declare var sprintf: (input: string, args?: any[], original?: any) => string;
141
+declare var printf: typeof lib_string.printf;
142
+declare var eml_log: any;
143
+declare var track_exports: any;
144
+declare var make_logger: (prefix: any, current_loglevel: any) => (obj: any, lvl: any) => void;
... ...
@@ -0,0 +1,906 @@
1
+/*
2
+This file is part of »bacterio-plankton:string«.
3
+
4
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5
+<info@greenscale.de>
6
+
7
+»bacterio-plankton:string« is free software: you can redistribute it and/or modify
8
+it under the terms of the GNU Lesser General Public License as published by
9
+the Free Software Foundation, either version 3 of the License, or
10
+(at your option) any later version.
11
+
12
+»bacterio-plankton:string« is distributed in the hope that it will be useful,
13
+but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+GNU Lesser General Public License for more details.
16
+
17
+You should have received a copy of the GNU Lesser General Public License
18
+along with »bacterio-plankton:string«. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+var plain_text_to_html = function (text) {
21
+    var ret = text;
22
+    ret = ret.replace(/  /g, "&nbsp;&nbsp;"); // convert multiple whitespace to forced ones
23
+    ret = ret.split("\n").join("<br/>");
24
+    return ret;
25
+};
26
+/**
27
+ * @desc makes a valid
28
+ */
29
+var format_sentence = function (str, rtl, caseSense) {
30
+    if (rtl === void 0) { rtl = false; }
31
+    if (caseSense === void 0) { caseSense = true; }
32
+    if (str === "") {
33
+        return str;
34
+    }
35
+    else {
36
+        var marks = {
37
+            ".": true,
38
+            "?": true,
39
+            "!": true
40
+        };
41
+        var default_mark = ".";
42
+        var ret = str.split("");
43
+        if (!rtl) {
44
+            ret[0] = ret[0].toLocaleUpperCase();
45
+            if (!(ret[ret.length - 1] in marks)) {
46
+                ret.push(default_mark);
47
+            }
48
+        }
49
+        else {
50
+            ret[ret.length - 1] = ret[ret.length - 1].toLocaleUpperCase();
51
+            if (!(ret[0] in marks)) {
52
+                ret.unshift(default_mark);
53
+            }
54
+        }
55
+        return ret.join("");
56
+    }
57
+};
58
+var fill_string_template = function (template_string, object, fabric, delimiter, default_string, sloppy) {
59
+    if (fabric === void 0) { fabric = function (object, key) { return object[key]; }; }
60
+    if (delimiter === void 0) { delimiter = "%"; }
61
+    if (default_string === void 0) { default_string = null; }
62
+    function get_tags(str) {
63
+        var r = new RegExp(delimiter + "[^\\s^" + delimiter + "]+" + delimiter, "gi");
64
+        return ((str.match(r) || []).map(function (e) {
65
+            return e.slice(delimiter.length, e.length - delimiter.length);
66
+        }));
67
+    }
68
+    function replace_tag(str, tag, value) {
69
+        var r = new RegExp(delimiter + tag + delimiter, "gi");
70
+        return str.replace(r, value);
71
+    }
72
+    function replace_tags(str, obj) {
73
+        return (get_tags(str).reduce(function (ret, key) {
74
+            var value = "";
75
+            try {
76
+                value = fabric(obj, key);
77
+                if ((!sloppy && (value === void 0)) || (sloppy && (value == void 0))) {
78
+                    value = default_string;
79
+                }
80
+            }
81
+            catch (e) {
82
+                console.warn("invalid placeholder " + key);
83
+                value = default_string;
84
+            }
85
+            return replace_tag(ret, key, value);
86
+        }, str));
87
+    }
88
+    return replace_tags(template_string, object);
89
+};
90
+var make_string_template = function (_template, _fabrics) {
91
+    if (_fabrics === void 0) { _fabrics = {}; }
92
+    function replace_tag(str, tag, value) {
93
+        var r = new RegExp("%" + tag + "%", "gi");
94
+        return str.replace(r, value);
95
+    }
96
+    function replace_tags(str, obj) {
97
+        return (Object.keys(obj).reduce(function (ret, key) {
98
+            return replace_tag(ret, key, _fabrics[key] || obj[key]);
99
+        }, str));
100
+    }
101
+    return (function (tags) {
102
+        return replace_tags(_template, tags);
103
+    });
104
+};
105
+var make_eml_header = (function () {
106
+    var _template = "";
107
+    _template += "From: %from%\n";
108
+    _template += "To: %recipient%\n";
109
+    _template += "Subject: %subject%\n";
110
+    _template += "X-Mailer: greenscale-plankton.emlgen\n";
111
+    return make_string_template(_template);
112
+})();
113
+var make_eml_body = (function () {
114
+    var exports = {};
115
+    exports["simple_body"] = make_string_template("Content-Type: %contenttype%\n\n%body%\n\n");
116
+    // very basic implementation
117
+    // parts = [{contenttype:"text/html; charset=UTF-8", body: "<h1>foo</h1>" }, {...}]
118
+    exports["body_boundrary"] = function (parts, boundrary) {
119
+        var _template = "";
120
+        _template += "--%boundrary%\n";
121
+        _template += "Content-Type: %contenttype%\n\n%body%\n\n";
122
+        //_template += "--%boundrary%--\n\n";
123
+        var maker = make_string_template(_template);
124
+        return (parts.reduce(function (prev, curr) {
125
+            curr.boundrary = boundrary;
126
+            return [prev, maker(curr)].join("");
127
+        }, ""));
128
+    };
129
+    // body must be base64 encoded!
130
+    exports["attachment_boundrary"] = function (parts, boundrary) {
131
+        var _template = "";
132
+        _template += "--%boundrary%\n";
133
+        _template += "Content-Type: %contenttype%\n";
134
+        _template += "Content-Transfer-Encoding: base64\n";
135
+        _template += "Content-Disposition: %disposition%; filename=\"%name%\"\n\n";
136
+        _template += "%body%\n\n";
137
+        //_template += "--%boundrary%--\n\n";
138
+        var maker = make_string_template(_template);
139
+        return (parts.reduce(function (prev, curr) {
140
+            curr.boundrary = boundrary;
141
+            if (curr.disposition === void 0)
142
+                curr.disposition = "inline";
143
+            return [prev, maker(curr)].join("");
144
+        }, ""));
145
+    };
146
+    exports["gen_boundrary"] = function () {
147
+        return ("xxxxxxxxxxxxxxxxxxxxxx".replace(/[xy]/g, function (c) {
148
+            var r = crypto.getRandomValues(new Uint8Array(1))[0] % 16 | 0, v = c == "x" ? r : (r & 0x3 | 0x8);
149
+            return v.toString(16);
150
+        }));
151
+    };
152
+    // simple implementation without alternatives (old rfc)
153
+    exports["complete_boundrary"] = function (bodyparts, attachments) {
154
+        var ret = "";
155
+        var boundrary = exports["gen_boundrary"]();
156
+        ret += exports["body_boundrary"](bodyparts, boundrary);
157
+        ret += exports["attachment_boundrary"](attachments, boundrary);
158
+        ret += "--" + boundrary + "--\n\nINVISIBLE!!!!";
159
+        return (exports["simple_body"]({
160
+            "contenttype": sprintf("multipart/mixed; boundary=%s", [boundrary]),
161
+            "body": ret
162
+        }));
163
+    };
164
+    return exports;
165
+})();
166
+/*
167
+This file is part of »bacterio-plankton:string«.
168
+
169
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
170
+<info@greenscale.de>
171
+
172
+»bacterio-plankton:string« is free software: you can redistribute it and/or modify
173
+it under the terms of the GNU Lesser General Public License as published by
174
+the Free Software Foundation, either version 3 of the License, or
175
+(at your option) any later version.
176
+
177
+»bacterio-plankton:string« is distributed in the hope that it will be useful,
178
+but WITHOUT ANY WARRANTY; without even the implied warranty of
179
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
180
+GNU Lesser General Public License for more details.
181
+
182
+You should have received a copy of the GNU Lesser General Public License
183
+along with »bacterio-plankton:string«. If not, see <http://www.gnu.org/licenses/>.
184
+ */
185
+var lib_string;
186
+(function (lib_string) {
187
+    /**
188
+     * @author fenris
189
+     */
190
+    var hexdigits = 4;
191
+    /**
192
+     * @author fenris
193
+     */
194
+    var index_max = (1 << (4 * hexdigits));
195
+    /**
196
+     * @author fenris
197
+     */
198
+    var index_is = 0;
199
+    /**
200
+     * @author neuc,frac
201
+     */
202
+    function empty(str) {
203
+        return (str.trim() === "");
204
+    }
205
+    lib_string.empty = empty;
206
+    /**
207
+     * @desc returns a unique string
208
+     * @param {string} prefix an optional prefix for the generated string
209
+     * @return {string}
210
+     * @author fenris
211
+     */
212
+    function generate(prefix) {
213
+        if (prefix === void 0) { prefix = "string_"; }
214
+        if (index_is > index_max) {
215
+            throw (new Error("[string_generate] out of valid indices"));
216
+        }
217
+        else {
218
+            return lib_string.sprintf(prefix + "%0" + hexdigits.toString() + "X", [index_is++]);
219
+        }
220
+    }
221
+    lib_string.generate = generate;
222
+    /**
223
+     * @desc splits a string, but returns an empty list, if the string is empty
224
+     * @param {string} chain
225
+     * @param {string} separator
226
+     * @return {Array<string>}
227
+     * @author fenris
228
+     */
229
+    function split(chain, separator) {
230
+        if (separator === void 0) { separator = " "; }
231
+        if (chain.length == 0) {
232
+            return [];
233
+        }
234
+        else {
235
+            return chain.split(separator);
236
+        }
237
+    }
238
+    lib_string.split = split;
239
+    /**
240
+     * @author neu3no
241
+     */
242
+    function explode(str, needle, max) {
243
+        var temp = str.split(needle);
244
+        var right = temp.splice(max - 1);
245
+        temp.push(right.join(needle));
246
+        return temp;
247
+    }
248
+    lib_string.explode = explode;
249
+    /**
250
+     * @desc concats a given word with itself n times
251
+     * @param {string} word
252
+     * @param {int}
253
+     * @return {string}
254
+     * @author fenris
255
+     */
256
+    function repeat(word, count) {
257
+        // return ((count == 0) ? "" : (word + repeat(word, count-1)));
258
+        var result = "";
259
+        for (var n = 0; n < count; n += 1) {
260
+            result += word;
261
+        }
262
+        return result;
263
+    }
264
+    lib_string.repeat = repeat;
265
+    /**
266
+     * @desc lengthens a string by repeatedly appending or prepending another string
267
+     * @param {string} word the string to pad
268
+     * @param {int} length the length, which the result shall have
269
+     * @param {string} symbol the string, which will be added (multiple times)
270
+     * @param {boolean} [prepend]; whether to prepend (~true) or append (~false); default: false
271
+     * @return {string} the padded string
272
+     * @author fenris
273
+     */
274
+    function pad(word, length, symbol, mode) {
275
+        if (symbol === void 0) { symbol = " "; }
276
+        if (mode === void 0) { mode = "append"; }
277
+        switch (mode) {
278
+            case "prepend": {
279
+                // insert symbols only at the beginning
280
+                while (word.length < length)
281
+                    word = symbol + word;
282
+                return word.substring(word.length - length);
283
+                break;
284
+            }
285
+            case "append": {
286
+                // insert symbols only at the end
287
+                while (word.length < length)
288
+                    word = word + symbol;
289
+                return word.substring(0, length);
290
+                break;
291
+            }
292
+            case "widen": {
293
+                // insert symbols at both sides
294
+                var left = (((length - word.length) & 1) === 0);
295
+                while (word.length < length) {
296
+                    word = (left
297
+                        ? (symbol + word)
298
+                        : (word + symbol));
299
+                    left = (!left);
300
+                }
301
+                return word.substring(0, length);
302
+                break;
303
+            }
304
+            default: {
305
+                var message = ("unhandled mode '" + mode + "'");
306
+                console.warn(message);
307
+                return word;
308
+                break;
309
+            }
310
+        }
311
+    }
312
+    lib_string.pad = pad;
313
+    /**
314
+     * @desc checks if a given string conttains a certain substring
315
+     * @param {string} string
316
+     * @param {string} part
317
+     * @return {boolean}
318
+     * @author fenris
319
+     */
320
+    function contains(chain, part) {
321
+        if (typeof (chain) !== "string") {
322
+            return false;
323
+        }
324
+        return (chain.indexOf(part) >= 0);
325
+    }
326
+    lib_string.contains = contains;
327
+    /**
328
+     * @desc checks if a given string starts with a certain substring
329
+     * @param {string} string
330
+     * @param {string} part
331
+     * @return {boolean}
332
+     * @author fenris
333
+     */
334
+    function startsWith(chain, part) {
335
+        if (typeof (chain) !== "string") {
336
+            return false;
337
+        }
338
+        // return (string.indexOf(part) === 0);
339
+        return ((function (m, n) {
340
+            if (n === 0) {
341
+                return true;
342
+            }
343
+            else {
344
+                if (m === 0) {
345
+                    return false;
346
+                }
347
+                else {
348
+                    return ((chain[0] == part[0])
349
+                        &&
350
+                            startsWith(chain.substring(1), part.substring(1)));
351
+                }
352
+            }
353
+        })(chain.length, part.length));
354
+    }
355
+    lib_string.startsWith = startsWith;
356
+    /**
357
+     * @desc checks if a given string ends with a certain substring
358
+     * @param {string} string
359
+     * @param {string} part
360
+     * @return {boolean}
361
+     * @author fenris
362
+     */
363
+    function endsWith(chain, part) {
364
+        if (typeof (chain) !== "string") {
365
+            return false;
366
+        }
367
+        // return (string.lastIndexOf(part) === string.length-part.length);
368
+        return ((function (m, n) {
369
+            if (n === 0) {
370
+                return true;
371
+            }
372
+            else {
373
+                if (m === 0) {
374
+                    return false;
375
+                }
376
+                else {
377
+                    // console.info(("(" + string[m-1] + " == " + part[n-1] + ")") + " = " + String(string[m-1] == part[n-1]));
378
+                    return ((chain[m - 1] === part[n - 1])
379
+                        &&
380
+                            endsWith(chain.substring(0, m - 1), part.substring(0, n - 1)));
381
+                }
382
+            }
383
+        })(chain.length, part.length));
384
+    }
385
+    lib_string.endsWith = endsWith;
386
+    /**
387
+     * @desc count the occourrences of a string in a string
388
+     * @param string haystack_string the string wich should be examined
389
+     * @param string needle_string the string which should be counted
390
+     * @author neuc
391
+     */
392
+    function count_occourrences(haystack_string, needle_string, check_escape) {
393
+        var cnt = 0;
394
+        var pos = -1;
395
+        do {
396
+            pos = haystack_string.indexOf(needle_string, pos + 1);
397
+            if ((!check_escape) || (haystack_string[pos - 1] != "\\")) {
398
+                cnt++;
399
+            }
400
+        } while (pos >= 0);
401
+        return (cnt - 1);
402
+    }
403
+    lib_string.count_occourrences = count_occourrences;
404
+    /**
405
+     * @desc replaces occurences of "${name}" in a string by the corresponding values of an argument object
406
+     * @author fenris
407
+     */
408
+    function coin(str, args) {
409
+        Object.keys(args).forEach(function (key) {
410
+            // old syntax
411
+            {
412
+                var value = args[key];
413
+                var regexp_argument = new RegExp("\\${" + key + "}");
414
+                str = str.replace(regexp_argument, value);
415
+            }
416
+            // new syntax
417
+            {
418
+                var value = args[key];
419
+                var regexp_argument = new RegExp("{{" + key + "}}");
420
+                str = str.replace(regexp_argument, value);
421
+            }
422
+        });
423
+        return str;
424
+    }
425
+    lib_string.coin = coin;
426
+    /**
427
+     * @author fenris
428
+     */
429
+    lib_string.stance = coin;
430
+    /**
431
+     * @author fenris
432
+     */
433
+    function url_encode(_a) {
434
+        var _b = _a === void 0 ? {} : _a, _c = _b["protocol"], protocol = _c === void 0 ? null : _c, _d = _b["host"], host = _d === void 0 ? null : _d, _e = _b["port"], port = _e === void 0 ? null : _e, _f = _b["path"], path = _f === void 0 ? null : _f, _g = _b["arguments"], arguments_ = _g === void 0 ? null : _g;
435
+        var url = "";
436
+        // protocol
437
+        {
438
+            if (protocol != null) {
439
+                url = protocol + ":" + url;
440
+            }
441
+        }
442
+        // host
443
+        {
444
+            if (host != null) {
445
+                url = url + "//" + host;
446
+            }
447
+        }
448
+        // port
449
+        {
450
+            if (port != null) {
451
+                url = url + ":" + port.toString();
452
+            }
453
+        }
454
+        // path
455
+        {
456
+            if (path != null) {
457
+                var path_ = encodeURI(path);
458
+                url = "" + url + path_;
459
+            }
460
+        }
461
+        // arguments
462
+        {
463
+            if (arguments_ != null) {
464
+                var suffix = Object.keys(arguments_).map(function (key) { return key + "=" + arguments_[key]; }).join("&");
465
+                var suffix_ = encodeURI(suffix);
466
+                url = url + "?" + suffix_;
467
+            }
468
+        }
469
+        return url;
470
+    }
471
+    lib_string.url_encode = url_encode;
472
+    /**
473
+     * @author fenris
474
+     */
475
+    lib_string.make_url = url_encode;
476
+    /**
477
+     * @author fenris
478
+     * @todo arguments
479
+     */
480
+    function url_decode(url) {
481
+        var regexp = new RegExp("^([^:]*)://([^:]*):([^/]*)/(.*)$");
482
+        var matching = regexp.exec(url);
483
+        if (matching === null) {
484
+            return null;
485
+        }
486
+        else {
487
+            var components = {
488
+                "protocol": matching[1],
489
+                "host": matching[2],
490
+                "port": parseInt(matching[3]),
491
+                "path": ("/" + matching[4])
492
+            };
493
+            return components;
494
+        }
495
+    }
496
+    lib_string.url_decode = url_decode;
497
+    /**
498
+     * @author fenris
499
+     */
500
+    function cut(str, length, delimiter) {
501
+        if (delimiter === void 0) { delimiter = "…"; }
502
+        if (str.length <= length) {
503
+            return str;
504
+        }
505
+        else {
506
+            return (str.slice(0, length - delimiter.length) + delimiter);
507
+        }
508
+    }
509
+    lib_string.cut = cut;
510
+})(lib_string || (lib_string = {}));
511
+/*
512
+This file is part of »bacterio-plankton:string«.
513
+
514
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
515
+<info@greenscale.de>
516
+
517
+»bacterio-plankton:string« is free software: you can redistribute it and/or modify
518
+it under the terms of the GNU Lesser General Public License as published by
519
+the Free Software Foundation, either version 3 of the License, or
520
+(at your option) any later version.
521
+
522
+»bacterio-plankton:string« is distributed in the hope that it will be useful,
523
+but WITHOUT ANY WARRANTY; without even the implied warranty of
524
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
525
+GNU Lesser General Public License for more details.
526
+
527
+You should have received a copy of the GNU Lesser General Public License
528
+along with »bacterio-plankton:string«. If not, see <http://www.gnu.org/licenses/>.
529
+ */
530
+var lib_string;
531
+(function (lib_string) {
532
+    var pattern = /%([-+#0 ]*)([0-9]*)[\.]{0,1}([0-9]*)([\w]{1})/;
533
+    var gpattern = /%([-+#0 ]*)([0-9]*)[\.]{0,1}([0-9]*)([\w]{1})/g;
534
+    function split_format(format) {
535
+        var tmp = format.match(pattern);
536
+        if (tmp === null)
537
+            return null;
538
+        return {
539
+            'flags': tmp[1].split(""),
540
+            'width': Number(tmp[2]),
541
+            'precision': tmp[3] === '' ? null : Number(tmp[3]),
542
+            'specifier': tmp[4],
543
+            'string': format
544
+        };
545
+    }
546
+    function make_err(format, arg, should) {
547
+        return ("[sprintf]" + " " + "argument for '" + format.string + "' has to be '" + should + "' but '" + arg + "' is '" + typeof arg + "'!");
548
+    }
549
+    function test_arg(format, arg, should) {
550
+        if (typeof arg !== should) {
551
+            console.warn(make_err(format, arg, should));
552
+            return false;
553
+        }
554
+        return true;
555
+    }
556
+    function string_fill(str, char, len, left) {
557
+        while (str.length < len) {
558
+            if (left) {
559
+                str += char;
560
+            }
561
+            else {
562
+                str = char + str;
563
+            }
564
+        }
565
+        return str;
566
+    }
567
+    /**
568
+     * the known_parameters are used to parse the different identifiers for the welln known syntax:
569
+     *          flag   width   precision   identifier
570
+     *      %{[0#+- ]}{[0-9]*}.{[0-9]*}[fFdiueEgGsoxXaAsn]
571
+     * flags:
572
+     * 0    -   fill with '0' instead of ' ' if the string length < width
573
+     * #    -   not implemented
574
+     * -    -   left-justified -> fill on the right side to reach width
575
+     * +    -   force using '+' on positive numbers
576
+     * ' '  -   add a single space before positive numbers
577
+     *
578
+     * identifiers
579
+     * %f, %F       -   interpret given number as float, width: the minimal total width (fill with ' ' or '0' if the
580
+     *                  resulting string is too short, precision: cut more then given decimal places
581
+     * %d, %i, %u   -   interpret number as integer, decimal places will be cut. width: like float, precision:
582
+     *                  fill with '0' on right side until length given in precision is reached
583
+     * %e           -   interpret as float and write as scientifical number, width & precision like in float
584
+     * %E           -   same es %e but uppercase 'E'
585
+     * %g           -   use the shortest string of %f or %e
586
+     * %G           -   use the shortest string of %E or %E
587
+     * %s           -   simply print a string
588
+     * %o           -   print the given number in octal notation
589
+     * %x           -   print the given number in hex notation
590
+     * %X           -   same as %x but with uppercase characters
591
+     * %a           -   alias to %x
592
+     * %A           -   alias to %X
593
+     * %n           -   just print nothing
594
+     * @type {{}}
595
+     */
596
+    var known_params = {};
597
+    known_params["f"] = function (format, arg) {
598
+        if (!test_arg(format, arg, "number"))
599
+            return "Ø";
600
+        var tmp = Math.abs(arg);
601
+        var sign = (arg < 0) ? -1 : 1;
602
+        var tmp_result = null;
603
+        if (format.precision !== null) {
604
+            tmp = Math.floor(Math.pow(10, format.precision) * tmp) / Math.pow(10, format.precision);
605
+            var tmp_ = (tmp * sign).toString().split(".");
606
+            if (tmp_.length === 1)
607
+                tmp_.push("");
608
+            tmp_[1] = string_fill(tmp_[1], "0", format.precision, true);
609
+            tmp_result = tmp_.join(".");
610
+        }
611
+        else {
612
+            tmp_result = (sign * tmp).toString();
613
+        }
614
+        if ((format.flags.indexOf(" ") >= 0) && (arg >= 0)) {
615
+            tmp_result = " " + tmp;
616
+        }
617
+        else if ((format.flags.indexOf("+") >= 0) && (arg >= 0)) {
618
+            tmp_result = "+" + tmp;
619
+        }
620
+        tmp_result = string_fill(tmp, (format.flags.indexOf("0") >= 0) ? "0" : " ", format.width, (format.flags.indexOf("-") >= 0));
621
+        return tmp_result;
622
+    };
623
+    known_params["F"] = known_params["f"];
624
+    known_params["d"] = function (format, arg) {
625
+        if (!test_arg(format, arg, 'number'))
626
+            return 'Ø';
627
+        var tmp = (((arg < 0 && format.specifier !== 'u') ? -1 : 1) * Math.floor(Math.abs(arg))).toString();
628
+        if ((format.specifier === 'd' || format.specifier === 'i') && format.flags.indexOf(' ') >= 0 && arg >= 0) {
629
+            tmp = ' ' + tmp;
630
+        }
631
+        else if ((format.specifier === 'd' || format.specifier === 'i') && format.flags.indexOf('+') >= 0 && arg >= 0) {
632
+            tmp = '+' + tmp;
633
+        }
634
+        tmp = string_fill(tmp, format.flags.indexOf('0') >= 0 ? '0' : ' ', format.width, format.flags.indexOf('-') >= 0);
635
+        tmp = string_fill(tmp, '0', format.precision === null ? 0 : format.precision, false);
636
+        return tmp;
637
+    };
638
+    known_params["i"] = known_params["d"];
639
+    known_params["u"] = known_params["d"];
640
+    known_params["e"] = function (format, arg) {
641
+        if (!test_arg(format, arg, 'number'))
642
+            return 'Ø';
643
+        var tmp = arg.toExponential(format.precision === null ? undefined : format.precision).toString();
644
+        if (format.flags.indexOf(' ') >= 0 && arg >= 0) {
645
+            tmp = ' ' + tmp;
646
+        }
647
+        else if (format.flags.indexOf('+') >= 0 && arg >= 0) {
648
+            tmp = '+' + tmp;
649
+        }
650
+        tmp = string_fill(tmp, format.flags.indexOf('0') >= 0 ? '0' : ' ', format.width, format.flags.indexOf('-') >= 0);
651
+        return tmp;
652
+    };
653
+    known_params["E"] = function (format, arg) {
654
+        return known_params["e"](format, arg).toUpperCase();
655
+    };
656
+    known_params["g"] = function (format, arg) {
657
+        if (!test_arg(format, arg, 'number'))
658
+            return 'Ø';
659
+        var tmpf = known_params["f"](format, arg);
660
+        var tmpe = known_params["e"](format, arg);
661
+        if (tmpf.length < tmpe.length) {
662
+            return tmpf;
663
+        }
664
+        else {
665
+            return tmpe;
666
+        }
667
+    };
668
+    known_params["G"] = function (format, arg) {
669
+        return known_params["g"](format, arg).toUpperCase();
670
+    };
671
+    known_params["s"] = function (format, arg) {
672
+        if (!test_arg(format, arg, 'string'))
673
+            return 'o.O';
674
+        var tmp = format.precision !== null ? arg.substr(0, format.precision) : arg;
675
+        tmp = string_fill(tmp, format.flags.indexOf('0') >= 0 ? '0' : ' ', format.width, format.flags.indexOf('-') >= 0);
676
+        return tmp;
677
+    };
678
+    known_params["o"] = function (format, arg) {
679
+        if (!test_arg(format, arg, 'number'))
680
+            return 'Ø';
681
+        var tmp = Math.floor(Math.round(Math.abs(arg))) * ((arg < 0) ? -1 : 1);
682
+        return known_params["s"](format, tmp.toString(8));
683
+    };
684
+    known_params["x"] = function (format, arg) {
685
+        if (!test_arg(format, arg, 'number'))
686
+            return 'Ø';
687
+        var tmp = Math.floor(Math.round(Math.abs(arg))) * ((arg < 0) ? -1 : 1);
688
+        return known_params["s"](format, tmp.toString(16));
689
+    };
690
+    known_params["a"] = known_params["x"];
691
+    known_params["X"] = function (format, arg) {
692
+        if (!test_arg(format, arg, 'number'))
693
+            return 'Ø';
694
+        return known_params["x"](format, arg).toUpperCase();
695
+    };
696
+    known_params["A"] = known_params["X"];
697
+    known_params["c"] = function (format, arg) {
698
+        var tmp = "";
699
+        if (typeof arg === "number") {
700
+            tmp = String.fromCharCode(arg);
701
+        }
702
+        else if ((typeof arg === "string") && (arg.length === 1)) {
703
+            tmp = arg[0];
704
+        }
705
+        else {
706
+            console.warn(make_err(format, arg, "number|string") + " and if string it needs to have the length of 1!");
707
+        }
708
+        return known_params["s"](format, tmp);
709
+    };
710
+    known_params["n"] = function () {
711
+        return "";
712
+    };
713
+    var decompose = function (chain, regexp) {
714
+        var result = regexp.exec(chain);
715
+        if (result == null) {
716
+            return null;
717
+        }
718
+        else {
719
+            var front = chain.substring(0, result.index);
720
+            var back = chain.substring(result.index + result[0].length);
721
+            return { "front": front, "match": result[0], "back": back };
722
+        }
723
+    };
724
+    /**
725
+     * an implementation of c sprintf
726
+     * @param {string} string format string
727
+     * @param {array} args arguments which should be filled into
728
+     * @returns {string}
729
+     */
730
+    lib_string.sprintf = function (input, args, original) {
731
+        if (args === void 0) { args = []; }
732
+        if (original === void 0) { original = null; }
733
+        if (original == null)
734
+            original = input;
735
+        var components = decompose(input, pattern);
736
+        if (components == null) {
737
+            if (args.length > 0) {
738
+                console.warn("[sprintf] superfluous arguments while formatting '" + original + "': ", args);
739
+            }
740
+            return input;
741
+        }
742
+        else {
743
+            var arg;
744
+            var rest;
745
+            if (args.length > 0) {
746
+                arg = args[0];
747
+                rest = args.slice(1);
748
+            }
749
+            else {
750
+                console.warn("[sprintf] out of arguments while formatting '" + original + "'");
751
+                arg = null;
752
+                rest = [];
753
+                return input;
754
+            }
755
+            var fmt = split_format(components["match"]);
756
+            return (components["front"]
757
+                + known_params[fmt.specifier](fmt, arg)
758
+                + lib_string.sprintf(components["back"], rest, original));
759
+        }
760
+    };
761
+    /**
762
+     * an implementation of c printf
763
+     * @param {string} string format string
764
+     * @param {array} args arguments which should be filled into
765
+     * @returns {string}
766
+     */
767
+    function printf(format, args) {
768
+        console.log(lib_string.sprintf(format, args));
769
+    }
770
+    lib_string.printf = printf;
771
+})(lib_string || (lib_string = {}));
772
+var sprintf = lib_string.sprintf;
773
+var printf = lib_string.printf;
774
+/*
775
+This file is part of »bacterio-plankton:string«.
776
+
777
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
778
+<info@greenscale.de>
779
+
780
+»bacterio-plankton:string« is free software: you can redistribute it and/or modify
781
+it under the terms of the GNU Lesser General Public License as published by
782
+the Free Software Foundation, either version 3 of the License, or
783
+(at your option) any later version.
784
+
785
+»bacterio-plankton:string« is distributed in the hope that it will be useful,
786
+but WITHOUT ANY WARRANTY; without even the implied warranty of
787
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
788
+GNU Lesser General Public License for more details.
789
+
790
+You should have received a copy of the GNU Lesser General Public License
791
+along with »bacterio-plankton:string«. If not, see <http://www.gnu.org/licenses/>.
792
+ */
793
+var make_logger = (function () {
794
+    var _loggers = {};
795
+    var make_logger = function (prefix, current_loglevel) {
796
+        var log = [];
797
+        var level = [
798
+            "LOG", "INFO", "WARNING", "DEBUG"
799
+        ];
800
+        var logger = function (obj, lvl) {
801
+            var txt = obj.txt || obj;
802
+            if (lvl == void 0)
803
+                lvl = 0;
804
+            var date = new Date();
805
+            log.push({
806
+                "message": sprintf("%s [%s:%s] %s", [date.toString(), level[lvl], prefix, txt]),
807
+                "timeStamp": +(date)
808
+            });
809
+            if (lvl <= current_loglevel) {
810
+                var msg = ["[" + prefix + "]", txt];
811
+                if (obj.arg)
812
+                    msg = ["[" + prefix + "]"].concat(Array.prototype.slice.call(obj.arg));
813
+                if (lvl === 0)
814
+                    console["_log"].apply(console, msg);
815
+                else if (lvl === 1)
816
+                    console["_info"].apply(console, msg);
817
+                else if (lvl === 2)
818
+                    console["_warn"].apply(console, msg);
819
+                else if (lvl >= 3)
820
+                    console["_log"].apply(console, msg);
821
+            }
822
+        };
823
+        _loggers[prefix] = {
824
+            "logger": logger,
825
+            "log": log
826
+        };
827
+        return logger;
828
+    };
829
+    make_logger["loggers"] = _loggers;
830
+    make_logger["complete_log"] = function () {
831
+        var logs = Object.keys(_loggers)
832
+            .reduce(function (p, c) {
833
+            return [].concat(p, _loggers[c].log);
834
+        }, []);
835
+        logs.sort(function (x, y) {
836
+            return ((x.timeStamp > y.timeStamp) ? -1 : +1);
837
+        });
838
+        return logs.map(function (x, i, a) {
839
+            return x.message;
840
+        });
841
+    };
842
+    if ( /*!track_exports*/true) {
843
+        var _log_all = function (log, lvl, next) {
844
+            if (next === void 0) { next = function () { }; }
845
+            return function () {
846
+                var msg = [];
847
+                for (var i = 0; i < arguments.length; i++) {
848
+                    if (typeof arguments[i] === "string") {
849
+                        msg.push(arguments[i]);
850
+                    }
851
+                    else {
852
+                        msg.push(JSON.stringify(arguments[i]));
853
+                    }
854
+                }
855
+                var obj = {
856
+                    txt: msg.join("\t"),
857
+                    arg: arguments
858
+                };
859
+                log(obj, lvl);
860
+                next();
861
+            };
862
+        };
863
+        {
864
+            var __warn = make_logger("deprecated console.warn", 99);
865
+            var __error = make_logger("deprecated console.error", 99);
866
+            var __log = make_logger("deprecated console.log", 99);
867
+            var __info = make_logger("deprecated console.info", 99);
868
+            // bad ass
869
+            console["_log"] = console.log;
870
+            console["_error"] = console.error;
871
+            console["_warn"] = console.warn;
872
+            console["_info"] = console.info;
873
+            /*
874
+            console["log"] = _log_all(__log, 0);
875
+            console["error"] = _log_all(__error, 2);
876
+            console["warn"] = _log_all(__warn, 2);
877
+            console["info"] = _log_all(__info, 0);
878
+             */
879
+        }
880
+        /*
881
+        {
882
+            make_logger["send_log"] = function(){
883
+                eml_log(
884
+                    function () {
885
+                        alert("fehlerbericht wurde gesendet!");
886
+                    }
887
+                );
888
+            };
889
+            var error_log = make_logger("global.error", 99);
890
+            window.onerror = _log_all(
891
+                error_log,
892
+                1,
893
+                function(){
894
+                    if (global_config == undefined) {
895
+                        return false;
896
+                    }
897
+                    if (global_config.report_error) {
898
+                        make_logger["send_log"]();
899
+                    }
900
+                }
901
+            );
902
+        }
903
+         */
904
+    }
905
+    return make_logger;
906
+})();
... ...
@@ -0,0 +1,860 @@
1
+Copyright 2016-2018 greenscale <info@greenscale.de>
2
+
3
+»bacterio-plankton:trait« is free software: you can redistribute it and/or modify
4
+it under the terms of the GNU Lesser General Public License as published by
5
+the Free Software Foundation, either version 3 of the License, or
6
+(at your option) any later version.
7
+
8
+»bacterio-plankton:trait« is distributed in the hope that it will be useful,
9
+but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+GNU Lesser General Public License for more details.
12
+
13
+You should have received a copy of the GNU Lesser General Public License
14
+along with »bacterio-plankton:trait«. If not, see <http://www.gnu.org/licenses/>.
15
+
16
+
17
+
18
+                    GNU GENERAL PUBLIC LICENSE
19
+                       Version 3, 29 June 2007
20
+
21
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
22
+ Everyone is permitted to copy and distribute verbatim copies
23
+ of this license document, but changing it is not allowed.
24
+
25
+                            Preamble
26
+
27
+  The GNU General Public License is a free, copyleft license for
28
+software and other kinds of works.
29
+
30
+  The licenses for most software and other practical works are designed
31
+to take away your freedom to share and change the works.  By contrast,
32
+the GNU General Public License is intended to guarantee your freedom to
33
+share and change all versions of a program--to make sure it remains free
34
+software for all its users.  We, the Free Software Foundation, use the
35
+GNU General Public License for most of our software; it applies also to
36
+any other work released this way by its authors.  You can apply it to
37
+your programs, too.
38
+
39
+  When we speak of free software, we are referring to freedom, not
40
+price.  Our General Public Licenses are designed to make sure that you
41
+have the freedom to distribute copies of free software (and charge for
42
+them if you wish), that you receive source code or can get it if you
43
+want it, that you can change the software or use pieces of it in new
44
+free programs, and that you know you can do these things.
45
+
46
+  To protect your rights, we need to prevent others from denying you
47
+these rights or asking you to surrender the rights.  Therefore, you have
48
+certain responsibilities if you distribute copies of the software, or if
49
+you modify it: responsibilities to respect the freedom of others.
50
+
51
+  For example, if you distribute copies of such a program, whether
52
+gratis or for a fee, you must pass on to the recipients the same
53
+freedoms that you received.  You must make sure that they, too, receive
54
+or can get the source code.  And you must show them these terms so they
55
+know their rights.
56
+
57
+  Developers that use the GNU GPL protect your rights with two steps:
58
+(1) assert copyright on the software, and (2) offer you this License
59
+giving you legal permission to copy, distribute and/or modify it.
60
+
61
+  For the developers' and authors' protection, the GPL clearly explains
62
+that there is no warranty for this free software.  For both users' and
63
+authors' sake, the GPL requires that modified versions be marked as
64
+changed, so that their problems will not be attributed erroneously to
65
+authors of previous versions.
66
+
67
+  Some devices are designed to deny users access to install or run
68
+modified versions of the software inside them, although the manufacturer
69
+can do so.  This is fundamentally incompatible with the aim of
70
+protecting users' freedom to change the software.  The systematic
71
+pattern of such abuse occurs in the area of products for individuals to
72
+use, which is precisely where it is most unacceptable.  Therefore, we
73
+have designed this version of the GPL to prohibit the practice for those
74
+products.  If such problems arise substantially in other domains, we
75
+stand ready to extend this provision to those domains in future versions
76
+of the GPL, as needed to protect the freedom of users.
77
+
78
+  Finally, every program is threatened constantly by software patents.
79
+States should not allow patents to restrict development and use of
80
+software on general-purpose computers, but in those that do, we wish to
81
+avoid the special danger that patents applied to a free program could
82
+make it effectively proprietary.  To prevent this, the GPL assures that
83
+patents cannot be used to render the program non-free.
84
+
85
+  The precise terms and conditions for copying, distribution and
86
+modification follow.
87
+
88
+                       TERMS AND CONDITIONS
89
+
90
+  0. Definitions.
91
+
92
+  "This License" refers to version 3 of the GNU General Public License.
93
+
94
+  "Copyright" also means copyright-like laws that apply to other kinds of
95
+works, such as semiconductor masks.
96
+
97
+  "The Program" refers to any copyrightable work licensed under this
98
+License.  Each licensee is addressed as "you".  "Licensees" and
99
+"recipients" may be individuals or organizations.
100
+
101
+  To "modify" a work means to copy from or adapt all or part of the work
102
+in a fashion requiring copyright permission, other than the making of an
103
+exact copy.  The resulting work is called a "modified version" of the
104
+earlier work or a work "based on" the earlier work.
105
+
106
+  A "covered work" means either the unmodified Program or a work based
107
+on the Program.
108
+
109
+  To "propagate" a work means to do anything with it that, without
110
+permission, would make you directly or secondarily liable for
111
+infringement under applicable copyright law, except executing it on a
112
+computer or modifying a private copy.  Propagation includes copying,
113
+distribution (with or without modification), making available to the
114
+public, and in some countries other activities as well.
115
+
116
+  To "convey" a work means any kind of propagation that enables other
117
+parties to make or receive copies.  Mere interaction with a user through
118
+a computer network, with no transfer of a copy, is not conveying.
119
+
120
+  An interactive user interface displays "Appropriate Legal Notices"
121
+to the extent that it includes a convenient and prominently visible
122
+feature that (1) displays an appropriate copyright notice, and (2)
123
+tells the user that there is no warranty for the work (except to the
124
+extent that warranties are provided), that licensees may convey the
125
+work under this License, and how to view a copy of this License.  If
126
+the interface presents a list of user commands or options, such as a
127
+menu, a prominent item in the list meets this criterion.
128
+
129
+  1. Source Code.
130
+
131
+  The "source code" for a work means the preferred form of the work
132
+for making modifications to it.  "Object code" means any non-source
133
+form of a work.
134
+
135
+  A "Standard Interface" means an interface that either is an official
136
+standard defined by a recognized standards body, or, in the case of
137
+interfaces specified for a particular programming language, one that
138
+is widely used among developers working in that language.
139
+
140
+  The "System Libraries" of an executable work include anything, other
141
+than the work as a whole, that (a) is included in the normal form of
142
+packaging a Major Component, but which is not part of that Major
143
+Component, and (b) serves only to enable use of the work with that
144
+Major Component, or to implement a Standard Interface for which an
145
+implementation is available to the public in source code form.  A
146
+"Major Component", in this context, means a major essential component
147
+(kernel, window system, and so on) of the specific operating system
148
+(if any) on which the executable work runs, or a compiler used to
149
+produce the work, or an object code interpreter used to run it.
150
+
151
+  The "Corresponding Source" for a work in object code form means all
152
+the source code needed to generate, install, and (for an executable
153
+work) run the object code and to modify the work, including scripts to
154
+control those activities.  However, it does not include the work's
155
+System Libraries, or general-purpose tools or generally available free
156
+programs which are used unmodified in performing those activities but
157
+which are not part of the work.  For example, Corresponding Source
158
+includes interface definition files associated with source files for
159
+the work, and the source code for shared libraries and dynamically
160
+linked subprograms that the work is specifically designed to require,
161
+such as by intimate data communication or control flow between those
162
+subprograms and other parts of the work.
163
+
164
+  The Corresponding Source need not include anything that users
165
+can regenerate automatically from other parts of the Corresponding
166
+Source.
167
+
168
+  The Corresponding Source for a work in source code form is that
169
+same work.
170
+
171
+  2. Basic Permissions.
172
+
173
+  All rights granted under this License are granted for the term of
174
+copyright on the Program, and are irrevocable provided the stated
175
+conditions are met.  This License explicitly affirms your unlimited
176
+permission to run the unmodified Program.  The output from running a
177
+covered work is covered by this License only if the output, given its
178
+content, constitutes a covered work.  This License acknowledges your
179
+rights of fair use or other equivalent, as provided by copyright law.
180
+
181
+  You may make, run and propagate covered works that you do not
182
+convey, without conditions so long as your license otherwise remains
183
+in force.  You may convey covered works to others for the sole purpose
184
+of having them make modifications exclusively for you, or provide you
185
+with facilities for running those works, provided that you comply with
186
+the terms of this License in conveying all material for which you do
187
+not control copyright.  Those thus making or running the covered works
188
+for you must do so exclusively on your behalf, under your direction
189
+and control, on terms that prohibit them from making any copies of
190
+your copyrighted material outside their relationship with you.
191
+
192
+  Conveying under any other circumstances is permitted solely under
193
+the conditions stated below.  Sublicensing is not allowed; section 10
194
+makes it unnecessary.
195
+
196
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
197
+
198
+  No covered work shall be deemed part of an effective technological
199
+measure under any applicable law fulfilling obligations under article
200
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
201
+similar laws prohibiting or restricting circumvention of such
202
+measures.
203
+
204
+  When you convey a covered work, you waive any legal power to forbid
205
+circumvention of technological measures to the extent such circumvention
206
+is effected by exercising rights under this License with respect to
207
+the covered work, and you disclaim any intention to limit operation or
208
+modification of the work as a means of enforcing, against the work's
209
+users, your or third parties' legal rights to forbid circumvention of
210
+technological measures.
211
+
212
+  4. Conveying Verbatim Copies.
213
+
214
+  You may convey verbatim copies of the Program's source code as you
215
+receive it, in any medium, provided that you conspicuously and
216
+appropriately publish on each copy an appropriate copyright notice;
217
+keep intact all notices stating that this License and any
218
+non-permissive terms added in accord with section 7 apply to the code;
219
+keep intact all notices of the absence of any warranty; and give all
220
+recipients a copy of this License along with the Program.
221
+
222
+  You may charge any price or no price for each copy that you convey,
223
+and you may offer support or warranty protection for a fee.
224
+
225
+  5. Conveying Modified Source Versions.
226
+
227
+  You may convey a work based on the Program, or the modifications to
228
+produce it from the Program, in the form of source code under the
229
+terms of section 4, provided that you also meet all of these conditions:
230
+
231
+    a) The work must carry prominent notices stating that you modified
232
+    it, and giving a relevant date.
233
+
234
+    b) The work must carry prominent notices stating that it is
235
+    released under this License and any conditions added under section
236
+    7.  This requirement modifies the requirement in section 4 to
237
+    "keep intact all notices".
238
+
239
+    c) You must license the entire work, as a whole, under this
240
+    License to anyone who comes into possession of a copy.  This
241
+    License will therefore apply, along with any applicable section 7
242
+    additional terms, to the whole of the work, and all its parts,
243
+    regardless of how they are packaged.  This License gives no
244
+    permission to license the work in any other way, but it does not
245
+    invalidate such permission if you have separately received it.
246
+
247
+    d) If the work has interactive user interfaces, each must display
248
+    Appropriate Legal Notices; however, if the Program has interactive
249
+    interfaces that do not display Appropriate Legal Notices, your
250
+    work need not make them do so.
251
+
252
+  A compilation of a covered work with other separate and independent
253
+works, which are not by their nature extensions of the covered work,
254
+and which are not combined with it such as to form a larger program,
255
+in or on a volume of a storage or distribution medium, is called an
256
+"aggregate" if the compilation and its resulting copyright are not
257
+used to limit the access or legal rights of the compilation's users
258
+beyond what the individual works permit.  Inclusion of a covered work
259
+in an aggregate does not cause this License to apply to the other
260
+parts of the aggregate.
261
+
262
+  6. Conveying Non-Source Forms.
263
+
264
+  You may convey a covered work in object code form under the terms
265
+of sections 4 and 5, provided that you also convey the
266
+machine-readable Corresponding Source under the terms of this License,
267
+in one of these ways:
268
+
269
+    a) Convey the object code in, or embodied in, a physical product
270
+    (including a physical distribution medium), accompanied by the
271
+    Corresponding Source fixed on a durable physical medium
272
+    customarily used for software interchange.
273
+
274
+    b) Convey the object code in, or embodied in, a physical product
275
+    (including a physical distribution medium), accompanied by a
276
+    written offer, valid for at least three years and valid for as
277
+    long as you offer spare parts or customer support for that product
278
+    model, to give anyone who possesses the object code either (1) a
279
+    copy of the Corresponding Source for all the software in the
280
+    product that is covered by this License, on a durable physical
281
+    medium customarily used for software interchange, for a price no
282
+    more than your reasonable cost of physically performing this
283
+    conveying of source, or (2) access to copy the
284
+    Corresponding Source from a network server at no charge.
285
+
286
+    c) Convey individual copies of the object code with a copy of the
287
+    written offer to provide the Corresponding Source.  This
288
+    alternative is allowed only occasionally and noncommercially, and
289
+    only if you received the object code with such an offer, in accord
290
+    with subsection 6b.
291
+
292
+    d) Convey the object code by offering access from a designated
293
+    place (gratis or for a charge), and offer equivalent access to the
294
+    Corresponding Source in the same way through the same place at no
295
+    further charge.  You need not require recipients to copy the
296
+    Corresponding Source along with the object code.  If the place to
297
+    copy the object code is a network server, the Corresponding Source
298
+    may be on a different server (operated by you or a third party)
299
+    that supports equivalent copying facilities, provided you maintain
300
+    clear directions next to the object code saying where to find the
301
+    Corresponding Source.  Regardless of what server hosts the
302
+    Corresponding Source, you remain obligated to ensure that it is
303
+    available for as long as needed to satisfy these requirements.
304
+
305
+    e) Convey the object code using peer-to-peer transmission, provided
306
+    you inform other peers where the object code and Corresponding
307
+    Source of the work are being offered to the general public at no
308
+    charge under subsection 6d.
309
+
310
+  A separable portion of the object code, whose source code is excluded
311
+from the Corresponding Source as a System Library, need not be
312
+included in conveying the object code work.
313
+
314
+  A "User Product" is either (1) a "consumer product", which means any
315
+tangible personal property which is normally used for personal, family,
316
+or household purposes, or (2) anything designed or sold for incorporation
317
+into a dwelling.  In determining whether a product is a consumer product,
318
+doubtful cases shall be resolved in favor of coverage.  For a particular
319
+product received by a particular user, "normally used" refers to a
320
+typical or common use of that class of product, regardless of the status
321
+of the particular user or of the way in which the particular user
322
+actually uses, or expects or is expected to use, the product.  A product
323
+is a consumer product regardless of whether the product has substantial
324
+commercial, industrial or non-consumer uses, unless such uses represent
325
+the only significant mode of use of the product.
326
+
327
+  "Installation Information" for a User Product means any methods,
328
+procedures, authorization keys, or other information required to install
329
+and execute modified versions of a covered work in that User Product from
330
+a modified version of its Corresponding Source.  The information must
331
+suffice to ensure that the continued functioning of the modified object
332
+code is in no case prevented or interfered with solely because
333
+modification has been made.
334
+
335
+  If you convey an object code work under this section in, or with, or
336
+specifically for use in, a User Product, and the conveying occurs as
337
+part of a transaction in which the right of possession and use of the
338
+User Product is transferred to the recipient in perpetuity or for a
339
+fixed term (regardless of how the transaction is characterized), the
340
+Corresponding Source conveyed under this section must be accompanied
341
+by the Installation Information.  But this requirement does not apply
342
+if neither you nor any third party retains the ability to install
343
+modified object code on the User Product (for example, the work has
344
+been installed in ROM).
345
+
346
+  The requirement to provide Installation Information does not include a
347
+requirement to continue to provide support service, warranty, or updates
348
+for a work that has been modified or installed by the recipient, or for
349
+the User Product in which it has been modified or installed.  Access to a
350
+network may be denied when the modification itself materially and
351
+adversely affects the operation of the network or violates the rules and
352
+protocols for communication across the network.
353
+
354
+  Corresponding Source conveyed, and Installation Information provided,
355
+in accord with this section must be in a format that is publicly
356
+documented (and with an implementation available to the public in
357
+source code form), and must require no special password or key for
358
+unpacking, reading or copying.
359
+
360
+  7. Additional Terms.
361
+
362
+  "Additional permissions" are terms that supplement the terms of this
363
+License by making exceptions from one or more of its conditions.
364
+Additional permissions that are applicable to the entire Program shall
365
+be treated as though they were included in this License, to the extent
366
+that they are valid under applicable law.  If additional permissions
367
+apply only to part of the Program, that part may be used separately
368
+under those permissions, but the entire Program remains governed by
369
+this License without regard to the additional permissions.
370
+
371
+  When you convey a copy of a covered work, you may at your option
372
+remove any additional permissions from that copy, or from any part of
373
+it.  (Additional permissions may be written to require their own
374
+removal in certain cases when you modify the work.)  You may place
375
+additional permissions on material, added by you to a covered work,
376
+for which you have or can give appropriate copyright permission.
377
+
378
+  Notwithstanding any other provision of this License, for material you
379
+add to a covered work, you may (if authorized by the copyright holders of
380
+that material) supplement the terms of this License with terms:
381
+
382
+    a) Disclaiming warranty or limiting liability differently from the
383
+    terms of sections 15 and 16 of this License; or
384
+
385
+    b) Requiring preservation of specified reasonable legal notices or
386
+    author attributions in that material or in the Appropriate Legal
387
+    Notices displayed by works containing it; or
388
+
389
+    c) Prohibiting misrepresentation of the origin of that material, or
390
+    requiring that modified versions of such material be marked in
391
+    reasonable ways as different from the original version; or
392
+
393
+    d) Limiting the use for publicity purposes of names of licensors or
394
+    authors of the material; or
395
+
396
+    e) Declining to grant rights under trademark law for use of some
397
+    trade names, trademarks, or service marks; or
398
+
399
+    f) Requiring indemnification of licensors and authors of that
400
+    material by anyone who conveys the material (or modified versions of
401
+    it) with contractual assumptions of liability to the recipient, for
402
+    any liability that these contractual assumptions directly impose on
403
+    those licensors and authors.
404
+
405
+  All other non-permissive additional terms are considered "further
406
+restrictions" within the meaning of section 10.  If the Program as you
407
+received it, or any part of it, contains a notice stating that it is
408
+governed by this License along with a term that is a further
409
+restriction, you may remove that term.  If a license document contains
410
+a further restriction but permits relicensing or conveying under this
411
+License, you may add to a covered work material governed by the terms
412
+of that license document, provided that the further restriction does
413
+not survive such relicensing or conveying.
414
+
415
+  If you add terms to a covered work in accord with this section, you
416
+must place, in the relevant source files, a statement of the
417
+additional terms that apply to those files, or a notice indicating
418
+where to find the applicable terms.
419
+
420
+  Additional terms, permissive or non-permissive, may be stated in the
421
+form of a separately written license, or stated as exceptions;
422
+the above requirements apply either way.
423
+
424
+  8. Termination.
425
+
426
+  You may not propagate or modify a covered work except as expressly
427
+provided under this License.  Any attempt otherwise to propagate or
428
+modify it is void, and will automatically terminate your rights under
429
+this License (including any patent licenses granted under the third
430
+paragraph of section 11).
431
+
432
+  However, if you cease all violation of this License, then your
433
+license from a particular copyright holder is reinstated (a)
434
+provisionally, unless and until the copyright holder explicitly and
435
+finally terminates your license, and (b) permanently, if the copyright
436
+holder fails to notify you of the violation by some reasonable means
437
+prior to 60 days after the cessation.
438
+
439
+  Moreover, your license from a particular copyright holder is
440
+reinstated permanently if the copyright holder notifies you of the
441
+violation by some reasonable means, this is the first time you have
442
+received notice of violation of this License (for any work) from that
443
+copyright holder, and you cure the violation prior to 30 days after
444
+your receipt of the notice.
445
+
446
+  Termination of your rights under this section does not terminate the
447
+licenses of parties who have received copies or rights from you under
448
+this License.  If your rights have been terminated and not permanently
449
+reinstated, you do not qualify to receive new licenses for the same
450
+material under section 10.
451
+
452
+  9. Acceptance Not Required for Having Copies.
453
+
454
+  You are not required to accept this License in order to receive or
455
+run a copy of the Program.  Ancillary propagation of a covered work
456
+occurring solely as a consequence of using peer-to-peer transmission
457
+to receive a copy likewise does not require acceptance.  However,
458
+nothing other than this License grants you permission to propagate or
459
+modify any covered work.  These actions infringe copyright if you do
460
+not accept this License.  Therefore, by modifying or propagating a
461
+covered work, you indicate your acceptance of this License to do so.
462
+
463
+  10. Automatic Licensing of Downstream Recipients.
464
+
465
+  Each time you convey a covered work, the recipient automatically
466
+receives a license from the original licensors, to run, modify and
467
+propagate that work, subject to this License.  You are not responsible
468
+for enforcing compliance by third parties with this License.
469
+
470
+  An "entity transaction" is a transaction transferring control of an
471
+organization, or substantially all assets of one, or subdividing an
472
+organization, or merging organizations.  If propagation of a covered
473
+work results from an entity transaction, each party to that
474
+transaction who receives a copy of the work also receives whatever
475
+licenses to the work the party's predecessor in interest had or could
476
+give under the previous paragraph, plus a right to possession of the
477
+Corresponding Source of the work from the predecessor in interest, if
478
+the predecessor has it or can get it with reasonable efforts.
479
+
480
+  You may not impose any further restrictions on the exercise of the
481
+rights granted or affirmed under this License.  For example, you may
482
+not impose a license fee, royalty, or other charge for exercise of
483
+rights granted under this License, and you may not initiate litigation
484
+(including a cross-claim or counterclaim in a lawsuit) alleging that
485
+any patent claim is infringed by making, using, selling, offering for
486
+sale, or importing the Program or any portion of it.
487
+
488
+  11. Patents.
489
+
490
+  A "contributor" is a copyright holder who authorizes use under this
491
+License of the Program or a work on which the Program is based.  The
492
+work thus licensed is called the contributor's "contributor version".
493
+
494
+  A contributor's "essential patent claims" are all patent claims
495
+owned or controlled by the contributor, whether already acquired or
496
+hereafter acquired, that would be infringed by some manner, permitted
497
+by this License, of making, using, or selling its contributor version,
498
+but do not include claims that would be infringed only as a
499
+consequence of further modification of the contributor version.  For
500
+purposes of this definition, "control" includes the right to grant
501
+patent sublicenses in a manner consistent with the requirements of
502
+this License.
503
+
504
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
505
+patent license under the contributor's essential patent claims, to
506
+make, use, sell, offer for sale, import and otherwise run, modify and
507
+propagate the contents of its contributor version.
508
+
509
+  In the following three paragraphs, a "patent license" is any express
510
+agreement or commitment, however denominated, not to enforce a patent
511
+(such as an express permission to practice a patent or covenant not to
512
+sue for patent infringement).  To "grant" such a patent license to a
513
+party means to make such an agreement or commitment not to enforce a
514
+patent against the party.
515
+
516
+  If you convey a covered work, knowingly relying on a patent license,
517
+and the Corresponding Source of the work is not available for anyone
518
+to copy, free of charge and under the terms of this License, through a
519
+publicly available network server or other readily accessible means,
520
+then you must either (1) cause the Corresponding Source to be so
521
+available, or (2) arrange to deprive yourself of the benefit of the
522
+patent license for this particular work, or (3) arrange, in a manner
523
+consistent with the requirements of this License, to extend the patent
524
+license to downstream recipients.  "Knowingly relying" means you have
525
+actual knowledge that, but for the patent license, your conveying the
526
+covered work in a country, or your recipient's use of the covered work
527
+in a country, would infringe one or more identifiable patents in that
528
+country that you have reason to believe are valid.
529
+
530
+  If, pursuant to or in connection with a single transaction or
531
+arrangement, you convey, or propagate by procuring conveyance of, a
532
+covered work, and grant a patent license to some of the parties
533
+receiving the covered work authorizing them to use, propagate, modify
534
+or convey a specific copy of the covered work, then the patent license
535
+you grant is automatically extended to all recipients of the covered
536
+work and works based on it.
537
+
538
+  A patent license is "discriminatory" if it does not include within
539
+the scope of its coverage, prohibits the exercise of, or is
540
+conditioned on the non-exercise of one or more of the rights that are
541
+specifically granted under this License.  You may not convey a covered
542
+work if you are a party to an arrangement with a third party that is
543
+in the business of distributing software, under which you make payment
544
+to the third party based on the extent of your activity of conveying
545
+the work, and under which the third party grants, to any of the
546
+parties who would receive the covered work from you, a discriminatory
547
+patent license (a) in connection with copies of the covered work
548
+conveyed by you (or copies made from those copies), or (b) primarily
549
+for and in connection with specific products or compilations that
550
+contain the covered work, unless you entered into that arrangement,
551
+or that patent license was granted, prior to 28 March 2007.
552
+
553
+  Nothing in this License shall be construed as excluding or limiting
554
+any implied license or other defenses to infringement that may
555
+otherwise be available to you under applicable patent law.
556
+
557
+  12. No Surrender of Others' Freedom.
558
+
559
+  If conditions are imposed on you (whether by court order, agreement or
560
+otherwise) that contradict the conditions of this License, they do not
561
+excuse you from the conditions of this License.  If you cannot convey a
562
+covered work so as to satisfy simultaneously your obligations under this
563
+License and any other pertinent obligations, then as a consequence you may
564
+not convey it at all.  For example, if you agree to terms that obligate you
565
+to collect a royalty for further conveying from those to whom you convey
566
+the Program, the only way you could satisfy both those terms and this
567
+License would be to refrain entirely from conveying the Program.
568
+
569
+  13. Use with the GNU Affero General Public License.
570
+
571
+  Notwithstanding any other provision of this License, you have
572
+permission to link or combine any covered work with a work licensed
573
+under version 3 of the GNU Affero General Public License into a single
574
+combined work, and to convey the resulting work.  The terms of this
575
+License will continue to apply to the part which is the covered work,
576
+but the special requirements of the GNU Affero General Public License,
577
+section 13, concerning interaction through a network will apply to the
578
+combination as such.
579
+
580
+  14. Revised Versions of this License.
581
+
582
+  The Free Software Foundation may publish revised and/or new versions of
583
+the GNU General Public License from time to time.  Such new versions will
584
+be similar in spirit to the present version, but may differ in detail to
585
+address new problems or concerns.
586
+
587
+  Each version is given a distinguishing version number.  If the
588
+Program specifies that a certain numbered version of the GNU General
589
+Public License "or any later version" applies to it, you have the
590
+option of following the terms and conditions either of that numbered
591
+version or of any later version published by the Free Software
592
+Foundation.  If the Program does not specify a version number of the
593
+GNU General Public License, you may choose any version ever published
594
+by the Free Software Foundation.
595
+
596
+  If the Program specifies that a proxy can decide which future
597
+versions of the GNU General Public License can be used, that proxy's
598
+public statement of acceptance of a version permanently authorizes you
599
+to choose that version for the Program.
600
+
601
+  Later license versions may give you additional or different
602
+permissions.  However, no additional obligations are imposed on any
603
+author or copyright holder as a result of your choosing to follow a
604
+later version.
605
+
606
+  15. Disclaimer of Warranty.
607
+
608
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
609
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
610
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
611
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
612
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
613
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
614
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
615
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
616
+
617
+  16. Limitation of Liability.
618
+
619
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
620
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
621
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
622
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
623
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
624
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
625
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
626
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
627
+SUCH DAMAGES.
628
+
629
+  17. Interpretation of Sections 15 and 16.
630
+
631
+  If the disclaimer of warranty and limitation of liability provided
632
+above cannot be given local legal effect according to their terms,
633
+reviewing courts shall apply local law that most closely approximates
634
+an absolute waiver of all civil liability in connection with the
635
+Program, unless a warranty or assumption of liability accompanies a
636
+copy of the Program in return for a fee.
637
+
638
+                     END OF TERMS AND CONDITIONS
639
+
640
+            How to Apply These Terms to Your New Programs
641
+
642
+  If you develop a new program, and you want it to be of the greatest
643
+possible use to the public, the best way to achieve this is to make it
644
+free software which everyone can redistribute and change under these terms.
645
+
646
+  To do so, attach the following notices to the program.  It is safest
647
+to attach them to the start of each source file to most effectively
648
+state the exclusion of warranty; and each file should have at least
649
+the "copyright" line and a pointer to where the full notice is found.
650
+
651
+    <one line to give the program's name and a brief idea of what it does.>
652
+    Copyright (C) <year>  <name of author>
653
+
654
+    This program is free software: you can redistribute it and/or modify
655
+    it under the terms of the GNU General Public License as published by
656
+    the Free Software Foundation, either version 3 of the License, or
657
+    (at your option) any later version.
658
+
659
+    This program is distributed in the hope that it will be useful,
660
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
661
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
662
+    GNU General Public License for more details.
663
+
664
+    You should have received a copy of the GNU General Public License
665
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
666
+
667
+Also add information on how to contact you by electronic and paper mail.
668
+
669
+  If the program does terminal interaction, make it output a short
670
+notice like this when it starts in an interactive mode:
671
+
672
+    <program>  Copyright (C) <year>  <name of author>
673
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
674
+    This is free software, and you are welcome to redistribute it
675
+    under certain conditions; type `show c' for details.
676
+
677
+The hypothetical commands `show w' and `show c' should show the appropriate
678
+parts of the General Public License.  Of course, your program's commands
679
+might be different; for a GUI interface, you would use an "about box".
680
+
681
+  You should also get your employer (if you work as a programmer) or school,
682
+if any, to sign a "copyright disclaimer" for the program, if necessary.
683
+For more information on this, and how to apply and follow the GNU GPL, see
684
+<https://www.gnu.org/licenses/>.
685
+
686
+  The GNU General Public License does not permit incorporating your program
687
+into proprietary programs.  If your program is a subroutine library, you
688
+may consider it more useful to permit linking proprietary applications with
689
+the library.  If this is what you want to do, use the GNU Lesser General
690
+Public License instead of this License.  But first, please read
691
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
692
+
693
+
694
+
695
+                   GNU LESSER GENERAL PUBLIC LICENSE
696
+                       Version 3, 29 June 2007
697
+
698
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
699
+ Everyone is permitted to copy and distribute verbatim copies
700
+ of this license document, but changing it is not allowed.
701
+
702
+
703
+  This version of the GNU Lesser General Public License incorporates
704
+the terms and conditions of version 3 of the GNU General Public
705
+License, supplemented by the additional permissions listed below.
706
+
707
+  0. Additional Definitions.
708
+
709
+  As used herein, "this License" refers to version 3 of the GNU Lesser
710
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
711
+General Public License.
712
+
713
+  "The Library" refers to a covered work governed by this License,
714
+other than an Application or a Combined Work as defined below.
715
+
716
+  An "Application" is any work that makes use of an interface provided
717
+by the Library, but which is not otherwise based on the Library.
718
+Defining a subclass of a class defined by the Library is deemed a mode
719
+of using an interface provided by the Library.
720
+
721
+  A "Combined Work" is a work produced by combining or linking an
722
+Application with the Library.  The particular version of the Library
723
+with which the Combined Work was made is also called the "Linked
724
+Version".
725
+
726
+  The "Minimal Corresponding Source" for a Combined Work means the
727
+Corresponding Source for the Combined Work, excluding any source code
728
+for portions of the Combined Work that, considered in isolation, are
729
+based on the Application, and not on the Linked Version.
730
+
731
+  The "Corresponding Application Code" for a Combined Work means the
732
+object code and/or source code for the Application, including any data
733
+and utility programs needed for reproducing the Combined Work from the
734
+Application, but excluding the System Libraries of the Combined Work.
735
+
736
+  1. Exception to Section 3 of the GNU GPL.
737
+
738
+  You may convey a covered work under sections 3 and 4 of this License
739
+without being bound by section 3 of the GNU GPL.
740
+
741
+  2. Conveying Modified Versions.
742
+
743
+  If you modify a copy of the Library, and, in your modifications, a
744
+facility refers to a function or data to be supplied by an Application
745
+that uses the facility (other than as an argument passed when the
746
+facility is invoked), then you may convey a copy of the modified
747
+version:
748
+
749
+   a) under this License, provided that you make a good faith effort to
750
+   ensure that, in the event an Application does not supply the
751
+   function or data, the facility still operates, and performs
752
+   whatever part of its purpose remains meaningful, or
753
+
754
+   b) under the GNU GPL, with none of the additional permissions of
755
+   this License applicable to that copy.
756
+
757
+  3. Object Code Incorporating Material from Library Header Files.
758
+
759
+  The object code form of an Application may incorporate material from
760
+a header file that is part of the Library.  You may convey such object
761
+code under terms of your choice, provided that, if the incorporated
762
+material is not limited to numerical parameters, data structure
763
+layouts and accessors, or small macros, inline functions and templates
764
+(ten or fewer lines in length), you do both of the following:
765
+
766
+   a) Give prominent notice with each copy of the object code that the
767
+   Library is used in it and that the Library and its use are
768
+   covered by this License.
769
+
770
+   b) Accompany the object code with a copy of the GNU GPL and this license
771
+   document.
772
+
773
+  4. Combined Works.
774
+
775
+  You may convey a Combined Work under terms of your choice that,
776
+taken together, effectively do not restrict modification of the
777
+portions of the Library contained in the Combined Work and reverse
778
+engineering for debugging such modifications, if you also do each of
779
+the following:
780
+
781
+   a) Give prominent notice with each copy of the Combined Work that
782
+   the Library is used in it and that the Library and its use are
783
+   covered by this License.
784
+
785
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
786
+   document.
787
+
788
+   c) For a Combined Work that displays copyright notices during
789
+   execution, include the copyright notice for the Library among
790
+   these notices, as well as a reference directing the user to the
791
+   copies of the GNU GPL and this license document.
792
+
793
+   d) Do one of the following:
794
+
795
+       0) Convey the Minimal Corresponding Source under the terms of this
796
+       License, and the Corresponding Application Code in a form
797
+       suitable for, and under terms that permit, the user to
798
+       recombine or relink the Application with a modified version of
799
+       the Linked Version to produce a modified Combined Work, in the
800
+       manner specified by section 6 of the GNU GPL for conveying
801
+       Corresponding Source.
802
+
803
+       1) Use a suitable shared library mechanism for linking with the
804
+       Library.  A suitable mechanism is one that (a) uses at run time
805
+       a copy of the Library already present on the user's computer
806
+       system, and (b) will operate properly with a modified version
807
+       of the Library that is interface-compatible with the Linked
808
+       Version.
809
+
810
+   e) Provide Installation Information, but only if you would otherwise
811
+   be required to provide such information under section 6 of the
812
+   GNU GPL, and only to the extent that such information is
813
+   necessary to install and execute a modified version of the
814
+   Combined Work produced by recombining or relinking the
815
+   Application with a modified version of the Linked Version. (If
816
+   you use option 4d0, the Installation Information must accompany
817
+   the Minimal Corresponding Source and Corresponding Application
818
+   Code. If you use option 4d1, you must provide the Installation
819
+   Information in the manner specified by section 6 of the GNU GPL
820
+   for conveying Corresponding Source.)
821
+
822
+  5. Combined Libraries.
823
+
824
+  You may place library facilities that are a work based on the
825
+Library side by side in a single library together with other library
826
+facilities that are not Applications and are not covered by this
827
+License, and convey such a combined library under terms of your
828
+choice, if you do both of the following:
829
+
830
+   a) Accompany the combined library with a copy of the same work based
831
+   on the Library, uncombined with any other library facilities,
832
+   conveyed under the terms of this License.
833
+
834
+   b) Give prominent notice with the combined library that part of it
835
+   is a work based on the Library, and explaining where to find the
836
+   accompanying uncombined form of the same work.
837
+
838
+  6. Revised Versions of the GNU Lesser General Public License.
839
+
840
+  The Free Software Foundation may publish revised and/or new versions
841
+of the GNU Lesser General Public License from time to time. Such new
842
+versions will be similar in spirit to the present version, but may
843
+differ in detail to address new problems or concerns.
844
+
845
+  Each version is given a distinguishing version number. If the
846
+Library as you received it specifies that a certain numbered version
847
+of the GNU Lesser General Public License "or any later version"
848
+applies to it, you have the option of following the terms and
849
+conditions either of that published version or of any later version
850
+published by the Free Software Foundation. If the Library as you
851
+received it does not specify a version number of the GNU Lesser
852
+General Public License, you may choose any version of the GNU Lesser
853
+General Public License ever published by the Free Software Foundation.
854
+
855
+  If the Library as you received it specifies that a proxy can decide
856
+whether future versions of the GNU Lesser General Public License shall
857
+apply, that proxy's public statement of acceptance of any version is
858
+permanent authorization for you to choose that version for the
859
+Library.
860
+
... ...
@@ -0,0 +1,174 @@
1
+declare module lib_trait {
2
+}
3
+/**
4
+ * @author fenris
5
+ */
6
+declare module lib_trait {
7
+    /**
8
+     * @author fenris
9
+     */
10
+    var _verbosity: number;
11
+    /**
12
+     * @author fenris
13
+     */
14
+    var _logprefix: string;
15
+    /**
16
+     * @author fenris
17
+     */
18
+    type type_domainparameters = {
19
+        [key: string]: any;
20
+    };
21
+    /**
22
+     * @author fenris
23
+     */
24
+    type type_domain = {
25
+        kind: string;
26
+        parameters?: type_domainparameters;
27
+    };
28
+    /**
29
+     * @author fenris
30
+     */
31
+    type type_instance<type_value> = {
32
+        domain: type_domain;
33
+        value: type_value;
34
+    };
35
+    /**
36
+     * @author fenris
37
+     */
38
+    type type_handler = (domain_parameters?: type_domainparameters) => any;
39
+    /**
40
+     * @author fenris
41
+     */
42
+    type type_facet_raw = {
43
+        shape?: lib_shape.type_shape;
44
+        description?: string;
45
+        implementation?: Function;
46
+    };
47
+    /**
48
+     * @author fenris
49
+     */
50
+    type type_condition = (attends: (trait_id: string, domain: type_domain) => boolean) => ((domain_parameters: type_domainparameters) => boolean);
51
+    /**
52
+     * @author fenris
53
+     */
54
+    type type_typechecker = (value: any, shape: lib_shape.type_shape, logger: (message: string) => void) => boolean;
55
+    /**
56
+     * @author fenris
57
+     */
58
+    function set_typechecker(typechecker: type_typechecker): void;
59
+    /**
60
+     * @author fenris
61
+     */
62
+    function domain_instance<type_value>(domain: type_domain, value: type_value): type_instance<type_value>;
63
+    /**
64
+     * @desc adds a trait
65
+     * @author fenris
66
+     */
67
+    function define(trait_id: string, variable_conditions: {
68
+        [variable_name: string]: Array<string>;
69
+    }, facets_raw: {
70
+        [facet_name: string]: type_facet_raw;
71
+    }): void;
72
+    /**
73
+     * @desc adhoc binding
74
+     * @author fenris
75
+     */
76
+    function attend(trait_id: string, domain_kind: string, bindings: {
77
+        [variable_name: string]: lib_shape.type_shape;
78
+    }, handlers: {
79
+        [facet_name: string]: type_handler;
80
+    }, condition?: type_condition): void;
81
+    /**
82
+     * @desc calls a facet from a trait according to a given domain
83
+     * @author fenris
84
+     */
85
+    function call(trait_id: string, facet_name: string, domain: type_domain, check?: boolean): any;
86
+    /**
87
+     * @author fenris
88
+     */
89
+    function explain(trait_id: string): string;
90
+    /**
91
+     * @author fenris
92
+     */
93
+    function explain_all(): string;
94
+}
95
+/**
96
+ * @author fenris
97
+ */
98
+declare module lib_trait {
99
+    /**
100
+     * @desc the ability to check for equality with another element of the same domain
101
+     * @author fenris
102
+     */
103
+    function define_collatable(): void;
104
+    /**
105
+     * @author fenris
106
+     */
107
+    function _collate(instance: any, other: any, domain?: {
108
+        kind: string;
109
+    }): boolean;
110
+}
111
+/**
112
+ * @author fenris
113
+ */
114
+declare module lib_trait {
115
+    /**
116
+     * @desc the ability to compare with another element of the same domain for determining if the first is "smaller than or equal to" the latter
117
+     * @author fenris
118
+     */
119
+    function define_comparable(): void;
120
+    /**
121
+     * @author fenris
122
+     */
123
+    function _compare(instance: any, other: any, domain?: {
124
+        kind: string;
125
+    }): boolean;
126
+}
127
+/**
128
+ * @author fenris
129
+ */
130
+declare module lib_trait {
131
+    /**
132
+     * @desc the ability to create an exact copy
133
+     * @author fenris
134
+     */
135
+    function define_clonable(): void;
136
+    /**
137
+     * @author fenris
138
+     */
139
+    function _clone(instance: any, domain?: {
140
+        kind: string;
141
+    }): any;
142
+}
143
+/**
144
+ * @author fenris
145
+ */
146
+declare module lib_trait {
147
+    /**
148
+     * @desc the ability to generate a string out of the element, which identifies it to a high degree
149
+     * @author fenris
150
+     */
151
+    function define_hashable(): void;
152
+    /**
153
+     * @author fenris
154
+     */
155
+    function _hash(instance: any, domain?: {
156
+        kind: string;
157
+    }): string;
158
+}
159
+/**
160
+ * @author fenris
161
+ */
162
+declare module lib_trait {
163
+    /**
164
+     * @desc the ability to map the element to a textual representation (most likely not injective)
165
+     * @author fenris
166
+     */
167
+    function define_showable(): void;
168
+    /**
169
+     * @author fenris
170
+     */
171
+    function _show(instance: any, domain?: {
172
+        kind: string;
173
+    }): string;
174
+}
... ...
@@ -0,0 +1,964 @@
1
+/*
2
+This file is part of »bacterio-plankton:trait«.
3
+
4
+Copyright 2016-2018 greenscale <info@greenscale.de>
5
+
6
+»bacterio-plankton:trait« is free software: you can redistribute it and/or modify
7
+it under the terms of the GNU Lesser General Public License as published by
8
+the Free Software Foundation, either version 3 of the License, or
9
+(at your option) any later version.
10
+
11
+»bacterio-plankton:trait« is distributed in the hope that it will be callful,
12
+but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+GNU Lesser General Public License for more details.
15
+
16
+You should have received a copy of the GNU Lesser General Public License
17
+along with »bacterio-plankton:trait«. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+var lib_trait;
20
+(function (lib_trait) {
21
+    /**
22
+     * @author fenris
23
+     */
24
+    function domain_make(_a, _make) {
25
+        var _b = _a["soft"], soft = _b === void 0 ? false : _b, kind = _a["kind"];
26
+        return {
27
+            "soft": soft,
28
+            "kind": kind
29
+        };
30
+    }
31
+    /**
32
+     * @author fenris
33
+     */
34
+    function domain_inspect(parameters, value, _inspect) {
35
+        var inspection = lib_shape.inspection_create();
36
+        if (value == undefined) {
37
+            if (parameters.soft) {
38
+                // all good
39
+            }
40
+            else {
41
+                lib_shape.inspection_add(inspection, "null is not allowed");
42
+            }
43
+        }
44
+        else {
45
+            var jstype_actual = typeof (value);
46
+            var jstype_expected = "object";
47
+            if (jstype_actual === jstype_expected) {
48
+                if ("domain" in value) {
49
+                    var domain_actual = value["domain"]["kind"];
50
+                    var domain_expected = parameters.kind;
51
+                    if (domain_actual == domain_expected) {
52
+                        // all good?
53
+                    }
54
+                    else {
55
+                        lib_shape.inspection_add(inspection, "expected domain-kind '" + domain_expected + "' but got '" + domain_actual + "'");
56
+                    }
57
+                }
58
+                else {
59
+                    lib_shape.inspection_add(inspection, "field 'domain' missing");
60
+                }
61
+            }
62
+            else {
63
+                lib_shape.inspection_add(inspection, "expected JS-type '" + jstype_expected + "' but got '" + jstype_actual + "'");
64
+            }
65
+        }
66
+        return inspection;
67
+    }
68
+    /**
69
+     * @author fenris
70
+     */
71
+    function domain_stance(parameters, bindings, _stance) {
72
+        return {
73
+            "name": "domain",
74
+            "parameters": {
75
+                "soft": parameters.soft,
76
+                "kind": parameters.kind
77
+            }
78
+        };
79
+    }
80
+    /**
81
+     * @author fenris
82
+     */
83
+    function domain_show(parameters, _show) {
84
+        var str;
85
+        // core
86
+        {
87
+            str = ("#" + parameters.kind);
88
+        }
89
+        /*
90
+        // parameters
91
+        {
92
+            str += (":" + JSON.stringify(parameters.parameters))
93
+        }
94
+         */
95
+        // soft
96
+        {
97
+            if (parameters.soft) {
98
+                str = "~" + str;
99
+            }
100
+        }
101
+        return str;
102
+    }
103
+    /**
104
+     * @author fenris
105
+     */
106
+    lib_shape.register({
107
+        "name": "domain",
108
+        "make": domain_make,
109
+        "inspect": domain_inspect,
110
+        "stance": domain_stance,
111
+        "show": domain_show
112
+    });
113
+})(lib_trait || (lib_trait = {}));
114
+/*
115
+This file is part of »bacterio-plankton:trait«.
116
+
117
+Copyright 2016-2018 greenscale <info@greenscale.de>
118
+
119
+»bacterio-plankton:trait« is free software: you can redistribute it and/or modify
120
+it under the terms of the GNU Lesser General Public License as published by
121
+the Free Software Foundation, either version 3 of the License, or
122
+(at your option) any later version.
123
+
124
+»bacterio-plankton:trait« is distributed in the hope that it will be callful,
125
+but WITHOUT ANY WARRANTY; without even the implied warranty of
126
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
127
+GNU Lesser General Public License for more details.
128
+
129
+You should have received a copy of the GNU Lesser General Public License
130
+along with »bacterio-plankton:trait«. If not, see <http://www.gnu.org/licenses/>.
131
+ */
132
+/**
133
+ * @author fenris
134
+ */
135
+var lib_trait;
136
+(function (lib_trait) {
137
+    /**
138
+     * @author fenris
139
+     */
140
+    lib_trait._verbosity = 1;
141
+    /**
142
+     * @author fenris
143
+     */
144
+    lib_trait._logprefix = "[lib_trait] ";
145
+    /**
146
+     * @desc holds all defined traits
147
+     * @author fenris
148
+     */
149
+    var _pool = {};
150
+    /**
151
+     * @author fenris
152
+     */
153
+    var _typechecker = function (value, shape, logger) {
154
+        var messages = lib_shape.inspect(shape, value).messages;
155
+        messages.forEach(logger);
156
+        return (messages.length === 0);
157
+    };
158
+    /**
159
+     * @author fenris
160
+     */
161
+    function log(_a) {
162
+        var message = _a["message"], _b = _a["kind"], kind = _b === void 0 ? "log" : _b, _c = _a["level"], level = _c === void 0 ? 0 : _c;
163
+        if (level <= lib_trait._verbosity) {
164
+            var message_ = "" + lib_trait._logprefix + message;
165
+            switch (kind) {
166
+                default:
167
+                case "log": {
168
+                    console.log(message_);
169
+                    break;
170
+                }
171
+                case "information":
172
+                case "info": {
173
+                    console.info(message_);
174
+                    break;
175
+                }
176
+                case "warning":
177
+                case "warn": {
178
+                    console.warn(message_);
179
+                    break;
180
+                }
181
+                case "error":
182
+                case "err": {
183
+                    console.error(message_);
184
+                    break;
185
+                }
186
+            }
187
+        }
188
+    }
189
+    /**
190
+     * @author fenris
191
+     */
192
+    function set_typechecker(typechecker) {
193
+        _typechecker = typechecker;
194
+    }
195
+    lib_trait.set_typechecker = set_typechecker;
196
+    /**
197
+     * @author fenris
198
+     */
199
+    function domain_instance(domain, value) {
200
+        return { "domain": domain, "value": value };
201
+    }
202
+    lib_trait.domain_instance = domain_instance;
203
+    /**
204
+     * @desc adds a trait
205
+     * @author fenris
206
+     */
207
+    function define(trait_id, variable_conditions, facets_raw) {
208
+        if (trait_id in _pool) {
209
+            var message = "trait '" + trait_id + "' already registered";
210
+            throw (new Error(message));
211
+        }
212
+        else {
213
+            var trait_1 = {
214
+                "variables": {},
215
+                "facets": {},
216
+                "attendants": {}
217
+            };
218
+            Object.keys(variable_conditions).forEach(function (variable_name) {
219
+                var variable = {
220
+                    "conditions": variable_conditions[variable_name],
221
+                    "bindings": {}
222
+                };
223
+                trait_1.variables[variable_name] = variable;
224
+            });
225
+            Object.keys(facets_raw).forEach(function (facet_name) {
226
+                var facet_raw = facets_raw[facet_name];
227
+                var facet = {
228
+                    "shape": lib_shape.make(facet_raw.shape || { "name": "any" }),
229
+                    "description": facet_raw.description,
230
+                    "implementation": facet_raw.implementation,
231
+                    "handlers": {}
232
+                };
233
+                trait_1.facets[facet_name] = facet;
234
+            });
235
+            _pool[trait_id] = trait_1;
236
+        }
237
+    }
238
+    lib_trait.define = define;
239
+    /**
240
+     * @desc adhoc binding
241
+     * @author fenris
242
+     */
243
+    function attend(trait_id, domain_kind, bindings, handlers, condition) {
244
+        if (condition === void 0) { condition = null; }
245
+        var strict_binding = true;
246
+        var strict_handling = true;
247
+        if (!_pool.hasOwnProperty(trait_id)) {
248
+            var message = "no trait '" + trait_id + "'";
249
+            throw (new Error(message));
250
+        }
251
+        else {
252
+            var trait_2 = _pool[trait_id];
253
+            // assignments
254
+            {
255
+                // variables
256
+                {
257
+                    Object.keys(bindings).forEach(function (variable_name) {
258
+                        if (!trait_2.variables.hasOwnProperty(variable_name)) {
259
+                            var message = "";
260
+                            message += "no variable '" + variable_name + "'";
261
+                            message += " to bind in trait '" + trait_id + "'";
262
+                            log({ "message": message, "kind": "warning" });
263
+                            // throw (new Error(message));
264
+                        }
265
+                        else {
266
+                            var variable = trait_2.variables[variable_name];
267
+                            if (variable.bindings.hasOwnProperty(domain_kind)) {
268
+                                var message = "";
269
+                                message += "variable '" + variable_name + "'";
270
+                                message += " already bound for domain '" + domain_kind + "'";
271
+                                message += " in trait '" + trait_id + "'";
272
+                                throw (new Error(message));
273
+                            }
274
+                            else {
275
+                                variable.bindings[domain_kind] = lib_shape.make(bindings[variable_name]);
276
+                            }
277
+                        }
278
+                    });
279
+                }
280
+                // facets
281
+                {
282
+                    Object.keys(handlers).forEach(function (facet_name) {
283
+                        if (!trait_2.facets.hasOwnProperty(facet_name)) {
284
+                            var message = "";
285
+                            message += "no facet '" + facet_name + "'";
286
+                            message += " to implement at trait '" + trait_id + "'";
287
+                            log({ "kind": "warning", "message": message });
288
+                            // throw (new Error(message));
289
+                        }
290
+                        else {
291
+                            var facet = trait_2.facets[facet_name];
292
+                            var intrinsic = (facet.implementation != undefined);
293
+                            if (intrinsic) {
294
+                                var message = "shadowing intrinsic facet '" + facet_name + "'";
295
+                                console.warn(message);
296
+                            }
297
+                            else {
298
+                                // do nothing
299
+                            }
300
+                            if (facet.handlers.hasOwnProperty(domain_kind)) {
301
+                                var message = "";
302
+                                message += "facet '" + facet_name + "'";
303
+                                message += " already implemented in domain '" + domain_kind + "'";
304
+                                message += " at trait '" + trait_id + "'";
305
+                                throw (new Error(message));
306
+                            }
307
+                            else {
308
+                                facet.handlers[domain_kind] = handlers[facet_name];
309
+                            }
310
+                        }
311
+                    });
312
+                }
313
+                // attendants
314
+                {
315
+                    trait_2.attendants[domain_kind] = {
316
+                        "condition": condition
317
+                    };
318
+                }
319
+            }
320
+            // checks
321
+            {
322
+                var messages_1 = [];
323
+                // variables
324
+                {
325
+                    if (strict_binding) {
326
+                        var variable_names_given_1 = Object.keys(bindings);
327
+                        var variable_names_present = Object.keys(trait_2.variables);
328
+                        var variable_names_missing = variable_names_present.filter(function (variable_name) { return (!variable_names_given_1.some(function (variable_name_) { return (variable_name == variable_name_); })); });
329
+                        variable_names_missing.forEach(function (variable_name) {
330
+                            var message = "binding missing for variable '" + variable_name + "'";
331
+                            messages_1.push(message);
332
+                        });
333
+                    }
334
+                    else {
335
+                        // do nothing
336
+                    }
337
+                }
338
+                // facets
339
+                {
340
+                    if (strict_handling) {
341
+                        var facet_names_given_1 = Object.keys(handlers);
342
+                        var facet_names_needed = (Object.keys(trait_2.facets).filter(function (facet_name) { return (trait_2.facets[facet_name].implementation == undefined); }));
343
+                        var facet_names_missing = (facet_names_needed.filter(function (facet_name) { return (!facet_names_given_1.some(function (facet_name_) { return (facet_name === facet_name_); })); }));
344
+                        facet_names_missing.forEach(function (facet_name) {
345
+                            var message = "implementation missing for the facet '" + facet_name + "'";
346
+                            messages_1.push(message);
347
+                        });
348
+                    }
349
+                    else {
350
+                        // do nothing
351
+                    }
352
+                }
353
+                if (messages_1.length > 0) {
354
+                    var message = "";
355
+                    message += "assignment of domain '" + domain_kind + "'";
356
+                    message += " to trait '" + trait_id + "'";
357
+                    message += " incomplete: " + messages_1.join(", ");
358
+                    throw (new Error(message));
359
+                }
360
+            }
361
+        }
362
+    }
363
+    lib_trait.attend = attend;
364
+    /**
365
+     * @desc calls a facet from a trait according to a given domain
366
+     * @author fenris
367
+     */
368
+    function call(trait_id, facet_name, domain, check) {
369
+        if (check === void 0) { check = true; }
370
+        if (!_pool.hasOwnProperty(trait_id)) {
371
+            var message = "no trait '" + trait_id + "'";
372
+            throw (new Error(message));
373
+        }
374
+        else {
375
+            var trait_3 = _pool[trait_id];
376
+            if (!trait_3.facets.hasOwnProperty(facet_name)) {
377
+                var message = "no facet '" + facet_name + "' in trait '" + trait_id + "'";
378
+                throw (new Error(message));
379
+            }
380
+            else {
381
+                var facet = trait_3.facets[facet_name];
382
+                var intrinsic = (facet.implementation !== undefined);
383
+                var result = void 0;
384
+                if (intrinsic) {
385
+                    result = facet.implementation(function (facet_name_) { return call(trait_id, facet_name_, domain, check); });
386
+                }
387
+                else {
388
+                    if (!facet.handlers.hasOwnProperty(domain.kind)) {
389
+                        var message = "";
390
+                        message += "implementation missing";
391
+                        message += " at trait '" + trait_id + "'";
392
+                        message += " for facet '" + facet_name + "'";
393
+                        message += " in domain '" + domain.kind + "'";
394
+                        throw (new Error(message));
395
+                    }
396
+                    else {
397
+                        var show_shape = (function (shape) { return lib_shape.show(shape); });
398
+                        var handler = facet.handlers[domain.kind];
399
+                        var bindings_1 = {};
400
+                        Object.keys(trait_3.variables).forEach(function (variable_name) {
401
+                            bindings_1[variable_name] = trait_3.variables[variable_name].bindings[domain.kind];
402
+                        });
403
+                        result = handler(domain.parameters);
404
+                        if (check
405
+                            &&
406
+                                (_typechecker !== null)
407
+                            &&
408
+                                (facet.shape !== undefined)) {
409
+                            var shape = lib_shape.stance(facet.shape, bindings_1);
410
+                            // console.info("expected shape of result: " + lib_shape.show(shape)); console.info("result: ", result);
411
+                            var valid = _typechecker(result, shape, function (message) { return log({ "kind": "warning", "message": "[typechecker] [result] " + message }); });
412
+                            if (!valid) {
413
+                                var message = "";
414
+                                message += "result '" + instance_show(result) + "'";
415
+                                message += " doesn't match the expected type '" + show_shape(shape) + "'";
416
+                                message += " at trait '" + trait_id + "'";
417
+                                message += " for facet '" + facet_name + "'";
418
+                                message += " in domain '" + domain.kind + "'";
419
+                                log({ "kind": "warning", "message": message });
420
+                            }
421
+                            {
422
+                                var condition = trait_3.attendants[domain.kind].condition;
423
+                                if (condition != null) {
424
+                                    var attends = function (trait_id_, domain_) {
425
+                                        return (_pool.hasOwnProperty(trait_id_) && _pool[trait_id_].attendants.hasOwnProperty(domain_.kind));
426
+                                    };
427
+                                    if (!condition(attends)(domain.parameters)) {
428
+                                        var message = "";
429
+                                        message += "condition not fulfilled";
430
+                                        message += " at trait '" + trait_id + "'";
431
+                                        message += " for facet '" + facet_name + "'";
432
+                                        message += " in domain '" + domain.kind + "'";
433
+                                        log({ "kind": "warning", "message": message });
434
+                                    }
435
+                                    else {
436
+                                        // do nothing
437
+                                    }
438
+                                }
439
+                                else {
440
+                                    // do nothing
441
+                                }
442
+                            }
443
+                        }
444
+                    }
445
+                }
446
+                return result;
447
+            }
448
+        }
449
+    }
450
+    lib_trait.call = call;
451
+    /**
452
+     * @author fenris
453
+     */
454
+    function explain(trait_id) {
455
+        if (!_pool.hasOwnProperty(trait_id)) {
456
+            var message = "no trait '" + trait_id + "'";
457
+            throw (new Error(message));
458
+        }
459
+        else {
460
+            var trait_4 = _pool[trait_id];
461
+            var str_1 = "";
462
+            // head
463
+            {
464
+                str_1 += "<<" + trait_id + ">>";
465
+                str_1 += (" "
466
+                    +
467
+                        "("
468
+                    +
469
+                        (Object.keys(trait_4.variables)
470
+                            .map(function (variable_name) {
471
+                            var shape = lib_shape.make({
472
+                                "name": "variable",
473
+                                "parameters": {
474
+                                    "name": variable_name
475
+                                }
476
+                            });
477
+                            return lib_shape.show(shape);
478
+                        })
479
+                            .join(","))
480
+                    +
481
+                        ")");
482
+                str_1 += "\n";
483
+            }
484
+            // facets
485
+            {
486
+                Object.keys(trait_4.facets)
487
+                    .forEach(function (facet_name) {
488
+                    var facet = trait_4.facets[facet_name];
489
+                    // str += "\t";
490
+                    str_1 += "* ";
491
+                    str_1 += ((facet.implementation != undefined) ? ("[" + facet_name + "]") : facet_name);
492
+                    str_1 += (" : " + lib_shape.show(facet.shape));
493
+                    if (facet.description !== undefined) {
494
+                        str_1 += (" ~ " + "" + facet.description + "");
495
+                    }
496
+                    str_1 += "\n";
497
+                });
498
+            }
499
+            return str_1;
500
+        }
501
+    }
502
+    lib_trait.explain = explain;
503
+    /**
504
+     * @author fenris
505
+     */
506
+    function explain_all() {
507
+        return Object.keys(_pool).map(function (trait_id) { return explain(trait_id); }).join("\n");
508
+    }
509
+    lib_trait.explain_all = explain_all;
510
+})(lib_trait || (lib_trait = {}));
511
+/*
512
+This file is part of »bacterio-plankton:trait«.
513
+
514
+Copyright 2016-2018 greenscale <info@greenscale.de>
515
+
516
+»bacterio-plankton:trait« is free software: you can redistribute it and/or modify
517
+it under the terms of the GNU Lesser General Public License as published by
518
+the Free Software Foundation, either version 3 of the License, or
519
+(at your option) any later version.
520
+
521
+»bacterio-plankton:trait« is distributed in the hope that it will be callful,
522
+but WITHOUT ANY WARRANTY; without even the implied warranty of
523
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
524
+GNU Lesser General Public License for more details.
525
+
526
+You should have received a copy of the GNU Lesser General Public License
527
+along with »bacterio-plankton:trait«. If not, see <http://www.gnu.org/licenses/>.
528
+ */
529
+/**
530
+ * @author fenris
531
+ */
532
+var lib_trait;
533
+(function (lib_trait) {
534
+    /**
535
+     * @desc the ability to check for equality with another element of the same domain
536
+     * @author fenris
537
+     */
538
+    function define_collatable() {
539
+        lib_trait.define("collatable", {
540
+            "value": []
541
+        }, {
542
+            "collate": {
543
+                "shape": {
544
+                    "name": "function",
545
+                    "parameters": {
546
+                        "shape_input": {
547
+                            "name": "variable",
548
+                            "parameters": {
549
+                                "name": "value"
550
+                            }
551
+                        },
552
+                        "shape_output": {
553
+                            "name": "function",
554
+                            "parameters": {
555
+                                "shape_input": {
556
+                                    "name": "variable",
557
+                                    "parameters": {
558
+                                        "name": "value"
559
+                                    }
560
+                                },
561
+                                "shape_output": {
562
+                                    "name": "boolean"
563
+                                }
564
+                            }
565
+                        }
566
+                    }
567
+                }
568
+            }
569
+        });
570
+        lib_trait.attend("collatable", "crude", {
571
+            "value": {
572
+                "name": "any"
573
+            }
574
+        }, {
575
+            "collate": function () { return function (instance) { return function (other) {
576
+                if (typeof (instance) === "object") {
577
+                    if (instance == null) {
578
+                        return (other == null);
579
+                    }
580
+                    else {
581
+                        if ("_collate" in instance) {
582
+                            return instance["_collate"](other);
583
+                        }
584
+                        else {
585
+                            var message = ("[collate]" + " " + "object has no such method");
586
+                            throw (new Error(message));
587
+                        }
588
+                    }
589
+                }
590
+                else {
591
+                    if (lib_trait._verbosity >= 1) {
592
+                        var message = ("[collate]" + " " + "primitive value; using default implementation");
593
+                        console.warn(message);
594
+                    }
595
+                    return (instance === other);
596
+                }
597
+            }; }; }
598
+        });
599
+    }
600
+    lib_trait.define_collatable = define_collatable;
601
+    /**
602
+     * @author fenris
603
+     */
604
+    function _collate(instance, other, domain) {
605
+        if (domain === void 0) { domain = { "kind": "crude" }; }
606
+        return lib_trait.call("collatable", "collate", domain)(instance)(other);
607
+    }
608
+    lib_trait._collate = _collate;
609
+    define_collatable();
610
+})(lib_trait || (lib_trait = {}));
611
+/*
612
+This file is part of »bacterio-plankton:trait«.
613
+
614
+Copyright 2016-2018 greenscale <info@greenscale.de>
615
+
616
+»bacterio-plankton:trait« is free software: you can redistribute it and/or modify
617
+it under the terms of the GNU Lesser General Public License as published by
618
+the Free Software Foundation, either version 3 of the License, or
619
+(at your option) any later version.
620
+
621
+»bacterio-plankton:trait« is distributed in the hope that it will be callful,
622
+but WITHOUT ANY WARRANTY; without even the implied warranty of
623
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
624
+GNU Lesser General Public License for more details.
625
+
626
+You should have received a copy of the GNU Lesser General Public License
627
+along with »bacterio-plankton:trait«. If not, see <http://www.gnu.org/licenses/>.
628
+ */
629
+/**
630
+ * @author fenris
631
+ */
632
+var lib_trait;
633
+(function (lib_trait) {
634
+    /**
635
+     * @desc the ability to compare with another element of the same domain for determining if the first is "smaller than or equal to" the latter
636
+     * @author fenris
637
+     */
638
+    function define_comparable() {
639
+        lib_trait.define("comparable", {
640
+            "value": []
641
+        }, {
642
+            "compare": {
643
+                "shape": {
644
+                    "name": "function",
645
+                    "parameters": {
646
+                        "shape_input": {
647
+                            "name": "variable",
648
+                            "parameters": {
649
+                                "name": "value"
650
+                            }
651
+                        },
652
+                        "shape_output": {
653
+                            "name": "function",
654
+                            "parameters": {
655
+                                "shape_input": {
656
+                                    "name": "variable",
657
+                                    "parameters": {
658
+                                        "name": "value"
659
+                                    }
660
+                                },
661
+                                "shape_output": {
662
+                                    "name": "boolean"
663
+                                }
664
+                            }
665
+                        }
666
+                    }
667
+                }
668
+            }
669
+        });
670
+        lib_trait.attend("comparable", "crude", {
671
+            "value": {
672
+                "name": "any"
673
+            }
674
+        }, {
675
+            "compare": function () { return function (instance) { return function (other) {
676
+                if (typeof (instance) === "object") {
677
+                    if ("_compare" in instance) {
678
+                        return instance["_compare"](other);
679
+                    }
680
+                    else {
681
+                        throw (new Error("[compare]" + " " + "object has no such method"));
682
+                    }
683
+                }
684
+                else {
685
+                    if (lib_trait._verbosity >= 1) {
686
+                        console.warn("[compare]" + " " + "primitive value; using default implementation");
687
+                    }
688
+                    return (instance <= other);
689
+                }
690
+            }; }; }
691
+        });
692
+    }
693
+    lib_trait.define_comparable = define_comparable;
694
+    /**
695
+     * @author fenris
696
+     */
697
+    function _compare(instance, other, domain) {
698
+        if (domain === void 0) { domain = { "kind": "crude" }; }
699
+        return lib_trait.call("comparable", "compare", domain)(instance)(other);
700
+    }
701
+    lib_trait._compare = _compare;
702
+    define_comparable();
703
+})(lib_trait || (lib_trait = {}));
704
+/*
705
+This file is part of »bacterio-plankton:trait«.
706
+
707
+Copyright 2016-2018 greenscale <info@greenscale.de>
708
+
709
+»bacterio-plankton:trait« is free software: you can redistribute it and/or modify
710
+it under the terms of the GNU Lesser General Public License as published by
711
+the Free Software Foundation, either version 3 of the License, or
712
+(at your option) any later version.
713
+
714
+»bacterio-plankton:trait« is distributed in the hope that it will be callful,
715
+but WITHOUT ANY WARRANTY; without even the implied warranty of
716
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
717
+GNU Lesser General Public License for more details.
718
+
719
+You should have received a copy of the GNU Lesser General Public License
720
+along with »bacterio-plankton:trait«. If not, see <http://www.gnu.org/licenses/>.
721
+ */
722
+/**
723
+ * @author fenris
724
+ */
725
+var lib_trait;
726
+(function (lib_trait) {
727
+    /**
728
+     * @desc the ability to create an exact copy
729
+     * @author fenris
730
+     */
731
+    function define_clonable() {
732
+        lib_trait.define("clonable", {
733
+            "value": []
734
+        }, {
735
+            "clone": {
736
+                "shape": {
737
+                    "name": "function",
738
+                    "parameters": {
739
+                        "shape_input": {
740
+                            "name": "variable",
741
+                            "parameters": {
742
+                                "name": "value"
743
+                            }
744
+                        },
745
+                        "shape_output": {
746
+                            "name": "variable",
747
+                            "parameters": {
748
+                                "name": "value"
749
+                            }
750
+                        }
751
+                    }
752
+                }
753
+            }
754
+        });
755
+        lib_trait.attend("clonable", "crude", {
756
+            "value": {
757
+                "name": "any"
758
+            }
759
+        }, {
760
+            "clone": function () { return function (instance) {
761
+                if (typeof (instance) === "object") {
762
+                    if ("_clone" in instance) {
763
+                        return instance["_clone"]();
764
+                    }
765
+                    else {
766
+                        throw (new Error("[clone]" + " " + "object has no such method"));
767
+                    }
768
+                }
769
+                else {
770
+                    if (lib_trait._verbosity >= 1) {
771
+                        console.warn("[clone]" + " " + "primitive value; using default implementation");
772
+                    }
773
+                    return instance;
774
+                }
775
+            }; }
776
+        });
777
+    }
778
+    lib_trait.define_clonable = define_clonable;
779
+    /**
780
+     * @author fenris
781
+     */
782
+    function _clone(instance, domain) {
783
+        if (domain === void 0) { domain = { "kind": "crude" }; }
784
+        return lib_trait.call("clonable", "clone", domain)(instance);
785
+    }
786
+    lib_trait._clone = _clone;
787
+    define_clonable();
788
+})(lib_trait || (lib_trait = {}));
789
+/*
790
+This file is part of »bacterio-plankton:trait«.
791
+
792
+Copyright 2016-2018 greenscale <info@greenscale.de>
793
+
794
+»bacterio-plankton:trait« is free software: you can redistribute it and/or modify
795
+it under the terms of the GNU Lesser General Public License as published by
796
+the Free Software Foundation, either version 3 of the License, or
797
+(at your option) any later version.
798
+
799
+»bacterio-plankton:trait« is distributed in the hope that it will be callful,
800
+but WITHOUT ANY WARRANTY; without even the implied warranty of
801
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
802
+GNU Lesser General Public License for more details.
803
+
804
+You should have received a copy of the GNU Lesser General Public License
805
+along with »bacterio-plankton:trait«. If not, see <http://www.gnu.org/licenses/>.
806
+ */
807
+/**
808
+ * @author fenris
809
+ */
810
+var lib_trait;
811
+(function (lib_trait) {
812
+    /**
813
+     * @desc the ability to generate a string out of the element, which identifies it to a high degree
814
+     * @author fenris
815
+     */
816
+    function define_hashable() {
817
+        lib_trait.define("hashable", {
818
+            "value": []
819
+        }, {
820
+            "hash": {
821
+                "shape": {
822
+                    "name": "function",
823
+                    "parameters": {
824
+                        "shape_input": {
825
+                            "name": "variable",
826
+                            "parameters": {
827
+                                "name": "value"
828
+                            }
829
+                        },
830
+                        "shape_output": {
831
+                            "name": "string"
832
+                        }
833
+                    }
834
+                }
835
+            }
836
+        });
837
+        lib_trait.attend("hashable", "crude", {
838
+            "value": {
839
+                "name": "any"
840
+            }
841
+        }, {
842
+            "hash": function () { return function (thing) {
843
+                if (typeof (thing) === "object") {
844
+                    if ("_hash" in thing) {
845
+                        return thing["_hash"]();
846
+                    }
847
+                    else {
848
+                        var message = ("[hash]" + " " + "object has no such method");
849
+                        throw (new Error(message));
850
+                    }
851
+                }
852
+                else {
853
+                    if (lib_trait._verbosity >= 1) {
854
+                        var message = ("[hash]" + " " + "primitive value; using default implementation");
855
+                        console.warn(message);
856
+                    }
857
+                    return String(thing);
858
+                }
859
+            }; }
860
+        });
861
+    }
862
+    lib_trait.define_hashable = define_hashable;
863
+    /**
864
+     * @author fenris
865
+     */
866
+    function _hash(instance, domain) {
867
+        if (domain === void 0) { domain = { "kind": "crude" }; }
868
+        return lib_trait.call("hashable", "hash", domain)(instance);
869
+    }
870
+    lib_trait._hash = _hash;
871
+    define_hashable();
872
+})(lib_trait || (lib_trait = {}));
873
+/*
874
+This file is part of »bacterio-plankton:trait«.
875
+
876
+Copyright 2016-2018 greenscale <info@greenscale.de>
877
+
878
+»bacterio-plankton:trait« is free software: you can redistribute it and/or modify
879
+it under the terms of the GNU Lesser General Public License as published by
880
+the Free Software Foundation, either version 3 of the License, or
881
+(at your option) any later version.
882
+
883
+»bacterio-plankton:trait« is distributed in the hope that it will be callful,
884
+but WITHOUT ANY WARRANTY; without even the implied warranty of
885
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
886
+GNU Lesser General Public License for more details.
887
+
888
+You should have received a copy of the GNU Lesser General Public License
889
+along with »bacterio-plankton:trait«. If not, see <http://www.gnu.org/licenses/>.
890
+ */
891
+/**
892
+ * @author fenris
893
+ */
894
+var lib_trait;
895
+(function (lib_trait) {
896
+    /**
897
+     * @desc the ability to map the element to a textual representation (most likely not injective)
898
+     * @author fenris
899
+     */
900
+    function define_showable() {
901
+        lib_trait.define("showable", {
902
+            "value": []
903
+        }, {
904
+            "show": {
905
+                "shape": {
906
+                    "name": "function",
907
+                    "parameters": {
908
+                        "shape_input": {
909
+                            "name": "variable",
910
+                            "parameters": {
911
+                                "name": "value"
912
+                            }
913
+                        },
914
+                        "shape_output": {
915
+                            "name": "string",
916
+                            "parameters": {
917
+                                "soft": false
918
+                            }
919
+                        }
920
+                    }
921
+                }
922
+            }
923
+        });
924
+        lib_trait.attend("showable", "crude", {
925
+            "value": {
926
+                "name": "any"
927
+            }
928
+        }, {
929
+            "show": function () { return function (instance) {
930
+                if (typeof (instance) === "object") {
931
+                    if (instance == null) {
932
+                        return "NULL";
933
+                    }
934
+                    else {
935
+                        if ("_show" in instance) {
936
+                            return instance["_show"]();
937
+                        }
938
+                        else {
939
+                            // throw (new Error("[show]" + " " + "object has no such method"));
940
+                            return JSON.stringify(instance);
941
+                        }
942
+                    }
943
+                }
944
+                else {
945
+                    if (lib_trait._verbosity >= 1) {
946
+                        var message = ("[show]" + " " + "primitive value; using default implementation");
947
+                        // console.warn(message);
948
+                    }
949
+                    return String(instance);
950
+                }
951
+            }; }
952
+        });
953
+    }
954
+    lib_trait.define_showable = define_showable;
955
+    /**
956
+     * @author fenris
957
+     */
958
+    function _show(instance, domain) {
959
+        if (domain === void 0) { domain = { "kind": "crude" }; }
960
+        return lib_trait.call("showable", "show", domain)(instance);
961
+    }
962
+    lib_trait._show = _show;
963
+    define_showable();
964
+})(lib_trait || (lib_trait = {}));
... ...
@@ -0,0 +1,73 @@
1
+async function api_query
2
+(
3
+	action_name,
4
+	input
5
+)
6
+{
7
+	const client = lib_comm.client_http_construct
8
+	(
9
+		{
10
+			"protocol": "http",
11
+			"host": "localhost",
12
+			"port": 7777,
13
+			"path": "/foo/bar",
14
+		}
15
+	);
16
+	const message = JSON.stringify
17
+	(
18
+		{
19
+			"action": action_name,
20
+			"input": input,
21
+		}
22
+	);
23
+	const answer = await lib_comm.client_http_send(client, message);
24
+	if (! (answer.code === 200))
25
+	{
26
+		return Promise.reject("server side error");
27
+	}
28
+	else
29
+	{
30
+		const output = JSON.parse(answer.text);
31
+		return Promise.resolve(output);
32
+	}
33
+}
34
+
35
+
36
+/**
37
+ */
38
+function main
39
+(
40
+)
41
+{
42
+	document.querySelector("button").addEventListener
43
+	(
44
+		"click",
45
+		async function ()
46
+		{
47
+			const language_from = document.querySelector("select[name=language_from]").value;
48
+			const language_to = document.querySelector("select[name=language_to]").value;
49
+			const token = document.querySelector("input[name=token]").value;
50
+			const result = await api_query
51
+			(
52
+				"translate",
53
+				{
54
+					"language_from": language_from,
55
+					"language_to": language_to,
56
+					"token": token,
57
+				}
58
+			);
59
+			const dom_ul = document.querySelector("#result");
60
+			dom_ul.textContent = "";
61
+			for (const entry of result)
62
+			{
63
+				let dom_li = document.createElement("li");
64
+				dom_li.textContent = (`[${entry.language_from}] ${entry.value_from} ~ [${entry.language_to}] ${entry.value_to}`);
65
+				dom_ul.appendChild(dom_li);
66
+			}
67
+		}
68
+	);
69
+}
70
+
71
+
72
+document.addEventListener("DOMContentLoaded", function (event) {main();});
73
+
... ...
@@ -0,0 +1,43 @@
1
+<!DOCTYPE HTML>
2
+<html>
3
+	<head>
4
+		<meta charset="utf-8"/>
5
+		<link rel="stylesheet" type="text/css" href="style.css"/>
6
+		<script type="text/javascript" src="logic.js"></script>
7
+	</head>
8
+	<body>
9
+		<select name="language_from">
10
+			<option value="_">*</option>
11
+			<option value="afr">afr</option>
12
+			<option value="dan">dan</option>
13
+			<option value="deu">deu</option>
14
+			<option value="eng">eng</option>
15
+			<option value="flk">flk</option>
16
+			<option value="gem">gem</option>
17
+			<option value="isl">isl</option>
18
+			<option value="nld">nld</option>
19
+			<option value="nob">nob</option>
20
+			<option value="swe">swe</option>
21
+			<option value="yid">yid</option>
22
+		</select>
23
+		<select name="language_to">
24
+			<option value="_">*</option>
25
+			<option value="afr">afr</option>
26
+			<option value="dan">dan</option>
27
+			<option value="deu">deu</option>
28
+			<option value="eng">eng</option>
29
+			<option value="flk">flk</option>
30
+			<option value="gem">gem</option>
31
+			<option value="isl">isl</option>
32
+			<option value="nld">nld</option>
33
+			<option value="nob">nob</option>
34
+			<option value="swe">swe</option>
35
+			<option value="yid">yid</option>
36
+		</select>
37
+		<input type="text" name="token"/>
38
+		<button>query</button>
39
+		<ul id="result">
40
+		</ul>
41
+	</body>
42
+</html>
43
+
... ...
@@ -0,0 +1,4 @@
1
+#!/usr/bin/env bash
2
+
3
+make --file=tools/makefile
4
+
... ...
@@ -0,0 +1,45 @@
1
+# directories
2
+dir_lib := lib
3
+dir_source := source
4
+dir_temp := temp
5
+dir_build := build
6
+
7
+## commands
8
+cmd_log := echo "--"
9
+cmd_copy := cp --recursive --update --verbose
10
+cmd_concatenate := cat
11
+cmd_dir_make := mkdir --parents
12
+
13
+## rules
14
+all: ${dir_build}/index.html ${dir_build}/logic.js ${dir_build}/style.css
15
+.PHONY: all
16
+
17
+${dir_temp}/plankton.d.ts:
18
+	@ ${cmd_log} "fetching plankton declaration"
19
+	@ ${cmd_dir_make} ${dir_temp}
20
+	@ schwamm --include=${dir_lib}/plankton/plankton.swm.json --output=dump:logic-decl > ${dir_temp}/plankton.d.ts
21
+
22
+${dir_temp}/plankton.js:
23
+	@ ${cmd_log} "fetching plankton implementation"
24
+	@ ${cmd_dir_make} ${dir_temp}
25
+	@ schwamm --include=${dir_lib}/plankton/plankton.swm.json --output=dump:logic-impl > ${dir_temp}/plankton.js
26
+
27
+${dir_build}/index.html: ${dir_source}/structure.html
28
+	@ ${cmd_log} "structure …"
29
+	@ ${cmd_dir_make} ${dir_build}
30
+	@ ${cmd_copy} $^ $@
31
+
32
+${dir_temp}/logic-unlinked.js: ${dir_source}/logic.js
33
+	@ ${cmd_log} "logic:compiling …"
34
+	@ ${cmd_dir_make} ${dir_temp}
35
+	@ ${cmd_concatenate} $^ > $@
36
+
37
+${dir_build}/logic.js: ${dir_temp}/plankton.js ${dir_temp}/logic-unlinked.js
38
+	@ ${cmd_log} "logic:linking …"
39
+	@ ${cmd_dir_make} ${dir_build}
40
+	@ ${cmd_concatenate} $^ > $@
41
+
42
+${dir_build}/style.css: ${dir_source}/style.css
43
+	@ ${cmd_log} "style …"
44
+	@ ${cmd_concatenate} $^ > $@
45
+
... ...
@@ -0,0 +1,4 @@
1
+#!/usr/bin/env sh
2
+
3
+web-server build 8888
4
+
0 5