1var De=Object.defineProperty,Te=Object.defineProperties;var Re=Object.getOwnPropertyDescriptors;var U=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable;var ne=(e,s,n)=>s in e?De(e,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[s]=n,x=(e,s)=>{for(var n in s||(s={}))oe.call(s,n)&&ne(e,n,s[n]);if(U)for(var n of U(s))ae.call(s,n)&&ne(e,n,s[n]);return e},v=(e,s)=>Te(e,Re(s));var ie=(e,s)=>{var n={};for(var o in e)oe.call(e,o)&&s.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&U)for(var o of U(e))s.indexOf(o)<0&&ae.call(e,o)&&(n[o]=e[o]);return n};import{j as t,h5 as ce,F as N,h6 as Le,bF as xe,e as W,a4 as $e,r as m,q as me,L as ve,c as y,h7 as ge,u as Fe,v as fe,Z as Pe,h8 as je,h9 as Me,fa as Ue,e2 as Be,a9 as He,cL as ze,ch as re,ha as Oe,hb as We,n as Ve,p as Ye,H as qe,M as Xe,c$ as Qe,hc as Ge,R as Ae,K as Y,hd as Ze,i as Je,a as Ke,o as et,b as tt,d as st}from"../chunks/chunk-C4bf_jzg.js";import{i as nt}from"../chunks/chunk-B1cU7beE.js";import{D as ot}from"../chunks/chunk-rGS511_b.js";import{i as at}from"../chunks/chunk-BJ70jo7S.js";import{S as it}from"../chunks/chunk-DiB-GtaW.js";import{S as ct}from"../chunks/chunk-rYhO_ml3.js";import{P as rt}from"../chunks/chunk-RGz99hBs.js";import{E as be,a as S}from"../chunks/chunk-BHVG-mKS.js";import{p as lt}from"../chunks/chunk-C-g1dyVi.js";import{I as dt}from"../chunks/chunk-BShfrxiG.js";import{P as Se}from"../chunks/chunk-CUCIZvYe.js";import{X as _t,r as pt}from"../chunks/chunk-DYCBmGBP.js";import{M as ut}from"../chunks/chunk-CBRsvm1v.js";import"../chunks/chunk-9OGX4MUS.js";import"../chunks/chunk-DiB4ngMM.js";import"../chunks/chunk-5BREqnsv.js";import"../chunks/chunk-C-X8nvVE.js";import"../chunks/chunk-SsC2XoNI.js";import"../chunks/chunk-wUeYqOkQ.js";const Ne=e=>e.invoice,$=e=>Ne(e).get,ee=e=>$(e).list,ht=e=>ee(e).length,te=e=>$(e).loading,se=e=>$(e).error,xt=e=>$(e).filteredList,mt=e=>$(e).isFiltered;var j=(e=>(e.DATE="DATE",e.SUM="SUM",e.NAME="NAME",e.IS_RECEIVED="IS_RECEIVED",e))(j||{}),we=(e=>(e.ALL="ALL",e.YES="YES",e.NO="NO",e.REORDER="REORDER",e))(we||{});const Ie=[{title:"ÐÐТРСÐÐÐÐÐÐЯ",name:j.DATE,type:"date",placeholder:""},{title:"СУÐÐÐ KZT",name:j.SUM,type:"text",placeholder:"УкажиÑе ÑÑммÑ"},{title:"â ÐÐÐÐÐСÐ",name:j.NAME,type:"text",isSortDisabled:!0,placeholder:"УкажиÑе â"},{title:"ÐÐÐУЧÐÐ?",name:j.IS_RECEIVED,type:"select",options:[{label:"ÐСÐ",value:"ALL"},{label:"ÐÐ",value:"YES"},{label:"ÐÐТ",value:"NO"},{label:"ÐÐÐ ÐÐÐÐÐÐ",value:"REORDER"}]}],vt=[10,20,50],gt=10,ft="_headersList_1b09c_1",jt="_headerItem_1b09c_8",le={headersList:ft,headerItem:jt},At=()=>t.jsx("div",{className:le.headersList,children:Ie.map((e,s)=>t.jsx("div",{className:le.headerItem,children:e.title},s))}),bt="_sortIcon_vxe6y_1",St={sortIcon:bt},Nt=n=>{var o=n,{children:e}=o,s=ie(o,["children"]);return ce.ValueContainer&&t.jsxs(ce.ValueContainer,v(x({},s),{children:[t.jsx(N,{icon:Le,className:St.sortIcon}),e]}))};var R=(e=>(e.ASC="ASC",e.DESC="DESC",e))(R||{});const wt={control:e=>v(x({},e),{background:"#fff",border:"none",boxShadow:"none",cursor:"pointer",minHeight:"24px",height:"24px",width:"24px"}),valueContainer:e=>x({},e),input:e=>v(x({},e),{margin:"0px"}),indicatorSeparator:e=>v(x({},e),{display:"none"}),indicatorsContainer:e=>x({},e),option:(e,s)=>v(x({},e),{color:s.isSelected?"#2E6880":"#1A1C1F",backgroundColor:s.isSelected?"#D7E4EA":"#fff",fontSize:"14px",fontWeight:s.isSelected?700:400,lineHeight:"20px",cursor:"pointer"}),menu:e=>v(x({},e),{width:"150px",borderRadius:"4px",boxShadow:"0px 2px 0px 0px rgba(16, 20, 45, 0.04), 0px 14px 12px 0px rgba(16, 20, 45, 0.06), 0px 31px 41px 0px rgba(16, 20, 45, 0.11)",backgroundColor:"#f2f2f2"})},It=[{label:"Ðо возÑаÑÑаниÑ",value:R.ASC},{label:"Ðо ÑбÑваниÑ",value:R.DESC}],ye=({columnName:e,selectedValue:s,onChange:n})=>{const o=i=>{i&&n(e,i.value)},a=s?{label:e,value:s}:null;return t.jsx(xe,{placeholder:!0,components:{ValueContainer:Nt,IndicatorSeparator:()=>null,DropdownIndicator:()=>null,SingleValue:()=>null},options:It,isSearchable:!1,styles:wt,value:a,onChange:o})},yt="_inputWrapper_pwnd4_1",Ct="_filterInput_pwnd4_14",Et="_placeholder_pwnd4_36",kt="_withoutSort_pwnd4_45",Dt="_sort_pwnd4_49",Tt="_selectWrapper_pwnd4_55",E={inputWrapper:yt,filterInput:Ct,placeholder:Et,withoutSort:kt,sort:Dt,selectWrapper:Tt},Rt=({name:e,changeFilterHandler:s,filterValue:n,placeholder:o,changeSortHandler:a,sort:i})=>{const c=d=>{const{value:r}=d.target,l=new Date(r);if(Number.isNaN(l.valueOf())){s(e,"");return}s(e,String(l.getTime()))};return t.jsxs("div",{className:E.inputWrapper,children:[t.jsx("input",{type:"date",className:W(E.filterInput,{[E.placeholder]:!n}),placeholder:n?void 0:o,onChange:c}
1),t.jsx(ye,{columnName:e,onChange:a,selectedValue:e===i.name?i.type:null})]})},Lt="_button_11zdy_1",$t="_button__icon_11zdy_16",de={button:Lt,button__icon:$t},Ft=({clickHandler:e})=>t.jsx("button",{className:de.button,onClick:e,children:t.jsx(N,{icon:$e,className:de.button__icon,size:"sm"})}),Pt=({changeFilterHandler:e,isSortDisabled:s,filterValue:n,placeholder:o,changeSortHandler:a,sort:i,name:c})=>{const d=m.useRef(n),r=d.current.length>0,l=p=>{const{value:_}=p.target;d.current=_,e(c,_)},h=()=>{d.current="",e(c,"")};return t.jsxs("div",{className:E.inputWrapper,children:[t.jsx("input",{className:W(E.filterInput,{[E.withoutSort]:s}),onChange:l,value:d.current,placeholder:o}),r&&t.jsx(Ft,{clickHandler:h}),!s&&t.jsx(ye,{columnName:c,onChange:a,selectedValue:c===i.name?i.type:null})]})},Mt={control:e=>v(x({},e),{background:"#fff",borderColor:"#9e9e9e",minHeight:"32px",height:"32px",color:"#1A1C1F",fontSize:"14px",fontWeight:400,lineHeight:"20px"}),valueContainer:e=>v(x({},e),{height:"30px",padding:"0 6px"}),input:e=>v(x({},e),{margin:"0px"}),indicatorSeparator:e=>v(x({},e),{display:"none"}),indicatorsContainer:e=>v(x({},e),{height:"30px"}),option:(e,s)=>v(x({},e),{color:s.isSelected?"#2E6880":"#1A1C1F",backgroundColor:s.isSelected?"#D7E4EA":"#fff",fontSize:"14px",fontWeight:s.isSelected?700:400,lineHeight:"20px",cursor:"pointer"}),menu:e=>v(x({},e),{borderRadius:"4px",boxShadow:"0px 2px 0px 0px rgba(16, 20, 45, 0.04), 0px 14px 12px 0px rgba(16, 20, 45, 0.06), 0px 31px 41px 0px rgba(16, 20, 45, 0.11)",backgroundColor:"#f2f2f2"})},Ut=({name:e,type:s,options:n,isSortDisabled:o,changeSortHandler:a,filterValue:i,changeFilterHandler:c,placeholder:d,sort:r})=>{const l=h=>{c(e,h.value)};return t.jsxs(t.Fragment,{children:[s==="text"&&t.jsx(Pt,{sort:r,name:e,filterValue:i,isSortDisabled:o,placeholder:d,changeFilterHandler:c,changeSortHandler:a}),s==="select"&&t.jsx(xe,{options:n,className:E.selectWrapper,defaultValue:n?n[0]:null,styles:Mt,onChange:l}),s==="date"&&t.jsx(Rt,{name:e,changeFilterHandler:c,filterValue:i,placeholder:d,changeSortHandler:a,sort:r})]})},Bt="_row_1irfg_1",Ht={row:Bt},zt=({sort:e,changeSortHandler:s,filter:n,changeFilterHandler:o})=>{const a=i=>{var d;const c=n.find(r=>r.name===i);return(d=c==null?void 0:c.value)!=null?d:""};return t.jsx("div",{className:Ht.row,children:Ie.map((i,c)=>t.jsx(Ut,v(x({},i),{sort:e,changeSortHandler:s,filterValue:a(i.name),changeFilterHandler:o}),c))})},Ot="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGKSURBVHgB3ZVPTsJAFMa/14ruDDewnkBuoEeAwMYoBjYSdnoC4ATKysCmRCBurOgNOEJvQLkBS6Jpn9NKoX9oK7Qb/W06nZm8783Mm2+Avw7FDaqqmv/MHdfErHMCFcBQVkM6ExuWiY/mTXmwl0Bv+FokklTRzCMGBgzL4k6UkLQ1+Eh7EMEnScFXGSqyRGpvrLUixgPBx5MWMbexBwx+bFyX7yMF+s9aDSIbpIDZKjWqlXf3379FErWQEvvc7OIICTjZY10lafipvKCAWFwRGcGgi7CAJJ0gI0TQM7d94OkvBCeaMp02L0sGYnh6mSiyybNAt+IRi2G5RCIJczwr4LmoAd82ybmjWX/0hp0h6G5zswKLdWSExZiHBFiiKTJCGGH4oh1+SQPxWSAlTDCaVxvjWwvU66WFuOZ1pMQCd7z/vipyPITRxZ4wmx1v9jZb34PeUGsT7ehLbHVvq5W7YHfkg9Mf294kRDjRn5yt9TrorwR8QkxFR4hcC3DujC78f2oXh31++Ld8A9U0ifcU5UDIAAAAAElFTkSuQmCC",Wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAH0SURBVHgB3ZU9TxtBEIbf2fNFiZLi0kKkOL8gViJHSLEUt4TGKdOZMgogaNBRgbuDxuZLlOYnQIOhM5KREF9ySWdTYFp3gJBvmbV0Z+zz7QlwA4918n6M590dz8wBLx3SbSam85Z4Z2SFa/wikgleirc3JKoSVHeptX3mTG0+SeD77GqGDBRJkgU99RbcXJiQ0W8xObeWJ6ICgd4iGkuAMkOpMTQqO/uRAj/s9Xn+svFIOBTpoZ+/rcbBzl7Peodv9krWgCjiGbiu/HO6NLnlzcXDTXY+r/uxAeOLenQ2gqiokiMgoE4PL0tCOHT+1dWjs+GYWLE3ZjYgEIPIYFAQ0gEBSfiMAUGEr9445q9KJHoNVbz7heTYmfCTY8TeiLfQqvWYxL2BgIYb/kQRZePfQEJecGF1hcmEWUvaa/7cOzmvSa1XbiXeUHQGVMWAYPWLgIBLKGNAcJvxC83/sxILecu8NWssH9rc7nDXLjIVulDn3GWPnP9+Mfo3qC7MNF3IcWhQjnXOFRye3MN5V7O7qpTOh1OjH/kcI3gCnCi5E2eiECqgaFRKu59Soxw6SuNR3uXyyeJkoAv3fR9cVkrl4dSYSltVfPoXDqFJrvh7vNR98s52BEl7PctXzxBknM3bLUDVDFRac+Z9uH6/WS6MN/FquQckJ5C0fp229QAAAABJRU5ErkJggg==",Ce=e=>Ne(e).details,Ee=e=>Ce(e).list,Vt=e=>Ce(e).error,Yt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGGSURBVHgB7VRRUsIwEN0NHWdQnOknWrTxBhzBnkBvIN4AT8BwAo8gR8ATqDfgBgYtDJ/5wfGHrJtCSwY
1U2qIfOr6ZpplN9r3NZjcAvx2Yd2O9LiVW6MHOaYbRZKJUHr9cAik5IshEgEDlFdkqsEqeIq+IKEA+cJYG1mbX7J7SAi75m4dRat+bzzOR0gKcQMU5fLLkWimdmhXPExGke4EwhO/CcSMk+xXxEfDD+BfYCq/IZq6oASH4RXwyAd+XfvXAtNAhMETqfVrpaz0v0anTC1/5cIdrmol+2uGZwH7NNgw2XQLBntUaXWkNCbHbC4nPId0B4aVrQ/v4eHTBY7Q49RyL+tZI5iaLRogOEEgDs2gSx48uUb0hzwVwULYZjekuoxK3fAp/HA9xXYAfsPFoeJbaghPZIuIoNwARr0evqpfxBKFi1jAV2HjJ1jFonDZpJQ0Oe88l/wxbq2gUv7T514aS8JbB8O0DyKMgfIZdwOnhUa8JsEIXgTo8k7ADbKDGYBf+DD4AqkOkaflbudYAAAAASUVORK5CYII=",qt="_button_jrtug_1",Xt="_downloadIcon_jrtug_30",Qt="_button__title_jrtug_35",q={button:qt,downloadIcon:Xt,button__title:Qt},Gt=({onClick:e,disabled:s})=>t.jsxs("button",{className:q.button,onClick:e,disabled:s,children:[t.jsx("img",{src:Yt,alt:"download",className:q.downloadIcon}),t.jsx("span",{className:q.button__title,children:"ÐкÑпоÑÑ Ð² Excel"})]}),Zt=[{field:"position_id",title:"Ð ÐФÐÐ ÐÐС"},{field:"comment",title:"ÐÐÐÐÐÐТ"},{field:"make",title:"ÐÐ ÐÐÐÐÐÐÐТÐÐЬ"},{field:"article",title:"ÐÐÐÐÐ ÐÐТÐÐÐ"},{field:"price",title:"ЦÐÐÐ KZT"},{field:"name",title:"ÐÐÐÐÐÐÐÐÐÐÐÐ"},{field:"quantity",title:"ÐÐÐ-ÐÐ"},{field:"cost",title:"СТÐÐÐÐСТЬ KZT"},{field:"weight",title:"ÐÐС кг"}],Jt="_excelExport__wrapper_1luwz_1",Kt={excelExport__wrapper:Jt},es=({invoiceName:e,details:s})=>{const[n,o]=m.useState(!1),a=m.useRef(null),i=()=>{var d;o(!0),a!=null&&a.current&&((d=a==null?void 0:a.current)==null||d.save())},c=s.map(d=>v(x({},d),{cost:+d.price*+d.quantity}));return t.jsxs("div",{className:Kt.excelExport__wrapper,children:[t.jsx(Gt,{onClick:i,disabled:n}),t.jsx(be,{ref:a,data:c,fileName:e+".xlsx",onExportComplete:()=>o(!1),children:Zt.map(({field:d,title:r})=>t.jsx(S,{field:d,title:r},d))})]})},ts="_info__left_1j1fm_1",ss="_article_1j1fm_7",ns="_article__value_1j1fm_14",os="_partName_1j1fm_23",as="_partInfo_1j1fm_33",is="_partInfo__item_1j1fm_38",cs="_partInfo__value_1j1fm_49",w={info__left:ts,article:ss,article__value:ns,partName:os,partInfo:as,partInfo__item:is,partInfo__value:cs},rs=({article:e,name:s,make:n,positionId:o})=>t.jsxs("div",{className:w.info__left,children:[t.jsxs("div",{className:w.article,children:["ÐÑÑикÑл: ",t.jsx("span",{className:w.article__value,children:e})]}),t.jsx("p",{className:w.partName,children:s}),t.jsxs("div",{className:w.partInfo,children:[t.jsxs("div",{className:w.partInfo__item,children:["РеÑеÑенÑ: ",t.jsx("span",{className:w.partInfo__value,children:o})]}),t.jsxs("div",{className:w.partInfo__item,children:["ÐÑоизв-лÑ: ",t.jsx("span",{className:w.partInfo__value,children:n})]})]})]}),ls="_infoRight_37g9f_1",ds="_info__quantity_37g9f_8",_s="_info__price_37g9f_16",X={infoRight:ls,info__quantity:ds,info__price:_s},ps=({quantity:e,price:s})=>{const n=me(lt(s))+" â¸";return t.jsxs("div",{className:X.infoRight,children:[t.jsx("div",{className:X.info__quantity,children:e+" ÑÑ."}),t.jsx("div",{className:X.info__price,children:n})]})},us="_details__info_1d07e_1",hs={details__info:us},xs=({item:e})=>{const{article:s,name:n,make:o,price:a,position_id:i,quantity:c}=e;return t.jsxs("div",{className:hs.details__info,children:[t.jsx(rs,{article:s,name:n,make:o,positionId:i}),t.jsx(ps,{price:a,quantity:c})]})},ms="_invoiceDetails_7j6v7_1",vs="_details_7j6v7_5",gs="_loader_7j6v7_15",fs="_error_7j6v7_21",B={invoiceDetails:ms,details:vs,loader:gs,error:fs},js=({invoice:e,details:s,loading:n,getDetails:o,onDetailsGetComplete:a,error:i})=>{const{invoice_id:c,invoice:d}=e;m.useEffect(()=>{o({invoiceId:c,onComplete:a})},[]);const r=c in s?s[c]:[];return n?t.jsx("div",{className:B.loader,children:t.jsx(ve,{})}):i?t.jsx("div",{className:B.error,children:"ÐÑоизоÑла оÑибка, повÑоÑиÑе запÑÐ¾Ñ Ð¿Ð¾Ð·Ð´Ð½ÐµÐµ"}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:B.invoiceDetails,children:r==null?void 0:r.map(l=>t.jsx("div",{className:B.details,children:t.jsx(xs,{item:l})},l.position_id))}),(r==null?void 0:r.length)>0&&t.jsx(es,{details:r,invoiceName:d})]})},As=e=>({details:Ee(e),error:Vt(e)}),bs={getDetails:ge},Ss=y(As,bs),Ns=Ss(js),ws=e=>{const s=new Date(e),n={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"};return new Intl.DateTimeFormat("ru-RU",n).format(s)},Is="_invoice_1wabh_1",ys="_selected_1wabh_11",Cs="_invoice__item_1wabh_30",k={invoice:Is,selected:ys,invoice__item:Cs},Es={YES:"ÐÐ",NO:"ÐÐТ",REORDER:"ÐÐÐ ÐÐÐÐÐÐ"},ks=({item:e})=>{const{created_at:s,amount:n,invoice:o,is_received:a}=e,[i,c]=m.useState(!1),[d,r]=m.useState(!1),l=()=>c(_=>(_||r(!0),!_)),h=m.useCallback(()=>{r(!1)},[r]),p=Es[a];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:W(k.invoice,{[k.selected]:i}),onClick:l,children:[t.jsxs("div",{className:k.invoice__item,children:[t.jsx("img",{src:i?Ot:Wt,alt:"toggle card"}),t.jsx("span",{children:ws(s)})]}),t.jsx("div",{className:k.invoice__item,children:t.jsxs("span",{children:[n," â¸"]})}),t.jsx("div",{className:k.invoice__item,children:t.jsx("span",{children:o})}),t.jsx("div",{className:k.invoice__item,children:t.jsx("span",{children:p})})]}),i&&t.jsx(Ns,{invoice:e,loading:d,onDetailsGetComplete:h})]})},Ds="_message_fjoh4_1",Ts="_message__text_fjoh4_8",Rs="_message__text_blue_fjoh4_15",H={message:Ds,message__text:Ts,message__text_blue:Rs},Ls=()=>t.jsxs("div",{className:H.message,children:[t.jsx("span",{className:H.message__text,children:"Ðе Ð½Ð°Ð¹Ð´ÐµÐ½Ñ Ð´Ð°Ð½Ð½Ñе ÑооÑвеÑÑÑвÑÑÑие ваÑÐµÐ¼Ñ Ð·Ð°Ð¿ÑоÑÑ"}),t.jsx("span",{className:W(H.message__text,{},[H.message__text_blue]),children:"ÐопÑобÑйÑе измениÑÑ Ð·Ð°Ð¿ÑоÑ"})]}),$s="_invoiceList_6t3yv_1",Fs={invoiceList:$s},Ps=({invoicesList:e})=>e.length>0?t.jsx("ul",{className:Fs.invoiceList,children:e.map(s=>t.jsx(ks,{item:s},s.id))}):t.jsx(Ls,{}),Ms=e=>({loading:te(e),error:se(e)}),Us=y(Ms,null),Bs=Us(Ps),Hs="_table_8lc3t_1",zs="_noData_8lc3t_7",Os="_noData__message_8lc3t_13",Q={table:Hs,noData:zs,noData__message:Os},Ws=({invoicesList:e,sort:s,changeSortHandler:n,filter:o,changeFilterHandler:a,invoicesAmount:i})=>{const c=i>0;return t.jsxs("div",{className:Q.table,children:[t.jsx(At,{}),t.jsx(zt,{sort:s,filter:o,changeSortHandler:n,changeFilterHandler:a}),c?t.jsx(Bs,{invoicesList:e}):t.jsx("div",{className:Q.noData,children:t.jsx("h2",{className:Q.noData__message,children:"ÐÐµÑ Ð´Ð°Ð½Ð½ÑÑ
"})})]})},Vs=e=>({invoicesAmount:ht(e)}),Ys=y(Vs,null),qs=Ys(Ws),Xs=(e,s=500)=>{const[n,o]=m.useState(e),a=m.useRef();return m.useEffect(()=>(a.current=setTimeout(()=>
1o(e),s),()=>{clearTimeout(a.current)}),[e,s]),n},Qs=(e,s)=>{const n=new Date(e),o=new Date(s);return n.getFullYear()===o.getFullYear()&&n.getMonth()===o.getMonth()&&n.getDate()===o.getDate()},_e=(e,s)=>e.toUpperCase().startsWith(s.toUpperCase()),Gs=(e,s)=>s===we.ALL?!0:e===s,Zs=({invoiceName:e,onPageReset:s})=>{const n=e?[{name:j.NAME,value:e}]:[],[o,a]=m.useState(n),i=Xs(o,500);return{filter:i,changeFilterHandler:(r,l)=>{if(s(),!i.some(p=>p.name===r)){a(p=>[...p,{name:r,value:l}]);return}a(p=>l===""?p.filter(_=>_.name!==r):p.map(_=>_.name===r?v(x({},_),{value:l}):_))},handleInvoicesFilter:r=>{let l=[...r];return i.length===0||i.forEach(({name:h,value:p})=>{l=l.filter(_=>{switch(h){case j.SUM:return _e(_.amount,String(p));case j.NAME:return _e(_.invoice,p);case j.IS_RECEIVED:return Gs(_.is_received,p);case j.DATE:return Qs(Number(p),new Date(_.created_at).getTime());default:return!0}})}),l}}},Js=()=>{const[e,s]=m.useState(1),[n,o]=m.useState(gt);return{page:e,pageChangeHandler:r=>{s(r)},pageSize:n,pageSizeChangeHandler:r=>{o(r)},onPageReset:()=>{s(1)},handleInvoicesPaginate:r=>r.slice(n*(e-1),n*e)}},Ks=(e,s)=>new Date(e.created_at).getTime()-new Date(s.created_at).getTime(),en=(e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime(),tn=(e,s)=>parseFloat(e.amount)-parseFloat(s.amount),sn=(e,s)=>parseFloat(s.amount)-parseFloat(e.amount),nn={name:j.DATE,type:R.DESC},on=({onPageReset:e})=>{const[s,n]=m.useState(nn);return{sort:s,changeSortHandler:(i,c)=>{e(),n({name:i,type:c})},handleInvoicesSort:i=>{const c=[...i];switch(s==null?void 0:s.name){case j.DATE:return c.sort(s.type===R.ASC?Ks:en);case j.SUM:return c.sort(s.type===R.ASC?tn:sn);default:return c}}}},an=({invoiceTableRef:e,pageChangeHandler:s})=>o=>{e==null||e.current.scrollIntoView({behavior:"smooth"}),s(o)},cn=({invoiceName:e,invoiceTableRef:s})=>{const{page:n,pageChangeHandler:o,pageSize:a,pageSizeChangeHandler:i,onPageReset:c,handleInvoicesPaginate:d}=Js(),{sort:r,changeSortHandler:l,handleInvoicesSort:h}=on({onPageReset:c}),{filter:p,changeFilterHandler:_,handleInvoicesFilter:A}=Zs({invoiceName:e,onPageReset:c}),F=Fe(ee);let g=h(F);g=A(g);const I=d(g),L=an({invoiceTableRef:s,pageChangeHandler:o});return{invoicesListToShow:I,page:{page:n,pageChangeHandler:L},pageSize:{pageSize:a,pageSizeChangeHandler:i},sort:{sort:r,changeSortHandler:l},filter:{filter:p,changeFilterHandler:_},totalItemsListLength:g.length}},rn="_title_c24gg_1",ln={title:rn},dn=()=>t.jsx("h2",{className:ln.title,children:"ÐÑÑоÑиÑ"}),_n="_tableWrapper_pnzas_1",pn="_pagination_pnzas_12",pe={tableWrapper:_n,pagination:pn},un=({invoiceName:e})=>{const s=m.useRef(null),{invoicesListToShow:n,page:{page:o,pageChangeHandler:a},pageSize:{pageSize:i,pageSizeChangeHandler:c},sort:{sort:d,changeSortHandler:r},filter:{filter:l,changeFilterHandler:h},totalItemsListLength:p}=cn({invoiceTableRef:s,invoiceName:e});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{ref:s,className:pe.tableWrapper,children:[t.jsx(dn,{}),t.jsx(qs,{invoicesList:n,sort:d,filter:l,changeSortHandler:r,changeFilterHandler:h})]}),p>0&&t.jsx(rt,{limit:i,active:o,totalItems:p,step:2,onClickHandler:a,pageSizes:vt,pageSizeHandler:c,paginationClassname:pe.pagination})]})},hn="_invoice_1ih7n_1",xn="_main_1ih7n_7",G={invoice:hn,main:xn},mn=({loading:e,error:s,getInvoices:n,invoiceName:o})=>{m.useEffect(()=>{n()},[]);const a=fe(),i=e||a;return t.jsx(ct,{title:"СÑеÑа",link:Pe,children:i?t.jsx("div",{className:G.loader,children:t.jsx(ve,{})}):s?t.jsx(it,{}):t.jsx(t.Fragment,{children:t.jsx("section",{className:G.invoice,children:t.jsx("div",{className:G.main,children:t.jsx(un,{invoiceName:o})})})})})},vn=e=>({loading:te(e),error:se(e)}),gn={getInvoices:je},fn=y(vn,gn),jn=fn(mn),An="_content_list_1wx2g_1",bn="_content_item_1wx2g_7",Sn="_top_1wx2g_13",Nn="_bottom_1wx2g_24",wn="_item_center_1wx2g_32",In="_item_right_1wx2g_38",yn="_item_left_1wx2g_44",C={content_list:An,content_item:bn,top:Sn,bottom:Nn,item_center:wn,item_right:In,item_left:yn},Cn=({list:e,openModalHandler:s})=>t.jsx("div",{className:C.content_list,children:e.map(n=>t.jsxs("div",{className:C.content_item,onClick:()=>s({invoiceId:n.invoice_id,invoice:n.invoice}),children:[t.jsxs("div",{className:C.top,children:[t.jsx("div",{className:C.item_left,children:n.created_at.slice(0,10)}),t.jsx("div",{className:C.item_center,children:n.amount}),t.jsx("div",{className:C.item_right,children:n.invoice})]}),t.jsx("div",{className:C.bottom,children:"ÐодÑобнее"})]},n.id))}),En="_empty_spw25_1",kn={empty:En},Dn=()=>t.jsx("div",{className:kn.empty,children:"ÐиÑего не найдено"}),Tn="_date_pitg8_1",Rn="_input_pitg8_9",Ln="_btn_pitg8_23",$n="_Input_wrapper_pitg8_38",z={date:Tn,input
1:Rn,btn:Ln,Input_wrapper:$n},Fn=({name:e,control:s})=>{const n=o=>{o.preventDefault();const a=document.getElementById(e);a==null||a.focus(),a==null||a.showPicker()};return t.jsx("label",{className:z.date,htmlFor:e,children:t.jsx(Me,{name:e,control:s,render:({field:o})=>t.jsxs("div",{className:z.Input_wrapper,children:[t.jsx(_t,{id:e,className:z.input,selected:o.value,placeholderText:"ÐаÑа ÑозданиÑ",dateFormat:"yyyy-MM-dd",locale:pt,onChange:o.onChange}),t.jsx("button",{className:z.btn,onClick:n,children:t.jsx(N,{icon:Ue,color:"white",size:"xl"})})]})})})},Pn="_dropdown_bmp2g_1",Mn="_input_bmp2g_5",Un="_icon_bmp2g_19",Bn="_values_bmp2g_30",Hn="_values_item_bmp2g_47",zn="_backdrop_bmp2g_58",D={dropdown:Pn,input:Mn,icon:Un,values:Bn,values_item:Hn,backdrop:zn},On=({placeHolder:e,name:s,register:n,values:o,setValue:a})=>{const[i,c]=m.useState(!1),d=n(s),r=l=>{l.stopPropagation(),c(h=>!h)};return t.jsxs("div",{className:D.dropdown,onClick:r,children:[i&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:D.backdrop,onClick:r}),t.jsx("div",{className:D.values,children:o.map(l=>t.jsx("div",{className:D.values_item,onClick:()=>a(l),children:l},l))})]}),t.jsx("input",x({type:"text",className:D.input,placeholder:e,disabled:!0},d)),t.jsx("div",{className:D.icon,children:t.jsx(N,{icon:Be})})]})},Wn="_input_wrapper_wck4d_1",Vn="_input_wck4d_1",Yn="_btn_wck4d_19",Z={input_wrapper:Wn,input:Vn,btn:Yn},ue=({placeHolder:e,icon:s,type:n="text",register:o,name:a})=>t.jsxs("div",{className:Z.input_wrapper,children:[t.jsx("input",x({type:n,className:Z.input,placeholder:e},o(a))),t.jsx("button",{className:Z.btn,type:"submit",children:t.jsx(N,{icon:s,color:"white"})})]}),qn="_filter_ckj4r_1",Xn="_mount_ckj4r_1",Qn="_backdrop_ckj4r_15",Gn="_header_ckj4r_25",Zn="_header_line_ckj4r_35",Jn="_header_title_ckj4r_42",Kn="_bold_ckj4r_49",eo="_header_reset_ckj4r_56",to="_body_ckj4r_
163",so="_content_ckj4r_68",no="_dates_ckj4r_77",oo="_footer_ckj4r_83",ao="_btn_select_ckj4r_90",io="_exit_ckj4r_109",co="_exitActive_ckj4r_115",f={filter:qn,mount:Xn,backdrop:Qn,header:Gn,header_line:Zn,header_title:Jn,bold:Kn,header_reset:eo,body:to,content:so,dates:no,footer:oo,btn_select:ao,exit:io,exitActive:co};var K=(e=>(e.YES="Ðа",e.NO="ÐеÑ",e.ALL="ÐÑе",e.REORDER="ÐеÑезаказ",e))(K||{});const ro=({isOpen:e,close:s,invoiceFilterReset:n,invoiceFilterList:o})=>{const{register:a,handleSubmit:i,setValue:c,reset:d,control:r}=He(),l=_=>{const A=[];Object.keys(_).forEach(g=>{var L,P;const I=typeof _[g]=="string"?(L=_[g])==null?void 0:L.trim():_[g];if(g==="is_received"){const M=(P=Object.entries(K).find(V=>V[1]===I))==null?void 0:P[0];if(I==="ÐÑе"||!M)return;A.push({filed:g,value:M});return}I&&A.push({filed:g,value:I})}),o(A),s()},h=()=>{n(),d({created_at:"",amount:"",invoice:"",is_received:""}),s()},p=_=>{c("is_received",_)};return t.jsxs(t.Fragment,{children:[e&&t.jsx("div",{className:f.backdrop,onClick:s}),t.jsx(ze,{unmountOnExit:!0,in:e,timeout:300,classNames:{exit:f.exit,exitActive:f.exitActive},children:t.jsxs("form",{className:f.filter,onSubmit:i(l),children:[t.jsxs("div",{className:f.header,children:[t.jsx("div",{className:f.header_line}),t.jsxs("div",{className:f.header_title,children:[t.jsx("div",{className:f.bold,children:"СоÑÑиÑовка"}),t.jsx("div",{className:f.header_reset,onClick:h,children:"СбÑоÑиÑÑ"})]})]}),t.jsx("div",{className:f.body,children:t.jsxs("div",{className:f.content,children:[t.jsx(Fn,{control:r,name:"created_at"}),t.jsx(ue,{icon:re,placeHolder:"СÑмма",type:"tel",register:a,name:"amount"}),t.jsx(ue,{icon:re,placeHolder:"â ÐнвойÑа",register:a,name:"invoice"}),t.jsx(On,{placeHolder:"ÐолÑÑен?",name:"is_received",register:a,values:Object.values(K),setValue:p})]})}),t.jsx("div",{className:f.footer,children:t.jsx("button",{className:f.btn_select,type:"submit",children:"ÐÑбÑаÑÑ"})})]})})]})},lo={invoiceFilterList:Oe,invoiceFilterReset:We},_o=y(null,lo)(ro),po="_skeleton_1qicm_1",uo="_skeleton_animation_1qicm_1",ho={skeleton:po,skeleton_animation:uo},ke=()=>t.jsx("div",{className:ho.skeleton}),xo="_article_fl4fd_1",mo="_value_fl4fd_10",vo="_icon_fl4fd_20",J={article:xo,value:mo,icon:vo},go=({article:e})=>{const s=n=>{window.navigator.clipboard.writeText(n)};return t.jsxs("div",{className:J.article,children:[t.jsx("a",{target:"_blank",href:Ve+`?${Ye.DETAIL_NUM}=${e}`,className:J.value,rel:"noreferrer",children:e}),t.jsx("div",{className:J.icon,onClick:()=>s(e),children:t.jsx(N,{icon:qe})})]})},fo="_detail_1b4jg_1",jo="_detail_item_1b4jg_12",Ao="_title_1b4jg_21",bo="_value_1b4jg_32",So="_now_rap_value_1b4jg_42",No="_name_1b4jg_54",wo="_all_price_1b4jg_63",Io="_text_1b4jg_73",yo="_text_title_1b4jg_77",Co="_text_description_1b4jg_81",u={detail:fo,detail_item:jo,title:Ao,value:bo,now_rap_value:So,name:No,all_price:wo,text:Io,text_title:yo,text_description:Co},Eo=({item:e,openImage:s})=>t.jsxs("div",{className:u.detail,children:[(e==null?void 0:e.position_id)&&t.jsxs("div",{className:u.detail_item,children:[t.jsx("div",{className:u.title,children:"РеÑеÑенÑ"}),t.jsx("div",{className:u.value,children:e==null?void 0:e.position_id})]}),(e==null?void 0:e.make)&&t.jsxs("div",{className:u.detail_item,children:[t.jsx("div",{className:u.title,children:"ÐÑоизводиÑелÑ"}),t.jsx("div",{className:u.value,children:e==null?void 0:e.make})]}),(e==null?void 0:e.article)&&t.jsxs("div",{className:u.detail_item,children:[t.jsx("div",{className:u.title,children:"ÐÐ¾Ð¼ÐµÑ Ð´ÐµÑали"}),t.jsx(go,{article:e==null?void 0:e.article})]}),(e==null?void 0:e.name)&&t.jsxs("div",{className:u.detail_item,children:[t.jsx("div",{className:u.name,children:e==null?void 0:e.name}),t.jsx("div",{className:u.icon,onClick:()=>s({make:e.make,article:e.article}),children:t.jsx(N,{icon:Xe})})]}),(e==null?void 0:e.weight)&&t.jsxs("div",{className:u.detail_item,children:[t.jsx("div",{className:u.title,children:"ÐÐµÑ Ð¸Ð·Ð´ÐµÐ»Ð¸Ñ"}),t.jsxs("div",{className:u.value,children:[e==null?void 0:e.weight," кг"]})]}),(e==null?void 0:e.price)&&t.jsxs("div",{className:u.detail_item,children:[t.jsx("div",{className:u.title,children:"Цена"}),t.jsx("div",{className:u.value,children:me(e==null?void 0:e.price)+" â¸"})]}),(e==null?void 0:e.quantity)&&t.jsxs("div",{className:u.detail_item,children:[t.jsx("div",{className:u.title,children:"ÐолиÑеÑÑво"}),t.jsx("div",{className:u.value,children:e==null?void 0:e.quantity})]}),(e==null?void 0:e.comment)&&t.jsx("div",{className:u.detail_item,children:t.jsx("div",{className:u.name,children:e==null?void 0:e.comment})})]}),ko="_empty_1gkgi_1",Do="_text_1gkgi_15",To="_description_1gkgi_23",Ro="_img_1gkgi_32",Lo="_icon_1gkgi_42",O={empty:ko,text:Do,description:To,img:
1Ro,icon:Lo},$o=()=>t.jsxs("div",{className:O.empty,children:[t.jsx("div",{className:O.img,children:t.jsx(N,{icon:Qe,color:"#9AA4AE",width:"48px",className:O.icon})}),t.jsx("div",{className:O.text,children:"ÐиÑего не найдено"})]}),Fo="_btn_17808_1",Po="_icon_17808_16",he={btn:Fo,icon:Po},Mo=({invoice:e,details:s})=>{const n=m.useRef(null),[o,a]=m.useState(!1),i=()=>{var c;a(!0),(c=n.current)==null||c.save()};return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:he.btn,disabled:o,onClick:i,children:[t.jsx("div",{className:he.icon,children:t.jsx(N,{icon:Ge})}),t.jsx("div",{children:o?"ÐагÑÑзка":"СкаÑаÑÑ Ð² EXCEL"})]}),t.jsxs(be,{ref:n,data:s,fileName:e+".xlsx",onExportComplete:()=>a(!1),children:[t.jsx(S,{field:"position_id",title:"Ð ÐФÐÐ ÐÐС"}),t.jsx(S,{field:"comment",title:"ÐÐÐÐÐÐТ"}),t.jsx(S,{field:"make",title:"ÐÐ ÐÐÐÐÐÐÐТÐÐЬ"}),t.jsx(S,{field:"article",title:"ÐÐÐÐÐ ÐÐТÐÐÐ"}),t.jsx(S,{field:"price",title:"ЦÐÐÐ KZT"}),t.jsx(S,{field:"name",title:"ÐÐÐÐÐÐÐÐÐÐÐÐ"}),t.jsx(S,{field:"quantity",title:"ÐÐÐ-ÐÐ"}),t.jsx(S,{field:"cost",title:"СТÐÐÐÐСТЬ KZT"}),t.jsx(S,{field:"weight",title:"ÐÐС кг"})]})]})},Uo="_item_a6jii_1",Bo="_header_a6jii_12",Ho="_header_title_a6jii_19",zo="_header_description_a6jii_26",Oo="_body_a6jii_33",Wo="_footer_a6jii_41",T={item:Uo,header:Bo,header_title:Ho,header_description:zo,body:Oo,footer:Wo},Vo=({isOpen:e,close:s,invoiceId:n,invoice:o,loading:a,error:i,details:c,openImage:d,invoiceDetailsRequest:r})=>{m.useEffect(()=>{n&&r({invoiceId:n})},[n]);const l=n in c?c[n]:[];return t.jsx(ut,{isOpen:e,showNavbar:!1,zIndex:6,children:t.jsxs("div",{className:T.item,children:[t.jsx(Se,{closeAction:s,zIndex:6,children:t.jsxs("div",{className:T.header,children:[t.jsx("span",{className:T.header_titel,children:"â ÐнвойÑа - "}),t.jsx("span",{className:T.header_description,children:o})]})}),t.jsx("div",{className:T.body,children:i?t.jsx(Ae,{}):a?t.jsx(ke,{}):(l==null?void 0:l.length)===0?t.jsx($o,{}):l.map(h=>t.jsx(Eo,{item:h,openImage:d},h.position_id))}),t.jsx("div",{className:T.footer,children:t.jsx(Mo,{details:l,invoice:o})})]})})},Yo=e=>({loading:e.invoice.details.loading,error:e.invoice.details.error,details:Ee(e)}),qo={invoiceDetailsRequest:ge},Xo=y(Yo,qo),Qo=Xo(Vo),Go="_invoice_6fov2_1",Zo="_header_6fov2_11",Jo="_icon_wrapper_6fov2_17",Ko="_icon_6fov2_17",ea="_body_6fov2_29",ta="_content_6fov2_36",sa="_content_title_6fov2_46",na="_content_header_6fov2_53",oa="_item_center_6fov2_62",aa="_item_right_6fov2_68",ia="_item_left_6fov2_74",b={invoice:Go,header:Zo,icon_wrapper:Jo,icon:Ko,body:ea,content:ta,content_title:sa,content_header:na,item_center:oa,item_right:aa,item_left:ia},ca=({invoiceFetchRequest:e,loading:s,error:n,isFiltered:o,list:a,filteredList:i})=>{const c=o?i:a,d=fe(),[r,l,h,p]=Y({}),[_,A,F,g]=Y({}),[I,L,P,M]=Y({}),V=()=>{window.history.back()};return m.useEffect(()=>{e()},[]),t.jsxs("div",{className:b.invoice,children:[_&&t.jsx(dt,{isModal:_,make:A==null?void 0:A.make,article:A==null?void 0:A.article,closeModal:g}),t.jsx(Qo,{isOpen:r,close:p,invoiceId:l==null?void 0:l.invoiceId,invoice:l==null?void 0:l.invoice,openImage:F}),t.jsx(_o,{isOpen:I,close:M}),t.jsx(Se,{closeAction:V,children:t.jsxs("div",{className:b.header,children:[t.jsx("div",{children:"СÑеÑа"}),t.jsx("div",{className:b.icon_wrapper,onClick:P,children:t.jsx(N,{icon:Ze,className:b.icon,width:20})})]})}),n?t.jsx(Ae,{}):t.jsx("div",{className:b.body,children:s||d?t.jsx(ke,{}):t.jsxs("div",{className:b.content,children:[t.jsx("div",{className:b.content_title,children:"ÐÑÑоÑиÑ"}),t.jsxs("div",{className:b.content_header,children:[t.jsx("div",{className:b.item_left,children:"ÐаÑа ÑозданиÑ"}),t.jsx("div",{className:b.item_center,children:"СÑмма KZT"}),t.jsx("div",{className:b.item_right,children:"â ÐнвойÑа"})]}),c.length>0?t.jsx(Cn,{list:c,openModalHandler:h}):t.jsx(Dn,{})]})})]})},ra=e=>({loading:te(e),error:se(e),list:ee(e),filteredList:xt(e),isFiltered:mt(e)}),la={invoiceFetchRequest:je},da=y(ra,la)(ca);function _a({invoiceName:e,isMobile:s,urlPathname:n}){const o=e&&decodeURI(e).replace(/[^\s0-9A-Za-zÐ-Яа-Ñ-_]+/g,""),a=s?t.jsx(da,{}):t.jsx(jn,{invoiceName:o});return t.jsx(ot,{isMobile:s,isProtected:at(n),children:a})}const pa=e=>({isMobile:Je(e)}),ua=y(pa,null),ha=ua(_a),xa=Object.freeze(Object.defineProperty({__proto__:null,Page:ha},Symbol.toStringTag,{value:"Module"})),Fa={onBeforeRenderEnv:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:null}},dataEnv:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:{server:!0,client:!0}}},Loading:{type:"standard",definedAtData:{filePathToShowToUser:"vike-react/components/Loading",fileExportPathToShowToUser:[]},valueSerialized:{type:"pointer-import",value:Ke}},hydrationCanBeAborted:{type:"standard",definedAtData:{filePathToShowToUser:"vike-react/config",fileExportPathToShowToUser:["default","hydrationCanBeAborted"]},valueSerialized:{type:"js-serialized",value:!0}},onRenderClient:{type:"standard",definedAtData:{filePathToShowToUser:"vike-react/renderer/onRenderClient",fileExportPathToShowToUser:[]},valueSerialized:{type:"pointer-import",value:et}},Layout:{type:"cumulative",definedAtData:[{filePathToShowToUser:"/src/pages/+Layout.t
1s",fileExportPathToShowToUser:[]}],valueSerialized:[{type:"plus-file",exportValues:tt}]},reactStrictMode:{type:"standard",definedAtData:{filePathToShowToUser:"/src/pages/+config.ts",fileExportPathToShowToUser:["default","reactStrictMode"]},valueSerialized:{type:"js-serialized",value:!1}},data:{type:"standard",definedAtData:{filePathToShowToUser:"/src/pages/+data.shared.ts",fileExportPathToShowToUser:[]},valueSerialized:{type:"plus-file",exportValues:st}},title:{type:"standard",definedAtData:{filePathToShowToUser:"/src/pages/+title.ts",fileExportPathToShowToUser:[]},valueSerialized:{type:"plus-file",exportValues:nt}},Page:{type:"standard",definedAtData:{filePathToShowToUser:"/src/pages/invoice/+Page.tsx",fileExportPathToShowToUser:[]},valueSerialized:{type:"plus-file",exportValues:xa}}};export{Fa as configValuesSerialized};
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.