mol_plot_all 1.2.1490 → 1.2.1492

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/node.mjs CHANGED
@@ -2356,245 +2356,6 @@ var $;
2356
2356
 
2357
2357
  ;
2358
2358
  "use strict";
2359
- var $;
2360
- (function ($) {
2361
- $.$mol_theme = $mol_style_prop('mol_theme', [
2362
- 'back',
2363
- 'hover',
2364
- 'card',
2365
- 'current',
2366
- 'special',
2367
- 'text',
2368
- 'control',
2369
- 'shade',
2370
- 'line',
2371
- 'focus',
2372
- 'field',
2373
- 'image',
2374
- 'spirit',
2375
- ]);
2376
- })($ || ($ = {}));
2377
-
2378
- ;
2379
- "use strict";
2380
- var $;
2381
- (function ($) {
2382
- $mol_style_attach("mol/theme/theme.css", ":root {\n\t--mol_theme_hue: 240deg;\n\t--mol_theme_hue_spread: 90deg;\n\tcolor-scheme: dark light;\n}\n\n:where([mol_theme]) {\n\tcolor: var(--mol_theme_text);\n\tfill: var(--mol_theme_text);\n\tbackground-color: var(--mol_theme_back);\n}\n\t\n:root, [mol_theme=\"$mol_theme_dark\"], :where([mol_theme=\"$mol_theme_dark\"]) [mol_theme] {\n\n\t--mol_theme_luma: -1;\n\t--mol_theme_image: invert(1) hue-rotate( 180deg );\n\t--mol_theme_spirit: hsl( 0deg, 0%, 0%, .75 );\n\n\t--mol_theme_back: hsl( var(--mol_theme_hue), 20%, 10% );\n\t--mol_theme_card: hsl( var(--mol_theme_hue), 50%, 20%, .25 );\n\t--mol_theme_field: hsl( var(--mol_theme_hue), 50%, 8%, .25 );\n\t--mol_theme_hover: hsl( var(--mol_theme_hue), 0%, 50%, .1 );\n\t\n\t--mol_theme_text: hsl( var(--mol_theme_hue), 0%, 80% );\n\t--mol_theme_shade: hsl( var(--mol_theme_hue), 0%, 60%, 1 );\n\t--mol_theme_line: hsl( var(--mol_theme_hue), 0%, 50%, .25 );\n\t--mol_theme_focus: hsl( calc( var(--mol_theme_hue) + 180deg ), 100%, 65% );\n\t\n\t--mol_theme_control: hsl( var(--mol_theme_hue), 60%, 65% );\n\t--mol_theme_current: hsl( calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ), 60%, 65% );\n\t--mol_theme_special: hsl( calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ), 60%, 65% );\n\n} @supports( color: oklch( 0% 0 0deg ) ) {\n:root, [mol_theme=\"$mol_theme_dark\"], :where([mol_theme=\"$mol_theme_dark\"]) [mol_theme] {\n\t\n\t--mol_theme_back: oklch( 20% .03 var(--mol_theme_hue) );\n\t--mol_theme_card: oklch( 30% .05 var(--mol_theme_hue) / .25 );\n\t--mol_theme_field: oklch( 15% 0 var(--mol_theme_hue) / .25 );\n\t--mol_theme_hover: oklch( 70% 0 var(--mol_theme_hue) / .1 );\n\t\n\t--mol_theme_text: oklch( 80% 0 var(--mol_theme_hue) );\n\t--mol_theme_shade: oklch( 60% 0 var(--mol_theme_hue) );\n\t--mol_theme_line: oklch( 60% 0 var(--mol_theme_hue) / .25 );\n\t--mol_theme_focus: oklch( 80% .2 calc( var(--mol_theme_hue) + 180deg ) );\n\t\n\t--mol_theme_control: oklch( 70% .1 var(--mol_theme_hue) );\n\t--mol_theme_current: oklch( 70% .2 calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ) );\n\t--mol_theme_special: oklch( 70% .2 calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ) );\n\n} }\n\n[mol_theme=\"$mol_theme_light\"], :where([mol_theme=\"$mol_theme_light\"]) [mol_theme] {\n\t\n\t--mol_theme_luma: 1;\n\t--mol_theme_image: none;\n\t--mol_theme_spirit: hsl( 0deg, 0%, 100%, .75 );\n\t\n\t--mol_theme_back: hsl( var(--mol_theme_hue), 20%, 92% );\n\t--mol_theme_card: hsl( var(--mol_theme_hue), 50%, 100%, .5 );\n\t--mol_theme_field: hsl( var(--mol_theme_hue), 50%, 100%, .75 );\n\t--mol_theme_hover: hsl( var(--mol_theme_hue), 0%, 50%, .1 );\n\t\n\t--mol_theme_text: hsl( var(--mol_theme_hue), 0%, 0% );\n\t--mol_theme_shade: hsl( var(--mol_theme_hue), 0%, 40%, 1 );\n\t--mol_theme_line: hsl( var(--mol_theme_hue), 0%, 50%, .25 );\n\t--mol_theme_focus: hsl( calc( var(--mol_theme_hue) + 180deg ), 100%, 40% );\n\t\n\t--mol_theme_control: hsl( var(--mol_theme_hue), 80%, 30% );\n\t--mol_theme_current: hsl( calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ), 80%, 30% );\n\t--mol_theme_special: hsl( calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ), 80%, 30% );\n\n} @supports( color: oklch( 0% 0 0deg ) ) {\n[mol_theme=\"$mol_theme_light\"], :where([mol_theme=\"$mol_theme_light\"]) [mol_theme] {\n\t--mol_theme_back: oklch( 92% .01 var(--mol_theme_hue) );\n\t--mol_theme_card: oklch( 99% .01 var(--mol_theme_hue) / .5 );\n\t--mol_theme_field: oklch( 100% 0 var(--mol_theme_hue) / .5 );\n\t--mol_theme_hover: oklch( 70% 0 var(--mol_theme_hue) / .1 );\n\t\n\t--mol_theme_text: oklch( 20% 0 var(--mol_theme_hue) );\n\t--mol_theme_shade: oklch( 60% 0 var(--mol_theme_hue) );\n\t--mol_theme_line: oklch( 50% 0 var(--mol_theme_hue) / .25 );\n\t--mol_theme_focus: oklch( 60% .2 calc( var(--mol_theme_hue) + 180deg ) );\n\t\n\t--mol_theme_control: oklch( 40% .15 var(--mol_theme_hue) );\n\t--mol_theme_current: oklch( 50% .2 calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ) );\n\t--mol_theme_special: oklch( 50% .2 calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ) );\n\n} }\n\n:where( :root, [mol_theme=\"$mol_theme_dark\"] ) [mol_theme=\"$mol_theme_base\"] {\n\t--mol_theme_back: oklch( 25% .075 var(--mol_theme_hue) );\n\t--mol_theme_card: oklch( 35% .1 var(--mol_theme_hue) / .25 );\n}\n:where( [mol_theme=\"$mol_theme_light\"] ) [mol_theme=\"$mol_theme_base\"] {\n\t--mol_theme_back: oklch( 85% .075 var(--mol_theme_hue) );\n\t--mol_theme_card: oklch( 98% .03 var(--mol_theme_hue) / .25 );\n}\n\n:where( :root, [mol_theme=\"$mol_theme_dark\"] ) [mol_theme=\"$mol_theme_current\"] {\n\t--mol_theme_back: oklch( 25% .05 calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ) );\n\t--mol_theme_card: oklch( 35% .1 calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ) / .25 );\n}\n:where( [mol_theme=\"$mol_theme_light\"] ) [mol_theme=\"$mol_theme_current\"] {\n\t--mol_theme_back: oklch( 85% .05 calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ) );\n\t--mol_theme_card: oklch( 98% .03 calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ) / .25 );\n}\n\n:where( :root, [mol_theme=\"$mol_theme_dark\"] ) [mol_theme=\"$mol_theme_special\"] {\n\t--mol_theme_back: oklch( 25% .05 calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ) );\n\t--mol_theme_card: oklch( 35% .1 calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ) / .25 );\n}\n:where( [mol_theme=\"$mol_theme_light\"] ) [mol_theme=\"$mol_theme_special\"] {\n\t--mol_theme_back: oklch( 85% .05 calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ) );\n\t--mol_theme_card: oklch( 98% .03 calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ) / .25 );\n}\n\n:where( :root, [mol_theme=\"$mol_theme_dark\"] ) [mol_theme=\"$mol_theme_accent\"] {\n\t--mol_theme_back: oklch( 35% .1 calc( var(--mol_theme_hue) + 180deg ) );\n\t--mol_theme_card: oklch( 45% .15 calc( var(--mol_theme_hue) + 180deg ) / .25 );\n}\n:where( [mol_theme=\"$mol_theme_light\"] ) [mol_theme=\"$mol_theme_accent\"] {\n\t--mol_theme_back: oklch( 83% .1 calc( var(--mol_theme_hue) + 180deg ) );\n\t--mol_theme_card: oklch( 98% .03 calc( var(--mol_theme_hue) + 180deg ) / .25 );\n}\n\n");
2383
- })($ || ($ = {}));
2384
-
2385
- ;
2386
- "use strict";
2387
- var $;
2388
- (function ($) {
2389
- $.$mol_gap = $mol_style_prop('mol_gap', [
2390
- 'block',
2391
- 'text',
2392
- 'round',
2393
- 'space',
2394
- 'blur',
2395
- ]);
2396
- })($ || ($ = {}));
2397
-
2398
- ;
2399
- "use strict";
2400
- var $;
2401
- (function ($) {
2402
- $mol_style_attach("mol/gap/gap.css", ":root {\n\t--mol_gap_block: .75rem;\n\t--mol_gap_text: .5rem .75rem;\n\t--mol_gap_round: .25rem;\n\t--mol_gap_space: .25rem;\n\t--mol_gap_blur: .5rem;\n}\n");
2403
- })($ || ($ = {}));
2404
-
2405
- ;
2406
- "use strict";
2407
- var $;
2408
- (function ($) {
2409
- function $mol_dom_render_children(el, childNodes) {
2410
- const node_set = new Set(childNodes);
2411
- let nextNode = el.firstChild;
2412
- for (let view of childNodes) {
2413
- if (view == null)
2414
- continue;
2415
- if (view instanceof $mol_dom_context.Node) {
2416
- while (true) {
2417
- if (!nextNode) {
2418
- el.appendChild(view);
2419
- break;
2420
- }
2421
- if (nextNode == view) {
2422
- nextNode = nextNode.nextSibling;
2423
- break;
2424
- }
2425
- else {
2426
- if (node_set.has(nextNode)) {
2427
- el.insertBefore(view, nextNode);
2428
- break;
2429
- }
2430
- else {
2431
- const nn = nextNode.nextSibling;
2432
- el.removeChild(nextNode);
2433
- nextNode = nn;
2434
- }
2435
- }
2436
- }
2437
- }
2438
- else {
2439
- if (nextNode && nextNode.nodeName === '#text') {
2440
- const str = String(view);
2441
- if (nextNode.nodeValue !== str)
2442
- nextNode.nodeValue = str;
2443
- nextNode = nextNode.nextSibling;
2444
- }
2445
- else {
2446
- const textNode = $mol_dom_context.document.createTextNode(String(view));
2447
- el.insertBefore(textNode, nextNode);
2448
- }
2449
- }
2450
- }
2451
- while (nextNode) {
2452
- const currNode = nextNode;
2453
- nextNode = currNode.nextSibling;
2454
- el.removeChild(currNode);
2455
- }
2456
- }
2457
- $.$mol_dom_render_children = $mol_dom_render_children;
2458
- })($ || ($ = {}));
2459
-
2460
- ;
2461
- "use strict";
2462
-
2463
- ;
2464
- "use strict";
2465
- var $;
2466
- (function ($) {
2467
- $.$mol_jsx_prefix = '';
2468
- $.$mol_jsx_crumbs = '';
2469
- $.$mol_jsx_booked = null;
2470
- $.$mol_jsx_document = {
2471
- getElementById: () => null,
2472
- createElementNS: (space, name) => $mol_dom_context.document.createElementNS(space, name),
2473
- createDocumentFragment: () => $mol_dom_context.document.createDocumentFragment(),
2474
- };
2475
- $.$mol_jsx_frag = '';
2476
- function $mol_jsx(Elem, props, ...childNodes) {
2477
- const id = props && props.id || '';
2478
- const guid = id ? $.$mol_jsx_prefix ? $.$mol_jsx_prefix + '/' + id : id : $.$mol_jsx_prefix;
2479
- const crumbs_self = id ? $.$mol_jsx_crumbs.replace(/(\S+)/g, `$1_${id.replace(/\/.*/i, '')}`) : $.$mol_jsx_crumbs;
2480
- if (Elem && $.$mol_jsx_booked) {
2481
- if ($.$mol_jsx_booked.has(id)) {
2482
- $mol_fail(new Error(`JSX already has tag with id ${JSON.stringify(guid)}`));
2483
- }
2484
- else {
2485
- $.$mol_jsx_booked.add(id);
2486
- }
2487
- }
2488
- let node = guid ? $.$mol_jsx_document.getElementById(guid) : null;
2489
- if ($.$mol_jsx_prefix) {
2490
- const prefix_ext = $.$mol_jsx_prefix;
2491
- const booked_ext = $.$mol_jsx_booked;
2492
- const crumbs_ext = $.$mol_jsx_crumbs;
2493
- for (const field in props) {
2494
- const func = props[field];
2495
- if (typeof func !== 'function')
2496
- continue;
2497
- const wrapper = function (...args) {
2498
- const prefix = $.$mol_jsx_prefix;
2499
- const booked = $.$mol_jsx_booked;
2500
- const crumbs = $.$mol_jsx_crumbs;
2501
- try {
2502
- $.$mol_jsx_prefix = prefix_ext;
2503
- $.$mol_jsx_booked = booked_ext;
2504
- $.$mol_jsx_crumbs = crumbs_ext;
2505
- return func.call(this, ...args);
2506
- }
2507
- finally {
2508
- $.$mol_jsx_prefix = prefix;
2509
- $.$mol_jsx_booked = booked;
2510
- $.$mol_jsx_crumbs = crumbs;
2511
- }
2512
- };
2513
- $mol_func_name_from(wrapper, func);
2514
- props[field] = wrapper;
2515
- }
2516
- }
2517
- if (typeof Elem !== 'string') {
2518
- if ('prototype' in Elem) {
2519
- const view = node && node[String(Elem)] || new Elem;
2520
- Object.assign(view, props);
2521
- view[Symbol.toStringTag] = guid;
2522
- view.childNodes = childNodes;
2523
- if (!view.ownerDocument)
2524
- view.ownerDocument = $.$mol_jsx_document;
2525
- view.className = (crumbs_self ? crumbs_self + ' ' : '') + (Elem['name'] || Elem);
2526
- node = view.valueOf();
2527
- node[String(Elem)] = view;
2528
- return node;
2529
- }
2530
- else {
2531
- const prefix = $.$mol_jsx_prefix;
2532
- const booked = $.$mol_jsx_booked;
2533
- const crumbs = $.$mol_jsx_crumbs;
2534
- try {
2535
- $.$mol_jsx_prefix = guid;
2536
- $.$mol_jsx_booked = new Set;
2537
- $.$mol_jsx_crumbs = (crumbs_self ? crumbs_self + ' ' : '') + (Elem['name'] || Elem);
2538
- return Elem(props, ...childNodes);
2539
- }
2540
- finally {
2541
- $.$mol_jsx_prefix = prefix;
2542
- $.$mol_jsx_booked = booked;
2543
- $.$mol_jsx_crumbs = crumbs;
2544
- }
2545
- }
2546
- }
2547
- if (!node) {
2548
- node = Elem
2549
- ? $.$mol_jsx_document.createElementNS(props?.xmlns ?? 'http://www.w3.org/1999/xhtml', Elem)
2550
- : $.$mol_jsx_document.createDocumentFragment();
2551
- }
2552
- $mol_dom_render_children(node, [].concat(...childNodes));
2553
- if (!Elem)
2554
- return node;
2555
- if (guid)
2556
- node.id = guid;
2557
- for (const key in props) {
2558
- if (key === 'id')
2559
- continue;
2560
- if (typeof props[key] === 'string') {
2561
- if (typeof node[key] === 'string')
2562
- node[key] = props[key];
2563
- node.setAttribute(key, props[key]);
2564
- }
2565
- else if (props[key] &&
2566
- typeof props[key] === 'object' &&
2567
- Reflect.getPrototypeOf(props[key]) === Reflect.getPrototypeOf({})) {
2568
- if (typeof node[key] === 'object') {
2569
- Object.assign(node[key], props[key]);
2570
- continue;
2571
- }
2572
- }
2573
- else {
2574
- node[key] = props[key];
2575
- }
2576
- }
2577
- if ($.$mol_jsx_crumbs)
2578
- node.className = (props?.['class'] ? props['class'] + ' ' : '') + crumbs_self;
2579
- return node;
2580
- }
2581
- $.$mol_jsx = $mol_jsx;
2582
- })($ || ($ = {}));
2583
-
2584
- ;
2585
- "use strict";
2586
- var $;
2587
- (function ($) {
2588
- class $mol_window extends $mol_object {
2589
- static size() {
2590
- return {
2591
- width: 1024,
2592
- height: 768,
2593
- };
2594
- }
2595
- }
2596
- $.$mol_window = $mol_window;
2597
- })($ || ($ = {}));
2598
2359
 
2599
2360
  ;
2600
2361
  "use strict";
@@ -2863,62 +2624,1385 @@ var $;
2863
2624
  return atom.sync();
2864
2625
  }
2865
2626
  }
2866
- return atom.resync(args);
2627
+ return atom.resync(args);
2628
+ }
2629
+ };
2630
+ Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
2631
+ Reflect.defineProperty(descr2.value, 'length', { value: orig.length });
2632
+ Object.assign(descr2.value, { orig });
2633
+ Reflect.defineProperty(host, field, descr2);
2634
+ return descr2;
2635
+ }
2636
+ $.$mol_wire_solo = $mol_wire_solo;
2637
+ })($ || ($ = {}));
2638
+
2639
+ ;
2640
+ "use strict";
2641
+ var $;
2642
+ (function ($) {
2643
+ function $mol_wire_plex(host, field, descr) {
2644
+ if (!descr)
2645
+ descr = Reflect.getOwnPropertyDescriptor(host, field);
2646
+ const orig = descr?.value ?? host[field];
2647
+ const sup = Reflect.getPrototypeOf(host);
2648
+ if (typeof sup[field] === 'function') {
2649
+ Object.defineProperty(orig, 'name', { value: sup[field].name });
2650
+ }
2651
+ const descr2 = {
2652
+ ...descr,
2653
+ value: function (...args) {
2654
+ let atom = $mol_wire_atom.plex(this, orig, args[0]);
2655
+ if ((args.length === 1) || (args[1] === undefined)) {
2656
+ if (!$mol_wire_fiber.warm)
2657
+ return atom.result();
2658
+ if ($mol_wire_auto()?.temp) {
2659
+ return atom.once();
2660
+ }
2661
+ else {
2662
+ return atom.sync();
2663
+ }
2664
+ }
2665
+ return atom.resync(args);
2666
+ }
2667
+ };
2668
+ Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
2669
+ Reflect.defineProperty(descr2.value, 'length', { value: orig.length });
2670
+ Object.assign(descr2.value, { orig });
2671
+ Reflect.defineProperty(host, field, descr2);
2672
+ return descr2;
2673
+ }
2674
+ $.$mol_wire_plex = $mol_wire_plex;
2675
+ })($ || ($ = {}));
2676
+
2677
+ ;
2678
+ "use strict";
2679
+ var $;
2680
+ (function ($) {
2681
+ $.$mol_mem = $mol_wire_solo;
2682
+ $.$mol_mem_key = $mol_wire_plex;
2683
+ })($ || ($ = {}));
2684
+
2685
+ ;
2686
+ "use strict";
2687
+ var $;
2688
+ (function ($) {
2689
+ $.$mol_action = $mol_wire_method;
2690
+ })($ || ($ = {}));
2691
+
2692
+ ;
2693
+ "use strict";
2694
+ var $;
2695
+ (function ($) {
2696
+ class $mol_state_arg extends $mol_object {
2697
+ prefix;
2698
+ static prolog = '';
2699
+ static separator = ' ';
2700
+ static href(next) {
2701
+ return next || process.argv.slice(2).join(' ');
2702
+ }
2703
+ static href_normal() {
2704
+ return this.link({});
2705
+ }
2706
+ static dict(next) {
2707
+ if (next !== void 0)
2708
+ this.href(this.make_link(next));
2709
+ var href = this.href();
2710
+ var chunks = href.split(' ');
2711
+ var params = {};
2712
+ chunks.forEach(chunk => {
2713
+ if (!chunk)
2714
+ return;
2715
+ var vals = chunk.split('=').map(decodeURIComponent);
2716
+ params[vals.shift()] = vals.join('=');
2717
+ });
2718
+ return params;
2719
+ }
2720
+ static value(key, next) {
2721
+ if (next === void 0)
2722
+ return this.dict()[key] ?? null;
2723
+ this.href(this.link({ [key]: next }));
2724
+ return next;
2725
+ }
2726
+ static link(next) {
2727
+ const params = {};
2728
+ var prev = this.dict();
2729
+ for (var key in prev) {
2730
+ params[key] = prev[key];
2731
+ }
2732
+ for (var key in next) {
2733
+ params[key] = next[key];
2734
+ }
2735
+ return this.make_link(params);
2736
+ }
2737
+ static make_link(next) {
2738
+ const chunks = [];
2739
+ for (const key in next) {
2740
+ if (next[key] !== null) {
2741
+ chunks.push([key, next[key]].map(encodeURIComponent).join('='));
2742
+ }
2743
+ }
2744
+ return chunks.join(' ');
2745
+ }
2746
+ static go(next) {
2747
+ this.href(this.link(next));
2748
+ }
2749
+ static commit() { }
2750
+ constructor(prefix = '') {
2751
+ super();
2752
+ this.prefix = prefix;
2753
+ }
2754
+ value(key, next) {
2755
+ return this.constructor.value(this.prefix + key, next);
2756
+ }
2757
+ sub(postfix) {
2758
+ return new this.constructor(this.prefix + postfix + '.');
2759
+ }
2760
+ link(next) {
2761
+ const prefix = this.prefix;
2762
+ const dict = {};
2763
+ for (var key in next) {
2764
+ dict[prefix + key] = next[key];
2765
+ }
2766
+ return this.constructor.link(dict);
2767
+ }
2768
+ }
2769
+ __decorate([
2770
+ $mol_mem
2771
+ ], $mol_state_arg, "href", null);
2772
+ __decorate([
2773
+ $mol_mem
2774
+ ], $mol_state_arg, "href_normal", null);
2775
+ __decorate([
2776
+ $mol_mem
2777
+ ], $mol_state_arg, "dict", null);
2778
+ __decorate([
2779
+ $mol_mem_key
2780
+ ], $mol_state_arg, "value", null);
2781
+ __decorate([
2782
+ $mol_action
2783
+ ], $mol_state_arg, "go", null);
2784
+ $.$mol_state_arg = $mol_state_arg;
2785
+ })($ || ($ = {}));
2786
+
2787
+ ;
2788
+ "use strict";
2789
+ var $;
2790
+ (function ($) {
2791
+ class $mol_media extends $mol_object2 {
2792
+ static match(query, next) {
2793
+ if (next !== undefined)
2794
+ return next;
2795
+ const res = this.$.$mol_dom_context.matchMedia?.(query) ?? {};
2796
+ res.onchange = () => this.match(query, res.matches);
2797
+ return res.matches;
2798
+ }
2799
+ }
2800
+ __decorate([
2801
+ $mol_mem_key
2802
+ ], $mol_media, "match", null);
2803
+ $.$mol_media = $mol_media;
2804
+ })($ || ($ = {}));
2805
+
2806
+ ;
2807
+ "use strict";
2808
+ var $;
2809
+ (function ($) {
2810
+ function $mol_wire_solid() {
2811
+ let current = $mol_wire_auto();
2812
+ if (current.temp)
2813
+ current = current.host;
2814
+ if (current.reap !== nothing) {
2815
+ current?.sub_on(sub, sub.data.length);
2816
+ }
2817
+ current.reap = nothing;
2818
+ }
2819
+ $.$mol_wire_solid = $mol_wire_solid;
2820
+ const nothing = () => { };
2821
+ const sub = new $mol_wire_pub_sub;
2822
+ })($ || ($ = {}));
2823
+
2824
+ ;
2825
+ "use strict";
2826
+ var $;
2827
+ (function ($) {
2828
+ $.$mol_mem_persist = $mol_wire_solid;
2829
+ })($ || ($ = {}));
2830
+
2831
+ ;
2832
+ "use strict";
2833
+ var $;
2834
+ (function ($) {
2835
+ function $mol_wire_probe(task, def) {
2836
+ const warm = $mol_wire_fiber.warm;
2837
+ try {
2838
+ $mol_wire_fiber.warm = false;
2839
+ const res = task();
2840
+ if (res === undefined)
2841
+ return def;
2842
+ return res;
2843
+ }
2844
+ finally {
2845
+ $mol_wire_fiber.warm = warm;
2846
+ }
2847
+ }
2848
+ $.$mol_wire_probe = $mol_wire_probe;
2849
+ })($ || ($ = {}));
2850
+
2851
+ ;
2852
+ "use strict";
2853
+ var $;
2854
+ (function ($) {
2855
+ $.$mol_mem_cached = $mol_wire_probe;
2856
+ })($ || ($ = {}));
2857
+
2858
+ ;
2859
+ "use strict";
2860
+ var $;
2861
+ (function ($) {
2862
+ class $mol_storage extends $mol_object2 {
2863
+ static native() {
2864
+ return this.$.$mol_dom_context.navigator.storage ?? {
2865
+ persisted: async () => false,
2866
+ persist: async () => false,
2867
+ estimate: async () => ({}),
2868
+ getDirectory: async () => null,
2869
+ };
2870
+ }
2871
+ static persisted(next, cache) {
2872
+ $mol_mem_persist();
2873
+ if (cache)
2874
+ return Boolean(next);
2875
+ const native = this.native();
2876
+ if (next && !$mol_mem_cached(() => this.persisted())) {
2877
+ native.persist().then(actual => {
2878
+ setTimeout(() => this.persisted(actual, 'cache'), 5000);
2879
+ if (actual)
2880
+ this.$.$mol_log3_done({ place: `$mol_storage`, message: `Persist: Yes` });
2881
+ else
2882
+ this.$.$mol_log3_fail({ place: `$mol_storage`, message: `Persist: No` });
2883
+ });
2884
+ }
2885
+ return next ?? $mol_wire_sync(native).persisted();
2886
+ }
2887
+ static estimate() {
2888
+ return $mol_wire_sync(this.native() ?? {}).estimate();
2889
+ }
2890
+ static dir() {
2891
+ return $mol_wire_sync(this.native()).getDirectory();
2892
+ }
2893
+ }
2894
+ __decorate([
2895
+ $mol_mem
2896
+ ], $mol_storage, "native", null);
2897
+ __decorate([
2898
+ $mol_mem
2899
+ ], $mol_storage, "persisted", null);
2900
+ $.$mol_storage = $mol_storage;
2901
+ })($ || ($ = {}));
2902
+
2903
+ ;
2904
+ "use strict";
2905
+ var $;
2906
+ (function ($) {
2907
+ class $mol_state_local extends $mol_object {
2908
+ static 'native()';
2909
+ static native() {
2910
+ if (this['native()'])
2911
+ return this['native()'];
2912
+ check: try {
2913
+ const native = $mol_dom_context.localStorage;
2914
+ if (!native)
2915
+ break check;
2916
+ native.setItem('', '');
2917
+ native.removeItem('');
2918
+ return this['native()'] = native;
2919
+ }
2920
+ catch (error) {
2921
+ console.warn(error);
2922
+ }
2923
+ return this['native()'] = {
2924
+ getItem(key) {
2925
+ return this[':' + key];
2926
+ },
2927
+ setItem(key, value) {
2928
+ this[':' + key] = value;
2929
+ },
2930
+ removeItem(key) {
2931
+ this[':' + key] = void 0;
2932
+ }
2933
+ };
2934
+ }
2935
+ static changes(next) { return next; }
2936
+ static value(key, next) {
2937
+ this.changes();
2938
+ if (next === void 0)
2939
+ return JSON.parse(this.native().getItem(key) || 'null');
2940
+ if (next === null) {
2941
+ this.native().removeItem(key);
2942
+ }
2943
+ else {
2944
+ this.native().setItem(key, JSON.stringify(next));
2945
+ this.$.$mol_storage.persisted(true);
2946
+ }
2947
+ return next;
2948
+ }
2949
+ prefix() { return ''; }
2950
+ value(key, next) {
2951
+ return $mol_state_local.value(this.prefix() + '.' + key, next);
2952
+ }
2953
+ }
2954
+ __decorate([
2955
+ $mol_mem
2956
+ ], $mol_state_local, "changes", null);
2957
+ __decorate([
2958
+ $mol_mem_key
2959
+ ], $mol_state_local, "value", null);
2960
+ $.$mol_state_local = $mol_state_local;
2961
+ })($ || ($ = {}));
2962
+
2963
+ ;
2964
+ "use strict";
2965
+ var $;
2966
+ (function ($) {
2967
+ function $mol_const(value) {
2968
+ const getter = (() => value);
2969
+ getter['()'] = value;
2970
+ getter[Symbol.toStringTag] = value;
2971
+ getter[$mol_dev_format_head] = () => $mol_dev_format_span({}, '()=> ', $mol_dev_format_auto(value));
2972
+ return getter;
2973
+ }
2974
+ $.$mol_const = $mol_const;
2975
+ })($ || ($ = {}));
2976
+
2977
+ ;
2978
+ "use strict";
2979
+ var $;
2980
+ (function ($) {
2981
+ function $mol_wire_async(obj) {
2982
+ let fiber;
2983
+ const temp = $mol_wire_task.getter(obj);
2984
+ return new Proxy(obj, {
2985
+ get(obj, field) {
2986
+ const val = obj[field];
2987
+ if (typeof val !== 'function')
2988
+ return val;
2989
+ let fiber;
2990
+ const temp = $mol_wire_task.getter(val);
2991
+ return function $mol_wire_async(...args) {
2992
+ fiber?.destructor();
2993
+ fiber = temp(obj, args);
2994
+ return fiber.async();
2995
+ };
2996
+ },
2997
+ apply(obj, self, args) {
2998
+ fiber?.destructor();
2999
+ fiber = temp(self, args);
3000
+ return fiber.async();
3001
+ },
3002
+ });
3003
+ }
3004
+ $.$mol_wire_async = $mol_wire_async;
3005
+ })($ || ($ = {}));
3006
+
3007
+ ;
3008
+ "use strict";
3009
+ var $;
3010
+ (function ($) {
3011
+ class $mol_lock extends $mol_object {
3012
+ promise = null;
3013
+ async wait() {
3014
+ let next = () => { };
3015
+ let destructed = false;
3016
+ const task = $mol_wire_auto();
3017
+ if (!task)
3018
+ return next;
3019
+ const destructor = task.destructor.bind(task);
3020
+ task.destructor = () => {
3021
+ destructor();
3022
+ destructed = true;
3023
+ next();
3024
+ };
3025
+ let promise;
3026
+ do {
3027
+ promise = this.promise;
3028
+ await promise;
3029
+ if (destructed)
3030
+ return next;
3031
+ } while (promise !== this.promise);
3032
+ this.promise = new Promise(done => { next = done; });
3033
+ return next;
3034
+ }
3035
+ grab() { return $mol_wire_sync(this).wait(); }
3036
+ }
3037
+ $.$mol_lock = $mol_lock;
3038
+ })($ || ($ = {}));
3039
+
3040
+ ;
3041
+ "use strict";
3042
+ var $;
3043
+ (function ($) {
3044
+ function $mol_compare_array(a, b) {
3045
+ if (a === b)
3046
+ return true;
3047
+ if (Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
3048
+ return false;
3049
+ if (a.length !== b.length)
3050
+ return false;
3051
+ for (let i = 0; i < a.length; i++)
3052
+ if (a[i] !== b[i])
3053
+ return false;
3054
+ return true;
3055
+ }
3056
+ $.$mol_compare_array = $mol_compare_array;
3057
+ })($ || ($ = {}));
3058
+
3059
+ ;
3060
+ "use strict";
3061
+
3062
+ ;
3063
+ "use strict";
3064
+ var $;
3065
+ (function ($) {
3066
+ const decoders = {};
3067
+ function $mol_charset_decode(buffer, encoding = 'utf8') {
3068
+ let decoder = decoders[encoding];
3069
+ if (!decoder)
3070
+ decoder = decoders[encoding] = new TextDecoder(encoding);
3071
+ return decoder.decode(buffer);
3072
+ }
3073
+ $.$mol_charset_decode = $mol_charset_decode;
3074
+ })($ || ($ = {}));
3075
+
3076
+ ;
3077
+ "use strict";
3078
+ var $;
3079
+ (function ($) {
3080
+ const TextEncoder = globalThis.TextEncoder ?? $node.util.TextEncoder;
3081
+ const encoder = new TextEncoder();
3082
+ function $mol_charset_encode(value) {
3083
+ return encoder.encode(value);
3084
+ }
3085
+ $.$mol_charset_encode = $mol_charset_encode;
3086
+ })($ || ($ = {}));
3087
+
3088
+ ;
3089
+ "use strict";
3090
+ var $;
3091
+ (function ($) {
3092
+ class $mol_file_transaction extends $mol_object {
3093
+ path() { return ''; }
3094
+ modes() { return []; }
3095
+ write(options) {
3096
+ return 0;
3097
+ }
3098
+ read() {
3099
+ return new Uint8Array();
3100
+ }
3101
+ truncate(size) { }
3102
+ close() { }
3103
+ destructor() {
3104
+ this.close();
3105
+ }
3106
+ }
3107
+ $.$mol_file_transaction = $mol_file_transaction;
3108
+ })($ || ($ = {}));
3109
+
3110
+ ;
3111
+ "use strict";
3112
+ var $;
3113
+ (function ($) {
3114
+ let file_modes;
3115
+ (function (file_modes) {
3116
+ file_modes[file_modes["create"] = $node.fs.constants.O_CREAT] = "create";
3117
+ file_modes[file_modes["exists_truncate"] = $node.fs.constants.O_TRUNC] = "exists_truncate";
3118
+ file_modes[file_modes["exists_fail"] = $node.fs.constants.O_EXCL] = "exists_fail";
3119
+ file_modes[file_modes["read_only"] = $node.fs.constants.O_RDONLY] = "read_only";
3120
+ file_modes[file_modes["write_only"] = $node.fs.constants.O_WRONLY] = "write_only";
3121
+ file_modes[file_modes["read_write"] = $node.fs.constants.O_RDWR] = "read_write";
3122
+ file_modes[file_modes["append"] = $node.fs.constants.O_APPEND] = "append";
3123
+ })(file_modes || (file_modes = {}));
3124
+ function mode_mask(modes) {
3125
+ return modes.reduce((res, mode) => res | file_modes[mode], 0);
3126
+ }
3127
+ class $mol_file_transaction_node extends $mol_file_transaction {
3128
+ descr() {
3129
+ $mol_wire_solid();
3130
+ return $node.fs.openSync(this.path(), mode_mask(this.modes()));
3131
+ }
3132
+ write({ buffer, offset = 0, length, position = null }) {
3133
+ if (Array.isArray(buffer)) {
3134
+ return $node.fs.writevSync(this.descr(), buffer, position ?? undefined);
3135
+ }
3136
+ if (typeof buffer === 'string') {
3137
+ return $node.fs.writeSync(this.descr(), buffer, position);
3138
+ }
3139
+ length = length ?? buffer.byteLength;
3140
+ return $node.fs.writeSync(this.descr(), buffer, offset, length, position);
3141
+ }
3142
+ truncate(size) {
3143
+ $node.fs.ftruncateSync(this.descr());
3144
+ }
3145
+ read() {
3146
+ return $mol_file_node_buffer_normalize($node.fs.readFileSync(this.descr()));
3147
+ }
3148
+ close() {
3149
+ $node.fs.closeSync(this.descr());
3150
+ }
3151
+ }
3152
+ __decorate([
3153
+ $mol_mem
3154
+ ], $mol_file_transaction_node.prototype, "descr", null);
3155
+ $.$mol_file_transaction_node = $mol_file_transaction_node;
3156
+ $.$mol_file_transaction = $mol_file_transaction_node;
3157
+ })($ || ($ = {}));
3158
+
3159
+ ;
3160
+ "use strict";
3161
+ var $;
3162
+ (function ($) {
3163
+ class $mol_file_base extends $mol_object {
3164
+ static absolute(path) {
3165
+ return this.make({
3166
+ path: $mol_const(path)
3167
+ });
3168
+ }
3169
+ static relative(path) {
3170
+ throw new Error('Not implemented yet');
3171
+ }
3172
+ static base = '';
3173
+ path() {
3174
+ return '.';
3175
+ }
3176
+ parent() {
3177
+ return this.resolve('..');
3178
+ }
3179
+ exists_cut() { return this.exists(); }
3180
+ root() {
3181
+ const path = this.path();
3182
+ const base = this.constructor.base;
3183
+ return base.startsWith(path) || this == this.parent();
3184
+ }
3185
+ stat(next, virt) {
3186
+ const path = this.path();
3187
+ const parent = this.parent();
3188
+ if (!this.root()) {
3189
+ parent.version();
3190
+ }
3191
+ parent.watcher();
3192
+ if (virt)
3193
+ return next ?? null;
3194
+ return next ?? this.info(path);
3195
+ }
3196
+ static changed = new Set;
3197
+ static frame = null;
3198
+ static changed_add(type, path) {
3199
+ if (/([\/\\]\.|___$)/.test(path))
3200
+ return;
3201
+ const file = this.relative(path.at(-1) === '/' ? path.slice(0, -1) : path);
3202
+ this.changed.add(file);
3203
+ if (!this.watching)
3204
+ return;
3205
+ this.frame?.destructor();
3206
+ this.frame = new this.$.$mol_after_timeout(this.watch_debounce(), () => {
3207
+ if (!this.watching)
3208
+ return;
3209
+ this.watching = false;
3210
+ $mol_wire_async(this).flush();
3211
+ });
3212
+ }
3213
+ static watch_debounce() { return 500; }
3214
+ static flush() {
3215
+ for (const file of this.changed) {
3216
+ const parent = file.parent();
3217
+ try {
3218
+ if ($mol_wire_probe(() => parent.sub()))
3219
+ parent.sub(null);
3220
+ file.reset();
3221
+ }
3222
+ catch (error) {
3223
+ if ($mol_fail_catch(error))
3224
+ $mol_fail_log(error);
3225
+ }
3226
+ }
3227
+ this.changed.clear();
3228
+ this.watching = true;
3229
+ }
3230
+ static watching = true;
3231
+ static lock = new $mol_lock;
3232
+ static watch_off(path) {
3233
+ this.watching = false;
3234
+ this.flush();
3235
+ this.watching = false;
3236
+ this.changed.add(this.absolute(path));
3237
+ }
3238
+ static unwatched(side_effect, affected_dir) {
3239
+ const unlock = this.lock.grab();
3240
+ this.watch_off(affected_dir);
3241
+ try {
3242
+ const result = side_effect();
3243
+ this.flush();
3244
+ unlock();
3245
+ return result;
3246
+ }
3247
+ catch (e) {
3248
+ if (!$mol_promise_like(e)) {
3249
+ this.flush();
3250
+ unlock();
3251
+ }
3252
+ $mol_fail_hidden(e);
3253
+ }
3254
+ }
3255
+ reset() {
3256
+ this.stat(null);
3257
+ }
3258
+ modified() { return this.stat()?.mtime ?? null; }
3259
+ version() {
3260
+ const next = this.stat()?.mtime.getTime().toString(36).toUpperCase() ?? '';
3261
+ return next;
3262
+ }
3263
+ info(path) { return null; }
3264
+ ensure() { }
3265
+ drop() { }
3266
+ copy(to) { }
3267
+ read() { return new Uint8Array; }
3268
+ write(buffer) { }
3269
+ kids() {
3270
+ return [];
3271
+ }
3272
+ readable(opts) {
3273
+ return new ReadableStream;
3274
+ }
3275
+ writable(opts) {
3276
+ return new WritableStream;
3277
+ }
3278
+ buffer(next) {
3279
+ let readed = new Uint8Array();
3280
+ if (next === undefined) {
3281
+ if (this.version())
3282
+ readed = this.read();
3283
+ }
3284
+ const prev = $mol_mem_cached(() => this.buffer());
3285
+ const changed = prev === undefined || !$mol_compare_array(prev, next ?? readed);
3286
+ if (prev !== undefined && changed) {
3287
+ this.$.$mol_log3_rise({
3288
+ place: `$mol_file_node.buffer()`,
3289
+ message: 'Changed',
3290
+ path: this.relate(),
3291
+ });
3292
+ }
3293
+ if (next === undefined)
3294
+ return changed ? readed : prev;
3295
+ if (!changed && this.exists())
3296
+ return prev;
3297
+ this.parent().exists(true);
3298
+ this.stat(this.stat_make(next.length), 'virt');
3299
+ this.write(next);
3300
+ return next;
3301
+ }
3302
+ stat_make(size) {
3303
+ const now = new Date();
3304
+ return {
3305
+ type: 'file',
3306
+ size,
3307
+ atime: now,
3308
+ mtime: now,
3309
+ ctime: now,
3310
+ };
3311
+ }
3312
+ clone(to) {
3313
+ if (!this.exists())
3314
+ return null;
3315
+ const target = this.constructor.absolute(to);
3316
+ try {
3317
+ this.version();
3318
+ target.parent().exists(true);
3319
+ this.copy(to);
3320
+ target.reset();
3321
+ return target;
3322
+ }
3323
+ catch (error) {
3324
+ if ($mol_fail_catch(error)) {
3325
+ console.error(error);
3326
+ }
3327
+ }
3328
+ return null;
3329
+ }
3330
+ watcher() {
3331
+ return {
3332
+ destructor() { }
3333
+ };
3334
+ }
3335
+ exists(next) {
3336
+ const exists = Boolean(this.stat());
3337
+ if (next === undefined)
3338
+ return exists;
3339
+ if (next === exists)
3340
+ return exists;
3341
+ if (next) {
3342
+ this.parent().exists(true);
3343
+ this.ensure();
3344
+ }
3345
+ else {
3346
+ this.drop();
3347
+ }
3348
+ this.reset();
3349
+ return next;
3350
+ }
3351
+ type() {
3352
+ return this.stat()?.type ?? '';
3353
+ }
3354
+ name() {
3355
+ return this.path().replace(/^.*\//, '');
3356
+ }
3357
+ ext() {
3358
+ const match = /((?:\.\w+)+)$/.exec(this.path());
3359
+ return match ? match[1].substring(1) : '';
3360
+ }
3361
+ text(next, virt) {
3362
+ if (next !== undefined)
3363
+ this.exists();
3364
+ return this.text_int(next, virt);
3365
+ }
3366
+ text_int(next, virt) {
3367
+ if (virt) {
3368
+ this.stat(this.stat_make(0), 'virt');
3369
+ return next;
3370
+ }
3371
+ if (next === undefined) {
3372
+ return $mol_charset_decode(this.buffer());
3373
+ }
3374
+ else {
3375
+ const buffer = $mol_charset_encode(next);
3376
+ this.buffer(buffer);
3377
+ return next;
3378
+ }
3379
+ }
3380
+ sub(reset) {
3381
+ if (!this.exists())
3382
+ return [];
3383
+ if (this.type() !== 'dir')
3384
+ return [];
3385
+ this.version();
3386
+ return this.kids().filter(file => file.exists());
3387
+ }
3388
+ resolve(path) {
3389
+ throw new Error('implement');
3390
+ }
3391
+ relate(base = this.constructor.relative('.')) {
3392
+ const base_path = base.path();
3393
+ const path = this.path();
3394
+ return path.startsWith(base_path) ? path.slice(base_path.length) : path;
3395
+ }
3396
+ find(include, exclude) {
3397
+ const found = [];
3398
+ const sub = this.sub();
3399
+ for (const child of sub) {
3400
+ const child_path = child.path();
3401
+ if (exclude && child_path.match(exclude))
3402
+ continue;
3403
+ if (!include || child_path.match(include))
3404
+ found.push(child);
3405
+ if (child.type() === 'dir') {
3406
+ const sub_child = child.find(include, exclude);
3407
+ for (const child of sub_child)
3408
+ found.push(child);
3409
+ }
3410
+ }
3411
+ return found;
3412
+ }
3413
+ size() {
3414
+ switch (this.type()) {
3415
+ case 'file': return this.stat()?.size ?? 0;
3416
+ default: return 0;
3417
+ }
3418
+ }
3419
+ toJSON() {
3420
+ return this.path();
3421
+ }
3422
+ open(...modes) {
3423
+ return this.$.$mol_file_transaction.make({
3424
+ path: () => this.path(),
3425
+ modes: () => modes
3426
+ });
3427
+ }
3428
+ }
3429
+ __decorate([
3430
+ $mol_action
3431
+ ], $mol_file_base.prototype, "exists_cut", null);
3432
+ __decorate([
3433
+ $mol_mem
3434
+ ], $mol_file_base.prototype, "stat", null);
3435
+ __decorate([
3436
+ $mol_mem
3437
+ ], $mol_file_base.prototype, "modified", null);
3438
+ __decorate([
3439
+ $mol_mem
3440
+ ], $mol_file_base.prototype, "version", null);
3441
+ __decorate([
3442
+ $mol_mem_key
3443
+ ], $mol_file_base.prototype, "readable", null);
3444
+ __decorate([
3445
+ $mol_mem_key
3446
+ ], $mol_file_base.prototype, "writable", null);
3447
+ __decorate([
3448
+ $mol_mem
3449
+ ], $mol_file_base.prototype, "buffer", null);
3450
+ __decorate([
3451
+ $mol_action
3452
+ ], $mol_file_base.prototype, "stat_make", null);
3453
+ __decorate([
3454
+ $mol_mem_key
3455
+ ], $mol_file_base.prototype, "clone", null);
3456
+ __decorate([
3457
+ $mol_mem
3458
+ ], $mol_file_base.prototype, "exists", null);
3459
+ __decorate([
3460
+ $mol_mem
3461
+ ], $mol_file_base.prototype, "type", null);
3462
+ __decorate([
3463
+ $mol_mem
3464
+ ], $mol_file_base.prototype, "text_int", null);
3465
+ __decorate([
3466
+ $mol_mem
3467
+ ], $mol_file_base.prototype, "sub", null);
3468
+ __decorate([
3469
+ $mol_mem
3470
+ ], $mol_file_base.prototype, "size", null);
3471
+ __decorate([
3472
+ $mol_action
3473
+ ], $mol_file_base.prototype, "open", null);
3474
+ __decorate([
3475
+ $mol_mem_key
3476
+ ], $mol_file_base, "absolute", null);
3477
+ __decorate([
3478
+ $mol_action
3479
+ ], $mol_file_base, "flush", null);
3480
+ __decorate([
3481
+ $mol_action
3482
+ ], $mol_file_base, "watch_off", null);
3483
+ $.$mol_file_base = $mol_file_base;
3484
+ })($ || ($ = {}));
3485
+
3486
+ ;
3487
+ "use strict";
3488
+ var $;
3489
+ (function ($) {
3490
+ class $mol_file extends $mol_file_base {
3491
+ }
3492
+ $.$mol_file = $mol_file;
3493
+ })($ || ($ = {}));
3494
+
3495
+ ;
3496
+ "use strict";
3497
+ var $;
3498
+ (function ($) {
3499
+ function stat_convert(stat) {
3500
+ if (!stat)
3501
+ return null;
3502
+ let type;
3503
+ if (stat.isDirectory())
3504
+ type = 'dir';
3505
+ if (stat.isFile())
3506
+ type = 'file';
3507
+ if (stat.isSymbolicLink())
3508
+ type = 'link';
3509
+ if (!type)
3510
+ return $mol_fail(new Error(`Unsupported file type`));
3511
+ return {
3512
+ type,
3513
+ size: Number(stat.size),
3514
+ atime: stat.atime,
3515
+ mtime: stat.mtime,
3516
+ ctime: stat.ctime
3517
+ };
3518
+ }
3519
+ function $mol_file_node_buffer_normalize(buf) {
3520
+ return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
3521
+ }
3522
+ $.$mol_file_node_buffer_normalize = $mol_file_node_buffer_normalize;
3523
+ class $mol_file_node extends $mol_file {
3524
+ static relative(path) {
3525
+ return this.absolute($node.path.resolve(this.base, path).replace(/\\/g, '/'));
3526
+ }
3527
+ watcher(reset) {
3528
+ const path = this.path();
3529
+ const root = this.root();
3530
+ if (!root && !this.exists())
3531
+ return super.watcher();
3532
+ let watcher;
3533
+ try {
3534
+ watcher = $node.fs.watch(path);
3535
+ }
3536
+ catch (error) {
3537
+ if (!(error instanceof Error))
3538
+ error = new Error('Unknown watch error', { cause: error });
3539
+ error.message += '\n' + path;
3540
+ if (root || error.code !== 'ENOENT') {
3541
+ this.$.$mol_fail_log(error);
3542
+ }
3543
+ return super.watcher();
3544
+ }
3545
+ watcher.on('change', (type, name) => {
3546
+ if (!name)
3547
+ return;
3548
+ const path = $node.path.join(this.path(), name.toString());
3549
+ this.constructor.changed_add(type, path);
3550
+ });
3551
+ watcher.on('error', e => this.$.$mol_fail_log(e));
3552
+ let destructed = false;
3553
+ watcher.on('close', () => {
3554
+ if (!destructed)
3555
+ setTimeout(() => $mol_wire_async(this).watcher(null), 500);
3556
+ });
3557
+ return {
3558
+ destructor() {
3559
+ destructed = true;
3560
+ watcher.close();
3561
+ }
3562
+ };
3563
+ }
3564
+ info(path) {
3565
+ try {
3566
+ return stat_convert($node.fs.statSync(path));
3567
+ }
3568
+ catch (error) {
3569
+ if (this.$.$mol_fail_catch(error)) {
3570
+ if (error.code === 'ENOENT')
3571
+ return null;
3572
+ error.message += '\n' + path;
3573
+ this.$.$mol_fail_hidden(error);
3574
+ }
3575
+ }
3576
+ return null;
3577
+ }
3578
+ ensure() {
3579
+ const path = this.path();
3580
+ try {
3581
+ $node.fs.mkdirSync(path, { recursive: true });
3582
+ return null;
3583
+ }
3584
+ catch (e) {
3585
+ if (this.$.$mol_fail_catch(e)) {
3586
+ if (e.code === 'EEXIST')
3587
+ return null;
3588
+ e.message += '\n' + path;
3589
+ this.$.$mol_fail_hidden(e);
3590
+ }
3591
+ }
3592
+ }
3593
+ copy(to) {
3594
+ $node.fs.copyFileSync(this.path(), to);
3595
+ }
3596
+ drop() {
3597
+ $node.fs.unlinkSync(this.path());
3598
+ }
3599
+ read() {
3600
+ const path = this.path();
3601
+ try {
3602
+ return $mol_file_node_buffer_normalize($node.fs.readFileSync(path));
3603
+ }
3604
+ catch (error) {
3605
+ if (!$mol_promise_like(error)) {
3606
+ error.message += '\n' + path;
3607
+ }
3608
+ $mol_fail_hidden(error);
3609
+ }
3610
+ }
3611
+ write(buffer) {
3612
+ const path = this.path();
3613
+ try {
3614
+ $node.fs.writeFileSync(path, buffer);
3615
+ }
3616
+ catch (error) {
3617
+ if (this.$.$mol_fail_catch(error)) {
3618
+ error.message += '\n' + path;
3619
+ }
3620
+ return this.$.$mol_fail_hidden(error);
3621
+ }
3622
+ }
3623
+ kids() {
3624
+ const path = this.path();
3625
+ try {
3626
+ const kids = $node.fs.readdirSync(path)
3627
+ .filter(name => !/^\.+$/.test(name))
3628
+ .map(name => this.resolve(name));
3629
+ return kids;
3630
+ }
3631
+ catch (e) {
3632
+ if (this.$.$mol_fail_catch(e)) {
3633
+ if (e.code === 'ENOENT')
3634
+ return [];
3635
+ e.message += '\n' + path;
3636
+ }
3637
+ $mol_fail_hidden(e);
3638
+ }
3639
+ }
3640
+ resolve(path) {
3641
+ return this.constructor
3642
+ .relative($node.path.join(this.path(), path));
3643
+ }
3644
+ relate(base = this.constructor.relative('.')) {
3645
+ return $node.path.relative(base.path(), this.path()).replace(/\\/g, '/');
3646
+ }
3647
+ readable(opts) {
3648
+ const { Readable } = $node['node:stream'];
3649
+ const stream = $node.fs.createReadStream(this.path(), {
3650
+ flags: 'r',
3651
+ autoClose: true,
3652
+ start: opts?.start,
3653
+ end: opts?.end,
3654
+ encoding: 'binary',
3655
+ });
3656
+ return Readable.toWeb(stream);
3657
+ }
3658
+ writable(opts) {
3659
+ const { Writable } = $node['node:stream'];
3660
+ const stream = $node.fs.createWriteStream(this.path(), {
3661
+ flags: 'w+',
3662
+ autoClose: true,
3663
+ start: opts?.start,
3664
+ encoding: 'binary',
3665
+ });
3666
+ return Writable.toWeb(stream);
3667
+ }
3668
+ }
3669
+ __decorate([
3670
+ $mol_mem
3671
+ ], $mol_file_node.prototype, "watcher", null);
3672
+ __decorate([
3673
+ $mol_action
3674
+ ], $mol_file_node.prototype, "info", null);
3675
+ __decorate([
3676
+ $mol_action
3677
+ ], $mol_file_node.prototype, "ensure", null);
3678
+ __decorate([
3679
+ $mol_action
3680
+ ], $mol_file_node.prototype, "copy", null);
3681
+ __decorate([
3682
+ $mol_action
3683
+ ], $mol_file_node.prototype, "drop", null);
3684
+ __decorate([
3685
+ $mol_action
3686
+ ], $mol_file_node.prototype, "read", null);
3687
+ __decorate([
3688
+ $mol_action
3689
+ ], $mol_file_node.prototype, "write", null);
3690
+ __decorate([
3691
+ $mol_mem_key
3692
+ ], $mol_file_node.prototype, "readable", null);
3693
+ __decorate([
3694
+ $mol_mem
3695
+ ], $mol_file_node.prototype, "writable", null);
3696
+ $.$mol_file_node = $mol_file_node;
3697
+ $.$mol_file = $mol_file_node;
3698
+ })($ || ($ = {}));
3699
+
3700
+ ;
3701
+ "use strict";
3702
+ var $;
3703
+ (function ($) {
3704
+ class $mol_state_local_node extends $mol_state_local {
3705
+ static dir() {
3706
+ const base = process.env.XDG_DATA_HOME || ($node.os.homedir() + '/.local/share');
3707
+ return $mol_file.absolute(base).resolve('./mol_state_local');
3708
+ }
3709
+ static value(key, next) {
3710
+ const file = this.dir().resolve(encodeURIComponent(key) + '.json');
3711
+ if (next === null) {
3712
+ file.exists(false);
3713
+ return null;
3714
+ }
3715
+ const arg = next === undefined ? undefined : JSON.stringify(next);
3716
+ return JSON.parse(file.text(arg) || 'null');
3717
+ }
3718
+ }
3719
+ __decorate([
3720
+ $mol_mem
3721
+ ], $mol_state_local_node, "dir", null);
3722
+ __decorate([
3723
+ $mol_mem_key
3724
+ ], $mol_state_local_node, "value", null);
3725
+ $.$mol_state_local_node = $mol_state_local_node;
3726
+ $.$mol_state_local = $mol_state_local_node;
3727
+ })($ || ($ = {}));
3728
+
3729
+ ;
3730
+ "use strict";
3731
+ var $;
3732
+ (function ($) {
3733
+ function parse(theme) {
3734
+ if (theme === 'true')
3735
+ return true;
3736
+ if (theme === 'false')
3737
+ return false;
3738
+ return null;
3739
+ }
3740
+ function $mol_lights(next) {
3741
+ const arg = parse(this.$mol_state_arg.value('mol_lights'));
3742
+ const base = this.$mol_media.match('(prefers-color-scheme: light)');
3743
+ if (next === undefined) {
3744
+ return arg ?? this.$mol_state_local.value('$mol_lights') ?? base;
3745
+ }
3746
+ else {
3747
+ if (arg === null) {
3748
+ this.$mol_state_local.value('$mol_lights', next === base ? null : next);
3749
+ }
3750
+ else {
3751
+ this.$mol_state_arg.value('mol_lights', String(next));
3752
+ }
3753
+ return next;
3754
+ }
3755
+ }
3756
+ $.$mol_lights = $mol_lights;
3757
+ })($ || ($ = {}));
3758
+
3759
+ ;
3760
+ "use strict";
3761
+ var $;
3762
+ (function ($) {
3763
+ $.$mol_theme = $mol_style_prop('mol_theme', [
3764
+ 'back',
3765
+ 'hover',
3766
+ 'card',
3767
+ 'current',
3768
+ 'special',
3769
+ 'text',
3770
+ 'control',
3771
+ 'shade',
3772
+ 'line',
3773
+ 'focus',
3774
+ 'field',
3775
+ 'image',
3776
+ 'spirit',
3777
+ ]);
3778
+ })($ || ($ = {}));
3779
+
3780
+ ;
3781
+ "use strict";
3782
+ var $;
3783
+ (function ($) {
3784
+ $mol_style_attach("mol/theme/theme.css", ":root {\n\t--mol_theme_hue: 240deg;\n\t--mol_theme_hue_spread: 90deg;\n\tcolor-scheme: dark light;\n}\n\n:where([mol_theme]) {\n\tcolor: var(--mol_theme_text);\n\tfill: var(--mol_theme_text);\n\tbackground-color: var(--mol_theme_back);\n}\n\t\n:root, [mol_theme=\"$mol_theme_dark\"], :where([mol_theme=\"$mol_theme_dark\"]) [mol_theme] {\n\n\t--mol_theme_luma: -1;\n\t--mol_theme_image: invert(1) hue-rotate( 180deg );\n\t--mol_theme_spirit: hsl( 0deg, 0%, 0%, .75 );\n\n\t--mol_theme_back: hsl( var(--mol_theme_hue), 20%, 10% );\n\t--mol_theme_card: hsl( var(--mol_theme_hue), 50%, 20%, .25 );\n\t--mol_theme_field: hsl( var(--mol_theme_hue), 50%, 8%, .25 );\n\t--mol_theme_hover: hsl( var(--mol_theme_hue), 0%, 50%, .1 );\n\t\n\t--mol_theme_text: hsl( var(--mol_theme_hue), 0%, 80% );\n\t--mol_theme_shade: hsl( var(--mol_theme_hue), 0%, 60%, 1 );\n\t--mol_theme_line: hsl( var(--mol_theme_hue), 0%, 50%, .25 );\n\t--mol_theme_focus: hsl( calc( var(--mol_theme_hue) + 180deg ), 100%, 65% );\n\t\n\t--mol_theme_control: hsl( var(--mol_theme_hue), 60%, 65% );\n\t--mol_theme_current: hsl( calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ), 60%, 65% );\n\t--mol_theme_special: hsl( calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ), 60%, 65% );\n\n} @supports( color: oklch( 0% 0 0deg ) ) {\n:root, [mol_theme=\"$mol_theme_dark\"], :where([mol_theme=\"$mol_theme_dark\"]) [mol_theme] {\n\t\n\t--mol_theme_back: oklch( 20% .03 var(--mol_theme_hue) );\n\t--mol_theme_card: oklch( 30% .05 var(--mol_theme_hue) / .25 );\n\t--mol_theme_field: oklch( 15% 0 var(--mol_theme_hue) / .25 );\n\t--mol_theme_hover: oklch( 70% 0 var(--mol_theme_hue) / .1 );\n\t\n\t--mol_theme_text: oklch( 80% 0 var(--mol_theme_hue) );\n\t--mol_theme_shade: oklch( 60% 0 var(--mol_theme_hue) );\n\t--mol_theme_line: oklch( 60% 0 var(--mol_theme_hue) / .25 );\n\t--mol_theme_focus: oklch( 80% .2 calc( var(--mol_theme_hue) + 180deg ) );\n\t\n\t--mol_theme_control: oklch( 70% .1 var(--mol_theme_hue) );\n\t--mol_theme_current: oklch( 70% .2 calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ) );\n\t--mol_theme_special: oklch( 70% .2 calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ) );\n\n} }\n\n[mol_theme=\"$mol_theme_light\"], :where([mol_theme=\"$mol_theme_light\"]) [mol_theme] {\n\t\n\t--mol_theme_luma: 1;\n\t--mol_theme_image: none;\n\t--mol_theme_spirit: hsl( 0deg, 0%, 100%, .75 );\n\t\n\t--mol_theme_back: hsl( var(--mol_theme_hue), 20%, 92% );\n\t--mol_theme_card: hsl( var(--mol_theme_hue), 50%, 100%, .5 );\n\t--mol_theme_field: hsl( var(--mol_theme_hue), 50%, 100%, .75 );\n\t--mol_theme_hover: hsl( var(--mol_theme_hue), 0%, 50%, .1 );\n\t\n\t--mol_theme_text: hsl( var(--mol_theme_hue), 0%, 0% );\n\t--mol_theme_shade: hsl( var(--mol_theme_hue), 0%, 40%, 1 );\n\t--mol_theme_line: hsl( var(--mol_theme_hue), 0%, 50%, .25 );\n\t--mol_theme_focus: hsl( calc( var(--mol_theme_hue) + 180deg ), 100%, 40% );\n\t\n\t--mol_theme_control: hsl( var(--mol_theme_hue), 80%, 30% );\n\t--mol_theme_current: hsl( calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ), 80%, 30% );\n\t--mol_theme_special: hsl( calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ), 80%, 30% );\n\n} @supports( color: oklch( 0% 0 0deg ) ) {\n[mol_theme=\"$mol_theme_light\"], :where([mol_theme=\"$mol_theme_light\"]) [mol_theme] {\n\t--mol_theme_back: oklch( 92% .01 var(--mol_theme_hue) );\n\t--mol_theme_card: oklch( 99% .01 var(--mol_theme_hue) / .5 );\n\t--mol_theme_field: oklch( 100% 0 var(--mol_theme_hue) / .5 );\n\t--mol_theme_hover: oklch( 70% 0 var(--mol_theme_hue) / .1 );\n\t\n\t--mol_theme_text: oklch( 20% 0 var(--mol_theme_hue) );\n\t--mol_theme_shade: oklch( 60% 0 var(--mol_theme_hue) );\n\t--mol_theme_line: oklch( 50% 0 var(--mol_theme_hue) / .25 );\n\t--mol_theme_focus: oklch( 60% .2 calc( var(--mol_theme_hue) + 180deg ) );\n\t\n\t--mol_theme_control: oklch( 40% .15 var(--mol_theme_hue) );\n\t--mol_theme_current: oklch( 50% .2 calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ) );\n\t--mol_theme_special: oklch( 50% .2 calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ) );\n\n} }\n\n:where( :root, [mol_theme=\"$mol_theme_dark\"] ) [mol_theme=\"$mol_theme_base\"] {\n\t--mol_theme_back: oklch( 25% .075 var(--mol_theme_hue) );\n\t--mol_theme_card: oklch( 35% .1 var(--mol_theme_hue) / .25 );\n}\n:where( [mol_theme=\"$mol_theme_light\"] ) [mol_theme=\"$mol_theme_base\"] {\n\t--mol_theme_back: oklch( 85% .075 var(--mol_theme_hue) );\n\t--mol_theme_card: oklch( 98% .03 var(--mol_theme_hue) / .25 );\n}\n\n:where( :root, [mol_theme=\"$mol_theme_dark\"] ) [mol_theme=\"$mol_theme_current\"] {\n\t--mol_theme_back: oklch( 25% .05 calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ) );\n\t--mol_theme_card: oklch( 35% .1 calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ) / .25 );\n}\n:where( [mol_theme=\"$mol_theme_light\"] ) [mol_theme=\"$mol_theme_current\"] {\n\t--mol_theme_back: oklch( 85% .05 calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ) );\n\t--mol_theme_card: oklch( 98% .03 calc( var(--mol_theme_hue) - var(--mol_theme_hue_spread) ) / .25 );\n}\n\n:where( :root, [mol_theme=\"$mol_theme_dark\"] ) [mol_theme=\"$mol_theme_special\"] {\n\t--mol_theme_back: oklch( 25% .05 calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ) );\n\t--mol_theme_card: oklch( 35% .1 calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ) / .25 );\n}\n:where( [mol_theme=\"$mol_theme_light\"] ) [mol_theme=\"$mol_theme_special\"] {\n\t--mol_theme_back: oklch( 85% .05 calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ) );\n\t--mol_theme_card: oklch( 98% .03 calc( var(--mol_theme_hue) + var(--mol_theme_hue_spread) ) / .25 );\n}\n\n:where( :root, [mol_theme=\"$mol_theme_dark\"] ) [mol_theme=\"$mol_theme_accent\"] {\n\t--mol_theme_back: oklch( 35% .1 calc( var(--mol_theme_hue) + 180deg ) );\n\t--mol_theme_card: oklch( 45% .15 calc( var(--mol_theme_hue) + 180deg ) / .25 );\n}\n:where( [mol_theme=\"$mol_theme_light\"] ) [mol_theme=\"$mol_theme_accent\"] {\n\t--mol_theme_back: oklch( 83% .1 calc( var(--mol_theme_hue) + 180deg ) );\n\t--mol_theme_card: oklch( 98% .03 calc( var(--mol_theme_hue) + 180deg ) / .25 );\n}\n\n");
3785
+ })($ || ($ = {}));
3786
+
3787
+ ;
3788
+ "use strict";
3789
+ var $;
3790
+ (function ($) {
3791
+ $mol_style_attach('$mol_theme_lights', `:root { --mol_theme_back: oklch( ${$$.$mol_lights() ? 92 : 20}% .01 var(--mol_theme_hue) ) }`);
3792
+ })($ || ($ = {}));
3793
+
3794
+ ;
3795
+ "use strict";
3796
+ var $;
3797
+ (function ($) {
3798
+ $.$mol_gap = $mol_style_prop('mol_gap', [
3799
+ 'block',
3800
+ 'text',
3801
+ 'round',
3802
+ 'space',
3803
+ 'blur',
3804
+ ]);
3805
+ })($ || ($ = {}));
3806
+
3807
+ ;
3808
+ "use strict";
3809
+ var $;
3810
+ (function ($) {
3811
+ $mol_style_attach("mol/gap/gap.css", ":root {\n\t--mol_gap_block: .75rem;\n\t--mol_gap_text: .5rem .75rem;\n\t--mol_gap_round: .25rem;\n\t--mol_gap_space: .25rem;\n\t--mol_gap_blur: .5rem;\n}\n");
3812
+ })($ || ($ = {}));
3813
+
3814
+ ;
3815
+ "use strict";
3816
+ var $;
3817
+ (function ($) {
3818
+ function $mol_dom_render_children(el, childNodes) {
3819
+ const node_set = new Set(childNodes);
3820
+ let nextNode = el.firstChild;
3821
+ for (let view of childNodes) {
3822
+ if (view == null)
3823
+ continue;
3824
+ if (view instanceof $mol_dom_context.Node) {
3825
+ while (true) {
3826
+ if (!nextNode) {
3827
+ el.appendChild(view);
3828
+ break;
3829
+ }
3830
+ if (nextNode == view) {
3831
+ nextNode = nextNode.nextSibling;
3832
+ break;
3833
+ }
3834
+ else {
3835
+ if (node_set.has(nextNode)) {
3836
+ el.insertBefore(view, nextNode);
3837
+ break;
3838
+ }
3839
+ else {
3840
+ const nn = nextNode.nextSibling;
3841
+ el.removeChild(nextNode);
3842
+ nextNode = nn;
3843
+ }
3844
+ }
3845
+ }
3846
+ }
3847
+ else {
3848
+ if (nextNode && nextNode.nodeName === '#text') {
3849
+ const str = String(view);
3850
+ if (nextNode.nodeValue !== str)
3851
+ nextNode.nodeValue = str;
3852
+ nextNode = nextNode.nextSibling;
3853
+ }
3854
+ else {
3855
+ const textNode = $mol_dom_context.document.createTextNode(String(view));
3856
+ el.insertBefore(textNode, nextNode);
3857
+ }
2867
3858
  }
2868
- };
2869
- Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
2870
- Reflect.defineProperty(descr2.value, 'length', { value: orig.length });
2871
- Object.assign(descr2.value, { orig });
2872
- Reflect.defineProperty(host, field, descr2);
2873
- return descr2;
3859
+ }
3860
+ while (nextNode) {
3861
+ const currNode = nextNode;
3862
+ nextNode = currNode.nextSibling;
3863
+ el.removeChild(currNode);
3864
+ }
2874
3865
  }
2875
- $.$mol_wire_solo = $mol_wire_solo;
3866
+ $.$mol_dom_render_children = $mol_dom_render_children;
2876
3867
  })($ || ($ = {}));
2877
3868
 
3869
+ ;
3870
+ "use strict";
3871
+
2878
3872
  ;
2879
3873
  "use strict";
2880
3874
  var $;
2881
3875
  (function ($) {
2882
- function $mol_wire_plex(host, field, descr) {
2883
- if (!descr)
2884
- descr = Reflect.getOwnPropertyDescriptor(host, field);
2885
- const orig = descr?.value ?? host[field];
2886
- const sup = Reflect.getPrototypeOf(host);
2887
- if (typeof sup[field] === 'function') {
2888
- Object.defineProperty(orig, 'name', { value: sup[field].name });
3876
+ $.$mol_jsx_prefix = '';
3877
+ $.$mol_jsx_crumbs = '';
3878
+ $.$mol_jsx_booked = null;
3879
+ $.$mol_jsx_document = {
3880
+ getElementById: () => null,
3881
+ createElementNS: (space, name) => $mol_dom_context.document.createElementNS(space, name),
3882
+ createDocumentFragment: () => $mol_dom_context.document.createDocumentFragment(),
3883
+ };
3884
+ $.$mol_jsx_frag = '';
3885
+ function $mol_jsx(Elem, props, ...childNodes) {
3886
+ const id = props && props.id || '';
3887
+ const guid = id ? $.$mol_jsx_prefix ? $.$mol_jsx_prefix + '/' + id : id : $.$mol_jsx_prefix;
3888
+ const crumbs_self = id ? $.$mol_jsx_crumbs.replace(/(\S+)/g, `$1_${id.replace(/\/.*/i, '')}`) : $.$mol_jsx_crumbs;
3889
+ if (Elem && $.$mol_jsx_booked) {
3890
+ if ($.$mol_jsx_booked.has(id)) {
3891
+ $mol_fail(new Error(`JSX already has tag with id ${JSON.stringify(guid)}`));
3892
+ }
3893
+ else {
3894
+ $.$mol_jsx_booked.add(id);
3895
+ }
2889
3896
  }
2890
- const descr2 = {
2891
- ...descr,
2892
- value: function (...args) {
2893
- let atom = $mol_wire_atom.plex(this, orig, args[0]);
2894
- if ((args.length === 1) || (args[1] === undefined)) {
2895
- if (!$mol_wire_fiber.warm)
2896
- return atom.result();
2897
- if ($mol_wire_auto()?.temp) {
2898
- return atom.once();
3897
+ let node = guid ? $.$mol_jsx_document.getElementById(guid) : null;
3898
+ if ($.$mol_jsx_prefix) {
3899
+ const prefix_ext = $.$mol_jsx_prefix;
3900
+ const booked_ext = $.$mol_jsx_booked;
3901
+ const crumbs_ext = $.$mol_jsx_crumbs;
3902
+ for (const field in props) {
3903
+ const func = props[field];
3904
+ if (typeof func !== 'function')
3905
+ continue;
3906
+ const wrapper = function (...args) {
3907
+ const prefix = $.$mol_jsx_prefix;
3908
+ const booked = $.$mol_jsx_booked;
3909
+ const crumbs = $.$mol_jsx_crumbs;
3910
+ try {
3911
+ $.$mol_jsx_prefix = prefix_ext;
3912
+ $.$mol_jsx_booked = booked_ext;
3913
+ $.$mol_jsx_crumbs = crumbs_ext;
3914
+ return func.call(this, ...args);
2899
3915
  }
2900
- else {
2901
- return atom.sync();
3916
+ finally {
3917
+ $.$mol_jsx_prefix = prefix;
3918
+ $.$mol_jsx_booked = booked;
3919
+ $.$mol_jsx_crumbs = crumbs;
2902
3920
  }
3921
+ };
3922
+ $mol_func_name_from(wrapper, func);
3923
+ props[field] = wrapper;
3924
+ }
3925
+ }
3926
+ if (typeof Elem !== 'string') {
3927
+ if ('prototype' in Elem) {
3928
+ const view = node && node[String(Elem)] || new Elem;
3929
+ Object.assign(view, props);
3930
+ view[Symbol.toStringTag] = guid;
3931
+ view.childNodes = childNodes;
3932
+ if (!view.ownerDocument)
3933
+ view.ownerDocument = $.$mol_jsx_document;
3934
+ view.className = (crumbs_self ? crumbs_self + ' ' : '') + (Elem['name'] || Elem);
3935
+ node = view.valueOf();
3936
+ node[String(Elem)] = view;
3937
+ return node;
3938
+ }
3939
+ else {
3940
+ const prefix = $.$mol_jsx_prefix;
3941
+ const booked = $.$mol_jsx_booked;
3942
+ const crumbs = $.$mol_jsx_crumbs;
3943
+ try {
3944
+ $.$mol_jsx_prefix = guid;
3945
+ $.$mol_jsx_booked = new Set;
3946
+ $.$mol_jsx_crumbs = (crumbs_self ? crumbs_self + ' ' : '') + (Elem['name'] || Elem);
3947
+ return Elem(props, ...childNodes);
3948
+ }
3949
+ finally {
3950
+ $.$mol_jsx_prefix = prefix;
3951
+ $.$mol_jsx_booked = booked;
3952
+ $.$mol_jsx_crumbs = crumbs;
2903
3953
  }
2904
- return atom.resync(args);
2905
3954
  }
2906
- };
2907
- Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
2908
- Reflect.defineProperty(descr2.value, 'length', { value: orig.length });
2909
- Object.assign(descr2.value, { orig });
2910
- Reflect.defineProperty(host, field, descr2);
2911
- return descr2;
3955
+ }
3956
+ if (!node) {
3957
+ node = Elem
3958
+ ? $.$mol_jsx_document.createElementNS(props?.xmlns ?? 'http://www.w3.org/1999/xhtml', Elem)
3959
+ : $.$mol_jsx_document.createDocumentFragment();
3960
+ }
3961
+ $mol_dom_render_children(node, [].concat(...childNodes));
3962
+ if (!Elem)
3963
+ return node;
3964
+ if (guid)
3965
+ node.id = guid;
3966
+ for (const key in props) {
3967
+ if (key === 'id')
3968
+ continue;
3969
+ if (typeof props[key] === 'string') {
3970
+ if (typeof node[key] === 'string')
3971
+ node[key] = props[key];
3972
+ node.setAttribute(key, props[key]);
3973
+ }
3974
+ else if (props[key] &&
3975
+ typeof props[key] === 'object' &&
3976
+ Reflect.getPrototypeOf(props[key]) === Reflect.getPrototypeOf({})) {
3977
+ if (typeof node[key] === 'object') {
3978
+ Object.assign(node[key], props[key]);
3979
+ continue;
3980
+ }
3981
+ }
3982
+ else {
3983
+ node[key] = props[key];
3984
+ }
3985
+ }
3986
+ if ($.$mol_jsx_crumbs)
3987
+ node.className = (props?.['class'] ? props['class'] + ' ' : '') + crumbs_self;
3988
+ return node;
2912
3989
  }
2913
- $.$mol_wire_plex = $mol_wire_plex;
3990
+ $.$mol_jsx = $mol_jsx;
2914
3991
  })($ || ($ = {}));
2915
3992
 
2916
3993
  ;
2917
3994
  "use strict";
2918
3995
  var $;
2919
3996
  (function ($) {
2920
- $.$mol_mem = $mol_wire_solo;
2921
- $.$mol_mem_key = $mol_wire_plex;
3997
+ class $mol_window extends $mol_object {
3998
+ static size() {
3999
+ return {
4000
+ width: 1024,
4001
+ height: 768,
4002
+ };
4003
+ }
4004
+ }
4005
+ $.$mol_window = $mol_window;
2922
4006
  })($ || ($ = {}));
2923
4007
 
2924
4008
  ;
@@ -3037,26 +4121,6 @@ var $;
3037
4121
  $.$mol_dom_qname = $mol_dom_qname;
3038
4122
  })($ || ($ = {}));
3039
4123
 
3040
- ;
3041
- "use strict";
3042
- var $;
3043
- (function ($) {
3044
- function $mol_wire_probe(task, def) {
3045
- const warm = $mol_wire_fiber.warm;
3046
- try {
3047
- $mol_wire_fiber.warm = false;
3048
- const res = task();
3049
- if (res === undefined)
3050
- return def;
3051
- return res;
3052
- }
3053
- finally {
3054
- $mol_wire_fiber.warm = warm;
3055
- }
3056
- }
3057
- $.$mol_wire_probe = $mol_wire_probe;
3058
- })($ || ($ = {}));
3059
-
3060
4124
  ;
3061
4125
  "use strict";
3062
4126
  var $;
@@ -3073,38 +4137,6 @@ var $;
3073
4137
  $.$mol_wire_watch = $mol_wire_watch;
3074
4138
  })($ || ($ = {}));
3075
4139
 
3076
- ;
3077
- "use strict";
3078
- var $;
3079
- (function ($) {
3080
- function $mol_const(value) {
3081
- const getter = (() => value);
3082
- getter['()'] = value;
3083
- getter[Symbol.toStringTag] = value;
3084
- getter[$mol_dev_format_head] = () => $mol_dev_format_span({}, '()=> ', $mol_dev_format_auto(value));
3085
- return getter;
3086
- }
3087
- $.$mol_const = $mol_const;
3088
- })($ || ($ = {}));
3089
-
3090
- ;
3091
- "use strict";
3092
- var $;
3093
- (function ($) {
3094
- function $mol_wire_solid() {
3095
- let current = $mol_wire_auto();
3096
- if (current.temp)
3097
- current = current.host;
3098
- if (current.reap !== nothing) {
3099
- current?.sub_on(sub, sub.data.length);
3100
- }
3101
- current.reap = nothing;
3102
- }
3103
- $.$mol_wire_solid = $mol_wire_solid;
3104
- const nothing = () => { };
3105
- const sub = new $mol_wire_pub_sub;
3106
- })($ || ($ = {}));
3107
-
3108
4140
  ;
3109
4141
  "use strict";
3110
4142
  var $;
@@ -3180,36 +4212,6 @@ var $;
3180
4212
  $.$mol_dom_render_fields = $mol_dom_render_fields;
3181
4213
  })($ || ($ = {}));
3182
4214
 
3183
- ;
3184
- "use strict";
3185
- var $;
3186
- (function ($) {
3187
- function $mol_wire_async(obj) {
3188
- let fiber;
3189
- const temp = $mol_wire_task.getter(obj);
3190
- return new Proxy(obj, {
3191
- get(obj, field) {
3192
- const val = obj[field];
3193
- if (typeof val !== 'function')
3194
- return val;
3195
- let fiber;
3196
- const temp = $mol_wire_task.getter(val);
3197
- return function $mol_wire_async(...args) {
3198
- fiber?.destructor();
3199
- fiber = temp(obj, args);
3200
- return fiber.async();
3201
- };
3202
- },
3203
- apply(obj, self, args) {
3204
- fiber?.destructor();
3205
- fiber = temp(self, args);
3206
- return fiber.async();
3207
- },
3208
- });
3209
- }
3210
- $.$mol_wire_async = $mol_wire_async;
3211
- })($ || ($ = {}));
3212
-
3213
4215
  ;
3214
4216
  "use strict";
3215
4217
 
@@ -3220,7 +4222,7 @@ var $;
3220
4222
  "use strict";
3221
4223
  var $;
3222
4224
  (function ($) {
3223
- $mol_style_attach("mol/view/view/view.css", "[mol_view] {\n\ttransition-property: height, width, min-height, min-width, max-width, max-height, transform;\n\ttransition-duration: .2s;\n\ttransition-timing-function: ease-out;\n\t-webkit-appearance: none;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\tflex-shrink: 0;\n\tcontain: style;\n\tscrollbar-color: var(--mol_theme_line) transparent;\n\tscrollbar-width: thin;\n}\t\n\n[mol_view]::selection {\n\tbackground: var(--mol_theme_line);\n}\t\n\n[mol_view]::-webkit-scrollbar {\n\twidth: .25rem;\n\theight: .25rem;\n}\n\n[mol_view]::-webkit-scrollbar-corner {\n\tbackground-color: var(--mol_theme_line);\n}\n\n[mol_view]::-webkit-scrollbar-track {\n\tbackground-color: transparent;\n}\n\n[mol_view]::-webkit-scrollbar-thumb {\n\tbackground-color: var(--mol_theme_line);\n\tborder-radius: var(--mol_gap_round);\n}\n\n[mol_view] > * {\n\tword-break: inherit;\n}\n\n[mol_view_root] {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbox-sizing: border-box;\n\tfont-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n\tfont-size: 1rem;\n\tline-height: 1.5rem;\n\tbackground: var(--mol_theme_back);\n\tcolor: var(--mol_theme_text);\n\tcontain: unset; /** Fixes bg ignoring when applied to body on Chrome */\n\ttab-size: 4;\n\toverscroll-behavior: contain; /** Disable navigation gestures **/\n}\n\n@media print {\n\t[mol_view_root] {\n\t\theight: auto;\n\t}\n}\n[mol_view][mol_view_error]:not([mol_view_error=\"Promise\"], [mol_view_error=\"$mol_promise_blocker\"]) {\n\tbackground-image: repeating-linear-gradient(\n\t\t-45deg,\n\t\t#f92323,\n\t\t#f92323 .5rem,\n\t\t#ff3d3d .5rem,\n\t\t#ff3d3d 1.5rem\n\t);\n\tcolor: black;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n@keyframes mol_view_wait {\n\tfrom {\n\t\topacity: .25;\n\t}\n\t20% {\n\t\topacity: .75;\n\t}\n\tto {\n\t\topacity: .25;\n\t}\n}\n\n:where([mol_view][mol_view_error=\"$mol_promise_blocker\"]),\n:where([mol_view][mol_view_error=\"Promise\"]) {\n\tbackground: var(--mol_theme_hover);\n}\n\n[mol_view][mol_view_error=\"Promise\"] {\n\tanimation: mol_view_wait 1s steps(20,end) infinite;\n}\n");
4225
+ $mol_style_attach("mol/view/view/view.css", "[mol_view] {\n\ttransition-property: height, width, min-height, min-width, max-width, max-height, transform;\n\ttransition-duration: .2s;\n\ttransition-timing-function: ease-out;\n\t-webkit-appearance: none;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\tflex-shrink: 0;\n\tcontain: style;\n\tscrollbar-color: var(--mol_theme_line) transparent;\n\tscrollbar-width: thin;\n}\t\n\n[mol_view]::selection {\n\tbackground: var(--mol_theme_line);\n}\t\n\n[mol_view]::-webkit-scrollbar {\n\twidth: .25rem;\n\theight: .25rem;\n}\n\n[mol_view]::-webkit-scrollbar-corner {\n\tbackground-color: var(--mol_theme_line);\n}\n\n[mol_view]::-webkit-scrollbar-track {\n\tbackground-color: transparent;\n}\n\n[mol_view]::-webkit-scrollbar-thumb {\n\tbackground-color: var(--mol_theme_line);\n\tborder-radius: var(--mol_gap_round);\n}\n\n[mol_view] > * {\n\tword-break: inherit;\n}\n\n[mol_view_root] {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbox-sizing: border-box;\n\tfont-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n\tfont-size: 1rem;\n\tline-height: 1.5rem;\n\t/* background: var(--mol_theme_back);\n\tcolor: var(--mol_theme_text); */\n\tcontain: unset; /** Fixes bg ignoring when applied to body on Chrome */\n\ttab-size: 4;\n\toverscroll-behavior: contain; /** Disable navigation gestures **/\n}\n\n@media print {\n\t[mol_view_root] {\n\t\theight: auto;\n\t}\n}\n[mol_view][mol_view_error]:not([mol_view_error=\"Promise\"], [mol_view_error=\"$mol_promise_blocker\"]) {\n\tbackground-image: repeating-linear-gradient(\n\t\t-45deg,\n\t\t#f92323,\n\t\t#f92323 .5rem,\n\t\t#ff3d3d .5rem,\n\t\t#ff3d3d 1.5rem\n\t);\n\tcolor: black;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n@keyframes mol_view_wait {\n\tfrom {\n\t\topacity: .25;\n\t}\n\t20% {\n\t\topacity: .75;\n\t}\n\tto {\n\t\topacity: .25;\n\t}\n}\n\n:where([mol_view][mol_view_error=\"$mol_promise_blocker\"]),\n:where([mol_view][mol_view_error=\"Promise\"]) {\n\tbackground: var(--mol_theme_hover);\n}\n\n[mol_view][mol_view_error=\"Promise\"] {\n\tanimation: mol_view_wait 1s steps(20,end) infinite;\n}\n");
3224
4226
  })($ || ($ = {}));
3225
4227
 
3226
4228
  ;
@@ -4599,13 +5601,6 @@ var $;
4599
5601
  ($mol_mem(($.$mol_plot_pane.prototype), "dimensions_viewport"));
4600
5602
 
4601
5603
 
4602
- ;
4603
- "use strict";
4604
- var $;
4605
- (function ($) {
4606
- $.$mol_mem_cached = $mol_wire_probe;
4607
- })($ || ($ = {}));
4608
-
4609
5604
  ;
4610
5605
  ($.$mol_svg_group) = class $mol_svg_group extends ($.$mol_svg) {
4611
5606
  dom_name(){