liftie 4.0.1 → 4.0.2
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.
- package/Makefile +6 -0
- package/app.js +1 -1
- package/package.json +2 -2
- package/public/scripts/liftie.js +1412 -1414
- package/public/scripts/liftie.js.map +1 -1
- package/public/stylesheets/style.css +2 -2
- package/views/layout.jade +2 -2
package/public/scripts/liftie.js
CHANGED
|
@@ -1,1558 +1,1556 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
));
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
27
|
+
// node_modules/.pnpm/transform-property@0.0.1/node_modules/transform-property/index.js
|
|
28
|
+
var require_transform_property = __commonJS({
|
|
29
|
+
"node_modules/.pnpm/transform-property@0.0.1/node_modules/transform-property/index.js"(exports, module) {
|
|
30
|
+
var styles = [
|
|
31
|
+
"webkitTransform",
|
|
32
|
+
"MozTransform",
|
|
33
|
+
"msTransform",
|
|
34
|
+
"OTransform",
|
|
35
|
+
"transform"
|
|
36
|
+
];
|
|
37
|
+
var el = document.createElement("p");
|
|
38
|
+
var style;
|
|
39
|
+
for (i = 0; i < styles.length; i++) {
|
|
40
|
+
style = styles[i];
|
|
41
|
+
if (null != el.style[style]) {
|
|
42
|
+
module.exports = style;
|
|
43
|
+
break;
|
|
46
44
|
}
|
|
47
|
-
var i;
|
|
48
45
|
}
|
|
49
|
-
|
|
46
|
+
var i;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
var map;
|
|
73
|
-
var el;
|
|
74
|
-
var val;
|
|
50
|
+
// node_modules/.pnpm/has-translate3d@0.0.3/node_modules/has-translate3d/index.js
|
|
51
|
+
var require_has_translate3d = __commonJS({
|
|
52
|
+
"node_modules/.pnpm/has-translate3d@0.0.3/node_modules/has-translate3d/index.js"(exports, module) {
|
|
53
|
+
var prop = require_transform_property();
|
|
54
|
+
if (!prop || !window.getComputedStyle) {
|
|
55
|
+
module.exports = false;
|
|
56
|
+
} else {
|
|
57
|
+
map = {
|
|
58
|
+
webkitTransform: "-webkit-transform",
|
|
59
|
+
OTransform: "-o-transform",
|
|
60
|
+
msTransform: "-ms-transform",
|
|
61
|
+
MozTransform: "-moz-transform",
|
|
62
|
+
transform: "transform"
|
|
63
|
+
};
|
|
64
|
+
el = document.createElement("div");
|
|
65
|
+
el.style[prop] = "translate3d(1px,1px,1px)";
|
|
66
|
+
document.body.insertBefore(el, null);
|
|
67
|
+
val = getComputedStyle(el).getPropertyValue(map[prop]);
|
|
68
|
+
document.body.removeChild(el);
|
|
69
|
+
module.exports = null != val && val.length && "none" != val;
|
|
75
70
|
}
|
|
76
|
-
|
|
71
|
+
var map;
|
|
72
|
+
var el;
|
|
73
|
+
var val;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
77
76
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
// node_modules/.pnpm/component-emitter@1.3.1/node_modules/component-emitter/index.js
|
|
78
|
+
var require_component_emitter = __commonJS({
|
|
79
|
+
"node_modules/.pnpm/component-emitter@1.3.1/node_modules/component-emitter/index.js"(exports, module) {
|
|
80
|
+
if (typeof module !== "undefined") {
|
|
81
|
+
module.exports = Emitter;
|
|
82
|
+
}
|
|
83
|
+
function Emitter(obj) {
|
|
84
|
+
if (obj) return mixin(obj);
|
|
85
|
+
}
|
|
86
|
+
function mixin(obj) {
|
|
87
|
+
for (var key in Emitter.prototype) {
|
|
88
|
+
obj[key] = Emitter.prototype[key];
|
|
86
89
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
return obj;
|
|
91
|
+
}
|
|
92
|
+
Emitter.prototype.on = Emitter.prototype.addEventListener = function(event, fn) {
|
|
93
|
+
this._callbacks = this._callbacks || {};
|
|
94
|
+
(this._callbacks["$" + event] = this._callbacks["$" + event] || []).push(fn);
|
|
95
|
+
return this;
|
|
96
|
+
};
|
|
97
|
+
Emitter.prototype.once = function(event, fn) {
|
|
98
|
+
function on() {
|
|
99
|
+
this.off(event, on);
|
|
100
|
+
fn.apply(this, arguments);
|
|
92
101
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
fn.apply(this, arguments);
|
|
102
|
-
}
|
|
103
|
-
on.fn = fn;
|
|
104
|
-
this.on(event, on);
|
|
102
|
+
on.fn = fn;
|
|
103
|
+
this.on(event, on);
|
|
104
|
+
return this;
|
|
105
|
+
};
|
|
106
|
+
Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function(event, fn) {
|
|
107
|
+
this._callbacks = this._callbacks || {};
|
|
108
|
+
if (0 == arguments.length) {
|
|
109
|
+
this._callbacks = {};
|
|
105
110
|
return this;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return this;
|
|
112
|
-
}
|
|
113
|
-
var callbacks = this._callbacks["$" + event];
|
|
114
|
-
if (!callbacks) return this;
|
|
115
|
-
if (1 == arguments.length) {
|
|
116
|
-
delete this._callbacks["$" + event];
|
|
117
|
-
return this;
|
|
118
|
-
}
|
|
119
|
-
var cb;
|
|
120
|
-
for (var i = 0; i < callbacks.length; i++) {
|
|
121
|
-
cb = callbacks[i];
|
|
122
|
-
if (cb === fn || cb.fn === fn) {
|
|
123
|
-
callbacks.splice(i, 1);
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
if (callbacks.length === 0) {
|
|
128
|
-
delete this._callbacks["$" + event];
|
|
129
|
-
}
|
|
111
|
+
}
|
|
112
|
+
var callbacks = this._callbacks["$" + event];
|
|
113
|
+
if (!callbacks) return this;
|
|
114
|
+
if (1 == arguments.length) {
|
|
115
|
+
delete this._callbacks["$" + event];
|
|
130
116
|
return this;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
117
|
+
}
|
|
118
|
+
var cb;
|
|
119
|
+
for (var i = 0; i < callbacks.length; i++) {
|
|
120
|
+
cb = callbacks[i];
|
|
121
|
+
if (cb === fn || cb.fn === fn) {
|
|
122
|
+
callbacks.splice(i, 1);
|
|
123
|
+
break;
|
|
137
124
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
125
|
+
}
|
|
126
|
+
if (callbacks.length === 0) {
|
|
127
|
+
delete this._callbacks["$" + event];
|
|
128
|
+
}
|
|
129
|
+
return this;
|
|
130
|
+
};
|
|
131
|
+
Emitter.prototype.emit = function(event) {
|
|
132
|
+
this._callbacks = this._callbacks || {};
|
|
133
|
+
var args = new Array(arguments.length - 1), callbacks = this._callbacks["$" + event];
|
|
134
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
135
|
+
args[i - 1] = arguments[i];
|
|
136
|
+
}
|
|
137
|
+
if (callbacks) {
|
|
138
|
+
callbacks = callbacks.slice(0);
|
|
139
|
+
for (var i = 0, len = callbacks.length; i < len; ++i) {
|
|
140
|
+
callbacks[i].apply(this, args);
|
|
143
141
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
}
|
|
142
|
+
}
|
|
143
|
+
return this;
|
|
144
|
+
};
|
|
145
|
+
Emitter.prototype.listeners = function(event) {
|
|
146
|
+
this._callbacks = this._callbacks || {};
|
|
147
|
+
return this._callbacks["$" + event] || [];
|
|
148
|
+
};
|
|
149
|
+
Emitter.prototype.hasListeners = function(event) {
|
|
150
|
+
return !!this.listeners(event).length;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
});
|
|
155
154
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
if (typeof handler === "string") {
|
|
167
|
-
handler = obj[handler].bind(obj);
|
|
168
|
-
}
|
|
169
|
-
el.addEventListener(name, handler, opts);
|
|
170
|
-
handlers[name] = {
|
|
171
|
-
handler,
|
|
172
|
-
opts
|
|
173
|
-
};
|
|
155
|
+
// node_modules/.pnpm/@pirxpilot+events@1.0.1/node_modules/@pirxpilot/events/index.js
|
|
156
|
+
var require_events = __commonJS({
|
|
157
|
+
"node_modules/.pnpm/@pirxpilot+events@1.0.1/node_modules/@pirxpilot/events/index.js"(exports, module) {
|
|
158
|
+
module.exports = events;
|
|
159
|
+
function events(el, obj) {
|
|
160
|
+
var handlers = {};
|
|
161
|
+
function bind(name, handler, opts) {
|
|
162
|
+
if (!handler) {
|
|
163
|
+
handler = name;
|
|
174
164
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (!h) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
el.removeEventListener(name, h.handler, h.opts);
|
|
181
|
-
delete handlers[name];
|
|
165
|
+
if (typeof handler === "string") {
|
|
166
|
+
handler = obj[handler].bind(obj);
|
|
182
167
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
168
|
+
el.addEventListener(name, handler, opts);
|
|
169
|
+
handlers[name] = {
|
|
170
|
+
handler,
|
|
171
|
+
opts
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function do_unbind(name) {
|
|
175
|
+
var h = handlers[name];
|
|
176
|
+
if (!h) {
|
|
177
|
+
return;
|
|
188
178
|
}
|
|
189
|
-
|
|
190
|
-
|
|
179
|
+
el.removeEventListener(name, h.handler, h.opts);
|
|
180
|
+
delete handlers[name];
|
|
181
|
+
}
|
|
182
|
+
function unbind(name) {
|
|
183
|
+
if (!name) {
|
|
184
|
+
return unbindAll();
|
|
191
185
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
186
|
+
do_unbind(name);
|
|
187
|
+
}
|
|
188
|
+
function unbindAll() {
|
|
189
|
+
Object.keys(handlers).forEach(do_unbind);
|
|
196
190
|
}
|
|
191
|
+
return {
|
|
192
|
+
bind,
|
|
193
|
+
unbind
|
|
194
|
+
};
|
|
197
195
|
}
|
|
198
|
-
}
|
|
196
|
+
}
|
|
197
|
+
});
|
|
199
198
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
199
|
+
// node_modules/.pnpm/@pirxpilot+swipe@2.0.2/node_modules/@pirxpilot/swipe/index.js
|
|
200
|
+
var require_swipe = __commonJS({
|
|
201
|
+
"node_modules/.pnpm/@pirxpilot+swipe@2.0.2/node_modules/@pirxpilot/swipe/index.js"(exports, module) {
|
|
202
|
+
var has3d = require_has_translate3d();
|
|
203
|
+
var Emitter = require_component_emitter();
|
|
204
|
+
var events = require_events();
|
|
205
|
+
var min = Math.min;
|
|
206
|
+
var max = Math.max;
|
|
207
|
+
module.exports = Swipe;
|
|
208
|
+
function Swipe(el) {
|
|
209
|
+
if (!(this instanceof Swipe)) return new Swipe(el);
|
|
210
|
+
if (!el) throw new TypeError("Swipe() requires an element");
|
|
211
|
+
this.child = el.children[0];
|
|
212
|
+
this.touchAction("none");
|
|
213
|
+
this.currentEl = this.children().visible[0];
|
|
214
|
+
this.currentVisible = 0;
|
|
215
|
+
this.current = 0;
|
|
216
|
+
this.el = el;
|
|
217
|
+
this.refresh();
|
|
218
|
+
this.interval(5e3);
|
|
219
|
+
this.duration(300);
|
|
220
|
+
this.fastThreshold(200);
|
|
221
|
+
this.threshold(0.5);
|
|
222
|
+
this.show(0, 0, { silent: true });
|
|
223
|
+
this.bind();
|
|
224
|
+
}
|
|
225
|
+
Emitter(Swipe.prototype);
|
|
226
|
+
Swipe.prototype.threshold = function(n) {
|
|
227
|
+
this._threshold = n;
|
|
228
|
+
};
|
|
229
|
+
Swipe.prototype.fastThreshold = function(ms) {
|
|
230
|
+
this._fastThreshold = ms;
|
|
231
|
+
};
|
|
232
|
+
Swipe.prototype.refresh = function() {
|
|
233
|
+
var children = this.children();
|
|
234
|
+
var visible2 = children.visible.length;
|
|
235
|
+
var prev = this.visible || visible2;
|
|
236
|
+
var i = indexOf(children.visible, this.currentEl);
|
|
237
|
+
if (visible2 < prev && i <= this.currentVisible && i >= 0) {
|
|
238
|
+
this.currentVisible -= this.currentVisible - i;
|
|
239
|
+
} else if (visible2 > prev && i > this.currentVisible) {
|
|
240
|
+
this.currentVisible += i - this.currentVisible;
|
|
225
241
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
this.
|
|
244
|
-
this.
|
|
245
|
-
this.
|
|
246
|
-
this.
|
|
247
|
-
this.
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
};
|
|
267
|
-
Swipe.prototype.unbind = function() {
|
|
268
|
-
this.events.unbind();
|
|
269
|
-
this.docEvents.unbind();
|
|
270
|
-
};
|
|
271
|
-
Swipe.prototype.ontouchstart = function(e) {
|
|
272
|
-
this.transitionDuration(0);
|
|
273
|
-
this.dx = 0;
|
|
274
|
-
this.updown = null;
|
|
275
|
-
if ("PointerEvent" in window) {
|
|
276
|
-
e.target.setPointerCapture(e.pointerId);
|
|
277
|
-
}
|
|
278
|
-
var touch = this.getTouch(e);
|
|
279
|
-
this.down = {
|
|
280
|
-
x: touch.pageX,
|
|
281
|
-
y: touch.pageY,
|
|
282
|
-
at: /* @__PURE__ */ new Date()
|
|
283
|
-
};
|
|
284
|
-
};
|
|
285
|
-
Swipe.prototype.ontouchmove = function(e) {
|
|
286
|
-
if (!this.down || this.updown) return;
|
|
287
|
-
var touch = this.getTouch(e);
|
|
288
|
-
if (!touch) return;
|
|
289
|
-
var down = this.down;
|
|
290
|
-
var x = touch.pageX;
|
|
291
|
-
var w = this.childWidth;
|
|
292
|
-
var i = this.currentVisible;
|
|
293
|
-
this.dx = x - down.x;
|
|
294
|
-
if (null == this.updown) {
|
|
295
|
-
var y = touch.pageY;
|
|
296
|
-
var dy = y - down.y;
|
|
297
|
-
var slope = dy / this.dx;
|
|
298
|
-
if (slope > 1 || slope < -1) {
|
|
299
|
-
this.updown = true;
|
|
300
|
-
return;
|
|
301
|
-
} else {
|
|
302
|
-
this.updown = false;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
e.preventDefault();
|
|
306
|
-
var dir = this.dx < 0 ? 1 : 0;
|
|
307
|
-
if (this.isFirst() && 0 === dir) this.dx /= 2;
|
|
308
|
-
if (this.isLast() && 1 === dir) this.dx /= 2;
|
|
309
|
-
this.translate(i * w + -this.dx);
|
|
310
|
-
};
|
|
311
|
-
Swipe.prototype.ontouchend = function(e) {
|
|
312
|
-
e.stopPropagation();
|
|
313
|
-
if (!this.down) return;
|
|
314
|
-
if ("PointerEvent" in window) {
|
|
315
|
-
e.target.releasePointerCapture(e.pointerId);
|
|
316
|
-
}
|
|
317
|
-
var dx = this.dx;
|
|
318
|
-
var w = this.childWidth;
|
|
319
|
-
var ms = /* @__PURE__ */ new Date() - this.down.at;
|
|
320
|
-
var threshold = ms < this._fastThreshold ? w / 10 : w * this._threshold;
|
|
321
|
-
var dir = dx < 0 ? 1 : 0;
|
|
322
|
-
var half = Math.abs(dx) >= threshold;
|
|
323
|
-
this.down = null;
|
|
324
|
-
if (this.isFirst() && 1 == dir && half) return this.next();
|
|
325
|
-
if (this.isFirst()) return this.prev();
|
|
326
|
-
if (this.isLast() && 1 == dir) return this.next();
|
|
327
|
-
if (1 === dir && half) return this.next();
|
|
328
|
-
if (0 === dir && half) return this.prev();
|
|
329
|
-
this.show(this.currentVisible);
|
|
330
|
-
};
|
|
331
|
-
Swipe.prototype.duration = function(ms) {
|
|
332
|
-
this._duration = ms;
|
|
333
|
-
return this;
|
|
334
|
-
};
|
|
335
|
-
Swipe.prototype.interval = function(ms) {
|
|
336
|
-
this._interval = ms;
|
|
337
|
-
return this;
|
|
338
|
-
};
|
|
339
|
-
Swipe.prototype.play = function() {
|
|
340
|
-
if (this.timer) return;
|
|
341
|
-
this.timer = setInterval(this.cycle.bind(this), this._interval);
|
|
342
|
-
return this;
|
|
343
|
-
};
|
|
344
|
-
Swipe.prototype.stop = function() {
|
|
345
|
-
clearInterval(this.timer);
|
|
346
|
-
this.timer = null;
|
|
347
|
-
return this;
|
|
242
|
+
this.visible = visible2;
|
|
243
|
+
this.childWidth = this.el.getBoundingClientRect().width;
|
|
244
|
+
this.width = Math.ceil(this.childWidth * visible2);
|
|
245
|
+
this.child.style.width = this.width + "px";
|
|
246
|
+
this.child.style.height = this.height + "px";
|
|
247
|
+
this.show(this.currentVisible, 0, { silent: true });
|
|
248
|
+
};
|
|
249
|
+
Swipe.prototype.bind = function() {
|
|
250
|
+
this.events = events(this.child, this);
|
|
251
|
+
this.docEvents = events(document, this);
|
|
252
|
+
if ("PointerEvent" in window) {
|
|
253
|
+
this.events.bind("pointerdown", "ontouchstart");
|
|
254
|
+
this.events.bind("pointermove", "ontouchmove");
|
|
255
|
+
this.events.bind("pointerup", "ontouchend");
|
|
256
|
+
this.events.bind("pointercancel", "ontouchend");
|
|
257
|
+
} else {
|
|
258
|
+
this.events.bind("mousedown", "ontouchstart");
|
|
259
|
+
this.events.bind("mousemove", "ontouchmove");
|
|
260
|
+
this.docEvents.bind("mouseup", "ontouchend");
|
|
261
|
+
this.events.bind("touchstart", "ontouchstart");
|
|
262
|
+
this.events.bind("touchmove", "ontouchmove");
|
|
263
|
+
this.docEvents.bind("touchend", "ontouchend");
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
Swipe.prototype.unbind = function() {
|
|
267
|
+
this.events.unbind();
|
|
268
|
+
this.docEvents.unbind();
|
|
269
|
+
};
|
|
270
|
+
Swipe.prototype.ontouchstart = function(e) {
|
|
271
|
+
this.transitionDuration(0);
|
|
272
|
+
this.dx = 0;
|
|
273
|
+
this.updown = null;
|
|
274
|
+
if ("PointerEvent" in window) {
|
|
275
|
+
e.target.setPointerCapture(e.pointerId);
|
|
276
|
+
}
|
|
277
|
+
var touch = this.getTouch(e);
|
|
278
|
+
this.down = {
|
|
279
|
+
x: touch.pageX,
|
|
280
|
+
y: touch.pageY,
|
|
281
|
+
at: /* @__PURE__ */ new Date()
|
|
348
282
|
};
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
283
|
+
};
|
|
284
|
+
Swipe.prototype.ontouchmove = function(e) {
|
|
285
|
+
if (!this.down || this.updown) return;
|
|
286
|
+
var touch = this.getTouch(e);
|
|
287
|
+
if (!touch) return;
|
|
288
|
+
var down = this.down;
|
|
289
|
+
var x = touch.pageX;
|
|
290
|
+
var w = this.childWidth;
|
|
291
|
+
var i = this.currentVisible;
|
|
292
|
+
this.dx = x - down.x;
|
|
293
|
+
if (null == this.updown) {
|
|
294
|
+
var y = touch.pageY;
|
|
295
|
+
var dy = y - down.y;
|
|
296
|
+
var slope = dy / this.dx;
|
|
297
|
+
if (slope > 1 || slope < -1) {
|
|
298
|
+
this.updown = true;
|
|
299
|
+
return;
|
|
353
300
|
} else {
|
|
354
|
-
this.
|
|
301
|
+
this.updown = false;
|
|
355
302
|
}
|
|
303
|
+
}
|
|
304
|
+
e.preventDefault();
|
|
305
|
+
var dir = this.dx < 0 ? 1 : 0;
|
|
306
|
+
if (this.isFirst() && 0 === dir) this.dx /= 2;
|
|
307
|
+
if (this.isLast() && 1 === dir) this.dx /= 2;
|
|
308
|
+
this.translate(i * w + -this.dx);
|
|
309
|
+
};
|
|
310
|
+
Swipe.prototype.ontouchend = function(e) {
|
|
311
|
+
e.stopPropagation();
|
|
312
|
+
if (!this.down) return;
|
|
313
|
+
if ("PointerEvent" in window) {
|
|
314
|
+
e.target.releasePointerCapture(e.pointerId);
|
|
315
|
+
}
|
|
316
|
+
var dx = this.dx;
|
|
317
|
+
var w = this.childWidth;
|
|
318
|
+
var ms = /* @__PURE__ */ new Date() - this.down.at;
|
|
319
|
+
var threshold = ms < this._fastThreshold ? w / 10 : w * this._threshold;
|
|
320
|
+
var dir = dx < 0 ? 1 : 0;
|
|
321
|
+
var half = Math.abs(dx) >= threshold;
|
|
322
|
+
this.down = null;
|
|
323
|
+
if (this.isFirst() && 1 == dir && half) return this.next();
|
|
324
|
+
if (this.isFirst()) return this.prev();
|
|
325
|
+
if (this.isLast() && 1 == dir) return this.next();
|
|
326
|
+
if (1 === dir && half) return this.next();
|
|
327
|
+
if (0 === dir && half) return this.prev();
|
|
328
|
+
this.show(this.currentVisible);
|
|
329
|
+
};
|
|
330
|
+
Swipe.prototype.duration = function(ms) {
|
|
331
|
+
this._duration = ms;
|
|
332
|
+
return this;
|
|
333
|
+
};
|
|
334
|
+
Swipe.prototype.interval = function(ms) {
|
|
335
|
+
this._interval = ms;
|
|
336
|
+
return this;
|
|
337
|
+
};
|
|
338
|
+
Swipe.prototype.play = function() {
|
|
339
|
+
if (this.timer) return;
|
|
340
|
+
this.timer = setInterval(this.cycle.bind(this), this._interval);
|
|
341
|
+
return this;
|
|
342
|
+
};
|
|
343
|
+
Swipe.prototype.stop = function() {
|
|
344
|
+
clearInterval(this.timer);
|
|
345
|
+
this.timer = null;
|
|
346
|
+
return this;
|
|
347
|
+
};
|
|
348
|
+
Swipe.prototype.cycle = function() {
|
|
349
|
+
if (this.isLast()) {
|
|
350
|
+
this.currentVisible = -1;
|
|
351
|
+
this.next();
|
|
352
|
+
} else {
|
|
353
|
+
this.next();
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
Swipe.prototype.isFirst = function() {
|
|
357
|
+
return this.currentVisible === 0;
|
|
358
|
+
};
|
|
359
|
+
Swipe.prototype.isLast = function() {
|
|
360
|
+
return this.currentVisible == this.visible - 1;
|
|
361
|
+
};
|
|
362
|
+
Swipe.prototype.prev = function() {
|
|
363
|
+
this.show(this.currentVisible - 1);
|
|
364
|
+
return this;
|
|
365
|
+
};
|
|
366
|
+
Swipe.prototype.next = function() {
|
|
367
|
+
this.show(this.currentVisible + 1);
|
|
368
|
+
return this;
|
|
369
|
+
};
|
|
370
|
+
Swipe.prototype.show = function(i, ms, options) {
|
|
371
|
+
options = options || {};
|
|
372
|
+
if (null == ms) ms = this._duration;
|
|
373
|
+
var self = this;
|
|
374
|
+
var children = this.children();
|
|
375
|
+
i = max(0, min(i, children.visible.length - 1));
|
|
376
|
+
this.currentVisible = i;
|
|
377
|
+
this.currentEl = children.visible[i];
|
|
378
|
+
this.current = indexOf(children.all, this.currentEl);
|
|
379
|
+
this.transitionDuration(ms);
|
|
380
|
+
this.translate(this.childWidth * i);
|
|
381
|
+
if (!options.silent) {
|
|
382
|
+
this.emit("showing", this.current, this.currentEl);
|
|
383
|
+
if (!ms) return this;
|
|
384
|
+
this.child.addEventListener("transitionend", function shown() {
|
|
385
|
+
if (self.current == i) self.emit("show", self.current, self.currentEl);
|
|
386
|
+
self.child.removeEventListener("transitionend", shown);
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
return this;
|
|
390
|
+
};
|
|
391
|
+
Swipe.prototype.children = function() {
|
|
392
|
+
var els = this.child.children;
|
|
393
|
+
var ret = {
|
|
394
|
+
all: els,
|
|
395
|
+
visible: [],
|
|
396
|
+
hidden: []
|
|
356
397
|
};
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
return this.currentVisible == this.visible - 1;
|
|
362
|
-
};
|
|
363
|
-
Swipe.prototype.prev = function() {
|
|
364
|
-
this.show(this.currentVisible - 1);
|
|
365
|
-
return this;
|
|
366
|
-
};
|
|
367
|
-
Swipe.prototype.next = function() {
|
|
368
|
-
this.show(this.currentVisible + 1);
|
|
369
|
-
return this;
|
|
370
|
-
};
|
|
371
|
-
Swipe.prototype.show = function(i, ms, options) {
|
|
372
|
-
options = options || {};
|
|
373
|
-
if (null == ms) ms = this._duration;
|
|
374
|
-
var self = this;
|
|
375
|
-
var children = this.children();
|
|
376
|
-
i = max(0, min(i, children.visible.length - 1));
|
|
377
|
-
this.currentVisible = i;
|
|
378
|
-
this.currentEl = children.visible[i];
|
|
379
|
-
this.current = indexOf(children.all, this.currentEl);
|
|
380
|
-
this.transitionDuration(ms);
|
|
381
|
-
this.translate(this.childWidth * i);
|
|
382
|
-
if (!options.silent) {
|
|
383
|
-
this.emit("showing", this.current, this.currentEl);
|
|
384
|
-
if (!ms) return this;
|
|
385
|
-
this.child.addEventListener("transitionend", function shown() {
|
|
386
|
-
if (self.current == i) self.emit("show", self.current, self.currentEl);
|
|
387
|
-
self.child.removeEventListener("transitionend", shown);
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
return this;
|
|
391
|
-
};
|
|
392
|
-
Swipe.prototype.children = function() {
|
|
393
|
-
var els = this.child.children;
|
|
394
|
-
var ret = {
|
|
395
|
-
all: els,
|
|
396
|
-
visible: [],
|
|
397
|
-
hidden: []
|
|
398
|
-
};
|
|
399
|
-
for (var i = 0; i < els.length; i++) {
|
|
400
|
-
var el = els[i];
|
|
401
|
-
if (visible(el)) {
|
|
402
|
-
ret.visible.push(el);
|
|
403
|
-
} else {
|
|
404
|
-
ret.hidden.push(el);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
return ret;
|
|
408
|
-
};
|
|
409
|
-
Swipe.prototype.transitionDuration = function(ms) {
|
|
410
|
-
var s = this.child.style;
|
|
411
|
-
s.transition = ms + "ms transform";
|
|
412
|
-
};
|
|
413
|
-
Swipe.prototype.translate = function(x) {
|
|
414
|
-
var s = this.child.style;
|
|
415
|
-
x = -x;
|
|
416
|
-
if (has3d) {
|
|
417
|
-
s.transform = "translate3d(" + x + "px, 0, 0)";
|
|
398
|
+
for (var i = 0; i < els.length; i++) {
|
|
399
|
+
var el = els[i];
|
|
400
|
+
if (visible(el)) {
|
|
401
|
+
ret.visible.push(el);
|
|
418
402
|
} else {
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
};
|
|
422
|
-
Swipe.prototype.touchAction = function(value) {
|
|
423
|
-
var s = this.child.style;
|
|
424
|
-
s.touchAction = value;
|
|
425
|
-
};
|
|
426
|
-
Swipe.prototype.getTouch = function(e) {
|
|
427
|
-
var touch = e;
|
|
428
|
-
if (e.changedTouches && e.changedTouches.length > 0) {
|
|
429
|
-
touch = e.changedTouches[0];
|
|
430
|
-
}
|
|
431
|
-
return touch;
|
|
432
|
-
};
|
|
433
|
-
function indexOf(els, el) {
|
|
434
|
-
for (var i = 0; i < els.length; i++) {
|
|
435
|
-
if (els[i] == el) return i;
|
|
403
|
+
ret.hidden.push(el);
|
|
436
404
|
}
|
|
437
|
-
return -1;
|
|
438
405
|
}
|
|
439
|
-
|
|
440
|
-
|
|
406
|
+
return ret;
|
|
407
|
+
};
|
|
408
|
+
Swipe.prototype.transitionDuration = function(ms) {
|
|
409
|
+
var s = this.child.style;
|
|
410
|
+
s.transition = ms + "ms transform";
|
|
411
|
+
};
|
|
412
|
+
Swipe.prototype.translate = function(x) {
|
|
413
|
+
var s = this.child.style;
|
|
414
|
+
x = -x;
|
|
415
|
+
if (has3d) {
|
|
416
|
+
s.transform = "translate3d(" + x + "px, 0, 0)";
|
|
417
|
+
} else {
|
|
418
|
+
s.transform = "translateX(" + x + "px)";
|
|
441
419
|
}
|
|
420
|
+
};
|
|
421
|
+
Swipe.prototype.touchAction = function(value) {
|
|
422
|
+
var s = this.child.style;
|
|
423
|
+
s.touchAction = value;
|
|
424
|
+
};
|
|
425
|
+
Swipe.prototype.getTouch = function(e) {
|
|
426
|
+
var touch = e;
|
|
427
|
+
if (e.changedTouches && e.changedTouches.length > 0) {
|
|
428
|
+
touch = e.changedTouches[0];
|
|
429
|
+
}
|
|
430
|
+
return touch;
|
|
431
|
+
};
|
|
432
|
+
function indexOf(els, el) {
|
|
433
|
+
for (var i = 0; i < els.length; i++) {
|
|
434
|
+
if (els[i] == el) return i;
|
|
435
|
+
}
|
|
436
|
+
return -1;
|
|
442
437
|
}
|
|
443
|
-
|
|
438
|
+
function visible(el) {
|
|
439
|
+
return getComputedStyle(el).display != "none";
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
});
|
|
444
443
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
444
|
+
// node_modules/.pnpm/el-component@1.0.1/node_modules/el-component/index.js
|
|
445
|
+
var require_el_component = __commonJS({
|
|
446
|
+
"node_modules/.pnpm/el-component@1.0.1/node_modules/el-component/index.js"(exports, module) {
|
|
447
|
+
var voids = [
|
|
448
|
+
"area",
|
|
449
|
+
"base",
|
|
450
|
+
"br",
|
|
451
|
+
"col",
|
|
452
|
+
"embed",
|
|
453
|
+
"hr",
|
|
454
|
+
"img",
|
|
455
|
+
"input",
|
|
456
|
+
"keygen",
|
|
457
|
+
"link",
|
|
458
|
+
"menuitem",
|
|
459
|
+
"meta",
|
|
460
|
+
"param",
|
|
461
|
+
"source",
|
|
462
|
+
"track",
|
|
463
|
+
"wbr"
|
|
464
|
+
].reduce(function(o, v) {
|
|
465
|
+
o[v] = true;
|
|
466
|
+
return o;
|
|
467
|
+
}, /* @__PURE__ */ Object.create(null));
|
|
468
|
+
function htmlTag(tag2, content, attrStr) {
|
|
469
|
+
var text = [
|
|
470
|
+
"<",
|
|
471
|
+
tag2,
|
|
472
|
+
attrStr ? " " + attrStr : "",
|
|
473
|
+
">"
|
|
474
|
+
];
|
|
475
|
+
if (!voids[tag2]) {
|
|
476
|
+
text = text.concat([
|
|
477
|
+
content || "",
|
|
478
|
+
"</",
|
|
472
479
|
tag2,
|
|
473
|
-
attrStr ? " " + attrStr : "",
|
|
474
480
|
">"
|
|
475
|
-
];
|
|
476
|
-
if (!voids[tag2]) {
|
|
477
|
-
text = text.concat([
|
|
478
|
-
content || "",
|
|
479
|
-
"</",
|
|
480
|
-
tag2,
|
|
481
|
-
">"
|
|
482
|
-
]);
|
|
483
|
-
}
|
|
484
|
-
return text;
|
|
481
|
+
]);
|
|
485
482
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
483
|
+
return text;
|
|
484
|
+
}
|
|
485
|
+
function xmlTag(tag2, content, attrStr) {
|
|
486
|
+
var text = [
|
|
487
|
+
"<",
|
|
488
|
+
tag2,
|
|
489
|
+
attrStr ? " " + attrStr : ""
|
|
490
|
+
];
|
|
491
|
+
if (!content || !content.length) {
|
|
492
|
+
text.push("/>");
|
|
493
|
+
} else {
|
|
494
|
+
text = text.concat([
|
|
495
|
+
">",
|
|
496
|
+
content,
|
|
497
|
+
"</",
|
|
489
498
|
tag2,
|
|
490
|
-
|
|
491
|
-
];
|
|
492
|
-
|
|
493
|
-
|
|
499
|
+
">"
|
|
500
|
+
]);
|
|
501
|
+
}
|
|
502
|
+
return text;
|
|
503
|
+
}
|
|
504
|
+
function toStr(tagFn, tag2, content, attrs) {
|
|
505
|
+
var attrStr, classes, ids;
|
|
506
|
+
if (typeof content !== "string") {
|
|
507
|
+
attrs = content;
|
|
508
|
+
content = "";
|
|
509
|
+
}
|
|
510
|
+
tag2 = tag2 || "";
|
|
511
|
+
attrs = attrs || {};
|
|
512
|
+
classes = tag2.split(".");
|
|
513
|
+
tag2 = classes.shift() || "div";
|
|
514
|
+
if (classes.length) {
|
|
515
|
+
classes = classes.join(" ");
|
|
516
|
+
if (attrs["class"]) {
|
|
517
|
+
attrs["class"] += " " + classes;
|
|
494
518
|
} else {
|
|
495
|
-
|
|
496
|
-
">",
|
|
497
|
-
content,
|
|
498
|
-
"</",
|
|
499
|
-
tag2,
|
|
500
|
-
">"
|
|
501
|
-
]);
|
|
519
|
+
attrs["class"] = classes;
|
|
502
520
|
}
|
|
503
|
-
return text;
|
|
504
521
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
content = "";
|
|
510
|
-
}
|
|
511
|
-
tag2 = tag2 || "";
|
|
512
|
-
attrs = attrs || {};
|
|
513
|
-
classes = tag2.split(".");
|
|
514
|
-
tag2 = classes.shift() || "div";
|
|
515
|
-
if (classes.length) {
|
|
516
|
-
classes = classes.join(" ");
|
|
517
|
-
if (attrs["class"]) {
|
|
518
|
-
attrs["class"] += " " + classes;
|
|
519
|
-
} else {
|
|
520
|
-
attrs["class"] = classes;
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
ids = tag2.split("#");
|
|
524
|
-
if (ids.length > 1) {
|
|
525
|
-
tag2 = ids[0] || "div";
|
|
526
|
-
attrs.id = ids[1];
|
|
527
|
-
}
|
|
528
|
-
attrStr = Object.keys(attrs).map(function(attr) {
|
|
529
|
-
return attr + '="' + attrs[attr] + '"';
|
|
530
|
-
}).join(" ");
|
|
531
|
-
return tagFn(tag2, content, attrStr).join("");
|
|
522
|
+
ids = tag2.split("#");
|
|
523
|
+
if (ids.length > 1) {
|
|
524
|
+
tag2 = ids[0] || "div";
|
|
525
|
+
attrs.id = ids[1];
|
|
532
526
|
}
|
|
533
|
-
|
|
534
|
-
|
|
527
|
+
attrStr = Object.keys(attrs).map(function(attr) {
|
|
528
|
+
return attr + '="' + attrs[attr] + '"';
|
|
529
|
+
}).join(" ");
|
|
530
|
+
return tagFn(tag2, content, attrStr).join("");
|
|
535
531
|
}
|
|
536
|
-
|
|
532
|
+
module.exports = toStr.bind(null, htmlTag);
|
|
533
|
+
module.exports.xml = toStr.bind(null, xmlTag);
|
|
534
|
+
}
|
|
535
|
+
});
|
|
537
536
|
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
}
|
|
548
|
-
this._total = 0;
|
|
549
|
-
this._current = 0;
|
|
550
|
-
this.el = el2;
|
|
551
|
-
el2.addEventListener("click", this.onclick.bind(this));
|
|
537
|
+
// node_modules/.pnpm/tiny-pager@1.0.0/node_modules/tiny-pager/index.js
|
|
538
|
+
var require_tiny_pager = __commonJS({
|
|
539
|
+
"node_modules/.pnpm/tiny-pager@1.0.0/node_modules/tiny-pager/index.js"(exports, module) {
|
|
540
|
+
var Emitter = require_component_emitter();
|
|
541
|
+
var el = require_el_component();
|
|
542
|
+
module.exports = Pager;
|
|
543
|
+
function Pager(el2) {
|
|
544
|
+
if (!(this instanceof Pager)) {
|
|
545
|
+
return new Pager(el2);
|
|
552
546
|
}
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
};
|
|
558
|
-
Pager.prototype.onclick = function onclick(e) {
|
|
559
|
-
var page, target = e.target || e.srcElement;
|
|
560
|
-
page = Array.prototype.indexOf.call(this.el.children, target);
|
|
561
|
-
if (page < 0) {
|
|
562
|
-
return;
|
|
563
|
-
}
|
|
564
|
-
e.preventDefault();
|
|
565
|
-
e.stopPropagation();
|
|
566
|
-
this.select(page);
|
|
567
|
-
};
|
|
568
|
-
Pager.prototype.select = function select(page, opts) {
|
|
569
|
-
var silent = opts && opts.silent;
|
|
570
|
-
if (page === this._current) {
|
|
571
|
-
return;
|
|
572
|
-
}
|
|
573
|
-
Array.prototype.forEach.call(this.el.children, function(a, i) {
|
|
574
|
-
a.className = i == page ? "active" : "inactive";
|
|
575
|
-
});
|
|
576
|
-
this._current = page;
|
|
577
|
-
if (!silent) {
|
|
578
|
-
this.emit("show", this._current);
|
|
579
|
-
}
|
|
580
|
-
return this;
|
|
581
|
-
};
|
|
582
|
-
Pager.prototype.render = function render6() {
|
|
583
|
-
var i, html = [];
|
|
584
|
-
for (i = 0; i < this._total; i++) {
|
|
585
|
-
html.push(i !== this._current ? "a.inactive" : "a.active");
|
|
586
|
-
}
|
|
587
|
-
this.el.innerHTML = html.map(function(item) {
|
|
588
|
-
return el(item);
|
|
589
|
-
}).join("");
|
|
590
|
-
return this;
|
|
591
|
-
};
|
|
547
|
+
this._total = 0;
|
|
548
|
+
this._current = 0;
|
|
549
|
+
this.el = el2;
|
|
550
|
+
el2.addEventListener("click", this.onclick.bind(this));
|
|
592
551
|
}
|
|
593
|
-
|
|
552
|
+
Emitter(Pager.prototype);
|
|
553
|
+
Pager.prototype.total = function total(t) {
|
|
554
|
+
this._total = t;
|
|
555
|
+
return this;
|
|
556
|
+
};
|
|
557
|
+
Pager.prototype.onclick = function onclick(e) {
|
|
558
|
+
var page, target = e.target || e.srcElement;
|
|
559
|
+
page = Array.prototype.indexOf.call(this.el.children, target);
|
|
560
|
+
if (page < 0) {
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
e.preventDefault();
|
|
564
|
+
e.stopPropagation();
|
|
565
|
+
this.select(page);
|
|
566
|
+
};
|
|
567
|
+
Pager.prototype.select = function select(page, opts) {
|
|
568
|
+
var silent = opts && opts.silent;
|
|
569
|
+
if (page === this._current) {
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
Array.prototype.forEach.call(this.el.children, function(a, i) {
|
|
573
|
+
a.className = i == page ? "active" : "inactive";
|
|
574
|
+
});
|
|
575
|
+
this._current = page;
|
|
576
|
+
if (!silent) {
|
|
577
|
+
this.emit("show", this._current);
|
|
578
|
+
}
|
|
579
|
+
return this;
|
|
580
|
+
};
|
|
581
|
+
Pager.prototype.render = function render6() {
|
|
582
|
+
var i, html = [];
|
|
583
|
+
for (i = 0; i < this._total; i++) {
|
|
584
|
+
html.push(i !== this._current ? "a.inactive" : "a.active");
|
|
585
|
+
}
|
|
586
|
+
this.el.innerHTML = html.map(function(item) {
|
|
587
|
+
return el(item);
|
|
588
|
+
}).join("");
|
|
589
|
+
return this;
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
});
|
|
594
593
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
594
|
+
// node_modules/.pnpm/yields-keycode@1.1.0/node_modules/yields-keycode/index.js
|
|
595
|
+
var require_yields_keycode = __commonJS({
|
|
596
|
+
"node_modules/.pnpm/yields-keycode@1.1.0/node_modules/yields-keycode/index.js"(exports, module) {
|
|
597
|
+
var map = {
|
|
598
|
+
backspace: 8,
|
|
599
|
+
command: 91,
|
|
600
|
+
tab: 9,
|
|
601
|
+
clear: 12,
|
|
602
|
+
enter: 13,
|
|
603
|
+
shift: 16,
|
|
604
|
+
ctrl: 17,
|
|
605
|
+
alt: 18,
|
|
606
|
+
capslock: 20,
|
|
607
|
+
escape: 27,
|
|
608
|
+
esc: 27,
|
|
609
|
+
space: 32,
|
|
610
|
+
pageup: 33,
|
|
611
|
+
pagedown: 34,
|
|
612
|
+
end: 35,
|
|
613
|
+
home: 36,
|
|
614
|
+
left: 37,
|
|
615
|
+
up: 38,
|
|
616
|
+
right: 39,
|
|
617
|
+
down: 40,
|
|
618
|
+
del: 46,
|
|
619
|
+
comma: 188,
|
|
620
|
+
f1: 112,
|
|
621
|
+
f2: 113,
|
|
622
|
+
f3: 114,
|
|
623
|
+
f4: 115,
|
|
624
|
+
f5: 116,
|
|
625
|
+
f6: 117,
|
|
626
|
+
f7: 118,
|
|
627
|
+
f8: 119,
|
|
628
|
+
f9: 120,
|
|
629
|
+
f10: 121,
|
|
630
|
+
f11: 122,
|
|
631
|
+
f12: 123,
|
|
632
|
+
",": 188,
|
|
633
|
+
".": 190,
|
|
634
|
+
"/": 191,
|
|
635
|
+
"`": 192,
|
|
636
|
+
"-": 189,
|
|
637
|
+
"=": 187,
|
|
638
|
+
";": 186,
|
|
639
|
+
"[": 219,
|
|
640
|
+
"\\": 220,
|
|
641
|
+
"]": 221,
|
|
642
|
+
"'": 222
|
|
643
|
+
};
|
|
644
|
+
module.exports = function(name) {
|
|
645
|
+
return map[name.toLowerCase()] || name.toUpperCase().charCodeAt(0);
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
});
|
|
650
649
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
}
|
|
650
|
+
// node_modules/.pnpm/yields-k-sequence@0.1.0/node_modules/yields-k-sequence/index.js
|
|
651
|
+
var require_yields_k_sequence = __commonJS({
|
|
652
|
+
"node_modules/.pnpm/yields-k-sequence@0.1.0/node_modules/yields-k-sequence/index.js"(exports, module) {
|
|
653
|
+
var keycode = require_yields_keycode();
|
|
654
|
+
module.exports = sequence;
|
|
655
|
+
function sequence(keys, ms, fn) {
|
|
656
|
+
var codes = keys.split(/ +/).map(keycode), clen = codes.length, seq = [], i = 0, prev;
|
|
657
|
+
if (2 == arguments.length) {
|
|
658
|
+
fn = ms;
|
|
659
|
+
ms = 500;
|
|
660
|
+
}
|
|
661
|
+
return function(e) {
|
|
662
|
+
var code = codes[i++];
|
|
663
|
+
if (42 != code && code != e.which) return reset();
|
|
664
|
+
if (prev && /* @__PURE__ */ new Date() - prev > ms) return reset();
|
|
665
|
+
var len = seq.push(e.which);
|
|
666
|
+
prev = /* @__PURE__ */ new Date();
|
|
667
|
+
if (len != clen) return;
|
|
668
|
+
reset();
|
|
669
|
+
fn(e);
|
|
670
|
+
};
|
|
671
|
+
function reset() {
|
|
672
|
+
prev = null;
|
|
673
|
+
seq = [];
|
|
674
|
+
i = 0;
|
|
677
675
|
}
|
|
678
676
|
}
|
|
679
|
-
}
|
|
677
|
+
}
|
|
678
|
+
});
|
|
680
679
|
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
}
|
|
680
|
+
// node_modules/.pnpm/component-os@0.0.1/node_modules/component-os/index.js
|
|
681
|
+
var require_component_os = __commonJS({
|
|
682
|
+
"node_modules/.pnpm/component-os@0.0.1/node_modules/component-os/index.js"(exports, module) {
|
|
683
|
+
module.exports = os();
|
|
684
|
+
function os() {
|
|
685
|
+
var ua = navigator.userAgent;
|
|
686
|
+
if (/mac/i.test(ua)) return "mac";
|
|
687
|
+
if (/win/i.test(ua)) return "windows";
|
|
688
|
+
if (/linux/i.test(ua)) return "linux";
|
|
691
689
|
}
|
|
692
|
-
}
|
|
690
|
+
}
|
|
691
|
+
});
|
|
693
692
|
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
if (invoke) {
|
|
740
|
-
fn(e);
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
};
|
|
744
|
-
exports.destroy = function() {
|
|
745
|
-
this.el.removeEventListener("keydown", this._handle);
|
|
746
|
-
this.el.removeEventListener("keyup", this._handle);
|
|
747
|
-
this.el.removeEventListener("keyup", this._clear);
|
|
748
|
-
this.el.removeEventListener("focus", this._clear);
|
|
749
|
-
this.listeners = [];
|
|
750
|
-
};
|
|
751
|
-
exports.unbind = function(keys, fn) {
|
|
752
|
-
var fns = this.listeners;
|
|
753
|
-
var len = fns.length;
|
|
754
|
-
var all;
|
|
755
|
-
if (0 === arguments.length) {
|
|
756
|
-
this.listeners = [];
|
|
757
|
-
return this;
|
|
758
|
-
}
|
|
759
|
-
all = parseKeys(keys);
|
|
760
|
-
for (var i = 0; i < all.length; ++i) {
|
|
761
|
-
for (var j = 0, obj; j < len; ++j) {
|
|
762
|
-
obj = fns[j];
|
|
763
|
-
if (!obj) continue;
|
|
764
|
-
if (fn && obj.fn != fn) continue;
|
|
765
|
-
if (obj.key != all[i].key) continue;
|
|
766
|
-
if (!matches(obj, all[i])) continue;
|
|
767
|
-
fns.splice(j--, 1);
|
|
693
|
+
// node_modules/.pnpm/@pirxpilot+k@1.0.1/node_modules/@pirxpilot/k/lib/proto.js
|
|
694
|
+
var require_proto = __commonJS({
|
|
695
|
+
"node_modules/.pnpm/@pirxpilot+k@1.0.1/node_modules/@pirxpilot/k/lib/proto.js"(exports) {
|
|
696
|
+
var sequence = require_yields_k_sequence();
|
|
697
|
+
var keycode = require_yields_keycode();
|
|
698
|
+
var os = require_component_os();
|
|
699
|
+
var modifiers = {
|
|
700
|
+
224: "command",
|
|
701
|
+
91: "command",
|
|
702
|
+
93: "command",
|
|
703
|
+
16: "shift",
|
|
704
|
+
17: "ctrl",
|
|
705
|
+
18: "alt"
|
|
706
|
+
};
|
|
707
|
+
exports["super"] = "mac" == os ? "command" : "ctrl";
|
|
708
|
+
exports.handle = function(e, fn) {
|
|
709
|
+
var ignore = this.ignore;
|
|
710
|
+
var event = e.type;
|
|
711
|
+
var code = e.which;
|
|
712
|
+
if (fn) return this.bind(e, fn);
|
|
713
|
+
var mod = modifiers[code];
|
|
714
|
+
if ("keydown" == event && mod) {
|
|
715
|
+
this["super"] = exports["super"] == mod;
|
|
716
|
+
this[mod] = true;
|
|
717
|
+
this.modifiers = true;
|
|
718
|
+
this.active++;
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
if (ignore && ignore(e)) return;
|
|
722
|
+
var all = this.listeners;
|
|
723
|
+
for (var i = 0; i < all.length; ++i) {
|
|
724
|
+
var invoke = true;
|
|
725
|
+
var obj = all[i];
|
|
726
|
+
var seq = obj.seq;
|
|
727
|
+
var mods = obj.mods;
|
|
728
|
+
fn = seq || obj.fn;
|
|
729
|
+
if (!seq && code != obj.code) continue;
|
|
730
|
+
if (event != obj.event) continue;
|
|
731
|
+
if (this.active != obj.mods.length) continue;
|
|
732
|
+
for (var j = 0; j < mods.length; ++j) {
|
|
733
|
+
if (!this[mods[j]]) {
|
|
734
|
+
invoke = null;
|
|
735
|
+
break;
|
|
768
736
|
}
|
|
769
737
|
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
exports.bind = function(event, keys, fn) {
|
|
773
|
-
var fns = this.listeners;
|
|
774
|
-
var len;
|
|
775
|
-
var all;
|
|
776
|
-
if (2 == arguments.length) {
|
|
777
|
-
fn = keys;
|
|
778
|
-
keys = event;
|
|
779
|
-
event = "keydown";
|
|
780
|
-
}
|
|
781
|
-
all = parseKeys(keys);
|
|
782
|
-
len = all.length;
|
|
783
|
-
for (var i = 0; i < len; ++i) {
|
|
784
|
-
var obj = all[i];
|
|
785
|
-
obj.seq = obj.seq && sequence(obj.key, fn);
|
|
786
|
-
obj.event = event;
|
|
787
|
-
obj.fn = fn;
|
|
788
|
-
fns.push(obj);
|
|
738
|
+
if (invoke) {
|
|
739
|
+
fn(e);
|
|
789
740
|
}
|
|
741
|
+
}
|
|
742
|
+
};
|
|
743
|
+
exports.destroy = function() {
|
|
744
|
+
this.el.removeEventListener("keydown", this._handle);
|
|
745
|
+
this.el.removeEventListener("keyup", this._handle);
|
|
746
|
+
this.el.removeEventListener("keyup", this._clear);
|
|
747
|
+
this.el.removeEventListener("focus", this._clear);
|
|
748
|
+
this.listeners = [];
|
|
749
|
+
};
|
|
750
|
+
exports.unbind = function(keys, fn) {
|
|
751
|
+
var fns = this.listeners;
|
|
752
|
+
var len = fns.length;
|
|
753
|
+
var all;
|
|
754
|
+
if (0 === arguments.length) {
|
|
755
|
+
this.listeners = [];
|
|
790
756
|
return this;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
this.active--;
|
|
802
|
-
this[modifiers[code]] = null;
|
|
803
|
-
this.modifiers = this.command || this.shift || this.ctrl || this.alt;
|
|
804
|
-
};
|
|
805
|
-
exports.reset = function() {
|
|
806
|
-
this.active = 0;
|
|
807
|
-
this.modifiers = this.command = this.shift = this.ctrl = this.alt = null;
|
|
808
|
-
};
|
|
809
|
-
exports.ignore = function(e) {
|
|
810
|
-
var el = e.target || e.srcElement;
|
|
811
|
-
var name = el.tagName.toLowerCase();
|
|
812
|
-
return "textarea" == name || "select" == name || "input" == name;
|
|
813
|
-
};
|
|
814
|
-
function parseKeys(keys) {
|
|
815
|
-
keys = keys.replace("super", exports["super"]);
|
|
816
|
-
var all = "," != keys ? keys.split(/ *, */) : [","];
|
|
817
|
-
var ret = [];
|
|
818
|
-
for (var i = 0; i < all.length; ++i) {
|
|
819
|
-
if ("" === all[i]) continue;
|
|
820
|
-
var mods = all[i].split(/ *\+ */);
|
|
821
|
-
var key = mods.pop() || ",";
|
|
822
|
-
ret.push({
|
|
823
|
-
seq: !!(~key.indexOf(" ") || ~key.indexOf("*")),
|
|
824
|
-
code: keycode(key),
|
|
825
|
-
mods,
|
|
826
|
-
key
|
|
827
|
-
});
|
|
757
|
+
}
|
|
758
|
+
all = parseKeys(keys);
|
|
759
|
+
for (var i = 0; i < all.length; ++i) {
|
|
760
|
+
for (var j = 0, obj; j < len; ++j) {
|
|
761
|
+
obj = fns[j];
|
|
762
|
+
if (!obj) continue;
|
|
763
|
+
if (fn && obj.fn != fn) continue;
|
|
764
|
+
if (obj.key != all[i].key) continue;
|
|
765
|
+
if (!matches(obj, all[i])) continue;
|
|
766
|
+
fns.splice(j--, 1);
|
|
828
767
|
}
|
|
829
|
-
return ret;
|
|
830
768
|
}
|
|
831
|
-
|
|
832
|
-
|
|
769
|
+
return this;
|
|
770
|
+
};
|
|
771
|
+
exports.bind = function(event, keys, fn) {
|
|
772
|
+
var fns = this.listeners;
|
|
773
|
+
var len;
|
|
774
|
+
var all;
|
|
775
|
+
if (2 == arguments.length) {
|
|
776
|
+
fn = keys;
|
|
777
|
+
keys = event;
|
|
778
|
+
event = "keydown";
|
|
833
779
|
}
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
780
|
+
all = parseKeys(keys);
|
|
781
|
+
len = all.length;
|
|
782
|
+
for (var i = 0; i < len; ++i) {
|
|
783
|
+
var obj = all[i];
|
|
784
|
+
obj.seq = obj.seq && sequence(obj.key, fn);
|
|
785
|
+
obj.event = event;
|
|
786
|
+
obj.fn = fn;
|
|
787
|
+
fns.push(obj);
|
|
838
788
|
}
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
const { immediate } = typeof options === "boolean" ? { immediate: options } : options;
|
|
877
|
-
let storedContext;
|
|
878
|
-
let storedArguments;
|
|
879
|
-
let timeoutId;
|
|
880
|
-
let timestamp;
|
|
881
|
-
let result;
|
|
882
|
-
function run() {
|
|
883
|
-
const callContext = storedContext;
|
|
884
|
-
const callArguments = storedArguments;
|
|
885
|
-
storedContext = void 0;
|
|
886
|
-
storedArguments = void 0;
|
|
887
|
-
result = function_.apply(callContext, callArguments);
|
|
888
|
-
return result;
|
|
889
|
-
}
|
|
890
|
-
function later() {
|
|
891
|
-
const last = Date.now() - timestamp;
|
|
892
|
-
if (last < wait && last >= 0) {
|
|
893
|
-
timeoutId = setTimeout(later, wait - last);
|
|
894
|
-
} else {
|
|
895
|
-
timeoutId = void 0;
|
|
896
|
-
if (!immediate) {
|
|
897
|
-
result = run();
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
const debounced = function(...arguments_) {
|
|
902
|
-
if (storedContext && this !== storedContext && Object.getPrototypeOf(this) === Object.getPrototypeOf(storedContext)) {
|
|
903
|
-
throw new Error("Debounced method called with different contexts of the same prototype.");
|
|
904
|
-
}
|
|
905
|
-
storedContext = this;
|
|
906
|
-
storedArguments = arguments_;
|
|
907
|
-
timestamp = Date.now();
|
|
908
|
-
const callNow = immediate && !timeoutId;
|
|
909
|
-
if (!timeoutId) {
|
|
910
|
-
timeoutId = setTimeout(later, wait);
|
|
911
|
-
}
|
|
912
|
-
if (callNow) {
|
|
913
|
-
result = run();
|
|
914
|
-
}
|
|
915
|
-
return result;
|
|
916
|
-
};
|
|
917
|
-
Object.defineProperty(debounced, "isPending", {
|
|
918
|
-
get() {
|
|
919
|
-
return timeoutId !== void 0;
|
|
920
|
-
}
|
|
789
|
+
return this;
|
|
790
|
+
};
|
|
791
|
+
exports.up = function(keys, fn) {
|
|
792
|
+
return this.bind("keyup", keys, fn);
|
|
793
|
+
};
|
|
794
|
+
exports.down = function(keys, fn) {
|
|
795
|
+
return this.bind("keydown", keys, fn);
|
|
796
|
+
};
|
|
797
|
+
exports.clear = function(e) {
|
|
798
|
+
var code = e.keyCode || e.which;
|
|
799
|
+
if (!(code in modifiers)) return;
|
|
800
|
+
this.active--;
|
|
801
|
+
this[modifiers[code]] = null;
|
|
802
|
+
this.modifiers = this.command || this.shift || this.ctrl || this.alt;
|
|
803
|
+
};
|
|
804
|
+
exports.reset = function() {
|
|
805
|
+
this.active = 0;
|
|
806
|
+
this.modifiers = this.command = this.shift = this.ctrl = this.alt = null;
|
|
807
|
+
};
|
|
808
|
+
exports.ignore = function(e) {
|
|
809
|
+
var el = e.target || e.srcElement;
|
|
810
|
+
var name = el.tagName.toLowerCase();
|
|
811
|
+
return "textarea" == name || "select" == name || "input" == name;
|
|
812
|
+
};
|
|
813
|
+
function parseKeys(keys) {
|
|
814
|
+
keys = keys.replace("super", exports["super"]);
|
|
815
|
+
var all = "," != keys ? keys.split(/ *, */) : [","];
|
|
816
|
+
var ret = [];
|
|
817
|
+
for (var i = 0; i < all.length; ++i) {
|
|
818
|
+
if ("" === all[i]) continue;
|
|
819
|
+
var mods = all[i].split(/ *\+ */);
|
|
820
|
+
var key = mods.pop() || ",";
|
|
821
|
+
ret.push({
|
|
822
|
+
seq: !!(~key.indexOf(" ") || ~key.indexOf("*")),
|
|
823
|
+
code: keycode(key),
|
|
824
|
+
mods,
|
|
825
|
+
key
|
|
921
826
|
});
|
|
922
|
-
debounced.clear = () => {
|
|
923
|
-
if (!timeoutId) {
|
|
924
|
-
return;
|
|
925
|
-
}
|
|
926
|
-
clearTimeout(timeoutId);
|
|
927
|
-
timeoutId = void 0;
|
|
928
|
-
};
|
|
929
|
-
debounced.flush = () => {
|
|
930
|
-
if (!timeoutId) {
|
|
931
|
-
return;
|
|
932
|
-
}
|
|
933
|
-
debounced.trigger();
|
|
934
|
-
};
|
|
935
|
-
debounced.trigger = () => {
|
|
936
|
-
result = run();
|
|
937
|
-
debounced.clear();
|
|
938
|
-
};
|
|
939
|
-
return debounced;
|
|
940
827
|
}
|
|
941
|
-
|
|
942
|
-
module.exports = debounce2;
|
|
828
|
+
return ret;
|
|
943
829
|
}
|
|
944
|
-
|
|
830
|
+
function matches(a, b) {
|
|
831
|
+
return 0 === b.mods.length || eql(a, b);
|
|
832
|
+
}
|
|
833
|
+
function eql(a, b) {
|
|
834
|
+
a = a.mods.sort().toString();
|
|
835
|
+
b = b.mods.sort().toString();
|
|
836
|
+
return a == b;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
});
|
|
945
840
|
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
841
|
+
// node_modules/.pnpm/@pirxpilot+k@1.0.1/node_modules/@pirxpilot/k/lib/index.js
|
|
842
|
+
var require_lib = __commonJS({
|
|
843
|
+
"node_modules/.pnpm/@pirxpilot+k@1.0.1/node_modules/@pirxpilot/k/lib/index.js"(exports, module) {
|
|
844
|
+
var proto = require_proto();
|
|
845
|
+
module.exports = function(el) {
|
|
846
|
+
function k2(e, fn) {
|
|
847
|
+
k2.handle(e, fn);
|
|
952
848
|
}
|
|
953
|
-
|
|
954
|
-
|
|
849
|
+
k2._handle = proto.handle.bind(k2);
|
|
850
|
+
k2._clear = proto.clear.bind(k2);
|
|
851
|
+
k2._reset = proto.reset.bind(k2);
|
|
852
|
+
el.addEventListener("keydown", k2._handle, false);
|
|
853
|
+
el.addEventListener("keyup", k2._handle, false);
|
|
854
|
+
el.addEventListener("keyup", k2._clear, false);
|
|
855
|
+
el.addEventListener("focus", k2._reset, false);
|
|
856
|
+
for (var p in proto) k2[p] = proto[p];
|
|
857
|
+
k2.listeners = [];
|
|
858
|
+
k2.active = 0;
|
|
859
|
+
k2.el = el;
|
|
860
|
+
return k2;
|
|
861
|
+
};
|
|
955
862
|
}
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
863
|
+
});
|
|
864
|
+
|
|
865
|
+
// node_modules/.pnpm/debounce@2.2.0/node_modules/debounce/index.js
|
|
866
|
+
var require_debounce = __commonJS({
|
|
867
|
+
"node_modules/.pnpm/debounce@2.2.0/node_modules/debounce/index.js"(exports, module) {
|
|
868
|
+
function debounce2(function_, wait = 100, options = {}) {
|
|
869
|
+
if (typeof function_ !== "function") {
|
|
870
|
+
throw new TypeError(`Expected the first parameter to be a function, got \`${typeof function_}\`.`);
|
|
960
871
|
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
write: function(value) {
|
|
964
|
-
return encodeURIComponent(value).replace(
|
|
965
|
-
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
966
|
-
decodeURIComponent
|
|
967
|
-
);
|
|
968
|
-
}
|
|
969
|
-
};
|
|
970
|
-
function init(converter, defaultAttributes) {
|
|
971
|
-
function set(name, value, attributes) {
|
|
972
|
-
if (typeof document === "undefined") {
|
|
973
|
-
return;
|
|
872
|
+
if (wait < 0) {
|
|
873
|
+
throw new RangeError("`wait` must not be negative.");
|
|
974
874
|
}
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
875
|
+
const { immediate } = typeof options === "boolean" ? { immediate: options } : options;
|
|
876
|
+
let storedContext;
|
|
877
|
+
let storedArguments;
|
|
878
|
+
let timeoutId;
|
|
879
|
+
let timestamp;
|
|
880
|
+
let result;
|
|
881
|
+
function run() {
|
|
882
|
+
const callContext = storedContext;
|
|
883
|
+
const callArguments = storedArguments;
|
|
884
|
+
storedContext = void 0;
|
|
885
|
+
storedArguments = void 0;
|
|
886
|
+
result = function_.apply(callContext, callArguments);
|
|
887
|
+
return result;
|
|
978
888
|
}
|
|
979
|
-
|
|
980
|
-
|
|
889
|
+
function later() {
|
|
890
|
+
const last = Date.now() - timestamp;
|
|
891
|
+
if (last < wait && last >= 0) {
|
|
892
|
+
timeoutId = setTimeout(later, wait - last);
|
|
893
|
+
} else {
|
|
894
|
+
timeoutId = void 0;
|
|
895
|
+
if (!immediate) {
|
|
896
|
+
result = run();
|
|
897
|
+
}
|
|
898
|
+
}
|
|
981
899
|
}
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
if (!attributes[attributeName]) {
|
|
986
|
-
continue;
|
|
900
|
+
const debounced = function(...arguments_) {
|
|
901
|
+
if (storedContext && this !== storedContext && Object.getPrototypeOf(this) === Object.getPrototypeOf(storedContext)) {
|
|
902
|
+
throw new Error("Debounced method called with different contexts of the same prototype.");
|
|
987
903
|
}
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
904
|
+
storedContext = this;
|
|
905
|
+
storedArguments = arguments_;
|
|
906
|
+
timestamp = Date.now();
|
|
907
|
+
const callNow = immediate && !timeoutId;
|
|
908
|
+
if (!timeoutId) {
|
|
909
|
+
timeoutId = setTimeout(later, wait);
|
|
991
910
|
}
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes;
|
|
995
|
-
}
|
|
996
|
-
function get(name) {
|
|
997
|
-
if (typeof document === "undefined" || arguments.length && !name) {
|
|
998
|
-
return;
|
|
999
|
-
}
|
|
1000
|
-
var cookies = document.cookie ? document.cookie.split("; ") : [];
|
|
1001
|
-
var jar = {};
|
|
1002
|
-
for (var i = 0; i < cookies.length; i++) {
|
|
1003
|
-
var parts = cookies[i].split("=");
|
|
1004
|
-
var value = parts.slice(1).join("=");
|
|
1005
|
-
try {
|
|
1006
|
-
var found = decodeURIComponent(parts[0]);
|
|
1007
|
-
jar[found] = converter.read(value, found);
|
|
1008
|
-
if (name === found) {
|
|
1009
|
-
break;
|
|
1010
|
-
}
|
|
1011
|
-
} catch (e) {
|
|
911
|
+
if (callNow) {
|
|
912
|
+
result = run();
|
|
1012
913
|
}
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
set,
|
|
1019
|
-
get,
|
|
1020
|
-
remove: function(name, attributes) {
|
|
1021
|
-
set(
|
|
1022
|
-
name,
|
|
1023
|
-
"",
|
|
1024
|
-
assign({}, attributes, {
|
|
1025
|
-
expires: -1
|
|
1026
|
-
})
|
|
1027
|
-
);
|
|
1028
|
-
},
|
|
1029
|
-
withAttributes: function(attributes) {
|
|
1030
|
-
return init(this.converter, assign({}, this.attributes, attributes));
|
|
1031
|
-
},
|
|
1032
|
-
withConverter: function(converter2) {
|
|
1033
|
-
return init(assign({}, this.converter, converter2), this.attributes);
|
|
914
|
+
return result;
|
|
915
|
+
};
|
|
916
|
+
Object.defineProperty(debounced, "isPending", {
|
|
917
|
+
get() {
|
|
918
|
+
return timeoutId !== void 0;
|
|
1034
919
|
}
|
|
1035
|
-
}
|
|
1036
|
-
{
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
920
|
+
});
|
|
921
|
+
debounced.clear = () => {
|
|
922
|
+
if (!timeoutId) {
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
clearTimeout(timeoutId);
|
|
926
|
+
timeoutId = void 0;
|
|
927
|
+
};
|
|
928
|
+
debounced.flush = () => {
|
|
929
|
+
if (!timeoutId) {
|
|
930
|
+
return;
|
|
931
|
+
}
|
|
932
|
+
debounced.trigger();
|
|
933
|
+
};
|
|
934
|
+
debounced.trigger = () => {
|
|
935
|
+
result = run();
|
|
936
|
+
debounced.clear();
|
|
937
|
+
};
|
|
938
|
+
return debounced;
|
|
939
|
+
}
|
|
940
|
+
module.exports.debounce = debounce2;
|
|
941
|
+
module.exports = debounce2;
|
|
1041
942
|
}
|
|
1042
|
-
|
|
943
|
+
});
|
|
1043
944
|
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
945
|
+
// node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.mjs
|
|
946
|
+
function assign(target) {
|
|
947
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
948
|
+
var source = arguments[i];
|
|
949
|
+
for (var key in source) {
|
|
950
|
+
target[key] = source[key];
|
|
1049
951
|
}
|
|
1050
|
-
|
|
1051
|
-
|
|
952
|
+
}
|
|
953
|
+
return target;
|
|
954
|
+
}
|
|
955
|
+
var defaultConverter = {
|
|
956
|
+
read: function(value) {
|
|
957
|
+
if (value[0] === '"') {
|
|
958
|
+
value = value.slice(1, -1);
|
|
1052
959
|
}
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
960
|
+
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
961
|
+
},
|
|
962
|
+
write: function(value) {
|
|
963
|
+
return encodeURIComponent(value).replace(
|
|
964
|
+
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
965
|
+
decodeURIComponent
|
|
966
|
+
);
|
|
967
|
+
}
|
|
968
|
+
};
|
|
969
|
+
function init(converter, defaultAttributes) {
|
|
970
|
+
function set(name, value, attributes) {
|
|
971
|
+
if (typeof document === "undefined") {
|
|
972
|
+
return;
|
|
1062
973
|
}
|
|
1063
|
-
|
|
1064
|
-
|
|
974
|
+
attributes = assign({}, defaultAttributes, attributes);
|
|
975
|
+
if (typeof attributes.expires === "number") {
|
|
976
|
+
attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
|
|
1065
977
|
}
|
|
1066
|
-
|
|
1067
|
-
|
|
978
|
+
if (attributes.expires) {
|
|
979
|
+
attributes.expires = attributes.expires.toUTCString();
|
|
1068
980
|
}
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
trigger: node.querySelector(selector),
|
|
1075
|
-
state: "open",
|
|
1076
|
-
// by default trigger 'open' state
|
|
1077
|
-
fn() {
|
|
981
|
+
name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
982
|
+
var stringifiedAttributes = "";
|
|
983
|
+
for (var attributeName in attributes) {
|
|
984
|
+
if (!attributes[attributeName]) {
|
|
985
|
+
continue;
|
|
1078
986
|
}
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
function onclick(e) {
|
|
1085
|
-
e.preventDefault();
|
|
1086
|
-
const state3 = node.classList.toggle(my.state);
|
|
1087
|
-
my.fn.call(null, state3);
|
|
1088
|
-
}
|
|
1089
|
-
function state2(s) {
|
|
1090
|
-
my.state = s;
|
|
1091
|
-
return self;
|
|
987
|
+
stringifiedAttributes += "; " + attributeName;
|
|
988
|
+
if (attributes[attributeName] === true) {
|
|
989
|
+
continue;
|
|
990
|
+
}
|
|
991
|
+
stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
|
|
1092
992
|
}
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
993
|
+
return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes;
|
|
994
|
+
}
|
|
995
|
+
function get(name) {
|
|
996
|
+
if (typeof document === "undefined" || arguments.length && !name) {
|
|
997
|
+
return;
|
|
1096
998
|
}
|
|
1097
|
-
|
|
1098
|
-
|
|
999
|
+
var cookies = document.cookie ? document.cookie.split("; ") : [];
|
|
1000
|
+
var jar = {};
|
|
1001
|
+
for (var i = 0; i < cookies.length; i++) {
|
|
1002
|
+
var parts = cookies[i].split("=");
|
|
1003
|
+
var value = parts.slice(1).join("=");
|
|
1004
|
+
try {
|
|
1005
|
+
var found = decodeURIComponent(parts[0]);
|
|
1006
|
+
jar[found] = converter.read(value, found);
|
|
1007
|
+
if (name === found) {
|
|
1008
|
+
break;
|
|
1009
|
+
}
|
|
1010
|
+
} catch (e) {
|
|
1011
|
+
}
|
|
1099
1012
|
}
|
|
1100
|
-
return
|
|
1013
|
+
return name ? jar[name] : jar;
|
|
1101
1014
|
}
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1015
|
+
return Object.create(
|
|
1016
|
+
{
|
|
1017
|
+
set,
|
|
1018
|
+
get,
|
|
1019
|
+
remove: function(name, attributes) {
|
|
1020
|
+
set(
|
|
1021
|
+
name,
|
|
1022
|
+
"",
|
|
1023
|
+
assign({}, attributes, {
|
|
1024
|
+
expires: -1
|
|
1025
|
+
})
|
|
1026
|
+
);
|
|
1027
|
+
},
|
|
1028
|
+
withAttributes: function(attributes) {
|
|
1029
|
+
return init(this.converter, assign({}, this.attributes, attributes));
|
|
1030
|
+
},
|
|
1031
|
+
withConverter: function(converter2) {
|
|
1032
|
+
return init(assign({}, this.converter, converter2), this.attributes);
|
|
1033
|
+
}
|
|
1034
|
+
},
|
|
1035
|
+
{
|
|
1036
|
+
attributes: { value: Object.freeze(defaultAttributes) },
|
|
1037
|
+
converter: { value: Object.freeze(converter) }
|
|
1107
1038
|
}
|
|
1039
|
+
);
|
|
1040
|
+
}
|
|
1041
|
+
var api = init(defaultConverter, { path: "/" });
|
|
1042
|
+
|
|
1043
|
+
// lib/client/about/index.js
|
|
1044
|
+
function about() {
|
|
1045
|
+
const s = document.querySelector(".hidden .about");
|
|
1046
|
+
if (!s) {
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
if (!check()) {
|
|
1050
|
+
return;
|
|
1051
|
+
}
|
|
1052
|
+
const section = s.parentNode;
|
|
1053
|
+
const trigger = s.querySelector("a.close");
|
|
1054
|
+
trigger.addEventListener("click", (e) => {
|
|
1055
|
+
close();
|
|
1056
|
+
e.preventDefault();
|
|
1057
|
+
});
|
|
1058
|
+
open();
|
|
1059
|
+
function check() {
|
|
1060
|
+
return window.parent === window && typeof api.get("resorts-open") === "undefined";
|
|
1061
|
+
}
|
|
1062
|
+
function close() {
|
|
1063
|
+
section.classList.add("hidden");
|
|
1108
1064
|
}
|
|
1109
|
-
function
|
|
1110
|
-
|
|
1065
|
+
function open() {
|
|
1066
|
+
section.classList.remove("hidden");
|
|
1111
1067
|
}
|
|
1068
|
+
}
|
|
1112
1069
|
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
node.innerHTML = Object.keys(status).map((name) => {
|
|
1121
|
-
const klass = `status ls-${status[name]}`;
|
|
1122
|
-
return `<li class="lift"><span class="name">${name}</span><span class="${klass}"></span></li>`;
|
|
1123
|
-
}).join("");
|
|
1070
|
+
// lib/client/minimax/index.js
|
|
1071
|
+
function minimax(node, selector) {
|
|
1072
|
+
const my = {
|
|
1073
|
+
trigger: node.querySelector(selector),
|
|
1074
|
+
state: "open",
|
|
1075
|
+
// by default trigger 'open' state
|
|
1076
|
+
fn() {
|
|
1124
1077
|
}
|
|
1078
|
+
};
|
|
1079
|
+
const self = {
|
|
1080
|
+
state: state2,
|
|
1081
|
+
on
|
|
1082
|
+
};
|
|
1083
|
+
function onclick(e) {
|
|
1084
|
+
e.preventDefault();
|
|
1085
|
+
const state3 = node.classList.toggle(my.state);
|
|
1086
|
+
my.fn.call(null, state3);
|
|
1125
1087
|
}
|
|
1126
|
-
function
|
|
1127
|
-
|
|
1088
|
+
function state2(s) {
|
|
1089
|
+
my.state = s;
|
|
1090
|
+
return self;
|
|
1128
1091
|
}
|
|
1129
|
-
function
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
node.querySelector(`.${state2}`).setAttribute("style", width);
|
|
1133
|
-
});
|
|
1092
|
+
function on(fn) {
|
|
1093
|
+
my.fn = fn;
|
|
1094
|
+
return self;
|
|
1134
1095
|
}
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
renderStats(node.querySelector(".summary"), stats2);
|
|
1138
|
-
renderColorBar(node.querySelector(".summary-color-bar"), stats2.percentage);
|
|
1096
|
+
if (my.trigger) {
|
|
1097
|
+
my.trigger.addEventListener("click", onclick);
|
|
1139
1098
|
}
|
|
1099
|
+
return self;
|
|
1100
|
+
}
|
|
1140
1101
|
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
function renderField(div, field, snow) {
|
|
1146
|
-
const el = div.querySelector(`.${field}`);
|
|
1147
|
-
const value = snow[field];
|
|
1148
|
-
el.querySelector(".value").innerHTML = value || "";
|
|
1149
|
-
el.classList.toggle("hidden", !value);
|
|
1102
|
+
// lib/client/resort/dom.js
|
|
1103
|
+
function removeAllChildren(node) {
|
|
1104
|
+
while (node.hasChildNodes()) {
|
|
1105
|
+
node.removeChild(node.lastChild);
|
|
1150
1106
|
}
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1107
|
+
}
|
|
1108
|
+
function next({ nextElementSibling, nextSibling }) {
|
|
1109
|
+
return nextElementSibling || nextSibling;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
// lib/client/resort/lifts.js
|
|
1113
|
+
render.section = 0;
|
|
1114
|
+
render.type = "lifts";
|
|
1115
|
+
var states = ["open", "hold", "scheduled", "closed"];
|
|
1116
|
+
function renderStatus(node, status) {
|
|
1117
|
+
removeAllChildren(node);
|
|
1118
|
+
if (status) {
|
|
1119
|
+
node.innerHTML = Object.keys(status).map((name) => {
|
|
1120
|
+
const klass = `status ls-${status[name]}`;
|
|
1121
|
+
return `<li class="lift"><span class="name">${name}</span><span class="${klass}"></span></li>`;
|
|
1122
|
+
}).join("");
|
|
1160
1123
|
}
|
|
1124
|
+
}
|
|
1125
|
+
function renderStats(node, stats2) {
|
|
1126
|
+
states.forEach((s) => node.querySelector(`.ls-${s}`).innerHTML = stats2 ? stats2[s] : 0);
|
|
1127
|
+
}
|
|
1128
|
+
function renderColorBar(node, percentage) {
|
|
1129
|
+
states.forEach((state2) => {
|
|
1130
|
+
const width = `width:${percentage ? percentage[state2] : 25}%;`;
|
|
1131
|
+
node.querySelector(`.${state2}`).setAttribute("style", width);
|
|
1132
|
+
});
|
|
1133
|
+
}
|
|
1134
|
+
function render(node, { status, stats: stats2 }) {
|
|
1135
|
+
renderStatus(node.querySelector(".lifts"), status);
|
|
1136
|
+
renderStats(node.querySelector(".summary"), stats2);
|
|
1137
|
+
renderColorBar(node.querySelector(".summary-color-bar"), stats2.percentage);
|
|
1138
|
+
}
|
|
1161
1139
|
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1140
|
+
// lib/client/resort/snow.js
|
|
1141
|
+
var day = 24 * 60 * 60 * 1e3;
|
|
1142
|
+
render2.section = 1;
|
|
1143
|
+
render2.type = "snow";
|
|
1144
|
+
function renderField(div, field, snow) {
|
|
1145
|
+
const el = div.querySelector(`.${field}`);
|
|
1146
|
+
const value = snow[field];
|
|
1147
|
+
el.querySelector(".value").innerHTML = value || "";
|
|
1148
|
+
el.classList.toggle("hidden", !value);
|
|
1149
|
+
}
|
|
1150
|
+
function render2(div, snow) {
|
|
1151
|
+
if (Date.now() - snow.timestamp > day) {
|
|
1152
|
+
return false;
|
|
1170
1153
|
}
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1154
|
+
renderField(div, "snowfall", snow);
|
|
1155
|
+
renderField(div, "depth", snow);
|
|
1156
|
+
renderField(div, "condition", snow);
|
|
1157
|
+
div.querySelector(".notice").innerHTML = snow.notice || "";
|
|
1158
|
+
return true;
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
// lib/client/resort/weather.js
|
|
1162
|
+
var day2 = 24 * 60 * 60 * 1e3;
|
|
1163
|
+
render3.section = 1;
|
|
1164
|
+
render3.type = "weather";
|
|
1165
|
+
function renderIcon(li, icon) {
|
|
1166
|
+
if (Array.isArray(icon)) {
|
|
1167
|
+
icon.forEach((cl, i) => li.item(i).setAttribute("class", cl));
|
|
1183
1168
|
}
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
renderIcon(div.querySelectorAll(".weather-icon > ul > li"), weather.icon);
|
|
1189
|
-
div.querySelector(".temperature").innerHTML = `${weather.temperature.max}°F`;
|
|
1190
|
-
const snowforecast = div.querySelector(".snowforecast");
|
|
1191
|
-
snowforecast.classList.toggle("hidden", !weather.snow);
|
|
1192
|
-
if (weather.snow) {
|
|
1193
|
-
snowforecast.innerHTML = `${weather.snow}"`;
|
|
1194
|
-
}
|
|
1195
|
-
div.querySelector(".conditions").innerHTML = weather.conditions;
|
|
1196
|
-
div.querySelector(".text").innerHTML = weather.text;
|
|
1197
|
-
renderNotice(div.querySelector(".notice"), weather.notice);
|
|
1198
|
-
return true;
|
|
1169
|
+
}
|
|
1170
|
+
function renderNotice(el, notice) {
|
|
1171
|
+
if (!notice) {
|
|
1172
|
+
return el.classList.add("hidden");
|
|
1199
1173
|
}
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
function refresh(count) {
|
|
1213
|
-
ui.swipe.refresh();
|
|
1214
|
-
ui.pager.total(count).render();
|
|
1215
|
-
el.pager.classList.toggle("hidden", count < 2);
|
|
1216
|
-
}
|
|
1217
|
-
function current() {
|
|
1218
|
-
return ui.swipe.currentVisible;
|
|
1219
|
-
}
|
|
1220
|
-
ui.pager.on("show", (n) => {
|
|
1221
|
-
ui.swipe.show(n, null, {
|
|
1222
|
-
silent: true
|
|
1223
|
-
});
|
|
1224
|
-
});
|
|
1225
|
-
ui.swipe.on("show", (n) => {
|
|
1226
|
-
ui.pager.select(n, {
|
|
1227
|
-
silent: true
|
|
1228
|
-
});
|
|
1229
|
-
});
|
|
1230
|
-
return {
|
|
1231
|
-
refresh,
|
|
1232
|
-
current
|
|
1233
|
-
};
|
|
1174
|
+
el.classList.remove("hidden");
|
|
1175
|
+
el = el.querySelector("a");
|
|
1176
|
+
el.setAttribute("href", notice.href);
|
|
1177
|
+
el.setAttribute("title", `Go to ${notice.site}`);
|
|
1178
|
+
el = el.querySelector("img");
|
|
1179
|
+
el.setAttribute("src", notice.img);
|
|
1180
|
+
el.setAttribute("style", `width:${notice.width}px;`);
|
|
1181
|
+
el.setAttribute("alt", notice.site);
|
|
1182
|
+
}
|
|
1183
|
+
function render3(div, weather) {
|
|
1184
|
+
if (Date.now() - weather.timestamp > day2) {
|
|
1185
|
+
return false;
|
|
1234
1186
|
}
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
const imgs = it.node.querySelectorAll("img");
|
|
1242
|
-
const fn = swap.bind(null, imgs, it);
|
|
1243
|
-
for (let i = 0; i < imgs.length; i++) {
|
|
1244
|
-
imgs[i].onload = fn;
|
|
1245
|
-
}
|
|
1246
|
-
imgs[it.inactive].setAttribute("src", imgs[it.active].getAttribute("src"));
|
|
1247
|
-
});
|
|
1248
|
-
}
|
|
1249
|
-
function initCam(cam, { source, image, name, notice }) {
|
|
1250
|
-
cam.querySelector("a").setAttribute("href", source);
|
|
1251
|
-
cam.querySelector("img.active").setAttribute("src", image);
|
|
1252
|
-
cam.querySelector("img.inactive").setAttribute("src", "");
|
|
1253
|
-
cam.querySelector(".title").innerHTML = name;
|
|
1254
|
-
cam.querySelector(".notice").innerHTML = notice || "";
|
|
1255
|
-
cams.push({
|
|
1256
|
-
node: cam,
|
|
1257
|
-
active: 0,
|
|
1258
|
-
inactive: 1
|
|
1259
|
-
});
|
|
1260
|
-
}
|
|
1261
|
-
function init3() {
|
|
1262
|
-
if (timer) {
|
|
1263
|
-
clearInterval(timer);
|
|
1264
|
-
timer = void 0;
|
|
1265
|
-
}
|
|
1266
|
-
cams = [];
|
|
1267
|
-
const ul = div.querySelector("ul");
|
|
1268
|
-
const li = ul.querySelectorAll("li");
|
|
1269
|
-
webcams.forEach((webcam, i) => {
|
|
1270
|
-
let cam;
|
|
1271
|
-
if (i < li.length) {
|
|
1272
|
-
cam = li[i];
|
|
1273
|
-
} else {
|
|
1274
|
-
cam = ul.appendChild(li[0].cloneNode(true));
|
|
1275
|
-
}
|
|
1276
|
-
initCam(cam.querySelector(".webcam"), webcam);
|
|
1277
|
-
});
|
|
1278
|
-
for (let i = Math.max(1, webcams.length); i < li.length; i++) {
|
|
1279
|
-
ul.removeChild(li[i]);
|
|
1280
|
-
}
|
|
1281
|
-
if (!ui) {
|
|
1282
|
-
ui = swiper({
|
|
1283
|
-
swipe: div.querySelector(".swipe"),
|
|
1284
|
-
pager: div.querySelector(".pager")
|
|
1285
|
-
});
|
|
1286
|
-
}
|
|
1287
|
-
ui.refresh(webcams.length);
|
|
1288
|
-
if (!cams.length) {
|
|
1289
|
-
return false;
|
|
1290
|
-
}
|
|
1291
|
-
timer = setInterval(refresh, DELAY);
|
|
1292
|
-
return true;
|
|
1293
|
-
}
|
|
1294
|
-
function swap(imgs, it) {
|
|
1295
|
-
it.active = (it.active + 1) % 2;
|
|
1296
|
-
it.inactive = (it.inactive + 1) % 2;
|
|
1297
|
-
imgs[it.inactive].setAttribute("class", "inactive");
|
|
1298
|
-
imgs[it.active].setAttribute("class", "active");
|
|
1299
|
-
imgs[it.inactive].setAttribute("src", "");
|
|
1300
|
-
}
|
|
1301
|
-
init3();
|
|
1187
|
+
renderIcon(div.querySelectorAll(".weather-icon > ul > li"), weather.icon);
|
|
1188
|
+
div.querySelector(".temperature").innerHTML = `${weather.temperature.max}°F`;
|
|
1189
|
+
const snowforecast = div.querySelector(".snowforecast");
|
|
1190
|
+
snowforecast.classList.toggle("hidden", !weather.snow);
|
|
1191
|
+
if (weather.snow) {
|
|
1192
|
+
snowforecast.innerHTML = `${weather.snow}"`;
|
|
1302
1193
|
}
|
|
1194
|
+
div.querySelector(".conditions").innerHTML = weather.conditions;
|
|
1195
|
+
div.querySelector(".text").innerHTML = weather.text;
|
|
1196
|
+
renderNotice(div.querySelector(".notice"), weather.notice);
|
|
1197
|
+
return true;
|
|
1198
|
+
}
|
|
1303
1199
|
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1200
|
+
// lib/client/resort/webcams.js
|
|
1201
|
+
var import_swipe = __toESM(require_swipe(), 1);
|
|
1202
|
+
var import_tiny_pager = __toESM(require_tiny_pager(), 1);
|
|
1203
|
+
render4.section = 1;
|
|
1204
|
+
render4.type = "webcams";
|
|
1205
|
+
var DELAY = 15 * 60 * 1e3;
|
|
1206
|
+
function swiper(el) {
|
|
1207
|
+
const ui = {
|
|
1208
|
+
swipe: (0, import_swipe.default)(el.swipe),
|
|
1209
|
+
pager: (0, import_tiny_pager.default)(el.pager)
|
|
1210
|
+
};
|
|
1211
|
+
function refresh(count) {
|
|
1212
|
+
ui.swipe.refresh();
|
|
1213
|
+
ui.pager.total(count).render();
|
|
1214
|
+
el.pager.classList.toggle("hidden", count < 2);
|
|
1314
1215
|
}
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1216
|
+
function current() {
|
|
1217
|
+
return ui.swipe.currentVisible;
|
|
1218
|
+
}
|
|
1219
|
+
ui.pager.on("show", (n) => {
|
|
1220
|
+
ui.swipe.show(n, null, {
|
|
1221
|
+
silent: true
|
|
1222
|
+
});
|
|
1223
|
+
});
|
|
1224
|
+
ui.swipe.on("show", (n) => {
|
|
1225
|
+
ui.pager.select(n, {
|
|
1226
|
+
silent: true
|
|
1227
|
+
});
|
|
1228
|
+
});
|
|
1229
|
+
return {
|
|
1230
|
+
refresh,
|
|
1231
|
+
current
|
|
1232
|
+
};
|
|
1233
|
+
}
|
|
1234
|
+
function render4(div, webcams) {
|
|
1235
|
+
let cams;
|
|
1236
|
+
let timer;
|
|
1237
|
+
let ui;
|
|
1238
|
+
function refresh() {
|
|
1239
|
+
cams.forEach((it) => {
|
|
1240
|
+
const imgs = it.node.querySelectorAll("img");
|
|
1241
|
+
const fn = swap.bind(null, imgs, it);
|
|
1242
|
+
for (let i = 0; i < imgs.length; i++) {
|
|
1243
|
+
imgs[i].onload = fn;
|
|
1331
1244
|
}
|
|
1245
|
+
imgs[it.inactive].setAttribute("src", imgs[it.active].getAttribute("src"));
|
|
1332
1246
|
});
|
|
1333
1247
|
}
|
|
1334
|
-
function
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
return resort2[plugin];
|
|
1248
|
+
function initCam(cam, { source, image, name, notice }) {
|
|
1249
|
+
cam.querySelector("a").setAttribute("href", source);
|
|
1250
|
+
cam.querySelector("img.active").setAttribute("src", image);
|
|
1251
|
+
cam.querySelector("img.inactive").setAttribute("src", "");
|
|
1252
|
+
cam.querySelector(".title").innerHTML = name;
|
|
1253
|
+
cam.querySelector(".notice").innerHTML = notice || "";
|
|
1254
|
+
cams.push({
|
|
1255
|
+
node: cam,
|
|
1256
|
+
active: 0,
|
|
1257
|
+
inactive: 1
|
|
1345
1258
|
});
|
|
1346
|
-
renderOpening(node, node.dataset.opening);
|
|
1347
|
-
node.dataset.timestamp = JSON.stringify(tsCurr);
|
|
1348
1259
|
}
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
const ttr = node.querySelector(".time-to-refresh");
|
|
1354
|
-
ttr.innerHTML = counter * 5;
|
|
1260
|
+
function init3() {
|
|
1261
|
+
if (timer) {
|
|
1262
|
+
clearInterval(timer);
|
|
1263
|
+
timer = void 0;
|
|
1355
1264
|
}
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
if (
|
|
1362
|
-
|
|
1265
|
+
cams = [];
|
|
1266
|
+
const ul = div.querySelector("ul");
|
|
1267
|
+
const li = ul.querySelectorAll("li");
|
|
1268
|
+
webcams.forEach((webcam, i) => {
|
|
1269
|
+
let cam;
|
|
1270
|
+
if (i < li.length) {
|
|
1271
|
+
cam = li[i];
|
|
1363
1272
|
} else {
|
|
1364
|
-
|
|
1273
|
+
cam = ul.appendChild(li[0].cloneNode(true));
|
|
1365
1274
|
}
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
updateCounter = MAX;
|
|
1371
|
-
updateTimeToRefresh(updateCounter);
|
|
1372
|
-
fetch(`/api/resort/${id}`).then((res) => res.json()).then((resort2) => render5(node, resort2));
|
|
1275
|
+
initCam(cam.querySelector(".webcam"), webcam);
|
|
1276
|
+
});
|
|
1277
|
+
for (let i = Math.max(1, webcams.length); i < li.length; i++) {
|
|
1278
|
+
ul.removeChild(li[i]);
|
|
1373
1279
|
}
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
const data = ds[plugin];
|
|
1379
|
-
return data && JSON.parse(data);
|
|
1280
|
+
if (!ui) {
|
|
1281
|
+
ui = swiper({
|
|
1282
|
+
swipe: div.querySelector(".swipe"),
|
|
1283
|
+
pager: div.querySelector(".pager")
|
|
1380
1284
|
});
|
|
1381
1285
|
}
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1286
|
+
ui.refresh(webcams.length);
|
|
1287
|
+
if (!cams.length) {
|
|
1288
|
+
return false;
|
|
1289
|
+
}
|
|
1290
|
+
timer = setInterval(refresh, DELAY);
|
|
1291
|
+
return true;
|
|
1387
1292
|
}
|
|
1293
|
+
function swap(imgs, it) {
|
|
1294
|
+
it.active = (it.active + 1) % 2;
|
|
1295
|
+
it.inactive = (it.inactive + 1) % 2;
|
|
1296
|
+
imgs[it.inactive].setAttribute("class", "inactive");
|
|
1297
|
+
imgs[it.active].setAttribute("class", "active");
|
|
1298
|
+
imgs[it.inactive].setAttribute("src", "");
|
|
1299
|
+
}
|
|
1300
|
+
init3();
|
|
1301
|
+
}
|
|
1388
1302
|
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
update,
|
|
1398
|
-
read
|
|
1399
|
-
};
|
|
1400
|
-
function find(id) {
|
|
1401
|
-
return nodes.find((n) => n.dataset.resort === id);
|
|
1303
|
+
// lib/client/resort/index.js
|
|
1304
|
+
function renderOpening(node, opening) {
|
|
1305
|
+
if (opening) {
|
|
1306
|
+
opening = opening.split("-");
|
|
1307
|
+
if (new Date(opening[0], opening[1] - 1, opening[2]).getTime() <= Date.now()) {
|
|
1308
|
+
node.dataset.opening = "";
|
|
1309
|
+
node = node.querySelector(".opening-date");
|
|
1310
|
+
node.parentNode.removeChild(node);
|
|
1402
1311
|
}
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
var plugins = [render, render3, render4, render2];
|
|
1315
|
+
function renderPlugins(node, getData) {
|
|
1316
|
+
const sec = next(node);
|
|
1317
|
+
plugins.forEach((plugin) => {
|
|
1318
|
+
const data = getData(plugin.type);
|
|
1319
|
+
if (!data) {
|
|
1320
|
+
return;
|
|
1406
1321
|
}
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
path: "/",
|
|
1411
|
-
secure: window.location.protocol === "https:",
|
|
1412
|
-
sameSite: "strict"
|
|
1413
|
-
});
|
|
1322
|
+
const el = plugin.section ? sec.querySelector(`.${plugin.type}`) : node;
|
|
1323
|
+
if (!el) {
|
|
1324
|
+
return;
|
|
1414
1325
|
}
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
}, {});
|
|
1420
|
-
nodes.forEach(({ dataset, classList }) => {
|
|
1421
|
-
const id = dataset.resort;
|
|
1422
|
-
state2[id] = classList.contains(st);
|
|
1423
|
-
});
|
|
1424
|
-
const selected = Object.keys(state2).filter((id) => state2[id]);
|
|
1425
|
-
write(selected);
|
|
1426
|
-
return selected;
|
|
1326
|
+
const show = plugin(el, data);
|
|
1327
|
+
if (typeof show === "boolean") {
|
|
1328
|
+
el.classList.toggle("visible", show);
|
|
1329
|
+
el.classList.toggle("hiddent", !show);
|
|
1427
1330
|
}
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1331
|
+
});
|
|
1332
|
+
}
|
|
1333
|
+
function render5(node, resort2) {
|
|
1334
|
+
const tsPrev = JSON.parse(node.dataset.timestamp);
|
|
1335
|
+
const tsCurr = resort2.timestamp;
|
|
1336
|
+
renderPlugins(node, (plugin) => {
|
|
1337
|
+
if (!resort2[plugin] || !tsCurr[plugin]) {
|
|
1338
|
+
return;
|
|
1432
1339
|
}
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
selected.forEach((id) => {
|
|
1436
|
-
const node = find(id);
|
|
1437
|
-
if (node) {
|
|
1438
|
-
node.classList.add(st);
|
|
1439
|
-
}
|
|
1440
|
-
});
|
|
1441
|
-
return selected;
|
|
1340
|
+
if (tsPrev[plugin] && tsCurr[plugin] <= tsPrev[plugin]) {
|
|
1341
|
+
return;
|
|
1442
1342
|
}
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1343
|
+
return resort2[plugin];
|
|
1344
|
+
});
|
|
1345
|
+
renderOpening(node, node.dataset.opening);
|
|
1346
|
+
node.dataset.timestamp = JSON.stringify(tsCurr);
|
|
1347
|
+
}
|
|
1348
|
+
var MAX = 12;
|
|
1349
|
+
function resort(node) {
|
|
1350
|
+
let updateCounter = MAX;
|
|
1351
|
+
function updateTimeToRefresh(counter) {
|
|
1352
|
+
const ttr = node.querySelector(".time-to-refresh");
|
|
1353
|
+
ttr.innerHTML = counter * 5;
|
|
1354
|
+
}
|
|
1355
|
+
function refresh(now) {
|
|
1356
|
+
const id = node.dataset.resort;
|
|
1357
|
+
if (!node.classList.contains("open")) {
|
|
1358
|
+
return;
|
|
1446
1359
|
}
|
|
1447
|
-
if (
|
|
1448
|
-
|
|
1449
|
-
|
|
1360
|
+
if (now) {
|
|
1361
|
+
updateCounter = 0;
|
|
1362
|
+
} else {
|
|
1363
|
+
updateCounter -= 1;
|
|
1450
1364
|
}
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
// lib/client/stats/index.js
|
|
1455
|
-
function stats() {
|
|
1456
|
-
const pie = document.querySelector(".stats .pie");
|
|
1457
|
-
if (!pie) {
|
|
1365
|
+
if (updateCounter > 0) {
|
|
1366
|
+
updateTimeToRefresh(updateCounter);
|
|
1458
1367
|
return;
|
|
1459
1368
|
}
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1369
|
+
updateCounter = MAX;
|
|
1370
|
+
updateTimeToRefresh(updateCounter);
|
|
1371
|
+
fetch(`/api/resort/${id}`).then((res) => res.json()).then((resort2) => render5(node, resort2));
|
|
1372
|
+
}
|
|
1373
|
+
function init3() {
|
|
1374
|
+
const ds = node.dataset;
|
|
1375
|
+
updateTimeToRefresh(MAX);
|
|
1376
|
+
renderPlugins(node, (plugin) => {
|
|
1377
|
+
const data = ds[plugin];
|
|
1378
|
+
return data && JSON.parse(data);
|
|
1379
|
+
});
|
|
1464
1380
|
}
|
|
1381
|
+
return {
|
|
1382
|
+
init: init3,
|
|
1383
|
+
refresh,
|
|
1384
|
+
node
|
|
1385
|
+
};
|
|
1386
|
+
}
|
|
1465
1387
|
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1388
|
+
// lib/client/state/index.js
|
|
1389
|
+
var import_k = __toESM(require_lib(), 1);
|
|
1390
|
+
var k = (0, import_k.default)(window);
|
|
1391
|
+
function state(nodes, st, keys) {
|
|
1392
|
+
const cookieName = `resorts-${st}`;
|
|
1393
|
+
const self = {
|
|
1394
|
+
load,
|
|
1395
|
+
save,
|
|
1396
|
+
update,
|
|
1397
|
+
read
|
|
1398
|
+
};
|
|
1399
|
+
function find(id) {
|
|
1400
|
+
return nodes.find((n) => n.dataset.resort === id);
|
|
1401
|
+
}
|
|
1402
|
+
function read() {
|
|
1403
|
+
const text = api.get(cookieName);
|
|
1404
|
+
return (text == null ? void 0 : text.length) ? text.split(",") : [];
|
|
1405
|
+
}
|
|
1406
|
+
function write(arr) {
|
|
1407
|
+
api.set(cookieName, arr.join(","), {
|
|
1408
|
+
expires: 30,
|
|
1409
|
+
path: "/",
|
|
1410
|
+
secure: window.location.protocol === "https:",
|
|
1411
|
+
sameSite: "strict"
|
|
1412
|
+
});
|
|
1413
|
+
}
|
|
1414
|
+
function update() {
|
|
1415
|
+
const state2 = read().reduce((memo, id) => {
|
|
1416
|
+
memo[id] = true;
|
|
1417
|
+
return memo;
|
|
1418
|
+
}, {});
|
|
1419
|
+
nodes.forEach(({ dataset, classList }) => {
|
|
1420
|
+
const id = dataset.resort;
|
|
1421
|
+
state2[id] = classList.contains(st);
|
|
1422
|
+
});
|
|
1423
|
+
const selected = Object.keys(state2).filter((id) => state2[id]);
|
|
1424
|
+
write(selected);
|
|
1425
|
+
return selected;
|
|
1426
|
+
}
|
|
1427
|
+
function save() {
|
|
1428
|
+
const selected = nodes.filter((n) => n.classList.contains(st)).map((n) => n.dataset.resort);
|
|
1429
|
+
write(selected);
|
|
1430
|
+
return selected;
|
|
1431
|
+
}
|
|
1432
|
+
function load() {
|
|
1433
|
+
const selected = read();
|
|
1434
|
+
selected.forEach((id) => {
|
|
1435
|
+
const node = find(id);
|
|
1436
|
+
if (node) {
|
|
1437
|
+
node.classList.add(st);
|
|
1472
1438
|
}
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
return {
|
|
1480
|
-
update
|
|
1481
|
-
};
|
|
1439
|
+
});
|
|
1440
|
+
return selected;
|
|
1441
|
+
}
|
|
1442
|
+
function all(on) {
|
|
1443
|
+
nodes.forEach((n) => n.classList.toggle(st, on));
|
|
1444
|
+
update();
|
|
1482
1445
|
}
|
|
1446
|
+
if (keys) {
|
|
1447
|
+
k(keys.on, all.bind(null, true));
|
|
1448
|
+
k(keys.off, all.bind(null, false));
|
|
1449
|
+
}
|
|
1450
|
+
return self;
|
|
1451
|
+
}
|
|
1483
1452
|
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
return;
|
|
1490
|
-
}
|
|
1491
|
-
window.parent.postMessage(
|
|
1492
|
-
{
|
|
1493
|
-
height: widget.scrollHeight,
|
|
1494
|
-
resort: window.location.pathname.split("/").pop()
|
|
1495
|
-
},
|
|
1496
|
-
"*"
|
|
1497
|
-
);
|
|
1453
|
+
// lib/client/stats/index.js
|
|
1454
|
+
function stats() {
|
|
1455
|
+
const pie = document.querySelector(".stats .pie");
|
|
1456
|
+
if (!pie) {
|
|
1457
|
+
return;
|
|
1498
1458
|
}
|
|
1499
|
-
|
|
1500
|
-
|
|
1459
|
+
const data = JSON.parse(pie.dataset.stats);
|
|
1460
|
+
let ac = 0;
|
|
1461
|
+
const { style } = pie;
|
|
1462
|
+
Object.entries(data.percentage).forEach(([key, value]) => style.setProperty(`--${key}`, `${ac += value}%`));
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
// lib/client/tag/index.js
|
|
1466
|
+
function tag(node) {
|
|
1467
|
+
let count;
|
|
1468
|
+
function update(c) {
|
|
1469
|
+
if (!count) {
|
|
1501
1470
|
return;
|
|
1502
1471
|
}
|
|
1503
|
-
|
|
1504
|
-
|
|
1472
|
+
count.innerHTML = c;
|
|
1473
|
+
node.classList.toggle("hidden", c <= 0);
|
|
1505
1474
|
}
|
|
1475
|
+
if (node) {
|
|
1476
|
+
count = node.querySelector(".count");
|
|
1477
|
+
}
|
|
1478
|
+
return {
|
|
1479
|
+
update
|
|
1480
|
+
};
|
|
1481
|
+
}
|
|
1506
1482
|
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
if (waiting) {
|
|
1514
|
-
console.log("waiting", waiting.state);
|
|
1515
|
-
}
|
|
1516
|
-
if (active) {
|
|
1517
|
-
console.log("active", active.state);
|
|
1518
|
-
}
|
|
1483
|
+
// lib/client/boot/height.js
|
|
1484
|
+
var import_debounce = __toESM(require_debounce(), 1);
|
|
1485
|
+
function notify() {
|
|
1486
|
+
const widget = document.querySelector(".widget");
|
|
1487
|
+
if (!widget) {
|
|
1488
|
+
return;
|
|
1519
1489
|
}
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1490
|
+
window.parent.postMessage(
|
|
1491
|
+
{
|
|
1492
|
+
height: widget.scrollHeight,
|
|
1493
|
+
resort: window.location.pathname.split("/").pop()
|
|
1494
|
+
},
|
|
1495
|
+
"*"
|
|
1496
|
+
);
|
|
1497
|
+
}
|
|
1498
|
+
function postHeight() {
|
|
1499
|
+
if (window === window.parent) {
|
|
1500
|
+
return;
|
|
1524
1501
|
}
|
|
1502
|
+
notify();
|
|
1503
|
+
window.addEventListener("resize", (0, import_debounce.default)(notify, 300), true);
|
|
1504
|
+
}
|
|
1525
1505
|
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
});
|
|
1535
|
-
const starred = state(rnodes, "starred");
|
|
1536
|
-
const starredTag = tag(document.querySelector(".tags .starred"));
|
|
1537
|
-
const resorts = rnodes.map((r) => resort(r));
|
|
1538
|
-
resorts.forEach((r) => {
|
|
1539
|
-
minimax(r.node, ".minimax").state("open").on((open) => {
|
|
1540
|
-
if (open) {
|
|
1541
|
-
r.refresh(true);
|
|
1542
|
-
}
|
|
1543
|
-
opens.update();
|
|
1544
|
-
});
|
|
1545
|
-
minimax(r.node, ".star").state("starred").on(() => starredTag.update(starred.update().length));
|
|
1546
|
-
r.init();
|
|
1547
|
-
});
|
|
1548
|
-
window.setInterval(() => resorts.forEach((r) => r.refresh()), 5 * 1e3);
|
|
1549
|
-
about();
|
|
1550
|
-
opens.update();
|
|
1551
|
-
starredTag.update(starred.load().length);
|
|
1552
|
-
stats();
|
|
1553
|
-
postHeight();
|
|
1506
|
+
// lib/client/boot/service-worker.js
|
|
1507
|
+
function registrationHandler({ scope, installing, waiting, active }) {
|
|
1508
|
+
console.log("SW", scope);
|
|
1509
|
+
if (installing) {
|
|
1510
|
+
console.log("installing", installing.state);
|
|
1511
|
+
}
|
|
1512
|
+
if (waiting) {
|
|
1513
|
+
console.log("waiting", waiting.state);
|
|
1554
1514
|
}
|
|
1555
|
-
|
|
1515
|
+
if (active) {
|
|
1516
|
+
console.log("active", active.state);
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
function register(url = "/sw.js") {
|
|
1520
|
+
if (navigator.serviceWorker && document.documentElement.hasAttribute("data-service-worker")) {
|
|
1521
|
+
return navigator.serviceWorker.register(url).then(registrationHandler).catch((reason) => console.log("SW registration failed!", reason));
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
// lib/client/boot/index.js
|
|
1526
|
+
register();
|
|
1527
|
+
init2();
|
|
1528
|
+
function init2() {
|
|
1529
|
+
const rnodes = Array.from(document.querySelectorAll(".resort"));
|
|
1530
|
+
const opens = state(rnodes, "open", {
|
|
1531
|
+
on: "shift + o",
|
|
1532
|
+
off: "shift + x"
|
|
1533
|
+
});
|
|
1534
|
+
const starred = state(rnodes, "starred");
|
|
1535
|
+
const starredTag = tag(document.querySelector(".tags .starred"));
|
|
1536
|
+
const resorts = rnodes.map((r) => resort(r));
|
|
1537
|
+
resorts.forEach((r) => {
|
|
1538
|
+
minimax(r.node, ".minimax").state("open").on((open) => {
|
|
1539
|
+
if (open) {
|
|
1540
|
+
r.refresh(true);
|
|
1541
|
+
}
|
|
1542
|
+
opens.update();
|
|
1543
|
+
});
|
|
1544
|
+
minimax(r.node, ".star").state("starred").on(() => starredTag.update(starred.update().length));
|
|
1545
|
+
r.init();
|
|
1546
|
+
});
|
|
1547
|
+
window.setInterval(() => resorts.forEach((r) => r.refresh()), 5 * 1e3);
|
|
1548
|
+
about();
|
|
1549
|
+
opens.update();
|
|
1550
|
+
starredTag.update(starred.load().length);
|
|
1551
|
+
stats();
|
|
1552
|
+
postHeight();
|
|
1553
|
+
}
|
|
1556
1554
|
/*! Bundled license information:
|
|
1557
1555
|
|
|
1558
1556
|
js-cookie/dist/js.cookie.mjs:
|