PageSourceSearch

https://kuber.ru/_next/static/chunks/4222-98dc6b4b1a2821bd.js

js kuber.ru collected 2026-10-07 18:20:33 UTC 67,821 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4222],{83099:function(e,n,t){t.d(n,{Z:function(){return i.Z}});var i=t(36180)},43174:function(e,n,t){t.d(n,{r:function(){return r}});var i=t(85893),r=function(e){var n=e.checked,t=e.onChange;return(0,i.jsx)("div",{className:"flex cursor-pointer items-center gap-2",onClick:function(){return t(!n)},children:n?(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"36",height:"20",viewBox:"0 0 36 20",fill:"none",children:[(0,i.jsx)("path",{d:"M0 10C0 6.68629 2.68629 4 6 4H30C33.3137 4 36 6.68629 36 10C36 13.3137 33.3137 16 30 16H6C2.68629 16 0 13.3137 0 10Z",fill:"#79D0FB"}),(0,i.jsx)("rect",{x:"18",y:"1",width:"18",height:"18",rx:"9",fill:"#2196F3"})]}):(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"36",height:"20",viewBox:"0 0 36 20",fill:"none",children:[(0,i.jsx)("path",{d:"M0 10C0 6.68629 2.68629 4 6 4H30C33.3137 4 36 6.68629 36 10C36 13.3137 33.3137 16 30 16H6C2.68629 16 0 13.3137 0 10Z",fill:"#D0D6E0"}),(0,i.jsx)("rect",{y:"1",width:"18",height:"18",rx:"9",fill:"#E5E9F0"})]})})}},23112:function(e,n,t){t.d(n,{nE:function(){return l},qX:function(){return a},xX:function(){return o}});var i,r=t(14924),o={isEdgePoint:!1,isFirstPoint:!1,isLastPoint:!1,pointType:"address",city:null,terminal:null,release:null,stock:null,instruction:null,dateTime:"",address:null,action:null,consigneeInn:null,shipperInn:null,clientInn:null},l=[{isEdgePoint:!0,isFirstPoint:!0,isLastPoint:!1,pointType:"terminal",city:null,terminal:null,release:null,stock:null,instruction:null,dateTime:"",address:null,action:null,consigneeInn:null,shipperInn:null,clientInn:null},{isEdgePoint:!0,isFirstPoint:!1,isLastPoint:!0,pointType:"terminal",city:null,terminal:null,release:null,stock:null,instruction:null,dateTime:"",address:null,action:null,consigneeInn:null,shipperInn:null}],a={cargos:[{name:"",cost:"",weight:"",containerHeight:null,containerNumber:"",zpu:""}],points:[{isEdgePoint:!0,isFirstPoint:!0,isLastPoint:!1,pointType:"terminal",city:null,terminal:null,release:null,stock:null,instruction:null,dateTime:"",address:null,action:null,consigneeInn:null,shipperInn:null,clientInn:null},{isEdgePoint:!1,isFirstPoint:!1,isLastPoint:!1,pointType:"address",city:null,terminal:null,release:null,stock:null,instruction:null,dateTime:"",address:null,action:null,consigneeInn:null,shipperInn:null,clientInn:null},{isEdgePoint:!0,isFirstPoint:!1,isLastPoint:!0,pointType:"terminal",city:null,terminal:null,release:null,stock:null,instruction:null,dateTime:"",address:null,action:null,consigneeInn:null,shipperInn:null}],containerType:null,pickupCity:null,pickupTerminal:null,deliveryCity:null,deliveryTerminal:null,warehouseAddress:null,warehouseCompanyInn:null,warehouseDeliveryDate:"",warehouseDeliveryTimePeriod:null,warehouseContacts:[{name:"",phone:""}],howToCarry:null,paymentType:"deferral_20",deliveryDateFrom:"",deliveryDateTo:"",additionalInfo:"",options:[],dangerClass:"",temperatureFrom:"",temperatureTo:"",shipperInn:null,consigneeInn:null,clientInn:null,requireClientInn:!1,promo:null,manyTn:null,withCargo:!0},s="overload",c="payment_type",u="promo_code";i={},(0,r.Z)(i,s,"\u0421\u0432\u0435\u0440\u0445\u043d\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430"),(0,r.Z)(i,c,"\u0421\u043a\u0438\u0434\u043a\u0430 \u0437\u0430 \u043f\u0440\u0435\u0434\u043e\u043f\u043b\u0430\u0442\u0443"),(0,r.Z)(i,u,"\u0421\u043a\u0438\u0434\u043a\u0430 \u043f\u043e \u043f\u0440\u043e\u043c\u043e-\u043a\u043e\u0434\u0443")},37991:function(e,n,t){t.d(n,{V:function(){return o},p:function(){return r}});var i=t(85893),r=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",className:"stroke-primary group-hover:stroke-hover group-active:stroke-active",children:(0,i.jsx)("path",{d:"M12.0107 5.22461V19.2246M5.01074 12.2246H19.0107",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},o=function(e){var n=e.className;return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",className:n||"stroke-primary group-hover:stroke-hover group-active:stroke-active",children:(0,i.jsx)("path",{d:"M3.3335 8.45312H12.6668",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}},35589:function(e,n,t){t.d(n,{t:function(){return C}});var i=t(85893),r=t(67294),o=t(87536),l=t(84749),a=t(26042),s=t(69396),c=t(77309),u=t
1(31059),d=t(41866),p=t(44250),v=t(79863),f=t(26493),m=t(86010),h=t(72827),g=t(37991),x={cont20_any_plat:"\u0422\u043e\u043b\u044c\u043a\u043e \u043d\u0430 20-\u0444\u0443\u0442\u043e\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435",cont20_cut40plat:"\u041f\u043e\u0434 \u0441\u0440\u0435\u0437 \u043d\u0430 40-\u0444\u0443\u0442\u043e\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435",cont20_middle40plat:"\u041f\u043e\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u043d\u0430 40-\u0444\u0443\u0442\u043e\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0441 \u043f\u043e\u043b\u043e\u043c",cont20_middle_any_plat:"\u041f\u043e\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 "},w={cont20_any_plat:"\u041f\u0435\u0440\u0435\u0432\u043e\u0437\u043a\u0430 20-\u0444\u0443\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043d\u0430 \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u043c 20-\u0444\u0443\u0442\u043e\u0432\u043e\u043c \u043f\u043e\u043b\u0443\u043f\u0440\u0438\u0446\u0435\u043f\u0435.",cont20_cut40plat:"\u041f\u0435\u0440\u0435\u0432\u043e\u0437\u043a\u0430 20-\u0444\u0443\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043d\u0430 40-\u0444\u0443\u0442\u043e\u0432\u043e\u043c \u043f\u0440\u0438\u0446\u0435\u043f\u0435 \u0441\xa0\u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u043d\u0430 \u043a\u0440\u0430\u0439 (\u043f\u043e\u0434 \u0441\u0440\u0435\u0437).",cont20_middle40plat:"\u041f\u0435\u0440\u0435\u0432\u043e\u0437\u043a\u0430 20-\u0444\u0443\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043d\u0430 40-\u0444\u0443\u0442\u043e\u0432\u043e\u043c \u043f\u0440\u0438\u0446\u0435\u043f\u0435 \u0441 \u043f\u043e\u043b\u043e\u043c, \u0441 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u043d\u0430 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0443 \u043f\u043e\u043b\u0443\u043f\u0440\u0438\u0446\u0435\u043f\u0430 \u0441 \u043f\u043e\u043b\u043e\u043c.",cont20_middle_any_plat:"\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043d\u0435\u0442."},j={0:"cont20_any_plat",1:"cont20_cut40plat",2:"cont20_middle40plat",3:"cont20_middle_any_plat"},y=function(e){var n=e.cargoIndex,t=e.length,l=e.withCargo,y=e.showHowToCarry,C=void 0===y||y,T=e.showContainerNumber,Z=void 0===T||T,k=e.showCargoDetailsToggle,I=void 0===k||k,_=e.showZpuToggle,S=void 0===_||_,b=e.tariffMode,P=void 0!==b&&b,D=(0,o.Gc)(),E=D.watch,F=D.control,M=D.setValue,H=(0,r.useState)(0),V=H[0],q=H[1],z=(0,r.useState)((function(){return!!E("cargos.".concat(n,".name"))||!!E("cargos.".concat(n,".cost"))})),L=z[0],U=z[1],Q=(0,r.useState)((function(){return!!E("cargos.".concat(n,".zpu"))})),A=Q[0],O=Q[1],B=E("containerType"),R=E("howToCarry"),W=(0,v.qK)(),J=(0,v.Ng)({containerType:null===B||void 0===B?void 0:B.value}),G=J.isHowToCarryRequired,$=J.howToCarryOptions,Y=(0,f.Jk)().data;(0,r.useEffect)((function(){C||M("howToCarry",null)}),[M,C]),(0,r.useEffect)((function(){I||(U(!1),M("cargos.".concat(n,".cost"),""),M("cargos.".concat(n,".name"),""))}),[n,M,I]),(0,r.useEffect)((function(){S||(O(!1),M("cargos.".concat(n,".zpu"),""))}),[n,M,S]);var K,X,ee=function(){q(3!==V?V+1:0)};return(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)("h4",{className:"text-textMediumSemi",children:t>1?"\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u2116".concat(n+1):"\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsxs)("div",{className:(0,m.Z)("grid w-full grid-cols-1 gap-3 tablet:w-fit tablet:grid-cols-3 desktop:grid-cols-4 at1920:grid-cols-6",{}),children:[0===n&&(0,i.jsx)("div",{className:"w-full tablet:w-[230px]","data-testid":"container-type-select-wrapper",children:(0,i.jsx)(o.Qr,{control:F,name:"containerType",render:function(e){var n,t=e.field,r=e.fieldState;return(0,i.jsx)(d.Z,(0,s.Z)((0,a.Z)({},t),{instanceId:"container-type",options:W,placeholder:"\u0422\u0438\u043f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 *",error:null===(n=r.error)||void 0===n?void 0:n.message,id:"containerType",required:!P}))},shouldUnregister:!0,rules:{required:{value:!0,message:"\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435"}}})}),(0,i.jsx)(o.Qr,{control:F,name:"cargos.".concat(n,".containerHeight"),render:function(e){var t,r=e.field,o=e.fieldState;return(0,i.jsx)(d.Z,(0,s.Z)((0,a.Z)({},r),{instanceId:"container-height-".concat(n),options:null===Y||void 0===Y?void 0:Y.containerHeights,placeholder:"\u0412\u044b\u0441\u043e\u0442\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 *",error:null===(t=o.error)||void 0===t?void 0:t.message,id:"containerHeight-".concat(n),className:"w-full tablet:w-[230px]",required:!P}))},rules:{required:{value:!0,message:"\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435"}},shouldUnregister:!0}),0===n&&C&&G&&(0,i.jsx)("div",{className:"w-full tablet:col-span-2 tablet:w-[470px]","data-testid":"how-to-carry-select-wrapper",children:(0,i.jsx)(o.Qr,{control:F,name:"howToCarry",render:function(e){var n,t=e.field,r=e.fieldState;return(0,i.jsx)(d.Z,(0,s.Z)((0,a.Z)({},t),{instanceId:"how-to-carry-option",options:$,placeholder:"\u041a\u0430\u043a \u0432\u0435\u0437\u0442\u0438 *",error:null===(n=r.error)||void 0===n?void 0:n.message,id:"howToCarry",leftIcon:(0,i.jsx)(p.Z,{isCompound:!R,onClick:ee,
1icon:(0,i.jsx)(N,{}),placement:"bottom",iconClassName:"h-6 w-6",tooltipClassName:"!-right-[490%] !top-[220%] after:!-ml-[130px] z-10",children:(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsx)("p",{className:"text-textSmallSemi",children:R?x[R.value]:x[j[V]]}),(0,i.jsx)("p",{className:"",children:R?w[R.value]:w[j[V]]})]})})}))},shouldUnregister:!0,rules:{required:{value:!0,message:"\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435"}}})}),Z&&(0,i.jsx)(o.Qr,{control:F,name:"cargos.".concat(n,".containerNumber"),render:function(e){var t,r=e.field,o=e.fieldState;return(0,i.jsx)(c.Z,(0,s.Z)((0,a.Z)({},r),{fieldValue:r.value,placeholder:"\u041d\u043e\u043c\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430",maxLength:11,error:null===(t=o.error)||void 0===t?void 0:t.message,id:"containerNumber-".concat(n),className:"w-full tablet:w-[230px]",value:null!==(K=r.value)&&void 0!==K?K:"",onChange:function(e){var n=e.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"");if(n.length>0){var t=n.slice(0,3).replace(/[^A-Z]/g,""),i="";n.length>=4&&(n[3],i="U");var o=n.slice(4).replace(/[^0-9]/g,"");n=t+(i||"")+o}n.length<=11&&r.onChange(n)},onKeyPress:function(e){var n=e.currentTarget.selectionStart||0;n<3?/[A-Za-z]/.test(e.key)||e.preventDefault():3===n?"U"!==e.key.toUpperCase()&&e.preventDefault():/[0-9]/.test(e.key)||e.preventDefault()},onPaste:function(e){var n=e.clipboardData.getData("text").toUpperCase().trim();/^[A-Z]{0,3}U?[0-9]*$/.test(n)||e.preventDefault()},leftIcon:(0,i.jsx)(p.Z,{icon:(0,i.jsx)(N,{}),placement:"bottom",iconClassName:"h-6 w-6",tooltipClassName:"!-right-[490%] !top-[220%] after:!-ml-[130px] !z-[5000]",children:"\u041f\u043e\u043b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443 AAAU0000000, \u0433\u0434\u0435 A \u2014 \u0431\u0443\u043a\u0432\u0430 \u0438\u0437 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 A\u2013Z, U \u2014 \u0431\u0443\u043a\u0432\u0430 U, 0 \u2014 \u043b\u044e\u0431\u0430\u044f \u0446\u0438\u0444\u0440\u0430"})}))},rules:{required:!1}}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.Qr,{control:F,name:"cargos.".concat(n,".weight"),render:function(e){var t,r=e.field,o=e.fieldState;return(0,i.jsx)(c.Z,(0,s.Z)((0,a.Z)({},r),{fieldValue:r.value,placeholder:"\u0412\u0435\u0441 \u0433\u0440\u0443\u0437\u0430 (\u043a\u0433)",error:null===(t=o.error)||void 0===t?void 0:t.message,id:"weight-".concat(n),className:"w-full tablet:w-[230px]",value:null!==(X=r.value)&&void 0!==X?X:"",rightIcon:P?(0,i.jsx)(h.Z,{}):void 0,resetField:P?function(){return M("cargos.".concat(n,".weight"),"")}:void 0,onChange:function(e){if(""===e.target.value)return r.onChange(e.target.value);var n=e.target.value.replace(/\s+/g,""),t=Number(n).toLocaleString("en-US").replace(/,/g," ");r.onChange(t)},onKeyPress:function(e){/[0-9]/.test(e.key)||e.preventDefault()},onPaste:function(e){/^[0-9 ]*$/.test(e.clipboardData.getData("text"))||e.preventDefault()},leftIcon:(0,i.jsx)(p.Z,{icon:(0,i.jsx)(N,{}),placement:"bottom",iconClassName:"h-6 w-6",tooltipClassName:"!-right-[490%] !top-[220%] after:!-ml-[130px] !z-[5000]",children:"\u0412\u0435\u0441 \u0433\u0440\u0443\u0437\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u041d\u0435\u0442\u0442\u043e \u2014 \u044d\u0442\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u0435\u0441 \u0433\u0440\u0443\u0437\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442 \u0431\u0435\u0437 \u0443\u0447\u0435\u0442\u0430 \u0432\u0435\u0441\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u0412 \u0432\u0435\u0441 \u043d\u0435\u0442\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 (\u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0439) \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0438\u043c\u0435\u0435\u0442\u0441\u044f."})}))},shouldUnregister:!0,rules:{required:!1}}),L&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.Qr,{control:F,name:"cargos.".concat(n,".cost"),render:function(e){var n=e.field;return(0,i.jsx)(u.Y2,(0,s.Z)((0,a.Z)({},n),{fieldValue:n.value,placeholder:"\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0433\u0440\u0443\u0437\u0430 (\u0440\u0443\u0431)",thous
1andsSeparator:" ",radix:".",className:"w-full tablet:w-[230px]"}))},shouldUnregister:!0}),(0,i.jsx)(o.Qr,{control:F,name:"cargos.".concat(n,".name"),render:function(e){var n=e.field;return(0,i.jsx)(c.Z,(0,s.Z)((0,a.Z)({},n),{fieldValue:n.value,placeholder:"\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0443\u0437\u0430",className:"w-full tablet:col-span-2 tablet:w-[470px]"}))},shouldUnregister:!0})]})]}),S&&A&&(0,i.jsx)(o.Qr,{control:F,name:"cargos.".concat(n,".zpu"),render:function(e){var t,r=e.field,o=e.fieldState;return(0,i.jsx)(c.Z,(0,s.Z)((0,a.Z)({},r),{fieldValue:r.value,placeholder:"\u0417\u041f\u0423",maxLength:10,error:null===(t=o.error)||void 0===t?void 0:t.message,"data-testid":"zpu-input-wrapper",id:"zpu-".concat(n),className:"w-full tablet:w-[230px]"}))},shouldUnregister:!0})]}),l&&(I||S)&&(0,i.jsxs)("div",{className:"flex gap-5",children:[I&&(0,i.jsxs)("div",{className:"group flex w-fit cursor-pointer items-center gap-1.5",onClick:function(){return U(!L)},children:[(0,i.jsx)("div",{className:"flex h-6 w-6 items-center justify-center",children:L?(0,i.jsx)(g.V,{className:"stroke-primaryText"}):(0,i.jsx)(g.p,{})}),(0,i.jsx)("p",{className:"text-textSmallSemi ".concat(L?"text-primaryText":"text-primary group-hover:text-hover group-active:text-active"),children:L?"\u0421\u043a\u0440\u044b\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0433\u0440\u0443\u0437\u0435":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0433\u0440\u0443\u0437\u0435"})]}),S&&(0,i.jsxs)("div",{className:"group flex w-fit cursor-pointer items-center gap-1.5",onClick:function(){return O(!A)},children:[(0,i.jsx)("div",{className:"flex h-6 w-6 items-center justify-center",children:A?(0,i.jsx)(g.V,{className:"stroke-primaryText"}):(0,i.jsx)(g.p,{})}),(0,i.jsx)("p",{className:"text-textSmallSemi ".concat(A?"text-primaryText":"text-primary group-hover:text-hover group-active:text-active"),children:A?"\u0421\u043a\u0440\u044b\u0442\u044c \u0417\u041f\u0423":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0417\u041f\u0423"})]})]})]})]})},N=function(){return(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",className:"z-10 stroke-disabled hover:cursor-pointer hover:stroke-secondaryText",children:[(0,i.jsx)("path",{d:"M12.7031 22.7246C18.226 22.7246 22.7031 18.2475 22.7031 12.7246C22.7031 7.20176 18.226 2.72461 12.7031 2.72461C7.18028 2.72461 2.70312 7.20176 2.70312 12.7246C2.70312 18.2475 7.18028 22.7246 12.7031 22.7246Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M12.7031 16.7246V12.7246",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M12.7031 8.72461H12.7131",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})},C=function(e){var n=e.withCargo,t=e.showHowToCarry,a=void 0===t||t,s=e.showContainerNumber,c=void 0===s||s,u=e.showCargoDetailsToggle,d=void 0===u||u,p=e.showZpuToggle,v=void 0===p||p,f=e.tariffMode,m=void 0!==f&&f,h=(0,o.Gc)(),g=h.watch,x=h.control,w=(0,o.Dq)({control:x,name:"cargos",shouldUnregister:!1}),j=w.fields,N=w.append,C=w.remove,T=g("containerType");return(0,r.useEffect)((function(){if((null===T||void 0===T?void 0:T.value)!==l.mJ["2x20f"]||1!==j.length){if((null===T||void 0===T?void 0:T.value)!==l.mJ["2x20f"]||2!==j.length){if(2!==j.length)return function(){2===j.length&&C(1)};C(1)}}else N({})}),[null===T||void 0===T?void 0:T.value]),(0,i.jsx)(i.Fragment,{children:j.map((function(e,t){return(0,i.jsx)(y,{cargoIndex:t,length:j.length,withCargo:n,showHowToCarry:a,showContainerNumber:c,showCargoDetailsToggle:d,showZpuToggle:v,tariffMode:m},e.id)}))})}},71562:function(e,n,t){t.d(n,{Z:function(){return le}});var i,r=t(85893),o=t(67294),l=t(87536),a=t(26042),s=t(69396),c=t(89570),u=t(83099),d=t(19617),p=t(77309),v=t(41866),f=t(79295),m=t(32217),h=t(67327),g=t(44250),x=t(43174),w=t(79863),j=t(26493),y=t(75661),N=t(88364),C=t(72827),T=t(65511),Z=function(){var e=(0,o.useState)(!1),n=e[0],t=e[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{onClick:function(){return t(!0)},className:"group flex cursor-pointer items-center gap-2 rounded-md bg-bgDisabled px-3 py-0.5 hover:bg-bg active:bg-divider",children:[(0,r.jsx)(k,{}),(0,r.jsx)("p",{className:"text-textSmall !leading-[24px] text-secondaryText group-active:text-primaryText",children:"\u0421\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u0422\u041d"})]}),n&&(0,r.jsxs)(T.ZP,{open:!0,onClose:function(){t(!1)},className:"h-fit max-h-[90%] w-[70%] max-w-[90%] overflow-y-hidden !rounded-xl",children:[(0,r.jsx)(T.xB,{onClose:function(){t(!1)},children:"\u041f\u0440\u0438\u043c\u0435\u0440 \u0432 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u043e\u0439 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u043e\u0439"}),(0,r.jsxs)("div",{className:"flex w-full flex-grow flex-col",children:[(0,r.jsx)("label",{className:"text-textSmall",children:"\u0413\u0440\u0443\u0437\u043e\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044c \u2014 \u043f\u0443\u043d\u043a\u0442 1, \u0413\u0440\u0443\u0437\u043e\u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044c \u2014 \u043f\u0443\u043d\u043a\u0442 2, \u041a\u043b\u0438\u0435\u043d\u0442 \u2014 \u043f\u0443\u043d\u043a\u0442 1\u0430"}),(0,r.jsx)("div",{className:"-mx-1 mt-3",children:(0,r.jsx)("img",{src:"/images/examples/TN-2.png",className:"object-cover"})})]})]})]})},k=function(){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"stroke-secondaryText group-active:stroke-primaryText",children:[(0,r.jsxs)("g",{"clip-path":"url(#clip0_11145_123062)",children:[(0,r.jsx)("path",{d:"M8.37199 15.1185C12.0539 15.1185 15.0387 12.1337 15.0387 8.45182C15.0387 4.76992 12.0539 1.78516 8.37199 1.78516C4.69009 1.78516 1.70532 4.76992 1.70532 8.45182C1.70532 12.1337 4.69009 15.1185 8.37199 15.1185Z","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,r.jsx)("path",{d:"M6.43213 6.4535C6.58886 6.00795 6.89823 5.63224 7.30543 5.39293C7.71263 5.15361 8.19139 5.06613 8.65691 5.14598C9.12243 5.22583 9.54467 5.46785 9.84885 5.82919C10.153 6.19053 10.3195 6.64785 10.3188 7.12017C10.3188 8.45351 8.3188 9.12017 8.3188 9.12017","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,r.jsx)("path",{d:"M8.37207 11.7852H8.37874","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_11145_123062",children:(0,r.jsx)("rect",{width:"16",height:"16",fill:"white",transform:"translate(0.37207 0.453125)"})})})]})}
1,I=t(37991),_=t(14924),S=t(99534),b=t(47544),P=t(84916),D=t(96719),E=t(68736),F=t(12813),M=t(47568),H=t(20414),V=t(84954),q=t(8226),z=t(1644),L=t(24463),U=t(86010),Q=t(13567),A=function(e){var n=e.value,t=e.onChange,i=e.isFormDiscarded,c=e.valuePiece,u=e.isHandInputChanged,d=e.setIsHandInputChanged,p=e.timeValues,v=e.setTimeValues,f=e.isFocused,m=e.isAdmin,h=(0,z.P)({defaultValues:{date:(0,E.gq)(n||new Date),time:n?(0,E.RH)((0,E.gs)(n)):D.C}}),g=h.control,x=h.trigger,w=h.formState,j=h.getValues,y=h.setValue;h.formState.errors;(0,o.useEffect)((function(){if(c){if(w.dirtyFields.time){y("date",(0,E.gq)(c));var e=j("time"),n=(0,E.lL)(e,c);t(n)}w.dirtyFields.time||(y("date",(0,E.gq)(c)),y("time",(0,E.RH)((0,E.gs)(c))))}}),[c]),(0,o.useEffect)((function(){y("time",f?p.single:D.C)}),[i]);var N=function(){var e=(0,M.Z)((function(){var e,i;return(0,H.__generator)(this,(function(r){switch(r.label){case 0:return[4,x("date")];case 1:return r.sent()?(e=j("date"),i=e.split("."),null===n||void 0===n||n.setDate(parseInt(i[0])),null===n||void 0===n||n.setMonth(parseInt(i[1])-1),null===n||void 0===n||n.setFullYear(parseInt(i[2])),t(n),d(!u),[2]):[2]}}))}));return function(){return e.apply(this,arguments)}}(),C=function(){var e=(0,M.Z)((function(){var e,i;return(0,H.__generator)(this,(function(r){switch(r.label){case 0:return[4,x("time")];case 1:return r.sent()?(e=j("time"),v((0,s.Z)((0,a.Z)({},p),{single:e})),i=e.split(":"),null===n||void 0===n||n.setHours(parseInt(i[0])),null===n||void 0===n||n.setMinutes(parseInt(i[1])),null===n||void 0===n||n.setSeconds(0),t(n),d(!u),[2]):[2]}}))}));return function(){return e.apply(this,arguments)}}();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex w-full",children:[(0,r.jsx)(l.Qr,{control:g,name:"date",render:function(e){var n=e.field,t=e.fieldState;return(0,r.jsx)(V.W,(0,s.Z)((0,a.Z)({},n),{isDirty:t.isDirty,isTouched:t.isTouched,fieldValue:n.value,name:n.name,autoComplete:"off","data-testid":"single-date-input",inputStyles:"!rounded-l-xl hover:z-10 focus:z-10 !rounded-r-none !w-[160px] !py-2 !h-fit !text-textBody",onValueChange:N}))},rules:{required:{value:!0,message:"\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435"},pattern:{value:L.Yo,message:"\u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u0442\u044b"}}}),(0,r.jsx)(l.Qr,{control:g,name:"time",render:function(e){var n=e.field,t=e.fieldState;return(0,r.jsx)(q.M,(0,s.Z)((0,a.Z)({},n),{isDirty:t.isDirty,isTouched:t.isTouched,fieldValue:n.value,autoComplete:"off","data-testid":"single-time-input",inputStyles:"!rounded-r-xl hover:z-10 focus:z-10 !rounded-l-none !-ml-1 !w-full !py-2 !h-fit !text-textBody",onValueChange:C}))},rules:{required:{value:!0,message:"\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435"},pattern:{value:L.Q6,message:"\u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438"}}})]}),w.errors.date&&!w.errors.time&&(0,r.jsx)("label",{className:(0,U.Z)("text-left text-textBody text-error-dark"),children:w.errors.date.message}),w.errors.time&&!w.errors.date&&(0,r.jsx)("label",{className:(0,U.Z)("text-left text-textBody text-error-dark"),children:w.errors.time.message}),w.errors.date&&w.errors.time&&(0,r.jsx)("label",{className:(0,U.Z)("text-left text-textBody text-error-dark"),children:"\u041e\u0448\u0438\u0431\u043a\u0430 \u0434\u0430\u0442\u044b \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438"})]}),(0,r.jsx)(Q.Z,{"data-testid":"date-picker",minDate:m?void 0:new Date,id:"date-picker-input",className:"date-picker-input",onChange:function(e){Array.isArray(e)?t(e[0]||null):t(e)},value:n,isOpen:!0,locale:"ru-RU",calendarClassName:"single-mode"})]})},O=t(84749),B=t(27484),R=t.n(B),W=t(29387),J=t.n(W),G=t(70178),$=t.n(G),Y=t(69293);R().extend($()),R().extend(J());var K=(i={},(0,_.Z)(i,O.VS.LOCAL_TIME,"\u0423\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043c\u0435\u043d\u044c\u0448\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438"),(0,_.Z)(i,O.VS.EIGHT_HOURS_FROM_LOCAL_TIME,"\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0437\u0430\u043a\u0430\u0437 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0440\u0430\u043d\u044c\u0448\u0435 4 \u0447\u0430\u0441\u043e\u0432 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438"),i),X=o.forwardRef((function(e,n){e.rightIcon;var t=e.onFocus,i=e.placeholder,c=e.customWidth,u=e.isHandInputChanged,d=e.setIsHandInputChanged,p=e.invalidDate,v=e.setInvalidDate,f=e.fieldName,m=e.setIsRendered,h=e.isRendered,g=e.dateInputValue,x=e.onChangeDateInput,w=e.id,j=((0,S.Z)(e,["rightIcon","onFocus","placeholder","customWidth","isHandInputChanged","setIsHandInputChanged","invali
1dDate","setInvalidDate","fieldName","setIsRendered","isRendered","dateInputValue","onChangeDateInput","id"]),(0,o.useState)(!1)),y=j[0],N=j[1],T=(0,o.useState)(!1),Z=(T[0],T[1],(0,o.useState)(!1)),k=(Z[0],Z[1],(0,o.useState)(!1)),I=k[0],_=k[1],M=(0,o.useState)(!1),H=M[0],V=M[1],q=(0,o.useRef)(null),z=(0,o.useState)(!0),L=z[0],U=z[1],Q=(0,o.useState)({single:D.C}),O=Q[0],B=Q[1],W=(0,l.Gc)(),J=W.control,G=W.getValues,$=W.resetField,X=W.setValue;(0,Y.Z)(q,(function(e){null===e||void 0===e||e.stopPropagation(),null===e||void 0===e||e.preventDefault(),N(!1)}));var ee=function(e){null!==e&&(e.stopPropagation(),e.preventDefault()),U(!0),x(new Date),X(f,(0,E.c2)(new Date)),_(!I),setTimeout((function(){U(!1)}),0)};(0,o.useEffect)((function(){if(!L&&g){var e=(0,E.lL)(O.single,g);X(f,(0,E.fY)(e))}}),[u]),(0,o.useEffect)((function(){h||(ie(),m(!0))}),[]);var ne,te=function(e){var n=G(f);if(n){var i=n.split(" ");B((0,s.Z)((0,a.Z)({},O),{single:i[1]}))}else X(f,(0,E.c2)(g));V(!0),U(!1),N(!0),setTimeout((function(){V(!1)}),0),t&&t(e)},ie=function(){U(!0),v(null),N(!1),$(f),x(new Date)},re=function(e){e.stopPropagation(),e.preventDefault(),N(!1)},oe=(ne=g)&&"object"===typeof ne&&"string"===typeof ne.timezone&&""!==ne.timezone.trim()?ne.timezone:null,le=function(e,n){if(!e)return null;var t=R()(e);if(!n)return t.toDate();var i=function(e){var n=e.match(/^UTC([+-]?\d{1,2})$/);return n?60*parseInt(n[1],10):null}(n);return null!==i?t.utcOffset(i).toDate():t.tz(n).toDate()}(g,oe);return(0,r.jsx)(l.Qr,{control:J,name:f,render:function(e){var n,t=e.field,o=e.fieldState;return(0,r.jsxs)("div",{className:"relative w-full",children:[(0,r.jsx)(P.Z,(0,s.Z)((0,a.Z)({"data-testid":"combo-input",placeholder:i||"\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f"},t),{rightIcon:(0,r.jsx)(C.Z,{}),resetField:ie,error:(null===(n=o.error)||void 0===n?void 0:n.message)||null===p?void 0:K[p],isDirty:o.isDirty,isTouched:o.isTouched,fieldValue:t.value,onFocus:te,onSpecialIconClick:te,specialIcon:(0,r.jsx)(F.Z,{}),disabled:y,dateTimePicker:!0,id:w||"warehouseDeliveryDate",withInterval:!1,customWidth:c})),y&&(0,r.jsxs)("div",{"data-testid":"calendar-window",ref:q,id:"calendar",className:"absolute right-[39%] !z-[5000] mt-1 flex w-[284px] translate-x-1/2 flex-col gap-4 roun
1ded-xl bg-white p-4 shadow-[0_6px_32px_8px_rgba(126,139,153,0.20)]",children:[(0,r.jsx)(A,{value:g,onChange:x,isFormDiscarded:I,valuePiece:le,isHandInputChanged:u,setIsHandInputChanged:d,timeValues:O,setTimeValues:B,isFocused:H}),(0,r.jsx)("div",{className:"w-full border-b border-b-divider"}),(0,r.jsxs)("div",{className:"flex w-full justify-center gap-2",children:[(0,r.jsx)(b.Z,{size:"small",fullWidth:!0,onClick:re,"data-testid":"save-button",children:"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c"}),(0,r.jsx)(b.Z,{variant:"outline",fullWidth:!0,size:"small",onClick:ee,"data-testid":"discard-button",children:"\u0421\u0431\u0440\u043e\u0441\u0438\u0442\u044c"})]})]})]})},rules:{required:{value:!0,message:"\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435"}}})})),ee=t(91550),ne=t(86501),te=function(e){var n,t,i,T,k,_,S,b=e.pointIndex,P=e.length,D=e.appendPoint,E=e.removePoint,F=e.insertPoint,M=e.pointsFields,H=e.invalidDate,V=e.setInvalidDate,q=(e.withCargo,e.tariffMode),z=void 0!==q&&q,L=(0,l.Gc)(),U=L.watch,Q=L.control,A=L.setValue,O=(0,o.useState)((function(){return new Date})),B=O[0],R=O[1],W=(0,o.useState)(!1),J=W[0],G=W[1],$=(0,o.useState)(!1),Y=$[0],K=$[1],te=(0,o.useState)((function(){var e=U("points.".concat(b,".name")),n=U("points.".concat(b,".phone"));return!(!e&&!n)})),re=te[0],oe=te[1],le=(0,o.useState)((function(){return!!U("points.".concat(b,".warehouseInn"))})),ae=le[0],se=le[1],ce=(0,o.useState)((function(){var e=U("points.".concat(b,".instruction")),n=U("points.".concat(b,".release")),t=U("points.".concat(b,".stock"));return!!(e||n||t)})),ue=ce[0],de=ce[1],pe=(0,o.useState)((function(){return!!U("points.".concat(b,".dateTime"))})),ve=pe[0],fe=pe[1],me=U("points.".concat(b,".address")),he=P>1,ge=null!==(i=U("points.".concat(b,".pointType")))&&void 0!==i?i:"address",xe="terminal"===ge,we=null!==(T=U("points.".concat(b,".isEdgePoint")))&&void 0!==T&&T,je=null!==(k=U("points.".concat(b,".isFirstPoint")))&&void 0!==k&&k,ye=null!==(_=U("points.".concat(b,".isLastPoint")))&&void 0!==_&&_,Ne=U("points.".concat(b,".action")),Ce="unloading"===(null===Ne||void 0===Ne?void 0:Ne.value)||"loading"===(null===Ne||void 0===Ne?void 0:Ne.value),Te=!xe&&Ce,Ze=!z&&(ve||Te),ke=we&&!xe,Ie=!z&&(xe||ke),_e=je?"\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435":ye?"\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u0441\u0434\u0430\u0447\u0435":"\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f",Se=ue?je?"\u0421\u043a\u0440\u044b\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u043e \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435":ye?"\u0421\u043a\u0440\u044b\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u043e \u0441\u0434\u0430\u0447\u0435":"\u0421\u043a\u0440\u044b\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e":je?"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u043e \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435":ye?"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u043e \u0441\u0434\u0430\u0447\u0435":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e",be=!xe&&(je||ye),Pe=(0,o.useMemo)((function(){return M.filter((function(e,n){return!U("points.".concat(n,".isEdgePoint"))})).length}),[M,U]),De=((0,o.useMemo)((function(){return M.filter((function(e,n){return U("points.".concat(n,".isEdgePoint"))})).length}),[M,U]),U("points")),Ee=(0,o.useMemo)((function(){if(!De||0===b)return!1;for(var e=0;e<b;e++){var n=De[e];if(n){var t,i,r="terminal"===(null!==(t=n.pointType)&&void 0!==t?t:"address"),o=null!==(i=n.isEdgePoint)&&void 0!==i&&i,l=n.action;if(!r&&!o&&("loading"===(null===l||void 0===l?void 0:l.value)||"unloading"===(null===l||void 0===l?void 0:l.value)))return!0}}return!1}),[De,b]),Fe=(0,o.useMemo)((function(){if(!De)return!1;if(we||"loading"!==(null===Ne||void 0===Ne?void 0:Ne.value)&&"unloading"!==(null===Ne||void 0===Ne?void 0:Ne.value))return!1;for(var e=0;e<b;e++){var n=De[e];if(n){var t,i=null!==(t=n.isEdgePoint)&&void 0!==t&&t,r=n.action;if(!i&&("loading"===(null===r||void 0===r?void 0:r.value)||"unloading"===(null===r||void 0===r?void 0:r.value)))return!1}}return!0}),[De,b,we,Ne]),Me=Pe<3&&P<5&&!ye&&(!je||2===P),He=U("points.".concat(b,".city")),Ve=U("points.".concat(b,".terminal")),qe=je&&"unknownSpot"===(null===Ve||void 0===Ve?void 0:Ve.type),ze=ye&&"unknownSpot"===(null===Ve||void 0===Ve?void 0:Ve.type),Le=(0,j.EN)(),Ue=(0,w.No)(),Qe=(0,w.Ng)({pickupCity:null===He||void 0===He?void 0:He.value,deliveryCity:null===He||void 0===He?void 0:He.value}).deliveryTerminals,Ae=(0,o.useMemo)((function(){return Qe.filter((function(e){return"unknownSpot"!==e.type}))}),[Qe]),Oe=(0,w.M5)(),Be=(0,o.useMemo)((function(){return Object.values(Le).filter((function(e){return e.active&&e.cityTerminal===(null!==(S=null===He||void 0===He?void 0:He.value)&&void 0!==S?S:"")}))}),[null===He||void 0===He?void 0:He.value,Le]),Re=(0,o.useMemo)((function(){return Be.filter((function(e){return"unknownSpot"!==e.type}))}),[Be]),We=null===De||void 0===De?void 0:De.find((function(e){return null===e||void 0===e?void 0:e.isFirstPoint})),Je=null===De||void 0===De?void 0:De.find((function(e){return null===e||void 0===e?void 0:e.isLastPoint})),Ge=je?"unknownSpot"===(null===Je||void 0===Je||null===(n=Je.terminal)||void 0===n?void 0:n.type):!!ye&&"unknownSpot"===(null===We||void 0===We||null===(t=We.terminal)||void 0===t?void 0:t.type),$e=(0,o.useMemo)((function(){return je&&qe?Be.filter((function(e){return"unknownSpot"===e.type})):Re}),[je,qe,Be,Re]),Ye=(0,o.useMemo)((function(){return ye&&ze?Qe.filter((function(e){return"unknownSpot"===e.type})):Ae}),[Qe,Ae,ye,ze]),Ke=(0,o.useMemo)((function(){return je?Oe.filter((function(e){return"pickup"===e.value})):ye?Oe.filter((function(e){return"delivery"===e.value})):Oe.filter((function(e){return"loading"===e.value||"unloading"===e.value||"other"===e.value}))}),[Oe,je,ye]);(0,o.useEffect)((function(){"address"===ge&&(je?"pickup"!==(null===Ne||void 0===Ne?void 0:Ne.value)&&A("points.".concat(b,".action"),Oe.find((function(e){return"pickup"===e.value}))||null):ye?"delivery"!==(null===Ne||void 0===Ne?void 0:Ne.value)&&A("points.".concat(b,".action"),Oe.find((function(e){return"delivery"===e.value}))||null):"pickup"!==(null===Ne||void 0===Ne?void 0:Ne.value)&&"delivery"!==(null===Ne||void 0===Ne?void 0:Ne.value)||A("points.".concat(b,".action"),null))}
1),[ge,je,ye,Ne,Oe,b,A]),(0,o.useEffect)((function(){xe||"loading"===(null===Ne||void 0===Ne?void 0:Ne.value)||"unloading"===(null===Ne||void 0===Ne?void 0:Ne.value)||(ae&&se(!1),A("points.".concat(b,".warehouseInn"),null))}),[Ne,xe,ae,b,A]),(0,o.useEffect)((function(){z&&(de(!1),oe(!1),se(!1),Ce||fe(!1),A("points.".concat(b,".release"),null),A("points.".concat(b,".stock"),null),A("points.".concat(b,".instruction"),null),A("points.".concat(b,".name"),""),A("points.".concat(b,".phone"),""),A("points.".concat(b,".warehouseInn"),null))}),[Ce,b,A,z]);var Xe,en,nn,tn,rn,on,ln,an,sn,cn,un,dn=function(e){if(je||ye){if(e){if(Ge)return void ne.Am.error("\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430: \u043b\u0438\u0431\u043e \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430, \u043b\u0438\u0431\u043e \u0441\u0434\u0430\u0447\u0430.");var n,t,i,r,o=je?null!==(n=null===Je||void 0===Je?void 0:Je.city)&&void 0!==n?n:null:null!==(t=null===We||void 0===We?void 0:We.city)&&void 0!==t?t:null,l=null!==(i=null!==He&&void 0!==He?He:o)&&void 0!==i?i:null;if(!l)return void ne.Am.error(je?"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043b\u043e\u043a\u0430\u0446\u0438\u044e \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043b\u043e\u043a\u0430\u0446\u0438\u044e \u0441\u0434\u0430\u0447\u0438");var a=function(e){var n,t;return null!==(t=null!==(n=Object.values(Le).find((function(n){return n.active&&"unknownSpot"===n.type&&n.cityTerminal===(null!==e&&void 0!==e?e:"")})))&&void 0!==n?n:Object.values(Le).find((function(e){return e.active&&"unknownSpot"===e.type})))&&void 0!==t?t:null}(null!==(r=null===l||void 0===l?void 0:l.value)&&void 0!==r?r:"");return a?("terminal"!==ge&&A("points.".concat(b,".pointType"),"terminal"),me&&A("points.".concat(b,".address"),null),!He&&o&&A("points.".concat(b,".city"),o),void A("points.".concat(b,".terminal"),a)):void ne.Am.error("\u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b \xab\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\xbb \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d")}"unknownSpot"===(null===Ve||void 0===Ve?void 0:Ve.type)&&A("points.".concat(b,".terminal"),null)}},pn=je&&qe||ye&&ze,vn=je?"\u0422\u043e\u0447\u043a\u0430 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430":"\u0422\u043e\u0447\u043a\u0430 \u0441\u0434\u0430\u0447\u0438 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430";return(0,r.jsxs)("div",{className:"flex flex-col ".concat(z?"gap-4":"gap-6"),children:[(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[he&&!we?(0,r.jsxs)("div",{className:"group flex w-fit cursor-pointer items-center gap-1.5",onClick:function(){we||(A("points.".concat(b,".shipperInn"),null),A("points.".concat(b,".consigneeInn"),null),A("points.".concat(b,".clientInn"),null),E(b))},children:[(0,r.jsx)("div",{className:"flex h-6 w-6 items-center justify-center",children:(0,r.jsx)(I.V,{className:"stroke-primaryText"})}),(0,r.jsx)("p",{className:"text-textSmallSemi text-primaryText",children:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441"})]}):(0,r.jsx)("div",{children:je?(0,r.jsxs)("div",{className:"flex flex-col gap-2 tablet:flex-row tablet:items-center",children:[(0,r.jsx)("h4",{className:"text-textMediumSemi",children:"\u041c\u0430\u0440\u0448\u0440\u0443\u0442 \u0437\u0430\u043a\u0430\u0437\u0430"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(x.r,{checked:qe,onChange:dn}),(0,r.jsx)("p",{className:"text-textBody",children:vn})]})]}):ye?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(x.r,{checked:ze,onChange:dn}),(0,r.jsx)("p",{className:"text-textBody",children:vn})]}):null}),pn?null:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".pointType"),render:function(e){var n=e.field;return(0,r.jsx)(ee.S,{value:null!==(Xe=n.value)&&void 0!==Xe?Xe:"address",onChange:function(e){n.onChange(e),"terminal"===e?A("points.".concat(b,".address"),null):(A("points.".concat(b,".city"),null),A("points.".concat(b,".terminal"),null),A("points.".concat(b,".release"),null),A("points.".concat(b,".stock"),null),je||ye||"pickup"!==(null===Ne||void 0===Ne?void 0:Ne.value)&&"delivery"!==(null===Ne||void 0===Ne?void 0:Ne.value)||A("points.".concat(b,".action"),null))}})}})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 tablet:flex-row",children:[!(we&&xe)&&(0,r.jsx)("div",{className:"w-full tablet:w-[230px]",children:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".action"),render:function(e){var n,t=e.field,i=e.fieldState;return(0,r.jsx)(v.Z,(0,s.Z)((0,a.Z)({},t),{instanceId:"point-action-".concat(b),options:Ke,placeholder:"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043a\u043e\u043d\u0442-\u043e\u043c *",error:null===(n=i.error)||void 0===n?void 0:n.message,id:"point-action-".concat(b),readOnly:be||ke,required:!z||be||ke}))},rules:{required:{value:!0,message:"\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435"}}})}),xe?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"w-full tablet:w-[230px]",children:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".city"),render:function(e){var n,t=e.field,i=e.fieldState;return(0,r.jsx)(v.Z,(0,s.Z)((0,a.Z)({},t),{instanceId:"point-city-".concat(b),options:Ue,placeholder:je?"\u041b\u
1043e\u043a\u0430\u0446\u0438\u044f \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 *":ye?"\u041b\u043e\u043a\u0430\u0446\u0438\u044f \u0441\u0434\u0430\u0447\u0438 *":"\u041b\u043e\u043a\u0430\u0446\u0438\u044f *",error:null===(n=i.error)||void 0===n?void 0:n.message,id:"point-city-".concat(b),required:!z}))},rules:{required:{value:!0,message:"\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435"}}})}),(0,r.jsx)("div",{className:"flex-grow tablet:max-w-[710px]",children:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".terminal"),render:function(e){var n,t=e.field,i=e.fieldState;return(0,r.jsx)(v.Z,(0,s.Z)((0,a.Z)({},t),{instanceId:"point-terminal-".concat(b),options:je?$e:Ye,placeholder:je?"\u041c\u0435\u0441\u0442\u043e \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 *":ye?"\u041c\u0435\u0441\u0442\u043e \u0441\u0434\u0430\u0447\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 *":"".concat(P>1?"".concat(1===b?"\u041f\u0435\u0440\u0432\u044b\u0439":"".concat(2==b?"\u0412\u0442\u043e\u0440\u043e\u0439":"".concat(3===b?"\u0422\u0440\u0435\u0442\u0438\u0439":"".concat(b+1,"-\u0439")))," \u0430\u0434\u0440\u0435\u0441"):"\u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b"," *"),isSearchable:!0,error:null===(n=i.error)||void 0===n?void 0:n.message,optionComponent:m.Z,filterOption:(0,c.c)(y._X),noOptionsMessage:function(){return"\u041f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e"},id:"point-terminal-".concat(b),required:!z}))},rules:{required:{value:!0,message:"\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435"}}})})]}):(0,r.jsx)("div",{className:"flex-grow tablet:max-w-[710px]",children:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".address"),render:function(e){var n,t=e.field,i=e.fieldState;return(0,r.jsx)(d.Z,(0,s.Z)((0,a.Z)({},t),{instanceId:"point-address-".concat(b),placeholder:je?"\u0410\u0434\u0440\u0435\u0441 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 *":ye?"\u0410\u0434\u0440\u0435\u0441 \u0441\u0434\u0430\u0447\u0438 *":"".concat(P>1?"".concat(1===b?"\u041f\u0435\u0440\u0432\u044b\u0439":"".concat(2==b?"\u0412\u0442\u043e\u0440\u043e\u0439":"".concat(3===b?"\u0422\u0440\u0435\u0442\u0438\u0439":"".concat(b+1,"-\u0439")))," \u0430\u0434\u0440\u0435\u0441"):"\u0410\u0434\u0440\u0435\u0441"," *"),fetcher:N.tJ.getWarehouseAddressGeoLocationSuggestions,noOptionsMessage:function(e){return e.inputValue?"":"\u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441"},loadingMessage:function(){return"..."},error:null===(n=i.error)||void 0===n?void 0:n.message,id:"point-address-".concat(b),required:!z}))},rules:{required:{value:!0,message:"\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435"}}})}),Ze&&(0,r.jsx)("div",{className:"w-full tablet:w-[230px]",children:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".dateTime"),render:function(e){var n=e.field;return(0,r.jsx)(X,(0,s.Z)((0,a.Z)({},n),{placeholder:Te?"\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f *":"\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f",fieldName:"points.".concat(b,".dateTime"),invalidDate:H,setInvalidDate:V,setIsHandInputChanged:G,isHandInputChanged:J,setIsRendered:K,isRendered:Y,dateInputValue:B,onChangeDateInput:R,id:"point-dateTime-".concat(b)}))},rules:{required:{value:Te,message:"\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435"}}})})]}),xe&&ue&&!z&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 tablet:flex-row",children:[(0,r.jsx)("div",{className:"w-full tablet:w-[230px]",children:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".release"),render:function(e){var n,t=e.field,i=e.fieldState;return(0,r.jsx)(p.Z,(0,s.Z)((0,a.Z)({},t),{value:null!==(en=t.value)&&void 0!==en?en:"",placeholder:"\u0420\u0435\u043b\u0438\u0437",fieldValue:null!==(nn=t.value)&&void 0!==nn?nn:"",error:null===(n=i.error)||void 0===n?void 0:n.message,rightIcon:(0,r.jsx)(C.Z,{}),resetField:function(){return A(t.name,"")},leftIcon:(0,r.jsx)(g.Z,{icon:(0,r.jsx)(ie,{}),placement:"bottom",iconClassName:"h-6 w-6",tooltipClassName:"!-right-[490%
1] !top-[220%] after:!-ml-[130px] !z-[5000]",children:"\u0420\u0435\u043b\u0438\u0437 \u2014 \u044d\u0442\u043e \u0437\u0430\u044f\u0432\u043a\u0430 \u043d\u0430 \u0432\u044b\u0434\u0430\u0447\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043d\u0430 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435."})}))},shouldUnregister:!0})}),(0,r.jsx)("div",{className:"w-full tablet:w-[230px]",children:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".stock"),render:function(e){var n,t=e.field,i=e.fieldState;return(0,r.jsx)(p.Z,(0,s.Z)((0,a.Z)({},t),{value:null!==(tn=t.value)&&void 0!==tn?tn:"",placeholder:"\u0421\u0442\u043e\u043a",fieldValue:null!==(rn=t.value)&&void 0!==rn?rn:"",error:null===(n=i.error)||void 0===n?void 0:n.message,rightIcon:(0,r.jsx)(C.Z,{}),resetField:function(){return A(t.name,"")},leftIcon:(0,r.jsx)(g.Z,{icon:(0,r.jsx)(ie,{}),placement:"bottom",iconClassName:"h-6 w-6",tooltipClassName:"!-right-[490%] !top-[220%] after:!-ml-[130px] !z-[5000]",children:"\u0421\u0442\u043e\u043a \u2014 \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u0432\u044b\u0434\u0430\u0447\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432 \u0443\u0447\u0451\u0442\u0435 \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 / \u041f\u043b\u043e\u0449\u0430\u0434\u043a\u0438."})}))},shouldUnregister:!0})})]}),(0,r.jsx)("div",{className:"flex flex-grow",children:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".instruction"),render:function(e){var n,t=e.field,i=e.fieldState;return(0,r.jsx)(h.Z,(0,s.Z)((0,a.Z)({},t),{value:null!==(on=t.value)&&void 0!==on?on:"",rightIcon:(0,r.jsx)(C.Z,{}),resetField:function(){return A(t.name,"")},placeholder:"\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f",fieldValue:null!==(ln=t.value)&&void 0!==ln?ln:"",error:null===(n=i.error)||void 0===n?void 0:n.message,className:"!h-auto w-full at1366:max-w-[950px]",disableResize:!0,inputStyles:"!text-textBody !min-h-[74px]",restrictHeight:!0,onInput:function(e){e.currentTarget.style.height="auto",e.currentTarget.style.height="".concat(e.currentTarget.scrollHeight+10,"px")}}))}})})]}),!xe&&we&&ue&&!z&&(0,r.jsx)("div",{className:"flex flex-grow",children:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".instruction"),render:function(e){var n,t=e.field,i=e.fieldState;return(0,r.jsx)(h.Z,(0,s.Z)((0,a.Z)({},t),{value:null!==(an=t.value)&&void 0!==an?an:"",rightIcon:(0,r.jsx)(C.Z,{}),resetField:function(){return A(t.name,"")},placeholder:_e,fieldValue:null!==(sn=t.value)&&void 0!==sn?sn:"",error:null===(n=i.error)||void 0===n?void 0:n.message,className:"!h-auto w-full at1366:max-w-[950px]",disableResize:!0,inputStyles:"!text-textBody !min-h-[74px]",restrictHeight:!0,onInput:function(e){e.currentTarget.style.height="auto",e.currentTarget.style.height="".concat(e.currentTarget.scrollHeight+10,"px")}}))}})}),!xe&&re&&!z&&(0,r.jsxs)("div",{className:"flex flex-col gap-3 tablet:flex-row",children:[(0,r.jsx)("div",{className:"w-full tablet:w-[230px]",children:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".phone"),render:function(e){var n,t=e.field,i=e.fieldState;return(0,r.jsx)(p.Z,(0,s.Z)((0,a.Z)({},t),{fieldValue:null!==(cn=t.value)&&void 0!==cn?cn:"",placeholder:"\u0422\u0435\u043b\u0435\u0444\u043e\u043d",error:null===(n=i.error)||void 0===n?void 0:n.message,id:"point-phone-".concat(b)}))},shouldUnregister:!0})}),(0,r.jsx)("div",{className:"w-full tablet:w-[230px]",children:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".name"),render:function(e){var n,t=e.field,i=e.fieldState;return(0,r.jsx)(p.Z,(0,s.Z)((0,a.Z)({},t),{fieldValue:null!==(un=t.value)&&void 0!==un?un:"",placeholder:"\u0418\u043c\u044f \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043b\u0438\u0446\u0430",error:null===(n=i.error)||void 0===n?void 0:n.message,id:"point-name-".concat(b)}))},shouldUnregister:!0})})]}),!xe&&ae&&!z&&("loading"===(null===Ne||void 0===Ne?void 0:Ne.value)||"unloading"===(null===Ne||void 0===Ne?void 0:Ne.value))&&(0,r.jsx)("div",{className:"w-full tablet:w-[230px]",children:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".warehouseInn"),render:function(e){var n,t=e.field,i=e.fieldState;return(0,r.jsx)(u.Z,(0,s.Z)((0,a.Z)({},t),{instanceId:"point-warehouse-inn-".concat(b),placeholder:"\u0418\u041d\u041d \u0441\u043a\u043b\u0430\u0434\u0430",o
1ptionComponent:f.Z,fetcher:N.tJ.getPartySuggestions,noOptionsMessage:function(e){return e.inputValue?"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438":"\u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0418\u041d\u041d"},loadingMessage:function(){return"..."},error:null===(n=i.error)||void 0===n?void 0:n.message,id:"point-warehouse-inn-".concat(b),smallFontSize:!0}))},shouldUnregister:!0})}),!xe&&!we&&!z&&("unloading"===(null===Ne||void 0===Ne?void 0:Ne.value)||"loading"===(null===Ne||void 0===Ne?void 0:Ne.value))&&(0,r.jsxs)("div",{className:"flex flex-col gap-3 pt-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-1.5",children:[(0,r.jsx)("h5",{className:"text-textSmallSemi text-label",children:"\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0418\u041d\u041d \u0434\u043b\u044f \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u043e\u0439 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u043e\u0439"}),!Ee&&(0,r.jsx)(Z,{})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 tablet:flex-row",children:[(0,r.jsx)("div",{className:"w-full tablet:w-[230px]",children:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".shipperInn"),render:function(e){var n,t=e.field,i=e.fieldState;return(0,r.jsx)(u.Z,(0,s.Z)((0,a.Z)({},t),{instanceId:"point-shipper-inn-".concat(b),placeholder:"\u0413\u0440\u0443\u0437\u043e\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044c",optionComponent:f.Z,fetcher:N.tJ.getPartySuggestions,noOptionsMessage:function(e){return e.inputValue?"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438":"\u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0418\u041d\u041d"},loadingMessage:function(){return"..."},error:null===(n=i.error)||void 0===n?void 0:n.message,id:"point-shipper-inn-".concat(b),smallFontSize:!0}))},shouldUnregister:!0})}),(0,r.jsx)("div",{className:"w-full tablet:w-[230px]",children:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".consigneeInn"),render:function(e){var n,t=e.field,i=e.fieldState;return(0,r.jsx)(u.Z,(0,s.Z)((0,a.Z)({},t),{instanceId:"point-consignee-inn-".concat(b),placeholder:"\u0413\u0440\u0443\u0437\u043e\u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044c",optionComponent:f.Z,fetcher:N.tJ.getPartySuggestions,noOptionsMessage:function(e){return e.inputValue?"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438":"\u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0418\u041d\u041d"},loadingMessage:function(){return"..."},error:null===(n=i.error)||void 0===n?void 0:n.message,id:"point-consignee-inn-".concat(b),smallFontSize:!0}))},shouldUnregister:!0})}),Fe&&(0,r.jsx)("div",{className:"w-full tablet:w-[230px]",children:(0,r.jsx)(l.Qr,{control:Q,name:"points.".concat(b,".clientInn"),render:function(e){var n,t=e.field,i=e.fieldState;return(0,r.jsx)(u.Z,(0,s.Z)((0,a.Z)({},t),{instanceId:"point-client-inn-".concat(b),placeholder:"\u041a\u043b\u0438\u0435\u043d\u0442",optionComponent:f.Z,fetcher:N.tJ.getPartySuggestions,noOptionsMessage:function(e){return e.inputValue?"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438":"\u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0418\u041d\u041d"},loadingMessage:function(){return"..."},error:null===(n=i.error)||void 0===n?void 0:n.message,id:"point-client-inn-".concat(b),smallFontSize:!0}))},shouldUnregister:!0})})]})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-5",children:[Me&&(0,r.jsxs)("div",{className:"group flex w-fit cursor-pointer items-center gap-1.5",onClick:function(){if(!(Pe>=3||P>=5)){for(var e={isEdgePoint:!1,isFirstPoint:!1,isLastPoint:!1,pointType:"address",city:null,terminal:null,release:null,stock:null,instruction:null,dateTime:"",address:null,action:null,consigneeInn:null,shipperInn:null},n=-1,t=M.length-1;t>=0;t--)if(U("points.".concat(t,".isEdgePoint"))){n=t;break}n>0?F(n,e):D(e)}},children:[(0,r.jsx)("div",{className:"flex h-6 w-6 items-center justify-center",children:(0,r.jsx)(I.p,{})}),(0,r.jsx)("p",{className:"text-textSmallSemi text-primary group-hover:text-hover group-active:text-active",children:"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441"})]}),Ie&&(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"group flex w-fit cursor-pointer items-center gap-1.5",onClick:function(){return de(!ue)},children:[(0,r.jsx)("div",{className:"flex h-6 w-6 items-center justify-center",children:ue?(0,r.jsx)(I.V,{className:"stroke-primaryText"}):(0,r.jsx)(I.p,{})}),(0,r.jsx)("p",{className:"text-textSmallSemi ".concat(ue?"text-primaryText":"text-primary group-hover:text-hover group-active:text-active"),children:Se})]})}),!Te&&!z&&(0,r.jsxs)("div",{className:"group flex w-fit cursor-pointer items-center gap-1.5",onClick:function(){return fe(!ve)},children:[(0,r.jsx)("div",{className:"flex h-6 w-6 items-center justify-center",children:ve?(0,r.jsx)(I.V,{className:"stroke-primaryText"}):(0,r.jsx)(I.p,{})}),(0,r.jsx)("p",{className:"text-textSmallSemi ".concat(ve?"text-primaryText":"text-primary group-hover:text-hover group-active:text-active"),children:ve?"\u0421\u043a\u0440\u044b\u0442\u044c \u0434\u0430\u0442\u0443":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u0442\u0443"})]}),!xe&&!z&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"group flex w-fit cursor-pointer items-center gap-1.5",onClick:function(){return oe(!re)},children:[(0,r.jsx)("div",{className:"flex h-6 w-6 items-center justify-center",children:re?(0,r.jsx)(I.V,{className:"stroke-primaryText"}):(0,r.jsx)(I.p,{})}),(0,r.jsx)("p",{className:"text-textSmallSemi ".concat(re?"text-primaryText":"text-primary group-hover:text-hover group-active:text-active"),children:re?"\u0421\u043a\u0440\u044b\u0442\u044c \u043a\u043e\u043d\u0442\u0430\u043a\u0442":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0430\u043a\u0442"})]}),("loading"===(null===Ne||void 0===Ne?void 0:Ne.value)||"unloading"===(null===Ne||void 0===Ne?void 0:Ne.value))&&(0,r.jsxs)("div",{className:"group flex w-fit cursor-pointer items-center gap-1.5",onClick:function(){return se(!ae)},children:[(0,r.jsx)("div",{className:"flex h-6 w-6 items-center justify-center",children:ae?(0,r.jsx)(I.V,{className:"stroke-primaryText"}):(0,r.jsx)(I.p,{})}),(0,r.jsx)("p",{className:"text-textSmallSemi ".concat(ae?"text-primaryText":"text-primary group-hover:text-hover group-active:text-active"),children:ae?"\u0421\u043a\u0440\u044b\u0442\u044c \u0418\u041d\u041d \u0441\u043a\u043b\u0430\u0434\u0430":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0418\u041d\u041d \u0441\u043a\u043b\u0430\u0434\u0430"})]})]})]})]})]})},ie=function(){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",className:"z-10 stroke-disabled hover:cursor-pointer hover:stroke-secondaryText",children:[(0,r.jsx)("path",{d:"M12.7031 22.7246C18.226 22.7246 22.7031 18.2475 22.7031 12.7246C22.7031 7.20176 18.226 2.72461 12.7031 2.72461C7.18028 2.72461 2.70312 7.20176 2.70312 12.7246C2.70312 18.2475 7.18028 22.7246 12.7031 22.7246Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M12.7031 16.7246V12.7246",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M12.7031 8.72461H12.7131",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})},re=function(e){var n=e.invalidDate,t=e.setInvalidDate,i=e.withCargo,o=e.tariffMode,a=void 0!==o&&o,s=(0,l.Gc)().control,c=(0,l.Dq)({control:s,name:"points",shouldUnregister:!1}),u=c.fields,d=c.append,p=c.remove,v=c.insert;return(0,r.jsx)("div",{className:"flex max-w-[950px] flex-col ".concat(a?"my-4":"my-10"),children:u.map((function(e,o){return(0,r.jsxs)("div",{className:"flex flex-col ".concat(a?"gap-4":"gap-5"," ").concat(o>0?a?"mt-4":"mt-5":""),children:[o>0&&(0,r.jsx)(oe,{}),(0,r.jsx)(te,{appendPoint:d,removePoint:p,insertPoint:v,pointsFields:u,pointIndex:o,length:u.length,invalidDate:n,setInvalidDate:t,withCargo:i,tariffMode:a})]},e.id)}))})},oe=function(){return(0,r.jsx)("div",{className:"h-px w-full",style:{backgroundImage:"repeating-linear-gradient(90deg, #D0D6E0 0 28px, transparent 28px 40px)"}})},le=function(e){var n=e.invalidDate,t=e.setInvalidDate,i=e.withCargo,l=e.tariffMode,a=void 0!==l&&l,s=(0,o.useState)(!1),c=s[0],u=s[1];return(0,o.useEffect)((function(){u(!0)}),[]),c?(0,r.jsx)("fieldset",{children:(0,r.jsx)("div",{className:"flex flex-col",children:(0,r.jsx)(re,{invalidDate:n,setInvalidDate:t,withCargo:i,tariffMode:a})})}):(0,r.jsx)(r.Fragment,{})}},61650:function(e,n,t){t.d(n,{$g:function(){return h},Az:function(){return m},p$:function(){return g},qZ:function(){return f}});
1var i,r,o=t(58486),l=t(13276),a=t(68736),s=t(27484),c=t.n(s),u=t(70178),d=t.n(u),p=function(e){return null!==(i=e.find((function(e){var n;return"pickup"===(null===(n=e.action)||void 0===n?void 0:n.value)})))&&void 0!==i?i:e.find((function(e){return e.isFirstPoint}))},v=function(e){return null!==(r=e.find((function(e){var n;return"delivery"===(null===(n=e.action)||void 0===n?void 0:n.value)})))&&void 0!==r?r:e.find((function(e){return e.isLastPoint}))};c().extend(d());var f=function(e,n){var t=e.split(" \u2014 "),i=function(e){if(n){var t=function(e){var n=e.match(/^UTC([+-]\d{1,2})$/);if(!n)return"+00:00";var t=Number(n[1]),i=t>=0?"+":"-",r=Math.abs(t).toString().padStart(2,"0");return"".concat(i).concat(r,":00")}(n);return c()((0,a.P0)(e)).utcOffset(t).format()}return c()((0,a.P0)(e)).format()};return t.length>1?{start:i(t[0]),end:i(t[1].length<6?t[0].split(" ")[0]+" "+t[1]:t[1]),timezone:null!==n&&void 0!==n?n:null}:{start:i(e),end:null,timezone:null!==n&&void 0!==n?n:null}},m=function(e){var n=e.reduce((function(e,n){return e+n.mapPoint[0]}),0),t=e.reduce((function(e,n){return e+n.mapPoint[1]}),0);return[n/e.length,t/e.length]};function h(e,n,t){var i,r,o,a,s,c,u,d=null===(u=null===t||void 0===t?void 0:t.requireDateTimeForLoadingUnloading)||void 0===u||u;if(console.log("form",e),!(null===(i=e.containerType)||void 0===i?void 0:i.value))throw new Error("containerType is required");if(!e.paymentType)throw new Error("paymentType is required");if(!e.points||0===e.points.length)throw new Error("points are required");if(!e.cargos||0===e.cargos.length)throw new Error("cargos are required");var p,v,m=(null===(r=e.points[0])||void 0===r||null===(o=r.clientInn)||void 0===o?void 0:o.value)||(null===(a=e.clientInn)||void 0===a?void 0:a.value)||null,h=e.points.findIndex((function(e){return!(null!==(p=e.isFirstPoint)&&void 0!==p&&p)&&!(null!==(v=e.isLastPoint)&&void 0!==v&&v)})),g=e.points.map((function(e,n){var t,i,r,o,a,s=n+1,c=null!==(o=e.isFirstPoint)&&void 0!==o&&o,u=null!==(a=e.isLastPoint)&&void 0!==a&&a,p=n===h&&-1!==h,v=null===(t=e.action)||void 0===t?void 0:t.value;v||(c?v="pickup":u&&(v="delivery"));var g=(0,l.iP)(null!==v&&void 0!==v?v:""),x="terminal"===e.pointType,w="address"===e.pointType,j=null,y=null;if(x){var N,C;if(!(null===(N=e.city)||void 0===N?void 0:N.value)||!(null===(C=e.terminal)||void 0===C?void 0:C.value))throw new Error("city and terminal are required for terminal point ".concat(s));j={city:(0,l.iP)(e.city.value),terminal:(0,l.iP)(e.terminal.value),delivery_date_time_period:e.dateTime?f(e.dateTime):null}}if(w){var T;if(!e.address)throw new Error("address is required for warehouse point ".concat(s));if(d&&("loading"===v||"unloading"===v)&&!e.dateTime)throw new Error("dateTime is required for warehouse point ".concat(s));var Z=e.dateTime?f(e.dateTime):null;y={address:e.address.label||e.address.value,delivery_date_time_period:Z,contacts:e.name||e.phone?[{name:e.name||void 0,phone:e.phone||void 0}]:[],inn:(null===(T=e.warehouseInn)||void 0===T?void 0:T.value)||null}}return{point_number:s,point_type_enum:g,terminal:j||void 0,warehouse:y||void 0,shipper_inn:(null===(i=e.shipperInn)||void 0===i?void 0:i.value)||null,consignee_inn:(null===(r=e.consigneeInn)||void 0===r?void 0:r.value)||null,client_inn:c||p?m:null}})),x=e.cargos[0];if(!(null===(s=x.containerHeight)||void 0===s?void 0:s.value))throw new Error("containerHeight is required for cargo");var w={container_height:(0,l.iP)(x.containerHeight.value),container_number:x.containerNumber||null,cargo_weight:x.weight?+x.weight.replace(/\s/g,""):null,cargo_name:x.name||null,cargo_cost:x.cost?+x.cost.replace(/\s/g,""):null,zpu:x.zpu||null},j=e.cargos.length>1&&e.cargos[1]?{container_height:e.cargos[1].containerHeight?(0,l.iP)(e.cargos[1].containerHeight.value):(0,l.iP)(x.containerHeight.value),container_number:e.cargos[1].containerNumber||null,cargo_weight:e.cargos[1].weight?+e.cargos[1].weight.replace(/\s/g,""):null,cargo_name:e.cargos[1].name||null,cargo_cost:e.cargos[1].cost?+e.cargos[1].cost.replace(/\s/g,""):null,zpu:e.cargos[1].zpu||null}:null,y=(0,l.iP)(n?"loaded":"not_loaded");return{container_type:(0,l.iP)(e.containerType.value),payment_type:(0,l.iP)(e.paymentType),route_points:g,loading_type:y,cargo:w,cargo2:j,promo_code:(null===(c=e.promo)||void 0===c?void 0:c.value)||null}}function g(e,n,t){var i,r,a,s,c,u;if(!(null===(i=e.containerType)||void 0===i?void 0:i.value))throw new Error("containerType is required");if(!e.paymentType)throw new Error("paymentType is required");if(!e.points||0===e.points.length)throw new Error("points are required");if(!e.cargos||0===e.cargos.length)throw new Error("cargos are required");if(!t||0===t.length)throw new Error("tariffs are required");var d,m,h=(null===(r=e.points[0])||void 0===r||null===(a=r.clientInn)||void 0===a?void 0:a.value)||(null===(s=e.clientInn)||void 0===s?void 0:s.value)||null,g=e.points.findIndex((function(e){return!(null!==(d=e.isFirstPoint)&&void 0!==d&&d)&&!(null!==(m=e.isLastPoint)&&void 0!==m&&m)})),x=e.points.map((function(e,n){var t,i,r,o,a,s=n+1,c=null!==(o=e.isFirstPoint)&&void 0!==o&&o,u=null!==(a=e.isLastPoint)&&void 0!==a&&a,d=n===g&&-1!==g,p=null===(t=e.action)||void 0===t?void 0:t.value;p||(c?p="pickup":u&&(p="delivery"));var v=(0,l.iP)(null!==p&&void 0!==p?p:""),m="terminal"===e.pointType,x="address"===e.pointType,w=null,j=null;if(m){var y,N;if(!(null===(y=e.city)||void 0===y?void 0:y.value)||!(null===(N=e.terminal)||void 0===N?void 0:N.value))throw new Error("city and terminal are required for terminal point ".concat(s));w={city:(0,l.iP)(e.city.value),terminal:(0,l.iP)(e.terminal.value),delivery_date_time_period:e.dateTime?f(e.dateTime):void 0}}if(x){var C;if(!e.address)throw new Error("address is required for warehouse point ".concat(s));if(("loading"===p||"unloading"===p)&&!e.dateTime)throw new Error("dateTime is required for warehouse point ".concat(s));var T=e.dateTime?f(e.dateTime):null;j={address:e.address.label||e.address.value,delivery_date_time_period:T,contacts:e.name||e.phone?[{name:e.name||void 0,phone:e.phone||void 0}]:[],inn:(null===(C=e.warehouseInn)||void 0===C?void 0:C.value)||null}}return{point_number:s,point_type_enum:v,terminal:w||void 0,warehouse:j||void 0,shipper_inn:(null===(i=e.shipperInn)||void 0===i?void 0:i.value)||null,consignee_inn:(null===(r=e.consigneeInn)||void 0===r?void 0:r.value)||null,client_inn:d?h:null}})),w=e.cargos[0];if(!(null===(c=w.containerHeight)||void 0===c?void 0:c.value))throw new Error("containerHeight is required for cargo");var j,y={container_height:(0,l.iP)(w.containerHeight.value),container_number:w.containerNumber||null,cargo_weight:w.weight?+w.weight.replace(/\s/g,""):null,cargo_name:w.name||null,cargo_cost:w.cost?
1+w.cost.replace(/\s/g,""):null,zpu:w.zpu||null},N=e.cargos.length>1&&e.cargos[1]?{container_height:e.cargos[1].containerHeight?(0,l.iP)(e.cargos[1].containerHeight.value):(0,l.iP)(w.containerHeight.value),container_number:e.cargos[1].containerNumber||null,cargo_weight:e.cargos[1].weight?+e.cargos[1].weight.replace(/\s/g,""):null,cargo_name:e.cargos[1].name||null,cargo_cost:e.cargos[1].cost?+e.cargos[1].cost.replace(/\s/g,""):null,zpu:e.cargos[1].zpu||null}:null,C=(0,l.iP)(n?"loaded":"not_loaded"),T=t.map((function(e){return o.A6.r.fromOrderTariffEntity(e)})),Z=p(e.points),k=v(e.points),I={pickup_release:(null===Z||void 0===Z?void 0:Z.release)||null,delivery_release:(null===k||void 0===k?void 0:k.release)||null,pickup_stock:(null===Z||void 0===Z?void 0:Z.stock)||null,delivery_stock:(null===k||void 0===k?void 0:k.stock)||null,pickup_instruction:(null===Z||void 0===Z?void 0:Z.instruction)||null,delivery_instruction:(null===k||void 0===k?void 0:k.instruction)||null},_=e.attachments&&e.attachments.length>0?e.attachments.map((function(e){return{file:{content:e.content,name:e.name},type:(0,l.iP)(e.doc_type)}})):null,S=null!==(j=e.manyTn)&&void 0!==j&&j;return{container_type:(0,l.iP)(e.containerType.value),how_to_carry:e.howToCarry?(0,l.iP)(e.howToCarry.value):null,loading_type:C,cargo:y,cargo2:N,route_points:x,instruction:I,tariff:T,payment_type:(0,l.iP)(e.paymentType),many_tn:S,additional_info:e.additionalInfo||null,input_scans:_,promo_code:(null===(u=e.promo)||void 0===u?void 0:u.value)||null}}}}]);

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.