pixel-mirror 1.0.4 → 2.0.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 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 [yyyy] [name of copyright owner]
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
@@ -2,82 +2,110 @@
2
2
 
3
3
  ![screenshot](./docs/app.png)
4
4
 
5
- Pixel Mirror is a lightweight tool for front-end developers that overlays design mockups on web pages. With features like adjustable transparency, scaling, alignment, and grid guides, it helps developers achieve pixel-perfect accuracy when implementing UI designs.
5
+ Overlay design mockups on web pages for pixel-perfect UI implementation. Features adjustable transparency, scaling, alignment, and grid guides.
6
6
 
7
- ## Installation
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
14
+
15
+ ## Overlay Modes
16
+
17
+ The mockup overlay has 5 modes:
18
+
19
+ | Mode | Description |
20
+ | ------------ | ----------------------------------------------------------------------------- |
21
+ | **Visible** | Default. Drag, adjust opacity/scale/alignment. |
22
+ | **Locked** | Position frozen, no interaction except unlock. |
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 (desktop only). Click in solid mode to enter. |
8
26
 
9
- ### 1. For [Vite](https://vite.dev/) projects
27
+ ## Usage
28
+
29
+ ### Desktop
30
+
31
+ | Action | Shortcut |
32
+ | ------------------------------- | --------------------------------------- |
33
+ | Show / Hide mockup | Toolbar button |
34
+ | Lock / Unlock position | `Escape` or toolbar button |
35
+ | Adjust opacity | `Ctrl + Scroll` (click button to reset) |
36
+ | Drag mockup | Mouse drag on overlay |
37
+ | Nudge mockup (1px) | Arrow keys |
38
+ | Nudge mockup (10px) | `Shift` + Arrow keys |
39
+ | Enter solid mode (100% opacity) | Hold `Space` |
40
+ | Zoom (2x) in solid mode | Click |
41
+ | Pan in zoomed mode | Move mouse |
42
+ | Cycle scale (1x / 0.5x) | Toolbar button |
43
+
44
+ ### Mobile / Touch
45
+
46
+ | Action | Gesture |
47
+ | ------------------------ | ---------------------------------- |
48
+ | Show / Hide mockup | Toolbar button |
49
+ | Lock / Unlock position | Toolbar button |
50
+ | Adjust opacity | Horizontal slide on opacity button |
51
+ | Drag mockup | Touch drag on overlay |
52
+ | Toggle solid mode | Double-tap anywhere |
53
+ | Pinch zoom in solid mode | Two-finger pinch (0.25x–4x) |
54
+ | Pan in solid mode | Single finger drag |
55
+ | Cycle scale (1x / 0.5x) | Toolbar button |
10
56
 
11
- Install the package via npm:
57
+ ## Installation
12
58
 
13
59
  ```bash
14
60
  npm install pixel-mirror --save-dev
15
61
  ```
16
62
 
17
- Then, add Pixel Mirror's Vite plugin to your `vite.config.js`:
63
+ ### Vite
18
64
 
19
65
  ```js
20
- import { defineConfig } from "vite";
66
+ // vite.config.js
21
67
  import pixelMirror from "pixel-mirror/vite";
22
68
 
23
69
  export default defineConfig({
24
- plugins: [pixelMirror()],
25
- // ... other configurations
70
+ plugins: [pixelMirror()]
26
71
  });
27
72
  ```
28
73
 
29
- The plugin is automatically injected into your HTML during development and will be removed in production builds.
30
-
31
- ### 2. For [Astro](https://astro.build/) projects
32
-
33
- Install the package via npm:
34
-
35
- ```bash
36
- npm install pixel-mirror --save-dev
37
- ```
38
-
39
- Then, add Pixel Mirror's Astro Integration to your `astro.config.mjs`:
74
+ ### Astro
40
75
 
41
76
  ```js
42
- import { defineConfig } from "astro/config";
77
+ // astro.config.mjs
43
78
  import pixelMirror from "pixel-mirror/astro";
44
79
 
45
80
  export default defineConfig({
46
- integrations: [pixelMirror()],
47
- // ... other configurations
81
+ integrations: [pixelMirror()]
48
82
  });
49
83
  ```
50
84
 
51
- ### 3. For [Next.js](https://nextjs.org/) projects
85
+ ### Next.js
52
86
 
53
- Inject the following code to the `<Head></Head>` section in `_document.jsx`:
54
-
55
- ``` jsx
56
- // import Script from "next/script"
57
-
58
- {process.env.NODE_ENV === "development" && (
59
- <Script
60
- src="https://cdn.jsdelivr.net/npm/pixel-mirror/dist/index.js"
61
- strategy="afterInteractive"
62
- />
63
- )}
87
+ ```jsx
88
+ // _document.jsx <Head>
89
+ {
90
+ process.env.NODE_ENV === "development" && (
91
+ <Script src="https://cdn.jsdelivr.net/npm/pixel-mirror/dist/index.js" strategy="afterInteractive" />
92
+ );
93
+ }
64
94
  ```
65
95
 
66
- ### 4. For other projects
96
+ ### CDN
67
97
 
68
- Integrate Pixel Mirror by injecting its script into your HTML:
69
-
70
- ``` html
98
+ ```html
71
99
  <script defer src="https://cdn.jsdelivr.net/npm/pixel-mirror/dist/index.js"></script>
72
100
  ```
73
101
 
74
- This allows you to use Pixel Mirror out of the box without additional setup. Remember to remove the script in the production environment.
102
+ Remove in production.
75
103
 
76
- ## Usage
104
+ ## Note
77
105
 
78
- _Before using this tool, please note that it sets the `position` of the `:root` element to `relative`. This ensures overlays work correctly with minimal impact on the host project. Be sure to verify compatibility with your project before proceeding._
106
+ This tool sets an inline `position: relative` style on the `<html>` element for overlay positioning. This may affect layouts that depend on the default `static` positioning of `<html>`.
79
107
 
80
- For an interactive usage example, please refer to https://peiwen.lu/posts/pixel-mirror.
108
+ 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.
81
109
 
82
110
  ## Credits
83
111
 
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(){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const $s=1,Es=2,yi=4,Ss=8,Ms=16,As=1,Ls=2,wi=4,Cs=8,Ts=1,Os=2,mi="[",Vr="[!",En="]",Lt={},ge=Symbol(),Gs="http://www.w3.org/1999/xhtml",Ps="@attach",Sn=!1;var Mn=Array.isArray,Ds=Array.prototype.indexOf,Wt=Array.prototype.includes,Xr=Array.from,Wr=Object.keys,qr=Object.defineProperty,qt=Object.getOwnPropertyDescriptor,ki=Object.getOwnPropertyDescriptors,Is=Object.prototype,js=Array.prototype,An=Object.getPrototypeOf,xi=Object.isExtensible;function Rs(e){for(var t=0;t<e.length;t++)e[t]()}function $i(){var e,t,r=new Promise((n,i)=>{e=n,t=i});return{promise:r,resolve:e,reject:t}}const me=2,Zr=4,Kr=8,Ln=1<<24,st=16,We=32,pt=64,Cn=128,Ne=512,_e=1024,xe=2048,at=4096,Oe=8192,lt=16384,Jr=32768,Zt=65536,Ei=1<<17,Si=1<<18,Ct=1<<19,zs=1<<20,ct=1<<25,Tt=32768,Tn=1<<21,On=1<<22,gt=1<<23,_t=Symbol("$state"),Ns=Symbol("legacy props"),Fs=Symbol(""),Kt=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Qr=3,Ot=8;function Mi(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Bs(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Us(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Hs(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ys(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Vs(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Xs(){throw new Error("https://svelte.dev/e/hydration_failed")}function Ws(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function qs(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Zs(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Ks(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function gr(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Js(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Qs(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let R=!1;function qe(e){R=e}let F;function $e(e){if(e===null)throw gr(),Lt;return F=e}function Jt(){return $e(Je(F))}function y(e){if(R){if(Je(F)!==null)throw gr(),Lt;F=e}}function ea(e=1){if(R){for(var t=e,r=F;t--;)r=Je(r);F=r}}function en(e=!0){for(var t=0,r=F;;){if(r.nodeType===Ot){var n=r.data;if(n===En){if(t===0)return r;t-=1}else(n===mi||n===Vr)&&(t+=1)}var i=Je(r);e&&r.remove(),r=i}}function Ai(e){if(!e||e.nodeType!==Ot)throw gr(),Lt;return e.data}function Li(e){return e===this.v}function Ci(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Ti(e){return!Ci(e,this.v)}let Qt=!1,ta=!1;function ra(){Qt=!0}let le=null;function er(e){le=e}function bt(e,t=!1,r){le={p:le,i:!1,c:null,e:null,s:e,x:null,l:Qt&&!t?{s:null,u:null,$:[]}:null}}function yt(e){var t=le,r=t.e;if(r!==null){t.e=null;for(var n of r)oo(n)}return t.i=!0,le=t.p,{}}function _r(){return!Qt||le!==null&&le.l===null}let Gt=[];function Oi(){var e=Gt;Gt=[],Rs(e)}function Ze(e){if(Gt.length===0&&!br){var t=Gt;queueMicrotask(()=>{t===Gt&&Oi()})}Gt.push(e)}function na(){for(;Gt.length>0;)Oi()}function Gi(e){var t=B;if(t===null)return U.f|=gt,e;if((t.f&Jr)===0){if((t.f&Cn)===0)throw e;t.b.error(e)}else tr(e,t)}function tr(e,t){for(;t!==null;){if((t.f&Cn)!==0)try{t.b.error(e);return}catch(r){e=r}t=t.parent}throw e}const ia=-7169;function he(e,t){e.f=e.f&ia|t}function Gn(e){(e.f&Ne)!==0||e.deps===null?he(e,_e):he(e,at)}function Pi(e){if(e!==null)for(const t of e)(t.f&me)===0||(t.f&Tt)===0||(t.f^=Tt,Pi(t.deps))}function Di(e,t,r){(e.f&xe)!==0?t.add(e):(e.f&at)!==0&&r.add(e),Pi(e.deps),he(e,_e)}const tn=new Set;let V=null,rn=null,Ke=null,Ge=[],nn=null,Pn=!1,br=!1;class ut{committed=!1;current=new Map;previous=new Map;#e=new Set;#t=new Set;#r=0;#o=0;#s=null;#i=new Set;#n=new Set;skipped_effects=new Set;is_fork=!1;#a=!1;is_deferred(){return this.is_fork||this.#o>0}process(t){Ge=[],this.apply();var r=[],n=[];for(const i of t)this.#l(i,r,n);if(this.is_deferred()){this.#c(n),this.#c(r);for(const i of this.skipped_effects)Fi(i)}else{for(const i of this.#e)i();this.#e.clear(),this.#r===0&&this.#u(),rn=this,V=null,Ri(n),Ri(r),rn=null,this.#s?.resolve()}Ke=null}#l(t,r,n){t.f^=_e;for(var i=t.first,o=null;i!==null;){var a=i.f,c=(a&(We|pt))!==0,l=c&&(a&_e)!==0,d=l||(a&Oe)!==0||this.skipped_effects.has(i);if(!d&&i.fn!==null){c?i.f^=_e:o!==null&&(a&(Zr|Kr|Ln))!==0?o.b.defer_effect(i):(a&Zr)!==0?r.push(i):mr(i)&&((a&st)!==0&&this.#n.add(i),kr(i));var v=i.first;if(v!==null){i=v;continue}}var h=i.parent;for(i=i.next;i===null&&h!==null;)h===o&&(o=null),i=h.next,h=h.parent}}#c(t){for(var r=0;r<t.length;r+=1)Di(t[r],this.#i,this.#n)}capture(t,r){r!==ge&&!this.previous.has(t)&&this.previous.set(t,r),(t.f&gt)===0&&(this.current.set(t,t.v),Ke?.set(t,t.v))}activate(){V=this,this.apply()}deactivate(){V===this&&(V=null,Ke=null)}flush(){if(this.activate(),Ge.length>0){if(ji(),V!==null&&V!==this)return}else this.#r===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#t)t(this);this.#t.clear()}#u(){if(tn.size>1){this.previous.clear();var t=Ke,r=!0;for(const i of tn){if(i===this){r=!1;continue}const o=[];for(const[c,l]of this.current){if(i.current.has(c))if(r&&l!==i.current.get(c))i.current.set(c,l);else continue;o.push(c)}if(o.length===0)continue;const a=[...i.current.keys()].filter(c=>!this.current.has(c));if(a.length>0){var n=Ge;Ge=[];const c=new Set,l=new Map;for(const d of o)zi(d,a,c,l);if(Ge.length>0){V=i,i.apply();for(const d of Ge)i.#l(d,[],[]);i.deactivate()}Ge=n}}V=null,Ke=t}this.committed=!0,tn.delete(this)}increment(t){this.#r+=1,t&&(this.#o+=1)}decrement(t){this.#r-=1,t&&(this.#o-=1),!this.#a&&(this.#a=!0,Ze(()=>{this.#a=!1,this.is_deferred()?Ge.length>0&&this.flush():this.revive()}))}revive(){for(const t of this.#i)this.#n.delete(t),he(t,xe),ft(t);for(const t of this.#n)he(t,at),ft(t);this.flush()}oncommit(t){this.#e.add(t)}ondiscard(t){this.#t.add(t)}settled(){return(this.#s??=$i()).promise}static ensure(){if(V===null){const t=V=new ut;tn.add(V),br||Ze(()=>{V===t&&t.flush()})}return V}apply(){}}function Ii(e){var t=br;br=!0;try{for(var r;;){if(na(),Ge.length===0&&(V?.flush(),Ge.length===0))return nn=null,r;ji()}}finally{br=t}}function ji(){Pn=!0;var e=null;try{for(var t=0;Ge.length>0;){var r=ut.ensure();if(t++>1e3){var n,i;oa()}r.process(Ge),wt.clear()}}finally{Pn=!1,nn=null}}function oa(){try{Vs()}catch(e){tr(e,nn)}}let dt=null;function Ri(e){var t=e.length;if(t!==0){for(var r=0;r<t;){var n=e[r++];if((n.f&(lt|Oe))===0&&mr(n)&&(dt=new Set,kr(n),n.deps===null&&n.first===null&&n.nodes===null&&(n.teardown===null&&n.ac===null?uo(n):n.fn=null),dt?.size>0)){wt.clear();for(const i of dt){if((i.f&(lt|Oe))!==0)continue;const o=[i];let a=i.parent;for(;a!==null;)dt.has(a)&&(dt.delete(a),o.push(a)),a=a.parent;for(let c=o.length-1;c>=0;c--){const l=o[c];(l.f&(lt|Oe))===0&&kr(l)}}dt.clear()}}dt=null}}function zi(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const i of e.reactions){const o=i.f;(o&me)!==0?zi(i,t,r,n):(o&(On|st))!==0&&(o&xe)===0&&Ni(i,t,n)&&(he(i,xe),ft(i))}}function Ni(e,t,r){const n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(const i of e.deps){if(Wt.call(t,i))return!0;if((i.f&me)!==0&&Ni(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function ft(e){for(var t=nn=e;t.parent!==null;){t=t.parent;var r=t.f;if(Pn&&t===B&&(r&st)!==0&&(r&Si)===0)return;if((r&(pt|We))!==0){if((r&_e)===0)return;t.f^=_e}}Ge.push(t)}function Fi(e){if(!((e.f&We)!==0&&(e.f&_e)!==0)){he(e,_e);for(var t=e.first;t!==null;)Fi(t),t=t.next}}function sa(e){let t=0,r=mt(0),n;return()=>{Fn()&&(s(r),wr(()=>(t===0&&(n=ir(()=>e(()=>yr(r)))),t+=1,()=>{Ze(()=>{t-=1,t===0&&(n?.(),n=void 0,yr(r))})})))}}var aa=Zt|Ct|Cn;function la(e,t,r){new ca(e,t,r)}class ca{parent;is_pending=!1;#e;#t=R?F:null;#r;#o;#s;#i=null;#n=null;#a=null;#l=null;#c=null;#u=0;#d=0;#h=!1;#v=!1;#p=new Set;#g=new Set;#f=null;#m=sa(()=>(this.#f=mt(this.#u),()=>{this.#f=null}));constructor(t,r,n){this.#e=t,this.#r=r,this.#o=n,this.parent=B.b,this.is_pending=!!this.#r.pending,this.#s=Un(()=>{if(B.b=this,R){const o=this.#t;Jt(),o.nodeType===Ot&&o.data===Vr?this.#x():(this.#k(),this.#d===0&&(this.is_pending=!1))}else{var i=this.#y();try{this.#i=Le(()=>n(i))}catch(o){this.error(o)}this.#d>0?this.#b():this.is_pending=!1}return()=>{this.#c?.remove()}},aa),R&&(this.#e=F)}#k(){try{this.#i=Le(()=>this.#o(this.#e))}catch(t){this.error(t)}}#x(){const t=this.#r.pending;t&&(this.#n=Le(()=>t(this.#e)),Ze(()=>{var r=this.#y();this.#i=this.#_(()=>(ut.ensure(),Le(()=>this.#o(r)))),this.#d>0?this.#b():(Dt(this.#n,()=>{this.#n=null}),this.is_pending=!1)}))}#y(){var t=this.#e;return this.is_pending&&(this.#c=Fe(),this.#e.before(this.#c),t=this.#c),t}defer_effect(t){Di(t,this.#p,this.#g)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#r.pending}#_(t){var r=B,n=U,i=le;Ue(this.#s),Be(this.#s),er(this.#s.ctx);try{return t()}catch(o){return Gi(o),null}finally{Ue(r),Be(n),er(i)}}#b(){const t=this.#r.pending;this.#i!==null&&(this.#l=document.createDocumentFragment(),this.#l.append(this.#c),ho(this.#i,this.#l)),this.#n===null&&(this.#n=Le(()=>t(this.#e)))}#w(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#w(t);return}if(this.#d+=t,this.#d===0){this.is_pending=!1;for(const r of this.#p)he(r,xe),ft(r);for(const r of this.#g)he(r,at),ft(r);this.#p.clear(),this.#g.clear(),this.#n&&Dt(this.#n,()=>{this.#n=null}),this.#l&&(this.#e.before(this.#l),this.#l=null)}}update_pending_count(t){this.#w(t),this.#u+=t,!(!this.#f||this.#h)&&(this.#h=!0,Ze(()=>{this.#h=!1,this.#f&&rr(this.#f,this.#u)}))}get_effect_pending(){return this.#m(),s(this.#f)}error(t){var r=this.#r.onerror;let n=this.#r.failed;if(this.#v||!r&&!n)throw t;this.#i&&(be(this.#i),this.#i=null),this.#n&&(be(this.#n),this.#n=null),this.#a&&(be(this.#a),this.#a=null),R&&($e(this.#t),ea(),$e(en()));var i=!1,o=!1;const a=()=>{if(i){Qs();return}i=!0,o&&Ks(),ut.ensure(),this.#u=0,this.#a!==null&&Dt(this.#a,()=>{this.#a=null}),this.is_pending=this.has_pending_snippet(),this.#i=this.#_(()=>(this.#v=!1,Le(()=>this.#o(this.#e)))),this.#d>0?this.#b():this.is_pending=!1};Ze(()=>{try{o=!0,r?.(t,a),o=!1}catch(c){tr(c,this.#s&&this.#s.parent)}n&&(this.#a=this.#_(()=>{ut.ensure(),this.#v=!0;try{return Le(()=>{n(this.#e,()=>t,()=>a)})}catch(c){return tr(c,this.#s.parent),null}finally{this.#v=!1}}))})}}function Bi(e,t,r,n){const i=_r()?on:In;var o=e.filter(u=>!u.settled);if(r.length===0&&o.length===0){n(t.map(i));return}var a=V,c=B,l=ua(),d=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(u=>u.promise)):null;function v(u){l();try{n(u)}catch(g){(c.f&lt)===0&&tr(g,c)}a?.deactivate(),Dn()}if(r.length===0){d.then(()=>v(t.map(i)));return}function h(){l(),Promise.all(r.map(u=>da(u))).then(u=>v([...t.map(i),...u])).catch(u=>tr(u,c))}d?d.then(h):h()}function ua(){var e=B,t=U,r=le,n=V;return function(o=!0){Ue(e),Be(t),er(r),o&&n?.activate()}}function Dn(){Ue(null),Be(null),er(null)}function on(e){var t=me|xe,r=U!==null&&(U.f&me)!==0?U:null;return B!==null&&(B.f|=Ct),{ctx:le,deps:null,effects:null,equals:Li,f:t,fn:e,reactions:null,rv:0,v:ge,wv:0,parent:r??B,ac:null}}function da(e,t,r){let n=B;n===null&&Bs();var i=n.b,o=void 0,a=mt(ge),c=!U,l=new Map;return wa(()=>{var d=$i();o=d.promise;try{Promise.resolve(e()).then(d.resolve,d.reject).then(()=>{v===V&&v.committed&&v.deactivate(),Dn()})}catch(g){d.reject(g),Dn()}var v=V;if(c){var h=i.is_rendered();i.update_pending_count(1),v.increment(h),l.get(v)?.reject(Kt),l.delete(v),l.set(v,d)}const u=(g,_=void 0)=>{if(v.activate(),_)_!==Kt&&(a.f|=gt,rr(a,_));else{(a.f&gt)!==0&&(a.f^=gt),rr(a,g);for(const[k,b]of l){if(l.delete(k),k===v)break;b.reject(Kt)}}c&&(i.update_pending_count(-1),v.decrement(h))};d.promise.then(u,g=>u(null,g||"unknown"))}),Bn(()=>{for(const d of l.values())d.reject(Kt)}),new Promise(d=>{function v(h){function u(){h===o?d(a):v(o)}h.then(u,u)}v(o)})}function se(e){const t=on(e);return go(t),t}function In(e){const t=on(e);return t.equals=Ti,t}function Ui(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)be(t[r])}}function fa(e){for(var t=e.parent;t!==null;){if((t.f&me)===0)return(t.f&lt)===0?t:null;t=t.parent}return null}function jn(e){var t,r=B;Ue(fa(e));try{e.f&=~Tt,Ui(e),t=mo(e)}finally{Ue(r)}return t}function Hi(e){var t=jn(e);if(!e.equals(t)&&(e.wv=yo(),(!V?.is_fork||e.deps===null)&&(e.v=t,e.deps===null))){he(e,_e);return}xt||(Ke!==null?(Fn()||V?.is_fork)&&Ke.set(e,t):Gn(e))}let Rn=new Set;const wt=new Map;let Yi=!1;function mt(e,t){var r={f:0,v:e,reactions:null,equals:Li,rv:0,wv:0};return r}function M(e,t){const r=mt(e);return go(r),r}function Vi(e,t=!1,r=!0){const n=mt(e);return t||(n.equals=Ti),Qt&&r&&le!==null&&le.l!==null&&(le.l.s??=[]).push(n),n}function f(e,t,r=!1){U!==null&&(!et||(U.f&Ei)!==0)&&_r()&&(U.f&(me|st|On|Ei))!==0&&(He===null||!Wt.call(He,e))&&Zs();let n=r?ce(t):t;return rr(e,n)}function rr(e,t){if(!e.equals(t)){var r=e.v;xt?wt.set(e,t):wt.set(e,r),e.v=t;var n=ut.ensure();if(n.capture(e,r),(e.f&me)!==0){const i=e;(e.f&xe)!==0&&jn(i),Gn(i)}e.wv=yo(),Wi(e,xe),_r()&&B!==null&&(B.f&_e)!==0&&(B.f&(We|pt))===0&&(Ye===null?ka([e]):Ye.push(e)),!n.is_fork&&Rn.size>0&&!Yi&&va()}return t}function va(){Yi=!1;for(const e of Rn)(e.f&_e)!==0&&he(e,at),mr(e)&&kr(e);Rn.clear()}function Xi(e,t=1){var r=s(e),n=t===1?r++:r--;return f(e,r),n}function yr(e){f(e,e.v+1)}function Wi(e,t){var r=e.reactions;if(r!==null)for(var n=_r(),i=r.length,o=0;o<i;o++){var a=r[o],c=a.f;if(!(!n&&a===B)){var l=(c&xe)===0;if(l&&he(a,t),(c&me)!==0){var d=a;Ke?.delete(d),(c&Tt)===0&&(c&Ne&&(a.f|=Tt),Wi(d,at))}else l&&((c&st)!==0&&dt!==null&&dt.add(a),ft(a))}}}function ce(e){if(typeof e!="object"||e===null||_t in e)return e;const t=An(e);if(t!==Is&&t!==js)return e;var r=new Map,n=Mn(e),i=M(0),o=jt,a=c=>{if(jt===o)return c();var l=U,d=jt;Be(null),bo(o);var v=c();return Be(l),bo(d),v};return n&&r.set("length",M(e.length)),new Proxy(e,{defineProperty(c,l,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&Ws();var v=r.get(l);return v===void 0?v=a(()=>{var h=M(d.value);return r.set(l,h),h}):f(v,d.value,!0),!0},deleteProperty(c,l){var d=r.get(l);if(d===void 0){if(l in c){const v=a(()=>M(ge));r.set(l,v),yr(i)}}else f(d,ge),yr(i);return!0},get(c,l,d){if(l===_t)return e;var v=r.get(l),h=l in c;if(v===void 0&&(!h||qt(c,l)?.writable)&&(v=a(()=>{var g=ce(h?c[l]:ge),_=M(g);return _}),r.set(l,v)),v!==void 0){var u=s(v);return u===ge?void 0:u}return Reflect.get(c,l,d)},getOwnPropertyDescriptor(c,l){var d=Reflect.getOwnPropertyDescriptor(c,l);if(d&&"value"in d){var v=r.get(l);v&&(d.value=s(v))}else if(d===void 0){var h=r.get(l),u=h?.v;if(h!==void 0&&u!==ge)return{enumerable:!0,configurable:!0,value:u,writable:!0}}return d},has(c,l){if(l===_t)return!0;var d=r.get(l),v=d!==void 0&&d.v!==ge||Reflect.has(c,l);if(d!==void 0||B!==null&&(!v||qt(c,l)?.writable)){d===void 0&&(d=a(()=>{var u=v?ce(c[l]):ge,g=M(u);return g}),r.set(l,d));var h=s(d);if(h===ge)return!1}return v},set(c,l,d,v){var h=r.get(l),u=l in c;if(n&&l==="length")for(var g=d;g<h.v;g+=1){var _=r.get(g+"");_!==void 0?f(_,ge):g in c&&(_=a(()=>M(ge)),r.set(g+"",_))}if(h===void 0)(!u||qt(c,l)?.writable)&&(h=a(()=>M(void 0)),f(h,ce(d)),r.set(l,h));else{u=h.v!==ge;var k=a(()=>ce(d));f(h,k)}var b=Reflect.getOwnPropertyDescriptor(c,l);if(b?.set&&b.set.call(v,d),!u){if(n&&typeof l=="string"){var $=r.get("length"),X=Number(l);Number.isInteger(X)&&X>=$.v&&f($,X+1)}yr(i)}return!0},ownKeys(c){s(i);var l=Reflect.ownKeys(c).filter(h=>{var u=r.get(h);return u===void 0||u.v!==ge});for(var[d,v]of r)v.v!==ge&&!(d in c)&&l.push(d);return l},setPrototypeOf(){qs()}})}function qi(e){try{if(e!==null&&typeof e=="object"&&_t in e)return e[_t]}catch{}return e}function ha(e,t){return Object.is(qi(e),qi(t))}var Zi,Ki,Ji,Qi;function zn(){if(Zi===void 0){Zi=window,Ki=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;Ji=qt(t,"firstChild").get,Qi=qt(t,"nextSibling").get,xi(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),xi(r)&&(r.__t=void 0)}}function Fe(e=""){return document.createTextNode(e)}function Pe(e){return Ji.call(e)}function Je(e){return Qi.call(e)}function w(e,t){if(!R)return Pe(e);var r=Pe(F);if(r===null)r=F.appendChild(Fe());else if(t&&r.nodeType!==Qr){var n=Fe();return r?.before(n),$e(n),n}return t&&Nn(r),$e(r),r}function kt(e,t=!1){if(!R){var r=Pe(e);return r instanceof Comment&&r.data===""?Je(r):r}if(t){if(F?.nodeType!==Qr){var n=Fe();return F?.before(n),$e(n),n}Nn(F)}return F}function A(e,t=1,r=!1){let n=R?F:e;for(var i;t--;)i=n,n=Je(n);if(!R)return n;if(r){if(n?.nodeType!==Qr){var o=Fe();return n===null?i?.after(o):n.before(o),$e(o),o}Nn(n)}return $e(n),n}function eo(e){e.textContent=""}function to(){return!1}function Nn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Qr;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function pa(e,t){if(t){const r=document.body;e.autofocus=!0,Ze(()=>{document.activeElement===r&&e.focus()})}}let ro=!1;function no(){ro||(ro=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function sn(e){var t=U,r=B;Be(null),Ue(null);try{return e()}finally{Be(t),Ue(r)}}function io(e,t,r,n=r){e.addEventListener(t,()=>sn(r));const i=e.__on_r;i?e.__on_r=()=>{i(),n(!0)}:e.__on_r=()=>n(!0),no()}function ga(e){B===null&&(U===null&&Ys(),Hs()),xt&&Us()}function _a(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function Qe(e,t,r){var n=B;n!==null&&(n.f&Oe)!==0&&(e|=Oe);var i={ctx:le,deps:null,nodes:null,f:e|xe|Ne,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(r)try{kr(i),i.f|=Jr}catch(c){throw be(i),c}else t!==null&&ft(i);var o=i;if(r&&o.deps===null&&o.teardown===null&&o.nodes===null&&o.first===o.last&&(o.f&Ct)===0&&(o=o.first,(e&st)!==0&&(e&Zt)!==0&&o!==null&&(o.f|=Zt)),o!==null&&(o.parent=n,n!==null&&_a(o,n),U!==null&&(U.f&me)!==0&&(e&pt)===0)){var a=U;(a.effects??=[]).push(o)}return i}function Fn(){return U!==null&&!et}function Bn(e){const t=Qe(Kr,null,!1);return he(t,_e),t.teardown=e,t}function Pt(e){ga();var t=B.f,r=!U&&(t&We)!==0&&(t&Jr)===0;if(r){var n=le;(n.e??=[]).push(e)}else return oo(e)}function oo(e){return Qe(Zr|zs,e,!1)}function ba(e){ut.ensure();const t=Qe(pt|Ct,e,!0);return()=>{be(t)}}function ya(e){ut.ensure();const t=Qe(pt|Ct,e,!0);return(r={})=>new Promise(n=>{r.outro?Dt(t,()=>{be(t),n(void 0)}):(be(t),n(void 0))})}function nr(e){return Qe(Zr,e,!1)}function wa(e){return Qe(On|Ct,e,!0)}function wr(e,t=0){return Qe(Kr|t,e,!0)}function Ee(e,t=[],r=[],n=[]){Bi(n,t,r,i=>{Qe(Kr,()=>e(...i.map(s)),!0)})}function Un(e,t=0){var r=Qe(st|t,e,!0);return r}function so(e,t=0){var r=Qe(Ln|t,e,!0);return r}function Le(e){return Qe(We|Ct,e,!0)}function ao(e){var t=e.teardown;if(t!==null){const r=xt,n=U;po(!0),Be(null);try{t.call(null)}finally{po(r),Be(n)}}}function lo(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const i=r.ac;i!==null&&sn(()=>{i.abort(Kt)});var n=r.next;(r.f&pt)!==0?r.parent=null:be(r,t),r=n}}function ma(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&We)===0&&be(t),t=r}}function be(e,t=!0){var r=!1;(t||(e.f&Si)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(co(e.nodes.start,e.nodes.end),r=!0),lo(e,t&&!r),ln(e,0),he(e,lt);var n=e.nodes&&e.nodes.t;if(n!==null)for(const o of n)o.stop();ao(e);var i=e.parent;i!==null&&i.first!==null&&uo(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function co(e,t){for(;e!==null;){var r=e===t?null:Je(e);e.remove(),e=r}}function uo(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function Dt(e,t,r=!0){var n=[];fo(e,n,!0);var i=()=>{r&&be(e),t&&t()},o=n.length;if(o>0){var a=()=>--o||i();for(var c of n)c.out(a)}else i()}function fo(e,t,r){if((e.f&Oe)===0){e.f^=Oe;var n=e.nodes&&e.nodes.t;if(n!==null)for(const c of n)(c.is_global||r)&&t.push(c);for(var i=e.first;i!==null;){var o=i.next,a=(i.f&Zt)!==0||(i.f&We)!==0&&(e.f&st)!==0;fo(i,t,a?r:!1),i=o}}}function Hn(e){vo(e,!0)}function vo(e,t){if((e.f&Oe)!==0){e.f^=Oe,(e.f&_e)===0&&(he(e,xe),ft(e));for(var r=e.first;r!==null;){var n=r.next,i=(r.f&Zt)!==0||(r.f&We)!==0;vo(r,i?t:!1),r=n}var o=e.nodes&&e.nodes.t;if(o!==null)for(const a of o)(a.is_global||t)&&a.in()}}function ho(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var i=r===n?null:Je(r);t.append(r),r=i}}let an=!1,xt=!1;function po(e){xt=e}let U=null,et=!1;function Be(e){U=e}let B=null;function Ue(e){B=e}let He=null;function go(e){U!==null&&(He===null?He=[e]:He.push(e))}let Ce=null,De=0,Ye=null;function ka(e){Ye=e}let _o=1,It=0,jt=It;function bo(e){jt=e}function yo(){return++_o}function mr(e){var t=e.f;if((t&xe)!==0)return!0;if(t&me&&(e.f&=~Tt),(t&at)!==0){for(var r=e.deps,n=r.length,i=0;i<n;i++){var o=r[i];if(mr(o)&&Hi(o),o.wv>e.wv)return!0}(t&Ne)!==0&&Ke===null&&he(e,_e)}return!1}function wo(e,t,r=!0){var n=e.reactions;if(n!==null&&!(He!==null&&Wt.call(He,e)))for(var i=0;i<n.length;i++){var o=n[i];(o.f&me)!==0?wo(o,t,!1):t===o&&(r?he(o,xe):(o.f&_e)!==0&&he(o,at),ft(o))}}function mo(e){var t=Ce,r=De,n=Ye,i=U,o=He,a=le,c=et,l=jt,d=e.f;Ce=null,De=0,Ye=null,U=(d&(We|pt))===0?e:null,He=null,er(e.ctx),et=!1,jt=++It,e.ac!==null&&(sn(()=>{e.ac.abort(Kt)}),e.ac=null);try{e.f|=Tn;var v=e.fn,h=v(),u=e.deps,g=V?.is_fork;if(Ce!==null){var _;if(g||ln(e,De),u!==null&&De>0)for(u.length=De+Ce.length,_=0;_<Ce.length;_++)u[De+_]=Ce[_];else e.deps=u=Ce;if(Fn()&&(e.f&Ne)!==0)for(_=De;_<u.length;_++)(u[_].reactions??=[]).push(e)}else!g&&u!==null&&De<u.length&&(ln(e,De),u.length=De);if(_r()&&Ye!==null&&!et&&u!==null&&(e.f&(me|at|xe))===0)for(_=0;_<Ye.length;_++)wo(Ye[_],e);if(i!==null&&i!==e){if(It++,i.deps!==null)for(let k=0;k<r;k+=1)i.deps[k].rv=It;if(t!==null)for(const k of t)k.rv=It;Ye!==null&&(n===null?n=Ye:n.push(...Ye))}return(e.f&gt)!==0&&(e.f^=gt),h}catch(k){return Gi(k)}finally{e.f^=Tn,Ce=t,De=r,Ye=n,U=i,He=o,er(a),et=c,jt=l}}function xa(e,t){let r=t.reactions;if(r!==null){var n=Ds.call(r,e);if(n!==-1){var i=r.length-1;i===0?r=t.reactions=null:(r[n]=r[i],r.pop())}}if(r===null&&(t.f&me)!==0&&(Ce===null||!Wt.call(Ce,t))){var o=t;(o.f&Ne)!==0&&(o.f^=Ne,o.f&=~Tt),Gn(o),Ui(o),ln(o,0)}}function ln(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)xa(e,r[n])}function kr(e){var t=e.f;if((t&lt)===0){he(e,_e);var r=B,n=an;B=e,an=!0;try{(t&(st|Ln))!==0?ma(e):lo(e),ao(e);var i=mo(e);e.teardown=typeof i=="function"?i:null,e.wv=_o;var o;Sn&&ta&&(e.f&xe)!==0&&e.deps}finally{an=n,B=r}}}async function $a(){await Promise.resolve(),Ii()}function s(e){var t=e.f,r=(t&me)!==0;if(U!==null&&!et){var n=B!==null&&(B.f&lt)!==0;if(!n&&(He===null||!Wt.call(He,e))){var i=U.deps;if((U.f&Tn)!==0)e.rv<It&&(e.rv=It,Ce===null&&i!==null&&i[De]===e?De++:Ce===null?Ce=[e]:Ce.push(e));else{(U.deps??=[]).push(e);var o=e.reactions;o===null?e.reactions=[U]:Wt.call(o,U)||o.push(U)}}}if(xt&&wt.has(e))return wt.get(e);if(r){var a=e;if(xt){var c=a.v;return((a.f&_e)===0&&a.reactions!==null||xo(a))&&(c=jn(a)),wt.set(a,c),c}var l=(a.f&Ne)===0&&!et&&U!==null&&(an||(U.f&Ne)!==0),d=a.deps===null;mr(a)&&(l&&(a.f|=Ne),Hi(a)),l&&!d&&ko(a)}if(Ke?.has(e))return Ke.get(e);if((e.f&gt)!==0)throw e.v;return e.v}function ko(e){if(e.deps!==null){e.f|=Ne;for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&me)!==0&&(t.f&Ne)===0&&ko(t)}}function xo(e){if(e.v===ge)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(wt.has(t)||(t.f&me)!==0&&xo(t))return!0;return!1}function ir(e){var t=et;try{return et=!0,e()}finally{et=t}}function Ea(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(_t in e)Yn(e);else if(!Array.isArray(e))for(let t in e){const r=e[t];typeof r=="object"&&r&&_t in r&&Yn(r)}}}function Yn(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{Yn(e[n],t)}catch{}const r=An(e);if(r!==Object.prototype&&r!==Array.prototype&&r!==Map.prototype&&r!==Set.prototype&&r!==Date.prototype){const n=ki(r);for(let i in n){const o=n[i].get;if(o)try{o.call(e)}catch{}}}}}const $o=new Set,Vn=new Set;function Eo(e){if(!R)return;e.removeAttribute("onload"),e.removeAttribute("onerror");const t=e.__e;t!==void 0&&(e.__e=void 0,queueMicrotask(()=>{e.isConnected&&e.dispatchEvent(t)}))}function So(e,t,r,n={}){function i(o){if(n.capture||$r.call(t,o),!o.cancelBubble)return sn(()=>r?.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Ze(()=>{t.addEventListener(e,i,n)}):t.addEventListener(e,i,n),i}function or(e,t,r,n,i){var o={capture:n,passive:i},a=So(e,t,r,o);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Bn(()=>{t.removeEventListener(e,a,o)})}function xr(e){for(var t=0;t<e.length;t++)$o.add(e[t]);for(var r of Vn)r(e)}let Mo=null;function $r(e){var t=this,r=t.ownerDocument,n=e.type,i=e.composedPath?.()||[],o=i[0]||e.target;Mo=e;var a=0,c=Mo===e&&e.__root;if(c){var l=i.indexOf(c);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var d=i.indexOf(t);if(d===-1)return;l<=d&&(a=l)}if(o=i[a]||e.target,o!==t){qr(e,"currentTarget",{configurable:!0,get(){return o||r}});var v=U,h=B;Be(null),Ue(null);try{for(var u,g=[];o!==null;){var _=o.assignedSlot||o.parentNode||o.host||null;try{var k=o["__"+n];k!=null&&(!o.disabled||e.target===o)&&k.call(o,e)}catch(b){u?g.push(b):u=b}if(e.cancelBubble||_===t||_===null)break;o=_}if(u){for(let b of g)queueMicrotask(()=>{throw b});throw u}}finally{e.__root=t,delete e.currentTarget,Be(v),Ue(h)}}}function Xn(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function rt(e,t){var r=B;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function ye(e,t){var r=(t&Ts)!==0,n=(t&Os)!==0,i,o=!e.startsWith("<!>");return()=>{if(R)return rt(F,null),F;i===void 0&&(i=Xn(o?e:"<!>"+e),r||(i=Pe(i)));var a=n||Ki?document.importNode(i,!0):i.cloneNode(!0);if(r){var c=Pe(a),l=a.lastChild;rt(c,l)}else rt(a,a);return a}}function Sa(e,t,r="svg"){var n=!e.startsWith("<!>"),i=`<${r}>${n?e:"<!>"+e}</${r}>`,o;return()=>{if(R)return rt(F,null),F;if(!o){var a=Xn(i),c=Pe(a);o=Pe(c)}var l=o.cloneNode(!0);return rt(l,l),l}}function ue(e,t){return Sa(e,t,"svg")}function sr(){if(R)return rt(F,null),F;var e=document.createDocumentFragment(),t=document.createComment(""),r=Fe();return e.append(t,r),rt(t,r),e}function G(e,t){if(R){var r=B;((r.f&Jr)===0||r.nodes.end===null)&&(r.nodes.end=F),Jt();return}e!==null&&e.before(t)}function Ma(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const Aa=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function La(e){return Aa.includes(e)}const Ca={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Ta(e){return e=e.toLowerCase(),Ca[e]??e}const Oa=["touchstart","touchmove"];function Ga(e){return Oa.includes(e)}function vt(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=r+"")}function Ao(e,t){return Lo(e,t)}function Pa(e,t){zn(),t.intro=t.intro??!1;const r=t.target,n=R,i=F;try{for(var o=Pe(r);o&&(o.nodeType!==Ot||o.data!==mi);)o=Je(o);if(!o)throw Lt;qe(!0),$e(o);const a=Lo(e,{...t,anchor:o});return qe(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
+ `).some(c=>c.startsWith("https://svelte.dev/e/")))throw a;return a!==Lt&&console.warn("Failed to hydrate: ",a),t.recover===!1&&Xs(),zn(),eo(r),qe(!1),Ao(e,t)}finally{qe(n),$e(i)}}const ar=new Map;function Lo(e,{target:t,anchor:r,props:n={},events:i,context:o,intro:a=!0}){zn();var c=new Set,l=h=>{for(var u=0;u<h.length;u++){var g=h[u];if(!c.has(g)){c.add(g);var _=Ga(g);t.addEventListener(g,$r,{passive:_});var k=ar.get(g);k===void 0?(document.addEventListener(g,$r,{passive:_}),ar.set(g,1)):ar.set(g,k+1)}}};l(Xr($o)),Vn.add(l);var d=void 0,v=ya(()=>{var h=r??t.appendChild(Fe());return la(h,{pending:()=>{}},u=>{if(o){bt({});var g=le;g.c=o}if(i&&(n.$$events=i),R&&rt(u,null),d=e(u,n)||{},R&&(B.nodes.end=F,F===null||F.nodeType!==Ot||F.data!==En))throw gr(),Lt;o&&yt()}),()=>{for(var u of c){t.removeEventListener(u,$r);var g=ar.get(u);--g===0?(document.removeEventListener(u,$r),ar.delete(u)):ar.set(u,g)}Vn.delete(l),h!==r&&h.parentNode?.removeChild(h)}});return Wn.set(d,v),d}let Wn=new WeakMap;function Da(e,t){const r=Wn.get(e);return r?(Wn.delete(e),r(t)):Promise.resolve()}class Ia{anchor;#e=new Map;#t=new Map;#r=new Map;#o=new Set;#s=!0;constructor(t,r=!0){this.anchor=t,this.#s=r}#i=()=>{var t=V;if(this.#e.has(t)){var r=this.#e.get(t),n=this.#t.get(r);if(n)Hn(n),this.#o.delete(r);else{var i=this.#r.get(r);i&&(this.#t.set(r,i.effect),this.#r.delete(r),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(const[o,a]of this.#e){if(this.#e.delete(o),o===t)break;const c=this.#r.get(a);c&&(be(c.effect),this.#r.delete(a))}for(const[o,a]of this.#t){if(o===r||this.#o.has(o))continue;const c=()=>{if(Array.from(this.#e.values()).includes(o)){var d=document.createDocumentFragment();ho(a,d),d.append(Fe()),this.#r.set(o,{effect:a,fragment:d})}else be(a);this.#o.delete(o),this.#t.delete(o)};this.#s||!n?(this.#o.add(o),Dt(a,c,!1)):c()}}};#n=t=>{this.#e.delete(t);const r=Array.from(this.#e.values());for(const[n,i]of this.#r)r.includes(n)||(be(i.effect),this.#r.delete(n))};ensure(t,r){var n=V,i=to();if(r&&!this.#t.has(t)&&!this.#r.has(t))if(i){var o=document.createDocumentFragment(),a=Fe();o.append(a),this.#r.set(t,{effect:Le(()=>r(a)),fragment:o})}else this.#t.set(t,Le(()=>r(this.anchor)));if(this.#e.set(n,t),i){for(const[c,l]of this.#t)c===t?n.skipped_effects.delete(l):n.skipped_effects.add(l);for(const[c,l]of this.#r)c===t?n.skipped_effects.delete(l.effect):n.skipped_effects.add(l.effect);n.oncommit(this.#i),n.ondiscard(this.#n)}else R&&(this.anchor=F),this.#i()}}function lr(e){le===null&&Mi(),Qt&&le.l!==null?ja(le).m.push(e):Pt(()=>{const t=ir(e);if(typeof t=="function")return t})}function cn(e){le===null&&Mi(),lr(()=>()=>ir(e))}function ja(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}function Se(e,t,r=!1){R&&Jt();var n=new Ia(e),i=r?Zt:0;function o(a,c){if(R){const d=Ai(e)===Vr;if(a===d){var l=en();$e(l),n.anchor=l,qe(!1),n.ensure(a,c),qe(!0);return}}n.ensure(a,c)}Un(()=>{var a=!1;t((c,l=!0)=>{a=!0,o(l,c)}),a||o(!1,null)},i)}function Ra(e,t){return t}function za(e,t,r){for(var n=[],i=t.length,o,a=t.length,c=0;c<i;c++){let h=t[c];Dt(h,()=>{if(o){if(o.pending.delete(h),o.done.add(h),o.pending.size===0){var u=e.outrogroups;qn(Xr(o.done)),u.delete(o),u.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var l=n.length===0&&r!==null;if(l){var d=r,v=d.parentNode;eo(v),v.append(d),e.items.clear()}qn(t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function qn(e,t=!0){for(var r=0;r<e.length;r++)be(e[r],t)}var Co;function Zn(e,t,r,n,i,o=null){var a=e,c=new Map,l=(t&yi)!==0;if(l){var d=e;a=R?$e(Pe(d)):d.appendChild(Fe())}R&&Jt();var v=null,h=In(()=>{var $=r();return Mn($)?$:$==null?[]:Xr($)}),u,g=!0;function _(){b.fallback=v,Na(b,u,a,t,n),v!==null&&(u.length===0?(v.f&ct)===0?Hn(v):(v.f^=ct,Sr(v,null,a)):Dt(v,()=>{v=null}))}var k=Un(()=>{u=s(h);var $=u.length;let X=!1;if(R){var ne=Ai(a)===Vr;ne!==($===0)&&(a=en(),$e(a),qe(!1),X=!0)}for(var D=new Set,Z=V,C=to(),S=0;S<$;S+=1){R&&F.nodeType===Ot&&F.data===En&&(a=F,X=!0,qe(!1));var I=u[S],H=n(I,S),L=g?null:c.get(H);L?(L.v&&rr(L.v,I),L.i&&rr(L.i,S),C&&Z.skipped_effects.delete(L.e)):(L=Fa(c,g?a:Co??=Fe(),I,H,S,i,t,r),g||(L.e.f|=ct),c.set(H,L)),D.add(H)}if($===0&&o&&!v&&(g?v=Le(()=>o(a)):(v=Le(()=>o(Co??=Fe())),v.f|=ct)),R&&$>0&&$e(en()),!g)if(C){for(const[Q,oe]of c)D.has(Q)||Z.skipped_effects.add(oe.e);Z.oncommit(_),Z.ondiscard(()=>{})}else _();X&&qe(!0),s(h)}),b={effect:k,items:c,outrogroups:null,fallback:v};g=!1,R&&(a=F)}function Er(e){for(;e!==null&&(e.f&We)===0;)e=e.next;return e}function Na(e,t,r,n,i){var o=(n&Ss)!==0,a=t.length,c=e.items,l=Er(e.effect.first),d,v=null,h,u=[],g=[],_,k,b,$;if(o)for($=0;$<a;$+=1)_=t[$],k=i(_,$),b=c.get(k).e,(b.f&ct)===0&&(b.nodes?.a?.measure(),(h??=new Set).add(b));for($=0;$<a;$+=1){if(_=t[$],k=i(_,$),b=c.get(k).e,e.outrogroups!==null)for(const L of e.outrogroups)L.pending.delete(b),L.done.delete(b);if((b.f&ct)!==0)if(b.f^=ct,b===l)Sr(b,null,r);else{var X=v?v.next:l;b===e.effect.last&&(e.effect.last=b.prev),b.prev&&(b.prev.next=b.next),b.next&&(b.next.prev=b.prev),$t(e,v,b),$t(e,b,X),Sr(b,X,r),v=b,u=[],g=[],l=Er(v.next);continue}if((b.f&Oe)!==0&&(Hn(b),o&&(b.nodes?.a?.unfix(),(h??=new Set).delete(b))),b!==l){if(d!==void 0&&d.has(b)){if(u.length<g.length){var ne=g[0],D;v=ne.prev;var Z=u[0],C=u[u.length-1];for(D=0;D<u.length;D+=1)Sr(u[D],ne,r);for(D=0;D<g.length;D+=1)d.delete(g[D]);$t(e,Z.prev,C.next),$t(e,v,Z),$t(e,C,ne),l=ne,v=C,$-=1,u=[],g=[]}else d.delete(b),Sr(b,l,r),$t(e,b.prev,b.next),$t(e,b,v===null?e.effect.first:v.next),$t(e,v,b),v=b;continue}for(u=[],g=[];l!==null&&l!==b;)(d??=new Set).add(l),g.push(l),l=Er(l.next);if(l===null)continue}(b.f&ct)===0&&u.push(b),v=b,l=Er(b.next)}if(e.outrogroups!==null){for(const L of e.outrogroups)L.pending.size===0&&(qn(Xr(L.done)),e.outrogroups?.delete(L));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||d!==void 0){var S=[];if(d!==void 0)for(b of d)(b.f&Oe)===0&&S.push(b);for(;l!==null;)(l.f&Oe)===0&&l!==e.fallback&&S.push(l),l=Er(l.next);var I=S.length;if(I>0){var H=(n&yi)!==0&&a===0?r:null;if(o){for($=0;$<I;$+=1)S[$].nodes?.a?.measure();for($=0;$<I;$+=1)S[$].nodes?.a?.fix()}za(e,S,H)}}o&&Ze(()=>{if(h!==void 0)for(b of h)b.nodes?.a?.apply()})}function Fa(e,t,r,n,i,o,a,c){var l=(a&$s)!==0?(a&Ms)===0?Vi(r,!1,!1):mt(r):null,d=(a&Es)!==0?mt(i):null;return{v:l,i:d,e:Le(()=>(o(t,l??r,d??i,c),()=>{e.delete(n)}))}}function Sr(e,t,r){if(e.nodes)for(var n=e.nodes.start,i=e.nodes.end,o=t&&(t.f&ct)===0?t.nodes.start:r;n!==null;){var a=Je(n);if(o.before(n),n===i)return;n=a}}function $t(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function de(e,t,r=!1,n=!1,i=!1){var o=e,a="";Ee(()=>{var c=B;if(a===(a=t()??"")){R&&Jt();return}if(c.nodes!==null&&(co(c.nodes.start,c.nodes.end),c.nodes=null),a!==""){if(R){F.data;for(var l=Jt(),d=l;l!==null&&(l.nodeType!==Ot||l.data!=="");)d=l,l=Je(l);if(l===null)throw gr(),Lt;rt(F,d),o=$e(l);return}var v=a+"";r?v=`<svg>${v}</svg>`:n&&(v=`<math>${v}</math>`);var h=Xn(v);if((r||n)&&(h=Pe(h)),rt(Pe(h),h.lastChild),r||n)for(;Pe(h);)o.before(Pe(h));else o.before(h)}})}function Rt(e,t){nr(()=>{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){const i=document.createElement("style");i.id=t.hash,i.textContent=t.code,n.appendChild(i)}})}function To(e,t,r){nr(()=>{var n=ir(()=>t(e,r?.())||{});if(r&&n?.update){var i=!1,o={};wr(()=>{var a=r();Ea(a),i&&Ci(o,a)&&(o=a,n.update(a))}),i=!0}if(n?.destroy)return()=>n.destroy()})}function Ba(e,t){var r=void 0,n;so(()=>{r!==(r=t())&&(n&&(be(n),n=null),r&&(n=Le(()=>{nr(()=>r(e))})))})}function Oo(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=Oo(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Ua(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Oo(e))&&(n&&(n+=" "),n+=t);return n}function Ha(e){return typeof e=="object"?Ua(e):e??""}const Go=[...`
3
+ \r\f \v\uFEFF`];function Ya(e,t,r){var n=e==null?"":""+e;if(t&&(n=n?n+" "+t:t),r){for(var i in r)if(r[i])n=n?n+" "+i:i;else if(n.length)for(var o=i.length,a=0;(a=n.indexOf(i,a))>=0;){var c=a+o;(a===0||Go.includes(n[a-1]))&&(c===n.length||Go.includes(n[c]))?n=(a===0?"":n.substring(0,a))+n.substring(c+1):a=c}}return n===""?null:n}function Po(e,t=!1){var r=t?" !important;":";",n="";for(var i in e){var o=e[i];o!=null&&o!==""&&(n+=" "+i+": "+o+r)}return n}function Kn(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Va(e,t){if(t){var r="",n,i;if(Array.isArray(t)?(n=t[0],i=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var o=!1,a=0,c=!1,l=[];n&&l.push(...Object.keys(n).map(Kn)),i&&l.push(...Object.keys(i).map(Kn));var d=0,v=-1;const k=e.length;for(var h=0;h<k;h++){var u=e[h];if(c?u==="/"&&e[h-1]==="*"&&(c=!1):o?o===u&&(o=!1):u==="/"&&e[h+1]==="*"?c=!0:u==='"'||u==="'"?o=u:u==="("?a++:u===")"&&a--,!c&&o===!1&&a===0){if(u===":"&&v===-1)v=h;else if(u===";"||h===k-1){if(v!==-1){var g=Kn(e.substring(d,v).trim());if(!l.includes(g)){u!==";"&&h++;var _=e.substring(d,h).trim();r+=" "+_+";"}}d=h+1,v=-1}}}}return n&&(r+=Po(n)),i&&(r+=Po(i,!0)),r=r.trim(),r===""?null:r}return e==null?null:String(e)}function ke(e,t,r,n,i,o){var a=e.__className;if(R||a!==r||a===void 0){var c=Ya(r,n,o);(!R||c!==e.getAttribute("class"))&&(c==null?e.removeAttribute("class"):t?e.className=c:e.setAttribute("class",c)),e.__className=r}else if(o&&i!==o)for(var l in o){var d=!!o[l];(i==null||d!==!!i[l])&&e.classList.toggle(l,d)}return o}function Jn(e,t={},r,n){for(var i in r){var o=r[i];t[i]!==o&&(r[i]==null?e.style.removeProperty(i):e.style.setProperty(i,o,n))}}function Et(e,t,r,n){var i=e.__style;if(R||i!==t){var o=Va(t,n);(!R||o!==e.getAttribute("style"))&&(o==null?e.removeAttribute("style"):e.style.cssText=o),e.__style=t}else n&&(Array.isArray(n)?(Jn(e,r?.[0],n[0]),Jn(e,r?.[1],n[1],"important")):Jn(e,r,n));return n}function un(e,t,r=!1){if(e.multiple){if(t==null)return;if(!Mn(t))return Js();for(var n of e.options)n.selected=t.includes(Mr(n));return}for(n of e.options){var i=Mr(n);if(ha(i,t)){n.selected=!0;return}}(!r||t!==void 0)&&(e.selectedIndex=-1)}function Do(e){var t=new MutationObserver(()=>{un(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Bn(()=>{t.disconnect()})}function Io(e,t,r=t){var n=new WeakSet,i=!0;io(e,"change",o=>{var a=o?"[selected]":":checked",c;if(e.multiple)c=[].map.call(e.querySelectorAll(a),Mr);else{var l=e.querySelector(a)??e.querySelector("option:not([disabled])");c=l&&Mr(l)}r(c),V!==null&&n.add(V)}),nr(()=>{var o=t();if(e===document.activeElement){var a=rn??V;if(n.has(a))return}if(un(e,o,i),i&&o===void 0){var c=e.querySelector(":checked");c!==null&&(o=Mr(c),r(o))}e.__value=o,i=!1}),Do(e)}function Mr(e){return"__value"in e?e.__value:e.value}const Ar=Symbol("class"),Lr=Symbol("style"),jo=Symbol("is custom element"),Ro=Symbol("is html");function zt(e){if(R){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var n=e.value;tt(e,"value",null),e.value=n}if(e.hasAttribute("checked")){var i=e.checked;tt(e,"checked",null),e.checked=i}}};e.__on_r=r,Ze(r),no()}}function Xa(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function tt(e,t,r,n){var i=zo(e);R&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||i[t]!==(i[t]=r)&&(t==="loading"&&(e[Fs]=r),r==null?e.removeAttribute(t):typeof r!="string"&&Fo(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Wa(e,t,r,n,i=!1,o=!1){if(R&&i&&e.tagName==="INPUT"){var a=e,c=a.type==="checkbox"?"defaultChecked":"defaultValue";c in r||zt(a)}var l=zo(e),d=l[jo],v=!l[Ro];let h=R&&d;h&&qe(!1);var u=t||{},g=e.tagName==="OPTION";for(var _ in t)_ in r||(r[_]=null);r.class?r.class=Ha(r.class):r[Ar]&&(r.class=null),r[Lr]&&(r.style??=null);var k=Fo(e);for(const C in r){let S=r[C];if(g&&C==="value"&&S==null){e.value=e.__value="",u[C]=S;continue}if(C==="class"){var b=e.namespaceURI==="http://www.w3.org/1999/xhtml";ke(e,b,S,n,t?.[Ar],r[Ar]),u[C]=S,u[Ar]=r[Ar];continue}if(C==="style"){Et(e,S,t?.[Lr],r[Lr]),u[C]=S,u[Lr]=r[Lr];continue}var $=u[C];if(!(S===$&&!(S===void 0&&e.hasAttribute(C)))){u[C]=S;var X=C[0]+C[1];if(X!=="$$")if(X==="on"){const I={},H="$$"+C;let L=C.slice(2);var ne=La(L);if(Ma(L)&&(L=L.slice(0,-7),I.capture=!0),!ne&&$){if(S!=null)continue;e.removeEventListener(L,u[H],I),u[H]=null}if(S!=null)if(ne)e[`__${L}`]=S,xr([L]);else{let Q=function(oe){u[C].call(this,oe)};u[H]=So(L,e,Q,I)}else ne&&(e[`__${L}`]=void 0)}else if(C==="style")tt(e,C,S);else if(C==="autofocus")pa(e,!!S);else if(!d&&(C==="__value"||C==="value"&&S!=null))e.value=e.__value=S;else if(C==="selected"&&g)Xa(e,S);else{var D=C;v||(D=Ta(D));var Z=D==="defaultValue"||D==="defaultChecked";if(S==null&&!d&&!Z)if(l[C]=null,D==="value"||D==="checked"){let I=e;const H=t===void 0;if(D==="value"){let L=I.defaultValue;I.removeAttribute(D),I.defaultValue=L,I.value=I.__value=H?L:null}else{let L=I.defaultChecked;I.removeAttribute(D),I.defaultChecked=L,I.checked=H?L:!1}}else e.removeAttribute(C);else Z||k.includes(D)&&(d||typeof S!="string")?(e[D]=S,D in l&&(l[D]=ge)):typeof S!="function"&&tt(e,D,S)}}}return h&&qe(!0),u}function fe(e,t,r=[],n=[],i=[],o,a=!1,c=!1){Bi(i,r,n,l=>{var d=void 0,v={},h=e.nodeName==="SELECT",u=!1;if(so(()=>{var _=t(...l.map(s)),k=Wa(e,d,_,o,a,c);u&&h&&"value"in _&&un(e,_.value);for(let $ of Object.getOwnPropertySymbols(v))_[$]||be(v[$]);for(let $ of Object.getOwnPropertySymbols(_)){var b=_[$];$.description===Ps&&(!d||b!==d[$])&&(v[$]&&be(v[$]),v[$]=Le(()=>Ba(e,()=>b))),k[$]=b}d=k}),h){var g=e;nr(()=>{un(g,d.value,!0),Do(g)})}u=!0})}function zo(e){return e.__attributes??={[jo]:e.nodeName.includes("-"),[Ro]:e.namespaceURI===Gs}}var No=new Map;function Fo(e){var t=e.getAttribute("is")||e.nodeName,r=No.get(t);if(r)return r;No.set(t,r=[]);for(var n,i=e,o=Element.prototype;o!==i;){n=ki(i);for(var a in n)n[a].set&&r.push(a);i=An(i)}return r}function cr(e,t,r=t){var n=new WeakSet;io(e,"input",async i=>{var o=i?e.defaultValue:e.value;if(o=Qn(e)?ei(o):o,r(o),V!==null&&n.add(V),await $a(),o!==(o=t())){var a=e.selectionStart,c=e.selectionEnd,l=e.value.length;if(e.value=o??"",c!==null){var d=e.value.length;a===c&&c===l&&d>l?(e.selectionStart=d,e.selectionEnd=d):(e.selectionStart=a,e.selectionEnd=Math.min(c,d))}}}),(R&&e.defaultValue!==e.value||ir(t)==null&&e.value)&&(r(Qn(e)?ei(e.value):e.value),V!==null&&n.add(V)),wr(()=>{var i=t();if(e===document.activeElement){var o=rn??V;if(n.has(o))return}Qn(e)&&i===ei(e.value)||e.type==="date"&&!i&&!e.value||i!==e.value&&(e.value=i??"")})}function Qn(e){var t=e.type;return t==="number"||t==="range"}function ei(e){return e===""?null:+e}function Bo(e,t){return e===t||e?.[_t]===t}function qa(e={},t,r,n){return nr(()=>{var i,o;return wr(()=>{i=o,o=[],ir(()=>{e!==r(...o)&&(t(e,...o),i&&Bo(r(...i),e)&&t(null,...i))})}),()=>{Ze(()=>{o&&Bo(r(...o),e)&&t(null,...o)})}}),e}const Za={get(e,t){if(!e.exclude.includes(t))return s(e.version),t in e.special?e.special[t]():e.props[t]},set(e,t,r){if(!(t in e.special)){var n=B;try{Ue(e.parent_effect),e.special[t]=Ka({get[t](){return e.props[t]}},t,wi)}finally{Ue(n)}}return e.special[t](r),Xi(e.version),!0},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},deleteProperty(e,t){return e.exclude.includes(t)||(e.exclude.push(t),Xi(e.version)),!0},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function ve(e,t){return new Proxy({props:e,exclude:t,special:{},version:mt(0),parent_effect:B},Za)}function Ka(e,t,r,n){var i=!Qt||(r&Ls)!==0,o=(r&Cs)!==0,a=n,c=!0,l=()=>(c&&(c=!1,a=n),a);e[t];var d;if(i?d=()=>{var g=e[t];return g===void 0?l():(c=!0,g)}:d=()=>{var g=e[t];return g!==void 0&&(a=void 0),g===void 0?a:g},i&&(r&wi)===0)return d;var v=!1,h=((r&As)!==0?on:In)(()=>(v=!1,d())),u=B;return(function(g,_){if(arguments.length>0){const k=_?s(h):i&&o?ce(g):g;return f(h,k),v=!0,a!==void 0&&(a=k),g}return xt&&v||(u.f&lt)!==0?h.v:s(h)})}function Ja(e){return new Qa(e)}class Qa{#e;#t;constructor(t){var r=new Map,n=(o,a)=>{var c=Vi(a,!1,!1);return r.set(o,c),c};const i=new Proxy({...t.props||{},$$events:{}},{get(o,a){return s(r.get(a)??n(a,Reflect.get(o,a)))},has(o,a){return a===Ns?!0:(s(r.get(a)??n(a,Reflect.get(o,a))),Reflect.has(o,a))},set(o,a,c){return f(r.get(a)??n(a,c),c),Reflect.set(o,a,c)}});this.#t=(t.hydrate?Pa:Ao)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&Ii(),this.#e=i.$$events;for(const o of Object.keys(this.#t))o==="$set"||o==="$destroy"||o==="$on"||qr(this,o,{get(){return this.#t[o]},set(a){this.#t[o]=a},enumerable:!0});this.#t.$set=o=>{Object.assign(i,o)},this.#t.$destroy=()=>{Da(this.#t)}}$set(t){this.#t.$set(t)}$on(t,r){this.#e[t]=this.#e[t]||[];const n=(...i)=>r.call(this,...i);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}}let Uo;typeof HTMLElement=="function"&&(Uo=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&(this.$$shadowRoot=this.attachShadow(r))}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){const n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return i=>{const o=document.createElement("slot");n!=="default"&&(o.name=n),G(i,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},r=el(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(const n of this.attributes){const i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=dn(i,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Ja({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=ba(()=>{wr(()=>{this.$$r=!0;for(const n of Wr(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const i=dn(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(const n in this.$$l)for(const i of this.$$l[n]){const o=this.$$c.$on(n,i);this.$$l_u.set(i,o)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=dn(e,r,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 Wr(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function dn(e,t,r,n){const i=r[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="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 el(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function Nt(e,t,r,n,i,o){let a=class extends Uo{constructor(){super(e,r,i),this.$$p_d=t}static get observedAttributes(){return Wr(t).map(c=>(t[c].attribute||c).toLowerCase())}};return Wr(t).forEach(c=>{qr(a.prototype,c,{get(){return this.$$c&&c in this.$$c?this.$$c[c]:this.$$d[c]},set(l){l=dn(c,l,t),this.$$d[c]=l;var d=this.$$c;if(d){var v=qt(d,c)?.get;v?d[c]=l:d.$set({[c]:l})}}})}),n.forEach(c=>{qr(a.prototype,c,{get(){return this.$$c?.[c]}})}),e.element=a,a}let ti=null;function Cr(){return ti===null&&(ti="ontouchstart"in window||navigator.maxTouchPoints>0),ti}let ri=null,Ho=!1;function Yo(){return ri==="touch"}function tl(e){ri=e.pointerType}function rl(){Ho||(document.addEventListener("pointerdown",e=>{ri=e.pointerType},{capture:!0,passive:!0}),Ho=!0)}ra();var nl=ue("<svg><!></svg>");function il(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=nl();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16.502 10.002c.844 0 1.818-.083 2.299.75.201.348.201.816.201 1.75v1c0 .935 0 1.402-.201 1.75-.481.834-1.455.75-2.299.75s-1.818.084-2.3-.75c-.2-.348-.2-.815-.2-1.75v-1c0-.934 0-1.402.2-1.75.482-.833 1.456-.75 2.3-.75M7.502 4.002c.844 0 1.818-.083 2.299.75.201.348.201.816.201 1.75v7c0 .935 0 1.402-.201 1.75-.481.834-1.455.75-2.3.75-.843 0-1.817.084-2.298-.75-.201-.348-.201-.815-.201-1.75v-7c0-.934 0-1.402.2-1.75.482-.833 1.456-.75 2.3-.75M22 20H2"/>',!0),y(n),G(e,n)}var ol=ue("<svg><!></svg>");function sl(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=ol();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 19v3M12 10v4M12 2v3M8 7.5c0-.844-.083-1.818.75-2.299C9.098 5 9.566 5 10.5 5h3c.935 0 1.402 0 1.75.201.834.481.75 1.455.75 2.299s.084 1.818-.75 2.299c-.348.201-.815.201-1.75.201h-3c-.934 0-1.402 0-1.75-.201C7.917 9.318 8 8.344 8 7.5M4 16.5c0-.844-.083-1.818.75-2.299C5.098 14 5.566 14 6.5 14h11c.935 0 1.402 0 1.75.201.834.481.75 1.455.75 2.299s.084 1.818-.75 2.299c-.348.201-.815.201-1.75.201h-11c-.934 0-1.402 0-1.75-.201C3.917 18.318 4 17.344 4 16.5"/>',!0),y(n),G(e,n)}var al=ue("<svg><!></svg>");function ll(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=al();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M8.002 7.5c0-.844-.083-1.818.75-2.299C9.1 5 9.568 5 10.502 5h1c.935 0 1.402 0 1.75.201.834.481.75 1.455.75 2.299s.084 1.818-.75 2.299c-.348.201-.815.201-1.75.201h-1c-.934 0-1.402 0-1.75-.201-.833-.481-.75-1.455-.75-2.299M8.002 16.5c0-.844-.083-1.818.75-2.299C9.1 14 9.568 14 10.502 14h7c.935 0 1.402 0 1.75.201.834.481.75 1.455.75 2.299s.084 1.818-.75 2.299c-.348.201-.815.201-1.75.201h-7c-.934 0-1.402 0-1.75-.201-.833-.481-.75-1.455-.75-2.299M4 2v20"/>',!0),y(n),G(e,n)}var cl=ue("<svg><!></svg>");function ul(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=cl();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M10 7.5c0-.844-.083-1.818.75-2.299C11.098 5 11.566 5 12.5 5h1c.935 0 1.402 0 1.75.201.834.481.75 1.455.75 2.299s.084 1.818-.75 2.299c-.348.201-.815.201-1.75.201h-1c-.934 0-1.402 0-1.75-.201C9.917 9.318 10 8.344 10 7.5M4 16.5c0-.844-.083-1.818.75-2.299C5.098 14 5.566 14 6.5 14h7c.935 0 1.402 0 1.75.201.834.481.75 1.455.75 2.299s.084 1.818-.75 2.299c-.348.201-.815.201-1.75.201h-7c-.934 0-1.402 0-1.75-.201C3.917 18.318 4 17.344 4 16.5M20 2v20"/>',!0),y(n),G(e,n)}var dl=ue("<svg><!></svg>");function fl(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=dl();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16.502 8c.844 0 1.818-.083 2.299.75.201.348.201.815.201 1.75v1c0 .934 0 1.402-.201 1.75-.481.833-1.455.75-2.299.75s-1.818.083-2.3-.75c-.2-.348-.2-.816-.2-1.75v-1c0-.935 0-1.402.2-1.75.482-.833 1.456-.75 2.3-.75M7.502 8c.844 0 1.818-.083 2.299.75.201.348.201.815.201 1.75v7c0 .934 0 1.402-.201 1.75-.481.833-1.455.75-2.3.75-.843 0-1.817.083-2.298-.75-.201-.348-.201-.816-.201-1.75v-7c0-.935 0-1.402.2-1.75.482-.833 1.456-.75 2.3-.75M22 4H2"/>',!0),y(n),G(e,n)}var vl=ue("<svg><!></svg>");function hl(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=vl();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3.891 3.891C5.282 2.5 7.521 2.5 12 2.5c4.478 0 6.718 0 8.109 1.391S21.5 7.521 21.5 12c0 4.478 0 6.718-1.391 8.109S16.479 21.5 12 21.5c-4.478 0-6.718 0-8.109-1.391S2.5 16.479 2.5 12c0-4.478 0-6.718 1.391-8.109"/>',!0),y(n),G(e,n)}var pl=ue("<svg><!></svg>");function gl(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=pl();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M4.008 5c.59-.607 2.159-3 2.999-3s2.409 2.393 2.999 3m-3-2.15V22M19.002 13.995c.607.59 3 2.159 3 2.999s-2.393 2.409-3 2.998m2.189-2.998H1.998"/>',!0),y(n),G(e,n)}var _l=ue("<svg><!></svg>");function bl(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=_l();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M9.667 22h4.666M3.015 16.5c-.017-.5-.018-1-.016-1.5m17.986 1.5c.017-.5.018-1 .017-1.5M3.537 19.255a5 5 0 0 0 2.226 2.217m12.417.028a5 5 0 0 0 2.283-2.245"/><path stroke="currentColor" stroke-width="1.5" d="M5.505 12c-1.86 0-2.498-.54-2.498-2.5 0-2.532-.25-5.454 2.248-6.897C6.3 2 7.7 2 10.501 2H13.5c2.801 0 4.202 0 5.246.603 2.498 1.443 2.248 4.365 2.248 6.897 0 1.862-.54 2.5-2.498 2.5z"/>',!0),y(n),G(e,n)}var yl=ue("<svg><!></svg>");function wl(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=yl();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3.891 20.109C2.5 18.717 2.5 16.479 2.5 12c0-4.478 0-6.718 1.391-8.109S7.521 2.5 12 2.5c4.478 0 6.718 0 8.109 1.391S21.5 7.521 21.5 12c0 4.478 0 6.718-1.391 8.109S16.479 21.5 12 21.5c-4.478 0-6.718 0-8.109-1.391"/><path stroke="currentColor" stroke-width="1.5" d="M2.5 9h19M2.5 15h19M16 21.5v-19M8 21.5v-19"/>',!0),y(n),G(e,n)}var ml=ue("<svg><!></svg>");function kl(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=ml();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M6.09 15a6.9 6.9 0 0 1-.59-2.795C5.5 8.502 8.41 5.5 12 5.5s6.5 3.003 6.5 6.706A6.9 6.9 0 0 1 17.91 15"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 2v1M22 12h-1M3 12H2M19.07 4.928l-.707.707M5.637 5.636l-.707-.707M14.517 19.306c1.01-.327 1.416-1.252 1.53-2.182.034-.278-.195-.509-.475-.509H8.477a.483.483 0 0 0-.488.534c.112.928.394 1.607 1.464 2.157m5.064 0H9.453m5.064 0c-.121 1.945-.683 2.715-2.51 2.693-1.954.036-2.404-.916-2.554-2.693"/>',!0),y(n),G(e,n)}var xl=ue("<svg><!></svg>");function $l(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=xl();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-width="1.5" d="M2.5 12c0-4.478 0-6.718 1.391-8.109S7.521 2.5 12 2.5c4.478 0 6.718 0 8.109 1.391S21.5 7.521 21.5 12c0 4.478 0 6.718-1.391 8.109S16.479 21.5 12 21.5c-4.478 0-6.718 0-8.109-1.391S2.5 16.479 2.5 12Z"/><circle cx="16.5" cy="7.5" r="1.5" stroke="currentColor" stroke-width="1.5"/><path stroke="currentColor" stroke-linejoin="round" stroke-width="1.5" d="M16 22c-.62-2.225-2.065-4.218-4.123-5.666-2.22-1.561-5.005-2.387-7.861-2.331q-.51-.001-1.016.032"/><path stroke="currentColor" stroke-linejoin="round" stroke-width="1.5" d="M13 18c1.701-1.327 3.535-2.007 5.386-2a7.8 7.8 0 0 1 3.114.662"/>',!0),y(n),G(e,n)}var El=ue("<svg><!></svg>");function Sl(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=El();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<circle cx="16.5" cy="7.5" r="1.5" stroke="currentColor" stroke-width="1.5"/><path stroke="currentColor" stroke-linejoin="round" stroke-width="1.5" d="M2 14.135q1.001-.135 2.016-.132c2.856-.056 5.642.77 7.86 2.331C13.936 17.782 15.381 19.774 16 22"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M13.5 17.5c1-1 1.677-1.223 2.5-1.5"/><path stroke="currentColor" stroke-width="1.5" d="M20 20.213C18.601 21.5 16.363 21.5 12 21.5c-4.478 0-6.718 0-8.109-1.391S2.5 16.479 2.5 12c0-4.364 0-6.601 1.287-8"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M20 16c.543 0 1.048.294 1.397.564.103-1.195.103-2.681.103-4.564 0-4.478 0-6.718-1.391-8.109S16.479 2.5 12 2.5c-2.41 0-4.17 0-5.5.217M2 2l20 20"/>',!0),y(n),G(e,n)}var Ml=ue("<svg><!></svg>");function Vo(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=Ml();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M13 3.002Q12.295 3 11.5 3C7.022 3 4.782 3 3.391 4.391S2 8.021 2 12.5c0 4.478 0 6.718 1.391 8.109S7.021 22 11.5 22c4.478 0 6.718 0 8.109-1.391 1.338-1.339 1.389-3.462 1.39-7.609"/><path stroke="currentColor" stroke-linejoin="round" stroke-width="1.5" d="M2 14.135q.93-.135 1.872-.132c2.652-.056 5.239.77 7.3 2.331 1.91 1.448 3.253 3.44 3.828 5.666"/><path stroke="currentColor" stroke-linejoin="round" stroke-width="1.5" d="M21 16.896c-1.175-.595-2.391-.897-3.614-.896-1.851-.007-3.684.673-5.386 2"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 4.5c.491-.506 1.8-2.5 2.5-2.5M22 4.5c-.491-.506-1.8-2.5-2.5-2.5m0 0v8"/>',!0),y(n),G(e,n)}var Al=ue("<svg><!></svg>");function Ll(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=Al();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path d="M21.5 14.078A8.557 8.557 0 0 1 9.922 2.5C5.668 3.497 2.5 7.315 2.5 11.873a9.627 9.627 0 0 0 9.627 9.627c4.558 0 8.376-3.168 9.373-7.422"/>',!0),y(n),G(e,n)}var Cl=ue("<svg><!></svg>");function Tl(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=Cl();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M12 16.5v-2"/><path stroke="currentColor" stroke-width="1.5" d="M4.268 18.845c.225 1.67 1.608 2.979 3.292 3.056 1.416.065 2.855.099 4.44.099s3.024-.034 4.44-.1c1.684-.076 3.067-1.385 3.292-3.055.147-1.09.268-2.207.268-3.345s-.121-2.255-.268-3.345c-.225-1.67-1.608-2.979-3.292-3.056A95 95 0 0 0 12 9c-1.585 0-3.024.034-4.44.1-1.684.076-3.067 1.385-3.292 3.055C4.12 13.245 4 14.362 4 15.5s.121 2.255.268 3.345Z"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M7.5 9V6.5a4.5 4.5 0 0 1 9 0V9"/>',!0),y(n),G(e,n)}var Ol=ue("<svg><!></svg>");function Gl(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=Ol();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M12 16.5v-2"/><path stroke="currentColor" stroke-width="1.5" d="M4.268 18.845c.225 1.67 1.608 2.979 3.292 3.056 1.416.065 2.855.099 4.44.099s3.024-.034 4.44-.1c1.684-.076 3.067-1.385 3.292-3.055.147-1.09.268-2.207.268-3.345s-.121-2.255-.268-3.345c-.225-1.67-1.608-2.979-3.292-3.056A95 95 0 0 0 12 9c-1.585 0-3.024.034-4.44.1-1.684.076-3.067 1.385-3.292 3.055C4.12 13.245 4 14.362 4 15.5s.121 2.255.268 3.345Z"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M7.5 9V6.5A4.5 4.5 0 0 1 12 2c1.96 0 3.5 1.5 4 3"/>',!0),y(n),G(e,n)}var Pl=ue("<svg><!></svg>");function Dl(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=Pl();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",stroke:"currentColor","stroke-width":"1.5",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path d="M17 12a5 5 0 1 1-10 0 5 5 0 0 1 10 0ZM12 2v1.5m0 17V22m7.07-2.929-1.06-1.06M5.99 5.989 4.928 4.93M22 12h-1.5m-17 0H2m17.071-7.071-1.06 1.06M5.99 18.011l-1.06 1.06"/>',!0),y(n),G(e,n)}const ni=(e,t)=>t.some(r=>e instanceof r);let Xo,Wo;function Il(){return Xo||(Xo=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function jl(){return Wo||(Wo=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const ii=new WeakMap,oi=new WeakMap,fn=new WeakMap;function Rl(e){const t=new Promise((r,n)=>{const i=()=>{e.removeEventListener("success",o),e.removeEventListener("error",a)},o=()=>{r(Ft(e.result)),i()},a=()=>{n(e.error),i()};e.addEventListener("success",o),e.addEventListener("error",a)});return fn.set(t,e),t}function zl(e){if(ii.has(e))return;const t=new Promise((r,n)=>{const i=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",a),e.removeEventListener("abort",a)},o=()=>{r(),i()},a=()=>{n(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",o),e.addEventListener("error",a),e.addEventListener("abort",a)});ii.set(e,t)}let si={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return ii.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Ft(e[t])},set(e,t,r){return e[t]=r,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function qo(e){si=e(si)}function Nl(e){return jl().includes(e)?function(...t){return e.apply(ai(this),t),Ft(this.request)}:function(...t){return Ft(e.apply(ai(this),t))}}function Fl(e){return typeof e=="function"?Nl(e):(e instanceof IDBTransaction&&zl(e),ni(e,Il())?new Proxy(e,si):e)}function Ft(e){if(e instanceof IDBRequest)return Rl(e);if(oi.has(e))return oi.get(e);const t=Fl(e);return t!==e&&(oi.set(e,t),fn.set(t,e)),t}const ai=e=>fn.get(e);function Bl(e,t,{blocked:r,upgrade:n,blocking:i,terminated:o}={}){const a=indexedDB.open(e,t),c=Ft(a);return n&&a.addEventListener("upgradeneeded",l=>{n(Ft(a.result),l.oldVersion,l.newVersion,Ft(a.transaction),l)}),r&&a.addEventListener("blocked",l=>r(l.oldVersion,l.newVersion,l)),c.then(l=>{o&&l.addEventListener("close",()=>o()),i&&l.addEventListener("versionchange",d=>i(d.oldVersion,d.newVersion,d))}).catch(()=>{}),c}const Ul=["get","getKey","getAll","getAllKeys","count"],Hl=["put","add","delete","clear"],li=new Map;function Zo(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(li.get(t))return li.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,i=Hl.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||Ul.includes(r)))return;const o=async function(a,...c){const l=this.transaction(a,i?"readwrite":"readonly");let d=l.store;return n&&(d=d.index(c.shift())),(await Promise.all([d[r](...c),i&&l.done]))[0]};return li.set(t,o),o}qo(e=>({...e,get:(t,r,n)=>Zo(t,r)||e.get(t,r,n),has:(t,r)=>!!Zo(t,r)||e.has(t,r)}));const Yl=["continue","continuePrimaryKey","advance"],Ko={},ci=new WeakMap,Jo=new WeakMap,Vl={get(e,t){if(!Yl.includes(t))return e[t];let r=Ko[t];return r||(r=Ko[t]=function(...n){ci.set(this,Jo.get(this)[t](...n))}),r}};async function*Xl(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const r=new Proxy(t,Vl);for(Jo.set(r,t),fn.set(r,ai(t));t;)yield r,t=await(ci.get(r)||t.continue()),ci.delete(r)}function Qo(e,t){return t===Symbol.asyncIterator&&ni(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&ni(e,[IDBIndex,IDBObjectStore])}qo(e=>({...e,get(t,r,n){return Qo(t,r)?Xl:e.get(t,r,n)},has(t,r){return Qo(t,r)||e.has(t,r)}}));class ui extends Error{details;constructor(t,r){super(t),this.name="ValidationError",this.details=r}}const ur=ui;class Ie extends Error{constructor(t,r){super(t),this.originalError=r,this.name="DatabaseError"}}function Wl(e,t){const r=t?`${t}: `:"";return e instanceof ui?{message:r+e.message,details:e.details}:e instanceof Error?{message:r+e.message}:{message:r+"An unknown error occurred"}}const Tr=new Map,es={emit(e,t){Tr.get(e)?.forEach(r=>{try{r(t)}catch(n){console.error("[EventBus]",n)}})},on(e,t){return Tr.has(e)||Tr.set(e,new Set),Tr.get(e).add(t),()=>Tr.get(e)?.delete(t)}},ql="PixelMirrorDB",Zl=2;function ts(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e,r=>r.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)}`}let di;async function je(){return di||(di=Bl(ql,Zl,{upgrade(e){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")}})),di}async function rs(){try{return(await(await je()).getAll("mockups")).sort((r,n)=>n.createdAt-r.createdAt)}catch(e){throw new Ie("Failed to load mockups",e)}}async function Kl(e){try{const r=(await je()).transaction(["mockups","mockup_blobs"],"readonly"),[n,i]=await Promise.all([r.objectStore("mockups").get(e),r.objectStore("mockup_blobs").get(e)]);return await r.done,!n||!i?void 0:{...n,originalBuffer:i}}catch(t){throw new Ie("Failed to get mockup",t)}}async function Jl(e){try{const t=Array.isArray(e)?e:[e],n=(await je()).transaction(["mockups","mockup_blobs"],"readwrite"),i=n.objectStore("mockups"),o=n.objectStore("mockup_blobs"),a=Date.now(),c=t.map((l,d)=>{const v=ts(),{originalBuffer:h,...u}=l,g={...u,id:v,createdAt:a+d};return Promise.all([i.put(g),o.put(h,v)])});await Promise.all(c),await n.done}catch(t){throw new Ie("Failed to add mockups",t)}}async function Ql(e){try{const r=(await je()).transaction(["mockups","mockup_blobs"],"readwrite");await Promise.all([r.objectStore("mockups").delete(e),r.objectStore("mockup_blobs").delete(e)]),await r.done}catch(t){throw new Ie("Failed to delete mockup",t)}}async function ec(){try{const t=(await je()).transaction(["mockups","mockup_blobs"],"readwrite");await Promise.all([t.objectStore("mockups").clear(),t.objectStore("mockup_blobs").clear()]),await t.done}catch(e){throw new Ie("Failed to reset mockups",e)}}async function fi(){try{return(await(await je()).getAll("grids")).sort((r,n)=>r.createdAt-n.createdAt)}catch(e){throw new Ie("Failed to load grids",e)}}async function tc(e){try{return await(await je()).get("grids",e)}catch(t){throw new Ie("Failed to get grid",t)}}async function vn(e){try{const t=await je(),r={...e,id:ts(),createdAt:Date.now()};return await t.put("grids",r),r.id}catch(t){throw new Ie("Failed to add grid",t)}}async function rc(e){try{await(await je()).delete("grids",e)}catch(t){throw new Ie("Failed to delete grid",t)}}async function nc(){try{await(await je()).clear("grids")}catch(e){throw new Ie("Failed to reset grids",e)}}async function hn(e){try{return await(await je()).get("settings",e)||{}}catch(t){throw new Ie("Failed to load settings",t)}}async function J(e,t,r){try{const i=(await je()).transaction("settings","readwrite"),o=i.objectStore("settings"),a=await o.get(e)||{};await o.put({...a,[t]:r},e),await i.done;const c={[t]:r};es.emit(e,c)}catch(n){throw new Ie("Failed to update setting",n)}}async function ic(){try{await(await je()).delete("settings","gridOverlay")}catch(e){throw new Ie("Failed to reset grid overlay settings",e)}}const Or={width:"1140px",columns:12,gutterWidth:"24px",isGutterOnOutside:!0,position:"center"},dr={showLayoutGrid:!1,layoutGridColor:"rgba(0, 0, 255, 0.05)",showSpacingGrid:!1,spacingGridColor:"rgba(255, 0, 0, 0.05)",spacingGridHeight:"8px"},pn=352,ns=.05,is=.1,os=.9,ss=.5,vi=[.5,1],oc=2,as=10*1024*1024,gn=["image/png","image/jpeg","image/webp","image/gif"],sc=300,ls=5,cs=10,us=150;let ds=!1;function ac(){let e=M(void 0);const t=(r,n)=>{const i=Wl(r,n);f(e,i.message,!0),console.error("[PixelMirror]",i.message,i.details??"")};return typeof window<"u"&&!ds&&(ds=!0,window.addEventListener("unhandledrejection",r=>{r.preventDefault(),t(r.reason)})),{get errorMessage(){return s(e)},showError:t,clear:()=>{f(e,void 0)}}}const O=ac();function _n(e,t,r){return Math.min(Math.max(e,t),r)}function fs(e,t){const r=Math.pow(10,t);return Math.round(e*r)/r}function lc(){let e=M(null),t=M(!1),r=M(!1),n=M(ce(ss)),i=M(ce({x:0,y:0})),o=M("center"),a=M("top"),c=M(1),l=M("visible"),d=M(null),v=M(void 0),h=M(ce({width:0,height:0})),u=M(ce({x:0,y:0})),g=M(!1),_=M("visible"),k=se(()=>{if(s(o)===null&&s(a)===null)return`x:${Math.round(s(u).x)}, y:${Math.round(s(u).y)}`;const p=[];return s(a)&&p.push(s(a)),s(o)&&p.push(s(o)),p.join("·")}),b=M(!1),$=null,X={x:0,y:0},ne={x:0,y:0},D={x:0,y:0},Z={x:0,y:0},C=1,S={x:0,y:0},I={x:0,y:0},H=0,L=1,Q={x:0,y:0},oe={x:0,y:0},j={x:0,y:0},Y={x:0,y:0},ie=1;async function ee(p){if(!p){s(d)&&URL.revokeObjectURL(s(d)),f(d,null),f(v,void 0),f(h,{width:0,height:0},!0);return}if(!(s(v)?.id===p&&s(d)))try{const E=await Kl(p);if(E){s(d)&&URL.revokeObjectURL(s(d));const T=new Blob([E.originalBuffer],{type:E.mimeType}),q=URL.createObjectURL(T);f(d,q,!0),f(v,E,!0);const re=new Image;re.onload=()=>{f(h,{width:re.naturalWidth,height:re.naturalHeight},!0)},re.onerror=()=>{O.showError(new Error("Failed to load mockup image.")),f(h,{width:0,height:0},!0)},re.src=q}else O.showError(new Error("Mockup not found.")),f(d,null),f(v,void 0),f(h,{width:0,height:0},!0)}catch(E){O.showError(E,"Failed to load mockup"),f(d,null),f(v,void 0),f(h,{width:0,height:0},!0)}}function pe(){if(s(o)===null&&s(a)===null)return;const{clientWidth:p,scrollHeight:E}=document.documentElement,T=s(h).width*s(c),q=s(h).height*s(c);let re=s(u).x,Me=s(u).y;if(s(o)!==null)switch(s(o)){case"left":re=0;break;case"center":re=(p-T)/2|0;break;case"right":re=p-T;break}if(s(a)!==null)switch(s(a)){case"top":Me=0;break;case"bottom":Me=E-q;break}(re!==s(u).x||Me!==s(u).y)&&(f(u,{x:re,y:Me},!0),f(i,{x:re,y:Me},!0),J("mockupOverlay","position",{...s(i)}).catch(O.showError))}function te(){(s(o)!==null||s(a)!==null)&&(f(o,null),f(a,null),Promise.all([J("mockupOverlay","alignmentX",null),J("mockupOverlay","alignmentY",null)]).catch(O.showError))}function ae(p){if(s(l)!=="dragging")return;const E=p.clientX-X.x,T=p.clientY-X.y;f(u,{x:ne.x+E,y:ne.y+T},!0)}function x(){s(l)==="dragging"&&(window.removeEventListener("mousemove",ae),window.removeEventListener("mouseup",x),f(l,"visible"),te(),f(i,{...s(u)},!0),J("mockupOverlay","position",{...s(i)}).catch(O.showError))}function N(p){if(s(l)!=="zoomed")return;s(g)||f(g,!0);const E=p.clientX-Z.x,T=p.clientY-Z.y;f(u,{x:D.x-E,y:D.y-T},!0)}return{get initialized(){return s(b)},get activeMockupId(){return s(e)},get activeMockupUrl(){return s(d)},get mockupSize(){return s(h)},get isHidden(){return s(t)},get isLocked(){return s(r)},get opacity(){return s(n)},get position(){return s(u)},get alignmentX(){return s(o)},get alignmentY(){return s(a)},get isAligned(){return s(o)!==null||s(a)!==null},get scale(){return s(c)},get mode(){return s(l)},get isZoomPanning(){return s(g)},get isDragging(){return s(l)==="dragging"},get isSolidOrZoomed(){return s(l)==="solid"||s(l)==="zoomed"},get isVisibleOrLocked(){return s(l)==="visible"||s(l)==="locked"},get effectiveOpacity(){return s(l)==="solid"||s(l)==="zoomed"?1:s(n)},get positionDisplay(){return s(k)},init:async()=>(s(b)||$||($=(async()=>{try{const p=await hn("mockupOverlay");p.activeMockupId!==void 0&&f(e,p.activeMockupId,!0),p.isHidden!==void 0&&f(t,p.isHidden,!0),p.isLocked!==void 0&&f(r,p.isLocked,!0),p.opacity!==void 0&&f(n,p.opacity,!0),p.position!==void 0&&(f(i,p.position,!0),f(u,{...p.position},!0)),p.alignmentX!==void 0&&f(o,p.alignmentX,!0),p.alignmentY!==void 0&&f(a,p.alignmentY,!0),p.scale!==void 0&&f(c,p.scale,!0),await ee(s(e)),f(l,s(r)?"locked":"visible",!0),f(_,s(l),!0)}catch(p){O.showError(p,"Failed to load mockup overlay settings")}finally{f(b,!0),$=null}})()),$),setActiveMockup:p=>{f(e,p,!0),ee(p);const E=[J("mockupOverlay","activeMockupId",p)];p&&(s(t)&&(f(t,!1),E.push(J("mockupOverlay","isHidden",!1))),s(r)&&(f(r,!1),f(l,"visible"),f(_,"visible"),E.push(J("mockupOverlay","isLocked",!1)))),Promise.all(E).catch(O.showError)},toggleVisibility:()=>{(s(l)==="solid"||s(l)==="zoomed")&&(window.removeEventListener("mousemove",N),f(c,C||s(c),!0),f(u,{...s(i)},!0),f(g,!1),f(l,s(r)?"locked":"visible",!0)),f(t,!s(t)),J("mockupOverlay","isHidden",s(t)).catch(O.showError)},toggleLock:()=>{s(l)!=="visible"&&s(l)!=="locked"||(f(r,!s(r)),f(l,s(r)?"locked":"visible",!0),f(_,s(l),!0),J("mockupOverlay","isLocked",s(r)).catch(O.showError))},adjustOpacity:p=>{if(s(l)!=="visible"&&s(l)!=="locked")return;const E=p>0?-ns:ns,T=fs(s(n)+E,2);f(n,_n(T,is,os),!0),J("mockupOverlay","opacity",s(n)).catch(O.showError)},resetOpacity:()=>{s(l)!=="visible"&&s(l)!=="locked"||(f(n,ss,!0),J("mockupOverlay","opacity",s(n)).catch(O.showError))},cycleScale:()=>{if(s(l)!=="visible")return;const p=s(c),T=(vi.indexOf(p)+1)%vi.length,q=vi[T>=0?T:0],{clientWidth:re,clientHeight:Me}=document.documentElement,Te=window.scrollX+re/2,ze=window.scrollY+Me/2,{x:we,y:it}=s(u),Ae=Te-(Te-we)/p*q,ot=ze-(ze-it)/p*q;f(c,q,!0),f(u,{x:Ae,y:ot},!0),f(i,{x:Ae,y:ot},!0),te(),Promise.all([J("mockupOverlay","scale",s(c)),J("mockupOverlay","position",{...s(i)})]).catch(O.showError)},setAlignmentX:p=>{s(l)==="visible"&&(f(o,p,!0),J("mockupOverlay","alignmentX",p).catch(O.showError),pe())},setAlignmentY:p=>{s(l)==="visible"&&(f(a,p,!0),J("mockupOverlay","alignmentY",p).catch(O.showError),pe())},setAlignment:(p,E)=>{s(l)==="visible"&&(f(a,p,!0),f(o,E,!0),Promise.all([J("mockupOverlay","alignmentY",p),J("mockupOverlay","alignmentX",E)]).catch(O.showError),pe())},clearAlignment:()=>{s(l)==="visible"&&te()},updateAlignedPosition:pe,move:(p,E)=>{s(l)==="visible"&&(te(),f(u,{x:s(u).x+p,y:s(u).y+E},!0))},persistPosition:()=>{f(i,{...s(u)},!0),J("mockupOverlay","position",{...s(i)}).catch(O.showError)},startDrag:p=>{s(l)==="visible"&&(f(l,"dragging"),X={x:p.clientX,y:p.clientY},ne={...s(u)},window.addEventListener("mousemove",ae),window.addEventListener("mouseup",x))},enterSolidMode:()=>{s(l)!=="visible"&&s(l)!=="locked"||(f(_,s(l),!0),f(l,"solid"))},exitSolidMode:()=>{s(l)==="zoomed"&&(window.removeEventListener("mousemove",N),f(c,C,!0),f(u,{...s(i)},!0),f(g,!1)),(s(l)==="solid"||s(l)==="zoomed")&&f(l,s(_),!0)},enterZoomMode:p=>{if(s(l)!=="solid")return;f(l,"zoomed"),C=s(c);const E=s(c)*oc;f(c,E);const{clientX:T,clientY:q}=p,{x:re,y:Me}=s(u),Te=T+window.scrollX,ze=q+window.scrollY,we=(Te-re)/C,it=(ze-Me)/C,{clientWidth:Ae,clientHeight:ot}=document.documentElement,Bt=window.scrollX+Ae/2,fr=window.scrollY+ot/2;D={x:Bt-we*E,y:fr-it*E},Z={x:T,y:q},f(u,{...D},!0),window.addEventListener("mousemove",N)},exitZoomMode:()=>{s(l)==="zoomed"&&(window.removeEventListener("mousemove",N),f(l,"solid"),f(c,C,!0),f(u,{...s(i)},!0),f(g,!1))},cleanup:()=>{window.removeEventListener("mousemove",ae),window.removeEventListener("mouseup",x),window.removeEventListener("mousemove",N),s(d)&&URL.revokeObjectURL(s(d))},setOpacity:p=>{s(l)!=="visible"&&s(l)!=="locked"||(f(n,_n(fs(p,2),is,os),!0),J("mockupOverlay","opacity",s(n)).catch(O.showError))},startTouchDrag:p=>{if(s(l)!=="visible")return;const E=p.touches[0];f(l,"dragging"),S={x:E.clientX,y:E.clientY},I={...s(u)}},handleTouchDrag:p=>{if(s(l)!=="dragging")return;const E=p.touches[0],T=E.clientX-S.x,q=E.clientY-S.y;f(u,{x:I.x+T,y:I.y+q},!0)},endTouchDrag:()=>{s(l)==="dragging"&&(f(l,"visible"),te(),f(i,{...s(u)},!0),J("mockupOverlay","position",{...s(i)}).catch(O.showError))},toggleMobileSolidMode:()=>{s(l)==="solid"?(f(c,ie,!0),f(u,{...s(i)},!0),f(l,s(_),!0)):(s(l)==="visible"||s(l)==="locked")&&(f(_,s(l),!0),ie=s(c),f(l,"solid"))},startPinch:p=>{if(s(l)!=="solid"||p.touches.length<2)return;const E=p.touches[0],T=p.touches[1],q=T.clientX-E.clientX,re=T.clientY-E.clientY;H=Math.sqrt(q*q+re*re),L=s(c),oe={...s(u)},Q={x:(E.clientX+T.clientX)/2+window.scrollX,y:(E.clientY+T.clientY)/2+window.scrollY}},handlePinch:p=>{if(s(l)!=="solid"||p.touches.length<2||H===0)return;const E=p.touches[0],T=p.touches[1],q=T.clientX-E.clientX,re=T.clientY-E.clientY,Te=Math.sqrt(q*q+re*re)/H,ze=_n(L*Te,.25,4),we=(Q.x-oe.x)/L,it=(Q.y-oe.y)/L;f(u,{x:Q.x-we*ze,y:Q.y-it*ze},!0),f(c,ze,!0)},endPinch:()=>{H=0,L=s(c)},startGesturePinch:(p,E)=>{s(l)==="solid"&&(L=s(c),oe={...s(u)},Q={x:p,y:E})},handleGesturePinch:p=>{if(s(l)!=="solid")return;const E=_n(L*p,.25,4),T=(Q.x-oe.x)/L,q=(Q.y-oe.y)/L;f(u,{x:Q.x-T*E,y:Q.y-q*E},!0),f(c,E,!0)},startSolidPan:p=>{if(s(l)!=="solid")return;const E=p.touches[0];j={x:E.clientX,y:E.clientY},Y={...s(u)}},handleSolidPan:p=>{if(s(l)!=="solid")return;const E=p.touches[0],T=E.clientX-j.x,q=E.clientY-j.y;f(u,{x:Y.x+T,y:Y.y+q},!0)}}}const m=lc(),cc=new Set(["INPUT","SELECT","TEXTAREA"]),uc={ArrowUp:[0,-1],ArrowDown:[0,1],ArrowLeft:[-1,0],ArrowRight:[1,0]};function dc(){let e=M(!1),t=M(!1),r=M(!1),n=M(!1),i=null;function o(){return K.mode==="toolbar"&&!m.isHidden}function a(){let _=document.activeElement;for(;_?.shadowRoot?.activeElement;)_=_.shadowRoot.activeElement;if(!_)return!1;const k=_;return cc.has(k.tagName)||k.isContentEditable}function c(_){if(!o())return;const{mode:k}=m;k!=="visible"&&k!=="locked"||(_.preventDefault(),m.adjustOpacity(_.deltaY>0?-1:1))}function l(){i||(i=c,window.addEventListener("wheel",i,{passive:!1}))}function d(){i&&(window.removeEventListener("wheel",i),i=null)}function v(){s(e)&&(f(e,!1),d()),s(r)&&(f(r,!1),m.exitSolidMode()),f(t,!1)}function h(_){if(a())return;switch(_.key){case"Control":s(e)||(f(e,!0),l());return;case"Shift":f(t,!0);return}if(!o())return;const{mode:k}=m;switch(_.key){case" ":_.preventDefault(),!s(r)&&(k==="visible"||k==="locked")&&(f(r,!0),m.enterSolidMode());break;case"Escape":(k==="visible"||k==="locked")&&m.toggleLock();break;case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":{if(k!=="visible")return;_.preventDefault();const b=_.shiftKey?10:1,[$,X]=uc[_.key];m.move($*b,X*b);break}}}function u(_){switch(_.key){case" ":s(r)&&(f(r,!1),m.exitSolidMode());break;case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":m.mode==="visible"&&m.persistPosition();break;case"Control":s(e)&&(f(e,!1),d());break;case"Shift":f(t,!1);break}}function g(){document.hidden&&v()}return{get isControlPressed(){return s(e)},get isShiftPressed(){return s(t)},get isSpacePressed(){return s(r)},init:()=>{s(n)||(f(n,!0),window.addEventListener("keydown",h),window.addEventListener("keyup",u),window.addEventListener("blur",v),document.addEventListener("visibilitychange",g))},cleanup:()=>{s(n)&&(f(n,!1),window.removeEventListener("keydown",h),window.removeEventListener("keyup",u),window.removeEventListener("blur",v),document.removeEventListener("visibilitychange",g),d(),v())},resetModifierStates:v}}const Gr=dc(),hi=250,fc={toolbar:{width:380,height:44},mockups:{width:820,height:480},grids:{width:640,height:580}};function vc(){let e=M("toolbar"),t=M("bottom"),r=M("light"),n=M(!1),i=M(!0),o=M(!1),a=null;return{get initialized(){return s(o)},get mode(){return s(e)},get position(){return s(t)},get theme(){return s(r)},get managerVisible(){return s(n)},set managerVisible(c){f(n,c,!0)},get toolbarVisible(){return s(i)},set toolbarVisible(c){f(i,c,!0)},get size(){return fc[s(e)]},get isManagerMode(){return s(e)==="mockups"||s(e)==="grids"},init:async()=>(s(o)||a||(a=(async()=>{try{const c=await hn("dock");c.position&&f(t,c.position,!0),c.theme&&f(r,c.theme,!0)}catch(c){O.showError(c,"Failed to load dock settings")}finally{f(o,!0),a=null}})()),a),enterToolbar:()=>{f(n,!1),f(e,"toolbar"),f(i,!0),Gr.resetModifierStates()},enterMockups:()=>{Gr.resetModifierStates(),f(i,!1),f(e,"mockups"),f(n,!1)},enterGrids:()=>{Gr.resetModifierStates(),f(i,!1),f(e,"grids"),f(n,!1)},togglePosition:()=>{const c=s(t)==="bottom"?"top":"bottom";J("dock","position",c).catch(O.showError),f(t,c,!0)},toggleTheme:()=>{const c=s(r)==="light"?"dark":"light";J("dock","theme",c).catch(O.showError),f(r,c,!0)}}}const K=vc();var hc=ue("<svg><!></svg>");function vs(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=hc();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="m19.5 5.5-.62 10.025c-.158 2.561-.237 3.842-.88 4.763a4 4 0 0 1-1.2 1.128C15.843 22 14.56 22 11.994 22c-2.57 0-3.855 0-4.814-.585a4 4 0 0 1-1.2-1.13c-.642-.922-.72-2.205-.874-4.77L4.5 5.5M3 5.5h18m-4.944 0-.683-1.408c-.453-.936-.68-1.403-1.071-1.695a2 2 0 0 0-.275-.172C13.594 2 13.074 2 12.035 2c-1.066 0-1.599 0-2.04.234a2 2 0 0 0-.278.18c-.395.303-.616.788-1.058 1.757L8.053 5.5M9.5 16.5v-6M14.5 16.5v-6"/>',!0),y(n),G(e,n)}var pc=ue("<svg><!></svg>");function hs(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=pc();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path id="toggle-trigger" stroke="currentColor" stroke-width="1.5" d="M18 12c1 1.657-.343 3-2 3a3 3 0 1 1 3-3Z"/><path stroke="currentColor" stroke-width="1.5" d="M16 6H8a6 6 0 1 0 0 12h8a6 6 0 0 0 0-12Z"/>',!0),y(n),G(e,n)}function gc(){let e=M(ce(dr.showLayoutGrid)),t=M(""),r=M(void 0),n=M(ce(dr.layoutGridColor)),i=M(ce(dr.showSpacingGrid)),o=M(ce(dr.spacingGridColor)),a=M(ce(dr.spacingGridHeight)),c=M(!1),l=null;async function d(u){if(!u){f(r,void 0);return}try{const g=await tc(u);f(r,g,!0),g||O.showError(new Error("Grid not found."))}catch(g){f(r,void 0),O.showError(g,"Failed to load grid")}}function v(u){u.showLayoutGrid!==void 0&&f(e,u.showLayoutGrid,!0),u.layoutGridColor!==void 0&&f(n,u.layoutGridColor,!0),u.showSpacingGrid!==void 0&&f(i,u.showSpacingGrid,!0),u.spacingGridColor!==void 0&&f(o,u.spacingGridColor,!0),u.spacingGridHeight!==void 0&&f(a,u.spacingGridHeight,!0),u.activeLayoutGridId!==void 0&&(f(t,u.activeLayoutGridId,!0),d(s(t)))}const h=es.on("gridOverlay",v);return{get activeLayoutGridId(){return s(t)},get activeLayoutGrid(){return s(r)},get showLayoutGrid(){return s(e)},get layoutGridColor(){return s(n)},get showSpacingGrid(){return s(i)},get spacingGridColor(){return s(o)},get spacingGridHeight(){return s(a)},get initialized(){return s(c)},init:async()=>(s(c)||l||(l=(async()=>{try{const u=await hn("gridOverlay");u.activeLayoutGridId!==void 0&&f(t,u.activeLayoutGridId,!0),u.showLayoutGrid!==void 0&&f(e,u.showLayoutGrid,!0),u.layoutGridColor!==void 0&&f(n,u.layoutGridColor,!0),u.showSpacingGrid!==void 0&&f(i,u.showSpacingGrid,!0),u.spacingGridColor!==void 0&&f(o,u.spacingGridColor,!0),u.spacingGridHeight!==void 0&&f(a,u.spacingGridHeight,!0),await d(s(t))}catch(u){O.showError(u,"Failed to load grid overlay settings")}finally{f(c,!0),l=null}})()),l),syncSettings:v,cleanup:h}}const W=gc(),_c=/^\d+(\.\d+)?(px|%|em|rem|vw|vh)$/;function bn(e){return{success:!0,data:e}}function St(e,t){return{success:!1,error:new ui(e,t)}}function ps(e,t){const r=e.trim();return r?_c.test(r)?bn(r):St(`Invalid ${t} format`,`Expected format like "100px", "50%", or "1.5rem", got "${e}"`):St(`${t} is required`)}function bc(e,t,r=1,n=Number.MAX_SAFE_INTEGER){return Number.isInteger(e)?e<r||e>n?St(`${t} must be between ${r} and ${n}`,`Got ${e}`):bn(e):St(`${t} must be an integer`,`Got ${e}`)}function yc(e){const t=ps(e.width,"Width");if(!t.success)return t;const r=bc(e.columns,"Columns",1,100);if(!r.success)return r;const n=ps(e.gutterWidth,"Gutter width");if(!n.success)return n;const i=["left","center","right"];return i.includes(e.position)?bn({...e,width:t.data,columns:r.data,gutterWidth:n.data}):St("Invalid position",`Expected one of: ${i.join(", ")}`)}function wc(e){if(!e)return St("No file provided");if(!gn.includes(e.type))return St("Unsupported file type",`Allowed types: ${gn.map(t=>t.split("/")[1]).join(", ")}`);if(e.size>as){const t=as/1048576,r=(e.size/(1024*1024)).toFixed(2);return St("File too large",`Maximum size is ${t}MB, got ${r}MB`)}return bn(e)}function mc(e){const t=[],r=[];for(const n of e){const i=wc(n);i.success?t.push(i.data):r.push(new ur(`${n.name}: ${i.error.message}`,i.error.details))}return{validFiles:t,errors:r}}function kc(){let e=M(ce([])),t=M(!1),r=null;const n=async i=>{try{await J("gridOverlay","activeLayoutGridId",i)}catch(o){throw O.showError(o,"Failed to set active grid"),o}};return{get initialized(){return s(t)},get layoutGrids(){return s(e)},init:async()=>(s(t)||r||(r=(async()=>{try{const i=await fi();if(i.length===0){const o=await vn(Or);f(e,[{...Or,id:o,createdAt:Date.now()}],!0),await n(o)}else{f(e,i,!0);const o=await hn("gridOverlay");o.activeLayoutGridId?i.some(c=>c.id===o.activeLayoutGridId)||await n(i[0].id):await n(i[0].id)}}catch(i){O.showError(i,"Failed to load grids")}finally{f(t,!0),r=null}})()),r),toggleSpacingGrid:()=>{const i=!W.showSpacingGrid;J("gridOverlay","showSpacingGrid",i).catch(O.showError)},updateSpacingGridHeight:i=>{J("gridOverlay","spacingGridHeight",i).catch(O.showError)},updateSpacingGridColor:i=>{J("gridOverlay","spacingGridColor",i).catch(O.showError)},toggleLayoutGrid:()=>{const i=!W.showLayoutGrid;J("gridOverlay","showLayoutGrid",i).catch(O.showError)},updateLayoutGridColor:i=>{J("gridOverlay","layoutGridColor",i).catch(O.showError)},setActiveLayoutGrid:n,add:async i=>{const o=yc(i);if(!o.success){O.showError(o.error);return}try{const a=await vn(o.data);return f(e,await fi(),!0),await n(a),a}catch(a){O.showError(a,"Failed to add grid");return}},delete:async i=>{try{if(await rc(i),f(e,s(e).filter(o=>o.id!==i),!0),W.activeLayoutGridId===i){const o=s(e)[0];if(o)await n(o.id);else{const a=await vn(Or);f(e,await fi(),!0),await n(a)}}}catch(o){O.showError(o,"Failed to delete grid")}},reset:async()=>{try{await nc(),await ic();const i=await vn(Or);f(e,[{...Or,id:i,createdAt:Date.now()}],!0),await n(i),W.syncSettings(dr)}catch(i){O.showError(i,"Failed to reset grids")}}}}const Re=kc();var xc=ye('<tr role="button" tabindex="0"><td class="svelte-s2yrtn"> </td><td class="svelte-s2yrtn"> </td><td class="svelte-s2yrtn"> </td><td class="svelte-s2yrtn"> </td><td style="text-transform: capitalize;" class="svelte-s2yrtn"> </td><td class="table__actions svelte-s2yrtn"><button class="table__button table__button--delete svelte-s2yrtn" aria-label="Delete grid"><!></button></td></tr>'),$c=ye('<div class="container svelte-s2yrtn"><div class="inner svelte-s2yrtn"><section class="section svelte-s2yrtn"><header class="header svelte-s2yrtn"><h3 class="header__title svelte-s2yrtn">Spacing Grids</h3> <button><!></button></header> <div><fieldset class="fieldset svelte-s2yrtn"><legend class="fieldset__legend svelte-s2yrtn">Spacing Grid Height</legend> <input class="fieldset__input svelte-s2yrtn" type="text" spellcheck="false"/> <button class="fieldset__button svelte-s2yrtn">Update</button></fieldset> <fieldset class="fieldset svelte-s2yrtn"><legend class="fieldset__legend svelte-s2yrtn">Spacing Grid Color</legend> <input class="fieldset__input svelte-s2yrtn" type="text" spellcheck="false"/> <button class="fieldset__button svelte-s2yrtn">Update</button></fieldset></div></section> <section class="section svelte-s2yrtn"><div class="header svelte-s2yrtn"><h3 class="header__title svelte-s2yrtn">Layout Grids</h3> <button><!></button></div> <div><fieldset class="fieldset svelte-s2yrtn"><legend class="fieldset__legend svelte-s2yrtn">Layout Grid Color</legend> <input class="fieldset__input svelte-s2yrtn" type="text" spellcheck="false"/> <button class="fieldset__button svelte-s2yrtn">Update</button></fieldset> <div class="table-wrapper svelte-s2yrtn"><table class="table svelte-s2yrtn"><thead class="svelte-s2yrtn"><tr class="svelte-s2yrtn"><th class="svelte-s2yrtn">Width</th><th class="svelte-s2yrtn">Columns</th><th class="svelte-s2yrtn">Gutter Width</th><th class="svelte-s2yrtn">Outer Gutter</th><th class="svelte-s2yrtn">Position</th><th class="svelte-s2yrtn"></th></tr></thead><tbody class="svelte-s2yrtn"></tbody><tfoot class="svelte-s2yrtn"><tr class="svelte-s2yrtn"><td class="svelte-s2yrtn"><input type="text" placeholder="1140px" spellcheck="false" class="svelte-s2yrtn"/></td><td class="svelte-s2yrtn"><input type="text" inputmode="numeric" placeholder="12" spellcheck="false" class="svelte-s2yrtn"/></td><td class="svelte-s2yrtn"><input type="text" placeholder="24px" spellcheck="false" class="svelte-s2yrtn"/></td><td class="svelte-s2yrtn"><select class="svelte-s2yrtn"><option class="svelte-s2yrtn">Yes</option><option class="svelte-s2yrtn">No</option></select></td><td class="svelte-s2yrtn"><select class="svelte-s2yrtn"><option class="svelte-s2yrtn">Center</option><option class="svelte-s2yrtn">Left</option><option class="svelte-s2yrtn">Right</option></select></td><td class="svelte-s2yrtn"><button class="table__add-button svelte-s2yrtn">Add</button></td></tr></tfoot></table></div></div></section></div> <footer class="footer svelte-s2yrtn"><button class="footer__button svelte-s2yrtn">Reset All Settings</button> <button class="footer__button svelte-s2yrtn">Close</button></footer></div>');const Ec={hash:"svelte-s2yrtn",code:'.container.svelte-s2yrtn{height:100%;overflow:hidden}.inner.svelte-s2yrtn{height:100%;overflow:auto;overscroll-behavior:contain;padding:24px 24px 40px}@media (max-width:680px){.inner.svelte-s2yrtn{padding:16px 16px 32px}}.footer.svelte-s2yrtn{align-items:center;bottom:-18px;display:flex;gap:8px;left:0;margin:auto;position:absolute;right:0;width:max-content;z-index:1}.footer__button.svelte-s2yrtn{background:var(--btn-bg);border-radius:16px;color:var(--btn-fg)}.footer__button.svelte-s2yrtn:hover:not(:disabled){background:var(--btn-hover-bg)}.footer__button.svelte-s2yrtn:focus-visible{box-shadow:0 0 0 2px var(--focus-ring)}.footer__button.svelte-s2yrtn:disabled{background:var(--btn-disabled-bg);cursor:not-allowed}.footer__button.svelte-s2yrtn{font-size:15px;line-height:32px;width:160px}@media (max-width:420px){.footer__button.svelte-s2yrtn{font-size:14px;width:132px}}.section.svelte-s2yrtn:not(:last-child){margin-bottom:32px}.section__content.svelte-s2yrtn{transition:opacity .2s ease}.section__content.disabled.svelte-s2yrtn{opacity:.5;pointer-events:none}.header.svelte-s2yrtn{align-items:center;display:flex;justify-content:space-between;margin-bottom:8px}.header__title.svelte-s2yrtn{font-size:18px;line-height:24px;margin:0}.header__toggle-button.svelte-s2yrtn{background:var(--btn-bg);border-radius:16px;color:var(--btn-fg)}.header__toggle-button.svelte-s2yrtn:hover:not(:disabled){background:var(--btn-hover-bg)}.header__toggle-button.svelte-s2yrtn:focus-visible{box-shadow:0 0 0 2px var(--focus-ring)}.header__toggle-button.svelte-s2yrtn:disabled{background:var(--btn-disabled-bg);cursor:not-allowed}.header__toggle-button.svelte-s2yrtn{align-items:center;display:flex;font-size:15px;gap:4px;line-height:32px;padding:0 10px;width:116px}.header__toggle-button.svelte-s2yrtn:after{content:"Disabled";flex:1;text-align:center}.header__toggle-button.enabled.svelte-s2yrtn:after{content:"Enabled"}.header__toggle-button.svelte-s2yrtn >svg{flex:none}.header__toggle-button.svelte-s2yrtn #toggle-trigger{transform:translateX(-8px);transition:transform .25s cubic-bezier(.4,0,.2,1)}.header__toggle-button.enabled.svelte-s2yrtn #toggle-trigger{transform:translateX(0)}.fieldset.svelte-s2yrtn{align-items:center;border:2px solid var(--border-medium);border-radius:12px;display:flex;margin:0 0 16px;padding:8px 16px}.fieldset.svelte-s2yrtn:has(:where(.svelte-s2yrtn):focus-visible){box-shadow:0 0 0 2px var(--focus-ring)}.fieldset.svelte-s2yrtn:has(:where(.svelte-s2yrtn):focus-visible)>.fieldset__legend:where(.svelte-s2yrtn){box-shadow:0 0 0 2px var(--focus-ring)}.fieldset__legend.svelte-s2yrtn{background:var(--btn-bg);border-radius:6px;color:var(--btn-fg);font-size:15px;line-height:24px;margin-left:-4px;padding:0 8px}.fieldset__input.svelte-s2yrtn{background:transparent;border:none;color:var(--input-text);display:block;flex:1;font-family:monospace;font-size:16px;line-height:24px;outline:none;padding:8px 8px 8px 0;width:100%}.fieldset__input.svelte-s2yrtn::placeholder{color:var(--input-placeholder)}.fieldset__button.svelte-s2yrtn{background:var(--btn-bg);border-radius:16px;color:var(--btn-fg)}.fieldset__button.svelte-s2yrtn:hover:not(:disabled){background:var(--btn-hover-bg)}.fieldset__button.svelte-s2yrtn:focus-visible{box-shadow:0 0 0 2px var(--focus-ring)}.fieldset__button.svelte-s2yrtn:disabled{background:var(--btn-disabled-bg);cursor:not-allowed}.fieldset__button.svelte-s2yrtn{font-size:14px;line-height:24px;padding:0 12px}.table-wrapper.svelte-s2yrtn{border:2px solid var(--border-medium);border-radius:12px;margin-top:20px;overflow:auto}.table.svelte-s2yrtn{border-collapse:collapse;border-spacing:0;font-size:15px;line-height:16px;min-width:100%;text-align:left;white-space:nowrap;width:max-content}.table__actions.svelte-s2yrtn{text-align:center}.table__button--delete.svelte-s2yrtn{border-radius:8px;color:var(--text-secondary);transition:color .2s ease}.table__button--delete.svelte-s2yrtn >svg{height:16px;margin-top:2px;width:16px}.table__button--delete.svelte-s2yrtn:hover:not(:disabled){color:var(--color-danger)}.table__button--delete.svelte-s2yrtn:focus-visible{box-shadow:0 0 0 2px var(--focus-ring)}.table__button--delete.svelte-s2yrtn:disabled{cursor:not-allowed;opacity:.5}.table.svelte-s2yrtn>thead:where(.svelte-s2yrtn){border-bottom:1px solid var(--border-light);color:var(--text-primary)}.table.svelte-s2yrtn>tbody:where(.svelte-s2yrtn){color:var(--text-secondary);text-transform:capitalize}.table.svelte-s2yrtn>tbody:where(.svelte-s2yrtn)>tr:where(.svelte-s2yrtn){border-bottom:1px solid var(--border-light);cursor:pointer;outline:none;transition:background .2s ease,color .2s ease}.table.svelte-s2yrtn>tbody:where(.svelte-s2yrtn)>tr:where(.svelte-s2yrtn):hover{background:var(--color-success-bg)}.table.svelte-s2yrtn>tbody:where(.svelte-s2yrtn)>tr:where(.svelte-s2yrtn):focus-visible{box-shadow:inset 0 0 0 2px var(--focus-ring)}.table.svelte-s2yrtn>tbody:where(.svelte-s2yrtn)>tr.active:where(.svelte-s2yrtn){color:var(--color-success);cursor:default}.table.svelte-s2yrtn>tbody:where(.svelte-s2yrtn)>tr.active:where(.svelte-s2yrtn),.table.svelte-s2yrtn>tbody:where(.svelte-s2yrtn)>tr.active:where(.svelte-s2yrtn):hover{background:var(--color-success-bg)}.table.svelte-s2yrtn>tbody:where(.svelte-s2yrtn)>tr.active:where(.svelte-s2yrtn):focus-visible{box-shadow:inset 0 0 0 2px var(--focus-ring)}.table.svelte-s2yrtn th:where(.svelte-s2yrtn){height:40px;padding:0 8px}.table.svelte-s2yrtn th:where(.svelte-s2yrtn):not(:last-child){border-right:1px solid var(--border-light)}.table.svelte-s2yrtn td:where(.svelte-s2yrtn){height:32px;padding:0 8px}.table.svelte-s2yrtn td:where(.svelte-s2yrtn):not(:last-child){border-right:1px solid var(--border-light)}.table.svelte-s2yrtn>tfoot:where(.svelte-s2yrtn) td:where(.svelte-s2yrtn){height:40px;padding:0 8px}.table.svelte-s2yrtn>tfoot:where(.svelte-s2yrtn) input:where(.svelte-s2yrtn),.table.svelte-s2yrtn>tfoot:where(.svelte-s2yrtn) select:where(.svelte-s2yrtn){background:var(--input-bg);border:1px solid var(--input-border);border-radius:6px;color:var(--input-text);font-size:15px;height:24px;outline:none;padding:0 4px}@media (max-width:680px){.table.svelte-s2yrtn>tfoot:where(.svelte-s2yrtn) input:where(.svelte-s2yrtn),.table.svelte-s2yrtn>tfoot:where(.svelte-s2yrtn) select:where(.svelte-s2yrtn){font-size:16px}}.table.svelte-s2yrtn>tfoot:where(.svelte-s2yrtn) input:where(.svelte-s2yrtn):focus-visible,.table.svelte-s2yrtn>tfoot:where(.svelte-s2yrtn) select:where(.svelte-s2yrtn):focus-visible{box-shadow:0 0 0 2px var(--focus-ring)}.table.svelte-s2yrtn>tfoot:where(.svelte-s2yrtn) input:where(.svelte-s2yrtn){width:72px}.table.svelte-s2yrtn>tfoot:where(.svelte-s2yrtn) input:where(.svelte-s2yrtn)::placeholder{color:var(--input-placeholder)}.table.svelte-s2yrtn>tfoot:where(.svelte-s2yrtn) select:where(.svelte-s2yrtn){cursor:pointer}.table__add-button.svelte-s2yrtn{background:var(--btn-bg);border-radius:16px;color:var(--btn-fg)}.table__add-button.svelte-s2yrtn:hover:not(:disabled){background:var(--btn-hover-bg)}.table__add-button.svelte-s2yrtn:focus-visible{box-shadow:0 0 0 2px var(--focus-ring)}.table__add-button.svelte-s2yrtn:disabled{background:var(--btn-disabled-bg);cursor:not-allowed}.table__add-button.svelte-s2yrtn{font-size:14px;height:24px;padding:0 12px}'};function gs(e,t){bt(t,!0),Rt(e,Ec),lr(()=>{Re.init()});let r=M(ce(W.spacingGridHeight)),n=M(ce(W.spacingGridColor)),i=M(ce(W.layoutGridColor)),o=se(()=>s(r).trim()!==""&&s(r)!==W.spacingGridHeight),a=se(()=>s(n).trim()!==""&&s(n)!==W.spacingGridColor),c=se(()=>s(i).trim()!==""&&s(i)!==W.layoutGridColor);Pt(()=>{f(r,W.spacingGridHeight,!0),f(n,W.spacingGridColor,!0),f(i,W.layoutGridColor,!0)});let l=M(""),d=M(""),v=M(""),h=M(!0),u=M("center"),g=se(()=>s(l).trim()&&s(v).trim()&&/^\d+$/.test(s(d))&&Number(s(d))>0);function _(C,S,I){C.key==="Enter"&&I&&S()}function k(){Re.updateSpacingGridHeight(s(r).trim())}function b(){Re.updateSpacingGridColor(s(n).trim())}function $(){Re.updateLayoutGridColor(s(i).trim())}async function X(){await Re.add({width:/^\d+$/.test(s(l))?`${s(l)}px`:s(l),columns:Number(s(d)),gutterWidth:/^\d+$/.test(s(v))?`${s(v)}px`:s(v),isGutterOnOutside:s(h),position:s(u)}),f(l,""),f(d,""),f(v,""),f(h,!0),f(u,"center")}var ne=sr(),D=kt(ne);{var Z=C=>{var S=$c(),I=w(S),H=w(I),L=w(H),Q=A(w(L),2);let oe;Q.__click=function(...z){Re.toggleSpacingGrid?.apply(this,z)};var j=w(Q);hs(j,{}),y(Q),y(L);var Y=A(L,2);let ie;var ee=w(Y),pe=A(w(ee),2);zt(pe),pe.__keydown=z=>_(z,k,s(o));var te=A(pe,2);te.__click=k,y(ee);var ae=A(ee,2);let x;var N=A(w(ae),2);zt(N),N.__keydown=z=>_(z,b,s(a));var p=A(N,2);p.__click=b,y(ae),y(Y),y(H);var E=A(H,2),T=w(E),q=A(w(T),2);let re;q.__click=function(...z){Re.toggleLayoutGrid?.apply(this,z)};var Me=w(q);hs(Me,{}),y(q),y(T);var Te=A(T,2);let ze;var we=w(Te);let it;var Ae=A(w(we),2);zt(Ae),Ae.__keydown=z=>_(z,$,s(c));var ot=A(Ae,2);ot.__click=$,y(we);var Bt=A(we,2),fr=w(Bt),Mt=A(w(fr));Zn(Mt,21,()=>Re.layoutGrids,z=>z.id,(z,Ve)=>{const Fr=se(()=>W.activeLayoutGridId===s(Ve).id);var Xe=xc();Xe.__click=()=>Re.setActiveLayoutGrid(s(Ve).id),Xe.__keydown=Yr=>{(Yr.key==="Enter"||Yr.key===" ")&&(Yr.preventDefault(),Re.setActiveLayoutGrid(s(Ve).id))};let Br;var Ur=w(Xe),hr=w(Ur,!0);y(Ur);var pr=A(Ur),pi=w(pr,!0);y(pr);var gi=A(pr),eu=w(gi,!0);y(gi);var _i=A(gi),tu=w(_i,!0);y(_i);var bi=A(_i),ru=w(bi,!0);y(bi);var xs=A(bi),Hr=w(xs);Hr.__click=Yr=>{Yr.stopPropagation(),Re.delete(s(Ve).id)};var nu=w(Hr);vs(nu,{}),y(Hr),y(xs),y(Xe),Ee(()=>{Br=ke(Xe,1,"svelte-s2yrtn",null,Br,{active:s(Fr)}),vt(hr,s(Ve).width),vt(pi,s(Ve).columns),vt(eu,s(Ve).gutterWidth),vt(tu,s(Ve).isGutterOnOutside?"Yes":"No"),vt(ru,s(Ve).position),Hr.disabled=s(Fr),tt(Hr,"title",s(Fr)?"Cannot delete active grid":"Delete this grid")}),G(z,Xe)}),y(Mt);var yn=A(Mt),Ut=w(yn),Pr=w(Ut),Ht=w(Pr);zt(Ht),y(Pr);var Dr=A(Pr),wn=w(Dr);zt(wn),y(Dr);var Ir=A(Dr),Yt=w(Ir);zt(Yt),y(Ir);var vr=A(Ir),jr=w(vr),Rr=w(jr);Rr.value=Rr.__value=!0;var mn=A(Rr);mn.value=mn.__value=!1,y(jr),y(vr);var P=A(vr),At=w(P),Vt=w(At);Vt.value=Vt.__value="center";var ht=A(Vt);ht.value=ht.__value="left";var zr=A(ht);zr.value=zr.__value="right",y(At),y(P);var kn=A(P),Xt=w(kn);Xt.__click=X,y(kn),y(Ut),y(yn),y(fr),y(Bt),y(Te),y(E),y(I);var Nr=A(I,2),xn=w(Nr);xn.__click=function(...z){Re.reset?.apply(this,z)};var $n=A(xn,2);$n.__click=function(...z){K.enterToolbar?.apply(this,z)},y(Nr),y(S),Ee(()=>{oe=ke(Q,1,"header__toggle-button svelte-s2yrtn",null,oe,{enabled:W.showSpacingGrid}),ie=ke(Y,1,"section__content svelte-s2yrtn",null,ie,{disabled:!W.showSpacingGrid}),Y.inert=!W.showSpacingGrid,te.disabled=!s(o),x=Et(ae,"",x,{"background-color":s(n)}),p.disabled=!s(a),re=ke(q,1,"header__toggle-button svelte-s2yrtn",null,re,{enabled:W.showLayoutGrid}),ze=ke(Te,1,"section__content svelte-s2yrtn",null,ze,{disabled:!W.showLayoutGrid}),Te.inert=!W.showLayoutGrid,it=Et(we,"",it,{"background-color":s(i)}),ot.disabled=!s(c),Xt.disabled=!s(g)}),cr(pe,()=>s(r),z=>f(r,z)),cr(N,()=>s(n),z=>f(n,z)),cr(Ae,()=>s(i),z=>f(i,z)),cr(Ht,()=>s(l),z=>f(l,z)),cr(wn,()=>s(d),z=>f(d,z)),cr(Yt,()=>s(v),z=>f(v,z)),Io(jr,()=>s(h),z=>f(h,z)),Io(At,()=>s(u),z=>f(u,z)),G(C,S)};Se(D,C=>{Re.initialized&&C(Z)})}G(e,ne),yt()}xr(["click","keydown"]),Nt(gs,{},[],[],{mode:"open"});async function Sc(e){const t=await e.arrayBuffer(),r=await new Promise((n,i)=>{const o=new Image,a=URL.createObjectURL(e);o.onload=()=>{const c=Math.min(o.width,o.height),l=(o.width-c)/2,d=(o.height-c)/2,v=document.createElement("canvas");v.width=pn,v.height=pn;const h=v.getContext("2d");if(!h){URL.revokeObjectURL(a),i(new ur("Failed to get canvas context"));return}h.drawImage(o,l,d,c,c,0,0,pn,pn),v.toBlob(async u=>{URL.revokeObjectURL(a),u?n(await u.arrayBuffer()):i(new ur("Failed to create thumbnail"))},e.type,.8)},o.onerror=()=>{URL.revokeObjectURL(a),i(new ur(`Failed to load image: ${e.name}`))},o.src=a});return{originalBuffer:t,thumbnailBuffer:r,filename:e.name,mimeType:e.type}}async function Mc(e){const{validFiles:t,errors:r}=mc(e);if(t.length===0)return{data:[],errors:r};const n=await Promise.allSettled(t.map(Sc)),i=[],o=[...r];return n.forEach((a,c)=>{if(a.status==="fulfilled")i.push(a.value);else{const l=t[c],d=a.reason instanceof ur?a.reason:new ur(`Failed to process ${l.name}`,String(a.reason));o.push(d)}}),{data:i,errors:o}}function Ac(){let e=M(ce([])),t=M(!1),r=null;return{get initialized(){return s(t)},get mockups(){return s(e)},get activeMockupId(){return m.activeMockupId},init:async()=>(s(t)||r||(r=(async()=>{try{f(e,await rs(),!0)}catch(n){O.showError(n,"Failed to load mockups")}finally{f(t,!0),r=null}})()),r),upload:async n=>{if(n.length!==0)try{const{data:i,errors:o}=await Mc(n);o.length>0&&o.forEach(a=>O.showError(a)),i.length>0&&(await Jl(i),f(e,await rs(),!0))}catch(i){O.showError(i,"Failed to upload mockups")}},select:n=>{m.setActiveMockup(n)},delete:async n=>{try{await Ql(n),f(e,s(e).filter(i=>i.id!==n),!0),m.activeMockupId===n&&m.setActiveMockup(null)}catch(i){O.showError(i,"Failed to delete mockup")}},clear:async()=>{try{await ec(),f(e,[],!0),m.setActiveMockup(null)}catch(n){O.showError(n,"Failed to clear mockups")}}}}const nt=Ac();var Lc=ye('<div class="mockup__indicator svelte-12ri4gy"></div>'),Cc=ye('<div><button class="mockup__preview svelte-12ri4gy" type="button"><img class="mockup__image svelte-12ri4gy" draggable="false"/></button> <!> <button class="mockup__delete svelte-12ri4gy" title="Delete mockup"><!></button></div>'),Tc=ye('<div class="container svelte-12ri4gy" role="region" aria-label="Mockup Manager"><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> <input type="file" multiple class="svelte-12ri4gy"/></label> <!></div></div> <footer class="footer svelte-12ri4gy"><button class="footer__button svelte-12ri4gy">Clear Mockups</button> <button class="footer__button svelte-12ri4gy">Close</button></footer></div>');const Oc={hash:"svelte-12ri4gy",code:".container.svelte-12ri4gy{height:100%;overflow:hidden}.inner.svelte-12ri4gy{height:100%;overflow:auto;overscroll-behavior:contain;padding:24px 24px 40px}@media (max-width:680px){.inner.svelte-12ri4gy{padding:16px 16px 32px}}.footer.svelte-12ri4gy{align-items:center;bottom:-18px;display:flex;gap:8px;left:0;margin:auto;position:absolute;right:0;width:max-content;z-index:1}.footer__button.svelte-12ri4gy{background:var(--btn-bg);border-radius:16px;color:var(--btn-fg)}.footer__button.svelte-12ri4gy:hover:not(:disabled){background:var(--btn-hover-bg)}.footer__button.svelte-12ri4gy:focus-visible{box-shadow:0 0 0 2px var(--focus-ring)}.footer__button.svelte-12ri4gy:disabled{background:var(--btn-disabled-bg);cursor:not-allowed}.footer__button.svelte-12ri4gy{font-size:15px;line-height:32px;width:160px}@media (max-width:420px){.footer__button.svelte-12ri4gy{font-size:14px;width:132px}}.grid.svelte-12ri4gy{display:grid;gap:16px;grid-template-columns:repeat(4,1fr)}.upload-button.svelte-12ri4gy{align-items:center;aspect-ratio:1/1;background:transparent;border:2px solid var(--mockup-border);border-radius:16px;cursor:pointer;display:flex;flex-direction:column;justify-content:center;outline:none;transition:background .2s ease}.upload-button.svelte-12ri4gy:focus-visible,.upload-button.svelte-12ri4gy:has(:where(.svelte-12ri4gy):focus-visible),.upload-button.svelte-12ri4gy:hover{background:var(--focus-bg);border-color:var(--mockup-border-hover);box-shadow:0 0 0 2px var(--focus-ring)}.upload-button__icon.svelte-12ri4gy{height:32px;margin-bottom:12px;width:32px}.upload-button__icon.svelte-12ri4gy >svg{height:100%;width:100%}.upload-button__text.svelte-12ri4gy{font-size:15px;font-weight:500;line-height:24px}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/1;position:relative}@media (hover:hover){.mockup.svelte-12ri4gy:hover .mockup__delete:where(.svelte-12ri4gy){opacity:1}}.mockup.active.svelte-12ri4gy .mockup__preview:where(.svelte-12ri4gy){border-color:var(--mockup-border-hover)}.mockup__preview.svelte-12ri4gy{border:2px solid var(--mockup-border);border-radius:16px;display:block;height:100%;overflow:hidden;width:100%}.mockup__preview.svelte-12ri4gy:focus,.mockup__preview.svelte-12ri4gy:hover{border-color:var(--mockup-border-hover);box-shadow:0 0 0 2px var(--focus-ring)}.mockup__image.svelte-12ri4gy{height:100%;object-fit:cover;width:100%}.mockup__indicator.svelte-12ri4gy{background:var(--color-success);border-radius:50%;box-shadow:0 0 0 2px var(--dock-bg);height:12px;left:12px;pointer-events:none;position:absolute;top:12px;width:12px}.mockup__delete.svelte-12ri4gy{align-items:center;background:var(--btn-bg);border-radius:16px;bottom:12px;color:var(--btn-fg);display:flex;height:32px;justify-content:center;padding:4px;position:absolute;right:12px;transition:background .2s ease,opacity .2s ease;width:32px;z-index:1}@media (hover:hover){.mockup__delete.svelte-12ri4gy{opacity:0}}.mockup__delete.svelte-12ri4gy >svg{height:20px;width:20px}.mockup__delete.svelte-12ri4gy:focus-visible,.mockup__delete.svelte-12ri4gy:hover{background:var(--btn-hover-bg);box-shadow:0 0 0 2px var(--focus-ring);opacity:1}@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 _s(e,t){bt(t,!0),Rt(e,Oc),lr(()=>{nt.init()});function r(h){const u=h.target;u.files&&nt.upload(Array.from(u.files)),u.value=""}function n(h){h.preventDefault(),h.stopPropagation()}function i(h){h.preventDefault(),h.stopPropagation();const u=Array.from(h.dataTransfer?.files||[]).filter(g=>gn.includes(g.type));nt.upload(u)}function o(h,u){h.stopPropagation(),nt.delete(u)}function a(h){K.enterToolbar(),setTimeout(()=>nt.select(h),hi)}function c(h,{buffer:u,mimeType:g}){let _;function k(b,$){_&&URL.revokeObjectURL(_);const X=new Blob([b],{type:$});_=URL.createObjectURL(X),h.src=_}return k(u,g),{update({buffer:b,mimeType:$}){k(b,$)},destroy(){_&&URL.revokeObjectURL(_)}}}var l=sr(),d=kt(l);{var v=h=>{var u=Tc(),g=w(u),_=w(g),k=w(_),b=w(k),$=w(b);Vo($,{}),y(b);var X=A(b,4);X.__change=r,y(k);var ne=A(k,2);Zn(ne,17,()=>nt.mockups,S=>S.id,(S,I)=>{const H=se(()=>nt.activeMockupId===s(I).id);var L=Cc();let Q;var oe=w(L);oe.__click=()=>a(s(I).id);var j=w(oe);To(j,(te,ae)=>c?.(te,ae),()=>({buffer:s(I).thumbnailBuffer,mimeType:s(I).mimeType})),y(oe);var Y=A(oe,2);{var ie=te=>{var ae=Lc();G(te,ae)};Se(Y,te=>{s(H)&&te(ie)})}var ee=A(Y,2);ee.__click=te=>o(te,s(I).id);var pe=w(ee);vs(pe,{}),y(ee),y(L),Ee(()=>{Q=ke(L,1,"mockup svelte-12ri4gy",null,Q,{active:s(H)}),oe.disabled=s(H),tt(j,"alt",s(I).filename)}),Eo(j),G(S,L)}),y(_),y(g);var D=A(g,2),Z=w(D);Z.__click=function(...S){nt.clear?.apply(this,S)};var C=A(Z,2);C.__click=function(...S){K.enterToolbar?.apply(this,S)},y(D),y(u),Ee(S=>{tt(X,"accept",S),Z.disabled=nt.mockups.length===0},[()=>gn.join(",")]),or("drop",u,i),or("dragover",u,n),G(h,u)};Se(d,h=>{nt.initialized&&h(v)})}G(e,l),yt()}xr(["change","click"]),Nt(_s,{},[],[],{mode:"open"});var Gc=ye('<div class="dock__popover svelte-19cxvb5"><div class="alignment-group alignment-group--vertical svelte-19cxvb5"><button title="Align top"><!></button> <button title="Align bottom"><!></button></div> <div class="alignment-group alignment-group--horizontal svelte-19cxvb5"><button title="Align left"><!></button> <button title="Align center horizontally"><!></button> <button title="Align right"><!></button></div></div>'),Pc=ye('<div class="toolbar svelte-19cxvb5"><button class="icon-button svelte-19cxvb5"><!></button> <button class="icon-button svelte-19cxvb5"><!></button> <button title="Opacity (Click to reset, Ctrl+Scroll to adjust)"><!> <span class="opacity-button__value svelte-19cxvb5"> </span></button> <button class="icon-button alignment-trigger-btn svelte-19cxvb5" title="Alignment (Click for top-center)"><!></button> <button class="icon-button scale-button svelte-19cxvb5" title="Scale (1x ↔ 0.5x)"><!> <span class="scale-button__value svelte-19cxvb5"> </span></button> <button class="icon-button svelte-19cxvb5" title="Mockup Manager"><!></button> <button class="icon-button svelte-19cxvb5" title="Grid Manager"><!></button> <button class="icon-button svelte-19cxvb5" title="Toggle theme"><!></button> <button title="Toggle dock position"><!></button></div> <!>',1),Dc=ye('<div class="manager-wrapper svelte-19cxvb5"><!></div>'),Ic=ye('<div class="manager-wrapper svelte-19cxvb5"><!></div>'),jc=ye('<div class="dock__coordinates svelte-19cxvb5"> </div>'),Rc=ye("<div><!> <!></div>");const zc={hash:"svelte-19cxvb5",code:".dock.svelte-19cxvb5{align-items:center;background:var(--dock-bg);border:2px solid var(--dock-border);border-radius:32px;bottom:24px;color:var(--dock-fg);display:flex;font-family:Arial,sans-serif;justify-content:center;left:8px;margin-left:auto;margin-right:auto;max-height:75vh;max-width:calc(100vw - 16px);outline:2px solid var(--dock-outline);position:fixed;right:8px;transform:translateZ(0);transition:width var(--transition-duration) cubic-bezier(.4,0,.2,1),height var(--transition-duration) cubic-bezier(.4,0,.2,1),border-radius var(--transition-duration) cubic-bezier(.4,0,.2,1);will-change:width,height,border-radius;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:40px}.dock.is-dragging.svelte-19cxvb5{pointer-events:none}.dock__coordinates.svelte-19cxvb5{background:var(--btn-bg);border-radius:16px;bottom:calc(100% + 8px);color:var(--btn-fg);font-family:monospace;font-size:12px;left:0;line-height:20px;margin:auto;padding:0 8px;position:absolute;right:0;white-space:nowrap;width:max-content;z-index:1}.dock__popover.svelte-19cxvb5{align-items:center;background:var(--dock-bg);border:2px solid var(--dock-border);border-bottom:none;border-radius:12px 12px 0 0;bottom:100%;display:flex;left:74px;overflow:hidden;padding:4px 4px 0;position:absolute;z-index:2}.dock__popover.svelte-19cxvb5 button:focus,.toolbar.svelte-19cxvb5 button:focus{outline:none}.toolbar.svelte-19cxvb5{align-items:center;display:flex;flex-shrink:0;max-width:100%;overflow-x:auto;padding:0 8px;-webkit-overflow-scrolling:touch;-ms-overflow-style:none;scrollbar-width:none}.toolbar.svelte-19cxvb5::-webkit-scrollbar{display:none}.icon-button.svelte-19cxvb5{padding:6px}.icon-button.svelte-19cxvb5:focus-visible{background:var(--focus-bg)}.icon-button.svelte-19cxvb5:disabled{cursor:not-allowed;opacity:.5}.icon-button.flip.svelte-19cxvb5{transform:rotate(180deg)}.icon-button.flip.svelte-19cxvb5:active{transform:scale(.95) rotate(180deg)}.opacity-button.svelte-19cxvb5{position:relative}.opacity-button.sliding.svelte-19cxvb5{background:var(--btn-hover);opacity:1}.opacity-button__value.svelte-19cxvb5{font-size:8px;font-weight:700;left:0;line-height:12px;position:absolute;right:0;text-align:center;top:14px;z-index:1}.scale-button.svelte-19cxvb5{position:relative}.scale-button__value.svelte-19cxvb5{font-size:11.5px;font-weight:700;height:16px;inset:0;line-height:16px;margin:auto;position:absolute;text-align:center;z-index:1}.alignment-group.svelte-19cxvb5{align-items:center;border-radius:6px;display:flex;padding:2px}.alignment-group.svelte-19cxvb5+.alignment-group:where(.svelte-19cxvb5){margin-left:4px}.alignment-group--vertical.svelte-19cxvb5{background:var(--align-y-bg)}.alignment-group--vertical.svelte-19cxvb5 .alignment-button:where(.svelte-19cxvb5):hover{background:var(--align-y-hover)}.alignment-group--vertical.svelte-19cxvb5 .alignment-button.active:where(.svelte-19cxvb5),.alignment-group--vertical.svelte-19cxvb5 .alignment-button:where(.svelte-19cxvb5):active{background:var(--align-y-active)}.alignment-group--horizontal.svelte-19cxvb5{background:var(--align-x-bg)}.alignment-group--horizontal.svelte-19cxvb5 .alignment-button:where(.svelte-19cxvb5):hover{background:var(--align-x-hover)}.alignment-group--horizontal.svelte-19cxvb5 .alignment-button.active:where(.svelte-19cxvb5),.alignment-group--horizontal.svelte-19cxvb5 .alignment-button:where(.svelte-19cxvb5):active{background:var(--align-x-active)}.alignment-button.svelte-19cxvb5{border-radius:6px;padding:2px}.alignment-button.svelte-19cxvb5:focus-visible{box-shadow:0 0 0 2px var(--focus-ring)}.alignment-button.svelte-19cxvb5 >svg{height:24px;width:24px}.manager-wrapper.svelte-19cxvb5{height:100%;width:100%}.manager-wrapper.svelte-19cxvb5 .inner{animation:svelte-19cxvb5-a .2s cubic-bezier(.4,0,.2,1)}@keyframes svelte-19cxvb5-a{0%{opacity:0}to{opacity:1}}@media (max-width:680px){.dock.is-manager.svelte-19cxvb5{border-radius:24px}}"};function bs(e,t){bt(t,!0),Rt(e,zc);let r=M(!1),n,i=M(!1),o=0,a=0,c=se(()=>Math.round(m.opacity*100)),l=se(()=>m.scale===.5?".5x":`${m.scale}x`),d=se(()=>!m.activeMockupId),v=se(()=>m.isHidden),h=se(()=>m.isLocked),u=se(()=>m.isDragging),g=se(()=>s(d)||s(v)),_=se(()=>K.mode==="toolbar"&&!s(r)&&!s(g));function k(){Yo()||s(u)||f(r,!0)}function b(j){if(Yo())return;const Y=j.relatedTarget;Y?.closest(".dock__popover")||Y?.closest(".alignment-trigger-btn")||f(r,!1)}function $(){const j=m.alignmentY==="top"&&m.alignmentX==="center";s(r)?j?f(r,!1):m.setAlignment("top","center"):f(r,!0)}function X(j){Cr()&&(j.preventDefault(),f(i,!0),o=j.touches[0].clientX,a=m.opacity,window.addEventListener("touchmove",ne,{passive:!1}),window.addEventListener("touchend",D))}function ne(j){if(!s(i))return;j.preventDefault();const ie=(j.touches[0].clientX-o)/200,ee=a+ie;m.setOpacity(ee)}function D(){f(i,!1),window.removeEventListener("touchmove",ne),window.removeEventListener("touchend",D)}Pt(()=>{if(!Cr()||!s(r))return;const j=ie=>{ie.composedPath().includes(n)||f(r,!1)},Y=setTimeout(()=>{window.addEventListener("touchend",j)},0);return()=>{clearTimeout(Y),window.removeEventListener("touchend",j)}}),Pt(()=>{if(!K.isManagerMode)return;const j=setTimeout(()=>{K.managerVisible=!0},hi),Y=ee=>{ee.composedPath().includes(n)||K.enterToolbar()},ie=setTimeout(()=>{window.addEventListener("click",Y)},0);return()=>{clearTimeout(j),clearTimeout(ie),window.removeEventListener("click",Y)}}),lr(()=>{K.init()});var Z=Rc();let C,S;var I=w(Z);{var H=j=>{var Y=Pc(),ie=kt(Y),ee=w(ie);ee.__click=function(...P){m.toggleVisibility?.apply(this,P)};var pe=w(ee);{var te=P=>{Sl(P,{})},ae=P=>{$l(P,{})};Se(pe,P=>{s(v)?P(te):P(ae,!1)})}y(ee);var x=A(ee,2);x.__click=()=>m.toggleLock();var N=w(x);{var p=P=>{Tl(P,{})},E=P=>{Gl(P,{})};Se(N,P=>{s(h)?P(p):P(E,!1)})}y(x);var T=A(x,2);let q;T.__click=function(...P){m.resetOpacity?.apply(this,P)};var re=se(()=>Cr()?X:void 0);T.__touchstart=function(...P){s(re)?.apply(this,P)};var Me=w(T);kl(Me,{});var Te=A(Me,2),ze=w(Te,!0);y(Te),y(T);var we=A(T,2);we.__click=$;var it=w(we);gl(it,{}),y(we);var Ae=A(we,2);Ae.__click=function(...P){m.cycleScale?.apply(this,P)};var ot=w(Ae);hl(ot,{});var Bt=A(ot,2),fr=w(Bt,!0);y(Bt),y(Ae);var Mt=A(Ae,2);Mt.__click=function(...P){K.enterMockups?.apply(this,P)};var yn=w(Mt);Vo(yn,{}),y(Mt);var Ut=A(Mt,2);Ut.__click=function(...P){K.enterGrids?.apply(this,P)};var Pr=w(Ut);wl(Pr,{}),y(Ut);var Ht=A(Ut,2);Ht.__click=function(...P){K.toggleTheme?.apply(this,P)};var Dr=w(Ht);{var wn=P=>{Dl(P,{})},Ir=P=>{Ll(P,{})};Se(Dr,P=>{K.theme==="dark"?P(wn):P(Ir,!1)})}y(Ht);var Yt=A(Ht,2);let vr;Yt.__click=function(...P){K.togglePosition?.apply(this,P)};var jr=w(Yt);bl(jr,{}),y(Yt),y(ie);var Rr=A(ie,2);{var mn=P=>{var At=Gc(),Vt=w(At),ht=w(Vt);let zr;ht.__click=()=>m.setAlignmentY("top");var kn=w(ht);fl(kn,{}),y(ht);var Xt=A(ht,2);let Nr;Xt.__click=()=>m.setAlignmentY("bottom");var xn=w(Xt);il(xn,{}),y(Xt),y(Vt);var $n=A(Vt,2),z=w($n);let Ve;z.__click=()=>m.setAlignmentX("left");var Fr=w(z);ll(Fr,{}),y(z);var Xe=A(z,2);let Br;Xe.__click=()=>m.setAlignmentX("center");var Ur=w(Xe);sl(Ur,{}),y(Xe);var hr=A(Xe,2);let pr;hr.__click=()=>m.setAlignmentX("right");var pi=w(hr);ul(pi,{}),y(hr),y($n),y(At),Ee(()=>{zr=ke(ht,1,"alignment-button svelte-19cxvb5",null,zr,{active:m.alignmentY==="top"}),Nr=ke(Xt,1,"alignment-button svelte-19cxvb5",null,Nr,{active:m.alignmentY==="bottom"}),Ve=ke(z,1,"alignment-button svelte-19cxvb5",null,Ve,{active:m.alignmentX==="left"}),Br=ke(Xe,1,"alignment-button svelte-19cxvb5",null,Br,{active:m.alignmentX==="center"}),pr=ke(hr,1,"alignment-button svelte-19cxvb5",null,pr,{active:m.alignmentX==="right"})}),or("mouseleave",At,b),G(P,At)};Se(Rr,P=>{s(r)&&!s(g)&&!s(h)&&P(mn)})}Ee(()=>{ee.disabled=s(d),tt(ee,"title",s(v)?"Show mockup":"Hide mockup"),x.disabled=s(g),tt(x,"title",s(h)?"Unlock mockup position":"Lock mockup position"),q=ke(T,1,"icon-button opacity-button svelte-19cxvb5",null,q,{sliding:s(i)}),T.disabled=s(g),vt(ze,s(c)),we.disabled=s(g)||s(h),Ae.disabled=s(g)||s(h),vt(fr,s(l)),vr=ke(Yt,1,"icon-button svelte-19cxvb5",null,vr,{flip:K.position==="top"})}),or("mouseenter",we,k),or("mouseleave",we,b),G(j,Y)},L=j=>{var Y=sr(),ie=kt(Y);{var ee=te=>{var ae=Dc(),x=w(ae);_s(x,{}),y(ae),G(te,ae)},pe=te=>{var ae=sr(),x=kt(ae);{var N=p=>{var E=Ic(),T=w(E);gs(T,{}),y(E),G(p,E)};Se(x,p=>{K.mode==="grids"&&K.managerVisible&&p(N)},!0)}G(te,ae)};Se(ie,te=>{K.mode==="mockups"&&K.managerVisible?te(ee):te(pe,!1)},!0)}G(j,Y)};Se(I,j=>{K.mode==="toolbar"&&K.toolbarVisible?j(H):j(L,!1)})}var Q=A(I,2);{var oe=j=>{var Y=jc(),ie=w(Y,!0);y(Y),Ee(()=>vt(ie,m.positionDisplay)),G(j,Y)};Se(Q,j=>{s(_)&&j(oe)})}y(Z),qa(Z,j=>n=j,()=>n),Ee(()=>{C=ke(Z,1,"dock svelte-19cxvb5",null,C,{"at-top":K.position==="top","is-manager":K.isManagerMode,"is-dragging":s(u)}),tt(Z,"hidden",!K.initialized||m.isSolidOrZoomed),S=Et(Z,"",S,{"--transition-duration":`${hi}ms`,width:`${K.size.width??""}px`,height:`${K.size.height??""}px`})}),G(e,Z),yt()}xr(["click","touchstart"]),Nt(bs,{},[],[],{mode:"open"});var Nc=ye('<div class="spacing-grid svelte-hxwjdk"></div>'),Fc=ye('<div class="layout-grid__column svelte-hxwjdk"></div>'),Bc=ye('<div><div class="layout-grid__inner svelte-hxwjdk"></div></div>'),Uc=ye("<!> <!>",1);const Hc={hash:"svelte-hxwjdk",code:".spacing-grid.svelte-hxwjdk{position:absolute;z-index:2147483646}.layout-grid.svelte-hxwjdk,.spacing-grid.svelte-hxwjdk{inset:0;pointer-events:none}.layout-grid.svelte-hxwjdk{display:flex;position:fixed;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;height:100%}.layout-grid__column.svelte-hxwjdk{flex:1;height:100%}"};function ys(e,t){bt(t,!0),Rt(e,Hc),lr(()=>{W.init()}),cn(()=>{W.cleanup()});let r=se(()=>!m.isSolidOrZoomed);function n(d,v){return d.replace(/[\d.]+/,h=>String(+h*v))}var i=Uc(),o=kt(i);{var a=d=>{var v=Nc();let h;Ee(u=>h=Et(v,"",h,u),[()=>({"background-image":`linear-gradient(to bottom, ${W.spacingGridColor??""}
4
+ ${W.spacingGridHeight??""}, transparent ${W.spacingGridHeight??""})`,"background-size":`100% ${n(W.spacingGridHeight,2)??""}`})]),G(d,v)};Se(o,d=>{W.showSpacingGrid&&s(r)&&d(a)})}var c=A(o,2);{var l=d=>{const v=se(()=>W.activeLayoutGrid);var h=Bc(),u=w(h);let g;Zn(u,21,()=>({length:s(v).columns}),Ra,(_,k)=>{var b=Fc();let $;Ee(()=>$=Et(b,"",$,{background:W.layoutGridColor})),G(_,b)}),y(u),y(h),Ee(_=>{ke(h,1,`layout-grid layout-grid--${s(v).position??""}`,"svelte-hxwjdk"),g=Et(u,"",g,_)},[()=>({width:s(v).width,"padding-left":s(v).isGutterOnOutside?n(s(v).gutterWidth,.5):void 0,"padding-right":s(v).isGutterOnOutside?n(s(v).gutterWidth,.5):void 0,gap:s(v).gutterWidth})]),G(d,h)};Se(c,d=>{W.showLayoutGrid&&W.activeLayoutGrid&&s(r)&&d(l)})}G(e,i),yt()}Nt(ys,{},[],[],{mode:"open"});var Yc=ye('<div class="mockup-container svelte-ya3gmp"><img draggable="false" class="mockup-overlay svelte-ya3gmp" alt="Mockup Overlay"/></div>');const Vc={hash:"svelte-ya3gmp",code:".mockup-container.svelte-ya3gmp{inset:0;overflow:hidden;pointer-events:none;position:absolute;z-index:2147483644}.mockup-overlay.svelte-ya3gmp{backface-visibility:hidden;left:0;max-width:none;position:absolute;top:0;transform-origin:top left;-webkit-user-select:none;user-select:none;will-change:transform;-webkit-touch-callout:none}"};function ws(e,t){bt(t,!0),Rt(e,Vc);let r=null,n=null,i=0,o=null,a=!1,c=!1,l=!1;function d(){n=null,i=0,c=!1,m.mode==="dragging"&&m.endTouchDrag(),m.endPinch()}function v(){!o||!l||(a&&(o.removeEventListener("gesturestart",Y),o.removeEventListener("gesturechange",ie),o.removeEventListener("gestureend",ee)),o.removeEventListener("touchstart",L),o.removeEventListener("touchmove",Q),o.removeEventListener("touchend",oe),o.removeEventListener("touchcancel",j),l=!1)}function h(){!o||l||("ongesturestart"in window&&(a=!0,o.addEventListener("gesturestart",Y,{passive:!1}),o.addEventListener("gesturechange",ie,{passive:!1}),o.addEventListener("gestureend",ee,{passive:!1})),o.addEventListener("touchstart",L,{passive:!1}),o.addEventListener("touchmove",Q,{passive:!1}),o.addEventListener("touchend",oe,{passive:!1}),o.addEventListener("touchcancel",j,{passive:!1}),l=!0)}function u(){document.hidden&&d()}lr(()=>{rl(),m.init(),Gr.init(),window.addEventListener("resize",_),document.addEventListener("visibilitychange",u)}),cn(()=>{window.removeEventListener("resize",_),document.removeEventListener("visibilitychange",u),r&&clearTimeout(r),v(),d(),o=null,Gr.cleanup(),m.cleanup()}),Pt(()=>{const x=!m.isHidden&&!!m.activeMockupUrl;o&&(x?h():(v(),d()))});function g(x){return o=x,m.isHidden||h(),{destroy(){v(),o=null}}}function _(){m.isAligned&&(r&&clearTimeout(r),r=setTimeout(()=>{m.updateAlignedPosition()},100))}let k=se(()=>K.mode==="toolbar");const b={dragging:"grabbing",solid:"zoom-in",zoomed:"zoom-out",visible:"grab"};let $=se(()=>{const{mode:x}=m;return s(k)?x==="solid"?{cursor:"zoom-in",pointerEvents:"auto"}:x==="locked"?{cursor:"default",pointerEvents:"auto"}:{cursor:b[x]||"grab",pointerEvents:"auto"}:{cursor:"default",pointerEvents:"none"}}),X=se(()=>`translate3d(${m.position.x}px, ${m.position.y}px, 0) scale(${m.scale})`),ne=se(()=>m.mode==="locked"?"pan-x pan-y":"none"),D=se(()=>m.isDragging||m.isZoomPanning||m.mode==="solid"?"none":"transform 0.2s ease-out");function Z(x){if(!s(k))return;tl(x);const{mode:N}=m;if(N!=="locked"&&x.pointerType!=="touch")switch(N){case"visible":n=x.pointerId,m.startDrag(x),x.target.setPointerCapture?.(x.pointerId);break;case"solid":m.enterZoomMode(x);break;case"zoomed":m.exitZoomMode();break}}function C(x){s(k)&&x.pointerId===n&&x.pointerType}function S(x){s(k)&&x.pointerId===n&&x.pointerType!=="touch"&&(n=null,x.target.releasePointerCapture?.(x.pointerId))}function I(x){x.pointerId===n&&(n=null,d())}let H={x:0,y:0};function L(x){if(!s(k))return;const{mode:N}=m;if(N==="locked"){if(i=x.touches.length,i===1){const p=x.touches[0];H={x:p.clientX,y:p.clientY}}return}if(x.preventDefault(),N==="solid"&&i===0&&(c=!1),i=x.touches.length,i===1){const p=x.touches[0];H={x:p.clientX,y:p.clientY},N==="solid"&&m.startSolidPan(x)}else i===2&&N==="solid"&&!a&&m.startPinch(x)}function Q(x){if(!s(k))return;const{mode:N}=m;if(N!=="locked")if(x.preventDefault(),x.touches.length===1){const p=x.touches[0],E=Math.abs(p.clientX-H.x),T=Math.abs(p.clientY-H.y);(E>ls||T>ls)&&N==="visible"&&m.startTouchDrag(x),N==="dragging"?m.handleTouchDrag(x):N==="solid"&&!c&&m.handleSolidPan(x)}else x.touches.length===2&&N==="solid"&&!a&&m.handlePinch(x)}function oe(x){if(!s(k))return;const{mode:N}=m,p=i;i=x.touches.length,N!=="locked"&&(!a&&p===2&&i<2&&m.endPinch(),i===0&&(N==="dragging"&&m.endTouchDrag(),c=!1))}function j(x){d()}function Y(x){if(!s(k)||m.mode!=="solid")return;x.preventDefault(),c=!0;const N=x.clientX+window.scrollX,p=x.clientY+window.scrollY;m.startGesturePinch(N,p)}function ie(x){s(k)&&m.mode==="solid"&&(x.preventDefault(),m.handleGesturePinch(x.scale))}function ee(x){s(k)&&(x.preventDefault(),m.endPinch())}var pe=sr(),te=kt(pe);{var ae=x=>{var N=Yc(),p=w(N);p.__pointerdown=Z,p.__pointermove=C,p.__pointerup=S;let E;To(p,T=>g?.(T)),y(N),Ee(()=>{tt(p,"src",m.activeMockupUrl),E=Et(p,"",E,{transform:s(X),transition:s(D),cursor:s($).cursor,"pointer-events":s($).pointerEvents,opacity:m.effectiveOpacity,"touch-action":s(ne)})}),or("pointercancel",p,I),Eo(p),G(x,N)};Se(te,x=>{!m.isHidden&&m.activeMockupUrl&&x(ae)})}G(e,pe),yt()}xr(["pointerdown","pointermove","pointerup"]),Nt(ws,{},[],[],{mode:"open"});var Xc=ue("<svg><!></svg>");function Wc(e,t){const r=ve(t,["children","$$slots","$$events","$$legacy"]);var n=Xc();fe(n,()=>({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",color:"#000",viewBox:"0 0 24 24",...r}));var i=w(n);de(i,()=>'<path stroke="currentColor" stroke-width="2" d="M5.322 9.683c2.413-4.271 3.62-6.407 5.276-6.956a4.45 4.45 0 0 1 2.804 0c1.656.55 2.863 2.685 5.276 6.956 2.414 4.27 3.62 6.406 3.259 8.146-.2.958-.69 1.826-1.402 2.48C19.241 21.5 16.827 21.5 12 21.5s-7.241 0-8.535-1.19a4.66 4.66 0 0 1-1.402-2.48c-.362-1.74.845-3.876 3.259-8.147Z"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11.992 16h.009M12 13V9"/>',!0),y(n),G(e,n)}var qc=ye('<div class="toast svelte-1ig2a9j"><!> <span class="toast__message svelte-1ig2a9j"> </span></div>');const Zc={hash:"svelte-1ig2a9j",code:".toast.svelte-1ig2a9j{animation:svelte-1ig2a9j-b .25s cubic-bezier(.4,0,.2,1);background:var(--color-danger);border-radius:16px;color:#fff;display:flex;font-family:Arial,sans-serif;gap:8px;left:50%;max-width:min(90vw,400px);outline:2px solid hsla(0,0%,100%,.5);padding:8px 16px;position:fixed;top:16px;transform:translateX(-50%);z-index:2147483647}.toast.svelte-1ig2a9j >svg{flex-shrink:0;height:20px;width:20px}.toast__message.svelte-1ig2a9j{font-size:15px;font-weight:500;line-height:18px;padding:1px 0}@keyframes svelte-1ig2a9j-b{0%{opacity:0;transform:translateX(-50%) translateY(-12px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}"};function ms(e,t){bt(t,!0),Rt(e,Zc);let r=!1;Pt(()=>{if(O.errorMessage)return window.addEventListener("mousedown",O.clear),r=!0,()=>{window.removeEventListener("mousedown",O.clear),r=!1}}),cn(()=>{r&&window.removeEventListener("mousedown",O.clear)});var n=sr(),i=kt(n);{var o=a=>{var c=qc(),l=w(c);Wc(l,{});var d=A(l,2),v=w(d,!0);y(d),y(c),Ee(()=>vt(v,O.errorMessage)),G(a,c)};Se(i,a=>{O.errorMessage&&a(o)})}G(e,n),yt()}Nt(ms,{},[],[],{mode:"open"});var Kc=ye("<div><!> <!> <!> <!></div>");const Jc={hash:"svelte-1n46o8q",code:".theme-root.svelte-1n46o8q{--dock-bg:#fff;--dock-fg:#000;--dock-border:#000;--dock-outline:hsla(0,0%,100%,.5);--text-primary:#000;--text-secondary:#333;--border-light:#eee;--border-medium:#d4d4d4;--input-bg:#fff;--input-text:#000;--input-placeholder:#999;--input-border:#d4d4d4;--btn-bg:#000;--btn-fg:#fff;--btn-hover-bg:#333;--btn-disabled-bg:#555;--focus-ring:#d9daff;--focus-bg:rgba(217,218,255,.2);--color-success:#10b981;--color-success-bg:#ecfdf5;--color-danger:#fe0200;--mockup-border:#999;--mockup-border-hover:#000;--align-x-bg:rgba(0,0,255,.05);--align-x-hover:rgba(0,0,255,.1);--align-x-active:rgba(0,0,255,.2);--align-y-bg:rgba(255,0,0,.05);--align-y-hover:rgba(255,0,0,.1);--align-y-active:rgba(255,0,0,.2)}.theme-root.dark.svelte-1n46o8q{--dock-bg:#1a1a1a;--dock-fg:#e8e8e8;--dock-border:#4d4d4d;--dock-outline:hsla(0,0%,100%,.1);--text-primary:#e8e8e8;--text-secondary:#999;--border-light:#3a3a3a;--border-medium:#4a4a4a;--input-bg:#2a2a2a;--input-text:#e8e8e8;--input-placeholder:#666;--input-border:#4a4a4a;--btn-bg:#3a3a3a;--btn-fg:#e8e8e8;--btn-hover-bg:#5a5a5a;--btn-disabled-bg:#6a6a6a;--focus-ring:#7a7cb8;--focus-bg:rgba(122,124,184,.2);--color-success-bg:rgba(16,185,129,.15);--mockup-border:#5a5a5a;--mockup-border-hover:#e8e8e8;--align-x-bg:rgba(120,170,240,.2);--align-x-hover:rgba(120,170,240,.3);--align-x-active:rgba(120,170,240,.4);--align-y-bg:rgba(240,130,150,.2);--align-y-hover:rgba(240,130,150,.3);--align-y-active:rgba(240,130,150,.4)} *{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(.95)} svg{color:currentColor;display:block;fill:none}"};function Qc(e,t){bt(t,!0),Rt(e,Jc);let r=0,n={x:0,y:0},i=0,o=!1,a=null;function c(){i=Date.now(),o=!0,a&&clearTimeout(a),a=setTimeout(()=>{o=!1},us)}function l(k){if(K.isManagerMode||k.touches.length!==0)return;if(o||Date.now()-i<us){r=0;return}const b=k.changedTouches[0],$=Date.now(),X=$-r,ne=Math.abs(b.clientX-n.x),D=Math.abs(b.clientY-n.y);X<sc&&ne<cs&&D<cs?(k.preventDefault(),m.toggleMobileSolidMode(),r=0):(r=$,n={x:b.clientX,y:b.clientY})}Pt(()=>Cr()?(!m.isHidden&&!!m.activeMockupUrl?(document.documentElement.style.touchAction="pan-x pan-y",document.addEventListener("touchend",l,{passive:!1}),window.addEventListener("scroll",c,{passive:!0})):(document.documentElement.style.touchAction="",document.removeEventListener("touchend",l),window.removeEventListener("scroll",c)),()=>{document.removeEventListener("touchend",l),window.removeEventListener("scroll",c),a&&clearTimeout(a)}):void 0),cn(()=>{Cr()&&(document.documentElement.style.touchAction="",document.removeEventListener("touchend",l),window.removeEventListener("scroll",c),a&&clearTimeout(a))});var d=Kc();let v;var h=w(d);ys(h,{});var u=A(h,2);ws(u,{});var g=A(u,2);bs(g,{});var _=A(g,2);ms(_,{}),y(d),Ee(()=>v=ke(d,1,"theme-root svelte-1n46o8q",null,v,{dark:K.theme==="dark"})),G(e,d),yt()}customElements.define("pixel-mirror",Nt(Qc,{},[],[],{mode:"open"}));const ks="pixel-mirror";document.querySelector(ks)||document.body.appendChild(document.createElement(ks)),document.documentElement.style.position="relative"})();
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "pixel-mirror",
3
- "version": "1.0.4",
3
+ "version": "2.0.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",
6
8
  "exports": {
7
9
  ".": "./dist/index.js",
@@ -14,52 +16,47 @@
14
16
  "default": "./plugins/astro.js"
15
17
  }
16
18
  },
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
19
  "devDependencies": {
33
- "clsx": "^2.1.1",
34
- "cssnano": "^7.0.6",
35
- "cssnano-preset-advanced": "^7.0.6",
36
- "eslint": "^9.17.0",
37
- "eslint-config-prettier": "^9.1.0",
38
- "eslint-plugin-prettier": "^5.2.1",
39
- "eslint-plugin-solid": "^0.14.5",
20
+ "@eslint/compat": "^2.0.0",
21
+ "@eslint/js": "^9.39.2",
22
+ "@poppanator/sveltekit-svg": "^6.0.1",
23
+ "@sveltejs/vite-plugin-svelte": "^6.2.4",
24
+ "@testing-library/jest-dom": "^6.9.1",
25
+ "@testing-library/svelte": "^5.3.1",
26
+ "@tsconfig/svelte": "^5.0.6",
27
+ "@types/node": "^25.2.0",
28
+ "@vitest/coverage-v8": "^4.0.18",
29
+ "cssnano": "^7.1.2",
30
+ "cssnano-preset-advanced": "^7.0.10",
31
+ "eslint-config-prettier": "^10.1.8",
32
+ "eslint-plugin-svelte": "^3.14.0",
33
+ "globals": "^17.3.0",
34
+ "happy-dom": "^20.5.0",
40
35
  "husky": "^9.1.7",
41
- "lint-staged": "^15.2.11",
42
- "postcss-scss": "^4.0.9",
43
- "prettier": "^3.4.2",
44
- "sass": "^1.83.0",
45
- "solid-js": "^1.9.3",
46
- "stylelint": "^16.12.0",
47
- "stylelint-config-recess-order": "^5.1.1",
48
- "stylelint-prettier": "^5.0.2",
49
- "typescript": "^5.7.2",
50
- "typescript-eslint": "^8.18.2",
51
- "vite": "^6.0.5",
52
- "vite-plugin-solid": "^2.11.0",
53
- "vite-plugin-solid-svg": "^0.8.1"
36
+ "idb": "^8.0.3",
37
+ "jsdom": "^28.0.0",
38
+ "lint-staged": "^16.2.7",
39
+ "postcss-html": "^1.8.1",
40
+ "prettier": "^3.8.1",
41
+ "prettier-plugin-svelte": "^3.4.1",
42
+ "sass": "^1.97.3",
43
+ "stylelint": "^17.1.1",
44
+ "stylelint-config-html": "^1.1.0",
45
+ "stylelint-config-recess-order": "^7.6.0",
46
+ "stylelint-prettier": "^5.0.3",
47
+ "svelte": "^5.49.1",
48
+ "svelte-check": "^4.3.6",
49
+ "typescript": "~5.9.3",
50
+ "typescript-eslint": "^8.54.0",
51
+ "vite": "^7.3.1",
52
+ "vitest": "^4.0.18"
54
53
  },
55
54
  "lint-staged": {
56
- "*.{ts,tsx}": [
57
- "eslint --fix --max-warnings 0"
58
- ],
59
- "*.scss": [
60
- "stylelint --fix"
55
+ "*.{js,ts,svelte}": [
56
+ "eslint --fix",
57
+ "prettier --write"
61
58
  ],
62
- "!(package*).json": [
59
+ "*.{json,md,html}": [
63
60
  "prettier --write"
64
61
  ]
65
62
  },
@@ -67,10 +64,32 @@
67
64
  "dist",
68
65
  "plugins"
69
66
  ],
67
+ "keywords": [
68
+ "vite",
69
+ "design",
70
+ "pixel-perfect",
71
+ "ui-overlay",
72
+ "mockup",
73
+ "frontend-tool",
74
+ "svelte",
75
+ "developer-tools"
76
+ ],
77
+ "homepage": "https://github.com/p233-studio/pixel-mirror#readme",
78
+ "repository": {
79
+ "type": "git",
80
+ "url": "git+https://github.com/p233-studio/pixel-mirror.git"
81
+ },
82
+ "bugs": {
83
+ "url": "https://github.com/p233-studio/pixel-mirror/issues"
84
+ },
70
85
  "scripts": {
71
86
  "dev": "vite",
72
- "build": "tsc && vite build",
87
+ "build": "vite build",
73
88
  "preview": "vite preview",
74
- "lint": "tsc && eslint --fix && stylelint --fix './src/**/*.scss'"
89
+ "check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",
90
+ "lint": "eslint . && stylelint --fix './src/**/*.svelte'",
91
+ "test": "vitest",
92
+ "test:run": "vitest run",
93
+ "test:coverage": "vitest run --coverage"
75
94
  }
76
95
  }