code7-leia 0.2.10 → 0.2.13
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/Leia.d.ts +3 -0
- package/dist/code7-leia.cjs.development.js +2331 -0
- package/dist/code7-leia.cjs.development.js.map +1 -0
- package/dist/code7-leia.cjs.production.min.js +2 -0
- package/dist/code7-leia.cjs.production.min.js.map +1 -0
- package/dist/code7-leia.esm.js +2323 -0
- package/dist/code7-leia.esm.js.map +1 -0
- package/dist/components/CustomToast/index.d.ts +13 -0
- package/dist/components/CustomToast/styles.d.ts +6 -0
- package/dist/components/EmptyState/index.d.ts +16 -0
- package/dist/components/EmptyState/styles.d.ts +8 -0
- package/dist/components/FileArea/components/AreaUpload/index.d.ts +24 -0
- package/dist/components/FileArea/components/AreaUpload/styles.d.ts +9 -0
- package/dist/components/FileArea/components/Modal/ModalButtonClose.d.ts +6 -0
- package/dist/components/FileArea/components/Modal/ModalContent.d.ts +8 -0
- package/dist/components/FileArea/components/Modal/ModalFooter.d.ts +6 -0
- package/dist/components/FileArea/components/Modal/ModalHeader.d.ts +6 -0
- package/dist/components/FileArea/components/Modal/ModalTitle.d.ts +6 -0
- package/dist/components/FileArea/components/Modal/index.d.ts +22 -0
- package/dist/components/FileArea/components/Modal/styles.d.ts +26 -0
- package/dist/components/FileArea/components/Search/index.d.ts +9 -0
- package/dist/components/FileArea/components/Search/styles.d.ts +4 -0
- package/dist/components/FileArea/components/Spinner/index.d.ts +4 -0
- package/dist/components/FileArea/components/Spinner/styles.d.ts +2 -0
- package/dist/components/FileArea/components/Table/index.d.ts +4 -0
- package/dist/components/FileArea/components/Table/styles.d.ts +4 -0
- package/dist/components/FileArea/index.d.ts +2 -0
- package/dist/components/FileArea/styles.d.ts +7 -0
- package/dist/components/MultiSelect/index.d.ts +17 -0
- package/dist/components/MultiSelect/styles.d.ts +8 -0
- package/dist/components/Select/index.d.ts +12 -0
- package/dist/components/Select/styles.d.ts +2 -0
- package/dist/components/Tabs/index.d.ts +35 -0
- package/dist/components/Tabs/styles.d.ts +13 -0
- package/dist/components/TestArea/components/InputTest/index.d.ts +7 -0
- package/dist/components/TestArea/components/InputTest/styles.d.ts +4 -0
- package/dist/components/TestArea/index.d.ts +2 -0
- package/dist/components/TestArea/styles.d.ts +9 -0
- package/dist/contexts/SharedPropsProvider.d.ts +17 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +8 -0
- package/dist/interface/FileData.d.ts +10 -0
- package/dist/interface/Language.d.ts +89 -0
- package/dist/interface/Table.d.ts +12 -0
- package/dist/service/Api.d.ts +3 -0
- package/dist/store/index.d.ts +10 -0
- package/dist/store/modules/actions.d.ts +87 -0
- package/dist/store/modules/reducer.d.ts +13 -0
- package/dist/store/modules/sagas.d.ts +26 -0
- package/dist/store/modules/types.d.ts +18 -0
- package/dist/utils/formatAxios.d.ts +3 -0
- package/dist/utils/getLanguage.d.ts +2 -0
- package/dist/utils/languages/en.d.ts +2 -0
- package/dist/utils/languages/es.d.ts +2 -0
- package/dist/utils/languages/pt-br.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/FileArea/index.tsx +1 -1
|
@@ -0,0 +1,2323 @@
|
|
|
1
|
+
import { useDispatch, useSelector, Provider } from 'react-redux';
|
|
2
|
+
import React, { forwardRef, useRef, useCallback, useEffect, useState, createContext, useContext, useMemo, Suspense } from 'react';
|
|
3
|
+
import { useRouteMatch, useLocation, useHistory, Switch, Route } from 'react-router-dom';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import cc from 'classcat';
|
|
6
|
+
import styled, { css } from 'styled-components';
|
|
7
|
+
import { renderToString } from 'react-dom/server';
|
|
8
|
+
import { FaSearch, FaUpload, FaList, FaCheck, FaFile } from 'react-icons/fa';
|
|
9
|
+
import { GiWeightLiftingUp } from 'react-icons/gi';
|
|
10
|
+
import { TiDelete } from 'react-icons/ti';
|
|
11
|
+
import unorm from 'unorm';
|
|
12
|
+
import { MdClose, MdPerson2 } from 'react-icons/md';
|
|
13
|
+
import { useDropzone } from 'react-dropzone';
|
|
14
|
+
import axios from 'axios';
|
|
15
|
+
import { PiWaveformBold } from 'react-icons/pi';
|
|
16
|
+
import { createStore, applyMiddleware } from 'redux';
|
|
17
|
+
import createSagaMiddleware from 'redux-saga';
|
|
18
|
+
import { produce } from 'immer';
|
|
19
|
+
import { all, takeLatest, put, call } from 'redux-saga/effects';
|
|
20
|
+
import { toast as toast$1 } from 'react-toastify';
|
|
21
|
+
import 'react-toastify/dist/ReactToastify.css';
|
|
22
|
+
|
|
23
|
+
function _regeneratorRuntime() {
|
|
24
|
+
_regeneratorRuntime = function () {
|
|
25
|
+
return e;
|
|
26
|
+
};
|
|
27
|
+
var t,
|
|
28
|
+
e = {},
|
|
29
|
+
r = Object.prototype,
|
|
30
|
+
n = r.hasOwnProperty,
|
|
31
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
32
|
+
t[e] = r.value;
|
|
33
|
+
},
|
|
34
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
35
|
+
a = i.iterator || "@@iterator",
|
|
36
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
37
|
+
u = i.toStringTag || "@@toStringTag";
|
|
38
|
+
function define(t, e, r) {
|
|
39
|
+
return Object.defineProperty(t, e, {
|
|
40
|
+
value: r,
|
|
41
|
+
enumerable: !0,
|
|
42
|
+
configurable: !0,
|
|
43
|
+
writable: !0
|
|
44
|
+
}), t[e];
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
define({}, "");
|
|
48
|
+
} catch (t) {
|
|
49
|
+
define = function (t, e, r) {
|
|
50
|
+
return t[e] = r;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function wrap(t, e, r, n) {
|
|
54
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
55
|
+
a = Object.create(i.prototype),
|
|
56
|
+
c = new Context(n || []);
|
|
57
|
+
return o(a, "_invoke", {
|
|
58
|
+
value: makeInvokeMethod(t, r, c)
|
|
59
|
+
}), a;
|
|
60
|
+
}
|
|
61
|
+
function tryCatch(t, e, r) {
|
|
62
|
+
try {
|
|
63
|
+
return {
|
|
64
|
+
type: "normal",
|
|
65
|
+
arg: t.call(e, r)
|
|
66
|
+
};
|
|
67
|
+
} catch (t) {
|
|
68
|
+
return {
|
|
69
|
+
type: "throw",
|
|
70
|
+
arg: t
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
e.wrap = wrap;
|
|
75
|
+
var h = "suspendedStart",
|
|
76
|
+
l = "suspendedYield",
|
|
77
|
+
f = "executing",
|
|
78
|
+
s = "completed",
|
|
79
|
+
y = {};
|
|
80
|
+
function Generator() {}
|
|
81
|
+
function GeneratorFunction() {}
|
|
82
|
+
function GeneratorFunctionPrototype() {}
|
|
83
|
+
var p = {};
|
|
84
|
+
define(p, a, function () {
|
|
85
|
+
return this;
|
|
86
|
+
});
|
|
87
|
+
var d = Object.getPrototypeOf,
|
|
88
|
+
v = d && d(d(values([])));
|
|
89
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
90
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
91
|
+
function defineIteratorMethods(t) {
|
|
92
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
93
|
+
define(t, e, function (t) {
|
|
94
|
+
return this._invoke(e, t);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function AsyncIterator(t, e) {
|
|
99
|
+
function invoke(r, o, i, a) {
|
|
100
|
+
var c = tryCatch(t[r], t, o);
|
|
101
|
+
if ("throw" !== c.type) {
|
|
102
|
+
var u = c.arg,
|
|
103
|
+
h = u.value;
|
|
104
|
+
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
105
|
+
invoke("next", t, i, a);
|
|
106
|
+
}, function (t) {
|
|
107
|
+
invoke("throw", t, i, a);
|
|
108
|
+
}) : e.resolve(h).then(function (t) {
|
|
109
|
+
u.value = t, i(u);
|
|
110
|
+
}, function (t) {
|
|
111
|
+
return invoke("throw", t, i, a);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
a(c.arg);
|
|
115
|
+
}
|
|
116
|
+
var r;
|
|
117
|
+
o(this, "_invoke", {
|
|
118
|
+
value: function (t, n) {
|
|
119
|
+
function callInvokeWithMethodAndArg() {
|
|
120
|
+
return new e(function (e, r) {
|
|
121
|
+
invoke(t, n, e, r);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function makeInvokeMethod(e, r, n) {
|
|
129
|
+
var o = h;
|
|
130
|
+
return function (i, a) {
|
|
131
|
+
if (o === f) throw new Error("Generator is already running");
|
|
132
|
+
if (o === s) {
|
|
133
|
+
if ("throw" === i) throw a;
|
|
134
|
+
return {
|
|
135
|
+
value: t,
|
|
136
|
+
done: !0
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
for (n.method = i, n.arg = a;;) {
|
|
140
|
+
var c = n.delegate;
|
|
141
|
+
if (c) {
|
|
142
|
+
var u = maybeInvokeDelegate(c, n);
|
|
143
|
+
if (u) {
|
|
144
|
+
if (u === y) continue;
|
|
145
|
+
return u;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
149
|
+
if (o === h) throw o = s, n.arg;
|
|
150
|
+
n.dispatchException(n.arg);
|
|
151
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
152
|
+
o = f;
|
|
153
|
+
var p = tryCatch(e, r, n);
|
|
154
|
+
if ("normal" === p.type) {
|
|
155
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
156
|
+
return {
|
|
157
|
+
value: p.arg,
|
|
158
|
+
done: n.done
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function maybeInvokeDelegate(e, r) {
|
|
166
|
+
var n = r.method,
|
|
167
|
+
o = e.iterator[n];
|
|
168
|
+
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
169
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
170
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
171
|
+
var a = i.arg;
|
|
172
|
+
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
173
|
+
}
|
|
174
|
+
function pushTryEntry(t) {
|
|
175
|
+
var e = {
|
|
176
|
+
tryLoc: t[0]
|
|
177
|
+
};
|
|
178
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
179
|
+
}
|
|
180
|
+
function resetTryEntry(t) {
|
|
181
|
+
var e = t.completion || {};
|
|
182
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
183
|
+
}
|
|
184
|
+
function Context(t) {
|
|
185
|
+
this.tryEntries = [{
|
|
186
|
+
tryLoc: "root"
|
|
187
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
188
|
+
}
|
|
189
|
+
function values(e) {
|
|
190
|
+
if (e || "" === e) {
|
|
191
|
+
var r = e[a];
|
|
192
|
+
if (r) return r.call(e);
|
|
193
|
+
if ("function" == typeof e.next) return e;
|
|
194
|
+
if (!isNaN(e.length)) {
|
|
195
|
+
var o = -1,
|
|
196
|
+
i = function next() {
|
|
197
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
198
|
+
return next.value = t, next.done = !0, next;
|
|
199
|
+
};
|
|
200
|
+
return i.next = i;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
204
|
+
}
|
|
205
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
206
|
+
value: GeneratorFunctionPrototype,
|
|
207
|
+
configurable: !0
|
|
208
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
209
|
+
value: GeneratorFunction,
|
|
210
|
+
configurable: !0
|
|
211
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
212
|
+
var e = "function" == typeof t && t.constructor;
|
|
213
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
214
|
+
}, e.mark = function (t) {
|
|
215
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
216
|
+
}, e.awrap = function (t) {
|
|
217
|
+
return {
|
|
218
|
+
__await: t
|
|
219
|
+
};
|
|
220
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
221
|
+
return this;
|
|
222
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
223
|
+
void 0 === i && (i = Promise);
|
|
224
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
225
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
226
|
+
return t.done ? t.value : a.next();
|
|
227
|
+
});
|
|
228
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
229
|
+
return this;
|
|
230
|
+
}), define(g, "toString", function () {
|
|
231
|
+
return "[object Generator]";
|
|
232
|
+
}), e.keys = function (t) {
|
|
233
|
+
var e = Object(t),
|
|
234
|
+
r = [];
|
|
235
|
+
for (var n in e) r.push(n);
|
|
236
|
+
return r.reverse(), function next() {
|
|
237
|
+
for (; r.length;) {
|
|
238
|
+
var t = r.pop();
|
|
239
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
240
|
+
}
|
|
241
|
+
return next.done = !0, next;
|
|
242
|
+
};
|
|
243
|
+
}, e.values = values, Context.prototype = {
|
|
244
|
+
constructor: Context,
|
|
245
|
+
reset: function (e) {
|
|
246
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
247
|
+
},
|
|
248
|
+
stop: function () {
|
|
249
|
+
this.done = !0;
|
|
250
|
+
var t = this.tryEntries[0].completion;
|
|
251
|
+
if ("throw" === t.type) throw t.arg;
|
|
252
|
+
return this.rval;
|
|
253
|
+
},
|
|
254
|
+
dispatchException: function (e) {
|
|
255
|
+
if (this.done) throw e;
|
|
256
|
+
var r = this;
|
|
257
|
+
function handle(n, o) {
|
|
258
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
259
|
+
}
|
|
260
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
261
|
+
var i = this.tryEntries[o],
|
|
262
|
+
a = i.completion;
|
|
263
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
264
|
+
if (i.tryLoc <= this.prev) {
|
|
265
|
+
var c = n.call(i, "catchLoc"),
|
|
266
|
+
u = n.call(i, "finallyLoc");
|
|
267
|
+
if (c && u) {
|
|
268
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
269
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
270
|
+
} else if (c) {
|
|
271
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
272
|
+
} else {
|
|
273
|
+
if (!u) throw new Error("try statement without catch or finally");
|
|
274
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
abrupt: function (t, e) {
|
|
280
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
281
|
+
var o = this.tryEntries[r];
|
|
282
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
283
|
+
var i = o;
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
288
|
+
var a = i ? i.completion : {};
|
|
289
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
290
|
+
},
|
|
291
|
+
complete: function (t, e) {
|
|
292
|
+
if ("throw" === t.type) throw t.arg;
|
|
293
|
+
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
294
|
+
},
|
|
295
|
+
finish: function (t) {
|
|
296
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
297
|
+
var r = this.tryEntries[e];
|
|
298
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
catch: function (t) {
|
|
302
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
303
|
+
var r = this.tryEntries[e];
|
|
304
|
+
if (r.tryLoc === t) {
|
|
305
|
+
var n = r.completion;
|
|
306
|
+
if ("throw" === n.type) {
|
|
307
|
+
var o = n.arg;
|
|
308
|
+
resetTryEntry(r);
|
|
309
|
+
}
|
|
310
|
+
return o;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
throw new Error("illegal catch attempt");
|
|
314
|
+
},
|
|
315
|
+
delegateYield: function (e, r, n) {
|
|
316
|
+
return this.delegate = {
|
|
317
|
+
iterator: values(e),
|
|
318
|
+
resultName: r,
|
|
319
|
+
nextLoc: n
|
|
320
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
321
|
+
}
|
|
322
|
+
}, e;
|
|
323
|
+
}
|
|
324
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
325
|
+
try {
|
|
326
|
+
var info = gen[key](arg);
|
|
327
|
+
var value = info.value;
|
|
328
|
+
} catch (error) {
|
|
329
|
+
reject(error);
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
if (info.done) {
|
|
333
|
+
resolve(value);
|
|
334
|
+
} else {
|
|
335
|
+
Promise.resolve(value).then(_next, _throw);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
function _asyncToGenerator(fn) {
|
|
339
|
+
return function () {
|
|
340
|
+
var self = this,
|
|
341
|
+
args = arguments;
|
|
342
|
+
return new Promise(function (resolve, reject) {
|
|
343
|
+
var gen = fn.apply(self, args);
|
|
344
|
+
function _next(value) {
|
|
345
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
346
|
+
}
|
|
347
|
+
function _throw(err) {
|
|
348
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
349
|
+
}
|
|
350
|
+
_next(undefined);
|
|
351
|
+
});
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
function _extends() {
|
|
355
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
356
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
357
|
+
var source = arguments[i];
|
|
358
|
+
for (var key in source) {
|
|
359
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
360
|
+
target[key] = source[key];
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
return target;
|
|
365
|
+
};
|
|
366
|
+
return _extends.apply(this, arguments);
|
|
367
|
+
}
|
|
368
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
369
|
+
if (source == null) return {};
|
|
370
|
+
var target = {};
|
|
371
|
+
var sourceKeys = Object.keys(source);
|
|
372
|
+
var key, i;
|
|
373
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
374
|
+
key = sourceKeys[i];
|
|
375
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
376
|
+
target[key] = source[key];
|
|
377
|
+
}
|
|
378
|
+
return target;
|
|
379
|
+
}
|
|
380
|
+
function _taggedTemplateLiteralLoose(strings, raw) {
|
|
381
|
+
if (!raw) {
|
|
382
|
+
raw = strings.slice(0);
|
|
383
|
+
}
|
|
384
|
+
strings.raw = raw;
|
|
385
|
+
return strings;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
var _templateObject, _templateObject2;
|
|
389
|
+
var TabsPane = /*#__PURE__*/styled.ul(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: max-content;\n display: flex;\n align-items: center;\n border-bottom: 1px solid var(--neutral-1);\n"])));
|
|
390
|
+
var Tab = /*#__PURE__*/styled.li(_templateObject2 || (_templateObject2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding: 12px;\n color: var(--neutral-3);\n font-size: 0.875rem;\n font-weight: normal;\n position: relative;\n cursor: pointer;\n\n svg {\n fill: var(--neutral-3) !important;\n margin-left: 8px;\n }\n\n &.active {\n color: var(--primary-700-light);\n\n svg {\n fill: var(--primary-700-light) !important;\n }\n\n ::after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 2px;\n background-color: var(--primary-700-light);\n }\n }\n\n &:not(:last-child) {\n margin-right: 8px;\n }\n"])));
|
|
391
|
+
|
|
392
|
+
var _excluded = ["active", "children"],
|
|
393
|
+
_excluded2 = ["children", "value", "onChange"];
|
|
394
|
+
var Tab$1 = function Tab$1(_ref) {
|
|
395
|
+
var active = _ref.active,
|
|
396
|
+
children = _ref.children,
|
|
397
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
398
|
+
return React.createElement(Tab, Object.assign({
|
|
399
|
+
className: cc({
|
|
400
|
+
active: active
|
|
401
|
+
})
|
|
402
|
+
}, rest), children);
|
|
403
|
+
};
|
|
404
|
+
Tab$1.propTypes = {
|
|
405
|
+
children: /*#__PURE__*/PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.node]).isRequired,
|
|
406
|
+
onChange: PropTypes.func,
|
|
407
|
+
value: PropTypes.string,
|
|
408
|
+
active: PropTypes.bool
|
|
409
|
+
};
|
|
410
|
+
Tab$1.defaultProps = {
|
|
411
|
+
onChange: function onChange() {},
|
|
412
|
+
value: '',
|
|
413
|
+
active: false
|
|
414
|
+
};
|
|
415
|
+
var Tabs = function Tabs(_ref2) {
|
|
416
|
+
var childrenProp = _ref2.children,
|
|
417
|
+
value = _ref2.value,
|
|
418
|
+
onChange = _ref2.onChange,
|
|
419
|
+
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
420
|
+
var children = React.Children.map(childrenProp, function (child) {
|
|
421
|
+
var _child$props, _child$props3;
|
|
422
|
+
if (!React.isValidElement(child)) {
|
|
423
|
+
return null;
|
|
424
|
+
}
|
|
425
|
+
if (Array.isArray((_child$props = child.props) == null ? void 0 : _child$props.children)) {
|
|
426
|
+
var _child$props2;
|
|
427
|
+
return React.cloneElement(child, {
|
|
428
|
+
active: ((_child$props2 = child.props) == null ? void 0 : _child$props2.value) === value,
|
|
429
|
+
value: value,
|
|
430
|
+
onChange: onChange
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
return React.cloneElement(child, {
|
|
434
|
+
active: ((_child$props3 = child.props) == null ? void 0 : _child$props3.value) === value,
|
|
435
|
+
onClick: function onClick() {
|
|
436
|
+
var _child$props4;
|
|
437
|
+
return onChange((_child$props4 = child.props) == null ? void 0 : _child$props4.value);
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
});
|
|
441
|
+
return React.createElement(TabsPane, Object.assign({}, rest), children);
|
|
442
|
+
};
|
|
443
|
+
Tabs.propTypes = {
|
|
444
|
+
children: PropTypes.node.isRequired,
|
|
445
|
+
value: /*#__PURE__*/PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
446
|
+
onChange: PropTypes.func.isRequired
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
var enTranslation = {
|
|
450
|
+
files: 'Files',
|
|
451
|
+
test: 'Test',
|
|
452
|
+
fileArea: {
|
|
453
|
+
description: 'Manage your files with ease! Add new ones and delete old ones as desired.',
|
|
454
|
+
fileName: 'File name',
|
|
455
|
+
status: 'Status',
|
|
456
|
+
presset: 'Presset',
|
|
457
|
+
actions: 'Actions',
|
|
458
|
+
search: 'Search',
|
|
459
|
+
fileUpload: 'File upload',
|
|
460
|
+
training: 'Train preset',
|
|
461
|
+
emptyState: {
|
|
462
|
+
title: 'No data',
|
|
463
|
+
description: 'No files uploaded yet. Start by adding your documents now!'
|
|
464
|
+
},
|
|
465
|
+
modal: {
|
|
466
|
+
descriptionUpload: 'Drag and drop files here or',
|
|
467
|
+
chooseFile: 'Choose a file',
|
|
468
|
+
uploadFile: 'Upload a file',
|
|
469
|
+
deleteFileTitle: 'Delete a file',
|
|
470
|
+
deleteFile: 'Important! By deleting this file, you will lose all its information and will not be able to recover it.',
|
|
471
|
+
trainingTitle: 'Presset Training',
|
|
472
|
+
trainingDescription: 'Select one or more pressets to be trained. Note: If none are selected, Le-IA will train all pressets.'
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
buttons: {
|
|
476
|
+
cancel: 'Cancel',
|
|
477
|
+
send: 'Send',
|
|
478
|
+
"delete": 'Delete',
|
|
479
|
+
test: 'Test',
|
|
480
|
+
addNewPresset: 'Add new presset',
|
|
481
|
+
addPresset: 'Add presset',
|
|
482
|
+
training: 'Training'
|
|
483
|
+
},
|
|
484
|
+
testArea: {
|
|
485
|
+
description: 'Type a sentence to test artificial intelligence',
|
|
486
|
+
typeSentence: 'Type a sentence',
|
|
487
|
+
selectPersona: 'Select a Persona',
|
|
488
|
+
selectPresset: 'Select a presset',
|
|
489
|
+
emptyState: {
|
|
490
|
+
title: 'No data for analysis',
|
|
491
|
+
description: 'Do a search, click the "Test" button.'
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
toast: {
|
|
495
|
+
deleteFile: {
|
|
496
|
+
success: {
|
|
497
|
+
title: 'Success',
|
|
498
|
+
description: 'File deleted successfully!'
|
|
499
|
+
},
|
|
500
|
+
fail: {
|
|
501
|
+
title: 'Failure',
|
|
502
|
+
description: 'Error deleting the file!'
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
uploadFile: {
|
|
506
|
+
success: {
|
|
507
|
+
title: 'Success',
|
|
508
|
+
description: 'File uploaded successfully!'
|
|
509
|
+
},
|
|
510
|
+
fail: {
|
|
511
|
+
title: 'Failure',
|
|
512
|
+
description: 'Error uploading the file!'
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
Test: {
|
|
516
|
+
fail: {
|
|
517
|
+
title: 'Failure',
|
|
518
|
+
description: 'Error testing Le-IA'
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
Train: {
|
|
522
|
+
fail: {
|
|
523
|
+
title: 'Failure',
|
|
524
|
+
description: 'Error training Le-IA'
|
|
525
|
+
},
|
|
526
|
+
success: {
|
|
527
|
+
title: 'Success',
|
|
528
|
+
description: 'Le-IA is in the training process!'
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
var ptTranslation = {
|
|
535
|
+
files: 'Arquivos',
|
|
536
|
+
test: 'Teste',
|
|
537
|
+
fileArea: {
|
|
538
|
+
description: 'Gerencie seus arquivos com facilidade! Adicione novos e exclua os antigos conforme desejar.',
|
|
539
|
+
fileName: 'Nome do arquivo',
|
|
540
|
+
status: 'Status',
|
|
541
|
+
presset: 'Predefinição',
|
|
542
|
+
actions: 'Ações',
|
|
543
|
+
search: 'Pesquisar',
|
|
544
|
+
fileUpload: 'Enviar arquivo',
|
|
545
|
+
training: 'Treinar predefinição',
|
|
546
|
+
emptyState: {
|
|
547
|
+
title: 'Sem dados',
|
|
548
|
+
description: 'Nenhum arquivo enviado ainda. Comece adicionando seus documentos agora!'
|
|
549
|
+
},
|
|
550
|
+
modal: {
|
|
551
|
+
descriptionUpload: 'Arraste e solte os arquivos aqui ou',
|
|
552
|
+
chooseFile: 'Escolha um arquivo',
|
|
553
|
+
uploadFile: 'Enviar um arquivo',
|
|
554
|
+
deleteFileTitle: 'Excluir um arquivo',
|
|
555
|
+
deleteFile: 'Importante! Ao excluir este arquivo, você perderá todas as suas informações e não poderá recuperá-las.',
|
|
556
|
+
trainingTitle: 'Treinamento de predefinição',
|
|
557
|
+
trainingDescription: 'Selecione um ou mais predefinições para serem treinadas. Obs: Caso não selecionada nenhuma a Le-IA irá treinar todas as predefinições'
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
buttons: {
|
|
561
|
+
cancel: 'Cancelar',
|
|
562
|
+
send: 'Enviar',
|
|
563
|
+
"delete": 'Excluir',
|
|
564
|
+
test: 'Teste',
|
|
565
|
+
addNewPresset: 'Adicionar nova predefinição',
|
|
566
|
+
addPresset: 'Adicionar predefinição',
|
|
567
|
+
training: 'Treinamento'
|
|
568
|
+
},
|
|
569
|
+
testArea: {
|
|
570
|
+
description: 'Digite uma frase para testar a inteligência artificial.',
|
|
571
|
+
typeSentence: 'Digite uma frase',
|
|
572
|
+
selectPersona: 'Selecione uma Persona',
|
|
573
|
+
selectPresset: 'Selecione uma predefinição',
|
|
574
|
+
emptyState: {
|
|
575
|
+
title: 'Sem dados para análise',
|
|
576
|
+
description: 'Faça uma pesquisa, clique no botão "Teste".'
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
toast: {
|
|
580
|
+
deleteFile: {
|
|
581
|
+
success: {
|
|
582
|
+
title: 'Sucesso',
|
|
583
|
+
description: 'Arquivo excluído com sucesso!'
|
|
584
|
+
},
|
|
585
|
+
fail: {
|
|
586
|
+
title: 'Falha',
|
|
587
|
+
description: 'Erro ao excluir o arquivo!'
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
uploadFile: {
|
|
591
|
+
success: {
|
|
592
|
+
title: 'Sucesso',
|
|
593
|
+
description: 'Arquivo enviado com sucesso!'
|
|
594
|
+
},
|
|
595
|
+
fail: {
|
|
596
|
+
title: 'Falha',
|
|
597
|
+
description: 'Erro ao enviar o arquivo!'
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
Test: {
|
|
601
|
+
fail: {
|
|
602
|
+
title: 'Falha',
|
|
603
|
+
description: 'Erro ao testar Le-IA'
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
Train: {
|
|
607
|
+
fail: {
|
|
608
|
+
title: 'Falha',
|
|
609
|
+
description: 'Erro ao treinar a Le-IA'
|
|
610
|
+
},
|
|
611
|
+
success: {
|
|
612
|
+
title: 'Sucesso',
|
|
613
|
+
description: 'A Le-IA está em processo de treinamento!'
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
var esTranslation = {
|
|
620
|
+
files: 'Archivos',
|
|
621
|
+
test: 'Prueba',
|
|
622
|
+
fileArea: {
|
|
623
|
+
description: '¡Administre sus archivos fácilmente! Agregue nuevos y elimine los antiguos según desee.',
|
|
624
|
+
fileName: 'Nombre del archivo',
|
|
625
|
+
status: 'Status',
|
|
626
|
+
presset: 'Preconfiguración',
|
|
627
|
+
actions: 'Acciones',
|
|
628
|
+
search: 'Buscar',
|
|
629
|
+
fileUpload: 'Subir archivo',
|
|
630
|
+
training: 'Entrenar preconfiguración',
|
|
631
|
+
emptyState: {
|
|
632
|
+
title: 'Sin datos',
|
|
633
|
+
description: 'Aún no se han subido archivos. ¡Comience agregando sus documentos ahora!'
|
|
634
|
+
},
|
|
635
|
+
modal: {
|
|
636
|
+
descriptionUpload: 'Arrastre y suelte los archivos aquí o',
|
|
637
|
+
chooseFile: 'Elegir un archivo',
|
|
638
|
+
uploadFile: 'Subir un archivo',
|
|
639
|
+
deleteFileTitle: 'Eliminar un archivo',
|
|
640
|
+
deleteFile: '¡Importante! Al eliminar este archivo, perderá toda su información y no podrá recuperarla.',
|
|
641
|
+
trainingTitle: 'Entrenamiento de preconfiguración',
|
|
642
|
+
trainingDescription: 'Seleccione una o más preconfiguracións para ser entrenadas. Nota: Si no se selecciona ninguna, Le-IA entrenará todas las preconfiguracións.'
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
buttons: {
|
|
646
|
+
cancel: 'Cancelar',
|
|
647
|
+
send: 'Enviar',
|
|
648
|
+
"delete": 'Eliminar',
|
|
649
|
+
test: 'Prueba',
|
|
650
|
+
addNewPresset: 'Agregar nueva preconfiguración',
|
|
651
|
+
addPresset: 'Agregar preconfiguración',
|
|
652
|
+
training: 'Capacitación'
|
|
653
|
+
},
|
|
654
|
+
testArea: {
|
|
655
|
+
description: 'Escribe una frase para probar la inteligencia artificial.',
|
|
656
|
+
typeSentence: 'Escribe una oración',
|
|
657
|
+
selectPersona: 'Seleccionar una Persona',
|
|
658
|
+
selectPresset: 'Seleccionar una preconfiguración',
|
|
659
|
+
emptyState: {
|
|
660
|
+
title: 'Sin datos para el análisis',
|
|
661
|
+
description: 'Realice una búsqueda, haga clic en el botón "Prueba".'
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
toast: {
|
|
665
|
+
deleteFile: {
|
|
666
|
+
success: {
|
|
667
|
+
title: 'Éxito',
|
|
668
|
+
description: '¡Archivo eliminado correctamente!'
|
|
669
|
+
},
|
|
670
|
+
fail: {
|
|
671
|
+
title: 'Error',
|
|
672
|
+
description: 'Error al eliminar el archivo!'
|
|
673
|
+
}
|
|
674
|
+
},
|
|
675
|
+
uploadFile: {
|
|
676
|
+
success: {
|
|
677
|
+
title: 'Éxito',
|
|
678
|
+
description: '¡Archivo subido correctamente!'
|
|
679
|
+
},
|
|
680
|
+
fail: {
|
|
681
|
+
title: 'Error',
|
|
682
|
+
description: 'Error al subir el archivo!'
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
Test: {
|
|
686
|
+
fail: {
|
|
687
|
+
title: 'Error',
|
|
688
|
+
description: 'Error al probar Le-IA'
|
|
689
|
+
}
|
|
690
|
+
},
|
|
691
|
+
Train: {
|
|
692
|
+
fail: {
|
|
693
|
+
title: 'Error',
|
|
694
|
+
description: 'Error al entrenar Le-IA'
|
|
695
|
+
},
|
|
696
|
+
success: {
|
|
697
|
+
title: 'Éxito',
|
|
698
|
+
description: '¡Le-IA está en proceso de entrenamiento!'
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
var getLanguage = function getLanguage(language) {
|
|
705
|
+
switch (language) {
|
|
706
|
+
case 'en':
|
|
707
|
+
return enTranslation;
|
|
708
|
+
case 'pt-br':
|
|
709
|
+
return ptTranslation;
|
|
710
|
+
case 'es':
|
|
711
|
+
return esTranslation;
|
|
712
|
+
default:
|
|
713
|
+
return enTranslation;
|
|
714
|
+
}
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
var _templateObject$1, _templateObject2$1, _templateObject3;
|
|
718
|
+
var Container = /*#__PURE__*/styled.div(_templateObject$1 || (_templateObject$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n ", "\n\n\n .tag {\n padding: 4px 8px 4px 8px;\n background: #C7F9ED;\n border-radius: 4px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .tags {\n display: flex;\n justify-content: left;\n gap: 4px;\n }\n\n .divDelete {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 4px;\n }\n\n .buttonDelete {\n color: #5b0a1f;\n background: #fae0d2;\n padding: 12px 20px;\n border-radius: 4px;\n }\n\n .buttonDelete:hover {\n background: #f5bba7;\n }\n\n .buttonTraining {\n color: #023906;\n background: #e3f8cc;\n padding: 12px 20px;\n border-radius: 4px;\n margin-right: 10px;\n }\n\n .buttonTraining:hover {\n background: #90d665;\n }\n\n .button {\n padding: 8px 16px 8px 16px;\n border-radius: 4px;\n gap: 10px;\n }\n\n .cancel {\n background: #F3F5F9;\n color: #5A5D68;\n }\n\n .send {\n background: #102693;\n color: white;\n }\n\n .delete {\n background: #871821;\n color: white;\n }\n\n .presset {\n padding-top: 10px;\n display: flex;\n flex-direction: column;\n\n p {\n font-size: 14px;\n font-weight: 600;\n padding: 4px 0;\n }\n }\n\n #warning {\n padding: 10px;\n background: #FAE0D2;\n color: #871821;\n }\n\n #info {\n padding: 10px;\n background: #c7f9ed;\n color: #00344e;\n }\n\n"])), function (props) {
|
|
719
|
+
return props.isloading && css(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteralLoose(["\n #loading {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgb(151,154,165, 0.7);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 9999;\n }\n\n #loading::after {\n content: \"\";\n border: 4px solid #f3f3f3; /* Cor do s\xEDmbolo de carregamento */\n border-top: 4px solid #5a5d68; /* Cor do s\xEDmbolo de carregamento */\n border-radius: 50%;\n width: 13px;\n height: 13px;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "])));
|
|
720
|
+
});
|
|
721
|
+
var Header = /*#__PURE__*/styled.div(_templateObject3 || (_templateObject3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n\n #button-upload {\n margin-right: 10px;\n }\n\n .infos {\n display: flex;\n flex-direction: column;\n padding: 14px 0;\n\n h2 {\n font-size: 20px\n }\n\n p {\n font-size: 14px\n }\n }\n\n .actions {\n display: flex;\n justify-content: space-between;\n padding-bottom: 14px;\n\n button {\n background: #102693;\n padding: 10px 20px;\n color: white;\n border-radius: 4px;\n }\n }\n\n"])));
|
|
722
|
+
|
|
723
|
+
var _templateObject$2, _templateObject2$2, _templateObject3$1;
|
|
724
|
+
var TableWrapper = /*#__PURE__*/styled.div(_templateObject$2 || (_templateObject$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n height: max-content;\n min-height: 50px;\n position: relative;\n"])));
|
|
725
|
+
var Table = /*#__PURE__*/styled.table(_templateObject2$2 || (_templateObject2$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 14px;\n line-height: 143%;\n color: black;\n width: 100%;\n border-collapse: collapse;\n border-radius: 4px;\n\n th {\n font-weight: 600;\n font-size: 14px;\n line-height: 143%;\n letter-spacing: 0.018em;\n color: #5A5D68;\n text-align: left;\n padding: 8px;\n border-radius: 4px;\n }\n\n thead tr {\n background: #dadce3;\n }\n\n tbody tr {\n border: 1px solid #dadce3;\n }\n\n &.small td {\n padding: 4px;\n }\n\n &.medium td {\n padding: 8px;\n }\n\n &.large td {\n padding: 16px;\n }\n"])));
|
|
726
|
+
var TableLoadingWrapper = /*#__PURE__*/styled.div(_templateObject3$1 || (_templateObject3$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: #f3f5f961;\n"])));
|
|
727
|
+
|
|
728
|
+
var _templateObject$3;
|
|
729
|
+
var SpinnerWrapper = /*#__PURE__*/styled.span(_templateObject$3 || (_templateObject$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: inline-block;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &.spinner--sm {\n width: 24px;\n height: 24px;\n }\n\n &.spinner--md {\n width: 32px;\n height: 32px;\n }\n\n &.spinner--lg {\n width: 60px;\n height: 60px;\n }\n\n span {\n box-sizing: border-box;\n display: block;\n position: absolute;\n width: 100%;\n height: 100%;\n margin: 8px;\n border: 4px solid #fff;\n border-radius: 50%;\n animation: rotateSpinner 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n border-color: ", " transparent transparent\n transparent;\n }\n\n & span:nth-child(1) {\n animation-delay: -0.45s;\n }\n\n & span:nth-child(2) {\n animation-delay: -0.3s;\n }\n\n & span:nth-child(3) {\n animation-delay: -0.15s;\n }\n\n @keyframes rotateSpinner {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])), function (props) {
|
|
730
|
+
return "var(--" + props.color + ")";
|
|
731
|
+
});
|
|
732
|
+
|
|
733
|
+
var Spinner = function Spinner(_ref) {
|
|
734
|
+
var _ref$color = _ref.color,
|
|
735
|
+
color = _ref$color === void 0 ? 'neutral-3' : _ref$color,
|
|
736
|
+
_ref$size = _ref.size,
|
|
737
|
+
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
738
|
+
className = _ref.className;
|
|
739
|
+
return React.createElement(SpinnerWrapper, {
|
|
740
|
+
color: color,
|
|
741
|
+
className: cc(["spinner--" + size, className])
|
|
742
|
+
}, React.createElement("span", null), React.createElement("span", null), React.createElement("span", null), React.createElement("span", null));
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
var _excluded$1 = ["size", "children", "isloading", "className"];
|
|
746
|
+
var Table$1 = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
747
|
+
var _ref$size = _ref.size,
|
|
748
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
749
|
+
children = _ref.children,
|
|
750
|
+
_ref$isloading = _ref.isloading,
|
|
751
|
+
isloading = _ref$isloading === void 0 ? false : _ref$isloading,
|
|
752
|
+
_ref$className = _ref.className,
|
|
753
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
754
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
755
|
+
return React.createElement(TableWrapper, {
|
|
756
|
+
className: className
|
|
757
|
+
}, isloading ? React.createElement(TableLoadingWrapper, null, React.createElement(Spinner, null)) : null, React.createElement(Table, Object.assign({
|
|
758
|
+
className: cc([size]),
|
|
759
|
+
ref: ref
|
|
760
|
+
}, props), children));
|
|
761
|
+
});
|
|
762
|
+
Table$1.propTypes = {
|
|
763
|
+
children: PropTypes.node.isRequired,
|
|
764
|
+
className: PropTypes.string,
|
|
765
|
+
size: /*#__PURE__*/PropTypes.oneOf(['small', 'medium', 'large']),
|
|
766
|
+
isloading: PropTypes.bool
|
|
767
|
+
};
|
|
768
|
+
|
|
769
|
+
var _templateObject$4, _templateObject2$3, _templateObject3$2;
|
|
770
|
+
var InputContainer = /*#__PURE__*/styled.div(_templateObject$4 || (_templateObject$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: 300px;\n"])));
|
|
771
|
+
var Input = /*#__PURE__*/styled.input(_templateObject2$3 || (_templateObject2$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding-left: 40px;\n border-radius: 5px;\n border: 1px solid #ccc;\n height: 45px;\n width: 100%;\n\n &:focus {\n outline: none;\n box-shadow: 0 0 0 3px #6690ff;\n }\n"])));
|
|
772
|
+
var IconContainer = /*#__PURE__*/styled.div(_templateObject3$2 || (_templateObject3$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n top: 14px;\n left: 10px;\n pointer-events: none;\n"])));
|
|
773
|
+
|
|
774
|
+
var SearchInput = function SearchInput(_ref) {
|
|
775
|
+
var placeholder = _ref.placeholder,
|
|
776
|
+
setFiles = _ref.setFiles,
|
|
777
|
+
initialFiles = _ref.initialFiles;
|
|
778
|
+
var searchName = function searchName(e) {
|
|
779
|
+
var searchTerm = e.target.value.trim();
|
|
780
|
+
var normalizedSearchTerm = unorm.nfkd(searchTerm).toLowerCase();
|
|
781
|
+
var newFiles = initialFiles.filter(function (file) {
|
|
782
|
+
var normalizedFileName = unorm.nfkd(file.name).toLowerCase();
|
|
783
|
+
return normalizedFileName.includes(normalizedSearchTerm);
|
|
784
|
+
});
|
|
785
|
+
setFiles(searchTerm !== '' ? newFiles : initialFiles);
|
|
786
|
+
};
|
|
787
|
+
return React.createElement(InputContainer, null, React.createElement(Input, {
|
|
788
|
+
type: "text",
|
|
789
|
+
onChange: function onChange(e) {
|
|
790
|
+
return searchName(e);
|
|
791
|
+
},
|
|
792
|
+
placeholder: placeholder
|
|
793
|
+
}), React.createElement(IconContainer, null, React.createElement(FaSearch, null)));
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
var _templateObject$5, _templateObject2$4, _templateObject3$3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
797
|
+
var FullScreen = /*#__PURE__*/styled.div(_templateObject$5 || (_templateObject$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: ", ";\n cursor: ", ";\n\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n justify-content: center;\n align-items: center;\n z-index: ", ";\n animation: fadeIn 380ms ease-in-out 1;\n background-color: #2f3845b8;\n backdrop-filter: blur(2px);\n\n @keyframes fadeIn {\n from {\n background-color: #2f384521;\n }\n to {\n background-color: #2f3845b8;\n }\n }\n"])), function (_ref) {
|
|
798
|
+
var isopen = _ref.isopen;
|
|
799
|
+
return isopen === 1 ? 'flex' : 'none';
|
|
800
|
+
}, function (_ref2) {
|
|
801
|
+
var isfixed = _ref2.isfixed;
|
|
802
|
+
return isfixed === 0 ? 'pointer' : 'default';
|
|
803
|
+
}, function (_ref3) {
|
|
804
|
+
var zindex = _ref3.zindex;
|
|
805
|
+
return zindex;
|
|
806
|
+
});
|
|
807
|
+
var Modal = /*#__PURE__*/styled.div(_templateObject2$4 || (_templateObject2$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background-color: #fff;\n border-radius: 3px;\n position: relative;\n cursor: default;\n width: 100%;\n max-width: ", ";\n animation: slideIn 350ms cubic-bezier(0.42, 0, 0.21, 1) 1;\n\n @keyframes slideIn {\n from {\n transform: translateY(-120px);\n opacity: 0;\n }\n\n 20% {\n opacity: 0;\n }\n\n to {\n transform: translateY(0);\n opacity: 1;\n }\n }\n"])), function (_ref4) {
|
|
808
|
+
var maxwidth = _ref4.maxwidth;
|
|
809
|
+
return maxwidth;
|
|
810
|
+
});
|
|
811
|
+
var ModalContainer = /*#__PURE__*/styled.div(_templateObject3$3 || (_templateObject3$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n overflow-y: auto;\n max-height: ", ";\n"])), function (_ref5) {
|
|
812
|
+
var maxheight = _ref5.maxheight;
|
|
813
|
+
return maxheight;
|
|
814
|
+
});
|
|
815
|
+
var ModalHeader = /*#__PURE__*/styled.header(_templateObject4 || (_templateObject4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: 1px solid #dadce3;\n padding: var(--spacement-medium);\n"])));
|
|
816
|
+
var ModalTitle = /*#__PURE__*/styled.div(_templateObject5 || (_templateObject5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-style: normal;\n font-weight: normal;\n font-size: 20px;\n line-height: 150%;\n letter-spacing: 0.0075em;\n color: var(--neutral-4);\n"])));
|
|
817
|
+
var ModalButtonClose = /*#__PURE__*/styled.button(_templateObject6 || (_templateObject6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n outline: none;\n cursor: pointer;\n\n :hover {\n opacity: 0.7;\n }\n"])));
|
|
818
|
+
var ModalContentWrapper = /*#__PURE__*/styled.div(_templateObject7 || (_templateObject7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n overflow-y: ", ";\n max-height: ", ";\n padding: var(--spacement-medium);\n"])), function (_ref6) {
|
|
819
|
+
var overflowy = _ref6.overflowy;
|
|
820
|
+
return overflowy;
|
|
821
|
+
}, function (_ref7) {
|
|
822
|
+
var maxheight = _ref7.maxheight;
|
|
823
|
+
return maxheight;
|
|
824
|
+
});
|
|
825
|
+
var ModalFooterWrapper = /*#__PURE__*/styled.div(_templateObject8 || (_templateObject8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding: var(--spacement-medium);\n background: var(--neutral-0);\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--spacement-medium);\n"])));
|
|
826
|
+
|
|
827
|
+
var _excluded$2 = ["children"];
|
|
828
|
+
var ModalFooter = function ModalFooter(_ref) {
|
|
829
|
+
var children = _ref.children,
|
|
830
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
831
|
+
return React.createElement(ModalFooterWrapper, Object.assign({}, rest), children);
|
|
832
|
+
};
|
|
833
|
+
ModalFooter.propTypes = {
|
|
834
|
+
children: PropTypes.node.isRequired
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
var _excluded$3 = ["children", "maxheight", "overflowy"];
|
|
838
|
+
var ModalContent = function ModalContent(_ref) {
|
|
839
|
+
var children = _ref.children,
|
|
840
|
+
_ref$maxheight = _ref.maxheight,
|
|
841
|
+
maxheight = _ref$maxheight === void 0 ? 'max-content' : _ref$maxheight,
|
|
842
|
+
_ref$overflowy = _ref.overflowy,
|
|
843
|
+
overflowy = _ref$overflowy === void 0 ? 'initial' : _ref$overflowy,
|
|
844
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
845
|
+
return React.createElement(ModalContentWrapper, Object.assign({
|
|
846
|
+
maxheight: maxheight,
|
|
847
|
+
overflowy: overflowy
|
|
848
|
+
}, rest), children);
|
|
849
|
+
};
|
|
850
|
+
ModalContent.propTypes = {
|
|
851
|
+
children: PropTypes.node.isRequired,
|
|
852
|
+
maxheight: PropTypes.string,
|
|
853
|
+
overflowy: PropTypes.string
|
|
854
|
+
};
|
|
855
|
+
|
|
856
|
+
var Modal$1 = function Modal$1(_ref) {
|
|
857
|
+
var isopen = _ref.isopen,
|
|
858
|
+
style = _ref.style,
|
|
859
|
+
maxwidth = _ref.maxwidth,
|
|
860
|
+
maxheight = _ref.maxheight,
|
|
861
|
+
className = _ref.className,
|
|
862
|
+
title = _ref.title,
|
|
863
|
+
children = _ref.children,
|
|
864
|
+
onClose = _ref.onClose,
|
|
865
|
+
contentStyle = _ref.contentStyle,
|
|
866
|
+
isfixed = _ref.isfixed,
|
|
867
|
+
zindex = _ref.zindex;
|
|
868
|
+
var modalRef = useRef(null);
|
|
869
|
+
var handleKeyUp = useCallback(function (e) {
|
|
870
|
+
var keys = {
|
|
871
|
+
// ESC Key
|
|
872
|
+
27: function _() {
|
|
873
|
+
e.preventDefault();
|
|
874
|
+
if (!isfixed && onClose) {
|
|
875
|
+
onClose();
|
|
876
|
+
}
|
|
877
|
+
window.removeEventListener('keyup', handleKeyUp, false);
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
if (keys[e.keyCode] && isopen) {
|
|
881
|
+
keys[e.keyCode]();
|
|
882
|
+
}
|
|
883
|
+
}, [onClose, isopen, isfixed]);
|
|
884
|
+
var handleOutsideClick = useCallback(function (e) {
|
|
885
|
+
if (modalRef.current && modalRef.current.parentNode === e.target) {
|
|
886
|
+
if (!isfixed && onClose) {
|
|
887
|
+
onClose();
|
|
888
|
+
}
|
|
889
|
+
document.removeEventListener('click', handleOutsideClick, false);
|
|
890
|
+
}
|
|
891
|
+
}, [onClose, isfixed]);
|
|
892
|
+
useEffect(function () {
|
|
893
|
+
window.addEventListener('keyup', handleKeyUp, false);
|
|
894
|
+
document.addEventListener('click', handleOutsideClick, false);
|
|
895
|
+
return function () {
|
|
896
|
+
window.removeEventListener('keyup', handleKeyUp, false);
|
|
897
|
+
document.removeEventListener('click', handleOutsideClick, false);
|
|
898
|
+
};
|
|
899
|
+
}, [handleKeyUp, handleOutsideClick]);
|
|
900
|
+
return React.createElement(FullScreen, {
|
|
901
|
+
isfixed: isfixed ? 1 : 0,
|
|
902
|
+
isopen: isopen ? 1 : 0,
|
|
903
|
+
zindex: zindex != null ? zindex : 0
|
|
904
|
+
}, React.createElement(Modal, {
|
|
905
|
+
ref: modalRef,
|
|
906
|
+
style: style,
|
|
907
|
+
maxwidth: maxwidth,
|
|
908
|
+
className: className
|
|
909
|
+
}, React.createElement(ModalContainer, {
|
|
910
|
+
className: "styleOverlay",
|
|
911
|
+
maxheight: maxheight,
|
|
912
|
+
style: contentStyle
|
|
913
|
+
}, React.createElement(ModalHeader, null, React.createElement(ModalTitle, null, String(title)), React.createElement(ModalButtonClose, {
|
|
914
|
+
type: "button",
|
|
915
|
+
onClick: onClose
|
|
916
|
+
}, React.createElement(MdClose, {
|
|
917
|
+
color: "#5A5D68",
|
|
918
|
+
size: 16
|
|
919
|
+
}))), children)));
|
|
920
|
+
};
|
|
921
|
+
Modal$1.propTypes = {
|
|
922
|
+
isopen: PropTypes.bool.isRequired,
|
|
923
|
+
title: /*#__PURE__*/PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.func]),
|
|
924
|
+
children: PropTypes.node.isRequired,
|
|
925
|
+
onClose: PropTypes.func,
|
|
926
|
+
style: /*#__PURE__*/PropTypes.objectOf(PropTypes.any),
|
|
927
|
+
contentStyle: /*#__PURE__*/PropTypes.objectOf(PropTypes.any),
|
|
928
|
+
className: PropTypes.string,
|
|
929
|
+
maxwidth: PropTypes.string,
|
|
930
|
+
maxheight: PropTypes.string,
|
|
931
|
+
isfixed: PropTypes.bool,
|
|
932
|
+
zindex: PropTypes.number
|
|
933
|
+
};
|
|
934
|
+
Modal$1.defaultProps = {
|
|
935
|
+
title: '',
|
|
936
|
+
style: {},
|
|
937
|
+
contentStyle: {},
|
|
938
|
+
className: '',
|
|
939
|
+
maxwidth: '360px',
|
|
940
|
+
maxheight: 'max-content',
|
|
941
|
+
isfixed: false,
|
|
942
|
+
onClose: function onClose() {},
|
|
943
|
+
zindex: 9999
|
|
944
|
+
};
|
|
945
|
+
|
|
946
|
+
var _templateObject$6;
|
|
947
|
+
var Container$1 = /*#__PURE__*/styled.div(_templateObject$6 || (_templateObject$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n justify-content: center;\n padding: 24px 0;\n height: 193px;\n \n p {\n margin: 10px 0;\n }\n\n background: ", ";\n background-position: top, right, bottom, left;\n background-repeat: repeat-x, repeat-y;\n background-size: 40px 1px, 1px 40px;\n background-color: ", ";\n\n button {\n background: #102693;\n color: white;\n width: fit-content;\n padding: 10px 20px;\n border-radius: 4px;\n }\n\n & .content {\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n & > .icon {\n background-color: ", ";\n border-radius: 16px;\n width: 145px;\n height: 145px;\n\n display: flex;\n justify-content: center;\n\n & svg {\n width: 100%;\n height: 70%;\n margin: 20px;\n }\n }\n\n & .description {\n max-width: 600px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n padding: 8px 0 8px 24px;\n\n .button-add {\n cursor: pointer;\n }\n\n .start-icon {\n display: flex;\n align-items: center;\n }\n }\n }\n"])), function (_ref) {
|
|
948
|
+
var hasborder = _ref.hasborder;
|
|
949
|
+
return hasborder && "linear-gradient(\n to right,\n #dadce3 50%,\n rgba(255, 255, 255, 0) 0%\n ),\n linear-gradient(#dadce3 50%, rgba(255, 255, 255, 0) 0%),\n linear-gradient(to right, #dadce3 50%, rgba(255, 255, 255, 0) 0%),\n linear-gradient(#dadce3 50%, rgba(255, 255, 255, 0) 0%)";
|
|
950
|
+
}, function (_ref2) {
|
|
951
|
+
var backgroundcolor = _ref2.backgroundcolor;
|
|
952
|
+
return backgroundcolor;
|
|
953
|
+
}, function (_ref3) {
|
|
954
|
+
var backgroundicon = _ref3.backgroundicon;
|
|
955
|
+
return backgroundicon;
|
|
956
|
+
});
|
|
957
|
+
|
|
958
|
+
var _excluded$4 = ["icon", "title", "description", "activeButton", "iconButton", "descriptionButton", "widthButton", "button", "backgroundIcon", "backgroundColor", "hasborder"];
|
|
959
|
+
var EmptyState = function EmptyState(_ref) {
|
|
960
|
+
var icon = _ref.icon,
|
|
961
|
+
title = _ref.title,
|
|
962
|
+
description = _ref.description,
|
|
963
|
+
activeButton = _ref.activeButton,
|
|
964
|
+
iconButton = _ref.iconButton,
|
|
965
|
+
descriptionButton = _ref.descriptionButton,
|
|
966
|
+
button = _ref.button,
|
|
967
|
+
backgroundIcon = _ref.backgroundIcon,
|
|
968
|
+
backgroundColor = _ref.backgroundColor,
|
|
969
|
+
hasborder = _ref.hasborder,
|
|
970
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
971
|
+
return React.createElement(Container$1, Object.assign({
|
|
972
|
+
backgroundicon: backgroundIcon,
|
|
973
|
+
backgroundcolor: backgroundColor,
|
|
974
|
+
hasborder: hasborder
|
|
975
|
+
}, rest), React.createElement("div", {
|
|
976
|
+
className: "content"
|
|
977
|
+
}, React.createElement("div", {
|
|
978
|
+
className: "icon"
|
|
979
|
+
}, icon), React.createElement("div", {
|
|
980
|
+
className: "description"
|
|
981
|
+
}, React.createElement("h5", null, " ", title), React.createElement("p", null, description), activeButton ? React.createElement("button", null, iconButton, " ", descriptionButton) : null, button)));
|
|
982
|
+
};
|
|
983
|
+
EmptyState.propTypes = {
|
|
984
|
+
icon: /*#__PURE__*/PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
985
|
+
title: PropTypes.string,
|
|
986
|
+
description: PropTypes.string,
|
|
987
|
+
activeButton: PropTypes.bool,
|
|
988
|
+
iconButton: PropTypes.element,
|
|
989
|
+
descriptionButton: PropTypes.string,
|
|
990
|
+
widthButton: PropTypes.string,
|
|
991
|
+
button: PropTypes.element,
|
|
992
|
+
backgroundIcon: PropTypes.string,
|
|
993
|
+
backgroundColor: PropTypes.string,
|
|
994
|
+
hasborder: PropTypes.bool
|
|
995
|
+
};
|
|
996
|
+
EmptyState.defaultProps = {
|
|
997
|
+
icon: '',
|
|
998
|
+
title: '',
|
|
999
|
+
description: '',
|
|
1000
|
+
activeButton: false,
|
|
1001
|
+
descriptionButton: '',
|
|
1002
|
+
widthButton: '140px',
|
|
1003
|
+
backgroundIcon: 'var(--neutral-0)',
|
|
1004
|
+
backgroundColor: 'var(--absolute-white)',
|
|
1005
|
+
hasborder: true
|
|
1006
|
+
};
|
|
1007
|
+
|
|
1008
|
+
var _templateObject$7, _templateObject2$5, _templateObject3$4, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1;
|
|
1009
|
+
var MultiSelectWrapper = /*#__PURE__*/styled.div(_templateObject$7 || (_templateObject$7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n height: 45px;\n"])));
|
|
1010
|
+
var SelectBox = /*#__PURE__*/styled.div(_templateObject2$5 || (_templateObject2$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n\n select {\n width: 100%;\n font-weight: bold;\n height: 45px;\n border-radius: 4px;\n }\n"])));
|
|
1011
|
+
var OverSelect = /*#__PURE__*/styled.div(_templateObject3$4 || (_templateObject3$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n\n input {\n height: 43px;\n width: calc(100% - 30px);\n border: none;\n margin: 1px;\n\n &:focus {\n outline: none;\n box-shadow: 0 0 0 3px #6690ff;\n }\n }\n"])));
|
|
1012
|
+
var Checkboxes = /*#__PURE__*/styled.div(_templateObject4$1 || (_templateObject4$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: none;\n background: white;\n position: absolute;\n width: 95%;\n z-index: 10;\n\n label {\n padding: 10px 5px;\n }\n"])));
|
|
1013
|
+
var CheckboxLabel = /*#__PURE__*/styled.label(_templateObject5$1 || (_templateObject5$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: block;\n\n &:hover {\n background-color: #6690ff;\n }\n"])));
|
|
1014
|
+
var SelectedValues = /*#__PURE__*/styled.div(_templateObject6$1 || (_templateObject6$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n top: 9px;\n display: flex;\n flex-wrap: wrap;\n margin-left: 5px;\n right: 30px;\n"])));
|
|
1015
|
+
var SelectedValue = /*#__PURE__*/styled.div(_templateObject7$1 || (_templateObject7$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background-color: #254EDB;\n color: white;\n border-radius: 15px;\n padding: 5px 10px;\n margin-right: 5px;\n margin-bottom: 5px;\n white-space: nowrap;\n"])));
|
|
1016
|
+
|
|
1017
|
+
var MultiSelect = function MultiSelect(_ref) {
|
|
1018
|
+
var options = _ref.options,
|
|
1019
|
+
presset = _ref.presset,
|
|
1020
|
+
setPresset = _ref.setPresset,
|
|
1021
|
+
setOptions = _ref.setOptions,
|
|
1022
|
+
modal = _ref.modal,
|
|
1023
|
+
language = _ref.language,
|
|
1024
|
+
hasAddNewOptions = _ref.hasAddNewOptions;
|
|
1025
|
+
var _useState = useState(false),
|
|
1026
|
+
expanded = _useState[0],
|
|
1027
|
+
setExpanded = _useState[1];
|
|
1028
|
+
var _useState2 = useState(''),
|
|
1029
|
+
newOption = _useState2[0],
|
|
1030
|
+
setNewOption = _useState2[1];
|
|
1031
|
+
var t = getLanguage(language);
|
|
1032
|
+
useEffect(function () {
|
|
1033
|
+
setExpanded(false);
|
|
1034
|
+
}, [modal]);
|
|
1035
|
+
var handleCheckboxChange = function handleCheckboxChange(value) {
|
|
1036
|
+
setPresset(function (prevPresset) {
|
|
1037
|
+
if (prevPresset.includes(value)) {
|
|
1038
|
+
return prevPresset.filter(function (val) {
|
|
1039
|
+
return val !== value;
|
|
1040
|
+
});
|
|
1041
|
+
} else {
|
|
1042
|
+
return [].concat(prevPresset, [value]);
|
|
1043
|
+
}
|
|
1044
|
+
});
|
|
1045
|
+
};
|
|
1046
|
+
var showCheckboxes = function showCheckboxes() {
|
|
1047
|
+
setExpanded(!expanded);
|
|
1048
|
+
};
|
|
1049
|
+
var handleInputChange = function handleInputChange(event) {
|
|
1050
|
+
setNewOption(event.target.value);
|
|
1051
|
+
};
|
|
1052
|
+
var handleInputKeyPress = function handleInputKeyPress(event) {
|
|
1053
|
+
if (event.key === 'Enter' && hasAddNewOptions) {
|
|
1054
|
+
event.preventDefault();
|
|
1055
|
+
var trimmedOption = newOption.trim();
|
|
1056
|
+
if (trimmedOption !== '' && !options.some(function (option) {
|
|
1057
|
+
return option.value === trimmedOption;
|
|
1058
|
+
})) {
|
|
1059
|
+
setOptions(function (prevOptions) {
|
|
1060
|
+
return [].concat(prevOptions, [{
|
|
1061
|
+
label: trimmedOption,
|
|
1062
|
+
value: trimmedOption
|
|
1063
|
+
}]);
|
|
1064
|
+
});
|
|
1065
|
+
setPresset(function (prevPresset) {
|
|
1066
|
+
return [].concat(prevPresset, [trimmedOption]);
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
setNewOption('');
|
|
1070
|
+
}
|
|
1071
|
+
};
|
|
1072
|
+
return React.createElement("form", null, React.createElement(MultiSelectWrapper, null, React.createElement(SelectBox, {
|
|
1073
|
+
onClick: showCheckboxes
|
|
1074
|
+
}, React.createElement("select", null, options.map(function (option, index) {
|
|
1075
|
+
return React.createElement("option", {
|
|
1076
|
+
key: index,
|
|
1077
|
+
value: option.value
|
|
1078
|
+
}, option.label);
|
|
1079
|
+
})), React.createElement(OverSelect, null, React.createElement(SelectedValues, null, presset.map(function (value, index) {
|
|
1080
|
+
return React.createElement(SelectedValue, {
|
|
1081
|
+
key: index
|
|
1082
|
+
}, value);
|
|
1083
|
+
})), React.createElement("input", {
|
|
1084
|
+
type: "text",
|
|
1085
|
+
placeholder: hasAddNewOptions ? t.buttons.addNewPresset : t.buttons.addPresset,
|
|
1086
|
+
value: newOption,
|
|
1087
|
+
onChange: handleInputChange,
|
|
1088
|
+
onKeyPress: handleInputKeyPress
|
|
1089
|
+
}))), React.createElement(Checkboxes, {
|
|
1090
|
+
style: {
|
|
1091
|
+
display: expanded ? 'block' : 'none'
|
|
1092
|
+
}
|
|
1093
|
+
}, options.map(function (option, index) {
|
|
1094
|
+
return React.createElement(CheckboxLabel, {
|
|
1095
|
+
key: index,
|
|
1096
|
+
htmlFor: option.value
|
|
1097
|
+
}, React.createElement("input", {
|
|
1098
|
+
type: "checkbox",
|
|
1099
|
+
id: option.value,
|
|
1100
|
+
checked: presset.includes(option.value),
|
|
1101
|
+
onChange: function onChange() {
|
|
1102
|
+
return handleCheckboxChange(option.value);
|
|
1103
|
+
}
|
|
1104
|
+
}), option.label);
|
|
1105
|
+
}))));
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
var _templateObject$8;
|
|
1109
|
+
var getColor = function getColor(props) {
|
|
1110
|
+
if (props.isDragAccept) {
|
|
1111
|
+
return '#6690ff';
|
|
1112
|
+
}
|
|
1113
|
+
if (props.isDragReject) {
|
|
1114
|
+
return '#e18976';
|
|
1115
|
+
}
|
|
1116
|
+
if (props.isDragActive) {
|
|
1117
|
+
return '#6690ff';
|
|
1118
|
+
}
|
|
1119
|
+
return '#979aa5';
|
|
1120
|
+
};
|
|
1121
|
+
var Container$2 = /*#__PURE__*/styled.div(_templateObject$8 || (_templateObject$8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background-color: #f3f5f9;\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n padding: 20px;\n border-width: 2px;\n border-radius: 4px;\n border-color: var(", ");\n border-style: dashed;\n color: #5a5d68;\n outline: none;\n transition: border 0.24s ease-in-out;\n\n & > span {\n margin: 8px 10px 0 0;\n display: flex;\n }\n\n button {\n padding: 8px 16px 8px 16px;\n border-radius: 4px;\n border: 2px #102693 solid;\n margin-top: 10px;\n }\n"])), function (props) {
|
|
1122
|
+
return getColor(props);
|
|
1123
|
+
});
|
|
1124
|
+
|
|
1125
|
+
var AreaUpload = function AreaUpload(_ref) {
|
|
1126
|
+
var _ref$formatFile = _ref.formatFile,
|
|
1127
|
+
formatFile = _ref$formatFile === void 0 ? 'application/pdf' : _ref$formatFile,
|
|
1128
|
+
_ref$multipleFile = _ref.multipleFile,
|
|
1129
|
+
multipleFile = _ref$multipleFile === void 0 ? false : _ref$multipleFile,
|
|
1130
|
+
_ref$initialFiles = _ref.initialFiles,
|
|
1131
|
+
initialFiles = _ref$initialFiles === void 0 ? [] : _ref$initialFiles,
|
|
1132
|
+
_ref$setFile = _ref.setFile,
|
|
1133
|
+
setFile = _ref$setFile === void 0 ? function () {} : _ref$setFile,
|
|
1134
|
+
_ref$file = _ref.file,
|
|
1135
|
+
file = _ref$file === void 0 ? '' : _ref$file,
|
|
1136
|
+
_ref$onChange = _ref.onChange,
|
|
1137
|
+
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange;
|
|
1138
|
+
var _useState = useState([]),
|
|
1139
|
+
myFiles = _useState[0],
|
|
1140
|
+
setMyFiles = _useState[1];
|
|
1141
|
+
var t = getLanguage('pt-br');
|
|
1142
|
+
useEffect(function () {
|
|
1143
|
+
setMyFiles([].concat(initialFiles, myFiles));
|
|
1144
|
+
}, []);
|
|
1145
|
+
var onDrop = useCallback(function (acceptedFiles, fileRejections) {
|
|
1146
|
+
if (fileRejections && fileRejections.length > 0) {
|
|
1147
|
+
console.error('Arquivos rejeitados:', fileRejections);
|
|
1148
|
+
}
|
|
1149
|
+
onChange(acceptedFiles);
|
|
1150
|
+
var files = [].concat(myFiles, acceptedFiles);
|
|
1151
|
+
var filesWithId = files.map(function (item, index) {
|
|
1152
|
+
return {
|
|
1153
|
+
id: index + 1,
|
|
1154
|
+
lastModified: item.lastModified,
|
|
1155
|
+
name: item.name,
|
|
1156
|
+
size: item.size,
|
|
1157
|
+
type: item.type
|
|
1158
|
+
};
|
|
1159
|
+
});
|
|
1160
|
+
setMyFiles(filesWithId);
|
|
1161
|
+
acceptedFiles.forEach(function (file) {
|
|
1162
|
+
var reader = new FileReader();
|
|
1163
|
+
reader.onload = function () {
|
|
1164
|
+
var binaryStr = reader.result;
|
|
1165
|
+
setFile({
|
|
1166
|
+
content: binaryStr,
|
|
1167
|
+
properties: file
|
|
1168
|
+
});
|
|
1169
|
+
};
|
|
1170
|
+
reader.readAsArrayBuffer(file);
|
|
1171
|
+
});
|
|
1172
|
+
}, [myFiles]);
|
|
1173
|
+
var _useDropzone = useDropzone({
|
|
1174
|
+
accept: formatFile,
|
|
1175
|
+
noClick: true,
|
|
1176
|
+
noKeyboard: true,
|
|
1177
|
+
multiple: multipleFile,
|
|
1178
|
+
onDrop: onDrop
|
|
1179
|
+
}),
|
|
1180
|
+
getRootProps = _useDropzone.getRootProps,
|
|
1181
|
+
getInputProps = _useDropzone.getInputProps,
|
|
1182
|
+
open = _useDropzone.open,
|
|
1183
|
+
isDragActive = _useDropzone.isDragActive,
|
|
1184
|
+
isDragAccept = _useDropzone.isDragAccept,
|
|
1185
|
+
isDragReject = _useDropzone.isDragReject;
|
|
1186
|
+
return React.createElement(React.Fragment, null, multipleFile || (myFiles == null ? void 0 : myFiles.length) === 0 || !file ? React.createElement(Container$2, Object.assign({}, getRootProps({
|
|
1187
|
+
isDragActive: isDragActive,
|
|
1188
|
+
isDragAccept: isDragAccept,
|
|
1189
|
+
isDragReject: isDragReject
|
|
1190
|
+
})), React.createElement("input", Object.assign({}, getInputProps())), React.createElement("span", null, React.createElement("p", null, t.fileArea.modal.descriptionUpload)), React.createElement("button", {
|
|
1191
|
+
type: "button",
|
|
1192
|
+
onClick: open
|
|
1193
|
+
}, t.fileArea.modal.chooseFile)) : React.createElement(Container$2, Object.assign({}, getRootProps({
|
|
1194
|
+
isDragActive: isDragActive,
|
|
1195
|
+
isDragAccept: isDragAccept,
|
|
1196
|
+
isDragReject: isDragReject
|
|
1197
|
+
})), React.createElement("p", null, file)));
|
|
1198
|
+
};
|
|
1199
|
+
AreaUpload.propTypes = {
|
|
1200
|
+
formatFile: PropTypes.string,
|
|
1201
|
+
multipleFile: PropTypes.bool,
|
|
1202
|
+
initialFiles: /*#__PURE__*/PropTypes.arrayOf(PropTypes.object),
|
|
1203
|
+
removeItem: PropTypes.func,
|
|
1204
|
+
setFile: PropTypes.func,
|
|
1205
|
+
onChange: PropTypes.func,
|
|
1206
|
+
hasListFiles: PropTypes.bool
|
|
1207
|
+
};
|
|
1208
|
+
AreaUpload.defaultProps = {
|
|
1209
|
+
formatFile: 'application/json',
|
|
1210
|
+
multipleFile: false,
|
|
1211
|
+
initialFiles: [],
|
|
1212
|
+
removeItem: function removeItem() {},
|
|
1213
|
+
setFile: function setFile() {},
|
|
1214
|
+
onChange: function onChange() {},
|
|
1215
|
+
hasListFiles: true
|
|
1216
|
+
};
|
|
1217
|
+
|
|
1218
|
+
var url = 'https://api.leia.digitalcontact.cloud';
|
|
1219
|
+
axios.defaults.baseURL = "" + url;
|
|
1220
|
+
var api = /*#__PURE__*/axios.create();
|
|
1221
|
+
|
|
1222
|
+
var _excluded$5 = ["children"];
|
|
1223
|
+
var SharedPropsContext = /*#__PURE__*/createContext(undefined);
|
|
1224
|
+
var useSharedProps = function useSharedProps() {
|
|
1225
|
+
var context = useContext(SharedPropsContext);
|
|
1226
|
+
if (!context) {
|
|
1227
|
+
throw new Error('useSharedProps deve ser usado dentro de um SharedPropsProvider');
|
|
1228
|
+
}
|
|
1229
|
+
return context.props;
|
|
1230
|
+
};
|
|
1231
|
+
var SharedPropsProvider = function SharedPropsProvider(_ref) {
|
|
1232
|
+
var children = _ref.children,
|
|
1233
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
1234
|
+
var id = props.id,
|
|
1235
|
+
language = props.language;
|
|
1236
|
+
var _useState = useState(null),
|
|
1237
|
+
tags = _useState[0],
|
|
1238
|
+
setTags = _useState[1];
|
|
1239
|
+
var _useState2 = useState(null),
|
|
1240
|
+
personas = _useState2[0],
|
|
1241
|
+
setPersonas = _useState2[1];
|
|
1242
|
+
useEffect(function () {
|
|
1243
|
+
var fetchData = /*#__PURE__*/function () {
|
|
1244
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
1245
|
+
var _yield$api$get, data;
|
|
1246
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1247
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1248
|
+
case 0:
|
|
1249
|
+
_context.prev = 0;
|
|
1250
|
+
_context.next = 3;
|
|
1251
|
+
return api.get("/tags/" + id);
|
|
1252
|
+
case 3:
|
|
1253
|
+
_yield$api$get = _context.sent;
|
|
1254
|
+
data = _yield$api$get.data;
|
|
1255
|
+
if (data) {
|
|
1256
|
+
setTags(data);
|
|
1257
|
+
} else {
|
|
1258
|
+
console.error('Erro ao fazer a solicitação');
|
|
1259
|
+
}
|
|
1260
|
+
_context.next = 11;
|
|
1261
|
+
break;
|
|
1262
|
+
case 8:
|
|
1263
|
+
_context.prev = 8;
|
|
1264
|
+
_context.t0 = _context["catch"](0);
|
|
1265
|
+
console.error('Erro ao fazer a solicitação:', _context.t0);
|
|
1266
|
+
case 11:
|
|
1267
|
+
case "end":
|
|
1268
|
+
return _context.stop();
|
|
1269
|
+
}
|
|
1270
|
+
}, _callee, null, [[0, 8]]);
|
|
1271
|
+
}));
|
|
1272
|
+
return function fetchData() {
|
|
1273
|
+
return _ref2.apply(this, arguments);
|
|
1274
|
+
};
|
|
1275
|
+
}();
|
|
1276
|
+
var personas = /*#__PURE__*/function () {
|
|
1277
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
1278
|
+
var _yield$api$get2, data;
|
|
1279
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1280
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1281
|
+
case 0:
|
|
1282
|
+
_context2.prev = 0;
|
|
1283
|
+
_context2.next = 3;
|
|
1284
|
+
return api.get("/personas?language=" + language);
|
|
1285
|
+
case 3:
|
|
1286
|
+
_yield$api$get2 = _context2.sent;
|
|
1287
|
+
data = _yield$api$get2.data;
|
|
1288
|
+
if (data) {
|
|
1289
|
+
setPersonas(data);
|
|
1290
|
+
} else {
|
|
1291
|
+
console.error('Erro ao fazer a solicitação');
|
|
1292
|
+
}
|
|
1293
|
+
_context2.next = 11;
|
|
1294
|
+
break;
|
|
1295
|
+
case 8:
|
|
1296
|
+
_context2.prev = 8;
|
|
1297
|
+
_context2.t0 = _context2["catch"](0);
|
|
1298
|
+
console.error('Erro ao fazer a solicitação:', _context2.t0);
|
|
1299
|
+
case 11:
|
|
1300
|
+
case "end":
|
|
1301
|
+
return _context2.stop();
|
|
1302
|
+
}
|
|
1303
|
+
}, _callee2, null, [[0, 8]]);
|
|
1304
|
+
}));
|
|
1305
|
+
return function personas() {
|
|
1306
|
+
return _ref3.apply(this, arguments);
|
|
1307
|
+
};
|
|
1308
|
+
}();
|
|
1309
|
+
fetchData();
|
|
1310
|
+
personas();
|
|
1311
|
+
}, [id]);
|
|
1312
|
+
var sharedProps = _extends({}, props, {
|
|
1313
|
+
propTags: tags,
|
|
1314
|
+
personas: personas
|
|
1315
|
+
});
|
|
1316
|
+
return React.createElement(SharedPropsContext.Provider, {
|
|
1317
|
+
value: {
|
|
1318
|
+
props: sharedProps
|
|
1319
|
+
}
|
|
1320
|
+
}, children);
|
|
1321
|
+
};
|
|
1322
|
+
|
|
1323
|
+
var Types = {
|
|
1324
|
+
GET_FILES_REQUEST: 'GET_FILES_REQUEST',
|
|
1325
|
+
GET_FILES_SUCCESS: 'GET_FILES_SUCCESS',
|
|
1326
|
+
DELETE_FILES_REQUEST: 'DELETE_FILES_REQUEST',
|
|
1327
|
+
DELETE_FILES_SUCCESS: 'DELETE_FILES_SUCCESS',
|
|
1328
|
+
UPLOAD_FILES_REQUEST: 'UPLOAD_FILES_REQUEST',
|
|
1329
|
+
UPLOAD_FILES_SUCCESS: 'UPLOAD_FILES_SUCCESS',
|
|
1330
|
+
TRAINING_REQUEST: 'TRAINING_REQUEST',
|
|
1331
|
+
TEST_REQUEST: 'TEST_REQUEST',
|
|
1332
|
+
TEST_SUCCESS: 'TEST_SUCCESS',
|
|
1333
|
+
LOADING_START: 'LOADING_START',
|
|
1334
|
+
LOADING_FINISH: 'LOADING_FINISH',
|
|
1335
|
+
CHANGING_START: 'CHANGING_START',
|
|
1336
|
+
CHANGING_FINISH: 'CHANGING_FINISH',
|
|
1337
|
+
NETWORK_ONLINE: 'NETWORK_ONLINE',
|
|
1338
|
+
NETWORK_OFFLINE: 'NETWORK_OFFLINE'
|
|
1339
|
+
};
|
|
1340
|
+
|
|
1341
|
+
var getFilesAction = function getFilesAction(id, token) {
|
|
1342
|
+
return {
|
|
1343
|
+
type: Types.GET_FILES_REQUEST,
|
|
1344
|
+
payload: {
|
|
1345
|
+
id: id,
|
|
1346
|
+
token: token
|
|
1347
|
+
}
|
|
1348
|
+
};
|
|
1349
|
+
};
|
|
1350
|
+
var getFilesActionSuccess = function getFilesActionSuccess(_ref) {
|
|
1351
|
+
var files = _ref.files;
|
|
1352
|
+
return {
|
|
1353
|
+
type: Types.GET_FILES_SUCCESS,
|
|
1354
|
+
payload: {
|
|
1355
|
+
files: files
|
|
1356
|
+
}
|
|
1357
|
+
};
|
|
1358
|
+
};
|
|
1359
|
+
var deleteFilesAction = function deleteFilesAction(name, id, language, token) {
|
|
1360
|
+
return {
|
|
1361
|
+
type: Types.DELETE_FILES_REQUEST,
|
|
1362
|
+
payload: {
|
|
1363
|
+
name: name,
|
|
1364
|
+
id: id,
|
|
1365
|
+
language: language,
|
|
1366
|
+
token: token
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
1369
|
+
};
|
|
1370
|
+
var deleteFilesActionSuccess = function deleteFilesActionSuccess(_ref2) {
|
|
1371
|
+
var files = _ref2.files;
|
|
1372
|
+
return {
|
|
1373
|
+
type: Types.DELETE_FILES_SUCCESS,
|
|
1374
|
+
payload: {
|
|
1375
|
+
files: files
|
|
1376
|
+
}
|
|
1377
|
+
};
|
|
1378
|
+
};
|
|
1379
|
+
var uploadFilesAction = function uploadFilesAction(file, id, pressets, language, token) {
|
|
1380
|
+
return {
|
|
1381
|
+
type: Types.UPLOAD_FILES_REQUEST,
|
|
1382
|
+
payload: {
|
|
1383
|
+
file: file,
|
|
1384
|
+
id: id,
|
|
1385
|
+
pressets: pressets,
|
|
1386
|
+
language: language,
|
|
1387
|
+
token: token
|
|
1388
|
+
}
|
|
1389
|
+
};
|
|
1390
|
+
};
|
|
1391
|
+
var uploadFilesActionSuccess = function uploadFilesActionSuccess(_ref3) {
|
|
1392
|
+
var files = _ref3.files;
|
|
1393
|
+
return {
|
|
1394
|
+
type: Types.UPLOAD_FILES_SUCCESS,
|
|
1395
|
+
payload: {
|
|
1396
|
+
files: files
|
|
1397
|
+
}
|
|
1398
|
+
};
|
|
1399
|
+
};
|
|
1400
|
+
var trainingAction = function trainingAction(id, pressets, language, token) {
|
|
1401
|
+
return {
|
|
1402
|
+
type: Types.TRAINING_REQUEST,
|
|
1403
|
+
payload: {
|
|
1404
|
+
id: id,
|
|
1405
|
+
pressets: pressets,
|
|
1406
|
+
language: language,
|
|
1407
|
+
token: token
|
|
1408
|
+
}
|
|
1409
|
+
};
|
|
1410
|
+
};
|
|
1411
|
+
var testAction = function testAction(question, profile, presset, files_directory, token) {
|
|
1412
|
+
return {
|
|
1413
|
+
type: Types.TEST_REQUEST,
|
|
1414
|
+
payload: {
|
|
1415
|
+
question: question,
|
|
1416
|
+
profile: profile,
|
|
1417
|
+
presset: presset,
|
|
1418
|
+
files_directory: files_directory,
|
|
1419
|
+
token: token
|
|
1420
|
+
}
|
|
1421
|
+
};
|
|
1422
|
+
};
|
|
1423
|
+
var testActionSuccess = function testActionSuccess(_ref4) {
|
|
1424
|
+
var message = _ref4.message;
|
|
1425
|
+
return {
|
|
1426
|
+
type: Types.TEST_SUCCESS,
|
|
1427
|
+
payload: {
|
|
1428
|
+
message: message
|
|
1429
|
+
}
|
|
1430
|
+
};
|
|
1431
|
+
};
|
|
1432
|
+
var commonLoadingStart = function commonLoadingStart() {
|
|
1433
|
+
return {
|
|
1434
|
+
type: Types.LOADING_START
|
|
1435
|
+
};
|
|
1436
|
+
};
|
|
1437
|
+
var commonLoadingFinish = function commonLoadingFinish() {
|
|
1438
|
+
return {
|
|
1439
|
+
type: Types.LOADING_FINISH
|
|
1440
|
+
};
|
|
1441
|
+
};
|
|
1442
|
+
|
|
1443
|
+
var FileArea = function FileArea() {
|
|
1444
|
+
var _useSharedProps = useSharedProps(),
|
|
1445
|
+
id = _useSharedProps.id,
|
|
1446
|
+
language = _useSharedProps.language,
|
|
1447
|
+
propTags = _useSharedProps.propTags,
|
|
1448
|
+
token = _useSharedProps.token;
|
|
1449
|
+
var _useState = useState([]),
|
|
1450
|
+
files = _useState[0],
|
|
1451
|
+
setFiles = _useState[1];
|
|
1452
|
+
var _useState2 = useState([]),
|
|
1453
|
+
initialFiles = _useState2[0],
|
|
1454
|
+
setInitialFiles = _useState2[1];
|
|
1455
|
+
var _useState3 = useState(),
|
|
1456
|
+
uploadFile = _useState3[0],
|
|
1457
|
+
setUploadFile = _useState3[1];
|
|
1458
|
+
var _useState4 = useState(false),
|
|
1459
|
+
modal = _useState4[0],
|
|
1460
|
+
setModal = _useState4[1];
|
|
1461
|
+
var _useState5 = useState(false),
|
|
1462
|
+
modalDelete = _useState5[0],
|
|
1463
|
+
setModalDelete = _useState5[1];
|
|
1464
|
+
var _useState6 = useState(false),
|
|
1465
|
+
modalTraining = _useState6[0],
|
|
1466
|
+
setModalTraining = _useState6[1];
|
|
1467
|
+
var _useState7 = useState(''),
|
|
1468
|
+
fileDelete = _useState7[0],
|
|
1469
|
+
setFileDelete = _useState7[1];
|
|
1470
|
+
var _useState8 = useState([]),
|
|
1471
|
+
optionsPresset = _useState8[0],
|
|
1472
|
+
setOptionsPresset = _useState8[1];
|
|
1473
|
+
var _useState9 = useState([]),
|
|
1474
|
+
presset = _useState9[0],
|
|
1475
|
+
setPresset = _useState9[1];
|
|
1476
|
+
var t = getLanguage(language);
|
|
1477
|
+
var dispatch = useDispatch();
|
|
1478
|
+
var initFiles = useSelector(function (state) {
|
|
1479
|
+
return state.files;
|
|
1480
|
+
});
|
|
1481
|
+
var isloading = useSelector(function (state) {
|
|
1482
|
+
return state.isloading;
|
|
1483
|
+
});
|
|
1484
|
+
var tags = propTags ? propTags.tags : [];
|
|
1485
|
+
useEffect(function () {
|
|
1486
|
+
dispatch(getFilesAction(id, token));
|
|
1487
|
+
}, [id]);
|
|
1488
|
+
useEffect(function () {
|
|
1489
|
+
if (tags.length > 0) {
|
|
1490
|
+
var options = tags.map(function (tag) {
|
|
1491
|
+
return {
|
|
1492
|
+
label: tag,
|
|
1493
|
+
value: tag
|
|
1494
|
+
};
|
|
1495
|
+
});
|
|
1496
|
+
setOptionsPresset(options);
|
|
1497
|
+
} else if (optionsPresset.length > 0) {
|
|
1498
|
+
setOptionsPresset([]);
|
|
1499
|
+
}
|
|
1500
|
+
}, [tags]);
|
|
1501
|
+
useEffect(function () {
|
|
1502
|
+
if (!modal) {
|
|
1503
|
+
var options = tags.map(function (tag) {
|
|
1504
|
+
return {
|
|
1505
|
+
label: tag,
|
|
1506
|
+
value: tag
|
|
1507
|
+
};
|
|
1508
|
+
});
|
|
1509
|
+
setOptionsPresset(options);
|
|
1510
|
+
}
|
|
1511
|
+
}, [modal]);
|
|
1512
|
+
useEffect(function () {
|
|
1513
|
+
if (!!initFiles) {
|
|
1514
|
+
setFiles(initFiles);
|
|
1515
|
+
setInitialFiles(initFiles);
|
|
1516
|
+
}
|
|
1517
|
+
}, [initFiles]);
|
|
1518
|
+
var pressetTag = function pressetTag(tags) {
|
|
1519
|
+
var html = '';
|
|
1520
|
+
html += tags.map(function (tag) {
|
|
1521
|
+
var checkIcon = tag.trained ? '' : renderToString(React.createElement(TiDelete, {
|
|
1522
|
+
size: 14
|
|
1523
|
+
}));
|
|
1524
|
+
var tagClass = tag.trained ? 'trained' : '';
|
|
1525
|
+
return "<p class='tag " + tagClass + "'>" + tag.name + " " + checkIcon + "</p>";
|
|
1526
|
+
}).join('');
|
|
1527
|
+
return html;
|
|
1528
|
+
};
|
|
1529
|
+
var handleOpenModal = function handleOpenModal() {
|
|
1530
|
+
if (modal) {
|
|
1531
|
+
setUploadFile(undefined);
|
|
1532
|
+
setPresset([]);
|
|
1533
|
+
}
|
|
1534
|
+
setModal(!modal);
|
|
1535
|
+
};
|
|
1536
|
+
var handleOpenModalDelete = function handleOpenModalDelete(name) {
|
|
1537
|
+
setFileDelete(name);
|
|
1538
|
+
setModalDelete(!modalDelete);
|
|
1539
|
+
};
|
|
1540
|
+
var handleOpenModalTraining = function handleOpenModalTraining(tags) {
|
|
1541
|
+
var pressets = [];
|
|
1542
|
+
tags == null || tags.map(function (tag) {
|
|
1543
|
+
if (!tag.trained) {
|
|
1544
|
+
pressets.push(tag.name);
|
|
1545
|
+
}
|
|
1546
|
+
});
|
|
1547
|
+
setPresset(pressets);
|
|
1548
|
+
setModalTraining(!modalTraining);
|
|
1549
|
+
};
|
|
1550
|
+
var deleteFile = function deleteFile() {
|
|
1551
|
+
dispatch(deleteFilesAction(fileDelete, id, language, token));
|
|
1552
|
+
setModalDelete(false);
|
|
1553
|
+
};
|
|
1554
|
+
var handleUploadFile = function handleUploadFile() {
|
|
1555
|
+
dispatch(uploadFilesAction(uploadFile, id, presset, language, token));
|
|
1556
|
+
setModal(false);
|
|
1557
|
+
setUploadFile(undefined);
|
|
1558
|
+
setPresset([]);
|
|
1559
|
+
};
|
|
1560
|
+
var handleTrain = function handleTrain() {
|
|
1561
|
+
dispatch(trainingAction(id, presset, language, token));
|
|
1562
|
+
setModalTraining(false);
|
|
1563
|
+
setPresset([]);
|
|
1564
|
+
};
|
|
1565
|
+
var viewFile = function viewFile(link, name) {
|
|
1566
|
+
if (link) {
|
|
1567
|
+
var checkIcon = renderToString(React.createElement(FaFile, {
|
|
1568
|
+
size: 14
|
|
1569
|
+
}));
|
|
1570
|
+
return "<a href='" + link + "' target='_blank'>" + checkIcon + "</a> " + name;
|
|
1571
|
+
}
|
|
1572
|
+
return name;
|
|
1573
|
+
};
|
|
1574
|
+
var renderFiles = function renderFiles() {
|
|
1575
|
+
return React.createElement(Container, {
|
|
1576
|
+
isloading: isloading
|
|
1577
|
+
}, React.createElement("div", {
|
|
1578
|
+
id: 'loading'
|
|
1579
|
+
}), React.createElement(Header, null, React.createElement("div", {
|
|
1580
|
+
className: 'infos'
|
|
1581
|
+
}, React.createElement("h2", null, t.files), React.createElement("p", null, t.fileArea.description)), React.createElement("div", {
|
|
1582
|
+
className: 'actions'
|
|
1583
|
+
}, React.createElement(SearchInput, {
|
|
1584
|
+
placeholder: t.fileArea.search,
|
|
1585
|
+
setFiles: setFiles,
|
|
1586
|
+
initialFiles: initialFiles
|
|
1587
|
+
}), React.createElement("div", null, React.createElement("button", {
|
|
1588
|
+
id: 'button-upload',
|
|
1589
|
+
onClick: handleOpenModal
|
|
1590
|
+
}, React.createElement(FaUpload, {
|
|
1591
|
+
size: 14
|
|
1592
|
+
}), " ", t.fileArea.fileUpload), React.createElement("button", {
|
|
1593
|
+
onClick: function onClick() {
|
|
1594
|
+
return handleOpenModalTraining(undefined);
|
|
1595
|
+
}
|
|
1596
|
+
}, React.createElement(GiWeightLiftingUp, {
|
|
1597
|
+
size: 14
|
|
1598
|
+
}), " ", t.fileArea.training)))), files.length === 0 ? React.createElement(EmptyState, {
|
|
1599
|
+
icon: React.createElement(FaList, null),
|
|
1600
|
+
title: t.fileArea.emptyState.title,
|
|
1601
|
+
description: t.fileArea.emptyState.description,
|
|
1602
|
+
iconButton: React.createElement("button", {
|
|
1603
|
+
id: 'button-upload',
|
|
1604
|
+
onClick: handleOpenModal
|
|
1605
|
+
}, React.createElement(FaUpload, {
|
|
1606
|
+
size: 14
|
|
1607
|
+
}), " ", t.fileArea.fileUpload),
|
|
1608
|
+
descriptionButton: t.fileArea.fileUpload,
|
|
1609
|
+
widthButton: "230px"
|
|
1610
|
+
}) : React.createElement(Table$1, null, React.createElement("thead", null, React.createElement("tr", null, React.createElement("th", {
|
|
1611
|
+
key: "th_file_name",
|
|
1612
|
+
className: "th_file_name"
|
|
1613
|
+
}, t.fileArea.fileName), React.createElement("th", {
|
|
1614
|
+
key: "th_file_name",
|
|
1615
|
+
className: "th_status"
|
|
1616
|
+
}, t.fileArea.status), React.createElement("th", {
|
|
1617
|
+
key: "th_pressets",
|
|
1618
|
+
className: "th_pressets"
|
|
1619
|
+
}, t.fileArea.presset), React.createElement("th", {
|
|
1620
|
+
key: "th_actions",
|
|
1621
|
+
className: "th_actions"
|
|
1622
|
+
}, t.fileArea.actions))), React.createElement("tbody", null, files.map(function (object) {
|
|
1623
|
+
return React.createElement("tr", null, React.createElement("td", {
|
|
1624
|
+
dangerouslySetInnerHTML: {
|
|
1625
|
+
__html: viewFile(object.link, object.name)
|
|
1626
|
+
}
|
|
1627
|
+
}), React.createElement("td", null, object.trained ? React.createElement(FaCheck, {
|
|
1628
|
+
size: 14,
|
|
1629
|
+
style: {
|
|
1630
|
+
color: 'green'
|
|
1631
|
+
}
|
|
1632
|
+
}) : React.createElement(TiDelete, {
|
|
1633
|
+
size: 14,
|
|
1634
|
+
style: {
|
|
1635
|
+
color: 'red'
|
|
1636
|
+
}
|
|
1637
|
+
})), React.createElement("td", {
|
|
1638
|
+
className: 'tags',
|
|
1639
|
+
dangerouslySetInnerHTML: {
|
|
1640
|
+
__html: pressetTag(object.tags)
|
|
1641
|
+
}
|
|
1642
|
+
}), React.createElement("td", null, React.createElement("div", {
|
|
1643
|
+
className: 'divDelete'
|
|
1644
|
+
}, React.createElement("button", {
|
|
1645
|
+
className: 'buttonTraining',
|
|
1646
|
+
onClick: function onClick() {
|
|
1647
|
+
return handleOpenModalTraining(object.tags);
|
|
1648
|
+
}
|
|
1649
|
+
}, t.buttons.training), React.createElement("button", {
|
|
1650
|
+
className: 'buttonDelete',
|
|
1651
|
+
onClick: function onClick() {
|
|
1652
|
+
return handleOpenModalDelete(object.name);
|
|
1653
|
+
}
|
|
1654
|
+
}, t.buttons["delete"]))));
|
|
1655
|
+
}))), React.createElement(Modal$1, {
|
|
1656
|
+
isopen: modal,
|
|
1657
|
+
maxwidth: "600px",
|
|
1658
|
+
maxheight: "max-content",
|
|
1659
|
+
onClose: handleOpenModal,
|
|
1660
|
+
title: t.fileArea.modal.uploadFile
|
|
1661
|
+
}, React.createElement(ModalContent, null, React.createElement("div", {
|
|
1662
|
+
className: 'choose-file'
|
|
1663
|
+
}, React.createElement(AreaUpload, {
|
|
1664
|
+
setFile: setUploadFile,
|
|
1665
|
+
file: uploadFile == null ? void 0 : uploadFile.properties.name
|
|
1666
|
+
})), React.createElement("div", {
|
|
1667
|
+
className: 'presset'
|
|
1668
|
+
}, React.createElement("p", null, t.fileArea.presset), React.createElement(MultiSelect, {
|
|
1669
|
+
setOptions: setOptionsPresset,
|
|
1670
|
+
options: optionsPresset,
|
|
1671
|
+
presset: presset,
|
|
1672
|
+
setPresset: setPresset,
|
|
1673
|
+
modal: modal,
|
|
1674
|
+
language: language,
|
|
1675
|
+
hasAddNewOptions: true
|
|
1676
|
+
}))), React.createElement(ModalFooter, null, React.createElement("button", {
|
|
1677
|
+
className: 'button cancel',
|
|
1678
|
+
onClick: handleOpenModal
|
|
1679
|
+
}, t.buttons.cancel), React.createElement("button", {
|
|
1680
|
+
onClick: function onClick() {
|
|
1681
|
+
return handleUploadFile();
|
|
1682
|
+
},
|
|
1683
|
+
className: 'button send',
|
|
1684
|
+
type: "submit",
|
|
1685
|
+
form: "form-tts"
|
|
1686
|
+
}, t.buttons.send))), React.createElement(Modal$1, {
|
|
1687
|
+
isopen: modalDelete,
|
|
1688
|
+
maxwidth: "600px",
|
|
1689
|
+
maxheight: "max-content",
|
|
1690
|
+
onClose: function onClose() {
|
|
1691
|
+
return handleOpenModalDelete('');
|
|
1692
|
+
},
|
|
1693
|
+
title: t.fileArea.modal.deleteFileTitle
|
|
1694
|
+
}, React.createElement(ModalContent, null, React.createElement("p", {
|
|
1695
|
+
id: 'warning'
|
|
1696
|
+
}, t.fileArea.modal.deleteFile)), React.createElement(ModalFooter, null, React.createElement("button", {
|
|
1697
|
+
className: 'button cancel',
|
|
1698
|
+
onClick: function onClick() {
|
|
1699
|
+
return handleOpenModalDelete('');
|
|
1700
|
+
}
|
|
1701
|
+
}, t.buttons.cancel), React.createElement("button", {
|
|
1702
|
+
className: 'button delete',
|
|
1703
|
+
type: "submit",
|
|
1704
|
+
form: "form-tts",
|
|
1705
|
+
onClick: deleteFile
|
|
1706
|
+
}, t.buttons["delete"]))), React.createElement(Modal$1, {
|
|
1707
|
+
isopen: modalTraining,
|
|
1708
|
+
maxwidth: "600px",
|
|
1709
|
+
maxheight: "max-content",
|
|
1710
|
+
onClose: function onClose() {
|
|
1711
|
+
return handleOpenModalTraining(undefined);
|
|
1712
|
+
},
|
|
1713
|
+
title: t.fileArea.modal.trainingTitle
|
|
1714
|
+
}, React.createElement(ModalContent, null, React.createElement("p", {
|
|
1715
|
+
id: 'info'
|
|
1716
|
+
}, t.fileArea.modal.trainingDescription), React.createElement("div", {
|
|
1717
|
+
className: 'presset'
|
|
1718
|
+
}, React.createElement("p", null, t.fileArea.presset), React.createElement(MultiSelect, {
|
|
1719
|
+
setOptions: setOptionsPresset,
|
|
1720
|
+
options: optionsPresset,
|
|
1721
|
+
presset: presset,
|
|
1722
|
+
setPresset: setPresset,
|
|
1723
|
+
modal: modal,
|
|
1724
|
+
language: language,
|
|
1725
|
+
hasAddNewOptions: false
|
|
1726
|
+
}))), React.createElement(ModalFooter, null, React.createElement("button", {
|
|
1727
|
+
className: 'button cancel',
|
|
1728
|
+
onClick: function onClick() {
|
|
1729
|
+
return handleOpenModalTraining(undefined);
|
|
1730
|
+
}
|
|
1731
|
+
}, t.buttons.cancel), React.createElement("button", {
|
|
1732
|
+
onClick: function onClick() {
|
|
1733
|
+
return handleTrain();
|
|
1734
|
+
},
|
|
1735
|
+
className: 'button send',
|
|
1736
|
+
type: "submit",
|
|
1737
|
+
form: "form-tts"
|
|
1738
|
+
}, t.buttons.send))));
|
|
1739
|
+
};
|
|
1740
|
+
return React.createElement(SharedPropsProvider, {
|
|
1741
|
+
id: id,
|
|
1742
|
+
language: language,
|
|
1743
|
+
token: token,
|
|
1744
|
+
propTags: {
|
|
1745
|
+
tags: []
|
|
1746
|
+
},
|
|
1747
|
+
personas: [{
|
|
1748
|
+
name: '',
|
|
1749
|
+
description: ''
|
|
1750
|
+
}]
|
|
1751
|
+
}, React.createElement(Container, null, renderFiles()));
|
|
1752
|
+
};
|
|
1753
|
+
|
|
1754
|
+
var _templateObject$9, _templateObject2$6, _templateObject3$5, _templateObject4$2, _templateObject5$2;
|
|
1755
|
+
var Container$3 = /*#__PURE__*/styled.div(_templateObject$9 || (_templateObject$9 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n ", "\n\n"])), function (props) {
|
|
1756
|
+
return props.isloading && css(_templateObject2$6 || (_templateObject2$6 = _taggedTemplateLiteralLoose(["\n #loading {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgb(151,154,165, 0.7);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 9999;\n }\n\n #loading::after {\n content: \"\";\n border: 4px solid #f3f3f3; /* Cor do s\xEDmbolo de carregamento */\n border-top: 4px solid #5a5d68; /* Cor do s\xEDmbolo de carregamento */\n border-radius: 50%;\n width: 13px;\n height: 13px;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "])));
|
|
1757
|
+
});
|
|
1758
|
+
var Header$1 = /*#__PURE__*/styled.div(_templateObject3$5 || (_templateObject3$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n .infos {\n display: flex;\n flex-direction: column;\n padding: 14px 0;\n\n h2 {\n font-size: 20px\n }\n\n p {\n font-size: 14px\n }\n }\n"])));
|
|
1759
|
+
var Inputs = /*#__PURE__*/styled.div(_templateObject4$2 || (_templateObject4$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n margin-bottom: 10px;\n\n button {\n background: #102693;\n padding: 10px 20px;\n color: white;\n border-radius: 4px;\n width: 190px;\n height: 45px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n svg {\n width: 23px;\n height: 23px;\n }\n }\n"])));
|
|
1760
|
+
var Result = /*#__PURE__*/styled.div(_templateObject5$2 || (_templateObject5$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: left;\n background: #F3F5F9;\n padding: 15px;\n border-radius: 5px;\n margin-top: 15px;\n\n .text{\n margin-left: 5px;\n font-size: 14px;\n line-height: 1.5;\n }\n\n .icon {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: 5px;\n\n svg {\n width: 35px;\n height: 35px;\n }\n }\n\n"])));
|
|
1761
|
+
|
|
1762
|
+
var _templateObject$a;
|
|
1763
|
+
var Container$4 = /*#__PURE__*/styled.div(_templateObject$a || (_templateObject$a = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: 50%;\n margin-right: 5px;\n\n .custom-select {\n position: relative;\n width: 100%;\n cursor: pointer;\n\n .selected-option {\n padding: 12px;\n border-radius: 4px;\n border: 1px solid #979AA5;\n height: 45px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: 14px;\n }\n\n .options {\n position: absolute;\n top: 100%;\n left: 0;\n width: 100%;\n border: 1px solid #979AA5;\n border-top: none;\n border-radius: 0 0 4px 4px;\n background-color: #fff;\n\n .option {\n padding: 12px;\n cursor: pointer;\n transition: background-color 0.1s;\n letter-spacing: 0.5px;\n font-size: 14px;\n\n &:hover {\n background-color: #6690ff;\n color: white;\n }\n }\n }\n }\n"])));
|
|
1764
|
+
|
|
1765
|
+
var CustomSelect = function CustomSelect(_ref) {
|
|
1766
|
+
var options = _ref.options,
|
|
1767
|
+
onSelect = _ref.onSelect,
|
|
1768
|
+
placeholder = _ref.placeholder;
|
|
1769
|
+
var _useState = useState(false),
|
|
1770
|
+
isOpen = _useState[0],
|
|
1771
|
+
setIsOpen = _useState[1];
|
|
1772
|
+
var _useState2 = useState(''),
|
|
1773
|
+
selectedValue = _useState2[0],
|
|
1774
|
+
setSelectedValue = _useState2[1];
|
|
1775
|
+
var handleSelectOption = function handleSelectOption(value) {
|
|
1776
|
+
var selected = String(value);
|
|
1777
|
+
setSelectedValue(selected);
|
|
1778
|
+
onSelect(selected);
|
|
1779
|
+
setIsOpen(false);
|
|
1780
|
+
};
|
|
1781
|
+
return React.createElement(Container$4, null, React.createElement("div", {
|
|
1782
|
+
className: "custom-select",
|
|
1783
|
+
onClick: function onClick() {
|
|
1784
|
+
return setIsOpen(!isOpen);
|
|
1785
|
+
}
|
|
1786
|
+
}, React.createElement("div", {
|
|
1787
|
+
className: "selected-option"
|
|
1788
|
+
}, selectedValue || placeholder, React.createElement("span", {
|
|
1789
|
+
className: "arrow"
|
|
1790
|
+
}, "\u25BC")), isOpen && React.createElement("div", {
|
|
1791
|
+
className: "options"
|
|
1792
|
+
}, options.map(function (option) {
|
|
1793
|
+
return React.createElement("div", {
|
|
1794
|
+
key: option.value,
|
|
1795
|
+
style: {
|
|
1796
|
+
background: option.value === selectedValue ? '#a0b7f5' : undefined,
|
|
1797
|
+
color: option.value === selectedValue ? 'white' : undefined
|
|
1798
|
+
},
|
|
1799
|
+
className: "option",
|
|
1800
|
+
onClick: function onClick() {
|
|
1801
|
+
return handleSelectOption(option.value);
|
|
1802
|
+
}
|
|
1803
|
+
}, option.label);
|
|
1804
|
+
}))));
|
|
1805
|
+
};
|
|
1806
|
+
|
|
1807
|
+
var _templateObject$b, _templateObject2$7;
|
|
1808
|
+
var Container$5 = /*#__PURE__*/styled.div(_templateObject$b || (_templateObject$b = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: 100%;\n margin-right: 5px;\n"])));
|
|
1809
|
+
var StyledInput = /*#__PURE__*/styled.input(_templateObject2$7 || (_templateObject2$7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding-left: 10px;\n padding-right: 40px;\n border-radius: 5px;\n border: 1px solid #ccc;\n height: 45px;\n width: 100%;\n\n &:focus {\n outline: none;\n box-shadow: 0 0 0 3px #6690ff;\n }\n"])));
|
|
1810
|
+
|
|
1811
|
+
var InputTest = function InputTest(_ref) {
|
|
1812
|
+
var placeholder = _ref.placeholder,
|
|
1813
|
+
_onChange = _ref.onChange;
|
|
1814
|
+
return React.createElement(Container$5, null, React.createElement(StyledInput, {
|
|
1815
|
+
type: "text",
|
|
1816
|
+
onChange: function onChange(e) {
|
|
1817
|
+
return _onChange(e.target.value);
|
|
1818
|
+
},
|
|
1819
|
+
placeholder: placeholder
|
|
1820
|
+
}));
|
|
1821
|
+
};
|
|
1822
|
+
|
|
1823
|
+
var TestArea = function TestArea() {
|
|
1824
|
+
var _useSharedProps = useSharedProps(),
|
|
1825
|
+
id = _useSharedProps.id,
|
|
1826
|
+
language = _useSharedProps.language,
|
|
1827
|
+
personas = _useSharedProps.personas,
|
|
1828
|
+
propTags = _useSharedProps.propTags,
|
|
1829
|
+
token = _useSharedProps.token;
|
|
1830
|
+
var t = getLanguage(language);
|
|
1831
|
+
var results = useSelector(function (state) {
|
|
1832
|
+
return state.message;
|
|
1833
|
+
});
|
|
1834
|
+
var isloading = useSelector(function (state) {
|
|
1835
|
+
return state.isloading;
|
|
1836
|
+
});
|
|
1837
|
+
var _useState = useState(''),
|
|
1838
|
+
search = _useState[0],
|
|
1839
|
+
setSearch = _useState[1];
|
|
1840
|
+
var _useState2 = useState(''),
|
|
1841
|
+
profile = _useState2[0],
|
|
1842
|
+
setProfile = _useState2[1];
|
|
1843
|
+
var _useState3 = useState(''),
|
|
1844
|
+
presset = _useState3[0],
|
|
1845
|
+
setPresset = _useState3[1];
|
|
1846
|
+
var dispatch = useDispatch();
|
|
1847
|
+
var tags = propTags ? propTags.tags : [];
|
|
1848
|
+
var optionsPersona = personas && personas.map(function (persona) {
|
|
1849
|
+
return {
|
|
1850
|
+
label: persona.name,
|
|
1851
|
+
value: persona.name
|
|
1852
|
+
};
|
|
1853
|
+
});
|
|
1854
|
+
var optionsPresset = tags.map(function (tag) {
|
|
1855
|
+
return {
|
|
1856
|
+
label: tag,
|
|
1857
|
+
value: tag
|
|
1858
|
+
};
|
|
1859
|
+
});
|
|
1860
|
+
var handleSelectPersona = function handleSelectPersona(value) {
|
|
1861
|
+
setProfile(value);
|
|
1862
|
+
};
|
|
1863
|
+
var handleSelectPresset = function handleSelectPresset(value) {
|
|
1864
|
+
setPresset(value);
|
|
1865
|
+
};
|
|
1866
|
+
var handleSearch = function handleSearch(value) {
|
|
1867
|
+
setSearch(value);
|
|
1868
|
+
};
|
|
1869
|
+
var handleTest = function handleTest() {
|
|
1870
|
+
dispatch(testAction(search, profile, presset, id, token));
|
|
1871
|
+
};
|
|
1872
|
+
var returnTest = function returnTest() {
|
|
1873
|
+
return React.createElement(Container$3, {
|
|
1874
|
+
isloading: isloading
|
|
1875
|
+
}, React.createElement("div", {
|
|
1876
|
+
id: 'loading'
|
|
1877
|
+
}), React.createElement(Header$1, null, React.createElement("div", {
|
|
1878
|
+
className: 'infos'
|
|
1879
|
+
}, React.createElement("h2", null, t.test), React.createElement("p", null, t.testArea.description))), React.createElement(Inputs, null, React.createElement(InputTest, {
|
|
1880
|
+
placeholder: t.testArea.typeSentence,
|
|
1881
|
+
onChange: handleSearch
|
|
1882
|
+
}), React.createElement(CustomSelect, {
|
|
1883
|
+
placeholder: t.testArea.selectPersona,
|
|
1884
|
+
options: optionsPersona,
|
|
1885
|
+
onSelect: handleSelectPersona
|
|
1886
|
+
}), React.createElement(CustomSelect, {
|
|
1887
|
+
placeholder: t.testArea.selectPresset,
|
|
1888
|
+
options: optionsPresset,
|
|
1889
|
+
onSelect: handleSelectPresset
|
|
1890
|
+
}), React.createElement("button", {
|
|
1891
|
+
onClick: handleTest
|
|
1892
|
+
}, React.createElement(PiWaveformBold, null), " ", t.buttons.test)), !results ? React.createElement(EmptyState, {
|
|
1893
|
+
icon: React.createElement(FaList, null),
|
|
1894
|
+
title: t.testArea.emptyState.title,
|
|
1895
|
+
description: t.testArea.emptyState.description,
|
|
1896
|
+
activeButton: false
|
|
1897
|
+
}) : React.createElement(Result, null, React.createElement("div", {
|
|
1898
|
+
className: 'icon'
|
|
1899
|
+
}, React.createElement(MdPerson2, null)), React.createElement("div", {
|
|
1900
|
+
className: 'text'
|
|
1901
|
+
}, results)));
|
|
1902
|
+
};
|
|
1903
|
+
return React.createElement(SharedPropsProvider, {
|
|
1904
|
+
id: id,
|
|
1905
|
+
token: token,
|
|
1906
|
+
language: language,
|
|
1907
|
+
propTags: {
|
|
1908
|
+
tags: []
|
|
1909
|
+
},
|
|
1910
|
+
personas: [{
|
|
1911
|
+
name: '',
|
|
1912
|
+
description: ''
|
|
1913
|
+
}]
|
|
1914
|
+
}, React.createElement(Container$3, null, returnTest()));
|
|
1915
|
+
};
|
|
1916
|
+
|
|
1917
|
+
var Leia = function Leia(props) {
|
|
1918
|
+
var match = useRouteMatch();
|
|
1919
|
+
var _useLocation = useLocation(),
|
|
1920
|
+
pathname = _useLocation.pathname;
|
|
1921
|
+
var history = useHistory();
|
|
1922
|
+
var t = getLanguage(props.language);
|
|
1923
|
+
var activeTab = useMemo(function () {
|
|
1924
|
+
return pathname.split('/')[5] || 'files';
|
|
1925
|
+
}, [pathname]);
|
|
1926
|
+
return React.createElement(SharedPropsProvider, Object.assign({
|
|
1927
|
+
propTags: {
|
|
1928
|
+
tags: []
|
|
1929
|
+
},
|
|
1930
|
+
personas: [{
|
|
1931
|
+
name: '',
|
|
1932
|
+
description: ''
|
|
1933
|
+
}]
|
|
1934
|
+
}, props), React.createElement(React.Fragment, null, React.createElement(Tabs, {
|
|
1935
|
+
value: activeTab,
|
|
1936
|
+
onChange: function onChange(value) {
|
|
1937
|
+
return history.push(match.url + "/" + value);
|
|
1938
|
+
}
|
|
1939
|
+
}, React.createElement(Tab$1, {
|
|
1940
|
+
value: "files"
|
|
1941
|
+
}, t.files), React.createElement(Tab$1, {
|
|
1942
|
+
value: "test"
|
|
1943
|
+
}, t.test)), React.createElement(Suspense, {
|
|
1944
|
+
fallback: props.loading
|
|
1945
|
+
}, React.createElement(Switch, null, React.createElement(Route, {
|
|
1946
|
+
path: "" + match.path,
|
|
1947
|
+
exact: true,
|
|
1948
|
+
component: FileArea
|
|
1949
|
+
}), React.createElement(Route, {
|
|
1950
|
+
path: match.path + "/files",
|
|
1951
|
+
component: FileArea
|
|
1952
|
+
}), React.createElement(Route, {
|
|
1953
|
+
path: match.path + "/test",
|
|
1954
|
+
component: TestArea
|
|
1955
|
+
})))));
|
|
1956
|
+
};
|
|
1957
|
+
|
|
1958
|
+
var INITIAL_STATE = {
|
|
1959
|
+
files: [],
|
|
1960
|
+
message: '',
|
|
1961
|
+
isloading: false,
|
|
1962
|
+
isChanging: false,
|
|
1963
|
+
isOffline: true
|
|
1964
|
+
};
|
|
1965
|
+
function filesReducer(state, action) {
|
|
1966
|
+
if (state === void 0) {
|
|
1967
|
+
state = INITIAL_STATE;
|
|
1968
|
+
}
|
|
1969
|
+
return produce(state, function (draft) {
|
|
1970
|
+
switch (action.type) {
|
|
1971
|
+
case Types.GET_FILES_SUCCESS:
|
|
1972
|
+
draft.files = action.payload.files;
|
|
1973
|
+
break;
|
|
1974
|
+
case Types.DELETE_FILES_SUCCESS:
|
|
1975
|
+
draft.files = action.payload.files;
|
|
1976
|
+
break;
|
|
1977
|
+
case Types.TEST_SUCCESS:
|
|
1978
|
+
draft.message = action.payload.message;
|
|
1979
|
+
break;
|
|
1980
|
+
case Types.LOADING_START:
|
|
1981
|
+
draft.isloading = true;
|
|
1982
|
+
break;
|
|
1983
|
+
case Types.LOADING_FINISH:
|
|
1984
|
+
draft.isloading = false;
|
|
1985
|
+
break;
|
|
1986
|
+
case Types.CHANGING_START:
|
|
1987
|
+
draft.isChanging = true;
|
|
1988
|
+
break;
|
|
1989
|
+
case Types.CHANGING_FINISH:
|
|
1990
|
+
draft.isChanging = false;
|
|
1991
|
+
break;
|
|
1992
|
+
case Types.NETWORK_ONLINE:
|
|
1993
|
+
draft.isOffline = false;
|
|
1994
|
+
break;
|
|
1995
|
+
case Types.NETWORK_OFFLINE:
|
|
1996
|
+
draft.isOffline = true;
|
|
1997
|
+
break;
|
|
1998
|
+
default:
|
|
1999
|
+
return action.payload;
|
|
2000
|
+
}
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
var CustomToastContent = function CustomToastContent(_ref) {
|
|
2005
|
+
var title = _ref.title,
|
|
2006
|
+
description = _ref.description;
|
|
2007
|
+
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
2008
|
+
className: "custom-toastify-content"
|
|
2009
|
+
}, React.createElement("strong", {
|
|
2010
|
+
className: "custom-toastify-title"
|
|
2011
|
+
}, title), description && React.createElement("p", {
|
|
2012
|
+
className: "custom-toastify-description"
|
|
2013
|
+
}, description)));
|
|
2014
|
+
};
|
|
2015
|
+
var toast = {
|
|
2016
|
+
"default": function _default(_ref2) {
|
|
2017
|
+
var title = _ref2.title,
|
|
2018
|
+
description = _ref2.description;
|
|
2019
|
+
return toast$1(React.createElement(CustomToastContent, {
|
|
2020
|
+
title: title,
|
|
2021
|
+
description: description
|
|
2022
|
+
}));
|
|
2023
|
+
},
|
|
2024
|
+
success: function success(_ref3) {
|
|
2025
|
+
var title = _ref3.title,
|
|
2026
|
+
description = _ref3.description;
|
|
2027
|
+
return toast$1.success(React.createElement(CustomToastContent, {
|
|
2028
|
+
title: title,
|
|
2029
|
+
description: description
|
|
2030
|
+
}));
|
|
2031
|
+
},
|
|
2032
|
+
error: function error(_ref4) {
|
|
2033
|
+
var title = _ref4.title,
|
|
2034
|
+
description = _ref4.description;
|
|
2035
|
+
return toast$1.error(React.createElement(CustomToastContent, {
|
|
2036
|
+
title: title,
|
|
2037
|
+
description: description
|
|
2038
|
+
}));
|
|
2039
|
+
},
|
|
2040
|
+
warn: function warn(_ref5) {
|
|
2041
|
+
var title = _ref5.title,
|
|
2042
|
+
description = _ref5.description;
|
|
2043
|
+
return toast$1.warn(React.createElement(CustomToastContent, {
|
|
2044
|
+
title: title,
|
|
2045
|
+
description: description
|
|
2046
|
+
}));
|
|
2047
|
+
}
|
|
2048
|
+
};
|
|
2049
|
+
|
|
2050
|
+
var _marked = /*#__PURE__*/_regeneratorRuntime().mark(getFilesSaga),
|
|
2051
|
+
_marked2 = /*#__PURE__*/_regeneratorRuntime().mark(deleteFilesSaga),
|
|
2052
|
+
_marked3 = /*#__PURE__*/_regeneratorRuntime().mark(testSaga),
|
|
2053
|
+
_marked4 = /*#__PURE__*/_regeneratorRuntime().mark(uploadFilesSaga),
|
|
2054
|
+
_marked5 = /*#__PURE__*/_regeneratorRuntime().mark(TrainingSaga),
|
|
2055
|
+
_marked6 = /*#__PURE__*/_regeneratorRuntime().mark(filesSagas);
|
|
2056
|
+
function getFilesSaga(action) {
|
|
2057
|
+
var _action$payload, id, token, _yield$call, data;
|
|
2058
|
+
return _regeneratorRuntime().wrap(function getFilesSaga$(_context) {
|
|
2059
|
+
while (1) switch (_context.prev = _context.next) {
|
|
2060
|
+
case 0:
|
|
2061
|
+
_context.prev = 0;
|
|
2062
|
+
_context.next = 3;
|
|
2063
|
+
return put(commonLoadingStart());
|
|
2064
|
+
case 3:
|
|
2065
|
+
_action$payload = action.payload, id = _action$payload.id, token = _action$payload.token;
|
|
2066
|
+
_context.next = 6;
|
|
2067
|
+
return call(api.get, "/training/" + id + "?token=" + token);
|
|
2068
|
+
case 6:
|
|
2069
|
+
_yield$call = _context.sent;
|
|
2070
|
+
data = _yield$call.data;
|
|
2071
|
+
_context.next = 10;
|
|
2072
|
+
return put(getFilesActionSuccess({
|
|
2073
|
+
files: data.files
|
|
2074
|
+
}));
|
|
2075
|
+
case 10:
|
|
2076
|
+
_context.next = 15;
|
|
2077
|
+
break;
|
|
2078
|
+
case 12:
|
|
2079
|
+
_context.prev = 12;
|
|
2080
|
+
_context.t0 = _context["catch"](0);
|
|
2081
|
+
console.log('-----------getFiles.error------------------->', _context.t0);
|
|
2082
|
+
case 15:
|
|
2083
|
+
_context.prev = 15;
|
|
2084
|
+
_context.next = 18;
|
|
2085
|
+
return put(commonLoadingFinish());
|
|
2086
|
+
case 18:
|
|
2087
|
+
return _context.finish(15);
|
|
2088
|
+
case 19:
|
|
2089
|
+
case "end":
|
|
2090
|
+
return _context.stop();
|
|
2091
|
+
}
|
|
2092
|
+
}, _marked, null, [[0, 12, 15, 19]]);
|
|
2093
|
+
}
|
|
2094
|
+
function deleteFilesSaga(action) {
|
|
2095
|
+
var t, _action$payload2, id, name, token, _yield$call2, data;
|
|
2096
|
+
return _regeneratorRuntime().wrap(function deleteFilesSaga$(_context2) {
|
|
2097
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
2098
|
+
case 0:
|
|
2099
|
+
t = getLanguage(action.payload.language);
|
|
2100
|
+
_context2.prev = 1;
|
|
2101
|
+
_context2.next = 4;
|
|
2102
|
+
return put(commonLoadingStart());
|
|
2103
|
+
case 4:
|
|
2104
|
+
_action$payload2 = action.payload, id = _action$payload2.id, name = _action$payload2.name, token = _action$payload2.token;
|
|
2105
|
+
_context2.next = 7;
|
|
2106
|
+
return call(api["delete"], "/delete/" + id + "/" + name + "?token=" + token);
|
|
2107
|
+
case 7:
|
|
2108
|
+
_context2.next = 9;
|
|
2109
|
+
return call(api.get, "/training/" + id + "?token=" + token);
|
|
2110
|
+
case 9:
|
|
2111
|
+
_yield$call2 = _context2.sent;
|
|
2112
|
+
data = _yield$call2.data;
|
|
2113
|
+
_context2.next = 13;
|
|
2114
|
+
return put(deleteFilesActionSuccess({
|
|
2115
|
+
files: data.files,
|
|
2116
|
+
success: true
|
|
2117
|
+
}));
|
|
2118
|
+
case 13:
|
|
2119
|
+
_context2.next = 19;
|
|
2120
|
+
break;
|
|
2121
|
+
case 15:
|
|
2122
|
+
_context2.prev = 15;
|
|
2123
|
+
_context2.t0 = _context2["catch"](1);
|
|
2124
|
+
toast.error({
|
|
2125
|
+
title: t.toast.deleteFile.fail.title,
|
|
2126
|
+
description: t.toast.deleteFile.fail.description
|
|
2127
|
+
});
|
|
2128
|
+
console.log('-----------deleteFilesSaga.error------------------->', _context2.t0);
|
|
2129
|
+
case 19:
|
|
2130
|
+
_context2.prev = 19;
|
|
2131
|
+
_context2.next = 22;
|
|
2132
|
+
return put(commonLoadingFinish());
|
|
2133
|
+
case 22:
|
|
2134
|
+
return _context2.finish(19);
|
|
2135
|
+
case 23:
|
|
2136
|
+
case "end":
|
|
2137
|
+
return _context2.stop();
|
|
2138
|
+
}
|
|
2139
|
+
}, _marked2, null, [[1, 15, 19, 23]]);
|
|
2140
|
+
}
|
|
2141
|
+
function testSaga(action) {
|
|
2142
|
+
var _action$payload3, question, profile, presset, files_directory, token, _yield$call3, data;
|
|
2143
|
+
return _regeneratorRuntime().wrap(function testSaga$(_context3) {
|
|
2144
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
2145
|
+
case 0:
|
|
2146
|
+
_context3.prev = 0;
|
|
2147
|
+
_context3.next = 3;
|
|
2148
|
+
return put(commonLoadingStart());
|
|
2149
|
+
case 3:
|
|
2150
|
+
_action$payload3 = action.payload, question = _action$payload3.question, profile = _action$payload3.profile, presset = _action$payload3.presset, files_directory = _action$payload3.files_directory, token = _action$payload3.token;
|
|
2151
|
+
_context3.next = 6;
|
|
2152
|
+
return call(api.post, "/ask", {
|
|
2153
|
+
question: question,
|
|
2154
|
+
profile: profile,
|
|
2155
|
+
tag: presset,
|
|
2156
|
+
files_directory: files_directory,
|
|
2157
|
+
token: token
|
|
2158
|
+
});
|
|
2159
|
+
case 6:
|
|
2160
|
+
_yield$call3 = _context3.sent;
|
|
2161
|
+
data = _yield$call3.data;
|
|
2162
|
+
_context3.next = 10;
|
|
2163
|
+
return put(testActionSuccess({
|
|
2164
|
+
message: data.message
|
|
2165
|
+
}));
|
|
2166
|
+
case 10:
|
|
2167
|
+
_context3.next = 15;
|
|
2168
|
+
break;
|
|
2169
|
+
case 12:
|
|
2170
|
+
_context3.prev = 12;
|
|
2171
|
+
_context3.t0 = _context3["catch"](0);
|
|
2172
|
+
console.log('-----------testSaga.error------------------->', _context3.t0);
|
|
2173
|
+
case 15:
|
|
2174
|
+
_context3.prev = 15;
|
|
2175
|
+
_context3.next = 18;
|
|
2176
|
+
return put(commonLoadingFinish());
|
|
2177
|
+
case 18:
|
|
2178
|
+
return _context3.finish(15);
|
|
2179
|
+
case 19:
|
|
2180
|
+
case "end":
|
|
2181
|
+
return _context3.stop();
|
|
2182
|
+
}
|
|
2183
|
+
}, _marked3, null, [[0, 12, 15, 19]]);
|
|
2184
|
+
}
|
|
2185
|
+
function uploadFilesSaga(action) {
|
|
2186
|
+
var t, _action$payload4, id, file, pressets, token, blob, formData, queryParams, url, _yield$call4, data;
|
|
2187
|
+
return _regeneratorRuntime().wrap(function uploadFilesSaga$(_context4) {
|
|
2188
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
2189
|
+
case 0:
|
|
2190
|
+
t = getLanguage(action.payload.language);
|
|
2191
|
+
_context4.prev = 1;
|
|
2192
|
+
_context4.next = 4;
|
|
2193
|
+
return put(commonLoadingStart());
|
|
2194
|
+
case 4:
|
|
2195
|
+
_action$payload4 = action.payload, id = _action$payload4.id, file = _action$payload4.file, pressets = _action$payload4.pressets, token = _action$payload4.token;
|
|
2196
|
+
blob = new Blob([file.content]);
|
|
2197
|
+
formData = new FormData();
|
|
2198
|
+
formData.append('file', blob, file.properties.path);
|
|
2199
|
+
queryParams = pressets.length ? new URLSearchParams({
|
|
2200
|
+
tags: pressets.join(',')
|
|
2201
|
+
}).toString() : '';
|
|
2202
|
+
url = queryParams ? "/upload/" + id + "?token=" + token + "&" + queryParams : "/upload/" + id + "?token=" + token;
|
|
2203
|
+
_context4.next = 12;
|
|
2204
|
+
return call(api.post, url, formData, {
|
|
2205
|
+
headers: {
|
|
2206
|
+
'Content-Type': 'multipart/form-data'
|
|
2207
|
+
}
|
|
2208
|
+
});
|
|
2209
|
+
case 12:
|
|
2210
|
+
_context4.next = 14;
|
|
2211
|
+
return call(api.get, "/training/" + id + "?token=" + token);
|
|
2212
|
+
case 14:
|
|
2213
|
+
_yield$call4 = _context4.sent;
|
|
2214
|
+
data = _yield$call4.data;
|
|
2215
|
+
_context4.next = 18;
|
|
2216
|
+
return put(uploadFilesActionSuccess({
|
|
2217
|
+
files: data.files
|
|
2218
|
+
}));
|
|
2219
|
+
case 18:
|
|
2220
|
+
_context4.next = 24;
|
|
2221
|
+
break;
|
|
2222
|
+
case 20:
|
|
2223
|
+
_context4.prev = 20;
|
|
2224
|
+
_context4.t0 = _context4["catch"](1);
|
|
2225
|
+
toast.error({
|
|
2226
|
+
title: t.toast.uploadFile.fail.title,
|
|
2227
|
+
description: t.toast.uploadFile.fail.description
|
|
2228
|
+
});
|
|
2229
|
+
console.log('-----------uploadFilesSaga.error------------------->', _context4.t0);
|
|
2230
|
+
case 24:
|
|
2231
|
+
_context4.prev = 24;
|
|
2232
|
+
_context4.next = 27;
|
|
2233
|
+
return put(commonLoadingFinish());
|
|
2234
|
+
case 27:
|
|
2235
|
+
return _context4.finish(24);
|
|
2236
|
+
case 28:
|
|
2237
|
+
case "end":
|
|
2238
|
+
return _context4.stop();
|
|
2239
|
+
}
|
|
2240
|
+
}, _marked4, null, [[1, 20, 24, 28]]);
|
|
2241
|
+
}
|
|
2242
|
+
function TrainingSaga(action) {
|
|
2243
|
+
var t, _action$payload5, id, pressets, token, tag, queryParams, _yield$call5, data;
|
|
2244
|
+
return _regeneratorRuntime().wrap(function TrainingSaga$(_context5) {
|
|
2245
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
2246
|
+
case 0:
|
|
2247
|
+
t = getLanguage(action.payload.language);
|
|
2248
|
+
_context5.prev = 1;
|
|
2249
|
+
_context5.next = 4;
|
|
2250
|
+
return put(commonLoadingStart());
|
|
2251
|
+
case 4:
|
|
2252
|
+
_action$payload5 = action.payload, id = _action$payload5.id, pressets = _action$payload5.pressets, token = _action$payload5.token;
|
|
2253
|
+
tag = pressets.join(',');
|
|
2254
|
+
queryParams = new URLSearchParams({
|
|
2255
|
+
tag: tag
|
|
2256
|
+
}).toString();
|
|
2257
|
+
_context5.next = 9;
|
|
2258
|
+
return call(api.post, pressets.length > 0 ? "/training?" + queryParams : "/training", {
|
|
2259
|
+
files_directory: id,
|
|
2260
|
+
token: token
|
|
2261
|
+
});
|
|
2262
|
+
case 9:
|
|
2263
|
+
_context5.next = 11;
|
|
2264
|
+
return call(api.get, "/training/" + id + "?token=" + token);
|
|
2265
|
+
case 11:
|
|
2266
|
+
_yield$call5 = _context5.sent;
|
|
2267
|
+
data = _yield$call5.data;
|
|
2268
|
+
_context5.next = 15;
|
|
2269
|
+
return put(uploadFilesActionSuccess({
|
|
2270
|
+
files: data.files
|
|
2271
|
+
}));
|
|
2272
|
+
case 15:
|
|
2273
|
+
toast.success({
|
|
2274
|
+
title: t.toast.Train.success.title,
|
|
2275
|
+
description: t.toast.Train.success.description
|
|
2276
|
+
});
|
|
2277
|
+
_context5.next = 22;
|
|
2278
|
+
break;
|
|
2279
|
+
case 18:
|
|
2280
|
+
_context5.prev = 18;
|
|
2281
|
+
_context5.t0 = _context5["catch"](1);
|
|
2282
|
+
toast.error({
|
|
2283
|
+
title: t.toast.Train.fail.title,
|
|
2284
|
+
description: t.toast.Train.fail.description
|
|
2285
|
+
});
|
|
2286
|
+
console.log('-----------TrainingSaga.error------------------->', _context5.t0);
|
|
2287
|
+
case 22:
|
|
2288
|
+
_context5.prev = 22;
|
|
2289
|
+
_context5.next = 25;
|
|
2290
|
+
return put(commonLoadingFinish());
|
|
2291
|
+
case 25:
|
|
2292
|
+
return _context5.finish(22);
|
|
2293
|
+
case 26:
|
|
2294
|
+
case "end":
|
|
2295
|
+
return _context5.stop();
|
|
2296
|
+
}
|
|
2297
|
+
}, _marked5, null, [[1, 18, 22, 26]]);
|
|
2298
|
+
}
|
|
2299
|
+
function filesSagas() {
|
|
2300
|
+
return _regeneratorRuntime().wrap(function filesSagas$(_context6) {
|
|
2301
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
2302
|
+
case 0:
|
|
2303
|
+
_context6.next = 2;
|
|
2304
|
+
return all([takeLatest(Types.GET_FILES_REQUEST, getFilesSaga), takeLatest(Types.DELETE_FILES_REQUEST, deleteFilesSaga), takeLatest(Types.UPLOAD_FILES_REQUEST, uploadFilesSaga), takeLatest(Types.TEST_REQUEST, testSaga), takeLatest(Types.TRAINING_REQUEST, TrainingSaga)]);
|
|
2305
|
+
case 2:
|
|
2306
|
+
case "end":
|
|
2307
|
+
return _context6.stop();
|
|
2308
|
+
}
|
|
2309
|
+
}, _marked6);
|
|
2310
|
+
}
|
|
2311
|
+
|
|
2312
|
+
var sagaMiddleware = /*#__PURE__*/createSagaMiddleware();
|
|
2313
|
+
var store = /*#__PURE__*/createStore(filesReducer, /*#__PURE__*/applyMiddleware(sagaMiddleware));
|
|
2314
|
+
sagaMiddleware.run(filesSagas);
|
|
2315
|
+
|
|
2316
|
+
function Code7(props) {
|
|
2317
|
+
return React.createElement(Provider, {
|
|
2318
|
+
store: store
|
|
2319
|
+
}, React.createElement(Leia, Object.assign({}, props)));
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
export { Code7 };
|
|
2323
|
+
//# sourceMappingURL=code7-leia.esm.js.map
|