@bigbinary/neeto-integrations-frontend 4.0.24 → 4.0.25

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.
Files changed (71) hide show
  1. package/dist/.ready +1 -1
  2. package/dist/Form-Bm37EVs6.js +189 -0
  3. package/dist/Form-Bm37EVs6.js.map +1 -0
  4. package/dist/Form-DbbEVp56.js +166 -0
  5. package/dist/Form-DbbEVp56.js.map +1 -0
  6. package/dist/cjs/v2/Connect.js +86 -0
  7. package/dist/cjs/v2/Connect.js.map +1 -0
  8. package/dist/cjs/v2/Daily.js +144 -0
  9. package/dist/cjs/v2/Daily.js.map +1 -0
  10. package/dist/cjs/v2/DailyForm.js +29 -0
  11. package/dist/cjs/v2/DailyForm.js.map +1 -0
  12. package/dist/cjs/v2/Demo.js +76 -0
  13. package/dist/cjs/v2/Demo.js.map +1 -0
  14. package/dist/cjs/v2/DisconnectAlert.js +40 -0
  15. package/dist/cjs/v2/DisconnectAlert.js.map +1 -0
  16. package/dist/cjs/v2/DisconnectedIntegrationsRibbon.js +109 -0
  17. package/dist/cjs/v2/DisconnectedIntegrationsRibbon.js.map +1 -0
  18. package/dist/cjs/v2/Finish.js +96 -0
  19. package/dist/cjs/v2/Finish.js.map +1 -0
  20. package/dist/cjs/v2/GoogleCalendar.js +112 -0
  21. package/dist/cjs/v2/GoogleCalendar.js.map +1 -0
  22. package/dist/cjs/v2/Manage.js +170 -0
  23. package/dist/cjs/v2/Manage.js.map +1 -0
  24. package/dist/cjs/v2/Modal.js +87 -0
  25. package/dist/cjs/v2/Modal.js.map +1 -0
  26. package/dist/cjs/v2/Telnyx.js +237 -0
  27. package/dist/cjs/v2/Telnyx.js.map +1 -0
  28. package/dist/cjs/v2/Twilio.js +309 -0
  29. package/dist/cjs/v2/Twilio.js.map +1 -0
  30. package/dist/cjs/v2/WalkthroughModal.js +51 -0
  31. package/dist/cjs/v2/WalkthroughModal.js.map +1 -0
  32. package/dist/cjs/v2/ZapierForm.js +316 -0
  33. package/dist/cjs/v2/ZapierForm.js.map +1 -0
  34. package/dist/cjs/v2/Zoom.js +125 -0
  35. package/dist/cjs/v2/Zoom.js.map +1 -0
  36. package/dist/query-BADHOzBP.js +21 -0
  37. package/dist/query-BADHOzBP.js.map +1 -0
  38. package/dist/query-BijkeV_r.js +31 -0
  39. package/dist/query-BijkeV_r.js.map +1 -0
  40. package/dist/v2/Connect.js +84 -0
  41. package/dist/v2/Connect.js.map +1 -0
  42. package/dist/v2/Daily.js +142 -0
  43. package/dist/v2/Daily.js.map +1 -0
  44. package/dist/v2/DailyForm.js +23 -0
  45. package/dist/v2/DailyForm.js.map +1 -0
  46. package/dist/v2/Demo.js +74 -0
  47. package/dist/v2/Demo.js.map +1 -0
  48. package/dist/v2/DisconnectAlert.js +38 -0
  49. package/dist/v2/DisconnectAlert.js.map +1 -0
  50. package/dist/v2/DisconnectedIntegrationsRibbon.js +107 -0
  51. package/dist/v2/DisconnectedIntegrationsRibbon.js.map +1 -0
  52. package/dist/v2/Finish.js +75 -0
  53. package/dist/v2/Finish.js.map +1 -0
  54. package/dist/v2/GoogleCalendar.js +110 -0
  55. package/dist/v2/GoogleCalendar.js.map +1 -0
  56. package/dist/v2/Manage.js +168 -0
  57. package/dist/v2/Manage.js.map +1 -0
  58. package/dist/v2/Modal.js +85 -0
  59. package/dist/v2/Modal.js.map +1 -0
  60. package/dist/v2/Telnyx.js +216 -0
  61. package/dist/v2/Telnyx.js.map +1 -0
  62. package/dist/v2/Twilio.js +288 -0
  63. package/dist/v2/Twilio.js.map +1 -0
  64. package/dist/v2/WalkthroughModal.js +49 -0
  65. package/dist/v2/WalkthroughModal.js.map +1 -0
  66. package/dist/v2/ZapierForm.js +295 -0
  67. package/dist/v2/ZapierForm.js.map +1 -0
  68. package/dist/v2/Zoom.js +123 -0
  69. package/dist/v2/Zoom.js.map +1 -0
  70. package/package.json +19 -9
  71. package/typeTemplates-v2/index.d.ts +180 -0
package/dist/.ready CHANGED
@@ -1 +1 @@
1
- Built at 2026-04-02T05:03:26.533Z
1
+ Built at 2026-04-15T10:12:55.866Z
@@ -0,0 +1,189 @@
1
+ 'use strict';
2
+
3
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
4
+ var React = require('react');
5
+ var neetoAtoms = require('@bigbinary/neeto-atoms');
6
+ var formik = require('@bigbinary/neeto-atoms/formik');
7
+ var i18next = require('i18next');
8
+ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
9
+ var CardLayout = require('@bigbinary/neeto-molecules/v2/CardLayout');
10
+ var Container = require('@bigbinary/neeto-molecules/v2/Container');
11
+ var Header = require('@bigbinary/neeto-molecules/v2/Header');
12
+ var reactI18next = require('react-i18next');
13
+ var reactRouterDom = require('react-router-dom');
14
+ var yup = require('yup');
15
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
16
+ var reactQuery = require('@tanstack/react-query');
17
+ var constants = require('@bigbinary/neeto-commons-frontend/constants');
18
+ var axios = require('axios');
19
+ var query = require('./query-BijkeV_r.js');
20
+ var v2_WalkthroughModal = require('./cjs/v2/WalkthroughModal.js');
21
+ var jsxRuntime = require('react/jsx-runtime');
22
+
23
+ function _interopNamespaceDefault(e) {
24
+ var n = Object.create(null);
25
+ if (e) {
26
+ Object.keys(e).forEach(function (k) {
27
+ if (k !== 'default') {
28
+ var d = Object.getOwnPropertyDescriptor(e, k);
29
+ Object.defineProperty(n, k, d.get ? d : {
30
+ enumerable: true,
31
+ get: function () { return e[k]; }
32
+ });
33
+ }
34
+ });
35
+ }
36
+ n.default = e;
37
+ return Object.freeze(n);
38
+ }
39
+
40
+ var yup__namespace = /*#__PURE__*/_interopNamespaceDefault(yup);
41
+
42
+ var MANAGE_DAILY_CO_FORM_INITIAL_VALUES = {
43
+ apiKey: ""
44
+ };
45
+ var DAILY_CO_VALIDATION_SCHEMA = yup__namespace.object().shape({
46
+ apiKey: yup__namespace.string().trim().required(i18next.t("neetoIntegrations.errors.required", {
47
+ entity: i18next.t("neetoIntegrations.daily.apiKey")
48
+ }))
49
+ });
50
+
51
+ // eslint-disable-next-line @bigbinary/neeto/no-axios-import-outside-apis
52
+ var create = function create(payload) {
53
+ return axios.post(query.INTEGRATIONS_ENGINE_DAILY_URL, {
54
+ daily: payload
55
+ });
56
+ };
57
+ var show = function show() {
58
+ return axios.get(query.INTEGRATIONS_ENGINE_DAILY_URL);
59
+ };
60
+ var destroy = function destroy() {
61
+ return axios["delete"](query.INTEGRATIONS_ENGINE_DAILY_URL);
62
+ };
63
+ var dailiesApi = {
64
+ create: create,
65
+ show: show,
66
+ destroy: destroy
67
+ };
68
+
69
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
70
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
71
+ var useCreateDaily = function useCreateDaily() {
72
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
73
+ return reactUtils.useMutationWithInvalidation(dailiesApi.create, _objectSpread({
74
+ keysToInvalidate: [[query.QUERY_KEYS.DAILY_CO_DETAILS]]
75
+ }, options));
76
+ };
77
+ var useFetchDaily = function useFetchDaily() {
78
+ return reactQuery.useQuery({
79
+ queryKey: [query.QUERY_KEYS.DAILY_CO_DETAILS],
80
+ queryFn: dailiesApi.show,
81
+ staleTime: constants.DEFAULT_STALE_TIME
82
+ });
83
+ };
84
+ var useDestroyDaily = function useDestroyDaily(_ref) {
85
+ var onSuccess = _ref.onSuccess;
86
+ return reactUtils.useMutationWithInvalidation(dailiesApi.destroy, {
87
+ keysToInvalidate: [[query.QUERY_KEYS.DAILY_CO_DETAILS]],
88
+ onSuccess: onSuccess
89
+ });
90
+ };
91
+
92
+ var Form$1 = function Form(_ref) {
93
+ var helpDocUrl = _ref.helpDocUrl,
94
+ videoUrl = _ref.videoUrl,
95
+ onConnect = _ref.onConnect,
96
+ breadcrumbs = _ref.breadcrumbs;
97
+ var _useTranslation = reactI18next.useTranslation(),
98
+ t = _useTranslation.t;
99
+ var history = reactRouterDom.useHistory();
100
+ var _useState = React.useState(false),
101
+ _useState2 = _slicedToArray(_useState, 2),
102
+ isDemoModalOpen = _useState2[0],
103
+ setIsDemoModalOpen = _useState2[1];
104
+ var _useCreateDaily = useCreateDaily({
105
+ onSuccess: function onSuccess() {
106
+ return onConnect === null || onConnect === void 0 ? void 0 : onConnect();
107
+ }
108
+ }),
109
+ createDaily = _useCreateDaily.mutate,
110
+ isConnecting = _useCreateDaily.isPending;
111
+ var handleSubmit = function handleSubmit(payload) {
112
+ return createDaily(payload);
113
+ };
114
+ if (isConnecting) {
115
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
116
+ className: "flex h-full w-full items-center justify-center",
117
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Spinner, {})
118
+ });
119
+ }
120
+ return /*#__PURE__*/jsxRuntime.jsxs(Container, {
121
+ isHeaderFixed: true,
122
+ children: [/*#__PURE__*/jsxRuntime.jsx(Header, {
123
+ breadcrumbs: breadcrumbs,
124
+ title: t("neetoIntegrations.daily.connect.title"),
125
+ titleHelpPopoverProps: {
126
+ title: t("neetoIntegrations.daily.connect.title"),
127
+ description: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
128
+ lineClamp: "none",
129
+ variant: "body2",
130
+ children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
131
+ i18nKey: "neetoIntegrations.daily.helpDoc",
132
+ components: {
133
+ videoLink: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
134
+ variant: "link",
135
+ onClick: function onClick() {
136
+ return setIsDemoModalOpen(true);
137
+ }
138
+ })
139
+ }
140
+ })
141
+ }),
142
+ helpLinkProps: {
143
+ href: helpDocUrl,
144
+ "data-testid": "api-key-help-doc-link"
145
+ }
146
+ }
147
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
148
+ className: "w-full",
149
+ children: [/*#__PURE__*/jsxRuntime.jsx(formik.Form, {
150
+ formikProps: {
151
+ initialValues: MANAGE_DAILY_CO_FORM_INITIAL_VALUES,
152
+ validationSchema: DAILY_CO_VALIDATION_SCHEMA,
153
+ onSubmit: handleSubmit
154
+ },
155
+ children: /*#__PURE__*/jsxRuntime.jsx(CardLayout, {
156
+ actionBlock: /*#__PURE__*/jsxRuntime.jsx(formik.ActionBlock, {
157
+ cancelButtonProps: {
158
+ onClick: function onClick() {
159
+ return history.goBack();
160
+ }
161
+ },
162
+ isSubmitting: isConnecting,
163
+ submitButtonProps: {
164
+ label: t("neetoIntegrations.common.connect")
165
+ }
166
+ }),
167
+ children: /*#__PURE__*/jsxRuntime.jsx(formik.Input, {
168
+ autoFocus: true,
169
+ required: true,
170
+ label: t("neetoIntegrations.daily.apiKey"),
171
+ name: "apiKey"
172
+ })
173
+ })
174
+ }), /*#__PURE__*/jsxRuntime.jsx(v2_WalkthroughModal, {
175
+ videoUrl: videoUrl,
176
+ isOpen: isDemoModalOpen,
177
+ onClose: function onClose() {
178
+ return setIsDemoModalOpen(false);
179
+ }
180
+ })]
181
+ })]
182
+ });
183
+ };
184
+ var Form = reactUtils.withTitle(Form$1, i18next.t("neetoIntegrations.browserTitles.integrations.dailyco"));
185
+
186
+ exports.Form = Form;
187
+ exports.useDestroyDaily = useDestroyDaily;
188
+ exports.useFetchDaily = useFetchDaily;
189
+ //# sourceMappingURL=Form-Bm37EVs6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Form-Bm37EVs6.js","sources":["../app/javascript/src/components/v2/Integrations/Daily/constants.js","../app/javascript/src/components/v2/apis/dailies.js","../app/javascript/src/components/v2/hooks/reactQuery/useDailiesApi.js","../app/javascript/src/components/v2/Integrations/Daily/Form.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const MANAGE_DAILY_CO_FORM_INITIAL_VALUES = { apiKey: \"\" };\n\nexport const DAILY_CO_VALIDATION_SCHEMA = yup.object().shape({\n apiKey: yup\n .string()\n .trim()\n .required(\n t(\"neetoIntegrations.errors.required\", {\n entity: t(\"neetoIntegrations.daily.apiKey\"),\n })\n ),\n});\n","// eslint-disable-next-line @bigbinary/neeto/no-axios-import-outside-apis\nimport axios from \"axios\";\n\nimport { INTEGRATIONS_ENGINE_DAILY_URL } from \"../constants/urls\";\n\nconst create = payload =>\n axios.post(INTEGRATIONS_ENGINE_DAILY_URL, { daily: payload });\n\nconst show = () => axios.get(INTEGRATIONS_ENGINE_DAILY_URL);\n\nconst destroy = () => axios.delete(INTEGRATIONS_ENGINE_DAILY_URL);\n\nconst dailiesApi = { create, show, destroy };\n\nexport default dailiesApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport dailiesApi from \"../../apis/dailies\";\nimport { QUERY_KEYS } from \"../../constants/query\";\n\nexport const useCreateDaily = (options = {}) =>\n useMutationWithInvalidation(dailiesApi.create, {\n keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]],\n ...options,\n });\n\nexport const useFetchDaily = () =>\n useQuery({\n queryKey: [QUERY_KEYS.DAILY_CO_DETAILS],\n queryFn: dailiesApi.show,\n staleTime: DEFAULT_STALE_TIME,\n });\n\nexport const useDestroyDaily = ({ onSuccess }) =>\n useMutationWithInvalidation(dailiesApi.destroy, {\n keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]],\n onSuccess,\n });\n","import { useState } from \"react\";\n\nimport { Button, Spinner, Typography } from \"@bigbinary/neeto-atoms\";\nimport {\n Input,\n Form as FormikForm,\n ActionBlock,\n} from \"@bigbinary/neeto-atoms/formik\";\nimport i18next from \"i18next\";\nimport { withTitle } from \"neetocommons/react-utils\";\nimport CardLayout from \"neetomolecules/v2/CardLayout\";\nimport Container from \"neetomolecules/v2/Container\";\nimport Header from \"neetomolecules/v2/Header\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n MANAGE_DAILY_CO_FORM_INITIAL_VALUES,\n DAILY_CO_VALIDATION_SCHEMA,\n} from \"./constants\";\n\nimport { useCreateDaily } from \"../../hooks/reactQuery/useDailiesApi\";\nimport WalkthroughModal from \"../../WalkthroughModal\";\n\nconst Form = ({ helpDocUrl, videoUrl, onConnect, breadcrumbs }) => {\n const { t } = useTranslation();\n const history = useHistory();\n\n const [isDemoModalOpen, setIsDemoModalOpen] = useState(false);\n\n const { mutate: createDaily, isPending: isConnecting } = useCreateDaily({\n onSuccess: () => onConnect?.(),\n });\n\n const handleSubmit = payload => createDaily(payload);\n\n if (isConnecting) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <Container isHeaderFixed>\n <Header\n {...{ breadcrumbs }}\n title={t(\"neetoIntegrations.daily.connect.title\")}\n titleHelpPopoverProps={{\n title: t(\"neetoIntegrations.daily.connect.title\"),\n description: (\n <Typography lineClamp=\"none\" variant=\"body2\">\n <Trans\n i18nKey=\"neetoIntegrations.daily.helpDoc\"\n components={{\n videoLink: (\n <Button\n variant=\"link\"\n onClick={() => setIsDemoModalOpen(true)}\n />\n ),\n }}\n />\n </Typography>\n ),\n helpLinkProps: {\n href: helpDocUrl,\n \"data-testid\": \"api-key-help-doc-link\",\n },\n }}\n />\n <div className=\"w-full\">\n <FormikForm\n formikProps={{\n initialValues: MANAGE_DAILY_CO_FORM_INITIAL_VALUES,\n validationSchema: DAILY_CO_VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n <CardLayout\n actionBlock={\n <ActionBlock\n cancelButtonProps={{ onClick: () => history.goBack() }}\n isSubmitting={isConnecting}\n submitButtonProps={{\n label: t(\"neetoIntegrations.common.connect\"),\n }}\n />\n }\n >\n <Input\n autoFocus\n required\n label={t(\"neetoIntegrations.daily.apiKey\")}\n name=\"apiKey\"\n />\n </CardLayout>\n </FormikForm>\n <WalkthroughModal\n {...{ videoUrl }}\n isOpen={isDemoModalOpen}\n onClose={() => setIsDemoModalOpen(false)}\n />\n </div>\n </Container>\n );\n};\nexport default withTitle(\n Form,\n i18next.t(\"neetoIntegrations.browserTitles.integrations.dailyco\")\n);\n"],"names":["MANAGE_DAILY_CO_FORM_INITIAL_VALUES","apiKey","DAILY_CO_VALIDATION_SCHEMA","yup","object","shape","string","trim","required","t","entity","create","payload","axios","post","INTEGRATIONS_ENGINE_DAILY_URL","daily","show","get","destroy","dailiesApi","useCreateDaily","options","arguments","length","undefined","useMutationWithInvalidation","_objectSpread","keysToInvalidate","QUERY_KEYS","DAILY_CO_DETAILS","useFetchDaily","useQuery","queryKey","queryFn","staleTime","DEFAULT_STALE_TIME","useDestroyDaily","_ref","onSuccess","Form","helpDocUrl","videoUrl","onConnect","breadcrumbs","_useTranslation","useTranslation","history","useHistory","_useState","useState","_useState2","_slicedToArray","isDemoModalOpen","setIsDemoModalOpen","_useCreateDaily","createDaily","mutate","isConnecting","isPending","handleSubmit","_jsx","className","children","Spinner","_jsxs","Container","isHeaderFixed","Header","title","titleHelpPopoverProps","description","Typography","lineClamp","variant","Trans","i18nKey","components","videoLink","Button","onClick","helpLinkProps","href","FormikForm","formikProps","initialValues","validationSchema","onSubmit","CardLayout","actionBlock","ActionBlock","cancelButtonProps","goBack","isSubmitting","submitButtonProps","label","Input","autoFocus","name","WalkthroughModal","isOpen","onClose","withTitle","i18next"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,mCAAmC,GAAG;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,CAAC,CAAC,sDAAsD,CAClE,CAAC;;;;;;"}
@@ -0,0 +1,166 @@
1
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
+ import { useState } from 'react';
3
+ import { Spinner, Typography, Button } from '@bigbinary/neeto-atoms';
4
+ import { Form as Form$2, Input, ActionBlock } from '@bigbinary/neeto-atoms/formik';
5
+ import i18next, { t } from 'i18next';
6
+ import { useMutationWithInvalidation, withTitle } from '@bigbinary/neeto-commons-frontend/react-utils';
7
+ import CardLayout from '@bigbinary/neeto-molecules/v2/CardLayout';
8
+ import Container from '@bigbinary/neeto-molecules/v2/Container';
9
+ import Header from '@bigbinary/neeto-molecules/v2/Header';
10
+ import { useTranslation, Trans } from 'react-i18next';
11
+ import { useHistory } from 'react-router-dom';
12
+ import * as yup from 'yup';
13
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
14
+ import { useQuery } from '@tanstack/react-query';
15
+ import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
16
+ import axios from 'axios';
17
+ import { I as INTEGRATIONS_ENGINE_DAILY_URL, Q as QUERY_KEYS } from './query-BADHOzBP.js';
18
+ import WalkthroughModal from './v2/WalkthroughModal.js';
19
+ import { jsx, jsxs } from 'react/jsx-runtime';
20
+
21
+ var MANAGE_DAILY_CO_FORM_INITIAL_VALUES = {
22
+ apiKey: ""
23
+ };
24
+ var DAILY_CO_VALIDATION_SCHEMA = yup.object().shape({
25
+ apiKey: yup.string().trim().required(t("neetoIntegrations.errors.required", {
26
+ entity: t("neetoIntegrations.daily.apiKey")
27
+ }))
28
+ });
29
+
30
+ // eslint-disable-next-line @bigbinary/neeto/no-axios-import-outside-apis
31
+ var create = function create(payload) {
32
+ return axios.post(INTEGRATIONS_ENGINE_DAILY_URL, {
33
+ daily: payload
34
+ });
35
+ };
36
+ var show = function show() {
37
+ return axios.get(INTEGRATIONS_ENGINE_DAILY_URL);
38
+ };
39
+ var destroy = function destroy() {
40
+ return axios["delete"](INTEGRATIONS_ENGINE_DAILY_URL);
41
+ };
42
+ var dailiesApi = {
43
+ create: create,
44
+ show: show,
45
+ destroy: destroy
46
+ };
47
+
48
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
49
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
50
+ var useCreateDaily = function useCreateDaily() {
51
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
52
+ return useMutationWithInvalidation(dailiesApi.create, _objectSpread({
53
+ keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]]
54
+ }, options));
55
+ };
56
+ var useFetchDaily = function useFetchDaily() {
57
+ return useQuery({
58
+ queryKey: [QUERY_KEYS.DAILY_CO_DETAILS],
59
+ queryFn: dailiesApi.show,
60
+ staleTime: DEFAULT_STALE_TIME
61
+ });
62
+ };
63
+ var useDestroyDaily = function useDestroyDaily(_ref) {
64
+ var onSuccess = _ref.onSuccess;
65
+ return useMutationWithInvalidation(dailiesApi.destroy, {
66
+ keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]],
67
+ onSuccess: onSuccess
68
+ });
69
+ };
70
+
71
+ var Form = function Form(_ref) {
72
+ var helpDocUrl = _ref.helpDocUrl,
73
+ videoUrl = _ref.videoUrl,
74
+ onConnect = _ref.onConnect,
75
+ breadcrumbs = _ref.breadcrumbs;
76
+ var _useTranslation = useTranslation(),
77
+ t = _useTranslation.t;
78
+ var history = useHistory();
79
+ var _useState = useState(false),
80
+ _useState2 = _slicedToArray(_useState, 2),
81
+ isDemoModalOpen = _useState2[0],
82
+ setIsDemoModalOpen = _useState2[1];
83
+ var _useCreateDaily = useCreateDaily({
84
+ onSuccess: function onSuccess() {
85
+ return onConnect === null || onConnect === void 0 ? void 0 : onConnect();
86
+ }
87
+ }),
88
+ createDaily = _useCreateDaily.mutate,
89
+ isConnecting = _useCreateDaily.isPending;
90
+ var handleSubmit = function handleSubmit(payload) {
91
+ return createDaily(payload);
92
+ };
93
+ if (isConnecting) {
94
+ return /*#__PURE__*/jsx("div", {
95
+ className: "flex h-full w-full items-center justify-center",
96
+ children: /*#__PURE__*/jsx(Spinner, {})
97
+ });
98
+ }
99
+ return /*#__PURE__*/jsxs(Container, {
100
+ isHeaderFixed: true,
101
+ children: [/*#__PURE__*/jsx(Header, {
102
+ breadcrumbs: breadcrumbs,
103
+ title: t("neetoIntegrations.daily.connect.title"),
104
+ titleHelpPopoverProps: {
105
+ title: t("neetoIntegrations.daily.connect.title"),
106
+ description: /*#__PURE__*/jsx(Typography, {
107
+ lineClamp: "none",
108
+ variant: "body2",
109
+ children: /*#__PURE__*/jsx(Trans, {
110
+ i18nKey: "neetoIntegrations.daily.helpDoc",
111
+ components: {
112
+ videoLink: /*#__PURE__*/jsx(Button, {
113
+ variant: "link",
114
+ onClick: function onClick() {
115
+ return setIsDemoModalOpen(true);
116
+ }
117
+ })
118
+ }
119
+ })
120
+ }),
121
+ helpLinkProps: {
122
+ href: helpDocUrl,
123
+ "data-testid": "api-key-help-doc-link"
124
+ }
125
+ }
126
+ }), /*#__PURE__*/jsxs("div", {
127
+ className: "w-full",
128
+ children: [/*#__PURE__*/jsx(Form$2, {
129
+ formikProps: {
130
+ initialValues: MANAGE_DAILY_CO_FORM_INITIAL_VALUES,
131
+ validationSchema: DAILY_CO_VALIDATION_SCHEMA,
132
+ onSubmit: handleSubmit
133
+ },
134
+ children: /*#__PURE__*/jsx(CardLayout, {
135
+ actionBlock: /*#__PURE__*/jsx(ActionBlock, {
136
+ cancelButtonProps: {
137
+ onClick: function onClick() {
138
+ return history.goBack();
139
+ }
140
+ },
141
+ isSubmitting: isConnecting,
142
+ submitButtonProps: {
143
+ label: t("neetoIntegrations.common.connect")
144
+ }
145
+ }),
146
+ children: /*#__PURE__*/jsx(Input, {
147
+ autoFocus: true,
148
+ required: true,
149
+ label: t("neetoIntegrations.daily.apiKey"),
150
+ name: "apiKey"
151
+ })
152
+ })
153
+ }), /*#__PURE__*/jsx(WalkthroughModal, {
154
+ videoUrl: videoUrl,
155
+ isOpen: isDemoModalOpen,
156
+ onClose: function onClose() {
157
+ return setIsDemoModalOpen(false);
158
+ }
159
+ })]
160
+ })]
161
+ });
162
+ };
163
+ var Form$1 = withTitle(Form, i18next.t("neetoIntegrations.browserTitles.integrations.dailyco"));
164
+
165
+ export { Form$1 as F, useDestroyDaily as a, useFetchDaily as u };
166
+ //# sourceMappingURL=Form-DbbEVp56.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Form-DbbEVp56.js","sources":["../app/javascript/src/components/v2/Integrations/Daily/constants.js","../app/javascript/src/components/v2/apis/dailies.js","../app/javascript/src/components/v2/hooks/reactQuery/useDailiesApi.js","../app/javascript/src/components/v2/Integrations/Daily/Form.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const MANAGE_DAILY_CO_FORM_INITIAL_VALUES = { apiKey: \"\" };\n\nexport const DAILY_CO_VALIDATION_SCHEMA = yup.object().shape({\n apiKey: yup\n .string()\n .trim()\n .required(\n t(\"neetoIntegrations.errors.required\", {\n entity: t(\"neetoIntegrations.daily.apiKey\"),\n })\n ),\n});\n","// eslint-disable-next-line @bigbinary/neeto/no-axios-import-outside-apis\nimport axios from \"axios\";\n\nimport { INTEGRATIONS_ENGINE_DAILY_URL } from \"../constants/urls\";\n\nconst create = payload =>\n axios.post(INTEGRATIONS_ENGINE_DAILY_URL, { daily: payload });\n\nconst show = () => axios.get(INTEGRATIONS_ENGINE_DAILY_URL);\n\nconst destroy = () => axios.delete(INTEGRATIONS_ENGINE_DAILY_URL);\n\nconst dailiesApi = { create, show, destroy };\n\nexport default dailiesApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport dailiesApi from \"../../apis/dailies\";\nimport { QUERY_KEYS } from \"../../constants/query\";\n\nexport const useCreateDaily = (options = {}) =>\n useMutationWithInvalidation(dailiesApi.create, {\n keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]],\n ...options,\n });\n\nexport const useFetchDaily = () =>\n useQuery({\n queryKey: [QUERY_KEYS.DAILY_CO_DETAILS],\n queryFn: dailiesApi.show,\n staleTime: DEFAULT_STALE_TIME,\n });\n\nexport const useDestroyDaily = ({ onSuccess }) =>\n useMutationWithInvalidation(dailiesApi.destroy, {\n keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]],\n onSuccess,\n });\n","import { useState } from \"react\";\n\nimport { Button, Spinner, Typography } from \"@bigbinary/neeto-atoms\";\nimport {\n Input,\n Form as FormikForm,\n ActionBlock,\n} from \"@bigbinary/neeto-atoms/formik\";\nimport i18next from \"i18next\";\nimport { withTitle } from \"neetocommons/react-utils\";\nimport CardLayout from \"neetomolecules/v2/CardLayout\";\nimport Container from \"neetomolecules/v2/Container\";\nimport Header from \"neetomolecules/v2/Header\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n MANAGE_DAILY_CO_FORM_INITIAL_VALUES,\n DAILY_CO_VALIDATION_SCHEMA,\n} from \"./constants\";\n\nimport { useCreateDaily } from \"../../hooks/reactQuery/useDailiesApi\";\nimport WalkthroughModal from \"../../WalkthroughModal\";\n\nconst Form = ({ helpDocUrl, videoUrl, onConnect, breadcrumbs }) => {\n const { t } = useTranslation();\n const history = useHistory();\n\n const [isDemoModalOpen, setIsDemoModalOpen] = useState(false);\n\n const { mutate: createDaily, isPending: isConnecting } = useCreateDaily({\n onSuccess: () => onConnect?.(),\n });\n\n const handleSubmit = payload => createDaily(payload);\n\n if (isConnecting) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <Container isHeaderFixed>\n <Header\n {...{ breadcrumbs }}\n title={t(\"neetoIntegrations.daily.connect.title\")}\n titleHelpPopoverProps={{\n title: t(\"neetoIntegrations.daily.connect.title\"),\n description: (\n <Typography lineClamp=\"none\" variant=\"body2\">\n <Trans\n i18nKey=\"neetoIntegrations.daily.helpDoc\"\n components={{\n videoLink: (\n <Button\n variant=\"link\"\n onClick={() => setIsDemoModalOpen(true)}\n />\n ),\n }}\n />\n </Typography>\n ),\n helpLinkProps: {\n href: helpDocUrl,\n \"data-testid\": \"api-key-help-doc-link\",\n },\n }}\n />\n <div className=\"w-full\">\n <FormikForm\n formikProps={{\n initialValues: MANAGE_DAILY_CO_FORM_INITIAL_VALUES,\n validationSchema: DAILY_CO_VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n <CardLayout\n actionBlock={\n <ActionBlock\n cancelButtonProps={{ onClick: () => history.goBack() }}\n isSubmitting={isConnecting}\n submitButtonProps={{\n label: t(\"neetoIntegrations.common.connect\"),\n }}\n />\n }\n >\n <Input\n autoFocus\n required\n label={t(\"neetoIntegrations.daily.apiKey\")}\n name=\"apiKey\"\n />\n </CardLayout>\n </FormikForm>\n <WalkthroughModal\n {...{ videoUrl }}\n isOpen={isDemoModalOpen}\n onClose={() => setIsDemoModalOpen(false)}\n />\n </div>\n </Container>\n );\n};\nexport default withTitle(\n Form,\n i18next.t(\"neetoIntegrations.browserTitles.integrations.dailyco\")\n);\n"],"names":["MANAGE_DAILY_CO_FORM_INITIAL_VALUES","apiKey","DAILY_CO_VALIDATION_SCHEMA","yup","object","shape","string","trim","required","t","entity","create","payload","axios","post","INTEGRATIONS_ENGINE_DAILY_URL","daily","show","get","destroy","dailiesApi","useCreateDaily","options","arguments","length","undefined","useMutationWithInvalidation","_objectSpread","keysToInvalidate","QUERY_KEYS","DAILY_CO_DETAILS","useFetchDaily","useQuery","queryKey","queryFn","staleTime","DEFAULT_STALE_TIME","useDestroyDaily","_ref","onSuccess","Form","helpDocUrl","videoUrl","onConnect","breadcrumbs","_useTranslation","useTranslation","history","useHistory","_useState","useState","_useState2","_slicedToArray","isDemoModalOpen","setIsDemoModalOpen","_useCreateDaily","createDaily","mutate","isConnecting","isPending","handleSubmit","_jsx","className","children","Spinner","_jsxs","Container","isHeaderFixed","Header","title","titleHelpPopoverProps","description","Typography","lineClamp","variant","Trans","i18nKey","components","videoLink","Button","onClick","helpLinkProps","href","FormikForm","formikProps","initialValues","validationSchema","onSubmit","CardLayout","actionBlock","ActionBlock","cancelButtonProps","goBack","isSubmitting","submitButtonProps","label","Input","autoFocus","name","WalkthroughModal","isOpen","onClose","withTitle","i18next"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,mCAAmC,GAAG;AAAEC,EAAAA,MAAM,EAAE;AAAG,CAAC;AAE1D,IAAMC,0BAA0B,GAAGC,GAAG,CAACC,MAAM,EAAE,CAACC,KAAK,CAAC;AAC3DJ,EAAAA,MAAM,EAAEE,GAAG,CACRG,MAAM,EAAE,CACRC,IAAI,EAAE,CACNC,QAAQ,CACPC,CAAC,CAAC,mCAAmC,EAAE;IACrCC,MAAM,EAAED,CAAC,CAAC,gCAAgC;AAC5C,GAAC,CACH;AACJ,CAAC,CAAC;;ACdF;AAKA,IAAME,MAAM,GAAG,SAATA,MAAMA,CAAGC,OAAO,EAAA;AAAA,EAAA,OACpBC,KAAK,CAACC,IAAI,CAACC,6BAA6B,EAAE;AAAEC,IAAAA,KAAK,EAAEJ;AAAQ,GAAC,CAAC;AAAA,CAAA;AAE/D,IAAMK,IAAI,GAAG,SAAPA,IAAIA,GAAA;AAAA,EAAA,OAASJ,KAAK,CAACK,GAAG,CAACH,6BAA6B,CAAC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Aa;AAC3BoC,YAAAA,iBAAiB,EAAE;cACjBC,KAAK,EAAEtF,CAAC,CAAC,kCAAkC;AAC7C;AAAE,WACH,CACF;UAAAsD,QAAA,eAEDF,GAAA,CAACmC,KAAK,EAAA;YACJC,SAAS,EAAA,IAAA;YACTzF,QAAQ,EAAA,IAAA;AACRuF,YAAAA,KAAK,EAAEtF,CAAC,CAAC,gCAAgC,CAAE;AAC3CyF,YAAAA,IAAI,EAAC;WACN;SACS;AAAC,OACH,CAAC,eACbrC,GAAA,CAACsC,gBAAgB,EAAA;AACTzD,QAAAA,QAAQ,EAARA,QAAQ;AACd0D,QAAAA,MAAM,EAAE/C,eAAgB;QACxBgD,OAAO,EAAE,SAATA,OAAOA,GAAA;UAAA,OAAQ/C,kBAAkB,CAAC,KAAK,CAAC;AAAA,QAAA;AAAC,OAC1C,CAAC;AAAA,KACC,CAAC;AAAA,GACG,CAAC;AAEhB,CAAC;AACD,aAAegD,SAAS,CACtB9D,IAAI,EACJ+D,OAAO,CAAC9F,CAAC,CAAC,sDAAsD,CAClE,CAAC;;;;"}
@@ -0,0 +1,86 @@
1
+ 'use strict';
2
+
3
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
+ var neetoAtoms = require('@bigbinary/neeto-atoms');
5
+ var neetoCist = require('@bigbinary/neeto-cist');
6
+ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
7
+ var CardLayout = require('@bigbinary/neeto-molecules/v2/CardLayout');
8
+ var index = require('../../index-dxk7jTL7.js');
9
+ var reactI18next = require('react-i18next');
10
+ var jsxRuntime = require('react/jsx-runtime');
11
+
12
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
+ var Connect = reactUtils.withT(function (_ref) {
15
+ var t = _ref.t,
16
+ Icon = _ref.Icon,
17
+ _ref$title = _ref.title,
18
+ title = _ref$title === void 0 ? "" : _ref$title,
19
+ _ref$description = _ref.description,
20
+ description = _ref$description === void 0 ? "" : _ref$description,
21
+ _ref$integration = _ref.integration,
22
+ integration = _ref$integration === void 0 ? "" : _ref$integration,
23
+ _ref$integrationName = _ref.integrationName,
24
+ integrationName = _ref$integrationName === void 0 ? "" : _ref$integrationName,
25
+ _ref$helpDocUrl = _ref.helpDocUrl,
26
+ helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
27
+ _ref$buttonProps = _ref.buttonProps,
28
+ buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
29
+ _ref$onConnect = _ref.onConnect,
30
+ onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect,
31
+ children = _ref.children,
32
+ secondaryButtonProps = _ref.secondaryButtonProps;
33
+ return /*#__PURE__*/jsxRuntime.jsxs(CardLayout, {
34
+ actionBlock: /*#__PURE__*/jsxRuntime.jsxs("div", {
35
+ className: "flex w-full flex-wrap items-center gap-2",
36
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, _objectSpread({
37
+ label: t("neetoIntegrations.common.connect"),
38
+ onClick: onConnect
39
+ }, buttonProps)), secondaryButtonProps && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, _objectSpread({
40
+ variant: "secondary"
41
+ }, secondaryButtonProps))]
42
+ }),
43
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
44
+ className: "flex flex-col gap-y-2",
45
+ children: [/*#__PURE__*/jsxRuntime.jsx(Icon, {
46
+ size: 48
47
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
48
+ className: "flex flex-col gap-y-1",
49
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
50
+ variant: "h2",
51
+ children: title
52
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
53
+ variant: "body2",
54
+ children: description
55
+ })]
56
+ })]
57
+ }), helpDocUrl && /*#__PURE__*/jsxRuntime.jsx("div", {
58
+ className: "w-full",
59
+ children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
60
+ i18nKey: "neetoIntegrations.common.helpDocUrl",
61
+ components: {
62
+ helpLink: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
63
+ className: "text-xs",
64
+ href: helpDocUrl,
65
+ size: "sm",
66
+ target: "_blank",
67
+ variant: "link"
68
+ })
69
+ },
70
+ values: {
71
+ integration: integrationName || neetoCist.humanize(integration)
72
+ }
73
+ })
74
+ }), children]
75
+ });
76
+ });
77
+ Connect.prototypes = {
78
+ Icon: index.PropTypes.node,
79
+ title: index.PropTypes.string,
80
+ description: index.PropTypes.string,
81
+ buttonProps: index.PropTypes.object,
82
+ onConnect: index.PropTypes.func
83
+ };
84
+
85
+ module.exports = Connect;
86
+ //# sourceMappingURL=Connect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Connect.js","sources":["../../../app/javascript/src/components/v2/Steps/Connect.jsx"],"sourcesContent":["import { Typography, Button } from \"@bigbinary/neeto-atoms\";\nimport { humanize, noop } from \"neetocist\";\nimport { withT } from \"neetocommons/react-utils\";\nimport CardLayout from \"neetomolecules/v2/CardLayout\";\nimport PropTypes from \"prop-types\";\nimport { Trans } from \"react-i18next\";\n\nconst Connect = withT(\n ({\n t,\n Icon,\n title = \"\",\n description = \"\",\n integration = \"\",\n integrationName = \"\",\n helpDocUrl = \"\",\n buttonProps = {},\n onConnect = noop,\n children,\n secondaryButtonProps,\n }) => (\n <CardLayout\n actionBlock={\n <div className=\"flex w-full flex-wrap items-center gap-2\">\n <Button\n label={t(\"neetoIntegrations.common.connect\")}\n onClick={onConnect}\n {...buttonProps}\n />\n {secondaryButtonProps && (\n <Button variant=\"secondary\" {...secondaryButtonProps} />\n )}\n </div>\n }\n >\n <div className=\"flex flex-col gap-y-2\">\n <Icon size={48} />\n <div className=\"flex flex-col gap-y-1\">\n <Typography variant=\"h2\">{title}</Typography>\n <Typography variant=\"body2\">{description}</Typography>\n </div>\n </div>\n {helpDocUrl && (\n <div className=\"w-full\">\n <Trans\n i18nKey=\"neetoIntegrations.common.helpDocUrl\"\n components={{\n helpLink: (\n <Button\n className=\"text-xs\"\n href={helpDocUrl}\n size=\"sm\"\n target=\"_blank\"\n variant=\"link\"\n />\n ),\n }}\n values={{\n integration: integrationName || humanize(integration),\n }}\n />\n </div>\n )}\n {children}\n </CardLayout>\n )\n);\n\nConnect.prototypes = {\n Icon: PropTypes.node,\n title: PropTypes.string,\n description: PropTypes.string,\n buttonProps: PropTypes.object,\n onConnect: PropTypes.func,\n};\n\nexport default Connect;\n"],"names":["Connect","withT","_ref","t","Icon","_ref$title","title","_ref$description","description","_ref$integration","integration","_ref$integrationName","integrationName","_ref$helpDocUrl","helpDocUrl","_ref$buttonProps","buttonProps","_ref$onConnect","onConnect","noop","children","secondaryButtonProps","_jsxs","CardLayout","actionBlock","className","_jsx","Button","_objectSpread","label","onClick","variant","size","Typography","Trans","i18nKey","components","helpLink","href","target","values","humanize","prototypes","PropTypes","node","string","object","func"],"mappings":";;;;;;;;;;;;;AAOA,IAAMA,OAAO,GAAGC,gBAAK,CACnB,UAAAC,IAAA,EAAA;AAAA,EAAA,IACEC,CAAC,GAAAD,IAAA,CAADC,CAAC;IACDC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAAC,UAAA,GAAAH,IAAA,CACJI,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,UAAA;IAAAE,gBAAA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ACG,MAAM;EAC7B5B,SAAS,EAAEyB,eAAS,CAACI;AACvB,CAAC;;;;"}
@@ -0,0 +1,144 @@
1
+ 'use strict';
2
+
3
+ var i18next = require('i18next');
4
+ var neetoCist = require('@bigbinary/neeto-cist');
5
+ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
6
+ var v2_DailyForm = require('../../Form-Bm37EVs6.js');
7
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
8
+ var React = require('react');
9
+ var neetoAtoms = require('@bigbinary/neeto-atoms');
10
+ var utils = require('@bigbinary/neeto-commons-frontend/utils');
11
+ var DailyIcon = require('@bigbinary/neeto-icons/misc/Daily');
12
+ var CopyToClipboardButton = require('@bigbinary/neeto-molecules/v2/CopyToClipboardButton');
13
+ var reactI18next = require('react-i18next');
14
+ var v2_Manage = require('./Manage.js');
15
+ var jsxRuntime = require('react/jsx-runtime');
16
+ require('@bigbinary/neeto-atoms/formik');
17
+ require('@bigbinary/neeto-molecules/v2/CardLayout');
18
+ require('@bigbinary/neeto-molecules/v2/Container');
19
+ require('@bigbinary/neeto-molecules/v2/Header');
20
+ require('react-router-dom');
21
+ require('yup');
22
+ require('@babel/runtime/helpers/defineProperty');
23
+ require('@tanstack/react-query');
24
+ require('@bigbinary/neeto-commons-frontend/constants');
25
+ require('axios');
26
+ require('../../query-BijkeV_r.js');
27
+ require('./WalkthroughModal.js');
28
+ require('@bigbinary/neeto-commons-frontend/react-utils/withT');
29
+ require('lucide-react');
30
+ require('./DisconnectAlert.js');
31
+ require('@babel/runtime/helpers/objectWithoutProperties');
32
+
33
+ var Manage = function Manage(_ref) {
34
+ var description = _ref.description,
35
+ onDisconnect = _ref.onDisconnect;
36
+ var _useState = React.useState(false),
37
+ _useState2 = _slicedToArray(_useState, 2),
38
+ isDisconnectAlertOpen = _useState2[0],
39
+ setIsDisconnectAlertOpen = _useState2[1];
40
+ var _useFetchDaily = v2_DailyForm.useFetchDaily(),
41
+ _useFetchDaily$data = _useFetchDaily.data,
42
+ _useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
43
+ _useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
44
+ metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$,
45
+ isFetching = _useFetchDaily.isFetching;
46
+ var _ref2 = metadata || {},
47
+ _ref2$apiKey = _ref2.apiKey,
48
+ apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
49
+ var _useTranslation = reactI18next.useTranslation(),
50
+ t = _useTranslation.t;
51
+ var _useDestroyDaily = v2_DailyForm.useDestroyDaily({
52
+ onSuccess: function onSuccess() {
53
+ setIsDisconnectAlertOpen(false);
54
+ onDisconnect === null || onDisconnect === void 0 || onDisconnect();
55
+ }
56
+ }),
57
+ destroyIntegration = _useDestroyDaily.mutate,
58
+ isDisconnecting = _useDestroyDaily.isPending;
59
+ var isConnected = neetoCist.isPresent(apiKey);
60
+ var handleDisconnect = function handleDisconnect() {
61
+ return destroyIntegration("daily");
62
+ };
63
+ if (isFetching || isDisconnecting) {
64
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
65
+ className: "flex h-full w-full items-center justify-center",
66
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Spinner, {})
67
+ });
68
+ }
69
+ return /*#__PURE__*/jsxRuntime.jsx(v2_Manage, {
70
+ isConnected: isConnected,
71
+ isDisconnectAlertOpen: isDisconnectAlertOpen,
72
+ isDisconnecting: isDisconnecting,
73
+ setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
74
+ Icon: DailyIcon,
75
+ connectPath: utils.buildUrl(window.location.pathname, {
76
+ connect: true
77
+ }),
78
+ integration: "daily",
79
+ description: isConnected ? /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
80
+ i18nKey: "neetoIntegrations.daily.yourApiKey",
81
+ values: {
82
+ apiKey: apiKey
83
+ },
84
+ components: {
85
+ wrapper: /*#__PURE__*/jsxRuntime.jsx("div", {
86
+ className: "neeto-ui-rounded-md mt-2 flex items-center justify-between gap-x-3 border border-border px-3 py-2"
87
+ }),
88
+ span: /*#__PURE__*/jsxRuntime.jsx("span", {
89
+ className: "break-all text-sm"
90
+ }),
91
+ copy: /*#__PURE__*/jsxRuntime.jsx(CopyToClipboardButton, {
92
+ className: "shrink-0 self-start",
93
+ style: "text",
94
+ value: apiKey
95
+ })
96
+ }
97
+ }) : description,
98
+ title: isConnected ? t("neetoIntegrations.daily.connected") : t("neetoIntegrations.daily.connect.account"),
99
+ onClose: function onClose() {
100
+ return setIsDisconnectAlertOpen(false);
101
+ },
102
+ onDisconnect: handleDisconnect
103
+ });
104
+ };
105
+
106
+ var Daily = function Daily(_ref) {
107
+ var _ref$isOnboarding = _ref.isOnboarding,
108
+ isOnboarding = _ref$isOnboarding === void 0 ? false : _ref$isOnboarding,
109
+ _ref$helpDocUrl = _ref.helpDocUrl,
110
+ helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
111
+ _ref$videoUrl = _ref.videoUrl,
112
+ videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
113
+ _ref$description = _ref.description,
114
+ description = _ref$description === void 0 ? "" : _ref$description,
115
+ _ref$onConnect = _ref.onConnect,
116
+ onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect,
117
+ _ref$onDisconnect = _ref.onDisconnect,
118
+ onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect;
119
+ var _useQueryParams = reactUtils.useQueryParams(),
120
+ connect = _useQueryParams.connect;
121
+ var _useFetchDaily = v2_DailyForm.useFetchDaily(),
122
+ _useFetchDaily$data = _useFetchDaily.data,
123
+ _useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
124
+ _useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
125
+ metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$;
126
+ var _ref2 = metadata || {},
127
+ _ref2$apiKey = _ref2.apiKey,
128
+ apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
129
+ if (neetoCist.isPresent(apiKey) && !isOnboarding || !connect) {
130
+ return /*#__PURE__*/jsxRuntime.jsx(Manage, {
131
+ description: description,
132
+ onDisconnect: onDisconnect
133
+ });
134
+ }
135
+ return /*#__PURE__*/jsxRuntime.jsx(v2_DailyForm.Form, {
136
+ helpDocUrl: helpDocUrl,
137
+ onConnect: onConnect,
138
+ videoUrl: videoUrl
139
+ });
140
+ };
141
+ var index = reactUtils.withTitle(Daily, i18next.t("neetoIntegrations.browserTitles.integrations.dailyco"));
142
+
143
+ module.exports = index;
144
+ //# sourceMappingURL=Daily.js.map