jamespot-react-core 1.3.6 → 1.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/build/346.5e80d1d74f0d543bfa32.chunk.js +2 -0
  2. package/build/346.5e80d1d74f0d543bfa32.chunk.js.map +1 -0
  3. package/build/605.e14ede6ac53f82a861c7.chunk.js +707 -0
  4. package/build/605.e14ede6ac53f82a861c7.chunk.js.map +1 -0
  5. package/build/app.bundle.js +879 -879
  6. package/build/app.bundle.js.LICENSE.txt +92 -1
  7. package/build/app.bundle.js.map +1 -1
  8. package/build/script/checkDependencies.d.ts +1 -0
  9. package/build/socket.sharedworker.6e975754295fd9584be6.js.map +1 -1
  10. package/build/src/App.d.ts +33 -5
  11. package/build/src/hooks/useAI.d.ts +1 -1
  12. package/build/src/redux/middleware/index.d.ts +0 -1
  13. package/build/src/redux/middleware/logger.d.ts +1 -1
  14. package/build/src/redux/slice/Article.slice.d.ts +21 -21
  15. package/build/src/redux/slice/User.slice.d.ts +21 -21
  16. package/build/src/redux/store.d.ts +191 -531
  17. package/externals.json +13 -2
  18. package/package.json +26 -28
  19. package/README.internal.md +0 -20
  20. package/build/534.606ae244f89e01f0c5fa.chunk.js +0 -2
  21. package/build/534.606ae244f89e01f0c5fa.chunk.js.map +0 -1
  22. package/build/605.2ea491387427c666537a.chunk.js +0 -707
  23. package/build/605.2ea491387427c666537a.chunk.js.map +0 -1
  24. package/build/assets/404.6ddcf23842aa398fdb2521ed61e26426.png +0 -0
  25. package/build/assets/ai.0bd1828cb6ec10ad92d900c710079cac.png +0 -0
  26. package/build/assets/check.e04c3374d2c43bd03d5c52b37639d90c.svg +0 -4
  27. package/build/assets/default.2ca3180f8cdd6f14c4184439f06173cb.png +0 -0
  28. package/build/assets/docx.d99aeeb833c328dc360bb2dc1d99126f.png +0 -0
  29. package/build/assets/gif.605d1d151a01356b376d5c4ac2f40d19.png +0 -0
  30. package/build/assets/group-background.daf782321c7f65cde0fc3d5918d27762.png +0 -0
  31. package/build/assets/jamespot-2025-216.d681af07a093035b056f3a3589dfb6f8.png +0 -0
  32. package/build/assets/jamespot-blue-2025-216.cbe9350502876bd1e0495637f73b0ce6.png +0 -0
  33. package/build/assets/mp3.c4f6cf8e048c8d1fd70ea5676f9e35bb.png +0 -0
  34. package/build/assets/mp4.c631e40ab77a5009bec629505396f88b.png +0 -0
  35. package/build/assets/pdf.25c19fbb11dacc87994bdce830d7e5ed.png +0 -0
  36. package/build/assets/pptx.fc266e95afba9abd862da4d909e1ad68.png +0 -0
  37. package/build/assets/psd.cca4c1ac52e6e24770486bf5bc6d6ff9.png +0 -0
  38. package/build/assets/svg.21a77099744d94b9214c52043ef39d95.png +0 -0
  39. package/build/assets/ttf.28668a6c059779e01fe7dc66dd70ef40.png +0 -0
  40. package/build/assets/txt.d0b32e515641b99e8e31165279361eb4.png +0 -0
  41. package/build/assets/x.609ccec1e6c6c10c412a1ab325258b42.svg +0 -1
  42. package/build/assets/xlsx.a3b00a8cd84f504b94d1cfc617b4080f.png +0 -0
  43. package/build/assets/zip.b8f8ab347fc92f763a2d44617a82b66e.png +0 -0
  44. package/build/jest.config.d.ts +0 -3
  45. package/build/jest.setup.d.ts +0 -1
  46. package/jest.config.ts +0 -17
  47. package/jest.setup.ts +0 -1
  48. package/script/checkDependencies.js +0 -48
  49. package/script/traduction-react.php +0 -95
  50. package/styled-components.d.ts +0 -6
@@ -0,0 +1,707 @@
1
+ "use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[605],{5605:(e,t,i)=>{i.r(t),i.d(t,{AIModal:()=>M,AddReportModal:()=>K,Audience:()=>L,Avatar:()=>p,CalendarToolbar:()=>_n,CalendarWrapper:()=>fl,CommentsBloc:()=>sn,CreateMeetingModal:()=>tl,CreateSocialEventOrRecurringEventModal:()=>ul,DisplayForm:()=>R,Editor:()=>Zl,EditorsPortal:()=>ks,Empty:()=>Ws,ExportCalendarModal:()=>dl,FullPageLayout:()=>Ss,GifsModal:()=>nn,JRCInputTinyMCEWithExt:()=>Gn,JRCInputTinyMCEWithExtRaw:()=>Ts,MarkdownModal:()=>ft,ModalAudience:()=>Ua,ModalSchedule:()=>Za,TwoColLayout:()=>Is,WidgetList:()=>pe,WidgetWrapperCore:()=>Po});var o=i(7670),n=i(1142),a=i(5762),l=i(128),s=i(7444),r=i(9532),d=i(4071),c=i(2389);const u=c.j.getLazyComponent("Icon"),g=c.j.getLazyComponent("JRCAvatar"),m=a.default.span`
2
+ ${s.SROnly}
3
+ `,p=e=>{const t=(0,a.useTheme)(),i=(0,l.A)(),n=(0,d.GV)(r.Network.selectors.selectNetworkPublic);return e.uri===n?.uri?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(u,{name:"icon-fs-wall",size:8*(e.size??3),color:t.color.primary,variant:"circle"}),(0,o.jsx)(m,{children:i.formatMessage({id:"NETWORK_Public"})})]}):(0,o.jsx)(g,{...e})},h=c.j.getLazyComponent("FlexBox"),f=c.j.getLazyComponent("ModalContent"),x=c.j.getLazyComponent("ModalLayout"),j=c.j.getLazyComponent("StyledHref"),b=c.j.getLazyComponent("Tooltip"),C=c.j.getLazyComponent("Typography"),y=a.default.div`
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: 12px;
7
+ margin-bottom: 24px;
8
+ `,v=a.default.a`
9
+ display: flex;
10
+ justify-content: center;
11
+ align-items: center;
12
+ position: relative;
13
+ width: 40px;
14
+ height: 40px;
15
+ border-radius: 40px;
16
+ overflow: hidden;
17
+ color: ${e=>e.theme.color.white};
18
+ background-color: ${e=>e.theme.color.lavender};
19
+ border: 4px solid ${e=>e.theme.color.white};
20
+ margin-left: ${e=>e.overlap?"-18px":"0"};
21
+ cursor: pointer;
22
+ `,L=({audience:e,limit:t=2})=>{const i=(0,l.A)(),r=(0,a.useTheme)(),[d,c]=(0,n.useState)(!1);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(h,{children:[[...e].splice(0,t).map((e,t)=>(0,o.jsx)(v,{overlap:0!==t,href:e._url,target:"_blank",children:(0,o.jsx)(b,{description:void 0===e.title?" ":e.title,position:"left",children:(0,o.jsx)(p,{uri:e.uri,size:4,variant:"circle",alt:"image",timestamp:e.dateModified?s.Utils.date.strToTimestamp(e.dateModified):void 0,focusable:!0})})},e.id)),e.length>t&&(0,o.jsxs)(v,{onClick:()=>c(!0),overlap:!0,children:["+",e.length-t]})]}),e.length>t&&(0,o.jsx)(x,{closeHandler:()=>c(!1),enableClickAwayCloseModal:!0,open:d,variant:"fixed-height",maxHeight:"800px",children:(0,o.jsx)(f,{title:i.formatMessage({id:"GLOBAL_Audience"}),overflow:"scroll",onClickIconClose:()=>c(!1),children:(0,o.jsx)(y,{children:e.map((e,t)=>(0,o.jsxs)(h,{y:"center",gap:r.space.l,children:[(0,o.jsx)(p,{size:5,uri:`${e.type}/${e.id}`}),(0,o.jsx)(j,{href:`${e.type}/${e.id}`,children:(0,o.jsx)(C,{children:e.title})})]},`audience-${t}`))})})})]})};var E=i(9108);const A=c.j.getLazyComponent("Loader"),_=c.j.getLazyComponent("ModalContent"),k=c.j.getLazyComponent("ModalLayout"),W=c.j.getLazyComponent("Typography"),w=a.default.div`
23
+ padding: ${e=>e.theme.space.md}px;
24
+ `,S={response:void 0,loading:!0,error:void 0},M=({query:e})=>{const t=(0,l.A)(),[i,s]=(0,n.useState)(S),r=(0,a.useTheme)(),d=(0,n.useCallback)(e=>{s(S),E.default.jia.textEnhancement({text:e.text,capacity:e.capability}).then(e=>{if(e.error)return void s({error:`${t.formatMessage({id:"JIA_ERROR_AI_CALL"})}${e.errorMsg&&": "+e.errorMsg}`,loading:!1,response:void 0});const i=e.result.text;s({error:void 0,loading:!1,response:i})}).catch(e=>{s({error:t.formatMessage({id:"JIA_ERROR_AI_CALL"}),loading:!1,response:void 0})})},[t]);return(0,n.useEffect)(()=>{e&&e.text.trim().length>0&&d(e)},[e,d]),(0,o.jsx)(k,{zIndex:r.zIndex.tinyMCEModal,open:!!e,closeHandler:()=>{e?.reject()},children:(0,o.jsx)(_,{overflow:"scroll",buttons:[{children:t.formatMessage({id:"GLOBAL_Try_Again"}),clickHandler:()=>{e&&d(e)}},{children:t.formatMessage({id:"GLOBAL_Validation"}),clickHandler:()=>i.response&&e?.resolve(i.response)},{children:t.formatMessage({id:"GLOBAL_Cancel"}),clickHandler:()=>e?.reject()}],isFull:!0,children:(0,o.jsxs)(w,{children:[i.loading&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(A,{}),(0,o.jsx)(W,{align:"center",children:t.formatMessage({id:"JIA_WAITING_WARNIG"})})]}),!i.loading&&i.error&&(0,o.jsx)("p",{children:i.error}),!i.loading&&i.response&&(0,o.jsx)("p",{children:i.response})]})})})};var T=i(59),q=i(9785),D=i(4155);const G=a.css`
25
+ height: 100%;
26
+ display: flex;
27
+ flex-direction: column;
28
+ justify-content: space-between;
29
+ `,z=a.default.div`
30
+ ${({stretch:e})=>e&&G}
31
+ `,I=a.default.form`
32
+ ${({stretch:e})=>e&&G}
33
+ `,V=(0,n.forwardRef)((e,t)=>e.onSubmit?(0,o.jsx)(I,{stretch:e.stretch,onSubmit:e.onSubmit,ref:t,"data-cy":e.dataCy,children:e.children}):(0,o.jsx)(z,{stretch:e.stretch,ref:t,"data-cy":e.dataCy,children:e.children})),O=a.default.div`
34
+ ${e=>e.stretch&&"\n flex: 1;\n"}
35
+ `,R=(0,n.forwardRef)(({onInit:e,...t},i)=>{const a=(0,n.useRef)(null),[l,s]=(0,D.SC)(t.fields,t.type,t.forceMandatory),[r,d]=(0,n.useState)(!1),{handleSubmit:c,control:u,reset:g,...m}=(0,q.useForm)({defaultValues:{...s,...t.defaultValues},criteriaMode:"all"});(0,n.useEffect)(()=>{e&&!r&&(e(m),d(!0))},[e,m,r]);const p=(0,n.useCallback)(e=>{const t={};return Object.keys(e).forEach(i=>{const o=l.find(e=>e.name===i)?.widget;switch(o?.type){case"audience":t[i]=e[i].map(e=>e.uri).join(",");break;case"taxonomy":t[i]=e[i].map(e=>e.title).join(",");break;case"toggle":t[i]=e[i]?"1":"0";break;default:t[i]=e[i]}}),t},[l]);return(0,n.useImperativeHandle)(i,()=>({...m,handleSubmit:c,control:u,reset:()=>{a?.current?.scrollTo(0,0),g()},getFormattedValues:()=>p(m.getValues())}),[]),(0,o.jsxs)(V,{dataCy:t.dataCy,stretch:t.stretch,onSubmit:t.onSubmit?c(t.onSubmit):void 0,ref:a,children:[(0,o.jsxs)(O,{stretch:t.stretch,children:[l.map(({Input:e,...i})=>(0,o.jsx)(e,{control:u,...i,dataCy:`${t.dataCy}-${i.name}`,readOnly:t.readOnly},i.name)),t.extraInputs&&t.extraInputs(u)]}),t.buttons]})});var B=i(6910);const H=c.j.getLazyComponent("ModalForm"),$=c.j.getLazyComponent("Loader"),F=c.j.getLazyComponent("Icon"),N=c.j.getLazyComponent("Typography"),U=c.j.getLazyComponent("Deprecated_Ellipsis"),P=c.j.getLazyComponent("StyledHref"),Y=a.default.div`
36
+ display: flex;
37
+ flex-direction: column;
38
+ gap: ${({theme:e})=>e.space.md}px;
39
+ `,Q=a.default.div`
40
+ display: flex;
41
+ gap: ${({theme:e})=>e.space.md}px;
42
+ align-items: center;
43
+ border: 1px solid ${({theme:e})=>e.color.grey2};
44
+ background-color: ${({theme:e})=>e.color.grey0};
45
+ border-radius: ${({theme:e})=>e.size.sm}px;
46
+ padding: ${({theme:e})=>e.space.md}px;
47
+ `,X=a.default.div`
48
+ display: flex;
49
+ flex-direction: column;
50
+ gap: ${({theme:e})=>e.space.sm}px;
51
+ `,K=({onClose:e,articleId:t,articleUri:i,commentUri:a})=>{const s=(0,l.A)(),c=(0,n.useRef)(null),u=(0,d.jL)(),[g,m]=(0,n.useState)(!0),[p,h]=(0,n.useState)(),[f,x]=(0,n.useState)(),[j,b]=(0,n.useState)(!0),[C,y]=(0,n.useState)(!1),v=(0,B.Ie)();(0,n.useEffect)(()=>{Promise.all([(async()=>{const e=await E.default.article.get({idArticle:t},{signal:v.signal,format:"raw-list"});h(e.result)})(),(async()=>{if(a){const e=await E.default.article.getComments({idArticle:t},{format:"raw-list",signal:v.signal});x(e.result.find(e=>e.uri===a))}})()]).then(()=>{b(!1)})},[v,t,a]);const L=(0,n.useCallback)(()=>{m(!1),e()},[e]),A=(0,n.useCallback)(e=>{e?.trim()?(y(!0),E.default.contentReport.createReport({uri:a||i,description:e}).then(()=>{u(r.Toast.actions.success({label:s.formatMessage({id:"CRPT_Report_Sent"})})),L()}).catch(e=>{r.Toast.actions.error({label:e.errorMsg??"GLOBAL_Error"}),y(!1)})):u(r.Toast.actions.error({label:s.formatMessage({id:"CRPT_Report_Description_Required"})}))},[i,L,a,u,s]),_=(0,n.useCallback)(({description:e})=>{A(e)},[A]);return(0,o.jsx)(H,{title:s.formatMessage({id:"CRPT_Add_Report"}),open:g,closeHandler:L,onSubmit:async()=>A(c.current?.getValues().description),enableClickAwayCloseModal:!0,maxHeight:"520px",buttons:[{children:(0,o.jsx)(T.A,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:L},{children:(0,o.jsx)(T.A,{id:"GLOBAL_Send"}),clickHandler:()=>A(c.current?.getValues().description),color:"valid",loading:C}],children:j?(0,o.jsx)($,{size:"l"}):(0,o.jsxs)(Y,{children:[(0,o.jsxs)(Q,{children:[(0,o.jsx)(F,{name:a?"icon-comment":"icon-file",size:50,variant:"square"}),(0,o.jsxs)(X,{children:[(0,o.jsx)(N,{variant:a?"h3":"h2",children:(0,o.jsx)(U,{label:p?.title,length:40})}),f&&(0,o.jsxs)(N,{children:[s.formatMessage({id:"CRPT_Comment_Of"})," ",(0,o.jsx)(P,{href:f?._user._url,children:f?._user.title})]})]})]}),(0,o.jsx)(R,{ref:c,fields:["description"],type:"contentReport",onSubmit:_})]})})};var Z=i(1861),ee=i(6626),te=i(3187);const ie=a.default.div`
52
+ display: flex;
53
+ flex-direction: row;
54
+ flex-wrap: wrap;
55
+ gap: 10px;
56
+ justify-content: center;
57
+ `,oe=a.default.div`
58
+ border: 1px solid ${e=>e.theme.color.grey2};
59
+ border-radius: 8px;
60
+ cursor: pointer;
61
+ padding: 12px;
62
+ position: relative;
63
+ opacity: ${e=>e.available?"1":".4"};
64
+ pointer-events: ${e=>e.available?"all":"none"};
65
+
66
+ .show-on-hover {
67
+ position: absolute;
68
+ inset: 0;
69
+ border-radius: 8px;
70
+ justify-content: center;
71
+ align-items: center;
72
+ display: flex;
73
+ opacity: 0;
74
+ background-color: #ffffffe6;
75
+ }
76
+
77
+ &:hover {
78
+ .show-on-hover {
79
+ opacity: 1;
80
+ }
81
+ }
82
+ `,ne=a.default.div`
83
+ border: 2px solid ${e=>e.theme.color.primary};
84
+ height: ${e=>e.open?e.height:"54"}px;
85
+ border-radius: 8px;
86
+ display: flex;
87
+ justify-content: top;
88
+ flex-direction: column;
89
+ transition: height 0.4s;
90
+ overflow: hidden;
91
+ flex-direction: column;
92
+ `,ae=a.default.div`
93
+ display: flex;
94
+ flex-direction: row;
95
+ flex-wrap: wrap;
96
+ justify-content: center;
97
+ gap: 10px;
98
+ ${e=>e.column&&"flex-direction: column;"}
99
+ `,le=a.default.div`
100
+ min-height: 50px;
101
+ display: flex;
102
+ justify-content: center;
103
+ align-items: center;
104
+ cursor: pointer;
105
+ color: ${e=>e.theme.color.primary};
106
+ &:hover {
107
+ background-color: ${e=>e.theme.color.grey0};
108
+ }
109
+ `,se=a.default.button`
110
+ display: flex;
111
+ align-items: center;
112
+ padding: ${e=>e.parentIsColumn?"36px 16px":"0 10px"};
113
+ gap: 10px;
114
+ width: 40%;
115
+ border: 1px solid ${e=>e.theme.color.grey1};
116
+ border-radius: 8px;
117
+ transition: opacity 0.4s ease ${e=>40*e.index}ms;
118
+ opacity: ${e=>e.open?1:0};
119
+ img {
120
+ width: 40px;
121
+ }
122
+ ${e=>e.full&&"flex: 1; width: 100%;"}
123
+ ${e=>e.parentIsColumn&&"flex-basis: 72px;"}
124
+ ${e=>!e.parentIsColumn&&"height: 72px;"}
125
+ &:hover {
126
+ background-color: ${e=>e.theme.color.grey0};
127
+ }
128
+
129
+ ${(0,s.DashedFocusBorder)()}
130
+ `,re=a.default.div`
131
+ display: flex;
132
+ flex-direction: ${e=>"row"===e.direction?"row":"column"};
133
+ align-items: ${e=>"row"===e.direction?"center":"flex-start"};
134
+ justify-content: ${e=>"row"===e.direction?"flex-start":"center"};
135
+ flex: 1;
136
+ ${e=>e.gap&&`gap:${e.gap}px`}
137
+ `,de=c.j.getLazyComponent("Button"),ce=c.j.getLazyComponent("ModalLayout"),ue=c.j.getLazyComponent("ModalContent"),ge=c.j.getLazyComponent("Tooltip"),me=c.j.getLazyComponent("IconButton"),pe=({mode:e,view:t,children:i,namespace:a="default",onChange:s})=>{const[d,c]=(0,n.useState)(!1),u=function(e){switch(e){case"widget-article-image":return[r.Widget.definition(E.WidgetsName.ArticleTitle),r.Widget.definition(E.WidgetsName.ArticleButton)];case"comment":return[r.Widget.definition(E.WidgetsName.CheckList),r.Widget.definition(E.WidgetsName.Presence),r.Widget.definition(E.WidgetsName.QuickSurvey)];default:return[r.Widget.definition(E.WidgetsName.ArticleTitle),r.Widget.definition(E.WidgetsName.ArticleText),r.Widget.definition(E.WidgetsName.ArticleImage),r.Widget.definition(E.WidgetsName.ArticleButton),r.Widget.definition(E.WidgetsName.ArticleSlider),r.Widget.definition(E.WidgetsName.ArticleAttachment),r.Widget.definition(E.WidgetsName.Presence)]}}(a),g=(0,l.A)(),m={open:d,portalId:"react-modal",variant:"full-height",closeHandler:()=>c(!1)},p=e=>{s(r.Widget.factory(e)),c(!1)};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ce,{...m,children:(0,o.jsx)(ue,{onClickIconClose:m.closeHandler,buttons:"comment"===e?[{children:(0,o.jsx)(T.A,{id:"GLOBAL_Close"}),color:"cancel",clickHandler:()=>c(!1)}]:void 0,title:g.formatMessage({id:"WIDGET_Builder"}),children:"comment"===e?(0,o.jsx)(ae,{column:!0,children:u.map((e,t)=>(0,o.jsx)(se,{open:!0,full:!0,parentIsColumn:!0,index:t,onClick:()=>p(e.name),children:(0,o.jsxs)(re,{direction:"row",gap:12,children:[(0,o.jsx)("img",{src:e.img}),(0,o.jsxs)(re,{direction:"column",children:[(0,o.jsx)("h3",{children:g.formatMessage({id:e.label})}),(0,o.jsx)("p",{children:g.formatMessage({id:e.description})})]})]})},e.name))}):(0,o.jsx)(ie,{children:u.map((e,t)=>(0,o.jsxs)(oe,{onClick:()=>p(e.name),available:e.available,children:[(0,o.jsx)("img",{src:e.img}),(0,o.jsx)("div",{className:"show-on-hover",children:g.formatMessage({id:e.label})})]},t))})})}),"custom"===e&&i?(0,o.jsx)("div",{onClick:()=>c(!0),children:i}):(0,o.jsx)(o.Fragment,{}),"button"===e&&"edit"===t?(0,o.jsx)(de,{onClick:()=>c(!0),variant:"outlined",minWidth:"100%",children:g.formatMessage({id:"WIDGET_Add_Widget"})}):(0,o.jsx)(o.Fragment,{}),"gallery"===e&&"edit"===t?(0,o.jsx)(ie,{children:u.map((e,t)=>(0,o.jsxs)(oe,{onClick:()=>p(e.name),available:e.available,children:[(0,o.jsx)("img",{src:e.img}),(0,o.jsx)("div",{className:"show-on-hover",children:g.formatMessage({id:e.label})})]},t))}):(0,o.jsx)(o.Fragment,{}),"article"===e&&"edit"===t?(0,o.jsx)(he,{widgets:u,onClick:p}):(0,o.jsx)(o.Fragment,{}),"comment"===e&&"edit"===t?(0,o.jsx)(fe,{onClick:()=>{c(!0)}}):(0,o.jsx)(o.Fragment,{})]})},he=({widgets:e,onClick:t})=>{const[i,a]=(0,n.useState)(!1),s=(0,l.A)(),r=(0,n.useMemo)(()=>80*Math.ceil(e.length/2)+50+10,[e]);return(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(ne,{open:i,height:r,children:[(0,o.jsx)(le,{onClick:()=>a(!i),children:s.formatMessage({id:"WIDGET_Add_Widget"})}),(0,o.jsx)(ae,{children:e.map((e,n)=>(0,o.jsxs)(se,{open:i,index:n,onClick:()=>t(e.name),children:[(0,o.jsx)("img",{src:e.img}),s.formatMessage({id:e.label})]},e.name))})]})})},fe=({onClick:e})=>{const t=(0,l.A)();return(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(ge,{description:t.formatMessage({id:"COMMENT_Add_Widget"}),children:(0,o.jsx)(me,{bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:22,onClick:()=>{e()},icon:"icon-fs-puzzle"})})})},xe=()=>{const e=(0,l.A)(),[t,i]=(0,n.useState)(!1),[o,a]=(0,n.useState)();return{open:t,onInsert:e=>{o?.execCommand("InsertHTML",!1,e)},close:()=>i(!1),ext:(0,n.useMemo)(()=>s.JTinyMCEExtensionsBuilders.markdown(e=>{a(e),i(!0)},e),[e]),isActive:!0}};var je=i(4786),be=i(1893),Ce=i(9876);const ye=c.j.getLazyComponent("InputText"),ve=({uniqid:e})=>{const t=(0,l.A)(),i=(0,d.jL)(),a=(0,d.GV)(t=>r.Widget.selectors.selectWidget(t,e)?.title,be.shallowEqual),{control:s,watch:c}=(0,q.useForm)({defaultValues:{widgetTitle:a},criteriaMode:"all"});return(0,n.useEffect)(()=>{const t=c(t=>{i(r.Widget.slice.actions.updateWidgetWrapper({uniqid:e,title:t.widgetTitle}))});return()=>t.unsubscribe()},[c,i,e]),(0,o.jsx)(ye,{name:"widgetTitle",control:s,placeholder:t.formatMessage({id:"GLOBAL_Title"}),width:"100%",margin:"0"})},Le=c.j.getLazyComponent("Button"),Ee=c.j.getLazyComponent("ModalLayout"),Ae=c.j.getLazyComponent("ModalContent"),_e=c.j.getLazyComponent("IconButton"),ke=a.default.div`
138
+ padding: ${e=>e.theme.space.md}px;
139
+ display: flex;
140
+ flex-direction: row-reverse;
141
+ `,We=a.default.div`
142
+ flex: 1;
143
+ display: flex;
144
+ flex-direction: row;
145
+ gap: ${e=>e.theme.space.sm}px;
146
+ padding: ${e=>e.theme.space.sm}px;
147
+ border-bottom: 1px solid ${e=>e.theme.color.grey1};
148
+ `,we=a.default.div`
149
+ flex: 1;
150
+ display: flex;
151
+ fieldset:first-of-type {
152
+ margin: 0px !important;
153
+ }
154
+ `,Se=a.default.div`
155
+ display: flex;
156
+ gap: ${e=>e.theme.space.sm}px;
157
+ `,Me=({uniqid:e,name:t,handleOpenEditor:i})=>{const a=(0,d.jL)(),s=(0,l.A)(),[c,u]=(0,n.useState)(!1),g=(0,n.useCallback)(()=>{a(r.WidgetEditor.slice.actions.registerEditor({uniqid:e,name:t,mode:"edit"}))},[e,a,t]),m=(0,n.useCallback)(()=>{a(r.Widget.slice.actions.flushWidget({uniqid:e}))},[e,a]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(We,{children:[(0,o.jsx)(we,{children:(0,o.jsx)(ve,{uniqid:e})}),(0,o.jsxs)(Se,{children:[(0,o.jsx)(_e,{icon:"icon-pencil",bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:14,onClick:i??g,title:s.formatMessage({id:"BUTTON_Title_Open_Edit_Panel"})}),(0,o.jsx)(_e,{icon:"icon-trash",bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:14,onClick:()=>u(!0),title:s.formatMessage({id:"BUTTON_Title_Open_Remove_Widget"})})]})]}),c&&(0,o.jsxs)(Ee,{enableClickAwayCloseModal:!0,open:c,closeHandler:()=>u(!1),children:[(0,o.jsx)(Ae,{overflow:"scroll",title:s.formatMessage({id:"WIDGET_Remove_Widget"}),onClickIconClose:()=>u(!1),children:s.formatMessage({id:"WIDGET_Delete_Widget_Confirmation"})}),(0,o.jsx)(ke,{children:(0,o.jsx)(Le,{label:s.formatMessage({id:"GLOBAL_Confirm"}),onClick:m})})]})]})},Te=c.j.getLazyComponent("Html"),qe=a.default.div`
158
+ padding: ${e=>e.theme.space.md}px;
159
+ border-bottom: 1px solid ${e=>e.theme.color.grey1};
160
+ `,De=({uniqid:e})=>{const t=(0,d.GV)(t=>r.Widget.selectors.selectWidget(t,e),be.shallowEqual),i=(0,a.useTheme)(),l=(0,d.GV)(t=>r.Widget.selectors.selectWidgetTitleStyle(t,e),be.shallowEqual),s=(0,n.useMemo)(()=>({color:l&&l.color?String(l.color):i.color.black,backgroundColor:l&&l["background-color"]?String(l["background-color"]):i.color.white,fontSize:l&&l["font-size"]?`${l["font-size"]}px`:"24px",fontWeight:l&&l["font-weight"]?String(l["font-weight"]):"medium",textAlign:l&&l["text-align"]?String(l["text-align"]):"left"}),[l,i]),c=(0,n.useMemo)(()=>t&&"string"==typeof t.title&&0!==t.title.length?t.title:void 0,[t]);return c?(0,o.jsx)(qe,{style:{color:s.color,backgroundColor:s.backgroundColor,fontSize:s.fontSize,fontWeight:s.fontWeight,textAlign:s.textAlign},children:(0,o.jsx)(Te,{as:"span",__html:c})}):(0,o.jsx)(o.Fragment,{})},Ge=c.j.getLazyComponent("InputFileAdvancedRaw"),ze=a.default.div`
161
+ width: 0;
162
+ height: 0;
163
+ overflow: hidden;
164
+ `,Ie=({children:e,initialFiles:t,initialClick:i,multiple:a,accept:l,onUploadStart:s,onUploadEnd:c,onUploadSuccess:u})=>{const g=(0,n.useRef)(null),m=(0,d.GV)(r.Widget.selectors.selectToken),[p,h]=(0,n.useState)(0),[f,x]=(0,n.useState)(t);return(0,n.useEffect)(()=>{i&&g.current?.click()},[i]),(0,n.useEffect)(()=>{t.length!==f.length&&x(t)},[t]),(0,n.useEffect)(()=>{u(f)},[f]),(0,n.useEffect)(()=>{0===p&&c()},[p]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{onClick:()=>{i&&g.current?.click()},children:e}),(0,o.jsx)(ze,{children:(0,o.jsx)(Ge,{ref:g,id:"widget-upload-file",name:"editorFiles",content:"",accept:l,multiple:a,token:m,onUploadStart:e=>{void 0!==e&&h(t=>t+e),"function"==typeof s&&0!==e&&s()},onUploadSuccess:e=>{void 0!==e&&(h(e=>void 0!==e?e-1:0),x(t=>a?[...t,e]:[e]))}})})]})},Ve=c.j.getLazyComponent("WidgetAttachment"),Oe=c.j.getLazyComponent("WidgetEmptyInplace"),Re=c.j.getLazyComponent("FileViewer"),Be=a.default.div`
165
+ flex: 1;
166
+ `,He=({widget:e,inplace:t,mode:i})=>{const a=(0,l.A)(),{uniqid:s}=e,{files:c}=e.content,u=(0,d.jL)(),g=(0,d.GV)(e=>r.Widget.selectors.isActive(e,s),be.shallowEqual),m=e=>{u(r.Toast.actions.error({label:e??a.formatMessage({id:"GLOBAL_Error"})}))};(0,n.useEffect)(()=>{u(r.Widget.slice.actions.setWidgetState({uniqid:s,mounted:!0}))},[]),(0,n.useEffect)(()=>{u(r.Widget.slice.actions.setWidgetState({uniqid:s,empty:!c||0===c.length}))},[c]);const p=(0,d.GV)(e=>r.Application.selectors.selectById(e,"WeDocHook")),h=[{label:a.formatMessage({id:"WIDGET_Open_With_Wedoc"}),onClick:e=>{e&&E.default.object.getAccessHash(`fileArticle/${e.id}`).then(t=>{if(""===t.result)throw new Error("result empty");const i=t.result;((e,t)=>{window.open(function(e,t){return`/ng/rr/file/${e}/${t}`}(e,t),void 0)})(e.id,i)}).catch(()=>{u(r.Toast.actions.error({label:"WIDGET_Open_Failed"},6e3))})}}],f=p?[{condition:e=>["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation"].includes(e.mimetype),options:h}]:[];return void 0!==c?(0,o.jsxs)(Be,{children:["view"!==i?(0,o.jsx)(Ve,{files:c,onClick:()=>{},onError:m}):(0,o.jsx)(Re,{files:c,openWithOptions:f,children:e=>(0,o.jsx)(Ve,{files:c.map(e=>({...e,uri:(0,E.resolveFilePath)(e)})),onClick:t=>e(t),onError:m})}),t&&"view"!==i&&(0,o.jsx)(Ie,{initialFiles:c,initialClick:g,multiple:!0,accept:"*",onUploadSuccess:e=>{Array.isArray(e)&&u((0,r.updateWidgetContent)(s,{files:e.map(e=>({...e,uri:(0,E.resolveFilePath)(e)??""}))}))},onUploadStart:()=>{u(r.Widget.slice.actions.setWidgetState({uniqid:s,loading:!0}))},onUploadEnd:()=>{u(r.Widget.slice.actions.setWidgetState({uniqid:s,loading:!1}))},children:"edit"===i?(0,o.jsx)(Oe,{label:"WIDGET_Article_Attachment_Empty_Label",description:"WIDGET_Article_Attachment_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}}):(0,o.jsx)(o.Fragment,{})})]}):(0,o.jsx)(o.Fragment,{})},$e=c.j.getLazyComponent("WidgetButton"),Fe=a.default.div`
167
+ display: flex;
168
+ flex: 1;
169
+ justify-content: center;
170
+ align-items: center;
171
+ `,Ne=a.default.div`
172
+ pointer-events: ${e=>e.clickable?"all":"none"};
173
+ cursor: pointer;
174
+ display: flex;
175
+ flex: 1;
176
+ justify-content: center;
177
+ align-items: center;
178
+ `,Ue=({widget:e,mode:t})=>{const i=(0,d.jL)(),{uniqid:a}=e,{text:l,url:s,target:c,color:u,backgroundColor:g,buttonSize:m,borderRadius:p,variant:h}=e.content;return(0,n.useEffect)(()=>{i(r.Widget.slice.actions.setWidgetState({uniqid:a,empty:!l||0===l.length}))},[l]),(0,o.jsx)(Fe,{onClick:()=>{"edit"===t&&i(r.WidgetEditor.slice.actions.registerEditor({uniqid:a,name:e.name}))},children:(0,o.jsx)(Ne,{clickable:"edit"!==t,children:(0,o.jsx)($e,{text:l,url:s,target:c,color:u,backgroundColor:g,buttonSize:m,borderRadius:p,variant:h})})})},Pe=c.j.getLazyComponent("WidgetArticleGallery"),Ye=c.j.getLazyComponent("WidgetEmptyInplace"),Qe=c.j.getLazyComponent("FileViewer"),Je=a.default.button`
179
+ cursor: pointer;
180
+ `,Xe=({widget:e,inplace:t,mode:i})=>{const{uniqid:a}=e,{files:l}=e.content,s=(0,d.jL)(),c=(0,d.GV)(e=>r.Widget.selectors.isActive(e,a),be.shallowEqual);return(0,n.useEffect)(()=>{s(r.Widget.slice.actions.setWidgetState({uniqid:a,mounted:!0}))},[]),void 0!==l?(0,o.jsxs)(o.Fragment,{children:["edit"===i?(0,o.jsx)(Pe,{files:l,maxWidth:800,gap:e.content.gap??"10",column:e.content.column??"3",onClick:()=>{}}):(0,o.jsx)(Qe,{files:l,openWithOptions:[],children:t=>(0,o.jsx)(Je,{children:(0,o.jsx)(Pe,{files:l,maxWidth:600,gap:e.content.gap??"10",column:e.content.column??"3",onClick:e=>t(e)})})}),t&&"edit"===i?(0,o.jsx)(Ie,{initialFiles:l,initialClick:c,accept:"image/png, image/jpeg, image/jpg",multiple:!0,onUploadSuccess:e=>{Array.isArray(e)&&s((0,r.updateWidgetContent)(a,{files:e}))},onUploadStart:()=>{s(r.Widget.slice.actions.setWidgetState({uniqid:a,loading:!0}))},onUploadEnd:()=>{s(r.Widget.slice.actions.setWidgetState({uniqid:a,loading:!1}))},children:(0,o.jsx)(Ye,{label:"WIDGET_Article_Gallery_Empty_Label",description:"WIDGET_Article_Gallery_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})}):(0,o.jsx)(o.Fragment,{})]}):(0,o.jsx)(o.Fragment,{})},Ke=c.j.getLazyComponent("WidgetImage"),Ze=c.j.getLazyComponent("FileViewer"),et=c.j.getLazyComponent("WidgetEmptyInplace"),tt=a.default.div`
181
+ position: absolute;
182
+ inset: 0;
183
+ background-color: rgba(0, 0, 0, 0.4);
184
+ pointer-events: none;
185
+ display: flex;
186
+ justify-content: center;
187
+ align-items: center;
188
+ opacity: 0;
189
+ color: ${e=>e.theme.color.white};
190
+ &:hover {
191
+ opacity: 1;
192
+ }
193
+ `,it=a.default.button`
194
+ cursor: pointer;
195
+ `,ot={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},nt=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},at=({widget:e,width:t,inplace:i,mode:a})=>{const{uniqid:s}=e,{file:c,useFilter:u}=e.content,g=(0,d.jL)(),m=(0,d.GV)(e=>r.Widget.selectors.isActive(e,s),be.shallowEqual),[p,h]=(0,n.useState)(void 0),f=(0,l.A)();return(0,n.useEffect)(()=>{g(r.Widget.slice.actions.setWidgetState({uniqid:s,mounted:!0}))},[]),(0,n.useEffect)(()=>{g(r.Widget.slice.actions.setWidgetState({uniqid:s,empty:!c}))},[c]),(0,n.useEffect)(()=>{c&&h((0,E.formatImgUrl)({timestamp:c.dateModified?nt(c.dateModified):Date.now(),from:"imagecache",size:"fitx1200",uri:c.uri}))},[c]),(0,o.jsxs)(o.Fragment,{children:["edit"!==a&&(0,o.jsx)(Ze,{files:[{...ot,...c,path:p,mimetype:"image/png"}],openWithOptions:[],children:e=>(0,o.jsx)(it,{onClick:()=>e(c?.id??0),children:(0,o.jsx)(Ke,{maxWidth:t??600,uri:p,useFilter:u??!1})})}),"edit"===a&&(0,o.jsxs)(o.Fragment,{children:[void 0!==p&&(0,o.jsx)(Ke,{maxWidth:t??600,uri:p,useFilter:u??!1}),i&&(0,o.jsx)(Ie,{initialFiles:[],initialClick:m,accept:"image/png, image/jpeg, image/jpg",multiple:!1,onUploadSuccess:e=>{Array.isArray(e)&&void 0!==e[0]&&g((0,r.updateWidgetContent)(s,{file:e[0]}))},onUploadStart:()=>{g(r.Widget.slice.actions.setWidgetState({uniqid:s,loading:!0}))},onUploadEnd:()=>{g(r.Widget.slice.actions.setWidgetState({uniqid:s,loading:!1}))},children:void 0!==c?(0,o.jsx)(tt,{children:f.formatMessage({id:"ARTICLE_Widget_Image_Change"})}):(0,o.jsx)(et,{label:"WIDGET_Article_Image_Empty_Label",description:"WIDGET_Article_Image_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})})]})]})},lt=c.j.getLazyComponent("FileViewer"),st=c.j.getLazyComponent("WidgetEmptyInplace"),rt=c.j.getLazyComponent("WidgetSlider"),dt=a.default.div`
196
+ flex: 1;
197
+ display: flex;
198
+ flex-direction: row;
199
+ min-height: 60px;
200
+ align-items: center;
201
+ width: ${e=>e.maxWidth}px;
202
+ `,ct={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},ut=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},gt=({widget:e,mode:t,width:i})=>{const{uniqid:a}=e,l=(0,d.jL)(),s=(0,d.GV)(e=>r.Widget.selectors.isActive(e,a),be.shallowEqual),c=i??600,[u,g]=(0,n.useState)(void 0),m=(0,n.useRef)(null),p=(0,n.useMemo)(()=>e.content.slides?[...e.content.slides.map((e,t)=>({...ct,id:e.file?e.file.id:t,mimetype:e.file?e.file.mimetype:ct.mimetype,path:e.file&&e.file.uri?(0,E.formatImgUrl)({size:"fitx1200",uri:e.file.uri,from:"imagecache",timestamp:e.file&&e.file.dateModified?ut(e.file.dateModified):Date.now()}):""}))]:[],[e.content.slides]),h=(0,n.useMemo)(()=>void 0!==e.content.slides?[...e.content.slides.map(e=>e.file?{...e,uri:(0,E.formatImgUrl)({timestamp:e.file.dateModified?ut(e.file.dateModified):Date.now(),size:`fitx${u&&u<c?u:c}`,from:"imagecache",uri:e.file.uri})}:{...e,uri:""})]:[],[e.content.slides,u,c]);(0,n.useEffect)(()=>{s&&"edit"===t&&l(r.WidgetEditor.slice.actions.registerEditor({uniqid:a,name:e.name}))},[s]),(0,n.useEffect)(()=>{const e=()=>{m.current&&g(m.current?m.current.offsetWidth:c)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[m]),(0,n.useEffect)(()=>{g(m.current?m.current.offsetWidth:c)},[m]),(0,n.useEffect)(()=>{l(r.Widget.slice.actions.setWidgetState({uniqid:a,empty:!e.content.slides||0===e.content.slides.length}))},[e.content.slides]);const f=(0,n.useMemo)(()=>"edit"===t&&Array.isArray(e.content.slides)&&0===e.content.slides.length,[e.content.slides,t]),x=(0,n.useCallback)(()=>{l(r.WidgetEditor.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))},[l,e.uniqid,e.name]);return void 0===u?(0,o.jsx)("div",{ref:m,style:{width:"100%"}}):(0,o.jsxs)(dt,{maxWidth:u&&u<c?u:c,children:[(0,o.jsx)(lt,{files:p,openWithOptions:[],children:i=>(0,o.jsx)(rt,{slides:h,maxWidth:u&&u<c?u:c,useDots:e.content.useDots??!0,loop:e.content.loop??!1,startAt:0,onClickSlide:o=>{if("edit"!==t){if(e.content.slides){const t=e.content.slides[o];t&&t.file&&i(t.file.id)}}else l(r.WidgetEditor.slice.actions.registerEditor({uniqid:a,name:e.name}))}})}),f?(0,o.jsx)(st,{label:"WIDGET_Article_Slider_Empty_Label",description:"WIDGET_Article_Slider_Empty_Description",url:"widget-article-image-placeholder.png",onClick:x}):(0,o.jsx)(o.Fragment,{})]})};var mt=i(4745);const pt=c.j.getLazyComponent("InputTextareaRaw"),ht=c.j.getLazyComponent("Modal"),ft=({onInsert:e,open:t,close:i})=>{const a=(0,l.A)(),[s,r]=(0,n.useState)(""),d=(0,n.useCallback)(()=>{r(""),i()},[i]);return(0,o.jsx)(ht,{title:a.formatMessage({id:"TINY_MCE_Insert_Markdown"}),open:t,closeHandler:d,enableClickAwayCloseModal:!0,buttons:[{children:(0,o.jsx)(T.A,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:d},{children:(0,o.jsx)(T.A,{id:"GLOBAL_Insert"}),color:"valid",disabled:!s,clickHandler:()=>{e(mt.xI.parse(s,{async:!1}).replace(/<br>/g,"<br><br>")),d()}}],children:(0,o.jsx)(pt,{value:s,onChange:e=>r(e.target.value),height:"400px"})})},xt=c.j.getLazyComponent("WidgetArticleText"),jt=a.default.div`
203
+ width: 100%;
204
+ cursor: text;
205
+
206
+ p {
207
+ word-wrap: break-word;
208
+ }
209
+
210
+ a {
211
+ word-wrap: break-word;
212
+ }
213
+ `,bt=({widget:e,mode:t})=>{const{uniqid:i}=e,s=(0,a.useTheme)(),{text:c}=e.content,u=(0,d.jL)(),g=(0,d.GV)(e=>r.Widget.selectors.isActive(e,i),be.shallowEqual),m=(0,d.GV)(e=>r.Widget.selectors.selectWidgetState(e,i)?.busy),p=(0,d.GV)(r.Widget.selectors.selectToken),h=(0,d.GV)(r.TinyMCE.selectors.selectTinyMCECommonOptions),f=(0,d.GV)(r.Model.selectors.selectAll),x=(0,l.A)(),{open:j,onInsert:b,close:C,ext:y,isActive:v}=xe(),L=(0,n.useCallback)(e=>{u(r.Toast.actions.error({label:e??x.formatMessage({id:"GLOBAL_Error"})}))},[u,x]);(0,n.useEffect)(()=>{u(r.Widget.slice.actions.setWidgetState({uniqid:i,empty:!c||0===c.length}))},[c]);const A=(0,n.useMemo)(()=>(0,je.X)(f,s,L),[f,L,s]);return m?(0,o.jsx)(o.Fragment,{}):(0,o.jsxs)(jt,{children:[(0,o.jsx)(xt,{autoFocus:g,text:c??"",token:"edit"===t&&void 0!==p?p:"",tinyMCECommonOptions:"edit"===t&&h?{commonOptions:h,mentionsQueries:A}:void 0,mode:t,onChange:e=>{u((0,r.updateWidgetContent)(i,{text:e}))},additionalExtensions:[y],handlers:{file:E.default.file}}),v&&(0,o.jsx)(ft,{onInsert:b,open:j,close:C})]})},Ct=c.j.getLazyComponent("WidgetArticleTitle"),yt=a.default.div`
214
+ flex: 1;
215
+ display: flex;
216
+ flex-direction: row;
217
+ align-items: center;
218
+ cursor: text;
219
+ `,vt=a.default.div`
220
+ display: flex;
221
+ flex-direction: row;
222
+ border-radius: 8px;
223
+ overflow: hidden;
224
+ margin: 4px;
225
+ border: 1px solid ${e=>e.theme.color.grey1};
226
+ `,Lt=a.default.button`
227
+ display: flex;
228
+ width: 40px;
229
+ height: 40px;
230
+ justify-content: center;
231
+ align-items: center;
232
+ cursor: pointer;
233
+ opacity: ${e=>e.isActive?"1.0":".8"};
234
+ background-color: ${e=>e.isActive?e.theme.color.grey1:e.theme.color.white};
235
+ &:hover {
236
+ background-color: ${e=>e.theme.color.grey1};
237
+ }
238
+ `,Et=({widget:e,inplace:t,mode:i,dataCy:a})=>{const{uniqid:l}=e,{text:s,color:c,heading:u}=e.content,g=(0,d.jL)(),m=(0,d.GV)(e=>r.Widget.selectors.isActive(e,l),be.shallowEqual);return(0,n.useEffect)(()=>{g(r.Widget.slice.actions.setWidgetState({uniqid:l,empty:!s||0===s.length}))},[s]),(0,o.jsxs)(yt,{children:[(0,o.jsx)(Ct,{dataCy:a,text:s,color:c,heading:u,autoFocus:m,inplace:t,mode:i,onChange:e=>{g((0,r.updateWidgetContent)(l,{text:e}))}}),m&&"edit"===i?(0,o.jsx)(At,{heading:u,onClick:e=>{g((0,r.updateWidgetContent)(l,{heading:e}))}}):(0,o.jsx)(o.Fragment,{})]})},At=({heading:e="h1",onClick:t})=>(0,o.jsx)(vt,{children:["h1","h2","h3","h4"].map((i,n)=>(0,o.jsx)(Lt,{isActive:e===i,onClick:()=>t(i),children:i},n))}),_t=c.j.getLazyComponent("ModalLayout"),kt=c.j.getLazyComponent("ModalContent"),Wt=c.j.getLazyComponent("Button"),wt=c.j.getLazyComponent("InputText"),St=c.j.getLazyComponent("InputNumber"),Mt=c.j.getLazyComponent("InputSelectExtended"),Tt=c.j.getLazyComponent("InputPassword"),qt=c.j.getLazyComponent("Typography"),Dt=c.j.getLazyComponent("Loader"),Gt=a.default.div`
239
+ display: flex;
240
+ flex-direction: column;
241
+ opacity: ${e=>e.isLocked?".4":"1.0"};
242
+ `,zt=a.default.div`
243
+ position: absolute;
244
+ inset: 0;
245
+ display: flex;
246
+ justify-content: center;
247
+ align-items: center;
248
+ `,It=a.default.div`
249
+ background-color: ${e=>e.theme.color.orange};
250
+ color: ${e=>e.theme.color.white};
251
+ padding: ${e=>e.theme.space.sm}px;
252
+ border-radius: ${e=>e.theme.space.sm}px;
253
+ display: flex;
254
+ justify-content: center;
255
+ align-items: center;
256
+ `,Vt=a.default.div`
257
+ margin-bottom: ${e=>e.theme.space.md}px;
258
+ `,Ot={username:"",password:"",hostname:"",imapPort:993,imapConnectionSecurity:E.ImapConnection.NONE,imapMailbox:"",cardDavAddressBook:"",calDavCalendar:"",provider:""},Rt=()=>{const e=(0,l.A)(),t=(0,d.jL)(),i=(0,s.useAbortController)(),[a,c]=(0,n.useState)(!1),[u,g]=(0,n.useState)(!1),{control:m,reset:p,setValue:h,getValues:f,watch:x,formState:{isValid:j}}=(0,q.useForm)({defaultValues:Ot,criteriaMode:"all"}),[b,C]=(0,n.useState)([]),y=x(),v=[{label:"NONE",value:E.ImapConnection.NONE},{label:"SSL",value:E.ImapConnection.SSL},{label:"STARTTLS",value:E.ImapConnection.STARTTLS}],L=(0,n.useCallback)(e=>{E.default.office.getConfiguration().then(({result:t})=>{p({...t,provider:e.includes(t.provider??"")?t.provider:e[0]})})},[p]);(0,n.useEffect)(()=>{a&&(g(!0),E.default.office.getProviders({signal:i.signal}).then(({result:e})=>{i.signal.aborted||(C(e),L(e.map(e=>e.id)))}).catch(e=>{i.signal.aborted||t(r.Toast.actions.error({label:e.errorMsg}))}).finally(()=>{g(!1)}))},[a,i.signal,t,L]),(0,n.useEffect)(()=>{1===b.length&&h("provider",b[0].id)},[b,h]);const A=()=>c(!1),_=(0,n.useMemo)(()=>b.length>1,[b]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(zt,{children:(0,o.jsx)(Wt,{label:e.formatMessage({id:"Office_Set_Configuration"}),onClick:()=>c(!0)})}),(0,o.jsx)(_t,{open:a,radius:"small",closeHandler:A,children:(0,o.jsx)(kt,{overflow:"scroll",title:e.formatMessage({id:"Office_Set_Configuration"}),onClickIconClose:A,children:u?(0,o.jsx)(Dt,{size:"s"}):(0,o.jsxs)(o.Fragment,{children:[0===b.length&&(0,o.jsx)(It,{children:e.formatMessage({id:"Office_No_Providers"})}),(0,o.jsxs)(Gt,{isLocked:0===b.length,children:[_&&(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(Vt,{children:[(0,o.jsx)(qt,{size:"l",children:(0,o.jsx)(T.A,{id:"OfficeHook_Conf_Provider"})}),(0,o.jsx)(Bt,{label:"OfficeHook_Conf_Select_Provider",initialValue:{label:b[0].label,value:b[0].id},options:b.map(e=>({label:e.label,value:e.id})),handleChange:e=>{f("provider")!==e&&p(),h("provider",e)}})]})}),(0,o.jsxs)(Vt,{children:[(0,o.jsx)(qt,{size:"l",children:(0,o.jsx)(T.A,{id:"OfficeHook_Settings"})}),(0,o.jsx)(wt,{control:m,name:"hostname",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Hostname"}),rules:{required:!0}}),(0,o.jsx)(wt,{control:m,name:"username",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_Username"}),rules:{required:!0}}),(0,o.jsx)(Tt,{control:m,name:"password",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_Password"}),rules:{required:!0}})]}),(0,o.jsxs)(Vt,{children:[(0,o.jsx)(qt,{size:"l",children:(0,o.jsx)(T.A,{id:"OfficeHook_Conf_IMap_Mailbox"})}),(0,o.jsx)(St,{control:m,name:"imapPort",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Port"}),rules:{required:!0}}),(0,o.jsx)(Bt,{label:"OfficeHook_Conf_Select_Connection_Security",initialValue:v[0],options:v,handleChange:e=>h("imapConnectionSecurity",e)}),(0,o.jsx)(wt,{control:m,name:"imapMailbox",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Mailbox"}),rules:{required:!0}})]}),(0,o.jsxs)(Vt,{children:[(0,o.jsx)(qt,{size:"l",children:(0,o.jsx)(T.A,{id:"OfficeHook_Conf_CalDav_Calendar"})}),(0,o.jsx)(wt,{control:m,name:"calDavCalendar",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_CalDav_Calendar"}),rules:{required:!0}})]}),(0,o.jsxs)(Vt,{children:[(0,o.jsx)(qt,{size:"l",children:(0,o.jsx)(T.A,{id:"OfficeHook_Conf_CardDav_Address_Book"})}),(0,o.jsx)(wt,{control:m,name:"cardDavAddressBook",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_CardDav_Address_Book"}),rules:{required:!0}})]})]}),(0,o.jsx)(Wt,{label:e.formatMessage({id:"OfficeHook_Conf_Prompt_Submit"}),loader:u,disabled:u||0===b.length||!j,onClick:()=>{u||(g(!0),E.default.office.setConfiguration(y).then(()=>window.location.reload()).catch(e=>t(r.Toast.actions.error({label:e.errorMsg}))).finally(()=>{c(!1),g(!1),p()}))}})]})})})]})},Bt=({label:e,initialValue:t,options:i,handleChange:a})=>{const{control:l,watch:s}=(0,q.useForm)({defaultValues:{provider:t},criteriaMode:"all"});return(0,n.useEffect)(()=>{const e=s(e=>{e.provider&&e.provider.value&&a(e.provider.value)});return()=>e.unsubscribe()},[s,a]),(0,o.jsx)(Mt,{label:e,name:"provider",options:i??[],getValue:e=>e.value,getLabel:"label",getSearch:"label",control:l,rules:{required:!0}})},Ht=a.default.div`
259
+ flex-direction: column;
260
+ display: flex;
261
+ flex: 1;
262
+ `,$t=a.default.div`
263
+ position: relative;
264
+ display: flex;
265
+ flex: 1;
266
+ `,Ft=a.default.div`
267
+ overflow: auto;
268
+ position: absolute;
269
+ inset: 0;
270
+ `,Nt=({header:e,scrollable:t,footer:i})=>(0,o.jsxs)(Ht,{children:[e&&e(),(0,o.jsx)($t,{children:(0,o.jsx)(Ft,{children:t&&t()})}),i&&i()]}),Ut=a.default.div`
271
+ display: flex;
272
+ flex-direction: column;
273
+ `,Pt=({uniqid:e,children:t})=>{const i=(0,d.GV)(t=>r.Widget.selectors.selectWidgetWrapperStyle(t,e),be.shallowEqual),a=(0,n.useMemo)(()=>({padding:i&&i.padding?`${i.padding}px`:"0px"}),[i]);return(0,o.jsx)(Ut,{style:{padding:a.padding},children:t})},Yt=a.default.div`
274
+ padding: ${e=>e.theme.space.md}px;
275
+ padding-right: 0px;
276
+ `,Qt=a.default.div`
277
+ text-align: ${e=>e.textAlign};
278
+ font-size: ${e=>e.fontSize}px;
279
+ font-weight: ${e=>e.fontWeight};
280
+ color: ${e=>e.color};
281
+ `,Jt=({uniqid:e,textAlign:t="left",fontSize:i="16",fontWeight:n="medium",color:a})=>{const l=(0,d.GV)(t=>r.Widget.selectors.selectWidget(t,e),be.shallowEqual);return(0,o.jsx)(o.Fragment,{children:l&&"string"==typeof l.title&&0!==l.title.length&&(0,o.jsx)(Yt,{children:(0,o.jsx)(Qt,{textAlign:t,fontSize:i,fontWeight:n,color:a,children:l.title})})})},Xt=a.default.div`
282
+ background-color: ${e=>e.backroundColor};
283
+ `,Kt=a.default.div`
284
+ display: flex;
285
+ flex-direction: row;
286
+ align-items: center;
287
+ `,Zt=(a.default.div`
288
+ padding: ${e=>e.theme.space.sm}px ${e=>e.theme.space.md}px;
289
+ color: ${e=>e.theme.color.grey4};
290
+ `,a.default.div`
291
+ flex: 1;
292
+ display: flex;
293
+ flex-direction: row;
294
+ gap: ${e=>e.theme.space.xs}px;
295
+ align-items: center;
296
+ `),ei=({uniqid:e,dropdown:t,subHeader:i})=>{const l=(0,a.useTheme)(),s=(0,d.GV)(t=>r.Widget.selectors.selectWidgetTitleStyle(t,e),be.shallowEqual),c=(0,n.useMemo)(()=>({color:s&&s.color?String(s.color):l.color.black,backgroundColor:s&&s["background-color"]?String(s["background-color"]):"transparent",fontSize:s&&s["font-size"]?String(s["font-size"]):"16",fontWeight:s&&s["font-weight"]?String(s["font-weight"]):"medium",textAlign:s&&s["text-align"]?String(s["text-align"]):"left"}),[s,l]);return(0,o.jsx)(Xt,{backroundColor:c.backgroundColor,children:(0,o.jsxs)(Kt,{children:[(0,o.jsxs)(Zt,{children:[(0,o.jsx)(Jt,{uniqid:e,fontWeight:c.fontWeight,fontSize:c.fontSize,textAlign:c.textAlign,color:c.color}),i&&i(c.color)]}),t&&t()]})})},ti=c.j.getLazyComponent("ButtonDropdown"),ii=c.j.getLazyComponent("Tooltip"),oi=a.default.div`
297
+ margin-right: ${e=>e.theme.space.sm}px;
298
+ button {
299
+ background: ${e=>e.theme.color.white};
300
+ }
301
+ `,ni=({uniqid:e,isConfigurationValid:t=!1,handleLogout:i})=>{const n=(0,l.A)(),a=(0,be.useDispatch)(),s=[{label:n.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{a(r.Widget.slice.actions.setWidgetState({uniqid:e,loading:!0})),E.default.office.setConfiguration(Ot).finally(i)}}];return(0,o.jsx)(ei,{uniqid:e,dropdown:()=>t&&(0,o.jsx)(oi,{children:(0,o.jsx)(ii,{position:"left",description:n.formatMessage({id:"WIDGET_Prompt_Dropdown"}),children:(0,o.jsx)(ti,{small:!0,smallOpenDirection:"left",options:s,icon:"icon-cogwheel",label:"",color:"primary",variant:"outlined"})})})})},ai=c.j.getLazyComponent("WidgetCalendarCalDav"),li=({widget:e,mode:t,levelFallback:i})=>{const{uniqid:a}=e,l=(0,d.jL)(),[c,u]=(0,n.useState)(void 0),[g,m]=(0,n.useState)(!1),p=(0,d.GV)(e=>r.Widget.selectors.selectWidgetLevel(e,a),be.shallowEqual),[h,f]=(0,n.useState)(void 0),[x,j]=(0,n.useState)([]),b=(0,n.useCallback)((e,t)=>{e&&400===e.error&&E.default.office.setConfiguration(Ot),t?window.location.reload():(u(!1),l(r.Widget.slice.actions.setWidgetState({uniqid:a,initialized:!0,loading:!1})))},[l,a]),C=(0,n.useCallback)(e=>{u(e),l(r.Widget.slice.actions.setWidgetState({uniqid:a,initialized:!0}))},[l,a]),y=(0,n.useCallback)(e=>l(r.Widget.slice.actions.setWidgetState({uniqid:a,loading:e})),[a,l]),v=(0,n.useCallback)(()=>{E.default.office.getProviderBaseUrls().then(({result:e})=>{f(e.dav_calendar_url)}).finally(()=>y(!1))},[y]),L=(0,n.useCallback)(()=>{const e=new Date,t=s.Utils.date.addMonth(new Date(e));E.default.office.davCalendarGetEvents({limit:10,dateStart:s.Utils.date.formatDateTime(e),dateEnd:s.Utils.date.formatDateTime(t)}).then(({result:e})=>{j(e),m(!0)}).catch(()=>{l(r.Toast.actions.error({label:"PLUGIN_Manager_Connection_Error"})),u(!1),l(r.Widget.slice.actions.setWidgetState({uniqid:a,initialized:!0,loading:!1}))}).finally(()=>y(!1))},[y,l,a]);return(0,n.useEffect)(()=>{if(!g)return;if(!c)return;if(p!==E.WIDGET_LEVEL_3)return;const e=setInterval(L,6e4);return()=>clearInterval(e)},[c,L,g,p]),(0,n.useEffect)(()=>{y(!0),E.default.office.isConfigurationValid().then(({result:e})=>C(e)).catch(b)},[b,y,C]),(0,n.useEffect)(()=>{if(c)return p===E.WIDGET_LEVEL_1?(y(!0),void v()):void L()},[c,v,y,L,p]),c&&p&&p!==E.WIDGET_LEVEL_3&&i?(0,o.jsx)(o.Fragment,{children:i(p,h??"")}):(0,o.jsx)(Nt,{header:()=>(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(ni,{uniqid:a,isConfigurationValid:void 0!==c&&!0===c,handleLogout:()=>b(void 0,!0)})}),scrollable:()=>(0,o.jsxs)(Pt,{uniqid:a,children:[c&&(0,o.jsx)(ai,{calendarListEvent:x}),void 0===c&&(0,o.jsx)(o.Fragment,{}),void 0!==c&&!1===c&&"view"===t&&(0,o.jsx)(Rt,{})]})})};var si=i(7858);const ri=c.j.getLazyComponent("Button"),di=c.j.getLazyComponent("ModalLayout"),ci=c.j.getLazyComponent("ModalContent"),ui=c.j.getLazyComponent("IconButton"),gi=(a.default.button`
302
+ padding: ${e=>e.theme.space.md}px;
303
+ `,a.default.div`
304
+ padding: ${e=>e.theme.space.md}px;
305
+ display: flex;
306
+ flex-direction: row-reverse;
307
+ `),mi=({id:e,type:t,uniqid:i})=>{const a=(0,d.jL)(),s=(0,l.A)(),[c,u]=(0,n.useState)(!1);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ui,{iconSize:14,onClick:()=>u(!0),icon:"icon-trash"}),c&&(0,o.jsxs)(di,{enableClickAwayCloseModal:!0,open:c,closeHandler:()=>u(!1),children:[(0,o.jsx)(ci,{overflow:"scroll",title:s.formatMessage({id:"WIDGET_Remove_Widget"}),onClickIconClose:()=>u(!1),children:s.formatMessage({id:"WIDGET_Delete_Widget_Confirmation"})}),(0,o.jsx)(gi,{children:(0,o.jsx)(ri,{label:s.formatMessage({id:"GLOBAL_Confirm"}),onClick:()=>{E.default.widget.removeWidget({id:e,type:t,uniqid:i}).then(()=>{a(r.Widget.slice.actions.flushWidget({uniqid:i}))}).catch(()=>a(r.Toast.actions.error({label:"WIDGET_Presence_Error"})))}})})]})]})},pi=a.default.div`
308
+ display: flex;
309
+ flex: 1;
310
+ flex-direction: row;
311
+ border-top: 1px solid ${e=>e.theme.color.grey1};
312
+ `,hi=a.default.button`
313
+ display: flex;
314
+ flex: 1;
315
+ justify-content: center;
316
+ align-items: center;
317
+ background-color: ${e=>e.theme.color.white};
318
+ &:hover {
319
+ background-color: ${e=>e.theme.color.grey0};
320
+ }
321
+ `,fi=({name:e,uniqid:t,mode:i,collaborationRights:a,handleOpenEditor:s})=>{const c=(0,l.A)(),u=(0,d.jL)(),g=(0,d.GV)(e=>r.Widget.selectors.selectWidgetObject(e,t),be.shallowEqual),m=(0,d.GV)(e=>r.Widget.selectors.selectWidgetObjectRights(e,t),be.shallowEqual),p=(0,n.useMemo)(()=>g&&m&&m.update||a&&a.update,[g,m,a]),h=(0,n.useMemo)(()=>g&&m&&m.delete,[g,m]),f=(0,n.useCallback)(()=>{u(r.WidgetEditor.slice.actions.registerEditor({uniqid:t,name:e,mode:i}))},[t,u,e,i]);return p&&(0,E.ensureWidgetObjectHasMinimumProperties)(g)?(0,o.jsxs)(pi,{children:[(0,o.jsx)(hi,{onClick:s??f,children:c.formatMessage({id:"WIDGET_Set_Widget"})}),h&&(0,o.jsx)(mi,{id:g.id,type:g.type,uniqid:t})]}):(0,o.jsx)(o.Fragment,{})},xi=c.j.getLazyComponent("Button"),ji=c.j.getLazyComponent("InputText"),bi=a.default.div`
322
+ padding: ${e=>e.theme.space.md}px;
323
+ display: flex;
324
+ flex-direction: row;
325
+ fieldset {
326
+ margin: 0.2rem !important;
327
+ }
328
+ `,Ci=({placeholder:e,handleClick:t})=>{const i=(0,l.A)(),a=(0,d.jL)(),[s,r]=(0,n.useState)(""),{control:c,watch:u,reset:g}=(0,q.useForm)({defaultValues:{label:s},criteriaMode:"all"});return(0,n.useEffect)(()=>{const e=u(e=>{r(e.label??"")});return()=>e.unsubscribe()},[u,a]),(0,o.jsxs)(bi,{children:[(0,o.jsx)(ji,{name:"label",control:c,placeholder:e,width:"100%"}),(0,o.jsx)(xi,{label:i.formatMessage({id:"GLOBAL_Confirm"}),disabled:!s.length,onClick:()=>{t(s),r(""),g()}})]})},yi=c.j.getLazyComponent("Loader"),vi=a.default.div`
329
+ position: absolute;
330
+ inset: 0;
331
+ display: flex;
332
+ justify-content: center;
333
+ align-items: center;
334
+ background-color: rgba(255, 255, 255, 0.4);
335
+ `,Li=()=>(0,o.jsx)(vi,{children:(0,o.jsx)(yi,{size:"m"})}),Ei=c.j.getLazyComponent("WidgetCheckList"),Ai=c.j.getLazyComponent("WidgetCheckListEditor"),_i=c.j.getLazyComponent("FileViewer"),ki=(a.default.div`
336
+ display: flex;
337
+ flex-direction: row;
338
+ justify-content: space-between;
339
+ align-items: center;
340
+ border: ${e=>e.border?`1px solid ${e.theme.color.grey2}`:"none"};
341
+ min-height: 24px;
342
+ border-radius: 4px;
343
+ padding: 4px 8px;
344
+ `,a.default.div`
345
+ width: 100%;
346
+ display: flex;
347
+ gap: 14px;
348
+ padding: 16px;
349
+ `),Wi=a.default.div`
350
+ position: relative;
351
+ `,wi=({widget:e,inplace:t,mode:i,onWidgetUpdate:a})=>{const c=(0,l.A)(),{uniqid:u,content:g}=e,m=(0,d.jL)(),[p,h]=(0,n.useState)(),[f,x]=(0,n.useState)(!1),[j,b]=(0,n.useState)(),[C,y]=(0,n.useState)(!1),v=(0,d.GV)(r.Widget.selectors.selectToken,be.shallowEqual),L=(0,d.GV)(t=>r.Widget.selectors.selectWidgetObjectUri(t,e.uniqid),be.shallowEqual),A=(0,d.GV)(e=>r.Widget.selectors.selectWidgetObjectRights(e,u),be.shallowEqual),_=(0,d.GV)(t=>r.Widget.selectors.selectAllWidgetRTObject(t,e.uniqid),be.shallowEqual),k=(0,n.useMemo)(()=>A&&A.update,[A]),W=(0,n.useMemo)(()=>A&&A.administrate,[A]),w=(0,n.useCallback)(e=>{m(r.Toast.actions.error({label:e??c.formatMessage({id:"GLOBAL_Error"})}))},[m,c]),S=(0,n.useCallback)(()=>{p||f||(x(!0),E.default.network.token().then(e=>{h(e.result),x(!1),m(r.Widget.slice.actions.setToken({token:e.result}))}).catch(e=>{w(e.errorMsg)}))},[w,p,f,m]);v?p||h(v):S();const M=(0,n.useCallback)((e,t)=>{m((0,r.updateWidgetContent)(e,t))},[m]),T=(0,n.useCallback)(()=>{L&&(y(!0),E.default.widget.getWidget({uri:L,uniqid:u}).then(e=>{(0,E.ensureWidgetCheckListType)(e.result)&&M(u,e.result.content)}).catch(e=>!e.aborted&&w).finally(()=>y(!1)))},[u,w,L,M]),q=t=>{m(r.WidgetEditor.slice.actions.flushAllEditor()),m(r.Widget.slice.actions.setToken({token:t})),m(r.WidgetEditor.slice.actions.registerEditor({uniqid:e.uniqid,name:E.WidgetsName.CheckList,mode:i}))};(0,n.useEffect)(()=>{p||"edit"!==i||E.default.network.token().then(e=>{m(r.Widget.slice.actions.setToken({token:e.result}))})},[i,p,m]),(0,n.useEffect)(()=>{const t=e.content.arr?.map(e=>({text:e.title??"",file:e.file??void 0,checked:e.value??!1,...e.links&&{links:e.links},...e.user&&{user:e.user??void 0},...e.id&&{id:e.id,mimetype:"image/png"}}));b(t)},[e.content.arr,g]),(0,n.useEffect)(()=>{if(!Array.isArray(_))return;const t=_.at(-1);t&&L&&t.object.uri===L&&t.uniqid===e.uniqid&&("check-list-response"!==t.fn&&"widget-update"!==t.fn||T())},[_,e.uniqid,L,w,m,T]);const D=t=>{if(!e.content.arr||!L)return;const i={...e.content,arr:[...e.content.arr,{title:t,value:!1}]};E.default.widget.updateWidget({uri:L,uniqid:e.uniqid,content:i,v2:!0}).then(()=>M(e.uniqid,i)).catch(e=>w(e.errorMsg))},G=(0,n.useMemo)(()=>{if(!Array.isArray(g.arr))return[];const e=[];return g.arr.forEach(t=>{t.file&&e.push(t.file)}),e},[g]);return"edit"===i&&t?(0,o.jsx)(ki,{children:(0,o.jsx)(Ai,{token:p,uniqid:u,content:{...g,arr:g.arr?.map(e=>({...e,title:s.Utils.html.htmlDecodeSpecialChars(e.title)}))},inplace:t,onChangeContent:M,onChangeWrapper:e=>{m(r.Widget.slice.actions.updateWidgetWrapper({...e}))},handleChange:t=>m((0,r.updateWidgetContent)(e.uniqid,t))})}):(0,o.jsx)(si.M,{useRT:()=>{(0,Ce.AW)(e.uniqid)},children:j&&(0,o.jsx)(_i,{files:G,openWithOptions:[],children:t=>(0,o.jsxs)(Wi,{children:[(0,o.jsx)(Ei,{limit:10,initialEntries:j,onFileClick:e=>e.id&&t(e.id),onItemCheckListChange:t=>((e,t)=>{L&&(C||(y(!0),E.default.widget.checkListRespond({uri:L,uniqid:e,index:t}).then(()=>{a&&a()}).catch(e=>{w(e.message),y(!1)})))})(e.uniqid,t)}),g.edit&&(0,o.jsx)(Ci,{handleClick:D,placeholder:c.formatMessage({id:"COMMENT_WIDGET_CHECKLIST_Add_New_Task"})}),W&&p&&(0,o.jsx)(fi,{uniqid:e.uniqid,name:e.name,collaborationRights:{update:!(!g.edit&&!k)},mode:i,handleOpenEditor:()=>{p?q(p):(y(!0),E.default.network.token().then(e=>{m(r.Widget.slice.actions.setToken({token:e.result})),q(e.result)}).finally(()=>y(!1)))}}),C&&(0,o.jsx)(Li,{})]},e.uniqid)})})},Si=c.j.getLazyComponent("ButtonDropdown"),Mi=c.j.getLazyComponent("Tooltip"),Ti=a.default.div`
352
+ margin-right: ${e=>e.theme.space.sm}px;
353
+ button {
354
+ background: ${e=>e.theme.color.white};
355
+ }
356
+ `,qi=({uniqid:e,isConfigurationValid:t=!1,handleLogout:i})=>{const n=(0,l.A)(),a=(0,be.useDispatch)(),s=[{label:n.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{a(r.Widget.slice.actions.setWidgetState({uniqid:e,loading:!0})),E.default.office.setConfiguration(Ot).finally(i)}}];return(0,o.jsx)(ei,{uniqid:e,dropdown:()=>t&&(0,o.jsx)(Ti,{children:(0,o.jsx)(Mi,{position:"left",description:n.formatMessage({id:"WIDGET_Prompt_Dropdown"}),children:(0,o.jsx)(Si,{small:!0,smallOpenDirection:"left",options:s,icon:"icon-cogwheel",label:"",color:"primary",variant:"outlined"})})})})},Di=c.j.getLazyComponent("WidgetContactCardDav"),Gi=({widget:e,mode:t,levelFallback:i})=>{const{uniqid:a}=e,l=(0,d.jL)(),[s,c]=(0,n.useState)(void 0),[u,g]=(0,n.useState)(void 0),[m,p]=(0,n.useState)(!1),h=(0,d.GV)(e=>r.Widget.selectors.selectWidgetLevel(e,a),be.shallowEqual),[f,x]=(0,n.useState)([]),j=(0,n.useCallback)((e,t)=>{e&&400===e.error&&E.default.office.setConfiguration(Ot),t?window.location.reload():(c(!1),l(r.Widget.slice.actions.setWidgetState({uniqid:a,initialized:!0,loading:!1})))},[l,a]),b=(0,n.useCallback)(e=>{c(e),l(r.Widget.slice.actions.setWidgetState({uniqid:a,initialized:!0}))},[l,a]),C=(0,n.useCallback)(e=>l(r.Widget.slice.actions.setWidgetState({uniqid:a,loading:e})),[a,l]),y=(0,n.useCallback)(()=>{E.default.office.getProviderBaseUrls().then(({result:e})=>{g(e.dav_address_book_url)}).finally(()=>C(!1))},[C]),v=(0,n.useCallback)(()=>{E.default.office.davAddressBookGetContacts({limit:10}).then(({result:e})=>{x(e),p(!0)}).catch(()=>{l(r.Toast.actions.error({label:"PLUGIN_Manager_Connection_Error"})),c(!1),l(r.Widget.slice.actions.setWidgetState({uniqid:a,initialized:!0,loading:!1}))}).finally(()=>C(!1))},[C,l,a]);return(0,n.useEffect)(()=>{if(!m)return;if(!s)return;if(h!==E.WIDGET_LEVEL_3)return;const e=setInterval(v,4e3);return()=>clearInterval(e)},[s,v,m,h]),(0,n.useEffect)(()=>{C(!0),E.default.office.isConfigurationValid().then(({result:e})=>b(e)).catch(j).finally(()=>C(!1))},[b,h,y,C,j]),(0,n.useEffect)(()=>{if(s)return h===E.WIDGET_LEVEL_1?(C(!0),void y()):void v()},[s,y,C,v,h]),s&&h&&h!==E.WIDGET_LEVEL_3&&i?(0,o.jsx)(o.Fragment,{children:i(h,u??"")}):(0,o.jsx)(Nt,{header:()=>(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(qi,{uniqid:a,isConfigurationValid:void 0!==s&&!0===s,handleLogout:()=>j(void 0,!0)})}),scrollable:()=>(0,o.jsxs)(Pt,{uniqid:a,children:[s&&(0,o.jsx)(Di,{contactCardList:f}),void 0===s&&(0,o.jsx)(o.Fragment,{}),void 0!==s&&!1===s&&"view"===t&&(0,o.jsx)(Rt,{})]})})},zi=c.j.getLazyComponent("ButtonDropdown"),Ii=c.j.getLazyComponent("Tooltip"),Vi=a.default.div`
357
+ margin-right: ${e=>e.theme.space.sm}px;
358
+ button {
359
+ background: ${e=>e.theme.color.white};
360
+ }
361
+ `,Oi=a.default.div`
362
+ font-size: ${e=>e.theme.size.sm+4}px;
363
+ color: ${e=>e.color};
364
+ `,Ri=({uniqid:e,isConfigurationValid:t=!1,handleLogout:i})=>{const n=(0,l.A)(),a=(0,d.jL)(),s=(0,d.GV)(t=>r.Widget.selectors.selectWidgetChipCount(t,e),be.shallowEqual),c=[{label:n.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{a(r.Widget.slice.actions.setWidgetState({uniqid:e,loading:!0})),E.default.office.setConfiguration(Ot).finally(i)}}];return(0,o.jsx)(ei,{uniqid:e,dropdown:()=>t&&(0,o.jsx)(Vi,{children:(0,o.jsx)(Ii,{position:"left",description:n.formatMessage({id:"WIDGET_Prompt_Dropdown"}),children:(0,o.jsx)(zi,{small:!0,smallOpenDirection:"left",options:c,icon:"icon-cogwheel",label:"",color:"primary",variant:"outlined"})})}),subHeader:e=>t&&0!==s&&(0,o.jsxs)(Oi,{color:e,children:["(",n.formatMessage({id:"WIDGET_Email_IMAP_Unread_Emails"},{count:s}),")"]})})},Bi=c.j.getLazyComponent("WidgetEmailsImap"),Hi=({widget:e,mode:t,levelFallback:i})=>{const{uniqid:a}=e,l=(0,d.jL)(),[s,c]=(0,n.useState)(void 0),[u,g]=(0,n.useState)(!1),[m,p]=(0,n.useState)([]),[h,f]=(0,n.useState)(void 0),x=(0,d.GV)(t=>r.Widget.selectors.selectWidgetLevel(t,e.uniqid),be.shallowEqual),j=(0,n.useCallback)((e,t)=>{e&&400===e.error&&E.default.office.setConfiguration(Ot),t?window.location.reload():(c(!1),l(r.Widget.slice.actions.setWidgetState({uniqid:a,initialized:!0,loading:!1})))},[l,a]),b=(0,n.useCallback)(()=>{E.default.office.imapInboxGetUnreadEmailsCount().then(({result:e})=>{l(r.Widget.slice.actions.setWidgetChipCount({uniqid:a,count:e})),l(r.Widget.slice.actions.setWidgetState({uniqid:a,initialized:!0}))}).catch(j)},[l,a,j]),C=(0,n.useCallback)(e=>l(r.Widget.slice.actions.setWidgetState({uniqid:a,loading:e})),[a,l]),y=(0,n.useCallback)(()=>{E.default.office.getProviderBaseUrls().then(({result:e})=>{f(e.imap_inbox_url)}).finally(()=>C(!1))},[C]),v=(0,n.useCallback)(e=>{c(e),l(r.Widget.slice.actions.setWidgetState({uniqid:a,initialized:!0}))},[l,a]),L=(0,n.useCallback)(()=>{E.default.office.imapInboxGetEmails({limit:10}).then(({result:e})=>{p(e),g(!0)}).catch(()=>{l(r.Toast.actions.error({label:"PLUGIN_Manager_Connection_Error"})),c(!1),l(r.Widget.slice.actions.setWidgetState({uniqid:a,initialized:!0,loading:!1}))}).finally(()=>C(!1))},[C,l,a]);return(0,n.useEffect)(()=>{if(!u)return;if(!s)return;if(x===E.WIDGET_LEVEL_1)return;const e=setInterval(()=>{x===E.WIDGET_LEVEL_2&&b(),x===E.WIDGET_LEVEL_3&&(b(),L())},6e4);return()=>clearInterval(e)},[s,L,u,b,x]),(0,n.useEffect)(()=>{E.default.office.isConfigurationValid().then(({result:e})=>v(e)).catch(j)},[v,j]),(0,n.useEffect)(()=>{if(s){if(x===E.WIDGET_LEVEL_1)return C(!0),void y();if(x===E.WIDGET_LEVEL_2)return C(!0),b(),void y();C(!0),b(),L()}},[s,x,y,L,C,b,l]),s&&x&&x!==E.WIDGET_LEVEL_3&&i?(0,o.jsx)(o.Fragment,{children:i(x,h??"")}):(0,o.jsx)(Nt,{header:()=>(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(Ri,{uniqid:a,isConfigurationValid:void 0!==s&&!0===s,handleLogout:()=>j(void 0,!0)})}),scrollable:()=>(0,o.jsxs)(Pt,{uniqid:a,children:[void 0===s&&(0,o.jsx)(o.Fragment,{}),void 0!==s&&!1===s&&"view"===t&&(0,o.jsx)(Rt,{}),s&&(0,o.jsx)(Bi,{emailList:m})]})})},$i=a.default.div`
365
+ position: absolute;
366
+ inset: 0;
367
+ display: flex;
368
+ justify-content: center;
369
+ align-items: center;
370
+ `,Fi=c.j.getLazyComponent("WidgetLuccaAbsence"),Ni=c.j.getLazyComponent("Loader"),Ui=({uniqid:e})=>{const[t,i]=(0,n.useState)([]),[a,l]=(0,n.useState)(!1),[s,r]=(0,n.useState)(!0),d=(0,B.Ie)(),c=(0,n.useMemo)(()=>(new Date).getFullYear()+"-"+((new Date).getMonth()+1).toString().padStart(2,"0")+"-"+(new Date).getDate().toString().padStart(2,"0")+" 00:00:00",[]);return(0,n.useEffect)(()=>{E.default.lucca.getAbsence({date:c},{signal:d.signal}).then(({result:e})=>i(e)).catch(()=>{d.signal.aborted||l(!0)}).finally(()=>r(!1))},[c,d.signal]),s?(0,o.jsx)($i,{children:(0,o.jsx)(Ni,{size:"m"})}):a?(0,o.jsx)($i,{children:(0,o.jsx)(T.A,{id:"WIDGET_Lucca_Absence_Url_Error"})}):(0,o.jsx)(Nt,{header:()=>(0,o.jsx)(ei,{uniqid:e}),scrollable:()=>(0,o.jsx)(Pt,{uniqid:e,children:(0,o.jsx)(Fi,{list:t})})})},Pi=a.default.div`
371
+ padding: ${e=>e.theme.space.md}px;
372
+ `,Yi=a.default.a`
373
+ cursor: pointer;
374
+ color: ${e=>e.theme.color.secondary};
375
+ `,Qi=a.default.div`
376
+ display: flex;
377
+ justify-content: center;
378
+ align-items: center;
379
+ `,Ji=({mode:e,uniqid:t,content:i})=>{const a=(0,l.A)(),s=(0,d.jL)(),c=(0,d.GV)(e=>r.Widget.selectors.selectWidgetObjectUri(e,t),be.shallowEqual),u=(0,d.GV)(e=>r.Widget.selectors.selectWidgetObjectRights(e,t),be.shallowEqual),g=(0,n.useMemo)(()=>!(!u||!u.update),[u]),m=(0,n.useCallback)(()=>{if("edit"===e||!g||!c)return;const o={...i,isClosed:!0};E.default.widget.updateWidget({uri:c,uniqid:t,content:o,v2:!0}).then(()=>s(r.Widget.slice.actions.updateWidget({uniqid:t,content:o}))).catch(()=>s(r.Toast.actions.error({label:"WIDGET_Presence_Error"})))},[e,t,g,c,i,s]);return(0,o.jsx)(o.Fragment,{children:g&&!i.isClosed&&(0,o.jsx)(Pi,{children:(0,o.jsx)(Qi,{children:(0,o.jsx)(Yi,{onClick:m,children:a.formatMessage({id:"WIDGET_Presence_Closing"})})})})})},Xi=c.j.getLazyComponent("WidgetPresence"),Ki=c.j.getLazyComponent("ModalUserList"),Zi=a.default.div`
380
+ display: flex;
381
+ flex: 1;
382
+ position: relative;
383
+ flex-direction: column;
384
+ `,eo=(a.default.div`
385
+ position: absolute;
386
+ inset: 0;
387
+ background-color: rgba(255, 255, 255, 0.7);
388
+ display: flex;
389
+ flex: 1;
390
+ justify-content: center;
391
+ align-items: center;
392
+ `,a.default.div`
393
+ flex: 1;
394
+ display: flex;
395
+ padding: ${e=>e.theme.space.md}px;
396
+ border: 1px dashed ${e=>e.theme.color.orange};
397
+ justify-content: center;
398
+ align-items: center;
399
+ border-radius: ${e=>e.theme.space.sm}px;
400
+ margin: ${e=>e.theme.space.sm}px;
401
+ `),to=({widget:e,mode:t})=>{const i=(0,l.A)(),a=(0,d.jL)(),{limit:s,limitValue:c,closing:u,isClosed:g}=e.content,{uniqid:m}=e,[p,h]=(0,n.useState)({userValue:-1,userAvailableList:[],userUnavailableList:[],userAvailableTotal:0,userUnavailableTotal:0}),[f,x]=(0,n.useState)(!1),[j]=(0,n.useState)(new AbortController),[b,C]=(0,n.useState)(!1),[y,v]=(0,n.useState)(),[L,A]=(0,n.useState)(),_=(0,n.useRef)(j),k=(0,d.GV)(e=>r.Widget.selectors.selectWidgetObjectUri(e,m),be.shallowEqual),W=(0,d.GV)(e=>r.Widget.selectors.selectAllWidgetRTObject(e,m),be.shallowEqual),w=(0,n.useCallback)(()=>a(r.Toast.actions.error({label:"WIDGET_Presence_Error"})),[a]),S=(0,n.useMemo)(()=>!(s&&c&&p.userAvailableTotal>=c),[s,c,p.userAvailableTotal]),M=(0,n.useMemo)(()=>u&&g||"edit"===t,[u,g,t]),T=(0,n.useCallback)(()=>{k&&!M&&(S?(x(!0),E.default.widget.presenceCancel({uri:k,uniqid:m}).catch(w).finally(()=>x(!1))):a(r.Toast.actions.error({label:"WIDGET_Presence_Limit_Response_Error"})))},[a,m,w,k,S,M]),q=(0,n.useCallback)(e=>{k&&!M&&(x(!0),E.default.widget.presenceRespond({uri:k,uniqid:m,value:e},_.current.signal).catch(w).finally(()=>x(!1)))},[k,m,w,M]),D=(0,n.useCallback)(()=>{"edit"!==t&&k&&(x(!0),E.default.widget.presenceGetResponse({uri:k,uniqid:m},_.current.signal).then(e=>{h(e.result)}).catch(e=>!e.aborted&&w()).finally(()=>x(!1)))},[k,w,m,t]),G=(e,t)=>{k&&E.default.widget.presenceGetResponseUserList({uri:k,uniqid:m,index:e,page:t,limit:8},_.current.signal).then(e=>{A({...e.result,data:[...e.result.data],cnt:e.result.cnt})}).catch(e=>!e.aborted&&w)},z=(0,n.useCallback)(()=>{k&&(x(!0),E.default.widget.getWidget({uri:k,uniqid:m}).then(e=>{a((0,r.updateWidgetContent)(m,e.result))}).catch(e=>!e.aborted&&w).finally(()=>x(!1)))},[a,w,k,m]);return(0,n.useEffect)(()=>{const e=_.current;return()=>{e.abort()}},[]),(0,n.useEffect)(()=>{D()},[D]),(0,n.useEffect)(()=>{if(!Array.isArray(W))return;const e=W.at(-1);e&&k&&e.object.uri===k&&e.uniqid===m&&("widget-presence-response"===e.fn&&D(),"widget-update"===e.fn&&z())},[W,D,m,k,z]),(0,o.jsx)(si.M,{useRT:()=>{(0,Ce.AW)(e.uniqid)},children:(0,o.jsxs)(Zi,{children:[(0,o.jsx)(Xi,{limit:s,limitValue:c,userAvailableList:p.userAvailableList,userUnavailableList:p.userUnavailableList,userValue:p.userValue,userAvailableTotal:p?.userAvailableTotal,userUnavailableTotal:p?.userUnavailableTotal,isClosed:u&&g,handleClickAvailable:()=>1===p.userValue?T():q(1),handleClickUnavailable:()=>0===p.userValue?T():q(0),handleOpenUsersModal:e=>{A({limit:0,page:0,data:[],cnt:0}),v(e),G(e),C(!0)}}),u&&g&&(0,o.jsx)(eo,{children:i.formatMessage({id:"WIDGET_Presence_Is_Closed"})}),u&&!g&&(0,o.jsx)(Ji,{mode:t,uniqid:e.uniqid,content:e.content}),"view"===t&&(0,o.jsx)(fi,{uniqid:e.uniqid,name:e.name,mode:t}),f&&(0,o.jsx)(Li,{}),(0,o.jsx)(Ki,{open:b,usersList:L,title:1===y?i.formatMessage({id:"WIDGET_Presence_On"}):i.formatMessage({id:"WIDGET_Presence_Off"}),setOpen:C,onClose:()=>{A({limit:0,page:0,data:[],cnt:0})},handleLoadUsersList:e=>{G(y??0,e)}})]})})},io=c.j.getLazyComponent("WidgetQuickSurvey"),oo=c.j.getLazyComponent("WidgetQuickSurveyEditor"),no=c.j.getLazyComponent("ModalUserList"),ao=c.j.getLazyComponent("FileViewer"),lo=a.default.div`
402
+ width: 100%;
403
+ display: flex;
404
+ flex-direction: column;
405
+ gap: 14px;
406
+ ${e=>e.withPadding&&"padding: 0 12px;"}
407
+ padding-top: 16px;
408
+ `,so=({widget:e,inplace:t,mode:i})=>{const a=(0,l.A)(),s=(0,d.jL)(),{uniqid:c,content:u}=e,[g,m]=(0,n.useState)({userResponses:[],totalRespondent:0,totalResponse:0,userLoggedResponses:[]}),[p,h]=(0,n.useState)(!1),[f,x]=(0,n.useState)(!1),[j,b]=(0,n.useState)(),[C,y]=(0,n.useState)(),[v]=(0,n.useState)(new AbortController),L=(0,n.useRef)(v),A=(0,d.GV)(r.Widget.selectors.selectToken,be.shallowEqual),_=(0,d.GV)(t=>r.Widget.selectors.selectWidgetObjectUri(t,e.uniqid),be.shallowEqual),k=(0,d.GV)(e=>r.Widget.selectors.selectWidgetObjectRights(e,c),be.shallowEqual),W=(0,d.GV)(t=>r.Widget.selectors.selectAllWidgetRTObject(t,e.uniqid),be.shallowEqual),w=(0,n.useCallback)((e,t)=>{s((0,r.updateWidgetContent)(e,t))},[s]),S=t=>{s(r.WidgetEditor.slice.actions.flushAllEditor()),s(r.Widget.slice.actions.setToken({token:t})),s(r.WidgetEditor.slice.actions.registerEditor({uniqid:e.uniqid,name:E.WidgetsName.QuickSurvey}))},M=(0,n.useCallback)(()=>s(r.Toast.actions.error({label:"WIDGET_Presence_Error"})),[s]),T=(0,n.useCallback)(e=>{"edit"!==i&&_&&(x(!0),E.default.widget.quickSurveyGetResponse({uri:_,uniqid:e},L.current.signal).then(e=>{m(e.result)}).catch(e=>!e.aborted&&M).finally(()=>x(!1)))},[M,_,i]),q=(0,n.useCallback)(()=>{_&&(x(!0),E.default.widget.getWidget({uri:_,uniqid:c},L.current.signal).then(e=>{w(c,e.result.content)}).catch(e=>!e.aborted&&M).finally(()=>x(!1)))},[c,M,_,w]),D=()=>{if(_&&u.closing){const e={...u,isClosed:!0};E.default.widget.updateWidget({uri:_,uniqid:c,content:e}).catch(()=>{M()})}},G=t=>{(t=>{"edit"!==i&&_&&(x(!0),E.default.widget.quickSurveyRespond({uri:_,index:t,multi:u.multi?1:0,uniqid:c},L.current.signal).then(()=>{T(e.uniqid)}).catch(e=>!e.aborted&&M).finally(()=>x(!1)))})(t)},z=(e,t)=>{_&&E.default.widget.quickSurveyGetResponseUserList({uri:_,uniqid:c,index:e,page:t,limit:8},L.current.signal).then(e=>{y({...e.result,data:[...e.result.data],cnt:e.result.cnt})}).catch(e=>!e.aborted&&M)},I=(0,n.useMemo)(()=>k&&k.update,[k]);(0,n.useEffect)(()=>{T(e.uniqid)},[T,e.uniqid]),(0,n.useEffect)(()=>{if(!Array.isArray(W))return;const t=W.at(-1);t&&_&&t.object.uri===_&&t.uniqid===e.uniqid&&("widget-quick-survey-response"===t.fn&&T(e.uniqid),"widget-update"===t.fn&&q())},[W,_,e.uniqid,q,T]);const V=(0,n.useMemo)(()=>{if(!Array.isArray(u.arr))return[];const e=[];return u.arr.forEach(t=>{t.file&&e.push(t.file)}),e},[u]);return(0,n.useEffect)(()=>{A||"edit"!==i||E.default.network.token().then(e=>{s(r.Widget.slice.actions.setToken({token:e.result}))})},[i,A,s]),"edit"===i&&t?(0,o.jsx)(lo,{withPadding:!0,children:(0,o.jsx)(oo,{token:A,uniqid:c,content:e.content,onChangeContent:w,onChangeWrapper:e=>{s(r.Widget.slice.actions.updateWidgetWrapper({...e}))},handleChange:e=>w(c,e),inplace:t})}):(0,o.jsx)(si.M,{useRT:()=>{(0,Ce.AW)(e.uniqid)},children:(0,o.jsxs)(lo,{children:[(0,o.jsx)(ao,{files:V,openWithOptions:[],children:t=>(0,o.jsx)(io,{limit:g.totalResponse??0,values:u.arr??[],userResponses:g.userResponses,userHasAlreadyVoted:g.userLoggedResponses.length>0,canCloseSurvey:e.content.closing??!1,isClosed:e.content.isClosed??!1,open:e.content.open??!1,anonymize:e.content.anonymize??!1,seeResponseAfter:e.content.seeResponseAfter??!1,canUpdate:I,handleClickFile:e=>e.id&&t(e.id),handleCloseSurvey:D,handleProgressBarClick:G,setOpenUsersModal:e=>{b(e),z(e),h(!0)}})}),u.open&&(0,o.jsx)(Ci,{handleClick:e=>{if(!_)return;const t={...u,arr:[...u.arr??[],{title:e}]};E.default.widget.quickSurveyAddEnty({uri:_,uniqid:c,label:e}).then(()=>{s(r.Widget.slice.actions.updateWidget({uniqid:c,content:t}))}).catch(M)},placeholder:a.formatMessage({id:"FIELDS_Add_Option"})}),I&&(0,o.jsx)(fi,{uniqid:e.uniqid,name:e.name,collaborationRights:{update:!!I},mode:i,handleOpenEditor:()=>{A?S(A):(x(!0),E.default.network.token().then(e=>{s(r.Widget.slice.actions.setToken({token:e.result})),S(e.result)}).finally(()=>x(!1)))}}),f&&(0,o.jsx)(Li,{}),(0,o.jsx)(no,{open:p,usersList:C,title:u.arr?.[j??0]?.title??"",setOpen:h,handleLoadUsersList:e=>{z(j??0,e)},onClose:()=>{y({limit:0,page:0,data:[],cnt:0})}})]})})},ro=c.j.getLazyComponent("WidgetUserProfile"),co=({widget:e,mode:t})=>{const i=(0,d.jL)(),{uniqid:a,name:l,content:s}=e,c=(0,d.GV)(r.UserCurrent.selectors.get);return(0,n.useEffect)(()=>(i(r.Widget.slice.actions.setWidgetState({uniqid:a,mounted:!0})),()=>{i(r.Widget.slice.actions.setWidgetState({uniqid:a,mounted:!1}))}),[a,i]),(0,n.useEffect)(()=>{"edit"===t&&(i(r.WidgetEditor.slice.actions.flushAllEditor()),i(r.WidgetEditor.slice.actions.registerEditor({uniqid:a,name:l})))},[i,t,l,a]),(0,n.useEffect)(()=>{"view"!==t&&"preview"!==t||i(r.WidgetEditor.slice.actions.flushAllEditor())},[t,i]),(0,o.jsx)(ro,{currentUser:c,pictureSize:s.pictureSize,displayMode:s.buttonName,css:s.css})},uo=c.j.getLazyComponent("WidgetWelcome"),go=({widget:e,mode:t})=>{const i=(0,d.jL)(),{uniqid:a,name:l,content:s}=e,c=(0,d.GV)(r.UserCurrent.selectors.get);return(0,n.useEffect)(()=>(i(r.Widget.slice.actions.setWidgetState({uniqid:a,mounted:!0})),()=>{i(r.Widget.slice.actions.setWidgetState({uniqid:a,mounted:!1}))}),[a,i]),(0,n.useEffect)(()=>{"edit"===t&&(i(r.WidgetEditor.slice.actions.flushAllEditor()),i(r.WidgetEditor.slice.actions.registerEditor({uniqid:a,name:l})))},[i,t,l,a]),(0,n.useEffect)(()=>{"view"!==t&&"preview"!==t||i(r.WidgetEditor.slice.actions.flushAllEditor())},[t,i]),(0,o.jsx)(uo,{currentUser:c,position:s.position,lineBreak:s.lineBreak,message:s.message,displayMode:s.buttonName,css:s.css})},mo=c.j.getLazyComponent("WidgetColor"),po=({widget:e,mode:t})=>{const i=(0,d.jL)(),{uniqid:a,name:l,content:s}=e;return(0,n.useEffect)(()=>(i(r.Widget.slice.actions.setWidgetState({uniqid:a,mounted:!0})),()=>{i(r.Widget.slice.actions.setWidgetState({uniqid:a,mounted:!1}))}),[a,i]),(0,n.useEffect)(()=>{"edit"===t&&(i(r.WidgetEditor.slice.actions.flushAllEditor()),i(r.WidgetEditor.slice.actions.registerEditor({uniqid:a,name:l})))},[i,t,l,a]),(0,n.useEffect)(()=>{"view"!==t&&"preview"!==t||i(r.WidgetEditor.slice.actions.flushAllEditor())},[t,i]),(0,o.jsx)(mo,{backgroundColor:s.backgroundColor})},ho=({uniqid:e,extensionName:t})=>{const i=(0,n.useMemo)(()=>`widget-extension-${t}-${e}`,[t,e]);return(0,n.useEffect)(()=>{t&&J.react.require(t,{anchorId:i})},[t,i]),(0,o.jsx)("div",{id:i})},fo=(e,t)=>{const i=[];return e.filter(e=>e.isVisible).forEach(e=>{const o=t.find(t=>t.name===e.name);o&&i.push(o)}),i},xo=c.j.getLazyComponent("Button"),jo=c.j.getLazyComponent("WidgetTable"),bo=c.j.getLazyComponent("Loader"),Co=(a.default.div``,a.default.div`
409
+ position: absolute;
410
+ inset: 0;
411
+ display: flex;
412
+ flex-direction: column;
413
+ justify-content: center;
414
+ align-items: center;
415
+ gap: ${e=>e.theme.space.md}px;
416
+ `),yo=({uri:e,limit:t,tableHeadColor:i,tableHeadTextColor:a,tableHeadIconColor:l,tableRowColor:s,tableRowTextColor:c,tableColumnsData:u=[],tableBorderRadius:g,tableSizedColumns:m,tableSizedColumnsWidth:p,mode:h})=>{const f=(0,d.jL)(),[x,j]=(0,n.useState)(!1),[b,C]=(0,n.useState)([]),[y,v]=(0,n.useState)([]),L=(0,n.useMemo)(()=>r.Widget.definition(E.WidgetsName.ExcelDatasourceTable),[]);(0,n.useEffect)(()=>{void 0!==e&&0!==u.length&&0===y.length&&(j(!0),E.default.datasource.get(e,E.Format.VIEW).then(e=>{v(e.result.model),C(e.result.data)}).finally(()=>j(!1)))},[e,u,y]),(0,n.useEffect)(()=>{e||v([])},[e]),(0,n.useEffect)(()=>{"view"!==h&&"preview"!==h||f(r.WidgetEditor.slice.actions.flushAllEditor())},[h,f]);const A=(0,n.useMemo)(()=>fo(u,y),[u,y]);return 0!==u.length||x||"edit"!==h?x?(0,o.jsx)(Co,{children:(0,o.jsx)(bo,{})}):(0,o.jsx)(o.Fragment,{children:x||0!==b.length||"edit"===h?(0,o.jsx)(jo,{rows:b,columns:A,limit:t,tableHeadColor:i,tableHeadTextColor:a,tableHeadIconColor:l,tableRowColor:s,tableRowTextColor:c,tableBorderRadius:g,tableColumnsData:u,tableSizedColumns:m,tableSizedColumnsWidth:p}):(0,o.jsxs)(Co,{children:[(0,o.jsx)("img",{src:`/img/fast-intranet/${E.WidgetsName.ExcelDatasourceTable}.png`,alt:""}),(0,o.jsx)(T.A,{id:"WIDGET_Datasource_No_Results"})]})}):(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(Co,{children:[(0,o.jsx)("img",{src:`/img/fast-intranet/${E.WidgetsName.ExcelDatasourceTable}.png`,alt:""}),(0,o.jsx)(T.A,{id:L.label}),(0,o.jsx)(xo,{label:"GLOBAL_Settings"})]})})},vo=c.j.getLazyComponent("Button"),Lo=c.j.getLazyComponent("WidgetTable"),Eo=c.j.getLazyComponent("Loader"),Ao=(a.default.div``,a.default.div`
417
+ position: absolute;
418
+ inset: 0;
419
+ display: flex;
420
+ flex-direction: column;
421
+ justify-content: center;
422
+ align-items: center;
423
+ gap: ${e=>e.theme.space.md}px;
424
+ `),_o=({uri:e,limit:t,tableHeadColor:i,tableHeadTextColor:a,tableHeadIconColor:l,tableRowColor:s,tableRowTextColor:c,tableColumnsData:u=[],tableBorderRadius:g,tableSizedColumns:m,tableSizedColumnsWidth:p,mode:h})=>{const f=(0,d.jL)(),[x,j]=(0,n.useState)(!1),[b,C]=(0,n.useState)([]),[y,v]=(0,n.useState)([]),[L,A]=(0,n.useState)({order:"ascending",name:"unknown"}),[_,k]=(0,n.useState)(void 0),[W,w]=(0,n.useState)(""),S=(0,n.useMemo)(()=>r.Widget.definition(E.WidgetsName.DatasourceTable),[]),M=(0,n.useMemo)(()=>"studio"===_?[{type:[W]}]:[],[_,W]),q=(0,n.useMemo)(()=>"doc"===_?[W]:[],[_,W]),{rtLastObject:D}=(0,Ce.YL)(M,q),G=(0,n.useCallback)(()=>{e&&(j(!0),E.default.datasource.get(e,E.Format.VIEW).then(e=>{v(e.result.model),C(e.result.data),A(e.result.sort),k(e.result.datasource.datasourceType),w(e.result.datasource.datasourceIdentifier)}).finally(()=>j(!1)))},[e]);(0,n.useEffect)(()=>{void 0!==e&&0!==u.length&&0===y.length&&G()},[e,u,y,G]),(0,n.useEffect)(()=>{D&&G()},[D,G]),(0,n.useEffect)(()=>{e||v([])},[e]),(0,n.useEffect)(()=>{"view"!==h&&"preview"!==h||f(r.WidgetEditor.slice.actions.flushAllEditor())},[h,f]);const z=(0,n.useMemo)(()=>fo(u,y),[u,y]);return 0!==u.length||x||"edit"!==h?x?(0,o.jsx)(Ao,{children:(0,o.jsx)(Eo,{})}):(0,o.jsx)(o.Fragment,{children:x||0!==b.length||"edit"===h?(0,o.jsx)(Lo,{rows:b,columns:z,limit:t,tableHeadColor:i,tableHeadTextColor:a,tableHeadIconColor:l,tableRowColor:s,tableRowTextColor:c,tableBorderRadius:g,tableColumnsData:u,tableSizedColumns:m,tableSizedColumnsWidth:p,tableDefaultSortOrder:L.order,tableDefaultSortName:L.name}):(0,o.jsxs)(Ao,{children:[(0,o.jsx)("img",{src:`/img/fast-intranet/${E.WidgetsName.DatasourceTable}.png`,alt:""}),(0,o.jsx)(T.A,{id:"WIDGET_Datasource_No_Results"})]})}):(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(Ao,{children:[(0,o.jsx)("img",{src:`/img/fast-intranet/${E.WidgetsName.DatasourceTable}.png`,alt:""}),(0,o.jsx)(T.A,{id:S.label}),(0,o.jsx)(vo,{label:"GLOBAL_Settings"})]})})},ko=a.default.div`
425
+ position: absolute;
426
+ inset: 0;
427
+ display: flex;
428
+ align-items: center;
429
+ justify-content: center;
430
+ color: ${e=>e.theme.color.orange};
431
+ `,Wo=({children:e,name:t})=>{const i=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,t)),n=(0,l.A)();return i&&!i.hasLicense?(0,o.jsx)(ko,{children:n.formatMessage({id:"WIDGET_Missing_License"},{label:"label"in i?i.label:""})}):(0,o.jsx)(o.Fragment,{children:e})},wo=a.default.div`
432
+ display: flex;
433
+ flex: 1;
434
+ flex-direction: column;
435
+ `,So=({widget:e,width:t,inplace:i=!1,mode:n="view",onWidgetUpdate:a,cannotDisplayComponent:l,levelFallback:s,dataCy:r})=>{const{name:d}=e;return(0,E.ensureWidgetArticleButtonType)(e)?(0,o.jsx)(Ue,{widget:e,inplace:i,mode:n}):(0,E.ensureWidgetArticleGalleryType)(e)?(0,o.jsx)(Xe,{widget:e,inplace:i,mode:n}):(0,E.ensureWidgetLuccaAbsenceType)(e)?(0,o.jsx)(wo,{children:(0,o.jsx)(Wo,{name:"LuccaAbsenceHook",children:(0,o.jsx)(Ui,{uniqid:e.uniqid})})}):(0,E.ensureWidgetArticleAttachmentType)(e)?(0,o.jsx)(He,{widget:e,inplace:i,mode:n}):(0,E.ensureWidgetArticleImageType)(e)?(0,o.jsx)(at,{widget:e,inplace:i,mode:n}):(0,E.ensureWidgetArticleSliderType)(e)?(0,o.jsx)(gt,{widget:e,inplace:i,mode:n,width:t??800}):(0,E.ensureWidgetArticleTitleType)(e)?(0,o.jsx)(Et,{widget:e,inplace:i,mode:n,dataCy:r}):(0,E.ensureWidgetArticleTextType)(e)?(0,o.jsx)(bt,{widget:e,inplace:i,mode:n}):(0,E.ensureWidgetExcelDatasourceTableType)(e)?(0,o.jsxs)(wo,{children:[(0,o.jsx)(De,{uniqid:e.uniqid}),(0,o.jsx)(yo,{...e.content,uniqid:e.uniqid,mode:n})]}):(0,E.ensureWidgetDatasourceTableType)(e)?(0,o.jsxs)(wo,{children:[(0,o.jsx)(De,{uniqid:e.uniqid}),(0,o.jsx)(_o,{...e.content,uniqid:e.uniqid,mode:n})]}):(0,E.ensureWidgetCheckListType)(e,"widget-check-list"===e.name)?(0,o.jsxs)(wo,{children:["edit"===n?(0,o.jsx)(Me,{name:e.name,uniqid:e.uniqid}):(0,o.jsx)(De,{uniqid:e.uniqid}),(0,o.jsx)(wi,{widget:e,inplace:i,mode:n,onWidgetUpdate:a})]}):(0,E.ensureWidgetPresenceType)(e)?(0,o.jsxs)(wo,{children:["edit"===n?(0,o.jsx)(Me,{name:e.name,uniqid:e.uniqid}):(0,o.jsx)(De,{uniqid:e.uniqid}),(0,o.jsx)(to,{widget:e,inplace:i,mode:n})]}):(0,E.ensureWidgetQuickSurveyType)(e)?(0,o.jsxs)(wo,{children:["edit"===n?(0,o.jsx)(Me,{name:e.name,uniqid:e.uniqid}):(0,o.jsx)(De,{uniqid:e.uniqid}),(0,o.jsx)(so,{widget:e,inplace:i,mode:n})]}):(0,E.ensureWidgetCalendarCalDavType)(e)?(0,o.jsx)(wo,{children:(0,o.jsx)(Wo,{name:"OfficeHook",children:(0,o.jsx)(li,{widget:e,inplace:i,mode:n,levelFallback:s})})}):(0,E.ensureWidgetContactCardDavType)(e)?(0,o.jsx)(wo,{children:(0,o.jsx)(Wo,{name:"OfficeHook",children:(0,o.jsx)(Gi,{widget:e,inplace:i,mode:n,levelFallback:s})})}):(0,E.ensureWidgetEmailsImapType)(e)?(0,o.jsx)(wo,{children:(0,o.jsx)(Wo,{name:"OfficeHook",children:(0,o.jsx)(Hi,{widget:e,inplace:i,mode:n,levelFallback:s})})}):(0,E.ensureWidgetUserProfileType)(e)?(0,o.jsx)(wo,{children:(0,o.jsx)(co,{widget:e,inplace:i,mode:n})}):(0,E.ensureWidgetColorType)(e)?(0,o.jsx)(wo,{children:(0,o.jsx)(po,{widget:e,inplace:i,mode:n})}):(0,E.ensureWidgetWelcomeType)(e)?(0,o.jsx)(wo,{children:(0,o.jsx)(go,{widget:e,inplace:i,mode:n})}):(0,E.ensureWidgetExtensionType)(e)&&e.content.extensionName?(0,o.jsx)(wo,{children:(0,o.jsx)(ho,{uniqid:e.uniqid,name:e.name,extensionName:e.content.extensionName})}):l?(0,o.jsx)(o.Fragment,{children:l(d)}):(0,o.jsxs)(o.Fragment,{children:["cannot display widget (",d,")"]})},Mo=a.default.div`
436
+ position: absolute;
437
+ inset: 0;
438
+ opacity: ${e=>e.opacity};
439
+ background-color: ${e=>e.backgroundColor};
440
+ pointer-events: ${e=>e.pointerEvents};
441
+ `,To=c.j.getLazyComponent("DoubleClick"),qo=({uniqid:e,mode:t})=>{const i=(0,d.GV)(t=>t.widgets.ids[e].widget.layers,be.shallowEqual);return(0,o.jsx)(o.Fragment,{children:i?.map((e,t)=>(0,o.jsx)(Do,{uniqid:e,mode:"edit"},t))})},Do=({uniqid:e,mode:t})=>{const i=(0,d.GV)(t=>t.widgets.layers[e]);return"view"===t?(0,o.jsx)(Mo,{opacity:1,backgroundColor:"transparent",pointerEvents:"none",children:i.widgets.map((e,t)=>(0,o.jsx)(Go,{layerId:i.uniqid,uniqid:e.widget.uniqid,mode:"view"},t))}):(0,o.jsx)(Mo,{opacity:i.visible?1:0,backgroundColor:i.visible?"rgba(255,255,255,.1)":"transparent",pointerEvents:i.locked?"none":"all",children:i.widgets.map((e,t)=>(0,o.jsx)(Go,{layerId:i.uniqid,uniqid:e.widget.uniqid,mode:"edit"},t))})},Go=({uniqid:e,layerId:t,mode:i})=>{const n=(0,d.jL)(),a=(0,d.GV)(t=>t.widgets.ids[e],be.shallowEqual),l=(0,d.GV)(e=>e.widgets.layers[t]);return a&&l&&l.position?"view"===i?(0,o.jsx)("div",{style:{position:"absolute",top:l.position.y,left:l.position.x},children:(0,o.jsx)(Yo,{uniqid:e,widget:a,mode:i,inplace:!0,context:"article"})}):(0,o.jsx)(zo,{position:{x:l.position.x,y:l.position.y},onMouseUp:e=>{(l.position&&l.position.x!==e.x||l.position&&l.position.y!==e.y)&&(e=>{n(r.Widget.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)},children:(0,o.jsx)(To,{onDoubleTap:()=>((e,t)=>{n(r.WidgetEditor.slice.actions.registerEditor({uniqid:e,name:t}))})(a.widget.uniqid,a.widget.name),children:(0,o.jsx)(Yo,{uniqid:e,widget:a,mode:i,inplace:!0,context:"article"})})}):(0,o.jsx)(o.Fragment,{})},zo=({position:e,children:t,onMouseUp:i})=>{const[a,l]=(0,n.useState)(!1),[s,r]=(0,n.useState)({x:0,y:0}),[d,c]=(0,n.useState)({x:0,y:0}),[u,g]=(0,n.useState)({x:e.x,y:e.y}),m=(0,n.useRef)(null),p=(0,n.useCallback)(e=>{l(!0),m.current&&(r({x:e.nativeEvent.clientX,y:e.nativeEvent.clientY}),c({x:u.x,y:u.y}))},[u.x,u.y]),h=(0,n.useCallback)(e=>{if(a&&m.current){const t=d.x+(e.clientX-s.x),i=d.y+(e.clientY-s.y);g({x:t,y:i})}},[s.x,s.y,a,d.x,d.y]),f=(0,n.useCallback)(()=>{l(!1),i({x:u.x,y:u.y})},[u.x,u.y,i]);return(0,n.useEffect)(()=>(document.addEventListener("mousemove",h),document.addEventListener("mouseup",f),()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",f)}),[h,f]),(0,o.jsx)("div",{style:{position:"absolute",top:u.y,left:u.x},ref:m,onMouseDown:p,children:t})},Io=c.j.getLazyComponent("Loader"),Vo=({uniqid:e,inplace:t})=>{const i=(0,d.GV)(t=>r.Widget.selectors.selectWidgetState(t,e));return i?.loading?(0,o.jsx)("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"},children:(0,o.jsx)(Io,{})}):i?.hover?(0,o.jsx)("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}}):(0,o.jsx)(o.Fragment,{})},Oo=c.j.getLazyComponent("Html"),Ro=a.default.button`
442
+ position: absolute;
443
+ inset: 0;
444
+ display: flex;
445
+ flex-direction: row;
446
+ justify-content: center;
447
+ align-items: center;
448
+ gap: ${e=>e.theme.space.md}px;
449
+ color: ${e=>e.theme.color.primary};
450
+ cursor: pointer;
451
+ opacity: 0;
452
+ border: 1px solid ${e=>e.theme.color.primary};
453
+ &:hover {
454
+ background-color: ${e=>e.theme.color.grey2};
455
+ opacity: 0.9;
456
+ }
457
+
458
+ ${(0,s.DashedFocusBorder)()}
459
+ `,Bo=({uniqid:e,name:t})=>{const i=(0,d.jL)(),a=(0,l.A)(),s=(0,n.useCallback)(()=>{i(r.WidgetEditor.slice.actions.flushAllEditor()),i(r.WidgetEditor.slice.actions.registerEditor({uniqid:e,name:t}))},[i,e,t]),c=r.Widget.definition(t);return(0,o.jsx)(Ro,{onClick:s,children:(0,o.jsx)(Oo,{__html:`${a.formatMessage({id:"WIDGET_Set_Widget"})} <b>${a.formatMessage({id:c.label})}</b>`})})},Ho=a.default.div`
460
+ display: flex;
461
+ flex-direction: column;
462
+ `,$o=({uniqid:e,onClick:t,children:i})=>{const l=(0,a.useTheme)(),s=(0,d.GV)(t=>r.Widget.selectors.selectWidgetWrapperStyle(t,e),be.shallowEqual),c=(0,n.useMemo)(()=>({color:s&&s.color?String(s.color):l.color.black,backgroundColor:s&&s["background-color"]?String(s["background-color"]):l.color.white,borderRadius:s&&s["border-radius"]?`${s["border-radius"]}px`:"0px",borderColor:s["border-color"]?String(s["border-color"]):l.color.black,borderWidth:s["border-width"]?`${s["border-width"]}px`:"0px",borderStyle:s["border-style"]?String(s["border-style"]):"none"}),[s,l]);return(0,o.jsx)(Ho,{onClick:t,style:{color:c.color,borderColor:c.borderColor,borderStyle:c.borderStyle,borderRadius:c.borderRadius,borderWidth:c.borderWidth,backgroundColor:c.backgroundColor,overflow:Number(c.borderRadius)>0?"hidden":"initial"},children:i})},Fo=c.j.getLazyComponent("WidgetIcon"),No=a.default.a`
463
+ position: absolute;
464
+ top: 0;
465
+ right: 0;
466
+ bottom: 0;
467
+ left: 0;
468
+ display: flex;
469
+ justify-content: center;
470
+ align-items: center;
471
+ flex-direction: column;
472
+ color: ${e=>e.color?e.color:e.theme.color.black};
473
+ transition: background-color 0.4s;
474
+ &:hover {
475
+ background-color: rgba(0, 0, 0, 0.1);
476
+ color: ${e=>e.color?e.color:e.theme.color.black};
477
+ }
478
+ `,Uo=({uniqid:e,name:t,url:i,level:n})=>{const a=r.Widget.definition(t),l=(0,d.GV)(t=>2===n?r.Widget.selectors.selectWidgetChipCount(t,e):0,be.shallowEqual),s=(0,d.GV)(t=>r.Widget.selectors.selectWidgetWrapperStyle(t,e),be.shallowEqual);return(0,o.jsx)(No,{href:i,target:"_blank",color:String(s.color)??void 0,rel:"noreferrer","aria-label":a.label,children:(0,o.jsx)(Fo,{count:l,img:a.img,label:a.label,maxValue:999})})},Po=({uniqid:e,widgetObject:t,widget:i,inplace:a=!0,mode:l,width:s,context:c,onWidgetUpdate:u,cannotDisplayComponent:g,dataCy:m})=>{const p=(0,d.jL)(),h=(0,d.GV)(t=>r.Widget.selectors.selectWidget(t,e)),f=(0,d.GV)(t=>t.widgets.editableMap[e],be.shallowEqual),x=(0,d.GV)(e=>e.widgets.currentEditableWidgetId,be.shallowEqual),j=(0,d.GV)(t=>t.widgets.currentEditableWidgetId===e,be.shallowEqual),{isComponentVisible:b,setIsComponentVisible:C}=(0,Ce.xv)(!1);(0,n.useEffect)(()=>{t&&p(r.Widget.slice.actions.registerWidgetObject({uniqid:e,object:t}))},[]),(0,n.useEffect)(()=>{i&&p(r.Widget.slice.actions.registerWidget({uniqid:e,widget:i,context:c}))},[]),(0,n.useEffect)(()=>{b||e===x&&p(r.Widget.slice.actions.setEditableWidgetId({uniqid:void 0}))},[b]),(0,n.useEffect)(()=>{b!==j&&C(j)},[j]);const y=(0,n.useCallback)(()=>{if(void 0===h||"view"===l)return;p(r.WidgetEditor.slice.actions.flushAllEditor());const{widget:e}=h;p(r.WidgetEditor.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))},[p,l,h]);return void 0===h?(0,o.jsx)(o.Fragment,{children:"This widget cannot be displayed"}):a&&"view"!==l?(0,o.jsxs)($o,{uniqid:e,onClick:()=>{C(!0),f&&(p(r.Widget.slice.actions.setEditableIndex({index:f.index})),p(r.Widget.slice.actions.setEditableWidgetId({uniqid:e})))},children:[(0,o.jsx)(So,{dataCy:m,width:s,widget:{...h.widget,...h.title&&{title:h.title}},inplace:a,mode:l,levelFallback:(e,t)=>e<=2&&(0,o.jsx)(Uo,{uniqid:i.widget.uniqid,name:i.widget.name,level:e,url:t})}),(0,o.jsx)(qo,{uniqid:e,mode:l}),(0,o.jsx)(Vo,{name:h.widget.name,uniqid:h.widget.uniqid,inplace:a})]}):(0,o.jsxs)($o,{uniqid:e,onClick:y,children:[(0,o.jsx)(So,{dataCy:m,widget:{...h.widget,...h.title&&{title:h.title}},inplace:a,mode:l,width:s,onWidgetUpdate:u,cannotDisplayComponent:g,levelFallback:(e,t)=>e<=2&&(0,o.jsx)(Uo,{uniqid:i.widget.uniqid,name:i.widget.name,level:e,url:t})}),(0,o.jsx)(qo,{uniqid:e,mode:l}),"edit"===l&&(0,o.jsx)(Bo,{uniqid:e,name:i.widget.name}),(0,o.jsx)(Vo,{name:h.widget.name,uniqid:h.widget.uniqid,inplace:a})]})},Yo=Po,Qo=a.default.div`
479
+ border-radius: ${e=>e.theme.space.sm}px;
480
+ border: 1px solid ${e=>e.theme.color.grey1};
481
+ background-color: ${e=>e.theme.color.white};
482
+ overflow: hidden;
483
+ `,Jo=c.j.getLazyComponent("Message"),Xo=({widgets:e})=>{const t=(0,l.A)(),i=(0,d.GV)(r.Widget.selectors.selectFlushedWidgets,be.shallowEqual);return(0,o.jsx)(o.Fragment,{children:e.filter(e=>!i.includes(e.widget.uniqid)).map(e=>e&&e.widget&&(0,o.jsx)(Qo,{children:(0,o.jsx)(Yo,{uniqid:e.widget.uniqid,widget:e,inplace:!0,mode:"edit",cannotDisplayComponent:e=>(0,o.jsx)(Jo,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})}),context:"comment"})},e.widget.uniqid))})},Ko=c.j.getLazyComponent("Message"),Zo=e=>{const t=(0,l.A)(),{widgets:i,comment:n,inplace:a,mode:s,handleWidgetUpdate:c}=e,u=(0,d.GV)(r.Widget.selectors.selectFlushedWidgets,be.shallowEqual);return(0,o.jsx)(o.Fragment,{children:i.filter(e=>!u.includes(e.widget.uniqid)).map(e=>e&&(0,o.jsx)(Qo,{children:(0,o.jsx)(Yo,{uniqid:e.widget.uniqid,widgetObject:n,widget:e,inplace:a,mode:s,onWidgetUpdate:c,cannotDisplayComponent:e=>(0,o.jsx)(Ko,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})}),context:"comment"})},e.widget.uniqid))})},en=()=>{const[e,t]=(0,n.useState)(!1),[i,o]=(0,n.useState)();return{open:e,onSelect:e=>{i?.execCommand("InsertHTML",!1,`<img src="${e}" alt="" />`),t(!1)},close:()=>t(!1),ext:(0,n.useMemo)(()=>s.JTinyMCEExtensionsBuilders.gifs(e=>o(e),()=>t(!0)),[]),isActive:!0}},tn=c.j.getLazyComponent("GifsSelector"),on=c.j.getLazyComponent("Modal"),nn=({onSelect:e,open:t,close:i})=>{const a=(0,d.jL)(),l=(0,B.Ie)(),[s,c]=(0,n.useState)(!1),[u,g]=(0,n.useState)([]),[m,p]=(0,n.useState)({q:void 0,offset:0}),h=(0,n.useCallback)(()=>{i(),p({q:void 0,offset:0})},[i]);return(0,n.useEffect)(()=>{t&&(c(!0),E.default.jamespot.getGifs({q:m.q||"awesome",limit:10,offset:m.offset},{signal:l.signal}).then(e=>{g(0===m.offset?e.result:t=>[...t,...e.result])}).catch(e=>{e.aborted||a(r.Toast.actions.error({label:e.errorMsg??"GLOBAL_Error"}))}).finally(()=>{c(!1)}))},[l,a,t,m]),(0,o.jsx)(on,{title:"Gif",open:t,closeHandler:h,enableClickAwayCloseModal:!0,variant:"fixed-height",buttons:[{children:(0,o.jsx)(T.A,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:h}],children:(0,o.jsx)(tn,{gifs:u,onSelectGif:e,loading:s,onSearch:e=>p({q:e,offset:0}),onReachEnd:()=>{p(e=>({...e,offset:e.offset+10}))}})})},an=c.j.getLazyComponent("JRCCommentsBloc"),ln=a.default.div`
484
+ display: flex;
485
+ flex-direction: column;
486
+ gap: 4px;
487
+ flex: 1;
488
+ width: 100%;
489
+ margin-top: 10px;
490
+ `,sn=({articleId:e,variant:t="inline",canComment:i,commentType:s="comment",socialQuestion:c,articleUri:u})=>{const g=(0,l.A)(),m=(0,a.useTheme)(),p=(0,d.jL)(),[h,f]=(0,n.useState)(),[x,j]=(0,n.useState)(!1),[b,C]=(0,n.useState)([]),[y,v]=(0,n.useState)(!1),L=(0,d.GV)(r.UserCurrent.selectors.get),A=(0,d.GV)(r.Widget.selectors.selectWidgets),_=(0,d.GV)(r.TinyMCE.selectors.selectTinyMCECommonOptions),k=(0,d.GV)(r.TinyMCE.selectors.selectTinyMCEExtendedOptions),W=(0,d.GV)(r.Model.selectors.selectAll),w=(0,d.GV)(r.Platform.selectors.selectPlatformConfig),S=(0,d.GV)(t=>r.Comment.selectors.commentList(t,e)),M=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"DriveHook")),T=(0,d.GV)(e=>r.Application.selectors.selectById(e,"FileBankHook")),q=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"WidgetHook")),[D,G]=(0,n.useState)(c),[z,I]=(0,n.useState)(null),{open:V,onInsert:O,close:R,ext:B,isActive:H}=xe(),{open:$,close:F,onSelect:N,ext:U,isActive:P}=en();(0,ee.A)(e),((e,t)=>{const i=(0,d.jL)(),o=(0,n.useMemo)(()=>te.A,[]),a=(0,n.useMemo)(()=>r.Comment.getCommentsLikeRTHandlers(i,e,t),[i,e,t]);(0,n.useEffect)(()=>(a.forEach(e=>{o.onMessage(e.namespace,e.function,e.handler)}),()=>{a.forEach(e=>{o.offMessage(e.namespace,e.function,e.handler)})}),[a,o])})(S.map(e=>e.id),e);const Y=(0,n.useCallback)(e=>{p(r.Toast.actions.error({label:e??g.formatMessage({id:"GLOBAL_Error"})}))},[p,g]),Q=()=>{p(r.Comment.actions.fetchComments({idArticle:e})),J()},J=(0,n.useCallback)(()=>{h||y||(v(!0),E.default.network.token().then(e=>{f(e.result),v(!1),p(r.Widget.slice.actions.setToken({token:e.result}))}).catch(e=>{Y(e.errorMsg)}))},[Y,h,y,p]),X=(0,n.useCallback)(async t=>{if(h){j(!0);const i=Object.keys(A).map(e=>b?.some(t=>t.widget.uniqid===e)?A[e]:null).filter(e=>null!==e);try{await E.default.article.addComment({...t,widgets:i,token:h,idArticle:e,type:s}).then(()=>{C([])}),J()}catch(e){throw Y(e.errorMsg),e}finally{j(!1)}}},[e,s,J,Y,h,A,b]);return(0,n.useEffect)(()=>{J()},[J]),(0,n.useEffect)(()=>{p(r.Comment.actions.fetchComments({idArticle:e}))},[e,p]),(0,n.useEffect)(()=>{S&&S.forEach(e=>{e._widgets?.forEach(t=>{p(r.Widget.slice.actions.registerWidgetObject({uniqid:t.widget.uniqid,object:e})),p(r.Widget.slice.actions.registerWidgetObjectRights({uniqid:t.widget.uniqid,rights:e._right}))})})},[S,p]),(0,o.jsxs)(o.Fragment,{children:[_&&k&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(ln,{children:(0,o.jsx)(an,{canComment:i,loading:x,token:h,comments:S,onComment:X,onCommentUpdate:async t=>{const i=S.find(e=>e.id===t.idComment);if(i)return E.default.article.updateComment({idComment:t.idComment,description:t.description??i.description??void 0,token:t.token,widgets:t.widgets}).then(()=>{p(r.Comment.actions.fetchComments({idArticle:e})),J()}).catch(e=>{Y(e.errorMsg)})},onCommentDelete:async t=>{p(r.Comment.actions.deleteComment({idComment:t,idArticle:e}))},isWidgetActive:!(!q?.isActive||!q?.autorize?.includes("comment")),canCreateWidget:!!(q?.isActive&&q?.create&&q?.autorize?.includes("comment")),widgetListComponent:(0,o.jsx)(pe,{mode:"comment",namespace:"comment",onChange:e=>{C([e]),p(r.Widget.slice.actions.registerWidget({uniqid:e.widget.uniqid,widget:e,context:"comment"})),f(void 0),J()},view:"edit"}),newWidgetsWrapperComponent:(0,o.jsx)(Xo,{widgets:b}),existingWidgetsWrapperComponent:(e,t,i,n=!0)=>(0,o.jsx)(Zo,{comment:e,widgets:t,mode:i,inplace:n,handleWidgetUpdate:Q,handleWidgetRemove:J}),currentUser:L,tinyMCEConfig:{commonOptions:{..._,toolbar:k.commentsToolbar},mentionsQueries:(0,je.X)(W,m,Y)},onError:Y,highlightFields:w.userHighlightFields,userAccountStatus:w.userAccountStatus,userModel:W.find(e=>"user"===e.type),onGetHashError:e=>p(r.Toast.actions.error({label:e??g.formatMessage({id:"GLOBAL_Error"})})),activeDrives:[...T&&M?["fileBank"]:[],...r.Hook.utils.buildDrivesArrayFromObject(M?.drives)],variant:t,handlers:{drive:E.default.drive,filebank:E.default.filebank,file:E.default.file,fileIntegrity:E.default.fileIntegrity,user:E.default.user,global:E.default.global,questionAnswer:E.default.questionAnswer},socialQuestion:D?{...D,onSelectResponse:e=>{G({...D,responseId:e,isResolved:!0})},onUnselectResponse:()=>{G({...D,responseId:void 0,isResolved:!1})}}:void 0,articleId:e,additionalExtensions:[B,U],onReport:t=>I({articleId:e,commentUri:t,articleUri:u})})})}),H&&(0,o.jsx)(ft,{onInsert:O,open:V,close:R}),z&&(0,o.jsx)(K,{onClose:()=>I(null),...z}),P&&(0,o.jsx)(nn,{open:$,close:F,onSelect:N})]})},rn=a.default.li`
491
+ list-style: none;
492
+ `,dn=a.default.a`
493
+ display: flex;
494
+ align-items: center;
495
+ gap: ${({theme:e})=>e.space.sm}px;
496
+ text-decoration: none;
497
+ color: ${({theme:e})=>e.font.color};
498
+ padding: ${({theme:e})=>e.space.sm}px ${({theme:e})=>e.space.md}px ${({theme:e})=>e.space.sm}px
499
+ ${({theme:e})=>e.space.xs}px;
500
+ border-radius: ${({theme:e})=>e.size.sm}px;
501
+
502
+ &:hover {
503
+ text-decoration: none;
504
+ background-color: ${({theme:e})=>e.color.grey1};
505
+ color: ${({theme:e})=>e.font.color};
506
+ }
507
+ `,cn=c.j.getLazyComponent("Icon"),un=c.j.getLazyComponent("FlexBox"),gn=c.j.getLazyComponent("Typography"),mn=c.j.getLazyComponent("DropDown"),pn=()=>{const e=(0,a.useTheme)(),t=(0,l.A)(),i=(0,d.GV)(e=>r.Application.selectors.selectById(e,"AnimatedMeetingHook")),n=(0,d.GV)(e=>r.Application.selectors.selectById(e,"calendar")),s=(0,d.GV)(e=>r.Application.selectors.selectById(e,"SurveyDateHook"));return n?(0,o.jsxs)(un,{y:"center",children:[(0,o.jsx)(cn,{name:"icon-"+n.icon,variant:"circle",color:n.color,size:40}),(0,o.jsx)(gn,{variant:"h1",size:"xl",weight:"medium",children:n.label}),(s||i)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(gn,{size:"xl",color:"grey4",children:"/"}),(0,o.jsx)(mn,{withBorder:!0,borderColor:"grey3",trigger:(0,o.jsxs)(un,{y:"center",gap:e.space.xs,children:[(0,o.jsx)(gn,{size:"xl",color:"grey4",children:t.formatMessage({id:"CALENDAR_Agenda"})}),(0,o.jsx)(cn,{name:"icon-chevron-down",color:"grey4",size:16})]}),dropdown:()=>(0,o.jsxs)(un,{direction:"column",gap:e.space.sm,as:"ul",children:[s&&(0,o.jsx)(rn,{children:(0,o.jsxs)(dn,{href:s.url,children:[(0,o.jsx)(cn,{name:"icon-"+s.icon,size:25,variant:"circle",color:s.color}),(0,o.jsx)(gn,{size:"l",children:s.label})]})}),i&&(0,o.jsx)(rn,{children:(0,o.jsxs)(dn,{href:i.url,children:[(0,o.jsx)(cn,{name:"icon-"+i.icon,size:25,variant:"circle",color:i.color}),(0,o.jsx)(gn,{size:"l",children:i.label})]})})]})})]})]}):null},hn=c.j.getLazyComponent("Typography"),fn=c.j.getLazyComponent("FlexBox"),xn=c.j.getLazyComponent("ButtonDropdown"),jn=c.j.getLazyComponent("DropDown"),bn=c.j.getLazyComponent("IconButton"),Cn=c.j.getLazyComponent("InputSelectRaw"),yn=c.j.getLazyComponent("InputCheckboxRaw"),vn=c.j.getLazyComponent("StyledHref"),Ln=(0,a.default)(hn)`
508
+ text-transform: capitalize;
509
+ margin-right: ${({theme:e})=>e.space.md}px;
510
+ `,En=a.default.div`
511
+ max-width: 200px;
512
+ display: flex;
513
+ align-items: center;
514
+ `,An=a.default.div`
515
+ padding: 0 ${({theme:e})=>e.space.md}px;
516
+ `,_n=({label:e,view:t,viewsOptions:i,calendarApi:a,isLoading:s,navigateWithQuery:c,setView:u,setCreationType:g,setExportModalOpen:m})=>{const p=(0,l.A)(),h=(0,d.jL)(),{types:f}=(0,d.GV)(r.Calendar.selectors.selectCalendarEvents),x=(0,d.GV)(e=>r.Application.selectors.selectById(e,"AnimatedMeetingHook")),j=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"AnimatedMeetingHook")),b=(0,d.GV)(e=>r.Application.selectors.selectById(e,"MeetingHook")),C=(0,d.GV)(e=>r.Application.selectors.selectById(e,"BoardcardHook")),y=(0,n.useMemo)(()=>[{label:p.formatMessage({id:"CALENDAR_Create_SocialEvent"}),onClick:()=>{g("socialEvent")}},...b?[{label:p.formatMessage({id:"CALENDAR_Create_Meeting"}),onClick:()=>{g("meeting")}}]:[],...x&&j?.create?[{label:p.formatMessage({id:"CALENDAR_Create_AnimatedMeeting"}),href:"/?action=spotlight-edit&type=animatedMeeting"}]:[]],[x,j?.create,p,b,g]),v=(0,n.useMemo)(()=>[{label:(0,o.jsx)(T.A,{id:"CALENDAR_SocialEvents"}),value:"socialEvent"},...b?[{label:(0,o.jsx)(T.A,{id:"CALENDAR_Meetings"}),value:"meeting"}]:[],...x?[{label:(0,o.jsx)(T.A,{id:"CALENDAR_AnimatedMeetings"}),value:"animatedMeeting"}]:[],...C?[{label:(0,o.jsx)(T.A,{id:"CALENDAR_BoardCards"}),value:"boardCard"}]:[]],[x,C,b]);return(0,o.jsxs)(fn,{y:"center",children:[(0,o.jsx)(Ln,{size:"l",weight:"medium",children:e}),(0,o.jsxs)(fn,{children:[(0,o.jsx)(bn,{icon:"icon-chevron-left",onClick:()=>a?.prev(),color:"grey5"}),(0,o.jsx)(bn,{icon:"icon-chevron-right",onClick:()=>a?.next(),color:"grey5"})]}),(0,o.jsx)(bn,{icon:"icon-calendar",onClick:()=>a?.today(),tooltip:{description:"CALENDAR_Today",position:"bottom"},color:"grey5"}),(0,o.jsx)(En,{children:(0,o.jsx)(Cn,{onChange:u,value:t,name:"selectView",options:i,getLabel:e=>e.label,getValue:e=>e.value,required:!0,minWidth:!1,loading:s,noMargin:!0})}),(0,o.jsx)(xn,{noMargin:!0,color:"primary",icon:"icon-plus",label:p.formatMessage({id:"GLOBAL_Add"}),options:y,dataCy:"calendar-create-dropdown"}),(0,o.jsx)(jn,{trigger:(0,o.jsx)(bn,{"aria-label":p.formatMessage({id:"GLOBAL_Filter"}),colorVariant:"light",icon:"icon-filter",badgeNumber:f.length}),dropdown:()=>(0,o.jsx)(n.Suspense,{fallback:(0,o.jsx)(o.Fragment,{}),children:(0,o.jsx)(An,{children:(0,o.jsxs)(fn,{direction:"column",children:[(0,o.jsx)(hn,{weight:"medium",color:"primary",children:p.formatMessage({id:"GLOBAL_Filter"})}),(0,o.jsx)(yn,{labelPosition:"before",checkboxMode:"checkbox",direction:"column",onChange:e=>{h(r.Calendar.actions.setTypes(e)),c({types:e})},options:v,value:f,name:"0"}),(0,o.jsx)(vn,{onClick:()=>{h(r.Calendar.actions.setTypes([])),c({types:[]})},as:"button",color:"cancel",disabled:0===f.length,children:p.formatMessage({id:"GLOBAL_Reset"})})]})})}),withBorder:!0,align:"right"}),(0,o.jsx)(xn,{noMargin:!0,small:!0,smallOpenDirection:"left",color:"primary",variant:"outlined",icon:"icon-ellipsis-v",label:p.formatMessage({id:"GLOBAL_Options"}),options:[{label:p.formatMessage({id:"EVENT_Export_Calendar_ICalendar_Format"}),onClick:()=>m(!0)}]})]})};var kn=i(3520),Wn=i(5903);const wn=[{label:"CALENDAR_EventRecurrence_None",value:{}},{label:"CALENDAR_EventRecurrence_Daily",value:{freq:"DAILY"}},{label:"CALENDAR_EventRecurrence_OpenDays",value:{freq:"WEEKLY",byDay:["MO","TU","WE","TH","FR"]}},{label:"CALENDAR_EventRecurrence_Weekly",value:{freq:"WEEKLY"}},{label:"CALENDAR_EventRecurrence_Monthly",value:{freq:"MONTHLY"}},{label:"CALENDAR_EventRecurrence_Yearly",value:{freq:"YEARLY"}}],Sn=(e,t)=>null===e&&null===t||e?.freq===t?.freq&&!e?.byDay?.some(e=>!t?.byDay?.includes(e))&&!t?.byDay?.some(t=>!e?.byDay?.includes(t)),Mn=e=>e&&Object.entries(e).length>0;var Tn=i(9622);const qn=()=>{const[e,t]=(0,n.useState)(),i=(0,l.A)(),o=(0,n.useMemo)(()=>J.hooks?.MagicWandHook?.isActive&&J.hooks?.MagicWandHook?.menuItems&&J.hooks.MagicWandHook.menuItems.length,[]),a=(0,n.useCallback)(e=>{t({...e,reject:i=>{e.reject(i),t(void 0)},resolve:i=>{e.resolve(i),t(void 0)}})},[]),r=(0,n.useCallback)((e,t)=>new Promise((i,o)=>{a({reject:o,resolve:i,text:e,capability:t})}),[a]),d=(0,n.useMemo)(()=>({develop:e=>r(e,"develop"),summarize:e=>r(e,"summarize"),tldr:e=>r(e,"tldr"),en:e=>r(e,"en"),es:e=>r(e,"es"),formal:e=>r(e,"formal"),funny:e=>r(e,"funny")}),[r]);return{query:e,ext:(0,n.useMemo)(()=>s.JTinyMCEExtensionsBuilders.jia(d,i),[i,d]),isActive:o}},Dn=c.j.getLazyComponent("InputTinyMCE"),Gn=e=>{const t=(0,l.A)(),i=(0,d.jL)(),s=(0,a.useTheme)(),c=(0,d.GV)(r.Model.selectors.selectAll),{query:u,ext:g,isActive:m}=qn(),{open:p,onInsert:h,close:f,ext:x,isActive:j}=xe(),{close:b,open:C,isActive:y,onSelect:v,ext:L}=en(),E=(0,n.useMemo)(()=>[...j?[x]:[],...m?[g]:[],...y?[L]:[]],[g,x,L,m,y,j]),A=(0,n.useCallback)(e=>{i(r.Toast.actions.error({label:e??t.formatMessage({id:"GLOBAL_Error"})}))},[i,t]),_=(0,n.useMemo)(()=>(0,je.X)(c,s,A),[c,A,s]),k=(0,n.useMemo)(()=>Tn.p9,[]);return(0,o.jsxs)(o.Fragment,{children:[k&&(0,o.jsx)(Dn,{commonOptions:k,additionalExtensions:E,mentionsQueries:_,...e}),m&&(0,o.jsx)(M,{query:u}),j&&(0,o.jsx)(ft,{onInsert:h,open:p,close:f}),y&&(0,o.jsx)(nn,{onSelect:v,open:C,close:b})]})},zn=c.j.getLazyComponent("InputImage"),In=c.j.getLazyComponent("InputText"),Vn=c.j.getLazyComponent("InputCheckbox"),On=c.j.getLazyComponent("InputCheckboxRaw"),Rn=c.j.getLazyComponent("InputNumber"),Bn=c.j.getLazyComponent("InputAudience"),Hn=c.j.getLazyComponent("InputFileAdvancedRaw"),$n=c.j.getLazyComponent("Typography"),Fn=c.j.getLazyComponent("InputColor"),Nn=c.j.getLazyComponent("InputDateTime"),Un=c.j.getLazyComponent("InputDateTimeRaw"),Pn=c.j.getLazyComponent("FlexBox"),Yn=c.j.getLazyComponent("InputAutocomplete"),Qn=c.j.getLazyComponent("InputSelectRaw"),Jn=c.j.getLazyComponent("InputSelect"),Xn=c.j.getLazyComponent("Message"),Kn=a.default.div`
517
+ margin-top: -${({theme:e})=>e.space.sm}px;
518
+ margin-bottom: -${({theme:e})=>e.space.l}px;
519
+ `,Zn=a.default.div`
520
+ ${({$show:e})=>!e&&"\n position: absolute;\n visibility: hidden;\n pointer-events: none;\n height: 0;\n overflow: hidden;\n opacity: 0;\n "}
521
+ `,ea=({form:e,setUploadLoading:t,extraInitialValues:i,mode:s})=>{const c=(0,l.A)(),u=(0,d.jL)(),g=(0,a.useTheme)(),m=(0,n.useRef)(null),[p,h]=(0,n.useState)(!1),[f,x]=(0,n.useState)(i?.eventMode??"onSpot"),[j,b]=(0,n.useState)(i?.customColors??!1),[C,y]=(0,n.useState)(),[v,L]=(0,n.useState)(),A=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"calendarHook")),_=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"FileBankHook")),k=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"SpotHook")),W=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"BusinessContactHook")),w=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"DriveHook")),S=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"VisioConnectHook")),M=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"BigBlueButtonHook")),T=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"SharedContentHook")),D=(0,d.GV)(r.Model.selectors.selectAll),[G,z]=(0,n.useState)(i?.until);m.current?.watch(t=>{Object.keys(t).forEach(i=>{e.setValue(i,t[i])})});const I=(0,q.useWatch)({control:e.control,name:"sendAlert"});(0,n.useEffect)(()=>{I||e.setValue("alertAuthor",!1)},[e,I]);const V=(0,q.useWatch)({control:e.control,name:"dateStart"}),O=(0,q.useWatch)({control:e.control,name:"dateEnd"}),B=(0,n.useMemo)(()=>V&&O&&(0,kn.d)(new Date(V),new Date(O)),[V,O]),H=(0,n.useMemo)(()=>[{label:c.formatMessage({id:"CALENDAR_On_Spot"}),value:"onSpot"},{label:c.formatMessage({id:"CALENDAR_Visio"}),value:"visio"},{label:c.formatMessage({id:"CALENDAR_Hybrid"}),value:"hybrid"}],[c]),$=(0,n.useMemo)(()=>{const e=[];return k&&k.isActive&&k.hasLicense&&e.push("group"),e.push("user"),_&&_.isActive&&e.push("folder"),W&&W.isActive&&e.push("businessContact"),e},[W,_,k]),F=(0,n.useCallback)(e=>u(r.Toast.actions.error({label:e??c.formatMessage({id:"GLOBAL_Error"})})),[u,c]),N=(0,q.useWatch)({control:e.control,name:"token"}),U=(0,n.useCallback)(async e=>{if(N)try{await E.default.file.deleteFile(e,"attachment",N)}catch(e){F&&F(e)}},[F,N]),P=(0,n.useMemo)(()=>[{value:"jitsi",label:c.formatMessage({id:"CALENDAR_Visio_Jitsi"})},...S&&S.isActive&&S.hasLicense?[{value:"visioConnect",label:c.formatMessage({id:"CALENDAR_Visio_VisioConnect"})}]:[],...M&&M.isActive&&M.hasLicense?[{value:"bbb",label:c.formatMessage({id:"CALENDAR_Visio_BBB"})},...T&&T.isActive?[{value:"bbb-public",label:c.formatMessage({id:"CALENDAR_Visio_BBB_Public"})}]:[]]:[],{value:"other",label:c.formatMessage({id:"CALENDAR_Visio_Other"})}],[M,c,T,S]),[Y,Q]=(0,n.useState)(P[P.length-1]),X=(0,n.useCallback)(t=>{switch(Q(t),t.value){case"jitsi":e.setValue("place","jitsi:"+J.urlBase+"?action=jitsiRedirect&id="+(0,Wn.A)());break;case"visioConnect":e.setValue("place","visioConnect");break;case"other":e.setValue("place","");break;case"bbb":e.setValue("place","bbb");break;case"bbb-public":e.setValue("place","bbb-public")}},[e]),K=(0,q.useWatch)({control:e.control,name:"place"}),Z=(0,q.useWatch)({control:e.control,name:"address"}),ee=(0,n.useCallback)(t=>x(i=>(h(!0),"visio"!==i&&"hybrid"!==i||y(K),"onSpot"!==i&&"hybrid"!==i||L(Z),"onSpot"===t?(e.setValue("place",null),"hybrid"!==i&&e.setValue("address",v)):"visio"===t?(e.setValue("address",null),"hybrid"!==i&&e.setValue("place",C)):"hybrid"===t&&("onSpot"!==i&&e.setValue("address",v),"visio"!==i&&e.setValue("place",C)),t)),[Z,e,K,v,C]),te=(0,q.useWatch)({control:e.control,name:"recurrenceRule"});(0,n.useEffect)(()=>{te&&Mn(te)&&te.until!==G&&e.setValue("recurrenceRule",{...te,until:G||void 0})},[e,te,G]);const ie=(0,n.useMemo)(()=>Mn(te),[te]),oe=(0,q.useWatch)({control:e.control,name:"allDay"}),ne=(0,q.useWatch)({control:e.control,name:"textColor"}),ae=(0,q.useWatch)({control:e.control,name:"bgColor"}),le=(0,q.useWatch)({control:e.control,name:"socialEventUseCeiling"});return(0,o.jsxs)(Pn,{direction:"column",gap:g.space.l,children:[(0,o.jsx)(Zn,{$show:"update"===s&&!!ie,children:(0,o.jsx)(Xn,{variant:"warning",message:c.formatMessage({id:"CALENDAR_Recurrent_Event_Warning"})})}),(0,o.jsx)(zn,{margin:"0",name:"image",dzDimensions:{width:"100%",height:275},control:e.control,token:N,aspectRatio:2,allowCustomRatio:!0,defaultImages:{imgs:[],columnCount:1}}),(0,o.jsx)(In,{margin:"0",label:c.formatMessage({id:"GLOBAL_Title"}),name:"title",control:e.control,rules:{required:!0}}),(0,o.jsxs)(Pn,{direction:"column",gap:g.space.sm,children:[B&&(0,o.jsx)(Xn,{message:c.formatMessage({id:"CALENDAR_Date_Start_After_Date_End"}),variant:"error"}),(0,o.jsxs)(Pn,{gap:g.space.md,y:"center",children:[(0,o.jsx)(Nn,{mode:oe?"date":"datetime",margin:"0",width:"100%",label:"CALENDAR_DateTime_Start",control:e.control,name:"dateStart",rules:{required:!0},openDirection:"left"}),(0,o.jsx)(Nn,{mode:oe?"date":"datetime",margin:"0",width:"100%",label:"CALENDAR_DateTime_End",control:e.control,name:"dateEnd",rules:{required:!0}})]}),(0,o.jsx)(Vn,{control:e.control,margin:"0",name:"allDay",checkboxMode:"checkbox",valueTypeIsBoolean:!0,options:[{label:c.formatMessage({id:"CALENDAR_All_Day"}),value:"YES"}]})]}),"create"===s&&A?.recurringEventsEnabled&&(0,o.jsx)(Jn,{noMargin:!0,label:c.formatMessage({id:"CALENDAR_Event_Recurrence"}),name:"recurrenceRule",control:e.control,options:wn,rules:{required:!0},isCurrentOption:Sn}),(0,o.jsx)(Zn,{$show:!!ie,children:(0,o.jsxs)(Pn,{direction:"column",children:[(0,o.jsx)($n,{children:c.formatMessage({id:"CALENDAR_Event_Recurrence_UntilField"})}),(0,o.jsx)(Un,{mode:"date",width:"100%",value:G,onChange:e=>z(e||void 0)})]})}),(0,o.jsxs)(Pn,{direction:"column",gap:g.space.md,children:["update"===s&&p&&!te&&(0,o.jsx)(Xn,{variant:"info",message:c.formatMessage({id:"Event_Warning_Message"})}),(0,o.jsx)(Zn,{$show:!ie,children:(0,o.jsx)(On,{margin:"0",checkboxMode:"radio",direction:"row",value:f,name:"value",onChange:ee,options:H})}),(0,o.jsx)(Zn,{$show:"onSpot"===f||"hybrid"===f||!!ie,children:(0,o.jsx)(In,{margin:"0",label:c.formatMessage({id:"CALENDAR_Event_Address"}),name:"address",control:e.control})}),(0,o.jsx)(Zn,{$show:("visio"===f||"hybrid"===f)&&!ie,children:(0,o.jsxs)(Pn,{direction:"column",children:[(0,o.jsx)($n,{children:c.formatMessage({id:"CALENDAR_Event_Place"})}),(0,o.jsxs)(Pn,{gap:g.space.md,y:"flex-end",children:[(0,o.jsx)(Pn,{flex:"1",margin:"0 0 4px 0",children:(0,o.jsx)(Qn,{noMargin:!0,name:"visio",onChange:X,options:P,value:Y,required:!0,getLabel:e=>e.label,getValue:e=>e.value})}),("other"===Y.value||"jitsi"===Y.value)&&(0,o.jsx)(Pn,{flex:"2",children:(0,o.jsx)(In,{width:"100%",margin:"0",name:"place",control:e.control,disabled:"jitsi"===Y.value})})]})]})}),(0,o.jsx)(Zn,{$show:!!A?.externalGestion&&!ie,children:(0,o.jsx)(In,{margin:"0",label:c.formatMessage({id:"CALENDAR_External_Link"}),description:c.formatMessage({id:"CALENDAR_External_Link_Description"}),name:"urlGestion",control:e.control})}),(0,o.jsx)(Gn,{margin:"0",label:c.formatMessage({id:"GLOBAL_Description"}),control:e.control,name:"description",handlers:{file:E.default.file}}),(0,o.jsx)(Kn,{children:(0,o.jsx)(R,{type:"socialEvent",fields:[{includes:"tags"}],ref:m,defaultValues:i?.tags})}),(0,o.jsx)(Zn,{$show:!ie,children:(0,o.jsx)(Yn,{noMargin:!0,control:e.control,name:"uiObjectLink",label:c.formatMessage({id:"GLOBAL_Object_Link"}),searchable:!0,asyncPromise:e=>E.default.article.list({query:e,filters:[{name:"type",value:"internalDraft",operator:"<>"}]}).then(e=>e?.result?.data.map(e=>{const t=D.find(t=>t.type===e.type);return{uri:e.uri,title:e.title,icon:t?.icon,color:t?.color}}))})}),(0,o.jsxs)(Pn,{direction:"column",gap:g.space.md,children:[(0,o.jsx)(On,{margin:"0",onChange:t=>{t?(e.setValue("textColor",g.color.grey5),e.setValue("bgColor",g.color.grey1)):(e.setValue("textColor",null),e.setValue("bgColor",null)),b(t)},value:j,name:"",checkboxMode:"checkbox",valueTypeIsBoolean:!0,options:[{label:c.formatMessage({id:"CALENDAR_Custom_Colors"}),value:"YES"}]}),(0,o.jsxs)(Zn,{$show:j,children:[(0,o.jsx)(Zn,{$show:!ie,children:(0,o.jsx)(Fn,{margin:"0",control:e.control,name:"textColor",label:"CALENDAR_Text_Color",initialValue:ne??g.color.grey5})}),(0,o.jsx)(Fn,{margin:"0",control:e.control,name:"bgColor",label:"CALENDAR_Background_Color",initialValue:ae??g.color.grey1})]})]}),(0,o.jsx)(Zn,{$show:!ie,children:(0,o.jsxs)(Pn,{direction:"column",gap:g.space.sm,children:[(0,o.jsx)(Vn,{margin:"0",control:e.control,name:"socialEventUseCeiling",checkboxMode:"checkbox",valueTypeIsBoolean:!0,options:[{label:c.formatMessage({id:"CALENDAR_Subscribers_Limit"}),value:"YES"}]}),(0,o.jsx)(Zn,{$show:!!le,children:(0,o.jsx)(Rn,{margin:"0",control:e.control,name:"socialEventCeiling"})})]})}),(0,o.jsx)(Bn,{margin:"0",label:c.formatMessage({id:"GLOBAL_Audience"}),control:e.control,name:"publishTo",searchable:!0,multiple:!0,views:{activeViews:$,handlers:{user:E.default.user,filebank:E.default.filebank,group:E.default.group},onError:F}}),(0,o.jsx)($n,{children:c.formatMessage({id:"GLOBAL_Attachments"})}),(0,o.jsx)(Hn,{token:N,multiple:!0,name:"attachment",deleteFile:U,activeDrives:[..._&&w?["fileBank"]:[],...r.Hook.utils.buildDrivesArrayFromObject(w?.drives)],handlers:{file:E.default.file,filebank:E.default.filebank,drive:E.default.drive},dispatchOnError:F,onUploadStart:()=>t(!0),onUploadSuccess:()=>t(!1),existingFiles:i?.attachments??[]}),(0,o.jsx)($n,{children:c.formatMessage({id:"CALENDAR_More_Options"})}),(0,o.jsxs)("div",{children:[(0,o.jsx)(Zn,{$show:!ie,children:(0,o.jsx)(Vn,{margin:"0",control:e.control,name:"noGestion",checkboxMode:"checkbox",valueTypeIsBoolean:!0,inverted:!0,options:[{label:c.formatMessage({id:"CALENDAR_Activate_Subscription"}),value:"YES"}]})}),(0,o.jsx)(Zn,{$show:!ie,children:(0,o.jsx)(Vn,{margin:"0",control:e.control,name:"hideFromCalendar",checkboxMode:"checkbox",valueTypeIsBoolean:!0,inverted:!0,options:[{label:c.formatMessage({id:"CALENDAR_Calendar_Display"}),value:"YES"}]})}),(0,o.jsx)(Zn,{$show:!ie,children:(0,o.jsx)(Vn,{margin:"0",control:e.control,name:"useQrcode",checkboxMode:"checkbox",valueTypeIsBoolean:!0,options:[{label:c.formatMessage({id:"CALENDAR_Use_QR_Code"}),value:"YES"}]})}),"create"===s&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Vn,{margin:"0",control:e.control,name:"sendAlert",checkboxMode:"checkbox",valueTypeIsBoolean:!0,options:[{label:c.formatMessage({id:"GLOBAL_Send_Alert"}),value:"YES"}]}),(0,o.jsx)(Vn,{margin:"0",control:e.control,name:"alertAuthor",checkboxMode:"checkbox",valueTypeIsBoolean:!0,options:[{label:c.formatMessage({id:"GLOBAL_Alert_Author"}),value:"YES"}],disabled:!I})]})]})]})]})},ta=c.j.getLazyComponent("ModalForm"),ia=({closeHandler:e,onSubmit:t,children:i,form:n,uploadLoading:a,type:s,loading:r,articleId:d})=>{const c=(0,l.A)();return(0,o.jsx)(ta,{onSubmit:t,loading:r,open:!!d,closeHandler:e,buttons:[{color:"cancel",children:c.formatMessage({id:"GLOBAL_Cancel"}),clickHandler:e},{color:"valid",isSubmit:!0,loading:r,disabled:!n.formState.isValid||r||a,children:c.formatMessage({id:"GLOBAL_Save"})}],extraTopButtons:d?[{icon:"icon-expand",href:`/?action=article-edit&IdArticle=${d}`}]:[],title:c.formatMessage({id:"socialEvent"===s?"CALENDAR_Update_SocialEvent_Title":"meeting"===s?"CALENDAR_Update_Meeting_Title":"CALENDAR_Update_RecurringEvent_Title"}),children:i})};var oa=i(3291),na=i(3320);const aa=c.j.getLazyComponent("Typography"),la=c.j.getLazyComponent("Modal"),sa=(e,t)=>({...e,publishTo:(0,na.q9)(e.publishTo),uiObjectLink:e.uiObjectLink?e.uiObjectLink.uri:"",sendAlert:e.sendAlert?"1":"0",alertAuthor:e.alertAuthor?"1":"0",...(0,E.extractTaxonomiesFromObjectAndMapProperty)(e,"title",e=>e.join(",")),uri:t??"",type:"socialEvent"}),ra=({closeHandler:e,onUpdate:t,event:i})=>{const a=(0,l.A)(),c=(0,oa.A)(),[u,g]=(0,n.useState)(!1),m=(0,q.useForm)(),p=(0,d.jL)(),[h,f]=(0,n.useState)(!0),[x,j]=(0,n.useState)(!1),[b,C]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(i){const e=s.Utils.date.strToTimestamp(i.dateModified);E.default.network.token(c.signal).then(t=>{m.reset({socialEventCeiling:i.socialEventCeiling,title:i.title,noGestion:i.noGestion,dateEnd:i.dateEnd,dateStart:i.dateStart,socialEventUseCeiling:i.socialEventUseCeiling,address:i.address,allDay:i.allDay,bgColor:i.bgColor,image:e&&i.image?{type:"socialEvent",id:i.id,timestamp:String(e)}:void 0,place:i.place,hideFromCalendar:i.hideFromCalendar,textColor:i.textColor,useQrcode:i.useQrcode,description:i.description??void 0,urlGestion:i.urlGestion??void 0,publishTo:i._audience.map(e=>({uri:e.uri,title:e.title})),uiObjectLink:i.uiObjectLink&&i.uiObjectLink.length>0?{uri:i.uiObjectLink[0].uri,title:i.uiObjectLink[0].title}:void 0,token:t.result}),f(!1)}).catch(e=>{c.signal.aborted||p(r.Toast.actions.error({label:e.errorMsg??a.formatMessage({id:"GLOBAL_Error"})}))})}},[c.signal,p,i,m,a]);const y=(0,n.useMemo)(()=>{if(!i)return;let e="onSpot";return e=i.place&&i.address?"hybrid":i.address?"onSpot":i.place?"visio":"onSpot",{eventMode:e,customColors:!!i.textColor||!!i.bgColor,attachments:i._attachedFiles,tags:(0,E.extractTaxonomiesFromObject)(i)}},[i]),v=(0,n.useCallback)(e=>{j(!0),E.default.article.update({...sa(e,i?.uri)},{signal:c.signal,format:E.Format.LITTLE}).then(e=>{t(),p(r.Toast.actions.success({label:"GLOBAL_Successfully_Saved",link:{label:"GLOBAL_Go_To_Content",url:e.result._url}}))}).catch(e=>{c.signal.aborted||p(r.Toast.actions.error({label:e.errorMsg??a.formatMessage({id:"GLOBAL_Error"})}))}).finally(()=>{c.signal.aborted||j(!1)})},[c.signal,p,i?.uri,a,t]),L=(0,q.useWatch)({control:m.control}),A=(0,n.useMemo)(()=>E.socialEventUpdateSchema.safeParse(sa(L,i?.uri)).success,[i?.uri,L]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ia,{articleId:i?.id,type:"socialEvent",closeHandler:e,onSubmit:m.handleSubmit(v),form:m,loading:x,isValid:A,uploadLoading:b,children:h?null:(0,o.jsx)(ea,{mode:"update",form:m,setUploadLoading:C,extraInitialValues:y})}),(0,o.jsx)(la,{open:u,closeHandler:()=>g(!1),title:a.formatMessage({id:"GLOBAL_Save"}),buttons:[{color:"cancel",clickHandler:()=>g(!1),children:a.formatMessage({id:"GLOBAL_Cancel"})},{color:"danger",clickHandler:m.handleSubmit(v),loading:x,children:a.formatMessage({id:"GLOBAL_Save"}),dataCy:"delete-continue"}],children:(0,o.jsx)(aa,{children:a.formatMessage({id:"CALENDAR_Update_Confirmation_Recurrent"})})})]})},da=c.j.getLazyComponent("InputImage"),ca=c.j.getLazyComponent("InputText"),ua=c.j.getLazyComponent("InputCheckbox"),ga=c.j.getLazyComponent("InputCheckboxRaw"),ma=c.j.getLazyComponent("InputAudience"),pa=c.j.getLazyComponent("InputFileAdvancedRaw"),ha=c.j.getLazyComponent("Typography"),fa=c.j.getLazyComponent("InputColor"),xa=c.j.getLazyComponent("InputDateTime"),ja=c.j.getLazyComponent("FlexBox"),ba=c.j.getLazyComponent("InputAutocomplete"),Ca=c.j.getLazyComponent("InputSelectRaw"),ya=c.j.getLazyComponent("Collapse"),va=c.j.getLazyComponent("Message"),La=a.default.div`
522
+ margin-top: -${({theme:e})=>e.space.sm}px;
523
+ margin-bottom: -${({theme:e})=>e.space.l}px;
524
+ `,Ea=a.default.div`
525
+ padding: ${({theme:e})=>e.space.md}px;
526
+ background-color: ${({theme:e})=>e.color.grey0};
527
+ border-radius: ${({theme:e})=>e.size.sm}px;
528
+ border: 1px solid ${({theme:e})=>e.color.grey1};
529
+ `,Aa=a.default.div`
530
+ display: ${({$show:e})=>e?"block":"none"};
531
+ `,_a=({form:e,setUploadLoading:t,extraInitialValues:i,mode:s})=>{const c=(0,l.A)(),u=(0,d.jL)(),g=(0,a.useTheme)(),m=(0,n.useRef)(null),[p,h]=(0,n.useState)(!1),[f,x]=(0,n.useState)(i?.eventMode??"onSpot"),[j,b]=(0,n.useState)(i?.customColors??!1),[C,y]=(0,n.useState)(),[v,L]=(0,n.useState)(),A=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"calendarHook")),_=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"FileBankHook")),k=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"SpotHook")),W=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"BusinessContactHook")),w=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"DriveHook")),S=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"VisioConnectHook")),M=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"BigBlueButtonHook")),T=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"SharedContentHook")),D=(0,d.GV)(r.Model.selectors.selectAll);m.current?.watch(t=>{Object.keys(t).forEach(i=>{e.setValue(i,t[i])})});const G=(0,q.useWatch)({control:e.control,name:"sendAlert"});(0,n.useEffect)(()=>{G||e.setValue("alertAuthor",!1)},[e,G]);const z=(0,q.useWatch)({control:e.control,name:"dateStart"}),I=(0,q.useWatch)({control:e.control,name:"dateEnd"}),V=(0,n.useMemo)(()=>z&&I&&(0,kn.d)(new Date(z),new Date(I)),[z,I]),O=(0,n.useMemo)(()=>[{label:c.formatMessage({id:"CALENDAR_On_Spot"}),value:"onSpot"},{label:c.formatMessage({id:"CALENDAR_Visio"}),value:"visio"},{label:c.formatMessage({id:"CALENDAR_Hybrid"}),value:"hybrid"}],[c]),B=(0,n.useMemo)(()=>{const e=[];return k&&k.isActive&&k.hasLicense&&e.push("group"),e.push("user"),_&&_.isActive&&e.push("folder"),W&&W.isActive&&e.push("businessContact"),e},[W,_,k]),H=(0,n.useCallback)(e=>u(r.Toast.actions.error({label:e??c.formatMessage({id:"GLOBAL_Error"})})),[u,c]),$=(0,n.useCallback)(async t=>{const i=e.watch("token");if(i)try{await E.default.file.deleteFile(t,"attachment",i)}catch(e){H&&H(e)}},[e,H]),F=(0,n.useMemo)(()=>[{value:"jitsi",label:c.formatMessage({id:"CALENDAR_Visio_Jitsi"})},...S&&S.isActive&&S.hasLicense?[{value:"visioConnect",label:c.formatMessage({id:"CALENDAR_Visio_VisioConnect"})}]:[],...M&&M.isActive&&M.hasLicense?[{value:"bbb",label:c.formatMessage({id:"CALENDAR_Visio_BBB"})},...T&&T.isActive?[{value:"bbb-public",label:c.formatMessage({id:"CALENDAR_Visio_BBB_Public"})}]:[]]:[],{value:"other",label:c.formatMessage({id:"CALENDAR_Visio_Other"})}],[M,c,T,S]),[N,U]=(0,n.useState)(F[F.length-1]),P=(0,n.useCallback)(t=>{switch(U(t),t.value){case"jitsi":e.setValue("place","jitsi:"+J.urlBase+"?action=jitsiRedirect&id="+(0,Wn.A)());break;case"visioConnect":e.setValue("place","visioConnect");break;case"other":e.setValue("place","");break;case"bbb":e.setValue("place","bbb");break;case"bbb-public":e.setValue("place","bbb-public")}},[e]),Y=(0,q.useWatch)({control:e.control,name:"place"}),Q=(0,q.useWatch)({control:e.control,name:"address"}),X=(0,n.useCallback)(t=>x(i=>(h(!0),"visio"!==i&&"hybrid"!==i||y(Y),"onSpot"!==i&&"hybrid"!==i||L(Q),"onSpot"===t?(e.setValue("place",null),"hybrid"!==i&&e.setValue("address",v)):"visio"===t?(e.setValue("address",null),"hybrid"!==i&&e.setValue("place",C)):"hybrid"===t&&("onSpot"!==i&&e.setValue("address",v),"visio"!==i&&e.setValue("place",C)),t)),[Q,e,Y,v,C]);return(0,o.jsxs)(ja,{direction:"column",gap:g.space.l,children:[(0,o.jsx)(da,{margin:"0",name:"image",dzDimensions:{width:"100%",height:275},control:e.control,token:e.watch("token"),aspectRatio:2,allowCustomRatio:!0,defaultImages:{imgs:[],columnCount:1}}),(0,o.jsx)(ca,{margin:"0",label:c.formatMessage({id:"GLOBAL_Title"}),name:"title",control:e.control,rules:{required:!0}}),(0,o.jsxs)(ja,{direction:"column",gap:g.space.sm,children:[V&&(0,o.jsx)(va,{message:c.formatMessage({id:"CALENDAR_Date_Start_After_Date_End"}),variant:"error"}),(0,o.jsxs)(ja,{gap:g.space.md,y:"center",children:[(0,o.jsx)(xa,{mode:e.watch("allDay")?"date":"datetime",margin:"0",width:"100%",label:"CALENDAR_DateTime_Start",control:e.control,name:"dateStart",rules:{required:!0},openDirection:"left"}),(0,o.jsx)(xa,{mode:e.watch("allDay")?"date":"datetime",margin:"0",width:"100%",label:"CALENDAR_DateTime_End",control:e.control,name:"dateEnd",rules:{required:!0}})]}),(0,o.jsx)(ua,{control:e.control,margin:"0",name:"allDay",checkboxMode:"checkbox",valueTypeIsBoolean:!0,options:[{label:c.formatMessage({id:"CALENDAR_All_Day"}),value:"YES"}]})]}),(0,o.jsxs)(ja,{direction:"column",gap:g.space.md,children:[(0,o.jsx)(Aa,{$show:"update"===s&&p,children:(0,o.jsx)(va,{variant:"info",message:c.formatMessage({id:"Event_Warning_Message"})})}),(0,o.jsx)(ga,{margin:"0",checkboxMode:"radio",direction:"row",value:f,name:"value",onChange:X,options:O}),("onSpot"===f||"hybrid"===f)&&(0,o.jsx)(ca,{margin:"0",label:c.formatMessage({id:"CALENDAR_Event_Address"}),name:"address",control:e.control}),("visio"===f||"hybrid"===f)&&(0,o.jsxs)(ja,{direction:"column",children:[(0,o.jsx)(ha,{children:c.formatMessage({id:"CALENDAR_Event_Place"})}),(0,o.jsxs)(ja,{gap:g.space.md,y:"flex-end",children:[(0,o.jsx)(ja,{flex:"1",margin:"0 0 4px 0",children:(0,o.jsx)(Ca,{noMargin:!0,name:"visio",onChange:P,options:F,value:N,required:!0,getLabel:e=>e.label,getValue:e=>e.value})}),("other"===N.value||"jitsi"===N.value)&&(0,o.jsx)(ja,{flex:"2",children:(0,o.jsx)(ca,{width:"100%",margin:"0",name:"place",control:e.control,disabled:"jitsi"===N.value})})]})]}),A?.externalGestion&&(0,o.jsx)(ca,{margin:"0",label:c.formatMessage({id:"CALENDAR_External_Link"}),description:c.formatMessage({id:"CALENDAR_External_Link_Description"}),name:"urlGestion",control:e.control}),(0,o.jsx)(Gn,{margin:"0",label:c.formatMessage({id:"GLOBAL_Description"}),control:e.control,name:"agenda",handlers:{file:E.default.file}}),(0,o.jsx)(La,{children:(0,o.jsx)(R,{type:"meeting",fields:[{includes:"tags"}],ref:m,defaultValues:i?.tags})}),(0,o.jsx)(ba,{noMargin:!0,control:e.control,name:"uiObjectLink",label:c.formatMessage({id:"GLOBAL_Object_Link"}),searchable:!0,asyncPromise:e=>E.default.article.list({query:e,filters:[{name:"type",value:"internalDraft",operator:"<>"}]}).then(e=>e?.result?.data.map(e=>{const t=D.find(t=>t.type===e.type);return{uri:e.uri,title:e.title,icon:t?.icon,color:t?.color}}))}),(0,o.jsxs)(ja,{direction:"column",gap:g.space.md,children:[(0,o.jsx)(ga,{margin:"0",onChange:t=>{t?(e.setValue("textColor",g.color.grey5),e.setValue("bgColor",g.color.grey1)):(e.setValue("textColor",null),e.setValue("bgColor",null)),b(t)},value:j,name:"",checkboxMode:"checkbox",valueTypeIsBoolean:!0,options:[{label:c.formatMessage({id:"CALENDAR_Custom_Colors"}),value:"YES"}]}),(0,o.jsxs)(Aa,{$show:j,children:[(0,o.jsx)(fa,{margin:"0",control:e.control,name:"textColor",label:"CALENDAR_Text_Color",initialValue:e.watch("textColor")??g.color.grey5}),(0,o.jsx)(fa,{margin:"0",control:e.control,name:"bgColor",label:"CALENDAR_Background_Color",initialValue:e.watch("bgColor")??g.color.grey1})]})]}),(0,o.jsx)(ma,{margin:"0",label:c.formatMessage({id:"GLOBAL_Audience"}),control:e.control,name:"publishTo",searchable:!0,multiple:!0,views:{activeViews:B,handlers:{user:E.default.user,filebank:E.default.filebank,group:E.default.group},onError:H}}),(0,o.jsx)(ha,{children:c.formatMessage({id:"GLOBAL_Attachments"})}),(0,o.jsx)(pa,{token:e.watch("token"),multiple:!0,name:"attachment",deleteFile:$,activeDrives:[..._&&w?["fileBank"]:[],...r.Hook.utils.buildDrivesArrayFromObject(w?.drives)],handlers:{file:E.default.file,filebank:E.default.filebank,drive:E.default.drive},dispatchOnError:H,onUploadStart:()=>t(!0),onUploadSuccess:()=>t(!1),existingFiles:i?.attachments??[]}),(0,o.jsx)(Ea,{children:(0,o.jsx)(ya,{openByDefault:"update"===s,header:(0,o.jsx)(ha,{children:c.formatMessage({id:"CALENDAR_Report"})}),content:(0,o.jsxs)(ja,{direction:"column",gap:g.space.l,children:[(0,o.jsx)(Gn,{margin:"0",control:e.control,name:"report",handlers:{file:E.default.file}}),(0,o.jsx)(ha,{children:c.formatMessage({id:"CALENDAR_Report_File"})}),(0,o.jsx)(pa,{token:e.watch("token"),multiple:!0,name:"reportFile",deleteFile:$,activeDrives:[..._&&w?["fileBank"]:[],...r.Hook.utils.buildDrivesArrayFromObject(w?.drives)],handlers:{file:E.default.file,filebank:E.default.filebank,drive:E.default.drive},dispatchOnError:H,onUploadStart:()=>t(!0),onUploadSuccess:()=>t(!1),existingFiles:i?.reportFile?[i.reportFile]:[]})]})})}),(0,o.jsx)(ha,{children:c.formatMessage({id:"CALENDAR_More_Options"})}),(0,o.jsxs)("div",{children:[(0,o.jsx)(ua,{margin:"0",control:e.control,name:"noGestion",checkboxMode:"checkbox",valueTypeIsBoolean:!0,inverted:!0,options:[{label:c.formatMessage({id:"CALENDAR_Activate_Subscription"}),value:"YES"}]}),"create"===s&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ua,{margin:"0",control:e.control,name:"sendAlert",checkboxMode:"checkbox",valueTypeIsBoolean:!0,options:[{label:c.formatMessage({id:"GLOBAL_Send_Alert"}),value:"YES"}]}),(0,o.jsx)(ua,{margin:"0",control:e.control,name:"alertAuthor",checkboxMode:"checkbox",valueTypeIsBoolean:!0,options:[{label:c.formatMessage({id:"GLOBAL_Alert_Author"}),value:"YES"}],disabled:!G})]})]})]})]})},ka=(e,t)=>({...e,publishTo:(0,na.q9)(e.publishTo),uiObjectLink:e.uiObjectLink?e.uiObjectLink.uri:"",sendAlert:e.sendAlert?"1":"0",alertAuthor:e.alertAuthor?"1":"0",...(0,E.extractTaxonomiesFromObjectAndMapProperty)(e,"title",e=>e.join(",")),uri:t??"",type:"meeting"}),Wa=({closeHandler:e,onUpdate:t,meeting:i})=>{const a=(0,l.A)(),c=(0,oa.A)(),u=(0,q.useForm)(),g=(0,d.jL)(),[m,p]=(0,n.useState)(!0),[h,f]=(0,n.useState)(!1),[x,j]=(0,n.useState)(!1),b=(0,q.useWatch)({control:u.control}),C=(0,n.useMemo)(()=>E.meetingUpdateSchema.safeParse(ka(b,i?.uri)).success,[i?.uri,b]);(0,n.useEffect)(()=>{if(i){const e=s.Utils.date.strToTimestamp(i.dateModified);E.default.network.token(c.signal).then(t=>{u.reset({title:i.title,noGestion:i.noGestion,dateEnd:i.dateEnd,dateStart:i.dateStart,address:i.address,allDay:i.allDay,bgColor:i.bgColor,image:e&&i.image?{type:"meeting",id:i.id,timestamp:String(e)}:void 0,place:i.place,textColor:i.textColor,agenda:i.agenda??void 0,report:i.report??void 0,urlGestion:i.urlGestion??void 0,publishTo:i._audience.map(e=>({uri:e.uri,title:e.title})),uiObjectLink:i.uiObjectLink&&i.uiObjectLink.length>0?{uri:i.uiObjectLink[0].uri,title:i.uiObjectLink[0].title}:void 0,token:t.result}),p(!1)}).catch(e=>{c.signal.aborted||g(r.Toast.actions.error({label:e.errorMsg??a.formatMessage({id:"GLOBAL_Error"})}))})}},[i,u,c.signal,g,a]);const y=(0,n.useMemo)(()=>{if(!i)return;let e="onSpot";return e=i.place&&i.address?"hybrid":i.address?"onSpot":i.place?"visio":"onSpot",{eventMode:e,customColors:!!i.textColor||!!i.bgColor,attachments:i._attachedFiles,reportFile:i.reportFile,tags:(0,E.extractTaxonomiesFromObject)(i)}},[i]),v=(0,n.useCallback)(e=>{f(!0),E.default.article.update(ka(e,i?.uri),{signal:c.signal,format:E.Format.LITTLE}).then(e=>{t(),g(r.Toast.actions.success({label:"GLOBAL_Successfully_Saved",link:{label:"GLOBAL_Go_To_Content",url:e.result._url}}))}).catch(e=>{c.signal.aborted||g(r.Toast.actions.error({label:e.errorMsg??a.formatMessage({id:"GLOBAL_Error"})}))}).finally(()=>{c.signal.aborted||f(!1)})},[c.signal,g,a,i?.uri,t]);return(0,o.jsx)(ia,{articleId:i?.id,type:"meeting",closeHandler:e,onSubmit:u.handleSubmit(v),form:u,loading:h,uploadLoading:x,isValid:C,children:m?null:(0,o.jsx)(_a,{mode:"update",form:u,setUploadLoading:j,extraInitialValues:y})})},wa=c.j.getLazyComponent("Typography"),Sa=c.j.getLazyComponent("Modal"),Ma=(e,t)=>({...e,publishTo:(0,na.q9)(e.publishTo),sendAlert:e.sendAlert?"1":"0",alertAuthor:e.alertAuthor?"1":"0",...(0,E.extractTaxonomiesFromObjectAndMapProperty)(e,"title",e=>e.join(",")),uri:t??"",type:"recurringEvent"}),Ta=({closeHandler:e,onUpdate:t,event:i})=>{const a=i?._extend?.recurringEventRecord,c=(0,l.A)(),u=(0,oa.A)(),[g,m]=(0,n.useState)(!1),p=(0,q.useForm)(),h=(0,d.jL)(),[f,x]=(0,n.useState)(!0),[j,b]=(0,n.useState)(!1),[C,y]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(a){const e=s.Utils.date.strToTimestamp(a.dateModified);E.default.network.token(u.signal).then(t=>{p.reset({title:a.title,dateEnd:a.dateEnd,dateStart:a.dateStart,address:a.address,allDay:a.allDay,bgColor:a.bgColor,image:e&&a.image?{type:"recurringEvent",id:a.id,timestamp:String(e)}:void 0,textColor:a.textColor,description:a.description??void 0,publishTo:a._audience.map(e=>({uri:e.uri,title:e.title})),recurrenceRule:a.recurrenceRule,token:t.result}),x(!1)}).catch(e=>{u.signal.aborted||h(r.Toast.actions.error({label:e.errorMsg??c.formatMessage({id:"GLOBAL_Error"})}))})}},[u.signal,h,a,p,c]);const v=(0,n.useMemo)(()=>{if(!a)return;let e="onSpot";return e=a.place&&a.address?"hybrid":a.address?"onSpot":a.place?"visio":"onSpot",{eventMode:e,customColors:!!a.textColor||!!a.bgColor,attachments:a._attachedFiles,tags:(0,E.extractTaxonomiesFromObject)(a),until:a.recurrenceRule.until}},[a]),L=(0,n.useCallback)(e=>{b(!0),E.default.article.update(Ma(e,a?.uri),{signal:u.signal,format:E.Format.LITTLE}).then(e=>{t(),h(r.Toast.actions.success({label:"GLOBAL_Successfully_Saved",link:{label:"GLOBAL_Go_To_Content",url:e.result._url}}))}).catch(e=>{u.signal.aborted||h(r.Toast.actions.error({label:e.errorMsg??c.formatMessage({id:"GLOBAL_Error"})}))}).finally(()=>{u.signal.aborted||b(!1)})},[u.signal,h,a?.uri,c,t]),A=(0,q.useWatch)({control:p.control}),_=(0,n.useMemo)(()=>E.recurringEventUpdateSchema.safeParse(Ma(A,a?.uri)).success,[a?.uri,A]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ia,{articleId:a?.id,type:"recurringEvent",closeHandler:e,onSubmit:p.handleSubmit(L),form:p,loading:j,isValid:_,uploadLoading:C,children:f?null:(0,o.jsx)(ea,{mode:"update",form:p,setUploadLoading:y,extraInitialValues:v})}),(0,o.jsx)(Sa,{open:g,closeHandler:()=>m(!1),title:c.formatMessage({id:"GLOBAL_Save"}),buttons:[{color:"cancel",clickHandler:()=>m(!1),children:c.formatMessage({id:"GLOBAL_Cancel"})},{color:"danger",clickHandler:p.handleSubmit(L),loading:j,children:c.formatMessage({id:"GLOBAL_Save"}),dataCy:"delete-continue"}],children:(0,o.jsx)(wa,{children:c.formatMessage({id:"CALENDAR_Update_Confirmation_Recurrent"})})})]})};var qa=i(1974),Da=i(4533);const Ga=c.j.getLazyComponent("SidePanelModal"),za=c.j.getLazyComponent("FlexBox"),Ia=c.j.getLazyComponent("Button"),Va=c.j.getLazyComponent("Typography"),Oa=c.j.getLazyComponent("IconButton"),Ra=a.default.div`
532
+ margin-right: ${({theme:e})=>e.space.sm}px;
533
+ `,Ba=({open:e,closeHandler:t,onSubmit:i,onSchedule:s,children:r,form:d,uploadLoading:c,type:u,scheduleLoading:g,publishLoading:m,isValid:p})=>{const h=(0,l.A)(),f=(0,a.useTheme)(),x=(0,n.useRef)(),[j,b]=(0,n.useState)(),C=(0,n.useCallback)(()=>{t()},[t]);(0,n.useEffect)(()=>{e&&(x.current=void 0,d.reset(),b(void 0))},[d,e]);const y=(0,q.useWatch)({control:d.control});(0,n.useEffect)(()=>{let t;return e&&Object.keys(d.formState.dirtyFields).filter(e=>!["dateStart","dateEnd"].includes(e)).length>0&&(t=setTimeout(()=>{E.default.article.saveAsDraft({idDraft:x.current,form:{...y,type:u},contentType:u}).then(e=>{x.current=e.result.idDraft,b(new Date)})},2e3)),()=>{t&&clearTimeout(t)}},[e,y,u,d]);const v=(0,n.useMemo)(()=>c||g||m,[m,g,c]);return(0,o.jsx)(Ga,{offsetTop:0,position:"right",open:e,closeHandler:C,showIconClose:!0,options:(0,o.jsx)(Oa,{icon:"icon-expand",href:x.current?`/?action=se&from=draft&idDraft=${x.current}`:`/?action=spotlight-edit&type=${u}`,tooltip:{description:h.formatMessage({id:"GLOBAL_Form_All"})},srOnly:h.formatMessage({id:"GLOBAL_Form_All"})}),title:h.formatMessage({id:"socialEvent"===u?"CALENDAR_Create_SocialEvent_Title":"CALENDAR_Create_Meeting_Title"}),sticky:!0,footer:(0,o.jsxs)(za,{direction:"column",x:"flex-end",gap:f.space.xs,children:[j&&(0,o.jsx)(Ra,{children:(0,o.jsx)(Va,{color:"grey5",size:"s",children:(0,qa.r)(j,new Date)?h.formatMessage({id:"CALENDAR_Draft_Saved_Today"},{time:(0,Da.Yq)(j,"HH:mm")}):h.formatMessage({id:"CALENDAR_Draft_Saved"},{date:h.formatDate(j,{day:"2-digit",month:"2-digit",year:"numeric"}),time:(0,Da.Yq)(j,"HH:mm")})})}),(0,o.jsxs)(za,{children:[(0,o.jsx)(Ia,{color:"cancel",label:h.formatMessage({id:"GLOBAL_Cancel"}),onClick:C}),(0,o.jsx)(Ia,{color:"cancel",label:h.formatMessage({id:"GLOBAL_Schedule_Action"}),onClick:s,disabled:!p||v,loader:g}),(0,o.jsx)(Ia,{color:"valid",label:h.formatMessage({id:"GLOBAL_Publish"}),onClick:()=>i(),dataCy:`${u}-publish`,disabled:!p||v,loader:m})]})]}),children:(0,o.jsx)("form",{onSubmit:i,children:r})})};var Ha=i(3912);const $a=c.j.getLazyComponent("InputAudience"),Fa=c.j.getLazyComponent("Message"),Na=c.j.getLazyComponent("Modal"),Ua=({open:e,closeHandler:t,title:i,control:n,warningMessage:a,onSubmit:s,name:r="publishTo"})=>{const d=(0,l.A)();return(0,o.jsxs)(Na,{open:e,closeHandler:t,title:i??d.formatMessage({id:"GLOBAL_Audience"}),buttons:[{children:(0,o.jsx)(T.A,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:()=>t()},{dataCy:"no-audience-continue",children:(0,o.jsx)(T.A,{id:"GLOBAL_Continue"}),color:"danger",clickHandler:()=>{t(),s()}}],children:[(0,o.jsx)(Fa,{variant:"warning",message:a??d.formatMessage({id:"FORM_Audience_Empty"})}),(0,o.jsx)($a,{asyncPromise:e=>E.default.audience.autocomplete(e),searchable:!0,control:n,multiple:!0,placeholder:d.formatMessage({id:"GLOBAL_Audience"}),name:r})]})},Pa=c.j.getLazyComponent("ModalForm"),Ya=c.j.getLazyComponent("InputDateTime"),Qa=c.j.getLazyComponent("InputTextRaw"),Ja=c.j.getLazyComponent("FlexBox"),Xa=c.j.getLazyComponent("IconButton"),Ka=a.default.div`
534
+ margin-bottom: ${({theme:e})=>e.space.xs}px;
535
+ `,Za=({open:e,closeHandler:t,onSubmit:i})=>{const a=(0,l.A)(),c=(0,d.jL)(),u=(0,d.GV)(r.Platform.selectors.selectUrlBase),g=(0,q.useForm)({defaultValues:async()=>{const e=new Date;return{scheduleDate:`${s.Utils.date.formatDate(e)} ${(0,E.padStartTwoDigits)(e.getHours())}:${(0,E.padStartTwoDigits)(e.getMinutes())}`,permalinkId:(0,Wn.A)()}}}),m=g.handleSubmit(e=>{i(e)});(0,n.useEffect)(()=>{e&&g.reset()},[g,e]);const p=(0,q.useWatch)({control:g.control,name:"permalinkId"}),h=(0,n.useMemo)(()=>`${u}permalink/${p}`,[p,u]);return(0,o.jsxs)(Pa,{open:e,closeHandler:t,onSubmit:m,maxHeight:"620px",title:a.formatMessage({id:"GLOBAL_Schedule_Action"}),buttons:[{children:(0,o.jsx)(T.A,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:()=>t()},{children:(0,o.jsx)(T.A,{id:"GLOBAL_Schedule_Action"}),color:"valid",clickHandler:()=>{t(),m()},disabled:!g.watch("scheduleDate")}],children:[(0,o.jsx)(Ya,{rules:{required:!0},label:"GLOBAL_Scheduled_Date",control:g.control,name:"scheduleDate"}),(0,o.jsxs)(Ja,{y:"flex-end",children:[(0,o.jsx)(Qa,{label:a.formatMessage({id:"GLOBAL_Permalink"}),value:h,onChange:()=>null,margin:"0",width:"100%"}),(0,o.jsx)(Ka,{children:(0,o.jsx)(Xa,{srOnly:"GLOBAL_Copy_Link",icon:"icon-copy",colorVariant:"primary",onClick:()=>{navigator.clipboard.writeText(h).then(()=>{c(r.Toast.actions.success({label:a.formatMessage({id:"CLIPBOARD_Copy_Success"})}))})}})})]})]})},el=e=>({...e,publishTo:(0,na.q9)(e.publishTo),uiObjectLink:e.uiObjectLink?e.uiObjectLink.uri:"",sendAlert:e.sendAlert?"1":"0",alertAuthor:e.alertAuthor?"1":"0",...(0,E.extractTaxonomiesFromObjectAndMapProperty)(e,"title",e=>e.join(",")),type:"meeting"}),tl=({open:e,closeHandler:t,onCreate:i})=>{const a=(0,l.A)(),s=(0,oa.A)(),[c,u]=(0,n.useState)(null),[g,m]=(0,n.useState)(!1),[p,h]=(0,n.useState)(),[f,x]=(0,n.useState)(),j=(0,be.useSelector)(r.Platform.selectors.selectPlatformConfig),b=(0,q.useForm)({defaultValues:async()=>{let e=new Date;e.setMinutes(e.getMinutes()<30?30:0),e=0===e.getMinutes()?(0,Ha.L)(e,1):e;let t=e;return t=(0,Ha.L)(t,1),{title:"",sendAlert:1===j.sendAlert,alertAuthor:1===j.sendAlert,dateStart:(0,Da.Yq)(e,"yyyy-MM-dd HH:mm"),dateEnd:(0,Da.Yq)(t,"yyyy-MM-dd HH:mm"),publishTo:[]}}}),C=(0,d.jL)(),[y,v]=(0,n.useState)(!1),[L,A]=(0,n.useState)(!1),[_,k]=(0,n.useState)(!1);(0,n.useEffect)(()=>{e&&E.default.network.token(s.signal).then(e=>{b.setValue("token",e.result)}).catch(e=>{s.signal.aborted||C(r.Toast.actions.error({label:e.errorMsg??a.formatMessage({id:"GLOBAL_Error"})}))})},[s.signal,C,b,a,e]);const W=(0,q.useWatch)({control:b.control}),w=(0,n.useMemo)(()=>E.meetingCreationSchema.safeParse(el(W)).success,[W]),S=(0,n.useCallback)(e=>b.handleSubmit(t=>{t.publishTo&&0!==t.publishTo.length||e?(v(!0),E.default.article.create(el(t),{signal:s.signal,format:E.Format.LITTLE}).then(e=>{i(),C(r.Toast.actions.success({label:"GLOBAL_Successfully_Saved",link:{label:"GLOBAL_Go_To_Content",url:e.result[0]._url}}))}).catch(e=>{C(r.Toast.actions.error({label:e.errorMsg??a.formatMessage({id:"GLOBAL_Error"})}))}).finally(()=>{v(!1)})):u("publish")})(),[C,b,a,i]),M=(0,n.useCallback)((e,t,o)=>b.handleSubmit(n=>{const l=el(n);if(!(l.publishTo&&0!==l.publishTo.length||o))return u("schedule"),h(e),void x(t);A(!0),E.default.article.saveAsDraft({form:l,contentType:"meeting",scheduleDate:e,permalinkId:t},{signal:s.signal}).then(()=>{i(),C(r.Toast.actions.success({label:"GLOBAL_Successfully_Saved"}))}).catch(e=>{s.signal.aborted||C(r.Toast.actions.error({label:e.errorMsg??a.formatMessage({id:"GLOBAL_Error"})}))}).finally(()=>{s.signal.aborted||A(!1)})})(),[s.signal,C,b,a,i]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Ba,{type:"meeting",open:e,closeHandler:t,onSubmit:S,onSchedule:()=>m(!0),form:b,publishLoading:y,scheduleLoading:L,uploadLoading:_,isValid:w,children:(0,o.jsx)(_a,{mode:"create",form:b,setUploadLoading:k})}),(0,o.jsx)(Ua,{open:null!==c,closeHandler:()=>u(null),control:b.control,onSubmit:()=>{"publish"===c?S(!0):"schedule"===c&&p&&f&&M(p,f,!0)}}),(0,o.jsx)(Za,{open:g,closeHandler:()=>m(!1),onSubmit:({scheduleDate:e,permalinkId:t})=>M(e,t)})]})},il=c.j.getLazyComponent("Modal"),ol=c.j.getLazyComponent("Message"),nl=c.j.getLazyComponent("Typography"),al=c.j.getLazyComponent("FlexBox"),ll=c.j.getLazyComponent("IconButton"),sl=c.j.getLazyComponent("InputTextRaw"),rl=a.default.div`
536
+ display: flex;
537
+ flex-direction: column;
538
+ gap: ${({theme:e})=>e.space.sm}px;
539
+ margin-bottom: ${({theme:e})=>e.space.l}px;
540
+ `,dl=({open:e,closeHandler:t})=>{const i=(0,l.A)(),n=(0,d.jL)(),a=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"calendarHook"))?.iCalendarUrls;return a?(0,o.jsx)(il,{title:i.formatMessage({id:"EVENT_Export_Calendar_ICalendar_Format"}),open:e,closeHandler:t,enableClickAwayCloseModal:!0,children:(0,o.jsxs)(rl,{children:[(0,o.jsx)(ol,{message:i.formatMessage({id:"EVENT_ICalendar_Export_Url_Explanation"}),variant:"info"}),(0,o.jsxs)(al,{direction:"column",children:[(0,o.jsx)(nl,{weight:"medium",children:i.formatMessage({id:"EVENT_ICalendar_Export_Url"})}),(0,o.jsxs)(al,{children:[(0,o.jsx)(ll,{icon:"icon-copy",colorVariant:"primary",onClick:()=>{navigator.clipboard.writeText(a.all).then(()=>{n(r.Toast.actions.success({label:i.formatMessage({id:"CLIPBOARD_Copy_Success"})}))})}}),(0,o.jsx)(sl,{value:a.all,margin:"0",width:"100%"})]})]}),(0,o.jsxs)(al,{direction:"column",children:[(0,o.jsx)(nl,{weight:"medium",children:i.formatMessage({id:"EVENT_ICalendar_Export_Url_Subscribed"})}),(0,o.jsxs)(al,{children:[(0,o.jsx)(ll,{icon:"icon-copy",colorVariant:"primary",onClick:()=>{navigator.clipboard.writeText(a.accepted).then(()=>{n(r.Toast.actions.success({label:i.formatMessage({id:"CLIPBOARD_Copy_Success"})}))})}}),(0,o.jsx)(sl,{value:a.accepted,margin:"0",width:"100%"})]})]})]})}):null},cl=e=>({...e,publishTo:(0,na.q9)(e.publishTo),uiObjectLink:e.uiObjectLink?e.uiObjectLink.uri:"",sendAlert:e.sendAlert?"1":"0",alertAuthor:e.alertAuthor?"1":"0",...(0,E.extractTaxonomiesFromObjectAndMapProperty)(e,"title",e=>e.join(",")),type:"recurrenceRule"in e&&e.recurrenceRule&&Mn(e.recurrenceRule)?"recurringEvent":"socialEvent"}),ul=({open:e,closeHandler:t,onCreate:i,defaultDateSelection:a})=>{const s=(0,l.A)(),c=(0,oa.A)(),[u,g]=(0,n.useState)(null),[m,p]=(0,n.useState)(!1),[h,f]=(0,n.useState)(),[x,j]=(0,n.useState)(),b=(0,be.useSelector)(r.Platform.selectors.selectPlatformConfig),C=(0,q.useForm)({defaultValues:async()=>{let e=new Date;e.setMinutes(e.getMinutes()<30?30:0),e=0===e.getMinutes()?(0,Ha.L)(e,1):e;let t=e;return t=(0,Ha.L)(t,1),{title:"",sendAlert:1===b.sendAlert,alertAuthor:1===b.sendAlert,dateStart:(0,Da.Yq)(e,"yyyy-MM-dd HH:mm"),dateEnd:(0,Da.Yq)(t,"yyyy-MM-dd HH:mm"),publishTo:[],recurrenceRule:{},token:"",uri:"",bgColor:void 0,place:void 0,textColor:void 0,urlGestion:void 0,socialEventCeiling:void 0,socialEventUseCeiling:void 0,allDay:void 0,noGestion:void 0,address:void 0,uiObjectLink:void 0,image:void 0,description:void 0,useQrcode:void 0,hideFromCalendar:void 0}}}),y=(0,d.jL)(),[v,L]=(0,n.useState)(!1),[A,_]=(0,n.useState)(!1),[k,W]=(0,n.useState)(!1);(0,n.useEffect)(()=>{e&&(a&&(C.setValue("dateStart",(0,Da.Yq)(a.start,a.allDay?"yyyy-MM-dd":"yyyy-MM-dd HH:mm")),C.setValue("dateEnd",(0,Da.Yq)(a.end,a.allDay?"yyyy-MM-dd":"yyyy-MM-dd HH:mm")),C.setValue("allDay",a.allDay)),E.default.network.token(c.signal).then(e=>{C.setValue("token",e.result)}).catch(e=>{c.signal.aborted||y(r.Toast.actions.error({label:e.errorMsg??s.formatMessage({id:"GLOBAL_Error"})}))}))},[c.signal,a,y,C,s,e]);const w=(0,n.useCallback)(e=>C.handleSubmit(t=>{const o=cl(t);o.publishTo&&0!==o.publishTo.length||e?(L(!0),E.default.article.create(cl(t),{format:E.Format.LITTLE}).then(e=>{i(),y(r.Toast.actions.success({label:"GLOBAL_Successfully_Saved",link:{label:"GLOBAL_Go_To_Content",url:e.result[0]._url}}))}).catch(e=>{y(r.Toast.actions.error({label:e.errorMsg??s.formatMessage({id:"GLOBAL_Error"})}))}).finally(()=>{L(!1)})):g("publish")})(),[y,C,s,i]),S=(0,n.useCallback)((e,t,o)=>C.handleSubmit(n=>{const a=cl(n);if(!(a.publishTo&&0!==a.publishTo.length||o))return g("schedule"),f(e),void j(t);_(!0),E.default.article.saveAsDraft({form:a,contentType:a.type,scheduleDate:e,permalinkId:t},{signal:c.signal}).then(()=>{i(),y(r.Toast.actions.success({label:"GLOBAL_Successfully_Saved"}))}).catch(e=>{c.signal.aborted||y(r.Toast.actions.error({label:e.errorMsg??s.formatMessage({id:"GLOBAL_Error"})}))}).finally(()=>{c.signal.aborted||_(!1)})})(),[c.signal,y,C,s,i]),M=(0,q.useWatch)({control:C.control}),T=(0,n.useMemo)(()=>(0,E.zPassThrough)(E.socialEventCreationSchema.or(E.recurringEventCreationSchema)).safeParse(cl(M)).success,[M]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Ba,{type:"socialEvent",open:e,closeHandler:t,onSubmit:w,onSchedule:()=>p(!0),form:C,publishLoading:v,scheduleLoading:A,uploadLoading:k,isValid:T,children:(0,o.jsx)(ea,{form:C,setUploadLoading:W,mode:"create"})}),(0,o.jsx)(Ua,{open:null!==u,closeHandler:()=>g(null),control:C.control,onSubmit:()=>{"publish"===u?w(!0):"schedule"===u&&h&&x&&S(h,x,!0)}}),(0,o.jsx)(Za,{open:m,closeHandler:()=>p(!1),onSubmit:({scheduleDate:e,permalinkId:t})=>S(e,t)})]})},gl=c.j.getLazyComponent("Calendar"),ml=a.default.div`
541
+ margin-bottom: ${({theme:e})=>e.space.md}px;
542
+ `,pl=a.default.div`
543
+ height: 54px;
544
+ display: flex;
545
+ align-items: center;
546
+ justify-content: space-between;
547
+ ${({view:e,theme:t})=>"list"===e&&`border-bottom: 1px solid ${t.color.grey2};`}
548
+ padding: 0 ${({theme:e})=>e.space.md}px;
549
+ `,hl=[{label:"CALENDAR_dayGridMonth",value:"dayGridMonth"},{label:"CALENDAR_timeGridWeek",value:"timeGridWeek"},{label:"CALENDAR_timeGridDay",value:"timeGridDay"},{label:"CALENDAR_listWeek",value:"list"}],fl=({views:e=["dayGridMonth","list","timeGridDay","timeGridWeek"],mode:t="full",withPadding:i=!0,withHeader:a=!0,withToolbar:c=!0,fluid:u})=>{const g=(0,l.A)(),m=(0,d.jL)(),p=(0,Z.Zp)();(()=>{const e=(0,d.jL)(),t=(0,n.useMemo)(()=>te.A,[]),i=(0,n.useMemo)(()=>r.Calendar.getCalendarRTHandlers(e,E.default),[e]);(0,n.useEffect)(()=>(i.forEach(e=>{t.onMessage(e.namespace,e.function,e.handler)}),()=>{i.forEach(e=>{t.offMessage(e.namespace,e.function,e.handler)})}),[i,t])})();const[h,f]=(0,n.useState)(),{loading:x,list:j,pendingStatusChanges:b}=(0,d.GV)(r.Calendar.selectors.selectCalendarEvents),[C,y]=(0,n.useState)(),[v,L]=(0,n.useState)(null),[A,_]=(0,n.useState)(!1),[k,W]=(0,n.useState)(null),w=(0,d.GV)(e=>r.Hook.selectors.selectHook(e,"calendarHook"))?.defaultView,S=(0,n.useMemo)(()=>{const e=new URLSearchParams(window.location.search).get("view");switch(e){case"dayGridMonth":case"timeGridDay":case"timeGridWeek":case"list":return e;default:switch(w){case"month":default:return"dayGridMonth";case"week":return"timeGridWeek";case"day":return"timeGridDay";case"list":return"list"}}},[w]),M=(0,n.useMemo)(()=>hl.filter(t=>e.includes(t.value)).map(e=>({label:g.formatMessage({id:e.label}),value:e.value})),[e,g]),[T,q]=(0,n.useState)(M.find(e=>e.value===S)??M[0]),D=(0,n.useCallback)(e=>{const t=new URLSearchParams(window.location.search);void 0!==e.types&&(e.types.length>0?t.set("types",e.types.join(",")):t.delete("types")),void 0!==e.view&&(e.view?t.set("view",e.view):t.delete("view")),p(`?${t.toString()}`,{replace:!0})},[p]),G=(0,n.useCallback)(e=>{m(r.Toast.actions.error({label:e??g.formatMessage({id:"GLOBAL_Error"})}))},[m,g]),z=(0,n.useCallback)(e=>{m(r.Toast.actions.success({label:e}))},[m]),I=(0,n.useCallback)(e=>{q(e),D({view:e.value})},[D]),V=(0,n.useCallback)((e,t)=>{const i={start:s.Utils.date.formatDate(e),end:s.Utils.date.formatDate(t)};m(r.Calendar.actions.setDates(i))},[m]),[O,R]=(0,n.useState)(null);return(0,n.useEffect)(()=>{m(r.Calendar.actions.setTypes(new URLSearchParams(window.location.search).get("types")?.split(",").filter(e=>["socialEvent","meeting","animatedMeeting","boardCard"].includes(e))??[]))},[m]),(0,o.jsxs)(o.Fragment,{children:[(a||c)&&(0,o.jsxs)(pl,{view:T.value,children:[a&&(0,o.jsx)(pn,{}),c&&(0,o.jsxs)(n.Suspense,{fallback:(0,o.jsx)(o.Fragment,{}),children:[(0,o.jsx)(_n,{label:h,isLoading:"pending"===x,view:T,calendarApi:C,viewsOptions:M,navigateWithQuery:D,setView:q,setCreationType:R,setExportModalOpen:_}),(0,o.jsx)(ul,{defaultDateSelection:k,closeHandler:()=>{R(null),W(null)},open:"socialEvent"===O||!!k,onCreate:()=>{R(null),W(null)}}),(0,o.jsx)(tl,{closeHandler:()=>R(null),open:"meeting"===O,onCreate:()=>{R(null)}}),(0,o.jsx)(dl,{open:A,closeHandler:()=>_(!1)})]})]}),(0,o.jsx)(gl,{fluid:u,mode:t,fullScreen:!0,withPadding:i,events:j,loading:"pending"===x,handler:{global:E.default.global,calendar:E.default.calendar,article:E.default.article},defaultView:T.value,eventModalExtraComponent:({id:e,uri:t,_right:i,type:n})=>"recurringEventOccurrence"===n?null:(0,o.jsx)(ml,{children:(0,o.jsx)(sn,{articleId:e,articleUri:t,canComment:i.comment})}),deportedToolbar:{onChangeLabel:f,onCalendarApiInit:y,view:T},onChangeDates:V,onError:G,onSuccess:z,onChangeView:I,onDeleteEvent:()=>{m(r.Toast.actions.success({label:g.formatMessage({id:"GLOBAL_Successfully_Deleted"})}))},onClickUpdateEvent:L,onUpdateStatus:e=>m(r.Calendar.actions.changeResponse(e)),isUpdateStatusLoading:e=>b.some(t=>t.eventId===e),onSelect:W,disableSelect:null!==k||null!==O}),(0,o.jsx)(ra,{event:"socialEvent"===v?.type?v:void 0,onUpdate:()=>{L(null)},closeHandler:()=>L(null)}),(0,o.jsx)(Wa,{meeting:"meeting"===v?.type?v:void 0,onUpdate:()=>{L(null)},closeHandler:()=>L(null)}),(0,o.jsx)(Ta,{event:v&&(0,E.isRecurringEventOccurrence)(v)?v:void 0,onUpdate:()=>{L(null)},closeHandler:()=>L(null)})]})},xl=(a.default.div`
550
+ margin-bottom: 24px;
551
+ `,a.default.div`
552
+ margin-bottom: 4px;
553
+ `,a.default.div`
554
+ position: absolute;
555
+ background-color: ${e=>e.isActive?"rgba(0,0,0,.1)":"transparent"};
556
+ inset: 0;
557
+ pointer-events: ${e=>e.isActive?"all":"none"};
558
+ flex: 1;
559
+ display: flex;
560
+ overflow: hidden;
561
+ `),jl=a.default.div`
562
+ flex-direction: row;
563
+ display: flex;
564
+ min-height: 60px;
565
+ border-bottom: 1px solid ${e=>e.theme.color.grey2};
566
+ `,bl=a.default.div`
567
+ width: 60px;
568
+ display: flex;
569
+ align-items: center;
570
+ justify-content: center;
571
+ `,Cl=a.default.div`
572
+ flex: 1;
573
+ display: flex;
574
+ align-items: center;
575
+ justify-content: center;
576
+ `,yl=a.default.div`
577
+ position: relative;
578
+ overflow: hidden;
579
+ top: 0px;
580
+ width: ${460}px;
581
+ `,vl=a.default.div`
582
+ position: absolute;
583
+ top: 0;
584
+ ${e=>"left"===e.position?"left: 0px;":""}
585
+ ${e=>"right"===e.position?"right: -1000px;":""}
586
+ width: ${440}px;
587
+ bottom: 00px;
588
+ display: flex;
589
+ background-color: ${e=>e.theme.color.white};
590
+ flex-direction: row;
591
+ transition: all 0.4s;
592
+ box-shadow: -4px 0px 20px 0px #00000017;
593
+
594
+ &.animate {
595
+ right: 0px;
596
+ }
597
+ `,Ll=a.default.div`
598
+ flex: 1;
599
+ display: flex;
600
+ flex-direction: column;
601
+ padding: 12px;
602
+ overflow: auto;
603
+ margin-bottom: 12px;
604
+ position: relative;
605
+ `,El=a.default.div`
606
+ flex: 1;
607
+ display: flex;
608
+ flex-direction: column;
609
+ `,Al=a.default.div`
610
+ position: absolute;
611
+ inset: 0;
612
+ background-color: rgba(255, 255, 255, 0.8);
613
+ display: flex;
614
+ align-items: center;
615
+ justify-content: center;
616
+ `,_l=a.default.div`
617
+ position: absolute;
618
+ inset: 0;
619
+ background-color: ${e=>e.theme.color.white};
620
+ padding: ${e=>e.theme.space.md}px;
621
+ `,kl=a.default.div`
622
+ width: ${50}px;
623
+ padding-top: 60px;
624
+ display: flex;
625
+ flex-direction: column;
626
+ border-right: 1px solid ${e=>e.theme.color.grey2};
627
+ `,Wl=a.default.button`
628
+ border-radius: 4px;
629
+ cursor: pointer;
630
+ height: 42px;
631
+ margin: 4px;
632
+ width: 42px;
633
+ display: flex;
634
+ align-items: center;
635
+ justify-content: center;
636
+ background-color: ${e=>e.isActive?e.theme.color.grey2:e.theme.color.white};
637
+
638
+ ${(0,s.DashedFocusBorder)()}
639
+
640
+ &:hover {
641
+ background-color: ${e=>e.theme.color.grey2};
642
+ }
643
+ `,wl=(a.default.div`
644
+ display: flex;
645
+ border: 1px solid ${e=>e.theme.color.grey1};
646
+ border-radius: ${8}px;
647
+ margin-bottom: 24px;
648
+ input {
649
+ width: 100%;
650
+ border: 0;
651
+ height: ${50}px;
652
+ margin: 0;
653
+ }
654
+ `,a.default.div`
655
+ display: flex;
656
+ flex-direction: row;
657
+ padding: 12px;
658
+ background-color: ${e=>e.theme.color.grey0};
659
+ border-radius: 8px;
660
+ margin-bottom: 4px;
661
+ `,a.default.div`
662
+ display: flex;
663
+ flex: 1;
664
+ align-items: center;
665
+ `,a.default.div`
666
+ width: 40px;
667
+ display: flex;
668
+ justify-content: center;
669
+ align-items: center;
670
+ `,a.default.div`
671
+ flex-direction: row;
672
+ display: flex;
673
+ align-items: center;
674
+ `,a.default.div`
675
+ flex: 1;
676
+ display: flex;
677
+ align-items: center;
678
+ `,c.j.getLazyComponent("Button")),Sl=c.j.getLazyComponent("Icon"),Ml=({uniqid:e})=>{const t=(0,d.jL)(),i=(0,d.GV)(t=>r.WidgetEditor.selectors.selectEditor(t,e));return i&&i.popup&&i.view?(0,o.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"white",marginTop:90},children:[(0,o.jsxs)(jl,{children:[(0,o.jsx)(bl,{}),(0,o.jsx)(Cl,{children:"Popup"}),(0,o.jsx)(bl,{children:(0,o.jsx)(Wl,{onClick:()=>{t(r.WidgetEditor.slice.actions.flushEditorPopup({uniqid:e}))},children:(0,o.jsx)(Sl,{name:"icon-times",color:"grey2",size:26.75})})})]}),(0,o.jsx)("div",{style:{flex:1,display:"flex"},children:i.view}),(0,o.jsx)(jl,{children:(0,o.jsx)(wl,{onClick:()=>{t(r.WidgetEditor.slice.actions.flushEditorPopup({uniqid:e}))},children:"Save"})})]}):(0,o.jsx)(o.Fragment,{})};var Tl=i(3771);const ql=c.j.getLazyComponent("WidgetArticleTitleEditor"),Dl=c.j.getLazyComponent("WidgetArticleTextEditor"),Gl=c.j.getLazyComponent("WidgetArticleGalleryEditor"),zl=c.j.getLazyComponent("WidgetArticleAttachmentEditor"),Il=c.j.getLazyComponent("WidgetArticleSliderEditor"),Vl=c.j.getLazyComponent("WidgetArticleImageEditor"),Ol=c.j.getLazyComponent("WidgetButtonEditor"),Rl=c.j.getLazyComponent("WidgetCheckListEditor"),Bl=c.j.getLazyComponent("WidgetQuickSurveyEditor"),Hl=c.j.getLazyComponent("WidgetDatasourceTableEditor"),$l=c.j.getLazyComponent("WidgetExcelDatasourceTableEditor"),Fl=c.j.getLazyComponent("WidgetPresenceEditor"),Nl=c.j.getLazyComponent("WidgetLuccaAbsenceEditor"),Ul=c.j.getLazyComponent("WidgetEmailsImapEditor"),Pl=c.j.getLazyComponent("WidgetContactCardDavEditor"),Yl=c.j.getLazyComponent("WidgetCalendarCalDavEditor"),Ql=c.j.getLazyComponent("WidgetUserProfileEditor"),Jl=c.j.getLazyComponent("WidgetColorEditor"),Xl=c.j.getLazyComponent("WidgetWelcomeEditor"),Kl=c.j.getLazyComponent("WidgetExtensionEditor"),Zl=({uniqid:e})=>{const t=(0,d.jL)(),i=(0,d.GV)(r.Widget.selectors.selectToken),n=(0,d.GV)(t=>r.Widget.selectors.selectWidget(t,e),be.shallowEqual),a=(0,d.GV)(t=>r.WidgetEditor.selectors.selectEditor(t,e)?.onSave,be.shallowEqual),l=e=>r.Hook.selectors.selectHook(Tl.M.getState(),e)?.isActive,c=i=>{n&&t(r.Widget.slice.actions.updateWidget({uniqid:e,content:i})),t(r.WidgetEditor.slice.actions.flushEditor({uniqid:e})),a&&a(i)},u=(i,o)=>{t(void 0!==o?r.Widget.slice.actions.setWidgetState({uniqid:o,...i}):r.Widget.slice.actions.setWidgetState({uniqid:e,...i}))},g=i=>{t(r.WidgetEditor.slice.actions.registerEditorPopup({uniqid:e,view:i}))},m=n?.widget;return m?(0,E.ensureWidgetArticleButtonType)(m)?(0,o.jsx)(Ol,{...m.content,onChange:i=>{t((0,r.updateWidgetContent)(e,i,!1))},onSave:()=>c({})}):(0,E.ensureWidgetArticleGalleryType)(m)?(0,o.jsx)(Gl,{token:i,content:m.content,onChange:i=>t((0,r.updateWidgetContent)(e,i,!1)),onSave:c,onStateChange:u}):(0,E.ensureWidgetArticleAttachmentType)(m)?(0,o.jsx)(zl,{token:i,content:m.content,onChange:i=>{t((0,r.updateWidgetContent)(e,i,!1))},onSave:c,onStateChange:u,onOpen:g}):(0,E.ensureWidgetLuccaAbsenceType)(m)?(0,o.jsx)(Nl,{}):(0,E.ensureWidgetArticleImageType)(m)?(0,o.jsx)(Vl,{content:m.content,token:i,onChange:i=>{t((0,r.updateWidgetContent)(e,i,!1))},onSave:c,onStateChange:u}):(0,E.ensureWidgetArticleSliderType)(m)?void 0!==i?(0,o.jsx)(Il,{slides:m.content.slides??[],loop:m.content.loop??!1,useDots:m.content.useDots??!0,onChange:i=>{t((0,r.updateWidgetContent)(e,i,!1))},token:i,onSave:c}):(0,o.jsx)(o.Fragment,{children:"Token is mandatory"}):(0,E.ensureWidgetArticleTitleType)(m)?(0,o.jsx)(ql,{onChange:i=>{t((0,r.updateWidgetContent)(e,i,!1))},onSave:c,content:m.content,onOpen:g}):(0,E.ensureWidgetArticleTextType)(m)?(0,o.jsx)(Dl,{onChange:i=>{t((0,r.updateWidgetContent)(e,i,!1))},onSave:c,content:m.content}):(0,E.ensureWidgetPresenceType)(m)?(0,o.jsx)(Fl,{onChange:i=>{t((0,r.updateWidgetContent)(e,i,!1))},onSave:c,onStateChange:u,...m.content}):(0,E.ensureWidgetCheckListType)(m)?(0,o.jsx)(Rl,{token:i,uniqid:m.uniqid,content:{...m.content,arr:m.content.arr?.map(e=>({...e,title:s.Utils.html.htmlDecodeSpecialChars(e.title)}))},onChangeContent:(e,i)=>{t((0,r.updateWidgetContent)(e,i,!1))},onChangeWrapper:e=>{t(r.Widget.slice.actions.updateWidgetWrapper({...e,title:s.Utils.html.htmlDecodeSpecialChars(e.title)}))},handleChange:i=>t((0,r.updateWidgetContent)(e,i,!1))}):(0,E.ensureWidgetQuickSurveyType)(m)?(0,o.jsx)(Bl,{token:i,uniqid:m.uniqid,content:m.content,onChangeContent:(e,i)=>{t((0,r.updateWidgetContent)(e,i,!1))},onChangeWrapper:e=>{t(r.Widget.slice.actions.updateWidgetWrapper({...e}))},handleChange:i=>t((0,r.updateWidgetContent)(e,i,!1))}):(0,E.ensureWidgetExcelDatasourceTableType)(m)?(0,o.jsx)($l,{...m.content,uri:m.content.uri,limit:m.content.limit??20,hook:{isActive:l},handlers:{jamespot:{datasource:E.default.datasource,network:E.default.network,filebank:E.default.filebank,wedoc:E.default.wedoc},handleStart:()=>u({busy:!0}),handleCatch:e=>t(r.Toast.actions.error({label:e.errorMsg})),handleFinally:()=>u({busy:!1})},onSave:c,onChange:(i,o)=>t((0,r.updateWidgetContent)(e,i,o??!1)),onStateChange:u,onError:e=>t(r.Toast.actions.error({label:e}))}):(0,E.ensureWidgetEmailsImapType)(m)?(0,o.jsx)(Ul,{}):(0,E.ensureWidgetExtensionType)(m)?(0,o.jsx)(Kl,{extensionName:m.content.extensionName,onChange:(i,o)=>t((0,r.updateWidgetContent)(e,i,o??!1)),onSave:c,onStateChange:u}):(0,E.ensureWidgetContactCardDavType)(m)?(0,o.jsx)(Pl,{}):(0,E.ensureWidgetCalendarCalDavType)(m)?(0,o.jsx)(Yl,{}):(0,E.ensureWidgetDatasourceTableType)(m)?(0,o.jsx)(Hl,{...m.content,uri:m.content.uri,limit:m.content.limit??20,hook:{isActive:l},handlers:{jamespot:{datasource:E.default.datasource,network:E.default.network,application:E.default.application,filebank:E.default.filebank},handleStart:()=>u({busy:!0}),handleCatch:e=>t(r.Toast.actions.error({label:e.errorMsg})),handleFinally:()=>u({busy:!1})},onSave:c,onChange:(i,o)=>t((0,r.updateWidgetContent)(e,i,o??!1)),onStateChange:u,onError:e=>{t(r.Toast.actions.error({label:e}))}}):(0,E.ensureWidgetUserProfileType)(m)?(0,o.jsx)(Ql,{uniqid:m.uniqid,content:m.content,onChangeContent:(e,i)=>{t((0,r.updateWidgetContent)(e,i,!1))}}):(0,E.ensureWidgetColorType)(m)?(0,o.jsx)(Jl,{uniqid:m.uniqid,content:m.content,onChangeContent:(e,i)=>{t((0,r.updateWidgetContent)(e,i,!1))}}):(0,E.ensureWidgetWelcomeType)(m)?(0,o.jsx)(Xl,{uniqid:m.uniqid,content:m.content,onChangeContent:(e,i)=>{t((0,r.updateWidgetContent)(e,i,!1))}}):(0,o.jsx)(o.Fragment,{children:"cannot display editor"}):null},es=c.j.getLazyComponent("Icon"),ts=({uniqid:e,position:t})=>{const i=(0,d.jL)(),n=(0,a.useTheme)();return(0,o.jsx)(bl,{children:(0,o.jsx)(Wl,{onClick:()=>{i(r.WidgetEditor.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))},children:(0,o.jsx)(es,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:n.color.lavender,size:26.75})})})},is=c.j.getLazyComponent("InputColorRaw"),os=a.default.label`
679
+ margin-left: 2px;
680
+ margin-right: 2px;
681
+ margin-bottom: 8px;
682
+ font-size: 14px;
683
+ width: 100%;
684
+ min-height: 20px;
685
+ `,ns=a.default.fieldset`
686
+ margin: 12px 0px !important;
687
+ width: 100% !important;
688
+ `,as=({label:e,initialValue:t,handleChange:i})=>{const n=(0,a.useTheme)(),s=[{name:(0,l.A)().formatMessage({id:"GLOBAL_Platform_Color"}),colors:[n.color.primary,n.color.secondary,n.color.headerColor,n.color.lavender,n.color.orange,n.color.green,n.color.navy,n.color.overseas,n.color.transparentHexa]}];return(0,o.jsxs)(ns,{children:[(0,o.jsx)(os,{children:(0,o.jsx)(T.A,{id:e})}),(0,o.jsx)(is,{palettes:s,label:e,initialValue:t??n.color.primary,name:"background-color",onChange:i})]})},ls=c.j.getLazyComponent("InputNumber"),ss=({label:e,initialValue:t,handleChange:i})=>{const a=(0,l.A)(),{control:s,watch:r}=(0,q.useForm)({defaultValues:{value:t??"0"},criteriaMode:"all"});return(0,n.useEffect)(()=>{const e=r(e=>{i(e.value??"")});return()=>e.unsubscribe()},[r,i]),(0,o.jsx)(ls,{label:e,name:"value",width:"100%",control:s,placeholder:a.formatMessage({id:e})})},rs=c.j.getLazyComponent("InputSelectExtended"),ds=({label:e,options:t=[],initialValue:i,required:a=!1,handleChange:l})=>{const s=(0,n.useMemo)(()=>i&&t.find(e=>e.value===i)?t.find(e=>e.value===i):t[0],[i,t]),{control:r,watch:d}=(0,q.useForm)({defaultValues:{select:s},criteriaMode:"all"});return(0,n.useEffect)(()=>{const e=d(e=>{l(e.select.value)});return()=>e.unsubscribe()},[d,l]),(0,o.jsx)(rs,{options:t,label:e,getValue:e=>e.value,getLabel:"label",getSearch:"label",rules:{required:a},hideDeleteIcon:!0,required:a,control:r,name:"select"})},cs=c.j.getLazyComponent("InputText"),us=({uniqid:e})=>{const t=(0,l.A)(),i=(0,d.jL)(),s=(0,d.GV)(t=>r.Widget.selectors.selectWidget(t,e)),c=(0,d.GV)(t=>r.Widget.selectors.selectWidgetContext(t,e),be.shallowEqual),u=(0,a.useTheme)(),g=(0,d.GV)(t=>r.Widget.selectors.selectWidgetTitleStyle(t,e),be.shallowEqual),{control:m,watch:p}=(0,q.useForm)({defaultValues:{text:s?.title.replace(/&amp;/g,"&")??""},criteriaMode:"all"});(0,n.useEffect)(()=>{const t=p(t=>{i(r.Widget.slice.actions.updateWidgetWrapper({uniqid:e,title:t.text}))});return()=>t.unsubscribe()},[p,e,i]);const h=(0,n.useMemo)(()=>({color:g&&g.color?String(g.color):u.color.black,backgroundColor:g&&g["background-color"]?String(g["background-color"]):"transparent",fontSize:g&&g["font-size"]?String(g["font-size"]):"24",fontWeight:g&&g["font-weight"]?String(g["font-weight"]):"medium",textAlign:g&&g["text-align"]?String(g["text-align"]):"left"}),[g,u]),f=(0,n.useCallback)((t,o)=>{i(r.Widget.slice.actions.setWidgetTitleStyle({uniqid:e,styles:{[t]:o}}))},[i,e]);return s?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(cs,{name:"text",label:"WIDGET_Title",width:"100%",control:m,placeholder:t.formatMessage({id:"WIDGET_Title"})}),"comment"!==c&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(as,{label:"STYLE_Text_Color",initialValue:h.color,handleChange:e=>f("color",e)}),(0,o.jsx)(as,{label:"STYLE_Background_Color",initialValue:h.backgroundColor,handleChange:e=>f("background-color",e)}),(0,o.jsx)(ss,{label:"STYLE_Text_Size",initialValue:h.fontSize,handleChange:e=>f("font-size",e)}),(0,o.jsx)(ds,{label:"STYLE_Font_Weight",initialValue:h.fontWeight,options:[{label:t.formatMessage({id:"STYLE_Font_Weight_Normal"}),value:"normal"},{label:t.formatMessage({id:"STYLE_Font_Weight_Medium"}),value:"medium"},{label:t.formatMessage({id:"STYLE_Font_Weight_Bold"}),value:"bold"}],required:!1,handleChange:e=>f("font-weight",e)}),(0,o.jsx)(ds,{label:"STYLE_Text_Align",initialValue:h.textAlign,options:[{label:t.formatMessage({id:"STYLE_Text_Align_Left"}),value:"left"},{label:t.formatMessage({id:"STYLE_Text_Align_Center"}),value:"center"},{label:t.formatMessage({id:"STYLE_Text_Align_Justify"}),value:"justify"},{label:t.formatMessage({id:"STYLE_Text_Align_Right"}),value:"right"}],required:!1,handleChange:e=>f("text-align",e)})]})]}):(0,o.jsx)(o.Fragment,{})},gs=c.j.getLazyComponent("Loader"),ms=({uniqid:e})=>{const t=(0,d.GV)(t=>r.Widget.selectors.selectWidgetState(t,e),be.shallowEqual)?.busy;return(0,o.jsx)(o.Fragment,{children:t&&(0,o.jsx)(Al,{children:(0,o.jsx)(gs,{size:"l"})})})},ps=({uniqid:e})=>{const t=(0,l.A)(),i=(0,d.GV)(t=>r.Widget.selectors.selectWidgetState(t,e),be.shallowEqual)?.locked;return i?(0,o.jsx)(_l,{children:t.formatMessage({id:"INTRANET_Panel_Change_Off"})}):(0,o.jsx)(o.Fragment,{})},hs=c.j.getLazyComponent("Button"),fs=({uniqid:e,mode:t})=>{const i=(0,l.A)(),n=(0,d.jL)(),a=(0,d.GV)(t=>r.Widget.selectors.selectWidget(t,e),be.shallowEqual),s=(0,d.GV)(t=>r.Widget.selectors.selectWidgetObjectUri(t,e),be.shallowEqual);return(0,o.jsx)(hs,{color:"valid",onClick:()=>{n(r.WidgetEditor.slice.actions.flushEditor({uniqid:e}));const o=a&&a.widget&&a.widget.content;s&&a&&o&&("view"==t&&E.default.widget.updateWidget({uri:s,uniqid:e,title:a.title,content:o,v2:!0}).catch(e=>{n(r.Toast.actions.error({label:e.errorMsg??i.formatMessage({id:"GLOBAL_Error"})}))}),"edit"===t&&n(r.Widget.slice.actions.updateWidget({uniqid:e,content:o})))},children:i.formatMessage({id:"GLOBAL_Save"})})},xs=({uniqid:e})=>{const t=(0,a.useTheme)(),i=(0,d.jL)(),s=(0,l.A)(),c=(0,d.GV)(t=>r.Widget.selectors.selectWidgetWrapperStyle(t,e),be.shallowEqual),u=(0,n.useMemo)(()=>({color:c&&c.color?String(c.color):t.color.black,backgroundColor:c&&c["background-color"]?String(c["background-color"]):t.color.white,padding:c&&c.padding?String(c.padding):"0",borderRadius:c&&c["border-radius"]?String(c["border-radius"]):"0",borderColor:c["border-color"]?String(c["border-color"]):t.color.black,borderWidth:c["border-width"]?String(c["border-width"]):"0",borderStyle:c["border-style"]?String(c["border-style"]):"none"}),[c,t]),g=(0,n.useCallback)((t,o)=>{i(r.Widget.slice.actions.setWidgetWrapperStyle({uniqid:e,styles:{[t]:o}}))},[e,i]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(as,{label:"STYLE_Background_Color",initialValue:u.backgroundColor,handleChange:e=>g("background-color",e)}),(0,o.jsx)(as,{label:"STYLE_Text_Color",initialValue:u.color,handleChange:e=>g("color",e)}),(0,o.jsx)("hr",{}),(0,o.jsx)(ss,{label:"STYLE_Padding",initialValue:u.padding,handleChange:e=>g("padding",String(e))}),(0,o.jsx)(ss,{label:"STYLE_Radius",initialValue:u.borderRadius,handleChange:e=>g("border-radius",String(e))}),(0,o.jsx)(ds,{label:"STYLE_Border_Style",initialValue:u.borderStyle,options:[{label:s.formatMessage({id:"STYLE_Border_Style_None"}),value:"none"},{label:s.formatMessage({id:"STYLE_Border_Style_Solid"}),value:"solid"},{label:s.formatMessage({id:"STYLE_Border_Style_Dashed"}),value:"dashed"},{label:s.formatMessage({id:"STYLE_Border_Style_Dotted"}),value:"dotted"}],required:!1,handleChange:e=>{g("border-style",e),"none"!==e&&g("border-color",t.color.black),"none"!==e&&g("border-width","1")}}),"string"==typeof u.borderStyle&&"none"!==u.borderStyle&&(0,o.jsx)(as,{label:"STYLE_Border_Color",initialValue:u.borderColor,handleChange:e=>g("border-color",e)}),"string"==typeof u.borderStyle&&"none"!==u.borderStyle&&(0,o.jsx)(ss,{label:"STYLE_Border_Width",initialValue:u.borderWidth,handleChange:e=>g("border-width",e)})]})},js=({uniqid:e})=>{const t=(0,d.jL)(),i=(0,l.A)(),a=(0,d.GV)(t=>r.WidgetEditor.selectors.selectEditor(t,e),be.shallowEqual),s=r.Widget.definition(a?.name),c=(0,d.GV)(t=>r.Widget.selectors.selectWidgetLevel(t,e),be.shallowEqual),u=(0,n.useCallback)(i=>{t(r.Widget.slice.actions.updateWidgetWrapper({uniqid:e,level:Number(i)}))},[e,t]);return(0,o.jsx)(ds,{handleChange:u,required:!0,label:"WIDGET_Display_Level_Select",initialValue:c?String(c):"3",options:[{label:i.formatMessage({id:"WIDGET_Display_Level_1"}),value:"1"},{label:i.formatMessage({id:"WIDGET_Display_Level_2"}),value:"2"},{label:i.formatMessage({id:"WIDGET_Display_Level_3"}),value:"3"},{label:i.formatMessage({id:"WIDGET_Display_Level_4"}),value:"4"}].filter(e=>Array.isArray(s.displayLevel)?s.displayLevel.includes(Number(e.value)):[])})},bs=["widget-presence","widget-quick-survey","widget-check-list","widget-emails-imap","widget-contact-cardDav","widget-calendar-calDav"],Cs=c.j.getLazyComponent("Icon"),ys=c.j.getLazyComponent("Tooltip"),vs=({uniqid:e,position:t})=>{const i=(0,l.A)(),s=(0,d.jL)(),c=(0,a.useTheme)(),u=(0,n.useRef)(null),g=(0,d.GV)(t=>r.WidgetEditor.selectors.selectEditor(t,e),be.shallowEqual),m=r.Widget.definition(g?.name),p=(0,n.useMemo)(()=>void 0!==m.displayLevel&&Array.isArray(m.displayLevel)&&0!==m.displayLevel.length,[m]),h=(0,n.useMemo)(()=>[{name:"widget-title",label:i.formatMessage({id:"PANEL_Title"}),enable:m.panel.useWrapper,icon:"icon-font"},{name:"widget-selection",label:i.formatMessage({id:"PANEL_Widget_Selection"}),enable:m.panel.useSelection,icon:"icon-sliders"},{name:"widget-settings",label:i.formatMessage({id:"PANEL_Widget_Settings"}),enable:m.panel.useEditor,icon:"icon-pen"},{name:"widget-level",label:i.formatMessage({id:"PANEL_Widget_Level"}),enable:p,icon:"icon-edit"}],[m,i,p]),f=(0,n.useMemo)(()=>m.panel.useEditor?h.find(e=>"widget-settings"===e.name):h.filter(e=>e.enable)[0],[m,h]),[x,j]=(0,n.useState)(f);return(0,n.useEffect)(()=>{setTimeout(()=>{u&&u.current&&(u.current.className=u.current.className+" animate")},0)},[]),g?(0,o.jsxs)(yl,{children:[(0,o.jsxs)(vl,{ref:u,position:t,children:[(0,o.jsx)(kl,{children:h.filter(e=>e.enable).map(e=>(0,o.jsx)(Wl,{isActive:x&&x.name===e.name,onClick:()=>j(e),children:(0,o.jsx)(ys,{position:"left",description:e.label,children:(0,o.jsx)(Cs,{name:e.icon,color:x&&x.name===e.name?c.color.white:c.color.lavender})})},e.name))}),(0,o.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",width:"390px"},children:[(0,o.jsxs)(jl,{children:[(0,o.jsx)(ts,{uniqid:e,position:g.position}),(0,o.jsx)(Cl,{children:(0,o.jsx)("h3",{children:x?x.label:i.formatMessage({id:m.label})})}),(0,o.jsx)(bl,{children:(0,o.jsx)(Wl,{onClick:()=>{s(r.WidgetEditor.slice.actions.flushEditor({uniqid:e}))},children:(0,o.jsx)(Cs,{name:"icon-times",color:c.color.lavender,size:26.75})})})]}),(0,o.jsxs)(Ll,{children:[(0,o.jsxs)(El,{children:[x&&"widget-settings"===x.name&&m.panel.useEditor&&(0,o.jsx)(Zl,{uniqid:g.uniqid}),x&&"widget-title"===x.name&&m.panel.useWrapper&&(0,o.jsx)(us,{uniqid:g.uniqid}),x&&"widget-selection"===x.name&&(0,o.jsx)(xs,{uniqid:e}),x&&"widget-level"===x.name&&p&&(0,o.jsx)(js,{uniqid:e})]}),(0,o.jsx)(ms,{uniqid:e}),(0,o.jsx)(ps,{uniqid:e}),bs.includes(g.name)&&(0,o.jsx)(fs,{uniqid:e,mode:g.mode})]})]})]}),g?.popup?(0,o.jsx)("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):(0,o.jsx)(o.Fragment,{})]}):(0,o.jsx)(o.Fragment,{})},Ls=a.default.div`
689
+ position: absolute;
690
+ inset: 0;
691
+ pointer-events: none;
692
+ z-index: 1;
693
+ `,Es=a.default.div`
694
+ flex: 1;
695
+ display: flex;
696
+ margin-top: ${90}px;
697
+ pointer-events: ${e=>e.isActive?"all":"none"};
698
+ `,As=a.default.div`
699
+ flex: 1;
700
+ display: flex;
701
+ flex-direction: row;
702
+ pointer-events: none;
703
+ `,_s=a.default.div`
704
+ width: ${440}px;
705
+ pointer-events: none;
706
+ `,ks=()=>{const e=(0,d.jL)();(0,n.useEffect)(()=>{const t=()=>{e(r.WidgetEditor.slice.actions.flushAllEditor())};return window.addEventListener("NGWidgetEditorFlushAll",t),()=>{window.removeEventListener("NGWidgetEditorFlushAll",t)}},[e]);const t=(0,d.GV)(r.WidgetEditor.selectors.selectEditors,be.shallowEqual);return(0,o.jsx)(Ls,{className:"editor-portal-wrapper",children:t.map(e=>(0,o.jsx)(xl,{isActive:!1,children:(0,o.jsx)(As,{children:"left"===e.position?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(vs,{uniqid:e.uniqid,position:e.position}),(0,o.jsx)(Es,{isActive:void 0!==e.popup,children:(0,o.jsx)(Ml,{uniqid:e.uniqid})}),(0,o.jsx)(_s,{})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(_s,{}),(0,o.jsx)(Es,{isActive:void 0!==e.popup,children:(0,o.jsx)(Ml,{uniqid:e.uniqid})}),(0,o.jsx)(vs,{uniqid:e.uniqid,position:e.position})]})})},e.uniqid))})},Ws=()=>(0,o.jsx)(o.Fragment,{}),ws=c.j.getLazyComponent("Container"),Ss=()=>(0,o.jsx)(n.Suspense,{fallback:(0,o.jsx)(o.Fragment,{}),children:(0,o.jsx)(ws,{backgroundColor:"white",mode:"fluid",flexDirection:"column",children:(0,o.jsx)(Z.sv,{})})}),Ms=c.j.getLazyComponent("InputTinyMCERaw"),Ts=e=>{const t=(0,l.A)(),i=(0,d.jL)(),s=(0,a.useTheme)(),c=(0,d.GV)(r.Model.selectors.selectAll),{query:u,ext:g,isActive:m}=qn(),{open:p,onInsert:h,close:f,ext:x,isActive:j}=xe(),b=(0,n.useMemo)(()=>[...j?[x]:[],...m?[g]:[]],[g,x,m,j]),C=(0,n.useCallback)(e=>{i(r.Toast.actions.error({label:e??t.formatMessage({id:"GLOBAL_Error"})}))},[i,t]),y=(0,n.useMemo)(()=>(0,je.X)(c,s,C),[c,C,s]),v=(0,n.useMemo)(()=>Tn.p9,[]);return(0,o.jsxs)(o.Fragment,{children:[v&&(0,o.jsx)(Ms,{commonOptions:v,additionalExtensions:b,mentionsQueries:y,...e}),m&&(0,o.jsx)(M,{query:u}),j&&(0,o.jsx)(ft,{onInsert:h,open:p,close:f})]})};var qs=i(3570);const Ds=c.j.getLazyComponent("Container"),Gs=c.j.getLazyComponent("AppColumn"),zs=c.j.getLazyComponent("MainColumn");function Is({extensionRoute:e,routes:t,description:i,mode:a="center",mainColumnProps:s}){const r=(0,l.A)(),{pathname:d}=(0,Z.zy)(),c=(0,n.useMemo)(()=>Object.values(t),[t]),[u,g]=(0,n.useState)(c?.[0]?.key),m=c.map(t=>({...t,label:r.formatMessage({id:t.label}),href:t.absolutePath?t.path:`/ng/rr/${e}/${t.path}`,group:t.group?r.formatMessage({id:t.group}):void 0}));return(0,n.useEffect)(()=>{const t=c.find(t=>`/ng/rr/${e}/${t.path}`===d||t.paths?.reduce((t,i)=>{const o=`/ng/rr/${e}/${i}`,n=null!==(0,qs.B6)(o,d);return t||n},!1));t&&g(t.key)},[d,c,e]),(0,o.jsx)(n.Suspense,{fallback:(0,o.jsx)(o.Fragment,{}),children:(0,o.jsxs)(Ds,{mode:a,children:[(0,o.jsx)(Gs,{mode:a,description:i,tabs:m,activeTab:u||""}),(0,o.jsx)(zs,{mode:a,flex:!0,...s,children:(0,o.jsx)(Z.sv,{})})]})})}}}]);
707
+ //# sourceMappingURL=605.e14ede6ac53f82a861c7.chunk.js.map