@wellesley/settings 1.0.781 → 1.0.783
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +1 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createAction as Du,createSlice as Uu,createSelector as yt}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import Ty,{useState as Dy,useEffect as Uy,forwardRef as Fu,createElement as No,useCallback as Fy}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{Checkbox as By,RadioGroup as zy,RadioGroupItem as Vy,TooltipProvider as qy,Tooltip as $y,TooltipTrigger as Ky,Label as Gy,TooltipContent as Jy,Select as Qy,SelectTrigger as Yy,SelectValue as Zy,SelectContent as Hy,SelectGroup as Xy,SelectItem as ev,Switch as tv,Input as rv,cn as nv}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.786";import{useForm as iv,FormProvider as ov}from"https://cdn.jsdelivr.net/npm/react-hook-form@7.51.0/+esm";import{useSelector as ht}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{toast as $e}from"https://cdn.jsdelivr.net/npm/@wellesley/system-toast@1.0.168";import{api as Ct,fetchInterceptor as av,isSuccessResponse as sv,QueryTags as vu}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.824";import{getErrorMsg as Xn}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.673";import{authSlice as Jr,useHasUserPermissions as uv}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.880";import{userSlice as mu}from"https://cdn.jsdelivr.net/npm/@wellesley/user@1.0.839";import{AppsLink as cv}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.750";import{useMatch as _u}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";const lv=t=>{if("object"!=typeof t||null===t)return!1;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||null===Object.getPrototypeOf(t)},fv=t=>lv(t)&&"type"in t&&"string"==typeof t.type,F=t=>{const e=e=>({type:t,payload:e});return e.toString=()=>`${t}`,e.type=t,e.match=e=>fv(e)&&e.type===t,e};F("remoteReady"),F("askLogin"),F("reselectUser"),F("requestLogout"),F("setConfirmLeavePage"),F("requestChangePath"),F("wsSubscribe"),F("wsUnSubscribe"),F("hostStoreConnect"),F("remoteLogin"),F("remoteLogout"),F("wsOnMessage"),F("setRouterPath"),F("setDeviceType"),F("setDeviceWidth"),F("setUserError"),F("setUserIsError"),F("setUserPending"),F("setUserSuccess"),F("setUserData"),F("updateAccountData"),F("updateUser"),F("addNotification"),F("markNotification"),F("setNotificationsError"),F("setNotificationsList"),F("setNotificationsPending"),F("setNotificationsTotalCount"),F("setNotificationsUnreadCount"),F("acceptAllFollowRequests"),F("resetNotificationsState"),F("undoNotification"),F("setInstanceInfo"),F("setInstanceInfoPending"),F("setInstanceInfoError");const To=F("setPlatformSettings"),ni=F("setProfileSettings");F("setGroupData"),F("setGroupLoading"),F("requestLocalStorageGet"),F("requestLocalStorageSet"),F("requestLocalStorageRemove"),F("requestLocalStorageClear"),F("requestLocalStorageKeys"),F("requestLocalStorageHas"),F("sendLocalStorageResponse"),F("sendLocalStorageChanged");const Gr="8.48.0",gt=globalThis;function Fo(t,e,n){const r=gt,i=r.__SENTRY__=r.__SENTRY__||{},o=i[Gr]=i[Gr]||{};return o[t]||(o[t]=e())}const Bu=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,pv="Sentry Logger ",wu=["debug","info","warn","error","log","assert","trace"],xu={};function hv(t){if(!("console"in gt))return t();const e=gt.console,n={},r=Object.keys(xu);r.forEach((t=>{const r=xu[t];n[t]=e[t],e[t]=r}));try{return t()}finally{r.forEach((t=>{e[t]=n[t]}))}}function dv(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return Bu?wu.forEach((n=>{e[n]=(...e)=>{t&&hv((()=>{gt.console[n](`${pv}[${n}]:`,...e)}))}})):wu.forEach((t=>{e[t]=()=>{}})),e}const ii=Fo("logger",dv);function Bo(){return zo(gt),gt}function zo(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||Gr,e[Gr]=e[Gr]||{}}const gv=Object.prototype.toString;function yv(t,e){return gv.call(t)===`[object ${e}]`}function vv(t){return yv(t,"Object")}function mv(t){return!(!t||!t.then||"function"!=typeof t.then)}function _v(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{Bu&&ii.log(`Failed to add non-enumerable property "${e}" to object`,t)}}const zu=1e3;function Vu(){return Date.now()/zu}function wv(){const{performance:t}=gt;if(!t||!t.now)return Vu;const e=Date.now()-t.now(),n=null==t.timeOrigin?e:t.timeOrigin;return()=>(n+t.now())/zu}const xv=wv();function pr(){const t=gt,e=t.crypto||t.msCrypto;let n=()=>16*Math.random();try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const t=new Uint8Array(1);return e.getRandomValues(t),t[0]})}catch{}return"10000000100040008000100000000000".replace(/[018]/g,(t=>(t^(15&n())>>t/4).toString(16)))}function Sv(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||xv(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=32===e.sid.length?e.sid:pr()),void 0!==e.init&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),"number"==typeof e.started&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof e.duration)t.duration=e.duration;else{const e=t.timestamp-t.started;t.duration=e>=0?e:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),"number"==typeof e.errors&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Su(){return pr()}function bu(){return pr().substring(16)}function qu(t,e,n=2){if(!e||"object"!=typeof e||n<=0)return e;if(t&&e&&0===Object.keys(e).length)return t;const r={...t};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=qu(r[t],e[t],n-1));return r}(()=>{const{performance:t}=gt;if(!t||!t.now)return;const e=36e5,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,o=i<e,a=t.timing&&t.timing.navigationStart,s="number"==typeof a?Math.abs(a+n-r):e;(o||s<e)&&(i<=s&&t.timeOrigin)})();const Do="_sentrySpan";function Au(t,e){e?_v(t,Do,e):delete t[Do]}function Pu(t){return t[Do]}const bv=100;class Vo{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Su(),spanId:bu()}}clone(){const t=new Vo;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,Au(t,Pu(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Sv(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,e){return this._tags={...this._tags,[t]:e},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,e){return this._extra={...this._extra,[t]:e},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,e){return null===e?delete this._contexts[t]:this._contexts[t]=e,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const e="function"==typeof t?t(this):t,[n,r]=e instanceof Qr?[e.getScopeData(),e.getRequestSession()]:vv(e)?[t,t.requestSession]:[],{tags:i,extra:o,user:a,contexts:s,level:u,fingerprint:l=[],propagationContext:c}=n||{};return this._tags={...this._tags,...i},this._extra={...this._extra,...o},this._contexts={...this._contexts,...s},a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),l.length&&(this._fingerprint=l),c&&(this._propagationContext=c),r&&(this._requestSession=r),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,Au(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Su()}),this._notifyScopeListeners(),this}addBreadcrumb(t,e){const n="number"==typeof e?e:bv;if(n<=0)return this;const r={timestamp:Vu(),...t},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Pu(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=qu(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext={spanId:bu(),...t},this}getPropagationContext(){return this._propagationContext}captureException(t,e){const n=e&&e.event_id?e.event_id:pr();if(!this._client)return ii.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:r,...e,event_id:n},this),n}captureMessage(t,e,n){const r=n&&n.event_id?n.event_id:pr();if(!this._client)return ii.warn("No client configured on scope - will not capture message!"),r;const i=new Error(t);return this._client.captureMessage(t,e,{originalException:t,syntheticException:i,...n,event_id:r},this),r}captureEvent(t,e){const n=e&&e.event_id?e.event_id:pr();return this._client?(this._client.captureEvent(t,{...e,event_id:n},this),n):(ii.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}}const Qr=Vo;function Av(){return Fo("defaultCurrentScope",(()=>new Qr))}function Pv(){return Fo("defaultIsolationScope",(()=>new Qr))}class Iv{constructor(t,e){let n,r;n=t||new Qr,r=e||new Qr,this._stack=[{scope:n}],this._isolationScope=r}withScope(t){const e=this._pushScope();let n;try{n=t(e)}catch(t){throw this._popScope(),t}return mv(n)?n.then((t=>(this._popScope(),t)),(t=>{throw this._popScope(),t})):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function hr(){const t=zo(Bo());return t.stack=t.stack||new Iv(Av(),Pv())}function Rv(t){return hr().withScope(t)}function Ev(t,e){const n=hr();return n.withScope((()=>(n.getStackTop().scope=t,e(t))))}function Iu(t){return hr().withScope((()=>t(hr().getIsolationScope())))}function kv(){return{withIsolationScope:Iu,withScope:Rv,withSetScope:Ev,withSetIsolationScope:(t,e)=>Iu(e),getCurrentScope:()=>hr().getScope(),getIsolationScope:()=>hr().getIsolationScope()}}function $u(t){const e=zo(t);return e.acs?e.acs:kv()}function Ku(){return $u(Bo()).getCurrentScope()}function Cv(){return $u(Bo()).getIsolationScope()}function Ov(t,e){return Ku().captureException(t,void 0)}function jv(t,e){const n={captureContext:e};return Ku().captureMessage(t,void 0,n)}function Lv(t,e){Cv().setExtra(t,e)}var ei=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const Mv=(...t)=>{let e="";for(const n of t){if(n instanceof Error){const t=n;return Lv("exceptionMessage",e),void Ov(t)}if("object"!=typeof n)e+=n;else try{e+=" "+JSON.stringify(n)}catch{e+=" "+n}}jv(e)},Wv=()=>"object"!=typeof window,Nv="wlsy",Gu=()=>{try{return window.localStorage}catch(t){console.warn("Error getting window.localStorage storage",t)}},Tv=()=>{const t=new Set,e=Gu();if(!e)return[];for(let n=0;n<(null==e?void 0:e.length);n+=1){const r=null==e?void 0:e.key(n);"string"==typeof r&&t.add(r)}return Array.from(t)},Dv=t=>{const e=`${Nv}`,n=t=>`${e}:${t}`,r=()=>Tv().filter((t=>t.startsWith(`${e}:`))),i=t=>t.slice(e.length+1),o=Gu(),a=t=>{try{return null==o?void 0:o.getItem(n(t))}catch{return null}},s=(t,e)=>{try{null==o||o.setItem(n(t),String(e))}catch{return}};return{getItem:a,setItem:s,removeItem:t=>{try{null==o||o.removeItem(n(t))}catch{return}},clear:()=>{try{r().forEach((t=>null==o?void 0:o.removeItem(t)))}catch{return}},keys:()=>r().map(i),has:t=>null!==a(t),getJSON:t=>{const e=a(t);if(null==e)return null;try{return JSON.parse(e)}catch{return null}},setJSON:(t,e)=>{try{s(t,JSON.stringify(e))}catch{return}}}},Ru=["debug","info","warn","error"],Uv=(t,e)=>{const n=Ru.indexOf(t);return Ru.indexOf(e)>=n},ti=(t,e,n,...r)=>{Uv(e,t)&&console.log(`[${t}] ${n}`,...r)},Fv=()=>Dv().getItem("logger_lvl"),Bv=(t=(Wv()?"info":Fv()||"warn"))=>{let e=t;return{debug:(t,...n)=>ti("debug",e,t,...n),info:(t,...n)=>ti("info",e,t,...n),warn:(t,...n)=>ti("warn",e,t,...n),error:(t,...n)=>(Mv(t,...n),ti("error",e,t,...n)),setLevel:t=>{e=t},getLevel:()=>e}},Eu=Bv();Du("requestMicroFrontendFetch"),Du("sendMicroFrontendFetchResponse");const zv={data:null,isPending:!1,isSuccess:!1},Vv=Uu({name:"profileSettings",initialState:zv,reducers:{setPending:(t,e)=>{t.isPending=e.payload},setSuccess:(t,{payload:e})=>{t.isSuccess=e},setError:(t,{payload:e})=>{t.error=e}},extraReducers:t=>{t.addCase(ni,((t,{payload:e})=>{t.data=e}))},selectors:{selectProfileSettings:t=>t.data,selectPending:t=>t.isPending,selectError:t=>t.error,selectSuccess:t=>t.isSuccess}}),j={openaiConfigModel:"wellesley.openai.config.model",openaiConfigApiKey:"wellesley.openai.config.apiKey",uploadsProvider:"wellesley.uploads.provider",uploadsS3:"wellesley.uploads.s3",uploadsPolicyImageExtensions:"wellesley.uploads.policy.image.extensions",uploadsPolicyImageKeepOriginal:"wellesley.uploads.policy.image.keepOriginal",uploadsPolicyImageResolutions:"wellesley.uploads.policy.image.resolutions",uploadsPolicyImageMaxResolution:"wellesley.uploads.policy.image.maxResolution",uploadsPolicyImageMaxMatrix:"wellesley.uploads.policy.image.maxMatrix",uploadsPolicyImageMaxSize:"wellesley.uploads.policy.image.maxSize",uploadsPolicyVideoExtensions:"wellesley.uploads.policy.video.extensions",uploadsPolicyVideoResolutions:"wellesley.uploads.policy.video.resolutions",uploadsPolicyVideoKeepOriginal:"wellesley.uploads.policy.video.keepOriginal",uploadsPolicyVideoMaxResolution:"wellesley.uploads.policy.video.maxResolution",uploadsPolicyVideoMaxMatrix:"wellesley.uploads.policy.video.maxMatrix",uploadsPolicyVideoMaxSize:"wellesley.uploads.policy.video.maxSize",uploadsPolicyVideoMaxDuration:"wellesley.uploads.policy.video.maxDuration",uploadsPolicyVideoStreamingThreshold:"wellesley.uploads.policy.video.streamingThreshold",uploadsPolicyAudioExtensions:"wellesley.uploads.policy.audio.extensions",uploadsPolicyAudioKeepOriginal:"wellesley.uploads.policy.audio.keepOriginal",uploadsPolicyAudioMaxSize:"wellesley.uploads.policy.audio.maxSize",uploadsPolicyDocExtensions:"wellesley.uploads.policy.doc.extensions",uploadsPolicyDocMaxSize:"wellesley.uploads.policy.doc.maxSize",mediacacheEnabled:"wellesley.mediacache.enabled",mediacacheMaxTotalSize:"wellesley.mediacache.maxTotalSize",mediacacheMaxFileSize:"wellesley.mediacache.maxFileSize",mediacacheLimitPerRun:"wellesley.mediacache.limitPerRun",mediacacheSingleRun:"wellesley.mediacache.singleRun",mediacacheCheckInterval:"wellesley.mediacache.checkInterval",postsMaxMediaAttachments:"wellesley.posts.max_media_attachments",postsMaxCharacters:"wellesley.posts.max_characters",postsMaxPins:"wellesley.posts.max_pins",registrationMode:"wellesley.registration.mode",registrationInvitesEnabled:"wellesley.registration.invitesEnabled",registrationReasonToJoin:"wellesley.registration.reasonToJoin",registrationShowCaptcha:"wellesley.registration.showCaptcha",registrationNotAvailableMessage:"wellesley.registration.notAvailableMessage",captchaVerifyUrl:"wellesley.captcha.verifyUrl",captchaSecretKey:"wellesley.captcha.secretKey",captchaSiteKey:"wellesley.captcha.siteKey",confirmationCodeCodeExpirationMinutes:"wellesley.confirmationCode.codeExpirationMinutes",confirmationCodeCounterExpirationMinutes:"wellesley.confirmationCode.counterExpirationMinutes",confirmationCodeLimitStoreAttempts:"wellesley.confirmationCode.limitStoreAttempts",confirmationCodeLimitCheckAttempts:"wellesley.confirmationCode.limitCheckAttempts",translation:"wellesley.translation"},o_=[j.uploadsPolicyImageExtensions,j.uploadsPolicyImageKeepOriginal,j.uploadsPolicyImageResolutions,j.uploadsPolicyImageMaxResolution,j.uploadsPolicyImageMaxMatrix,j.uploadsPolicyImageMaxSize,j.uploadsPolicyVideoExtensions,j.uploadsPolicyVideoResolutions,j.uploadsPolicyVideoKeepOriginal,j.uploadsPolicyVideoMaxResolution,j.uploadsPolicyVideoMaxMatrix,j.uploadsPolicyVideoMaxSize,j.uploadsPolicyVideoMaxDuration,j.uploadsPolicyVideoStreamingThreshold,j.uploadsPolicyAudioExtensions,j.uploadsPolicyAudioKeepOriginal,j.uploadsPolicyAudioMaxSize,j.uploadsPolicyDocExtensions,j.uploadsPolicyDocMaxSize,j.mediacacheEnabled,j.mediacacheMaxTotalSize,j.mediacacheMaxFileSize,j.mediacacheLimitPerRun,j.mediacacheSingleRun,j.mediacacheCheckInterval,j.postsMaxMediaAttachments,j.postsMaxCharacters,j.postsMaxPins,j.registrationMode,j.registrationInvitesEnabled,j.registrationReasonToJoin,j.registrationShowCaptcha,j.registrationNotAvailableMessage],a_="wellesley",ne={followAutoAccept:"user.follow.autoAccept",notificationsPrefsEmailMuteEnabled:"user.notifications.prefs.email.mute.enabled",notificationsPrefsEmailMuteExpiresAt:"user.notifications.prefs.email.mute.expiresAt",notificationsPrefsEmailFollow:"user.notifications.prefs.email.follow",notificationsPrefsEmailFollowRequest:"user.notifications.prefs.email.followRequest",notificationsPrefsEmailLike:"user.notifications.prefs.email.like",notificationsPrefsEmailComment:"user.notifications.prefs.email.comment",notificationsPrefsEmailMention:"user.notifications.prefs.email.mention",notificationsPrefsEmailGroupInvite:"user.notifications.prefs.email.groupInvite",notificationsPrefsEmailRepost:"user.notifications.prefs.email.repost",notificationsPrefsEmailListPostCreate:"user.notifications.prefs.email.listPostCreate",notificationsPrefsEmailPostUpdate:"user.notifications.prefs.email.postUpdate",notificationsPrefsEmailPollVote:"user.notifications.prefs.email.pollVote",notificationsPrefsEmailEventInvite:"user.notifications.prefs.email.eventInvite",notificationsPrefsEmailEventCancel:"user.notifications.prefs.email.eventCancel",notificationsPrefsEmailEventJoin:"user.notifications.prefs.email.eventJoin",notificationsPrefsEmailEventUpdate:"user.notifications.prefs.email.eventUpdate",notificationsPrefsPushMuteEnabled:"user.notifications.prefs.push.mute.enabled",notificationsPrefsPushMuteExpiresAt:"user.notifications.prefs.push.mute.expiresAt",notificationsPrefsPushFollow:"user.notifications.prefs.push.follow",notificationsPrefsPushFollowRequest:"user.notifications.prefs.push.followRequest",notificationsPrefsPushLike:"user.notifications.prefs.push.like",notificationsPrefsPushComment:"user.notifications.prefs.push.comment",notificationsPrefsPushMention:"user.notifications.prefs.push.mention",notificationsPrefsPushGroupInvite:"user.notifications.prefs.push.groupInvite",notificationsPrefsPushRepost:"user.notifications.prefs.push.repost",notificationsPrefsPushListPostCreate:"user.notifications.prefs.push.listPostCreate",notificationsPrefsPushPostUpdate:"user.notifications.prefs.push.postUpdate",notificationsPrefsPushPollVote:"user.notifications.prefs.push.pollVote",notificationsPrefsPushEventInvite:"user.notifications.prefs.push.eventInvite",notificationsPrefsPushEventCancel:"user.notifications.prefs.push.eventCancel",notificationsPrefsPushEventJoin:"user.notifications.prefs.push.eventJoin",notificationsPrefsPushEventUpdate:"user.notifications.prefs.push.eventUpdate",notificationsPrefsSubscribeOnComment:"user.notifications.prefs.subscribeOnComment",notificationsPrefsSyncAcrossProfiles:"user.notifications.prefs.syncAcrossProfiles",notificationsShowPopup:"user.notifications.prefs.showPopup",notificationsPolicyBlockNonFollowers:"user.notifications.policy.blockNonFollowers",notificationsPolicyBlockNonFollowing:"user.notifications.policy.blockNonFollowing",notificationsPolicyBlockNonFollowingMessages:"user.notifications.policy.blockNonFollowingMessages",notificationsPolicyBlockNewAccounts:"user.notifications.policy.blockNewAccounts",privacyShowPublicPosts:"user.privacy.showPublicPosts",privacyShowProfilePage:"user.privacy.showProfilePage",privacyShowFollowers:"user.privacy.showFollowers",translation:"user.translation"},s_="user",qv=["wellesley.posts","wellesley.captcha","wellesley.registration","wellesley.access","wellesley.branding","wellesley.confirmationCode","wellesley.uploads.policy.doc","wellesley.uploads.policy.audio","wellesley.uploads.policy.image","wellesley.uploads.policy.video","wellesley.translation","wellesley.instance.admin","wellesley.instance.legal","wellesley.instance.domainBlocks","wellesley.instance.contacts"],$v=["wellesley.admin.sms","wellesley.admin.openai","wellesley.admin.uploads","wellesley.admin.captcha","wellesley.admin.language","wellesley.admin.mediacache","wellesley.admin.translation","wellesley.admin.link_service"],Kv={sms:"wellesley.admin.sms",openai:"wellesley.admin.openai",uploads:"wellesley.admin.uploads",captcha:"wellesley.admin.captcha",language:"wellesley.admin.language",mediacache:"wellesley.admin.mediacache",translation:"wellesley.admin.translation",link_service:"wellesley.admin.link_service"},Uo={posts:"wellesley.posts",translation:"wellesley.translation",registration:"wellesley.registration",confirmationCode:"wellesley.confirmationCode",uploadsPolicyDoc:"wellesley.uploads.policy.doc",uploadsPolicyAudio:"wellesley.uploads.policy.audio",uploadsPolicyImage:"wellesley.uploads.policy.image",uploadsPolicyVideo:"wellesley.uploads.policy.video",captcha:"wellesley.captcha",access:"wellesley.access",branding:"wellesley.branding",instanceAdmin:"wellesley.instance.admin",legal:"wellesley.instance.legal",domainBlocks:"wellesley.instance.domainBlocks",contacts:"wellesley.instance.contacts"},$r=t=>(null==t?void 0:t.map((t=>t.value||t)))||[],Gv={data:null,isPending:!1},{posts:Ro,uploadsPolicyDoc:ku,uploadsPolicyAudio:Eo,uploadsPolicyImage:ri,uploadsPolicyVideo:Vr,registration:Ju,captcha:Jv,instanceAdmin:Qv,branding:Yv,translation:Zv,domainBlocks:Hv,access:Xv}=Uo,{captcha:em,language:tm,translation:rm,openai:nm,link_service:im}=Kv,qt=t=>t.data,om=yt(qt,(t=>{var e,n,r;return{max_characters:(null==(e=null==t?void 0:t[Ro])?void 0:e.max_characters)||0,max_media_attachments:(null==(n=null==t?void 0:t[Ro])?void 0:n.max_media_attachments)||0,max_pins:(null==(r=null==t?void 0:t[Ro])?void 0:r.max_pins)||0}})),qo=yt(qt,(t=>{var e,n,r;return{...null==t?void 0:t[ri],maxSize:(null==(e=null==t?void 0:t[ri])?void 0:e.maxSize)||0,maxMatrix:(null==(n=null==t?void 0:t[ri])?void 0:n.maxMatrix)||0,maxResolution:(null==(r=null==t?void 0:t[ri])?void 0:r.maxResolution)||0}})),am=yt(qo,(t=>$r(t.extensions))),Qu=yt(qt,(t=>{var e,n,r,i;return{...null==t?void 0:t[Vr],maxSize:(null==(e=null==t?void 0:t[Vr])?void 0:e.maxSize)||0,maxMatrix:(null==(n=null==t?void 0:t[Vr])?void 0:n.maxMatrix)||0,maxDuration:(null==(r=null==t?void 0:t[Vr])?void 0:r.maxDuration)||0,maxResolution:(null==(i=null==t?void 0:t[Vr])?void 0:i.maxResolution)||0}})),Yu=yt(qt,(t=>{var e,n;return{...null==t?void 0:t[Eo],maxSize:null==(e=null==t?void 0:t[Eo])?void 0:e.maxSize,keepOriginal:(null==(n=null==t?void 0:t[Eo])?void 0:n.keepOriginal)||0}})),Zu=yt(qt,(t=>{var e;return{...null==t?void 0:t[ku],maxSize:(null==(e=null==t?void 0:t[ku])?void 0:e.maxSize)||0}})),Hu=yt([qo,Qu,Yu,Zu],((t,e,n,r)=>({IMAGE:$r(null==t?void 0:t.extensions),VIDEO:$r(null==e?void 0:e.extensions),AUDIO:$r(null==n?void 0:n.extensions),DOCUMENT:$r(null==r?void 0:r.extensions)}))),sm=yt(Hu,(t=>Object.keys(t).reduce(((e,n)=>[...e,...t[n]||[]]),[]))),um=yt(qt,(t=>{var e;return null==(e=null==t?void 0:t[Ju])?void 0:e.invites})),oi=Uu({name:"platformSettings",initialState:Gv,reducers:{setError:(t,e)=>{t.error=e.payload},setPending:(t,e)=>{t.isPending=e.payload}},extraReducers:t=>{t.addCase(To,((t,{payload:e})=>{t.data={...t.data,...e}}))},selectors:{selectSettings:qt,selectPostConfig:om,selectDocPolicy:Zu,selectImagePolicy:qo,selectVideoPolicy:Qu,selectAudioPolicy:Yu,selectInvitesEnabled:um,selectImageExtensions:am,selectSupportedExtensions:Hu,selectFullExtensionsList:sm,selectRegistration:t=>{var e;return null==(e=t.data)?void 0:e[Ju]},selectLanguageDetection:t=>{var e;return null==(e=t.data)?void 0:e[tm]},selectLanguageTranslation:t=>{var e;return null==(e=t.data)?void 0:e[rm]},selectOpenai:t=>{var e;return null==(e=t.data)?void 0:e[nm]},selectCaptcha:t=>{var e;return null==(e=t.data)?void 0:e[Jv]},selectAdminCaptcha:t=>{var e;return null==(e=t.data)?void 0:e[em]},selectPlatformTranslation:t=>{var e;return null==(e=t.data)?void 0:e[Zv]},selectAccess:t=>{var e;return null==(e=t.data)?void 0:e[Xv]},selectBranding:t=>{var e;return null==(e=t.data)?void 0:e[Yv]},selectLinkService:t=>{var e;return null==(e=t.data)?void 0:e[im]},selectInstanceAdmin:t=>{var e;return null==(e=t.data)?void 0:e[Qv]},selectLegal:t=>{var e;return null==(e=t.data)?void 0:e[Uo.legal]},selectDomainBlocks:t=>{var e;return null==(e=t.data)?void 0:e[Hv]},selectContacts:t=>{var e;return null==(e=t.data)?void 0:e[Uo.contacts]}}});var Cu,Ou,ko={exports:{}},qr={};
|
|
1
|
+
import{createAction as Du,createSlice as Uu,createSelector as yt}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import Ty,{useState as Dy,useEffect as Uy,forwardRef as Fu,createElement as No,useCallback as Fy}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{Checkbox as By,RadioGroup as zy,RadioGroupItem as Vy,TooltipProvider as qy,Tooltip as $y,TooltipTrigger as Ky,Label as Gy,TooltipContent as Jy,Select as Qy,SelectTrigger as Yy,SelectValue as Zy,SelectContent as Hy,SelectGroup as Xy,SelectItem as ev,Switch as tv,Input as rv,cn as nv}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.788";import{useForm as iv,FormProvider as ov}from"https://cdn.jsdelivr.net/npm/react-hook-form@7.51.0/+esm";import{useSelector as ht}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{toast as $e}from"https://cdn.jsdelivr.net/npm/@wellesley/system-toast@1.0.170";import{api as Ct,fetchInterceptor as av,isSuccessResponse as sv,QueryTags as vu}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.826";import{getErrorMsg as Xn}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.675";import{authSlice as Jr,useHasUserPermissions as uv}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.882";import{userSlice as mu}from"https://cdn.jsdelivr.net/npm/@wellesley/user@1.0.841";import{AppsLink as cv}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.752";import{useMatch as _u}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";const lv=t=>{if("object"!=typeof t||null===t)return!1;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||null===Object.getPrototypeOf(t)},fv=t=>lv(t)&&"type"in t&&"string"==typeof t.type,F=t=>{const e=e=>({type:t,payload:e});return e.toString=()=>`${t}`,e.type=t,e.match=e=>fv(e)&&e.type===t,e};F("remoteReady"),F("askLogin"),F("reselectUser"),F("requestLogout"),F("setConfirmLeavePage"),F("requestChangePath"),F("wsSubscribe"),F("wsUnSubscribe"),F("hostStoreConnect"),F("remoteLogin"),F("remoteLogout"),F("wsOnMessage"),F("setRouterPath"),F("setDeviceType"),F("setDeviceWidth"),F("setUserError"),F("setUserIsError"),F("setUserPending"),F("setUserSuccess"),F("setUserData"),F("updateAccountData"),F("updateUser"),F("addNotification"),F("markNotification"),F("setNotificationsError"),F("setNotificationsList"),F("setNotificationsPending"),F("setNotificationsTotalCount"),F("setNotificationsUnreadCount"),F("acceptAllFollowRequests"),F("resetNotificationsState"),F("undoNotification"),F("setInstanceInfo"),F("setInstanceInfoPending"),F("setInstanceInfoError");const To=F("setPlatformSettings"),ni=F("setProfileSettings");F("setGroupData"),F("setGroupLoading"),F("requestLocalStorageGet"),F("requestLocalStorageSet"),F("requestLocalStorageRemove"),F("requestLocalStorageClear"),F("requestLocalStorageKeys"),F("requestLocalStorageHas"),F("sendLocalStorageResponse"),F("sendLocalStorageChanged");const Gr="8.48.0",gt=globalThis;function Fo(t,e,n){const r=gt,i=r.__SENTRY__=r.__SENTRY__||{},o=i[Gr]=i[Gr]||{};return o[t]||(o[t]=e())}const Bu=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,pv="Sentry Logger ",wu=["debug","info","warn","error","log","assert","trace"],xu={};function hv(t){if(!("console"in gt))return t();const e=gt.console,n={},r=Object.keys(xu);r.forEach((t=>{const r=xu[t];n[t]=e[t],e[t]=r}));try{return t()}finally{r.forEach((t=>{e[t]=n[t]}))}}function dv(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return Bu?wu.forEach((n=>{e[n]=(...e)=>{t&&hv((()=>{gt.console[n](`${pv}[${n}]:`,...e)}))}})):wu.forEach((t=>{e[t]=()=>{}})),e}const ii=Fo("logger",dv);function Bo(){return zo(gt),gt}function zo(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||Gr,e[Gr]=e[Gr]||{}}const gv=Object.prototype.toString;function yv(t,e){return gv.call(t)===`[object ${e}]`}function vv(t){return yv(t,"Object")}function mv(t){return!(!t||!t.then||"function"!=typeof t.then)}function _v(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{Bu&&ii.log(`Failed to add non-enumerable property "${e}" to object`,t)}}const zu=1e3;function Vu(){return Date.now()/zu}function wv(){const{performance:t}=gt;if(!t||!t.now)return Vu;const e=Date.now()-t.now(),n=null==t.timeOrigin?e:t.timeOrigin;return()=>(n+t.now())/zu}const xv=wv();function pr(){const t=gt,e=t.crypto||t.msCrypto;let n=()=>16*Math.random();try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const t=new Uint8Array(1);return e.getRandomValues(t),t[0]})}catch{}return"10000000100040008000100000000000".replace(/[018]/g,(t=>(t^(15&n())>>t/4).toString(16)))}function Sv(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||xv(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=32===e.sid.length?e.sid:pr()),void 0!==e.init&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),"number"==typeof e.started&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof e.duration)t.duration=e.duration;else{const e=t.timestamp-t.started;t.duration=e>=0?e:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),"number"==typeof e.errors&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Su(){return pr()}function bu(){return pr().substring(16)}function qu(t,e,n=2){if(!e||"object"!=typeof e||n<=0)return e;if(t&&e&&0===Object.keys(e).length)return t;const r={...t};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=qu(r[t],e[t],n-1));return r}(()=>{const{performance:t}=gt;if(!t||!t.now)return;const e=36e5,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,o=i<e,a=t.timing&&t.timing.navigationStart,s="number"==typeof a?Math.abs(a+n-r):e;(o||s<e)&&(i<=s&&t.timeOrigin)})();const Do="_sentrySpan";function Au(t,e){e?_v(t,Do,e):delete t[Do]}function Pu(t){return t[Do]}const bv=100;class Vo{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Su(),spanId:bu()}}clone(){const t=new Vo;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,Au(t,Pu(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Sv(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,e){return this._tags={...this._tags,[t]:e},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,e){return this._extra={...this._extra,[t]:e},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,e){return null===e?delete this._contexts[t]:this._contexts[t]=e,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const e="function"==typeof t?t(this):t,[n,r]=e instanceof Qr?[e.getScopeData(),e.getRequestSession()]:vv(e)?[t,t.requestSession]:[],{tags:i,extra:o,user:a,contexts:s,level:u,fingerprint:l=[],propagationContext:c}=n||{};return this._tags={...this._tags,...i},this._extra={...this._extra,...o},this._contexts={...this._contexts,...s},a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),l.length&&(this._fingerprint=l),c&&(this._propagationContext=c),r&&(this._requestSession=r),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,Au(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Su()}),this._notifyScopeListeners(),this}addBreadcrumb(t,e){const n="number"==typeof e?e:bv;if(n<=0)return this;const r={timestamp:Vu(),...t},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Pu(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=qu(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext={spanId:bu(),...t},this}getPropagationContext(){return this._propagationContext}captureException(t,e){const n=e&&e.event_id?e.event_id:pr();if(!this._client)return ii.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:r,...e,event_id:n},this),n}captureMessage(t,e,n){const r=n&&n.event_id?n.event_id:pr();if(!this._client)return ii.warn("No client configured on scope - will not capture message!"),r;const i=new Error(t);return this._client.captureMessage(t,e,{originalException:t,syntheticException:i,...n,event_id:r},this),r}captureEvent(t,e){const n=e&&e.event_id?e.event_id:pr();return this._client?(this._client.captureEvent(t,{...e,event_id:n},this),n):(ii.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}}const Qr=Vo;function Av(){return Fo("defaultCurrentScope",(()=>new Qr))}function Pv(){return Fo("defaultIsolationScope",(()=>new Qr))}class Iv{constructor(t,e){let n,r;n=t||new Qr,r=e||new Qr,this._stack=[{scope:n}],this._isolationScope=r}withScope(t){const e=this._pushScope();let n;try{n=t(e)}catch(t){throw this._popScope(),t}return mv(n)?n.then((t=>(this._popScope(),t)),(t=>{throw this._popScope(),t})):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function hr(){const t=zo(Bo());return t.stack=t.stack||new Iv(Av(),Pv())}function Rv(t){return hr().withScope(t)}function Ev(t,e){const n=hr();return n.withScope((()=>(n.getStackTop().scope=t,e(t))))}function Iu(t){return hr().withScope((()=>t(hr().getIsolationScope())))}function kv(){return{withIsolationScope:Iu,withScope:Rv,withSetScope:Ev,withSetIsolationScope:(t,e)=>Iu(e),getCurrentScope:()=>hr().getScope(),getIsolationScope:()=>hr().getIsolationScope()}}function $u(t){const e=zo(t);return e.acs?e.acs:kv()}function Ku(){return $u(Bo()).getCurrentScope()}function Cv(){return $u(Bo()).getIsolationScope()}function Ov(t,e){return Ku().captureException(t,void 0)}function jv(t,e){const n={captureContext:e};return Ku().captureMessage(t,void 0,n)}function Lv(t,e){Cv().setExtra(t,e)}var ei=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const Mv=(...t)=>{let e="";for(const n of t){if(n instanceof Error){const t=n;return Lv("exceptionMessage",e),void Ov(t)}if("object"!=typeof n)e+=n;else try{e+=" "+JSON.stringify(n)}catch{e+=" "+n}}jv(e)},Wv=()=>"object"!=typeof window,Nv="wlsy",Gu=()=>{try{return window.localStorage}catch(t){console.warn("Error getting window.localStorage storage",t)}},Tv=()=>{const t=new Set,e=Gu();if(!e)return[];for(let n=0;n<(null==e?void 0:e.length);n+=1){const r=null==e?void 0:e.key(n);"string"==typeof r&&t.add(r)}return Array.from(t)},Dv=t=>{const e=`${Nv}`,n=t=>`${e}:${t}`,r=()=>Tv().filter((t=>t.startsWith(`${e}:`))),i=t=>t.slice(e.length+1),o=Gu(),a=t=>{try{return null==o?void 0:o.getItem(n(t))}catch{return null}},s=(t,e)=>{try{null==o||o.setItem(n(t),String(e))}catch{return}};return{getItem:a,setItem:s,removeItem:t=>{try{null==o||o.removeItem(n(t))}catch{return}},clear:()=>{try{r().forEach((t=>null==o?void 0:o.removeItem(t)))}catch{return}},keys:()=>r().map(i),has:t=>null!==a(t),getJSON:t=>{const e=a(t);if(null==e)return null;try{return JSON.parse(e)}catch{return null}},setJSON:(t,e)=>{try{s(t,JSON.stringify(e))}catch{return}}}},Ru=["debug","info","warn","error"],Uv=(t,e)=>{const n=Ru.indexOf(t);return Ru.indexOf(e)>=n},ti=(t,e,n,...r)=>{Uv(e,t)&&console.log(`[${t}] ${n}`,...r)},Fv=()=>Dv().getItem("logger_lvl"),Bv=(t=(Wv()?"info":Fv()||"warn"))=>{let e=t;return{debug:(t,...n)=>ti("debug",e,t,...n),info:(t,...n)=>ti("info",e,t,...n),warn:(t,...n)=>ti("warn",e,t,...n),error:(t,...n)=>(Mv(t,...n),ti("error",e,t,...n)),setLevel:t=>{e=t},getLevel:()=>e}},Eu=Bv();Du("requestMicroFrontendFetch"),Du("sendMicroFrontendFetchResponse");const zv={data:null,isPending:!1,isSuccess:!1},Vv=Uu({name:"profileSettings",initialState:zv,reducers:{setPending:(t,e)=>{t.isPending=e.payload},setSuccess:(t,{payload:e})=>{t.isSuccess=e},setError:(t,{payload:e})=>{t.error=e}},extraReducers:t=>{t.addCase(ni,((t,{payload:e})=>{t.data=e}))},selectors:{selectProfileSettings:t=>t.data,selectPending:t=>t.isPending,selectError:t=>t.error,selectSuccess:t=>t.isSuccess}}),j={openaiConfigModel:"wellesley.openai.config.model",openaiConfigApiKey:"wellesley.openai.config.apiKey",uploadsProvider:"wellesley.uploads.provider",uploadsS3:"wellesley.uploads.s3",uploadsPolicyImageExtensions:"wellesley.uploads.policy.image.extensions",uploadsPolicyImageKeepOriginal:"wellesley.uploads.policy.image.keepOriginal",uploadsPolicyImageResolutions:"wellesley.uploads.policy.image.resolutions",uploadsPolicyImageMaxResolution:"wellesley.uploads.policy.image.maxResolution",uploadsPolicyImageMaxMatrix:"wellesley.uploads.policy.image.maxMatrix",uploadsPolicyImageMaxSize:"wellesley.uploads.policy.image.maxSize",uploadsPolicyVideoExtensions:"wellesley.uploads.policy.video.extensions",uploadsPolicyVideoResolutions:"wellesley.uploads.policy.video.resolutions",uploadsPolicyVideoKeepOriginal:"wellesley.uploads.policy.video.keepOriginal",uploadsPolicyVideoMaxResolution:"wellesley.uploads.policy.video.maxResolution",uploadsPolicyVideoMaxMatrix:"wellesley.uploads.policy.video.maxMatrix",uploadsPolicyVideoMaxSize:"wellesley.uploads.policy.video.maxSize",uploadsPolicyVideoMaxDuration:"wellesley.uploads.policy.video.maxDuration",uploadsPolicyVideoStreamingThreshold:"wellesley.uploads.policy.video.streamingThreshold",uploadsPolicyAudioExtensions:"wellesley.uploads.policy.audio.extensions",uploadsPolicyAudioKeepOriginal:"wellesley.uploads.policy.audio.keepOriginal",uploadsPolicyAudioMaxSize:"wellesley.uploads.policy.audio.maxSize",uploadsPolicyDocExtensions:"wellesley.uploads.policy.doc.extensions",uploadsPolicyDocMaxSize:"wellesley.uploads.policy.doc.maxSize",mediacacheEnabled:"wellesley.mediacache.enabled",mediacacheMaxTotalSize:"wellesley.mediacache.maxTotalSize",mediacacheMaxFileSize:"wellesley.mediacache.maxFileSize",mediacacheLimitPerRun:"wellesley.mediacache.limitPerRun",mediacacheSingleRun:"wellesley.mediacache.singleRun",mediacacheCheckInterval:"wellesley.mediacache.checkInterval",postsMaxMediaAttachments:"wellesley.posts.max_media_attachments",postsMaxCharacters:"wellesley.posts.max_characters",postsMaxPins:"wellesley.posts.max_pins",registrationMode:"wellesley.registration.mode",registrationInvitesEnabled:"wellesley.registration.invitesEnabled",registrationReasonToJoin:"wellesley.registration.reasonToJoin",registrationShowCaptcha:"wellesley.registration.showCaptcha",registrationNotAvailableMessage:"wellesley.registration.notAvailableMessage",captchaVerifyUrl:"wellesley.captcha.verifyUrl",captchaSecretKey:"wellesley.captcha.secretKey",captchaSiteKey:"wellesley.captcha.siteKey",confirmationCodeCodeExpirationMinutes:"wellesley.confirmationCode.codeExpirationMinutes",confirmationCodeCounterExpirationMinutes:"wellesley.confirmationCode.counterExpirationMinutes",confirmationCodeLimitStoreAttempts:"wellesley.confirmationCode.limitStoreAttempts",confirmationCodeLimitCheckAttempts:"wellesley.confirmationCode.limitCheckAttempts",translation:"wellesley.translation"},o_=[j.uploadsPolicyImageExtensions,j.uploadsPolicyImageKeepOriginal,j.uploadsPolicyImageResolutions,j.uploadsPolicyImageMaxResolution,j.uploadsPolicyImageMaxMatrix,j.uploadsPolicyImageMaxSize,j.uploadsPolicyVideoExtensions,j.uploadsPolicyVideoResolutions,j.uploadsPolicyVideoKeepOriginal,j.uploadsPolicyVideoMaxResolution,j.uploadsPolicyVideoMaxMatrix,j.uploadsPolicyVideoMaxSize,j.uploadsPolicyVideoMaxDuration,j.uploadsPolicyVideoStreamingThreshold,j.uploadsPolicyAudioExtensions,j.uploadsPolicyAudioKeepOriginal,j.uploadsPolicyAudioMaxSize,j.uploadsPolicyDocExtensions,j.uploadsPolicyDocMaxSize,j.mediacacheEnabled,j.mediacacheMaxTotalSize,j.mediacacheMaxFileSize,j.mediacacheLimitPerRun,j.mediacacheSingleRun,j.mediacacheCheckInterval,j.postsMaxMediaAttachments,j.postsMaxCharacters,j.postsMaxPins,j.registrationMode,j.registrationInvitesEnabled,j.registrationReasonToJoin,j.registrationShowCaptcha,j.registrationNotAvailableMessage],a_="wellesley",ne={followAutoAccept:"user.follow.autoAccept",notificationsPrefsEmailMuteEnabled:"user.notifications.prefs.email.mute.enabled",notificationsPrefsEmailMuteExpiresAt:"user.notifications.prefs.email.mute.expiresAt",notificationsPrefsEmailFollow:"user.notifications.prefs.email.follow",notificationsPrefsEmailFollowRequest:"user.notifications.prefs.email.followRequest",notificationsPrefsEmailLike:"user.notifications.prefs.email.like",notificationsPrefsEmailComment:"user.notifications.prefs.email.comment",notificationsPrefsEmailMention:"user.notifications.prefs.email.mention",notificationsPrefsEmailGroupInvite:"user.notifications.prefs.email.groupInvite",notificationsPrefsEmailRepost:"user.notifications.prefs.email.repost",notificationsPrefsEmailListPostCreate:"user.notifications.prefs.email.listPostCreate",notificationsPrefsEmailPostUpdate:"user.notifications.prefs.email.postUpdate",notificationsPrefsEmailPollVote:"user.notifications.prefs.email.pollVote",notificationsPrefsEmailEventInvite:"user.notifications.prefs.email.eventInvite",notificationsPrefsEmailEventCancel:"user.notifications.prefs.email.eventCancel",notificationsPrefsEmailEventJoin:"user.notifications.prefs.email.eventJoin",notificationsPrefsEmailEventUpdate:"user.notifications.prefs.email.eventUpdate",notificationsPrefsPushMuteEnabled:"user.notifications.prefs.push.mute.enabled",notificationsPrefsPushMuteExpiresAt:"user.notifications.prefs.push.mute.expiresAt",notificationsPrefsPushFollow:"user.notifications.prefs.push.follow",notificationsPrefsPushFollowRequest:"user.notifications.prefs.push.followRequest",notificationsPrefsPushLike:"user.notifications.prefs.push.like",notificationsPrefsPushComment:"user.notifications.prefs.push.comment",notificationsPrefsPushMention:"user.notifications.prefs.push.mention",notificationsPrefsPushGroupInvite:"user.notifications.prefs.push.groupInvite",notificationsPrefsPushRepost:"user.notifications.prefs.push.repost",notificationsPrefsPushListPostCreate:"user.notifications.prefs.push.listPostCreate",notificationsPrefsPushPostUpdate:"user.notifications.prefs.push.postUpdate",notificationsPrefsPushPollVote:"user.notifications.prefs.push.pollVote",notificationsPrefsPushEventInvite:"user.notifications.prefs.push.eventInvite",notificationsPrefsPushEventCancel:"user.notifications.prefs.push.eventCancel",notificationsPrefsPushEventJoin:"user.notifications.prefs.push.eventJoin",notificationsPrefsPushEventUpdate:"user.notifications.prefs.push.eventUpdate",notificationsPrefsSubscribeOnComment:"user.notifications.prefs.subscribeOnComment",notificationsPrefsSyncAcrossProfiles:"user.notifications.prefs.syncAcrossProfiles",notificationsShowPopup:"user.notifications.prefs.showPopup",notificationsPolicyBlockNonFollowers:"user.notifications.policy.blockNonFollowers",notificationsPolicyBlockNonFollowing:"user.notifications.policy.blockNonFollowing",notificationsPolicyBlockNonFollowingMessages:"user.notifications.policy.blockNonFollowingMessages",notificationsPolicyBlockNewAccounts:"user.notifications.policy.blockNewAccounts",privacyShowPublicPosts:"user.privacy.showPublicPosts",privacyShowProfilePage:"user.privacy.showProfilePage",privacyShowFollowers:"user.privacy.showFollowers",translation:"user.translation"},s_="user",qv=["wellesley.posts","wellesley.captcha","wellesley.registration","wellesley.access","wellesley.branding","wellesley.confirmationCode","wellesley.uploads.policy.doc","wellesley.uploads.policy.audio","wellesley.uploads.policy.image","wellesley.uploads.policy.video","wellesley.translation","wellesley.instance.admin","wellesley.instance.legal","wellesley.instance.domainBlocks","wellesley.instance.contacts"],$v=["wellesley.admin.sms","wellesley.admin.openai","wellesley.admin.uploads","wellesley.admin.captcha","wellesley.admin.language","wellesley.admin.mediacache","wellesley.admin.translation","wellesley.admin.link_service"],Kv={sms:"wellesley.admin.sms",openai:"wellesley.admin.openai",uploads:"wellesley.admin.uploads",captcha:"wellesley.admin.captcha",language:"wellesley.admin.language",mediacache:"wellesley.admin.mediacache",translation:"wellesley.admin.translation",link_service:"wellesley.admin.link_service"},Uo={posts:"wellesley.posts",translation:"wellesley.translation",registration:"wellesley.registration",confirmationCode:"wellesley.confirmationCode",uploadsPolicyDoc:"wellesley.uploads.policy.doc",uploadsPolicyAudio:"wellesley.uploads.policy.audio",uploadsPolicyImage:"wellesley.uploads.policy.image",uploadsPolicyVideo:"wellesley.uploads.policy.video",captcha:"wellesley.captcha",access:"wellesley.access",branding:"wellesley.branding",instanceAdmin:"wellesley.instance.admin",legal:"wellesley.instance.legal",domainBlocks:"wellesley.instance.domainBlocks",contacts:"wellesley.instance.contacts"},$r=t=>(null==t?void 0:t.map((t=>t.value||t)))||[],Gv={data:null,isPending:!1},{posts:Ro,uploadsPolicyDoc:ku,uploadsPolicyAudio:Eo,uploadsPolicyImage:ri,uploadsPolicyVideo:Vr,registration:Ju,captcha:Jv,instanceAdmin:Qv,branding:Yv,translation:Zv,domainBlocks:Hv,access:Xv}=Uo,{captcha:em,language:tm,translation:rm,openai:nm,link_service:im}=Kv,qt=t=>t.data,om=yt(qt,(t=>{var e,n,r;return{max_characters:(null==(e=null==t?void 0:t[Ro])?void 0:e.max_characters)||0,max_media_attachments:(null==(n=null==t?void 0:t[Ro])?void 0:n.max_media_attachments)||0,max_pins:(null==(r=null==t?void 0:t[Ro])?void 0:r.max_pins)||0}})),qo=yt(qt,(t=>{var e,n,r;return{...null==t?void 0:t[ri],maxSize:(null==(e=null==t?void 0:t[ri])?void 0:e.maxSize)||0,maxMatrix:(null==(n=null==t?void 0:t[ri])?void 0:n.maxMatrix)||0,maxResolution:(null==(r=null==t?void 0:t[ri])?void 0:r.maxResolution)||0}})),am=yt(qo,(t=>$r(t.extensions))),Qu=yt(qt,(t=>{var e,n,r,i;return{...null==t?void 0:t[Vr],maxSize:(null==(e=null==t?void 0:t[Vr])?void 0:e.maxSize)||0,maxMatrix:(null==(n=null==t?void 0:t[Vr])?void 0:n.maxMatrix)||0,maxDuration:(null==(r=null==t?void 0:t[Vr])?void 0:r.maxDuration)||0,maxResolution:(null==(i=null==t?void 0:t[Vr])?void 0:i.maxResolution)||0}})),Yu=yt(qt,(t=>{var e,n;return{...null==t?void 0:t[Eo],maxSize:null==(e=null==t?void 0:t[Eo])?void 0:e.maxSize,keepOriginal:(null==(n=null==t?void 0:t[Eo])?void 0:n.keepOriginal)||0}})),Zu=yt(qt,(t=>{var e;return{...null==t?void 0:t[ku],maxSize:(null==(e=null==t?void 0:t[ku])?void 0:e.maxSize)||0}})),Hu=yt([qo,Qu,Yu,Zu],((t,e,n,r)=>({IMAGE:$r(null==t?void 0:t.extensions),VIDEO:$r(null==e?void 0:e.extensions),AUDIO:$r(null==n?void 0:n.extensions),DOCUMENT:$r(null==r?void 0:r.extensions)}))),sm=yt(Hu,(t=>Object.keys(t).reduce(((e,n)=>[...e,...t[n]||[]]),[]))),um=yt(qt,(t=>{var e;return null==(e=null==t?void 0:t[Ju])?void 0:e.invites})),oi=Uu({name:"platformSettings",initialState:Gv,reducers:{setError:(t,e)=>{t.error=e.payload},setPending:(t,e)=>{t.isPending=e.payload}},extraReducers:t=>{t.addCase(To,((t,{payload:e})=>{t.data={...t.data,...e}}))},selectors:{selectSettings:qt,selectPostConfig:om,selectDocPolicy:Zu,selectImagePolicy:qo,selectVideoPolicy:Qu,selectAudioPolicy:Yu,selectInvitesEnabled:um,selectImageExtensions:am,selectSupportedExtensions:Hu,selectFullExtensionsList:sm,selectRegistration:t=>{var e;return null==(e=t.data)?void 0:e[Ju]},selectLanguageDetection:t=>{var e;return null==(e=t.data)?void 0:e[tm]},selectLanguageTranslation:t=>{var e;return null==(e=t.data)?void 0:e[rm]},selectOpenai:t=>{var e;return null==(e=t.data)?void 0:e[nm]},selectCaptcha:t=>{var e;return null==(e=t.data)?void 0:e[Jv]},selectAdminCaptcha:t=>{var e;return null==(e=t.data)?void 0:e[em]},selectPlatformTranslation:t=>{var e;return null==(e=t.data)?void 0:e[Zv]},selectAccess:t=>{var e;return null==(e=t.data)?void 0:e[Xv]},selectBranding:t=>{var e;return null==(e=t.data)?void 0:e[Yv]},selectLinkService:t=>{var e;return null==(e=t.data)?void 0:e[im]},selectInstanceAdmin:t=>{var e;return null==(e=t.data)?void 0:e[Qv]},selectLegal:t=>{var e;return null==(e=t.data)?void 0:e[Uo.legal]},selectDomainBlocks:t=>{var e;return null==(e=t.data)?void 0:e[Hv]},selectContacts:t=>{var e;return null==(e=t.data)?void 0:e[Uo.contacts]}}});var Cu,Ou,ko={exports:{}},qr={};
|
|
2
2
|
/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.min.js
|
package/package.json
CHANGED