bonuspluscomponents 0.0.145 → 0.0.147

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 +1 @@
1
- {"version":3,"file":"AppContext.d.ts","sourceRoot":"","sources":["../../../src/AppContext/Context/AppContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAC5E,OAAc,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAC,iBAAiB,EAAC,MAAM,yCAAyC,CAAC;AAM1E,aAAK,WAAW;IACZ,eAAe,IAAA;IACf,QAAQ,IAAA;IACR,EAAE,IAAA;CACL;AAED,KAAK,QAAQ,GAAG;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,8BAA8B,EAAE,MAAM,CAAC;IACvC,4BAA4B,EAAE,MAAM,CAAC;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,UAAU,eAAe;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;CAClB;AAGD,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,MAAM,aAAa,CAAC;IAE9B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAEpE,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;IACxC,kBAAkB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC,CAAC;IAGjF,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAE5C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAElE,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAEvD,KAAK,EAAE,GAAG,CAAC;IAEX,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAEjE,cAAc,EAAE,GAAG,CAAC;IACpB,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;CAChE,CAAC;AAkCF,eAAO,MAAM,UAAU,4BAAmC,CAAC;AA+J3D,eAAO,MAAM,WAAW;cAAyC,WAAW;iBAAe,WAAW;6CAKrG,CAAC"}
1
+ {"version":3,"file":"AppContext.d.ts","sourceRoot":"","sources":["../../../src/AppContext/Context/AppContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAC5E,OAAc,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAC,iBAAiB,EAAC,MAAM,yCAAyC,CAAC;AAM1E,aAAK,WAAW;IACZ,eAAe,IAAA;IACf,QAAQ,IAAA;IACR,EAAE,IAAA;CACL;AAED,KAAK,QAAQ,GAAG;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,8BAA8B,EAAE,MAAM,CAAC;IACvC,4BAA4B,EAAE,MAAM,CAAC;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,UAAU,eAAe;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;CAClB;AAGD,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,MAAM,aAAa,CAAC;IAE9B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAEpE,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;IACxC,kBAAkB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC,CAAC;IAGjF,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAE5C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAElE,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAEvD,KAAK,EAAE,GAAG,CAAC;IAEX,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAEjE,cAAc,EAAE,GAAG,CAAC;IACpB,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;CAChE,CAAC;AAkCF,eAAO,MAAM,UAAU,4BAAmC,CAAC;AAgK3D,eAAO,MAAM,WAAW;cAAyC,WAAW;iBAAe,WAAW;6CAKrG,CAAC"}
@@ -30,7 +30,7 @@ Check the top-level render call using <`+pe+">.")}return ie}}function Zt(k,ie){{
30
30
  @font-face {
31
31
  font-family: bonusPlus, Fallback, sans-serif;
32
32
  }
33
- `}}});ji=Ce.responsiveFontSizes(ji);const hs=ji,Dm={isLoading:!1,setIsLoading(e,t){}},Ln=H.createContext(Dm),Sm=()=>{const[e,t]=H.useState([]),n=(r,o)=>{t(o?i=>[...i,{id:r}]:i=>i.filter(s=>s.id!==r))};return{isLoading:e.length!==0,setIsLoading:n}},Rm=({children:e})=>{const t=Sm();return p.jsx(Ln.Provider,{value:t,children:e})},Mm={openedPage:"info",setOpenedPage:null},Ro=H.createContext(Mm),km=()=>{const[e,t]=H.useState("info");return{openedPage:e,setOpenedPage:t}},$m=({children:e})=>{const t=km();return p.jsx(Ro.Provider,{value:t,children:e})},_m={cabinetType:null,cabinetIsLoading:!0,apiAxios:()=>null,phoneNumber:null,setPhoneNumber:null,cabinetSettings:null,setCabinetSettings:null,cabinetUISettings:null,authToken:null,setAuthToken:null,createAxios:null,theme:null,customer:null,VKUserId:null,setVKUserId:null,additionalData:null,setAdditionalData:null},Ft=H.createContext(_m),Im=({cabinetType:e})=>{const{setIsLoading:t}=H.useContext(Ln),{setOpenedPage:n}=H.useContext(Ro),[r,o]=H.useState(null),[i,s]=H.useState(null),[l,c]=H.useState(null),[u,d]=H.useState(null),[f,h]=H.useState(null);H.useState(null);const[v,b]=H.useState({}),m=()=>Yu.create({baseURL:f??"",headers:{Authorization:`Bearer ${l}`,"X-CabinetType":e,"X-PhoneNumber":i}}),y=hs,[E,P]=H.useState(null),[x,T]=H.useState(null);return H.useEffect(()=>{(async()=>{if(!l||!i||e===null)return;t("GetCabinetSettings",!0);const R=await m().post("/externalCustomerCabinet/cabinetInfo",{});P(R.data),R.data.isReg&&n("registration"),t("GetCabinetSettings",!1)})()},[i,l]),H.useEffect(()=>{(async()=>{if(!l||!i||e===null||!E||E!=null&&E.isReg)return;t("GetCustomerInfo",!0);const D=async()=>{const I=await m().post("/externalCustomerCabinet/customer/info",{VKUserId:r});d({...I.data.customer,eCardCustomerLink:I.data.eCardCustomerLink})};try{await D()}catch{await(async()=>{await m().post("/externalCustomerCabinet/customer/connect",{VKUserId:r})})(),await D()}finally{t("GetCustomerInfo",!1)}})()},[i,E]),H.useEffect(()=>{(async()=>{if(!l)return;t("GetCabinetUISettings",!0);const R=await m().post("/externalCustomerCabinet/settings",{});T(R.data.settings),t("GetCabinetUISettings",!1)})()},[l]),{cabinetType:e,apiAxios:m,cabinetIsLoading:!1,cabinetSettings:E,setCabinetSettings:P,cabinetUISettings:x,phoneNumber:i,setPhoneNumber:s,authToken:l,setAuthToken:c,createAxios:(O,D)=>{c(O),h(D)},theme:y,setVKUserId:o,VKUserId:r,customer:u,additionalData:v,setAdditionalData:b}},Nm=({children:e,cabinetType:t})=>{const n=Im({cabinetType:t});return p.jsx(Ft.Provider,{value:{...n,cabinetType:t},children:e})},Gu=({fileValue:e})=>{const{cabinetUISettings:t}=H.useContext(Ft),n=e?`url(data:image/png;base64,${e})`:`url(${t==null?void 0:t.headerImageUrl})`;return p.jsx(Ce.Typography,{variant:"h2",component:"div",children:p.jsx("div",{className:"header",style:{backgroundColor:t==null?void 0:t.headerColor},children:p.jsx(Ce.Container,{maxWidth:"sm",sx:{paddingBottom:`${t==null?void 0:t.paddingBottom}px`,paddingTop:`${t==null?void 0:t.paddingTop}px`},children:t!=null&&t.headerUrlRedirect?p.jsx("a",{href:t==null?void 0:t.headerUrlRedirect,target:"_blank",children:p.jsx("div",{className:"header__img",style:{backgroundImage:n}})}):p.jsx("div",{className:"header__img",style:{backgroundImage:n}})})})})};class jm extends H.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.log({error:t,errorInfo:n})}render(){return this.state.hasError?p.jsx("h1",{children:"Что-то пошло не так"}):this.props.children}}var vs={},Ku={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ku);var $t=Ku.exports,mi={};function gn(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...r){return e(...r)||t(...r)}}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(this,arguments)}function Zn(e){return e!==null&&typeof e=="object"&&e.constructor===Object}function Qu(e){if(!Zn(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Qu(e[n])}),t}function Ht(e,t,n={clone:!0}){const r=n.clone?w({},e):e;return Zn(e)&&Zn(t)&&Object.keys(t).forEach(o=>{o!=="__proto__"&&(Zn(t[o])&&o in e&&Zn(e[o])?r[o]=Ht(e[o],t[o],n):n.clone?r[o]=Zn(t[o])?Qu(t[o]):t[o]:r[o]=t[o])}),r}var Ai={exports:{}},Yo={exports:{}},Ue={};/** @license React v16.13.1
33
+ `}}});ji=Ce.responsiveFontSizes(ji);const hs=ji,Dm={isLoading:!1,setIsLoading(e,t){}},Ln=H.createContext(Dm),Sm=()=>{const[e,t]=H.useState([]),n=(r,o)=>{t(o?i=>[...i,{id:r}]:i=>i.filter(s=>s.id!==r))};return{isLoading:e.length!==0,setIsLoading:n}},Rm=({children:e})=>{const t=Sm();return p.jsx(Ln.Provider,{value:t,children:e})},Mm={openedPage:"info",setOpenedPage:null},Ro=H.createContext(Mm),km=()=>{const[e,t]=H.useState("info");return{openedPage:e,setOpenedPage:t}},$m=({children:e})=>{const t=km();return p.jsx(Ro.Provider,{value:t,children:e})},_m={cabinetType:null,cabinetIsLoading:!0,apiAxios:()=>null,phoneNumber:null,setPhoneNumber:null,cabinetSettings:null,setCabinetSettings:null,cabinetUISettings:null,authToken:null,setAuthToken:null,createAxios:null,theme:null,customer:null,VKUserId:null,setVKUserId:null,additionalData:null,setAdditionalData:null},Ft=H.createContext(_m),Im=({cabinetType:e})=>{const{setIsLoading:t}=H.useContext(Ln),{setOpenedPage:n}=H.useContext(Ro),[r,o]=H.useState(null),[i,s]=H.useState(null),[l,c]=H.useState(null),[u,d]=H.useState(null),[f,h]=H.useState(null);H.useState(null);const[v,b]=H.useState({}),m=()=>Yu.create({baseURL:f??"",headers:{Authorization:`Bearer ${l}`,"X-CabinetType":e,"X-PhoneNumber":i}}),y=hs,[E,P]=H.useState(null),[x,T]=H.useState(null);return H.useEffect(()=>{(async()=>{if(!l||!i||e===null)return;t("GetCabinetSettings",!0);const R=await m().post("/externalCustomerCabinet/cabinetInfo",{});P(R.data),R.data.isReg&&n("registration"),t("GetCabinetSettings",!1)})()},[i,l]),H.useEffect(()=>{(async()=>{if(!l||!i||e===null||!E||E!=null&&E.isReg)return;t("GetCustomerInfo",!0);const D=async()=>{const I=await m().post("/externalCustomerCabinet/customer/info",{VKUserId:r});d({...I.data.customer,eCardCustomerLink:I.data.eCardCustomerLink})};try{await D()}catch{await(async()=>{const $=await m().post("/externalCustomerCabinet/customer/connect",{VKUserId:r});s($.data.encryptPhoneNumber)})(),await D()}finally{t("GetCustomerInfo",!1)}})()},[i,E]),H.useEffect(()=>{(async()=>{if(!l)return;t("GetCabinetUISettings",!0);const R=await m().post("/externalCustomerCabinet/settings",{});T(R.data.settings),t("GetCabinetUISettings",!1)})()},[l]),{cabinetType:e,apiAxios:m,cabinetIsLoading:!1,cabinetSettings:E,setCabinetSettings:P,cabinetUISettings:x,phoneNumber:i,setPhoneNumber:s,authToken:l,setAuthToken:c,createAxios:(O,D)=>{c(O),h(D)},theme:y,setVKUserId:o,VKUserId:r,customer:u,additionalData:v,setAdditionalData:b}},Nm=({children:e,cabinetType:t})=>{const n=Im({cabinetType:t});return p.jsx(Ft.Provider,{value:{...n,cabinetType:t},children:e})},Gu=({fileValue:e})=>{const{cabinetUISettings:t}=H.useContext(Ft),n=e?`url(data:image/png;base64,${e})`:`url(${t==null?void 0:t.headerImageUrl})`;return p.jsx(Ce.Typography,{variant:"h2",component:"div",children:p.jsx("div",{className:"header",style:{backgroundColor:t==null?void 0:t.headerColor},children:p.jsx(Ce.Container,{maxWidth:"sm",sx:{paddingBottom:`${t==null?void 0:t.paddingBottom}px`,paddingTop:`${t==null?void 0:t.paddingTop}px`},children:t!=null&&t.headerUrlRedirect?p.jsx("a",{href:t==null?void 0:t.headerUrlRedirect,target:"_blank",children:p.jsx("div",{className:"header__img",style:{backgroundImage:n}})}):p.jsx("div",{className:"header__img",style:{backgroundImage:n}})})})})};class jm extends H.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.log({error:t,errorInfo:n})}render(){return this.state.hasError?p.jsx("h1",{children:"Что-то пошло не так"}):this.props.children}}var vs={},Ku={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ku);var $t=Ku.exports,mi={};function gn(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...r){return e(...r)||t(...r)}}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(this,arguments)}function Zn(e){return e!==null&&typeof e=="object"&&e.constructor===Object}function Qu(e){if(!Zn(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Qu(e[n])}),t}function Ht(e,t,n={clone:!0}){const r=n.clone?w({},e):e;return Zn(e)&&Zn(t)&&Object.keys(t).forEach(o=>{o!=="__proto__"&&(Zn(t[o])&&o in e&&Zn(e[o])?r[o]=Ht(e[o],t[o],n):n.clone?r[o]=Zn(t[o])?Qu(t[o]):t[o]:r[o]=t[o])}),r}var Ai={exports:{}},Yo={exports:{}},Ue={};/** @license React v16.13.1
34
34
  * react-is.production.min.js
35
35
  *
36
36
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -197,7 +197,7 @@ const theme2 = createTheme({ palette: {
197
197
  animation-delay: 200ms;
198
198
  }
199
199
  `),Yt.rippleVisible,sx,Gi,({theme:e})=>e.transitions.easing.easeInOut,Yt.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,Yt.child,Yt.childLeaving,lx,Gi,({theme:e})=>e.transitions.easing.easeInOut,Yt.childPulsate,cx,({theme:e})=>e.transitions.easing.easeInOut),of=C.forwardRef(function(t,n){const r=Te({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:s}=r,l=se(r,ax),[c,u]=C.useState([]),d=C.useRef(0),f=C.useRef(null);C.useEffect(()=>{f.current&&(f.current(),f.current=null)},[c]);const h=C.useRef(!1),v=C.useRef(0),b=C.useRef(null),m=C.useRef(null);C.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]);const y=C.useCallback(T=>{const{pulsate:g,rippleX:O,rippleY:D,rippleSize:R,cb:I}=T;u(_=>[..._,p.jsx(dx,{classes:{ripple:ve(i.ripple,Yt.ripple),rippleVisible:ve(i.rippleVisible,Yt.rippleVisible),ripplePulsate:ve(i.ripplePulsate,Yt.ripplePulsate),child:ve(i.child,Yt.child),childLeaving:ve(i.childLeaving,Yt.childLeaving),childPulsate:ve(i.childPulsate,Yt.childPulsate)},timeout:Gi,pulsate:g,rippleX:O,rippleY:D,rippleSize:R},d.current)]),d.current+=1,f.current=I},[i]),E=C.useCallback((T={},g={},O=()=>{})=>{const{pulsate:D=!1,center:R=o||g.pulsate,fakeElement:I=!1}=g;if((T==null?void 0:T.type)==="mousedown"&&h.current){h.current=!1;return}(T==null?void 0:T.type)==="touchstart"&&(h.current=!0);const _=I?null:m.current,$=_?_.getBoundingClientRect():{width:0,height:0,left:0,top:0};let B,N,j;if(R||T===void 0||T.clientX===0&&T.clientY===0||!T.clientX&&!T.touches)B=Math.round($.width/2),N=Math.round($.height/2);else{const{clientX:M,clientY:L}=T.touches&&T.touches.length>0?T.touches[0]:T;B=Math.round(M-$.left),N=Math.round(L-$.top)}if(R)j=Math.sqrt((2*$.width**2+$.height**2)/3),j%2===0&&(j+=1);else{const M=Math.max(Math.abs((_?_.clientWidth:0)-B),B)*2+2,L=Math.max(Math.abs((_?_.clientHeight:0)-N),N)*2+2;j=Math.sqrt(M**2+L**2)}T!=null&&T.touches?b.current===null&&(b.current=()=>{y({pulsate:D,rippleX:B,rippleY:N,rippleSize:j,cb:O})},v.current=setTimeout(()=>{b.current&&(b.current(),b.current=null)},ix)):y({pulsate:D,rippleX:B,rippleY:N,rippleSize:j,cb:O})},[o,y]),P=C.useCallback(()=>{E({},{pulsate:!0})},[E]),x=C.useCallback((T,g)=>{if(clearTimeout(v.current),(T==null?void 0:T.type)==="touchend"&&b.current){b.current(),b.current=null,v.current=setTimeout(()=>{x(T,g)});return}b.current=null,u(O=>O.length>0?O.slice(1):O),f.current=g},[]);return C.useImperativeHandle(n,()=>({pulsate:P,start:E,stop:x}),[P,E,x]),p.jsx(ux,w({className:ve(Yt.root,i.root,s),ref:m},l,{children:p.jsx(Js,{component:null,exit:!0,children:c})}))});process.env.NODE_ENV!=="production"&&(of.propTypes={center:a.bool,classes:a.object,className:a.string});const fx=of;function px(e){return Ee("MuiButtonBase",e)}const mx=Pe("MuiButtonBase",["root","disabled","focusVisible"]),hx=mx,vx=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],gx=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,s=Oe({root:["root",t&&"disabled",n&&"focusVisible"]},px,o);return n&&r&&(s.root+=` ${r}`),s},yx=ae("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${hx.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),af=C.forwardRef(function(t,n){const r=Te({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:s,className:l,component:c="button",disabled:u=!1,disableRipple:d=!1,disableTouchRipple:f=!1,focusRipple:h=!1,LinkComponent:v="a",onBlur:b,onClick:m,onContextMenu:y,onDragLeave:E,onFocus:P,onFocusVisible:x,onKeyDown:T,onKeyUp:g,onMouseDown:O,onMouseLeave:D,onMouseUp:R,onTouchEnd:I,onTouchMove:_,onTouchStart:$,tabIndex:B=0,TouchRippleProps:N,touchRippleRef:j,type:M}=r,L=se(r,vx),F=C.useRef(null),W=C.useRef(null),G=ot(W,j),{isFocusVisibleRef:A,onFocus:U,onBlur:re,ref:oe}=ad(),[z,K]=C.useState(!1);u&&z&&K(!1),C.useImperativeHandle(o,()=>({focusVisible:()=>{K(!0),F.current.focus()}}),[]);const[Y,q]=C.useState(!1);C.useEffect(()=>{q(!0)},[]);const Q=Y&&!d&&!u;C.useEffect(()=>{z&&h&&!d&&Y&&W.current.pulsate()},[d,h,z,Y]);function X(we,St,ge=f){return ye(Re=>(St&&St(Re),!ge&&W.current&&W.current[we](Re),!0))}const V=X("start",O),J=X("stop",y),S=X("stop",E),ee=X("stop",R),Z=X("stop",we=>{z&&we.preventDefault(),D&&D(we)}),ne=X("start",$),fe=X("stop",I),te=X("stop",_),me=X("stop",we=>{re(we),A.current===!1&&K(!1),b&&b(we)},!1),be=ye(we=>{F.current||(F.current=we.currentTarget),U(we),A.current===!0&&(K(!0),x&&x(we)),P&&P(we)}),xe=()=>{const we=F.current;return c&&c!=="button"&&!(we.tagName==="A"&&we.href)},De=C.useRef(!1),Xe=ye(we=>{h&&!De.current&&z&&W.current&&we.key===" "&&(De.current=!0,W.current.stop(we,()=>{W.current.start(we)})),we.target===we.currentTarget&&xe()&&we.key===" "&&we.preventDefault(),T&&T(we),we.target===we.currentTarget&&xe()&&we.key==="Enter"&&!u&&(we.preventDefault(),m&&m(we))}),Fe=ye(we=>{h&&we.key===" "&&W.current&&z&&!we.defaultPrevented&&(De.current=!1,W.current.stop(we,()=>{W.current.pulsate(we)})),g&&g(we),m&&we.target===we.currentTarget&&xe()&&we.key===" "&&!we.defaultPrevented&&m(we)});let nt=c;nt==="button"&&(L.href||L.to)&&(nt=v);const Ze={};nt==="button"?(Ze.type=M===void 0?"button":M,Ze.disabled=u):(!L.href&&!L.to&&(Ze.role="button"),u&&(Ze["aria-disabled"]=u));const Pt=ot(n,oe,F);process.env.NODE_ENV!=="production"&&C.useEffect(()=>{Q&&!W.current&&console.error(["MUI: The `component` prop provided to ButtonBase is invalid.","Please make sure the children prop is rendered in this custom component."].join(`
200
- `))},[Q]);const Ct=w({},r,{centerRipple:i,component:c,disabled:u,disableRipple:d,disableTouchRipple:f,focusRipple:h,tabIndex:B,focusVisible:z}),ke=gx(Ct);return p.jsxs(yx,w({as:nt,className:ve(ke.root,l),ownerState:Ct,onBlur:me,onClick:m,onContextMenu:J,onFocus:be,onKeyDown:Xe,onKeyUp:Fe,onMouseDown:V,onMouseLeave:Z,onMouseUp:ee,onDragLeave:S,onTouchEnd:fe,onTouchMove:te,onTouchStart:ne,ref:Pt,tabIndex:u?-1:B,type:M},Ze,L,{children:[s,Q?p.jsx(fx,w({ref:G,center:i},N)):null]}))});process.env.NODE_ENV!=="production"&&(af.propTypes={action:nn,centerRipple:a.bool,children:a.node,classes:a.object,className:a.string,component:Ra,disabled:a.bool,disableRipple:a.bool,disableTouchRipple:a.bool,focusRipple:a.bool,focusVisibleClassName:a.string,href:a.any,LinkComponent:a.elementType,onBlur:a.func,onClick:a.func,onContextMenu:a.func,onDragLeave:a.func,onFocus:a.func,onFocusVisible:a.func,onKeyDown:a.func,onKeyUp:a.func,onMouseDown:a.func,onMouseLeave:a.func,onMouseUp:a.func,onTouchEnd:a.func,onTouchMove:a.func,onTouchStart:a.func,sx:a.oneOfType([a.arrayOf(a.oneOfType([a.func,a.object,a.bool])),a.func,a.object]),tabIndex:a.number,TouchRippleProps:a.object,touchRippleRef:a.oneOfType([a.func,a.shape({current:a.shape({pulsate:a.func.isRequired,start:a.func.isRequired,stop:a.func.isRequired})})]),type:a.oneOfType([a.oneOf(["button","reset","submit"]),a.string])});const Ir=af;function bx(e){return Ee("MuiButton",e)}const xx=Pe("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),Ko=xx,sf=C.createContext({});process.env.NODE_ENV!=="production"&&(sf.displayName="ButtonGroupContext");const wx=sf,Cx=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],Tx=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:i,classes:s}=e,l={root:["root",i,`${i}${ce(t)}`,`size${ce(o)}`,`${i}Size${ce(o)}`,t==="inherit"&&"colorInherit",n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${ce(o)}`],endIcon:["endIcon",`iconSize${ce(o)}`]},c=Oe(l,bx,s);return w({},s,c)},lf=e=>w({},e.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},e.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},e.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),Ex=ae(Ir,{shouldForwardProp:e=>Dn(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${ce(n.color)}`],t[`size${ce(n.size)}`],t[`${n.variant}Size${ce(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var n,r;const o=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],i=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return w({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":w({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Je(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="text"&&t.color!=="inherit"&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Je(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="outlined"&&t.color!=="inherit"&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Je(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="contained"&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:i,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},t.variant==="contained"&&t.color!=="inherit"&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":w({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${Ko.focusVisible}`]:w({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${Ko.disabled}`]:w({color:(e.vars||e).palette.action.disabled},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},t.variant==="contained"&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},t.variant==="text"&&{padding:"6px 8px"},t.variant==="text"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main},t.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},t.variant==="outlined"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${Je(e.palette[t.color].main,.5)}`},t.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(n=(r=e.palette).getContrastText)==null?void 0:n.call(r,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:o,boxShadow:(e.vars||e).shadows[2]},t.variant==="contained"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},t.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},t.size==="small"&&t.variant==="text"&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="text"&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="outlined"&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="outlined"&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="contained"&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="contained"&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Ko.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Ko.disabled}`]:{boxShadow:"none"}}),Px=ae("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${ce(n.size)}`]]}})(({ownerState:e})=>w({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},lf(e))),Ox=ae("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${ce(n.size)}`]]}})(({ownerState:e})=>w({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},lf(e))),cf=C.forwardRef(function(t,n){const r=C.useContext(wx),o=xs(r,t),i=Te({props:o,name:"MuiButton"}),{children:s,color:l="primary",component:c="button",className:u,disabled:d=!1,disableElevation:f=!1,disableFocusRipple:h=!1,endIcon:v,focusVisibleClassName:b,fullWidth:m=!1,size:y="medium",startIcon:E,type:P,variant:x="text"}=i,T=se(i,Cx),g=w({},i,{color:l,component:c,disabled:d,disableElevation:f,disableFocusRipple:h,fullWidth:m,size:y,type:P,variant:x}),O=Tx(g),D=E&&p.jsx(Px,{className:O.startIcon,ownerState:g,children:E}),R=v&&p.jsx(Ox,{className:O.endIcon,ownerState:g,children:v});return p.jsxs(Ex,w({ownerState:g,className:ve(r.className,O.root,u),component:c,disabled:d,focusRipple:!h,focusVisibleClassName:ve(O.focusVisible,b),ref:n,type:P},T,{classes:O,children:[D,s,R]}))});process.env.NODE_ENV!=="production"&&(cf.propTypes={children:a.node,classes:a.object,className:a.string,color:a.oneOfType([a.oneOf(["inherit","primary","secondary","success","error","info","warning"]),a.string]),component:a.elementType,disabled:a.bool,disableElevation:a.bool,disableFocusRipple:a.bool,disableRipple:a.bool,endIcon:a.node,focusVisibleClassName:a.string,fullWidth:a.bool,href:a.string,size:a.oneOfType([a.oneOf(["small","medium","large"]),a.string]),startIcon:a.node,sx:a.oneOfType([a.arrayOf(a.oneOfType([a.func,a.object,a.bool])),a.func,a.object]),type:a.oneOfType([a.oneOf(["button","reset","submit"]),a.string]),variant:a.oneOfType([a.oneOf(["contained","outlined","text"]),a.string])});const er=cf,Xc=({status:e,message:t,onSuccess:n,id:r})=>{const{closePopupById:o}=H.useContext(Rn),i=()=>{o(r)};return p.jsxs("div",{className:"alert-message",children:[p.jsxs("div",{className:"alert-message-content",children:[e==="failed"&&p.jsx("div",{className:"alert-message-img",children:p.jsx(tf,{fontSize:"inherit",color:"error"})}),p.jsx("div",{className:"alert-message-text",dangerouslySetInnerHTML:{__html:t||""}})]}),p.jsx("div",{className:"alert-message-button",children:p.jsx(er,{id:"alert_submit_button",variant:"contained",color:"secondary",onClick:()=>{i(),e==="success"&&(n==null||n())},children:"Продолжить"})})]})},Dx={showErrorAlert(e){},showSuccessAlert(e,t){},popups:[],showNewPopup:null,closePopupById:null},Rn=H.createContext(Dx),Sx=()=>{const[e,t]=H.useState([]);return{popups:e,showNewPopup:s=>{t(l=>[...l,s])},closePopupById:s=>{t(l=>l.filter(c=>c.id!==s))},showErrorAlert:s=>{const l=Math.random().toString();t(c=>[...c,{content:p.jsx(Xc,{id:l,status:"failed",message:s}),title:"Уведомление",id:l}])},showSuccessAlert:(s,l)=>{const c=Math.random().toString();t(u=>[...u,{content:p.jsx(Xc,{id:c,status:"success",message:s,onSuccess:l}),title:"Уведомление",id:c}])}}},Rx=({children:e})=>{const t=Sx();return p.jsx(Rn.Provider,{value:t,children:e})};Yu.create();function ir({url:e,method:t,data:n,setIsLoadingVal:r,excludedCodes:o,initLoading:i=!1,successMessage:s,onSuccessMessageConfirm:l}){const[c,u]=H.useState(i),{apiAxios:d}=H.useContext(Ft),{showSuccessAlert:f,showErrorAlert:h}=H.useContext(Rn);return{isLoading:c,setIsLoading:u,Send:async(b,m)=>(u(!0),r==null||r(!0),d()(e,{method:t,data:{...n,...b}}).then(y=>(m==null||m(),s&&f(s,l),y.data.message&&f(y.data.message,l),y.data)).catch(y=>{throw o!=null&&o.includes(y.response.data.code)||h(y.response.data.msg||"Произошла непредвиденная ошибка"),{code:y.response.data.code,msg:y.response.data.msg}}).finally(()=>{u(!1),r==null||r(!1)}))}}const Xa=({children:e})=>p.jsx("div",{className:"cloud",children:p.jsx(Ce.Typography,{children:e})}),Mx=()=>{const[e,t]=H.useState(),{phoneNumber:n,cabinetType:r}=H.useContext(Ft),{setIsLoading:o}=H.useContext(Ln),{Send:i}=ir({url:"/externalCustomerCabinet/purchase/history",method:"post"}),s=async()=>{if(!n)throw ErrorEvent;o("GetPurchaseHistory",!0);const c=await i({phone:n,cabinetType:r});t(c.activities),o("GetPurchaseHistory",!1)};return H.useEffect(()=>{s()},[n]),{purchaseNotFound:e&&(e==null?void 0:e.length)===0?p.jsx(Xa,{children:p.jsx("div",{children:p.jsx("div",{children:"Покупок не было"})})}):null,purchaseHistory:e}};var uf=(e=>(e[e.Bonuses=0]="Bonuses",e[e.Purchases=1]="Purchases",e))(uf||{});const sr=e=>{const t=[{id:1,name:"Понедельник"},{id:2,name:"Вторник"},{id:3,name:"Среда"},{id:4,name:"Четверг"},{id:5,name:"Пятница"},{id:6,name:"Суббота"},{id:0,name:"Воскресенье"}],n=[{time:2,name:"Московское время - 1ч"},{time:3,name:"Московское время"},{time:4,name:"Московское время + 1ч"},{time:5,name:"Московское время + 2ч"},{time:6,name:"Московское время + 3ч"},{time:7,name:"Московское время + 4ч"},{time:8,name:"Московское время + 5ч"},{time:9,name:"Московское время + 6ч"},{time:10,name:"Московское время + 7ч"},{time:11,name:"Московское время + 8ч"},{time:12,name:"Московское время + 9ч"}],r=x=>{var T;return(T=t.find(g=>g.id===x))==null?void 0:T.name},o=x=>Date.parse(x)?new Date(x).toLocaleString("en-US"):null,i=(x,T)=>x?new Date(x).toLocaleDateString("ru",T):null,s=x=>x?new Date(x).toLocaleString("ru"):null,l=x=>new Date(x).toLocaleTimeString("ru",{hour:"2-digit",minute:"2-digit"});Date.prototype.addHours=function(x){return this.setTime(this.getTime()+x*60*60*1e3),this};const c=x=>{const T=new RegExp("\\d{2}:\\d{2}:\\d{2}");return new Date(x).addHours(e??0).toISOString().match(T)[0]},u=x=>{if(!x)return null;const T=/^(\d{1,2}).(\d{1,2}).(\d{4})/;let g;try{g=x.match(T)}catch{return null}if(g==null||g.length<4)return null;const O=new Date;return O.setFullYear(Number(g[3]),Number(g[2])-1,Number(g[1])),console.log(O),O};function d(x){return new Date(x.getTime()-x.getTimezoneOffset()*60*1e3)}const f=(x,T=new Date)=>{const O=T.getTime()+x*864e5;return new Date(O)},h=(x,T=new Date)=>{const O=T.getTime()+x*864e5;return new Date(O).toISOString().split("T")[0]},v=()=>new Date().toISOString().split("T")[0],b=x=>{if(!x)return null;const T=/^(\d{4})-(\d{1,2})-(\d{1,2})/,g=x.match(T);return`${g[1]}-${g[2]}-${g[3]}`},m=x=>typeof x=="string"?x:new Date(x.getTime()-x.getTimezoneOffset()*6e4).toISOString(),y=()=>{const x=new Date;return x.getMonth()===0?new Date(x.getFullYear()-1,0,2,1).toISOString().split("T")[0]:new Date(x.getFullYear(),0,2,1).toISOString().split("T")[0]},E=[...Array(12).keys()];return{ConvertUTCDateToLocalDate:d,ParseStringToDate:u,ToIsoWithoutTimeZone:m,ConvertFromStringWithPoints:o,AddDaysToDateToStr:h,ParseDataTimeToRusLocale:s,ParseDataToRusLocale:i,AddDaysToDate:f,GetToday:v,ParseTimeSec:c,GetStartYear:y,DayOfWeeks:t,monthsNum:E,monthsStr:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],UtcOffsets:n,ParseTime:l,DateFromString:b,DayOfWeekById:r}};var df={exports:{}};/*!
200
+ `))},[Q]);const Ct=w({},r,{centerRipple:i,component:c,disabled:u,disableRipple:d,disableTouchRipple:f,focusRipple:h,tabIndex:B,focusVisible:z}),ke=gx(Ct);return p.jsxs(yx,w({as:nt,className:ve(ke.root,l),ownerState:Ct,onBlur:me,onClick:m,onContextMenu:J,onFocus:be,onKeyDown:Xe,onKeyUp:Fe,onMouseDown:V,onMouseLeave:Z,onMouseUp:ee,onDragLeave:S,onTouchEnd:fe,onTouchMove:te,onTouchStart:ne,ref:Pt,tabIndex:u?-1:B,type:M},Ze,L,{children:[s,Q?p.jsx(fx,w({ref:G,center:i},N)):null]}))});process.env.NODE_ENV!=="production"&&(af.propTypes={action:nn,centerRipple:a.bool,children:a.node,classes:a.object,className:a.string,component:Ra,disabled:a.bool,disableRipple:a.bool,disableTouchRipple:a.bool,focusRipple:a.bool,focusVisibleClassName:a.string,href:a.any,LinkComponent:a.elementType,onBlur:a.func,onClick:a.func,onContextMenu:a.func,onDragLeave:a.func,onFocus:a.func,onFocusVisible:a.func,onKeyDown:a.func,onKeyUp:a.func,onMouseDown:a.func,onMouseLeave:a.func,onMouseUp:a.func,onTouchEnd:a.func,onTouchMove:a.func,onTouchStart:a.func,sx:a.oneOfType([a.arrayOf(a.oneOfType([a.func,a.object,a.bool])),a.func,a.object]),tabIndex:a.number,TouchRippleProps:a.object,touchRippleRef:a.oneOfType([a.func,a.shape({current:a.shape({pulsate:a.func.isRequired,start:a.func.isRequired,stop:a.func.isRequired})})]),type:a.oneOfType([a.oneOf(["button","reset","submit"]),a.string])});const Ir=af;function bx(e){return Ee("MuiButton",e)}const xx=Pe("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),Ko=xx,sf=C.createContext({});process.env.NODE_ENV!=="production"&&(sf.displayName="ButtonGroupContext");const wx=sf,Cx=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],Tx=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:i,classes:s}=e,l={root:["root",i,`${i}${ce(t)}`,`size${ce(o)}`,`${i}Size${ce(o)}`,t==="inherit"&&"colorInherit",n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${ce(o)}`],endIcon:["endIcon",`iconSize${ce(o)}`]},c=Oe(l,bx,s);return w({},s,c)},lf=e=>w({},e.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},e.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},e.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),Ex=ae(Ir,{shouldForwardProp:e=>Dn(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${ce(n.color)}`],t[`size${ce(n.size)}`],t[`${n.variant}Size${ce(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var n,r;const o=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],i=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return w({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":w({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Je(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="text"&&t.color!=="inherit"&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Je(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="outlined"&&t.color!=="inherit"&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Je(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="contained"&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:i,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},t.variant==="contained"&&t.color!=="inherit"&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":w({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${Ko.focusVisible}`]:w({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${Ko.disabled}`]:w({color:(e.vars||e).palette.action.disabled},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},t.variant==="contained"&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},t.variant==="text"&&{padding:"6px 8px"},t.variant==="text"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main},t.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},t.variant==="outlined"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${Je(e.palette[t.color].main,.5)}`},t.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(n=(r=e.palette).getContrastText)==null?void 0:n.call(r,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:o,boxShadow:(e.vars||e).shadows[2]},t.variant==="contained"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},t.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},t.size==="small"&&t.variant==="text"&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="text"&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="outlined"&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="outlined"&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="contained"&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="contained"&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Ko.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Ko.disabled}`]:{boxShadow:"none"}}),Px=ae("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${ce(n.size)}`]]}})(({ownerState:e})=>w({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},lf(e))),Ox=ae("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${ce(n.size)}`]]}})(({ownerState:e})=>w({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},lf(e))),cf=C.forwardRef(function(t,n){const r=C.useContext(wx),o=xs(r,t),i=Te({props:o,name:"MuiButton"}),{children:s,color:l="primary",component:c="button",className:u,disabled:d=!1,disableElevation:f=!1,disableFocusRipple:h=!1,endIcon:v,focusVisibleClassName:b,fullWidth:m=!1,size:y="medium",startIcon:E,type:P,variant:x="text"}=i,T=se(i,Cx),g=w({},i,{color:l,component:c,disabled:d,disableElevation:f,disableFocusRipple:h,fullWidth:m,size:y,type:P,variant:x}),O=Tx(g),D=E&&p.jsx(Px,{className:O.startIcon,ownerState:g,children:E}),R=v&&p.jsx(Ox,{className:O.endIcon,ownerState:g,children:v});return p.jsxs(Ex,w({ownerState:g,className:ve(r.className,O.root,u),component:c,disabled:d,focusRipple:!h,focusVisibleClassName:ve(O.focusVisible,b),ref:n,type:P},T,{classes:O,children:[D,s,R]}))});process.env.NODE_ENV!=="production"&&(cf.propTypes={children:a.node,classes:a.object,className:a.string,color:a.oneOfType([a.oneOf(["inherit","primary","secondary","success","error","info","warning"]),a.string]),component:a.elementType,disabled:a.bool,disableElevation:a.bool,disableFocusRipple:a.bool,disableRipple:a.bool,endIcon:a.node,focusVisibleClassName:a.string,fullWidth:a.bool,href:a.string,size:a.oneOfType([a.oneOf(["small","medium","large"]),a.string]),startIcon:a.node,sx:a.oneOfType([a.arrayOf(a.oneOfType([a.func,a.object,a.bool])),a.func,a.object]),type:a.oneOfType([a.oneOf(["button","reset","submit"]),a.string]),variant:a.oneOfType([a.oneOf(["contained","outlined","text"]),a.string])});const er=cf,Xc=({status:e,message:t,onSuccess:n,id:r})=>{const{closePopupById:o}=H.useContext(Rn),i=()=>{o(r)};return p.jsxs("div",{className:"alert-message",children:[p.jsxs("div",{className:"alert-message-content",children:[e==="failed"&&p.jsx("div",{className:"alert-message-img",children:p.jsx(tf,{fontSize:"inherit",color:"error"})}),p.jsx("div",{className:"alert-message-text",dangerouslySetInnerHTML:{__html:t||""}})]}),p.jsx("div",{className:"alert-message-button",children:p.jsx(er,{id:"alert_submit_button",variant:"contained",color:"secondary",onClick:()=>{i(),e==="success"&&(n==null||n())},children:"Продолжить"})})]})},Dx={showErrorAlert(e){},showSuccessAlert(e,t){},popups:[],showNewPopup:null,closePopupById:null},Rn=H.createContext(Dx),Sx=()=>{const[e,t]=H.useState([]);return{popups:e,showNewPopup:s=>{t(l=>[...l,s])},closePopupById:s=>{t(l=>l.filter(c=>c.id!==s))},showErrorAlert:s=>{const l=Math.random().toString();t(c=>[...c,{content:p.jsx(Xc,{id:l,status:"failed",message:s}),title:"Уведомление",id:l}])},showSuccessAlert:(s,l)=>{const c=Math.random().toString();t(u=>[...u,{content:p.jsx(Xc,{id:c,status:"success",message:s,onSuccess:l}),title:"Уведомление",id:c}])}}},Rx=({children:e})=>{const t=Sx();return p.jsx(Rn.Provider,{value:t,children:e})};Yu.create();function ir({url:e,method:t,data:n,setIsLoadingVal:r,excludedCodes:o,initLoading:i=!1,successMessage:s,onSuccessMessageConfirm:l}){const[c,u]=H.useState(i),{apiAxios:d}=H.useContext(Ft),{showSuccessAlert:f,showErrorAlert:h}=H.useContext(Rn);return{isLoading:c,setIsLoading:u,Send:async(b,m)=>(u(!0),r==null||r(!0),d()(e,{method:t,data:{...n,...b}}).then(y=>(m==null||m(),s&&f(s,l),y.data.message&&f(y.data.message,l),y.data)).catch(y=>{throw o!=null&&o.includes(y.response.data.code)||h(y.response.data.msg||"Произошла непредвиденная ошибка"),{code:y.response.data.code,msg:y.response.data.msg}}).finally(()=>{u(!1),r==null||r(!1)}))}}const Xa=({children:e})=>p.jsx("div",{className:"cloud",children:p.jsx(Ce.Typography,{children:e})}),Mx=()=>{const[e,t]=H.useState(),{phoneNumber:n,cabinetType:r}=H.useContext(Ft),{setIsLoading:o}=H.useContext(Ln),{Send:i}=ir({url:"/externalCustomerCabinet/purchase/history",method:"post"}),s=async()=>{if(!n)throw ErrorEvent;o("GetPurchaseHistory",!0);try{const c=await i({phone:n,cabinetType:r});t(c.activities)}catch{}finally{o("GetPurchaseHistory",!1)}};return H.useEffect(()=>{s()},[n]),{purchaseNotFound:e&&(e==null?void 0:e.length)===0?p.jsx(Xa,{children:p.jsx("div",{children:p.jsx("div",{children:"Покупок не было"})})}):null,purchaseHistory:e}};var uf=(e=>(e[e.Bonuses=0]="Bonuses",e[e.Purchases=1]="Purchases",e))(uf||{});const sr=e=>{const t=[{id:1,name:"Понедельник"},{id:2,name:"Вторник"},{id:3,name:"Среда"},{id:4,name:"Четверг"},{id:5,name:"Пятница"},{id:6,name:"Суббота"},{id:0,name:"Воскресенье"}],n=[{time:2,name:"Московское время - 1ч"},{time:3,name:"Московское время"},{time:4,name:"Московское время + 1ч"},{time:5,name:"Московское время + 2ч"},{time:6,name:"Московское время + 3ч"},{time:7,name:"Московское время + 4ч"},{time:8,name:"Московское время + 5ч"},{time:9,name:"Московское время + 6ч"},{time:10,name:"Московское время + 7ч"},{time:11,name:"Московское время + 8ч"},{time:12,name:"Московское время + 9ч"}],r=x=>{var T;return(T=t.find(g=>g.id===x))==null?void 0:T.name},o=x=>Date.parse(x)?new Date(x).toLocaleString("en-US"):null,i=(x,T)=>x?new Date(x).toLocaleDateString("ru",T):null,s=x=>x?new Date(x).toLocaleString("ru"):null,l=x=>new Date(x).toLocaleTimeString("ru",{hour:"2-digit",minute:"2-digit"});Date.prototype.addHours=function(x){return this.setTime(this.getTime()+x*60*60*1e3),this};const c=x=>{const T=new RegExp("\\d{2}:\\d{2}:\\d{2}");return new Date(x).addHours(e??0).toISOString().match(T)[0]},u=x=>{if(!x)return null;const T=/^(\d{1,2}).(\d{1,2}).(\d{4})/;let g;try{g=x.match(T)}catch{return null}if(g==null||g.length<4)return null;const O=new Date;return O.setFullYear(Number(g[3]),Number(g[2])-1,Number(g[1])),console.log(O),O};function d(x){return new Date(x.getTime()-x.getTimezoneOffset()*60*1e3)}const f=(x,T=new Date)=>{const O=T.getTime()+x*864e5;return new Date(O)},h=(x,T=new Date)=>{const O=T.getTime()+x*864e5;return new Date(O).toISOString().split("T")[0]},v=()=>new Date().toISOString().split("T")[0],b=x=>{if(!x)return null;const T=/^(\d{4})-(\d{1,2})-(\d{1,2})/,g=x.match(T);return`${g[1]}-${g[2]}-${g[3]}`},m=x=>typeof x=="string"?x:new Date(x.getTime()-x.getTimezoneOffset()*6e4).toISOString(),y=()=>{const x=new Date;return x.getMonth()===0?new Date(x.getFullYear()-1,0,2,1).toISOString().split("T")[0]:new Date(x.getFullYear(),0,2,1).toISOString().split("T")[0]},E=[...Array(12).keys()];return{ConvertUTCDateToLocalDate:d,ParseStringToDate:u,ToIsoWithoutTimeZone:m,ConvertFromStringWithPoints:o,AddDaysToDateToStr:h,ParseDataTimeToRusLocale:s,ParseDataToRusLocale:i,AddDaysToDate:f,GetToday:v,ParseTimeSec:c,GetStartYear:y,DayOfWeeks:t,monthsNum:E,monthsStr:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],UtcOffsets:n,ParseTime:l,DateFromString:b,DayOfWeekById:r}};var df={exports:{}};/*!
201
201
  Copyright (c) 2018 Jed Watson.
202
202
  Licensed under the MIT License (MIT), see
203
203
  http://jedwatson.github.io/classnames
@@ -798,9 +798,10 @@ const Ps = Hi, sh = {
798
798
  await D();
799
799
  } catch {
800
800
  await (async () => {
801
- await m().post("/externalCustomerCabinet/customer/connect", {
801
+ const $ = await m().post("/externalCustomerCabinet/customer/connect", {
802
802
  VKUserId: r
803
803
  });
804
+ s($.data.encryptPhoneNumber);
804
805
  })(), await D();
805
806
  } finally {
806
807
  t("GetCustomerInfo", !1);
@@ -9303,11 +9304,16 @@ const ii = ({ children: e }) => /* @__PURE__ */ p.jsx("div", { className: "cloud
9303
9304
  if (!n)
9304
9305
  throw ErrorEvent;
9305
9306
  o("GetPurchaseHistory", !0);
9306
- const c = await i({
9307
- phone: n,
9308
- cabinetType: r
9309
- });
9310
- t(c.activities), o("GetPurchaseHistory", !1);
9307
+ try {
9308
+ const c = await i({
9309
+ phone: n,
9310
+ cabinetType: r
9311
+ });
9312
+ t(c.activities);
9313
+ } catch {
9314
+ } finally {
9315
+ o("GetPurchaseHistory", !1);
9316
+ }
9311
9317
  };
9312
9318
  return nt(() => {
9313
9319
  s();
@@ -30,7 +30,7 @@ Check the top-level render call using <`+pe+">.")}return ie}}function rn(R,ie){{
30
30
  @font-face {
31
31
  font-family: bonusPlus, Fallback, sans-serif;
32
32
  }
33
- `}}});bi=Ce.responsiveFontSizes(bi);const xi=bi,Cm={isLoading:!1,setIsLoading(e,t){}},$n=U.createContext(Cm),Tm=()=>{const[e,t]=U.useState([]),n=(r,o)=>{t(o?i=>[...i,{id:r}]:i=>i.filter(s=>s.id!==r))};return{isLoading:e.length!==0,setIsLoading:n}},Em=({children:e})=>{const t=Tm();return f.jsx($n.Provider,{value:t,children:e})},Pm={openedPage:"info",setOpenedPage:null},zr=U.createContext(Pm),Om=()=>{const[e,t]=U.useState("info");return{openedPage:e,setOpenedPage:t}},Dm=({children:e})=>{const t=Om();return f.jsx(zr.Provider,{value:t,children:e})},Sm={cabinetType:null,cabinetIsLoading:!0,apiAxios:()=>null,phoneNumber:null,setPhoneNumber:null,cabinetSettings:null,setCabinetSettings:null,cabinetUISettings:null,authToken:null,setAuthToken:null,createAxios:null,theme:null,customer:null,VKUserId:null,setVKUserId:null,additionalData:null,setAdditionalData:null},Nt=U.createContext(Sm),Mm=({cabinetType:e})=>{const{setIsLoading:t}=U.useContext($n),{setOpenedPage:n}=U.useContext(zr),[r,o]=U.useState(null),[i,s]=U.useState(null),[l,c]=U.useState(null),[u,d]=U.useState(null),[p,h]=U.useState(null);U.useState(null);const[v,b]=U.useState({}),m=()=>Al.create({baseURL:p??"",headers:{Authorization:`Bearer ${l}`,"X-CabinetType":e,"X-PhoneNumber":i}}),y=xi,[E,P]=U.useState(null),[x,T]=U.useState(null);return U.useEffect(()=>{(async()=>{if(!l||!i||e===null)return;t("GetCabinetSettings",!0);const M=await m().post("/externalCustomerCabinet/cabinetInfo",{});P(M.data),M.data.isReg&&n("registration"),t("GetCabinetSettings",!1)})()},[i,l]),U.useEffect(()=>{(async()=>{if(!l||!i||e===null||!E||E!=null&&E.isReg)return;t("GetCustomerInfo",!0);const D=async()=>{const I=await m().post("/externalCustomerCabinet/customer/info",{VKUserId:r});d({...I.data.customer,eCardCustomerLink:I.data.eCardCustomerLink})};try{await D()}catch{await(async()=>{await m().post("/externalCustomerCabinet/customer/connect",{VKUserId:r})})(),await D()}finally{t("GetCustomerInfo",!1)}})()},[i,E]),U.useEffect(()=>{(async()=>{if(!l)return;t("GetCabinetUISettings",!0);const M=await m().post("/externalCustomerCabinet/settings",{});T(M.data.settings),t("GetCabinetUISettings",!1)})()},[l]),{cabinetType:e,apiAxios:m,cabinetIsLoading:!1,cabinetSettings:E,setCabinetSettings:P,cabinetUISettings:x,phoneNumber:i,setPhoneNumber:s,authToken:l,setAuthToken:c,createAxios:(O,D)=>{c(O),h(D)},theme:y,setVKUserId:o,VKUserId:r,customer:u,additionalData:v,setAdditionalData:b}},km=({children:e,cabinetType:t})=>{const n=Mm({cabinetType:t});return f.jsx(Nt.Provider,{value:{...n,cabinetType:t},children:e})},zl=({fileValue:e})=>{const{cabinetUISettings:t}=U.useContext(Nt),n=e?`url(data:image/png;base64,${e})`:`url(${t==null?void 0:t.headerImageUrl})`;return f.jsx(Ce.Typography,{variant:"h2",component:"div",children:f.jsx("div",{className:"header",style:{backgroundColor:t==null?void 0:t.headerColor},children:f.jsx(Ce.Container,{maxWidth:"sm",sx:{paddingBottom:`${t==null?void 0:t.paddingBottom}px`,paddingTop:`${t==null?void 0:t.paddingTop}px`},children:t!=null&&t.headerUrlRedirect?f.jsx("a",{href:t==null?void 0:t.headerUrlRedirect,target:"_blank",children:f.jsx("div",{className:"header__img",style:{backgroundImage:n}})}):f.jsx("div",{className:"header__img",style:{backgroundImage:n}})})})})};class Rm extends U.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.log({error:t,errorInfo:n})}render(){return this.state.hasError?f.jsx("h1",{children:"Что-то пошло не так"}):this.props.children}}var wi={},Ul={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ul);var Mt=Ul.exports,Ci={};function on(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...r){return e(...r)||t(...r)}}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(this,arguments)}function zn(e){return e!==null&&typeof e=="object"&&e.constructor===Object}function Yl(e){if(!zn(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Yl(e[n])}),t}function Wt(e,t,n={clone:!0}){const r=n.clone?w({},e):e;return zn(e)&&zn(t)&&Object.keys(t).forEach(o=>{o!=="__proto__"&&(zn(t[o])&&o in e&&zn(e[o])?r[o]=Wt(e[o],t[o],n):n.clone?r[o]=zn(t[o])?Yl(t[o]):t[o]:r[o]=t[o])}),r}var Ti={exports:{}},Yo={exports:{}},Ue={};/** @license React v16.13.1
33
+ `}}});bi=Ce.responsiveFontSizes(bi);const xi=bi,Cm={isLoading:!1,setIsLoading(e,t){}},$n=U.createContext(Cm),Tm=()=>{const[e,t]=U.useState([]),n=(r,o)=>{t(o?i=>[...i,{id:r}]:i=>i.filter(s=>s.id!==r))};return{isLoading:e.length!==0,setIsLoading:n}},Em=({children:e})=>{const t=Tm();return f.jsx($n.Provider,{value:t,children:e})},Pm={openedPage:"info",setOpenedPage:null},zr=U.createContext(Pm),Om=()=>{const[e,t]=U.useState("info");return{openedPage:e,setOpenedPage:t}},Dm=({children:e})=>{const t=Om();return f.jsx(zr.Provider,{value:t,children:e})},Sm={cabinetType:null,cabinetIsLoading:!0,apiAxios:()=>null,phoneNumber:null,setPhoneNumber:null,cabinetSettings:null,setCabinetSettings:null,cabinetUISettings:null,authToken:null,setAuthToken:null,createAxios:null,theme:null,customer:null,VKUserId:null,setVKUserId:null,additionalData:null,setAdditionalData:null},Nt=U.createContext(Sm),Mm=({cabinetType:e})=>{const{setIsLoading:t}=U.useContext($n),{setOpenedPage:n}=U.useContext(zr),[r,o]=U.useState(null),[i,s]=U.useState(null),[l,c]=U.useState(null),[u,d]=U.useState(null),[p,h]=U.useState(null);U.useState(null);const[v,b]=U.useState({}),m=()=>Al.create({baseURL:p??"",headers:{Authorization:`Bearer ${l}`,"X-CabinetType":e,"X-PhoneNumber":i}}),y=xi,[E,P]=U.useState(null),[x,T]=U.useState(null);return U.useEffect(()=>{(async()=>{if(!l||!i||e===null)return;t("GetCabinetSettings",!0);const M=await m().post("/externalCustomerCabinet/cabinetInfo",{});P(M.data),M.data.isReg&&n("registration"),t("GetCabinetSettings",!1)})()},[i,l]),U.useEffect(()=>{(async()=>{if(!l||!i||e===null||!E||E!=null&&E.isReg)return;t("GetCustomerInfo",!0);const D=async()=>{const I=await m().post("/externalCustomerCabinet/customer/info",{VKUserId:r});d({...I.data.customer,eCardCustomerLink:I.data.eCardCustomerLink})};try{await D()}catch{await(async()=>{const $=await m().post("/externalCustomerCabinet/customer/connect",{VKUserId:r});s($.data.encryptPhoneNumber)})(),await D()}finally{t("GetCustomerInfo",!1)}})()},[i,E]),U.useEffect(()=>{(async()=>{if(!l)return;t("GetCabinetUISettings",!0);const M=await m().post("/externalCustomerCabinet/settings",{});T(M.data.settings),t("GetCabinetUISettings",!1)})()},[l]),{cabinetType:e,apiAxios:m,cabinetIsLoading:!1,cabinetSettings:E,setCabinetSettings:P,cabinetUISettings:x,phoneNumber:i,setPhoneNumber:s,authToken:l,setAuthToken:c,createAxios:(O,D)=>{c(O),h(D)},theme:y,setVKUserId:o,VKUserId:r,customer:u,additionalData:v,setAdditionalData:b}},km=({children:e,cabinetType:t})=>{const n=Mm({cabinetType:t});return f.jsx(Nt.Provider,{value:{...n,cabinetType:t},children:e})},zl=({fileValue:e})=>{const{cabinetUISettings:t}=U.useContext(Nt),n=e?`url(data:image/png;base64,${e})`:`url(${t==null?void 0:t.headerImageUrl})`;return f.jsx(Ce.Typography,{variant:"h2",component:"div",children:f.jsx("div",{className:"header",style:{backgroundColor:t==null?void 0:t.headerColor},children:f.jsx(Ce.Container,{maxWidth:"sm",sx:{paddingBottom:`${t==null?void 0:t.paddingBottom}px`,paddingTop:`${t==null?void 0:t.paddingTop}px`},children:t!=null&&t.headerUrlRedirect?f.jsx("a",{href:t==null?void 0:t.headerUrlRedirect,target:"_blank",children:f.jsx("div",{className:"header__img",style:{backgroundImage:n}})}):f.jsx("div",{className:"header__img",style:{backgroundImage:n}})})})})};class Rm extends U.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.log({error:t,errorInfo:n})}render(){return this.state.hasError?f.jsx("h1",{children:"Что-то пошло не так"}):this.props.children}}var wi={},Ul={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ul);var Mt=Ul.exports,Ci={};function on(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...r){return e(...r)||t(...r)}}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(this,arguments)}function zn(e){return e!==null&&typeof e=="object"&&e.constructor===Object}function Yl(e){if(!zn(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Yl(e[n])}),t}function Wt(e,t,n={clone:!0}){const r=n.clone?w({},e):e;return zn(e)&&zn(t)&&Object.keys(t).forEach(o=>{o!=="__proto__"&&(zn(t[o])&&o in e&&zn(e[o])?r[o]=Wt(e[o],t[o],n):n.clone?r[o]=zn(t[o])?Yl(t[o]):t[o]:r[o]=t[o])}),r}var Ti={exports:{}},Yo={exports:{}},Ue={};/** @license React v16.13.1
34
34
  * react-is.production.min.js
35
35
  *
36
36
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -197,7 +197,7 @@ const theme2 = createTheme({ palette: {
197
197
  animation-delay: 200ms;
198
198
  }
199
199
  `),qt.rippleVisible,_0,Ds,({theme:e})=>e.transitions.easing.easeInOut,qt.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,qt.child,qt.childLeaving,I0,Ds,({theme:e})=>e.transitions.easing.easeInOut,qt.childPulsate,N0,({theme:e})=>e.transitions.easing.easeInOut),ld=C.forwardRef(function(t,n){const r=Te({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:s}=r,l=se(r,R0),[c,u]=C.useState([]),d=C.useRef(0),p=C.useRef(null);C.useEffect(()=>{p.current&&(p.current(),p.current=null)},[c]);const h=C.useRef(!1),v=C.useRef(0),b=C.useRef(null),m=C.useRef(null);C.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]);const y=C.useCallback(T=>{const{pulsate:g,rippleX:O,rippleY:D,rippleSize:M,cb:I}=T;u(_=>[..._,f.jsx(A0,{classes:{ripple:ve(i.ripple,qt.ripple),rippleVisible:ve(i.rippleVisible,qt.rippleVisible),ripplePulsate:ve(i.ripplePulsate,qt.ripplePulsate),child:ve(i.child,qt.child),childLeaving:ve(i.childLeaving,qt.childLeaving),childPulsate:ve(i.childPulsate,qt.childPulsate)},timeout:Ds,pulsate:g,rippleX:O,rippleY:D,rippleSize:M},d.current)]),d.current+=1,p.current=I},[i]),E=C.useCallback((T={},g={},O=()=>{})=>{const{pulsate:D=!1,center:M=o||g.pulsate,fakeElement:I=!1}=g;if((T==null?void 0:T.type)==="mousedown"&&h.current){h.current=!1;return}(T==null?void 0:T.type)==="touchstart"&&(h.current=!0);const _=I?null:m.current,$=_?_.getBoundingClientRect():{width:0,height:0,left:0,top:0};let B,N,j;if(M||T===void 0||T.clientX===0&&T.clientY===0||!T.clientX&&!T.touches)B=Math.round($.width/2),N=Math.round($.height/2);else{const{clientX:k,clientY:L}=T.touches&&T.touches.length>0?T.touches[0]:T;B=Math.round(k-$.left),N=Math.round(L-$.top)}if(M)j=Math.sqrt((2*$.width**2+$.height**2)/3),j%2===0&&(j+=1);else{const k=Math.max(Math.abs((_?_.clientWidth:0)-B),B)*2+2,L=Math.max(Math.abs((_?_.clientHeight:0)-N),N)*2+2;j=Math.sqrt(k**2+L**2)}T!=null&&T.touches?b.current===null&&(b.current=()=>{y({pulsate:D,rippleX:B,rippleY:N,rippleSize:j,cb:O})},v.current=setTimeout(()=>{b.current&&(b.current(),b.current=null)},$0)):y({pulsate:D,rippleX:B,rippleY:N,rippleSize:j,cb:O})},[o,y]),P=C.useCallback(()=>{E({},{pulsate:!0})},[E]),x=C.useCallback((T,g)=>{if(clearTimeout(v.current),(T==null?void 0:T.type)==="touchend"&&b.current){b.current(),b.current=null,v.current=setTimeout(()=>{x(T,g)});return}b.current=null,u(O=>O.length>0?O.slice(1):O),p.current=g},[]);return C.useImperativeHandle(n,()=>({pulsate:P,start:E,stop:x}),[P,E,x]),f.jsx(j0,w({className:ve(qt.root,i.root,s),ref:m},l,{children:f.jsx(Os,{component:null,exit:!0,children:c})}))});process.env.NODE_ENV!=="production"&&(ld.propTypes={center:a.bool,classes:a.object,className:a.string});const L0=ld;function F0(e){return Ee("MuiButtonBase",e)}const V0=Pe("MuiButtonBase",["root","disabled","focusVisible"]),B0=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],W0=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,s=Oe({root:["root",t&&"disabled",n&&"focusVisible"]},F0,o);return n&&r&&(s.root+=` ${r}`),s},z0=ae("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${V0.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),cd=C.forwardRef(function(t,n){const r=Te({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:s,className:l,component:c="button",disabled:u=!1,disableRipple:d=!1,disableTouchRipple:p=!1,focusRipple:h=!1,LinkComponent:v="a",onBlur:b,onClick:m,onContextMenu:y,onDragLeave:E,onFocus:P,onFocusVisible:x,onKeyDown:T,onKeyUp:g,onMouseDown:O,onMouseLeave:D,onMouseUp:M,onTouchEnd:I,onTouchMove:_,onTouchStart:$,tabIndex:B=0,TouchRippleProps:N,touchRippleRef:j,type:k}=r,L=se(r,B0),F=C.useRef(null),W=C.useRef(null),G=nt(W,j),{isFocusVisibleRef:A,onFocus:Y,onBlur:re,ref:oe}=mc(),[z,K]=C.useState(!1);u&&z&&K(!1),C.useImperativeHandle(o,()=>({focusVisible:()=>{K(!0),F.current.focus()}}),[]);const[H,q]=C.useState(!1);C.useEffect(()=>{q(!0)},[]);const Q=H&&!d&&!u;C.useEffect(()=>{z&&h&&!d&&H&&W.current.pulsate()},[d,h,z,H]);function X(we,It,ge=p){return ye(Me=>(It&&It(Me),!ge&&W.current&&W.current[we](Me),!0))}const V=X("start",O),J=X("stop",y),S=X("stop",E),ee=X("stop",M),Z=X("stop",we=>{z&&we.preventDefault(),D&&D(we)}),ne=X("start",$),fe=X("stop",I),te=X("stop",_),me=X("stop",we=>{re(we),A.current===!1&&K(!1),b&&b(we)},!1),be=ye(we=>{F.current||(F.current=we.currentTarget),Y(we),A.current===!0&&(K(!0),x&&x(we)),P&&P(we)}),xe=()=>{const we=F.current;return c&&c!=="button"&&!(we.tagName==="A"&&we.href)},De=C.useRef(!1),Xe=ye(we=>{h&&!De.current&&z&&W.current&&we.key===" "&&(De.current=!0,W.current.stop(we,()=>{W.current.start(we)})),we.target===we.currentTarget&&xe()&&we.key===" "&&we.preventDefault(),T&&T(we),we.target===we.currentTarget&&xe()&&we.key==="Enter"&&!u&&(we.preventDefault(),m&&m(we))}),Ve=ye(we=>{h&&we.key===" "&&W.current&&z&&!we.defaultPrevented&&(De.current=!1,W.current.stop(we,()=>{W.current.pulsate(we)})),g&&g(we),m&&we.target===we.currentTarget&&xe()&&we.key===" "&&!we.defaultPrevented&&m(we)});let rt=c;rt==="button"&&(L.href||L.to)&&(rt=v);const Je={};rt==="button"?(Je.type=k===void 0?"button":k,Je.disabled=u):(!L.href&&!L.to&&(Je.role="button"),u&&(Je["aria-disabled"]=u));const Dt=nt(n,oe,F);process.env.NODE_ENV!=="production"&&C.useEffect(()=>{Q&&!W.current&&console.error(["MUI: The `component` prop provided to ButtonBase is invalid.","Please make sure the children prop is rendered in this custom component."].join(`
200
- `))},[Q]);const Pt=w({},r,{centerRipple:i,component:c,disabled:u,disableRipple:d,disableTouchRipple:p,focusRipple:h,tabIndex:B,focusVisible:z}),Re=W0(Pt);return f.jsxs(z0,w({as:rt,className:ve(Re.root,l),ownerState:Pt,onBlur:me,onClick:m,onContextMenu:J,onFocus:be,onKeyDown:Xe,onKeyUp:Ve,onMouseDown:V,onMouseLeave:Z,onMouseUp:ee,onDragLeave:S,onTouchEnd:fe,onTouchMove:te,onTouchStart:ne,ref:Dt,tabIndex:u?-1:B,type:k},Je,L,{children:[s,Q?f.jsx(L0,w({ref:G,center:i},N)):null]}))});process.env.NODE_ENV!=="production"&&(cd.propTypes={action:Jt,centerRipple:a.bool,children:a.node,classes:a.object,className:a.string,component:Ho,disabled:a.bool,disableRipple:a.bool,disableTouchRipple:a.bool,focusRipple:a.bool,focusVisibleClassName:a.string,href:a.any,LinkComponent:a.elementType,onBlur:a.func,onClick:a.func,onContextMenu:a.func,onDragLeave:a.func,onFocus:a.func,onFocusVisible:a.func,onKeyDown:a.func,onKeyUp:a.func,onMouseDown:a.func,onMouseLeave:a.func,onMouseUp:a.func,onTouchEnd:a.func,onTouchMove:a.func,onTouchStart:a.func,sx:a.oneOfType([a.arrayOf(a.oneOfType([a.func,a.object,a.bool])),a.func,a.object]),tabIndex:a.number,TouchRippleProps:a.object,touchRippleRef:a.oneOfType([a.func,a.shape({current:a.shape({pulsate:a.func.isRequired,start:a.func.isRequired,stop:a.func.isRequired})})]),type:a.oneOfType([a.oneOf(["button","reset","submit"]),a.string])});const Mr=cd;function U0(e){return Ee("MuiButton",e)}const $a=Pe("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),ud=C.createContext({});process.env.NODE_ENV!=="production"&&(ud.displayName="ButtonGroupContext");const Y0=ud,H0=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],q0=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:i,classes:s}=e,l={root:["root",i,`${i}${ce(t)}`,`size${ce(o)}`,`${i}Size${ce(o)}`,t==="inherit"&&"colorInherit",n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${ce(o)}`],endIcon:["endIcon",`iconSize${ce(o)}`]},c=Oe(l,U0,s);return w({},s,c)},dd=e=>w({},e.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},e.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},e.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),G0=ae(Mr,{shouldForwardProp:e=>Cn(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${ce(n.color)}`],t[`size${ce(n.size)}`],t[`${n.variant}Size${ce(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var n,r;const o=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],i=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return w({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":w({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Ze(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="text"&&t.color!=="inherit"&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ze(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="outlined"&&t.color!=="inherit"&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ze(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="contained"&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:i,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},t.variant==="contained"&&t.color!=="inherit"&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":w({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${$a.focusVisible}`]:w({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${$a.disabled}`]:w({color:(e.vars||e).palette.action.disabled},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},t.variant==="contained"&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},t.variant==="text"&&{padding:"6px 8px"},t.variant==="text"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main},t.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},t.variant==="outlined"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${Ze(e.palette[t.color].main,.5)}`},t.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(n=(r=e.palette).getContrastText)==null?void 0:n.call(r,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:o,boxShadow:(e.vars||e).shadows[2]},t.variant==="contained"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},t.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},t.size==="small"&&t.variant==="text"&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="text"&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="outlined"&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="outlined"&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="contained"&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="contained"&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${$a.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${$a.disabled}`]:{boxShadow:"none"}}),K0=ae("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${ce(n.size)}`]]}})(({ownerState:e})=>w({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},dd(e))),Q0=ae("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${ce(n.size)}`]]}})(({ownerState:e})=>w({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},dd(e))),fd=C.forwardRef(function(t,n){const r=C.useContext(Y0),o=Ai(r,t),i=Te({props:o,name:"MuiButton"}),{children:s,color:l="primary",component:c="button",className:u,disabled:d=!1,disableElevation:p=!1,disableFocusRipple:h=!1,endIcon:v,focusVisibleClassName:b,fullWidth:m=!1,size:y="medium",startIcon:E,type:P,variant:x="text"}=i,T=se(i,H0),g=w({},i,{color:l,component:c,disabled:d,disableElevation:p,disableFocusRipple:h,fullWidth:m,size:y,type:P,variant:x}),O=q0(g),D=E&&f.jsx(K0,{className:O.startIcon,ownerState:g,children:E}),M=v&&f.jsx(Q0,{className:O.endIcon,ownerState:g,children:v});return f.jsxs(G0,w({ownerState:g,className:ve(r.className,O.root,u),component:c,disabled:d,focusRipple:!h,focusVisibleClassName:ve(O.focusVisible,b),ref:n,type:P},T,{classes:O,children:[D,s,M]}))});process.env.NODE_ENV!=="production"&&(fd.propTypes={children:a.node,classes:a.object,className:a.string,color:a.oneOfType([a.oneOf(["inherit","primary","secondary","success","error","info","warning"]),a.string]),component:a.elementType,disabled:a.bool,disableElevation:a.bool,disableFocusRipple:a.bool,disableRipple:a.bool,endIcon:a.node,focusVisibleClassName:a.string,fullWidth:a.bool,href:a.string,size:a.oneOfType([a.oneOf(["small","medium","large"]),a.string]),startIcon:a.node,sx:a.oneOfType([a.arrayOf(a.oneOfType([a.func,a.object,a.bool])),a.func,a.object]),type:a.oneOfType([a.oneOf(["button","reset","submit"]),a.string]),variant:a.oneOfType([a.oneOf(["contained","outlined","text"]),a.string])});const Xn=fd,pd=({status:e,message:t,onSuccess:n,id:r})=>{const{closePopupById:o}=U.useContext(En),i=()=>{o(r)};return f.jsxs("div",{className:"alert-message",children:[f.jsxs("div",{className:"alert-message-content",children:[e==="failed"&&f.jsx("div",{className:"alert-message-img",children:f.jsx(Ju,{fontSize:"inherit",color:"error"})}),f.jsx("div",{className:"alert-message-text",dangerouslySetInnerHTML:{__html:t||""}})]}),f.jsx("div",{className:"alert-message-button",children:f.jsx(Xn,{id:"alert_submit_button",variant:"contained",color:"secondary",onClick:()=>{i(),e==="success"&&(n==null||n())},children:"Продолжить"})})]})},X0={showErrorAlert(e){},showSuccessAlert(e,t){},popups:[],showNewPopup:null,closePopupById:null},En=U.createContext(X0),Z0=()=>{const[e,t]=U.useState([]);return{popups:e,showNewPopup:s=>{t(l=>[...l,s])},closePopupById:s=>{t(l=>l.filter(c=>c.id!==s))},showErrorAlert:s=>{const l=Math.random().toString();t(c=>[...c,{content:f.jsx(pd,{id:l,status:"failed",message:s}),title:"Уведомление",id:l}])},showSuccessAlert:(s,l)=>{const c=Math.random().toString();t(u=>[...u,{content:f.jsx(pd,{id:c,status:"success",message:s,onSuccess:l}),title:"Уведомление",id:c}])}}},J0=({children:e})=>{const t=Z0();return f.jsx(En.Provider,{value:t,children:e})};Al.create();function Zn({url:e,method:t,data:n,setIsLoadingVal:r,excludedCodes:o,initLoading:i=!1,successMessage:s,onSuccessMessageConfirm:l}){const[c,u]=U.useState(i),{apiAxios:d}=U.useContext(Nt),{showSuccessAlert:p,showErrorAlert:h}=U.useContext(En);return{isLoading:c,setIsLoading:u,Send:async(b,m)=>(u(!0),r==null||r(!0),d()(e,{method:t,data:{...n,...b}}).then(y=>(m==null||m(),s&&p(s,l),y.data.message&&p(y.data.message,l),y.data)).catch(y=>{throw o!=null&&o.includes(y.response.data.code)||h(y.response.data.msg||"Произошла непредвиденная ошибка"),{code:y.response.data.code,msg:y.response.data.msg}}).finally(()=>{u(!1),r==null||r(!1)}))}}const UR="",_a=({children:e})=>f.jsx("div",{className:"cloud",children:f.jsx(Ce.Typography,{children:e})}),ex=()=>{const[e,t]=U.useState(),{phoneNumber:n,cabinetType:r}=U.useContext(Nt),{setIsLoading:o}=U.useContext($n),{Send:i}=Zn({url:"/externalCustomerCabinet/purchase/history",method:"post"}),s=async()=>{if(!n)throw ErrorEvent;o("GetPurchaseHistory",!0);const c=await i({phone:n,cabinetType:r});t(c.activities),o("GetPurchaseHistory",!1)};return U.useEffect(()=>{s()},[n]),{purchaseNotFound:e&&(e==null?void 0:e.length)===0?f.jsx(_a,{children:f.jsx("div",{children:f.jsx("div",{children:"Покупок не было"})})}):null,purchaseHistory:e}};var md=(e=>(e[e.Bonuses=0]="Bonuses",e[e.Purchases=1]="Purchases",e))(md||{});const Jn=e=>{const t=[{id:1,name:"Понедельник"},{id:2,name:"Вторник"},{id:3,name:"Среда"},{id:4,name:"Четверг"},{id:5,name:"Пятница"},{id:6,name:"Суббота"},{id:0,name:"Воскресенье"}],n=[{time:2,name:"Московское время - 1ч"},{time:3,name:"Московское время"},{time:4,name:"Московское время + 1ч"},{time:5,name:"Московское время + 2ч"},{time:6,name:"Московское время + 3ч"},{time:7,name:"Московское время + 4ч"},{time:8,name:"Московское время + 5ч"},{time:9,name:"Московское время + 6ч"},{time:10,name:"Московское время + 7ч"},{time:11,name:"Московское время + 8ч"},{time:12,name:"Московское время + 9ч"}],r=x=>{var T;return(T=t.find(g=>g.id===x))==null?void 0:T.name},o=x=>Date.parse(x)?new Date(x).toLocaleString("en-US"):null,i=(x,T)=>x?new Date(x).toLocaleDateString("ru",T):null,s=x=>x?new Date(x).toLocaleString("ru"):null,l=x=>new Date(x).toLocaleTimeString("ru",{hour:"2-digit",minute:"2-digit"});Date.prototype.addHours=function(x){return this.setTime(this.getTime()+x*60*60*1e3),this};const c=x=>{const T=new RegExp("\\d{2}:\\d{2}:\\d{2}");return new Date(x).addHours(e??0).toISOString().match(T)[0]},u=x=>{if(!x)return null;const T=/^(\d{1,2}).(\d{1,2}).(\d{4})/;let g;try{g=x.match(T)}catch{return null}if(g==null||g.length<4)return null;const O=new Date;return O.setFullYear(Number(g[3]),Number(g[2])-1,Number(g[1])),console.log(O),O};function d(x){return new Date(x.getTime()-x.getTimezoneOffset()*60*1e3)}const p=(x,T=new Date)=>{const O=T.getTime()+x*864e5;return new Date(O)},h=(x,T=new Date)=>{const O=T.getTime()+x*864e5;return new Date(O).toISOString().split("T")[0]},v=()=>new Date().toISOString().split("T")[0],b=x=>{if(!x)return null;const T=/^(\d{4})-(\d{1,2})-(\d{1,2})/,g=x.match(T);return`${g[1]}-${g[2]}-${g[3]}`},m=x=>typeof x=="string"?x:new Date(x.getTime()-x.getTimezoneOffset()*6e4).toISOString(),y=()=>{const x=new Date;return x.getMonth()===0?new Date(x.getFullYear()-1,0,2,1).toISOString().split("T")[0]:new Date(x.getFullYear(),0,2,1).toISOString().split("T")[0]},E=[...Array(12).keys()];return{ConvertUTCDateToLocalDate:d,ParseStringToDate:u,ToIsoWithoutTimeZone:m,ConvertFromStringWithPoints:o,AddDaysToDateToStr:h,ParseDataTimeToRusLocale:s,ParseDataToRusLocale:i,AddDaysToDate:p,GetToday:v,ParseTimeSec:c,GetStartYear:y,DayOfWeeks:t,monthsNum:E,monthsStr:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],UtcOffsets:n,ParseTime:l,DateFromString:b,DayOfWeekById:r}};var hd={exports:{}};/*!
200
+ `))},[Q]);const Pt=w({},r,{centerRipple:i,component:c,disabled:u,disableRipple:d,disableTouchRipple:p,focusRipple:h,tabIndex:B,focusVisible:z}),Re=W0(Pt);return f.jsxs(z0,w({as:rt,className:ve(Re.root,l),ownerState:Pt,onBlur:me,onClick:m,onContextMenu:J,onFocus:be,onKeyDown:Xe,onKeyUp:Ve,onMouseDown:V,onMouseLeave:Z,onMouseUp:ee,onDragLeave:S,onTouchEnd:fe,onTouchMove:te,onTouchStart:ne,ref:Dt,tabIndex:u?-1:B,type:k},Je,L,{children:[s,Q?f.jsx(L0,w({ref:G,center:i},N)):null]}))});process.env.NODE_ENV!=="production"&&(cd.propTypes={action:Jt,centerRipple:a.bool,children:a.node,classes:a.object,className:a.string,component:Ho,disabled:a.bool,disableRipple:a.bool,disableTouchRipple:a.bool,focusRipple:a.bool,focusVisibleClassName:a.string,href:a.any,LinkComponent:a.elementType,onBlur:a.func,onClick:a.func,onContextMenu:a.func,onDragLeave:a.func,onFocus:a.func,onFocusVisible:a.func,onKeyDown:a.func,onKeyUp:a.func,onMouseDown:a.func,onMouseLeave:a.func,onMouseUp:a.func,onTouchEnd:a.func,onTouchMove:a.func,onTouchStart:a.func,sx:a.oneOfType([a.arrayOf(a.oneOfType([a.func,a.object,a.bool])),a.func,a.object]),tabIndex:a.number,TouchRippleProps:a.object,touchRippleRef:a.oneOfType([a.func,a.shape({current:a.shape({pulsate:a.func.isRequired,start:a.func.isRequired,stop:a.func.isRequired})})]),type:a.oneOfType([a.oneOf(["button","reset","submit"]),a.string])});const Mr=cd;function U0(e){return Ee("MuiButton",e)}const $a=Pe("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),ud=C.createContext({});process.env.NODE_ENV!=="production"&&(ud.displayName="ButtonGroupContext");const Y0=ud,H0=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],q0=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:i,classes:s}=e,l={root:["root",i,`${i}${ce(t)}`,`size${ce(o)}`,`${i}Size${ce(o)}`,t==="inherit"&&"colorInherit",n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${ce(o)}`],endIcon:["endIcon",`iconSize${ce(o)}`]},c=Oe(l,U0,s);return w({},s,c)},dd=e=>w({},e.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},e.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},e.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),G0=ae(Mr,{shouldForwardProp:e=>Cn(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${ce(n.color)}`],t[`size${ce(n.size)}`],t[`${n.variant}Size${ce(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var n,r;const o=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],i=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return w({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":w({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Ze(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="text"&&t.color!=="inherit"&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ze(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="outlined"&&t.color!=="inherit"&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ze(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="contained"&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:i,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},t.variant==="contained"&&t.color!=="inherit"&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":w({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${$a.focusVisible}`]:w({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${$a.disabled}`]:w({color:(e.vars||e).palette.action.disabled},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},t.variant==="contained"&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},t.variant==="text"&&{padding:"6px 8px"},t.variant==="text"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main},t.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},t.variant==="outlined"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${Ze(e.palette[t.color].main,.5)}`},t.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(n=(r=e.palette).getContrastText)==null?void 0:n.call(r,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:o,boxShadow:(e.vars||e).shadows[2]},t.variant==="contained"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},t.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},t.size==="small"&&t.variant==="text"&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="text"&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="outlined"&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="outlined"&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="contained"&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="contained"&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${$a.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${$a.disabled}`]:{boxShadow:"none"}}),K0=ae("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${ce(n.size)}`]]}})(({ownerState:e})=>w({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},dd(e))),Q0=ae("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${ce(n.size)}`]]}})(({ownerState:e})=>w({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},dd(e))),fd=C.forwardRef(function(t,n){const r=C.useContext(Y0),o=Ai(r,t),i=Te({props:o,name:"MuiButton"}),{children:s,color:l="primary",component:c="button",className:u,disabled:d=!1,disableElevation:p=!1,disableFocusRipple:h=!1,endIcon:v,focusVisibleClassName:b,fullWidth:m=!1,size:y="medium",startIcon:E,type:P,variant:x="text"}=i,T=se(i,H0),g=w({},i,{color:l,component:c,disabled:d,disableElevation:p,disableFocusRipple:h,fullWidth:m,size:y,type:P,variant:x}),O=q0(g),D=E&&f.jsx(K0,{className:O.startIcon,ownerState:g,children:E}),M=v&&f.jsx(Q0,{className:O.endIcon,ownerState:g,children:v});return f.jsxs(G0,w({ownerState:g,className:ve(r.className,O.root,u),component:c,disabled:d,focusRipple:!h,focusVisibleClassName:ve(O.focusVisible,b),ref:n,type:P},T,{classes:O,children:[D,s,M]}))});process.env.NODE_ENV!=="production"&&(fd.propTypes={children:a.node,classes:a.object,className:a.string,color:a.oneOfType([a.oneOf(["inherit","primary","secondary","success","error","info","warning"]),a.string]),component:a.elementType,disabled:a.bool,disableElevation:a.bool,disableFocusRipple:a.bool,disableRipple:a.bool,endIcon:a.node,focusVisibleClassName:a.string,fullWidth:a.bool,href:a.string,size:a.oneOfType([a.oneOf(["small","medium","large"]),a.string]),startIcon:a.node,sx:a.oneOfType([a.arrayOf(a.oneOfType([a.func,a.object,a.bool])),a.func,a.object]),type:a.oneOfType([a.oneOf(["button","reset","submit"]),a.string]),variant:a.oneOfType([a.oneOf(["contained","outlined","text"]),a.string])});const Xn=fd,pd=({status:e,message:t,onSuccess:n,id:r})=>{const{closePopupById:o}=U.useContext(En),i=()=>{o(r)};return f.jsxs("div",{className:"alert-message",children:[f.jsxs("div",{className:"alert-message-content",children:[e==="failed"&&f.jsx("div",{className:"alert-message-img",children:f.jsx(Ju,{fontSize:"inherit",color:"error"})}),f.jsx("div",{className:"alert-message-text",dangerouslySetInnerHTML:{__html:t||""}})]}),f.jsx("div",{className:"alert-message-button",children:f.jsx(Xn,{id:"alert_submit_button",variant:"contained",color:"secondary",onClick:()=>{i(),e==="success"&&(n==null||n())},children:"Продолжить"})})]})},X0={showErrorAlert(e){},showSuccessAlert(e,t){},popups:[],showNewPopup:null,closePopupById:null},En=U.createContext(X0),Z0=()=>{const[e,t]=U.useState([]);return{popups:e,showNewPopup:s=>{t(l=>[...l,s])},closePopupById:s=>{t(l=>l.filter(c=>c.id!==s))},showErrorAlert:s=>{const l=Math.random().toString();t(c=>[...c,{content:f.jsx(pd,{id:l,status:"failed",message:s}),title:"Уведомление",id:l}])},showSuccessAlert:(s,l)=>{const c=Math.random().toString();t(u=>[...u,{content:f.jsx(pd,{id:c,status:"success",message:s,onSuccess:l}),title:"Уведомление",id:c}])}}},J0=({children:e})=>{const t=Z0();return f.jsx(En.Provider,{value:t,children:e})};Al.create();function Zn({url:e,method:t,data:n,setIsLoadingVal:r,excludedCodes:o,initLoading:i=!1,successMessage:s,onSuccessMessageConfirm:l}){const[c,u]=U.useState(i),{apiAxios:d}=U.useContext(Nt),{showSuccessAlert:p,showErrorAlert:h}=U.useContext(En);return{isLoading:c,setIsLoading:u,Send:async(b,m)=>(u(!0),r==null||r(!0),d()(e,{method:t,data:{...n,...b}}).then(y=>(m==null||m(),s&&p(s,l),y.data.message&&p(y.data.message,l),y.data)).catch(y=>{throw o!=null&&o.includes(y.response.data.code)||h(y.response.data.msg||"Произошла непредвиденная ошибка"),{code:y.response.data.code,msg:y.response.data.msg}}).finally(()=>{u(!1),r==null||r(!1)}))}}const UR="",_a=({children:e})=>f.jsx("div",{className:"cloud",children:f.jsx(Ce.Typography,{children:e})}),ex=()=>{const[e,t]=U.useState(),{phoneNumber:n,cabinetType:r}=U.useContext(Nt),{setIsLoading:o}=U.useContext($n),{Send:i}=Zn({url:"/externalCustomerCabinet/purchase/history",method:"post"}),s=async()=>{if(!n)throw ErrorEvent;o("GetPurchaseHistory",!0);try{const c=await i({phone:n,cabinetType:r});t(c.activities)}catch{}finally{o("GetPurchaseHistory",!1)}};return U.useEffect(()=>{s()},[n]),{purchaseNotFound:e&&(e==null?void 0:e.length)===0?f.jsx(_a,{children:f.jsx("div",{children:f.jsx("div",{children:"Покупок не было"})})}):null,purchaseHistory:e}};var md=(e=>(e[e.Bonuses=0]="Bonuses",e[e.Purchases=1]="Purchases",e))(md||{});const Jn=e=>{const t=[{id:1,name:"Понедельник"},{id:2,name:"Вторник"},{id:3,name:"Среда"},{id:4,name:"Четверг"},{id:5,name:"Пятница"},{id:6,name:"Суббота"},{id:0,name:"Воскресенье"}],n=[{time:2,name:"Московское время - 1ч"},{time:3,name:"Московское время"},{time:4,name:"Московское время + 1ч"},{time:5,name:"Московское время + 2ч"},{time:6,name:"Московское время + 3ч"},{time:7,name:"Московское время + 4ч"},{time:8,name:"Московское время + 5ч"},{time:9,name:"Московское время + 6ч"},{time:10,name:"Московское время + 7ч"},{time:11,name:"Московское время + 8ч"},{time:12,name:"Московское время + 9ч"}],r=x=>{var T;return(T=t.find(g=>g.id===x))==null?void 0:T.name},o=x=>Date.parse(x)?new Date(x).toLocaleString("en-US"):null,i=(x,T)=>x?new Date(x).toLocaleDateString("ru",T):null,s=x=>x?new Date(x).toLocaleString("ru"):null,l=x=>new Date(x).toLocaleTimeString("ru",{hour:"2-digit",minute:"2-digit"});Date.prototype.addHours=function(x){return this.setTime(this.getTime()+x*60*60*1e3),this};const c=x=>{const T=new RegExp("\\d{2}:\\d{2}:\\d{2}");return new Date(x).addHours(e??0).toISOString().match(T)[0]},u=x=>{if(!x)return null;const T=/^(\d{1,2}).(\d{1,2}).(\d{4})/;let g;try{g=x.match(T)}catch{return null}if(g==null||g.length<4)return null;const O=new Date;return O.setFullYear(Number(g[3]),Number(g[2])-1,Number(g[1])),console.log(O),O};function d(x){return new Date(x.getTime()-x.getTimezoneOffset()*60*1e3)}const p=(x,T=new Date)=>{const O=T.getTime()+x*864e5;return new Date(O)},h=(x,T=new Date)=>{const O=T.getTime()+x*864e5;return new Date(O).toISOString().split("T")[0]},v=()=>new Date().toISOString().split("T")[0],b=x=>{if(!x)return null;const T=/^(\d{4})-(\d{1,2})-(\d{1,2})/,g=x.match(T);return`${g[1]}-${g[2]}-${g[3]}`},m=x=>typeof x=="string"?x:new Date(x.getTime()-x.getTimezoneOffset()*6e4).toISOString(),y=()=>{const x=new Date;return x.getMonth()===0?new Date(x.getFullYear()-1,0,2,1).toISOString().split("T")[0]:new Date(x.getFullYear(),0,2,1).toISOString().split("T")[0]},E=[...Array(12).keys()];return{ConvertUTCDateToLocalDate:d,ParseStringToDate:u,ToIsoWithoutTimeZone:m,ConvertFromStringWithPoints:o,AddDaysToDateToStr:h,ParseDataTimeToRusLocale:s,ParseDataToRusLocale:i,AddDaysToDate:p,GetToday:v,ParseTimeSec:c,GetStartYear:y,DayOfWeeks:t,monthsNum:E,monthsStr:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],UtcOffsets:n,ParseTime:l,DateFromString:b,DayOfWeekById:r}};var hd={exports:{}};/*!
201
201
  Copyright (c) 2018 Jed Watson.
202
202
  Licensed under the MIT License (MIT), see
203
203
  http://jedwatson.github.io/classnames
@@ -1 +1 @@
1
- {"version":3,"file":"UsePurchaseHistory.d.ts","sourceRoot":"","sources":["../../../../src/components/PurchaseHistory/usePurchaseHistory/UsePurchaseHistory.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAC;AAOnC,QAAA,MAAM,kBAAkB;;;CAgDvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"UsePurchaseHistory.d.ts","sourceRoot":"","sources":["../../../../src/components/PurchaseHistory/usePurchaseHistory/UsePurchaseHistory.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAC;AAOnC,QAAA,MAAM,kBAAkB;;;CA0DvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bonuspluscomponents",
3
3
  "private": false,
4
- "version": "0.0.145",
4
+ "version": "0.0.147",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",