@shgysk8zer0/importmap 1.8.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -7,124 +7,7 @@ var yaml_js = require('@shgysk8zer0/npm-utils/yaml.js');
7
7
  var json_js = require('@shgysk8zer0/npm-utils/json.js');
8
8
  var path_js = require('@shgysk8zer0/npm-utils/path.js');
9
9
 
10
- const imports$1 = {
11
- "@node/": "/node_modules/",
12
- "@shgysk8zer0/kazoo/": "https://unpkg.com/@shgysk8zer0/kazoo@1.0.11/",
13
- "@shgysk8zer0/konami": "https://unpkg.com/@shgysk8zer0/konami@1.1.2/konami.js",
14
- "@shgysk8zer0/polyfills": "https://unpkg.com/@shgysk8zer0/polyfills@0.6.2/browser.min.js",
15
- "@shgysk8zer0/polyfills/": "https://unpkg.com/@shgysk8zer0/polyfills@0.6.2/",
16
- "@shgysk8zer0/jwk-utils": "https://unpkg.com/@shgysk8zer0/jwk-utils@1.0.20/jwk-utils.min.js",
17
- "@shgysk8zer0/jwk-utils/": "https://unpkg.com/@shgysk8zer0/jwk-utils@1.0.20/",
18
- "@shgysk8zer0/jswaggersheets": "https://unpkg.com/@shgysk8zer0/jswaggersheets@1.1.0/swagger.js",
19
- "@shgysk8zer0/jswaggersheets/": "https://unpkg.com/@shgysk8zer0/jswaggersheets@1.1.0/",
20
- "@shgysk8zer0/jss/": "https://unpkg.com/@shgysk8zer0/jss@1.0.1/",
21
- "@shgysk8zer0/consts/": "https://unpkg.com/@shgysk8zer0/consts@1.0.8/",
22
- "@shgysk8zer0/http/": "https://unpkg.com/@shgysk8zer0/http@1.0.5/",
23
- "@shgysk8zer0/http-status": "https://unpkg.com/@shgysk8zer0/http-status@1.1.4/http-status.js",
24
- "@shgysk8zer0/aes-gcm": "https://unpkg.com/@shgysk8zer0/aes-gcm@1.0.8/aes-gcm.min.js",
25
- "@shgysk8zer0/aes-gcm/": "https://unpkg.com/@shgysk8zer0/aes-gcm@1.0.8/",
26
- "@shgysk8zer0/squish": "https://unpkg.com/@shgysk8zer0/squish@1.0.2/squish.min.js",
27
- "@shgysk8zer0/squish/": "https://unpkg.com/@shgysk8zer0/squish@1.0.2/",
28
- "@shgysk8zer0/suid": "https://unpkg.com/@shgysk8zer0/suid@1.0.0/suid.min.js",
29
- "@shgysk8zer0/suid/": "https://unpkg.com/@shgysk8zer0/suid@1.0.0/",
30
- "@shgysk8zer0/geoutils": "https://unpkg.com/@shgysk8zer0/geoutils@1.0.6/geoutils.min.js",
31
- "@shgysk8zer0/geoutils/": "https://unpkg.com/@shgysk8zer0/geoutils@1.0.6/",
32
- "@shgysk8zer0/core-css/": "https://unpkg.com/@shgysk8zer0/core-css@2.5.4/",
33
- "@shgysk8zer0/signals": "https://unpkg.com/@shgysk8zer0/signals@0.0.3/signals.min.js",
34
- "@shgysk8zer0/signals/": "https://unpkg.com/@shgysk8zer0/signals@0.0.3/",
35
- "@aegisjsproject/trusted-types": "https://unpkg.com/@aegisjsproject/trusted-types@1.0.2/bundle.min.js",
36
- "@aegisjsproject/trusted-types/": "https://unpkg.com/@aegisjsproject/trusted-types@1.0.2/",
37
- "@aegisjsproject/parsers": "https://unpkg.com/@aegisjsproject/parsers@0.1.5/bundle.min.js",
38
- "@aegisjsproject/parsers/": "https://unpkg.com/@aegisjsproject/parsers@0.1.5/",
39
- "@aegisjsproject/sanitizer": "https://unpkg.com/@aegisjsproject/sanitizer@0.2.4/sanitizer.js",
40
- "@aegisjsproject/sanitizer/": "https://unpkg.com/@aegisjsproject/sanitizer@0.2.4/",
41
- "@aegisjsproject/core": "https://unpkg.com/@aegisjsproject/core@0.2.33/core.js",
42
- "@aegisjsproject/core/": "https://unpkg.com/@aegisjsproject/core@0.2.33/",
43
- "@aegisjsproject/styles": "https://unpkg.com/@aegisjsproject/styles@0.2.7/styles.js",
44
- "@aegisjsproject/styles/": "https://unpkg.com/@aegisjsproject/styles@0.2.7/",
45
- "@aegisjsproject/component": "https://unpkg.com/@aegisjsproject/component@0.1.7/component.js",
46
- "@aegisjsproject/component/": "https://unpkg.com/@aegisjsproject/component@0.1.7/",
47
- "@aegisjsproject/markdown": "https://unpkg.com/@aegisjsproject/markdown@0.1.6/markdown.min.js",
48
- "@aegisjsproject/markdown/": "https://unpkg.com/@aegisjsproject/markdown@0.1.6/",
49
- "@aegisjsproject/aegis-md": "https://unpkg.com/@aegisjsproject/aegis-md@0.0.4/aegis-md.js",
50
- "@aegisjsproject/aegis-md/": "https://unpkg.com/@aegisjsproject/aegis-md@0.0.4/",
51
- "@aegisjsproject/url": "https://unpkg.com/@aegisjsproject/url@1.0.3/url.min.js",
52
- "@aegisjsproject/url/": "https://unpkg.com/@aegisjsproject/url@1.0.3/",
53
- "@aegisjsproject/idb/": "https://unpkg.com/@aegisjsproject/idb@1.0.6/",
54
- "@aegisjsproject/idb": "https://unpkg.com/@aegisjsproject/idb@1.0.6/idb.min.js",
55
- "@aegisjsproject/otp/": "https://unpkg.com/@aegisjsproject/otp@1.0.1/",
56
- "@aegisjsproject/otp": "https://unpkg.com/@aegisjsproject/otp@1.0.1/otp.min.js",
57
- "@aegisjsproject/md-editor": "https://unpkg.com/@aegisjsproject/md-editor@1.0.0/md-editor.js",
58
- "@aegisjsproject/md-editor/": "https://unpkg.com/@aegisjsproject/md-editor@1.0.0/",
59
- "@aegisjsproject/barcodescanner": "https://unpkg.com/@aegisjsproject/barcodescanner@1.2.3/scanner.min.js",
60
- "@aegisjsproject/barcodescanner/": "https://unpkg.com/@aegisjsproject/barcodescanner@1.2.3/",
61
- "@shgysk8zer0/components/": "https://unpkg.com/@shgysk8zer0/components@0.3.22/",
62
- "@aegisjsproject/state": "https://unpkg.com/@aegisjsproject/state@1.0.7/state.mjs",
63
- "@aegisjsproject/state/": "https://unpkg.com/@aegisjsproject/state@1.0.7/",
64
- "@aegisjsproject/router": "https://unpkg.com/@aegisjsproject/router@1.1.15/router.mjs",
65
- "@aegisjsproject/router/": "https://unpkg.com/@aegisjsproject/router@1.1.15/",
66
- "@aegisjsproject/callback-registry": "https://unpkg.com/@aegisjsproject/callback-registry@2.0.0/callbackRegistry.js",
67
- "@aegisjsproject/callback-registry/": "https://unpkg.com/@aegisjsproject/callback-registry@2.0.0/",
68
- "@aegisjsproject/attempt": "https://unpkg.com/@aegisjsproject/attempt@1.0.7/attempt.js",
69
- "@aegisjsproject/attempt/": "https://unpkg.com/@aegisjsproject/attempt@1.0.7/",
70
- "@aegisjsproject/secret-store": "https://unpkg.com/@aegisjsproject/secret-store@1.0.1/commands.min.js",
71
- "@aegisjsproject/commands/": "https://unpkg.com/@aegisjsproject/commands@1.0.1/",
72
- "@aegisjsproject/commands": "https://unpkg.com/@aegisjsproject/commands@1.0.1/commands.min.js",
73
- "@aegisjsproject/firebase-account-routes": "https://unpkg.com/@aegisjsproject/firebase-account-routes@0.0.5/main.js",
74
- "@aegisjsproject/firebase-account-routes/": "https://unpkg.com/@aegisjsproject/firebase-account-routes@0.0.5/",
75
- "@aegisjsproject/secret-store/": "https://unpkg.com/@aegisjsproject/secret-store@1.0.1/",
76
- "@aegisjsproject/qr-encoder": "https://unpkg.com/@aegisjsproject/qr-encoder@1.0.1/index.min.js",
77
- "@aegisjsproject/qr-encoder/": "https://unpkg.com/@aegisjsproject/qr-encoder@1.0.1/",
78
- "@aegisjsproject/escape": "https://unpkg.com/@aegisjsproject/escape@1.0.4/index.min.js",
79
- "@aegisjsproject/escape/": "https://unpkg.com/@aegisjsproject/escape@1.0.4/",
80
- "@aegisjsproject/disposable": "https://unpkg.com/@aegisjsproject/disposable@1.0.3/disposable.min.js",
81
- "@aegisjsproject/disposable/": "https://unpkg.com/@aegisjsproject/disposable@1.0.3/",
82
- "@kernvalley/components/": "https://unpkg.com/@kernvalley/components@2.0.9/",
83
- "@webcomponents/custom-elements": "https://unpkg.com/@webcomponents/custom-elements@1.6.0/custom-elements.min.js",
84
- leaflet: "https://unpkg.com/leaflet@1.9.4/dist/leaflet-src.esm.js",
85
- "leaflet/": "https://unpkg.com/leaflet@1.9.4/dist/",
86
- "urlpattern-polyfill": "https://unpkg.com/urlpattern-polyfill@10.1.0/index.js",
87
- "highlight.js": "https://unpkg.com/@highlightjs/cdn-assets@11.11.1/es/core.min.js",
88
- "highlight.js/": "https://unpkg.com/@highlightjs/cdn-assets@11.11.1/es/",
89
- "highlight.js/styles/": "https://unpkg.com/@highlightjs/cdn-assets@11.11.1/styles/",
90
- "@highlightjs/cdn-assets": "https://unpkg.com/@highlightjs/cdn-assets@11.11.1/es/core.min.js",
91
- "@highlightjs/cdn-assets/": "https://unpkg.com/@highlightjs/cdn-assets@11.11.1/es/",
92
- "@highlightjs/cdn-assets/styles/": "https://unpkg.com/@highlightjs/cdn-assets@11.11.1/styles/",
93
- marked: "https://unpkg.com/marked@17.0.3/lib/marked.esm.js",
94
- "marked-highlight": "https://unpkg.com/marked-highlight@2.2.3/src/index.js",
95
- yaml: "https://unpkg.com/yaml@2.8.2/browser/dist/index.js",
96
- "yaml/": "https://unpkg.com/yaml@2.8.2/browser/dist/",
97
- "firebase/": "https://www.gstatic.com/firebasejs/10.12.1/",
98
- "firebase/app": "https://www.gstatic.com/firebasejs/10.12.1/firebase-app.js",
99
- "firebase/app-check": "https://www.gstatic.com/firebasejs/10.12.1/firebase-app-check.js",
100
- "firebase/auth": "https://www.gstatic.com/firebasejs/10.12.1/firebase-auth.js",
101
- "firebase/database": "https://www.gstatic.com/firebasejs/10.12.1/firebase-database.js",
102
- "firebase/firestore": "https://www.gstatic.com/firebasejs/10.12.1/firebase-firestore.js",
103
- "firebase/functions": "https://www.gstatic.com/firebasejs/10.12.1/firebase-functions.js",
104
- "firebase/messaging": "https://www.gstatic.com/firebasejs/10.12.1/firebase-messaging.js",
105
- "firebase/performance": "https://www.gstatic.com/firebasejs/10.12.1/firebase-performance.js",
106
- "firebase/remote-config": "https://www.gstatic.com/firebasejs/10.12.1/firebase-remote-config.js",
107
- "firebase/storage": "https://www.gstatic.com/firebasejs/10.12.1/firebase-storage.js",
108
- "firebase/analytics": "https://www.gstatic.com/firebasejs/10.12.1/firebase-analytics.js",
109
- qr: "https://unpkg.com/qr@0.5.4/index.js",
110
- "qr/": "https://unpkg.com/qr@0.5.4/",
111
- lit: "https://unpkg.com/lit@3.3.2/index.js",
112
- "lit/": "https://unpkg.com/lit@3.3.2/",
113
- "lit-html": "https://unpkg.com/lit-html@3.3.2/lit-html.js",
114
- "lit-html/": "https://unpkg.com/lit-html@3.3.2/",
115
- "lit-element": "https://unpkg.com/lit-element@4.2.2/lit-element.js",
116
- "lit-element/": "https://unpkg.com/lit-element@4.2.2/",
117
- "@lit/reactive-element": "https://unpkg.com/@lit/reactive-element@2.1.2/reactive-element.js",
118
- "@lit/reactive-element/": "https://unpkg.com/@lit/reactive-element@2.1.2/",
119
- "@awesome.me/webawesome/": "https://unpkg.com/@awesome.me/webawesome@3.2.1/",
120
- "normalize.css": "https://unpkg.com/normalize.css@8.0.1/normalize.css"
121
- };
122
- const scopes$1 = {
123
- };
124
- var json = {
125
- imports: imports$1,
126
- scopes: scopes$1
127
- };
10
+ var json = JSON.parse('{\n "imports": {\n "@node/": "/node_modules/",\n "@shgysk8zer0/kazoo/": "https://unpkg.com/@shgysk8zer0/kazoo@1.0.11/",\n "@shgysk8zer0/konami": "https://unpkg.com/@shgysk8zer0/konami@1.1.2/konami.js",\n "@shgysk8zer0/polyfills": "https://unpkg.com/@shgysk8zer0/polyfills@0.6.2/browser.min.js",\n "@shgysk8zer0/polyfills/": "https://unpkg.com/@shgysk8zer0/polyfills@0.6.2/",\n "@shgysk8zer0/jwk-utils": "https://unpkg.com/@shgysk8zer0/jwk-utils@1.0.20/jwk-utils.min.js",\n "@shgysk8zer0/jwk-utils/": "https://unpkg.com/@shgysk8zer0/jwk-utils@1.0.20/",\n "@shgysk8zer0/jswaggersheets": "https://unpkg.com/@shgysk8zer0/jswaggersheets@1.1.0/swagger.js",\n "@shgysk8zer0/jswaggersheets/": "https://unpkg.com/@shgysk8zer0/jswaggersheets@1.1.0/",\n "@shgysk8zer0/jss/": "https://unpkg.com/@shgysk8zer0/jss@1.0.1/",\n "@shgysk8zer0/consts/": "https://unpkg.com/@shgysk8zer0/consts@1.0.8/",\n "@shgysk8zer0/http/": "https://unpkg.com/@shgysk8zer0/http@1.0.5/",\n "@shgysk8zer0/http-status": "https://unpkg.com/@shgysk8zer0/http-status@1.1.4/http-status.js",\n "@shgysk8zer0/aes-gcm": "https://unpkg.com/@shgysk8zer0/aes-gcm@1.0.8/aes-gcm.min.js",\n "@shgysk8zer0/aes-gcm/": "https://unpkg.com/@shgysk8zer0/aes-gcm@1.0.8/",\n "@shgysk8zer0/squish": "https://unpkg.com/@shgysk8zer0/squish@1.0.2/squish.min.js",\n "@shgysk8zer0/squish/": "https://unpkg.com/@shgysk8zer0/squish@1.0.2/",\n "@shgysk8zer0/suid": "https://unpkg.com/@shgysk8zer0/suid@1.0.0/suid.min.js",\n "@shgysk8zer0/suid/": "https://unpkg.com/@shgysk8zer0/suid@1.0.0/",\n "@shgysk8zer0/geoutils": "https://unpkg.com/@shgysk8zer0/geoutils@1.0.6/geoutils.min.js",\n "@shgysk8zer0/geoutils/": "https://unpkg.com/@shgysk8zer0/geoutils@1.0.6/",\n "@shgysk8zer0/core-css/": "https://unpkg.com/@shgysk8zer0/core-css@2.5.5/",\n "@shgysk8zer0/signals": "https://unpkg.com/@shgysk8zer0/signals@0.0.3/signals.min.js",\n "@shgysk8zer0/signals/": "https://unpkg.com/@shgysk8zer0/signals@0.0.3/",\n "@aegisjsproject/trusted-types": "https://unpkg.com/@aegisjsproject/trusted-types@1.0.2/bundle.min.js",\n "@aegisjsproject/trusted-types/": "https://unpkg.com/@aegisjsproject/trusted-types@1.0.2/",\n "@aegisjsproject/parsers": "https://unpkg.com/@aegisjsproject/parsers@0.1.6/bundle.min.js",\n "@aegisjsproject/parsers/": "https://unpkg.com/@aegisjsproject/parsers@0.1.6/",\n "@aegisjsproject/sanitizer": "https://unpkg.com/@aegisjsproject/sanitizer@0.2.4/sanitizer.js",\n "@aegisjsproject/sanitizer/": "https://unpkg.com/@aegisjsproject/sanitizer@0.2.4/",\n "@aegisjsproject/core": "https://unpkg.com/@aegisjsproject/core@0.2.34/core.js",\n "@aegisjsproject/core/": "https://unpkg.com/@aegisjsproject/core@0.2.34/",\n "@aegisjsproject/styles": "https://unpkg.com/@aegisjsproject/styles@0.2.7/styles.js",\n "@aegisjsproject/styles/": "https://unpkg.com/@aegisjsproject/styles@0.2.7/",\n "@aegisjsproject/component": "https://unpkg.com/@aegisjsproject/component@0.1.7/component.js",\n "@aegisjsproject/component/": "https://unpkg.com/@aegisjsproject/component@0.1.7/",\n "@aegisjsproject/markdown": "https://unpkg.com/@aegisjsproject/markdown@0.1.6/markdown.min.js",\n "@aegisjsproject/markdown/": "https://unpkg.com/@aegisjsproject/markdown@0.1.6/",\n "@aegisjsproject/aegis-md": "https://unpkg.com/@aegisjsproject/aegis-md@0.0.4/aegis-md.js",\n "@aegisjsproject/aegis-md/": "https://unpkg.com/@aegisjsproject/aegis-md@0.0.4/",\n "@aegisjsproject/url": "https://unpkg.com/@aegisjsproject/url@1.0.3/url.min.js",\n "@aegisjsproject/url/": "https://unpkg.com/@aegisjsproject/url@1.0.3/",\n "@aegisjsproject/idb/": "https://unpkg.com/@aegisjsproject/idb@1.0.6/",\n "@aegisjsproject/idb": "https://unpkg.com/@aegisjsproject/idb@1.0.6/idb.min.js",\n "@aegisjsproject/otp/": "https://unpkg.com/@aegisjsproject/otp@1.0.1/",\n "@aegisjsproject/otp": "https://unpkg.com/@aegisjsproject/otp@1.0.1/otp.min.js",\n "@aegisjsproject/md-editor": "https://unpkg.com/@aegisjsproject/md-editor@1.0.0/md-editor.js",\n "@aegisjsproject/md-editor/": "https://unpkg.com/@aegisjsproject/md-editor@1.0.0/",\n "@aegisjsproject/barcodescanner": "https://unpkg.com/@aegisjsproject/barcodescanner@1.2.3/scanner.min.js",\n "@aegisjsproject/barcodescanner/": "https://unpkg.com/@aegisjsproject/barcodescanner@1.2.3/",\n "@shgysk8zer0/components/": "https://unpkg.com/@shgysk8zer0/components@0.3.22/",\n "@aegisjsproject/state": "https://unpkg.com/@aegisjsproject/state@1.0.7/state.mjs",\n "@aegisjsproject/state/": "https://unpkg.com/@aegisjsproject/state@1.0.7/",\n "@aegisjsproject/router": "https://unpkg.com/@aegisjsproject/router@1.1.15/router.mjs",\n "@aegisjsproject/router/": "https://unpkg.com/@aegisjsproject/router@1.1.15/",\n "@aegisjsproject/callback-registry": "https://unpkg.com/@aegisjsproject/callback-registry@2.0.2/callbackRegistry.js",\n "@aegisjsproject/callback-registry/": "https://unpkg.com/@aegisjsproject/callback-registry@2.0.2/",\n "@aegisjsproject/attempt": "https://unpkg.com/@aegisjsproject/attempt@1.0.7/attempt.js",\n "@aegisjsproject/attempt/": "https://unpkg.com/@aegisjsproject/attempt@1.0.7/",\n "@aegisjsproject/secret-store": "https://unpkg.com/@aegisjsproject/secret-store@1.0.1/commands.min.js",\n "@aegisjsproject/commands/": "https://unpkg.com/@aegisjsproject/commands@1.0.2/",\n "@aegisjsproject/commands": "https://unpkg.com/@aegisjsproject/commands@1.0.2/commands.min.js",\n "@aegisjsproject/firebase-account-routes": "https://unpkg.com/@aegisjsproject/firebase-account-routes@0.0.5/main.js",\n "@aegisjsproject/firebase-account-routes/": "https://unpkg.com/@aegisjsproject/firebase-account-routes@0.0.5/",\n "@aegisjsproject/secret-store/": "https://unpkg.com/@aegisjsproject/secret-store@1.0.1/",\n "@aegisjsproject/qr-encoder": "https://unpkg.com/@aegisjsproject/qr-encoder@1.0.1/index.min.js",\n "@aegisjsproject/qr-encoder/": "https://unpkg.com/@aegisjsproject/qr-encoder@1.0.1/",\n "@aegisjsproject/escape": "https://unpkg.com/@aegisjsproject/escape@1.0.4/index.min.js",\n "@aegisjsproject/escape/": "https://unpkg.com/@aegisjsproject/escape@1.0.4/",\n "@aegisjsproject/disposable": "https://unpkg.com/@aegisjsproject/disposable@1.0.3/disposable.min.js",\n "@aegisjsproject/disposable/": "https://unpkg.com/@aegisjsproject/disposable@1.0.3/",\n "@aegisjsproject/iota": "https://unpkg.com/@aegisjsproject/iota@1.0.2/iota.min.js",\n "@aegisjsproject/iota/": "https://unpkg.com/@aegisjsproject/iota@1.0.2/",\n "@kernvalley/components/": "https://unpkg.com/@kernvalley/components@2.0.9/",\n "@webcomponents/custom-elements": "https://unpkg.com/@webcomponents/custom-elements@1.6.0/custom-elements.min.js",\n "leaflet": "https://unpkg.com/leaflet@1.9.4/dist/leaflet-src.esm.js",\n "leaflet/": "https://unpkg.com/leaflet@1.9.4/dist/",\n "urlpattern-polyfill": "https://unpkg.com/urlpattern-polyfill@10.1.0/index.js",\n "highlight.js": "https://unpkg.com/@highlightjs/cdn-assets@11.11.1/es/core.min.js",\n "highlight.js/": "https://unpkg.com/@highlightjs/cdn-assets@11.11.1/es/",\n "highlight.js/styles/": "https://unpkg.com/@highlightjs/cdn-assets@11.11.1/styles/",\n "@highlightjs/cdn-assets": "https://unpkg.com/@highlightjs/cdn-assets@11.11.1/es/core.min.js",\n "@highlightjs/cdn-assets/": "https://unpkg.com/@highlightjs/cdn-assets@11.11.1/es/",\n "@highlightjs/cdn-assets/styles/": "https://unpkg.com/@highlightjs/cdn-assets@11.11.1/styles/",\n "marked": "https://unpkg.com/marked@17.0.4/lib/marked.esm.js",\n "marked-highlight": "https://unpkg.com/marked-highlight@2.2.3/src/index.js",\n "yaml": "https://unpkg.com/yaml@2.8.2/browser/dist/index.js",\n "yaml/": "https://unpkg.com/yaml@2.8.2/browser/dist/",\n "firebase/": "https://www.gstatic.com/firebasejs/10.12.1/",\n "firebase/app": "https://www.gstatic.com/firebasejs/10.12.1/firebase-app.js",\n "firebase/app-check": "https://www.gstatic.com/firebasejs/10.12.1/firebase-app-check.js",\n "firebase/auth": "https://www.gstatic.com/firebasejs/10.12.1/firebase-auth.js",\n "firebase/database": "https://www.gstatic.com/firebasejs/10.12.1/firebase-database.js",\n "firebase/firestore": "https://www.gstatic.com/firebasejs/10.12.1/firebase-firestore.js",\n "firebase/functions": "https://www.gstatic.com/firebasejs/10.12.1/firebase-functions.js",\n "firebase/messaging": "https://www.gstatic.com/firebasejs/10.12.1/firebase-messaging.js",\n "firebase/performance": "https://www.gstatic.com/firebasejs/10.12.1/firebase-performance.js",\n "firebase/remote-config": "https://www.gstatic.com/firebasejs/10.12.1/firebase-remote-config.js",\n "firebase/storage": "https://www.gstatic.com/firebasejs/10.12.1/firebase-storage.js",\n "firebase/analytics": "https://www.gstatic.com/firebasejs/10.12.1/firebase-analytics.js",\n "qr": "https://unpkg.com/qr@0.5.5/index.js",\n "qr/": "https://unpkg.com/qr@0.5.5/",\n "lit": "https://unpkg.com/lit@3.3.2/index.js",\n "lit/": "https://unpkg.com/lit@3.3.2/",\n "lit-html": "https://unpkg.com/lit-html@3.3.2/lit-html.js",\n "lit-html/": "https://unpkg.com/lit-html@3.3.2/",\n "lit-element": "https://unpkg.com/lit-element@4.2.2/lit-element.js",\n "lit-element/": "https://unpkg.com/lit-element@4.2.2/",\n "@lit/reactive-element": "https://unpkg.com/@lit/reactive-element@2.1.2/reactive-element.js",\n "@lit/reactive-element/": "https://unpkg.com/@lit/reactive-element@2.1.2/",\n "@awesome.me/webawesome/": "https://unpkg.com/@awesome.me/webawesome@3.3.1/",\n "normalize.css": "https://unpkg.com/normalize.css@8.0.1/normalize.css"\n },\n "scopes": {}\n}');
128
11
 
129
12
  const SHA256 = 'SHA-256';
130
13
  const SHA384 = 'SHA-384';
@@ -334,6 +217,9 @@ class Importmap {
334
217
 
335
218
  const importmap = new Importmap({ imports, scopes });
336
219
 
220
+ // export const IMPORTMAP_EXP = /<script\b(?=[^>]*\btype=["']importmap["'])(?:[^>]*?\bnonce=["'](?<nonce>[^"']*)["'])?[^>]*>[\s\S]*?<\/script>/i;
221
+ const IMPORTMAP_EXP = /<script\b(?=[^>]*\btype=["']importmap["'])(?:[^>]*?\bnonce=["'](?<nonce>[^"']*)["'])?[^>]*>(?<content>[\s\S]*?)<\/script>/i;
222
+
337
223
  const UNPKG = 'https://unpkg.com/';
338
224
 
339
225
  const cache = new Map();
@@ -451,43 +337,135 @@ async function updateJSON(file) {
451
337
  }
452
338
 
453
339
  var unpkg = /*#__PURE__*/Object.freeze({
454
- __proto__: null,
455
- update: update,
456
- updateJSON: updateJSON,
457
- updateUnpkg: updateUnpkg,
458
- updateYAML: updateYAML
340
+ __proto__: null,
341
+ update: update,
342
+ updateJSON: updateJSON,
343
+ updateUnpkg: updateUnpkg,
344
+ updateYAML: updateYAML
459
345
  });
460
346
 
347
+ /**
348
+ * @typedef {Object<string, string>} ImportMapSpecifiers
349
+ */
350
+
351
+ /**
352
+ * @typedef {Object} ImportMap
353
+ * @property {ImportMapSpecifiers} [imports]
354
+ * @property {Object<string, ImportMapSpecifiers>} [scopes]
355
+ */
356
+
357
+ /**
358
+ * @typedef {((this: any, key: string, value: any) => any) | (number | string)[] | null} JSONReplacer
359
+ * @typedef {string | number | null} JSONSpace
360
+ */
361
+
461
362
  const ENCODING = 'utf8';
462
363
 
364
+ /**
365
+ *
366
+ * @param {ImportMap} importmap
367
+ * @returns {ImportMap}
368
+ */
463
369
  function mergeWithImportmap({ imports = {}, scopes = {}}) {
464
370
  return {
465
371
  imports: { ...importmap.imports, ...imports },
466
- scopes: { ...importmap.scope, ...scopes },
372
+ scopes: { ...importmap.scopes, ...scopes },
467
373
  };
468
374
  }
469
375
 
376
+ /**
377
+ * @async
378
+ * @param {string} path
379
+ * @param {object} options
380
+ * @param {ImportMap} [options.importmap]
381
+ * @param {JSONReplacer} [options.replacer=null]
382
+ * @param {JSONSpace} [options.spaces=2]
383
+ * @param {AbortSignal} [options.signal]
384
+ */
470
385
  async function createImportmapJSON(path = 'importmap.json', {
471
386
  importmap = { imports, scopes },
387
+ replacer = null,
472
388
  spaces = 2,
473
389
  signal,
474
390
  } = {}) {
475
- await promises.writeFile(path, JSON.stringify(importmap, null, spaces), { encoding: ENCODING, signal });
391
+ await promises.writeFile(path, JSON.stringify(importmap, replacer, spaces), { encoding: ENCODING, signal });
476
392
  }
477
393
 
394
+ /**
395
+ *
396
+ * @param {object} options
397
+ * @param {ImportMap} [options.importmap]
398
+ * @param {HashAlgorithmIdentifier} [options.algo="SHA-384"]
399
+ * @param {JSONReplacer} [options.replacer=null]
400
+ * @param {JSONSpace} [options.spaces]
401
+ * @param {AbortSignal} [options.signal]
402
+ * @returns {Promise<string>}
403
+ */
478
404
  async function getImportmapIntegrity({
479
405
  importmap = { imports, scopes },
480
406
  algo = DEFAULT_ALGO,
407
+ replacer,
408
+ spaces,
481
409
  } = {}) {
482
- return await sri(JSON.stringify(importmap), { algo });
410
+ return await sri(JSON.stringify(importmap, replacer, spaces), { algo });
483
411
  }
484
412
 
413
+ /**
414
+ *
415
+ * @param {object} options
416
+ * @param {ImportMap} [options.importmap]
417
+ * @param {HashAlgorithmIdentifier} [options.algo="SHA-384"]
418
+ * @param {string} [options.nonce]
419
+ * @param {JSONReplacer} [options.replacer=null]
420
+ * @param {JSONSpace} [options.spaces]
421
+ * @param {AbortSignal} [options.signal]
422
+ * @returns {Promise<string>}
423
+ */
485
424
  async function getImportmapScript({
486
425
  importmap = { imports, scopes },
487
426
  algo = DEFAULT_ALGO,
427
+ nonce = null,
428
+ replacer,
429
+ spaces,
488
430
  } = {}) {
489
- const integrity = await getImportmapIntegrity({ importmap, algo });
490
- return `<script type="importmap" integrity="${integrity}">${JSON.stringify(importmap)}</script>`;
431
+ const integrity = await getImportmapIntegrity({ importmap, algo, replacer, spaces });
432
+
433
+ return typeof nonce === 'string' && nonce.length !== 0
434
+ ? `<script type="importmap" integrity="${integrity}" nonce="${nonce}">${JSON.stringify(importmap, replacer, spaces)}</script>`
435
+ : `<script type="importmap" integrity="${integrity}">${JSON.stringify(importmap, replacer, spaces)}</script>`;
436
+ }
437
+
438
+ /**
439
+ * Updates a `<script type="importmap" from an HTML file, writing the updated file back to disk
440
+ *
441
+ * @param {string} fileName The name of the file to update
442
+ * @param {object} options
443
+ * @param {HashAlgorithmIdentifier} [options.algo="SHA-384"] The algorithm to use for the `integrity` hash
444
+ * @param {ImportMap} [options.importmap] Optional source immportmap object, defaults to library defined importmap
445
+ * @param {JSONReplacer} [options.replacer]
446
+ * @param {JSONSpace} [options.spaces]
447
+ * @param {AbortSignal} [options.signal] Optional `AbortSignal` to abort during the read/write of the file
448
+ * @returns {Promise<boolean>} Whether or not the upate was successful
449
+ */
450
+ async function updateImportmap(fileName = 'index.html', {
451
+ algo = 'SHA-384',
452
+ importmap,
453
+ replacer,
454
+ spaces,
455
+ signal,
456
+ } = {}) {
457
+ signal?.throwIfAborted();
458
+ const file = await promises.readFile(fileName, { encoding: 'utf-8', signal });
459
+ const match = IMPORTMAP_EXP.exec(file);
460
+
461
+ if (Array.isArray(match) && typeof match[0] === 'string') {
462
+ const script = await getImportmapScript({ nonce: match.groups?.nonce, algo, importmap, replacer, spaces });
463
+ await promises.writeFile(fileName, file.replace(match[0], script), { signal });
464
+
465
+ return true;
466
+ } else {
467
+ return false;
468
+ }
491
469
  }
492
470
 
493
471
  exports.ENCODING = ENCODING;
@@ -500,3 +478,4 @@ exports.imports = imports;
500
478
  exports.mergeWithImportmap = mergeWithImportmap;
501
479
  exports.scopes = scopes;
502
480
  exports.unpkg = unpkg;
481
+ exports.updateImportmap = updateImportmap;