voodoojs 0.5.0 → 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.
@@ -3387,7 +3387,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
3387
3387
  // src/store/index.ts
3388
3388
  init_reactivity();
3389
3389
  var stores = /* @__PURE__ */ new Map();
3390
- var versao = ref(0);
3390
+ var version = ref(0);
3391
3391
  var persistHandles = /* @__PURE__ */ new Map();
3392
3392
  function store(name, definition, options = {}) {
3393
3393
  const existing = stores.get(name);
@@ -3404,30 +3404,30 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
3404
3404
  return existing;
3405
3405
  }
3406
3406
  const key = typeof options.persist === "string" ? options.persist : `voodoo:store:${name}`;
3407
- const descritores = Object.getOwnPropertyDescriptors(definition);
3408
- const initial = Object.defineProperties({}, descritores);
3407
+ const descriptors = Object.getOwnPropertyDescriptors(definition);
3408
+ const initial = Object.defineProperties({}, descriptors);
3409
3409
  if (options.persist && typeof localStorage !== "undefined") {
3410
3410
  try {
3411
3411
  const saved = localStorage.getItem(key);
3412
3412
  if (saved) {
3413
- const salvo = JSON.parse(saved);
3414
- for (const [chave, valor] of Object.entries(salvo)) {
3415
- if (descritores[chave] && !("value" in descritores[chave])) continue;
3416
- initial[chave] = valor;
3413
+ const parsed = JSON.parse(saved);
3414
+ for (const [field, value] of Object.entries(parsed)) {
3415
+ if (descriptors[field] && !("value" in descriptors[field])) continue;
3416
+ initial[field] = value;
3417
3417
  }
3418
3418
  }
3419
3419
  } catch (e) {
3420
3420
  }
3421
3421
  }
3422
3422
  const created = reactive(initial);
3423
- for (const [prop, descritor] of Object.entries(descritores)) {
3424
- const value = descritor.value;
3423
+ for (const [prop, descriptor] of Object.entries(descriptors)) {
3424
+ const value = descriptor.value;
3425
3425
  if (typeof value === "function") {
3426
3426
  created[prop] = (...args) => value.apply(created, args);
3427
3427
  }
3428
3428
  }
3429
3429
  stores.set(name, created);
3430
- versao.value++;
3430
+ version.value++;
3431
3431
  if (options.persist && typeof localStorage !== "undefined") {
3432
3432
  const stop2 = watch(
3433
3433
  created,
@@ -3445,10 +3445,10 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
3445
3445
  }
3446
3446
  function stripFunctions(source) {
3447
3447
  const out = {};
3448
- const descritores = Object.getOwnPropertyDescriptors(toRaw(source));
3448
+ const descriptors = Object.getOwnPropertyDescriptors(toRaw(source));
3449
3449
  for (const [key, value] of Object.entries(source)) {
3450
3450
  if (typeof value === "function") continue;
3451
- if (descritores[key] && !("value" in descritores[key])) continue;
3451
+ if (descriptors[key] && !("value" in descriptors[key])) continue;
3452
3452
  out[key] = value;
3453
3453
  }
3454
3454
  return out;
@@ -3457,11 +3457,11 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
3457
3457
  {},
3458
3458
  {
3459
3459
  get: (_t, key) => {
3460
- void versao.value;
3460
+ void version.value;
3461
3461
  return stores.get(key);
3462
3462
  },
3463
3463
  has: (_t, key) => {
3464
- void versao.value;
3464
+ void version.value;
3465
3465
  return stores.has(key);
3466
3466
  },
3467
3467
  ownKeys: () => [...stores.keys()],
@@ -4736,11 +4736,12 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
4736
4736
  }
4737
4737
  };
4738
4738
  var THEME_KEY = "voodoo:theme";
4739
+ var picked = null;
4739
4740
  var theme = {
4740
4741
  /** Theme chosen by the user, or `system` when never set. */
4741
4742
  get current() {
4742
- var _a2;
4743
- return (_a2 = storage.get(THEME_KEY)) != null ? _a2 : "system";
4743
+ var _a2, _b;
4744
+ return (_b = (_a2 = storage.get(THEME_KEY)) != null ? _a2 : picked) != null ? _b : "system";
4744
4745
  },
4745
4746
  /** Theme effectively applied, resolving `system`. */
4746
4747
  get resolved() {
@@ -4750,6 +4751,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
4750
4751
  return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
4751
4752
  },
4752
4753
  set(value) {
4754
+ picked = value;
4753
4755
  storage.set(THEME_KEY, value);
4754
4756
  this.apply();
4755
4757
  },
@@ -4760,7 +4762,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
4760
4762
  },
4761
4763
  /** `true` once the visitor has actually picked a theme. */
4762
4764
  get chosen() {
4763
- return storage.get(THEME_KEY) != null;
4765
+ return picked !== null || storage.get(THEME_KEY) != null;
4764
4766
  },
4765
4767
  /** Writes `data-theme` on the root element and notifies the page. */
4766
4768
  apply() {
@@ -4784,7 +4786,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
4784
4786
  init() {
4785
4787
  if (typeof document === "undefined") return;
4786
4788
  this.apply();
4787
- matchMedia == null ? void 0 : matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
4789
+ if (typeof matchMedia === "undefined") return;
4790
+ matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
4788
4791
  if (this.current === "system") this.apply();
4789
4792
  });
4790
4793
  }
@@ -5234,8 +5237,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5234
5237
  defineDirective("text", ({ el, effect: effect2, evaluate: ev }) => {
5235
5238
  effect2(() => {
5236
5239
  el.textContent = stringify(ev());
5237
- const primeiro = el.firstChild;
5238
- if (primeiro && primeiro.nodeType === 3) markInitialized(primeiro);
5240
+ const first = el.firstChild;
5241
+ if (first && first.nodeType === 3) markInitialized(first);
5239
5242
  });
5240
5243
  });
5241
5244
  defineDirective("html", (ctx) => {
@@ -5441,10 +5444,10 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5441
5444
  next.push({ key, scope: childScope, nodes, data: childScope.data });
5442
5445
  });
5443
5446
  if (batch.fragment.firstChild) (_a3 = anchor.parentNode) == null ? void 0 : _a3.insertBefore(batch.fragment, anchor);
5444
- for (const [node, escopo] of batch.pending) walk(node, escopo);
5445
- const reaproveitados = new Set(next);
5447
+ for (const [node, rowScope] of batch.pending) walk(node, rowScope);
5448
+ const reused = new Set(next);
5446
5449
  for (const block2 of blocks) {
5447
- if (used.has(block2.key) && reaproveitados.has(block2)) continue;
5450
+ if (used.has(block2.key) && reused.has(block2)) continue;
5448
5451
  for (const node of block2.nodes) {
5449
5452
  destroy(node);
5450
5453
  node.remove();
@@ -5514,7 +5517,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5514
5517
  "novalidate",
5515
5518
  "inert"
5516
5519
  ]);
5517
- var ATRIBUTOS_DE_URL = /* @__PURE__ */ new Set([
5520
+ var URL_ATTRIBUTES = /* @__PURE__ */ new Set([
5518
5521
  "href",
5519
5522
  "src",
5520
5523
  "action",
@@ -5523,15 +5526,15 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5523
5526
  "ping",
5524
5527
  "poster"
5525
5528
  ]);
5526
- var RUIDO_DE_ESQUEMA = /[\s\x00-\x1f]/g;
5527
- function urlPerigosa(valor) {
5528
- const limpo = valor.replace(RUIDO_DE_ESQUEMA, "").toLowerCase();
5529
- return limpo.startsWith("javascript:") || limpo.startsWith("vbscript:") || limpo.startsWith("data:text/html") || limpo.startsWith("data:application/xhtml");
5529
+ var SCHEME_NOISE = /[\s\x00-\x1f]/g;
5530
+ function isDangerousUrl(value) {
5531
+ const clean = value.replace(SCHEME_NOISE, "").toLowerCase();
5532
+ return clean.startsWith("javascript:") || clean.startsWith("vbscript:") || clean.startsWith("data:text/html") || clean.startsWith("data:application/xhtml");
5530
5533
  }
5531
- function applyBinding(el, name, value, asProp = false, perigoLiberado = false) {
5534
+ function applyBinding(el, name, value, asProp = false, allowDangerous = false) {
5532
5535
  if (name === "class") return applyClass(el, value);
5533
5536
  if (name === "style") return applyStyle(el, value);
5534
- if (config.sanitizeUrls && !perigoLiberado && name === "srcdoc") {
5537
+ if (config.sanitizeUrls && !allowDangerous && name === "srcdoc") {
5535
5538
  warn2(
5536
5539
  `: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.`
5537
5540
  );
@@ -5539,7 +5542,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5539
5542
  return;
5540
5543
  }
5541
5544
  if (config.sanitizeUrls && !asProp) {
5542
- if (ATRIBUTOS_DE_URL.has(name) && typeof value === "string" && urlPerigosa(value)) {
5545
+ if (URL_ATTRIBUTES.has(name) && typeof value === "string" && isDangerousUrl(value)) {
5543
5546
  warn2(
5544
5547
  `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.`
5545
5548
  );
@@ -5636,9 +5639,9 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5636
5639
  }
5637
5640
  if (arg === "key") return;
5638
5641
  const asProp = !!modifiers.prop;
5639
- const perigoLiberado = !!modifiers.dangerous;
5642
+ const allowDangerous = !!modifiers.dangerous;
5640
5643
  effect2(() => {
5641
- applyBinding(el, arg, ev(), asProp, perigoLiberado);
5644
+ applyBinding(el, arg, ev(), asProp, allowDangerous);
5642
5645
  });
5643
5646
  void expression;
5644
5647
  },
@@ -6573,7 +6576,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
6573
6576
  (ctx) => {
6574
6577
  var _a3, _b2;
6575
6578
  let oldValue;
6576
- let mounted = false;
6579
+ let mounted2 = false;
6577
6580
  const makeBinding = (value) => {
6578
6581
  var _a4, _b3;
6579
6582
  return {
@@ -6593,8 +6596,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
6593
6596
  ctx.effect(() => {
6594
6597
  var _a4, _b3;
6595
6598
  const value = hooks.raw ? ctx.expression : ctx.evaluate();
6596
- if (!mounted) {
6597
- mounted = true;
6599
+ if (!mounted2) {
6600
+ mounted2 = true;
6598
6601
  oldValue = value;
6599
6602
  (_a4 = hooks.mounted) == null ? void 0 : _a4.call(hooks, ctx.el, makeBinding(value));
6600
6603
  return;
@@ -6618,11 +6621,11 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
6618
6621
  Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
6619
6622
  return rootScope.data;
6620
6623
  }
6621
- var version = "0.4.6";
6624
+ var version2 = "0.4.6";
6622
6625
  var core = {
6623
6626
  // Utilities first: Voodoo's own names can override.
6624
6627
  ...utils_exports,
6625
- version,
6628
+ version: version2,
6626
6629
  config,
6627
6630
  // Reactivity
6628
6631
  reactive,
@@ -9993,7 +9996,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
9993
9996
  if (addedTabIndex) el.setAttribute("tabindex", "0");
9994
9997
  let bubble = null;
9995
9998
  let timer = null;
9996
- const build = () => {
9999
+ const build2 = () => {
9997
10000
  const node = document.createElement("div");
9998
10001
  node.className = "v-tooltip";
9999
10002
  node.setAttribute("role", "tooltip");
@@ -10007,7 +10010,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
10007
10010
  };
10008
10011
  const open = () => {
10009
10012
  if (bubble) return;
10010
- bubble = build();
10013
+ bubble = build2();
10011
10014
  el.setAttribute("aria-describedby", bubble.id);
10012
10015
  reposition();
10013
10016
  requestAnimationFrame(() => bubble == null ? void 0 : bubble.classList.add("v-in"));
@@ -11217,37 +11220,37 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
11217
11220
  init_registry();
11218
11221
  init_style();
11219
11222
  var messages = {
11220
- required: "Preencha este campo.",
11221
- email: "Informe um e-mail valido.",
11222
- url: "Informe uma URL valida.",
11223
- number: "Informe um numero valido.",
11224
- integer: "Informe um numero inteiro.",
11225
- decimal: "Informe um numero decimal valido.",
11226
- alpha: "Use apenas letras.",
11227
- alphanumeric: "Use apenas letras e numeros.",
11228
- minlength: "Use no minimo {param} caracteres.",
11229
- maxlength: "Use no maximo {param} caracteres.",
11230
- min: "O valor minimo e {param}.",
11231
- max: "O valor maximo e {param}.",
11232
- between: "Informe um valor entre {min} e {max}.",
11233
- match: "Os campos nao conferem.",
11234
- regex: "O formato informado nao e valido.",
11235
- date: "Informe uma data valida.",
11236
- after: "A data precisa ser posterior a {param}.",
11237
- before: "A data precisa ser anterior a {param}.",
11238
- accepted: "E preciso marcar esta opcao para continuar.",
11239
- same: "Os valores precisam ser iguais.",
11240
- different: "Os valores precisam ser diferentes.",
11241
- in: "Escolha uma das opcoes permitidas.",
11242
- notin: "Este valor nao e permitido.",
11243
- phone: "Informe um telefone valido com DDD.",
11244
- cpf: "CPF invalido.",
11245
- cnpj: "CNPJ invalido.",
11246
- cep: "CEP invalido.",
11247
- creditcard: "Numero de cartao invalido.",
11248
- strongpassword: "Use {param} caracteres ou mais, com maiuscula, minuscula, numero e simbolo.",
11249
- unique: "Este valor ja esta em uso.",
11250
- invalid: "Valor invalido."
11223
+ required: "Please fill in this field.",
11224
+ email: "Enter a valid email address.",
11225
+ url: "Enter a valid URL.",
11226
+ number: "Enter a valid number.",
11227
+ integer: "Enter a whole number.",
11228
+ decimal: "Enter a valid decimal number.",
11229
+ alpha: "Use letters only.",
11230
+ alphanumeric: "Use letters and numbers only.",
11231
+ minlength: "Use at least {param} characters.",
11232
+ maxlength: "Use at most {param} characters.",
11233
+ min: "The smallest allowed value is {param}.",
11234
+ max: "The largest allowed value is {param}.",
11235
+ between: "Enter a value between {min} and {max}.",
11236
+ match: "The fields do not match.",
11237
+ regex: "That format is not valid.",
11238
+ date: "Enter a valid date.",
11239
+ after: "The date has to be later than {param}.",
11240
+ before: "The date has to be earlier than {param}.",
11241
+ accepted: "You have to tick this to continue.",
11242
+ same: "The values have to be the same.",
11243
+ different: "The values have to be different.",
11244
+ in: "Choose one of the allowed options.",
11245
+ notin: "That value is not allowed.",
11246
+ phone: "Enter a valid phone number, including the area code.",
11247
+ cpf: "Invalid CPF.",
11248
+ cnpj: "Invalid CNPJ.",
11249
+ cep: "Invalid postcode.",
11250
+ creditcard: "Invalid card number.",
11251
+ strongpassword: "Use {param} characters or more, with an upper case letter, a lower case letter, a number and a symbol.",
11252
+ unique: "That value is already taken.",
11253
+ invalid: "Invalid value."
11251
11254
  };
11252
11255
  function formatMessage(template, data2) {
11253
11256
  var _a2, _b, _c, _d, _e, _f;
@@ -14684,7 +14687,7 @@ form.v-loading [type="submit"],form.v-loading button[disabled]{opacity:.6}
14684
14687
  const labels2 = fromOptions ? options.labels.map((label) => String(label)) : [];
14685
14688
  const series = [];
14686
14689
  const raw = options.data;
14687
- const singleName = (_a2 = options.name) != null ? _a2 : "Valor";
14690
+ const singleName = (_a2 = options.name) != null ? _a2 : "Value";
14688
14691
  if (typeof raw === "number") {
14689
14692
  series.push({ name: singleName, values: [raw], xs: null, color: palette2[0] });
14690
14693
  } else if (Array.isArray(raw) && raw.length > 0) {
@@ -15417,7 +15420,7 @@ form.v-loading [type="submit"],form.v-loading button[disabled]{opacity:.6}
15417
15420
  const palette2 = options.colors && options.colors.length > 0 ? options.colors : CHART_COLORS;
15418
15421
  const format = (_b = options.format) != null ? _b : "number";
15419
15422
  const width = Math.max(160, Math.round(el.clientWidth || options.width || 640));
15420
- const height = Math.max(48, Math.round((_c = options.height) != null ? _c : defaultHeight(type)));
15423
+ const height = Math.max(48, Math.round((_c = options.height) != null ? _c : el.clientHeight || defaultHeight(type)));
15421
15424
  state2.lastWidth = width;
15422
15425
  state2.viewWidth = width;
15423
15426
  state2.viewHeight = height;
@@ -16280,7 +16283,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16280
16283
  @keyframes v-shimmer{0%{background-position:-180% 0}100%{background-position:180% 0}}
16281
16284
  @keyframes v-indeterminate{0%{transform:translateX(-100%)}100%{transform:translateX(340%)}}
16282
16285
 
16283
- /* ------------------------------------------------------------------ botao */
16286
+ /* ----------------------------------------------------------------- button */
16284
16287
  .v-btn{appearance:none;-webkit-appearance:none;position:relative;display:inline-flex;
16285
16288
  align-items:center;justify-content:center;gap:8px;vertical-align:middle;white-space:nowrap;
16286
16289
  font-family:var(--v-font-sans);font-weight:600;line-height:1;text-decoration:none;
@@ -16324,7 +16327,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16324
16327
  .v-btn-spin{width:1em;height:1em;border-radius:50%;border:2px solid currentColor;
16325
16328
  border-top-color:transparent;animation:v-spin .7s linear infinite;flex:none}
16326
16329
 
16327
- /* ------------------------------------------------------- botao de icone */
16330
+ /* ------------------------------------------------------------ icon button */
16328
16331
  .v-icon-btn{appearance:none;-webkit-appearance:none;display:inline-grid;place-items:center;
16329
16332
  border:1px solid transparent;border-radius:var(--v-radius-sm);cursor:pointer;
16330
16333
  font-family:var(--v-font-sans);
@@ -16369,7 +16372,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16369
16372
  .v-card-foot:empty{display:none}
16370
16373
  .v-card[data-padded="false"] .v-card-body{padding:0}
16371
16374
 
16372
- /* ------------------------------------------------------------ formulario */
16375
+ /* ------------------------------------------------------------------- form */
16373
16376
  .v-field{display:flex;flex-direction:column;gap:6px;font-family:var(--v-font-sans);min-width:0}
16374
16377
  .v-label{display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:600;
16375
16378
  line-height:1.3;color:var(--v-text)}
@@ -16448,7 +16451,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16448
16451
  .v-select-opt.is-selected .v-select-check{opacity:1}
16449
16452
  .v-select-empty{padding:14px 10px;text-align:center;font-size:13.5px;color:var(--v-text-muted)}
16450
16453
 
16451
- /* -------------------------------------------- caixa, radio e interruptor */
16454
+ /* --------------------------------------------- checkbox, radio and switch */
16452
16455
  .v-check{display:inline-flex;align-items:flex-start;gap:9px;cursor:pointer;
16453
16456
  font-family:var(--v-font-sans);font-size:14px;line-height:1.45;color:var(--v-text)}
16454
16457
  .v-check[data-disabled="true"]{cursor:not-allowed;opacity:.6}
@@ -16485,7 +16488,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16485
16488
  .v-check[data-size="sm"] .v-switch-thumb{width:16px;height:16px}
16486
16489
  .v-check[data-size="sm"] .v-check-native:checked+.v-switch-track .v-switch-thumb{transform:translateX(14px)}
16487
16490
 
16488
- /* --------------------------------------------------- selo, etiqueta, alerta */
16491
+ /* ------------------------------------------------------ badge, tag, alert */
16489
16492
  .v-badge{display:inline-flex;align-items:center;gap:5px;font-family:var(--v-font-sans);
16490
16493
  font-weight:600;line-height:1;border-radius:var(--v-radius-full);border:1px solid transparent;
16491
16494
  white-space:nowrap;vertical-align:middle}
@@ -16562,7 +16565,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16562
16565
  .v-avatar-status[data-status="busy"]{background:var(--v-danger)}
16563
16566
  .v-avatar-status[data-status="away"]{background:var(--v-warning)}
16564
16567
 
16565
- /* ------------------------------------------------- spinner e esqueleto */
16568
+ /* --------------------------------------------------- spinner and skeleton */
16566
16569
  .v-spinner{display:inline-block;border-radius:50%;border-style:solid;border-color:var(--v-border);
16567
16570
  border-top-color:var(--v-primary);animation:v-spin .7s linear infinite;vertical-align:middle}
16568
16571
  .v-spinner[data-tone="accent"]{border-top-color:var(--v-accent)}
@@ -16579,7 +16582,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16579
16582
  .v-skeleton[data-circle="true"]{border-radius:var(--v-radius-full)}
16580
16583
  .v-skeleton-stack{display:flex;flex-direction:column;gap:8px}
16581
16584
 
16582
- /* ------------------------------------------------------------- progresso */
16585
+ /* --------------------------------------------------------------- progress */
16583
16586
  .v-progress{font-family:var(--v-font-sans);display:flex;flex-direction:column;gap:6px}
16584
16587
  .v-progress-head{display:flex;justify-content:space-between;gap:12px;font-size:13px;color:var(--v-text-muted)}
16585
16588
  .v-progress-value{font-weight:650;color:var(--v-text)}
@@ -16596,7 +16599,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16596
16599
  .v-progress[data-tone="danger"] .v-progress-bar{background:var(--v-danger)}
16597
16600
  .v-progress[data-indeterminate="true"] .v-progress-bar{width:30% !important;animation:v-indeterminate 1.3s var(--v-ease) infinite}
16598
16601
 
16599
- /* ------------------------------------------------------------- divisor */
16602
+ /* ---------------------------------------------------------------- divider */
16600
16603
  .v-divider{display:flex;align-items:center;gap:12px;color:var(--v-text-soft);
16601
16604
  font-family:var(--v-font-sans);font-size:12.5px;font-weight:600;margin:16px 0}
16602
16605
  .v-divider::before,.v-divider::after{content:"";flex:1;height:1px;background:var(--v-border)}
@@ -16604,7 +16607,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16604
16607
  .v-divider[data-vertical="true"]{flex-direction:column;margin:0 16px;align-self:stretch;height:auto}
16605
16608
  .v-divider[data-vertical="true"]::before,.v-divider[data-vertical="true"]::after{width:1px;height:auto;flex:1}
16606
16609
 
16607
- /* -------------------------------------------------------------- tabela */
16610
+ /* ------------------------------------------------------------------ table */
16608
16611
  .v-table-wrap{width:100%;overflow-x:auto;background:var(--v-surface);border:1px solid var(--v-border);
16609
16612
  border-radius:var(--v-radius);font-family:var(--v-font-sans)}
16610
16613
  .v-table{width:100%;border-collapse:collapse;font-size:14px;color:var(--v-text)}
@@ -16625,7 +16628,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16625
16628
  .v-th[aria-sort="ascending"] .v-th-arrow,.v-th[aria-sort="descending"] .v-th-arrow{opacity:1;color:var(--v-primary)}
16626
16629
  .v-table-empty{text-align:center;color:var(--v-text-muted);padding:34px 14px;font-size:14px}
16627
16630
 
16628
- /* ---------------------------------------------------------- paginacao */
16631
+ /* ------------------------------------------------------------- pagination */
16629
16632
  .v-pagination{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-family:var(--v-font-sans)}
16630
16633
  .v-page{appearance:none;min-width:34px;height:34px;padding:0 9px;display:inline-grid;place-items:center;
16631
16634
  background:transparent;border:1px solid transparent;border-radius:var(--v-radius-sm);
@@ -16637,7 +16640,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16637
16640
  .v-page[aria-current="page"]{background:var(--v-primary);border-color:var(--v-primary);color:var(--v-primary-contrast)}
16638
16641
  .v-page-gap{min-width:24px;text-align:center;color:var(--v-text-soft);user-select:none}
16639
16642
 
16640
- /* ----------------------------------------------------------- migalhas */
16643
+ /* ------------------------------------------------------------- breadcrumb */
16641
16644
  .v-breadcrumb{font-family:var(--v-font-sans);font-size:13.5px}
16642
16645
  .v-breadcrumb-list{list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;padding:0}
16643
16646
  .v-breadcrumb-item{display:inline-flex;align-items:center;gap:6px;color:var(--v-text-muted)}
@@ -16647,7 +16650,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16647
16650
  .v-breadcrumb-item[aria-current="page"]{color:var(--v-text);font-weight:600}
16648
16651
  .v-breadcrumb-sep{color:var(--v-text-soft);user-select:none}
16649
16652
 
16650
- /* ------------------------------------------------------------ metrica */
16653
+ /* ------------------------------------------------------------------- stat */
16651
16654
  .v-stat{display:flex;gap:14px;align-items:flex-start;padding:16px 18px;background:var(--v-surface);
16652
16655
  border:1px solid var(--v-border);border-radius:var(--v-radius);font-family:var(--v-font-sans)}
16653
16656
  .v-stat-icon{flex:none;width:40px;height:40px;display:grid;place-items:center;font-size:19px;
@@ -16665,7 +16668,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16665
16668
  .v-stat-delta[data-dir="flat"]{background:var(--v-surface-3);color:var(--v-text-muted)}
16666
16669
  .v-stat-hint{font-size:12.5px;color:var(--v-text-muted)}
16667
16670
 
16668
- /* ------------------------------------------------------- estado vazio */
16671
+ /* ------------------------------------------------------------ empty state */
16669
16672
  .v-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;
16670
16673
  padding:44px 22px;font-family:var(--v-font-sans);color:var(--v-text)}
16671
16674
  .v-empty-icon{width:58px;height:58px;display:grid;place-items:center;font-size:27px;
@@ -16675,7 +16678,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16675
16678
  .v-empty-actions{margin-top:6px;display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
16676
16679
  .v-empty-actions:empty{display:none}
16677
16680
 
16678
- /* ----------------------------------------------------------- linha do tempo */
16681
+ /* --------------------------------------------------------------- timeline */
16679
16682
  .v-timeline{list-style:none;margin:0;padding:0;font-family:var(--v-font-sans);
16680
16683
  display:flex;flex-direction:column}
16681
16684
  .v-timeline-item{position:relative;display:flex;gap:14px;padding-bottom:20px}
@@ -16695,7 +16698,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16695
16698
  .v-timeline-desc{margin:3px 0 0;font-size:13.5px;line-height:1.55;color:var(--v-text-muted)}
16696
16699
  .v-timeline-time{display:block;margin-top:3px;font-size:12px;color:var(--v-text-soft)}
16697
16700
 
16698
- /* ---------------------------------------------------------------- passos */
16701
+ /* ------------------------------------------------------------------ steps */
16699
16702
  .v-steps{display:flex;gap:0;font-family:var(--v-font-sans);list-style:none;margin:0;padding:0}
16700
16703
  .v-steps[data-vertical="true"]{flex-direction:column;gap:4px}
16701
16704
  .v-step{flex:1;display:flex;align-items:flex-start;gap:10px;min-width:0;position:relative;padding-right:12px}
@@ -16714,7 +16717,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16714
16717
  .v-steps[data-vertical="true"] .v-step-line{left:13px;right:auto;top:30px;bottom:2px;width:2px;height:auto}
16715
16718
  .v-step:last-child .v-step-line{display:none}
16716
16719
 
16717
- /* ------------------------------------------------------------ avaliacao */
16720
+ /* ----------------------------------------------------------------- rating */
16718
16721
  .v-rating{display:inline-flex;align-items:center;gap:6px;font-family:var(--v-font-sans)}
16719
16722
  .v-rating-stars{display:inline-flex;gap:2px}
16720
16723
  .v-star{appearance:none;background:none;border:0;padding:2px;cursor:pointer;line-height:0;
@@ -16741,7 +16744,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16741
16744
  .v-tip[data-placement="right"]{left:calc(100% + 8px);top:50%;translate:0 -50%}
16742
16745
  .v-tipwrap:hover .v-tip,.v-tipwrap:focus-within .v-tip{opacity:1;transform:none}
16743
16746
 
16744
- /* ------------------------------------------------------------ codigo */
16747
+ /* ------------------------------------------------------------------- code */
16745
16748
  .v-code{position:relative;background:var(--v-surface-inset);border:1px solid var(--v-border);
16746
16749
  border-radius:var(--v-radius);overflow:hidden;font-family:var(--v-font-mono)}
16747
16750
  .v-code-head{display:flex;align-items:center;justify-content:space-between;gap:10px;
@@ -17754,7 +17757,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17754
17757
  props: {
17755
17758
  columns: { type: "any", default: "" },
17756
17759
  rows: { type: "any", default: "" },
17757
- empty: { type: "string", default: "Nenhum registro encontrado" },
17760
+ empty: { type: "string", default: "No records found" },
17758
17761
  sortable: { type: "any", default: true },
17759
17762
  dense: BOOL,
17760
17763
  striped: BOOL,
@@ -17866,9 +17869,9 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17866
17869
  total: { type: "number", default: 0 },
17867
17870
  perPage: { type: "number", default: 10 },
17868
17871
  siblings: { type: "number", default: 1 },
17869
- previousLabel: { type: "string", default: "Anterior" },
17870
- nextLabel: { type: "string", default: "Pr\xF3xima" },
17871
- ariaLabel: { type: "string", default: "Pagina\xE7\xE3o" }
17872
+ previousLabel: { type: "string", default: "Previous" },
17873
+ nextLabel: { type: "string", default: "Next" },
17874
+ ariaLabel: { type: "string", default: "Pagination" }
17872
17875
  },
17873
17876
  computed: {
17874
17877
  lastPage() {
@@ -17882,7 +17885,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17882
17885
  const value = Number(this.page) || 1;
17883
17886
  return Math.min(Math.max(1, Math.round(value)), this.lastPage);
17884
17887
  },
17885
- /** Numeros visiveis, com `0` marcando as reticencias. */
17888
+ /** Visible page numbers, with `0` marking the ellipsis. */
17886
17889
  items() {
17887
17890
  const last = this.lastPage;
17888
17891
  const current2 = this.currentPage;
@@ -17927,7 +17930,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17927
17930
  <template v-for="(item, index) in items" :key="index">
17928
17931
  <span class="v-page-gap" v-if="item === 0" aria-hidden="true">...</span>
17929
17932
  <button type="button" class="v-page" v-if="item !== 0" :aria-current="isCurrent(item)"
17930
- :aria-label="'P\xE1gina ' + item" v-click="go(item)" v-text="item"></button>
17933
+ :aria-label="'Page ' + item" v-click="go(item)" v-text="item"></button>
17931
17934
  </template>
17932
17935
  <button type="button" class="v-page" :disabled="currentPage >= lastPage"
17933
17936
  :aria-label="nextLabel" v-click="go(currentPage + 1)" v-html="svgIcon('chevron-right')"></button>
@@ -17960,7 +17963,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17960
17963
  props: {
17961
17964
  items: { type: "any", default: "" },
17962
17965
  separator: { type: "string", default: "/" },
17963
- ariaLabel: { type: "string", default: "Trilha de navega\xE7\xE3o" }
17966
+ ariaLabel: { type: "string", default: "Breadcrumb" }
17964
17967
  },
17965
17968
  computed: {
17966
17969
  crumbs() {
@@ -17994,7 +17997,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17994
17997
  hint: TEXT,
17995
17998
  icon: TEXT,
17996
17999
  suffix: { type: "string", default: "%" },
17997
- /** Quando `true`, uma variacao negativa e considerada positiva. */
18000
+ /** When `true`, a negative change counts as positive. */
17998
18001
  inverted: BOOL
17999
18002
  },
18000
18003
  computed: {
@@ -18047,7 +18050,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18047
18050
  register("v-empty-state", {
18048
18051
  props: {
18049
18052
  icon: { type: "string", default: "inbox" },
18050
- title: { type: "string", default: "Nada por aqui" },
18053
+ title: { type: "string", default: "Nothing here yet" },
18051
18054
  description: TEXT
18052
18055
  },
18053
18056
  template: `
@@ -18121,7 +18124,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18121
18124
  steps: { type: "any", default: "" },
18122
18125
  current: { type: "number", default: 0 },
18123
18126
  vertical: BOOL,
18124
- ariaLabel: { type: "string", default: "Etapas" }
18127
+ ariaLabel: { type: "string", default: "Steps" }
18125
18128
  },
18126
18129
  computed: {
18127
18130
  ...flags("vertical"),
@@ -18169,7 +18172,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18169
18172
  value: { type: "number", default: 0 },
18170
18173
  max: { type: "number", default: 5 },
18171
18174
  size: { type: "string", default: "md" },
18172
- label: { type: "string", default: "Avalia\xE7\xE3o" },
18175
+ label: { type: "string", default: "Rating" },
18173
18176
  readonly: BOOL,
18174
18177
  disabled: BOOL,
18175
18178
  showValue: BOOL,
@@ -18195,7 +18198,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18195
18198
  return this.hovered > 0 ? this.hovered : this.score;
18196
18199
  },
18197
18200
  valueText() {
18198
- return `${this.score} de ${this.total}`;
18201
+ return `${this.score} of ${this.total}`;
18199
18202
  }
18200
18203
  },
18201
18204
  methods: {
@@ -18251,7 +18254,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18251
18254
  :tabindex="locked ? -1 : 0" :aria-readonly="locked" v-keydown="onKey" v-mouseleave="reset">
18252
18255
  <span class="v-rating-stars">
18253
18256
  <button type="button" class="v-star" v-for="index in total" :key="index"
18254
- :data-on="isOn(index)" :disabled="locked" :aria-label="index + ' de ' + total"
18257
+ :data-on="isOn(index)" :disabled="locked" :aria-label="index + ' of ' + total"
18255
18258
  :tabindex="-1" v-click="pick(index)" v-mouseenter="preview(index)"
18256
18259
  v-html="svgIcon('star')"></button>
18257
18260
  </span>
@@ -18319,8 +18322,8 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18319
18322
  code: TEXT,
18320
18323
  language: TEXT,
18321
18324
  filename: TEXT,
18322
- copyLabel: { type: "string", default: "Copiar" },
18323
- copiedLabel: { type: "string", default: "Copiado" },
18325
+ copyLabel: { type: "string", default: "Copy" },
18326
+ copiedLabel: { type: "string", default: "Copied" },
18324
18327
  wrap: BOOL
18325
18328
  },
18326
18329
  state() {
@@ -18664,7 +18667,7 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
18664
18667
  source.remove();
18665
18668
  }
18666
18669
  sourceAnchors.delete(source);
18667
- if (source.hasAttribute(`${config.prefix}modal-content`) || source.hasAttribute("data-v-modal-content")) {
18670
+ if (hasDirective(source, "modal-content")) {
18668
18671
  source.setAttribute("hidden", "");
18669
18672
  }
18670
18673
  }
@@ -20700,14 +20703,14 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
20700
20703
 
20701
20704
  // src/devtools/launcher.ts
20702
20705
  init_style();
20703
- var POSICAO_KEY = "voodoo:devtools:widget-position";
20704
- var ESCONDIDO_KEY = "voodoo:devtools:widget-hidden";
20705
- var LIMIAR_ARRASTO = 4;
20706
+ var POSITION_KEY = "voodoo:devtools:widget-position";
20707
+ var HIDDEN_KEY = "voodoo:devtools:widget-hidden";
20708
+ var DRAG_THRESHOLD = 4;
20706
20709
  var refs2 = null;
20707
- var montado = false;
20708
- var timerContador = 0;
20709
- var timerPulso = 0;
20710
- var desligar = [];
20710
+ var mounted = false;
20711
+ var counterTimer = 0;
20712
+ var pulseTimer = 0;
20713
+ var teardown2 = [];
20711
20714
  var WIDGET_CSS = `
20712
20715
  .v-devtools-widget{
20713
20716
  all: initial;
@@ -20840,219 +20843,219 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
20840
20843
  .v-devtools-btn:hover{transform:none}
20841
20844
  }
20842
20845
  `;
20843
- var MARCA = `<svg class="v-devtools-mark" viewBox="0 0 24 24" fill="none" aria-hidden="true">
20846
+ var MARK = `<svg class="v-devtools-mark" viewBox="0 0 24 24" fill="none" aria-hidden="true">
20844
20847
  <path d="M4 4l8 16 8-16" stroke="#6D3BF5" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>
20845
20848
  <circle cx="12" cy="7.5" r="2" fill="#FF3D8B"/>
20846
20849
  </svg>`;
20847
- function lerPosicao() {
20850
+ function readPosition() {
20848
20851
  try {
20849
- const bruto = localStorage.getItem(POSICAO_KEY);
20850
- if (!bruto) return null;
20851
- const valor = JSON.parse(bruto);
20852
- if (typeof (valor == null ? void 0 : valor.x) !== "number" || typeof (valor == null ? void 0 : valor.y) !== "number") return null;
20853
- return valor;
20852
+ const raw = localStorage.getItem(POSITION_KEY);
20853
+ if (!raw) return null;
20854
+ const value = JSON.parse(raw);
20855
+ if (typeof (value == null ? void 0 : value.x) !== "number" || typeof (value == null ? void 0 : value.y) !== "number") return null;
20856
+ return value;
20854
20857
  } catch (e) {
20855
20858
  return null;
20856
20859
  }
20857
20860
  }
20858
- function gravarPosicao(pos) {
20861
+ function writePosition(pos) {
20859
20862
  try {
20860
- localStorage.setItem(POSICAO_KEY, JSON.stringify(pos));
20863
+ localStorage.setItem(POSITION_KEY, JSON.stringify(pos));
20861
20864
  } catch (e) {
20862
20865
  }
20863
20866
  }
20864
- function aplicarPosicao(raiz, pos) {
20865
- const largura = raiz.offsetWidth || 120;
20866
- const altura = raiz.offsetHeight || 38;
20867
- const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth - largura - 8));
20868
- const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight - altura - 8));
20869
- raiz.style.left = `${x}px`;
20870
- raiz.style.top = `${y}px`;
20871
- raiz.style.right = "auto";
20872
- raiz.style.bottom = "auto";
20873
- }
20874
- function construir() {
20875
- const raiz = document.createElement("div");
20876
- raiz.className = "v-devtools-widget";
20877
- raiz.setAttribute("data-voodoo-devtools", "widget");
20878
- const botao = document.createElement("button");
20879
- botao.type = "button";
20880
- botao.className = "v-devtools-btn";
20881
- botao.setAttribute("aria-label", "Open Voodoo devtools (Ctrl+Shift+X)");
20882
- botao.setAttribute("aria-pressed", "false");
20883
- botao.title = "Voodoo devtools \u2014 click to inspect, drag to move (Ctrl+Shift+X)";
20884
- botao.innerHTML = MARCA;
20885
- const rotulo = document.createElement("span");
20886
- rotulo.className = "v-devtools-label";
20887
- rotulo.textContent = "Voodoo";
20888
- const contador = document.createElement("span");
20889
- contador.className = "v-devtools-count";
20890
- contador.textContent = "0";
20891
- const pulso = document.createElement("span");
20892
- pulso.className = "v-devtools-pulse";
20893
- pulso.setAttribute("data-on", "false");
20894
- botao.append(rotulo, contador, pulso);
20895
- const fechar = document.createElement("button");
20896
- fechar.type = "button";
20897
- fechar.className = "v-devtools-close";
20898
- fechar.setAttribute("aria-label", "Hide the devtools widget in this tab");
20899
- fechar.title = "Hide in this tab";
20900
- fechar.textContent = "\xD7";
20901
- raiz.append(botao, fechar);
20902
- document.body.appendChild(raiz);
20903
- const salva = lerPosicao();
20904
- if (salva) {
20905
- aplicarPosicao(raiz, salva);
20867
+ function applyPosition(root, pos) {
20868
+ const width = root.offsetWidth || 120;
20869
+ const height = root.offsetHeight || 38;
20870
+ const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth - width - 8));
20871
+ const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight - height - 8));
20872
+ root.style.left = `${x}px`;
20873
+ root.style.top = `${y}px`;
20874
+ root.style.right = "auto";
20875
+ root.style.bottom = "auto";
20876
+ }
20877
+ function build() {
20878
+ const root = document.createElement("div");
20879
+ root.className = "v-devtools-widget";
20880
+ root.setAttribute("data-voodoo-devtools", "widget");
20881
+ const button = document.createElement("button");
20882
+ button.type = "button";
20883
+ button.className = "v-devtools-btn";
20884
+ button.setAttribute("aria-label", "Open Voodoo devtools (Ctrl+Shift+X)");
20885
+ button.setAttribute("aria-pressed", "false");
20886
+ button.title = "Voodoo devtools \u2014 click to inspect, drag to move (Ctrl+Shift+X)";
20887
+ button.innerHTML = MARK;
20888
+ const label = document.createElement("span");
20889
+ label.className = "v-devtools-label";
20890
+ label.textContent = "Voodoo";
20891
+ const counter2 = document.createElement("span");
20892
+ counter2.className = "v-devtools-count";
20893
+ counter2.textContent = "0";
20894
+ const pulse = document.createElement("span");
20895
+ pulse.className = "v-devtools-pulse";
20896
+ pulse.setAttribute("data-on", "false");
20897
+ button.append(label, counter2, pulse);
20898
+ const close = document.createElement("button");
20899
+ close.type = "button";
20900
+ close.className = "v-devtools-close";
20901
+ close.setAttribute("aria-label", "Hide the devtools widget in this tab");
20902
+ close.title = "Hide in this tab";
20903
+ close.textContent = "\xD7";
20904
+ root.append(button, close);
20905
+ document.body.appendChild(root);
20906
+ const saved = readPosition();
20907
+ if (saved) {
20908
+ applyPosition(root, saved);
20906
20909
  } else {
20907
- raiz.style.right = "16px";
20908
- raiz.style.bottom = "16px";
20909
- }
20910
- return { raiz, botao, pulso, contador, fechar };
20911
- }
20912
- function ligarArrasto(refs3, aoClicar) {
20913
- let arrastando = false;
20914
- let moveu = false;
20915
- let deslocX = 0;
20916
- let deslocY = 0;
20917
- let inicioX = 0;
20918
- let inicioY = 0;
20919
- const aoDescer = (evento) => {
20910
+ root.style.right = "16px";
20911
+ root.style.bottom = "16px";
20912
+ }
20913
+ return { root, button, pulse, counter: counter2, close };
20914
+ }
20915
+ function enableDrag(refs3, onClick) {
20916
+ let dragging = false;
20917
+ let moved = false;
20918
+ let offsetX = 0;
20919
+ let offsetY = 0;
20920
+ let startX = 0;
20921
+ let startY = 0;
20922
+ const onPointerDown = (event) => {
20920
20923
  var _a2, _b;
20921
- if (evento.button !== 0) return;
20922
- const caixa = refs3.raiz.getBoundingClientRect();
20923
- arrastando = true;
20924
- moveu = false;
20925
- inicioX = evento.clientX;
20926
- inicioY = evento.clientY;
20927
- deslocX = evento.clientX - caixa.left;
20928
- deslocY = evento.clientY - caixa.top;
20929
- (_b = (_a2 = refs3.botao).setPointerCapture) == null ? void 0 : _b.call(_a2, evento.pointerId);
20924
+ if (event.button !== 0) return;
20925
+ const box = refs3.root.getBoundingClientRect();
20926
+ dragging = true;
20927
+ moved = false;
20928
+ startX = event.clientX;
20929
+ startY = event.clientY;
20930
+ offsetX = event.clientX - box.left;
20931
+ offsetY = event.clientY - box.top;
20932
+ (_b = (_a2 = refs3.button).setPointerCapture) == null ? void 0 : _b.call(_a2, event.pointerId);
20930
20933
  };
20931
- const aoMover = (evento) => {
20932
- if (!arrastando) return;
20933
- const distancia = Math.hypot(evento.clientX - inicioX, evento.clientY - inicioY);
20934
- if (!moveu && distancia < LIMIAR_ARRASTO) return;
20935
- moveu = true;
20936
- evento.preventDefault();
20937
- aplicarPosicao(refs3.raiz, { x: evento.clientX - deslocX, y: evento.clientY - deslocY });
20934
+ const onPointerMove2 = (event) => {
20935
+ if (!dragging) return;
20936
+ const distance = Math.hypot(event.clientX - startX, event.clientY - startY);
20937
+ if (!moved && distance < DRAG_THRESHOLD) return;
20938
+ moved = true;
20939
+ event.preventDefault();
20940
+ applyPosition(refs3.root, { x: event.clientX - offsetX, y: event.clientY - offsetY });
20938
20941
  };
20939
- const aoSubir = (evento) => {
20942
+ const onPointerUp = (event) => {
20940
20943
  var _a2, _b;
20941
- if (!arrastando) return;
20942
- arrastando = false;
20943
- (_b = (_a2 = refs3.botao).releasePointerCapture) == null ? void 0 : _b.call(_a2, evento.pointerId);
20944
- if (!moveu) {
20945
- aoClicar();
20944
+ if (!dragging) return;
20945
+ dragging = false;
20946
+ (_b = (_a2 = refs3.button).releasePointerCapture) == null ? void 0 : _b.call(_a2, event.pointerId);
20947
+ if (!moved) {
20948
+ onClick();
20946
20949
  return;
20947
20950
  }
20948
- const caixa = refs3.raiz.getBoundingClientRect();
20949
- gravarPosicao({ x: caixa.left, y: caixa.top });
20951
+ const box = refs3.root.getBoundingClientRect();
20952
+ writePosition({ x: box.left, y: box.top });
20950
20953
  };
20951
- const aoTeclar = (evento) => {
20952
- if (evento.key !== "Enter" && evento.key !== " ") return;
20953
- evento.preventDefault();
20954
- aoClicar();
20954
+ const onKeyDown = (event) => {
20955
+ if (event.key !== "Enter" && event.key !== " ") return;
20956
+ event.preventDefault();
20957
+ onClick();
20955
20958
  };
20956
- const aoRedimensionar = () => {
20957
- const caixa = refs3.raiz.getBoundingClientRect();
20958
- if (refs3.raiz.style.left) aplicarPosicao(refs3.raiz, { x: caixa.left, y: caixa.top });
20959
+ const onResize = () => {
20960
+ const box = refs3.root.getBoundingClientRect();
20961
+ if (refs3.root.style.left) applyPosition(refs3.root, { x: box.left, y: box.top });
20959
20962
  };
20960
- refs3.botao.addEventListener("pointerdown", aoDescer);
20961
- refs3.botao.addEventListener("pointermove", aoMover);
20962
- refs3.botao.addEventListener("pointerup", aoSubir);
20963
- refs3.botao.addEventListener("pointercancel", aoSubir);
20964
- refs3.botao.addEventListener("keydown", aoTeclar);
20965
- window.addEventListener("resize", aoRedimensionar);
20963
+ refs3.button.addEventListener("pointerdown", onPointerDown);
20964
+ refs3.button.addEventListener("pointermove", onPointerMove2);
20965
+ refs3.button.addEventListener("pointerup", onPointerUp);
20966
+ refs3.button.addEventListener("pointercancel", onPointerUp);
20967
+ refs3.button.addEventListener("keydown", onKeyDown);
20968
+ window.addEventListener("resize", onResize);
20966
20969
  return () => {
20967
- refs3.botao.removeEventListener("pointerdown", aoDescer);
20968
- refs3.botao.removeEventListener("pointermove", aoMover);
20969
- refs3.botao.removeEventListener("pointerup", aoSubir);
20970
- refs3.botao.removeEventListener("pointercancel", aoSubir);
20971
- refs3.botao.removeEventListener("keydown", aoTeclar);
20972
- window.removeEventListener("resize", aoRedimensionar);
20970
+ refs3.button.removeEventListener("pointerdown", onPointerDown);
20971
+ refs3.button.removeEventListener("pointermove", onPointerMove2);
20972
+ refs3.button.removeEventListener("pointerup", onPointerUp);
20973
+ refs3.button.removeEventListener("pointercancel", onPointerUp);
20974
+ refs3.button.removeEventListener("keydown", onKeyDown);
20975
+ window.removeEventListener("resize", onResize);
20973
20976
  };
20974
20977
  }
20975
- function piscar() {
20978
+ function blink() {
20976
20979
  if (!refs2) return;
20977
- refs2.pulso.setAttribute("data-on", "true");
20978
- window.clearTimeout(timerPulso);
20979
- timerPulso = window.setTimeout(() => {
20980
- refs2 == null ? void 0 : refs2.pulso.setAttribute("data-on", "false");
20980
+ refs2.pulse.setAttribute("data-on", "true");
20981
+ window.clearTimeout(pulseTimer);
20982
+ pulseTimer = window.setTimeout(() => {
20983
+ refs2 == null ? void 0 : refs2.pulse.setAttribute("data-on", "false");
20981
20984
  }, 320);
20982
20985
  }
20983
- function atualizarContador() {
20986
+ function updateCounter() {
20984
20987
  if (!refs2) return;
20985
20988
  const total = instances.size;
20986
- const texto = total === 1 ? "1 component" : `${total} components`;
20987
- if (refs2.contador.textContent !== texto) refs2.contador.textContent = texto;
20989
+ const text = total === 1 ? "1 component" : `${total} components`;
20990
+ if (refs2.counter.textContent !== text) refs2.counter.textContent = text;
20988
20991
  }
20989
20992
  function mountDevtoolsWidget() {
20990
- if (montado || typeof document === "undefined" || !document.body) return;
20993
+ if (mounted || typeof document === "undefined" || !document.body) return;
20991
20994
  try {
20992
- if (sessionStorage.getItem(ESCONDIDO_KEY) === "1") return;
20995
+ if (sessionStorage.getItem(HIDDEN_KEY) === "1") return;
20993
20996
  } catch (e) {
20994
20997
  }
20995
- montado = true;
20998
+ mounted = true;
20996
20999
  injectStyle("devtools-widget", WIDGET_CSS);
20997
- refs2 = construir();
20998
- const alternar = () => {
20999
- const ligado = xray();
21000
- refs2 == null ? void 0 : refs2.raiz.setAttribute("data-active", String(ligado));
21001
- refs2 == null ? void 0 : refs2.botao.setAttribute("aria-pressed", String(ligado));
21000
+ refs2 = build();
21001
+ const toggle = () => {
21002
+ const enabled2 = xray();
21003
+ refs2 == null ? void 0 : refs2.root.setAttribute("data-active", String(enabled2));
21004
+ refs2 == null ? void 0 : refs2.button.setAttribute("aria-pressed", String(enabled2));
21002
21005
  };
21003
- desligar.push(ligarArrasto(refs2, alternar));
21004
- const aoFechar = (evento) => {
21005
- evento.stopPropagation();
21006
+ teardown2.push(enableDrag(refs2, toggle));
21007
+ const onClose = (event) => {
21008
+ event.stopPropagation();
21006
21009
  try {
21007
- sessionStorage.setItem(ESCONDIDO_KEY, "1");
21010
+ sessionStorage.setItem(HIDDEN_KEY, "1");
21008
21011
  } catch (e) {
21009
21012
  }
21010
21013
  unmountDevtoolsWidget();
21011
21014
  console.info("[Voodoo] devtools widget hidden. Use V.devtoolsWidget(true) to bring back.");
21012
21015
  };
21013
- refs2.fechar.addEventListener("click", aoFechar);
21014
- desligar.push(() => refs2 == null ? void 0 : refs2.fechar.removeEventListener("click", aoFechar));
21015
- const aoTeclarGlobal = () => {
21016
- const ligado = isXrayEnabled();
21017
- refs2 == null ? void 0 : refs2.raiz.setAttribute("data-active", String(ligado));
21018
- refs2 == null ? void 0 : refs2.botao.setAttribute("aria-pressed", String(ligado));
21016
+ refs2.close.addEventListener("click", onClose);
21017
+ teardown2.push(() => refs2 == null ? void 0 : refs2.close.removeEventListener("click", onClose));
21018
+ const onGlobalKeyUp = () => {
21019
+ const enabled2 = isXrayEnabled();
21020
+ refs2 == null ? void 0 : refs2.root.setAttribute("data-active", String(enabled2));
21021
+ refs2 == null ? void 0 : refs2.button.setAttribute("aria-pressed", String(enabled2));
21019
21022
  };
21020
- document.addEventListener("keyup", aoTeclarGlobal);
21021
- desligar.push(() => document.removeEventListener("keyup", aoTeclarGlobal));
21022
- for (const tipo of ["network", "event", "navigation", "update"]) {
21023
- desligar.push(devtoolsBus.on(tipo, piscar));
21023
+ document.addEventListener("keyup", onGlobalKeyUp);
21024
+ teardown2.push(() => document.removeEventListener("keyup", onGlobalKeyUp));
21025
+ for (const type of ["network", "event", "navigation", "update"]) {
21026
+ teardown2.push(devtoolsBus.on(type, blink));
21024
21027
  }
21025
- atualizarContador();
21026
- timerContador = window.setInterval(atualizarContador, 1e3);
21028
+ updateCounter();
21029
+ counterTimer = window.setInterval(updateCounter, 1e3);
21027
21030
  }
21028
21031
  function unmountDevtoolsWidget() {
21029
- if (!montado) return;
21030
- montado = false;
21031
- for (const fn of desligar.splice(0)) {
21032
+ if (!mounted) return;
21033
+ mounted = false;
21034
+ for (const fn of teardown2.splice(0)) {
21032
21035
  try {
21033
21036
  fn();
21034
21037
  } catch (e) {
21035
21038
  }
21036
21039
  }
21037
- window.clearInterval(timerContador);
21038
- window.clearTimeout(timerPulso);
21039
- timerContador = 0;
21040
- timerPulso = 0;
21041
- refs2 == null ? void 0 : refs2.raiz.remove();
21040
+ window.clearInterval(counterTimer);
21041
+ window.clearTimeout(pulseTimer);
21042
+ counterTimer = 0;
21043
+ pulseTimer = 0;
21044
+ refs2 == null ? void 0 : refs2.root.remove();
21042
21045
  refs2 = null;
21043
21046
  }
21044
21047
  function devtoolsWidget(force) {
21045
- const alvo = force != null ? force : !montado;
21046
- if (alvo) {
21048
+ const target = force != null ? force : !mounted;
21049
+ if (target) {
21047
21050
  try {
21048
- sessionStorage.removeItem(ESCONDIDO_KEY);
21051
+ sessionStorage.removeItem(HIDDEN_KEY);
21049
21052
  } catch (e) {
21050
21053
  }
21051
21054
  mountDevtoolsWidget();
21052
21055
  } else {
21053
21056
  unmountDevtoolsWidget();
21054
21057
  }
21055
- return montado;
21058
+ return mounted;
21056
21059
  }
21057
21060
 
21058
21061
  // src/index.ts