@airporting/integrations-app 0.4.187 → 0.4.189

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/mf/8305.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["8305"],{4184:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{q:()=>ConnectorBubble});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(4848);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(2773);var _tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(5200);var _src_utils_connectorLogoUrl_ts__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(4937);var react_i18next__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(6155);function ConnectorBubble({connector,rename}){const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_4__.useTranslation)();const{colorScheme}=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineColorScheme)();const bg="dark"===colorScheme?"white":"dark";const logoUrl=(0,_src_utils_connectorLogoUrl_ts__WEBPACK_IMPORTED_MODULE_3__.U)(connector.main_connectorlist);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Card,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Avatar,{src:logoUrl,size:64,radius:"md",bg:bg,color:"dark"===colorScheme?"black":"white",p:18}),rename?rename.editing?/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"xs",wrap:"nowrap",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{value:rename.draft,onChange:e=>rename.onDraftChange(e.currentTarget.value),autoFocus:true,onKeyDown:e=>{if("Enter"===e.key)rename.onSave();if("Escape"===e.key)rename.onCancel()},style:{flex:1}}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.ActionIcon,{onClick:rename.onSave,"aria-label":t("Sauvegarder"),loading:rename.isPending,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__.IconCheck,{size:16})}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.ActionIcon,{onClick:rename.onCancel,"aria-label":t("Annuler"),variant:"subtle",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__.IconX,{size:16})})]}):/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"xs",wrap:"nowrap",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{w:"fit-content",order:3,children:connector.name}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.ActionIcon,{onClick:rename.onStartEditing,"aria-label":t("Renommer"),variant:"subtle",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__.IconPencil,{size:16})})]}):/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{w:"fit-content",order:3,children:connector.name}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",size:"lg",lineClamp:3,children:connector.main_connectorlist.description_fr})]})})}},6699:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Qq:()=>HttpClient,cM:()=>ContentType,qx:()=>IntegrationsApi});var ContentType=/*#__PURE__*/function(ContentType){ContentType["Json"]="application/json";ContentType["JsonApi"]="application/vnd.api+json";ContentType["FormData"]="multipart/form-data";ContentType["UrlEncoded"]="application/x-www-form-urlencoded";ContentType["Text"]="text/plain";return ContentType}({});class HttpClient{baseUrl="";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...fetchParams)=>fetch(...fetchParams);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(apiConfig={}){Object.assign(this,apiConfig)}setSecurityData=data=>{this.securityData=data};encodeQueryParam(key,value){const encodedKey=encodeURIComponent(key);return`${encodedKey}=${encodeURIComponent("number"==typeof value?value:`${value}`)}`}addQueryParam(query,key){return this.encodeQueryParam(key,query[key])}addArrayQueryParam(query,key){const value=query[key];return value.map(v=>this.encodeQueryParam(key,v)).join("&")}toQueryString(rawQuery){const query=rawQuery||{};const keys=Object.keys(query).filter(key=>void 0!==query[key]);return keys.map(key=>Array.isArray(query[key])?this.addArrayQueryParam(query,key):this.addQueryParam(query,key)).join("&")}addQueryParams(rawQuery){const queryString=this.toQueryString(rawQuery);return queryString?`?${queryString}`:""}contentFormatters={["application/json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["application/vnd.api+json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["text/plain"]:input=>null!==input&&"string"!=typeof input?JSON.stringify(input):input,["multipart/form-data"]:input=>{if(input instanceof FormData)return input;return Object.keys(input||{}).reduce((formData,key)=>{const property=input[key];formData.append(key,property instanceof Blob?property:"object"==typeof property&&null!==property?JSON.stringify(property):`${property}`);return formData},new FormData)},["application/x-www-form-urlencoded"]:input=>this.toQueryString(input)};mergeRequestParams(params1,params2){return{...this.baseApiParams,...params1,...params2||{},headers:{...this.baseApiParams.headers||{},...params1.headers||{},...params2&&params2.headers||{}}}}createAbortSignal=cancelToken=>{if(this.abortControllers.has(cancelToken)){const abortController=this.abortControllers.get(cancelToken);if(abortController)return abortController.signal;return}const abortController=new AbortController;this.abortControllers.set(cancelToken,abortController);return abortController.signal};abortRequest=cancelToken=>{const abortController=this.abortControllers.get(cancelToken);if(abortController){abortController.abort();this.abortControllers.delete(cancelToken)}};request=async({body,secure,path,type,query,format,baseUrl,cancelToken,...params})=>{const secureParams=("boolean"==typeof secure?secure:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{};const requestParams=this.mergeRequestParams(params,secureParams);const queryString=query&&this.toQueryString(query);const payloadFormatter=this.contentFormatters[type||"application/json"];const responseFormat=format||requestParams.format;return this.customFetch(`${baseUrl||this.baseUrl||""}${path}${queryString?`?${queryString}`:""}`,{...requestParams,headers:{...requestParams.headers||{},...type&&"multipart/form-data"!==type?{"Content-Type":type}:{}},signal:(cancelToken?this.createAbortSignal(cancelToken):requestParams.signal)||null,body:null==body?null:payloadFormatter(body)}).then(async response=>{const r=response;r.data=null;r.error=null;const responseToParse=responseFormat?response.clone():response;const data=responseFormat?await responseToParse[responseFormat]().then(data=>{if(r.ok)r.data=data;else r.error=data;return r}).catch(e=>{r.error=e;return r}):r;if(cancelToken)this.abortControllers.delete(cancelToken);if(!response.ok)throw data;return data})}}class IntegrationsApi{http;constructor(http){this.http=http}status=(params={})=>this.http.request({path:"/status",method:"GET",...params});connectors={getStatsConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/stats`,method:"GET",secure:true,format:"json",...params}),getConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/ok`,method:"GET",secure:true,format:"json",...params}),getIllConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/ill`,method:"GET",secure:true,format:"json",...params}),getCatalogConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/catalog`,method:"GET",secure:true,format:"json",...params}),addConnectorV1:({cid,...query},data,params={})=>this.http.request({path:`/v1/connectors/${cid}/add`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),getConnectorConfigV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/config/${connector}`,method:"GET",secure:true,format:"json",...params}),getConnectorSingleV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/single/${connector}`,method:"GET",secure:true,format:"json",...params}),putConnectorDataV1:({connector,cid,...query},data,params={})=>this.http.request({path:`/v1/connectors/${cid}/data/${connector}`,method:"PUT",body:data,secure:true,type:"application/json",format:"json",...params}),refreshConnectorAccountsV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/${connector}/refresh-accounts`,method:"POST",secure:true,format:"json",...params}),renameConnectorV1:({connector,cid,...query},data,params={})=>this.http.request({path:`/v1/connectors/${cid}/${connector}`,method:"PATCH",body:data,secure:true,type:"application/json",format:"json",...params}),deleteConnectorV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/${connector}`,method:"DELETE",secure:true,format:"json",...params}),getConnectorHistoryV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/${connector}/history`,method:"GET",secure:true,format:"json",...params}),getAuthSecretsV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/${connector}/auth-secrets`,method:"GET",secure:true,format:"json",...params})};google={listGsheetFilesV1:({cid,...query},params={})=>this.http.request({path:`/v1/google/${cid}/gsheet/files`,method:"GET",secure:true,format:"json",...params}),addGsheetFileV1:({cid,...query},data,params={})=>this.http.request({path:`/v1/google/${cid}/gsheet/files`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),deleteGsheetFileV1:({fileId,cid,...query},params={})=>this.http.request({path:`/v1/google/${cid}/gsheet/files/${fileId}`,method:"DELETE",secure:true,format:"json",...params}),listGslidesFilesV1:({cid,...query},params={})=>this.http.request({path:`/v1/google/${cid}/gslides/files`,method:"GET",secure:true,format:"json",...params}),addGslidesFileV1:({cid,...query},data,params={})=>this.http.request({path:`/v1/google/${cid}/gslides/files`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),deleteGslidesFileV1:({fileId,cid,...query},params={})=>this.http.request({path:`/v1/google/${cid}/gslides/files/${fileId}`,method:"DELETE",secure:true,format:"json",...params})};microsoft={startAdminConsentV1:({cid,...query},params={})=>this.http.request({path:`/v1/microsoft/${cid}/admin-consent/start`,method:"GET",query:query,secure:true,format:"json",...params}),handleCallbackV1:(query,params={})=>this.http.request({path:"/v1/microsoft/admin-consent/callback",method:"GET",query:query,...params}),getTenantV1:({cid,...query},params={})=>this.http.request({path:`/v1/microsoft/${cid}/tenant`,method:"GET",secure:true,format:"json",...params}),resolveFileV1:({cid,...query},data,params={})=>this.http.request({path:`/v1/microsoft/${cid}/resolve-file`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),listPptxFilesV1:({cid,...query},params={})=>this.http.request({path:`/v1/microsoft/${cid}/pptx/files`,method:"GET",secure:true,format:"json",...params}),addPptxFileV1:({cid,...query},data,params={})=>this.http.request({path:`/v1/microsoft/${cid}/pptx/files`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),deletePptxFileV1:({fileId,cid,...query},params={})=>this.http.request({path:`/v1/microsoft/${cid}/pptx/files/${fileId}`,method:"DELETE",secure:true,format:"json",...params}),listExcelFilesV1:({cid,...query},params={})=>this.http.request({path:`/v1/microsoft/${cid}/excel/files`,method:"GET",secure:true,format:"json",...params}),addExcelFileV1:({cid,...query},data,params={})=>this.http.request({path:`/v1/microsoft/${cid}/excel/files`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),readExcelV1:({cid,...query},data,params={})=>this.http.request({path:`/v1/microsoft/${cid}/excel/read`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),deleteExcelFileV1:({fileId,cid,...query},params={})=>this.http.request({path:`/v1/microsoft/${cid}/excel/files/${fileId}`,method:"DELETE",secure:true,format:"json",...params})};pennylane={startOauthV1:({cid,...query},params={})=>this.http.request({path:`/v1/pennylane/${cid}/oauth/start`,method:"GET",query:query,secure:true,format:"json",...params}),getStatusV1:({cid,...query},params={})=>this.http.request({path:`/v1/pennylane/${cid}/oauth/status`,method:"GET",secure:true,format:"json",...params}),disconnectV1:({cid,...query},params={})=>this.http.request({path:`/v1/pennylane/${cid}/oauth`,method:"DELETE",secure:true,format:"json",...params}),getTokenV1:({cid,...query},params={})=>this.http.request({path:`/v1/pennylane/${cid}/oauth/token`,method:"GET",format:"json",...params}),handleCallbackV1:(query,params={})=>this.http.request({path:"/v1/pennylane/callback",method:"GET",query:query,...params})};puzzle={startOauthV1:({cid,...query},params={})=>this.http.request({path:`/v1/puzzle/${cid}/oauth/start`,method:"GET",query:query,secure:true,format:"json",...params}),getStatusV1:({cid,...query},params={})=>this.http.request({path:`/v1/puzzle/${cid}/oauth/status`,method:"GET",secure:true,format:"json",...params}),getTokenV1:({cid,...query},params={})=>this.http.request({path:`/v1/puzzle/${cid}/oauth/token`,method:"GET",format:"json",...params}),handleCallbackV1:(query,params={})=>this.http.request({path:"/v1/puzzle/oauth/callback",method:"GET",query:query,...params})}}}}]);
1
+ "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["8305"],{4184:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{q:()=>ConnectorBubble});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(4848);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(2773);var _tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(5200);var _src_utils_connectorLogoUrl_ts__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(8753);var react_i18next__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(6155);function ConnectorBubble({connector,rename}){const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_4__.useTranslation)();const{colorScheme}=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineColorScheme)();const bg="dark"===colorScheme?"white":"dark";const logoUrl=(0,_src_utils_connectorLogoUrl_ts__WEBPACK_IMPORTED_MODULE_3__.U)(connector.main_connectorlist);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Card,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Avatar,{src:logoUrl,size:64,radius:"md",bg:bg,color:"dark"===colorScheme?"black":"white",p:18}),rename?rename.editing?/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"xs",wrap:"nowrap",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{value:rename.draft,onChange:e=>rename.onDraftChange(e.currentTarget.value),autoFocus:true,onKeyDown:e=>{if("Enter"===e.key)rename.onSave();if("Escape"===e.key)rename.onCancel()},style:{flex:1}}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.ActionIcon,{onClick:rename.onSave,"aria-label":t("Sauvegarder"),loading:rename.isPending,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__.IconCheck,{size:16})}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.ActionIcon,{onClick:rename.onCancel,"aria-label":t("Annuler"),variant:"subtle",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__.IconX,{size:16})})]}):/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"xs",wrap:"nowrap",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{w:"fit-content",order:3,children:connector.name}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.ActionIcon,{onClick:rename.onStartEditing,"aria-label":t("Renommer"),variant:"subtle",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__.IconPencil,{size:16})})]}):/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{w:"fit-content",order:3,children:connector.name}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",size:"lg",lineClamp:3,children:connector.main_connectorlist.description_fr})]})})}},6699:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Qq:()=>HttpClient,cM:()=>ContentType,qx:()=>IntegrationsApi});var ContentType=/*#__PURE__*/function(ContentType){ContentType["Json"]="application/json";ContentType["JsonApi"]="application/vnd.api+json";ContentType["FormData"]="multipart/form-data";ContentType["UrlEncoded"]="application/x-www-form-urlencoded";ContentType["Text"]="text/plain";return ContentType}({});class HttpClient{baseUrl="";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...fetchParams)=>fetch(...fetchParams);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(apiConfig={}){Object.assign(this,apiConfig)}setSecurityData=data=>{this.securityData=data};encodeQueryParam(key,value){const encodedKey=encodeURIComponent(key);return`${encodedKey}=${encodeURIComponent("number"==typeof value?value:`${value}`)}`}addQueryParam(query,key){return this.encodeQueryParam(key,query[key])}addArrayQueryParam(query,key){const value=query[key];return value.map(v=>this.encodeQueryParam(key,v)).join("&")}toQueryString(rawQuery){const query=rawQuery||{};const keys=Object.keys(query).filter(key=>void 0!==query[key]);return keys.map(key=>Array.isArray(query[key])?this.addArrayQueryParam(query,key):this.addQueryParam(query,key)).join("&")}addQueryParams(rawQuery){const queryString=this.toQueryString(rawQuery);return queryString?`?${queryString}`:""}contentFormatters={["application/json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["application/vnd.api+json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["text/plain"]:input=>null!==input&&"string"!=typeof input?JSON.stringify(input):input,["multipart/form-data"]:input=>{if(input instanceof FormData)return input;return Object.keys(input||{}).reduce((formData,key)=>{const property=input[key];formData.append(key,property instanceof Blob?property:"object"==typeof property&&null!==property?JSON.stringify(property):`${property}`);return formData},new FormData)},["application/x-www-form-urlencoded"]:input=>this.toQueryString(input)};mergeRequestParams(params1,params2){return{...this.baseApiParams,...params1,...params2||{},headers:{...this.baseApiParams.headers||{},...params1.headers||{},...params2&&params2.headers||{}}}}createAbortSignal=cancelToken=>{if(this.abortControllers.has(cancelToken)){const abortController=this.abortControllers.get(cancelToken);if(abortController)return abortController.signal;return}const abortController=new AbortController;this.abortControllers.set(cancelToken,abortController);return abortController.signal};abortRequest=cancelToken=>{const abortController=this.abortControllers.get(cancelToken);if(abortController){abortController.abort();this.abortControllers.delete(cancelToken)}};request=async({body,secure,path,type,query,format,baseUrl,cancelToken,...params})=>{const secureParams=("boolean"==typeof secure?secure:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{};const requestParams=this.mergeRequestParams(params,secureParams);const queryString=query&&this.toQueryString(query);const payloadFormatter=this.contentFormatters[type||"application/json"];const responseFormat=format||requestParams.format;return this.customFetch(`${baseUrl||this.baseUrl||""}${path}${queryString?`?${queryString}`:""}`,{...requestParams,headers:{...requestParams.headers||{},...type&&"multipart/form-data"!==type?{"Content-Type":type}:{}},signal:(cancelToken?this.createAbortSignal(cancelToken):requestParams.signal)||null,body:null==body?null:payloadFormatter(body)}).then(async response=>{const r=response;r.data=null;r.error=null;const responseToParse=responseFormat?response.clone():response;const data=responseFormat?await responseToParse[responseFormat]().then(data=>{if(r.ok)r.data=data;else r.error=data;return r}).catch(e=>{r.error=e;return r}):r;if(cancelToken)this.abortControllers.delete(cancelToken);if(!response.ok)throw data;return data})}}class IntegrationsApi{http;constructor(http){this.http=http}status=(params={})=>this.http.request({path:"/status",method:"GET",...params});connectors={getStatsConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/stats`,method:"GET",secure:true,format:"json",...params}),getConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/ok`,method:"GET",secure:true,format:"json",...params}),getIllConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/ill`,method:"GET",secure:true,format:"json",...params}),getCatalogConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/catalog`,method:"GET",secure:true,format:"json",...params}),addConnectorV1:({cid,...query},data,params={})=>this.http.request({path:`/v1/connectors/${cid}/add`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),getConnectorConfigV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/config/${connector}`,method:"GET",secure:true,format:"json",...params}),getConnectorSingleV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/single/${connector}`,method:"GET",secure:true,format:"json",...params}),putConnectorDataV1:({connector,cid,...query},data,params={})=>this.http.request({path:`/v1/connectors/${cid}/data/${connector}`,method:"PUT",body:data,secure:true,type:"application/json",format:"json",...params}),refreshConnectorAccountsV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/${connector}/refresh-accounts`,method:"POST",secure:true,format:"json",...params}),renameConnectorV1:({connector,cid,...query},data,params={})=>this.http.request({path:`/v1/connectors/${cid}/${connector}`,method:"PATCH",body:data,secure:true,type:"application/json",format:"json",...params}),deleteConnectorV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/${connector}`,method:"DELETE",secure:true,format:"json",...params}),getConnectorHistoryV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/${connector}/history`,method:"GET",secure:true,format:"json",...params}),getAuthSecretsV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/${connector}/auth-secrets`,method:"GET",secure:true,format:"json",...params})};google={listGsheetFilesV1:({cid,...query},params={})=>this.http.request({path:`/v1/google/${cid}/gsheet/files`,method:"GET",secure:true,format:"json",...params}),addGsheetFileV1:({cid,...query},data,params={})=>this.http.request({path:`/v1/google/${cid}/gsheet/files`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),deleteGsheetFileV1:({fileId,cid,...query},params={})=>this.http.request({path:`/v1/google/${cid}/gsheet/files/${fileId}`,method:"DELETE",secure:true,format:"json",...params}),listGslidesFilesV1:({cid,...query},params={})=>this.http.request({path:`/v1/google/${cid}/gslides/files`,method:"GET",secure:true,format:"json",...params}),addGslidesFileV1:({cid,...query},data,params={})=>this.http.request({path:`/v1/google/${cid}/gslides/files`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),deleteGslidesFileV1:({fileId,cid,...query},params={})=>this.http.request({path:`/v1/google/${cid}/gslides/files/${fileId}`,method:"DELETE",secure:true,format:"json",...params})};microsoft={startAdminConsentV1:({cid,...query},params={})=>this.http.request({path:`/v1/microsoft/${cid}/admin-consent/start`,method:"GET",query:query,secure:true,format:"json",...params}),handleCallbackV1:(query,params={})=>this.http.request({path:"/v1/microsoft/admin-consent/callback",method:"GET",query:query,...params}),getTenantV1:({cid,...query},params={})=>this.http.request({path:`/v1/microsoft/${cid}/tenant`,method:"GET",secure:true,format:"json",...params}),resolveFileV1:({cid,...query},data,params={})=>this.http.request({path:`/v1/microsoft/${cid}/resolve-file`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),listPptxFilesV1:({cid,...query},params={})=>this.http.request({path:`/v1/microsoft/${cid}/pptx/files`,method:"GET",secure:true,format:"json",...params}),addPptxFileV1:({cid,...query},data,params={})=>this.http.request({path:`/v1/microsoft/${cid}/pptx/files`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),deletePptxFileV1:({fileId,cid,...query},params={})=>this.http.request({path:`/v1/microsoft/${cid}/pptx/files/${fileId}`,method:"DELETE",secure:true,format:"json",...params}),listExcelFilesV1:({cid,...query},params={})=>this.http.request({path:`/v1/microsoft/${cid}/excel/files`,method:"GET",secure:true,format:"json",...params}),addExcelFileV1:({cid,...query},data,params={})=>this.http.request({path:`/v1/microsoft/${cid}/excel/files`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),readExcelV1:({cid,...query},data,params={})=>this.http.request({path:`/v1/microsoft/${cid}/excel/read`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),deleteExcelFileV1:({fileId,cid,...query},params={})=>this.http.request({path:`/v1/microsoft/${cid}/excel/files/${fileId}`,method:"DELETE",secure:true,format:"json",...params})};pennylane={startOauthV1:({cid,...query},params={})=>this.http.request({path:`/v1/pennylane/${cid}/oauth/start`,method:"GET",query:query,secure:true,format:"json",...params}),getStatusV1:({cid,...query},params={})=>this.http.request({path:`/v1/pennylane/${cid}/oauth/status`,method:"GET",secure:true,format:"json",...params}),disconnectV1:({cid,...query},params={})=>this.http.request({path:`/v1/pennylane/${cid}/oauth`,method:"DELETE",secure:true,format:"json",...params}),getTokenV1:({cid,...query},params={})=>this.http.request({path:`/v1/pennylane/${cid}/oauth/token`,method:"GET",format:"json",...params}),handleCallbackV1:(query,params={})=>this.http.request({path:"/v1/pennylane/callback",method:"GET",query:query,...params})};puzzle={startOauthV1:({cid,...query},params={})=>this.http.request({path:`/v1/puzzle/${cid}/oauth/start`,method:"GET",query:query,secure:true,format:"json",...params}),getStatusV1:({cid,...query},params={})=>this.http.request({path:`/v1/puzzle/${cid}/oauth/status`,method:"GET",secure:true,format:"json",...params}),getTokenV1:({cid,...query},params={})=>this.http.request({path:`/v1/puzzle/${cid}/oauth/token`,method:"GET",format:"json",...params}),handleCallbackV1:(query,params={})=>this.http.request({path:"/v1/puzzle/oauth/callback",method:"GET",query:query,...params})}}}}]);
@@ -0,0 +1,8 @@
1
+ export declare function eburyOauthStatusQueryKey(company: string): string[];
2
+ export declare function useEburyOauth(): {
3
+ status: import("@tanstack/react-query").UseQueryResult<import("@/src/gen/EburyApi").EburyOauthStatusResponse, Error>;
4
+ start: import("@tanstack/react-query").UseMutationResult<import("@/src/gen/EburyApi").EburyOauthStartResponse, Error, void, unknown>;
5
+ disconnect: import("@tanstack/react-query").UseMutationResult<import("@/src/gen/EburyApi").EburyOauthDisconnectResponse, Error, void, unknown>;
6
+ refresh: () => Promise<void>;
7
+ callbackOrigin: string;
8
+ };
@@ -0,0 +1,5 @@
1
+ import { useConnectorSaveWithStepUp } from '@/src/api/connectors/useConnectorSaveWithStepUp';
2
+ export declare function EburyConfigPanel({ initialData, save, }: {
3
+ initialData: object;
4
+ save: ReturnType<typeof useConnectorSaveWithStepUp>['save'];
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ export declare function isTrustedEburyOauthEvent(event: MessageEvent, origin: string, popup: Window | null): boolean;
2
+ export declare function useEburyOauthPopup({ origin, onResult, onDismiss, }: {
3
+ origin: string;
4
+ onResult: (success: boolean) => void;
5
+ onDismiss: () => void;
6
+ }): {
7
+ openPopup: () => Window;
8
+ closePopup: () => void;
9
+ isOpen: boolean;
10
+ };
@@ -0,0 +1,151 @@
1
+ export interface CallbackV1Params {
2
+ code?: string;
3
+ error?: string;
4
+ state: string;
5
+ }
6
+ export interface DisconnectV1Params {
7
+ cid: string;
8
+ }
9
+ export interface EburyOauthDisconnectResponse {
10
+ disconnected: boolean;
11
+ }
12
+ export interface EburyOauthStartResponse {
13
+ url: string;
14
+ }
15
+ export interface EburyOauthStatusResponse {
16
+ accessTokenExpiresAt?: string;
17
+ connected: boolean;
18
+ eburyClientId?: string;
19
+ eburyClientName?: string;
20
+ }
21
+ export interface ReadV1Params {
22
+ cid: string;
23
+ resource: string;
24
+ }
25
+ export interface StartV1Params {
26
+ cid: string;
27
+ /** @format uri */
28
+ returnTo: string;
29
+ }
30
+ export interface StatusV1Params {
31
+ cid: string;
32
+ }
33
+ export type QueryParamsType = Record<string | number, any>;
34
+ export type ResponseFormat = keyof Omit<Body, 'body' | 'bodyUsed'>;
35
+ export interface FullRequestParams extends Omit<RequestInit, 'body'> {
36
+ /** set parameter to `true` for call `securityWorker` for this request */
37
+ secure?: boolean;
38
+ /** request path */
39
+ path: string;
40
+ /** content type of request body */
41
+ type?: ContentType;
42
+ /** query params */
43
+ query?: QueryParamsType;
44
+ /** format of response (i.e. response.json() -> format: "json") */
45
+ format?: ResponseFormat;
46
+ /** request body */
47
+ body?: unknown;
48
+ /** base url */
49
+ baseUrl?: string;
50
+ /** request cancellation token */
51
+ cancelToken?: CancelToken;
52
+ }
53
+ export type RequestParams = Omit<FullRequestParams, 'body' | 'method' | 'query' | 'path'>;
54
+ export interface ApiConfig<SecurityDataType = unknown> {
55
+ baseUrl?: string;
56
+ baseApiParams?: Omit<RequestParams, 'baseUrl' | 'cancelToken' | 'signal'>;
57
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
58
+ customFetch?: typeof fetch;
59
+ }
60
+ export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
61
+ data: D;
62
+ error: E;
63
+ }
64
+ type CancelToken = Symbol | string | number;
65
+ export declare enum ContentType {
66
+ Json = "application/json",
67
+ JsonApi = "application/vnd.api+json",
68
+ FormData = "multipart/form-data",
69
+ UrlEncoded = "application/x-www-form-urlencoded",
70
+ Text = "text/plain"
71
+ }
72
+ export declare class HttpClient<SecurityDataType = unknown> {
73
+ baseUrl: string;
74
+ private securityData;
75
+ private securityWorker?;
76
+ private abortControllers;
77
+ private customFetch;
78
+ private baseApiParams;
79
+ constructor(apiConfig?: ApiConfig<SecurityDataType>);
80
+ setSecurityData: (data: SecurityDataType | null) => void;
81
+ protected encodeQueryParam(key: string, value: any): string;
82
+ protected addQueryParam(query: QueryParamsType, key: string): string;
83
+ protected addArrayQueryParam(query: QueryParamsType, key: string): any;
84
+ protected toQueryString(rawQuery?: QueryParamsType): string;
85
+ protected addQueryParams(rawQuery?: QueryParamsType): string;
86
+ private contentFormatters;
87
+ protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams;
88
+ protected createAbortSignal: (cancelToken: CancelToken) => AbortSignal | undefined;
89
+ abortRequest: (cancelToken: CancelToken) => void;
90
+ request: <T = any, E = any>({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }: FullRequestParams) => Promise<HttpResponse<T, E>>;
91
+ }
92
+ /**
93
+ * @title Ebury
94
+ * @version 1
95
+ * @contact
96
+ */
97
+ export declare class EburyApi<SecurityDataType extends unknown> {
98
+ http: HttpClient<SecurityDataType>;
99
+ constructor(http: HttpClient<SecurityDataType>);
100
+ ebury: {
101
+ /**
102
+ * No description
103
+ *
104
+ * @tags Ebury
105
+ * @name StartV1
106
+ * @request GET:/v1/ebury/{cid}/oauth/start
107
+ * @secure
108
+ * @response `200` `EburyOauthStartResponse`
109
+ */
110
+ startV1: ({ cid, ...query }: StartV1Params, params?: RequestParams) => Promise<HttpResponse<EburyOauthStartResponse, any>>;
111
+ /**
112
+ * No description
113
+ *
114
+ * @tags Ebury
115
+ * @name StatusV1
116
+ * @request GET:/v1/ebury/{cid}/oauth/status
117
+ * @secure
118
+ * @response `200` `EburyOauthStatusResponse`
119
+ */
120
+ statusV1: ({ cid, ...query }: StatusV1Params, params?: RequestParams) => Promise<HttpResponse<EburyOauthStatusResponse, any>>;
121
+ /**
122
+ * No description
123
+ *
124
+ * @tags Ebury
125
+ * @name DisconnectV1
126
+ * @request DELETE:/v1/ebury/{cid}/oauth
127
+ * @secure
128
+ * @response `200` `EburyOauthDisconnectResponse`
129
+ */
130
+ disconnectV1: ({ cid, ...query }: DisconnectV1Params, params?: RequestParams) => Promise<HttpResponse<EburyOauthDisconnectResponse, any>>;
131
+ /**
132
+ * No description
133
+ *
134
+ * @tags Ebury
135
+ * @name CallbackV1
136
+ * @request GET:/v1/ebury/callback
137
+ * @response `200` `void`
138
+ */
139
+ callbackV1: (query: CallbackV1Params, params?: RequestParams) => Promise<HttpResponse<void, any>>;
140
+ /**
141
+ * No description
142
+ *
143
+ * @tags Ebury
144
+ * @name ReadV1
145
+ * @request GET:/v1/ebury/{cid}/data/{resource}
146
+ * @response `200` `void`
147
+ */
148
+ readV1: ({ cid, resource, ...query }: ReadV1Params, params?: RequestParams) => Promise<HttpResponse<void, any>>;
149
+ };
150
+ }
151
+ export {};
@@ -1 +1 @@
1
- "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["1153"],{9429:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>Connectors});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(8556);var index_mjs_=__webpack_require__(2773);var modern_index_js_=__webpack_require__(7714);var IntegrationsApi=__webpack_require__(6699);const AppConfigCtx=/*#__PURE__*/(0,index_js_.createContext)(null);const AppConfigProvider=AppConfigCtx.Provider;function useAppConfig(){const config=(0,index_js_.useContext)(AppConfigCtx);if(!config)throw new Error("Called `useAppConfig` outside a `<AppConfigProvider />`");return config}function useApi(){const config=useAppConfig();const client=new IntegrationsApi.Qq({baseUrl:config.api.replace(/\/$/,""),baseApiParams:{headers:{Authorization:config.token?`Bearer ${config.token}`:"",From:config.owner}}});return new IntegrationsApi.qx(client)}function useStatsQuery(){const api=useApi();const config=useAppConfig();const query=(0,modern_index_js_.useQuery)({queryKey:["connectors","stats",config.company],queryFn:async()=>await api.connectors.getStatsConnectorsV1({cid:config.company}).then(x=>x.data),staleTime:6e4,refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}function useConnectorsListQuery(){const api=useApi();const config=useAppConfig();const query=(0,modern_index_js_.useQuery)({queryKey:["connectors","list",config.company],queryFn:async()=>await api.connectors.getConnectorsV1({cid:config.company}).then(x=>x.data),staleTime:6e4,refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}var connector_bubble=__webpack_require__(4184);var tabler_icons_react_mjs_=__webpack_require__(5200);var esm_index_mjs_=__webpack_require__(4931);var es_index_js_=__webpack_require__(6155);function useConnectorDeleteMutation(){const{t}=(0,es_index_js_.useTranslation)();const api=useApi();const config=useAppConfig();const queryClient=(0,modern_index_js_.useQueryClient)();return(0,modern_index_js_.useMutation)({mutationFn:async connector=>{const res=await api.connectors.deleteConnectorV1({cid:config.company,connector});return res.data},onSuccess:()=>{queryClient.invalidateQueries({queryKey:["connectors","list",config.company]});queryClient.invalidateQueries({queryKey:["connectors","list","ill",config.company]});queryClient.invalidateQueries({queryKey:["connectors","catalog",config.company]});queryClient.invalidateQueries({queryKey:["connectors","stats",config.company]});queryClient.invalidateQueries({queryKey:["connectors","ok",config.company]});queryClient.invalidateQueries({queryKey:["connectors","ill",config.company]});esm_index_mjs_.notifications.show({color:"green",title:t("Connecteur supprim\xe9"),message:t("Vous pouvez le r\xe9ajouter depuis le catalogue.")})},onError:error=>{console.error(error);esm_index_mjs_.notifications.show({color:"red",title:t("Suppression \xe9chou\xe9e"),message:t("R\xe9essayez dans un instant.")})}})}var locales=__webpack_require__(108);var modals_esm_index_mjs_=__webpack_require__(4403);function isDeleteConfirmInput(input){return"DELETE"===input}function DeleteActiveBody({name,onConfirm}){const{t}=(0,es_index_js_.useTranslation)();const[input,setInput]=(0,index_js_.useState)("");const isMatch=isDeleteConfirmInput(input);const handleConfirm=()=>{if(!isMatch)return;onConfirm();modals_esm_index_mjs_.modals.closeAll()};return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:/*#__PURE__*/(0,jsx_runtime.jsx)(es_index_js_.Trans,{i18nKey:"Le connecteur <1>{{nom}}</1> est actuellement actif. Sa suppression arr\xeatera la synchronisation et le retirera de la liste. Vous pourrez le r\xe9ajouter depuis le catalogue plus tard.",values:{nom:name},components:{1:/*#__PURE__*/(0,jsx_runtime.jsx)("strong",{})}})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:/*#__PURE__*/(0,jsx_runtime.jsx)(es_index_js_.Trans,{i18nKey:"Pour confirmer, tapez <1>DELETE</1> ci-dessous.",components:{1:/*#__PURE__*/(0,jsx_runtime.jsx)("strong",{})}})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{value:input,onChange:e=>setInput(e.currentTarget.value),placeholder:"DELETE",autoFocus:true,onKeyDown:e=>{if("Enter"===e.key)handleConfirm()}}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"flex-end",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"default",onClick:()=>modals_esm_index_mjs_.modals.closeAll(),children:t("Annuler")}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{color:"red",disabled:!isMatch,onClick:handleConfirm,children:t("Supprimer")})]})]})}function openDeleteActiveConnectorModal(name,onConfirm){modals_esm_index_mjs_.modals.open({title:(0,locales.tr)("Supprimer ce connecteur ?"),centered:true,children:/*#__PURE__*/(0,jsx_runtime.jsx)(DeleteActiveBody,{name:name,onConfirm:onConfirm})})}function ConnectorMenu({connectorId,connectorName,isActive}){const{t}=(0,es_index_js_.useTranslation)();const{mutate,isPending}=useConnectorDeleteMutation();const handleDelete=()=>{if(isActive)openDeleteActiveConnectorModal(connectorName,()=>mutate(connectorId));else mutate(connectorId)};const stopBubble=e=>{e.stopPropagation();e.preventDefault()};return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Menu,{position:"bottom-end",withinPortal:true,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Menu.Target,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.ActionIcon,{variant:"subtle",color:"gray","aria-label":t("Actions du connecteur"),onClick:stopBubble,children:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconDots,{size:18})})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Menu.Dropdown,{onClick:stopBubble,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Menu.Item,{color:"red",leftSection:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconTrash,{size:16}),onClick:handleDelete,disabled:isPending,children:t("Supprimer")})})]})}function ListOkComponent(){const{t}=(0,es_index_js_.useTranslation)();const config=useAppConfig();const listResultRes=useConnectorsListQuery();const listResult=listResultRes.data;return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",mb:0,order:2,children:t("Tous vos connecteurs en marche")}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SimpleGrid,{cols:{base:1,xs:2,sm:3,md:4,lg:5,xl:6},spacing:"lg",verticalSpacing:"lg",style:{alignItems:"stretch"},children:listResult?.list?.map((connector,idx)=>connector?.main_connectorlist?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Card,{pos:"relative",style:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Anchor,{underline:"never",href:`/company/${config.company}/integrations/${connector.id}/connector`,children:/*#__PURE__*/(0,jsx_runtime.jsx)(connector_bubble.q,{connector:connector})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Box,{pos:"absolute",top:8,right:8,children:/*#__PURE__*/(0,jsx_runtime.jsx)(ConnectorMenu,{connectorId:connector.id,connectorName:connector.name,isActive:true})})]},idx):/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{radius:"md",animate:true},idx))})]})}function useConnectorsIllListQuery(){const api=useApi();const config=useAppConfig();const query=(0,modern_index_js_.useQuery)({queryKey:["connectors","list","ill",config.company],queryFn:async()=>await api.connectors.getIllConnectorsV1({cid:config.company}).then(x=>x.data),staleTime:6e4,refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}function ListIllComponent(){const{t}=(0,es_index_js_.useTranslation)();const config=useAppConfig();const listResultRes=useConnectorsIllListQuery();const listResult=listResultRes.data;return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",mb:0,order:2,children:t("Tous vos connecteurs \xe0 configurer")}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SimpleGrid,{cols:{base:1,xs:2,sm:3,md:4,lg:5,xl:6},spacing:"lg",verticalSpacing:"lg",style:{alignItems:"stretch"},children:listResult?.list?.map((connector,idx)=>connector?.main_connectorlist?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Card,{pos:"relative",style:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Anchor,{underline:"never",href:`/company/${config.company}/integrations/${connector.id}/connector`,children:/*#__PURE__*/(0,jsx_runtime.jsx)(connector_bubble.q,{connector:connector})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Box,{pos:"absolute",top:8,right:8,children:/*#__PURE__*/(0,jsx_runtime.jsx)(ConnectorMenu,{connectorId:connector.id,connectorName:connector.name,isActive:false})})]},idx):/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{radius:"md",animate:true},idx))})]})}function useConnectorAddMutation(){const api=useApi();const config=useAppConfig();const queryClient=(0,modern_index_js_.useQueryClient)();return(0,modern_index_js_.useMutation)({mutationFn:async connector_id=>{const res=await api.connectors.addConnectorV1({cid:config.company},{connector_id});return res.data},onSuccess:()=>{queryClient.invalidateQueries({queryKey:["connectors","catalog",config.company]});queryClient.invalidateQueries({queryKey:["connectors","list",config.company]});queryClient.invalidateQueries({queryKey:["connectors","list","ill",config.company]});queryClient.invalidateQueries({queryKey:["connectors","stats",config.company]});queryClient.invalidateQueries({queryKey:["connectors","ok",config.company]});queryClient.invalidateQueries({queryKey:["connectors","ill",config.company]})}})}function useConnectorCatalogQuery(){const api=useApi();const config=useAppConfig();const query=(0,modern_index_js_.useQuery)({queryKey:["connectors","catalog",config.company],queryFn:async()=>await api.connectors.getCatalogConnectorsV1({cid:config.company}).then(x=>x.data),refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}var connectorLogoUrl=__webpack_require__(4937);function CollapsibleGroup({title,count,collapsed,onToggle,children}){return/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.UnstyledButton,{onClick:onToggle,style:{width:"100%",padding:"8px 12px"},children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"xs",children:[collapsed?/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconChevronRight,{size:16}):/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconChevronDown,{size:16}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,children:title}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{c:"dimmed",children:["(",count,")"]})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Collapse,{in:!collapsed,children:children})]})}const KEY=userId=>`connectors-expanded-groups:${userId}`;function useCollapsedGroups(userId,_allGroupKeys){const[expanded,setExpanded]=(0,index_js_.useState)(()=>{const raw=localStorage.getItem(KEY(userId));if(raw)try{return new Set(JSON.parse(raw))}catch{}return new Set});(0,index_js_.useEffect)(()=>{localStorage.setItem(KEY(userId),JSON.stringify([...expanded]))},[userId,expanded]);const toggle=(0,index_js_.useCallback)(key=>{setExpanded(prev=>{const next=new Set(prev);if(next.has(key))next.delete(key);else next.add(key);return next})},[]);const isCollapsed=(0,index_js_.useCallback)(key=>!expanded.has(key),[expanded]);return{isCollapsed,toggle}}function normalize(value){return(value??"").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"")}function getBaseName(name){return name.replace(/\s+via\s+.+$/i,"").trim()}function getMethodSuffix(name,baseName){return name.length>baseName.length?name.slice(baseName.length).trim():name}function GroupCard({group,pending}){const{t}=(0,es_index_js_.useTranslation)();const{colorScheme}=(0,index_mjs_.useMantineColorScheme)();const bg="dark"===colorScheme?"white":"dark";const first=group.items[0];const logoUrl=(0,connectorLogoUrl.U)({codename:group.codename,logo_key:group.logoKey});return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Card,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"space-between",align:"flex-start",children:[pending?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Loader,{size:64}):/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Avatar,{src:logoUrl,size:64,radius:"md",bg:bg,color:"dark"===colorScheme?"black":"white",p:18}),group.items.length>1&&/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Badge,{variant:"light",color:"blue",children:t("{{count}} m\xe9thode",{count:group.items.length})})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",order:3,children:group.baseName}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",size:"lg",lineClamp:3,children:first.description_fr?t(first.description_fr):null})]})})}function MethodChoiceCard({item,baseName,pending,disabled,onClick}){const{t}=(0,es_index_js_.useTranslation)();const suffix=getMethodSuffix(item.name,baseName);return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Card,{style:{cursor:disabled?"wait":"pointer",opacity:disabled&&!pending?.5:1},onClick:()=>{if(!disabled)onClick()},children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"space-between",align:"center",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:4,style:{flex:1},children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"xs",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,children:suffix||item.name}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Badge,{variant:"light",color:"gray",children:item.sharing_method})]}),item.description_fr&&/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",size:"sm",lineClamp:2,children:t(item.description_fr)})]}),pending&&/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Loader,{size:"sm"})]})})}function ListCatalogComponent(){const{t}=(0,es_index_js_.useTranslation)();const config=useAppConfig();const result=useConnectorCatalogQuery();const list=result.data?.list;const[searchValue,setSearchValue]=(0,index_js_.useState)("");const[pendingId,setPendingId]=(0,index_js_.useState)(null);const[selectedGroup,setSelectedGroup]=(0,index_js_.useState)(null);const[hoveredGroupKey,setHoveredGroupKey]=(0,index_js_.useState)(null);const mutation=useConnectorAddMutation();const filtered=(0,index_js_.useMemo)(()=>{if(!list)return;const q=normalize(searchValue);if(!q)return list;return list.filter(item=>{const source=item.description_fr??"";const traduite=source?t(source):"";return normalize(`${item.name} ${source} ${traduite}`).includes(q)})},[list,searchValue,t]);const sections=(0,index_js_.useMemo)(()=>{if(!filtered)return;const groups=new Map;for(const item of filtered){const baseName=getBaseName(item.name);const groupKey=`${item.logo_key??item.codename}::${baseName}`;if(!groups.has(groupKey))groups.set(groupKey,{groupKey,baseName,type:item.type,codename:item.codename,logoKey:item.logo_key,items:[]});groups.get(groupKey).items.push(item)}const byCategory=new Map;for(const group of groups.values()){const k=group.type.codename;if(!byCategory.has(k))byCategory.set(k,{type:group.type,groups:[]});byCategory.get(k).groups.push(group)}return Array.from(byCategory.values())},[filtered]);const sectionKeys=(0,index_js_.useMemo)(()=>(sections??[]).map(s=>s.type.codename),[sections]);const{isCollapsed,toggle}=useCollapsedGroups(`catalog:${config.owner}`,sectionKeys);const triggerAdd=id=>{setPendingId(id);mutation.mutate(id,{onSuccess:data=>{window.location.href=`/company/${config.company}/integrations/${data.id}/connector`},onError:()=>{setPendingId(null)}})};const handleGroupClick=group=>{if(mutation.isPending)return;if(1===group.items.length)triggerAdd(group.items[0].id);else setSelectedGroup(group)};const handleCloseModal=()=>{if(mutation.isPending)return;setSelectedGroup(null);setPendingId(null)};return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{placeholder:t("Rechercher un connecteur..."),leftSection:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconSearch,{size:16}),value:searchValue,onChange:e=>setSearchValue(e.currentTarget.value),size:"md"}),sections?sections.map(section=>/*#__PURE__*/(0,jsx_runtime.jsx)(CollapsibleGroup,{title:t(section.type.name),count:section.groups.length,collapsed:isCollapsed(section.type.codename),onToggle:()=>toggle(section.type.codename),children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SimpleGrid,{cols:{base:1,xs:2,sm:3,md:4,lg:5,xl:6},spacing:"lg",verticalSpacing:"lg",style:{alignItems:"stretch"},children:section.groups.map(group=>{const isSinglePending=1===group.items.length&&pendingId===group.items[0].id;const isHovered=hoveredGroupKey===group.groupKey&&!mutation.isPending;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Card,{withBorder:true,style:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between",cursor:mutation.isPending?"wait":"pointer",opacity:mutation.isPending&&!isSinglePending?.5:1,borderColor:isHovered?"var(--mantine-color-green-5)":void 0,backgroundColor:isHovered?"var(--mantine-color-green-0)":void 0,transition:"border-color 120ms ease, background-color 120ms ease",position:"relative"},onMouseEnter:()=>setHoveredGroupKey(group.groupKey),onMouseLeave:()=>setHoveredGroupKey(null),onClick:()=>handleGroupClick(group),children:[isHovered&&/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Badge,{variant:"filled",color:"green",style:{position:"absolute",top:8,right:8,zIndex:1},children:t("Configurer →")}),/*#__PURE__*/(0,jsx_runtime.jsx)(GroupCard,{group:group,pending:isSinglePending})]},group.groupKey)})})},section.type.codename)):/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SimpleGrid,{cols:{base:1,xs:2,sm:3,md:4,lg:5,xl:6},spacing:"lg",verticalSpacing:"lg",children:Array.from({length:8}).map((_,idx)=>/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{height:180,radius:"md",animate:true},idx))}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Modal,{opened:null!==selectedGroup,onClose:handleCloseModal,title:selectedGroup?.baseName??"",size:"lg",children:selectedGroup&&/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",children:t("Choisir une m\xe9thode de connexion :")}),selectedGroup.items.map(item=>/*#__PURE__*/(0,jsx_runtime.jsx)(MethodChoiceCard,{item:item,baseName:selectedGroup.baseName,pending:pendingId===item.id,disabled:mutation.isPending,onClick:()=>triggerAdd(item.id)},item.id))]})})]})}var dist_index_js_=__webpack_require__(4259);function ConnectorsApp(){const{t}=(0,es_index_js_.useTranslation)();const tab=(0,dist_index_js_.useRxState)(new URL(location.href).searchParams.get("tab")??"active");const statsResultRes=useStatsQuery();const statsResult=statsResultRes.data;const[tabValue,setTabValue]=(0,index_js_.useState)(tab.value??"active");(0,index_js_.useEffect)(()=>{tab.dispatch(tabValue)},[tabValue]);return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Container,{size:"xl",px:0,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{py:16,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:0,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",mb:0,order:1,children:t("Nos connecteurs")}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{w:"fit-content",mb:0,c:"dimmed",fz:"h5",children:t("Synchronisez vos comptes bancaires et outils comptables facilement.")})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{py:16,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SegmentedControl,{value:tabValue,onChange:setTabValue,radius:"md",size:"lg",data:[{label:t("Connecteurs actifs ({{nombre}})",{nombre:statsResult?statsResult.ok??0:"…"}),value:"active"},{label:t("Connecteurs \xe0 configurer ({{nombre}})",{nombre:statsResult?statsResult.ill??0:"…"}),value:"ill"},{label:t("Les autres connecteurs"),value:"all"}]})}),"active"===tabValue&&/*#__PURE__*/(0,jsx_runtime.jsx)(ListOkComponent,{}),"ill"===tabValue&&/*#__PURE__*/(0,jsx_runtime.jsx)(ListIllComponent,{}),"all"===tabValue&&/*#__PURE__*/(0,jsx_runtime.jsx)(ListCatalogComponent,{})]})}var dist_esm_index_mjs_=__webpack_require__(4449);const theme=(0,index_mjs_.createTheme)((0,dist_esm_index_mjs_.assign)(dist_index_js_.theme,{components:{}}));const cssVarResolver=x=>(0,dist_esm_index_mjs_.assign)(dist_index_js_.cssVarResolver(x),{dark:{},light:{},variables:{}});function Providers(props){const[queryClient]=(0,index_js_.useState)(()=>props.tanstack?.queryClient??new modern_index_js_.QueryClient);const{children,config,mantine}=props;return/*#__PURE__*/(0,jsx_runtime.jsx)(AppConfigProvider,{value:config,children:/*#__PURE__*/(0,jsx_runtime.jsx)(modern_index_js_.QueryClientProvider,{client:queryClient,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.MantineProvider,{theme:theme,cssVariablesResolver:cssVarResolver,defaultColorScheme:mantine?.defaultColorScheme,forceColorScheme:mantine?.forceColorScheme,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(modals_esm_index_mjs_.ModalsProvider,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.Notifications,{}),/*#__PURE__*/(0,jsx_runtime.jsx)(dist_index_js_.RevealTokenProvider,{children:children})]})})})})}(0,locales.o)();function Connectors(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(Providers,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(ConnectorsApp,{})})})}}}]);
1
+ "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["1153"],{9429:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>Connectors});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(8556);var index_mjs_=__webpack_require__(2773);var modern_index_js_=__webpack_require__(7714);var IntegrationsApi=__webpack_require__(6699);const AppConfigCtx=/*#__PURE__*/(0,index_js_.createContext)(null);const AppConfigProvider=AppConfigCtx.Provider;function useAppConfig(){const config=(0,index_js_.useContext)(AppConfigCtx);if(!config)throw new Error("Called `useAppConfig` outside a `<AppConfigProvider />`");return config}function useApi(){const config=useAppConfig();const client=new IntegrationsApi.Qq({baseUrl:config.api.replace(/\/$/,""),baseApiParams:{headers:{Authorization:config.token?`Bearer ${config.token}`:"",From:config.owner}}});return new IntegrationsApi.qx(client)}function useStatsQuery(){const api=useApi();const config=useAppConfig();const query=(0,modern_index_js_.useQuery)({queryKey:["connectors","stats",config.company],queryFn:async()=>await api.connectors.getStatsConnectorsV1({cid:config.company}).then(x=>x.data),staleTime:6e4,refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}function useConnectorsListQuery(){const api=useApi();const config=useAppConfig();const query=(0,modern_index_js_.useQuery)({queryKey:["connectors","list",config.company],queryFn:async()=>await api.connectors.getConnectorsV1({cid:config.company}).then(x=>x.data),staleTime:6e4,refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}var connector_bubble=__webpack_require__(4184);var tabler_icons_react_mjs_=__webpack_require__(5200);var esm_index_mjs_=__webpack_require__(4931);var es_index_js_=__webpack_require__(6155);function useConnectorDeleteMutation(){const{t}=(0,es_index_js_.useTranslation)();const api=useApi();const config=useAppConfig();const queryClient=(0,modern_index_js_.useQueryClient)();return(0,modern_index_js_.useMutation)({mutationFn:async connector=>{const res=await api.connectors.deleteConnectorV1({cid:config.company,connector});return res.data},onSuccess:()=>{queryClient.invalidateQueries({queryKey:["connectors","list",config.company]});queryClient.invalidateQueries({queryKey:["connectors","list","ill",config.company]});queryClient.invalidateQueries({queryKey:["connectors","catalog",config.company]});queryClient.invalidateQueries({queryKey:["connectors","stats",config.company]});queryClient.invalidateQueries({queryKey:["connectors","ok",config.company]});queryClient.invalidateQueries({queryKey:["connectors","ill",config.company]});esm_index_mjs_.notifications.show({color:"green",title:t("Connecteur supprim\xe9"),message:t("Vous pouvez le r\xe9ajouter depuis le catalogue.")})},onError:error=>{console.error(error);esm_index_mjs_.notifications.show({color:"red",title:t("Suppression \xe9chou\xe9e"),message:t("R\xe9essayez dans un instant.")})}})}var locales=__webpack_require__(108);var modals_esm_index_mjs_=__webpack_require__(4403);function isDeleteConfirmInput(input){return"DELETE"===input}function DeleteActiveBody({name,onConfirm}){const{t}=(0,es_index_js_.useTranslation)();const[input,setInput]=(0,index_js_.useState)("");const isMatch=isDeleteConfirmInput(input);const handleConfirm=()=>{if(!isMatch)return;onConfirm();modals_esm_index_mjs_.modals.closeAll()};return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:/*#__PURE__*/(0,jsx_runtime.jsx)(es_index_js_.Trans,{i18nKey:"Le connecteur <1>{{nom}}</1> est actuellement actif. Sa suppression arr\xeatera la synchronisation et le retirera de la liste. Vous pourrez le r\xe9ajouter depuis le catalogue plus tard.",values:{nom:name},components:{1:/*#__PURE__*/(0,jsx_runtime.jsx)("strong",{})}})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:/*#__PURE__*/(0,jsx_runtime.jsx)(es_index_js_.Trans,{i18nKey:"Pour confirmer, tapez <1>DELETE</1> ci-dessous.",components:{1:/*#__PURE__*/(0,jsx_runtime.jsx)("strong",{})}})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{value:input,onChange:e=>setInput(e.currentTarget.value),placeholder:"DELETE",autoFocus:true,onKeyDown:e=>{if("Enter"===e.key)handleConfirm()}}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"flex-end",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"default",onClick:()=>modals_esm_index_mjs_.modals.closeAll(),children:t("Annuler")}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{color:"red",disabled:!isMatch,onClick:handleConfirm,children:t("Supprimer")})]})]})}function openDeleteActiveConnectorModal(name,onConfirm){modals_esm_index_mjs_.modals.open({title:(0,locales.tr)("Supprimer ce connecteur ?"),centered:true,children:/*#__PURE__*/(0,jsx_runtime.jsx)(DeleteActiveBody,{name:name,onConfirm:onConfirm})})}function ConnectorMenu({connectorId,connectorName,isActive}){const{t}=(0,es_index_js_.useTranslation)();const{mutate,isPending}=useConnectorDeleteMutation();const handleDelete=()=>{if(isActive)openDeleteActiveConnectorModal(connectorName,()=>mutate(connectorId));else mutate(connectorId)};const stopBubble=e=>{e.stopPropagation();e.preventDefault()};return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Menu,{position:"bottom-end",withinPortal:true,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Menu.Target,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.ActionIcon,{variant:"subtle",color:"gray","aria-label":t("Actions du connecteur"),onClick:stopBubble,children:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconDots,{size:18})})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Menu.Dropdown,{onClick:stopBubble,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Menu.Item,{color:"red",leftSection:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconTrash,{size:16}),onClick:handleDelete,disabled:isPending,children:t("Supprimer")})})]})}function ListOkComponent(){const{t}=(0,es_index_js_.useTranslation)();const config=useAppConfig();const listResultRes=useConnectorsListQuery();const listResult=listResultRes.data;return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",mb:0,order:2,children:t("Tous vos connecteurs en marche")}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SimpleGrid,{cols:{base:1,xs:2,sm:3,md:4,lg:5,xl:6},spacing:"lg",verticalSpacing:"lg",style:{alignItems:"stretch"},children:listResult?.list?.map((connector,idx)=>connector?.main_connectorlist?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Card,{pos:"relative",style:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Anchor,{underline:"never",href:`/company/${config.company}/integrations/${connector.id}/connector`,children:/*#__PURE__*/(0,jsx_runtime.jsx)(connector_bubble.q,{connector:connector})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Box,{pos:"absolute",top:8,right:8,children:/*#__PURE__*/(0,jsx_runtime.jsx)(ConnectorMenu,{connectorId:connector.id,connectorName:connector.name,isActive:true})})]},idx):/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{radius:"md",animate:true},idx))})]})}function useConnectorsIllListQuery(){const api=useApi();const config=useAppConfig();const query=(0,modern_index_js_.useQuery)({queryKey:["connectors","list","ill",config.company],queryFn:async()=>await api.connectors.getIllConnectorsV1({cid:config.company}).then(x=>x.data),staleTime:6e4,refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}function ListIllComponent(){const{t}=(0,es_index_js_.useTranslation)();const config=useAppConfig();const listResultRes=useConnectorsIllListQuery();const listResult=listResultRes.data;return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",mb:0,order:2,children:t("Tous vos connecteurs \xe0 configurer")}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SimpleGrid,{cols:{base:1,xs:2,sm:3,md:4,lg:5,xl:6},spacing:"lg",verticalSpacing:"lg",style:{alignItems:"stretch"},children:listResult?.list?.map((connector,idx)=>connector?.main_connectorlist?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Card,{pos:"relative",style:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Anchor,{underline:"never",href:`/company/${config.company}/integrations/${connector.id}/connector`,children:/*#__PURE__*/(0,jsx_runtime.jsx)(connector_bubble.q,{connector:connector})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Box,{pos:"absolute",top:8,right:8,children:/*#__PURE__*/(0,jsx_runtime.jsx)(ConnectorMenu,{connectorId:connector.id,connectorName:connector.name,isActive:false})})]},idx):/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{radius:"md",animate:true},idx))})]})}function useConnectorAddMutation(){const api=useApi();const config=useAppConfig();const queryClient=(0,modern_index_js_.useQueryClient)();return(0,modern_index_js_.useMutation)({mutationFn:async connector_id=>{const res=await api.connectors.addConnectorV1({cid:config.company},{connector_id});return res.data},onSuccess:()=>{queryClient.invalidateQueries({queryKey:["connectors","catalog",config.company]});queryClient.invalidateQueries({queryKey:["connectors","list",config.company]});queryClient.invalidateQueries({queryKey:["connectors","list","ill",config.company]});queryClient.invalidateQueries({queryKey:["connectors","stats",config.company]});queryClient.invalidateQueries({queryKey:["connectors","ok",config.company]});queryClient.invalidateQueries({queryKey:["connectors","ill",config.company]})}})}function useConnectorCatalogQuery(){const api=useApi();const config=useAppConfig();const query=(0,modern_index_js_.useQuery)({queryKey:["connectors","catalog",config.company],queryFn:async()=>await api.connectors.getCatalogConnectorsV1({cid:config.company}).then(x=>x.data),refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}var connectorLogoUrl=__webpack_require__(8753);function CollapsibleGroup({title,count,collapsed,onToggle,children}){return/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.UnstyledButton,{onClick:onToggle,style:{width:"100%",padding:"8px 12px"},children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"xs",children:[collapsed?/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconChevronRight,{size:16}):/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconChevronDown,{size:16}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,children:title}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{c:"dimmed",children:["(",count,")"]})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Collapse,{in:!collapsed,children:children})]})}const KEY=userId=>`connectors-expanded-groups:${userId}`;function useCollapsedGroups(userId,_allGroupKeys){const[expanded,setExpanded]=(0,index_js_.useState)(()=>{const raw=localStorage.getItem(KEY(userId));if(raw)try{return new Set(JSON.parse(raw))}catch{}return new Set});(0,index_js_.useEffect)(()=>{localStorage.setItem(KEY(userId),JSON.stringify([...expanded]))},[userId,expanded]);const toggle=(0,index_js_.useCallback)(key=>{setExpanded(prev=>{const next=new Set(prev);if(next.has(key))next.delete(key);else next.add(key);return next})},[]);const isCollapsed=(0,index_js_.useCallback)(key=>!expanded.has(key),[expanded]);return{isCollapsed,toggle}}function normalize(value){return(value??"").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"")}function getBaseName(name){return name.replace(/\s+via\s+.+$/i,"").trim()}function getMethodSuffix(name,baseName){return name.length>baseName.length?name.slice(baseName.length).trim():name}function GroupCard({group,pending}){const{t}=(0,es_index_js_.useTranslation)();const{colorScheme}=(0,index_mjs_.useMantineColorScheme)();const bg="dark"===colorScheme?"white":"dark";const first=group.items[0];const logoUrl=(0,connectorLogoUrl.U)({codename:group.codename,logo_key:group.logoKey});return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Card,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"space-between",align:"flex-start",children:[pending?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Loader,{size:64}):/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Avatar,{src:logoUrl,size:64,radius:"md",bg:bg,color:"dark"===colorScheme?"black":"white",p:18}),group.items.length>1&&/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Badge,{variant:"light",color:"blue",children:t("{{count}} m\xe9thode",{count:group.items.length})})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",order:3,children:group.baseName}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",size:"lg",lineClamp:3,children:first.description_fr?t(first.description_fr):null})]})})}function MethodChoiceCard({item,baseName,pending,disabled,onClick}){const{t}=(0,es_index_js_.useTranslation)();const suffix=getMethodSuffix(item.name,baseName);return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Card,{style:{cursor:disabled?"wait":"pointer",opacity:disabled&&!pending?.5:1},onClick:()=>{if(!disabled)onClick()},children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"space-between",align:"center",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:4,style:{flex:1},children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"xs",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,children:suffix||item.name}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Badge,{variant:"light",color:"gray",children:item.sharing_method})]}),item.description_fr&&/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",size:"sm",lineClamp:2,children:t(item.description_fr)})]}),pending&&/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Loader,{size:"sm"})]})})}function ListCatalogComponent(){const{t}=(0,es_index_js_.useTranslation)();const config=useAppConfig();const result=useConnectorCatalogQuery();const list=result.data?.list;const[searchValue,setSearchValue]=(0,index_js_.useState)("");const[pendingId,setPendingId]=(0,index_js_.useState)(null);const[selectedGroup,setSelectedGroup]=(0,index_js_.useState)(null);const[hoveredGroupKey,setHoveredGroupKey]=(0,index_js_.useState)(null);const mutation=useConnectorAddMutation();const filtered=(0,index_js_.useMemo)(()=>{if(!list)return;const q=normalize(searchValue);if(!q)return list;return list.filter(item=>{const source=item.description_fr??"";const traduite=source?t(source):"";return normalize(`${item.name} ${source} ${traduite}`).includes(q)})},[list,searchValue,t]);const sections=(0,index_js_.useMemo)(()=>{if(!filtered)return;const groups=new Map;for(const item of filtered){const baseName=getBaseName(item.name);const groupKey=`${item.logo_key??item.codename}::${baseName}`;if(!groups.has(groupKey))groups.set(groupKey,{groupKey,baseName,type:item.type,codename:item.codename,logoKey:item.logo_key,items:[]});groups.get(groupKey).items.push(item)}const byCategory=new Map;for(const group of groups.values()){const k=group.type.codename;if(!byCategory.has(k))byCategory.set(k,{type:group.type,groups:[]});byCategory.get(k).groups.push(group)}return Array.from(byCategory.values())},[filtered]);const sectionKeys=(0,index_js_.useMemo)(()=>(sections??[]).map(s=>s.type.codename),[sections]);const{isCollapsed,toggle}=useCollapsedGroups(`catalog:${config.owner}`,sectionKeys);const triggerAdd=id=>{setPendingId(id);mutation.mutate(id,{onSuccess:data=>{window.location.href=`/company/${config.company}/integrations/${data.id}/connector`},onError:()=>{setPendingId(null)}})};const handleGroupClick=group=>{if(mutation.isPending)return;if(1===group.items.length)triggerAdd(group.items[0].id);else setSelectedGroup(group)};const handleCloseModal=()=>{if(mutation.isPending)return;setSelectedGroup(null);setPendingId(null)};return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{placeholder:t("Rechercher un connecteur..."),leftSection:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconSearch,{size:16}),value:searchValue,onChange:e=>setSearchValue(e.currentTarget.value),size:"md"}),sections?sections.map(section=>/*#__PURE__*/(0,jsx_runtime.jsx)(CollapsibleGroup,{title:t(section.type.name),count:section.groups.length,collapsed:isCollapsed(section.type.codename),onToggle:()=>toggle(section.type.codename),children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SimpleGrid,{cols:{base:1,xs:2,sm:3,md:4,lg:5,xl:6},spacing:"lg",verticalSpacing:"lg",style:{alignItems:"stretch"},children:section.groups.map(group=>{const isSinglePending=1===group.items.length&&pendingId===group.items[0].id;const isHovered=hoveredGroupKey===group.groupKey&&!mutation.isPending;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Card,{withBorder:true,style:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between",cursor:mutation.isPending?"wait":"pointer",opacity:mutation.isPending&&!isSinglePending?.5:1,borderColor:isHovered?"var(--mantine-color-green-5)":void 0,backgroundColor:isHovered?"var(--mantine-color-green-0)":void 0,transition:"border-color 120ms ease, background-color 120ms ease",position:"relative"},onMouseEnter:()=>setHoveredGroupKey(group.groupKey),onMouseLeave:()=>setHoveredGroupKey(null),onClick:()=>handleGroupClick(group),children:[isHovered&&/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Badge,{variant:"filled",color:"green",style:{position:"absolute",top:8,right:8,zIndex:1},children:t("Configurer →")}),/*#__PURE__*/(0,jsx_runtime.jsx)(GroupCard,{group:group,pending:isSinglePending})]},group.groupKey)})})},section.type.codename)):/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SimpleGrid,{cols:{base:1,xs:2,sm:3,md:4,lg:5,xl:6},spacing:"lg",verticalSpacing:"lg",children:Array.from({length:8}).map((_,idx)=>/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{height:180,radius:"md",animate:true},idx))}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Modal,{opened:null!==selectedGroup,onClose:handleCloseModal,title:selectedGroup?.baseName??"",size:"lg",children:selectedGroup&&/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",children:t("Choisir une m\xe9thode de connexion :")}),selectedGroup.items.map(item=>/*#__PURE__*/(0,jsx_runtime.jsx)(MethodChoiceCard,{item:item,baseName:selectedGroup.baseName,pending:pendingId===item.id,disabled:mutation.isPending,onClick:()=>triggerAdd(item.id)},item.id))]})})]})}var dist_index_js_=__webpack_require__(4259);function ConnectorsApp(){const{t}=(0,es_index_js_.useTranslation)();const tab=(0,dist_index_js_.useRxState)(new URL(location.href).searchParams.get("tab")??"active");const statsResultRes=useStatsQuery();const statsResult=statsResultRes.data;const[tabValue,setTabValue]=(0,index_js_.useState)(tab.value??"active");(0,index_js_.useEffect)(()=>{tab.dispatch(tabValue)},[tabValue]);return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Container,{size:"xl",px:0,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{py:16,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:0,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",mb:0,order:1,children:t("Nos connecteurs")}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{w:"fit-content",mb:0,c:"dimmed",fz:"h5",children:t("Synchronisez vos comptes bancaires et outils comptables facilement.")})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{py:16,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SegmentedControl,{value:tabValue,onChange:setTabValue,radius:"md",size:"lg",data:[{label:t("Connecteurs actifs ({{nombre}})",{nombre:statsResult?statsResult.ok??0:"…"}),value:"active"},{label:t("Connecteurs \xe0 configurer ({{nombre}})",{nombre:statsResult?statsResult.ill??0:"…"}),value:"ill"},{label:t("Les autres connecteurs"),value:"all"}]})}),"active"===tabValue&&/*#__PURE__*/(0,jsx_runtime.jsx)(ListOkComponent,{}),"ill"===tabValue&&/*#__PURE__*/(0,jsx_runtime.jsx)(ListIllComponent,{}),"all"===tabValue&&/*#__PURE__*/(0,jsx_runtime.jsx)(ListCatalogComponent,{})]})}var dist_esm_index_mjs_=__webpack_require__(4449);const theme=(0,index_mjs_.createTheme)((0,dist_esm_index_mjs_.assign)(dist_index_js_.theme,{components:{}}));const cssVarResolver=x=>(0,dist_esm_index_mjs_.assign)(dist_index_js_.cssVarResolver(x),{dark:{},light:{},variables:{}});function Providers(props){const[queryClient]=(0,index_js_.useState)(()=>props.tanstack?.queryClient??new modern_index_js_.QueryClient);const{children,config,mantine}=props;return/*#__PURE__*/(0,jsx_runtime.jsx)(AppConfigProvider,{value:config,children:/*#__PURE__*/(0,jsx_runtime.jsx)(modern_index_js_.QueryClientProvider,{client:queryClient,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.MantineProvider,{theme:theme,cssVariablesResolver:cssVarResolver,defaultColorScheme:mantine?.defaultColorScheme,forceColorScheme:mantine?.forceColorScheme,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(modals_esm_index_mjs_.ModalsProvider,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.Notifications,{}),/*#__PURE__*/(0,jsx_runtime.jsx)(dist_index_js_.RevealTokenProvider,{children:children})]})})})})}(0,locales.o)();function Connectors(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(Providers,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(ConnectorsApp,{})})})}}}]);
@@ -1 +1 @@
1
- "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["4821"],{466:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>SingleConnector});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(8556);var single_connector_app=__webpack_require__(545);var dist_index_js_=__webpack_require__(4259);var index_mjs_=__webpack_require__(2773);var esm_index_mjs_=__webpack_require__(4931);var modern_index_js_=__webpack_require__(7714);var dist_esm_index_mjs_=__webpack_require__(4449);var useAppConfigConnectorSingle=__webpack_require__(4613);const theme=(0,index_mjs_.createTheme)((0,dist_esm_index_mjs_.assign)(dist_index_js_.theme,{components:{}}));const cssVarResolver=x=>(0,dist_esm_index_mjs_.assign)(dist_index_js_.cssVarResolver(x),{dark:{},light:{},variables:{}});function ProvidersSingleConnector(props){const[queryClient]=(0,index_js_.useState)(()=>props.tanstack?.queryClient??new modern_index_js_.QueryClient);const{children,config,mantine,tanstack}=props;return/*#__PURE__*/(0,jsx_runtime.jsx)(useAppConfigConnectorSingle.a,{value:config,children:/*#__PURE__*/(0,jsx_runtime.jsx)(modern_index_js_.QueryClientProvider,{client:queryClient,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.MantineProvider,{theme:theme,cssVariablesResolver:cssVarResolver,defaultColorScheme:mantine?.defaultColorScheme,forceColorScheme:mantine?.forceColorScheme,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.Notifications,{}),/*#__PURE__*/(0,jsx_runtime.jsx)(dist_index_js_.RevealTokenProvider,{children:children})]})})})}var locales=__webpack_require__(108);(0,locales.o)();function SingleConnector(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(ProvidersSingleConnector,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(single_connector_app.d,{})})})}},4613:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{C:()=>useAppConfigConnectorSingle,a:()=>AppConfigConnectorSingleProvider});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(8556);const AppConfigCtx=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);const AppConfigConnectorSingleProvider=AppConfigCtx.Provider;function useAppConfigConnectorSingle(){const config=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(AppConfigCtx);if(!config)throw new Error("Called `useAppConfig` outside a `<AppConfigConnectorSingleProvider />`");return config}}}]);
1
+ "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["4821"],{466:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>SingleConnector});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(8556);var single_connector_app=__webpack_require__(5477);var dist_index_js_=__webpack_require__(4259);var index_mjs_=__webpack_require__(2773);var esm_index_mjs_=__webpack_require__(4931);var modern_index_js_=__webpack_require__(7714);var dist_esm_index_mjs_=__webpack_require__(4449);var useAppConfigConnectorSingle=__webpack_require__(4613);const theme=(0,index_mjs_.createTheme)((0,dist_esm_index_mjs_.assign)(dist_index_js_.theme,{components:{}}));const cssVarResolver=x=>(0,dist_esm_index_mjs_.assign)(dist_index_js_.cssVarResolver(x),{dark:{},light:{},variables:{}});function ProvidersSingleConnector(props){const[queryClient]=(0,index_js_.useState)(()=>props.tanstack?.queryClient??new modern_index_js_.QueryClient);const{children,config,mantine,tanstack}=props;return/*#__PURE__*/(0,jsx_runtime.jsx)(useAppConfigConnectorSingle.a,{value:config,children:/*#__PURE__*/(0,jsx_runtime.jsx)(modern_index_js_.QueryClientProvider,{client:queryClient,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.MantineProvider,{theme:theme,cssVariablesResolver:cssVarResolver,defaultColorScheme:mantine?.defaultColorScheme,forceColorScheme:mantine?.forceColorScheme,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.Notifications,{}),/*#__PURE__*/(0,jsx_runtime.jsx)(dist_index_js_.RevealTokenProvider,{children:children})]})})})}var locales=__webpack_require__(108);(0,locales.o)();function SingleConnector(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(ProvidersSingleConnector,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(single_connector_app.d,{})})})}},4613:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{C:()=>useAppConfigConnectorSingle,a:()=>AppConfigConnectorSingleProvider});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(8556);const AppConfigCtx=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);const AppConfigConnectorSingleProvider=AppConfigCtx.Provider;function useAppConfigConnectorSingle(){const config=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(AppConfigCtx);if(!config)throw new Error("Called `useAppConfig` outside a `<AppConfigConnectorSingleProvider />`");return config}}}]);