@crystaldesign/diva-core 25.15.0-beta.14 → 25.15.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { s as styleInject, u as useDivaCoreContext } from './index-01eb3133.js';
1
+ import { s as styleInject, u as useDivaCoreContext } from './index-a9036ecc.js';
2
2
  import { useState, useEffect, useCallback } from 'react';
3
3
  import { observer } from 'mobx-react-lite';
4
4
  import Button from '@mui/material/Button';
@@ -45,7 +45,7 @@ import { actions } from '@storybook/addon-actions';
45
45
  import * as Styles from '@mui/styles';
46
46
 
47
47
  (function() {
48
- const env = {"STAGE":"production","VERSION":"25.15.0-beta.14"};
48
+ const env = {"STAGE":"production","VERSION":"25.15.0-beta.15"};
49
49
  try {
50
50
  if (process) {
51
51
  process.env = Object.assign({}, process.env);
@@ -9891,7 +9891,7 @@ var DrawerMenu$1 = observer(DrawerMenu);
9891
9891
  function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9892
9892
  function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9893
9893
  var LazyModals$1 = /*#__PURE__*/React.lazy(function () {
9894
- return import('./ModalsWrapper-ed7d833d.js');
9894
+ return import('./ModalsWrapper-99f58963.js');
9895
9895
  });
9896
9896
  function Fullscreen(_ref) {
9897
9897
  var inAbsoluteFullscreen = _ref.inAbsoluteFullscreen;
@@ -10351,10 +10351,10 @@ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
10351
10351
  function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10352
10352
  var LOG$2 = getLogger('Framework', 'Root');
10353
10353
  var LazyAuth = /*#__PURE__*/React.lazy(function () {
10354
- return import('./index-06e1b79b.js');
10354
+ return import('./index-f66a1578.js');
10355
10355
  });
10356
10356
  var LazyModals = /*#__PURE__*/React.lazy(function () {
10357
- return import('./ModalsWrapper-ed7d833d.js');
10357
+ return import('./ModalsWrapper-99f58963.js');
10358
10358
  });
10359
10359
  function ContentComponent() {
10360
10360
  var context = useDivaCoreContext();
@@ -1,4 +1,4 @@
1
- import { s as styleInject, u as useDivaCoreContext, g as getLogger } from './index-01eb3133.js';
1
+ import { s as styleInject, u as useDivaCoreContext, g as getLogger } from './index-a9036ecc.js';
2
2
  import { forwardRef, useState, useRef, useEffect, useMemo } from 'react';
3
3
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
4
4
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
@@ -1,4 +1,4 @@
1
- export { c as AnalyticsHandler, A as AuthorizationHandler, e as ClientArticleHandler, C as Content, f as DivaMockProvider, D as DrawerMenuComponent, H as HelpButton, O as ONE_DAY_UNIX, d as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, b as default, g as getLogger, h as storyBookCoreMock, a as useDivaCore } from './index-01eb3133.js';
1
+ export { c as AnalyticsHandler, A as AuthorizationHandler, e as ClientArticleHandler, C as Content, f as DivaMockProvider, D as DrawerMenuComponent, H as HelpButton, O as ONE_DAY_UNIX, d as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, b as default, g as getLogger, h as storyBookCoreMock, a as useDivaCore } from './index-a9036ecc.js';
2
2
  export { DivaError, default as DivaUtils } from '@crystaldesign/diva-utils';
3
3
  export { Trans, useTranslation } from 'react-i18next';
4
4
  export * from '@crystaldesign/basket-model';
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 124.diva-core.umd.min.js.LICENSE.txt */
2
- (self.webpackChunkCrystaldesignDivaCore=self.webpackChunkCrystaldesignDivaCore||[]).push([[124],{6437:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(6177),a=r(7514);const o=(0,n.Z)((0,a.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack")},6033:(e,t,r)=>{"use strict";r.d(t,{Z:()=>E});var n=r(7363),a=r(7726),o=r(9916),s=r(5689),i=r(7843),l=r(518),c=r(2893),f=r(7249),d=r(2791),u=r(8981),p=r(9173),h=r(4685),m=r(9503);function getAlertUtilityClass(e){return(0,m.ZP)("MuiAlert",e)}const g=(0,h.Z)("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);var v=r(3697),w=r(6177),y=r(7514);const S=(0,w.Z)((0,y.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),x=(0,w.Z)((0,y.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),C=(0,w.Z)((0,y.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),k=(0,w.Z)((0,y.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),M=(0,w.Z)((0,y.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),A=(0,i.ZP)(p.Z,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`${r.variant}${(0,d.Z)(r.color||r.severity)}`]]}})((0,l.Z)((({theme:e})=>{const t="light"===e.palette.mode?s._j:s.$n,r="light"===e.palette.mode?s.$n:s._j;return{...e.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(e.palette).filter((0,u.Z)(["light"])).map((([n])=>({props:{colorSeverity:n,variant:"standard"},style:{color:e.vars?e.vars.palette.Alert[`${n}Color`]:t(e.palette[n].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${n}StandardBg`]:r(e.palette[n].light,.9),[`& .${g.icon}`]:e.vars?{color:e.vars.palette.Alert[`${n}IconColor`]}:{color:e.palette[n].main}}}))),...Object.entries(e.palette).filter((0,u.Z)(["light"])).map((([r])=>({props:{colorSeverity:r,variant:"outlined"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),border:`1px solid ${(e.vars||e).palette[r].light}`,[`& .${g.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}}))),...Object.entries(e.palette).filter((0,u.Z)(["dark"])).map((([t])=>({props:{colorSeverity:t,variant:"filled"},style:{fontWeight:e.typography.fontWeightMedium,...e.vars?{color:e.vars.palette.Alert[`${t}FilledColor`],backgroundColor:e.vars.palette.Alert[`${t}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[t].dark:e.palette[t].main,color:e.palette.getContrastText(e.palette[t].main)}}})))]}}))),b=(0,i.ZP)("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Z=(0,i.ZP)("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),j=(0,i.ZP)("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),z={success:(0,y.jsx)(S,{fontSize:"inherit"}),warning:(0,y.jsx)(x,{fontSize:"inherit"}),error:(0,y.jsx)(C,{fontSize:"inherit"}),info:(0,y.jsx)(k,{fontSize:"inherit"})},E=n.forwardRef((function Alert(e,t){const r=(0,c.i)({props:e,name:"MuiAlert"}),{action:n,children:s,className:i,closeText:l="Close",color:u,components:p={},componentsProps:h={},icon:m,iconMapping:g=z,onClose:w,role:S="alert",severity:x="success",slotProps:C={},slots:k={},variant:E="standard",...O}=r,P={...r,color:u,severity:x,variant:E,colorSeverity:u||x},I=(e=>{const{variant:t,color:r,severity:n,classes:a}=e,s={root:["root",`color${(0,d.Z)(r||n)}`,`${t}${(0,d.Z)(r||n)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return(0,o.Z)(s,getAlertUtilityClass,a)})(P),F={slots:{closeButton:p.CloseButton,closeIcon:p.CloseIcon,...k},slotProps:{...h,...C}},[L,$]=(0,f.Z)("root",{ref:t,shouldForwardComponentProp:!0,className:(0,a.Z)(I.root,i),elementType:A,externalForwardedProps:{...F,...O},ownerState:P,additionalProps:{role:S,elevation:0}}),[R,T]=(0,f.Z)("icon",{className:I.icon,elementType:b,externalForwardedProps:F,ownerState:P}),[W,q]=(0,f.Z)("message",{className:I.message,elementType:Z,externalForwardedProps:F,ownerState:P}),[H,N]=(0,f.Z)("action",{className:I.action,elementType:j,externalForwardedProps:F,ownerState:P}),[B,D]=(0,f.Z)("closeButton",{elementType:v.Z,externalForwardedProps:F,ownerState:P}),[U,_]=(0,f.Z)("closeIcon",{elementType:M,externalForwardedProps:F,ownerState:P});return(0,y.jsxs)(L,{...$,children:[!1!==m?(0,y.jsx)(R,{...T,children:m||g[x]||z[x]}):null,(0,y.jsx)(W,{...q,children:s}),null!=n?(0,y.jsx)(H,{...N,children:n}):null,null==n&&w?(0,y.jsx)(H,{...N,children:(0,y.jsx)(B,{size:"small","aria-label":l,title:l,color:"inherit",onClick:w,...D,children:(0,y.jsx)(U,{fontSize:"small",..._})})}):null]})}))},8942:(e,t,r)=>{var n=r(5108),a="undefined"!=typeof Element,o="function"==typeof Map,s="function"==typeof Set,i="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function equal(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var r,n,l,c;if(Array.isArray(e)){if((r=e.length)!=t.length)return!1;for(n=r;0!=n--;)if(!equal(e[n],t[n]))return!1;return!0}if(o&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(c=e.entries();!(n=c.next()).done;)if(!t.has(n.value[0]))return!1;for(c=e.entries();!(n=c.next()).done;)if(!equal(n.value[1],t.get(n.value[0])))return!1;return!0}if(s&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(c=e.entries();!(n=c.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((r=e.length)!=t.length)return!1;for(n=r;0!=n--;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof t.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof t.toString)return e.toString()===t.toString();if((r=(l=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,l[n]))return!1;if(a&&e instanceof Element)return!1;for(n=r;0!=n--;)if(("_owner"!==l[n]&&"__v"!==l[n]&&"__o"!==l[n]||!e.$$typeof)&&!equal(e[l[n]],t[l[n]]))return!1;return!0}return e!=e&&t!=t}e.exports=function isEqual(e,t){try{return equal(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return n.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},4376:(e,t,r)=>{"use strict";r.d(t,{Z:()=>lib_Snowfall});var n=r(7363),a=r(8942);function random(e,t){return Number.isInteger(e)&&Number.isInteger(t)?Math.floor(Math.random()*(t-e+1)+e):Math.random()*(t-e)+e}function lerp(e,t,r){return(1-r)*e+r*t}function getSize(e){return e?{height:e.offsetHeight,width:e.offsetWidth}:{height:0,width:0}}const o=2*Math.PI,s={color:"#dee4fd",radius:[.5,3],speed:[1,3],wind:[-.5,2],changeFrequency:200,rotationSpeed:[-1,1],opacity:[1,1]};class Snowflake{static createSnowflakes(e,t,r){if(!e)return[];const n=[];for(let a=0;a<t;a++)n.push(new Snowflake(e,r));return n}constructor(e,t={}){this.updateConfig(t);const{radius:r,wind:n,speed:a,rotationSpeed:o,opacity:s}=this.config;this.params={x:random(0,e.offsetWidth),y:random(-e.offsetHeight,0),rotation:random(0,360),radius:random(...r),speed:random(...a),wind:random(...n),rotationSpeed:random(...o),nextSpeed:random(...a),nextWind:random(...n),nextRotationSpeed:random(...o),opacity:random(...s),hasNextOpacity:!1},this.framesSinceLastUpdate=0}selectImage(){this.config.images&&this.config.images.length>0?this.image=function randomElement(e){return e[Math.floor(Math.random()*e.length)]}(this.config.images):this.image=void 0}updateConfig(e){const t=this.config;this.config={...s,...e},this.config.changeFrequency=random(this.config.changeFrequency,1.5*this.config.changeFrequency),this.params&&!a(this.config.radius,null==t?void 0:t.radius)&&(this.params.radius=random(...this.config.radius)),a(this.config.images,null==t?void 0:t.images)||this.selectImage(),(null==t?void 0:t.opacity)&&!a(this.config.opacity,null==t?void 0:t.opacity)&&(this.params.hasNextOpacity=!0)}updateTargetParams(){this.params.nextSpeed=random(...this.config.speed),this.params.nextWind=random(...this.config.wind),this.image&&(this.params.nextRotationSpeed=random(...this.config.rotationSpeed))}update(e,t,r=1){const{x:n,y:a,rotation:o,rotationSpeed:s,nextRotationSpeed:i,wind:l,speed:c,nextWind:f,nextSpeed:d,radius:u}=this.params;this.params.x=(n+l*r)%(e+2*u),this.params.x>e+u&&(this.params.x=-u),this.params.y=(a+c*r)%(t+2*u),this.params.y>t+u&&(this.params.hasNextOpacity&&(this.params.opacity=random(...this.config.opacity),this.params.hasNextOpacity=!1),this.params.y=-u),this.image&&(this.params.rotation=(o+s)%360),this.params.speed=lerp(c,d,.01),this.params.wind=lerp(l,f,.01),this.params.rotationSpeed=lerp(s,i,.01),this.framesSinceLastUpdate++>this.config.changeFrequency&&(this.updateTargetParams(),this.framesSinceLastUpdate=0)}getImageOffscreenCanvas(e,t){var r,n;if(e instanceof HTMLImageElement&&e.loading)return e;let a=Snowflake.offscreenCanvases.get(e);if(a||(a={},Snowflake.offscreenCanvases.set(e,a)),!(t in a)){const n=document.createElement("canvas");n.width=t,n.height=t,null===(r=n.getContext("2d"))||void 0===r||r.drawImage(e,0,0,t,t),a[t]=n}return null!==(n=a[t])&&void 0!==n?n:e}drawCircle(e){e.moveTo(this.params.x,this.params.y),e.arc(this.params.x,this.params.y,this.params.radius,0,o)}drawImage(e){const{x:t,y:r,rotation:n,radius:a}=this.params,o=n*Math.PI/180,s=Math.cos(o),i=Math.sin(o);1!==this.params.opacity&&(e.save(),e.globalAlpha=this.params.opacity),e.setTransform(s,i,-i,s,t,r);const l=this.getImageOffscreenCanvas(this.image,a);e.drawImage(l,-a/2,-a/2,a,a),1!==this.params.opacity&&e.restore()}}Snowflake.offscreenCanvases=new WeakMap;const i=Snowflake,l={pointerEvents:"none",backgroundColor:"transparent",position:"absolute",top:0,left:0,width:"100%",height:"100%"};var c,f,__classPrivateFieldGet=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},__classPrivateFieldSet=function(e,t,r,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(e,r):a?a.value=r:t.set(e,r),r};class SnowfallCanvas{get ctx(){return __classPrivateFieldGet(this,c,"f")}get canvas(){return __classPrivateFieldGet(this,f,"f")}set canvas(e){__classPrivateFieldSet(this,f,e,"f"),__classPrivateFieldSet(this,c,e.getContext("2d"),"f")}constructor(e,t){this.lastUpdate=Date.now(),this.snowflakes=[],c.set(this,void 0),f.set(this,void 0),__classPrivateFieldSet(this,f,e,"f"),__classPrivateFieldSet(this,c,e.getContext("2d"),"f"),this.config={snowflakeCount:150,...s,...t},this.snowflakes=[],this.snowflakes=i.createSnowflakes(e,t.snowflakeCount||150,t),this.play()}updateConfig(e){this.config={...this.config,...e};const t=this.config.snowflakeCount-this.snowflakes.length;t>0&&(this.snowflakes=[...this.snowflakes,...i.createSnowflakes(this.canvas,t,e)]),t<0&&(this.snowflakes=this.snowflakes.slice(0,this.config.snowflakeCount));for(const e of this.snowflakes)e.updateConfig(this.config)}render(e=1){const{ctx:t,canvas:r,snowflakes:n}=this;if(!t||!r)return;const{offsetWidth:a,offsetHeight:o}=r;for(const t of n)t.update(a,o,e);if(t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,a,o),this.config.images&&this.config.images.length>0)for(const e of n)e.drawImage(t);else{t.beginPath();for(const e of n)e.drawCircle(t);t.fillStyle=this.config.color,t.fill()}}loop(){const e=Date.now(),t=Date.now()-this.lastUpdate;this.lastUpdate=e;const r=t/16.666666666666668;this.render(r),this.animationFrame=requestAnimationFrame((()=>this.loop()))}play(){this.loop()}pause(){this.animationFrame&&(cancelAnimationFrame(this.animationFrame),this.animationFrame=void 0)}}c=new WeakMap,f=new WeakMap;function useDeepMemo(e){const[t,r]=(0,n.useState)(e);return function useDeepCompareEffect(e,t){const r=(0,n.useRef)(t);return a(t,r.current)||(r.current=t),(0,n.useEffect)(e,r.current)}((()=>r(e)),[e]),t}const lib_Snowfall=({color:e=s.color,changeFrequency:t=s.changeFrequency,radius:r=s.radius,speed:a=s.speed,wind:o=s.wind,rotationSpeed:i=s.rotationSpeed,opacity:c=s.opacity,snowflakeCount:f=150,images:d,style:u}={})=>{const p=(h=u,(0,n.useMemo)((()=>({...l,...h||{}})),[h]));var h;const m=(0,n.useRef)(null),g=(e=>{const[t,r]=(0,n.useState)(getSize(e.current)),a=(0,n.useCallback)((()=>{e.current&&r(getSize(e.current))}),[e]);return(0,n.useEffect)((()=>{const{ResizeObserver:t}=window;if(e.current){if(a(),"function"==typeof t){const r=new t(a);return r.observe(e.current),()=>r.disconnect()}return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)}}),[e,a]),t})(m),v=useDeepMemo({color:e,changeFrequency:t,radius:r,speed:a,wind:o,rotationSpeed:i,images:d,snowflakeCount:f,opacity:c}),w=(0,n.useRef)(v),y=(0,n.useRef)();return(0,n.useEffect)((()=>(!y.current&&m.current&&(y.current=new SnowfallCanvas(m.current,w.current)),()=>{var e;null===(e=y.current)||void 0===e||e.pause(),y.current=void 0})),[]),(0,n.useEffect)((()=>{y.current&&y.current.updateConfig(v)}),[v]),n.createElement("canvas",{ref:m,height:g.height,width:g.width,style:p,"data-testid":"SnowfallCanvas"})}}}]);
2
+ (self.webpackChunkCrystaldesignDivaCore=self.webpackChunkCrystaldesignDivaCore||[]).push([[124],{6437:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(6177),o=r(7514);const a=(0,n.Z)((0,o.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack")},6033:(e,t,r)=>{"use strict";r.d(t,{Z:()=>E});var n=r(7363),o=r(7726),a=r(9916),s=r(5689),i=r(7843),l=r(518),c=r(2893),f=r(7249),d=r(2791),u=r(8981),p=r(9173),h=r(4685),m=r(9503);function getAlertUtilityClass(e){return(0,m.ZP)("MuiAlert",e)}const g=(0,h.Z)("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);var v=r(3697),w=r(6177),y=r(7514);const S=(0,w.Z)((0,y.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),x=(0,w.Z)((0,y.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),C=(0,w.Z)((0,y.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),k=(0,w.Z)((0,y.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),M=(0,w.Z)((0,y.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),A=(0,i.ZP)(p.Z,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`${r.variant}${(0,d.Z)(r.color||r.severity)}`]]}})((0,l.Z)((({theme:e})=>{const t="light"===e.palette.mode?s._j:s.$n,r="light"===e.palette.mode?s.$n:s._j;return{...e.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(e.palette).filter((0,u.Z)(["light"])).map((([n])=>({props:{colorSeverity:n,variant:"standard"},style:{color:e.vars?e.vars.palette.Alert[`${n}Color`]:t(e.palette[n].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${n}StandardBg`]:r(e.palette[n].light,.9),[`& .${g.icon}`]:e.vars?{color:e.vars.palette.Alert[`${n}IconColor`]}:{color:e.palette[n].main}}}))),...Object.entries(e.palette).filter((0,u.Z)(["light"])).map((([r])=>({props:{colorSeverity:r,variant:"outlined"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),border:`1px solid ${(e.vars||e).palette[r].light}`,[`& .${g.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}}))),...Object.entries(e.palette).filter((0,u.Z)(["dark"])).map((([t])=>({props:{colorSeverity:t,variant:"filled"},style:{fontWeight:e.typography.fontWeightMedium,...e.vars?{color:e.vars.palette.Alert[`${t}FilledColor`],backgroundColor:e.vars.palette.Alert[`${t}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[t].dark:e.palette[t].main,color:e.palette.getContrastText(e.palette[t].main)}}})))]}}))),b=(0,i.ZP)("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Z=(0,i.ZP)("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),j=(0,i.ZP)("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),z={success:(0,y.jsx)(S,{fontSize:"inherit"}),warning:(0,y.jsx)(x,{fontSize:"inherit"}),error:(0,y.jsx)(C,{fontSize:"inherit"}),info:(0,y.jsx)(k,{fontSize:"inherit"})},E=n.forwardRef((function Alert(e,t){const r=(0,c.i)({props:e,name:"MuiAlert"}),{action:n,children:s,className:i,closeText:l="Close",color:u,components:p={},componentsProps:h={},icon:m,iconMapping:g=z,onClose:w,role:S="alert",severity:x="success",slotProps:C={},slots:k={},variant:E="standard",...P}=r,I={...r,color:u,severity:x,variant:E,colorSeverity:u||x},F=(e=>{const{variant:t,color:r,severity:n,classes:o}=e,s={root:["root",`color${(0,d.Z)(r||n)}`,`${t}${(0,d.Z)(r||n)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return(0,a.Z)(s,getAlertUtilityClass,o)})(I),O={slots:{closeButton:p.CloseButton,closeIcon:p.CloseIcon,...k},slotProps:{...h,...C}},[L,$]=(0,f.Z)("root",{ref:t,shouldForwardComponentProp:!0,className:(0,o.Z)(F.root,i),elementType:A,externalForwardedProps:{...O,...P},ownerState:I,additionalProps:{role:S,elevation:0}}),[R,T]=(0,f.Z)("icon",{className:F.icon,elementType:b,externalForwardedProps:O,ownerState:I}),[W,q]=(0,f.Z)("message",{className:F.message,elementType:Z,externalForwardedProps:O,ownerState:I}),[H,B]=(0,f.Z)("action",{className:F.action,elementType:j,externalForwardedProps:O,ownerState:I}),[D,U]=(0,f.Z)("closeButton",{elementType:v.Z,externalForwardedProps:O,ownerState:I}),[N,_]=(0,f.Z)("closeIcon",{elementType:M,externalForwardedProps:O,ownerState:I});return(0,y.jsxs)(L,{...$,children:[!1!==m?(0,y.jsx)(R,{...T,children:m||g[x]||z[x]}):null,(0,y.jsx)(W,{...q,children:s}),null!=n?(0,y.jsx)(H,{...B,children:n}):null,null==n&&w?(0,y.jsx)(H,{...B,children:(0,y.jsx)(D,{size:"small","aria-label":l,title:l,color:"inherit",onClick:w,...U,children:(0,y.jsx)(N,{fontSize:"small",..._})})}):null]})}))},8942:(e,t,r)=>{var n=r(5108),o="undefined"!=typeof Element,a="function"==typeof Map,s="function"==typeof Set,i="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function equal(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var r,n,l,c;if(Array.isArray(e)){if((r=e.length)!=t.length)return!1;for(n=r;0!=n--;)if(!equal(e[n],t[n]))return!1;return!0}if(a&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(c=e.entries();!(n=c.next()).done;)if(!t.has(n.value[0]))return!1;for(c=e.entries();!(n=c.next()).done;)if(!equal(n.value[1],t.get(n.value[0])))return!1;return!0}if(s&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(c=e.entries();!(n=c.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((r=e.length)!=t.length)return!1;for(n=r;0!=n--;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof t.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof t.toString)return e.toString()===t.toString();if((r=(l=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,l[n]))return!1;if(o&&e instanceof Element)return!1;for(n=r;0!=n--;)if(("_owner"!==l[n]&&"__v"!==l[n]&&"__o"!==l[n]||!e.$$typeof)&&!equal(e[l[n]],t[l[n]]))return!1;return!0}return e!=e&&t!=t}e.exports=function isEqual(e,t){try{return equal(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return n.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},4376:(e,t,r)=>{"use strict";r.d(t,{Z:()=>lib_Snowfall});var n=r(7363),o=r(8942);function random(e,t){const r=Math.random()*(t-e+1)+e;return Number.isInteger(e)&&Number.isInteger(t)?Math.floor(r):r}function lerp(e,t,r){return(1-r)*e+r*t}function getSize(e){return e?{height:e.offsetHeight,width:e.offsetWidth}:{height:0,width:0}}const a=2*Math.PI,s={color:"#dee4fd",radius:[.5,3],speed:[1,3],wind:[-.5,2],changeFrequency:200,rotationSpeed:[-1,1],opacity:[1,1]};class Snowflake{static createSnowflakes(e,t,r){if(!e)return[];const n=[];for(let o=0;o<t;o++)n.push(new Snowflake(e,r));return n}constructor(e,t={}){this.updateConfig(t);const{radius:r,wind:n,speed:o,rotationSpeed:a,opacity:s}=this.config;this.params={x:random(0,e.offsetWidth),y:random(-e.offsetHeight,0),rotation:random(0,360),radius:random(...r),speed:random(...o),wind:random(...n),rotationSpeed:random(...a),nextSpeed:random(...o),nextWind:random(...n),nextRotationSpeed:random(...a),opacity:random(...s)},this.framesSinceLastUpdate=0}selectImage(){this.config.images&&this.config.images.length>0?this.image=function randomElement(e){return e[Math.floor(Math.random()*e.length)]}(this.config.images):this.image=void 0}updateConfig(e){const t=this.config;this.config={...s,...e},this.config.changeFrequency=random(this.config.changeFrequency,1.5*this.config.changeFrequency),this.params&&!o(this.config.radius,null==t?void 0:t.radius)&&(this.params.radius=random(...this.config.radius)),o(this.config.images,null==t?void 0:t.images)||this.selectImage()}updateTargetParams(){this.params.nextSpeed=random(...this.config.speed),this.params.nextWind=random(...this.config.wind),this.image&&(this.params.nextRotationSpeed=random(...this.config.rotationSpeed))}update(e,t,r=1){const{x:n,y:o,rotation:a,rotationSpeed:s,nextRotationSpeed:i,wind:l,speed:c,nextWind:f,nextSpeed:d,radius:u}=this.params;this.params.x=(n+l*r)%(e+2*u),this.params.x>e+u&&(this.params.x=-u),this.params.y=(o+c*r)%(t+2*u),this.params.y>t+u&&(this.params.y=-u),this.image&&(this.params.rotation=(a+s)%360),this.params.speed=lerp(c,d,.01),this.params.wind=lerp(l,f,.01),this.params.rotationSpeed=lerp(s,i,.01),this.framesSinceLastUpdate++>this.config.changeFrequency&&(this.updateTargetParams(),this.framesSinceLastUpdate=0)}getImageOffscreenCanvas(e,t){var r,n;if(e instanceof HTMLImageElement&&e.loading)return e;let o=Snowflake.offscreenCanvases.get(e);if(o||(o={},Snowflake.offscreenCanvases.set(e,o)),!(t in o)){const n=document.createElement("canvas");n.width=t,n.height=t,null===(r=n.getContext("2d"))||void 0===r||r.drawImage(e,0,0,t,t),o[t]=n}return null!==(n=o[t])&&void 0!==n?n:e}drawCircle(e){e.moveTo(this.params.x,this.params.y),e.arc(this.params.x,this.params.y,this.params.radius,0,a)}drawImage(e){const{x:t,y:r,rotation:n,radius:o}=this.params,a=n*Math.PI/180,s=Math.cos(a),i=Math.sin(a);1!==this.params.opacity&&(e.save(),e.globalAlpha=this.params.opacity),e.setTransform(s,i,-i,s,t,r);const l=this.getImageOffscreenCanvas(this.image,o);e.drawImage(l,-o/2,-o/2,o,o),1!==this.params.opacity&&e.restore()}}Snowflake.offscreenCanvases=new WeakMap;const i=Snowflake,l={pointerEvents:"none",backgroundColor:"transparent",position:"absolute",top:0,left:0,width:"100%",height:"100%"};var c,f,__classPrivateFieldGet=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},__classPrivateFieldSet=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r};class SnowfallCanvas{get ctx(){return __classPrivateFieldGet(this,c,"f")}get canvas(){return __classPrivateFieldGet(this,f,"f")}set canvas(e){__classPrivateFieldSet(this,f,e,"f"),__classPrivateFieldSet(this,c,e.getContext("2d"),"f")}constructor(e,t){this.lastUpdate=Date.now(),this.snowflakes=[],c.set(this,void 0),f.set(this,void 0),__classPrivateFieldSet(this,f,e,"f"),__classPrivateFieldSet(this,c,e.getContext("2d"),"f"),this.config={snowflakeCount:150,...s,...t},this.snowflakes=[],this.snowflakes=i.createSnowflakes(e,t.snowflakeCount||150,t),this.play()}updateConfig(e){this.config={...this.config,...e};const t=this.config.snowflakeCount-this.snowflakes.length;t>0&&(this.snowflakes=[...this.snowflakes,...i.createSnowflakes(this.canvas,t,e)]),t<0&&(this.snowflakes=this.snowflakes.slice(0,this.config.snowflakeCount));for(const e of this.snowflakes)e.updateConfig(this.config)}render(e=1){const{ctx:t,canvas:r,snowflakes:n}=this;if(!t||!r)return;const{offsetWidth:o,offsetHeight:a}=r;for(const t of n)t.update(o,a,e);if(t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,o,a),this.config.images&&this.config.images.length>0)for(const e of n)e.drawImage(t);else{t.beginPath();for(const e of n)e.drawCircle(t);t.fillStyle=this.config.color,t.fill()}}loop(){const e=Date.now(),t=Date.now()-this.lastUpdate;this.lastUpdate=e;const r=t/16.666666666666668;this.render(r),this.animationFrame=requestAnimationFrame((()=>this.loop()))}play(){this.loop()}pause(){this.animationFrame&&(cancelAnimationFrame(this.animationFrame),this.animationFrame=void 0)}}c=new WeakMap,f=new WeakMap;function useDeepMemo(e){const[t,r]=(0,n.useState)(e);return function useDeepCompareEffect(e,t){const r=(0,n.useRef)(t);return o(t,r.current)||(r.current=t),(0,n.useEffect)(e,r.current)}((()=>r(e)),[e]),t}const lib_Snowfall=({color:e=s.color,changeFrequency:t=s.changeFrequency,radius:r=s.radius,speed:o=s.speed,wind:a=s.wind,rotationSpeed:i=s.rotationSpeed,opacity:c=s.opacity,snowflakeCount:f=150,images:d,style:u}={})=>{const p=(h=u,(0,n.useMemo)((()=>({...l,...h||{}})),[h]));var h;const m=(0,n.useRef)(null),g=(e=>{const[t,r]=(0,n.useState)(getSize(e.current)),o=(0,n.useCallback)((()=>{e.current&&r(getSize(e.current))}),[e]);return(0,n.useEffect)((()=>{const{ResizeObserver:t}=window;if(e.current){if(o(),"function"==typeof t){const r=new t(o);return r.observe(e.current),()=>r.disconnect()}return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)}}),[e,o]),t})(m),v=useDeepMemo({color:e,changeFrequency:t,radius:r,speed:o,wind:a,rotationSpeed:i,images:d,snowflakeCount:f,opacity:c}),w=(0,n.useRef)(v),y=(0,n.useRef)();return(0,n.useEffect)((()=>(!y.current&&m.current&&(y.current=new SnowfallCanvas(m.current,w.current)),()=>{var e;null===(e=y.current)||void 0===e||e.pause(),y.current=void 0})),[]),(0,n.useEffect)((()=>{y.current&&y.current.updateConfig(v)}),[v]),n.createElement("canvas",{ref:m,height:g.height,width:g.width,style:p,"data-testid":"SnowfallCanvas"})}}}]);