@fayz-ai/core 0.8.2 → 0.8.4
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/{chunk-XJKW2JRW.js → chunk-GULZD7XW.js} +7 -14
- package/dist/chunk-GULZD7XW.js.map +1 -0
- package/dist/{chunk-SO3VUKGZ.cjs → chunk-HN66DF4E.cjs} +123 -4
- package/dist/chunk-HN66DF4E.cjs.map +1 -0
- package/dist/{chunk-CYAWDW44.cjs → chunk-KL2XT2TV.cjs} +6 -16
- package/dist/chunk-KL2XT2TV.cjs.map +1 -0
- package/dist/{chunk-JHGXROKV.js → chunk-MJ4ML56F.js} +123 -4
- package/dist/chunk-MJ4ML56F.js.map +1 -0
- package/dist/data/archetype.d.ts.map +1 -1
- package/dist/data/index.cjs +9 -21
- package/dist/data/index.d.ts +0 -1
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/index.js +1 -1
- package/dist/data/refresh.d.ts +36 -0
- package/dist/data/refresh.d.ts.map +1 -0
- package/dist/data/supabase.d.ts.map +1 -1
- package/dist/data/types.d.ts +6 -0
- package/dist/data/types.d.ts.map +1 -1
- package/dist/i18n/index.cjs +10 -10
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/shell-translations.d.ts.map +1 -1
- package/dist/index.cjs +694 -97
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +652 -59
- package/dist/index.js.map +1 -1
- package/dist/search/engine.d.ts +12 -0
- package/dist/search/engine.d.ts.map +1 -0
- package/dist/search/index.d.ts +5 -0
- package/dist/search/index.d.ts.map +1 -0
- package/dist/search/text.d.ts +37 -0
- package/dist/search/text.d.ts.map +1 -0
- package/dist/search/types.d.ts +72 -0
- package/dist/search/types.d.ts.map +1 -0
- package/dist/types/org.d.ts +28 -0
- package/dist/types/org.d.ts.map +1 -1
- package/dist/types/plugins.d.ts +12 -0
- package/dist/types/plugins.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/data/archetype.ts +4 -2
- package/src/data/index.ts +0 -1
- package/src/data/refresh.ts +105 -0
- package/src/data/supabase.ts +3 -1
- package/src/data/types.ts +6 -0
- package/src/i18n/index.ts +2 -0
- package/src/i18n/shell-translations.ts +119 -2
- package/src/index.ts +19 -2
- package/src/search/engine.ts +551 -0
- package/src/search/index.ts +25 -0
- package/src/search/text.ts +206 -0
- package/src/search/types.ts +75 -0
- package/src/types/org.ts +29 -0
- package/src/types/plugins.ts +12 -0
- package/dist/chunk-CYAWDW44.cjs.map +0 -1
- package/dist/chunk-JHGXROKV.js.map +0 -1
- package/dist/chunk-SO3VUKGZ.cjs.map +0 -1
- package/dist/chunk-XJKW2JRW.js.map +0 -1
- package/dist/data/cloud.d.ts +0 -5
- package/dist/data/cloud.d.ts.map +0 -1
- package/src/data/cloud.ts +0 -28
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export { withAfterHooks } from './chunk-BBDNC3FP.js';
|
|
2
2
|
export { PluginContractError, assertConnectorContract, assertPluginManifestContract } from './chunk-X5THHG6T.js';
|
|
3
|
-
import { getSupabaseClientOptional } from './chunk-
|
|
4
|
-
export {
|
|
3
|
+
import { globalCache, getActiveTenantId, getSupabaseClientOptional, resolveDataProvider } from './chunk-GULZD7XW.js';
|
|
4
|
+
export { clearGlobalCache, countByTenant, createArchetypeProvider, createCacheStore, createFayzApiProvider, createMockProvider, createSupabaseProvider, getActiveTenantId, getSupabaseClientOptional, globalCache, invalidateCount, resolveDataProvider, setActiveTenantId, setGlobalSupabaseClient, stableKey, withCache } from './chunk-GULZD7XW.js';
|
|
5
5
|
export { clearEntityRegistry, deriveEntityKey, getAllEntities, getEntityByKey, registerEntity } from './chunk-CU64QI4A.js';
|
|
6
6
|
import { getBlock, getScaffold } from './chunk-YH25Y4FW.js';
|
|
7
7
|
export { PLUGIN_API_VERSION, PluginRuntimeProvider, Registry, blockRegistry, componentRegistry, definePlugin, getBlock, getComponent, getDashboardWidgets, getMetric, getPage, getPlugin, getPluginFactory, getScaffold, getWidgetsForZone, isCustomId, listBlocks, listMetrics, listPluginFactories, listPlugins, metricRegistry, pageRegistry, pluginFactoryRegistry, pluginRegistry, registerBlock, registerComponent, registerMetric, registerPage, registerPlugin, registerPluginFactory, registerScaffold, resolvePluginComponent, resolvePluginRuntime, scaffoldRegistry, useConnectorsForPlugin, usePluginRuntime, usePluginRuntimeOptional } from './chunk-YH25Y4FW.js';
|
|
8
|
-
import { getCurrentLocale } from './chunk-
|
|
9
|
-
export { I18nProvider, coreTranslations, getCurrentLocale, mergeTranslations, registerTranslations, setCurrentLocale, setLocaleStore, useI18nConfig, useTranslation } from './chunk-
|
|
8
|
+
import { getCurrentLocale } from './chunk-MJ4ML56F.js';
|
|
9
|
+
export { I18nProvider, coreTranslations, getCurrentLocale, mergeTranslations, registerTranslations, setCurrentLocale, setLocaleStore, useI18nConfig, useTranslation } from './chunk-MJ4ML56F.js';
|
|
10
10
|
export { hashRouterAdapter, windowRouterAdapter } from './chunk-Y2C2FBQP.js';
|
|
11
11
|
export { FayzRuntimeError, createFayzRuntimeClient } from './chunk-7RTUHSKY.js';
|
|
12
|
-
import * as
|
|
12
|
+
import * as React3 from 'react';
|
|
13
13
|
import { useEffect } from 'react';
|
|
14
14
|
import { create } from 'zustand';
|
|
15
15
|
|
|
@@ -25,6 +25,97 @@ var WidgetZone = {
|
|
|
25
25
|
SETTINGS_AFTER: "settings.after",
|
|
26
26
|
FLOATING: "shell.floating"
|
|
27
27
|
};
|
|
28
|
+
function createEventBus() {
|
|
29
|
+
const handlers = /* @__PURE__ */ new Map();
|
|
30
|
+
const bus = {
|
|
31
|
+
emit(event, payload) {
|
|
32
|
+
const set = handlers.get(event);
|
|
33
|
+
if (!set) return;
|
|
34
|
+
for (const handler of Array.from(set)) {
|
|
35
|
+
try {
|
|
36
|
+
handler(payload);
|
|
37
|
+
} catch (err) {
|
|
38
|
+
console.error(`[fayz] event handler for "${event}" threw:`, err);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
on(event, handler) {
|
|
43
|
+
let set = handlers.get(event);
|
|
44
|
+
if (!set) {
|
|
45
|
+
set = /* @__PURE__ */ new Set();
|
|
46
|
+
handlers.set(event, set);
|
|
47
|
+
}
|
|
48
|
+
set.add(handler);
|
|
49
|
+
return () => bus.off(event, handler);
|
|
50
|
+
},
|
|
51
|
+
once(event, handler) {
|
|
52
|
+
const wrapped = (payload) => {
|
|
53
|
+
bus.off(event, wrapped);
|
|
54
|
+
handler(payload);
|
|
55
|
+
};
|
|
56
|
+
return bus.on(event, wrapped);
|
|
57
|
+
},
|
|
58
|
+
off(event, handler) {
|
|
59
|
+
handlers.get(event)?.delete(handler);
|
|
60
|
+
},
|
|
61
|
+
clear(event) {
|
|
62
|
+
if (event) handlers.delete(event);
|
|
63
|
+
else handlers.clear();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
return bus;
|
|
67
|
+
}
|
|
68
|
+
var eventBus = createEventBus();
|
|
69
|
+
function useOnEvent(event, handler, deps = []) {
|
|
70
|
+
const ref = React3.useRef(handler);
|
|
71
|
+
ref.current = handler;
|
|
72
|
+
React3.useEffect(
|
|
73
|
+
() => eventBus.on(event, (payload) => ref.current(payload)),
|
|
74
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
75
|
+
[event, ...deps]
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// src/data/refresh.ts
|
|
80
|
+
var DATA_CHANGED_EVENT = "data:changed";
|
|
81
|
+
function matchesDataChange(match, payload) {
|
|
82
|
+
const attributed = payload.table ?? payload.entityKey ?? payload.archetype;
|
|
83
|
+
if (!attributed) return true;
|
|
84
|
+
if (match.table && payload.table && match.table === payload.table) return true;
|
|
85
|
+
if (match.entityKey && payload.entityKey && match.entityKey === payload.entityKey) return true;
|
|
86
|
+
if (match.archetype && payload.archetype && match.archetype === payload.archetype) return true;
|
|
87
|
+
return !match.table && !match.entityKey && !match.archetype;
|
|
88
|
+
}
|
|
89
|
+
var pending = [];
|
|
90
|
+
var flushTimer = null;
|
|
91
|
+
function flush() {
|
|
92
|
+
const batch = pending;
|
|
93
|
+
pending = [];
|
|
94
|
+
flushTimer = null;
|
|
95
|
+
for (const payload of batch) eventBus.emit(DATA_CHANGED_EVENT, payload);
|
|
96
|
+
}
|
|
97
|
+
function emitDataChanged(payload = {}) {
|
|
98
|
+
if (payload.table) {
|
|
99
|
+
globalCache.invalidate(`${getActiveTenantId() ?? "_"}:${payload.table}`);
|
|
100
|
+
} else {
|
|
101
|
+
globalCache.clear();
|
|
102
|
+
}
|
|
103
|
+
pending.push({ op: "unknown", source: "agent", ...payload });
|
|
104
|
+
if (flushTimer) return;
|
|
105
|
+
flushTimer = setTimeout(flush, 120);
|
|
106
|
+
}
|
|
107
|
+
function useDataChanged(match, handler, deps = []) {
|
|
108
|
+
const handlerRef = React3.useRef(handler);
|
|
109
|
+
handlerRef.current = handler;
|
|
110
|
+
const { table, entityKey, archetype } = match;
|
|
111
|
+
React3.useEffect(
|
|
112
|
+
() => eventBus.on(DATA_CHANGED_EVENT, (payload) => {
|
|
113
|
+
if (matchesDataChange({ table, entityKey, archetype }, payload)) handlerRef.current(payload);
|
|
114
|
+
}),
|
|
115
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
116
|
+
[table, entityKey, archetype, ...deps]
|
|
117
|
+
);
|
|
118
|
+
}
|
|
28
119
|
|
|
29
120
|
// src/plugin/createSafeDataProvider.ts
|
|
30
121
|
function createSafeDataProvider(makeSupabase, makeMock) {
|
|
@@ -331,58 +422,560 @@ function downloadCSV(csv, filename) {
|
|
|
331
422
|
function exportCSV(columns, rows, filename) {
|
|
332
423
|
downloadCSV(buildCSV(columns, rows), filename);
|
|
333
424
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
425
|
+
|
|
426
|
+
// src/search/text.ts
|
|
427
|
+
var COMBINING_MARKS = /[\u0300-\u036f]/g;
|
|
428
|
+
function foldText(value) {
|
|
429
|
+
if (typeof value !== "string" || value === "") return "";
|
|
430
|
+
return value.normalize("NFD").replace(COMBINING_MARKS, "").toLowerCase().replace(/[^a-z0-9]+/g, " ").trim();
|
|
431
|
+
}
|
|
432
|
+
function foldWithMap(value) {
|
|
433
|
+
const out = [];
|
|
434
|
+
const map = [];
|
|
435
|
+
let pendingSpace = false;
|
|
436
|
+
for (let i = 0; i < value.length; i++) {
|
|
437
|
+
const ch = value[i];
|
|
438
|
+
const folded = ch.normalize("NFD").replace(COMBINING_MARKS, "").toLowerCase();
|
|
439
|
+
for (const f of folded) {
|
|
440
|
+
const alnum = f >= "a" && f <= "z" || f >= "0" && f <= "9";
|
|
441
|
+
if (!alnum) {
|
|
442
|
+
pendingSpace = out.length > 0;
|
|
443
|
+
continue;
|
|
346
444
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
set = /* @__PURE__ */ new Set();
|
|
352
|
-
handlers.set(event, set);
|
|
445
|
+
if (pendingSpace) {
|
|
446
|
+
out.push(" ");
|
|
447
|
+
map.push(i);
|
|
448
|
+
pendingSpace = false;
|
|
353
449
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
},
|
|
357
|
-
once(event, handler) {
|
|
358
|
-
const wrapped = (payload) => {
|
|
359
|
-
bus.off(event, wrapped);
|
|
360
|
-
handler(payload);
|
|
361
|
-
};
|
|
362
|
-
return bus.on(event, wrapped);
|
|
363
|
-
},
|
|
364
|
-
off(event, handler) {
|
|
365
|
-
handlers.get(event)?.delete(handler);
|
|
366
|
-
},
|
|
367
|
-
clear(event) {
|
|
368
|
-
if (event) handlers.delete(event);
|
|
369
|
-
else handlers.clear();
|
|
450
|
+
out.push(f);
|
|
451
|
+
map.push(i);
|
|
370
452
|
}
|
|
453
|
+
}
|
|
454
|
+
return { folded: out.join(""), map };
|
|
455
|
+
}
|
|
456
|
+
function digitsOf(value) {
|
|
457
|
+
return typeof value === "string" ? value.replace(/\D+/g, "") : "";
|
|
458
|
+
}
|
|
459
|
+
var MIN_DIGIT_QUERY = 4;
|
|
460
|
+
function normalizeQuery(raw) {
|
|
461
|
+
const folded = foldText(raw);
|
|
462
|
+
const tokens = folded ? folded.split(" ").filter(Boolean) : [];
|
|
463
|
+
const digits = raw.replace(/\D+/g, "");
|
|
464
|
+
let anchor = "";
|
|
465
|
+
for (const token of tokens) if (token.length > anchor.length) anchor = token;
|
|
466
|
+
return {
|
|
467
|
+
raw,
|
|
468
|
+
folded,
|
|
469
|
+
tokens,
|
|
470
|
+
digits: digits.length >= MIN_DIGIT_QUERY ? digits : "",
|
|
471
|
+
anchor
|
|
371
472
|
};
|
|
372
|
-
return bus;
|
|
373
473
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
const
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
);
|
|
474
|
+
function bigrams(value) {
|
|
475
|
+
if (value.length < 2) return value ? [value] : [];
|
|
476
|
+
const out = [];
|
|
477
|
+
for (let i = 0; i < value.length - 1; i++) out.push(value.slice(i, i + 2));
|
|
478
|
+
return out;
|
|
479
|
+
}
|
|
480
|
+
function similarity(a, b) {
|
|
481
|
+
if (!a || !b) return 0;
|
|
482
|
+
if (a === b) return 1;
|
|
483
|
+
const left = bigrams(a);
|
|
484
|
+
const right = bigrams(b);
|
|
485
|
+
if (left.length === 0 || right.length === 0) return 0;
|
|
486
|
+
const pool = /* @__PURE__ */ new Map();
|
|
487
|
+
for (const g of left) pool.set(g, (pool.get(g) ?? 0) + 1);
|
|
488
|
+
let shared = 0;
|
|
489
|
+
for (const g of right) {
|
|
490
|
+
const count = pool.get(g);
|
|
491
|
+
if (count) {
|
|
492
|
+
shared++;
|
|
493
|
+
pool.set(g, count - 1);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
return 2 * shared / (left.length + right.length);
|
|
497
|
+
}
|
|
498
|
+
function wordSimilarity(text, token) {
|
|
499
|
+
let best = similarity(text, token);
|
|
500
|
+
for (const word of text.split(" ")) {
|
|
501
|
+
if (!word) continue;
|
|
502
|
+
const s = similarity(word, token);
|
|
503
|
+
if (s > best) best = s;
|
|
504
|
+
}
|
|
505
|
+
return best;
|
|
506
|
+
}
|
|
507
|
+
var FUZZY_FLOOR = 0.62;
|
|
508
|
+
function scoreCandidate(query, candidate) {
|
|
509
|
+
const { folded, tokens } = query;
|
|
510
|
+
if (!folded || tokens.length === 0) return 0;
|
|
511
|
+
const title = candidate.title;
|
|
512
|
+
const haystack = candidate.haystack || title;
|
|
513
|
+
let phrase = 0;
|
|
514
|
+
if (title === folded) phrase = 1;
|
|
515
|
+
else if (title.startsWith(folded)) phrase = 0.94;
|
|
516
|
+
else if (title.includes(" " + folded)) phrase = 0.88;
|
|
517
|
+
else if (title.includes(folded)) phrase = 0.76;
|
|
518
|
+
else if (haystack.startsWith(folded) || haystack.includes(" " + folded)) phrase = 0.7;
|
|
519
|
+
else if (haystack.includes(folded)) phrase = 0.62;
|
|
520
|
+
let tokenTotal = 0;
|
|
521
|
+
let fuzzyUsed = false;
|
|
522
|
+
for (const token of tokens) {
|
|
523
|
+
let best = 0;
|
|
524
|
+
if (title.startsWith(token)) best = 0.95;
|
|
525
|
+
else if (title.includes(" " + token)) best = 0.85;
|
|
526
|
+
else if (title.includes(token)) best = 0.7;
|
|
527
|
+
else if (haystack.startsWith(token) || haystack.includes(" " + token)) best = 0.6;
|
|
528
|
+
else if (haystack.includes(token)) best = 0.5;
|
|
529
|
+
else {
|
|
530
|
+
const sim = wordSimilarity(title, token);
|
|
531
|
+
if (sim >= FUZZY_FLOOR) {
|
|
532
|
+
best = 0.45 * sim;
|
|
533
|
+
fuzzyUsed = true;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
if (best === 0) return phrase > 0 ? phrase : 0;
|
|
537
|
+
tokenTotal += best;
|
|
538
|
+
}
|
|
539
|
+
let tokenScore = tokenTotal / tokens.length;
|
|
540
|
+
if (fuzzyUsed) tokenScore *= 0.8;
|
|
541
|
+
let score = Math.max(phrase, tokenScore);
|
|
542
|
+
if (query.digits && candidate.digits && candidate.digits.includes(query.digits)) {
|
|
543
|
+
score = Math.max(score, 0.72 + Math.min(0.2, query.digits.length / 50));
|
|
544
|
+
}
|
|
545
|
+
if (score === 0) return 0;
|
|
546
|
+
const brevity = 1 / (1 + Math.max(0, title.length - folded.length) / 40);
|
|
547
|
+
return score * 0.97 + brevity * 0.03;
|
|
548
|
+
}
|
|
549
|
+
function highlightRanges(text, query) {
|
|
550
|
+
if (!text || query.tokens.length === 0) return [];
|
|
551
|
+
const { folded, map } = foldWithMap(text);
|
|
552
|
+
if (!folded) return [];
|
|
553
|
+
const spans = [];
|
|
554
|
+
const needles = query.tokens.length > 1 ? [query.folded, ...query.tokens] : [query.folded];
|
|
555
|
+
for (const needle of needles) {
|
|
556
|
+
if (!needle) continue;
|
|
557
|
+
let from = 0;
|
|
558
|
+
for (; ; ) {
|
|
559
|
+
const at = folded.indexOf(needle, from);
|
|
560
|
+
if (at === -1) break;
|
|
561
|
+
const start = map[at];
|
|
562
|
+
const endChar = map[at + needle.length - 1];
|
|
563
|
+
if (start !== void 0 && endChar !== void 0) spans.push([start, endChar + 1]);
|
|
564
|
+
from = at + needle.length;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
if (spans.length === 0) return [];
|
|
568
|
+
spans.sort((a, b) => a[0] - b[0]);
|
|
569
|
+
const merged = [spans[0]];
|
|
570
|
+
for (const span of spans.slice(1)) {
|
|
571
|
+
const last = merged[merged.length - 1];
|
|
572
|
+
if (span[0] <= last[1]) last[1] = Math.max(last[1], span[1]);
|
|
573
|
+
else merged.push(span);
|
|
574
|
+
}
|
|
575
|
+
return merged;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// src/search/engine.ts
|
|
579
|
+
var MIN_QUERY_LENGTH = 2;
|
|
580
|
+
var DEFAULT_LIMIT = 30;
|
|
581
|
+
var DEFAULT_PER_TARGET = 5;
|
|
582
|
+
var SCAN_CONCURRENCY = 16;
|
|
583
|
+
var TARGET_TIMEOUT_MS = 3e3;
|
|
584
|
+
var CACHE_TTL_MS = 3e4;
|
|
585
|
+
var CACHE_MAX_ENTRIES = 40;
|
|
586
|
+
var RPC_NAME = "fayz_global_search";
|
|
587
|
+
var indexAvailable = null;
|
|
588
|
+
function setSearchIndexAvailable(value) {
|
|
589
|
+
indexAvailable = value;
|
|
590
|
+
}
|
|
591
|
+
function isSearchIndexAvailable() {
|
|
592
|
+
return indexAvailable;
|
|
593
|
+
}
|
|
594
|
+
function camelOf(key) {
|
|
595
|
+
return key.replace(/_([a-z0-9])/g, (_, c) => c.toUpperCase());
|
|
596
|
+
}
|
|
597
|
+
function snakeOf(key) {
|
|
598
|
+
return key.replace(/[A-Z]/g, (c) => "_" + c.toLowerCase());
|
|
599
|
+
}
|
|
600
|
+
function readField(row, key) {
|
|
601
|
+
if (key in row) return row[key];
|
|
602
|
+
const camel = camelOf(key);
|
|
603
|
+
if (camel in row) return row[camel];
|
|
604
|
+
const snake = snakeOf(key);
|
|
605
|
+
if (snake in row) return row[snake];
|
|
606
|
+
return void 0;
|
|
607
|
+
}
|
|
608
|
+
function asText(value) {
|
|
609
|
+
if (typeof value === "string") return value;
|
|
610
|
+
if (typeof value === "number") return String(value);
|
|
611
|
+
if (Array.isArray(value)) return value.filter((v) => typeof v === "string").join(" ");
|
|
612
|
+
return "";
|
|
613
|
+
}
|
|
614
|
+
function searchableKeys(entity) {
|
|
615
|
+
const declared = entity.data?.searchColumns ?? entity.fields.filter((f) => f.searchable).map((f) => f.key);
|
|
616
|
+
const keys = [...declared];
|
|
617
|
+
const display = entity.displayField ?? "name";
|
|
618
|
+
if (!keys.includes(display)) keys.unshift(display);
|
|
619
|
+
const subtitle = entity.subtitleField;
|
|
620
|
+
if (subtitle && !keys.includes(subtitle)) keys.push(subtitle);
|
|
621
|
+
return keys;
|
|
622
|
+
}
|
|
623
|
+
var DIGIT_FIELD_TYPES = /* @__PURE__ */ new Set(["phone", "number"]);
|
|
624
|
+
function digitKeys(entity) {
|
|
625
|
+
const keys = entity.fields.filter((f) => DIGIT_FIELD_TYPES.has(f.type) || /phone|document|cpf|cnpj|zip|postal|sku|code|reference/i.test(f.key)).map((f) => f.key);
|
|
626
|
+
for (const extra of ["phone", "document_number", "sku", "reference_number", "postal_code"]) {
|
|
627
|
+
if (!keys.includes(extra)) keys.push(extra);
|
|
628
|
+
}
|
|
629
|
+
return keys;
|
|
630
|
+
}
|
|
631
|
+
function titleOf(entity, row) {
|
|
632
|
+
const display = entity.displayField ?? "name";
|
|
633
|
+
const primary = asText(readField(row, display));
|
|
634
|
+
if (primary) return primary;
|
|
635
|
+
for (const field of entity.fields) {
|
|
636
|
+
if (field.type === "text" || field.type === "email") {
|
|
637
|
+
const value = asText(readField(row, field.key));
|
|
638
|
+
if (value) return value;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
return asText(row.id) || "\u2014";
|
|
642
|
+
}
|
|
643
|
+
function subtitleOf(entity, row, title) {
|
|
644
|
+
const distinct = (value) => {
|
|
645
|
+
if (!value || foldText(value) === foldText(title)) return void 0;
|
|
646
|
+
return value.length > 90 ? value.slice(0, 89) + "\u2026" : value;
|
|
647
|
+
};
|
|
648
|
+
const declared = entity.subtitleField;
|
|
649
|
+
if (declared) {
|
|
650
|
+
const value = distinct(asText(readField(row, declared)));
|
|
651
|
+
if (value) return value;
|
|
652
|
+
}
|
|
653
|
+
for (const key of ["email", "phone", "sku", "reference_number", "document_number", "description"]) {
|
|
654
|
+
const value = distinct(asText(readField(row, key)));
|
|
655
|
+
if (value) return value;
|
|
656
|
+
}
|
|
657
|
+
return void 0;
|
|
658
|
+
}
|
|
659
|
+
function hitFromRow(target, row, query) {
|
|
660
|
+
const id = asText(row.id);
|
|
661
|
+
if (!id) return null;
|
|
662
|
+
const entity = target.entity;
|
|
663
|
+
const title = titleOf(entity, row);
|
|
664
|
+
const parts = [title];
|
|
665
|
+
for (const key of searchableKeys(entity)) {
|
|
666
|
+
const value = asText(readField(row, key));
|
|
667
|
+
if (value) parts.push(value);
|
|
668
|
+
}
|
|
669
|
+
let digits = "";
|
|
670
|
+
for (const key of digitKeys(entity)) {
|
|
671
|
+
const value = readField(row, key);
|
|
672
|
+
if (typeof value === "string" || typeof value === "number") digits += digitsOf(String(value));
|
|
673
|
+
}
|
|
674
|
+
const score = scoreCandidate(query, {
|
|
675
|
+
title: foldText(title),
|
|
676
|
+
haystack: foldText(parts.join(" ")),
|
|
677
|
+
digits
|
|
678
|
+
});
|
|
679
|
+
if (score === 0) return null;
|
|
680
|
+
return {
|
|
681
|
+
uid: `${target.key}:${id}`,
|
|
682
|
+
id,
|
|
683
|
+
key: target.key,
|
|
684
|
+
group: target.label,
|
|
685
|
+
icon: target.icon ?? entity.icon,
|
|
686
|
+
title,
|
|
687
|
+
subtitle: subtitleOf(entity, row, title),
|
|
688
|
+
score: score * (target.boost ?? 1),
|
|
689
|
+
archetype: entity.data?.archetype,
|
|
690
|
+
archetypeKind: entity.data?.archetypeKind,
|
|
691
|
+
table: entity.data?.table,
|
|
692
|
+
record: row
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
696
|
+
function recordIdentity(hit) {
|
|
697
|
+
if (UUID.test(hit.id)) return hit.id;
|
|
698
|
+
return `${hit.table ?? hit.key}#${hit.id}`;
|
|
699
|
+
}
|
|
700
|
+
function assemble(query, hits, targets, opts) {
|
|
701
|
+
const seen = /* @__PURE__ */ new Set();
|
|
702
|
+
const unique = [];
|
|
703
|
+
for (const hit of hits.slice().sort((a, b) => b.score - a.score || a.title.localeCompare(b.title))) {
|
|
704
|
+
const identity = recordIdentity(hit);
|
|
705
|
+
if (seen.has(identity)) continue;
|
|
706
|
+
seen.add(identity);
|
|
707
|
+
unique.push(hit);
|
|
708
|
+
}
|
|
709
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
710
|
+
const kept = [];
|
|
711
|
+
const capped = /* @__PURE__ */ new Set();
|
|
712
|
+
for (const hit of unique) {
|
|
713
|
+
const bucket = byKey.get(hit.key) ?? [];
|
|
714
|
+
if (bucket.length >= opts.perTarget) {
|
|
715
|
+
capped.add(hit.key);
|
|
716
|
+
continue;
|
|
717
|
+
}
|
|
718
|
+
bucket.push(hit);
|
|
719
|
+
byKey.set(hit.key, bucket);
|
|
720
|
+
kept.push(hit);
|
|
721
|
+
}
|
|
722
|
+
const limited = kept.slice(0, opts.limit);
|
|
723
|
+
const order = new Map(targets.map((t, i) => [t.key, i]));
|
|
724
|
+
const groups = [];
|
|
725
|
+
for (const hit of limited) {
|
|
726
|
+
let group = groups.find((g) => g.key === hit.key);
|
|
727
|
+
if (!group) {
|
|
728
|
+
group = { key: hit.key, label: hit.group, icon: hit.icon, hits: [], hasMore: capped.has(hit.key) };
|
|
729
|
+
groups.push(group);
|
|
730
|
+
}
|
|
731
|
+
group.hits.push(hit);
|
|
732
|
+
}
|
|
733
|
+
groups.sort((a, b) => (b.hits[0]?.score ?? 0) - (a.hits[0]?.score ?? 0) || (order.get(a.key) ?? 99) - (order.get(b.key) ?? 99));
|
|
734
|
+
return {
|
|
735
|
+
query,
|
|
736
|
+
hits: limited,
|
|
737
|
+
groups,
|
|
738
|
+
via: opts.via,
|
|
739
|
+
failed: opts.failed,
|
|
740
|
+
elapsedMs: opts.elapsedMs,
|
|
741
|
+
partial: opts.partial ?? false
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
var cache = [];
|
|
745
|
+
function scopeKey(targets) {
|
|
746
|
+
return `${getActiveTenantId() ?? "_"}|${targets.map((t) => t.key).sort().join(",")}`;
|
|
747
|
+
}
|
|
748
|
+
function cacheGet(scope, folded) {
|
|
749
|
+
const now = Date.now();
|
|
750
|
+
return cache.find((e) => e.scope === scope && e.folded === folded && now - e.at < CACHE_TTL_MS);
|
|
751
|
+
}
|
|
752
|
+
function cachePrefix(scope, folded) {
|
|
753
|
+
const now = Date.now();
|
|
754
|
+
let best;
|
|
755
|
+
for (const entry of cache) {
|
|
756
|
+
if (entry.scope !== scope || !entry.complete) continue;
|
|
757
|
+
if (now - entry.at >= CACHE_TTL_MS) continue;
|
|
758
|
+
if (!folded.startsWith(entry.folded)) continue;
|
|
759
|
+
if (!best || entry.folded.length > best.folded.length) best = entry;
|
|
760
|
+
}
|
|
761
|
+
return best;
|
|
762
|
+
}
|
|
763
|
+
function cacheSet(entry) {
|
|
764
|
+
const at = cache.findIndex((e) => e.scope === entry.scope && e.folded === entry.folded);
|
|
765
|
+
if (at >= 0) cache.splice(at, 1);
|
|
766
|
+
cache.unshift(entry);
|
|
767
|
+
if (cache.length > CACHE_MAX_ENTRIES) cache.length = CACHE_MAX_ENTRIES;
|
|
768
|
+
}
|
|
769
|
+
function clearSearchCache() {
|
|
770
|
+
cache.length = 0;
|
|
771
|
+
}
|
|
772
|
+
function isMissingFunction(error) {
|
|
773
|
+
if (!error) return false;
|
|
774
|
+
if (error.code === "PGRST202") return true;
|
|
775
|
+
const message = (error.message ?? "").toLowerCase();
|
|
776
|
+
return message.includes(RPC_NAME) && (message.includes("does not exist") || message.includes("not find"));
|
|
777
|
+
}
|
|
778
|
+
async function searchViaIndex(query, targets, perTarget, limit) {
|
|
779
|
+
const client = getSupabaseClientOptional();
|
|
780
|
+
const tenantId = getActiveTenantId();
|
|
781
|
+
if (!client || !tenantId) return { hits: [], ok: false };
|
|
782
|
+
const byKey = new Map(targets.map((t) => [t.key, t]));
|
|
783
|
+
const { data, error } = await client.rpc(RPC_NAME, {
|
|
784
|
+
p_query: query.raw,
|
|
785
|
+
p_tenant_id: tenantId,
|
|
786
|
+
p_entity_keys: targets.map((t) => t.key),
|
|
787
|
+
p_per_source: perTarget * 3,
|
|
788
|
+
p_limit: limit * 3
|
|
789
|
+
});
|
|
790
|
+
if (error) {
|
|
791
|
+
if (isMissingFunction(error)) {
|
|
792
|
+
indexAvailable = false;
|
|
793
|
+
return { hits: [], ok: false };
|
|
794
|
+
}
|
|
795
|
+
throw error;
|
|
796
|
+
}
|
|
797
|
+
indexAvailable = true;
|
|
798
|
+
const rows = Array.isArray(data) ? data : [];
|
|
799
|
+
const hits = [];
|
|
800
|
+
for (const row of rows) {
|
|
801
|
+
const target = byKey.get(row.entity_key);
|
|
802
|
+
if (!target || !row.record_id) continue;
|
|
803
|
+
const title = row.title ?? "";
|
|
804
|
+
const local = scoreCandidate(query, {
|
|
805
|
+
title: foldText(title),
|
|
806
|
+
haystack: foldText(`${title} ${row.subtitle ?? ""}`),
|
|
807
|
+
digits: digitsOf(row.subtitle ?? "") + digitsOf(title)
|
|
808
|
+
});
|
|
809
|
+
const score = local > 0 ? local : Math.min(0.55, row.score ?? 0.4);
|
|
810
|
+
hits.push({
|
|
811
|
+
uid: `${target.key}:${row.record_id}`,
|
|
812
|
+
id: row.record_id,
|
|
813
|
+
key: target.key,
|
|
814
|
+
group: target.label,
|
|
815
|
+
icon: target.icon ?? target.entity.icon,
|
|
816
|
+
title: title || "\u2014",
|
|
817
|
+
subtitle: row.subtitle ?? void 0,
|
|
818
|
+
score: score * (target.boost ?? 1),
|
|
819
|
+
archetype: target.entity.data?.archetype,
|
|
820
|
+
archetypeKind: target.entity.data?.archetypeKind,
|
|
821
|
+
table: target.entity.data?.table
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
return { hits, ok: true };
|
|
825
|
+
}
|
|
826
|
+
async function withTimeout(promise, ms) {
|
|
827
|
+
let timer;
|
|
828
|
+
try {
|
|
829
|
+
return await Promise.race([
|
|
830
|
+
promise,
|
|
831
|
+
new Promise((_, reject) => {
|
|
832
|
+
timer = setTimeout(() => reject(new Error("search target timed out")), ms);
|
|
833
|
+
})
|
|
834
|
+
]);
|
|
835
|
+
} finally {
|
|
836
|
+
if (timer) clearTimeout(timer);
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
async function mapLimited(items, limit, fn) {
|
|
840
|
+
const results = new Array(items.length);
|
|
841
|
+
let cursor = 0;
|
|
842
|
+
const workers = Array.from({ length: Math.min(limit, items.length) }, async () => {
|
|
843
|
+
for (; ; ) {
|
|
844
|
+
const index = cursor++;
|
|
845
|
+
if (index >= items.length) return;
|
|
846
|
+
const item = items[index];
|
|
847
|
+
try {
|
|
848
|
+
results[index] = { ok: true, value: await fn(item) };
|
|
849
|
+
} catch {
|
|
850
|
+
results[index] = { ok: false, item };
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
});
|
|
854
|
+
await Promise.all(workers);
|
|
855
|
+
return results;
|
|
856
|
+
}
|
|
857
|
+
async function searchViaScan(query, targets, perTarget, onProgress) {
|
|
858
|
+
const multiWord = query.tokens.length > 1;
|
|
859
|
+
const phrase = query.folded;
|
|
860
|
+
const token = query.anchor.length >= MIN_QUERY_LENGTH ? query.anchor : phrase;
|
|
861
|
+
const pageSize = Math.min(perTarget * 3, 24);
|
|
862
|
+
const widePageSize = Math.min(perTarget * 6, 40);
|
|
863
|
+
const searchable = targets.filter((t) => searchableKeys(t.entity).length > 0);
|
|
864
|
+
const running = [];
|
|
865
|
+
const round = (search, size) => mapLimited(searchable, SCAN_CONCURRENCY, async (target) => {
|
|
866
|
+
const provider = resolveDataProvider(target.entity, target.mockData);
|
|
867
|
+
const result = await withTimeout(
|
|
868
|
+
provider.list({ search, pageSize: size, countMode: "none" }),
|
|
869
|
+
TARGET_TIMEOUT_MS
|
|
870
|
+
);
|
|
871
|
+
const rows = result.data;
|
|
872
|
+
const hits = rows.map((row) => hitFromRow(target, row, query)).filter((h) => h !== null);
|
|
873
|
+
if (hits.length && onProgress) {
|
|
874
|
+
running.push(...hits);
|
|
875
|
+
onProgress(running.slice());
|
|
876
|
+
}
|
|
877
|
+
return { target, hits };
|
|
878
|
+
});
|
|
879
|
+
const collect = (settled) => {
|
|
880
|
+
const hits = [];
|
|
881
|
+
const failed = [];
|
|
882
|
+
for (const outcome of settled) {
|
|
883
|
+
if (outcome.ok) hits.push(...outcome.value.hits);
|
|
884
|
+
else failed.push(outcome.item.key);
|
|
885
|
+
}
|
|
886
|
+
return { hits, failed };
|
|
887
|
+
};
|
|
888
|
+
const first = collect(await round(phrase, pageSize));
|
|
889
|
+
if (first.hits.length > 0 || !multiWord || token === phrase) return first;
|
|
890
|
+
const second = collect(await round(token, widePageSize));
|
|
891
|
+
return { hits: second.hits, failed: [.../* @__PURE__ */ new Set([...first.failed, ...second.failed])] };
|
|
892
|
+
}
|
|
893
|
+
async function searchEverything(rawQuery, options) {
|
|
894
|
+
const started = Date.now();
|
|
895
|
+
const query = normalizeQuery(rawQuery);
|
|
896
|
+
const targets = options.targets;
|
|
897
|
+
const limit = options.limit ?? DEFAULT_LIMIT;
|
|
898
|
+
const perTarget = options.perTarget ?? DEFAULT_PER_TARGET;
|
|
899
|
+
const empty = (via2) => assemble(rawQuery, [], targets, { via: via2, failed: [], elapsedMs: Date.now() - started, perTarget, limit });
|
|
900
|
+
if (query.folded.length < MIN_QUERY_LENGTH || targets.length === 0) return empty("cache");
|
|
901
|
+
const scope = scopeKey(targets);
|
|
902
|
+
const exact = cacheGet(scope, query.folded);
|
|
903
|
+
if (exact) {
|
|
904
|
+
return assemble(rawQuery, exact.hits, targets, {
|
|
905
|
+
via: "cache",
|
|
906
|
+
failed: [],
|
|
907
|
+
elapsedMs: Date.now() - started,
|
|
908
|
+
perTarget,
|
|
909
|
+
limit
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
if (options.onPartial) {
|
|
913
|
+
const prefix = cachePrefix(scope, query.folded);
|
|
914
|
+
if (prefix) {
|
|
915
|
+
const rescored = prefix.hits.map((hit) => {
|
|
916
|
+
const score = scoreCandidate(query, {
|
|
917
|
+
title: foldText(hit.title),
|
|
918
|
+
haystack: foldText(`${hit.title} ${hit.subtitle ?? ""}`),
|
|
919
|
+
digits: digitsOf(hit.subtitle ?? "")
|
|
920
|
+
});
|
|
921
|
+
return score > 0 ? { ...hit, score } : null;
|
|
922
|
+
}).filter((h) => h !== null);
|
|
923
|
+
options.onPartial(assemble(rawQuery, rescored, targets, {
|
|
924
|
+
via: "cache",
|
|
925
|
+
failed: [],
|
|
926
|
+
elapsedMs: Date.now() - started,
|
|
927
|
+
perTarget,
|
|
928
|
+
limit,
|
|
929
|
+
partial: true
|
|
930
|
+
}));
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
let hits = [];
|
|
934
|
+
let failed = [];
|
|
935
|
+
let via = "scan";
|
|
936
|
+
if (!options.forceScan && indexAvailable !== false) {
|
|
937
|
+
try {
|
|
938
|
+
const indexed = await searchViaIndex(query, targets, perTarget, limit);
|
|
939
|
+
if (indexed.ok) {
|
|
940
|
+
hits = indexed.hits;
|
|
941
|
+
via = "index";
|
|
942
|
+
}
|
|
943
|
+
} catch {
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
if (via !== "index") {
|
|
947
|
+
const emit = options.onPartial;
|
|
948
|
+
const scanned = await searchViaScan(query, targets, perTarget, emit ? (running) => emit(assemble(rawQuery, running, targets, {
|
|
949
|
+
via: "scan",
|
|
950
|
+
failed: [],
|
|
951
|
+
elapsedMs: Date.now() - started,
|
|
952
|
+
perTarget,
|
|
953
|
+
limit,
|
|
954
|
+
partial: true
|
|
955
|
+
})) : void 0);
|
|
956
|
+
hits = scanned.hits;
|
|
957
|
+
failed = scanned.failed;
|
|
958
|
+
}
|
|
959
|
+
if (options.signal?.aborted) return empty(via);
|
|
960
|
+
const result = assemble(rawQuery, hits, targets, {
|
|
961
|
+
via,
|
|
962
|
+
failed,
|
|
963
|
+
elapsedMs: Date.now() - started,
|
|
964
|
+
perTarget,
|
|
965
|
+
limit
|
|
966
|
+
});
|
|
967
|
+
cacheSet({
|
|
968
|
+
scope,
|
|
969
|
+
folded: query.folded,
|
|
970
|
+
at: Date.now(),
|
|
971
|
+
// Only an uncapped answer is a sound superset for longer queries.
|
|
972
|
+
complete: failed.length === 0 && !result.groups.some((g) => g.hasMore),
|
|
973
|
+
hits
|
|
974
|
+
});
|
|
975
|
+
return result;
|
|
383
976
|
}
|
|
384
977
|
function UnknownBlock({ type }) {
|
|
385
|
-
return
|
|
978
|
+
return React3.createElement(
|
|
386
979
|
"div",
|
|
387
980
|
{
|
|
388
981
|
style: {
|
|
@@ -399,14 +992,14 @@ function UnknownBlock({ type }) {
|
|
|
399
992
|
function BlockRenderer({ node }) {
|
|
400
993
|
const Comp = getBlock(node.type);
|
|
401
994
|
const childEls = node.children?.length ? node.children.map(
|
|
402
|
-
(child, i) =>
|
|
995
|
+
(child, i) => React3.createElement(BlockRenderer, { key: child.id ?? `${child.type}-${i}`, node: child })
|
|
403
996
|
) : null;
|
|
404
|
-
if (!Comp) return
|
|
405
|
-
return
|
|
997
|
+
if (!Comp) return React3.createElement(UnknownBlock, { type: node.type });
|
|
998
|
+
return React3.createElement(Comp, { ...node.props ?? {}, node }, childEls);
|
|
406
999
|
}
|
|
407
1000
|
function renderBlocks(nodes) {
|
|
408
1001
|
return nodes.map(
|
|
409
|
-
(node, i) =>
|
|
1002
|
+
(node, i) => React3.createElement(BlockRenderer, { key: node.id ?? `${node.type}-${i}`, node })
|
|
410
1003
|
);
|
|
411
1004
|
}
|
|
412
1005
|
function BlockChildren({ node }) {
|
|
@@ -1386,9 +1979,9 @@ var app_manifest_schema_default = {
|
|
|
1386
1979
|
}
|
|
1387
1980
|
}
|
|
1388
1981
|
};
|
|
1389
|
-
var ManifestContext =
|
|
1982
|
+
var ManifestContext = React3.createContext(null);
|
|
1390
1983
|
function useManifest() {
|
|
1391
|
-
return
|
|
1984
|
+
return React3.useContext(ManifestContext);
|
|
1392
1985
|
}
|
|
1393
1986
|
function defineApp(manifest) {
|
|
1394
1987
|
const full = {
|
|
@@ -1420,10 +2013,10 @@ function renderApp(input, opts = {}) {
|
|
|
1420
2013
|
`Scaffold "${surface.scaffold}" is not registered. Import the package that provides it (e.g. @fayz-ai/saas or @fayz-ai/shop) before calling renderApp.`
|
|
1421
2014
|
);
|
|
1422
2015
|
}
|
|
1423
|
-
return
|
|
2016
|
+
return React3.createElement(
|
|
1424
2017
|
ManifestContext.Provider,
|
|
1425
2018
|
{ value: manifest },
|
|
1426
|
-
|
|
2019
|
+
React3.createElement(Scaffold, { manifest, surface: surfaceName })
|
|
1427
2020
|
);
|
|
1428
2021
|
}
|
|
1429
2022
|
var MAX_ENTRIES = 20;
|
|
@@ -1466,6 +2059,6 @@ function routeModule(path) {
|
|
|
1466
2059
|
return path.replace(/^\/+/, "").split("/")[0] ?? "";
|
|
1467
2060
|
}
|
|
1468
2061
|
|
|
1469
|
-
export { BlockChildren, BlockRenderer, COUNTRIES, CURRENT_MANIFEST_VERSION, DEFAULT_COUNTRY, WidgetZone, absoluteUrl, app_manifest_schema_default as appManifestSchema, applySeo, breadcrumbJsonLd, buildCSV, clearPostalCache, computeContractHash, createEventBus, createSafeDataProvider, createViaCepProvider, defineApp, downloadCSV, eventBus, exportCSV, formatCurrency, formatDate, formatDateTime, formatPostalCode, getActiveLocale, getCountry, getDefaultCurrency, getPostalLookupProvider, isValidPostalCode, lookupPostalCode, maskDigitCount, maskPhone, migrateManifest, navHistoryBack, normalizePostalCode, organizationJsonLd, recordNavigation, registerManifestMigration, renderApp, renderBlocks, routeModule, seoOrigin, serializeManifest, serializeManifestWithHash, setDefaultCurrency, setPostalLookupProvider, unmaskPhone, useManifest, useNavHistoryStore, useNavReferrer, useOnEvent, useSeo, validateManifest };
|
|
2062
|
+
export { BlockChildren, BlockRenderer, COUNTRIES, CURRENT_MANIFEST_VERSION, DATA_CHANGED_EVENT, DEFAULT_COUNTRY, MIN_QUERY_LENGTH, WidgetZone, absoluteUrl, app_manifest_schema_default as appManifestSchema, applySeo, breadcrumbJsonLd, buildCSV, clearPostalCache, clearSearchCache, computeContractHash, createEventBus, createSafeDataProvider, createViaCepProvider, defineApp, digitsOf, downloadCSV, emitDataChanged, eventBus, exportCSV, foldText, foldWithMap, formatCurrency, formatDate, formatDateTime, formatPostalCode, getActiveLocale, getCountry, getDefaultCurrency, getPostalLookupProvider, highlightRanges, isSearchIndexAvailable, isValidPostalCode, lookupPostalCode, maskDigitCount, maskPhone, matchesDataChange, migrateManifest, navHistoryBack, normalizePostalCode, normalizeQuery, organizationJsonLd, recordNavigation, registerManifestMigration, renderApp, renderBlocks, routeModule, scoreCandidate, searchEverything, seoOrigin, serializeManifest, serializeManifestWithHash, setDefaultCurrency, setPostalLookupProvider, setSearchIndexAvailable, similarity, unmaskPhone, useDataChanged, useManifest, useNavHistoryStore, useNavReferrer, useOnEvent, useSeo, validateManifest };
|
|
1470
2063
|
//# sourceMappingURL=index.js.map
|
|
1471
2064
|
//# sourceMappingURL=index.js.map
|