skeleton-load 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +455 -2
  3. package/dist/cli.js +255 -0
  4. package/dist/index.cjs +1347 -0
  5. package/dist/index.cjs.map +1 -0
  6. package/dist/index.d.cts +12 -0
  7. package/dist/index.d.ts +12 -0
  8. package/dist/index.js +1338 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/next/index.cjs +425 -0
  11. package/dist/next/index.cjs.map +1 -0
  12. package/dist/next/index.d.cts +19 -0
  13. package/dist/next/index.d.ts +19 -0
  14. package/dist/next/index.js +420 -0
  15. package/dist/next/index.js.map +1 -0
  16. package/dist/plugins/vite.cjs +413 -0
  17. package/dist/plugins/vite.cjs.map +1 -0
  18. package/dist/plugins/vite.d.cts +40 -0
  19. package/dist/plugins/vite.d.ts +40 -0
  20. package/dist/plugins/vite.js +408 -0
  21. package/dist/plugins/vite.js.map +1 -0
  22. package/dist/plugins/webpack.cjs +411 -0
  23. package/dist/plugins/webpack.cjs.map +1 -0
  24. package/dist/plugins/webpack.d.cts +43 -0
  25. package/dist/plugins/webpack.d.ts +43 -0
  26. package/dist/plugins/webpack.js +406 -0
  27. package/dist/plugins/webpack.js.map +1 -0
  28. package/dist/react/index.cjs +1387 -0
  29. package/dist/react/index.cjs.map +1 -0
  30. package/dist/react/index.d.cts +48 -0
  31. package/dist/react/index.d.ts +48 -0
  32. package/dist/react/index.js +1382 -0
  33. package/dist/react/index.js.map +1 -0
  34. package/dist/singleton-D0608W4u.d.cts +74 -0
  35. package/dist/singleton-D4bvf9fp.d.ts +74 -0
  36. package/dist/skeleton-load.auto.js +328 -0
  37. package/dist/skeleton-load.css +326 -0
  38. package/dist/skeleton-load.record.js +21 -0
  39. package/dist/types-DNYMIyOJ.d.cts +73 -0
  40. package/dist/types-DNYMIyOJ.d.ts +73 -0
  41. package/dist/vanilla.cjs +1356 -0
  42. package/dist/vanilla.cjs.map +1 -0
  43. package/dist/vanilla.d.cts +23 -0
  44. package/dist/vanilla.d.ts +23 -0
  45. package/dist/vanilla.js +1353 -0
  46. package/dist/vanilla.js.map +1 -0
  47. package/dist/vue/index.cjs +1379 -0
  48. package/dist/vue/index.cjs.map +1 -0
  49. package/dist/vue/index.d.cts +145 -0
  50. package/dist/vue/index.d.ts +145 -0
  51. package/dist/vue/index.js +1373 -0
  52. package/dist/vue/index.js.map +1 -0
  53. package/package.json +104 -4
@@ -0,0 +1,420 @@
1
+ // src/core/minify.ts
2
+ function minifyCss(css) {
3
+ return css.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>])\s*/g, "$1").replace(/;}/g, "}").trim();
4
+ }
5
+
6
+ // src/core/css.generated.ts
7
+ var css_generated_default = `/*!
8
+ * skeleton-load v0.1.0 \u2014 MIT
9
+ * https://github.com/skeleton-load
10
+ */
11
+
12
+ .skl-host,
13
+ [data-skl-state] {
14
+ position: relative;
15
+ }
16
+
17
+ /* Content is kept in the layout (no CLS) but hidden while the skeleton plays. */
18
+ [data-skl-state="loading"] > *:not(.skl-overlay) {
19
+ visibility: hidden !important;
20
+ }
21
+
22
+ .skl-overlay {
23
+ position: absolute;
24
+ inset: 0;
25
+ z-index: 4;
26
+ overflow: hidden;
27
+ pointer-events: none;
28
+ border-radius: inherit;
29
+ opacity: 0;
30
+ transition: opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);
31
+ contain: layout paint style;
32
+
33
+ --skl-base: rgba(17, 20, 28, 0.1);
34
+ --skl-highlight: rgba(255, 255, 255, 0.72);
35
+ --skl-radius: 8px;
36
+ --skl-gap: 10px;
37
+ --skl-surface: #ffffff;
38
+ --skl-border: rgba(17, 20, 28, 0.08);
39
+ --skl-line: rgba(17, 20, 28, 0.08);
40
+ --skl-solid: #f1f1f6;
41
+ }
42
+
43
+ /* A dark surface needs brighter placeholders to be readable at all. */
44
+ .skl-overlay[data-skl-tone="dark"] {
45
+ --skl-base: rgba(255, 255, 255, 0.115);
46
+ --skl-highlight: rgba(255, 255, 255, 0.22);
47
+ --skl-surface: rgba(255, 255, 255, 0.035);
48
+ --skl-border: rgba(255, 255, 255, 0.07);
49
+ --skl-line: rgba(255, 255, 255, 0.07);
50
+ --skl-solid: #14161c;
51
+ }
52
+
53
+ .skl-overlay[data-skl-show="1"] {
54
+ opacity: 1;
55
+ }
56
+
57
+ /* Temporary state used to measure the skeleton's natural height. */
58
+ .skl-overlay[data-skl-measure] {
59
+ inset: auto;
60
+ top: 0;
61
+ left: 0;
62
+ opacity: 0;
63
+ }
64
+
65
+ .skl-overlay[data-skl-kind="media"] {
66
+ background: var(--skl-solid);
67
+ border-radius: var(--skl-radius);
68
+ }
69
+
70
+ /* ---------- blocks ---------- */
71
+
72
+ .skl-block {
73
+ position: relative;
74
+ min-height: 8px;
75
+ overflow: hidden;
76
+ border-radius: var(--skl-radius);
77
+ background: var(--skl-base);
78
+ }
79
+
80
+ .skl-block::after {
81
+ content: "";
82
+ position: absolute;
83
+ inset: 0;
84
+ background: linear-gradient(
85
+ 90deg,
86
+ transparent 0%,
87
+ var(--skl-highlight) 50%,
88
+ transparent 100%
89
+ );
90
+ transform: translateX(-100%);
91
+ animation: skl-shimmer var(--skl-speed, 1.6s) cubic-bezier(0.45, 0, 0.25, 1) infinite;
92
+ will-change: transform;
93
+ }
94
+
95
+ .skl-overlay[data-skl-preset="pulse"] .skl-block::after,
96
+ .skl-overlay[data-skl-preset="static"] .skl-block::after {
97
+ display: none;
98
+ }
99
+
100
+ .skl-overlay[data-skl-preset="pulse"] .skl-block {
101
+ animation: skl-pulse 1.8s ease-in-out infinite;
102
+ }
103
+
104
+ .skl-overlay[data-skl-preset="static"] .skl-block {
105
+ opacity: 0.92;
106
+ }
107
+
108
+ /* Pause everything while the tab is in the background. */
109
+ html[data-skl-idle] .skl-block::after,
110
+ html[data-skl-idle] .skl-block {
111
+ animation-play-state: paused;
112
+ }
113
+
114
+ /* ---------- layouts ---------- */
115
+
116
+ .skl-overlay[data-skl-layout="stack"] {
117
+ display: flex;
118
+ flex-direction: column;
119
+ gap: var(--skl-gap);
120
+ }
121
+
122
+ .skl-overlay[data-skl-layout="row"] {
123
+ display: flex;
124
+ flex-direction: row;
125
+ align-items: center;
126
+ gap: var(--skl-gap);
127
+ }
128
+
129
+ .skl-overlay[data-skl-layout="grid"] {
130
+ display: grid;
131
+ gap: var(--skl-gap);
132
+ grid-template-columns: repeat(var(--skl-cols, 3), minmax(0, 1fr));
133
+ }
134
+
135
+ .skl-overlay[data-skl-layout="center"] {
136
+ display: flex;
137
+ flex-direction: column;
138
+ align-items: center;
139
+ justify-content: center;
140
+ gap: var(--skl-gap);
141
+ }
142
+
143
+ .skl-overlay[data-skl-layout="mirror"] {
144
+ padding: 0;
145
+ }
146
+
147
+ .skl-overlay[data-skl-layout="mirror"] > .skl-block {
148
+ position: absolute;
149
+ min-height: 0;
150
+ }
151
+
152
+ .skl-card {
153
+ display: flex;
154
+ flex-direction: column;
155
+ gap: var(--skl-gap);
156
+ min-width: 0;
157
+ }
158
+
159
+ .skl-cell {
160
+ display: flex;
161
+ flex-direction: column;
162
+ gap: 0;
163
+ min-width: 0;
164
+ overflow: hidden;
165
+ border-radius: calc(var(--skl-radius) + 8px);
166
+ background: var(--skl-surface);
167
+ border: 1px solid var(--skl-border);
168
+ }
169
+
170
+ .skl-cell-body {
171
+ display: flex;
172
+ flex-direction: column;
173
+ gap: 8px;
174
+ padding: 16px;
175
+ }
176
+
177
+ .skl-cell-pad {
178
+ padding: 20px 18px;
179
+ }
180
+
181
+ .skl-row {
182
+ display: flex;
183
+ align-items: center;
184
+ gap: var(--skl-gap);
185
+ min-width: 0;
186
+ }
187
+
188
+ .skl-lines {
189
+ display: flex;
190
+ flex: 1 1 auto;
191
+ flex-direction: column;
192
+ gap: 8px;
193
+ min-width: 0;
194
+ }
195
+
196
+ .skl-line {
197
+ height: var(--skl-line-h, 0.72em);
198
+ min-height: 7px;
199
+ border-radius: 999px;
200
+ }
201
+
202
+ .skl-circle {
203
+ border-radius: 50%;
204
+ flex: 0 0 auto;
205
+ }
206
+
207
+ .skl-chart {
208
+ display: flex;
209
+ align-items: flex-end;
210
+ gap: var(--skl-gap);
211
+ height: 100%;
212
+ min-height: 90px;
213
+ }
214
+
215
+ .skl-chart > .skl-block {
216
+ flex: 1 1 0;
217
+ min-width: 0;
218
+ }
219
+
220
+ /* ---------- table ---------- */
221
+
222
+ .skl-table {
223
+ display: flex;
224
+ flex-direction: column;
225
+ width: 100%;
226
+ }
227
+
228
+ .skl-trow {
229
+ display: grid;
230
+ grid-template-columns: 2.2fr 1fr 1fr 0.9fr;
231
+ gap: 14px;
232
+ align-items: center;
233
+ padding: 19px 8px;
234
+ }
235
+
236
+ .skl-trow + .skl-trow {
237
+ border-top: 1px solid var(--skl-line);
238
+ }
239
+
240
+ .skl-thead {
241
+ padding-top: 2px;
242
+ padding-bottom: 12px;
243
+ }
244
+
245
+ .skl-thead .skl-line {
246
+ min-height: 8px;
247
+ }
248
+
249
+ .skl-who {
250
+ display: flex;
251
+ align-items: center;
252
+ gap: 10px;
253
+ min-width: 0;
254
+ }
255
+
256
+ /* ---------- reveal ---------- */
257
+
258
+ [data-skl-state="done"] > *:not(.skl-overlay) {
259
+ animation: skl-content-in 200ms ease both;
260
+ }
261
+
262
+ /* ---------- debug ---------- */
263
+
264
+ [data-skl-debug] .skl-block {
265
+ outline: 1px dashed rgba(255, 64, 129, 0.7);
266
+ outline-offset: -1px;
267
+ }
268
+
269
+ [data-skl-debug] .skl-overlay {
270
+ outline: 2px solid rgba(255, 64, 129, 0.9);
271
+ outline-offset: -2px;
272
+ }
273
+
274
+ /* ---------- keyframes ---------- */
275
+
276
+ @keyframes skl-shimmer {
277
+ from {
278
+ transform: translateX(-100%);
279
+ }
280
+ to {
281
+ transform: translateX(100%);
282
+ }
283
+ }
284
+
285
+ @keyframes skl-pulse {
286
+ 0%,
287
+ 100% {
288
+ opacity: 0.55;
289
+ }
290
+ 50% {
291
+ opacity: 1;
292
+ }
293
+ }
294
+
295
+ @keyframes skl-content-in {
296
+ from {
297
+ opacity: 0;
298
+ }
299
+ to {
300
+ opacity: 1;
301
+ }
302
+ }
303
+
304
+ /* ---------- preferences ---------- */
305
+
306
+ @media (prefers-reduced-motion: reduce) {
307
+ .skl-overlay {
308
+ transition: none;
309
+ }
310
+
311
+ .skl-block::after {
312
+ display: none;
313
+ }
314
+
315
+ .skl-overlay[data-skl-preset="pulse"] .skl-block,
316
+ [data-skl-state="done"] > * {
317
+ animation: none;
318
+ }
319
+ }
320
+
321
+ @media (prefers-reduced-data: reduce) {
322
+ .skl-block::after {
323
+ display: none;
324
+ }
325
+ }
326
+
327
+ @media (forced-colors: active) {
328
+ .skl-block {
329
+ background: CanvasText;
330
+ opacity: 0.25;
331
+ }
332
+ }
333
+ `;
334
+
335
+ // src/plugins/runtime.generated.ts
336
+ var runtime_generated_default = '"use strict";(()=>{var G=["shimmer","pulse","static"],oe=["auto","card","grid","list","text","table","media","avatar","chart","profile","off"],j={preset:"shimmer",theme:"auto",delay:120,minVisible:300,maxWait:5e3,autoMedia:!0,observe:!0,css:!0,nonce:"",root:null,debug:!1,respectReducedMotion:!0};function E(n,e){if(n===null||n==="")return e;let t=Number(n);return Number.isFinite(t)?t:e}function C(n={}){let e={...j};for(let t of Object.keys(n)){let i=n[t];i!==void 0&&(e[t]=i)}return G.includes(e.preset)||(e.preset=j.preset),e.delay=Math.max(0,e.delay),e.minVisible=Math.max(0,e.minVisible),e.maxWait=Math.max(0,e.maxWait),e}function w(n){return n&&G.includes(n)?n:null}function ae(n){return n==="light"||n==="dark"||n==="auto"?n:null}function le(n){if(!n)return null;let e=n.trim().toLowerCase();return e===""||e==="true"||e==="1"?"auto":oe.includes(e)?e:null}function q(n){let e=n,t=e.dataset,i=le(e.getAttribute("data-skeleton"));return{shape:i!=null?i:"auto",state:t.skeletonState==="loading"||t.skeletonState==="done"?t.skeletonState:null,preset:w(e.getAttribute("data-skeleton-preset")),lines:Math.max(1,Math.min(12,E(e.getAttribute("data-skeleton-lines"),3))),ratio:e.getAttribute("data-skeleton-ratio"),count:Math.max(1,Math.min(24,E(e.getAttribute("data-skeleton-count"),4))),cols:Math.max(1,Math.min(6,E(e.getAttribute("data-skeleton-cols"),3))),height:e.hasAttribute("data-skeleton-h")&&E(e.getAttribute("data-skeleton-h"),0)||null,radius:e.hasAttribute("data-skeleton-radius")&&E(e.getAttribute("data-skeleton-radius"),0)||null}}function T(n){let e=n;for(;e&&e!==document.documentElement;){let t=w(e.getAttribute("data-skeleton-preset"));if(t)return t;e=e.parentElement}return w(document.documentElement.getAttribute("data-skeleton-preset"))}function _(n){let e=n;for(;e;){let t=ae(e.getAttribute("data-skeleton-theme"));if(t)return t;e=e.parentElement}return null}function K(n){let e=n,t=0;for(;e&&t<64;){if(e.hasAttribute("data-skeleton-skip")||e.getAttribute("data-skeleton")==="off")return!0;e=e.parentElement,t++}return!1}function L(n){let e=n.tagName;return e==="IMG"||e==="VIDEO"||e==="IFRAME"}function O(n){let e=n.tagName;if(e==="IMG"){let t=n;return t.complete&&t.naturalWidth>0}return e==="VIDEO"?n.readyState>=2:!1}function x(n){var e;for(let t of Array.from(n.children))if(!t.classList.contains("skl-overlay"))return!0;return((e=n.textContent)!=null?e:"").trim().length>0}function X(n){return n.getAttribute("loading")==="lazy"||n.getAttribute("data-skeleton-lazy")==="true"}var P=typeof requestAnimationFrame=="function"?n=>requestAnimationFrame(n):n=>setTimeout(()=>n(Date.now()),16);function A(){return typeof performance!="undefined"?performance.now():Date.now()}function y(n,e,t){return Math.min(t,Math.max(e,n))}function H(n){var s;let e=n.borderTopLeftRadius||n.borderRadius;if(!e)return null;let t=(s=e.split(/\\s+/)[0])!=null?s:"";if(t.endsWith("%"))return null;let i=Number.parseFloat(t);return Number.isFinite(i)?i:null}function Y(n){return{"padding-top":n.paddingTop,"padding-right":n.paddingRight,"padding-bottom":n.paddingBottom,"padding-left":n.paddingLeft}}function u(n,e,t={}){let i=document.createElement(n);e&&(i.className=e);for(let s of Object.keys(t)){let r=t[s];r!==void 0&&i.style.setProperty(s,r)}return i}function h(n={},e=""){return u("div",`skl-block ${e}`.trim(),n)}function de(n){let e=n.match(/rgba?\\(([^)]+)\\)/i);if(!e||!e[1])return null;let t=e[1].split(",").map(l=>Number.parseFloat(l.trim())),[i,s,r,o]=t;if(i===void 0||s===void 0||r===void 0||o!==void 0&&o<.5)return null;let a=l=>{let c=l/255;return c<=.03928?c/12.92:((c+.055)/1.055)**2.4};return .2126*a(i)+.7152*a(s)+.0722*a(r)}function ue(n){let e=n,t=0;for(;e&&t<24;){let s="";try{s=getComputedStyle(e).backgroundColor}catch{s=""}let r=de(s);if(r!==null)return{tone:r<.42?"dark":"light",color:s};e=e.parentElement,t++}let i=typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches;return{tone:i?"dark":"light",color:i?"#0b0d12":"#ffffff"}}function p(n,e){return h({width:n,...e?{height:e}:{}},"skl-line")}function pe(n){var i;let e=u("div","skl-lines"),t=["100%","92%","97%","88%","94%","84%"];for(let s=0;s<n;s++){let r=s===n-1&&n>1;e.appendChild(p(r?"58%":(i=t[s%t.length])!=null?i:"100%"))}return e}function ce(n){var s;let e=u("div","skl-card"),t=(s=n.ratio)!=null?s:"16/10";e.appendChild(h({width:"100%","aspect-ratio":t})),e.appendChild(p("68%","0.8em"));let i=u("div","skl-lines");return i.appendChild(p("100%")),i.appendChild(p("82%")),e.appendChild(i),e.appendChild(h({width:"34%",height:"1.15em","border-radius":"999px"})),e}function he(n){var s;let e=u("div","skl-cell");e.appendChild(h({width:"100%","aspect-ratio":(s=n.ratio)!=null?s:"16/10","border-radius":"0"}));let t=u("div","skl-cell-body");t.appendChild(p("58%","0.82em")),t.appendChild(p("36%")),t.appendChild(p("92%"));let i=u("div","skl-row",{"justify-content":"space-between","margin-top":"6px"});return i.appendChild(h({width:"28%",height:"1.15em","border-radius":"999px"})),i.appendChild(h({width:"24%",height:"1.5em","border-radius":"999px"})),t.appendChild(i),e.appendChild(t),e}function U(n){let e=u("div","skl-row");n&&e.appendChild(h({width:"40px",height:"40px"},"skl-circle"));let t=u("div","skl-lines");return t.appendChild(p("62%")),t.appendChild(p("40%")),e.appendChild(t),e}function fe(n){let e=u("div","skl-table"),t=u("div","skl-trow skl-thead");for(let s of["54%","66%","58%","50%"])t.appendChild(p(s,"10px"));e.appendChild(t);let i=y(n.count,1,12);for(let s=0;s<i;s++){let r=u("div","skl-trow"),o=u("div","skl-who");o.appendChild(h({width:"30px",height:"30px","min-height":"0"},"skl-circle"));let a=u("div","skl-lines",{gap:"7px"});a.appendChild(p("86%","10px")),a.appendChild(p("52%","10px")),o.appendChild(a),r.appendChild(o),r.appendChild(p("62%","12px")),r.appendChild(p("54%","12px")),r.appendChild(p("58%","12px")),e.appendChild(r)}return e}function me(){let n=u("div","skl-chart"),e=["38%","64%","48%","86%","58%","74%","44%"];for(let t of e)n.appendChild(h({height:t,width:"100%","border-radius":"6px"}));return n}function ke(n){var i;let e=u("div","skl-lines",{width:"100%",height:"100%"}),t=(i=n.ratio)!=null?i:"16/9";return e.appendChild(h({width:"100%",height:"100%","min-height":"48px","aspect-ratio":t,"border-radius":"inherit"})),e}function ge(n){let e=n.height?`${n.height}px`:"clamp(32px, 42%, 64px)",t=u("div","skl-lines",{width:"100%",height:"100%","align-items":"center","justify-content":"center"});return t.appendChild(h({width:e,height:e,"min-height":"0"},"skl-circle")),t}function be(n){let e=u("div","skl-lines",{"align-items":"center","justify-content":"center",height:"100%",gap:"12px"}),t=n.height?`${n.height}px`:"72px";return e.appendChild(h({width:t,height:t,"min-height":"0"},"skl-circle")),e.appendChild(p("46%")),e.appendChild(p("30%")),e}function ve(n){let e=y(n.count,1,8),t=u("div","skl-lines",{width:"100%",gap:"12px"});t.appendChild(p("34%","0.85em"));for(let i=0;i<e;i++){let s=u("div","skl-cell skl-cell-pad");s.appendChild(U(!0)),t.appendChild(s)}return t}function ye(n,e,t,i){var F,W,D;let s=n,r=s.getBoundingClientRect(),o=r.left+s.clientLeft,a=r.top+s.clientTop,l=s.clientWidth||r.width,c=s.clientHeight||r.height;if(l<8||c<8)return 0;let f=[],d=(v,k)=>{for(let m of Array.from(v.children)){if(m.classList.contains("skl-overlay"))continue;let b=getComputedStyle(m);b.display==="none"||b.visibility==="hidden"||(f.push(m),k<i&&d(m,k+1))}};d(n,1);let g=0;for(let v of f){if(g>=64)break;let k=v.getBoundingClientRect();if(k.width<4||k.height<4)continue;let m=k.left-o,b=k.top-a;if(m>l-2||b>c-2)continue;m=y(m,0,Math.max(0,l-4)),b=y(b,0,Math.max(0,c-4));let V=Math.min(k.width,l-m),M=Math.min(k.height,c-b);if(V<4||M<4)continue;let ne=getComputedStyle(v),ie=(W=t.radius)!=null?W:v.tagName==="IMG"?8:y((F=H(ne))!=null?F:8,0,24),se=v.childElementCount===0&&((D=v.textContent)!=null?D:"").trim().length>0,re=h({left:`${Math.round(m)}px`,top:`${Math.round(b)}px`,width:`${Math.round(V)}px`,height:`${Math.round(M)}px`,"border-radius":`${ie}px`,...se?{"border-radius":"999px",height:`${Math.min(Math.round(M),16)}px`}:{}});e.appendChild(re),g++}return g}function R(n){var f;let{host:e,spec:t,media:i,preset:s}=n,r=u("div","skl-overlay");r.dataset.sklPreset=s,r.dataset.sklKind=i?"media":"container",r.setAttribute("aria-hidden","true");let o=getComputedStyle(e),a=ue(i&&(f=e.parentElement)!=null?f:e),l=n.theme==="light"||n.theme==="dark"?n.theme:null;if(r.dataset.sklTone=l!=null?l:a.tone,r.style.setProperty("--skl-solid",a.color),i){r.dataset.sklLayout="fill";let d=o.borderRadius;return d&&d!=="0px"&&(r.style.borderRadius=d),r.appendChild(h({width:"100%",height:"100%","border-radius":"inherit"})),r}let c=Y(o);for(let d of Object.keys(c)){let g=c[d];g&&g!=="0px"&&r.style.setProperty(d,g)}switch(t.radius&&r.style.setProperty("--skl-radius",`${t.radius}px`),t.shape){case"text":r.dataset.sklLayout="stack",r.appendChild(pe(t.lines));break;case"card":r.dataset.sklLayout="stack",r.appendChild(ce(t));break;case"grid":{r.dataset.sklLayout="grid",r.style.setProperty("--skl-cols",String(t.cols));for(let d=0;d<t.count;d++)r.appendChild(he(t));break}case"list":{r.dataset.sklLayout="stack";for(let d=0;d<t.count;d++)r.appendChild(U(!0));break}case"table":r.dataset.sklLayout="stack",r.appendChild(fe(t));break;case"media":r.dataset.sklLayout="stack",r.appendChild(ke(t));break;case"avatar":r.dataset.sklLayout="stack",r.appendChild(ge(t));break;case"chart":r.dataset.sklLayout="stack",r.appendChild(me());break;case"profile":r.dataset.sklLayout="stack",r.appendChild(be(t));break;default:{r.dataset.sklLayout="mirror";let d=e.getAttribute("data-skeleton-depth")==="2"?2:1;ye(e,r,t,d)||(r.dataset.sklLayout="stack",r.appendChild(ve(t)))}}if(!r.style.getPropertyValue("--skl-radius")&&t.radius===null){let d=H(o);d!==null&&d<=32&&r.style.setProperty("--skl-radius",`${d}px`)}return r}var J=`/*!\n * skeleton-load v0.1.0 \\u2014 MIT\n * https://github.com/skeleton-load\n */\n\n.skl-host,\n[data-skl-state] {\n position: relative;\n}\n\n/* Content is kept in the layout (no CLS) but hidden while the skeleton plays. */\n[data-skl-state="loading"] > *:not(.skl-overlay) {\n visibility: hidden !important;\n}\n\n.skl-overlay {\n position: absolute;\n inset: 0;\n z-index: 4;\n overflow: hidden;\n pointer-events: none;\n border-radius: inherit;\n opacity: 0;\n transition: opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);\n contain: layout paint style;\n\n --skl-base: rgba(17, 20, 28, 0.1);\n --skl-highlight: rgba(255, 255, 255, 0.72);\n --skl-radius: 8px;\n --skl-gap: 10px;\n --skl-surface: #ffffff;\n --skl-border: rgba(17, 20, 28, 0.08);\n --skl-line: rgba(17, 20, 28, 0.08);\n --skl-solid: #f1f1f6;\n}\n\n/* A dark surface needs brighter placeholders to be readable at all. */\n.skl-overlay[data-skl-tone="dark"] {\n --skl-base: rgba(255, 255, 255, 0.115);\n --skl-highlight: rgba(255, 255, 255, 0.22);\n --skl-surface: rgba(255, 255, 255, 0.035);\n --skl-border: rgba(255, 255, 255, 0.07);\n --skl-line: rgba(255, 255, 255, 0.07);\n --skl-solid: #14161c;\n}\n\n.skl-overlay[data-skl-show="1"] {\n opacity: 1;\n}\n\n/* Temporary state used to measure the skeleton\'s natural height. */\n.skl-overlay[data-skl-measure] {\n inset: auto;\n top: 0;\n left: 0;\n opacity: 0;\n}\n\n.skl-overlay[data-skl-kind="media"] {\n background: var(--skl-solid);\n border-radius: var(--skl-radius);\n}\n\n/* ---------- blocks ---------- */\n\n.skl-block {\n position: relative;\n min-height: 8px;\n overflow: hidden;\n border-radius: var(--skl-radius);\n background: var(--skl-base);\n}\n\n.skl-block::after {\n content: "";\n position: absolute;\n inset: 0;\n background: linear-gradient(\n 90deg,\n transparent 0%,\n var(--skl-highlight) 50%,\n transparent 100%\n );\n transform: translateX(-100%);\n animation: skl-shimmer var(--skl-speed, 1.6s) cubic-bezier(0.45, 0, 0.25, 1) infinite;\n will-change: transform;\n}\n\n.skl-overlay[data-skl-preset="pulse"] .skl-block::after,\n.skl-overlay[data-skl-preset="static"] .skl-block::after {\n display: none;\n}\n\n.skl-overlay[data-skl-preset="pulse"] .skl-block {\n animation: skl-pulse 1.8s ease-in-out infinite;\n}\n\n.skl-overlay[data-skl-preset="static"] .skl-block {\n opacity: 0.92;\n}\n\n/* Pause everything while the tab is in the background. */\nhtml[data-skl-idle] .skl-block::after,\nhtml[data-skl-idle] .skl-block {\n animation-play-state: paused;\n}\n\n/* ---------- layouts ---------- */\n\n.skl-overlay[data-skl-layout="stack"] {\n display: flex;\n flex-direction: column;\n gap: var(--skl-gap);\n}\n\n.skl-overlay[data-skl-layout="row"] {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--skl-gap);\n}\n\n.skl-overlay[data-skl-layout="grid"] {\n display: grid;\n gap: var(--skl-gap);\n grid-template-columns: repeat(var(--skl-cols, 3), minmax(0, 1fr));\n}\n\n.skl-overlay[data-skl-layout="center"] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--skl-gap);\n}\n\n.skl-overlay[data-skl-layout="mirror"] {\n padding: 0;\n}\n\n.skl-overlay[data-skl-layout="mirror"] > .skl-block {\n position: absolute;\n min-height: 0;\n}\n\n.skl-card {\n display: flex;\n flex-direction: column;\n gap: var(--skl-gap);\n min-width: 0;\n}\n\n.skl-cell {\n display: flex;\n flex-direction: column;\n gap: 0;\n min-width: 0;\n overflow: hidden;\n border-radius: calc(var(--skl-radius) + 8px);\n background: var(--skl-surface);\n border: 1px solid var(--skl-border);\n}\n\n.skl-cell-body {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 16px;\n}\n\n.skl-cell-pad {\n padding: 20px 18px;\n}\n\n.skl-row {\n display: flex;\n align-items: center;\n gap: var(--skl-gap);\n min-width: 0;\n}\n\n.skl-lines {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n gap: 8px;\n min-width: 0;\n}\n\n.skl-line {\n height: var(--skl-line-h, 0.72em);\n min-height: 7px;\n border-radius: 999px;\n}\n\n.skl-circle {\n border-radius: 50%;\n flex: 0 0 auto;\n}\n\n.skl-chart {\n display: flex;\n align-items: flex-end;\n gap: var(--skl-gap);\n height: 100%;\n min-height: 90px;\n}\n\n.skl-chart > .skl-block {\n flex: 1 1 0;\n min-width: 0;\n}\n\n/* ---------- table ---------- */\n\n.skl-table {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.skl-trow {\n display: grid;\n grid-template-columns: 2.2fr 1fr 1fr 0.9fr;\n gap: 14px;\n align-items: center;\n padding: 19px 8px;\n}\n\n.skl-trow + .skl-trow {\n border-top: 1px solid var(--skl-line);\n}\n\n.skl-thead {\n padding-top: 2px;\n padding-bottom: 12px;\n}\n\n.skl-thead .skl-line {\n min-height: 8px;\n}\n\n.skl-who {\n display: flex;\n align-items: center;\n gap: 10px;\n min-width: 0;\n}\n\n/* ---------- reveal ---------- */\n\n[data-skl-state="done"] > *:not(.skl-overlay) {\n animation: skl-content-in 200ms ease both;\n}\n\n/* ---------- debug ---------- */\n\n[data-skl-debug] .skl-block {\n outline: 1px dashed rgba(255, 64, 129, 0.7);\n outline-offset: -1px;\n}\n\n[data-skl-debug] .skl-overlay {\n outline: 2px solid rgba(255, 64, 129, 0.9);\n outline-offset: -2px;\n}\n\n/* ---------- keyframes ---------- */\n\n@keyframes skl-shimmer {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(100%);\n }\n}\n\n@keyframes skl-pulse {\n 0%,\n 100% {\n opacity: 0.55;\n }\n 50% {\n opacity: 1;\n }\n}\n\n@keyframes skl-content-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n/* ---------- preferences ---------- */\n\n@media (prefers-reduced-motion: reduce) {\n .skl-overlay {\n transition: none;\n }\n\n .skl-block::after {\n display: none;\n }\n\n .skl-overlay[data-skl-preset="pulse"] .skl-block,\n [data-skl-state="done"] > * {\n animation: none;\n }\n}\n\n@media (prefers-reduced-data: reduce) {\n .skl-block::after {\n display: none;\n }\n}\n\n@media (forced-colors: active) {\n .skl-block {\n background: CanvasText;\n opacity: 0.25;\n }\n}\n`;var I="skeleton-load-styles";function Q(n){var s;if(typeof document=="undefined")return null;let e=document.getElementById(I);if(e)return e;let t=document.createElement("style");return t.id=I,t.setAttribute("data-skeleton-load",""),n&&t.setAttribute("nonce",n),t.textContent=J,((s=document.head)!=null?s:document.documentElement).prepend(t),t}function Z(){var n;(n=document.getElementById(I))==null||n.remove()}function Ee(n){if(n.hidden)return!0;try{return getComputedStyle(n).display==="none"}catch{return!1}}var S=class{constructor(e={}){this.entries=new Map;this.waiting=new Map;this.mo=null;this.io=null;this.pending=new Set;this.rafId=0;this.styleEl=null;this.started=!1;this.destroyed=!1;this.visibilityHandler=null;this.stats={shown:0,hidden:0,total:0};this.raw={...e},this.resolved=C(this.raw)}get options(){return this.resolved}start(){return typeof document=="undefined"?this:(this.destroyed=!1,this.started?this:(this.started=!0,this.resolved.css&&!this.styleEl&&(this.styleEl=Q(this.resolved.nonce)),this.resolved.debug&&document.documentElement.setAttribute("data-skl-debug",""),this.observe(),this.bindVisibility(),this.refresh(),this))}stop(){var e,t;this.started=!1,(e=this.mo)==null||e.disconnect(),this.mo=null,(t=this.io)==null||t.disconnect(),this.io=null,this.waiting.clear(),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=0);for(let i of Array.from(this.entries.values()))i.state="done",this.teardown(i,!0);return this.entries.clear(),document.documentElement.removeAttribute("data-skl-debug"),this}destroy(){this.stop(),this.destroyed=!0,this.styleEl&&(Z(),this.styleEl=null)}update(e){var t,i;if(this.raw={...this.raw,...e},this.resolved=C(this.raw),this.started){for(let s of this.entries.values()){let r=(i=(t=s.spec.preset)!=null?t:T(s.host))!=null?i:this.resolved.preset;s.preset!==r&&(s.preset=r,s.overlay&&(s.overlay.dataset.sklPreset=r))}this.refresh()}return this}setPreset(e){return this.update({preset:e})}refresh(e){var t;return this.started||this.start(),this.scan((t=e!=null?e:this.resolved.root)!=null?t:document),this}show(e){return this.started||this.start(),this.consider(e,!0),this}hide(e){let t=this.entries.get(e);return t&&this.finish(t),this}get active(){return Array.from(this.entries.values()).filter(e=>e.state==="shown").map(e=>e.host)}get report(){return{...this.stats}}observe(){typeof MutationObserver!="undefined"&&(this.mo||(this.mo=new MutationObserver(e=>this.onMutations(e))),this.mo.observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["data-skeleton","data-skeleton-state","data-skeleton-preset","data-skeleton-lines","src","loading"]}))}bindVisibility(){this.visibilityHandler||(this.visibilityHandler=()=>{let e=document.documentElement;document.hidden?e.setAttribute("data-skl-idle",""):e.removeAttribute("data-skl-idle")},document.addEventListener("visibilitychange",this.visibilityHandler))}onMutations(e){let t=[];for(let i of e){let s=i.target;if(i.type==="attributes"){let o=i.attributeName;if(o==="data-skeleton-state"){this.syncState(s);continue}if(o==="data-skeleton"||o==="data-skeleton-preset"||o==="data-skeleton-lines"){this.entries.has(s)?this.restart(s):this.resolved.observe&&t.push(s);continue}o==="src"&&L(s)&&(this.entries.has(s)?this.restart(s):this.resolved.observe&&t.push(s));continue}let r=this.entries.get(s);if(r&&!r.media&&x(s)&&this.finish(r),i.type==="characterData"){let o=s.parentElement,a=o?this.entries.get(o):void 0;a&&!a.media&&x(o)&&this.finish(a);continue}this.resolved.observe&&i.addedNodes.forEach(o=>{o.nodeType===1&&t.push(o)})}t.length&&this.queueScan(t)}queueScan(e){for(let t of e)this.pending.add(t);this.rafId||(this.rafId=P(()=>{this.rafId=0;let t=Array.from(this.pending);this.pending.clear();for(let i of t)i.isConnected&&this.scan(i)}))}syncState(e){let t=e.getAttribute("data-skeleton-state"),i=this.entries.get(e);if(t==="loading"){i?i.state==="done"?this.restart(e):i.forced=!0:this.consider(e,!0);return}t==="done"&&i&&this.finish(i)}restart(e){let t=this.entries.get(e);t&&this.teardown(t,!0),P(()=>this.consider(e,!1))}scan(e){if(!e)return;let t=[];e instanceof Element&&t.push(e);let i=e.querySelectorAll;typeof i=="function"&&i.call(e,"img,video,iframe,[data-skeleton]").forEach(s=>t.push(s));for(let s of t)this.consider(s,!1)}consider(e,t){if(!e.isConnected&&t||this.entries.has(e)||!t&&K(e))return;let i=L(e),s=q(e);if(!i&&s.shape==="off"||!t&&e.closest(\'[data-skl-state="loading"]\'))return;if(i){let o=e.hasAttribute("data-skeleton");if(!this.resolved.autoMedia&&!o&&!t||!t&&s.state==="done"||!t&&O(e)&&s.state!=="loading")return;if(!t&&this.resolved.observe&&X(e)){this.watchLazy(e);return}this.addEntry(e,!0,s,t||s.state==="loading");return}if(!t&&s.state==="done")return;let r=t||s.state==="loading";!r&&x(e)||!r&&Ee(e)||this.addEntry(e,!1,s,r)}watchLazy(e){if(typeof IntersectionObserver=="undefined"){this.consider(e,!0);return}this.waiting.has(e)||(this.io||(this.io=new IntersectionObserver(t=>{var i;for(let s of t){if(!s.isIntersecting)continue;let r=this.waiting.get(s.target);r&&(this.waiting.delete(s.target),(i=this.io)==null||i.unobserve(s.target),r())}},{rootMargin:"320px 0px"})),this.waiting.set(e,()=>this.consider(e,!1)),this.io.observe(e))}addEntry(e,t,i,s){var l,c;if(this.entries.has(e))return;let r=(c=(l=i.preset)!=null?l:T(e))!=null?c:this.resolved.preset,o={host:e,media:t,spec:i,preset:r,forced:s,state:"pending",overlay:null,container:null,timer:null,guard:null,hideTimer:null,fadeTimer:null,shownAt:0,cleanup:[]};this.entries.set(e,o),this.stats.total++;let a=this.resolved.delay;if(a<=0?this.paint(o):o.timer=setTimeout(()=>this.paint(o),a),this.resolved.maxWait>0&&(o.guard=setTimeout(()=>this.finish(o),this.resolved.maxWait+a)),t){let f=()=>this.finish(o);e.addEventListener("load",f,{once:!0}),e.addEventListener("error",f,{once:!0}),o.cleanup.push(()=>{e.removeEventListener("load",f),e.removeEventListener("error",f)})}}paint(e){var s,r;if(e.state!=="pending")return;let t=e.host;if(e.media){if(O(t)&&!e.forced){this.finish(e);return}}else if(!e.forced&&x(t)){this.finish(e);return}let i=R({host:t,spec:e.spec,media:e.media,preset:e.preset,theme:this.themeOf(t)});e.media?this.mountMedia(e,i):this.mountContainer(e,i),e.overlay=i,e.state="shown",e.shownAt=A(),this.stats.shown++,this.resolved.debug&&i.setAttribute("data-skl-debug",""),i.offsetWidth,i.dataset.sklShow="1",(r=(s=this.resolved).onShow)==null||r.call(s,t)}mountContainer(e,t){let i=e.host;if(i.classList.add("skl-host"),i.dataset.sklShape=e.spec.shape,i.dataset.sklState="loading",i.appendChild(t),e.spec.height)e.prevMinHeight=i.style.minHeight,i.style.minHeight=`${e.spec.height}px`;else if(t.dataset.sklLayout!=="mirror"){let s=this.measure(t);if(s>8){let r=i.getBoundingClientRect().height;s>r+2&&(e.prevMinHeight=i.style.minHeight,i.style.minHeight=`${Math.ceil(s)}px`)}}if(e.spec.shape==="auto"&&typeof ResizeObserver!="undefined"){let s=new ResizeObserver(()=>this.repaint(e));s.observe(i),e.cleanup.push(()=>s.disconnect())}}measure(e){let t=e.parentElement;e.dataset.sklMeasure="",t&&t.clientWidth>0&&(e.style.width=`${t.clientWidth}px`);let i=e.getBoundingClientRect().height;return e.style.removeProperty("width"),delete e.dataset.sklMeasure,i}mountMedia(e,t){let i=e.host,s=i.parentElement;if(!s)return;let r="";try{r=getComputedStyle(s).position}catch{r="static"}r==="static"&&(e.prevParentPosition=s.style.position,s.style.position="relative",t.dataset.sklPatched="1"),s.appendChild(t),e.container=s,e.prevVisibility=i.style.visibility,i.style.visibility="hidden";let o=()=>{if(!t.isConnected)return;let a=s.getBoundingClientRect(),l=i.getBoundingClientRect();t.style.left=`${l.left-a.left-s.clientLeft}px`,t.style.top=`${l.top-a.top-s.clientTop}px`,t.style.width=`${l.width}px`,t.style.height=`${l.height}px`};if(o(),typeof ResizeObserver!="undefined"){let a=new ResizeObserver(o);a.observe(i),a.observe(s),e.cleanup.push(()=>a.disconnect())}typeof window!="undefined"&&(window.addEventListener("resize",o),e.cleanup.push(()=>window.removeEventListener("resize",o))),e.cleanup.push(()=>{var a;t.dataset.sklPatched&&(s.style.position=(a=e.prevParentPosition)!=null?a:""),e.prevVisibility!==void 0&&(i.style.visibility=e.prevVisibility)})}repaint(e){if(e.state!=="shown"||!e.overlay||!e.overlay.isConnected)return;let t=R({host:e.host,spec:e.spec,media:e.media,preset:e.preset,theme:this.themeOf(e.host)});t.dataset.sklShow="1",this.resolved.debug&&t.setAttribute("data-skl-debug",""),e.overlay.replaceWith(t),e.overlay=t}finish(e){if(e.state==="done")return;let t=e.state==="shown";e.state="done",this.clearTimers(e);let i=t?Math.max(0,this.resolved.minVisible-(A()-e.shownAt)):0;if(!e.overlay){this.teardown(e,!1);return}e.hideTimer=setTimeout(()=>this.teardown(e,!1),i)}teardown(e,t){var o,a;this.entries.delete(e.host),this.clearTimers(e);for(let l of e.cleanup)try{l()}catch{}e.cleanup=[];let i=e.host;if(e.prevMinHeight!==void 0&&(i.style.minHeight=e.prevMinHeight),i.classList.remove("skl-host"),!e.overlay){i.dataset.sklState==="loading"&&delete i.dataset.sklState,delete i.dataset.sklShape;return}let s=e.overlay;i.dataset.sklState="done";let r=()=>{s.remove(),i.dataset.sklState==="done"&&delete i.dataset.sklState,delete i.dataset.sklShape,s.remove()};t||this.prefersReducedMotion()?r():(s.dataset.sklShow="0",e.fadeTimer=setTimeout(r,220)),this.stats.hidden++,(a=(o=this.resolved).onHide)==null||a.call(o,i),this.started&&setTimeout(()=>this.scan(i),0)}themeOf(e){var t;return(t=_(e))!=null?t:this.resolved.theme}prefersReducedMotion(){if(!this.resolved.respectReducedMotion||typeof matchMedia!="function")return!1;try{return matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}clearTimers(e){e.timer&&clearTimeout(e.timer),e.guard&&clearTimeout(e.guard),e.hideTimer&&clearTimeout(e.hideTimer),e.timer=null,e.guard=null,e.hideTimer=null}};var N=Symbol.for("skeleton-load:default");function xe(){let n=globalThis;return n[N]||(n[N]={}),n[N]}function z(n){let e=xe();return e.engine?n&&e.engine.update(n):e.engine=new S(n),e.engine}function B(n){return z(n).start()}var te,$=typeof window!="undefined"?(te=window.SKELETON_LOAD_CONFIG)!=null?te:{}:{};function ee(){$.autoStart!==!1&&B($)}typeof document!="undefined"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ee,{once:!0}):ee());if(typeof window!="undefined"){let n=z($);window.SkeletonLoad={engine:n,start(e){return B(e)},stop(){n.stop()},refresh(e){n.refresh(e)},setPreset(e){n.setPreset(e)},show(e){n.show(e)},hide(e){n.hide(e)}}}})();\n';
337
+
338
+ // src/plugins/webpack.ts
339
+ function configJson(options) {
340
+ const config = {};
341
+ for (const key of ["preset", "theme", "delay", "minVisible", "maxWait", "autoMedia", "observe", "debug"]) {
342
+ const value = options[key];
343
+ if (value !== void 0) config[key] = value;
344
+ }
345
+ return JSON.stringify(config);
346
+ }
347
+ function snippet(options) {
348
+ const parts = [];
349
+ if (options.css !== false) {
350
+ parts.push(`<style data-skeleton-load>${minifyCss(css_generated_default)}</style>`);
351
+ }
352
+ if ((options.runtime ?? "inline") !== "none") {
353
+ parts.push(`<script>window.SKELETON_LOAD_CONFIG=Object.assign({},window.SKELETON_LOAD_CONFIG,${configJson(options)})</script>`);
354
+ if ((options.runtime ?? "inline") === "inline") {
355
+ parts.push(`<script>${runtime_generated_default}</script>`);
356
+ } else {
357
+ parts.push(`<script src="${options.src ?? "/skeleton-load.auto.js"}" defer></script>`);
358
+ }
359
+ }
360
+ if (options.autoMark) {
361
+ return parts.join("");
362
+ }
363
+ return parts.join("");
364
+ }
365
+ function inject(html, code) {
366
+ if (!code) return html;
367
+ if (/<\/head>/i.test(html)) return html.replace(/<\/head>/i, `${code}</head>`);
368
+ return `${code}${html}`;
369
+ }
370
+ var SkeletonLoadPlugin = class {
371
+ constructor(options = {}) {
372
+ this.options = options;
373
+ }
374
+ apply(compiler) {
375
+ compiler.hooks.thisCompilation.tap("SkeletonLoadPlugin", (compilation) => {
376
+ compilation.hooks.processAssets.tap({ name: "SkeletonLoadPlugin", stage: 1e3 }, (assets) => {
377
+ const code = snippet(this.options);
378
+ for (const name of Object.keys(assets)) {
379
+ if (!name.endsWith(".html")) continue;
380
+ const source = assets[name];
381
+ if (!source) continue;
382
+ const html = String(source.source());
383
+ const next = inject(
384
+ this.options.autoMark ? html.replace(
385
+ /<main(\s[^>]*)?>/i,
386
+ (match) => /data-skeleton/i.test(match) ? match : match.replace("<main", '<main data-skeleton="auto"')
387
+ ) : html,
388
+ code
389
+ );
390
+ if (next === html) continue;
391
+ const RawSource = compiler.webpack?.sources?.RawSource;
392
+ if (RawSource) {
393
+ assets[name] = new RawSource(next);
394
+ } else if (compilation.updateAsset) {
395
+ compilation.updateAsset(name, { source: () => next, size: () => next.length });
396
+ }
397
+ }
398
+ });
399
+ });
400
+ }
401
+ };
402
+
403
+ // src/next/index.ts
404
+ function withSkeleton(config = {}, options = {}) {
405
+ const previous = config.webpack;
406
+ return {
407
+ ...config,
408
+ webpack(webpackConfig, context) {
409
+ const resolved = previous ? previous(webpackConfig, context) : webpackConfig;
410
+ const plugins = Array.isArray(resolved.plugins) ? resolved.plugins.slice() : [];
411
+ plugins.push(new SkeletonLoadPlugin(options));
412
+ return { ...resolved, plugins };
413
+ }
414
+ };
415
+ }
416
+ var next_default = withSkeleton;
417
+
418
+ export { next_default as default, withSkeleton };
419
+ //# sourceMappingURL=index.js.map
420
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/minify.ts","../../src/core/css.generated.ts","../../src/plugins/runtime.generated.ts","../../src/plugins/webpack.ts","../../src/next/index.ts"],"names":[],"mappings":"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","file":"index.js","sourcesContent":["/** Small, dependency-free CSS minifier for the injected critical styles. */\nexport function minifyCss(css: string): string {\n return css\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, '')\n .replace(/\\s+/g, ' ')\n .replace(/\\s*([{}:;,>])\\s*/g, '$1')\n .replace(/;}/g, '}')\n .trim()\n}\n","// generated by scripts/prebuild.mjs — do not edit\nexport default \"/*!\\n * skeleton-load v0.1.0 — MIT\\n * https://github.com/skeleton-load\\n */\\n\\n.skl-host,\\n[data-skl-state] {\\n position: relative;\\n}\\n\\n/* Content is kept in the layout (no CLS) but hidden while the skeleton plays. */\\n[data-skl-state=\\\"loading\\\"] > *:not(.skl-overlay) {\\n visibility: hidden !important;\\n}\\n\\n.skl-overlay {\\n position: absolute;\\n inset: 0;\\n z-index: 4;\\n overflow: hidden;\\n pointer-events: none;\\n border-radius: inherit;\\n opacity: 0;\\n transition: opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);\\n contain: layout paint style;\\n\\n --skl-base: rgba(17, 20, 28, 0.1);\\n --skl-highlight: rgba(255, 255, 255, 0.72);\\n --skl-radius: 8px;\\n --skl-gap: 10px;\\n --skl-surface: #ffffff;\\n --skl-border: rgba(17, 20, 28, 0.08);\\n --skl-line: rgba(17, 20, 28, 0.08);\\n --skl-solid: #f1f1f6;\\n}\\n\\n/* A dark surface needs brighter placeholders to be readable at all. */\\n.skl-overlay[data-skl-tone=\\\"dark\\\"] {\\n --skl-base: rgba(255, 255, 255, 0.115);\\n --skl-highlight: rgba(255, 255, 255, 0.22);\\n --skl-surface: rgba(255, 255, 255, 0.035);\\n --skl-border: rgba(255, 255, 255, 0.07);\\n --skl-line: rgba(255, 255, 255, 0.07);\\n --skl-solid: #14161c;\\n}\\n\\n.skl-overlay[data-skl-show=\\\"1\\\"] {\\n opacity: 1;\\n}\\n\\n/* Temporary state used to measure the skeleton's natural height. */\\n.skl-overlay[data-skl-measure] {\\n inset: auto;\\n top: 0;\\n left: 0;\\n opacity: 0;\\n}\\n\\n.skl-overlay[data-skl-kind=\\\"media\\\"] {\\n background: var(--skl-solid);\\n border-radius: var(--skl-radius);\\n}\\n\\n/* ---------- blocks ---------- */\\n\\n.skl-block {\\n position: relative;\\n min-height: 8px;\\n overflow: hidden;\\n border-radius: var(--skl-radius);\\n background: var(--skl-base);\\n}\\n\\n.skl-block::after {\\n content: \\\"\\\";\\n position: absolute;\\n inset: 0;\\n background: linear-gradient(\\n 90deg,\\n transparent 0%,\\n var(--skl-highlight) 50%,\\n transparent 100%\\n );\\n transform: translateX(-100%);\\n animation: skl-shimmer var(--skl-speed, 1.6s) cubic-bezier(0.45, 0, 0.25, 1) infinite;\\n will-change: transform;\\n}\\n\\n.skl-overlay[data-skl-preset=\\\"pulse\\\"] .skl-block::after,\\n.skl-overlay[data-skl-preset=\\\"static\\\"] .skl-block::after {\\n display: none;\\n}\\n\\n.skl-overlay[data-skl-preset=\\\"pulse\\\"] .skl-block {\\n animation: skl-pulse 1.8s ease-in-out infinite;\\n}\\n\\n.skl-overlay[data-skl-preset=\\\"static\\\"] .skl-block {\\n opacity: 0.92;\\n}\\n\\n/* Pause everything while the tab is in the background. */\\nhtml[data-skl-idle] .skl-block::after,\\nhtml[data-skl-idle] .skl-block {\\n animation-play-state: paused;\\n}\\n\\n/* ---------- layouts ---------- */\\n\\n.skl-overlay[data-skl-layout=\\\"stack\\\"] {\\n display: flex;\\n flex-direction: column;\\n gap: var(--skl-gap);\\n}\\n\\n.skl-overlay[data-skl-layout=\\\"row\\\"] {\\n display: flex;\\n flex-direction: row;\\n align-items: center;\\n gap: var(--skl-gap);\\n}\\n\\n.skl-overlay[data-skl-layout=\\\"grid\\\"] {\\n display: grid;\\n gap: var(--skl-gap);\\n grid-template-columns: repeat(var(--skl-cols, 3), minmax(0, 1fr));\\n}\\n\\n.skl-overlay[data-skl-layout=\\\"center\\\"] {\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n gap: var(--skl-gap);\\n}\\n\\n.skl-overlay[data-skl-layout=\\\"mirror\\\"] {\\n padding: 0;\\n}\\n\\n.skl-overlay[data-skl-layout=\\\"mirror\\\"] > .skl-block {\\n position: absolute;\\n min-height: 0;\\n}\\n\\n.skl-card {\\n display: flex;\\n flex-direction: column;\\n gap: var(--skl-gap);\\n min-width: 0;\\n}\\n\\n.skl-cell {\\n display: flex;\\n flex-direction: column;\\n gap: 0;\\n min-width: 0;\\n overflow: hidden;\\n border-radius: calc(var(--skl-radius) + 8px);\\n background: var(--skl-surface);\\n border: 1px solid var(--skl-border);\\n}\\n\\n.skl-cell-body {\\n display: flex;\\n flex-direction: column;\\n gap: 8px;\\n padding: 16px;\\n}\\n\\n.skl-cell-pad {\\n padding: 20px 18px;\\n}\\n\\n.skl-row {\\n display: flex;\\n align-items: center;\\n gap: var(--skl-gap);\\n min-width: 0;\\n}\\n\\n.skl-lines {\\n display: flex;\\n flex: 1 1 auto;\\n flex-direction: column;\\n gap: 8px;\\n min-width: 0;\\n}\\n\\n.skl-line {\\n height: var(--skl-line-h, 0.72em);\\n min-height: 7px;\\n border-radius: 999px;\\n}\\n\\n.skl-circle {\\n border-radius: 50%;\\n flex: 0 0 auto;\\n}\\n\\n.skl-chart {\\n display: flex;\\n align-items: flex-end;\\n gap: var(--skl-gap);\\n height: 100%;\\n min-height: 90px;\\n}\\n\\n.skl-chart > .skl-block {\\n flex: 1 1 0;\\n min-width: 0;\\n}\\n\\n/* ---------- table ---------- */\\n\\n.skl-table {\\n display: flex;\\n flex-direction: column;\\n width: 100%;\\n}\\n\\n.skl-trow {\\n display: grid;\\n grid-template-columns: 2.2fr 1fr 1fr 0.9fr;\\n gap: 14px;\\n align-items: center;\\n padding: 19px 8px;\\n}\\n\\n.skl-trow + .skl-trow {\\n border-top: 1px solid var(--skl-line);\\n}\\n\\n.skl-thead {\\n padding-top: 2px;\\n padding-bottom: 12px;\\n}\\n\\n.skl-thead .skl-line {\\n min-height: 8px;\\n}\\n\\n.skl-who {\\n display: flex;\\n align-items: center;\\n gap: 10px;\\n min-width: 0;\\n}\\n\\n/* ---------- reveal ---------- */\\n\\n[data-skl-state=\\\"done\\\"] > *:not(.skl-overlay) {\\n animation: skl-content-in 200ms ease both;\\n}\\n\\n/* ---------- debug ---------- */\\n\\n[data-skl-debug] .skl-block {\\n outline: 1px dashed rgba(255, 64, 129, 0.7);\\n outline-offset: -1px;\\n}\\n\\n[data-skl-debug] .skl-overlay {\\n outline: 2px solid rgba(255, 64, 129, 0.9);\\n outline-offset: -2px;\\n}\\n\\n/* ---------- keyframes ---------- */\\n\\n@keyframes skl-shimmer {\\n from {\\n transform: translateX(-100%);\\n }\\n to {\\n transform: translateX(100%);\\n }\\n}\\n\\n@keyframes skl-pulse {\\n 0%,\\n 100% {\\n opacity: 0.55;\\n }\\n 50% {\\n opacity: 1;\\n }\\n}\\n\\n@keyframes skl-content-in {\\n from {\\n opacity: 0;\\n }\\n to {\\n opacity: 1;\\n }\\n}\\n\\n/* ---------- preferences ---------- */\\n\\n@media (prefers-reduced-motion: reduce) {\\n .skl-overlay {\\n transition: none;\\n }\\n\\n .skl-block::after {\\n display: none;\\n }\\n\\n .skl-overlay[data-skl-preset=\\\"pulse\\\"] .skl-block,\\n [data-skl-state=\\\"done\\\"] > * {\\n animation: none;\\n }\\n}\\n\\n@media (prefers-reduced-data: reduce) {\\n .skl-block::after {\\n display: none;\\n }\\n}\\n\\n@media (forced-colors: active) {\\n .skl-block {\\n background: CanvasText;\\n opacity: 0.25;\\n }\\n}\\n\"\n","// generated by scripts/prebuild.mjs — do not edit\nexport default \"\\\"use strict\\\";(()=>{var G=[\\\"shimmer\\\",\\\"pulse\\\",\\\"static\\\"],oe=[\\\"auto\\\",\\\"card\\\",\\\"grid\\\",\\\"list\\\",\\\"text\\\",\\\"table\\\",\\\"media\\\",\\\"avatar\\\",\\\"chart\\\",\\\"profile\\\",\\\"off\\\"],j={preset:\\\"shimmer\\\",theme:\\\"auto\\\",delay:120,minVisible:300,maxWait:5e3,autoMedia:!0,observe:!0,css:!0,nonce:\\\"\\\",root:null,debug:!1,respectReducedMotion:!0};function E(n,e){if(n===null||n===\\\"\\\")return e;let t=Number(n);return Number.isFinite(t)?t:e}function C(n={}){let e={...j};for(let t of Object.keys(n)){let i=n[t];i!==void 0&&(e[t]=i)}return G.includes(e.preset)||(e.preset=j.preset),e.delay=Math.max(0,e.delay),e.minVisible=Math.max(0,e.minVisible),e.maxWait=Math.max(0,e.maxWait),e}function w(n){return n&&G.includes(n)?n:null}function ae(n){return n===\\\"light\\\"||n===\\\"dark\\\"||n===\\\"auto\\\"?n:null}function le(n){if(!n)return null;let e=n.trim().toLowerCase();return e===\\\"\\\"||e===\\\"true\\\"||e===\\\"1\\\"?\\\"auto\\\":oe.includes(e)?e:null}function q(n){let e=n,t=e.dataset,i=le(e.getAttribute(\\\"data-skeleton\\\"));return{shape:i!=null?i:\\\"auto\\\",state:t.skeletonState===\\\"loading\\\"||t.skeletonState===\\\"done\\\"?t.skeletonState:null,preset:w(e.getAttribute(\\\"data-skeleton-preset\\\")),lines:Math.max(1,Math.min(12,E(e.getAttribute(\\\"data-skeleton-lines\\\"),3))),ratio:e.getAttribute(\\\"data-skeleton-ratio\\\"),count:Math.max(1,Math.min(24,E(e.getAttribute(\\\"data-skeleton-count\\\"),4))),cols:Math.max(1,Math.min(6,E(e.getAttribute(\\\"data-skeleton-cols\\\"),3))),height:e.hasAttribute(\\\"data-skeleton-h\\\")&&E(e.getAttribute(\\\"data-skeleton-h\\\"),0)||null,radius:e.hasAttribute(\\\"data-skeleton-radius\\\")&&E(e.getAttribute(\\\"data-skeleton-radius\\\"),0)||null}}function T(n){let e=n;for(;e&&e!==document.documentElement;){let t=w(e.getAttribute(\\\"data-skeleton-preset\\\"));if(t)return t;e=e.parentElement}return w(document.documentElement.getAttribute(\\\"data-skeleton-preset\\\"))}function _(n){let e=n;for(;e;){let t=ae(e.getAttribute(\\\"data-skeleton-theme\\\"));if(t)return t;e=e.parentElement}return null}function K(n){let e=n,t=0;for(;e&&t<64;){if(e.hasAttribute(\\\"data-skeleton-skip\\\")||e.getAttribute(\\\"data-skeleton\\\")===\\\"off\\\")return!0;e=e.parentElement,t++}return!1}function L(n){let e=n.tagName;return e===\\\"IMG\\\"||e===\\\"VIDEO\\\"||e===\\\"IFRAME\\\"}function O(n){let e=n.tagName;if(e===\\\"IMG\\\"){let t=n;return t.complete&&t.naturalWidth>0}return e===\\\"VIDEO\\\"?n.readyState>=2:!1}function x(n){var e;for(let t of Array.from(n.children))if(!t.classList.contains(\\\"skl-overlay\\\"))return!0;return((e=n.textContent)!=null?e:\\\"\\\").trim().length>0}function X(n){return n.getAttribute(\\\"loading\\\")===\\\"lazy\\\"||n.getAttribute(\\\"data-skeleton-lazy\\\")===\\\"true\\\"}var P=typeof requestAnimationFrame==\\\"function\\\"?n=>requestAnimationFrame(n):n=>setTimeout(()=>n(Date.now()),16);function A(){return typeof performance!=\\\"undefined\\\"?performance.now():Date.now()}function y(n,e,t){return Math.min(t,Math.max(e,n))}function H(n){var s;let e=n.borderTopLeftRadius||n.borderRadius;if(!e)return null;let t=(s=e.split(/\\\\s+/)[0])!=null?s:\\\"\\\";if(t.endsWith(\\\"%\\\"))return null;let i=Number.parseFloat(t);return Number.isFinite(i)?i:null}function Y(n){return{\\\"padding-top\\\":n.paddingTop,\\\"padding-right\\\":n.paddingRight,\\\"padding-bottom\\\":n.paddingBottom,\\\"padding-left\\\":n.paddingLeft}}function u(n,e,t={}){let i=document.createElement(n);e&&(i.className=e);for(let s of Object.keys(t)){let r=t[s];r!==void 0&&i.style.setProperty(s,r)}return i}function h(n={},e=\\\"\\\"){return u(\\\"div\\\",`skl-block ${e}`.trim(),n)}function de(n){let e=n.match(/rgba?\\\\(([^)]+)\\\\)/i);if(!e||!e[1])return null;let t=e[1].split(\\\",\\\").map(l=>Number.parseFloat(l.trim())),[i,s,r,o]=t;if(i===void 0||s===void 0||r===void 0||o!==void 0&&o<.5)return null;let a=l=>{let c=l/255;return c<=.03928?c/12.92:((c+.055)/1.055)**2.4};return .2126*a(i)+.7152*a(s)+.0722*a(r)}function ue(n){let e=n,t=0;for(;e&&t<24;){let s=\\\"\\\";try{s=getComputedStyle(e).backgroundColor}catch{s=\\\"\\\"}let r=de(s);if(r!==null)return{tone:r<.42?\\\"dark\\\":\\\"light\\\",color:s};e=e.parentElement,t++}let i=typeof matchMedia==\\\"function\\\"&&matchMedia(\\\"(prefers-color-scheme: dark)\\\").matches;return{tone:i?\\\"dark\\\":\\\"light\\\",color:i?\\\"#0b0d12\\\":\\\"#ffffff\\\"}}function p(n,e){return h({width:n,...e?{height:e}:{}},\\\"skl-line\\\")}function pe(n){var i;let e=u(\\\"div\\\",\\\"skl-lines\\\"),t=[\\\"100%\\\",\\\"92%\\\",\\\"97%\\\",\\\"88%\\\",\\\"94%\\\",\\\"84%\\\"];for(let s=0;s<n;s++){let r=s===n-1&&n>1;e.appendChild(p(r?\\\"58%\\\":(i=t[s%t.length])!=null?i:\\\"100%\\\"))}return e}function ce(n){var s;let e=u(\\\"div\\\",\\\"skl-card\\\"),t=(s=n.ratio)!=null?s:\\\"16/10\\\";e.appendChild(h({width:\\\"100%\\\",\\\"aspect-ratio\\\":t})),e.appendChild(p(\\\"68%\\\",\\\"0.8em\\\"));let i=u(\\\"div\\\",\\\"skl-lines\\\");return i.appendChild(p(\\\"100%\\\")),i.appendChild(p(\\\"82%\\\")),e.appendChild(i),e.appendChild(h({width:\\\"34%\\\",height:\\\"1.15em\\\",\\\"border-radius\\\":\\\"999px\\\"})),e}function he(n){var s;let e=u(\\\"div\\\",\\\"skl-cell\\\");e.appendChild(h({width:\\\"100%\\\",\\\"aspect-ratio\\\":(s=n.ratio)!=null?s:\\\"16/10\\\",\\\"border-radius\\\":\\\"0\\\"}));let t=u(\\\"div\\\",\\\"skl-cell-body\\\");t.appendChild(p(\\\"58%\\\",\\\"0.82em\\\")),t.appendChild(p(\\\"36%\\\")),t.appendChild(p(\\\"92%\\\"));let i=u(\\\"div\\\",\\\"skl-row\\\",{\\\"justify-content\\\":\\\"space-between\\\",\\\"margin-top\\\":\\\"6px\\\"});return i.appendChild(h({width:\\\"28%\\\",height:\\\"1.15em\\\",\\\"border-radius\\\":\\\"999px\\\"})),i.appendChild(h({width:\\\"24%\\\",height:\\\"1.5em\\\",\\\"border-radius\\\":\\\"999px\\\"})),t.appendChild(i),e.appendChild(t),e}function U(n){let e=u(\\\"div\\\",\\\"skl-row\\\");n&&e.appendChild(h({width:\\\"40px\\\",height:\\\"40px\\\"},\\\"skl-circle\\\"));let t=u(\\\"div\\\",\\\"skl-lines\\\");return t.appendChild(p(\\\"62%\\\")),t.appendChild(p(\\\"40%\\\")),e.appendChild(t),e}function fe(n){let e=u(\\\"div\\\",\\\"skl-table\\\"),t=u(\\\"div\\\",\\\"skl-trow skl-thead\\\");for(let s of[\\\"54%\\\",\\\"66%\\\",\\\"58%\\\",\\\"50%\\\"])t.appendChild(p(s,\\\"10px\\\"));e.appendChild(t);let i=y(n.count,1,12);for(let s=0;s<i;s++){let r=u(\\\"div\\\",\\\"skl-trow\\\"),o=u(\\\"div\\\",\\\"skl-who\\\");o.appendChild(h({width:\\\"30px\\\",height:\\\"30px\\\",\\\"min-height\\\":\\\"0\\\"},\\\"skl-circle\\\"));let a=u(\\\"div\\\",\\\"skl-lines\\\",{gap:\\\"7px\\\"});a.appendChild(p(\\\"86%\\\",\\\"10px\\\")),a.appendChild(p(\\\"52%\\\",\\\"10px\\\")),o.appendChild(a),r.appendChild(o),r.appendChild(p(\\\"62%\\\",\\\"12px\\\")),r.appendChild(p(\\\"54%\\\",\\\"12px\\\")),r.appendChild(p(\\\"58%\\\",\\\"12px\\\")),e.appendChild(r)}return e}function me(){let n=u(\\\"div\\\",\\\"skl-chart\\\"),e=[\\\"38%\\\",\\\"64%\\\",\\\"48%\\\",\\\"86%\\\",\\\"58%\\\",\\\"74%\\\",\\\"44%\\\"];for(let t of e)n.appendChild(h({height:t,width:\\\"100%\\\",\\\"border-radius\\\":\\\"6px\\\"}));return n}function ke(n){var i;let e=u(\\\"div\\\",\\\"skl-lines\\\",{width:\\\"100%\\\",height:\\\"100%\\\"}),t=(i=n.ratio)!=null?i:\\\"16/9\\\";return e.appendChild(h({width:\\\"100%\\\",height:\\\"100%\\\",\\\"min-height\\\":\\\"48px\\\",\\\"aspect-ratio\\\":t,\\\"border-radius\\\":\\\"inherit\\\"})),e}function ge(n){let e=n.height?`${n.height}px`:\\\"clamp(32px, 42%, 64px)\\\",t=u(\\\"div\\\",\\\"skl-lines\\\",{width:\\\"100%\\\",height:\\\"100%\\\",\\\"align-items\\\":\\\"center\\\",\\\"justify-content\\\":\\\"center\\\"});return t.appendChild(h({width:e,height:e,\\\"min-height\\\":\\\"0\\\"},\\\"skl-circle\\\")),t}function be(n){let e=u(\\\"div\\\",\\\"skl-lines\\\",{\\\"align-items\\\":\\\"center\\\",\\\"justify-content\\\":\\\"center\\\",height:\\\"100%\\\",gap:\\\"12px\\\"}),t=n.height?`${n.height}px`:\\\"72px\\\";return e.appendChild(h({width:t,height:t,\\\"min-height\\\":\\\"0\\\"},\\\"skl-circle\\\")),e.appendChild(p(\\\"46%\\\")),e.appendChild(p(\\\"30%\\\")),e}function ve(n){let e=y(n.count,1,8),t=u(\\\"div\\\",\\\"skl-lines\\\",{width:\\\"100%\\\",gap:\\\"12px\\\"});t.appendChild(p(\\\"34%\\\",\\\"0.85em\\\"));for(let i=0;i<e;i++){let s=u(\\\"div\\\",\\\"skl-cell skl-cell-pad\\\");s.appendChild(U(!0)),t.appendChild(s)}return t}function ye(n,e,t,i){var F,W,D;let s=n,r=s.getBoundingClientRect(),o=r.left+s.clientLeft,a=r.top+s.clientTop,l=s.clientWidth||r.width,c=s.clientHeight||r.height;if(l<8||c<8)return 0;let f=[],d=(v,k)=>{for(let m of Array.from(v.children)){if(m.classList.contains(\\\"skl-overlay\\\"))continue;let b=getComputedStyle(m);b.display===\\\"none\\\"||b.visibility===\\\"hidden\\\"||(f.push(m),k<i&&d(m,k+1))}};d(n,1);let g=0;for(let v of f){if(g>=64)break;let k=v.getBoundingClientRect();if(k.width<4||k.height<4)continue;let m=k.left-o,b=k.top-a;if(m>l-2||b>c-2)continue;m=y(m,0,Math.max(0,l-4)),b=y(b,0,Math.max(0,c-4));let V=Math.min(k.width,l-m),M=Math.min(k.height,c-b);if(V<4||M<4)continue;let ne=getComputedStyle(v),ie=(W=t.radius)!=null?W:v.tagName===\\\"IMG\\\"?8:y((F=H(ne))!=null?F:8,0,24),se=v.childElementCount===0&&((D=v.textContent)!=null?D:\\\"\\\").trim().length>0,re=h({left:`${Math.round(m)}px`,top:`${Math.round(b)}px`,width:`${Math.round(V)}px`,height:`${Math.round(M)}px`,\\\"border-radius\\\":`${ie}px`,...se?{\\\"border-radius\\\":\\\"999px\\\",height:`${Math.min(Math.round(M),16)}px`}:{}});e.appendChild(re),g++}return g}function R(n){var f;let{host:e,spec:t,media:i,preset:s}=n,r=u(\\\"div\\\",\\\"skl-overlay\\\");r.dataset.sklPreset=s,r.dataset.sklKind=i?\\\"media\\\":\\\"container\\\",r.setAttribute(\\\"aria-hidden\\\",\\\"true\\\");let o=getComputedStyle(e),a=ue(i&&(f=e.parentElement)!=null?f:e),l=n.theme===\\\"light\\\"||n.theme===\\\"dark\\\"?n.theme:null;if(r.dataset.sklTone=l!=null?l:a.tone,r.style.setProperty(\\\"--skl-solid\\\",a.color),i){r.dataset.sklLayout=\\\"fill\\\";let d=o.borderRadius;return d&&d!==\\\"0px\\\"&&(r.style.borderRadius=d),r.appendChild(h({width:\\\"100%\\\",height:\\\"100%\\\",\\\"border-radius\\\":\\\"inherit\\\"})),r}let c=Y(o);for(let d of Object.keys(c)){let g=c[d];g&&g!==\\\"0px\\\"&&r.style.setProperty(d,g)}switch(t.radius&&r.style.setProperty(\\\"--skl-radius\\\",`${t.radius}px`),t.shape){case\\\"text\\\":r.dataset.sklLayout=\\\"stack\\\",r.appendChild(pe(t.lines));break;case\\\"card\\\":r.dataset.sklLayout=\\\"stack\\\",r.appendChild(ce(t));break;case\\\"grid\\\":{r.dataset.sklLayout=\\\"grid\\\",r.style.setProperty(\\\"--skl-cols\\\",String(t.cols));for(let d=0;d<t.count;d++)r.appendChild(he(t));break}case\\\"list\\\":{r.dataset.sklLayout=\\\"stack\\\";for(let d=0;d<t.count;d++)r.appendChild(U(!0));break}case\\\"table\\\":r.dataset.sklLayout=\\\"stack\\\",r.appendChild(fe(t));break;case\\\"media\\\":r.dataset.sklLayout=\\\"stack\\\",r.appendChild(ke(t));break;case\\\"avatar\\\":r.dataset.sklLayout=\\\"stack\\\",r.appendChild(ge(t));break;case\\\"chart\\\":r.dataset.sklLayout=\\\"stack\\\",r.appendChild(me());break;case\\\"profile\\\":r.dataset.sklLayout=\\\"stack\\\",r.appendChild(be(t));break;default:{r.dataset.sklLayout=\\\"mirror\\\";let d=e.getAttribute(\\\"data-skeleton-depth\\\")===\\\"2\\\"?2:1;ye(e,r,t,d)||(r.dataset.sklLayout=\\\"stack\\\",r.appendChild(ve(t)))}}if(!r.style.getPropertyValue(\\\"--skl-radius\\\")&&t.radius===null){let d=H(o);d!==null&&d<=32&&r.style.setProperty(\\\"--skl-radius\\\",`${d}px`)}return r}var J=`/*!\\n * skeleton-load v0.1.0 \\\\u2014 MIT\\n * https://github.com/skeleton-load\\n */\\n\\n.skl-host,\\n[data-skl-state] {\\n position: relative;\\n}\\n\\n/* Content is kept in the layout (no CLS) but hidden while the skeleton plays. */\\n[data-skl-state=\\\"loading\\\"] > *:not(.skl-overlay) {\\n visibility: hidden !important;\\n}\\n\\n.skl-overlay {\\n position: absolute;\\n inset: 0;\\n z-index: 4;\\n overflow: hidden;\\n pointer-events: none;\\n border-radius: inherit;\\n opacity: 0;\\n transition: opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);\\n contain: layout paint style;\\n\\n --skl-base: rgba(17, 20, 28, 0.1);\\n --skl-highlight: rgba(255, 255, 255, 0.72);\\n --skl-radius: 8px;\\n --skl-gap: 10px;\\n --skl-surface: #ffffff;\\n --skl-border: rgba(17, 20, 28, 0.08);\\n --skl-line: rgba(17, 20, 28, 0.08);\\n --skl-solid: #f1f1f6;\\n}\\n\\n/* A dark surface needs brighter placeholders to be readable at all. */\\n.skl-overlay[data-skl-tone=\\\"dark\\\"] {\\n --skl-base: rgba(255, 255, 255, 0.115);\\n --skl-highlight: rgba(255, 255, 255, 0.22);\\n --skl-surface: rgba(255, 255, 255, 0.035);\\n --skl-border: rgba(255, 255, 255, 0.07);\\n --skl-line: rgba(255, 255, 255, 0.07);\\n --skl-solid: #14161c;\\n}\\n\\n.skl-overlay[data-skl-show=\\\"1\\\"] {\\n opacity: 1;\\n}\\n\\n/* Temporary state used to measure the skeleton's natural height. */\\n.skl-overlay[data-skl-measure] {\\n inset: auto;\\n top: 0;\\n left: 0;\\n opacity: 0;\\n}\\n\\n.skl-overlay[data-skl-kind=\\\"media\\\"] {\\n background: var(--skl-solid);\\n border-radius: var(--skl-radius);\\n}\\n\\n/* ---------- blocks ---------- */\\n\\n.skl-block {\\n position: relative;\\n min-height: 8px;\\n overflow: hidden;\\n border-radius: var(--skl-radius);\\n background: var(--skl-base);\\n}\\n\\n.skl-block::after {\\n content: \\\"\\\";\\n position: absolute;\\n inset: 0;\\n background: linear-gradient(\\n 90deg,\\n transparent 0%,\\n var(--skl-highlight) 50%,\\n transparent 100%\\n );\\n transform: translateX(-100%);\\n animation: skl-shimmer var(--skl-speed, 1.6s) cubic-bezier(0.45, 0, 0.25, 1) infinite;\\n will-change: transform;\\n}\\n\\n.skl-overlay[data-skl-preset=\\\"pulse\\\"] .skl-block::after,\\n.skl-overlay[data-skl-preset=\\\"static\\\"] .skl-block::after {\\n display: none;\\n}\\n\\n.skl-overlay[data-skl-preset=\\\"pulse\\\"] .skl-block {\\n animation: skl-pulse 1.8s ease-in-out infinite;\\n}\\n\\n.skl-overlay[data-skl-preset=\\\"static\\\"] .skl-block {\\n opacity: 0.92;\\n}\\n\\n/* Pause everything while the tab is in the background. */\\nhtml[data-skl-idle] .skl-block::after,\\nhtml[data-skl-idle] .skl-block {\\n animation-play-state: paused;\\n}\\n\\n/* ---------- layouts ---------- */\\n\\n.skl-overlay[data-skl-layout=\\\"stack\\\"] {\\n display: flex;\\n flex-direction: column;\\n gap: var(--skl-gap);\\n}\\n\\n.skl-overlay[data-skl-layout=\\\"row\\\"] {\\n display: flex;\\n flex-direction: row;\\n align-items: center;\\n gap: var(--skl-gap);\\n}\\n\\n.skl-overlay[data-skl-layout=\\\"grid\\\"] {\\n display: grid;\\n gap: var(--skl-gap);\\n grid-template-columns: repeat(var(--skl-cols, 3), minmax(0, 1fr));\\n}\\n\\n.skl-overlay[data-skl-layout=\\\"center\\\"] {\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n gap: var(--skl-gap);\\n}\\n\\n.skl-overlay[data-skl-layout=\\\"mirror\\\"] {\\n padding: 0;\\n}\\n\\n.skl-overlay[data-skl-layout=\\\"mirror\\\"] > .skl-block {\\n position: absolute;\\n min-height: 0;\\n}\\n\\n.skl-card {\\n display: flex;\\n flex-direction: column;\\n gap: var(--skl-gap);\\n min-width: 0;\\n}\\n\\n.skl-cell {\\n display: flex;\\n flex-direction: column;\\n gap: 0;\\n min-width: 0;\\n overflow: hidden;\\n border-radius: calc(var(--skl-radius) + 8px);\\n background: var(--skl-surface);\\n border: 1px solid var(--skl-border);\\n}\\n\\n.skl-cell-body {\\n display: flex;\\n flex-direction: column;\\n gap: 8px;\\n padding: 16px;\\n}\\n\\n.skl-cell-pad {\\n padding: 20px 18px;\\n}\\n\\n.skl-row {\\n display: flex;\\n align-items: center;\\n gap: var(--skl-gap);\\n min-width: 0;\\n}\\n\\n.skl-lines {\\n display: flex;\\n flex: 1 1 auto;\\n flex-direction: column;\\n gap: 8px;\\n min-width: 0;\\n}\\n\\n.skl-line {\\n height: var(--skl-line-h, 0.72em);\\n min-height: 7px;\\n border-radius: 999px;\\n}\\n\\n.skl-circle {\\n border-radius: 50%;\\n flex: 0 0 auto;\\n}\\n\\n.skl-chart {\\n display: flex;\\n align-items: flex-end;\\n gap: var(--skl-gap);\\n height: 100%;\\n min-height: 90px;\\n}\\n\\n.skl-chart > .skl-block {\\n flex: 1 1 0;\\n min-width: 0;\\n}\\n\\n/* ---------- table ---------- */\\n\\n.skl-table {\\n display: flex;\\n flex-direction: column;\\n width: 100%;\\n}\\n\\n.skl-trow {\\n display: grid;\\n grid-template-columns: 2.2fr 1fr 1fr 0.9fr;\\n gap: 14px;\\n align-items: center;\\n padding: 19px 8px;\\n}\\n\\n.skl-trow + .skl-trow {\\n border-top: 1px solid var(--skl-line);\\n}\\n\\n.skl-thead {\\n padding-top: 2px;\\n padding-bottom: 12px;\\n}\\n\\n.skl-thead .skl-line {\\n min-height: 8px;\\n}\\n\\n.skl-who {\\n display: flex;\\n align-items: center;\\n gap: 10px;\\n min-width: 0;\\n}\\n\\n/* ---------- reveal ---------- */\\n\\n[data-skl-state=\\\"done\\\"] > *:not(.skl-overlay) {\\n animation: skl-content-in 200ms ease both;\\n}\\n\\n/* ---------- debug ---------- */\\n\\n[data-skl-debug] .skl-block {\\n outline: 1px dashed rgba(255, 64, 129, 0.7);\\n outline-offset: -1px;\\n}\\n\\n[data-skl-debug] .skl-overlay {\\n outline: 2px solid rgba(255, 64, 129, 0.9);\\n outline-offset: -2px;\\n}\\n\\n/* ---------- keyframes ---------- */\\n\\n@keyframes skl-shimmer {\\n from {\\n transform: translateX(-100%);\\n }\\n to {\\n transform: translateX(100%);\\n }\\n}\\n\\n@keyframes skl-pulse {\\n 0%,\\n 100% {\\n opacity: 0.55;\\n }\\n 50% {\\n opacity: 1;\\n }\\n}\\n\\n@keyframes skl-content-in {\\n from {\\n opacity: 0;\\n }\\n to {\\n opacity: 1;\\n }\\n}\\n\\n/* ---------- preferences ---------- */\\n\\n@media (prefers-reduced-motion: reduce) {\\n .skl-overlay {\\n transition: none;\\n }\\n\\n .skl-block::after {\\n display: none;\\n }\\n\\n .skl-overlay[data-skl-preset=\\\"pulse\\\"] .skl-block,\\n [data-skl-state=\\\"done\\\"] > * {\\n animation: none;\\n }\\n}\\n\\n@media (prefers-reduced-data: reduce) {\\n .skl-block::after {\\n display: none;\\n }\\n}\\n\\n@media (forced-colors: active) {\\n .skl-block {\\n background: CanvasText;\\n opacity: 0.25;\\n }\\n}\\n`;var I=\\\"skeleton-load-styles\\\";function Q(n){var s;if(typeof document==\\\"undefined\\\")return null;let e=document.getElementById(I);if(e)return e;let t=document.createElement(\\\"style\\\");return t.id=I,t.setAttribute(\\\"data-skeleton-load\\\",\\\"\\\"),n&&t.setAttribute(\\\"nonce\\\",n),t.textContent=J,((s=document.head)!=null?s:document.documentElement).prepend(t),t}function Z(){var n;(n=document.getElementById(I))==null||n.remove()}function Ee(n){if(n.hidden)return!0;try{return getComputedStyle(n).display===\\\"none\\\"}catch{return!1}}var S=class{constructor(e={}){this.entries=new Map;this.waiting=new Map;this.mo=null;this.io=null;this.pending=new Set;this.rafId=0;this.styleEl=null;this.started=!1;this.destroyed=!1;this.visibilityHandler=null;this.stats={shown:0,hidden:0,total:0};this.raw={...e},this.resolved=C(this.raw)}get options(){return this.resolved}start(){return typeof document==\\\"undefined\\\"?this:(this.destroyed=!1,this.started?this:(this.started=!0,this.resolved.css&&!this.styleEl&&(this.styleEl=Q(this.resolved.nonce)),this.resolved.debug&&document.documentElement.setAttribute(\\\"data-skl-debug\\\",\\\"\\\"),this.observe(),this.bindVisibility(),this.refresh(),this))}stop(){var e,t;this.started=!1,(e=this.mo)==null||e.disconnect(),this.mo=null,(t=this.io)==null||t.disconnect(),this.io=null,this.waiting.clear(),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=0);for(let i of Array.from(this.entries.values()))i.state=\\\"done\\\",this.teardown(i,!0);return this.entries.clear(),document.documentElement.removeAttribute(\\\"data-skl-debug\\\"),this}destroy(){this.stop(),this.destroyed=!0,this.styleEl&&(Z(),this.styleEl=null)}update(e){var t,i;if(this.raw={...this.raw,...e},this.resolved=C(this.raw),this.started){for(let s of this.entries.values()){let r=(i=(t=s.spec.preset)!=null?t:T(s.host))!=null?i:this.resolved.preset;s.preset!==r&&(s.preset=r,s.overlay&&(s.overlay.dataset.sklPreset=r))}this.refresh()}return this}setPreset(e){return this.update({preset:e})}refresh(e){var t;return this.started||this.start(),this.scan((t=e!=null?e:this.resolved.root)!=null?t:document),this}show(e){return this.started||this.start(),this.consider(e,!0),this}hide(e){let t=this.entries.get(e);return t&&this.finish(t),this}get active(){return Array.from(this.entries.values()).filter(e=>e.state===\\\"shown\\\").map(e=>e.host)}get report(){return{...this.stats}}observe(){typeof MutationObserver!=\\\"undefined\\\"&&(this.mo||(this.mo=new MutationObserver(e=>this.onMutations(e))),this.mo.observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[\\\"data-skeleton\\\",\\\"data-skeleton-state\\\",\\\"data-skeleton-preset\\\",\\\"data-skeleton-lines\\\",\\\"src\\\",\\\"loading\\\"]}))}bindVisibility(){this.visibilityHandler||(this.visibilityHandler=()=>{let e=document.documentElement;document.hidden?e.setAttribute(\\\"data-skl-idle\\\",\\\"\\\"):e.removeAttribute(\\\"data-skl-idle\\\")},document.addEventListener(\\\"visibilitychange\\\",this.visibilityHandler))}onMutations(e){let t=[];for(let i of e){let s=i.target;if(i.type===\\\"attributes\\\"){let o=i.attributeName;if(o===\\\"data-skeleton-state\\\"){this.syncState(s);continue}if(o===\\\"data-skeleton\\\"||o===\\\"data-skeleton-preset\\\"||o===\\\"data-skeleton-lines\\\"){this.entries.has(s)?this.restart(s):this.resolved.observe&&t.push(s);continue}o===\\\"src\\\"&&L(s)&&(this.entries.has(s)?this.restart(s):this.resolved.observe&&t.push(s));continue}let r=this.entries.get(s);if(r&&!r.media&&x(s)&&this.finish(r),i.type===\\\"characterData\\\"){let o=s.parentElement,a=o?this.entries.get(o):void 0;a&&!a.media&&x(o)&&this.finish(a);continue}this.resolved.observe&&i.addedNodes.forEach(o=>{o.nodeType===1&&t.push(o)})}t.length&&this.queueScan(t)}queueScan(e){for(let t of e)this.pending.add(t);this.rafId||(this.rafId=P(()=>{this.rafId=0;let t=Array.from(this.pending);this.pending.clear();for(let i of t)i.isConnected&&this.scan(i)}))}syncState(e){let t=e.getAttribute(\\\"data-skeleton-state\\\"),i=this.entries.get(e);if(t===\\\"loading\\\"){i?i.state===\\\"done\\\"?this.restart(e):i.forced=!0:this.consider(e,!0);return}t===\\\"done\\\"&&i&&this.finish(i)}restart(e){let t=this.entries.get(e);t&&this.teardown(t,!0),P(()=>this.consider(e,!1))}scan(e){if(!e)return;let t=[];e instanceof Element&&t.push(e);let i=e.querySelectorAll;typeof i==\\\"function\\\"&&i.call(e,\\\"img,video,iframe,[data-skeleton]\\\").forEach(s=>t.push(s));for(let s of t)this.consider(s,!1)}consider(e,t){if(!e.isConnected&&t||this.entries.has(e)||!t&&K(e))return;let i=L(e),s=q(e);if(!i&&s.shape===\\\"off\\\"||!t&&e.closest('[data-skl-state=\\\"loading\\\"]'))return;if(i){let o=e.hasAttribute(\\\"data-skeleton\\\");if(!this.resolved.autoMedia&&!o&&!t||!t&&s.state===\\\"done\\\"||!t&&O(e)&&s.state!==\\\"loading\\\")return;if(!t&&this.resolved.observe&&X(e)){this.watchLazy(e);return}this.addEntry(e,!0,s,t||s.state===\\\"loading\\\");return}if(!t&&s.state===\\\"done\\\")return;let r=t||s.state===\\\"loading\\\";!r&&x(e)||!r&&Ee(e)||this.addEntry(e,!1,s,r)}watchLazy(e){if(typeof IntersectionObserver==\\\"undefined\\\"){this.consider(e,!0);return}this.waiting.has(e)||(this.io||(this.io=new IntersectionObserver(t=>{var i;for(let s of t){if(!s.isIntersecting)continue;let r=this.waiting.get(s.target);r&&(this.waiting.delete(s.target),(i=this.io)==null||i.unobserve(s.target),r())}},{rootMargin:\\\"320px 0px\\\"})),this.waiting.set(e,()=>this.consider(e,!1)),this.io.observe(e))}addEntry(e,t,i,s){var l,c;if(this.entries.has(e))return;let r=(c=(l=i.preset)!=null?l:T(e))!=null?c:this.resolved.preset,o={host:e,media:t,spec:i,preset:r,forced:s,state:\\\"pending\\\",overlay:null,container:null,timer:null,guard:null,hideTimer:null,fadeTimer:null,shownAt:0,cleanup:[]};this.entries.set(e,o),this.stats.total++;let a=this.resolved.delay;if(a<=0?this.paint(o):o.timer=setTimeout(()=>this.paint(o),a),this.resolved.maxWait>0&&(o.guard=setTimeout(()=>this.finish(o),this.resolved.maxWait+a)),t){let f=()=>this.finish(o);e.addEventListener(\\\"load\\\",f,{once:!0}),e.addEventListener(\\\"error\\\",f,{once:!0}),o.cleanup.push(()=>{e.removeEventListener(\\\"load\\\",f),e.removeEventListener(\\\"error\\\",f)})}}paint(e){var s,r;if(e.state!==\\\"pending\\\")return;let t=e.host;if(e.media){if(O(t)&&!e.forced){this.finish(e);return}}else if(!e.forced&&x(t)){this.finish(e);return}let i=R({host:t,spec:e.spec,media:e.media,preset:e.preset,theme:this.themeOf(t)});e.media?this.mountMedia(e,i):this.mountContainer(e,i),e.overlay=i,e.state=\\\"shown\\\",e.shownAt=A(),this.stats.shown++,this.resolved.debug&&i.setAttribute(\\\"data-skl-debug\\\",\\\"\\\"),i.offsetWidth,i.dataset.sklShow=\\\"1\\\",(r=(s=this.resolved).onShow)==null||r.call(s,t)}mountContainer(e,t){let i=e.host;if(i.classList.add(\\\"skl-host\\\"),i.dataset.sklShape=e.spec.shape,i.dataset.sklState=\\\"loading\\\",i.appendChild(t),e.spec.height)e.prevMinHeight=i.style.minHeight,i.style.minHeight=`${e.spec.height}px`;else if(t.dataset.sklLayout!==\\\"mirror\\\"){let s=this.measure(t);if(s>8){let r=i.getBoundingClientRect().height;s>r+2&&(e.prevMinHeight=i.style.minHeight,i.style.minHeight=`${Math.ceil(s)}px`)}}if(e.spec.shape===\\\"auto\\\"&&typeof ResizeObserver!=\\\"undefined\\\"){let s=new ResizeObserver(()=>this.repaint(e));s.observe(i),e.cleanup.push(()=>s.disconnect())}}measure(e){let t=e.parentElement;e.dataset.sklMeasure=\\\"\\\",t&&t.clientWidth>0&&(e.style.width=`${t.clientWidth}px`);let i=e.getBoundingClientRect().height;return e.style.removeProperty(\\\"width\\\"),delete e.dataset.sklMeasure,i}mountMedia(e,t){let i=e.host,s=i.parentElement;if(!s)return;let r=\\\"\\\";try{r=getComputedStyle(s).position}catch{r=\\\"static\\\"}r===\\\"static\\\"&&(e.prevParentPosition=s.style.position,s.style.position=\\\"relative\\\",t.dataset.sklPatched=\\\"1\\\"),s.appendChild(t),e.container=s,e.prevVisibility=i.style.visibility,i.style.visibility=\\\"hidden\\\";let o=()=>{if(!t.isConnected)return;let a=s.getBoundingClientRect(),l=i.getBoundingClientRect();t.style.left=`${l.left-a.left-s.clientLeft}px`,t.style.top=`${l.top-a.top-s.clientTop}px`,t.style.width=`${l.width}px`,t.style.height=`${l.height}px`};if(o(),typeof ResizeObserver!=\\\"undefined\\\"){let a=new ResizeObserver(o);a.observe(i),a.observe(s),e.cleanup.push(()=>a.disconnect())}typeof window!=\\\"undefined\\\"&&(window.addEventListener(\\\"resize\\\",o),e.cleanup.push(()=>window.removeEventListener(\\\"resize\\\",o))),e.cleanup.push(()=>{var a;t.dataset.sklPatched&&(s.style.position=(a=e.prevParentPosition)!=null?a:\\\"\\\"),e.prevVisibility!==void 0&&(i.style.visibility=e.prevVisibility)})}repaint(e){if(e.state!==\\\"shown\\\"||!e.overlay||!e.overlay.isConnected)return;let t=R({host:e.host,spec:e.spec,media:e.media,preset:e.preset,theme:this.themeOf(e.host)});t.dataset.sklShow=\\\"1\\\",this.resolved.debug&&t.setAttribute(\\\"data-skl-debug\\\",\\\"\\\"),e.overlay.replaceWith(t),e.overlay=t}finish(e){if(e.state===\\\"done\\\")return;let t=e.state===\\\"shown\\\";e.state=\\\"done\\\",this.clearTimers(e);let i=t?Math.max(0,this.resolved.minVisible-(A()-e.shownAt)):0;if(!e.overlay){this.teardown(e,!1);return}e.hideTimer=setTimeout(()=>this.teardown(e,!1),i)}teardown(e,t){var o,a;this.entries.delete(e.host),this.clearTimers(e);for(let l of e.cleanup)try{l()}catch{}e.cleanup=[];let i=e.host;if(e.prevMinHeight!==void 0&&(i.style.minHeight=e.prevMinHeight),i.classList.remove(\\\"skl-host\\\"),!e.overlay){i.dataset.sklState===\\\"loading\\\"&&delete i.dataset.sklState,delete i.dataset.sklShape;return}let s=e.overlay;i.dataset.sklState=\\\"done\\\";let r=()=>{s.remove(),i.dataset.sklState===\\\"done\\\"&&delete i.dataset.sklState,delete i.dataset.sklShape,s.remove()};t||this.prefersReducedMotion()?r():(s.dataset.sklShow=\\\"0\\\",e.fadeTimer=setTimeout(r,220)),this.stats.hidden++,(a=(o=this.resolved).onHide)==null||a.call(o,i),this.started&&setTimeout(()=>this.scan(i),0)}themeOf(e){var t;return(t=_(e))!=null?t:this.resolved.theme}prefersReducedMotion(){if(!this.resolved.respectReducedMotion||typeof matchMedia!=\\\"function\\\")return!1;try{return matchMedia(\\\"(prefers-reduced-motion: reduce)\\\").matches}catch{return!1}}clearTimers(e){e.timer&&clearTimeout(e.timer),e.guard&&clearTimeout(e.guard),e.hideTimer&&clearTimeout(e.hideTimer),e.timer=null,e.guard=null,e.hideTimer=null}};var N=Symbol.for(\\\"skeleton-load:default\\\");function xe(){let n=globalThis;return n[N]||(n[N]={}),n[N]}function z(n){let e=xe();return e.engine?n&&e.engine.update(n):e.engine=new S(n),e.engine}function B(n){return z(n).start()}var te,$=typeof window!=\\\"undefined\\\"?(te=window.SKELETON_LOAD_CONFIG)!=null?te:{}:{};function ee(){$.autoStart!==!1&&B($)}typeof document!=\\\"undefined\\\"&&(document.readyState===\\\"loading\\\"?document.addEventListener(\\\"DOMContentLoaded\\\",ee,{once:!0}):ee());if(typeof window!=\\\"undefined\\\"){let n=z($);window.SkeletonLoad={engine:n,start(e){return B(e)},stop(){n.stop()},refresh(e){n.refresh(e)},setPreset(e){n.setPreset(e)},show(e){n.show(e)},hide(e){n.hide(e)}}}})();\\n\"\n","import { minifyCss } from '../core/minify'\nimport { cssText } from '../core/style'\nimport type { SkeletonLoadPluginOptions } from './vite'\nimport runtimeCode from './runtime.generated'\n\ninterface Compilation {\n hooks: {\n processAssets: {\n tap: (options: { name: string; stage?: number }, callback: (assets: Record<string, Source>) => void) => void\n }\n }\n getAsset?: (name: string) => { source: { source: () => string | Buffer } } | undefined\n updateAsset?: (name: string, source: Source) => void\n assets?: Record<string, Source>\n}\n\ninterface Source {\n source: () => string | Buffer\n size: () => number\n}\n\ninterface Compiler {\n hooks: { thisCompilation: { tap: (name: string, callback: (compilation: Compilation) => void) => void } }\n webpack?: { sources?: { RawSource: new (value: string) => Source } }\n}\n\ninterface Stats {\n toJson: (options: { all: boolean; assets: boolean }) => { assets?: Array<{ name: string }> }\n}\n\nfunction configJson(options: SkeletonLoadPluginOptions): string {\n const config: Record<string, unknown> = {}\n for (const key of ['preset', 'theme', 'delay', 'minVisible', 'maxWait', 'autoMedia', 'observe', 'debug'] as const) {\n const value = options[key]\n if (value !== undefined) config[key] = value as unknown\n }\n return JSON.stringify(config)\n}\n\nfunction snippet(options: SkeletonLoadPluginOptions): string {\n const parts: string[] = []\n if (options.css !== false) {\n parts.push(`<style data-skeleton-load>${minifyCss(cssText)}</style>`)\n }\n if ((options.runtime ?? 'inline') !== 'none') {\n parts.push(`<script>window.SKELETON_LOAD_CONFIG=Object.assign({},window.SKELETON_LOAD_CONFIG,${configJson(options)})</script>`)\n if ((options.runtime ?? 'inline') === 'inline') {\n parts.push(`<script>${runtimeCode}</script>`)\n } else {\n parts.push(`<script src=\"${options.src ?? '/skeleton-load.auto.js'}\" defer></script>`)\n }\n }\n if (options.autoMark) {\n return parts.join('')\n }\n return parts.join('')\n}\n\nfunction inject(html: string, code: string): string {\n if (!code) return html\n if (/<\\/head>/i.test(html)) return html.replace(/<\\/head>/i, `${code}</head>`)\n return `${code}${html}`\n}\n\nexport class SkeletonLoadPlugin {\n private options: SkeletonLoadPluginOptions\n constructor(options: SkeletonLoadPluginOptions = {}) {\n this.options = options\n }\n\n apply(compiler: Compiler): void {\n compiler.hooks.thisCompilation.tap('SkeletonLoadPlugin', (compilation) => {\n compilation.hooks.processAssets.tap({ name: 'SkeletonLoadPlugin', stage: 1000 }, (assets) => {\n const code = snippet(this.options)\n for (const name of Object.keys(assets)) {\n if (!name.endsWith('.html')) continue\n const source = assets[name]\n if (!source) continue\n const html = String(source.source())\n const next = inject(\n this.options.autoMark\n ? html.replace(/<main(\\s[^>]*)?>/i, (match) =>\n /data-skeleton/i.test(match) ? match : match.replace('<main', '<main data-skeleton=\"auto\"'),\n )\n : html,\n code,\n )\n if (next === html) continue\n const RawSource = compiler.webpack?.sources?.RawSource\n if (RawSource) {\n assets[name] = new RawSource(next)\n } else if (compilation.updateAsset) {\n compilation.updateAsset(name, { source: () => next, size: () => next.length })\n }\n }\n })\n })\n }\n}\n\nexport default SkeletonLoadPlugin\nexport type { SkeletonLoadPluginOptions }\n","import { SkeletonLoadPlugin, type SkeletonLoadPluginOptions } from '../plugins/webpack'\n\ninterface NextConfig {\n webpack?: (config: Record<string, unknown>, context: unknown) => Record<string, unknown>\n [key: string]: unknown\n}\n\n/**\n * Adds skeleton-load to a Next.js app (Pages Router and App Router).\n *\n * ```js\n * // next.config.mjs\n * import { withSkeleton } from 'skeleton-load/next'\n * export default withSkeleton({}, { preset: 'shimmer' })\n * ```\n */\nexport function withSkeleton<T extends NextConfig>(config: T = {} as T, options: SkeletonLoadPluginOptions = {}): T {\n const previous = config.webpack\n return {\n ...config,\n webpack(webpackConfig: Record<string, unknown>, context: unknown) {\n const resolved = previous ? previous(webpackConfig, context) : webpackConfig\n const plugins = Array.isArray(resolved.plugins) ? resolved.plugins.slice() : []\n plugins.push(new SkeletonLoadPlugin(options))\n return { ...resolved, plugins }\n },\n }\n}\n\nexport type { SkeletonLoadPluginOptions }\nexport default withSkeleton\n"]}