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