@commercelayer/app-elements 6.0.3 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{InputDateComponent-BT5dGoyh.js → InputDateComponent-CkXAs3q3.js} +2 -2
- package/dist/{RuleEngineComponent-CP1fRsbv.js → RuleEngineComponent-Dg3KtMkk.js} +745 -593
- package/dist/{en-DZFYYpbl.js → en-zfMbz9a_.js} +50 -0
- package/dist/{it-B_kKLza9.js → it-6Nhey2x1.js} +50 -0
- package/dist/locales/en.d.ts +50 -0
- package/dist/{main-CuXYh6yM.js → main-Dv_RZ0zk.js} +8243 -8170
- package/dist/main.js +44 -44
- package/dist/{parseISO-Ccxkiq7f.js → parseISO-BVgVyT7w.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/ui/forms/InputSelect/GenericAsyncComponent.d.ts +3 -2
- package/dist/ui/forms/InputSelect/InputSelect.d.ts +7 -0
- package/dist/ui/forms/RuleEngine/InputResourcePath.d.ts +5 -0
- package/dist/ui/forms/RuleEngine/RuleEngineContext.d.ts +3 -0
- package/dist/ui/forms/RuleEngine/utils.d.ts +4 -4
- package/package.json +1 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as
|
|
3
|
-
import
|
|
2
|
+
import { t as D, B as re, D as le, E as ie, I as oe, N as ce, O as ue, P as de, Z as S, b as me, d as pe, e as fe, f as he, g as ye, h as ge, i as be, j as xe, k as ve, l as M, n as je, o as _e, p as Te, q as Ne, r as we, s as $e, u as Ce, v as Ee, w as ke, x as Se, y as Ve, z as Re, A as Ae, C as Ie, F as Ze, G as De, H as Me, J as qe, K as Oe, L as Le, M as Fe, Q as Pe, R as ze, S as Ue, T as Je, U as We, V as Be, W as Ke, X as Ye, Y as Xe, _ as He, $ as Ge, a0 as Qe, a1 as et, a2 as tt, a3 as at, a4 as st, a5 as nt, a6 as rt, a7 as lt, a8 as it, a9 as q, aa as ot, ab as ct, ac as ut, ad as dt, ae as mt, af as pt, ag as ft, ah as ht, ai as yt, aj as gt, ak as bt, al as xt, am as vt, an as jt, ao as _t, ap as Tt, aq as Nt, ar as wt, as as $t, at as Ct, au as Et, av as kt, aw as St, ax as Vt, ay as Rt, az as At, aA as It, aB as Zt, aC as Dt, aD as Mt, aE as qt, aF as Ot, aG as Lt, aH as Ft, aI as Pt, aJ as zt, aK as Ut, aL as Jt, aM as Wt, aN as Bt, aO as Kt, aP as Yt, aQ as Xt, aR as Ht, aS as Gt, aT as Qt, aU as e, aV as V, aW as ea, aX as ta, aY as aa, aZ as v, a_ as $, a$ as sa, b0 as R, b1 as g, b2 as I, b3 as w, b4 as x, b5 as N, b6 as na, b7 as E, b8 as K, b9 as Y, ba as X, bb as ra, bc as la, bd as H, be as A, bf as ia, bg as oa, bh as ca } from "./main-Dv_RZ0zk.js";
|
|
3
|
+
import O, { useReducer as ua, useCallback as C, useMemo as da, createContext as ma, useContext as pa, useRef as G, useState as f, useEffect as T } from "react";
|
|
4
4
|
import "react-hook-form";
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import "wouter";
|
|
6
|
+
import { p as L } from "./parseISO-BVgVyT7w.js";
|
|
7
|
+
function F(t, a) {
|
|
8
|
+
const s = t.match(
|
|
8
9
|
/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/
|
|
9
10
|
);
|
|
10
|
-
return s ?
|
|
11
|
+
return s ? D(
|
|
11
12
|
Date.UTC(
|
|
12
13
|
+s[1],
|
|
13
14
|
+s[2] - 1,
|
|
@@ -17,158 +18,162 @@ function q(a, t) {
|
|
|
17
18
|
+s[6],
|
|
18
19
|
+((s[7] || "0") + "00").substring(0, 3)
|
|
19
20
|
),
|
|
20
|
-
|
|
21
|
-
) :
|
|
21
|
+
a?.in
|
|
22
|
+
) : D(NaN, a?.in);
|
|
22
23
|
}
|
|
23
24
|
const y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
24
25
|
__proto__: null,
|
|
25
|
-
BRAND:
|
|
26
|
-
DIRTY:
|
|
27
|
-
EMPTY_PATH:
|
|
28
|
-
INVALID:
|
|
29
|
-
NEVER:
|
|
30
|
-
OK:
|
|
31
|
-
ParseStatus:
|
|
32
|
-
Schema:
|
|
33
|
-
ZodAny:
|
|
34
|
-
ZodArray:
|
|
35
|
-
ZodBigInt:
|
|
36
|
-
ZodBoolean:
|
|
37
|
-
ZodBranded:
|
|
38
|
-
ZodCatch:
|
|
39
|
-
ZodDate:
|
|
40
|
-
ZodDefault:
|
|
41
|
-
ZodDiscriminatedUnion:
|
|
42
|
-
ZodEffects:
|
|
43
|
-
ZodEnum:
|
|
44
|
-
ZodError:
|
|
26
|
+
BRAND: re,
|
|
27
|
+
DIRTY: le,
|
|
28
|
+
EMPTY_PATH: ie,
|
|
29
|
+
INVALID: oe,
|
|
30
|
+
NEVER: ce,
|
|
31
|
+
OK: ue,
|
|
32
|
+
ParseStatus: de,
|
|
33
|
+
Schema: S,
|
|
34
|
+
ZodAny: me,
|
|
35
|
+
ZodArray: pe,
|
|
36
|
+
ZodBigInt: fe,
|
|
37
|
+
ZodBoolean: he,
|
|
38
|
+
ZodBranded: ye,
|
|
39
|
+
ZodCatch: ge,
|
|
40
|
+
ZodDate: be,
|
|
41
|
+
ZodDefault: xe,
|
|
42
|
+
ZodDiscriminatedUnion: ve,
|
|
43
|
+
ZodEffects: M,
|
|
44
|
+
ZodEnum: je,
|
|
45
|
+
ZodError: _e,
|
|
45
46
|
get ZodFirstPartyTypeKind() {
|
|
46
|
-
return
|
|
47
|
+
return Te;
|
|
47
48
|
},
|
|
48
|
-
ZodFunction:
|
|
49
|
-
ZodIntersection:
|
|
50
|
-
ZodIssueCode:
|
|
51
|
-
ZodLazy:
|
|
52
|
-
ZodLiteral:
|
|
53
|
-
ZodMap:
|
|
54
|
-
ZodNaN:
|
|
55
|
-
ZodNativeEnum:
|
|
56
|
-
ZodNever:
|
|
57
|
-
ZodNull:
|
|
58
|
-
ZodNullable:
|
|
59
|
-
ZodNumber:
|
|
60
|
-
ZodObject:
|
|
61
|
-
ZodOptional:
|
|
62
|
-
ZodParsedType:
|
|
63
|
-
ZodPipeline:
|
|
64
|
-
ZodPromise:
|
|
65
|
-
ZodReadonly:
|
|
66
|
-
ZodRecord:
|
|
67
|
-
ZodSchema:
|
|
68
|
-
ZodSet:
|
|
69
|
-
ZodString:
|
|
70
|
-
ZodSymbol:
|
|
71
|
-
ZodTransformer:
|
|
72
|
-
ZodTuple:
|
|
73
|
-
ZodType:
|
|
74
|
-
ZodUndefined:
|
|
75
|
-
ZodUnion:
|
|
76
|
-
ZodUnknown:
|
|
77
|
-
ZodVoid:
|
|
78
|
-
addIssueToContext:
|
|
79
|
-
any:
|
|
80
|
-
array:
|
|
81
|
-
bigint:
|
|
82
|
-
boolean:
|
|
83
|
-
coerce:
|
|
84
|
-
custom:
|
|
85
|
-
date:
|
|
86
|
-
datetimeRegex:
|
|
87
|
-
defaultErrorMap:
|
|
88
|
-
discriminatedUnion:
|
|
89
|
-
effect:
|
|
90
|
-
enum:
|
|
91
|
-
function:
|
|
92
|
-
getErrorMap:
|
|
93
|
-
getParsedType:
|
|
94
|
-
instanceof:
|
|
95
|
-
intersection:
|
|
96
|
-
isAborted:
|
|
97
|
-
isAsync:
|
|
98
|
-
isDirty:
|
|
99
|
-
isValid:
|
|
100
|
-
late:
|
|
101
|
-
lazy:
|
|
102
|
-
literal:
|
|
103
|
-
makeIssue:
|
|
104
|
-
map:
|
|
105
|
-
nan:
|
|
106
|
-
nativeEnum:
|
|
107
|
-
never:
|
|
108
|
-
null:
|
|
109
|
-
nullable:
|
|
110
|
-
number:
|
|
111
|
-
object:
|
|
49
|
+
ZodFunction: Ne,
|
|
50
|
+
ZodIntersection: we,
|
|
51
|
+
ZodIssueCode: $e,
|
|
52
|
+
ZodLazy: Ce,
|
|
53
|
+
ZodLiteral: Ee,
|
|
54
|
+
ZodMap: ke,
|
|
55
|
+
ZodNaN: Se,
|
|
56
|
+
ZodNativeEnum: Ve,
|
|
57
|
+
ZodNever: Re,
|
|
58
|
+
ZodNull: Ae,
|
|
59
|
+
ZodNullable: Ie,
|
|
60
|
+
ZodNumber: Ze,
|
|
61
|
+
ZodObject: De,
|
|
62
|
+
ZodOptional: Me,
|
|
63
|
+
ZodParsedType: qe,
|
|
64
|
+
ZodPipeline: Oe,
|
|
65
|
+
ZodPromise: Le,
|
|
66
|
+
ZodReadonly: Fe,
|
|
67
|
+
ZodRecord: Pe,
|
|
68
|
+
ZodSchema: S,
|
|
69
|
+
ZodSet: ze,
|
|
70
|
+
ZodString: Ue,
|
|
71
|
+
ZodSymbol: Je,
|
|
72
|
+
ZodTransformer: M,
|
|
73
|
+
ZodTuple: We,
|
|
74
|
+
ZodType: S,
|
|
75
|
+
ZodUndefined: Be,
|
|
76
|
+
ZodUnion: Ke,
|
|
77
|
+
ZodUnknown: Ye,
|
|
78
|
+
ZodVoid: Xe,
|
|
79
|
+
addIssueToContext: He,
|
|
80
|
+
any: Ge,
|
|
81
|
+
array: Qe,
|
|
82
|
+
bigint: et,
|
|
83
|
+
boolean: tt,
|
|
84
|
+
coerce: at,
|
|
85
|
+
custom: st,
|
|
86
|
+
date: nt,
|
|
87
|
+
datetimeRegex: rt,
|
|
88
|
+
defaultErrorMap: lt,
|
|
89
|
+
discriminatedUnion: it,
|
|
90
|
+
effect: q,
|
|
91
|
+
enum: ot,
|
|
92
|
+
function: ct,
|
|
93
|
+
getErrorMap: ut,
|
|
94
|
+
getParsedType: dt,
|
|
95
|
+
instanceof: mt,
|
|
96
|
+
intersection: pt,
|
|
97
|
+
isAborted: ft,
|
|
98
|
+
isAsync: ht,
|
|
99
|
+
isDirty: yt,
|
|
100
|
+
isValid: gt,
|
|
101
|
+
late: bt,
|
|
102
|
+
lazy: xt,
|
|
103
|
+
literal: vt,
|
|
104
|
+
makeIssue: jt,
|
|
105
|
+
map: _t,
|
|
106
|
+
nan: Tt,
|
|
107
|
+
nativeEnum: Nt,
|
|
108
|
+
never: wt,
|
|
109
|
+
null: $t,
|
|
110
|
+
nullable: Ct,
|
|
111
|
+
number: Et,
|
|
112
|
+
object: kt,
|
|
112
113
|
get objectUtil() {
|
|
113
|
-
return
|
|
114
|
+
return St;
|
|
114
115
|
},
|
|
115
|
-
oboolean:
|
|
116
|
-
onumber:
|
|
117
|
-
optional:
|
|
118
|
-
ostring:
|
|
119
|
-
pipeline:
|
|
120
|
-
preprocess:
|
|
121
|
-
promise:
|
|
122
|
-
quotelessJson:
|
|
123
|
-
record:
|
|
124
|
-
set:
|
|
125
|
-
setErrorMap:
|
|
126
|
-
strictObject:
|
|
127
|
-
string:
|
|
128
|
-
symbol:
|
|
129
|
-
transformer:
|
|
130
|
-
tuple:
|
|
131
|
-
undefined:
|
|
132
|
-
union:
|
|
133
|
-
unknown:
|
|
116
|
+
oboolean: Vt,
|
|
117
|
+
onumber: Rt,
|
|
118
|
+
optional: At,
|
|
119
|
+
ostring: It,
|
|
120
|
+
pipeline: Zt,
|
|
121
|
+
preprocess: Dt,
|
|
122
|
+
promise: Mt,
|
|
123
|
+
quotelessJson: qt,
|
|
124
|
+
record: Ot,
|
|
125
|
+
set: Lt,
|
|
126
|
+
setErrorMap: Ft,
|
|
127
|
+
strictObject: Pt,
|
|
128
|
+
string: zt,
|
|
129
|
+
symbol: Ut,
|
|
130
|
+
transformer: q,
|
|
131
|
+
tuple: Jt,
|
|
132
|
+
undefined: Wt,
|
|
133
|
+
union: Bt,
|
|
134
|
+
unknown: Kt,
|
|
134
135
|
get util() {
|
|
135
|
-
return
|
|
136
|
+
return Yt;
|
|
136
137
|
},
|
|
137
|
-
void:
|
|
138
|
+
void: Xt
|
|
138
139
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
139
|
-
|
|
140
|
-
|
|
140
|
+
var fa = 1, ha = 4;
|
|
141
|
+
function ya(t) {
|
|
142
|
+
return Ht(t, fa | ha);
|
|
141
143
|
}
|
|
142
|
-
function
|
|
143
|
-
return
|
|
144
|
+
function P(t, a, s) {
|
|
145
|
+
return t == null ? t : Gt(t, a, s);
|
|
144
146
|
}
|
|
145
|
-
|
|
147
|
+
function z(t, a) {
|
|
148
|
+
return t == null ? !0 : Qt(t, a);
|
|
149
|
+
}
|
|
150
|
+
const Q = ma(
|
|
146
151
|
void 0
|
|
147
152
|
);
|
|
148
|
-
function
|
|
149
|
-
switch (
|
|
153
|
+
function ga(t, a) {
|
|
154
|
+
switch (a.type) {
|
|
150
155
|
case "SET_PATH": {
|
|
151
|
-
const s =
|
|
152
|
-
if (
|
|
153
|
-
if (/\.\d+$/.test(
|
|
154
|
-
const
|
|
155
|
-
Array.isArray(
|
|
156
|
+
const s = ya(t.value);
|
|
157
|
+
if (a.value === null)
|
|
158
|
+
if (/\.\d+$/.test(a.path)) {
|
|
159
|
+
const l = a.path.replace(/\.\d+$/, ""), c = parseInt(a.path.match(/\d+$/)?.[0] ?? "0", 10), n = ea(s, l);
|
|
160
|
+
Array.isArray(n) && (n.splice(c, 1), P(s, l, n), n.length === 0 && l.endsWith(".nested.conditions") && z(s, l.replace(/\.conditions$/, "")));
|
|
156
161
|
} else
|
|
157
|
-
z(s,
|
|
162
|
+
z(s, a.path);
|
|
158
163
|
else
|
|
159
|
-
|
|
164
|
+
P(s, a.path, a.value);
|
|
160
165
|
return {
|
|
161
|
-
...
|
|
166
|
+
...t,
|
|
162
167
|
value: s
|
|
163
168
|
};
|
|
164
169
|
}
|
|
165
170
|
case "SET_SELECTED_RULE_INDEX":
|
|
166
171
|
return {
|
|
167
|
-
...
|
|
168
|
-
selectedRuleIndex:
|
|
172
|
+
...t,
|
|
173
|
+
selectedRuleIndex: a.index
|
|
169
174
|
};
|
|
170
175
|
case "SET_VALUE":
|
|
171
|
-
return
|
|
176
|
+
return V(t.value, a.value) ? t : (a.value.rules?.length ?? 0) === 0 ? {
|
|
172
177
|
selectedRuleIndex: 0,
|
|
173
178
|
value: {
|
|
174
179
|
rules: [
|
|
@@ -182,86 +187,194 @@ function it(a, t) {
|
|
|
182
187
|
]
|
|
183
188
|
}
|
|
184
189
|
} : {
|
|
185
|
-
...
|
|
186
|
-
value:
|
|
190
|
+
...t,
|
|
191
|
+
value: a.value
|
|
187
192
|
};
|
|
188
193
|
default:
|
|
189
|
-
return
|
|
194
|
+
return t;
|
|
190
195
|
}
|
|
191
196
|
}
|
|
192
|
-
function
|
|
193
|
-
children:
|
|
194
|
-
initialValue:
|
|
197
|
+
function ba({
|
|
198
|
+
children: t,
|
|
199
|
+
initialValue: a
|
|
195
200
|
}) {
|
|
196
|
-
const [s,
|
|
197
|
-
value:
|
|
201
|
+
const [s, l] = ua(ga, {
|
|
202
|
+
value: a.value,
|
|
198
203
|
selectedRuleIndex: 0
|
|
199
|
-
}),
|
|
200
|
-
|
|
201
|
-
}, []),
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}, []),
|
|
204
|
+
}), c = C((u, i) => {
|
|
205
|
+
l({ type: "SET_PATH", path: u, value: i });
|
|
206
|
+
}, []), n = C((u) => {
|
|
207
|
+
l({ type: "SET_SELECTED_RULE_INDEX", index: u }), u < 0 && setTimeout(() => {
|
|
208
|
+
l({ type: "SET_SELECTED_RULE_INDEX", index: 0 });
|
|
209
|
+
}, 50);
|
|
210
|
+
}, []), r = C((u) => {
|
|
211
|
+
l({ type: "SET_VALUE", value: u });
|
|
212
|
+
}, []), o = da(
|
|
206
213
|
() => ({
|
|
207
214
|
state: s,
|
|
208
|
-
setPath:
|
|
209
|
-
setSelectedRuleIndex:
|
|
210
|
-
setValue:
|
|
211
|
-
availableActionTypes:
|
|
215
|
+
setPath: c,
|
|
216
|
+
setSelectedRuleIndex: n,
|
|
217
|
+
setValue: r,
|
|
218
|
+
availableActionTypes: a.availableActionTypes,
|
|
219
|
+
schemaType: a.schemaType
|
|
212
220
|
}),
|
|
213
221
|
[
|
|
214
222
|
s,
|
|
215
|
-
|
|
216
|
-
l,
|
|
223
|
+
c,
|
|
217
224
|
n,
|
|
218
|
-
|
|
225
|
+
r,
|
|
226
|
+
a.availableActionTypes,
|
|
227
|
+
a.schemaType
|
|
219
228
|
]
|
|
220
229
|
);
|
|
221
|
-
return /* @__PURE__ */ e.jsx(
|
|
230
|
+
return /* @__PURE__ */ e.jsx(Q.Provider, { value: o, children: t });
|
|
222
231
|
}
|
|
223
|
-
function
|
|
224
|
-
const
|
|
225
|
-
if (
|
|
232
|
+
function b() {
|
|
233
|
+
const t = pa(Q);
|
|
234
|
+
if (t === void 0)
|
|
226
235
|
throw new Error("useRuleEngine must be used within a RuleEngineProvider");
|
|
227
|
-
return
|
|
236
|
+
return t;
|
|
228
237
|
}
|
|
229
|
-
function
|
|
230
|
-
|
|
231
|
-
|
|
238
|
+
function ee({
|
|
239
|
+
value: t,
|
|
240
|
+
name: a,
|
|
241
|
+
preset: s
|
|
232
242
|
}) {
|
|
233
|
-
const { setPath:
|
|
234
|
-
|
|
243
|
+
const { setPath: l, schemaType: c } = b(), { t: n } = ta(), r = G(null), o = c === "order-rules" ? "order" : c === "price-rules" ? "price" : void 0, u = aa(
|
|
244
|
+
(s === "condition" ? xa : s === "action" ? va : []).filter(
|
|
245
|
+
(i) => o != null && i.startsWith(o)
|
|
246
|
+
).map((i) => ({
|
|
247
|
+
value: i,
|
|
248
|
+
label: n(`resource_paths.${i}`).replace(
|
|
249
|
+
"resource_paths.",
|
|
250
|
+
""
|
|
251
|
+
)
|
|
252
|
+
})),
|
|
253
|
+
"label"
|
|
254
|
+
);
|
|
255
|
+
return /* @__PURE__ */ e.jsx(
|
|
256
|
+
v,
|
|
257
|
+
{
|
|
258
|
+
ref: r,
|
|
259
|
+
name: a,
|
|
260
|
+
initialValues: u,
|
|
261
|
+
defaultValue: t != null ? u.find((i) => i.value === t) ?? {
|
|
262
|
+
value: t,
|
|
263
|
+
label: t
|
|
264
|
+
} : void 0,
|
|
265
|
+
asTextSearch: !0,
|
|
266
|
+
isCreatable: !0,
|
|
267
|
+
loadAsyncValues: async (i) => {
|
|
268
|
+
if (o == null)
|
|
269
|
+
return [];
|
|
270
|
+
const d = u.filter(
|
|
271
|
+
(p) => p.label.includes(i)
|
|
272
|
+
), m = (await sa([o], i)).filter((p) => p.value.startsWith(i)).map((p) => {
|
|
273
|
+
const _ = p.type === "relationship" || p.value.endsWith(".metadata") ? `${p.value}.` : p.value;
|
|
274
|
+
return {
|
|
275
|
+
value: _,
|
|
276
|
+
label: _
|
|
277
|
+
};
|
|
278
|
+
}), j = i.includes(".metadata") ? [{ label: i, value: i }] : [], h = [...d, ...m, ...j];
|
|
279
|
+
return console.log("results", h), h;
|
|
280
|
+
},
|
|
281
|
+
onSelect: async (i) => {
|
|
282
|
+
$(i) && (l(a, i.value), i.value.toString().endsWith(".") && r.current?.openMenu("first"));
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
const xa = [
|
|
288
|
+
"order.billing_address.country_code",
|
|
289
|
+
"order.country_code",
|
|
290
|
+
"order.currency_code",
|
|
291
|
+
"order.customer_email",
|
|
292
|
+
"order.customer.email",
|
|
293
|
+
"order.customer.customer_group.id",
|
|
294
|
+
"order.customer.customer_group.name",
|
|
295
|
+
"order.customer.tags.id",
|
|
296
|
+
"order.customer.tags.name",
|
|
297
|
+
"order.line_items.item_type",
|
|
298
|
+
"order.line_items.line_item_options.sku_option.tags.name",
|
|
299
|
+
"order.line_items.options_amount_cents",
|
|
300
|
+
"order.line_items.quantity",
|
|
301
|
+
"order.line_items.reference",
|
|
302
|
+
"order.line_items.shipment.id",
|
|
303
|
+
"order.line_items.shipment.shipping_method.id",
|
|
304
|
+
"order.line_items.shipment.shipping_method.name",
|
|
305
|
+
"order.line_items.shipment.shipping_method.reference",
|
|
306
|
+
"order.line_items.sku_code",
|
|
307
|
+
"order.line_items.sku.code",
|
|
308
|
+
"order.line_items.sku.id",
|
|
309
|
+
"order.line_items.sku.inventory.quantity",
|
|
310
|
+
"order.line_items.sku.name",
|
|
311
|
+
"order.line_items.sku.shipping_category.id",
|
|
312
|
+
"order.line_items.sku.sku_lists.id",
|
|
313
|
+
"order.line_items.sku.sku_lists.name",
|
|
314
|
+
"order.line_items.sku.tags.name",
|
|
315
|
+
"order.line_items.unit_amount_cents",
|
|
316
|
+
"order.market.code",
|
|
317
|
+
"order.market.id",
|
|
318
|
+
"order.shipments_count",
|
|
319
|
+
"order.shipping_address.country_code",
|
|
320
|
+
"order.subtotal_amount_cents",
|
|
321
|
+
"order.tags.name",
|
|
322
|
+
"order.total_amount_cents",
|
|
323
|
+
"price.jwt_customer.email",
|
|
324
|
+
"price.jwt_customer.tags.name",
|
|
325
|
+
"price.sku.sku_list_items.sku_list.name",
|
|
326
|
+
"price.sku.code",
|
|
327
|
+
"price.sku.tags.name",
|
|
328
|
+
"price.processed_at",
|
|
329
|
+
"price.amount_cents"
|
|
330
|
+
], va = [
|
|
331
|
+
"order.line_items.line_item_options",
|
|
332
|
+
"order.line_items.shipment",
|
|
333
|
+
"order.line_items.sku_code",
|
|
334
|
+
"order.line_items.sku.code",
|
|
335
|
+
"order.line_items.sku",
|
|
336
|
+
"order.line_items",
|
|
337
|
+
"order.subtotal_amount_cents",
|
|
338
|
+
"order.total_amount_cents",
|
|
339
|
+
"order",
|
|
340
|
+
"price"
|
|
341
|
+
];
|
|
342
|
+
function ja({
|
|
343
|
+
item: t,
|
|
344
|
+
pathPrefix: a
|
|
345
|
+
}) {
|
|
346
|
+
const { setPath: s } = b();
|
|
347
|
+
if (t == null)
|
|
235
348
|
return null;
|
|
236
|
-
switch (
|
|
349
|
+
switch (t.type) {
|
|
237
350
|
case "buy_x_pay_y":
|
|
238
351
|
return /* @__PURE__ */ e.jsxs("div", { className: "w-36 flex items-center gap-0.5", children: [
|
|
239
352
|
/* @__PURE__ */ e.jsx(
|
|
240
|
-
|
|
353
|
+
g,
|
|
241
354
|
{
|
|
242
|
-
name: `${
|
|
355
|
+
name: `${a}.value.x`,
|
|
243
356
|
type: "number",
|
|
244
357
|
suffix: "X",
|
|
245
|
-
defaultValue:
|
|
246
|
-
onChange: (
|
|
358
|
+
defaultValue: t.value?.x,
|
|
359
|
+
onChange: (l) => {
|
|
247
360
|
s(
|
|
248
|
-
`${
|
|
249
|
-
parseInt(
|
|
361
|
+
`${a}.value.x`,
|
|
362
|
+
parseInt(l.currentTarget.value, 10)
|
|
250
363
|
);
|
|
251
364
|
}
|
|
252
365
|
}
|
|
253
366
|
),
|
|
254
367
|
/* @__PURE__ */ e.jsx(
|
|
255
|
-
|
|
368
|
+
g,
|
|
256
369
|
{
|
|
257
|
-
name: `${
|
|
370
|
+
name: `${a}.value.y`,
|
|
258
371
|
type: "number",
|
|
259
372
|
suffix: "Y",
|
|
260
|
-
defaultValue:
|
|
261
|
-
onChange: (
|
|
373
|
+
defaultValue: t.value?.y,
|
|
374
|
+
onChange: (l) => {
|
|
262
375
|
s(
|
|
263
|
-
`${
|
|
264
|
-
parseInt(
|
|
376
|
+
`${a}.value.y`,
|
|
377
|
+
parseInt(l.currentTarget.value, 10)
|
|
265
378
|
);
|
|
266
379
|
}
|
|
267
380
|
}
|
|
@@ -270,31 +383,31 @@ function ut({
|
|
|
270
383
|
case "every_x_discount_y":
|
|
271
384
|
return /* @__PURE__ */ e.jsxs("div", { className: "w-36 flex items-center gap-0.5", children: [
|
|
272
385
|
/* @__PURE__ */ e.jsx(
|
|
273
|
-
|
|
386
|
+
g,
|
|
274
387
|
{
|
|
275
|
-
name: `${
|
|
388
|
+
name: `${a}.value.x`,
|
|
276
389
|
type: "number",
|
|
277
390
|
suffix: "X",
|
|
278
|
-
defaultValue:
|
|
279
|
-
onChange: (
|
|
391
|
+
defaultValue: t.value?.x,
|
|
392
|
+
onChange: (l) => {
|
|
280
393
|
s(
|
|
281
|
-
`${
|
|
282
|
-
parseInt(
|
|
394
|
+
`${a}.value.x`,
|
|
395
|
+
parseInt(l.currentTarget.value, 10)
|
|
283
396
|
);
|
|
284
397
|
}
|
|
285
398
|
}
|
|
286
399
|
),
|
|
287
400
|
/* @__PURE__ */ e.jsx(
|
|
288
|
-
|
|
401
|
+
g,
|
|
289
402
|
{
|
|
290
|
-
name: `${
|
|
403
|
+
name: `${a}.value.y`,
|
|
291
404
|
type: "number",
|
|
292
405
|
suffix: "Y",
|
|
293
|
-
defaultValue:
|
|
294
|
-
onChange: (
|
|
406
|
+
defaultValue: t.value?.y,
|
|
407
|
+
onChange: (l) => {
|
|
295
408
|
s(
|
|
296
|
-
`${
|
|
297
|
-
parseInt(
|
|
409
|
+
`${a}.value.y`,
|
|
410
|
+
parseInt(l.currentTarget.value, 10)
|
|
298
411
|
);
|
|
299
412
|
}
|
|
300
413
|
}
|
|
@@ -303,36 +416,36 @@ function ut({
|
|
|
303
416
|
case "fixed_amount":
|
|
304
417
|
case "fixed_price":
|
|
305
418
|
return /* @__PURE__ */ e.jsx("div", { className: "w-36", children: /* @__PURE__ */ e.jsx(
|
|
306
|
-
|
|
419
|
+
g,
|
|
307
420
|
{
|
|
308
|
-
name: `${
|
|
421
|
+
name: `${a}.value`,
|
|
309
422
|
type: "number",
|
|
310
|
-
defaultValue:
|
|
423
|
+
defaultValue: t.value,
|
|
311
424
|
min: 0,
|
|
312
425
|
suffix: "cents",
|
|
313
|
-
onChange: (
|
|
426
|
+
onChange: (l) => {
|
|
314
427
|
s(
|
|
315
|
-
`${
|
|
316
|
-
parseInt(
|
|
428
|
+
`${a}.value`,
|
|
429
|
+
parseInt(l.currentTarget.value, 10)
|
|
317
430
|
);
|
|
318
431
|
}
|
|
319
432
|
}
|
|
320
433
|
) });
|
|
321
434
|
case "percentage": {
|
|
322
|
-
const
|
|
435
|
+
const l = (t.value * 100).toFixed(2);
|
|
323
436
|
return /* @__PURE__ */ e.jsx("div", { className: "w-24", children: /* @__PURE__ */ e.jsx(
|
|
324
|
-
|
|
437
|
+
g,
|
|
325
438
|
{
|
|
326
|
-
name: `${
|
|
439
|
+
name: `${a}.value`,
|
|
327
440
|
type: "number",
|
|
328
|
-
defaultValue:
|
|
441
|
+
defaultValue: l.endsWith(".00") ? l.slice(0, -3) : l,
|
|
329
442
|
min: 0,
|
|
330
443
|
max: 100,
|
|
331
444
|
suffix: "%",
|
|
332
|
-
onChange: (
|
|
445
|
+
onChange: (c) => {
|
|
333
446
|
s(
|
|
334
|
-
`${
|
|
335
|
-
parseFloat(
|
|
447
|
+
`${a}.value`,
|
|
448
|
+
parseFloat(c.currentTarget.value) / 100
|
|
336
449
|
);
|
|
337
450
|
}
|
|
338
451
|
}
|
|
@@ -342,57 +455,54 @@ function ut({
|
|
|
342
455
|
return R();
|
|
343
456
|
}
|
|
344
457
|
}
|
|
345
|
-
function
|
|
346
|
-
item:
|
|
347
|
-
index:
|
|
458
|
+
function _a({
|
|
459
|
+
item: t,
|
|
460
|
+
index: a,
|
|
348
461
|
onDelete: s
|
|
349
462
|
}) {
|
|
350
463
|
const {
|
|
351
|
-
setPath:
|
|
352
|
-
state: { selectedRuleIndex:
|
|
353
|
-
availableActionTypes:
|
|
354
|
-
} =
|
|
464
|
+
setPath: l,
|
|
465
|
+
state: { selectedRuleIndex: c },
|
|
466
|
+
availableActionTypes: n
|
|
467
|
+
} = b(), r = {
|
|
355
468
|
percentage: "Percentage discount",
|
|
356
469
|
fixed_amount: "Fixed amount",
|
|
357
470
|
fixed_price: "Fixed price",
|
|
358
471
|
buy_x_pay_y: "Buy X, Pay Y",
|
|
359
472
|
every_x_discount_y: "Every X, Discount Y"
|
|
360
|
-
},
|
|
473
|
+
}, o = `rules.${c}.actions.${a}`;
|
|
361
474
|
return /* @__PURE__ */ e.jsx("div", { className: "mb-4 last:mb-0", children: /* @__PURE__ */ e.jsxs("div", { className: "bg-gray-50 rounded-md flex items-center", children: [
|
|
362
475
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-2 grow p-2", children: [
|
|
363
476
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1", children: /* @__PURE__ */ e.jsx(
|
|
364
477
|
v,
|
|
365
478
|
{
|
|
366
|
-
name: `${
|
|
367
|
-
defaultValue:
|
|
368
|
-
label:
|
|
369
|
-
value:
|
|
479
|
+
name: `${o}.type`,
|
|
480
|
+
defaultValue: t != null ? {
|
|
481
|
+
label: r[t.type],
|
|
482
|
+
value: t.type
|
|
370
483
|
} : void 0,
|
|
371
|
-
initialValues:
|
|
372
|
-
value:
|
|
373
|
-
label:
|
|
484
|
+
initialValues: n.map((u) => ({
|
|
485
|
+
value: u,
|
|
486
|
+
label: r[u]
|
|
374
487
|
})),
|
|
375
|
-
onSelect: (
|
|
376
|
-
|
|
488
|
+
onSelect: (u) => {
|
|
489
|
+
$(u) && l(`${o}.type`, u.value);
|
|
377
490
|
}
|
|
378
491
|
}
|
|
379
492
|
) }),
|
|
380
|
-
/* @__PURE__ */ e.jsx(
|
|
493
|
+
/* @__PURE__ */ e.jsx(ja, { item: t, pathPrefix: o }),
|
|
381
494
|
/* @__PURE__ */ e.jsx("div", { className: "text-black font-bold text-sm", children: "ON" }),
|
|
382
495
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1", children: /* @__PURE__ */ e.jsx(
|
|
383
|
-
|
|
496
|
+
ee,
|
|
384
497
|
{
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
onChange: (c) => {
|
|
389
|
-
r(`${i}.selector`, c.currentTarget.value);
|
|
390
|
-
}
|
|
498
|
+
preset: "action",
|
|
499
|
+
value: t?.selector,
|
|
500
|
+
name: `${o}.selector`
|
|
391
501
|
}
|
|
392
502
|
) })
|
|
393
503
|
] }),
|
|
394
504
|
s != null && /* @__PURE__ */ e.jsx(
|
|
395
|
-
|
|
505
|
+
I,
|
|
396
506
|
{
|
|
397
507
|
className: "w-8 border-l border-gray-100 flex items-center justify-center self-stretch",
|
|
398
508
|
dropdownLabel: /* @__PURE__ */ e.jsx(
|
|
@@ -400,15 +510,15 @@ function ct({
|
|
|
400
510
|
{
|
|
401
511
|
type: "button",
|
|
402
512
|
className: "flex items-center justify-center self-stretch grow",
|
|
403
|
-
children: /* @__PURE__ */ e.jsx(
|
|
513
|
+
children: /* @__PURE__ */ e.jsx(x, { name: "dotsThreeVertical", size: 16, weight: "bold" })
|
|
404
514
|
}
|
|
405
515
|
),
|
|
406
516
|
dropdownItems: /* @__PURE__ */ e.jsx(
|
|
407
|
-
|
|
517
|
+
w,
|
|
408
518
|
{
|
|
409
519
|
label: "Delete",
|
|
410
520
|
onClick: () => {
|
|
411
|
-
|
|
521
|
+
l(`${o}`, null), s();
|
|
412
522
|
}
|
|
413
523
|
}
|
|
414
524
|
)
|
|
@@ -416,94 +526,94 @@ function ct({
|
|
|
416
526
|
)
|
|
417
527
|
] }) });
|
|
418
528
|
}
|
|
419
|
-
function
|
|
420
|
-
actions:
|
|
529
|
+
function Ta({
|
|
530
|
+
actions: t
|
|
421
531
|
}) {
|
|
422
|
-
const [
|
|
423
|
-
setPath:
|
|
424
|
-
state: { selectedRuleIndex:
|
|
425
|
-
} =
|
|
532
|
+
const [a, s] = f(0), {
|
|
533
|
+
setPath: l,
|
|
534
|
+
state: { selectedRuleIndex: c }
|
|
535
|
+
} = b();
|
|
426
536
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
427
|
-
/* @__PURE__ */ e.jsx("div", { children:
|
|
428
|
-
|
|
537
|
+
/* @__PURE__ */ e.jsx("div", { children: t?.map((n, r, o) => /* @__PURE__ */ e.jsx(
|
|
538
|
+
_a,
|
|
429
539
|
{
|
|
430
|
-
item:
|
|
431
|
-
index:
|
|
432
|
-
onDelete:
|
|
433
|
-
s((
|
|
540
|
+
item: n,
|
|
541
|
+
index: r,
|
|
542
|
+
onDelete: o.length > 1 ? () => {
|
|
543
|
+
s((u) => u + 1);
|
|
434
544
|
} : void 0
|
|
435
545
|
},
|
|
436
|
-
`${
|
|
546
|
+
`${c}-${r}-${a}`
|
|
437
547
|
)) }),
|
|
438
548
|
/* @__PURE__ */ e.jsx("div", { className: "mt-6", children: /* @__PURE__ */ e.jsxs(
|
|
439
|
-
|
|
549
|
+
N,
|
|
440
550
|
{
|
|
441
551
|
size: "small",
|
|
442
552
|
variant: "secondary",
|
|
443
553
|
alignItems: "center",
|
|
444
554
|
onClick: () => {
|
|
445
|
-
|
|
446
|
-
`rules.${
|
|
555
|
+
l(
|
|
556
|
+
`rules.${c}.actions.${t?.length ?? 0}`,
|
|
447
557
|
void 0
|
|
448
558
|
);
|
|
449
559
|
},
|
|
450
560
|
children: [
|
|
451
|
-
/* @__PURE__ */ e.jsx(
|
|
561
|
+
/* @__PURE__ */ e.jsx(x, { name: "plusCircle" }),
|
|
452
562
|
" Add action"
|
|
453
563
|
]
|
|
454
564
|
}
|
|
455
565
|
) })
|
|
456
566
|
] });
|
|
457
567
|
}
|
|
458
|
-
function
|
|
459
|
-
const [
|
|
460
|
-
return
|
|
461
|
-
|
|
462
|
-
s(
|
|
463
|
-
}).catch((
|
|
464
|
-
console.error("Error fetching field info:",
|
|
568
|
+
function te(t) {
|
|
569
|
+
const [a, s] = f(void 0);
|
|
570
|
+
return T(() => {
|
|
571
|
+
t?.field != null && na(t.field).then((l) => {
|
|
572
|
+
s(l);
|
|
573
|
+
}).catch((l) => {
|
|
574
|
+
console.error("Error fetching field info:", l);
|
|
465
575
|
});
|
|
466
|
-
}, [
|
|
576
|
+
}, [t?.field]), { infos: a };
|
|
467
577
|
}
|
|
468
|
-
function
|
|
469
|
-
if (typeof
|
|
470
|
-
return
|
|
471
|
-
if (typeof
|
|
578
|
+
function ae(t) {
|
|
579
|
+
if (typeof t == "string")
|
|
580
|
+
return E(F(t)) ? "datetime" : "string";
|
|
581
|
+
if (typeof t == "number")
|
|
472
582
|
return "integer";
|
|
473
|
-
if (typeof
|
|
583
|
+
if (typeof t == "boolean")
|
|
474
584
|
return "boolean";
|
|
475
|
-
if (Array.isArray(
|
|
476
|
-
if (typeof
|
|
477
|
-
return
|
|
478
|
-
if (typeof
|
|
585
|
+
if (Array.isArray(t)) {
|
|
586
|
+
if (typeof t[0] == "string")
|
|
587
|
+
return E(F(t[0])) ? "datetime" : "string";
|
|
588
|
+
if (typeof t[0] == "number")
|
|
479
589
|
return "integer";
|
|
480
590
|
}
|
|
481
591
|
return "string";
|
|
482
592
|
}
|
|
483
|
-
function
|
|
484
|
-
item:
|
|
485
|
-
pathPrefix:
|
|
593
|
+
function Na({
|
|
594
|
+
item: t,
|
|
595
|
+
pathPrefix: a
|
|
486
596
|
}) {
|
|
487
|
-
const { setPath: s } =
|
|
488
|
-
let
|
|
489
|
-
return
|
|
597
|
+
const { setPath: s } = b(), { infos: l } = te(t);
|
|
598
|
+
let c = l?.field?.type;
|
|
599
|
+
return c == null && (c = ae(t?.value)), /* @__PURE__ */ e.jsx(
|
|
490
600
|
v,
|
|
491
601
|
{
|
|
492
|
-
name: `${
|
|
493
|
-
value:
|
|
494
|
-
label:
|
|
495
|
-
value:
|
|
602
|
+
name: `${a}.matcher`,
|
|
603
|
+
value: t != null ? {
|
|
604
|
+
label: U.find((n) => n.matcher === t.matcher && (c != null && n.fieldTypes.includes(c) || c == null))?.label ?? (t.matcher != null ? `⚠️ ${t.matcher}` : ""),
|
|
605
|
+
value: t.matcher
|
|
496
606
|
} : void 0,
|
|
497
|
-
initialValues:
|
|
498
|
-
onSelect: (
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
) && s(`${
|
|
607
|
+
initialValues: U.filter(({ fieldTypes: n, visible: r }) => r !== !1 && n.includes(c)).map(({ matcher: n, label: r }) => ({ value: n, label: r })),
|
|
608
|
+
onSelect: (n) => {
|
|
609
|
+
$(n) && (s(`${a}.matcher`, n.value), K.includes(
|
|
610
|
+
n.value
|
|
611
|
+
) && s(`${a}.value`, null));
|
|
502
612
|
}
|
|
503
613
|
}
|
|
504
614
|
);
|
|
505
615
|
}
|
|
506
|
-
const
|
|
616
|
+
const U = [
|
|
507
617
|
{
|
|
508
618
|
/** Matches if field value equals provided value
|
|
509
619
|
* @field Integer, String, Datetime, Boolean
|
|
@@ -748,7 +858,7 @@ const F = [
|
|
|
748
858
|
label: "is present",
|
|
749
859
|
fieldTypes: ["integer", "string", "datetime", "boolean"]
|
|
750
860
|
}
|
|
751
|
-
],
|
|
861
|
+
], J = {
|
|
752
862
|
in_and: {
|
|
753
863
|
label: "all of"
|
|
754
864
|
},
|
|
@@ -762,46 +872,46 @@ const F = [
|
|
|
762
872
|
label: "not at least one of"
|
|
763
873
|
}
|
|
764
874
|
};
|
|
765
|
-
function
|
|
766
|
-
value:
|
|
767
|
-
pathPrefix:
|
|
875
|
+
function wa({
|
|
876
|
+
value: t,
|
|
877
|
+
pathPrefix: a
|
|
768
878
|
}) {
|
|
769
|
-
return (typeof
|
|
879
|
+
return (typeof t != "object" || Array.isArray(t) || t === null) && (t = {
|
|
770
880
|
in_and: []
|
|
771
|
-
}), /* @__PURE__ */ e.jsx("div", { children: Object.entries(
|
|
772
|
-
|
|
881
|
+
}), /* @__PURE__ */ e.jsx("div", { children: Object.entries(t).map(([s, l], c) => /* @__PURE__ */ e.jsx(
|
|
882
|
+
$a,
|
|
773
883
|
{
|
|
774
|
-
pathPrefix:
|
|
775
|
-
defaultValue:
|
|
884
|
+
pathPrefix: a,
|
|
885
|
+
defaultValue: l,
|
|
776
886
|
initialMatcher: s
|
|
777
887
|
},
|
|
778
|
-
`${
|
|
779
|
-
|
|
888
|
+
`${a}.${// biome-ignore lint/suspicious/noArrayIndexKey: Using index as key is acceptable here since items are static
|
|
889
|
+
c}`
|
|
780
890
|
)) });
|
|
781
891
|
}
|
|
782
|
-
function
|
|
783
|
-
initialMatcher:
|
|
784
|
-
defaultValue:
|
|
892
|
+
function $a({
|
|
893
|
+
initialMatcher: t,
|
|
894
|
+
defaultValue: a,
|
|
785
895
|
pathPrefix: s
|
|
786
896
|
}) {
|
|
787
|
-
const [
|
|
788
|
-
return
|
|
789
|
-
|
|
790
|
-
}, [
|
|
897
|
+
const [l, c] = f(t), [n, r] = f(t), [o, u] = f(a), { setPath: i } = b();
|
|
898
|
+
return T(() => {
|
|
899
|
+
l !== n && (i(`${s}.${l}`, null), c(n)), i(`${s}.${n}`, o);
|
|
900
|
+
}, [n, o, i]), /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 last-of-type:mt-2", children: [
|
|
791
901
|
/* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: /* @__PURE__ */ e.jsx(
|
|
792
902
|
v,
|
|
793
903
|
{
|
|
794
904
|
defaultValue: [
|
|
795
|
-
{ value:
|
|
905
|
+
{ value: n, label: J[n].label }
|
|
796
906
|
],
|
|
797
|
-
initialValues: Object.entries(
|
|
907
|
+
initialValues: Object.entries(J).map(
|
|
798
908
|
([d, { label: m }]) => ({
|
|
799
909
|
value: d,
|
|
800
910
|
label: m
|
|
801
911
|
})
|
|
802
912
|
),
|
|
803
913
|
onSelect: (d) => {
|
|
804
|
-
|
|
914
|
+
$(d) && r(d.value);
|
|
805
915
|
}
|
|
806
916
|
}
|
|
807
917
|
) }),
|
|
@@ -810,13 +920,13 @@ function pt({
|
|
|
810
920
|
{
|
|
811
921
|
isMulti: !0,
|
|
812
922
|
isCreatable: !0,
|
|
813
|
-
defaultValue: (Array.isArray(
|
|
923
|
+
defaultValue: (Array.isArray(o) ? o : []).map((d) => ({
|
|
814
924
|
value: d,
|
|
815
925
|
label: d.toString()
|
|
816
926
|
})),
|
|
817
927
|
initialValues: [],
|
|
818
928
|
onSelect: (d) => {
|
|
819
|
-
Y(d) &&
|
|
929
|
+
Y(d) && u(
|
|
820
930
|
d.map(
|
|
821
931
|
(m) => typeof m.value == "boolean" ? m.value.toString() : m.value
|
|
822
932
|
)
|
|
@@ -826,111 +936,111 @@ function pt({
|
|
|
826
936
|
) })
|
|
827
937
|
] });
|
|
828
938
|
}
|
|
829
|
-
function
|
|
830
|
-
value:
|
|
831
|
-
onChange:
|
|
939
|
+
function Ca({
|
|
940
|
+
value: t,
|
|
941
|
+
onChange: a
|
|
832
942
|
}) {
|
|
833
|
-
const [s,
|
|
834
|
-
Array.isArray(
|
|
835
|
-
), [
|
|
836
|
-
Array.isArray(
|
|
943
|
+
const [s, l] = f(
|
|
944
|
+
Array.isArray(t) && typeof t[0] == "number" ? t[0] : null
|
|
945
|
+
), [c, n] = f(
|
|
946
|
+
Array.isArray(t) && typeof t[1] == "number" ? t[1] : null
|
|
837
947
|
);
|
|
838
948
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
839
949
|
/* @__PURE__ */ e.jsx("div", { className: "grow", children: /* @__PURE__ */ e.jsx(
|
|
840
|
-
|
|
950
|
+
g,
|
|
841
951
|
{
|
|
842
952
|
type: "number",
|
|
843
953
|
placeholder: "Min",
|
|
844
954
|
value: s ?? "",
|
|
845
|
-
onChange: (
|
|
846
|
-
const
|
|
847
|
-
|
|
955
|
+
onChange: (r) => {
|
|
956
|
+
const o = parseInt(r.currentTarget.value, 10);
|
|
957
|
+
l(Number.isNaN(o) ? null : o), a([Number.isNaN(o) ? null : o, c]);
|
|
848
958
|
}
|
|
849
959
|
}
|
|
850
960
|
) }),
|
|
851
961
|
/* @__PURE__ */ e.jsx("span", { className: "text-gray-300", children: "to" }),
|
|
852
962
|
/* @__PURE__ */ e.jsx("div", { className: "grow", children: /* @__PURE__ */ e.jsx(
|
|
853
|
-
|
|
963
|
+
g,
|
|
854
964
|
{
|
|
855
965
|
type: "number",
|
|
856
966
|
placeholder: "Max",
|
|
857
|
-
value:
|
|
858
|
-
onChange: (
|
|
859
|
-
const
|
|
860
|
-
|
|
967
|
+
value: c ?? "",
|
|
968
|
+
onChange: (r) => {
|
|
969
|
+
const o = parseInt(r.currentTarget.value, 10);
|
|
970
|
+
n(Number.isNaN(o) ? null : o), a([s, Number.isNaN(o) ? null : o]);
|
|
861
971
|
}
|
|
862
972
|
}
|
|
863
973
|
) })
|
|
864
974
|
] });
|
|
865
975
|
}
|
|
866
|
-
function
|
|
867
|
-
value:
|
|
868
|
-
onChange:
|
|
976
|
+
function Ea({
|
|
977
|
+
value: t,
|
|
978
|
+
onChange: a
|
|
869
979
|
}) {
|
|
870
|
-
const [s,
|
|
871
|
-
Array.isArray(
|
|
872
|
-
), [
|
|
873
|
-
Array.isArray(
|
|
980
|
+
const [s, l] = f(
|
|
981
|
+
Array.isArray(t) && typeof t[0] == "string" ? t[0] : null
|
|
982
|
+
), [c, n] = f(
|
|
983
|
+
Array.isArray(t) && typeof t[1] == "string" ? t[1] : null
|
|
874
984
|
);
|
|
875
985
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
876
986
|
/* @__PURE__ */ e.jsx("div", { className: "grow", children: /* @__PURE__ */ e.jsx(
|
|
877
|
-
|
|
987
|
+
g,
|
|
878
988
|
{
|
|
879
989
|
type: "text",
|
|
880
990
|
placeholder: "Min",
|
|
881
991
|
value: s ?? "",
|
|
882
|
-
onChange: (
|
|
883
|
-
const
|
|
884
|
-
|
|
992
|
+
onChange: (r) => {
|
|
993
|
+
const o = r.currentTarget.value;
|
|
994
|
+
l(o), a([o, c]);
|
|
885
995
|
}
|
|
886
996
|
}
|
|
887
997
|
) }),
|
|
888
998
|
/* @__PURE__ */ e.jsx("span", { className: "text-gray-300", children: "to" }),
|
|
889
999
|
/* @__PURE__ */ e.jsx("div", { className: "grow", children: /* @__PURE__ */ e.jsx(
|
|
890
|
-
|
|
1000
|
+
g,
|
|
891
1001
|
{
|
|
892
1002
|
type: "text",
|
|
893
1003
|
placeholder: "Max",
|
|
894
|
-
value:
|
|
895
|
-
onChange: (
|
|
896
|
-
const
|
|
897
|
-
|
|
1004
|
+
value: c ?? "",
|
|
1005
|
+
onChange: (r) => {
|
|
1006
|
+
const o = r.currentTarget.value;
|
|
1007
|
+
n(o), a([s, o]);
|
|
898
1008
|
}
|
|
899
1009
|
}
|
|
900
1010
|
) })
|
|
901
1011
|
] });
|
|
902
1012
|
}
|
|
903
|
-
function
|
|
904
|
-
item:
|
|
905
|
-
pathPrefix:
|
|
1013
|
+
function ka({
|
|
1014
|
+
item: t,
|
|
1015
|
+
pathPrefix: a
|
|
906
1016
|
}) {
|
|
907
|
-
const { setPath: s } =
|
|
908
|
-
if (
|
|
909
|
-
|
|
1017
|
+
const { setPath: s } = b(), { infos: l } = te(t), { user: c } = X(), n = `${a}.value`;
|
|
1018
|
+
if (t == null || K.includes(
|
|
1019
|
+
t.matcher
|
|
910
1020
|
))
|
|
911
1021
|
return null;
|
|
912
|
-
const
|
|
913
|
-
let
|
|
914
|
-
|
|
915
|
-
(
|
|
916
|
-
)) && (
|
|
917
|
-
let
|
|
918
|
-
switch (
|
|
1022
|
+
const r = t;
|
|
1023
|
+
let o = l?.field?.type;
|
|
1024
|
+
o == null && (o = ae(r.value)), (typeof r.value == "string" && /^{{.*}}$/.test(r.value) || Array.isArray(r.value) && r.value.some(
|
|
1025
|
+
(i) => typeof i == "string" && /^{{.*}}$/.test(i)
|
|
1026
|
+
)) && (o = "string");
|
|
1027
|
+
let u = null;
|
|
1028
|
+
switch (o) {
|
|
919
1029
|
case "datetime": {
|
|
920
|
-
|
|
1030
|
+
u = "date";
|
|
921
1031
|
break;
|
|
922
1032
|
}
|
|
923
1033
|
case "boolean": {
|
|
924
|
-
|
|
1034
|
+
u = "boolean";
|
|
925
1035
|
break;
|
|
926
1036
|
}
|
|
927
1037
|
case "string": {
|
|
928
|
-
|
|
1038
|
+
u = "text";
|
|
929
1039
|
break;
|
|
930
1040
|
}
|
|
931
1041
|
case "integer":
|
|
932
1042
|
case "float": {
|
|
933
|
-
|
|
1043
|
+
u = "number";
|
|
934
1044
|
break;
|
|
935
1045
|
}
|
|
936
1046
|
case "array":
|
|
@@ -938,11 +1048,11 @@ function bt({
|
|
|
938
1048
|
case "object":
|
|
939
1049
|
break;
|
|
940
1050
|
default: {
|
|
941
|
-
|
|
1051
|
+
u = "text";
|
|
942
1052
|
break;
|
|
943
1053
|
}
|
|
944
1054
|
}
|
|
945
|
-
switch (
|
|
1055
|
+
switch (r.matcher) {
|
|
946
1056
|
case "eq":
|
|
947
1057
|
case "not_eq":
|
|
948
1058
|
case "lt":
|
|
@@ -962,54 +1072,54 @@ function bt({
|
|
|
962
1072
|
case "gteq_lt":
|
|
963
1073
|
case "gt_lteq":
|
|
964
1074
|
case "gteq_lteq": {
|
|
965
|
-
|
|
1075
|
+
u === "number" && (u = "numberRange"), u === "text" && (u = "textRange"), u === "date" && (u = "dateRange");
|
|
966
1076
|
break;
|
|
967
1077
|
}
|
|
968
1078
|
case "is_in":
|
|
969
1079
|
case "is_not_in": {
|
|
970
|
-
|
|
1080
|
+
u = "tag";
|
|
971
1081
|
break;
|
|
972
1082
|
}
|
|
973
1083
|
case "array_match": {
|
|
974
|
-
|
|
1084
|
+
u = "arrayMatch";
|
|
975
1085
|
break;
|
|
976
1086
|
}
|
|
977
1087
|
default: {
|
|
978
|
-
R(
|
|
1088
|
+
R(r.matcher);
|
|
979
1089
|
break;
|
|
980
1090
|
}
|
|
981
1091
|
}
|
|
982
|
-
switch (
|
|
1092
|
+
switch (u) {
|
|
983
1093
|
case "date": {
|
|
984
|
-
const
|
|
985
|
-
typeof
|
|
1094
|
+
const i = L(
|
|
1095
|
+
typeof r.value == "string" ? r.value : ""
|
|
986
1096
|
);
|
|
987
1097
|
return /* @__PURE__ */ e.jsx(
|
|
988
|
-
|
|
1098
|
+
la,
|
|
989
1099
|
{
|
|
990
|
-
value:
|
|
1100
|
+
value: E(i) ? i : void 0,
|
|
991
1101
|
showTimeSelect: !0,
|
|
992
1102
|
placeholder: "Enter value",
|
|
993
1103
|
onChange: (d) => {
|
|
994
|
-
s(
|
|
1104
|
+
s(n, d?.toJSON());
|
|
995
1105
|
},
|
|
996
|
-
timezone:
|
|
1106
|
+
timezone: c?.timezone
|
|
997
1107
|
}
|
|
998
1108
|
);
|
|
999
1109
|
}
|
|
1000
1110
|
case "dateRange": {
|
|
1001
|
-
const
|
|
1002
|
-
const m =
|
|
1003
|
-
return
|
|
1111
|
+
const i = Array.isArray(r.value) ? r.value.map((d) => {
|
|
1112
|
+
const m = L(typeof d == "string" ? d : "");
|
|
1113
|
+
return E(m) ? m : null;
|
|
1004
1114
|
}) : [null, null];
|
|
1005
1115
|
return /* @__PURE__ */ e.jsx(
|
|
1006
|
-
|
|
1116
|
+
ra,
|
|
1007
1117
|
{
|
|
1008
|
-
value:
|
|
1118
|
+
value: i,
|
|
1009
1119
|
showTimeSelect: !0,
|
|
1010
1120
|
onChange: (d) => {
|
|
1011
1121
|
s(
|
|
1012
|
-
`${
|
|
1122
|
+
`${a}.value`,
|
|
1013
1123
|
d.map((m) => m?.toJSON() ?? null)
|
|
1014
1124
|
);
|
|
1015
1125
|
}
|
|
@@ -1018,30 +1128,30 @@ function bt({
|
|
|
1018
1128
|
}
|
|
1019
1129
|
case "numberRange":
|
|
1020
1130
|
return /* @__PURE__ */ e.jsx(
|
|
1021
|
-
|
|
1131
|
+
Ca,
|
|
1022
1132
|
{
|
|
1023
|
-
value:
|
|
1024
|
-
onChange: (
|
|
1025
|
-
s(
|
|
1133
|
+
value: r.value,
|
|
1134
|
+
onChange: (i) => {
|
|
1135
|
+
s(n, i);
|
|
1026
1136
|
}
|
|
1027
1137
|
}
|
|
1028
1138
|
);
|
|
1029
1139
|
case "textRange":
|
|
1030
1140
|
return /* @__PURE__ */ e.jsx(
|
|
1031
|
-
|
|
1141
|
+
Ea,
|
|
1032
1142
|
{
|
|
1033
|
-
value:
|
|
1034
|
-
onChange: (
|
|
1035
|
-
s(
|
|
1143
|
+
value: r.value,
|
|
1144
|
+
onChange: (i) => {
|
|
1145
|
+
s(n, i);
|
|
1036
1146
|
}
|
|
1037
1147
|
}
|
|
1038
1148
|
);
|
|
1039
1149
|
case "arrayMatch":
|
|
1040
1150
|
return /* @__PURE__ */ e.jsx(
|
|
1041
|
-
|
|
1151
|
+
wa,
|
|
1042
1152
|
{
|
|
1043
|
-
value:
|
|
1044
|
-
pathPrefix: `${
|
|
1153
|
+
value: r.value,
|
|
1154
|
+
pathPrefix: `${a}.value`
|
|
1045
1155
|
}
|
|
1046
1156
|
);
|
|
1047
1157
|
case "tag":
|
|
@@ -1051,16 +1161,16 @@ function bt({
|
|
|
1051
1161
|
isMulti: !0,
|
|
1052
1162
|
isClearable: !1,
|
|
1053
1163
|
isCreatable: !0,
|
|
1054
|
-
defaultValue: Array.isArray(
|
|
1055
|
-
label:
|
|
1056
|
-
value:
|
|
1164
|
+
defaultValue: Array.isArray(r.value) ? r.value.map((i) => ({
|
|
1165
|
+
label: i.toString(),
|
|
1166
|
+
value: i
|
|
1057
1167
|
})) : [],
|
|
1058
1168
|
initialValues: [],
|
|
1059
|
-
onSelect: (
|
|
1060
|
-
Y(
|
|
1061
|
-
`${
|
|
1062
|
-
|
|
1063
|
-
if (
|
|
1169
|
+
onSelect: (i) => {
|
|
1170
|
+
Y(i) && s(
|
|
1171
|
+
`${a}.value`,
|
|
1172
|
+
i.map((d) => {
|
|
1173
|
+
if (o === "integer") {
|
|
1064
1174
|
const m = parseInt(d.value.toString(), 10);
|
|
1065
1175
|
return Number.isNaN(m) ? null : m;
|
|
1066
1176
|
}
|
|
@@ -1072,16 +1182,16 @@ function bt({
|
|
|
1072
1182
|
);
|
|
1073
1183
|
case "number":
|
|
1074
1184
|
return /* @__PURE__ */ e.jsx(
|
|
1075
|
-
|
|
1185
|
+
g,
|
|
1076
1186
|
{
|
|
1077
|
-
name: `${
|
|
1187
|
+
name: `${a}.value`,
|
|
1078
1188
|
type: "number",
|
|
1079
|
-
defaultValue: typeof
|
|
1189
|
+
defaultValue: typeof r.value == "number" ? r.value : "",
|
|
1080
1190
|
placeholder: "Enter value",
|
|
1081
|
-
onChange: (
|
|
1191
|
+
onChange: (i) => {
|
|
1082
1192
|
s(
|
|
1083
|
-
`${
|
|
1084
|
-
parseInt(
|
|
1193
|
+
`${a}.value`,
|
|
1194
|
+
parseInt(i.currentTarget.value, 10)
|
|
1085
1195
|
);
|
|
1086
1196
|
}
|
|
1087
1197
|
}
|
|
@@ -1090,31 +1200,31 @@ function bt({
|
|
|
1090
1200
|
return /* @__PURE__ */ e.jsx(
|
|
1091
1201
|
v,
|
|
1092
1202
|
{
|
|
1093
|
-
name: `${
|
|
1094
|
-
defaultValue: typeof
|
|
1095
|
-
label:
|
|
1096
|
-
value:
|
|
1203
|
+
name: `${a}.value`,
|
|
1204
|
+
defaultValue: typeof r.value == "boolean" ? {
|
|
1205
|
+
label: r.value ? "Yes" : "No",
|
|
1206
|
+
value: r.value
|
|
1097
1207
|
} : void 0,
|
|
1098
1208
|
initialValues: [
|
|
1099
1209
|
{ label: "Yes", value: !0 },
|
|
1100
1210
|
{ label: "No", value: !1 }
|
|
1101
1211
|
],
|
|
1102
|
-
onSelect: (
|
|
1103
|
-
|
|
1212
|
+
onSelect: (i) => {
|
|
1213
|
+
$(i) && s(n, i.value);
|
|
1104
1214
|
}
|
|
1105
1215
|
}
|
|
1106
1216
|
);
|
|
1107
1217
|
case "text":
|
|
1108
1218
|
case null:
|
|
1109
1219
|
return /* @__PURE__ */ e.jsx(
|
|
1110
|
-
|
|
1220
|
+
g,
|
|
1111
1221
|
{
|
|
1112
|
-
name: `${
|
|
1222
|
+
name: `${a}.value`,
|
|
1113
1223
|
type: "text",
|
|
1114
|
-
defaultValue: typeof
|
|
1224
|
+
defaultValue: typeof r.value == "string" ? r.value : JSON.stringify(r.value),
|
|
1115
1225
|
placeholder: "Enter value",
|
|
1116
|
-
onChange: (
|
|
1117
|
-
s(
|
|
1226
|
+
onChange: (i) => {
|
|
1227
|
+
s(n, i.currentTarget.value);
|
|
1118
1228
|
}
|
|
1119
1229
|
}
|
|
1120
1230
|
);
|
|
@@ -1122,33 +1232,33 @@ function bt({
|
|
|
1122
1232
|
return R();
|
|
1123
1233
|
}
|
|
1124
1234
|
}
|
|
1125
|
-
function
|
|
1126
|
-
item:
|
|
1127
|
-
nestingLevel:
|
|
1235
|
+
function Sa({
|
|
1236
|
+
item: t,
|
|
1237
|
+
nestingLevel: a,
|
|
1128
1238
|
pathPrefix: s,
|
|
1129
|
-
onDelete:
|
|
1239
|
+
onDelete: l
|
|
1130
1240
|
}) {
|
|
1131
|
-
const { setPath:
|
|
1132
|
-
return
|
|
1241
|
+
const { setPath: c } = b(), n = [];
|
|
1242
|
+
return a < 2 && (n[0] ??= [], n[0].push(
|
|
1133
1243
|
/* @__PURE__ */ e.jsx(
|
|
1134
|
-
|
|
1244
|
+
w,
|
|
1135
1245
|
{
|
|
1136
1246
|
label: "Nest conditions",
|
|
1137
1247
|
onClick: () => {
|
|
1138
|
-
|
|
1139
|
-
`${s}.nested.conditions.${(
|
|
1248
|
+
c(
|
|
1249
|
+
`${s}.nested.conditions.${(t?.nested?.conditions ?? []).length}`,
|
|
1140
1250
|
void 0
|
|
1141
1251
|
);
|
|
1142
1252
|
}
|
|
1143
1253
|
}
|
|
1144
1254
|
)
|
|
1145
|
-
)),
|
|
1255
|
+
)), l != null && (n[1] ??= [], n[1].push(
|
|
1146
1256
|
/* @__PURE__ */ e.jsx(
|
|
1147
|
-
|
|
1257
|
+
w,
|
|
1148
1258
|
{
|
|
1149
1259
|
label: "Delete",
|
|
1150
1260
|
onClick: () => {
|
|
1151
|
-
|
|
1261
|
+
c(`${s}`, null), l();
|
|
1152
1262
|
}
|
|
1153
1263
|
}
|
|
1154
1264
|
)
|
|
@@ -1156,25 +1266,19 @@ function ht({
|
|
|
1156
1266
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between gap-2 grow p-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 grow", children: [
|
|
1157
1267
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1158
1268
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1", children: /* @__PURE__ */ e.jsx(
|
|
1159
|
-
|
|
1269
|
+
ee,
|
|
1160
1270
|
{
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
onChange: (n) => {
|
|
1165
|
-
o(`${s}.field`, n.currentTarget.value);
|
|
1166
|
-
},
|
|
1167
|
-
onBlur: (n) => {
|
|
1168
|
-
o(`${s}.field`, n.currentTarget.value);
|
|
1169
|
-
}
|
|
1271
|
+
preset: "condition",
|
|
1272
|
+
value: t?.field,
|
|
1273
|
+
name: `${s}.field`
|
|
1170
1274
|
}
|
|
1171
1275
|
) }),
|
|
1172
|
-
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
|
|
1276
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(Na, { item: t, pathPrefix: s }) })
|
|
1173
1277
|
] }),
|
|
1174
|
-
/* @__PURE__ */ e.jsx(
|
|
1278
|
+
/* @__PURE__ */ e.jsx(ka, { item: t, pathPrefix: s })
|
|
1175
1279
|
] }) }),
|
|
1176
|
-
|
|
1177
|
-
|
|
1280
|
+
n.length > 0 && /* @__PURE__ */ e.jsx(
|
|
1281
|
+
I,
|
|
1178
1282
|
{
|
|
1179
1283
|
className: "w-8 border-l border-gray-100 flex items-center justify-center self-stretch",
|
|
1180
1284
|
dropdownLabel: /* @__PURE__ */ e.jsx(
|
|
@@ -1182,92 +1286,92 @@ function ht({
|
|
|
1182
1286
|
{
|
|
1183
1287
|
type: "button",
|
|
1184
1288
|
className: "flex items-center justify-center self-stretch grow",
|
|
1185
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1289
|
+
children: /* @__PURE__ */ e.jsx(x, { name: "dotsThreeVertical", size: 16, weight: "bold" })
|
|
1186
1290
|
}
|
|
1187
1291
|
),
|
|
1188
|
-
dropdownItems:
|
|
1292
|
+
dropdownItems: n.map((r, o, u) => (
|
|
1189
1293
|
// biome-ignore lint/suspicious/noArrayIndexKey: Using index as key is acceptable here since items are static
|
|
1190
|
-
/* @__PURE__ */ e.jsxs(
|
|
1191
|
-
|
|
1294
|
+
/* @__PURE__ */ e.jsxs(O.Fragment, { children: [
|
|
1295
|
+
r.map((i, d) => (
|
|
1192
1296
|
// biome-ignore lint/suspicious/noArrayIndexKey: Using index as key is acceptable here since items are static
|
|
1193
|
-
/* @__PURE__ */ e.jsx(
|
|
1297
|
+
/* @__PURE__ */ e.jsx(O.Fragment, { children: i }, d)
|
|
1194
1298
|
)),
|
|
1195
|
-
|
|
1196
|
-
] },
|
|
1299
|
+
o < u.length - 1 && /* @__PURE__ */ e.jsx(H, {})
|
|
1300
|
+
] }, o)
|
|
1197
1301
|
))
|
|
1198
1302
|
}
|
|
1199
1303
|
)
|
|
1200
1304
|
] });
|
|
1201
1305
|
}
|
|
1202
|
-
function
|
|
1203
|
-
item:
|
|
1204
|
-
children:
|
|
1306
|
+
function se({
|
|
1307
|
+
item: t,
|
|
1308
|
+
children: a,
|
|
1205
1309
|
nestingLevel: s = 0,
|
|
1206
|
-
pathPrefix:
|
|
1310
|
+
pathPrefix: l
|
|
1207
1311
|
}) {
|
|
1208
1312
|
const {
|
|
1209
|
-
state: { selectedRuleIndex:
|
|
1210
|
-
} =
|
|
1313
|
+
state: { selectedRuleIndex: c }
|
|
1314
|
+
} = b(), n = t?.conditions_logic?.toLowerCase() ?? "and", { setPath: r } = b(), [o, u] = f(0), i = s > 0;
|
|
1211
1315
|
return /* @__PURE__ */ e.jsxs(
|
|
1212
1316
|
"div",
|
|
1213
1317
|
{
|
|
1214
|
-
className:
|
|
1215
|
-
"p-4 border border-gray-200 rounded-md":
|
|
1318
|
+
className: A("query-group", {
|
|
1319
|
+
"p-4 border border-gray-200 rounded-md": i
|
|
1216
1320
|
}),
|
|
1217
1321
|
children: [
|
|
1218
|
-
|
|
1219
|
-
|
|
1322
|
+
a,
|
|
1323
|
+
t != null && (t.conditions ?? []).length > 0 && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1220
1324
|
/* @__PURE__ */ e.jsxs(
|
|
1221
1325
|
"select",
|
|
1222
1326
|
{
|
|
1223
1327
|
onChange: (d) => {
|
|
1224
|
-
|
|
1225
|
-
`${
|
|
1328
|
+
r(
|
|
1329
|
+
`${l}.conditions_logic`,
|
|
1226
1330
|
d.currentTarget.value
|
|
1227
1331
|
);
|
|
1228
1332
|
},
|
|
1229
|
-
defaultValue:
|
|
1333
|
+
defaultValue: n,
|
|
1230
1334
|
className: "pl-4 pr-8 py-2 font-bold focus:ring-0 focus:outline-hidden appearance-none bg-gray-50 border border-gray-200 rounded-md text-sm leading-4",
|
|
1231
1335
|
children: [
|
|
1232
1336
|
/* @__PURE__ */ e.jsxs("option", { value: "and", children: [
|
|
1233
|
-
|
|
1337
|
+
i ? "Nested in " : "",
|
|
1234
1338
|
"AND"
|
|
1235
1339
|
] }),
|
|
1236
1340
|
/* @__PURE__ */ e.jsxs("option", { value: "or", children: [
|
|
1237
|
-
|
|
1341
|
+
i ? "Nested in " : "",
|
|
1238
1342
|
"OR"
|
|
1239
1343
|
] })
|
|
1240
1344
|
]
|
|
1241
1345
|
}
|
|
1242
1346
|
),
|
|
1243
|
-
/* @__PURE__ */ e.jsx("div", { className: "border-l border-gray-200 ml-3 pt-3", children:
|
|
1244
|
-
const
|
|
1347
|
+
/* @__PURE__ */ e.jsx("div", { className: "border-l border-gray-200 ml-3 pt-3", children: t?.conditions?.map((d, m, j) => {
|
|
1348
|
+
const h = m === j.length - 1;
|
|
1245
1349
|
return /* @__PURE__ */ e.jsxs(
|
|
1246
1350
|
"div",
|
|
1247
1351
|
{
|
|
1248
1352
|
className: "flex items-center mb-4 last:mb-0 relative",
|
|
1249
1353
|
children: [
|
|
1250
|
-
/* @__PURE__ */ e.jsx(
|
|
1354
|
+
/* @__PURE__ */ e.jsx(Va, { rounded: h }),
|
|
1251
1355
|
/* @__PURE__ */ e.jsx("div", { className: "ml-4 w-full", children: /* @__PURE__ */ e.jsx(
|
|
1252
|
-
|
|
1356
|
+
se,
|
|
1253
1357
|
{
|
|
1254
1358
|
item: d?.nested ?? void 0,
|
|
1255
1359
|
nestingLevel: d?.nested != null ? s + 1 : 0,
|
|
1256
|
-
pathPrefix: `${
|
|
1360
|
+
pathPrefix: `${l}.conditions.${m}.nested`,
|
|
1257
1361
|
children: /* @__PURE__ */ e.jsx(
|
|
1258
1362
|
"div",
|
|
1259
1363
|
{
|
|
1260
|
-
className:
|
|
1364
|
+
className: A({
|
|
1261
1365
|
"mb-4": d?.nested != null
|
|
1262
1366
|
}),
|
|
1263
1367
|
children: /* @__PURE__ */ e.jsx(
|
|
1264
|
-
|
|
1368
|
+
Sa,
|
|
1265
1369
|
{
|
|
1266
1370
|
item: d,
|
|
1267
1371
|
nestingLevel: s,
|
|
1268
|
-
pathPrefix: `${
|
|
1269
|
-
onDelete:
|
|
1270
|
-
|
|
1372
|
+
pathPrefix: `${l}.conditions.${m}`,
|
|
1373
|
+
onDelete: j.length > 1 || s > 0 ? () => {
|
|
1374
|
+
u((p) => p + 1);
|
|
1271
1375
|
} : void 0
|
|
1272
1376
|
}
|
|
1273
1377
|
)
|
|
@@ -1277,7 +1381,7 @@ function Q({
|
|
|
1277
1381
|
) })
|
|
1278
1382
|
]
|
|
1279
1383
|
},
|
|
1280
|
-
`${
|
|
1384
|
+
`${c}-${m}-${o}`
|
|
1281
1385
|
);
|
|
1282
1386
|
}) })
|
|
1283
1387
|
] })
|
|
@@ -1285,75 +1389,84 @@ function Q({
|
|
|
1285
1389
|
}
|
|
1286
1390
|
);
|
|
1287
1391
|
}
|
|
1288
|
-
function
|
|
1289
|
-
rounded:
|
|
1392
|
+
function Va({
|
|
1393
|
+
rounded: t = !1
|
|
1290
1394
|
}) {
|
|
1291
|
-
return
|
|
1395
|
+
return t ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1292
1396
|
/* @__PURE__ */ e.jsx("div", { className: "absolute -left-px top-1/2 w-px h-1/2 bg-white" }),
|
|
1293
1397
|
/* @__PURE__ */ e.jsx("div", { className: "absolute -left-px top-1/2 -translate-y-1/2 w-3.5 h-3.5 border-l border-b rounded-es-sm bg-white border-gray-200" })
|
|
1294
1398
|
] }) : /* @__PURE__ */ e.jsx("div", { className: "absolute left-0 top-1/2 -translate-y-1/2 w-3.5 h-px bg-gray-200" });
|
|
1295
1399
|
}
|
|
1296
|
-
function
|
|
1400
|
+
function Ra() {
|
|
1297
1401
|
const {
|
|
1298
|
-
setPath:
|
|
1299
|
-
state: { value:
|
|
1300
|
-
} =
|
|
1301
|
-
|
|
1402
|
+
setPath: t,
|
|
1403
|
+
state: { value: a, selectedRuleIndex: s }
|
|
1404
|
+
} = b(), [l, c] = f(
|
|
1405
|
+
a.rules?.[s]?.name ?? ""
|
|
1302
1406
|
);
|
|
1303
|
-
return
|
|
1304
|
-
|
|
1305
|
-
}, [s]), //
|
|
1407
|
+
return T(() => {
|
|
1408
|
+
c(a.rules?.[s]?.name ?? "");
|
|
1409
|
+
}, [s]), // <Input
|
|
1410
|
+
// value={value.rules?.[selectedRuleIndex]?.name}
|
|
1411
|
+
// onChange={(event) => {
|
|
1412
|
+
// const target = event.currentTarget
|
|
1413
|
+
// const value = target.value.replace(/[\n\s]+/g, " ").trim()
|
|
1414
|
+
// setPath(`rules.${selectedRuleIndex}.name`, value)
|
|
1415
|
+
// }}
|
|
1416
|
+
// className="bg-transparent border-0 shadow-none field-sizing-content"
|
|
1417
|
+
// />
|
|
1418
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: This <div> is used with contentEditable
|
|
1306
1419
|
/* @__PURE__ */ e.jsx(
|
|
1307
1420
|
"div",
|
|
1308
1421
|
{
|
|
1309
1422
|
contentEditable: "plaintext-only",
|
|
1310
1423
|
suppressContentEditableWarning: !0,
|
|
1311
|
-
onInput: (
|
|
1312
|
-
const
|
|
1313
|
-
|
|
1424
|
+
onInput: (n) => {
|
|
1425
|
+
const o = n.currentTarget.innerText.replace(/[\n\s]+/g, " ").trim();
|
|
1426
|
+
t(`rules.${s}.name`, o);
|
|
1314
1427
|
},
|
|
1315
|
-
onKeyDown: (
|
|
1316
|
-
|
|
1428
|
+
onKeyDown: (n) => {
|
|
1429
|
+
n.key === "Enter" && (n.preventDefault(), n.currentTarget.blur());
|
|
1317
1430
|
},
|
|
1318
|
-
onBlur: (
|
|
1319
|
-
const
|
|
1320
|
-
|
|
1431
|
+
onBlur: (n) => {
|
|
1432
|
+
const r = n.currentTarget;
|
|
1433
|
+
r.innerText = r.innerText.replace(/[\n\s]+/g, " ").trim();
|
|
1321
1434
|
},
|
|
1322
|
-
children:
|
|
1435
|
+
children: l
|
|
1323
1436
|
},
|
|
1324
1437
|
s
|
|
1325
1438
|
);
|
|
1326
1439
|
}
|
|
1327
|
-
const
|
|
1440
|
+
const W = {
|
|
1328
1441
|
rules: []
|
|
1329
|
-
},
|
|
1442
|
+
}, k = (t) => {
|
|
1330
1443
|
try {
|
|
1331
|
-
return JSON.parse(
|
|
1444
|
+
return JSON.parse(t ?? JSON.stringify(W));
|
|
1332
1445
|
} catch {
|
|
1333
|
-
return
|
|
1446
|
+
return W;
|
|
1334
1447
|
}
|
|
1335
|
-
},
|
|
1448
|
+
}, Aa = (t) => {
|
|
1336
1449
|
try {
|
|
1337
|
-
return JSON.parse(
|
|
1450
|
+
return JSON.parse(t ?? "{}"), !0;
|
|
1338
1451
|
} catch {
|
|
1339
1452
|
return !1;
|
|
1340
1453
|
}
|
|
1341
1454
|
};
|
|
1342
|
-
function
|
|
1455
|
+
function Pa(t) {
|
|
1343
1456
|
const {
|
|
1344
|
-
settings: { domain:
|
|
1345
|
-
} =
|
|
1346
|
-
|
|
1457
|
+
settings: { domain: a }
|
|
1458
|
+
} = X(), [s, l] = f([]), [c, n] = f(
|
|
1459
|
+
k(t.value ?? t.defaultValue)
|
|
1347
1460
|
);
|
|
1348
|
-
return
|
|
1461
|
+
return T(
|
|
1349
1462
|
function() {
|
|
1350
|
-
|
|
1463
|
+
c.rules?.length === 0 && n(k(t.value));
|
|
1351
1464
|
},
|
|
1352
|
-
[
|
|
1353
|
-
),
|
|
1465
|
+
[t.value]
|
|
1466
|
+
), T(
|
|
1354
1467
|
function() {
|
|
1355
|
-
|
|
1356
|
-
const
|
|
1468
|
+
ia(t.schemaType, a).then((o) => {
|
|
1469
|
+
const i = y.object({
|
|
1357
1470
|
properties: y.object({
|
|
1358
1471
|
rules: y.object({
|
|
1359
1472
|
items: y.object({
|
|
@@ -1375,188 +1488,227 @@ function Et(a) {
|
|
|
1375
1488
|
})
|
|
1376
1489
|
})
|
|
1377
1490
|
})
|
|
1378
|
-
}).parse(
|
|
1491
|
+
}).parse(o).properties.rules.items.properties.actions.items.anyOf.flatMap(
|
|
1379
1492
|
(d) => d.properties.type.enum
|
|
1380
1493
|
);
|
|
1381
|
-
|
|
1494
|
+
l([...new Set(i)]);
|
|
1382
1495
|
});
|
|
1383
1496
|
},
|
|
1384
|
-
[
|
|
1497
|
+
[a]
|
|
1385
1498
|
), /* @__PURE__ */ e.jsx(
|
|
1386
|
-
|
|
1499
|
+
ba,
|
|
1387
1500
|
{
|
|
1388
1501
|
initialValue: {
|
|
1389
|
-
value: { rules:
|
|
1390
|
-
availableActionTypes: s
|
|
1502
|
+
value: { rules: c.rules },
|
|
1503
|
+
availableActionTypes: s,
|
|
1504
|
+
schemaType: t.schemaType
|
|
1391
1505
|
},
|
|
1392
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1506
|
+
children: /* @__PURE__ */ e.jsx(Ia, { ...t })
|
|
1393
1507
|
}
|
|
1394
1508
|
);
|
|
1395
1509
|
}
|
|
1396
|
-
function
|
|
1510
|
+
function Ia(t) {
|
|
1397
1511
|
const {
|
|
1398
|
-
state: { value:
|
|
1399
|
-
setSelectedRuleIndex:
|
|
1400
|
-
setValue:
|
|
1401
|
-
setPath:
|
|
1402
|
-
} =
|
|
1403
|
-
|
|
1404
|
-
),
|
|
1405
|
-
|
|
1512
|
+
state: { value: a, selectedRuleIndex: s },
|
|
1513
|
+
setSelectedRuleIndex: l,
|
|
1514
|
+
setValue: c,
|
|
1515
|
+
setPath: n
|
|
1516
|
+
} = b(), [r, o] = f(
|
|
1517
|
+
t.defaultCodeEditorVisible ?? !1
|
|
1518
|
+
), u = a.rules?.[s], i = G(null), [d, m] = f(0);
|
|
1519
|
+
T(
|
|
1406
1520
|
function() {
|
|
1407
|
-
|
|
1521
|
+
V(k(i.current?.getValue()), a) || i.current?.setValue(JSON.stringify(a, null, 2)), t.onChange?.(a);
|
|
1408
1522
|
},
|
|
1409
|
-
[
|
|
1523
|
+
[a]
|
|
1410
1524
|
);
|
|
1411
|
-
const
|
|
1412
|
-
(
|
|
1413
|
-
const
|
|
1414
|
-
|
|
1525
|
+
const j = C(
|
|
1526
|
+
(h) => {
|
|
1527
|
+
const p = k(h);
|
|
1528
|
+
i.current?.hasTextFocus() && Aa(h) && !V(p, a) && (c(p), m((_) => _ + 1));
|
|
1415
1529
|
},
|
|
1416
|
-
[
|
|
1530
|
+
[a]
|
|
1417
1531
|
);
|
|
1418
1532
|
return /* @__PURE__ */ e.jsx(
|
|
1419
|
-
|
|
1533
|
+
oa,
|
|
1420
1534
|
{
|
|
1421
|
-
hint:
|
|
1422
|
-
feedback:
|
|
1535
|
+
hint: t.hint,
|
|
1536
|
+
feedback: t.feedback,
|
|
1423
1537
|
className: "h-full [&>div:first-of-type]:h-full",
|
|
1424
1538
|
children: /* @__PURE__ */ e.jsxs("section", { className: "flex h-full", children: [
|
|
1425
1539
|
/* @__PURE__ */ e.jsxs(
|
|
1426
1540
|
"div",
|
|
1427
1541
|
{
|
|
1428
|
-
className: `shrink-0 basis-3/5 overflow-x-auto relative flex flex-col ${
|
|
1542
|
+
className: `shrink-0 basis-3/5 overflow-x-auto relative flex flex-col ${r ? "" : "grow"}`,
|
|
1429
1543
|
children: [
|
|
1430
|
-
/* @__PURE__ */ e.jsxs("header", { className: "w-full bg-white border-b border-gray-200
|
|
1431
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center
|
|
1432
|
-
|
|
1433
|
-
const
|
|
1434
|
-
return /* @__PURE__ */ e.
|
|
1435
|
-
"
|
|
1544
|
+
/* @__PURE__ */ e.jsxs("header", { className: "w-full bg-white border-b border-gray-200 px-4 flex text-[13px] gap-4 text-gray-400 font-semibold items-center", children: [
|
|
1545
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center flex-wrap basis-full", children: [
|
|
1546
|
+
a.rules?.map((h, p, _) => {
|
|
1547
|
+
const ne = `#${(p + 1).toString().padStart(2, "0")}`;
|
|
1548
|
+
return /* @__PURE__ */ e.jsxs(
|
|
1549
|
+
"div",
|
|
1436
1550
|
{
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1551
|
+
className: "flex items-center py-3 pl-4 pr-2 border-r basis-[88px] justify-center",
|
|
1552
|
+
children: [
|
|
1553
|
+
/* @__PURE__ */ e.jsx(
|
|
1554
|
+
"button",
|
|
1555
|
+
{
|
|
1556
|
+
type: "button",
|
|
1557
|
+
className: A("font-bold mr-2", {
|
|
1558
|
+
"text-black": s === p
|
|
1559
|
+
}),
|
|
1560
|
+
onClick: () => {
|
|
1561
|
+
l(p);
|
|
1562
|
+
},
|
|
1563
|
+
children: ne
|
|
1564
|
+
}
|
|
1565
|
+
),
|
|
1566
|
+
/* @__PURE__ */ e.jsx(
|
|
1567
|
+
I,
|
|
1568
|
+
{
|
|
1569
|
+
menuPosition: p === 0 ? "bottom-left" : "bottom-right",
|
|
1570
|
+
dropdownLabel: /* @__PURE__ */ e.jsx(N, { variant: "circle", children: /* @__PURE__ */ e.jsx(x, { name: "dotsThreeVertical", size: 16 }) }),
|
|
1571
|
+
dropdownItems: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1572
|
+
/* @__PURE__ */ e.jsx(
|
|
1573
|
+
w,
|
|
1574
|
+
{
|
|
1575
|
+
onClick: () => {
|
|
1576
|
+
const Z = a.rules?.length ?? 0;
|
|
1577
|
+
n(`rules.${Z}`, {
|
|
1578
|
+
...h,
|
|
1579
|
+
name: `${h.name} (copy)`
|
|
1580
|
+
}), l(Z);
|
|
1581
|
+
},
|
|
1582
|
+
label: "Duplicate"
|
|
1583
|
+
}
|
|
1584
|
+
),
|
|
1585
|
+
/* @__PURE__ */ e.jsx(H, {}),
|
|
1586
|
+
/* @__PURE__ */ e.jsx(
|
|
1587
|
+
w,
|
|
1588
|
+
{
|
|
1589
|
+
disabled: _.length === 1,
|
|
1590
|
+
onClick: () => {
|
|
1591
|
+
n(`rules.${p}`, null), s >= p && l(s - 1);
|
|
1592
|
+
},
|
|
1593
|
+
label: "Delete"
|
|
1594
|
+
}
|
|
1595
|
+
)
|
|
1596
|
+
] })
|
|
1597
|
+
}
|
|
1598
|
+
)
|
|
1599
|
+
]
|
|
1445
1600
|
},
|
|
1446
|
-
`${
|
|
1601
|
+
`${p}-${h.id}`
|
|
1447
1602
|
);
|
|
1448
1603
|
}),
|
|
1449
|
-
/* @__PURE__ */ e.jsx(
|
|
1450
|
-
|
|
1604
|
+
/* @__PURE__ */ e.jsx("div", { className: "min-h-[49px] flex items-center", children: /* @__PURE__ */ e.jsx(
|
|
1605
|
+
N,
|
|
1451
1606
|
{
|
|
1452
|
-
|
|
1453
|
-
className:
|
|
1454
|
-
"text-black": !0
|
|
1455
|
-
}),
|
|
1607
|
+
variant: "circle",
|
|
1608
|
+
className: "mx-4",
|
|
1456
1609
|
onClick: () => {
|
|
1457
|
-
|
|
1610
|
+
n(`rules.${a.rules?.length ?? 0}`, {
|
|
1458
1611
|
name: "Rule name",
|
|
1459
1612
|
actions: [null],
|
|
1460
1613
|
conditions: [null]
|
|
1461
|
-
}),
|
|
1614
|
+
}), l(a.rules?.length ?? 0);
|
|
1462
1615
|
},
|
|
1463
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1616
|
+
children: /* @__PURE__ */ e.jsx(x, { name: "plus", size: 16, className: "shrink-0" })
|
|
1464
1617
|
}
|
|
1465
|
-
)
|
|
1618
|
+
) })
|
|
1466
1619
|
] }),
|
|
1467
1620
|
/* @__PURE__ */ e.jsx("div", { className: "grow flex justify-end", children: /* @__PURE__ */ e.jsx(
|
|
1468
|
-
|
|
1621
|
+
N,
|
|
1469
1622
|
{
|
|
1470
|
-
|
|
1471
|
-
className: "text-blue-600 hover:text-blue-700 focus:outline-hidden focus:ring-2 focus:ring-blue-500",
|
|
1623
|
+
variant: "circle",
|
|
1472
1624
|
onClick: () => {
|
|
1473
|
-
|
|
1625
|
+
o(!r);
|
|
1474
1626
|
},
|
|
1475
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1627
|
+
children: /* @__PURE__ */ e.jsx(x, { name: "sidebarSimple", size: 16 })
|
|
1476
1628
|
}
|
|
1477
1629
|
) })
|
|
1478
1630
|
] }),
|
|
1479
|
-
/* @__PURE__ */ e.jsxs(
|
|
1631
|
+
/* @__PURE__ */ e.jsx(Da, { children: u && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1480
1632
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-8 flex items-center gap-2", children: [
|
|
1481
|
-
/* @__PURE__ */ e.jsx(
|
|
1482
|
-
/* @__PURE__ */ e.jsx(
|
|
1633
|
+
/* @__PURE__ */ e.jsx(Ra, {}),
|
|
1634
|
+
/* @__PURE__ */ e.jsx(x, { name: "pencilSimple", size: 16, className: "shrink-0" })
|
|
1483
1635
|
] }),
|
|
1484
|
-
/* @__PURE__ */ e.jsx(
|
|
1485
|
-
/* @__PURE__ */ e.jsx(
|
|
1486
|
-
/* @__PURE__ */ e.jsxs(
|
|
1636
|
+
/* @__PURE__ */ e.jsx(B, { title: "Actions", icon: "lightning", children: /* @__PURE__ */ e.jsx(Ta, { actions: u?.actions }) }),
|
|
1637
|
+
/* @__PURE__ */ e.jsx(Za, { children: "when" }),
|
|
1638
|
+
/* @__PURE__ */ e.jsxs(B, { title: "Conditions", icon: "treeView", children: [
|
|
1487
1639
|
/* @__PURE__ */ e.jsx(
|
|
1488
|
-
|
|
1640
|
+
se,
|
|
1489
1641
|
{
|
|
1490
|
-
item:
|
|
1642
|
+
item: u,
|
|
1491
1643
|
pathPrefix: `rules.${s}`
|
|
1492
1644
|
}
|
|
1493
1645
|
),
|
|
1494
1646
|
/* @__PURE__ */ e.jsx("div", { className: "mt-6", children: /* @__PURE__ */ e.jsxs(
|
|
1495
|
-
|
|
1647
|
+
N,
|
|
1496
1648
|
{
|
|
1497
1649
|
size: "small",
|
|
1498
1650
|
variant: "secondary",
|
|
1499
1651
|
alignItems: "center",
|
|
1500
1652
|
onClick: () => {
|
|
1501
|
-
|
|
1502
|
-
`rules.${s}.conditions.${
|
|
1653
|
+
n(
|
|
1654
|
+
`rules.${s}.conditions.${u?.conditions?.length ?? 0}`,
|
|
1503
1655
|
void 0
|
|
1504
1656
|
);
|
|
1505
1657
|
},
|
|
1506
1658
|
children: [
|
|
1507
|
-
/* @__PURE__ */ e.jsx(
|
|
1659
|
+
/* @__PURE__ */ e.jsx(x, { name: "plusCircle" }),
|
|
1508
1660
|
" Add condition"
|
|
1509
1661
|
]
|
|
1510
1662
|
}
|
|
1511
1663
|
) })
|
|
1512
1664
|
] })
|
|
1513
|
-
] })
|
|
1665
|
+
] }) })
|
|
1514
1666
|
]
|
|
1515
1667
|
},
|
|
1516
1668
|
d
|
|
1517
1669
|
),
|
|
1518
|
-
|
|
1519
|
-
|
|
1670
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "shrink-0 basis-2/5", children: /* @__PURE__ */ e.jsx(
|
|
1671
|
+
ca,
|
|
1520
1672
|
{
|
|
1521
|
-
ref:
|
|
1522
|
-
name:
|
|
1673
|
+
ref: i,
|
|
1674
|
+
name: t.id ?? t.name,
|
|
1523
1675
|
height: "100%",
|
|
1524
1676
|
language: "json",
|
|
1525
|
-
jsonSchema:
|
|
1526
|
-
defaultValue: JSON.stringify(
|
|
1677
|
+
jsonSchema: t.schemaType,
|
|
1678
|
+
defaultValue: JSON.stringify(a, null, 2),
|
|
1527
1679
|
noRounding: !0,
|
|
1528
|
-
onChange:
|
|
1680
|
+
onChange: j
|
|
1529
1681
|
}
|
|
1530
1682
|
) })
|
|
1531
1683
|
] })
|
|
1532
1684
|
}
|
|
1533
1685
|
);
|
|
1534
1686
|
}
|
|
1535
|
-
function
|
|
1687
|
+
function Za({ children: t }) {
|
|
1536
1688
|
return /* @__PURE__ */ e.jsxs("div", { className: "text-gray-500 flex items-center justify-center flex-col", children: [
|
|
1537
1689
|
/* @__PURE__ */ e.jsx("div", { className: "h-6 w-[2px] bg-gray-200" }),
|
|
1538
|
-
/* @__PURE__ */ e.jsx("span", { className: "font-bold my-1 bg-gray-200 px-3 relative uppercase rounded h-[25px] items-center flex text-sm", children:
|
|
1690
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-bold my-1 bg-gray-200 px-3 relative uppercase rounded h-[25px] items-center flex text-sm", children: t }),
|
|
1539
1691
|
/* @__PURE__ */ e.jsx("div", { className: "h-6 w-[2px] bg-gray-200" })
|
|
1540
1692
|
] });
|
|
1541
1693
|
}
|
|
1542
|
-
function
|
|
1543
|
-
children:
|
|
1544
|
-
title:
|
|
1694
|
+
function B({
|
|
1695
|
+
children: t,
|
|
1696
|
+
title: a,
|
|
1545
1697
|
icon: s
|
|
1546
1698
|
}) {
|
|
1547
1699
|
return /* @__PURE__ */ e.jsxs("div", { className: "rounded-md bg-white shadow-xs", children: [
|
|
1548
1700
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4 py-4 border-b border-gray-100", children: [
|
|
1549
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-8 h-8 -ml-4 bg-white rounded-full border border-gray-200 flex items-center justify-center shadow-xs shadow-primary-200", children: /* @__PURE__ */ e.jsx(
|
|
1550
|
-
/* @__PURE__ */ e.jsx("h2", { className: "text-lg font-semibold", children:
|
|
1701
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-8 h-8 -ml-4 bg-white rounded-full border border-gray-200 flex items-center justify-center shadow-xs shadow-primary-200", children: /* @__PURE__ */ e.jsx(x, { name: s }) }),
|
|
1702
|
+
/* @__PURE__ */ e.jsx("h2", { className: "text-lg font-semibold", children: a })
|
|
1551
1703
|
] }),
|
|
1552
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-6", children:
|
|
1704
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-6", children: t })
|
|
1553
1705
|
] });
|
|
1554
1706
|
}
|
|
1555
|
-
function
|
|
1556
|
-
children:
|
|
1707
|
+
function Da({
|
|
1708
|
+
children: t
|
|
1557
1709
|
}) {
|
|
1558
|
-
return /* @__PURE__ */ e.jsx("div", { className: "h-full w-full bg-gray-50 p-8 bg-[radial-gradient(#d6d6d6_1px,transparent_1px)] bg-size-[16px_16px] overflow-auto", children: /* @__PURE__ */ e.jsx("div", { className: "max-w-[900px] mx-auto", children:
|
|
1710
|
+
return /* @__PURE__ */ e.jsx("div", { className: "h-full w-full bg-gray-50 p-8 bg-[radial-gradient(#d6d6d6_1px,transparent_1px)] bg-size-[16px_16px] overflow-auto", children: /* @__PURE__ */ e.jsx("div", { className: "max-w-[900px] mx-auto", children: t }) });
|
|
1559
1711
|
}
|
|
1560
1712
|
export {
|
|
1561
|
-
|
|
1713
|
+
Pa as RuleEngine
|
|
1562
1714
|
};
|