voodoojs 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3349,7 +3349,7 @@ init_reactivity();
3349
3349
  // src/store/index.ts
3350
3350
  init_reactivity();
3351
3351
  var stores = /* @__PURE__ */ new Map();
3352
- var versao = ref(0);
3352
+ var version = ref(0);
3353
3353
  var persistHandles = /* @__PURE__ */ new Map();
3354
3354
  function store(name, definition, options = {}) {
3355
3355
  const existing = stores.get(name);
@@ -3366,30 +3366,30 @@ function store(name, definition, options = {}) {
3366
3366
  return existing;
3367
3367
  }
3368
3368
  const key = typeof options.persist === "string" ? options.persist : `voodoo:store:${name}`;
3369
- const descritores = Object.getOwnPropertyDescriptors(definition);
3370
- const initial = Object.defineProperties({}, descritores);
3369
+ const descriptors = Object.getOwnPropertyDescriptors(definition);
3370
+ const initial = Object.defineProperties({}, descriptors);
3371
3371
  if (options.persist && typeof localStorage !== "undefined") {
3372
3372
  try {
3373
3373
  const saved = localStorage.getItem(key);
3374
3374
  if (saved) {
3375
- const salvo = JSON.parse(saved);
3376
- for (const [chave, valor] of Object.entries(salvo)) {
3377
- if (descritores[chave] && !("value" in descritores[chave])) continue;
3378
- initial[chave] = valor;
3375
+ const parsed = JSON.parse(saved);
3376
+ for (const [field, value] of Object.entries(parsed)) {
3377
+ if (descriptors[field] && !("value" in descriptors[field])) continue;
3378
+ initial[field] = value;
3379
3379
  }
3380
3380
  }
3381
3381
  } catch {
3382
3382
  }
3383
3383
  }
3384
3384
  const created = reactive(initial);
3385
- for (const [prop, descritor] of Object.entries(descritores)) {
3386
- const value = descritor.value;
3385
+ for (const [prop, descriptor] of Object.entries(descriptors)) {
3386
+ const value = descriptor.value;
3387
3387
  if (typeof value === "function") {
3388
3388
  created[prop] = (...args) => value.apply(created, args);
3389
3389
  }
3390
3390
  }
3391
3391
  stores.set(name, created);
3392
- versao.value++;
3392
+ version.value++;
3393
3393
  if (options.persist && typeof localStorage !== "undefined") {
3394
3394
  const stop2 = watch(
3395
3395
  created,
@@ -3407,10 +3407,10 @@ function store(name, definition, options = {}) {
3407
3407
  }
3408
3408
  function stripFunctions(source) {
3409
3409
  const out = {};
3410
- const descritores = Object.getOwnPropertyDescriptors(toRaw(source));
3410
+ const descriptors = Object.getOwnPropertyDescriptors(toRaw(source));
3411
3411
  for (const [key, value] of Object.entries(source)) {
3412
3412
  if (typeof value === "function") continue;
3413
- if (descritores[key] && !("value" in descritores[key])) continue;
3413
+ if (descriptors[key] && !("value" in descriptors[key])) continue;
3414
3414
  out[key] = value;
3415
3415
  }
3416
3416
  return out;
@@ -3419,11 +3419,11 @@ var allStores = new Proxy(
3419
3419
  {},
3420
3420
  {
3421
3421
  get: (_t, key) => {
3422
- void versao.value;
3422
+ void version.value;
3423
3423
  return stores.get(key);
3424
3424
  },
3425
3425
  has: (_t, key) => {
3426
- void versao.value;
3426
+ void version.value;
3427
3427
  return stores.has(key);
3428
3428
  },
3429
3429
  ownKeys: () => [...stores.keys()],
@@ -4673,10 +4673,11 @@ var cache2 = {
4673
4673
  }
4674
4674
  };
4675
4675
  var THEME_KEY = "voodoo:theme";
4676
+ var picked = null;
4676
4677
  var theme = {
4677
4678
  /** Theme chosen by the user, or `system` when never set. */
4678
4679
  get current() {
4679
- return storage.get(THEME_KEY) ?? "system";
4680
+ return storage.get(THEME_KEY) ?? picked ?? "system";
4680
4681
  },
4681
4682
  /** Theme effectively applied, resolving `system`. */
4682
4683
  get resolved() {
@@ -4686,6 +4687,7 @@ var theme = {
4686
4687
  return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
4687
4688
  },
4688
4689
  set(value) {
4690
+ picked = value;
4689
4691
  storage.set(THEME_KEY, value);
4690
4692
  this.apply();
4691
4693
  },
@@ -4696,7 +4698,7 @@ var theme = {
4696
4698
  },
4697
4699
  /** `true` once the visitor has actually picked a theme. */
4698
4700
  get chosen() {
4699
- return storage.get(THEME_KEY) != null;
4701
+ return picked !== null || storage.get(THEME_KEY) != null;
4700
4702
  },
4701
4703
  /** Writes `data-theme` on the root element and notifies the page. */
4702
4704
  apply() {
@@ -4720,7 +4722,8 @@ var theme = {
4720
4722
  init() {
4721
4723
  if (typeof document === "undefined") return;
4722
4724
  this.apply();
4723
- matchMedia?.("(prefers-color-scheme: dark)").addEventListener("change", () => {
4725
+ if (typeof matchMedia === "undefined") return;
4726
+ matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
4724
4727
  if (this.current === "system") this.apply();
4725
4728
  });
4726
4729
  }
@@ -5155,8 +5158,8 @@ function transitionOptions(el) {
5155
5158
  defineDirective("text", ({ el, effect: effect3, evaluate: ev }) => {
5156
5159
  effect3(() => {
5157
5160
  el.textContent = stringify(ev());
5158
- const primeiro = el.firstChild;
5159
- if (primeiro && primeiro.nodeType === 3) markInitialized(primeiro);
5161
+ const first = el.firstChild;
5162
+ if (first && first.nodeType === 3) markInitialized(first);
5160
5163
  });
5161
5164
  });
5162
5165
  defineDirective("html", (ctx) => {
@@ -5359,10 +5362,10 @@ defineDirective(
5359
5362
  next.push({ key, scope: childScope, nodes, data: childScope.data });
5360
5363
  });
5361
5364
  if (batch.fragment.firstChild) anchor.parentNode?.insertBefore(batch.fragment, anchor);
5362
- for (const [node, escopo] of batch.pending) walk(node, escopo);
5363
- const reaproveitados = new Set(next);
5365
+ for (const [node, rowScope] of batch.pending) walk(node, rowScope);
5366
+ const reused = new Set(next);
5364
5367
  for (const block2 of blocks) {
5365
- if (used.has(block2.key) && reaproveitados.has(block2)) continue;
5368
+ if (used.has(block2.key) && reused.has(block2)) continue;
5366
5369
  for (const node of block2.nodes) {
5367
5370
  destroy(node);
5368
5371
  node.remove();
@@ -5432,7 +5435,7 @@ var BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
5432
5435
  "novalidate",
5433
5436
  "inert"
5434
5437
  ]);
5435
- var ATRIBUTOS_DE_URL = /* @__PURE__ */ new Set([
5438
+ var URL_ATTRIBUTES = /* @__PURE__ */ new Set([
5436
5439
  "href",
5437
5440
  "src",
5438
5441
  "action",
@@ -5441,15 +5444,15 @@ var ATRIBUTOS_DE_URL = /* @__PURE__ */ new Set([
5441
5444
  "ping",
5442
5445
  "poster"
5443
5446
  ]);
5444
- var RUIDO_DE_ESQUEMA = /[\s\x00-\x1f]/g;
5445
- function urlPerigosa(valor) {
5446
- const limpo = valor.replace(RUIDO_DE_ESQUEMA, "").toLowerCase();
5447
- return limpo.startsWith("javascript:") || limpo.startsWith("vbscript:") || limpo.startsWith("data:text/html") || limpo.startsWith("data:application/xhtml");
5447
+ var SCHEME_NOISE = /[\s\x00-\x1f]/g;
5448
+ function isDangerousUrl(value) {
5449
+ const clean = value.replace(SCHEME_NOISE, "").toLowerCase();
5450
+ return clean.startsWith("javascript:") || clean.startsWith("vbscript:") || clean.startsWith("data:text/html") || clean.startsWith("data:application/xhtml");
5448
5451
  }
5449
- function applyBinding(el, name, value, asProp = false, perigoLiberado = false) {
5452
+ function applyBinding(el, name, value, asProp = false, allowDangerous = false) {
5450
5453
  if (name === "class") return applyClass(el, value);
5451
5454
  if (name === "style") return applyStyle(el, value);
5452
- if (exports.config.sanitizeUrls && !perigoLiberado && name === "srcdoc") {
5455
+ if (exports.config.sanitizeUrls && !allowDangerous && name === "srcdoc") {
5453
5456
  warn2(
5454
5457
  `:srcdoc refused in ${describeElement(el)}: the value becomes a document with active script inside the iframe, the same way v-html becomes markup. If the content is trusted, write :srcdoc.dangerous="..."; to turn off this protection on the entire application, set V.config.sanitizeUrls = false.`
5455
5458
  );
@@ -5457,7 +5460,7 @@ function applyBinding(el, name, value, asProp = false, perigoLiberado = false) {
5457
5460
  return;
5458
5461
  }
5459
5462
  if (exports.config.sanitizeUrls && !asProp) {
5460
- if (ATRIBUTOS_DE_URL.has(name) && typeof value === "string" && urlPerigosa(value)) {
5463
+ if (URL_ATTRIBUTES.has(name) && typeof value === "string" && isDangerousUrl(value)) {
5461
5464
  warn2(
5462
5465
  `value refused in :${name} of ${describeElement(el)}: "${value.slice(0, 60)}" uses a scheme that executes code. Use an http(s) or relative address. To turn off this protection, set V.config.sanitizeUrls = false.`
5463
5466
  );
@@ -5554,9 +5557,9 @@ defineDirective(
5554
5557
  }
5555
5558
  if (arg === "key") return;
5556
5559
  const asProp = !!modifiers.prop;
5557
- const perigoLiberado = !!modifiers.dangerous;
5560
+ const allowDangerous = !!modifiers.dangerous;
5558
5561
  effect3(() => {
5559
- applyBinding(el, arg, ev(), asProp, perigoLiberado);
5562
+ applyBinding(el, arg, ev(), asProp, allowDangerous);
5560
5563
  });
5561
5564
  },
5562
5565
  { priority: exports.PRIORITY.BIND }
@@ -6473,7 +6476,7 @@ function directive(name, definition) {
6473
6476
  name,
6474
6477
  (ctx) => {
6475
6478
  let oldValue;
6476
- let mounted = false;
6479
+ let mounted2 = false;
6477
6480
  const makeBinding = (value) => ({
6478
6481
  el: ctx.el,
6479
6482
  value,
@@ -6489,8 +6492,8 @@ function directive(name, definition) {
6489
6492
  hooks.beforeMount?.(ctx.el, makeBinding(initial));
6490
6493
  ctx.effect(() => {
6491
6494
  const value = hooks.raw ? ctx.expression : ctx.evaluate();
6492
- if (!mounted) {
6493
- mounted = true;
6495
+ if (!mounted2) {
6496
+ mounted2 = true;
6494
6497
  oldValue = value;
6495
6498
  hooks.mounted?.(ctx.el, makeBinding(value));
6496
6499
  return;
@@ -6513,11 +6516,11 @@ function data(values) {
6513
6516
  Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
6514
6517
  return rootScope.data;
6515
6518
  }
6516
- var version = "0.4.6";
6519
+ var version2 = "0.4.6";
6517
6520
  var core = {
6518
6521
  // Utilities first: Voodoo's own names can override.
6519
6522
  ...utils_exports,
6520
- version,
6523
+ version: version2,
6521
6524
  config: exports.config,
6522
6525
  // Reactivity
6523
6526
  reactive,
@@ -7729,6 +7732,32 @@ function buildUrl(location2) {
7729
7732
  const base = settings2.base === "/" ? "" : settings2.base.replace(/\/$/, "");
7730
7733
  return `${base}${suffix}` || "/";
7731
7734
  }
7735
+ var historyRefused = false;
7736
+ var writingHash = false;
7737
+ function writeUrl(state2, url2, replace) {
7738
+ if (!historyRefused) {
7739
+ try {
7740
+ if (replace) window.history.replaceState(state2, "", url2);
7741
+ else window.history.pushState(state2, "", url2);
7742
+ return;
7743
+ } catch (error) {
7744
+ if (!(error instanceof Error) || error.name !== "SecurityError") throw error;
7745
+ historyRefused = true;
7746
+ }
7747
+ }
7748
+ if (settings2.mode !== "hash") return;
7749
+ const hash = url2.slice(url2.indexOf("#"));
7750
+ if (window.location.hash === hash) return;
7751
+ writingHash = true;
7752
+ try {
7753
+ if (replace) window.location.replace(url2);
7754
+ else window.location.hash = hash;
7755
+ } finally {
7756
+ setTimeout(() => {
7757
+ writingHash = false;
7758
+ }, 0);
7759
+ }
7760
+ }
7732
7761
  function compileRoute(pattern, record) {
7733
7762
  const clean = pattern === "*" ? "*" : normalizePath(pattern);
7734
7763
  const raw = clean === "*" ? ["*"] : clean.split("/").filter(Boolean);
@@ -7915,8 +7944,7 @@ async function navigate(target2, options = {}) {
7915
7944
  const key = uid("rota");
7916
7945
  const historyState = { ...options.state ?? {}, [HISTORY_KEY]: key };
7917
7946
  const url2 = buildUrl(destination);
7918
- if (options.replace) window.history.replaceState(historyState, "", url2);
7919
- else window.history.pushState(historyState, "", url2);
7947
+ writeUrl(historyState, url2, options.replace === true);
7920
7948
  currentKey = key;
7921
7949
  applyLocation(destination);
7922
7950
  if (options.scroll !== false) scheduleScroll(destination, from, null);
@@ -7929,17 +7957,14 @@ async function navigate(target2, options = {}) {
7929
7957
  return true;
7930
7958
  }
7931
7959
  async function onHistoryChange(event) {
7960
+ if (writingHash) return;
7932
7961
  const { path, query: query2, hash } = readLocation();
7933
7962
  const destination = locationFor(path, query2, hash);
7934
7963
  const from = snapshot();
7935
7964
  if (destination.fullPath === from.fullPath) return;
7936
7965
  const verdict = await runGuards(destination, from);
7937
7966
  if (verdict === false) {
7938
- window.history.replaceState(
7939
- { [HISTORY_KEY]: currentKey },
7940
- "",
7941
- buildUrl(from)
7942
- );
7967
+ writeUrl({ [HISTORY_KEY]: currentKey }, buildUrl(from), true);
7943
7968
  devtoolsBus.emit("navigation", {
7944
7969
  from: from.fullPath,
7945
7970
  to: destination.fullPath,
@@ -7982,6 +8007,8 @@ function stopRouter() {
7982
8007
  window.removeEventListener("popstate", historyListener);
7983
8008
  window.removeEventListener("hashchange", historyListener);
7984
8009
  window.removeEventListener("beforeunload", saveScroll);
8010
+ historyRefused = false;
8011
+ writingHash = false;
7985
8012
  }
7986
8013
  async function enterInitialRoute() {
7987
8014
  if (typeof window === "undefined") return;
@@ -8002,7 +8029,7 @@ async function enterInitialRoute() {
8002
8029
  break;
8003
8030
  }
8004
8031
  currentKey = uid("rota");
8005
- window.history.replaceState({ [HISTORY_KEY]: currentKey }, "", buildUrl(destination));
8032
+ writeUrl({ [HISTORY_KEY]: currentKey }, buildUrl(destination), true);
8006
8033
  applyLocation(destination);
8007
8034
  if (destination.hash) scheduleScroll(destination, from, null);
8008
8035
  settings2.afterEach?.(snapshot(), from);
@@ -9841,7 +9868,7 @@ defineDirective("tooltip", ({ el, expression, cleanup }) => {
9841
9868
  if (addedTabIndex) el.setAttribute("tabindex", "0");
9842
9869
  let bubble = null;
9843
9870
  let timer = null;
9844
- const build = () => {
9871
+ const build2 = () => {
9845
9872
  const node = document.createElement("div");
9846
9873
  node.className = "v-tooltip";
9847
9874
  node.setAttribute("role", "tooltip");
@@ -9855,7 +9882,7 @@ defineDirective("tooltip", ({ el, expression, cleanup }) => {
9855
9882
  };
9856
9883
  const open = () => {
9857
9884
  if (bubble) return;
9858
- bubble = build();
9885
+ bubble = build2();
9859
9886
  el.setAttribute("aria-describedby", bubble.id);
9860
9887
  reposition();
9861
9888
  requestAnimationFrame(() => bubble?.classList.add("v-in"));
@@ -11041,37 +11068,37 @@ init_reactivity();
11041
11068
  init_registry();
11042
11069
  init_style();
11043
11070
  var messages = {
11044
- required: "Preencha este campo.",
11045
- email: "Informe um e-mail valido.",
11046
- url: "Informe uma URL valida.",
11047
- number: "Informe um numero valido.",
11048
- integer: "Informe um numero inteiro.",
11049
- decimal: "Informe um numero decimal valido.",
11050
- alpha: "Use apenas letras.",
11051
- alphanumeric: "Use apenas letras e numeros.",
11052
- minlength: "Use no minimo {param} caracteres.",
11053
- maxlength: "Use no maximo {param} caracteres.",
11054
- min: "O valor minimo e {param}.",
11055
- max: "O valor maximo e {param}.",
11056
- between: "Informe um valor entre {min} e {max}.",
11057
- match: "Os campos nao conferem.",
11058
- regex: "O formato informado nao e valido.",
11059
- date: "Informe uma data valida.",
11060
- after: "A data precisa ser posterior a {param}.",
11061
- before: "A data precisa ser anterior a {param}.",
11062
- accepted: "E preciso marcar esta opcao para continuar.",
11063
- same: "Os valores precisam ser iguais.",
11064
- different: "Os valores precisam ser diferentes.",
11065
- in: "Escolha uma das opcoes permitidas.",
11066
- notin: "Este valor nao e permitido.",
11067
- phone: "Informe um telefone valido com DDD.",
11068
- cpf: "CPF invalido.",
11069
- cnpj: "CNPJ invalido.",
11070
- cep: "CEP invalido.",
11071
- creditcard: "Numero de cartao invalido.",
11072
- strongpassword: "Use {param} caracteres ou mais, com maiuscula, minuscula, numero e simbolo.",
11073
- unique: "Este valor ja esta em uso.",
11074
- invalid: "Valor invalido."
11071
+ required: "Please fill in this field.",
11072
+ email: "Enter a valid email address.",
11073
+ url: "Enter a valid URL.",
11074
+ number: "Enter a valid number.",
11075
+ integer: "Enter a whole number.",
11076
+ decimal: "Enter a valid decimal number.",
11077
+ alpha: "Use letters only.",
11078
+ alphanumeric: "Use letters and numbers only.",
11079
+ minlength: "Use at least {param} characters.",
11080
+ maxlength: "Use at most {param} characters.",
11081
+ min: "The smallest allowed value is {param}.",
11082
+ max: "The largest allowed value is {param}.",
11083
+ between: "Enter a value between {min} and {max}.",
11084
+ match: "The fields do not match.",
11085
+ regex: "That format is not valid.",
11086
+ date: "Enter a valid date.",
11087
+ after: "The date has to be later than {param}.",
11088
+ before: "The date has to be earlier than {param}.",
11089
+ accepted: "You have to tick this to continue.",
11090
+ same: "The values have to be the same.",
11091
+ different: "The values have to be different.",
11092
+ in: "Choose one of the allowed options.",
11093
+ notin: "That value is not allowed.",
11094
+ phone: "Enter a valid phone number, including the area code.",
11095
+ cpf: "Invalid CPF.",
11096
+ cnpj: "Invalid CNPJ.",
11097
+ cep: "Invalid postcode.",
11098
+ creditcard: "Invalid card number.",
11099
+ strongpassword: "Use {param} characters or more, with an upper case letter, a lower case letter, a number and a symbol.",
11100
+ unique: "That value is already taken.",
11101
+ invalid: "Invalid value."
11075
11102
  };
11076
11103
  function formatMessage(template, data2) {
11077
11104
  const param = data2.param ?? "";
@@ -14444,7 +14471,7 @@ function normalize2(options, type) {
14444
14471
  const labels2 = fromOptions ? options.labels.map((label) => String(label)) : [];
14445
14472
  const series = [];
14446
14473
  const raw = options.data;
14447
- const singleName = options.name ?? "Valor";
14474
+ const singleName = options.name ?? "Value";
14448
14475
  if (typeof raw === "number") {
14449
14476
  series.push({ name: singleName, values: [raw], xs: null, color: palette2[0] });
14450
14477
  } else if (Array.isArray(raw) && raw.length > 0) {
@@ -15174,7 +15201,7 @@ function draw(state2) {
15174
15201
  const palette2 = options.colors && options.colors.length > 0 ? options.colors : CHART_COLORS;
15175
15202
  const format = options.format ?? "number";
15176
15203
  const width = Math.max(160, Math.round(el.clientWidth || options.width || 640));
15177
- const height = Math.max(48, Math.round(options.height ?? defaultHeight(type)));
15204
+ const height = Math.max(48, Math.round(options.height ?? (el.clientHeight || defaultHeight(type))));
15178
15205
  state2.lastWidth = width;
15179
15206
  state2.viewWidth = width;
15180
15207
  state2.viewHeight = height;
@@ -16026,7 +16053,7 @@ var CSS5 = `
16026
16053
  @keyframes v-shimmer{0%{background-position:-180% 0}100%{background-position:180% 0}}
16027
16054
  @keyframes v-indeterminate{0%{transform:translateX(-100%)}100%{transform:translateX(340%)}}
16028
16055
 
16029
- /* ------------------------------------------------------------------ botao */
16056
+ /* ----------------------------------------------------------------- button */
16030
16057
  .v-btn{appearance:none;-webkit-appearance:none;position:relative;display:inline-flex;
16031
16058
  align-items:center;justify-content:center;gap:8px;vertical-align:middle;white-space:nowrap;
16032
16059
  font-family:var(--v-font-sans);font-weight:600;line-height:1;text-decoration:none;
@@ -16070,7 +16097,7 @@ var CSS5 = `
16070
16097
  .v-btn-spin{width:1em;height:1em;border-radius:50%;border:2px solid currentColor;
16071
16098
  border-top-color:transparent;animation:v-spin .7s linear infinite;flex:none}
16072
16099
 
16073
- /* ------------------------------------------------------- botao de icone */
16100
+ /* ------------------------------------------------------------ icon button */
16074
16101
  .v-icon-btn{appearance:none;-webkit-appearance:none;display:inline-grid;place-items:center;
16075
16102
  border:1px solid transparent;border-radius:var(--v-radius-sm);cursor:pointer;
16076
16103
  font-family:var(--v-font-sans);
@@ -16115,7 +16142,7 @@ var CSS5 = `
16115
16142
  .v-card-foot:empty{display:none}
16116
16143
  .v-card[data-padded="false"] .v-card-body{padding:0}
16117
16144
 
16118
- /* ------------------------------------------------------------ formulario */
16145
+ /* ------------------------------------------------------------------- form */
16119
16146
  .v-field{display:flex;flex-direction:column;gap:6px;font-family:var(--v-font-sans);min-width:0}
16120
16147
  .v-label{display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:600;
16121
16148
  line-height:1.3;color:var(--v-text)}
@@ -16194,7 +16221,7 @@ var CSS5 = `
16194
16221
  .v-select-opt.is-selected .v-select-check{opacity:1}
16195
16222
  .v-select-empty{padding:14px 10px;text-align:center;font-size:13.5px;color:var(--v-text-muted)}
16196
16223
 
16197
- /* -------------------------------------------- caixa, radio e interruptor */
16224
+ /* --------------------------------------------- checkbox, radio and switch */
16198
16225
  .v-check{display:inline-flex;align-items:flex-start;gap:9px;cursor:pointer;
16199
16226
  font-family:var(--v-font-sans);font-size:14px;line-height:1.45;color:var(--v-text)}
16200
16227
  .v-check[data-disabled="true"]{cursor:not-allowed;opacity:.6}
@@ -16231,7 +16258,7 @@ var CSS5 = `
16231
16258
  .v-check[data-size="sm"] .v-switch-thumb{width:16px;height:16px}
16232
16259
  .v-check[data-size="sm"] .v-check-native:checked+.v-switch-track .v-switch-thumb{transform:translateX(14px)}
16233
16260
 
16234
- /* --------------------------------------------------- selo, etiqueta, alerta */
16261
+ /* ------------------------------------------------------ badge, tag, alert */
16235
16262
  .v-badge{display:inline-flex;align-items:center;gap:5px;font-family:var(--v-font-sans);
16236
16263
  font-weight:600;line-height:1;border-radius:var(--v-radius-full);border:1px solid transparent;
16237
16264
  white-space:nowrap;vertical-align:middle}
@@ -16308,7 +16335,7 @@ var CSS5 = `
16308
16335
  .v-avatar-status[data-status="busy"]{background:var(--v-danger)}
16309
16336
  .v-avatar-status[data-status="away"]{background:var(--v-warning)}
16310
16337
 
16311
- /* ------------------------------------------------- spinner e esqueleto */
16338
+ /* --------------------------------------------------- spinner and skeleton */
16312
16339
  .v-spinner{display:inline-block;border-radius:50%;border-style:solid;border-color:var(--v-border);
16313
16340
  border-top-color:var(--v-primary);animation:v-spin .7s linear infinite;vertical-align:middle}
16314
16341
  .v-spinner[data-tone="accent"]{border-top-color:var(--v-accent)}
@@ -16325,7 +16352,7 @@ var CSS5 = `
16325
16352
  .v-skeleton[data-circle="true"]{border-radius:var(--v-radius-full)}
16326
16353
  .v-skeleton-stack{display:flex;flex-direction:column;gap:8px}
16327
16354
 
16328
- /* ------------------------------------------------------------- progresso */
16355
+ /* --------------------------------------------------------------- progress */
16329
16356
  .v-progress{font-family:var(--v-font-sans);display:flex;flex-direction:column;gap:6px}
16330
16357
  .v-progress-head{display:flex;justify-content:space-between;gap:12px;font-size:13px;color:var(--v-text-muted)}
16331
16358
  .v-progress-value{font-weight:650;color:var(--v-text)}
@@ -16342,7 +16369,7 @@ var CSS5 = `
16342
16369
  .v-progress[data-tone="danger"] .v-progress-bar{background:var(--v-danger)}
16343
16370
  .v-progress[data-indeterminate="true"] .v-progress-bar{width:30% !important;animation:v-indeterminate 1.3s var(--v-ease) infinite}
16344
16371
 
16345
- /* ------------------------------------------------------------- divisor */
16372
+ /* ---------------------------------------------------------------- divider */
16346
16373
  .v-divider{display:flex;align-items:center;gap:12px;color:var(--v-text-soft);
16347
16374
  font-family:var(--v-font-sans);font-size:12.5px;font-weight:600;margin:16px 0}
16348
16375
  .v-divider::before,.v-divider::after{content:"";flex:1;height:1px;background:var(--v-border)}
@@ -16350,7 +16377,7 @@ var CSS5 = `
16350
16377
  .v-divider[data-vertical="true"]{flex-direction:column;margin:0 16px;align-self:stretch;height:auto}
16351
16378
  .v-divider[data-vertical="true"]::before,.v-divider[data-vertical="true"]::after{width:1px;height:auto;flex:1}
16352
16379
 
16353
- /* -------------------------------------------------------------- tabela */
16380
+ /* ------------------------------------------------------------------ table */
16354
16381
  .v-table-wrap{width:100%;overflow-x:auto;background:var(--v-surface);border:1px solid var(--v-border);
16355
16382
  border-radius:var(--v-radius);font-family:var(--v-font-sans)}
16356
16383
  .v-table{width:100%;border-collapse:collapse;font-size:14px;color:var(--v-text)}
@@ -16371,7 +16398,7 @@ var CSS5 = `
16371
16398
  .v-th[aria-sort="ascending"] .v-th-arrow,.v-th[aria-sort="descending"] .v-th-arrow{opacity:1;color:var(--v-primary)}
16372
16399
  .v-table-empty{text-align:center;color:var(--v-text-muted);padding:34px 14px;font-size:14px}
16373
16400
 
16374
- /* ---------------------------------------------------------- paginacao */
16401
+ /* ------------------------------------------------------------- pagination */
16375
16402
  .v-pagination{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-family:var(--v-font-sans)}
16376
16403
  .v-page{appearance:none;min-width:34px;height:34px;padding:0 9px;display:inline-grid;place-items:center;
16377
16404
  background:transparent;border:1px solid transparent;border-radius:var(--v-radius-sm);
@@ -16383,7 +16410,7 @@ var CSS5 = `
16383
16410
  .v-page[aria-current="page"]{background:var(--v-primary);border-color:var(--v-primary);color:var(--v-primary-contrast)}
16384
16411
  .v-page-gap{min-width:24px;text-align:center;color:var(--v-text-soft);user-select:none}
16385
16412
 
16386
- /* ----------------------------------------------------------- migalhas */
16413
+ /* ------------------------------------------------------------- breadcrumb */
16387
16414
  .v-breadcrumb{font-family:var(--v-font-sans);font-size:13.5px}
16388
16415
  .v-breadcrumb-list{list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;padding:0}
16389
16416
  .v-breadcrumb-item{display:inline-flex;align-items:center;gap:6px;color:var(--v-text-muted)}
@@ -16393,7 +16420,7 @@ var CSS5 = `
16393
16420
  .v-breadcrumb-item[aria-current="page"]{color:var(--v-text);font-weight:600}
16394
16421
  .v-breadcrumb-sep{color:var(--v-text-soft);user-select:none}
16395
16422
 
16396
- /* ------------------------------------------------------------ metrica */
16423
+ /* ------------------------------------------------------------------- stat */
16397
16424
  .v-stat{display:flex;gap:14px;align-items:flex-start;padding:16px 18px;background:var(--v-surface);
16398
16425
  border:1px solid var(--v-border);border-radius:var(--v-radius);font-family:var(--v-font-sans)}
16399
16426
  .v-stat-icon{flex:none;width:40px;height:40px;display:grid;place-items:center;font-size:19px;
@@ -16411,7 +16438,7 @@ var CSS5 = `
16411
16438
  .v-stat-delta[data-dir="flat"]{background:var(--v-surface-3);color:var(--v-text-muted)}
16412
16439
  .v-stat-hint{font-size:12.5px;color:var(--v-text-muted)}
16413
16440
 
16414
- /* ------------------------------------------------------- estado vazio */
16441
+ /* ------------------------------------------------------------ empty state */
16415
16442
  .v-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;
16416
16443
  padding:44px 22px;font-family:var(--v-font-sans);color:var(--v-text)}
16417
16444
  .v-empty-icon{width:58px;height:58px;display:grid;place-items:center;font-size:27px;
@@ -16421,7 +16448,7 @@ var CSS5 = `
16421
16448
  .v-empty-actions{margin-top:6px;display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
16422
16449
  .v-empty-actions:empty{display:none}
16423
16450
 
16424
- /* ----------------------------------------------------------- linha do tempo */
16451
+ /* --------------------------------------------------------------- timeline */
16425
16452
  .v-timeline{list-style:none;margin:0;padding:0;font-family:var(--v-font-sans);
16426
16453
  display:flex;flex-direction:column}
16427
16454
  .v-timeline-item{position:relative;display:flex;gap:14px;padding-bottom:20px}
@@ -16441,7 +16468,7 @@ var CSS5 = `
16441
16468
  .v-timeline-desc{margin:3px 0 0;font-size:13.5px;line-height:1.55;color:var(--v-text-muted)}
16442
16469
  .v-timeline-time{display:block;margin-top:3px;font-size:12px;color:var(--v-text-soft)}
16443
16470
 
16444
- /* ---------------------------------------------------------------- passos */
16471
+ /* ------------------------------------------------------------------ steps */
16445
16472
  .v-steps{display:flex;gap:0;font-family:var(--v-font-sans);list-style:none;margin:0;padding:0}
16446
16473
  .v-steps[data-vertical="true"]{flex-direction:column;gap:4px}
16447
16474
  .v-step{flex:1;display:flex;align-items:flex-start;gap:10px;min-width:0;position:relative;padding-right:12px}
@@ -16460,7 +16487,7 @@ var CSS5 = `
16460
16487
  .v-steps[data-vertical="true"] .v-step-line{left:13px;right:auto;top:30px;bottom:2px;width:2px;height:auto}
16461
16488
  .v-step:last-child .v-step-line{display:none}
16462
16489
 
16463
- /* ------------------------------------------------------------ avaliacao */
16490
+ /* ----------------------------------------------------------------- rating */
16464
16491
  .v-rating{display:inline-flex;align-items:center;gap:6px;font-family:var(--v-font-sans)}
16465
16492
  .v-rating-stars{display:inline-flex;gap:2px}
16466
16493
  .v-star{appearance:none;background:none;border:0;padding:2px;cursor:pointer;line-height:0;
@@ -16487,7 +16514,7 @@ var CSS5 = `
16487
16514
  .v-tip[data-placement="right"]{left:calc(100% + 8px);top:50%;translate:0 -50%}
16488
16515
  .v-tipwrap:hover .v-tip,.v-tipwrap:focus-within .v-tip{opacity:1;transform:none}
16489
16516
 
16490
- /* ------------------------------------------------------------ codigo */
16517
+ /* ------------------------------------------------------------------- code */
16491
16518
  .v-code{position:relative;background:var(--v-surface-inset);border:1px solid var(--v-border);
16492
16519
  border-radius:var(--v-radius);overflow:hidden;font-family:var(--v-font-mono)}
16493
16520
  .v-code-head{display:flex;align-items:center;justify-content:space-between;gap:10px;
@@ -17488,7 +17515,7 @@ register("v-table", {
17488
17515
  props: {
17489
17516
  columns: { type: "any", default: "" },
17490
17517
  rows: { type: "any", default: "" },
17491
- empty: { type: "string", default: "Nenhum registro encontrado" },
17518
+ empty: { type: "string", default: "No records found" },
17492
17519
  sortable: { type: "any", default: true },
17493
17520
  dense: BOOL,
17494
17521
  striped: BOOL,
@@ -17598,9 +17625,9 @@ register("v-pagination", {
17598
17625
  total: { type: "number", default: 0 },
17599
17626
  perPage: { type: "number", default: 10 },
17600
17627
  siblings: { type: "number", default: 1 },
17601
- previousLabel: { type: "string", default: "Anterior" },
17602
- nextLabel: { type: "string", default: "Pr\xF3xima" },
17603
- ariaLabel: { type: "string", default: "Pagina\xE7\xE3o" }
17628
+ previousLabel: { type: "string", default: "Previous" },
17629
+ nextLabel: { type: "string", default: "Next" },
17630
+ ariaLabel: { type: "string", default: "Pagination" }
17604
17631
  },
17605
17632
  computed: {
17606
17633
  lastPage() {
@@ -17614,7 +17641,7 @@ register("v-pagination", {
17614
17641
  const value = Number(this.page) || 1;
17615
17642
  return Math.min(Math.max(1, Math.round(value)), this.lastPage);
17616
17643
  },
17617
- /** Numeros visiveis, com `0` marcando as reticencias. */
17644
+ /** Visible page numbers, with `0` marking the ellipsis. */
17618
17645
  items() {
17619
17646
  const last = this.lastPage;
17620
17647
  const current2 = this.currentPage;
@@ -17659,7 +17686,7 @@ register("v-pagination", {
17659
17686
  <template v-for="(item, index) in items" :key="index">
17660
17687
  <span class="v-page-gap" v-if="item === 0" aria-hidden="true">...</span>
17661
17688
  <button type="button" class="v-page" v-if="item !== 0" :aria-current="isCurrent(item)"
17662
- :aria-label="'P\xE1gina ' + item" v-click="go(item)" v-text="item"></button>
17689
+ :aria-label="'Page ' + item" v-click="go(item)" v-text="item"></button>
17663
17690
  </template>
17664
17691
  <button type="button" class="v-page" :disabled="currentPage >= lastPage"
17665
17692
  :aria-label="nextLabel" v-click="go(currentPage + 1)" v-html="svgIcon('chevron-right')"></button>
@@ -17691,7 +17718,7 @@ register("v-breadcrumb", {
17691
17718
  props: {
17692
17719
  items: { type: "any", default: "" },
17693
17720
  separator: { type: "string", default: "/" },
17694
- ariaLabel: { type: "string", default: "Trilha de navega\xE7\xE3o" }
17721
+ ariaLabel: { type: "string", default: "Breadcrumb" }
17695
17722
  },
17696
17723
  computed: {
17697
17724
  crumbs() {
@@ -17724,7 +17751,7 @@ register("v-stat", {
17724
17751
  hint: TEXT,
17725
17752
  icon: TEXT,
17726
17753
  suffix: { type: "string", default: "%" },
17727
- /** Quando `true`, uma variacao negativa e considerada positiva. */
17754
+ /** When `true`, a negative change counts as positive. */
17728
17755
  inverted: BOOL
17729
17756
  },
17730
17757
  computed: {
@@ -17777,7 +17804,7 @@ register("v-stat", {
17777
17804
  register("v-empty-state", {
17778
17805
  props: {
17779
17806
  icon: { type: "string", default: "inbox" },
17780
- title: { type: "string", default: "Nada por aqui" },
17807
+ title: { type: "string", default: "Nothing here yet" },
17781
17808
  description: TEXT
17782
17809
  },
17783
17810
  template: `
@@ -17848,7 +17875,7 @@ register("v-steps", {
17848
17875
  steps: { type: "any", default: "" },
17849
17876
  current: { type: "number", default: 0 },
17850
17877
  vertical: BOOL,
17851
- ariaLabel: { type: "string", default: "Etapas" }
17878
+ ariaLabel: { type: "string", default: "Steps" }
17852
17879
  },
17853
17880
  computed: {
17854
17881
  ...flags("vertical"),
@@ -17892,7 +17919,7 @@ register("v-rating", {
17892
17919
  value: { type: "number", default: 0 },
17893
17920
  max: { type: "number", default: 5 },
17894
17921
  size: { type: "string", default: "md" },
17895
- label: { type: "string", default: "Avalia\xE7\xE3o" },
17922
+ label: { type: "string", default: "Rating" },
17896
17923
  readonly: BOOL,
17897
17924
  disabled: BOOL,
17898
17925
  showValue: BOOL,
@@ -17918,7 +17945,7 @@ register("v-rating", {
17918
17945
  return this.hovered > 0 ? this.hovered : this.score;
17919
17946
  },
17920
17947
  valueText() {
17921
- return `${this.score} de ${this.total}`;
17948
+ return `${this.score} of ${this.total}`;
17922
17949
  }
17923
17950
  },
17924
17951
  methods: {
@@ -17974,7 +18001,7 @@ register("v-rating", {
17974
18001
  :tabindex="locked ? -1 : 0" :aria-readonly="locked" v-keydown="onKey" v-mouseleave="reset">
17975
18002
  <span class="v-rating-stars">
17976
18003
  <button type="button" class="v-star" v-for="index in total" :key="index"
17977
- :data-on="isOn(index)" :disabled="locked" :aria-label="index + ' de ' + total"
18004
+ :data-on="isOn(index)" :disabled="locked" :aria-label="index + ' of ' + total"
17978
18005
  :tabindex="-1" v-click="pick(index)" v-mouseenter="preview(index)"
17979
18006
  v-html="svgIcon('star')"></button>
17980
18007
  </span>
@@ -18042,8 +18069,8 @@ register("v-code-block", {
18042
18069
  code: TEXT,
18043
18070
  language: TEXT,
18044
18071
  filename: TEXT,
18045
- copyLabel: { type: "string", default: "Copiar" },
18046
- copiedLabel: { type: "string", default: "Copiado" },
18072
+ copyLabel: { type: "string", default: "Copy" },
18073
+ copiedLabel: { type: "string", default: "Copied" },
18047
18074
  wrap: BOOL
18048
18075
  },
18049
18076
  state() {
@@ -18383,7 +18410,7 @@ function openDialog(request2) {
18383
18410
  source.remove();
18384
18411
  }
18385
18412
  sourceAnchors.delete(source);
18386
- if (source.hasAttribute(`${exports.config.prefix}modal-content`) || source.hasAttribute("data-v-modal-content")) {
18413
+ if (hasDirective(source, "modal-content")) {
18387
18414
  source.setAttribute("hidden", "");
18388
18415
  }
18389
18416
  }
@@ -20385,14 +20412,14 @@ function xray(force) {
20385
20412
 
20386
20413
  // src/devtools/launcher.ts
20387
20414
  init_style();
20388
- var POSICAO_KEY = "voodoo:devtools:widget-position";
20389
- var ESCONDIDO_KEY = "voodoo:devtools:widget-hidden";
20390
- var LIMIAR_ARRASTO = 4;
20415
+ var POSITION_KEY = "voodoo:devtools:widget-position";
20416
+ var HIDDEN_KEY = "voodoo:devtools:widget-hidden";
20417
+ var DRAG_THRESHOLD = 4;
20391
20418
  var refs2 = null;
20392
- var montado = false;
20393
- var timerContador = 0;
20394
- var timerPulso = 0;
20395
- var desligar = [];
20419
+ var mounted = false;
20420
+ var counterTimer = 0;
20421
+ var pulseTimer = 0;
20422
+ var teardown2 = [];
20396
20423
  var WIDGET_CSS = `
20397
20424
  .v-devtools-widget{
20398
20425
  all: initial;
@@ -20525,220 +20552,220 @@ var WIDGET_CSS = `
20525
20552
  .v-devtools-btn:hover{transform:none}
20526
20553
  }
20527
20554
  `;
20528
- var MARCA = `<svg class="v-devtools-mark" viewBox="0 0 24 24" fill="none" aria-hidden="true">
20555
+ var MARK = `<svg class="v-devtools-mark" viewBox="0 0 24 24" fill="none" aria-hidden="true">
20529
20556
  <path d="M4 4l8 16 8-16" stroke="#6D3BF5" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>
20530
20557
  <circle cx="12" cy="7.5" r="2" fill="#FF3D8B"/>
20531
20558
  </svg>`;
20532
- function lerPosicao() {
20559
+ function readPosition() {
20533
20560
  try {
20534
- const bruto = localStorage.getItem(POSICAO_KEY);
20535
- if (!bruto) return null;
20536
- const valor = JSON.parse(bruto);
20537
- if (typeof valor?.x !== "number" || typeof valor?.y !== "number") return null;
20538
- return valor;
20561
+ const raw = localStorage.getItem(POSITION_KEY);
20562
+ if (!raw) return null;
20563
+ const value = JSON.parse(raw);
20564
+ if (typeof value?.x !== "number" || typeof value?.y !== "number") return null;
20565
+ return value;
20539
20566
  } catch {
20540
20567
  return null;
20541
20568
  }
20542
20569
  }
20543
- function gravarPosicao(pos) {
20570
+ function writePosition(pos) {
20544
20571
  try {
20545
- localStorage.setItem(POSICAO_KEY, JSON.stringify(pos));
20572
+ localStorage.setItem(POSITION_KEY, JSON.stringify(pos));
20546
20573
  } catch {
20547
20574
  }
20548
20575
  }
20549
- function aplicarPosicao(raiz, pos) {
20550
- const largura = raiz.offsetWidth || 120;
20551
- const altura = raiz.offsetHeight || 38;
20552
- const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth - largura - 8));
20553
- const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight - altura - 8));
20554
- raiz.style.left = `${x}px`;
20555
- raiz.style.top = `${y}px`;
20556
- raiz.style.right = "auto";
20557
- raiz.style.bottom = "auto";
20558
- }
20559
- function construir() {
20560
- const raiz = document.createElement("div");
20561
- raiz.className = "v-devtools-widget";
20562
- raiz.setAttribute("data-voodoo-devtools", "widget");
20563
- const botao = document.createElement("button");
20564
- botao.type = "button";
20565
- botao.className = "v-devtools-btn";
20566
- botao.setAttribute("aria-label", "Open Voodoo devtools (Ctrl+Shift+X)");
20567
- botao.setAttribute("aria-pressed", "false");
20568
- botao.title = "Voodoo devtools \u2014 click to inspect, drag to move (Ctrl+Shift+X)";
20569
- botao.innerHTML = MARCA;
20570
- const rotulo = document.createElement("span");
20571
- rotulo.className = "v-devtools-label";
20572
- rotulo.textContent = "Voodoo";
20573
- const contador = document.createElement("span");
20574
- contador.className = "v-devtools-count";
20575
- contador.textContent = "0";
20576
- const pulso = document.createElement("span");
20577
- pulso.className = "v-devtools-pulse";
20578
- pulso.setAttribute("data-on", "false");
20579
- botao.append(rotulo, contador, pulso);
20580
- const fechar = document.createElement("button");
20581
- fechar.type = "button";
20582
- fechar.className = "v-devtools-close";
20583
- fechar.setAttribute("aria-label", "Hide the devtools widget in this tab");
20584
- fechar.title = "Hide in this tab";
20585
- fechar.textContent = "\xD7";
20586
- raiz.append(botao, fechar);
20587
- document.body.appendChild(raiz);
20588
- const salva = lerPosicao();
20589
- if (salva) {
20590
- aplicarPosicao(raiz, salva);
20576
+ function applyPosition(root, pos) {
20577
+ const width = root.offsetWidth || 120;
20578
+ const height = root.offsetHeight || 38;
20579
+ const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth - width - 8));
20580
+ const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight - height - 8));
20581
+ root.style.left = `${x}px`;
20582
+ root.style.top = `${y}px`;
20583
+ root.style.right = "auto";
20584
+ root.style.bottom = "auto";
20585
+ }
20586
+ function build() {
20587
+ const root = document.createElement("div");
20588
+ root.className = "v-devtools-widget";
20589
+ root.setAttribute("data-voodoo-devtools", "widget");
20590
+ const button = document.createElement("button");
20591
+ button.type = "button";
20592
+ button.className = "v-devtools-btn";
20593
+ button.setAttribute("aria-label", "Open Voodoo devtools (Ctrl+Shift+X)");
20594
+ button.setAttribute("aria-pressed", "false");
20595
+ button.title = "Voodoo devtools \u2014 click to inspect, drag to move (Ctrl+Shift+X)";
20596
+ button.innerHTML = MARK;
20597
+ const label = document.createElement("span");
20598
+ label.className = "v-devtools-label";
20599
+ label.textContent = "Voodoo";
20600
+ const counter2 = document.createElement("span");
20601
+ counter2.className = "v-devtools-count";
20602
+ counter2.textContent = "0";
20603
+ const pulse = document.createElement("span");
20604
+ pulse.className = "v-devtools-pulse";
20605
+ pulse.setAttribute("data-on", "false");
20606
+ button.append(label, counter2, pulse);
20607
+ const close = document.createElement("button");
20608
+ close.type = "button";
20609
+ close.className = "v-devtools-close";
20610
+ close.setAttribute("aria-label", "Hide the devtools widget in this tab");
20611
+ close.title = "Hide in this tab";
20612
+ close.textContent = "\xD7";
20613
+ root.append(button, close);
20614
+ document.body.appendChild(root);
20615
+ const saved = readPosition();
20616
+ if (saved) {
20617
+ applyPosition(root, saved);
20591
20618
  } else {
20592
- raiz.style.right = "16px";
20593
- raiz.style.bottom = "16px";
20594
- }
20595
- return { raiz, botao, pulso, contador, fechar };
20596
- }
20597
- function ligarArrasto(refs3, aoClicar) {
20598
- let arrastando = false;
20599
- let moveu = false;
20600
- let deslocX = 0;
20601
- let deslocY = 0;
20602
- let inicioX = 0;
20603
- let inicioY = 0;
20604
- const aoDescer = (evento) => {
20605
- if (evento.button !== 0) return;
20606
- const caixa = refs3.raiz.getBoundingClientRect();
20607
- arrastando = true;
20608
- moveu = false;
20609
- inicioX = evento.clientX;
20610
- inicioY = evento.clientY;
20611
- deslocX = evento.clientX - caixa.left;
20612
- deslocY = evento.clientY - caixa.top;
20613
- refs3.botao.setPointerCapture?.(evento.pointerId);
20619
+ root.style.right = "16px";
20620
+ root.style.bottom = "16px";
20621
+ }
20622
+ return { root, button, pulse, counter: counter2, close };
20623
+ }
20624
+ function enableDrag(refs3, onClick) {
20625
+ let dragging = false;
20626
+ let moved = false;
20627
+ let offsetX = 0;
20628
+ let offsetY = 0;
20629
+ let startX = 0;
20630
+ let startY = 0;
20631
+ const onPointerDown = (event) => {
20632
+ if (event.button !== 0) return;
20633
+ const box = refs3.root.getBoundingClientRect();
20634
+ dragging = true;
20635
+ moved = false;
20636
+ startX = event.clientX;
20637
+ startY = event.clientY;
20638
+ offsetX = event.clientX - box.left;
20639
+ offsetY = event.clientY - box.top;
20640
+ refs3.button.setPointerCapture?.(event.pointerId);
20614
20641
  };
20615
- const aoMover = (evento) => {
20616
- if (!arrastando) return;
20617
- const distancia = Math.hypot(evento.clientX - inicioX, evento.clientY - inicioY);
20618
- if (!moveu && distancia < LIMIAR_ARRASTO) return;
20619
- moveu = true;
20620
- evento.preventDefault();
20621
- aplicarPosicao(refs3.raiz, { x: evento.clientX - deslocX, y: evento.clientY - deslocY });
20642
+ const onPointerMove2 = (event) => {
20643
+ if (!dragging) return;
20644
+ const distance = Math.hypot(event.clientX - startX, event.clientY - startY);
20645
+ if (!moved && distance < DRAG_THRESHOLD) return;
20646
+ moved = true;
20647
+ event.preventDefault();
20648
+ applyPosition(refs3.root, { x: event.clientX - offsetX, y: event.clientY - offsetY });
20622
20649
  };
20623
- const aoSubir = (evento) => {
20624
- if (!arrastando) return;
20625
- arrastando = false;
20626
- refs3.botao.releasePointerCapture?.(evento.pointerId);
20627
- if (!moveu) {
20628
- aoClicar();
20650
+ const onPointerUp = (event) => {
20651
+ if (!dragging) return;
20652
+ dragging = false;
20653
+ refs3.button.releasePointerCapture?.(event.pointerId);
20654
+ if (!moved) {
20655
+ onClick();
20629
20656
  return;
20630
20657
  }
20631
- const caixa = refs3.raiz.getBoundingClientRect();
20632
- gravarPosicao({ x: caixa.left, y: caixa.top });
20658
+ const box = refs3.root.getBoundingClientRect();
20659
+ writePosition({ x: box.left, y: box.top });
20633
20660
  };
20634
- const aoTeclar = (evento) => {
20635
- if (evento.key !== "Enter" && evento.key !== " ") return;
20636
- evento.preventDefault();
20637
- aoClicar();
20661
+ const onKeyDown = (event) => {
20662
+ if (event.key !== "Enter" && event.key !== " ") return;
20663
+ event.preventDefault();
20664
+ onClick();
20638
20665
  };
20639
- const aoRedimensionar = () => {
20640
- const caixa = refs3.raiz.getBoundingClientRect();
20641
- if (refs3.raiz.style.left) aplicarPosicao(refs3.raiz, { x: caixa.left, y: caixa.top });
20666
+ const onResize = () => {
20667
+ const box = refs3.root.getBoundingClientRect();
20668
+ if (refs3.root.style.left) applyPosition(refs3.root, { x: box.left, y: box.top });
20642
20669
  };
20643
- refs3.botao.addEventListener("pointerdown", aoDescer);
20644
- refs3.botao.addEventListener("pointermove", aoMover);
20645
- refs3.botao.addEventListener("pointerup", aoSubir);
20646
- refs3.botao.addEventListener("pointercancel", aoSubir);
20647
- refs3.botao.addEventListener("keydown", aoTeclar);
20648
- window.addEventListener("resize", aoRedimensionar);
20670
+ refs3.button.addEventListener("pointerdown", onPointerDown);
20671
+ refs3.button.addEventListener("pointermove", onPointerMove2);
20672
+ refs3.button.addEventListener("pointerup", onPointerUp);
20673
+ refs3.button.addEventListener("pointercancel", onPointerUp);
20674
+ refs3.button.addEventListener("keydown", onKeyDown);
20675
+ window.addEventListener("resize", onResize);
20649
20676
  return () => {
20650
- refs3.botao.removeEventListener("pointerdown", aoDescer);
20651
- refs3.botao.removeEventListener("pointermove", aoMover);
20652
- refs3.botao.removeEventListener("pointerup", aoSubir);
20653
- refs3.botao.removeEventListener("pointercancel", aoSubir);
20654
- refs3.botao.removeEventListener("keydown", aoTeclar);
20655
- window.removeEventListener("resize", aoRedimensionar);
20677
+ refs3.button.removeEventListener("pointerdown", onPointerDown);
20678
+ refs3.button.removeEventListener("pointermove", onPointerMove2);
20679
+ refs3.button.removeEventListener("pointerup", onPointerUp);
20680
+ refs3.button.removeEventListener("pointercancel", onPointerUp);
20681
+ refs3.button.removeEventListener("keydown", onKeyDown);
20682
+ window.removeEventListener("resize", onResize);
20656
20683
  };
20657
20684
  }
20658
- function piscar() {
20685
+ function blink() {
20659
20686
  if (!refs2) return;
20660
- refs2.pulso.setAttribute("data-on", "true");
20661
- window.clearTimeout(timerPulso);
20662
- timerPulso = window.setTimeout(() => {
20663
- refs2?.pulso.setAttribute("data-on", "false");
20687
+ refs2.pulse.setAttribute("data-on", "true");
20688
+ window.clearTimeout(pulseTimer);
20689
+ pulseTimer = window.setTimeout(() => {
20690
+ refs2?.pulse.setAttribute("data-on", "false");
20664
20691
  }, 320);
20665
20692
  }
20666
- function atualizarContador() {
20693
+ function updateCounter() {
20667
20694
  if (!refs2) return;
20668
20695
  const total = instances.size;
20669
- const texto = total === 1 ? "1 component" : `${total} components`;
20670
- if (refs2.contador.textContent !== texto) refs2.contador.textContent = texto;
20696
+ const text = total === 1 ? "1 component" : `${total} components`;
20697
+ if (refs2.counter.textContent !== text) refs2.counter.textContent = text;
20671
20698
  }
20672
20699
  function mountDevtoolsWidget() {
20673
- if (montado || typeof document === "undefined" || !document.body) return;
20700
+ if (mounted || typeof document === "undefined" || !document.body) return;
20674
20701
  try {
20675
- if (sessionStorage.getItem(ESCONDIDO_KEY) === "1") return;
20702
+ if (sessionStorage.getItem(HIDDEN_KEY) === "1") return;
20676
20703
  } catch {
20677
20704
  }
20678
- montado = true;
20705
+ mounted = true;
20679
20706
  injectStyle("devtools-widget", WIDGET_CSS);
20680
- refs2 = construir();
20681
- const alternar = () => {
20682
- const ligado = xray();
20683
- refs2?.raiz.setAttribute("data-active", String(ligado));
20684
- refs2?.botao.setAttribute("aria-pressed", String(ligado));
20707
+ refs2 = build();
20708
+ const toggle = () => {
20709
+ const enabled2 = xray();
20710
+ refs2?.root.setAttribute("data-active", String(enabled2));
20711
+ refs2?.button.setAttribute("aria-pressed", String(enabled2));
20685
20712
  };
20686
- desligar.push(ligarArrasto(refs2, alternar));
20687
- const aoFechar = (evento) => {
20688
- evento.stopPropagation();
20713
+ teardown2.push(enableDrag(refs2, toggle));
20714
+ const onClose = (event) => {
20715
+ event.stopPropagation();
20689
20716
  try {
20690
- sessionStorage.setItem(ESCONDIDO_KEY, "1");
20717
+ sessionStorage.setItem(HIDDEN_KEY, "1");
20691
20718
  } catch {
20692
20719
  }
20693
20720
  unmountDevtoolsWidget();
20694
20721
  console.info("[Voodoo] devtools widget hidden. Use V.devtoolsWidget(true) to bring back.");
20695
20722
  };
20696
- refs2.fechar.addEventListener("click", aoFechar);
20697
- desligar.push(() => refs2?.fechar.removeEventListener("click", aoFechar));
20698
- const aoTeclarGlobal = () => {
20699
- const ligado = isXrayEnabled();
20700
- refs2?.raiz.setAttribute("data-active", String(ligado));
20701
- refs2?.botao.setAttribute("aria-pressed", String(ligado));
20723
+ refs2.close.addEventListener("click", onClose);
20724
+ teardown2.push(() => refs2?.close.removeEventListener("click", onClose));
20725
+ const onGlobalKeyUp = () => {
20726
+ const enabled2 = isXrayEnabled();
20727
+ refs2?.root.setAttribute("data-active", String(enabled2));
20728
+ refs2?.button.setAttribute("aria-pressed", String(enabled2));
20702
20729
  };
20703
- document.addEventListener("keyup", aoTeclarGlobal);
20704
- desligar.push(() => document.removeEventListener("keyup", aoTeclarGlobal));
20705
- for (const tipo of ["network", "event", "navigation", "update"]) {
20706
- desligar.push(devtoolsBus.on(tipo, piscar));
20730
+ document.addEventListener("keyup", onGlobalKeyUp);
20731
+ teardown2.push(() => document.removeEventListener("keyup", onGlobalKeyUp));
20732
+ for (const type of ["network", "event", "navigation", "update"]) {
20733
+ teardown2.push(devtoolsBus.on(type, blink));
20707
20734
  }
20708
- atualizarContador();
20709
- timerContador = window.setInterval(atualizarContador, 1e3);
20735
+ updateCounter();
20736
+ counterTimer = window.setInterval(updateCounter, 1e3);
20710
20737
  }
20711
20738
  function unmountDevtoolsWidget() {
20712
- if (!montado) return;
20713
- montado = false;
20714
- for (const fn of desligar.splice(0)) {
20739
+ if (!mounted) return;
20740
+ mounted = false;
20741
+ for (const fn of teardown2.splice(0)) {
20715
20742
  try {
20716
20743
  fn();
20717
20744
  } catch {
20718
20745
  }
20719
20746
  }
20720
- window.clearInterval(timerContador);
20721
- window.clearTimeout(timerPulso);
20722
- timerContador = 0;
20723
- timerPulso = 0;
20724
- refs2?.raiz.remove();
20747
+ window.clearInterval(counterTimer);
20748
+ window.clearTimeout(pulseTimer);
20749
+ counterTimer = 0;
20750
+ pulseTimer = 0;
20751
+ refs2?.root.remove();
20725
20752
  refs2 = null;
20726
20753
  }
20727
20754
  function isDevtoolsWidgetMounted() {
20728
- return montado;
20755
+ return mounted;
20729
20756
  }
20730
20757
  function devtoolsWidget(force) {
20731
- const alvo = force ?? !montado;
20732
- if (alvo) {
20758
+ const target2 = force ?? !mounted;
20759
+ if (target2) {
20733
20760
  try {
20734
- sessionStorage.removeItem(ESCONDIDO_KEY);
20761
+ sessionStorage.removeItem(HIDDEN_KEY);
20735
20762
  } catch {
20736
20763
  }
20737
20764
  mountDevtoolsWidget();
20738
20765
  } else {
20739
20766
  unmountDevtoolsWidget();
20740
20767
  }
20741
- return montado;
20768
+ return mounted;
20742
20769
  }
20743
20770
 
20744
20771
  // src/index.ts
@@ -22760,20 +22787,20 @@ function buildFrame2(gpu2, encoder, relogio) {
22760
22787
  };
22761
22788
  return frameObj;
22762
22789
  }
22763
- function frame(gpu2, build, relogio = EMPTY_CLOCK) {
22790
+ function frame(gpu2, build2, relogio = EMPTY_CLOCK) {
22764
22791
  if (!live(gpu2)) {
22765
- build(noFrame());
22792
+ build2(noFrame());
22766
22793
  return;
22767
22794
  }
22768
22795
  try {
22769
22796
  const encoder = gpu2.device.createCommandEncoder({ label: "voodoo-frame" });
22770
- build(buildFrame2(gpu2, encoder, relogio));
22797
+ build2(buildFrame2(gpu2, encoder, relogio));
22771
22798
  gpu2.queue.submit([encoder.finish()]);
22772
22799
  } catch (err) {
22773
22800
  handleError(err, "V.gpu.frame");
22774
22801
  }
22775
22802
  }
22776
- function frameLoop(gpu2, build) {
22803
+ function frameLoop(gpu2, build2) {
22777
22804
  if (!live(gpu2) || typeof requestAnimationFrame !== "function") return () => void 0;
22778
22805
  const relogio = clock();
22779
22806
  let handle = 0;
@@ -22782,7 +22809,7 @@ function frameLoop(gpu2, build) {
22782
22809
  handle = 0;
22783
22810
  if (!running || !live(gpu2)) return;
22784
22811
  relogio.tick(now2);
22785
- frame(gpu2, build, relogio);
22812
+ frame(gpu2, build2, relogio);
22786
22813
  if (running) handle = requestAnimationFrame(step2);
22787
22814
  };
22788
22815
  handle = requestAnimationFrame(step2);