@myinterview/chatbot 0.1.77-experimental-b8f1917 → 0.1.78-experimental-f9ad8db
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/index-BKaveF39.js +19 -0
- package/dist/index-BKaveF39.js.map +1 -0
- package/dist/index-BM74fau_.js +41 -0
- package/dist/index-BM74fau_.js.map +1 -0
- package/dist/index-B_3V2SsA.js +18 -0
- package/dist/index-B_3V2SsA.js.map +1 -0
- package/dist/index-BkKh_B9_.js +10 -0
- package/dist/index-BkKh_B9_.js.map +1 -0
- package/dist/index-BwnD9b3f.js +40956 -0
- package/dist/index-BwnD9b3f.js.map +1 -0
- package/dist/index-C9VugPt_.js +78 -0
- package/dist/index-C9VugPt_.js.map +1 -0
- package/dist/index-CRTFfAjz.js +22 -0
- package/dist/index-CRTFfAjz.js.map +1 -0
- package/dist/index-ClFF5jtR.js +87 -0
- package/dist/index-ClFF5jtR.js.map +1 -0
- package/dist/index-DXXAEzZX.js +37 -0
- package/dist/index-DXXAEzZX.js.map +1 -0
- package/dist/index.js +3 -123928
- package/dist/index.js.map +1 -1
- package/dist/main.react-EZCAUint.js +82794 -0
- package/dist/main.react-EZCAUint.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { c as n, d as _, J as v, P as g } from "./main.react-EZCAUint.js";
|
|
3
|
+
import { useState as a } from "react";
|
|
4
|
+
const S = ({ data: s, completed: r, onSubmitAnswer: d }) => {
|
|
5
|
+
const [l, m] = a(r), [t, o] = a(), h = (e) => {
|
|
6
|
+
l || o(e);
|
|
7
|
+
}, b = () => {
|
|
8
|
+
t && (d({
|
|
9
|
+
...s,
|
|
10
|
+
options: s.options.map((e) => ({ ...e, selected: e.id === t.id })),
|
|
11
|
+
selected_id: t.id
|
|
12
|
+
}, t.title), m(!0));
|
|
13
|
+
};
|
|
14
|
+
return c("div", { className: "myinterview-chatbot-single-select", children: [i("div", { className: n("myinterview-chatbot-single-select__list", { "myinterview-chatbot-single-select__list--disabled": l }), children: s.options.map((e) => c("div", { className: "myinterview-chatbot-single-select__item", onClick: () => h(e), role: "presentation", children: [i("div", { className: n("myinterview-chatbot-single-select__checkmark", { "myinterview-chatbot-single-select__checkmark--selected": e.id === (t == null ? void 0 : t.id) }), children: i(_, {}) }), i(v, { className: "myinterview-chatbot-single-select__title", children: e.title })] }, e.id)) }), i(g, { size: "small", onClick: b, disabled: l || !t, children: s.buttonText || "Submit" })] });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
S as default
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=index-BKaveF39.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BKaveF39.js","sources":["../src/components/modules/SingleSelect/index.tsx"],"sourcesContent":["import { Button, Check, Text } from '@myinterview/component-library';\nimport { useState } from 'react';\nimport classNames from 'classnames';\nimport { MessageModuleProps } from '../../../interfaces/modules';\nimport { ModuleType } from '../../../interfaces/modules/generic';\n\nconst SingleSelect = ({ data, completed, onSubmitAnswer }: MessageModuleProps<ModuleType.SINGLE_SELECT>) => {\n const [isDisabled, setIsDisabled] = useState<boolean>(completed);\n const [selectedOption, setSelectedOption] = useState<typeof data['options'][number] | null>();\n\n const handleChange = (option: typeof data['options'][number]) => {\n if (isDisabled) return;\n setSelectedOption(option);\n };\n\n const handleSubmit = () => {\n if (!selectedOption) return;\n onSubmitAnswer(\n {\n ...data,\n options: data.options.map((option) => ({ ...option, selected: option.id === selectedOption.id })),\n selected_id: selectedOption.id,\n },\n selectedOption.title,\n );\n setIsDisabled(true);\n };\n\n return (\n <div className=\"myinterview-chatbot-single-select\">\n <div className={classNames('myinterview-chatbot-single-select__list', { 'myinterview-chatbot-single-select__list--disabled': isDisabled })}>\n {data.options.map((option) => (\n <div\n key={option.id}\n className=\"myinterview-chatbot-single-select__item\"\n onClick={() => handleChange(option)}\n role=\"presentation\"\n >\n <div className={classNames('myinterview-chatbot-single-select__checkmark', { 'myinterview-chatbot-single-select__checkmark--selected': option.id === selectedOption?.id })}>\n <Check />\n </div>\n <Text className=\"myinterview-chatbot-single-select__title\">{option.title}</Text>\n </div>\n ))}\n </div>\n\n <Button\n size=\"small\"\n onClick={handleSubmit}\n disabled={isDisabled || !selectedOption}\n >\n {data.buttonText || 'Submit'}\n </Button>\n </div>\n );\n};\n\nexport default SingleSelect;\n"],"names":["SingleSelect","data","completed","onSubmitAnswer","isDisabled","setIsDisabled","useState","selectedOption","setSelectedOption","handleChange","option","handleSubmit","_jsxs","_jsx","classNames","Check","Text","Button"],"mappings":";;;AAMA,MAAMA,IAAe,CAAC,EAAE,MAAAC,GAAM,WAAAC,GAAW,gBAAAC,QAAkE;AACzG,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAkBJ,CAAS,GACzD,CAACK,GAAgBC,CAAiB,IAAIF,EAAA,GAEtCG,IAAe,CAACC,MAA0C;AAC9D,IAAIN,KACJI,EAAkBE,CAAM;AAAA,EAC1B,GAEMC,IAAe,MAAK;AACxB,IAAKJ,MACLJ,EACE;AAAA,MACE,GAAGF;AAAA,MACH,SAASA,EAAK,QAAQ,IAAI,CAACS,OAAY,EAAE,GAAGA,GAAQ,UAAUA,EAAO,OAAOH,EAAe,KAAK;AAAA,MAChG,aAAaA,EAAe;AAAA,IAAA,GAE9BA,EAAe,KAAK,GAEtBF,EAAc,EAAI;AAAA,EACpB;AAEA,SACEO,EAAA,OAAA,EAAK,WAAU,qCAAmC,UAAA,CAChDC,EAAA,OAAA,EAAK,WAAWC,EAAW,2CAA2C,EAAE,qDAAqDV,EAAA,CAAY,GAAC,UACvIH,EAAK,QAAQ,IAAI,CAACS,MACjBE,EAAA,OAAA,EAEE,WAAU,2CACV,SAAS,MAAMH,EAAaC,CAAM,GAClC,MAAK,gBAAc,UAAA,CAEnBG,EAAA,OAAA,EAAK,WAAWC,EAAW,gDAAgD,EAAE,0DAA0DJ,EAAO,QAAOH,KAAA,gBAAAA,EAAgB,IAAA,CAAI,GAAC,UACxKM,EAACE,GAAK,EAAA,GAAG,GAEXF,EAACG,GAAI,EAAC,WAAU,4CAA0C,UAAEN,EAAO,MAAA,CAAK,CAAQ,EAAA,GAR3EA,EAAO,EAAE,CAUjB,EAAA,CAAC,GAGJG,EAACI,GAAM,EACL,MAAK,SACL,SAASN,GACT,UAAUP,KAAc,CAACG,GAAc,UAEtCN,EAAK,cAAc,UAAQ,CACrB,GAAA;AAGf;"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as I, useState as u, useEffect as x } from "react";
|
|
3
|
+
import { a as C, u as A, b as k, i as q, c as D, M as E, S as V, P as j, C as T } from "./main.react-EZCAUint.js";
|
|
4
|
+
var a;
|
|
5
|
+
(function(e) {
|
|
6
|
+
e.IframeModule = "0", e.MobileModule = "1", e.RedirectionModule = "2", e.LiveMobileModule = "3";
|
|
7
|
+
})(a || (a = {}));
|
|
8
|
+
const m = {
|
|
9
|
+
[a.IframeModule]: "iframe",
|
|
10
|
+
[a.MobileModule]: "qrcode",
|
|
11
|
+
[a.RedirectionModule]: "url",
|
|
12
|
+
[a.LiveMobileModule]: "qrcode"
|
|
13
|
+
}, U = async (e, o, r, l) => C.post("/modules/idanalyzer/createVerificationSession", { type: e, documentType: o, video_id: l }, { headers: { authorization: r } }), O = async (e, o, r) => C.get(`/modules/idanalyzer?video_id=${r}`, { headers: { authorization: e }, timeout: 1e6, signal: o.signal }), H = ({ data: e, completed: o }) => {
|
|
14
|
+
var v;
|
|
15
|
+
const r = A((t) => t.chatbotConfig.auth), l = A((t) => t.main.selectedConversationId), c = I(new AbortController()), y = ((v = k.get(l)) == null ? void 0 : v.attributes).video_id, i = I(q ? a.IframeModule : a.LiveMobileModule), [s, _] = u(""), [R, f] = u(!1), [g, w] = u(!1), M = m[i.current] === "qrcode", h = () => {
|
|
16
|
+
c.current.abort(), f(!1);
|
|
17
|
+
}, z = () => {
|
|
18
|
+
c.current = new AbortController(), O(r, c.current, y).then(h).catch((t) => {
|
|
19
|
+
t.code !== "ERR_CANCELED" && z();
|
|
20
|
+
});
|
|
21
|
+
}, N = () => {
|
|
22
|
+
var p;
|
|
23
|
+
const t = (p = e.methods) == null ? void 0 : p.join("");
|
|
24
|
+
U(i.current, t, r, y).then((S) => {
|
|
25
|
+
_(S.data.data[m[i.current]]);
|
|
26
|
+
});
|
|
27
|
+
}, L = () => {
|
|
28
|
+
f(!0), z();
|
|
29
|
+
};
|
|
30
|
+
x(() => {
|
|
31
|
+
N();
|
|
32
|
+
}, []);
|
|
33
|
+
const b = D("myinterview-chatbot-id-analyzer", {
|
|
34
|
+
"myinterview-chatbot-id-analyzer--qr-code": M
|
|
35
|
+
});
|
|
36
|
+
return M ? d("div", { className: b, children: [n(E, { mediaUrl: s, title: "QR-Code", disableFetching: !0, onMediaReady: () => w(!0) }), !g && n(V, { transparent: !0 })] }) : d("div", { className: b, children: [n(j, { onClick: L, size: "small", disabled: !s || o, children: e.buttonText || "Verify ID" }), R && d("div", { className: "myinterview-chatbot-id-analyzer__iframe-container", children: [n(T, { classNames: "myinterview-chatbot-id-analyzer__close", onClick: h, size: 16 }), m[i.current] === "iframe" ? n("div", { className: "myinterview-chatbot-id-analyzer__iframe-wrapper", dangerouslySetInnerHTML: { __html: s } }) : n("iframe", { src: s, title: "ID Analyzer" })] })] });
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
H as default
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=index-BM74fau_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BM74fau_.js","sources":["../src/interfaces/modules/idAnalyzer.ts","../src/services/idAnalayzer.service.ts","../src/components/modules/IDAnalayzer/index.tsx"],"sourcesContent":["import { ChatModule, IDAnalayzerMethod, ModuleName, ModuleType } from './generic';\n\nexport enum DocuPassModuleType {\n IframeModule = '0',\n MobileModule = '1',\n RedirectionModule = '2',\n LiveMobileModule = '3',\n}\n\nexport const DocuPassModuleTypeResponse: { [k in DocuPassModuleType]: 'iframe' | 'qrcode' | 'url' } = {\n [DocuPassModuleType.IframeModule]: 'iframe',\n [DocuPassModuleType.MobileModule]: 'qrcode',\n [DocuPassModuleType.RedirectionModule]: 'url',\n [DocuPassModuleType.LiveMobileModule]: 'qrcode',\n} as const;\n\nexport type IDAnalayzerModule = ChatModule<ModuleName.ID_ANALYZER, ModuleType.ID_ANALYZER, IDAnalayzerMethod>;\n","import { DocuPassModuleType } from '../interfaces/modules/idAnalyzer';\nimport { axiosInstanceVius } from './axiosInstances.service';\n\nexport const createAnalyzer = async (docPassModuleType: DocuPassModuleType, verificationMethods: string, authorization: string, video_id: string) => axiosInstanceVius.post('/modules/idanalyzer/createVerificationSession', { type: docPassModuleType, documentType: verificationMethods, video_id }, { headers: { authorization } });\n\nexport const confirmAnalyzer = async (authorization: string, controller: AbortController, video_id: string) => axiosInstanceVius.get(`/modules/idanalyzer?video_id=${video_id}`, { headers: { authorization }, timeout: 1e6, signal: controller.signal });\n","import { useEffect, useRef, useState } from 'react';\nimport classNames from 'classnames';\nimport { Button } from '@myinterview/component-library';\n// import { createPortal } from 'react-dom';\nimport { MessageModuleProps } from '../../../interfaces/modules';\nimport { ModuleType } from '../../../interfaces/modules/generic';\nimport { DocuPassModuleType, DocuPassModuleTypeResponse } from '../../../interfaces/modules/idAnalyzer';\nimport { isMobile } from '../../../utils/device.utils';\nimport { useAppSelector } from '../../../store/hooks';\nimport { confirmAnalyzer, createAnalyzer } from '../../../services/idAnalayzer.service';\nimport { conversationsMap } from '../../../utils/sdkObject.utils';\nimport { ReduxConversationAttributes } from '../../../interfaces/mainInterface';\nimport MediaImage from '../../MediaImage';\nimport CloseButton from '../../common/CloseButton';\nimport Skeleton from '../../ui/Skeleton';\n\nconst IDAnalayzer = ({ data, completed }: MessageModuleProps<ModuleType.ID_ANALYZER>) => {\n const auth = useAppSelector((state) => state.chatbotConfig.auth);\n const selectedConversationId = useAppSelector((state) => state.main.selectedConversationId);\n const idAnalyzerController = useRef(new AbortController());\n const videoId = (conversationsMap.get(selectedConversationId)?.attributes as ReduxConversationAttributes).video_id;\n const docModuleType = useRef<DocuPassModuleType>(isMobile ? DocuPassModuleType.IframeModule : DocuPassModuleType.LiveMobileModule);\n const [idAnalyzerUrl, setIdAnalazyerUrl] = useState<string>('');\n const [isOpen, setIsOpen] = useState<boolean>(false);\n const [mediaLoaded, setIsMediaLoaded] = useState<boolean>(false);\n\n const isQRCode = DocuPassModuleTypeResponse[docModuleType.current] === 'qrcode';\n\n const clearIdAnalyzer = () => {\n idAnalyzerController.current.abort();\n setIsOpen(false);\n };\n\n const checkAnalyzerValidation = () => {\n idAnalyzerController.current = new AbortController();\n confirmAnalyzer(auth, idAnalyzerController.current, videoId)\n .then(clearIdAnalyzer)\n .catch((e) => {\n if (e.code !== 'ERR_CANCELED') {\n checkAnalyzerValidation();\n }\n });\n };\n\n const setAnalyzer = () => {\n const verificationMethods = data.methods?.join('');\n createAnalyzer(docModuleType.current, verificationMethods, auth, videoId).then((res) => {\n setIdAnalazyerUrl(res.data.data[DocuPassModuleTypeResponse[docModuleType.current]]);\n });\n };\n\n const openIDAnalayzer = () => {\n setIsOpen(true);\n checkAnalyzerValidation();\n };\n\n useEffect(() => {\n setAnalyzer();\n }, []);\n\n const idAnalayzerClassNames = classNames('myinterview-chatbot-id-analyzer', {\n 'myinterview-chatbot-id-analyzer--qr-code': isQRCode,\n });\n\n if (isQRCode) {\n return (\n <div className={idAnalayzerClassNames}>\n <MediaImage mediaUrl={idAnalyzerUrl} title=\"QR-Code\" disableFetching onMediaReady={() => setIsMediaLoaded(true)} />\n {!mediaLoaded && <Skeleton transparent />}\n </div>\n );\n }\n\n return (\n <div className={idAnalayzerClassNames}>\n <Button onClick={openIDAnalayzer} size=\"small\" disabled={!idAnalyzerUrl || completed}>{data.buttonText || 'Verify ID'}</Button>\n {isOpen\n && (\n <div className=\"myinterview-chatbot-id-analyzer__iframe-container\">\n <CloseButton classNames=\"myinterview-chatbot-id-analyzer__close\" onClick={clearIdAnalyzer} size={16} />\n\n {DocuPassModuleTypeResponse[docModuleType.current] === 'iframe'\n ? <div className=\"myinterview-chatbot-id-analyzer__iframe-wrapper\" dangerouslySetInnerHTML={{ __html: idAnalyzerUrl }} />\n : <iframe src={idAnalyzerUrl} title=\"ID Analyzer\" />}\n </div>\n )}\n </div>\n );\n};\n\nexport default IDAnalayzer;\n"],"names":["DocuPassModuleType","DocuPassModuleTypeResponse","createAnalyzer","docPassModuleType","verificationMethods","authorization","video_id","axiosInstanceVius","confirmAnalyzer","controller","IDAnalayzer","data","completed","auth","useAppSelector","state","selectedConversationId","idAnalyzerController","useRef","videoId","_a","conversationsMap","docModuleType","isMobile","idAnalyzerUrl","setIdAnalazyerUrl","useState","isOpen","setIsOpen","mediaLoaded","setIsMediaLoaded","isQRCode","clearIdAnalyzer","checkAnalyzerValidation","e","setAnalyzer","res","openIDAnalayzer","useEffect","idAnalayzerClassNames","classNames","_jsxs","_jsx","MediaImage","Skeleton","Button","CloseButton"],"mappings":"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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { P as r } from "./main.react-EZCAUint.js";
|
|
3
|
+
import { useState as h } from "react";
|
|
4
|
+
const p = ({ data: i, completed: c, onSubmitAnswer: a }) => {
|
|
5
|
+
const [d, m] = h(c), n = (e) => {
|
|
6
|
+
const { id: t, title: o } = e;
|
|
7
|
+
a({
|
|
8
|
+
...i,
|
|
9
|
+
options: i.options.map((l) => ({ ...l, selected: l.id === t })),
|
|
10
|
+
selected_id: t
|
|
11
|
+
}, o), m(!0);
|
|
12
|
+
};
|
|
13
|
+
return s("div", { className: "myinterview-chatbot-yes-no", children: s("div", { className: "myinterview-chatbot-yes-no__list", children: i.options.map((e) => s(r, { size: "small", className: "myinterview-chatbot-yes-no__item", onClick: () => n(e), value: e.id, disabled: d, children: e.title }, e.id)) }) });
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
p as default
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=index-B_3V2SsA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-B_3V2SsA.js","sources":["../src/components/modules/YesNo/index.tsx"],"sourcesContent":["import { Button } from '@myinterview/component-library';\nimport { useState } from 'react';\nimport { MessageModuleProps } from '../../../interfaces/modules';\nimport { ModuleType } from '../../../interfaces/modules/generic';\n\nconst SingleSelect = ({ data, completed, onSubmitAnswer }: MessageModuleProps<ModuleType.YES_NO>) => { // TODO: Disable buttons after seleted / completed: true\n const [isDisabled, setIsDisabled] = useState<boolean>(completed);\n\n const handleClick = (selectedOption: typeof data.options[number]) => {\n const { id, title } = selectedOption;\n onSubmitAnswer({\n ...data,\n options: data.options.map((option) => ({ ...option, selected: option.id === id })),\n selected_id: id,\n }, title);\n setIsDisabled(true);\n };\n\n return (\n <div className=\"myinterview-chatbot-yes-no\">\n <div className=\"myinterview-chatbot-yes-no__list\">\n {data.options.map((option) => (\n <Button\n key={option.id}\n size=\"small\"\n className=\"myinterview-chatbot-yes-no__item\"\n onClick={() => handleClick(option)}\n value={option.id}\n disabled={isDisabled}\n >\n {option.title}\n </Button>\n ))}\n </div>\n </div>\n );\n};\n\nexport default SingleSelect;\n"],"names":["SingleSelect","data","completed","onSubmitAnswer","isDisabled","setIsDisabled","useState","handleClick","selectedOption","id","title","option","_jsx","Button"],"mappings":";;;AAKA,MAAMA,IAAe,CAAC,EAAE,MAAAC,GAAM,WAAAC,GAAW,gBAAAC,QAA2D;AAClG,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAkBJ,CAAS,GAEzDK,IAAc,CAACC,MAA+C;AAClE,UAAM,EAAE,IAAAC,GAAI,OAAAC,EAAA,IAAUF;AACtB,IAAAL,EAAe;AAAA,MACb,GAAGF;AAAA,MACH,SAASA,EAAK,QAAQ,IAAI,CAACU,OAAY,EAAE,GAAGA,GAAQ,UAAUA,EAAO,OAAOF,IAAK;AAAA,MACjF,aAAaA;AAAA,IAAA,GACZC,CAAK,GACRL,EAAc,EAAI;AAAA,EACpB;AAEA,SACEO,EAAA,OAAA,EAAK,WAAU,8BAA4B,UACzCA,EAAA,OAAA,EAAK,WAAU,oCAAkC,UAC9CX,EAAK,QAAQ,IAAI,CAACU,MACjBC,EAACC,GAAM,EAEL,MAAK,SACL,WAAU,oCACV,SAAS,MAAMN,EAAYI,CAAM,GACjC,OAAOA,EAAO,IACd,UAAUP,GAAU,UAEnBO,EAAO,MAAA,GAPHA,EAAO,EAAE,CASjB,EAAA,CAAC,GACE;AAGZ;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { P as l } from "./main.react-EZCAUint.js";
|
|
3
|
+
const s = ({ data: i, completed: o, customAction: c }) => {
|
|
4
|
+
var e;
|
|
5
|
+
return t("div", { className: "myinterview-chatbot-tnc-module", children: t(l, { size: "small", onClick: c, disabled: o, children: ((e = i.buttonText) == null ? void 0 : e.cta) ?? "Review Terms" }) });
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
s as default
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index-BkKh_B9_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BkKh_B9_.js","sources":["../src/components/modules/Tnc/index.tsx"],"sourcesContent":["import { Button } from '@myinterview/component-library';\nimport { MessageModuleProps } from '../../../interfaces/modules';\nimport { ModuleType } from '../../../interfaces/modules/generic';\n\nconst Tnc = ({ data, completed, customAction }: MessageModuleProps<ModuleType.TNC>) => (\n <div className=\"myinterview-chatbot-tnc-module\">\n <Button\n size=\"small\"\n onClick={customAction}\n disabled={completed}\n >\n {data.buttonText?.cta ?? 'Review Terms'}\n </Button>\n </div>\n);\n\nexport default Tnc;\n"],"names":["Tnc","data","completed","customAction","_jsx","Button","_a"],"mappings":";;AAIA,MAAMA,IAAM,CAAC,EAAE,MAAAC,GAAM,WAAAC,GAAW,cAAAC,EAAA,MAAY;;AAC1CC,SAAAA,EAAA,OAAA,EAAK,WAAU,kCAAgC,UAC7CA,EAACC,GAAM,EACL,MAAK,SACL,SAASF,GACT,UAAUD,GAAS,YAElBI,IAAAL,EAAK,eAAL,gBAAAK,EAAiB,QAAO,eAAA,CAAc,GAChC;AAAA;"}
|