@edusight/notification-widget 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -0
- package/dist/components/EmptyState.d.ts +7 -0
- package/dist/components/EmptyState.d.ts.map +1 -0
- package/dist/components/NotificationBell.d.ts +8 -0
- package/dist/components/NotificationBell.d.ts.map +1 -0
- package/dist/components/NotificationCenter.d.ts +18 -0
- package/dist/components/NotificationCenter.d.ts.map +1 -0
- package/dist/components/NotificationGroup.d.ts +13 -0
- package/dist/components/NotificationGroup.d.ts.map +1 -0
- package/dist/components/NotificationItem.d.ts +10 -0
- package/dist/components/NotificationItem.d.ts.map +1 -0
- package/dist/components/NotificationList.d.ts +16 -0
- package/dist/components/NotificationList.d.ts.map +1 -0
- package/dist/components/Preferences.d.ts +10 -0
- package/dist/components/Preferences.d.ts.map +1 -0
- package/dist/hooks/useNotificationCenter.d.ts +22 -0
- package/dist/hooks/useNotificationCenter.d.ts.map +1 -0
- package/dist/hooks/useNotifications.d.ts +21 -0
- package/dist/hooks/useNotifications.d.ts.map +1 -0
- package/dist/hooks/useWebSocket.d.ts +20 -0
- package/dist/hooks/useWebSocket.d.ts.map +1 -0
- package/dist/index.cjs.js +48 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +5038 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/interfaces/notification-client.interface.d.ts +3 -0
- package/dist/interfaces/notification-client.interface.d.ts.map +1 -0
- package/dist/notification-widget.css +1 -0
- package/dist/services/websocket-service.d.ts +35 -0
- package/dist/services/websocket-service.d.ts.map +1 -0
- package/dist/theme/notification-theme.d.ts +3 -0
- package/dist/theme/notification-theme.d.ts.map +1 -0
- package/package.json +100 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("react"),P=require("@mui/material"),Fe=require("@edusight/notification-sdk"),no=require("@emotion/styled");require("@emotion/react");function oo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Pe=oo(Z);function io(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pt={exports:{}},tt={};var wr;function ao(){if(wr)return tt;wr=1;var e=Z,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function c(u,f,d){var m,p={},h=null,y=null;d!==void 0&&(h=""+d),f.key!==void 0&&(h=""+f.key),f.ref!==void 0&&(y=f.ref);for(m in f)n.call(f,m)&&!i.hasOwnProperty(m)&&(p[m]=f[m]);if(u&&u.defaultProps)for(m in f=u.defaultProps,f)p[m]===void 0&&(p[m]=f[m]);return{$$typeof:t,type:u,key:h,ref:y,props:p,_owner:o.current}}return tt.Fragment=r,tt.jsx=c,tt.jsxs=c,tt}var rt={};var Or;function so(){return Or||(Or=1,process.env.NODE_ENV!=="production"&&(function(){var e=Z,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),b=Symbol.iterator,l="@@iterator";function T(s){if(s===null||typeof s!="object")return null;var v=b&&s[b]||s[l];return typeof v=="function"?v:null}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(s){{for(var v=arguments.length,R=new Array(v>1?v-1:0),I=1;I<v;I++)R[I-1]=arguments[I];A("error",s,R)}}function A(s,v,R){{var I=S.ReactDebugCurrentFrame,J=I.getStackAddendum();J!==""&&(v+="%s",R=R.concat([J]));var ne=R.map(function(U){return String(U)});ne.unshift("Warning: "+v),Function.prototype.apply.call(console[s],console,ne)}}var $=!1,E=!1,K=!1,ae=!1,re=!1,z;z=Symbol.for("react.module.reference");function a(s){return!!(typeof s=="string"||typeof s=="function"||s===n||s===i||re||s===o||s===d||s===m||ae||s===y||$||E||K||typeof s=="object"&&s!==null&&(s.$$typeof===h||s.$$typeof===p||s.$$typeof===c||s.$$typeof===u||s.$$typeof===f||s.$$typeof===z||s.getModuleId!==void 0))}function _(s,v,R){var I=s.displayName;if(I)return I;var J=v.displayName||v.name||"";return J!==""?R+"("+J+")":R}function G(s){return s.displayName||"Context"}function D(s){if(s==null)return null;if(typeof s.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case n:return"Fragment";case r:return"Portal";case i:return"Profiler";case o:return"StrictMode";case d:return"Suspense";case m:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case u:var v=s;return G(v)+".Consumer";case c:var R=s;return G(R._context)+".Provider";case f:return _(s,s.render,"ForwardRef");case p:var I=s.displayName||null;return I!==null?I:D(s.type)||"Memo";case h:{var J=s,ne=J._payload,U=J._init;try{return D(U(ne))}catch{return null}}}return null}var fe=Object.assign,ce=0,he,ve,De,ze,C,k,F;function B(){}B.__reactDisabledLog=!0;function N(){{if(ce===0){he=console.log,ve=console.info,De=console.warn,ze=console.error,C=console.group,k=console.groupCollapsed,F=console.groupEnd;var s={configurable:!0,enumerable:!0,value:B,writable:!0};Object.defineProperties(console,{info:s,log:s,warn:s,error:s,group:s,groupCollapsed:s,groupEnd:s})}ce++}}function Y(){{if(ce--,ce===0){var s={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:fe({},s,{value:he}),info:fe({},s,{value:ve}),warn:fe({},s,{value:De}),error:fe({},s,{value:ze}),group:fe({},s,{value:C}),groupCollapsed:fe({},s,{value:k}),groupEnd:fe({},s,{value:F})})}ce<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var j=S.ReactCurrentDispatcher,M;function L(s,v,R){{if(M===void 0)try{throw Error()}catch(J){var I=J.stack.trim().match(/\n( *(at )?)/);M=I&&I[1]||""}return`
|
|
2
|
+
`+M+s}}var q=!1,V;{var ge=typeof WeakMap=="function"?WeakMap:Map;V=new ge}function O(s,v){if(!s||q)return"";{var R=V.get(s);if(R!==void 0)return R}var I;q=!0;var J=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ne;ne=j.current,j.current=null,N();try{if(v){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(be){I=be}Reflect.construct(s,[],U)}else{try{U.call()}catch(be){I=be}s.call(U.prototype)}}else{try{throw Error()}catch(be){I=be}s()}}catch(be){if(be&&I&&typeof be.stack=="string"){for(var W=be.stack.split(`
|
|
3
|
+
`),ye=I.stack.split(`
|
|
4
|
+
`),de=W.length-1,me=ye.length-1;de>=1&&me>=0&&W[de]!==ye[me];)me--;for(;de>=1&&me>=0;de--,me--)if(W[de]!==ye[me]){if(de!==1||me!==1)do if(de--,me--,me<0||W[de]!==ye[me]){var xe=`
|
|
5
|
+
`+W[de].replace(" at new "," at ");return s.displayName&&xe.includes("<anonymous>")&&(xe=xe.replace("<anonymous>",s.displayName)),typeof s=="function"&&V.set(s,xe),xe}while(de>=1&&me>=0);break}}}finally{q=!1,j.current=ne,Y(),Error.prepareStackTrace=J}var Ge=s?s.displayName||s.name:"",Be=Ge?L(Ge):"";return typeof s=="function"&&V.set(s,Be),Be}function Ce(s,v,R){return O(s,!1)}function Ye(s){var v=s.prototype;return!!(v&&v.isReactComponent)}function Me(s,v,R){if(s==null)return"";if(typeof s=="function")return O(s,Ye(s));if(typeof s=="string")return L(s);switch(s){case d:return L("Suspense");case m:return L("SuspenseList")}if(typeof s=="object")switch(s.$$typeof){case f:return Ce(s.render);case p:return Me(s.type,v,R);case h:{var I=s,J=I._payload,ne=I._init;try{return Me(ne(J),v,R)}catch{}}}return""}var et=Object.prototype.hasOwnProperty,fr={},dr=S.ReactDebugCurrentFrame;function dt(s){if(s){var v=s._owner,R=Me(s.type,s._source,v?v.type:null);dr.setExtraStackFrame(R)}else dr.setExtraStackFrame(null)}function jn(s,v,R,I,J){{var ne=Function.call.bind(et);for(var U in s)if(ne(s,U)){var W=void 0;try{if(typeof s[U]!="function"){var ye=Error((I||"React class")+": "+R+" type `"+U+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[U]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ye.name="Invariant Violation",ye}W=s[U](v,U,I,R,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(de){W=de}W&&!(W instanceof Error)&&(dt(J),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",I||"React class",R,U,typeof W),dt(null)),W instanceof Error&&!(W.message in fr)&&(fr[W.message]=!0,dt(J),w("Failed %s type: %s",R,W.message),dt(null))}}}var Dn=Array.isArray;function jt(s){return Dn(s)}function Mn(s){{var v=typeof Symbol=="function"&&Symbol.toStringTag,R=v&&s[Symbol.toStringTag]||s.constructor.name||"Object";return R}}function Bn(s){try{return pr(s),!1}catch{return!0}}function pr(s){return""+s}function mr(s){if(Bn(s))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Mn(s)),pr(s)}var hr=S.ReactCurrentOwner,Fn={key:!0,ref:!0,__self:!0,__source:!0},gr,yr;function Ln(s){if(et.call(s,"ref")){var v=Object.getOwnPropertyDescriptor(s,"ref").get;if(v&&v.isReactWarning)return!1}return s.ref!==void 0}function Vn(s){if(et.call(s,"key")){var v=Object.getOwnPropertyDescriptor(s,"key").get;if(v&&v.isReactWarning)return!1}return s.key!==void 0}function Wn(s,v){typeof s.ref=="string"&&hr.current}function zn(s,v){{var R=function(){gr||(gr=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",v))};R.isReactWarning=!0,Object.defineProperty(s,"key",{get:R,configurable:!0})}}function Yn(s,v){{var R=function(){yr||(yr=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",v))};R.isReactWarning=!0,Object.defineProperty(s,"ref",{get:R,configurable:!0})}}var Un=function(s,v,R,I,J,ne,U){var W={$$typeof:t,type:s,key:v,ref:R,props:U,_owner:ne};return W._store={},Object.defineProperty(W._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(W,"_self",{configurable:!1,enumerable:!1,writable:!1,value:I}),Object.defineProperty(W,"_source",{configurable:!1,enumerable:!1,writable:!1,value:J}),Object.freeze&&(Object.freeze(W.props),Object.freeze(W)),W};function Gn(s,v,R,I,J){{var ne,U={},W=null,ye=null;R!==void 0&&(mr(R),W=""+R),Vn(v)&&(mr(v.key),W=""+v.key),Ln(v)&&(ye=v.ref,Wn(v,J));for(ne in v)et.call(v,ne)&&!Fn.hasOwnProperty(ne)&&(U[ne]=v[ne]);if(s&&s.defaultProps){var de=s.defaultProps;for(ne in de)U[ne]===void 0&&(U[ne]=de[ne])}if(W||ye){var me=typeof s=="function"?s.displayName||s.name||"Unknown":s;W&&zn(U,me),ye&&Yn(U,me)}return Un(s,W,ye,J,I,hr.current,U)}}var Dt=S.ReactCurrentOwner,br=S.ReactDebugCurrentFrame;function Ue(s){if(s){var v=s._owner,R=Me(s.type,s._source,v?v.type:null);br.setExtraStackFrame(R)}else br.setExtraStackFrame(null)}var Mt;Mt=!1;function Bt(s){return typeof s=="object"&&s!==null&&s.$$typeof===t}function vr(){{if(Dt.current){var s=D(Dt.current.type);if(s)return`
|
|
6
|
+
|
|
7
|
+
Check the render method of \``+s+"`."}return""}}function qn(s){return""}var Sr={};function Kn(s){{var v=vr();if(!v){var R=typeof s=="string"?s:s.displayName||s.name;R&&(v=`
|
|
8
|
+
|
|
9
|
+
Check the top-level render call using <`+R+">.")}return v}}function Er(s,v){{if(!s._store||s._store.validated||s.key!=null)return;s._store.validated=!0;var R=Kn(v);if(Sr[R])return;Sr[R]=!0;var I="";s&&s._owner&&s._owner!==Dt.current&&(I=" It was passed a child from "+D(s._owner.type)+"."),Ue(s),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',R,I),Ue(null)}}function Cr(s,v){{if(typeof s!="object")return;if(jt(s))for(var R=0;R<s.length;R++){var I=s[R];Bt(I)&&Er(I,v)}else if(Bt(s))s._store&&(s._store.validated=!0);else if(s){var J=T(s);if(typeof J=="function"&&J!==s.entries)for(var ne=J.call(s),U;!(U=ne.next()).done;)Bt(U.value)&&Er(U.value,v)}}}function Hn(s){{var v=s.type;if(v==null||typeof v=="string")return;var R;if(typeof v=="function")R=v.propTypes;else if(typeof v=="object"&&(v.$$typeof===f||v.$$typeof===p))R=v.propTypes;else return;if(R){var I=D(v);jn(R,s.props,"prop",I,s)}else if(v.PropTypes!==void 0&&!Mt){Mt=!0;var J=D(v);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",J||"Unknown")}typeof v.getDefaultProps=="function"&&!v.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Jn(s){{for(var v=Object.keys(s.props),R=0;R<v.length;R++){var I=v[R];if(I!=="children"&&I!=="key"){Ue(s),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",I),Ue(null);break}}s.ref!==null&&(Ue(s),w("Invalid attribute `ref` supplied to `React.Fragment`."),Ue(null))}}var xr={};function Tr(s,v,R,I,J,ne){{var U=a(s);if(!U){var W="";(s===void 0||typeof s=="object"&&s!==null&&Object.keys(s).length===0)&&(W+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ye=qn();ye?W+=ye:W+=vr();var de;s===null?de="null":jt(s)?de="array":s!==void 0&&s.$$typeof===t?(de="<"+(D(s.type)||"Unknown")+" />",W=" Did you accidentally export a JSX literal instead of a component?"):de=typeof s,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",de,W)}var me=Gn(s,v,R,J,ne);if(me==null)return me;if(U){var xe=v.children;if(xe!==void 0)if(I)if(jt(xe)){for(var Ge=0;Ge<xe.length;Ge++)Cr(xe[Ge],s);Object.freeze&&Object.freeze(xe)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Cr(xe,s)}if(et.call(v,"key")){var Be=D(s),be=Object.keys(v).filter(function(ro){return ro!=="key"}),Ft=be.length>0?"{key: someKey, "+be.join(": ..., ")+": ...}":"{key: someKey}";if(!xr[Be+Ft]){var to=be.length>0?"{"+be.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
|
|
10
|
+
let props = %s;
|
|
11
|
+
<%s {...props} />
|
|
12
|
+
React keys must be passed directly to JSX without using spread:
|
|
13
|
+
let props = %s;
|
|
14
|
+
<%s key={someKey} {...props} />`,Ft,Be,to,Be),xr[Be+Ft]=!0}}return s===n?Jn(me):Hn(me),me}}function Xn(s,v,R){return Tr(s,v,R,!0)}function Qn(s,v,R){return Tr(s,v,R,!1)}var Zn=Qn,eo=Xn;rt.Fragment=n,rt.jsx=Zn,rt.jsxs=eo})()),rt}var _r;function co(){return _r||(_r=1,process.env.NODE_ENV==="production"?pt.exports=ao():pt.exports=so()),pt.exports}var x=co();function ln(e){const{client:t,tenantId:r,subscriberId:n,filters:o,pollInterval:i,autoFetch:c=!0}=e,[u,f]=Z.useState([]),[d,m]=Z.useState(c),[p,h]=Z.useState(null),y=Z.useCallback(async()=>{try{m(!0),h(null);const S={tenantId:r,subscriberId:n,limit:e?.maxNotifications,...o},w=await t.notifications.list(S);f(w.items||[])}catch(S){h(S instanceof Error?S:new Error("Failed to fetch notifications"))}finally{m(!1)}},[t,r,n,o,e?.maxNotifications]);Z.useEffect(()=>{c&&y()},[c]),Z.useEffect(()=>{if(i&&i>0){const S=setInterval(()=>{y()},i);return()=>clearInterval(S)}},[i,y]);const b=u.filter(S=>S.read!==!0).length,l=Z.useCallback(async S=>{try{await t.notifications.markAsRead(S,n),f(w=>w.map(A=>A.notificationId===S?{...A,read:!0}:A))}catch(w){console.error("Failed to mark notification as read",w)}},[t,n]),T=Z.useCallback(async S=>{try{await t.notifications.delete(S,n),f(w=>w.filter(A=>A.notificationId!==S))}catch(w){console.error("Failed to delete notification",w)}},[t,n]);return{notifications:u,loading:d,error:p,unreadCount:b,refresh:y,markAsRead:l,deleteNotification:T}}const lo="edusight:notification-widget:context";function uo(e){try{if(typeof window>"u"||!window.localStorage)return;window.localStorage.setItem(lo,JSON.stringify(e))}catch{}}class fo{constructor(t){this.listeners=new Map;const r={wsUrl:t.client.getWebSocketUrl(),tenantId:t.tenantId,subscriberId:t.subscriberId,environmentId:t.environmentId,namespace:t.namespace,autoAck:t.autoAck,transports:t.transports,reconnectionDelay:t.reconnectionDelay,reconnectionDelayMax:t.reconnectionDelayMax};this.config=t,this.context={tenantId:t.tenantId,subscriberId:t.subscriberId,environmentId:t.environmentId},this.socketClient=new Fe.NotificationSocketClient(r),this.socketClient.on("connect",()=>{uo({environmentId:t.environmentId,subscriberId:t.subscriberId,tenantId:t.tenantId}),this.emit("connect")}),this.socketClient.on("disconnect",n=>{this.emit("disconnect",n)}),this.socketClient.on("notification",n=>{this.emit("notification",this.normalizeNotification(n)),this.config.autoAck===!1&&this.ackNotification(n.notificationId)}),this.socketClient.on("ack",n=>{this.emit("ack",n)}),this.socketClient.on("error",n=>{this.emit("error",n)})}connect(){this.socketClient.connect()}disconnect(){this.socketClient.disconnect()}ackNotification(t){try{this.socketClient.ack(t)}catch(r){this.emit("error",r instanceof Error?r:new Error(String(r)))}}isConnected(){return this.socketClient.isConnected()}on(t,r){this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(r)}off(t,r){this.listeners.get(t)?.delete(r)}emit(t,...r){const n=this.listeners.get(t);n&&n.forEach(o=>{try{o(...r)}catch(i){console.warn(`Error in ${t} handler:`,i)}})}normalizeNotification(t){const r=new Date().toISOString(),n=t.channel||Fe.Channel.IN_APP,o=t.renderedContent||{inApp:{title:t.title,message:t.message,action:t.action,icon:t.icon}},i=t.category??Fe.NotificationCategory.REAL_TIME;return{notificationId:t.notificationId,tenantId:this.context.tenantId,subscriberId:this.context.subscriberId,templateId:t.templateId??"",type:t.type||Fe.NotificationType.CUSTOM,category:i,channels:[n],payload:t.data||{},renderedContent:o,status:Fe.NotificationStatus.PENDING,priority:Fe.Priority.MEDIUM,scheduledFor:void 0,sentAt:void 0,retryCount:void 0,batchId:t.batchId,metadata:t.data,createdAt:t.createdAt??r,updatedAt:r,feedId:t.feedId}}}function un(e){const{client:t,tenantId:r,subscriberId:n,environmentId:o,enabled:i=!0,autoAck:c=!1}=e,[u,f]=Z.useState(!1),[d,m]=Z.useState(null),p=Z.useRef(null);Z.useEffect(()=>{if(!i)return;const S=new fo({client:t,tenantId:r,subscriberId:n,environmentId:o,autoAck:c});return S.on("connect",()=>{f(!0),m(null)}),S.on("disconnect",()=>{f(!1)}),S.on("error",w=>{m(w)}),p.current=S,S.connect(),()=>{S.disconnect(),p.current=null,f(!1)}},[t,r,n,o,i,c]);const h=Z.useCallback(()=>{p.current?.connect()},[]),y=Z.useCallback(()=>{p.current?.disconnect()},[]),b=Z.useCallback(S=>{p.current?.ackNotification(S)},[]),l=Z.useCallback(S=>p.current?(p.current.on("notification",S),()=>{p.current?.off("notification",S)}):()=>{},[]),T=Z.useCallback(S=>p.current?(p.current.on("ack",S),()=>{p.current?.off("ack",S)}):()=>{},[]);return{connected:u,connect:h,disconnect:y,onNotification:l,onAck:T,ackNotification:b,error:d}}function fn(e){const{client:t,tenantId:r,subscriberId:n,environmentId:o,pollInterval:i,autoFetch:c,autoAck:u=!1}=e,f={client:t,tenantId:r,subscriberId:n,pollInterval:i,autoFetch:c},d={client:t,tenantId:r,subscriberId:n,environmentId:o,enabled:!0,autoAck:u},m=ln(f),p=un(d),[h,y]=Z.useState(m.notifications);return Z.useEffect(()=>{y(m.notifications)},[m.notifications]),Z.useEffect(()=>{const b=p.onNotification(T=>{y(S=>S.some(w=>w.notificationId===T.notificationId)?S:[T,...S]),p.ackNotification(T.notificationId)}),l=p.onAck(T=>{y(S=>S.map(w=>w.notificationId===T.notificationId?{...w,status:Fe.NotificationStatus.DELIVERED}:w))});return()=>{b(),l()}},[p]),{notifications:h,loading:m.loading,error:m.error,unreadCount:m.unreadCount,connected:p.connected,refresh:m.refresh,markAsRead:m.markAsRead,deleteNotification:m.deleteNotification}}var mt={exports:{}},ee={};var Rr;function po(){if(Rr)return ee;Rr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),y=Symbol.for("react.client.reference");function b(l){if(typeof l=="object"&&l!==null){var T=l.$$typeof;switch(T){case e:switch(l=l.type,l){case r:case o:case n:case f:case d:case h:return l;default:switch(l=l&&l.$$typeof,l){case c:case u:case p:case m:return l;case i:return l;default:return T}}case t:return T}}}return ee.ContextConsumer=i,ee.ContextProvider=c,ee.Element=e,ee.ForwardRef=u,ee.Fragment=r,ee.Lazy=p,ee.Memo=m,ee.Portal=t,ee.Profiler=o,ee.StrictMode=n,ee.Suspense=f,ee.SuspenseList=d,ee.isContextConsumer=function(l){return b(l)===i},ee.isContextProvider=function(l){return b(l)===c},ee.isElement=function(l){return typeof l=="object"&&l!==null&&l.$$typeof===e},ee.isForwardRef=function(l){return b(l)===u},ee.isFragment=function(l){return b(l)===r},ee.isLazy=function(l){return b(l)===p},ee.isMemo=function(l){return b(l)===m},ee.isPortal=function(l){return b(l)===t},ee.isProfiler=function(l){return b(l)===o},ee.isStrictMode=function(l){return b(l)===n},ee.isSuspense=function(l){return b(l)===f},ee.isSuspenseList=function(l){return b(l)===d},ee.isValidElementType=function(l){return typeof l=="string"||typeof l=="function"||l===r||l===o||l===n||l===f||l===d||typeof l=="object"&&l!==null&&(l.$$typeof===p||l.$$typeof===m||l.$$typeof===c||l.$$typeof===i||l.$$typeof===u||l.$$typeof===y||l.getModuleId!==void 0)},ee.typeOf=b,ee}var te={};var Ar;function mo(){return Ar||(Ar=1,process.env.NODE_ENV!=="production"&&(function(){function e(l){if(typeof l=="object"&&l!==null){var T=l.$$typeof;switch(T){case t:switch(l=l.type,l){case n:case i:case o:case d:case m:case y:return l;default:switch(l=l&&l.$$typeof,l){case u:case f:case h:case p:return l;case c:return l;default:return T}}case r:return T}}}var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),y=Symbol.for("react.view_transition"),b=Symbol.for("react.client.reference");te.ContextConsumer=c,te.ContextProvider=u,te.Element=t,te.ForwardRef=f,te.Fragment=n,te.Lazy=h,te.Memo=p,te.Portal=r,te.Profiler=i,te.StrictMode=o,te.Suspense=d,te.SuspenseList=m,te.isContextConsumer=function(l){return e(l)===c},te.isContextProvider=function(l){return e(l)===u},te.isElement=function(l){return typeof l=="object"&&l!==null&&l.$$typeof===t},te.isForwardRef=function(l){return e(l)===f},te.isFragment=function(l){return e(l)===n},te.isLazy=function(l){return e(l)===h},te.isMemo=function(l){return e(l)===p},te.isPortal=function(l){return e(l)===r},te.isProfiler=function(l){return e(l)===i},te.isStrictMode=function(l){return e(l)===o},te.isSuspense=function(l){return e(l)===d},te.isSuspenseList=function(l){return e(l)===m},te.isValidElementType=function(l){return typeof l=="string"||typeof l=="function"||l===n||l===i||l===o||l===d||l===m||typeof l=="object"&&l!==null&&(l.$$typeof===h||l.$$typeof===p||l.$$typeof===u||l.$$typeof===c||l.$$typeof===f||l.$$typeof===b||l.getModuleId!==void 0)},te.typeOf=e})()),te}var kr;function ho(){return kr||(kr=1,process.env.NODE_ENV==="production"?mt.exports=po():mt.exports=mo()),mt.exports}var St=ho();function Ae(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function dn(e){if(Pe.isValidElement(e)||St.isValidElementType(e)||!Ae(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=dn(e[r])}),t}function Ee(e,t,r={clone:!0}){const n=r.clone?{...e}:e;return Ae(e)&&Ae(t)&&Object.keys(t).forEach(o=>{Pe.isValidElement(t[o])||St.isValidElementType(t[o])?n[o]=t[o]:Ae(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&Ae(e[o])?n[o]=Ee(e[o],t[o],r):r.clone?n[o]=Ae(t[o])?dn(t[o]):t[o]:n[o]=t[o]}),n}var ht={exports:{}},gt={exports:{}},X={};var $r;function go(){if($r)return X;$r=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,f=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,m=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,l=e?Symbol.for("react.block"):60121,T=e?Symbol.for("react.fundamental"):60117,S=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function A(E){if(typeof E=="object"&&E!==null){var K=E.$$typeof;switch(K){case t:switch(E=E.type,E){case f:case d:case n:case i:case o:case p:return E;default:switch(E=E&&E.$$typeof,E){case u:case m:case b:case y:case c:return E;default:return K}}case r:return K}}}function $(E){return A(E)===d}return X.AsyncMode=f,X.ConcurrentMode=d,X.ContextConsumer=u,X.ContextProvider=c,X.Element=t,X.ForwardRef=m,X.Fragment=n,X.Lazy=b,X.Memo=y,X.Portal=r,X.Profiler=i,X.StrictMode=o,X.Suspense=p,X.isAsyncMode=function(E){return $(E)||A(E)===f},X.isConcurrentMode=$,X.isContextConsumer=function(E){return A(E)===u},X.isContextProvider=function(E){return A(E)===c},X.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===t},X.isForwardRef=function(E){return A(E)===m},X.isFragment=function(E){return A(E)===n},X.isLazy=function(E){return A(E)===b},X.isMemo=function(E){return A(E)===y},X.isPortal=function(E){return A(E)===r},X.isProfiler=function(E){return A(E)===i},X.isStrictMode=function(E){return A(E)===o},X.isSuspense=function(E){return A(E)===p},X.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===n||E===d||E===i||E===o||E===p||E===h||typeof E=="object"&&E!==null&&(E.$$typeof===b||E.$$typeof===y||E.$$typeof===c||E.$$typeof===u||E.$$typeof===m||E.$$typeof===T||E.$$typeof===S||E.$$typeof===w||E.$$typeof===l)},X.typeOf=A,X}var Q={};var Pr;function yo(){return Pr||(Pr=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,f=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,m=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,l=e?Symbol.for("react.block"):60121,T=e?Symbol.for("react.fundamental"):60117,S=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function A(O){return typeof O=="string"||typeof O=="function"||O===n||O===d||O===i||O===o||O===p||O===h||typeof O=="object"&&O!==null&&(O.$$typeof===b||O.$$typeof===y||O.$$typeof===c||O.$$typeof===u||O.$$typeof===m||O.$$typeof===T||O.$$typeof===S||O.$$typeof===w||O.$$typeof===l)}function $(O){if(typeof O=="object"&&O!==null){var Ce=O.$$typeof;switch(Ce){case t:var Ye=O.type;switch(Ye){case f:case d:case n:case i:case o:case p:return Ye;default:var Me=Ye&&Ye.$$typeof;switch(Me){case u:case m:case b:case y:case c:return Me;default:return Ce}}case r:return Ce}}}var E=f,K=d,ae=u,re=c,z=t,a=m,_=n,G=b,D=y,fe=r,ce=i,he=o,ve=p,De=!1;function ze(O){return De||(De=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),C(O)||$(O)===f}function C(O){return $(O)===d}function k(O){return $(O)===u}function F(O){return $(O)===c}function B(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function N(O){return $(O)===m}function Y(O){return $(O)===n}function j(O){return $(O)===b}function M(O){return $(O)===y}function L(O){return $(O)===r}function q(O){return $(O)===i}function V(O){return $(O)===o}function ge(O){return $(O)===p}Q.AsyncMode=E,Q.ConcurrentMode=K,Q.ContextConsumer=ae,Q.ContextProvider=re,Q.Element=z,Q.ForwardRef=a,Q.Fragment=_,Q.Lazy=G,Q.Memo=D,Q.Portal=fe,Q.Profiler=ce,Q.StrictMode=he,Q.Suspense=ve,Q.isAsyncMode=ze,Q.isConcurrentMode=C,Q.isContextConsumer=k,Q.isContextProvider=F,Q.isElement=B,Q.isForwardRef=N,Q.isFragment=Y,Q.isLazy=j,Q.isMemo=M,Q.isPortal=L,Q.isProfiler=q,Q.isStrictMode=V,Q.isSuspense=ge,Q.isValidElementType=A,Q.typeOf=$})()),Q}var Ir;function pn(){return Ir||(Ir=1,process.env.NODE_ENV==="production"?gt.exports=go():gt.exports=yo()),gt.exports}var Lt,Nr;function bo(){if(Nr)return Lt;Nr=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var c={},u=0;u<10;u++)c["_"+String.fromCharCode(u)]=u;var f=Object.getOwnPropertyNames(c).map(function(m){return c[m]});if(f.join("")!=="0123456789")return!1;var d={};return"abcdefghijklmnopqrst".split("").forEach(function(m){d[m]=m}),Object.keys(Object.assign({},d)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Lt=o()?Object.assign:function(i,c){for(var u,f=n(i),d,m=1;m<arguments.length;m++){u=Object(arguments[m]);for(var p in u)t.call(u,p)&&(f[p]=u[p]);if(e){d=e(u);for(var h=0;h<d.length;h++)r.call(u,d[h])&&(f[d[h]]=u[d[h]])}}return f},Lt}var Vt,jr;function tr(){if(jr)return Vt;jr=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Vt=e,Vt}var Wt,Dr;function mn(){return Dr||(Dr=1,Wt=Function.call.bind(Object.prototype.hasOwnProperty)),Wt}var zt,Mr;function vo(){if(Mr)return zt;Mr=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=tr(),r={},n=mn();e=function(i){var c="Warning: "+i;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}}}function o(i,c,u,f,d){if(process.env.NODE_ENV!=="production"){for(var m in i)if(n(i,m)){var p;try{if(typeof i[m]!="function"){var h=Error((f||"React class")+": "+u+" type `"+m+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[m]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}p=i[m](c,m,f,u,null,t)}catch(b){p=b}if(p&&!(p instanceof Error)&&e((f||"React class")+": type specification of "+u+" `"+m+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof p+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),p instanceof Error&&!(p.message in r)){r[p.message]=!0;var y=d?d():"";e("Failed "+u+" type: "+p.message+(y??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},zt=o,zt}var Yt,Br;function So(){if(Br)return Yt;Br=1;var e=pn(),t=bo(),r=tr(),n=mn(),o=vo(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(u){var f="Warning: "+u;typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}});function c(){return null}return Yt=function(u,f){var d=typeof Symbol=="function"&&Symbol.iterator,m="@@iterator";function p(C){var k=C&&(d&&C[d]||C[m]);if(typeof k=="function")return k}var h="<<anonymous>>",y={array:S("array"),bigint:S("bigint"),bool:S("boolean"),func:S("function"),number:S("number"),object:S("object"),string:S("string"),symbol:S("symbol"),any:w(),arrayOf:A,element:$(),elementType:E(),instanceOf:K,node:a(),objectOf:re,oneOf:ae,oneOfType:z,shape:G,exact:D};function b(C,k){return C===k?C!==0||1/C===1/k:C!==C&&k!==k}function l(C,k){this.message=C,this.data=k&&typeof k=="object"?k:{},this.stack=""}l.prototype=Error.prototype;function T(C){if(process.env.NODE_ENV!=="production")var k={},F=0;function B(Y,j,M,L,q,V,ge){if(L=L||h,V=V||M,ge!==r){if(f){var O=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw O.name="Invariant Violation",O}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ce=L+":"+M;!k[Ce]&&F<3&&(i("You are manually calling a React.PropTypes validation function for the `"+V+"` prop on `"+L+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),k[Ce]=!0,F++)}}return j[M]==null?Y?j[M]===null?new l("The "+q+" `"+V+"` is marked as required "+("in `"+L+"`, but its value is `null`.")):new l("The "+q+" `"+V+"` is marked as required in "+("`"+L+"`, but its value is `undefined`.")):null:C(j,M,L,q,V)}var N=B.bind(null,!1);return N.isRequired=B.bind(null,!0),N}function S(C){function k(F,B,N,Y,j,M){var L=F[B],q=he(L);if(q!==C){var V=ve(L);return new l("Invalid "+Y+" `"+j+"` of type "+("`"+V+"` supplied to `"+N+"`, expected ")+("`"+C+"`."),{expectedType:C})}return null}return T(k)}function w(){return T(c)}function A(C){function k(F,B,N,Y,j){if(typeof C!="function")return new l("Property `"+j+"` of component `"+N+"` has invalid PropType notation inside arrayOf.");var M=F[B];if(!Array.isArray(M)){var L=he(M);return new l("Invalid "+Y+" `"+j+"` of type "+("`"+L+"` supplied to `"+N+"`, expected an array."))}for(var q=0;q<M.length;q++){var V=C(M,q,N,Y,j+"["+q+"]",r);if(V instanceof Error)return V}return null}return T(k)}function $(){function C(k,F,B,N,Y){var j=k[F];if(!u(j)){var M=he(j);return new l("Invalid "+N+" `"+Y+"` of type "+("`"+M+"` supplied to `"+B+"`, expected a single ReactElement."))}return null}return T(C)}function E(){function C(k,F,B,N,Y){var j=k[F];if(!e.isValidElementType(j)){var M=he(j);return new l("Invalid "+N+" `"+Y+"` of type "+("`"+M+"` supplied to `"+B+"`, expected a single ReactElement type."))}return null}return T(C)}function K(C){function k(F,B,N,Y,j){if(!(F[B]instanceof C)){var M=C.name||h,L=ze(F[B]);return new l("Invalid "+Y+" `"+j+"` of type "+("`"+L+"` supplied to `"+N+"`, expected ")+("instance of `"+M+"`."))}return null}return T(k)}function ae(C){if(!Array.isArray(C))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),c;function k(F,B,N,Y,j){for(var M=F[B],L=0;L<C.length;L++)if(b(M,C[L]))return null;var q=JSON.stringify(C,function(ge,O){var Ce=ve(O);return Ce==="symbol"?String(O):O});return new l("Invalid "+Y+" `"+j+"` of value `"+String(M)+"` "+("supplied to `"+N+"`, expected one of "+q+"."))}return T(k)}function re(C){function k(F,B,N,Y,j){if(typeof C!="function")return new l("Property `"+j+"` of component `"+N+"` has invalid PropType notation inside objectOf.");var M=F[B],L=he(M);if(L!=="object")return new l("Invalid "+Y+" `"+j+"` of type "+("`"+L+"` supplied to `"+N+"`, expected an object."));for(var q in M)if(n(M,q)){var V=C(M,q,N,Y,j+"."+q,r);if(V instanceof Error)return V}return null}return T(k)}function z(C){if(!Array.isArray(C))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),c;for(var k=0;k<C.length;k++){var F=C[k];if(typeof F!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+De(F)+" at index "+k+"."),c}function B(N,Y,j,M,L){for(var q=[],V=0;V<C.length;V++){var ge=C[V],O=ge(N,Y,j,M,L,r);if(O==null)return null;O.data&&n(O.data,"expectedType")&&q.push(O.data.expectedType)}var Ce=q.length>0?", expected one of type ["+q.join(", ")+"]":"";return new l("Invalid "+M+" `"+L+"` supplied to "+("`"+j+"`"+Ce+"."))}return T(B)}function a(){function C(k,F,B,N,Y){return fe(k[F])?null:new l("Invalid "+N+" `"+Y+"` supplied to "+("`"+B+"`, expected a ReactNode."))}return T(C)}function _(C,k,F,B,N){return new l((C||"React class")+": "+k+" type `"+F+"."+B+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function G(C){function k(F,B,N,Y,j){var M=F[B],L=he(M);if(L!=="object")return new l("Invalid "+Y+" `"+j+"` of type `"+L+"` "+("supplied to `"+N+"`, expected `object`."));for(var q in C){var V=C[q];if(typeof V!="function")return _(N,Y,j,q,ve(V));var ge=V(M,q,N,Y,j+"."+q,r);if(ge)return ge}return null}return T(k)}function D(C){function k(F,B,N,Y,j){var M=F[B],L=he(M);if(L!=="object")return new l("Invalid "+Y+" `"+j+"` of type `"+L+"` "+("supplied to `"+N+"`, expected `object`."));var q=t({},F[B],C);for(var V in q){var ge=C[V];if(n(C,V)&&typeof ge!="function")return _(N,Y,j,V,ve(ge));if(!ge)return new l("Invalid "+Y+" `"+j+"` key `"+V+"` supplied to `"+N+"`.\nBad object: "+JSON.stringify(F[B],null," ")+`
|
|
15
|
+
Valid keys: `+JSON.stringify(Object.keys(C),null," "));var O=ge(M,V,N,Y,j+"."+V,r);if(O)return O}return null}return T(k)}function fe(C){switch(typeof C){case"number":case"string":case"undefined":return!0;case"boolean":return!C;case"object":if(Array.isArray(C))return C.every(fe);if(C===null||u(C))return!0;var k=p(C);if(k){var F=k.call(C),B;if(k!==C.entries){for(;!(B=F.next()).done;)if(!fe(B.value))return!1}else for(;!(B=F.next()).done;){var N=B.value;if(N&&!fe(N[1]))return!1}}else return!1;return!0;default:return!1}}function ce(C,k){return C==="symbol"?!0:k?k["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&k instanceof Symbol:!1}function he(C){var k=typeof C;return Array.isArray(C)?"array":C instanceof RegExp?"object":ce(k,C)?"symbol":k}function ve(C){if(typeof C>"u"||C===null)return""+C;var k=he(C);if(k==="object"){if(C instanceof Date)return"date";if(C instanceof RegExp)return"regexp"}return k}function De(C){var k=ve(C);switch(k){case"array":case"object":return"an "+k;case"boolean":case"date":case"regexp":return"a "+k;default:return k}}function ze(C){return!C.constructor||!C.constructor.name?h:C.constructor.name}return y.checkPropTypes=o,y.resetWarningCache=o.resetWarningCache,y.PropTypes=y,y},Yt}var Ut,Fr;function Eo(){if(Fr)return Ut;Fr=1;var e=tr();function t(){}function r(){}return r.resetWarningCache=t,Ut=function(){function n(c,u,f,d,m,p){if(p!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}n.isRequired=n;function o(){return n}var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return i.PropTypes=i,i},Ut}var Lr;function Co(){if(Lr)return ht.exports;if(Lr=1,process.env.NODE_ENV!=="production"){var e=pn(),t=!0;ht.exports=So()(e.isElement,t)}else ht.exports=Eo()();return ht.exports}var xo=Co();const H=io(xo);function Ie(e,...t){const r=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(n=>r.searchParams.append("args[]",n)),`Minified MUI error #${e}; visit ${r} for the full message.`}function hn(e,t=""){return e.displayName||e.name||t}function Vr(e,t,r){const n=hn(t);return e.displayName||(n!==""?`${r}(${n})`:r)}function To(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return hn(e,"Component");if(typeof e=="object")switch(e.$$typeof){case St.ForwardRef:return Vr(e,e.render,"ForwardRef");case St.Memo:return Vr(e,e.type,"memo");default:return}}}function We(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":Ie(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Jt(e,t){const r={...t};for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=n;if(o==="components"||o==="slots")r[o]={...e[o],...r[o]};else if(o==="componentsProps"||o==="slotProps"){const i=e[o],c=t[o];if(!c)r[o]=i||{};else if(!i)r[o]=c;else{r[o]={...c};for(const u in i)if(Object.prototype.hasOwnProperty.call(i,u)){const f=u;r[o][f]=Jt(i[f],c[f])}}}else r[o]===void 0&&(r[o]=e[o])}return r}function wo(e,t,r=void 0){const n={};for(const o in e){const i=e[o];let c="",u=!0;for(let f=0;f<i.length;f+=1){const d=i[f];d&&(c+=(u===!0?"":" ")+t(d),u=!1,r&&r[d]&&(c+=" "+r[d]))}n[o]=c}return n}const Wr=e=>e,Oo=()=>{let e=Wr;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Wr}}},_o=Oo(),Ro={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function rr(e,t,r="Mui"){const n=Ro[t];return n?`${r}-${n}`:`${_o.generate(e)}-${t}`}function Ao(e,t,r="Mui"){const n={};return t.forEach(o=>{n[o]=rr(e,o,r)}),n}function ko(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function gn(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=gn(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function $o(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=gn(e))&&(n&&(n+=" "),n+=t);return n}function at(e,t){return t?Ee(e,t,{clone:!1}):e}const je=process.env.NODE_ENV!=="production"?H.oneOfType([H.number,H.string,H.object,H.array]):{};function zr(e,t){if(!e.containerQueries)return t;const r=Object.keys(t).filter(n=>n.startsWith("@container")).sort((n,o)=>{const i=/min-width:\s*([0-9.]+)/;return+(n.match(i)?.[1]||0)-+(o.match(i)?.[1]||0)});return r.length?r.reduce((n,o)=>{const i=t[o];return delete n[o],n[o]=i,n},{...t}):t}function Po(e,t){return t==="@"||t.startsWith("@")&&(e.some(r=>t.startsWith(`@${r}`))||!!t.match(/^@\d/))}function Io(e,t){const r=t.match(/^@([^/]+)?\/?(.+)?$/);if(!r){if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
|
|
16
|
+
For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:Ie(18,`(${t})`));return null}const[,n,o]=r,i=Number.isNaN(+n)?n||0:+n;return e.containerQueries(o).up(i)}function No(e){const t=(i,c)=>i.replace("@media",c?`@container ${c}`:"@container");function r(i,c){i.up=(...u)=>t(e.breakpoints.up(...u),c),i.down=(...u)=>t(e.breakpoints.down(...u),c),i.between=(...u)=>t(e.breakpoints.between(...u),c),i.only=(...u)=>t(e.breakpoints.only(...u),c),i.not=(...u)=>{const f=t(e.breakpoints.not(...u),c);return f.includes("not all and")?f.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):f}}const n={},o=i=>(r(n,i),n);return r(o),{...e,containerQueries:o}}const Tt={xs:0,sm:600,md:900,lg:1200,xl:1536},Yr={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Tt[e]}px)`},jo={containerQueries:e=>({up:t=>{let r=typeof t=="number"?t:Tt[t]||t;return typeof r=="number"&&(r=`${r}px`),e?`@container ${e} (min-width:${r})`:`@container (min-width:${r})`}})};function ke(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const i=n.breakpoints||Yr;return t.reduce((c,u,f)=>(c[i.up(i.keys[f])]=r(t[f]),c),{})}if(typeof t=="object"){const i=n.breakpoints||Yr;return Object.keys(t).reduce((c,u)=>{if(Po(i.keys,u)){const f=Io(n.containerQueries?n:jo,u);f&&(c[f]=r(t[u],u))}else if(Object.keys(i.values||Tt).includes(u)){const f=i.up(u);c[f]=r(t[u],u)}else{const f=u;c[f]=t[f]}return c},{})}return r(t)}function Do(e={}){return e.keys?.reduce((r,n)=>{const o=e.up(n);return r[o]={},r},{})||{}}function Ur(e,t){return e.reduce((r,n)=>{const o=r[n];return(!o||Object.keys(o).length===0)&&delete r[n],r},t)}function wt(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const n=`vars.${t}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,e);if(n!=null)return n}return t.split(".").reduce((n,o)=>n&&n[o]!=null?n[o]:null,e)}function Et(e,t,r,n=r){let o;return typeof e=="function"?o=e(r):Array.isArray(e)?o=e[r]||n:o=wt(e,r)||n,t&&(o=t(o,n,e)),o}function pe(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:o}=e,i=c=>{if(c[t]==null)return null;const u=c[t],f=c.theme,d=wt(f,n)||{};return ke(c,u,p=>{let h=Et(d,o,p);return p===h&&typeof p=="string"&&(h=Et(d,o,`${t}${p==="default"?"":We(p)}`,p)),r===!1?h:{[r]:h}})};return i.propTypes=process.env.NODE_ENV!=="production"?{[t]:je}:{},i.filterProps=[t],i}function Mo(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const Bo={m:"margin",p:"padding"},Fo={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Gr={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Lo=Mo(e=>{if(e.length>2)if(Gr[e])e=Gr[e];else return[e];const[t,r]=e.split(""),n=Bo[t],o=Fo[r]||"";return Array.isArray(o)?o.map(i=>n+i):[n+o]}),Ot=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],_t=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],Vo=[...Ot,..._t];function lt(e,t,r,n){const o=wt(e,t,!0)??r;return typeof o=="number"||typeof o=="string"?i=>typeof i=="string"?i:(process.env.NODE_ENV!=="production"&&typeof i!="number"&&console.error(`MUI: Expected ${n} argument to be a number or a string, got ${i}.`),typeof o=="string"?`calc(${i} * ${o})`:o*i):Array.isArray(o)?i=>{if(typeof i=="string")return i;const c=Math.abs(i);process.env.NODE_ENV!=="production"&&(Number.isInteger(c)?c>o.length-1&&console.error([`MUI: The value provided (${c}) overflows.`,`The supported values are: ${JSON.stringify(o)}.`,`${c} > ${o.length-1}, you need to add the missing values.`].join(`
|
|
17
|
+
`)):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join(`
|
|
18
|
+
`)));const u=o[c];return i>=0?u:typeof u=="number"?-u:`-${u}`}:typeof o=="function"?o:(process.env.NODE_ENV!=="production"&&console.error([`MUI: The \`theme.${t}\` value (${o}) is invalid.`,"It should be a number, an array or a function."].join(`
|
|
19
|
+
`)),()=>{})}function nr(e){return lt(e,"spacing",8,"spacing")}function ut(e,t){return typeof t=="string"||t==null?t:e(t)}function Wo(e,t){return r=>e.reduce((n,o)=>(n[o]=ut(t,r),n),{})}function zo(e,t,r,n){if(!t.includes(r))return null;const o=Lo(r),i=Wo(o,n),c=e[r];return ke(e,c,i)}function yn(e,t){const r=nr(e.theme);return Object.keys(e).map(n=>zo(e,t,n,r)).reduce(at,{})}function le(e){return yn(e,Ot)}le.propTypes=process.env.NODE_ENV!=="production"?Ot.reduce((e,t)=>(e[t]=je,e),{}):{};le.filterProps=Ot;function ue(e){return yn(e,_t)}ue.propTypes=process.env.NODE_ENV!=="production"?_t.reduce((e,t)=>(e[t]=je,e),{}):{};ue.filterProps=_t;process.env.NODE_ENV!=="production"&&Vo.reduce((e,t)=>(e[t]=je,e),{});function Rt(...e){const t=e.reduce((n,o)=>(o.filterProps.forEach(i=>{n[i]=o}),n),{}),r=n=>Object.keys(n).reduce((o,i)=>t[i]?at(o,t[i](n)):o,{});return r.propTypes=process.env.NODE_ENV!=="production"?e.reduce((n,o)=>Object.assign(n,o.propTypes),{}):{},r.filterProps=e.reduce((n,o)=>n.concat(o.filterProps),[]),r}function Te(e){return typeof e!="number"?e:`${e}px solid`}function we(e,t){return pe({prop:e,themeKey:"borders",transform:t})}const Yo=we("border",Te),Uo=we("borderTop",Te),Go=we("borderRight",Te),qo=we("borderBottom",Te),Ko=we("borderLeft",Te),Ho=we("borderColor"),Jo=we("borderTopColor"),Xo=we("borderRightColor"),Qo=we("borderBottomColor"),Zo=we("borderLeftColor"),ei=we("outline",Te),ti=we("outlineColor"),At=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=lt(e.theme,"shape.borderRadius",4,"borderRadius"),r=n=>({borderRadius:ut(t,n)});return ke(e,e.borderRadius,r)}return null};At.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:je}:{};At.filterProps=["borderRadius"];Rt(Yo,Uo,Go,qo,Ko,Ho,Jo,Xo,Qo,Zo,At,ei,ti);const kt=e=>{if(e.gap!==void 0&&e.gap!==null){const t=lt(e.theme,"spacing",8,"gap"),r=n=>({gap:ut(t,n)});return ke(e,e.gap,r)}return null};kt.propTypes=process.env.NODE_ENV!=="production"?{gap:je}:{};kt.filterProps=["gap"];const $t=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=lt(e.theme,"spacing",8,"columnGap"),r=n=>({columnGap:ut(t,n)});return ke(e,e.columnGap,r)}return null};$t.propTypes=process.env.NODE_ENV!=="production"?{columnGap:je}:{};$t.filterProps=["columnGap"];const Pt=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=lt(e.theme,"spacing",8,"rowGap"),r=n=>({rowGap:ut(t,n)});return ke(e,e.rowGap,r)}return null};Pt.propTypes=process.env.NODE_ENV!=="production"?{rowGap:je}:{};Pt.filterProps=["rowGap"];const ri=pe({prop:"gridColumn"}),ni=pe({prop:"gridRow"}),oi=pe({prop:"gridAutoFlow"}),ii=pe({prop:"gridAutoColumns"}),ai=pe({prop:"gridAutoRows"}),si=pe({prop:"gridTemplateColumns"}),ci=pe({prop:"gridTemplateRows"}),li=pe({prop:"gridTemplateAreas"}),ui=pe({prop:"gridArea"});Rt(kt,$t,Pt,ri,ni,oi,ii,ai,si,ci,li,ui);function Qe(e,t){return t==="grey"?t:e}const fi=pe({prop:"color",themeKey:"palette",transform:Qe}),di=pe({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Qe}),pi=pe({prop:"backgroundColor",themeKey:"palette",transform:Qe});Rt(fi,di,pi);function Se(e){return e<=1&&e!==0?`${e*100}%`:e}const mi=pe({prop:"width",transform:Se}),or=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{const n=e.theme?.breakpoints?.values?.[r]||Tt[r];return n?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:n}:{maxWidth:Se(r)}};return ke(e,e.maxWidth,t)}return null};or.filterProps=["maxWidth"];const hi=pe({prop:"minWidth",transform:Se}),gi=pe({prop:"height",transform:Se}),yi=pe({prop:"maxHeight",transform:Se}),bi=pe({prop:"minHeight",transform:Se});pe({prop:"size",cssProperty:"width",transform:Se});pe({prop:"size",cssProperty:"height",transform:Se});const vi=pe({prop:"boxSizing"});Rt(mi,or,hi,gi,yi,bi,vi);const It={border:{themeKey:"borders",transform:Te},borderTop:{themeKey:"borders",transform:Te},borderRight:{themeKey:"borders",transform:Te},borderBottom:{themeKey:"borders",transform:Te},borderLeft:{themeKey:"borders",transform:Te},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Te},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:At},color:{themeKey:"palette",transform:Qe},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Qe},backgroundColor:{themeKey:"palette",transform:Qe},p:{style:ue},pt:{style:ue},pr:{style:ue},pb:{style:ue},pl:{style:ue},px:{style:ue},py:{style:ue},padding:{style:ue},paddingTop:{style:ue},paddingRight:{style:ue},paddingBottom:{style:ue},paddingLeft:{style:ue},paddingX:{style:ue},paddingY:{style:ue},paddingInline:{style:ue},paddingInlineStart:{style:ue},paddingInlineEnd:{style:ue},paddingBlock:{style:ue},paddingBlockStart:{style:ue},paddingBlockEnd:{style:ue},m:{style:le},mt:{style:le},mr:{style:le},mb:{style:le},ml:{style:le},mx:{style:le},my:{style:le},margin:{style:le},marginTop:{style:le},marginRight:{style:le},marginBottom:{style:le},marginLeft:{style:le},marginX:{style:le},marginY:{style:le},marginInline:{style:le},marginInlineStart:{style:le},marginInlineEnd:{style:le},marginBlock:{style:le},marginBlockStart:{style:le},marginBlockEnd:{style:le},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:kt},rowGap:{style:Pt},columnGap:{style:$t},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Se},maxWidth:{style:or},minWidth:{transform:Se},height:{transform:Se},maxHeight:{transform:Se},minHeight:{transform:Se},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function Si(...e){const t=e.reduce((n,o)=>n.concat(Object.keys(o)),[]),r=new Set(t);return e.every(n=>r.size===Object.keys(n).length)}function Ei(e,t){return typeof e=="function"?e(t):e}function Ci(){function e(r,n,o,i){const c={[r]:n,theme:o},u=i[r];if(!u)return{[r]:n};const{cssProperty:f=r,themeKey:d,transform:m,style:p}=u;if(n==null)return null;if(d==="typography"&&n==="inherit")return{[r]:n};const h=wt(o,d)||{};return p?p(c):ke(c,n,b=>{let l=Et(h,m,b);return b===l&&typeof b=="string"&&(l=Et(h,m,`${r}${b==="default"?"":We(b)}`,b)),f===!1?l:{[f]:l}})}function t(r){const{sx:n,theme:o={},nested:i}=r||{};if(!n)return null;const c=o.unstable_sxConfig??It;function u(f){let d=f;if(typeof f=="function")d=f(o);else if(typeof f!="object")return f;if(!d)return null;const m=Do(o.breakpoints),p=Object.keys(m);let h=m;return Object.keys(d).forEach(y=>{const b=Ei(d[y],o);if(b!=null)if(typeof b=="object")if(c[y])h=at(h,e(y,b,o,c));else{const l=ke({theme:o},b,T=>({[y]:T}));Si(l,b)?h[y]=t({sx:b,theme:o,nested:!0}):h=at(h,l)}else h=at(h,e(y,b,o,c))}),!i&&o.modularCssLayers?{"@layer sx":zr(o,Ur(p,h))}:zr(o,Ur(p,h))}return Array.isArray(n)?n.map(u):u(n)}return t}const Ze=Ci();Ze.filterProps=["sx"];function xi(e){for(var t=0,r,n=0,o=e.length;o>=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Ti={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function wi(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Oi=/[A-Z]|^ms/g,_i=/_EMO_([^_]+?)_([^]*?)_EMO_/g,bn=function(t){return t.charCodeAt(1)===45},qr=function(t){return t!=null&&typeof t!="boolean"},Gt=wi(function(e){return bn(e)?e:e.replace(Oi,"-$&").toLowerCase()}),Kr=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(_i,function(n,o,i){return $e={name:o,styles:i,next:$e},o})}return Ti[t]!==1&&!bn(t)&&typeof r=="number"&&r!==0?r+"px":r};function Ct(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var o=r;if(o.anim===1)return $e={name:o.name,styles:o.styles,next:$e},o.name;var i=r;if(i.styles!==void 0){var c=i.next;if(c!==void 0)for(;c!==void 0;)$e={name:c.name,styles:c.styles,next:$e},c=c.next;var u=i.styles+";";return u}return Ri(e,t,r)}}var f=r;return f}function Ri(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=Ct(e,t,r[o])+";";else for(var i in r){var c=r[i];if(typeof c!="object"){var u=c;qr(u)&&(n+=Gt(i)+":"+Kr(i,u)+";")}else if(Array.isArray(c)&&typeof c[0]=="string"&&t==null)for(var f=0;f<c.length;f++)qr(c[f])&&(n+=Gt(i)+":"+Kr(i,c[f])+";");else{var d=Ct(e,t,c);switch(i){case"animation":case"animationName":{n+=Gt(i)+":"+d+";";break}default:n+=i+"{"+d+"}"}}}return n}var Hr=/label:\s*([^\s;{]+)\s*(;|$)/g,$e;function Ai(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,o="";$e=void 0;var i=e[0];if(i==null||i.raw===void 0)n=!1,o+=Ct(r,t,i);else{var c=i;o+=c[0]}for(var u=1;u<e.length;u++)if(o+=Ct(r,t,e[u]),n){var f=i;o+=f[u]}Hr.lastIndex=0;for(var d="",m;(m=Hr.exec(o))!==null;)d+="-"+m[1];var p=xi(o)+d;return{name:p,styles:o,next:$e}}function ki(e,t){const r=no(e,t);return process.env.NODE_ENV!=="production"?(...n)=>{const o=typeof e=="string"?`"${e}"`:"component";return n.length===0?console.error([`MUI: Seems like you called \`styled(${o})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
|
|
20
|
+
`)):n.some(i=>i===void 0)&&console.error(`MUI: the styled(${o})(...args) API requires all its args to be defined.`),r(...n)}:r}function $i(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Jr=[];function Ve(e){return Jr[0]=e,Ai(Jr)}const Pi=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,n)=>r.val-n.val),t.reduce((r,n)=>({...r,[n.key]:n.val}),{})};function Ii(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5,...o}=e,i=Pi(t),c=Object.keys(i);function u(h){return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${r})`}function f(h){return`@media (max-width:${(typeof t[h]=="number"?t[h]:h)-n/100}${r})`}function d(h,y){const b=c.indexOf(y);return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${r}) and (max-width:${(b!==-1&&typeof t[c[b]]=="number"?t[c[b]]:y)-n/100}${r})`}function m(h){return c.indexOf(h)+1<c.length?d(h,c[c.indexOf(h)+1]):u(h)}function p(h){const y=c.indexOf(h);return y===0?u(c[1]):y===c.length-1?f(c[y]):d(h,c[c.indexOf(h)+1]).replace("@media","@media not all and")}return{keys:c,values:i,up:u,down:f,between:d,only:m,not:p,unit:r,...o}}const Ni={borderRadius:4};function vn(e=8,t=nr({spacing:e})){if(e.mui)return e;const r=(...n)=>(process.env.NODE_ENV!=="production"&&(n.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${n.length}`)),(n.length===0?[1]:n).map(i=>{const c=t(i);return typeof c=="number"?`${c}px`:c}).join(" "));return r.mui=!0,r}function ji(e,t){const r=this;if(r.vars){if(!r.colorSchemes?.[e]||typeof r.getColorSchemeSelector!="function")return{};let n=r.getColorSchemeSelector(e);return n==="&"?t:((n.includes("data-")||n.includes("."))&&(n=`*:where(${n.replace(/\s*&$/,"")}) &`),{[n]:t})}return r.palette.mode===e?t:{}}function Sn(e={},...t){const{breakpoints:r={},palette:n={},spacing:o,shape:i={},...c}=e,u=Ii(r),f=vn(o);let d=Ee({breakpoints:u,direction:"ltr",components:{},palette:{mode:"light",...n},spacing:f,shape:{...Ni,...i}},c);return d=No(d),d.applyStyles=ji,d=t.reduce((m,p)=>Ee(m,p),d),d.unstable_sxConfig={...It,...c?.unstable_sxConfig},d.unstable_sx=function(p){return Ze({sx:p,theme:this})},d}function En(e){const{variants:t,...r}=e,n={variants:t,style:Ve(r),isProcessed:!0};return n.style===r||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=Ve(o.style))}),n}const Di=Sn();function qt(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function Le(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function Mi(e){return e?(t,r)=>r[e]:null}function Bi(e,t,r){e.theme=Wi(e.theme)?r:e.theme[t]||e.theme}function vt(e,t,r){const n=typeof t=="function"?t(e):t;if(Array.isArray(n))return n.flatMap(o=>vt(e,o,r));if(Array.isArray(n?.variants)){let o;if(n.isProcessed)o=r?Le(n.style,r):n.style;else{const{variants:i,...c}=n;o=r?Le(Ve(c),r):c}return Cn(e,n.variants,[o],r)}return n?.isProcessed?r?Le(Ve(n.style),r):n.style:r?Le(Ve(n),r):n}function Cn(e,t,r=[],n=void 0){let o;e:for(let i=0;i<t.length;i+=1){const c=t[i];if(typeof c.props=="function"){if(o??={...e,...e.ownerState,ownerState:e.ownerState},!c.props(o))continue}else for(const u in c.props)if(e[u]!==c.props[u]&&e.ownerState?.[u]!==c.props[u])continue e;typeof c.style=="function"?(o??={...e,...e.ownerState,ownerState:e.ownerState},r.push(n?Le(Ve(c.style(o)),n):c.style(o))):r.push(n?Le(Ve(c.style),n):c.style)}return r}function Fi(e={}){const{themeId:t,defaultTheme:r=Di,rootShouldForwardProp:n=qt,slotShouldForwardProp:o=qt}=e;function i(u){Bi(u,t,r)}return(u,f={})=>{$i(u,K=>K.filter(ae=>ae!==Ze));const{name:d,slot:m,skipVariantsResolver:p,skipSx:h,overridesResolver:y=Mi(xn(m)),...b}=f,l=d&&d.startsWith("Mui")||m?"components":"custom",T=p!==void 0?p:m&&m!=="Root"&&m!=="root"||!1,S=h||!1;let w=qt;m==="Root"||m==="root"?w=n:m?w=o:zi(u)&&(w=void 0);const A=ki(u,{shouldForwardProp:w,label:Vi(d,m),...b}),$=K=>{if(K.__emotion_real===K)return K;if(typeof K=="function")return function(re){return vt(re,K,re.theme.modularCssLayers?l:void 0)};if(Ae(K)){const ae=En(K);return function(z){return ae.variants?vt(z,ae,z.theme.modularCssLayers?l:void 0):z.theme.modularCssLayers?Le(ae.style,l):ae.style}}return K},E=(...K)=>{const ae=[],re=K.map($),z=[];if(ae.push(i),d&&y&&z.push(function(D){const ce=D.theme.components?.[d]?.styleOverrides;if(!ce)return null;const he={};for(const ve in ce)he[ve]=vt(D,ce[ve],D.theme.modularCssLayers?"theme":void 0);return y(D,he)}),d&&!T&&z.push(function(D){const ce=D.theme?.components?.[d]?.variants;return ce?Cn(D,ce,[],D.theme.modularCssLayers?"theme":void 0):null}),S||z.push(Ze),Array.isArray(re[0])){const G=re.shift(),D=new Array(ae.length).fill(""),fe=new Array(z.length).fill("");let ce;ce=[...D,...G,...fe],ce.raw=[...D,...G.raw,...fe],ae.unshift(ce)}const a=[...ae,...re,...z],_=A(...a);return u.muiName&&(_.muiName=u.muiName),process.env.NODE_ENV!=="production"&&(_.displayName=Li(d,m,u)),_};return A.withConfig&&(E.withConfig=A.withConfig),E}}function Li(e,t,r){return e?`${e}${We(t||"")}`:`Styled(${To(r)})`}function Vi(e,t){let r;return process.env.NODE_ENV!=="production"&&e&&(r=`${e}-${xn(t||"Root")}`),r}function Wi(e){for(const t in e)return!1;return!0}function zi(e){return typeof e=="string"&&e.charCodeAt(0)>96}function xn(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function ir(e,t=0,r=1){return process.env.NODE_ENV!=="production"&&(e<t||e>r)&&console.error(`MUI: The value provided ${e} is out of range [${t}, ${r}].`),ko(e,t,r)}function Yi(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(n=>n+n)),process.env.NODE_ENV!=="production"&&e.length!==e.trim().length&&console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`),r?`rgb${r.length===4?"a":""}(${r.map((n,o)=>o<3?parseInt(n,16):Math.round(parseInt(n,16)/255*1e3)/1e3).join(", ")})`:""}function Ne(e){if(e.type)return e;if(e.charAt(0)==="#")return Ne(Yi(e));const t=e.indexOf("("),r=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(process.env.NODE_ENV!=="production"?`MUI: Unsupported \`${e}\` color.
|
|
21
|
+
The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:Ie(9,e));let n=e.substring(t+1,e.length-1),o;if(r==="color"){if(n=n.split(" "),o=n.shift(),n.length===4&&n[3].charAt(0)==="/"&&(n[3]=n[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error(process.env.NODE_ENV!=="production"?`MUI: unsupported \`${o}\` color space.
|
|
22
|
+
The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:Ie(10,o))}else n=n.split(",");return n=n.map(i=>parseFloat(i)),{type:r,values:n,colorSpace:o}}const Ui=e=>{const t=Ne(e);return t.values.slice(0,3).map((r,n)=>t.type.includes("hsl")&&n!==0?`${r}%`:r).join(" ")},ot=(e,t)=>{try{return Ui(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function Nt(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.includes("rgb")?n=n.map((o,i)=>i<3?parseInt(o,10):o):t.includes("hsl")&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),t.includes("color")?n=`${r} ${n.join(" ")}`:n=`${n.join(", ")}`,`${t}(${n})`}function Tn(e){e=Ne(e);const{values:t}=e,r=t[0],n=t[1]/100,o=t[2]/100,i=n*Math.min(o,1-o),c=(d,m=(d+r/30)%12)=>o-i*Math.max(Math.min(m-3,9-m,1),-1);let u="rgb";const f=[Math.round(c(0)*255),Math.round(c(8)*255),Math.round(c(4)*255)];return e.type==="hsla"&&(u+="a",f.push(t[3])),Nt({type:u,values:f})}function Xt(e){e=Ne(e);let t=e.type==="hsl"||e.type==="hsla"?Ne(Tn(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Xr(e,t){const r=Xt(e),n=Xt(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function Gi(e,t){return e=Ne(e),t=ir(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Nt(e)}function yt(e,t,r){try{return Gi(e,t)}catch{return e}}function ar(e,t){if(e=Ne(e),t=ir(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Nt(e)}function oe(e,t,r){try{return ar(e,t)}catch{return e}}function sr(e,t){if(e=Ne(e),t=ir(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Nt(e)}function ie(e,t,r){try{return sr(e,t)}catch{return e}}function qi(e,t=.15){return Xt(e)>.5?ar(e,t):sr(e,t)}function bt(e,t,r){try{return qi(e,t)}catch{return e}}const Ki=Pe.createContext(void 0);process.env.NODE_ENV!=="production"&&(H.node,H.object);function Hi(e){const{theme:t,name:r,props:n}=e;if(!t||!t.components||!t.components[r])return n;const o=t.components[r];return o.defaultProps?Jt(o.defaultProps,n):!o.styleOverrides&&!o.variants?Jt(o,n):n}function Ji({props:e,name:t}){const r=Pe.useContext(Ki);return Hi({props:e,name:t,theme:{components:r}})}const Qr={theme:void 0};function Xi(e){let t,r;return function(o){let i=t;return(i===void 0||o.theme!==r)&&(Qr.theme=o.theme,i=En(e(Qr)),t=i,r=o.theme),i}}function Qi(e=""){function t(...n){if(!n.length)return"";const o=n[0];return typeof o=="string"&&!o.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${o}${t(...n.slice(1))})`:`, ${o}`}return(n,...o)=>`var(--${e?`${e}-`:""}${n}${t(...o)})`}const Zr=(e,t,r,n=[])=>{let o=e;t.forEach((i,c)=>{c===t.length-1?Array.isArray(o)?o[Number(i)]=r:o&&typeof o=="object"&&(o[i]=r):o&&typeof o=="object"&&(o[i]||(o[i]=n.includes(i)?[]:{}),o=o[i])})},Zi=(e,t,r)=>{function n(o,i=[],c=[]){Object.entries(o).forEach(([u,f])=>{(!r||r&&!r([...i,u]))&&f!=null&&(typeof f=="object"&&Object.keys(f).length>0?n(f,[...i,u],Array.isArray(f)?[...c,u]:c):t([...i,u],f,c))})}n(e)},ea=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(n=>e.includes(n))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function Kt(e,t){const{prefix:r,shouldSkipGeneratingVar:n}=t||{},o={},i={},c={};return Zi(e,(u,f,d)=>{if((typeof f=="string"||typeof f=="number")&&(!n||!n(u,f))){const m=`--${r?`${r}-`:""}${u.join("-")}`,p=ea(u,f);Object.assign(o,{[m]:p}),Zr(i,u,`var(${m})`,d),Zr(c,u,`var(${m}, ${p})`,d)}},u=>u[0]==="vars"),{css:o,vars:i,varsWithDefaults:c}}function ta(e,t={}){const{getSelector:r=T,disableCssColorScheme:n,colorSchemeSelector:o}=t,{colorSchemes:i={},components:c,defaultColorScheme:u="light",...f}=e,{vars:d,css:m,varsWithDefaults:p}=Kt(f,t);let h=p;const y={},{[u]:b,...l}=i;if(Object.entries(l||{}).forEach(([A,$])=>{const{vars:E,css:K,varsWithDefaults:ae}=Kt($,t);h=Ee(h,ae),y[A]={css:K,vars:E}}),b){const{css:A,vars:$,varsWithDefaults:E}=Kt(b,t);h=Ee(h,E),y[u]={css:A,vars:$}}function T(A,$){let E=o;if(o==="class"&&(E=".%s"),o==="data"&&(E="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(E=`[${o}="%s"]`),A){if(E==="media")return e.defaultColorScheme===A?":root":{[`@media (prefers-color-scheme: ${i[A]?.palette?.mode||A})`]:{":root":$}};if(E)return e.defaultColorScheme===A?`:root, ${E.replace("%s",String(A))}`:E.replace("%s",String(A))}return":root"}return{vars:h,generateThemeVars:()=>{let A={...d};return Object.entries(y).forEach(([,{vars:$}])=>{A=Ee(A,$)}),A},generateStyleSheets:()=>{const A=[],$=e.defaultColorScheme||"light";function E(re,z){Object.keys(z).length&&A.push(typeof re=="string"?{[re]:{...z}}:re)}E(r(void 0,{...m}),m);const{[$]:K,...ae}=y;if(K){const{css:re}=K,z=i[$]?.palette?.mode,a=!n&&z?{colorScheme:z,...re}:{...re};E(r($,{...a}),a)}return Object.entries(ae).forEach(([re,{css:z}])=>{const a=i[re]?.palette?.mode,_=!n&&a?{colorScheme:a,...z}:{...z};E(r(re,{..._}),_)}),A}}}function ra(e){return function(r){return e==="media"?(process.env.NODE_ENV!=="production"&&r!=="light"&&r!=="dark"&&console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${r}'.`),`@media (prefers-color-scheme: ${r})`):e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${r}"] &`:e==="class"?`.${r} &`:e==="data"?`[data-${r}] &`:`${e.replace("%s",r)} &`:"&"}}const st={black:"#000",white:"#fff"},na={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},qe={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Ke={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},nt={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},He={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},Je={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Xe={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function wn(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:st.white,default:st.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const oa=wn();function On(){return{text:{primary:st.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:st.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const en=On();function tn(e,t,r,n){const o=n.light||n,i=n.dark||n*1.5;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:t==="light"?e.light=sr(e.main,o):t==="dark"&&(e.dark=ar(e.main,i)))}function ia(e="light"){return e==="dark"?{main:He[200],light:He[50],dark:He[400]}:{main:He[700],light:He[400],dark:He[800]}}function aa(e="light"){return e==="dark"?{main:qe[200],light:qe[50],dark:qe[400]}:{main:qe[500],light:qe[300],dark:qe[700]}}function sa(e="light"){return e==="dark"?{main:Ke[500],light:Ke[300],dark:Ke[700]}:{main:Ke[700],light:Ke[400],dark:Ke[800]}}function ca(e="light"){return e==="dark"?{main:Je[400],light:Je[300],dark:Je[700]}:{main:Je[700],light:Je[500],dark:Je[900]}}function la(e="light"){return e==="dark"?{main:Xe[400],light:Xe[300],dark:Xe[700]}:{main:Xe[800],light:Xe[500],dark:Xe[900]}}function ua(e="light"){return e==="dark"?{main:nt[400],light:nt[300],dark:nt[700]}:{main:"#ed6c02",light:nt[500],dark:nt[900]}}function cr(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:n=.2,...o}=e,i=e.primary||ia(t),c=e.secondary||aa(t),u=e.error||sa(t),f=e.info||ca(t),d=e.success||la(t),m=e.warning||ua(t);function p(l){const T=Xr(l,en.text.primary)>=r?en.text.primary:oa.text.primary;if(process.env.NODE_ENV!=="production"){const S=Xr(l,T);S<3&&console.error([`MUI: The contrast ratio of ${S}:1 for ${T} on ${l}`,"falls below the WCAG recommended absolute minimum contrast ratio of 3:1.","https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join(`
|
|
23
|
+
`))}return T}const h=({color:l,name:T,mainShade:S=500,lightShade:w=300,darkShade:A=700})=>{if(l={...l},!l.main&&l[S]&&(l.main=l[S]),!l.hasOwnProperty("main"))throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${T?` (${T})`:""} provided to augmentColor(color) is invalid.
|
|
24
|
+
The color object needs to have a \`main\` property or a \`${S}\` property.`:Ie(11,T?` (${T})`:"",S));if(typeof l.main!="string")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${T?` (${T})`:""} provided to augmentColor(color) is invalid.
|
|
25
|
+
\`color.main\` should be a string, but \`${JSON.stringify(l.main)}\` was provided instead.
|
|
26
|
+
|
|
27
|
+
Did you intend to use one of the following approaches?
|
|
28
|
+
|
|
29
|
+
import { green } from "@mui/material/colors";
|
|
30
|
+
|
|
31
|
+
const theme1 = createTheme({ palette: {
|
|
32
|
+
primary: green,
|
|
33
|
+
} });
|
|
34
|
+
|
|
35
|
+
const theme2 = createTheme({ palette: {
|
|
36
|
+
primary: { main: green[500] },
|
|
37
|
+
} });`:Ie(12,T?` (${T})`:"",JSON.stringify(l.main)));return tn(l,"light",w,n),tn(l,"dark",A,n),l.contrastText||(l.contrastText=p(l.main)),l};let y;return t==="light"?y=wn():t==="dark"&&(y=On()),process.env.NODE_ENV!=="production"&&(y||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),Ee({common:{...st},mode:t,primary:h({color:i,name:"primary"}),secondary:h({color:c,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:u,name:"error"}),warning:h({color:m,name:"warning"}),info:h({color:f,name:"info"}),success:h({color:d,name:"success"}),grey:na,contrastThreshold:r,getContrastText:p,augmentColor:h,tonalOffset:n,...y},o)}function fa(e){const t={};return Object.entries(e).forEach(n=>{const[o,i]=n;typeof i=="object"&&(t[o]=`${i.fontStyle?`${i.fontStyle} `:""}${i.fontVariant?`${i.fontVariant} `:""}${i.fontWeight?`${i.fontWeight} `:""}${i.fontStretch?`${i.fontStretch} `:""}${i.fontSize||""}${i.lineHeight?`/${i.lineHeight} `:""}${i.fontFamily||""}`)}),t}function da(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function pa(e){return Math.round(e*1e5)/1e5}const rn={textTransform:"uppercase"},nn='"Roboto", "Helvetica", "Arial", sans-serif';function ma(e,t){const{fontFamily:r=nn,fontSize:n=14,fontWeightLight:o=300,fontWeightRegular:i=400,fontWeightMedium:c=500,fontWeightBold:u=700,htmlFontSize:f=16,allVariants:d,pxToRem:m,...p}=typeof t=="function"?t(e):t;process.env.NODE_ENV!=="production"&&(typeof n!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof f!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const h=n/14,y=m||(T=>`${T/f*h}rem`),b=(T,S,w,A,$)=>({fontFamily:r,fontWeight:T,fontSize:y(S),lineHeight:w,...r===nn?{letterSpacing:`${pa(A/S)}em`}:{},...$,...d}),l={h1:b(o,96,1.167,-1.5),h2:b(o,60,1.2,-.5),h3:b(i,48,1.167,0),h4:b(i,34,1.235,.25),h5:b(i,24,1.334,0),h6:b(c,20,1.6,.15),subtitle1:b(i,16,1.75,.15),subtitle2:b(c,14,1.57,.1),body1:b(i,16,1.5,.15),body2:b(i,14,1.43,.15),button:b(c,14,1.75,.4,rn),caption:b(i,12,1.66,.4),overline:b(i,12,2.66,1,rn),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Ee({htmlFontSize:f,pxToRem:y,fontFamily:r,fontSize:n,fontWeightLight:o,fontWeightRegular:i,fontWeightMedium:c,fontWeightBold:u,...l},p,{clone:!1})}const ha=.2,ga=.14,ya=.12;function se(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${ha})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${ga})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${ya})`].join(",")}const ba=["none",se(0,2,1,-1,0,1,1,0,0,1,3,0),se(0,3,1,-2,0,2,2,0,0,1,5,0),se(0,3,3,-2,0,3,4,0,0,1,8,0),se(0,2,4,-1,0,4,5,0,0,1,10,0),se(0,3,5,-1,0,5,8,0,0,1,14,0),se(0,3,5,-1,0,6,10,0,0,1,18,0),se(0,4,5,-2,0,7,10,1,0,2,16,1),se(0,5,5,-3,0,8,10,1,0,3,14,2),se(0,5,6,-3,0,9,12,1,0,3,16,2),se(0,6,6,-3,0,10,14,1,0,4,18,3),se(0,6,7,-4,0,11,15,1,0,4,20,3),se(0,7,8,-4,0,12,17,2,0,5,22,4),se(0,7,8,-4,0,13,19,2,0,5,24,4),se(0,7,9,-4,0,14,21,2,0,5,26,4),se(0,8,9,-5,0,15,22,2,0,6,28,5),se(0,8,10,-5,0,16,24,2,0,6,30,5),se(0,8,11,-5,0,17,26,2,0,6,32,5),se(0,9,11,-5,0,18,28,2,0,7,34,6),se(0,9,12,-6,0,19,29,2,0,7,36,6),se(0,10,13,-6,0,20,31,3,0,8,38,7),se(0,10,13,-6,0,21,33,3,0,8,40,7),se(0,10,14,-6,0,22,35,3,0,8,42,7),se(0,11,14,-7,0,23,36,3,0,9,44,8),se(0,11,15,-7,0,24,38,3,0,9,46,8)],va={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Sa={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function on(e){return`${Math.round(e)}ms`}function Ea(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function Ca(e){const t={...va,...e.easing},r={...Sa,...e.duration};return{getAutoHeightDuration:Ea,create:(o=["all"],i={})=>{const{duration:c=r.standard,easing:u=t.easeInOut,delay:f=0,...d}=i;if(process.env.NODE_ENV!=="production"){const m=h=>typeof h=="string",p=h=>!Number.isNaN(parseFloat(h));!m(o)&&!Array.isArray(o)&&console.error('MUI: Argument "props" must be a string or Array.'),!p(c)&&!m(c)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${c}.`),m(u)||console.error('MUI: Argument "easing" must be a string.'),!p(f)&&!m(f)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof i!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
|
|
38
|
+
`)),Object.keys(d).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(d).join(",")}].`)}return(Array.isArray(o)?o:[o]).map(m=>`${m} ${typeof c=="string"?c:on(c)} ${u} ${typeof f=="string"?f:on(f)}`).join(",")},...e,easing:t,duration:r}}const xa={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Ta(e){return Ae(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function _n(e={}){const t={...e};function r(n){const o=Object.entries(n);for(let i=0;i<o.length;i++){const[c,u]=o[i];!Ta(u)||c.startsWith("unstable_")?delete n[c]:Ae(u)&&(n[c]={...u},r(n[c]))}}return r(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
39
|
+
|
|
40
|
+
const theme = ${JSON.stringify(t,null,2)};
|
|
41
|
+
|
|
42
|
+
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
43
|
+
theme.transitions = createTransitions(theme.transitions || {});
|
|
44
|
+
|
|
45
|
+
export default theme;`}function Qt(e={},...t){const{breakpoints:r,mixins:n={},spacing:o,palette:i={},transitions:c={},typography:u={},shape:f,...d}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":Ie(20));const m=cr(i),p=Sn(e);let h=Ee(p,{mixins:da(p.breakpoints,n),palette:m,shadows:ba.slice(),typography:ma(m,u),transitions:Ca(c),zIndex:{...xa}});if(h=Ee(h,d),h=t.reduce((y,b)=>Ee(y,b),h),process.env.NODE_ENV!=="production"){const y=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],b=(l,T)=>{let S;for(S in l){const w=l[S];if(y.includes(S)&&Object.keys(w).length>0){if(process.env.NODE_ENV!=="production"){const A=rr("",S);console.error([`MUI: The \`${T}\` component increases the CSS specificity of the \`${S}\` internal state.`,"You can not override it like this: ",JSON.stringify(l,null,2),"",`Instead, you need to use the '&.${A}' syntax:`,JSON.stringify({root:{[`&.${A}`]:w}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
|
|
46
|
+
`))}l[S]={}}}};Object.keys(h.components).forEach(l=>{const T=h.components[l].styleOverrides;T&&l.startsWith("Mui")&&b(T,l)})}return h.unstable_sxConfig={...It,...d?.unstable_sxConfig},h.unstable_sx=function(b){return Ze({sx:b,theme:this})},h.toRuntimeSource=_n,h}function wa(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const Oa=[...Array(25)].map((e,t)=>{if(t===0)return"none";const r=wa(t);return`linear-gradient(rgba(255 255 255 / ${r}), rgba(255 255 255 / ${r}))`});function Rn(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function An(e){return e==="dark"?Oa:[]}function _a(e){const{palette:t={mode:"light"},opacity:r,overlays:n,...o}=e,i=cr(t);return{palette:i,opacity:{...Rn(i.mode),...r},overlays:n||An(i.mode),...o}}function Ra(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const Aa=e=>[...[...Array(25)].map((t,r)=>`--${e?`${e}-`:""}overlays-${r}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],ka=e=>(t,r)=>{const n=e.rootSelector||":root",o=e.colorSchemeSelector;let i=o;if(o==="class"&&(i=".%s"),o==="data"&&(i="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(i=`[${o}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const c={};return Aa(e.cssVarPrefix).forEach(u=>{c[u]=r[u],delete r[u]}),i==="media"?{[n]:r,"@media (prefers-color-scheme: dark)":{[n]:c}}:i?{[i.replace("%s",t)]:c,[`${n}, ${i.replace("%s",t)}`]:r}:{[n]:{...r,...c}}}if(i&&i!=="media")return`${n}, ${i.replace("%s",String(t))}`}else if(t){if(i==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[n]:r}};if(i)return i.replace("%s",String(t))}return n};function $a(e,t){t.forEach(r=>{e[r]||(e[r]={})})}function g(e,t,r){!e[t]&&r&&(e[t]=r)}function it(e){return typeof e!="string"||!e.startsWith("hsl")?e:Tn(e)}function Re(e,t){`${t}Channel`in e||(e[`${t}Channel`]=ot(it(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
|
|
47
|
+
To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function Pa(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const _e=e=>{try{return e()}catch{}},Ia=(e="mui")=>Qi(e);function Ht(e,t,r,n){if(!t)return;t=t===!0?{}:t;const o=n==="dark"?"dark":"light";if(!r){e[n]=_a({...t,palette:{mode:o,...t?.palette}});return}const{palette:i,...c}=Qt({...r,palette:{mode:o,...t?.palette}});return e[n]={...t,palette:i,opacity:{...Rn(o),...t?.opacity},overlays:t?.overlays||An(o)},c}function Na(e={},...t){const{colorSchemes:r={light:!0},defaultColorScheme:n,disableCssColorScheme:o=!1,cssVarPrefix:i="mui",shouldSkipGeneratingVar:c=Ra,colorSchemeSelector:u=r.light&&r.dark?"media":void 0,rootSelector:f=":root",...d}=e,m=Object.keys(r)[0],p=n||(r.light&&m!=="light"?"light":m),h=Ia(i),{[p]:y,light:b,dark:l,...T}=r,S={...T};let w=y;if((p==="dark"&&!("dark"in r)||p==="light"&&!("light"in r))&&(w=!0),!w)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${p}\` option is either missing or invalid.`:Ie(21,p));const A=Ht(S,w,d,p);b&&!S.light&&Ht(S,b,void 0,"light"),l&&!S.dark&&Ht(S,l,void 0,"dark");let $={defaultColorScheme:p,...A,cssVarPrefix:i,colorSchemeSelector:u,rootSelector:f,getCssVar:h,colorSchemes:S,font:{...fa(A.typography),...A.font},spacing:Pa(d.spacing)};Object.keys($.colorSchemes).forEach(z=>{const a=$.colorSchemes[z].palette,_=G=>{const D=G.split("-"),fe=D[1],ce=D[2];return h(G,a[fe][ce])};if(a.mode==="light"&&(g(a.common,"background","#fff"),g(a.common,"onBackground","#000")),a.mode==="dark"&&(g(a.common,"background","#000"),g(a.common,"onBackground","#fff")),$a(a,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),a.mode==="light"){g(a.Alert,"errorColor",oe(a.error.light,.6)),g(a.Alert,"infoColor",oe(a.info.light,.6)),g(a.Alert,"successColor",oe(a.success.light,.6)),g(a.Alert,"warningColor",oe(a.warning.light,.6)),g(a.Alert,"errorFilledBg",_("palette-error-main")),g(a.Alert,"infoFilledBg",_("palette-info-main")),g(a.Alert,"successFilledBg",_("palette-success-main")),g(a.Alert,"warningFilledBg",_("palette-warning-main")),g(a.Alert,"errorFilledColor",_e(()=>a.getContrastText(a.error.main))),g(a.Alert,"infoFilledColor",_e(()=>a.getContrastText(a.info.main))),g(a.Alert,"successFilledColor",_e(()=>a.getContrastText(a.success.main))),g(a.Alert,"warningFilledColor",_e(()=>a.getContrastText(a.warning.main))),g(a.Alert,"errorStandardBg",ie(a.error.light,.9)),g(a.Alert,"infoStandardBg",ie(a.info.light,.9)),g(a.Alert,"successStandardBg",ie(a.success.light,.9)),g(a.Alert,"warningStandardBg",ie(a.warning.light,.9)),g(a.Alert,"errorIconColor",_("palette-error-main")),g(a.Alert,"infoIconColor",_("palette-info-main")),g(a.Alert,"successIconColor",_("palette-success-main")),g(a.Alert,"warningIconColor",_("palette-warning-main")),g(a.AppBar,"defaultBg",_("palette-grey-100")),g(a.Avatar,"defaultBg",_("palette-grey-400")),g(a.Button,"inheritContainedBg",_("palette-grey-300")),g(a.Button,"inheritContainedHoverBg",_("palette-grey-A100")),g(a.Chip,"defaultBorder",_("palette-grey-400")),g(a.Chip,"defaultAvatarColor",_("palette-grey-700")),g(a.Chip,"defaultIconColor",_("palette-grey-700")),g(a.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),g(a.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),g(a.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),g(a.LinearProgress,"primaryBg",ie(a.primary.main,.62)),g(a.LinearProgress,"secondaryBg",ie(a.secondary.main,.62)),g(a.LinearProgress,"errorBg",ie(a.error.main,.62)),g(a.LinearProgress,"infoBg",ie(a.info.main,.62)),g(a.LinearProgress,"successBg",ie(a.success.main,.62)),g(a.LinearProgress,"warningBg",ie(a.warning.main,.62)),g(a.Skeleton,"bg",`rgba(${_("palette-text-primaryChannel")} / 0.11)`),g(a.Slider,"primaryTrack",ie(a.primary.main,.62)),g(a.Slider,"secondaryTrack",ie(a.secondary.main,.62)),g(a.Slider,"errorTrack",ie(a.error.main,.62)),g(a.Slider,"infoTrack",ie(a.info.main,.62)),g(a.Slider,"successTrack",ie(a.success.main,.62)),g(a.Slider,"warningTrack",ie(a.warning.main,.62));const G=bt(a.background.default,.8);g(a.SnackbarContent,"bg",G),g(a.SnackbarContent,"color",_e(()=>a.getContrastText(G))),g(a.SpeedDialAction,"fabHoverBg",bt(a.background.paper,.15)),g(a.StepConnector,"border",_("palette-grey-400")),g(a.StepContent,"border",_("palette-grey-400")),g(a.Switch,"defaultColor",_("palette-common-white")),g(a.Switch,"defaultDisabledColor",_("palette-grey-100")),g(a.Switch,"primaryDisabledColor",ie(a.primary.main,.62)),g(a.Switch,"secondaryDisabledColor",ie(a.secondary.main,.62)),g(a.Switch,"errorDisabledColor",ie(a.error.main,.62)),g(a.Switch,"infoDisabledColor",ie(a.info.main,.62)),g(a.Switch,"successDisabledColor",ie(a.success.main,.62)),g(a.Switch,"warningDisabledColor",ie(a.warning.main,.62)),g(a.TableCell,"border",ie(yt(a.divider,1),.88)),g(a.Tooltip,"bg",yt(a.grey[700],.92))}if(a.mode==="dark"){g(a.Alert,"errorColor",ie(a.error.light,.6)),g(a.Alert,"infoColor",ie(a.info.light,.6)),g(a.Alert,"successColor",ie(a.success.light,.6)),g(a.Alert,"warningColor",ie(a.warning.light,.6)),g(a.Alert,"errorFilledBg",_("palette-error-dark")),g(a.Alert,"infoFilledBg",_("palette-info-dark")),g(a.Alert,"successFilledBg",_("palette-success-dark")),g(a.Alert,"warningFilledBg",_("palette-warning-dark")),g(a.Alert,"errorFilledColor",_e(()=>a.getContrastText(a.error.dark))),g(a.Alert,"infoFilledColor",_e(()=>a.getContrastText(a.info.dark))),g(a.Alert,"successFilledColor",_e(()=>a.getContrastText(a.success.dark))),g(a.Alert,"warningFilledColor",_e(()=>a.getContrastText(a.warning.dark))),g(a.Alert,"errorStandardBg",oe(a.error.light,.9)),g(a.Alert,"infoStandardBg",oe(a.info.light,.9)),g(a.Alert,"successStandardBg",oe(a.success.light,.9)),g(a.Alert,"warningStandardBg",oe(a.warning.light,.9)),g(a.Alert,"errorIconColor",_("palette-error-main")),g(a.Alert,"infoIconColor",_("palette-info-main")),g(a.Alert,"successIconColor",_("palette-success-main")),g(a.Alert,"warningIconColor",_("palette-warning-main")),g(a.AppBar,"defaultBg",_("palette-grey-900")),g(a.AppBar,"darkBg",_("palette-background-paper")),g(a.AppBar,"darkColor",_("palette-text-primary")),g(a.Avatar,"defaultBg",_("palette-grey-600")),g(a.Button,"inheritContainedBg",_("palette-grey-800")),g(a.Button,"inheritContainedHoverBg",_("palette-grey-700")),g(a.Chip,"defaultBorder",_("palette-grey-700")),g(a.Chip,"defaultAvatarColor",_("palette-grey-300")),g(a.Chip,"defaultIconColor",_("palette-grey-300")),g(a.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),g(a.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),g(a.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),g(a.LinearProgress,"primaryBg",oe(a.primary.main,.5)),g(a.LinearProgress,"secondaryBg",oe(a.secondary.main,.5)),g(a.LinearProgress,"errorBg",oe(a.error.main,.5)),g(a.LinearProgress,"infoBg",oe(a.info.main,.5)),g(a.LinearProgress,"successBg",oe(a.success.main,.5)),g(a.LinearProgress,"warningBg",oe(a.warning.main,.5)),g(a.Skeleton,"bg",`rgba(${_("palette-text-primaryChannel")} / 0.13)`),g(a.Slider,"primaryTrack",oe(a.primary.main,.5)),g(a.Slider,"secondaryTrack",oe(a.secondary.main,.5)),g(a.Slider,"errorTrack",oe(a.error.main,.5)),g(a.Slider,"infoTrack",oe(a.info.main,.5)),g(a.Slider,"successTrack",oe(a.success.main,.5)),g(a.Slider,"warningTrack",oe(a.warning.main,.5));const G=bt(a.background.default,.98);g(a.SnackbarContent,"bg",G),g(a.SnackbarContent,"color",_e(()=>a.getContrastText(G))),g(a.SpeedDialAction,"fabHoverBg",bt(a.background.paper,.15)),g(a.StepConnector,"border",_("palette-grey-600")),g(a.StepContent,"border",_("palette-grey-600")),g(a.Switch,"defaultColor",_("palette-grey-300")),g(a.Switch,"defaultDisabledColor",_("palette-grey-600")),g(a.Switch,"primaryDisabledColor",oe(a.primary.main,.55)),g(a.Switch,"secondaryDisabledColor",oe(a.secondary.main,.55)),g(a.Switch,"errorDisabledColor",oe(a.error.main,.55)),g(a.Switch,"infoDisabledColor",oe(a.info.main,.55)),g(a.Switch,"successDisabledColor",oe(a.success.main,.55)),g(a.Switch,"warningDisabledColor",oe(a.warning.main,.55)),g(a.TableCell,"border",oe(yt(a.divider,1),.68)),g(a.Tooltip,"bg",yt(a.grey[700],.92))}Re(a.background,"default"),Re(a.background,"paper"),Re(a.common,"background"),Re(a.common,"onBackground"),Re(a,"divider"),Object.keys(a).forEach(G=>{const D=a[G];G!=="tonalOffset"&&D&&typeof D=="object"&&(D.main&&g(a[G],"mainChannel",ot(it(D.main))),D.light&&g(a[G],"lightChannel",ot(it(D.light))),D.dark&&g(a[G],"darkChannel",ot(it(D.dark))),D.contrastText&&g(a[G],"contrastTextChannel",ot(it(D.contrastText))),G==="text"&&(Re(a[G],"primary"),Re(a[G],"secondary")),G==="action"&&(D.active&&Re(a[G],"active"),D.selected&&Re(a[G],"selected")))})}),$=t.reduce((z,a)=>Ee(z,a),$);const E={prefix:i,disableCssColorScheme:o,shouldSkipGeneratingVar:c,getSelector:ka($)},{vars:K,generateThemeVars:ae,generateStyleSheets:re}=ta($,E);return $.vars=K,Object.entries($.colorSchemes[$.defaultColorScheme]).forEach(([z,a])=>{$[z]=a}),$.generateThemeVars=ae,$.generateStyleSheets=re,$.generateSpacing=function(){return vn(d.spacing,nr(this))},$.getColorSchemeSelector=ra(u),$.spacing=$.generateSpacing(),$.shouldSkipGeneratingVar=c,$.unstable_sxConfig={...It,...d?.unstable_sxConfig},$.unstable_sx=function(a){return Ze({sx:a,theme:this})},$.toRuntimeSource=_n,$}function an(e,t,r){e.colorSchemes&&r&&(e.colorSchemes[t]={...r!==!0&&r,palette:cr({...r===!0?{}:r.palette,mode:t})})}function kn(e={},...t){const{palette:r,cssVariables:n=!1,colorSchemes:o=r?void 0:{light:!0},defaultColorScheme:i=r?.mode,...c}=e,u=i||"light",f=o?.[u],d={...o,...r?{[u]:{...typeof f!="boolean"&&f,palette:r}}:void 0};if(n===!1){if(!("colorSchemes"in e))return Qt(e,...t);let m=r;"palette"in e||d[u]&&(d[u]!==!0?m=d[u].palette:u==="dark"&&(m={mode:"dark"}));const p=Qt({...e,palette:m},...t);return p.defaultColorScheme=u,p.colorSchemes=d,p.palette.mode==="light"&&(p.colorSchemes.light={...d.light!==!0&&d.light,palette:p.palette},an(p,"dark",d.dark)),p.palette.mode==="dark"&&(p.colorSchemes.dark={...d.dark!==!0&&d.dark,palette:p.palette},an(p,"light",d.light)),p}return!r&&!("light"in d)&&u==="light"&&(d.light=!0),Na({...c,colorSchemes:d,defaultColorScheme:u,...typeof n!="boolean"&&n},...t)}const ja=kn(),Da="$$material";function Ma(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Ba=e=>Ma(e)&&e!=="classes",Fa=Fi({themeId:Da,defaultTheme:ja,rootShouldForwardProp:Ba}),La=Xi;process.env.NODE_ENV!=="production"&&(H.node,H.object.isRequired);function Va(e){return Ji(e)}function Wa(e){return rr("MuiSvgIcon",e)}Ao("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const za=e=>{const{color:t,fontSize:r,classes:n}=e,o={root:["root",t!=="inherit"&&`color${We(t)}`,`fontSize${We(r)}`]};return wo(o,Wa,n)},Ya=Fa("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="inherit"&&t[`color${We(r.color)}`],t[`fontSize${We(r.fontSize)}`]]}})(La(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),xt=Pe.forwardRef(function(t,r){const n=Va({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:c="inherit",component:u="svg",fontSize:f="medium",htmlColor:d,inheritViewBox:m=!1,titleAccess:p,viewBox:h="0 0 24 24",...y}=n,b=Pe.isValidElement(o)&&o.type==="svg",l={...n,color:c,component:u,fontSize:f,instanceFontSize:t.fontSize,inheritViewBox:m,viewBox:h,hasSvgAsChild:b},T={};m||(T.viewBox=h);const S=za(l);return x.jsxs(Ya,{as:u,className:$o(S.root,i),focusable:"false",color:d,"aria-hidden":p?void 0:!0,role:p?"img":void 0,ref:r,...T,...y,...b&&o.props,ownerState:l,children:[b?o.props.children:o,p?x.jsx("title",{children:p}):null]})});process.env.NODE_ENV!=="production"&&(xt.propTypes={children:H.node,classes:H.object,className:H.string,color:H.oneOfType([H.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),H.string]),component:H.elementType,fontSize:H.oneOfType([H.oneOf(["inherit","large","medium","small"]),H.string]),htmlColor:H.string,inheritViewBox:H.bool,shapeRendering:H.string,sx:H.oneOfType([H.arrayOf(H.oneOfType([H.func,H.object,H.bool])),H.func,H.object]),titleAccess:H.string,viewBox:H.string});xt.muiName="SvgIcon";function ft(e,t){function r(n,o){return x.jsx(xt,{"data-testid":`${t}Icon`,ref:o,...n,children:e})}return process.env.NODE_ENV!=="production"&&(r.displayName=`${t}Icon`),r.muiName=xt.muiName,Pe.memo(Pe.forwardRef(r))}const Zt=ft(x.jsx("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2m6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1z"}),"Notifications"),$n=({unreadCount:e=0,onClick:t,showBadge:r=!0})=>x.jsx(P.IconButton,{onClick:t,color:"inherit",className:"relative",children:r&&e>0?x.jsx(P.Badge,{badgeContent:e>99?"99+":e,color:"error",children:x.jsx(Zt,{})}):x.jsx(Zt,{})}),Ua=ft(x.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),Ga=ft(x.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle"),qa=ft(x.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),lr=({notification:e,onMarkAsRead:t,onDelete:r,onClick:n})=>{const o=e.read!==!0,i=()=>{n&&n(e)},c=p=>{p.stopPropagation(),t&&t(e.notificationId)},u=p=>{p.stopPropagation(),r&&r(e.notificationId)},f=e.payload||{},d=e.renderedContent?.inApp?.title||e.renderedContent?.push?.title||f.title||f.message||"Notification",m=e.renderedContent?.inApp?.message||e.renderedContent?.push?.body||f.message||"";return x.jsxs(P.ListItem,{className:`cursor-pointer hover:bg-gray-50 ${o?"bg-blue-50":""}`,onClick:i,sx:{borderRadius:"8px",mb:.5,"&:hover":{backgroundColor:"action.hover"}},children:[x.jsx(P.Box,{className:"mr-2",children:x.jsx(Zt,{color:o?"primary":"disabled"})}),x.jsx(P.ListItemText,{primary:x.jsxs(P.Box,{className:"flex items-center gap-2",children:[x.jsx("span",{className:"font-medium",children:d}),o&&x.jsx(P.Chip,{label:"New",size:"small",color:"primary",className:"h-5 text-xs"})]}),secondary:m,primaryTypographyProps:{className:o?"font-semibold":""}}),x.jsx(P.ListItemSecondaryAction,{children:x.jsxs(P.Box,{className:"flex items-center gap-1",children:[o&&x.jsx(P.IconButton,{edge:"end",size:"small",onClick:c,title:"Mark as read",children:x.jsx(Ga,{fontSize:"small"})}),x.jsx(P.IconButton,{edge:"end",size:"small",onClick:u,title:"Delete",children:x.jsx(qa,{fontSize:"small"})})]})})]})},Ka=ft(x.jsx("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"}),"NotificationsNone"),Pn=({message:e="No notifications",icon:t})=>x.jsxs(P.Box,{className:"flex flex-col items-center justify-center p-8 text-center",sx:{minHeight:"200px"},children:[t||x.jsx(Ka,{sx:{fontSize:48,color:"text.secondary",mb:2}}),x.jsx(P.Typography,{variant:"body2",color:"text.secondary",children:e})]});function er(e){"@babel/helpers - typeof";return er=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},er(e)}function ur(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Oe(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function ct(e){Oe(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||er(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Ha(e,t){Oe(2,arguments);var r=ct(e),n=ur(t);return isNaN(n)?new Date(NaN):(n&&r.setDate(r.getDate()+n),r)}var Ja={};function Xa(){return Ja}function sn(e,t){var r,n,o,i,c,u;Oe(1,arguments);var f=Xa(),d=ur((r=(n=(o=(i=void 0)!==null&&i!==void 0?i:void 0)!==null&&o!==void 0?o:f.weekStartsOn)!==null&&n!==void 0?n:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=ct(e),p=m.getDay(),h=(p<d?7:0)+p-d;return m.setDate(m.getDate()-h),m.setHours(0,0,0,0),m}function cn(e){Oe(1,arguments);var t=ct(e);return t.setHours(0,0,0,0),t}function In(e,t){Oe(2,arguments);var r=cn(e),n=cn(t);return r.getTime()===n.getTime()}function Qa(e,t,r){Oe(2,arguments);var n=sn(e,r),o=sn(t,r);return n.getTime()===o.getTime()}function Za(e,t){Oe(2,arguments);var r=ct(e),n=ct(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function es(e){return Oe(1,arguments),Za(Date.now(),e)}function ts(e,t){return Oe(1,arguments),Qa(e,Date.now(),t)}function rs(e){return Oe(1,arguments),In(e,Date.now())}function ns(e,t){Oe(2,arguments);var r=ur(t);return Ha(e,-r)}function os(e){return Oe(1,arguments),In(e,ns(Date.now(),1))}const is=({groupLabel:e,notifications:t,onMarkAsRead:r,onDelete:n,onClick:o})=>t.length===0?null:x.jsxs(P.Box,{sx:{mb:2},children:[x.jsx(P.Typography,{variant:"caption",sx:{color:"text.secondary",px:2,py:1,display:"block"},children:e}),x.jsx(P.Divider,{sx:{mb:1}}),t.map(i=>x.jsx(lr,{notification:i,onMarkAsRead:r,onDelete:n,onClick:o},i.notificationId))]});function as(e){const t={today:[],yesterday:[],thisWeek:[],thisMonth:[],older:[]};return e.forEach(r=>{const n=r.createdAt?new Date(r.createdAt):new Date;rs(n)?t.today.push(r):os(n)?t.yesterday.push(r):ts(n)?t.thisWeek.push(r):es(n)?t.thisMonth.push(r):t.older.push(r)}),t}function ss(e){switch(e){case"today":return"Today";case"yesterday":return"Yesterday";case"thisWeek":return"This Week";case"thisMonth":return"This Month";case"older":return"Older";default:return e}}const cs=({client:e,subscriberId:t,tenantId:r,onClose:n})=>{const[o,i]=Z.useState({email:!0,push:!0,sms:!0,in_app:!0}),[c,u]=Z.useState({}),[f,d]=Z.useState(!1);Z.useEffect(()=>{m()},[]);const m=async()=>{try{const y=await e.preferences.get(r,t);i({email:y.emailEnabled,push:y.pushEnabled,sms:y.smsEnabled,in_app:y.inAppEnabled}),y.categories&&u(y.categories)}catch(y){console.error("Failed to load preferences:",y)}},p=async(y,b)=>{const l={...o,[y]:b};i(l);try{d(!0),await e.preferences.update(r,t,{emailEnabled:l.email,pushEnabled:l.push,smsEnabled:l.sms,inAppEnabled:l.in_app})}catch(T){console.error("Failed to update preferences:",T),i(S=>({...S,[y]:!b}))}finally{d(!1)}},h=async()=>{try{d(!0),await e.preferences.update(r,t,{emailEnabled:o.email,pushEnabled:o.push,smsEnabled:o.sms,inAppEnabled:o.in_app,categories:c}),n&&n()}catch(y){console.error("Failed to save preferences:",y)}finally{d(!1)}};return x.jsxs(P.Box,{sx:{p:3,minWidth:300},children:[x.jsx(P.Typography,{variant:"h6",gutterBottom:!0,children:"Notification Preferences"}),x.jsx(P.Divider,{sx:{my:2}}),x.jsx(P.Typography,{variant:"subtitle2",sx:{mb:2,fontWeight:"bold"},children:"Channels"}),x.jsx(P.FormControlLabel,{control:x.jsx(P.Switch,{checked:o.email,onChange:y=>p("email",y.target.checked),disabled:f}),label:"Email"}),x.jsx(P.FormControlLabel,{control:x.jsx(P.Switch,{checked:o.push,onChange:y=>p("push",y.target.checked),disabled:f}),label:"Push Notifications"}),x.jsx(P.FormControlLabel,{control:x.jsx(P.Switch,{checked:o.sms,onChange:y=>p("sms",y.target.checked),disabled:f}),label:"SMS"}),x.jsx(P.FormControlLabel,{control:x.jsx(P.Switch,{checked:o.in_app,onChange:y=>p("in_app",y.target.checked),disabled:f}),label:"In-App"}),x.jsxs(P.Box,{sx:{mt:3,display:"flex",justifyContent:"flex-end",gap:1},children:[n&&x.jsx(P.Button,{onClick:n,variant:"outlined",size:"small",children:"Cancel"}),x.jsx(P.Button,{onClick:h,variant:"contained",size:"small",disabled:f,children:"Save"})]})]})},Nn=({notifications:e,loading:t=!1,error:r=null,onNotificationClick:n,onMarkAsRead:o,onDelete:i,subscriberId:c,tenantId:u,client:f,groupByDate:d=!0})=>{const[m,p]=Z.useState("all"),[h,y]=Z.useState(null),b=m==="unread"?e.filter(w=>w.read!==!0):e;if(t)return x.jsx(P.Box,{className:"flex items-center justify-center p-8",children:x.jsx(P.CircularProgress,{size:40})});if(r)return x.jsx(P.Alert,{severity:"error",className:"m-4",children:r.message||"Failed to load notifications"});if(e.length===0)return x.jsx(Pn,{});const l=async w=>{o&&await o(w)},T=async w=>{i&&await i(w)},S=d?as(b):{all:b};return x.jsxs(P.Box,{children:[x.jsxs(P.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:2,py:1,borderBottom:1,borderColor:"divider"},children:[x.jsxs(P.Tabs,{value:m,onChange:(w,A)=>p(A),children:[x.jsx(P.Tab,{label:"All",value:"all"}),x.jsx(P.Tab,{label:"Unread",value:"unread"})]}),f&&c&&u&&x.jsxs(x.Fragment,{children:[x.jsx(P.IconButton,{size:"small",onClick:w=>y(w.currentTarget),title:"Preferences",children:x.jsx(Ua,{fontSize:"small"})}),x.jsx(P.Popover,{open:!!h,anchorEl:h,onClose:()=>y(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:x.jsx(cs,{client:f,subscriberId:c,tenantId:u,onClose:()=>y(null)})})]})]}),x.jsx(P.List,{className:"max-h-96 overflow-y-auto",sx:{padding:0},children:d?Object.entries(S).map(([w,A])=>x.jsx(is,{groupLabel:ss(w),notifications:A,onMarkAsRead:l,onDelete:T,onClick:n},w)):b.map(w=>x.jsx(lr,{notification:w,onMarkAsRead:l,onDelete:T,onClick:n},w.notificationId))})]})},ls=({client:e,tenantId:t,subscriberId:r,environmentId:n,position:o="top-right",maxNotifications:i=50,showUnreadBadge:c=!0,onNotificationClick:u,onMarkAsRead:f,onDelete:d,pollInterval:m})=>{const[p,h]=Z.useState(null),y=!!p,{notifications:b,loading:l,error:T,unreadCount:S,connected:w,markAsRead:A,deleteNotification:$}=fn({client:e,tenantId:t,subscriberId:r,environmentId:n,pollInterval:m}),E=_=>{h(_.currentTarget)},K=()=>{h(null)},ae=async _=>{await A(_),f&&await f(_)},re=async _=>{await $(_),d&&await d(_)},z=b.slice(0,i),a=()=>{const _={};return o.includes("top")?_.top="8px":_.bottom="8px",o.includes("right")?_.right="8px":_.left="8px",_};return x.jsxs(x.Fragment,{children:[x.jsx($n,{unreadCount:S,onClick:E,showBadge:c}),x.jsx(P.Popover,{open:y,anchorEl:p,onClose:K,anchorOrigin:{vertical:o.includes("bottom")?"bottom":"top",horizontal:o.includes("right")?"right":"left"},transformOrigin:{vertical:o.includes("bottom")?"top":"bottom",horizontal:o.includes("right")?"right":"left"},PaperProps:{sx:{width:400,maxWidth:"90vw",maxHeight:"80vh",...a()}},children:x.jsxs(P.Paper,{className:"notification-center",sx:{borderRadius:"15px",overflow:"hidden"},children:[x.jsx(P.Box,{className:"p-4 border-b border-gray-200",children:x.jsxs(P.Box,{className:"flex items-center justify-between",children:[x.jsx("h3",{className:"text-lg font-semibold",children:"Notifications"}),w&&x.jsxs(P.Box,{className:"flex items-center gap-2",children:[x.jsx(P.Box,{className:"w-2 h-2 bg-green-500 rounded-full",title:"Connected"}),x.jsx("span",{className:"text-xs text-gray-500",children:"Live"})]})]})}),x.jsx(Nn,{notifications:z,loading:l,error:T,onNotificationClick:u,onMarkAsRead:ae,onDelete:re,subscriberId:r,tenantId:t,client:e,groupByDate:!0})]})})]})},us=kn({palette:{primary:{main:"#1E3A8A"},secondary:{main:"rgba(30, 58, 138, 0.75)"}},components:{MuiPaper:{styleOverrides:{root:{boxShadow:"none",borderRadius:"15px"}}},MuiTableContainer:{styleOverrides:{root:{border:"1px solid #E9EAEB",borderRadius:"15px","&::-webkit-scrollbar":{width:"8px",height:"8px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"darkgray",borderRadius:"4px"},"&::-webkit-scrollbar-track":{backgroundColor:"transparent"},scrollbarWidth:"thin",scrollbarColor:"darkgray transparent"}}},MuiList:{styleOverrides:{root:{padding:0}}},MuiListItem:{styleOverrides:{root:{borderRadius:"8px",marginBottom:"4px"}}}}});exports.EmptyState=Pn;exports.NotificationBell=$n;exports.NotificationCenter=ls;exports.NotificationItem=lr;exports.NotificationList=Nn;exports.notificationTheme=us;exports.useNotificationCenter=fn;exports.useNotifications=ln;exports.useWebSocket=un;
|
|
48
|
+
//# sourceMappingURL=index.cjs.js.map
|