PageSourceSearch

https://daks.by/_next/static/chunks/pages/profile/orders-ead39f37383b1910.js

js daks.by collected 2026-10-02 01:21:43 UTC 14,734 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3319],{27484:function(e){var t,r,n,s,i,o,a,d,c,l,u,_,h,m,f,p,y,g,$,v,x;e.exports=(t="millisecond",r="second",n="minute",s="hour",i="week",o="month",a="quarter",d="year",c="date",l="Invalid Date",u=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},(f={})[m="en"]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||"th")+"]"}},p=function(e){return e instanceof v},y=function e(t,r,n){var s;if(!t)return m;if("string"==typeof t){var i=t.toLowerCase();f[i]&&(s=i),r&&(f[i]=r,s=i);var o=t.split("-");if(!s&&o.length>1)return e(o[0])}else{var a=t.name;f[a]=t,s=a}return!n&&s&&(m=s),s||!n&&m},g=function(e,t){if(p(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new v(r)},($={s:h,z:function(e){var t=-e.utcOffset(),r=Math.abs(t);return(t<=0?"+":"-")+h(Math.floor(r/60),2,"0")+":"+h(r%60,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),s=t.clone().add(n,o),i=r-s<0,a=t.clone().add(n+(i?-1:1),o);return+(-(n+(r-s)/(i?s-a:a-s))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return({M:o,y:d,w:i,d:"day",D:c,h:s,m:n,s:r,ms:t,Q:a})[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}}).l=y,$.i=p,$.w=function(e,t){return g(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})},x=(v=function(){function e(e){this.$L=y(e.locale,null,!0),this.parse(e)}var h=e.prototype;return h.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if($.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(u);if(n){var s=n[2]-1||0,i=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)):new Date(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},h.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},h.$utils=function(){return $},h.isValid=function(){return this.$d.toString()!==l},h.isSame=function(e,t){var r=g(e);return this.startOf(t)<=r&&r<=this.endOf(t)},h.isAfter=function(e,t){return g(e)<this.startOf(t)},h.isBefore=function(e,t){return this.endOf(t)<g(e)},h.$g=function(e,t,r){return $.u(e)?this[t]:this.set(r,e)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(e,t){var a=this,l=!!$.u(t)||t,u=$.p(e),_=function(e,t){var r=$.w(a.$u?Date.UTC(a.$y,t,e):new Date(a.$y,t,e),a);return l?r:r.endOf("day")},h=function(e,t){return $.w(a.toDate()[e].apply(a.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(t)),a)},m=this.$W,f=this.$M,p=this.$D,y="set"+(this.$u?"UTC":"");switch(u){case d:return l?_(1,0):_(31,11);case o:return l?_(1,f):_(0,f+1);case i:var g=this.$locale().weekStart||0,v=(m<g?m+7:m)-g;return _(l?p-v:p+(6-v),f);case"day":case c:return h(y+"Hours",0);case s:return h(y+"Minutes",1);case n:return h(y+"Seconds",2);case r:return h(y+"Milliseconds",3);default:return this.clone()}},h.endOf=function(e){return this.startOf(e,!1)},h.$set=function(e,i){var a,l=$.p(e),u="set"+(this.$u?"UTC":""),_=((a={}).day=u+"Date",a[c]=u+"Date",a[o]=u+"Month",a[d]=u+"FullYear",a[s]=u+"Hours",a[n]=u+"Minutes",a[r]=u+"Seconds",a[t]=u+"Milliseconds",a)[l],h="day"===l?this.$D+(i-this.$W):i;if(l===o||l===d){var m=this.clone().set(c,1);m.$d[_](h),m.init(),this.$d=m.set(c,Math.min(this.$D,m.daysInMonth())).$d}else _&&this.$d[_](h);return this.init(),this},h.set=function(e,t){return this.clone().$set(e,t)},h.get=function(e){return this[$.p(e)]()},h.add=function(e,t){var a,c=this;e=Number(e);var l=$.p(t),u=function(t){var r=g(c);return $.w(r.date(r.date()+Math.round(t*e)),c)};if(l===o)return this.set(o,this.$M+e);if(l===d)return this.set(d,this.$y+e);if("day"===l)return u(1);if(l===i)return u(7);var _=((a={})[n]=6e4,a[s]=36e5,a[r]=1e3,a)[l]||1,h=this.$d.getTime()+e*_;return $.w(h,this)},h.subtract=function(e,t){return this.add(-1*e,t)},h.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||l;var n=e||"YYYY-MM-DDTHH:mm:ssZ",s=$.z(this),i=this.$H,o=this.$m,a=this.$M,d=r.weekdays,c=r.months,u=function(e,r,s,i){return e&&(e[r]||e(t,n))||s[r].slice(0,i)},h=function(e){return $.s(i%12||12,e,"0")},m=r.meridiem||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n}
1,f={YY:String(this.$y).slice(-2),YYYY:$.s(this.$y,4,"0"),M:a+1,MM:$.s(a+1,2,"0"),MMM:u(r.monthsShort,a,c,3),MMMM:u(c,a),D:this.$D,DD:$.s(this.$D,2,"0"),d:String(this.$W),dd:u(r.weekdaysMin,this.$W,d,2),ddd:u(r.weekdaysShort,this.$W,d,3),dddd:d[this.$W],H:String(i),HH:$.s(i,2,"0"),h:h(1),hh:h(2),a:m(i,o,!0),A:m(i,o,!1),m:String(o),mm:$.s(o,2,"0"),s:String(this.$s),ss:$.s(this.$s,2,"0"),SSS:$.s(this.$ms,3,"0"),Z:s};return n.replace(_,function(e,t){return t||f[e]||s.replace(":","")})},h.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},h.diff=function(e,t,c){var l,u=$.p(t),_=g(e),h=(_.utcOffset()-this.utcOffset())*6e4,m=this-_,f=$.m(this,_);return f=((l={})[d]=f/12,l[o]=f,l[a]=f/3,l[i]=(m-h)/6048e5,l.day=(m-h)/864e5,l[s]=m/36e5,l[n]=m/6e4,l[r]=m/1e3,l)[u]||m,c?f:$.a(f)},h.daysInMonth=function(){return this.endOf(o).$D},h.$locale=function(){return f[this.$L]},h.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=y(e,t,!0);return n&&(r.$L=n),r},h.clone=function(){return $.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},e}()).prototype,g.prototype=x,[["$ms",t],["$s",r],["$m",n],["$H",s],["$W","day"],["$M",o],["$y",d],["$D",c]].forEach(function(e){x[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),g.extend=function(e,t){return e.$i||(e(t,v,g),e.$i=!0),g},g.locale=y,g.isDayjs=p,g.unix=function(e){return g(1e3*e)},g.en=f[m],g.Ls=f,g.p={},g)},49578:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile/orders",function(){return r(3634)}])},55513:function(e,t,r){"use strict";var n=r(85893),s=r(78046),i=r(11163),o=r(67294),a=r(82857);let d=(e,t,r)=>{let d=r=>{let{headerStore:d}=(0,s.oR)(),c=(0,i.useRouter)(),[l,u]=(0,o.useState)(!0),_=e=>{u(e)};return(0,o.useEffect)(()=>{d.setOpenMenuBlock(!1)},[c,d]),(0,n.jsxs)(o.Fragment,{children:[l&&(0,n.jsx)(a.Z,{visible:!0,message:t}),(0,n.jsx)(e,{...r,setLoading:_,load:l})]})};return d.Layout=r,d};t.Z=d},25962:function(e,t,r){"use strict";var n=r(85893),s=r(50281),i=r(1811),o=r.n(i);let a=e=>{let{children:t}=e;return(0,n.jsx)(s.Container,{children:(0,n.jsx)("main",{className:o().layout,children:t})})};t.Z=a},3634:function(e,t,r){"use strict";r.r(t);var n=r(85893),s=r(85873),i=r(33159),o=r(50281),a=r(25962),d=r(89099),c=r(27484),l=r.n(c),u=r(55513),_=r(67294),h=r(93434),m=r.n(h);let f=new Set(["pending","confirmed"]),p={pending:"Ожидает подтверждения",confirmed:"Готовится",completed:"Готов",cancelled:"Отменён"},y=[{key:"pending",label:"Принят"},{key:"confirmed",label:"Готовится"},{key:"completed",label:"Готов"}],g=e=>{if("number"==typeof e&&Number.isFinite(e))return e;if("string"==typeof e){let t=Number(e.replace(",","."));return Number.isFinite(t)?t:0}if(null!==e&&"object"==typeof e&&Array.isArray(e.d)){let t=e.d.map((e,t)=>{if("number"!=typeof e||!Number.isFinite(e))return null;let r=Math.trunc(e).toString();return 0===t?r:r.padStart(7,"0")});if(t.some(e=>null===e))return 0;let r=t.join(""),n=Number(r);return Number.isFinite(n)?e.s*n*10**(e.e+1-r.length):0}return 0},$=e=>"".concat(g(e).toFixed(2)," руб."),v=e=>{let t=g(e);return Number.isInteger(t)?"".concat(t," руб."):"".concat(t.toFixed(2)," руб.")},x=e=>e&&e>1?" \xd7".concat(e):"",b=e=>{if(Array.isArray(e)){let t=e[0];return Array.isArray(t)?t:t&&"object"==typeof t&&Array.isArray(t.items)?t.items:e}if(e&&"object"==typeof e){if(Array.isArray(e.items))return e.items;if(Array.isArray(e.data))return e.data}return[]},M=e=>String(null!=e?e:0),j=e=>"pending"===e||"confirmed"===e,S=(e,t)=>"completed"===e?"done":"confirmed"===e?"pending"===t?"done":"confirmed"===t?"active":"idle":"pending"===e&&"pending"===t?"active":"idle",w=e=>{let{setLoading:t,load:r}=e,[a,c]=(0,_.useState)([]),[u,h]=(0,_.useState)(!1),g=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{e&&t(!0);let r=await (0,s.getUserOrders)({page:1,limit:50});c(b(r))}catch(e){console.error("Error fetching user orders:",e)}finally{e&&t(!1)}};(0,_.useEffect)(()=>{g(!0);let e=window.setInterval(()=>{g(!1)},15e3);return()=>window.clearInterval(e)},[]);let w=async e=>{try{t(!0),await (0,s.cancelUserOrder)(e),await g(!1),h(!0)}catch(e){console.error("Error cancelling order:",e),d.Z.error({title:"Ошибка",content:"Не удалось отменить заказ. Попробуйте позже.",centered:!0})}finally{t(!1)}},D=e=>{d.Z.confirm({icon:null,title:"Отмена заказа",content:"Вы уверены, что хотите отменить заказ?",okText:"Отменить заказ",cancelText:"Назад",okButtonProps:{type:"primary",danger:!0,style:{background:"var(--primary-blue-color)"}},cancelButtonProps:{type:"default",style:{color:"#888"}},centered:!0,onOk:async()=>{await w(e)}})},N=a.filter(e=>f.has(String(e.status))),O=a.filter(e=>!f.has(String(e.status))),k=e=>{var t,r,s;let i=String(e.status||"pending"),a=e.pickup_in_minutes;return(0,n.jsxs)("div",{className:"".concat(m().orders_item," ").concat(m()["orders_item_".concat(i)]||""),children:[(0,n.jsxs)("div",{className:m().orders_item_top,children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("span",{className:m().orders_item_number,children:["Заказ №",M(e.order_number)]}),(0,n.jsx)("p",{className:m().orders_item_business,children:(null===(t=e.business)||void 0===t?void 0:t.t
1itle)||"Заведение"})]}),(0,n.jsx)("span",{className:"".concat(m().orders_item_badge," ").concat(m()["badge_".concat(i)]),children:p[i]||i})]}),"cancelled"!==i&&(0,n.jsx)("div",{className:m().orders_item_steps,children:y.map((e,t)=>{let r=S(i,e.key);return(0,n.jsxs)("div",{className:m().orders_item_stepWrap,children:[t>0&&(0,n.jsx)("span",{className:"".concat(m().orders_item_line," ").concat("idle"!==r?m().orders_item_line_done:"")}),(0,n.jsxs)("div",{className:"".concat(m().orders_item_step," ").concat(m()["step_".concat(r)]),children:[(0,n.jsx)("span",{className:m().orders_item_stepDot}),(0,n.jsx)("span",{className:m().orders_item_stepLabel,children:e.label})]})]},e.key)})}),(0,n.jsxs)("div",{className:m().orders_item_info,children:[e.created_at&&(0,n.jsxs)("p",{children:["Оформлен: ",l()(e.created_at).format("DD.MM.YYYY HH:mm")]}),a?(0,n.jsxs)("p",{children:["Готов будет через: ",a," ",e.pickup_label||"минут"]}):null,(e.items||[]).map((t,i)=>(0,n.jsxs)("div",{className:m().orders_item_lines,children:[(0,n.jsxs)("p",{children:[t.product_name_snapshot,x(t.quantity)," —"," ",v(null!==(r=t.unit_price)&&void 0!==r?r:t.base_line_total_snapshot)]}),(t.enhancements||[]).map((e,r)=>(0,n.jsxs)("p",{className:m().orders_item_addon,children:["Добавка ",e.enhancement_name_snapshot,x(e.quantity)," —"," ",v(null!==(s=e.price_at_order_time)&&void 0!==s?s:e.enhancement_line_total_snapshot)]},"".concat(t.id||i,"-enh-").concat(r)))]},t.id||"".concat(e.id,"-item-").concat(i))),(0,n.jsxs)("p",{className:m().orders_item_total,children:["Сумма: ",$(e.total_price)]})]}),j(i)&&(0,n.jsx)(o.Btn.Standart,{mix:m().orders_item_cancel,onClick:()=>D(e.id),children:"Отменить заказ"})]},e.id)};return(0,n.jsx)(n.Fragment,{children:!r&&(0,n.jsxs)("div",{className:m().orders,children:[(0,n.jsx)(o.Heading,{title:"Мои заказы",backUrl:"/profile"}),(0,n.jsx)("div",{className:m().orders_list,children:a.length>0?(0,n.jsxs)(n.Fragment,{children:[N.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("h3",{className:m().orders_section,children:"Сейчас готовится"}),N.map(k)]}),O.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("h3",{className:m().orders_section,children:"История"}),O.map(k)]})]}):(0,n.jsx)(i.HY,{description:"У вас пока нет заказов",linkText:"",url:""})}),(0,n.jsx)(d.Z,{open:u,onCancel:()=>h(!1),footer:[(0,n.jsx)(o.Btn.Standart,{onClick:()=>h(!1),children:"Закрыть"},"close")],children:(0,n.jsx)("div",{style:{textAlign:"center"},children:(0,n.jsx)("p",{children:"Заказ успешно отменён"})})})]})})};t.default=(0,u.Z)(w,"Загрузка...",a.Z)},1811:function(e){e.exports={layout:"ProfileLayout_layout__mQlfR"}},93434:function(e){e.exports={orders:"orders_orders__WNNfa",orders_section:"orders_orders_section__USACq",orders_list:"orders_orders_list__aZ86U",orders_item:"orders_orders_item__QyHuu",orders_item_cancelled:"orders_orders_item_cancelled___VaXg",orders_item_top:"orders_orders_item_top__mVGdg",orders_item_number:"orders_orders_item_number__fk6kg",orders_item_business:"orders_orders_item_business__J8MCq",orders_item_badge:"orders_orders_item_badge__ZB56X",orders_item_steps:"orders_orders_item_steps__PXTOZ",orders_item_stepWrap:"orders_orders_item_stepWrap__lan03",orders_item_line:"orders_orders_item_line__OMuF3",orders_item_line_done:"orders_orders_item_line_done__uZhgM",orders_item_step:"orders_orders_item_step__gNcT4",orders_item_stepDot:"orders_orders_item_stepDot__RqFEi",orders_item_stepLabel:"orders_orders_item_stepLabel__vL7JC",orders_item_info:"orders_orders_item_info__uqweE",orders_item_lines:"orders_orders_item_lines__JRQyq",orders_item_addon:"orders_orders_item_addon__aO_eH",orders_item_total:"orders_orders_item_total__l3MGl",orders_item_cancel:"orders_orders_item_cancel__Tjh5R",badge_pending:"orders_badge_pending__uzVEt",badge_confirmed:"orders_badge_confirmed__Y9GHl",badge_completed:"orders_badge_completed__GY0LO",badge_cancelled:"orders_badge_cancelled__HZBpG",step_done:"orders_step_done__M3Clx",step_active:"orders_step_active__uypMx"}}},function(e){e.O(0,[9099,9774,2888,179],function(){return e(e.s=49578)}),_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.