@fayz-ai/sdk 0.43.2 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-52B62IQQ.js → chunk-4XZCJCLX.js} +42 -2
- package/dist/chunk-4XZCJCLX.js.map +1 -0
- package/dist/chunk-QP5O7KWV.js +135 -0
- package/dist/chunk-QP5O7KWV.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/release-channels.js +1 -1
- package/dist/release-channels.json +93 -93
- package/dist/shop.d.ts +22 -0
- package/dist/shop.d.ts.map +1 -1
- package/dist/shop.js +1 -1
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +1 -1
- package/dist/vite.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-52B62IQQ.js.map +0 -1
- package/dist/chunk-BHLSDMAR.js +0 -135
- package/dist/chunk-BHLSDMAR.js.map +0 -1
|
@@ -1,103 +1,103 @@
|
|
|
1
1
|
{
|
|
2
2
|
"channels": {
|
|
3
3
|
"stable": {
|
|
4
|
-
"@fayz-ai/sdk": "^0.
|
|
5
|
-
"@fayz-ai/admin": "^0.
|
|
6
|
-
"@fayz-ai/core": "^0.
|
|
7
|
-
"@fayz-ai/auth": "^0.
|
|
8
|
-
"@fayz-ai/ui": "^0.
|
|
9
|
-
"@fayz-ai/shop": "^0.
|
|
10
|
-
"@fayz-ai/storefront": "^0.
|
|
11
|
-
"@fayz-ai/portal": "^0.
|
|
12
|
-
"@fayz-ai/courses": "^0.
|
|
13
|
-
"@fayz-ai/db": "^0.
|
|
14
|
-
"@fayz-ai/plugin-agenda": "^0.
|
|
15
|
-
"@fayz-ai/plugin-auth": "^0.
|
|
16
|
-
"@fayz-ai/plugin-automations": "^0.15.
|
|
17
|
-
"@fayz-ai/plugin-blog": "^0.12.
|
|
18
|
-
"@fayz-ai/plugin-conversations": "^0.
|
|
19
|
-
"@fayz-ai/plugin-courses": "^0.10.
|
|
20
|
-
"@fayz-ai/plugin-crm": "^0.
|
|
21
|
-
"@fayz-ai/plugin-dashboard": "^0.9.
|
|
22
|
-
"@fayz-ai/plugin-financial": "^0.
|
|
23
|
-
"@fayz-ai/plugin-forms": "^0.
|
|
24
|
-
"@fayz-ai/plugin-inventory": "^0.
|
|
25
|
-
"@fayz-ai/plugin-marketing": "^0.13.
|
|
26
|
-
"@fayz-ai/plugin-menu": "^0.
|
|
27
|
-
"@fayz-ai/plugin-orders": "^0.
|
|
28
|
-
"@fayz-ai/plugin-payments": "^0.9.
|
|
29
|
-
"@fayz-ai/plugin-reports": "^0.16.
|
|
30
|
-
"@fayz-ai/plugin-reputation": "^0.10.
|
|
31
|
-
"@fayz-ai/plugin-shop": "^0.
|
|
32
|
-
"@fayz-ai/plugin-sites": "^0.9.
|
|
33
|
-
"@fayz-ai/plugin-tables": "^0.
|
|
34
|
-
"@fayz-ai/plugin-tasks": "^0.
|
|
4
|
+
"@fayz-ai/sdk": "^0.48.0",
|
|
5
|
+
"@fayz-ai/admin": "^0.48.0",
|
|
6
|
+
"@fayz-ai/core": "^0.48.0",
|
|
7
|
+
"@fayz-ai/auth": "^0.48.0",
|
|
8
|
+
"@fayz-ai/ui": "^0.48.0",
|
|
9
|
+
"@fayz-ai/shop": "^0.48.0",
|
|
10
|
+
"@fayz-ai/storefront": "^0.48.0",
|
|
11
|
+
"@fayz-ai/portal": "^0.48.0",
|
|
12
|
+
"@fayz-ai/courses": "^0.48.0",
|
|
13
|
+
"@fayz-ai/db": "^0.24.1",
|
|
14
|
+
"@fayz-ai/plugin-agenda": "^0.26.0",
|
|
15
|
+
"@fayz-ai/plugin-auth": "^0.13.0",
|
|
16
|
+
"@fayz-ai/plugin-automations": "^0.15.15",
|
|
17
|
+
"@fayz-ai/plugin-blog": "^0.12.26",
|
|
18
|
+
"@fayz-ai/plugin-conversations": "^0.23.0",
|
|
19
|
+
"@fayz-ai/plugin-courses": "^0.10.36",
|
|
20
|
+
"@fayz-ai/plugin-crm": "^0.32.0",
|
|
21
|
+
"@fayz-ai/plugin-dashboard": "^0.9.34",
|
|
22
|
+
"@fayz-ai/plugin-financial": "^0.24.0",
|
|
23
|
+
"@fayz-ai/plugin-forms": "^0.15.0",
|
|
24
|
+
"@fayz-ai/plugin-inventory": "^0.18.0",
|
|
25
|
+
"@fayz-ai/plugin-marketing": "^0.13.19",
|
|
26
|
+
"@fayz-ai/plugin-menu": "^0.13.0",
|
|
27
|
+
"@fayz-ai/plugin-orders": "^0.15.0",
|
|
28
|
+
"@fayz-ai/plugin-payments": "^0.9.28",
|
|
29
|
+
"@fayz-ai/plugin-reports": "^0.16.15",
|
|
30
|
+
"@fayz-ai/plugin-reputation": "^0.10.29",
|
|
31
|
+
"@fayz-ai/plugin-shop": "^0.19.1",
|
|
32
|
+
"@fayz-ai/plugin-sites": "^0.9.32",
|
|
33
|
+
"@fayz-ai/plugin-tables": "^0.13.0",
|
|
34
|
+
"@fayz-ai/plugin-tasks": "^0.11.0"
|
|
35
35
|
},
|
|
36
36
|
"latest": {
|
|
37
|
-
"@fayz-ai/sdk": "^0.
|
|
38
|
-
"@fayz-ai/admin": "^0.
|
|
39
|
-
"@fayz-ai/core": "^0.
|
|
40
|
-
"@fayz-ai/auth": "^0.
|
|
41
|
-
"@fayz-ai/ui": "^0.
|
|
42
|
-
"@fayz-ai/shop": "^0.
|
|
43
|
-
"@fayz-ai/storefront": "^0.
|
|
44
|
-
"@fayz-ai/portal": "^0.
|
|
45
|
-
"@fayz-ai/courses": "^0.
|
|
46
|
-
"@fayz-ai/db": "^0.
|
|
47
|
-
"@fayz-ai/plugin-agenda": "^0.
|
|
48
|
-
"@fayz-ai/plugin-auth": "^0.
|
|
49
|
-
"@fayz-ai/plugin-automations": "^0.15.
|
|
50
|
-
"@fayz-ai/plugin-blog": "^0.12.
|
|
51
|
-
"@fayz-ai/plugin-conversations": "^0.
|
|
52
|
-
"@fayz-ai/plugin-courses": "^0.10.
|
|
53
|
-
"@fayz-ai/plugin-crm": "^0.
|
|
54
|
-
"@fayz-ai/plugin-dashboard": "^0.9.
|
|
55
|
-
"@fayz-ai/plugin-financial": "^0.
|
|
56
|
-
"@fayz-ai/plugin-forms": "^0.
|
|
57
|
-
"@fayz-ai/plugin-inventory": "^0.
|
|
58
|
-
"@fayz-ai/plugin-marketing": "^0.13.
|
|
59
|
-
"@fayz-ai/plugin-menu": "^0.
|
|
60
|
-
"@fayz-ai/plugin-orders": "^0.
|
|
61
|
-
"@fayz-ai/plugin-payments": "^0.9.
|
|
62
|
-
"@fayz-ai/plugin-reports": "^0.16.
|
|
63
|
-
"@fayz-ai/plugin-reputation": "^0.10.
|
|
64
|
-
"@fayz-ai/plugin-shop": "^0.
|
|
65
|
-
"@fayz-ai/plugin-sites": "^0.9.
|
|
66
|
-
"@fayz-ai/plugin-tables": "^0.
|
|
67
|
-
"@fayz-ai/plugin-tasks": "^0.
|
|
37
|
+
"@fayz-ai/sdk": "^0.48.0",
|
|
38
|
+
"@fayz-ai/admin": "^0.48.0",
|
|
39
|
+
"@fayz-ai/core": "^0.48.0",
|
|
40
|
+
"@fayz-ai/auth": "^0.48.0",
|
|
41
|
+
"@fayz-ai/ui": "^0.48.0",
|
|
42
|
+
"@fayz-ai/shop": "^0.48.0",
|
|
43
|
+
"@fayz-ai/storefront": "^0.48.0",
|
|
44
|
+
"@fayz-ai/portal": "^0.48.0",
|
|
45
|
+
"@fayz-ai/courses": "^0.48.0",
|
|
46
|
+
"@fayz-ai/db": "^0.24.1",
|
|
47
|
+
"@fayz-ai/plugin-agenda": "^0.26.0",
|
|
48
|
+
"@fayz-ai/plugin-auth": "^0.13.0",
|
|
49
|
+
"@fayz-ai/plugin-automations": "^0.15.15",
|
|
50
|
+
"@fayz-ai/plugin-blog": "^0.12.26",
|
|
51
|
+
"@fayz-ai/plugin-conversations": "^0.23.0",
|
|
52
|
+
"@fayz-ai/plugin-courses": "^0.10.36",
|
|
53
|
+
"@fayz-ai/plugin-crm": "^0.32.0",
|
|
54
|
+
"@fayz-ai/plugin-dashboard": "^0.9.34",
|
|
55
|
+
"@fayz-ai/plugin-financial": "^0.24.0",
|
|
56
|
+
"@fayz-ai/plugin-forms": "^0.15.0",
|
|
57
|
+
"@fayz-ai/plugin-inventory": "^0.18.0",
|
|
58
|
+
"@fayz-ai/plugin-marketing": "^0.13.19",
|
|
59
|
+
"@fayz-ai/plugin-menu": "^0.13.0",
|
|
60
|
+
"@fayz-ai/plugin-orders": "^0.15.0",
|
|
61
|
+
"@fayz-ai/plugin-payments": "^0.9.28",
|
|
62
|
+
"@fayz-ai/plugin-reports": "^0.16.15",
|
|
63
|
+
"@fayz-ai/plugin-reputation": "^0.10.29",
|
|
64
|
+
"@fayz-ai/plugin-shop": "^0.19.1",
|
|
65
|
+
"@fayz-ai/plugin-sites": "^0.9.32",
|
|
66
|
+
"@fayz-ai/plugin-tables": "^0.13.0",
|
|
67
|
+
"@fayz-ai/plugin-tasks": "^0.11.0"
|
|
68
68
|
},
|
|
69
69
|
"preview": {
|
|
70
|
-
"@fayz-ai/sdk": "^0.
|
|
71
|
-
"@fayz-ai/admin": "^0.
|
|
72
|
-
"@fayz-ai/core": "^0.
|
|
73
|
-
"@fayz-ai/auth": "^0.
|
|
74
|
-
"@fayz-ai/ui": "^0.
|
|
75
|
-
"@fayz-ai/shop": "^0.
|
|
76
|
-
"@fayz-ai/storefront": "^0.
|
|
77
|
-
"@fayz-ai/portal": "^0.
|
|
78
|
-
"@fayz-ai/courses": "^0.
|
|
79
|
-
"@fayz-ai/db": "^0.
|
|
80
|
-
"@fayz-ai/plugin-agenda": "^0.
|
|
81
|
-
"@fayz-ai/plugin-auth": "^0.
|
|
82
|
-
"@fayz-ai/plugin-automations": "^0.15.
|
|
83
|
-
"@fayz-ai/plugin-blog": "^0.12.
|
|
84
|
-
"@fayz-ai/plugin-conversations": "^0.
|
|
85
|
-
"@fayz-ai/plugin-courses": "^0.10.
|
|
86
|
-
"@fayz-ai/plugin-crm": "^0.
|
|
87
|
-
"@fayz-ai/plugin-dashboard": "^0.9.
|
|
88
|
-
"@fayz-ai/plugin-financial": "^0.
|
|
89
|
-
"@fayz-ai/plugin-forms": "^0.
|
|
90
|
-
"@fayz-ai/plugin-inventory": "^0.
|
|
91
|
-
"@fayz-ai/plugin-marketing": "^0.13.
|
|
92
|
-
"@fayz-ai/plugin-menu": "^0.
|
|
93
|
-
"@fayz-ai/plugin-orders": "^0.
|
|
94
|
-
"@fayz-ai/plugin-payments": "^0.9.
|
|
95
|
-
"@fayz-ai/plugin-reports": "^0.16.
|
|
96
|
-
"@fayz-ai/plugin-reputation": "^0.10.
|
|
97
|
-
"@fayz-ai/plugin-shop": "^0.
|
|
98
|
-
"@fayz-ai/plugin-sites": "^0.9.
|
|
99
|
-
"@fayz-ai/plugin-tables": "^0.
|
|
100
|
-
"@fayz-ai/plugin-tasks": "^0.
|
|
70
|
+
"@fayz-ai/sdk": "^0.48.0",
|
|
71
|
+
"@fayz-ai/admin": "^0.48.0",
|
|
72
|
+
"@fayz-ai/core": "^0.48.0",
|
|
73
|
+
"@fayz-ai/auth": "^0.48.0",
|
|
74
|
+
"@fayz-ai/ui": "^0.48.0",
|
|
75
|
+
"@fayz-ai/shop": "^0.48.0",
|
|
76
|
+
"@fayz-ai/storefront": "^0.48.0",
|
|
77
|
+
"@fayz-ai/portal": "^0.48.0",
|
|
78
|
+
"@fayz-ai/courses": "^0.48.0",
|
|
79
|
+
"@fayz-ai/db": "^0.24.1",
|
|
80
|
+
"@fayz-ai/plugin-agenda": "^0.26.0",
|
|
81
|
+
"@fayz-ai/plugin-auth": "^0.13.0",
|
|
82
|
+
"@fayz-ai/plugin-automations": "^0.15.15",
|
|
83
|
+
"@fayz-ai/plugin-blog": "^0.12.26",
|
|
84
|
+
"@fayz-ai/plugin-conversations": "^0.23.0",
|
|
85
|
+
"@fayz-ai/plugin-courses": "^0.10.36",
|
|
86
|
+
"@fayz-ai/plugin-crm": "^0.32.0",
|
|
87
|
+
"@fayz-ai/plugin-dashboard": "^0.9.34",
|
|
88
|
+
"@fayz-ai/plugin-financial": "^0.24.0",
|
|
89
|
+
"@fayz-ai/plugin-forms": "^0.15.0",
|
|
90
|
+
"@fayz-ai/plugin-inventory": "^0.18.0",
|
|
91
|
+
"@fayz-ai/plugin-marketing": "^0.13.19",
|
|
92
|
+
"@fayz-ai/plugin-menu": "^0.13.0",
|
|
93
|
+
"@fayz-ai/plugin-orders": "^0.15.0",
|
|
94
|
+
"@fayz-ai/plugin-payments": "^0.9.28",
|
|
95
|
+
"@fayz-ai/plugin-reports": "^0.16.15",
|
|
96
|
+
"@fayz-ai/plugin-reputation": "^0.10.29",
|
|
97
|
+
"@fayz-ai/plugin-shop": "^0.19.1",
|
|
98
|
+
"@fayz-ai/plugin-sites": "^0.9.32",
|
|
99
|
+
"@fayz-ai/plugin-tables": "^0.13.0",
|
|
100
|
+
"@fayz-ai/plugin-tasks": "^0.11.0"
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}
|
package/dist/shop.d.ts
CHANGED
|
@@ -72,6 +72,10 @@ interface CheckoutSessionInput {
|
|
|
72
72
|
paymentMethod?: string;
|
|
73
73
|
/** O adquirente que deve cobrar. Ausente cai na AbacatePay. */
|
|
74
74
|
provider?: string | null;
|
|
75
|
+
/** The market this charge is in (0116 code); absent = the default market. */
|
|
76
|
+
market?: string | null;
|
|
77
|
+
/** The buyer's country (ISO2), when the market is not named. */
|
|
78
|
+
country?: string | null;
|
|
75
79
|
/** Para onde o adquirente devolve o comprador que pagou fora da loja. */
|
|
76
80
|
returnUrl?: string | null;
|
|
77
81
|
/** Em vez de cobrar agora, devolve um link para o lojista mandar ao cliente. */
|
|
@@ -678,6 +682,24 @@ export declare function createFayzShopProvider(options: FayzShopProviderOptions)
|
|
|
678
682
|
checkoutFields: object | undefined;
|
|
679
683
|
carrierQuotes: boolean | undefined;
|
|
680
684
|
} | null>;
|
|
685
|
+
/** Markets (0116), default first. A pool without 0116, or a failure: none. */
|
|
686
|
+
listMarkets(): Promise<{
|
|
687
|
+
code: string;
|
|
688
|
+
name: string;
|
|
689
|
+
currency: string;
|
|
690
|
+
locale: string | null;
|
|
691
|
+
countries: string[];
|
|
692
|
+
isDefault: boolean;
|
|
693
|
+
paymentProvider: string | null;
|
|
694
|
+
shippingFlatRate: number;
|
|
695
|
+
shippingFreeAbove: number | null;
|
|
696
|
+
}[]>;
|
|
697
|
+
/** One market's price list, keyed by shop product and shop variant. */
|
|
698
|
+
getMarketPrices(market: string): Promise<{
|
|
699
|
+
productId: string;
|
|
700
|
+
variantId: string | null;
|
|
701
|
+
price: number;
|
|
702
|
+
}[]>;
|
|
681
703
|
/**
|
|
682
704
|
* Dispatch by hand.
|
|
683
705
|
*
|
package/dist/shop.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shop.d.ts","sourceRoot":"","sources":["../src/shop.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;;;;;;OAUG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC5B,eAAe,CAAC,EAAE,8BAA8B,EAAE,CAAA;IAClD,OAAO,CAAC,EAAE,OAAO,KAAK,CAAA;CACvB;AAED;;;;;;;;;;;;;GAaG;AACH,KAAK,mBAAmB,GAAG,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;AAI1D,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAErF;AAoBD;;;;;GAKG;AACH,UAAU,mBAAmB;IAC3B,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU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;;;;IAa7D;;;;;;;;;;;;;;;;;OAiBG;8BAC6B,MAAM,YAAY,MAAM;IAwCxD;;;;;;;OAOG;mCACkC,MAAM;sCAcH,MAAM;;;;;;;;;;;;;;;0BA4BlB;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;uBAe3F,MAAM,SAAS;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE;;;;;;;;;;;;;;uBAe7H,MAAM;4BAGD,4BAA4B;;;;;;;;;;;;;;;;;oBAWpC,MAAM;;;;;;;;;;;;;;;;;;;;EAc/B"}
|
package/dist/shop.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { FayzShopError, PRODUCT_METADATA_OVERLAY_DEPRECATION, createFayzShopProvider, resetProductMetadataOverlayDeprecationWarning, setShopAccessTokenResolver, setShopCarrierQuotesResolver, setShopShippingItemsResolver } from './chunk-
|
|
1
|
+
export { FayzShopError, PRODUCT_METADATA_OVERLAY_DEPRECATION, createFayzShopProvider, resetProductMetadataOverlayDeprecationWarning, setShopAccessTokenResolver, setShopCarrierQuotesResolver, setShopShippingItemsResolver } from './chunk-4XZCJCLX.js';
|
|
2
2
|
import './chunk-LCW5ZV5S.js';
|
|
3
3
|
//# sourceMappingURL=shop.js.map
|
|
4
4
|
//# sourceMappingURL=shop.js.map
|
package/dist/vite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.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;;OAIG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;IAC/B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAA;IAClC;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAAA;CACnC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,iBAAiB,CAAA;AAE9C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,EACf,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,MAAM,CAGR;AA2CD,wBAAgB,QAAQ,CAAC,IAAI,GAAE,eAAoB,GAAG,UAAU,CAgG/D"}
|
package/dist/vite.js
CHANGED
|
@@ -404,7 +404,7 @@ function sdkAliases(sdkDir) {
|
|
|
404
404
|
if (!existsSync(dir)) continue;
|
|
405
405
|
for (const name of readdirSync(dir)) {
|
|
406
406
|
const src = resolve(dir, name, "src");
|
|
407
|
-
if (existsSync(
|
|
407
|
+
if (existsSync(src)) out[`@fayz-ai/${name}`] = src;
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
return out;
|
package/dist/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/app-shell-pwa.ts","../src/lib/boot-skeleton.ts","../src/vite.ts"],"names":["identity","lightnessOf","resolve","existsSync","readFileSync","HEAD_ANCHOR","insertAfter"],"mappings":";;;;;AAoCA,IAAM,OAAA,GAAU,OAAA;AAChB,IAAM,YAAA,GAAe,UAAA;AACrB,IAAM,aAAA,GAAgB,sBAAA;AACtB,IAAM,SAAA,GAAY,UAAA;AAIlB,IAAM,YAAA,GAAe,YAAA;AAIrB,IAAM,aAAA,GAAgB,SAAA;AACtB,IAAM,kBAAA,GAAqB,SAAA;AAQ3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A;AAAA,QAAgC,wBAAA;AAAA,QAChC,gCAAA;AAAA,QAAkC;AAAA,OACpC;AAAA,MACA,UAAA,EAAY,WAAW,CAAC,QAAA,EAAU,WAAW,QAAA,EAAU,aAAA,EAAe,QAAQ,CAAA,GAAI;AAAA,KACpF;AAAA,IACA,YAAA,EAAc;AAAA,MACZ,SAAS,QAAA,GAAW,MAAA,CAAO,IAAA,CAAK,YAAY,IAAI,EAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOjD,OAAA,EAAS,QAAA,GAAW,CAAC,GAAG,aAAA,CAAc,IAAA,EAAM,cAAc,CAAA,EAAG,GAAG,OAAA,CAAQ,OAAO,CAAA,GAAI;AAAA,KACrF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,MAAA,EAAQ;AAAA,MACN,IAAA,EAAM,IAAA;AAAA,MACN,MAAM,IAAA,CAAK,IAAA;AAAA,MACX,YAAY,IAAA,CAAK,UAAA;AAAA,MACjB,IAAA,EAAM,IAAA;AAAA,MACN,YAAA,EAAc,IAAA;AAAA,MACd,OAAA,EAAS;AAAA,QACP,6BAAA,EAA+B,GAAA;AAAA,QAC/B,8BAAA,EAAgC;AAAA,OAClC;AAAA,MACA,IAAI,EAAE,KAAA,EAAO,CAAC,IAAA,EAAM,OAAO,CAAA,EAAE;AAAA,MAC7B,GAAI,IAAA,CAAK,MAAA,IAAU;AAAC;AACtB,GACF;AACF","file":"vite.js","sourcesContent":["import { createHash } from 'node:crypto'\nimport { existsSync, readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport type { Plugin } from 'vite'\n\n// ---------------------------------------------------------------------------\n// App shell, cached — the second load, and every load after it.\n//\n// The boot screen fixes the blank page; it does not fix the WAIT. A deployed\n// app still fetches its entry chunk over the network every single time, and on\n// a phone on café wifi that is the whole perceived cost of \"opening the app\".\n// A service worker that precaches the build turns the shell into something the\n// device already has: reload is instant, and a dropped connection still gets\n// the app (its own data is another story — see the fetch rules below).\n//\n// Hand-rolled on purpose. What we need is a precache list, a cache name and\n// three event listeners — about a page of JavaScript, against a build-time\n// dependency the preview container would have to cold-install on every start.\n//\n// Build only. A dev server that installs a service worker serves yesterday's\n// bundle to a developer who just saved a file, and the confusion costs more\n// than the caching saves.\n// ---------------------------------------------------------------------------\n\nexport interface AppShellPwaOptions {\n /** Install name. Default: the app's package.json name, de-scoped and titled. */\n name?: string\n /** Home-screen label, ideally ≤12 chars. Default: derived from `name`. */\n shortName?: string\n /** Browser chrome / icon color. Default: the boot screen's neutral rail. */\n themeColor?: string\n /** Splash background while the app boots. Default: the boot screen's page. */\n backgroundColor?: string\n}\n\n/** The emitted file names, at the bundle root (not under assets/). */\nconst SW_FILE = 'sw.js'\nconst HEADERS_FILE = '_headers'\nconst MANIFEST_FILE = 'manifest.webmanifest'\nconst ICON_FILE = 'icon.svg'\n\n/** Every cache this SW owns is `<prefix><build id>`, so activate can tell its\n * own stale generations apart from caches belonging to anything else. */\nconst CACHE_PREFIX = 'app-shell-'\n\n// The same neutral defaults the boot screen paints with (see boot-skeleton.ts),\n// so the manifest, the theme-color meta and the first paint agree.\nconst DEFAULT_THEME = '#131c26'\nconst DEFAULT_BACKGROUND = '#f1f1f1'\n\ninterface AppIdentity {\n name: string\n shortName: string\n}\n\n/** Perceived lightness of a hex color, 0-100; non-hex is assumed light. */\nfunction lightnessOf(css: string): number {\n const hex = css.trim().replace('#', '')\n const full = hex.length === 3 ? hex.replace(/./g, (c) => c + c) : hex\n if (!/^[0-9a-f]{6}$/i.test(full)) return 100\n const [r, g, b] = [0, 2, 4].map((i) => parseInt(full.slice(i, i + 2), 16) / 255)\n return ((Math.max(r, g, b) + Math.min(r, g, b)) / 2) * 100\n}\n\nfunction readPackageName(root: string): string | undefined {\n const pkgPath = resolve(root, 'package.json')\n if (!existsSync(pkgPath)) return undefined\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')) as { name?: string }\n return pkg.name\n } catch {\n return undefined\n }\n}\n\n/** `@acme/beauty-saas` → `Beauty Saas`. Good enough for a home-screen label,\n * and `name` overrides it whenever the app cares. */\nfunction titleize(pkgName: string): string {\n const bare = pkgName.replace(/^@[^/]+\\//, '')\n return (\n bare\n .split(/[-_.\\s]+/)\n .filter(Boolean)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ') || bare\n )\n}\n\nfunction identity(root: string, opts: AppShellPwaOptions): AppIdentity {\n const pkgName = readPackageName(root)\n const name = opts.name ?? (pkgName ? titleize(pkgName) : 'App')\n const shortName = opts.shortName ?? (name.length <= 12 ? name : name.split(' ')[0].slice(0, 12))\n return { name, shortName }\n}\n\n/** A maskable mark: rounded square in the theme color, app initial on top.\n * The glyph stays well inside the 80% safe zone, so a circular mask on\n * Android does not clip it. PNG sizes are a follow-up. */\nfunction iconSvg(identity: AppIdentity, themeColor: string): string {\n const initial = (identity.name.match(/[a-z0-9]/i)?.[0] ?? 'A').toUpperCase()\n const ink = lightnessOf(themeColor) > 55 ? '#111111' : '#ffffff'\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" width=\"512\" height=\"512\" role=\"img\" aria-label=\"${escapeXml(identity.name)}\">\n<rect width=\"512\" height=\"512\" rx=\"112\" fill=\"${themeColor}\"/>\n<text x=\"256\" y=\"256\" fill=\"${ink}\" font-family=\"system-ui,-apple-system,'Segoe UI',sans-serif\" font-size=\"232\" font-weight=\"600\" text-anchor=\"middle\" dominant-baseline=\"central\">${escapeXml(initial)}</text>\n</svg>\n`\n}\n\nfunction escapeXml(value: string): string {\n return value.replace(/[<>&\"']/g, (c) => `&#${c.charCodeAt(0)};`)\n}\n\nfunction manifestJson(\n identity: AppIdentity,\n base: string,\n themeColor: string,\n backgroundColor: string,\n): string {\n return `${JSON.stringify(\n {\n name: identity.name,\n short_name: identity.shortName,\n start_url: base,\n scope: base,\n display: 'standalone',\n theme_color: themeColor,\n background_color: backgroundColor,\n icons: [\n {\n src: `${base}${ICON_FILE}`,\n sizes: 'any',\n type: 'image/svg+xml',\n purpose: 'any maskable',\n },\n ],\n },\n null,\n 2,\n )}\\n`\n}\n\n/**\n * The worker itself, as plain JS with the build's precache list baked in.\n *\n * Caching rules, in the order the fetch handler applies them:\n * - non-GET, or cross-origin → untouched, the network answers\n * - navigation → network first, cached index.html offline\n * - a precached (hashed) asset → cache first, it can never go stale\n * - anything else same-origin → untouched (API reads/writes land here)\n *\n * The last rule is the important one: Supabase and every other API call goes\n * straight to the network, always. A service worker that answers a data\n * request from cache shows the user a number that is quietly wrong, which is\n * worse than an error.\n *\n * ── a troca de versão ──────────────────────────────────────────────────────\n *\n * There is no UNCONDITIONAL `skipWaiting`, and that part was right: a tab in\n * the middle of a form must never have its code swapped underneath it.\n *\n * What was wrong is what came with it. Without skipWaiting the new worker sits\n * in `waiting` until every tab of the origin is CLOSED — not reloaded, closed.\n * F5 on a controlled page does not replace the worker. So a deploy reached the\n * edge and did not reach the person, and the only gesture they knew that did\n * replace it was \"clear the browser cache\", because that unregisters the\n * worker. We were teaching non-technical users to clear site data on every\n * release.\n *\n * So the worker now skips waiting ON REQUEST — `postMessage('skip-waiting')`\n * — and the page asks first. The decision is the person's, taken in one click,\n * with the form still on screen. It is the Workbox pattern, and it is the only\n * one that keeps both halves: no silent swap, no cache ritual.\n */\nfunction serviceWorkerSource(buildId: string, shell: string, precache: string[]): string {\n return `// Generated by @fayz-ai/sdk at build time. Do not edit.\nconst BUILD_ID = ${JSON.stringify(buildId)};\nconst CACHE = ${JSON.stringify(CACHE_PREFIX)} + BUILD_ID;\nconst SHELL = ${JSON.stringify(shell)};\nconst PRECACHE = ${JSON.stringify(precache, null, 2)};\nconst PRECACHED = new Set(PRECACHE);\n\nself.addEventListener('install', function (event) {\n event.waitUntil(\n caches.open(CACHE).then(function (cache) {\n // One request at a time and forgiving: a single 404 must not void the\n // whole precache the way cache.addAll() would.\n return Promise.all(\n PRECACHE.map(function (url) {\n return cache.add(new Request(url, { cache: 'reload' })).catch(function () {});\n })\n );\n })\n );\n});\n\nself.addEventListener('activate', function (event) {\n event.waitUntil(\n caches\n .keys()\n .then(function (keys) {\n return Promise.all(\n keys\n .filter(function (key) {\n return key.indexOf(${JSON.stringify(CACHE_PREFIX)}) === 0 && key !== CACHE;\n })\n .map(function (key) {\n return caches.delete(key);\n })\n );\n })\n .then(function () {\n return self.clients.claim();\n })\n );\n});\n\n// The ONLY way to take over early, and it comes from outside. The page asks;\n// if the person says yes, it sends this message. Without it the behaviour is\n// what it always was: install quietly, take over when allowed.\nself.addEventListener('message', function (event) {\n if (event.data === 'skip-waiting') self.skipWaiting();\n});\n\nself.addEventListener('fetch', function (event) {\n var request = event.request;\n if (request.method !== 'GET') return;\n var url;\n try {\n url = new URL(request.url);\n } catch (e) {\n return;\n }\n if (url.origin !== self.location.origin) return;\n\n if (request.mode === 'navigate') {\n event.respondWith(\n fetch(request).catch(function () {\n return caches.match(SHELL, { cacheName: CACHE }).then(function (hit) {\n return hit || Response.error();\n });\n })\n );\n return;\n }\n\n // Only the build's own hashed assets, which are immutable by construction.\n // Everything else same-origin (API calls above all) is left to the network.\n if (!PRECACHED.has(url.pathname)) return;\n event.respondWith(\n caches.match(request, { cacheName: CACHE }).then(function (hit) {\n return hit || fetch(request);\n })\n );\n});\n`\n}\n\nconst HEAD_ANCHOR = /<head[^>]*>/i\nconst BODY_END = /<\\/body>/i\n\nfunction insertAfter(html: string, anchor: RegExp, chunk: string): string | null {\n const match = anchor.exec(html)\n if (!match) return null\n const at = match.index + match[0].length\n return `${html.slice(0, at)}\\n${chunk}${html.slice(at)}`\n}\n\n/**\n * Registra o worker E avisa a página quando há versão nova esperando.\n *\n * O aviso é um `CustomEvent` no `window`, não um import: este script é uma\n * tag inline no HTML, roda antes de qualquer bundle, e não pode depender de\n * React nem de nada que o app monte depois. Quem quiser desenhar o convite\n * escuta `fayz:update-ready`; quem não escutar não ganha comportamento\n * nenhum — a versão nova continua entrando na próxima visita, como antes.\n *\n * `window.fayzApplyUpdate()` é a outra metade: manda o worker assumir e\n * recarrega quando ele assumir. Recarregar no `controllerchange` e não no\n * clique é o que garante que a página que volta é a NOVA — recarregar antes\n * pega o worker velho de novo e o convite reaparece, que é a falha que faz o\n * usuário clicar três vezes e desistir.\n *\n * `reloading` existe porque o Chrome dispara `controllerchange` mais de uma\n * vez quando há abas irmãs, e dois `location.reload()` numa mesma navegação\n * deixam a aba piscando.\n */\nfunction registrationScript(swUrl: string): string {\n const source = `\nif ('serviceWorker' in navigator) {\n addEventListener('load', function () {\n navigator.serviceWorker.register('${swUrl}').then(function (reg) {\n var reloading = false;\n navigator.serviceWorker.addEventListener('controllerchange', function () {\n if (reloading) return;\n reloading = true;\n location.reload();\n });\n window.fayzApplyUpdate = function () {\n if (reg.waiting) reg.waiting.postMessage('skip-waiting');\n };\n function announce() {\n // Only when a controller ALREADY exists: without one this is a first\n // visit, the worker is installing for the first time and there is no\n // \"new version\" to offer — announcing here would ask someone to\n // reload a page they just opened.\n if (reg.waiting && navigator.serviceWorker.controller) {\n dispatchEvent(new CustomEvent('fayz:update-ready'));\n }\n }\n announce();\n reg.addEventListener('updatefound', function () {\n var sw = reg.installing;\n if (!sw) return;\n sw.addEventListener('statechange', function () {\n if (sw.state === 'installed') announce();\n });\n });\n // A tab left open all day never re-checks the worker on its own. Hourly\n // is cheap (a conditional GET of a few KB) and it is what gets the\n // invitation to the people who never close the browser.\n setInterval(function () { reg.update().catch(function () {}); }, 3600000);\n }).catch(function () {});\n });\n}`.trim()\n return `<script>${source}</script>`\n}\n\n/** What goes in the precache list: the build's own output, minus the things a\n * cache has no use for (sourcemaps, the worker itself, other HTML). */\nfunction isPrecacheable(fileName: string): boolean {\n if (fileName === SW_FILE || fileName === MANIFEST_FILE) return false\n return !fileName.endsWith('.map') && !fileName.endsWith('.html')\n}\n\n\n/**\n * The HOST's cache rules, which the worker alone cannot reach.\n *\n * Cloudflare (Pages and Workers Static Assets) reads `_headers` from the\n * published directory. Without one the default is `max-age=0,\n * must-revalidate` for EVERYTHING — including `/assets/app-BzniUHZd.js`,\n * whose name carries the hash of its content and therefore can never change\n * content. The result is revalidating several megabytes on every load, for\n * nothing, to confirm what the name already proved.\n *\n * The inverse is what has to stay volatile:\n *\n * index.html is the map to the build's hashes; serving it stale serves\n * the whole stale build, and is the one way a deploy fails to\n * reach someone who has visited before.\n * sw.js is what replaces the worker. Cached, a new version would\n * never be discovered. (Browsers already cap this one at 24h\n * on their own; saying `no-cache` removes the doubt.)\n */\nfunction headersSource(base: string): string {\n return [\n `${base}assets/*`,\n ' Cache-Control: public, max-age=31536000, immutable',\n '',\n `${base}${SW_FILE}`,\n ' Cache-Control: no-cache',\n '',\n `${base}index.html`,\n ' Cache-Control: no-cache',\n '',\n ].join('\\n')\n}\n\nexport function appShellPwa(root: string, opts: AppShellPwaOptions = {}): Plugin {\n const app = identity(root, opts)\n const themeColor = opts.themeColor ?? DEFAULT_THEME\n const backgroundColor = opts.backgroundColor ?? DEFAULT_BACKGROUND\n // Deployments under a subpath exist (preview containers, docs sites); every\n // emitted URL is base-relative so `/` is just the common case.\n let base = '/'\n\n return {\n name: 'fayz:app-shell-pwa',\n apply: 'build',\n\n configResolved(config) {\n base = config.base || '/'\n if (!base.endsWith('/')) base += '/'\n },\n\n generateBundle: {\n order: 'post',\n handler(_options, bundle) {\n const precache = Object.keys(bundle)\n .filter(isPrecacheable)\n .sort()\n .map((fileName) => `${base}${fileName}`)\n const shell = `${base}index.html`\n precache.unshift(shell)\n\n // The index.html source joins the hash: its asset names already change\n // per build, but its INLINE content (boot screen, meta) can change on\n // its own, and a shell served from an old cache would be that content.\n const indexAsset = bundle['index.html']\n const indexSource =\n indexAsset && indexAsset.type === 'asset' ? String(indexAsset.source) : ''\n const buildId = createHash('sha256')\n .update(precache.join('\\n'))\n .update(indexSource)\n .digest('hex')\n .slice(0, 12)\n\n this.emitFile({\n type: 'asset',\n fileName: SW_FILE,\n source: serviceWorkerSource(buildId, shell, precache),\n })\n this.emitFile({\n type: 'asset',\n fileName: HEADERS_FILE,\n source: headersSource(base),\n })\n this.emitFile({\n type: 'asset',\n fileName: MANIFEST_FILE,\n source: manifestJson(app, base, themeColor, backgroundColor),\n })\n this.emitFile({ type: 'asset', fileName: ICON_FILE, source: iconSvg(app, themeColor) })\n },\n },\n\n transformIndexHtml: {\n order: 'post',\n handler(html: string) {\n const manifestHref = `${base}${MANIFEST_FILE}`\n const link = /<link[^>]+rel=[\"']?manifest/i.test(html)\n ? ''\n : `<link rel=\"manifest\" href=\"${manifestHref}\" />`\n const script = html.includes('serviceWorker.register')\n ? ''\n : registrationScript(`${base}${SW_FILE}`)\n if (!link && !script) return html\n\n const withLink = link ? (insertAfter(html, HEAD_ANCHOR, link) ?? `${link}\\n${html}`) : html\n if (!script) return withLink\n return BODY_END.test(withLink)\n ? withLink.replace(BODY_END, `${script}\\n</body>`)\n : `${withLink}\\n${script}`\n },\n },\n }\n}\n","import { existsSync, readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport type { Plugin } from 'vite'\n\n// ---------------------------------------------------------------------------\n// Boot screen — the first thing painted, from the HTML itself.\n//\n// The React boot screen only exists once React exists, and the wait BEFORE that\n// (fetch the entry chunk, parse it, run it) is the long part of a cold load:\n// the page sat blank for most of the wait. Anything that fills that window has\n// to be in the document the server already sent — markup and CSS the browser\n// can paint on its own, with no module graph behind it.\n//\n// What it paints is the THEME BACKGROUND and a spinner in the middle — light in\n// light mode, dark in dark mode. It used to paint the rail's color edge to\n// edge, but a dark splash in front of a light interface reads as a flash, not\n// a hand-off; the surface the app is about to paint is the only color that\n// disappears into it. It is deliberately the SAME image as AppShellSkeleton in\n// @fayz-ai/ui, so the handoff HTML → React → app never swaps anything the eye\n// can catch.\n//\n// The same inline script also resolves the theme mode before first paint, so a\n// dark-mode reload never flashes a light frame while React boots.\n//\n// It dismisses itself the moment React puts anything in #root.\n// ---------------------------------------------------------------------------\n\nexport interface BootSkeletonOptions {\n /**\n * 'admin' additionally seeds the app's stored palette tokens (sidebar) into\n * the document before React paints, so the console's rail mounts in its own\n * color; 'page' skips that; 'none' injects nothing. Both visible surfaces\n * paint the same background-colored screen. Default: 'admin' when the app\n * depends on @fayz-ai/admin or @fayz-ai/saas and not on @fayz-ai/storefront,\n * 'page' otherwise.\n */\n surface?: 'admin' | 'page' | 'none'\n /** @deprecated The boot screen paints the theme background, not the rail.\n * Accepted and ignored. */\n sidebar?: string\n /** Boot background, light mode. */\n background?: string\n /** Boot background, dark mode. */\n backgroundDark?: string\n}\n\n/** localStorage key the admin writes its resolved palette to, so the NEXT boot\n * paints in the app's own colors instead of the neutral default. */\nexport const BOOT_THEME_STORAGE_KEY = 'fayz:boot-theme'\n\n/** localStorage key the admin theme store writes the chosen mode to\n * ('light' | 'dark' | 'system', default 'light'). Duplicated as a literal on\n * both sides — see persistBootPalette in packages/admin/src/theme/utils.ts:\n * the app runtime must not depend on the build-tool package, and this file\n * must not depend on the admin package. */\nexport const THEME_MODE_STORAGE_KEY = 'saas-core:theme-mode'\n\n/** The same thing under @fayz-ai/ui's own theme store, which is what a\n * storefront or member app runs (packages/ui/src/stores/theme.store.ts). */\nexport const UI_THEME_MODE_STORAGE_KEY = 'fayz-ui:theme-mode'\n\n// The light/dark values of `--background` in @fayz-ai/ui — so React's first\n// real paint changes nothing.\nconst DEFAULT_PAGE = '#f1f1f1'\nconst DEFAULT_PAGE_DARK = '#1a1a1a'\n\nconst RING_ON_DARK = ['rgba(255,255,255,.18)', 'rgba(255,255,255,.7)'] as const\nconst RING_ON_LIGHT = ['rgba(0,0,0,.15)', 'rgba(0,0,0,.55)'] as const\n\n/** Perceived lightness of a hex color, 0-100. Non-hex CSS is assumed light —\n * a dark ring on an unknown surface is the safer miss on a white default. */\nfunction lightnessOf(css: string): number {\n const hex = css.trim().replace('#', '')\n const full = hex.length === 3 ? hex.replace(/./g, (c) => c + c) : hex\n if (!/^[0-9a-f]{6}$/i.test(full)) return 100\n const [r, g, b] = [0, 2, 4].map((i) => parseInt(full.slice(i, i + 2), 16) / 255)\n return ((Math.max(r, g, b) + Math.min(r, g, b)) / 2) * 100\n}\n\nfunction ringTones(background: string): readonly [string, string] {\n return lightnessOf(background) > 55 ? RING_ON_LIGHT : RING_ON_DARK\n}\n\nfunction markup(): string {\n return `<div id=\"fayz-boot\" role=\"status\" aria-live=\"polite\" aria-label=\"Carregando\"><span class=\"fb-spin\"></span></div>`\n}\n\n/** The overlay's own CSS. The `.dark` rule makes the screen correct at the\n * very first paint: the inline script sets the class synchronously before\n * the browser draws. The ring is drawn in rgba rather than a theme token,\n * which could land invisible. */\nfunction style(colors: { light: string; dark: string }): string {\n const [ring, ringLit] = ringTones(colors.light)\n const [darkRing, darkRingLit] = ringTones(colors.dark)\n return `<style id=\"fayz-boot-style\">\n#fayz-boot{--fb-bg:${colors.light};--fb-ring:${ring};--fb-ring-lit:${ringLit};position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;background:var(--fb-bg);opacity:1;transition:opacity .2s ease}\n.dark #fayz-boot{--fb-bg:${colors.dark};--fb-ring:${darkRing};--fb-ring-lit:${darkRingLit}}\n#fayz-boot[data-leaving]{opacity:0;pointer-events:none}\n#fayz-boot .fb-spin{display:block;width:1.75rem;height:1.75rem;border-radius:9999px;border:2px solid var(--fb-ring);border-top-color:var(--fb-ring-lit);animation:fb-spin .7s linear infinite}\n@keyframes fb-spin{to{transform:rotate(360deg)}}\n@media (prefers-reduced-motion:reduce){#fayz-boot .fb-spin{animation:none;border-top-color:var(--fb-ring)}}\n</style>`\n}\n\n/**\n * Resolves the theme mode, seeds the app's stored palette tokens, then removes\n * the whole thing as soon as React fills #root.\n *\n * The mode has to be resolved HERE and not in React: the class that makes the\n * page dark only exists once the theme store runs, which is a whole module\n * graph too late — the browser has already painted a light frame by then.\n *\n * The MutationObserver is the handoff: no import, no callback the app has to\n * remember to call, and it works for any scaffold. The timeout is the safety\n * net — a boot that never mounts must not leave a fixed overlay on top of\n * whatever error the page is trying to show.\n */\nfunction dismissScript(surface: 'admin' | 'page', colors: { light: string; dark: string }): string {\n // Seed the app's own sidebar tokens before the bundle paints: the console's\n // rail (and the React skeleton's spinner) mount BEFORE the theme effect\n // applies the palette, and the default tokens would flash the wrong colors\n // for one theme-effect's worth of frames. applyTheme overwrites these same\n // inline properties on every boot.\n const paletteSeed =\n surface === 'admin'\n ? `\n try{\n var t=JSON.parse(localStorage.getItem('${BOOT_THEME_STORAGE_KEY}')||'null');\n if(t&&t.sidebar){\n de.style.setProperty('--sidebar',t.sidebar);\n if(t.sidebarForeground)de.style.setProperty('--sidebar-foreground',t.sidebarForeground);\n }\n }catch(e){}`\n : ''\n return `<script>(function(){\n var de=document.documentElement,dark=false;\n try{\n var m=localStorage.getItem('${THEME_MODE_STORAGE_KEY}')||localStorage.getItem('${UI_THEME_MODE_STORAGE_KEY}');\n dark=m==='dark'||(m==='system'&&!!window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches);\n }catch(e){}\n de.classList.toggle('dark',dark);\n de.style.colorScheme=dark?'dark':'light';${paletteSeed}\n var boot=document.getElementById('fayz-boot'),root=document.getElementById('root');\n if(!boot)return;\n var meta=document.querySelector('meta[name=\"theme-color\"]');\n if(meta)meta.setAttribute('content',dark?'${colors.dark}':'${colors.light}');\n var gone=false,drop=function(){\n if(gone)return;gone=true;boot.setAttribute('data-leaving','');\n setTimeout(function(){boot.parentNode&&boot.parentNode.removeChild(boot)},250);\n };\n if(!root){drop();return}\n if(root.childNodes.length){drop();return}\n var mo=new MutationObserver(function(){\n if(!root.childNodes.length)return;\n mo.disconnect();\n (window.requestAnimationFrame||setTimeout)(drop);\n });\n mo.observe(root,{childList:true});\n setTimeout(function(){mo.disconnect();drop()},15000);\n})();</script>`\n}\n\n/** True when the app on disk renders an admin console. */\nfunction looksLikeAdminApp(root: string): boolean {\n const pkgPath = resolve(root, 'package.json')\n if (!existsSync(pkgPath)) return false\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')) as {\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n }\n const deps = { ...pkg.dependencies, ...pkg.devDependencies }\n if (deps['@fayz-ai/storefront']) return false\n return Boolean(deps['@fayz-ai/admin'] || deps['@fayz-ai/saas'])\n } catch {\n return false\n }\n}\n\n// The head anchor swallows a leading charset meta if there is one: that\n// declaration has to stay inside the document's first 1024 bytes, and the boot\n// style is most of a kilobyte on its own.\nconst HEAD_ANCHOR = /<head[^>]*>(\\s*<meta[^>]+charset[^>]*>)?/i\nconst BODY_ANCHOR = /<body[^>]*>/i\n\n/** Inserts right after the opening tag, so the overlay paints before whatever\n * the template already had in there. */\nfunction insertAfter(html: string, anchor: RegExp, chunk: string): string | null {\n const match = anchor.exec(html)\n if (!match) return null\n const at = match.index + match[0].length\n return `${html.slice(0, at)}\\n${chunk}${html.slice(at)}`\n}\n\nexport function fayzBootSkeleton(root: string, opts: BootSkeletonOptions = {}): Plugin {\n const surface = opts.surface ?? (looksLikeAdminApp(root) ? 'admin' : 'page')\n // Neutral, not a guess at the brand: @fayz-ai/ui's own background values,\n // which is exactly what the app paints next.\n const colors = {\n light: opts.background ?? DEFAULT_PAGE,\n dark: opts.backgroundDark ?? DEFAULT_PAGE_DARK,\n }\n\n return {\n name: 'fayz:boot-skeleton',\n transformIndexHtml: {\n order: 'post',\n handler(html: string) {\n if (surface === 'none') return html\n if (!html.includes('id=\"root\"')) return html\n\n const hasThemeColor = /<meta[^>]+name=[\"']?theme-color/i.test(html)\n const headChunk = hasThemeColor\n ? style(colors)\n : `<meta name=\"theme-color\" content=\"${colors.light}\" />\\n${style(colors)}`\n const bodyChunk = `${markup()}\\n${dismissScript(surface, colors)}`\n\n const withHead = insertAfter(html, HEAD_ANCHOR, headChunk)\n // No <head> in the template: the style rides along at the top of the\n // body, still ahead of the markup it paints.\n const base = withHead ?? html\n const pending = withHead ? bodyChunk : `${headChunk}\\n${bodyChunk}`\n return insertAfter(base, BODY_ANCHOR, pending) ?? `${base}\\n${pending}`\n },\n },\n }\n}\n","import { existsSync, readdirSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport type { UserConfig, PluginOption, AliasOptions } from 'vite'\nimport { appShellPwa, type AppShellPwaOptions } from './lib/app-shell-pwa'\nimport { fayzBootSkeleton, type BootSkeletonOptions } from './lib/boot-skeleton'\n\nexport { BOOT_THEME_STORAGE_KEY, type BootSkeletonOptions } from './lib/boot-skeleton'\nexport { appShellPwa, type AppShellPwaOptions } from './lib/app-shell-pwa'\n\n/**\n * Every `@fayz-ai/*` package in the checkout, as a Vite alias map (root src).\n * Subpaths (e.g. `@fayz-ai/admin/ui`, `@fayz-ai/storefront/catalog`) resolve\n * automatically via Vite's prefix alias matching — the shim files mirror the\n * subpath under `src/`.\n *\n * Read from disk rather than listed, because a hardcoded list is only correct\n * for the version it shipped in and apps run the INSTALLED `fayzVite`, not this\n * one. That is how the `saas` → `admin` rename half-broke the fleet: `admin`\n * was not in 0.9.0's list, so every app resolved it through the workspace to\n * `packages/admin/dist` — a stale build in the middle of an otherwise\n * source-resolved app, which reads as a bug in the code rather than in the\n * setup. A directory listing cannot go stale.\n */\nfunction sdkAliases(sdkDir: string): Record<string, string> {\n const out: Record<string, string> = {}\n for (const group of ['packages', 'plugins']) {\n const dir = resolve(sdkDir, group)\n if (!existsSync(dir)) continue\n for (const name of readdirSync(dir)) {\n const src = resolve(dir, name, 'src')\n // The directory name is the package name minus the scope, for both groups\n // (packages/admin → @fayz-ai/admin, plugins/plugin-crm → …/plugin-crm).\n if (existsSync(resolve(src, 'index.ts'))) out[`@fayz-ai/${name}`] = src\n }\n }\n return out\n}\n\nexport interface FayzViteOptions {\n /** Dev server port. */\n port?: number\n /** Fail instead of incrementing if the port is taken. */\n strictPort?: boolean\n /** Extra app-specific aliases, merged after the SDK aliases. */\n aliases?: Record<string, string>\n /** Extra Vite plugins, appended after @vitejs/plugin-react. */\n plugins?: PluginOption[]\n /**\n * SDK source location, absolute or relative to the app root\n * (default `../../fayz-sdk`).\n *\n * The `FAYZ_SDK_DIR` environment variable OVERRIDES this — see\n * {@link resolveSdkDir}.\n */\n sdkDir?: string\n /** App root directory (default process.cwd()). */\n root?: string\n /**\n * Extra Vite `server` config, merged over the SDK server defaults. The\n * preview-container contract (host/cors/allowedHosts/headers) is applied\n * first, so an override can add e.g. `proxy` without dropping it.\n */\n server?: UserConfig['server']\n /**\n * Extra Vite `resolve` config, merged over the SDK resolve defaults. The SDK\n * alias map / dedupe / conditions win for `@fayz-ai/*` local-source\n * resolution; any other resolve keys (and extra aliases) are merged in.\n */\n resolve?: UserConfig['resolve']\n /**\n * The shell outline painted into index.html, so the wait for the entry chunk\n * is not a blank page. Auto-detected from the app's dependencies; pass\n * `{ surface: 'none' }` to opt out, or colors to match the app's palette on a\n * first-ever visit (later visits reuse the palette the app itself stored).\n */\n bootSkeleton?: BootSkeletonOptions\n /**\n * The built app precaches itself: a service worker + webmanifest emitted at\n * build time, so a deployed app reloads instantly and still opens with no\n * network. On by default, and build-only by construction — the dev server\n * never registers a worker. Pass `false` to opt out, or an object to name\n * the install / set its colors.\n */\n pwa?: boolean | AppShellPwaOptions\n}\n\n/**\n * Shared Vite config for Fayz dogfood apps. Resolves `@fayz-ai/*` from the local\n * SDK source when it is checked out next to the app AND `FAYZ_SDK_SOURCE` is not\n * `published`; otherwise from node_modules (the Fayz editor sandbox / published\n * npm). Apps no longer hand-maintain alias maps or the local-vs-npm guard.\n *\n * import { defineConfig } from 'vite'\n * import react from '@vitejs/plugin-react'\n * import { fayzVite } from '@fayz-ai/sdk/vite'\n * export default defineConfig(fayzVite({ port: 5185, plugins: [react()] }))\n *\n * Where that local source is read from is {@link resolveSdkDir}: `FAYZ_SDK_DIR`\n * beats the `sdkDir` option beats `../../fayz-sdk`.\n *\n * The app passes its own `@vitejs/plugin-react` so `@fayz-ai/sdk` carries no\n * build-tool peer deps (which otherwise choke npm's peer resolution, since sdk\n * sits in every dependency path).\n */\n/** Env var that redirects local-source resolution to another SDK checkout. */\nexport const FAYZ_SDK_DIR_ENV = 'FAYZ_SDK_DIR'\n\n/**\n * Where the local SDK source is, as an absolute path. Resolution order:\n *\n * 1. `FAYZ_SDK_DIR` (env) — wins, absolute or root-relative\n * 2. `sdkDir` (option) — what the app's vite config declares\n * 3. `../../fayz-sdk` — the sibling-checkout convention\n *\n * Env wins deliberately. `sdkDir` lives in the app's COMMITTED vite config, so\n * without an override there was no way to build, dev or `fayz validate` a\n * store against a different SDK tree (a worktree, a release branch) short of\n * editing that committed file or dropping an untracked config shim next to it\n * — which is exactly what the fleet ended up doing. An env var is the one\n * knob a CLI flag and a container can both set without touching the repo.\n *\n * Exported so the CLI and the tests agree on the precedence by construction\n * rather than by comment.\n */\nexport function resolveSdkDir(\n root: string,\n sdkDir?: string,\n env: Record<string, string | undefined> = process.env,\n): string {\n const fromEnv = env[FAYZ_SDK_DIR_ENV]?.trim()\n return resolve(root, fromEnv || sdkDir || '../../fayz-sdk')\n}\n\n/**\n * Bare deps that only ever appear behind a `React.lazy()` inside an @fayz-ai\n * package. See the `optimizeDeps.include` comment below for why they have to be\n * named. Filtered by what is actually installed, because a plugin the app does\n * not carry leaves its deps uninstalled and `include` hard-fails on those.\n */\nconst LAZY_ONLY_DEPS = ['recharts', '@dnd-kit/core', '@dnd-kit/sortable', '@dnd-kit/modifiers', '@dnd-kit/utilities']\n\n/**\n * Lazy deps an SDK package brings itself, which an app on local source may not\n * have installed yet (it only gets them with the next npm release). Resolved\n * from the checkout and pre-bundled up front, for the same click-time\n * re-optimize reason as LAZY_ONLY_DEPS — otherwise the first export hits\n * \"Outdated Optimize Dep\" in a loop, because the re-optimize runs from the\n * app root and cannot find the module.\n */\nconst SDK_LAZY_DEPS: Array<{ name: string; pkg: string; entry: string }> = [\n { name: 'exceljs', pkg: 'packages/ui', entry: 'dist/exceljs.min.js' },\n]\n\nfunction sdkLazyDeps(root: string, sdk: string): { alias: Record<string, string>; include: string[] } {\n const alias: Record<string, string> = {}\n const include: string[] = []\n for (const dep of SDK_LAZY_DEPS) {\n if (installedDeps(root, [dep.name]).length) { include.push(dep.name); continue }\n const file = resolve(sdk, dep.pkg, 'node_modules', dep.name, dep.entry)\n if (!existsSync(file)) continue\n alias[dep.name] = file\n include.push(dep.name)\n }\n return { alias, include }\n}\n\nfunction installedDeps(root: string, names: string[]): string[] {\n const roots: string[] = []\n for (let dir = root, prev = ''; dir !== prev; prev = dir, dir = resolve(dir, '..')) {\n roots.push(resolve(dir, 'node_modules'))\n }\n return names.filter((name) => roots.some((nm) => existsSync(resolve(nm, name, 'package.json'))))\n}\n\nexport function fayzVite(opts: FayzViteOptions = {}): UserConfig {\n const root = opts.root ?? process.cwd()\n const fayzSdk = resolveSdkDir(root, opts.sdkDir)\n const wantLocal = process.env.FAYZ_SDK_SOURCE !== 'published'\n const localPresent = existsSync(resolve(fayzSdk, 'packages/core/src/index.ts'))\n const useLocal = wantLocal && localPresent\n\n const localAliases = useLocal ? sdkAliases(fayzSdk) : {}\n const sdkLazy = useLocal ? sdkLazyDeps(root, fayzSdk) : { alias: {}, include: [] }\n\n // Pull SDK-owned resolve keys out of any caller override so they can't clobber\n // local-source @fayz-ai/* resolution; the rest of `resolve` is merged in.\n const { alias: userAlias, dedupe: userDedupe, conditions: _ignore, ...restResolve } =\n (opts.resolve ?? {}) as Exclude<UserConfig['resolve'], undefined>\n\n const pwa = opts.pwa ?? true\n // The install colors follow the boot screen's, so the splash, the browser\n // chrome and the first paint are one surface rather than three guesses.\n const pwaPlugins =\n pwa === false\n ? []\n : [\n appShellPwa(root, {\n themeColor: opts.bootSkeleton?.sidebar ?? opts.bootSkeleton?.background,\n backgroundColor: opts.bootSkeleton?.background ?? opts.bootSkeleton?.sidebar,\n ...(pwa === true ? {} : pwa),\n }),\n ]\n\n return {\n plugins: [...(opts.plugins ?? []), fayzBootSkeleton(root, opts.bootSkeleton), ...pwaPlugins],\n envPrefix: ['VITE_', 'PUBLIC_'],\n resolve: {\n ...restResolve,\n alias: {\n '@': resolve(root, 'src'),\n ...localAliases,\n ...sdkLazy.alias,\n ...(opts.aliases ?? {}),\n ...((userAlias as Record<string, string> | undefined) ?? {}),\n } as AliasOptions,\n // lucide-react is a direct dep of both the app and every @fayz-ai/*\n // package; without dedupe a version skew installs two copies and esbuild\n // pre-bundles each barrel separately (~1,500 icon modules each).\n // Collapsing to one copy is the single biggest cut to the editor-container\n // optimize RAM/CPU spike. Only dedupe deps the *app* directly depends on\n // (so they're hoisted to its root node_modules) — deduping a transitive\n // like @tanstack/react-table makes Vite resolve it from the app root,\n // which fails in local-source mode and 500s the aliased UI source.\n //\n // @fullcalendar/* is here for a different reason: plugin-agenda and the\n // app each carry a copy, and only the app's has `premium-common`. Split\n // across two copies, the resource views register their ScrollGrid into a\n // `core` the calendar is not the instance of, and the week grid dies with\n // \"No ScrollGrid implementation\" — a failure that only surfaces after the\n // dep cache is cleared, so it reads as random.\n dedupe: userDedupe ?? [\n 'react', 'react-dom', 'zustand', 'lucide-react', 'react-router-dom',\n '@supabase/supabase-js', 'sonner',\n '@fullcalendar/core', '@fullcalendar/react', '@fullcalendar/daygrid',\n '@fullcalendar/timegrid', '@fullcalendar/list', '@fullcalendar/interaction',\n '@fullcalendar/premium-common', '@fullcalendar/resource',\n '@fullcalendar/resource-daygrid', '@fullcalendar/resource-timegrid',\n ],\n conditions: useLocal ? ['source', 'browser', 'module', 'jsnext:main', 'jsnext'] : undefined,\n },\n optimizeDeps: {\n exclude: useLocal ? Object.keys(localAliases) : [],\n // Excluding @fayz-ai/* also hides THEIR bare deps from Vite's initial\n // scan. A dep that first appears behind a React.lazy() is then discovered\n // at click time, and the re-optimize that follows kills the very imports\n // that triggered it — the screen fails with \"Failed to fetch dynamically\n // imported module\" (recharts: every chart at once; @dnd-kit: the forms\n // builder). Naming them keeps the exclude that keeps SDK source hot.\n include: useLocal ? [...installedDeps(root, LAZY_ONLY_DEPS), ...sdkLazy.include] : undefined,\n },\n // The preview-container runtime contract: Vite's host-check 403s any\n // non-local Host (browser iframe via Caddy, health probe via\n // host.docker.internal) unless allowedHosts is set. host/cors/headers keep\n // the proxied iframe + cross-origin asset fetches working. Owned here\n // because the app's vite.config has no literal `server: {` for the\n // container's text patchers to anchor on. Caller `server` merges last.\n server: {\n host: true,\n port: opts.port,\n strictPort: opts.strictPort,\n cors: true,\n allowedHosts: true,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Cross-Origin-Resource-Policy': 'cross-origin',\n },\n fs: { allow: [root, fayzSdk] },\n ...(opts.server ?? {}),\n },\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/lib/app-shell-pwa.ts","../src/lib/boot-skeleton.ts","../src/vite.ts"],"names":["identity","lightnessOf","resolve","existsSync","readFileSync","HEAD_ANCHOR","insertAfter"],"mappings":";;;;;AAoCA,IAAM,OAAA,GAAU,OAAA;AAChB,IAAM,YAAA,GAAe,UAAA;AACrB,IAAM,aAAA,GAAgB,sBAAA;AACtB,IAAM,SAAA,GAAY,UAAA;AAIlB,IAAM,YAAA,GAAe,YAAA;AAIrB,IAAM,aAAA,GAAgB,SAAA;AACtB,IAAM,kBAAA,GAAqB,SAAA;AAQ3B,SAAS,YAAY,GAAA,EAAqB;AACxC,EAAA,MAAM,MAAM,GAAA,CAAI,IAAA,EAAK,CAAE,OAAA,CAAQ,KAAK,EAAE,CAAA;AACtC,EAAA,MAAM,IAAA,GAAO,GAAA,CAAI,MAAA,KAAW,CAAA,GAAI,GAAA,CAAI,OAAA,CAAQ,IAAA,EAAM,CAAC,CAAA,KAAM,CAAA,GAAI,CAAC,CAAA,GAAI,GAAA;AAClE,EAAA,IAAI,CAAC,gBAAA,CAAiB,IAAA,CAAK,IAAI,GAAG,OAAO,GAAA;AACzC,EAAA,MAAM,CAAC,GAAG,CAAA,EAAG,CAAC,IAAI,CAAC,CAAA,EAAG,CAAA,EAAG,CAAC,CAAA,CAAE,GAAA,CAAI,CAAC,CAAA,KAAM,QAAA,CAAS,KAAK,KAAA,CAAM,CAAA,EAAG,IAAI,CAAC,CAAA,EAAG,EAAE,CAAA,GAAI,GAAG,CAAA;AAC/E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AAA;AAAA,MACN,YAAA,EAAc,IAAA;AAAA,MACd,OAAA,EAAS;AAAA,QACP,6BAAA,EAA+B,GAAA;AAAA,QAC/B,8BAAA,EAAgC;AAAA,OAClC;AAAA,MACA,IAAI,EAAE,KAAA,EAAO,CAAC,IAAA,EAAM,OAAO,CAAA,EAAE;AAAA,MAC7B,GAAI,IAAA,CAAK,MAAA,IAAU;AAAC;AACtB,GACF;AACF","file":"vite.js","sourcesContent":["import { createHash } from 'node:crypto'\nimport { existsSync, readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport type { Plugin } from 'vite'\n\n// ---------------------------------------------------------------------------\n// App shell, cached — the second load, and every load after it.\n//\n// The boot screen fixes the blank page; it does not fix the WAIT. A deployed\n// app still fetches its entry chunk over the network every single time, and on\n// a phone on café wifi that is the whole perceived cost of \"opening the app\".\n// A service worker that precaches the build turns the shell into something the\n// device already has: reload is instant, and a dropped connection still gets\n// the app (its own data is another story — see the fetch rules below).\n//\n// Hand-rolled on purpose. What we need is a precache list, a cache name and\n// three event listeners — about a page of JavaScript, against a build-time\n// dependency the preview container would have to cold-install on every start.\n//\n// Build only. A dev server that installs a service worker serves yesterday's\n// bundle to a developer who just saved a file, and the confusion costs more\n// than the caching saves.\n// ---------------------------------------------------------------------------\n\nexport interface AppShellPwaOptions {\n /** Install name. Default: the app's package.json name, de-scoped and titled. */\n name?: string\n /** Home-screen label, ideally ≤12 chars. Default: derived from `name`. */\n shortName?: string\n /** Browser chrome / icon color. Default: the boot screen's neutral rail. */\n themeColor?: string\n /** Splash background while the app boots. Default: the boot screen's page. */\n backgroundColor?: string\n}\n\n/** The emitted file names, at the bundle root (not under assets/). */\nconst SW_FILE = 'sw.js'\nconst HEADERS_FILE = '_headers'\nconst MANIFEST_FILE = 'manifest.webmanifest'\nconst ICON_FILE = 'icon.svg'\n\n/** Every cache this SW owns is `<prefix><build id>`, so activate can tell its\n * own stale generations apart from caches belonging to anything else. */\nconst CACHE_PREFIX = 'app-shell-'\n\n// The same neutral defaults the boot screen paints with (see boot-skeleton.ts),\n// so the manifest, the theme-color meta and the first paint agree.\nconst DEFAULT_THEME = '#131c26'\nconst DEFAULT_BACKGROUND = '#f1f1f1'\n\ninterface AppIdentity {\n name: string\n shortName: string\n}\n\n/** Perceived lightness of a hex color, 0-100; non-hex is assumed light. */\nfunction lightnessOf(css: string): number {\n const hex = css.trim().replace('#', '')\n const full = hex.length === 3 ? hex.replace(/./g, (c) => c + c) : hex\n if (!/^[0-9a-f]{6}$/i.test(full)) return 100\n const [r, g, b] = [0, 2, 4].map((i) => parseInt(full.slice(i, i + 2), 16) / 255)\n return ((Math.max(r, g, b) + Math.min(r, g, b)) / 2) * 100\n}\n\nfunction readPackageName(root: string): string | undefined {\n const pkgPath = resolve(root, 'package.json')\n if (!existsSync(pkgPath)) return undefined\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')) as { name?: string }\n return pkg.name\n } catch {\n return undefined\n }\n}\n\n/** `@acme/beauty-saas` → `Beauty Saas`. Good enough for a home-screen label,\n * and `name` overrides it whenever the app cares. */\nfunction titleize(pkgName: string): string {\n const bare = pkgName.replace(/^@[^/]+\\//, '')\n return (\n bare\n .split(/[-_.\\s]+/)\n .filter(Boolean)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ') || bare\n )\n}\n\nfunction identity(root: string, opts: AppShellPwaOptions): AppIdentity {\n const pkgName = readPackageName(root)\n const name = opts.name ?? (pkgName ? titleize(pkgName) : 'App')\n const shortName = opts.shortName ?? (name.length <= 12 ? name : name.split(' ')[0].slice(0, 12))\n return { name, shortName }\n}\n\n/** A maskable mark: rounded square in the theme color, app initial on top.\n * The glyph stays well inside the 80% safe zone, so a circular mask on\n * Android does not clip it. PNG sizes are a follow-up. */\nfunction iconSvg(identity: AppIdentity, themeColor: string): string {\n const initial = (identity.name.match(/[a-z0-9]/i)?.[0] ?? 'A').toUpperCase()\n const ink = lightnessOf(themeColor) > 55 ? '#111111' : '#ffffff'\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" width=\"512\" height=\"512\" role=\"img\" aria-label=\"${escapeXml(identity.name)}\">\n<rect width=\"512\" height=\"512\" rx=\"112\" fill=\"${themeColor}\"/>\n<text x=\"256\" y=\"256\" fill=\"${ink}\" font-family=\"system-ui,-apple-system,'Segoe UI',sans-serif\" font-size=\"232\" font-weight=\"600\" text-anchor=\"middle\" dominant-baseline=\"central\">${escapeXml(initial)}</text>\n</svg>\n`\n}\n\nfunction escapeXml(value: string): string {\n return value.replace(/[<>&\"']/g, (c) => `&#${c.charCodeAt(0)};`)\n}\n\nfunction manifestJson(\n identity: AppIdentity,\n base: string,\n themeColor: string,\n backgroundColor: string,\n): string {\n return `${JSON.stringify(\n {\n name: identity.name,\n short_name: identity.shortName,\n start_url: base,\n scope: base,\n display: 'standalone',\n theme_color: themeColor,\n background_color: backgroundColor,\n icons: [\n {\n src: `${base}${ICON_FILE}`,\n sizes: 'any',\n type: 'image/svg+xml',\n purpose: 'any maskable',\n },\n ],\n },\n null,\n 2,\n )}\\n`\n}\n\n/**\n * The worker itself, as plain JS with the build's precache list baked in.\n *\n * Caching rules, in the order the fetch handler applies them:\n * - non-GET, or cross-origin → untouched, the network answers\n * - navigation → network first, cached index.html offline\n * - a precached (hashed) asset → cache first, it can never go stale\n * - anything else same-origin → untouched (API reads/writes land here)\n *\n * The last rule is the important one: Supabase and every other API call goes\n * straight to the network, always. A service worker that answers a data\n * request from cache shows the user a number that is quietly wrong, which is\n * worse than an error.\n *\n * ── a troca de versão ──────────────────────────────────────────────────────\n *\n * There is no UNCONDITIONAL `skipWaiting`, and that part was right: a tab in\n * the middle of a form must never have its code swapped underneath it.\n *\n * What was wrong is what came with it. Without skipWaiting the new worker sits\n * in `waiting` until every tab of the origin is CLOSED — not reloaded, closed.\n * F5 on a controlled page does not replace the worker. So a deploy reached the\n * edge and did not reach the person, and the only gesture they knew that did\n * replace it was \"clear the browser cache\", because that unregisters the\n * worker. We were teaching non-technical users to clear site data on every\n * release.\n *\n * So the worker now skips waiting ON REQUEST — `postMessage('skip-waiting')`\n * — and the page asks first. The decision is the person's, taken in one click,\n * with the form still on screen. It is the Workbox pattern, and it is the only\n * one that keeps both halves: no silent swap, no cache ritual.\n */\nfunction serviceWorkerSource(buildId: string, shell: string, precache: string[]): string {\n return `// Generated by @fayz-ai/sdk at build time. Do not edit.\nconst BUILD_ID = ${JSON.stringify(buildId)};\nconst CACHE = ${JSON.stringify(CACHE_PREFIX)} + BUILD_ID;\nconst SHELL = ${JSON.stringify(shell)};\nconst PRECACHE = ${JSON.stringify(precache, null, 2)};\nconst PRECACHED = new Set(PRECACHE);\n\nself.addEventListener('install', function (event) {\n event.waitUntil(\n caches.open(CACHE).then(function (cache) {\n // One request at a time and forgiving: a single 404 must not void the\n // whole precache the way cache.addAll() would.\n return Promise.all(\n PRECACHE.map(function (url) {\n return cache.add(new Request(url, { cache: 'reload' })).catch(function () {});\n })\n );\n })\n );\n});\n\nself.addEventListener('activate', function (event) {\n event.waitUntil(\n caches\n .keys()\n .then(function (keys) {\n return Promise.all(\n keys\n .filter(function (key) {\n return key.indexOf(${JSON.stringify(CACHE_PREFIX)}) === 0 && key !== CACHE;\n })\n .map(function (key) {\n return caches.delete(key);\n })\n );\n })\n .then(function () {\n return self.clients.claim();\n })\n );\n});\n\n// The ONLY way to take over early, and it comes from outside. The page asks;\n// if the person says yes, it sends this message. Without it the behaviour is\n// what it always was: install quietly, take over when allowed.\nself.addEventListener('message', function (event) {\n if (event.data === 'skip-waiting') self.skipWaiting();\n});\n\nself.addEventListener('fetch', function (event) {\n var request = event.request;\n if (request.method !== 'GET') return;\n var url;\n try {\n url = new URL(request.url);\n } catch (e) {\n return;\n }\n if (url.origin !== self.location.origin) return;\n\n if (request.mode === 'navigate') {\n event.respondWith(\n fetch(request).catch(function () {\n return caches.match(SHELL, { cacheName: CACHE }).then(function (hit) {\n return hit || Response.error();\n });\n })\n );\n return;\n }\n\n // Only the build's own hashed assets, which are immutable by construction.\n // Everything else same-origin (API calls above all) is left to the network.\n if (!PRECACHED.has(url.pathname)) return;\n event.respondWith(\n caches.match(request, { cacheName: CACHE }).then(function (hit) {\n return hit || fetch(request);\n })\n );\n});\n`\n}\n\nconst HEAD_ANCHOR = /<head[^>]*>/i\nconst BODY_END = /<\\/body>/i\n\nfunction insertAfter(html: string, anchor: RegExp, chunk: string): string | null {\n const match = anchor.exec(html)\n if (!match) return null\n const at = match.index + match[0].length\n return `${html.slice(0, at)}\\n${chunk}${html.slice(at)}`\n}\n\n/**\n * Registra o worker E avisa a página quando há versão nova esperando.\n *\n * O aviso é um `CustomEvent` no `window`, não um import: este script é uma\n * tag inline no HTML, roda antes de qualquer bundle, e não pode depender de\n * React nem de nada que o app monte depois. Quem quiser desenhar o convite\n * escuta `fayz:update-ready`; quem não escutar não ganha comportamento\n * nenhum — a versão nova continua entrando na próxima visita, como antes.\n *\n * `window.fayzApplyUpdate()` é a outra metade: manda o worker assumir e\n * recarrega quando ele assumir. Recarregar no `controllerchange` e não no\n * clique é o que garante que a página que volta é a NOVA — recarregar antes\n * pega o worker velho de novo e o convite reaparece, que é a falha que faz o\n * usuário clicar três vezes e desistir.\n *\n * `reloading` existe porque o Chrome dispara `controllerchange` mais de uma\n * vez quando há abas irmãs, e dois `location.reload()` numa mesma navegação\n * deixam a aba piscando.\n */\nfunction registrationScript(swUrl: string): string {\n const source = `\nif ('serviceWorker' in navigator) {\n addEventListener('load', function () {\n navigator.serviceWorker.register('${swUrl}').then(function (reg) {\n var reloading = false;\n navigator.serviceWorker.addEventListener('controllerchange', function () {\n if (reloading) return;\n reloading = true;\n location.reload();\n });\n window.fayzApplyUpdate = function () {\n if (reg.waiting) reg.waiting.postMessage('skip-waiting');\n };\n function announce() {\n // Only when a controller ALREADY exists: without one this is a first\n // visit, the worker is installing for the first time and there is no\n // \"new version\" to offer — announcing here would ask someone to\n // reload a page they just opened.\n if (reg.waiting && navigator.serviceWorker.controller) {\n dispatchEvent(new CustomEvent('fayz:update-ready'));\n }\n }\n announce();\n reg.addEventListener('updatefound', function () {\n var sw = reg.installing;\n if (!sw) return;\n sw.addEventListener('statechange', function () {\n if (sw.state === 'installed') announce();\n });\n });\n // A tab left open all day never re-checks the worker on its own. Hourly\n // is cheap (a conditional GET of a few KB) and it is what gets the\n // invitation to the people who never close the browser.\n setInterval(function () { reg.update().catch(function () {}); }, 3600000);\n }).catch(function () {});\n });\n}`.trim()\n return `<script>${source}</script>`\n}\n\n/** What goes in the precache list: the build's own output, minus the things a\n * cache has no use for (sourcemaps, the worker itself, other HTML). */\nfunction isPrecacheable(fileName: string): boolean {\n if (fileName === SW_FILE || fileName === MANIFEST_FILE) return false\n return !fileName.endsWith('.map') && !fileName.endsWith('.html')\n}\n\n\n/**\n * The HOST's cache rules, which the worker alone cannot reach.\n *\n * Cloudflare (Pages and Workers Static Assets) reads `_headers` from the\n * published directory. Without one the default is `max-age=0,\n * must-revalidate` for EVERYTHING — including `/assets/app-BzniUHZd.js`,\n * whose name carries the hash of its content and therefore can never change\n * content. The result is revalidating several megabytes on every load, for\n * nothing, to confirm what the name already proved.\n *\n * The inverse is what has to stay volatile:\n *\n * index.html is the map to the build's hashes; serving it stale serves\n * the whole stale build, and is the one way a deploy fails to\n * reach someone who has visited before.\n * sw.js is what replaces the worker. Cached, a new version would\n * never be discovered. (Browsers already cap this one at 24h\n * on their own; saying `no-cache` removes the doubt.)\n */\nfunction headersSource(base: string): string {\n return [\n `${base}assets/*`,\n ' Cache-Control: public, max-age=31536000, immutable',\n '',\n `${base}${SW_FILE}`,\n ' Cache-Control: no-cache',\n '',\n `${base}index.html`,\n ' Cache-Control: no-cache',\n '',\n ].join('\\n')\n}\n\nexport function appShellPwa(root: string, opts: AppShellPwaOptions = {}): Plugin {\n const app = identity(root, opts)\n const themeColor = opts.themeColor ?? DEFAULT_THEME\n const backgroundColor = opts.backgroundColor ?? DEFAULT_BACKGROUND\n // Deployments under a subpath exist (preview containers, docs sites); every\n // emitted URL is base-relative so `/` is just the common case.\n let base = '/'\n\n return {\n name: 'fayz:app-shell-pwa',\n apply: 'build',\n\n configResolved(config) {\n base = config.base || '/'\n if (!base.endsWith('/')) base += '/'\n },\n\n generateBundle: {\n order: 'post',\n handler(_options, bundle) {\n const precache = Object.keys(bundle)\n .filter(isPrecacheable)\n .sort()\n .map((fileName) => `${base}${fileName}`)\n const shell = `${base}index.html`\n precache.unshift(shell)\n\n // The index.html source joins the hash: its asset names already change\n // per build, but its INLINE content (boot screen, meta) can change on\n // its own, and a shell served from an old cache would be that content.\n const indexAsset = bundle['index.html']\n const indexSource =\n indexAsset && indexAsset.type === 'asset' ? String(indexAsset.source) : ''\n const buildId = createHash('sha256')\n .update(precache.join('\\n'))\n .update(indexSource)\n .digest('hex')\n .slice(0, 12)\n\n this.emitFile({\n type: 'asset',\n fileName: SW_FILE,\n source: serviceWorkerSource(buildId, shell, precache),\n })\n this.emitFile({\n type: 'asset',\n fileName: HEADERS_FILE,\n source: headersSource(base),\n })\n this.emitFile({\n type: 'asset',\n fileName: MANIFEST_FILE,\n source: manifestJson(app, base, themeColor, backgroundColor),\n })\n this.emitFile({ type: 'asset', fileName: ICON_FILE, source: iconSvg(app, themeColor) })\n },\n },\n\n transformIndexHtml: {\n order: 'post',\n handler(html: string) {\n const manifestHref = `${base}${MANIFEST_FILE}`\n const link = /<link[^>]+rel=[\"']?manifest/i.test(html)\n ? ''\n : `<link rel=\"manifest\" href=\"${manifestHref}\" />`\n const script = html.includes('serviceWorker.register')\n ? ''\n : registrationScript(`${base}${SW_FILE}`)\n if (!link && !script) return html\n\n const withLink = link ? (insertAfter(html, HEAD_ANCHOR, link) ?? `${link}\\n${html}`) : html\n if (!script) return withLink\n return BODY_END.test(withLink)\n ? withLink.replace(BODY_END, `${script}\\n</body>`)\n : `${withLink}\\n${script}`\n },\n },\n }\n}\n","import { existsSync, readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport type { Plugin } from 'vite'\n\n// ---------------------------------------------------------------------------\n// Boot screen — the first thing painted, from the HTML itself.\n//\n// The React boot screen only exists once React exists, and the wait BEFORE that\n// (fetch the entry chunk, parse it, run it) is the long part of a cold load:\n// the page sat blank for most of the wait. Anything that fills that window has\n// to be in the document the server already sent — markup and CSS the browser\n// can paint on its own, with no module graph behind it.\n//\n// What it paints is the THEME BACKGROUND and a spinner in the middle — light in\n// light mode, dark in dark mode. It used to paint the rail's color edge to\n// edge, but a dark splash in front of a light interface reads as a flash, not\n// a hand-off; the surface the app is about to paint is the only color that\n// disappears into it. It is deliberately the SAME image as AppShellSkeleton in\n// @fayz-ai/ui, so the handoff HTML → React → app never swaps anything the eye\n// can catch.\n//\n// The same inline script also resolves the theme mode before first paint, so a\n// dark-mode reload never flashes a light frame while React boots.\n//\n// It dismisses itself the moment React puts anything in #root.\n// ---------------------------------------------------------------------------\n\nexport interface BootSkeletonOptions {\n /**\n * 'admin' additionally seeds the app's stored palette tokens (sidebar) into\n * the document before React paints, so the console's rail mounts in its own\n * color; 'page' skips that; 'none' injects nothing. Both visible surfaces\n * paint the same background-colored screen. Default: 'admin' when the app\n * depends on @fayz-ai/admin or @fayz-ai/saas and not on @fayz-ai/storefront,\n * 'page' otherwise.\n */\n surface?: 'admin' | 'page' | 'none'\n /** @deprecated The boot screen paints the theme background, not the rail.\n * Accepted and ignored. */\n sidebar?: string\n /** Boot background, light mode. */\n background?: string\n /** Boot background, dark mode. */\n backgroundDark?: string\n}\n\n/** localStorage key the admin writes its resolved palette to, so the NEXT boot\n * paints in the app's own colors instead of the neutral default. */\nexport const BOOT_THEME_STORAGE_KEY = 'fayz:boot-theme'\n\n/** localStorage key the admin theme store writes the chosen mode to\n * ('light' | 'dark' | 'system', default 'light'). Duplicated as a literal on\n * both sides — see persistBootPalette in packages/admin/src/theme/utils.ts:\n * the app runtime must not depend on the build-tool package, and this file\n * must not depend on the admin package. */\nexport const THEME_MODE_STORAGE_KEY = 'saas-core:theme-mode'\n\n/** The same thing under @fayz-ai/ui's own theme store, which is what a\n * storefront or member app runs (packages/ui/src/stores/theme.store.ts). */\nexport const UI_THEME_MODE_STORAGE_KEY = 'fayz-ui:theme-mode'\n\n// The light/dark values of `--background` in @fayz-ai/ui — so React's first\n// real paint changes nothing.\nconst DEFAULT_PAGE = '#f1f1f1'\nconst DEFAULT_PAGE_DARK = '#1a1a1a'\n\nconst RING_ON_DARK = ['rgba(255,255,255,.18)', 'rgba(255,255,255,.7)'] as const\nconst RING_ON_LIGHT = ['rgba(0,0,0,.15)', 'rgba(0,0,0,.55)'] as const\n\n/** Perceived lightness of a hex color, 0-100. Non-hex CSS is assumed light —\n * a dark ring on an unknown surface is the safer miss on a white default. */\nfunction lightnessOf(css: string): number {\n const hex = css.trim().replace('#', '')\n const full = hex.length === 3 ? hex.replace(/./g, (c) => c + c) : hex\n if (!/^[0-9a-f]{6}$/i.test(full)) return 100\n const [r, g, b] = [0, 2, 4].map((i) => parseInt(full.slice(i, i + 2), 16) / 255)\n return ((Math.max(r, g, b) + Math.min(r, g, b)) / 2) * 100\n}\n\nfunction ringTones(background: string): readonly [string, string] {\n return lightnessOf(background) > 55 ? RING_ON_LIGHT : RING_ON_DARK\n}\n\nfunction markup(): string {\n return `<div id=\"fayz-boot\" role=\"status\" aria-live=\"polite\" aria-label=\"Carregando\"><span class=\"fb-spin\"></span></div>`\n}\n\n/** The overlay's own CSS. The `.dark` rule makes the screen correct at the\n * very first paint: the inline script sets the class synchronously before\n * the browser draws. The ring is drawn in rgba rather than a theme token,\n * which could land invisible. */\nfunction style(colors: { light: string; dark: string }): string {\n const [ring, ringLit] = ringTones(colors.light)\n const [darkRing, darkRingLit] = ringTones(colors.dark)\n return `<style id=\"fayz-boot-style\">\n#fayz-boot{--fb-bg:${colors.light};--fb-ring:${ring};--fb-ring-lit:${ringLit};position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;background:var(--fb-bg);opacity:1;transition:opacity .2s ease}\n.dark #fayz-boot{--fb-bg:${colors.dark};--fb-ring:${darkRing};--fb-ring-lit:${darkRingLit}}\n#fayz-boot[data-leaving]{opacity:0;pointer-events:none}\n#fayz-boot .fb-spin{display:block;width:1.75rem;height:1.75rem;border-radius:9999px;border:2px solid var(--fb-ring);border-top-color:var(--fb-ring-lit);animation:fb-spin .7s linear infinite}\n@keyframes fb-spin{to{transform:rotate(360deg)}}\n@media (prefers-reduced-motion:reduce){#fayz-boot .fb-spin{animation:none;border-top-color:var(--fb-ring)}}\n</style>`\n}\n\n/**\n * Resolves the theme mode, seeds the app's stored palette tokens, then removes\n * the whole thing as soon as React fills #root.\n *\n * The mode has to be resolved HERE and not in React: the class that makes the\n * page dark only exists once the theme store runs, which is a whole module\n * graph too late — the browser has already painted a light frame by then.\n *\n * The MutationObserver is the handoff: no import, no callback the app has to\n * remember to call, and it works for any scaffold. The timeout is the safety\n * net — a boot that never mounts must not leave a fixed overlay on top of\n * whatever error the page is trying to show.\n */\nfunction dismissScript(surface: 'admin' | 'page', colors: { light: string; dark: string }): string {\n // Seed the app's own sidebar tokens before the bundle paints: the console's\n // rail (and the React skeleton's spinner) mount BEFORE the theme effect\n // applies the palette, and the default tokens would flash the wrong colors\n // for one theme-effect's worth of frames. applyTheme overwrites these same\n // inline properties on every boot.\n const paletteSeed =\n surface === 'admin'\n ? `\n try{\n var t=JSON.parse(localStorage.getItem('${BOOT_THEME_STORAGE_KEY}')||'null');\n if(t&&t.sidebar){\n de.style.setProperty('--sidebar',t.sidebar);\n if(t.sidebarForeground)de.style.setProperty('--sidebar-foreground',t.sidebarForeground);\n }\n }catch(e){}`\n : ''\n return `<script>(function(){\n var de=document.documentElement,dark=false;\n try{\n var m=localStorage.getItem('${THEME_MODE_STORAGE_KEY}')||localStorage.getItem('${UI_THEME_MODE_STORAGE_KEY}');\n dark=m==='dark'||(m==='system'&&!!window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches);\n }catch(e){}\n de.classList.toggle('dark',dark);\n de.style.colorScheme=dark?'dark':'light';${paletteSeed}\n var boot=document.getElementById('fayz-boot'),root=document.getElementById('root');\n if(!boot)return;\n var meta=document.querySelector('meta[name=\"theme-color\"]');\n if(meta)meta.setAttribute('content',dark?'${colors.dark}':'${colors.light}');\n var gone=false,drop=function(){\n if(gone)return;gone=true;boot.setAttribute('data-leaving','');\n setTimeout(function(){boot.parentNode&&boot.parentNode.removeChild(boot)},250);\n };\n if(!root){drop();return}\n if(root.childNodes.length){drop();return}\n var mo=new MutationObserver(function(){\n if(!root.childNodes.length)return;\n mo.disconnect();\n (window.requestAnimationFrame||setTimeout)(drop);\n });\n mo.observe(root,{childList:true});\n setTimeout(function(){mo.disconnect();drop()},15000);\n})();</script>`\n}\n\n/** True when the app on disk renders an admin console. */\nfunction looksLikeAdminApp(root: string): boolean {\n const pkgPath = resolve(root, 'package.json')\n if (!existsSync(pkgPath)) return false\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')) as {\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n }\n const deps = { ...pkg.dependencies, ...pkg.devDependencies }\n if (deps['@fayz-ai/storefront']) return false\n return Boolean(deps['@fayz-ai/admin'] || deps['@fayz-ai/saas'])\n } catch {\n return false\n }\n}\n\n// The head anchor swallows a leading charset meta if there is one: that\n// declaration has to stay inside the document's first 1024 bytes, and the boot\n// style is most of a kilobyte on its own.\nconst HEAD_ANCHOR = /<head[^>]*>(\\s*<meta[^>]+charset[^>]*>)?/i\nconst BODY_ANCHOR = /<body[^>]*>/i\n\n/** Inserts right after the opening tag, so the overlay paints before whatever\n * the template already had in there. */\nfunction insertAfter(html: string, anchor: RegExp, chunk: string): string | null {\n const match = anchor.exec(html)\n if (!match) return null\n const at = match.index + match[0].length\n return `${html.slice(0, at)}\\n${chunk}${html.slice(at)}`\n}\n\nexport function fayzBootSkeleton(root: string, opts: BootSkeletonOptions = {}): Plugin {\n const surface = opts.surface ?? (looksLikeAdminApp(root) ? 'admin' : 'page')\n // Neutral, not a guess at the brand: @fayz-ai/ui's own background values,\n // which is exactly what the app paints next.\n const colors = {\n light: opts.background ?? DEFAULT_PAGE,\n dark: opts.backgroundDark ?? DEFAULT_PAGE_DARK,\n }\n\n return {\n name: 'fayz:boot-skeleton',\n transformIndexHtml: {\n order: 'post',\n handler(html: string) {\n if (surface === 'none') return html\n if (!html.includes('id=\"root\"')) return html\n\n const hasThemeColor = /<meta[^>]+name=[\"']?theme-color/i.test(html)\n const headChunk = hasThemeColor\n ? style(colors)\n : `<meta name=\"theme-color\" content=\"${colors.light}\" />\\n${style(colors)}`\n const bodyChunk = `${markup()}\\n${dismissScript(surface, colors)}`\n\n const withHead = insertAfter(html, HEAD_ANCHOR, headChunk)\n // No <head> in the template: the style rides along at the top of the\n // body, still ahead of the markup it paints.\n const base = withHead ?? html\n const pending = withHead ? bodyChunk : `${headChunk}\\n${bodyChunk}`\n return insertAfter(base, BODY_ANCHOR, pending) ?? `${base}\\n${pending}`\n },\n },\n }\n}\n","import { existsSync, readdirSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport type { UserConfig, PluginOption, AliasOptions } from 'vite'\nimport { appShellPwa, type AppShellPwaOptions } from './lib/app-shell-pwa'\nimport { fayzBootSkeleton, type BootSkeletonOptions } from './lib/boot-skeleton'\n\nexport { BOOT_THEME_STORAGE_KEY, type BootSkeletonOptions } from './lib/boot-skeleton'\nexport { appShellPwa, type AppShellPwaOptions } from './lib/app-shell-pwa'\n\n/**\n * Every `@fayz-ai/*` package in the checkout, as a Vite alias map (root src).\n * Subpaths (e.g. `@fayz-ai/admin/ui`, `@fayz-ai/storefront/catalog`) resolve\n * automatically via Vite's prefix alias matching — the shim files mirror the\n * subpath under `src/`.\n *\n * Read from disk rather than listed, because a hardcoded list is only correct\n * for the version it shipped in and apps run the INSTALLED `fayzVite`, not this\n * one. That is how the `saas` → `admin` rename half-broke the fleet: `admin`\n * was not in 0.9.0's list, so every app resolved it through the workspace to\n * `packages/admin/dist` — a stale build in the middle of an otherwise\n * source-resolved app, which reads as a bug in the code rather than in the\n * setup. A directory listing cannot go stale.\n */\nfunction sdkAliases(sdkDir: string): Record<string, string> {\n const out: Record<string, string> = {}\n for (const group of ['packages', 'plugins']) {\n const dir = resolve(sdkDir, group)\n if (!existsSync(dir)) continue\n for (const name of readdirSync(dir)) {\n const src = resolve(dir, name, 'src')\n // The directory name is the package name minus the scope, for both groups\n // (packages/admin → @fayz-ai/admin, plugins/plugin-crm → …/plugin-crm).\n // A bounded context has no index.ts — it exports every module — so src/ itself is the test.\n if (existsSync(src)) out[`@fayz-ai/${name}`] = src\n }\n }\n return out\n}\n\nexport interface FayzViteOptions {\n /** Dev server port. */\n port?: number\n /** Fail instead of incrementing if the port is taken. */\n strictPort?: boolean\n /** Extra app-specific aliases, merged after the SDK aliases. */\n aliases?: Record<string, string>\n /** Extra Vite plugins, appended after @vitejs/plugin-react. */\n plugins?: PluginOption[]\n /**\n * SDK source location, absolute or relative to the app root\n * (default `../../fayz-sdk`).\n *\n * The `FAYZ_SDK_DIR` environment variable OVERRIDES this — see\n * {@link resolveSdkDir}.\n */\n sdkDir?: string\n /** App root directory (default process.cwd()). */\n root?: string\n /**\n * Extra Vite `server` config, merged over the SDK server defaults. The\n * preview-container contract (host/cors/allowedHosts/headers) is applied\n * first, so an override can add e.g. `proxy` without dropping it.\n */\n server?: UserConfig['server']\n /**\n * Extra Vite `resolve` config, merged over the SDK resolve defaults. The SDK\n * alias map / dedupe / conditions win for `@fayz-ai/*` local-source\n * resolution; any other resolve keys (and extra aliases) are merged in.\n */\n resolve?: UserConfig['resolve']\n /**\n * The shell outline painted into index.html, so the wait for the entry chunk\n * is not a blank page. Auto-detected from the app's dependencies; pass\n * `{ surface: 'none' }` to opt out, or colors to match the app's palette on a\n * first-ever visit (later visits reuse the palette the app itself stored).\n */\n bootSkeleton?: BootSkeletonOptions\n /**\n * The built app precaches itself: a service worker + webmanifest emitted at\n * build time, so a deployed app reloads instantly and still opens with no\n * network. On by default, and build-only by construction — the dev server\n * never registers a worker. Pass `false` to opt out, or an object to name\n * the install / set its colors.\n */\n pwa?: boolean | AppShellPwaOptions\n}\n\n/**\n * Shared Vite config for Fayz dogfood apps. Resolves `@fayz-ai/*` from the local\n * SDK source when it is checked out next to the app AND `FAYZ_SDK_SOURCE` is not\n * `published`; otherwise from node_modules (the Fayz editor sandbox / published\n * npm). Apps no longer hand-maintain alias maps or the local-vs-npm guard.\n *\n * import { defineConfig } from 'vite'\n * import react from '@vitejs/plugin-react'\n * import { fayzVite } from '@fayz-ai/sdk/vite'\n * export default defineConfig(fayzVite({ port: 5185, plugins: [react()] }))\n *\n * Where that local source is read from is {@link resolveSdkDir}: `FAYZ_SDK_DIR`\n * beats the `sdkDir` option beats `../../fayz-sdk`.\n *\n * The app passes its own `@vitejs/plugin-react` so `@fayz-ai/sdk` carries no\n * build-tool peer deps (which otherwise choke npm's peer resolution, since sdk\n * sits in every dependency path).\n */\n/** Env var that redirects local-source resolution to another SDK checkout. */\nexport const FAYZ_SDK_DIR_ENV = 'FAYZ_SDK_DIR'\n\n/**\n * Where the local SDK source is, as an absolute path. Resolution order:\n *\n * 1. `FAYZ_SDK_DIR` (env) — wins, absolute or root-relative\n * 2. `sdkDir` (option) — what the app's vite config declares\n * 3. `../../fayz-sdk` — the sibling-checkout convention\n *\n * Env wins deliberately. `sdkDir` lives in the app's COMMITTED vite config, so\n * without an override there was no way to build, dev or `fayz validate` a\n * store against a different SDK tree (a worktree, a release branch) short of\n * editing that committed file or dropping an untracked config shim next to it\n * — which is exactly what the fleet ended up doing. An env var is the one\n * knob a CLI flag and a container can both set without touching the repo.\n *\n * Exported so the CLI and the tests agree on the precedence by construction\n * rather than by comment.\n */\nexport function resolveSdkDir(\n root: string,\n sdkDir?: string,\n env: Record<string, string | undefined> = process.env,\n): string {\n const fromEnv = env[FAYZ_SDK_DIR_ENV]?.trim()\n return resolve(root, fromEnv || sdkDir || '../../fayz-sdk')\n}\n\n/**\n * Bare deps that only ever appear behind a `React.lazy()` inside an @fayz-ai\n * package. See the `optimizeDeps.include` comment below for why they have to be\n * named. Filtered by what is actually installed, because a plugin the app does\n * not carry leaves its deps uninstalled and `include` hard-fails on those.\n */\nconst LAZY_ONLY_DEPS = ['recharts', '@dnd-kit/core', '@dnd-kit/sortable', '@dnd-kit/modifiers', '@dnd-kit/utilities']\n\n/**\n * Lazy deps an SDK package brings itself, which an app on local source may not\n * have installed yet (it only gets them with the next npm release). Resolved\n * from the checkout and pre-bundled up front, for the same click-time\n * re-optimize reason as LAZY_ONLY_DEPS — otherwise the first export hits\n * \"Outdated Optimize Dep\" in a loop, because the re-optimize runs from the\n * app root and cannot find the module.\n */\nconst SDK_LAZY_DEPS: Array<{ name: string; pkg: string; entry: string }> = [\n { name: 'exceljs', pkg: 'packages/ui', entry: 'dist/exceljs.min.js' },\n]\n\nfunction sdkLazyDeps(root: string, sdk: string): { alias: Record<string, string>; include: string[] } {\n const alias: Record<string, string> = {}\n const include: string[] = []\n for (const dep of SDK_LAZY_DEPS) {\n if (installedDeps(root, [dep.name]).length) { include.push(dep.name); continue }\n const file = resolve(sdk, dep.pkg, 'node_modules', dep.name, dep.entry)\n if (!existsSync(file)) continue\n alias[dep.name] = file\n include.push(dep.name)\n }\n return { alias, include }\n}\n\nfunction installedDeps(root: string, names: string[]): string[] {\n const roots: string[] = []\n for (let dir = root, prev = ''; dir !== prev; prev = dir, dir = resolve(dir, '..')) {\n roots.push(resolve(dir, 'node_modules'))\n }\n return names.filter((name) => roots.some((nm) => existsSync(resolve(nm, name, 'package.json'))))\n}\n\nexport function fayzVite(opts: FayzViteOptions = {}): UserConfig {\n const root = opts.root ?? process.cwd()\n const fayzSdk = resolveSdkDir(root, opts.sdkDir)\n const wantLocal = process.env.FAYZ_SDK_SOURCE !== 'published'\n const localPresent = existsSync(resolve(fayzSdk, 'packages/core/src/index.ts'))\n const useLocal = wantLocal && localPresent\n\n const localAliases = useLocal ? sdkAliases(fayzSdk) : {}\n const sdkLazy = useLocal ? sdkLazyDeps(root, fayzSdk) : { alias: {}, include: [] }\n\n // Pull SDK-owned resolve keys out of any caller override so they can't clobber\n // local-source @fayz-ai/* resolution; the rest of `resolve` is merged in.\n const { alias: userAlias, dedupe: userDedupe, conditions: _ignore, ...restResolve } =\n (opts.resolve ?? {}) as Exclude<UserConfig['resolve'], undefined>\n\n const pwa = opts.pwa ?? true\n // The install colors follow the boot screen's, so the splash, the browser\n // chrome and the first paint are one surface rather than three guesses.\n const pwaPlugins =\n pwa === false\n ? []\n : [\n appShellPwa(root, {\n themeColor: opts.bootSkeleton?.sidebar ?? opts.bootSkeleton?.background,\n backgroundColor: opts.bootSkeleton?.background ?? opts.bootSkeleton?.sidebar,\n ...(pwa === true ? {} : pwa),\n }),\n ]\n\n return {\n plugins: [...(opts.plugins ?? []), fayzBootSkeleton(root, opts.bootSkeleton), ...pwaPlugins],\n envPrefix: ['VITE_', 'PUBLIC_'],\n resolve: {\n ...restResolve,\n alias: {\n '@': resolve(root, 'src'),\n ...localAliases,\n ...sdkLazy.alias,\n ...(opts.aliases ?? {}),\n ...((userAlias as Record<string, string> | undefined) ?? {}),\n } as AliasOptions,\n // lucide-react is a direct dep of both the app and every @fayz-ai/*\n // package; without dedupe a version skew installs two copies and esbuild\n // pre-bundles each barrel separately (~1,500 icon modules each).\n // Collapsing to one copy is the single biggest cut to the editor-container\n // optimize RAM/CPU spike. Only dedupe deps the *app* directly depends on\n // (so they're hoisted to its root node_modules) — deduping a transitive\n // like @tanstack/react-table makes Vite resolve it from the app root,\n // which fails in local-source mode and 500s the aliased UI source.\n //\n // @fullcalendar/* is here for a different reason: plugin-agenda and the\n // app each carry a copy, and only the app's has `premium-common`. Split\n // across two copies, the resource views register their ScrollGrid into a\n // `core` the calendar is not the instance of, and the week grid dies with\n // \"No ScrollGrid implementation\" — a failure that only surfaces after the\n // dep cache is cleared, so it reads as random.\n dedupe: userDedupe ?? [\n 'react', 'react-dom', 'zustand', 'lucide-react', 'react-router-dom',\n '@supabase/supabase-js', 'sonner',\n '@fullcalendar/core', '@fullcalendar/react', '@fullcalendar/daygrid',\n '@fullcalendar/timegrid', '@fullcalendar/list', '@fullcalendar/interaction',\n '@fullcalendar/premium-common', '@fullcalendar/resource',\n '@fullcalendar/resource-daygrid', '@fullcalendar/resource-timegrid',\n ],\n conditions: useLocal ? ['source', 'browser', 'module', 'jsnext:main', 'jsnext'] : undefined,\n },\n optimizeDeps: {\n exclude: useLocal ? Object.keys(localAliases) : [],\n // Excluding @fayz-ai/* also hides THEIR bare deps from Vite's initial\n // scan. A dep that first appears behind a React.lazy() is then discovered\n // at click time, and the re-optimize that follows kills the very imports\n // that triggered it — the screen fails with \"Failed to fetch dynamically\n // imported module\" (recharts: every chart at once; @dnd-kit: the forms\n // builder). Naming them keeps the exclude that keeps SDK source hot.\n include: useLocal ? [...installedDeps(root, LAZY_ONLY_DEPS), ...sdkLazy.include] : undefined,\n },\n // The preview-container runtime contract: Vite's host-check 403s any\n // non-local Host (browser iframe via Caddy, health probe via\n // host.docker.internal) unless allowedHosts is set. host/cors/headers keep\n // the proxied iframe + cross-origin asset fetches working. Owned here\n // because the app's vite.config has no literal `server: {` for the\n // container's text patchers to anchor on. Caller `server` merges last.\n server: {\n host: true,\n port: opts.port,\n strictPort: opts.strictPort,\n cors: true,\n allowedHosts: true,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Cross-Origin-Resource-Policy': 'cross-origin',\n },\n fs: { allow: [root, fayzSdk] },\n ...(opts.server ?? {}),\n },\n }\n}\n"]}
|