jamespot-react-core 1.2.31 → 1.2.33

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.
@@ -1,9 +1,11 @@
1
- "use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[199],{199:(e,t,n)=>{n.r(t),n.d(t,{AIModal:()=>M,AddReportModal:()=>Z,Audience:()=>x,Avatar:()=>g,CommentsBloc:()=>Jl,DisplayForm:()=>F,Editor:()=>Ge,EditorsPortal:()=>ut,Empty:()=>Ql,FullPageLayout:()=>Zl,JRCInputTinyMCEWithExt:()=>io,JRCInputTinyMCEWithExtRaw:()=>oo,MarkdownModal:()=>jn,ModalAudience:()=>co,TwoColLayout:()=>po,WidgetList:()=>Wt,WidgetWrapperCore:()=>Vl});var i=n(594),l=n.n(i),o=n(196),a=n.n(o),r=n(493),s=n(752),c=n(585),d=n(996),u=n(683);const m=d.j.getLazyComponent("Icon"),g=e=>{var t;const n=(0,o.useTheme)(),i=(0,u.GV)(c.Bx.selectors.selectNetworkPublic);return e.uri===(null==i?void 0:i.uri)?l().createElement(m,{name:"icon-fs-wall",size:8*(null!==(t=e.size)&&void 0!==t?t:3),color:n.color.primary,variant:"circle"}):l().createElement(s.JRCAvatar,Object.assign({},e))},p=d.j.getLazyComponent("FlexBox"),f=d.j.getLazyComponent("ModalContent"),E=d.j.getLazyComponent("ModalLayout"),h=d.j.getLazyComponent("StyledHref"),b=d.j.getLazyComponent("Tooltip"),v=d.j.getLazyComponent("Typography"),y=a().div`
1
+ "use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[199],{199:(e,t,n)=>{n.r(t),n.d(t,{AIModal:()=>T,AddReportModal:()=>ee,Audience:()=>w,Avatar:()=>p,CommentsBloc:()=>Ql,DisplayForm:()=>$,Editor:()=>De,EditorsPortal:()=>mt,Empty:()=>Kl,FullPageLayout:()=>eo,JRCInputTinyMCEWithExt:()=>lo,JRCInputTinyMCEWithExtRaw:()=>ao,MarkdownModal:()=>Mn,ModalAudience:()=>uo,TwoColLayout:()=>fo,WidgetList:()=>_t,WidgetWrapperCore:()=>Fl});var i=n(594),l=n.n(i),o=n(196),a=n.n(o),r=n(493),s=n(576),c=n(207),d=n(996),u=n(683);const m=d.j.getLazyComponent("Icon"),g=a().span`
2
+ ${s.SROnly}
3
+ `,p=e=>{var t;const n=(0,o.useTheme)(),i=(0,r.useIntl)(),a=(0,u.GV)(c.Bx.selectors.selectNetworkPublic);return e.uri===(null==a?void 0:a.uri)?l().createElement(l().Fragment,null,l().createElement(m,{name:"icon-fs-wall",size:8*(null!==(t=e.size)&&void 0!==t?t:3),color:n.color.primary,variant:"circle"}),l().createElement(g,null,i.formatMessage({id:"NETWORK_Public"}))):l().createElement(s.JRCAvatar,Object.assign({},e))},f=d.j.getLazyComponent("FlexBox"),E=d.j.getLazyComponent("ModalContent"),h=d.j.getLazyComponent("ModalLayout"),b=d.j.getLazyComponent("StyledHref"),v=d.j.getLazyComponent("Tooltip"),y=d.j.getLazyComponent("Typography"),C=a().div`
2
4
  display: flex;
3
5
  flex-direction: column;
4
6
  gap: 12px;
5
7
  margin-bottom: 24px;
6
- `,C=a().a`
8
+ `,x=a().a`
7
9
  display: flex;
8
10
  justify-content: center;
9
11
  align-items: center;
@@ -17,20 +19,20 @@
17
19
  border: 4px solid ${e=>e.theme.color.white};
18
20
  margin-left: ${e=>e.overlap?"-18px":"0"};
19
21
  cursor: pointer;
20
- `,x=({audience:e,limit:t=2})=>{const n=(0,r.useIntl)(),a=(0,o.useTheme)(),[c,d]=(0,i.useState)(!1);return l().createElement(l().Fragment,null,l().createElement(p,null,[...e].splice(0,t).map(((e,t)=>l().createElement(C,{overlap:0!==t,href:e._url,target:"_blank",key:e.id},l().createElement(b,{description:void 0===e.title?" ":e.title,position:"left"},l().createElement(g,{uri:e.uri,size:4,variant:"circle",alt:"image",timestamp:e.dateModified?s.Utils.date.strToTimestamp(e.dateModified):void 0,focusable:!0}))))),e.length>t&&l().createElement(C,{onClick:()=>d(!0),overlap:!0},"+",e.length-t)),e.length>t&&l().createElement(E,{closeHandler:()=>d(!1),enableClickAwayCloseModal:!0,open:c,variant:"fixed-height",maxHeight:"800px"},l().createElement(f,{title:n.formatMessage({id:"GLOBAL_Audience"}),overflow:"scroll",onClickIconClose:()=>d(!1)},l().createElement(y,null,e.map(((e,t)=>l().createElement(p,{key:`audience-${t}`,y:"center",gap:a.space.l},l().createElement(g,{size:5,uri:`${e.type}/${e.id}`}),l().createElement(h,{href:`${e.type}/${e.id}`},l().createElement(v,null,e.title)))))))))};var w=n(833),k=n.n(w);const L=d.j.getLazyComponent("Loader"),W=d.j.getLazyComponent("ModalContent"),_=d.j.getLazyComponent("ModalLayout"),q=d.j.getLazyComponent("Typography"),S=a().div`
22
+ `,w=({audience:e,limit:t=2})=>{const n=(0,r.useIntl)(),a=(0,o.useTheme)(),[c,d]=(0,i.useState)(!1);return l().createElement(l().Fragment,null,l().createElement(f,null,[...e].splice(0,t).map(((e,t)=>l().createElement(x,{overlap:0!==t,href:e._url,target:"_blank",key:e.id},l().createElement(v,{description:void 0===e.title?" ":e.title,position:"left"},l().createElement(p,{uri:e.uri,size:4,variant:"circle",alt:"image",timestamp:e.dateModified?s.Utils.date.strToTimestamp(e.dateModified):void 0,focusable:!0}))))),e.length>t&&l().createElement(x,{onClick:()=>d(!0),overlap:!0},"+",e.length-t)),e.length>t&&l().createElement(h,{closeHandler:()=>d(!1),enableClickAwayCloseModal:!0,open:c,variant:"fixed-height",maxHeight:"800px"},l().createElement(E,{title:n.formatMessage({id:"GLOBAL_Audience"}),overflow:"scroll",onClickIconClose:()=>d(!1)},l().createElement(C,null,e.map(((e,t)=>l().createElement(f,{key:`audience-${t}`,y:"center",gap:a.space.l},l().createElement(p,{size:5,uri:`${e.type}/${e.id}`}),l().createElement(b,{href:`${e.type}/${e.id}`},l().createElement(y,null,e.title)))))))))};var k=n(833),L=n.n(k);const W=d.j.getLazyComponent("Loader"),_=d.j.getLazyComponent("ModalContent"),q=d.j.getLazyComponent("ModalLayout"),S=d.j.getLazyComponent("Typography"),j=a().div`
21
23
  padding: ${e=>e.theme.space.md}px;
22
- `,j={response:void 0,loading:!0,error:void 0},M=({query:e})=>{const t=(0,r.useIntl)(),[n,a]=(0,i.useState)(j),s=(0,o.useTheme)(),c=(0,i.useCallback)((e=>{a(j),k().jia.textEnhancement({text:e.text,capacity:e.capability}).then((e=>{if(e.error)return void a({error:`${t.formatMessage({id:"JIA_ERROR_AI_CALL"})}${e.errorMsg&&": "+e.errorMsg}`,loading:!1,response:void 0});const n=e.result.text;a({error:void 0,loading:!1,response:n})})).catch((e=>{a({error:t.formatMessage({id:"JIA_ERROR_AI_CALL"}),loading:!1,response:void 0})}))}),[t]);return(0,i.useEffect)((()=>{e&&e.text.trim().length>0&&c(e)}),[e,c]),l().createElement(_,{zIndex:s.zIndex.tinyMCEModal,open:!!e,closeHandler:()=>{null==e||e.reject()}},l().createElement(W,{overflow:"scroll",buttons:[{children:t.formatMessage({id:"GLOBAL_Try_Again"}),clickHandler:()=>{e&&c(e)}},{children:t.formatMessage({id:"GLOBAL_Validation"}),clickHandler:()=>n.response&&(null==e?void 0:e.resolve(n.response))},{children:t.formatMessage({id:"GLOBAL_Cancel"}),clickHandler:()=>null==e?void 0:e.reject()}],isFull:!0},l().createElement(S,null,n.loading&&l().createElement(l().Fragment,null,l().createElement(L,null),l().createElement(q,{align:"center"},t.formatMessage({id:"JIA_WAITING_WARNIG"}))),!n.loading&&n.error&&l().createElement("p",null,n.error),!n.loading&&n.response&&l().createElement("p",null,n.response))))};var T=n(655),A=n(571),I=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(i=Object.getOwnPropertySymbols(e);l<i.length;l++)t.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(e,i[l])&&(n[i[l]]=e[i[l]])}return n};const O=o.css`
24
+ `,M={response:void 0,loading:!0,error:void 0},T=({query:e})=>{const t=(0,r.useIntl)(),[n,a]=(0,i.useState)(M),s=(0,o.useTheme)(),c=(0,i.useCallback)((e=>{a(M),L().jia.textEnhancement({text:e.text,capacity:e.capability}).then((e=>{if(e.error)return void a({error:`${t.formatMessage({id:"JIA_ERROR_AI_CALL"})}${e.errorMsg&&": "+e.errorMsg}`,loading:!1,response:void 0});const n=e.result.text;a({error:void 0,loading:!1,response:n})})).catch((e=>{a({error:t.formatMessage({id:"JIA_ERROR_AI_CALL"}),loading:!1,response:void 0})}))}),[t]);return(0,i.useEffect)((()=>{e&&e.text.trim().length>0&&c(e)}),[e,c]),l().createElement(q,{zIndex:s.zIndex.tinyMCEModal,open:!!e,closeHandler:()=>{null==e||e.reject()}},l().createElement(_,{overflow:"scroll",buttons:[{children:t.formatMessage({id:"GLOBAL_Try_Again"}),clickHandler:()=>{e&&c(e)}},{children:t.formatMessage({id:"GLOBAL_Validation"}),clickHandler:()=>n.response&&(null==e?void 0:e.resolve(n.response))},{children:t.formatMessage({id:"GLOBAL_Cancel"}),clickHandler:()=>null==e?void 0:e.reject()}],isFull:!0},l().createElement(j,null,n.loading&&l().createElement(l().Fragment,null,l().createElement(W,null),l().createElement(S,{align:"center"},t.formatMessage({id:"JIA_WAITING_WARNIG"}))),!n.loading&&n.error&&l().createElement("p",null,n.error),!n.loading&&n.response&&l().createElement("p",null,n.response))))};var A=n(655),I=n(571),O=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(i=Object.getOwnPropertySymbols(e);l<i.length;l++)t.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(e,i[l])&&(n[i[l]]=e[i[l]])}return n};const z=o.css`
23
25
  height: 100%;
24
26
  display: flex;
25
27
  flex-direction: column;
26
28
  justify-content: space-between;
27
- `,z=a().div`
28
- ${({stretch:e})=>e&&O}
29
- `,G=a().form`
30
- ${({stretch:e})=>e&&O}
31
- `,D=(0,i.forwardRef)(((e,t)=>e.onSubmit?l().createElement(G,{stretch:e.stretch,onSubmit:e.onSubmit,ref:t,"data-cy":e.dataCy},e.children):l().createElement(z,{stretch:e.stretch,ref:t,"data-cy":e.dataCy},e.children))),V=a().div`
29
+ `,G=a().div`
30
+ ${({stretch:e})=>e&&z}
31
+ `,D=a().form`
32
+ ${({stretch:e})=>e&&z}
33
+ `,V=(0,i.forwardRef)(((e,t)=>e.onSubmit?l().createElement(D,{stretch:e.stretch,onSubmit:e.onSubmit,ref:t,"data-cy":e.dataCy},e.children):l().createElement(G,{stretch:e.stretch,ref:t,"data-cy":e.dataCy},e.children))),F=a().div`
32
34
  ${e=>e.stretch&&"\n flex: 1;\n"}
33
- `,F=(0,i.forwardRef)(((e,t)=>{var{onInit:n}=e,o=I(e,["onInit"]);const a=(0,i.useRef)(null),[r,s]=(0,A.SC)(o.fields,o.type,o.forceMandatory),[c,d]=(0,i.useState)(!1),u=(0,T.useForm)({defaultValues:Object.assign(Object.assign({},s),o.defaultValues),criteriaMode:"all"}),{handleSubmit:m,control:g,reset:p}=u,f=I(u,["handleSubmit","control","reset"]);(0,i.useEffect)((()=>{n&&!c&&(n(f),d(!0))}),[n,f,c]);const E=(0,i.useCallback)((e=>{const t={};return Object.keys(e).forEach((n=>{var i;const l=null===(i=r.find((e=>e.name===n)))||void 0===i?void 0:i.widget;switch(null==l?void 0:l.type){case"audience":t[n]=e[n].map((e=>e.uri)).join(",");break;case"taxonomy":t[n]=e[n].map((e=>e.title)).join(",");break;case"toggle":t[n]=e[n]?"1":"0";break;default:t[n]=e[n]}})),t}),[r]);return(0,i.useImperativeHandle)(t,(()=>Object.assign(Object.assign({},f),{handleSubmit:m,control:g,reset:()=>{var e;null===(e=null==a?void 0:a.current)||void 0===e||e.scrollTo(0,0),p()},getFormattedValues:()=>E(f.getValues())})),[]),l().createElement(D,{dataCy:o.dataCy,stretch:o.stretch,onSubmit:o.onSubmit?m(o.onSubmit):void 0,ref:a},l().createElement(V,{stretch:o.stretch},r.map((e=>{var{Input:t}=e,n=I(e,["Input"]);return l().createElement(t,Object.assign({key:n.name,control:g},n,{dataCy:`${o.dataCy}-${n.name}`,readOnly:o.readOnly}))})),o.extraInputs&&o.extraInputs(g)),o.buttons)}));var $=n(491),R=function(e,t,n,i){return new(n||(n=Promise))((function(l,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function r(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?l(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}s((i=i.apply(e,t||[])).next())}))};const B=d.j.getLazyComponent("ModalForm"),H=d.j.getLazyComponent("Loader"),P=d.j.getLazyComponent("Icon"),U=d.j.getLazyComponent("Typography"),N=d.j.getLazyComponent("Ellipsis"),Y=d.j.getLazyComponent("StyledHref"),Q=a().div`
35
+ `,$=(0,i.forwardRef)(((e,t)=>{var{onInit:n}=e,o=O(e,["onInit"]);const a=(0,i.useRef)(null),[r,s]=(0,I.SC)(o.fields,o.type,o.forceMandatory),[c,d]=(0,i.useState)(!1),u=(0,A.useForm)({defaultValues:Object.assign(Object.assign({},s),o.defaultValues),criteriaMode:"all"}),{handleSubmit:m,control:g,reset:p}=u,f=O(u,["handleSubmit","control","reset"]);(0,i.useEffect)((()=>{n&&!c&&(n(f),d(!0))}),[n,f,c]);const E=(0,i.useCallback)((e=>{const t={};return Object.keys(e).forEach((n=>{var i;const l=null===(i=r.find((e=>e.name===n)))||void 0===i?void 0:i.widget;switch(null==l?void 0:l.type){case"audience":t[n]=e[n].map((e=>e.uri)).join(",");break;case"taxonomy":t[n]=e[n].map((e=>e.title)).join(",");break;case"toggle":t[n]=e[n]?"1":"0";break;default:t[n]=e[n]}})),t}),[r]);return(0,i.useImperativeHandle)(t,(()=>Object.assign(Object.assign({},f),{handleSubmit:m,control:g,reset:()=>{var e;null===(e=null==a?void 0:a.current)||void 0===e||e.scrollTo(0,0),p()},getFormattedValues:()=>E(f.getValues())})),[]),l().createElement(V,{dataCy:o.dataCy,stretch:o.stretch,onSubmit:o.onSubmit?m(o.onSubmit):void 0,ref:a},l().createElement(F,{stretch:o.stretch},r.map((e=>{var{Input:t}=e,n=O(e,["Input"]);return l().createElement(t,Object.assign({key:n.name,control:g},n,{dataCy:`${o.dataCy}-${n.name}`,readOnly:o.readOnly}))})),o.extraInputs&&o.extraInputs(g)),o.buttons)}));var R=n(491),B=function(e,t,n,i){return new(n||(n=Promise))((function(l,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function r(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?l(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}s((i=i.apply(e,t||[])).next())}))};const H=d.j.getLazyComponent("ModalForm"),P=d.j.getLazyComponent("Loader"),U=d.j.getLazyComponent("Icon"),N=d.j.getLazyComponent("Typography"),Y=d.j.getLazyComponent("Deprecated_Ellipsis"),Q=d.j.getLazyComponent("StyledHref"),K=a().div`
34
36
  display: flex;
35
37
  flex-direction: column;
36
38
  gap: ${({theme:e})=>e.space.md}px;
@@ -42,11 +44,11 @@
42
44
  background-color: ${({theme:e})=>e.color.grey0};
43
45
  border-radius: ${({theme:e})=>e.size.sm}px;
44
46
  padding: ${({theme:e})=>e.space.md}px;
45
- `,K=a().div`
47
+ `,Z=a().div`
46
48
  display: flex;
47
49
  flex-direction: column;
48
50
  gap: ${({theme:e})=>e.space.sm}px;
49
- `,Z=({onClose:e,articleId:t,articleUri:n,commentUri:o})=>{const a=(0,r.useIntl)(),s=(0,i.useRef)(null),d=(0,u.jL)(),[m,g]=l().useState(!0),[p,f]=(0,i.useState)(),[E,h]=(0,i.useState)(),[b,v]=(0,i.useState)(!0),[y,C]=(0,i.useState)(!1),x=(0,$.Ie)();(0,i.useEffect)((()=>{Promise.all([R(void 0,void 0,void 0,(function*(){const e=yield k().article.get({idArticle:t,format:"raw-list"},{signal:x.signal});f(e.result)})),R(void 0,void 0,void 0,(function*(){if(o){const e=yield k().article.getComments({idArticle:t},{format:"raw-list",signal:x.signal});h(e.result.find((e=>e.uri===o)))}}))]).then((()=>{v(!1)}))}),[x,t,o]);const w=(0,i.useCallback)((()=>{g(!1),e()}),[e]),L=(0,i.useCallback)((e=>{(null==e?void 0:e.trim())?(C(!0),k().contentReport.createReport({uri:o||n,description:e}).then((()=>{d(c.y8.actions.success({label:a.formatMessage({id:"CRPT_Report_Sent"})})),w()})).catch((e=>{var t;c.y8.actions.error({label:null!==(t=e.errorMsg)&&void 0!==t?t:"GLOBAL_Error"}),C(!1)}))):d(c.y8.actions.error({label:a.formatMessage({id:"CRPT_Report_Description_Required"})}))}),[n,w,o,d,a]),W=(0,i.useCallback)((({description:e})=>{L(e)}),[L]);return l().createElement(B,{title:a.formatMessage({id:"CRPT_Add_Report"}),open:m,closeHandler:w,onSubmit:()=>R(void 0,void 0,void 0,(function*(){var e;return L(null===(e=s.current)||void 0===e?void 0:e.getValues().description)})),enableClickAwayCloseModal:!0,maxHeight:"520px",buttons:[{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:w},{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Send"}),clickHandler:()=>{var e;return L(null===(e=s.current)||void 0===e?void 0:e.getValues().description)},color:"valid",loading:y}]},b?l().createElement(H,{size:"l"}):l().createElement(Q,null,l().createElement(X,null,l().createElement(P,{name:o?"icon-comment":"icon-file",size:50,variant:"square"}),l().createElement(K,null,l().createElement(U,{variant:o?"h3":"h2"},l().createElement(N,{label:null==p?void 0:p.title,length:40})),E&&l().createElement(U,null,a.formatMessage({id:"CRPT_Comment_Of"})," ",l().createElement(Y,{href:null==E?void 0:E._user._url},null==E?void 0:E._user.title)))),l().createElement(F,{ref:s,fields:["description"],type:"contentReport",onSubmit:W})))};var ee=n(690),te=n(746);var ne=n(206),ie=n(743),le=n(704);const oe=(a().div`
51
+ `,ee=({onClose:e,articleId:t,articleUri:n,commentUri:o})=>{const a=(0,r.useIntl)(),s=(0,i.useRef)(null),d=(0,u.jL)(),[m,g]=l().useState(!0),[p,f]=(0,i.useState)(),[E,h]=(0,i.useState)(),[b,v]=(0,i.useState)(!0),[y,C]=(0,i.useState)(!1),x=(0,R.Ie)();(0,i.useEffect)((()=>{Promise.all([B(void 0,void 0,void 0,(function*(){const e=yield L().article.get({idArticle:t,format:"raw-list"},{signal:x.signal});f(e.result)})),B(void 0,void 0,void 0,(function*(){if(o){const e=yield L().article.getComments({idArticle:t},{format:"raw-list",signal:x.signal});h(e.result.find((e=>e.uri===o)))}}))]).then((()=>{v(!1)}))}),[x,t,o]);const w=(0,i.useCallback)((()=>{g(!1),e()}),[e]),k=(0,i.useCallback)((e=>{(null==e?void 0:e.trim())?(C(!0),L().contentReport.createReport({uri:o||n,description:e}).then((()=>{d(c.y8.actions.success({label:a.formatMessage({id:"CRPT_Report_Sent"})})),w()})).catch((e=>{var t;c.y8.actions.error({label:null!==(t=e.errorMsg)&&void 0!==t?t:"GLOBAL_Error"}),C(!1)}))):d(c.y8.actions.error({label:a.formatMessage({id:"CRPT_Report_Description_Required"})}))}),[n,w,o,d,a]),W=(0,i.useCallback)((({description:e})=>{k(e)}),[k]);return l().createElement(H,{title:a.formatMessage({id:"CRPT_Add_Report"}),open:m,closeHandler:w,onSubmit:()=>B(void 0,void 0,void 0,(function*(){var e;return k(null===(e=s.current)||void 0===e?void 0:e.getValues().description)})),enableClickAwayCloseModal:!0,maxHeight:"520px",buttons:[{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:w},{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Send"}),clickHandler:()=>{var e;return k(null===(e=s.current)||void 0===e?void 0:e.getValues().description)},color:"valid",loading:y}]},b?l().createElement(P,{size:"l"}):l().createElement(K,null,l().createElement(X,null,l().createElement(U,{name:o?"icon-comment":"icon-file",size:50,variant:"square"}),l().createElement(Z,null,l().createElement(N,{variant:o?"h3":"h2"},l().createElement(Y,{label:null==p?void 0:p.title,length:40})),E&&l().createElement(N,null,a.formatMessage({id:"CRPT_Comment_Of"})," ",l().createElement(Q,{href:null==E?void 0:E._user._url},null==E?void 0:E._user.title)))),l().createElement($,{ref:s,fields:["description"],type:"contentReport",onSubmit:W})))};var te=n(690),ne=n(746);var ie=n(206),le=n(743),oe=n(704);const ae=(a().div`
50
52
  margin-bottom: 24px;
51
53
  `,a().div`
52
54
  margin-bottom: 4px;
@@ -58,27 +60,27 @@
58
60
  flex: 1;
59
61
  display: flex;
60
62
  overflow: hidden;
61
- `),ae=a().div`
63
+ `),re=a().div`
62
64
  flex-direction: row;
63
65
  display: flex;
64
66
  min-height: 60px;
65
67
  border-bottom: 1px solid ${e=>e.theme.color.grey2};
66
- `,re=a().div`
68
+ `,se=a().div`
67
69
  width: 60px;
68
70
  display: flex;
69
71
  align-items: center;
70
72
  justify-content: center;
71
- `,se=a().div`
73
+ `,ce=a().div`
72
74
  flex: 1;
73
75
  display: flex;
74
76
  align-items: center;
75
77
  justify-content: center;
76
- `,ce=a().div`
78
+ `,de=a().div`
77
79
  position: relative;
78
80
  overflow: hidden;
79
81
  top: 0px;
80
82
  width: ${460}px;
81
- `,de=a().div`
83
+ `,ue=a().div`
82
84
  position: absolute;
83
85
  top: 0;
84
86
  ${e=>"left"===e.position?"left: 0px;":""}
@@ -94,7 +96,7 @@
94
96
  &.animate {
95
97
  right: 0px;
96
98
  }
97
- `,ue=a().div`
99
+ `,me=a().div`
98
100
  flex: 1;
99
101
  display: flex;
100
102
  flex-direction: column;
@@ -102,29 +104,29 @@
102
104
  overflow: auto;
103
105
  margin-bottom: 12px;
104
106
  position: relative;
105
- `,me=a().div`
107
+ `,ge=a().div`
106
108
  flex: 1;
107
109
  display: flex;
108
110
  flex-direction: column;
109
- `,ge=a().div`
111
+ `,pe=a().div`
110
112
  position: absolute;
111
113
  inset: 0;
112
114
  background-color: rgba(255, 255, 255, 0.8);
113
115
  display: flex;
114
116
  align-items: center;
115
117
  justify-content: center;
116
- `,pe=a().div`
118
+ `,fe=a().div`
117
119
  position: absolute;
118
120
  inset: 0;
119
121
  background-color: ${e=>e.theme.color.white};
120
122
  padding: ${e=>e.theme.space.md}px;
121
- `,fe=a().div`
123
+ `,Ee=a().div`
122
124
  width: ${50}px;
123
125
  padding-top: 60px;
124
126
  display: flex;
125
127
  flex-direction: column;
126
128
  border-right: 1px solid ${e=>e.theme.color.grey2};
127
- `,Ee=a().button`
129
+ `,he=a().button`
128
130
  border-radius: 4px;
129
131
  cursor: pointer;
130
132
  height: 42px;
@@ -140,7 +142,7 @@
140
142
  &:hover {
141
143
  background-color: ${e=>e.theme.color.grey2};
142
144
  }
143
- `,he=(a().div`
145
+ `,be=(a().div`
144
146
  display: flex;
145
147
  border: 1px solid ${e=>e.theme.color.grey1};
146
148
  border-radius: ${8}px;
@@ -175,41 +177,41 @@
175
177
  flex: 1;
176
178
  display: flex;
177
179
  align-items: center;
178
- `,d.j.getLazyComponent("Button")),be=d.j.getLazyComponent("Icon"),ve=({uniqid:e})=>{const t=(0,u.jL)(),n=(0,u.GV)((t=>c.cr.selectors.selectEditor(t,e)));return n&&n.popup&&n.view?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"white",marginTop:90}},l().createElement(ae,null,l().createElement(re,null),l().createElement(se,null,"Popup"),l().createElement(re,null,l().createElement(Ee,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(be,{name:"icon-times",color:"grey2",size:26.75})))),l().createElement("div",{style:{flex:1,display:"flex"}},n.view),l().createElement(ae,null,l().createElement(he,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)};var ye=n(939);const Ce=d.j.getLazyComponent("WidgetArticleTitleEditor"),xe=d.j.getLazyComponent("WidgetArticleTextEditor"),we=d.j.getLazyComponent("WidgetArticleGalleryEditor"),ke=d.j.getLazyComponent("WidgetArticleAttachmentEditor"),Le=d.j.getLazyComponent("WidgetArticleSliderEditor"),We=d.j.getLazyComponent("WidgetArticleImageEditor"),_e=d.j.getLazyComponent("WidgetButtonEditor"),qe=d.j.getLazyComponent("WidgetCheckListEditor"),Se=d.j.getLazyComponent("WidgetQuickSurveyEditor"),je=d.j.getLazyComponent("WidgetDatasourceTableEditor"),Me=d.j.getLazyComponent("WidgetExcelDatasourceTableEditor"),Te=d.j.getLazyComponent("WidgetPresenceEditor"),Ae=d.j.getLazyComponent("WidgetLuccaAbsenceEditor"),Ie=d.j.getLazyComponent("WidgetEmailsImapEditor"),Oe=d.j.getLazyComponent("WidgetContactCardDavEditor"),ze=d.j.getLazyComponent("WidgetCalendarCalDavEditor"),Ge=({uniqid:e})=>{var t,n,i,o,a,r;const d=(0,u.jL)(),m=(0,u.GV)(c.x0.selectors.selectToken),g=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e)),le.shallowEqual),p=(0,u.GV)((t=>{var n;return null===(n=c.cr.selectors.selectEditor(t,e))||void 0===n?void 0:n.onSave}),le.shallowEqual),f=e=>{var t;return null===(t=c.qn.selectors.selectHook(ye.M.getState(),e))||void 0===t?void 0:t.isActive},E=t=>{g&&d(c.x0.slice.actions.updateWidget({uniqid:e,content:t})),d(c.cr.slice.actions.flushEditor({uniqid:e})),p&&p(t)},h=(t,n)=>{d(void 0!==n?c.x0.slice.actions.setWidgetState(Object.assign({uniqid:n},t)):c.x0.slice.actions.setWidgetState(Object.assign({uniqid:e},t)))},b=t=>{d(c.cr.slice.actions.registerEditorPopup({uniqid:e,view:t}))},v=null==g?void 0:g.widget;return v?(0,w.ensureWidgetArticleButtonType)(v)?l().createElement(_e,Object.assign({},v.content,{onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:()=>E({})})):(0,w.ensureWidgetArticleGalleryType)(v)?l().createElement(we,{token:m,content:v.content,onChange:t=>d((0,c.vR)(e,t,!1)),onSave:E,onStateChange:h}):(0,w.ensureWidgetArticleAttachmentType)(v)?l().createElement(ke,{token:m,content:v.content,onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,onStateChange:h,onOpen:b}):(0,w.ensureWidgetLuccaAbsenceType)(v)?l().createElement(Ae,null):(0,w.ensureWidgetArticleImageType)(v)?l().createElement(We,{content:v.content,token:m,onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,onStateChange:h}):(0,w.ensureWidgetArticleSliderType)(v)?void 0!==m?l().createElement(Le,{slides:null!==(t=v.content.slides)&&void 0!==t?t:[],loop:null!==(n=v.content.loop)&&void 0!==n&&n,useDots:null===(i=v.content.useDots)||void 0===i||i,onChange:t=>{d((0,c.vR)(e,t,!1))},token:m,onSave:E}):l().createElement(l().Fragment,null,"Token is mandatory"):(0,w.ensureWidgetArticleTitleType)(v)?l().createElement(Ce,{onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,content:v.content,onOpen:b}):(0,w.ensureWidgetArticleTextType)(v)?l().createElement(xe,{onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,content:v.content}):(0,w.ensureWidgetPresenceType)(v)?l().createElement(Te,Object.assign({onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,onStateChange:h},v.content)):(0,w.ensureWidgetCheckListType)(v)?l().createElement(qe,{token:m,uniqid:v.uniqid,content:Object.assign(Object.assign({},v.content),{arr:null===(o=v.content.arr)||void 0===o?void 0:o.map((e=>Object.assign(Object.assign({},e),{title:s.Utils.html.htmlDecodeSpecialChars(e.title)})))}),onChangeContent:(e,t)=>{d((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{d(c.x0.slice.actions.updateWidgetWrapper(Object.assign(Object.assign({},e),{title:s.Utils.html.htmlDecodeSpecialChars(e.title)})))},handleChange:t=>d((0,c.vR)(e,t,!1))}):(0,w.ensureWidgetQuickSurveyType)(v)?l().createElement(Se,{token:m,uniqid:v.uniqid,content:v.content,onChangeContent:(e,t)=>{d((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{d(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>d((0,c.vR)(e,t,!1))}):(0,w.ensureWidgetExcelDatasourceTableType)(v)?l().createElement(Me,Object.assign({},v.content,{uri:v.content.uri,limit:null!==(a=v.content.limit)&&void 0!==a?a:20,hook:{isActive:f},handlers:{jamespot:{datasource:k().datasource,network:k().network,filebank:k().filebank,wedoc:k().wedoc},handleStart:()=>h({busy:!0}),handleCatch:e=>d(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>h({busy:!1})},onSave:E,onChange:(t,n)=>d((0,c.vR)(e,t,null!=n&&n)),onStateChange:h,onError:e=>d(c.y8.actions.error({label:e}))})):(0,w.ensureWidgetEmailsImapType)(v)?l().createElement(Ie,null):(0,w.ensureWidgetContactCardDavType)(v)?l().createElement(Oe,null):(0,w.ensureWidgetCalendarCalDavType)(v)?l().createElement(ze,null):(0,w.ensureWidgetDatasourceTableType)(v)?l().createElement(je,Object.assign({},v.content,{uri:v.content.uri,limit:null!==(r=v.content.limit)&&void 0!==r?r:20,hook:{isActive:f},handlers:{jamespot:{datasource:k().datasource,network:k().network,application:k().application,filebank:k().filebank},handleStart:()=>h({busy:!0}),handleCatch:e=>d(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>h({busy:!1})},onSave:E,onChange:(t,n)=>d((0,c.vR)(e,t,null!=n&&n)),onStateChange:h,onError:e=>{d(c.y8.actions.error({label:e}))}})):l().createElement(l().Fragment,null,"cannot display editor"):null},De=d.j.getLazyComponent("Icon"),Ve=({uniqid:e,position:t})=>{const n=(0,u.jL)(),i=(0,o.useTheme)();return l().createElement(re,null,l().createElement(Ee,{onClick:()=>{n(c.cr.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(De,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:i.color.lavender,size:26.75})))},Fe=d.j.getLazyComponent("InputColorRaw"),$e=a().label`
180
+ `,d.j.getLazyComponent("Button")),ve=d.j.getLazyComponent("Icon"),ye=({uniqid:e})=>{const t=(0,u.jL)(),n=(0,u.GV)((t=>c.cr.selectors.selectEditor(t,e)));return n&&n.popup&&n.view?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"white",marginTop:90}},l().createElement(re,null,l().createElement(se,null),l().createElement(ce,null,"Popup"),l().createElement(se,null,l().createElement(he,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(ve,{name:"icon-times",color:"grey2",size:26.75})))),l().createElement("div",{style:{flex:1,display:"flex"}},n.view),l().createElement(re,null,l().createElement(be,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)};var Ce=n(939);const xe=d.j.getLazyComponent("WidgetArticleTitleEditor"),we=d.j.getLazyComponent("WidgetArticleTextEditor"),ke=d.j.getLazyComponent("WidgetArticleGalleryEditor"),Le=d.j.getLazyComponent("WidgetArticleAttachmentEditor"),We=d.j.getLazyComponent("WidgetArticleSliderEditor"),_e=d.j.getLazyComponent("WidgetArticleImageEditor"),qe=d.j.getLazyComponent("WidgetButtonEditor"),Se=d.j.getLazyComponent("WidgetCheckListEditor"),je=d.j.getLazyComponent("WidgetQuickSurveyEditor"),Me=d.j.getLazyComponent("WidgetDatasourceTableEditor"),Te=d.j.getLazyComponent("WidgetExcelDatasourceTableEditor"),Ae=d.j.getLazyComponent("WidgetPresenceEditor"),Ie=d.j.getLazyComponent("WidgetLuccaAbsenceEditor"),Oe=d.j.getLazyComponent("WidgetEmailsImapEditor"),ze=d.j.getLazyComponent("WidgetContactCardDavEditor"),Ge=d.j.getLazyComponent("WidgetCalendarCalDavEditor"),De=({uniqid:e})=>{var t,n,i,o,a,r;const d=(0,u.jL)(),m=(0,u.GV)(c.x0.selectors.selectToken),g=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e)),oe.shallowEqual),p=(0,u.GV)((t=>{var n;return null===(n=c.cr.selectors.selectEditor(t,e))||void 0===n?void 0:n.onSave}),oe.shallowEqual),f=e=>{var t;return null===(t=c.qn.selectors.selectHook(Ce.M.getState(),e))||void 0===t?void 0:t.isActive},E=t=>{g&&d(c.x0.slice.actions.updateWidget({uniqid:e,content:t})),d(c.cr.slice.actions.flushEditor({uniqid:e})),p&&p(t)},h=(t,n)=>{d(void 0!==n?c.x0.slice.actions.setWidgetState(Object.assign({uniqid:n},t)):c.x0.slice.actions.setWidgetState(Object.assign({uniqid:e},t)))},b=t=>{d(c.cr.slice.actions.registerEditorPopup({uniqid:e,view:t}))},v=null==g?void 0:g.widget;return v?(0,k.ensureWidgetArticleButtonType)(v)?l().createElement(qe,Object.assign({},v.content,{onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:()=>E({})})):(0,k.ensureWidgetArticleGalleryType)(v)?l().createElement(ke,{token:m,content:v.content,onChange:t=>d((0,c.vR)(e,t,!1)),onSave:E,onStateChange:h}):(0,k.ensureWidgetArticleAttachmentType)(v)?l().createElement(Le,{token:m,content:v.content,onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,onStateChange:h,onOpen:b}):(0,k.ensureWidgetLuccaAbsenceType)(v)?l().createElement(Ie,null):(0,k.ensureWidgetArticleImageType)(v)?l().createElement(_e,{content:v.content,token:m,onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,onStateChange:h}):(0,k.ensureWidgetArticleSliderType)(v)?void 0!==m?l().createElement(We,{slides:null!==(t=v.content.slides)&&void 0!==t?t:[],loop:null!==(n=v.content.loop)&&void 0!==n&&n,useDots:null===(i=v.content.useDots)||void 0===i||i,onChange:t=>{d((0,c.vR)(e,t,!1))},token:m,onSave:E}):l().createElement(l().Fragment,null,"Token is mandatory"):(0,k.ensureWidgetArticleTitleType)(v)?l().createElement(xe,{onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,content:v.content,onOpen:b}):(0,k.ensureWidgetArticleTextType)(v)?l().createElement(we,{onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,content:v.content}):(0,k.ensureWidgetPresenceType)(v)?l().createElement(Ae,Object.assign({onChange:t=>{d((0,c.vR)(e,t,!1))},onSave:E,onStateChange:h},v.content)):(0,k.ensureWidgetCheckListType)(v)?l().createElement(Se,{token:m,uniqid:v.uniqid,content:Object.assign(Object.assign({},v.content),{arr:null===(o=v.content.arr)||void 0===o?void 0:o.map((e=>Object.assign(Object.assign({},e),{title:s.Utils.html.htmlDecodeSpecialChars(e.title)})))}),onChangeContent:(e,t)=>{d((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{d(c.x0.slice.actions.updateWidgetWrapper(Object.assign(Object.assign({},e),{title:s.Utils.html.htmlDecodeSpecialChars(e.title)})))},handleChange:t=>d((0,c.vR)(e,t,!1))}):(0,k.ensureWidgetQuickSurveyType)(v)?l().createElement(je,{token:m,uniqid:v.uniqid,content:v.content,onChangeContent:(e,t)=>{d((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{d(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>d((0,c.vR)(e,t,!1))}):(0,k.ensureWidgetExcelDatasourceTableType)(v)?l().createElement(Te,Object.assign({},v.content,{uri:v.content.uri,limit:null!==(a=v.content.limit)&&void 0!==a?a:20,hook:{isActive:f},handlers:{jamespot:{datasource:L().datasource,network:L().network,filebank:L().filebank,wedoc:L().wedoc},handleStart:()=>h({busy:!0}),handleCatch:e=>d(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>h({busy:!1})},onSave:E,onChange:(t,n)=>d((0,c.vR)(e,t,null!=n&&n)),onStateChange:h,onError:e=>d(c.y8.actions.error({label:e}))})):(0,k.ensureWidgetEmailsImapType)(v)?l().createElement(Oe,null):(0,k.ensureWidgetContactCardDavType)(v)?l().createElement(ze,null):(0,k.ensureWidgetCalendarCalDavType)(v)?l().createElement(Ge,null):(0,k.ensureWidgetDatasourceTableType)(v)?l().createElement(Me,Object.assign({},v.content,{uri:v.content.uri,limit:null!==(r=v.content.limit)&&void 0!==r?r:20,hook:{isActive:f},handlers:{jamespot:{datasource:L().datasource,network:L().network,application:L().application,filebank:L().filebank},handleStart:()=>h({busy:!0}),handleCatch:e=>d(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>h({busy:!1})},onSave:E,onChange:(t,n)=>d((0,c.vR)(e,t,null!=n&&n)),onStateChange:h,onError:e=>{d(c.y8.actions.error({label:e}))}})):l().createElement(l().Fragment,null,"cannot display editor"):null},Ve=d.j.getLazyComponent("Icon"),Fe=({uniqid:e,position:t})=>{const n=(0,u.jL)(),i=(0,o.useTheme)();return l().createElement(se,null,l().createElement(he,{onClick:()=>{n(c.cr.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(Ve,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:i.color.lavender,size:26.75})))},$e=d.j.getLazyComponent("InputColorRaw"),Re=a().label`
179
181
  margin-left: 2px;
180
182
  margin-right: 2px;
181
183
  margin-bottom: 8px;
182
184
  font-size: 14px;
183
185
  width: 100%;
184
186
  min-height: 20px;
185
- `,Re=a().fieldset`
187
+ `,Be=a().fieldset`
186
188
  margin: 12px 0px !important;
187
189
  width: 100% !important;
188
- `,Be=({label:e,initialValue:t,handleChange:n})=>{const i=(0,o.useTheme)(),a=[{name:(0,r.useIntl)().formatMessage({id:"GLOBAL_Platform_Color"}),colors:[i.color.primary,i.color.secondary,i.color.headerColor,i.color.lavender,i.color.orange,i.color.green,i.color.navy,i.color.overseas]}];return l().createElement(Re,null,l().createElement($e,null,l().createElement(r.FormattedMessage,{id:e})),l().createElement(Fe,{palettes:a,label:e,initialValue:null!=t?t:i.color.primary,name:"background-color",onChange:n}))},He=d.j.getLazyComponent("InputNumber"),Pe=({label:e,initialValue:t,handleChange:n})=>{const i=(0,r.useIntl)(),{control:o,watch:a}=(0,T.useForm)({defaultValues:{value:null!=t?t:"0"},criteriaMode:"all"});return l().useEffect((()=>{const e=a((e=>{var t;n(null!==(t=e.value)&&void 0!==t?t:"")}));return()=>e.unsubscribe()}),[a,n]),l().createElement(He,{label:e,name:"value",width:"100%",control:o,placeholder:i.formatMessage({id:e})})},Ue=d.j.getLazyComponent("InputSelectExtended"),Ne=({label:e,options:t=[],initialValue:n,required:o=!1,handleChange:a})=>{const r=(0,i.useMemo)((()=>n&&t.find((e=>e.value===n))?t.find((e=>e.value===n)):t[0]),[n,t]),{control:s,watch:c}=(0,T.useForm)({defaultValues:{select:r},criteriaMode:"all"});return l().useEffect((()=>{const e=c((e=>{a(e.select.value)}));return()=>e.unsubscribe()}),[c,a]),l().createElement(Ue,{options:t,label:e,getValue:e=>e.value,getLabel:"label",getSearch:"label",rules:{required:o},hideDeleteIcon:!0,required:o,control:s,name:"select"})},Ye=d.j.getLazyComponent("InputText"),Je=({uniqid:e})=>{var t;const n=(0,r.useIntl)(),a=(0,u.jL)(),s=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e))),d=(0,u.GV)((t=>c.x0.selectors.selectWidgetContext(t,e)),le.shallowEqual),m=(0,o.useTheme)(),g=(0,u.GV)((t=>c.x0.selectors.selectWidgetTitleStyle(t,e)),le.shallowEqual),{control:p,watch:f}=(0,T.useForm)({defaultValues:{text:null!==(t=null==s?void 0:s.title.replace(/&amp;/g,"&"))&&void 0!==t?t:""},criteriaMode:"all"});(0,i.useEffect)((()=>{const t=f((t=>{a(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,title:t.text}))}));return()=>t.unsubscribe()}),[f,e,a]);const E=(0,i.useMemo)((()=>({color:g&&g.color?String(g.color):m.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,m]),h=(0,i.useCallback)(((t,n)=>{a(c.x0.slice.actions.setWidgetTitleStyle({uniqid:e,styles:{[t]:n}}))}),[a,e]);return s?l().createElement(l().Fragment,null,l().createElement(Ye,{name:"text",label:"WIDGET_Title",width:"100%",control:p,placeholder:n.formatMessage({id:"WIDGET_Title"})}),"comment"!==d&&l().createElement(l().Fragment,null,l().createElement(Be,{label:"STYLE_Text_Color",initialValue:E.color,handleChange:e=>h("color",e)}),l().createElement(Be,{label:"STYLE_Background_Color",initialValue:E.backgroundColor,handleChange:e=>h("background-color",e)}),l().createElement(Pe,{label:"STYLE_Text_Size",initialValue:E.fontSize,handleChange:e=>h("font-size",e)}),l().createElement(Ne,{label:"STYLE_Font_Weight",initialValue:E.fontWeight,options:[{label:n.formatMessage({id:"STYLE_Font_Weight_Normal"}),value:"normal"},{label:n.formatMessage({id:"STYLE_Font_Weight_Medium"}),value:"medium"},{label:n.formatMessage({id:"STYLE_Font_Weight_Bold"}),value:"bold"}],required:!1,handleChange:e=>h("font-weight",e)}),l().createElement(Ne,{label:"STYLE_Text_Align",initialValue:E.textAlign,options:[{label:n.formatMessage({id:"STYLE_Text_Align_Left"}),value:"left"},{label:n.formatMessage({id:"STYLE_Text_Align_Center"}),value:"center"},{label:n.formatMessage({id:"STYLE_Text_Align_Justify"}),value:"justify"},{label:n.formatMessage({id:"STYLE_Text_Align_Right"}),value:"right"}],required:!1,handleChange:e=>h("text-align",e)}))):l().createElement(l().Fragment,null)},Qe=d.j.getLazyComponent("Loader"),Xe=({uniqid:e})=>{var t;const n=null===(t=(0,u.GV)((t=>c.x0.selectors.selectWidgetState(t,e)),le.shallowEqual))||void 0===t?void 0:t.busy;return l().createElement(l().Fragment,null,n&&l().createElement(ge,null,l().createElement(Qe,{size:"l"})))},Ke=({uniqid:e})=>{var t;const n=(0,r.useIntl)();return(null===(t=(0,u.GV)((t=>c.x0.selectors.selectWidgetState(t,e)),le.shallowEqual))||void 0===t?void 0:t.locked)?l().createElement(pe,null,n.formatMessage({id:"INTRANET_Panel_Change_Off"})):l().createElement(l().Fragment,null)},Ze=d.j.getLazyComponent("Button"),et=({uniqid:e,mode:t})=>{const n=(0,r.useIntl)(),i=(0,u.jL)(),o=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e)),le.shallowEqual),a=(0,u.GV)((t=>c.x0.selectors.selectWidgetObjectUri(t,e)),le.shallowEqual);return l().createElement(Ze,{color:"valid",onClick:()=>{i(c.cr.slice.actions.flushEditor({uniqid:e}));const l=o&&o.widget&&o.widget.content;a&&o&&l&&("view"==t&&k().widget.updateWidget({uri:a,uniqid:e,title:o.title,content:l,v2:!0}).catch((e=>{var t;i(c.y8.actions.error({label:null!==(t=e.errorMsg)&&void 0!==t?t:n.formatMessage({id:"GLOBAL_Error"})}))})),"edit"===t&&i(c.x0.slice.actions.updateWidget({uniqid:e,content:l})))}},n.formatMessage({id:"GLOBAL_Save"}))},tt=({uniqid:e})=>{const t=(0,o.useTheme)(),n=(0,u.jL)(),a=(0,r.useIntl)(),s=(0,u.GV)((t=>c.x0.selectors.selectWidgetWrapperStyle(t,e)),le.shallowEqual),d=(0,i.useMemo)((()=>({color:s&&s.color?String(s.color):t.color.black,backgroundColor:s&&s["background-color"]?String(s["background-color"]):t.color.white,padding:s&&s.padding?String(s.padding):"0",borderRadius:s&&s["border-radius"]?String(s["border-radius"]):"0",borderColor:s["border-color"]?String(s["border-color"]):t.color.black,borderWidth:s["border-width"]?String(s["border-width"]):"0",borderStyle:s["border-style"]?String(s["border-style"]):"none"})),[s,t]),m=(0,i.useCallback)(((t,i)=>{n(c.x0.slice.actions.setWidgetWrapperStyle({uniqid:e,styles:{[t]:i}}))}),[e,n]);return l().createElement(l().Fragment,null,l().createElement(Be,{label:"STYLE_Background_Color",initialValue:d.backgroundColor,handleChange:e=>m("background-color",e)}),l().createElement(Be,{label:"STYLE_Text_Color",initialValue:d.color,handleChange:e=>m("color",e)}),l().createElement("hr",null),l().createElement(Pe,{label:"STYLE_Padding",initialValue:d.padding,handleChange:e=>m("padding",String(e))}),l().createElement(Pe,{label:"STYLE_Radius",initialValue:d.borderRadius,handleChange:e=>m("border-radius",String(e))}),l().createElement(Ne,{label:"STYLE_Border_Style",initialValue:d.borderStyle,options:[{label:a.formatMessage({id:"STYLE_Border_Style_None"}),value:"none"},{label:a.formatMessage({id:"STYLE_Border_Style_Solid"}),value:"solid"},{label:a.formatMessage({id:"STYLE_Border_Style_Dashed"}),value:"dashed"},{label:a.formatMessage({id:"STYLE_Border_Style_Dotted"}),value:"dotted"}],required:!1,handleChange:e=>{m("border-style",e),"none"!==e&&m("border-color",t.color.black),"none"!==e&&m("border-width","1")}}),"string"==typeof d.borderStyle&&"none"!==d.borderStyle&&l().createElement(Be,{label:"STYLE_Border_Color",initialValue:d.borderColor,handleChange:e=>m("border-color",e)}),"string"==typeof d.borderStyle&&"none"!==d.borderStyle&&l().createElement(Pe,{label:"STYLE_Border_Width",initialValue:d.borderWidth,handleChange:e=>m("border-width",e)}))},nt=({uniqid:e})=>{const t=(0,u.jL)(),n=(0,r.useIntl)(),o=(0,u.GV)((t=>c.cr.selectors.selectEditor(t,e)),le.shallowEqual),a=c.x0.definition(null==o?void 0:o.name),s=(0,u.GV)((t=>c.x0.selectors.selectWidgetLevel(t,e)),le.shallowEqual),d=(0,i.useCallback)((n=>{t(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,level:Number(n)}))}),[e,t]);return l().createElement(Ne,{handleChange:d,required:!0,label:"WIDGET_Display_Level_Select",initialValue:s?String(s):"3",options:[{label:n.formatMessage({id:"WIDGET_Display_Level_1"}),value:"1"},{label:n.formatMessage({id:"WIDGET_Display_Level_2"}),value:"2"},{label:n.formatMessage({id:"WIDGET_Display_Level_3"}),value:"3"},{label:n.formatMessage({id:"WIDGET_Display_Level_4"}),value:"4"}].filter((e=>Array.isArray(a.displayLevel)?a.displayLevel.includes(Number(e.value)):[]))})},it=["widget-presence","widget-quick-survey","widget-check-list","widget-emails-imap","widget-contact-cardDav","widget-calendar-calDav"],lt=d.j.getLazyComponent("Icon"),ot=d.j.getLazyComponent("Tooltip"),at=({uniqid:e,position:t})=>{const n=(0,r.useIntl)(),a=(0,u.jL)(),s=(0,o.useTheme)(),d=(0,i.useRef)(null),m=(0,u.GV)((t=>c.cr.selectors.selectEditor(t,e)),le.shallowEqual),g=c.x0.definition(null==m?void 0:m.name),p=(0,i.useMemo)((()=>void 0!==g.displayLevel&&Array.isArray(g.displayLevel)&&0!==g.displayLevel.length),[g]),f=(0,i.useMemo)((()=>[{name:"widget-title",label:n.formatMessage({id:"PANEL_Title"}),enable:g.panel.useWrapper,icon:"icon-font"},{name:"widget-selection",label:n.formatMessage({id:"PANEL_Widget_Selection"}),enable:g.panel.useSelection,icon:"icon-sliders"},{name:"widget-settings",label:n.formatMessage({id:"PANEL_Widget_Settings"}),enable:g.panel.useEditor,icon:"icon-pen"},{name:"widget-level",label:n.formatMessage({id:"PANEL_Widget_Level"}),enable:p,icon:"icon-edit"}]),[g,n,p]),E=(0,i.useMemo)((()=>g.panel.useEditor?f.find((e=>"widget-settings"===e.name)):f.filter((e=>e.enable))[0]),[g,f]),[h,b]=(0,i.useState)(E);return(0,i.useEffect)((()=>{setTimeout((()=>{d&&d.current&&(d.current.className=d.current.className+" animate")}),0)}),[]),m?l().createElement(ce,null,l().createElement(de,{ref:d,position:t},l().createElement(fe,null,f.filter((e=>e.enable)).map((e=>l().createElement(Ee,{key:e.name,isActive:h&&h.name===e.name,onClick:()=>b(e)},l().createElement(ot,{position:"left",description:e.label},l().createElement(lt,{name:e.icon,color:h&&h.name===e.name?s.color.white:s.color.lavender})))))),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",width:"390px"}},l().createElement(ae,null,l().createElement(Ve,{uniqid:e,position:m.position}),l().createElement(se,null,l().createElement("h3",null,h?h.label:n.formatMessage({id:g.label}))),l().createElement(re,null,l().createElement(Ee,{onClick:()=>{a(c.cr.slice.actions.flushEditor({uniqid:e}))}},l().createElement(lt,{name:"icon-times",color:s.color.lavender,size:26.75})))),l().createElement(ue,null,l().createElement(me,null,h&&"widget-settings"===h.name&&g.panel.useEditor&&l().createElement(Ge,{uniqid:m.uniqid}),h&&"widget-title"===h.name&&g.panel.useWrapper&&l().createElement(Je,{uniqid:m.uniqid}),h&&"widget-selection"===h.name&&l().createElement(tt,{uniqid:e}),h&&"widget-level"===h.name&&p&&l().createElement(nt,{uniqid:e})),l().createElement(Xe,{uniqid:e}),l().createElement(Ke,{uniqid:e}),it.includes(m.name)&&l().createElement(et,{uniqid:e,mode:m.mode})))),(null==m?void 0:m.popup)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},rt=a().div`
190
+ `,He=({label:e,initialValue:t,handleChange:n})=>{const i=(0,o.useTheme)(),a=[{name:(0,r.useIntl)().formatMessage({id:"GLOBAL_Platform_Color"}),colors:[i.color.primary,i.color.secondary,i.color.headerColor,i.color.lavender,i.color.orange,i.color.green,i.color.navy,i.color.overseas]}];return l().createElement(Be,null,l().createElement(Re,null,l().createElement(r.FormattedMessage,{id:e})),l().createElement($e,{palettes:a,label:e,initialValue:null!=t?t:i.color.primary,name:"background-color",onChange:n}))},Pe=d.j.getLazyComponent("InputNumber"),Ue=({label:e,initialValue:t,handleChange:n})=>{const i=(0,r.useIntl)(),{control:o,watch:a}=(0,A.useForm)({defaultValues:{value:null!=t?t:"0"},criteriaMode:"all"});return l().useEffect((()=>{const e=a((e=>{var t;n(null!==(t=e.value)&&void 0!==t?t:"")}));return()=>e.unsubscribe()}),[a,n]),l().createElement(Pe,{label:e,name:"value",width:"100%",control:o,placeholder:i.formatMessage({id:e})})},Ne=d.j.getLazyComponent("InputSelectExtended"),Ye=({label:e,options:t=[],initialValue:n,required:o=!1,handleChange:a})=>{const r=(0,i.useMemo)((()=>n&&t.find((e=>e.value===n))?t.find((e=>e.value===n)):t[0]),[n,t]),{control:s,watch:c}=(0,A.useForm)({defaultValues:{select:r},criteriaMode:"all"});return l().useEffect((()=>{const e=c((e=>{a(e.select.value)}));return()=>e.unsubscribe()}),[c,a]),l().createElement(Ne,{options:t,label:e,getValue:e=>e.value,getLabel:"label",getSearch:"label",rules:{required:o},hideDeleteIcon:!0,required:o,control:s,name:"select"})},Je=d.j.getLazyComponent("InputText"),Qe=({uniqid:e})=>{var t;const n=(0,r.useIntl)(),a=(0,u.jL)(),s=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e))),d=(0,u.GV)((t=>c.x0.selectors.selectWidgetContext(t,e)),oe.shallowEqual),m=(0,o.useTheme)(),g=(0,u.GV)((t=>c.x0.selectors.selectWidgetTitleStyle(t,e)),oe.shallowEqual),{control:p,watch:f}=(0,A.useForm)({defaultValues:{text:null!==(t=null==s?void 0:s.title.replace(/&amp;/g,"&"))&&void 0!==t?t:""},criteriaMode:"all"});(0,i.useEffect)((()=>{const t=f((t=>{a(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,title:t.text}))}));return()=>t.unsubscribe()}),[f,e,a]);const E=(0,i.useMemo)((()=>({color:g&&g.color?String(g.color):m.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,m]),h=(0,i.useCallback)(((t,n)=>{a(c.x0.slice.actions.setWidgetTitleStyle({uniqid:e,styles:{[t]:n}}))}),[a,e]);return s?l().createElement(l().Fragment,null,l().createElement(Je,{name:"text",label:"WIDGET_Title",width:"100%",control:p,placeholder:n.formatMessage({id:"WIDGET_Title"})}),"comment"!==d&&l().createElement(l().Fragment,null,l().createElement(He,{label:"STYLE_Text_Color",initialValue:E.color,handleChange:e=>h("color",e)}),l().createElement(He,{label:"STYLE_Background_Color",initialValue:E.backgroundColor,handleChange:e=>h("background-color",e)}),l().createElement(Ue,{label:"STYLE_Text_Size",initialValue:E.fontSize,handleChange:e=>h("font-size",e)}),l().createElement(Ye,{label:"STYLE_Font_Weight",initialValue:E.fontWeight,options:[{label:n.formatMessage({id:"STYLE_Font_Weight_Normal"}),value:"normal"},{label:n.formatMessage({id:"STYLE_Font_Weight_Medium"}),value:"medium"},{label:n.formatMessage({id:"STYLE_Font_Weight_Bold"}),value:"bold"}],required:!1,handleChange:e=>h("font-weight",e)}),l().createElement(Ye,{label:"STYLE_Text_Align",initialValue:E.textAlign,options:[{label:n.formatMessage({id:"STYLE_Text_Align_Left"}),value:"left"},{label:n.formatMessage({id:"STYLE_Text_Align_Center"}),value:"center"},{label:n.formatMessage({id:"STYLE_Text_Align_Justify"}),value:"justify"},{label:n.formatMessage({id:"STYLE_Text_Align_Right"}),value:"right"}],required:!1,handleChange:e=>h("text-align",e)}))):l().createElement(l().Fragment,null)},Ke=d.j.getLazyComponent("Loader"),Xe=({uniqid:e})=>{var t;const n=null===(t=(0,u.GV)((t=>c.x0.selectors.selectWidgetState(t,e)),oe.shallowEqual))||void 0===t?void 0:t.busy;return l().createElement(l().Fragment,null,n&&l().createElement(pe,null,l().createElement(Ke,{size:"l"})))},Ze=({uniqid:e})=>{var t;const n=(0,r.useIntl)();return(null===(t=(0,u.GV)((t=>c.x0.selectors.selectWidgetState(t,e)),oe.shallowEqual))||void 0===t?void 0:t.locked)?l().createElement(fe,null,n.formatMessage({id:"INTRANET_Panel_Change_Off"})):l().createElement(l().Fragment,null)},et=d.j.getLazyComponent("Button"),tt=({uniqid:e,mode:t})=>{const n=(0,r.useIntl)(),i=(0,u.jL)(),o=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e)),oe.shallowEqual),a=(0,u.GV)((t=>c.x0.selectors.selectWidgetObjectUri(t,e)),oe.shallowEqual);return l().createElement(et,{color:"valid",onClick:()=>{i(c.cr.slice.actions.flushEditor({uniqid:e}));const l=o&&o.widget&&o.widget.content;a&&o&&l&&("view"==t&&L().widget.updateWidget({uri:a,uniqid:e,title:o.title,content:l,v2:!0}).catch((e=>{var t;i(c.y8.actions.error({label:null!==(t=e.errorMsg)&&void 0!==t?t:n.formatMessage({id:"GLOBAL_Error"})}))})),"edit"===t&&i(c.x0.slice.actions.updateWidget({uniqid:e,content:l})))}},n.formatMessage({id:"GLOBAL_Save"}))},nt=({uniqid:e})=>{const t=(0,o.useTheme)(),n=(0,u.jL)(),a=(0,r.useIntl)(),s=(0,u.GV)((t=>c.x0.selectors.selectWidgetWrapperStyle(t,e)),oe.shallowEqual),d=(0,i.useMemo)((()=>({color:s&&s.color?String(s.color):t.color.black,backgroundColor:s&&s["background-color"]?String(s["background-color"]):t.color.white,padding:s&&s.padding?String(s.padding):"0",borderRadius:s&&s["border-radius"]?String(s["border-radius"]):"0",borderColor:s["border-color"]?String(s["border-color"]):t.color.black,borderWidth:s["border-width"]?String(s["border-width"]):"0",borderStyle:s["border-style"]?String(s["border-style"]):"none"})),[s,t]),m=(0,i.useCallback)(((t,i)=>{n(c.x0.slice.actions.setWidgetWrapperStyle({uniqid:e,styles:{[t]:i}}))}),[e,n]);return l().createElement(l().Fragment,null,l().createElement(He,{label:"STYLE_Background_Color",initialValue:d.backgroundColor,handleChange:e=>m("background-color",e)}),l().createElement(He,{label:"STYLE_Text_Color",initialValue:d.color,handleChange:e=>m("color",e)}),l().createElement("hr",null),l().createElement(Ue,{label:"STYLE_Padding",initialValue:d.padding,handleChange:e=>m("padding",String(e))}),l().createElement(Ue,{label:"STYLE_Radius",initialValue:d.borderRadius,handleChange:e=>m("border-radius",String(e))}),l().createElement(Ye,{label:"STYLE_Border_Style",initialValue:d.borderStyle,options:[{label:a.formatMessage({id:"STYLE_Border_Style_None"}),value:"none"},{label:a.formatMessage({id:"STYLE_Border_Style_Solid"}),value:"solid"},{label:a.formatMessage({id:"STYLE_Border_Style_Dashed"}),value:"dashed"},{label:a.formatMessage({id:"STYLE_Border_Style_Dotted"}),value:"dotted"}],required:!1,handleChange:e=>{m("border-style",e),"none"!==e&&m("border-color",t.color.black),"none"!==e&&m("border-width","1")}}),"string"==typeof d.borderStyle&&"none"!==d.borderStyle&&l().createElement(He,{label:"STYLE_Border_Color",initialValue:d.borderColor,handleChange:e=>m("border-color",e)}),"string"==typeof d.borderStyle&&"none"!==d.borderStyle&&l().createElement(Ue,{label:"STYLE_Border_Width",initialValue:d.borderWidth,handleChange:e=>m("border-width",e)}))},it=({uniqid:e})=>{const t=(0,u.jL)(),n=(0,r.useIntl)(),o=(0,u.GV)((t=>c.cr.selectors.selectEditor(t,e)),oe.shallowEqual),a=c.x0.definition(null==o?void 0:o.name),s=(0,u.GV)((t=>c.x0.selectors.selectWidgetLevel(t,e)),oe.shallowEqual),d=(0,i.useCallback)((n=>{t(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,level:Number(n)}))}),[e,t]);return l().createElement(Ye,{handleChange:d,required:!0,label:"WIDGET_Display_Level_Select",initialValue:s?String(s):"3",options:[{label:n.formatMessage({id:"WIDGET_Display_Level_1"}),value:"1"},{label:n.formatMessage({id:"WIDGET_Display_Level_2"}),value:"2"},{label:n.formatMessage({id:"WIDGET_Display_Level_3"}),value:"3"},{label:n.formatMessage({id:"WIDGET_Display_Level_4"}),value:"4"}].filter((e=>Array.isArray(a.displayLevel)?a.displayLevel.includes(Number(e.value)):[]))})},lt=["widget-presence","widget-quick-survey","widget-check-list","widget-emails-imap","widget-contact-cardDav","widget-calendar-calDav"],ot=d.j.getLazyComponent("Icon"),at=d.j.getLazyComponent("Tooltip"),rt=({uniqid:e,position:t})=>{const n=(0,r.useIntl)(),a=(0,u.jL)(),s=(0,o.useTheme)(),d=(0,i.useRef)(null),m=(0,u.GV)((t=>c.cr.selectors.selectEditor(t,e)),oe.shallowEqual),g=c.x0.definition(null==m?void 0:m.name),p=(0,i.useMemo)((()=>void 0!==g.displayLevel&&Array.isArray(g.displayLevel)&&0!==g.displayLevel.length),[g]),f=(0,i.useMemo)((()=>[{name:"widget-title",label:n.formatMessage({id:"PANEL_Title"}),enable:g.panel.useWrapper,icon:"icon-font"},{name:"widget-selection",label:n.formatMessage({id:"PANEL_Widget_Selection"}),enable:g.panel.useSelection,icon:"icon-sliders"},{name:"widget-settings",label:n.formatMessage({id:"PANEL_Widget_Settings"}),enable:g.panel.useEditor,icon:"icon-pen"},{name:"widget-level",label:n.formatMessage({id:"PANEL_Widget_Level"}),enable:p,icon:"icon-edit"}]),[g,n,p]),E=(0,i.useMemo)((()=>g.panel.useEditor?f.find((e=>"widget-settings"===e.name)):f.filter((e=>e.enable))[0]),[g,f]),[h,b]=(0,i.useState)(E);return(0,i.useEffect)((()=>{setTimeout((()=>{d&&d.current&&(d.current.className=d.current.className+" animate")}),0)}),[]),m?l().createElement(de,null,l().createElement(ue,{ref:d,position:t},l().createElement(Ee,null,f.filter((e=>e.enable)).map((e=>l().createElement(he,{key:e.name,isActive:h&&h.name===e.name,onClick:()=>b(e)},l().createElement(at,{position:"left",description:e.label},l().createElement(ot,{name:e.icon,color:h&&h.name===e.name?s.color.white:s.color.lavender})))))),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",width:"390px"}},l().createElement(re,null,l().createElement(Fe,{uniqid:e,position:m.position}),l().createElement(ce,null,l().createElement("h3",null,h?h.label:n.formatMessage({id:g.label}))),l().createElement(se,null,l().createElement(he,{onClick:()=>{a(c.cr.slice.actions.flushEditor({uniqid:e}))}},l().createElement(ot,{name:"icon-times",color:s.color.lavender,size:26.75})))),l().createElement(me,null,l().createElement(ge,null,h&&"widget-settings"===h.name&&g.panel.useEditor&&l().createElement(De,{uniqid:m.uniqid}),h&&"widget-title"===h.name&&g.panel.useWrapper&&l().createElement(Qe,{uniqid:m.uniqid}),h&&"widget-selection"===h.name&&l().createElement(nt,{uniqid:e}),h&&"widget-level"===h.name&&p&&l().createElement(it,{uniqid:e})),l().createElement(Xe,{uniqid:e}),l().createElement(Ze,{uniqid:e}),lt.includes(m.name)&&l().createElement(tt,{uniqid:e,mode:m.mode})))),(null==m?void 0:m.popup)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},st=a().div`
189
191
  position: absolute;
190
192
  inset: 0;
191
193
  pointer-events: none;
192
194
  z-index: 1;
193
- `,st=a().div`
195
+ `,ct=a().div`
194
196
  flex: 1;
195
197
  display: flex;
196
198
  margin-top: ${90}px;
197
199
  pointer-events: ${e=>e.isActive?"all":"none"};
198
- `,ct=a().div`
200
+ `,dt=a().div`
199
201
  flex: 1;
200
202
  display: flex;
201
203
  flex-direction: row;
202
204
  pointer-events: none;
203
- `,dt=a().div`
205
+ `,ut=a().div`
204
206
  width: ${440}px;
205
207
  pointer-events: none;
206
- `,ut=()=>{const e=(0,u.jL)();(0,i.useEffect)((()=>{const t=()=>{e(c.cr.slice.actions.flushAllEditor())};return window.addEventListener("NGWidgetEditorFlushAll",t),()=>{window.removeEventListener("NGWidgetEditorFlushAll",t)}}),[e]);const t=(0,u.GV)(c.cr.selectors.selectEditors,le.shallowEqual);return l().createElement(rt,{className:"editor-portal-wrapper"},t.map((e=>l().createElement(oe,{isActive:!1,key:e.uniqid},l().createElement(ct,null,"left"===e.position?l().createElement(l().Fragment,null,l().createElement(at,{uniqid:e.uniqid,position:e.position}),l().createElement(st,{isActive:void 0!==e.popup},l().createElement(ve,{uniqid:e.uniqid})),l().createElement(dt,null)):l().createElement(l().Fragment,null,l().createElement(dt,null),l().createElement(st,{isActive:void 0!==e.popup},l().createElement(ve,{uniqid:e.uniqid})),l().createElement(at,{uniqid:e.uniqid,position:e.position})))))))},mt=d.j.getLazyComponent("ThemeProvider"),gt=()=>{const e=document.getElementById("react-portals"),t=(0,i.useMemo)((()=>e&&(e=>{let t=document.getElementById("react-portals");return t||(t=document.createElement("div"),t.id=(0,ie.A)(),e.appendChild(t)),t})(e)),[e]);return t?(0,ne.createPortal)(l().createElement(mt,null,l().createElement(ut,null)),t):null},pt=a().div`
208
+ `,mt=()=>{const e=(0,u.jL)();(0,i.useEffect)((()=>{const t=()=>{e(c.cr.slice.actions.flushAllEditor())};return window.addEventListener("NGWidgetEditorFlushAll",t),()=>{window.removeEventListener("NGWidgetEditorFlushAll",t)}}),[e]);const t=(0,u.GV)(c.cr.selectors.selectEditors,oe.shallowEqual);return l().createElement(st,{className:"editor-portal-wrapper"},t.map((e=>l().createElement(ae,{isActive:!1,key:e.uniqid},l().createElement(dt,null,"left"===e.position?l().createElement(l().Fragment,null,l().createElement(rt,{uniqid:e.uniqid,position:e.position}),l().createElement(ct,{isActive:void 0!==e.popup},l().createElement(ye,{uniqid:e.uniqid})),l().createElement(ut,null)):l().createElement(l().Fragment,null,l().createElement(ut,null),l().createElement(ct,{isActive:void 0!==e.popup},l().createElement(ye,{uniqid:e.uniqid})),l().createElement(rt,{uniqid:e.uniqid,position:e.position})))))))},gt=d.j.getLazyComponent("ThemeProvider"),pt=()=>{const e=document.getElementById("react-portals"),t=(0,i.useMemo)((()=>e&&(e=>{let t=document.getElementById("react-portals");return t||(t=document.createElement("div"),t.id=(0,le.A)(),e.appendChild(t)),t})(e)),[e]);return t?(0,ie.createPortal)(l().createElement(gt,null,l().createElement(mt,null)),t):null},ft=a().div`
207
209
  display: flex;
208
210
  flex-direction: row;
209
211
  flex-wrap: wrap;
210
212
  gap: 10px;
211
213
  justify-content: center;
212
- `,ft=a().div`
214
+ `,Et=a().div`
213
215
  border: 1px solid ${e=>e.theme.color.grey2};
214
216
  border-radius: 8px;
215
217
  cursor: pointer;
@@ -234,7 +236,7 @@
234
236
  opacity: 1;
235
237
  }
236
238
  }
237
- `,Et=a().div`
239
+ `,ht=a().div`
238
240
  border: 2px solid ${e=>e.theme.color.primary};
239
241
  height: ${e=>e.open?e.height:"54"}px;
240
242
  border-radius: 8px;
@@ -244,14 +246,14 @@
244
246
  transition: height 0.4s;
245
247
  overflow: hidden;
246
248
  flex-direction: column;
247
- `,ht=a().div`
249
+ `,bt=a().div`
248
250
  display: flex;
249
251
  flex-direction: row;
250
252
  flex-wrap: wrap;
251
253
  justify-content: center;
252
254
  gap: 10px;
253
255
  ${e=>e.column&&"flex-direction: column;"}
254
- `,bt=a().div`
256
+ `,vt=a().div`
255
257
  min-height: 50px;
256
258
  display: flex;
257
259
  justify-content: center;
@@ -261,7 +263,7 @@
261
263
  &:hover {
262
264
  background-color: ${e=>e.theme.color.grey0};
263
265
  }
264
- `,vt=a().button`
266
+ `,yt=a().button`
265
267
  display: flex;
266
268
  align-items: center;
267
269
  padding: ${e=>e.parentIsColumn?"36px 16px":"0 10px"};
@@ -282,63 +284,63 @@
282
284
  }
283
285
 
284
286
  ${(0,s.DashedFocusBorder)()}
285
- `,yt=a().div`
287
+ `,Ct=a().div`
286
288
  display: flex;
287
289
  flex-direction: ${e=>"row"===e.direction?"row":"column"};
288
290
  align-items: ${e=>"row"===e.direction?"center":"flex-start"};
289
291
  justify-content: ${e=>"row"===e.direction?"flex-start":"center"};
290
292
  flex: 1;
291
293
  ${e=>e.gap&&`gap:${e.gap}px`}
292
- `,Ct=d.j.getLazyComponent("Button"),xt=d.j.getLazyComponent("ModalLayout"),wt=d.j.getLazyComponent("ModalContent"),kt=d.j.getLazyComponent("Tooltip"),Lt=d.j.getLazyComponent("IconButton"),Wt=({mode:e,view:t,children:n,namespace:o="default",onChange:a})=>{const[s,d]=(0,i.useState)(!1),u=function(e){switch(e){case"widget-article-image":return[c.x0.definition(w.WidgetsName.ArticleTitle),c.x0.definition(w.WidgetsName.ArticleButton)];case"comment":return[c.x0.definition(w.WidgetsName.CheckList),c.x0.definition(w.WidgetsName.Presence),c.x0.definition(w.WidgetsName.QuickSurvey)];default:return[c.x0.definition(w.WidgetsName.ArticleTitle),c.x0.definition(w.WidgetsName.ArticleText),c.x0.definition(w.WidgetsName.ArticleImage),c.x0.definition(w.WidgetsName.ArticleButton),c.x0.definition(w.WidgetsName.ArticleSlider),c.x0.definition(w.WidgetsName.ArticleAttachment),c.x0.definition(w.WidgetsName.Presence)]}}(o),m=(0,r.useIntl)(),g={open:s,portalId:"react-modal",variant:"full-height",closeHandler:()=>d(!1)},p=e=>{a(c.x0.factory(e)),d(!1)};return l().createElement(l().Fragment,null,l().createElement(xt,Object.assign({},g),l().createElement(wt,{onClickIconClose:g.closeHandler,buttons:"comment"===e?[{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Close"}),color:"cancel",clickHandler:()=>d(!1)}]:void 0,title:m.formatMessage({id:"WIDGET_Builder"})},"comment"===e?l().createElement(ht,{column:!0},u.map(((e,t)=>l().createElement(vt,{key:e.name,open:!0,full:!0,parentIsColumn:!0,index:t,onClick:()=>p(e.name)},l().createElement(yt,{direction:"row",gap:12},l().createElement("img",{src:e.img}),l().createElement(yt,{direction:"column"},l().createElement("h3",null,m.formatMessage({id:e.label})),l().createElement("p",null,m.formatMessage({id:e.description})))))))):l().createElement(pt,null,u.map(((e,t)=>l().createElement(ft,{key:t,onClick:()=>p(e.name),available:e.available},l().createElement("img",{src:e.img}),l().createElement("div",{className:"show-on-hover"},m.formatMessage({id:e.label})))))))),"custom"===e&&n?l().createElement("div",{onClick:()=>d(!0)},n):l().createElement(l().Fragment,null),"button"===e&&"edit"===t?l().createElement(Ct,{onClick:()=>d(!0),variant:"outlined",minWidth:"100%"},m.formatMessage({id:"WIDGET_Add_Widget"})):l().createElement(l().Fragment,null),"gallery"===e&&"edit"===t?l().createElement(pt,null,u.map(((e,t)=>l().createElement(ft,{key:t,onClick:()=>p(e.name),available:e.available},l().createElement("img",{src:e.img}),l().createElement("div",{className:"show-on-hover"},m.formatMessage({id:e.label})))))):l().createElement(l().Fragment,null),"article"===e&&"edit"===t?l().createElement(_t,{widgets:u,onClick:p}):l().createElement(l().Fragment,null),"comment"===e&&"edit"===t?l().createElement(qt,{onClick:()=>{d(!0)}}):l().createElement(l().Fragment,null))},_t=({widgets:e,onClick:t})=>{const[n,o]=(0,i.useState)(!1),a=(0,r.useIntl)(),s=(0,i.useMemo)((()=>80*Math.ceil(e.length/2)+50+10),[e]);return l().createElement(l().Fragment,null,l().createElement(Et,{open:n,height:s},l().createElement(bt,{onClick:()=>o(!n)},a.formatMessage({id:"WIDGET_Add_Widget"})),l().createElement(ht,null,e.map(((e,i)=>l().createElement(vt,{key:e.name,open:n,index:i,onClick:()=>t(e.name)},l().createElement("img",{src:e.img}),a.formatMessage({id:e.label})))))))},qt=({onClick:e})=>{const t=(0,r.useIntl)();return l().createElement(l().Fragment,null,l().createElement(kt,{description:t.formatMessage({id:"COMMENT_Add_Widget"})},l().createElement(Lt,{bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:22,onClick:()=>{e()},icon:"icon-fs-puzzle"})))},St=()=>{const e=(0,r.useIntl)(),[t,n]=(0,i.useState)(!1),[l,o]=(0,i.useState)();return{open:t,onInsert:e=>{null==l||l.execCommand("InsertHTML",!1,e)},close:()=>n(!1),ext:(0,i.useMemo)((()=>s.JTinyMCEExtensionsBuilders.markdown((e=>{o(e),n(!0)}),e)),[e]),isActive:!0}};var jt=n(730),Mt=n(876);const Tt=d.j.getLazyComponent("InputFileAdvancedRaw"),At=a().div`
294
+ `,xt=d.j.getLazyComponent("Button"),wt=d.j.getLazyComponent("ModalLayout"),kt=d.j.getLazyComponent("ModalContent"),Lt=d.j.getLazyComponent("Tooltip"),Wt=d.j.getLazyComponent("IconButton"),_t=({mode:e,view:t,children:n,namespace:o="default",onChange:a})=>{const[s,d]=(0,i.useState)(!1),u=function(e){switch(e){case"widget-article-image":return[c.x0.definition(k.WidgetsName.ArticleTitle),c.x0.definition(k.WidgetsName.ArticleButton)];case"comment":return[c.x0.definition(k.WidgetsName.CheckList),c.x0.definition(k.WidgetsName.Presence),c.x0.definition(k.WidgetsName.QuickSurvey)];default:return[c.x0.definition(k.WidgetsName.ArticleTitle),c.x0.definition(k.WidgetsName.ArticleText),c.x0.definition(k.WidgetsName.ArticleImage),c.x0.definition(k.WidgetsName.ArticleButton),c.x0.definition(k.WidgetsName.ArticleSlider),c.x0.definition(k.WidgetsName.ArticleAttachment),c.x0.definition(k.WidgetsName.Presence)]}}(o),m=(0,r.useIntl)(),g={open:s,portalId:"react-modal",variant:"full-height",closeHandler:()=>d(!1)},p=e=>{a(c.x0.factory(e)),d(!1)};return l().createElement(l().Fragment,null,l().createElement(wt,Object.assign({},g),l().createElement(kt,{onClickIconClose:g.closeHandler,buttons:"comment"===e?[{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Close"}),color:"cancel",clickHandler:()=>d(!1)}]:void 0,title:m.formatMessage({id:"WIDGET_Builder"})},"comment"===e?l().createElement(bt,{column:!0},u.map(((e,t)=>l().createElement(yt,{key:e.name,open:!0,full:!0,parentIsColumn:!0,index:t,onClick:()=>p(e.name)},l().createElement(Ct,{direction:"row",gap:12},l().createElement("img",{src:e.img}),l().createElement(Ct,{direction:"column"},l().createElement("h3",null,m.formatMessage({id:e.label})),l().createElement("p",null,m.formatMessage({id:e.description})))))))):l().createElement(ft,null,u.map(((e,t)=>l().createElement(Et,{key:t,onClick:()=>p(e.name),available:e.available},l().createElement("img",{src:e.img}),l().createElement("div",{className:"show-on-hover"},m.formatMessage({id:e.label})))))))),"custom"===e&&n?l().createElement("div",{onClick:()=>d(!0)},n):l().createElement(l().Fragment,null),"button"===e&&"edit"===t?l().createElement(xt,{onClick:()=>d(!0),variant:"outlined",minWidth:"100%"},m.formatMessage({id:"WIDGET_Add_Widget"})):l().createElement(l().Fragment,null),"gallery"===e&&"edit"===t?l().createElement(ft,null,u.map(((e,t)=>l().createElement(Et,{key:t,onClick:()=>p(e.name),available:e.available},l().createElement("img",{src:e.img}),l().createElement("div",{className:"show-on-hover"},m.formatMessage({id:e.label})))))):l().createElement(l().Fragment,null),"article"===e&&"edit"===t?l().createElement(qt,{widgets:u,onClick:p}):l().createElement(l().Fragment,null),"comment"===e&&"edit"===t?l().createElement(St,{onClick:()=>{d(!0)}}):l().createElement(l().Fragment,null))},qt=({widgets:e,onClick:t})=>{const[n,o]=(0,i.useState)(!1),a=(0,r.useIntl)(),s=(0,i.useMemo)((()=>80*Math.ceil(e.length/2)+50+10),[e]);return l().createElement(l().Fragment,null,l().createElement(ht,{open:n,height:s},l().createElement(vt,{onClick:()=>o(!n)},a.formatMessage({id:"WIDGET_Add_Widget"})),l().createElement(bt,null,e.map(((e,i)=>l().createElement(yt,{key:e.name,open:n,index:i,onClick:()=>t(e.name)},l().createElement("img",{src:e.img}),a.formatMessage({id:e.label})))))))},St=({onClick:e})=>{const t=(0,r.useIntl)();return l().createElement(l().Fragment,null,l().createElement(Lt,{description:t.formatMessage({id:"COMMENT_Add_Widget"})},l().createElement(Wt,{bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:22,onClick:()=>{e()},icon:"icon-fs-puzzle"})))},jt=()=>{const e=(0,r.useIntl)(),[t,n]=(0,i.useState)(!1),[l,o]=(0,i.useState)();return{open:t,onInsert:e=>{null==l||l.execCommand("InsertHTML",!1,e)},close:()=>n(!1),ext:(0,i.useMemo)((()=>s.JTinyMCEExtensionsBuilders.markdown((e=>{o(e),n(!0)}),e)),[e]),isActive:!0}};var Mt=n(730),Tt=n(876);const At=d.j.getLazyComponent("InputFileAdvancedRaw"),It=a().div`
293
295
  width: 0;
294
296
  height: 0;
295
297
  overflow: hidden;
296
- `,It=({children:e,initialFiles:t,initialClick:n,multiple:o,accept:a,onUploadStart:r,onUploadEnd:s,onUploadSuccess:d})=>{const m=(0,i.useRef)(null),g=(0,u.GV)(c.x0.selectors.selectToken),[p,f]=(0,i.useState)(0),[E,h]=(0,i.useState)(t);return(0,i.useEffect)((()=>{var e;n&&(null===(e=m.current)||void 0===e||e.click())}),[n]),(0,i.useEffect)((()=>{t.length!==E.length&&h(t)}),[t]),(0,i.useEffect)((()=>{d(E)}),[E]),(0,i.useEffect)((()=>{0===p&&s()}),[p]),l().createElement(l().Fragment,null,l().createElement("div",{onClick:()=>{var e;n&&(null===(e=m.current)||void 0===e||e.click())}},e),l().createElement(At,null,l().createElement(Tt,{ref:m,id:"widget-upload-file",name:"editorFiles",content:"",accept:a,multiple:o,token:g,onUploadStart:e=>{void 0!==e&&f((t=>t+e)),"function"==typeof r&&0!==e&&r()},onUploadSuccess:e=>{void 0!==e&&(f((e=>void 0!==e?e-1:0)),h((t=>o?[...t,e]:[e])))}})))},Ot=d.j.getLazyComponent("WidgetAttachment"),zt=d.j.getLazyComponent("WidgetEmptyInplace"),Gt=d.j.getLazyComponent("FileViewer"),Dt=a().div`
298
+ `,Ot=({children:e,initialFiles:t,initialClick:n,multiple:o,accept:a,onUploadStart:r,onUploadEnd:s,onUploadSuccess:d})=>{const m=(0,i.useRef)(null),g=(0,u.GV)(c.x0.selectors.selectToken),[p,f]=(0,i.useState)(0),[E,h]=(0,i.useState)(t);return(0,i.useEffect)((()=>{var e;n&&(null===(e=m.current)||void 0===e||e.click())}),[n]),(0,i.useEffect)((()=>{t.length!==E.length&&h(t)}),[t]),(0,i.useEffect)((()=>{d(E)}),[E]),(0,i.useEffect)((()=>{0===p&&s()}),[p]),l().createElement(l().Fragment,null,l().createElement("div",{onClick:()=>{var e;n&&(null===(e=m.current)||void 0===e||e.click())}},e),l().createElement(It,null,l().createElement(At,{ref:m,id:"widget-upload-file",name:"editorFiles",content:"",accept:a,multiple:o,token:g,onUploadStart:e=>{void 0!==e&&f((t=>t+e)),"function"==typeof r&&0!==e&&r()},onUploadSuccess:e=>{void 0!==e&&(f((e=>void 0!==e?e-1:0)),h((t=>o?[...t,e]:[e])))}})))},zt=d.j.getLazyComponent("WidgetAttachment"),Gt=d.j.getLazyComponent("WidgetEmptyInplace"),Dt=d.j.getLazyComponent("FileViewer"),Vt=a().div`
297
299
  flex: 1;
298
- `,Vt=({widget:e,inplace:t,mode:n})=>{const o=(0,r.useIntl)(),{uniqid:a}=e,{files:s}=e.content,d=(0,u.jL)(),m=(0,u.GV)((e=>c.x0.selectors.isActive(e,a)),le.shallowEqual),g=e=>{d(c.y8.actions.error({label:null!=e?e:o.formatMessage({id:"GLOBAL_Error"})}))};(0,i.useEffect)((()=>{d(c.x0.slice.actions.setWidgetState({uniqid:a,mounted:!0}))}),[]),(0,i.useEffect)((()=>{d(c.x0.slice.actions.setWidgetState({uniqid:a,empty:!s||0===s.length}))}),[s]);const p=(0,u.GV)((e=>c.lg.selectors.selectById(e,"WeDocHook"))),f=[{label:o.formatMessage({id:"WIDGET_Open_With_Wedoc"}),onClick:e=>{e&&k().object.getAccessHash(`fileArticle/${e.id}`).then((t=>{if(""===t.result)throw new Error("result empty");const n=t.result;((e,t)=>{window.open(function(e,t){return`/ng/rr/file/${e}/${t}`}(e,t),void 0)})(e.id,n)})).catch((()=>{d(c.y8.actions.error({label:"WIDGET_Open_Failed"},6e3))}))}}],E=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:f}]:[];return void 0!==s?l().createElement(Dt,null,"view"!==n?l().createElement(Ot,{files:s,onClick:()=>{},onError:g}):l().createElement(Gt,{files:s,openWithOptions:E},(e=>l().createElement(Ot,{files:s.map((e=>Object.assign(Object.assign({},e),{uri:(0,w.resolveFilePath)(e)}))),onClick:t=>e(t),onError:g}))),t&&"view"!==n&&l().createElement(It,{initialFiles:s,initialClick:m,multiple:!0,accept:"*",onUploadSuccess:e=>{Array.isArray(e)&&d((0,c.vR)(a,{files:e.map((e=>{var t;return Object.assign(Object.assign({},e),{uri:null!==(t=(0,w.resolveFilePath)(e))&&void 0!==t?t:""})}))}))},onUploadStart:()=>{d(c.x0.slice.actions.setWidgetState({uniqid:a,loading:!0}))},onUploadEnd:()=>{d(c.x0.slice.actions.setWidgetState({uniqid:a,loading:!1}))}},"edit"===n?l().createElement(zt,{label:"WIDGET_Article_Attachment_Empty_Label",description:"WIDGET_Article_Attachment_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}}):l().createElement(l().Fragment,null))):l().createElement(l().Fragment,null)},Ft=d.j.getLazyComponent("WidgetButton"),$t=a().div`
300
+ `,Ft=({widget:e,inplace:t,mode:n})=>{const o=(0,r.useIntl)(),{uniqid:a}=e,{files:s}=e.content,d=(0,u.jL)(),m=(0,u.GV)((e=>c.x0.selectors.isActive(e,a)),oe.shallowEqual),g=e=>{d(c.y8.actions.error({label:null!=e?e:o.formatMessage({id:"GLOBAL_Error"})}))};(0,i.useEffect)((()=>{d(c.x0.slice.actions.setWidgetState({uniqid:a,mounted:!0}))}),[]),(0,i.useEffect)((()=>{d(c.x0.slice.actions.setWidgetState({uniqid:a,empty:!s||0===s.length}))}),[s]);const p=(0,u.GV)((e=>c.lg.selectors.selectById(e,"WeDocHook"))),f=[{label:o.formatMessage({id:"WIDGET_Open_With_Wedoc"}),onClick:e=>{e&&L().object.getAccessHash(`fileArticle/${e.id}`).then((t=>{if(""===t.result)throw new Error("result empty");const n=t.result;((e,t)=>{window.open(function(e,t){return`/ng/rr/file/${e}/${t}`}(e,t),void 0)})(e.id,n)})).catch((()=>{d(c.y8.actions.error({label:"WIDGET_Open_Failed"},6e3))}))}}],E=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:f}]:[];return void 0!==s?l().createElement(Vt,null,"view"!==n?l().createElement(zt,{files:s,onClick:()=>{},onError:g}):l().createElement(Dt,{files:s,openWithOptions:E},(e=>l().createElement(zt,{files:s.map((e=>Object.assign(Object.assign({},e),{uri:(0,k.resolveFilePath)(e)}))),onClick:t=>e(t),onError:g}))),t&&"view"!==n&&l().createElement(Ot,{initialFiles:s,initialClick:m,multiple:!0,accept:"*",onUploadSuccess:e=>{Array.isArray(e)&&d((0,c.vR)(a,{files:e.map((e=>{var t;return Object.assign(Object.assign({},e),{uri:null!==(t=(0,k.resolveFilePath)(e))&&void 0!==t?t:""})}))}))},onUploadStart:()=>{d(c.x0.slice.actions.setWidgetState({uniqid:a,loading:!0}))},onUploadEnd:()=>{d(c.x0.slice.actions.setWidgetState({uniqid:a,loading:!1}))}},"edit"===n?l().createElement(Gt,{label:"WIDGET_Article_Attachment_Empty_Label",description:"WIDGET_Article_Attachment_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}}):l().createElement(l().Fragment,null))):l().createElement(l().Fragment,null)},$t=d.j.getLazyComponent("WidgetButton"),Rt=a().div`
299
301
  display: flex;
300
302
  flex: 1;
301
303
  justify-content: center;
302
304
  align-items: center;
303
- `,Rt=a().div`
305
+ `,Bt=a().div`
304
306
  pointer-events: ${e=>e.clickable?"all":"none"};
305
307
  cursor: pointer;
306
308
  display: flex;
307
309
  flex: 1;
308
310
  justify-content: center;
309
311
  align-items: center;
310
- `,Bt=({widget:e,mode:t})=>{const n=(0,u.jL)(),{uniqid:o}=e,{text:a,url:r,target:s,color:d,backgroundColor:m,buttonSize:g,borderRadius:p,variant:f}=e.content;return(0,i.useEffect)((()=>{n(c.x0.slice.actions.setWidgetState({uniqid:o,empty:!a||0===a.length}))}),[a]),l().createElement($t,{onClick:()=>{"edit"===t&&n(c.cr.slice.actions.registerEditor({uniqid:o,name:e.name}))}},l().createElement(Rt,{clickable:"edit"!==t},l().createElement(Ft,{text:a,url:r,target:s,color:d,backgroundColor:m,buttonSize:g,borderRadius:p,variant:f})))},Ht=d.j.getLazyComponent("WidgetArticleGallery"),Pt=d.j.getLazyComponent("WidgetEmptyInplace"),Ut=d.j.getLazyComponent("FileViewer"),Nt=a().button`
312
+ `,Ht=({widget:e,mode:t})=>{const n=(0,u.jL)(),{uniqid:o}=e,{text:a,url:r,target:s,color:d,backgroundColor:m,buttonSize:g,borderRadius:p,variant:f}=e.content;return(0,i.useEffect)((()=>{n(c.x0.slice.actions.setWidgetState({uniqid:o,empty:!a||0===a.length}))}),[a]),l().createElement(Rt,{onClick:()=>{"edit"===t&&n(c.cr.slice.actions.registerEditor({uniqid:o,name:e.name}))}},l().createElement(Bt,{clickable:"edit"!==t},l().createElement($t,{text:a,url:r,target:s,color:d,backgroundColor:m,buttonSize:g,borderRadius:p,variant:f})))},Pt=d.j.getLazyComponent("WidgetArticleGallery"),Ut=d.j.getLazyComponent("WidgetEmptyInplace"),Nt=d.j.getLazyComponent("FileViewer"),Yt=a().button`
311
313
  cursor: pointer;
312
- `,Yt=({widget:e,inplace:t,mode:n})=>{var o,a;const{uniqid:r}=e,{files:s}=e.content,d=(0,u.jL)(),m=(0,u.GV)((e=>c.x0.selectors.isActive(e,r)),le.shallowEqual);return(0,i.useEffect)((()=>{d(c.x0.slice.actions.setWidgetState({uniqid:r,mounted:!0}))}),[]),void 0!==s?l().createElement(l().Fragment,null,"edit"===n?l().createElement(Ht,{files:s,maxWidth:800,gap:null!==(o=e.content.gap)&&void 0!==o?o:"10",column:null!==(a=e.content.column)&&void 0!==a?a:"3",onClick:()=>{}}):l().createElement(Ut,{files:s,openWithOptions:[]},(t=>{var n,i;return l().createElement(Nt,null,l().createElement(Ht,{files:s,maxWidth:600,gap:null!==(n=e.content.gap)&&void 0!==n?n:"10",column:null!==(i=e.content.column)&&void 0!==i?i:"3",onClick:e=>t(e)}))})),t&&"edit"===n?l().createElement(It,{initialFiles:s,initialClick:m,accept:"image/png, image/jpeg, image/jpg",multiple:!0,onUploadSuccess:e=>{Array.isArray(e)&&d((0,c.vR)(r,{files:e}))},onUploadStart:()=>{d(c.x0.slice.actions.setWidgetState({uniqid:r,loading:!0}))},onUploadEnd:()=>{d(c.x0.slice.actions.setWidgetState({uniqid:r,loading:!1}))}},l().createElement(Pt,{label:"WIDGET_Article_Gallery_Empty_Label",description:"WIDGET_Article_Gallery_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},Jt=a().div`
314
+ `,Jt=({widget:e,inplace:t,mode:n})=>{var o,a;const{uniqid:r}=e,{files:s}=e.content,d=(0,u.jL)(),m=(0,u.GV)((e=>c.x0.selectors.isActive(e,r)),oe.shallowEqual);return(0,i.useEffect)((()=>{d(c.x0.slice.actions.setWidgetState({uniqid:r,mounted:!0}))}),[]),void 0!==s?l().createElement(l().Fragment,null,"edit"===n?l().createElement(Pt,{files:s,maxWidth:800,gap:null!==(o=e.content.gap)&&void 0!==o?o:"10",column:null!==(a=e.content.column)&&void 0!==a?a:"3",onClick:()=>{}}):l().createElement(Nt,{files:s,openWithOptions:[]},(t=>{var n,i;return l().createElement(Yt,null,l().createElement(Pt,{files:s,maxWidth:600,gap:null!==(n=e.content.gap)&&void 0!==n?n:"10",column:null!==(i=e.content.column)&&void 0!==i?i:"3",onClick:e=>t(e)}))})),t&&"edit"===n?l().createElement(Ot,{initialFiles:s,initialClick:m,accept:"image/png, image/jpeg, image/jpg",multiple:!0,onUploadSuccess:e=>{Array.isArray(e)&&d((0,c.vR)(r,{files:e}))},onUploadStart:()=>{d(c.x0.slice.actions.setWidgetState({uniqid:r,loading:!0}))},onUploadEnd:()=>{d(c.x0.slice.actions.setWidgetState({uniqid:r,loading:!1}))}},l().createElement(Ut,{label:"WIDGET_Article_Gallery_Empty_Label",description:"WIDGET_Article_Gallery_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},Qt=a().div`
313
315
  display: flex;
314
316
  flex-direction: column;
315
- `,Qt=({uniqid:e,children:t})=>{const n=(0,u.GV)((t=>c.x0.selectors.selectWidgetWrapperStyle(t,e)),le.shallowEqual),o=(0,i.useMemo)((()=>({padding:n&&n.padding?`${n.padding}px`:"0px"})),[n]);return l().createElement(Jt,{style:{padding:o.padding}},t)},Xt=a().div`
317
+ `,Kt=({uniqid:e,children:t})=>{const n=(0,u.GV)((t=>c.x0.selectors.selectWidgetWrapperStyle(t,e)),oe.shallowEqual),o=(0,i.useMemo)((()=>({padding:n&&n.padding?`${n.padding}px`:"0px"})),[n]);return l().createElement(Qt,{style:{padding:o.padding}},t)},Xt=a().div`
316
318
  flex-direction: column;
317
319
  display: flex;
318
320
  flex: 1;
319
- `,Kt=a().div`
321
+ `,Zt=a().div`
320
322
  position: relative;
321
323
  display: flex;
322
324
  flex: 1;
323
- `,Zt=a().div`
325
+ `,en=a().div`
324
326
  overflow: auto;
325
327
  position: absolute;
326
328
  inset: 0;
327
- `,en=({header:e,scrollable:t,footer:n})=>l().createElement(Xt,null,e&&e(),l().createElement(Kt,null,l().createElement(Zt,null,t&&t())),n&&n()),tn=a().div`
329
+ `,tn=({header:e,scrollable:t,footer:n})=>l().createElement(Xt,null,e&&e(),l().createElement(Zt,null,l().createElement(en,null,t&&t())),n&&n()),nn=a().div`
328
330
  padding: ${e=>e.theme.space.md}px;
329
331
  padding-right: 0px;
330
- `,nn=a().div`
332
+ `,ln=a().div`
331
333
  text-align: ${e=>e.textAlign};
332
334
  font-size: ${e=>e.fontSize}px;
333
335
  font-weight: ${e=>e.fontWeight};
334
336
  color: ${e=>e.color};
335
- `,ln=({uniqid:e,textAlign:t="left",fontSize:n="16",fontWeight:i="medium",color:o})=>{const a=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e)),le.shallowEqual);return l().createElement(l().Fragment,null,a&&"string"==typeof a.title&&0!==a.title.length&&l().createElement(tn,null,l().createElement(nn,{textAlign:t,fontSize:n,fontWeight:i,color:o},a.title)))},on=a().div`
337
+ `,on=({uniqid:e,textAlign:t="left",fontSize:n="16",fontWeight:i="medium",color:o})=>{const a=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e)),oe.shallowEqual);return l().createElement(l().Fragment,null,a&&"string"==typeof a.title&&0!==a.title.length&&l().createElement(nn,null,l().createElement(ln,{textAlign:t,fontSize:n,fontWeight:i,color:o},a.title)))},an=a().div`
336
338
  background-color: ${e=>e.backroundColor};
337
- `,an=a().div`
339
+ `,rn=a().div`
338
340
  display: flex;
339
341
  flex-direction: row;
340
342
  align-items: center;
341
- `,rn=(a().div`
343
+ `,sn=(a().div`
342
344
  padding: ${e=>e.theme.space.sm}px ${e=>e.theme.space.md}px;
343
345
  color: ${e=>e.theme.color.grey4};
344
346
  `,a().div`
@@ -347,13 +349,13 @@
347
349
  flex-direction: row;
348
350
  gap: ${e=>e.theme.space.xs}px;
349
351
  align-items: center;
350
- `),sn=({uniqid:e,dropdown:t,subHeader:n})=>{const a=(0,o.useTheme)(),r=(0,u.GV)((t=>c.x0.selectors.selectWidgetTitleStyle(t,e)),le.shallowEqual),s=(0,i.useMemo)((()=>({color:r&&r.color?String(r.color):a.color.black,backgroundColor:r&&r["background-color"]?String(r["background-color"]):"transparent",fontSize:r&&r["font-size"]?String(r["font-size"]):"16",fontWeight:r&&r["font-weight"]?String(r["font-weight"]):"medium",textAlign:r&&r["text-align"]?String(r["text-align"]):"left"})),[r,a]);return l().createElement(on,{backroundColor:s.backgroundColor},l().createElement(an,null,l().createElement(rn,null,l().createElement(ln,{uniqid:e,fontWeight:s.fontWeight,fontSize:s.fontSize,textAlign:s.textAlign,color:s.color}),n&&n(s.color)),t&&t()))},cn=a().div`
352
+ `),cn=({uniqid:e,dropdown:t,subHeader:n})=>{const a=(0,o.useTheme)(),r=(0,u.GV)((t=>c.x0.selectors.selectWidgetTitleStyle(t,e)),oe.shallowEqual),s=(0,i.useMemo)((()=>({color:r&&r.color?String(r.color):a.color.black,backgroundColor:r&&r["background-color"]?String(r["background-color"]):"transparent",fontSize:r&&r["font-size"]?String(r["font-size"]):"16",fontWeight:r&&r["font-weight"]?String(r["font-weight"]):"medium",textAlign:r&&r["text-align"]?String(r["text-align"]):"left"})),[r,a]);return l().createElement(an,{backroundColor:s.backgroundColor},l().createElement(rn,null,l().createElement(sn,null,l().createElement(on,{uniqid:e,fontWeight:s.fontWeight,fontSize:s.fontSize,textAlign:s.textAlign,color:s.color}),n&&n(s.color)),t&&t()))},dn=a().div`
351
353
  position: absolute;
352
354
  inset: 0;
353
355
  display: flex;
354
356
  justify-content: center;
355
357
  align-items: center;
356
- `,dn=d.j.getLazyComponent("WidgetLuccaAbsence"),un=({uniqid:e})=>{const[t,n]=(0,i.useState)([]),[o,a]=(0,i.useState)(!1),[c,d]=(0,i.useState)(!0),u=(0,$.Ie)(),m=(0,i.useMemo)((()=>(new Date).getFullYear()+"-"+((new Date).getMonth()+1).toString().padStart(2,"0")+"-"+(new Date).getDate().toString().padStart(2,"0")+" 00:00:00"),[]);return(0,i.useEffect)((()=>{k().lucca.getAbsence({date:m},{signal:u.signal}).then((({result:e})=>n(e))).catch((()=>{u.signal.aborted||a(!0)})).finally((()=>d(!1)))}),[m,u.signal]),c?l().createElement(cn,null,l().createElement(s.JRCLoader,{size:"m"})):o?l().createElement(cn,null,l().createElement(r.FormattedMessage,{id:"WIDGET_Lucca_Absence_Url_Error"})):l().createElement(en,{header:()=>l().createElement(sn,{uniqid:e}),scrollable:()=>l().createElement(Qt,{uniqid:e},l().createElement(dn,{list:t}))})},mn=d.j.getLazyComponent("WidgetImage"),gn=d.j.getLazyComponent("FileViewer"),pn=d.j.getLazyComponent("WidgetEmptyInplace"),fn=a().div`
358
+ `,un=d.j.getLazyComponent("WidgetLuccaAbsence"),mn=({uniqid:e})=>{const[t,n]=(0,i.useState)([]),[o,a]=(0,i.useState)(!1),[c,d]=(0,i.useState)(!0),u=(0,R.Ie)(),m=(0,i.useMemo)((()=>(new Date).getFullYear()+"-"+((new Date).getMonth()+1).toString().padStart(2,"0")+"-"+(new Date).getDate().toString().padStart(2,"0")+" 00:00:00"),[]);return(0,i.useEffect)((()=>{L().lucca.getAbsence({date:m},{signal:u.signal}).then((({result:e})=>n(e))).catch((()=>{u.signal.aborted||a(!0)})).finally((()=>d(!1)))}),[m,u.signal]),c?l().createElement(dn,null,l().createElement(s.JRCLoader,{size:"m"})):o?l().createElement(dn,null,l().createElement(r.FormattedMessage,{id:"WIDGET_Lucca_Absence_Url_Error"})):l().createElement(tn,{header:()=>l().createElement(cn,{uniqid:e}),scrollable:()=>l().createElement(Kt,{uniqid:e},l().createElement(un,{list:t}))})},gn=d.j.getLazyComponent("WidgetImage"),pn=d.j.getLazyComponent("FileViewer"),fn=d.j.getLazyComponent("WidgetEmptyInplace"),En=a().div`
357
359
  position: absolute;
358
360
  inset: 0;
359
361
  background-color: rgba(0, 0, 0, 0.4);
@@ -366,16 +368,16 @@
366
368
  &:hover {
367
369
  opacity: 1;
368
370
  }
369
- `,En=a().button`
371
+ `,hn=a().button`
370
372
  cursor: pointer;
371
- `,hn={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},bn=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},vn=({widget:e,width:t,inplace:n,mode:o})=>{const{uniqid:a}=e,{file:s,useFilter:d}=e.content,m=(0,u.jL)(),g=(0,u.GV)((e=>c.x0.selectors.isActive(e,a)),le.shallowEqual),[p,f]=(0,i.useState)(void 0),E=(0,r.useIntl)();return(0,i.useEffect)((()=>{m(c.x0.slice.actions.setWidgetState({uniqid:a,mounted:!0}))}),[]),(0,i.useEffect)((()=>{m(c.x0.slice.actions.setWidgetState({uniqid:a,empty:!s}))}),[s]),(0,i.useEffect)((()=>{s&&f((0,w.formatImgUrl)({timestamp:s.dateModified?bn(s.dateModified):Date.now(),from:"imagecache",size:"fitx1200",uri:s.uri}))}),[s]),l().createElement(l().Fragment,null,"edit"!==o&&l().createElement(gn,{files:[Object.assign(Object.assign(Object.assign({},hn),s),{path:p,mimetype:"image/png"})],openWithOptions:[]},(e=>l().createElement(En,{onClick:()=>{var t;return e(null!==(t=null==s?void 0:s.id)&&void 0!==t?t:0)}},l().createElement(mn,{maxWidth:null!=t?t:600,uri:p,useFilter:null!=d&&d})))),"edit"===o&&l().createElement(l().Fragment,null,void 0!==p&&l().createElement(mn,{maxWidth:null!=t?t:600,uri:p,useFilter:null!=d&&d}),n&&l().createElement(It,{initialFiles:[],initialClick:g,accept:"image/png, image/jpeg, image/jpg",multiple:!1,onUploadSuccess:e=>{Array.isArray(e)&&void 0!==e[0]&&m((0,c.vR)(a,{file:e[0]}))},onUploadStart:()=>{m(c.x0.slice.actions.setWidgetState({uniqid:a,loading:!0}))},onUploadEnd:()=>{m(c.x0.slice.actions.setWidgetState({uniqid:a,loading:!1}))}},void 0!==s?l().createElement(fn,null,E.formatMessage({id:"ARTICLE_Widget_Image_Change"})):l().createElement(pn,{label:"WIDGET_Article_Image_Empty_Label",description:"WIDGET_Article_Image_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}}))))},yn=d.j.getLazyComponent("FileViewer"),Cn=d.j.getLazyComponent("WidgetEmptyInplace"),xn=d.j.getLazyComponent("WidgetSlider"),wn=a().div`
373
+ `,bn={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},vn=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},yn=({widget:e,width:t,inplace:n,mode:o})=>{const{uniqid:a}=e,{file:s,useFilter:d}=e.content,m=(0,u.jL)(),g=(0,u.GV)((e=>c.x0.selectors.isActive(e,a)),oe.shallowEqual),[p,f]=(0,i.useState)(void 0),E=(0,r.useIntl)();return(0,i.useEffect)((()=>{m(c.x0.slice.actions.setWidgetState({uniqid:a,mounted:!0}))}),[]),(0,i.useEffect)((()=>{m(c.x0.slice.actions.setWidgetState({uniqid:a,empty:!s}))}),[s]),(0,i.useEffect)((()=>{s&&f((0,k.formatImgUrl)({timestamp:s.dateModified?vn(s.dateModified):Date.now(),from:"imagecache",size:"fitx1200",uri:s.uri}))}),[s]),l().createElement(l().Fragment,null,"edit"!==o&&l().createElement(pn,{files:[Object.assign(Object.assign(Object.assign({},bn),s),{path:p,mimetype:"image/png"})],openWithOptions:[]},(e=>l().createElement(hn,{onClick:()=>{var t;return e(null!==(t=null==s?void 0:s.id)&&void 0!==t?t:0)}},l().createElement(gn,{maxWidth:null!=t?t:600,uri:p,useFilter:null!=d&&d})))),"edit"===o&&l().createElement(l().Fragment,null,void 0!==p&&l().createElement(gn,{maxWidth:null!=t?t:600,uri:p,useFilter:null!=d&&d}),n&&l().createElement(Ot,{initialFiles:[],initialClick:g,accept:"image/png, image/jpeg, image/jpg",multiple:!1,onUploadSuccess:e=>{Array.isArray(e)&&void 0!==e[0]&&m((0,c.vR)(a,{file:e[0]}))},onUploadStart:()=>{m(c.x0.slice.actions.setWidgetState({uniqid:a,loading:!0}))},onUploadEnd:()=>{m(c.x0.slice.actions.setWidgetState({uniqid:a,loading:!1}))}},void 0!==s?l().createElement(En,null,E.formatMessage({id:"ARTICLE_Widget_Image_Change"})):l().createElement(fn,{label:"WIDGET_Article_Image_Empty_Label",description:"WIDGET_Article_Image_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}}))))},Cn=d.j.getLazyComponent("FileViewer"),xn=d.j.getLazyComponent("WidgetEmptyInplace"),wn=d.j.getLazyComponent("WidgetSlider"),kn=a().div`
372
374
  flex: 1;
373
375
  display: flex;
374
376
  flex-direction: row;
375
377
  min-height: 60px;
376
378
  align-items: center;
377
379
  width: ${e=>e.maxWidth}px;
378
- `,kn={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},Ln=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},Wn=({widget:e,mode:t,width:n})=>{const{uniqid:o}=e,a=(0,u.jL)(),r=(0,u.GV)((e=>c.x0.selectors.isActive(e,o)),le.shallowEqual),s=null!=n?n:600,[d,m]=(0,i.useState)(void 0),g=(0,i.useRef)(null),p=(0,i.useMemo)((()=>e.content.slides?[...e.content.slides.map(((e,t)=>Object.assign(Object.assign({},kn),{id:e.file?e.file.id:t,mimetype:e.file?e.file.mimetype:kn.mimetype,path:e.file&&e.file.uri?(0,w.formatImgUrl)({size:"fitx1200",uri:e.file.uri,from:"imagecache",timestamp:e.file&&e.file.dateModified?Ln(e.file.dateModified):Date.now()}):""})))]:[]),[e.content.slides]),f=(0,i.useMemo)((()=>void 0!==e.content.slides?[...e.content.slides.map((e=>e.file?Object.assign(Object.assign({},e),{uri:(0,w.formatImgUrl)({timestamp:e.file.dateModified?Ln(e.file.dateModified):Date.now(),size:`fitx${d&&d<s?d:s}`,from:"imagecache",uri:e.file.uri})}):Object.assign(Object.assign({},e),{uri:""})))]:[]),[e.content.slides,d,s]);(0,i.useEffect)((()=>{r&&"edit"===t&&a(c.cr.slice.actions.registerEditor({uniqid:o,name:e.name}))}),[r]),(0,i.useEffect)((()=>{const e=()=>{g.current&&m(g.current?g.current.offsetWidth:s)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[g]),(0,i.useEffect)((()=>{m(g.current?g.current.offsetWidth:s)}),[g]),(0,i.useEffect)((()=>{a(c.x0.slice.actions.setWidgetState({uniqid:o,empty:!e.content.slides||0===e.content.slides.length}))}),[e.content.slides]);const E=(0,i.useMemo)((()=>"edit"===t&&Array.isArray(e.content.slides)&&0===e.content.slides.length),[e.content.slides,t]),h=(0,i.useCallback)((()=>{a(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))}),[a,e.uniqid,e.name]);return void 0===d?l().createElement("div",{ref:g,style:{width:"100%"}}):l().createElement(wn,{maxWidth:d&&d<s?d:s},l().createElement(yn,{files:p,openWithOptions:[]},(n=>{var i,r;return l().createElement(xn,{slides:f,maxWidth:d&&d<s?d:s,useDots:null===(i=e.content.useDots)||void 0===i||i,loop:null!==(r=e.content.loop)&&void 0!==r&&r,startAt:0,onClickSlide:i=>{if("edit"!==t){if(e.content.slides){const t=e.content.slides[i];t&&t.file&&n(t.file.id)}}else a(c.cr.slice.actions.registerEditor({uniqid:o,name:e.name}))}})})),E?l().createElement(Cn,{label:"WIDGET_Article_Slider_Empty_Label",description:"WIDGET_Article_Slider_Empty_Description",url:"widget-article-image-placeholder.png",onClick:h}):l().createElement(l().Fragment,null))};var _n=n(201);const qn=d.j.getLazyComponent("InputTextareaRaw"),Sn=d.j.getLazyComponent("Modal"),jn=({onInsert:e,open:t,close:n})=>{const o=(0,r.useIntl)(),[a,s]=(0,i.useState)(""),c=(0,i.useCallback)((()=>{s(""),n()}),[n]);return l().createElement(Sn,{title:o.formatMessage({id:"TINY_MCE_Insert_Markdown"}),open:t,closeHandler:c,enableClickAwayCloseModal:!0,buttons:[{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:c},{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Insert"}),color:"valid",disabled:!a,clickHandler:()=>{e(_n.xI.parse(a,{async:!1}).replace(/<br>/g,"<br><br>")),c()}}]},l().createElement(qn,{value:a,onChange:e=>s(e.target.value),height:"400px"}))},Mn=d.j.getLazyComponent("WidgetArticleText"),Tn=a().div`
380
+ `,Ln={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},Wn=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},_n=({widget:e,mode:t,width:n})=>{const{uniqid:o}=e,a=(0,u.jL)(),r=(0,u.GV)((e=>c.x0.selectors.isActive(e,o)),oe.shallowEqual),s=null!=n?n:600,[d,m]=(0,i.useState)(void 0),g=(0,i.useRef)(null),p=(0,i.useMemo)((()=>e.content.slides?[...e.content.slides.map(((e,t)=>Object.assign(Object.assign({},Ln),{id:e.file?e.file.id:t,mimetype:e.file?e.file.mimetype:Ln.mimetype,path:e.file&&e.file.uri?(0,k.formatImgUrl)({size:"fitx1200",uri:e.file.uri,from:"imagecache",timestamp:e.file&&e.file.dateModified?Wn(e.file.dateModified):Date.now()}):""})))]:[]),[e.content.slides]),f=(0,i.useMemo)((()=>void 0!==e.content.slides?[...e.content.slides.map((e=>e.file?Object.assign(Object.assign({},e),{uri:(0,k.formatImgUrl)({timestamp:e.file.dateModified?Wn(e.file.dateModified):Date.now(),size:`fitx${d&&d<s?d:s}`,from:"imagecache",uri:e.file.uri})}):Object.assign(Object.assign({},e),{uri:""})))]:[]),[e.content.slides,d,s]);(0,i.useEffect)((()=>{r&&"edit"===t&&a(c.cr.slice.actions.registerEditor({uniqid:o,name:e.name}))}),[r]),(0,i.useEffect)((()=>{const e=()=>{g.current&&m(g.current?g.current.offsetWidth:s)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[g]),(0,i.useEffect)((()=>{m(g.current?g.current.offsetWidth:s)}),[g]),(0,i.useEffect)((()=>{a(c.x0.slice.actions.setWidgetState({uniqid:o,empty:!e.content.slides||0===e.content.slides.length}))}),[e.content.slides]);const E=(0,i.useMemo)((()=>"edit"===t&&Array.isArray(e.content.slides)&&0===e.content.slides.length),[e.content.slides,t]),h=(0,i.useCallback)((()=>{a(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))}),[a,e.uniqid,e.name]);return void 0===d?l().createElement("div",{ref:g,style:{width:"100%"}}):l().createElement(kn,{maxWidth:d&&d<s?d:s},l().createElement(Cn,{files:p,openWithOptions:[]},(n=>{var i,r;return l().createElement(wn,{slides:f,maxWidth:d&&d<s?d:s,useDots:null===(i=e.content.useDots)||void 0===i||i,loop:null!==(r=e.content.loop)&&void 0!==r&&r,startAt:0,onClickSlide:i=>{if("edit"!==t){if(e.content.slides){const t=e.content.slides[i];t&&t.file&&n(t.file.id)}}else a(c.cr.slice.actions.registerEditor({uniqid:o,name:e.name}))}})})),E?l().createElement(xn,{label:"WIDGET_Article_Slider_Empty_Label",description:"WIDGET_Article_Slider_Empty_Description",url:"widget-article-image-placeholder.png",onClick:h}):l().createElement(l().Fragment,null))};var qn=n(758);const Sn=d.j.getLazyComponent("InputTextareaRaw"),jn=d.j.getLazyComponent("Modal"),Mn=({onInsert:e,open:t,close:n})=>{const o=(0,r.useIntl)(),[a,s]=(0,i.useState)(""),c=(0,i.useCallback)((()=>{s(""),n()}),[n]);return l().createElement(jn,{title:o.formatMessage({id:"TINY_MCE_Insert_Markdown"}),open:t,closeHandler:c,enableClickAwayCloseModal:!0,buttons:[{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:c},{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Insert"}),color:"valid",disabled:!a,clickHandler:()=>{e(qn.xI.parse(a,{async:!1}).replace(/<br>/g,"<br><br>")),c()}}]},l().createElement(Sn,{value:a,onChange:e=>s(e.target.value),height:"400px"}))},Tn=d.j.getLazyComponent("WidgetArticleText"),An=a().div`
379
381
  width: 100%;
380
382
  cursor: text;
381
383
 
@@ -386,20 +388,20 @@
386
388
  a {
387
389
  word-wrap: break-word;
388
390
  }
389
- `,An=({widget:e,mode:t})=>{const{uniqid:n}=e,a=(0,o.useTheme)(),{text:s}=e.content,d=(0,u.jL)(),m=(0,u.GV)((e=>c.x0.selectors.isActive(e,n)),le.shallowEqual),g=(0,u.GV)((e=>{var t;return null===(t=c.x0.selectors.selectWidgetState(e,n))||void 0===t?void 0:t.busy})),p=(0,u.GV)(c.x0.selectors.selectToken),f=(0,u.GV)(c.sU.selectors.selectTinyMCECommonOptions),E=(0,u.GV)(c.Kx.selectors.selectAll),h=(0,r.useIntl)(),{open:b,onInsert:v,close:y,ext:C,isActive:x}=St(),w=(0,i.useCallback)((e=>{d(c.y8.actions.error({label:null!=e?e:h.formatMessage({id:"GLOBAL_Error"})}))}),[d,h]);(0,i.useEffect)((()=>{d(c.x0.slice.actions.setWidgetState({uniqid:n,empty:!s||0===s.length}))}),[s]);const k=(0,i.useMemo)((()=>(0,jt.X)(E,a,w)),[E,w,a]);return g?l().createElement(l().Fragment,null):l().createElement(Tn,null,l().createElement(Mn,{autoFocus:m,text:null!=s?s:"",token:"edit"===t&&void 0!==p?p:"",tinyMCECommonOptions:"edit"===t&&f?{commonOptions:f,mentionsQueries:k}:void 0,mode:t,onChange:e=>{d((0,c.vR)(n,{text:e}))},additionalExtensions:[C]}),x&&l().createElement(jn,{onInsert:v,open:b,close:y}))},In=d.j.getLazyComponent("WidgetArticleTitle"),On=a().div`
391
+ `,In=({widget:e,mode:t})=>{const{uniqid:n}=e,a=(0,o.useTheme)(),{text:s}=e.content,d=(0,u.jL)(),m=(0,u.GV)((e=>c.x0.selectors.isActive(e,n)),oe.shallowEqual),g=(0,u.GV)((e=>{var t;return null===(t=c.x0.selectors.selectWidgetState(e,n))||void 0===t?void 0:t.busy})),p=(0,u.GV)(c.x0.selectors.selectToken),f=(0,u.GV)(c.sU.selectors.selectTinyMCECommonOptions),E=(0,u.GV)(c.Kx.selectors.selectAll),h=(0,r.useIntl)(),{open:b,onInsert:v,close:y,ext:C,isActive:x}=jt(),w=(0,i.useCallback)((e=>{d(c.y8.actions.error({label:null!=e?e:h.formatMessage({id:"GLOBAL_Error"})}))}),[d,h]);(0,i.useEffect)((()=>{d(c.x0.slice.actions.setWidgetState({uniqid:n,empty:!s||0===s.length}))}),[s]);const k=(0,i.useMemo)((()=>(0,Mt.X)(E,a,w)),[E,w,a]);return g?l().createElement(l().Fragment,null):l().createElement(An,null,l().createElement(Tn,{autoFocus:m,text:null!=s?s:"",token:"edit"===t&&void 0!==p?p:"",tinyMCECommonOptions:"edit"===t&&f?{commonOptions:f,mentionsQueries:k}:void 0,mode:t,onChange:e=>{d((0,c.vR)(n,{text:e}))},additionalExtensions:[C]}),x&&l().createElement(Mn,{onInsert:v,open:b,close:y}))},On=d.j.getLazyComponent("WidgetArticleTitle"),zn=a().div`
390
392
  flex: 1;
391
393
  display: flex;
392
394
  flex-direction: row;
393
395
  align-items: center;
394
396
  cursor: text;
395
- `,zn=a().div`
397
+ `,Gn=a().div`
396
398
  display: flex;
397
399
  flex-direction: row;
398
400
  border-radius: 8px;
399
401
  overflow: hidden;
400
402
  margin: 4px;
401
403
  border: 1px solid ${e=>e.theme.color.grey1};
402
- `,Gn=a().button`
404
+ `,Dn=a().button`
403
405
  display: flex;
404
406
  width: 40px;
405
407
  height: 40px;
@@ -411,18 +413,18 @@
411
413
  &:hover {
412
414
  background-color: ${e=>e.theme.color.grey1};
413
415
  }
414
- `,Dn=({widget:e,inplace:t,mode:n,dataCy:o})=>{const{uniqid:a}=e,{text:r,color:s,heading:d}=e.content,m=(0,u.jL)(),g=(0,u.GV)((e=>c.x0.selectors.isActive(e,a)),le.shallowEqual);return(0,i.useEffect)((()=>{m(c.x0.slice.actions.setWidgetState({uniqid:a,empty:!r||0===r.length}))}),[r]),l().createElement(On,null,l().createElement(In,{dataCy:o,text:r,color:s,heading:d,autoFocus:g,inplace:t,mode:n,onChange:e=>{m((0,c.vR)(a,{text:e}))}}),g&&"edit"===n?l().createElement(Vn,{heading:d,onClick:e=>{m((0,c.vR)(a,{heading:e}))}}):l().createElement(l().Fragment,null))},Vn=({heading:e="h1",onClick:t})=>l().createElement(zn,null,["h1","h2","h3","h4"].map(((n,i)=>l().createElement(Gn,{key:i,isActive:e===n,onClick:()=>t(n)},n))));var Fn=n(586);const $n=d.j.getLazyComponent("Button"),Rn=d.j.getLazyComponent("ModalLayout"),Bn=d.j.getLazyComponent("ModalContent"),Hn=(a().button`
416
+ `,Vn=({widget:e,inplace:t,mode:n,dataCy:o})=>{const{uniqid:a}=e,{text:r,color:s,heading:d}=e.content,m=(0,u.jL)(),g=(0,u.GV)((e=>c.x0.selectors.isActive(e,a)),oe.shallowEqual);return(0,i.useEffect)((()=>{m(c.x0.slice.actions.setWidgetState({uniqid:a,empty:!r||0===r.length}))}),[r]),l().createElement(zn,null,l().createElement(On,{dataCy:o,text:r,color:s,heading:d,autoFocus:g,inplace:t,mode:n,onChange:e=>{m((0,c.vR)(a,{text:e}))}}),g&&"edit"===n?l().createElement(Fn,{heading:d,onClick:e=>{m((0,c.vR)(a,{heading:e}))}}):l().createElement(l().Fragment,null))},Fn=({heading:e="h1",onClick:t})=>l().createElement(Gn,null,["h1","h2","h3","h4"].map(((n,i)=>l().createElement(Dn,{key:i,isActive:e===n,onClick:()=>t(n)},n))));var $n=n(586);const Rn=d.j.getLazyComponent("Button"),Bn=d.j.getLazyComponent("ModalLayout"),Hn=d.j.getLazyComponent("ModalContent"),Pn=(a().button`
415
417
  padding: ${e=>e.theme.space.md}px;
416
418
  `,a().div`
417
419
  padding: ${e=>e.theme.space.md}px;
418
420
  display: flex;
419
421
  flex-direction: row-reverse;
420
- `),Pn=({id:e,type:t,uniqid:n})=>{const o=(0,u.jL)(),a=(0,r.useIntl)(),[d,m]=(0,i.useState)(!1);return l().createElement(l().Fragment,null,l().createElement(s.JRCIconButton,{iconSize:14,onClick:()=>m(!0),icon:"icon-trash"}),d&&l().createElement(Rn,{enableClickAwayCloseModal:!0,open:d,closeHandler:()=>m(!1)},l().createElement(Bn,{overflow:"scroll",title:a.formatMessage({id:"WIDGET_Remove_Widget"}),onClickIconClose:()=>m(!1)},a.formatMessage({id:"WIDGET_Delete_Widget_Confirmation"})),l().createElement(Hn,null,l().createElement($n,{label:a.formatMessage({id:"GLOBAL_Confirm"}),onClick:()=>{k().widget.removeWidget({id:e,type:t,uniqid:n}).then((()=>{o(c.x0.slice.actions.flushWidget({uniqid:n}))})).catch((()=>o(c.y8.actions.error({label:"WIDGET_Presence_Error"}))))}}))))},Un=a().div`
422
+ `),Un=({id:e,type:t,uniqid:n})=>{const o=(0,u.jL)(),a=(0,r.useIntl)(),[d,m]=(0,i.useState)(!1);return l().createElement(l().Fragment,null,l().createElement(s.JRCIconButton,{iconSize:14,onClick:()=>m(!0),icon:"icon-trash"}),d&&l().createElement(Bn,{enableClickAwayCloseModal:!0,open:d,closeHandler:()=>m(!1)},l().createElement(Hn,{overflow:"scroll",title:a.formatMessage({id:"WIDGET_Remove_Widget"}),onClickIconClose:()=>m(!1)},a.formatMessage({id:"WIDGET_Delete_Widget_Confirmation"})),l().createElement(Pn,null,l().createElement(Rn,{label:a.formatMessage({id:"GLOBAL_Confirm"}),onClick:()=>{L().widget.removeWidget({id:e,type:t,uniqid:n}).then((()=>{o(c.x0.slice.actions.flushWidget({uniqid:n}))})).catch((()=>o(c.y8.actions.error({label:"WIDGET_Presence_Error"}))))}}))))},Nn=a().div`
421
423
  display: flex;
422
424
  flex: 1;
423
425
  flex-direction: row;
424
426
  border-top: 1px solid ${e=>e.theme.color.grey1};
425
- `,Nn=a().button`
427
+ `,Yn=a().button`
426
428
  display: flex;
427
429
  flex: 1;
428
430
  justify-content: center;
@@ -431,21 +433,21 @@
431
433
  &:hover {
432
434
  background-color: ${e=>e.theme.color.grey0};
433
435
  }
434
- `,Yn=({name:e,uniqid:t,mode:n,collaborationRights:o,handleOpenEditor:a})=>{const s=(0,r.useIntl)(),d=(0,u.jL)(),m=(0,u.GV)((e=>c.x0.selectors.selectWidgetObject(e,t)),le.shallowEqual),g=(0,u.GV)((e=>c.x0.selectors.selectWidgetObjectRights(e,t)),le.shallowEqual),p=(0,i.useMemo)((()=>m&&g&&g.update||o&&o.update),[m,g,o]),f=(0,i.useMemo)((()=>m&&g&&g.delete),[m,g]),E=(0,i.useCallback)((()=>{d(c.cr.slice.actions.registerEditor({uniqid:t,name:e,mode:n}))}),[t,d,e,n]);return p&&(0,w.ensureWidgetObjectHasMinimumProperties)(m)?l().createElement(Un,null,l().createElement(Nn,{onClick:null!=a?a:E},s.formatMessage({id:"WIDGET_Set_Widget"})),f&&l().createElement(Pn,{id:m.id,type:m.type,uniqid:t})):l().createElement(l().Fragment,null)},Jn=a().div`
436
+ `,Jn=({name:e,uniqid:t,mode:n,collaborationRights:o,handleOpenEditor:a})=>{const s=(0,r.useIntl)(),d=(0,u.jL)(),m=(0,u.GV)((e=>c.x0.selectors.selectWidgetObject(e,t)),oe.shallowEqual),g=(0,u.GV)((e=>c.x0.selectors.selectWidgetObjectRights(e,t)),oe.shallowEqual),p=(0,i.useMemo)((()=>m&&g&&g.update||o&&o.update),[m,g,o]),f=(0,i.useMemo)((()=>m&&g&&g.delete),[m,g]),E=(0,i.useCallback)((()=>{d(c.cr.slice.actions.registerEditor({uniqid:t,name:e,mode:n}))}),[t,d,e,n]);return p&&(0,k.ensureWidgetObjectHasMinimumProperties)(m)?l().createElement(Nn,null,l().createElement(Yn,{onClick:null!=a?a:E},s.formatMessage({id:"WIDGET_Set_Widget"})),f&&l().createElement(Un,{id:m.id,type:m.type,uniqid:t})):l().createElement(l().Fragment,null)},Qn=a().div`
435
437
  padding: ${e=>e.theme.space.md}px;
436
438
  display: flex;
437
439
  flex-direction: row;
438
440
  fieldset {
439
441
  margin: 0.2rem !important;
440
442
  }
441
- `,Qn=({placeholder:e,handleClick:t})=>{const n=(0,r.useIntl)(),o=(0,u.jL)(),[a,c]=(0,i.useState)(""),{control:d,watch:m,reset:g}=(0,T.useForm)({defaultValues:{label:a},criteriaMode:"all"});return(0,i.useEffect)((()=>{const e=m((e=>{var t;c(null!==(t=e.label)&&void 0!==t?t:"")}));return()=>e.unsubscribe()}),[m,o]),l().createElement(Jn,null,l().createElement(s.JRCInputText,{name:"label",control:d,placeholder:e,width:"100%"}),l().createElement(s.JRCButton,{label:n.formatMessage({id:"GLOBAL_Confirm"}),disabled:!a.length,onClick:()=>{t(a),c(""),g()}}))},Xn=a().div`
443
+ `,Kn=({placeholder:e,handleClick:t})=>{const n=(0,r.useIntl)(),o=(0,u.jL)(),[a,c]=(0,i.useState)(""),{control:d,watch:m,reset:g}=(0,A.useForm)({defaultValues:{label:a},criteriaMode:"all"});return(0,i.useEffect)((()=>{const e=m((e=>{var t;c(null!==(t=e.label)&&void 0!==t?t:"")}));return()=>e.unsubscribe()}),[m,o]),l().createElement(Qn,null,l().createElement(s.JRCInputText,{name:"label",control:d,placeholder:e,width:"100%"}),l().createElement(s.JRCButton,{label:n.formatMessage({id:"GLOBAL_Confirm"}),disabled:!a.length,onClick:()=>{t(a),c(""),g()}}))},Xn=a().div`
442
444
  position: absolute;
443
445
  inset: 0;
444
446
  display: flex;
445
447
  justify-content: center;
446
448
  align-items: center;
447
449
  background-color: rgba(255, 255, 255, 0.4);
448
- `,Kn=()=>l().createElement(Xn,null,l().createElement(s.JRCLoader,{size:"m"})),Zn=d.j.getLazyComponent("WidgetCheckList"),ei=d.j.getLazyComponent("WidgetCheckListEditor"),ti=(a().div`
450
+ `,Zn=()=>l().createElement(Xn,null,l().createElement(s.JRCLoader,{size:"m"})),ei=d.j.getLazyComponent("WidgetCheckList"),ti=d.j.getLazyComponent("WidgetCheckListEditor"),ni=(a().div`
449
451
  display: flex;
450
452
  flex-direction: row;
451
453
  justify-content: space-between;
@@ -459,9 +461,9 @@
459
461
  display: flex;
460
462
  gap: 14px;
461
463
  padding: 16px;
462
- `),ni=a().div`
464
+ `),ii=a().div`
463
465
  position: relative;
464
- `,ii=({widget:e,inplace:t,mode:n,onWidgetUpdate:o})=>{var a;const d=(0,r.useIntl)(),{uniqid:m,content:g}=e,p=(0,u.jL)(),[f,E]=(0,i.useState)(),[h,b]=(0,i.useState)(!1),[v,y]=(0,i.useState)(),[C,x]=(0,i.useState)(!1),L=(0,u.GV)(c.x0.selectors.selectToken,le.shallowEqual),W=(0,u.GV)((t=>c.x0.selectors.selectWidgetObjectUri(t,e.uniqid)),le.shallowEqual),_=(0,u.GV)((e=>c.x0.selectors.selectWidgetObjectRights(e,m)),le.shallowEqual),q=(0,u.GV)((t=>c.x0.selectors.selectAllWidgetRTObject(t,e.uniqid)),le.shallowEqual),S=(0,i.useMemo)((()=>_&&_.update),[_]),j=(0,i.useMemo)((()=>_&&_.administrate),[_]),M=(0,i.useCallback)((e=>{p(c.y8.actions.error({label:null!=e?e:d.formatMessage({id:"GLOBAL_Error"})}))}),[p,d]),T=(0,i.useCallback)((()=>{f||h||(b(!0),k().network.token().then((e=>{E(e.result),b(!1),p(c.x0.slice.actions.setToken({token:e.result}))})).catch((e=>{M(e.errorMsg)})))}),[M,f,h,p]);L?f||E(L):T();const A=(0,i.useCallback)(((e,t)=>{p((0,c.vR)(e,t))}),[p]),I=(0,i.useCallback)((()=>{W&&(x(!0),k().widget.getWidget({uri:W,uniqid:m}).then((e=>{(0,w.ensureWidgetCheckListType)(e.result)&&A(m,e.result.content)})).catch((e=>!e.aborted&&M)).finally((()=>x(!1))))}),[m,M,W,A]),O=t=>{p(c.cr.slice.actions.flushAllEditor()),p(c.x0.slice.actions.setToken({token:t})),p(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:w.WidgetsName.CheckList,mode:n}))};(0,i.useEffect)((()=>{f||"edit"!==n||k().network.token().then((e=>{p(c.x0.slice.actions.setToken({token:e.result}))}))}),[n,f,p]),(0,i.useEffect)((()=>{var t;const n=null===(t=e.content.arr)||void 0===t?void 0:t.map((e=>{var t,n,i,l;return Object.assign(Object.assign(Object.assign({text:null!==(t=e.title)&&void 0!==t?t:"",file:null!==(n=e.file)&&void 0!==n?n:void 0,checked:null!==(i=e.value)&&void 0!==i&&i},e.links&&{links:e.links}),e.user&&{user:null!==(l=e.user)&&void 0!==l?l:void 0}),e.id&&{id:e.id,mimetype:"image/png"})}));y(n)}),[e.content.arr,g]),(0,i.useEffect)((()=>{if(!Array.isArray(q))return;const t=q.at(-1);t&&W&&t.object.uri===W&&t.uniqid===e.uniqid&&("check-list-response"!==t.fn&&"widget-update"!==t.fn||I())}),[q,e.uniqid,W,M,p,I]);const z=t=>{if(!e.content.arr||!W)return;const n=Object.assign(Object.assign({},e.content),{arr:[...e.content.arr,{title:t,value:!1}]});k().widget.updateWidget({uri:W,uniqid:e.uniqid,content:n,v2:!0}).then((()=>A(e.uniqid,n))).catch((e=>M(e.errorMsg)))},G=(0,i.useMemo)((()=>{if(!Array.isArray(g.arr))return[];const e=[];return g.arr.forEach((t=>{t.file&&e.push(t.file)})),e}),[g]);return"edit"===n&&t?l().createElement(ti,null,l().createElement(ei,{token:f,uniqid:m,content:Object.assign(Object.assign({},g),{arr:null===(a=g.arr)||void 0===a?void 0:a.map((e=>Object.assign(Object.assign({},e),{title:s.Utils.html.htmlDecodeSpecialChars(e.title)})))}),inplace:t,onChangeContent:A,onChangeWrapper:e=>{p(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>p((0,c.vR)(e.uniqid,t))})):l().createElement(Fn.M,{useRT:()=>{(0,Mt.AW)(e.uniqid)}},v&&l().createElement(s.JRCFileViewer,{files:G,openWithOptions:[]},(t=>l().createElement(ni,{key:e.uniqid},l().createElement(Zn,{limit:10,initialEntries:v,onFileClick:e=>e.id&&t(e.id),onItemCheckListChange:t=>((e,t)=>{W&&(C||(x(!0),k().widget.checkListRespond({uri:W,uniqid:e,index:t}).then((()=>{o&&o()})).catch((e=>{M(e.message),x(!1)}))))})(e.uniqid,t)}),g.edit&&l().createElement(Qn,{handleClick:z,placeholder:d.formatMessage({id:"COMMENT_WIDGET_CHECKLIST_Add_New_Task"})}),j&&f&&l().createElement(Yn,{uniqid:e.uniqid,name:e.name,collaborationRights:{update:!(!g.edit&&!S)},mode:n,handleOpenEditor:()=>{f?O(f):(x(!0),k().network.token().then((e=>{p(c.x0.slice.actions.setToken({token:e.result})),O(e.result)})).finally((()=>x(!1))))}}),C&&l().createElement(Kn,null)))))},li=(e,t)=>{const n=[];return e.filter((e=>e.isVisible)).forEach((e=>{const i=t.find((t=>t.name===e.name));i&&n.push(i)})),n},oi=d.j.getLazyComponent("Button"),ai=d.j.getLazyComponent("WidgetTable"),ri=d.j.getLazyComponent("Loader"),si=(a().div``,a().div`
466
+ `,li=({widget:e,inplace:t,mode:n,onWidgetUpdate:o})=>{var a;const d=(0,r.useIntl)(),{uniqid:m,content:g}=e,p=(0,u.jL)(),[f,E]=(0,i.useState)(),[h,b]=(0,i.useState)(!1),[v,y]=(0,i.useState)(),[C,x]=(0,i.useState)(!1),w=(0,u.GV)(c.x0.selectors.selectToken,oe.shallowEqual),W=(0,u.GV)((t=>c.x0.selectors.selectWidgetObjectUri(t,e.uniqid)),oe.shallowEqual),_=(0,u.GV)((e=>c.x0.selectors.selectWidgetObjectRights(e,m)),oe.shallowEqual),q=(0,u.GV)((t=>c.x0.selectors.selectAllWidgetRTObject(t,e.uniqid)),oe.shallowEqual),S=(0,i.useMemo)((()=>_&&_.update),[_]),j=(0,i.useMemo)((()=>_&&_.administrate),[_]),M=(0,i.useCallback)((e=>{p(c.y8.actions.error({label:null!=e?e:d.formatMessage({id:"GLOBAL_Error"})}))}),[p,d]),T=(0,i.useCallback)((()=>{f||h||(b(!0),L().network.token().then((e=>{E(e.result),b(!1),p(c.x0.slice.actions.setToken({token:e.result}))})).catch((e=>{M(e.errorMsg)})))}),[M,f,h,p]);w?f||E(w):T();const A=(0,i.useCallback)(((e,t)=>{p((0,c.vR)(e,t))}),[p]),I=(0,i.useCallback)((()=>{W&&(x(!0),L().widget.getWidget({uri:W,uniqid:m}).then((e=>{(0,k.ensureWidgetCheckListType)(e.result)&&A(m,e.result.content)})).catch((e=>!e.aborted&&M)).finally((()=>x(!1))))}),[m,M,W,A]),O=t=>{p(c.cr.slice.actions.flushAllEditor()),p(c.x0.slice.actions.setToken({token:t})),p(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:k.WidgetsName.CheckList,mode:n}))};(0,i.useEffect)((()=>{f||"edit"!==n||L().network.token().then((e=>{p(c.x0.slice.actions.setToken({token:e.result}))}))}),[n,f,p]),(0,i.useEffect)((()=>{var t;const n=null===(t=e.content.arr)||void 0===t?void 0:t.map((e=>{var t,n,i,l;return Object.assign(Object.assign(Object.assign({text:null!==(t=e.title)&&void 0!==t?t:"",file:null!==(n=e.file)&&void 0!==n?n:void 0,checked:null!==(i=e.value)&&void 0!==i&&i},e.links&&{links:e.links}),e.user&&{user:null!==(l=e.user)&&void 0!==l?l:void 0}),e.id&&{id:e.id,mimetype:"image/png"})}));y(n)}),[e.content.arr,g]),(0,i.useEffect)((()=>{if(!Array.isArray(q))return;const t=q.at(-1);t&&W&&t.object.uri===W&&t.uniqid===e.uniqid&&("check-list-response"!==t.fn&&"widget-update"!==t.fn||I())}),[q,e.uniqid,W,M,p,I]);const z=t=>{if(!e.content.arr||!W)return;const n=Object.assign(Object.assign({},e.content),{arr:[...e.content.arr,{title:t,value:!1}]});L().widget.updateWidget({uri:W,uniqid:e.uniqid,content:n,v2:!0}).then((()=>A(e.uniqid,n))).catch((e=>M(e.errorMsg)))},G=(0,i.useMemo)((()=>{if(!Array.isArray(g.arr))return[];const e=[];return g.arr.forEach((t=>{t.file&&e.push(t.file)})),e}),[g]);return"edit"===n&&t?l().createElement(ni,null,l().createElement(ti,{token:f,uniqid:m,content:Object.assign(Object.assign({},g),{arr:null===(a=g.arr)||void 0===a?void 0:a.map((e=>Object.assign(Object.assign({},e),{title:s.Utils.html.htmlDecodeSpecialChars(e.title)})))}),inplace:t,onChangeContent:A,onChangeWrapper:e=>{p(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>p((0,c.vR)(e.uniqid,t))})):l().createElement($n.M,{useRT:()=>{(0,Tt.AW)(e.uniqid)}},v&&l().createElement(s.JRCFileViewer,{files:G,openWithOptions:[]},(t=>l().createElement(ii,{key:e.uniqid},l().createElement(ei,{limit:10,initialEntries:v,onFileClick:e=>e.id&&t(e.id),onItemCheckListChange:t=>((e,t)=>{W&&(C||(x(!0),L().widget.checkListRespond({uri:W,uniqid:e,index:t}).then((()=>{o&&o()})).catch((e=>{M(e.message),x(!1)}))))})(e.uniqid,t)}),g.edit&&l().createElement(Kn,{handleClick:z,placeholder:d.formatMessage({id:"COMMENT_WIDGET_CHECKLIST_Add_New_Task"})}),j&&f&&l().createElement(Jn,{uniqid:e.uniqid,name:e.name,collaborationRights:{update:!(!g.edit&&!S)},mode:n,handleOpenEditor:()=>{f?O(f):(x(!0),L().network.token().then((e=>{p(c.x0.slice.actions.setToken({token:e.result})),O(e.result)})).finally((()=>x(!1))))}}),C&&l().createElement(Zn,null)))))},oi=(e,t)=>{const n=[];return e.filter((e=>e.isVisible)).forEach((e=>{const i=t.find((t=>t.name===e.name));i&&n.push(i)})),n},ai=d.j.getLazyComponent("Button"),ri=d.j.getLazyComponent("WidgetTable"),si=d.j.getLazyComponent("Loader"),ci=(a().div``,a().div`
465
467
  position: absolute;
466
468
  inset: 0;
467
469
  display: flex;
@@ -469,7 +471,7 @@
469
471
  justify-content: center;
470
472
  align-items: center;
471
473
  gap: ${e=>e.theme.space.md}px;
472
- `),ci=({uri:e,limit:t,tableHeadColor:n,tableHeadTextColor:o,tableHeadIconColor:a,tableRowColor:s,tableRowTextColor:d,tableColumnsData:m=[],tableBorderRadius:g,tableSizedColumns:p,tableSizedColumnsWidth:f,mode:E})=>{const h=(0,u.jL)(),[b,v]=(0,i.useState)(!1),[y,C]=(0,i.useState)([]),[x,L]=(0,i.useState)([]),[W,_]=(0,i.useState)({order:"ascending",name:"unknown"}),[q,S]=(0,i.useState)(void 0),[j,M]=(0,i.useState)(""),T=(0,i.useMemo)((()=>c.x0.definition(w.WidgetsName.DatasourceTable)),[]),A=(0,i.useMemo)((()=>"studio"===q?[{type:[j]}]:[]),[q,j]),I=(0,i.useMemo)((()=>"doc"===q?[j]:[]),[q,j]),{rtLastObject:O}=(0,Mt.YL)(A,I),z=(0,i.useCallback)((()=>{e&&(v(!0),k().datasource.get(e,w.Format.VIEW).then((e=>{L(e.result.model),C(e.result.data),_(e.result.sort),S(e.result.datasource.datasourceType),M(e.result.datasource.datasourceIdentifier)})).finally((()=>v(!1))))}),[e]);(0,i.useEffect)((()=>{void 0!==e&&0!==m.length&&0===x.length&&z()}),[e,m,x,z]),(0,i.useEffect)((()=>{O&&z()}),[O,z]),(0,i.useEffect)((()=>{e||L([])}),[e]),(0,i.useEffect)((()=>{"view"!==E&&"preview"!==E||h(c.cr.slice.actions.flushAllEditor())}),[E,h]);const G=(0,i.useMemo)((()=>li(m,x)),[m,x]);return 0!==m.length||b||"edit"!==E?b?l().createElement(si,null,l().createElement(ri,null)):l().createElement(l().Fragment,null,b||0!==y.length||"edit"===E?l().createElement(ai,{rows:y,columns:G,limit:t,tableHeadColor:n,tableHeadTextColor:o,tableHeadIconColor:a,tableRowColor:s,tableRowTextColor:d,tableBorderRadius:g,tableColumnsData:m,tableSizedColumns:p,tableSizedColumnsWidth:f,tableDefaultSortOrder:W.order,tableDefaultSortName:W.name}):l().createElement(si,null,l().createElement("img",{src:`/img/fast-intranet/${w.WidgetsName.DatasourceTable}.png`,alt:""}),l().createElement(r.FormattedMessage,{id:"WIDGET_Datasource_No_Results"}))):l().createElement(l().Fragment,null,l().createElement(si,null,l().createElement("img",{src:`/img/fast-intranet/${w.WidgetsName.DatasourceTable}.png`,alt:""}),l().createElement(r.FormattedMessage,{id:T.label}),l().createElement(oi,{label:"GLOBAL_Settings"})))},di=d.j.getLazyComponent("Button"),ui=d.j.getLazyComponent("WidgetTable"),mi=d.j.getLazyComponent("Loader"),gi=(a().div``,a().div`
474
+ `),di=({uri:e,limit:t,tableHeadColor:n,tableHeadTextColor:o,tableHeadIconColor:a,tableRowColor:s,tableRowTextColor:d,tableColumnsData:m=[],tableBorderRadius:g,tableSizedColumns:p,tableSizedColumnsWidth:f,mode:E})=>{const h=(0,u.jL)(),[b,v]=(0,i.useState)(!1),[y,C]=(0,i.useState)([]),[x,w]=(0,i.useState)([]),[W,_]=(0,i.useState)({order:"ascending",name:"unknown"}),[q,S]=(0,i.useState)(void 0),[j,M]=(0,i.useState)(""),T=(0,i.useMemo)((()=>c.x0.definition(k.WidgetsName.DatasourceTable)),[]),A=(0,i.useMemo)((()=>"studio"===q?[{type:[j]}]:[]),[q,j]),I=(0,i.useMemo)((()=>"doc"===q?[j]:[]),[q,j]),{rtLastObject:O}=(0,Tt.YL)(A,I),z=(0,i.useCallback)((()=>{e&&(v(!0),L().datasource.get(e,k.Format.VIEW).then((e=>{w(e.result.model),C(e.result.data),_(e.result.sort),S(e.result.datasource.datasourceType),M(e.result.datasource.datasourceIdentifier)})).finally((()=>v(!1))))}),[e]);(0,i.useEffect)((()=>{void 0!==e&&0!==m.length&&0===x.length&&z()}),[e,m,x,z]),(0,i.useEffect)((()=>{O&&z()}),[O,z]),(0,i.useEffect)((()=>{e||w([])}),[e]),(0,i.useEffect)((()=>{"view"!==E&&"preview"!==E||h(c.cr.slice.actions.flushAllEditor())}),[E,h]);const G=(0,i.useMemo)((()=>oi(m,x)),[m,x]);return 0!==m.length||b||"edit"!==E?b?l().createElement(ci,null,l().createElement(si,null)):l().createElement(l().Fragment,null,b||0!==y.length||"edit"===E?l().createElement(ri,{rows:y,columns:G,limit:t,tableHeadColor:n,tableHeadTextColor:o,tableHeadIconColor:a,tableRowColor:s,tableRowTextColor:d,tableBorderRadius:g,tableColumnsData:m,tableSizedColumns:p,tableSizedColumnsWidth:f,tableDefaultSortOrder:W.order,tableDefaultSortName:W.name}):l().createElement(ci,null,l().createElement("img",{src:`/img/fast-intranet/${k.WidgetsName.DatasourceTable}.png`,alt:""}),l().createElement(r.FormattedMessage,{id:"WIDGET_Datasource_No_Results"}))):l().createElement(l().Fragment,null,l().createElement(ci,null,l().createElement("img",{src:`/img/fast-intranet/${k.WidgetsName.DatasourceTable}.png`,alt:""}),l().createElement(r.FormattedMessage,{id:T.label}),l().createElement(ai,{label:"GLOBAL_Settings"})))},ui=d.j.getLazyComponent("Button"),mi=d.j.getLazyComponent("WidgetTable"),gi=d.j.getLazyComponent("Loader"),pi=(a().div``,a().div`
473
475
  position: absolute;
474
476
  inset: 0;
475
477
  display: flex;
@@ -477,21 +479,21 @@
477
479
  justify-content: center;
478
480
  align-items: center;
479
481
  gap: ${e=>e.theme.space.md}px;
480
- `),pi=({uri:e,limit:t,tableHeadColor:n,tableHeadTextColor:o,tableHeadIconColor:a,tableRowColor:s,tableRowTextColor:d,tableColumnsData:m=[],tableBorderRadius:g,tableSizedColumns:p,tableSizedColumnsWidth:f,mode:E})=>{const h=(0,u.jL)(),[b,v]=(0,i.useState)(!1),[y,C]=(0,i.useState)([]),[x,L]=(0,i.useState)([]),W=(0,i.useMemo)((()=>c.x0.definition(w.WidgetsName.ExcelDatasourceTable)),[]);(0,i.useEffect)((()=>{void 0!==e&&0!==m.length&&0===x.length&&(v(!0),k().datasource.get(e,w.Format.VIEW).then((e=>{L(e.result.model),C(e.result.data)})).finally((()=>v(!1))))}),[e,m,x]),(0,i.useEffect)((()=>{e||L([])}),[e]),(0,i.useEffect)((()=>{"view"!==E&&"preview"!==E||h(c.cr.slice.actions.flushAllEditor())}),[E,h]);const _=(0,i.useMemo)((()=>li(m,x)),[m,x]);return 0!==m.length||b||"edit"!==E?b?l().createElement(gi,null,l().createElement(mi,null)):l().createElement(l().Fragment,null,b||0!==y.length||"edit"===E?l().createElement(ui,{rows:y,columns:_,limit:t,tableHeadColor:n,tableHeadTextColor:o,tableHeadIconColor:a,tableRowColor:s,tableRowTextColor:d,tableBorderRadius:g,tableColumnsData:m,tableSizedColumns:p,tableSizedColumnsWidth:f}):l().createElement(gi,null,l().createElement("img",{src:`/img/fast-intranet/${w.WidgetsName.ExcelDatasourceTable}.png`,alt:""}),l().createElement(r.FormattedMessage,{id:"WIDGET_Datasource_No_Results"}))):l().createElement(l().Fragment,null,l().createElement(gi,null,l().createElement("img",{src:`/img/fast-intranet/${w.WidgetsName.ExcelDatasourceTable}.png`,alt:""}),l().createElement(r.FormattedMessage,{id:W.label}),l().createElement(di,{label:"GLOBAL_Settings"})))},fi=a().div`
482
+ `),fi=({uri:e,limit:t,tableHeadColor:n,tableHeadTextColor:o,tableHeadIconColor:a,tableRowColor:s,tableRowTextColor:d,tableColumnsData:m=[],tableBorderRadius:g,tableSizedColumns:p,tableSizedColumnsWidth:f,mode:E})=>{const h=(0,u.jL)(),[b,v]=(0,i.useState)(!1),[y,C]=(0,i.useState)([]),[x,w]=(0,i.useState)([]),W=(0,i.useMemo)((()=>c.x0.definition(k.WidgetsName.ExcelDatasourceTable)),[]);(0,i.useEffect)((()=>{void 0!==e&&0!==m.length&&0===x.length&&(v(!0),L().datasource.get(e,k.Format.VIEW).then((e=>{w(e.result.model),C(e.result.data)})).finally((()=>v(!1))))}),[e,m,x]),(0,i.useEffect)((()=>{e||w([])}),[e]),(0,i.useEffect)((()=>{"view"!==E&&"preview"!==E||h(c.cr.slice.actions.flushAllEditor())}),[E,h]);const _=(0,i.useMemo)((()=>oi(m,x)),[m,x]);return 0!==m.length||b||"edit"!==E?b?l().createElement(pi,null,l().createElement(gi,null)):l().createElement(l().Fragment,null,b||0!==y.length||"edit"===E?l().createElement(mi,{rows:y,columns:_,limit:t,tableHeadColor:n,tableHeadTextColor:o,tableHeadIconColor:a,tableRowColor:s,tableRowTextColor:d,tableBorderRadius:g,tableColumnsData:m,tableSizedColumns:p,tableSizedColumnsWidth:f}):l().createElement(pi,null,l().createElement("img",{src:`/img/fast-intranet/${k.WidgetsName.ExcelDatasourceTable}.png`,alt:""}),l().createElement(r.FormattedMessage,{id:"WIDGET_Datasource_No_Results"}))):l().createElement(l().Fragment,null,l().createElement(pi,null,l().createElement("img",{src:`/img/fast-intranet/${k.WidgetsName.ExcelDatasourceTable}.png`,alt:""}),l().createElement(r.FormattedMessage,{id:W.label}),l().createElement(ui,{label:"GLOBAL_Settings"})))},Ei=a().div`
481
483
  padding: ${e=>e.theme.space.md}px;
482
- `,Ei=a().a`
484
+ `,hi=a().a`
483
485
  cursor: pointer;
484
486
  color: ${e=>e.theme.color.secondary};
485
- `,hi=a().div`
487
+ `,bi=a().div`
486
488
  display: flex;
487
489
  justify-content: center;
488
490
  align-items: center;
489
- `,bi=({mode:e,uniqid:t,content:n})=>{const o=(0,r.useIntl)(),a=(0,u.jL)(),s=(0,u.GV)((e=>c.x0.selectors.selectWidgetObjectUri(e,t)),le.shallowEqual),d=(0,u.GV)((e=>c.x0.selectors.selectWidgetObjectRights(e,t)),le.shallowEqual),m=(0,i.useMemo)((()=>!(!d||!d.update)),[d]),g=(0,i.useCallback)((()=>{if("edit"===e||!m||!s)return;const i=Object.assign(Object.assign({},n),{isClosed:!0});k().widget.updateWidget({uri:s,uniqid:t,content:i,v2:!0}).then((()=>a(c.x0.slice.actions.updateWidget({uniqid:t,content:i})))).catch((()=>a(c.y8.actions.error({label:"WIDGET_Presence_Error"}))))}),[e,t,m,s,n,a]);return l().createElement(l().Fragment,null,m&&!n.isClosed&&l().createElement(fi,null,l().createElement(hi,null,l().createElement(Ei,{onClick:g},o.formatMessage({id:"WIDGET_Presence_Closing"})))))},vi=d.j.getLazyComponent("WidgetPresence"),yi=d.j.getLazyComponent("ModalUserList"),Ci=a().div`
491
+ `,vi=({mode:e,uniqid:t,content:n})=>{const o=(0,r.useIntl)(),a=(0,u.jL)(),s=(0,u.GV)((e=>c.x0.selectors.selectWidgetObjectUri(e,t)),oe.shallowEqual),d=(0,u.GV)((e=>c.x0.selectors.selectWidgetObjectRights(e,t)),oe.shallowEqual),m=(0,i.useMemo)((()=>!(!d||!d.update)),[d]),g=(0,i.useCallback)((()=>{if("edit"===e||!m||!s)return;const i=Object.assign(Object.assign({},n),{isClosed:!0});L().widget.updateWidget({uri:s,uniqid:t,content:i,v2:!0}).then((()=>a(c.x0.slice.actions.updateWidget({uniqid:t,content:i})))).catch((()=>a(c.y8.actions.error({label:"WIDGET_Presence_Error"}))))}),[e,t,m,s,n,a]);return l().createElement(l().Fragment,null,m&&!n.isClosed&&l().createElement(Ei,null,l().createElement(bi,null,l().createElement(hi,{onClick:g},o.formatMessage({id:"WIDGET_Presence_Closing"})))))},yi=d.j.getLazyComponent("WidgetPresence"),Ci=d.j.getLazyComponent("ModalUserList"),xi=a().div`
490
492
  display: flex;
491
493
  flex: 1;
492
494
  position: relative;
493
495
  flex-direction: column;
494
- `,xi=(a().div`
496
+ `,wi=(a().div`
495
497
  position: absolute;
496
498
  inset: 0;
497
499
  background-color: rgba(255, 255, 255, 0.7);
@@ -508,24 +510,24 @@
508
510
  align-items: center;
509
511
  border-radius: ${e=>e.theme.space.sm}px;
510
512
  margin: ${e=>e.theme.space.sm}px;
511
- `),wi=({widget:e,mode:t})=>{const n=(0,r.useIntl)(),o=(0,u.jL)(),{limit:a,limitValue:s,closing:d,isClosed:m}=e.content,{uniqid:g}=e,[p,f]=(0,i.useState)({userValue:-1,userAvailableList:[],userUnavailableList:[],userAvailableTotal:0,userUnavailableTotal:0}),[E,h]=(0,i.useState)(!1),[b]=(0,i.useState)(new AbortController),[v,y]=(0,i.useState)(!1),[C,x]=(0,i.useState)(),[w,L]=(0,i.useState)(),W=(0,i.useRef)(b),_=(0,u.GV)((e=>c.x0.selectors.selectWidgetObjectUri(e,g)),le.shallowEqual),q=(0,u.GV)((e=>c.x0.selectors.selectAllWidgetRTObject(e,g)),le.shallowEqual),S=(0,i.useCallback)((()=>o(c.y8.actions.error({label:"WIDGET_Presence_Error"}))),[o]),j=(0,i.useMemo)((()=>!(a&&s&&p.userAvailableTotal>=s)),[a,s,p.userAvailableTotal]),M=(0,i.useMemo)((()=>d&&m||"edit"===t),[d,m,t]),T=(0,i.useCallback)((()=>{_&&!M&&(j?(h(!0),k().widget.presenceCancel({uri:_,uniqid:g}).catch(S).finally((()=>h(!1)))):o(c.y8.actions.error({label:"WIDGET_Presence_Limit_Response_Error"})))}),[o,g,S,_,j,M]),A=(0,i.useCallback)((e=>{_&&!M&&(h(!0),k().widget.presenceRespond({uri:_,uniqid:g,value:e},W.current.signal).catch(S).finally((()=>h(!1))))}),[_,g,S,M]),I=(0,i.useCallback)((()=>{"edit"!==t&&_&&(h(!0),k().widget.presenceGetResponse({uri:_,uniqid:g},W.current.signal).then((e=>{f(e.result)})).catch((e=>!e.aborted&&S())).finally((()=>h(!1))))}),[_,S,g,t]),O=(e,t)=>{_&&k().widget.presenceGetResponseUserList({uri:_,uniqid:g,index:e,page:t,limit:8},W.current.signal).then((e=>{L(Object.assign(Object.assign({},e.result),{data:[...e.result.data],cnt:e.result.cnt}))})).catch((e=>!e.aborted&&S))},z=(0,i.useCallback)((()=>{_&&(h(!0),k().widget.getWidget({uri:_,uniqid:g}).then((e=>{o((0,c.vR)(g,e.result))})).catch((e=>!e.aborted&&S)).finally((()=>h(!1))))}),[o,S,_,g]);return(0,i.useEffect)((()=>{const e=W.current;return()=>{e.abort()}}),[]),(0,i.useEffect)((()=>{I()}),[I]),(0,i.useEffect)((()=>{if(!Array.isArray(q))return;const e=q.at(-1);e&&_&&e.object.uri===_&&e.uniqid===g&&("widget-presence-response"===e.fn&&I(),"widget-update"===e.fn&&z())}),[q,I,g,_,z]),l().createElement(Fn.M,{useRT:()=>{(0,Mt.AW)(e.uniqid)}},l().createElement(Ci,null,l().createElement(vi,{limit:a,limitValue:s,userAvailableList:p.userAvailableList,userUnavailableList:p.userUnavailableList,userValue:p.userValue,userAvailableTotal:null==p?void 0:p.userAvailableTotal,userUnavailableTotal:null==p?void 0:p.userUnavailableTotal,isClosed:d&&m,handleClickAvailable:()=>1===p.userValue?T():A(1),handleClickUnavailable:()=>0===p.userValue?T():A(0),handleOpenUsersModal:e=>{L({limit:0,page:0,data:[],cnt:0}),x(e),O(e),y(!0)}}),d&&m&&l().createElement(xi,null,n.formatMessage({id:"WIDGET_Presence_Is_Closed"})),d&&!m&&l().createElement(bi,{mode:t,uniqid:e.uniqid,content:e.content}),"view"===t&&l().createElement(Yn,{uniqid:e.uniqid,name:e.name,mode:t}),E&&l().createElement(Kn,null),l().createElement(yi,{open:v,usersList:w,title:1===C?n.formatMessage({id:"WIDGET_Presence_On"}):n.formatMessage({id:"WIDGET_Presence_Off"}),setOpen:y,onClose:()=>{L({limit:0,page:0,data:[],cnt:0})},handleLoadUsersList:e=>{O(null!=C?C:0,e)}})))},ki=d.j.getLazyComponent("WidgetQuickSurvey"),Li=d.j.getLazyComponent("WidgetQuickSurveyEditor"),Wi=d.j.getLazyComponent("ModalUserList"),_i=a().div`
513
+ `),ki=({widget:e,mode:t})=>{const n=(0,r.useIntl)(),o=(0,u.jL)(),{limit:a,limitValue:s,closing:d,isClosed:m}=e.content,{uniqid:g}=e,[p,f]=(0,i.useState)({userValue:-1,userAvailableList:[],userUnavailableList:[],userAvailableTotal:0,userUnavailableTotal:0}),[E,h]=(0,i.useState)(!1),[b]=(0,i.useState)(new AbortController),[v,y]=(0,i.useState)(!1),[C,x]=(0,i.useState)(),[w,k]=(0,i.useState)(),W=(0,i.useRef)(b),_=(0,u.GV)((e=>c.x0.selectors.selectWidgetObjectUri(e,g)),oe.shallowEqual),q=(0,u.GV)((e=>c.x0.selectors.selectAllWidgetRTObject(e,g)),oe.shallowEqual),S=(0,i.useCallback)((()=>o(c.y8.actions.error({label:"WIDGET_Presence_Error"}))),[o]),j=(0,i.useMemo)((()=>!(a&&s&&p.userAvailableTotal>=s)),[a,s,p.userAvailableTotal]),M=(0,i.useMemo)((()=>d&&m||"edit"===t),[d,m,t]),T=(0,i.useCallback)((()=>{_&&!M&&(j?(h(!0),L().widget.presenceCancel({uri:_,uniqid:g}).catch(S).finally((()=>h(!1)))):o(c.y8.actions.error({label:"WIDGET_Presence_Limit_Response_Error"})))}),[o,g,S,_,j,M]),A=(0,i.useCallback)((e=>{_&&!M&&(h(!0),L().widget.presenceRespond({uri:_,uniqid:g,value:e},W.current.signal).catch(S).finally((()=>h(!1))))}),[_,g,S,M]),I=(0,i.useCallback)((()=>{"edit"!==t&&_&&(h(!0),L().widget.presenceGetResponse({uri:_,uniqid:g},W.current.signal).then((e=>{f(e.result)})).catch((e=>!e.aborted&&S())).finally((()=>h(!1))))}),[_,S,g,t]),O=(e,t)=>{_&&L().widget.presenceGetResponseUserList({uri:_,uniqid:g,index:e,page:t,limit:8},W.current.signal).then((e=>{k(Object.assign(Object.assign({},e.result),{data:[...e.result.data],cnt:e.result.cnt}))})).catch((e=>!e.aborted&&S))},z=(0,i.useCallback)((()=>{_&&(h(!0),L().widget.getWidget({uri:_,uniqid:g}).then((e=>{o((0,c.vR)(g,e.result))})).catch((e=>!e.aborted&&S)).finally((()=>h(!1))))}),[o,S,_,g]);return(0,i.useEffect)((()=>{const e=W.current;return()=>{e.abort()}}),[]),(0,i.useEffect)((()=>{I()}),[I]),(0,i.useEffect)((()=>{if(!Array.isArray(q))return;const e=q.at(-1);e&&_&&e.object.uri===_&&e.uniqid===g&&("widget-presence-response"===e.fn&&I(),"widget-update"===e.fn&&z())}),[q,I,g,_,z]),l().createElement($n.M,{useRT:()=>{(0,Tt.AW)(e.uniqid)}},l().createElement(xi,null,l().createElement(yi,{limit:a,limitValue:s,userAvailableList:p.userAvailableList,userUnavailableList:p.userUnavailableList,userValue:p.userValue,userAvailableTotal:null==p?void 0:p.userAvailableTotal,userUnavailableTotal:null==p?void 0:p.userUnavailableTotal,isClosed:d&&m,handleClickAvailable:()=>1===p.userValue?T():A(1),handleClickUnavailable:()=>0===p.userValue?T():A(0),handleOpenUsersModal:e=>{k({limit:0,page:0,data:[],cnt:0}),x(e),O(e),y(!0)}}),d&&m&&l().createElement(wi,null,n.formatMessage({id:"WIDGET_Presence_Is_Closed"})),d&&!m&&l().createElement(vi,{mode:t,uniqid:e.uniqid,content:e.content}),"view"===t&&l().createElement(Jn,{uniqid:e.uniqid,name:e.name,mode:t}),E&&l().createElement(Zn,null),l().createElement(Ci,{open:v,usersList:w,title:1===C?n.formatMessage({id:"WIDGET_Presence_On"}):n.formatMessage({id:"WIDGET_Presence_Off"}),setOpen:y,onClose:()=>{k({limit:0,page:0,data:[],cnt:0})},handleLoadUsersList:e=>{O(null!=C?C:0,e)}})))},Li=d.j.getLazyComponent("WidgetQuickSurvey"),Wi=d.j.getLazyComponent("WidgetQuickSurveyEditor"),_i=d.j.getLazyComponent("ModalUserList"),qi=a().div`
512
514
  width: 100%;
513
515
  display: flex;
514
516
  flex-direction: column;
515
517
  gap: 14px;
516
518
  ${e=>e.withPadding&&"padding: 0 12px;"}
517
519
  padding-top: 16px;
518
- `,qi=({widget:e,inplace:t,mode:n})=>{var o,a,d;const m=(0,r.useIntl)(),g=(0,u.jL)(),{uniqid:p,content:f}=e,[E,h]=(0,i.useState)({userResponses:[],totalRespondent:0,totalResponse:0,userLoggedResponses:[]}),[b,v]=(0,i.useState)(!1),[y,C]=(0,i.useState)(!1),[x,L]=(0,i.useState)(),[W,_]=(0,i.useState)(),[q]=(0,i.useState)(new AbortController),S=(0,i.useRef)(q),j=(0,u.GV)(c.x0.selectors.selectToken,le.shallowEqual),M=(0,u.GV)((t=>c.x0.selectors.selectWidgetObjectUri(t,e.uniqid)),le.shallowEqual),T=(0,u.GV)((e=>c.x0.selectors.selectWidgetObjectRights(e,p)),le.shallowEqual),A=(0,u.GV)((t=>c.x0.selectors.selectAllWidgetRTObject(t,e.uniqid)),le.shallowEqual),I=(0,i.useCallback)(((e,t)=>{g((0,c.vR)(e,t))}),[g]),O=t=>{g(c.cr.slice.actions.flushAllEditor()),g(c.x0.slice.actions.setToken({token:t})),g(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:w.WidgetsName.QuickSurvey}))},z=(0,i.useCallback)((()=>g(c.y8.actions.error({label:"WIDGET_Presence_Error"}))),[g]),G=(0,i.useCallback)((e=>{"edit"!==n&&M&&(C(!0),k().widget.quickSurveyGetResponse({uri:M,uniqid:e},S.current.signal).then((e=>{h(e.result)})).catch((e=>!e.aborted&&z)).finally((()=>C(!1))))}),[z,M,n]),D=(0,i.useCallback)((()=>{M&&(C(!0),k().widget.getWidget({uri:M,uniqid:p},S.current.signal).then((e=>{I(p,e.result.content)})).catch((e=>!e.aborted&&z)).finally((()=>C(!1))))}),[p,z,M,I]),V=()=>{if(M&&f.closing){const e=Object.assign(Object.assign({},f),{isClosed:!0});k().widget.updateWidget({uri:M,uniqid:p,content:e}).catch((()=>{z()}))}},F=t=>{(t=>{"edit"!==n&&M&&(C(!0),k().widget.quickSurveyRespond({uri:M,index:t,multi:f.multi?1:0,uniqid:p},S.current.signal).then((()=>{G(e.uniqid)})).catch((e=>!e.aborted&&z)).finally((()=>C(!1))))})(t)},$=(e,t)=>{M&&k().widget.quickSurveyGetResponseUserList({uri:M,uniqid:p,index:e,page:t,limit:8},S.current.signal).then((e=>{_(Object.assign(Object.assign({},e.result),{data:[...e.result.data],cnt:e.result.cnt}))})).catch((e=>!e.aborted&&z))},R=(0,i.useMemo)((()=>T&&T.update),[T]);(0,i.useEffect)((()=>{G(e.uniqid)}),[G,e.uniqid]),(0,i.useEffect)((()=>{if(!Array.isArray(A))return;const t=A.at(-1);t&&M&&t.object.uri===M&&t.uniqid===e.uniqid&&("widget-quick-survey-response"===t.fn&&G(e.uniqid),"widget-update"===t.fn&&D())}),[A,M,e.uniqid,D,G]);const B=(0,i.useMemo)((()=>{if(!Array.isArray(f.arr))return[];const e=[];return f.arr.forEach((t=>{t.file&&e.push(t.file)})),e}),[f]);return(0,i.useEffect)((()=>{j||"edit"!==n||k().network.token().then((e=>{g(c.x0.slice.actions.setToken({token:e.result}))}))}),[n,j,g]),"edit"===n&&t?l().createElement(_i,{withPadding:!0},l().createElement(Li,{token:j,uniqid:p,content:e.content,onChangeContent:I,onChangeWrapper:e=>{g(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:e=>I(p,e),inplace:t})):l().createElement(Fn.M,{useRT:()=>{(0,Mt.AW)(e.uniqid)}},l().createElement(_i,null,l().createElement(s.JRCFileViewer,{files:B,openWithOptions:[]},(t=>{var n,i,o,a,r,s,c;return l().createElement(ki,{limit:null!==(n=E.totalResponse)&&void 0!==n?n:0,values:null!==(i=f.arr)&&void 0!==i?i:[],userResponses:E.userResponses,userHasAlreadyVoted:E.userLoggedResponses.length>0,canCloseSurvey:null!==(o=e.content.closing)&&void 0!==o&&o,isClosed:null!==(a=e.content.isClosed)&&void 0!==a&&a,open:null!==(r=e.content.open)&&void 0!==r&&r,anonymize:null!==(s=e.content.anonymize)&&void 0!==s&&s,seeResponseAfter:null!==(c=e.content.seeResponseAfter)&&void 0!==c&&c,canUpdate:R,handleClickFile:e=>e.id&&t(e.id),handleCloseSurvey:V,handleProgressBarClick:F,setOpenUsersModal:e=>{L(e),$(e),v(!0)}})})),f.open&&l().createElement(Qn,{handleClick:e=>{var t;if(!M)return;const n=Object.assign(Object.assign({},f),{arr:[...null!==(t=f.arr)&&void 0!==t?t:[],{title:e}]});k().widget.quickSurveyAddEnty({uri:M,uniqid:p,label:e}).then((()=>{g(c.x0.slice.actions.updateWidget({uniqid:p,content:n}))})).catch(z)},placeholder:m.formatMessage({id:"FIELDS_Add_Option"})}),R&&l().createElement(Yn,{uniqid:e.uniqid,name:e.name,collaborationRights:{update:!!R},mode:n,handleOpenEditor:()=>{j?O(j):(C(!0),k().network.token().then((e=>{g(c.x0.slice.actions.setToken({token:e.result})),O(e.result)})).finally((()=>C(!1))))}}),y&&l().createElement(Kn,null),l().createElement(Wi,{open:b,usersList:W,title:null!==(d=null===(a=null===(o=f.arr)||void 0===o?void 0:o[null!=x?x:0])||void 0===a?void 0:a.title)&&void 0!==d?d:"",setOpen:v,handleLoadUsersList:e=>{$(null!=x?x:0,e)},onClose:()=>{_({limit:0,page:0,data:[],cnt:0})}})))},Si=d.j.getLazyComponent("ModalLayout"),ji=d.j.getLazyComponent("ModalContent"),Mi=d.j.getLazyComponent("Button"),Ti=d.j.getLazyComponent("InputText"),Ai=d.j.getLazyComponent("InputNumber"),Ii=d.j.getLazyComponent("InputSelectExtended"),Oi=d.j.getLazyComponent("InputPassword"),zi=d.j.getLazyComponent("Typography"),Gi=a().div`
520
+ `,Si=({widget:e,inplace:t,mode:n})=>{var o,a,d;const m=(0,r.useIntl)(),g=(0,u.jL)(),{uniqid:p,content:f}=e,[E,h]=(0,i.useState)({userResponses:[],totalRespondent:0,totalResponse:0,userLoggedResponses:[]}),[b,v]=(0,i.useState)(!1),[y,C]=(0,i.useState)(!1),[x,w]=(0,i.useState)(),[W,_]=(0,i.useState)(),[q]=(0,i.useState)(new AbortController),S=(0,i.useRef)(q),j=(0,u.GV)(c.x0.selectors.selectToken,oe.shallowEqual),M=(0,u.GV)((t=>c.x0.selectors.selectWidgetObjectUri(t,e.uniqid)),oe.shallowEqual),T=(0,u.GV)((e=>c.x0.selectors.selectWidgetObjectRights(e,p)),oe.shallowEqual),A=(0,u.GV)((t=>c.x0.selectors.selectAllWidgetRTObject(t,e.uniqid)),oe.shallowEqual),I=(0,i.useCallback)(((e,t)=>{g((0,c.vR)(e,t))}),[g]),O=t=>{g(c.cr.slice.actions.flushAllEditor()),g(c.x0.slice.actions.setToken({token:t})),g(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:k.WidgetsName.QuickSurvey}))},z=(0,i.useCallback)((()=>g(c.y8.actions.error({label:"WIDGET_Presence_Error"}))),[g]),G=(0,i.useCallback)((e=>{"edit"!==n&&M&&(C(!0),L().widget.quickSurveyGetResponse({uri:M,uniqid:e},S.current.signal).then((e=>{h(e.result)})).catch((e=>!e.aborted&&z)).finally((()=>C(!1))))}),[z,M,n]),D=(0,i.useCallback)((()=>{M&&(C(!0),L().widget.getWidget({uri:M,uniqid:p},S.current.signal).then((e=>{I(p,e.result.content)})).catch((e=>!e.aborted&&z)).finally((()=>C(!1))))}),[p,z,M,I]),V=()=>{if(M&&f.closing){const e=Object.assign(Object.assign({},f),{isClosed:!0});L().widget.updateWidget({uri:M,uniqid:p,content:e}).catch((()=>{z()}))}},F=t=>{(t=>{"edit"!==n&&M&&(C(!0),L().widget.quickSurveyRespond({uri:M,index:t,multi:f.multi?1:0,uniqid:p},S.current.signal).then((()=>{G(e.uniqid)})).catch((e=>!e.aborted&&z)).finally((()=>C(!1))))})(t)},$=(e,t)=>{M&&L().widget.quickSurveyGetResponseUserList({uri:M,uniqid:p,index:e,page:t,limit:8},S.current.signal).then((e=>{_(Object.assign(Object.assign({},e.result),{data:[...e.result.data],cnt:e.result.cnt}))})).catch((e=>!e.aborted&&z))},R=(0,i.useMemo)((()=>T&&T.update),[T]);(0,i.useEffect)((()=>{G(e.uniqid)}),[G,e.uniqid]),(0,i.useEffect)((()=>{if(!Array.isArray(A))return;const t=A.at(-1);t&&M&&t.object.uri===M&&t.uniqid===e.uniqid&&("widget-quick-survey-response"===t.fn&&G(e.uniqid),"widget-update"===t.fn&&D())}),[A,M,e.uniqid,D,G]);const B=(0,i.useMemo)((()=>{if(!Array.isArray(f.arr))return[];const e=[];return f.arr.forEach((t=>{t.file&&e.push(t.file)})),e}),[f]);return(0,i.useEffect)((()=>{j||"edit"!==n||L().network.token().then((e=>{g(c.x0.slice.actions.setToken({token:e.result}))}))}),[n,j,g]),"edit"===n&&t?l().createElement(qi,{withPadding:!0},l().createElement(Wi,{token:j,uniqid:p,content:e.content,onChangeContent:I,onChangeWrapper:e=>{g(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:e=>I(p,e),inplace:t})):l().createElement($n.M,{useRT:()=>{(0,Tt.AW)(e.uniqid)}},l().createElement(qi,null,l().createElement(s.JRCFileViewer,{files:B,openWithOptions:[]},(t=>{var n,i,o,a,r,s,c;return l().createElement(Li,{limit:null!==(n=E.totalResponse)&&void 0!==n?n:0,values:null!==(i=f.arr)&&void 0!==i?i:[],userResponses:E.userResponses,userHasAlreadyVoted:E.userLoggedResponses.length>0,canCloseSurvey:null!==(o=e.content.closing)&&void 0!==o&&o,isClosed:null!==(a=e.content.isClosed)&&void 0!==a&&a,open:null!==(r=e.content.open)&&void 0!==r&&r,anonymize:null!==(s=e.content.anonymize)&&void 0!==s&&s,seeResponseAfter:null!==(c=e.content.seeResponseAfter)&&void 0!==c&&c,canUpdate:R,handleClickFile:e=>e.id&&t(e.id),handleCloseSurvey:V,handleProgressBarClick:F,setOpenUsersModal:e=>{w(e),$(e),v(!0)}})})),f.open&&l().createElement(Kn,{handleClick:e=>{var t;if(!M)return;const n=Object.assign(Object.assign({},f),{arr:[...null!==(t=f.arr)&&void 0!==t?t:[],{title:e}]});L().widget.quickSurveyAddEnty({uri:M,uniqid:p,label:e}).then((()=>{g(c.x0.slice.actions.updateWidget({uniqid:p,content:n}))})).catch(z)},placeholder:m.formatMessage({id:"FIELDS_Add_Option"})}),R&&l().createElement(Jn,{uniqid:e.uniqid,name:e.name,collaborationRights:{update:!!R},mode:n,handleOpenEditor:()=>{j?O(j):(C(!0),L().network.token().then((e=>{g(c.x0.slice.actions.setToken({token:e.result})),O(e.result)})).finally((()=>C(!1))))}}),y&&l().createElement(Zn,null),l().createElement(_i,{open:b,usersList:W,title:null!==(d=null===(a=null===(o=f.arr)||void 0===o?void 0:o[null!=x?x:0])||void 0===a?void 0:a.title)&&void 0!==d?d:"",setOpen:v,handleLoadUsersList:e=>{$(null!=x?x:0,e)},onClose:()=>{_({limit:0,page:0,data:[],cnt:0})}})))},ji=d.j.getLazyComponent("ModalLayout"),Mi=d.j.getLazyComponent("ModalContent"),Ti=d.j.getLazyComponent("Button"),Ai=d.j.getLazyComponent("InputText"),Ii=d.j.getLazyComponent("InputNumber"),Oi=d.j.getLazyComponent("InputSelectExtended"),zi=d.j.getLazyComponent("InputPassword"),Gi=d.j.getLazyComponent("Typography"),Di=a().div`
519
521
  display: flex;
520
522
  flex-direction: column;
521
523
  opacity: ${e=>e.isLocked?".4":"1.0"};
522
- `,Di=a().div`
524
+ `,Vi=a().div`
523
525
  position: absolute;
524
526
  inset: 0;
525
527
  display: flex;
526
528
  justify-content: center;
527
529
  align-items: center;
528
- `,Vi=a().div`
530
+ `,Fi=a().div`
529
531
  background-color: ${e=>e.theme.color.orange};
530
532
  color: ${e=>e.theme.color.white};
531
533
  padding: ${e=>e.theme.space.sm}px;
@@ -533,67 +535,67 @@
533
535
  display: flex;
534
536
  justify-content: center;
535
537
  align-items: center;
536
- `,Fi=a().div`
538
+ `,$i=a().div`
537
539
  margin-bottom: ${e=>e.theme.space.md}px;
538
- `,$i={username:"",password:"",hostname:"",imapPort:993,imapConnectionSecurity:w.ImapConnection.NONE,imapMailbox:"",cardDavAddressBook:"",calDavCalendar:"",provider:""},Ri=()=>{const e=(0,r.useIntl)(),t=(0,le.useDispatch)(),n=(0,s.useAbortController)(),[o,a]=(0,i.useState)(!1),[d,u]=(0,i.useState)(!1),{control:m,reset:g,setValue:p,getValues:f,watch:E,formState:{isValid:h}}=(0,T.useForm)({defaultValues:$i,criteriaMode:"all"}),[b,v]=(0,i.useState)([]),y=E(),C=[{label:"NONE",value:w.ImapConnection.NONE},{label:"SSL",value:w.ImapConnection.SSL},{label:"STARTTLS",value:w.ImapConnection.STARTTLS}],x=(0,i.useCallback)((e=>{k().office.getConfiguration().then((({result:t})=>{var n;g(Object.assign(Object.assign({},t),{provider:e.includes(null!==(n=t.provider)&&void 0!==n?n:"")?t.provider:e[0]}))}))}),[g]);(0,i.useEffect)((()=>{o&&(u(!0),k().office.getProviders({signal:n.signal}).then((({result:e})=>{n.signal.aborted||(v(e),x(e.map((e=>e.id))))})).catch((e=>{n.signal.aborted||t(c.y8.actions.error({label:e.errorMsg}))})).finally((()=>{u(!1)})))}),[o,n.signal,t,x]),(0,i.useEffect)((()=>{1===b.length&&p("provider",b[0].id)}),[b,p]);const L=()=>a(!1),W=(0,i.useMemo)((()=>b.length>1),[b]);return l().createElement(l().Fragment,null,l().createElement(Di,null,l().createElement(Mi,{label:e.formatMessage({id:"Office_Set_Configuration"}),onClick:()=>a(!0)})),l().createElement(Si,{open:o,radius:"small",closeHandler:L},l().createElement(ji,{overflow:"scroll",title:e.formatMessage({id:"Office_Set_Configuration"}),onClickIconClose:L},d?l().createElement(s.JRCLoader,{size:"s"}):l().createElement(l().Fragment,null,0===b.length&&l().createElement(Vi,null,e.formatMessage({id:"Office_No_Providers"})),l().createElement(Gi,{isLocked:0===b.length},W&&l().createElement(l().Fragment,null,l().createElement(Fi,null,l().createElement(zi,{size:"l"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_Provider"})),l().createElement(Bi,{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&&g(),p("provider",e)}}))),l().createElement(Fi,null,l().createElement(zi,{size:"l"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Settings"})),l().createElement(Ti,{control:m,name:"hostname",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Hostname"}),rules:{required:!0}}),l().createElement(Ti,{control:m,name:"username",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_Username"}),rules:{required:!0}}),l().createElement(Oi,{control:m,name:"password",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_Password"}),rules:{required:!0}})),l().createElement(Fi,null,l().createElement(zi,{size:"l"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_IMap_Mailbox"})),l().createElement(Ai,{control:m,name:"imapPort",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Port"}),rules:{required:!0}}),l().createElement(Bi,{label:"OfficeHook_Conf_Select_Connection_Security",initialValue:C[0],options:C,handleChange:e=>p("imapConnectionSecurity",e)}),l().createElement(Ti,{control:m,name:"imapMailbox",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Mailbox"}),rules:{required:!0}})),l().createElement(Fi,null,l().createElement(zi,{size:"l"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_CalDav_Calendar"})),l().createElement(Ti,{control:m,name:"calDavCalendar",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_CalDav_Calendar"}),rules:{required:!0}})),l().createElement(Fi,null,l().createElement(zi,{size:"l"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_CardDav_Address_Book"})),l().createElement(Ti,{control:m,name:"cardDavAddressBook",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_CardDav_Address_Book"}),rules:{required:!0}}))),l().createElement(Mi,{label:e.formatMessage({id:"OfficeHook_Conf_Prompt_Submit"}),loader:d,disabled:d||0===b.length||!h,onClick:()=>{d||(u(!0),k().office.setConfiguration(y).then((()=>window.location.reload())).catch((e=>t(c.y8.actions.error({label:e.errorMsg})))).finally((()=>{a(!1),u(!1),g()})))}})))))},Bi=({label:e,initialValue:t,options:n,handleChange:o})=>{const{control:a,watch:r}=(0,T.useForm)({defaultValues:{provider:t},criteriaMode:"all"});return(0,i.useEffect)((()=>{const e=r((e=>{e.provider&&e.provider.value&&o(e.provider.value)}));return()=>e.unsubscribe()}),[r,o]),l().createElement(Ii,{label:e,name:"provider",options:null!=n?n:[],getValue:e=>e.value,getLabel:"label",getSearch:"label",control:a,rules:{required:!0}})},Hi=d.j.getLazyComponent("ButtonDropdown"),Pi=d.j.getLazyComponent("Tooltip"),Ui=a().div`
540
+ `,Ri={username:"",password:"",hostname:"",imapPort:993,imapConnectionSecurity:k.ImapConnection.NONE,imapMailbox:"",cardDavAddressBook:"",calDavCalendar:"",provider:""},Bi=()=>{const e=(0,r.useIntl)(),t=(0,oe.useDispatch)(),n=(0,s.useAbortController)(),[o,a]=(0,i.useState)(!1),[d,u]=(0,i.useState)(!1),{control:m,reset:g,setValue:p,getValues:f,watch:E,formState:{isValid:h}}=(0,A.useForm)({defaultValues:Ri,criteriaMode:"all"}),[b,v]=(0,i.useState)([]),y=E(),C=[{label:"NONE",value:k.ImapConnection.NONE},{label:"SSL",value:k.ImapConnection.SSL},{label:"STARTTLS",value:k.ImapConnection.STARTTLS}],x=(0,i.useCallback)((e=>{L().office.getConfiguration().then((({result:t})=>{var n;g(Object.assign(Object.assign({},t),{provider:e.includes(null!==(n=t.provider)&&void 0!==n?n:"")?t.provider:e[0]}))}))}),[g]);(0,i.useEffect)((()=>{o&&(u(!0),L().office.getProviders({signal:n.signal}).then((({result:e})=>{n.signal.aborted||(v(e),x(e.map((e=>e.id))))})).catch((e=>{n.signal.aborted||t(c.y8.actions.error({label:e.errorMsg}))})).finally((()=>{u(!1)})))}),[o,n.signal,t,x]),(0,i.useEffect)((()=>{1===b.length&&p("provider",b[0].id)}),[b,p]);const w=()=>a(!1),W=(0,i.useMemo)((()=>b.length>1),[b]);return l().createElement(l().Fragment,null,l().createElement(Vi,null,l().createElement(Ti,{label:e.formatMessage({id:"Office_Set_Configuration"}),onClick:()=>a(!0)})),l().createElement(ji,{open:o,radius:"small",closeHandler:w},l().createElement(Mi,{overflow:"scroll",title:e.formatMessage({id:"Office_Set_Configuration"}),onClickIconClose:w},d?l().createElement(s.JRCLoader,{size:"s"}):l().createElement(l().Fragment,null,0===b.length&&l().createElement(Fi,null,e.formatMessage({id:"Office_No_Providers"})),l().createElement(Di,{isLocked:0===b.length},W&&l().createElement(l().Fragment,null,l().createElement($i,null,l().createElement(Gi,{size:"l"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_Provider"})),l().createElement(Hi,{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&&g(),p("provider",e)}}))),l().createElement($i,null,l().createElement(Gi,{size:"l"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Settings"})),l().createElement(Ai,{control:m,name:"hostname",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Hostname"}),rules:{required:!0}}),l().createElement(Ai,{control:m,name:"username",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_Username"}),rules:{required:!0}}),l().createElement(zi,{control:m,name:"password",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_Password"}),rules:{required:!0}})),l().createElement($i,null,l().createElement(Gi,{size:"l"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_IMap_Mailbox"})),l().createElement(Ii,{control:m,name:"imapPort",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Port"}),rules:{required:!0}}),l().createElement(Hi,{label:"OfficeHook_Conf_Select_Connection_Security",initialValue:C[0],options:C,handleChange:e=>p("imapConnectionSecurity",e)}),l().createElement(Ai,{control:m,name:"imapMailbox",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Mailbox"}),rules:{required:!0}})),l().createElement($i,null,l().createElement(Gi,{size:"l"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_CalDav_Calendar"})),l().createElement(Ai,{control:m,name:"calDavCalendar",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_CalDav_Calendar"}),rules:{required:!0}})),l().createElement($i,null,l().createElement(Gi,{size:"l"},l().createElement(r.FormattedMessage,{id:"OfficeHook_Conf_CardDav_Address_Book"})),l().createElement(Ai,{control:m,name:"cardDavAddressBook",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_CardDav_Address_Book"}),rules:{required:!0}}))),l().createElement(Ti,{label:e.formatMessage({id:"OfficeHook_Conf_Prompt_Submit"}),loader:d,disabled:d||0===b.length||!h,onClick:()=>{d||(u(!0),L().office.setConfiguration(y).then((()=>window.location.reload())).catch((e=>t(c.y8.actions.error({label:e.errorMsg})))).finally((()=>{a(!1),u(!1),g()})))}})))))},Hi=({label:e,initialValue:t,options:n,handleChange:o})=>{const{control:a,watch:r}=(0,A.useForm)({defaultValues:{provider:t},criteriaMode:"all"});return(0,i.useEffect)((()=>{const e=r((e=>{e.provider&&e.provider.value&&o(e.provider.value)}));return()=>e.unsubscribe()}),[r,o]),l().createElement(Oi,{label:e,name:"provider",options:null!=n?n:[],getValue:e=>e.value,getLabel:"label",getSearch:"label",control:a,rules:{required:!0}})},Pi=d.j.getLazyComponent("ButtonDropdown"),Ui=d.j.getLazyComponent("Tooltip"),Ni=a().div`
539
541
  margin-right: ${e=>e.theme.space.sm}px;
540
542
  button {
541
543
  background: ${e=>e.theme.color.white};
542
544
  }
543
- `,Ni=({uniqid:e,isConfigurationValid:t=!1,handleLogout:n})=>{const i=(0,r.useIntl)(),o=(0,le.useDispatch)(),a=[{label:i.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{o(c.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),k().office.setConfiguration($i).finally(n)}}];return l().createElement(sn,{uniqid:e,dropdown:()=>t&&l().createElement(Ui,null,l().createElement(Pi,{position:"left",description:i.formatMessage({id:"WIDGET_Prompt_Dropdown"})},l().createElement(Hi,{small:!0,smallOpenDirection:"left",options:a,icon:"icon-cogwheel",label:"",color:"primary",variant:"outlined"})))})},Yi=d.j.getLazyComponent("WidgetContactCardDav"),Ji=({widget:e,mode:t,levelFallback:n})=>{const{uniqid:o}=e,a=(0,u.jL)(),[r,s]=(0,i.useState)(void 0),[d,m]=(0,i.useState)(void 0),[g,p]=(0,i.useState)(!1),f=(0,u.GV)((e=>c.x0.selectors.selectWidgetLevel(e,o)),le.shallowEqual),[E,h]=(0,i.useState)([]),b=(0,i.useCallback)(((e,t)=>{e&&400===e.error&&k().office.setConfiguration($i),t?window.location.reload():(s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1})))}),[a,o]),v=(0,i.useCallback)((e=>{s(e),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))}),[a,o]),y=(0,i.useCallback)((e=>a(c.x0.slice.actions.setWidgetState({uniqid:o,loading:e}))),[o,a]),C=(0,i.useCallback)((()=>{k().office.getProviderBaseUrls().then((({result:e})=>{m(e.dav_address_book_url)})).finally((()=>y(!1)))}),[y]),x=(0,i.useCallback)((()=>{k().office.davAddressBookGetContacts({limit:10}).then((({result:e})=>{h(e),p(!0)})).catch((()=>{a(c.y8.actions.error({label:"PLUGIN_Manager_Connection_Error"})),s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1}))})).finally((()=>y(!1)))}),[y,a,o]);return(0,i.useEffect)((()=>{if(!g)return;if(!r)return;if(f!==w.WIDGET_LEVEL_3)return;const e=setInterval(x,4e3);return()=>clearInterval(e)}),[r,x,g,f]),(0,i.useEffect)((()=>{y(!0),k().office.isConfigurationValid().then((({result:e})=>v(e))).catch(b).finally((()=>y(!1)))}),[v,f,C,y,b]),(0,i.useEffect)((()=>{if(r)return f===w.WIDGET_LEVEL_1?(y(!0),void C()):void x()}),[r,C,y,x,f]),r&&f&&f!==w.WIDGET_LEVEL_3&&n?l().createElement(l().Fragment,null,n(f,null!=d?d:"")):l().createElement(en,{header:()=>l().createElement(l().Fragment,null,l().createElement(Ni,{uniqid:o,isConfigurationValid:void 0!==r&&!0===r,handleLogout:()=>b(void 0,!0)})),scrollable:()=>l().createElement(Qt,{uniqid:o},r&&l().createElement(Yi,{contactCardList:E}),void 0===r&&l().createElement(l().Fragment,null),void 0!==r&&!1===r&&"view"===t&&l().createElement(Ri,null))})},Qi=d.j.getLazyComponent("ButtonDropdown"),Xi=d.j.getLazyComponent("Tooltip"),Ki=a().div`
545
+ `,Yi=({uniqid:e,isConfigurationValid:t=!1,handleLogout:n})=>{const i=(0,r.useIntl)(),o=(0,oe.useDispatch)(),a=[{label:i.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{o(c.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),L().office.setConfiguration(Ri).finally(n)}}];return l().createElement(cn,{uniqid:e,dropdown:()=>t&&l().createElement(Ni,null,l().createElement(Ui,{position:"left",description:i.formatMessage({id:"WIDGET_Prompt_Dropdown"})},l().createElement(Pi,{small:!0,smallOpenDirection:"left",options:a,icon:"icon-cogwheel",label:"",color:"primary",variant:"outlined"})))})},Ji=d.j.getLazyComponent("WidgetContactCardDav"),Qi=({widget:e,mode:t,levelFallback:n})=>{const{uniqid:o}=e,a=(0,u.jL)(),[r,s]=(0,i.useState)(void 0),[d,m]=(0,i.useState)(void 0),[g,p]=(0,i.useState)(!1),f=(0,u.GV)((e=>c.x0.selectors.selectWidgetLevel(e,o)),oe.shallowEqual),[E,h]=(0,i.useState)([]),b=(0,i.useCallback)(((e,t)=>{e&&400===e.error&&L().office.setConfiguration(Ri),t?window.location.reload():(s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1})))}),[a,o]),v=(0,i.useCallback)((e=>{s(e),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))}),[a,o]),y=(0,i.useCallback)((e=>a(c.x0.slice.actions.setWidgetState({uniqid:o,loading:e}))),[o,a]),C=(0,i.useCallback)((()=>{L().office.getProviderBaseUrls().then((({result:e})=>{m(e.dav_address_book_url)})).finally((()=>y(!1)))}),[y]),x=(0,i.useCallback)((()=>{L().office.davAddressBookGetContacts({limit:10}).then((({result:e})=>{h(e),p(!0)})).catch((()=>{a(c.y8.actions.error({label:"PLUGIN_Manager_Connection_Error"})),s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1}))})).finally((()=>y(!1)))}),[y,a,o]);return(0,i.useEffect)((()=>{if(!g)return;if(!r)return;if(f!==k.WIDGET_LEVEL_3)return;const e=setInterval(x,4e3);return()=>clearInterval(e)}),[r,x,g,f]),(0,i.useEffect)((()=>{y(!0),L().office.isConfigurationValid().then((({result:e})=>v(e))).catch(b).finally((()=>y(!1)))}),[v,f,C,y,b]),(0,i.useEffect)((()=>{if(r)return f===k.WIDGET_LEVEL_1?(y(!0),void C()):void x()}),[r,C,y,x,f]),r&&f&&f!==k.WIDGET_LEVEL_3&&n?l().createElement(l().Fragment,null,n(f,null!=d?d:"")):l().createElement(tn,{header:()=>l().createElement(l().Fragment,null,l().createElement(Yi,{uniqid:o,isConfigurationValid:void 0!==r&&!0===r,handleLogout:()=>b(void 0,!0)})),scrollable:()=>l().createElement(Kt,{uniqid:o},r&&l().createElement(Ji,{contactCardList:E}),void 0===r&&l().createElement(l().Fragment,null),void 0!==r&&!1===r&&"view"===t&&l().createElement(Bi,null))})},Ki=d.j.getLazyComponent("ButtonDropdown"),Xi=d.j.getLazyComponent("Tooltip"),Zi=a().div`
544
546
  margin-right: ${e=>e.theme.space.sm}px;
545
547
  button {
546
548
  background: ${e=>e.theme.color.white};
547
549
  }
548
- `,Zi=({uniqid:e,isConfigurationValid:t=!1,handleLogout:n})=>{const i=(0,r.useIntl)(),o=(0,le.useDispatch)(),a=[{label:i.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{o(c.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),k().office.setConfiguration($i).finally(n)}}];return l().createElement(sn,{uniqid:e,dropdown:()=>t&&l().createElement(Ki,null,l().createElement(Xi,{position:"left",description:i.formatMessage({id:"WIDGET_Prompt_Dropdown"})},l().createElement(Qi,{small:!0,smallOpenDirection:"left",options:a,icon:"icon-cogwheel",label:"",color:"primary",variant:"outlined"})))})},el=d.j.getLazyComponent("WidgetCalendarCalDav"),tl=({widget:e,mode:t,levelFallback:n})=>{const{uniqid:o}=e,a=(0,u.jL)(),[r,d]=(0,i.useState)(void 0),[m,g]=(0,i.useState)(!1),p=(0,u.GV)((e=>c.x0.selectors.selectWidgetLevel(e,o)),le.shallowEqual),[f,E]=(0,i.useState)(void 0),[h,b]=(0,i.useState)([]),v=(0,i.useCallback)(((e,t)=>{e&&400===e.error&&k().office.setConfiguration($i),t?window.location.reload():(d(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1})))}),[a,o]),y=(0,i.useCallback)((e=>{d(e),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))}),[a,o]),C=(0,i.useCallback)((e=>a(c.x0.slice.actions.setWidgetState({uniqid:o,loading:e}))),[o,a]),x=(0,i.useCallback)((()=>{k().office.getProviderBaseUrls().then((({result:e})=>{E(e.dav_calendar_url)})).finally((()=>C(!1)))}),[C]),L=(0,i.useCallback)((()=>{const e=new Date,t=s.Utils.date.addMonth(new Date(e));k().office.davCalendarGetEvents({limit:10,dateStart:s.Utils.date.formatDateTime(e),dateEnd:s.Utils.date.formatDateTime(t)}).then((({result:e})=>{b(e),g(!0)})).catch((()=>{a(c.y8.actions.error({label:"PLUGIN_Manager_Connection_Error"})),d(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1}))})).finally((()=>C(!1)))}),[C,a,o]);return(0,i.useEffect)((()=>{if(!m)return;if(!r)return;if(p!==w.WIDGET_LEVEL_3)return;const e=setInterval(L,6e4);return()=>clearInterval(e)}),[r,L,m,p]),(0,i.useEffect)((()=>{C(!0),k().office.isConfigurationValid().then((({result:e})=>y(e))).catch(v)}),[v,C,y]),(0,i.useEffect)((()=>{if(r)return p===w.WIDGET_LEVEL_1?(C(!0),void x()):void L()}),[r,x,C,L,p]),r&&p&&p!==w.WIDGET_LEVEL_3&&n?l().createElement(l().Fragment,null,n(p,null!=f?f:"")):l().createElement(en,{header:()=>l().createElement(l().Fragment,null,l().createElement(Zi,{uniqid:o,isConfigurationValid:void 0!==r&&!0===r,handleLogout:()=>v(void 0,!0)})),scrollable:()=>l().createElement(Qt,{uniqid:o},r&&l().createElement(el,{calendarListEvent:h}),void 0===r&&l().createElement(l().Fragment,null),void 0!==r&&!1===r&&"view"===t&&l().createElement(Ri,null))})},nl=d.j.getLazyComponent("ButtonDropdown"),il=d.j.getLazyComponent("Tooltip"),ll=a().div`
550
+ `,el=({uniqid:e,isConfigurationValid:t=!1,handleLogout:n})=>{const i=(0,r.useIntl)(),o=(0,oe.useDispatch)(),a=[{label:i.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{o(c.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),L().office.setConfiguration(Ri).finally(n)}}];return l().createElement(cn,{uniqid:e,dropdown:()=>t&&l().createElement(Zi,null,l().createElement(Xi,{position:"left",description:i.formatMessage({id:"WIDGET_Prompt_Dropdown"})},l().createElement(Ki,{small:!0,smallOpenDirection:"left",options:a,icon:"icon-cogwheel",label:"",color:"primary",variant:"outlined"})))})},tl=d.j.getLazyComponent("WidgetCalendarCalDav"),nl=({widget:e,mode:t,levelFallback:n})=>{const{uniqid:o}=e,a=(0,u.jL)(),[r,d]=(0,i.useState)(void 0),[m,g]=(0,i.useState)(!1),p=(0,u.GV)((e=>c.x0.selectors.selectWidgetLevel(e,o)),oe.shallowEqual),[f,E]=(0,i.useState)(void 0),[h,b]=(0,i.useState)([]),v=(0,i.useCallback)(((e,t)=>{e&&400===e.error&&L().office.setConfiguration(Ri),t?window.location.reload():(d(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1})))}),[a,o]),y=(0,i.useCallback)((e=>{d(e),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))}),[a,o]),C=(0,i.useCallback)((e=>a(c.x0.slice.actions.setWidgetState({uniqid:o,loading:e}))),[o,a]),x=(0,i.useCallback)((()=>{L().office.getProviderBaseUrls().then((({result:e})=>{E(e.dav_calendar_url)})).finally((()=>C(!1)))}),[C]),w=(0,i.useCallback)((()=>{const e=new Date,t=s.Utils.date.addMonth(new Date(e));L().office.davCalendarGetEvents({limit:10,dateStart:s.Utils.date.formatDateTime(e),dateEnd:s.Utils.date.formatDateTime(t)}).then((({result:e})=>{b(e),g(!0)})).catch((()=>{a(c.y8.actions.error({label:"PLUGIN_Manager_Connection_Error"})),d(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1}))})).finally((()=>C(!1)))}),[C,a,o]);return(0,i.useEffect)((()=>{if(!m)return;if(!r)return;if(p!==k.WIDGET_LEVEL_3)return;const e=setInterval(w,6e4);return()=>clearInterval(e)}),[r,w,m,p]),(0,i.useEffect)((()=>{C(!0),L().office.isConfigurationValid().then((({result:e})=>y(e))).catch(v)}),[v,C,y]),(0,i.useEffect)((()=>{if(r)return p===k.WIDGET_LEVEL_1?(C(!0),void x()):void w()}),[r,x,C,w,p]),r&&p&&p!==k.WIDGET_LEVEL_3&&n?l().createElement(l().Fragment,null,n(p,null!=f?f:"")):l().createElement(tn,{header:()=>l().createElement(l().Fragment,null,l().createElement(el,{uniqid:o,isConfigurationValid:void 0!==r&&!0===r,handleLogout:()=>v(void 0,!0)})),scrollable:()=>l().createElement(Kt,{uniqid:o},r&&l().createElement(tl,{calendarListEvent:h}),void 0===r&&l().createElement(l().Fragment,null),void 0!==r&&!1===r&&"view"===t&&l().createElement(Bi,null))})},il=d.j.getLazyComponent("ButtonDropdown"),ll=d.j.getLazyComponent("Tooltip"),ol=a().div`
549
551
  margin-right: ${e=>e.theme.space.sm}px;
550
552
  button {
551
553
  background: ${e=>e.theme.color.white};
552
554
  }
553
- `,ol=a().div`
555
+ `,al=a().div`
554
556
  font-size: ${e=>e.theme.size.sm+4}px;
555
557
  color: ${e=>e.color};
556
- `,al=({uniqid:e,isConfigurationValid:t=!1,handleLogout:n})=>{const i=(0,r.useIntl)(),o=(0,u.jL)(),a=(0,u.GV)((t=>c.x0.selectors.selectWidgetChipCount(t,e)),le.shallowEqual),s=[{label:i.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{o(c.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),k().office.setConfiguration($i).finally(n)}}];return l().createElement(sn,{uniqid:e,dropdown:()=>t&&l().createElement(ll,null,l().createElement(il,{position:"left",description:i.formatMessage({id:"WIDGET_Prompt_Dropdown"})},l().createElement(nl,{small:!0,smallOpenDirection:"left",options:s,icon:"icon-cogwheel",label:"",color:"primary",variant:"outlined"}))),subHeader:e=>t&&0!==a&&l().createElement(ol,{color:e},"(",i.formatMessage({id:"WIDGET_Email_IMAP_Unread_Emails"},{count:a}),")")})},rl=d.j.getLazyComponent("WidgetEmailsImap"),sl=({widget:e,mode:t,levelFallback:n})=>{const{uniqid:o}=e,a=(0,u.jL)(),[r,s]=(0,i.useState)(void 0),[d,m]=(0,i.useState)(!1),[g,p]=(0,i.useState)([]),[f,E]=(0,i.useState)(void 0),h=(0,u.GV)((t=>c.x0.selectors.selectWidgetLevel(t,e.uniqid)),le.shallowEqual),b=(0,i.useCallback)(((e,t)=>{e&&400===e.error&&k().office.setConfiguration($i),t?window.location.reload():(s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1})))}),[a,o]),v=(0,i.useCallback)((()=>{k().office.imapInboxGetUnreadEmailsCount().then((({result:e})=>{a(c.x0.slice.actions.setWidgetChipCount({uniqid:o,count:e})),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))})).catch(b)}),[a,o,b]),y=(0,i.useCallback)((e=>a(c.x0.slice.actions.setWidgetState({uniqid:o,loading:e}))),[o,a]),C=(0,i.useCallback)((()=>{k().office.getProviderBaseUrls().then((({result:e})=>{E(e.imap_inbox_url)})).finally((()=>y(!1)))}),[y]),x=(0,i.useCallback)((e=>{s(e),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))}),[a,o]),L=(0,i.useCallback)((()=>{k().office.imapInboxGetEmails({limit:10}).then((({result:e})=>{p(e),m(!0)})).catch((()=>{a(c.y8.actions.error({label:"PLUGIN_Manager_Connection_Error"})),s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1}))})).finally((()=>y(!1)))}),[y,a,o]);return(0,i.useEffect)((()=>{if(!d)return;if(!r)return;if(h===w.WIDGET_LEVEL_1)return;const e=setInterval((()=>{h===w.WIDGET_LEVEL_2&&v(),h===w.WIDGET_LEVEL_3&&(v(),L())}),6e4);return()=>clearInterval(e)}),[r,L,d,v,h]),(0,i.useEffect)((()=>{k().office.isConfigurationValid().then((({result:e})=>x(e))).catch(b)}),[x,b]),(0,i.useEffect)((()=>{if(r){if(h===w.WIDGET_LEVEL_1)return y(!0),void C();if(h===w.WIDGET_LEVEL_2)return y(!0),v(),void C();y(!0),v(),L()}}),[r,h,C,L,y,v,a]),r&&h&&h!==w.WIDGET_LEVEL_3&&n?l().createElement(l().Fragment,null,n(h,null!=f?f:"")):l().createElement(en,{header:()=>l().createElement(l().Fragment,null,l().createElement(al,{uniqid:o,isConfigurationValid:void 0!==r&&!0===r,handleLogout:()=>b(void 0,!0)})),scrollable:()=>l().createElement(Qt,{uniqid:o},void 0===r&&l().createElement(l().Fragment,null),void 0!==r&&!1===r&&"view"===t&&l().createElement(Ri,null),r&&l().createElement(rl,{emailList:g}))})},cl=a().div`
558
+ `,rl=({uniqid:e,isConfigurationValid:t=!1,handleLogout:n})=>{const i=(0,r.useIntl)(),o=(0,u.jL)(),a=(0,u.GV)((t=>c.x0.selectors.selectWidgetChipCount(t,e)),oe.shallowEqual),s=[{label:i.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{o(c.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),L().office.setConfiguration(Ri).finally(n)}}];return l().createElement(cn,{uniqid:e,dropdown:()=>t&&l().createElement(ol,null,l().createElement(ll,{position:"left",description:i.formatMessage({id:"WIDGET_Prompt_Dropdown"})},l().createElement(il,{small:!0,smallOpenDirection:"left",options:s,icon:"icon-cogwheel",label:"",color:"primary",variant:"outlined"}))),subHeader:e=>t&&0!==a&&l().createElement(al,{color:e},"(",i.formatMessage({id:"WIDGET_Email_IMAP_Unread_Emails"},{count:a}),")")})},sl=d.j.getLazyComponent("WidgetEmailsImap"),cl=({widget:e,mode:t,levelFallback:n})=>{const{uniqid:o}=e,a=(0,u.jL)(),[r,s]=(0,i.useState)(void 0),[d,m]=(0,i.useState)(!1),[g,p]=(0,i.useState)([]),[f,E]=(0,i.useState)(void 0),h=(0,u.GV)((t=>c.x0.selectors.selectWidgetLevel(t,e.uniqid)),oe.shallowEqual),b=(0,i.useCallback)(((e,t)=>{e&&400===e.error&&L().office.setConfiguration(Ri),t?window.location.reload():(s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1})))}),[a,o]),v=(0,i.useCallback)((()=>{L().office.imapInboxGetUnreadEmailsCount().then((({result:e})=>{a(c.x0.slice.actions.setWidgetChipCount({uniqid:o,count:e})),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))})).catch(b)}),[a,o,b]),y=(0,i.useCallback)((e=>a(c.x0.slice.actions.setWidgetState({uniqid:o,loading:e}))),[o,a]),C=(0,i.useCallback)((()=>{L().office.getProviderBaseUrls().then((({result:e})=>{E(e.imap_inbox_url)})).finally((()=>y(!1)))}),[y]),x=(0,i.useCallback)((e=>{s(e),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0}))}),[a,o]),w=(0,i.useCallback)((()=>{L().office.imapInboxGetEmails({limit:10}).then((({result:e})=>{p(e),m(!0)})).catch((()=>{a(c.y8.actions.error({label:"PLUGIN_Manager_Connection_Error"})),s(!1),a(c.x0.slice.actions.setWidgetState({uniqid:o,initialized:!0,loading:!1}))})).finally((()=>y(!1)))}),[y,a,o]);return(0,i.useEffect)((()=>{if(!d)return;if(!r)return;if(h===k.WIDGET_LEVEL_1)return;const e=setInterval((()=>{h===k.WIDGET_LEVEL_2&&v(),h===k.WIDGET_LEVEL_3&&(v(),w())}),6e4);return()=>clearInterval(e)}),[r,w,d,v,h]),(0,i.useEffect)((()=>{L().office.isConfigurationValid().then((({result:e})=>x(e))).catch(b)}),[x,b]),(0,i.useEffect)((()=>{if(r){if(h===k.WIDGET_LEVEL_1)return y(!0),void C();if(h===k.WIDGET_LEVEL_2)return y(!0),v(),void C();y(!0),v(),w()}}),[r,h,C,w,y,v,a]),r&&h&&h!==k.WIDGET_LEVEL_3&&n?l().createElement(l().Fragment,null,n(h,null!=f?f:"")):l().createElement(tn,{header:()=>l().createElement(l().Fragment,null,l().createElement(rl,{uniqid:o,isConfigurationValid:void 0!==r&&!0===r,handleLogout:()=>b(void 0,!0)})),scrollable:()=>l().createElement(Kt,{uniqid:o},void 0===r&&l().createElement(l().Fragment,null),void 0!==r&&!1===r&&"view"===t&&l().createElement(Bi,null),r&&l().createElement(sl,{emailList:g}))})},dl=a().div`
557
559
  padding: ${e=>e.theme.space.md}px;
558
560
  border-bottom: 1px solid ${e=>e.theme.color.grey1};
559
- `,dl=({uniqid:e})=>{const t=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e)),le.shallowEqual),n=(0,o.useTheme)(),a=(0,u.GV)((t=>c.x0.selectors.selectWidgetTitleStyle(t,e)),le.shallowEqual),r=(0,i.useMemo)((()=>({color:a&&a.color?String(a.color):n.color.black,backgroundColor:a&&a["background-color"]?String(a["background-color"]):n.color.white,fontSize:a&&a["font-size"]?`${a["font-size"]}px`:"24px",fontWeight:a&&a["font-weight"]?String(a["font-weight"]):"medium",textAlign:a&&a["text-align"]?String(a["text-align"]):"left"})),[a,n]),d=(0,i.useMemo)((()=>t&&"string"==typeof t.title&&0!==t.title.length?t.title:void 0),[t]);return d?l().createElement(cl,{style:{color:r.color,backgroundColor:r.backgroundColor,fontSize:r.fontSize,fontWeight:r.fontWeight,textAlign:r.textAlign}},l().createElement(s.JRCHtml,{as:"span",__html:d})):l().createElement(l().Fragment,null)},ul=({uniqid:e})=>{const t=(0,r.useIntl)(),n=(0,u.jL)(),o=(0,u.GV)((t=>{var n;return null===(n=c.x0.selectors.selectWidget(t,e))||void 0===n?void 0:n.title}),le.shallowEqual),{control:a,watch:d}=(0,T.useForm)({defaultValues:{widgetTitle:o},criteriaMode:"all"});return(0,i.useEffect)((()=>{const t=d((t=>{n(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,title:t.widgetTitle}))}));return()=>t.unsubscribe()}),[d,n,e]),l().createElement(s.JRCInputText,{name:"widgetTitle",control:a,placeholder:t.formatMessage({id:"GLOBAL_Title"}),width:"100%",margin:"0"})},ml=d.j.getLazyComponent("Button"),gl=d.j.getLazyComponent("ModalLayout"),pl=d.j.getLazyComponent("ModalContent"),fl=a().div`
561
+ `,ul=({uniqid:e})=>{const t=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e)),oe.shallowEqual),n=(0,o.useTheme)(),a=(0,u.GV)((t=>c.x0.selectors.selectWidgetTitleStyle(t,e)),oe.shallowEqual),r=(0,i.useMemo)((()=>({color:a&&a.color?String(a.color):n.color.black,backgroundColor:a&&a["background-color"]?String(a["background-color"]):n.color.white,fontSize:a&&a["font-size"]?`${a["font-size"]}px`:"24px",fontWeight:a&&a["font-weight"]?String(a["font-weight"]):"medium",textAlign:a&&a["text-align"]?String(a["text-align"]):"left"})),[a,n]),d=(0,i.useMemo)((()=>t&&"string"==typeof t.title&&0!==t.title.length?t.title:void 0),[t]);return d?l().createElement(dl,{style:{color:r.color,backgroundColor:r.backgroundColor,fontSize:r.fontSize,fontWeight:r.fontWeight,textAlign:r.textAlign}},l().createElement(s.JRCHtml,{as:"span",__html:d})):l().createElement(l().Fragment,null)},ml=({uniqid:e})=>{const t=(0,r.useIntl)(),n=(0,u.jL)(),o=(0,u.GV)((t=>{var n;return null===(n=c.x0.selectors.selectWidget(t,e))||void 0===n?void 0:n.title}),oe.shallowEqual),{control:a,watch:d}=(0,A.useForm)({defaultValues:{widgetTitle:o},criteriaMode:"all"});return(0,i.useEffect)((()=>{const t=d((t=>{n(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,title:t.widgetTitle}))}));return()=>t.unsubscribe()}),[d,n,e]),l().createElement(s.JRCInputText,{name:"widgetTitle",control:a,placeholder:t.formatMessage({id:"GLOBAL_Title"}),width:"100%",margin:"0"})},gl=d.j.getLazyComponent("Button"),pl=d.j.getLazyComponent("ModalLayout"),fl=d.j.getLazyComponent("ModalContent"),El=a().div`
560
562
  padding: ${e=>e.theme.space.md}px;
561
563
  display: flex;
562
564
  flex-direction: row-reverse;
563
- `,El=a().div`
565
+ `,hl=a().div`
564
566
  flex: 1;
565
567
  display: flex;
566
568
  flex-direction: row;
567
569
  gap: ${e=>e.theme.space.sm}px;
568
570
  padding: ${e=>e.theme.space.sm}px;
569
571
  border-bottom: 1px solid ${e=>e.theme.color.grey1};
570
- `,hl=a().div`
572
+ `,bl=a().div`
571
573
  flex: 1;
572
574
  display: flex;
573
575
  fieldset:first-of-type {
574
576
  margin: 0px !important;
575
577
  }
576
- `,bl=a().div`
578
+ `,vl=a().div`
577
579
  display: flex;
578
580
  gap: ${e=>e.theme.space.sm}px;
579
- `,vl=({uniqid:e,name:t,handleOpenEditor:n})=>{const o=(0,u.jL)(),a=(0,r.useIntl)(),[d,m]=(0,i.useState)(!1),g=(0,i.useCallback)((()=>{o(c.cr.slice.actions.registerEditor({uniqid:e,name:t,mode:"edit"}))}),[e,o,t]),p=(0,i.useCallback)((()=>{o(c.x0.slice.actions.flushWidget({uniqid:e}))}),[e,o]);return l().createElement(l().Fragment,null,l().createElement(El,null,l().createElement(hl,null,l().createElement(ul,{uniqid:e})),l().createElement(bl,null,l().createElement(s.JRCIconButton,{icon:"icon-pencil",bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:14,onClick:null!=n?n:g,title:a.formatMessage({id:"BUTTON_Title_Open_Edit_Panel"})}),l().createElement(s.JRCIconButton,{icon:"icon-trash",bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:14,onClick:()=>m(!0),title:a.formatMessage({id:"BUTTON_Title_Open_Remove_Widget"})}))),d&&l().createElement(gl,{enableClickAwayCloseModal:!0,open:d,closeHandler:()=>m(!1)},l().createElement(pl,{overflow:"scroll",title:a.formatMessage({id:"WIDGET_Remove_Widget"}),onClickIconClose:()=>m(!1)},a.formatMessage({id:"WIDGET_Delete_Widget_Confirmation"})),l().createElement(fl,null,l().createElement(ml,{label:a.formatMessage({id:"GLOBAL_Confirm"}),onClick:p}))))},yl=a().div`
581
+ `,yl=({uniqid:e,name:t,handleOpenEditor:n})=>{const o=(0,u.jL)(),a=(0,r.useIntl)(),[d,m]=(0,i.useState)(!1),g=(0,i.useCallback)((()=>{o(c.cr.slice.actions.registerEditor({uniqid:e,name:t,mode:"edit"}))}),[e,o,t]),p=(0,i.useCallback)((()=>{o(c.x0.slice.actions.flushWidget({uniqid:e}))}),[e,o]);return l().createElement(l().Fragment,null,l().createElement(hl,null,l().createElement(bl,null,l().createElement(ml,{uniqid:e})),l().createElement(vl,null,l().createElement(s.JRCIconButton,{icon:"icon-pencil",bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:14,onClick:null!=n?n:g,title:a.formatMessage({id:"BUTTON_Title_Open_Edit_Panel"})}),l().createElement(s.JRCIconButton,{icon:"icon-trash",bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:14,onClick:()=>m(!0),title:a.formatMessage({id:"BUTTON_Title_Open_Remove_Widget"})}))),d&&l().createElement(pl,{enableClickAwayCloseModal:!0,open:d,closeHandler:()=>m(!1)},l().createElement(fl,{overflow:"scroll",title:a.formatMessage({id:"WIDGET_Remove_Widget"}),onClickIconClose:()=>m(!1)},a.formatMessage({id:"WIDGET_Delete_Widget_Confirmation"})),l().createElement(El,null,l().createElement(gl,{label:a.formatMessage({id:"GLOBAL_Confirm"}),onClick:p}))))},Cl=a().div`
580
582
  position: absolute;
581
583
  inset: 0;
582
584
  display: flex;
583
585
  align-items: center;
584
586
  justify-content: center;
585
587
  color: ${e=>e.theme.color.orange};
586
- `,Cl=({children:e,name:t})=>{const n=(0,u.GV)((e=>c.qn.selectors.selectHook(e,t))),i=(0,r.useIntl)();return n&&!n.hasLicense?l().createElement(yl,null,i.formatMessage({id:"WIDGET_Missing_License"},{label:"label"in n?n.label:""})):l().createElement(l().Fragment,null,e)},xl=a().div`
588
+ `,xl=({children:e,name:t})=>{const n=(0,u.GV)((e=>c.qn.selectors.selectHook(e,t))),i=(0,r.useIntl)();return n&&!n.hasLicense?l().createElement(Cl,null,i.formatMessage({id:"WIDGET_Missing_License"},{label:"label"in n?n.label:""})):l().createElement(l().Fragment,null,e)},wl=a().div`
587
589
  display: flex;
588
590
  flex: 1;
589
591
  flex-direction: column;
590
- `,wl=({widget:e,width:t,inplace:n=!1,mode:i="view",onWidgetUpdate:o,cannotDisplayComponent:a,levelFallback:r,dataCy:s})=>{const{name:c}=e;return(0,w.ensureWidgetArticleButtonType)(e)?l().createElement(Bt,{widget:e,inplace:n,mode:i}):(0,w.ensureWidgetArticleGalleryType)(e)?l().createElement(Yt,{widget:e,inplace:n,mode:i}):(0,w.ensureWidgetLuccaAbsenceType)(e)?l().createElement(xl,null,l().createElement(Cl,{name:"LuccaAbsenceHook"},l().createElement(un,{uniqid:e.uniqid}))):(0,w.ensureWidgetArticleAttachmentType)(e)?l().createElement(Vt,{widget:e,inplace:n,mode:i}):(0,w.ensureWidgetArticleImageType)(e)?l().createElement(vn,{widget:e,inplace:n,mode:i}):(0,w.ensureWidgetArticleSliderType)(e)?l().createElement(Wn,{widget:e,inplace:n,mode:i,width:null!=t?t:800}):(0,w.ensureWidgetArticleTitleType)(e)?l().createElement(Dn,{widget:e,inplace:n,mode:i,dataCy:s}):(0,w.ensureWidgetArticleTextType)(e)?l().createElement(An,{widget:e,inplace:n,mode:i}):(0,w.ensureWidgetExcelDatasourceTableType)(e)?l().createElement(xl,null,l().createElement(dl,{uniqid:e.uniqid}),l().createElement(pi,Object.assign({},e.content,{uniqid:e.uniqid,mode:i}))):(0,w.ensureWidgetDatasourceTableType)(e)?l().createElement(xl,null,l().createElement(dl,{uniqid:e.uniqid}),l().createElement(ci,Object.assign({},e.content,{uniqid:e.uniqid,mode:i}))):(0,w.ensureWidgetCheckListType)(e,"widget-check-list"===e.name)?l().createElement(xl,null,"edit"===i?l().createElement(vl,{name:e.name,uniqid:e.uniqid}):l().createElement(dl,{uniqid:e.uniqid}),l().createElement(ii,{widget:e,inplace:n,mode:i,onWidgetUpdate:o})):(0,w.ensureWidgetPresenceType)(e)?l().createElement(xl,null,"edit"===i?l().createElement(vl,{name:e.name,uniqid:e.uniqid}):l().createElement(dl,{uniqid:e.uniqid}),l().createElement(wi,{widget:e,inplace:n,mode:i})):(0,w.ensureWidgetQuickSurveyType)(e)?l().createElement(xl,null,"edit"===i?l().createElement(vl,{name:e.name,uniqid:e.uniqid}):l().createElement(dl,{uniqid:e.uniqid}),l().createElement(qi,{widget:e,inplace:n,mode:i})):(0,w.ensureWidgetCalendarCalDavType)(e)?l().createElement(xl,null,l().createElement(Cl,{name:"OfficeHook"},l().createElement(tl,{widget:e,inplace:n,mode:i,levelFallback:r}))):(0,w.ensureWidgetContactCardDavType)(e)?l().createElement(xl,null,l().createElement(Cl,{name:"OfficeHook"},l().createElement(Ji,{widget:e,inplace:n,mode:i,levelFallback:r}))):(0,w.ensureWidgetEmailsImapType)(e)?l().createElement(xl,null,l().createElement(Cl,{name:"OfficeHook"},l().createElement(sl,{widget:e,inplace:n,mode:i,levelFallback:r}))):a?l().createElement(l().Fragment,null,a(c)):l().createElement(l().Fragment,null,"cannot display widget (",c,")")},kl=a().div`
592
+ `,kl=({widget:e,width:t,inplace:n=!1,mode:i="view",onWidgetUpdate:o,cannotDisplayComponent:a,levelFallback:r,dataCy:s})=>{const{name:c}=e;return(0,k.ensureWidgetArticleButtonType)(e)?l().createElement(Ht,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleGalleryType)(e)?l().createElement(Jt,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetLuccaAbsenceType)(e)?l().createElement(wl,null,l().createElement(xl,{name:"LuccaAbsenceHook"},l().createElement(mn,{uniqid:e.uniqid}))):(0,k.ensureWidgetArticleAttachmentType)(e)?l().createElement(Ft,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleImageType)(e)?l().createElement(yn,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleSliderType)(e)?l().createElement(_n,{widget:e,inplace:n,mode:i,width:null!=t?t:800}):(0,k.ensureWidgetArticleTitleType)(e)?l().createElement(Vn,{widget:e,inplace:n,mode:i,dataCy:s}):(0,k.ensureWidgetArticleTextType)(e)?l().createElement(In,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetExcelDatasourceTableType)(e)?l().createElement(wl,null,l().createElement(ul,{uniqid:e.uniqid}),l().createElement(fi,Object.assign({},e.content,{uniqid:e.uniqid,mode:i}))):(0,k.ensureWidgetDatasourceTableType)(e)?l().createElement(wl,null,l().createElement(ul,{uniqid:e.uniqid}),l().createElement(di,Object.assign({},e.content,{uniqid:e.uniqid,mode:i}))):(0,k.ensureWidgetCheckListType)(e,"widget-check-list"===e.name)?l().createElement(wl,null,"edit"===i?l().createElement(yl,{name:e.name,uniqid:e.uniqid}):l().createElement(ul,{uniqid:e.uniqid}),l().createElement(li,{widget:e,inplace:n,mode:i,onWidgetUpdate:o})):(0,k.ensureWidgetPresenceType)(e)?l().createElement(wl,null,"edit"===i?l().createElement(yl,{name:e.name,uniqid:e.uniqid}):l().createElement(ul,{uniqid:e.uniqid}),l().createElement(ki,{widget:e,inplace:n,mode:i})):(0,k.ensureWidgetQuickSurveyType)(e)?l().createElement(wl,null,"edit"===i?l().createElement(yl,{name:e.name,uniqid:e.uniqid}):l().createElement(ul,{uniqid:e.uniqid}),l().createElement(Si,{widget:e,inplace:n,mode:i})):(0,k.ensureWidgetCalendarCalDavType)(e)?l().createElement(wl,null,l().createElement(xl,{name:"OfficeHook"},l().createElement(nl,{widget:e,inplace:n,mode:i,levelFallback:r}))):(0,k.ensureWidgetContactCardDavType)(e)?l().createElement(wl,null,l().createElement(xl,{name:"OfficeHook"},l().createElement(Qi,{widget:e,inplace:n,mode:i,levelFallback:r}))):(0,k.ensureWidgetEmailsImapType)(e)?l().createElement(wl,null,l().createElement(xl,{name:"OfficeHook"},l().createElement(cl,{widget:e,inplace:n,mode:i,levelFallback:r}))):a?l().createElement(l().Fragment,null,a(c)):l().createElement(l().Fragment,null,"cannot display widget (",c,")")},Ll=a().div`
591
593
  position: absolute;
592
594
  inset: 0;
593
595
  opacity: ${e=>e.opacity};
594
596
  background-color: ${e=>e.backgroundColor};
595
597
  pointer-events: ${e=>e.pointerEvents};
596
- `,Ll=d.j.getLazyComponent("DoubleClick"),Wl=({uniqid:e,mode:t})=>{const n=(0,u.GV)((t=>t.widgets.ids[e].widget.layers),le.shallowEqual);return l().createElement(l().Fragment,null,null==n?void 0:n.map(((e,t)=>l().createElement(_l,{uniqid:e,key:t,mode:"edit"}))))},_l=({uniqid:e,mode:t})=>{const n=(0,u.GV)((t=>t.widgets.layers[e]));return"view"===t?l().createElement(kl,{opacity:1,backgroundColor:"transparent",pointerEvents:"none"},n.widgets.map(((e,t)=>l().createElement(ql,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"view"})))):l().createElement(kl,{opacity:n.visible?1:0,backgroundColor:n.visible?"rgba(255,255,255,.1)":"transparent",pointerEvents:n.locked?"none":"all"},n.widgets.map(((e,t)=>l().createElement(ql,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"edit"}))))},ql=({uniqid:e,layerId:t,mode:n})=>{const i=(0,u.jL)(),o=(0,u.GV)((t=>t.widgets.ids[e]),le.shallowEqual),a=(0,u.GV)((e=>e.widgets.layers[t]));return o&&a&&a.position?"view"===n?l().createElement("div",{style:{position:"absolute",top:a.position.y,left:a.position.x}},l().createElement(Fl,{uniqid:e,widget:o,mode:n,inplace:!0,context:"article"})):l().createElement(Sl,{position:{x:a.position.x,y:a.position.y},onMouseUp:e=>{(a.position&&a.position.x!==e.x||a.position&&a.position.y!==e.y)&&(e=>{i(c.x0.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)}},l().createElement(Ll,{onDoubleTap:()=>((e,t)=>{i(c.cr.slice.actions.registerEditor({uniqid:e,name:t}))})(o.widget.uniqid,o.widget.name)},l().createElement(Fl,{uniqid:e,widget:o,mode:n,inplace:!0,context:"article"}))):l().createElement(l().Fragment,null)},Sl=({position:e,children:t,onMouseUp:n})=>{const[o,a]=(0,i.useState)(!1),[r,s]=(0,i.useState)({x:0,y:0}),[c,d]=(0,i.useState)({x:0,y:0}),[u,m]=(0,i.useState)({x:e.x,y:e.y}),g=(0,i.useRef)(null),p=(0,i.useCallback)((e=>{a(!0),g.current&&(s({x:e.nativeEvent.clientX,y:e.nativeEvent.clientY}),d({x:u.x,y:u.y}))}),[u.x,u.y]),f=(0,i.useCallback)((e=>{if(o&&g.current){const t=c.x+(e.clientX-r.x),n=c.y+(e.clientY-r.y);m({x:t,y:n})}}),[r.x,r.y,o,c.x,c.y]),E=(0,i.useCallback)((()=>{a(!1),n({x:u.x,y:u.y})}),[u.x,u.y,n]);return(0,i.useEffect)((()=>(document.addEventListener("mousemove",f),document.addEventListener("mouseup",E),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",E)})),[f,E]),l().createElement("div",{style:{position:"absolute",top:u.y,left:u.x},ref:g,onMouseDown:p},t)},jl=d.j.getLazyComponent("Loader"),Ml=({uniqid:e,inplace:t})=>{const n=(0,u.GV)((t=>c.x0.selectors.selectWidgetState(t,e)));return(null==n?void 0:n.loading)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}},l().createElement(jl,null)):(null==n?void 0:n.hover)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}}):(null==n||n.initialized,l().createElement(l().Fragment,null))},Tl=a().button`
598
+ `,Wl=d.j.getLazyComponent("DoubleClick"),_l=({uniqid:e,mode:t})=>{const n=(0,u.GV)((t=>t.widgets.ids[e].widget.layers),oe.shallowEqual);return l().createElement(l().Fragment,null,null==n?void 0:n.map(((e,t)=>l().createElement(ql,{uniqid:e,key:t,mode:"edit"}))))},ql=({uniqid:e,mode:t})=>{const n=(0,u.GV)((t=>t.widgets.layers[e]));return"view"===t?l().createElement(Ll,{opacity:1,backgroundColor:"transparent",pointerEvents:"none"},n.widgets.map(((e,t)=>l().createElement(Sl,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"view"})))):l().createElement(Ll,{opacity:n.visible?1:0,backgroundColor:n.visible?"rgba(255,255,255,.1)":"transparent",pointerEvents:n.locked?"none":"all"},n.widgets.map(((e,t)=>l().createElement(Sl,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"edit"}))))},Sl=({uniqid:e,layerId:t,mode:n})=>{const i=(0,u.jL)(),o=(0,u.GV)((t=>t.widgets.ids[e]),oe.shallowEqual),a=(0,u.GV)((e=>e.widgets.layers[t]));return o&&a&&a.position?"view"===n?l().createElement("div",{style:{position:"absolute",top:a.position.y,left:a.position.x}},l().createElement($l,{uniqid:e,widget:o,mode:n,inplace:!0,context:"article"})):l().createElement(jl,{position:{x:a.position.x,y:a.position.y},onMouseUp:e=>{(a.position&&a.position.x!==e.x||a.position&&a.position.y!==e.y)&&(e=>{i(c.x0.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)}},l().createElement(Wl,{onDoubleTap:()=>((e,t)=>{i(c.cr.slice.actions.registerEditor({uniqid:e,name:t}))})(o.widget.uniqid,o.widget.name)},l().createElement($l,{uniqid:e,widget:o,mode:n,inplace:!0,context:"article"}))):l().createElement(l().Fragment,null)},jl=({position:e,children:t,onMouseUp:n})=>{const[o,a]=(0,i.useState)(!1),[r,s]=(0,i.useState)({x:0,y:0}),[c,d]=(0,i.useState)({x:0,y:0}),[u,m]=(0,i.useState)({x:e.x,y:e.y}),g=(0,i.useRef)(null),p=(0,i.useCallback)((e=>{a(!0),g.current&&(s({x:e.nativeEvent.clientX,y:e.nativeEvent.clientY}),d({x:u.x,y:u.y}))}),[u.x,u.y]),f=(0,i.useCallback)((e=>{if(o&&g.current){const t=c.x+(e.clientX-r.x),n=c.y+(e.clientY-r.y);m({x:t,y:n})}}),[r.x,r.y,o,c.x,c.y]),E=(0,i.useCallback)((()=>{a(!1),n({x:u.x,y:u.y})}),[u.x,u.y,n]);return(0,i.useEffect)((()=>(document.addEventListener("mousemove",f),document.addEventListener("mouseup",E),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",E)})),[f,E]),l().createElement("div",{style:{position:"absolute",top:u.y,left:u.x},ref:g,onMouseDown:p},t)},Ml=d.j.getLazyComponent("Loader"),Tl=({uniqid:e,inplace:t})=>{const n=(0,u.GV)((t=>c.x0.selectors.selectWidgetState(t,e)));return(null==n?void 0:n.loading)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}},l().createElement(Ml,null)):(null==n?void 0:n.hover)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}}):(null==n||n.initialized,l().createElement(l().Fragment,null))},Al=a().button`
597
599
  position: absolute;
598
600
  inset: 0;
599
601
  display: flex;
@@ -611,10 +613,10 @@
611
613
  }
612
614
 
613
615
  ${(0,s.DashedFocusBorder)()}
614
- `,Al=({uniqid:e,name:t})=>{const n=(0,u.jL)(),o=(0,r.useIntl)(),a=(0,i.useCallback)((()=>{n(c.cr.slice.actions.flushAllEditor()),n(c.cr.slice.actions.registerEditor({uniqid:e,name:t}))}),[n,e,t]),d=c.x0.definition(t);return l().createElement(Tl,{onClick:a},l().createElement(s.JRCHtml,{__html:`${o.formatMessage({id:"WIDGET_Set_Widget"})} <b>${o.formatMessage({id:d.label})}</b>`}))},Il=a().div`
616
+ `,Il=({uniqid:e,name:t})=>{const n=(0,u.jL)(),o=(0,r.useIntl)(),a=(0,i.useCallback)((()=>{n(c.cr.slice.actions.flushAllEditor()),n(c.cr.slice.actions.registerEditor({uniqid:e,name:t}))}),[n,e,t]),d=c.x0.definition(t);return l().createElement(Al,{onClick:a},l().createElement(s.JRCHtml,{__html:`${o.formatMessage({id:"WIDGET_Set_Widget"})} <b>${o.formatMessage({id:d.label})}</b>`}))},Ol=a().div`
615
617
  display: flex;
616
618
  flex-direction: column;
617
- `,Ol=({uniqid:e,onClick:t,children:n})=>{const a=(0,o.useTheme)(),r=(0,u.GV)((t=>c.x0.selectors.selectWidgetWrapperStyle(t,e)),le.shallowEqual),s=(0,i.useMemo)((()=>({color:r&&r.color?String(r.color):a.color.black,backgroundColor:r&&r["background-color"]?String(r["background-color"]):a.color.white,borderRadius:r&&r["border-radius"]?`${r["border-radius"]}px`:"0px",borderColor:r["border-color"]?String(r["border-color"]):a.color.black,borderWidth:r["border-width"]?`${r["border-width"]}px`:"0px",borderStyle:r["border-style"]?String(r["border-style"]):"none"})),[r,a]);return l().createElement(Il,{onClick:t,style:{color:s.color,borderColor:s.borderColor,borderStyle:s.borderStyle,borderRadius:s.borderRadius,borderWidth:s.borderWidth,backgroundColor:s.backgroundColor,overflow:Number(s.borderRadius)>0?"hidden":"initial"}},n)},zl=d.j.getLazyComponent("WidgetIcon"),Gl=a().a`
619
+ `,zl=({uniqid:e,onClick:t,children:n})=>{const a=(0,o.useTheme)(),r=(0,u.GV)((t=>c.x0.selectors.selectWidgetWrapperStyle(t,e)),oe.shallowEqual),s=(0,i.useMemo)((()=>({color:r&&r.color?String(r.color):a.color.black,backgroundColor:r&&r["background-color"]?String(r["background-color"]):a.color.white,borderRadius:r&&r["border-radius"]?`${r["border-radius"]}px`:"0px",borderColor:r["border-color"]?String(r["border-color"]):a.color.black,borderWidth:r["border-width"]?`${r["border-width"]}px`:"0px",borderStyle:r["border-style"]?String(r["border-style"]):"none"})),[r,a]);return l().createElement(Ol,{onClick:t,style:{color:s.color,borderColor:s.borderColor,borderStyle:s.borderStyle,borderRadius:s.borderRadius,borderWidth:s.borderWidth,backgroundColor:s.backgroundColor,overflow:Number(s.borderRadius)>0?"hidden":"initial"}},n)},Gl=d.j.getLazyComponent("WidgetIcon"),Dl=a().a`
618
620
  position: absolute;
619
621
  top: 0;
620
622
  right: 0;
@@ -630,17 +632,17 @@
630
632
  background-color: rgba(0, 0, 0, 0.1);
631
633
  color: ${e=>e.color?e.color:e.theme.color.black};
632
634
  }
633
- `,Dl=({uniqid:e,name:t,url:n,level:i})=>{var o;const a=c.x0.definition(t),r=(0,u.GV)((t=>2===i?c.x0.selectors.selectWidgetChipCount(t,e):0),le.shallowEqual),s=(0,u.GV)((t=>c.x0.selectors.selectWidgetWrapperStyle(t,e)),le.shallowEqual);return l().createElement(Gl,{href:n,target:"_blank",color:null!==(o=String(s.color))&&void 0!==o?o:void 0,rel:"noreferrer","aria-label":a.label},l().createElement(zl,{count:r,img:a.img,label:a.label,maxValue:999}))},Vl=({uniqid:e,widgetObject:t,widget:n,inplace:o=!0,mode:a,width:r,context:s,onWidgetUpdate:d,cannotDisplayComponent:m,dataCy:g})=>{const p=(0,u.jL)(),f=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e))),E=(0,u.GV)((t=>t.widgets.editableMap[e]),le.shallowEqual),h=(0,u.GV)((e=>e.widgets.currentEditableWidgetId),le.shallowEqual),b=(0,u.GV)((t=>t.widgets.currentEditableWidgetId===e),le.shallowEqual),{isComponentVisible:v,setIsComponentVisible:y}=(0,Mt.xv)(!1);(0,i.useEffect)((()=>{t&&p(c.x0.slice.actions.registerWidgetObject({uniqid:e,object:t}))}),[]),(0,i.useEffect)((()=>{n&&p(c.x0.slice.actions.registerWidget({uniqid:e,widget:n,context:s}))}),[]),(0,i.useEffect)((()=>{v||e===h&&p(c.x0.slice.actions.setEditableWidgetId({uniqid:void 0}))}),[v]),(0,i.useEffect)((()=>{v!==b&&y(b)}),[b]);const C=(0,i.useCallback)((()=>{if(void 0===f||"view"===a)return;p(c.cr.slice.actions.flushAllEditor());const{widget:e}=f;p(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))}),[p,a,f]);return void 0===f?l().createElement(l().Fragment,null,"This widget cannot be displayed"):o&&"view"!==a?l().createElement(Ol,{uniqid:e,onClick:()=>{y(!0),E&&(p(c.x0.slice.actions.setEditableIndex({index:E.index})),p(c.x0.slice.actions.setEditableWidgetId({uniqid:e})))}},l().createElement(wl,{dataCy:g,width:r,widget:Object.assign(Object.assign({},f.widget),f.title&&{title:f.title}),inplace:o,mode:a,levelFallback:(e,t)=>e<=2&&l().createElement(Dl,{uniqid:n.widget.uniqid,name:n.widget.name,level:e,url:t})}),l().createElement(Wl,{uniqid:e,mode:a}),l().createElement(Ml,{name:f.widget.name,uniqid:f.widget.uniqid,inplace:o})):l().createElement(Ol,{uniqid:e,onClick:C},l().createElement(wl,{dataCy:g,widget:Object.assign(Object.assign({},f.widget),f.title&&{title:f.title}),inplace:o,mode:a,width:r,onWidgetUpdate:d,cannotDisplayComponent:m,levelFallback:(e,t)=>e<=2&&l().createElement(Dl,{uniqid:n.widget.uniqid,name:n.widget.name,level:e,url:t})}),l().createElement(Wl,{uniqid:e,mode:a}),"edit"===a&&l().createElement(Al,{uniqid:e,name:n.widget.name}),l().createElement(Ml,{name:f.widget.name,uniqid:f.widget.uniqid,inplace:o}))},Fl=Vl,$l=a().div`
635
+ `,Vl=({uniqid:e,name:t,url:n,level:i})=>{var o;const a=c.x0.definition(t),r=(0,u.GV)((t=>2===i?c.x0.selectors.selectWidgetChipCount(t,e):0),oe.shallowEqual),s=(0,u.GV)((t=>c.x0.selectors.selectWidgetWrapperStyle(t,e)),oe.shallowEqual);return l().createElement(Dl,{href:n,target:"_blank",color:null!==(o=String(s.color))&&void 0!==o?o:void 0,rel:"noreferrer","aria-label":a.label},l().createElement(Gl,{count:r,img:a.img,label:a.label,maxValue:999}))},Fl=({uniqid:e,widgetObject:t,widget:n,inplace:o=!0,mode:a,width:r,context:s,onWidgetUpdate:d,cannotDisplayComponent:m,dataCy:g})=>{const p=(0,u.jL)(),f=(0,u.GV)((t=>c.x0.selectors.selectWidget(t,e))),E=(0,u.GV)((t=>t.widgets.editableMap[e]),oe.shallowEqual),h=(0,u.GV)((e=>e.widgets.currentEditableWidgetId),oe.shallowEqual),b=(0,u.GV)((t=>t.widgets.currentEditableWidgetId===e),oe.shallowEqual),{isComponentVisible:v,setIsComponentVisible:y}=(0,Tt.xv)(!1);(0,i.useEffect)((()=>{t&&p(c.x0.slice.actions.registerWidgetObject({uniqid:e,object:t}))}),[]),(0,i.useEffect)((()=>{n&&p(c.x0.slice.actions.registerWidget({uniqid:e,widget:n,context:s}))}),[]),(0,i.useEffect)((()=>{v||e===h&&p(c.x0.slice.actions.setEditableWidgetId({uniqid:void 0}))}),[v]),(0,i.useEffect)((()=>{v!==b&&y(b)}),[b]);const C=(0,i.useCallback)((()=>{if(void 0===f||"view"===a)return;p(c.cr.slice.actions.flushAllEditor());const{widget:e}=f;p(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))}),[p,a,f]);return void 0===f?l().createElement(l().Fragment,null,"This widget cannot be displayed"):o&&"view"!==a?l().createElement(zl,{uniqid:e,onClick:()=>{y(!0),E&&(p(c.x0.slice.actions.setEditableIndex({index:E.index})),p(c.x0.slice.actions.setEditableWidgetId({uniqid:e})))}},l().createElement(kl,{dataCy:g,width:r,widget:Object.assign(Object.assign({},f.widget),f.title&&{title:f.title}),inplace:o,mode:a,levelFallback:(e,t)=>e<=2&&l().createElement(Vl,{uniqid:n.widget.uniqid,name:n.widget.name,level:e,url:t})}),l().createElement(_l,{uniqid:e,mode:a}),l().createElement(Tl,{name:f.widget.name,uniqid:f.widget.uniqid,inplace:o})):l().createElement(zl,{uniqid:e,onClick:C},l().createElement(kl,{dataCy:g,widget:Object.assign(Object.assign({},f.widget),f.title&&{title:f.title}),inplace:o,mode:a,width:r,onWidgetUpdate:d,cannotDisplayComponent:m,levelFallback:(e,t)=>e<=2&&l().createElement(Vl,{uniqid:n.widget.uniqid,name:n.widget.name,level:e,url:t})}),l().createElement(_l,{uniqid:e,mode:a}),"edit"===a&&l().createElement(Il,{uniqid:e,name:n.widget.name}),l().createElement(Tl,{name:f.widget.name,uniqid:f.widget.uniqid,inplace:o}))},$l=Fl,Rl=a().div`
634
636
  border-radius: ${e=>e.theme.space.sm}px;
635
637
  border: 1px solid ${e=>e.theme.color.grey1};
636
638
  background-color: ${e=>e.theme.color.white};
637
639
  overflow: hidden;
638
- `,Rl=d.j.getLazyComponent("Message"),Bl=({widgets:e})=>{const t=(0,r.useIntl)(),n=(0,u.GV)(c.x0.selectors.selectFlushedWidgets,le.shallowEqual);return l().createElement(l().Fragment,null,e.filter((e=>!n.includes(e.widget.uniqid))).map((e=>e&&e.widget&&l().createElement($l,{key:e.widget.uniqid},l().createElement(Fl,{uniqid:e.widget.uniqid,widget:e,inplace:!0,mode:"edit",cannotDisplayComponent:e=>l().createElement(Rl,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})}),context:"comment"})))))},Hl=d.j.getLazyComponent("Message"),Pl=e=>{const t=(0,r.useIntl)(),{widgets:n,comment:i,inplace:o,mode:a,handleWidgetUpdate:s}=e,d=(0,u.GV)(c.x0.selectors.selectFlushedWidgets,le.shallowEqual);return l().createElement(l().Fragment,null,n.filter((e=>!d.includes(e.widget.uniqid))).map((e=>e&&l().createElement($l,{key:e.widget.uniqid},l().createElement(Fl,{uniqid:e.widget.uniqid,widgetObject:i,widget:e,inplace:o,mode:a,onWidgetUpdate:s,cannotDisplayComponent:e=>l().createElement(Hl,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})}),context:"comment"})))))};var Ul=function(e,t,n,i){return new(n||(n=Promise))((function(l,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function r(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?l(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}s((i=i.apply(e,t||[])).next())}))};const Nl=d.j.getLazyComponent("JRCCommentsBloc"),Yl=a().div`
640
+ `,Bl=d.j.getLazyComponent("Message"),Hl=({widgets:e})=>{const t=(0,r.useIntl)(),n=(0,u.GV)(c.x0.selectors.selectFlushedWidgets,oe.shallowEqual);return l().createElement(l().Fragment,null,e.filter((e=>!n.includes(e.widget.uniqid))).map((e=>e&&e.widget&&l().createElement(Rl,{key:e.widget.uniqid},l().createElement($l,{uniqid:e.widget.uniqid,widget:e,inplace:!0,mode:"edit",cannotDisplayComponent:e=>l().createElement(Bl,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})}),context:"comment"})))))},Pl=d.j.getLazyComponent("Message"),Ul=e=>{const t=(0,r.useIntl)(),{widgets:n,comment:i,inplace:o,mode:a,handleWidgetUpdate:s}=e,d=(0,u.GV)(c.x0.selectors.selectFlushedWidgets,oe.shallowEqual);return l().createElement(l().Fragment,null,n.filter((e=>!d.includes(e.widget.uniqid))).map((e=>e&&l().createElement(Rl,{key:e.widget.uniqid},l().createElement($l,{uniqid:e.widget.uniqid,widgetObject:i,widget:e,inplace:o,mode:a,onWidgetUpdate:s,cannotDisplayComponent:e=>l().createElement(Pl,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})}),context:"comment"})))))};var Nl=function(e,t,n,i){return new(n||(n=Promise))((function(l,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function r(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?l(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}s((i=i.apply(e,t||[])).next())}))};const Yl=d.j.getLazyComponent("JRCCommentsBloc"),Jl=a().div`
639
641
  display: flex;
640
642
  flex-direction: column;
641
643
  gap: 4px;
642
644
  flex: 1;
643
645
  width: 100%;
644
646
  margin-top: 10px;
645
- `,Jl=({articleId:e,variant:t="inline",canComment:n,commentType:a="comment",socialQuestion:s,articleUri:d})=>{var m,g;const p=(0,r.useIntl)(),f=(0,o.useTheme)(),E=(0,u.jL)(),[h,b]=(0,i.useState)(),[v,y]=(0,i.useState)(!1),[C,x]=(0,i.useState)([]),[w,L]=(0,i.useState)(!1),W=(0,u.GV)(c.xJ.selectors.get),_=(0,u.GV)(c.x0.selectors.selectWidgets),q=(0,u.GV)(c.sU.selectors.selectTinyMCECommonOptions),S=(0,u.GV)(c.sU.selectors.selectTinyMCEExtendedOptions),j=(0,u.GV)(c.Kx.selectors.selectAll),M=(0,u.GV)(c.OD.selectors.selectPlatformConfig),T=(0,u.GV)((t=>c.Mw.selectors.commentList(t,e))),A=(0,u.GV)((e=>c.qn.selectors.selectHook(e,"DriveHook"))),I=(0,u.GV)((e=>c.lg.selectors.selectById(e,"FileBankHook"))),O=(0,u.GV)((e=>c.qn.selectors.selectHook(e,"WidgetHook"))),[z,G]=(0,i.useState)(s),[D,V]=(0,i.useState)(null),{open:F,onInsert:$,close:R,ext:B,isActive:H}=St();(0,ee.A)(e),((e,t)=>{const n=(0,u.jL)(),l=(0,i.useMemo)((()=>te.A),[]),o=(0,i.useMemo)((()=>c.Mw.getCommentsLikeRTHandlers(n,e,t)),[n,e,t]);(0,i.useEffect)((()=>(o.forEach((e=>{l.onMessage(e.namespace,e.function,e.handler)})),()=>{o.forEach((e=>{l.offMessage(e.namespace,e.function,e.handler)}))})),[o,l])})(T.map((e=>e.id)),e);const P=(0,i.useCallback)((e=>{E(c.y8.actions.error({label:null!=e?e:p.formatMessage({id:"GLOBAL_Error"})}))}),[E,p]),U=()=>{E(c.Mw.actions.fetchComments({idArticle:e})),N()},N=(0,i.useCallback)((()=>{h||w||(L(!0),k().network.token().then((e=>{b(e.result),L(!1),E(c.x0.slice.actions.setToken({token:e.result}))})).catch((e=>{P(e.errorMsg)})))}),[P,h,w,E]),Y=(0,i.useCallback)((t=>Ul(void 0,void 0,void 0,(function*(){if(h){y(!0);const n=Object.keys(_).map((e=>(null==C?void 0:C.some((t=>t.widget.uniqid===e)))?_[e]:null)).filter((e=>null!==e));try{yield k().article.addComment(Object.assign(Object.assign({},t),{widgets:n,token:h,idArticle:e,type:a})).then((()=>{x([])})),N()}catch(e){throw P(e.errorMsg),e}finally{y(!1)}}}))),[e,a,N,P,h,_,C]);return(0,i.useEffect)((()=>{N()}),[N]),(0,i.useEffect)((()=>{E(c.Mw.actions.fetchComments({idArticle:e}))}),[e,E]),(0,i.useEffect)((()=>{T&&T.forEach((e=>{var t;null===(t=e._widgets)||void 0===t||t.forEach((t=>{E(c.x0.slice.actions.registerWidgetObject({uniqid:t.widget.uniqid,object:e})),E(c.x0.slice.actions.registerWidgetObjectRights({uniqid:t.widget.uniqid,rights:e._right}))}))}))}),[T,E]),l().createElement(l().Fragment,null,q&&S&&l().createElement(l().Fragment,null,l().createElement(Yl,null,l().createElement(Nl,{canComment:n,loading:v,token:h,comments:T,onComment:Y,onCommentUpdate:t=>Ul(void 0,void 0,void 0,(function*(){var n,i;const l=T.find((e=>e.id===t.idComment));if(l)return k().article.updateComment({idComment:t.idComment,description:null!==(i=null!==(n=t.description)&&void 0!==n?n:l.description)&&void 0!==i?i:void 0,token:t.token,widgets:t.widgets}).then((()=>{E(c.Mw.actions.fetchComments({idArticle:e})),N()})).catch((e=>{P(e.errorMsg)}))})),onCommentDelete:t=>Ul(void 0,void 0,void 0,(function*(){E(c.Mw.actions.deleteComment({idComment:t,idArticle:e}))})),isWidgetActive:!(!(null==O?void 0:O.isActive)||!(null===(m=null==O?void 0:O.autorize)||void 0===m?void 0:m.includes("comment"))),canCreateWidget:!!((null==O?void 0:O.isActive)&&(null==O?void 0:O.create)&&(null===(g=null==O?void 0:O.autorize)||void 0===g?void 0:g.includes("comment"))),widgetListComponent:l().createElement(Wt,{mode:"comment",namespace:"comment",onChange:e=>{x([e]),E(c.x0.slice.actions.registerWidget({uniqid:e.widget.uniqid,widget:e,context:"comment"})),b(void 0),N()},view:"edit"}),newWidgetsWrapperComponent:l().createElement(Bl,{widgets:C}),existingWidgetsWrapperComponent:(e,t,n,i=!0)=>l().createElement(Pl,{comment:e,widgets:t,mode:n,inplace:i,handleWidgetUpdate:U,handleWidgetRemove:N}),currentUser:W,tinyMCEConfig:{commonOptions:Object.assign(Object.assign({},q),{toolbar:S.commentsToolbar}),mentionsQueries:(0,jt.X)(j,f,P)},onError:P,highlightFields:M.userHighlightFields,userAccountStatus:M.userAccountStatus,userModel:j.find((e=>"user"===e.type)),onGetHashError:e=>E(c.y8.actions.error({label:null!=e?e:p.formatMessage({id:"GLOBAL_Error"})})),activeDrives:[...I&&A?["fileBank"]:[],...c.qn.utils.buildDrivesArrayFromObject(null==A?void 0:A.drives)],variant:t,handlers:{drive:k().drive,filebank:k().filebank,file:k().file,user:k().user,global:k().global,questionAnswer:k().questionAnswer},socialQuestion:z?Object.assign(Object.assign({},z),{onSelectResponse:e=>{G(Object.assign(Object.assign({},z),{responseId:e,isResolved:!0}))},onUnselectResponse:()=>{G(Object.assign(Object.assign({},z),{responseId:void 0,isResolved:!1}))}}):void 0,articleId:e,additionalExtensions:[B],onReport:t=>V({articleId:e,commentUri:t,articleUri:d})}),l().createElement(gt,null))),H&&l().createElement(jn,{onInsert:$,open:F,close:R}),D&&l().createElement(Z,Object.assign({onClose:()=>V(null)},D)))},Ql=()=>l().createElement(l().Fragment,null);var Xl=n(737);const Kl=d.j.getLazyComponent("Container"),Zl=()=>l().createElement(i.Suspense,{fallback:l().createElement(l().Fragment,null)},l().createElement(Kl,{backgroundColor:"white",mode:"fluid",flexDirection:"column"},l().createElement(Xl.Outlet,null)));var eo=n(286);const to=()=>{const[e,t]=(0,i.useState)(),n=(0,r.useIntl)(),l=(0,i.useMemo)((()=>{var e,t,n,i;return(null===(t=null===(e=J.hooks)||void 0===e?void 0:e.MagicWandHook)||void 0===t?void 0:t.isActive)&&(null===(i=null===(n=J.hooks)||void 0===n?void 0:n.MagicWandHook)||void 0===i?void 0:i.menuItems)&&J.hooks.MagicWandHook.menuItems.length}),[]),o=(0,i.useCallback)((e=>{t(Object.assign(Object.assign({},e),{reject:n=>{e.reject(n),t(void 0)},resolve:n=>{e.resolve(n),t(void 0)}}))}),[]),a=(0,i.useCallback)(((e,t)=>new Promise(((n,i)=>{o({reject:i,resolve:n,text:e,capability:t})}))),[o]),c=(0,i.useMemo)((()=>({develop:e=>a(e,"develop"),summarize:e=>a(e,"summarize"),tldr:e=>a(e,"tldr"),en:e=>a(e,"en"),es:e=>a(e,"es"),formal:e=>a(e,"formal"),funny:e=>a(e,"funny")})),[a]);return{query:e,ext:(0,i.useMemo)((()=>s.JTinyMCEExtensionsBuilders.jia(c,n)),[n,c]),isActive:l}},no=d.j.getLazyComponent("InputTinyMCE"),io=e=>{const t=(0,r.useIntl)(),n=(0,u.jL)(),a=(0,o.useTheme)(),s=(0,u.GV)(c.Kx.selectors.selectAll),{query:d,ext:m,isActive:g}=to(),{open:p,onInsert:f,close:E,ext:h,isActive:b}=St(),v=(0,i.useMemo)((()=>[...b?[h]:[],...g?[m]:[]]),[m,h,g,b]),y=(0,i.useCallback)((e=>{n(c.y8.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[n,t]),C=(0,i.useMemo)((()=>(0,jt.X)(s,a,y)),[s,y,a]),x=(0,i.useMemo)((()=>eo.p9),[]);return l().createElement(l().Fragment,null,x&&l().createElement(no,Object.assign({commonOptions:x,additionalExtensions:v,mentionsQueries:C},e)),g&&l().createElement(M,{query:d}),b&&l().createElement(jn,{onInsert:f,open:p,close:E}))},lo=d.j.getLazyComponent("InputTinyMCERaw"),oo=e=>{const t=(0,r.useIntl)(),n=(0,u.jL)(),a=(0,o.useTheme)(),s=(0,u.GV)(c.Kx.selectors.selectAll),{query:d,ext:m,isActive:g}=to(),{open:p,onInsert:f,close:E,ext:h,isActive:b}=St(),v=(0,i.useMemo)((()=>[...b?[h]:[],...g?[m]:[]]),[m,h,g,b]),y=(0,i.useCallback)((e=>{n(c.y8.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[n,t]),C=(0,i.useMemo)((()=>(0,jt.X)(s,a,y)),[s,y,a]),x=(0,i.useMemo)((()=>eo.p9),[]);return l().createElement(l().Fragment,null,x&&l().createElement(lo,Object.assign({commonOptions:x,additionalExtensions:v,mentionsQueries:C},e)),g&&l().createElement(M,{query:d}),b&&l().createElement(jn,{onInsert:f,open:p,close:E}))},ao=d.j.getLazyComponent("InputAudience"),ro=d.j.getLazyComponent("Message"),so=d.j.getLazyComponent("Modal"),co=({open:e,closeHandler:t,title:n,control:i,warningMessage:o,onSubmit:a,name:s="publishTo"})=>{const c=(0,r.useIntl)();return l().createElement(so,{open:e,closeHandler:t,title:null!=n?n:c.formatMessage({id:"GLOBAL_Audience"}),buttons:[{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:()=>t()},{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Continue"}),color:"danger",clickHandler:()=>{t(),a()}}]},l().createElement(ro,{variant:"warning",message:null!=o?o:c.formatMessage({id:"FORM_Audience_Empty"})}),l().createElement(ao,{asyncPromise:e=>k().audience.autocomplete(e),searchable:!0,control:i,multiple:!0,placeholder:c.formatMessage({id:"GLOBAL_Audience"}),name:s}))},uo=d.j.getLazyComponent("Container"),mo=d.j.getLazyComponent("AppColumn"),go=d.j.getLazyComponent("MainColumn");function po({extensionRoute:e,routes:t,description:n,mode:o="center",mainColumnProps:a}){var s;const c=(0,r.useIntl)(),{pathname:d}=(0,Xl.useLocation)(),u=(0,i.useMemo)((()=>Object.values(t)),[t]),[m,g]=(0,i.useState)(null===(s=null==u?void 0:u[0])||void 0===s?void 0:s.key),p=u.map((t=>Object.assign(Object.assign({},t),{label:c.formatMessage({id:t.label}),href:t.absolutePath?t.path:`/ng/rr/${e}/${t.path}`,group:t.group?c.formatMessage({id:t.group}):void 0})));return(0,i.useEffect)((()=>{const t=u.find((t=>{var n;return`/ng/rr/${e}/${t.path}`===d||(null===(n=t.paths)||void 0===n?void 0:n.reduce(((t,n)=>{const i=`/ng/rr/${e}/${n}`,l=null!==(0,Xl.matchPath)(i,d);return t||l}),!1))}));t&&g(t.key)}),[d,u,e]),l().createElement(i.Suspense,{fallback:l().createElement(l().Fragment,null)},l().createElement(uo,{mode:o},l().createElement(mo,{mode:o,description:n,tabs:p,activeTab:m||""}),l().createElement(go,Object.assign({mode:o,flex:!0},a),l().createElement(Xl.Outlet,null))))}}}]);
646
- //# sourceMappingURL=199.a6f9afd0ce446f0d2b89.chunk.js.map
647
+ `,Ql=({articleId:e,variant:t="inline",canComment:n,commentType:a="comment",socialQuestion:s,articleUri:d})=>{var m,g;const p=(0,r.useIntl)(),f=(0,o.useTheme)(),E=(0,u.jL)(),[h,b]=(0,i.useState)(),[v,y]=(0,i.useState)(!1),[C,x]=(0,i.useState)([]),[w,k]=(0,i.useState)(!1),W=(0,u.GV)(c.xJ.selectors.get),_=(0,u.GV)(c.x0.selectors.selectWidgets),q=(0,u.GV)(c.sU.selectors.selectTinyMCECommonOptions),S=(0,u.GV)(c.sU.selectors.selectTinyMCEExtendedOptions),j=(0,u.GV)(c.Kx.selectors.selectAll),M=(0,u.GV)(c.OD.selectors.selectPlatformConfig),T=(0,u.GV)((t=>c.Mw.selectors.commentList(t,e))),A=(0,u.GV)((e=>c.qn.selectors.selectHook(e,"DriveHook"))),I=(0,u.GV)((e=>c.lg.selectors.selectById(e,"FileBankHook"))),O=(0,u.GV)((e=>c.qn.selectors.selectHook(e,"WidgetHook"))),[z,G]=(0,i.useState)(s),[D,V]=(0,i.useState)(null),{open:F,onInsert:$,close:R,ext:B,isActive:H}=jt();(0,te.A)(e),((e,t)=>{const n=(0,u.jL)(),l=(0,i.useMemo)((()=>ne.A),[]),o=(0,i.useMemo)((()=>c.Mw.getCommentsLikeRTHandlers(n,e,t)),[n,e,t]);(0,i.useEffect)((()=>(o.forEach((e=>{l.onMessage(e.namespace,e.function,e.handler)})),()=>{o.forEach((e=>{l.offMessage(e.namespace,e.function,e.handler)}))})),[o,l])})(T.map((e=>e.id)),e);const P=(0,i.useCallback)((e=>{E(c.y8.actions.error({label:null!=e?e:p.formatMessage({id:"GLOBAL_Error"})}))}),[E,p]),U=()=>{E(c.Mw.actions.fetchComments({idArticle:e})),N()},N=(0,i.useCallback)((()=>{h||w||(k(!0),L().network.token().then((e=>{b(e.result),k(!1),E(c.x0.slice.actions.setToken({token:e.result}))})).catch((e=>{P(e.errorMsg)})))}),[P,h,w,E]),Y=(0,i.useCallback)((t=>Nl(void 0,void 0,void 0,(function*(){if(h){y(!0);const n=Object.keys(_).map((e=>(null==C?void 0:C.some((t=>t.widget.uniqid===e)))?_[e]:null)).filter((e=>null!==e));try{yield L().article.addComment(Object.assign(Object.assign({},t),{widgets:n,token:h,idArticle:e,type:a})).then((()=>{x([])})),N()}catch(e){throw P(e.errorMsg),e}finally{y(!1)}}}))),[e,a,N,P,h,_,C]);return(0,i.useEffect)((()=>{N()}),[N]),(0,i.useEffect)((()=>{E(c.Mw.actions.fetchComments({idArticle:e}))}),[e,E]),(0,i.useEffect)((()=>{T&&T.forEach((e=>{var t;null===(t=e._widgets)||void 0===t||t.forEach((t=>{E(c.x0.slice.actions.registerWidgetObject({uniqid:t.widget.uniqid,object:e})),E(c.x0.slice.actions.registerWidgetObjectRights({uniqid:t.widget.uniqid,rights:e._right}))}))}))}),[T,E]),l().createElement(l().Fragment,null,q&&S&&l().createElement(l().Fragment,null,l().createElement(Jl,null,l().createElement(Yl,{canComment:n,loading:v,token:h,comments:T,onComment:Y,onCommentUpdate:t=>Nl(void 0,void 0,void 0,(function*(){var n,i;const l=T.find((e=>e.id===t.idComment));if(l)return L().article.updateComment({idComment:t.idComment,description:null!==(i=null!==(n=t.description)&&void 0!==n?n:l.description)&&void 0!==i?i:void 0,token:t.token,widgets:t.widgets}).then((()=>{E(c.Mw.actions.fetchComments({idArticle:e})),N()})).catch((e=>{P(e.errorMsg)}))})),onCommentDelete:t=>Nl(void 0,void 0,void 0,(function*(){E(c.Mw.actions.deleteComment({idComment:t,idArticle:e}))})),isWidgetActive:!(!(null==O?void 0:O.isActive)||!(null===(m=null==O?void 0:O.autorize)||void 0===m?void 0:m.includes("comment"))),canCreateWidget:!!((null==O?void 0:O.isActive)&&(null==O?void 0:O.create)&&(null===(g=null==O?void 0:O.autorize)||void 0===g?void 0:g.includes("comment"))),widgetListComponent:l().createElement(_t,{mode:"comment",namespace:"comment",onChange:e=>{x([e]),E(c.x0.slice.actions.registerWidget({uniqid:e.widget.uniqid,widget:e,context:"comment"})),b(void 0),N()},view:"edit"}),newWidgetsWrapperComponent:l().createElement(Hl,{widgets:C}),existingWidgetsWrapperComponent:(e,t,n,i=!0)=>l().createElement(Ul,{comment:e,widgets:t,mode:n,inplace:i,handleWidgetUpdate:U,handleWidgetRemove:N}),currentUser:W,tinyMCEConfig:{commonOptions:Object.assign(Object.assign({},q),{toolbar:S.commentsToolbar}),mentionsQueries:(0,Mt.X)(j,f,P)},onError:P,highlightFields:M.userHighlightFields,userAccountStatus:M.userAccountStatus,userModel:j.find((e=>"user"===e.type)),onGetHashError:e=>E(c.y8.actions.error({label:null!=e?e:p.formatMessage({id:"GLOBAL_Error"})})),activeDrives:[...I&&A?["fileBank"]:[],...c.qn.utils.buildDrivesArrayFromObject(null==A?void 0:A.drives)],variant:t,handlers:{drive:L().drive,filebank:L().filebank,file:L().file,user:L().user,global:L().global,questionAnswer:L().questionAnswer},socialQuestion:z?Object.assign(Object.assign({},z),{onSelectResponse:e=>{G(Object.assign(Object.assign({},z),{responseId:e,isResolved:!0}))},onUnselectResponse:()=>{G(Object.assign(Object.assign({},z),{responseId:void 0,isResolved:!1}))}}):void 0,articleId:e,additionalExtensions:[B],onReport:t=>V({articleId:e,commentUri:t,articleUri:d})}),l().createElement(pt,null))),H&&l().createElement(Mn,{onInsert:$,open:F,close:R}),D&&l().createElement(ee,Object.assign({onClose:()=>V(null)},D)))},Kl=()=>l().createElement(l().Fragment,null);var Xl=n(737);const Zl=d.j.getLazyComponent("Container"),eo=()=>l().createElement(i.Suspense,{fallback:l().createElement(l().Fragment,null)},l().createElement(Zl,{backgroundColor:"white",mode:"fluid",flexDirection:"column"},l().createElement(Xl.Outlet,null)));var to=n(286);const no=()=>{const[e,t]=(0,i.useState)(),n=(0,r.useIntl)(),l=(0,i.useMemo)((()=>{var e,t,n,i;return(null===(t=null===(e=J.hooks)||void 0===e?void 0:e.MagicWandHook)||void 0===t?void 0:t.isActive)&&(null===(i=null===(n=J.hooks)||void 0===n?void 0:n.MagicWandHook)||void 0===i?void 0:i.menuItems)&&J.hooks.MagicWandHook.menuItems.length}),[]),o=(0,i.useCallback)((e=>{t(Object.assign(Object.assign({},e),{reject:n=>{e.reject(n),t(void 0)},resolve:n=>{e.resolve(n),t(void 0)}}))}),[]),a=(0,i.useCallback)(((e,t)=>new Promise(((n,i)=>{o({reject:i,resolve:n,text:e,capability:t})}))),[o]),c=(0,i.useMemo)((()=>({develop:e=>a(e,"develop"),summarize:e=>a(e,"summarize"),tldr:e=>a(e,"tldr"),en:e=>a(e,"en"),es:e=>a(e,"es"),formal:e=>a(e,"formal"),funny:e=>a(e,"funny")})),[a]);return{query:e,ext:(0,i.useMemo)((()=>s.JTinyMCEExtensionsBuilders.jia(c,n)),[n,c]),isActive:l}},io=d.j.getLazyComponent("InputTinyMCE"),lo=e=>{const t=(0,r.useIntl)(),n=(0,u.jL)(),a=(0,o.useTheme)(),s=(0,u.GV)(c.Kx.selectors.selectAll),{query:d,ext:m,isActive:g}=no(),{open:p,onInsert:f,close:E,ext:h,isActive:b}=jt(),v=(0,i.useMemo)((()=>[...b?[h]:[],...g?[m]:[]]),[m,h,g,b]),y=(0,i.useCallback)((e=>{n(c.y8.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[n,t]),C=(0,i.useMemo)((()=>(0,Mt.X)(s,a,y)),[s,y,a]),x=(0,i.useMemo)((()=>to.p9),[]);return l().createElement(l().Fragment,null,x&&l().createElement(io,Object.assign({commonOptions:x,additionalExtensions:v,mentionsQueries:C},e)),g&&l().createElement(T,{query:d}),b&&l().createElement(Mn,{onInsert:f,open:p,close:E}))},oo=d.j.getLazyComponent("InputTinyMCERaw"),ao=e=>{const t=(0,r.useIntl)(),n=(0,u.jL)(),a=(0,o.useTheme)(),s=(0,u.GV)(c.Kx.selectors.selectAll),{query:d,ext:m,isActive:g}=no(),{open:p,onInsert:f,close:E,ext:h,isActive:b}=jt(),v=(0,i.useMemo)((()=>[...b?[h]:[],...g?[m]:[]]),[m,h,g,b]),y=(0,i.useCallback)((e=>{n(c.y8.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[n,t]),C=(0,i.useMemo)((()=>(0,Mt.X)(s,a,y)),[s,y,a]),x=(0,i.useMemo)((()=>to.p9),[]);return l().createElement(l().Fragment,null,x&&l().createElement(oo,Object.assign({commonOptions:x,additionalExtensions:v,mentionsQueries:C},e)),g&&l().createElement(T,{query:d}),b&&l().createElement(Mn,{onInsert:f,open:p,close:E}))},ro=d.j.getLazyComponent("InputAudience"),so=d.j.getLazyComponent("Message"),co=d.j.getLazyComponent("Modal"),uo=({open:e,closeHandler:t,title:n,control:i,warningMessage:o,onSubmit:a,name:s="publishTo"})=>{const c=(0,r.useIntl)();return l().createElement(co,{open:e,closeHandler:t,title:null!=n?n:c.formatMessage({id:"GLOBAL_Audience"}),buttons:[{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:()=>t()},{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Continue"}),color:"danger",clickHandler:()=>{t(),a()}}]},l().createElement(so,{variant:"warning",message:null!=o?o:c.formatMessage({id:"FORM_Audience_Empty"})}),l().createElement(ro,{asyncPromise:e=>L().audience.autocomplete(e),searchable:!0,control:i,multiple:!0,placeholder:c.formatMessage({id:"GLOBAL_Audience"}),name:s}))},mo=d.j.getLazyComponent("Container"),go=d.j.getLazyComponent("AppColumn"),po=d.j.getLazyComponent("MainColumn");function fo({extensionRoute:e,routes:t,description:n,mode:o="center",mainColumnProps:a}){var s;const c=(0,r.useIntl)(),{pathname:d}=(0,Xl.useLocation)(),u=(0,i.useMemo)((()=>Object.values(t)),[t]),[m,g]=(0,i.useState)(null===(s=null==u?void 0:u[0])||void 0===s?void 0:s.key),p=u.map((t=>Object.assign(Object.assign({},t),{label:c.formatMessage({id:t.label}),href:t.absolutePath?t.path:`/ng/rr/${e}/${t.path}`,group:t.group?c.formatMessage({id:t.group}):void 0})));return(0,i.useEffect)((()=>{const t=u.find((t=>{var n;return`/ng/rr/${e}/${t.path}`===d||(null===(n=t.paths)||void 0===n?void 0:n.reduce(((t,n)=>{const i=`/ng/rr/${e}/${n}`,l=null!==(0,Xl.matchPath)(i,d);return t||l}),!1))}));t&&g(t.key)}),[d,u,e]),l().createElement(i.Suspense,{fallback:l().createElement(l().Fragment,null)},l().createElement(mo,{mode:o},l().createElement(go,{mode:o,description:n,tabs:p,activeTab:m||""}),l().createElement(po,Object.assign({mode:o,flex:!0},a),l().createElement(Xl.Outlet,null))))}}}]);
648
+ //# sourceMappingURL=199.03f2527ea54b5c4f17be.chunk.js.map