widget-chatbot 1.0.5 → 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -77
- package/dist/index.d.ts +24 -35
- package/dist/vite.svg +1 -0
- package/dist/widget-chatbot.cjs.js +1 -0
- package/dist/widget-chatbot.css +1 -0
- package/dist/widget-chatbot.es.js +3614 -0
- package/dist/widget-chatbot.umd.js +1 -0
- package/package.json +52 -200
- package/LICENSE +0 -177
- package/dist/index.js +0 -1
package/README.md
CHANGED
|
@@ -1,77 +1,84 @@
|
|
|
1
|
-
### Built With
|
|
2
|
-
|
|
3
|
-
-
|
|
4
|
-
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
### Requirements
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
##
|
|
19
|
-
|
|
20
|
-
```sh
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
[
|
|
73
|
-
|
|
74
|
-
[
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
1
|
+
### Built With
|
|
2
|
+
|
|
3
|
+
- [![React][react.js]][react-url]
|
|
4
|
+
- [![Socket-io][socket-io-img]][socket-io-url]
|
|
5
|
+
- [![Chart.js][chart.js-img]][chart.js-url]
|
|
6
|
+
|
|
7
|
+
### Requirements
|
|
8
|
+
|
|
9
|
+
- react : >=^17.0.2
|
|
10
|
+
- react-dom : >=^17.0.2
|
|
11
|
+
- @emoji-mart/react
|
|
12
|
+
- @ant-design/plots
|
|
13
|
+
- antd
|
|
14
|
+
- axios
|
|
15
|
+
- react-markdown
|
|
16
|
+
- remark-gfm
|
|
17
|
+
|
|
18
|
+
## Getting Started
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm i widget-chatbot
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
import Widget from 'widget-chatbot';
|
|
28
|
+
import { createBrowserHistory } from 'history';
|
|
29
|
+
import 'widget-chatbot/dist/widget-chatbot.css';
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
const history = createBrowserHistory();
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
const App = ()=>{
|
|
36
|
+
const initPayload = {
|
|
37
|
+
access_token: 'jwt token',
|
|
38
|
+
refresh_token: 'refresh token',
|
|
39
|
+
uagent: window.navigator.userAgent,
|
|
40
|
+
uriBackend: 'uri backend',
|
|
41
|
+
uriService: 'uri open ai service chatbot',
|
|
42
|
+
companyid: 'coid',
|
|
43
|
+
companycode:'companycode',
|
|
44
|
+
lang:'EN',
|
|
45
|
+
uriBackendEnt: 'uri backend go',
|
|
46
|
+
uriBackendHRMGO: 'uri backend hrm go',
|
|
47
|
+
config: cookies?.CHATBOT?.config,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const textSayHiAndGetStarted = 'Hi and get started';
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<Widget
|
|
55
|
+
getStartedPayload={getInitPayload()}
|
|
56
|
+
history={history}
|
|
57
|
+
keyEncrypt={keyEncrypt}
|
|
58
|
+
onPayslipFn={{
|
|
59
|
+
onCheckPYAccess,
|
|
60
|
+
onSubmitPYPwd,
|
|
61
|
+
}}
|
|
62
|
+
socketPath={socketPath || ''}
|
|
63
|
+
socketURL={socketUrl}
|
|
64
|
+
subTitle={textSayHiAndGetStarted}
|
|
65
|
+
title={textSunfishAssistantTitle}
|
|
66
|
+
isSF
|
|
67
|
+
/>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## [Click this for Publish Process](./publish_process/README.md)
|
|
73
|
+
|
|
74
|
+
<!-- Read [This](./publish_process/README.md) -->
|
|
75
|
+
|
|
76
|
+
<!-- MARKDOWN LINKS & IMAGES -->
|
|
77
|
+
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
|
|
78
|
+
|
|
79
|
+
[react.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB
|
|
80
|
+
[react-url]: https://reactjs.org/
|
|
81
|
+
[socket-io-url]: https://socket.io/
|
|
82
|
+
[socket-io-img]: https://img.shields.io/badge/Socket-io?logo=socketdotio&label=Socket.io
|
|
83
|
+
[chart.js-url]: https://www.chartjs.org/
|
|
84
|
+
[chart.js-img]: https://img.shields.io/badge/Chart-js?logo=chartdotjs&logoColor=%23FF6384&label=Chart.js&labelColor=white&color=%23FF6384
|
package/dist/index.d.ts
CHANGED
|
@@ -1,36 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const closeImage: string;
|
|
26
|
-
const docViewer: boolean;
|
|
27
|
-
const customComponent: () => void;
|
|
28
|
-
const displayUnreadCount: boolean;
|
|
29
|
-
const showMessageDate: any;
|
|
30
|
-
const customMessageDelay: () => void;
|
|
31
|
-
const tooltipPayload: string;
|
|
32
|
-
const tooltipDelay: number;
|
|
33
|
-
const withRules: boolean;
|
|
34
|
-
const rules: any;
|
|
35
|
-
const triggerEventListenerUpdateRate: number;
|
|
1
|
+
import { Axios } from "axios";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
declare module "widget-chatbot" {
|
|
5
|
+
type PayslipFn = {
|
|
6
|
+
onSubmitPYPwd: () => Axios;
|
|
7
|
+
onCheckPYAccess: () => void;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type WidgetChatbotProps = {
|
|
11
|
+
getStartedPayload: string;
|
|
12
|
+
socketURL: string;
|
|
13
|
+
socketPath: string;
|
|
14
|
+
onPayslipFn: PayslipFn;
|
|
15
|
+
title: string;
|
|
16
|
+
subTitle: string;
|
|
17
|
+
keyEncrypt: string;
|
|
18
|
+
history: Object;
|
|
19
|
+
isSF?: boolean;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const WidgetChatbot: (props: WidgetChatbotProps) => ReactNode;
|
|
23
|
+
|
|
24
|
+
export default WidgetChatbot;
|
|
36
25
|
}
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),q=require("axios"),l=require("react"),V=require("dayjs"),x=require("antd"),sn=require("socket.io-client"),on=require("react-markdown"),cn=require("remark-gfm"),ln=require("react-syntax-highlighter"),rn=require("@ant-design/icons"),an=require("@ant-design/plots"),ee=require("crypto-js"),dn=require("@emoji-mart/react"),un="2.0.0-alpha.1",Re="chat_session",xn="user_uttered",fn="bot_uttered",gn="ehelp_bot_uttered",mn="https://sfchatbot.dataon.com",Cn=[{label:"Didn’t address my question",value:"Didn’t address my question"},{label:"Inaccurate Answer",value:"Inaccurate Answer"},{label:"The response unclear",value:"The response unclear"},{label:"The information is incomplete",value:"The information is incomplete"},{label:"I’d like to explain further",value:"another"}],se=x.version,oe=l.version,Tn=un,yn="https://sfchatbot.dataon.com/openai-service-dev/",xe="https://res.cloudinary.com/dcvolkyfb/image/upload/v1740135794/svg/bot_profile_hlnyop.png",je="YYYY-MM-DD",fe="HH:mm",De="N/A",Ce=[".jpg",".jpeg",".png",".gif",".bmp",".tiff",".tif",".webp",".heif",".heic",".jp2",".ico",".dds",".raw",".cr2",".nef",".arw",".orf",".psd",".xcf"],Te="w-widget-content-container",ye="w-ticket-detail-content-container",bn="w-wrapper-body",hn="w-wrapper-body-helpdesk",le="w-header",be={FADE_IN:"w-fade-in-animate"},jn="https://placehold.co/600x400?text=No+Image",re=3,Sn="GoHRDev2025WorkPlazeDataOnDotCom",ne="(Helpdesk Widget Chatbot)",kn=e=>JSON.parse((e==null?void 0:e.replaceAll("/get_started",""))||"{}"),Fe=e=>{var t;try{return(t=new URL(e))==null?void 0:t.host}catch{return Fe(mn)}},G=(e,t)=>{var s,o,r;return((s=Object.keys(e||{}))==null?void 0:s.length)>0?(r=(o=Object==null?void 0:Object.prototype)==null?void 0:o.hasOwnProperty)==null?void 0:r.call(e,t):!1},te=e=>{var s;const t=e==null?void 0:e.attachment;return{text:((s=Object.keys(e||{}))==null?void 0:s.length)>0&&(e==null?void 0:e.type)==="text",upload:G(e,"attachment")&&G(t,"type")&&(t==null?void 0:t.type)==="fileuploader",password:(t==null?void 0:t.type)==="show_password_wp",filedownload:G(t,"type")&&(t==null?void 0:t.type)==="filedownloader",chart:(t==null?void 0:t.type)==="charts"&&G(t,"chartType")}},Ne=e=>{var t,s,o,r;if(e){const i=e==null?void 0:e.split(".")[1],c=(t=i==null?void 0:i.replace(/-/g,"+"))==null?void 0:t.replace(/_/g,"/"),a=decodeURIComponent((r=(o=(s=window==null?void 0:window.atob(c))==null?void 0:s.split(""))==null?void 0:o.map(d=>"%"+("00"+d.charCodeAt(0).toString(16)).slice(-2)))==null?void 0:r.join(""));return JSON==null?void 0:JSON.parse(a||"{}")}return{}},Se=({downloadURL:e="",fileName:t="",isOpenNewTab:s=!1})=>{var r;const o=document==null?void 0:document.createElement("a");o.href=e,o.download=t||e,s&&(o.target="_blank"),(r=document==null?void 0:document.body)==null||r.appendChild(o),o.click(),document.body.removeChild(o)},En=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=crypto.getRandomValues(new Uint8Array(1))[0]%16;return(e==="x"?t:t&3|8).toString(16)}),ke=({ArrObj:e,key:t,ignoreCaseSensitive:s=!1})=>(e==null?void 0:e.length)>0?[...new Map(e.map(o=>{var r;return[s?(r=String(o[t]))==null?void 0:r.toLowerCase():o[t],o]})).values()]:[],An=(e=[])=>{const t={},s=[],o=[];e==null||e.forEach(i=>{var c;G(i,"chats")?(c=i==null?void 0:i.chats)==null||c.forEach(a=>{o==null||o.push(a)}):o==null||o.push(i)}),o==null||o.forEach((i,c)=>{var d,u,g;const a=i==null?void 0:i.generated_id;a?(t[a]||(t[a]=[]),(u=t[a])==null||u.push({...i,indexChat:c,...!(i!=null&&i.timestamp)&&{timestamp:(d=V())==null?void 0:d.format("hh:mm A")}}),s==null||s.push({keyItem:a??c,type:"text",sender:"response",...a&&{generated_id:a},chats:t==null?void 0:t[a]})):s==null||s.push({...i,keyItem:c,...!(i!=null&&i.timestamp)&&{timestamp:(g=V())==null?void 0:g.format("hh:mm A")}})});const r=ke({ArrObj:s,key:"keyItem"});return r==null||r.forEach(i=>{i==null||delete i.keyItem}),r},ge=(e={})=>{const s={...He(),...e};localStorage==null||localStorage.setItem(Re,JSON.stringify(s||{}))},He=()=>{const e=localStorage==null?void 0:localStorage.getItem(Re);return JSON.parse(e||"{}")},wn=(e="")=>{var t;try{const s=new URL(e);return(t=s==null?void 0:s.protocol)!=null&&t.includes("https")?"wss":"ws"}catch{return"wss"}};let Me=null;const Q=(e=".w-wrapper-body")=>{const t=document.querySelector(e);clearTimeout(Me),Me=setTimeout(()=>{t&&t.scrollTo({top:t.scrollHeight,behavior:"smooth"})},0)},pn=e=>{const t=new Uint8Array(e);let s="";for(let o=0;o<t.byteLength;o++)s+=String.fromCharCode(t[o]);return btoa(s)},Ln=async(e,t)=>{var d;const s=typeof e=="object"?JSON==null?void 0:JSON.stringify(e||{}):e,o=new TextEncoder,r=o==null?void 0:o.encode(s),i=o==null?void 0:o.encode(t);if(i.length!==32)throw new Error("Key length must be 32 bytes for AES-256");const c=await((d=crypto==null?void 0:crypto.subtle)==null?void 0:d.importKey("raw",i,{name:"AES-CBC"},!1,["encrypt"])),a=await crypto.subtle.encrypt({name:"AES-CBC",iv:new Uint8Array(16)},c,r);return pn(a)},ue=e=>{const t={},s=Be(e),o=s==null?void 0:s.map(r=>{var c;const i=r==null?void 0:r.CREATED_DATE;return{...r,DATE_KEY:(c=V(i))==null?void 0:c.format("YYYY-MM-DD")}});return o==null||o.forEach(r=>{var i;t[r==null?void 0:r.DATE_KEY]||(t[r==null?void 0:r.DATE_KEY]=[]),(i=t[r==null?void 0:r.DATE_KEY])==null||i.push(r)}),t},Ee=e=>{var t;return(t=Object.values(e||{}))==null?void 0:t.flat()},Be=e=>e==null?void 0:e.sort((t,s)=>V(t==null?void 0:t.CREATED_DATE)-V(s==null?void 0:s.CREATED_DATE)),Ie=e=>{if(e&&typeof e=="string"){const t=e==null?void 0:e.split("."),s=t[(t==null?void 0:t.length)-1];return e==null?void 0:e.replaceAll(`.${s}`,`_avatar.${s}`)}return e},Ae=e=>`https://ui-avatars.com/api/?background=e5e5e5&color=000${e&&typeof e=="string"?`&name=${e.replaceAll(" ","+")}`:""}`,$e=l.createContext({}),R=()=>l.useContext($e),vn=({children:e,getStartedPayload:t,socketURL:s,socketPath:o,onPayslipFn:r,title:i,subTitle:c,keyEncrypt:a,history:d,isSF:u})=>{const[g,T]=l.useState(!1),[y,b]=l.useState("va"),[h,A]=l.useState(!1),[E,k]=l.useState({}),[m,f]=l.useState(!1),[C,j]=l.useState(!1),p=l.useRef(!1),L=l.useMemo(()=>({getStartedPayload:t,socketURL:s,socketPath:o,onPayslipFn:r,title:i,subTitle:c,keyEncrypt:a,isSF:u}),[t,s,o,r,i,c,a,u]),_=l.useMemo(()=>Ne(E==null?void 0:E.access_token),[E==null?void 0:E.access_token]);return l.useEffect(()=>{k(kn(t))},[t]),l.useEffect(()=>{ge({chatbot_version:Tn})},[]),n.jsx($e.Provider,{value:{objInitPayload:E,setOpenWidget:T,isOpenWidget:g,activeTab:y,setActiveTab:b,isExpand:h,setExpand:A,setObjInitPayload:k,parsedJWT:_,widgetProps:L,isFirstOpenWidget:m,setFirstOpenWidget:f,isFirstRenderHelpdesk:p,history:d,showReadyWSHD:C,setShowReadyWSHD:j},children:e})},Ue=l.createContext({}),_n=()=>l.useContext(Ue),Dn=({children:e})=>{const{objInitPayload:t}=R(),[s,o]=l.useState({}),r=()=>{var c;(c=q(`${(t==null?void 0:t.uriService)||yn}optional/translations`))==null||c.then(({data:a})=>{var d;if(a){const u=Object.keys((d=Object.values(a))==null?void 0:d[0]),g={};u==null||u.forEach(T=>{var y;(y=Object.keys(a))==null||y.forEach(b=>{var h;g[T==null?void 0:T.toLowerCase()]=(h=a==null?void 0:a[b])==null?void 0:h[T]})}),o(g)}})},i=()=>{const c=window.indexedDB.open("language");c.onsuccess=a=>{var u;const d=a.target.result;try{const T=d.transaction("keyvaluepairs","readonly").objectStore("keyvaluepairs"),y=T==null?void 0:T.get((u=t==null?void 0:t.lang)==null?void 0:u.toLowerCase());y.onsuccess=()=>{o(y==null?void 0:y.result)},y.onerror=()=>{r()}}catch{r()}},c.onerror=()=>{r()}};return l.useEffect(()=>{i()},[t==null?void 0:t.uriService,t==null?void 0:t.lang]),n.jsx(Ue.Provider,{value:{langDatas:s},children:e})},We=l.createContext({}),z=()=>l.useContext(We),Mn=({children:e})=>{var M;const[t,s]=l.useState([]),[o,r]=l.useState(!1),[i,c]=l.useState(!1),[a,d]=l.useState({}),[u,g]=l.useState(!1),[T,y]=l.useState(!1),{objInitPayload:b,widgetProps:h,setOpenWidget:A,setFirstOpenWidget:E,isFirstRenderHelpdesk:k}=R(),m=l.useRef(null),f=l.useRef(""),C=l.useRef(""),j=w=>{const v=G(w,"text_feedback_link")&&G(w,"text");s(H=>{const D=[...H,{...w,...v&&{type:"text"},sender:"response"}];return An(D)}),r(!1),c(!1),Q()},p=()=>{var w,v,H,D;(w=m==null?void 0:m.current)==null||w.emit("session_request",{session_id:null}),(v=m==null?void 0:m.current)==null||v.on("session_confirm",O=>{f.current=O,ge({session_id:O==null?void 0:O.session_id})}),(H=m==null?void 0:m.current)==null||H.on(fn,j),(D=m==null?void 0:m.current)==null||D.on(gn,O=>{const B=JSON.parse(O||"{}");G(B,"iswidget")&&y(B==null?void 0:B.iswidget)}),u||g(!0),E(!1)},L=({msg:w,additionalConfig:v={},isShowLoadingResponse:H=!0})=>{var D;(D=m==null?void 0:m.current)==null||D.emit(xn,{customData:{language:b==null?void 0:b.lang},message:w,session_id:f==null?void 0:f.current,...v}),H?r(!0):c(!0)},_=()=>{var v,H;m.current&&((v=m==null?void 0:m.current)==null||v.off(),(H=m==null?void 0:m.current)==null||H.disconnect(),m.current=null),k.current=!1;const w=sn.io(`${wn(h==null?void 0:h.socketURL)}://${Fe(h==null?void 0:h.socketURL)}`,{path:h==null?void 0:h.socketPath,transports:["websocket"],reconnection:!0,reconnectionAttempts:1});w.on("connect",p),w.on("connect_error",D=>{console.error("connect_error widget-chatbot : ",{err:D,socketURL:h==null?void 0:h.socketURL,socketPath:h==null?void 0:h.widgetProps})}),w.io.on("reconnect",()=>{console.error("reconnect widget-chatbot : ",{socketURL:h==null?void 0:h.socketURL,socketPath:h==null?void 0:h.widgetProps})}),m.current=w},N=()=>{var w;(!((w=m==null?void 0:m.current)!=null&&w.connected)||!u)&&(_(),A(!1))},F=()=>{g(!1)};return l.useEffect(()=>(A(!1),_(),window.addEventListener("online",N),window.addEventListener("offline",F),()=>{var w,v;m.current&&((w=m.current)==null||w.off("connect",p),(v=m.current)==null||v.disconnect(),m.current=null),window.removeEventListener("online",N),window.removeEventListener("offline",F)}),[JSON.stringify(b||{}),h==null?void 0:h.socketURL,h==null?void 0:h.socketPath]),n.jsx(We.Provider,{value:{setChats:s,chats:t,onSendMsg:L,isWaitResponse:o,socket:m==null?void 0:m.current,sessionId:(M=f==null?void 0:f.current)==null?void 0:M.session_id,loadingRegenerate:i,file:a,setFile:d,connected:u,isHandshakeWidget:T,createSocket:_,currRegenerateId:C},children:e})},On={'pre[class*="language-"]':{color:"#d4d4d4",fontSize:"13px",textShadow:"none",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto",background:"#1e1e1e"},'code[class*="language-"]':{color:"#d4d4d4",fontSize:"13px",textShadow:"none",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]::selection':{textShadow:"none",background:"#264F78"},'code[class*="language-"]::selection':{textShadow:"none",background:"#264F78"},'pre[class*="language-"] *::selection':{textShadow:"none",background:"#264F78"},'code[class*="language-"] *::selection':{textShadow:"none",background:"#264F78"},':not(pre) > code[class*="language-"]':{padding:".1em .3em",borderRadius:".3em",color:"#db4c69",background:"#1e1e1e"},".namespace":{Opacity:".7"},"doctype.doctype-tag":{color:"#569CD6"},"doctype.name":{color:"#9cdcfe"},comment:{color:"#6a9955"},prolog:{color:"#6a9955"},punctuation:{color:"#d4d4d4"},".language-html .language-css .token.punctuation":{color:"#d4d4d4"},".language-html .language-javascript .token.punctuation":{color:"#d4d4d4"},property:{color:"#9cdcfe"},tag:{color:"#569cd6"},boolean:{color:"#569cd6"},number:{color:"#b5cea8"},constant:{color:"#9cdcfe"},symbol:{color:"#b5cea8"},inserted:{color:"#b5cea8"},unit:{color:"#b5cea8"},selector:{color:"#d7ba7d"},"attr-name":{color:"#9cdcfe"},string:{color:"#ce9178"},char:{color:"#ce9178"},builtin:{color:"#ce9178"},deleted:{color:"#ce9178"},".language-css .token.string.url":{textDecoration:"underline"},operator:{color:"#d4d4d4"},entity:{color:"#569cd6"},"operator.arrow":{color:"#569CD6"},atrule:{color:"#ce9178"},"atrule.rule":{color:"#c586c0"},"atrule.url":{color:"#9cdcfe"},"atrule.url.function":{color:"#dcdcaa"},"atrule.url.punctuation":{color:"#d4d4d4"},keyword:{color:"#569CD6"},"keyword.module":{color:"#c586c0"},"keyword.control-flow":{color:"#c586c0"},function:{color:"#dcdcaa"},"function.maybe-class-name":{color:"#dcdcaa"},regex:{color:"#d16969"},important:{color:"#569cd6"},italic:{fontStyle:"italic"},"class-name":{color:"#4ec9b0"},"maybe-class-name":{color:"#4ec9b0"},console:{color:"#9cdcfe"},parameter:{color:"#9cdcfe"},interpolation:{color:"#9cdcfe"},"punctuation.interpolation-punctuation":{color:"#569cd6"},variable:{color:"#9cdcfe"},"imports.maybe-class-name":{color:"#9cdcfe"},"exports.maybe-class-name":{color:"#9cdcfe"},escape:{color:"#d7ba7d"},"tag.punctuation":{color:"#808080"},cdata:{color:"#808080"},"attr-value":{color:"#ce9178"},"attr-value.punctuation":{color:"#ce9178"},"attr-value.punctuation.attr-equals":{color:"#d4d4d4"},namespace:{color:"#4ec9b0"},'pre[class*="language-javascript"]':{color:"#9cdcfe"},'code[class*="language-javascript"]':{color:"#9cdcfe"},'pre[class*="language-jsx"]':{color:"#9cdcfe"},'code[class*="language-jsx"]':{color:"#9cdcfe"},'pre[class*="language-typescript"]':{color:"#9cdcfe"},'code[class*="language-typescript"]':{color:"#9cdcfe"},'pre[class*="language-tsx"]':{color:"#9cdcfe"},'code[class*="language-tsx"]':{color:"#9cdcfe"},'pre[class*="language-css"]':{color:"#ce9178"},'code[class*="language-css"]':{color:"#ce9178"},'pre[class*="language-html"]':{color:"#d4d4d4"},'code[class*="language-html"]':{color:"#d4d4d4"},".language-regex .token.anchor":{color:"#dcdcaa"},".language-html .token.punctuation":{color:"#808080"},'pre[class*="language-"] > code[class*="language-"]':{position:"relative",zIndex:"1"},".line-highlight.line-highlight":{background:"#f7ebc6",boxShadow:"inset 5px 0 0 #f7d87c",zIndex:"0"}},Rn=e=>e.replace(/[^a-zA-Z0-9_]/g,"").trim(),S=(e="",t)=>{var c;const{langDatas:s}=_n(),o=localStorage==null?void 0:localStorage.getItem("show_text_id"),r=Rn(String(e)),i=(s==null?void 0:s[r==null?void 0:r.toUpperCase()])||t;return((c=Object.keys(s||{}))==null?void 0:c.length)>0?o?`WPUI_${r}`:i:t},Fn=({isFeedback:e=!1,open:t,...s})=>{var r;const o=l.useMemo(()=>e?"w-modal-container-feedback":"",[e]);return se!=null&&se.startsWith("5")?n.jsx(x.Modal,{rootClassName:o,...s,open:t,getContainer:"#w-widget-content",maskProps:{style:{backdropFilter:"blur(4px)"}},width:300,style:{...Object.keys((s==null?void 0:s.style)||{}).length>0&&{...s==null?void 0:s.style},top:20}}):n.jsx(x.Modal,{getContainer:"#w-widget-content",width:300,...s,...oe!=null&&oe.startsWith("18")?{open:t}:{visible:t},maskStyle:{backdropFilter:"blur(4x)",...((r=Object.keys((s==null?void 0:s.maskStyle)||{}))==null?void 0:r.length)>0&&{...s==null?void 0:s.maskStyle}},style:{...Object.keys((s==null?void 0:s.style)||{}).length>0&&{...s==null?void 0:s.style},top:20}})},Ge=l.memo(Fn),Oe=({props:e,isModal:t=!1})=>{const s=(o,r)=>{var i;return(i=l.Children)==null?void 0:i.map(o,c=>{var a,d,u;return!l.isValidElement(c)||((a=Object.keys((c==null?void 0:c.props)||{}))==null?void 0:a.length)===0?c:l.cloneElement(c,{...c==null?void 0:c.props,...(c==null?void 0:c.type)==="thead"&&{className:"ant-table-thead"},...((c==null?void 0:c.type)==="th"||(c==null?void 0:c.type)==="td")&&{className:"ant-table-cell",...(c==null?void 0:c.type)==="th"&&{style:{background:"var(--primary-color, #395ebc)",color:"#ffffff",minWidth:180}}},...c.type==="tr"&&r==="tbody"&&{className:"ant-table-row"},...(c==null?void 0:c.type)==="tbody"&&{className:"ant-table-tbody"},children:(d=c==null?void 0:c.props)!=null&&d.children?s((u=c==null?void 0:c.props)==null?void 0:u.children,c==null?void 0:c.type):c==null?void 0:c.props})})};return n.jsx(n.Fragment,{children:n.jsx("div",{className:"ant-table",children:n.jsx("div",{className:"ant-table-container",children:n.jsx("div",{className:"ant-table-content",style:{overflow:"scroll",maxWidth:t?"100%":330,maxHeight:t?"100%":360},children:n.jsx("table",{className:"wp-md-table",...e,children:s(e==null?void 0:e.children,"")})})})})})},Nn=({children:e})=>{const t=S("OpenDetailTable","Open Detail Table"),s=S("TableDetail","Tabel Detail"),[o,r]=l.useState(!1),i={table:({...c})=>n.jsxs(n.Fragment,{children:[n.jsx(Oe,{props:c}),n.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"5px 0px 10px 0px"},children:n.jsx(x.Button,{onClick:()=>{r(!0)},children:t})}),n.jsx(Ge,{getContainer:()=>document.body,footer:null,title:s,width:800,open:o,onCancel:()=>{r(!1)},children:n.jsx(Oe,{props:c,isModal:!0})})]}),code:({...c})=>{const{children:a,className:d,...u}=c,g=/language-(\w+)/.exec(d||"");return g?n.jsx(ln.Prism,{...u,PreTag:"div",language:g[1],style:On,children:String(a).replace(/\n$/,"")}):n.jsx(x.Typography.Text,{code:!0,children:c==null?void 0:c.children})}};return n.jsx(on,{remarkPlugins:[cn],components:i,children:e})},Ve=l.memo(Nn),Hn=()=>n.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.25 4.5H18.75C19.5 4.5 19.5 5.44772 19.5 6V18C19.5 18.5523 19.5 19.5 18.75 19.5H5.25C4.5 19.5 4.5 18.5523 4.5 18V6C4.5 5.44772 4.5 4.5 5.25 4.5ZM3 6C3 4.34315 4.34315 3 6 3H18C19.6569 3 21 4.34315 21 6V18C21 19.6569 19.6569 21 18 21H6C4.34315 21 3 19.6569 3 18V6ZM17 17V15.75H7V17H17Z",fill:"white"})}),Bn=()=>n.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:"rotate(0deg)",transition:"300ms"},children:n.jsx("path",{d:"M11.325 21H5.175C3.9735 21 3 20.0265 3 18.825V5.175C3 3.9735 3.9735 3 5.175 3H18.825C20.0265 3 21 3.9735 21 5.175V18.825C21 20.0265 20.0265 21 18.825 21H11.325ZM4.35 5.175V12H9.825C11.0265 12 12 12.9735 12 14.175V19.65H18.825C19.281 19.65 19.65 19.281 19.65 18.825V5.175C19.65 4.71975 19.281 4.35 18.825 4.35H5.175C4.71975 4.35 4.35 4.719 4.35 5.175V5.175ZM4.35 18.825C4.35 19.281 4.719 19.65 5.175 19.65H10.65V14.175C10.65 13.719 10.281 13.35 9.825 13.35H4.35V18.825ZM12.4882 11.5117C12.366 11.3895 12.2902 11.2207 12.2902 11.034C12.2902 10.8472 12.366 10.6785 12.4882 10.5562L15.9863 7.059H14.364C13.9913 7.059 13.689 6.75675 13.689 6.384C13.689 6.01125 13.9913 5.709 14.364 5.709H17.616C17.709 5.709 17.7975 5.7285 17.8785 5.763L17.874 5.7615C17.958 5.79675 18.0293 5.8455 18.09 5.90475C18.1508 5.9655 18.1995 6.03825 18.2333 6.11925L18.2347 6.12375C18.2677 6.1995 18.2872 6.28875 18.2872 6.38175V9.633C18.2872 10.0057 17.985 10.308 17.6122 10.308C17.2395 10.308 16.9373 10.0057 16.9373 9.633V8.0115L13.4393 11.5095C13.317 11.631 13.1483 11.7068 12.9623 11.7068C12.7778 11.7068 12.6105 11.6325 12.489 11.5125L12.4882 11.5117Z",fill:"white"})}),In=()=>n.jsxs("svg",{viewBox:"64 64 896 896",focusable:"false",width:"14",height:"14","aria-hidden":"true",fill:"white",children:[n.jsx("defs",{children:n.jsx("style",{})}),n.jsx("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})]}),$n=()=>n.jsxs("svg",{viewBox:"-2.4 -2.4 28.80 28.80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("g",{id:"SVGRepo_bgCarrier",strokeWidth:"0"}),n.jsx("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("g",{id:"SVGRepo_iconCarrier",children:n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM8.58579 8.58579C8 9.17157 8 10.1144 8 12C8 13.8856 8 14.8284 8.58579 15.4142C9.17157 16 10.1144 16 12 16C13.8856 16 14.8284 16 15.4142 15.4142C16 14.8284 16 13.8856 16 12C16 10.1144 16 9.17157 15.4142 8.58579C14.8284 8 13.8856 8 12 8C10.1144 8 9.17157 8 8.58579 8.58579Z",fill:"rgb(57, 94, 188)"})})]}),Un=()=>n.jsx("span",{role:"img","aria-label":"sync",className:"anticon anticon-sync",children:n.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 01755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 01512.1 856a342.24 342.24 0 01-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 00-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 00-8-8.2z"})})}),Wn=()=>n.jsx("span",{role:"img","aria-label":"left",className:"anticon anticon-left",children:n.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"})})}),Gn=()=>n.jsx("span",{role:"img","aria-label":"right",className:"anticon anticon-right",children:n.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"})})}),Vn=({...e})=>n.jsx("span",{role:"img","aria-label":"like",className:"anticon anticon-like",children:n.jsxs("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"like",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:[n.jsx("path",{d:"M273 495.9v428l.3-428zm538.2-88.3H496.8l9.6-198.4c.6-11.9-4.7-23.1-14.6-30.5-6.1-4.5-13.6-6.8-21.1-6.7-19.6.1-36.9 13.4-42.2 32.3-37.1 134.4-64.9 235.2-83.5 302.5V852h399.4a56.85 56.85 0 0033.6-51.8c0-9.7-2.3-18.9-6.9-27.3l-13.9-25.4 21.9-19a56.76 56.76 0 0019.6-43c0-9.7-2.3-18.9-6.9-27.3l-13.9-25.4 21.9-19a56.76 56.76 0 0019.6-43c0-9.7-2.3-18.9-6.9-27.3l-14-25.5 21.9-19a56.76 56.76 0 0019.6-43c0-19.1-11-37.5-28.8-48.4z",fill:(e==null?void 0:e.feedback)==="like"?"green":"#fff"}),n.jsx("path",{d:"M112 528v364c0 17.7 14.3 32 32 32h65V496h-65c-17.7 0-32 14.3-32 32zm773.9 5.7c16.8-22.2 26.1-49.4 26.1-77.7 0-44.9-25.1-87.5-65.5-111a67.67 67.67 0 00-34.3-9.3H572.3l6-122.9c1.5-29.7-9-57.9-29.5-79.4a106.4 106.4 0 00-77.9-33.4c-52 0-98 35-111.8 85.1l-85.8 310.8-.3 428h472.1c9.3 0 18.2-1.8 26.5-5.4 47.6-20.3 78.3-66.8 78.3-118.4 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7 0-12.6-1.8-25-5.4-37zM820.4 499l-21.9 19 14 25.5a56.2 56.2 0 016.9 27.3c0 16.5-7.1 32.2-19.6 43l-21.9 19 13.9 25.4a56.2 56.2 0 016.9 27.3c0 16.5-7.1 32.2-19.6 43l-21.9 19 13.9 25.4a56.2 56.2 0 016.9 27.3c0 22.4-13.2 42.6-33.6 51.8H345V506.8c18.6-67.2 46.4-168 83.5-302.5a44.28 44.28 0 0142.2-32.3c7.5-.1 15 2.2 21.1 6.7 9.9 7.4 15.2 18.6 14.6 30.5l-9.6 198.4h314.4C829 418.5 840 436.9 840 456c0 16.5-7.1 32.2-19.6 43z",fill:(e==null?void 0:e.feedback)==="like"?"green":"black"})]})}),zn=({...e})=>n.jsx("span",{role:"img","aria-label":"dislike",className:"anticon anticon-dislike",children:n.jsxs("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"dislike",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:[n.jsx("path",{d:"M273 100.1v428h.3l-.3-428zM820.4 525l-21.9-19 14-25.5a56.2 56.2 0 006.9-27.3c0-16.5-7.1-32.2-19.6-43l-21.9-19 13.9-25.4a56.2 56.2 0 006.9-27.3c0-16.5-7.1-32.2-19.6-43l-21.9-19 13.9-25.4a56.2 56.2 0 006.9-27.3c0-22.4-13.2-42.6-33.6-51.8H345v345.2c18.6 67.2 46.4 168 83.5 302.5a44.28 44.28 0 0042.2 32.3c7.5.1 15-2.2 21.1-6.7 9.9-7.4 15.2-18.6 14.6-30.5l-9.6-198.4h314.4C829 605.5 840 587.1 840 568c0-16.5-7.1-32.2-19.6-43z",fill:(e==null?void 0:e.feedback)==="dislike"?"red":"#fff"}),n.jsx("path",{d:"M112 132v364c0 17.7 14.3 32 32 32h65V100h-65c-17.7 0-32 14.3-32 32zm773.9 358.3c3.6-12 5.4-24.4 5.4-37 0-28.3-9.3-55.5-26.1-77.7 3.6-12 5.4-24.4 5.4-37 0-28.3-9.3-55.5-26.1-77.7 3.6-12 5.4-24.4 5.4-37 0-51.6-30.7-98.1-78.3-118.4a66.1 66.1 0 00-26.5-5.4H273l.3 428 85.8 310.8C372.9 889 418.9 924 470.9 924c29.7 0 57.4-11.8 77.9-33.4 20.5-21.5 31-49.7 29.5-79.4l-6-122.9h239.9c12.1 0 23.9-3.2 34.3-9.3 40.4-23.5 65.5-66.1 65.5-111 0-28.3-9.3-55.5-26.1-77.7zm-74.7 126.1H496.8l9.6 198.4c.6 11.9-4.7 23.1-14.6 30.5-6.1 4.5-13.6 6.8-21.1 6.7a44.28 44.28 0 01-42.2-32.3c-37.1-134.4-64.9-235.2-83.5-302.5V172h399.4a56.85 56.85 0 0133.6 51.8c0 9.7-2.3 18.9-6.9 27.3l-13.9 25.4 21.9 19a56.76 56.76 0 0119.6 43c0 9.7-2.3 18.9-6.9 27.3l-13.9 25.4 21.9 19a56.76 56.76 0 0119.6 43c0 9.7-2.3 18.9-6.9 27.3l-14 25.5 21.9 19a56.76 56.76 0 0119.6 43c0 19.1-11 37.5-28.8 48.4z",fill:(e==null?void 0:e.feedback)==="dislike"?"red":"black"})]})}),Kn=()=>n.jsx("span",{role:"img","aria-label":"delete",className:"anticon anticon-delete",children:n.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"})})}),Yn=()=>n.jsx("span",{role:"img","aria-label":"close",className:"anticon anticon-close",children:n.jsx("svg",{fillRule:"evenodd",viewBox:"64 64 896 896",focusable:"false","data-icon":"close",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"})})}),qn=()=>n.jsx("span",{role:"img","aria-label":"upload",className:"anticon anticon-upload",children:n.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"})})}),Qn=()=>n.jsx("span",{role:"img","aria-label":"filter",className:"anticon anticon-filter",children:n.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"})})}),Zn=()=>n.jsx("span",{role:"img","aria-label":"down",className:"anticon anticon-down",children:n.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"})})}),Jn=()=>n.jsx("span",{role:"img","aria-label":"paper-clip",className:"anticon anticon-paper-clip",children:n.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"})})}),Xn=()=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 32 32",fill:"none",children:n.jsx("path",{d:"M13.083 1C10.9876 0.99919 8.92848 1.54638 7.10994 2.58726C5.2914 3.62814 3.7767 5.12652 2.71618 6.93367C1.65565 8.74083 1.08618 10.7939 1.06429 12.8892C1.0424 14.9844 1.56884 17.0489 2.59138 18.8778L1.12189 22.7262C0.999579 23.0461 0.968553 23.3937 1.03227 23.7303C1.096 24.0668 1.25196 24.379 1.48276 24.632C1.71356 24.885 2.01013 25.069 2.33938 25.1633C2.66863 25.2576 3.0176 25.2586 3.34738 25.1661L7.94438 23.8778C9.57274 24.6472 11.3532 25.0407 13.1542 25.0291C14.9551 25.0176 16.7304 24.6013 18.3488 23.8111C19.9671 23.0209 21.3871 21.8769 22.5038 20.4639C23.6204 19.0509 24.4051 17.4049 24.7998 15.6477C25.1944 13.8905 25.189 12.0671 24.7839 10.3122C24.3788 8.5574 23.5844 6.9161 22.4595 5.50971C21.3345 4.10332 19.9077 2.96783 18.2847 2.18722C16.6617 1.40662 14.8839 1.00088 13.083 1ZM13.0682 8.21066C12.4064 8.34005 11.6819 8.76888 11.1126 9.77442C11.0526 9.88001 10.9724 9.97275 10.8766 10.0474C10.7808 10.122 10.6713 10.177 10.5542 10.2092C10.4372 10.2415 10.3149 10.2504 10.1944 10.2354C10.0739 10.2204 9.95753 10.1819 9.85194 10.1219C9.74635 10.062 9.6536 9.98179 9.57899 9.88599C9.50439 9.79019 9.44938 9.68064 9.41711 9.56358C9.38484 9.44652 9.37594 9.32425 9.39093 9.20375C9.40591 9.08326 9.44448 8.96689 9.50444 8.8613C10.3196 7.42693 11.4785 6.63766 12.7133 6.39737C13.8622 6.18019 15.0505 6.41957 16.0256 7.06464C16.9203 7.65613 17.643 8.62285 17.6652 9.78181C17.6892 10.9925 16.9535 12.0849 15.5968 12.8871C14.6763 13.4306 14.3177 13.8003 14.1643 14.0461C14.0349 14.2531 14.0072 14.4417 14.0072 14.8631C14.0072 15.1082 13.9098 15.3433 13.7365 15.5166C13.5632 15.6899 13.3281 15.7873 13.083 15.7873C12.8379 15.7873 12.6028 15.6899 12.4295 15.5166C12.2561 15.3433 12.1588 15.1082 12.1588 14.8631C12.1588 14.3603 12.1846 13.7356 12.5968 13.0701C12.985 12.4472 13.6486 11.8927 14.6578 11.2957C15.6467 10.7097 15.826 10.1533 15.8205 9.82062C15.8131 9.438 15.558 8.97035 15.0072 8.60622C14.4369 8.22892 13.7426 8.08716 13.07 8.21066H13.0682ZM13.5432 20.4083C13.1755 20.4083 12.8229 20.2623 12.563 20.0023C12.303 19.7423 12.1569 19.3897 12.1569 19.022C12.1569 18.6544 12.303 18.3017 12.563 18.0418C12.8229 17.7818 13.1755 17.6357 13.5432 17.6357C13.9109 17.6357 14.2635 17.7818 14.5235 18.0418C14.7835 18.3017 14.9295 18.6544 14.9295 19.022C14.9295 19.3897 14.7835 19.7423 14.5235 20.0023C14.2635 20.2623 13.9109 20.4083 13.5432 20.4083ZM9.45084 26.3972C10.5776 27.7093 11.975 28.762 13.547 29.4831C15.119 30.2042 16.8285 30.5765 18.558 30.5746C20.3934 30.5746 22.1365 30.1624 23.6966 29.423L28.2917 30.7114C28.6215 30.8038 28.9705 30.8028 29.2997 30.7085C29.629 30.6142 29.9255 30.4303 30.1563 30.1772C30.3871 29.9242 30.5431 29.612 30.6068 29.2755C30.6705 28.939 30.6395 28.5914 30.5172 28.2715L29.0477 24.4231C30.05 22.6316 30.5751 20.6127 30.5726 18.5599C30.5726 14.974 29.0015 11.7541 26.508 9.5526C26.7814 10.6172 26.9272 11.7105 26.9424 12.8095C28.0662 14.4454 28.7242 16.4269 28.7242 18.5599C28.7242 20.5008 28.1808 22.314 27.2363 23.8575L26.9997 24.2456L28.7926 28.9314L23.5062 27.4526L23.1827 27.6153C21.7964 28.3251 20.2252 28.7262 18.558 28.7262C16.4617 28.7294 14.4162 28.0816 12.704 26.8722C11.6046 26.8435 10.5126 26.684 9.45084 26.3972Z",fill:"white"})}),Pn=()=>n.jsx("span",{role:"img","aria-label":"smile",className:"anticon anticon-smile",children:n.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M288 421a48 48 0 1096 0 48 48 0 10-96 0zm352 0a48 48 0 1096 0 48 48 0 10-96 0zM512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm263 711c-34.2 34.2-74 61-118.3 79.8C611 874.2 562.3 884 512 884c-50.3 0-99-9.8-144.8-29.2A370.4 370.4 0 01248.9 775c-34.2-34.2-61-74-79.8-118.3C149.8 611 140 562.3 140 512s9.8-99 29.2-144.8A370.4 370.4 0 01249 248.9c34.2-34.2 74-61 118.3-79.8C413 149.8 461.7 140 512 140c50.3 0 99 9.8 144.8 29.2A370.4 370.4 0 01775.1 249c34.2 34.2 61 74 79.8 118.3C874.2 413 884 461.7 884 512s-9.8 99-29.2 144.8A368.89 368.89 0 01775 775zM664 533h-48.1c-4.2 0-7.8 3.2-8.1 7.4C604 589.9 562.5 629 512 629s-92.1-39.1-95.8-88.6c-.3-4.2-3.9-7.4-8.1-7.4H360a8 8 0 00-8 8.4c4.4 84.3 74.5 151.6 160 151.6s155.6-67.3 160-151.6a8 8 0 00-8-8.4z"})})}),et=()=>n.jsx("span",{role:"img","aria-label":"file",className:"anticon anticon-file",children:n.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:24,height:24,fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"})})}),nt=({...e})=>n.jsx("span",{role:"img","aria-label":"loading",...e,children:n.jsx("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"loading",width:52,height:52,fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})})}),I=({type:e="",chatProps:t,...s})=>{const o=l.useMemo(()=>({minimize:Hn,expand:Bn,send:In,stop:$n,sync:Un,left:Wn,right:Gn,like:()=>n.jsx(Vn,{...t}),dislike:()=>n.jsx(zn,{...t}),delete:Kn,close:Yn,upload:qn,filter:Qn,down:Zn,"paper-clip":Jn,"chat-bubble":Xn,smile:Pn,file:et,loading:()=>n.jsx(nt,{...s})}),[e,t]);return n.jsx(rn,{component:o==null?void 0:o[e],...s})},ze=l.createContext({}),Z=()=>l.useContext(ze),tt=({children:e})=>{const[t,s]=l.useState("va"),o=l.useMemo(()=>t==="va",[t]);return n.jsx(ze.Provider,{value:{activeTab:t,setActiveTab:s,isActiveTabVA:o},children:e})},st=({...e})=>{const t=S("WeLoveToHearAboutYourExperienceWithTheSunfishChatbot","We'd love to hear about your experience with the Sunfish chatbot"),s=S("ShareAnyCommentsOrSuggestionsToHelpUsImprove","Share any comments or suggestions to help us improve"),o=S("Submit","Submit"),r=S("ThankFeedback","Thank You for your feedback"),i=S("AdditionalFeedback","Additional Feedback"),[c]=x.Form.useForm(),[a,d]=l.useState(!1),[u,g]=l.useState(""),{setChats:T}=z(),{objInitPayload:y}=R(),{activeTab:b}=Z(),h=l.useMemo(()=>{var f;const m=G(e,"feedback")?(e==null?void 0:e.feedback)==="like"||(e==null?void 0:e.feedback)==="":!0;return typeof(e==null?void 0:e.text_thumbsup_link)=="string"&&((f=e==null?void 0:e.text_thumbsup_link)==null?void 0:f.trim())!==""&&m},[e]),A=l.useMemo(()=>{var f;const m=G(e,"feedback")?(e==null?void 0:e.feedback)==="dislike"||(e==null?void 0:e.feedback)==="":!0;return typeof(e==null?void 0:e.text_thumbsdown_link)=="string"&&((f=e==null?void 0:e.text_thumbsdown_link)==null?void 0:f.trim())!==""&&m},[e]),E=l.useMemo(()=>{if(y!=null&&y.uriBackend)try{return new URL(y.uriBackend).origin}catch{return""}return""},[y==null?void 0:y.uriBackend]),k=m=>{var M;const f=m==="like"?e==null?void 0:e.text_thumbsup_link:e==null?void 0:e.text_thumbsdown_link,{access_token:C="",companycode:j="",companyid:p="",uriBackend:L="",uriBackendEnt:_="",lang:N=""}=y||{},F=u==="another"?c==null?void 0:c.getFieldValue("ADDITIONAL_FEEDBACK"):u;(M=q({method:"POST",url:f,data:{message_id:e==null?void 0:e.id,response_type:m==="like"?"up":"down",...m==="dislike"&&{additional_feedback:F}},headers:{"Content-Type":"application/json",Authorization:`Bearer ${C}`,"company-code":`${j}`,"company-id":`${p}`,uriBackend:`${L}`,uriBackendEnt:`${_}`,"custom-origin":`${E}`,"Acc-Name":`${j.toUpperCase()}`,Language:`${N}`}}))==null||M.then(w=>{var v,H,D;(w==null?void 0:w.status)===200&&(a&&d(!1),(v=x.notification)==null||v.destroy(),(H=x.notification)==null||H.config({getContainer:()=>document.querySelector(".w-widget-content-container"),top:28,placement:"top",duration:3}),(D=x.notification)==null||D.success({message:r,className:"w-notification-content"}),T(O=>{var B;return(B=O==null?void 0:O.map($=>{var U;if(G($,"chats")){const X=(U=$==null?void 0:$.chats)==null?void 0:U.map(Y=>(Y==null?void 0:Y.indexChat)===(e==null?void 0:e.indexChat)?{...Y,feedback:m}:Y);return{...$,chats:X}}return(e==null?void 0:e.message_id)===($==null?void 0:$.message_id)?{...$,feedback:m}:$}))==null?void 0:B.flat()}))})};return l.useEffect(()=>{var m;(m=x.notification)==null||m.destroy()},[b]),n.jsxs(n.Fragment,{children:[h&&n.jsx(x.Button,{icon:n.jsx(I,{type:"like",chatProps:e}),onClick:()=>{(e==null?void 0:e.feedback)!=="like"&&k("like")}}),A&&n.jsx(x.Button,{icon:n.jsx(I,{type:"dislike",chatProps:e}),onClick:()=>{(e==null?void 0:e.feedback)!=="dislike"&&d(!0)}}),n.jsxs(Ge,{open:a,isFeedback:!0,okText:o,onCancel:()=>{d(!1)},onOk:()=>{k("dislike")},children:[n.jsx("p",{style:{textAlign:"center",fontWeight:600,fontSize:14},children:t}),n.jsxs("p",{style:{textAlign:"center"},children:[s,"!"]}),n.jsx(x.Radio.Group,{className:"w-list-feedback-suggestion",options:Cn,optionType:"button",buttonStyle:"solid",onChange:m=>{var f;g((f=m==null?void 0:m.target)==null?void 0:f.value)}}),u==="another"&&n.jsxs(n.Fragment,{children:[n.jsx(x.Divider,{children:i}),n.jsx(x.Form,{form:c,layout:"vertical",children:n.jsx(x.Form.Item,{name:"ADDITIONAL_FEEDBACK",children:n.jsx(x.Input.TextArea,{rows:3})})})]})]})]})},ot=l.memo(st),ct=({showFeedback:e=!0,showRegenerate:t=!0,position:s="left",...o})=>{const r=En(),{chats:i,onSendMsg:c,setChats:a,loadingRegenerate:d,currRegenerateId:u}=z(),g=l.useMemo(()=>o==null?void 0:o.sender,[o]),T=l.useMemo(()=>i==null?void 0:i.filter(E=>(E==null?void 0:E.sender)==="client"),[i]),y=l.useMemo(()=>t&&g==="response"&&(T==null?void 0:T.length)>0&&(o==null?void 0:o.indexChat)===(i==null?void 0:i.length)-1,[g,T,i,o==null?void 0:o.indexChat,t]),b=l.useMemo(()=>{switch(s){case"left":return"flex-start";case"center":return"center";case"right":return"flex-end"}},[s]),h=l.useMemo(()=>e&&(o==null?void 0:o.text_FeedbackIcons)==="hidup",[o,e]),A=()=>{const E=T==null?void 0:T[(T==null?void 0:T.length)-1],k=i==null?void 0:i[(i==null?void 0:i.length)-1];a((m=[])=>m==null?void 0:m.map((f,C)=>C===(m==null?void 0:m.length)-1&&(f==null?void 0:f.sender)==="response"?{...f,generated_id:(k==null?void 0:k.generated_id)??r}:f)),u.current=(k==null?void 0:k.generated_id)??r,c({msg:E==null?void 0:E.text,additionalConfig:{generate_id:(k==null?void 0:k.generated_id)??r},isShowLoadingResponse:d}),Q()};return n.jsx(n.Fragment,{children:n.jsxs("div",{style:{display:"flex",gap:8,justifyContent:b},children:[y&&n.jsx(x.Button,{loading:d,icon:n.jsx(I,{type:"sync"}),onClick:()=>{A()}}),h&&n.jsx(ot,{...o})]})})},he=l.memo(ct),lt=({nameFallback:e="",...t})=>n.jsx(x.Image,{...typeof(t==null?void 0:t.onError)!="function"&&{fallback:Ae(e)},placeholder:n.jsx(x.Skeleton.Image,{style:{width:"100%",height:"100%"}}),loading:"lazy",...t}),we=l.memo(lt),rt=({nameFallback:e="",...t})=>{const s=l.useRef(0);return n.jsx(x.Avatar,{...t,src:n.jsx(we,{src:t==null?void 0:t.src,nameFallback:e,...t,onError:o=>{s.current+=1,(s==null?void 0:s.current)<3?o.target.src=Ie(t==null?void 0:t.src):o.target.src=Ae(e)}})})},P=l.memo(rt);P.Group=x.Avatar.Group;const it=()=>n.jsxs("div",{className:"lds-ellipsis",children:[n.jsx("div",{}),n.jsx("div",{}),n.jsx("div",{}),n.jsx("div",{})]}),Ke=l.memo(it),at=()=>{const{widgetProps:e}=R();return n.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[n.jsx(P,{src:xe,nameFallback:e==null?void 0:e.title}),n.jsx(Ke,{})]})},pe=l.memo(at),dt=({src:e,name:t})=>n.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[n.jsx(P,{src:e,preview:!1,nameFallback:t}),n.jsx(x.Typography.Text,{children:t})]}),ae=l.memo(dt),ut=({...e})=>{var g,T;const[t,s]=l.useState(1),{loadingRegenerate:o,currRegenerateId:r}=z(),{isExpand:i,widgetProps:c}=R(),a=l.useMemo(()=>e==null?void 0:e.sender,[e]),d=l.useMemo(()=>e==null?void 0:e.chats,[e==null?void 0:e.chats]),u=l.useMemo(()=>{const y=d==null?void 0:d[(d==null?void 0:d.length)-1];return(y==null?void 0:y.generated_id)===r.current},[d,e,r.current]);return l.useEffect(()=>{!o&&(d==null?void 0:d.length)>0&&(s(d==null?void 0:d.length),Q())},[o]),o&&u?n.jsx(pe,{}):n.jsxs(n.Fragment,{children:[a==="response"&&n.jsx(ae,{name:c==null?void 0:c.title,src:xe}),n.jsx("div",{style:{display:"flex",gap:8},children:d==null?void 0:d.map((y,b)=>{var E;const h=b===((E=e==null?void 0:e.chats)==null?void 0:E.length)-1,A=t===b+1;return n.jsxs("div",{style:{display:A?"flex":"none",flexDirection:"column",gap:8},className:"w-fade-in-animate",children:[n.jsx("div",{...h&&{className:`w-regenerate-chat-last ${i?"w-regenerate-chat-last-expand":""}`},children:n.jsxs("div",{className:`w-bubble-chat w-bubble-chat-regenerate ${`w-${a}`} ${i?"w-bubble-chat-regenerate-expand":""}`,children:[n.jsx(Ve,{children:y==null?void 0:y.text}),a==="response"&&n.jsx("span",{style:{fontSize:12,color:"rgba(0,0,0,0.4)"},children:y==null?void 0:y.timestamp})]})}),n.jsx(he,{showFeedback:!0,showRegenerate:!1,...y})]},b)})}),n.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"center"},children:[n.jsx(he,{showRegenerate:!0,showFeedback:!1,...e}),n.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[n.jsx(x.Button,{size:"small",shape:"circle",disabled:t===1,icon:n.jsx(I,{type:"left"}),onClick:()=>{t>1&&s(y=>y-1)}}),n.jsxs(x.Typography.Text,{children:[t," / ",(g=e==null?void 0:e.chats)==null?void 0:g.length]}),n.jsx(x.Button,{size:"small",shape:"circle",disabled:t===((T=e==null?void 0:e.chats)==null?void 0:T.length),icon:n.jsx(I,{type:"right"}),onClick:()=>{var y;t<((y=e==null?void 0:e.chats)==null?void 0:y.length)&&s(b=>b+1)}})]})]})]})},xt=l.memo(ut),ft=({date:e,format:t,sender:s,...o})=>{var r,i;return n.jsx(x.Typography.Text,{...o,type:"secondary",style:{display:"block",fontSize:12,...s==="client"&&{textAlign:"right"},...((r=Object.keys((o==null?void 0:o.style)||{}))==null?void 0:r.length)>0&&{...o==null?void 0:o.style}},children:t?(i=V(e))==null?void 0:i.format(t):e})},de=l.memo(ft),gt=({...e})=>{var c;const{loadingRegenerate:t,chats:s}=z(),{widgetProps:o}=R(),r=l.useMemo(()=>(s==null?void 0:s.length)-1===(e==null?void 0:e.indexChat),[s]),i=l.useMemo(()=>e==null?void 0:e.sender,[e]);return((c=e==null?void 0:e.chats)==null?void 0:c.length)>0?n.jsx(xt,{...e}):t&&r?n.jsx(pe,{}):n.jsxs(n.Fragment,{children:[i==="response"&&n.jsx(ae,{name:o==null?void 0:o.title,src:xe}),n.jsxs("div",{className:`w-bubble-chat ${`w-${i}`}`,children:[n.jsx(Ve,{children:e==null?void 0:e.text}),n.jsx(de,{date:e==null?void 0:e.timestamp,sender:i})]}),n.jsx(he,{...e})]})},ie=l.memo(gt),mt=()=>{const e=S("PleaseUploadFile","Please upload specify file that needed to complete your request"),t=S("ClickToUpload","Click to upload"),s=S("ContinueWithoutUpload","Continue without upload"),{onSendMsg:o,setFile:r}=z(),i=()=>{o({msg:"CANCEL UPLOAD"})};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:12},children:[n.jsx(ie,{sender:"response",text:`${e}...`}),n.jsxs("div",{style:{display:"flex",gap:8},children:[n.jsx(x.Upload,{className:"btn_upload",beforeUpload:()=>!1,fileList:[],accept:".doc, .jpg, .ods, .png, .txt, .docx, .pdf",onChange:c=>{r(c==null?void 0:c.file)},children:n.jsx(x.Button,{icon:n.jsx(I,{type:"upload"}),children:t})}),n.jsx(x.Button,{type:"dashed",onClick:i,children:s})]})]})},Ct=l.memo(mt),Tt=()=>{const[e,t]=l.useState(!1),[s,o]=l.useState(!1),[r,i]=l.useState(!1),[c,a]=l.useState(3),[d,u]=l.useState(!1),[g,T]=l.useState(""),{widgetProps:y}=R(),{onSendMsg:b,chats:h}=z(),{onSubmitPYPwd:A=()=>{},onCheckPYAccess:E=()=>{}}=(y==null?void 0:y.onPayslipFn)||{},k=S("ProvidePasswordPayslip","Please provide your password account to access the download"),m=S("Cancel","Cancel"),f=S("Submit","Submit"),C=S("Password","Password"),j=S("IsRequired","Is Required"),p=S("PasswordPayslipValid","Your password is valid. Please download the payslip file"),L=S("AttemptPasswordExceeded","Your attempt to enter the password exceeded the limit"),_=S("VerifyAccessPayslip","Please wait, verifying access to your payslip"),N=S("WrongPwdPayslip","The password you entered is incorrect. Please try again or contact support if you need assistance"),F=S("SessionExpired","Session expired. Please log in again to continue"),[M]=x.Form.useForm(),w=()=>{var D,O,B;i(!0),u(!0),(B=(O=(D=E())==null?void 0:D.then($=>{var U,X;const W=(X=(U=$==null?void 0:$.data)==null?void 0:U.DATA)==null?void 0:X.RESULT;W&&b({msg:"Valid"}),t(W),T("")}))==null?void 0:O.catch($=>{T($==null?void 0:$.toString())}))==null||B.finally(()=>{o(!1),u(!1)})},v=()=>{b({msg:"cancel"}),i(!1)},H=()=>{var O;const D=M==null?void 0:M.getFieldValue("pwd");(O=M==null?void 0:M.validateFields())==null||O.then(()=>{var B,$;o(!0),($=(B=A(D))==null?void 0:B.then(({data:W})=>{var U;(U=W==null?void 0:W.DATA)!=null&&U.ISVALID?w():(T(N),a(c-1),o(!1))}))==null||$.catch(W=>{var X,Y,Le,ve,_e;const U=W==null?void 0:W.response;if((U==null?void 0:U.status)===401){const nn=(Y=(X=U==null?void 0:U.data)==null?void 0:X.ERRORS)==null?void 0:Y.includes("ACCESS_TOKEN_EXPIRED"),tn=(_e=(ve=(Le=U==null?void 0:U.data)==null?void 0:Le.MESSAGE)==null?void 0:ve.toLowerCase())==null?void 0:_e.includes("invalid password");nn&&T(F),tn&&(T(N),a(c-1),o(!1))}else T(W==null?void 0:W.toString());o(!1)})})};return l.useEffect(()=>{var O;const D=h==null?void 0:h[(h==null?void 0:h.length)-1];((O=D==null?void 0:D.attachment)==null?void 0:O.type)==="show_password_wp"&&w()},[]),r?d?n.jsx(ie,{sender:"response",text:`${_}...`}):c===0?n.jsx(ie,{sender:"response",text:L}):g?n.jsx(ie,{sender:"response",text:g}):n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[n.jsx(x.Form,{form:M,layout:"vertical",children:n.jsx(x.Form.Item,{name:"pwd",label:e?p:k,rules:[{required:!0,message:`${C} ${j}`}],children:n.jsx(x.Input.Password,{...e&&{disabled:!0,style:{display:"none"}}})})}),!e&&n.jsxs("div",{style:{display:"flex",gap:8},children:[n.jsx(x.Button,{disabled:s,onClick:v,children:m}),n.jsx(x.Button,{type:"primary",onClick:H,loading:s,children:f})]})]}):null},yt=l.memo(Tt),bt=({...e})=>{const{objInitPayload:t}=R(),s=l.useMemo(()=>Ne(t==null?void 0:t.access_token),[t]),o=()=>{var i,c;const r=e==null?void 0:e.attachment;(c=q({method:"POST",url:r==null?void 0:r.endpoint,data:r==null?void 0:r.body,headers:{Authorization:`Bearer ${t==null?void 0:t.access_token}`,"Content-Type":r==null?void 0:r.headers["Content-Type"],coid:t==null?void 0:t.companyid,"Company-Id":t==null?void 0:t.companyid,"Acc-Name":(i=s==null?void 0:s.INSTANCE)==null?void 0:i.toLowerCase()},responseType:"blob"}))==null||c.then(a=>{var y;const d=(y=r==null?void 0:r.body)==null?void 0:y.media,u=`${r==null?void 0:r.filename}.${d}`,g=new Blob([a==null?void 0:a.data]),T=URL==null?void 0:URL.createObjectURL(g);Se({downloadURL:T,fileName:u}),URL.revokeObjectURL(T)})};return n.jsx(x.Button,{onClick:o,children:"Download file"})},ht=l.memo(bt),jt=({...e})=>{const t=l.useRef(),s=S("DownloadChart","Download Chart"),o=l.useMemo(()=>e==null?void 0:e.attachment,[e==null?void 0:e.attachment]),r=l.useMemo(()=>{var c;return(c=o==null?void 0:o.data)==null?void 0:c.map((a,d)=>{var u,g;return{label:(u=o==null?void 0:o.labels)==null?void 0:u[d],value:a,color:(g=o==null?void 0:o.colors)==null?void 0:g[d]}})},[o]),i=()=>{var a;const c=(a=document==null?void 0:document.querySelector(".chart_widget canvas"))==null?void 0:a.toDataURL();Se({fileName:o==null?void 0:o.title,downloadURL:c})};return n.jsxs(n.Fragment,{children:[n.jsx(an.Pie,{className:"chart_widget",ref:t,data:r,angleField:"value",colorField:"label",label:{text:"label",style:{fontWeight:"bold"}},legend:{color:{title:!0,position:"bottom",rowPadding:5}}}),n.jsx("div",{style:{textAlign:"center"},children:n.jsx(x.Button,{onClick:()=>{i()},children:s})})]})},St=l.memo(jt),kt=({...e})=>{var t,s,o,r,i;switch(!0){case((t=te(e))==null?void 0:t.text):return n.jsx(ie,{...e});case((s=te(e))==null?void 0:s.upload):return n.jsx(Ct,{...e});case((o=te(e))==null?void 0:o.password):return n.jsx(yt,{...e});case((r=te(e))==null?void 0:r.filedownload):return n.jsx(ht,{...e});case((i=te(e))==null?void 0:i.chart):return n.jsx(St,{...e});default:return null}},Et=l.memo(kt),At=()=>{const{isOpenWidget:e,widgetProps:t}=R(),{chats:s,isWaitResponse:o}=z(),{activeTab:r}=Z();return l.useEffect(()=>{Q()},[r]),e?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"w-bubble-chat-container",children:s==null?void 0:s.map((i,c)=>{var d;const a=(d=te(i))==null?void 0:d.text;return n.jsxs(l.Fragment,{children:[(i==null?void 0:i.sender)==="response"&&!a&&n.jsx(ae,{name:t==null?void 0:t.title,src:xe}),n.jsx(Et,{indexChat:c,...i})]},c)})}),o&&n.jsx(pe,{})]}):null},wt=l.memo(At),pt=()=>{var f;const e=S("ContinueWithoutUpload","Continue without Upload"),{onSendMsg:t,setChats:s,isWaitResponse:o,loadingRegenerate:r,file:i,setFile:c,chats:a,connected:d}=z(),{isActiveTabVA:u}=Z(),g=l.useMemo(()=>{var j;const C=a==null?void 0:a[(a==null?void 0:a.length)-1];return(C==null?void 0:C.sender)==="response"&&((j=C==null?void 0:C.attachment)==null?void 0:j.type)==="fileuploader"},[a]),T=l.useRef(),[y,b]=l.useState(!1),[h,A]=l.useState(!1),E=l.useMemo(()=>o||!h,[h,o]),k=()=>{var p,L,_,N;const C=(_=(L=(p=T==null?void 0:T.current)==null?void 0:p.resizableTextArea)==null?void 0:L.textArea)==null?void 0:_.value;if(!(C!=null&&C.trim())||o)return;A(!1),t({msg:C}),b(!y);const j={text:C,sender:"client",type:"text",timestamp:(N=V())==null?void 0:N.format("hh:mm A")};s(F=>[...F,j]),Q()},m=()=>{t({msg:"SKIP_WAITING_RESPONSE"})};return l.useEffect(()=>{var C;T!=null&&T.current&&u&&((C=T==null?void 0:T.current)==null||C.focus())},[u]),g?n.jsxs("div",{className:"w-input-container",style:{alignItems:"center"},children:[n.jsx(x.Typography.Text,{children:i==null?void 0:i.name}),((f=Object==null?void 0:Object.keys(i||{}))==null?void 0:f.length)>0?n.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[n.jsx(x.Button,{danger:!0,icon:n.jsx(I,{type:"delete"}),shape:"circle",onClick:()=>c({})}),n.jsx(x.Button,{className:"w-send-btn",style:{backgroundColor:"var(--primary-color, #395ebc)"},icon:n.jsx(I,{type:"send"}),shape:"circle",onClick:k})]}):n.jsx(x.Tooltip,{title:e,children:n.jsx(x.Button,{icon:n.jsx(I,{type:"close"}),shape:"circle",onClick:()=>{t({msg:"CANCEL UPLOAD"})}})})]}):n.jsxs("div",{className:"w-input-container",children:[n.jsx(x.Input.TextArea,{className:"w-input-widget",disabled:!d,ref:T,placeholder:"Type a message...",onKeyDown:C=>{((C==null?void 0:C.code)==="Enter"||(C==null?void 0:C.key)==="Enter")&&!(C!=null&&C.shiftKey)&&k()},onChange:({target:{value:C}})=>{const j=/\S/;ge({input_va_value:C}),C&&(j!=null&&j.test(C))?A(!0):C!=null&&C.trim()||A(!1)}},y),o||r?n.jsx(x.Button,{style:{border:"none"},icon:n.jsx(I,{type:"stop"}),shape:"circle",onClick:m,size:"large"}):n.jsx(x.Button,{className:`w-send-btn ${E?"w-send-btn-disabled":""}`,disabled:E,style:{backgroundColor:"var(--primary-color, #395ebc)"},icon:n.jsx(I,{type:"send"}),shape:"circle",onClick:k})]})},Lt=l.memo(pt),vt=({taskStatus:e})=>{const t=S("InProgress","In Progress"),s=S("New","New"),o=S("Closed","Closed"),r=S("Done","Done"),i=S("HDCancelled","Cancelled"),c={"In Progress":t,Open:s,New:s,Closed:o,Fixed:r,Cancelled:i},a={"In Progress":"#FFF2D6",Responded:"#FFF2D6",Open:"#e9e2f8",Reopen:"#e9e2f8",Closed:"#e1ebfd",Fixed:"#bbfab7",Done:"#bbfab7",Cancelled:"#FFF2D6"},d=l.useMemo(()=>a[e]||a.Closed,[e]),u=l.useMemo(()=>c[e]||e,[e]);return n.jsx(x.Tag,{color:d,children:n.jsx(x.Typography.Text,{className:"primary-color-active",style:{width:"100%",textAlign:"center"},ellipsis:{tooltip:u},children:u})},e)},Ye=l.memo(vt),_t=({onClick:e,...t})=>n.jsxs("div",{className:"w-ticket-card-container",...typeof e=="function"&&{onClick:e},children:[n.jsx(x.Typography.Text,{strong:!0,style:{color:"var(--primary-color, #395ebc)",fontSize:16,marginBottom:10,display:"block"},children:t==null?void 0:t.TASK_NAME}),n.jsxs("div",{className:"w-ticket-card-content-container",children:[n.jsxs("div",{className:"w-ticket-card-cat-code",children:[n.jsx(x.Typography.Text,{children:(t==null?void 0:t.TASK_CATEGORY)||De}),n.jsx(x.Typography.Text,{children:(t==null?void 0:t.TASK_CODE)||De})]}),n.jsxs("div",{className:"w-ticket-card-status-date",style:{alignItems:"flex-end"},children:[n.jsx(Ye,{taskStatus:t==null?void 0:t.TASK_STATUS}),n.jsx(x.Typography.Text,{children:t==null?void 0:t.CREATED_DATE})]})]})]}),Dt=l.memo(_t),qe=()=>{const{objInitPayload:e,setObjInitPayload:t,parsedJWT:s}=R(),o=l.useMemo(()=>{var i;return{Authorization:`Bearer ${e==null?void 0:e.access_token}`,coid:s==null?void 0:s.COID,"Acc-Name":(i=s==null?void 0:s.INSTANCE)==null?void 0:i.toLowerCase(),"Company-Id":e==null?void 0:e.companyid,Language:e==null?void 0:e.lang}},[e]);return async i=>{var u,g,T;const{onSuccess:c,onError:a,onFinally:d}=i??{};(T=(g=(u=q({url:e==null?void 0:e.uriBackend,params:{ofid:"sfsystem.RefreshToken",accname:e==null?void 0:e.companycode},data:{refreshtoken:(e==null?void 0:e.refresh_token)||"4D8C30EE29749D0F06B4F6E2527516B397C09D4DB148D42214E2941C7A86139D3CB512D925E1B098C6090A45E6BCC545723222FA3BABDC2A"},headers:o,method:"POST"}))==null?void 0:u.then(y=>{var A;const b=(A=y==null?void 0:y.data)==null?void 0:A.DATA,h={access_token:b==null?void 0:b.JWT_TOKEN,refresh_token:e==null?void 0:e.refresh_token,uagent:e==null?void 0:e.uagent,uriBackend:e==null?void 0:e.uriBackend,uriService:e==null?void 0:e.uriService,companyid:e==null?void 0:e.companyid,companycode:e==null?void 0:e.companycode,lang:e==null?void 0:e.lang,uriBackendEnt:e==null?void 0:e.uriBackendEnt,uriBackendHRMGO:e==null?void 0:e.uriBackendHRMGO,config:e==null?void 0:e.config};t(h),typeof c=="function"&&c(y)}))==null?void 0:g.catch(y=>{typeof a=="function"&&a(y)}))==null||T.finally(()=>{typeof d=="function"&&d()})}},me=()=>{var c;const e=l.useRef(new AbortController),{objInitPayload:t,parsedJWT:s}=R(),o=qe(),r={Authorization:`Bearer ${t==null?void 0:t.access_token}`,coid:s==null?void 0:s.COID,"Acc-Name":(c=s==null?void 0:s.INSTANCE)==null?void 0:c.toLowerCase(),"Company-Id":t==null?void 0:t.companyid,Language:t==null?void 0:t.lang},i=async({url:a,endpoint:d,method:u="POST",headers:g,...T})=>{var A,E,k,m,f;const y={url:a||`${t==null?void 0:t.uriBackendHRMGO}${d}`,...e.current&&{signal:(A=e==null?void 0:e.current)==null?void 0:A.signal},headers:{...r,...g,"Company-Code":t==null?void 0:t.companycode},method:u,...T},b=q==null?void 0:q.create(y);return(k=(E=b==null?void 0:b.interceptors)==null?void 0:E.request)==null||k.use(C=>(t!=null&&t.access_token&&(C.headers.Authorization=`Bearer ${t==null?void 0:t.access_token}`),C),C=>{Promise.reject(C)}),(f=(m=b==null?void 0:b.interceptors)==null?void 0:m.response)==null||f.use(C=>C,async C=>{var p;const j=C==null?void 0:C.config;if(((p=C==null?void 0:C.response)==null?void 0:p.status)===401){const L=await o();return j.headers.Authorization=`Bearer ${L}`,q(j)}return Promise==null?void 0:Promise.reject(C)}),await(b==null?void 0:b.request(y))};return i.abort=()=>{var a;e!=null&&e.current&&((a=e==null?void 0:e.current)==null||a.abort(),e.current=new AbortController)},l.useEffect(()=>()=>i.abort(),[]),i},Qe=l.createContext({}),K=()=>l.useContext(Qe),Mt=({children:e})=>{const t=me(),[s,o]=l.useState([]),[r,i]=l.useState(""),[c,a]=l.useState(!1),[d,u]=l.useState(!0),[g,T]=l.useState(0),y=b=>{var h,A,E,k;u(!0),(k=(E=t({endpoint:"/helpdesk/myticket/ticket-list",method:"POST",data:{LIMIT:20,PAGE:1,SEARCH:{MY_TICKET:!0,TASK_MODULE:"HD",...((h=Object.keys(b||{}))==null?void 0:h.length)>0&&{...b,...(b==null?void 0:b.CREATED_DATE)&&{CREATED_DATE:(A=V(b==null?void 0:b.CREATED_DATE))==null?void 0:A.format(je)}}},SORT:{FIELD:"t.created_date",ORDER:"DESC"}}}))==null?void 0:E.then(m=>{var f,C,j;(f=m==null?void 0:m.data)!=null&&f.DATA&&o((j=(C=m==null?void 0:m.data)==null?void 0:C.DATA)==null?void 0:j.LIST)}))==null||k.finally(()=>{u(!1)})};return l.useEffect(()=>{y()},[]),n.jsx(Qe.Provider,{value:{listTicket:s,ticketId:r,setTicketId:i,getListTicket:y,openFilter:c,setOpenFilter:a,loadingListTicket:d,countFilters:g,setCountFilters:T},children:e})},Ot=()=>{const e=S("SubjectSearch","Subject Search"),t=S("AdvanceFilter","Advance Filter"),s=l.useRef(null),{getListTicket:o,setOpenFilter:r,loadingListTicket:i,countFilters:c}=K();return n.jsx(n.Fragment,{children:n.jsxs("div",{style:{display:"flex",gap:8,marginBottom:12},children:[n.jsx(x.Input,{placeholder:e,onChange:({target:{value:a}})=>{clearTimeout(s==null?void 0:s.current),s.current=setTimeout(()=>{o({TASK_NAME:a})},250)},allowClear:!0}),n.jsx(x.Tooltip,{title:`${t} (${c})`,children:n.jsx(x.Badge,{count:c,children:n.jsx(x.Button,{loading:i,icon:n.jsx(I,{type:"filter"}),onClick:()=>{r(!0)}})})})]})})},Rt=l.memo(Ot),Ze=l.createContext({}),J=()=>l.useContext(Ze),Ft=({children:e})=>{const t=l.useRef(null),s=l.useRef(0),o=l.useRef(!1),r=l.useRef(null),[i,c]=l.useState([]),[a,d]=l.useState(0),{objInitPayload:u,parsedJWT:g,isFirstRenderHelpdesk:T,setShowReadyWSHD:y}=R(),b=qe(),h=m=>{const f=new WebSocket(m);f.onopen=()=>{o.current=!0,s.current=0,d(0),y(!0)},f.onerror=C=>{y(!1),console.error(`${ne} - WebSocket error:`,C)},f.onclose=C=>{console.warn(`${ne} - WebSocket disconnected:`,C),o.current=!1,y(!1),!(C!=null&&C.wasClean)&&(s==null?void 0:s.current)<re&&(s.current+=1,d(j=>j+1),clearTimeout(r.current),r.current=setTimeout(A,2e3))},f.onmessage=E(f),t.current=f},A=async()=>{var F,M,w;if(((F=t.current)==null?void 0:F.readyState)===(WebSocket==null?void 0:WebSocket.CONNECTING))return;const{access_token:m,companyid:f="",companycode:C="",lang:j="",uriBackendHRMGO:p=""}=u??{};if(!m||!f||!C){console.warn(`${ne} - Missing required WebSocket credentials.`);return}const L=`Bearer ${m}`,_=(M=`${p}/ws`)==null?void 0:M.replace("https://","wss://"),N={COMPANY_ID:f.toString(),COMPANY_CODE:C.toLowerCase(),LANGUAGE:j,ACC_NAME:(w=g==null?void 0:g.INSTANCE)==null?void 0:w.toLowerCase(),TOKEN:L};try{const v=await Ln(N,Sn);if(!v||o.current||(s==null?void 0:s.current)>=re){console.warn(`${ne} - Skipping WebSocket connection attempt.`);return}t.current&&t.current.close(),h(`${_}?t=${v}`)}catch(v){console.error(`${ne} - Failed to encrypt token:`,v)}},E=m=>f=>{var C;try{if((f==null?void 0:f.data)==="PING")m.send("PONG");else{const{DATA:j,EVENT:p}=JSON.parse(f.data||"{}");!T.current&&p==="USER_ONLINE_NOTIF"&&Array.isArray(j==null?void 0:j.EMPLOYEES)&&(c((C=j==null?void 0:j.EMPLOYEES)==null?void 0:C.filter(Boolean)),T.current=!0),p==="TOKEN_EXPIRED"&&b({onSuccess:()=>{A()}})}}catch{console.error(`${ne} - Invalid WebSocket message:`,f.data)}},k=({event:m,data:f,module:C="HELPDESK_CHAT"})=>{var j;(j=t==null?void 0:t.current)==null||j.send(JSON.stringify({EVENT:m,DATA:f,MODULE:C}))};return l.useEffect(()=>{T.current||A()},[]),n.jsx(Ze.Provider,{value:{ws:t==null?void 0:t.current,onSendMsg:k,userOnline:i,connectWebSocket:A,retryCountState:a,setRetryCountState:d,retryCountRef:s},children:e})},Nt=()=>{var c;const{widgetProps:e}=R(),{listTicket:t,setTicketId:s,loadingListTicket:o}=K(),{onSendMsg:r}=J(),{xs:i}=x.Grid.useBreakpoint();return n.jsxs(n.Fragment,{children:[n.jsx(Rt,{}),o?n.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:(c=Array.from({length:5}))==null?void 0:c.map((a,d)=>n.jsx(x.Skeleton.Input,{style:{height:80,width:"100%",borderRadius:8}},d))}):n.jsx("div",{className:`w-list-ticket-container ${e!=null&&e.isSF?"w-list-ticket-container-sf":""} ${i?"w-list-ticket-container-mobile":""}`,...(t==null?void 0:t.length)===0&&{style:{justifyContent:"center"}},children:(t==null?void 0:t.length)>0?t==null?void 0:t.map((a,d)=>l.createElement(Dt,{...a,key:d,onClick:()=>{r({event:"JOIN_ROOM",data:{TASK_ID:a==null?void 0:a.TASK_ID}}),s(a==null?void 0:a.TASK_ID)}})):n.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",flex:1},children:n.jsx(x.Empty,{})})})]})},Ht=l.memo(Nt),Bt=({children:e,open:t,onClose:s,footer:o,styleContainer:r})=>{var y;const[i,c]=l.useState(!1),a=l.useRef(),d=l.useRef(null),u=l.useRef(),g=l.useMemo(()=>t?"w-fade-in-animate":"w-fade-out-animate",[t]),T=b=>{b.code==="Escape"&&!b.shiftKey&&!b.altKey&&!b.ctrlKey&&b.key==="Escape"&&(b.stopPropagation(),typeof s=="function"&&s())};return l.useEffect(()=>{const b=u.current;return b&&(clearTimeout(d.current),d.current=setTimeout(()=>{b==null||b.focus()},250),b==null||b.addEventListener("keydown",T)),t&&c(!1),clearTimeout(a==null?void 0:a.current),a.current=setTimeout(()=>{t||c(!0)},300),()=>{b&&(b==null||b.removeEventListener("keydown",T))}},[t]),n.jsxs("div",{className:`${g}`,tabIndex:1,ref:u,style:{display:i?"none":"block",height:"100%",...((y=Object==null?void 0:Object.keys(r||{}))==null?void 0:y.length)>0&&{...r}},children:[e,o&&o]})},Je=l.memo(Bt),Xe=l.createContext({}),ce=()=>l.useContext(Xe),It=({children:e})=>{const[t,s]=l.useState([]),[o,r]=l.useState({}),[i,c]=l.useState(!0),a=l.useRef(!1),d=me(),{ticketId:u}=K(),{ws:g}=J(),T=l.useMemo(()=>{var C;const E=(o==null?void 0:o.CREATED_BY)??{},k=(o==null?void 0:o.ASSIGNEE)??{},m=(o==null?void 0:o.OTHER_ASSIGNEE)??[],f=(C=[E,k,...m].map(j=>({...j})))==null?void 0:C.filter(j=>{var p;return((p=Object.keys(j||{}))==null?void 0:p.length)>0});return ke({ArrObj:f,key:"EMP_ID"})},[o]),y=()=>{var E,k;c(!0),(k=(E=d({endpoint:"/helpdesk/chat/list",method:"POST",data:{LIMIT:10,PAGE:1,TASK_ID:u}}))==null?void 0:E.then(m=>{var f,C,j,p,L,_;if(((j=(C=(f=m==null?void 0:m.data)==null?void 0:f.DATA)==null?void 0:C.LIST)==null?void 0:j.length)>0){const N=(_=(L=(p=m==null?void 0:m.data)==null?void 0:p.DATA)==null?void 0:L.LIST)==null?void 0:_.map(F=>({...F,ACTOR:{...F==null?void 0:F.ACTOR}}));s(ue(N))}else s({})}))==null||k.finally(()=>{c(!1)})},b=()=>{var E;(E=d({endpoint:"/helpdesk/myticket/get",method:"POST",data:{TASK_ID:u}}))==null||E.then(k=>{var m,f,C;if((m=k==null?void 0:k.data)!=null&&m.DATA){const j=(C=(f=k==null?void 0:k.data)==null?void 0:f.DATA)==null?void 0:C.LIST;r(j)}else r({})})},h=E=>{a.current||s(k=>{const f=[...Ee(k),{...E,CHAT_ALIGN:"from"}];return ue(f)}),a.current=!1},A=E=>{if((E==null?void 0:E.data)!=="PING"){const k=JSON.parse((E==null?void 0:E.data)||"{}"),{DATA:m={},EVENT:f=""}=k??{};(f==="RECEIVE_MESSAGE"||f==="RECEIVE_ANOTHER_MESSAGE")&&h(m)}};return l.useEffect(()=>(u&&(y(),b()),g&&u&&(g==null||g.addEventListener("message",A)),()=>{g&&u&&(g==null||g.removeEventListener("message",A))}),[u]),n.jsx(Xe.Provider,{value:{chats:t,setChats:s,detailTicket:o,employees:T,isFromSelf:a,loadingChats:i},children:e})},$t=()=>{const{xs:e}=x.Grid.useBreakpoint(),{employees:t,detailTicket:s,loadingChats:o}=ce(),{setTicketId:r}=K(),{userOnline:i}=J(),c=l.useMemo(()=>{var d;return(d=t==null?void 0:t.map(u=>u==null?void 0:u.FULL_NAME))==null?void 0:d.join(", ")},[t]),a=l.useMemo(()=>e?"click":"hover",[e]);return o?n.jsxs("div",{className:"w-ticket-detail-header-container",children:[n.jsx(x.Skeleton.Avatar,{}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[n.jsx(x.Skeleton.Input,{}),n.jsx(x.Skeleton.Input,{size:"small"})]}),n.jsx(x.Skeleton.Input,{})]}):n.jsxs("div",{className:"w-ticket-detail-header-container",children:[n.jsxs("div",{style:{display:"flex",gap:8},children:[n.jsx(x.Button,{icon:n.jsx(I,{type:"down"}),style:{border:"none"},onClick:()=>{r("")}}),n.jsx(P.Group,{maxCount:2,maxPopoverTrigger:a,maxStyle:{color:"#f56a00",backgroundColor:"#fde3cf",cursor:"pointer"},children:t==null?void 0:t.map((d,u)=>{const g=i==null?void 0:i.includes(d==null?void 0:d.EMP_ID);return n.jsx(x.Tooltip,{title:d==null?void 0:d.FULL_NAME,trigger:a,children:l.createElement(P,{...g&&{style:{border:"2px solid green",borderRadius:"50%"}},src:d==null?void 0:d.PHOTO,key:u,nameFallback:d==null?void 0:d.FULL_NAME})},u)})}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",width:150},children:[n.jsx(x.Tooltip,{title:`${s==null?void 0:s.TASK_CODE} - ${s==null?void 0:s.SUBJECT}`,trigger:a,children:n.jsxs(x.Typography.Text,{className:"w-ticket-detail-header-text",children:[s==null?void 0:s.TASK_CODE," - ",s==null?void 0:s.SUBJECT]})}),n.jsx(x.Tooltip,{title:c,trigger:a,children:n.jsx(x.Typography.Text,{type:"secondary",className:"w-ticket-detail-header-text",style:{fontSize:12},children:c})})]})]}),n.jsx(Ye,{taskStatus:s==null?void 0:s.STATUS})]})},Ut=l.memo($t),Wt=({...e})=>{const t=l.useMemo(()=>(e==null?void 0:e.CHAT_ALIGN)==="to"?"client":"response",[e]);return n.jsxs("div",{className:`w-bubble-chat ${`w-${t}`}`,children:[n.jsx("p",{dangerouslySetInnerHTML:{__html:e==null?void 0:e.MESSAGE}}),n.jsx(de,{date:e==null?void 0:e.CREATED_DATE,format:fe,sender:t})]})},Gt=l.memo(Wt),Vt=({...e})=>{const t=S("Download","Download"),s=l.useMemo(()=>(e==null?void 0:e.CHAT_ALIGN)==="to"?"client":"response",[e]),o=l.useMemo(()=>{var d;const a=e==null?void 0:e.ATTACHMENT;if(a)try{const u=new URL(a),g=(d=u==null?void 0:u.pathname)==null?void 0:d.split("/");return g==null?void 0:g[(g==null?void 0:g.length)-1]}catch{return a}return""},[e]),r=l.useMemo(()=>{if(o!=null&&o.includes(".")){const a=o==null?void 0:o.split(".");return`.${a==null?void 0:a[(a==null?void 0:a.length)-1]}`}return""},[e,o]),i=l.useMemo(()=>Ce==null?void 0:Ce.includes(r),[e,r]),c=()=>{Se({downloadURL:e==null?void 0:e.ATTACHMENT,fileName:o,isOpenNewTab:!0})};return n.jsx(n.Fragment,{children:n.jsxs("div",{className:`w-bubble-chat ${`w-${s}`}`,style:{display:"flex",flexDirection:"column"},children:[i?n.jsx(we,{src:e==null?void 0:e.ATTACHMENT,fallback:jn}):n.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[n.jsx(I,{type:"file"}),n.jsx(x.Typography.Link,{onClick:c,style:{display:"block",width:160},children:o})]}),i&&n.jsx(x.Button,{onClick:c,style:{display:"block",margin:"10px auto 0px"},children:t}),n.jsx(de,{date:e==null?void 0:e.CREATED_DATE,format:fe,...s==="client"&&{style:{alignSelf:"flex-end"}}})]})})},zt=l.memo(Vt),Kt=({...e})=>{const t=l.useMemo(()=>(e==null?void 0:e.CHAT_ALIGN)==="to"?"client":"response",[e]);return n.jsxs("div",{className:"w-ticket-info-chat-container",children:[n.jsx(de,{date:e==null?void 0:e.CREATED_DATE,format:fe,sender:t}),n.jsx(x.Typography.Text,{children:e==null?void 0:e.MESSAGE})]})},Yt=l.memo(Kt),Pe=()=>{const{widgetProps:e}=R(),t=ee.enc.Hex.parse(ee.enc.Utf8.parse(e==null?void 0:e.keyEncrypt).toString()),s={mode:ee.mode.ECB,padding:ee.pad.Pkcs7},o=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|GreatDayHR/i.test(navigator.userAgent),r=c=>{if(typeof c=="number"&&(c=c.toString()),!c)return"";if(o)return window.encodeURIComponent(c);const a=ee.enc.Utf8.parse(c),d=ee.AES.encrypt(a,t,s).toString();return window.encodeURIComponent(`$${d}`)};return{paramsEncrypt:c=>{const[a,d=null]=c.split("?"),u=a.split("/").map(g=>{const[,T=null]=g.split(":");return T&&(e!=null&&e.keyEncrypt)?r(T):g}).join("/");return d?`${u}?${d}`:u},encrypt:r}},qt=({...e})=>{const t=S("ViewFAQ","View FAQ"),s=S("FAQUnavailable","FAQ unavailable"),o=S("ThisFAQIsUnavailable","This FAQ is unavailable"),{paramsEncrypt:r}=Pe(),{history:i}=R(),c=l.useMemo(()=>(e==null?void 0:e.CHAT_ALIGN)==="to"?"client":"response",[e]),a=l.useMemo(()=>e==null?void 0:e.FAQ_ID,[e]);return n.jsxs("div",{className:`w-bubble-chat ${`w-${c}`}`,children:[n.jsx(x.Typography.Text,{style:{backgroundColor:"rgb(244, 245, 246)",padding:8,borderRadius:8,fontWeight:600,marginBottom:8,display:"block"},children:a?e==null?void 0:e.MESSAGE:s}),a?n.jsx(x.Button,{block:!0,onClick:()=>{typeof i<"u"&&i.push(r(`/standard/hrm.helpdesk.FAQ-detail/:${a}`))},children:t}):n.jsx(x.Typography.Text,{children:o}),n.jsx(de,{date:e==null?void 0:e.CREATED_DATE,format:fe,sender:c})]})},Qt=l.memo(qt),Zt=({...e})=>{switch(e==null?void 0:e.CHAT_TYPE){case"info":return n.jsx(Yt,{...e});case"faq":return n.jsx(Qt,{...e});case"chat":return e!=null&&e.ATTACHMENT?n.jsx(zt,{...e}):n.jsx(Gt,{...e});default:return null}},Jt=l.memo(Zt),Xt=()=>{const{employees:e}=ce(),[t,s]=l.useState([]),o=S("And","and"),r=S("IsTyping","Is Typing"),i=S("People","People"),{ws:c}=J(),a=l.useMemo(()=>{const u=t==null?void 0:t.map(g=>g==null?void 0:g.FULL_NAME);if((t==null?void 0:t.length)>2){const g=u==null?void 0:u.filter((y,b)=>b<=1),T=u==null?void 0:u.filter((y,b)=>b>1);return`${g==null?void 0:g.join(", ")}, ${o} ${T==null?void 0:T.length} ${i} ${r}`}return`${u==null?void 0:u.join(", ")} ${r}`},[t]),d=u=>{if((u==null?void 0:u.data)!=="PING"){const g=JSON.parse((u==null?void 0:u.data)||"{}"),{DATA:T={},EVENT:y=""}=g??{};if(y==="TYPING"){const b=e==null?void 0:e.find(A=>(A==null?void 0:A.EMP_ID)===(T==null?void 0:T.EMPLOYEE_ID)),h={...T,...b};s(A=>{const E=[...A,h],k=ke({ArrObj:E,key:"EMPLOYEE_ID"});return k==null?void 0:k.filter(m=>m==null?void 0:m.IS_TYPING)})}}};return l.useEffect(()=>(c&&(c==null||c.addEventListener("message",d)),()=>{c&&(c==null||c.removeEventListener("message",d))}),[e]),(t==null?void 0:t.length)===0?null:n.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[n.jsx(P.Group,{maxCount:2,maxPopoverTrigger:"click",maxStyle:{color:"#f56a00",backgroundColor:"#fde3cf",cursor:"pointer"},children:t==null?void 0:t.map((u,g)=>n.jsx(x.Tooltip,{title:u==null?void 0:u.FULL_NAME,children:n.jsx(P,{src:u==null?void 0:u.PHOTO,nameFallback:u==null?void 0:u.FULL_NAME})},g))}),n.jsx(x.Typography.Text,{children:a}),(t==null?void 0:t.length)>0?n.jsx(Ke,{}):null]})},Pt=l.memo(Xt),es=()=>{var i;const{chats:e}=ce(),{widgetProps:t}=R(),{activeTab:s}=Z(),o=l.useRef(),{xs:r}=x.Grid.useBreakpoint();return l.useEffect(()=>{clearTimeout(o.current),o.current=setTimeout(()=>{Q(".w-ticket-detail-content-container")},350)},[s]),n.jsxs("div",{className:`w-ticket-detail-content-container ${r?t!=null&&t.isSF?"w-ticket-detail-content-container-sf-mobile":"w-ticket-detail-content-container-mobile":""} `,children:[(i=Object.keys(e||{}))==null?void 0:i.map(c=>{var d,u;const a=e==null?void 0:e[c];return n.jsxs(l.Fragment,{children:[n.jsx("div",{className:"w-datekey-chats",children:(d=V(c))==null?void 0:d.format("ddd, DD MMMM YYYY")}),n.jsx("div",{className:"w-bubble-chat-container",children:(u=Be(a))==null?void 0:u.map((g,T)=>{var h,A;const y=(g==null?void 0:g.CHAT_ALIGN)==="to"?"client":"response",b=g==null?void 0:g.CHAT_TYPE;return n.jsxs(l.Fragment,{children:[y==="response"&&b!=="info"&&n.jsx(ae,{src:(h=g==null?void 0:g.ACTOR)==null?void 0:h.PHOTO,name:(A=g==null?void 0:g.ACTOR)==null?void 0:A.FULL_NAME}),n.jsx(Jt,{...g})]},T)})})]},c)}),n.jsx(Pt,{})]})},ns=l.memo(es),ts=()=>{var i,c;const{chats:e,loadingChats:t}=ce(),{widgetProps:s}=R(),{xs:o}=x.Grid.useBreakpoint(),r=l.useMemo(()=>{var d;const a=[ye];return o&&(s!=null&&s.isSF?a==null||a.push(`${ye}-sf-mobile`):a==null||a.push(`${ye}-mobile`)),(d=a==null?void 0:a.filter(Boolean))==null?void 0:d.join(" ")},[o,s==null?void 0:s.isSF]);return t?n.jsx("div",{className:`${r} w-ticket-detail-loading-chats`,children:(i=Array.from({length:3}))==null?void 0:i.map((a,d)=>{const u=d%2===0;return n.jsxs("div",{style:{display:"flex",gap:8,...u&&{alignSelf:"flex-end"}},children:[n.jsx("div",{style:{order:u?2:1},children:n.jsx(x.Skeleton.Avatar,{})}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,order:u?1:2},children:[n.jsx(x.Skeleton.Input,{style:{width:120,borderRadius:8}}),n.jsx(x.Skeleton.Input,{style:{height:50,width:"100%",borderRadius:8}})]})]},d)})}):((c=Object.keys(e||{}))==null?void 0:c.length)===0?n.jsx("div",{className:r,style:{display:"flex",justifyContent:"center",alignItems:"center"},children:n.jsx(x.Empty,{})}):n.jsx(ns,{})},ss=l.memo(ts),os=({...e})=>{const t=l.useRef(0);return n.jsxs("div",{style:{display:"flex",gap:8},onClick:s=>{s==null||s.stopPropagation()},children:[n.jsx(we,{nameFallback:e==null?void 0:e.FULL_NAME,src:e==null?void 0:e.PHOTO,width:80,placeholder:n.jsx(x.Skeleton.Image,{style:{width:"100%",height:"100%"}}),style:{borderRadius:8},preview:!1,loading:"lazy",onError:s=>{t.current+=1,(t==null?void 0:t.current)<3?s.target.src=Ie(e==null?void 0:e.PHOTO):s.target.src=Ae(e==null?void 0:e.FULL_NAME)}}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[n.jsx(x.Typography.Text,{strong:!0,style:{fontSize:18},children:e==null?void 0:e.FULL_NAME}),n.jsx(x.Typography.Text,{children:e==null?void 0:e.POSITION_NAME},e==null?void 0:e.POSITION_NAME),n.jsx(x.Typography.Text,{children:e==null?void 0:e.DEPT_NAME}),n.jsx(x.Typography.Text,{children:e==null?void 0:e.WORKLOCATION})]})]})},cs=l.memo(os),ls=({setLoadingUpload:e,isLoadingUpload:t})=>{var k,m;const s=me(),[o,r]=l.useState({}),i=l.useRef(null),c=S("ImageMustSmallerThan","Image must smaller than"),a=S("MaximumFileSizeExceeded","Maximum file size exceeded"),{onSendMsg:d}=J(),{employees:u,setChats:g,isFromSelf:T}=ce(),{ticketId:y}=K(),{activeTab:b}=Z(),h=()=>{var f;(f=s({endpoint:"/upload/get-upload-config",data:{LIMIT:1,PAGE:1,SEARCH:{UPLOAD_CODE:"helpdesk"}}}))==null||f.then(C=>{var p,L;const j=(L=(p=C==null?void 0:C.data)==null?void 0:p.DATA)==null?void 0:L.LIST;(j==null?void 0:j.length)>0&&r(j==null?void 0:j[0])})},A=f=>{var p,L,_;const C=f.size/1024/1024,j=(o==null?void 0:o.MAXFILESIZE)/1024;return C>j&&((p=x.notification)==null||p.destroy(),(L=x.notification)==null||L.config({getContainer:()=>document.querySelector(".w-widget-content-container"),top:28,placement:"top"}),(_=x.notification)==null||_.error({message:a,description:`${c} ${j==null?void 0:j.toFixed(1)} MB!`,className:"w-notification-content",duration:3})),!1},E=f=>{var j,p;e(!0);const C=new FormData;C.append("UPLOAD_CODE",o==null?void 0:o.UPLOAD_CODE),C.append("UPLOAD_TYPE",o==null?void 0:o.UPLOAD_TYPE),C.append("FILE",f),(p=(j=s({endpoint:"/upload/temp",data:C,headers:{"Content-Type":"multipart/form-data"}}))==null?void 0:j.then(L=>{var _,N,F,M,w;if((N=(_=L==null?void 0:L.data)==null?void 0:_.DATA)!=null&&N.LIST){const v=(M=(F=L==null?void 0:L.data)==null?void 0:F.DATA)==null?void 0:M.LIST,H={ATTACHMENT:v==null?void 0:v.VIEW_PATH,FAQ_ID:null,MESSAGE:"",CREATED_DATE:(w=V())==null?void 0:w.format(`${je} HH:mm:ss`),CHAT_ALIGN:"to",CHAT_TYPE:"chat"};g(D=>{const B=[...Ee(D),H];return ue(B)}),T.current=!0,d({event:"SEND_MESSAGE",data:{ATTACHMENT:v==null?void 0:v.TEMP_PATH,FAQ_ID:null,MESSAGE:"",EMPLOYEES:u==null?void 0:u.map(D=>D==null?void 0:D.EMP_ID),TASK_ID:y}}),clearTimeout(i.current),i.current=setTimeout(()=>{Q(".w-ticket-detail-content-container")},350)}}))==null||p.finally(()=>{e(!1)})};return l.useEffect(()=>{h()},[]),l.useEffect(()=>{var f;(f=x.notification)==null||f.destroy()},[b]),n.jsx(x.Upload,{beforeUpload:A,fileList:[],accept:(m=(k=o==null?void 0:o.EXT_LIST)==null?void 0:k.split(","))==null?void 0:m.map(f=>`.${f}`),onChange:f=>{E(f==null?void 0:f.file)},children:n.jsx(x.Button,{loading:t,icon:n.jsx(I,{type:"paper-clip"}),shape:"circle",style:{border:"none"}})})},rs=l.memo(ls),is=({refInput:e})=>{const{xs:t}=x.Grid.useBreakpoint(),s=l.useMemo(()=>t?"click":"hover",[t]),o=()=>{var y;const i=(y=e==null?void 0:e.current)==null?void 0:y.textarea;if(!i)return!1;const{selectionStart:c,selectionEnd:a,value:d}=i,u=d==null?void 0:d.substring(0,c),g=d==null?void 0:d.substring(c,a),T=d==null?void 0:d.substring(a);return{before:u,selectedText:g,after:T,selectionStart:c,selectionEnd:a,text:d}},r=i=>{var T,y;(T=e==null?void 0:e.current)==null||T.focus();const c=(y=e==null?void 0:e.current)==null?void 0:y.textarea,a=i==null?void 0:i.native;if(!c)return;const{before:d,after:u}=o(),g=`${d}${a}${u}`;typeof document.execCommand=="function"?document.execCommand("insertText",!1,a):c.value=g};return n.jsx(x.Popover,{trigger:s,content:n.jsx(dn,{onEmojiSelect:i=>{r(i)},theme:"auto"}),children:n.jsx(x.Button,{icon:n.jsx(I,{type:"smile"}),style:{border:"none"}})})},as=l.memo(is),ds=()=>{const[e,t]=l.useState(0),[s,o]=l.useState(!1),r=l.useRef(null),i=l.useRef(null),c=l.useRef(!1),a=l.useRef(null),{onSendMsg:d}=J(),{ticketId:u}=K(),{isActiveTabVA:g}=Z(),{employees:T,setChats:y,isFromSelf:b,detailTicket:h}=ce(),A=l.useMemo(()=>{var f;return((f=h==null?void 0:h.STATUS)==null?void 0:f.toString().toLowerCase())==="closed"},[h==null?void 0:h.STATUS]),E=l.useMemo(()=>T==null?void 0:T.map(f=>({...f,label:n.jsx(x.Popover,{placement:"left",content:n.jsx(cs,{...f}),children:n.jsx("div",{children:n.jsx(ae,{src:f==null?void 0:f.PHOTO,name:f==null?void 0:f.FULL_NAME})})}),value:f==null?void 0:f.FULL_NAME})),[T]),k=()=>{var j,p,L;const f=(p=(j=r==null?void 0:r.current)==null?void 0:j.textarea)==null?void 0:p.value;d({event:"SEND_MESSAGE",data:{ATTACHMENT:"",FAQ_ID:null,MESSAGE:f,EMPLOYEES:T==null?void 0:T.map(_=>_==null?void 0:_.EMP_ID),TASK_ID:u}});const C={ATTACHMENT:"",FAQ_ID:null,MESSAGE:f,CREATED_DATE:(L=V())==null?void 0:L.format(`${je} HH:mm:ss`),CHAT_ALIGN:"to",CHAT_TYPE:"chat"};y(_=>{const F=[...Ee(_),C];return ue(F)}),b.current=!0,Q(".w-ticket-detail-content-container"),t(_=>_+1)},m=()=>{window.clearTimeout(i.current),c.current||(c.current=!0,d({event:"TYPING",data:{TASK_ID:u,IS_TYPING:!0}})),i.current=setTimeout(()=>{d({event:"TYPING",data:{TASK_ID:u,IS_TYPING:!1}}),c.current=!1},250)};return l.useEffect(()=>{r!=null&&r.current&&!g&&u&&(clearTimeout(a.current),a.current=setTimeout(()=>{var f;(f=r==null?void 0:r.current)==null||f.focus()},500))},[g,u]),A?null:n.jsxs("div",{className:"w-input-container",style:{margin:0},children:[n.jsx(as,{refInput:r}),n.jsx(rs,{setLoadingUpload:o,isLoadingUpload:s}),n.jsx(x.Mentions,{autoSize:{maxRows:3},ref:r,className:"w-input-helpdesk",placeholder:"Type a message...",onChange:()=>{m()},onKeyDown:f=>{((f==null?void 0:f.code)==="Enter"||(f==null?void 0:f.key)==="Enter")&&!(f!=null&&f.shiftKey)&&k()},filterOption:(f,C)=>{var L,_,N;const j=(L=f==null?void 0:f.toString())==null?void 0:L.toLowerCase(),p=(N=(_=C==null?void 0:C.FULL_NAME)==null?void 0:_.toString())==null?void 0:N.toLowerCase();return p==null?void 0:p.includes(j)},children:E==null?void 0:E.map((f,C)=>n.jsx(x.Mentions.Option,{...f,children:f==null?void 0:f.label},C))},e),n.jsx(x.Button,{loading:s,disabled:s,className:"w-send-btn ",style:{backgroundColor:"var(--primary-color, #395ebc)"},icon:n.jsx(I,{type:"send"}),shape:"circle",onClick:k})]})},us=l.memo(ds),xs=({title:e,subTitle:t,onClose:s,open:o,styleWrapper:r})=>{var i;return o?n.jsx("div",{className:"w-banner-container",...((i=Object.keys(r||{}))==null?void 0:i.length)>0&&{style:r},children:n.jsxs("div",{className:"w-banner-content",children:[e&&n.jsx(x.Typography.Text,{style:{fontSize:16,fontWeight:600},children:e}),t&&n.jsx("div",{className:"w-banner-subtitle",children:t}),typeof s=="function"&&n.jsx("div",{className:"w-banner-close-btn",children:n.jsx(x.Button,{style:{border:"none",background:"transparent"},icon:n.jsx(I,{type:"close"}),onClick:()=>s()})})]})}):null},en=l.memo(xs),fs=()=>{const e=S("ForMoreInformationOfThisTicket","For more information of this ticket"),t=S("ClickHere","Click here"),{ticketId:s}=K(),{history:o}=R(),{encrypt:r}=Pe();return n.jsx(en,{subTitle:n.jsxs(n.Fragment,{children:[n.jsx(x.Typography.Text,{children:e}),n.jsx(x.Typography.Link,{strong:!0,className:"w-reconnect-manual",onClick:()=>{const i=r(s);o.push(`/standard/hrm.helpdesk.my-ticket.ticket-details?id=${i}`)},children:t})]}),open:!0,styleWrapper:{position:"sticky"}})},gs=l.memo(fs),ms=({onClose:e,visible:t})=>n.jsx(Je,{open:t,onClose:e,children:n.jsxs(It,{children:[n.jsx(Ut,{}),n.jsx(gs,{}),n.jsx(ss,{}),n.jsx(us,{})]})}),Cs=l.memo(ms),Ts=()=>{const e=S("AdvanceFilter","Advance Filter"),t=S("Subject","Subject"),s=S("TicketCategory","Ticket Category"),o=S("TicketStatus","Ticket Status"),r=S("CreatedDate","Created Date"),i=S("New","New"),c=S("Open","Open"),a=S("Reopen","Reopen"),d=S("InProgress","In Progress"),u=S("Responded","Responded"),g=S("Fixed","Fixed"),T=S("Done","Done"),y=S("Closed","Closed"),b=S("HDCancelled","Cancelled"),h=S("Clear","Clear"),A=S("Filter","Filter"),E=me(),[k]=x.Form.useForm(),{openFilter:m,setOpenFilter:f,getListTicket:C,setCountFilters:j}=K(),[p,L]=l.useState([]),_=l.useMemo(()=>{const M=`${i}/${c}/${a}`,w=`${d}/${u}`,v=`${g}/${T}`;return[{value:3,label:M},{value:1,label:w},{value:4,label:v},{value:6,label:y},{value:8,label:b}]},[]),N=()=>{var M;(M=E({endpoint:"/helpdesk/category/list",data:{LIMIT:999999,PAGE:1,SELECTOR:"*",SORT:{FIELD:"ORDER_NO",ORDER:"ASC"}}}))==null||M.then(w=>{var v,H,D;if((v=w==null?void 0:w.data)!=null&&v.DATA){const O=(D=(H=w==null?void 0:w.data)==null?void 0:H.DATA)==null?void 0:D.LIST;L(O==null?void 0:O.map(B=>({label:B==null?void 0:B.CATEGORY_NAME,value:B==null?void 0:B.CATEGORY_CODE})))}})},F=()=>{var v,H;const M=k==null?void 0:k.getFieldsValue(!0);C(M);const w=(H=(v=Object.values(M||{}))==null?void 0:v.flat())==null?void 0:H.filter(Boolean);j(w==null?void 0:w.length)};return l.useEffect(()=>{N()},[]),n.jsxs(Je,{styleContainer:{height:"calc(100% - 50px)"},open:m,onClose:()=>{f(!1)},footer:n.jsxs("div",{className:"w-ticket-list-advance-filter-footer",children:[n.jsx(x.Button,{onClick:()=>{k==null||k.resetFields(),F()},children:h},"clear"),n.jsx(x.Button,{type:"primary",onClick:()=>{F(),f(!1)},children:A},"filter")]}),children:[n.jsx(x.Typography.Text,{strong:!0,style:{fontSize:16},children:e}),n.jsx("div",{className:"w-ticket-list-advance-filter-form-container",children:n.jsxs(x.Form,{form:k,layout:"vertical",children:[n.jsx(x.Form.Item,{label:t,name:"TASK_NAME",children:n.jsx(x.Input,{allowClear:!0})}),n.jsx(x.Form.Item,{label:s,name:"CATEGORY_CODE",children:n.jsx(x.Select,{options:p,mode:"multiple",allowClear:!0})}),n.jsx(x.Form.Item,{label:o,name:"TASK_STATUS",children:n.jsx(x.Select,{options:_,mode:"multiple",allowClear:!0})}),n.jsx(x.Form.Item,{label:r,name:"CREATED_DATE",children:n.jsx(x.DatePicker,{style:{width:"100%"},allowClear:!0})})]})})]})},ys=l.memo(Ts),bs=()=>{const e=S("ReconnectManually","Reconnect Manually"),t=S("HelpdeskWebsocket","Helpdesk Websocket"),s=S("NotConnected","Not Connected"),o=S("Connecting","Connecting"),{connectWebSocket:r,retryCountState:i,setRetryCountState:c,retryCountRef:a}=J(),d=l.useMemo(()=>i===re?`${t} ${s}`:`${t} ${o}`,[i]);return n.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:n.jsx(x.Result,{...i===re?{status:"warning"}:{icon:null},title:d,extra:i===re?n.jsx(x.Button,{type:"primary",onClick:()=>{a.current=0,c(0),r()},children:e},"reconnect"):n.jsx(I,{type:"loading",className:"w-spin-animate",style:{paddingTop:8}})})})},hs=l.memo(bs),js=()=>{const{setTicketId:e,ticketId:t,openFilter:s}=K(),{onSendMsg:o}=J(),{showReadyWSHD:r}=R();return r?n.jsxs(n.Fragment,{children:[n.jsx(Cs,{visible:t,onClose:()=>{e(""),o({event:"LEAVE_ROOM",data:{TASK_ID:t}})}}),n.jsx("div",{style:{display:!t&&!s?"block":"none"},children:n.jsx(Ht,{})}),n.jsx(ys,{})]}):n.jsx(hs,{})},Ss=l.memo(js),ks=()=>{const e=S("NeedHelp","Need Help"),t=S("WidgetDisconnected","Widget Disconnected"),[s,o]=l.useState(!1),r=l.useRef(),{widgetProps:i,setOpenWidget:c,isFirstOpenWidget:a,setFirstOpenWidget:d}=R(),{onSendMsg:u,connected:g,isHandshakeWidget:T}=z(),y=()=>{c(!0),u({msg:i==null?void 0:i.getStartedPayload})};return l.useEffect(()=>{o(!g),window.clearTimeout(r.current),r.current=setTimeout(()=>{o(!1)},2e3)},[g]),n.jsx(x.Popover,{open:s&&T,content:t,placement:"right",children:n.jsxs("div",{className:"w-launcher-container",onClick:()=>{a||(d(!0),y()),c(!0)},children:[n.jsx(I,{type:"chat-bubble"}),n.jsxs(x.Typography.Text,{style:{fontWeight:600,color:"#fff"},children:[e,"?"]})]})})},Es=l.memo(ks),As=()=>{const e=S("NotConnected","Not Connected"),t=S("CannotAutoReconnect","Cannot auto reconnect"),s=S("ReconnectManually","Reconnect Manually"),[o,r]=l.useState(!1),{connected:i,createSocket:c}=z(),{widgetProps:a}=R();return l.useEffect(()=>{r(!i)},[i]),n.jsx(en,{title:`${a==null?void 0:a.title} ${e}`,subTitle:n.jsxs(n.Fragment,{children:[n.jsxs(x.Typography.Text,{children:[t,"?"]}),n.jsx(x.Typography.Link,{strong:!0,className:"w-reconnect-manual",onClick:()=>{c()},children:s})]}),onClose:()=>r(!1),open:!i&&o})},ws=l.memo(As),ps=()=>{const{xs:e}=x.Grid.useBreakpoint(),[t,s]=l.useState(!1),{isOpenWidget:o,widgetProps:r}=R(),{isActiveTabVA:i}=Z(),c=l.useRef(null),a=l.useMemo(()=>{var g;const u=[Te];return e&&(r!=null&&r.isSF?u==null||u.push(`${Te}-sf-mobile`):u==null||u.push(`${Te}-mobile`)),(g=u==null?void 0:u.filter(Boolean))==null?void 0:g.join(" ")},[e,r==null?void 0:r.isSF]),d=l.useCallback(u=>{var T;const g=[u,be==null?void 0:be.FADE_IN];return r!=null&&r.isSF&&(g==null||g.push(`${u}-sf`)),e&&(r!=null&&r.isSF?g==null||g.push(`${u}-sf-mobile`):g==null||g.push(`${u}-mobile`)),(T=g==null?void 0:g.filter(Boolean))==null?void 0:T.join(" ")},[r==null?void 0:r.isSF,e]);return l.useEffect(()=>{o&&s(o),clearTimeout(c.current),c.current=setTimeout(()=>{o||s(o)},250)},[o]),t?n.jsxs("div",{className:a,children:[n.jsxs("div",{style:{display:i?"block":"none"},children:[n.jsx("div",{className:d(bn),children:n.jsx(wt,{})}),n.jsx(Lt,{})]}),n.jsx("div",{style:{display:i?"none":"block"},children:n.jsx("div",{className:d(hn),children:n.jsx(Ft,{children:n.jsx(Mt,{children:n.jsx(Ss,{})})})})}),n.jsx(ws,{})]}):n.jsx(Es,{})},Ls=l.memo(ps),vs=({items:e,...t})=>se!=null&&se.startsWith("5")||oe!=null&&oe.startsWith("18")?n.jsx(x.Tabs,{...t,items:e}):n.jsx(x.Tabs,{...t,children:e==null?void 0:e.map(({...s})=>l.createElement(x.Tabs.TabPane,{...s,key:s==null?void 0:s.key,tab:s==null?void 0:s.label}))}),_s=l.memo(vs),Ds=()=>{const{isOpenWidget:e}=R(),{setActiveTab:t,activeTab:s}=Z(),o=S("VirtualAssistant","Virtual Assistant"),r=S("Helpdesk","Helpdesk"),{xs:i}=x.Grid.useBreakpoint();return l.useEffect(()=>{const c=He();t((c==null?void 0:c.activeTab)??s)},[]),e?n.jsx("div",{className:"w-widget-tab-footer-container",...i&&{style:{borderRadius:0}},children:n.jsx(_s,{activeKey:s,onChange:c=>{t(c),ge({activeTab:c})},items:[{label:o,key:"va"},{label:r,key:"helpdesk"}]})}):null},Ms=l.memo(Ds),Os=()=>{const{isOpenWidget:e,setOpenWidget:t,setExpand:s,isExpand:o,widgetProps:r}=R(),{xs:i}=x.Grid.useBreakpoint();return e?n.jsxs("div",{className:`${le}-container`,...i&&{style:{borderRadius:0}},children:[n.jsxs("div",{className:`${le}-text`,children:[n.jsx("h4",{className:`${le}-title`,children:r==null?void 0:r.title}),n.jsx("span",{className:`${le}-subtitle`,children:r==null?void 0:r.subTitle})]}),n.jsxs("div",{className:`${le}-action`,children:[!i&&n.jsx(I,{type:"expand",style:{transform:o?"rotate(180deg)":"rotate(0deg)",transition:"all 300ms"},onClick:()=>{s(c=>!c)}}),n.jsx(I,{type:"minimize",onClick:()=>{t(!1)}})]})]}):null},Rs=l.memo(Os),Fs=()=>{const{isExpand:e,isOpenWidget:t,isFirstOpenWidget:s,setOpenWidget:o}=R(),{xs:r}=x.Grid.useBreakpoint(),i=l.useMemo(()=>{var a;const c=[r&&"w-container-widget-mobile",s&&(t?"w-show-animate":"w-close-animate"),"w-container-widget",e&&"w-container-widget-expand"];return(a=c==null?void 0:c.filter(Boolean))==null?void 0:a.join(" ")},[e,r,s,t]);return n.jsxs("div",{className:i,onKeyDown:c=>{(c==null?void 0:c.code)==="Escape"&&!(c!=null&&c.shiftKey)&&!(c!=null&&c.altKey)&&!(c!=null&&c.ctrlKey)&&(c==null?void 0:c.key)==="Escape"&&o(!1)},tabIndex:0,children:[n.jsx(Rs,{}),n.jsx("div",{id:"w-widget-content",children:n.jsxs(tt,{children:[n.jsx(Mn,{children:n.jsx(Ls,{})}),n.jsx(Ms,{})]})})]})},Ns=l.memo(Fs),Hs=({getStartedPayload:e,socketURL:t,socketPath:s,onPayslipFn:o,title:r,subTitle:i,keyEncrypt:c,history:a,isSF:d=!1})=>n.jsx(vn,{getStartedPayload:e,socketURL:t,socketPath:s,onPayslipFn:o,title:r,subTitle:i,keyEncrypt:c,history:a,isSF:d,children:n.jsx(Dn,{children:n.jsx(Ns,{})})});module.exports=Hs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.w-modal-container-feedback{width:100%}.w-modal-container-feedback .ant-modal-content{background-image:url(https://res.cloudinary.com/dcvolkyfb/image/upload/v1740108579/svg/modal_feedback_image_smgsc0.svg);background-repeat:no-repeat;background-size:cover}.w-list-feedback-suggestion{display:flex!important;flex-wrap:wrap;gap:8px!important}.w-list-feedback-suggestion .ant-radio-button-wrapper{border-width:1px;border-radius:10px!important;font-size:10px!important}.w-list-feedback-suggestion .ant-radio-button-wrapper:before{content:none}.lds-ellipsis,.lds-ellipsis div{box-sizing:border-box}.lds-ellipsis{display:inline-block;position:relative;width:48px;height:70px}.lds-ellipsis div{position:absolute;top:33.33333px;width:8px;height:8px;border-radius:50%;background:#00000080;animation-timing-function:cubic-bezier(0,1,1,0)}.lds-ellipsis div:nth-child(1){left:8px;animation:lds-ellipsis1 .6s infinite}.lds-ellipsis div:nth-child(2){left:8px;animation:lds-ellipsis2 .6s infinite}.lds-ellipsis div:nth-child(3){left:22px;animation:lds-ellipsis2 .6s infinite}.lds-ellipsis div:nth-child(4){left:37px;animation:lds-ellipsis3 .6s infinite}@keyframes lds-ellipsis1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes lds-ellipsis3{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes lds-ellipsis2{0%{transform:translate(0)}to{transform:translate(13px)}}.w-bubble-chat-container{display:flex;flex-direction:column;gap:18px}.w-bubble-chat{padding:11px 15px;box-shadow:0 2px 8px #00000026}.w-bubble-chat-regenerate{width:100%;max-width:250px!important}.w-bubble-chat-regenerate-expand{width:100%;max-width:750px!important}.w-response{background-color:#fff;border-radius:0 15px 15px;width:fit-content;max-width:calc(100% - 20px)}.w-client{background-color:#ebeff8;align-self:flex-end;border-radius:15px 0 15px 15px;max-width:250px}.w-regenerate-chat-last{padding:1px;background:linear-gradient(71.62deg,#395ebc 24.16%,#a8d8f3 76.78%);border-radius:0 15px 15px;animation:gradient 5s ease infinite;background-size:400% 400%;max-width:300px;margin-bottom:10px;transition:all .3s}.w-regenerate-chat-last-expand{max-width:100%}.w-bubble-chat .ant-table-content{max-width:100%!important}@keyframes gradient{0%{background-position:0% 50%}50%{background-position:100% 50%}to{background-position:0% 50%}}.w-input-container{border:1px solid rgba(217,217,217,1);border-radius:8px;display:flex;justify-content:space-between;align-items:flex-end;padding:10px 5px 5px;margin:0 10px}.w-input-widget,.w-input-helpdesk{overflow:auto;resize:none!important;width:100%;border:none}.w-input-widget.ant-input,.w-input-widget.ant-input-focused,.w-input-widget.ant-input:focus,.w-input-widget.ant-input-outlined:focus,.w-input-widget.ant-input-outlined:focus-within{box-shadow:none;border:none!important}.w-input-helpdesk.ant-mentions,.w-input-helpdesk.ant-mentions-focused,.w-input-helpdesk.ant-mentions:hover{border:none!important;box-shadow:none}.w-input-helpdesk.ant-mentions-outlined:focus,.w-input-helpdesk.ant-mentions-outlined:focus-within{box-shadow:none}.w-send-btn{background-color:var(--primary-color, #395ebc)}.w-send-btn-disabled{background-color:#0006!important}.w-list-ticket-container{display:flex;flex-direction:column;gap:12px;height:calc(100vh - 320px);overflow-y:auto;position:relative}.w-list-ticket-container-sf{height:calc(100vh - 250px)}.w-list-ticket-container-mobile{height:calc(100vh - 190px)}.w-ticket-card-container{box-shadow:0 0 8px #a8d8f34d;padding:8px 12px;border-radius:10px;cursor:pointer;transition:all .3s}.w-ticket-card-container:hover{box-shadow:0 3px 6px -4px #a8d8f31a,0 6px 16px #a8d8f330,0 9px 28px 8px #a8d8f32b;border:none}.w-ticket-card-content-container{display:flex;justify-content:space-between}.w-ticket-card-cat-code{display:flex;flex-direction:column}.w-ticket-card-status-date{display:flex;flex-direction:column;align-items:flex-end}.w-ticket-list-advance-filter-form-container{overflow-y:auto;height:calc(100% - 50px);padding:18px 12px}.w-ticket-list-advance-filter-footer{display:flex;gap:8px;align-items:flex-end;justify-content:flex-end;flex:auto}.w-drawer-container{background-color:#fff;height:100%;right:0;bottom:0;left:0;position:absolute;z-index:1;top:62px;padding:15px 12px 12px;display:flex;flex-direction:column}.w-show-animate{animation:show .3s cubic-bezier(.4,0,.2,1) 0ms 1}.w-close-animate{animation:close .3s cubic-bezier(.4,0,.2,1) 0ms 1}.w-slide-left-animate{animation:slide_left .3s cubic-bezier(.4,0,.2,1) 0ms 1}.w-slide-right-animate{animation:slide_right .3s cubic-bezier(.4,0,.2,1) 0ms 1}.w-fade-in-animate{animation:fade-in .3s cubic-bezier(.4,0,.2,1) 0ms 1}.w-fade-out-animate{animation:fade-out .3s cubic-bezier(.4,0,.2,1) 0ms 1;height:0;visibility:hidden;padding:0;margin:0}.w-slide-up-animate{animation:slide-up .3s cubic-bezier(.4,0,.2,1) 0ms 1}.w-spin-animate{animation:spin 1s infinite forwards}@keyframes show{0%{transform:scale(0);overflow:hidden;transform-origin:right}to{transform:scale(1);overflow:visible}}@keyframes close{0%{transform:scale(1);overflow:visible}to{transform:scale(0);overflow:hidden;transform-origin:right}}@keyframes slide_left{0%{transform:translate(-500px);overflow:hidden}to{transform:translate(0);overflow:visible}}@keyframes slide_right{0%{transform:translate(500px);overflow:hidden}to{transform:translate(0);overflow:visible}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}@keyframes slide-up{0%{transform:translateY(500px)}to{transform:translateY(-100px)}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.w-wrapper-body-helpdesk{padding:24px 12px;position:relative;overflow:hidden;height:calc(100vh - 230px)}.w-wrapper-body-helpdesk-sf{height:calc(100vh - 190px)}.w-wrapper-body-helpdesk-mobile,.w-wrapper-body-helpdesk-sf-mobile{height:calc(100vh - 115px)}.w-wrapper-body-helpdesk .ant-drawer{position:absolute!important;height:100%}.w-wrapper-body-helpdesk .ant-drawer-content-wrapper{height:100%!important}.w-wrapper-body-helpdesk .ant-drawer-body{overflow:hidden;padding:12px 0 0!important}.w-ticket-detail-content-container{height:calc(100% - 130px);overflow-y:auto;padding:0 24px 20px;position:relative}.w-ticket-detail-content-container-sf-mobile{height:calc(100% - 110px)}.w-ticket-detail-content-container-mobile{height:calc(100% - 120px);padding:0 12px 20px}.w-datekey-chats{color:gray;border-bottom:1px solid rgb(221,221,221);background-color:#fff;border-radius:8px;margin:24px auto 12px;text-align:center;padding:5px 15px;width:fit-content;position:sticky;top:10px;z-index:1}.w-ticket-info-chat-container{display:flex;flex-direction:column;-webkit-box-align:center;align-items:center;text-align:center;margin:auto;padding:4px;background:#fafafa;border:1px solid rgb(217,217,217);border-radius:8px;width:80%;font-size:14px}.w-ticket-detail-header-container{display:flex;gap:8px;border-bottom:1px solid rgba(0,0,0,.05);align-items:center;justify-content:space-between}.w-ticket-detail-header-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.w-ticket-detail-loading-chats{display:flex;flex-direction:column;gap:24px;padding:0}.w-banner-container{position:absolute;top:0;left:0;right:0;background-color:#00000080;width:100%;padding:8px 0;border-radius:0 0 8px 8px}.w-banner-container span{color:#fff}.w-banner-container .w-reconnect-manual{color:#69b1ff!important}.w-banner-container .w-banner-content{position:relative;display:flex;gap:4px;text-align:center;flex-direction:column}.w-banner-container .w-banner-subtitle{display:flex;gap:8px;justify-content:center}.w-banner-container .w-banner-close-btn{position:absolute;top:10px;right:10px}.w-launcher-container{cursor:pointer;display:flex;position:fixed;right:0;top:30%;gap:8px;align-items:center;transform:rotate(-90deg);transform-origin:bottom right;background-color:var(--primary-color, #395ebc);color:#fff;padding:15px;border-radius:8px 8px 0 0;transition:all .3s}.w-container-widget{position:fixed;right:2%;top:60px;width:360px;border-radius:8px;box-shadow:0 1px 1.5px -1px #0000000c,0 2.5px 3.7px -1px #00000012,0 5px 7px -1px #00000016,0 9.7px 12.5px -1px #0000001a,0 19.7px 23.4px -1px #0000001f,0 54px 56px -1px #0000002b;z-index:999;transition:all .25s}.w-container-widget-mobile{width:100vw;border-radius:0;top:0;right:0;bottom:0;left:0}.w-container-widget.w-container-widget-expand{width:800px}#w-widget-content .ant-modal-mask,#w-widget-content .ant-modal-wrap{position:absolute}.w-widget-content-container{position:relative;height:100%;background-color:#fff;overflow:hidden}.w-widget-content-container-mobile,.w-widget-content-container-sf-mobile{height:calc(100vh - 120px)}.w-wrapper-body{overflow-y:auto;height:calc(100vh - 300px);padding:24px 12px;position:relative}.w-wrapper-body-sf{height:calc(100vh - 260px)}.w-wrapper-body-sf-mobile{height:calc(100vh - 190px)}.w-wrapper-body-mobile{height:calc(100vh - 195px)}.w-widget-tab-footer-container{width:100%;background-color:#fff;border-radius:0 0 8px 8px}.w-widget-tab-footer-container .ant-tabs-nav{width:100%!important;margin:0}.w-widget-tab-footer-container .ant-tabs-nav>div:nth-of-type(1){display:unset!important;width:100%!important}.w-widget-tab-footer-container .ant-tabs-tab{display:block;flex:1;text-align:center}.w-widget-tab-footer-container .ant-tabs-nav-operations{display:none!important}.w-header-container{display:flex;justify-content:space-between;padding:0 15px;border-radius:8px 8px 0 0;align-items:center;background-color:var(--primary-color, #395ebc);color:#fff}.w-header-text{display:flex;flex-direction:column;gap:8px;padding:12px 0}.w-header-title{font-size:14px;font-weight:600;margin:0!important;color:#fff}.w-header-subtitle{font-size:12px;color:#fff}.w-header-action{display:flex;gap:12px}.w-widget-content-container .ant-notification{position:absolute!important}.w-widget-content-container .w-notification-content{width:300px!important}
|