1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6601],{83321:function(e,t,o){"use strict";o.d(t,{Z:function(){return C}});var n=o(63366),a=o(87462),r=o(67294),i=o(90512),s=o(47925),l=o(94780),c=o(41796),d=o(90948),p=o(71657),u=o(49990),h=o(98216),m=o(1588),v=o(34867);function getButtonUtilityClass(e){return(0,v.Z)("MuiButton",e)}let g=(0,m.Z)("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"]),b=r.createContext({});var y=o(85893);let x=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],useUtilityClasses=e=>{let{color:t,disableElevation:o,fullWidth:n,size:r,variant:i,classes:s}=e,c={root:["root",i,`${i}${(0,h.Z)(t)}`,`size${(0,h.Z)(r)}`,`${i}Size${(0,h.Z)(r)}`,"inherit"===t&&"colorInherit",o&&"disableElevation",n&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${(0,h.Z)(r)}`],endIcon:["endIcon",`iconSize${(0,h.Z)(r)}`]},d=(0,l.Z)(c,getButtonUtilityClass,s);return(0,a.Z)({},s,d)},commonIconStyles=e=>(0,a.Z)({},"small"===e.size&&{"& > *:nth-of-type(1)":{fontSize:18}},"medium"===e.size&&{"& > *:nth-of-type(1)":{fontSize:20}},"large"===e.size&&{"& > *:nth-of-type(1)":{fontSize:22}}),f=(0,d.ZP)(u.Z,{shouldForwardProp:e=>(0,d.FO)(e)||"classes"===e,name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:o}=e;return[t.root,t[o.variant],t[`${o.variant}${(0,h.Z)(o.color)}`],t[`size${(0,h.Z)(o.size)}`],t[`${o.variant}Size${(0,h.Z)(o.size)}`],"inherit"===o.color&&t.colorInherit,o.disableElevation&&t.disableElevation,o.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var o,n;let r="light"===e.palette.mode?e.palette.grey[300]:e.palette.grey[800],i="light"===e.palette.mode?e.palette.grey.A100:e.palette.grey[700];return(0,a.Z)({},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":(0,a.Z)({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,c.Fq)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"text"===t.variant&&"inherit"!==t.color&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,c.Fq)(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"outlined"===t.variant&&"inherit"!==t.color&&{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})`:(0,c.Fq)(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"contained"===t.variant&&{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]}},"contained"===t.variant&&"inherit"!==t.color&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":(0,a.Z)({},"contained"===t.variant&&{boxShadow:(e.vars||e).shadows[8]}
1),[`&.${g.focusVisible}`]:(0,a.Z)({},"contained"===t.variant&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${g.disabled}`]:(0,a.Z)({color:(e.vars||e).palette.action.disabled},"outlined"===t.variant&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"contained"===t.variant&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},"text"===t.variant&&{padding:"6px 8px"},"text"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].main},"outlined"===t.variant&&{padding:"5px 15px",border:"1px solid currentColor"},"outlined"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${(0,c.Fq)(e.palette[t.color].main,.5)}`},"contained"===t.variant&&{color:e.vars?e.vars.palette.text.primary:null==(o=(n=e.palette).getContrastText)?void 0:o.call(n,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:r,boxShadow:(e.vars||e).shadows[2]},"contained"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},"inherit"===t.color&&{color:"inherit",borderColor:"currentColor"},"small"===t.size&&"text"===t.variant&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"text"===t.variant&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},"small"===t.size&&"outlined"===t.variant&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"outlined"===t.variant&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},"small"===t.size&&"contained"===t.variant&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"contained"===t.variant&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${g.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${g.disabled}`]:{boxShadow:"none"}}),S=(0,d.ZP)("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{let{ownerState:o}=e;return[t.startIcon,t[`iconSize${(0,h.Z)(o.size)}`]]}})(({ownerState:e})=>(0,a.Z)({display:"inherit",marginRight:8,marginLeft:-4},"small"===e.size&&{marginLeft:-2},commonIconStyles(e))),w=(0,d.ZP)("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{let{ownerState:o}=e;return[t.endIcon,t[`iconSize${(0,h.Z)(o.size)}`]]}})(({ownerState:e})=>(0,a.Z)({display:"inherit",marginRight:-4,marginLeft:8},"small"===e.size&&{marginRight:-2},commonIconStyles(e))),z=r.forwardRef(function(e,t){let o=r.useContext(b),l=(0,s.Z)(o,e),c=(0,p.Z)({props:l,name:"MuiButton"}),{children:d,color:u="primary",component:h="button",className:m,disabled:v=!1,disableElevation:g=!1,disableFocusRipple:z=!1,endIcon:C,focusVisibleClassName:Z,fullWidth:k=!1,size:I="medium",startIcon:P,type:R,variant:_="text"}=c,j=(0,n.Z)(c,x),$=(0,a.Z)({},c,{color:u,component:h,disabled:v,disableElevation:g,disableFocusRipple:z,fullWidth:k,size:I,type:R,variant:_}),E=useUtilityClasses($),T=P&&(0,y.jsx)(S,{className:E.startIcon,ownerState:$,children:P}),N=C&&(0,y.jsx)(w,{className:E.endIcon,ownerState:$,children:C});return(0,y.jsxs)(f,(0,a.Z)({ownerState:$,className:(0,i.Z)(o.className,E.root,m),component:h,disabled:v,focusRipple:!z,focusVisibleClassName:(0,i.Z)(E.focusVisible,Z),ref:t,type:R},j,{classes:E,children:[T,d,N]}))});var C=z},38841:function(e,t,o){(window.__NEXT_P=window.__NEXT_P||[]).push(["/delivery-points",function(){return o(40457)}])},27866:function(e,t,o){"use strict";o.d(t,{p:function(){return MyDropzone}});var n=o(85893),a=o(15861),r=o(67294),i=o(68901),s=o(96540),l=o(25675),c=o.n(l);function MyDropzone(e){let{className:t,onChange:o}=e,l=(0,r.useCallback)(e=>{o(e)},[o]),{getRootProps:d,getInputProps:p}=(0,i.uI)({onDrop:l});return(0,n.jsxs)("div",{...d(),className:"".concat(t," flex cursor-pointer items-center justify-center border border-dashed border-black p-20"),children:[(0,n.jsx)("input",{...p()}),(0,n.jsxs)("div",{className:"flex flex-col items-center",children:[(0,n.jsx)(c(),{src:"/file-icon.svg",width:40,height:50,alt:"file icon",className:"mb-5"}),(0,n.jsxs)(a.Z,{variant:"subtitle1",sx:{textTransform:"uppercase",display:"flex",alignItems:"center",fontWeight:"bold"},children:[(0,n.jsx)(s.Z,{className:"mr-2"}),"ÐагÑÑзиÑÑ Ñайл"]})]})]})}},24812:function(e,t,o){"use strict";o.d(t,{b:function(){return a}});var n=o(90948);let a=(0,n.ZP)("input")({clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:1,overflow:"hidden",position:"absolute",bottom:0,left:0,whiteSpace:"nowrap",width:1})},4813:function(e,t,o){"use strict";var n=o(85893),a=o(83321);t.Z=e=>
1{let{children:t,onClick:o,variant:r="DARK",small:i,className:s="",type:l="button",disabled:c,href:d,component:p=d?"a":"button"}=e,u="enabled:cursor-pointer enabled:hover:bg-red ".concat("button"!==p?"hover:bg-red":""," rounded-lg ").concat(i?"h-9 px-3 py-2.5":"h-12 px-5 py-4");return(0,n.jsx)(a.Z,{component:p,href:d,type:l,disabled:c,onClick:o,className:"".concat(s," ").concat("disabled:bg-grey2 disabled:border-none disabled:text-white"," ").concat(u," ").concat({DARK:"bg-grey4 text-white border-none",LIGHT:"bg-white text-grey4 enabled:hover:text-white ".concat(i?"":"border-solid border border-grey4 hover:border-red"),GRAY:"bg-grey2 border-none text-grey4 enabled:hover:text-white"}[r]),children:t})}},21321:function(e,t,o){"use strict";var n=o(85893),a=o(87357),r=o(98456);t.Z=e=>{let{color:t="#E51C2F",size:o=40}=e;return(0,n.jsx)(a.Z,{sx:{display:"flex",width:"100%",height:"100%",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(r.Z,{sx:{color:t},size:o})})}},40457:function(e,t,o){"use strict";o.r(t);var n=o(85893),a=o(69481),r=o(28119),i=o(26303),s=o(27866),l=o(84105),c=o(5917),d=o(21321),p=o(68854);o(67294);var u=o(4813),h=o(24812);let DeliveryPointsPage=()=>{let{data:e=0,isLoading:t,refetch:o}=c.h.deliveryPoints.getCount.useQuery(),{mutate:r}=c.h.deliveryPoints.download.useMutation({onSuccess:e=>{(0,p.q)(e,[{key:"id",name:"ID"},{key:"name",name:"Ðаименование"},{key:"address",name:"ÐдÑеÑ"},{key:"region",name:"ÐблаÑÑÑ"},{key:"locality",name:"ÐаÑелÑннÑй пÑнкÑ"},{key:"direction",name:"Ðак добÑаÑÑÑÑ"}],"ТоÑки доÑÑавки CSE")}}),{mutate:i,isLoading:m}=c.h.deliveryPoints.upload.useMutation({onSuccess:async()=>{await o()}}),handleChange=async e=>{let t=e?e[0]:null;if(t)try{let e=await t.arrayBuffer(),o=l.ij(e,{type:"buffer"}),n=o.SheetNames[0],a=o.Sheets[n],r=l.P6.decode_range(a["!ref"]);r.s.r=3,r.s.c=54;let s=l.P6.encode_range(r),c=l.P6.sheet_to_json(a,{header:["direction"],range:s}),d=l.P6.decode_range(a["!ref"]);d.s.r=3,d.s.c=0,d.e.c=6;let p=l.P6.encode_range(d),u=l.P6.sheet_to_json(a,{header:["name","region","skip1","locality","address","skip2","id"],range:p}).map((e,t)=>(delete e.skip1,delete e.skip2,{...e,...c[t]})).filter(e=>!!e.address);i(u)}catch(e){console.error("Error parsing the file:",e)}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.Z,{title:"ТоÑки доÑÑавки"}),(0,n.jsxs)("div",{className:"p-5",children:[(m||t)&&(0,n.jsx)(d.Z,{}),!t&&!m&&!e&&(0,n.jsx)(s.p,{onChange:handleChange}),!m&&!t&&e>0&&(0,n.jsxs)("div",{className:"space-x-2 flex justify-end",children:[(0,n.jsx)(u.Z,{small:!0,variant:"LIGHT",onClick:()=>{r()},children:"ÑкаÑаÑÑ"}),(0,n.jsxs)(u.Z,{small:!0,component:"label",children:["замениÑÑ",(0,n.jsx)(h.b,{onChange:async e=>{let t=e.target.files;await handleChange(t)},type:"file"})]})]})]})]})};DeliveryPointsPage.getLayout=e=>(0,n.jsx)(r.Z,{children:e}),DeliveryPointsPage.auth={roles:[i.vX.ADMIN,i.vX.MANAGER]},t.default=DeliveryPointsPage},68854:function(e,t,o){"use strict";o.d(t,{q:function(){return createAndDownloadXLSX}});var n=o(84105);function createAndDownloadXLSX(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"output",a=function(e,t){let o=[t.map(e=>{var t;return null!==(t=e.name)&&void 0!==t?t:e.key}),...e.map(e=>[...t.map(t=>{var o;return null!==(o=e[t.key])&&void 0!==o?o:""})])],a=n.P6.aoa_to_sheet(o);a["!cols"]=[...t.map(e=>{var t;return{wch:null!==(t=e.width)&&void 0!==t?t:30}})];let r=n.P6.book_new();return n.P6.book_append_sheet(r,a,"Sheet1"),n.cW(r,{type:"buffer",bookType:"xlsx"})}(e,t),r=new Blob([a],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),i=window.URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download="".concat(o,".xlsx"),document.body.appendChild(s),s.click(),window.URL.revokeObjectURL(i),document.body.removeChild(s)}},92703:function(e,t,o){"use strict";var n=o(50414);function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction,e.exports=function(){function shim(e,t,o,a,r,i){if(i!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function getShim(){return shim}shim.isRequired=shim;var e={array:shim,bigint:shim,bool:shim,func:shim,number:shim,object:shim,string:shim,symbol
1:shim,any:shim,arrayOf:getShim,element:shim,elementType:shim,instanceOf:getShim,node:shim,objectOf:getShim,oneOf:getShim,oneOfType:getShim,shape:getShim,exact:getShim,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return e.PropTypes=e,e}},45697:function(e,t,o){e.exports=o(92703)()},50414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},20067:function(){},72061:function(){}},function(e){e.O(0,[2251,4241,4396,2844,9774,2888,179],function(){return e(e.s=38841)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.