copious-mail 0.0.0-stage → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/LICENSE +504 -0
  2. package/README.md +143 -2
  3. package/bin/index.js +345 -0
  4. package/client/copiousLogo.svg +123 -0
  5. package/client/hosted.html +5259 -0
  6. package/client/mail_styles.css +40 -0
  7. package/client/mikado.bundle.debug.js +1406 -0
  8. package/client/mikado.bundle.min.js +68 -0
  9. package/client/mikado.bundle.module.debug.js +1401 -0
  10. package/client/mikado.bundle.module.min.js +67 -0
  11. package/client/mikado.bundle.profiler.debug.js +1490 -0
  12. package/client/mikado.es5.debug.js +1995 -0
  13. package/client/mikado.es5.min.js +85 -0
  14. package/client/mikado.light.debug.js +535 -0
  15. package/client/mikado.light.min.js +29 -0
  16. package/client/mikado.light.module.debug.js +530 -0
  17. package/data/user_list.db +14 -0
  18. package/index.html +7242 -0
  19. package/index.js +5 -0
  20. package/jsconfig.json +32 -0
  21. package/lib/mail_repo_bridge_ops.js +1177 -0
  22. package/lib/utils.js +70 -0
  23. package/lib/websocket_con.js +249 -0
  24. package/mail_bridge.conf +10 -0
  25. package/package.json +41 -5
  26. package/svelte-src/App.svelte +2513 -0
  27. package/svelte-src/ContactGrid.svelte +98 -0
  28. package/svelte-src/FloatWindow.svelte +181 -0
  29. package/svelte-src/MessageDisplay.svelte +230 -0
  30. package/svelte-src/MessageEditor.svelte +664 -0
  31. package/svelte-src/MessageListEditor.svelte +133 -0
  32. package/svelte-src/Thing.svelte +190 -0
  33. package/svelte-src/ThingFull.svelte +117 -0
  34. package/svelte-src/ipfs_profile_proxy.js +923 -0
  35. package/svelte-src/main.js +10 -0
  36. package/svelte-src/search_box.js +69 -0
  37. package/svelte-src/utilities.js +180 -0
  38. package/test/c +28 -0
  39. package/test/copiousLogo.svg +123 -0
  40. package/test/index.html +4408 -0
  41. package/test/index.js +244 -0
  42. package/test/mail_styles.css +40 -0
  43. package/test/mikado.bundle.debug.js +1406 -0
  44. package/test/mikado.bundle.min.js +68 -0
  45. package/test/mikado.bundle.module.debug.js +1401 -0
  46. package/test/mikado.bundle.module.min.js +67 -0
  47. package/test/mikado.bundle.profiler.debug.js +1490 -0
  48. package/test/mikado.es5.debug.js +1995 -0
  49. package/test/mikado.es5.min.js +85 -0
  50. package/test/mikado.light.debug.js +535 -0
  51. package/test/mikado.light.min.js +29 -0
  52. package/test/mikado.light.module.debug.js +530 -0
  53. package/test/tpl/partial/attachment_edit.es5.js +1 -0
  54. package/test/tpl/partial/attachment_edit.html +5 -0
  55. package/test/tpl/partial/attachment_edit.js +1 -0
  56. package/test/tpl/partial/attachment_view.es5.js +1 -0
  57. package/test/tpl/partial/attachment_view.html +1 -0
  58. package/test/tpl/partial/attachment_view.js +1 -0
  59. package/test/tpl/partial/contact_list.es5.js +1 -0
  60. package/test/tpl/partial/contact_list.html +9 -0
  61. package/test/tpl/partial/contact_list.js +1 -0
  62. package/test/tpl/partial/draft_list.es5.js +1 -0
  63. package/test/tpl/partial/draft_list.html +8 -0
  64. package/test/tpl/partial/draft_list.js +1 -0
  65. package/test/tpl/partial/inbox_list.es5.js +1 -0
  66. package/test/tpl/partial/inbox_list.html +7 -0
  67. package/test/tpl/partial/inbox_list.js +1 -0
  68. package/test/tpl/partial/notify_list.es5.js +1 -0
  69. package/test/tpl/partial/notify_list.html +8 -0
  70. package/test/tpl/partial/notify_list.js +1 -0
  71. package/test/tpl/partial/sent_list.es5.js +1 -0
  72. package/test/tpl/partial/sent_list.html +7 -0
  73. package/test/tpl/partial/sent_list.js +1 -0
  74. package/test/tpl/partial/spam_list.es5.js +1 -0
  75. package/test/tpl/partial/spam_list.html +8 -0
  76. package/test/tpl/partial/spam_list.js +1 -0
  77. package/test/tpl/partial/trash_list.es5.js +1 -0
  78. package/test/tpl/partial/trash_list.html +7 -0
  79. package/test/tpl/partial/trash_list.js +1 -0
  80. package/test/tpl/partial/user.es5.js +1 -0
  81. package/test/tpl/partial/user.html +18 -0
  82. package/test/tpl/partial/user.js +1 -0
  83. package/tools/jsdoc.conf +47 -0
  84. package/tools/templates/docdash/publish.js +843 -0
  85. package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  86. package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  87. package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  88. package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  89. package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  90. package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  91. package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  92. package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  93. package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  94. package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  95. package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  96. package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  97. package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  98. package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  99. package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  100. package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  101. package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  102. package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  103. package/tools/templates/docdash/static/scripts/collapse.js +67 -0
  104. package/tools/templates/docdash/static/scripts/commonNav.js +28 -0
  105. package/tools/templates/docdash/static/scripts/linenumber.js +25 -0
  106. package/tools/templates/docdash/static/scripts/nav.js +12 -0
  107. package/tools/templates/docdash/static/scripts/polyfill.js +4 -0
  108. package/tools/templates/docdash/static/scripts/prettify/Apache-License-2.0.txt +202 -0
  109. package/tools/templates/docdash/static/scripts/prettify/lang-css.js +2 -0
  110. package/tools/templates/docdash/static/scripts/prettify/prettify.js +28 -0
  111. package/tools/templates/docdash/static/scripts/search.js +99 -0
  112. package/tools/templates/docdash/static/styles/jsdoc.css +803 -0
  113. package/tools/templates/docdash/static/styles/prettify.css +80 -0
  114. package/tools/templates/docdash/tmpl/augments.tmpl +10 -0
  115. package/tools/templates/docdash/tmpl/container.tmpl +203 -0
  116. package/tools/templates/docdash/tmpl/details.tmpl +152 -0
  117. package/tools/templates/docdash/tmpl/example.tmpl +2 -0
  118. package/tools/templates/docdash/tmpl/examples.tmpl +13 -0
  119. package/tools/templates/docdash/tmpl/exceptions.tmpl +32 -0
  120. package/tools/templates/docdash/tmpl/layout.tmpl +102 -0
  121. package/tools/templates/docdash/tmpl/mainpage.tmpl +15 -0
  122. package/tools/templates/docdash/tmpl/members.tmpl +38 -0
  123. package/tools/templates/docdash/tmpl/method.tmpl +132 -0
  124. package/tools/templates/docdash/tmpl/modifies.tmpl +14 -0
  125. package/tools/templates/docdash/tmpl/namespace.tmpl +133 -0
  126. package/tools/templates/docdash/tmpl/params.tmpl +132 -0
  127. package/tools/templates/docdash/tmpl/properties.tmpl +107 -0
  128. package/tools/templates/docdash/tmpl/returns.tmpl +19 -0
  129. package/tools/templates/docdash/tmpl/source.tmpl +8 -0
  130. package/tools/templates/docdash/tmpl/tutorial.tmpl +19 -0
  131. package/tools/templates/docdash/tmpl/type.tmpl +26 -0
  132. package/tools/templates/templates/docdash/publish.js +843 -0
  133. package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  134. package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  135. package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  136. package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  137. package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  138. package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  139. package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  140. package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  141. package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  142. package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  143. package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  144. package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  145. package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  146. package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  147. package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  148. package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  149. package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  150. package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  151. package/tools/templates/templates/docdash/static/scripts/collapse.js +67 -0
  152. package/tools/templates/templates/docdash/static/scripts/commonNav.js +28 -0
  153. package/tools/templates/templates/docdash/static/scripts/linenumber.js +25 -0
  154. package/tools/templates/templates/docdash/static/scripts/nav.js +12 -0
  155. package/tools/templates/templates/docdash/static/scripts/polyfill.js +4 -0
  156. package/tools/templates/templates/docdash/static/scripts/prettify/Apache-License-2.0.txt +202 -0
  157. package/tools/templates/templates/docdash/static/scripts/prettify/lang-css.js +2 -0
  158. package/tools/templates/templates/docdash/static/scripts/prettify/prettify.js +28 -0
  159. package/tools/templates/templates/docdash/static/scripts/search.js +99 -0
  160. package/tools/templates/templates/docdash/static/styles/jsdoc.css +803 -0
  161. package/tools/templates/templates/docdash/static/styles/prettify.css +80 -0
  162. package/tools/templates/templates/docdash/tmpl/augments.tmpl +10 -0
  163. package/tools/templates/templates/docdash/tmpl/container.tmpl +203 -0
  164. package/tools/templates/templates/docdash/tmpl/details.tmpl +152 -0
  165. package/tools/templates/templates/docdash/tmpl/example.tmpl +2 -0
  166. package/tools/templates/templates/docdash/tmpl/examples.tmpl +13 -0
  167. package/tools/templates/templates/docdash/tmpl/exceptions.tmpl +32 -0
  168. package/tools/templates/templates/docdash/tmpl/layout.tmpl +102 -0
  169. package/tools/templates/templates/docdash/tmpl/mainpage.tmpl +15 -0
  170. package/tools/templates/templates/docdash/tmpl/members.tmpl +38 -0
  171. package/tools/templates/templates/docdash/tmpl/method.tmpl +132 -0
  172. package/tools/templates/templates/docdash/tmpl/modifies.tmpl +14 -0
  173. package/tools/templates/templates/docdash/tmpl/namespace.tmpl +133 -0
  174. package/tools/templates/templates/docdash/tmpl/params.tmpl +132 -0
  175. package/tools/templates/templates/docdash/tmpl/properties.tmpl +107 -0
  176. package/tools/templates/templates/docdash/tmpl/returns.tmpl +19 -0
  177. package/tools/templates/templates/docdash/tmpl/source.tmpl +8 -0
  178. package/tools/templates/templates/docdash/tmpl/tutorial.tmpl +19 -0
  179. package/tools/templates/templates/docdash/tmpl/type.tmpl +26 -0
  180. package/tpl/partial/user.es5.js +1 -0
  181. package/tpl/partial/user.html +10 -0
  182. package/tpl/partial/user.js +1 -0
@@ -0,0 +1,1995 @@
1
+ /**!
2
+ * Mikado.js v0.8.400 (ES5/Debug)
3
+ * Copyright 2019-2024 Nextapps GmbH
4
+ * Author: Thomas Wilkerling
5
+ * Licence: Apache-2.0
6
+ * https://github.com/nextapps-de/mikado
7
+ */
8
+ (function(){'use strict';
9
+ var p;
10
+ function aa(a, b, c) {
11
+ if (null == a) {
12
+ throw new TypeError("The 'this' value for String.prototype." + c + " must not be null or undefined");
13
+ }
14
+ if (b instanceof RegExp) {
15
+ throw new TypeError("First argument to String.prototype." + c + " must not be a regular expression");
16
+ }
17
+ return a + "";
18
+ }
19
+ var q = "function" == typeof Object.defineProperties ? Object.defineProperty : function(a, b, c) {
20
+ if (a == Array.prototype || a == Object.prototype) {
21
+ return a;
22
+ }
23
+ a[b] = c.value;
24
+ return a;
25
+ };
26
+ function ba(a) {
27
+ a = ["object" == typeof globalThis && globalThis, a, "object" == typeof window && window, "object" == typeof self && self, "object" == typeof global && global];
28
+ for (var b = 0; b < a.length; ++b) {
29
+ var c = a[b];
30
+ if (c && c.Math == Math) {
31
+ return c;
32
+ }
33
+ }
34
+ throw Error("Cannot find global object");
35
+ }
36
+ var v = ba(this);
37
+ function y(a, b) {
38
+ if (b) {
39
+ a: {
40
+ var c = v;
41
+ a = a.split(".");
42
+ for (var d = 0; d < a.length - 1; d++) {
43
+ var g = a[d];
44
+ if (!(g in c)) {
45
+ break a;
46
+ }
47
+ c = c[g];
48
+ }
49
+ a = a[a.length - 1];
50
+ d = c[a];
51
+ b = b(d);
52
+ b != d && null != b && q(c, a, {configurable:!0, writable:!0, value:b});
53
+ }
54
+ }
55
+ }
56
+ y("String.prototype.endsWith", function(a) {
57
+ return a ? a : function(b, c) {
58
+ var d = aa(this, b, "endsWith");
59
+ void 0 === c && (c = d.length);
60
+ c = Math.max(0, Math.min(c | 0, d.length));
61
+ for (var g = b.length; 0 < g && 0 < c;) {
62
+ if (d[--c] != b[--g]) {
63
+ return !1;
64
+ }
65
+ }
66
+ return 0 >= g;
67
+ };
68
+ });
69
+ function ca(a) {
70
+ var b = 0;
71
+ return function() {
72
+ return b < a.length ? {done:!1, value:a[b++]} : {done:!0};
73
+ };
74
+ }
75
+ y("Symbol", function(a) {
76
+ function b(l) {
77
+ if (this instanceof b) {
78
+ throw new TypeError("Symbol is not a constructor");
79
+ }
80
+ return new c(d + (l || "") + "_" + g++, l);
81
+ }
82
+ function c(l, h) {
83
+ this.g = l;
84
+ q(this, "description", {configurable:!0, writable:!0, value:h});
85
+ }
86
+ if (a) {
87
+ return a;
88
+ }
89
+ c.prototype.toString = function() {
90
+ return this.g;
91
+ };
92
+ var d = "jscomp_symbol_" + (1E9 * Math.random() >>> 0) + "_", g = 0;
93
+ return b;
94
+ });
95
+ y("Symbol.iterator", function(a) {
96
+ if (a) {
97
+ return a;
98
+ }
99
+ a = Symbol("Symbol.iterator");
100
+ for (var b = "Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "), c = 0; c < b.length; c++) {
101
+ var d = v[b[c]];
102
+ "function" === typeof d && "function" != typeof d.prototype[a] && q(d.prototype, a, {configurable:!0, writable:!0, value:function() {
103
+ return da(ca(this));
104
+ }});
105
+ }
106
+ return a;
107
+ });
108
+ function da(a) {
109
+ a = {next:a};
110
+ a[Symbol.iterator] = function() {
111
+ return this;
112
+ };
113
+ return a;
114
+ }
115
+ function z(a) {
116
+ var b = "undefined" != typeof Symbol && Symbol.iterator && a[Symbol.iterator];
117
+ if (b) {
118
+ return b.call(a);
119
+ }
120
+ if ("number" == typeof a.length) {
121
+ return {next:ca(a)};
122
+ }
123
+ throw Error(String(a) + " is not an iterable or ArrayLike");
124
+ }
125
+ function A(a, b) {
126
+ return Object.prototype.hasOwnProperty.call(a, b);
127
+ }
128
+ y("WeakMap", function(a) {
129
+ function b(e) {
130
+ this.g = (f += Math.random() + 1).toString();
131
+ if (e) {
132
+ e = z(e);
133
+ for (var k; !(k = e.next()).done;) {
134
+ k = k.value, this.set(k[0], k[1]);
135
+ }
136
+ }
137
+ }
138
+ function c() {
139
+ }
140
+ function d(e) {
141
+ var k = typeof e;
142
+ return "object" === k && null !== e || "function" === k;
143
+ }
144
+ function g(e) {
145
+ if (!A(e, h)) {
146
+ var k = new c();
147
+ q(e, h, {value:k});
148
+ }
149
+ }
150
+ function l(e) {
151
+ var k = Object[e];
152
+ k && (Object[e] = function(m) {
153
+ if (m instanceof c) {
154
+ return m;
155
+ }
156
+ Object.isExtensible(m) && g(m);
157
+ return k(m);
158
+ });
159
+ }
160
+ if (function() {
161
+ if (!a || !Object.seal) {
162
+ return !1;
163
+ }
164
+ try {
165
+ var e = Object.seal({}), k = Object.seal({}), m = new a([[e, 2], [k, 3]]);
166
+ if (2 != m.get(e) || 3 != m.get(k)) {
167
+ return !1;
168
+ }
169
+ m.delete(e);
170
+ m.set(k, 4);
171
+ return !m.has(e) && 4 == m.get(k);
172
+ } catch (n) {
173
+ return !1;
174
+ }
175
+ }()) {
176
+ return a;
177
+ }
178
+ var h = "$jscomp_hidden_" + Math.random();
179
+ l("freeze");
180
+ l("preventExtensions");
181
+ l("seal");
182
+ var f = 0;
183
+ b.prototype.set = function(e, k) {
184
+ if (!d(e)) {
185
+ throw Error("Invalid WeakMap key");
186
+ }
187
+ g(e);
188
+ if (!A(e, h)) {
189
+ throw Error("WeakMap key fail: " + e);
190
+ }
191
+ e[h][this.g] = k;
192
+ return this;
193
+ };
194
+ b.prototype.get = function(e) {
195
+ return d(e) && A(e, h) ? e[h][this.g] : void 0;
196
+ };
197
+ b.prototype.has = function(e) {
198
+ return d(e) && A(e, h) && A(e[h], this.g);
199
+ };
200
+ b.prototype.delete = function(e) {
201
+ return d(e) && A(e, h) && A(e[h], this.g) ? delete e[h][this.g] : !1;
202
+ };
203
+ return b;
204
+ });
205
+ y("Map", function(a) {
206
+ function b() {
207
+ var f = {};
208
+ return f.s = f.next = f.head = f;
209
+ }
210
+ function c(f, e) {
211
+ var k = f[1];
212
+ return da(function() {
213
+ if (k) {
214
+ for (; k.head != f[1];) {
215
+ k = k.s;
216
+ }
217
+ for (; k.next != k.head;) {
218
+ return k = k.next, {done:!1, value:e(k)};
219
+ }
220
+ k = null;
221
+ }
222
+ return {done:!0, value:void 0};
223
+ });
224
+ }
225
+ function d(f, e) {
226
+ var k = e && typeof e;
227
+ "object" == k || "function" == k ? l.has(e) ? k = l.get(e) : (k = "" + ++h, l.set(e, k)) : k = "p_" + e;
228
+ var m = f[0][k];
229
+ if (m && A(f[0], k)) {
230
+ for (f = 0; f < m.length; f++) {
231
+ var n = m[f];
232
+ if (e !== e && n.key !== n.key || e === n.key) {
233
+ return {id:k, list:m, index:f, j:n};
234
+ }
235
+ }
236
+ }
237
+ return {id:k, list:m, index:-1, j:void 0};
238
+ }
239
+ function g(f) {
240
+ this[0] = {};
241
+ this[1] = b();
242
+ this.size = 0;
243
+ if (f) {
244
+ f = z(f);
245
+ for (var e; !(e = f.next()).done;) {
246
+ e = e.value, this.set(e[0], e[1]);
247
+ }
248
+ }
249
+ }
250
+ if (function() {
251
+ if (!a || "function" != typeof a || !a.prototype.entries || "function" != typeof Object.seal) {
252
+ return !1;
253
+ }
254
+ try {
255
+ var f = Object.seal({x:4}), e = new a(z([[f, "s"]]));
256
+ if ("s" != e.get(f) || 1 != e.size || e.get({x:4}) || e.set({x:4}, "t") != e || 2 != e.size) {
257
+ return !1;
258
+ }
259
+ var k = e.entries(), m = k.next();
260
+ if (m.done || m.value[0] != f || "s" != m.value[1]) {
261
+ return !1;
262
+ }
263
+ m = k.next();
264
+ return m.done || 4 != m.value[0].x || "t" != m.value[1] || !k.next().done ? !1 : !0;
265
+ } catch (n) {
266
+ return !1;
267
+ }
268
+ }()) {
269
+ return a;
270
+ }
271
+ var l = new WeakMap();
272
+ g.prototype.set = function(f, e) {
273
+ f = 0 === f ? 0 : f;
274
+ var k = d(this, f);
275
+ k.list || (k.list = this[0][k.id] = []);
276
+ k.j ? k.j.value = e : (k.j = {next:this[1], s:this[1].s, head:this[1], key:f, value:e}, k.list.push(k.j), this[1].s.next = k.j, this[1].s = k.j, this.size++);
277
+ return this;
278
+ };
279
+ g.prototype.delete = function(f) {
280
+ f = d(this, f);
281
+ return f.j && f.list ? (f.list.splice(f.index, 1), f.list.length || delete this[0][f.id], f.j.s.next = f.j.next, f.j.next.s = f.j.s, f.j.head = null, this.size--, !0) : !1;
282
+ };
283
+ g.prototype.clear = function() {
284
+ this[0] = {};
285
+ this[1] = this[1].s = b();
286
+ this.size = 0;
287
+ };
288
+ g.prototype.has = function(f) {
289
+ return !!d(this, f).j;
290
+ };
291
+ g.prototype.get = function(f) {
292
+ return (f = d(this, f).j) && f.value;
293
+ };
294
+ g.prototype.entries = function() {
295
+ return c(this, function(f) {
296
+ return [f.key, f.value];
297
+ });
298
+ };
299
+ g.prototype.keys = function() {
300
+ return c(this, function(f) {
301
+ return f.key;
302
+ });
303
+ };
304
+ g.prototype.values = function() {
305
+ return c(this, function(f) {
306
+ return f.value;
307
+ });
308
+ };
309
+ g.prototype.forEach = function(f, e) {
310
+ for (var k = this.entries(), m; !(m = k.next()).done;) {
311
+ m = m.value, f.call(e, m[1], m[0], this);
312
+ }
313
+ };
314
+ g.prototype[Symbol.iterator] = g.prototype.entries;
315
+ var h = 0;
316
+ return g;
317
+ });
318
+ y("Promise", function(a) {
319
+ function b(h) {
320
+ this.i = 0;
321
+ this.u = void 0;
322
+ this.g = [];
323
+ this.K = !1;
324
+ var f = this.D();
325
+ try {
326
+ h(f.resolve, f.reject);
327
+ } catch (e) {
328
+ f.reject(e);
329
+ }
330
+ }
331
+ function c() {
332
+ this.g = null;
333
+ }
334
+ function d(h) {
335
+ return h instanceof b ? h : new b(function(f) {
336
+ f(h);
337
+ });
338
+ }
339
+ if (a) {
340
+ return a;
341
+ }
342
+ c.prototype.i = function(h) {
343
+ if (null == this.g) {
344
+ this.g = [];
345
+ var f = this;
346
+ this.u(function() {
347
+ f.F();
348
+ });
349
+ }
350
+ this.g.push(h);
351
+ };
352
+ var g = v.setTimeout;
353
+ c.prototype.u = function(h) {
354
+ g(h, 0);
355
+ };
356
+ c.prototype.F = function() {
357
+ for (; this.g && this.g.length;) {
358
+ var h = this.g;
359
+ this.g = [];
360
+ for (var f = 0; f < h.length; ++f) {
361
+ var e = h[f];
362
+ h[f] = null;
363
+ try {
364
+ e();
365
+ } catch (k) {
366
+ this.D(k);
367
+ }
368
+ }
369
+ }
370
+ this.g = null;
371
+ };
372
+ c.prototype.D = function(h) {
373
+ this.u(function() {
374
+ throw h;
375
+ });
376
+ };
377
+ b.prototype.D = function() {
378
+ function h(k) {
379
+ return function(m) {
380
+ e || (e = !0, k.call(f, m));
381
+ };
382
+ }
383
+ var f = this, e = !1;
384
+ return {resolve:h(this.O), reject:h(this.F)};
385
+ };
386
+ b.prototype.O = function(h) {
387
+ if (h === this) {
388
+ this.F(new TypeError("A Promise cannot resolve to itself"));
389
+ } else {
390
+ if (h instanceof b) {
391
+ this.R(h);
392
+ } else {
393
+ a: {
394
+ switch(typeof h) {
395
+ case "object":
396
+ var f = null != h;
397
+ break a;
398
+ case "function":
399
+ f = !0;
400
+ break a;
401
+ default:
402
+ f = !1;
403
+ }
404
+ }
405
+ f ? this.N(h) : this.J(h);
406
+ }
407
+ }
408
+ };
409
+ b.prototype.N = function(h) {
410
+ var f = void 0;
411
+ try {
412
+ f = h.then;
413
+ } catch (e) {
414
+ this.F(e);
415
+ return;
416
+ }
417
+ "function" == typeof f ? this.S(f, h) : this.J(h);
418
+ };
419
+ b.prototype.F = function(h) {
420
+ this.L(2, h);
421
+ };
422
+ b.prototype.J = function(h) {
423
+ this.L(1, h);
424
+ };
425
+ b.prototype.L = function(h, f) {
426
+ if (0 != this.i) {
427
+ throw Error("Cannot settle(" + h + ", " + f + "): Promise already settled in state" + this.i);
428
+ }
429
+ this.i = h;
430
+ this.u = f;
431
+ 2 === this.i && this.P();
432
+ this.T();
433
+ };
434
+ b.prototype.P = function() {
435
+ var h = this;
436
+ g(function() {
437
+ if (h.M()) {
438
+ var f = v.console;
439
+ "undefined" !== typeof f && f.error(h.u);
440
+ }
441
+ }, 1);
442
+ };
443
+ b.prototype.M = function() {
444
+ if (this.K) {
445
+ return !1;
446
+ }
447
+ var h = v.CustomEvent, f = v.Event, e = v.dispatchEvent;
448
+ if ("undefined" === typeof e) {
449
+ return !0;
450
+ }
451
+ "function" === typeof h ? h = new h("unhandledrejection", {cancelable:!0}) : "function" === typeof f ? h = new f("unhandledrejection", {cancelable:!0}) : (h = v.document.createEvent("CustomEvent"), h.initCustomEvent("unhandledrejection", !1, !0, h));
452
+ h.promise = this;
453
+ h.reason = this.u;
454
+ return e(h);
455
+ };
456
+ b.prototype.T = function() {
457
+ if (null != this.g) {
458
+ for (var h = 0; h < this.g.length; ++h) {
459
+ l.i(this.g[h]);
460
+ }
461
+ this.g = null;
462
+ }
463
+ };
464
+ var l = new c();
465
+ b.prototype.R = function(h) {
466
+ var f = this.D();
467
+ h.H(f.resolve, f.reject);
468
+ };
469
+ b.prototype.S = function(h, f) {
470
+ var e = this.D();
471
+ try {
472
+ h.call(f, e.resolve, e.reject);
473
+ } catch (k) {
474
+ e.reject(k);
475
+ }
476
+ };
477
+ b.prototype.then = function(h, f) {
478
+ function e(r, t) {
479
+ return "function" == typeof r ? function(u) {
480
+ try {
481
+ k(r(u));
482
+ } catch (w) {
483
+ m(w);
484
+ }
485
+ } : t;
486
+ }
487
+ var k, m, n = new b(function(r, t) {
488
+ k = r;
489
+ m = t;
490
+ });
491
+ this.H(e(h, k), e(f, m));
492
+ return n;
493
+ };
494
+ b.prototype.catch = function(h) {
495
+ return this.then(void 0, h);
496
+ };
497
+ b.prototype.H = function(h, f) {
498
+ function e() {
499
+ switch(k.i) {
500
+ case 1:
501
+ h(k.u);
502
+ break;
503
+ case 2:
504
+ f(k.u);
505
+ break;
506
+ default:
507
+ throw Error("Unexpected state: " + k.i);
508
+ }
509
+ }
510
+ var k = this;
511
+ null == this.g ? l.i(e) : this.g.push(e);
512
+ this.K = !0;
513
+ };
514
+ b.resolve = d;
515
+ b.reject = function(h) {
516
+ return new b(function(f, e) {
517
+ e(h);
518
+ });
519
+ };
520
+ b.race = function(h) {
521
+ return new b(function(f, e) {
522
+ for (var k = z(h), m = k.next(); !m.done; m = k.next()) {
523
+ d(m.value).H(f, e);
524
+ }
525
+ });
526
+ };
527
+ b.all = function(h) {
528
+ var f = z(h), e = f.next();
529
+ return e.done ? d([]) : new b(function(k, m) {
530
+ function n(u) {
531
+ return function(w) {
532
+ r[u] = w;
533
+ t--;
534
+ 0 == t && k(r);
535
+ };
536
+ }
537
+ var r = [], t = 0;
538
+ do {
539
+ r.push(void 0), t++, d(e.value).H(n(r.length - 1), m), e = f.next();
540
+ } while (!e.done);
541
+ });
542
+ };
543
+ return b;
544
+ });
545
+ function ea(a, b) {
546
+ a instanceof String && (a += "");
547
+ var c = 0, d = !1, g = {next:function() {
548
+ if (!d && c < a.length) {
549
+ var l = c++;
550
+ return {value:b(l, a[l]), done:!1};
551
+ }
552
+ d = !0;
553
+ return {done:!0, value:void 0};
554
+ }};
555
+ g[Symbol.iterator] = function() {
556
+ return g;
557
+ };
558
+ return g;
559
+ }
560
+ y("Array.prototype.keys", function(a) {
561
+ return a ? a : function() {
562
+ return ea(this, function(b) {
563
+ return b;
564
+ });
565
+ };
566
+ });
567
+ y("Object.is", function(a) {
568
+ return a ? a : function(b, c) {
569
+ return b === c ? 0 !== b || 1 / b === 1 / c : b !== b && c !== c;
570
+ };
571
+ });
572
+ y("Array.prototype.includes", function(a) {
573
+ return a ? a : function(b, c) {
574
+ var d = this;
575
+ d instanceof String && (d = String(d));
576
+ var g = d.length;
577
+ c = c || 0;
578
+ for (0 > c && (c = Math.max(c + g, 0)); c < g; c++) {
579
+ var l = d[c];
580
+ if (l === b || Object.is(l, b)) {
581
+ return !0;
582
+ }
583
+ }
584
+ return !1;
585
+ };
586
+ });
587
+ y("String.prototype.includes", function(a) {
588
+ return a ? a : function(b, c) {
589
+ return -1 !== aa(this, b, "includes").indexOf(b, c || 0);
590
+ };
591
+ });
592
+ var B = {}, C = {}, D = Object.create(null), E = Object.create(null), fa = document.documentElement || document.body.parentNode, ja = "ontouchstart" in window, F = !ja && window.PointerEvent && navigator.maxTouchPoints, ka;
593
+ function la(a, b) {
594
+ var c = a.target;
595
+ if (c !== window && c !== fa) {
596
+ b || (b = a.type);
597
+ var d = c["_mke" + b];
598
+ if ("undefined" === typeof d) {
599
+ for (var g = c; g && g !== fa;) {
600
+ var l = void 0;
601
+ "click" === b && ka && (l = g.getAttribute("tap"));
602
+ l || (l = g.getAttribute(b));
603
+ if (l) {
604
+ if ("$" === l[0]) {
605
+ var h = g === c;
606
+ l = l.substring(1);
607
+ }
608
+ var f = l.indexOf(":"), e = g, k = void 0;
609
+ if (-1 < f) {
610
+ k = l.endsWith(":*");
611
+ var m = l.substring(0, f);
612
+ f = l.substring(f + 1, l.length - (k ? 2 : 0));
613
+ for (l = ""; (e = e.parentElement) !== fa;) {
614
+ if ("root" === f ? e._mkr : e.hasAttribute(f)) {
615
+ l = m;
616
+ break;
617
+ }
618
+ }
619
+ l || console.warn("Event root '" + f + "' was not found for the event: '" + m + "'.");
620
+ }
621
+ if (l && (d || (d = [], h && (c["_mke" + b] = d)), d.push([l, e]), l = E[l], !k || l && (l.stop || l.cancel))) {
622
+ break;
623
+ }
624
+ }
625
+ g = g.parentElement;
626
+ }
627
+ h && (d || (c["_mke" + b] = null));
628
+ }
629
+ if (d) {
630
+ for (g = 0; g < d.length; g++) {
631
+ if (e = d[g], k = e[0], l = D[k]) {
632
+ e = e[1];
633
+ if (m = E[k]) {
634
+ m.prevent && a.preventDefault(), m.stop && a.stopImmediatePropagation(), m.once && (D[k] = null, h && (c["_mke" + b] = null));
635
+ }
636
+ l(e, a);
637
+ } else {
638
+ console.warn("The route '" + k + "' is not defined for the event '" + b + "'.");
639
+ }
640
+ }
641
+ }
642
+ }
643
+ }
644
+ function ma(a, b, c) {
645
+ if (!a) {
646
+ throw Error("Missing route name.");
647
+ }
648
+ if (!D[a]) {
649
+ throw Error("Undefined route '" + a + "'.");
650
+ }
651
+ D[a](b || this, c || window.event);
652
+ return this;
653
+ }
654
+ function na(a, b) {
655
+ B[a] || (G(1, a, la, b), B[a] = 1, C[a] = b || null);
656
+ return this;
657
+ }
658
+ var I, J, oa;
659
+ if (ja || F) {
660
+ var pa = function(a) {
661
+ var b = I, c = J, d = a, g = a.changedTouches;
662
+ g && (d = g[0]);
663
+ I = d.clientX;
664
+ J = d.clientY;
665
+ 15 > Math.abs(I - b) && 15 > Math.abs(J - c) && la(a, "tap");
666
+ }, qa = function(a) {
667
+ var b = a;
668
+ (a = a.touches) && (b = a[0]);
669
+ I = b.clientX;
670
+ J = b.clientY;
671
+ }, ra = {passive:!1, capture:!0};
672
+ oa = function(a) {
673
+ G(a, F ? "pointerdown" : "touchstart", qa, ra);
674
+ G(a, F ? "pointerup" : "touchend", pa, ra);
675
+ };
676
+ }
677
+ function G(a, b, c, d) {
678
+ if ("tap" === b) {
679
+ if (ja || F) {
680
+ oa(a);
681
+ return;
682
+ }
683
+ ka = !0;
684
+ b = "click";
685
+ }
686
+ window[(a ? "add" : "remove") + "EventListener"](b, c, d || !1 === d ? d : !0);
687
+ }
688
+ ;function K(a, b, c) {
689
+ var d;
690
+ c && (d = a._mkc) && (a._mkc = null);
691
+ for (var g = b.length, l = [], h = {}, f = 0, e, k, m, n = null; f < g; f++) {
692
+ e = b[f];
693
+ if (k = e.v) {
694
+ if (m = e = h[k], !m) {
695
+ a: {
696
+ e = a;
697
+ m = 0;
698
+ for (var r = k.length, t = ""; m < r; m++) {
699
+ var u = k[m];
700
+ t += u;
701
+ if (h[t]) {
702
+ e = h[t];
703
+ } else {
704
+ if (">" === u) {
705
+ e = e.firstChild;
706
+ } else {
707
+ if ("|" === u) {
708
+ e = [e.firstChild, e];
709
+ break a;
710
+ }
711
+ if ("@" === u) {
712
+ e = [e.style, e];
713
+ break a;
714
+ }
715
+ e = e.nextSibling;
716
+ }
717
+ h[t] = e;
718
+ }
719
+ }
720
+ e = [e];
721
+ }
722
+ m = e[0];
723
+ e = e[1] || m;
724
+ }
725
+ } else {
726
+ m = e = a;
727
+ }
728
+ c && (n = d ? d[f] : {}, e._mkc = n);
729
+ l[f] = new L(n, m, "");
730
+ }
731
+ return a._mkp = l;
732
+ }
733
+ function M(a, b, c, d, g, l) {
734
+ l || (a.l = 1);
735
+ var h = g || (b.tag ? b.svg ? document.createElementNS("http://www.w3.org/2000/svg", b.tag) : document.createElement(b.tag) : document.createTextNode(b.text)), f, e;
736
+ if (e = b.class) {
737
+ "object" === typeof e ? (c.push(new L(f = {_c:""}, h, d)), (e = e[0]) ? N(a, e, {fn:"_c", index:c.length - 1}) : a.l = 0) : g || (h.className = e);
738
+ }
739
+ if (e = b.attr) {
740
+ for (var k in e) {
741
+ var m = e[k];
742
+ "object" === typeof m ? (f || c.push(new L(f = {}, h, d)), f["_a" + k] = !1, (m = m[0]) ? N(a, m, {fn:"_a", index:c.length - 1, key:k}) : a.l = 0) : g || h.setAttribute(k, m);
743
+ }
744
+ }
745
+ if (e = b.event) {
746
+ for (var n in e) {
747
+ k = void 0;
748
+ if (!g) {
749
+ if ("load" === n || "error" === n) {
750
+ window.dispatch = ma, e["on" + n] = "dispatch('" + e[n] + "', this)", n = "on" + n, k = 1;
751
+ }
752
+ h.setAttribute(n, e[n]);
753
+ }
754
+ k || na(n);
755
+ }
756
+ }
757
+ if (e = b.style) {
758
+ "object" === typeof e ? (c.push(new L(f || (f = {}), h.style, d + "@")), f._s = "", (e = e[0]) ? N(a, e, {fn:"_s", index:c.length - 1}) : a.l = 0) : g || (h.style.cssText = e);
759
+ }
760
+ if (e = b.text) {
761
+ if ("object" === typeof e) {
762
+ var r = h;
763
+ e = e[0];
764
+ b.tag ? (d += "|", r = !g && h.firstChild, r || (r = document.createTextNode(e), h.appendChild(r))) : f = {};
765
+ (f || (f = {}))._t = e;
766
+ c.push(new L(f, r, d));
767
+ e ? N(a, e, {fn:"_t", index:c.length - 1}) : a.l = 0;
768
+ } else {
769
+ g || (b.tag ? h.textContent = e : h.nodeValue = e);
770
+ }
771
+ } else if (e = b.child) {
772
+ if (g && (g = g.firstChild, !g)) {
773
+ return console.warn("Hydration failed of template '" + a.name + "' because the existing DOM structure was incompatible. Falls back to factory construction instead."), null;
774
+ }
775
+ e.constructor !== Array && (e = [e]);
776
+ b = 0;
777
+ for (r = e.length; b < r; b++) {
778
+ if (n = e[b], d = b ? d + "+" : d + ">", n = M(a, n, c, d, g, 1), g) {
779
+ if (b < r - 1 && (g = g.nextSibling, !g)) {
780
+ return console.warn("Hydration failed of template '" + a.name + "' because the existing DOM structure was incompatible. Falls back to factory construction instead."), null;
781
+ }
782
+ } else {
783
+ h.appendChild(n);
784
+ }
785
+ }
786
+ } else if (e = b.html) {
787
+ "object" === typeof e ? (f || c.push(new L(f = {}, h, d)), f._h = "", (e = e[0]) ? N(a, e, {fn:"_h", index:c.length - 1}) : a.l = 0) : g || (h.innerHTML = e);
788
+ } else if (e = b.inc) {
789
+ f || c.push(new L(null, h, d));
790
+ if ("string" === typeof e) {
791
+ r = O[e];
792
+ if (!r) {
793
+ throw Error("The partial template '" + e + "' which is included by the root template '" + a.name + "' was not registered. When using named includes make sure you register all your includes by Mikado.register(tpl) before instantiating the Mikado view instance.");
794
+ }
795
+ if (!(r instanceof P)) {
796
+ d = r[0];
797
+ if (b = r[1]) {
798
+ b.async = !1, g && (b.root = g, b.hydrate = !0);
799
+ }
800
+ O[e] = r = new P(d, b);
801
+ }
802
+ } else if (1 !== e) {
803
+ d = a.inc.length;
804
+ if (!a.tpl.fn.length) {
805
+ throw Error("The template '" + a.name + "|" + d + "' has conflicts. It should provide a handler entry, but wasn't found.");
806
+ }
807
+ r = new P({name:a.name + "|" + d, tpl:e, key:e.key, cache:e.cache, fn:a.tpl.fn}, {recycle:a.recycle, cache:a.cache, pool:!!a.pool, state:a.state, mount:h, hydrate:!!g});
808
+ }
809
+ 1 !== e && a.inc.push(r);
810
+ }
811
+ f && (h._mkc = f);
812
+ l || (h._mkp = c);
813
+ return h;
814
+ }
815
+ function N(a, b, c) {
816
+ a.proxy || (a.proxy = {});
817
+ (a.proxy[b] || (a.proxy[b] = [])).push(c);
818
+ }
819
+ var Q = {checked:1, selected:1, hidden:1};
820
+ function L(a, b, c) {
821
+ this.c = a;
822
+ this.n = b;
823
+ this.v = c;
824
+ }
825
+ p = L.prototype;
826
+ p._a = function(a, b, c, d, g) {
827
+ if (this.c) {
828
+ if (d) {
829
+ if (g || 0 === g) {
830
+ d = d[g] || (d[g] = {});
831
+ }
832
+ d["_a" + a] = b;
833
+ }
834
+ if (this.c["_a" + a] === b) {
835
+ return;
836
+ }
837
+ this.c["_a" + a] = b;
838
+ }
839
+ !Q[a] || c && "selected" === a ? !1 === b ? this.n.removeAttribute(a) : this.n.setAttribute(a, b) : this.n[a] = b;
840
+ };
841
+ p._t = function(a, b, c) {
842
+ if (this.c) {
843
+ if (b) {
844
+ if (c || 0 === c) {
845
+ b = b[c] || (b[c] = {});
846
+ }
847
+ b._t = a;
848
+ }
849
+ if (this.c._t === a) {
850
+ return;
851
+ }
852
+ this.c._t = a;
853
+ }
854
+ this.n.nodeValue = a;
855
+ };
856
+ p._c = function(a, b, c) {
857
+ if (this.c) {
858
+ if (b) {
859
+ if (c || 0 === c) {
860
+ b = b[c] || (b[c] = {});
861
+ }
862
+ b._c = a;
863
+ }
864
+ if (this.c._c === a) {
865
+ return;
866
+ }
867
+ this.c._c = a;
868
+ }
869
+ this.n.className = a;
870
+ };
871
+ p._s = function(a, b, c) {
872
+ if (this.c) {
873
+ if (b) {
874
+ if (c || 0 === c) {
875
+ b = b[c] || (b[c] = {});
876
+ }
877
+ b._s = a;
878
+ }
879
+ if (this.c._s === a) {
880
+ return;
881
+ }
882
+ this.c._s = a;
883
+ }
884
+ this.n.cssText = a;
885
+ };
886
+ p._h = function(a, b, c) {
887
+ if (this.c) {
888
+ if (b) {
889
+ if (c || 0 === c) {
890
+ b = b[c] || (b[c] = {});
891
+ }
892
+ b._h = a;
893
+ }
894
+ if (this.c._h === a) {
895
+ return;
896
+ }
897
+ this.c._h = a;
898
+ }
899
+ this.n.innerHTML = a;
900
+ };
901
+ var ta = window.Proxy || function() {
902
+ function a(b, c) {
903
+ this.path = c.path;
904
+ this.fn = c.fn;
905
+ for (var d in b) {
906
+ this.g(b, d, b[d]);
907
+ }
908
+ b._mkx = this;
909
+ return b;
910
+ }
911
+ a.prototype.g = function(b, c, d) {
912
+ var g = this;
913
+ Object.defineProperty(b, c, {get:function() {
914
+ return d;
915
+ }, set:function(l) {
916
+ sa(g, d = l, c);
917
+ }});
918
+ };
919
+ return a;
920
+ }();
921
+ function ua(a, b) {
922
+ return "_mkx" === b ? this : a[b];
923
+ }
924
+ function va(a, b, c) {
925
+ sa(this, c, b);
926
+ a[b] = c;
927
+ return !0;
928
+ }
929
+ function sa(a, b, c) {
930
+ if (c = a.fn[c]) {
931
+ for (var d = 0; d < c.length; d++) {
932
+ var g = c[d], l = g.fn, h = a.path[g.index];
933
+ g = g.key || "";
934
+ h.c && h.c[l + g] === b || (g ? h[l](g, b) : h[l](b));
935
+ }
936
+ }
937
+ }
938
+ ;var O = Object.create(null);
939
+ function P(a, b) {
940
+ b = void 0 === b ? {} : b;
941
+ if (!(this instanceof P)) {
942
+ return new P(a, b);
943
+ }
944
+ if ("string" === typeof a) {
945
+ var c = O[a];
946
+ if (!c) {
947
+ throw Error("The template '" + a + "' is not registered.");
948
+ }
949
+ if (c instanceof P) {
950
+ return c;
951
+ }
952
+ a = c[0];
953
+ b || (b = c[1]);
954
+ }
955
+ if (!a) {
956
+ throw Error("Initialization Error: Template is not defined.");
957
+ }
958
+ if (!a.tpl) {
959
+ throw Error("Initialization Error: Template isn't supported.");
960
+ }
961
+ this.h = [];
962
+ this.length = 0;
963
+ this.root = b.root || b.mount || null;
964
+ this.recycle = !!b.recycle;
965
+ this.state = b.state || {};
966
+ this.shadow = b.shadow || !1;
967
+ this.key = a.key || "";
968
+ this.A = {};
969
+ c = a.fn;
970
+ a.I || c && (a.I = c.slice());
971
+ this.apply = c && c.pop();
972
+ this.tpl = a;
973
+ this.name = a.name;
974
+ this.inc = [];
975
+ this.pool = (c = this.recycle || !!this.key) && b.pool ? 1 : 0;
976
+ this.G = [];
977
+ this.m = new Map();
978
+ this.cache = c && (a.cache || !!b.cache);
979
+ this.async = !!b.async;
980
+ this.B = 0;
981
+ this.on = b.on || null;
982
+ this.proxy = null;
983
+ this.l = 0;
984
+ (a = b.observe) && (new R(a)).mount(this);
985
+ this.root ? this.mount(this.root, b.hydrate) : this.o = null;
986
+ }
987
+ p = P.prototype;
988
+ p.mount = function(a, b) {
989
+ if (!a) {
990
+ throw Error("No target was passed to .mount()");
991
+ }
992
+ this.B && this.cancel();
993
+ this.shadow && (a = a.shadowRoot || a.attachShadow({mode:"open"}));
994
+ var c = a._mki, d = this.root !== a;
995
+ if (c === this) {
996
+ if (!d) {
997
+ return this;
998
+ }
999
+ this.h = a._mkd;
1000
+ this.length = this.h.length;
1001
+ } else if (c) {
1002
+ c.clear();
1003
+ a._mkd = this.h = [];
1004
+ this.length = 0;
1005
+ a.firstChild && (a.textContent = "");
1006
+ var g = this.on && this.on.unmount;
1007
+ g && g(a, c);
1008
+ } else {
1009
+ if (b) {
1010
+ g = a.children;
1011
+ for (var l = g.length, h = Array(l), f = 0; f < l; f++) {
1012
+ h[f] = g[f];
1013
+ }
1014
+ this.h = h;
1015
+ this.length = this.h.length;
1016
+ } else {
1017
+ this.h = [], this.length = 0, a.firstChild && (a.textContent = "");
1018
+ }
1019
+ a._mkd = this.h;
1020
+ }
1021
+ if (this.key) {
1022
+ if (d && this.root && (this.root._mkl = this.A), c === this) {
1023
+ this.A = a._mkl;
1024
+ } else {
1025
+ d = {};
1026
+ if (!c && b && this.length) {
1027
+ for (c = 0; c < this.length; c++) {
1028
+ g = this.h[c], (l = g.getAttribute("key")) || console.warn("The template '" + this.name + "' runs in keyed mode, but the hydrated component don't have the attribute 'key' exported."), g._mkk = l, d[l] = g;
1029
+ }
1030
+ }
1031
+ a._mkl = this.A = d;
1032
+ }
1033
+ }
1034
+ a._mki = this;
1035
+ this.root = a;
1036
+ this.o || (b && this.length && (this.o = this.h[0].cloneNode(!0), M(this, this.tpl.tpl, [], "", this.o) && wa(this)), this.tpl && (this.o = M(this, this.tpl.tpl, [], ""), wa(this)));
1037
+ (b = this.on && this.on.mount) && b(a, this);
1038
+ return this;
1039
+ };
1040
+ function wa(a) {
1041
+ a.tpl.I && (a.tpl.fn = a.tpl.I, a.tpl.I = null);
1042
+ a.tpl = null;
1043
+ }
1044
+ function xa(a, b, c, d, g) {
1045
+ if (!a) {
1046
+ throw Error("Root element is not defined.");
1047
+ }
1048
+ if (!b) {
1049
+ throw Error("Template is not defined.");
1050
+ }
1051
+ if ("function" === typeof c || !0 === c) {
1052
+ g = c, c = null;
1053
+ } else if ("function" === typeof d || !0 === d) {
1054
+ g = d, d = null;
1055
+ }
1056
+ if (g) {
1057
+ return new Promise(function(f) {
1058
+ requestAnimationFrame(function() {
1059
+ xa(a, b, c, d);
1060
+ "function" === typeof g && g();
1061
+ f();
1062
+ });
1063
+ });
1064
+ }
1065
+ if (c || b.fn) {
1066
+ var l = new P(b);
1067
+ if (c && Array.isArray(c)) {
1068
+ for (var h = 0; h < c.length; h++) {
1069
+ a.append(l.create(c[h], d, h));
1070
+ }
1071
+ } else {
1072
+ a.append(l.create(c, d));
1073
+ }
1074
+ l.destroy();
1075
+ } else {
1076
+ l = M({}, b.tpl, [], "", null, 1), a.append(l);
1077
+ }
1078
+ return P;
1079
+ }
1080
+ p.render = function(a, b, c, d) {
1081
+ if (!this.root) {
1082
+ throw Error("Template was not mounted or root was not found.");
1083
+ }
1084
+ if (this.root._mki !== this) {
1085
+ throw Error("Another template is already assigned to this root. Please use '.mount(root_element)' before calling '.render()' to switch the context of a template.");
1086
+ }
1087
+ if (!d) {
1088
+ var g;
1089
+ if (b && (g = "function" === typeof b) || !0 === b) {
1090
+ c = b, b = null;
1091
+ }
1092
+ this.B && this.cancel();
1093
+ if (this.async || c) {
1094
+ var l = this;
1095
+ g || (g = "function" === typeof c);
1096
+ l.B = requestAnimationFrame(function() {
1097
+ l.B = 0;
1098
+ l.render(a, b, null, 1);
1099
+ c();
1100
+ });
1101
+ return g ? this : new Promise(function(r) {
1102
+ c = r;
1103
+ });
1104
+ }
1105
+ }
1106
+ var h = this.length;
1107
+ if (!a && !this.apply) {
1108
+ return this.h[0] || this.add(), this;
1109
+ }
1110
+ if (Array.isArray(a) || a instanceof R) {
1111
+ if (d = a.length, !d) {
1112
+ return this.remove(0, h);
1113
+ }
1114
+ } else {
1115
+ if (this.proxy) {
1116
+ throw Error("When a template is using data bindings by an expression like {{= ... }} you will need to pass an array to the render() function, also when just one single item should be rendered. Because the array you will pass in is getting proxified after calling .render(arr), after then you can trigger bindings via arr[0].prop = 'value'.");
1117
+ }
1118
+ a = [a];
1119
+ d = 1;
1120
+ }
1121
+ var f = this.key;
1122
+ g = this.proxy;
1123
+ !h || f || this.recycle || (this.remove(0, h), h = 0);
1124
+ var e = h < d ? h : d, k = 0;
1125
+ if (k < e) {
1126
+ for (var m = void 0, n = void 0; k < e; k++) {
1127
+ m = this.h[k];
1128
+ n = a[k];
1129
+ if (f && m._mkk !== n[f]) {
1130
+ return ya(this, a, b, k);
1131
+ }
1132
+ this.update(m, n, b, k);
1133
+ g && !n._mkx && (a[k] = S(this, m, n));
1134
+ }
1135
+ }
1136
+ if (k < d) {
1137
+ for (h = f || this.recycle; k < d; k++) {
1138
+ f = a[k], this.add(f, b), !g || h && f._mkx || (a[k] = S(this, this.h[k], f));
1139
+ }
1140
+ } else {
1141
+ d < h && this.remove(d, h - d);
1142
+ }
1143
+ return this;
1144
+ };
1145
+ p.replace = function(a, b, c, d) {
1146
+ "undefined" === typeof d && ("number" === typeof a ? (d = 0 > a ? this.length + a : a, a = this.h[d]) : d = this.index(a));
1147
+ var g;
1148
+ if (this.key) {
1149
+ var l = b[this.key];
1150
+ if (g = this.A[l]) {
1151
+ if (g !== a) {
1152
+ l = this.index(g);
1153
+ var h = l < d ? g : a, f = l < d ? a : g, e = this.h[l < d ? l + 1 : d + 1];
1154
+ this.h[d] = g;
1155
+ this.h[l] = a;
1156
+ e !== f ? this.root.insertBefore(h, f) : e = h;
1157
+ this.root.insertBefore(f, e);
1158
+ }
1159
+ } else {
1160
+ this.pool && (g = this.m.get(l)) && (this.m.delete(l), za(this, a), this.h[d] = g, a.replaceWith(g));
1161
+ }
1162
+ } else {
1163
+ this.recycle && (g = a);
1164
+ }
1165
+ g ? this.apply && (this.l && b._mkx || this.apply(b, c || this.state, d, g._mkp || K(g, this.o._mkp, this.cache))) : (b = this.create(b, c, d, 1), (this.key || this.pool) && za(this, a), this.h[d] = b, a.replaceWith(b));
1166
+ (d = this.on && this.on.replace) && d(a, this);
1167
+ return this;
1168
+ };
1169
+ p.update = function(a, b, c, d) {
1170
+ if (!this.apply) {
1171
+ return "number" !== typeof d && console.warn("The template '" + this.name + "' is a static template and should not be updated. Alternatively you can use .replace() to switch contents."), this;
1172
+ }
1173
+ if (this.l && b._mkx) {
1174
+ return this;
1175
+ }
1176
+ "undefined" === typeof d && ("number" === typeof a ? (d = 0 > a ? this.length + a - 1 : a, a = this.h[d]) : d = this.index(a));
1177
+ this.apply(b, c || this.state, d, a._mkp || K(a, this.o._mkp, this.cache));
1178
+ (b = this.on && this.on.update) && b(a, this);
1179
+ return this;
1180
+ };
1181
+ p.cancel = function() {
1182
+ cancelAnimationFrame(this.B);
1183
+ this.B = 0;
1184
+ return this;
1185
+ };
1186
+ p.create = function(a, b, c, d) {
1187
+ var g = this.key, l = g && a[g], h, f, e;
1188
+ if (this.pool) {
1189
+ if (g) {
1190
+ if ((f = this.m) && (h = f.get(l))) {
1191
+ f.delete(l);
1192
+ var k = 1;
1193
+ }
1194
+ } else {
1195
+ (f = this.G) && f.length && (h = f.pop());
1196
+ }
1197
+ }
1198
+ h || (h = e = this.o, e || (this.o = h = e = M(this, this.tpl.tpl, [], ""), wa(this)));
1199
+ if (this.apply) {
1200
+ f = h._mkp || K(h, this.o._mkp, !!e || this.cache);
1201
+ var m = e && this.cache && Array(f.length);
1202
+ this.apply(a, b || this.state, c, f, !!e, m);
1203
+ }
1204
+ e && (h = e.cloneNode(!0), m && !0 !== m && (h._mkc = m), h._mkr = 1);
1205
+ g && (k || (h._mkk = l), d && (this.A[l] = h));
1206
+ (a = this.on && this.on[e ? "create" : "recycle"]) && a(h, this);
1207
+ return h;
1208
+ };
1209
+ p.add = function(a, b, c) {
1210
+ if ("number" === typeof b) {
1211
+ c = 0 > b ? this.length + b : b;
1212
+ b = null;
1213
+ var d = c < this.length;
1214
+ } else {
1215
+ "number" === typeof c ? (0 > c && (c += this.length), d = c < this.length) : c = this.length;
1216
+ }
1217
+ a = this.create(a, b, c, 1);
1218
+ d ? (this.root.insertBefore(a, this.h[c]), Aa(this.h, this.length - 1, c, a), this.length++) : (this.root.appendChild(a), this.h[this.length++] = a);
1219
+ this.key && this.pool && this.pool < this.length && (this.pool = this.length);
1220
+ (c = this.on && this.on.insert) && c(a, this);
1221
+ return this;
1222
+ };
1223
+ function S(a, b, c) {
1224
+ b = b._mkp || K(b, a.o._mkp, a.cache);
1225
+ a = a.proxy;
1226
+ var d = c._mkx;
1227
+ d ? d.path = b : c = new ta(c, {path:b, fn:a, get:ua, set:va});
1228
+ return c;
1229
+ }
1230
+ function ya(a, b, c, d) {
1231
+ var g = a.h, l = a.A, h = a.key, f = b.length, e = g.length, k = e > f ? e : f, m = 0;
1232
+ for (d || (d = 0); d < k; d++) {
1233
+ var n = void 0;
1234
+ if (d < f) {
1235
+ var r = b[d], t = d >= e, u = void 0, w = void 0, ha = void 0, ia = void 0;
1236
+ a.proxy && (r._mkx ? ia = a.l : b[d] = S(a, g[d], r));
1237
+ if (!t && (u = g[d], w = r[h], ha = u._mkk, ha === w)) {
1238
+ ia || a.update(u, r, c, d);
1239
+ continue;
1240
+ }
1241
+ if (t || !l[w]) {
1242
+ t || !a.pool ? (e++, k = e > f ? e : f, a.add(r, c, d)) : a.replace(u, r, c, d);
1243
+ continue;
1244
+ }
1245
+ for (var H = t = void 0, x = d + 1; x < k; x++) {
1246
+ if (!t && x < e && g[x]._mkk === w && (t = x + 1), !H && x < f && b[x][h] === ha && (H = x + 1), t && H) {
1247
+ t >= H + m ? (n = g[t - 1], a.root.insertBefore(n, u), ia || a.update(n, r, c, d), t === H ? (1 < x - d && a.root.insertBefore(u, g[t]), g[d] = g[x], (g[x] = u) || console.error("reconcile.error 1")) : (t - 1 === d && console.error("reconcile.error 2"), Aa(g, t - 1, d), m++)) : (r = H - 1 + m, a.root.insertBefore(u, g[r] || null), (r > e ? e : r) - 1 === d && console.error("reconcile.error 3"), Aa(g, d, (r > e ? e : r) - 1), m--, d--);
1248
+ n = 1;
1249
+ break;
1250
+ }
1251
+ }
1252
+ }
1253
+ n || (a.remove(d), e--, k = e > f ? e : f, d--);
1254
+ }
1255
+ return a;
1256
+ }
1257
+ function Aa(a, b, c, d) {
1258
+ var g = d || a[b];
1259
+ d && b++;
1260
+ if (b < c) {
1261
+ for (; b < c; b++) {
1262
+ a[b] = a[b + 1];
1263
+ }
1264
+ } else {
1265
+ for (; b > c; b--) {
1266
+ a[b] = a[b - 1];
1267
+ }
1268
+ }
1269
+ a[c] = g;
1270
+ }
1271
+ p.append = function(a, b, c) {
1272
+ if ("number" === typeof b) {
1273
+ c = 0 > b ? this.length + b : b;
1274
+ b = null;
1275
+ var d = 1;
1276
+ } else {
1277
+ "number" === typeof c && (0 > c && (c += this.length), d = 1);
1278
+ }
1279
+ for (var g = a.length, l = 0; l < g; l++) {
1280
+ this.add(a[l], b, d ? c++ : null);
1281
+ }
1282
+ return this;
1283
+ };
1284
+ p.clear = function() {
1285
+ this.length && this.remove(0, this.length);
1286
+ return this;
1287
+ };
1288
+ p.remove = function(a, b) {
1289
+ var c = this.length;
1290
+ c && a && ("number" !== typeof a ? a = this.index(a) : 0 > a && (a = c + a));
1291
+ if (!c || a >= c) {
1292
+ return this;
1293
+ }
1294
+ b ? 0 > b && (a -= b + 1, 0 > a && (a = 0), b *= -1) : b = 1;
1295
+ if (!a && b >= c) {
1296
+ var d = this.h;
1297
+ b = d.length;
1298
+ this.root.textContent = "";
1299
+ this.root._mkd = this.h = [];
1300
+ c = 0;
1301
+ } else {
1302
+ d = this.h.splice(a, b), c -= b;
1303
+ }
1304
+ var g = this.pool && !this.key, l = this.key || this.pool, h = this.on && this.on.remove;
1305
+ (a = this.key && this.pool) && b >= a && (this.m = new Map(), a = 0);
1306
+ for (var f = 0, e; f < b; f++) {
1307
+ e = d[g ? b - f - 1 : f], c && e.remove(), l && za(this, e, 1), h && h(e, this);
1308
+ }
1309
+ if (a && 0 < (a = this.m.size - a)) {
1310
+ for (b = this.m.keys(); a--;) {
1311
+ this.m.delete(b.next().value);
1312
+ }
1313
+ }
1314
+ this.length = c;
1315
+ return this;
1316
+ };
1317
+ p.index = function(a) {
1318
+ return a ? this.h.indexOf(a) : -1;
1319
+ };
1320
+ p.node = function(a) {
1321
+ return this.h[a];
1322
+ };
1323
+ function za(a, b, c) {
1324
+ if (a.key) {
1325
+ var d = b._mkk;
1326
+ a.A[d] = null;
1327
+ }
1328
+ a.pool && (d ? (a.m.set(d, b), !c && a.m.size > a.pool && a.m.delete(a.m.keys().next().value)) : a.G[a.G.length] = b);
1329
+ }
1330
+ p.flush = function() {
1331
+ this.G = [];
1332
+ this.m = new Map();
1333
+ return this;
1334
+ };
1335
+ p.destroy = function() {
1336
+ for (var a = 0, b; a < this.inc.length; a++) {
1337
+ b = this.inc[a], O[b.name] || b.destroy();
1338
+ }
1339
+ this.key && (this.root && (this.root._mkl = null), this.A = null);
1340
+ this.root && (this.root._mkd = this.root._mki = null);
1341
+ this.proxy = this.on = this.m = this.G = this.h = this.root = this.tpl = this.apply = this.inc = this.state = this.o = null;
1342
+ };
1343
+ var T = Array.prototype, Ba = window.Proxy, U = !1;
1344
+ function V(a) {
1345
+ if (!a) {
1346
+ throw Error("The observable array was not assigned to a Mikado instance. You need to pass in the observable array when initiating a Mikado instance.");
1347
+ }
1348
+ }
1349
+ function R(a) {
1350
+ if (a instanceof R) {
1351
+ return a;
1352
+ }
1353
+ if (!(this instanceof R)) {
1354
+ return new R(a);
1355
+ }
1356
+ this.g = null;
1357
+ var b = a ? a.length : 0;
1358
+ if (Ba) {
1359
+ if (b) {
1360
+ for (var c = 0; c < b; c++) {
1361
+ this[c] = a[c];
1362
+ }
1363
+ }
1364
+ this.length = b;
1365
+ this.i = {splice:T.splice.bind(this), pop:T.pop.bind(this), shift:T.shift.bind(this), unshift:T.unshift.bind(this), push:T.push.bind(this)};
1366
+ return new Proxy(this, Ca);
1367
+ }
1368
+ this.i = a || [];
1369
+ for (a = 0; a <= b; a++) {
1370
+ Da(this, a);
1371
+ }
1372
+ Da(this, "length");
1373
+ }
1374
+ R.prototype.mount = function(a) {
1375
+ this.g !== a && (this.g && a.mount(this.g.root), this.g = a);
1376
+ return this;
1377
+ };
1378
+ function Da(a, b) {
1379
+ Object.defineProperty(a, b, {get:function() {
1380
+ return this.i[b];
1381
+ }, set:function(c) {
1382
+ "number" === typeof b && (b === this.length && Da(this, b + 1), Ca.set(this, b, c));
1383
+ }});
1384
+ }
1385
+ var Ca = {set:function(a, b, c) {
1386
+ var d;
1387
+ "number" === typeof b ? d = !0 : b === "" + parseInt(b, 10) && (d = !0);
1388
+ var g = a.g;
1389
+ if (!U) {
1390
+ U = !0;
1391
+ if (g) {
1392
+ var l = a.length;
1393
+ if (d) {
1394
+ V(g);
1395
+ var h = g.length;
1396
+ l !== h && (a.length = h);
1397
+ b >= h ? (g.add(c), a.length++) : b < h && (l = g.h[b], g.recycle || g.key && l._mkk === c[g.key] ? g.update(l, c, null, b) : g.replace(l, c, null, b));
1398
+ } else {
1399
+ "length" === b && c < l && g.remove(c, l - c);
1400
+ }
1401
+ }
1402
+ U = !1;
1403
+ }
1404
+ g && (l = g.recycle || g.key, !d || !g.proxy || l && c._mkx || (c = S(g, g.h[b], c)));
1405
+ (Ba ? a : a.i)[b] = c;
1406
+ return !0;
1407
+ }};
1408
+ p = R.prototype;
1409
+ p.set = function(a) {
1410
+ var b = this.g;
1411
+ b.recycle || b.key ? (U = !0, b.render(a), U = !1, this.length > a.length && this.splice(a.length)) : (this.splice(), this.concat(a));
1412
+ return this;
1413
+ };
1414
+ p.splice = function(a, b, c) {
1415
+ V(this.g);
1416
+ U = !0;
1417
+ a || (a = 0);
1418
+ "undefined" === typeof b && (b = this.length - a, 0 > b && (b = 0));
1419
+ b && this.g.remove(a, b);
1420
+ b = c ? this.i.splice(a, b, c) : this.i.splice(a, b);
1421
+ c && this.g.add(c, a);
1422
+ U = !1;
1423
+ return b;
1424
+ };
1425
+ p.push = function(a) {
1426
+ V(this.g);
1427
+ U = !0;
1428
+ this.g.add(a);
1429
+ this[this.length] = a;
1430
+ Ba && this.length++;
1431
+ U = !1;
1432
+ };
1433
+ p.unshift = function(a) {
1434
+ V(this.g);
1435
+ U = !0;
1436
+ this.g.add(a, 0);
1437
+ this.i.unshift(a);
1438
+ U = !1;
1439
+ };
1440
+ p.pop = function() {
1441
+ V(this.g);
1442
+ U = !0;
1443
+ this.g.remove(this.length - 1);
1444
+ var a = this.i.pop();
1445
+ U = !1;
1446
+ return a;
1447
+ };
1448
+ p.shift = function() {
1449
+ V(this.g);
1450
+ U = !0;
1451
+ this.g.remove(0);
1452
+ var a = this.i.shift();
1453
+ U = !1;
1454
+ return a;
1455
+ };
1456
+ p.concat = function(a) {
1457
+ for (var b = a.length, c = 0; c < b; c++) {
1458
+ this.push(a[c]);
1459
+ }
1460
+ return this;
1461
+ };
1462
+ p.sort = T.sort;
1463
+ p.reverse = T.reverse;
1464
+ p.slice = T.slice;
1465
+ p.map = function(a, b) {
1466
+ b && (a = a.bind(this));
1467
+ b = 0;
1468
+ for (var c = this.length; b < c; b++) {
1469
+ this[b] = a(this[b]);
1470
+ }
1471
+ return this;
1472
+ };
1473
+ p.filter = function(a, b) {
1474
+ b && (a = a.bind(this));
1475
+ b = 0;
1476
+ for (var c = this.length; b < c; b++) {
1477
+ if (a(this[b])) {
1478
+ g && (this.splice(d, g), c -= g, b -= g, g = 0);
1479
+ } else {
1480
+ if (g) {
1481
+ g++;
1482
+ } else {
1483
+ var d = b;
1484
+ var g = 1;
1485
+ }
1486
+ }
1487
+ }
1488
+ g && this.splice(d, g);
1489
+ return this;
1490
+ };
1491
+ p.indexOf = function(a) {
1492
+ for (var b = 0, c = this.length; b < c; b++) {
1493
+ if (this[b] === a) {
1494
+ return b;
1495
+ }
1496
+ }
1497
+ return -1;
1498
+ };
1499
+ p.lastIndexOf = function(a) {
1500
+ for (var b = this.length - 1; 0 <= b; b--) {
1501
+ if (this[b] === a) {
1502
+ return b;
1503
+ }
1504
+ }
1505
+ return -1;
1506
+ };
1507
+ p.includes = T.includes;
1508
+ p.forEach = function(a) {
1509
+ for (var b = 0, c = this.length; b < c; b++) {
1510
+ a(this[b]);
1511
+ }
1512
+ return this;
1513
+ };
1514
+ p.swap = function(a, b) {
1515
+ var c = this[b];
1516
+ this[b] = this[a];
1517
+ this[a] = c;
1518
+ return this;
1519
+ };
1520
+ p.transaction = function(a) {
1521
+ V(this.g);
1522
+ U = !0;
1523
+ a();
1524
+ U = !1;
1525
+ var b = this.g, c = b.l;
1526
+ b.l = 0;
1527
+ b.async ? b.render(this).then(function() {
1528
+ b.l = c;
1529
+ }) : (b.render(this), b.l = c);
1530
+ };
1531
+ var W = document.createElement("div"), Ea = document.createTextNode(""), X = document.createElement("div");
1532
+ W.appendChild(Ea);
1533
+ p = P.prototype;
1534
+ p.move = P.prototype.moveTo = function(a, b) {
1535
+ if ("number" === typeof a) {
1536
+ var c = a;
1537
+ a = this.h[c];
1538
+ } else {
1539
+ c = this.index(a);
1540
+ }
1541
+ 0 > b && (b = this.length + b - 1);
1542
+ c !== b && this.shift(a, b - c);
1543
+ return this;
1544
+ };
1545
+ p.shift = function(a, b) {
1546
+ if (!b) {
1547
+ return this;
1548
+ }
1549
+ if ("number" === typeof a) {
1550
+ var c = a;
1551
+ a = this.h[a];
1552
+ } else {
1553
+ c = this.index(a);
1554
+ }
1555
+ var d = 0 > b;
1556
+ if (d && c || !d && c < this.length - 1) {
1557
+ b = d ? Math.max(c + b, 0) : Math.min(c + b, this.length - 1);
1558
+ var g = this.h[b], l = d && 1 < c - b || !d && 1 < b - c;
1559
+ this.root.insertBefore(a, d ? g : this.h[b + 1] || null);
1560
+ if (l) {
1561
+ a = this.h[c];
1562
+ if (d) {
1563
+ for (; c > b; c--) {
1564
+ this.h[c] = this.h[c - 1];
1565
+ }
1566
+ } else {
1567
+ for (; c < b; c++) {
1568
+ this.h[c] = this.h[c + 1];
1569
+ }
1570
+ }
1571
+ this.h[b] = a;
1572
+ } else {
1573
+ this.h[c] = g, this.h[b] = a;
1574
+ }
1575
+ }
1576
+ return this;
1577
+ };
1578
+ p.up = function(a, b) {
1579
+ (!b || 0 < b) && this.shift(a, -(b || 1));
1580
+ return this;
1581
+ };
1582
+ p.down = function(a, b) {
1583
+ (!b || 0 < b) && this.shift(a, b || 1);
1584
+ return this;
1585
+ };
1586
+ p.first = function(a) {
1587
+ return this.shift(a, -this.length);
1588
+ };
1589
+ p.last = function(a) {
1590
+ return this.shift(a, this.length);
1591
+ };
1592
+ p.before = function(a, b) {
1593
+ "number" !== typeof a && (a = this.index(a));
1594
+ "number" !== typeof b && (b = this.index(b));
1595
+ b !== a + 1 && (0 > b && (b = this.length + b, 0 > a && b--), 0 > a && (a = this.length + a - 1), this.shift(a, b - a - 1));
1596
+ return this;
1597
+ };
1598
+ p.after = function(a, b) {
1599
+ "number" !== typeof a && (a = this.index(a));
1600
+ "number" !== typeof b && (b = this.index(b));
1601
+ b !== a - 1 && (0 > b && (b = this.length + b - 2, 0 > a && b++), 0 > a && (a = this.length + a - 1), this.shift(a, b - a + 1));
1602
+ return this;
1603
+ };
1604
+ p.swap = function(a, b) {
1605
+ if (a !== b) {
1606
+ if ("number" === typeof a) {
1607
+ var c = 0 > a ? this.length + a : a;
1608
+ a = this.h[c];
1609
+ } else {
1610
+ c = this.index(a);
1611
+ }
1612
+ if ("number" === typeof b) {
1613
+ var d = 0 > b ? this.length + b : b;
1614
+ b = this.h[d];
1615
+ } else {
1616
+ d = this.index(b);
1617
+ }
1618
+ var g = c + 1 !== d;
1619
+ this.root.insertBefore(g ? a : b, g ? b : a);
1620
+ g && d + 1 !== c && this.root.insertBefore(b, this.h[c + 1] || null);
1621
+ this.h[c] = b;
1622
+ this.h[d] = a;
1623
+ }
1624
+ return this;
1625
+ };
1626
+ var Fa = {tap:1, change:1, click:1, dblclick:1, input:1, keydown:1, keypress:1, keyup:1, mousedown:1, mouseover:1, mouseout:1, mousemove:1, mouseup:1, mousewheel:1, touchstart:1, touchmove:1, touchend:1, touchcancel:1, reset:1, select:1, submit:1, toggle:1, focusin:1, focusout:1, resize:1, scroll:1, error:1, load:1}, Ga = {blur:"focusout", focus:"focusin", mouseleave:"mouseout", mouseenter:"mouseover"}, Ha = 0, Ia = 0;
1627
+ function Ja(a, b, c, d, g, l) {
1628
+ Ha || (Ha = 1, console.info("If this page has set a Content-Security-Policy (CSP) header field, using the inline compiler has disadvantage when not configure \"script-src 'unsafe-eval'\". It is recommended to use the Mikado native compiler, which is CSP-friendly and also can optimize your templates more powerful."));
1629
+ if (b) {
1630
+ return new Promise(function(u) {
1631
+ var w = Ja(a);
1632
+ "function" === typeof b && b(w);
1633
+ u(w);
1634
+ });
1635
+ }
1636
+ g || (d = [], c = [d], d.index = g = {current:-1, count:0, last:-1, inc:0, C:!1});
1637
+ var h = l ? {} : {tpl:{}}, f = l ? h : h.tpl;
1638
+ if (!l) {
1639
+ if ("string" === typeof a) {
1640
+ if (/<.*>/.test(a)) {
1641
+ var e = document.createElement("div");
1642
+ e.innerHTML = a;
1643
+ a = e.firstElementChild;
1644
+ } else {
1645
+ h.name = a, a = document.getElementById(a);
1646
+ }
1647
+ if (!a) {
1648
+ throw Error("The template was not found.");
1649
+ }
1650
+ }
1651
+ a.content && (h.name || (h.name = a.id || a.getAttribute("name")), a = a.content.firstElementChild);
1652
+ }
1653
+ e = a.tagName;
1654
+ if (!e || "SCRIPT" === e) {
1655
+ var k;
1656
+ if ((k = (e ? a.firstChild : a).nodeValue) && k && k.trim()) {
1657
+ if (k.includes("{{@")) {
1658
+ var m = k.replace(/{{@([\s\S]+)}}/g, "$1").trim();
1659
+ k = /{{[\s\S]+}}/.test(m) ? m.replace(/{{([\s\S]+)}}/g, "{{$1}}") : "";
1660
+ m && (m = m.replace(/{{([\s\S]+)}}/g, ""));
1661
+ m && d.push(m);
1662
+ if ("SCRIPT" === e) {
1663
+ return k.trim() && (f.text = k, f.tag = e), f;
1664
+ }
1665
+ }
1666
+ k && k.trim() && (k.includes("{{#") ? Ka(f, "html", k, !1, null, g, d) : (g.count++, Ka(f, "text", k, !1, null, g, d)));
1667
+ }
1668
+ if (!e) {
1669
+ return k && k.trim() ? f : null;
1670
+ }
1671
+ }
1672
+ e && (f.tag = e);
1673
+ if ((k = a.attributes) && k.length) {
1674
+ e = {};
1675
+ for (m = 0; m < k.length; m++) {
1676
+ var n = k[m].nodeName, r = a.getAttribute(n);
1677
+ "include" === n && (n = "inc");
1678
+ e[n] = r;
1679
+ }
1680
+ k = e;
1681
+ for (var t in k) {
1682
+ e = k[t];
1683
+ n = m = void 0;
1684
+ switch(t) {
1685
+ case "class":
1686
+ case "style":
1687
+ m = t;
1688
+ break;
1689
+ case "include":
1690
+ t = "inc";
1691
+ case "inc":
1692
+ m = t;
1693
+ break;
1694
+ case "if":
1695
+ m = t;
1696
+ break;
1697
+ case "foreach":
1698
+ m = t = "for";
1699
+ break;
1700
+ case "js":
1701
+ break;
1702
+ case "key":
1703
+ h.key = e.replace(/({{|}})/g, "").trim().replace("data.", "");
1704
+ break;
1705
+ case "cache":
1706
+ break;
1707
+ default:
1708
+ Ga[t] ? (n = f.event || (f.event = {}), console.info("The assigned event '" + t + "' was replaced by the event '" + Ga[t] + "'."), t = Ga[t]) : Fa[t] ? n = f.event || (f.event = {}) : (l || "id" !== t && "name" !== t || h.name || /{{[\s\S]+}}/.test(e) || (h.name = e), n = f.attr || (f.attr = {})), m = t;
1709
+ }
1710
+ m && Ka(n || f, m, e, !!n, k, g, d);
1711
+ }
1712
+ }
1713
+ t = (a.content || a).childNodes;
1714
+ k = t.length;
1715
+ g.C && (g.C = !1, g.inc++, d = [], (f.for || f.if) && c.unshift(d), f.child || (f.child = f.text ? {text:f.text} : f.html ? {html:f.html} : null), k ? (d.root = f, d.inc = f.child || (f.child = []), d.index = g = {current:-1, count:0, last:-1, inc:0, C:!1}) : d.inc = f.inc, delete f.for, delete f.if, delete f.text, delete f.html);
1716
+ if (k) {
1717
+ e = 0;
1718
+ for (m = void 0; e < k; e++) {
1719
+ if (m = t[e], 8 !== m.nodeType && (g.count++, n = Ja(m, null, c, d, g, 1))) {
1720
+ 1 !== k || 3 !== m.nodeType && n.text || f.js && n.js ? (n.text || n.tag) && (f.child || (f.child = [])).push(n) : (n.js && (f.js = n.js), n.html && (f.html = n.html), n.text && (f.text = n.text));
1721
+ }
1722
+ }
1723
+ f.child && 1 === f.child.length && (f.child = f.child[0]);
1724
+ }
1725
+ if (!l) {
1726
+ if (h.name || (h.name = "tpl-" + Ia++), 1 === c.length && 0 === c[0].length) {
1727
+ h.fn = null;
1728
+ } else {
1729
+ for (d = 0; d < c.length; d++) {
1730
+ c[d].root && (c[d].root.inc = c[d].inc[0], delete c[d].root.child), c[d] = c[d].length ? Function("data", "state", "index", "_p", "_f", "_x", '"use strict";let _o,_v,_c;' + c[d].join(";")) : null;
1731
+ }
1732
+ h.fn = c.length ? c : null;
1733
+ }
1734
+ }
1735
+ return h;
1736
+ }
1737
+ function Ka(a, b, c, d, g, l, h) {
1738
+ if (/{{[\s\S]+}}/.test(c)) {
1739
+ var f = /{{([!?#]+)?=/.test(c), e = /{{!?\?/.test(c), k = /{{\??!/.test(c);
1740
+ if (f) {
1741
+ if (e || k) {
1742
+ c = c.replace(/{{[!?]+/g, "{{");
1743
+ }
1744
+ f = c.replace(/{{#?=+(.*)?}}/ig, "$1").trim().replace(/^data\./, "").replace(/^data\[['"](.*)['"]]/, "$1");
1745
+ }
1746
+ c = c.replace(/{{[!?#=]+/g, "{{").replace(/"(\s+)?{{(\s+)?/g, "(").replace(/(\s+)?}}(\s+)?"/g, ")").replace(/{{(\s+)?/g, "'+(").replace(/(\s+)?}}/g, ")+'").replace(/\s+/g, " ");
1747
+ c = ("'" + c + "'").replace(/^""\+/g, "").replace(/^''\+/g, "").replace(/\+''$/g, "").replace(/\+""$/g, "").replace(/"\)\+''\+\("/g, "").replace(/'\)\+''\+\('/g, "").replace(/\+''\+/g, "+").replace(/'(\s+)?\+(\s+)?'/g, "").replace(/"(\s+)?\+(\s+)?"/g, "").replace(/^\(([^ ]+)\)$/g, "$1").trim();
1748
+ e && (c = "(" + (c + "||" + c + "===0?" + c + ":'')"));
1749
+ "text" !== b && "style" !== b || !a.tag || l.count++;
1750
+ l.count !== l.last && (l.current++, l.last = l.count, h.push("_o=_p[" + l.current + "]"), h.push("_x&&(_x[" + l.current + "]=_c={})"));
1751
+ h.push("_v=" + c);
1752
+ d ? h.push('_c&&(_c["_a' + b + '"]=_v);if(!_o.c||_o.c["_a' + b + '"]!==_v){_o.c&&(_o.c["_a' + b + '"]=_v);' + (Q[b] ? "selected" === b ? '_f?_o.n[_v===false?"removeAttribute":"setAttribute"]("' + b + '",_v):_o.n.' + b + "=_v" : "_o.n." + b + "=_v" : '_o.n[_v===false?"removeAttribute":"setAttribute"]("' + b + '",_v)') + "}") : "class" === b ? h.push("_c&&(_c._c=_v);if(!_o.c||_o.c._c!==_v){_o.c&&(_o.c._c=_v);_o.n.className=_v}") : "style" === b ? h.push("_c&&(_c._s=_v);if(!_o.c||_o.c._s!==_v){_o.c&&(_o.c._s=_v);_o.n.cssText=_v}") :
1753
+ "html" === b ? h.push("_c&&(_c._h=_v);if(!_o.c||_o.c._h!==_v){_o.c&&(_o.c._h=_v);_o.n.innerHTML=_v}") : "text" === b && h.push("_c&&(_c._t=_v);if(!_o.c||_o.c._t!==_v){_o.c&&(_o.c._t=_v);_o.n.nodeValue=_v}");
1754
+ a[b] = f ? [f] : [];
1755
+ } else {
1756
+ a[b] = c;
1757
+ }
1758
+ "for" !== b && "if" !== b && "inc" !== b || d || l.C || (l.count !== l.last && (l.current++, l.last = l.count, h.push("_o=_p[" + l.current + "]")), a = g.foreach ? g.foreach.trim() : "data", b = l.inc, g.if ? h.push("this.inc[" + b + "].mount(_o.n)[" + g.if.trim() + '?"render":"clear"](' + a + ",state)") : g.foreach ? h.push("this.inc[" + b + "].mount(_o.n).render(" + a + ",state)") : h.push("this.inc[" + b + "].mount(_o.n).render(data,state)"), l.C = !0);
1759
+ }
1760
+ ;var La = /[^;:]+/g, Ma = / +/;
1761
+ function Na(a, b, c, d) {
1762
+ d["_a" + b] !== c && (d["_a" + b] = c, Q[b] ? a[b] = c : !1 === c ? a.removeAttribute(b) : a.setAttribute(b, c));
1763
+ }
1764
+ function Oa(a, b, c) {
1765
+ !1 !== c["_a" + b] && (c["_a" + b] = !1, Q[b] ? a[b] = !1 : a.removeAttribute(b));
1766
+ }
1767
+ function Pa(a, b) {
1768
+ var c = a._mkc, d;
1769
+ c ? d = c["_a" + b] : a._mkc = c = {};
1770
+ "string" !== typeof d && (Q[b] ? d = a[b] : d = a.getAttribute(b), c["_a" + b] = d);
1771
+ return d;
1772
+ }
1773
+ function Y(a) {
1774
+ var b = a._mkc, c;
1775
+ b ? c = b._c : a._mkc = b = {};
1776
+ if (!c) {
1777
+ return b._c = {};
1778
+ }
1779
+ if ("string" === typeof c) {
1780
+ a = c.trim().split(Ma);
1781
+ b._c = c = {};
1782
+ b = 0;
1783
+ for (var d; b < a.length; b++) {
1784
+ (d = a[b]) && (c[a[b]] = 1);
1785
+ }
1786
+ }
1787
+ return c;
1788
+ }
1789
+ function Qa(a, b, c, d) {
1790
+ var g = !!d[b];
1791
+ c = "undefined" === typeof c ? !g : !!c;
1792
+ g !== c && (d[b] = c ? 1 : 0, c ? a.classList.add(b) : a.classList.remove(b));
1793
+ }
1794
+ function Ra(a) {
1795
+ var b = a._mkc, c;
1796
+ b ? c = b._s : a._mkc = b = {};
1797
+ if (!c) {
1798
+ return b._s = {};
1799
+ }
1800
+ if ("string" === typeof c) {
1801
+ for (a = c.match(La), b._s = c = {}, b = 0; b < a.length; b += 2) {
1802
+ c[a[b].trim()] = a[b + 1].trim();
1803
+ }
1804
+ }
1805
+ return c;
1806
+ }
1807
+ ;P.once = xa;
1808
+ P.register = function(a, b) {
1809
+ var c;
1810
+ if ("string" === typeof a) {
1811
+ var d = c = a;
1812
+ a = O[d];
1813
+ a instanceof P || (a = a[0]);
1814
+ if (!a) {
1815
+ throw Error("The template '" + d + "' was not found.");
1816
+ }
1817
+ } else {
1818
+ d = a.name;
1819
+ }
1820
+ O[d] && (c ? console.info("The template '" + d + "' was replaced by a new definition.") : console.warn("The template '" + d + "' was already registered and is getting overwritten. When this isn't your intention, then please check your template names about uniqueness and collision!"));
1821
+ O[d] = [a, b];
1822
+ return P;
1823
+ };
1824
+ P.unregister = function(a) {
1825
+ "object" === typeof a && (a = a.name);
1826
+ var b = O[a];
1827
+ b && (b instanceof P && b.destroy(), O[a] = null);
1828
+ return P;
1829
+ };
1830
+ P.compile = Ja;
1831
+ P.setText = function(a, b) {
1832
+ var c = a._mkc, d;
1833
+ c ? d = c._t : a._mkc = c = {};
1834
+ d !== b && (c._t = b, c._h = null, (c = a.firstChild) ? c.nodeValue = b : a.appendChild(document.createTextNode(b)));
1835
+ };
1836
+ P.getText = function(a) {
1837
+ var b = a._mkc, c;
1838
+ b ? c = b._t : a._mkc = b = {};
1839
+ "string" !== typeof c && (a = a.firstChild, b._t = c = a ? a.nodeValue : "");
1840
+ return c;
1841
+ };
1842
+ P.setHtml = function(a, b) {
1843
+ var c = a._mkc, d;
1844
+ c ? d = c._h : a._mkc = c = {};
1845
+ d !== b && (a.innerHTML = b, c._h = b, c._t = null);
1846
+ };
1847
+ P.getHtml = function(a) {
1848
+ var b = a._mkc, c;
1849
+ b ? c = b._h || b._t : a._mkc = b = {};
1850
+ "string" !== typeof c && (b._h = c = a.innerHTML);
1851
+ return c;
1852
+ };
1853
+ P.setClass = function(a, b) {
1854
+ var c = a._mkc, d;
1855
+ c ? d = c._c : a._mkc = c = {};
1856
+ "object" === typeof b && (b = b.join(" "));
1857
+ d !== b && (c._c = b, a.className = b);
1858
+ };
1859
+ P.getClass = function(a) {
1860
+ var b = a._mkc, c;
1861
+ b ? c = b._c : a._mkc = b = {};
1862
+ "string" !== typeof c && (b._c = c = a.className);
1863
+ c = c.split(Ma);
1864
+ return "" === c[0] ? [] : c;
1865
+ };
1866
+ P.hasClass = function(a, b) {
1867
+ var c = Y(a), d = c[b];
1868
+ "number" !== typeof d && (c[b] = d = a.classList.contains(b) ? 1 : 0);
1869
+ return !!d;
1870
+ };
1871
+ P.toggleClass = function(a, b, c) {
1872
+ var d = Y(a);
1873
+ if ("object" === typeof b) {
1874
+ if (b.constructor === Array) {
1875
+ for (var g = 0; g < b.length; g++) {
1876
+ Qa(a, b[g], c, d);
1877
+ }
1878
+ } else {
1879
+ for (g in b) {
1880
+ Qa(a, g, b[g], d);
1881
+ }
1882
+ }
1883
+ } else {
1884
+ Qa(a, b, c, d);
1885
+ }
1886
+ };
1887
+ P.removeClass = function(a, b) {
1888
+ var c = Y(a);
1889
+ if ("object" === typeof b) {
1890
+ for (var d = 0; d < b.length; d++) {
1891
+ var g = a, l = b[d];
1892
+ 0 !== c[l] && (c[l] = 0, g.classList.remove(l));
1893
+ }
1894
+ } else {
1895
+ 0 !== c[b] && (c[b] = 0, a.classList.remove(b));
1896
+ }
1897
+ };
1898
+ P.addClass = function(a, b) {
1899
+ var c = Y(a);
1900
+ if ("object" === typeof b) {
1901
+ for (var d = 0; d < b.length; d++) {
1902
+ var g = a, l = b[d];
1903
+ c[l] || (c[l] = 1, g.classList.add(l));
1904
+ }
1905
+ } else {
1906
+ c[b] || (c[b] = 1, a.classList.add(b));
1907
+ }
1908
+ };
1909
+ P.setAttribute = function(a, b, c) {
1910
+ var d = a._mkc;
1911
+ d || (a._mkc = d = {});
1912
+ if ("object" === typeof b) {
1913
+ for (var g in b) {
1914
+ Na(a, g, b[g], d);
1915
+ }
1916
+ } else {
1917
+ Na(a, b, c, d);
1918
+ }
1919
+ };
1920
+ P.getAttribute = Pa;
1921
+ P.hasAttribute = function(a, b) {
1922
+ a = Pa(a, b);
1923
+ return !(!a && "" !== a);
1924
+ };
1925
+ P.removeAttribute = function(a, b) {
1926
+ var c = a._mkc;
1927
+ c || (a._mkc = c = {});
1928
+ if ("object" === typeof b) {
1929
+ for (var d = 0; d < b.length; d++) {
1930
+ Oa(a, b[d], c);
1931
+ }
1932
+ } else {
1933
+ Oa(a, b, c);
1934
+ }
1935
+ };
1936
+ P.setCss = function(a, b) {
1937
+ var c = a._mkc, d;
1938
+ c ? d = c._s : a._mkc = c = {};
1939
+ d !== b && (c._s = b, a.style.cssText = b);
1940
+ };
1941
+ P.getCss = function(a) {
1942
+ var b = a._mkc, c;
1943
+ b ? c = b._s : a._mkc = b = {};
1944
+ "string" !== typeof c && (b._s = c = a.style.cssText);
1945
+ return c;
1946
+ };
1947
+ P.getStyle = function(a, b) {
1948
+ var c = Ra(a), d = c[b];
1949
+ "string" !== typeof d && (c[b] = d = a.style.getPropertyValue(b));
1950
+ return d;
1951
+ };
1952
+ P.setStyle = function(a, b, c) {
1953
+ var d = Ra(a), g = a.style;
1954
+ if ("object" === typeof b) {
1955
+ for (var l in b) {
1956
+ c = a;
1957
+ var h = l, f = b[l];
1958
+ d[h] !== f && (d[h] = f, (g || c.style).setProperty(h, f));
1959
+ }
1960
+ } else {
1961
+ d[b] !== c && (d[b] = c, (g || a.style).setProperty(b, c));
1962
+ }
1963
+ };
1964
+ P.escape = function(a) {
1965
+ W.i !== a && (Ea.nodeValue = a, W.g = W.innerHTML, W.i = a);
1966
+ return W.g;
1967
+ };
1968
+ P.sanitize = function(a) {
1969
+ X.g !== a && (X.innerHTML = a, X.g = a, X.i = X.textContent);
1970
+ return X.i;
1971
+ };
1972
+ P.prototype.route = P.route = function(a, b, c) {
1973
+ if (!a) {
1974
+ throw Error("Missing route name.");
1975
+ }
1976
+ if (!b) {
1977
+ throw Error("The route '" + a + "' has no function assigned to it.");
1978
+ }
1979
+ D[a] && console.info("A new handler was re-assigned to the route '" + a + "'.");
1980
+ D[a] = b;
1981
+ E[a] = c || null;
1982
+ return this;
1983
+ };
1984
+ P.prototype.dispatch = P.dispatch = ma;
1985
+ P.prototype.listen = P.listen = na;
1986
+ P.prototype.unlisten = P.unlisten = function(a) {
1987
+ B[a] && (G(0, a, la, C[a]), B[a] = 0, C[a] = null);
1988
+ return this;
1989
+ };
1990
+ P.Array = R;
1991
+ var Z = window, Sa;
1992
+ (Sa = Z.define) && Sa.amd ? Sa([], function() {
1993
+ return P;
1994
+ }) : "object" === typeof Z.exports ? Z.exports = P : Z.Mikado = P;
1995
+ }).call(this);