@aevantec/litevue 0.5.16 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +1 -1
  2. package/dist/litevue-devtools.iife.js +1 -1
  3. package/dist/litevue-devtools.mjs +1 -1
  4. package/dist/litevue-devtools.umd.js +1 -1
  5. package/dist/litevue-plugins.dev.iife.js +32 -29
  6. package/dist/litevue-plugins.dev.mjs +32 -29
  7. package/dist/litevue-plugins.iife.js +1 -1
  8. package/dist/litevue-plugins.mjs +1 -1
  9. package/dist/litevue-plugins.umd.js +1 -1
  10. package/dist/litevue.dev.iife.js +246 -222
  11. package/dist/litevue.dev.mjs +246 -222
  12. package/dist/litevue.iife.js +1 -1
  13. package/dist/litevue.mjs +1 -1
  14. package/dist/litevue.umd.js +1 -1
  15. package/dist/plugins/focus.iife.js +1 -1
  16. package/dist/plugins/focus.mjs +1 -1
  17. package/dist/plugins/focus.umd.js +1 -1
  18. package/dist/plugins/mask.iife.js +1 -1
  19. package/dist/plugins/mask.mjs +1 -1
  20. package/dist/plugins/mask.umd.js +1 -1
  21. package/dist/plugins/media.dev.iife.js +9 -7
  22. package/dist/plugins/media.dev.mjs +9 -7
  23. package/dist/plugins/media.iife.js +1 -1
  24. package/dist/plugins/media.mjs +1 -1
  25. package/dist/plugins/media.umd.js +1 -1
  26. package/dist/plugins/morph.dev.iife.js +7 -4
  27. package/dist/plugins/morph.dev.mjs +7 -4
  28. package/dist/plugins/morph.iife.js +1 -1
  29. package/dist/plugins/morph.mjs +1 -1
  30. package/dist/plugins/morph.umd.js +1 -1
  31. package/dist/plugins/navigate.dev.iife.js +36 -16
  32. package/dist/plugins/navigate.dev.mjs +36 -16
  33. package/dist/plugins/navigate.iife.js +1 -1
  34. package/dist/plugins/navigate.mjs +1 -1
  35. package/dist/plugins/navigate.umd.js +1 -1
  36. package/dist/plugins/persist.dev.iife.js +1 -2
  37. package/dist/plugins/persist.dev.mjs +1 -2
  38. package/dist/types/block.d.mts +1 -1
  39. package/dist/types/block.d.ts +1 -1
  40. package/dist/types/context.d.mts +7 -1
  41. package/dist/types/context.d.ts +7 -1
  42. package/dist/types/directives/index.d.mts +2 -0
  43. package/dist/types/directives/index.d.ts +2 -0
  44. package/dist/types/directives/on.d.mts +2 -0
  45. package/dist/types/directives/on.d.ts +2 -0
  46. package/dist/types/directives/show.d.mts +4 -1
  47. package/dist/types/directives/show.d.ts +4 -1
  48. package/dist/types/ownership.d.mts +2 -0
  49. package/dist/types/ownership.d.ts +2 -0
  50. package/dist/types/scheduler.d.mts +10 -2
  51. package/dist/types/scheduler.d.ts +10 -2
  52. package/dist/types/walk.d.mts +1 -0
  53. package/dist/types/walk.d.ts +1 -0
  54. package/package.json +9 -9
package/README.md CHANGED
@@ -6,7 +6,7 @@ Published on npm as **[`@aevantec/litevue`](https://www.npmjs.com/package/@aevan
6
6
  unscoped name is blocked by an unrelated `lite-vue` package. The IIFE/UMD global
7
7
  stays `LiteVue`.
8
8
 
9
- - **~10kb**<!-- size:dist/litevue.iife.js --> gzipped core, driven by the real `@vue/reactivity`
9
+ - **~11kb**<!-- size:dist/litevue.iife.js --> gzipped core, driven by the real `@vue/reactivity`
10
10
  - Vue-compatible syntax: `{{ }}`, `v-if`/`v-for` (keyed), `v-model`, `v-show`, …
11
11
  - **Built-in devtools** — in-page inspector panel + browser extension, one line to disable in production
12
12
  - **Transitions** that work with `v-show` *and* `v-if` (deferred unmount)
@@ -1 +1 @@
1
- var LiteVueDevtoolsPanel=function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});var e,t,o,r,i,l,d,a,s,p,c,h,g=n=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+n+"</svg>",u="litevue-devtools-theme",v="litevue-devtools-ui",f=()=>{try{return JSON.parse(localStorage.getItem(v)||"{}")}catch{return{}}},x=n=>{try{localStorage.setItem(v,JSON.stringify({...f(),...n}))}catch{}},m={dark:g('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:g('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:g('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},b={float:g('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),right:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},y={float:"bottom",bottom:"right",right:"float"},w={float:"floating",bottom:"docked to bottom",right:"docked to right"},k={dark:"light",light:"system",system:"dark"},C=(n,e,t)=>Math.min(Math.max(n,e),Math.max(e,t)),L=(n,e,t)=>{const o=document.createElement(n);return o.className=e,null!=t&&(o.textContent=t),o},E=(n,e)=>{const t=new Set,o=(n,r,i)=>{if(null!=n){if("object"!=typeof n)return String(n).toLowerCase().includes(e)?r:void 0;if(i>4||t.has(n))return;t.add(n);for(const t of Object.keys(n)){if("$"===t[0])continue;let l;try{l=n[t]}catch{continue}if("function"==typeof l)continue;const d=r?`${r}.${t}`:t;if(t.toLowerCase().includes(e))return d;const a=o(l,d,i+1);if(a)return a}}};return o(n,"",0)},O=n=>{let e;try{e=void 0===n?"undefined":JSON.stringify(n)??String(n)}catch{e=String(n)}return e.length>60?e.slice(0,60)+"\u2026":e},S=n=>[...n.directives.map(n=>"v-"+n),...n.magics].join(" "),M=null,$=null,_=!1,z="",j="Elements",I="float",N="",H="",P="",T="",D="",V="",W=()=>{},R=(()=>{try{const n=localStorage.getItem(u);if("light"===n||"system"===n)return n}catch{}return"dark"})(),X=matchMedia("(prefers-color-scheme: light)"),Y=()=>{const n="light"===R||"system"===R&&X.matches;t.host.classList.toggle("light",n),a.innerHTML=m[R],a.title="theme: "+R},A=new Set,B=new WeakSet,F=()=>{if("float"!==I)return;const n=parseInt(o.style.right)||0,e=parseInt(o.style.bottom)||0;P=o.style.right=C(n,0,window.innerWidth-o.offsetWidth)+"px",T=o.style.bottom=C(e,0,window.innerHeight-o.offsetHeight)+"px"},J=n=>{"float"===I?(N=o.style.width||N,H=o.style.height||H,P=o.style.right||P,T=o.style.bottom||T):"bottom"===I?D=o.style.height||D:V=o.style.width||V,I=n;const e="float"!==n;o.classList.toggle("dock-bottom","bottom"===n),o.classList.toggle("dock-right","right"===n),o.style.right=e?"":P,o.style.bottom=e?"":T,o.style.width="bottom"===n?"":"right"===n?V:N,o.style.height="right"===n?"":"bottom"===n?D:H,p.innerHTML=b[n],p.title="panel: "+w[n]},U=n=>{const e=L("span","label");return e.appendChild(L("span","punct","<")),e.appendChild(L("span","name",tn(n))),e.appendChild(L("span","punct",">")),e},q=n=>{let t=n.parentElement;for(;t;){if(e.scopes.has(t))return t;t=t.parentElement}return null},G=n=>{const e=n.getBoundingClientRect();s.style.cssText=`display:block;left:${e.left}px;top:${e.top}px;width:${e.width}px;height:${e.height}px`},Z=()=>{s.style.display="none"},K=n=>{n!==M&&A.clear(),$=null,M=n,j="Elements",window.$scope=n?e.scopes.get(n):void 0,on(),rn()},Q=n=>{n!==$&&A.clear(),M=null,$=n,j="Stores",window.$scope=e.stores.get(n),on(),rn()},nn=n=>{j=n,on()},en=/^\s*([A-Za-z_$][\w$]*)\s*\(/,tn=n=>e.names.get(n)||(n=>{const t=en.exec(e.exps.get(n)||"")?.[1];return t&&e.components?.has(t)?t:void 0})(n)||n.id||n.tagName.toLowerCase(),on=()=>{if((()=>{const n=e.stores?e.stores.size:0;c.textContent=`Elements (${e.scopes.size})`,c.className="Elements"===j?"tab active":"tab",h.textContent=`Stores (${n})`,h.className="Stores"===j?"tab active":"tab"})(),W(),i.textContent="","Elements"===j){const n=[...e.scopes.keys()].sort((n,e)=>n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=new Map;for(const i of n)if(!z||tn(i).toLowerCase().includes(z))t.set(i,void 0);else{const n=E(e.scopes.get(i),z);n&&t.set(i,n)}if(!t.size)return void i.appendChild(L("div","empty",z?"no matching scopes":"no scopes mounted"));const o=new Set;for(const e of t.keys()){o.add(e);for(let n=q(e);n;n=q(n))o.add(n)}const r=new Map,l=new Map,d=new Map;for(const e of n){if(!o.has(e))continue;const n=q(e);r.set(e,n),d.set(e,n?(d.get(n)??0)+1:0),n&&l.set(n,(l.get(n)||0)+1)}const a=n=>{for(let e=r.get(n);e;e=r.get(e)??null)if(B.has(e))return!0;return!1};for(const s of n){if(!o.has(s)||a(s))continue;const n=L("div",s===M?"row sel":"row");n.style.paddingLeft=8+12*(d.get(s)??0)+"px";const r=B.has(s);if(l.get(s)){const e=L("span",r?"arrow":"arrow open","\u25b6");e.onclick=n=>{n.stopPropagation(),r?B.delete(s):B.add(s),on()},n.appendChild(e)}else n.appendChild(L("span","spacer"));n.appendChild(U(s));const p=e.exps.get(s);p&&n.appendChild(L("span","exp"," "+p));const c=t.get(s);c&&n.appendChild(L("span","hit"," "+c)),n.onclick=()=>K(s),n.onmouseenter=()=>G(s),n.onmouseleave=Z,i.appendChild(n)}return}const n=new Map;for(const o of e.stores?e.stores.keys():[])if(!z||o.toLowerCase().includes(z))n.set(o,void 0);else{const t=E(e.stores.get(o),z);t&&n.set(o,t)}const t=[...n.keys()];if(t.length)for(const e of t){const t=L("div",e===$?"row sel":"row"),o=L("span","label");o.appendChild(L("span","punct","$store.")),o.appendChild(L("span","name",e)),t.appendChild(o);const r=n.get(e);r&&t.appendChild(L("span","hit"," "+r)),t.onclick=()=>Q(e),i.appendChild(t)}else i.appendChild(L("div","empty",z?"no matching stores":"no stores registered"))},rn=()=>{if(l.contains(t.activeElement))return;l.textContent="";const n=$?e.stores.get($):M?e.scopes.get(M):void 0;if(!n)return void l.appendChild(L("div","empty","Select a scope"));const{own:o,inherited:r}=(n=>{const e=(n,e)=>"$"!==e[0]&&"function"!=typeof n[e],t=Object.keys(n).filter(t=>e(n,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(n);for(;i&&i!==Object.prototype;){for(const n of Object.keys(i))!o.has(n)&&e(i,n)&&(o.add(n),r.push(n));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(n);o.forEach(e=>dn(e,n,e,0,"prop",[])),r.length&&(l.appendChild(L("div","divider","inherited")),r.forEach(e=>dn(e,n,e,0,"prop inherited",[]))),o.length||r.length||l.appendChild(L("div","empty","empty scope")),l.appendChild(ln(n))},ln=n=>{const e=L("div","prop adder");e.appendChild(L("span","spacer"));const t=L("input","val key-in");t.placeholder="key";const o=L("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=e=>{"Enter"===e.key&&(()=>{const e=t.value.trim();if(!e)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:""===r||isNaN(+r)||(i=+r),n[e]=i,t.blur(),o.blur(),gn(),setTimeout(()=>{const n=l.querySelector(".adder .key-in");n&&n.focus()})})()},e.appendChild(t),e.appendChild(o),e},dn=(n,e,t,o,r,i)=>{const d=e[n],a=L("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==d&&"object"==typeof d){const s=i.indexOf(d)>-1,p=!s&&A.has(t);if(a.appendChild(L("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(L("span","key",n)),a.appendChild(L("span","preview",s?"(circular)":(n=>Array.isArray(n)?`(${n.length}) ${O(n)}`:O(n))(d))),s||(a.classList.add("toggle"),a.onclick=()=>{p?A.delete(t):A.add(t),rn()}),an(a,e,n,o,r),l.appendChild(a),p){const n=Object.keys(d);if(!n.length){const n=L("div","muted","(empty)");n.style.paddingLeft=22+14*(o+1)+"px",l.appendChild(n)}for(const e of n)dn(e,d,t+"."+e,o+1,r,i.concat([d]))}return}a.appendChild(L("span","spacer")),a.appendChild(L("span","key",n));const s=((n,e)=>{for(let t=n;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const n=Object.getOwnPropertyDescriptor(t,e);if(n)return n}})(e,n);if("function"==typeof d)a.appendChild(L("span","preview","\u0192"));else if((n=>{if(!n)return!1;if(n.get&&!n.set)return!0;const e=n.value;return!!e&&!0===e.__v_isRef&&!0===e.__v_isReadonly})(s))a.appendChild(L("span","preview",O(d)));else if("boolean"==typeof d){a.appendChild(L("span","bool",String(d)));const t=L("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{e[n]=t.checked,t.blur(),gn()},a.appendChild(t)}else{const t=L("input","val");t.value=O(d),t.onfocus=()=>{t.value="string"==typeof d?d:String(d)},t.onkeydown=n=>{"Enter"===n.key&&t.blur(),"Escape"===n.key&&(t.value=O(d),t.blur())},t.onblur=()=>{const o=((n,e)=>{if("number"==typeof e){const e=parseFloat(n);return isNaN(e)?n:e}return n})(t.value,d);o!==d?(e[n]=o,gn()):t.value=O(d)},a.appendChild(t)}an(a,e,n,o,r),l.appendChild(a)},an=(n,e,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(e,o);if(l&&l.get)return;const d=L("button","del","\u2715");d.title=`delete "${o}"`,d.onclick=n=>{n.stopPropagation();const r=t.activeElement;r&&r.blur&&r.blur(),delete e[o],gn()},n.appendChild(d)},sn=n=>{const o=n.target;if(o===t.host)return;n.preventDefault(),n.stopPropagation(),cn();let r=o;for(;r&&!e.scopes.has(r);)r=r.parentElement;r&&K(r)},pn=n=>{let o=n.target;if(o!==t.host){for(;o&&!e.scopes.has(o);)o=o.parentElement;o?G(o):Z()}},cn=()=>{_=!1,d.classList.remove("active"),Z(),document.removeEventListener("click",sn,!0),document.removeEventListener("mousemove",pn,!0)},hn=!1,gn=()=>{hn||(hn=!0,setTimeout(()=>{hn=!1,"none"!==o.style.display&&(on(),rn())}))},un=()=>{const n=document.createElement("div");t=n.attachShadow({mode:"open"});const v=document.createElement("style");v.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n[hidden] {\n display: none !important;\n}\n.plugins {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.plugin {\n display: flex;\n gap: 8px;\n padding: 3px 10px;\n align-items: baseline;\n}\n.plugin .name {\n min-width: 120px;\n}\n.plugin .gave {\n flex: 1;\n color: var(--muted);\n word-break: break-word;\n}\n.plugin .flag {\n color: var(--muted);\n opacity: 0.7;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",t.appendChild(v),s=L("div","highlight"),t.appendChild(s),(r=L("div","pill","\u26a1 LiteVue")).onclick=()=>{r.style.display="none",o.style.display="flex",F(),x({open:!0}),gn()},t.appendChild(r),(o=L("div","panel")).style.display="none";const m=L("div","header");m.appendChild(L("span","title","\u26a1 LiteVue")),m.addEventListener("mousedown",n=>{if(n.target.closest(".btn"))return;if("float"!==I)return;n.preventDefault();const e=o.getBoundingClientRect(),t=window.innerWidth-e.right,r=window.innerHeight-e.bottom,i=n.clientX,l=n.clientY,d=n=>{o.style.right=C(t-(n.clientX-i),0,window.innerWidth-o.offsetWidth)+"px",o.style.bottom=C(r-(n.clientY-l),0,window.innerHeight-o.offsetHeight)+"px"},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),x({right:parseInt(o.style.right)||12,bottom:parseInt(o.style.bottom)||12})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)});const b=L("div","grip");b.addEventListener("mousedown",n=>{n.preventDefault(),b.classList.add("active");const e=o.getBoundingClientRect(),t=n.clientX,r=n.clientY,i=e.width,l=e.height,d=n=>{if("right"!==I){const e="bottom"===I?r-n.clientY:n.clientY-r;o.style.height=C(l+e,320,window.innerHeight-24)+"px"}if("bottom"!==I){const e="right"===I?t-n.clientX:n.clientX-t;o.style.width=C(i+e,320,window.innerWidth-24)+"px"}},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),b.classList.remove("active");const n=parseInt(o.style.width),e=parseInt(o.style.height);x("float"===I?{w:n,h:e}:"bottom"===I?{bh:e}:{rw:n})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)});const w=(n=>{let e=!1;const t=L("button","btn");t.innerHTML=g('<path d="M9 3a2 2 0 0 1 4 0v1h3a1 1 0 0 1 1 1v3h1a2 2 0 0 1 0 4h-1v3a1 1 0 0 1-1 1h-3v-1a2 2 0 0 0-4 0v1H6a1 1 0 0 1-1-1v-3H4a2 2 0 0 1 0-4h1V5a1 1 0 0 1 1-1h3z"/>');const o=L("div","plugins");o.hidden=!0;const r=()=>{const r=n.plugins||[];if(t.title=`plugins (${r.length})`,e)if(o.textContent="",r.length)for(const n of r){const e=L("div","plugin");e.appendChild(L("span","name",n.name)),e.appendChild(L("span","gave",S(n)||"nothing registered")),n.teardown||e.appendChild(L("span","flag","no teardown")),o.appendChild(e)}else o.appendChild(L("div","empty","no plugins installed, or this is a production build"))};return t.onclick=()=>{e=!e;for(const n of o.parentElement.children)n.hidden=n===o?!e:e;t.classList.toggle("active",e),r()},{btn:t,el:o,render:r}})(e);W=w.render,m.appendChild(w.btn),(p=L("button","btn")).onclick=()=>{J(y[I]),x({dock:I})},m.appendChild(p),(a=L("button","btn")).onclick=()=>{(n=>{try{localStorage.setItem(u,n)}catch{}})(R=k[R]),Y()},m.appendChild(a),X.addEventListener("change",()=>{"system"===R&&Y()}),Y(),(d=L("button","btn")).title="pick an element on the page",d.innerHTML=g('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),d.onclick=()=>_?cn():(_=!0,d.classList.add("active"),document.addEventListener("click",sn,!0),void document.addEventListener("mousemove",pn,!0)),m.appendChild(d);const E=L("button","btn","\u2715");E.onclick=()=>{_&&cn(),o.style.display="none",r.style.display="",x({open:!1})},m.appendChild(E),o.appendChild(m);const O=L("div","body"),$=L("div","side"),j=L("div","tabs");(c=L("div","tab active")).onclick=()=>nn("Elements"),(h=L("div","tab")).onclick=()=>nn("Stores"),j.appendChild(c),j.appendChild(h),$.appendChild(j);const A=L("input","filter");A.placeholder="Filter by name or state",A.oninput=()=>{z=A.value.trim().toLowerCase(),on()},A.onkeydown=n=>{"Escape"===n.key&&(A.value="",z="",on())},$.appendChild(A),i=L("div","tree"),$.appendChild(i),l=L("div","state"),O.appendChild($),O.appendChild(l),O.appendChild(w.el),o.appendChild(O),o.appendChild(b),t.appendChild(o);const B=f();B.w&&(N=o.style.width=B.w+"px"),B.h&&(H=o.style.height=B.h+"px"),null!=B.right&&(P=o.style.right=B.right+"px"),null!=B.bottom&&(T=o.style.bottom=B.bottom+"px"),B.bh&&(D=B.bh+"px"),B.rw&&(V=B.rw+"px"),J(B.dock||"float"),document.body.appendChild(n),B.open&&(r.style.display="none",o.style.display="flex",F(),gn()),e.on("scope:mount",gn),e.on("scope:unmount",n=>{n===M&&(M=null),gn()}),e.stores&&e.on("store:register",gn),e.plugins&&e.on("plugin:install",gn),e.on("flush",gn)},vn=()=>{const n=window.__LITE_VUE__;n?(e=n,document.body?un():addEventListener("DOMContentLoaded",un)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};return vn(),n.init=vn,n}({});
1
+ var LiteVueDevtoolsPanel=function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});var e,t,o,r,i,l,d,a,s,p,c,h,g=n=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+n+"</svg>",u="litevue-devtools-theme",v="litevue-devtools-ui",f=()=>{try{return JSON.parse(localStorage.getItem(v)||"{}")}catch{return{}}},x=n=>{try{localStorage.setItem(v,JSON.stringify({...f(),...n}))}catch{}},m={dark:g('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:g('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:g('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},b={float:g('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),right:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},y={float:"bottom",bottom:"right",right:"float"},w={float:"floating",bottom:"docked to bottom",right:"docked to right"},k={dark:"light",light:"system",system:"dark"},C=(n,e,t)=>Math.min(Math.max(n,e),Math.max(e,t)),L=(n,e,t)=>{const o=document.createElement(n);return o.className=e,null!=t&&(o.textContent=t),o},E=(n,e)=>{const t=new Set,o=(n,r,i)=>{if(null!=n){if("object"!=typeof n)return String(n).toLowerCase().includes(e)?r:void 0;if(i>4||t.has(n))return;t.add(n);for(const t of Object.keys(n)){if("$"===t[0])continue;let l;try{l=n[t]}catch{continue}if("function"==typeof l)continue;const d=r?`${r}.${t}`:t;if(t.toLowerCase().includes(e))return d;const a=o(l,d,i+1);if(a)return a}}};return o(n,"",0)},O=n=>{let e;try{e=void 0===n?"undefined":JSON.stringify(n)??String(n)}catch{e=String(n)}return e.length>60?e.slice(0,60)+"\u2026":e},S=n=>[...n.directives.map(n=>"v-"+n),...n.magics].join(" "),M=null,$=null,_=!1,z="",j="Elements",I="float",N="",H="",P="",T="",D="",V="",W=()=>{},R=(()=>{try{const n=localStorage.getItem(u);if("light"===n||"system"===n)return n}catch{}return"dark"})(),X=matchMedia("(prefers-color-scheme: light)"),Y=()=>{const n="light"===R||"system"===R&&X.matches;t.host.classList.toggle("light",n),a.innerHTML=m[R],a.title="theme: "+R},A=new Set,B=new WeakSet,F=()=>{if("float"!==I)return;const n=parseInt(o.style.right)||0,e=parseInt(o.style.bottom)||0;P=o.style.right=C(n,0,window.innerWidth-o.offsetWidth)+"px",T=o.style.bottom=C(e,0,window.innerHeight-o.offsetHeight)+"px"},J=n=>{"float"===I?(N=o.style.width||N,H=o.style.height||H,P=o.style.right||P,T=o.style.bottom||T):"bottom"===I?D=o.style.height||D:V=o.style.width||V,I=n;const e="float"!==n;o.classList.toggle("dock-bottom","bottom"===n),o.classList.toggle("dock-right","right"===n),o.style.right=e?"":P,o.style.bottom=e?"":T,o.style.width="bottom"===n?"":"right"===n?V:N,o.style.height="right"===n?"":"bottom"===n?D:H,p.innerHTML=b[n],p.title="panel: "+w[n]},U=n=>{const e=L("span","label");return e.appendChild(L("span","punct","<")),e.appendChild(L("span","name",tn(n))),e.appendChild(L("span","punct",">")),e},q=n=>{let t=n.parentElement;for(;t;){if(e.scopes.has(t))return t;t=t.parentElement}return null},G=n=>{const e=n.getBoundingClientRect();s.style.cssText=`display:block;left:${e.left}px;top:${e.top}px;width:${e.width}px;height:${e.height}px`},Z=()=>{s.style.display="none"},K=n=>{n!==M&&A.clear(),$=null,M=n,j="Elements",window.$scope=n?e.scopes.get(n):void 0,on(),rn()},Q=n=>{n!==$&&A.clear(),M=null,$=n,j="Stores",window.$scope=e.stores.get(n),on(),rn()},nn=n=>{j=n,on()},en=/^\s*([A-Za-z_$][\w$]*)\s*\(/,tn=n=>e.names.get(n)||(n=>{const t=en.exec(e.exps.get(n)||"")?.[1];return t&&e.components?.has(t)?t:void 0})(n)||n.id||n.tagName.toLowerCase(),on=()=>{if((()=>{const n=e.stores?e.stores.size:0;c.textContent=`Elements (${e.scopes.size})`,c.className="Elements"===j?"tab active":"tab",h.textContent=`Stores (${n})`,h.className="Stores"===j?"tab active":"tab"})(),W(),i.textContent="","Elements"===j){const n=[...e.scopes.keys()].sort((n,e)=>n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=new Map;for(const i of n)if(!z||tn(i).toLowerCase().includes(z))t.set(i,void 0);else{const n=E(e.scopes.get(i),z);n&&t.set(i,n)}if(!t.size)return void i.appendChild(L("div","empty",z?"no matching scopes":"no scopes mounted"));const o=new Set;for(const e of t.keys()){o.add(e);for(let n=q(e);n;n=q(n))o.add(n)}const r=new Map,l=new Map,d=new Map;for(const e of n){if(!o.has(e))continue;const n=q(e);r.set(e,n),d.set(e,n?(d.get(n)??0)+1:0),n&&l.set(n,(l.get(n)||0)+1)}const a=n=>{for(let e=r.get(n);e;e=r.get(e)??null)if(B.has(e))return!0;return!1};for(const s of n){if(!o.has(s)||a(s))continue;const n=L("div",s===M?"row sel":"row");n.style.paddingLeft=8+12*(d.get(s)??0)+"px";const r=B.has(s);if(l.get(s)){const e=L("span",r?"arrow":"arrow open","\u25b6");e.onclick=n=>{n.stopPropagation(),r?B.delete(s):B.add(s),on()},n.appendChild(e)}else n.appendChild(L("span","spacer"));n.appendChild(U(s));const p=e.exps.get(s);p&&n.appendChild(L("span","exp"," "+p));const c=t.get(s);c&&n.appendChild(L("span","hit"," "+c)),n.onclick=()=>K(s),n.onmouseenter=()=>G(s),n.onmouseleave=Z,i.appendChild(n)}return}const n=new Map;for(const o of e.stores?e.stores.keys():[])if(!z||o.toLowerCase().includes(z))n.set(o,void 0);else{const t=E(e.stores.get(o),z);t&&n.set(o,t)}const t=[...n.keys()];if(t.length)for(const e of t){const t=L("div",e===$?"row sel":"row"),o=L("span","label");o.appendChild(L("span","punct","$store.")),o.appendChild(L("span","name",e)),t.appendChild(o);const r=n.get(e);r&&t.appendChild(L("span","hit"," "+r)),t.onclick=()=>Q(e),i.appendChild(t)}else i.appendChild(L("div","empty",z?"no matching stores":"no stores registered"))},rn=()=>{if(l.contains(t.activeElement))return;l.textContent="";const n=$?e.stores.get($):M?e.scopes.get(M):void 0;if(!n)return void l.appendChild(L("div","empty","Select a scope"));const{own:o,inherited:r}=(n=>{const e=(n,e)=>"$"!==e[0]&&"function"!=typeof n[e],t=Object.keys(n).filter(t=>e(n,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(n);for(;i&&i!==Object.prototype;){for(const n of Object.keys(i))!o.has(n)&&e(i,n)&&(o.add(n),r.push(n));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(n);o.forEach(e=>dn(e,n,e,0,"prop",[])),r.length&&(l.appendChild(L("div","divider","inherited")),r.forEach(e=>dn(e,n,e,0,"prop inherited",[]))),o.length||r.length||l.appendChild(L("div","empty","empty scope")),l.appendChild(ln(n))},ln=n=>{const e=L("div","prop adder");e.appendChild(L("span","spacer"));const t=L("input","val key-in");t.placeholder="key";const o=L("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=e=>{"Enter"===e.key&&(()=>{const e=t.value.trim();if(!e)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:""===r||isNaN(+r)||(i=+r),n[e]=i,t.blur(),o.blur(),gn(),setTimeout(()=>{const n=l.querySelector(".adder .key-in");n&&n.focus()})})()},e.appendChild(t),e.appendChild(o),e},dn=(n,e,t,o,r,i)=>{const d=e[n],a=L("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==d&&"object"==typeof d){const s=i.indexOf(d)>-1,p=!s&&A.has(t);if(a.appendChild(L("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(L("span","key",n)),a.appendChild(L("span","preview",s?"(circular)":(n=>Array.isArray(n)?`(${n.length}) ${O(n)}`:O(n))(d))),s||(a.classList.add("toggle"),a.onclick=()=>{p?A.delete(t):A.add(t),rn()}),an(a,e,n,o,r),l.appendChild(a),p){const n=Object.keys(d);if(!n.length){const n=L("div","muted","(empty)");n.style.paddingLeft=22+14*(o+1)+"px",l.appendChild(n)}for(const e of n)dn(e,d,t+"."+e,o+1,r,i.concat([d]))}return}a.appendChild(L("span","spacer")),a.appendChild(L("span","key",n));const s=((n,e)=>{for(let t=n;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const n=Object.getOwnPropertyDescriptor(t,e);if(n)return n}})(e,n);if("function"==typeof d)a.appendChild(L("span","preview","\u0192"));else if((n=>{if(!n)return!1;if(n.get&&!n.set)return!0;const e=n.value;return!!e&&!0===e.__v_isRef&&!0===e.__v_isReadonly})(s))a.appendChild(L("span","preview",O(d)));else if("boolean"==typeof d){a.appendChild(L("span","bool",String(d)));const t=L("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{e[n]=t.checked,t.blur(),gn()},a.appendChild(t)}else{const t=L("input","val");t.value=O(d),t.onfocus=()=>{t.value="string"==typeof d?d:String(d)},t.onkeydown=n=>{"Enter"===n.key&&t.blur(),"Escape"===n.key&&(t.value=O(d),t.blur())},t.onblur=()=>{const o=((n,e)=>{if("number"==typeof e){const e=parseFloat(n);return isNaN(e)?n:e}return n})(t.value,d);o!==d?(e[n]=o,gn()):t.value=O(d)},a.appendChild(t)}an(a,e,n,o,r),l.appendChild(a)},an=(n,e,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(e,o);if(l&&l.get)return;const d=L("button","del","\u2715");d.title=`delete "${o}"`,d.onclick=n=>{n.stopPropagation();const r=t.activeElement;r&&r.blur&&r.blur(),delete e[o],gn()},n.appendChild(d)},sn=n=>{const o=n.target;if(o===t.host)return;n.preventDefault(),n.stopPropagation(),cn();let r=o;for(;r&&!e.scopes.has(r);)r=r.parentElement;r&&K(r)},pn=n=>{let o=n.target;if(o!==t.host){for(;o&&!e.scopes.has(o);)o=o.parentElement;o?G(o):Z()}},cn=()=>{_=!1,d.classList.remove("active"),Z(),document.removeEventListener("click",sn,!0),document.removeEventListener("mousemove",pn,!0)},hn=!1,gn=()=>{hn||(hn=!0,setTimeout(()=>{hn=!1,"none"!==o.style.display&&(on(),rn())}))},un=()=>{const n=document.createElement("div");t=n.attachShadow({mode:"open"});const v=document.createElement("style");v.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n[hidden] {\n display: none !important;\n}\n.plugins {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.plugin {\n display: flex;\n gap: 8px;\n padding: 3px 10px;\n align-items: baseline;\n}\n.plugin .name {\n min-width: 120px;\n}\n.plugin .gave {\n flex: 1;\n color: var(--muted);\n word-break: break-word;\n}\n.plugin .flag {\n color: var(--muted);\n opacity: 0.7;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",t.appendChild(v),s=L("div","highlight"),t.appendChild(s),(r=L("div","pill","\u26a1 LiteVue")).onclick=()=>{r.style.display="none",o.style.display="flex",F(),x({open:!0}),gn()},t.appendChild(r),(o=L("div","panel")).style.display="none";const m=L("div","header");m.appendChild(L("span","title","\u26a1 LiteVue")),m.addEventListener("mousedown",n=>{if(n.target.closest(".btn"))return;if("float"!==I)return;n.preventDefault();const e=o.getBoundingClientRect(),t=window.innerWidth-e.right,r=window.innerHeight-e.bottom,i=n.clientX,l=n.clientY,d=n=>{o.style.right=C(t-(n.clientX-i),0,window.innerWidth-o.offsetWidth)+"px",o.style.bottom=C(r-(n.clientY-l),0,window.innerHeight-o.offsetHeight)+"px"},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),x({right:parseInt(o.style.right)||12,bottom:parseInt(o.style.bottom)||12})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)});const b=L("div","grip");b.addEventListener("mousedown",n=>{n.preventDefault(),b.classList.add("active");const e=o.getBoundingClientRect(),t=n.clientX,r=n.clientY,i=e.width,l=e.height,d=n=>{if("right"!==I){const e="bottom"===I?r-n.clientY:n.clientY-r;o.style.height=C(l+e,320,window.innerHeight-24)+"px"}if("bottom"!==I){const e="right"===I?t-n.clientX:n.clientX-t;o.style.width=C(i+e,320,window.innerWidth-24)+"px"}},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),b.classList.remove("active");const n=parseInt(o.style.width),e=parseInt(o.style.height);x("float"===I?{w:n,h:e}:"bottom"===I?{bh:e}:{rw:n})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)});const w=(n=>{let e=!1;const t=L("button","btn");t.innerHTML=g('<path d="M9 3a2 2 0 0 1 4 0v1h3a1 1 0 0 1 1 1v3h1a2 2 0 0 1 0 4h-1v3a1 1 0 0 1-1 1h-3v-1a2 2 0 0 0-4 0v1H6a1 1 0 0 1-1-1v-3H4a2 2 0 0 1 0-4h1V5a1 1 0 0 1 1-1h3z"/>');const o=L("div","plugins");o.hidden=!0;const r=()=>{const r=n.plugins||[];if(t.title=`plugins (${r.length})`,e)if(o.textContent="",r.length)for(const n of r){const e=L("div","plugin");e.appendChild(L("span","name",n.name)),e.appendChild(L("span","gave",S(n)||"nothing registered")),n.teardown||e.appendChild(L("span","flag","no teardown")),o.appendChild(e)}else o.appendChild(L("div","empty","no plugins installed, or this is a production build"))};return t.onclick=()=>{e=!e;for(const n of o.parentElement.children)n.hidden=n===o?!e:e;t.classList.toggle("active",e),r()},{btn:t,el:o,render:r}})(e);W=w.render,m.appendChild(w.btn),(p=L("button","btn")).onclick=()=>{J(y[I]),x({dock:I})},m.appendChild(p),(a=L("button","btn")).onclick=()=>{(n=>{try{localStorage.setItem(u,n)}catch{}})(R=k[R]),Y()},m.appendChild(a),X.addEventListener("change",()=>{"system"===R&&Y()}),Y(),(d=L("button","btn")).title="pick an element on the page",d.innerHTML=g('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),d.onclick=()=>_?cn():(_=!0,d.classList.add("active"),document.addEventListener("click",sn,!0),void document.addEventListener("mousemove",pn,!0)),m.appendChild(d);const E=L("button","btn","\u2715");E.onclick=()=>{_&&cn(),o.style.display="none",r.style.display="",x({open:!1})},m.appendChild(E),o.appendChild(m);const O=L("div","body"),$=L("div","side"),j=L("div","tabs");(c=L("div","tab active")).onclick=()=>nn("Elements"),(h=L("div","tab")).onclick=()=>nn("Stores"),j.appendChild(c),j.appendChild(h),$.appendChild(j);const A=L("input","filter");A.placeholder="Filter by name or state",A.oninput=()=>{z=A.value.trim().toLowerCase(),on()},A.onkeydown=n=>{"Escape"===n.key&&(A.value="",z="",on())},$.appendChild(A),i=L("div","tree"),$.appendChild(i),l=L("div","state"),O.appendChild($),O.appendChild(l),O.appendChild(w.el),o.appendChild(O),o.appendChild(b),t.appendChild(o);const B=f();B.w&&(N=o.style.width=B.w+"px"),B.h&&(H=o.style.height=B.h+"px"),null!=B.right&&(P=o.style.right=B.right+"px"),null!=B.bottom&&(T=o.style.bottom=B.bottom+"px"),B.bh&&(D=B.bh+"px"),B.rw&&(V=B.rw+"px"),J(B.dock||"float"),document.body.appendChild(n),B.open&&(r.style.display="none",o.style.display="flex",F(),gn()),e.on("scope:mount",gn),e.on("scope:unmount",n=>{n===M&&(M=null),gn()}),e.stores&&e.on("store:register",gn),e.plugins&&e.on("plugin:install",gn),e.on("flush",gn)},vn=!1,fn=()=>{if(vn)return;const n=window.__LITE_VUE__;n?(vn=!0,e=n,document.body?un():addEventListener("DOMContentLoaded",un)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};return fn(),n.init=fn,n}({});
@@ -1 +1 @@
1
- var n,e,t,o,r,i,l,d,a,s,p,c,h=n=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+n+"</svg>",g="litevue-devtools-theme",u="litevue-devtools-ui",v=()=>{try{return JSON.parse(localStorage.getItem(u)||"{}")}catch{return{}}},f=n=>{try{localStorage.setItem(u,JSON.stringify({...v(),...n}))}catch{}},x={dark:h('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:h('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:h('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},m={float:h('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:h('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),right:h('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},b={float:"bottom",bottom:"right",right:"float"},y={float:"floating",bottom:"docked to bottom",right:"docked to right"},w={dark:"light",light:"system",system:"dark"},k=(n,e,t)=>Math.min(Math.max(n,e),Math.max(e,t)),C=(n,e,t)=>{const o=document.createElement(n);return o.className=e,null!=t&&(o.textContent=t),o},L=(n,e)=>{const t=/* @__PURE__ */new Set,o=(n,r,i)=>{if(null!=n){if("object"!=typeof n)return String(n).toLowerCase().includes(e)?r:void 0;if(i>4||t.has(n))return;t.add(n);for(const t of Object.keys(n)){if("$"===t[0])continue;let l;try{l=n[t]}catch{continue}if("function"==typeof l)continue;const d=r?`${r}.${t}`:t;if(t.toLowerCase().includes(e))return d;const a=o(l,d,i+1);if(a)return a}}};return o(n,"",0)},E=n=>{let e;try{e=void 0===n?"undefined":JSON.stringify(n)??String(n)}catch{e=String(n)}return e.length>60?e.slice(0,60)+"\u2026":e},O=n=>[...n.directives.map(n=>"v-"+n),...n.magics].join(" "),S=null,$=null,_=!1,M="",z="Elements",I="float",N="",j="",H="",T="",P="",D="",W=()=>{},V=(()=>{try{const n=localStorage.getItem(g);if("light"===n||"system"===n)return n}catch{}return"dark"})(),R=matchMedia("(prefers-color-scheme: light)"),X=()=>{const n="light"===V||"system"===V&&R.matches;e.host.classList.toggle("light",n),d.innerHTML=x[V],d.title="theme: "+V},Y=/* @__PURE__ */new Set,A=/* @__PURE__ */new WeakSet,B=()=>{if("float"!==I)return;const n=parseInt(t.style.right)||0,e=parseInt(t.style.bottom)||0;H=t.style.right=k(n,0,window.innerWidth-t.offsetWidth)+"px",T=t.style.bottom=k(e,0,window.innerHeight-t.offsetHeight)+"px"},F=n=>{"float"===I?(N=t.style.width||N,j=t.style.height||j,H=t.style.right||H,T=t.style.bottom||T):"bottom"===I?P=t.style.height||P:D=t.style.width||D,I=n;const e="float"!==n;t.classList.toggle("dock-bottom","bottom"===n),t.classList.toggle("dock-right","right"===n),t.style.right=e?"":H,t.style.bottom=e?"":T,t.style.width="bottom"===n?"":"right"===n?D:N,t.style.height="right"===n?"":"bottom"===n?P:j,s.innerHTML=m[n],s.title="panel: "+y[n]},J=n=>{const e=C("span","label");return e.appendChild(C("span","punct","<")),e.appendChild(C("span","name",en(n))),e.appendChild(C("span","punct",">")),e},U=e=>{let t=e.parentElement;for(;t;){if(n.scopes.has(t))return t;t=t.parentElement}return null},q=n=>{const e=n.getBoundingClientRect();a.style.cssText=`display:block;left:${e.left}px;top:${e.top}px;width:${e.width}px;height:${e.height}px`},G=()=>{a.style.display="none"},Z=e=>{e!==S&&Y.clear(),$=null,S=e,z="Elements",window.$scope=e?n.scopes.get(e):void 0,tn(),on()},K=e=>{e!==$&&Y.clear(),S=null,$=e,z="Stores",window.$scope=n.stores.get(e),tn(),on()},Q=n=>{z=n,tn()},nn=/^\s*([A-Za-z_$][\w$]*)\s*\(/,en=e=>n.names.get(e)||(e=>{const t=nn.exec(n.exps.get(e)||"")?.[1];return t&&n.components?.has(t)?t:void 0})(e)||e.id||e.tagName.toLowerCase(),tn=()=>{if((()=>{const e=n.stores?n.stores.size:0;p.textContent=`Elements (${n.scopes.size})`,p.className="Elements"===z?"tab active":"tab",c.textContent=`Stores (${e})`,c.className="Stores"===z?"tab active":"tab"})(),W(),r.textContent="","Elements"===z){const e=[...n.scopes.keys()].sort((n,e)=>n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=/* @__PURE__ */new Map;for(const r of e)if(!M||en(r).toLowerCase().includes(M))t.set(r,void 0);else{const e=L(n.scopes.get(r),M);e&&t.set(r,e)}if(!t.size)return void r.appendChild(C("div","empty",M?"no matching scopes":"no scopes mounted"));const o=/* @__PURE__ */new Set;for(const n of t.keys()){o.add(n);for(let e=U(n);e;e=U(e))o.add(e)}const i=/* @__PURE__ */new Map,l=/* @__PURE__ */new Map,d=/* @__PURE__ */new Map;for(const n of e){if(!o.has(n))continue;const e=U(n);i.set(n,e),d.set(n,e?(d.get(e)??0)+1:0),e&&l.set(e,(l.get(e)||0)+1)}const a=n=>{for(let e=i.get(n);e;e=i.get(e)??null)if(A.has(e))return!0;return!1};for(const s of e){if(!o.has(s)||a(s))continue;const e=C("div",s===S?"row sel":"row");e.style.paddingLeft=8+12*(d.get(s)??0)+"px";const i=A.has(s);if(l.get(s)){const n=C("span",i?"arrow":"arrow open","\u25b6");n.onclick=n=>{n.stopPropagation(),i?A.delete(s):A.add(s),tn()},e.appendChild(n)}else e.appendChild(C("span","spacer"));e.appendChild(J(s));const p=n.exps.get(s);p&&e.appendChild(C("span","exp"," "+p));const c=t.get(s);c&&e.appendChild(C("span","hit"," "+c)),e.onclick=()=>Z(s),e.onmouseenter=()=>q(s),e.onmouseleave=G,r.appendChild(e)}return}const e=/* @__PURE__ */new Map;for(const o of n.stores?n.stores.keys():[])if(!M||o.toLowerCase().includes(M))e.set(o,void 0);else{const t=L(n.stores.get(o),M);t&&e.set(o,t)}const t=[...e.keys()];if(t.length)for(const n of t){const t=C("div",n===$?"row sel":"row"),o=C("span","label");o.appendChild(C("span","punct","$store.")),o.appendChild(C("span","name",n)),t.appendChild(o);const i=e.get(n);i&&t.appendChild(C("span","hit"," "+i)),t.onclick=()=>K(n),r.appendChild(t)}else r.appendChild(C("div","empty",M?"no matching stores":"no stores registered"))},on=()=>{if(i.contains(e.activeElement))return;i.textContent="";const t=$?n.stores.get($):S?n.scopes.get(S):void 0;if(!t)return void i.appendChild(C("div","empty","Select a scope"));const{own:o,inherited:r}=(n=>{const e=(n,e)=>"$"!==e[0]&&"function"!=typeof n[e],t=Object.keys(n).filter(t=>e(n,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(n);for(;i&&i!==Object.prototype;){for(const n of Object.keys(i))!o.has(n)&&e(i,n)&&(o.add(n),r.push(n));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(t);o.forEach(n=>ln(n,t,n,0,"prop",[])),r.length&&(i.appendChild(C("div","divider","inherited")),r.forEach(n=>ln(n,t,n,0,"prop inherited",[]))),o.length||r.length||i.appendChild(C("div","empty","empty scope")),i.appendChild(rn(t))},rn=n=>{const e=C("div","prop adder");e.appendChild(C("span","spacer"));const t=C("input","val key-in");t.placeholder="key";const o=C("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=e=>{"Enter"===e.key&&(()=>{const e=t.value.trim();if(!e)return;const r=o.value;let l=r;"true"===r?l=!0:"false"===r?l=!1:""===r||isNaN(+r)||(l=+r),n[e]=l,t.blur(),o.blur(),hn(),setTimeout(()=>{const n=i.querySelector(".adder .key-in");n&&n.focus()})})()},e.appendChild(t),e.appendChild(o),e},ln=(n,e,t,o,r,l)=>{const d=e[n],a=C("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==d&&"object"==typeof d){const s=l.indexOf(d)>-1,p=!s&&Y.has(t);if(a.appendChild(C("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(C("span","key",n)),a.appendChild(C("span","preview",s?"(circular)":(n=>Array.isArray(n)?`(${n.length}) ${E(n)}`:E(n))(d))),s||(a.classList.add("toggle"),a.onclick=()=>{p?Y.delete(t):Y.add(t),on()}),dn(a,e,n,o,r),i.appendChild(a),p){const n=Object.keys(d);if(!n.length){const n=C("div","muted","(empty)");n.style.paddingLeft=22+14*(o+1)+"px",i.appendChild(n)}for(const e of n)ln(e,d,t+"."+e,o+1,r,l.concat([d]))}return}a.appendChild(C("span","spacer")),a.appendChild(C("span","key",n));const s=((n,e)=>{for(let t=n;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const n=Object.getOwnPropertyDescriptor(t,e);if(n)return n}})(e,n);if("function"==typeof d)a.appendChild(C("span","preview","\u0192"));else if((n=>{if(!n)return!1;if(n.get&&!n.set)return!0;const e=n.value;return!!e&&!0===e.__v_isRef&&!0===e.__v_isReadonly})(s))a.appendChild(C("span","preview",E(d)));else if("boolean"==typeof d){a.appendChild(C("span","bool",String(d)));const t=C("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{e[n]=t.checked,t.blur(),hn()},a.appendChild(t)}else{const t=C("input","val");t.value=E(d),t.onfocus=()=>{t.value="string"==typeof d?d:String(d)},t.onkeydown=n=>{"Enter"===n.key&&t.blur(),"Escape"===n.key&&(t.value=E(d),t.blur())},t.onblur=()=>{const o=((n,e)=>{if("number"==typeof e){const e=parseFloat(n);return isNaN(e)?n:e}return n})(t.value,d);o!==d?(e[n]=o,hn()):t.value=E(d)},a.appendChild(t)}dn(a,e,n,o,r),i.appendChild(a)},dn=(n,t,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(t,o);if(l&&l.get)return;const d=C("button","del","\u2715");d.title=`delete "${o}"`,d.onclick=n=>{n.stopPropagation();const r=e.activeElement;r&&r.blur&&r.blur(),delete t[o],hn()},n.appendChild(d)},an=t=>{const o=t.target;if(o===e.host)return;t.preventDefault(),t.stopPropagation(),pn();let r=o;for(;r&&!n.scopes.has(r);)r=r.parentElement;r&&Z(r)},sn=t=>{let o=t.target;if(o!==e.host){for(;o&&!n.scopes.has(o);)o=o.parentElement;o?q(o):G()}},pn=()=>{_=!1,l.classList.remove("active"),G(),document.removeEventListener("click",an,!0),document.removeEventListener("mousemove",sn,!0)},cn=!1,hn=()=>{cn||(cn=!0,setTimeout(()=>{cn=!1,"none"!==t.style.display&&(tn(),on())}))},gn=()=>{const u=document.createElement("div");e=u.attachShadow({mode:"open"});const x=document.createElement("style");x.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n[hidden] {\n display: none !important;\n}\n.plugins {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.plugin {\n display: flex;\n gap: 8px;\n padding: 3px 10px;\n align-items: baseline;\n}\n.plugin .name {\n min-width: 120px;\n}\n.plugin .gave {\n flex: 1;\n color: var(--muted);\n word-break: break-word;\n}\n.plugin .flag {\n color: var(--muted);\n opacity: 0.7;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",e.appendChild(x),a=C("div","highlight"),e.appendChild(a),(o=C("div","pill","\u26a1 LiteVue")).onclick=()=>{o.style.display="none",t.style.display="flex",B(),f({open:!0}),hn()},e.appendChild(o),(t=C("div","panel")).style.display="none";const m=C("div","header");m.appendChild(C("span","title","\u26a1 LiteVue")),m.addEventListener("mousedown",n=>{if(n.target.closest(".btn"))return;if("float"!==I)return;n.preventDefault();const e=t.getBoundingClientRect(),o=window.innerWidth-e.right,r=window.innerHeight-e.bottom,i=n.clientX,l=n.clientY,d=n=>{t.style.right=k(o-(n.clientX-i),0,window.innerWidth-t.offsetWidth)+"px",t.style.bottom=k(r-(n.clientY-l),0,window.innerHeight-t.offsetHeight)+"px"},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),f({right:parseInt(t.style.right)||12,bottom:parseInt(t.style.bottom)||12})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)});const y=C("div","grip");y.addEventListener("mousedown",n=>{n.preventDefault(),y.classList.add("active");const e=t.getBoundingClientRect(),o=n.clientX,r=n.clientY,i=e.width,l=e.height,d=n=>{if("right"!==I){const e="bottom"===I?r-n.clientY:n.clientY-r;t.style.height=k(l+e,320,window.innerHeight-24)+"px"}if("bottom"!==I){const e="right"===I?o-n.clientX:n.clientX-o;t.style.width=k(i+e,320,window.innerWidth-24)+"px"}},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),y.classList.remove("active");const n=parseInt(t.style.width),e=parseInt(t.style.height);f("float"===I?{w:n,h:e}:"bottom"===I?{bh:e}:{rw:n})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)});const L=(n=>{let e=!1;const t=C("button","btn");t.innerHTML=h('<path d="M9 3a2 2 0 0 1 4 0v1h3a1 1 0 0 1 1 1v3h1a2 2 0 0 1 0 4h-1v3a1 1 0 0 1-1 1h-3v-1a2 2 0 0 0-4 0v1H6a1 1 0 0 1-1-1v-3H4a2 2 0 0 1 0-4h1V5a1 1 0 0 1 1-1h3z"/>');const o=C("div","plugins");o.hidden=!0;const r=()=>{const r=n.plugins||[];if(t.title=`plugins (${r.length})`,e)if(o.textContent="",r.length)for(const n of r){const e=C("div","plugin");e.appendChild(C("span","name",n.name)),e.appendChild(C("span","gave",O(n)||"nothing registered")),n.teardown||e.appendChild(C("span","flag","no teardown")),o.appendChild(e)}else o.appendChild(C("div","empty","no plugins installed, or this is a production build"))};return t.onclick=()=>{e=!e;for(const n of o.parentElement.children)n.hidden=n===o?!e:e;t.classList.toggle("active",e),r()},{btn:t,el:o,render:r}})(n);W=L.render,m.appendChild(L.btn),(s=C("button","btn")).onclick=()=>{F(b[I]),f({dock:I})},m.appendChild(s),(d=C("button","btn")).onclick=()=>{(n=>{try{localStorage.setItem(g,n)}catch{}})(V=w[V]),X()},m.appendChild(d),R.addEventListener("change",()=>{"system"===V&&X()}),X(),(l=C("button","btn")).title="pick an element on the page",l.innerHTML=h('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),l.onclick=()=>_?pn():(_=!0,l.classList.add("active"),document.addEventListener("click",an,!0),void document.addEventListener("mousemove",sn,!0)),m.appendChild(l);const E=C("button","btn","\u2715");E.onclick=()=>{_&&pn(),t.style.display="none",o.style.display="",f({open:!1})},m.appendChild(E),t.appendChild(m);const $=C("div","body"),z=C("div","side"),Y=C("div","tabs");(p=C("div","tab active")).onclick=()=>Q("Elements"),(c=C("div","tab")).onclick=()=>Q("Stores"),Y.appendChild(p),Y.appendChild(c),z.appendChild(Y);const A=C("input","filter");A.placeholder="Filter by name or state",A.oninput=()=>{M=A.value.trim().toLowerCase(),tn()},A.onkeydown=n=>{"Escape"===n.key&&(A.value="",M="",tn())},z.appendChild(A),r=C("div","tree"),z.appendChild(r),i=C("div","state"),$.appendChild(z),$.appendChild(i),$.appendChild(L.el),t.appendChild($),t.appendChild(y),e.appendChild(t);const J=v();J.w&&(N=t.style.width=J.w+"px"),J.h&&(j=t.style.height=J.h+"px"),null!=J.right&&(H=t.style.right=J.right+"px"),null!=J.bottom&&(T=t.style.bottom=J.bottom+"px"),J.bh&&(P=J.bh+"px"),J.rw&&(D=J.rw+"px"),F(J.dock||"float"),document.body.appendChild(u),J.open&&(o.style.display="none",t.style.display="flex",B(),hn()),n.on("scope:mount",hn),n.on("scope:unmount",n=>{n===S&&(S=null),hn()}),n.stores&&n.on("store:register",hn),n.plugins&&n.on("plugin:install",hn),n.on("flush",hn)},un=()=>{const e=window.__LITE_VUE__;e?(n=e,document.body?gn():addEventListener("DOMContentLoaded",gn)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};un();export{un as init};
1
+ var n,e,t,o,r,i,l,d,a,s,p,c,h=n=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+n+"</svg>",g="litevue-devtools-theme",u="litevue-devtools-ui",v=()=>{try{return JSON.parse(localStorage.getItem(u)||"{}")}catch{return{}}},f=n=>{try{localStorage.setItem(u,JSON.stringify({...v(),...n}))}catch{}},x={dark:h('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:h('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:h('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},m={float:h('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:h('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),right:h('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},b={float:"bottom",bottom:"right",right:"float"},y={float:"floating",bottom:"docked to bottom",right:"docked to right"},w={dark:"light",light:"system",system:"dark"},k=(n,e,t)=>Math.min(Math.max(n,e),Math.max(e,t)),C=(n,e,t)=>{const o=document.createElement(n);return o.className=e,null!=t&&(o.textContent=t),o},L=(n,e)=>{const t=/* @__PURE__ */new Set,o=(n,r,i)=>{if(null!=n){if("object"!=typeof n)return String(n).toLowerCase().includes(e)?r:void 0;if(i>4||t.has(n))return;t.add(n);for(const t of Object.keys(n)){if("$"===t[0])continue;let l;try{l=n[t]}catch{continue}if("function"==typeof l)continue;const d=r?`${r}.${t}`:t;if(t.toLowerCase().includes(e))return d;const a=o(l,d,i+1);if(a)return a}}};return o(n,"",0)},E=n=>{let e;try{e=void 0===n?"undefined":JSON.stringify(n)??String(n)}catch{e=String(n)}return e.length>60?e.slice(0,60)+"\u2026":e},O=n=>[...n.directives.map(n=>"v-"+n),...n.magics].join(" "),S=null,$=null,_=!1,M="",z="Elements",I="float",N="",j="",H="",T="",P="",D="",W=()=>{},V=(()=>{try{const n=localStorage.getItem(g);if("light"===n||"system"===n)return n}catch{}return"dark"})(),R=matchMedia("(prefers-color-scheme: light)"),X=()=>{const n="light"===V||"system"===V&&R.matches;e.host.classList.toggle("light",n),d.innerHTML=x[V],d.title="theme: "+V},Y=/* @__PURE__ */new Set,A=/* @__PURE__ */new WeakSet,B=()=>{if("float"!==I)return;const n=parseInt(t.style.right)||0,e=parseInt(t.style.bottom)||0;H=t.style.right=k(n,0,window.innerWidth-t.offsetWidth)+"px",T=t.style.bottom=k(e,0,window.innerHeight-t.offsetHeight)+"px"},F=n=>{"float"===I?(N=t.style.width||N,j=t.style.height||j,H=t.style.right||H,T=t.style.bottom||T):"bottom"===I?P=t.style.height||P:D=t.style.width||D,I=n;const e="float"!==n;t.classList.toggle("dock-bottom","bottom"===n),t.classList.toggle("dock-right","right"===n),t.style.right=e?"":H,t.style.bottom=e?"":T,t.style.width="bottom"===n?"":"right"===n?D:N,t.style.height="right"===n?"":"bottom"===n?P:j,s.innerHTML=m[n],s.title="panel: "+y[n]},J=n=>{const e=C("span","label");return e.appendChild(C("span","punct","<")),e.appendChild(C("span","name",en(n))),e.appendChild(C("span","punct",">")),e},U=e=>{let t=e.parentElement;for(;t;){if(n.scopes.has(t))return t;t=t.parentElement}return null},q=n=>{const e=n.getBoundingClientRect();a.style.cssText=`display:block;left:${e.left}px;top:${e.top}px;width:${e.width}px;height:${e.height}px`},G=()=>{a.style.display="none"},Z=e=>{e!==S&&Y.clear(),$=null,S=e,z="Elements",window.$scope=e?n.scopes.get(e):void 0,tn(),on()},K=e=>{e!==$&&Y.clear(),S=null,$=e,z="Stores",window.$scope=n.stores.get(e),tn(),on()},Q=n=>{z=n,tn()},nn=/^\s*([A-Za-z_$][\w$]*)\s*\(/,en=e=>n.names.get(e)||(e=>{const t=nn.exec(n.exps.get(e)||"")?.[1];return t&&n.components?.has(t)?t:void 0})(e)||e.id||e.tagName.toLowerCase(),tn=()=>{if((()=>{const e=n.stores?n.stores.size:0;p.textContent=`Elements (${n.scopes.size})`,p.className="Elements"===z?"tab active":"tab",c.textContent=`Stores (${e})`,c.className="Stores"===z?"tab active":"tab"})(),W(),r.textContent="","Elements"===z){const e=[...n.scopes.keys()].sort((n,e)=>n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=/* @__PURE__ */new Map;for(const r of e)if(!M||en(r).toLowerCase().includes(M))t.set(r,void 0);else{const e=L(n.scopes.get(r),M);e&&t.set(r,e)}if(!t.size)return void r.appendChild(C("div","empty",M?"no matching scopes":"no scopes mounted"));const o=/* @__PURE__ */new Set;for(const n of t.keys()){o.add(n);for(let e=U(n);e;e=U(e))o.add(e)}const i=/* @__PURE__ */new Map,l=/* @__PURE__ */new Map,d=/* @__PURE__ */new Map;for(const n of e){if(!o.has(n))continue;const e=U(n);i.set(n,e),d.set(n,e?(d.get(e)??0)+1:0),e&&l.set(e,(l.get(e)||0)+1)}const a=n=>{for(let e=i.get(n);e;e=i.get(e)??null)if(A.has(e))return!0;return!1};for(const s of e){if(!o.has(s)||a(s))continue;const e=C("div",s===S?"row sel":"row");e.style.paddingLeft=8+12*(d.get(s)??0)+"px";const i=A.has(s);if(l.get(s)){const n=C("span",i?"arrow":"arrow open","\u25b6");n.onclick=n=>{n.stopPropagation(),i?A.delete(s):A.add(s),tn()},e.appendChild(n)}else e.appendChild(C("span","spacer"));e.appendChild(J(s));const p=n.exps.get(s);p&&e.appendChild(C("span","exp"," "+p));const c=t.get(s);c&&e.appendChild(C("span","hit"," "+c)),e.onclick=()=>Z(s),e.onmouseenter=()=>q(s),e.onmouseleave=G,r.appendChild(e)}return}const e=/* @__PURE__ */new Map;for(const o of n.stores?n.stores.keys():[])if(!M||o.toLowerCase().includes(M))e.set(o,void 0);else{const t=L(n.stores.get(o),M);t&&e.set(o,t)}const t=[...e.keys()];if(t.length)for(const n of t){const t=C("div",n===$?"row sel":"row"),o=C("span","label");o.appendChild(C("span","punct","$store.")),o.appendChild(C("span","name",n)),t.appendChild(o);const i=e.get(n);i&&t.appendChild(C("span","hit"," "+i)),t.onclick=()=>K(n),r.appendChild(t)}else r.appendChild(C("div","empty",M?"no matching stores":"no stores registered"))},on=()=>{if(i.contains(e.activeElement))return;i.textContent="";const t=$?n.stores.get($):S?n.scopes.get(S):void 0;if(!t)return void i.appendChild(C("div","empty","Select a scope"));const{own:o,inherited:r}=(n=>{const e=(n,e)=>"$"!==e[0]&&"function"!=typeof n[e],t=Object.keys(n).filter(t=>e(n,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(n);for(;i&&i!==Object.prototype;){for(const n of Object.keys(i))!o.has(n)&&e(i,n)&&(o.add(n),r.push(n));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(t);o.forEach(n=>ln(n,t,n,0,"prop",[])),r.length&&(i.appendChild(C("div","divider","inherited")),r.forEach(n=>ln(n,t,n,0,"prop inherited",[]))),o.length||r.length||i.appendChild(C("div","empty","empty scope")),i.appendChild(rn(t))},rn=n=>{const e=C("div","prop adder");e.appendChild(C("span","spacer"));const t=C("input","val key-in");t.placeholder="key";const o=C("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=e=>{"Enter"===e.key&&(()=>{const e=t.value.trim();if(!e)return;const r=o.value;let l=r;"true"===r?l=!0:"false"===r?l=!1:""===r||isNaN(+r)||(l=+r),n[e]=l,t.blur(),o.blur(),hn(),setTimeout(()=>{const n=i.querySelector(".adder .key-in");n&&n.focus()})})()},e.appendChild(t),e.appendChild(o),e},ln=(n,e,t,o,r,l)=>{const d=e[n],a=C("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==d&&"object"==typeof d){const s=l.indexOf(d)>-1,p=!s&&Y.has(t);if(a.appendChild(C("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(C("span","key",n)),a.appendChild(C("span","preview",s?"(circular)":(n=>Array.isArray(n)?`(${n.length}) ${E(n)}`:E(n))(d))),s||(a.classList.add("toggle"),a.onclick=()=>{p?Y.delete(t):Y.add(t),on()}),dn(a,e,n,o,r),i.appendChild(a),p){const n=Object.keys(d);if(!n.length){const n=C("div","muted","(empty)");n.style.paddingLeft=22+14*(o+1)+"px",i.appendChild(n)}for(const e of n)ln(e,d,t+"."+e,o+1,r,l.concat([d]))}return}a.appendChild(C("span","spacer")),a.appendChild(C("span","key",n));const s=((n,e)=>{for(let t=n;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const n=Object.getOwnPropertyDescriptor(t,e);if(n)return n}})(e,n);if("function"==typeof d)a.appendChild(C("span","preview","\u0192"));else if((n=>{if(!n)return!1;if(n.get&&!n.set)return!0;const e=n.value;return!!e&&!0===e.__v_isRef&&!0===e.__v_isReadonly})(s))a.appendChild(C("span","preview",E(d)));else if("boolean"==typeof d){a.appendChild(C("span","bool",String(d)));const t=C("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{e[n]=t.checked,t.blur(),hn()},a.appendChild(t)}else{const t=C("input","val");t.value=E(d),t.onfocus=()=>{t.value="string"==typeof d?d:String(d)},t.onkeydown=n=>{"Enter"===n.key&&t.blur(),"Escape"===n.key&&(t.value=E(d),t.blur())},t.onblur=()=>{const o=((n,e)=>{if("number"==typeof e){const e=parseFloat(n);return isNaN(e)?n:e}return n})(t.value,d);o!==d?(e[n]=o,hn()):t.value=E(d)},a.appendChild(t)}dn(a,e,n,o,r),i.appendChild(a)},dn=(n,t,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(t,o);if(l&&l.get)return;const d=C("button","del","\u2715");d.title=`delete "${o}"`,d.onclick=n=>{n.stopPropagation();const r=e.activeElement;r&&r.blur&&r.blur(),delete t[o],hn()},n.appendChild(d)},an=t=>{const o=t.target;if(o===e.host)return;t.preventDefault(),t.stopPropagation(),pn();let r=o;for(;r&&!n.scopes.has(r);)r=r.parentElement;r&&Z(r)},sn=t=>{let o=t.target;if(o!==e.host){for(;o&&!n.scopes.has(o);)o=o.parentElement;o?q(o):G()}},pn=()=>{_=!1,l.classList.remove("active"),G(),document.removeEventListener("click",an,!0),document.removeEventListener("mousemove",sn,!0)},cn=!1,hn=()=>{cn||(cn=!0,setTimeout(()=>{cn=!1,"none"!==t.style.display&&(tn(),on())}))},gn=()=>{const u=document.createElement("div");e=u.attachShadow({mode:"open"});const x=document.createElement("style");x.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n[hidden] {\n display: none !important;\n}\n.plugins {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.plugin {\n display: flex;\n gap: 8px;\n padding: 3px 10px;\n align-items: baseline;\n}\n.plugin .name {\n min-width: 120px;\n}\n.plugin .gave {\n flex: 1;\n color: var(--muted);\n word-break: break-word;\n}\n.plugin .flag {\n color: var(--muted);\n opacity: 0.7;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",e.appendChild(x),a=C("div","highlight"),e.appendChild(a),(o=C("div","pill","\u26a1 LiteVue")).onclick=()=>{o.style.display="none",t.style.display="flex",B(),f({open:!0}),hn()},e.appendChild(o),(t=C("div","panel")).style.display="none";const m=C("div","header");m.appendChild(C("span","title","\u26a1 LiteVue")),m.addEventListener("mousedown",n=>{if(n.target.closest(".btn"))return;if("float"!==I)return;n.preventDefault();const e=t.getBoundingClientRect(),o=window.innerWidth-e.right,r=window.innerHeight-e.bottom,i=n.clientX,l=n.clientY,d=n=>{t.style.right=k(o-(n.clientX-i),0,window.innerWidth-t.offsetWidth)+"px",t.style.bottom=k(r-(n.clientY-l),0,window.innerHeight-t.offsetHeight)+"px"},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),f({right:parseInt(t.style.right)||12,bottom:parseInt(t.style.bottom)||12})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)});const y=C("div","grip");y.addEventListener("mousedown",n=>{n.preventDefault(),y.classList.add("active");const e=t.getBoundingClientRect(),o=n.clientX,r=n.clientY,i=e.width,l=e.height,d=n=>{if("right"!==I){const e="bottom"===I?r-n.clientY:n.clientY-r;t.style.height=k(l+e,320,window.innerHeight-24)+"px"}if("bottom"!==I){const e="right"===I?o-n.clientX:n.clientX-o;t.style.width=k(i+e,320,window.innerWidth-24)+"px"}},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),y.classList.remove("active");const n=parseInt(t.style.width),e=parseInt(t.style.height);f("float"===I?{w:n,h:e}:"bottom"===I?{bh:e}:{rw:n})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)});const L=(n=>{let e=!1;const t=C("button","btn");t.innerHTML=h('<path d="M9 3a2 2 0 0 1 4 0v1h3a1 1 0 0 1 1 1v3h1a2 2 0 0 1 0 4h-1v3a1 1 0 0 1-1 1h-3v-1a2 2 0 0 0-4 0v1H6a1 1 0 0 1-1-1v-3H4a2 2 0 0 1 0-4h1V5a1 1 0 0 1 1-1h3z"/>');const o=C("div","plugins");o.hidden=!0;const r=()=>{const r=n.plugins||[];if(t.title=`plugins (${r.length})`,e)if(o.textContent="",r.length)for(const n of r){const e=C("div","plugin");e.appendChild(C("span","name",n.name)),e.appendChild(C("span","gave",O(n)||"nothing registered")),n.teardown||e.appendChild(C("span","flag","no teardown")),o.appendChild(e)}else o.appendChild(C("div","empty","no plugins installed, or this is a production build"))};return t.onclick=()=>{e=!e;for(const n of o.parentElement.children)n.hidden=n===o?!e:e;t.classList.toggle("active",e),r()},{btn:t,el:o,render:r}})(n);W=L.render,m.appendChild(L.btn),(s=C("button","btn")).onclick=()=>{F(b[I]),f({dock:I})},m.appendChild(s),(d=C("button","btn")).onclick=()=>{(n=>{try{localStorage.setItem(g,n)}catch{}})(V=w[V]),X()},m.appendChild(d),R.addEventListener("change",()=>{"system"===V&&X()}),X(),(l=C("button","btn")).title="pick an element on the page",l.innerHTML=h('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),l.onclick=()=>_?pn():(_=!0,l.classList.add("active"),document.addEventListener("click",an,!0),void document.addEventListener("mousemove",sn,!0)),m.appendChild(l);const E=C("button","btn","\u2715");E.onclick=()=>{_&&pn(),t.style.display="none",o.style.display="",f({open:!1})},m.appendChild(E),t.appendChild(m);const $=C("div","body"),z=C("div","side"),Y=C("div","tabs");(p=C("div","tab active")).onclick=()=>Q("Elements"),(c=C("div","tab")).onclick=()=>Q("Stores"),Y.appendChild(p),Y.appendChild(c),z.appendChild(Y);const A=C("input","filter");A.placeholder="Filter by name or state",A.oninput=()=>{M=A.value.trim().toLowerCase(),tn()},A.onkeydown=n=>{"Escape"===n.key&&(A.value="",M="",tn())},z.appendChild(A),r=C("div","tree"),z.appendChild(r),i=C("div","state"),$.appendChild(z),$.appendChild(i),$.appendChild(L.el),t.appendChild($),t.appendChild(y),e.appendChild(t);const J=v();J.w&&(N=t.style.width=J.w+"px"),J.h&&(j=t.style.height=J.h+"px"),null!=J.right&&(H=t.style.right=J.right+"px"),null!=J.bottom&&(T=t.style.bottom=J.bottom+"px"),J.bh&&(P=J.bh+"px"),J.rw&&(D=J.rw+"px"),F(J.dock||"float"),document.body.appendChild(u),J.open&&(o.style.display="none",t.style.display="flex",B(),hn()),n.on("scope:mount",hn),n.on("scope:unmount",n=>{n===S&&(S=null),hn()}),n.stores&&n.on("store:register",hn),n.plugins&&n.on("plugin:install",hn),n.on("flush",hn)},un=!1,vn=()=>{if(un)return;const e=window.__LITE_VUE__;e?(un=!0,n=e,document.body?gn():addEventListener("DOMContentLoaded",gn)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};vn();export{vn as init};
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).LiteVueDevtoolsPanel={})}(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var n,t,o,r,i,l,d,a,s,p,c,h,g=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",u="litevue-devtools-theme",f="litevue-devtools-ui",v=()=>{try{return JSON.parse(localStorage.getItem(f)||"{}")}catch{return{}}},x=e=>{try{localStorage.setItem(f,JSON.stringify({...v(),...e}))}catch{}},m={dark:g('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:g('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:g('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},b={float:g('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),right:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},y={float:"bottom",bottom:"right",right:"float"},w={float:"floating",bottom:"docked to bottom",right:"docked to right"},k={dark:"light",light:"system",system:"dark"},C=(e,n,t)=>Math.min(Math.max(e,n),Math.max(n,t)),L=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},E=(e,n)=>{const t=new Set,o=(e,r,i)=>{if(null!=e){if("object"!=typeof e)return String(e).toLowerCase().includes(n)?r:void 0;if(i>4||t.has(e))return;t.add(e);for(const t of Object.keys(e)){if("$"===t[0])continue;let l;try{l=e[t]}catch{continue}if("function"==typeof l)continue;const d=r?`${r}.${t}`:t;if(t.toLowerCase().includes(n))return d;const a=o(l,d,i+1);if(a)return a}}};return o(e,"",0)},O=e=>{let n;try{n=void 0===e?"undefined":JSON.stringify(e)??String(e)}catch{n=String(e)}return n.length>60?n.slice(0,60)+"\u2026":n},S=e=>[...e.directives.map(e=>"v-"+e),...e.magics].join(" "),M=null,$=null,_=!1,j="",z="Elements",I="float",N="",T="",H="",P="",D="",V="",W=()=>{},R=(()=>{try{const e=localStorage.getItem(u);if("light"===e||"system"===e)return e}catch{}return"dark"})(),X=matchMedia("(prefers-color-scheme: light)"),Y=()=>{const e="light"===R||"system"===R&&X.matches;t.host.classList.toggle("light",e),a.innerHTML=m[R],a.title="theme: "+R},A=new Set,B=new WeakSet,F=()=>{if("float"!==I)return;const e=parseInt(o.style.right)||0,n=parseInt(o.style.bottom)||0;H=o.style.right=C(e,0,window.innerWidth-o.offsetWidth)+"px",P=o.style.bottom=C(n,0,window.innerHeight-o.offsetHeight)+"px"},J=e=>{"float"===I?(N=o.style.width||N,T=o.style.height||T,H=o.style.right||H,P=o.style.bottom||P):"bottom"===I?D=o.style.height||D:V=o.style.width||V,I=e;const n="float"!==e;o.classList.toggle("dock-bottom","bottom"===e),o.classList.toggle("dock-right","right"===e),o.style.right=n?"":H,o.style.bottom=n?"":P,o.style.width="bottom"===e?"":"right"===e?V:N,o.style.height="right"===e?"":"bottom"===e?D:T,p.innerHTML=b[e],p.title="panel: "+w[e]},U=e=>{const n=L("span","label");return n.appendChild(L("span","punct","<")),n.appendChild(L("span","name",te(e))),n.appendChild(L("span","punct",">")),n},q=e=>{let t=e.parentElement;for(;t;){if(n.scopes.has(t))return t;t=t.parentElement}return null},G=e=>{const n=e.getBoundingClientRect();s.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},Z=()=>{s.style.display="none"},K=e=>{e!==M&&A.clear(),$=null,M=e,z="Elements",window.$scope=e?n.scopes.get(e):void 0,oe(),re()},Q=e=>{e!==$&&A.clear(),M=null,$=e,z="Stores",window.$scope=n.stores.get(e),oe(),re()},ee=e=>{z=e,oe()},ne=/^\s*([A-Za-z_$][\w$]*)\s*\(/,te=e=>n.names.get(e)||(e=>{const t=ne.exec(n.exps.get(e)||"")?.[1];return t&&n.components?.has(t)?t:void 0})(e)||e.id||e.tagName.toLowerCase(),oe=()=>{if((()=>{const e=n.stores?n.stores.size:0;c.textContent=`Elements (${n.scopes.size})`,c.className="Elements"===z?"tab active":"tab",h.textContent=`Stores (${e})`,h.className="Stores"===z?"tab active":"tab"})(),W(),i.textContent="","Elements"===z){const e=[...n.scopes.keys()].sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=new Map;for(const i of e)if(!j||te(i).toLowerCase().includes(j))t.set(i,void 0);else{const e=E(n.scopes.get(i),j);e&&t.set(i,e)}if(!t.size)return void i.appendChild(L("div","empty",j?"no matching scopes":"no scopes mounted"));const o=new Set;for(const n of t.keys()){o.add(n);for(let e=q(n);e;e=q(e))o.add(e)}const r=new Map,l=new Map,d=new Map;for(const n of e){if(!o.has(n))continue;const e=q(n);r.set(n,e),d.set(n,e?(d.get(e)??0)+1:0),e&&l.set(e,(l.get(e)||0)+1)}const a=e=>{for(let n=r.get(e);n;n=r.get(n)??null)if(B.has(n))return!0;return!1};for(const s of e){if(!o.has(s)||a(s))continue;const e=L("div",s===M?"row sel":"row");e.style.paddingLeft=8+12*(d.get(s)??0)+"px";const r=B.has(s);if(l.get(s)){const n=L("span",r?"arrow":"arrow open","\u25b6");n.onclick=e=>{e.stopPropagation(),r?B.delete(s):B.add(s),oe()},e.appendChild(n)}else e.appendChild(L("span","spacer"));e.appendChild(U(s));const p=n.exps.get(s);p&&e.appendChild(L("span","exp"," "+p));const c=t.get(s);c&&e.appendChild(L("span","hit"," "+c)),e.onclick=()=>K(s),e.onmouseenter=()=>G(s),e.onmouseleave=Z,i.appendChild(e)}return}const e=new Map;for(const o of n.stores?n.stores.keys():[])if(!j||o.toLowerCase().includes(j))e.set(o,void 0);else{const t=E(n.stores.get(o),j);t&&e.set(o,t)}const t=[...e.keys()];if(t.length)for(const n of t){const t=L("div",n===$?"row sel":"row"),o=L("span","label");o.appendChild(L("span","punct","$store.")),o.appendChild(L("span","name",n)),t.appendChild(o);const r=e.get(n);r&&t.appendChild(L("span","hit"," "+r)),t.onclick=()=>Q(n),i.appendChild(t)}else i.appendChild(L("div","empty",j?"no matching stores":"no stores registered"))},re=()=>{if(l.contains(t.activeElement))return;l.textContent="";const e=$?n.stores.get($):M?n.scopes.get(M):void 0;if(!e)return void l.appendChild(L("div","empty","Select a scope"));const{own:o,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof e[n],t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(e);o.forEach(n=>le(n,e,n,0,"prop",[])),r.length&&(l.appendChild(L("div","divider","inherited")),r.forEach(n=>le(n,e,n,0,"prop inherited",[]))),o.length||r.length||l.appendChild(L("div","empty","empty scope")),l.appendChild(ie(e))},ie=e=>{const n=L("div","prop adder");n.appendChild(L("span","spacer"));const t=L("input","val key-in");t.placeholder="key";const o=L("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:""===r||isNaN(+r)||(i=+r),e[n]=i,t.blur(),o.blur(),he(),setTimeout(()=>{const e=l.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},le=(e,n,t,o,r,i)=>{const d=n[e],a=L("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==d&&"object"==typeof d){const s=i.indexOf(d)>-1,p=!s&&A.has(t);if(a.appendChild(L("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(L("span","key",e)),a.appendChild(L("span","preview",s?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${O(e)}`:O(e))(d))),s||(a.classList.add("toggle"),a.onclick=()=>{p?A.delete(t):A.add(t),re()}),de(a,n,e,o,r),l.appendChild(a),p){const e=Object.keys(d);if(!e.length){const e=L("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",l.appendChild(e)}for(const n of e)le(n,d,t+"."+n,o+1,r,i.concat([d]))}return}a.appendChild(L("span","spacer")),a.appendChild(L("span","key",e));const s=((e,n)=>{for(let t=e;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyDescriptor(t,n);if(e)return e}})(n,e);if("function"==typeof d)a.appendChild(L("span","preview","\u0192"));else if((e=>{if(!e)return!1;if(e.get&&!e.set)return!0;const n=e.value;return!!n&&!0===n.__v_isRef&&!0===n.__v_isReadonly})(s))a.appendChild(L("span","preview",O(d)));else if("boolean"==typeof d){a.appendChild(L("span","bool",String(d)));const t=L("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{n[e]=t.checked,t.blur(),he()},a.appendChild(t)}else{const t=L("input","val");t.value=O(d),t.onfocus=()=>{t.value="string"==typeof d?d:String(d)},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=O(d),t.blur())},t.onblur=()=>{const o=((e,n)=>{if("number"==typeof n){const n=parseFloat(e);return isNaN(n)?e:n}return e})(t.value,d);o!==d?(n[e]=o,he()):t.value=O(d)},a.appendChild(t)}de(a,n,e,o,r),l.appendChild(a)},de=(e,n,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(n,o);if(l&&l.get)return;const d=L("button","del","\u2715");d.title=`delete "${o}"`,d.onclick=e=>{e.stopPropagation();const r=t.activeElement;r&&r.blur&&r.blur(),delete n[o],he()},e.appendChild(d)},ae=e=>{const o=e.target;if(o===t.host)return;e.preventDefault(),e.stopPropagation(),pe();let r=o;for(;r&&!n.scopes.has(r);)r=r.parentElement;r&&K(r)},se=e=>{let o=e.target;if(o!==t.host){for(;o&&!n.scopes.has(o);)o=o.parentElement;o?G(o):Z()}},pe=()=>{_=!1,d.classList.remove("active"),Z(),document.removeEventListener("click",ae,!0),document.removeEventListener("mousemove",se,!0)},ce=!1,he=()=>{ce||(ce=!0,setTimeout(()=>{ce=!1,"none"!==o.style.display&&(oe(),re())}))},ge=()=>{const e=document.createElement("div");t=e.attachShadow({mode:"open"});const f=document.createElement("style");f.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n[hidden] {\n display: none !important;\n}\n.plugins {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.plugin {\n display: flex;\n gap: 8px;\n padding: 3px 10px;\n align-items: baseline;\n}\n.plugin .name {\n min-width: 120px;\n}\n.plugin .gave {\n flex: 1;\n color: var(--muted);\n word-break: break-word;\n}\n.plugin .flag {\n color: var(--muted);\n opacity: 0.7;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",t.appendChild(f),s=L("div","highlight"),t.appendChild(s),(r=L("div","pill","\u26a1 LiteVue")).onclick=()=>{r.style.display="none",o.style.display="flex",F(),x({open:!0}),he()},t.appendChild(r),(o=L("div","panel")).style.display="none";const m=L("div","header");m.appendChild(L("span","title","\u26a1 LiteVue")),m.addEventListener("mousedown",e=>{if(e.target.closest(".btn"))return;if("float"!==I)return;e.preventDefault();const n=o.getBoundingClientRect(),t=window.innerWidth-n.right,r=window.innerHeight-n.bottom,i=e.clientX,l=e.clientY,d=e=>{o.style.right=C(t-(e.clientX-i),0,window.innerWidth-o.offsetWidth)+"px",o.style.bottom=C(r-(e.clientY-l),0,window.innerHeight-o.offsetHeight)+"px"},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),x({right:parseInt(o.style.right)||12,bottom:parseInt(o.style.bottom)||12})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)});const b=L("div","grip");b.addEventListener("mousedown",e=>{e.preventDefault(),b.classList.add("active");const n=o.getBoundingClientRect(),t=e.clientX,r=e.clientY,i=n.width,l=n.height,d=e=>{if("right"!==I){const n="bottom"===I?r-e.clientY:e.clientY-r;o.style.height=C(l+n,320,window.innerHeight-24)+"px"}if("bottom"!==I){const n="right"===I?t-e.clientX:e.clientX-t;o.style.width=C(i+n,320,window.innerWidth-24)+"px"}},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),b.classList.remove("active");const e=parseInt(o.style.width),n=parseInt(o.style.height);x("float"===I?{w:e,h:n}:"bottom"===I?{bh:n}:{rw:e})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)});const w=(e=>{let n=!1;const t=L("button","btn");t.innerHTML=g('<path d="M9 3a2 2 0 0 1 4 0v1h3a1 1 0 0 1 1 1v3h1a2 2 0 0 1 0 4h-1v3a1 1 0 0 1-1 1h-3v-1a2 2 0 0 0-4 0v1H6a1 1 0 0 1-1-1v-3H4a2 2 0 0 1 0-4h1V5a1 1 0 0 1 1-1h3z"/>');const o=L("div","plugins");o.hidden=!0;const r=()=>{const r=e.plugins||[];if(t.title=`plugins (${r.length})`,n)if(o.textContent="",r.length)for(const e of r){const n=L("div","plugin");n.appendChild(L("span","name",e.name)),n.appendChild(L("span","gave",S(e)||"nothing registered")),e.teardown||n.appendChild(L("span","flag","no teardown")),o.appendChild(n)}else o.appendChild(L("div","empty","no plugins installed, or this is a production build"))};return t.onclick=()=>{n=!n;for(const e of o.parentElement.children)e.hidden=e===o?!n:n;t.classList.toggle("active",n),r()},{btn:t,el:o,render:r}})(n);W=w.render,m.appendChild(w.btn),(p=L("button","btn")).onclick=()=>{J(y[I]),x({dock:I})},m.appendChild(p),(a=L("button","btn")).onclick=()=>{(e=>{try{localStorage.setItem(u,e)}catch{}})(R=k[R]),Y()},m.appendChild(a),X.addEventListener("change",()=>{"system"===R&&Y()}),Y(),(d=L("button","btn")).title="pick an element on the page",d.innerHTML=g('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),d.onclick=()=>_?pe():(_=!0,d.classList.add("active"),document.addEventListener("click",ae,!0),void document.addEventListener("mousemove",se,!0)),m.appendChild(d);const E=L("button","btn","\u2715");E.onclick=()=>{_&&pe(),o.style.display="none",r.style.display="",x({open:!1})},m.appendChild(E),o.appendChild(m);const O=L("div","body"),$=L("div","side"),z=L("div","tabs");(c=L("div","tab active")).onclick=()=>ee("Elements"),(h=L("div","tab")).onclick=()=>ee("Stores"),z.appendChild(c),z.appendChild(h),$.appendChild(z);const A=L("input","filter");A.placeholder="Filter by name or state",A.oninput=()=>{j=A.value.trim().toLowerCase(),oe()},A.onkeydown=e=>{"Escape"===e.key&&(A.value="",j="",oe())},$.appendChild(A),i=L("div","tree"),$.appendChild(i),l=L("div","state"),O.appendChild($),O.appendChild(l),O.appendChild(w.el),o.appendChild(O),o.appendChild(b),t.appendChild(o);const B=v();B.w&&(N=o.style.width=B.w+"px"),B.h&&(T=o.style.height=B.h+"px"),null!=B.right&&(H=o.style.right=B.right+"px"),null!=B.bottom&&(P=o.style.bottom=B.bottom+"px"),B.bh&&(D=B.bh+"px"),B.rw&&(V=B.rw+"px"),J(B.dock||"float"),document.body.appendChild(e),B.open&&(r.style.display="none",o.style.display="flex",F(),he()),n.on("scope:mount",he),n.on("scope:unmount",e=>{e===M&&(M=null),he()}),n.stores&&n.on("store:register",he),n.plugins&&n.on("plugin:install",he),n.on("flush",he)},ue=()=>{const e=window.__LITE_VUE__;e?(n=e,document.body?ge():addEventListener("DOMContentLoaded",ge)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};ue(),e.init=ue});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).LiteVueDevtoolsPanel={})}(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var n,t,o,r,i,l,d,a,s,p,c,h,g=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",u="litevue-devtools-theme",f="litevue-devtools-ui",v=()=>{try{return JSON.parse(localStorage.getItem(f)||"{}")}catch{return{}}},x=e=>{try{localStorage.setItem(f,JSON.stringify({...v(),...e}))}catch{}},m={dark:g('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:g('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:g('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},b={float:g('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),right:g('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},y={float:"bottom",bottom:"right",right:"float"},w={float:"floating",bottom:"docked to bottom",right:"docked to right"},k={dark:"light",light:"system",system:"dark"},C=(e,n,t)=>Math.min(Math.max(e,n),Math.max(n,t)),L=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},E=(e,n)=>{const t=new Set,o=(e,r,i)=>{if(null!=e){if("object"!=typeof e)return String(e).toLowerCase().includes(n)?r:void 0;if(i>4||t.has(e))return;t.add(e);for(const t of Object.keys(e)){if("$"===t[0])continue;let l;try{l=e[t]}catch{continue}if("function"==typeof l)continue;const d=r?`${r}.${t}`:t;if(t.toLowerCase().includes(n))return d;const a=o(l,d,i+1);if(a)return a}}};return o(e,"",0)},O=e=>{let n;try{n=void 0===e?"undefined":JSON.stringify(e)??String(e)}catch{n=String(e)}return n.length>60?n.slice(0,60)+"\u2026":n},S=e=>[...e.directives.map(e=>"v-"+e),...e.magics].join(" "),M=null,$=null,_=!1,j="",z="Elements",I="float",N="",T="",H="",P="",D="",V="",W=()=>{},R=(()=>{try{const e=localStorage.getItem(u);if("light"===e||"system"===e)return e}catch{}return"dark"})(),X=matchMedia("(prefers-color-scheme: light)"),Y=()=>{const e="light"===R||"system"===R&&X.matches;t.host.classList.toggle("light",e),a.innerHTML=m[R],a.title="theme: "+R},A=new Set,B=new WeakSet,F=()=>{if("float"!==I)return;const e=parseInt(o.style.right)||0,n=parseInt(o.style.bottom)||0;H=o.style.right=C(e,0,window.innerWidth-o.offsetWidth)+"px",P=o.style.bottom=C(n,0,window.innerHeight-o.offsetHeight)+"px"},J=e=>{"float"===I?(N=o.style.width||N,T=o.style.height||T,H=o.style.right||H,P=o.style.bottom||P):"bottom"===I?D=o.style.height||D:V=o.style.width||V,I=e;const n="float"!==e;o.classList.toggle("dock-bottom","bottom"===e),o.classList.toggle("dock-right","right"===e),o.style.right=n?"":H,o.style.bottom=n?"":P,o.style.width="bottom"===e?"":"right"===e?V:N,o.style.height="right"===e?"":"bottom"===e?D:T,p.innerHTML=b[e],p.title="panel: "+w[e]},U=e=>{const n=L("span","label");return n.appendChild(L("span","punct","<")),n.appendChild(L("span","name",te(e))),n.appendChild(L("span","punct",">")),n},q=e=>{let t=e.parentElement;for(;t;){if(n.scopes.has(t))return t;t=t.parentElement}return null},G=e=>{const n=e.getBoundingClientRect();s.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},Z=()=>{s.style.display="none"},K=e=>{e!==M&&A.clear(),$=null,M=e,z="Elements",window.$scope=e?n.scopes.get(e):void 0,oe(),re()},Q=e=>{e!==$&&A.clear(),M=null,$=e,z="Stores",window.$scope=n.stores.get(e),oe(),re()},ee=e=>{z=e,oe()},ne=/^\s*([A-Za-z_$][\w$]*)\s*\(/,te=e=>n.names.get(e)||(e=>{const t=ne.exec(n.exps.get(e)||"")?.[1];return t&&n.components?.has(t)?t:void 0})(e)||e.id||e.tagName.toLowerCase(),oe=()=>{if((()=>{const e=n.stores?n.stores.size:0;c.textContent=`Elements (${n.scopes.size})`,c.className="Elements"===z?"tab active":"tab",h.textContent=`Stores (${e})`,h.className="Stores"===z?"tab active":"tab"})(),W(),i.textContent="","Elements"===z){const e=[...n.scopes.keys()].sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=new Map;for(const i of e)if(!j||te(i).toLowerCase().includes(j))t.set(i,void 0);else{const e=E(n.scopes.get(i),j);e&&t.set(i,e)}if(!t.size)return void i.appendChild(L("div","empty",j?"no matching scopes":"no scopes mounted"));const o=new Set;for(const n of t.keys()){o.add(n);for(let e=q(n);e;e=q(e))o.add(e)}const r=new Map,l=new Map,d=new Map;for(const n of e){if(!o.has(n))continue;const e=q(n);r.set(n,e),d.set(n,e?(d.get(e)??0)+1:0),e&&l.set(e,(l.get(e)||0)+1)}const a=e=>{for(let n=r.get(e);n;n=r.get(n)??null)if(B.has(n))return!0;return!1};for(const s of e){if(!o.has(s)||a(s))continue;const e=L("div",s===M?"row sel":"row");e.style.paddingLeft=8+12*(d.get(s)??0)+"px";const r=B.has(s);if(l.get(s)){const n=L("span",r?"arrow":"arrow open","\u25b6");n.onclick=e=>{e.stopPropagation(),r?B.delete(s):B.add(s),oe()},e.appendChild(n)}else e.appendChild(L("span","spacer"));e.appendChild(U(s));const p=n.exps.get(s);p&&e.appendChild(L("span","exp"," "+p));const c=t.get(s);c&&e.appendChild(L("span","hit"," "+c)),e.onclick=()=>K(s),e.onmouseenter=()=>G(s),e.onmouseleave=Z,i.appendChild(e)}return}const e=new Map;for(const o of n.stores?n.stores.keys():[])if(!j||o.toLowerCase().includes(j))e.set(o,void 0);else{const t=E(n.stores.get(o),j);t&&e.set(o,t)}const t=[...e.keys()];if(t.length)for(const n of t){const t=L("div",n===$?"row sel":"row"),o=L("span","label");o.appendChild(L("span","punct","$store.")),o.appendChild(L("span","name",n)),t.appendChild(o);const r=e.get(n);r&&t.appendChild(L("span","hit"," "+r)),t.onclick=()=>Q(n),i.appendChild(t)}else i.appendChild(L("div","empty",j?"no matching stores":"no stores registered"))},re=()=>{if(l.contains(t.activeElement))return;l.textContent="";const e=$?n.stores.get($):M?n.scopes.get(M):void 0;if(!e)return void l.appendChild(L("div","empty","Select a scope"));const{own:o,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof e[n],t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(e);o.forEach(n=>le(n,e,n,0,"prop",[])),r.length&&(l.appendChild(L("div","divider","inherited")),r.forEach(n=>le(n,e,n,0,"prop inherited",[]))),o.length||r.length||l.appendChild(L("div","empty","empty scope")),l.appendChild(ie(e))},ie=e=>{const n=L("div","prop adder");n.appendChild(L("span","spacer"));const t=L("input","val key-in");t.placeholder="key";const o=L("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:""===r||isNaN(+r)||(i=+r),e[n]=i,t.blur(),o.blur(),he(),setTimeout(()=>{const e=l.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},le=(e,n,t,o,r,i)=>{const d=n[e],a=L("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==d&&"object"==typeof d){const s=i.indexOf(d)>-1,p=!s&&A.has(t);if(a.appendChild(L("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(L("span","key",e)),a.appendChild(L("span","preview",s?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${O(e)}`:O(e))(d))),s||(a.classList.add("toggle"),a.onclick=()=>{p?A.delete(t):A.add(t),re()}),de(a,n,e,o,r),l.appendChild(a),p){const e=Object.keys(d);if(!e.length){const e=L("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",l.appendChild(e)}for(const n of e)le(n,d,t+"."+n,o+1,r,i.concat([d]))}return}a.appendChild(L("span","spacer")),a.appendChild(L("span","key",e));const s=((e,n)=>{for(let t=e;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyDescriptor(t,n);if(e)return e}})(n,e);if("function"==typeof d)a.appendChild(L("span","preview","\u0192"));else if((e=>{if(!e)return!1;if(e.get&&!e.set)return!0;const n=e.value;return!!n&&!0===n.__v_isRef&&!0===n.__v_isReadonly})(s))a.appendChild(L("span","preview",O(d)));else if("boolean"==typeof d){a.appendChild(L("span","bool",String(d)));const t=L("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{n[e]=t.checked,t.blur(),he()},a.appendChild(t)}else{const t=L("input","val");t.value=O(d),t.onfocus=()=>{t.value="string"==typeof d?d:String(d)},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=O(d),t.blur())},t.onblur=()=>{const o=((e,n)=>{if("number"==typeof n){const n=parseFloat(e);return isNaN(n)?e:n}return e})(t.value,d);o!==d?(n[e]=o,he()):t.value=O(d)},a.appendChild(t)}de(a,n,e,o,r),l.appendChild(a)},de=(e,n,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(n,o);if(l&&l.get)return;const d=L("button","del","\u2715");d.title=`delete "${o}"`,d.onclick=e=>{e.stopPropagation();const r=t.activeElement;r&&r.blur&&r.blur(),delete n[o],he()},e.appendChild(d)},ae=e=>{const o=e.target;if(o===t.host)return;e.preventDefault(),e.stopPropagation(),pe();let r=o;for(;r&&!n.scopes.has(r);)r=r.parentElement;r&&K(r)},se=e=>{let o=e.target;if(o!==t.host){for(;o&&!n.scopes.has(o);)o=o.parentElement;o?G(o):Z()}},pe=()=>{_=!1,d.classList.remove("active"),Z(),document.removeEventListener("click",ae,!0),document.removeEventListener("mousemove",se,!0)},ce=!1,he=()=>{ce||(ce=!0,setTimeout(()=>{ce=!1,"none"!==o.style.display&&(oe(),re())}))},ge=()=>{const e=document.createElement("div");t=e.attachShadow({mode:"open"});const f=document.createElement("style");f.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n[hidden] {\n display: none !important;\n}\n.plugins {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.plugin {\n display: flex;\n gap: 8px;\n padding: 3px 10px;\n align-items: baseline;\n}\n.plugin .name {\n min-width: 120px;\n}\n.plugin .gave {\n flex: 1;\n color: var(--muted);\n word-break: break-word;\n}\n.plugin .flag {\n color: var(--muted);\n opacity: 0.7;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",t.appendChild(f),s=L("div","highlight"),t.appendChild(s),(r=L("div","pill","\u26a1 LiteVue")).onclick=()=>{r.style.display="none",o.style.display="flex",F(),x({open:!0}),he()},t.appendChild(r),(o=L("div","panel")).style.display="none";const m=L("div","header");m.appendChild(L("span","title","\u26a1 LiteVue")),m.addEventListener("mousedown",e=>{if(e.target.closest(".btn"))return;if("float"!==I)return;e.preventDefault();const n=o.getBoundingClientRect(),t=window.innerWidth-n.right,r=window.innerHeight-n.bottom,i=e.clientX,l=e.clientY,d=e=>{o.style.right=C(t-(e.clientX-i),0,window.innerWidth-o.offsetWidth)+"px",o.style.bottom=C(r-(e.clientY-l),0,window.innerHeight-o.offsetHeight)+"px"},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),x({right:parseInt(o.style.right)||12,bottom:parseInt(o.style.bottom)||12})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)});const b=L("div","grip");b.addEventListener("mousedown",e=>{e.preventDefault(),b.classList.add("active");const n=o.getBoundingClientRect(),t=e.clientX,r=e.clientY,i=n.width,l=n.height,d=e=>{if("right"!==I){const n="bottom"===I?r-e.clientY:e.clientY-r;o.style.height=C(l+n,320,window.innerHeight-24)+"px"}if("bottom"!==I){const n="right"===I?t-e.clientX:e.clientX-t;o.style.width=C(i+n,320,window.innerWidth-24)+"px"}},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),b.classList.remove("active");const e=parseInt(o.style.width),n=parseInt(o.style.height);x("float"===I?{w:e,h:n}:"bottom"===I?{bh:n}:{rw:e})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)});const w=(e=>{let n=!1;const t=L("button","btn");t.innerHTML=g('<path d="M9 3a2 2 0 0 1 4 0v1h3a1 1 0 0 1 1 1v3h1a2 2 0 0 1 0 4h-1v3a1 1 0 0 1-1 1h-3v-1a2 2 0 0 0-4 0v1H6a1 1 0 0 1-1-1v-3H4a2 2 0 0 1 0-4h1V5a1 1 0 0 1 1-1h3z"/>');const o=L("div","plugins");o.hidden=!0;const r=()=>{const r=e.plugins||[];if(t.title=`plugins (${r.length})`,n)if(o.textContent="",r.length)for(const e of r){const n=L("div","plugin");n.appendChild(L("span","name",e.name)),n.appendChild(L("span","gave",S(e)||"nothing registered")),e.teardown||n.appendChild(L("span","flag","no teardown")),o.appendChild(n)}else o.appendChild(L("div","empty","no plugins installed, or this is a production build"))};return t.onclick=()=>{n=!n;for(const e of o.parentElement.children)e.hidden=e===o?!n:n;t.classList.toggle("active",n),r()},{btn:t,el:o,render:r}})(n);W=w.render,m.appendChild(w.btn),(p=L("button","btn")).onclick=()=>{J(y[I]),x({dock:I})},m.appendChild(p),(a=L("button","btn")).onclick=()=>{(e=>{try{localStorage.setItem(u,e)}catch{}})(R=k[R]),Y()},m.appendChild(a),X.addEventListener("change",()=>{"system"===R&&Y()}),Y(),(d=L("button","btn")).title="pick an element on the page",d.innerHTML=g('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),d.onclick=()=>_?pe():(_=!0,d.classList.add("active"),document.addEventListener("click",ae,!0),void document.addEventListener("mousemove",se,!0)),m.appendChild(d);const E=L("button","btn","\u2715");E.onclick=()=>{_&&pe(),o.style.display="none",r.style.display="",x({open:!1})},m.appendChild(E),o.appendChild(m);const O=L("div","body"),$=L("div","side"),z=L("div","tabs");(c=L("div","tab active")).onclick=()=>ee("Elements"),(h=L("div","tab")).onclick=()=>ee("Stores"),z.appendChild(c),z.appendChild(h),$.appendChild(z);const A=L("input","filter");A.placeholder="Filter by name or state",A.oninput=()=>{j=A.value.trim().toLowerCase(),oe()},A.onkeydown=e=>{"Escape"===e.key&&(A.value="",j="",oe())},$.appendChild(A),i=L("div","tree"),$.appendChild(i),l=L("div","state"),O.appendChild($),O.appendChild(l),O.appendChild(w.el),o.appendChild(O),o.appendChild(b),t.appendChild(o);const B=v();B.w&&(N=o.style.width=B.w+"px"),B.h&&(T=o.style.height=B.h+"px"),null!=B.right&&(H=o.style.right=B.right+"px"),null!=B.bottom&&(P=o.style.bottom=B.bottom+"px"),B.bh&&(D=B.bh+"px"),B.rw&&(V=B.rw+"px"),J(B.dock||"float"),document.body.appendChild(e),B.open&&(r.style.display="none",o.style.display="flex",F(),he()),n.on("scope:mount",he),n.on("scope:unmount",e=>{e===M&&(M=null),he()}),n.stores&&n.on("store:register",he),n.plugins&&n.on("plugin:install",he),n.on("flush",he)},ue=!1,fe=()=>{if(ue)return;const e=window.__LITE_VUE__;e?(ue=!0,n=e,document.body?ge():addEventListener("DOMContentLoaded",ge)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};fe(),e.init=fe});
@@ -1,6 +1,6 @@
1
1
  var LiteVuePlugins = (function(exports, _aevantec_litevue) {
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- //#region src/plugins/intersect/index.ts
3
+ // src/plugins/intersect/index.ts
4
4
  /**
5
5
  * v-intersect="expression" — evaluates the expression when the element
6
6
  * enters the viewport.
@@ -28,8 +28,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
28
28
  return () => observer.disconnect();
29
29
  });
30
30
  };
31
- //#endregion
32
- //#region src/plugins/mask/index.ts
31
+ // src/plugins/mask/index.ts
33
32
  var tokens = {
34
33
  "9": /\d/,
35
34
  a: /[a-zA-Z]/,
@@ -68,7 +67,8 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
68
67
  if (masked === value) return false;
69
68
  input.value = masked;
70
69
  if (at != null && document.activeElement === input) {
71
- const to = format(value.slice(0, at), exp).length;
70
+ let to = format(value.slice(0, at), exp).length;
71
+ while (to < masked.length && !tokens[exp[to]]) to++;
72
72
  input.setSelectionRange(to, to);
73
73
  }
74
74
  return true;
@@ -85,8 +85,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
85
85
  };
86
86
  });
87
87
  };
88
- //#endregion
89
- //#region src/plugins/transition/index.ts
88
+ // src/plugins/transition/index.ts
90
89
  var toMs = (v) => (parseFloat(v) || 0) * (v.includes("ms") ? 1 : 1e3);
91
90
  var maxOf = (durations, delays) => {
92
91
  const ds = durations.split(",");
@@ -170,8 +169,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
170
169
  };
171
170
  });
172
171
  };
173
- //#endregion
174
- //#region src/plugins/persist/index.ts
172
+ // src/plugins/persist/index.ts
175
173
  var PREFIX = "litevue:";
176
174
  /** Custom storages registered by name, usable as a directive modifier. */
177
175
  var registry = Object.create(null);
@@ -288,9 +286,10 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
288
286
  if (!storage) console.error(`persistStore("${name}") — storage "${String(options.storage)}" is not available.`);
289
287
  return sync(target, PREFIX + (options.key ?? name), options.keys, storage, _aevantec_litevue.watchEffect);
290
288
  };
291
- //#endregion
292
- //#region src/plugins/focus/index.ts
289
+ // src/plugins/focus/index.ts
293
290
  var FOCUSABLE = "a[href],area[href],button,input:not([type=hidden]),select,textarea,summary,iframe,audio[controls],video[controls],[contenteditable],[tabindex]";
291
+ var traps = [];
292
+ var isTabStop = (e, _, all) => e.type !== "radio" || !e.name || e === (all.find((o) => o.type === "radio" && o.name === e.name && o.checked) || all.find((o) => o.type === "radio" && o.name === e.name));
294
293
  /**
295
294
  * Focus utilities.
296
295
  *
@@ -321,9 +320,9 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
321
320
  app.directive("trap", ({ el, get, effect }) => {
322
321
  let active = false;
323
322
  let prevFocus = null;
324
- const focusables = () => [...el.querySelectorAll(FOCUSABLE)].filter((e) => e.tabIndex >= 0 && !e.matches(":disabled,[inert] *") && e.checkVisibility?.({ visibilityProperty: true }) !== false);
323
+ const focusables = () => [...el.querySelectorAll(FOCUSABLE)].filter((e) => e.tabIndex >= 0 && !e.matches(":disabled,[inert] *") && e.checkVisibility?.({ visibilityProperty: true }) !== false).filter(isTabStop);
325
324
  const onKeydown = (e) => {
326
- if (e.key !== "Tab") return;
325
+ if (e.key !== "Tab" || traps.at(-1) !== onKeydown) return;
327
326
  const els = focusables();
328
327
  if (!els.length) {
329
328
  e.preventDefault();
@@ -335,7 +334,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
335
334
  if (!el.contains(current)) {
336
335
  e.preventDefault();
337
336
  first.focus();
338
- } else if (e.shiftKey && current === first) {
337
+ } else if (e.shiftKey && (current === first || current === el)) {
339
338
  e.preventDefault();
340
339
  last.focus();
341
340
  } else if (!e.shiftKey && current === last) {
@@ -345,6 +344,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
345
344
  };
346
345
  const release = () => {
347
346
  active = false;
347
+ traps.splice(traps.indexOf(onKeydown), 1);
348
348
  document.removeEventListener("keydown", onKeydown, true);
349
349
  if (prevFocus && prevFocus.focus) prevFocus.focus();
350
350
  };
@@ -353,6 +353,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
353
353
  if (on && !active) {
354
354
  active = true;
355
355
  prevFocus = document.activeElement;
356
+ traps.push(onKeydown);
356
357
  document.addEventListener("keydown", onKeydown, true);
357
358
  Promise.resolve().then(() => {
358
359
  if (active) (focusables()[0] || el).focus();
@@ -364,8 +365,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
364
365
  };
365
366
  });
366
367
  };
367
- //#endregion
368
- //#region src/plugins/collapse/index.ts
368
+ // src/plugins/collapse/index.ts
369
369
  /**
370
370
  * v-collapse="expression" — expands/collapses the element's height with a
371
371
  * transition as the expression toggles. The initial state applies without
@@ -431,8 +431,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
431
431
  };
432
432
  });
433
433
  };
434
- //#endregion
435
- //#region src/plugins/morph/index.ts
434
+ // src/plugins/morph/index.ts
436
435
  /**
437
436
  * A `data-` attribute rather than `v-preserve`: an unrecognised `v-` attribute
438
437
  * logs an unknown-directive error, and registering one would have the walker
@@ -506,7 +505,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
506
505
  var patchAttrs = (from, to) => {
507
506
  const owned = boundAttrs(to);
508
507
  const bound = Object(from.__bound);
509
- for (const { name, value } of [...to.attributes]) {
508
+ for (const { name, value } of to.attributes) {
510
509
  if (dirRE.test(name) || owned.has(name) || name in bound) continue;
511
510
  if (from.getAttribute(name) !== value) from.setAttribute(name, value);
512
511
  }
@@ -584,6 +583,10 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
584
583
  patchNode(match, newChild, ctx, opts);
585
584
  } else insert(newChild);
586
585
  } else if (oldChild && keyOf(oldChild) == null) {
586
+ if (preserved(oldChild, opts) && !preserved(newChild, opts)) {
587
+ oldChild = oldChild.nextSibling;
588
+ continue;
589
+ }
587
590
  const nextOld = oldChild.nextSibling;
588
591
  patchNode(oldChild, newChild, ctx, opts);
589
592
  oldChild = nextOld;
@@ -610,7 +613,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
610
613
  const holder = document.createElement("template");
611
614
  holder.innerHTML = to.trim();
612
615
  const content = holder.content;
613
- target = content.childElementCount === 1 ? content.firstElementChild : (() => {
616
+ target = content.childNodes.length === 1 && content.firstElementChild ? content.firstElementChild : (() => {
614
617
  const wrapper = from.cloneNode(false);
615
618
  wrapper.appendChild(content);
616
619
  return wrapper;
@@ -656,8 +659,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
656
659
  var morphPlugin = (app) => {
657
660
  app.scope.$morph = morph;
658
661
  };
659
- //#endregion
660
- //#region src/plugins/media/index.ts
662
+ // src/plugins/media/index.ts
661
663
  var DEFAULT_BREAKPOINTS = {
662
664
  sm: 640,
663
665
  md: 768,
@@ -767,7 +769,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
767
769
  if (typeof key === "number") return key;
768
770
  if (key === "base") return 0;
769
771
  if (NUMERIC.test(key)) return Number(key);
770
- const alias = ALIASES[key];
772
+ const alias = scale[key] === void 0 ? ALIASES[key] : void 0;
771
773
  if (alias !== void 0) return alias === "base" ? 0 : scale[alias];
772
774
  return scale[key];
773
775
  };
@@ -858,9 +860,9 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
858
860
  } }
859
861
  });
860
862
  /**
861
- * Drops every live subscription; `activate()` rebuilds them on the next read,
862
- * so this is safe while something still holds `mq`. The scale is deliberately
863
- * left alone — a page that configured one still wants it.
863
+ * Drops every live subscription; `activate()` rebuilds them on the next read.
864
+ * The scale is deliberately left alone — a page that configured one still
865
+ * wants it.
864
866
  */
865
867
  var releaseSubscriptions = () => {
866
868
  scaleSubs.forEach((s) => s.off());
@@ -900,10 +902,12 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
900
902
  enumerable: true,
901
903
  configurable: true
902
904
  });
903
- return releaseSubscriptions;
905
+ return () => {
906
+ releaseSubscriptions();
907
+ state.tick++;
908
+ };
904
909
  };
905
- //#endregion
906
- //#region src/plugins/resize/index.ts
910
+ // src/plugins/resize/index.ts
907
911
  /**
908
912
  * `v-resize="expr"` — element size, which no media query reports and container
909
913
  * queries cannot hand to JavaScript. The expression runs with `$width` and
@@ -935,7 +939,6 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
935
939
  return () => observer.disconnect();
936
940
  });
937
941
  };
938
- //#endregion
939
942
  exports.collapse = collapse;
940
943
  exports.defaultBreakpoints = defaultBreakpoints;
941
944
  exports.focus = focus;