pixel-mirror 1.0.4 → 2.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.
- package/LICENSE +1 -1
- package/README.md +109 -38
- package/THIRD_PARTY_NOTICES.md +49 -0
- package/dist/index.js +4 -1
- package/index.d.ts +1 -0
- package/package.json +79 -51
- package/plugins/astro.js +16 -10
- package/plugins/script-url.js +4 -0
- package/plugins/vite.js +26 -5
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2025 Peiwen Lu
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -1,84 +1,155 @@
|
|
|
1
1
|
# Pixel Mirror
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Overlay design mockups on web pages for pixel-perfect UI implementation. Features adjustable transparency, scaling, alignment, and grid guides.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Mockup overlay** with opacity, scale, alignment, drag positioning, and a 5-state mode system (visible / locked / dragging / solid / zoomed)
|
|
10
|
+
- **Grid overlay** with layout columns and spacing guides
|
|
11
|
+
- **Desktop**: keyboard shortcuts, Ctrl+Scroll opacity, click-to-zoom (2x), mouse pan
|
|
12
|
+
- **Mobile / Touch**: double-tap solid mode, pinch-to-zoom (0.25x–4x), touch drag & pan, slide-to-adjust opacity
|
|
13
|
+
- **Hybrid device support**: touch and keyboard/mouse inputs coexist seamlessly
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
## Overlay Modes
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
The mockup overlay has 5 modes:
|
|
18
|
+
|
|
19
|
+
| Mode | Description |
|
|
20
|
+
| ------------ | ----------------------------------------------------------------------------- |
|
|
21
|
+
| **Visible** | Default. Drag, adjust opacity/scale/alignment. |
|
|
22
|
+
| **Locked** | Position frozen; clicks, hovers and scrolling pass through to the page. |
|
|
23
|
+
| **Dragging** | Active during drag, returns to visible on release. |
|
|
24
|
+
| **Solid** | 100% opacity for pixel comparison. Desktop: hold `Space`; Mobile: double-tap. |
|
|
25
|
+
| **Zoomed** | 2x zoom with mouse pan. Click in solid mode to enter, click again to leave. |
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### Desktop
|
|
30
|
+
|
|
31
|
+
| Action | Shortcut |
|
|
32
|
+
| ------------------------------- | -------------------------------------------------------------------------------------------- |
|
|
33
|
+
| Add mockups | Drop images on the page, or Mockup Studio |
|
|
34
|
+
| Show / Hide mockup | Toolbar button |
|
|
35
|
+
| Lock / Unlock position | `Escape` or toolbar button |
|
|
36
|
+
| Snap to an edge or center | Hover the alignment button; click it for top center |
|
|
37
|
+
| Adjust opacity | Hover the opacity button, or focus it and press `Enter`, or `Ctrl + Scroll` (click to reset) |
|
|
38
|
+
| Drag mockup | Mouse drag on overlay |
|
|
39
|
+
| Nudge mockup (1px) | Arrow keys |
|
|
40
|
+
| Nudge mockup (10px) | `Shift` + Arrow keys |
|
|
41
|
+
| Enter solid mode (100% opacity) | Hold `Space` |
|
|
42
|
+
| Zoom (2x) in solid mode | Click |
|
|
43
|
+
| Pan in zoomed mode | Move mouse |
|
|
44
|
+
| Cycle scale (1x / 0.5x) | Toolbar button |
|
|
45
|
+
| Grid color opacity | Scroll over the color field in Grid Studio |
|
|
46
|
+
|
|
47
|
+
Moving the mockup only releases the alignment of the axis you move it along: center it horizontally, then nudge it down with the arrow keys to check a section further down the page.
|
|
48
|
+
|
|
49
|
+
### Mobile / Touch
|
|
50
|
+
|
|
51
|
+
| Action | Gesture |
|
|
52
|
+
| ------------------------- | -------------------------------------------------- |
|
|
53
|
+
| Add mockups | Mockup Studio |
|
|
54
|
+
| Show / Hide mockup | Toolbar button |
|
|
55
|
+
| Lock / Unlock position | Toolbar button |
|
|
56
|
+
| Snap to an edge or center | Tap the alignment button; tap again for top center |
|
|
57
|
+
| Adjust opacity | Horizontal slide on opacity button |
|
|
58
|
+
| Drag mockup | Touch drag on overlay |
|
|
59
|
+
| Toggle solid mode | Double-tap anywhere |
|
|
60
|
+
| Pinch zoom in solid mode | Two-finger pinch (0.25x–4x) |
|
|
61
|
+
| Pan in solid mode | Single finger drag |
|
|
62
|
+
| Cycle scale (1x / 0.5x) | Toolbar button |
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
12
65
|
|
|
13
66
|
```bash
|
|
14
67
|
npm install pixel-mirror --save-dev
|
|
15
68
|
```
|
|
16
69
|
|
|
17
|
-
|
|
70
|
+
### Vite
|
|
18
71
|
|
|
19
72
|
```js
|
|
20
|
-
|
|
73
|
+
// vite.config.js
|
|
21
74
|
import pixelMirror from "pixel-mirror/vite";
|
|
22
75
|
|
|
23
76
|
export default defineConfig({
|
|
24
|
-
plugins: [pixelMirror()]
|
|
25
|
-
// ... other configurations
|
|
77
|
+
plugins: [pixelMirror()]
|
|
26
78
|
});
|
|
27
79
|
```
|
|
28
80
|
|
|
29
|
-
The plugin
|
|
81
|
+
The plugin only runs in dev (`vite serve`) and injects the tool into `index.html`.
|
|
30
82
|
|
|
31
|
-
###
|
|
83
|
+
### Any bundler / SSR frameworks (SvelteKit, Nuxt, Remix, ...)
|
|
32
84
|
|
|
33
|
-
|
|
85
|
+
Frameworks that render HTML themselves don't go through Vite's `index.html` transform. Import the package from your client entry instead; it is dropped from production builds:
|
|
34
86
|
|
|
35
|
-
```
|
|
36
|
-
|
|
87
|
+
```js
|
|
88
|
+
if (import.meta.env.DEV) import("pixel-mirror");
|
|
37
89
|
```
|
|
38
90
|
|
|
39
|
-
|
|
91
|
+
### Astro
|
|
40
92
|
|
|
41
93
|
```js
|
|
42
|
-
|
|
94
|
+
// astro.config.mjs
|
|
43
95
|
import pixelMirror from "pixel-mirror/astro";
|
|
44
96
|
|
|
45
97
|
export default defineConfig({
|
|
46
|
-
integrations: [pixelMirror()]
|
|
47
|
-
// ... other configurations
|
|
98
|
+
integrations: [pixelMirror()]
|
|
48
99
|
});
|
|
49
100
|
```
|
|
50
101
|
|
|
51
|
-
###
|
|
102
|
+
### Next.js
|
|
52
103
|
|
|
53
|
-
|
|
104
|
+
```jsx
|
|
105
|
+
// _document.jsx <Head>
|
|
106
|
+
{
|
|
107
|
+
process.env.NODE_ENV === "development" && (
|
|
108
|
+
<Script src="https://cdn.jsdelivr.net/npm/pixel-mirror/dist/index.js" strategy="afterInteractive" />
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
```
|
|
54
112
|
|
|
55
|
-
|
|
56
|
-
// import Script from "next/script"
|
|
113
|
+
### CDN
|
|
57
114
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
src="https://cdn.jsdelivr.net/npm/pixel-mirror/dist/index.js"
|
|
61
|
-
strategy="afterInteractive"
|
|
62
|
-
/>
|
|
63
|
-
)}
|
|
115
|
+
```html
|
|
116
|
+
<script defer src="https://cdn.jsdelivr.net/npm/pixel-mirror/dist/index.js"></script>
|
|
64
117
|
```
|
|
65
118
|
|
|
66
|
-
|
|
119
|
+
Remove in production.
|
|
67
120
|
|
|
68
|
-
|
|
121
|
+
## Note
|
|
69
122
|
|
|
70
|
-
|
|
71
|
-
<script defer src="https://cdn.jsdelivr.net/npm/pixel-mirror/dist/index.js"></script>
|
|
72
|
-
```
|
|
123
|
+
Pixel Mirror leaves the host `<html>` element's `position` unchanged. The mockup uses a fixed viewport clip, with a separate scroll translation to keep it aligned with its document coordinates. Scrolling is separate from the image's move and scale transitions.
|
|
73
124
|
|
|
74
|
-
|
|
125
|
+
Scroll compensation runs in JavaScript and can [lag behind asynchronous scrolling](https://firefox-source-docs.mozilla.org/performance/scroll-linked_effects.html) while the main thread is busy.
|
|
75
126
|
|
|
76
|
-
|
|
127
|
+
Avoid `transform` or `contain: layout` on `<html>`, which can affect the positioning of the mockup, toolbar and grids.
|
|
128
|
+
|
|
129
|
+
Spacing grids use alternating horizontal stripes with a default height of `8px`. Height accepts `px` and `rem`, with `4px`, `8px` and `16px` presets. Saved heights are retained.
|
|
130
|
+
|
|
131
|
+
On touch devices, browser pinch-to-zoom is temporarily disabled while the mockup overlay is visible to avoid conflicts with the tool's gesture handling. It reverts to normal when the overlay is hidden.
|
|
132
|
+
|
|
133
|
+
If your page enforces [Trusted Types](https://developer.mozilla.org/docs/Web/API/Trusted_Types_API) (`require-trusted-types-for 'script'`), allow the `svelte-trusted-html` policy in your dev CSP, e.g. `trusted-types your-policies svelte-trusted-html 'allow-duplicates'` (`'allow-duplicates'` is only needed if your app also uses Svelte).
|
|
134
|
+
|
|
135
|
+
## Development
|
|
136
|
+
|
|
137
|
+
Use Node.js 24 and pnpm 12.11.2:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
pnpm install --frozen-lockfile
|
|
141
|
+
pnpm check
|
|
142
|
+
pnpm lint
|
|
143
|
+
pnpm build
|
|
144
|
+
pnpm test:run
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
CI runs these checks on pushes and pull requests. The build runs before tests so the Vite plugin tests can serve the bundle.
|
|
77
148
|
|
|
78
|
-
|
|
149
|
+
Settings updates merge only changed fields in an IndexedDB transaction. Failed settings and resource loads retry when the window regains focus; failed writes retry on the next edit. Loading settings preserves edits whose writes are still in flight.
|
|
79
150
|
|
|
80
|
-
|
|
151
|
+
Layout and spacing grids use a 1%–99% opacity range and default to 10%. Grid colors entered as text, picked natively or loaded from stored settings are clamped to this range. Mockup opacity ranges from 10% to 90%, with a default of 50%. Solid mode uses 100% opacity for comparison.
|
|
81
152
|
|
|
82
153
|
## Credits
|
|
83
154
|
|
|
84
|
-
Icons
|
|
155
|
+
Icons from [Lucide](https://lucide.dev) (ISC License); see [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md).
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Third-Party Notices
|
|
2
|
+
|
|
3
|
+
The toolbar and panel icons are outlines from [Lucide](https://lucide.dev) (`src/components/icons/paths.ts`, the alignment dots adapted from `grip-horizontal` in `src/components/icons/AlignmentIcon.svelte`, and the select arrow `chevron-down` in `src/App.svelte`), bundled into `dist/index.js`. Of those, `chevron-down`, `circle-alert`, `columns-3`, `lock`, `moon`, `plus` and `trash-2` are derived from the Feather project.
|
|
4
|
+
|
|
5
|
+
## Lucide
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
ISC License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2026 Lucide Icons and Contributors
|
|
11
|
+
|
|
12
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
13
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
14
|
+
copyright notice and this permission notice appear in all copies.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
17
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
19
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
20
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
21
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
22
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Feather (for the icons derived from it)
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
The MIT License (MIT)
|
|
29
|
+
|
|
30
|
+
Copyright (c) 2013-present Cole Bemis
|
|
31
|
+
|
|
32
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
33
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
34
|
+
in the Software without restriction, including without limitation the rights
|
|
35
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
36
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
37
|
+
furnished to do so, subject to the following conditions:
|
|
38
|
+
|
|
39
|
+
The above copyright notice and this permission notice shall be included in all
|
|
40
|
+
copies or substantial portions of the Software.
|
|
41
|
+
|
|
42
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
43
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
44
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
45
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
46
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
47
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
48
|
+
SOFTWARE.
|
|
49
|
+
```
|
package/dist/index.js
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
var Qo=Object.defineProperty;var ei=(te,L,ae)=>L in te?Qo(te,L,{enumerable:!0,configurable:!0,writable:!0,value:ae}):te[L]=ae;var me=(te,L,ae)=>ei(te,typeof L!="symbol"?L+"":L,ae);(function(){"use strict";const te=(e,t)=>e===t,L=Symbol("solid-proxy"),ae=typeof Proxy=="function",tt=Symbol("solid-track"),Ne={equals:te};let pt=yt;const J=1,Te=2,bt={owned:null,cleanups:null,context:null,owner:null};var O=null;let nt=null,Qt=null,A=null,R=null,q=null,ze=0;function Be(e,t){const n=A,o=O,i=e.length===0,r=t===void 0?o:t,s=i?bt:{owned:null,cleanups:null,context:r?r.context:null,owner:r},l=i?e:()=>e(()=>Q(()=>Se(s)));O=s,A=null;try{return de(l,!0)}finally{A=n,O=o}}function G(e,t){t=t?Object.assign({},Ne,t):Ne;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},o=i=>(typeof i=="function"&&(i=i(n.value)),vt(n,i));return[wt.bind(n),o]}function S(e,t,n){const o=it(e,t,!1,J);_e(o)}function Ce(e,t,n){pt=on;const o=it(e,t,!1,J);o.user=!0,q?q.push(o):_e(o)}function ne(e,t,n){n=n?Object.assign({},Ne,n):Ne;const o=it(e,t,!0,0);return o.observers=null,o.observerSlots=null,o.comparator=n.equals||void 0,_e(o),wt.bind(o)}function en(e){return de(e,!1)}function Q(e){if(A===null)return e();const t=A;A=null;try{return e()}finally{A=t}}function xe(e){Ce(()=>Q(e))}function ke(e){return O===null||(O.cleanups===null?O.cleanups=[e]:O.cleanups.push(e)),e}function ot(){return A}function wt(){if(this.sources&&this.state)if(this.state===J)_e(this);else{const e=R;R=null,de(()=>He(this),!1),R=e}if(A){const e=this.observers?this.observers.length:0;A.sources?(A.sources.push(this),A.sourceSlots.push(e)):(A.sources=[this],A.sourceSlots=[e]),this.observers?(this.observers.push(A),this.observerSlots.push(A.sources.length-1)):(this.observers=[A],this.observerSlots=[A.sources.length-1])}return this.value}function vt(e,t,n){let o=e.value;return(!e.comparator||!e.comparator(o,t))&&(e.value=t,e.observers&&e.observers.length&&de(()=>{for(let i=0;i<e.observers.length;i+=1){const r=e.observers[i],s=nt&&nt.running;s&&nt.disposed.has(r),(s?!r.tState:!r.state)&&(r.pure?R.push(r):q.push(r),r.observers&&mt(r)),s||(r.state=J)}if(R.length>1e6)throw R=[],new Error},!1)),t}function _e(e){if(!e.fn)return;Se(e);const t=ze;tn(e,e.value,t)}function tn(e,t,n){let o;const i=O,r=A;A=O=e;try{o=e.fn(t)}catch(s){return e.pure&&(e.state=J,e.owned&&e.owned.forEach(Se),e.owned=null),e.updatedAt=n+1,Ct(s)}finally{A=r,O=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?vt(e,o):e.value=o,e.updatedAt=n)}function it(e,t,n,o=J,i){const r={fn:e,state:o,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:O,context:O?O.context:null,pure:n};return O===null||O!==bt&&(O.owned?O.owned.push(r):O.owned=[r]),r}function Ue(e){if(e.state===0)return;if(e.state===Te)return He(e);if(e.suspense&&Q(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ze);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===J)_e(e);else if(e.state===Te){const o=R;R=null,de(()=>He(e,t[0]),!1),R=o}}function de(e,t){if(R)return e();let n=!1;t||(R=[]),q?n=!0:q=[],ze++;try{const o=e();return nn(n),o}catch(o){n||(q=null),R=null,Ct(o)}}function nn(e){if(R&&(yt(R),R=null),e)return;const t=q;q=null,t.length&&de(()=>pt(t),!1)}function yt(e){for(let t=0;t<e.length;t++)Ue(e[t])}function on(e){let t,n=0;for(t=0;t<e.length;t++){const o=e[t];o.user?e[n++]=o:Ue(o)}for(t=0;t<n;t++)Ue(e[t])}function He(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const o=e.sources[n];if(o.sources){const i=o.state;i===J?o!==t&&(!o.updatedAt||o.updatedAt<ze)&&Ue(o):i===Te&&He(o,t)}}}function mt(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Te,n.pure?R.push(n):q.push(n),n.observers&&mt(n))}}function Se(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),o=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const r=i.pop(),s=n.observerSlots.pop();o<i.length&&(r.sourceSlots[s]=o,i[o]=r,n.observerSlots[o]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Se(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Se(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function rn(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Ct(e,t=O){throw rn(e)}const sn=Symbol("fallback");function xt(e){for(let t=0;t<e.length;t++)e[t]()}function ln(e,t,n={}){let o=[],i=[],r=[],s=0,l=t.length>1?[]:null;return ke(()=>xt(r)),()=>{let d=e()||[],g=d.length,c,a;return d[tt],Q(()=>{let p,_,$,M,z,C,x,D,V;if(g===0)s!==0&&(xt(r),r=[],o=[],i=[],s=0,l&&(l=[])),n.fallback&&(o=[sn],i[0]=Be(oe=>(r[0]=oe,n.fallback())),s=1);else if(s===0){for(i=new Array(g),a=0;a<g;a++)o[a]=d[a],i[a]=Be(h);s=g}else{for($=new Array(g),M=new Array(g),l&&(z=new Array(g)),C=0,x=Math.min(s,g);C<x&&o[C]===d[C];C++);for(x=s-1,D=g-1;x>=C&&D>=C&&o[x]===d[D];x--,D--)$[D]=i[x],M[D]=r[x],l&&(z[D]=l[x]);for(p=new Map,_=new Array(D+1),a=D;a>=C;a--)V=d[a],c=p.get(V),_[a]=c===void 0?-1:c,p.set(V,a);for(c=C;c<=x;c++)V=o[c],a=p.get(V),a!==void 0&&a!==-1?($[a]=i[c],M[a]=r[c],l&&(z[a]=l[c]),a=_[a],p.set(V,a)):r[c]();for(a=C;a<g;a++)a in $?(i[a]=$[a],r[a]=M[a],l&&(l[a]=z[a],l[a](a))):i[a]=Be(h);i=i.slice(0,s=g),o=d.slice(0)}return i});function h(p){if(r[a]=p,l){const[_,$]=G(a);return l[a]=$,t(d[a],_)}return t(d[a])}}}function w(e,t){return Q(()=>e(t||{}))}function Ve(){return!0}const an={get(e,t,n){return t===L?n:e.get(t)},has(e,t){return t===L?!0:e.has(t)},set:Ve,deleteProperty:Ve,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Ve,deleteProperty:Ve}},ownKeys(e){return e.keys()}};function rt(e){return(e=typeof e=="function"?e():e)?e:{}}function dn(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function cn(...e){let t=!1;for(let s=0;s<e.length;s++){const l=e[s];t=t||!!l&&L in l,e[s]=typeof l=="function"?(t=!0,ne(l)):l}if(ae&&t)return new Proxy({get(s){for(let l=e.length-1;l>=0;l--){const d=rt(e[l])[s];if(d!==void 0)return d}},has(s){for(let l=e.length-1;l>=0;l--)if(s in rt(e[l]))return!0;return!1},keys(){const s=[];for(let l=0;l<e.length;l++)s.push(...Object.keys(rt(e[l])));return[...new Set(s)]}},an);const n={},o=Object.create(null);for(let s=e.length-1;s>=0;s--){const l=e[s];if(!l)continue;const d=Object.getOwnPropertyNames(l);for(let g=d.length-1;g>=0;g--){const c=d[g];if(c==="__proto__"||c==="constructor")continue;const a=Object.getOwnPropertyDescriptor(l,c);if(!o[c])o[c]=a.get?{enumerable:!0,configurable:!0,get:dn.bind(n[c]=[a.get.bind(l)])}:a.value!==void 0?a:void 0;else{const h=n[c];h&&(a.get?h.push(a.get.bind(l)):a.value!==void 0&&h.push(()=>a.value))}}}const i={},r=Object.keys(o);for(let s=r.length-1;s>=0;s--){const l=r[s],d=o[l];d&&d.get?Object.defineProperty(i,l,d):i[l]=d?d.value:void 0}return i}const un=e=>`Stale read from <${e}>.`;function st(e){const t="fallback"in e&&{fallback:()=>e.fallback};return ne(ln(()=>e.each,e.children,t||void 0))}function H(e){const t=e.keyed,n=ne(()=>e.when,void 0,{equals:(o,i)=>t?o===i:!o==!i});return ne(()=>{const o=n();if(o){const i=e.children;return typeof i=="function"&&i.length>0?Q(()=>i(t?o:()=>{if(!Q(n))throw un("Show");return e.when})):i}return e.fallback},void 0,void 0)}const hn=new Set(["innerHTML","textContent","innerText","children"]),gn=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),fn=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),pn={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function bn(e,t,n){let o=n.length,i=t.length,r=o,s=0,l=0,d=t[i-1].nextSibling,g=null;for(;s<i||l<r;){if(t[s]===n[l]){s++,l++;continue}for(;t[i-1]===n[r-1];)i--,r--;if(i===s){const c=r<o?l?n[l-1].nextSibling:n[r-l]:d;for(;l<r;)e.insertBefore(n[l++],c)}else if(r===l)for(;s<i;)(!g||!g.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[r-1]&&n[l]===t[i-1]){const c=t[--i].nextSibling;e.insertBefore(n[l++],t[s++].nextSibling),e.insertBefore(n[--r],c),t[i]=n[r]}else{if(!g){g=new Map;let a=l;for(;a<r;)g.set(n[a],a++)}const c=g.get(t[s]);if(c!=null)if(l<c&&c<r){let a=s,h=1,p;for(;++a<i&&a<r&&!((p=g.get(t[a]))==null||p!==c+h);)h++;if(h>c-l){const _=t[s];for(;l<c;)e.insertBefore(n[l++],_)}else e.replaceChild(n[l++],t[s++])}else s++;else t[s++].remove()}}}const kt="_$DX_DELEGATE";function wn(e,t,n,o={}){let i;return Be(r=>{i=r,t===document?e():v(t,e(),t.firstChild?null:void 0,n)},o.owner),()=>{i(),t.textContent=""}}function y(e,t,n){let o;const i=()=>{const s=document.createElement("template");return s.innerHTML=e,s.content.firstChild},r=()=>(o||(o=i())).cloneNode(!0);return r.cloneNode=r,r}function _t(e,t=window.document){const n=t[kt]||(t[kt]=new Set);for(let o=0,i=e.length;o<i;o++){const r=e[o];n.has(r)||(n.add(r),t.addEventListener(r,Sn))}}function B(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function vn(e,t,n,o){o==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,o)}function yn(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}function j(e,t){t==null?e.removeAttribute("class"):e.className=t}function mn(e,t,n,o){if(o)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=r=>i.call(e,n[1],r))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Cn(e,t,n={}){const o=Object.keys(t||{}),i=Object.keys(n);let r,s;for(r=0,s=i.length;r<s;r++){const l=i[r];!l||l==="undefined"||t[l]||(St(e,l,!1),delete n[l])}for(r=0,s=o.length;r<s;r++){const l=o[r],d=!!t[l];!l||l==="undefined"||n[l]===d||!d||(St(e,l,!0),n[l]=d)}return n}function lt(e,t,n){if(!t)return n?B(e,"style"):t;const o=e.style;if(typeof t=="string")return o.cssText=t;typeof n=="string"&&(o.cssText=n=void 0),n||(n={}),t||(t={});let i,r;for(r in n)t[r]==null&&o.removeProperty(r),delete n[r];for(r in t)i=t[r],i!==n[r]&&(o.setProperty(r,i),n[r]=i);return n}function E(e,t={},n,o){const i={};return S(()=>typeof t.ref=="function"&&xn(t.ref,e)),S(()=>kn(e,t,n,!0,i,!0)),i}function xn(e,t,n){return Q(()=>e(t,n))}function v(e,t,n,o){if(n!==void 0&&!o&&(o=[]),typeof t!="function")return Ze(e,t,o,n);S(i=>Ze(e,t(),i,n),o)}function kn(e,t,n,o,i={},r=!1){t||(t={});for(const s in i)if(!(s in t)){if(s==="children")continue;i[s]=$t(e,s,null,i[s],n,r,t)}for(const s in t){if(s==="children")continue;const l=t[s];i[s]=$t(e,s,l,i[s],n,r,t)}}function _n(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function St(e,t,n){const o=t.trim().split(/\s+/);for(let i=0,r=o.length;i<r;i++)e.classList.toggle(o[i],n)}function $t(e,t,n,o,i,r,s){let l,d,g,c;if(t==="style")return lt(e,n,o);if(t==="classList")return Cn(e,n,o);if(n===o)return o;if(t==="ref")r||n(e);else if(t.slice(0,3)==="on:"){const a=t.slice(3);o&&e.removeEventListener(a,o,typeof o!="function"&&o),n&&e.addEventListener(a,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const a=t.slice(10);o&&e.removeEventListener(a,o,!0),n&&e.addEventListener(a,n,!0)}else if(t.slice(0,2)==="on"){const a=t.slice(2).toLowerCase(),h=fn.has(a);if(!h&&o){const p=Array.isArray(o)?o[0]:o;e.removeEventListener(a,p)}(h||n)&&(mn(e,a,n,h),h&&_t([a]))}else if(t.slice(0,5)==="attr:")B(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")yn(e,t.slice(5),n);else if((c=t.slice(0,5)==="prop:")||(g=hn.has(t))||!i||(l=e.nodeName.includes("-")||"is"in s))c&&(t=t.slice(5),d=!0),t==="class"||t==="className"?j(e,n):l&&!d&&!g?e[_n(t)]=n:e[t]=n;else{const a=t.indexOf(":")>-1&&pn[t.split(":")[0]];a?vn(e,a,t,n):B(e,gn[t]||t,n)}return n}function Sn(e){let t=e.target;const n=`$$${e.type}`,o=e.target,i=e.currentTarget,r=d=>Object.defineProperty(e,"target",{configurable:!0,value:d}),s=()=>{const d=t[n];if(d&&!t.disabled){const g=t[`${n}Data`];if(g!==void 0?d.call(t,g,e):d.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&r(t.host),!0},l=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const d=e.composedPath();r(d[0]);for(let g=0;g<d.length-2&&(t=d[g],!!s());g++){if(t._$host){t=t._$host,l();break}if(t.parentNode===i)break}}else l();r(o)}function Ze(e,t,n,o,i){for(;typeof n=="function";)n=n();if(t===n)return n;const r=typeof t,s=o!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,r==="string"||r==="number"){if(r==="number"&&(t=t.toString(),t===n))return n;if(s){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=ce(e,n,o,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||r==="boolean")n=ce(e,n,o);else{if(r==="function")return S(()=>{let l=t();for(;typeof l=="function";)l=l();n=Ze(e,l,n,o)}),()=>n;if(Array.isArray(t)){const l=[],d=n&&Array.isArray(n);if(at(l,t,n,i))return S(()=>n=Ze(e,l,n,o,!0)),()=>n;if(l.length===0){if(n=ce(e,n,o),s)return n}else d?n.length===0?At(e,l,o):bn(e,n,l):(n&&ce(e),At(e,l));n=l}else if(t.nodeType){if(Array.isArray(n)){if(s)return n=ce(e,n,o,t);ce(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function at(e,t,n,o){let i=!1;for(let r=0,s=t.length;r<s;r++){let l=t[r],d=n&&n[e.length],g;if(!(l==null||l===!0||l===!1))if((g=typeof l)=="object"&&l.nodeType)e.push(l);else if(Array.isArray(l))i=at(e,l,d)||i;else if(g==="function")if(o){for(;typeof l=="function";)l=l();i=at(e,Array.isArray(l)?l:[l],Array.isArray(d)?d:[d])||i}else e.push(l),i=!0;else{const c=String(l);d&&d.nodeType===3&&d.data===c?e.push(d):e.push(document.createTextNode(c))}}return i}function At(e,t,n=null){for(let o=0,i=t.length;o<i;o++)e.insertBefore(t[o],n)}function ce(e,t,n,o){if(n===void 0)return e.textContent="";const i=o||document.createTextNode("");if(t.length){let r=!1;for(let s=t.length-1;s>=0;s--){const l=t[s];if(i!==l){const d=l.parentNode===e;!r&&!s?d?e.replaceChild(i,l):e.insertBefore(i,n):d&&l.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function Et(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Et(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function I(){for(var e,t,n=0,o="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Et(e))&&(o&&(o+=" "),o+=t);return o}function $n(e){var n;return((n=e.split(".").pop())==null?void 0:n.toLowerCase())==="png"?"image/png":"image/jpeg"}const Ot={id:"default",width:"1140px",columns:12,gutterWidth:"24px",isGutterOnOutside:!0,position:"center"};class N{constructor(){}static async init(){this.db=await new Promise((t,n)=>{const o=indexedDB.open(this.DB_NAME,this.VERSION);o.onerror=()=>n(o.error),o.onsuccess=()=>t(o.result),o.onupgradeneeded=i=>{const r=i.target.result;r.objectStoreNames.contains(this.DESIGN_STORE_NAME)||r.createObjectStore(this.DESIGN_STORE_NAME,{keyPath:"id"}),r.objectStoreNames.contains(this.GRID_STORE_NAME)||r.createObjectStore(this.GRID_STORE_NAME,{keyPath:"id"}).add({...Ot,createdAt:Date.now()})}})}static async uploadDesign(t){const n=t.map(async s=>{const l=await s.arrayBuffer();return{id:crypto.randomUUID(),buffer:l,mimeType:$n(s.name),createdAt:Date.now()}}),o=await Promise.all(n),i=this.db.transaction(this.DESIGN_STORE_NAME,"readwrite"),r=i.objectStore(this.DESIGN_STORE_NAME);return await Promise.all([new Promise((s,l)=>{i.oncomplete=()=>s(),i.onerror=()=>l(i.error)}),...o.map(s=>new Promise((l,d)=>{const g=r.add(s);g.onsuccess=()=>l(),g.onerror=()=>d(g.error)}))]),o.sort((s,l)=>l.createdAt-s.createdAt)}static async getDesign(t){const n=this.db.transaction(this.DESIGN_STORE_NAME,"readonly").objectStore(this.DESIGN_STORE_NAME);return new Promise((o,i)=>{const r=n.get(t);r.onerror=()=>i(r.error),r.onsuccess=()=>o(r.result)})}static async getAllDesigns(){const t=this.db.transaction(this.DESIGN_STORE_NAME,"readonly").objectStore(this.DESIGN_STORE_NAME);return new Promise((n,o)=>{const i=t.getAll();i.onerror=()=>o(i.error),i.onsuccess=()=>n(i.result.sort((r,s)=>s.createdAt-r.createdAt))})}static async deleteDesign(t){const o=this.db.transaction(this.DESIGN_STORE_NAME,"readwrite").objectStore(this.DESIGN_STORE_NAME);await new Promise((i,r)=>{const s=o.delete(t);s.onsuccess=()=>i(),s.onerror=()=>r(s.error)})}static async deleteAllDesigns(){const n=this.db.transaction(this.DESIGN_STORE_NAME,"readwrite").objectStore(this.DESIGN_STORE_NAME);await new Promise((o,i)=>{const r=n.clear();r.onsuccess=()=>o(),r.onerror=()=>i(r.error)})}static async addGridSet(t){const n={...t,id:crypto.randomUUID(),createdAt:Date.now()},i=this.db.transaction(this.GRID_STORE_NAME,"readwrite").objectStore(this.GRID_STORE_NAME);return await new Promise((r,s)=>{const l=i.add(n);l.onsuccess=()=>r(),l.onerror=()=>s(l.error)}),n}static async getGridSet(t){const n=this.db.transaction(this.GRID_STORE_NAME,"readonly").objectStore(this.GRID_STORE_NAME);return new Promise((o,i)=>{const r=n.get(t);r.onerror=()=>i(r.error),r.onsuccess=()=>o(r.result)})}static async getAllGridSets(){const t=this.db.transaction(this.GRID_STORE_NAME,"readonly").objectStore(this.GRID_STORE_NAME);return new Promise((n,o)=>{const i=t.getAll();i.onerror=()=>o(i.error),i.onsuccess=()=>n(i.result.sort((r,s)=>r.createdAt-s.createdAt))})}static async deleteGridSet(t){const o=this.db.transaction(this.GRID_STORE_NAME,"readwrite").objectStore(this.GRID_STORE_NAME);await new Promise((i,r)=>{const s=o.delete(t);s.onsuccess=()=>i(),s.onerror=()=>r(s.error)})}static async resetGridSets(){const n=this.db.transaction(this.GRID_STORE_NAME,"readwrite").objectStore(this.GRID_STORE_NAME);await new Promise((i,r)=>{const s=n.clear();s.onsuccess=()=>i(),s.onerror=()=>r(s.error)});const o={...Ot,createdAt:Date.now()};return await new Promise((i,r)=>{const s=n.add(o);s.onsuccess=()=>i(),s.onerror=()=>r(s.error)}),[o]}}me(N,"DB_NAME","PixelMirrorDB"),me(N,"DESIGN_STORE_NAME","designs"),me(N,"GRID_STORE_NAME","grids"),me(N,"VERSION",1),me(N,"db");const dt=Symbol("store-raw"),ue=Symbol("store-node"),K=Symbol("store-has"),Pt=Symbol("store-self");function Mt(e){let t=e[L];if(!t&&(Object.defineProperty(e,L,{value:t=new Proxy(e,On)}),!Array.isArray(e))){const n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let i=0,r=n.length;i<r;i++){const s=n[i];o[s].get&&Object.defineProperty(e,s,{enumerable:o[s].enumerable,get:o[s].get.bind(t)})}}return t}function We(e){let t;return e!=null&&typeof e=="object"&&(e[L]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function $e(e,t=new Set){let n,o,i,r;if(n=e!=null&&e[dt])return n;if(!We(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,l=e.length;s<l;s++)i=e[s],(o=$e(i,t))!==i&&(e[s]=o)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),l=Object.getOwnPropertyDescriptors(e);for(let d=0,g=s.length;d<g;d++)r=s[d],!l[r].get&&(i=e[r],(o=$e(i,t))!==i&&(e[r]=o))}return e}function qe(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Ae(e,t,n){if(e[t])return e[t];const[o,i]=G(n,{equals:!1,internal:!0});return o.$=i,e[t]=o}function An(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===L||t===ue||(delete n.value,delete n.writable,n.get=()=>e[L][t]),n}function Dt(e){ot()&&Ae(qe(e,ue),Pt)()}function En(e){return Dt(e),Reflect.ownKeys(e)}const On={get(e,t,n){if(t===dt)return e;if(t===L)return n;if(t===tt)return Dt(e),n;const o=qe(e,ue),i=o[t];let r=i?i():e[t];if(t===ue||t===K||t==="__proto__")return r;if(!i){const s=Object.getOwnPropertyDescriptor(e,t);ot()&&(typeof r!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(r=Ae(o,t,r)())}return We(r)?Mt(r):r},has(e,t){return t===dt||t===L||t===tt||t===ue||t===K||t==="__proto__"?!0:(ot()&&Ae(qe(e,K),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:En,getOwnPropertyDescriptor:An};function Ke(e,t,n,o=!1){if(!o&&e[t]===n)return;const i=e[t],r=e.length;n===void 0?(delete e[t],e[K]&&e[K][t]&&i!==void 0&&e[K][t].$()):(e[t]=n,e[K]&&e[K][t]&&i===void 0&&e[K][t].$());let s=qe(e,ue),l;if((l=Ae(s,t,i))&&l.$(()=>n),Array.isArray(e)&&e.length!==r){for(let d=e.length;d<r;d++)(l=s[d])&&l.$();(l=Ae(s,"length",r))&&l.$(e.length)}(l=s[Pt])&&l.$()}function Lt(e,t){const n=Object.keys(t);for(let o=0;o<n.length;o+=1){const i=n[o];Ke(e,i,t[i])}}function Pn(e,t){if(typeof t=="function"&&(t=t(e)),t=$e(t),Array.isArray(t)){if(e===t)return;let n=0,o=t.length;for(;n<o;n++){const i=t[n];e[n]!==i&&Ke(e,n,i)}Ke(e,"length",o)}else Lt(e,t)}function Ee(e,t,n=[]){let o,i=e;if(t.length>1){o=t.shift();const s=typeof o,l=Array.isArray(e);if(Array.isArray(o)){for(let d=0;d<o.length;d++)Ee(e,[o[d]].concat(t),n);return}else if(l&&s==="function"){for(let d=0;d<e.length;d++)o(e[d],d)&&Ee(e,[d].concat(t),n);return}else if(l&&s==="object"){const{from:d=0,to:g=e.length-1,by:c=1}=o;for(let a=d;a<=g;a+=c)Ee(e,[a].concat(t),n);return}else if(t.length>1){Ee(e[o],t,[o].concat(n));return}i=e[o],n=[o].concat(n)}let r=t[0];typeof r=="function"&&(r=r(i,n),r===i)||o===void 0&&r==null||(r=$e(r),o===void 0||We(i)&&We(r)&&!Array.isArray(r)?Lt(i,r):Ke(e,o,r))}function jt(...[e,t]){const n=$e(e||{}),o=Array.isArray(n),i=Mt(n);function r(...s){en(()=>{o&&s.length===1?Pn(n,s[0]):Ee(n,s)})}return[i,r]}const Rt="_J-",Gt={designId:void 0,designOpacity:.5,designPosition:{x:0,y:0},designScale:1,showDesignOverlay:!1,lockDesignOverlay:!1,showVerticalRhythmOverlay:!1,verticalRhythmHeight:"8px",verticalRhythmColor:"rgba(255, 0, 0, .05)",showGridSystemOverlay:!1,activeGridSystemId:"default",gridSystemColor:"rgba(255, 0, 0, .05)",appPosition:"bottom"};function Mn(e){const t=localStorage.getItem(Rt+e);return t?JSON.parse(t):Gt[e]}const Dn=Object.keys(Gt).reduce((e,t)=>({...e,[t]:Mn(t)}),{}),[u,Ln]=jt(Dn);function P(e){Object.entries(e).forEach(([t,n])=>{localStorage.setItem(Rt+t,JSON.stringify(n))}),Ln(t=>({...t,...e}))}const jn={showAlignmentPopover:!1,showGridSettingsPanel:!1,showAllDesignsPanel:!1,designUrl:void 0,designSize:{width:0,height:0},designOriginalSize:{width:0,height:0},designBufferedPosition:{x:0,y:0},isSolidMode:!1,isZoomMode:!1,isDragging:!1,enableAnimation:!1,errorMessage:void 0},[f,k]=jt(jn);var Rn=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z"stroke=currentColor stroke-width=1.5></path><circle cx=16.5 cy=7.5 r=1.5 stroke=currentColor stroke-width=1.5></circle><path d="M16 22C15.3805 19.7749 13.9345 17.7821 11.8765 16.3342C9.65761 14.7729 6.87163 13.9466 4.01569 14.0027C3.67658 14.0019 3.33776 14.0127 3 14.0351"stroke=currentColor stroke-width=1.5 stroke-linejoin=round></path><path d="M13 18C14.7015 16.6733 16.5345 15.9928 18.3862 16.0001C19.4362 15.999 20.4812 16.2216 21.5 16.6617"stroke=currentColor stroke-width=1.5 stroke-linejoin=round>');const Gn=(e={})=>(()=>{var t=Rn();return E(t,e,!0),t})();var In=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><circle cx=16.5 cy=7.5 r=1.5 stroke=currentColor stroke-width=1.5></circle><path d="M2 14.1354C2.66663 14.0455 3.3406 14.0011 4.01569 14.0027C6.87163 13.9466 9.65761 14.7729 11.8765 16.3342C13.9345 17.7821 15.3805 19.7749 16 22"stroke=currentColor stroke-width=1.5 stroke-linejoin=round></path><path d="M13.5 17.5C14.5 16.5 15.1772 16.2768 16 16"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M20 20.2131C18.6012 21.5 16.3635 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1087C2.5 18.7175 2.5 16.4783 2.5 12C2.5 7.6364 2.5 5.3987 3.78701 3.99988"stroke=currentColor stroke-width=1.5></path><path d="M20.0002 16C20.5427 16 21.048 16.2945 21.3967 16.5638C21.5 15.3693 21.5 13.8825 21.5 12C21.5 7.52166 21.5 5.28249 20.1088 3.89124C18.7175 2.5 16.4783 2.5 12 2.5C9.59086 2.5 7.82972 2.5 6.5 2.71659"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M2 2L22 22"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round>');const Nn=(e={})=>(()=>{var t=In();return E(t,e,!0),t})();var Tn=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M22 16C21.4102 15.3932 19.8403 13 19 13C18.1597 13 16.5898 15.3932 16 16M19 14L19 21"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M15.0035 21H12.0027C7.28739 21 4.92973 21 3.46487 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38042 4.53806C2.6516 4.05227 3.05255 3.65142 3.53848 3.38032C4.22017 3 5.12865 3 6.94562 3C8.10968 3 8.69172 3 9.20122 3.19101C10.3645 3.62712 10.8442 4.68358 11.3691 5.73313L12.0027 7M8.00163 7H16.754C18.8613 7 19.9149 7 20.6718 7.50559C20.9995 7.72447 21.2808 8.00572 21.4997 8.33329C21.8937 8.92282 21.9808 9.69244 22 11"stroke=currentColor stroke-width=1.5 stroke-linecap=round>');const zn=(e={})=>(()=>{var t=Tn();return E(t,e,!0),t})();var Bn=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M4.00781 4.99913C4.59743 4.39256 6.16671 2.00049 7.00666 2.00049C7.84661 2.00049 9.41589 4.39256 10.0055 4.99913M7.00666 2.84907V21.9995"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M19.0023 13.995C19.6088 14.5846 22.0011 16.1538 22.0011 16.9937C22.0011 17.8336 19.6088 19.4028 19.0023 19.9923M21.1906 16.9939H1.99805"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round>');const Un=(e={})=>(()=>{var t=Bn();return E(t,e,!0),t})();var Hn=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M16.502 7.99988C17.3458 7.99988 18.3198 7.9165 18.801 8.74988C19.002 9.09795 19.002 9.56526 19.002 10.4999V11.4999C19.002 12.4345 19.002 12.9018 18.801 13.2499C18.3198 14.0832 17.3458 13.9999 16.502 13.9999C15.6581 13.9999 14.6841 14.0832 14.2029 13.2499C14.002 12.9018 14.002 12.4345 14.002 11.4999L14.002 10.4999C14.002 9.56526 14.002 9.09795 14.2029 8.74988C14.6841 7.9165 15.6581 7.99988 16.502 7.99988Z"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M7.50195 7.99988C8.34585 7.99988 9.31984 7.9165 9.80099 8.74988C10.002 9.09795 10.002 9.56526 10.002 10.4999L10.002 17.4999C10.002 18.4345 10.002 18.9018 9.80099 19.2499C9.31984 20.0832 8.34585 19.9999 7.50195 19.9999C6.65806 19.9999 5.68406 20.0832 5.20292 19.2499C5.00195 18.9018 5.00195 18.4345 5.00195 17.4999L5.00195 10.4999C5.00195 9.56526 5.00195 9.09795 5.20292 8.74988C5.68406 7.9165 6.65806 7.99988 7.50195 7.99988Z"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M22 4L2 4"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round>');const Vn=(e={})=>(()=>{var t=Hn();return E(t,e,!0),t})();var Zn=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M16.502 10.0023C17.3458 10.0023 18.3198 9.91895 18.801 10.7523C19.002 11.1004 19.002 11.5677 19.002 12.5023V13.5023C19.002 14.4369 19.002 14.9042 18.801 15.2523C18.3198 16.0857 17.3458 16.0023 16.502 16.0023C15.6581 16.0023 14.6841 16.0857 14.2029 15.2523C14.002 14.9042 14.002 14.4369 14.002 13.5023L14.002 12.5023C14.002 11.5677 14.002 11.1004 14.2029 10.7523C14.6841 9.91895 15.6581 10.0023 16.502 10.0023Z"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M7.50195 4.00232C8.34585 4.00232 9.31984 3.91895 9.80099 4.75232C10.002 5.10039 10.002 5.5677 10.002 6.50232L10.002 13.5023C10.002 14.4369 10.002 14.9042 9.80099 15.2523C9.31984 16.0857 8.34585 16.0023 7.50195 16.0023C6.65806 16.0023 5.68406 16.0857 5.20292 15.2523C5.00195 14.9042 5.00195 14.4369 5.00195 13.5023L5.00195 6.50232C5.00195 5.5677 5.00195 5.10039 5.20292 4.75232C5.68406 3.91895 6.65806 4.00232 7.50195 4.00232Z"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M22 20L2 20"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round>');const Wn=(e={})=>(()=>{var t=Zn();return E(t,e,!0),t})();var qn=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M8.00232 7.5C8.00232 6.65611 7.91895 5.68211 8.75232 5.20096C9.10039 5 9.5677 5 10.5023 5H11.5023C12.4369 5 12.9042 5 13.2523 5.20096C14.0857 5.68211 14.0023 6.65611 14.0023 7.5C14.0023 8.34389 14.0857 9.31789 13.2523 9.79904C12.9042 10 12.4369 10 11.5023 10H10.5023C9.5677 10 9.10039 10 8.75232 9.79904C7.91895 9.31789 8.00232 8.34389 8.00232 7.5Z"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M8.00232 16.5C8.00232 15.6561 7.91895 14.6821 8.75232 14.201C9.10039 14 9.5677 14 10.5023 14H17.5023C18.4369 14 18.9042 14 19.2523 14.201C20.0857 14.6821 20.0023 15.6561 20.0023 16.5C20.0023 17.3439 20.0857 18.3179 19.2523 18.799C18.9042 19 18.4369 19 17.5023 19H10.5023C9.5677 19 9.10039 19 8.75232 18.799C7.91895 18.3179 8.00232 17.3439 8.00232 16.5Z"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M4 2V22"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round>');const Kn=(e={})=>(()=>{var t=qn();return E(t,e,!0),t})();var Fn=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M10.0004 7.5C10.0004 6.65611 9.91699 5.68211 10.7504 5.20096C11.0984 5 11.5657 5 12.5004 5H13.5004C14.435 5 14.9023 5 15.2504 5.20096C16.0837 5.68211 16.0004 6.65611 16.0004 7.5C16.0004 8.34389 16.0837 9.31789 15.2504 9.79904C14.9023 10 14.435 10 13.5004 10H12.5004C11.5657 10 11.0984 10 10.7504 9.79904C9.91699 9.31789 10.0004 8.34389 10.0004 7.5Z"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M4.00036 16.5C4.00036 15.6561 3.91699 14.6821 4.75036 14.201C5.09844 14 5.56575 14 6.50036 14H13.5004C14.435 14 14.9023 14 15.2504 14.201C16.0837 14.6821 16.0004 15.6561 16.0004 16.5C16.0004 17.3439 16.0837 18.3179 15.2504 18.799C14.9023 19 14.435 19 13.5004 19H6.50036C5.56575 19 5.09844 19 4.75036 18.799C3.91699 18.3179 4.00036 17.3439 4.00036 16.5Z"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M20 2V22"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round>');const Yn=(e={})=>(()=>{var t=Fn();return E(t,e,!0),t})();var Xn=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M12 19L12 22"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M12 10L12 14"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M12 2L12 5"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M8.00036 7.5C8.00036 6.65611 7.91699 5.68211 8.75036 5.20096C9.09844 5 9.56575 5 10.5004 5H13.5004C14.435 5 14.9023 5 15.2504 5.20096C16.0837 5.68211 16.0004 6.65611 16.0004 7.5C16.0004 8.34389 16.0837 9.31789 15.2504 9.79904C14.9023 10 14.435 10 13.5004 10H10.5004C9.56575 10 9.09844 10 8.75036 9.79904C7.91699 9.31789 8.00036 8.34389 8.00036 7.5Z"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M4.00036 16.5C4.00036 15.6561 3.91699 14.6821 4.75036 14.201C5.09844 14 5.56575 14 6.50036 14H17.5004C18.435 14 18.9023 14 19.2504 14.201C20.0837 14.6821 20.0004 15.6561 20.0004 16.5C20.0004 17.3439 20.0837 18.3179 19.2504 18.799C18.9023 19 18.435 19 17.5004 19H6.50036C5.56575 19 5.09844 19 4.75036 18.799C3.91699 18.3179 4.00036 17.3439 4.00036 16.5Z"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round>');const Jn=(e={})=>(()=>{var t=Xn();return E(t,e,!0),t})();var Qn=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124Z"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round>');const eo=(e={})=>(()=>{var t=Qn();return E(t,e,!0),t})();var to=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M12 16.5V14.5"stroke=currentColor stroke-width=1.5 stroke-linecap=round></path><path d="M4.2678 18.8447C4.49268 20.515 5.87612 21.8235 7.55965 21.9009C8.97626 21.966 10.4153 22 12 22C13.5847 22 15.0237 21.966 16.4403 21.9009C18.1239 21.8235 19.5073 20.515 19.7322 18.8447C19.8789 17.7547 20 16.6376 20 15.5C20 14.3624 19.8789 13.2453 19.7322 12.1553C19.5073 10.485 18.1239 9.17649 16.4403 9.09909C15.0237 9.03397 13.5847 9 12 9C10.4153 9 8.97626 9.03397 7.55965 9.09909C5.87612 9.17649 4.49268 10.485 4.2678 12.1553C4.12104 13.2453 3.99999 14.3624 3.99999 15.5C3.99999 16.6376 4.12104 17.7547 4.2678 18.8447Z"stroke=currentColor stroke-width=1.5></path><path d="M7.5 9V6.5C7.5 4.01472 9.51472 2 12 2C14.4853 2 16.5 4.01472 16.5 6.5V9"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round>');const no=(e={})=>(()=>{var t=to();return E(t,e,!0),t})();var oo=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M12 16.5V14.5"stroke=currentColor stroke-width=1.5 stroke-linecap=round></path><path d="M4.26781 18.8447C4.49269 20.515 5.87613 21.8235 7.55966 21.9009C8.97627 21.966 10.4153 22 12 22C13.5847 22 15.0237 21.966 16.4403 21.9009C18.1239 21.8235 19.5073 20.515 19.7322 18.8447C19.879 17.7547 20 16.6376 20 15.5C20 14.3624 19.879 13.2453 19.7322 12.1553C19.5073 10.485 18.1239 9.17649 16.4403 9.09909C15.0237 9.03397 13.5847 9 12 9C10.4153 9 8.97627 9.03397 7.55966 9.09909C5.87613 9.17649 4.49269 10.485 4.26781 12.1553C4.12105 13.2453 4 14.3624 4 15.5C4 16.6376 4.12105 17.7547 4.26781 18.8447Z"stroke=currentColor stroke-width=1.5></path><path d="M7.5 9V6.5C7.5 4.01472 9.51472 2 12 2C13.9593 2 15.5 3.5 16 5"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round>');const io=(e={})=>(()=>{var t=oo();return E(t,e,!0),t})();var ro=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M6.08938 14.9992C5.71097 14.1486 5.5 13.2023 5.5 12.2051C5.5 8.50154 8.41015 5.49921 12 5.49921C15.5899 5.49921 18.5 8.50154 18.5 12.2051C18.5 13.2023 18.289 14.1486 17.9106 14.9992"stroke=currentColor stroke-width=1.5 stroke-linecap=round></path><path d="M12 1.99921V2.99921"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M22 11.9992H21"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M3 11.9992H2"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M19.0704 4.92792L18.3633 5.63503"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M5.6368 5.636L4.92969 4.92889"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M14.517 19.3056C15.5274 18.9788 15.9326 18.054 16.0466 17.1238C16.0806 16.8459 15.852 16.6154 15.572 16.6154L8.47685 16.6156C8.18725 16.6156 7.95467 16.8614 7.98925 17.1489C8.1009 18.0773 8.3827 18.7555 9.45345 19.3056M14.517 19.3056C14.517 19.3056 9.62971 19.3056 9.45345 19.3056M14.517 19.3056C14.3955 21.2506 13.8338 22.0209 12.0068 21.9993C10.0526 22.0354 9.60303 21.0833 9.45345 19.3056"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round>');const so=(e={})=>(()=>{var t=ro();return E(t,e,!0),t})();var lo=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28248 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28248 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088Z"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path><path d="M2.5 8.99976L21.5 8.99976"stroke=currentColor stroke-width=1.5></path><path d="M2.5 14.9998L21.5 14.9998"stroke=currentColor stroke-width=1.5></path><path d="M16 21.5L16 2.5"stroke=currentColor stroke-width=1.5></path><path d="M8 21.4998L8 2.49976"stroke=currentColor stroke-width=1.5>');const ao=(e={})=>(()=>{var t=lo();return E(t,e,!0),t})();var co=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M9.66676 22L14.3334 22M3.01509 16.5C2.99793 16.0004 2.99705 15.5001 2.99855 15M20.9849 16.5C21.0021 16.0004 21.003 15.5001 21.0015 15M3.53709 19.2547C4.02122 20.213 4.80249 20.9914 5.76305 21.4718M18.1797 21.5C19.1665 21.0221 19.9692 20.232 20.4629 19.2547"stroke=currentColor stroke-width=1.5 stroke-linecap=round></path><path d="M5.50502 12C3.64422 12 3.00695 11.4596 3.00695 9.5C3.00695 6.96832 2.75702 4.04633 5.25521 2.60289C6.29863 2 7.69947 2 10.5012 2L13.4988 2C16.3005 2 17.7014 2 18.7448 2.60289C21.243 4.04633 20.9931 6.96832 20.9931 9.5C20.9931 11.3622 20.453 12 18.495 12L5.50502 12Z"stroke=currentColor stroke-width=1.5>');const uo=(e={})=>(()=>{var t=co();return E(t,e,!0),t})();var ho=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=20 height=20 color=#000000 fill=none><path d="M5.32171 9.6829C7.73539 5.41196 8.94222 3.27648 10.5983 2.72678C11.5093 2.42437 12.4907 2.42437 13.4017 2.72678C15.0578 3.27648 16.2646 5.41196 18.6783 9.6829C21.092 13.9538 22.2988 16.0893 21.9368 17.8293C21.7376 18.7866 21.2469 19.6548 20.535 20.3097C19.241 21.5 16.8274 21.5 12 21.5C7.17265 21.5 4.75897 21.5 3.46496 20.3097C2.75308 19.6548 2.26239 18.7866 2.06322 17.8293C1.70119 16.0893 2.90803 13.9538 5.32171 9.6829Z"stroke=currentColor stroke-width=2></path><path d="M11.992 16H12.001"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 13L12 8.99997"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>');const go=(e={})=>(()=>{var t=ho();return E(t,e,!0),t})();var fo=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5"stroke=currentColor stroke-width=1.5 stroke-linecap=round></path><path d="M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5"stroke=currentColor stroke-width=1.5 stroke-linecap=round></path><path d="M9.5 16.5L9.5 10.5"stroke=currentColor stroke-width=1.5 stroke-linecap=round></path><path d="M14.5 16.5L14.5 10.5"stroke=currentColor stroke-width=1.5 stroke-linecap=round>');const It=(e={})=>(()=>{var t=fo();return E(t,e,!0),t})();var po=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z"stroke=currentColor stroke-width=1.5></path><path d="M8 12.5L10.5 15L16 9"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round>');const bo=(e={})=>(()=>{var t=po();return E(t,e,!0),t})();var wo=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path d="M13 3.00231C12.5299 3 12.0307 3 11.5 3C7.02166 3 4.78249 3 3.39124 4.39124C2 5.78249 2 8.02166 2 12.5C2 16.9783 2 19.2175 3.39124 20.6088C4.78249 22 7.02166 22 11.5 22C15.9783 22 18.2175 22 19.6088 20.6088C20.9472 19.2703 20.998 17.147 20.9999 13"stroke=currentColor stroke-width=1.5 stroke-linecap=round></path><path d="M2 14.1354C2.61902 14.0455 3.24484 14.0011 3.87171 14.0027C6.52365 13.9466 9.11064 14.7729 11.1711 16.3342C13.082 17.7821 14.4247 19.7749 15 22"stroke=currentColor stroke-width=1.5 stroke-linejoin=round></path><path d="M21 16.8962C19.8246 16.3009 18.6088 15.9988 17.3862 16.0001C15.5345 15.9928 13.7015 16.6733 12 18"stroke=currentColor stroke-width=1.5 stroke-linejoin=round></path><path d="M17 4.5C17.4915 3.9943 18.7998 2 19.5 2M22 4.5C21.5085 3.9943 20.2002 2 19.5 2M19.5 2V10"stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round>');const vo=(e={})=>(()=>{var t=wo();return E(t,e,!0),t})();var yo=y('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"width=28 height=28 color=#000000 fill=none><path id=toggle-trigger d="M19 12C19 13.6569 17.6569 15 16 15C14.3431 15 13 13.6569 13 12C13 10.3431 14.3431 9 16 9C17.6569 9 19 10.3431 19 12Z"stroke=currentColor stroke-width=1.5></path><path d="M16 6H8C4.68629 6 2 8.68629 2 12C2 15.3137 4.68629 18 8 18H16C19.3137 18 22 15.3137 22 12C22 8.68629 19.3137 6 16 6Z"stroke=currentColor stroke-width=1.5>');const Nt=(e={})=>(()=>{var t=yo();return E(t,e,!0),t})();var mo=y("<div class=overlay-container>"),Co=y("<div id=app-bar><div><button class=menu-button></button><button class=menu-button></button><button><span class=opacity-button__value></span></button><button class=menu-button></button><button><span class=scale-button__value>x</span></button><button class=menu-button></button><button class=menu-button></button><button></button></div><div>x:<!>, y:</div><div id=popover><button class=alignment-button></button><button class=alignment-button></button><button class=alignment-button></button><button class=alignment-button></button><button class=alignment-button>"),xo=y("<div class=panel><div class=panel__content-wrapper><div><div class=grid-setting-box><div class=grid-setting-box__header><h3 class=grid-setting-box__heading>Vertical Rhythm</h3><button><span></span></button></div><fieldset class=fieldset><legend>Vertical Rhythm Height</legend><input type=text><button>Update</button></fieldset><fieldset class=fieldset><legend>Vertical Rhythm Color</legend><input type=text><button>Update</button></fieldset></div><div class=grid-setting-box><div class=grid-setting-box__header><h3 class=grid-setting-box__heading>Grid System</h3><button><span></span></button></div><fieldset class=fieldset><legend>Grid System Color</legend><input type=text><button>Update</button></fieldset><div class=table-wrapper><table class=table><thead><tr><th>Width</th><th>Columns</th><th>Gutter Width</th><th>Outer Gutter</th><th>Position</th><th></th></tr></thead><tbody></tbody><tfoot><tr><td><input type=text placeholder=1140px></td><td><input type=text placeholder=12></td><td><input type=text placeholder=24px></td><td><select><option value=1>Yes</option><option value=0>No</option></select></td><td><select><option value=center>Center</option><option value=left>Left</option><option value=right>Right</option></select></td><td colspan=2><button class=add-grid-button>Add Grid</button></td></tr></tfoot></table></div></div></div></div><div class=panel__footer><button class=panel__button>Reset Grid Settings</button><button class=panel__button>Close"),ko=y("<tr><td></td><td></td><td></td><td></td><td></td><td class=table__bgroup><button class=table__button></button><button>"),_o=y('<div><img class=design-card__img alt=""><button class=design-card__button>'),So=y("<button class=panel__button>Clear Designs"),$o=y("<div class=panel><div class=panel__content-wrapper><div><div class=all-designs-list><label class=upload-button><span class=upload-button__text>Upload</span><input type=file accept=image/jpeg,image/png multiple></label></div></div></div><div class=panel__footer><button class=panel__button>Close"),Ao=y('<img alt="">'),Eo=y("<div class=vertical-rhythm-overlay>"),Oo=y("<div><div>"),Po=y("<div>"),Mo=y("<div id=toast class=toast><span class=toast__message>");function U(e){const t=e instanceof Error?e.message:"An error occurred.";k("errorMessage",t),console.error(t)}function Do(){const[e,t]=G(!1),n=ne(()=>f.showAllDesignsPanel?{width:"800px",height:"600px"}:f.showGridSettingsPanel?{width:"680px",height:"600px"}:{width:"380px",height:"48px"});xe(()=>{N.init().then(()=>t(!0)).catch(U)});const o=h=>{h.composedPath().find(p=>p instanceof Element&&p.id==="app-bar")||(k({showAllDesignsPanel:!1,showGridSettingsPanel:!1}),window.removeEventListener("mousedown",o))};Ce(()=>{!f.showAllDesignsPanel&&!f.showGridSettingsPanel||(window.addEventListener("mousedown",o),ke(()=>{window.removeEventListener("mousedown",o)}))});const i=()=>{P({showDesignOverlay:!u.showDesignOverlay})},r=()=>{P({lockDesignOverlay:!u.lockDesignOverlay})},s=()=>{P({designOpacity:.5})},l=()=>{u.showDesignOverlay&&k("showAlignmentPopover",!0)},d=h=>{const p=h.relatedTarget;p!=null&&p.closest("#popover")||k("showAlignmentPopover",!1)},g=h=>{const{clientWidth:p,scrollHeight:_}=document.documentElement,{width:$,height:M}=f.designSize,{x:z,y:C}=u.designPosition,x={top:{x:z,y:0},right:{x:p-$,y:C},bottom:{x:z,y:_-M},left:{x:0,y:C},center:{x:(p-$)/2|0,y:C},"top-center":{x:(p-$)/2|0,y:0}}[h];x.x===z&&x.y===C||(k({designBufferedPosition:x,enableAnimation:!0}),P({designPosition:x}))},c=()=>{const h=u.designScale===.5?1:.5;k({designSize:{width:f.designOriginalSize.width*h,height:f.designOriginalSize.height*h},enableAnimation:!0}),P({designScale:h})},a=()=>{const h=u.appPosition==="top"?"bottom":"top";P({appPosition:h})};return w(H,{get when(){return e()},get children(){return[(()=>{var h=mo();return v(h,w(Go,{}),null),v(h,w(H,{get when(){return u.showVerticalRhythmOverlay&&!f.isZoomMode},get children(){return w(Io,{})}}),null),v(h,w(H,{get when(){return u.showGridSystemOverlay&&!f.isZoomMode},get children(){return w(No,{})}}),null),h})(),(()=>{var h=Co(),p=h.firstChild,_=p.firstChild,$=_.nextSibling,M=$.nextSibling,z=M.firstChild,C=M.nextSibling,x=C.nextSibling,D=x.firstChild,V=D.firstChild,oe=x.nextSibling,Oe=oe.nextSibling,Pe=Oe.nextSibling,ie=p.nextSibling,ct=ie.firstChild,T=ct.nextSibling;T.nextSibling;var Z=ie.nextSibling,W=Z.firstChild,he=W.nextSibling,ge=he.nextSibling,Me=ge.nextSibling,re=Me.nextSibling;return v(h,w(H,{get when(){return!!f.errorMessage},get children(){return w(To,{})}}),p),_.$$click=i,v(_,w(H,{get when(){return u.showDesignOverlay},get fallback(){return w(Nn,{})},get children(){return w(Gn,{})}})),$.$$click=r,v($,w(H,{get when(){return u.lockDesignOverlay},get fallback(){return w(io,{})},get children(){return w(no,{})}})),M.$$click=s,v(z,()=>Math.floor(u.designOpacity*100)),v(M,w(so,{}),null),C.addEventListener("mouseleave",d),C.addEventListener("mouseenter",l),C.$$click=()=>g("top-center"),v(C,w(Un,{})),x.$$click=c,v(D,(()=>{var m=ne(()=>u.designScale===.5);return()=>m()?".5":u.designScale.toString()})(),V),v(x,w(eo,{}),null),oe.$$click=()=>k("showGridSettingsPanel",!0),v(oe,w(ao,{})),Oe.$$click=()=>k("showAllDesignsPanel",!0),v(Oe,w(zn,{})),Pe.$$click=a,v(Pe,w(uo,{})),v(ie,()=>f.designBufferedPosition.x,T),v(ie,()=>f.designBufferedPosition.y,null),Z.addEventListener("mouseleave",d),W.$$click=()=>g("left"),v(W,w(Kn,{})),he.$$click=()=>g("top"),v(he,w(Vn,{})),ge.$$click=()=>g("center"),v(ge,w(Jn,{})),Me.$$click=()=>g("bottom"),v(Me,w(Wn,{})),re.$$click=()=>g("right"),v(re,w(Yn,{})),v(h,w(H,{get when(){return f.showGridSettingsPanel},get children(){return w(Lo,{})}}),null),v(h,w(H,{get when(){return f.showAllDesignsPanel},get children(){return w(Ro,{})}}),null),S(m=>{var De=I("app-bar",f.isSolidMode&&"hide",f.isDragging&&"no-events",u.appPosition==="top"&&"top"),ut=n(),F=I("menu-bar",(f.showAllDesignsPanel||f.showGridSettingsPanel)&&"hide"),Fe=!f.designUrl,fe=!u.showDesignOverlay,Ye=I("menu-button","opacity-button"),Y=!u.showDesignOverlay,Xe=!u.showDesignOverlay,Je=I("menu-button","scale-button"),Le=!u.showDesignOverlay,Qe=I("menu-button",u.appPosition==="top"&&"rotate"),se=I("coordinates",(!u.showDesignOverlay||f.showAlignmentPopover||f.showAllDesignsPanel||f.showGridSettingsPanel)&&"hide"),je=I("alignment-popover",!f.showAlignmentPopover&&"hide");return De!==m.e&&j(h,m.e=De),m.t=lt(h,ut,m.t),F!==m.a&&j(p,m.a=F),Fe!==m.o&&(_.disabled=m.o=Fe),fe!==m.i&&($.disabled=m.i=fe),Ye!==m.n&&j(M,m.n=Ye),Y!==m.s&&(M.disabled=m.s=Y),Xe!==m.h&&(C.disabled=m.h=Xe),Je!==m.r&&j(x,m.r=Je),Le!==m.d&&(x.disabled=m.d=Le),Qe!==m.l&&j(Pe,m.l=Qe),se!==m.u&&j(ie,m.u=se),je!==m.c&&j(Z,m.c=je),m},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0}),h})()]}})}function Lo(){const[e,t]=G(u.verticalRhythmHeight),[n,o]=G(u.verticalRhythmColor),[i,r]=G([]),[s,l]=G(u.gridSystemColor),[d,g]=G(""),[c,a]=G(""),[h,p]=G(""),[_,$]=G(!0),[M,z]=G("center");xe(()=>{N.getAllGridSets().then(T=>r(T)).catch(U)});const C=()=>{P({showVerticalRhythmOverlay:!u.showVerticalRhythmOverlay})},x=()=>{P({verticalRhythmHeight:e()})},D=()=>{P({verticalRhythmColor:n()})},V=()=>{P({showGridSystemOverlay:!u.showGridSystemOverlay})},oe=()=>{P({gridSystemColor:s()})},Oe=()=>{const T={width:/^\d+$/.test(d())?`${d()}px`:d(),columns:+c(),gutterWidth:/^\d+$/.test(h())?`${h()}px`:h(),isGutterOnOutside:_(),position:M()};N.addGridSet(T).then(Z=>{r(W=>[...W,Z]),g(""),a(""),p(""),$(!0),z("center")}).catch(U)},Pe=T=>{N.deleteGridSet(T).then(()=>{r(Z=>Z.filter(W=>W.id!==T))}).catch(U)},ie=T=>{P({activeGridSystemId:T})},ct=()=>{N.resetGridSets().then(T=>{r(T),P({activeGridSystemId:"default"})}).catch(U)};return(()=>{var T=xo(),Z=T.firstChild,W=Z.firstChild,he=W.firstChild,ge=he.firstChild,Me=ge.firstChild,re=Me.nextSibling,m=re.firstChild,De=ge.nextSibling,ut=De.firstChild,F=ut.nextSibling,Fe=F.nextSibling,fe=De.nextSibling,Ye=fe.firstChild,Y=Ye.nextSibling,Xe=Y.nextSibling,Je=he.nextSibling,Le=Je.firstChild,Qe=Le.firstChild,se=Qe.nextSibling,je=se.firstChild,et=Le.nextSibling,Ho=et.firstChild,pe=Ho.nextSibling,Vo=pe.nextSibling,Zo=et.nextSibling,Wo=Zo.firstChild,qo=Wo.firstChild,Tt=qo.nextSibling,Ko=Tt.nextSibling,Fo=Ko.firstChild,zt=Fo.firstChild,ht=zt.firstChild,Bt=zt.nextSibling,gt=Bt.firstChild,Ut=Bt.nextSibling,ft=Ut.firstChild,Ht=Ut.nextSibling,Vt=Ht.firstChild,Zt=Ht.nextSibling,Wt=Zt.firstChild,Yo=Zt.nextSibling,qt=Yo.firstChild,Xo=Z.nextSibling,Kt=Xo.firstChild,Jo=Kt.nextSibling;return re.$$click=C,v(re,w(Nt,{}),m),v(m,()=>u.showVerticalRhythmOverlay?"Enabled":"Disabled"),F.$$input=b=>t(b.target.value),B(F,"spellcheck",!1),Fe.$$click=x,Y.$$input=b=>o(b.target.value),B(Y,"spellcheck",!1),Xe.$$click=D,se.$$click=V,v(se,w(Nt,{}),je),v(je,()=>u.showGridSystemOverlay?"Enabled":"Disabled"),pe.$$input=b=>l(b.target.value),B(pe,"spellcheck",!1),Vo.$$click=oe,v(Tt,()=>w(st,{get each(){return i()},children:b=>(()=>{var be=ko(),Re=be.firstChild,we=Re.nextSibling,ve=we.nextSibling,ye=ve.nextSibling,Ge=ye.nextSibling,Ie=Ge.nextSibling,ee=Ie.firstChild,le=ee.nextSibling;return v(Re,()=>b.width),v(we,()=>b.columns),v(ve,()=>b.gutterWidth),v(ye,()=>b.isGutterOnOutside?"Yes":"No"),v(Ge,()=>b.position),ee.$$click=()=>Pe(b.id),v(ee,w(It,{})),le.$$click=()=>ie(b.id),v(le,w(bo,{})),S(X=>{var Ft=I(u.activeGridSystemId===b.id&&"active"),Yt=i().length==1||u.activeGridSystemId===b.id,Xt=I("table__button","active-grid-button",u.activeGridSystemId===b.id&&"active"),Jt=u.activeGridSystemId===b.id;return Ft!==X.e&&j(be,X.e=Ft),Yt!==X.t&&(ee.disabled=X.t=Yt),Xt!==X.a&&j(le,X.a=Xt),Jt!==X.o&&(le.disabled=X.o=Jt),X},{e:void 0,t:void 0,a:void 0,o:void 0}),be})()})),ht.$$input=b=>g(b.target.value),B(ht,"spellcheck",!1),gt.$$input=b=>a(b.target.value),B(gt,"spellcheck",!1),ft.$$input=b=>p(b.target.value),B(ft,"spellcheck",!1),Vt.addEventListener("change",b=>$(!!+b.target.value)),Wt.addEventListener("change",b=>z(b.target.value)),qt.$$click=Oe,Kt.$$click=ct,Jo.$$click=()=>k("showGridSettingsPanel",!1),S(b=>{var be=I("panel__content",!!i().length&&"show"),Re=I("grid-setting-box__toggle-button",u.showVerticalRhythmOverlay&&"enabled"),we=e()!==u.verticalRhythmHeight?"italic":void 0,ve=n(),ye=n()!==u.verticalRhythmColor?"italic":void 0,Ge=I("grid-setting-box__toggle-button",u.showGridSystemOverlay&&"enabled"),Ie=s(),ee=s()!==u.gridSystemColor?"italic":void 0,le=!d()||!c()||!h();return be!==b.e&&j(W,b.e=be),Re!==b.t&&j(re,b.t=Re),we!==b.a&&((b.a=we)!=null?F.style.setProperty("font-style",we):F.style.removeProperty("font-style")),ve!==b.o&&((b.o=ve)!=null?fe.style.setProperty("background",ve):fe.style.removeProperty("background")),ye!==b.i&&((b.i=ye)!=null?Y.style.setProperty("font-style",ye):Y.style.removeProperty("font-style")),Ge!==b.n&&j(se,b.n=Ge),Ie!==b.s&&((b.s=Ie)!=null?et.style.setProperty("background",Ie):et.style.removeProperty("background")),ee!==b.h&&((b.h=ee)!=null?pe.style.setProperty("font-style",ee):pe.style.removeProperty("font-style")),le!==b.r&&(qt.disabled=b.r=le),b},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),S(()=>F.value=e()),S(()=>Y.value=n()),S(()=>pe.value=s()),S(()=>ht.value=d()),S(()=>gt.value=c()),S(()=>ft.value=h()),S(()=>Vt.value=Number(_())),S(()=>Wt.value=M()),T})()}function jo(e){const[t,n]=G("");return xe(()=>{const o=new Blob([e.buffer],{type:e.mimeType}),i=URL.createObjectURL(o);n(i)}),ke(()=>{URL.revokeObjectURL(t())}),(()=>{var o=_o(),i=o.firstChild,r=i.nextSibling;return i.$$click=()=>e.selectDesign(e.id),B(i,"draggable",!1),r.$$click=()=>e.deleteDesign(e.id),v(r,w(It,{})),S(s=>{var l=I("design-card",u.designId===e.id&&"current"),d=t(),g=u.designId===e.id;return l!==s.e&&j(o,s.e=l),d!==s.t&&B(i,"src",s.t=d),g!==s.a&&(r.disabled=s.a=g),s},{e:void 0,t:void 0,a:void 0}),o})()}function Ro(){const[e,t]=G(!1),[n,o]=G([]);xe(()=>{N.getAllDesigns().then(a=>{o(a),t(!0)}).catch(U)});const i=a=>{a.length!==0&&N.uploadDesign(a).then(h=>o(p=>[...h,...p])).catch(U)},r=a=>{const h=a.target,p=Array.from(h.files||[]);i(p)},s=a=>{var p;a.preventDefault(),a.stopPropagation();const h=Array.from(((p=a.dataTransfer)==null?void 0:p.files)||[]).filter(_=>["image/jpeg","image/png"].includes(_.type));i(h)},l=a=>{a.preventDefault(),a.stopPropagation()},d=a=>{u.designId!==a&&(P({designId:a,showDesignOverlay:!0}),k("showAllDesignsPanel",!1))},g=a=>{N.deleteDesign(a).then(()=>o(h=>h.filter(p=>p.id!==a))).catch(U)},c=()=>{N.deleteAllDesigns().then(()=>{o([]),P({designId:"",showDesignOverlay:!1}),f.designUrl&&(URL.revokeObjectURL(f.designUrl),k("designUrl",void 0))}).catch(U)};return(()=>{var a=$o(),h=a.firstChild,p=h.firstChild,_=p.firstChild,$=_.firstChild,M=$.firstChild,z=M.nextSibling,C=h.nextSibling,x=C.firstChild;return p.addEventListener("dragover",l),p.addEventListener("drop",s),v($,w(vo,{class:"upload-button__icon"}),M),z.addEventListener("change",r),v(_,()=>w(st,{get each(){return n()},children:D=>w(jo,cn(D,{selectDesign:d,deleteDesign:g}))}),null),v(C,w(H,{get when(){return!!n().length},get children(){var D=So();return D.$$click=c,D}}),x),x.$$click=()=>k("showAllDesignsPanel",!1),S(()=>j(p,I("panel__content",e()&&"show"))),a})()}function Go(){Ce(()=>{u.designId&&N.getDesign(u.designId).then(c=>{if(!c)throw new Error("Failed to load design image.");const a=new Blob([c.buffer],{type:c.mimeType}),h=URL.createObjectURL(a);k("designUrl",h)}).catch(U)}),Ce(()=>{u.showDesignOverlay?(window.addEventListener("keydown",s),window.addEventListener("keyup",l)):(window.removeEventListener("keydown",s),window.removeEventListener("keyup",l))}),ke(()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",l)});const e=ne(()=>({width:`${f.designSize.width}px`,height:`${f.designSize.height}px`,opacity:f.isSolidMode?1:u.designOpacity,transform:`translate3D(${f.designBufferedPosition.x}px, ${f.designBufferedPosition.y}px, 0)`,cursor:f.isSolidMode?f.isZoomMode?"zoom-out":"zoom-in":f.isDragging?"grabbing":"grab"})),t=c=>{const a=c.target;k({designSize:{width:a.naturalWidth*u.designScale,height:a.naturalHeight*u.designScale},designOriginalSize:{width:a.naturalWidth,height:a.naturalHeight},designBufferedPosition:u.designPosition})},n=c=>{c.button===0&&(f.isSolidMode?f.isZoomMode?(k({isZoomMode:!1,designSize:{width:f.designOriginalSize.width*u.designScale,height:f.designOriginalSize.height*u.designScale},designBufferedPosition:u.designPosition,enableAnimation:!0}),window.removeEventListener("mousemove",i)):k({isZoomMode:!0,designSize:{width:f.designSize.width*2,height:f.designSize.height*2},designBufferedPosition:{x:innerWidth/2-(c.clientX-f.designBufferedPosition.x)*2,y:innerHeight/2-(c.clientY-f.designBufferedPosition.y)*2},enableAnimation:!0}):u.lockDesignOverlay||(k("isDragging",!0),window.addEventListener("mousemove",o)))},o=c=>{k("designBufferedPosition",a=>({x:a.x+c.movementX,y:a.y+c.movementY}))},i=c=>{k("designBufferedPosition",a=>({x:a.x-c.movementX,y:a.y-c.movementY}))},r=c=>{c.button!==0||!f.isDragging||(k("isDragging",!1),P({designPosition:f.designBufferedPosition}),window.removeEventListener("mousemove",o))},s=c=>{if(!c.composedPath().find(a=>a instanceof Element&&["INPUT","SELECT"].includes(a.tagName)))if(c.key==="Control")window.addEventListener("wheel",d,{passive:!1});else if(c.key===" ")c.preventDefault(),f.isDragging||k("isSolidMode",!0);else if(c.key.startsWith("Arrow")){c.preventDefault();const[a,h]={ArrowUp:[0,-1],ArrowDown:[0,1],ArrowLeft:[-1,0],ArrowRight:[1,0]}[c.key]||[0,0];k("designBufferedPosition",{x:u.designPosition.x+a,y:u.designPosition.y+h})}else c.key==="Escape"&&P({lockDesignOverlay:!u.lockDesignOverlay})},l=c=>{["INPUT","SELECT"].includes(c.target.tagName)||(c.key==="Control"?window.removeEventListener("wheel",d):c.key===" "?f.isZoomMode?(k({isSolidMode:!1,isZoomMode:!1,designSize:{width:f.designOriginalSize.width*u.designScale,height:f.designOriginalSize.height*u.designScale},designBufferedPosition:u.designPosition,enableAnimation:!0}),window.removeEventListener("mousemove",i)):k("isSolidMode",!1):c.key.startsWith("Arrow")&&P({designPosition:f.designBufferedPosition}))},d=c=>{c.preventDefault();const a=c.deltaY>0?.05:-.05,h=Math.round((u.designOpacity+a)*100)/100;P({designOpacity:Math.max(.1,Math.min(.9,h))})},g=()=>{k("enableAnimation",!1),f.isZoomMode&&window.addEventListener("mousemove",i)};return(()=>{var c=Ao();return c.addEventListener("transitionend",g),c.addEventListener("mouseleave",r),c.$$mouseup=r,c.$$mousedown=n,c.addEventListener("load",t),B(c,"draggable",!1),S(a=>{var h=f.designUrl,p=I("design-overlay",f.isSolidMode&&"solid",f.enableAnimation&&"animation",u.lockDesignOverlay&&!f.isSolidMode&&"locked",(!f.designUrl||!u.showDesignOverlay)&&"hide"),_=e();return h!==a.e&&B(c,"src",a.e=h),p!==a.t&&j(c,a.t=p),a.a=lt(c,_,a.a),a},{e:void 0,t:void 0,a:void 0}),c})()}function Io(){return(()=>{var e=Eo();return S(t=>{var n=`linear-gradient(to bottom, ${u.verticalRhythmColor} ${u.verticalRhythmHeight}, transparent ${u.verticalRhythmHeight})`,o=`100% ${u.verticalRhythmHeight.replace(/\d+/,i=>String(+i*2))}`;return n!==t.e&&((t.e=n)!=null?e.style.setProperty("background-image",n):e.style.removeProperty("background-image")),o!==t.t&&((t.t=o)!=null?e.style.setProperty("background-size",o):e.style.removeProperty("background-size")),t},{e:void 0,t:void 0}),e})()}function No(){const[e,t]=G(void 0);return Ce(()=>{u.activeGridSystemId&&N.getGridSet(u.activeGridSystemId).then(n=>{if(!n)throw new Error("Failed to load grid system.");t(n)}).catch(U)}),w(H,{get when(){return!!e()},get children(){var n=Oo(),o=n.firstChild;return o.style.setProperty("box-sizing","border-box"),o.style.setProperty("display","flex"),v(o,w(st,{get each(){return Array.from({length:e().columns})},children:()=>(()=>{var i=Po();return i.style.setProperty("flex","1"),S(r=>(r=u.gridSystemColor)!=null?i.style.setProperty("background",r):i.style.removeProperty("background")),i})()})),S(i=>{var r=I("grid-system-overlay",e().position),s=e().width,l=e().isGutterOnOutside?e().gutterWidth.replace(/\d+/,c=>String(+c/2)):void 0,d=e().isGutterOnOutside?e().gutterWidth.replace(/\d+/,c=>String(+c/2)):void 0,g=e().gutterWidth;return r!==i.e&&j(n,i.e=r),s!==i.t&&((i.t=s)!=null?o.style.setProperty("width",s):o.style.removeProperty("width")),l!==i.a&&((i.a=l)!=null?o.style.setProperty("padding-left",l):o.style.removeProperty("padding-left")),d!==i.o&&((i.o=d)!=null?o.style.setProperty("padding-right",d):o.style.removeProperty("padding-right")),g!==i.i&&((i.i=g)!=null?o.style.setProperty("gap",g):o.style.removeProperty("gap")),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),n}})}function To(){const e=()=>{k("errorMessage",void 0)};return xe(()=>{window.addEventListener("mousedown",e),ke(()=>{window.removeEventListener("mousedown",e)})}),(()=>{var t=Mo(),n=t.firstChild;return v(t,w(go,{}),n),v(n,()=>f.errorMessage),t})()}_t(["click","input","mousedown","mouseup"]);const zo=".alignment-button:not(:disabled):hover,.menu-button:not(:disabled):hover{background:#0000000a}*{box-sizing:border-box}button{background:none;border:none;cursor:pointer;font:inherit;margin:0;outline:none;padding:0}button:disabled{cursor:default}button:not(:disabled):active{transform:scale(.95)}svg{color:currentcolor;display:block;fill:none}.hide{display:none!important}.app-bar{align-items:center;background:#fff;border:2px solid;border-radius:32px;bottom:40px;box-sizing:border-box;color:#000;display:flex;font-family:Arial,sans-serif;justify-content:center;left:16px;margin-left:auto;margin-right:auto;max-width:calc(100vw - 32px);outline:3px solid hsla(0,0%,100%,.5);position:fixed;right:16px;transform:translateZ(0);transition:all .25s cubic-bezier(.4,0,.2,1);-webkit-user-select:none;user-select:none;will-change:width,height;z-index:2147483647}.app-bar.no-events{pointer-events:none}.app-bar.top{bottom:auto;top:48px}.toast{align-items:center;background:#fe0200;border:2px solid;border-radius:32px;bottom:96px;color:#fff;display:flex;gap:.5rem;left:50%;margin:auto;padding:.375rem .75rem;position:absolute;transform:translate(-50%);width:max-content;z-index:10}.toast__message{font-size:15px;line-height:16px}.top .toast{bottom:-64px}.menu-bar{align-items:center;display:flex;overflow-x:auto;padding:0 12px}.menu-button{padding:8px}.menu-button.rotate{transform:rotate(180deg)}.opacity-button{position:relative}.opacity-button__value{font-size:8px;font-weight:700;left:0;line-height:1;position:absolute;right:0;text-align:center;top:18px;z-index:1}.alignment-popover{align-items:center;background:#fff;border-left:2px solid;border-radius:12px 12px 0 0;border-right:2px solid;border-top:2px solid;bottom:100%;display:flex;left:80px;overflow:hidden;padding-left:4px;padding-right:4px;padding-top:4px;position:absolute;z-index:1}.alignment-button{border-radius:8px;padding:4px}.alignment-button>svg{height:24px;width:24px}.scale-button{position:relative}.scale-button__value{font-size:11.5px;font-weight:700;height:16px;top:0;right:0;bottom:0;left:0;line-height:16px;text-align:center}.coordinates,.scale-button__value{margin:auto;position:absolute;z-index:1}.coordinates{background:#fff;background:#000;border-radius:16px;bottom:calc(100% + 8px);color:#fff;font-family:monospace;font-size:12px;left:0;line-height:20px;padding:0 8px;pointer-events:none;right:0;white-space:nowrap;width:max-content}.panel{position:relative;width:100%}.panel,.panel__content-wrapper{border-radius:inherit;height:100%}.panel__content-wrapper{overflow:hidden;padding:8px}.panel__content{height:100%;opacity:0;overflow:auto;overscroll-behavior:contain;padding:16px;visibility:hidden;will-change:opacity visibility}.panel__content.show{opacity:1;transition:opacity .5s cubic-bezier(.4,0,.2,1) .25s,visibility 0s .25s;visibility:visible}.panel__footer{align-items:center;bottom:-18px;display:flex;gap:16px;left:0;margin:auto;position:absolute;right:0;width:max-content;z-index:1}.panel__button{background:#000;border-radius:16px;color:#fff;font-size:15px;line-height:32px;width:168px}.grid-setting-box{padding-bottom:24px}.grid-setting-box__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:8px}.grid-setting-box__heading{font-size:18px;line-height:32px;margin:0}.grid-setting-box__toggle-button{align-items:center;background:#000;border-radius:16px;color:#fff;display:flex;font-size:15px;gap:4px;line-height:32px;padding:0 10px;width:116px}.grid-setting-box__toggle-button>svg{flex:none}.grid-setting-box__toggle-button>span{flex:1;text-align:center}.grid-setting-box__toggle-button:active{transform:none!important}.grid-setting-box__toggle-button #toggle-trigger{transform:translate(-8px);transition:transform .25s cubic-bezier(.4,0,.2,1)}.grid-setting-box__toggle-button.enabled #toggle-trigger{transform:translate(0)}.fieldset{align-items:center;border-color:#000;border-radius:12px;display:flex;margin-bottom:16px;padding:8px 16px}.fieldset>legend{background:#000;border-radius:6px;color:#fff;font-size:15px;line-height:24px;padding-left:8px;padding-right:8px}.fieldset>input{background:transparent;border:none;display:block;flex:1;font-family:monospace;font-size:16px;line-height:24px;outline:none;padding:8px 8px 8px 0;width:100%}.fieldset>button{background:#000;border-radius:16px;color:#fff;font-size:14px;line-height:24px;padding-left:12px;padding-right:12px}.table-wrapper{border:2px solid #000;border-radius:12px;margin-top:24px;overflow:auto}.table{border-collapse:collapse;border-spacing:0;font-size:14px;line-height:16px;min-width:100%;text-align:left;white-space:nowrap;width:max-content}.table__bgroup{align-items:center;display:flex;gap:8px;justify-content:space-evenly}.table__button{border-radius:8px}.table__button>svg{height:20px;width:20px}.table__button.active-grid-button{opacity:0}.table__button.active-grid-button.active,.table__button.active-grid-button:focus{opacity:1}.table>thead>tr{border-bottom:1px solid #eee}.table>tbody{color:#333;text-transform:capitalize}.table>tbody>tr{border-bottom:1px solid #eee}.table>tbody>tr:hover .active-grid-button{opacity:1}.table>tbody>tr.active{background:#f9f9f9}.table th{padding:12px}.table th:not(:last-child){border-right:1px solid #eee}.table td{padding:8px 12px}.table td:not(:last-child){border-right:1px solid #eee}.table>tfoot td{padding:12px}.table>tfoot input{border:1px solid #eee;border-radius:6px;font-size:14px;height:24px;outline:none;padding:0 8px;width:72px}.table>tfoot input:focus{outline:2px solid #ddd}.table>tfoot select{border:1px solid #eee;border-radius:6px;font-size:14px;height:24px;outline:none;padding:0 4px}.table>tfoot select:focus{outline:2px solid #ddd}.add-grid-button{background:#000;border:none;border-radius:16px;color:#fff;font-size:13px;height:24px;padding-left:12px;padding-right:12px}.add-grid-button:disabled{opacity:.5}.add-grid-button:focus{outline:2px solid #999}.all-designs-list{display:grid;gap:20px;grid-template-columns:repeat(4,1fr)}.design-card{cursor:pointer;position:relative}.design-card__img{aspect-ratio:3/4;border:2px solid #ddd;border-radius:16px;display:block;object-fit:cover;width:100%}.design-card__button{align-items:center;background:#000;border-radius:50%;bottom:12px;color:#fff;display:flex;justify-content:center;opacity:0;padding:6px;position:absolute;right:12px;z-index:2}.design-card__button>svg{height:20px;width:20px}.design-card__button:hover{background:#fe0200}.design-card.current{cursor:not-allowed}.design-card.current .design-card__img{border-color:#666}.design-card.current .design-card__button{display:none}.design-card:hover .design-card__img{border-color:#666}.design-card:hover .design-card__button{opacity:1;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.upload-button{align-items:center;aspect-ratio:3/4;background:#fafafa;border:2px solid #ddd;border-radius:16px;color:#aaa;cursor:pointer;display:flex;flex-direction:column;justify-content:center;width:100%}.upload-button__icon{background:#eee;border-radius:12px;height:64px;padding:12px;width:64px}.upload-button__text{font-size:16px;line-height:24px;margin-top:8px}.upload-button>input{display:none}.upload-button:hover{border-color:#666;color:#666}.overlay-container{top:0;right:0;bottom:0;left:0;min-height:100vh;overflow:hidden;pointer-events:none;position:absolute;z-index:2147483646}.design-overlay{contain:layout size;left:0;pointer-events:all;position:absolute;top:0;transition:none;-webkit-user-select:none;user-select:none;will-change:width,height,transform;z-index:1}.design-overlay:active{outline:1px dashed #000}.design-overlay.animation{transition:width .25s cubic-bezier(.4,0,.2,1),height .25s cubic-bezier(.4,0,.2,1),transform .25s cubic-bezier(.4,0,.2,1)}.design-overlay.locked{cursor:default;pointer-events:none}.design-overlay.solid{outline:none!important}.vertical-rhythm-overlay{top:0;right:0;bottom:0;left:0;position:absolute;z-index:2}.grid-system-overlay{display:grid;top:0;right:0;bottom:0;left:0;position:absolute;z-index:3}.grid-system-overlay.center{justify-content:center}.grid-system-overlay.left{justify-content:start}.grid-system-overlay.right{justify-content:end}";document.documentElement.style.position="relative";class Bo extends HTMLElement{constructor(){super();const t=this.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=zo,t.appendChild(n),wn(()=>w(Do,{}),t)}}customElements.define("pixel-mirror",Bo);const Uo=document.createElement("pixel-mirror");document.body.appendChild(Uo)})();
|
|
1
|
+
(function(){typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var e={},t=Symbol(`uninitialized`),n=`http://www.w3.org/1999/xhtml`,r=Array.isArray,i=Array.prototype.indexOf,a=Array.prototype.includes,o=Array.from,s=Object.keys,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyDescriptors,d=Object.prototype,f=Array.prototype,p=Object.getPrototypeOf,m=Object.isExtensible,h=()=>{};function g(e){for(var t=0;t<e.length;t++)e[t]()}function _(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var v=1<<24,y=1024,b=2048,x=4096,S=8192,C=16384,w=32768,T=1<<25,E=65536,D=1<<19,ee=1<<20,O=1<<25,te=1<<21,ne=1<<22,re=1<<23,ie=Symbol(`$state`),ae=Symbol(`component`),oe=Symbol(`legacy props`),se=Symbol(``),ce=Symbol(`attributes`),le=Symbol(`class`),ue=Symbol(`style`),de=Symbol(`text`),fe=Symbol(`form reset`),pe=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},me=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function he(){console.warn(`https://svelte.dev/e/derived_inert`)}function ge(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function _e(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function ve(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var k=!1;function ye(e){k=e}var A;function be(t){if(t===null)throw ge(),e;return A=t}function xe(){return be(an(A))}function j(t){if(k){if(an(A)!==null)throw ge(),e;A=t}}function Se(e=1){if(k){for(var t=e,n=A;t--;)n=an(n);A=n}}function Ce(e=!0){for(var t=0,n=A;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=an(n);e&&n.remove(),n=i}}function M(t){if(!t||t.nodeType!==8)throw ge(),e;return t.data}function we(e){return e===this.v}function Te(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Ee(e){return!Te(e,this.v)}function De(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function Oe(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function ke(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Ae(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function je(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Me(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Ne(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Pe(){throw Error(`https://svelte.dev/e/hydration_failed`)}function Fe(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Ie(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Le(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Re(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function ze(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Be=[];function Ve(e,t=!1,n=!1){return He(e,new Map,``,Be,null,n)}function He(e,t,n,i,a=null,o=!1){if(typeof e==`object`&&e){var s=t.get(e);if(s!==void 0)return s;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(r(e)){var c=Array(e.length);t.set(e,c),a!==null&&t.set(a,c);for(var l=0;l<e.length;l+=1){var u=e[l];l in e&&(c[l]=He(u,t,n,i,null,o))}return c}if(p(e)===d){c={},t.set(e,c),a!==null&&t.set(a,c);for(var f of Object.keys(e))c[f]=He(e[f],t,n,i,null,o);return c}if(e instanceof Date)return e.getTime(),structuredClone(e);if(typeof e.toJSON==`function`&&!o)return He(e.toJSON(),t,n,i,e)}if(e instanceof EventTarget)return e;try{return structuredClone(e)}catch{return e}}var Ue=null;function We(e){Ue=e}function Ge(e,t=!1,n){Ue={p:Ue,i:!1,c:null,e:null,s:e,x:null,r:H,l:null}}function Ke(e){var t=Ue,n=t.e;if(n!==null){t.e=null;for(var r of n)bn(r)}return e!==void 0&&(t.x=e),t.i=!0,Ue=t.p,qe(e)}function qe(e={}){return c(e,ae,{value:!0}),e}function Je(){return!0}var Ye=[];function Xe(){var e=Ye;Ye=[],g(e)}function Ze(e){if(Ye.length===0&&!Ct){var t=Ye;queueMicrotask(()=>{t===Ye&&Xe()})}Ye.push(e)}function Qe(){for(;Ye.length>0;)Xe()}var $e=~(b|x|y);function N(e,t){e.f=e.f&$e|t}function et(e){e.f&512||e.deps===null?N(e,y):N(e,x)}function tt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),N(e,y)}var nt=!1;function rt(){nt||(nt=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[fe]?.()})},{capture:!0}))}function it(e){var t=V,n=H;Wn(null),Gn(null);try{return e()}finally{Wn(t),Gn(n)}}function at(e,t,n,r=n){e.addEventListener(t,()=>it(n));let i=e[fe];e[fe]=i?()=>{i(),r(!0)}:()=>r(!0),rt()}function ot(e,t,n,r){let i=Je()?ut:pt;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=H,c=st(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){pn(e,s)}ct()}}var d=lt();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>ft(e))).then(u).catch(e=>pn(e,s)).finally(d)}l?l.then(()=>{s.f&16384?d():(c(),f(),ct())}):f()}function st(){var e=H,t=V,n=Ue,r=F;return function(i=!0){Gn(e),Wn(t),We(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function ct(e=!0){Gn(null),Wn(null),We(null),e&&F?.deactivate()}function lt(){var e=H,t=e.b,n=F,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function ut(e){var n=2|b;return H!==null&&(H.f|=D),{ctx:Ue,deps:null,effects:null,equals:we,f:n,fn:e,reactions:null,rv:0,v:t,wv:0,parent:H,ac:null}}var dt=Symbol(`obsolete`);function ft(e,n,r){let i=H;i===null&&Oe();var a=void 0,o=Bt(t),s=!V,c=new Set;return wn(()=>{var t=H,n=_();a=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==pe&&n.reject(e)}).finally(ct)}catch(e){n.reject(e),ct()}var r=F;if(s){if(t.f&32768)var l=lt();if(i.b?.is_rendered())r.async_deriveds.get(t)?.reject(dt);else for(let e of c.values())e.reject(dt);c.add(n),r.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),c.delete(n),t!==dt&&(r.activate(),t?(o.f|=re,Wt(o,t)):(o.f&8388608&&(o.f^=re),Wt(o,e)),r.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),vn(()=>{for(let e of c)e.reject(dt)}),new Promise(e=>{function t(n){function r(){n===a?e(o):t(a)}n.then(r,r)}t(a)})}function P(e){let t=ut(e);return qn(t),t}function pt(e){let t=ut(e);return t.equals=Ee,t}function mt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Mn(t[n])}}function ht(e){var n,r=H,i=e.parent;if(!Vn&&i!==null&&e.v!==t&&i.f&24576)return he(),e.v;Gn(i);try{mt(e),n=ar(e)}finally{Gn(r)}return n}function gt(e){var t=ht(e);!e.equals(t)&&(e.wv=nr(),(!F?.is_fork||e.deps===null)&&(F===null?e.v=t:(F.capture(e,t,!0),bt?.capture(e,t,!0)),e.deps===null))?N(e,y):Vn||(xt===null?et(e):(_n()||F?.is_fork)&&xt.set(e,t))}function _t(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac!==null&&it(()=>{t.ac.abort(pe),t.ac=null}),t.fn!==null&&(t.teardown=h),cr(t,0),An(t))}function vt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&lr(t)}var yt=null,F=null,bt=null,xt=null,St=null,Ct=!1,wt=!1,Tt=null,Et=null,Dt=0,Ot=1,kt=class e{id=Ot++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){yt===null?yt=this:(yt.#n=this,this.#t=yt),yt=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)N(r,b),t(r);for(r of n.m)N(r,x),t(r)}this.#p.add(e)}#g(){var e=[];for(let i of this.#c)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=y}}n||e.push(t)}return this.#c=[],e}#_(){this.#e=!0;for(let e of this.#u)this.#d.delete(e),N(e,b),this.schedule(e);for(let e of this.#d)N(e,x),this.schedule(e);this.apply();for(var t=Tt=[],n=[],r=Et=[];this.#c.length>0;){Dt++>1e3&&(this.#S(),jt());for(let e of this.#g())try{this.#v(e,t,n)}catch(t){throw It(e),this.#h()||this.discard(),t}}if(F=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(Tt=null,Et=null,this.#h()){this.#x(n),this.#x(t);for(let[e,t]of this.#f)Ft(e,t);r.length>0&&F.#_();return}let a=this.#y();if(a)this.#x(n),this.#x(t),a.#b(this);else{this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),bt=this,Nt(n),Nt(t),bt=null,this.#s?.resolve();var o=F;if(this.#a===0&&(this.#c.length===0||o!==null)&&this.#S(),this.#c.length>0){if(o!==null){for(let e of this.#c)o.#c.push(e);this.#c=[]}else o=this}o!==null&&(Rt.clear(),o.#_())}}#v(e,t,n){e.f^=y;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=y:i&4?t.push(r):rr(r)&&(i&16&&this.#d.add(r),lr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#y(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#b(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),N(i,b),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),F=this,this.#_()}#x(e){for(var t=0;t<e.length;t+=1)tt(e[t],this.#u,this.#d)}capture(e,n,r=!1){e.v!==t&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[n,r]),xt?.set(e,n)),this.is_fork||(e.v=n)}activate(){F=this}deactivate(){F=null,xt=null}flush(){try{wt=!0,F=this,this.#_()}finally{Dt=0,St=null,Tt=null,Et=null,wt=!1,F=null,xt=null,Rt.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(dt);this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,Ze(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=_()).promise}static ensure(){if(F===null){let t=F=new e;!wt&&!Ct&&Ze(()=>{t.#e||t.flush()})}return F}apply(){xt=null}schedule(e){St=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)?e.b.defer_effect(e):this.#c.push(e)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?yt=e:t.#t=e,this.linked=!1}}};function At(e){var t=Ct,n=bt;bt=null,Ct=!0;try{var r;for(e&&(At(),r=e());;){if(Qe(),F===null)return r;F.flush()}}finally{Ct=t,bt=n}}function jt(){try{Ne()}catch(e){pn(e,St)}}var Mt=null;function Nt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&rr(r)&&(Mt=new Set,lr(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Pn(r),Mt?.size>0)){Rt.clear();for(let e of Mt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Mt.has(n)&&(Mt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||lr(n)}}Mt.clear()}}Mt=null}}function Pt(e){F.schedule(e)}function Ft(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),N(e,y);for(var n=e.first;n!==null;)Ft(n,t),n=n.next}}function It(e){N(e,y);for(var t=e.first;t!==null;)It(t),t=t.next}var Lt=new Set,Rt=new Map,zt=!1;function Bt(e,t){return{f:0,v:e,reactions:null,equals:we,rv:0,wv:0}}function I(e,t){let n=Bt(e,t);return qn(n),n}function Vt(e,t=!1,n=!0){let r=Bt(e);return t||(r.equals=Ee),r}function L(e,t,n=!1){return V!==null&&(!Un||V.f&131072)&&Je()&&V.f&4325394&&(Kn===null||!Kn.has(e))&&Re(),Wt(e,n?Jt(t):t,Et)}var Ht=null,Ut=0;function Wt(e,t,n=null){if(!e.equals(t)){Vn?Rt.set(e,t):Rt.has(e)||Rt.set(e,e.v);var r=kt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&ht(t),xt===null&&et(t)}e.wv=nr(),Ht=null,Ut=0,qt(e,b,n),Ht=null,Je()&&H!==null&&H.f&1024&&!(H.f&96)&&(Xn===null?Zn([e]):Xn.push(e)),!r.is_fork&&Lt.size>0&&!zt&&Gt()}return t}function Gt(){zt=!1;for(let e of Lt){e.f&1024&&N(e,x);let t;try{t=rr(e)}catch{t=!0}t&&lr(e)}Lt.clear()}function Kt(e){L(e,e.v+1)}function qt(e,t,n){var r=e.reactions;if(r!==null){var i=Je(),a=r.length;if(Ut+=a,Ut>1e5&&Ht===null&&(Ht=new Set),Ht!==null){if(Ht.has(e))return;Ht.add(e)}for(var o=0;o<a;o++){var s=r[o],c=s.f;if(i||s!==H){var l=(c&b)===0;if(l&&N(s,t),c&131072)Lt.add(s);else if(c&2){var u=s;xt?.delete(u),qt(u,x,n)}else if(l){var d=s;c&16&&Mt!==null&&Mt.add(d),n===null?Pt(d):n.push(d)}}}}}function Jt(e){if(typeof e!=`object`||!e||ie in e||ae in e)return e;let n=p(e);if(n!==d&&n!==f)return e;var i=new Map,a=r(e),o=I(0),s=null,c=er,u=e=>{if(er===c)return e();var t=V,n=er;Wn(null),tr(c);var r=e();return Wn(t),tr(n),r};return a&&i.set(`length`,I(e.length,s)),new Proxy(e,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&Ie();var r=i.get(t);return r===void 0?u(()=>{var e=I(n.value,s);return i.set(t,e),e}):L(r,n.value,!0),!0},deleteProperty(e,n){var r=i.get(n);if(r===void 0){if(n in e){let e=u(()=>I(t,s));i.set(n,e),Kt(o)}}else L(r,t),Kt(o);return!0},get(n,r,a){if(r===ie)return e;var o=i.get(r),c=r in n;if(o===void 0&&(!c||l(n,r)?.writable)&&(o=u(()=>I(Jt(c?n[r]:t),s)),i.set(r,o)),o!==void 0){var d=U(o);return d===t?void 0:d}return Reflect.get(n,r,a)},getOwnPropertyDescriptor(e,n){this.has?.(e,n);var r=Reflect.getOwnPropertyDescriptor(e,n),a=i.get(n);if(a!==void 0){var o=U(a);if(o===t)return;if(r&&`value`in r)r.value=o;else return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,n){if(n===ie)return!0;var r=i.get(n),a=r!==void 0&&r.v!==t||Reflect.has(e,n);return(r!==void 0||H!==null&&(!a||l(e,n)?.writable))&&(r===void 0&&(r=u(()=>I(a?Jt(e[n]):t,s)),i.set(n,r)),U(r)===t)?!1:a},set(e,n,r,c){var d=i.get(n),f=n in e;if(a&&n===`length`)for(var p=r;p<d.v;p+=1){var m=i.get(p+``);m===void 0?p in e&&(m=u(()=>I(t,s)),i.set(p+``,m)):L(m,t)}if(d===void 0)(!f||l(e,n)?.writable)&&(d=u(()=>I(void 0,s)),L(d,Jt(r)),i.set(n,d));else{f=d.v!==t;var h=u(()=>Jt(r));L(d,h)}var g=Reflect.getOwnPropertyDescriptor(e,n);if(g?.set&&g.set.call(c,r),!f){if(a&&typeof n==`string`){var _=i.get(`length`),v=Number(n);Number.isInteger(v)&&v>=_.v&&L(_,v+1)}Kt(o)}return!0},ownKeys(e){U(o);var n=Reflect.ownKeys(e).filter(e=>{var n=i.get(e);return n===void 0||n.v!==t});for(var[r,a]of i)a.v!==t&&!(r in e)&&n.push(r);return n},setPrototypeOf(){Le()}})}function Yt(e){try{if(typeof e==`object`&&e&&ie in e)return e[ie]}catch{}return e}function Xt(e,t){return Object.is(Yt(e),Yt(t))}var Zt,Qt,$t,en;function tn(){if(Zt===void 0){Zt=window,Qt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;$t=l(t,`firstChild`).get,en=l(t,`nextSibling`).get,m(e)&&(e[le]=void 0,e[ce]=null,e[ue]=void 0,e.__e=void 0),m(n)&&(n[de]=void 0)}}function nn(e=``){return document.createTextNode(e)}function rn(e){return $t.call(e)}function an(e){return en.call(e)}function R(e,t){if(!k)return rn(e);var n=rn(A);if(n===null)n=A.appendChild(nn());else if(t&&n.nodeType!==3){var r=nn();return n?.before(r),be(r),r}return t&&dn(n),be(n),n}function on(e,t=!1){if(!k){var n=rn(e);return n instanceof Comment&&n.data===``?an(n):n}if(t){if(A?.nodeType!==3){var r=nn();return A?.before(r),be(r),r}dn(A)}return A}function sn(e,t=!1){if(!k)return rn(e);var n=R(e,t);return j(e),n}function z(e,t=1,n=!1){let r=k?A:e;for(var i;t--;)i=r,r=an(r);if(!k)return r;if(n){if(r?.nodeType!==3){var a=nn();return r===null?i?.after(a):r.before(a),be(a),a}dn(r)}return be(r),r}function cn(e){e.textContent=``}function ln(){return!1}function un(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function dn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function fn(e){var t=H;if(t===null)return V.f|=re,e;if(!(t.f&32768)&&!(t.f&4))throw e;pn(e,t)}function pn(t,n){if(t===e)throw t;if(!(n!==null&&n.f&16384)){for(;n!==null;){if(n.f&128&&!(n.f&33570816)){if(!(n.f&32768))throw t;try{n.b.error(t);return}catch(e){t=e}}n=n.parent}throw t}}function mn(e){H===null&&(V===null&&Me(e),je()),Vn&&Ae(e)}function hn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function gn(e,t){var n=H;n!==null&&n.f&8192&&(e|=S);var r={ctx:Ue,deps:null,nodes:null,f:e|b|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};F?.register_created_effect(r);var i=r;if(e&4)Tt===null?kt.ensure().schedule(r):Tt.push(r);else if(t!==null){try{lr(r)}catch(e){throw Mn(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=E))}if(i!==null&&(i.parent=n,n!==null&&hn(i,n),V!==null&&V.f&2&&!(e&64))){var a=V;(a.effects??=[]).push(i)}return r}function _n(){return V!==null&&!Un}function vn(e){let t=gn(8,null);return N(t,y),t.teardown=e,t}function yn(e){mn(`$effect`);var t=H.f;if(!V&&t&32&&Ue!==null&&!Ue.i){var n=Ue;(n.e??=[]).push(e)}else return bn(e)}function bn(e){return gn(4|ee,e)}function xn(e){kt.ensure();let t=gn(64|D,e);return()=>{Mn(t)}}function Sn(e){kt.ensure();let t=gn(64|D,e);return(e={})=>new Promise(n=>{e.outro?Fn(t,()=>{Mn(t),n(void 0)}):(Mn(t),n(void 0))})}function Cn(e){return gn(4,e)}function wn(e){return gn(ne|D,e)}function Tn(e,t=0){return gn(8|t,e)}function B(e,t=[],n=[],r=[]){ot(r,t,n,t=>{gn(8,()=>{e(...t.map(U))})})}function En(e,t=0){return gn(16|t,e)}function Dn(e,t=0){return gn(v|t,e)}function On(e){return gn(32|D,e)}function kn(e){var t=e.teardown;if(t!==null){let n=Vn,r=V;Hn(!0),Wn(null);try{t.call(null)}catch(t){pn(t,e.parent)}finally{Hn(n),Wn(r)}}}function An(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&it(()=>{e.abort(pe)});var r=n.next;n.f&64?n.parent=null:Mn(n,t),n=r}}function jn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Mn(t),t=n}}function Mn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Nn(e.nodes.start,e.nodes.end),n=!0),e.f|=T,An(e,t&&!n),cr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();kn(e),e.f^=T,e.f|=C;var i=e.parent;i!==null&&i.first!==null&&Pn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Nn(e,t){for(;e!==null;){var n=e===t?null:an(e);e.remove(),e=n}}function Pn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Fn(e,t,n=!0){var r=[];e.f|=256,In(e,r,!0);var i=()=>{n&&Mn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function In(e,t,n){if(!(e.f&8192)){e.f^=S;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);In(i,t,o?n:!1)}i=a}}}function Ln(e){e.f&=-257,Rn(e,!0)}function Rn(e,t){if(!(e.f&256)&&e.f&8192){e.f^=S,e.f&1024||(N(e,b),kt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);Rn(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function zn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:an(n);t.append(n),n=i}}var Bn=null,Vn=!1;function Hn(e){Vn=e}var V=null,Un=!1;function Wn(e){V=e}var H=null;function Gn(e){H=e}var Kn=null;function qn(e){V!==null&&(V.f&2097152||V.f&2)&&(Kn??=new Set).add(e)}var Jn=null,Yn=0,Xn=null;function Zn(e){Xn=e}var Qn=1,$n=0,er=$n;function tr(e){er=e}function nr(){return++Qn}function rr(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(rr(a)&>(a),a.wv>e.wv)return!0}t&512&&xt===null&&N(e,y)}return!1}function ir(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Kn!==null&&Kn.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?ir(a,t,!1):t===a&&(n?N(a,b):a.f&1024&&N(a,x),Pt(a))}}function ar(e){var t=Jn,n=Yn,r=Xn,i=V,a=Kn,o=Ue,s=Un,c=er,l=e.f;Jn=null,Yn=0,Xn=null,V=l&96?null:e,Kn=null,We(e.ctx),Un=!1,er=++$n,e.ac!==null&&(it(()=>{e.ac.abort(pe)}),e.ac=null);try{e.f|=te;var u=e.fn,d=u();e.f|=w;var f=or(e);if(Je()&&Xn!==null&&!Un&&f!==null&&!(e.f&6146))for(var p=0;p<Xn.length;p++)ir(Xn[p],e);if(i!==null&&i!==e){if($n++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=$n;if(t!==null)for(let e of t)e.rv=$n;Xn!==null&&(r===null?r=Xn:r.push(...Xn))}return e.f&8388608&&(e.f^=re),d}catch(t){return or(e),fn(t)}finally{e.f^=te,Jn=t,Yn=n,Xn=r,V=i,Kn=a,We(o),Un=s,er=c}}function or(e){var t=e.deps,n=F?.is_fork;if(Jn!==null){var r;if(n||cr(e,Yn),t!==null&&Yn>0)for(t.length=Yn+Jn.length,r=0;r<Jn.length;r++)t[Yn+r]=Jn[r];else e.deps=t=Jn;if(_n()&&e.f&512)for(r=Yn;r<t.length;r++)(t[r].reactions??=[]).push(e)}else!n&&t!==null&&Yn<t.length&&(cr(e,Yn),t.length=Yn);return t}function sr(e,n){let r=n.reactions;if(r!==null){var o=i.call(r,e);if(o!==-1){var s=r.length-1;s===0?r=n.reactions=null:(r[o]=r[s],r.pop())}}if(r===null&&n.f&2&&(Jn===null||!a.call(Jn,n))){var c=n;c.f&512&&(c.f^=512),c.v!==t&&et(c),c.ac!==null&&it(()=>{c.ac.abort(pe),c.ac=null,N(c,b)}),_t(c),cr(c,0)}}function cr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)sr(e,n[r])}function lr(e){var t=e.f;if(!(t&16384)){N(e,y);var n=H;H=e;try{t&16777232?jn(e):An(e),kn(e);var r=ar(e);e.teardown=typeof r==`function`?r:null,e.wv=Qn}finally{H=n}}}async function ur(){await Promise.resolve(),At()}function U(e){var t=!!(e.f&2);if(Bn?.add(e),V!==null&&!Un&&!(H!==null&&H.f&16384)&&(Kn===null||!Kn.has(e))){var n=V.deps;if(V.f&2097152)e.rv<$n&&(e.rv=$n,Jn===null&&n!==null&&n[Yn]===e?Yn++:Jn===null?Jn=[e]:Jn.push(e));else{V.deps??=[],a.call(V.deps,e)||V.deps.push(e);var r=e.reactions;r===null?e.reactions=[V]:a.call(r,V)||r.push(V)}}if(Vn&&Rt.has(e))return Rt.get(e);if(t){var i=e;if(Vn){var o=i.v;return(!(i.f&1024)&&i.reactions!==null||fr(i))&&(o=ht(i)),Rt.set(i,o),o}var s=!(i.f&512)&&!Un&&V!==null&&!!(V.f&512),c=(i.f&w)===0;rr(i)&&(s&&(i.f|=512),gt(i)),s&&!c&&(vt(i),dr(i))}if(xt?.has(e))return xt.get(e);if(e.f&8388608)throw e.v;return e.v}function dr(e){if(e.f|=512,e.deps!==null)for(let n of e.deps){var t=n.reactions;t===null?n.reactions=[e]:a.call(t,e)||t.push(e),n.f&2&&!(n.f&512)&&(vt(n),dr(n))}}function fr(e){if(e.v===t)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Rt.has(t)||t.f&2&&fr(t))return!0;return!1}function pr(e){var t=Un;try{return Un=!0,e()}finally{Un=t}}var mr=Symbol(`events`),hr=new Set,gr=new Set;function _r(e,t,n,r={}){function i(e){if(r.capture||Sr.call(t,e),!e.cancelBubble)return it(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,Ze(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function W(e,t,n,r={}){var i=_r(t,e,n,r);return()=>{i.__removed=!0,e.removeEventListener(t,i,r)}}function vr(e,t,n,r,i){var a={capture:r,passive:i},o=_r(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&vn(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function G(e,t,n){(t[mr]??={})[e]=n}function yr(e){for(var t=0;t<e.length;t++)hr.add(e[t]);for(var n of gr)n(e)}var br=null,xr=!1;function Sr(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;br=e,xr||(xr=!0,setTimeout(()=>{xr=!1,br=null}));var o=0,s=br===e&&e[mr];if(s){var l=i.indexOf(s);if(l!==-1&&(t===document||t===window)){e[mr]=t;return}var u=i.indexOf(t);if(u===-1)return;l<=u&&(o=l)}if(a=i[o]||e.target,a!==t){c(e,`currentTarget`,{configurable:!0,get(){return a||n}});var d=V,f=H;Wn(null),Gn(null);try{for(var p,m=[];a!==null&&a!==t;){try{var h=a[mr]?.[r];h!=null&&(!a.disabled||e.target===a)&&h.call(a,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble)break;o++,a=o<i.length?i[o]:null}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[mr]=t,delete e.currentTarget,Wn(d),Gn(f)}}}var Cr=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function wr(e){return Cr?.createHTML(e)??e}function Tr(e){var t=un(`template`);return t.innerHTML=wr(e.replaceAll(`<!>`,`<!---->`)),t.content}function Er(e,t){var n=H;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function K(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(`<!>`);return()=>{if(k)return Er(A,null),A;i===void 0&&(i=Tr(a?e:`<!>`+e),n||(i=rn(i)));var t=r||Qt?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=rn(t),s=t.lastChild;Er(o,s)}else Er(t,t);return t}}function Dr(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=!!(t&1),a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(k)return Er(A,null),A;if(!o){var e=rn(Tr(a));if(i)for(o=document.createDocumentFragment();rn(e);)o.appendChild(rn(e));else o=rn(e)}var t=o.cloneNode(!0);if(i){var n=rn(t),r=t.lastChild;Er(n,r)}else Er(t,t);return t}}function Or(e,t){return Dr(e,t,`svg`)}function kr(){if(k)return Er(A,null),A;var e=document.createDocumentFragment(),t=document.createComment(``),n=nn();return e.append(t,n),Er(t,n),e}function q(e,t){if(k){var n=H;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=A),xe()}else e!==null&&e.before(t)}function Ar(){if(k&&A&&A.nodeType===8&&A.textContent?.startsWith(`$`)){let e=A.textContent.substring(1);return xe(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var jr=[`touchstart`,`touchmove`];function Mr(e){return jr.includes(e)}function Nr(e){let t=0,n=Bt(0),r;return()=>{_n()&&(U(n),Tn(()=>(t===0&&(r=pr(()=>e(()=>Kt(n)))),t+=1,()=>{Ze(()=>{--t,t===0&&(r?.(),r=void 0,Kt(n))})})))}}var Pr=E|D;function Fr(e,t,n,r){new Ir(e,t,n,r)}var Ir=class{parent;is_pending=!1;transform_error;#e;#t=k?A:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Nr(()=>(this.#m=Bt(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=H;t.b=this,t.f|=128,n(e)},this.parent=H.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=En(()=>{if(k){let e=M(this.#t);xe();let t=e===`[!`;if(e.startsWith(`[?`)){let t=JSON.parse(e.slice(2));this.#_(t)}else t?this.#b():this.#g()}else this.#x()},Pr),k&&(this.#e=A)}#g(){try{this.#a=On(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);Ze(r),t&&(this.#s=On(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{this.#y()||(t?ve():(t=!0,n&&ze(),this.#s!==null&&Fn(this.#s,()=>{this.#s=null}),this.#C(()=>{this.#x()})))};return{reset:r,invoke_onerror:()=>{if(!this.#y())try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){pn(e,this.#i&&this.#i.parent)}}}}#y(){return(this.#i.f&(C|T))!==0}#b(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=On(()=>e(this.#e)),Ze(()=>{if(!this.#y()){var e=this.#c=document.createDocumentFragment(),t=nn(),n=!1;e.append(t),this.#a=this.#C(()=>{try{return On(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){pn(e,this.#i.parent)}return null}}),this.#a===null?(this.#c=null,n&&this.#S(F)):this.#u===0&&(this.#e.before(e),this.#c=null,Fn(this.#o,()=>{this.#o=null}),this.#S(F))}}))}#x(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=On(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();zn(this.#a,e);let t=this.#n.pending;this.#o=On(()=>t(this.#e))}else this.#S(F)}catch(e){this.error(e)}}#S(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){tt(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#C(e){var t=H,n=V,r=Ue;Gn(this.#i),Wn(this.#i),We(this.#i.ctx);try{return kt.ensure(),e()}finally{Gn(t),Wn(n),We(r)}}#w(e,t){this.has_pending_snippet()?(this.#u+=e,this.#u===0&&(this.#S(t),this.#o&&Fn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))):this.parent&&this.parent.#w(e,t)}update_pending_count(e,t){this.#w(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,Ze(()=>{this.#d=!1,this.#m&&Wt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),U(this.#m)}error(t){if(t===e||!this.#n.onerror&&!this.#n.failed)throw t;F?.is_fork?(this.#a&&F.skip_effect(this.#a),this.#o&&F.skip_effect(this.#o),this.#s&&F.skip_effect(this.#s),F.oncommit(()=>{this.#y()||this.#T(t)})):this.#T(t)}#T(e){this.#a&&=(Mn(this.#a),null),this.#o&&=(Mn(this.#o),null),this.#s&&=(Mn(this.#s),null),k&&(be(this.#t),Se(),be(Ce()));let t=this.#n.failed,n=e=>{if(this.#y())return;let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&!this.#y()&&(this.#s=this.#C(()=>{try{return On(()=>{var r=H;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return pn(e,this.#i.parent),null}}))};Ze(()=>{if(!this.#y()){var t;try{t=this.transform_error(e)}catch(e){pn(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>pn(e,this.#i&&this.#i.parent)):n(t)}})}};function Lr(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[de]??=e.nodeValue)&&(e[de]=n,e.nodeValue=`${n}`)}function Rr(e,t){return Vr(e,t)}function zr(t,n){tn(),n.intro=n.intro??!1;let r=n.target,i=k,a=A;try{for(var o=rn(r);o&&(o.nodeType!==8||o.data!==`[`);)o=an(o);if(!o)throw e;ye(!0),be(o);let i=Vr(t,{...n,anchor:o});return ye(!1),i}catch(i){if(i instanceof Error&&i.message.split(`
|
|
2
|
+
`).some(e=>e.startsWith(`https://svelte.dev/e/`)))throw i;return i!==e&&console.warn(`Failed to hydrate: `,i),n.recover===!1&&Pe(),tn(),cn(r),ye(!1),Rr(t,n)}finally{ye(i),be(a)}}var Br=new Map;function Vr(t,{target:n,anchor:r,props:i={},events:a,context:s,intro:c=!0,transformError:l}){tn();var u=void 0,d=Sn(()=>{var c=r??n.appendChild(nn());Fr(c,{pending:()=>{}},n=>{Ge({});var r=Ue;if(s&&(r.c=s),a&&(i.$$events=a),k&&Er(n,null),u=t(n,i)||qe(),k&&(H.nodes.end=A,A===null||A.nodeType!==8||A.data!==`]`))throw ge(),e;Ke()},l);var d=new Set,f=e=>{for(var t=0;t<e.length;t++){var r=e[t];if(!d.has(r)){d.add(r);var i=Mr(r);for(let e of[n,document]){var a=Br.get(e);a===void 0&&(a=new Map,Br.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Sr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return f(o(hr)),gr.add(f),()=>{for(var e of d)for(let r of[n,document]){var t=Br.get(r),i=t.get(e);--i==0?(r.removeEventListener(e,Sr),t.delete(e),t.size===0&&Br.delete(r)):t.set(e,i)}gr.delete(f),c!==r&&c.parentNode?.removeChild(c)}});return Hr.set(u,d),u}var Hr=new WeakMap;function Ur(e,t){let n=Hr.get(e);return n?(Hr.delete(e),n(t)):Promise.resolve()}var Wr=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Ln(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(Ln(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(Mn(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();zn(r,t),t.append(nn()),this.#n.set(e,{effect:r,fragment:t})}else Mn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Fn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(Mn(n.effect),this.#n.delete(e))};ensure(e,t){var n=F,r=ln();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=nn();i.append(a),this.#n.set(e,{effect:On(()=>t(a)),fragment:i})}else this.#t.set(e,On(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else k&&(this.anchor=A),this.#a(n)}};function Gr(e){Ue===null&&De(`onMount`),yn(()=>{let t=pr(e);if(typeof t==`function`)return t})}function J(e,t,n=!1){var r;k&&(r=A,xe());var i=new Wr(e),a=n?E:0;function o(e,t){if(k){var n=M(r);if(e!==parseInt(n.substring(1))){var a=Ce();be(a),i.anchor=a,ye(!1),i.ensure(e,t),ye(!0);return}}i.ensure(e,t)}En(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Kr(e,t){return t}function qr(e,t,n){for(var r=[],i=t.length,a,s=t.length,c=0;c<i;c++){let n=t[c];Fn(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Jr(e,o(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else--s},!1)}if(s===0){var l=r.length===0&&n!==null&&e.pending.size===0;if(l){var u=n,d=u.parentNode;cn(d),d.append(u),e.items.clear()}Jr(e,t,!l)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Jr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=O,zn(a,document.createDocumentFragment())):Mn(t[i],n)}}var Yr;function Xr(e,t,n,i,a,s=null){var c=e,l=new Map;if(t&4){var u=e;c=k?be(rn(u)):u.appendChild(nn())}k&&xe();var d=null,f=pt(()=>{var e=n();return r(e)?e:e==null?[]:o(e)}),p=new Map,m=!0;function h(e){if(!(_.effect.f&16384)){_.pending.delete(e);var n=U(f);_.fallback=d,Qr(_,n,c,t,i),d!==null&&(n.length===0?d.f&33554432?(d.f^=O,ei(d,null,c)):Ln(d):Fn(d,()=>{d=null}))}}function g(e){_.pending.delete(e)}var _={effect:En(()=>{var e=U(f),r=e.length;let o=!1;k&&M(c)===`[!`!=(r===0)&&(c=Ce(),be(c),ye(!1),o=!0);for(var u=new Set,_=F,v=ln(),y=0;y<r;y+=1){k&&A.nodeType===8&&A.data===`]`&&(c=A,o=!0,ye(!1));var b=e[y],x=i(b,y),S=m?null:l.get(x);S?(S.v&&Wt(S.v,b),S.i&&Wt(S.i,y),v&&_.unskip_effect(S.e)):(S=$r(l,m?c:Yr??=nn(),b,x,y,a,t,n),m||(S.e.f|=O),l.set(x,S)),u.add(x)}if(r===0&&s&&!d&&(m?d=On(()=>s(c)):(d=On(()=>s(Yr??=nn())),d.f|=O)),r>u.size&&ke(``,``,``),k&&r>0&&be(Ce()),!m){if(p.set(_,u),v){for(let[e,t]of l)u.has(e)||_.skip_effect(t.e);_.oncommit(h),_.ondiscard(g)}else h(_)}o&&ye(!0),U(f)}),flags:t,items:l,pending:p,outrogroups:null,fallback:d};m=!1,k&&(c=A)}function Zr(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Qr(e,t,n,r,i){var a=!!(r&8),s=t.length,c=e.items,l=Zr(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(a)for(v=0;v<s;v+=1)h=t[v],g=i(h,v),_=c.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<s;v+=1){if(h=t[v],g=i(h,v),_=c.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(Ln(_),a&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432){if(_.f^=O,_===l)ei(_,null,n);else{var y=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),ti(e,d,_),ti(e,_,y),ei(_,y,n),d=_,p=[],m=[],l=Zr(d.next);continue}}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var b=m[0],x;d=b.prev;var S=p[0],C=p[p.length-1];for(x=0;x<p.length;x+=1)ei(p[x],b,n);for(x=0;x<m.length;x+=1)u.delete(m[x]);ti(e,S.prev,C.next),ti(e,d,S),ti(e,C,b),l=b,d=C,--v,p=[],m=[]}else u.delete(_),ei(_,l,n),ti(e,_.prev,_.next),ti(e,_,d===null?e.effect.first:d.next),ti(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;)(u??=new Set).add(l),m.push(l),l=Zr(l.next);if(l===null)continue}_.f&33554432||p.push(_),d=_,l=Zr(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Jr(e,o(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var w=[];if(u!==void 0)for(_ of u)_.f&8192||w.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&w.push(l),l=Zr(l.next);var T=w.length;if(T>0){var E=r&4&&s===0?n:null;if(a){for(v=0;v<T;v+=1)w[v].nodes?.a?.measure();for(v=0;v<T;v+=1)w[v].nodes?.a?.fix()}qr(e,w,E)}}a&&Ze(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function $r(e,t,n,r,i,a,o,s){var c=o&1?o&16?Bt(n):Vt(n,!1,!1):null,l=o&2?Bt(i):null;return{v:c,i:l,e:On(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function ei(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=an(r);if(a.before(r),r===i)return;r=o}}function ti(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function ni(e,t){Cn(()=>{e=H?.parent?.nodes?.start??e;var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=un(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}function ri(e,t){var n=void 0,r;Dn(()=>{n!==(n=t())&&(r&&=(Mn(r),null),n&&(r=On(()=>{Cn(()=>n(e))})))})}var ii=[...`
|
|
3
|
+
\r\f\u00A0\v\uFEFF`];function ai(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||ii.includes(r[o-1]))&&(s===r.length||ii.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function oi(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function si(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function ci(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(si)),i&&c.push(...Object.keys(i).map(si));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=si(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=oi(r)),i&&(n+=oi(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function li(e,t,n,r,i,a){var o=e[le];if(k||o!==n||o===void 0){var s=ai(n,r,a);(!k||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[le]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function ui(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function di(e,t,n,r){var i=e[ue];if(k||i!==t){var a=ci(t,r);(!k||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[ue]=t}else r&&(Array.isArray(r)?(ui(e,n?.[0],r[0]),ui(e,n?.[1],r[1],`important`)):ui(e,n,r));return r}function fi(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function pi(e,t){var n=e.__defaultValue,i=e.multiple,a=i?n??[]:null;if(!i||r(a)){var o=e.selectedIndex,s=t&&i?new Set(e.selectedOptions):null;for(var c of e.options){var l=_i(c);fi(c,i?a.includes(l):Xt(l,n))}if(t){if(s!==null)for(c of e.options){var u=s.has(c);c.selected!==u&&(c.selected=u)}else e.selectedIndex!==o&&(e.selectedIndex=o)}}}function mi(e,t,n=!1){if(e.multiple){if(t==null)return;if(!r(t))return _e();for(var i of e.options)i.selected=t.includes(_i(i))}else{for(i of e.options)if(Xt(_i(i),t)){i.selected=!0;return}(!n||t!==void 0)&&(e.selectedIndex=-1)}}function hi(e){var t=new MutationObserver(t=>{t.every(vi)||(`__defaultValue`in e&&pi(e,!1),`__value`in e&&mi(e,e.__value))});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),vn(()=>{t.disconnect()})}function gi(e,t,n=t){var r=new WeakSet,i=!0;at(e,`change`,t=>{var i=t?`[selected]`:`:checked`,a;if(e.multiple)a=[].map.call(e.querySelectorAll(i),_i);else{var o=e.querySelector(i)??e.querySelector(`option:not([disabled])`);a=o&&_i(o)}n(a),e.__value=a,F!==null&&r.add(F)}),Cn(()=>{var a=t();if(e===document.activeElement){var o=F;if(r.has(o))return}if(mi(e,a,i),i&&a===void 0){var s=e.querySelector(`:checked`);s!==null&&(a=_i(s),n(a))}e.__value=a,i=!1})}function _i(e){return`__value`in e?e.__value:e.value}function vi(e){if(e.target.closest(`selectedcontent`)!==null)return!0;if(e.type===`childList`){var t=[...e.addedNodes,...e.removedNodes];return t.length>0&&t.every(e=>e.nodeName===`SELECTEDCONTENT`)}return!1}var yi=Symbol(`is custom element`),bi=Symbol(`is html`),xi=me?`link`:`LINK`,Si=me?`progress`:`PROGRESS`;function Ci(e){if(k){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Y(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Y(e,`checked`,null),e.checked=r}}};e[fe]=n,Ze(n),rt()}}function wi(e,t){var n=Ei(e);n.value!==(n.value=t??void 0)&&(e.value!==t||t===0&&e.nodeName===Si)&&(e.value=t??``)}function Ti(e,t){var n=Ei(e);n.checked!==(n.checked=t??void 0)&&(e.checked=t)}function Y(e,t,n,r){var i=Ei(e);k&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===xi)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[se]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&Oi(e).has(t)?e[t]=n:e.setAttribute(t,n))}function Ei(e){return e[ce]??={[yi]:e.nodeName.includes(`-`),[bi]:e.namespaceURI===n}}var Di=new Map;function Oi(e){var t=e.getAttribute(`is`)||e.nodeName,n=Di.get(t);if(n)return n;Di.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=u(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.add(o);i=p(i)}return n}function ki(e,t,n=t){var r=new WeakSet;at(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=Ai(e)?ji(a):a,n(a),F!==null&&r.add(F),await ur(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(k&&e.defaultValue!==e.value||pr(t)==null&&e.value)&&(n(Ai(e)?ji(e.value):e.value),F!==null&&r.add(F)),Tn(()=>{var n=t();if(e===document.activeElement){var i=F;if(r.has(i))return}Ai(e)&&n===ji(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}function Ai(e){var t=e.type;return t===`number`||t===`range`}function ji(e){return e===``?null:+e}function Mi(e,t){return e===t||e?.[ie]===t}function Ni(e=qe(),t,n,r){var i=Ue.r,a=H;return Cn(()=>{var o,s;return Tn(()=>{o=s,s=r?.()||[],pr(()=>{Mi(n(...s),e)||(t(e,...s),o&&Mi(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&Mi(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}var Pi=!1;function Fi(e){var t=Pi;try{return Pi=!1,[e(),Pi]}finally{Pi=t}}function Ii(e,t,n,r){var i=!0,a=!!(n&8),o=!!(n&16),s=r,c=!0,u=void 0,d=()=>o&&i?(u??=ut(r),U(u)):(c&&(c=!1,s=o?pr(r):r),s);let f;if(a){var p=ie in e||oe in e;f=l(e,t)?.set??(p&&t in e?n=>e[t]=n:void 0)}var m,h=!1;a?[m,h]=Fi(()=>e[t]):m=e[t],m===void 0&&r!==void 0&&(m=d(),f&&(i&&Fe(t),f(m)));var g=i?()=>{var n=e[t];return n===void 0?d():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return g;if(f){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||h)&&f(t?g():e),e):g()})}var v=!1,y=(n&1?ut:pt)(()=>(v=!1,g()));a&&U(y);var b=H;return(function(e,t){if(arguments.length>0){let n=t?U(y):i&&a?Jt(e):e;return L(y,n),v=!0,s!==void 0&&(s=n),e}return Vn&&v||b.f&16384?y.v:U(y)})}function Li(e){return new Ri(e)}var Ri=class{#e;#t;constructor(e){var t=new Map,n=(e,n)=>{var r=Vt(n,!1,!1);return t.set(e,r),r};let r=new Proxy({...e.props||{},$$events:{}},{get(e,r){return U(t.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===oe||(U(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,i){return L(t.get(r)??n(r,i),i),Reflect.set(e,r,i)}});this.#t=(e.hydrate?zr:Rr)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),(!e?.props?.$$host||e.sync===!1)&&At(),this.#e=r.$$events;for(let e of Object.keys(this.#t))e!==`$set`&&e!==`$destroy`&&e!==`$on`&&c(this,e,{get(){return this.#t[e]},set(t){this.#t[e]=t},enumerable:!0});this.#t.$set=e=>{Object.assign(r,e)},this.#t.$destroy=()=>{Ur(this.#t)}}$set(e){this.#t.$set(e)}$on(e,t){this.#e[e]=this.#e[e]||[];let n=(...e)=>t.call(this,...e);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(e=>e!==n)}}$destroy(){this.#t.$destroy()}},zi;typeof HTMLElement==`function`&&(zi=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn||this.$$c)return;function e(e){return t=>{let n=un(`slot`);e!=="default"&&(n.name=e),q(t,n)}}let t={},n=Vi(this);for(let r of this.$$s)r in n&&(r==="default"&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(let e of this.attributes){let t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=Bi(t,e.value,this.$$p_d,`toProp`))}for(let e in this.$$p_d)!(e in this.$$d)&&this[e]!==void 0&&(this.$$d[e]=this[e],delete this[e]);this.$$c=Li({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=xn(()=>{Tn(()=>{this.$$r=!0;for(let e of s(this.$$c)){if(!this.$$p_d[e]?.reflect)continue;this.$$d[e]=this.$$c[e];let t=Bi(e,this.$$d[e],this.$$p_d,`toAttribute`);t==null?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1})});for(let e in this.$$l)for(let t of this.$$l[e]){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Bi(e,n,this.$$p_d,`toProp`),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return s(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Bi(e,t,n,r){let i=n[e]?.type;if(t=i===`Boolean`&&typeof t!=`boolean`?t!=null:t,!r||!n[e])return t;if(r===`toAttribute`)switch(i){case`Object`:case`Array`:return t==null?null:JSON.stringify(t);case`Boolean`:return t?``:null;case`Number`:return t??null;default:return t}else switch(i){case`Object`:case`Array`:return t&&JSON.parse(t);case`Boolean`:return t;case`Number`:return t==null?t:+t;default:return t}}function Vi(e){let t={};return e.childNodes.forEach(e=>{t[e.slot||`default`]=!0}),t}function Hi(e,t,n,r,i,a){let o=class extends zi{constructor(){super(e,n,i),this.$$p_d=t}static get observedAttributes(){return s(t).map(e=>(t[e].attribute||e).toLowerCase())}};return s(t).forEach(e=>{c(o.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){n=Bi(e,n,t),this.$$d[e]=n;var r=this.$$c;r&&(l(r,e)?.get?r[e]=n:r.$set({[e]:n}))}})}),r.forEach(e=>{c(o.prototype,e,{get(){return this.$$c?.[e]}})}),a&&(o=a(o)),e.element=o,o}var Ui=.05,Wi=.1,Gi=.9,Ki=.5,qi=.01,Ji=.99,Yi=.1,Xi={width:`1044px`,columns:12,gutterWidth:`24px`,isGutterOnOutside:!1,position:`center`},Zi={showLayoutGrid:!1,layoutGridColor:`rgba(0, 0, 255, ${Yi})`,showSpacingGrid:!1,spacingGridColor:`rgba(255, 0, 0, ${Yi})`,spacingGridHeight:`8px`},Qi=[.5,1],$i=.25,ea=10485760,ta=[`image/png`,`image/jpeg`,`image/webp`,`image/gif`];function na(e,t,n){if(`offset`in e)return e.offset;switch(e.align){case`left`:return 0;case`center`:return Math.trunc((n-t)/2)||0;case`right`:return n-t}}function ra(e,t,n){if(`offset`in e)return e.offset;switch(e.align){case`top`:return 0;case`bottom`:return n-t}}function ia(e,t,n,r){return{x:na(e.x,t.width*n,r.width),y:ra(e.y,t.height*n,r.height)}}function aa(e,t,n,r,i=r){return{x:i.x-(r.x-e.x)/t*n,y:i.y-(r.y-e.y)/t*n}}function oa(e,t){return Math.hypot(t.x-e.x,t.y-e.y)}function sa(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}var ca={kind:`idle`},la={x:{align:`center`},y:{align:`top`}};function ua(e,t){switch(e.kind){case`dragging`:return`dragging`;case`inspecting`:return e.zoom?`zoomed`:`solid`;case`idle`:return t?`locked`:`visible`}}var da={adjustAppearance:e=>e===`visible`||e===`locked`,reposition:e=>e===`visible`,zoom:e=>e===`solid`};function fa(e){return`align`in e.x?e.x.align:null}function pa(e){return`align`in e.y?e.y.align:null}function ma(e){return fa(e)!==null||pa(e)!==null}function ha(e){return{x:{offset:e.x},y:{offset:e.y}}}function ga(e,t,n){return{x:n.x===t.x?e.x:{offset:n.x},y:n.y===t.y?e.y:{offset:n.y}}}function _a(e,t,n){return{x:e===null?{offset:n.x}:{align:e},y:t===null?{offset:n.y}:{align:t}}}function va(e,t){let n=fa(e),r=pa(e);return n&&r?`${r}\u00B7${n}`:`${n??`x:${Math.round(t.x)}`}, ${r??`y:${Math.round(t.y)}`}`}var ya=(e,t)=>t.some(t=>e instanceof t),ba,xa;function Sa(){return ba||=[IDBIndex,IDBObjectStore,IDBCursor,IDBDatabase,IDBTransaction]}function Ca(){return xa||=[`advance`,`continue`,`continuePrimaryKey`].map(e=>IDBCursor.prototype[e])}var wa=new WeakMap,Ta=new WeakMap,Ea=new WeakMap;function Da(e){let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener(`success`,i),e.removeEventListener(`error`,a)},i=()=>{t(Na(e.result)),r()},a=()=>{n(e.error),r()};e.addEventListener(`success`,i),e.addEventListener(`error`,a)});return Ea.set(t,e),t}function Oa(e){if(wa.has(e))return;let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener(`complete`,i),e.removeEventListener(`error`,a),e.removeEventListener(`abort`,a)},i=()=>{t(),r()},a=()=>{n(e.error||new DOMException(`AbortError`,`AbortError`)),r()};e.addEventListener(`complete`,i),e.addEventListener(`error`,a),e.addEventListener(`abort`,a)});wa.set(e,t)}var ka={get(e,t,n){if(e instanceof IDBTransaction){if(t===`done`)return wa.get(e);if(t===`store`)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Na(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t===`done`||t===`store`)||t in e}};function Aa(e){ka=e(ka)}function ja(e){return Ca().includes(e)?function(...t){return e.apply(Pa(this),t),Na(this.request)}:function(...t){return Na(e.apply(Pa(this),t))}}function Ma(e){return typeof e==`function`?ja(e):(e instanceof IDBTransaction&&Oa(e),ya(e,Sa())?new Proxy(e,ka):e)}function Na(e){if(e instanceof IDBRequest)return Da(e);if(Ta.has(e))return Ta.get(e);let t=Ma(e);return Object.is(t,e)||(Ta.set(e,t),Ea.set(t,e)),t}var Pa=e=>Ea.get(e);function Fa(e,t,{blocked:n,upgrade:r,blocking:i,terminated:a}={}){let o=indexedDB.open(e,t),s=Na(o);return r&&o.addEventListener(`upgradeneeded`,e=>{r(Na(o.result),e.oldVersion,e.newVersion,Na(o.transaction),e)}),n&&o.addEventListener(`blocked`,e=>n(e.oldVersion,e.newVersion,e)),s.then(e=>{a&&e.addEventListener(`close`,()=>a()),i&&e.addEventListener(`versionchange`,e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}var Ia=[`get`,`getKey`,`getAll`,`getAllKeys`,`count`],La=[`put`,`add`,`delete`,`clear`],Ra={};function za(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t==`string`))return;if(Ra[t])return Ra[t];let n=t.replace(/FromIndex$/,``),r=t!==n,i=La.includes(n);return!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||Ia.includes(n))?void 0:Ra[t]=async function(e,...t){let a=this.transaction(e,i?`readwrite`:`readonly`),o=a.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&a.done]))[0]}}Aa(e=>({...e,get:(t,n,r)=>za(t,n)||e.get(t,n,r),has:(t,n)=>!!za(t,n)||e.has(t,n)}));var Ba=[`advance`,`continue`,`continuePrimaryKey`],Va={},Ha=new WeakMap,Ua=new WeakMap,Wa={get(e,t){if(!Ba.includes(t))return e[t];let n=Va[t];return n||=Va[t]=function(...e){Ha.set(this,Ua.get(this)[t](...e))},n}};async function*Ga(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;let n=new Proxy(t,Wa);for(Ua.set(n,t),Ea.set(n,Pa(t));t;)yield n,t=await(Ha.get(n)||t.continue()),Ha.delete(n)}function Ka(e,t){return t===Symbol.asyncIterator&&ya(e,[IDBIndex,IDBObjectStore,IDBCursor])||t===`iterate`&&ya(e,[IDBIndex,IDBObjectStore])}Aa(e=>({...e,get(t,n,r){return Ka(t,n)?Ga:e.get(t,n,r)},has(t,n){return Ka(t,n)||e.has(t,n)}}));var qa=class extends Error{details;constructor(e,t){super(e),this.name=`ValidationError`,this.details=t}},Ja=class extends Error{constructor(){super(`Pixel Mirror was updated: close other tabs that use the old version, then reload this page`),this.name=`DatabaseBlockedError`}},Ya=class extends Error{constructor(e,t){super(e,{cause:t}),this.name=`DatabaseError`}};function Xa(e,t){if(e instanceof Error&&e.cause instanceof Ja)return{message:e.cause.message};let n=t?`${t}: `:``;return e instanceof qa?{message:n+e.message,details:e.details}:e instanceof Error?{message:n+e.message}:{message:n+`An unknown error occurred`}}var Za=`PixelMirrorDB`,Qa=3;function $a(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}async function eo(e){return{bytes:await e.arrayBuffer(),type:e.type}}function to(e){return e instanceof Blob?e:new Blob([e.bytes],{type:e.type})}function no({thumbnail:e,...t}){return{...t,thumbnail:to(e)}}async function ro(e){let t=new Map,n=await e.objectStore(`mockups`).openCursor();for(;n;){let{thumbnailBuffer:e,...r}=n.value;t.set(r.id,r.mimeType),e&&await n.update({...r,thumbnail:{bytes:e,type:r.mimeType}}),n=await n.continue()}let r=await e.objectStore(`mockup_blobs`).openCursor();for(;r;){let e=r.value;e instanceof ArrayBuffer&&await r.update({bytes:e,type:t.get(r.key)??``}),r=await r.continue()}}async function io(e,t){await Promise.all([...e,t])}var ao,oo=3e3,so=!1;function co(){return new Promise((e,t)=>{let n=!1,r=()=>{clearTimeout(i),!n&&(n=!0,so=!0,t(new Ja))},i=setTimeout(r,oo);Fa(Za,Qa,{upgrade(e,n,r,a){clearTimeout(i),io([(async()=>{n<2&&(e.objectStoreNames.contains(`mockups`)||e.createObjectStore(`mockups`,{keyPath:`id`}),e.objectStoreNames.contains(`mockup_blobs`)||e.createObjectStore(`mockup_blobs`),e.objectStoreNames.contains(`grids`)||e.createObjectStore(`grids`,{keyPath:`id`}),e.objectStoreNames.contains(`settings`)||e.createObjectStore(`settings`)),n<3&&await ro(a)})()],a.done).catch(e=>{try{a.abort()}catch{}t(e)})},blocking(e,t,n){n.target.close(),ao=void 0},terminated(){ao=void 0},blocked:r}).then(t=>{if(clearTimeout(i),!n)return e(t);so=!1,ao=Promise.resolve(t)},e=>{clearTimeout(i),n?so=!1:t(e)})})}async function lo(){if(so)throw new Ja;return ao||=co().catch(e=>{throw ao=void 0,e}),ao}async function uo(e,t,n){let r;try{r=(await lo()).transaction(e,`readwrite`);let[t]=await Promise.all([n(r),r.done]);return t}catch(e){if(r){try{r.abort()}catch{}await r.done.catch(()=>{})}throw new Ya(t,e)}}function fo(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}async function po(e,t,n){let r={...fo(await e.objectStore(`settings`).get(t)),...n};return await e.objectStore(`settings`).put(r,t),r}async function mo(e,t){let n=e.objectStore(`grids`),r=(await n.getAll()).sort((e,t)=>e.createdAt-t.createdAt);if(!r.length){let e={...Xi,id:$a(),createdAt:Date.now()};await n.put(e),r.push(e)}let i=fo(await e.objectStore(`settings`).get(`gridOverlay`));return r.some(e=>e.id===i.activeLayoutGridId)||(i=await po(e,`gridOverlay`,{activeLayoutGridId:r[0].id})),{items:r,activeId:r.some(e=>e.id===t)?t:i.activeLayoutGridId,stored:i}}function ho(e){return uo([`grids`,`settings`],`Failed to load grids`,t=>mo(t,e))}function go(e){return uo([`grids`,`settings`],`Failed to add grid`,async t=>{let n={...e,id:$a(),createdAt:Date.now()};return await t.objectStore(`grids`).put(n),await po(t,`gridOverlay`,{activeLayoutGridId:n.id}),mo(t,n.id)})}function _o(e){return uo([`grids`,`settings`],`Failed to select grid`,async t=>{if(!await t.objectStore(`grids`).get(e))throw Error(`Grid not found.`);return await po(t,`gridOverlay`,{activeLayoutGridId:e}),mo(t,e)})}function vo(e,t){return uo([`grids`,`settings`],`Failed to delete grid`,async n=>(await n.objectStore(`grids`).delete(e),mo(n,t)))}function yo(){return uo([`grids`,`settings`],`Failed to reset grids`,async e=>(await e.objectStore(`grids`).clear(),await e.objectStore(`settings`).put(Zi,`gridOverlay`),mo(e)))}function bo(e){return uo([`mockups`,`settings`],`Failed to load mockups`,async t=>{let n=(await t.objectStore(`mockups`).getAll()).map(no).sort((e,t)=>t.createdAt-e.createdAt),r=fo(await t.objectStore(`settings`).get(`mockupOverlay`));return r.activeMockupId!==null&&!n.some(e=>e.id===r.activeMockupId)&&(r=await po(t,`mockupOverlay`,{activeMockupId:null})),{items:n,activeId:e===void 0?r.activeMockupId:n.some(t=>t.id===e)?e:null,stored:r}})}async function xo(e){try{let t=await(await lo()).get(`mockup_blobs`,e);return t&&to(t)}catch(e){throw new Ya(`Failed to get mockup`,e)}}var So={isHidden:!1,isLocked:!1};async function Co(e,t=!1,n){let r;try{r=await Promise.all((Array.isArray(e)?e:[e]).map(async({image:e,thumbnail:t,...n})=>({metadata:n,image:await eo(e),thumbnail:await eo(t)})))}catch(e){throw new Ya(`Failed to read mockup files`,e)}return uo([`mockups`,`mockup_blobs`,`settings`],`Failed to add mockups`,async e=>{let i=Date.now(),a=[];for(let{metadata:t,image:n,thumbnail:o}of r){let r={...t,thumbnail:o,id:$a(),createdAt:i+a.length};await e.objectStore(`mockups`).put(r),await e.objectStore(`mockup_blobs`).put(n,r.id),a.push(no(r))}return t&&a.length?(await po(e,`mockupOverlay`,{activeMockupId:a[0].id,...So}),{added:a,activeId:a[0].id,appearance:So}):{added:a,activeId:await wo(e,n),appearance:{}}})}async function wo(e,t){let n=fo(await e.objectStore(`settings`).get(`mockupOverlay`)),r=typeof n.activeMockupId==`string`?n.activeMockupId:null;return r!==null&&!await e.objectStore(`mockups`).getKey(r)&&(r=null),r!==n.activeMockupId&&await po(e,`mockupOverlay`,{activeMockupId:r}),t===null?null:t===void 0?r:await e.objectStore(`mockups`).getKey(t)?t:null}function To(e){return uo([`mockups`,`settings`],`Failed to select mockup`,async t=>{if(e!==null&&!await t.objectStore(`mockups`).getKey(e))throw Error(`Mockup not found.`);let n=e===null?{}:So;return await po(t,`mockupOverlay`,{activeMockupId:e,...n}),{added:[],activeId:e,appearance:n}})}function Eo(e,t){return uo([`mockups`,`mockup_blobs`,`settings`],`Failed to delete mockup`,async n=>(await n.objectStore(`mockups`).delete(e),await n.objectStore(`mockup_blobs`).delete(e),{added:[],activeId:await wo(n,t===e?null:t),appearance:{}}))}function Do(){return uo([`mockups`,`mockup_blobs`,`settings`],`Failed to clear mockups`,async e=>(await e.objectStore(`mockups`).clear(),await e.objectStore(`mockup_blobs`).clear(),await po(e,`mockupOverlay`,{activeMockupId:null}),{added:[],activeId:null,appearance:{}}))}async function Oo(e){try{return await(await lo()).get(`settings`,e)}catch(e){throw new Ya(`Failed to load settings`,e)}}function ko(e,t){return uo([`settings`],`Failed to save settings`,async n=>{if(`activeLayoutGridId`in t||`activeMockupId`in t)throw Error(`Selections must be changed through library commands.`);await po(n,e,t)})}function Ao(){let e=I(void 0);return{get errorMessage(){return U(e)},showError:(t,n)=>{let r=Xa(t,n);L(e,r.message,!0),console.error(`[PixelMirror]`,r.message,r.details??``,t)},clear:()=>{L(e,void 0)}}}var jo=Ao(),Mo=new Set,No=new Map;function Po(e,t){if(typeof e!=`object`||!e||Array.isArray(e))return{};let n={};for(let r of Object.keys(t)){let i=e[r];i!==void 0&&t[r](i)&&(n[r]=i)}return n}function Fo(e,t,n){let r=Jt({...t}),i=null,a=null;function o(e){No.get(s)?.promise===e&&(No.delete(s),Mo.has(s)&&queueMicrotask(()=>void s()))}function s(){let t=No.get(s);if(t)return t.promise;if(!Mo.delete(s)||i===null)return Promise.resolve();let n=Ve(i),a=Object.keys(n);i=null;let c=ko(e,n).catch(e=>{for(let e of a)n[e]=r[e];i={...n,...i},jo.showError(e,`Failed to save settings`)}).finally(()=>o(c));return No.set(s,{promise:c,keys:a}),c}function c(e){Object.assign(r,e),a!==null&&Object.assign(a,e),i={...i,...e},Mo.add(s),queueMicrotask(()=>void s())}return{get current(){return r},async load(o=async()=>({stored:await Oo(e),result:void 0}),c=()=>{}){a={...i};for(let e of No.get(s)?.keys??[])a[e]=r[e];try{let{stored:e,result:i}=await o();Object.assign(r,{...t,...Po(e,n),...a}),c(i)}finally{a=null}},async commit(e,t,n){let c=No.get(s)?.promise;a={};let l=(async()=>{await c;let{appearance:o,result:l}=await t();for(let t of e)i&&delete i[t];return i={...i,...a},Object.keys(i).length||(i=null,Mo.delete(s)),Object.assign(r,{...o,...a}),n(l),l})().finally(()=>{a=null,o(l)});return No.set(s,{promise:l,keys:e}),l},update:c,reset:()=>c({...t})}}var Io=/^\d+(\.\d+)?(px|%|em|rem|vw|vh)$/,Lo=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/,Ro=/^rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*(,\s*[\d.]+\s*)?\)$/;function zo(e){return{success:!0,data:e}}function Bo(e,t){return{success:!1,error:new qa(e,t)}}function Vo(e){let t=e.trim();return/^\d+(\.\d+)?$/.test(t)?`${t}px`:t}function Ho(e,t){let n=e.trim();return n?Io.test(n)?zo(n):Bo(`Invalid ${t} format`,`Expected format like "100px", "50%", or "1.5rem", got "${e}"`):Bo(`${t} is required`)}function Uo(e){let t=Ho(e,`Spacing grid height`);return t.success?/(?:px|rem)$/.test(t.data)?t:Bo(`Spacing grid height must use px or rem`):t}function Wo(e,t){let n=e.trim();return n?(typeof CSS<`u`&&typeof CSS.supports==`function`?CSS.supports(`color`,n):Lo.test(n)||Ro.test(n))?zo(n):Bo(`Invalid ${t} format`,`Expected a CSS color such as #fff, rgba(0, 0, 255, 0.1) or hsl(0 100% 50%), got "${e}"`):Bo(`${t} is required`)}function Go(e,t,n=1,r=2**53-1){return Number.isInteger(e)?e<n||e>r?Bo(`${t} must be between ${n} and ${r}`,`Got ${e}`):zo(e):Bo(`${t} must be an integer`,`Got ${e}`)}function Ko(e){let t=Ho(e.width,`Width`);if(!t.success)return t;let n=Go(e.columns,`Columns`,1,100);if(!n.success)return n;let r=Ho(e.gutterWidth,`Gutter width`);if(!r.success)return r;let i=[`left`,`center`,`right`];return i.includes(e.position)?zo({...e,width:t.data,columns:n.data,gutterWidth:r.data}):Bo(`Invalid position`,`Expected one of: ${i.join(`, `)}`)}function qo(e){return e?ta.includes(e.type)?e.size>10485760?Bo(`File too large`,`Maximum size is ${ea/1048576}MB, got ${(e.size/1048576).toFixed(2)}MB`):zo(e):Bo(`Unsupported file type`,`Allowed types: ${ta.map(e=>e.split(`/`)[1]).join(`, `)}`):Bo(`No file provided`)}function Jo(e){let t=[],n=[];for(let r of e){let e=qo(r);e.success?t.push(e.data):n.push(new qa(`${r.name}: ${e.error.message}`,e.error.details))}return{validFiles:t,errors:n}}async function Yo(e){let{thumbnail:t,width:n,height:r}=await new Promise((t,n)=>{let r=new Image,i=URL.createObjectURL(e);r.onload=()=>{let a=Math.min(r.width,r.height),o=(r.width-a)/2,s=document.createElement(`canvas`);s.width=352,s.height=352;let c=s.getContext(`2d`);c?(c.drawImage(r,o,0,a,a,0,0,352,352),s.toBlob(e=>{URL.revokeObjectURL(i),e?t({thumbnail:e,width:r.naturalWidth,height:r.naturalHeight}):n(new qa(`Failed to create thumbnail`))},e.type,.8)):(URL.revokeObjectURL(i),n(new qa(`Failed to get canvas context`)))},r.onerror=()=>{URL.revokeObjectURL(i),n(new qa(`Failed to load image: ${e.name}`))},r.src=i});return{image:e,thumbnail:t,filename:e.name,mimeType:e.type,width:n,height:r,fileSize:e.size}}async function Xo(e){let{validFiles:t,errors:n}=Jo(e);if(t.length===0)return{data:[],errors:n};let r=await Promise.allSettled(t.map(Yo)),i=[],a=[...n];return r.forEach((e,n)=>{if(e.status===`fulfilled`)i.push(e.value);else{let r=t[n],i=e.reason instanceof qa?e.reason:new qa(`Failed to process ${r.name}`,String(e.reason));a.push(i)}}),{data:i,errors:a}}var Zo={isHidden:!1,isLocked:!1,opacity:Ki,position:{x:0,y:0},alignmentX:fa(la),alignmentY:pa(la),scale:1},Qo=e=>typeof e==`number`&&Number.isFinite(e);function $o(){let e=Fo(`mockupOverlay`,Zo,{isHidden:e=>typeof e==`boolean`,isLocked:e=>typeof e==`boolean`,opacity:e=>Qo(e)&&e>=.1&&e<=.9,position:e=>Qo(e?.x)&&Qo(e?.y),alignmentX:e=>e===null||e===`left`||e===`center`||e===`right`,alignmentY:e=>e===null||e===`top`||e===`bottom`,scale:e=>Qi.includes(e)}),t=I(Jt([])),n=I(null),r=P(()=>U(t).find(e=>e.id===U(n))),i=I(`pending`),a=!1,o=Promise.resolve(),s=null,c=new Set;function l(e,t){let n=o.then(e).catch(e=>{jo.showError(e,t)});return o=n.then(()=>{}),n}function u(e){for(let t of c)t(e)}function d(){return s||(s=l(async()=>{try{await e.load(async()=>{let t=await bo(a?U(n):void 0);return{stored:a?e.current:t.stored,result:t}},e=>{L(t,e.items,!0),L(n,e.activeId,!0),u(`refresh`)}),a=!0,L(i,`ready`)}catch(e){throw L(i,`failed`),e}},`Failed to load mockups`).then(()=>{}).finally(()=>{s=null}),s)}function f(r,i,a=!1){return e.commit(a?[`isHidden`,`isLocked`]:[],async()=>{let e=await r();return{appearance:e.appearance,result:e}},e=>{L(t,i===`all`?[]:[...e.added,...U(t).filter(e=>e.id!==i)].sort((e,t)=>t.createdAt-e.createdAt),!0),L(n,e.activeId,!0),u(`commit`)})}function p(e,t){return e.length?l(async()=>{let{data:r,errors:i}=await Xo(e);i.length===1?jo.showError(i[0]):i.length>1&&jo.showError(new qa(`${i.length} files could not be added: ${i.map(e=>e.message).join(`; `)}`)),r.length&&await f(()=>Co(r,t,U(n)),void 0,t)},`Failed to upload mockups`):Promise.resolve()}return{get initialized(){return U(i)!==`pending`},get mockups(){return U(t)},get activeMockupId(){return U(n)},get activeMockup(){return U(r)},get appearance(){return e.current},updateAppearance:e.update,init:()=>U(i)===`ready`?Promise.resolve():d(),refresh:d,subscribe(e){return c.add(e),()=>c.delete(e)},upload:e=>p(e,!1),uploadAndActivate:e=>p(e,!0),select:e=>l(()=>f(()=>To(e),void 0,e!==null),`Failed to select mockup`),delete:e=>l(()=>f(()=>Eo(e,U(n)),e),`Failed to delete mockup`),clear:()=>l(()=>f(Do,`all`),`Failed to clear mockups`)}}var X=$o();function es(){let{clientWidth:e,clientHeight:t}=document.documentElement;return{x:window.scrollX+e/2,y:window.scrollY+t/2}}function ts(e,t){return{x:e+window.scrollX,y:t+window.scrollY}}function ns(){let{clientWidth:e,scrollHeight:t}=document.documentElement;return{width:e,height:t}}var rs=150;function is(e){let t=()=>e(ns());t();let n=null,r=()=>{n??=setTimeout(()=>{n=null,t()},rs)},i=[W(window,`resize`,t),W(document,`load`,r,{capture:!0}),W(document,`transitionend`,r,{capture:!0}),W(document,`animationend`,r,{capture:!0})],a=typeof ResizeObserver>`u`?null:new ResizeObserver(t);a?.observe(document.documentElement),document.body&&a?.observe(document.body);let o=typeof MutationObserver>`u`?null:new MutationObserver(r);return o?.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),()=>{i.forEach(e=>e()),a?.disconnect(),o?.disconnect(),n!==null&&clearTimeout(n)}}function as(e,t,n){return Math.min(Math.max(e,t),n)}function os(e,t){let n=10**t;return Math.round(e*n)/n}function ss(){let e={get current(){return X.appearance},update:X.updateAppearance},t=P(()=>e.current.isHidden),n=P(()=>e.current.isLocked),r=P(()=>e.current.opacity),i=P(()=>e.current.scale),a=P(()=>_a(e.current.alignmentX,e.current.alignmentY,e.current.position)),o=I(Jt(ca)),s=I(null),c=null,l=I(Jt({width:0,height:0})),u=I(Jt({width:0,height:0})),d=P(()=>ua(U(o),U(n))),f=P(()=>ia(U(a),U(l),U(i),U(u))),p=P(()=>U(o).kind===`dragging`?{...U(o).current,scale:U(i)}:U(o).kind===`inspecting`&&U(o).view?U(o).view:{...U(f),scale:U(i)}),m=P(()=>({x:U(p).x,y:U(p).y})),h=P(()=>va(U(a),U(m))),g=0,_={x:0,y:0,scale:1},v={x:0,y:0},y={x:0,y:0},b={x:0,y:0,scale:1};function x(){U(s)&&URL.revokeObjectURL(U(s)),L(s,null),c=null,L(l,{width:0,height:0},!0),L(o,ca,!0)}async function S(e){let t=++g;if(!e)return x(),!0;if(c===e&&U(s))return!0;try{let n=await xo(e);if(t!==g)return c===X.activeMockupId;if(!n)return jo.showError(Error(`Mockup not found.`)),x(),!0;x();let r=URL.createObjectURL(n);L(s,r,!0);let i=await new Promise((e,t)=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth,height:n.naturalHeight}),n.onerror=()=>t(Error(`Failed to load mockup image.`)),n.src=r});return t===g?(L(l,i,!0),c=e,!0):c===X.activeMockupId}catch(e){return t===g?(jo.showError(e,`Failed to load mockup`),x(),!1):c===X.activeMockupId}}function C(t){e.update({alignmentX:fa(t),alignmentY:pa(t),position:{x:`offset`in t.x?t.x.offset:U(f).x,y:`offset`in t.y?t.y.offset:U(f).y}})}function w(e){C(ha(e))}function T(){return{...U(p)}}function E(e){U(o).kind===`inspecting`&&L(o,{...U(o),view:e},!0)}function D(){L(o,{kind:`inspecting`,view:null,zoom:null},!0)}function ee(){U(o).kind===`inspecting`&&L(o,ca,!0)}function O(){if(U(o).kind!==`dragging`)return;let{origin:e,current:t}=U(o);L(o,ca,!0),(t.x!==e.x||t.y!==e.y)&&C(ga(U(a),e,t))}function te(e){let t=as(_.scale*e,$i,4);E({...aa(_,_.scale,t,v),scale:t})}return{get activeMockupId(){return X.activeMockupId},get activeMockupUrl(){return U(s)},get mockupSize(){return U(l)},get pageSize(){return U(u)},get isHidden(){return U(t)},get isLocked(){return U(n)},get opacity(){return U(r)},get position(){return U(m)},get alignmentX(){return fa(U(a))},get alignmentY(){return pa(U(a))},get isAligned(){return ma(U(a))},get scale(){return U(p).scale},get mode(){return U(d)},get isZoomPanning(){return U(o).kind===`inspecting`&&!!U(o).zoom?.isPanning},get isDragging(){return U(d)===`dragging`},get isSolidOrZoomed(){return U(d)===`solid`||U(d)===`zoomed`},get effectiveOpacity(){return U(d)===`solid`||U(d)===`zoomed`?1:U(r)},get positionDisplay(){return U(h)},setPageSize:e=>{(e.width!==U(u).width||e.height!==U(u).height)&&L(u,e,!0)},sync:()=>S(X.activeMockupId),cleanup:()=>{++g,x()},toggleVisibility:()=>{ee(),e.update({isHidden:!U(t)})},toggleLock:()=>{da.adjustAppearance(U(d))&&e.update({isLocked:!U(n)})},stepOpacity:t=>{da.adjustAppearance(U(d))&&e.update({opacity:as(os(U(r)+t*Ui,2),Wi,Gi)})},resetOpacity:()=>{da.adjustAppearance(U(d))&&e.update({opacity:Ki})},setOpacity:t=>{da.adjustAppearance(U(d))&&e.update({opacity:as(os(t,2),Wi,Gi)})},cycleScale:()=>{if(!da.reposition(U(d)))return;let t=Qi[(Qi.indexOf(U(i))+1)%Qi.length],n=es(),r=aa(U(f),U(i),t,n);e.update({scale:t}),w(r)},setAlignment:(e,t)=>{da.reposition(U(d))&&C({x:{align:t},y:{align:e}})},move:(e,t)=>{if(!da.reposition(U(d)))return;let n={x:U(f).x+e,y:U(f).y+t};C(ga(U(a),U(f),n))},beginDrag:e=>{da.reposition(U(d))&&L(o,{kind:`dragging`,pointerStart:e,origin:{...U(f)},current:{...U(f)}},!0)},dragTo:e=>{if(U(o).kind!==`dragging`)return;let{pointerStart:t,origin:n}=U(o);L(o,{...U(o),current:{x:n.x+e.x-t.x,y:n.y+e.y-t.y}},!0)},endDrag:O,beginPan:e=>{U(d)===`solid`&&(y=e,b=T())},panTo:e=>{U(d)===`solid`&&E({...b,x:b.x+e.x-y.x,y:b.y+e.y-y.y})},beginPinch:e=>{U(d)===`solid`&&(_=T(),v=ts(e.x,e.y))},pinchTo:e=>{U(d)===`solid`&&te(e)},enterSolidMode:()=>{da.adjustAppearance(U(d))&&D()},exitSolidMode:ee,toggleMobileSolidMode:()=>{U(o).kind===`inspecting`?ee():da.adjustAppearance(U(d))&&D()},enterZoomMode:e=>{if(U(o).kind!==`inspecting`||!da.zoom(U(d)))return;let t=T(),n=t.scale*2,r=aa(t,t.scale,n,ts(e.x,e.y),es());L(o,{kind:`inspecting`,view:{...r,scale:n},zoom:{returnTo:U(o).view,pointerStart:e,origin:r,isPanning:!1}},!0)},exitZoomMode:()=>{U(o).kind===`inspecting`&&U(o).zoom&&L(o,{kind:`inspecting`,view:U(o).zoom.returnTo,zoom:null},!0)},zoomPanTo:e=>{if(U(o).kind!==`inspecting`||!U(o).zoom||!U(o).view)return;let{zoom:t,view:n}=U(o);L(o,{...U(o),zoom:{...t,isPanning:!0},view:{...n,x:t.origin.x-(e.x-t.pointerStart.x),y:t.origin.y-(e.y-t.pointerStart.y)}},!0)}}}var Z=ss();function cs(){return typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(prefers-color-scheme: dark)`):null}var ls={position:`bottom`,theme:null};function us(){let e=Fo(`dock`,ls,{position:e=>e===`top`||e===`bottom`,theme:e=>e===null||e===`light`||e===`dark`}),t=cs(),n=I(Jt(t?.matches?`dark`:`light`));t&&typeof t.addEventListener==`function`&&t.addEventListener(`change`,t=>{L(n,t.matches?`dark`:`light`,!0),e.current.theme!==null&&e.update({theme:null})});let r=I(`toolbar`),i=I(`pending`),a=null,o=P(()=>e.current.theme??U(n));return{get initialized(){return U(i)!==`pending`},get mode(){return U(r)},get position(){return e.current.position},get theme(){return U(o)},get isManagerMode(){return U(r)===`mockups`||U(r)===`grids`},init:async()=>(U(i)===`ready`||a||(a=(async()=>{try{await e.load(),L(i,`ready`)}catch(e){L(i,`failed`),jo.showError(e,`Failed to load dock settings`)}finally{a=null}})()),a),enterToolbar:()=>{L(r,`toolbar`)},enterMockups:()=>{L(r,`mockups`)},enterGrids:()=>{L(r,`grids`)},togglePosition:()=>{e.update({position:e.current.position===`bottom`?`top`:`bottom`})},toggleTheme:()=>{e.update({theme:U(o)===`light`?`dark`:`light`})}}}var Q=us(),ds=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,fs=/^color\(\s*srgb\s+(\d*\.?\d+)\s+(\d*\.?\d+)\s+(\d*\.?\d+)\s*(?:\/\s*(\d*\.?\d+)\s*)?\)$/i,ps=/^rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*(?:,\s*(\d*\.?\d+)\s*)?\)$/i,ms=/(?:\s*\/\s*(none|[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?))?\s*\)$/i;function hs(e){let t=e.trim(),n=t.match(ds);if(n){let e=n[1].length<=4?[...n[1]].map(e=>e+e).join(``):n[1],t=t=>parseInt(e.slice(t*2,t*2+2),16);return{r:t(0),g:t(1),b:t(2),a:e.length===8?t(3)/255:1}}let r=t.match(ps);if(r){let e=e=>Math.min(255,Math.round(Number(e)));return{r:e(r[1]),g:e(r[2]),b:e(r[3]),a:r[4]===void 0?1:Math.min(1,Number(r[4]))}}let i=t.match(fs);if(i){let e=e=>Math.round(Math.min(1,Number(e))*255),t=i[4]===void 0?1:Math.min(1,Number(i[4]));return{r:e(i[1]),g:e(i[2]),b:e(i[3]),a:t}}return null}function gs(e){let t=e.trim(),n=hs(t);if(!n){if(typeof document>`u`)return null;let e=document.createElement(`span`);if(e.style.setProperty(`color`,t,`important`),!e.style.color)return null;e.style.setProperty(`display`,`none`,`important`),(document.body??document.documentElement).appendChild(e);try{t=getComputedStyle(e).color}finally{e.remove()}if(n=hs(t),!n&&!/^(?:color|oklch|oklab|lch|lab)\(/.test(t))return null}let r=t.match(ms)?.[1],i=n?.a??(r===`none`?0:Number(r??1));return{css:t,rgba:n,alpha:i}}function _s(e,t){return e.rgba?bs({...e.rgba,a:t}):e.css.replace(ms,` / ${os(t,2)})`)}function vs(e){let t=gs(e);if(!t)return e;let n=as(t.alpha,qi,Ji);return n===t.alpha?t.css:_s(t,n)}function ys({r:e,g:t,b:n}){return`#${[e,t,n].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function bs({r:e,g:t,b:n,a:r}){return`rgba(${e}, ${t}, ${n}, ${os(r,2)})`}function xs(e,t,n,r){return r?bs(e??{...hs(t)??{r:0,g:0,b:0,a:1},a:n}):e?ys(e):t}function Ss(e,t,n,r){return r?e:{...e,a:t?.a??n}}var Cs=e=>typeof e==`string`&&Wo(e,`color`).success;function ws(){let e=Fo(`gridOverlay`,Zi,{showLayoutGrid:e=>typeof e==`boolean`,layoutGridColor:Cs,showSpacingGrid:e=>typeof e==`boolean`,spacingGridColor:Cs,spacingGridHeight:e=>typeof e==`string`&&Uo(e).success}),t=I(Jt([])),n=I(``),r=P(()=>U(t).find(e=>e.id===U(n))),i=I(`pending`),a=I(!1),o=!1,s=Promise.resolve(),c=null,l=null,u=new Set;function d(e,t){let n=s.then(e).catch(e=>{jo.showError(e,t)});return s=n.then(()=>{}),n}function f(e,r){L(t,e.items,!0),L(n,e.activeId,!0);for(let e of u)e(r)}function p(){return c||(c=d(async()=>{try{await e.load(async()=>{let t=await ho(o?U(n):void 0);return{stored:o?e.current:t.stored,result:t}},e=>f(e,`refresh`));let t={};for(let n of[`layoutGridColor`,`spacingGridColor`]){let r=vs(e.current[n]);r!==e.current[n]&&(t[n]=r)}Object.keys(t).length&&e.update(t),o=!0,L(i,`ready`)}catch(e){throw L(i,`failed`),e}},`Failed to load grids`).then(()=>{}).finally(()=>{c=null}),c)}function m(t,n=!1){return e.commit(n?Object.keys(Zi):[],async()=>({appearance:n?Zi:{},result:await t()}),e=>f(e,`commit`))}function h(t,n){let r=Wo(n,t===`layoutGridColor`?`Layout grid color`:`Spacing grid color`);if(!r.success)return jo.showError(r.error);e.update({[t]:vs(r.data)})}return{get initialized(){return U(i)!==`pending`},get layoutGrids(){return U(t)},get activeLayoutGridId(){return U(n)},get activeLayoutGrid(){return U(r)},get showLayoutGrid(){return e.current.showLayoutGrid},get layoutGridColor(){return e.current.layoutGridColor},get showSpacingGrid(){return e.current.showSpacingGrid},get spacingGridColor(){return e.current.spacingGridColor},get spacingGridHeight(){return e.current.spacingGridHeight},get isResetting(){return U(a)},init:()=>U(i)===`ready`?Promise.resolve():p(),refresh:p,subscribe(e){return u.add(e),()=>u.delete(e)},toggleLayoutGrid:()=>e.update({showLayoutGrid:!e.current.showLayoutGrid}),toggleSpacingGrid:()=>e.update({showSpacingGrid:!e.current.showSpacingGrid}),updateLayoutGridColor:e=>h(`layoutGridColor`,e),updateSpacingGridColor:e=>h(`spacingGridColor`,e),updateSpacingGridHeight(t){let n=Uo(Vo(t));if(!n.success)return jo.showError(n.error);e.update({spacingGridHeight:n.data})},setActiveLayoutGrid:e=>d(()=>m(()=>_o(e)),`Failed to select grid`),add(e){let t=Ko(e);return t.success?d(async()=>(await m(()=>go(t.data))).activeId,`Failed to add grid`):(jo.showError(t.error),Promise.resolve(void 0))},delete:e=>d(()=>m(()=>vo(e,U(n))),`Failed to delete grid`),reset(){return l||(L(a,!0),l=d(async()=>(await m(yo,!0),!0),`Failed to reset grids`).finally(()=>{L(a,!1),l=null}),l)}}}var $=ws(),Ts=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Es(e){return e instanceof HTMLElement?Ts.has(e.tagName)||e.isContentEditable:!1}function Ds(e){if(Es(e.composedPath()[0]))return!0;let t=document.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return Es(t)}var Os={ArrowUp:[0,-1],ArrowDown:[0,1],ArrowLeft:[-1,0],ArrowRight:[1,0]};function ks(){let e=I(!1),t=I(!1),n=I(!1),r=null;function i(){return Q.mode===`toolbar`&&!Z.isHidden&&!!Z.activeMockupUrl}function a(e){return e.defaultPrevented||e.isComposing||e.ctrlKey||e.metaKey||e.altKey}function o(e){if(e.defaultPrevented||!i())return;let{mode:t}=Z;(t===`visible`||t===`locked`)&&(e.preventDefault(),Z.stepOpacity(e.deltaY>0?1:-1))}function s(){r||(r=o,window.addEventListener(`wheel`,r,{passive:!1}))}function c(){r&&=(window.removeEventListener(`wheel`,r),null)}function l(){U(e)&&(L(e,!1),c()),U(t)&&(L(t,!1),Z.exitSolidMode())}function u(n){if(Ds(n))return;if(n.key===`Control`){U(e)||(L(e,!0),s());return}if(Q.mode!==`toolbar`){n.key===`Escape`&&!a(n)&&Q.enterToolbar();return}if(!i()||a(n))return;let{mode:r}=Z;switch(n.key){case` `:if(n.shiftKey)return;n.preventDefault(),!U(t)&&(r===`visible`||r===`locked`)&&(L(t,!0),Z.enterSolidMode());break;case`Escape`:!n.repeat&&(r===`visible`||r===`locked`)&&Z.toggleLock();break;case`ArrowUp`:case`ArrowDown`:case`ArrowLeft`:case`ArrowRight`:{if(r!==`visible`)return;n.preventDefault();let e=n.shiftKey?10:1,[t,i]=Os[n.key];Z.move(t*e,i*e);break}}}function d(n){switch(n.key){case` `:U(t)&&(L(t,!1),Z.exitSolidMode());break;case`Control`:U(e)&&(L(e,!1),c())}}function f(){document.hidden&&l()}return{get isControlPressed(){return U(e)},get isSpacePressed(){return U(t)},init:()=>{U(n)||(L(n,!0),window.addEventListener(`keydown`,u),window.addEventListener(`keyup`,d),window.addEventListener(`blur`,l),document.addEventListener(`visibilitychange`,f))},cleanup:()=>{U(n)&&(L(n,!1),window.removeEventListener(`keydown`,u),window.removeEventListener(`keyup`,d),window.removeEventListener(`blur`,l),document.removeEventListener(`visibilitychange`,f),c(),l())}}}var As=ks(),js=null;function Ms(){return js===null&&(js=`ontouchstart`in window||navigator.maxTouchPoints>0),js}var Ns=null,Ps=!1;function Fs(){return Ns===`touch`}function Is(){Ps||=(document.addEventListener(`pointerdown`,e=>{Ns=e.pointerType},{capture:!0,passive:!0}),!0)}function Ls(){Is(),As.init();let e=!1,t=!1,n=new Set,r=null;try{typeof BroadcastChannel<`u`&&(r=new BroadcastChannel(`pixel-mirror-libraries`))}catch{}async function i(r){for(let e of r)n.add(e);if(!t){t=!0;try{for(;!e&&n.size;){let t=n.delete(`grids`),r=n.delete(`mockups`);await Promise.all([t?$.refresh():void 0,r?X.refresh():void 0]),!e&&r&&await Z.sync()}}finally{t=!1}}}function a(e,t){if(t===`commit`)try{r?.postMessage(e)}catch{}}let o=[$.subscribe(e=>a(`grids`,e)),X.subscribe(e=>{a(`mockups`,e),e===`commit`&&Z.sync()}),W(window,`focus`,()=>{Q.init(),i([`grids`,`mockups`])})];return r&&(r.onmessage=({data:e})=>{(e===`grids`||e===`mockups`)&&i([e])}),Q.init(),i([`grids`,`mockups`]),()=>{e=!0,n.clear(),o.forEach(e=>e()),r?.close(),Z.cleanup(),As.cleanup()}}var Rs=Or(`<circle class="mark" r="3.75" fill="currentColor"></circle>`),zs=Or(`<circle r="2.25" fill="currentColor"></circle>`),Bs=Or(`<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"></svg>`);function Vs(e,t){Ge(t,!0);let n=Ii(t,`x`,7),r=Ii(t,`y`,7),i=Ii(t,`size`,7,20),a={left:4,center:12,right:20},o={top:8,bottom:16},s=[`top`,`bottom`].flatMap(e=>[`left`,`center`,`right`].map(t=>({row:e,column:t,cx:a[t],cy:o[e]}))),c=P(()=>n()!==null&&r()!==null);var l={get x(){return n()},set x(e){n(e),At()},get y(){return r()},set y(e){r(e),At()},get size(){return i()},set size(e=20){i(e),At()}},u=Bs();return Xr(u,21,()=>s,e=>`${e.row}-${e.column}`,(e,t)=>{var i=kr(),a=on(i),o=e=>{var n=Rs();B(()=>{Y(n,`cx`,U(t).cx),Y(n,`cy`,U(t).cy)}),q(e,n)},s=e=>{var n=zs();B(()=>{Y(n,`cx`,U(t).cx),Y(n,`cy`,U(t).cy),Y(n,`opacity`,U(c)?.45:1)}),q(e,n)};J(a,e=>{U(t).row===r()&&U(t).column===n()?e(o):e(s,-1)}),q(e,i)}),j(u),B(()=>{Y(u,`width`,i()),Y(u,`height`,i())}),q(e,u),Ke(l)}Hi(Vs,{x:{},y:{},size:{}},[],[],{mode:`open`});var Hs={show:[`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,`M9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0`],hide:[`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,`M14.084 14.158a3 3 0 0 1-4.242-4.242`,`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,`m2 2 20 20`],lock:[`M5 11h14a2 2 0 0 1 2 2v7a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-7a2 2 0 0 1 2 -2Z`,`M7 11V7a5 5 0 0 1 10 0v4`],unlock:[`M5 11h14a2 2 0 0 1 2 2v7a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-7a2 2 0 0 1 2 -2Z`,`M7 11V7a5 5 0 0 1 9.9-1`],mockups:[`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,`M12 7a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,`M10 2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2Z`],grids:[`M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2Z`,`M9 3v18`,`M15 3v18`],sun:[`M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0`,`M12 2v2`,`M12 20v2`,`m4.93 4.93 1.41 1.41`,`m17.66 17.66 1.41 1.41`,`M2 12h2`,`M20 12h2`,`m6.34 17.66-1.41 1.41`,`m19.07 4.93-1.41 1.41`],moon:[`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`],dockTop:[`M5 3h14`,`m18 13-6-6-6 6`,`M12 7v14`],dockBottom:[`M12 17V3`,`m6 11 6 6 6-6`,`M19 21H5`],delete:[`M10 11v6`,`M14 11v6`,`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,`M3 6h18`,`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`],upload:[`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,`m14 19.5 3-3 3 3`,`M17 22v-5.5`,`M7 9a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`],alert:[`M2 12a10 10 0 1 0 20 0a10 10 0 1 0 -20 0`,`M12 8L12 12`,`M12 16L12.01 16`],plus:[`M5 12h14`,`M12 5v14`]},Us=Or(`<path></path>`),Ws=Or(`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"></svg>`);function Gs(e,t){Ge(t,!0);let n=Ii(t,`name`,7),r=Ii(t,`size`,7,20);var i={get name(){return n()},set name(e){n(e),At()},get size(){return r()},set size(e=20){r(e),At()}},a=Ws();return Xr(a,21,()=>Hs[n()],Kr,(e,t)=>{var n=Us();B(()=>Y(n,`d`,U(t))),q(e,n)}),j(a),B(()=>{Y(a,`width`,r()),Y(a,`height`,r())}),q(e,a),Ke(i)}Hi(Gs,{name:{},size:{}},[],[],{mode:`open`});var Ks=Or(`<path fill="currentColor" stroke="none"></path>`),qs=Or(`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="9"></circle><!></svg>`);function Js(e,t){Ge(t,!0);let n=Ii(t,`level`,7),r=Ii(t,`size`,7,20),i=P(()=>{let e=Math.min(Math.max(n(),0),1);if(e===0)return``;if(e===1)return`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`;let t=21-18*e,r=Math.sqrt(81-(t-12)**2),i=+(e>.5);return`M${12-r} ${t}A9 9 0 ${i} 0 ${12+r} ${t}Z`});var a={get level(){return n()},set level(e){n(e),At()},get size(){return r()},set size(e=20){r(e),At()}},o=qs(),s=z(R(o)),c=e=>{var t=Ks();B(()=>Y(t,`d`,U(i))),q(e,t)};return J(s,e=>{U(i)&&e(c)}),j(o),B(()=>{Y(o,`width`,r()),Y(o,`height`,r())}),q(e,o),Ke(a)}Hi(Js,{level:{},size:{}},[],[],{mode:`open`});var Ys=K(`<span class="color-field__opacity svelte-1ttqu47" role="spinbutton" tabindex="0"> </span>`),Xs=K(`<div class="color-field svelte-1ttqu47"><label class="color-field__label svelte-1ttqu47">Color</label> <div class="color-field__control svelte-1ttqu47" title="Scroll to change the opacity"><span class="swatch svelte-1ttqu47"><span class="swatch__preview svelte-1ttqu47"></span> <input type="color" class="swatch__picker svelte-1ttqu47"/></span> <input class="color-field__text svelte-1ttqu47" type="text" spellcheck="false"/> <!></div></div>`),Zs={hash:`svelte-1ttqu47`,code:`.color-field.svelte-1ttqu47{display:flex;flex-direction:column;gap:6px;min-width:0}.color-field__label.svelte-1ttqu47{color:var(--pm-text-secondary);font-size:11px;font-weight:600;letter-spacing:.04em;line-height:16px;text-transform:uppercase}.color-field__control.svelte-1ttqu47{align-items:center;background:var(--pm-surface-elevated);border:1px solid var(--pm-border-control);border-radius:var(--pm-radius-control);color:var(--pm-text-primary);display:flex;font-family:var(--pm-font-mono);font-size:13px;gap:8px;height:32px;outline:none;padding:0 4px 0 6px;transition:border-color .2s,box-shadow .2s}@media(max-width:680px){.color-field__control.svelte-1ttqu47{font-size:16px}}.color-field__control.svelte-1ttqu47:has(:where(.svelte-1ttqu47):focus-visible){border-color:var(--pm-focus-ring);box-shadow:0 0 0 1px var(--pm-focus-ring)}.color-field__text.svelte-1ttqu47{align-self:stretch;background:transparent;border:none;color:inherit;flex:1;font:inherit;min-width:0;outline:none;padding:0}.color-field__opacity.svelte-1ttqu47{background:var(--pm-surface-subtle);border-radius:5px;color:var(--pm-text-secondary);cursor:ns-resize;flex:none;font-size:12px;font-variant-numeric:tabular-nums;line-height:18px;min-width:44px;padding:2px 6px;text-align:right}.color-field__opacity.svelte-1ttqu47:focus-visible{color:var(--pm-text-primary);outline:2px solid var(--pm-focus-ring);outline-offset:-2px}.swatch.svelte-1ttqu47{background:linear-gradient(45deg,#ccc 25%,transparent 0),linear-gradient(-45deg,#ccc 25%,transparent 0),linear-gradient(45deg,transparent 75%,#ccc 0),linear-gradient(-45deg,transparent 75%,#ccc 0);background-position:0 0,0 4px,4px -4px,-4px 0;background-size:8px 8px;border-radius:5px;box-shadow:inset 0 0 0 1px var(--pm-border-strong);flex:none;height:20px;overflow:hidden;position:relative;width:20px}.swatch.svelte-1ttqu47:has(.swatch__picker:where(.svelte-1ttqu47):focus-visible){outline:2px solid var(--pm-focus-ring);outline-offset:1px}.swatch__picker.svelte-1ttqu47,.swatch__preview.svelte-1ttqu47{inset:0;position:absolute}.swatch__picker.svelte-1ttqu47{border:none;cursor:pointer;height:100%;opacity:0;padding:0;width:100%}`};function Qs(e,t){let n=Ar();Ge(t,!0),ni(e,Zs);let r=Ii(t,`value`,7),i=Ii(t,`fallback`,7),a=Ii(t,`pickerLabel`,7),o=Ii(t,`opacityLabel`,7),s=Ii(t,`pickerTestId`,7),c=Ii(t,`onchange`,7),l=Yi,u=typeof HTMLInputElement<`u`&&`alpha`in HTMLInputElement.prototype,d=P(r),f=P(()=>gs(U(d))),p=P(()=>Math.round(as(U(f)?.alpha??.99,qi,Ji)*100)),m=P(()=>xs(U(f)?.rgba??null,i(),l,u)),h=e=>{e.setAttribute(`alpha`,``),e.value=U(m)};function g(){let e=U(d).trim();e?e!==r()&&_(e):L(d,r())}function _(e){L(d,vs(e)),c()(U(d))}function v(e){if(!U(f))return;let t=as(Math.round(e)/100,qi,Ji);t!==U(f).alpha&&_(_s(U(f),t))}function y(e){let t=hs(e.currentTarget.value);t&&_(bs(Ss(t,U(f)?{a:U(f).alpha}:null,l,u)))}function b(e){e.key===`Enter`&&(e.preventDefault(),g())}function x(e){let t=e.shiftKey?10:1,n={ArrowUp:U(p)+t,ArrowRight:U(p)+t,ArrowDown:U(p)-t,ArrowLeft:U(p)-t,PageUp:U(p)+10,PageDown:U(p)-10,Home:qi*100,End:Ji*100};e.key in n&&(e.preventDefault(),v(n[e.key]))}let S=e=>{let t=0;return W(e,`wheel`,e=>{if(!U(f))return;e.preventDefault();let n=e.deltaY*(e.deltaMode===WheelEvent.DOM_DELTA_LINE?16:e.deltaMode===WheelEvent.DOM_DELTA_PAGE?400:1);t+=n/20;let r=Math.trunc(t);r!==0&&(t-=r,v(U(p)+r))},{passive:!1})};var C={get value(){return r()},set value(e){r(e),At()},get fallback(){return i()},set fallback(e){i(e),At()},get pickerLabel(){return a()},set pickerLabel(e){a(e),At()},get opacityLabel(){return o()},set opacityLabel(e){o(e),At()},get pickerTestId(){return s()},set pickerTestId(e){s(e),At()},get onchange(){return c()},set onchange(e){c(e),At()}},w=Xs(),T=R(w),E=z(T,2),D=R(E),ee=R(D);let O;var te=z(ee,2);Ci(te),ri(te,()=>h),j(D);var ne=z(D,2);Ci(ne);var re=z(ne,2),ie=e=>{var t=Ys(),n=sn(t);B(()=>{Y(t,`aria-label`,o()),Y(t,`aria-valuemin`,qi*100),Y(t,`aria-valuemax`,Ji*100),Y(t,`aria-valuenow`,U(p)),Y(t,`aria-valuetext`,`${U(p)??``}%`),Lr(n,`${U(p)??``}%`)}),G(`keydown`,t,x),q(e,t)};return J(re,e=>{U(f)&&e(ie)}),j(E),ri(E,()=>S),j(w),B(()=>{Y(T,`for`,`${n}-text`),O=di(ee,``,O,{"background-color":U(d)}),wi(te,U(m)),Y(te,`data-testid`,s()),Y(te,`aria-label`,a()),Y(ne,`id`,`${n}-text`)}),G(`input`,te,y),G(`change`,ne,g),G(`keydown`,ne,b),ki(ne,()=>U(d),e=>L(d,e)),q(e,w),Ke(C)}yr([`input`,`change`,`keydown`]),Hi(Qs,{value:{},fallback:{},pickerLabel:{},opacityLabel:{},pickerTestId:{},onchange:{}},[],[],{mode:`open`});var $s=K(`<button type="button" class="preset svelte-s2yrtn"> </button>`),ec=K(`<button type="button" class="text-button svelte-s2yrtn"><!> New grid</button>`),tc=K(`<div><label class="grid-option__choice svelte-s2yrtn"><input type="radio" class="grid-option__radio svelte-s2yrtn"/> <span class="grid-option__mark svelte-s2yrtn" aria-hidden="true"></span> <span class="grid-option__text svelte-s2yrtn"><span class="grid-option__summary svelte-s2yrtn"> </span> <span class="grid-option__details svelte-s2yrtn"> </span></span></label> <button type="button" class="grid-option__delete svelte-s2yrtn"><!></button></div>`),nc=K(`<form class="new-grid svelte-s2yrtn" aria-label="New grid"><div class="field svelte-s2yrtn"><label class="field__label svelte-s2yrtn">Width</label> <input class="control svelte-s2yrtn" type="text" placeholder="1044px" spellcheck="false"/></div> <div class="field svelte-s2yrtn"><label class="field__label svelte-s2yrtn">Columns</label> <input class="control svelte-s2yrtn" type="text" inputmode="numeric" placeholder="12" spellcheck="false"/></div> <div class="field svelte-s2yrtn"><label class="field__label svelte-s2yrtn">Gutter</label> <input class="control svelte-s2yrtn" type="text" placeholder="24px" spellcheck="false"/></div> <div class="field svelte-s2yrtn"><label class="field__label svelte-s2yrtn">Outer gutters</label> <select class="control svelte-s2yrtn"><option>Yes</option><option>No</option></select></div> <div class="field svelte-s2yrtn"><label class="field__label svelte-s2yrtn">Position</label> <select class="control svelte-s2yrtn"><option>Center</option><option>Left</option><option>Right</option></select></div> <div class="new-grid__actions svelte-s2yrtn"><button type="button" class="button button--ghost svelte-s2yrtn">Cancel</button> <button type="submit" class="button svelte-s2yrtn">Add grid</button></div></form>`),rc=K(`<button type="button" class="footer__button footer__button--ghost svelte-s2yrtn">Cancel</button>`),ic=K(`<div class="container svelte-s2yrtn" role="region" aria-label="Grid Manager"><div class="inner svelte-s2yrtn"><section class="section svelte-s2yrtn"><header class="section__header svelte-s2yrtn"><div class="section__heading svelte-s2yrtn"><h3 class="section__title svelte-s2yrtn">Spacing Grids</h3> <span class="section__hint svelte-s2yrtn">Vertical rhythm</span></div> <button type="button" role="switch" class="switch svelte-s2yrtn"><span class="switch__thumb svelte-s2yrtn"></span></button></header> <div><div class="field svelte-s2yrtn"><label class="field__label svelte-s2yrtn">Height</label> <div class="field__row svelte-s2yrtn"><input class="control control--short svelte-s2yrtn" type="text" placeholder="8px" title="Stripe height in px or rem" spellcheck="false"/> <div class="presets svelte-s2yrtn" role="group" aria-label="Height presets"></div></div></div> <!></div></section> <section class="section svelte-s2yrtn"><header class="section__header svelte-s2yrtn"><div class="section__heading svelte-s2yrtn"><h3 class="section__title svelte-s2yrtn">Layout Grids</h3> <span class="section__hint svelte-s2yrtn">Columns and gutters</span></div> <button type="button" role="switch" class="switch svelte-s2yrtn"><span class="switch__thumb svelte-s2yrtn"></span></button></header> <div><div class="fields svelte-s2yrtn"><!></div> <div class="field svelte-s2yrtn"><div class="grids-header svelte-s2yrtn"><span class="field__label svelte-s2yrtn">Grids</span> <!></div> <div class="grid-list svelte-s2yrtn" role="radiogroup"></div></div> <!></div></section></div> <footer class="footer svelte-s2yrtn"><!> <button type="button"> </button> <button type="button" class="footer__button svelte-s2yrtn">Close</button></footer></div>`),ac={hash:`svelte-s2yrtn`,code:`.container.svelte-s2yrtn{height:100%;max-height:inherit;overflow:hidden;width:100%}.container.svelte-s2yrtn,.inner.svelte-s2yrtn{display:flex;flex-direction:column}.inner.svelte-s2yrtn{flex:1;gap:20px;min-height:0;overflow:auto;overscroll-behavior:contain;padding:20px 24px}@media(max-width:680px){.inner.svelte-s2yrtn{padding:16px}}.footer.svelte-s2yrtn{align-items:center;background:var(--pm-surface-subtle);border-top:1px solid var(--pm-border-subtle);display:flex;flex-shrink:0;gap:8px;justify-content:flex-end;padding:12px 24px}@media(max-width:680px){.footer.svelte-s2yrtn{padding:12px 16px}}.footer__button.svelte-s2yrtn{align-items:center;background:var(--pm-button-bg);border:1px solid transparent;border-radius:var(--pm-radius-control);color:var(--pm-button-fg);display:inline-flex;font-size:13px;font-weight:600;height:32px;justify-content:center;line-height:1;min-width:96px;padding:0 16px;transition:background .2s,color .2s,border-color .2s;white-space:nowrap}.footer__button.svelte-s2yrtn:hover:not(:disabled){background:var(--pm-button-hover-bg)}.footer__button.svelte-s2yrtn:focus-visible{outline:2px solid var(--pm-focus-ring);outline-offset:2px}.footer__button.svelte-s2yrtn:disabled{background:var(--pm-button-disabled-bg);cursor:not-allowed;opacity:.55}@media(max-width:420px){.footer__button.svelte-s2yrtn{padding:0 12px}}.footer__button--ghost.svelte-s2yrtn{background:transparent;border-color:var(--pm-border-strong);color:var(--pm-text-primary)}.footer__button--ghost.svelte-s2yrtn:hover:not(:disabled){background:var(--pm-surface-hover)}.footer__button--danger.svelte-s2yrtn{background:var(--pm-danger);border-color:transparent;color:#fff}.footer__button--danger.svelte-s2yrtn:hover:not(:disabled){background:var(--pm-danger-hover)}.section.svelte-s2yrtn{display:flex;flex-direction:column;gap:12px}.section.svelte-s2yrtn+.section:where(.svelte-s2yrtn){border-top:1px solid var(--pm-border-subtle);padding-top:20px}.section__header.svelte-s2yrtn{align-items:center;display:flex;gap:16px;justify-content:space-between}.section__heading.svelte-s2yrtn{align-items:baseline;column-gap:8px;display:flex;flex-wrap:wrap;min-width:0}.section__title.svelte-s2yrtn{color:var(--pm-text-primary);font-size:14px;font-weight:600;line-height:20px;margin:0}.section__hint.svelte-s2yrtn{color:var(--pm-text-secondary);font-size:12px}.section__body.svelte-s2yrtn{display:flex;flex-direction:column;gap:12px;transition:opacity .2s}.section__body.disabled.svelte-s2yrtn{opacity:.45;pointer-events:none}.fields.svelte-s2yrtn{align-items:end;display:grid;gap:12px 16px;grid-template-columns:repeat(2,minmax(0,1fr))}@media(max-width:560px){.fields.svelte-s2yrtn{grid-template-columns:minmax(0,1fr)}}.field.svelte-s2yrtn{display:flex;flex-direction:column;gap:6px;min-width:0}.field__label.svelte-s2yrtn{color:var(--pm-text-secondary);font-size:11px;font-weight:600;letter-spacing:.04em;line-height:16px;text-transform:uppercase}.field__row.svelte-s2yrtn{align-items:center;display:flex;gap:8px}.control.svelte-s2yrtn{background:var(--pm-surface-elevated);border:1px solid var(--pm-border-control);border-radius:var(--pm-radius-control);color:var(--pm-text-primary);font-family:var(--pm-font-mono);font-size:13px;height:32px;min-width:0;outline:none;padding:0 10px;transition:border-color .2s,box-shadow .2s;width:100%}@media(max-width:680px){.control.svelte-s2yrtn{font-size:16px}}.control.svelte-s2yrtn::placeholder{color:var(--pm-text-muted)}.control.svelte-s2yrtn:focus-visible{border-color:var(--pm-focus-ring);box-shadow:0 0 0 1px var(--pm-focus-ring)}.control--short.svelte-s2yrtn{flex:0 1 auto;width:112px}select.control.svelte-s2yrtn{appearance:none;background-image:var(--pm-select-arrow);background-position:right 10px center;background-repeat:no-repeat;background-size:16px;cursor:pointer;font-family:var(--pm-font-sans);padding-right:36px}.presets.svelte-s2yrtn{display:flex;gap:4px}.preset.svelte-s2yrtn{border:1px solid var(--pm-border-subtle);border-radius:6px;color:var(--pm-text-secondary);font-family:var(--pm-font-mono);font-size:11px;font-weight:600;height:28px;padding:0 8px;transition:background .2s,color .2s,border-color .2s}.preset.svelte-s2yrtn:hover{background:var(--pm-surface-hover);color:var(--pm-text-primary)}.preset.svelte-s2yrtn:focus-visible{outline:2px solid var(--pm-focus-ring);outline-offset:2px}.preset[aria-pressed=true].svelte-s2yrtn{background:var(--pm-accent-subtle);border-color:transparent;color:var(--pm-accent-text)}.switch.svelte-s2yrtn{background:var(--pm-switch-off);border-radius:var(--pm-radius-pill);box-shadow:inset 0 0 0 1px var(--pm-border-control);flex:none;height:20px;position:relative;transition:background .2s;width:34px}.switch.svelte-s2yrtn:focus-visible{outline:2px solid var(--pm-focus-ring);outline-offset:2px}.switch__thumb.svelte-s2yrtn{background:#fff;border-radius:50%;box-shadow:0 1px 2px rgba(0,0,0,.2);height:16px;left:2px;position:absolute;top:2px;transition:transform .2s cubic-bezier(.4,0,.2,1);width:16px}.switch[aria-checked=true].svelte-s2yrtn{background:var(--pm-accent);box-shadow:none}.switch[aria-checked=true].svelte-s2yrtn .switch__thumb:where(.svelte-s2yrtn){background:var(--pm-accent-fg);transform:translateX(14px)}.grids-header.svelte-s2yrtn{align-items:center;display:flex;justify-content:space-between;min-height:24px}.text-button.svelte-s2yrtn{align-items:center;border-radius:6px;color:var(--pm-accent-text);display:inline-flex;font-size:12px;font-weight:600;gap:4px;height:24px;padding:0 8px;transition:background .2s}.text-button.svelte-s2yrtn:hover{background:var(--pm-accent-subtle)}.text-button.svelte-s2yrtn:focus-visible{outline:2px solid var(--pm-focus-ring);outline-offset:2px}.grid-list.svelte-s2yrtn{border:1px solid var(--pm-border-strong);border-radius:var(--pm-radius-card);overflow:hidden}.grid-option.svelte-s2yrtn{align-items:center;display:flex;position:relative;transition:background .2s}.grid-option.svelte-s2yrtn+.grid-option:where(.svelte-s2yrtn){border-top:1px solid var(--pm-border-subtle)}.grid-option.svelte-s2yrtn:hover{background:var(--pm-surface-hover)}.grid-option.active.svelte-s2yrtn{background:var(--pm-surface-active)}.grid-option__choice.svelte-s2yrtn{align-items:center;cursor:pointer;display:flex;flex:1;gap:10px;min-width:0;padding:8px 12px}.grid-option__choice.svelte-s2yrtn:has(:where(.svelte-s2yrtn):focus-visible){box-shadow:inset 0 0 0 2px var(--pm-focus-ring)}.grid-option.active.svelte-s2yrtn .grid-option__choice:where(.svelte-s2yrtn){cursor:default}.grid-option__radio.svelte-s2yrtn{border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.grid-option__mark.svelte-s2yrtn{border:1.5px solid var(--pm-border-control);border-radius:50%;display:grid;flex:none;height:16px;place-items:center;width:16px}.grid-option__mark.svelte-s2yrtn:after{border-radius:50%;content:"";height:8px;width:8px}.grid-option__radio.svelte-s2yrtn:checked+.grid-option__mark:where(.svelte-s2yrtn){border-color:var(--pm-accent)}.grid-option__radio.svelte-s2yrtn:checked+.grid-option__mark:where(.svelte-s2yrtn):after{background:var(--pm-accent)}.grid-option__text.svelte-s2yrtn{align-items:baseline;display:flex;flex-wrap:wrap;font-size:13px;gap:2px 8px;line-height:18px;min-width:0}.grid-option__summary.svelte-s2yrtn{color:var(--pm-text-primary);font-variant-numeric:tabular-nums;font-weight:500}.grid-option__details.svelte-s2yrtn{color:var(--pm-text-secondary);font-size:12px}.grid-option__delete.svelte-s2yrtn{border-radius:6px;color:var(--pm-text-secondary);display:grid;flex:none;height:32px;margin-right:6px;place-items:center;transition:color .2s;width:32px}.grid-option__delete.svelte-s2yrtn:hover:not(:disabled){color:var(--pm-danger-text)}.grid-option__delete.svelte-s2yrtn:focus-visible{outline:2px solid var(--pm-focus-ring);outline-offset:2px}.grid-option__delete.svelte-s2yrtn:disabled{cursor:not-allowed;opacity:.35}.new-grid.svelte-s2yrtn{align-items:end;background:var(--pm-surface-subtle);border:1px solid var(--pm-border-subtle);border-radius:var(--pm-radius-card);display:grid;gap:10px 8px;grid-template-columns:minmax(0,1fr) minmax(0,0.7fr) minmax(0,0.8fr) minmax(0,1.2fr) minmax(0,1fr);padding:12px}@media(max-width:560px){.new-grid.svelte-s2yrtn{grid-template-columns:repeat(2,minmax(0,1fr))}}.new-grid__actions.svelte-s2yrtn{display:flex;gap:8px;grid-column:1/-1;justify-content:flex-end}.button.svelte-s2yrtn{background:var(--pm-button-bg);border:1px solid transparent;border-radius:var(--pm-radius-control);color:var(--pm-button-fg);font-size:12px;font-weight:600;height:30px;padding:0 12px;transition:background .2s,color .2s,border-color .2s}.button.svelte-s2yrtn:hover:not(:disabled){background:var(--pm-button-hover-bg)}.button.svelte-s2yrtn:focus-visible{outline:2px solid var(--pm-focus-ring);outline-offset:2px}.button.svelte-s2yrtn:disabled{background:var(--pm-button-disabled-bg);cursor:not-allowed;opacity:.55}.button--ghost.svelte-s2yrtn{background:transparent;border-color:var(--pm-border-strong);color:var(--pm-text-primary)}.button--ghost.svelte-s2yrtn:hover:not(:disabled){background:var(--pm-surface-hover)}`};function oc(e,t){let n=Ar();Ge(t,!0),ni(e,ac);let r=[`4px`,`8px`,`16px`],i=P(()=>$.spacingGridHeight),a=I(!1),o=I(void 0),s=I(void 0),c=I(``),l=I(``),u=I(``),d=I(!0),f=I(`center`),p=I(!1),m=I(void 0),h=P(()=>U(c).trim()&&U(u).trim()&&/^\d+$/.test(U(l))&&Number(U(l))>0);function g(e){return{summary:`${e.width} \u00B7 ${e.columns} columns \u00B7 ${e.gutterWidth} gutters`,details:`${e.position[0].toUpperCase()}${e.position.slice(1)} \u00B7 ${e.isGutterOnOutside?`outer gutters`:`no outer gutters`}`}}function _(e,t){e.key===`Enter`&&(e.preventDefault(),t())}function v(){let e=U(i).trim();e?e!==$.spacingGridHeight&&$.updateSpacingGridHeight(e):L(i,$.spacingGridHeight)}async function y(){L(a,!0),await ur(),U(s)?.focus()}async function b(){L(a,!1),L(c,``),L(l,``),L(u,``),L(d,!0),L(f,`center`),await ur(),U(o)?.focus()}async function x(e){e.preventDefault(),U(h)&&await $.add({width:Vo(U(c)),columns:Number(U(l)),gutterWidth:Vo(U(u)),isGutterOnOutside:U(d),position:U(f)})&&await b()}async function S(){if($.isResetting)return;if(!U(p)){L(p,!0);return}let e=U(m)?.getRootNode()?.activeElement===U(m);await $.reset()&&(L(p,!1),L(a,!1),L(c,``),L(l,``),L(u,``)),await ur(),e&&U(m)?.isConnected&&U(m).focus()}var C=kr(),w=on(C),T=e=>{var t=ic(),C=R(t),w=R(C),T=R(w),E=R(T),D=R(E);Se(2),j(E);var ee=z(E,2);j(T);var O=z(T,2);let te;var ne=R(O),re=R(ne),ie=z(re,2),ae=R(ie);Ci(ae);var oe=z(ae,2);Xr(oe,20,()=>r,e=>e,(e,t)=>{var n=$s(),r=sn(n,!0);B(()=>{Y(n,`aria-pressed`,$.spacingGridHeight===t),Lr(r,t)}),G(`click`,n,()=>$.updateSpacingGridHeight(t)),q(e,n)}),j(oe),j(ie),j(ne),Qs(z(ne,2),{get value(){return $.spacingGridColor},fallback:`#ff0000`,pickerLabel:`Pick spacing grid color`,opacityLabel:`Spacing grid opacity`,pickerTestId:`picker-spacing-color`,get onchange(){return $.updateSpacingGridColor}}),j(O),j(w);var se=z(w,2),ce=R(se),le=R(ce),ue=R(le);Se(2),j(le);var de=z(le,2);j(ce);var fe=z(ce,2);let pe;var me=R(fe);Qs(R(me),{get value(){return $.layoutGridColor},fallback:`#0000ff`,pickerLabel:`Pick layout grid color`,opacityLabel:`Layout grid opacity`,pickerTestId:`picker-layout-color`,get onchange(){return $.updateLayoutGridColor}}),j(me);var he=z(me,2),ge=R(he),_e=R(ge),ve=z(_e,2),k=e=>{var t=ec();Gs(R(t),{name:`plus`,size:14}),Se(),j(t),Ni(t,e=>L(o,e),()=>U(o)),G(`click`,t,y),q(e,t)};J(ve,e=>{U(a)||e(k)}),j(ge);var ye=z(ge,2);Xr(ye,21,()=>$.layoutGrids,e=>e.id,(e,t)=>{let r=P(()=>$.activeLayoutGridId===U(t).id),i=P(()=>g(U(t)));var a=tc();let o;var s=R(a),c=R(s);Ci(c);var l=z(c,4),u=R(l),d=sn(u,!0),f=sn(z(u,2),!0);j(l),j(s);var p=z(s,2);Gs(R(p),{name:`delete`,size:16}),j(p),j(a),B(()=>{o=li(a,1,`grid-option svelte-s2yrtn`,null,o,{active:U(r)}),Y(c,`name`,`${n}-active-grid`),Ti(c,U(r)),Lr(d,U(i).summary),Lr(f,U(i).details),p.disabled=U(r),Y(p,`title`,U(r)?`The grid in use can't be deleted`:`Delete this grid`),Y(p,`aria-label`,`Delete grid ${U(i).summary??``}`)}),G(`change`,c,()=>$.setActiveLayoutGrid(U(t).id)),G(`click`,p,()=>$.delete(U(t).id)),q(e,a)}),j(ye),j(he);var A=z(he,2),be=e=>{var t=nc(),r=R(t),i=R(r),a=z(i,2);Ci(a),Ni(a,e=>L(s,e),()=>U(s)),j(r);var o=z(r,2),p=R(o),m=z(p,2);Ci(m),j(o);var g=z(o,2),_=R(g),v=z(_,2);Ci(v),j(g);var y=z(g,2),S=R(y),C=z(S,2),w=R(C);w.value=w.__value=!0;var T=z(w);T.value=T.__value=!1,j(C),hi(C),j(y);var E=z(y,2),D=R(E),ee=z(D,2),O=R(ee);O.value=O.__value=`center`;var te=z(O);te.value=te.__value=`left`;var ne=z(te);ne.value=ne.__value=`right`,j(ee),hi(ee),j(E);var re=z(E,2),ie=R(re),ae=z(ie,2);j(re),j(t),B(()=>{Y(i,`for`,`${n}-new-width`),Y(a,`id`,`${n}-new-width`),Y(p,`for`,`${n}-new-columns`),Y(m,`id`,`${n}-new-columns`),Y(_,`for`,`${n}-new-gutter`),Y(v,`id`,`${n}-new-gutter`),Y(S,`for`,`${n}-new-outer`),Y(C,`id`,`${n}-new-outer`),Y(D,`for`,`${n}-new-position`),Y(ee,`id`,`${n}-new-position`),ae.disabled=!U(h)}),vr(`submit`,t,x),ki(a,()=>U(c),e=>L(c,e)),ki(m,()=>U(l),e=>L(l,e)),ki(v,()=>U(u),e=>L(u,e)),gi(C,()=>U(d),e=>L(d,e)),gi(ee,()=>U(f),e=>L(f,e)),G(`click`,ie,b),q(e,t)};J(A,e=>{U(a)&&e(be)}),j(fe),j(se),j(C);var xe=z(C,2),Ce=R(xe),M=e=>{var t=rc();G(`click`,t,()=>L(p,!1)),q(e,t)};J(Ce,e=>{U(p)&&e(M)});var we=z(Ce,2);let Te;var Ee=sn(we,!0);Ni(we,e=>L(m,e),()=>U(m));var De=z(we,2);j(xe),j(t),B(()=>{C.inert=$.isResetting,Y(D,`id`,`${n}-spacing-title`),Y(ee,`aria-checked`,$.showSpacingGrid),Y(ee,`aria-labelledby`,`${n}-spacing-title`),te=li(O,1,`section__body fields svelte-s2yrtn`,null,te,{disabled:!$.showSpacingGrid}),O.inert=!$.showSpacingGrid,Y(re,`for`,`${n}-spacing-height`),Y(ae,`id`,`${n}-spacing-height`),Y(ue,`id`,`${n}-layout-title`),Y(de,`aria-checked`,$.showLayoutGrid),Y(de,`aria-labelledby`,`${n}-layout-title`),pe=li(fe,1,`section__body svelte-s2yrtn`,null,pe,{disabled:!$.showLayoutGrid}),fe.inert=!$.showLayoutGrid,Y(_e,`id`,`${n}-grids-label`),Y(ye,`aria-labelledby`,`${n}-grids-label`),Te=li(we,1,`footer__button svelte-s2yrtn`,null,Te,{"footer__button--ghost":!U(p),"footer__button--danger":U(p)}),we.disabled=$.isResetting,Lr(Ee,U(p)?`Confirm Reset?`:`Reset All Settings`)}),G(`click`,ee,function(...e){$.toggleSpacingGrid?.apply(this,e)}),G(`change`,ae,v),G(`keydown`,ae,e=>_(e,v)),ki(ae,()=>U(i),e=>L(i,e)),G(`click`,de,function(...e){$.toggleLayoutGrid?.apply(this,e)}),G(`click`,we,S),G(`click`,De,function(...e){Q.enterToolbar?.apply(this,e)}),q(e,t)};J(w,e=>{$.initialized&&e(T)}),q(e,C),Ke()}yr([`click`,`change`,`keydown`]),Hi(oc,{},[],[],{mode:`open`});function sc(e){return t=>{let n=URL.createObjectURL(e);return t.src=n,()=>URL.revokeObjectURL(n)}}var cc=K(`<span class="mockup__details svelte-12ri4gy"> </span>`),lc=K(`<div class="mockup__indicator svelte-12ri4gy" title="Active mockup">Active</div>`),uc=K(`<div><button class="mockup__preview svelte-12ri4gy" type="button"><img class="mockup__image svelte-12ri4gy" draggable="false"/> <div class="mockup__meta svelte-12ri4gy"><span class="mockup__filename svelte-12ri4gy"> </span> <!></div></button> <!> <button class="mockup__delete svelte-12ri4gy" type="button" title="Delete mockup"><!></button></div>`),dc=K(`<button class="footer__button footer__button--ghost svelte-12ri4gy" type="button">Cancel</button>`),fc=K(`<div class="container svelte-12ri4gy" role="region" aria-label="Mockup Manager"><header class="studio-header svelte-12ri4gy"><div class="studio-header__title-group svelte-12ri4gy"><h3 class="studio-header__title svelte-12ri4gy">Mockup Studio</h3> <span class="studio-header__badge svelte-12ri4gy"> </span></div> <span class="studio-header__hint svelte-12ri4gy">Drop PNG, JPG, WebP, or GIF anywhere on the page</span></header> <div class="inner svelte-12ri4gy"><div class="grid svelte-12ri4gy"><label class="upload-button svelte-12ri4gy"><span class="upload-button__icon svelte-12ri4gy"><!></span> <span class="upload-button__text svelte-12ri4gy">Upload Mockups</span> <span class="upload-button__subtext svelte-12ri4gy">Click or drag files</span> <input type="file" multiple="" class="svelte-12ri4gy"/></label> <!></div></div> <footer class="footer svelte-12ri4gy"><!> <button type="button"> </button> <button class="footer__button svelte-12ri4gy" type="button">Close</button></footer></div>`),pc={hash:`svelte-12ri4gy`,code:`.container.svelte-12ri4gy{display:flex;flex-direction:column;height:100%;max-height:inherit;overflow:hidden;width:100%}.studio-header.svelte-12ri4gy{align-items:center;border-bottom:1px solid var(--pm-border-subtle);display:flex;flex-shrink:0;gap:12px;justify-content:space-between;padding:16px 24px}.studio-header__title-group.svelte-12ri4gy{align-items:center;display:flex;gap:8px}.studio-header__title.svelte-12ri4gy{color:var(--pm-text-primary);font-size:15px;font-weight:700;margin:0}.studio-header__badge.svelte-12ri4gy{background:var(--pm-accent-subtle);border-radius:var(--pm-radius-pill);color:var(--pm-accent-text);font-family:var(--pm-font-mono);font-size:11px;font-weight:600;padding:2px 8px}.studio-header__hint.svelte-12ri4gy{color:var(--pm-text-secondary);font-size:12px}@media(max-width:560px){.studio-header__hint.svelte-12ri4gy{display:none}}.inner.svelte-12ri4gy{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:20px 24px}@media(max-width:680px){.inner.svelte-12ri4gy{padding:16px}}.footer.svelte-12ri4gy{align-items:center;background:var(--pm-surface-subtle);border-top:1px solid var(--pm-border-subtle);display:flex;flex-shrink:0;gap:8px;justify-content:flex-end;padding:12px 24px}@media(max-width:680px){.footer.svelte-12ri4gy{padding:12px 16px}}.footer__button.svelte-12ri4gy{align-items:center;background:var(--pm-button-bg);border:1px solid transparent;border-radius:var(--pm-radius-control);color:var(--pm-button-fg);display:inline-flex;font-size:13px;font-weight:600;height:32px;justify-content:center;line-height:1;min-width:96px;padding:0 16px;transition:background .2s,color .2s,border-color .2s;white-space:nowrap}.footer__button.svelte-12ri4gy:hover:not(:disabled){background:var(--pm-button-hover-bg)}.footer__button.svelte-12ri4gy:focus-visible{outline:2px solid var(--pm-focus-ring);outline-offset:2px}.footer__button.svelte-12ri4gy:disabled{background:var(--pm-button-disabled-bg);cursor:not-allowed;opacity:.55}@media(max-width:420px){.footer__button.svelte-12ri4gy{padding:0 12px}}.footer__button--ghost.svelte-12ri4gy{background:transparent;border-color:var(--pm-border-strong);color:var(--pm-text-primary)}.footer__button--ghost.svelte-12ri4gy:hover:not(:disabled){background:var(--pm-surface-hover)}.footer__button--danger.svelte-12ri4gy{background:var(--pm-danger);border-color:transparent;color:#fff}.footer__button--danger.svelte-12ri4gy:hover:not(:disabled){background:var(--pm-danger-hover)}.grid.svelte-12ri4gy{display:grid;gap:16px;grid-template-columns:repeat(4,1fr)}.upload-button.svelte-12ri4gy{align-items:center;aspect-ratio:1;background:var(--pm-surface-subtle);border:2px dashed var(--pm-border-strong);border-radius:var(--pm-radius-card);cursor:pointer;display:flex;flex-direction:column;justify-content:center;outline:none;padding:16px;text-align:center;transition:background .2s,border-color .2s}.upload-button.svelte-12ri4gy:has(:where(.svelte-12ri4gy):focus-visible),.upload-button.svelte-12ri4gy:hover{background:var(--pm-accent-subtle);border-color:var(--pm-accent)}.upload-button.svelte-12ri4gy:has(:where(.svelte-12ri4gy):focus-visible){outline:2px solid var(--pm-focus-ring);outline-offset:2px}.upload-button__icon.svelte-12ri4gy{color:var(--pm-accent-text);height:28px;margin-bottom:8px;width:28px}.upload-button__text.svelte-12ri4gy{color:var(--pm-text-primary);font-size:13px;font-weight:600;line-height:18px}.upload-button__subtext.svelte-12ri4gy{color:var(--pm-text-secondary);font-size:11px;margin-top:2px}input[type=file].svelte-12ri4gy{border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.mockup.svelte-12ri4gy{aspect-ratio:1;position:relative}@media(hover:hover){.mockup.svelte-12ri4gy:hover .mockup__delete:where(.svelte-12ri4gy){opacity:1}.mockup__delete.svelte-12ri4gy{opacity:0}}.mockup.active.svelte-12ri4gy .mockup__preview:where(.svelte-12ri4gy){border-color:var(--pm-accent);box-shadow:0 0 0 2px var(--pm-accent-subtle)}.mockup__preview.svelte-12ri4gy{background:var(--pm-surface-subtle);border:2px solid var(--pm-mockup-border);border-radius:var(--pm-radius-card);display:block;height:100%;overflow:hidden;position:relative;transition:border-color .2s;width:100%}.mockup__preview.svelte-12ri4gy:focus-visible,.mockup__preview.svelte-12ri4gy:hover:not(:disabled){border-color:var(--pm-mockup-border-hover)}.mockup__preview.svelte-12ri4gy:focus-visible{outline:2px solid var(--pm-focus-ring);outline-offset:2px}.mockup__image.svelte-12ri4gy{height:100%;object-fit:cover;object-position:top center;width:100%}.mockup__meta.svelte-12ri4gy{background:linear-gradient(0deg,rgba(0,0,0,.78),rgba(0,0,0,.42) 65%,transparent);bottom:0;display:flex;flex-direction:column;gap:1px;left:0;padding:16px 10px 8px;position:absolute;right:0;text-align:left}.mockup__filename.svelte-12ri4gy{color:#fff;font-size:11px;font-weight:600;line-height:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mockup__details.svelte-12ri4gy{color:hsla(0,0%,100%,.8);font-family:var(--pm-font-mono);font-size:10px;line-height:13px}.mockup__indicator.svelte-12ri4gy{background:var(--pm-accent);border-radius:var(--pm-radius-pill);box-shadow:0 2px 6px rgba(0,0,0,.2);color:var(--pm-accent-fg);font-size:10px;font-weight:700;left:8px;letter-spacing:.04em;line-height:14px;padding:2px 7px;pointer-events:none;position:absolute;text-transform:uppercase;top:8px}.mockup__delete.svelte-12ri4gy{align-items:center;backdrop-filter:blur(4px);background:rgba(24,24,27,.72);border-radius:var(--pm-radius-control);color:#fff;display:flex;height:28px;justify-content:center;padding:4px;position:absolute;right:8px;top:8px;transition:background .2s,opacity .2s;width:28px;z-index:1}.mockup__delete.svelte-12ri4gy:focus-visible,.mockup__delete.svelte-12ri4gy:hover{background:var(--pm-danger);opacity:1}.mockup__delete.svelte-12ri4gy:focus-visible{outline:2px solid var(--pm-focus-ring);outline-offset:2px}@media(max-width:680px){.grid.svelte-12ri4gy{grid-template-columns:repeat(3,1fr)}}@media(max-width:480px){.grid.svelte-12ri4gy{grid-template-columns:repeat(2,1fr)}}`};function mc(e,t){Ge(t,!0),ni(e,pc);let n=I(!1);function r(e){return!e||e<=0?``:e<1024?`${e} B`:e<1048576?`${Math.round(e/1024)} KB`:`${(e/1048576).toFixed(1)} MB`}function i(e){let t=[];e.width&&e.height&&t.push(`${e.width}\u00D7${e.height}`);let n=r(e.fileSize);return n&&t.push(n),t.join(` \u00B7 `)}function a(e){let t=e.target;t.files&&X.upload(Array.from(t.files)),t.value=``}function o(e,t){e.stopPropagation(),X.mockups.length<=1&&L(n,!1),X.delete(t)}function s(e){X.select(e),Q.enterToolbar()}function c(){U(n)?(L(n,!1),X.clear()):L(n,!0)}var l=kr(),u=on(l),d=e=>{var t=fc(),r=R(t),l=R(r),u=sn(z(R(l),2),!0);j(l),Se(2),j(r);var d=z(r,2),f=R(d),p=R(f),m=R(p);Gs(R(m),{name:`upload`,size:28}),j(m);var h=z(m,6);j(p),Xr(z(p,2),17,()=>X.mockups,e=>e.id,(e,t)=>{let n=P(()=>X.activeMockupId===U(t).id),r=P(()=>i(U(t)));var a=uc();let c;var l=R(a),u=R(l);ri(u,()=>sc(U(t).thumbnail));var d=z(u,2),f=R(d),p=sn(f,!0),m=z(f,2),h=e=>{var t=cc(),n=sn(t,!0);B(()=>Lr(n,U(r))),q(e,t)};J(m,e=>{U(r)&&e(h)}),j(d),j(l);var g=z(l,2),_=e=>{q(e,lc())};J(g,e=>{U(n)&&e(_)});var v=z(g,2);Gs(R(v),{name:`delete`,size:16}),j(v),j(a),B(()=>{c=li(a,1,`mockup svelte-12ri4gy`,null,c,{active:U(n)}),l.disabled=U(n),Y(u,`alt`,U(t).filename),Y(f,`title`,U(t).filename),Lr(p,U(t).filename)}),G(`click`,l,()=>s(U(t).id)),G(`click`,v,e=>o(e,U(t).id)),q(e,a)}),j(f),j(d);var g=z(d,2),_=R(g),v=e=>{var t=dc();G(`click`,t,()=>L(n,!1)),q(e,t)};J(_,e=>{U(n)&&X.mockups.length>0&&e(v)});var y=z(_,2);let b;var x=sn(y,!0),S=z(y,2);j(g),j(t),B(e=>{Lr(u,X.mockups.length),Y(h,`accept`,e),b=li(y,1,`footer__button svelte-12ri4gy`,null,b,{"footer__button--ghost":!(U(n)&&X.mockups.length>0),"footer__button--danger":U(n)&&X.mockups.length>0}),y.disabled=X.mockups.length===0,Lr(x,U(n)&&X.mockups.length>0?`Confirm Clear?`:`Clear Mockups`)},[()=>ta.join(`,`)]),G(`change`,h,a),G(`click`,y,c),G(`click`,S,function(...e){Q.enterToolbar?.apply(this,e)}),q(e,t)};J(u,e=>{X.initialized&&e(d)}),q(e,l),Ke()}yr([`change`,`click`]),Hi(mc,{},[],[],{mode:`open`});var hc=K(`<button type="button"> </button>`),gc=K(`<div class="dock__popover dock__popover--opacity svelte-19cxvb5"><div class="popover-section svelte-19cxvb5"><div class="popover-section__header svelte-19cxvb5"><span class="popover-section__label svelte-19cxvb5">Opacity</span> <button type="button" class="popover-section__reset svelte-19cxvb5" title="Reset opacity to 50%"> </button></div> <input type="range" class="opacity-slider svelte-19cxvb5" aria-label="Mockup opacity" step="5"/> <div class="chip-row svelte-19cxvb5"></div></div></div>`),_c=K(`<button type="button"><span class="svelte-19cxvb5"></span></button>`),vc=K(`<div class="dock__popover dock__popover--placement svelte-19cxvb5"><div class="alignment-matrix svelte-19cxvb5" role="group" aria-label="2x3 alignment matrix"></div></div>`),yc=K(`<div class="manager-wrapper dock__panel dock__panel--mockups svelte-19cxvb5"><!></div>`),bc=K(`<div class="manager-wrapper dock__panel dock__panel--grids svelte-19cxvb5"><!></div>`),xc=K(`<div class="dock__coordinates svelte-19cxvb5"> </div>`),Sc=K(`<div><span class="inspect-hud__badge svelte-19cxvb5"> </span> <span class="inspect-hud__coords svelte-19cxvb5"> </span></div>`),Cc=K(`<div><div class="toolbar svelte-19cxvb5" role="toolbar" aria-label="Pixel Mirror controls"><button class="icon-button svelte-19cxvb5"><!></button> <button aria-label="Lock mockup position"><!></button> <span class="toolbar__divider svelte-19cxvb5" aria-hidden="true"></span> <button title="Opacity (Enter to adjust, click to reset, hover or Ctrl+Scroll)"><!></button> <span class="toolbar__divider svelte-19cxvb5" aria-hidden="true"></span> <button aria-label="Alignment" title="Alignment (click for top center)"><!></button> <button class="icon-button scale-button svelte-19cxvb5" title="Scale (1\u00D7 \u2194 \u00BD\u00D7)"><span class="scale-button__value svelte-19cxvb5"> </span></button> <span class="toolbar__divider svelte-19cxvb5" aria-hidden="true"></span> <button title="Mockup Studio"><!></button> <button title="Grid Studio"><!></button> <span class="toolbar__divider svelte-19cxvb5" aria-hidden="true"></span> <button class="icon-button svelte-19cxvb5" title="Toggle theme"><!></button> <button class="icon-button svelte-19cxvb5"><!></button></div> <!> <!> <!> <!></div> <!>`,1),wc={hash:`svelte-19cxvb5`,code:`.dock.svelte-19cxvb5{align-items:center;backdrop-filter:var(--pm-backdrop-blur);background:var(--pm-surface-primary);border:1px solid var(--pm-border-strong);border-radius:var(--pm-radius-pill);bottom:24px;box-shadow:var(--pm-shadow-hud);color:var(--pm-text-primary);display:flex;font-family:var(--pm-font-sans);justify-content:center;left:12px;margin-left:auto;margin-right:auto;max-width:calc(100vw - 24px);position:fixed;right:12px;transform:translateZ(0);width:max-content;z-index:2147483647}.dock[hidden].svelte-19cxvb5{display:none!important}.dock.svelte-19cxvb5,.dock.svelte-19cxvb5 :where(.svelte-19cxvb5){touch-action:pan-x pan-y;user-select:none}.dock.at-top.svelte-19cxvb5{bottom:auto;top:24px}.dock.is-dragging.svelte-19cxvb5,.dock__coordinates.svelte-19cxvb5,.inspect-hud.svelte-19cxvb5{pointer-events:none}.dock__coordinates.svelte-19cxvb5{backdrop-filter:var(--pm-backdrop-blur);background:var(--pm-surface-primary);border:1px solid var(--pm-border-subtle);border-radius:var(--pm-radius-pill);bottom:calc(100% + 8px);box-shadow:var(--pm-shadow-hud);color:var(--pm-text-secondary);font-family:var(--pm-font-mono);font-size:11px;font-variant-numeric:tabular-nums;font-weight:500;left:0;line-height:16px;margin:auto;padding:3px 10px;position:absolute;right:0;white-space:nowrap;width:max-content;z-index:1}.dock.at-top.svelte-19cxvb5 .dock__coordinates:where(.svelte-19cxvb5){bottom:auto;top:calc(100% + 8px)}.dock__popover.svelte-19cxvb5{animation:svelte-19cxvb5-d .16s cubic-bezier(.4,0,.2,1);background:var(--pm-surface-elevated);border:1px solid var(--pm-border-strong);border-radius:var(--pm-radius-card);bottom:calc(100% + 10px);box-shadow:var(--pm-shadow-panel);display:flex;flex-direction:column;gap:8px;left:50%;padding:12px;position:absolute;transform:translateX(-50%);width:max-content;z-index:3}.dock__popover--opacity.svelte-19cxvb5{--opacity-popover-width:min(232px, 100%);left:clamp(var(--opacity-popover-width) / 2,var(--popover-anchor,50%),100% - var(--opacity-popover-width) / 2);min-width:0;width:var(--opacity-popover-width)}.dock__popover--placement.svelte-19cxvb5{padding:8px}.dock__popover.svelte-19cxvb5:after{bottom:-18px;content:"";height:18px;left:0;position:absolute;right:0}.dock.at-top.svelte-19cxvb5 .dock__popover:where(.svelte-19cxvb5){bottom:auto;top:calc(100% + 10px)}.dock.at-top.svelte-19cxvb5 .dock__popover:where(.svelte-19cxvb5):after{bottom:auto;top:-18px}.dock__panel.svelte-19cxvb5{animation:svelte-19cxvb5-d .18s cubic-bezier(.4,0,.2,1);background:var(--pm-surface-elevated);border:1px solid var(--pm-border-strong);border-radius:var(--pm-radius-panel);bottom:calc(100% + 12px);box-shadow:var(--pm-shadow-panel);left:50%;max-height:calc(min(68vh,560px));max-width:calc(100vw - 24px);overflow:hidden;position:absolute;transform:translateX(-50%);z-index:4}.dock__panel--mockups.svelte-19cxvb5{width:calc(min(820px,100vw - 24px))}.dock__panel--grids.svelte-19cxvb5{width:calc(min(648px,100vw - 24px))}.dock.at-top.svelte-19cxvb5 .dock__panel:where(.svelte-19cxvb5){bottom:auto;top:calc(100% + 12px)}.toolbar.svelte-19cxvb5{align-items:center;display:flex;flex-shrink:0;gap:2px;max-width:100%;overflow-x:auto;padding:4px;-webkit-overflow-scrolling:touch;-ms-overflow-style:none;scrollbar-width:none}.toolbar.svelte-19cxvb5::-webkit-scrollbar{display:none}.toolbar__divider.svelte-19cxvb5{background:var(--pm-border-strong);flex:none;height:20px;margin:0 4px;width:1px}@media(max-width:420px){.toolbar.svelte-19cxvb5{gap:0}.toolbar__divider.svelte-19cxvb5{display:none}}.icon-button.svelte-19cxvb5{border-radius:var(--pm-radius-pill);color:var(--pm-text-secondary);display:inline-grid;flex:none;height:36px;place-items:center;transition:background .2s,color .2s;width:36px}@media(hover:hover){.icon-button.svelte-19cxvb5:hover:not(:disabled){background:var(--pm-surface-hover);color:var(--pm-text-primary)}}.icon-button.svelte-19cxvb5:focus-visible{outline:2px solid var(--pm-focus-ring);outline-offset:2px}.icon-button.active.svelte-19cxvb5,.icon-button.active.svelte-19cxvb5:hover:not(:disabled),.opacity-button.sliding.svelte-19cxvb5{background:var(--pm-accent-subtle);color:var(--pm-accent-text)}.icon-button.svelte-19cxvb5:disabled{cursor:not-allowed;opacity:.35}.scale-button__value.svelte-19cxvb5{font-size:13px;font-variant-numeric:tabular-nums;font-weight:600;line-height:20px}.popover-section.svelte-19cxvb5{display:flex;flex-direction:column;gap:10px}.popover-section__header.svelte-19cxvb5{align-items:center;display:flex;justify-content:space-between}.popover-section__label.svelte-19cxvb5{color:var(--pm-text-secondary);font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}.popover-section__reset.svelte-19cxvb5{border-radius:6px;color:var(--pm-accent-text);font-size:12px;font-variant-numeric:tabular-nums;font-weight:600;padding:2px 6px;transition:background .2s}.popover-section__reset.svelte-19cxvb5:hover{background:var(--pm-accent-subtle)}.popover-section__reset.svelte-19cxvb5:focus-visible{outline:2px solid var(--pm-focus-ring);outline-offset:2px}.opacity-slider.svelte-19cxvb5{accent-color:var(--pm-accent);cursor:pointer;margin:0;width:100%}.opacity-slider.svelte-19cxvb5:focus-visible{border-radius:var(--pm-radius-pill);outline:2px solid var(--pm-focus-ring);outline-offset:2px}.chip-row.svelte-19cxvb5{display:grid;gap:4px;grid-template-columns:repeat(4,minmax(0,1fr))}.chip.svelte-19cxvb5{border:1px solid var(--pm-border-strong);border-radius:6px;color:var(--pm-text-secondary);font-size:12px;font-variant-numeric:tabular-nums;font-weight:600;height:28px;transition:background .2s,color .2s,border-color .2s}.chip.svelte-19cxvb5:hover{background:var(--pm-surface-hover);color:var(--pm-text-primary)}.chip.svelte-19cxvb5:focus-visible{outline:2px solid var(--pm-focus-ring);outline-offset:2px}.chip.active.svelte-19cxvb5{background:var(--pm-accent-subtle);border-color:transparent;color:var(--pm-accent-text)}.alignment-matrix.svelte-19cxvb5{display:grid;gap:4px;grid-template-columns:repeat(3,36px);grid-template-rows:repeat(2,28px)}.alignment-matrix__dot.svelte-19cxvb5{background:var(--pm-surface-subtle);border-radius:6px;display:grid;height:100%;place-items:center;transition:background .2s;width:100%}.alignment-matrix__dot.svelte-19cxvb5 span:where(.svelte-19cxvb5){background:var(--pm-text-muted);border-radius:50%;height:6px;transition:transform .2s,background .2s;width:6px}.alignment-matrix__dot.svelte-19cxvb5:hover{background:var(--pm-surface-active)}.alignment-matrix__dot.svelte-19cxvb5:hover span:where(.svelte-19cxvb5){background:var(--pm-text-primary);transform:scale(1.3)}.alignment-matrix__dot.svelte-19cxvb5:focus-visible{outline:2px solid var(--pm-focus-ring);outline-offset:2px}.alignment-matrix__dot.active.svelte-19cxvb5{background:var(--pm-accent-subtle)}.alignment-matrix__dot.active.svelte-19cxvb5 span:where(.svelte-19cxvb5){background:var(--pm-accent);transform:scale(1.5)}.inspect-hud.svelte-19cxvb5{align-items:center;backdrop-filter:var(--pm-backdrop-blur);background:var(--pm-surface-primary);border:1px solid var(--pm-border-strong);border-radius:var(--pm-radius-pill);bottom:24px;box-shadow:var(--pm-shadow-hud);color:var(--pm-text-primary);display:flex;font-family:var(--pm-font-sans);font-size:12px;gap:10px;height:40px;left:0;margin:auto;padding:0 14px 0 6px;position:fixed;right:0;width:max-content;z-index:2147483647}.inspect-hud.at-top.svelte-19cxvb5{bottom:auto;top:24px}.inspect-hud__badge.svelte-19cxvb5{background:var(--pm-accent);border-radius:var(--pm-radius-pill);color:var(--pm-accent-fg);font-weight:600;line-height:16px;padding:4px 10px}.inspect-hud__coords.svelte-19cxvb5{color:var(--pm-text-secondary);font-family:var(--pm-font-mono);font-size:11px;font-variant-numeric:tabular-nums}@keyframes svelte-19cxvb5-d{0%{opacity:0;transform:translateX(-50%) translateY(4px) scale(.98)}to{opacity:1;transform:translateX(-50%) translateY(0) scale(1)}}`};function Tc(e,t){Ge(t,!0),ni(e,wc);let n=[`top`,`bottom`],r=[`left`,`center`,`right`],i=[.25,.5,.75,Gi],a=I(null),o=I(null),s=null,c,l,u,d=I(!1),f=0,p=0,m=``,h=P(()=>Math.round(Z.opacity*100)),g=P(()=>Z.scale===.5?`\u00BD\u00D7`:`${Z.scale}\u00D7`),_=P(()=>Q.position===`top`?`bottom`:`top`),v=P(()=>!Z.activeMockupId),y=P(()=>Z.isHidden),b=P(()=>Z.isLocked),x=P(()=>Z.isDragging),S=P(()=>U(v)||U(y)),C=P(()=>Q.mode===`mockups`),w=P(()=>Q.mode===`grids`),T=P(()=>U(C)||U(w)),E=P(()=>U(a)===`opacity`&&!U(S)&&!U(T)),D=P(()=>U(a)===`alignment`&&!U(S)&&!U(b)&&!U(T)),ee=P(()=>Q.mode===`toolbar`&&!U(D)&&!U(E)&&!U(S));function O(){s!==null&&(clearTimeout(s),s=null)}function te(e){let t=e===`opacity`?l:u;if(!t||!c){L(o,null);return}let n=c.getBoundingClientRect(),r=t.getBoundingClientRect();n.width>0&&r.width>0?L(o,r.left-n.left+r.width/2):t.offsetWidth>0?L(o,t.offsetLeft+t.offsetWidth/2):L(o,null)}function ne(e){O(),te(e),L(a,e,!0)}function re(){O(),L(a,null)}function ie(){return!!c.getRootNode().activeElement?.closest(`.dock__popover`)}function ae(e,t){if(Fs()||U(a)!==e)return;let n=e===`opacity`?`.opacity-button`:`.alignment-trigger-btn`,r=e===`opacity`?`.dock__popover--opacity`:`.dock__popover--placement`,i=t.relatedTarget;ie()||i?.closest(r)||i?.closest(n)?O():i&&c?.contains(i)?(O(),s=setTimeout(()=>{s=null,U(a)===e&&!ie()&&L(a,null)},140)):re()}function oe(){Fs()||U(x)||U(T)||ie()||ne(`alignment`)}function se(e){ae(`alignment`,e)}async function ce(e){if(e.detail===0){ne(`alignment`),await ur();let e=c.querySelectorAll(`.alignment-matrix__dot`);(Array.from(e).find(e=>e.classList.contains(`active`))??e[0])?.focus()}else Fs()&&U(a)!==`alignment`?ne(`alignment`):Z.setAlignment(`top`,`center`)}function le(){Fs()||U(x)||U(T)||ie()||ne(`opacity`)}function ue(e){ae(`opacity`,e)}function de(e){m=e.pointerType,e.pointerType===`touch`&&(e.currentTarget.setPointerCapture?.(e.pointerId),L(d,!0),f=e.clientX,p=Z.opacity)}function fe(e){if(!U(d))return;let t=e.clientX-f;Z.setOpacity(p+t/200)}function pe(){L(d,!1)}async function me(e){U(T)||(e.detail===0?(ne(`opacity`),await ur(),c.querySelector(`.opacity-slider`)?.focus()):m!==`touch`&&Z.resetOpacity())}function he(){U(w)||(re(),Q.mode===`mockups`?Q.enterToolbar():Q.enterMockups())}function ge(){U(C)||(re(),Q.mode===`grids`?Q.enterToolbar():Q.enterGrids())}yn(()=>{(U(S)||U(T)||U(a)===`alignment`&&U(b))&&re()}),yn(()=>{if(!U(D)&&!U(E))return;let e=[W(window,`keydown`,e=>{if(e.key!==`Escape`||e.defaultPrevented)return;let t=c.getRootNode().activeElement;if(!(t&&c.contains(t))&&Ds(e))return;e.preventDefault();let n=U(a)===`opacity`?l:u;re(),t?.closest(`.dock__popover`)&&n.focus()},{capture:!0}),W(window,`pointerdown`,e=>{e.composedPath().includes(c)||re()})];return()=>e.forEach(e=>e())}),yn(()=>{if(!Q.isManagerMode)return;let e=e=>{e.composedPath().includes(c)||Q.enterToolbar()},t=null,n=setTimeout(()=>{t=W(window,`click`,e)},0);return()=>{clearTimeout(n),t?.()}}),yn(()=>()=>O());var _e=Cc(),ve=on(_e);let k;var ye=R(ve),A=R(ye),be=R(A);{let e=P(()=>U(y)?`hide`:`show`);Gs(be,{get name(){return U(e)}})}j(A);var xe=z(A,2);let Se;var Ce=R(xe);{let e=P(()=>U(b)?`lock`:`unlock`);Gs(Ce,{get name(){return U(e)}})}j(xe);var M=z(xe,4);let we;di(M,``,{},{"touch-action":`none`}),Js(R(M),{get level(){return Z.opacity}}),j(M),Ni(M,e=>l=e,()=>l);var Te=z(M,4);let Ee;Vs(R(Te),{get x(){return Z.alignmentX},get y(){return Z.alignmentY}}),j(Te),Ni(Te,e=>u=e,()=>u);var De=z(Te,2),Oe=sn(R(De),!0);j(De);var ke=z(De,4);let Ae;Gs(R(ke),{name:`mockups`}),j(ke);var je=z(ke,2);let Me;Gs(R(je),{name:`grids`}),j(je);var Ne=z(je,4),Pe=R(Ne);{let e=P(()=>Q.theme===`dark`?`sun`:`moon`);Gs(Pe,{get name(){return U(e)}})}j(Ne);var Fe=z(Ne,2),Ie=R(Fe);{let e=P(()=>U(_)===`top`?`dockTop`:`dockBottom`);Gs(Ie,{get name(){return U(e)}})}j(Fe),j(ye);var Le=z(ye,2),Re=e=>{var t=gc();let n;var r=R(t),a=R(r),s=z(R(a),2),c=sn(s);j(a);var l=z(a,2);Ci(l);var u=z(l,2);Xr(u,20,()=>i,e=>e,(e,t)=>{var n=hc();let r;var i=sn(n);B((e,t)=>{r=li(n,1,`chip svelte-19cxvb5`,null,r,{active:e}),Lr(i,`${t??``}%`)},[()=>Math.abs(Z.opacity-t)<.03,()=>Math.round(t*100)]),G(`click`,n,()=>Z.setOpacity(t)),q(e,n)}),j(u),j(r),j(t),B(()=>{n=di(t,``,n,{"--popover-anchor":U(o)===null?void 0:`${U(o)}px`}),Lr(c,`${U(h)??``}% \u00B7 Reset`),Y(l,`min`,Wi*100),Y(l,`max`,Gi*100),wi(l,U(h))}),vr(`mouseenter`,t,O),vr(`mouseleave`,t,ue),G(`click`,s,()=>Z.resetOpacity()),G(`input`,l,e=>Z.setOpacity(Number(e.currentTarget.value)/100)),q(e,t)};J(Le,e=>{U(E)&&e(Re)});var ze=z(Le,2),Be=e=>{var t=vc();let i;var a=R(t);Xr(a,20,()=>n,e=>e,(e,t)=>{var n=kr();Xr(on(n),17,()=>r,e=>`${t}-${e}`,(e,n)=>{var r=_c();let i;B(()=>{i=li(r,1,`alignment-matrix__dot svelte-19cxvb5`,null,i,{active:Z.alignmentY===t&&Z.alignmentX===U(n)}),Y(r,`title`,`Snap ${t??``} ${U(n)??``}`),Y(r,`aria-label`,`Snap ${t??``} ${U(n)??``}`)}),G(`click`,r,()=>Z.setAlignment(t,U(n))),q(e,r)}),q(e,n)}),j(a),j(t),B(()=>i=di(t,``,i,{left:U(o)===null?void 0:`${U(o)}px`})),vr(`mouseenter`,t,O),vr(`mouseleave`,t,se),q(e,t)};J(ze,e=>{U(D)&&e(Be)});var Ve=z(ze,2),He=e=>{var t=yc();mc(R(t),{}),j(t),q(e,t)},Ue=e=>{var t=bc();oc(R(t),{}),j(t),q(e,t)};J(Ve,e=>{Q.mode===`mockups`?e(He):Q.mode===`grids`&&e(Ue,1)});var We=z(Ve,2),qe=e=>{var t=xc(),n=sn(t,!0);B(()=>Lr(n,Z.positionDisplay)),q(e,t)};J(We,e=>{U(ee)&&e(qe)}),j(ve),Ni(ve,e=>c=e,()=>c);var Je=z(ve,2),Ye=e=>{var t=Sc();let n;var r=R(t),i=sn(r,!0),a=sn(z(r,2),!0);j(t),B(()=>{n=li(t,1,`inspect-hud svelte-19cxvb5`,null,n,{"at-top":Q.position===`top`}),Lr(i,Z.mode===`zoomed`?`200% Zoom`:`100% Solid`),Lr(a,Z.positionDisplay)}),q(e,t)};J(Je,e=>{Q.initialized&&Z.isSolidOrZoomed&&e(Ye)}),B(()=>{k=li(ve,1,`dock svelte-19cxvb5`,null,k,{"at-top":Q.position===`top`,"is-dragging":U(x)}),Y(ve,`hidden`,!Q.initialized||Z.isSolidOrZoomed),A.disabled=U(v)||U(T),Y(A,`title`,U(y)?`Show mockup`:`Hide mockup`),Se=li(xe,1,`icon-button svelte-19cxvb5`,null,Se,{active:U(b)&&!U(S)}),xe.disabled=U(S)||U(T),Y(xe,`aria-pressed`,U(b)),Y(xe,`title`,U(b)?`Unlock mockup position (Click-through active)`:`Lock mockup position (Enable click-through)`),we=li(M,1,`icon-button opacity-button svelte-19cxvb5`,null,we,{sliding:U(d),active:U(E)}),M.disabled=U(S)||U(T),Y(M,`aria-expanded`,U(E)),Y(M,`aria-label`,`Opacity ${U(h)??``}%`),Ee=li(Te,1,`icon-button alignment-trigger-btn svelte-19cxvb5`,null,Ee,{active:U(D)}),Te.disabled=U(S)||U(b)||U(T),Y(Te,`aria-expanded`,U(D)),De.disabled=U(S)||U(b)||U(T),Y(De,`aria-label`,`Scale ${Z.scale??``}x`),Lr(Oe,U(g)),Ae=li(ke,1,`icon-button svelte-19cxvb5`,null,Ae,{active:U(C)}),Y(ke,`aria-pressed`,U(C)),ke.disabled=U(w),Me=li(je,1,`icon-button svelte-19cxvb5`,null,Me,{active:U(w)}),Y(je,`aria-pressed`,U(w)),je.disabled=U(C),Y(Fe,`title`,`Move toolbar to the ${U(_)??``}`)}),G(`click`,A,function(...e){Z.toggleVisibility?.apply(this,e)}),G(`click`,xe,()=>Z.toggleLock()),G(`click`,M,me),G(`pointerdown`,M,de),G(`pointermove`,M,fe),G(`pointerup`,M,pe),vr(`pointercancel`,M,pe),vr(`mouseenter`,M,le),vr(`mouseleave`,M,ue),G(`click`,Te,ce),vr(`mouseenter`,Te,oe),vr(`mouseleave`,Te,se),G(`click`,De,function(...e){Z.cycleScale?.apply(this,e)}),G(`click`,ke,he),G(`click`,je,ge),G(`click`,Ne,function(...e){Q.toggleTheme?.apply(this,e)}),G(`click`,Fe,function(...e){Q.togglePosition?.apply(this,e)}),q(e,_e),Ke()}yr([`click`,`pointerdown`,`pointermove`,`pointerup`,`input`]),Hi(Tc,{},[],[],{mode:`open`});var Ec=K(`<div class="drop-zone svelte-1b5cnjl" role="region" aria-label="Drop zone for mockup upload"><div class="drop-zone__card svelte-1b5cnjl"><div class="drop-zone__icon svelte-1b5cnjl"><!></div> <p class="drop-zone__text svelte-1b5cnjl">Drop image to set as mockup</p> <span class="drop-zone__subtext svelte-1b5cnjl">PNG, JPG, WebP, or GIF up to 10 MB</span></div></div>`),Dc={hash:`svelte-1b5cnjl`,code:`.drop-zone.svelte-1b5cnjl{animation:svelte-1b5cnjl-b .2s cubic-bezier(.4,0,.2,1);background:rgba(0,0,0,.32);inset:0;justify-content:center;pointer-events:none;position:fixed;z-index:2147483647}.drop-zone.svelte-1b5cnjl,.drop-zone__card.svelte-1b5cnjl{align-items:center;display:flex}.drop-zone__card.svelte-1b5cnjl{animation:svelte-1b5cnjl-c .2s cubic-bezier(.4,0,.2,1);background:var(--pm-surface-elevated);border:2px dashed var(--pm-accent);border-radius:var(--pm-radius-panel);box-shadow:var(--pm-shadow-panel);flex-direction:column;padding:32px 48px}.drop-zone__icon.svelte-1b5cnjl{color:var(--pm-accent-text);margin-bottom:12px}.drop-zone__text.svelte-1b5cnjl{color:var(--pm-text-primary);font-family:var(--pm-font-sans);font-size:15px;font-weight:600;margin:0}.drop-zone__subtext.svelte-1b5cnjl{color:var(--pm-text-secondary);font-family:var(--pm-font-sans);font-size:12px;margin-top:4px}@keyframes svelte-1b5cnjl-b{0%{opacity:0}to{opacity:1}}@keyframes svelte-1b5cnjl-c{0%{opacity:0;transform:scale(.94)}to{opacity:1;transform:scale(1)}}`};function Oc(e,t){Ge(t,!0),ni(e,Dc);let n=Ii(t,`visible`,7);var r={get visible(){return n()},set visible(e){n(e),At()}},i=kr(),a=on(i),o=e=>{var t=Ec(),n=R(t),r=R(n);Gs(R(r),{name:`upload`,size:40}),j(r),Se(4),j(n),j(t),q(e,t)};return J(a,e=>{n()&&e(o)}),q(e,i),Ke(r)}Hi(Oc,{visible:{}},[],[],{mode:`open`});var kc=K(`<div class="spacing-grid svelte-hxwjdk"></div>`),Ac=K(`<div class="layout-grid__column svelte-hxwjdk"></div>`),jc=K(`<div><div class="layout-grid__inner svelte-hxwjdk"></div></div>`),Mc=K(`<!> <!>`,1),Nc={hash:`svelte-hxwjdk`,code:`.spacing-grid.svelte-hxwjdk{z-index:2147483646}.layout-grid.svelte-hxwjdk,.spacing-grid.svelte-hxwjdk{inset:0;pointer-events:none;position:fixed}.layout-grid.svelte-hxwjdk{display:flex;overflow:hidden;overflow:clip;z-index:2147483645}.layout-grid--center.svelte-hxwjdk{justify-content:center}.layout-grid--left.svelte-hxwjdk{justify-content:flex-start}.layout-grid--right.svelte-hxwjdk{justify-content:flex-end}.layout-grid__inner.svelte-hxwjdk{display:flex;flex-shrink:0;height:100%}.layout-grid__column.svelte-hxwjdk{flex:1;height:100%}`};function Pc(e,t){Ge(t,!0),ni(e,Nc);let n=P(()=>!Z.isSolidOrZoomed),r=I(0);yn(()=>{if(!$.showSpacingGrid||!U(n))return;let e=()=>{L(r,window.scrollY,!0)};return e(),W(window,`scroll`,e,{passive:!0})});function i(e,t){return e.replace(/[\d.]+/,e=>String(+e*t))}function a(e){return e.gutterWidth.endsWith(`%`)?i(e.width,.5/(1+100/parseFloat(e.gutterWidth))):i(e.gutterWidth,.5)}var o=Mc(),s=on(o),c=e=>{var t=kc();let n;B(e=>n=di(t,``,n,{"background-position-y":`${-U(r)}px`,"background-image":`linear-gradient(to bottom, ${$.spacingGridColor??``}
|
|
4
|
+
${$.spacingGridHeight??``}, transparent ${$.spacingGridHeight??``})`,"background-size":e}),[()=>`100% ${i($.spacingGridHeight,2)??``}`]),q(e,t)};J(s,e=>{$.showSpacingGrid&&U(n)&&e(c)});var l=z(s,2),u=e=>{let t=P(()=>$.activeLayoutGrid);var n=jc(),r=R(n);let i;Xr(r,21,()=>({length:U(t).columns}),Kr,(e,t)=>{var n=Ac();let r;B(()=>r=di(n,``,r,{background:$.layoutGridColor})),q(e,n)}),j(r),j(n),B((e,a)=>{li(n,1,`layout-grid layout-grid--${U(t).position??``}`,`svelte-hxwjdk`),i=di(r,``,i,{width:U(t).width,"padding-left":e,"padding-right":a,gap:U(t).gutterWidth})},[()=>U(t).isGutterOnOutside?a(U(t)):void 0,()=>U(t).isGutterOnOutside?a(U(t)):void 0]),q(e,n)};J(l,e=>{$.showLayoutGrid&&$.activeLayoutGrid&&U(n)&&e(u)}),q(e,o),Ke()}Hi(Pc,{},[],[],{mode:`open`});var Fc=e=>({x:e.clientX,y:e.clientY}),Ic=(e,t)=>Math.abs(t.x-e.x)>5||Math.abs(t.y-e.y)>5;function Lc(e,t){return n=>{let r=new Map,i=null,a=0,o=!1,s=null;function c(){r.clear(),i=null,a=0,o=!1,s=null,e.mode===`dragging`&&e.endDrag()}function l(c){if(t()&&e.mode!==`locked`){if(c.pointerType!==`touch`){if(c.button!==0)return;switch(e.mode){case`visible`:s=c.pointerId,n.setPointerCapture?.(c.pointerId),e.beginDrag(Fc(c));break;case`solid`:e.enterZoomMode(Fc(c));break;case`zoomed`:e.exitZoomMode()}}else if(r.set(c.pointerId,Fc(c)),r.size===1)i=Fc(c),o=!1,e.mode===`solid`&&e.beginPan(Fc(c));else if(r.size===2&&e.mode===`solid`){let[t,n]=r.values();o=!0,a=oa(t,n),e.beginPinch(sa(t,n))}}}function u(t){if(t.pointerId===s){e.dragTo(Fc(t));return}if(!r.has(t.pointerId))return;if(r.set(t.pointerId,Fc(t)),r.size>=2){if(a>0&&e.mode===`solid`){let[t,n]=r.values();e.pinchTo(oa(t,n)/a)}return}let n=Fc(t);switch(e.mode){case`visible`:i&&Ic(i,n)&&(i=null,e.beginDrag(n));break;case`dragging`:e.dragTo(n);break;case`solid`:o||e.panTo(n)}}function d(t){t.pointerId===s?(s=null,n.releasePointerCapture?.(t.pointerId),e.endDrag()):r.delete(t.pointerId)&&(r.size<2&&(a=0),r.size===0&&c())}function f(t){t.pointerType!==`touch`&&e.mode===`zoomed`&&e.zoomPanTo(Fc(t))}let p=[W(n,`pointerdown`,l),W(n,`pointermove`,u),W(n,`pointerup`,d),W(n,`pointercancel`,c),W(window,`pointermove`,f),W(n,`gesturestart`,t=>e.mode!==`locked`&&t.preventDefault(),{passive:!1}),W(document,`visibilitychange`,()=>document.hidden&&c())];return()=>{p.forEach(e=>e()),c()}}}var Rc=K(`<div class="mockup-viewport svelte-ya3gmp"><div class="mockup-document svelte-ya3gmp"><img draggable="false" class="mockup-overlay svelte-ya3gmp" alt="Mockup Overlay"/></div></div>`),zc={hash:`svelte-ya3gmp`,code:`.mockup-viewport.svelte-ya3gmp{inset:0;position:fixed;z-index:2147483644}.mockup-document.svelte-ya3gmp,.mockup-viewport.svelte-ya3gmp{overflow:hidden;overflow:clip;pointer-events:none}.mockup-document.svelte-ya3gmp,.mockup-overlay.svelte-ya3gmp{left:0;position:absolute;top:0}.mockup-overlay.svelte-ya3gmp{backface-visibility:hidden;max-width:none;transform-origin:top left;-webkit-user-select:none;user-select:none;will-change:transform;-webkit-touch-callout:none}`};function Bc(e,t){Ge(t,!0),ni(e,zc);let n=I(Jt({x:window.scrollX,y:window.scrollY}));Gr(()=>{let e=is(e=>Z.setPageSize(e)),t=()=>{L(n,{x:window.scrollX,y:window.scrollY},!0)};t();let r=W(window,`scroll`,t,{passive:!0});return()=>{e(),r()}});let r=P(()=>Q.mode===`toolbar`),i={dragging:`grabbing`,solid:`zoom-in`,zoomed:`zoom-out`,visible:`grab`,locked:`default`},a=P(()=>U(r)?i[Z.mode]:`default`),o=P(()=>U(r)&&Z.mode!==`locked`?`auto`:`none`),s=P(()=>`translate3d(${Z.position.x}px, ${Z.position.y}px, 0) scale(${Z.scale})`),c=P(()=>Z.mode===`locked`?`pan-x pan-y`:`none`),l=P(()=>Z.isDragging||Z.isZoomPanning||Z.mode===`solid`?`none`:`transform 0.2s ease-out`);var u=kr(),d=on(u),f=e=>{var t=Rc(),i=R(t);let u;var d=R(i);let f;ri(d,()=>Lc(Z,()=>U(r))),j(i),j(t),B(()=>{u=di(i,``,u,{width:`${Z.pageSize.width}px`,height:`${Z.pageSize.height}px`,transform:`translate3d(${-U(n).x}px, ${-U(n).y}px, 0)`}),Y(d,`src`,Z.activeMockupUrl),f=di(d,``,f,{transform:U(s),transition:U(l),cursor:U(a),"pointer-events":U(o),opacity:Z.effectiveOpacity,visibility:Z.mockupSize.width?void 0:`hidden`,"touch-action":U(c)})}),q(e,t)};J(d,e=>{!Z.isHidden&&Z.activeMockupUrl&&e(f)}),q(e,u),Ke()}Hi(Bc,{},[],[],{mode:`open`});var Vc=K(`<div class="toast svelte-1ig2a9j" role="alert" aria-live="assertive"><span class="toast__icon svelte-1ig2a9j"><!></span> <span class="toast__message svelte-1ig2a9j"> </span></div>`),Hc={hash:`svelte-1ig2a9j`,code:`.toast.svelte-1ig2a9j{align-items:flex-start;animation:svelte-1ig2a9j-a .22s cubic-bezier(.4,0,.2,1);background:var(--pm-surface-elevated);border:1px solid var(--pm-border-strong);border-radius:var(--pm-radius-card);box-shadow:var(--pm-shadow-panel);color:var(--pm-text-primary);display:flex;font-family:var(--pm-font-sans);gap:10px;left:50%;max-width:calc(min(100vw - 24px,440px));padding:10px 16px 10px 12px;position:fixed;top:20px;transform:translateX(-50%);width:max-content;z-index:2147483647}.toast__icon.svelte-1ig2a9j{color:var(--pm-danger-text);flex:none;margin-top:1px}.toast__message.svelte-1ig2a9j{font-size:13px;font-weight:500;line-height:20px}@keyframes svelte-1ig2a9j-a{0%{opacity:0;transform:translateX(-50%) translateY(-10px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}`};function Uc(e,t){Ge(t,!0),ni(e,Hc);let n=I(!1);function r(){L(n,!1),jo.clear()}yn(()=>{if(jo.errorMessage)return W(window,`mousedown`,r)}),yn(()=>{if(!jo.errorMessage||U(n))return;let e=setTimeout(r,4500);return()=>clearTimeout(e)});var i=kr(),a=on(i),o=e=>{var t=Vc(),r=R(t);Gs(R(r),{name:`alert`,size:18}),j(r);var i=sn(z(r,2),!0);j(t),B(()=>Lr(i,jo.errorMessage)),vr(`mouseenter`,t,()=>L(n,!0)),vr(`mouseleave`,t,()=>L(n,!1)),q(e,t)};J(a,e=>{jo.errorMessage&&e(o)}),q(e,i),Ke()}Hi(Uc,{},[],[],{mode:`open`});function Wc({delay:e=300,tolerance:t=10,scrollCooldown:n=150}={}){let r=-1/0,i={x:0,y:0},a=-1/0,o=null;function s(){o=null,r=-1/0}let c=(e,t)=>Math.abs(t.x-e.x)>5||Math.abs(t.y-e.y)>5;return{start(e,t){o={position:e,time:t}},move(e){o&&c(o.position,e)&&s()},end(l,u){let d=o;if(o=null,!d||u-d.time>=e||c(d.position,l))return s(),!1;if(u-a<n)return r=-1/0,!1;let f=u-r<e&&Math.abs(l.x-i.x)<t&&Math.abs(l.y-i.y)<t;return r=f?-1/0:u,i=l,f},cancel:s,scrolled(e){a=e,s()}}}var Gc=K(`<div><!> <!> <!> <!> <!></div>`),Kc={hash:`svelte-1n46o8q`,code:`:host{all:initial!important;direction:ltr!important;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif!important}.theme-root.svelte-1n46o8q{--pm-font-sans:ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;--pm-font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;--pm-surface-primary:hsla(0,0%,100%,.9);--pm-surface-elevated:#fff;--pm-surface-subtle:#f5f5f7;--pm-surface-hover:rgba(24,24,27,.05);--pm-surface-active:rgba(24,24,27,.08);--pm-backdrop-blur:blur(20px) saturate(180%);--pm-border-subtle:rgba(24,24,27,.06);--pm-border-strong:rgba(24,24,27,.12);--pm-border-control:#8a8a92;--pm-text-primary:#18181b;--pm-text-secondary:#52525b;--pm-text-muted:#71717a;--pm-accent:#18181b;--pm-accent-hover:#3f3f46;--pm-accent-fg:#fff;--pm-accent-subtle:rgba(24,24,27,.1);--pm-accent-text:#18181b;--pm-focus-ring:#18181b;--pm-danger:#dc2626;--pm-danger-hover:#b91c1c;--pm-select-arrow:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2352525b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");--pm-danger-text:#b91c1c;--pm-switch-off:#d4d4d8;--pm-shadow-hud:0 1px 2px rgba(0,0,0,.06), 0 8px 24px -4px rgba(0,0,0,.14);--pm-shadow-panel:0 2px 6px rgba(0,0,0,.05), 0 20px 48px -8px rgba(0,0,0,.2);--pm-radius-pill:9999px;--pm-radius-panel:16px;--pm-radius-card:12px;--pm-radius-control:8px;--pm-button-bg:var(--pm-accent);--pm-button-fg:var(--pm-accent-fg);--pm-button-hover-bg:var(--pm-accent-hover);--pm-button-disabled-bg:#a1a1aa;--pm-mockup-border:rgba(24,24,27,.1);--pm-mockup-border-hover:rgba(24,24,27,.24);color-scheme:light}.theme-root.dark.svelte-1n46o8q{--pm-surface-primary:rgba(28,28,32,.9);--pm-surface-elevated:#1c1c20;--pm-surface-subtle:#232328;--pm-surface-hover:hsla(0,0%,100%,.06);--pm-surface-active:hsla(0,0%,100%,.1);--pm-border-subtle:hsla(0,0%,100%,.06);--pm-border-strong:hsla(0,0%,100%,.12);--pm-border-control:#71717a;--pm-text-primary:#f4f4f5;--pm-text-secondary:#a1a1aa;--pm-text-muted:#93939b;--pm-accent:#f4f4f5;--pm-accent-hover:#d4d4d8;--pm-accent-fg:#18181b;--pm-accent-subtle:hsla(0,0%,100%,.12);--pm-accent-text:#fafafa;--pm-focus-ring:#f4f4f5;--pm-danger-text:#f87171;--pm-select-arrow:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");--pm-switch-off:#3f3f46;--pm-shadow-hud:0 1px 2px rgba(0,0,0,.3), 0 10px 30px -4px rgba(0,0,0,.5);--pm-shadow-panel:0 2px 8px rgba(0,0,0,.3), 0 24px 56px -8px rgba(0,0,0,.6);--pm-button-disabled-bg:#3f3f46;--pm-mockup-border:hsla(0,0%,100%,.1);--pm-mockup-border-hover:hsla(0,0%,100%,.24);color-scheme:dark} *{box-sizing:border-box} button{background:none;border:none;color:inherit;cursor:pointer;font:inherit;margin:0;outline:none;padding:0;-webkit-tap-highlight-color:transparent} button:disabled{cursor:default} button:not(:disabled):active{transform:scale(.96)} svg{color:currentColor;display:block;fill:none}@media(prefers-reduced-motion:reduce){ *, :after, :before{animation:none!important;transition:none!important}}`};function qc(e,t){Ge(t,!0),ni(e,Kc),Gr(Ls);let n=Wc();function r(e){if(Q.isManagerMode||e.touches.length!==1)return n.cancel();let t=e.touches[0];n.start({x:t.clientX,y:t.clientY},Date.now())}function i(e){if(e.touches.length!==1)return n.cancel();let t=e.touches[0];n.move({x:t.clientX,y:t.clientY})}function a(e){if(Q.isManagerMode||e.touches.length!==0)return n.cancel();let t=e.changedTouches[0];n.end({x:t.clientX,y:t.clientY},Date.now())&&(e.preventDefault(),Z.toggleMobileSolidMode())}let o=0,s=I(!1);function c(e){if(!e.dataTransfer?.types.includes(`Files`))return!1;let t=e.composedPath()[0];return!(t instanceof HTMLInputElement&&t.type===`file`)}function l(e){c(e)&&(o++,o===1&&L(s,!0))}function u(e){c(e)&&(o--,o===0&&L(s,!1))}function d(e){c(e)&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`))}function f(e){if(L(s,!1),o=0,!c(e)||e.defaultPrevented)return;e.preventDefault();let t=Array.from(e.dataTransfer?.files||[]).filter(e=>ta.includes(e.type));t.length>0&&X.uploadAndActivate(t)}yn(()=>{let e=[W(document,`dragenter`,l),W(document,`dragleave`,u),W(document,`dragover`,d),W(document,`drop`,f)];return()=>e.forEach(e=>e())}),yn(()=>{if(!Ms()||Z.isHidden||!Z.activeMockupUrl)return;let e=document.documentElement.style,t=e.getPropertyValue(`touch-action`),o=e.getPropertyPriority(`touch-action`);e.setProperty(`touch-action`,`pan-x pan-y`);let s=[W(document,`touchstart`,r,{passive:!0}),W(document,`touchmove`,i,{passive:!0}),W(document,`touchend`,a,{passive:!1}),W(document,`touchcancel`,n.cancel,{passive:!0}),W(window,`scroll`,()=>n.scrolled(Date.now()),{passive:!0})];return()=>{e.getPropertyValue(`touch-action`)===`pan-x pan-y`&&!e.getPropertyPriority(`touch-action`)&&e.setProperty(`touch-action`,t,o),n.cancel(),s.forEach(e=>e())}});var p=Gc();let m;var h=R(p);Pc(h,{});var g=z(h,2);Bc(g,{});var _=z(g,2);Tc(_,{});var v=z(_,2);Uc(v,{}),Oc(z(v,2),{get visible(){return U(s)}}),j(p),B(()=>m=li(p,1,`theme-root svelte-1n46o8q`,null,m,{dark:Q.theme===`dark`})),q(e,p),Ke()}Hi(qc,{},[],[],{mode:`open`});var Jc=`pixel-mirror`;function Yc(){customElements.get(Jc)||customElements.define(Jc,qc.element),document.querySelector(Jc)||document.body.appendChild(document.createElement(Jc))}document.body?Yc():document.addEventListener(`DOMContentLoaded`,Yc,{once:!0}),document.addEventListener(`astro:after-swap`,Yc)})();
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pixel-mirror",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Pixel Mirror helps developers achieve pixel-perfect UIs by easily overlaying design mockups.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": "Peiwen Lu",
|
|
5
7
|
"type": "module",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"dev": "vite",
|
|
10
|
+
"build": "vite build",
|
|
11
|
+
"preview": "vite preview",
|
|
12
|
+
"check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",
|
|
13
|
+
"lint": "eslint . && stylelint './src/**/*.svelte' && prettier --check .",
|
|
14
|
+
"lint:fix": "eslint --fix . && stylelint --fix './src/**/*.svelte' && prettier --write .",
|
|
15
|
+
"test": "vitest",
|
|
16
|
+
"test:run": "vitest run",
|
|
17
|
+
"test:coverage": "vitest run --coverage",
|
|
18
|
+
"prepublishOnly": "pnpm run build",
|
|
19
|
+
"prepare": "husky"
|
|
20
|
+
},
|
|
6
21
|
"exports": {
|
|
7
|
-
".":
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./index.d.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
},
|
|
8
26
|
"./vite": {
|
|
9
27
|
"types": "./plugins/vite.d.ts",
|
|
10
28
|
"default": "./plugins/vite.js"
|
|
@@ -14,63 +32,73 @@
|
|
|
14
32
|
"default": "./plugins/astro.js"
|
|
15
33
|
}
|
|
16
34
|
},
|
|
17
|
-
"keywords": [
|
|
18
|
-
"solid",
|
|
19
|
-
"vite",
|
|
20
|
-
"design"
|
|
21
|
-
],
|
|
22
|
-
"homepage": "https://github.com/p233-studio/pixel-mirror#readme",
|
|
23
|
-
"repository": {
|
|
24
|
-
"type": "git",
|
|
25
|
-
"url": "git+https://github.com/p233-studio/pixel-mirror.git"
|
|
26
|
-
},
|
|
27
|
-
"bugs": {
|
|
28
|
-
"url": "https://github.com/p233-studio/pixel-mirror/issues"
|
|
29
|
-
},
|
|
30
|
-
"license": "Apache-2.0",
|
|
31
|
-
"author": "Peiwen Lu",
|
|
32
35
|
"devDependencies": {
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
36
|
+
"@eslint/js": "^10.0.1",
|
|
37
|
+
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
38
|
+
"@testing-library/dom": "^10.4.2",
|
|
39
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
40
|
+
"@testing-library/svelte": "^5.4.2",
|
|
41
|
+
"@tsconfig/svelte": "^5.0.8",
|
|
42
|
+
"@types/node": "^26.6.5",
|
|
43
|
+
"@vitest/coverage-v8": "^5.0.4",
|
|
44
|
+
"cssnano": "^9.8.0",
|
|
45
|
+
"cssnano-preset-advanced": "^9.7.0",
|
|
46
|
+
"eslint": "^10.12.0",
|
|
47
|
+
"eslint-config-prettier": "^10.1.8",
|
|
48
|
+
"eslint-plugin-svelte": "^3.23.1",
|
|
49
|
+
"fake-indexeddb": "^6.2.5",
|
|
50
|
+
"globals": "^17.13.0",
|
|
40
51
|
"husky": "^9.1.7",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"stylelint
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
52
|
+
"idb": "^8.0.4",
|
|
53
|
+
"jsdom": "^30.1.2",
|
|
54
|
+
"lint-staged": "^17.6.0",
|
|
55
|
+
"postcss-html": "^2.0.0",
|
|
56
|
+
"prettier": "^3.9.10",
|
|
57
|
+
"prettier-plugin-svelte": "^4.1.1",
|
|
58
|
+
"sass": "^1.105.1",
|
|
59
|
+
"stylelint": "^17.16.0",
|
|
60
|
+
"stylelint-config-html": "^2.0.0",
|
|
61
|
+
"stylelint-config-recess-order": "^7.8.0",
|
|
62
|
+
"stylelint-prettier": "^5.0.3",
|
|
63
|
+
"svelte": "^5.57.2",
|
|
64
|
+
"svelte-check": "^4.7.6",
|
|
65
|
+
"typescript": "~6.0.3",
|
|
66
|
+
"typescript-eslint": "^8.71.2",
|
|
67
|
+
"vite": "^8.3.4",
|
|
68
|
+
"vitest": "^5.0.4"
|
|
54
69
|
},
|
|
55
70
|
"lint-staged": {
|
|
56
|
-
"*.{ts,
|
|
57
|
-
"eslint --fix
|
|
58
|
-
|
|
59
|
-
"*.scss": [
|
|
60
|
-
"stylelint --fix"
|
|
71
|
+
"*.{js,ts,svelte}": [
|
|
72
|
+
"eslint --fix",
|
|
73
|
+
"prettier --write"
|
|
61
74
|
],
|
|
62
|
-
"
|
|
75
|
+
"*.{json,md,html}": [
|
|
63
76
|
"prettier --write"
|
|
64
77
|
]
|
|
65
78
|
},
|
|
66
79
|
"files": [
|
|
80
|
+
"index.d.ts",
|
|
67
81
|
"dist",
|
|
68
|
-
"plugins"
|
|
82
|
+
"plugins",
|
|
83
|
+
"THIRD_PARTY_NOTICES.md"
|
|
69
84
|
],
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
85
|
+
"keywords": [
|
|
86
|
+
"vite",
|
|
87
|
+
"design",
|
|
88
|
+
"pixel-perfect",
|
|
89
|
+
"ui-overlay",
|
|
90
|
+
"mockup",
|
|
91
|
+
"frontend-tool",
|
|
92
|
+
"svelte",
|
|
93
|
+
"developer-tools"
|
|
94
|
+
],
|
|
95
|
+
"homepage": "https://github.com/p233-studio/pixel-mirror#readme",
|
|
96
|
+
"repository": {
|
|
97
|
+
"type": "git",
|
|
98
|
+
"url": "git+https://github.com/p233-studio/pixel-mirror.git"
|
|
99
|
+
},
|
|
100
|
+
"bugs": {
|
|
101
|
+
"url": "https://github.com/p233-studio/pixel-mirror/issues"
|
|
102
|
+
},
|
|
103
|
+
"types": "./index.d.ts"
|
|
104
|
+
}
|
package/plugins/astro.js
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
|
+
import vitePlugin from "./vite.js";
|
|
2
|
+
import { scriptUrl } from "./script-url.js";
|
|
3
|
+
|
|
1
4
|
export default function pixelMirror() {
|
|
2
5
|
return {
|
|
3
6
|
name: "pixel-mirror",
|
|
4
7
|
hooks: {
|
|
5
|
-
"astro:config:setup": ({ command, injectScript }) => {
|
|
6
|
-
if (command
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
"astro:config:setup": ({ config, command, injectScript, updateConfig }) => {
|
|
9
|
+
if (command !== "dev") return;
|
|
10
|
+
|
|
11
|
+
// Reuse the Vite plugin's middleware to serve the bundle, then load it like a deferred script
|
|
12
|
+
updateConfig({ vite: { plugins: [vitePlugin()] } });
|
|
13
|
+
injectScript(
|
|
14
|
+
"head-inline",
|
|
15
|
+
`(() => {
|
|
16
|
+
const script = document.createElement("script");
|
|
17
|
+
script.src = ${JSON.stringify(scriptUrl(config.base))};
|
|
18
|
+
document.head.appendChild(script);
|
|
19
|
+
})();`
|
|
20
|
+
);
|
|
15
21
|
}
|
|
16
22
|
}
|
|
17
23
|
};
|
package/plugins/vite.js
CHANGED
|
@@ -1,11 +1,32 @@
|
|
|
1
|
+
import { createReadStream } from "node:fs";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { scriptUrl } from "./script-url.js";
|
|
4
|
+
|
|
5
|
+
// Served by the dev server itself, so the URL works wherever the package is installed
|
|
6
|
+
// (hoisted monorepos, pnpm stores, linked packages) and regardless of `server.fs.allow`
|
|
7
|
+
const SCRIPT_FILE = fileURLToPath(new URL("../dist/index.js", import.meta.url));
|
|
8
|
+
|
|
1
9
|
export default function pixelMirror() {
|
|
2
10
|
return {
|
|
3
11
|
name: "pixel-mirror",
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
apply: "serve",
|
|
13
|
+
configureServer(server) {
|
|
14
|
+
server.middlewares.use(scriptUrl(server.config.base), (_req, res) => {
|
|
15
|
+
createReadStream(SCRIPT_FILE)
|
|
16
|
+
.on("open", () => {
|
|
17
|
+
res.setHeader("Content-Type", "text/javascript; charset=utf-8");
|
|
18
|
+
res.setHeader("Cache-Control", "no-cache");
|
|
19
|
+
})
|
|
20
|
+
.on("error", () => {
|
|
21
|
+
res.statusCode = 404;
|
|
22
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
23
|
+
res.end(`pixel-mirror: ${SCRIPT_FILE} not found. Run the package build first.`);
|
|
24
|
+
})
|
|
25
|
+
.pipe(res);
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
transformIndexHtml(_html, context) {
|
|
29
|
+
return [{ tag: "script", attrs: { src: scriptUrl(context.server.config.base), defer: true }, injectTo: "head" }];
|
|
9
30
|
}
|
|
10
31
|
};
|
|
11
32
|
}
|