VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /opt/mattermost/client/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/mattermost/client/4377.469067183c098bc3d0d4.js
"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[4377],{11284:(e,t,n)=>{n.d(t,{A:()=>E});var a=n(62688),o=n.n(a),s=(n(76685),n(17046),n(3188),n(59297),n(97023)),i=n.n(s),l=n(14778),r=n(23453),c=n(14776),d=n(98566),u=n(71633),p=n.n(u),m=n(87131),h=n(63155);function f(e){let{base:t,path:n,pathInfo:a,limit:o,maxLength:r,shortenLength:c,error:u,className:f,onChange:_,onBlur:g}=e;const{formatMessage:N}=(0,l.useIntl)(),[C,E]=(0,s.useState)(!1);(0,s.useEffect)((()=>{u&&E(!0)}),[u]);const b="".concat(t,"/").concat(n?"".concat(n,"/"):""),v="".concat(b).concat(C?"":a),k=c&&v.length>c,y=Boolean(u),M=i().createElement("span",{className:"url-input-label","data-testid":"urlInputLabel"},N({id:"url_input.label.url",defaultMessage:"URL: "}),k?(0,h.S3)(v,c):v);return i().createElement("div",{className:p()("url-input-main",f)},i().createElement("div",{className:"url-input-container"},k?i().createElement(m.A,{title:v},M):M,(C||y)&&i().createElement(d.A,{"data-testid":"channelURLInput",name:"url-input",type:"text",containerClassName:"url-input-editable-container",wrapperClassName:"url-input-editable-wrapper",inputClassName:"url-input-editable-path",autoFocus:!0,autoComplete:"off",value:a,limit:o,maxLength:r,hasError:y,onChange:e=>{e.preventDefault(),_&&_(e)},onBlur:e=>{e.preventDefault(),E(y),g&&g(e)}}),i().createElement("button",{className:p()("url-input-button",{disabled:y}),disabled:y,onClick:()=>{y||E(!C)}},i().createElement("span",{className:"url-input-button-label"},N(C?{id:"url_input.buttonLabel.done",defaultMessage:"Done"}:{id:"url_input.buttonLabel.edit",defaultMessage:"Edit"})))),u&&i().createElement("div",{className:"url-input-error"},i().createElement("i",{className:"icon icon-alert-outline"}),i().createElement("span",null,u)))}f.propTypes={base:o().string.isRequired,path:o().string,pathInfo:o().string.isRequired,limit:o().number,maxLength:o().number,shortenLength:o().number,error:o().string,className:o().string,onChange:o().func,onBlur:o().func};const _=f;var g=n(78451),N=n(85873);const C=e=>{var t;const n=(0,l.useIntl)(),{formatMessage:a}=n,o=(0,s.useRef)(!1),[u,p]=(0,s.useState)(""),m=(0,s.useRef)(""),f=(0,s.useRef)(!1),[C,E]=(0,s.useState)(""),[b,v]=(0,s.useState)(""),[k,y]=(0,s.useState)(null),M=null===(t=(0,r.useSelector)(c.H7))||void 0===t?void 0:t.name,D=e.team?e.team.name:M,T=(0,s.useCallback)((t=>{t.preventDefault();const{target:{value:a}}=t,o=function(e,t){const n=[],a=t.trim();return a.length<g.Ay.MIN_CHANNELNAME_LENGTH&&n.push(e.formatMessage({id:"channel_modal.name.longer",defaultMessage:"Channel names must have at least 2 characters."})),a.length>g.Ay.MAX_CHANNELNAME_LENGTH&&n.push(e.formatMessage({id:"channel_modal.name.shorter",defaultMessage:"Channel names must have maximum 64 characters."})),n}(n,a);if(p(o.length?o[o.length-1]:""),m.current=a,e.onDisplayNameChange(a),!f.current){const t=(0,h.aM)(a);E(t),v(""),e.onURLChange(t)}}),[e.onDisplayNameChange,e.onURLChange]),A=(0,s.useCallback)((()=>{if(m.current&&!C){const t=(0,N.z9)();E(t),e.onURLChange(t)}o.current||(o.current=!0,y(null))}),[e.onURLChange,m.current,C,o]),L=(0,s.useCallback)((t=>{t.preventDefault();const{target:{value:a}}=t,o=a.toLowerCase().replace(/\s/g,"-"),s=(0,h.B5)(o,n);v(s.length?s[s.length-1]:""),E(o),f.current=!0,e.onURLChange(o)}),[e.onURLChange]);return(0,s.useEffect)((()=>{e.onErrorStateChange&&e.onErrorStateChange(Boolean(u)||Boolean(b))}),[u,b]),i().createElement(i().Fragment,null,i().createElement(d.A,{type:"text",autoComplete:"off",autoFocus:!1!==e.autoFocus,required:!0,name:e.name,containerClassName:"".concat(e.name,"-container"),inputClassName:"".concat(e.name,"-input channel-name-input-field"),label:a({id:"channel_modal.name.label",defaultMessage:"Channel name"}),placeholder:e.placeholder,limit:g.Ay.MAX_CHANNELNAME_LENGTH,value:e.value,customMessage:k,onChange:T,onBlur:A}),i().createElement(_,{className:"new-channel-modal__url",base:(0,h.vV)(),path:"".concat(D,"/channels"),pathInfo:C,limit:g.Ay.MAX_CHANNELNAME_LENGTH,shortenLength:g.Ay.DEFAULT_CHANNELURL_SHORTEN_LENGTH,error:b||e.urlError,onChange:L}))};C.propTypes={value:o().string.isRequired,name:o().string.isRequired,placeholder:o().string.isRequired,onDisplayNameChange:o().func.isRequired,onURLChange:o().func.isRequired,autoFocus:o().bool,onErrorStateChange:o().func,urlError:o().string};const E=C},64109:(e,t,n)=>{n.d(t,{A:()=>H});var a=n(23453),o=n(52602),s=n(30413),i=n(65952),l=n(26614),r=n(77440),c=n(62688),d=n.n(c),u=(n(17046),n(4290),n(97023)),p=n.n(u),m=n(34529),h=n(14778),f=n(85406),_=n(44553),g=n(66549),N=n(6251),C=n(8589);function E(e){let{title:t,description:n,containerClassName:a,descriptionAboveContent:o=!1,checkboxFieldTitle:s,checkboxFieldData:i,checkboxFieldValue:l,handleCheckboxChange:r,selectFieldData:c,selectFieldValue:d,handleSelectChange:u,isSelectDisabled:m,selectPlaceholder:h}=e;const f=p().createElement(p().Fragment,null,p().createElement("fieldset",{key:i.name,className:"mm-modal-generic-section-item__fieldset-checkbox-ctr"},p().createElement("label",{className:"mm-modal-generic-section-item__fieldset-checkbox"},p().createElement("input",{className:"mm-modal-generic-section-item__input-checkbox","data-testid":i.dataTestId,type:"checkbox",name:i.name,checked:l,onChange:e=>r(e.target.checked)}),s)),p().createElement("fieldset",{className:"mm-modal-generic-section-item__fieldset-react-select"},p().createElement(N.Ay,{id:c.id,inputId:c.inputId,"aria-labelledby":c.ariaLabelledby,className:"react-select singleSelect react-select-top",classNamePrefix:"react-select",options:c.options,clearable:c.clearable,isClearable:c.clearable,isDisabled:m,isSearchable:!1,placeholder:h,onChange:e=>u(e),value:d,components:{IndicatorSeparator:b}})));return p().createElement(C.A,{title:t,content:f,isContentInline:!0,description:n,className:a,descriptionAboveContent:o})}function b(){return null}function v(e){let{id:t,title:n,subtitle:a,handleClose:o}=e;return p().createElement("header",{className:"mm-modal-header"},p().createElement("h1",{id:"mm-modal-header-".concat(t),className:"mm-modal-header__title",tabIndex:0},n),p().createElement("div",{className:"mm-modal-header__vertical-divider"}),p().createElement("p",{className:"mm-modal-header__subtitle"},a),p().createElement("div",{className:"mm-modal-header__ctr",onClick:o},p().createElement("button",{className:"btn btn-icon"},p().createElement("i",{className:"icon icon-close"}))))}E.propTypes={containerClassName:d().string,descriptionAboveContent:d().bool,checkboxFieldTitle:d().node.isRequired,checkboxFieldValue:d().bool.isRequired,handleCheckboxChange:d().func.isRequired,handleSelectChange:d().func.isRequired,isSelectDisabled:d().bool,selectPlaceholder:d().string},v.propTypes={id:d().string.isRequired,title:d().string.isRequired,subtitle:d().string.isRequired,handleClose:d().func};const k=v;var y=n(49698);function M(e){let{title:t,description:n,className:a,inputFieldData:o,inputFieldValue:s,handleChange:i,dataTestId:l}=e;const r=o.options.map((e=>p().createElement("label",{key:e.key,className:"mm-modal-generic-section-item__label-radio"},p().createElement("input",{id:e.key,"data-testid":e.dataTestId,type:"radio",name:e.name,checked:e.value===s,value:e.value,onChange:i}),e.title))),c=p().createElement("fieldset",{className:"mm-modal-generic-section-item__fieldset-radio"},[...r]);return p().createElement(C.A,{dataTestId:l,className:a,content:c,title:t,description:n})}M.propTypes={className:d().string,inputFieldData:d().shape({options:d().arrayOf(d().shape({dataTestId:d().string,title:d().node.isRequired,name:d().string.isRequired,key:d().string.isRequired,value:d().string.isRequired})).isRequired}).isRequired,inputFieldValue:d().string.isRequired,handleChange:d().func.isRequired};const D=M;var T=n(78451),A=n(36003);n(57406),n(55448);let L=function(e){return e.Desktop="desktop",e.Mobile="mobile",e}({});const F=Object.values(L);function S(e){const t=(0,u.useMemo)((()=>{const t=e.userNotifyProps.desktop===e.userSelectedChannelNotifyProps.desktop,n=e.userNotifyProps.desktop_threads===e.userSelectedChannelNotifyProps.desktop_threads,a=(0,A.pN)(e.userNotifyProps.desktop_sound)===e.userSelectedChannelNotifyProps.desktop_sound;let o=!1;return o=e.userNotifyProps.desktop_notification_sound?e.userNotifyProps.desktop_notification_sound===e.userSelectedChannelNotifyProps.desktop_notification_sound:e.userSelectedChannelNotifyProps.desktop_notification_sound===A.x[0],t&&n&&a&&o}),[e.userNotifyProps.desktop,e.userSelectedChannelNotifyProps.desktop,e.userNotifyProps.desktop_threads,e.userSelectedChannelNotifyProps.desktop_threads,e.userNotifyProps.desktop_sound,e.userSelectedChannelNotifyProps.desktop_sound,e.userNotifyProps.desktop_notification_sound,e.userSelectedChannelNotifyProps.desktop_notification_sound]),n=(0,u.useMemo)((()=>{const t=e.userNotifyProps.push===e.userSelectedChannelNotifyProps.push,n=e.userNotifyProps.push_threads===e.userSelectedChannelNotifyProps.push_threads;return t&&n}),[e.userNotifyProps.push,e.userSelectedChannelNotifyProps.push,e.userNotifyProps.push_threads,e.userSelectedChannelNotifyProps.push_threads]);return F.includes(e.sectionName)?e.sectionName===L.Desktop&&t||e.sectionName===L.Mobile&&n?null:p().createElement("button",{className:"channel-notifications-settings-modal__reset-btn",onClick:function(){const t=(n=e.userNotifyProps,(a=e.sectionName)===L.Desktop?{desktop:n.desktop,desktop_threads:null!==(o=null==n?void 0:n.desktop_threads)&&void 0!==o?o:T.DB.ALL,desktop_sound:n&&n.desktop_sound?(0,A.pN)(n.desktop_sound):T.o0.ON,desktop_notification_sound:null!==(s=null==n?void 0:n.desktop_notification_sound)&&void 0!==s?s:A.x[0]}:a===L.Mobile?{push:n.push,push_threads:null!==(i=null==n?void 0:n.push_threads)&&void 0!==i?i:T.DB.ALL}:{});var n,a,o,s,i;e.onClick(t,e.sectionName)},"data-testid":"resetToDefaultButton-".concat(e.sectionName)},p().createElement("i",{className:"icon icon-refresh"}),p().createElement(h.FormattedMessage,{id:"channel_notifications.resetToDefault",defaultMessage:"Reset to default"})):null}S.propTypes={sectionName:d().oneOf(["desktop","mobile"]).isRequired,onClick:d().func.isRequired};const w={desktopNotificationInputFieldData:e=>({options:[{dataTestId:"desktopNotification-".concat(T.DB.ALL),title:p().createElement(h.FormattedMessage,{id:"channelNotifications.desktopNotification.allMessages",defaultMessage:"All new messages {optionalDefault}",values:{optionalDefault:e===T.DB.ALL?p().createElement(h.FormattedMessage,{id:"channel_notifications.default",defaultMessage:"(default)"}):void 0}}),name:"desktopNotification-".concat(T.DB.ALL),key:"desktopNotification-".concat(T.DB.ALL),value:T.DB.ALL},{dataTestId:"desktopNotification-".concat(T.DB.MENTION),title:p().createElement(h.FormattedMessage,{id:"channelNotifications.desktopNotification.mention",defaultMessage:"Mentions, direct messages, and keywords only {optionalDefault}",values:{optionalDefault:e===T.DB.MENTION?p().createElement(h.FormattedMessage,{id:"channel_notifications.default",defaultMessage:"(default)"}):void 0}}),name:"desktopNotification-".concat(T.DB.MENTION),key:"desktopNotification-".concat(T.DB.MENTION),value:T.DB.MENTION},{dataTestId:"desktopNotification-".concat(T.DB.NONE),title:p().createElement(h.FormattedMessage,{id:"channelNotifications.desktopNotification.nothing",defaultMessage:"Nothing {optionalDefault}",values:{optionalDefault:e===T.DB.NONE?p().createElement(h.FormattedMessage,{id:"channel_notifications.default",defaultMessage:"(default)"}):void 0}}),name:"desktopNotification-".concat(T.DB.NONE),key:"desktopNotification-".concat(T.DB.NONE),value:T.DB.NONE}]}),desktopNotificationSoundsCheckboxFieldData:{name:"desktopNotificationSoundsCheckbox",dataTestId:"desktopNotificationSoundsCheckbox"},desktopNotificationSoundsSelectFieldData:{id:"desktopNotificationSoundsSelect",inputId:"desktopNotificationSoundsSelectInputId",options:A.Il},IgnoreMentionsInputFieldData:{name:"ignore mentions",dataTestId:"ignoreMentions"},mobileNotificationInputFieldData:e=>({options:[{dataTestId:"MobileNotification-".concat(T.DB.ALL),title:p().createElement(h.FormattedMessage,{id:"channelNotifications.mobileNotification.newMessages",defaultMessage:"All new messages {optionalDefault}",values:{optionalDefault:e===T.DB.ALL?p().createElement(h.FormattedMessage,{id:"channel_notifications.default",defaultMessage:"(default)"}):void 0}}),name:"MobileNotification-".concat(T.DB.ALL),key:"MobileNotification-".concat(T.DB.ALL),value:T.DB.ALL},{dataTestId:"MobileNotification-".concat(T.DB.MENTION),title:p().createElement(h.FormattedMessage,{id:"channelNotifications.mobileNotification.mention",defaultMessage:"Mentions, direct messages, and keywords only {optionalDefault}",values:{optionalDefault:e===T.DB.MENTION?p().createElement(h.FormattedMessage,{id:"channel_notifications.default",defaultMessage:"(default)"}):void 0}}),name:"MobileNotification-".concat(T.DB.MENTION),key:"MobileNotification-".concat(T.DB.MENTION),value:T.DB.MENTION},{dataTestId:"MobileNotification-".concat(T.DB.NONE),title:p().createElement(h.FormattedMessage,{id:"channelNotifications.mobileNotification.nothing",defaultMessage:"Nothing {optionalDefault}",values:{optionalDefault:e===T.DB.NONE?p().createElement(h.FormattedMessage,{id:"channel_notifications.default",defaultMessage:"(default)"}):void 0}}),name:"MobileNotification-".concat(T.DB.NONE),key:"MobileNotification-".concat(T.DB.NONE),value:T.DB.NONE}]}),MuteChannelInputFieldData:{name:"mute channel",dataTestId:"muteChannel"},DesktopReplyThreadsInputFieldData:{name:"desktop reply threads",dataTestId:"desktopReplyThreads"},MobileReplyThreadsInputFieldData:{name:"mobile reply threads",dataTestId:"mobileReplyThreads"},AutoFollowThreadsInputFieldData:{name:"auto follow threads",dataTestId:"autoFollowThreads"},sameMobileSettingsDesktopInputFieldData:{name:"same mobile settings as Desktop",dataTestId:"sameMobileSettingsDesktop"}};function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){B(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function B(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){var t,n,a,o,s,i,l,r,c;const{formatMessage:d}=(0,h.useIntl)(),[N,C]=(0,u.useState)(!0),[b,v]=(0,u.useState)(""),[M,F]=(0,u.useState)((I=e.currentUser.notify_props,{mark_unread:null!==(P=null==(B=null===(t=e.channelMember)||void 0===t?void 0:t.notify_props)?void 0:B.mark_unread)&&void 0!==P?P:T.DB.ALL,ignore_channel_mentions:x(null==B?void 0:B.mark_unread,null==B?void 0:B.ignore_channel_mentions,null==I?void 0:I.channel),desktop:O(T.DB.ALL,null==B?void 0:B.desktop,null==I?void 0:I.desktop),desktop_threads:O(T.DB.ALL,null==B?void 0:B.desktop_threads,null==I?void 0:I.desktop_threads),desktop_sound:O(T.o0.ON,null==B?void 0:B.desktop_sound,(0,A.pN)(null==I?void 0:I.desktop_sound)),desktop_notification_sound:O(A.ye.BING,null==B?void 0:B.desktop_notification_sound,null==I?void 0:I.desktop_notification_sound),push:O(T.DB.ALL,null==B?void 0:B.push,null==I?void 0:I.push),push_threads:O(T.DB.ALL,null==B?void 0:B.push_threads,null==I?void 0:I.push_threads),channel_auto_follow_threads:null!==(H=null==B?void 0:B.channel_auto_follow_threads)&&void 0!==H?H:"off"}));var I,B,P,H;const[V,q]=(0,u.useState)(U(e.collapsedReplyThreads,O(T.DB.ALL,null==e||null===(n=e.channelMember)||void 0===n||null===(a=n.notify_props)||void 0===a?void 0:a.desktop,e.currentUser.notify_props.desktop),O(T.DB.ALL,null==e||null===(o=e.channelMember)||void 0===o||null===(s=o.notify_props)||void 0===s?void 0:s.desktop_threads,e.currentUser.notify_props.desktop_threads),O(T.DB.ALL,null==e||null===(i=e.channelMember)||void 0===i||null===(l=i.notify_props)||void 0===l?void 0:l.push,e.currentUser.notify_props.push),O(T.DB.ALL,null==e||null===(r=e.channelMember)||void 0===r||null===(c=r.notify_props)||void 0===c?void 0:c.push_threads,e.currentUser.notify_props.push_threads)));function z(){C(!1)}const W=(0,u.useCallback)((e=>{F((t=>R(R({},t),e)))}),[]);function j(t,n){if(n===L.Mobile){const n=U(e.collapsedReplyThreads,M.desktop,M.desktop_threads,t.push,t.push_threads);q(n)}F(R(R({},M),t))}const Z=p().createElement(p().Fragment,null,p().createElement(g.A,{inputFieldTitle:p().createElement(h.FormattedMessage,{id:"channel_notifications.muteChannelTitle",defaultMessage:"Mute channel"}),description:d({id:"channel_notifications.muteChannelDesc",defaultMessage:"Turns off notifications for this channel. You'll still see badges if you're mentioned."}),inputFieldValue:"mention"===M.mark_unread,inputFieldData:w.MuteChannelInputFieldData,handleChange:e=>W({mark_unread:e?"mention":"all"})}),p().createElement(g.A,{inputFieldTitle:p().createElement(h.FormattedMessage,{id:"channel_notifications.ignoreMentionsTitle",defaultMessage:"Ignore mentions for @channel, @here and @all"}),description:d({id:"channel_notifications.ignoreMentionsDesc",defaultMessage:"When enabled, @channel, @here and @all will not trigger mentions or mention notifications in this channel"}),inputFieldValue:"on"===M.ignore_channel_mentions,inputFieldData:w.IgnoreMentionsInputFieldData,handleChange:e=>W({ignore_channel_mentions:e?"on":"off"})})),G=p().createElement(p().Fragment,null,p().createElement(D,{title:d({id:"channel_notifications.NotifyMeTitle",defaultMessage:"Notify me about…"}),inputFieldValue:M.desktop||"",inputFieldData:w.desktopNotificationInputFieldData(e.currentUser.notify_props.desktop),handleChange:e=>W({desktop:e.target.value})}),e.collapsedReplyThreads&&"mention"===M.desktop&&p().createElement(g.A,{title:d({id:"channel_notifications.ThreadsReplyTitle",defaultMessage:"Thread reply notifications"}),inputFieldValue:"all"===M.desktop_threads,inputFieldData:w.DesktopReplyThreadsInputFieldData,inputFieldTitle:p().createElement(h.FormattedMessage,{id:"channel_notifications.checkbox.threadsReplyTitle",defaultMessage:"Notify me about replies to threads I\\'m following"}),handleChange:e=>W({desktop_threads:e?"all":"mention"})}),"none"!==M.desktop&&p().createElement(E,{title:d({id:"channel_notifications.desktopNotifications.title",defaultMessage:"Sounds"}),checkboxFieldTitle:p().createElement(h.FormattedMessage,{id:"channel_notifications.desktopNotifications.soundEnable",defaultMessage:"Message notification sounds"}),checkboxFieldValue:M.desktop_sound===T.o0.ON,checkboxFieldData:w.desktopNotificationSoundsCheckboxFieldData,handleCheckboxChange:e=>W({desktop_sound:e?T.o0.ON:T.o0.OFF}),selectFieldData:w.desktopNotificationSoundsSelectFieldData,selectFieldValue:(0,A.ed)(M.desktop_notification_sound),isSelectDisabled:"on"!==M.desktop_sound,selectPlaceholder:d({id:"channel_notifications.desktopNotifications.soundSelectPlaceholder",defaultMessage:"Select a sound"}),handleSelectChange:e=>{(0,A.$c)(),e&&"value"in e&&(W({desktop_notification_sound:e.value}),(0,A.Yx)(e.value))}})),Y=p().createElement(p().Fragment,null,p().createElement(g.A,{inputFieldTitle:p().createElement(h.FormattedMessage,{id:"channel_notifications.checkbox.sameMobileSettingsDesktop",defaultMessage:"Use the same notification settings as desktop"}),inputFieldValue:!V,inputFieldData:w.sameMobileSettingsDesktopInputFieldData,handleChange:function(t){const n=R({},M),a=!t;var o,s,i,l,r,c,d,u;!1===a?(n.push=M.desktop,n.push_threads=M.desktop_threads):(n.push=O(T.DB.ALL,null===(o=e.channelMember)||void 0===o||null===(s=o.notify_props)||void 0===s?void 0:s.push,null===(i=e.currentUser)||void 0===i||null===(l=i.notify_props)||void 0===l?void 0:l.push),n.push_threads=O(T.DB.ALL,null===(r=e.channelMember)||void 0===r||null===(c=r.notify_props)||void 0===c?void 0:c.push_threads,null===(d=e.currentUser)||void 0===d||null===(u=d.notify_props)||void 0===u?void 0:u.push_threads)),F(n),q(a)}}),V&&p().createElement(p().Fragment,null,p().createElement(D,{dataTestId:"mobile-notify-me-radio-section",title:d({id:"channel_notifications.NotifyMeTitle",defaultMessage:"Notify me about…"}),inputFieldValue:M.push||"",inputFieldData:w.mobileNotificationInputFieldData(e.currentUser.notify_props.push),handleChange:e=>W({push:e.target.value})}),e.collapsedReplyThreads&&"mention"===M.push&&p().createElement(g.A,{dataTestId:"mobile-reply-threads-checkbox-section",title:d({id:"channel_notifications.ThreadsReplyTitle",defaultMessage:"Thread reply notifications"}),inputFieldTitle:p().createElement(h.FormattedMessage,{id:"channel_notifications.checkbox.threadsReplyTitle",defaultMessage:"Notify me about replies to threads I\\'m following"}),inputFieldValue:"all"===M.push_threads,inputFieldData:w.MobileReplyThreadsInputFieldData,handleChange:e=>W({push_threads:e?"all":"mention"})}))),X=p().createElement(g.A,{inputFieldTitle:p().createElement(h.FormattedMessage,{id:"channel_notifications.checkbox.autoFollowThreadsTitle",defaultMessage:"Automatically follow threads in this channel"}),inputFieldValue:"on"===M.channel_auto_follow_threads,inputFieldData:w.AutoFollowThreadsInputFieldData,handleChange:e=>W({channel_auto_follow_threads:e?"on":"off"})}),K="all"===M.mark_unread?p().createElement(p().Fragment,null,p().createElement("div",{className:"channel-notifications-settings-modal__divider"}),p().createElement(y.A,{title:d({id:"channel_notifications.desktopNotificationsTitle",defaultMessage:"Desktop Notifications"}),titleSuffix:p().createElement(S,{sectionName:L.Desktop,userNotifyProps:e.currentUser.notify_props,userSelectedChannelNotifyProps:M,onClick:j}),description:d({id:"channel_notifications.desktopNotificationsDesc",defaultMessage:"Available on Chrome, Edge, Firefox, and the Mattermost Desktop App."}),content:G}),p().createElement("div",{className:"channel-notifications-settings-modal__divider"}),p().createElement(y.A,{title:d({id:"channel_notifications.mobileNotificationsTitle",defaultMessage:"Mobile Notifications"}),titleSuffix:p().createElement(S,{sectionName:L.Mobile,userNotifyProps:e.currentUser.notify_props,userSelectedChannelNotifyProps:M,onClick:j}),description:d({id:"channel_notifications.mobileNotificationsDesc",defaultMessage:"Notification alerts are pushed to your mobile device when there is activity in Mattermost."}),content:Y})):p().createElement(_.A,{id:"channelNotificationsMutedBanner",mode:"info",variant:"app",customIcon:p().createElement(f.BellOffOutlineIcon,{size:24,color:"currentColor"}),title:p().createElement(h.FormattedMessage,{id:"channel_notifications.alertBanner.title",defaultMessage:"This channel is muted"}),message:p().createElement(h.FormattedMessage,{id:"channel_notifications.alertBanner.description",defaultMessage:"All other notification preferences for this channel are disabled"})});return p().createElement(m.Modal,{dialogClassName:"a11y__modal channel-notifications-settings-modal",show:N,onHide:z,onExited:e.onExited,role:"none","aria-labelledby":"channelNotificationModalLabel",style:{display:"flex",placeItems:"center"}},p().createElement(k,{id:"channelNotificationModalLabel",title:d({id:"channel_notifications.preferences",defaultMessage:"Notification Preferences"}),subtitle:e.channel.display_name,handleClose:z}),p().createElement("main",{className:"channel-notifications-settings-modal__body"},p().createElement(y.A,{title:d({id:"channel_notifications.muteAndIgnore",defaultMessage:"Mute or ignore"}),content:Z}),K,e.collapsedReplyThreads&&p().createElement(p().Fragment,null,p().createElement("div",{className:"channel-notifications-settings-modal__divider"}),p().createElement(y.A,{title:d({id:"channel_notifications.autoFollowThreadsTitle",defaultMessage:"Follow all threads in this channel"}),description:d({id:"channel_notifications.autoFollowThreadsDesc",defaultMessage:"When enabled, all new replies in this channel will be automatically followed and will appear in your Threads view."}),content:X}))),p().createElement("footer",{className:"channel-notifications-settings-modal__footer"},b&&p().createElement("span",{className:"channel-notifications-settings-modal__server-error"},b),p().createElement("button",{className:"btn btn-tertiary btn-md",onClick:z},p().createElement(h.FormattedMessage,{id:"generic_btn.cancel",defaultMessage:"Cancel"})),p().createElement("button",{className:"btn btn-primary btn-md",onClick:function(){const t=function(e,t,n){var a,o,s;const i={mark_unread:t.mark_unread,ignore_channel_mentions:t.ignore_channel_mentions,channel_auto_follow_threads:t.channel_auto_follow_threads};return t.desktop===e.desktop?i.desktop=T.DB.DEFAULT:i.desktop=t.desktop,null!=e&&null!==(a=e.desktop_threads)&&void 0!==a&&a.length?e.desktop_threads===t.desktop_threads?i.desktop_threads=T.DB.DEFAULT:i.desktop_threads=t.desktop_threads:t.desktop_threads===T.DB.MENTION||t.desktop_threads===T.DB.DEFAULT?i.desktop_threads=T.DB.DEFAULT:i.desktop_threads=t.desktop_threads,(0,A.pN)(null==e?void 0:e.desktop_sound)===t.desktop_sound?i.desktop_sound=T.o0.DEFAULT:i.desktop_sound=t.desktop_sound,null!=e&&null!==(o=e.desktop_notification_sound)&&void 0!==o&&o.length?e.desktop_notification_sound===t.desktop_notification_sound?i.desktop_notification_sound=A.ye.DEFAULT:i.desktop_notification_sound=t.desktop_notification_sound:t.desktop_notification_sound===A.ye.BING||t.desktop_notification_sound===A.ye.DEFAULT?i.desktop_notification_sound=A.ye.DEFAULT:i.desktop_notification_sound=t.desktop_notification_sound,t.push===e.push?i.push=T.DB.DEFAULT:i.push=t.push,null!=e&&null!==(s=e.push_threads)&&void 0!==s&&s.length?e.push_threads===t.push_threads?i.push_threads=T.DB.DEFAULT:i.push_threads=t.push_threads:t.push_threads===T.DB.MENTION||t.push_threads===T.DB.DEFAULT?i.push_threads=T.DB.DEFAULT:i.push_threads=t.push_threads,!1===n&&(i.desktop===T.DB.DEFAULT?i.push=e.desktop:i.push=i.desktop,i.desktop_threads===T.DB.DEFAULT?i.push_threads=e.desktop_threads:i.push_threads=i.desktop_threads),i}(e.currentUser.notify_props,M,V);e.actions.updateChannelNotifyProps(e.currentUser.id,e.channel.id,t).then((e=>{const{error:t}=e;t?v(t.message):z()}))}},p().createElement(h.FormattedMessage,{id:"generic_btn.save",defaultMessage:"Save"}))))}function O(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,a=e;return t?a=t===T.DB.DEFAULT&&n?n:t:n&&(a=n),a}function x(e,t,n){let a=T.fV.OFF;return(e===T.DB.MENTION||n&&"false"===n)&&(a=T.fV.ON),t?t===T.fV.DEFAULT?a:t:a}function U(e,t,n,a,o){return a!==T.DB.DEFAULT&&a!==t||e&&n!==o}P.propTypes={onExited:d().func.isRequired};const H=(0,a.connect)((e=>({collapsedReplyThreads:(0,r.WW)(e),channelMember:(0,i.tW)(e),sendPushNotifications:"true"===(0,l.zj)(e).SendPushNotifications})),(e=>({actions:(0,o.bindActionCreators)({updateChannelNotifyProps:s.cz},e)})))(P)},98089:(e,t,n)=>{n.r(t),n.d(t,{default:()=>R,getChannelTypeFromPermissions:()=>w}),n(17046),n(43813);var a=n(71633),o=n.n(a),s=n(97023),i=n.n(s),l=n(14778),r=n(23453),c=n(14696),d=n(30596),u=n(30413),p=n(16983),m=n(92157),h=n(77440),f=n(80635),_=n(14776),g=n(25778),N=n(79751),C=n(11284),E=n(62688),b=n.n(E);function v(e){const{formatMessage:t}=(0,l.useIntl)();return i().createElement("span",e,i().createElement("svg",{width:"22",height:"22",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg","aria-label":t({id:"generic_icons.check.circle",defaultMessage:"Check Circle Icon"})},i().createElement("path",{d:"M11 0.992024C9.192 0.992024 7.512 1.44802 5.96 2.36002C4.44 3.24002 3.24 4.44002 2.36 5.96002C1.448 7.51202 0.992 9.19202 0.992 11C0.992 12.808 1.448 14.488 2.36 16.04C3.24 17.56 4.44 18.76 5.96 19.64C7.512 20.552 9.192 21.008 11 21.008C12.808 21.008 14.488 20.552 16.04 19.64C17.56 18.76 18.76 17.56 19.64 16.04C20.552 14.488 21.008 12.808 21.008 11C21.008 9.19202 20.552 7.51202 19.64 5.96002C18.76 4.44002 17.56 3.24002 16.04 2.36002C14.488 1.44802 12.808 0.992024 11 0.992024ZM9.248 15.68L7.832 14.288L5 11.456L6.416 10.04L9.248 12.872L15.608 6.48802L17.024 7.90402L9.248 15.68Z"})))}function k(e){const{formatMessage:t}=(0,l.useIntl)();return i().createElement("span",e,i().createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",xmlns:"http://www.w3.org/2000/svg","aria-label":t({id:"generic_icons.globe.circleSolid",defaultMessage:"Globe Circle Solid Icon"})},i().createElement("rect",{width:"40",height:"40",rx:"20",fillOpacity:"0.08"}),i().createElement("path",{d:"M20 8.31042C17.8304 8.31042 15.8144 8.85762 13.952 9.95202C12.1472 11.0272 10.7072 12.4672 9.632 14.272C8.5376 16.1344 7.9904 18.1504 7.9904 20.32C7.9904 22.4896 8.5376 24.5056 9.632 26.368C10.7072 28.1728 12.1472 29.6128 13.952 30.688C15.8144 31.7824 17.8304 32.3296 20 32.3296C22.1696 32.3296 24.1856 31.7824 26.048 30.688C27.8528 29.6128 29.2928 28.1728 30.368 26.368C31.4624 24.5056 32.0096 22.4896 32.0096 20.32C32.0096 18.1504 31.4624 16.1344 30.368 14.272C29.2928 12.4672 27.8528 11.0272 26.048 9.95202C24.1856 8.85762 22.1696 8.31042 20 8.31042ZM29.5904 20.9248C29.3792 21.2128 28.8896 21.5296 28.1216 21.8752C27.1616 22.2976 26.0576 22.6144 24.8096 22.8256V18.7648C26.5184 18.4576 27.8336 18.0928 28.7552 17.6704C28.7936 17.632 28.8704 17.5936 28.9856 17.5552C29.12 17.5168 29.2064 17.4784 29.2448 17.44C29.4752 18.2656 29.5904 19.2256 29.5904 20.32V20.9248ZM18.2144 25.5904C18.4064 25.5904 18.6944 25.6096 19.0784 25.648C19.4816 25.6864 19.7888 25.7056 20 25.7056C20.8064 25.7056 21.4112 25.6672 21.8144 25.5904C21.5264 26.7424 21.2096 27.7024 20.864 28.4704C20.5568 29.1616 20.2688 29.6032 20 29.7952C19.712 29.584 19.4144 29.1424 19.1072 28.4704C18.7232 27.664 18.4256 26.704 18.2144 25.5904ZM20 23.3152C18.9632 23.3152 18.2048 23.2768 17.7248 23.2C17.7248 22.9312 17.7056 22.5088 17.6672 21.9328C17.6288 21.2416 17.6096 20.704 17.6096 20.32V18.9952C18.1664 19.072 18.9632 19.1104 20 19.1104C21.0368 19.1104 21.8336 19.072 22.3904 18.9952V20.32C22.3904 20.704 22.3712 21.2416 22.3328 21.9328C22.2944 22.5088 22.2752 22.9312 22.2752 23.2C21.7952 23.2768 21.0368 23.3152 20 23.3152ZM22.16 16.6048C21.68 16.6816 20.96 16.72 20 16.72C19.04 16.72 18.32 16.6816 17.84 16.6048C18.0704 15.0688 18.416 13.7248 18.8768 12.5728C19.2608 11.6128 19.6352 10.9984 20 10.7296C20.3648 10.9984 20.7392 11.6128 21.1232 12.5728C21.584 13.7248 21.9296 15.0688 22.16 16.6048ZM28.1504 15.28C27.536 15.5296 27.0272 15.7216 26.624 15.856C25.9328 16.0864 25.2416 16.2496 24.5504 16.3456C24.4352 15.424 24.2624 14.5216 24.032 13.6384C23.8016 12.7552 23.5424 11.9776 23.2544 11.3056C25.3472 12.0544 26.9792 13.3792 28.1504 15.28ZM11.8496 15.28C12.464 14.3392 13.184 13.5424 14.0096 12.8896C14.8736 12.1792 15.8336 11.6512 16.8896 11.3056C16.2752 12.6496 15.7952 14.3296 15.4496 16.3456C13.9712 16.0192 12.7712 15.664 11.8496 15.28ZM10.8704 17.44C10.928 17.4784 11.0144 17.5264 11.1296 17.584L11.36 17.6704C12.3968 18.1312 13.7216 18.496 15.3344 18.7648C15.2768 18.976 15.2384 19.216 15.2192 19.4848C15.2 19.6576 15.1904 19.936 15.1904 20.32C15.1904 21.4336 15.2384 22.2688 15.3344 22.8256C14.0864 22.6144 12.9824 22.2976 12.0224 21.8752C11.2352 21.5296 10.736 21.2128 10.5248 20.9248V20.32C10.4672 19.84 10.4672 19.3408 10.5248 18.8224C10.5824 18.304 10.6976 17.8432 10.8704 17.44ZM11.2448 24.1504C12.7424 24.7456 14.2208 25.1488 15.68 25.36C15.872 26.6464 16.2752 27.9616 16.8896 29.3056C15.6224 28.8832 14.4992 28.2208 13.52 27.3184C12.5408 26.416 11.7824 25.36 11.2448 24.1504ZM28.7552 24.1504C28.2176 25.36 27.4592 26.416 26.48 27.3184C25.5008 28.2208 24.3776 28.8832 23.1104 29.3056C23.7248 27.9616 24.128 26.6464 24.32 25.36C26.2208 25.0912 27.6992 24.688 28.7552 24.1504Z"})))}function y(e){const{formatMessage:t}=(0,l.useIntl)();return i().createElement("span",e,i().createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",xmlns:"http://www.w3.org/2000/svg","aria-label":t({id:"generic_icons.lock.circleSolid",defaultMessage:"Lock Circle Solid Icon"})},i().createElement("rect",{width:"40",height:"40",rx:"20",fillOpacity:"0.08"}),i().createElement("path",{d:"M27.2 29.9104V19.1104H12.8V29.9104H27.2ZM27.2 16.72C27.872 16.72 28.4384 16.9504 28.8992 17.4112C29.36 17.872 29.5904 18.4384 29.5904 19.1104V29.9104C29.5904 30.5824 29.3504 31.1488 28.8704 31.6096C28.4096 32.0896 27.8528 32.3296 27.2 32.3296H12.8C12.1472 32.3296 11.5808 32.0896 11.1008 31.6096C10.64 31.1488 10.4096 30.5824 10.4096 29.9104V19.1104C10.4096 18.4384 10.64 17.872 11.1008 17.4112C11.5808 16.9504 12.1472 16.72 12.8 16.72H14.0096V14.3296C14.0096 13.216 14.2688 12.208 14.7872 11.3056C15.3248 10.384 16.0448 9.65442 16.9472 9.11682C17.8688 8.57922 18.8864 8.31042 20 8.31042C21.1136 8.31042 22.1216 8.57922 23.024 9.11682C23.9456 9.65442 24.6656 10.384 25.184 11.3056C25.7216 12.208 25.9904 13.216 25.9904 14.3296V16.72H27.2ZM20 10.7296C19.328 10.7296 18.7136 10.8928 18.1568 11.2192C17.6192 11.5264 17.1872 11.9584 16.8608 12.5152C16.5536 13.0528 16.4 13.6576 16.4 14.3296V16.72H23.6V14.3296C23.6 13.6576 23.4368 13.0528 23.1104 12.5152C22.8032 11.9584 22.3712 11.5264 21.8144 11.2192C21.2768 10.8928 20.672 10.7296 20 10.7296Z"})))}function M(e){const{formatMessage:t}=(0,l.useIntl)();return i().createElement("span",e,i().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",viewBox:"2 2 20 20",role:"img","aria-label":t({id:"generic_icons.upgradeBadge",defaultMessage:"Upgrade badge"})},i().createElement("circle",{cx:"12",cy:"12",r:"10",fillOpacity:"0.08"}),i().createElement("path",{d:"M12,2c5.523,0,10,4.477,10,10s-4.477,10-10,10S2,17.523,2,12S6.477,2,12,2z M14.994,9.033 c0.218,0.217,0.327,0.47,0.327,0.76s-0.109,0.543-0.327,0.76c-0.218,0.217-0.472,0.326-0.762,0.326s-0.545-0.109-0.762-0.326 c-0.218-0.217-0.327-0.47-0.327-0.76s0.109-0.543,0.327-0.76c0.218-0.217,0.472-0.326,0.762-0.326S14.776,8.816,14.994,9.033z M16.555,7.477C15.902,6.826,15.115,6.5,14.195,6.5c-0.871,0-1.634,0.326-2.287,0.977c-0.508,0.507-0.823,1.11-0.944,1.809 c-0.097,0.675,0.012,1.315,0.327,1.918L6.5,15.98l1.525,1.52l1.561-1.556l1.561,1.556l1.525-1.52l-1.561-1.556l1.706-1.701 c0.605,0.314,1.246,0.422,1.924,0.326c0.702-0.121,1.307-0.434,1.815-0.941c0.653-0.651,0.968-1.423,0.944-2.316 C17.523,8.9,17.208,8.128,16.555,7.477z"})))}n(4290);var D=n(87131),T=n(78451);const A=e=>{let{id:t,title:n,description:a,iconSVG:l,titleClassName:r,descriptionClassName:c,iconClassName:d,tooltip:u,selected:p,disabled:m,locked:h,onClick:f}=e;const _=(0,s.useCallback)((e=>{e.preventDefault(),f(t)}),[t,f]),g=i().createElement("button",{id:"public-private-selector-button-".concat(t),className:o()("public-private-selector-button",{selected:p,disabled:m,locked:h}),onClick:_},i().createElement(l,{className:o()("public-private-selector-button-icon",d)}),i().createElement("div",{className:"public-private-selector-button-text"},i().createElement("div",{className:o()("public-private-selector-button-title",r)},n,h&&i().createElement(M,{className:"public-private-selector-button-icon-upgrade"})),i().createElement("div",{className:o()("public-private-selector-button-description",c)},a)),p&&i().createElement(v,{className:"public-private-selector-button-icon-check"}));return u?i().createElement(D.A,{title:u},g):g};A.propTypes={title:b().oneOfType([b().string,b().node]).isRequired,description:b().oneOfType([b().string,b().node]).isRequired,iconSVG:b().func.isRequired,titleClassName:b().string,descriptionClassName:b().string,iconClassName:b().string,tooltip:b().string,selected:b().bool,disabled:b().bool,locked:b().bool,onClick:b().func.isRequired};const L=e=>{let{selected:t,className:n,publicButtonProps:{title:a,description:r,titleClassName:c,descriptionClassName:d,iconClassName:u,tooltip:p,disabled:m,locked:h}={},privateButtonProps:{title:f,description:_,titleClassName:g,descriptionClassName:N,iconClassName:C,tooltip:E,disabled:b,locked:v}={},onChange:M}=e;const{formatMessage:D}=(0,l.useIntl)(),L=!m&&!h,F=!b&&!v,S=(0,s.useCallback)((e=>{e===t||e===T.YM.OPEN_CHANNEL&&!L||e===T.YM.PRIVATE_CHANNEL&&!F||M(e)}),[t,L,F,M]);return i().createElement("div",{className:o()("public-private-selector",n)},i().createElement(A,{id:T.YM.OPEN_CHANNEL,title:a||D({id:"public_private_selector.public.title",defaultMessage:"Public"}),description:r||D({id:"public_private_selector.public.description",defaultMessage:"Anyone"}),iconSVG:k,titleClassName:c,descriptionClassName:d,iconClassName:u,tooltip:p,selected:t===T.YM.OPEN_CHANNEL,disabled:m,locked:h,onClick:S}),i().createElement(A,{id:T.YM.PRIVATE_CHANNEL,title:f||D({id:"public_private_selector.private.title",defaultMessage:"Private"}),description:_||D({id:"public_private_selector.private.description",defaultMessage:"Only invited members"}),iconSVG:y,titleClassName:g,descriptionClassName:N,iconClassName:C,tooltip:E,selected:t===T.YM.PRIVATE_CHANNEL,disabled:b,locked:v,onClick:S}))};L.propTypes={className:b().string,publicButtonProps:b().shape({title:b().oneOfType([b().string,b().node]),description:b().oneOfType([b().string,b().node]),titleClassName:b().string,descriptionClassName:b().string,iconClassName:b().string,tooltip:b().string,selected:b().bool,disabled:b().bool,locked:b().bool}),privateButtonProps:b().shape({title:b().oneOfType([b().string,b().node]),description:b().oneOfType([b().string,b().node]),titleClassName:b().string,descriptionClassName:b().string,iconClassName:b().string,tooltip:b().string,selected:b().bool,disabled:b().bool,locked:b().bool}),onChange:b().func.isRequired};const F=L;var S=n(694);function w(e,t){let n=T.Ay.OPEN_CHANNEL;return e||n!==T.Ay.OPEN_CHANNEL||(n=T.Ay.PRIVATE_CHANNEL),t||n!==T.Ay.PRIVATE_CHANNEL||(n=T.Ay.OPEN_CHANNEL),n}var I=function(e){return e.CHANNEL_URL_SIZE="model.channel.is_valid.1_or_more.app_error",e.CHANNEL_UPDATE_EXISTS="store.sql_channel.update.exists.app_error",e.CHANNEL_CREATE_EXISTS="store.sql_channel.save_channel.exists.app_error",e.CHANNEL_PURPOSE_SIZE="model.channel.is_valid.purpose.app_error",e}(I||{});const R=()=>{var e;const t=(0,l.useIntl)(),{formatMessage:n}=t,a=null===(e=(0,r.useSelector)(_.H7))||void 0===e?void 0:e.id,E=(0,r.useSelector)((e=>!!a&&(0,f.xY)(e,p.A.CREATE_PUBLIC_CHANNEL))),b=(0,r.useSelector)((e=>!!a&&(0,f.xY)(e,p.A.CREATE_PRIVATE_CHANNEL))),v=(0,r.useDispatch)(),[k,y]=(0,s.useState)(w(E,b)),[M,A]=(0,s.useState)(""),[L,R]=(0,s.useState)(""),[B,P]=(0,s.useState)(""),[O,x]=(0,s.useState)(""),[U,H]=(0,s.useState)(""),[V,q]=(0,s.useState)(""),[z,W]=(0,s.useState)(!1),j=(0,r.useSelector)((e=>e.plugins.components)),Z=null==j?void 0:j.CreateBoardFromTemplate,G=(0,r.useSelector)((e=>(0,h.Jt)(e,m.A.APP_BAR,m.A.NEW_CHANNEL_WITH_BOARD_TOUR_SHOWED,""))),[Y,X]=(0,s.useState)(!0),[K,Q]=(0,s.useState)(void 0),J=(0,s.useCallback)((e=>{R(e),x("")}),[]),$=async()=>{if(!oe||!a)return;const e={team_id:a,name:L,display_name:M,purpose:B,header:"",type:k,create_at:0,creator_id:"",delete_at:0,group_constrained:!1,id:"",last_post_at:0,last_root_post_at:0,scheme_id:"",update_at:0};try{const{data:t,error:n}=await v((0,u.oP)(e,""));if(n)return void ne(n);if(te(),Y&&Z)try{ee(t.id)}catch(e){console.log(e.message)}v((0,g.BX)(t))}catch(e){ne({message:n({id:"channel_modal.error.generic",defaultMessage:"Something went wrong. Please try again."})})}},ee=async e=>{if(!Z||!a)return!1;if(!K)return!1;const t=K;if(t&&Y){const n=await t(e,a);if(null==n||!n.id)return!1}return""===G&&v((0,d.z)({[m.A.NEW_CHANNEL_WITH_BOARD_TOUR_SHOWED]:!1})),!0},te=()=>{v((0,N.O)(T.IQ.NEW_CHANNEL_MODAL))},ne=e=>{let{server_error_id:t,message:a}=e;switch(t){case I.CHANNEL_URL_SIZE:x(n({id:"channel_modal.handleTooShort",defaultMessage:"Channel URL must be 1 or more lowercase alphanumeric characters"}));break;case I.CHANNEL_UPDATE_EXISTS:case I.CHANNEL_CREATE_EXISTS:x(n({id:"channel_modal.alreadyExist",defaultMessage:"A channel with that URL already exists"}));break;case I.CHANNEL_PURPOSE_SIZE:H(n({id:"channel_modal.purposeTooLong",defaultMessage:"The purpose exceeds the maximum of 250 characters"}));break;default:q(a)}},ae=(0,s.useCallback)((e=>{y(e),q("")}),[]),oe=M&&!O&&k&&!U&&!V&&Y&&!z,se=i().createElement(D.A,{title:i().createElement(i().Fragment,null,i().createElement("div",{className:"title"},i().createElement(l.FormattedMessage,{id:"channel_modal.create_board.tooltip_title",defaultMessage:"Manage your task with a board"})),i().createElement("div",{className:"description"},i().createElement(l.FormattedMessage,{id:"channel_modal.create_board.tooltip_description",defaultMessage:"Use any of our templates to manage your tasks or start from scratch with your own!"})))},i().createElement("i",{className:"icon-information-outline"}));return i().createElement(c.zW,{id:"new-channel-modal",className:"new-channel-modal",modalHeaderText:n({id:"channel_modal.modalTitle",defaultMessage:"Create a new channel"}),confirmButtonText:n({id:"channel_modal.createNew",defaultMessage:"Create channel"}),cancelButtonText:n({id:"channel_modal.cancel",defaultMessage:"Cancel"}),errorText:V,isConfirmDisabled:!oe,autoCloseOnConfirmButton:!1,compassDesign:!0,handleConfirm:$,handleEnterKeyPress:$,handleCancel:te,onExited:te},i().createElement("div",{className:"new-channel-modal-body"},i().createElement(C.A,{value:M,name:"new-channel-modal-name",placeholder:n({id:"channel_modal.name.placeholder",defaultMessage:"Enter a name for your new channel"}),onDisplayNameChange:A,onURLChange:J,onErrorStateChange:W,urlError:O}),i().createElement(F,{className:"new-channel-modal-type-selector",selected:k,publicButtonProps:{title:n({id:"channel_modal.type.public.title",defaultMessage:"Public Channel"}),description:n({id:"channel_modal.type.public.description",defaultMessage:"Anyone can join"}),disabled:!E},privateButtonProps:{title:n({id:"channel_modal.type.private.title",defaultMessage:"Private Channel"}),description:n({id:"channel_modal.type.private.description",defaultMessage:"Only invited members"}),disabled:!b},onChange:ae}),i().createElement("div",{className:"new-channel-modal-purpose-container"},i().createElement("textarea",{id:"new-channel-modal-purpose",className:o()("new-channel-modal-purpose-textarea",{"with-error":U}),placeholder:n({id:"channel_modal.purpose.placeholder",defaultMessage:"Enter a purpose for this channel (optional)"}),rows:4,maxLength:T.Ay.MAX_CHANNELPURPOSE_LENGTH,autoComplete:"off",value:B,onChange:e=>{e.preventDefault();const{target:{value:t}}=e;P(t),H(""),q("")},onKeyDown:e=>{e.stopPropagation()}}),U?i().createElement("div",{className:"new-channel-modal-purpose-error"},i().createElement("i",{className:"icon icon-alert-outline"}),i().createElement("span",null,U)):i().createElement("div",{className:"new-channel-modal-purpose-info"},i().createElement("span",null,n({id:"channel_modal.purpose.info",defaultMessage:"This will be displayed when browsing for channels."}))),Z&&i().createElement(S.default,{pluggableName:"CreateBoardFromTemplate",setCanCreate:X,setAction:Q,newBoardInfoIcon:se}))))}},7021:(e,t,n)=>{n.d(t,{A:()=>b}),n(57406),n(55448);var a=n(62688),o=n.n(a),s=(n(17046),n(71633)),i=n.n(s),l=n(97023),r=n.n(l),c=n(23453),d=n(92387),u=n.n(d),p=n(7430),m=n(7380),h=n(17463),f=n(71769),_=n(69161);const g=["id","name","className","disabled","dir","containerRef","defaultWidth","onResize","onResizeStart","onResizeEnd","onDividerDoubleClick"],N=u().div.withConfig({displayName:"Divider"})(["position:absolute;z-index:50;top:0;width:12px;height:100%;cursor:col-resize;&.left{right:-12px;}&::after{position:absolute;width:4px;height:100%;background-color:",";content:'';}&:hover{&::after{background-color:var(--sidebar-text-active-border);transition:background-color 400ms step-end;}}&.snapped{&::after{animation:emphasis-sidebar-resize-line 800ms;}}"],(e=>{let{isActive:t}=e;return t?"var(--sidebar-text-active-border)":"transparent"})),C=(0,d.createGlobalStyle)([""," ",""],(e=>{let{active:t}=e;return t&&(0,d.css)(["body{cursor:col-resize;user-select:none;}"])}),(e=>{let{varName:t,width:n}=e;return n&&(0,d.css)([":root{--",":","px;}"],t,n)}));function E(e){let{id:t,name:n,className:a,disabled:o,dir:s,containerRef:d,defaultWidth:u,onResize:E,onResizeStart:b,onResizeEnd:v,onDividerDoubleClick:k}=e,y=function(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)n=s[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,g);const M=(0,l.useRef)(null),D=(0,l.useRef)(0),T=(0,l.useRef)(null),A=(0,l.useRef)(0),L="--".concat(y.globalCssVar),F=(0,c.useSelector)(p.WR),S=(0,c.useSelector)(m.w3),[w,I]=(0,l.useState)(!1),[R,B]=(0,h.Q)(null,"resizable_".concat(n,":"),F),P=(e,t,n)=>{E&&E(e,t,n),((e,t,n)=>{var a;null===(a=d.current)||void 0===a||a.style.setProperty(t,n),T.current=e})(e,t,n)},O=()=>{D.current=0,A.current=0,T.current=null};return(0,l.useEffect)((()=>{if(!w||o)return void O();const e=e=>{var t;const n=M.current;if(!w)return;if(!n)return;e.preventDefault();const a=null!==(t=T.current)&&void 0!==t?t:0;let o=0;switch(s){case f.Cr.LEFT:o=e.clientX-A.current;break;case f.Cr.RIGHT:o=A.current-e.clientX}const i=a+o;if(n.classList.contains("snapped")){const t=i-u;if((0,_.bs)(t))return;return P(i,L,"".concat(i,"px")),n.classList.remove("snapped"),void(A.current=e.clientX)}A.current=e.clientX;const l=(0,_._L)(i,a,u)||(0,_.kW)(i,a,u);if((0,_.YP)(i-a)&&l){switch(s){case f.Cr.LEFT:A.current+=u-i;break;case f.Cr.RIGHT:A.current+=i-u}return P(u,L,"".concat(u,"px")),void n.classList.add("snapped")}P(i,L,"".concat(i,"px"))},t=()=>{var e,t;const n=null===(e=d.current)||void 0===e?void 0:e.getBoundingClientRect().width;w&&n&&(B(n),null==v||v(n,L,"".concat(n,"px"))),null===(t=d.current)||void 0===t||t.style.removeProperty(L),document.body.classList.remove("layout-changing"),O(),I(!1)};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}}),[w,o]),o||S?null:r().createElement(r().Fragment,null,r().createElement(N,{id:t,className:i()(a,{left:s===f.Cr.LEFT,right:s===f.Cr.RIGHT}),ref:M,isActive:w,onMouseDown:e=>{!o&&d.current&&(A.current=e.clientX,D.current=d.current.getBoundingClientRect().width,I(!0),b&&b(D.current),P(D.current,L,"".concat(D.current,"px")),document.body.classList.add("layout-changing"))},onDoubleClick:()=>{null==k||k(null!=R?R:0,L),O(),B(null)}}),r().createElement(C,{varName:y.globalCssVar,width:R,active:w}))}E.propTypes={id:o().string,className:o().string,name:o().string.isRequired,disabled:o().bool,defaultWidth:o().number.isRequired,onResizeStart:o().func,onResize:o().func,onResizeEnd:o().func,onDividerDoubleClick:o().func};const b=E},69161:(e,t,n)=>{n.d(t,{Em:()=>r,YP:()=>s,_L:()=>i,bs:()=>o,kW:()=>l});var a=n(71769);const o=e=>Math.abs(e)<=a.Yj,s=e=>Math.abs(e)<=a.YL,i=(e,t,n)=>{const o=n-e,s=e>t;return o>=0&&o<=a.Yj&&s},l=(e,t,n)=>{const o=e-n,s=e<t;return o>=0&&o<=a.Yj&&s},r=e=>e===a.sK.MEDIUM},30596:(e,t,n)=>{n.d(t,{z:()=>i}),n(43813);var a=n(7430),o=n(35631),s=n(57898);function i(e){return async(t,n)=>{const i=n(),l=(0,a.WR)(i),r={user_id:l,category:s.pm.APP_BAR,name:s.pm.NEW_CHANNEL_WITH_BOARD_TOUR_SHOWED,value:JSON.stringify(e)};return await t((0,o.SF)(l,[r])),{data:!0}}}},17463:(e,t,n)=>{n.d(t,{Q:()=>u});var a=n(97023),o=n(23453),s=n(8361),i=n(14776),l=n(7430),r=n(61185),c=n(77212);const d=(0,s.Mz)("currentUserAndTeamSuffix",[l.WR,i.Sy],((e,t)=>":".concat(e,":").concat(t)));function u(e,t,n){const s=(0,o.useDispatch)(),i=(0,o.useSelector)(d),l=n||i,u="".concat(t).concat(l);return[(0,o.useSelector)((0,c.zR)(u,e),o.shallowEqual),(0,a.useCallback)((e=>s((0,r.X2)(u,e))),[u])]}}}]);
//# sourceMappingURL=4377.469067183c098bc3d0d4.js.map

VaKeR 2022