@djb25/digit-ui-module-wt 1.0.69 → 1.0.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@djb25/digit-ui-react-components"),l=require("react"),n=e(l),i=require("react-i18next"),o=require("react-router-dom"),a=require("react-query"),r=require("react-hook-form"),d=require("socket.io-client"),u=require("react-leaflet"),s=e(require("leaflet"));require("leaflet/dist/leaflet.css");const c=[{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"service-type",component:"ServiceTypes",withoutLabel:!0,key:"serviceType",type:"component",nextStep:"info",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT"}},{route:"info",component:"InfoPage",nextStep:"applicant-details",key:"infodetails"},{route:"applicant-details",component:"ApplicantDetails",withoutLabel:!0,key:"owner",type:"component",nextStep:"address-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"ES_APPLICANT_DETAILS"},timeLine:[{currentStep:1,actions:"ES_APPLICANT_DETAILS"}]}]},{head:"ES_TITLE_ADDRESS_DETAILS",body:[{route:"address-details",component:"AddressDetails",withoutLabel:!0,key:"address",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"request-details",texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"ES_ADDRESS_DETAILS"},timeLine:[{currentStep:2,actions:"ES_ADDRESS_DETAILS"}]}]},{head:"ES_REQUEST_DETAILS",body:[{route:"request-details",component:"RequestDetails",withoutLabel:!0,key:"requestDetails",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:null,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"WT_REQUEST_DETAILS"},timeLine:[{currentStep:3,actions:"ES_REQUEST_DETAILS"}]}]},{head:"ES_TOILET_REQUEST_DETAILS",body:[{route:"toiletRequest-details",component:"ToiletRequestDetails",withoutLabel:!0,key:"toiletRequestDetails",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:null,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"MT_REQUEST_DETAILS"},timeLine:[{currentStep:3,actions:"ES_TOILET_REQUEST_DETAILS"}]}]},{head:"ES_TREE_PRUNING_REQUEST_DETAILS",body:[{route:"treePruningRequest-details",component:"TreePruningRequestDetails",withoutLabel:!0,key:"treePruningRequestDetails",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:null,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"TP_REQUEST_DETAILS"},timeLine:[{currentStep:3,actions:"ES_TREE_PRUNING_REQUEST_DETAILS"}]}]}],v=e=>{let{config:l,showFinalStep:a,...r}=e;const{t:d}=i.useTranslation(),u=o.useLocation().pathname.split("/").pop();if("info"===u)return null;const s=l.filter(e=>e.timeLine&&e.timeLine.length>0).reduce((e,t)=>{const l=t.timeLine[0],n=e.findIndex(e=>e.key===l.currentStep);return-1===n?e.push({key:l.currentStep,label:l.actions,routes:[t.route],stepNumber:l.currentStep}):e[n].routes.push(t.route),e},[]).sort((e,t)=>e.stepNumber-t.stepNumber);a&&s.push({key:"final-submit",label:"Review & Submit",routes:["check","wt-acknowledgement","mt-acknowledgement","tp-acknowledgement","fp-check","fp-wt-acknowledgement"],stepNumber:s.length+1});const c=s.findIndex(e=>e.routes.includes(u)),v=-1!==c?c:0;return n.createElement(n.Fragment,null,n.createElement("div",{className:"vertical-timeline-container"},n.createElement("div",{className:"vertical-timeline-wrapper"},s.map((e,l)=>{const i=l<v;return n.createElement("div",{key:l,className:`vertical-timeline-step ${i?"completed":""} ${l===v?"activeTimeline active":""}`,onClick:()=>{}},n.createElement("div",{className:"vertical-timeline-connector "+(l<v?"completed":"")}),n.createElement("div",{className:"vertical-timeline-pill"},i?n.createElement(t.TickMark,null):e.stepNumber),n.createElement("div",{className:"vertical-timeline-content"},n.createElement("div",{className:"vertical-timeline-label"},d(e.label))))}))))};function m(){return(m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(null,arguments)}const p=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||void 0===e||""===e)}(e)?e:"NA"},E=e=>{if(!e)return"NA";const[t,l]=e.split(":").map(Number),n=t>=12?"PM":"AM";return`${t%12||12}:${l.toString().padStart(2,"0")} ${n}`},f=e=>{if(!e)return"NA";const[t,l,n]=e.split("-");return`${n}-${l}-${t}`},g=e=>{var t,l,n,i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,h,T,y,S,b,N,I,D,C,A,x,O;return{mobileToiletBookingDetail:{tenantId:null==e?void 0:e.tenantId,description:null==e||null===(t=e.toiletRequestDetails)||void 0===t?void 0:t.specialRequest,noOfMobileToilet:null==e||null===(l=e.toiletRequestDetails)||void 0===l||null===(n=l.mobileToilet)||void 0===n?void 0:n.code,deliveryFromDate:null==e||null===(i=e.toiletRequestDetails)||void 0===i?void 0:i.deliveryfromDate,deliveryToDate:null==e||null===(o=e.toiletRequestDetails)||void 0===o?void 0:o.deliverytoDate,deliveryFromTime:null==e||null===(a=e.toiletRequestDetails)||void 0===a?void 0:a.deliveryfromTime,deliveryToTime:null==e||null===(r=e.toiletRequestDetails)||void 0===r?void 0:r.deliverytoTime,addressDetailId:(null==e||null===(d=e.address)||void 0===d?void 0:d.addressDetailId)||"",applicantDetail:{name:null==e||null===(u=e.owner)||void 0===u?void 0:u.applicantName,mobileNumber:null==e||null===(s=e.owner)||void 0===s?void 0:s.mobileNumber,alternateNumber:null==e||null===(c=e.owner)||void 0===c?void 0:c.alternateNumber,emailId:null==e||null===(v=e.owner)||void 0===v?void 0:v.emailId},address:{addressType:null==e||null===(m=e.address)||void 0===m||null===(p=m.addressType)||void 0===p?void 0:p.code,pincode:null==e||null===(E=e.address)||void 0===E?void 0:E.pincode,city:(null==e||null===(f=e.address)||void 0===f||null===(g=f.city)||void 0===g||null===(_=g.city)||void 0===_?void 0:_.name)||"DJB",cityCode:(null==e||null===(h=e.address)||void 0===h||null===(T=h.city)||void 0===T||null===(y=T.city)||void 0===y?void 0:y.code)||"DJB",addressLine1:null==e||null===(S=e.address)||void 0===S?void 0:S.addressLine1,addressLine2:null==e||null===(b=e.address)||void 0===b?void 0:b.addressLine2,locality:null==e||null===(N=e.address)||void 0===N||null===(I=N.locality)||void 0===I?void 0:I.i18nKey,localityCode:null==e||null===(D=e.address)||void 0===D||null===(C=D.locality)||void 0===C?void 0:C.code,streetName:null==e||null===(A=e.address)||void 0===A?void 0:A.streetName,houseNo:null==e||null===(x=e.address)||void 0===x?void 0:x.houseNo,landmark:null==e||null===(O=e.address)||void 0===O?void 0:O.landmark},bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"mobileToilet",moduleName:"request-service.mobile_toilet"}}}},h=e=>{var t,l,n,i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,h,T,y,S,b,N,I,D,C;return{treePruningBookingDetail:{tenantId:null==e?void 0:e.tenantId,latitude:null==e||null===(t=e.treePruningRequestDetails)||void 0===t?void 0:t.latitude,longitude:null==e||null===(l=e.treePruningRequestDetails)||void 0===l?void 0:l.longitude,reasonForPruning:null==e||null===(n=e.treePruningRequestDetails)||void 0===n||null===(i=n.reasonOfPruning)||void 0===i?void 0:i.code,applicantDetail:{name:null==e||null===(o=e.owner)||void 0===o?void 0:o.applicantName,mobileNumber:null==e||null===(a=e.owner)||void 0===a?void 0:a.mobileNumber,alternateNumber:null==e||null===(r=e.owner)||void 0===r?void 0:r.alternateNumber,emailId:null==e||null===(d=e.owner)||void 0===d?void 0:d.emailId},documentDetails:[{documentType:"Site Photograph",fileStoreId:null==e||null===(u=e.treePruningRequestDetails)||void 0===u?void 0:u.supportingDocumentFile}],address:{addressType:null==e||null===(s=e.address)||void 0===s||null===(c=s.addressType)||void 0===c?void 0:c.code,pincode:null==e||null===(v=e.address)||void 0===v?void 0:v.pincode,city:(null==e||null===(m=e.address)||void 0===m||null===(p=m.city)||void 0===p||null===(E=p.city)||void 0===E?void 0:E.name)||"DJB",cityCode:(null==e||null===(f=e.address)||void 0===f||null===(g=f.city)||void 0===g||null===(_=g.city)||void 0===_?void 0:_.code)||"DJB",addressLine1:null==e||null===(h=e.address)||void 0===h?void 0:h.addressLine1,addressLine2:null==e||null===(T=e.address)||void 0===T?void 0:T.addressLine2,locality:null==e||null===(y=e.address)||void 0===y||null===(S=y.locality)||void 0===S?void 0:S.i18nKey,localityCode:null==e||null===(b=e.address)||void 0===b||null===(N=b.locality)||void 0===N?void 0:N.code,streetName:null==e||null===(I=e.address)||void 0===I?void 0:I.streetName,houseNo:null==e||null===(D=e.address)||void 0===D?void 0:D.houseNo,landmark:null==e||null===(C=e.address)||void 0===C?void 0:C.landmark},bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"treePruning",moduleName:"request-service.tree_pruning"}}}},T=function(){function e(){}return e.prototype.then=function(t,l){const n=new e,i=this.s;if(i){const e=1&i?t:l;if(e){try{y(n,1,e(this.v))}catch(e){y(n,2,e)}return n}return this}return this.o=function(e){try{const i=e.v;1&e.s?y(n,1,t?t(i):i):l?y(n,1,l(i)):y(n,2,i)}catch(e){y(n,2,e)}},n},e}();function y(e,t,l){if(!e.s){if(l instanceof T){if(!l.s)return void(l.o=y.bind(null,e,t));1&t&&(t=l.s),l=l.v}if(l&&l.then)return void l.then(y.bind(null,e,t),y.bind(null,e,2));e.s=t,e.v=l;const n=e.o;n&&n(e)}}function S(e){return e instanceof T&&1&e.s}function b(e,t,l){for(var n;;){var i=e();if(S(i)&&(i=i.v),!i)return o;if(i.then){n=0;break}var o=l();if(o&&o.then){if(!S(o)){n=1;break}o=o.s}if(t){var a=t();if(a&&a.then&&!S(a)){n=2;break}}}var r=new T,d=y.bind(null,r,2);return(0===n?i.then(s):1===n?o.then(u):a.then(c)).then(void 0,d),r;function u(n){o=n;do{if(t&&(a=t())&&a.then&&!S(a))return void a.then(c).then(void 0,d);if(!(i=e())||S(i)&&!i.v)return void y(r,1,o);if(i.then)return void i.then(s).then(void 0,d);S(o=l())&&(o=o.v)}while(!o||!o.then);o.then(u).then(void 0,d)}function s(e){e?(o=l())&&o.then?o.then(u).then(void 0,d):u(o):y(r,1,o)}function c(){(i=e())?i.then?i.then(s).then(void 0,d):s(i):y(r,1,o)}}function N(e,t){try{var l=e()}catch(e){return t(e)}return l&&l.then?l.then(void 0,t):l}function I(e,t){try{var l=e()}catch(e){return t(!0,e)}return l&&l.then?l.then(t.bind(null,!1),t.bind(null,!0)):t(!1,l)}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const D=e=>{let{number:i,title:o,children:a,defaultOpen:r=!1,tabs:d=null,defaultTab:u="",onTabChange:s=(()=>{})}=e;const[c,v]=l.useState(r),[m,p]=l.useState(u||d&&d[0]||"");return n.createElement("div",{className:"collapsible-card"},n.createElement("div",{className:"collapsible-card-header",onClick:()=>v(!c)},n.createElement("h3",{className:"collapsible-card-title"},i?i+". ":"",o),n.createElement("span",{className:"collapsible-card-arrow "+(c?"rotate":"")},n.createElement(t.ArrowDown,null))),c&&n.createElement("div",{className:"collapsible-card-body"},d&&n.createElement("div",{className:"collapsible-card-tabs"},d.map((e,t)=>n.createElement("button",{key:t,onClick:()=>(e=>{p(e),s(e)})(e),className:"collapsible-card-tab-button "+(m===e?"active":"")},e))),n.createElement("div",{className:"collapsible-card-tab-content"},d?n.createElement("div",{key:m},a(m)):n.createElement("div",null,a))))},C=e=>{let{tenantId:i,isLoading:a,t:d,onSubmit:u,data:s,count:c,setShowToast:v,moduleCode:m,isFixedPoint:p}=e;console.log("WTSearchApplication Rendered",{moduleCode:m,isFixedPoint:p});const E=window.Digit.Utils.browser.isMobile(),f=Digit.UserService.getUser().info,[g,_]=l.useState(!1),[h,T]=l.useState(null),[y,S]=l.useState(!1),b=l.useCallback(function(e){try{return e?(S(!0),_(!0),Promise.resolve(I(function(){return N(function(){return Promise.resolve(Digit.UploadServices.FileFetchbyid(e,i)).then(function(e){if(200!==(null==e?void 0:e.status)||null==e||!e.data)throw new Error("Failed to fetch image");{var t;const l=new Blob([e.data],{type:(null===(t=e.headers)||void 0===t?void 0:t["content-type"])||"image/jpeg"}),n=URL.createObjectURL(l);T(n)}})},function(e){console.error(e)})},function(e,t){if(S(!1),e)throw t;return t}))):Promise.resolve()}catch(e){return Promise.reject(e)}},[i]),C={offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",bookingNo:"",mobileNumber:"",applicantName:"",status:"",fromDate:"",toDate:""},{register:A,control:x,handleSubmit:O,setValue:w,getValues:L,reset:P,formState:R,watch:k}=r.useForm({defaultValues:C}),M=k("fromDate"),{data:F}=Digit.Hooks.wt.useFillPointSearch({tenantId:Digit.ULBService.getCurrentTenantId(),filters:{limit:1e3}},{enabled:!!p}),B=(null==F?void 0:F.fillingPoints)||[],{data:W}=Digit.Hooks.wt.useDriverTripReportSearch({tenantId:i,filters:{bookingNo:Array.isArray(s)?s.map(e=>e.bookingNo).join(","):null}},{enabled:!!s&&Array.isArray(s)&&s.length>0&&"WT"===m}),U=l.useMemo(()=>s&&Array.isArray(s)&&"WT"===m&&null!=W&&W.driverTripReports?s.map(e=>{const t=W.driverTripReports.find(t=>t.bookingNo===e.bookingNo);return{...e,...t}}):s,[s,W,m]),H=e=>n.createElement("span",{className:"cell-text"},e),j=l.useMemo(()=>[{Header:d("S.No"),accessor:(e,t)=>t+1},{Header:d("WT_BOOKING_NO"),accessor:"bookingNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;const l=t.original.bookingNo;return n.createElement("div",null,n.createElement("span",{className:"link"},n.createElement(o.Link,{to:`/digit-ui/${"EMPLOYEE"===f.type?"employee":"citizen"}/wt/bookingsearch/booking-details/${l}`},l)))}},{Header:d("WT_APPLICANT_NAME"),disableSortBy:!0,Cell:e=>{var t,l;let{row:n}=e;return H(null===(t=n.original)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:d("WT_MOBILE_NUMBER"),disableSortBy:!0,Cell:e=>{var t,l;let{row:n}=e;return H(null===(t=n.original)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:d("PT_COMMON_TABLE_COL_STATUS_LABEL"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return H(d(t.original.bookingStatus))}},{Header:d("WT_VEHICLE_NO"),accessor:"vehicleRegistrationNo"},{Header:d("WT_DRIVER_NAME"),accessor:"driverName"},{Header:d("WT_TANK_CAPACITY"),accessor:"tankCapicity"},{Header:d("WT_STATUS"),accessor:"currentStatus"},{Header:d("WT_START_PHOTO"),Cell:e=>{let{row:l}=e;return l.original.startFileStoreId?n.createElement("div",{style:{color:"#f47738",cursor:"pointer",display:"inline-block"},onClick:()=>b(l.original.startFileStoreId)},n.createElement(t.ViewsIcon,null)):d("CS_NA")}},{Header:d("WT_END_PHOTO"),Cell:e=>{let{row:l}=e;return l.original.endFileStoreId?n.createElement("div",{style:{color:"#f47738",cursor:"pointer",display:"inline-block"},onClick:()=>b(l.original.endFileStoreId)},n.createElement(t.ViewsIcon,null)):d("CS_NA")}}],[d,f.type]),V="TP"===m?[{i18nKey:"TP_BOOKING_CREATED",code:"BOOKING_CREATED",value:d("TP_BOOKING_CREATED")},{i18nKey:"TP_PENDING_FOR_APPROVAL",code:"PENDING_FOR_APPROVAL",value:d("TP_PENDING_FOR_APPROVAL")},{i18nKey:"TP_PAYMENT_PENDING",code:"PAYMENT_PENDING",value:d("TP_PAYMENT_PENDING")},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_VERIFICATION",code:"TEAM_ASSIGNMENT_FOR_VERIFICATION",value:d("TP_TEAM_ASSIGNMENT_FOR_VERIFICATION")},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_EXECUTION",code:"TEAM_ASSIGNMENT_FOR_EXECUTION",value:d("TP_TEAM_ASSIGNMENT_FOR_EXECUTION")},{i18nKey:"TP_TREE_PRUNING_SERVICE_COMPLETED",code:"TREE_PRUNING_SERVICE_COMPLETED",value:d("TP_TREE_PRUNING_SERVICE_COMPLETED")}]:[{i18nKey:"WT_BOOKING_CREATED",code:"BOOKING_CREATED",value:d("WT_BOOKING_CREATED")},{i18nKey:"WT_VENDOR_ASSIGNED",code:"VENDOR_ASSIGNED",value:d("WT_VENDOR_ASSIGNED")},{i18nKey:"WT_DELIVERY_PENDING",code:"DELIVERY_PENDING",value:d("WT_DELIVERY_PENDING")},{i18nKey:"WT_DELIVERED",code:"DELIVERED",value:d("WT_DELIVERED")},{i18nKey:"WT_REQUEST_REJECTED",code:"REQUEST_REJECTED",value:d("WT_REQUEST_REJECTED")}],z=l.useCallback(e=>{0!==e.length&&(w("sortBy",e.id),w("sortOrder",e.desc?"DESC":"ASC"))},[w]),K=()=>{P(C),v(null),O(u)()};return n.createElement(n.Fragment,null,n.createElement("div",{className:"CITIZEN"===(null==f?void 0:f.type)?"citizen-wrapper":"employee-wrapper"},n.createElement(D,{title:d("WT_SEARCH_FILTERS_LABEL")||"Search Filters",defaultOpen:!0,tabs:[d("WT_SMART_SEARCH"),d("WT_ADVANCED_SEARCH")],defaultTab:d("WT_SMART_SEARCH")},e=>{var l,i,o,a;return n.createElement("form",{onSubmit:O(u)},e===d("WT_SMART_SEARCH")&&n.createElement("div",{className:"formcomposer-section-grid"},n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_BOOKING_NO")),n.createElement(t.TextInput,{name:"bookingNo",inputRef:A({})})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:A({minLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:d("CORE_COMMON_MOBILE_ERROR")}}),type:"number",maxlength:10}),n.createElement(t.CardLabelError,null,null==R||null===(l=R.errors)||void 0===l||null===(i=l.mobileNumber)||void 0===i?void 0:i.message))),e===d("WT_ADVANCED_SEARCH")&&n.createElement("div",{className:"formcomposer-section-grid"},n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_BOOKING_NO")),n.createElement(t.TextInput,{name:"bookingNo",inputRef:A({})})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_APPLICANT_NAME")),n.createElement(t.TextInput,{name:"applicantName",inputRef:A({})})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:A({minLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:d("CORE_COMMON_MOBILE_ERROR")}}),type:"number",maxlength:10}),n.createElement(t.CardLabelError,null,null==R||null===(o=R.errors)||void 0===o||null===(a=o.mobileNumber)||void 0===a?void 0:a.message)),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("PT_COMMON_TABLE_COL_STATUS_LABEL")),n.createElement(r.Controller,{control:x,name:"status",render:e=>n.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:V,optionKey:"i18nKey",t:d})})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("FROM_DATE")),n.createElement(r.Controller,{render:e=>n.createElement(t.DatePicker,{date:e.value,onChange:e.onChange,max:(new Date).toISOString().split("T")[0]}),name:"fromDate",control:x})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("TO_DATE")),n.createElement(r.Controller,{render:e=>n.createElement(t.DatePicker,{date:e.value,onChange:e.onChange,min:M}),name:"toDate",control:x})),p&&n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_FILLING_POINT")),n.createElement(r.Controller,{control:x,name:"fillingPointId",render:e=>n.createElement(t.Dropdown,{selected:B.find(t=>(t.id||t.fillingPointId||t.bookingId)===e.value),select:t=>e.onChange((null==t?void 0:t.id)||(null==t?void 0:t.fillingPointId)||(null==t?void 0:t.bookingId)),onBlur:e.onBlur,option:B,optionKey:"fillingPointName",t:d})}))),n.createElement("div",{className:"wt-search-actions",style:{display:"flex",justifyContent:E?"center":"flex-end",flexDirection:E?"column-reverse":"row",gap:"24px",marginTop:"16px"}},n.createElement("span",{className:"generic-button clear-search",onClick:K,style:{cursor:"pointer",alignSelf:"center"}},d("ES_COMMON_CLEAR_ALL")),n.createElement("div",{style:{minWidth:E?"100%":"160px"}},n.createElement(t.SubmitBar,{label:d("ES_COMMON_SEARCH"),submit:!0}))))}),!a&&null!=s&&s.display?n.createElement(t.Card,{style:{marginTop:20}},d(s.display).split("\\n").map((e,t)=>n.createElement("p",{key:t,style:{textAlign:"center"}},e))):a||""===s?(""!==s||a)&&n.createElement(t.Loader,null):n.createElement(t.Table,{t:d,data:U,totalRecords:c,columns:j,getCellProps:e=>({style:{minWidth:e.column.Header===d("WT_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:e=>{w("limit",Number(e.target.value)),O(u)()},currentPage:L("offset")/L("limit"),onNextPage:()=>{w("offset",L("offset")+L("limit")),O(u)()},onPrevPage:()=>{const e=L("offset"),t=L("limit");e-t>=0&&(w("offset",e-t),O(u)())},pageSizeLimit:L("limit"),onSort:z,disableSort:!1,sortParams:[{id:L("sortBy"),desc:"DESC"===L("sortOrder")}]})),g&&n.createElement(t.Modal,{headerBarMain:n.createElement("h1",{className:"heading-m"},d("WT_VIEW_PHOTO")),headerBarEnd:n.createElement("div",{className:"icon-bg-secondary",onClick:()=>{_(!1),T(null)},style:{cursor:"pointer"}},n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF",width:"24",height:"24"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))),hideSubmit:!0,actionCancelLabel:d("CS_COMMON_CLOSE"),actionCancelOnSubmit:()=>{_(!1),T(null)}},n.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px"}},y?n.createElement(t.Loader,null):h?n.createElement("img",{src:h,alt:"View",style:{maxWidth:"100%",maxHeight:"500px"}}):n.createElement("p",null,d("CS_COMMON_NO_DATA")))))},A=e=>{let{moduleCode:o}=e;const{t:a}=i.useTranslation(),r=Digit.ULBService.getCurrentTenantId(),[d,u]=l.useState({}),[s,c]=l.useState(null);l.useEffect(()=>{if(s){const e=setTimeout(()=>{c(null)},1e3);return()=>clearTimeout(e)}},[s]);const v={enabled:!!(d&&Object.keys(d).length>0)};let m=[],p=0,E=!1,f=!1,g=!1,_=null;return"WT"===o?({isLoading:E,isSuccess:f,isError:g,error:_,data:{waterTankerBookingDetail:m=[],count:p=0}={}}=Digit.Hooks.wt.useTankerSearchAPI({tenantId:r,filters:d},v)):"MT"===o?({isLoading:E,isSuccess:f,isError:g,error:_,data:{mobileToiletBookingDetails:m=[],Count:p=0}={}}=Digit.Hooks.wt.useMobileToiletSearchAPI({tenantId:r,filters:d},v)):"TP"===o&&({isLoading:E,isSuccess:f,isError:g,error:_,data:{treePruningBookingDetails:m=[],Count:p=0}={}}=Digit.Hooks.wt.useTreePruningSearchAPI({tenantId:r,filters:d},v)),n.createElement(n.Fragment,null,n.createElement(C,{t:a,isLoading:E,tenantId:r,setShowToast:c,onSubmit:function(e){const{fromDate:t,toDate:l}=e,n={...e,...l?{toDate:l}:{},...t?{fromDate:t}:{}};let i=Object.keys(n).filter(e=>n[e]).reduce((e,t)=>({...e,[t]:"object"==typeof n[t]?n[t].code:n[t]}),{});!(Object.keys(i).length>0)||i.bookingNo||i.fromDate||i.status||i.toDate||i.mobileNumber?i.fromDate&&!i.toDate||!i.fromDate&&i.toDate?c({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):u(i):c({warning:!0,label:"ERR_PROVIDE_ONE_PARAMETERS"})},data:f&&!E?m.length>0?m:{display:"ES_COMMON_NO_DATA"}:"",count:p,moduleCode:o}),s&&n.createElement(t.Toast,{error:s.error,warning:s.warning,label:a(s.label),onClose:()=>c(null)}))},x=()=>{var e,l,a,r,d,u,s,c,v,p,E,f;const{t:g}=i.useTranslation(),_=o.useLocation(),{path:h}=o.useRouteMatch(),T=null===(e=Digit)||void 0===e||null===(l=e.ComponentRegistryService)||void 0===l?void 0:l.getComponent("WTCreate"),y=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("WTApplicationDetails"),S=null===(d=Digit)||void 0===d||null===(u=d.ComponentRegistryService)||void 0===u?void 0:u.getComponent("MTApplicationDetails"),b=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("TPApplicationDetails"),N=null===(v=Digit)||void 0===v||null===(p=v.ComponentRegistryService)||void 0===p?void 0:p.getComponent("WTMyApplications"),I=Digit.ComponentRegistryService.getComponent("WTEmpInbox"),D=null===(E=Digit)||void 0===E||null===(f=E.ComponentRegistryService)||void 0===f?void 0:f.getComponent("ApplicationDetails"),C=e=>({searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:[e],applicationStatus:[],locality:[]}}),x=C("watertanker"),O=C("mobileToilet");return n.createElement("span",{style:{width:"100%"}},n.createElement(o.Switch,null,n.createElement(t.AppContainer,null,n.createElement("div",{className:"ground-container employee-app-container form-container"},n.createElement(t.ModuleHeader,{leftContent:n.createElement(n.Fragment,null,n.createElement(t.ArrowLeft,{className:"icon"}),g("CS_COMMON_BACK")),onLeftClick:()=>window.history.back(),breadcrumbs:(()=>{const e=_.pathname;let l=[{icon:t.HomeIcon,path:"/digit-ui/citizen"},{label:g("WT_MODULE_NAME"),path:h+"/wt-Vendor"}];if(e.includes("/inbox")){let n="ES_COMMON_INBOX";e.includes("/mt/inbox")&&(l=[{icon:t.HomeIcon,path:"/digit-ui/citizen"},{label:g("ACTION_TEST_MT"),path:h+"/mt-Vendor"}]),l.push({label:g(n)})}else if(e.includes("/my-bookings")){let t="WT_SEARCH_BOOKINGS";e.includes("/mt/my-bookings")&&(t="MT_SEARCH_BOOKINGS"),l.push({label:g(t)})}else e.includes("/status")?l.push({label:g("WT_MY_APPLICATIONS")}):(e.includes("/booking/")||e.includes("/booking-details")||e.includes("/bookingsearch/booking-details"))&&(l.push({label:g("ES_COMMON_INBOX"),path:e.includes("/mt/")?h+"/mt/inbox":h+"/inbox"}),l.push({label:g("WT_BOOKING_DETAILS")}));return l})()}),n.createElement("div",{className:"employee-form-content abcd"},n.createElement(t.PrivateRoute,{path:h+"/inbox",component:()=>n.createElement(I,{useNewInboxAPI:!0,parentRoute:h,moduleCode:"WT",businessService:"watertanker",filterComponent:"WT_INBOX_FILTER",initialStates:x,isInbox:!0})}),n.createElement(t.PrivateRoute,{path:h+"/mt/inbox",component:()=>n.createElement(I,{useNewInboxAPI:!0,parentRoute:h,businessService:"mobileToilet",moduleCode:"MT",filterComponent:"WT_INBOX_FILTER",initialStates:O,isInbox:!0})}),n.createElement(t.PrivateRoute,{path:h+"/request-service",component:T}),n.createElement(t.PrivateRoute,{path:h+"/status",component:N}),n.createElement(t.PrivateRoute,{path:h+"/booking/waterTanker/:acknowledgementIds/:tenantId",component:y}),n.createElement(t.PrivateRoute,{path:h+"/booking/mobileToilet/:acknowledgementIds/:tenantId",component:S}),n.createElement(t.PrivateRoute,{path:h+"/booking/treePruning/:acknowledgementIds/:tenantId",component:b}),n.createElement(t.PrivateRoute,{path:h+"/booking-details/:id",component:()=>n.createElement(D,{parentRoute:h})}),n.createElement(t.PrivateRoute,{path:h+"/bookingsearch/booking-details/:id",component:()=>n.createElement(D,{parentRoute:h})}),n.createElement(t.PrivateRoute,{path:h+"/vendor",component:()=>Digit.UserService.hasAccess(["WT_VENDOR"])?n.createElement("div",{style:{display:"flex",gap:"24px",flexWrap:"wrap",width:"100%",padding:"8px 0"}},n.createElement(t.CitizenHomeCard,{header:g("WT_MODULE_NAME"),links:[{i18nKey:g("ES_COMMON_INBOX"),link:"/digit-ui/citizen/wt/inbox"},{i18nKey:g("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/citizen/wt/my-bookings"},{i18nKey:g("WT_REQUEST_TANKER"),link:"/digit-ui/citizen/wt/request-service"}],Icon:()=>n.createElement(t.CHBIcon,{className:"fill-path-primary-main"})}),n.createElement(t.CitizenHomeCard,{header:g("TITLE_VENDOR_MANAGEMENT"),links:[{i18nKey:g("SEARCH_VENDOR"),link:"/digit-ui/citizen/vendor/search-vendor"}],Icon:()=>n.createElement(t.PropertyHouse,{className:"fill-path-primary-main"})})):n.createElement(o.Redirect,{to:{pathname:"/digit-ui/citizen/login",state:{from:h+"/wt-Vendor",role:"WT_VENDOR"}}})}),n.createElement(t.PrivateRoute,{path:h+"/mt-Vendor",component:()=>Digit.UserService.hasAccess(["MT_VENDOR"])?n.createElement("div",{style:{display:"flex",gap:"24px",flexWrap:"wrap",width:"100%",padding:"8px 0"}},n.createElement(t.CitizenHomeCard,{header:g("ACTION_TEST_MT"),links:[{i18nKey:g("ES_COMMON_INBOX"),link:"/digit-ui/citizen/wt/mt/inbox"},{i18nKey:g("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/citizen/wt/mt/my-bookings"},{i18nKey:g("MT_REQUEST_TANKER"),link:"/digit-ui/citizen/wt/request-service"}],Icon:()=>n.createElement(t.CHBIcon,{className:"fill-path-primary-main"})}),n.createElement(t.CitizenHomeCard,{header:g("TITLE_VENDOR_MANAGEMENT"),links:[{i18nKey:g("SEARCH_VENDOR"),link:"/digit-ui/citizen/vendor/search-vendor"}],Icon:()=>n.createElement(t.PropertyHouse,{className:"fill-path-primary-main"})})):n.createElement(o.Redirect,{to:{pathname:"/digit-ui/citizen/login",state:{from:h+"/mt-Vendor",role:"MT_VENDOR"}}})}),n.createElement(t.PrivateRoute,{path:h+"/my-bookings",component:e=>n.createElement(A,m({},e,{parentRoute:h,moduleCode:"WT"}))}),n.createElement(t.PrivateRoute,{path:h+"/mt/my-bookings",component:e=>n.createElement(A,m({},e,{parentRoute:h,moduleCode:"MT"}))}))))))},O=e=>{let{onSubmit:a,setExistingDataSet:r}=e;const{t:d}=i.useTranslation(),u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[s,c]=l.useState(null),[v,m]=l.useState(!1),{offset:p}=o.useParams();l.useEffect(()=>{v&&(a(),m(!1))},[v,a]);let E={limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:p&&!isNaN(parseInt(p))?p:"0",tenantId:u};l.useEffect(()=>{c(E)},[p]);const{isLoading:f,data:g}=Digit.Hooks.wt.useTankerSearchAPI({filters:s});if(f)return n.createElement(t.Loader,null);const _=(null==g?void 0:g.waterTankerBookingDetail)||[],h={padding:"10px",margin:"10px 0",border:"1px solid #ccc",transition:"background-color 0.3s ease, box-shadow 0.3s ease"},T={boxShadow:"1px 4px 4px 7px rgba(0, 0, 0, 0.5)"};return n.createElement(n.Fragment,null,n.createElement("div",null,_.length>0&&_.map((e,l)=>{var i;return n.createElement("div",{key:l},n.createElement(t.Card,{style:{...h,cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=T.backgroundColor,e.currentTarget.style.boxShadow=T.boxShadow},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="",e.currentTarget.style.boxShadow=""},onClick:()=>{(e=>{var t,l,n,i,o,a,d,u,s,c,v,p,E,f,g,_,h,T;const y={address:{houseNo:null==e||null===(t=e.address)||void 0===t?void 0:t.houseNo,streetName:null==e||null===(l=e.address)||void 0===l?void 0:l.streetName,addressline1:null==e||null===(n=e.address)||void 0===n?void 0:n.addressLine1,addressline2:null==e||null===(i=e.address)||void 0===i?void 0:i.addressLine2,landmark:null==e||null===(o=e.address)||void 0===o?void 0:o.landmark,pincode:null==e||null===(a=e.address)||void 0===a?void 0:a.pincode,cityValue:{code:null==e||null===(d=e.address)||void 0===d?void 0:d.city,value:null==e||null===(u=e.address)||void 0===u?void 0:u.city,i18nKey:null==e||null===(s=e.address)||void 0===s?void 0:s.city,city:{name:null==e||null===(c=e.address)||void 0===c?void 0:c.city,code:null==e||null===(v=e.address)||void 0===v?void 0:v.cityCode}},locality:{code:null==e||null===(p=e.address)||void 0===p?void 0:p.localityCode,value:null==e||null===(E=e.address)||void 0===E?void 0:E.locality,i18nKey:null==e||null===(f=e.address)||void 0===f?void 0:f.locality}},owner:{applicantName:null==e||null===(g=e.applicantDetail)||void 0===g?void 0:g.name,mobileNumber:null==e||null===(_=e.applicantDetail)||void 0===_?void 0:_.mobileNumber,alternateNumber:null==e||null===(h=e.applicantDetail)||void 0===h?void 0:h.alternateNumber,emailId:null==e||null===(T=e.applicantDetail)||void 0===T?void 0:T.emailId},requestDetails:{deliveryDate:null==e?void 0:e.deliveryDate,deliveryTime:null==e?void 0:e.deliveryTime,waterQuantity:{code:null==e?void 0:e.waterQuantity,value:null==e?void 0:e.waterQuantity,i18nKey:null==e?void 0:e.waterQuantity},tankerType:{code:null==e?void 0:e.tankerType,value:null==e?void 0:e.tankerType,i18nKey:null==e?void 0:e.tankerType},description:null==e?void 0:e.description}};r(y),m(!0)})(e)}},n.createElement(t.KeyNote,{keyValue:d("BOOKING_NO"),note:null==e?void 0:e.bookingNo}),n.createElement(t.KeyNote,{keyValue:d("APPLICANT_NAME"),note:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name}),n.createElement(t.KeyNote,{keyValue:d("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:d(""+(null==e?void 0:e.bookingStatus))})))}),0===_.length&&!f&&n.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},d("NO_APPLICATION_FOUND_MSG"))))},w=n.memo(e=>{let{t:t}=e;return n.createElement("h1",{className:"heading-m"},t("MY_BOOKINGS"))}),L=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),P=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(L,null)),R=e=>{let{t:i,closeModal:o,onSubmit:a,setExistingDataSet:r}=e;const[d,u]=l.useState(!1),[s,c]=l.useState(!1),v=l.useCallback(()=>{s&&(a(),c(!1))},[s,a]);return l.useEffect(()=>{v()},[v]),n.createElement(n.Fragment,null,n.createElement(t.Modal,{headerBarMain:n.createElement(w,{t:i}),headerBarEnd:n.createElement(P,{onClick:o}),actionCancelLabel:d&&i("CS_COMMON_BACK"),actionCancelOnSubmit:()=>u(!1),hideSubmit:!0,formId:"modal-action"},n.createElement(t.Card,{style:{boxShadow:"none"}},d&&n.createElement(O,{onSubmit:a,setExistingDataSet:r}),n.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},!d&&n.createElement(t.SubmitBar,{label:i("USE_EXISTING_DETAILS"),onSubmit:()=>{u(!0)}}),!d&&n.createElement(t.SubmitBar,{label:i("FILL_NEW_DETAILS"),onSubmit:()=>{c(!0)}})))))},k=e=>{let{jumpTo:l}=e;i.useTranslation();const a=o.useHistory();return n.createElement(t.LinkButton,{label:n.createElement(t.EditIcon,{style:{marginTop:"-30px",float:"right",position:"relative",bottom:"32px"}}),className:"check-page-link-button",onClick:function(){a.push(l)}})},M=e=>{Digit.UploadServices.Filefetch([e],Digit.ULBService.getStateId()).then(e=>{var t,l,n;const i=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.url;if(i){const e=i.split(",")[0];e?window.open(e,"_blank"):console.error("No valid URL found to open!")}else console.error("URL is missing in the response!")}).catch(e=>{console.error("Error fetching file:",e)})},F=e=>e.substr(0,1).toUpperCase()+e.substr(1),B=function(e,t,l){try{var n,i,o,a,r,d,u,s,c,v,m,p,g,_;return console.log("booking",e),console.log("tenantInfo",t),Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${h=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),h.toLowerCase().split(" ").map(F).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.bookingNo,isTOCRequired:!1,heading:l("WT_ACKNOWLEDGEMENT"),details:[{title:l("WT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:l("WT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:l("WT_ALT_MOBILE_NUMBER"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.alternateNumber},{title:l("WT_EMAIL_ID"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.emailId}].filter(e=>e.value)},{title:l("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_PINCODE"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.pincode},{title:l("WT_CITY"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.city},{title:l("WT_LOCALITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.locality},{title:l("WT_STREET_NAME"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.streetName},{title:l("WT_DOOR_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.doorNo},{title:l("WT_HOUSE_NO"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.houseNo},{title:l("WT_ADDRESS_LINE1"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.addressLine1},{title:l("WT_ADDRESS_LINE2"),value:null==e||null===(g=e.address)||void 0===g?void 0:g.addressLine2},{title:l("WT_LANDMARK"),value:null==e||null===(_=e.address)||void 0===_?void 0:_.landmark}].filter(e=>e.value)},{title:l("WT_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_TANKER_TYPE"),value:null==e?void 0:e.tankerType},{title:l("WT_WATER_TYPE"),value:l(null==e?void 0:e.waterType)},{title:l("WT_TANKER_QUANTITY"),value:null==e?void 0:e.tankerQuantity},{title:l("WT_WATER_QUANTITY"),value:(null==e?void 0:e.waterQuantity)+" Ltr"},{title:l("WT_DELIVERY_DATE_TIME"),value:`${f(null==e?void 0:e.deliveryDate)} (${E(null==e?void 0:e.deliveryTime)})`},{title:l("WT_DESCRIPTION"),value:null==e?void 0:e.description},{title:l("WT_IMMEDIATE"),value:l("Y"===(null==e?void 0:e.extraCharge)?"YES":"NO")}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var h},W=e=>{const{t:t}=i.useTranslation();return e.isSuccess?t("WT_SUBMIT_SUCCESSFULL"):e.isLoading?t("WT_APPLICATION_PENDING"):e.isSuccess?void 0:t("WT_APPLICATION_FAILED")},U={padding:"4px 0px",justifyContent:"space-between"},H=e=>{var l,i;return n.createElement(t.Banner,{message:W(e),applicationNumber:null===(l=e.data)||void 0===l||null===(i=l.waterTankerBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("WT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},j=()=>{const{t:e}=i.useTranslation(),l=Digit.ULBService.getCurrentTenantId(),o="WT_EMERGENCY_WATER_TANKER_REQUEST"!==e("WT_EMERGENCY_WATER_TANKER_REQUEST")?e("WT_EMERGENCY_WATER_TANKER_REQUEST"):"Emergency Water Tanker Request",{data:a,isLoading:r}=Digit.Hooks.useNewInboxGeneral({tenantId:l,ModuleCode:"WT",filters:{limit:10,offset:0,services:["watertanker"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.wtAccess()}}),{data:d,isLoading:u}=Digit.Hooks.useNewInboxGeneral({tenantId:l,ModuleCode:"WT",filters:{limit:10,offset:0,services:["watertanker-fixedpoint"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.wtAccess()}}),s=r?"-":(null==a?void 0:a.totalCount)??0,c=u?"-":(null==d?void 0:d.totalCount)??0,v=[{count:s,label:e("ES_COMMON_INBOX_CITIZEN"),link:"/digit-ui/employee/wt/inbox"},{count:c,label:e("ES_COMMON_INBOX_FIXED_POINT"),link:"/digit-ui/employee/wt/fixed-point/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/wt/my-bookings"},{label:e("WT_APPLICATION_CREATE"),link:"/digit-ui/employee/wt/request-service"},{label:o,link:"/digit-ui/employee/wt/fixed-point/request-service"},{label:e("WT_FIXED_POINT_SCHEDULE_MANAGEMENT"),link:"/digit-ui/employee/wt/fixed-point-schedule"},{label:e("WT_LIVE_TRACKING_SYSTEM"),link:"/digit-ui/employee/wt/live-tracking"},{label:e("WT_SEARCH_FIX_POINT"),link:"/digit-ui/employee/wt/search-filling-fix-point"},{label:e("Vendor_Assign"),link:"/digit-ui/employee/wt/vendor-assignment"}],m=Digit.UserService.hasAccess(["WT_CEMP"])||!1,p={Icon:n.createElement(t.CHBIcon,null),moduleName:e("WT_MODULE_NAME"),kpis:[{count:r?"-":s,label:"WT_ONLINE_INBOX"!==e("WT_ONLINE_INBOX")?e("WT_ONLINE_INBOX"):"General Inbox",link:"/digit-ui/employee/wt/inbox"},{count:u?"-":c,label:"WT_EMERGENCY_INBOX"!==e("WT_EMERGENCY_INBOX")?e("WT_EMERGENCY_INBOX"):"Emergency Inbox",link:"/digit-ui/employee/wt/fixed-point/inbox"}],links:v.filter(e=>!(null!=e&&e.role)||m)};return n.createElement(t.EmployeeModuleCard,p)},V=e=>{let{t:l,currentPage:i,columns:o,data:a,getCellProps:r,disableSort:d,onSort:u,onNextPage:s,onPrevPage:c,onPageSizeChange:v,isPaginationRequired:p,pageSizeLimit:E,sortParams:f,totalRecords:g,showCSVExport:_,csvExportFileName:h,csvExportData:T,getCSVExportData:y,csvExportColumns:S,csvExportButtonLabel:b,...N}=e;return n.createElement(t.Table,m({t:l,data:a,currentPage:i,columns:o,getCellProps:r,onNextPage:s,onPrevPage:c,pageSizeLimit:E,disableSort:d,isPaginationRequired:p,onPageSizeChange:v,onSort:u,sortParams:f,totalRecords:g,showCSVExport:_,csvExportFileName:h,csvExportData:T,getCSVExportData:y,csvExportColumns:S,csvExportButtonLabel:b,inboxStyles:{overflowX:"scroll"}},N))},z=e=>{let{businessService:l}=e;const{t:o}=i.useTranslation();return n.createElement(t.Card,{className:"filter inboxLinks"},n.createElement("div",{className:"complaint-links-container"},"CITIZEN"!==Digit.UserService.getUser().info.type&&n.createElement("div",{className:"header"},n.createElement("span",{className:"logo"},n.createElement(t.HomeIcon,null))," ",n.createElement("span",{className:"text"},o(l+"_REQUEST")))))},K={mobileNumber:t.MobileNumber},G=["vendorName","vehicleName","driverName","fillingPointId"],Y=e=>null==e?"":String(e),q=e=>(null==e?void 0:e.name)||(null==e?void 0:e.vendor_id)||"",$=e=>(null==e?void 0:e.registrationNumber)||(null==e?void 0:e.name)||(null==e?void 0:e.type)||"",X=e=>{var t;return(null==e?void 0:e.name)||(null==e||null===(t=e.owner)||void 0===t?void 0:t.name)||(null==e?void 0:e.licenseNumber)||""},Q=e=>(null==e?void 0:e.fillingPointName)||(null==e?void 0:e.name)||"",Z=e=>"object"==typeof e?(null==e?void 0:e.id)||(null==e?void 0:e.fillingPointId)||(null==e?void 0:e.bookingId)||"":Y(e),J=function(e,t,l,n){if(void 0===e&&(e=[]),void 0===n&&(n=[]),!t)return null;const i=("object"==typeof t?[l(t),...n.map(e=>null==t?void 0:t[e])]:[t]).map(Y).filter(Boolean);return e.find(e=>[l(e),...n.map(t=>null==e?void 0:e[t])].map(Y).filter(Boolean).some(e=>i.includes(e)))||("object"==typeof t?t:null)},ee=e=>{var o;let{onSearch:a,type:d,onClose:u,searchFields:s,searchParams:c,isInboxPage:v,clearSearch:m}=e;const{t:p}=i.useTranslation(),{handleSubmit:E,reset:f,watch:g,control:_,formState:h,setValue:T}=r.useForm({defaultValues:v?c:{locality:null,city:null,...c}}),y=g(),S=window.innerWidth<=640,b=e=>{const t={...e};if(e.mobileNumber||delete t.mobileNumber,C){const e="object"==typeof t.vendorName?q(t.vendorName):Y(t.vendorName),l="object"==typeof t.vehicleName?$(t.vehicleName):Y(t.vehicleName),n="object"==typeof t.driverName?X(t.driverName):Y(t.driverName),i="object"==typeof t.fillingPointId?Z(t.fillingPointId):Y(t.fillingPointId);e?t.vendorName=e:delete t.vendorName,l?t.vehicleName=l:delete t.vehicleName,n?t.driverName=n:delete t.driverName,i?t.fillingPointId=i:delete t.fillingPointId}t.delete=[],s.forEach(e=>{t[e.name]||t.delete.push(e.name)}),C&&G.forEach(e=>{t[e]||t.delete.push(e)}),a(t),"mobile"===d&&u()};function N(){const e=s.reduce((e,t)=>({...e,[null==t?void 0:t.name]:""}),{});if(C&&G.forEach(t=>{e[t]=""}),f(e),v){const e={...c};e.delete=[],s.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),C&&G.forEach(t=>{e.delete.push(t)}),a({...e})}else m()}const I=e=>n.createElement(t.LinkLabel,{style:{display:"inline",...e?{margin:0}:{}},onClick:N},p("ES_COMMON_CLEAR_SEARCH")),C=window.location.href.includes("fixed-point"),{data:A}=Digit.Hooks.wt.useFillPointSearch({tenantId:Digit.ULBService.getCurrentTenantId(),filters:{limit:1e3}},{enabled:!!C}),x=(null==A?void 0:A.fillingPoints)||[],O=l.useMemo(()=>x.map(e=>({...e,name:Q(e)||"NA"})),[x]),w=l.useMemo(()=>J(O,null==y?void 0:y.fillingPointId,Q,["id","fillingPointId","bookingId","name"]),[O,null==y?void 0:y.fillingPointId]),L=Z(w||(null==y?void 0:y.fillingPointId)),{data:P}=Digit.Hooks.fsm.useVendorSearch({tenantId:Digit.ULBService.getCurrentTenantId(),filters:{limit:1e3,...L?{fillingPointId:L}:{}},config:{enabled:!!C}}),R=l.useMemo(()=>((null==P?void 0:P.vendor)||[]).map(e=>({...e,name:q(e)||"NA"})),[P]),k=l.useMemo(()=>J(R,null==y?void 0:y.vendorName,q,["id","vendor_id","name"]),[R,null==y?void 0:y.vendorName]),M=l.useMemo(()=>R.flatMap(e=>((null==e?void 0:e.vehicles)||[]).map(t=>({...t,name:$(t)||"NA",vendorId:null==e?void 0:e.id}))),[R]),F=l.useMemo(()=>R.flatMap(e=>((null==e?void 0:e.drivers)||[]).map(t=>({...t,name:X(t)||"NA",vendorId:null==e?void 0:e.id}))),[R]),B=l.useMemo(()=>k?((null==k?void 0:k.vehicles)||[]).map(e=>({...e,name:$(e)||"NA",vendorId:null==k?void 0:k.id})):M,[M,k]),W=l.useMemo(()=>k?((null==k?void 0:k.drivers)||[]).map(e=>({...e,name:X(e)||"NA",vendorId:null==k?void 0:k.id})):F,[F,k]);return n.createElement("form",{id:"search-form",onSubmit:E(b),className:" search-complaint-container"},n.createElement(n.Fragment,null,("mobile"===d||S)&&n.createElement("div",{className:"complaint-header"},n.createElement("h2",null,p("ES_COMMON_SEARCH_BY")),n.createElement("span",{onClick:u},n.createElement(t.CloseSvg,null))),C?n.createElement(D,{title:p("WT_SEARCH_FILTERS_LABEL")||"Search Filters",defaultOpen:!0,tabs:[p("WT_SMART_SEARCH"),p("WT_ADVANCED_SEARCH")],defaultTab:p("WT_SMART_SEARCH")},e=>n.createElement("div",{className:"formcomposer-section-grid"},e===p("WT_SMART_SEARCH")&&n.createElement(l.Fragment,null,null==s?void 0:s.map(e=>"bookingNo"!==e.name&&"mobileNumber"!==e.name?null:n.createElement("div",{key:e.name,className:"input-fields"},n.createElement("span",{className:"mobile-input"},n.createElement(t.Label,null,p(e.label)+" "+(e.isMendatory?"*":"")),n.createElement(r.Controller,e.type?{render:t=>n.createElement(null==K?void 0:K[e.type],{formValue:y,setValue:T,onChange:t.onChange,value:t.value}),name:e.name,control:_,defaultValue:""}:{render:e=>n.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:_,defaultValue:""}))))),e===p("WT_ADVANCED_SEARCH")&&n.createElement(l.Fragment,null,null==s?void 0:s.map(e=>n.createElement("div",{key:e.name,className:"input-fields"},n.createElement("span",{className:"mobile-input"},n.createElement(t.Label,null,p(e.label)+" "+(e.isMendatory?"*":"")),n.createElement(r.Controller,e.type?{render:t=>n.createElement(null==K?void 0:K[e.type],{formValue:y,setValue:T,onChange:t.onChange,value:t.value}),name:e.name,control:_,defaultValue:""}:{render:e=>n.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:_,defaultValue:""})))),n.createElement("div",{className:"input-fields"},n.createElement("span",{className:"mobile-input"},n.createElement(t.Label,null,p("WT_FILLING_POINT")),n.createElement(r.Controller,{control:_,name:"fillingPointId",render:e=>n.createElement(t.Dropdown,{selected:J(O,e.value,Q,["id","fillingPointId","bookingId","name"]),select:t=>{e.onChange(t),T("vendorName",""),T("vehicleName",""),T("driverName","")},onBlur:e.onBlur,option:O,optionKey:"name",t:p})}))),n.createElement("div",{className:"input-fields"},n.createElement("span",{className:"mobile-input"},n.createElement(t.Label,null,p("WT_VENDOR_NAME")),n.createElement(r.Controller,{control:_,name:"vendorName",render:e=>n.createElement(t.Dropdown,{selected:J(R,e.value,q,["id","vendor_id","name"]),select:t=>{e.onChange(t),T("vehicleName",""),T("driverName","")},onBlur:e.onBlur,option:R,optionKey:"name",t:p})}))),n.createElement("div",{className:"input-fields"},n.createElement("span",{className:"mobile-input"},n.createElement(t.Label,null,p("WT_VEHICLE_NO")),n.createElement(r.Controller,{control:_,name:"vehicleName",render:e=>n.createElement(t.Dropdown,{selected:J(B,e.value,$,["id","registrationNumber","name"]),select:e.onChange,onBlur:e.onBlur,option:B,optionKey:"name",t:p})}))),n.createElement("div",{className:"input-fields"},n.createElement("span",{className:"mobile-input"},n.createElement(t.Label,null,p("WT_DRIVER_NAME")),n.createElement(r.Controller,{control:_,name:"driverName",render:e=>n.createElement(t.Dropdown,{selected:J(W,e.value,X,["id","ownerId","licenseNumber","name"]),select:e.onChange,onBlur:e.onBlur,option:W,optionKey:"name",t:p})})))))):n.createElement("div",{className:"formcomposer-section-grid"},null==s||null===(o=s.filter(e=>!0))||void 0===o?void 0:o.map((e,l)=>{var i,o,a,d,u;return n.createElement("div",{key:e.name,className:"input-fields"},n.createElement("span",{className:"mobile-input"},n.createElement(t.Label,null,p(e.label)+" "+(e.isMendatory?"*":"")),n.createElement(r.Controller,e.type?{render:t=>n.createElement(null==K?void 0:K[e.type],{formValue:y,setValue:T,onChange:t.onChange,value:t.value}),name:e.name,control:_,defaultValue:""}:{render:e=>n.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:_,defaultValue:""})),null!=h&&null!==(i=h.dirtyFields)&&void 0!==i&&i[e.name]&&null!=h&&null!==(o=h.errors)&&void 0!==o&&null!==(a=o[e.name])&&void 0!==a&&a.message?n.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==h||null===(d=h.errors)||void 0===d||null===(u=d[e.name])||void 0===u?void 0:u.message):null)})),n.createElement("div",{className:"formcomposer-section-button"},v?n.createElement("div",{className:"generic-button clear-search"},n.createElement("p",{onClick:N},p("ES_COMMON_CLEAR_SEARCH"))):n.createElement("div",null,I()),"desktop"===d&&!S&&n.createElement(t.SubmitBar,{className:"generic-button",disabled:!!Object.keys(h.errors).length||(()=>{var e;let t=!0;return Object.keys(y).forEach(e=>{!["locality","city"].includes(e)&&y[e]&&(t=!1)}),null==s||!s.find(e=>"locality"===e.name)||null!=y&&null!==(e=y.locality)&&void 0!==e&&e.code||(t=!0),t})(),label:p("ES_COMMON_SEARCH"),onClick:E(b),submit:!0,form:"search-form"})),("mobile"===d||S)&&n.createElement(t.ActionBar,{className:"clear-search-container"},n.createElement("button",{className:"clear-search",style:{flex:1}},I(S)),n.createElement(t.SubmitBar,{disabled:!!Object.keys(h.errors).length,label:p("ES_COMMON_SEARCH"),style:{flex:1},onClick:E(b),submit:!0}))))},te=e=>{var o;let{tableConfig:a,filterComponent:r,...d}=e;const{data:u,useNewInboxAPI:s}=d,{t:c}=i.useTranslation(),v=n.useCallback(e=>{var t,l,n,i;const o=(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.auditDetails)||void 0===l?void 0:l.createdTime)||(null==e||null===(n=e.workflowData)||void 0===n||null===(i=n.auditDetails)||void 0===i?void 0:i.createdTime);return o?`${Digit.DateUtils.ConvertEpochToDate(o)} ${Digit.DateUtils.ConvertEpochToTimeInHours(o)}`:""},[]),[m,p]=l.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r)}),[E,f]=l.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(d.EmptyResultInboxComp)}),[g,_]=l.useState(!1),h=n.useMemo(()=>d.isSearch?a.searchColumns(d):a.inboxColumns(d)||[],[]),T=n.useMemo(()=>{var e,t,l,n,i;const o=[{Header:(null==h||null===(e=h[0])||void 0===e?void 0:e.Header)||c("WT_BOOKING_NO"),exportAccessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""}},{Header:(null==h||null===(t=h[1])||void 0===t?void 0:t.Header)||c("WT_APPLICANT_NAME"),exportAccessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""}},{Header:(null==h||null===(l=h[2])||void 0===l?void 0:l.Header)||c("WT_MOBILE_NUMBER"),exportAccessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""}},{Header:(null==h||null===(n=h[3])||void 0===n?void 0:n.Header)||c("LOCALITY"),exportAccessor:e=>{var t,l;if(null==e||null===(t=e.searchData)||void 0===t||!t.localityCode)return"";const n=((null==e||null===(l=e.searchData)||void 0===l?void 0:l.tenantId)||Digit.ULBService.getCurrentTenantId()||"djb").replace(".","_").toUpperCase();return c(`${n}_REVENUE_${e.searchData.localityCode}`)}}];var a,r,d,u,s,m;return null!=h&&h.some(e=>"fillingPoint"===(null==e?void 0:e.id))&&o.push({Header:(null==h||null===(a=h.find(e=>"fillingPoint"===(null==e?void 0:e.id)))||void 0===a?void 0:a.Header)||c("Filling Point"),exportAccessor:e=>{var t,l,n;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.fillingPointMetadata)||void 0===l?void 0:l.name)||(null==e||null===(n=e.searchData)||void 0===n?void 0:n.fillingPointName)||"-"}}),null!=h&&h.some(e=>"createdTime"===(null==e?void 0:e.id))&&o.push({Header:(null==h||null===(r=h.find(e=>"createdTime"===(null==e?void 0:e.id)))||void 0===r?void 0:r.Header)||c("CREATED_AT"),exportAccessor:e=>v(e)}),o.push({Header:(null==h||null===(i=h.find(e=>"applicationStatus"===(null==e?void 0:e.id)))||void 0===i?void 0:i.Header)||c("WT_STATUS"),exportAccessor:e=>{var t,l;return null!=e&&null!==(t=e.workflowData)&&void 0!==t&&null!==(l=t.state)&&void 0!==l&&l.applicationStatus?c(e.workflowData.state.applicationStatus):""}}),null!=h&&h.some(e=>"deliveryDateTime"===(null==e?void 0:e.id))&&o.push({Header:(null==h||null===(d=h.find(e=>"deliveryDateTime"===(null==e?void 0:e.id)))||void 0===d?void 0:d.Header)||c("WT_DELIVERY_DATE_TIME"),exportAccessor:e=>{var t;const l=null==e||null===(t=e.searchData)||void 0===t?void 0:t.driverTripReport;if(Array.isArray(l)&&l.length>0){var n,i;const e=null===(n=l[0])||void 0===n||null===(i=n.auditDetails)||void 0===i?void 0:i.lastModifiedTime;if(e)return`${Digit.DateUtils.ConvertEpochToDate(e)} ${Digit.DateUtils.ConvertEpochToTimeInHours(e)}`}return"-"}}),null!=h&&h.some(e=>"vendorName"===(null==e?void 0:e.id))&&o.push({Header:(null==h||null===(u=h.find(e=>"vendorName"===(null==e?void 0:e.id)))||void 0===u?void 0:u.Header)||c("WT_VENDOR_NAME"),exportAccessor:e=>{var t,l,n;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.vendor)||void 0===l?void 0:l.name)||(null==e||null===(n=e.searchData)||void 0===n?void 0:n.vendorName)||"-"}}),null!=h&&h.some(e=>"vehicleNumber"===(null==e?void 0:e.id))&&o.push({Header:(null==h||null===(s=h.find(e=>"vehicleNumber"===(null==e?void 0:e.id)))||void 0===s?void 0:s.Header)||c("WT_VEHICLE_NO"),exportAccessor:e=>{var t,l;const n=null==e?void 0:e.searchData,i=(null==n?void 0:n.vehicle)||(null==n||null===(t=n.vendor)||void 0===t||null===(l=t.vehicles)||void 0===l?void 0:l.find(e=>(null==e?void 0:e.id)===(null==n?void 0:n.vehicleId)));return(null==i?void 0:i.registrationNumber)||(null==i?void 0:i.name)||(null==i?void 0:i.type)||(null==n?void 0:n.vehicleName)||(null==n?void 0:n.vehicleRegistrationNo)||"-"}}),null!=h&&h.some(e=>"driverName"===(null==e?void 0:e.id))&&o.push({Header:(null==h||null===(m=h.find(e=>"driverName"===(null==e?void 0:e.id)))||void 0===m?void 0:m.Header)||c("WT_DRIVER_NAME"),exportAccessor:e=>{var t,l,n;const i=null==e?void 0:e.searchData,o=(null==i?void 0:i.driver)||(null==i||null===(t=i.vendor)||void 0===t||null===(l=t.drivers)||void 0===l?void 0:l.find(e=>{var t;return(null==e?void 0:e.id)===(null==i?void 0:i.driverId)||(null==e?void 0:e.ownerId)===(null==i?void 0:i.driverId)||(null==e||null===(t=e.owner)||void 0===t?void 0:t.uuid)===(null==i?void 0:i.driverId)}));return(null==o?void 0:o.name)||(null==o||null===(n=o.owner)||void 0===n?void 0:n.name)||(null==i?void 0:i.driverName)||"-"}}),o},[h,v,c]);let y;if(d.isLoading)y=n.createElement(t.Loader,null);else if(g)y=null;else if(!u||0===(null==u?void 0:u.length)||s&&null!=u&&null!==(o=u[0])&&void 0!==o&&o.dataEmpty){var S;y=E?n.createElement(E,{data:u}):0===(null==u?void 0:u.length)||s&&null!=u&&null!==(S=u[0])&&void 0!==S&&S.dataEmpty?n.createElement(t.Card,{style:{marginTop:20}},c("DATA_NOT_FOUND","Data Not Found").split("\n").map((e,t)=>n.createElement("p",{key:t,style:{textAlign:"center"}},e))):n.createElement(t.Loader,null)}else(null==u?void 0:u.length)>0&&(y=n.createElement(V,{t:c,data:u,columns:h,getCellProps:e=>({style:{padding:"8px 12px",fontSize:"13.5px"}}),onPageSizeChange:d.onPageSizeChange,currentPage:d.currentPage,onNextPage:d.onNextPage,onPrevPage:d.onPrevPage,pageSizeLimit:d.pageSizeLimit,onSort:d.onSort,disableSort:d.disableSort,sortParams:d.sortParams,autoSort:!1,totalRecords:d.totalRecords,showCSVExport:!0,getCSVExportData:d.getCSVExportData,csvExportColumns:T,csvExportFileName:String(d.moduleCode||"wt").toLowerCase()+"-inbox"}));return n.createElement("div",{className:"inbox-container"},!d.isSearch&&n.createElement("div",{className:"side-panel-item"},n.createElement(z,{parentRoute:d.parentRoute,businessService:d.moduleCode}),n.createElement("div",{className:"filter-form "},n.createElement(m,{defaultSearchParams:d.defaultSearchParams,onFilterChange:d.onFilterChange,searchParams:d.searchParams,type:"desktop",useNewInboxAPI:s,statusMap:s?null==u?void 0:u[0].statusMap:null,moduleCode:d.moduleCode}))),n.createElement("div",{className:"employee-form-content",style:{flex:1}},!d.isSearch&&n.createElement("div",{className:"summary-cards-container"},((e,t,l,n)=>{const i=e=>{var t;return((null==u||null===(t=u[0])||void 0===t?void 0:t.statusMap)||[]).filter(t=>{const l=(t.applicationStatus||t.applicationstatus||t.bookingStatus||t.bookingstatus||t.statusid||"").toUpperCase().replace(/\s+/g,"_");return e.includes(l)}).reduce((e,t)=>e+t.count,0)},o=("watertanker-fixedpoint"===d.businessService||null===(e=d.searchParams)||void 0===e||null===(t=e.services)||void 0===t||t.includes("watertanker-fixedpoint"),[{label:"WT_TOTAL_BOOKINGS",count:(null==u||null===(l=u[0])||void 0===l?void 0:l.totalCount)||0,color:"#0B2559",filter:null,active:!(null!==(n=d.searchParams)&&void 0!==n&&n.status)},{label:"WT_SCHEDULED",count:i(["SCHEDULED","VENDOR_ASSIGNED"]),color:"#F59E0B",filter:["SCHEDULED"]},{label:"WT_DELIVERED",count:i(["TANKER_DELIVERED","DELIVERED"]),color:"#10B981",filter:["TANKER_DELIVERED"]}]);return o.push({label:"IN_TRANSIT",count:i(["IN_TRANSIT","DELIVERY_PENDING"]),color:"#A855F7",filter:["IN_TRANSIT"]},{label:"MISSED",count:i(["MISSED","DELIVERY_MISSED"]),color:"#EF4444",filter:["MISSED"]},{label:"REJECTED",count:i(["CANCELLED","REJECTED","REQUEST_REJECTED"]),color:"#64748B",filter:["CANCELLED"]}),o})().map((e,t)=>{var l,i,o,a,r;const u=null!==(l=d.searchParams)&&void 0!==l&&null!==(i=l.status)&&void 0!==i&&i.code?null===(o=e.filter)||void 0===o?void 0:o.includes(null===(a=d.searchParams)||void 0===a||null===(r=a.status)||void 0===r?void 0:r.code):e.active;return n.createElement("div",{key:t,className:"summary-card",style:{backgroundColor:"#fff",borderRadius:"6px",padding:"16px 14px",boxShadow:"0 2px 8px rgba(0,0,0,0.05)",flex:"1 1 0%",minWidth:"110px",border:u?"2px solid "+e.color:"1px solid #E2E8F0",cursor:"pointer",display:"flex",flexDirection:"column",justifyContent:"space-between",transition:"all 0.2s ease-in-out"}},n.createElement("div",{style:{fontSize:"11px",color:"#64748B",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},c(e.label)),n.createElement("div",{style:{fontSize:"28px",fontWeight:"700",color:e.color,marginTop:"12px"}},String(e.count).padStart(2,"0")))})),n.createElement(ee,{defaultSearchParams:d.defaultSearchParams,onSearch:e=>{d.onSearch(e),_(!1)},type:"desktop",searchFields:d.searchFields,isInboxPage:!(null!=d&&d.isSearch),searchParams:d.searchParams,clearSearch:()=>_(!0)}),n.createElement("div",{className:"result",style:{flex:1}},y)))},le=e=>{const{t:o}=i.useTranslation(),[a,r]=l.useState(()=>{var t,l;return null!==(t=e.sortParams)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.desc?{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}});function d(){}return n.createElement(n.Fragment,null,n.createElement("div",{className:"filter"},n.createElement("div",{className:"filter-card"},n.createElement("div",{className:"heading"},n.createElement("div",{className:"filter-label"},o("SORT_BY"),":"),n.createElement("div",{className:"clearAll",onClick:d},o("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&n.createElement("span",{className:"clear-search",onClick:d},o("ES_COMMON_CLEAR_ALL")),"mobile"===e.type&&n.createElement("span",{onClick:e.onClose},n.createElement(t.CloseSvg,null))),n.createElement("div",null,n.createElement(t.RadioButtons,{onSelect:function(t){e.onSort([{id:"createdTime",desc:"DESC"===t.code}]),e.onClose()},selectedOption:a,optionsKey:"name",options:[{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}]})))))},ne=e=>{let{t:i,data:o,onFilterChange:a,onSearch:r,onSort:d,serviceRequestIdKey:u,isFstpOperator:s,isLoading:c,isSearch:v,searchParams:m,searchFields:p,sortParams:E,linkPrefix:f,filterComponent:g}=e;const[_,h]=l.useState(v?"SEARCH":""),[T,y]=l.useState(!!v),[S,b]=l.useState(E),[N]=l.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(g)});l.useEffect(()=>{_&&y(!0)},[_]);const I=()=>{y(!1),h(""),b(E)};if(c)return n.createElement(t.Loader,null);let D;return o&&0!==(null==o?void 0:o.length)?o&&(null==o?void 0:o.length)>0&&(D=n.createElement(t.DetailsCard,{data:o,serviceRequestIdKey:u,linkPrefix:f||"/digit-ui/employee/chb/"})):D=n.createElement(t.Card,{style:{marginTop:20}},i("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>n.createElement("p",{key:t,style:{textAlign:"center"}},e))),n.createElement(n.Fragment,null,n.createElement("div",{className:"searchBox"},r&&n.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{h("SEARCH"),y(!0)}}),!v&&a&&n.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{h("FILTER"),y(!0)}}),n.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{h("SORT"),y(!0)}})),D,T&&n.createElement(t.PopUp,null,"FILTER"===_&&n.createElement("div",{className:"popup-module"},n.createElement(N,{onFilterChange:e=>{a(e),y(!1)},Close:I,type:"mobile",searchParams:m})),"SORT"===_&&n.createElement("div",{className:"popup-module"},n.createElement(le,{type:"mobile",sortParams:E,onClose:I,onSort:d})),"SEARCH"===_&&n.createElement("div",{className:"popup-module"},n.createElement(ee,{type:"mobile",onClose:I,onSearch:r,isFstpOperator:s,searchParams:m,searchFields:p}))))},ie=e=>{let{classNameForMobileView:a=""}=e;const{t:r}=i.useTranslation(),d=[],[u,s]=l.useState([]),{roles:c}=Digit.UserService.getUser().info;return l.useEffect(()=>{let e=[];d.forEach(t=>{var l;t.accessTo?(l=t.accessTo,c.filter(e=>l.includes(e.code)).length&&e.push(t)):e.push(t)}),s(e)},[]),n.createElement(t.Card,{className:"employeeCard filter"},n.createElement("div",{className:"complaint-links-container "+a},n.createElement("div",{className:"header"},n.createElement("span",{className:"logo"},n.createElement(t.ShippingTruck,null))," ",n.createElement("span",{className:"text"},r("ES_TITLE_WT_REGISTRATION"))),n.createElement("div",{className:"body"},u.map((e,t)=>{let{link:l,text:i}=e;return n.createElement("span",{className:"link",key:t},n.createElement(o.Link,{to:l},i))}))))},oe=e=>{let{data:t,isLoading:l,isSearch:o,searchFields:a,onFilterChange:r,onSearch:d,onSort:u,parentRoute:s,searchParams:c,sortParams:v,linkPrefix:m,tableConfig:p,filterComponent:E}=e;const{t:f}=i.useTranslation();return n.createElement("div",{style:{padding:0}},n.createElement("div",{className:"inbox-container"},n.createElement("div",{className:"filters-container"},!o&&n.createElement(ie,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:s,isMobile:!0}),n.createElement(ne,{t:f,data:null!=t&&null!==(g=t[0])&&void 0!==g&&g.dataEmpty?[]:null==t?void 0:t.map(e=>{const t={};return(o?p.searchColumns():p.inboxColumns()).forEach(l=>{l.mobileCell&&(t[l.Header]=l.mobileCell(e))}),t}),onFilterChange:r,isLoading:l,isSearch:o,onSearch:d,onSort:u,searchParams:c,searchFields:a,linkPrefix:m,sortParams:v,serviceRequestIdKey:null==p?void 0:p.serviceRequestIdKey,filterComponent:E}))));var g},ae={bookingNo:"bookingNo",applicantName:"applicantName",mobileNumber:"mobileNumber",localityCode:"localityCode",applicationStatus:"applicationStatus",bookingStatus:"bookingStatus",createdTime:"createdTime"},re=e=>{var t,o,a,r,d;let{useNewInboxAPI:u,parentRoute:s,moduleCode:c,detailRoute:v,initialStates:m={},filterComponent:p,isInbox:E,rawWfHandler:f,rawSearchHandler:g,combineResponse:_,wfConfig:h,searchConfig:T,middlewaresWf:y,middlewareSearch:S,EmptyResultInboxComp:N}=e;const I=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),D=Digit.UserService.getUser().info,{t:C}=i.useTranslation(),[A,x]=l.useState(()=>E?{}:{enabled:!1}),[O,w]=l.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("WTInboxTableConfig")}),[L,P]=l.useState(m.pageOffset||0),[R,k]=l.useState(m.pageSize||10),[M,F]=l.useState(m.sortParams||[{id:"createdTime",desc:!0}]),[B,W]=l.useState(m.searchParams||{}),U=ae[null==M||null===(t=M[0])||void 0===t?void 0:t.id]||(null==M||null===(o=M[0])||void 0===o?void 0:o.id)||"createdTime";let H=window.Digit.Utils.browser.isMobile(),j=H?{limit:100,offset:0,sortBy:U,sortOrder:null!=M&&null!==(a=M[0])&&void 0!==a&&a.desc?"DESC":"ASC"}:{limit:R,offset:L,sortBy:U,sortOrder:null!=M&&null!==(r=M[0])&&void 0!==r&&r.desc?"DESC":"ASC"};const{isLoading:V,data:z,searchFields:K,...G}=u?Digit.Hooks.useNewInboxGeneral({tenantId:I,ModuleCode:c,filters:{...B,...j,sortParams:M}}):Digit.Hooks.useInboxGeneral({tenantId:I,businessService:c,isInbox:E,filters:{...B,...j,sortParams:M},rawWfHandler:f,rawSearchHandler:g,combineResponse:_,wfConfig:h,searchConfig:{...A,...T},middlewaresWf:y,middlewareSearch:S});l.useEffect(()=>{null!=G&&G.revalidate&&(null==G||G.revalidate()),null!=G&&G.refetch&&(null==G||G.refetch())},[]),l.useEffect(()=>{P(0)},[B]);const Y=e=>{let t=e.delete,l={...B,...e};t&&t.forEach(e=>delete l[e]),delete e.delete,W({...l}),x({enabled:!0})},q=l.useCallback(e=>{var t;Array.isArray(e)&&0!==e.length&&null!==(t=e[0])&&void 0!==t&&t.id&&F(e)},[]),$=l.useCallback(()=>{var e,t,l,n;const i={WT:"request-service.water_tanker",MT:"request-service.mobile_toilet",TP:"request-service.tree_pruning"},o={moduleName:i[c]||i.WT},a={isInboxSearch:!0,creationReason:[""]},r="ASSIGNED_TO_ME"===(null==B||null===(e=B.uuid)||void 0===e?void 0:e.code),d=null===(t=Digit.UserService.getUser())||void 0===t||null===(l=t.info)||void 0===l?void 0:l.uuid;if(r&&d&&(o.assignee=d),Array.isArray(null==B?void 0:B.services)&&B.services.length>0&&(o.businessService=B.services),Array.isArray(null==B?void 0:B.applicationStatus)&&B.applicationStatus.length>0){const e=B.applicationStatus.map(e=>null==e?void 0:e.uuid).filter(Boolean);e.length>0&&(o.status=e)}return null!=B&&B.mobileNumber&&(a.mobileNumber=B.mobileNumber),null!=B&&B.bookingNo&&(a.bookingNo=B.bookingNo),null!=B&&B.vendorName&&(a.vendorName=B.vendorName),null!=B&&B.vehicleName&&(a.vehicleName=B.vehicleName),null!=B&&B.driverName&&(a.driverName=B.driverName),null!=B&&B.fillingPointId&&(a.fillingPointId=B.fillingPointId),Array.isArray(null==B?void 0:B.locality)&&B.locality.length>0&&(a.locality=B.locality.map(e=>String((null==e?void 0:e.code)||"").split("_").pop()).filter(Boolean)),Array.isArray(M)&&null!==(n=M[0])&&void 0!==n&&n.id&&(a.sortBy=ae[M[0].id]||M[0].id,a.sortOrder=M[0].desc?"DESC":"ASC"),{workflowFilters:o,moduleSearchCriteria:a}},[c,B,M]),X=l.useCallback(function(){try{var e,t;let l=!1;if(!u||"function"!=typeof(null===(e=Digit)||void 0===e||null===(t=e.InboxGeneral)||void 0===t?void 0:t.Search))return Promise.resolve(Array.isArray(z)?z:[]);const{workflowFilters:n,moduleSearchCriteria:i}=$(),o=200;let a=0,r=Number.POSITIVE_INFINITY;const d=[],s=b(function(){return!l&&a<r},void 0,function(){return Promise.resolve(Digit.InboxGeneral.Search({inbox:{tenantId:I,processSearchCriteria:n,moduleSearchCriteria:i,limit:o,offset:a}})).then(function(e){const t=Array.isArray(null==e?void 0:e.items)?e.items:[],n=t.map(t=>({searchData:(null==t?void 0:t.businessObject)||{},workflowData:(null==t?void 0:t.ProcessInstance)||{},statusMap:null==e?void 0:e.statusMap,totalCount:null==e?void 0:e.totalCount}));d.push(...n);const i=Number(null==e?void 0:e.totalCount);r=Number.isFinite(i)&&i>=0?i:d.length,0===t.length||t.length<o?l=!0:a+=t.length})});return Promise.resolve(s&&s.then?s.then(function(){return d}):d)}catch(e){return Promise.reject(e)}},[$,z,I,u]);var Q;if(null!==(null==G||null===(d=G.data)||void 0===d?void 0:d.length))return H?n.createElement(oe,{data:z,isLoading:V,isSearch:!E,searchFields:K,onFilterChange:Y,onSearch:Y,onSort:q,parentRoute:s,searchParams:B,sortParams:M,linkPrefix:s+"/application-details/",tableConfig:null!=G&&G.tableConfig?G.tableConfig:O(C)[c],filterComponent:p,EmptyResultInboxComp:N,useNewInboxAPI:u}):n.createElement("div",{className:"app-container",style:{padding:"CITIZEN"===(null==D?void 0:D.type)?"0 24px":""}},n.createElement(te,{moduleCode:c,detailRoute:v,data:z,tableConfig:O(C)[c],isLoading:V,defaultSearchParams:m.searchParams,isSearch:!E,onFilterChange:Y,searchFields:K,onSearch:Y,onSort:q,onNextPage:()=>{P(e=>e+R)},onPrevPage:()=>{P(e=>e-R)},currentPage:Math.floor(L/R),pageSizeLimit:R,disableSort:!1,onPageSizeChange:e=>{k(Number(e.target.value))},parentRoute:s,searchParams:B,sortParams:M,totalRecords:Number(null==z||null===(Q=z[0])||void 0===Q?void 0:Q.totalCount),filterComponent:p,EmptyResultInboxComp:N,useNewInboxAPI:u,getCSVExportData:X}))},de=e=>{let{t:i,closeModal:o,onSubmit:a,initialValues:d}=e;const u=new Date,s=`${String(u.getHours()).padStart(2,"0")}:${String(u.getMinutes()).padStart(2,"0")}`,c=Boolean(d),v=e=>null==e?"":String(e).trim().toLowerCase(),m=e=>{const t=void 0!==(null==e?void 0:e.value)?e.value:e;if("string"==typeof t){const e=t.trim().toUpperCase();return"TRUE"===e||"YES"===e||"Y"===e}return Boolean(t)},p=d?{...d,arrivalTimeFpl:d.arrivalTimeFpl||d.arrival_time_to_fpl||s,departureTimeFpl:d.departureTimeFpl||d.departure_time_from_fpl||s,arrivalFixedPoint:d.arrivalFixedPoint||d.arrival_time_delivery_point||s,departureFixedPoint:d.departureFixedPoint||d.departure_time_delivery_point||s,returnFpl:d.returnFpl||d.time_of_arriving_back_fpl_after_delivery||s,frequencyNo:d.frequencyNo||d.trip_no||1,vehicleId:d.vehicleId||d.vehicle_id||"",fixedPointCode:d.fixedPointCode||d.fixed_point_code||d.fixedPointId||"",fillingPointCode:d.fillingPointCode||d.fillingPointId||"",day:d.day||[],volume:d.volume||d.volume_water_tobe_delivery||"",remarks:d.remarks||"",active:m(d.active)}:{fixedPointCode:"",fillingPointCode:"",day:[],arrivalTimeFpl:s,departureTimeFpl:s,arrivalFixedPoint:s,departureFixedPoint:s,returnFpl:s,volume:"",remarks:"",frequencyNo:1,active:!0},{handleSubmit:E,control:f,formState:{},watch:g}=r.useForm({defaultValues:p}),_=Digit.ULBService.getCurrentTenantId(),[h,T]=l.useState(""),[y,S]=l.useState("");l.useEffect(()=>{const e=setTimeout(()=>{S(h)},500);return()=>clearTimeout(e)},[h]);const b=l.useCallback(e=>{T(e)},[]),{isLoading:N,data:I}=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:_,filters:{limit:1e3,...y?{name:y}:{}}},{keepPreviousData:!0}),{isLoading:D,data:C}=Digit.Hooks.wt.useFillPointSearch({tenantId:_,filters:{limit:1e3}}),A=[...(null==I?void 0:I.waterTankerBookingDetail)||[],...(null==I?void 0:I.fixedPointTimeTableDetails)||[],...(null==I?void 0:I.fixedPoints)||[]],x=(null==C?void 0:C.fillingPoints)||[],O=(null==d?void 0:d.fixedPointCode)||(null==d?void 0:d.fixed_point_code)||(null==d?void 0:d.fixedPointId)||"",w=(null==d?void 0:d.fixedPointName)||O||"NA",L=A.map(e=>{var t,l,n,o,a,r,d,u,s,c;const v=(null==e?void 0:e.fixedPointCode)||(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.fixedPointId)||(null==e?void 0:e.fixedPointId)||(null==e?void 0:e.code)||(null==e?void 0:e.id)||"",m=(null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.fixedPointId)||(null==e?void 0:e.fixedPointId)||(null==e?void 0:e.id)||v,p=(null==e||null===(n=e.applicantDetail)||void 0===n?void 0:n.applicantId)||(null==e?void 0:e.id)||(null==e?void 0:e.bookingId)||v,E=(null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.name)||(null==e?void 0:e.fixedPointName)||(null==e?void 0:e.name)||v||"NA",f=v?`${E} (${v})`:E,g=(null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.mobileNumber)||(null==e?void 0:e.mobileNumber)||"NA",_=(null==e||null===(r=e.address)||void 0===r?void 0:r.locality)||(null==e?void 0:e.locality)||"NA";return{name:f,mobileNumber:g,locality:_,displayLabel:`${f} | ${g} | ${_}`,value:p,code:v,id:m,fullAddress:[(null==e||null===(d=e.address)||void 0===d?void 0:d.houseNo)&&`${i("WT_HOUSE_NO")} = ${e.address.houseNo}`,(null==e||null===(u=e.address)||void 0===u?void 0:u.streetName)&&`${i("WT_STREET_NAME")} = ${e.address.streetName}`,(null==e||null===(s=e.address)||void 0===s?void 0:s.landmark)&&`${i("WT_LANDMARK")} = ${e.address.landmark}`,(null==e||null===(c=e.address)||void 0===c?void 0:c.locality)&&`${i("WT_LOCALITY")} = ${e.address.locality}`].filter(Boolean).join(", ")}}).reduce((e,t)=>(e.some(e=>[e.value,e.code,e.id].some(e=>[t.value,t.code,t.id].some(t=>v(e)===v(t))))||e.push(t),e),[]),P=O&&L.some(e=>[e.value,e.code,e.id].some(e=>v(e)===v(O)));if(O&&!P){const e=O&&v(w)!==v(O)?`${w} (${O})`:w;L.unshift({name:e,mobileNumber:"NA",locality:"NA",displayLabel:e+" | NA | NA",value:O,code:O,id:(null==d?void 0:d.fixedPointId)||O,fullAddress:""})}const R=e=>L.find(t=>[t.value,t.code,t.id].some(t=>v(t)===v(e))),k=x.map(e=>({displayLabel:(null==e?void 0:e.fillingPointName)||"NA",value:(null==e?void 0:e.fillingPointId)||(null==e?void 0:e.id),eeName:(null==e?void 0:e.eeName)||"NA",aeName:(null==e?void 0:e.aeName)||"NA"})),M=g("fixedPointCode"),F=R(M),B=[{label:i("MONDAY"),value:"MONDAY"},{label:i("TUESDAY"),value:"TUESDAY"},{label:i("WEDNESDAY"),value:"WEDNESDAY"},{label:i("THURSDAY"),value:"THURSDAY"},{label:i("FRIDAY"),value:"FRIDAY"},{label:i("SATURDAY"),value:"SATURDAY"},{label:i("SUNDAY"),value:"SUNDAY"}],W=[{label:"true",value:!0},{label:"false",value:!1}];return g(),n.createElement("div",{className:"custom-modal-overlay",style:{position:"fixed",top:30,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2e5}},n.createElement("style",null,"\n\n .custom-modal-content {\n\n background-color: #fff;\n\n border-radius: 8px;\n\n width: 70%;\n\n max-width: 800px;\n\n max-height: 90vh;\n\n display: flex;\n\n flex-direction: column;\n\n box-shadow: 0 4px 12px rgba(0,0,0,0.15);\n\n position: relative;\n\n }\n\n .add-trip-form {\n\n display: grid;\n\n grid-template-columns: repeat(2, 1fr);\n\n gap: 20px;\n\n }\n\n @media (max-width: 768px) {\n\n .custom-modal-content {\n\n width: 90%;\n\n max-height: 85vh;\n\n }\n\n .add-trip-form {\n\n grid-template-columns: 1fr;\n\n gap: 15px;\n\n }\n\n }\n\n @media (max-width: 480px) {\n\n .custom-modal-content {\n\n width: 95%;\n\n max-height: 95vh;\n\n }\n\n .custom-modal-body {\n\n padding: 15px !important;\n\n }\n\n .custom-modal-footer {\n\n padding: 12px 15px !important;\n\n flex-direction: row;\n\n justify-content: flex-end;\n\n }\n\n .custom-modal-header {\n\n padding: 12px 15px !important;\n\n }\n\n .custom-modal-header h1 {\n\n font-size: 18px !important;\n\n }\n\n }\n\n @media (max-width: 320px) {\n\n .custom-modal-footer {\n\n flex-direction: column-reverse;\n\n align-items: stretch;\n\n }\n\n .custom-modal-footer button {\n\n width: 100%;\n\n }\n\n }\n\n "),n.createElement("div",{className:"custom-modal-content"},n.createElement("div",{className:"custom-modal-header",style:{padding:"16px 24px",borderBottom:"1px solid #eee",display:"flex",justifyContent:"space-between",alignItems:"center"}},n.createElement("h1",{style:{margin:0,fontSize:"20px",fontWeight:"600",color:"#1D4E7F"}},i(d?"WT_EDIT_TRIP":"WT_ADD_TRIP")),n.createElement("button",{onClick:o,style:{background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×")),n.createElement("div",{className:"custom-modal-body",style:{padding:"24px",overflowY:"auto"}},n.createElement("div",{className:"add-trip-form"},n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_FIXED_POINT_CODE")),N?n.createElement(t.Loader,null):n.createElement(r.Controller,{control:f,name:"fixedPointCode",defaultValue:p.fixedPointCode||p.fixedPointId||"",render:e=>n.createElement(t.CustomNameDropdown,{option:L,optionKey:"displayLabel",selected:R(e.value),select:t=>e.onChange(t.code||t.id||t.value),t:i,optionsHeader:{name:"WT_NAME",mobileNumber:"WT_MOBILE_NUMBER",locality:"WT_LOCALITY"},onSearch:b})}),(null==F?void 0:F.fullAddress)&&n.createElement("div",{style:{marginTop:"8px",padding:"10px",backgroundColor:"#f9f9f9",border:"1px solid #ddd",borderRadius:"4px",fontSize:"14px",color:"#555"}},n.createElement("strong",null,i("WT_ADDRESS"),":")," ",F.fullAddress)),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_FILLING_POINT")),D?n.createElement(t.Loader,null):n.createElement(r.Controller,{control:f,name:"fillingPointCode",defaultValue:p.fillingPointCode,render:e=>n.createElement(t.CustomNameDropdown,{option:k,optionKey:"displayLabel",selected:k.find(t=>t.value===e.value),select:t=>e.onChange(t.value),t:i})})),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_DAY")),n.createElement(r.Controller,{control:f,name:"day",render:e=>n.createElement(t.MultiSelectDropdown,{options:B,optionsKey:"label",selected:B.filter(t=>(e.value||[]).some(e=>e===t.value||(null==e?void 0:e.value)===t.value)),onSelect:t=>{const l=(t||[]).map(e=>null!=e&&e[1]?e[1]:(null==e?void 0:e.value)||e);e.onChange(l)},t:i,defaultLabel:i("WT_SELECT_DAYS"),defaultUnit:i("WT_DAYS"),ServerStyle:{backgroundColor:"#fff",zIndex:1e3,border:"1px solid #ccc",boxShadow:"0px 4px 6px rgba(0,0,0,0.1)",borderRadius:"4px"}})})),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_ARRIVAL_TIME_TO_FPL")),n.createElement(r.Controller,{control:f,name:"arrivalTimeFpl",defaultValue:p.arrivalTimeFpl,render:e=>n.createElement(t.TextInput,{type:"time",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_DEPARTURE_TIME_FROM_FPL")),n.createElement(r.Controller,{control:f,name:"departureTimeFpl",defaultValue:p.departureTimeFpl,render:e=>n.createElement(t.TextInput,{type:"time",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_ARRIVAL_AT_FIXED_POINT")),n.createElement(r.Controller,{control:f,name:"arrivalFixedPoint",defaultValue:p.arrivalFixedPoint,render:e=>n.createElement(t.TextInput,{type:"time",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_DEPARTURE_AT_FIXED_POINT")),n.createElement(r.Controller,{control:f,name:"departureFixedPoint",defaultValue:p.departureFixedPoint,render:e=>n.createElement(t.TextInput,{type:"time",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_RETURN_TO_FPL")),n.createElement(r.Controller,{control:f,name:"returnFpl",defaultValue:p.returnFpl,render:e=>n.createElement(t.TextInput,{type:"time",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_VOLUME")),n.createElement(r.Controller,{control:f,name:"volume",defaultValue:p.volume,render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),c&&n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_ACTIVE")),n.createElement(r.Controller,{control:f,name:"active",defaultValue:p.active,render:e=>n.createElement(t.CustomNameDropdown,{option:W,optionKey:"label",selected:W.find(t=>t.value===m(e.value))||W[0],select:t=>e.onChange(t.value),t:i})})),n.createElement("div",{className:"field-group remarks-field-group",style:{gridColumn:"span 2"}},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_REMARKS")),n.createElement(r.Controller,{control:f,name:"remarks",defaultValue:p.remarks,render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})))),n.createElement("div",{className:"custom-modal-footer",style:{padding:"16px 24px",borderTop:"1px solid #eee",display:"flex",justifyContent:"flex-end",gap:"12px"}},n.createElement("button",{className:"button-cancel",onClick:o,style:{padding:"8px 20px",border:"1px solid #ccc",background:"#f4f4f4",borderRadius:"4px",cursor:"pointer"}},i("CS_COMMON_CANCEL")),n.createElement("button",{className:"button-save",onClick:E(e=>{const t=R(e.fixedPointCode),l={...e,fixedPointId:t?t.id:(null==d?void 0:d.fixedPointId)||"",fixedPointCode:t?t.code:e.fixedPointCode||(null==d?void 0:d.fixedPointCode)||""};a(l)}),style:{padding:"8px 20px",background:"#1D4E7F",color:"#ffffffff",border:"none",borderRadius:"4px",cursor:"pointer"}},i(d?"WT_UPDATE":"CS_COMMON_SAVE")))))},ue=e=>{if(!e)return e;if(e.includes("AM")||e.includes("PM"))return e;const t=e.split(":");if(t.length<2)return e;let l=parseInt(t[0],10);const n=l>=12?"PM":"AM";return l=l%12||12,`${l<10?"0"+l:l}:${t[1]} ${n}`},se=e=>{if(!e)return e;const t=e.match(/^(\d{2}):(\d{2})\s?(AM|PM)$/i);if(!t)return e;let[l,n,i,o]=t;return n=parseInt(n,10),"PM"===o.toUpperCase()&&n<12&&(n+=12),"AM"===o.toUpperCase()&&12===n&&(n=0),`${n<10?"0"+n:n}:${i}`},ce=e=>{var o;let{...r}=e;const{t:d}=i.useTranslation(),u=a.useQueryClient(),s=Digit.ULBService.getCurrentTenantId(),[c,v]=l.useState(!1),[m,p]=l.useState(null),[E,f]=l.useState("all"),[g,_]=l.useState({label:"All Fixed Points",value:"all"}),[h,T]=l.useState({label:"All Days",value:"all"}),[y,S]=l.useState({label:"All Status",value:"all"}),[N,I]=l.useState(null),[D,C]=l.useState(0),[A,x]=l.useState(10),[O,w]=l.useState({limit:10,offset:0}),{isLoading:L,data:P,refetch:R}=Digit.Hooks.wt.useFixedPointScheduleSearch(s,O);l.useEffect(()=>{R&&R()},[]);const{data:k}=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:s,filters:{offset:0,limit:100}}),M=n.useMemo(()=>({...O,limit:1e3,offset:0}),[O]),{data:F}=Digit.Hooks.wt.useFixedPointScheduleSearch(s,M),B=n.useMemo(()=>{const e=[...(null==k?void 0:k.fixedPointTimeTableDetails)||(null==k?void 0:k.waterTankerBookingDetail)||(null==k?void 0:k.fixedPoints)||[],...(null==F?void 0:F.fixedPointTimeTableDetails)||[]].map(e=>{var t,l,n;return{label:e.fixedPointCode||(null===(t=e.applicantDetail)||void 0===t?void 0:t.fixedPointId)||e.name||(null===(l=e.applicantDetail)||void 0===l?void 0:l.name)||e.bookingId,value:e.fixedPointCode||(null===(n=e.applicantDetail)||void 0===n?void 0:n.fixedPointId)||e.bookingId}}).filter(e=>e.label&&e.value).filter((e,t,l)=>l.findIndex(t=>t.value===e.value)===t);return[{label:"WT_ALL_FIXED_POINTS"!==d("WT_ALL_FIXED_POINTS")?d("WT_ALL_FIXED_POINTS"):"All Fixed Points",value:"all"},...e]},[k,F,d]);console.log(B,"fixedPoints"),console.log(k,"fixedPointData");const{mutate:W}=Digit.Hooks.wt.useCreateFixedPointSchedule(s),{mutate:U}=Digit.Hooks.wt.useUpdateFixedPointSchedule(s),H=()=>{p(null)},j=n.useCallback(function(e){return void 0===e&&(e=[]),e.map(e=>({scheduleId:e.systemAssignedScheduleId,fixedPointName:e.fixedPointName,fixedPoint:e.fixedPointCode||e.fixedPointId,fixedPointId:e.fixedPointId||e.id||null,day:e.day,freq:e.tripNo,arrToFpl:e.arrivalTimeToFpl,depFromFpl:e.departureTimeFromFpl,arrAtFixedPoint:e.arrivalTimeDeliveryPoint,depAtFixedPoint:e.departureTimeDeliveryPoint,returnToFpl:e.timeOfArrivingBackFplAfterDelivery,volume:e.volumeWaterTobeDelivery,vehicle:e.vehicleId,active:e.isEnable?"Y":"N",totalCount:e.totalCount,fillingPointId:e.fillingPointId}))},[]),z=n.useMemo(()=>({MONDAY:1,TUESDAY:2,WEDNESDAY:3,THURSDAY:4,FRIDAY:5,SATURDAY:6,SUNDAY:7}),[]),K=n.useMemo(()=>j((null==P?void 0:P.fixedPointTimeTableDetails)||[]).sort((e,t)=>{var l,n;const i=(e.fixedPoint||"").localeCompare(t.fixedPoint||"");return 0!==i?i:(z[null===(l=e.day)||void 0===l?void 0:l.toUpperCase()]||8)-(z[null===(n=t.day)||void 0===n?void 0:n.toUpperCase()]||8)}),[P,j,z]),G=function(e,t){var l;void 0===e&&(e=null),void 0===t&&(t=null);const n=e||{fixedPointCode:"all"===(null==g?void 0:g.value)?"":null==g?void 0:g.value,day:"all"===(null==h?void 0:h.value)?"":null==h||null===(l=h.value)||void 0===l?void 0:l.toUpperCase(),status:"all"===(null==y?void 0:y.value)?"":null==y?void 0:y.value},i=null!==t?t:0;null===t&&C(0),w(e=>({...n,limit:e.limit,offset:i}))},Y=n.useMemo(()=>[{Header:d("WT_FIXED_POINT_CODE"),accessor:"fixedPoint"},{Header:d("WT_FIXED_POINT_NAME"),accessor:"fixedPointName"},{Header:d("WT_DAY"),accessor:"day"},{Header:d("WT_ARR_TO_FPL"),accessor:"arrToFpl"},{Header:d("WT_DEP_FROM_FPL"),accessor:"depFromFpl"},{Header:d("WT_ARR_AT_FIXED_POINT"),accessor:"arrAtFixedPoint"},{Header:d("WT_DEP_AT_FIXED_POINT"),accessor:"depAtFixedPoint"},{Header:d("WT_RETURN_TO_FPL"),accessor:"returnToFpl"},{Header:d("WT_VOLUME"),accessor:"volume"},{Header:d("WT_ACTIVE"),accessor:"active",Cell:e=>{let{value:t}=e;return n.createElement("span",{style:{background:"Y"===t?"#E6F4EA":"#FCE8E6",padding:"2px 8px",borderRadius:"10px",color:"Y"===t?"#1E8E3E":"#D93025"}},t)}},{Header:d("WT_ACTION"),Cell:e=>{let{row:t}=e;return n.createElement("div",{style:{display:"flex",gap:"5px"}},n.createElement("button",{onClick:()=>{I(t.index),v(!0)},style:{color:"#1D4E7F",border:"1px solid #1D4E7F",background:"none",padding:"2px 8px",cursor:"pointer"}},d("WT_EDIT")))}}],[d]),q=n.useCallback(function(){try{let t=!1;function e(){return j(a)}const l={...O||{}};delete l.limit,delete l.offset;const n=200;let i=0,o=Number.POSITIVE_INFINITY;const a=[],r=b(function(){return!t&&i<o},void 0,function(){return Promise.resolve(Digit.WTService.SearchFixedPointSchedule({tenantId:s,filters:{...l,limit:n,offset:i}})).then(function(e){const l=(null==e?void 0:e.fixedPointTimeTableDetails)||[];a.push(...l);const r=Number((null==e?void 0:e.count)??(null==e?void 0:e.totalCount)??(null==e?void 0:e.Count));o=Number.isFinite(r)&&r>=0?r:a.length,!l.length||l.length<n?t=!0:i+=l.length})});return Promise.resolve(r&&r.then?r.then(e):e())}catch(e){return Promise.reject(e)}},[O,j,s]),$=n.useMemo(()=>[{Header:d("WT_SCHEDULE_ID"),accessor:"scheduleId"},{Header:d("WT_FIXED_POINT"),accessor:"fixedPoint"},{Header:d("WT_DAY"),accessor:"day"},{Header:d("WT_FREQ"),accessor:"freq"},{Header:d("WT_ARR_TO_FPL"),accessor:"arrToFpl"},{Header:d("WT_DEP_FROM_FPL"),accessor:"depFromFpl"},{Header:d("WT_ARR_AT_FIXED_POINT"),accessor:"arrAtFixedPoint"},{Header:d("WT_DEP_AT_FIXED_POINT"),accessor:"depAtFixedPoint"},{Header:d("WT_RETURN_TO_FPL"),accessor:"returnToFpl"},{Header:d("WT_VOLUME"),accessor:"volume"},{Header:d("WT_ACTIVE"),accessor:"active"}],[d]);return n.createElement("div",{className:"fixed-point-schedule-management"},n.createElement(t.Card,{style:{padding:"20px"}},n.createElement("div",{className:"finance-mainlayout",style:{marginBottom:"20px"}},n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.CardLabel,null,d("WT_EXPORT")),n.createElement(t.Dropdown,{option:[{label:d("WT_EXCEL_WEEKWISE"),value:"Weekwise"},{label:d("WT_EXCEL_MONTHWISE"),value:"Monthwise"},{label:d("WT_EXCEL_YEARWISE"),value:"Yearwise"}],optionKey:"label",placeholder:d("WT_EXPORT"),t:d,select:e=>{const t=new Date,l=`${t.getDate()}-${t.getMonth()+1}-${t.getFullYear()}`,n=`FixedPointSchedule_${e.value}_${l}`,i=(null==F?void 0:F.fixedPointTimeTableDetails)||[],o=[[d("WT_SCHEDULE_ID"),d("WT_FIXED_POINT"),d("WT_DAY"),d("WT_FREQ"),d("WT_ARR_TO_FPL"),d("WT_DEP_FROM_FPL"),d("WT_ARR_AT_FIXED_POINT"),d("WT_DEP_AT_FIXED_POINT"),d("WT_RETURN_TO_FPL"),d("WT_VOLUME"),d("WT_VEHICLE"),d("WT_ACTIVE")],...i.map(e=>[e.systemAssignedScheduleId,e.fixedPointCode,d(e.day),e.tripNo,e.arrivalTimeToFpl,e.departureTimeFromFpl,e.arrivalTimeDeliveryPoint,e.departureTimeDeliveryPoint,e.timeOfArrivingBackFplAfterDelivery,e.volumeWaterTobeDelivery,e.vehicleId,e.isEnable?"Y":"N"])];if(window.Digit&&window.Digit.Download&&window.Digit.Download.Excel)window.Digit.Download.Excel(o,n);else{const e=o.map(e=>e.map(e=>`"${(""+(null==e?"":e)).replace(/"/g,'\\"')}"`).join(",")),t=new Blob([e.join("\n")],{type:"text/csv"}),l=window.URL.createObjectURL(t),i=document.createElement("a");i.setAttribute("hidden",""),i.setAttribute("href",l),i.setAttribute("download",n+".csv"),document.body.appendChild(i),i.click(),document.body.removeChild(i)}}})),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.CardLabel,null,d("WT_FIXED_POINT")),n.createElement(t.Dropdown,{option:B,optionKey:"label",selected:g,t:d,select:e=>{_(e)},placeholder:d("WT_ALL_FIXED_POINTS")})),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.CardLabel,null,d("WT_DAY")),n.createElement(t.Dropdown,{option:[{label:"All Days",value:"all"},{label:d("MONDAY"),value:"MONDAY"},{label:d("TUESDAY"),value:"TUESDAY"},{label:d("WEDNESDAY"),value:"WEDNESDAY"},{label:d("THURSDAY"),value:"THURSDAY"},{label:d("FRIDAY"),value:"FRIDAY"},{label:d("SATURDAY"),value:"SATURDAY"},{label:d("SUNDAY"),value:"SUNDAY"}],optionKey:"label",selected:h,t:d,select:e=>{var t;T(e),f(e.value),G({fixedPointCode:"all"===(null==g?void 0:g.value)?"":null==g?void 0:g.value,day:"all"===(null==e?void 0:e.value)?"":null==e||null===(t=e.value)||void 0===t?void 0:t.toUpperCase(),status:"all"===(null==y?void 0:y.value)?"":null==y?void 0:y.value})},placeholder:"All Days"})),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.CardLabel,null,d("WT_STATUS")),n.createElement(t.Dropdown,{option:[{label:"All Status",value:"all"},{label:"Active",value:"Active"},{label:"Inactive",value:"Inactive"}],optionKey:"label",selected:y,t:d,select:e=>{var t;S(e),G({fixedPointCode:"all"===(null==g?void 0:g.value)?"":null==g?void 0:g.value,day:"all"===(null==h?void 0:h.value)?"":null==h||null===(t=h.value)||void 0===t?void 0:t.toUpperCase(),status:"all"===(null==e?void 0:e.value)?"":null==e?void 0:e.value})},placeholder:"All Status"})),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null," "),n.createElement("span",{className:"generic-button clear-search",onClick:()=>{f("all"),T({label:"All Days",value:"all"}),_({label:"All Fixed Points",value:"all"}),S({label:"All Status",value:"all"}),C(0),w({limit:A,offset:0})},style:{alignSelf:"center"}},d("ES_COMMON_CLEAR_SEARCH"))),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null," "),n.createElement(t.SubmitBar,{label:d("ES_COMMON_SEARCH"),onSubmit:()=>G()}))),n.createElement("div",{style:{display:"flex",gap:"5px",marginBottom:"20px",flexWrap:"wrap"}},["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"].map(e=>n.createElement("button",{key:e,onClick:()=>{f(e),T({label:e,value:e}),G({fixedPointCode:"all"===(null==g?void 0:g.value)?"":null==g?void 0:g.value,day:e.toUpperCase(),status:"all"===(null==y?void 0:y.value)?"":null==y?void 0:y.value})},style:{padding:"8px 16px",border:"1px solid #ccc",borderRadius:"4px",background:E===e?"#1D4E7F":"#fff",color:E===e?"#fff":"#333",cursor:"pointer"}},d(e.toUpperCase())))),n.createElement("span",null,n.createElement("button",{onClick:()=>{I(null),v(!0)},style:{background:"#1E8E3E",color:"#fff",border:"none",padding:"10px 20px",borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",gap:"5px",marginBottom:"10px"}},n.createElement("span",null,"+")," ",d("WT_ADD_TRIP"))),n.createElement("div",{style:{width:"100%",overflowX:"auto"}},n.createElement(V,{t:d,data:K,columns:Y,getCellProps:e=>({}),styles:{minWidth:"1200px"},inboxStyles:{overflowX:"auto"},isLoading:L,onPageSizeChange:e=>{const t=Number(e.target.value);x(t),C(0),w(e=>({...e,limit:t,offset:0}))},currentPage:Math.floor(D/A),onNextPage:()=>{const e=D+A;C(e),w(t=>({...t,offset:e}))},onPrevPage:()=>{const e=Math.max(0,D-A);C(e),w(t=>({...t,offset:e}))},pageSizeLimit:A,onSort:r.onSort,disableSort:!0,sortParams:r.sortParams,totalRecords:(null==P?void 0:P.count)||(null==P?void 0:P.totalCount)||(null==K||null===(o=K[0])||void 0===o?void 0:o.totalCount),showCSVExport:!0,getCSVExportData:q,csvExportColumns:$,csvExportFileName:"wt-fixed-point-schedule"}))),c&&n.createElement(de,{t:d,closeModal:()=>{v(!1),I(null)},initialValues:null!==N?{scheduleId:K[N].scheduleId,fixedPointCode:K[N].fixedPoint,fixedPointId:K[N].fixedPointId,fillingPointCode:K[N].fillingPointId,day:[{label:d(K[N].day),value:K[N].day}],frequencyNo:K[N].freq,arrivalTimeFpl:se(K[N].arrToFpl),departureTimeFpl:se(K[N].depFromFpl),arrivalFixedPoint:se(K[N].arrAtFixedPoint),departureFixedPoint:se(K[N].depAtFixedPoint),returnFpl:se(K[N].returnToFpl),volume:K[N].volume,vehicleId:K[N].vehicle,active:{label:d("Y"===K[N].active?"YES":"NO"),value:"Y"===K[N].active?"Yes":"No"}}:null,onSubmit:e=>{var t,l,n;console.log(e,"dsdsdsdsdsdsds");const i=null==e?void 0:e.day;let o=[];if(Array.isArray(i))o=i.map(e=>"string"==typeof e?e:(null==e?void 0:e.value)||e).filter(e=>e&&"WT_SELECT_ALL"!==e);else if(i){const e=(null==i?void 0:i.value)||i;e&&"WT_SELECT_ALL"!==e&&(o=[e])}const a=null!==N?K[N]:{},r="Yes"===(null===(t=e.active)||void 0===t?void 0:t.value)||"Yes"===e.active||!0===e.active,c=void 0!==e.active?r:null===N||"Y"===(null==a?void 0:a.active),m={system_assigned_schedule_id:e.scheduleId||a.scheduleId||null,fixed_point_code:e.fixedPointId||e.fixedPointCode||"",fillingPointId:e.fillingPointCode||e.fillingPointId||null,day:o.map(e=>e.toUpperCase()),trip_no:Number(e.frequencyNo)||1,arrival_time_to_fpl:ue(e.arrivalTimeFpl),departure_time_from_fpl:ue(e.departureTimeFpl),arrival_time_delivery_point:ue(e.arrivalFixedPoint),departure_time_delivery_point:ue(e.departureFixedPoint),time_of_arriving_back_fpl_after_delivery:ue(e.returnFpl),volume_water_tobe_delivery:e.volume,active:c,is_enable:c,remarks:e.remarks||"",vehicle_id:e.vehicleId||a.vehicle||null,audit_details:(null==P||null===(l=P.fixedPointTimeTableDetails)||void 0===l||null===(n=l[N])||void 0===n?void 0:n.auditDetails)||null};m.system_assigned_schedule_id||delete m.system_assigned_schedule_id,m.vehicle_id||delete m.vehicle_id,m.audit_details||delete m.audit_details;const E=null!==N?{fixedPointDetailsList:[m]}:{fixedPointDetails:m},f={onError:e=>{var t,l,n,i,o,a,r;const d=(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.error)||void 0===n?void 0:n.message)||(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.message)||(null==e?void 0:e.message)||"Operation Failed";p({key:"error",label:d}),setTimeout(H,5e3)},onSuccess:e=>{var t;if(null!=e&&e.error||null!=e&&null!==(t=e.data)&&void 0!==t&&t.error){var l,n,i;const t=(null==e||null===(l=e.error)||void 0===l?void 0:l.message)||(null==e||null===(n=e.data)||void 0===n||null===(i=n.error)||void 0===i?void 0:i.message)||"Operation Failed";p({key:"error",label:t}),setTimeout(H,5e3)}else p({label:d(null!==N?"WT_SCHEDULE_UPDATE_SUCCESS":"WT_SCHEDULE_CREATE_SUCCESS")}),v(!1),I(null),u.invalidateQueries(["FIXED_POINT_SCHEDULE_SEARCH",s])}};null!==N?U(E,f):W(E,f)}}),m&&n.createElement("div",{style:{position:"fixed",zIndex:3e5}},n.createElement(t.Toast,{error:"error"===m.key,label:m.label,onClose:H})))},ve=new Map,me=function(e,t){try{if(null==e||null==t)return Promise.resolve(null);const l=`${e.toFixed(5)},${t.toFixed(5)}`;return ve.has(l)?Promise.resolve(ve.get(l)):Promise.resolve(N(function(){return Promise.resolve(fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${e}&lon=${t}&zoom=18&addressdetails=1`,{headers:{"Accept-Language":"en","User-Agent":"Digit-UI-WT-Module"}})).then(function(e){if(!e.ok)throw new Error("Geocoding failed: "+e.statusText);return Promise.resolve(e.json()).then(function(e){return ve.set(l,e),e})})},function(e){return console.error("Error in reverseGeocode:",e),null}))}catch(e){return Promise.reject(e)}},pe=function(e,t){if(void 0===t&&(t=!1),!e)return"Unknown Address";if(t&&e.display_name)return e.display_name;if(!e.address)return e.display_name||"Unknown Address";const{address:l}=e,n=[l.house_number||l.amenity,l.road,l.suburb||l.neighbourhood||l.village,l.city_district||l.city||l.town,l.state,l.postcode].filter(Boolean);return n.length>0?n.join(", "):e.display_name||"Unknown Address"},Ee=(e,t,l,n)=>{const i=fe(l-e),o=fe(n-t),a=Math.sin(i/2)*Math.sin(i/2)+Math.cos(fe(e))*Math.cos(fe(l))*Math.sin(o/2)*Math.sin(o/2);return 2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))*6371};function fe(e){return e*(Math.PI/180)}delete s.Icon.Default.prototype._getIconUrl,s.Icon.Default.mergeOptions({iconRetinaUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",iconUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png"});const ge=s.divIcon({className:"blinking-green-dot",html:'\n <div style="position: relative;">\n <div style="\n width: 14px;\n height: 14px;\n background: #4caf50;\n border: 2px solid white;\n border-radius: 50%;\n box-shadow: 0 0 10px rgba(76, 175, 80, 0.8);\n z-index: 2;\n position: relative;\n animation: blink 1s infinite ease-in-out;\n "></div>\n <div style="\n position: absolute;\n top: -6px;\n left: -6px;\n width: 26px;\n height: 26px;\n background: rgba(76, 175, 80, 0.3);\n border-radius: 50%;\n animation: pulse 2s infinite;\n z-index: 1;\n "></div>\n <style>\n @keyframes blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.6; }\n }\n @keyframes pulse {\n 0% { transform: scale(0.6); opacity: 1; }\n 100% { transform: scale(2); opacity: 0; }\n }\n </style>\n </div>\n ',iconSize:[14,14],iconAnchor:[7,7]}),_e=new s.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),he=new s.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-blue.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),Te=e=>{let{lat:t,lng:i,fallback:o="Resolving area"}=e;const[a,r]=l.useState(o);return l.useEffect(()=>{!function(){try{const e=function(){if(null!=t&&null!=i)return Promise.resolve(me(t,i)).then(function(e){r(pe(e))})}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[t,i]),n.createElement("span",{title:`${null==t?void 0:t.toFixed(6)}, ${null==i?void 0:i.toFixed(6)}`},a)},ye=e=>{let{selectedDriver:t,mapZoom:n,mapCenter:i}=e;const o=u.useMap();return l.useEffect(()=>{null!=t&&t.lat&&null!=t&&t.lng&&o.setView([t.lat,t.lng],n||15,{animate:!0,duration:1})},[t,o]),l.useEffect(()=>{Array.isArray(i)&&2===i.length&&o.setView(i,n||15,{animate:!0,duration:1})},[i,o]),l.useEffect(()=>{n&&o.setZoom(n)},[n,o]),null},Se=e=>{let{start:t,end:o,color:a="#2196f3",weight:r=6}=e;const{t:d}=i.useTranslation(),{routeData:s,loading:c,error:v}=((e,t)=>{const{t:n}=i.useTranslation(),[o,a]=l.useState(null),[r,d]=l.useState(!1),[u,s]=l.useState(null);return l.useEffect(()=>{e&&t&&function(){try{d(!0),Promise.resolve(I(function(){return N(function(){return Promise.resolve(fetch(`https://router.project-osrm.org/route/v1/driving/${e.lng},${e.lat};${t.lng},${t.lat}?overview=full&geometries=geojson&steps=true`)).then(function(e){if(!e.ok)throw new Error(n("FAILED_TO_FETCH_ROUTE"));return Promise.resolve(e.json()).then(function(e){if(e.routes&&e.routes[0]){const t=e.routes[0],l=t.geometry.coordinates.map(e=>[e[1],e[0]]);a({coordinates:l,distance:t.distance,duration:t.duration,legs:t.legs})}})})},function(e){console.error(n("Error fetching route:"),e),s(e.message)})},function(e,t){if(d(!1),e)throw t;return t}))}catch(e){return Promise.reject(e)}}()},[null==e?void 0:e.lat,null==e?void 0:e.lng,null==t?void 0:t.lat,null==t?void 0:t.lng]),{routeData:o,loading:r,error:u}})(t,o),[m,p]=l.useState(!1),[E,f]=l.useState(null);return c?n.createElement("div",{style:{position:"absolute",top:"20px",left:"20px",background:"white",padding:"8px 16px",borderRadius:"4px",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",zIndex:1e3}},d("LOADING_ROUTE")):v?n.createElement("div",{style:{position:"absolute",top:"20px",left:"20px",background:"#ffebee",color:"#c62828",padding:"8px 16px",borderRadius:"4px",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",zIndex:1e3}},d("ERROR_LOADING_ROUTE"),v):s?n.createElement(n.Fragment,null,n.createElement(u.Polyline,{positions:s.coordinates,color:"#1F5FA8",weight:5,opacity:.8,lineJoin:"round"}),(E||m)&&n.createElement("div",{style:{position:"absolute",bottom:"80px",left:"10px",right:"10px",background:"white",padding:"16px",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",zIndex:1e3,maxWidth:"calc(100% - 20px)",border:"1px solid #e0e0e0",maxHeight:"50vh",overflowY:"auto"}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"}},n.createElement("h4",{style:{margin:0,color:"#1F5FA8"}},d("ROUTE_INFORMATION")),n.createElement("button",{onClick:()=>p(!1),style:{background:"none",border:"none",cursor:"pointer",fontSize:"24px",color:"#666",padding:"0 8px"}},"×")),n.createElement("div",{style:{marginBottom:"12px"}},n.createElement("div",null,n.createElement("strong",null,d("TOTAL_DISTANCE"),":")," ",(s.distance/1e3).toFixed(2)," km"),n.createElement("div",null,n.createElement("strong",null,d("ESTIMATED_TIME"),":")," ",Math.round(s.duration/60)," minutes")),E&&n.createElement("div",{style:{padding:"8px",background:"#f5f5f5",borderRadius:"4px",marginBottom:"8px"}},n.createElement("div",null,n.createElement("strong",null,d("CURRENT_STEP"),":")," ",E.maneuver.type),n.createElement("div",null,n.createElement("strong",null,d("INSTRUCTION"),":")," ",E.maneuver.instruction||E.name),n.createElement("div",null,n.createElement("strong",null,d("DISTANCE"),":")," ",(E.distance/1e3).toFixed(2)," km"),n.createElement("div",null,n.createElement("strong",null,d("DURATION"),":")," ",Math.round(E.duration/60)," min")),m&&s.legs&&n.createElement("div",{style:{maxHeight:"200px",overflowY:"auto"}},n.createElement("h5",{style:{margin:"8px 0",color:"#666"}},d("TURN_BY_TURN_DIRECTIONS"),":"),s.legs[0].steps.map((e,t)=>n.createElement("div",{key:t,style:{padding:"8px",borderBottom:"1px solid #eee",fontSize:"12px",cursor:"pointer",background:E===e?"#e3f2fd":"transparent"},onMouseEnter:()=>f(e),onMouseLeave:()=>f(null)},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},n.createElement("span",{style:{width:"20px",height:"20px",borderRadius:"50%",background:"#1F5FA8",color:"white",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",flexShrink:0}},t+1),n.createElement("div",null,n.createElement("div",{style:{fontWeight:"500"}},e.maneuver.instruction||e.name),n.createElement("div",{style:{color:"#666"}},(e.distance/1e3).toFixed(2)," km · ",Math.round(e.duration/60)," min")))))))):null},be=e=>{let{isOnline:t}=e;return n.createElement("span",{style:{display:"inline-block",padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",backgroundColor:t?"#e6f7e6":"#ffe6e6",color:t?"#2e7d32":"#c62828",border:"1px solid "+(t?"#a5d6a7":"#ef9a9a")}},n.createElement("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:t?"#4caf50":"#f44336",marginRight:"6px"}}),t?"ONLINE":"OFFLINE")},Ne=e=>{let{driver:t,isSelected:o,onClick:a,vendorList:r}=e;const{t:d}=i.useTranslation(),[u,s]=l.useState("Resolving area..."),[c,v]=l.useState("Resolving area..."),m=l.useRef({lat:null,lng:null}),p=l.useRef({lat:null,lng:null});l.useEffect(()=>{!function(){try{const e=function(){if(t.lat&&t.lng){const e=m.current.lat?Ee(m.current.lat,m.current.lng,t.lat,t.lng):Infinity,l=function(){if(e>.2)return Promise.resolve(me(t.lat,t.lng)).then(function(e){s(pe(e)),m.current={lat:t.lat,lng:t.lng}})}();if(l&&l.then)return l.then(function(){})}}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[t.lat,t.lng]),l.useEffect(()=>{!function(){try{const e=function(){if(t.activeDeliveryLat&&t.activeDeliveryLng){const e=p.current.lat?Ee(p.current.lat,p.current.lng,t.activeDeliveryLat,t.activeDeliveryLng):Infinity,l=function(){if(e>.2)return Promise.resolve(me(t.activeDeliveryLat,t.activeDeliveryLng)).then(function(e){v(pe(e)),p.current={lat:t.activeDeliveryLat,lng:t.activeDeliveryLng}})}();if(l&&l.then)return l.then(function(){})}}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[t.activeDeliveryLat,t.activeDeliveryLng]);const E=l.useMemo(()=>{if(!r||!r.length)return{name:"Unknown",vehicle:"N/A"};for(const o of r){var e;const a=null===(e=o.drivers)||void 0===e?void 0:e.find(e=>{var l,n;return e.id===t.driverId||(null===(l=e.owner)||void 0===l?void 0:l.mobileNumber)===t.driverId||(null===(n=e.owner)||void 0===n?void 0:n.uuid)===t.driverId});var l,n,i;if(a)return{name:(null===(l=a.owner)||void 0===l?void 0:l.name)||"Unknown",vehicle:(null===(n=o.vehicles)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.registrationNumber)||"N/A"}}return{name:"Unknown",vehicle:"N/A"}},[r,t.driverId]);return n.createElement("div",{onClick:a,style:{padding:"10px",borderRadius:"8px",background:o?"#f0f4ff":"white",border:"2px solid "+(o?"#1F5FA8":"#f0f0f0"),cursor:"pointer",position:"relative",transition:"all 0.2s ease"}},n.createElement("div",{style:{display:"flex",gap:"12px",marginBottom:"8px"}},n.createElement("div",{style:{width:"40px",height:"40px",borderRadius:"8px",background:"#f0f2f5",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"20px"}},"👤"),n.createElement("div",{style:{flex:1}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},n.createElement("div",null,n.createElement("div",{style:{fontWeight:"700",fontSize:"14px",color:"#0d47a1"}},"DRV-",t.driverId.substring(0,4).toUpperCase()),n.createElement("div",{style:{fontSize:"11px",color:"#666"}},E.name," • ",E.vehicle)),n.createElement("div",{style:{fontSize:"10px",fontWeight:"700",padding:"2px 8px",borderRadius:"4px",background:t.isOnline?"#e8f5e9":"#ffebee",color:t.isOnline?"#2e7d32":"#c62828"}},t.isOnline?"ONLINE":"OFFLINE")))),n.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px"}},n.createElement("div",null,n.createElement("div",{style:{fontSize:"10px",fontWeight:"600",color:"#aaa",marginBottom:"2px"}},d("CURRENT_LOCATION")),n.createElement("div",{style:{fontSize:"11px",fontWeight:"700",color:"#333",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},u))),n.createElement("div",null,n.createElement("div",null,n.createElement("div",{style:{fontSize:"10px",fontWeight:"600",color:"#aaa",marginBottom:"2px"}},d("DESTINATION")),n.createElement("div",{style:{fontSize:"11px",fontWeight:"700",color:"#333",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},c))))};function Ie(){const{t:e}=i.useTranslation(),o=Digit.ULBService.getCurrentTenantId(),[a,r]=l.useState({}),[s,c]=l.useState(!1),[v,m]=l.useState(null),[p,E]=l.useState(""),[f,g]=l.useState("all"),[_,h]=l.useState(!0),[T,y]=l.useState([28.6139,77.209]),[S,b]=l.useState(12),[N,I]=l.useState(!0),[D,C]=l.useState(window.innerWidth<=768),[A,x]=l.useState(null),[O,w]=l.useState(null),{data:L}=Digit.Hooks.wt.useFillPointSearch({tenantId:o,filters:{status:"ACTIVE"}}),P=l.useMemo(()=>(null==L?void 0:L.fillingPoints)||[],[L]),{data:R}=Digit.Hooks.fsm.useVendorSearch({tenantId:o,filters:{status:"ACTIVE",...null!=A&&A.id?{fillingPointId:null==A?void 0:A.id}:{}},config:{select:e=>(null==e?void 0:e.vendor)||[]}}),k=l.useMemo(()=>R||[],[R]);l.useEffect(()=>{var e,t,l;null!=R&&R.length&&Object.keys(a).length&&(console.log("=== VENDOR DEBUG ==="),console.log("Vendor[0] vehicles:",null===(e=R[0])||void 0===e?void 0:e.vehicles),console.log("Vendor[0] drivers:",null===(t=R[0])||void 0===t||null===(l=t.drivers)||void 0===l?void 0:l.map(e=>{var t,l;return{id:e.id,mobile:null===(t=e.owner)||void 0===t?void 0:t.mobileNumber,uuid:null===(l=e.owner)||void 0===l?void 0:l.uuid}})),console.log("Socket driverId example:",Object.keys(a)[0]))},[R,a]),l.useEffect(()=>{const e=()=>{C(window.innerWidth<=768),window.innerWidth<=768?I(!1):I(!0)};return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]);const M=l.useMemo(()=>d.io("https://dev-djberp.nitcon.in",{path:"/driver-tanker-tracker-service/socket.io",transports:["websocket"],autoConnect:!1}),[]);l.useEffect(()=>(M.connect(),M.on("connect",()=>{console.log("Admin connected:",M.id),c(!0),M.emit("admin-join")}),M.on("disconnect",()=>{console.log("Admin disconnected"),c(!1)}),M.on("drivers-snapshot",e=>{if(console.log("drivers-snapshot",e),!Array.isArray(e))return;const t={};e.forEach(e=>{e&&e.driverId&&(t[e.driverId]={...e,lastUpdate:(new Date).toISOString()})}),r(t)}),M.on("driver-location-update",e=>{console.log("driver-location-update",e),e&&e.driverId&&r(t=>{const l=t[e.driverId]||{};return{...t,[e.driverId]:{...l,...e,lastUpdate:(new Date).toISOString()}}})}),M.on("driver-status",e=>{console.log("driver-status",e),e&&e.driverId&&r(t=>({...t,[e.driverId]:{...t[e.driverId],...e,lastUpdate:(new Date).toISOString()}}))}),()=>{M.disconnect()}),[M]),l.useEffect(()=>{null!=v&&v.lat&&null!=v&&v.lng&&(y([v.lat,v.lng]),b(15))},[v]);const F=Object.values(a).filter(e=>{const t=e.driverId.toLowerCase().includes(p.toLowerCase()),l="all"===f||"online"===f&&e.isOnline||"offline"===f&&!e.isOnline,n=!A||!(!R||!R.length)&&R.some(t=>{var l;return null===(l=t.drivers)||void 0===l?void 0:l.some(t=>{var l,n,i,o;return(null===(l=t.owner)||void 0===l?void 0:l.mobileNumber)===e.driverId||(null===(n=t.owner)||void 0===n?void 0:n.uuid)===e.driverId||t.id===e.driverId||String(null===(i=t.owner)||void 0===i?void 0:i.mobileNumber)===String(e.driverId)||String(null===(o=t.owner)||void 0===o?void 0:o.uuid)===String(e.driverId)})}),i=!O||((null===(o=O.drivers)||void 0===o?void 0:o.map(e=>{var t,l,n,i;return[null===(t=e.owner)||void 0===t?void 0:t.mobileNumber,null===(l=e.owner)||void 0===l?void 0:l.uuid,e.id,String(null===(n=e.owner)||void 0===n?void 0:n.mobileNumber),String(null===(i=e.owner)||void 0===i?void 0:i.uuid)]}).flat().filter(Boolean))||[]).some(t=>e.driverId===t);var o;return t&&l&&n&&i}),B=Object.values(a).filter(e=>e.isOnline).length,W=Object.values(a).filter(e=>!e.isOnline).length,U=Object.values(a).filter(e=>e.isOnline&&e.activeDeliveryLat&&e.activeDeliveryLng).length;return n.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100vh",width:"100%",overflow:"hidden",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif",background:"#f0f2f5",padding:"16px",boxSizing:"border-box"}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px",background:"white",padding:"12px 24px",borderRadius:"12px",boxShadow:"0 2px 8px rgba(0,0,0,0.05)",border:"2px solid #1F5FA844"}},n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},n.createElement("h1",{style:{margin:0,fontSize:"24px",fontWeight:"700",color:"#0d47a1"}},e("WT_LIVE_DRIVER_TRACKING")),n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",background:"#e8f5e9",color:"#2e7d32",borderRadius:"20px",fontSize:"12px",fontWeight:"700",border:"1px solid #c8e6c9"}},n.createElement("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:s?"#4caf50":"#f44336",boxShadow:s?"0 0 8px #4caf50":"none"}}))),n.createElement("p",{style:{margin:"4px 0 0 0",fontSize:"14px",color:"#666"}},e("REAL_TIME_TELEMETRY_AND_FLEET_COORDINATION"))),n.createElement("div",{style:{display:"flex",gap:"12px"}},[{label:e("TOTAL_FLEET"),value:Object.keys(a).length,color:"#0d47a1"},{label:e("ONLINE"),value:B,color:"#2e7d32"},{label:e("OFFLINE"),value:W,color:"#c62828"},{label:e("ACTIVE"),value:U,color:"#0d47a1"}].map((e,t)=>n.createElement("div",{key:t,style:{background:"#f8f9fa",padding:"8px 16px",borderRadius:"8px",minWidth:"100px",display:"flex",flexDirection:"column",border:"1px solid #e0e0e0"}},n.createElement("div",{style:{fontSize:"10px",fontWeight:"600",color:"#888",marginBottom:"4px"}},e.label),n.createElement("div",{style:{fontSize:"20px",fontWeight:"700",color:e.color}},e.value))))),n.createElement("div",{style:{display:"flex",flex:1,gap:"16px",overflow:"hidden"}},D&&n.createElement("button",{onClick:()=>{I(!N)},style:{position:"absolute",top:"80px",left:"20px",zIndex:2e3,background:"#1F5FA8",color:"white",border:"none",borderRadius:"8px",padding:"8px 12px",fontSize:"12px",cursor:"pointer",boxShadow:"0 2px 8px rgba(0,0,0,0.2)"}},N?"Close":"Menu"),n.createElement("div",{style:{width:D?N?"100%":"0":"360px",height:"100%",display:"flex",flexDirection:"column",background:"transparent",position:D?"absolute":"relative",top:0,left:0,zIndex:1500,transition:"all 0.3s ease-in-out",...D&&!N&&{width:"0",opacity:0,pointerEvents:"none"}}},N&&n.createElement(n.Fragment,null,n.createElement("div",{style:{padding:"12px",background:"white",borderRadius:"12px",display:"flex",flexDirection:"column",height:"100%",boxShadow:"0 2px 8px rgba(0,0,0,0.05)",border:"1px solid #e0e0e0"}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"}},n.createElement("h3",{style:{margin:0,fontSize:"14px",fontWeight:"700",color:"#888",letterSpacing:"1px"}},e("WT_FILTER_FLEET")),n.createElement("button",{onClick:()=>{x(null),w(null),E(""),g("all")},style:{background:"none",border:"none",color:"#1F5FA8",fontSize:"12px",fontWeight:"700",cursor:"pointer"}},e("WT_RESET_ALL"))),n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"12px"}},n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},n.createElement("label",{style:{fontSize:"12px",fontWeight:"700",color:"#888"}},e("WT_SELECT_FILLING_POINT")),n.createElement(t.Dropdown,{t:e,option:P,optionKey:"fillingPointName",select:e=>{x(e),w(null)},selected:A,placeholder:e("WT_SELECT_FILLING_POINT"),style:{width:"100%",margin:0}})),n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},n.createElement("label",{style:{fontSize:"12px",fontWeight:"700",color:"#888"}},e("WT_SELECT_VENDOR")),n.createElement(t.Dropdown,{t:e,option:k,optionKey:"name",select:w,selected:O,placeholder:e("WT_SELECT_VENDOR"),style:{width:"100%",margin:0}})),n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},n.createElement("label",{style:{fontSize:"10px",fontWeight:"700",color:"#888"}},e("WT_SEARCH_DRIVER_BY_ID")),n.createElement("div",{style:{position:"relative"}},n.createElement("span",{style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"#888"}},"🔍"),n.createElement("input",{type:"text",placeholder:e("WT_SEARCH_DRIVER_BY_ID"),value:p,onChange:e=>E(e.target.value),style:{width:"100%",padding:"10px 10px 10px 36px",border:"1px solid #e0e0e0",borderRadius:"8px",fontSize:"12px",outline:"none",background:"#f8f9fa",boxSizing:"border-box"}})))),n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"}},n.createElement("div",{style:{display:"flex",gap:"8px"}},["all","online","offline"].map(e=>n.createElement("button",{key:e,onClick:()=>g(e),style:{padding:"4px 12px",borderRadius:"4px",background:f===e?"#1F5FA8":"transparent",color:f===e?"white":"#666",border:f===e?"none":"1px solid #e0e0e0",cursor:"pointer",fontSize:"12px",fontWeight:"600",textTransform:"capitalize"}},e))),n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},n.createElement("input",{type:"checkbox",id:"showRoutes",checked:_,onChange:e=>h(e.target.checked),style:{cursor:"pointer"}}),n.createElement("label",{htmlFor:"showRoutes",style:{fontSize:"12px",color:"#666",cursor:"pointer"}},"Routes"))),n.createElement("div",{style:{flex:1,overflowY:"auto",padding:"4px",marginTop:"8px",display:"flex",flexDirection:"column",gap:"12px"}},0===F.length?n.createElement("div",{style:{textAlign:"center",padding:"40px 20px",color:"#999"}},n.createElement("p",null,e("WT_NO_DRIVERS_FOUND"))):F.map(e=>n.createElement(Ne,{key:e.driverId,driver:e,isSelected:(null==v?void 0:v.driverId)===e.driverId,vendorList:R,onClick:()=>{m(e),D&&I(!1)}})))))),n.createElement("div",{style:{flex:1,height:"100%",minHeight:0,position:"relative",background:"white",borderRadius:"12px",overflow:"hidden",boxShadow:"0 2px 8px rgba(0,0,0,0.05)",border:"1px solid #e0e0e0"}},n.createElement(u.MapContainer,{center:T,zoom:S,style:{height:"100%",width:"100%"},zoomControl:!1},n.createElement(u.TileLayer,{url:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),n.createElement(ye,{selectedDriver:v,mapZoom:S,mapCenter:T}),F.filter(e=>e.driverId!==(null==v?void 0:v.driverId)).map(e=>n.createElement(u.Marker,{key:e.driverId,position:[Number(e.lat),Number(e.lng)],icon:e.isOnline?ge:_e,eventHandlers:{click:()=>{m(e)}}})),v&&null!=v.lat&&null!=v.lng&&n.createElement(u.Marker,{key:v.driverId,position:[Number(v.lat),Number(v.lng)],icon:v.isOnline?ge:_e},n.createElement(u.Popup,null,n.createElement("div",{style:{minWidth:D?"200px":"250px",padding:"8px"}},n.createElement("div",{style:{fontWeight:"bold",fontSize:D?"14px":"16px",color:"#1F5FA8",marginBottom:"8px",borderBottom:"1px solid #eee",paddingBottom:"4px"}},"Driver #",v.driverId.substring(0,8),"... (Selected)"),n.createElement("div",{style:{marginBottom:"8px"}},n.createElement(be,{isOnline:v.isOnline})),n.createElement("div",{style:{fontSize:D?"12px":"13px"}},n.createElement("div",{style:{marginBottom:"8px"}},n.createElement("strong",null,"Current Location"),n.createElement("div",null,n.createElement(Te,{lat:v.lat,lng:v.lng}))),v.activeDeliveryLat&&v.activeDeliveryLng&&n.createElement("div",{style:{marginBottom:"8px"}},n.createElement("strong",null,e("DELIVERY_DESTINATION")),n.createElement("div",null,n.createElement(Te,{lat:v.activeDeliveryLat,lng:v.activeDeliveryLng}))),n.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px",background:"#f5f5f5",padding:"8px",borderRadius:"4px",marginTop:"8px"}},v.speed&&n.createElement(n.Fragment,null,n.createElement("span",null,e("WT_SPEED"),":"),n.createElement("span",null,(3.6*v.speed).toFixed(1)," ",e("WT_KM_PER_HOUR"))),v.heading&&n.createElement(n.Fragment,null,n.createElement("span",null,e("WT_HEADING"),":"),n.createElement("span",null,Math.round(v.heading),"°")),v.accuracy&&n.createElement(n.Fragment,null,n.createElement("span",null,e("WT_ACCURACY"),":"),n.createElement("span",null,Math.round(v.accuracy),"m"))),v.lastUpdate&&n.createElement("div",{style:{marginTop:"8px",color:"#666",fontSize:"10px"}},e("WT_LAST_UPDATE"),": ",new Date(v.lastUpdate).toLocaleString()))))),v&&null!=v.activeDeliveryLat&&null!=v.activeDeliveryLng&&n.createElement(u.Marker,{key:"dest-"+v.driverId,position:[Number(v.activeDeliveryLat),Number(v.activeDeliveryLng)],icon:he}),_&&v&&v.lat&&v.lng&&v.activeDeliveryLat&&v.activeDeliveryLng&&n.createElement(Se,{start:{lat:v.lat,lng:v.lng},end:{lat:v.activeDeliveryLat,lng:v.activeDeliveryLng},color:"#2196f3",weight:6})),n.createElement("div",{style:{position:"absolute",top:D?"60px":"20px",right:"10px",zIndex:1e3,background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",padding:"4px",display:"flex",flexDirection:D?"column":"row",gap:"4px"}},v&&n.createElement(n.Fragment,null,n.createElement("button",{onClick:()=>{if(null!=v&&v.lat&&null!=v&&v.lng){const e=[Number(v.lat),Number(v.lng)];y(e),b(15)}},style:{padding:D?"10px 12px":"8px 16px",background:"#1F5FA8",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:D?"12px":"14px",fontWeight:"500",whiteSpace:"nowrap"}},e("WT_CENTER")),n.createElement("button",{onClick:()=>m(null),style:{padding:D?"10px 12px":"8px 16px",background:"#f44336",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:D?"12px":"14px",fontWeight:"500",whiteSpace:"nowrap"}},e("WT_CLEAR"))),!v&&n.createElement("div",{style:{padding:D?"10px 12px":"8px 16px",background:"#f5f5f5",color:"#666",borderRadius:"4px",fontSize:D?"12px":"14px"}},D?"Select driver":"Select a driver from the list")),v&&n.createElement("div",{style:{position:"absolute",bottom:D?"10px":"20px",left:D?"10px":"20px",right:D?"10px":"auto",zIndex:1e3,background:"white",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:D?"12px":"16px",maxWidth:D?"calc(100% - 20px)":"300px",border:"2px solid #2196f3"}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"}},n.createElement("h4",{style:{margin:0,color:"#1F5FA8",fontSize:D?"14px":"16px"}},e("WT_SELECTED_DRIVER")),n.createElement(be,{isOnline:v.isOnline})),n.createElement("div",{style:{fontSize:D?"12px":"13px"}},n.createElement("div",null,n.createElement("strong",null,e("WT_ID"),":")," ",v.driverId.substring(0,6).toUpperCase(),"..."),n.createElement("div",null,n.createElement("strong",null,e("WT_LOCATION"),":")," ",n.createElement(Te,{lat:v.lat,lng:v.lng})),v.speed&&n.createElement("div",null,n.createElement("strong",null,e("WT_SPEED"),":")," ",Math.round(3.6*v.speed)," ",e("km/h")),v.lastSeen&&n.createElement("div",null,n.createElement("strong",null,e("WT_LAST_SEEN"),":")," ",new Date(v.lastSeen).toLocaleTimeString()))),n.createElement("div",{style:{position:"absolute",top:"20px",left:"20px",zIndex:1e3,display:"flex",flexDirection:"column",gap:"8px"}},n.createElement("button",{onClick:()=>b(e=>e+1),style:{width:"32px",height:"32px",background:"white",border:"1px solid #e0e0e0",borderRadius:"4px",fontSize:"18px",fontWeight:"700",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},"+"),n.createElement("button",{onClick:()=>b(e=>e-1),style:{width:"32px",height:"32px",background:"white",border:"1px solid #e0e0e0",borderRadius:"4px",fontSize:"18px",fontWeight:"700",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},"−")),n.createElement("div",{style:{position:"absolute",top:"20px",right:"20px",zIndex:1e3,display:"flex",gap:"12px"}}))))}const De=e=>{let{t:l,formData:i={},onSelect:o,config:a={},visibleFields:r=[]}=e;const d=(null==a?void 0:a.key)||"metaData",u=[{label:"WT_FILLING_POINT_NAME",name:"fillingPointName",isMandatory:!0},{label:"WT_AE_NAME",name:"aeName",isMandatory:!0,validation:{pattern:"^[a-zA-Z]+( [a-zA-Z]+)*$"}},{label:"WT_AE_MOBILE_NUMBER",name:"aeMobile",isMandatory:!0,componentInFront:n.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91"),validation:{pattern:"[6-9]{1}[0-9]{9}",type:"tel",maxLength:10}},{label:"WT_AE_EMAIL_ID",name:"aeEmail",validation:{pattern:"^[a-zA-Z0-9._%+-]+@[a-z.-]+\\.(com|org|in)$"}},{label:"WT_JE_NAME",name:"jeName",isMandatory:!0,validation:{pattern:"^[a-zA-Z]+( [a-zA-Z]+)*$"}},{label:"WT_JE_MOBILE_NUMBER",name:"jeMobile",isMandatory:!0,componentInFront:n.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91"),validation:{pattern:"[6-9]{1}[0-9]{9}",type:"tel",maxLength:10}},{label:"WT_JE_EMAIL_ID",name:"jeEmail",validation:{pattern:"^[a-zA-Z0-9._%+-]+@[a-z.-]+\\.(com|org|in)$"}},{label:"WT_EE_NAME",name:"eeName",isMandatory:!0,validation:{pattern:"^[a-zA-Z]+( [a-zA-Z]+)*$"}},{label:"WT_EE_MOBILE_NUMBER",name:"eeMobile",isMandatory:!0,componentInFront:n.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91"),validation:{pattern:"[6-9]{1}[0-9]{9}",type:"tel",maxLength:10}},{label:"WT_EE_EMAIL_ID",name:"eeEmail",validation:{pattern:"^[a-zA-Z0-9._%+-]+@[a-z.-]+\\.(com|org|in)$"}}],s=r&&r.length>0?u.filter(e=>r.includes(e.name)):u;return n.createElement(t.CollapsibleCardPage,{title:"Filling Point Details",defaultOpen:!0},n.createElement("div",{className:"formcomposer-section-grid"},s.map(e=>{var a,r;return n.createElement("div",{key:e.name},n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},l(e.label),e.isMandatory?" *":""),n.createElement("div",{style:{display:"flex"}},e.componentInFront||null,n.createElement(t.TextInput,m({value:(null==i||null===(a=i[d])||void 0===a?void 0:a[e.name])||"",onChange:t=>((e,t)=>{if(!o)return;let l=e;["aeMobile","jeMobile","eeMobile","alternateNumber"].includes(t)&&(l=e.slice(0,10).replace(/[^0-9]/g,"")),o(d,{...null==i?void 0:i[d],[t]:l})})(t.target.value,e.name),maxLength:null===(r=e.validation)||void 0===r?void 0:r.maxLength},e.validation)))))})))},Ce=[{name:"Correspondence",code:"CORRESPONDENCE",i18nKey:"COMMON_ADDRESS_TYPE_CORRESPONDENCE"},{name:"Permanent",code:"PERMANENT",i18nKey:"COMMON_ADDRESS_TYPE_PERMANENT"},{name:"Other",code:"OTHER",i18nKey:"COMMON_ADDRESS_TYPE_OTHER"}],Ae=e=>{var i,a,r,d,u,s,c,v,m,p,E,f,g,_,h;let{t:T,config:y,formData:S,onSelect:b,isEdit:D}=e;const{data:C}=Digit.Hooks.useTenants(),A=o.useLocation(),x=Digit.ULBService.getCurrentTenantId(),O=(null===(i=A.state)||void 0===i?void 0:i.usedAddressTypes)||[],[w,L]=l.useState((null==S||null===(a=S.address)||void 0===a?void 0:a.pincode)||""),[P,R]=l.useState((null==S||null===(r=S.address)||void 0===r?void 0:r.city)||null),[k,M]=l.useState((null==S||null===(d=S.address)||void 0===d?void 0:d.locality)||null),[F,B]=l.useState((null==S||null===(u=S.address)||void 0===u?void 0:u.houseNo)||""),[W,U]=l.useState((null==S||null===(s=S.address)||void 0===s?void 0:s.streetName)||""),[H,j]=l.useState((null==S||null===(c=S.address)||void 0===c?void 0:c.landmark)||""),[V,z]=l.useState((null==S||null===(v=S.address)||void 0===v?void 0:v.addressLine1)||""),[K,G]=l.useState((null==S||null===(m=S.address)||void 0===m?void 0:m.addressLine2)||""),[Y,q]=l.useState(null!=S&&null!==(p=S.address)&&void 0!==p&&p.addressType?Ce.find(e=>e.code===S.address.addressType)||S.address.addressType:Ce.find(e=>"PERMANENT"===e.code)),[$,X]=l.useState((null==S||null===(E=S.address)||void 0===E?void 0:E.zone)||""),[Q,Z]=l.useState((null==S||null===(f=S.address)||void 0===f?void 0:f.block)||""),[J,ee]=l.useState((null==S||null===(g=S.address)||void 0===g?void 0:g.assembly)||""),[te,le]=l.useState((null==S||null===(_=S.address)||void 0===_?void 0:_.latitude)||""),[ne,ie]=l.useState((null==S||null===(h=S.address)||void 0===h?void 0:h.longitude)||""),[oe,ae]=l.useState(""),[re,de]=l.useState(!1),[ue,se]=l.useState(!1),[ce,ve]=l.useState(null),[me,pe]=l.useState(null),Ee=l.useRef(!D),fe=l.useRef(null),ge=l.useRef(null),{data:_e}=(l.useMemo(()=>Ce.filter(3===O.length?e=>"OTHER"===e.code:e=>!O.includes(e.code)),[O]),Digit.Hooks.useCommonMDMS(x,"egov-location",["TenantBoundary"]));l.useEffect(()=>{if(!P&&C&&C.length>0){const e=C.find(e=>e.code===x)||C[0];R(e)}},[C,P,x]);const he=l.useMemo(()=>{var e;const t=((null==_e||null===(e=_e["egov-location"])||void 0===e?void 0:e.TenantBoundary)||[]).find(e=>{var t;return"REVENUE"===(null==e||null===(t=e.hierarchyType)||void 0===t?void 0:t.code)}),l=(null==t?void 0:t.boundary)||[];return Array.isArray(l)?l:[l]},[_e]),Te=l.useMemo(()=>{let e=[];const t=Array.isArray(he)?he:he?[he]:[],l=function(t,n,i,o){if(void 0===n&&(n=null),void 0===i&&(i=null),void 0===o&&(o=null),!t)return;let a=n,r=i,d=o;"Zone"!==t.label&&"ZONE"!==t.label||(a=t.localname||t.code||t.name),"Ward"!==t.label&&"WARD"!==t.label&&"Block"!==t.label&&"BLOCK"!==t.label||(r=t.code||t.localname||t.name),"Assembly Constituency"!==t.label&&"ASSEMBLY_CONSTITUENCY"!==t.label||(d=t.code||t.localname||t.name),"Locality"!==t.label&&"LOCALITY"!==t.label||e.push({...t,name:t.localname||t.name||t.code,i18nkey:t.i18nkey||`${x.replace(".","_")}_REVENUE_${t.code}`.toUpperCase(),zone:a,ward:r,assembly:d}),t.children&&t.children.length>0&&t.children.forEach(e=>l(e,a,r,d))};return t.forEach(e=>l(e)),e},[he,x]),ye=l.useMemo(()=>{const e=new Set;return Te.forEach(t=>{t.pincode&&(Array.isArray(t.pincode)?t.pincode:[t.pincode]).forEach(t=>{if(t){const l=t.toString().split(".")[0];e.add(l)}})}),0===e.size&&null!=P&&P.pincode&&(Array.isArray(P.pincode)?P.pincode:[P.pincode]).forEach(t=>{if(t){const l=t.toString().split(".")[0];e.add(l)}}),Array.from(e).sort().map(e=>({code:e,name:e,i18nKey:e}))},[Te,P]),Se=l.useMemo(()=>w&&ye.some(e=>e.code===w)?Te.filter(e=>!!e.pincode&&(Array.isArray(e.pincode)?e.pincode:[e.pincode]).some(e=>e.toString()===w)):Te,[Te,w,ye]);return l.useEffect(()=>{var e;const t=(null==S?void 0:S.id)||(null==S?void 0:S.bookingId)||(null==S||null===(e=S.address)||void 0===e?void 0:e.id);if(t&&ge.current!==t&&(Ee.current=!1,ge.current=t),null!=S&&S.address&&!Ee.current&&C){var l;const e=S.address,t=C.find(t=>t.code===e.cityCode||t.code===e.city||t.name===e.city)||e.city;if(t&&(!P||P.code!==t.code&&P!==t)&&R(t||null),L((null===(l=e.pincode)||void 0===l?void 0:l.toString().split(".")[0])||""),B(e.houseNo||""),U(e.streetName||""),j(e.landmark||""),z(e.addressLine1||""),q(Ce.find(t=>t.code===e.addressType)||e.addressType||Ce.find(e=>"PERMANENT"===e.code)),X(e.zone||""),Z(e.block||e.ward||""),ee(e.assembly||e.constituency||""),le(e.latitude||""),ie(e.longitude||""),(null==Te?void 0:Te.length)>0||!e.cityCode){const t=Te.find(t=>t.code===e.localityCode||t.code===e.locality||t.i18nkey===e.locality);M(t||e.locality||null),t&&(!e.zone&&t.zone&&X(t.zone),!e.block&&t.ward&&Z(t.ward),!e.assembly&&t.assembly&&ee(t.assembly)),Ee.current=!0,fe.current=JSON.stringify(e)}}},[null==S?void 0:S.address,P,C,Te]),l.useEffect(()=>{navigator.geolocation&&navigator.geolocation.getCurrentPosition(e=>{le(e.coords.latitude),ie(e.coords.longitude)},()=>{})},[]),l.useEffect(()=>{oe&&Object.keys(oe).length&&(L(oe.pinCode),R(null==C?void 0:C.find(e=>e.name===oe.city)),M(Array.isArray(he)?he.find(e=>e.i18nkey===oe.locality):null),B(oe.houseNumber),U(oe.streetName),j(oe.landmark),z(oe.address),X(oe.zone),Z(oe.block),ee(oe.assembly),le(oe.latitude),ie(oe.longitude),q(Ce.find(e=>e.code===oe.addressType)))},[oe,Te]),l.useEffect(()=>{if(!V||V.trim().length<5)return;const e=setTimeout(()=>{!function(){try{Promise.resolve(I(function(){return N(function(){se(!0),ve(null);const e=[F,W,V,K,(null==k?void 0:k.name)||("string"==typeof k?k:""),(null==P?void 0:P.name)||("string"==typeof P?P:""),w].filter(Boolean).join(", ");return e.trim()?Promise.resolve(function(e){try{return e&&e.trim()?Promise.resolve(N(function(){return Promise.resolve(fetch("https://nominatim.openstreetmap.org/search?format=json&q="+encodeURIComponent(e),{headers:{"Accept-Language":"en","User-Agent":"Digit-UI-WT-Module"}})).then(function(e){if(!e.ok)throw new Error("Geocoding failed: "+e.statusText);return Promise.resolve(e.json())})},function(e){return console.error("Error in geocodeAddress:",e),null})):Promise.resolve(null)}catch(e){return Promise.reject(e)}}(e)).then(function(e){e&&e.length>0?(le(e[0].lat),ie(e[0].lon),pe(e[0].display_name)):ve(T("WT_LOCATION_NOT_FOUND"))}):(ve(T("WT_ENTER_ADDRESS_DETAILS_FIRST")),void se(!1))},function(){ve(T("WT_GEOCODING_ERROR"))})},function(e,t){if(se(!1),e)throw t;return t}))}catch(e){return Promise.reject(e)}}()},1e3);return()=>clearTimeout(e)},[V]),l.useEffect(()=>{if(!b||!Ee.current)return;const e={pincode:w||"",city:(null==P?void 0:P.code)||P||null,locality:(null==k?void 0:k.code)||k||null,houseNo:F||"",landmark:H||"",addressLine1:V||"",addressLine2:K||"",streetName:W||"",addressType:(null==Y?void 0:Y.code)||Y||null,zone:$||"",block:Q||"",assembly:J||"",latitude:te||"",longitude:ne||""},t=JSON.stringify(e);fe.current!==t&&(fe.current=t,b((null==y?void 0:y.key)||"address",e))},[w,P,k,F,H,V,K,W,Y,$,Q,J,te,ne]),n.createElement(t.CollapsibleCardPage,{title:T("WT_ADDRESS_DETAILS"),defaultOpen:!0},n.createElement("div",{className:"formcomposer-section-grid"},n.createElement("div",{style:{position:"relative"}},n.createElement(t.CardLabel,null,T("PINCODE")),n.createElement(t.TextInput,{value:w,onChange:e=>{const t=e.target.value.replace(/\D/g,"").slice(0,6);t!==w&&(M(null),X(""),Z(""),le(""),ie(""),z("")),L(t),de(!0)},onFocus:()=>de(!0),onBlur:()=>{setTimeout(()=>de(!1),200)},style:{width:"100%"},maxlength:6}),re&&(null==ye?void 0:ye.length)>0&&n.createElement("div",{className:"options-card",style:{position:"absolute",zIndex:100,width:"100%",maxHeight:"200px",overflowY:"auto",backgroundColor:"white",boxShadow:"0 2px 5px rgba(0,0,0,0.1)"}},ye.filter(e=>!w||e.code.toLowerCase().includes(w.toLowerCase())).map((e,t)=>n.createElement("div",{key:t,className:"cp profile-dropdown--item",style:{padding:"10px",borderBottom:"1px solid #eee",cursor:"pointer"},onClick:()=>{L(e.code),de(!1)}},e.code)))),n.createElement("div",null,n.createElement(t.CardLabel,null,T("LOCALITY")),n.createElement(t.Dropdown,{selected:k,select:e=>{M(e),null!=e&&e.latitude&&le(e.latitude),null!=e&&e.longitude&&ie(e.longitude),null!=e&&e.localname&&z(e.localname),null!=e&&e.zone&&X(e.zone),null!=e&&e.ward&&Z(e.ward),null!=e&&e.assembly&&ee(e.assembly)},option:Se,optionKey:"i18nkey",t:T,style:{width:"100%"},isSearchable:!0})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("HOUSE_NO")),n.createElement(t.TextInput,{value:F,onChange:e=>B(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("STREET_NAME")),n.createElement(t.TextInput,{value:W,onChange:e=>U(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("ADDRESS_LINE1")),n.createElement(t.TextInput,{value:V,onChange:e=>z(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("ADDRESS_LINE2")),n.createElement(t.TextInput,{value:K,onChange:e=>G(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("BLOCK")),n.createElement(t.TextInput,{value:Q,onChange:e=>Z(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("ZONE")),n.createElement(t.TextInput,{value:$,onChange:e=>X(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("LATITUDE")),n.createElement(t.TextInput,{value:te,onChange:e=>le(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("LONGITUDE")),n.createElement(t.TextInput,{value:ne,onChange:e=>ie(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("ASSEMBLY_CONSTITUENCY")),n.createElement(t.TextInput,{value:J,onChange:e=>ee(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("LANDMARK")),n.createElement(t.TextInput,{value:H,onChange:e=>j(e.target.value),style:{width:"100%"}}))))},xe=()=>{var e,r,d,u,s,c,m,p,E,f,g,_;const{t:h}=i.useTranslation(),T=o.useLocation(),y=o.useHistory(),S=a.useQueryClient(),b=new URLSearchParams(T.search).get("id"),[N,I]=l.useState({}),[D,C]=l.useState(null),A=Digit.ULBService.getCurrentTenantId(),{isLoading:x,data:O}=Digit.Hooks.wt.useFillPointSearch({tenantId:A,filters:{id:b}},{enabled:!!b});l.useEffect(()=>{if(b&&null!=O&&O.fillingPoints){const e=O.fillingPoints.find(e=>e.id===b);e&&I({id:e.id,tenantId:e.tenantId,status:e.status,owner:{fillingPointName:e.fillingPointName,emergencyName:e.emergencyName,aeName:e.aeName,aeMobile:e.aeMobile,aeEmail:e.aeEmail,jeName:e.jeName,jeMobile:e.jeMobile,jeEmail:e.jeEmail,eeName:e.eeName,eeMobile:e.eeMobile,eeEmail:e.eeEmail},address:{...e.address}})}},[O,b]);const{mutate:w}=Digit.Hooks.wt.useCreateFillPoint(A),{mutate:L}=Digit.Hooks.wt.useUpdateFillPoint(A),P=window.Digit.Utils.browser.isMobile(),R=!(null!=N&&null!==(e=N.owner)&&void 0!==e&&e.aeName&&null!=N&&null!==(r=N.owner)&&void 0!==r&&r.aeMobile&&null!=N&&null!==(d=N.owner)&&void 0!==d&&d.jeName&&null!=N&&null!==(u=N.owner)&&void 0!==u&&u.jeMobile&&null!=N&&null!==(s=N.owner)&&void 0!==s&&s.eeName&&null!=N&&null!==(c=N.owner)&&void 0!==c&&c.eeMobile&&null!=N&&null!==(m=N.address)&&void 0!==m&&m.addressLine1&&null!=N&&null!==(p=N.address)&&void 0!==p&&p.city&&null!=N&&null!==(E=N.address)&&void 0!==E&&E.locality&&null!=N&&null!==(f=N.address)&&void 0!==f&&f.latitude&&null!=N&&null!==(g=N.address)&&void 0!==g&&g.longitude&&null!=N&&null!==(_=N.address)&&void 0!==_&&_.pincode);return x?n.createElement(t.Loader,null):n.createElement("div",{className:"employee-form-section-wrapper"},n.createElement(v,{config:[{timeLine:[{actions:b?"Update Filling Point":"Add Filling Point",currentStep:1}]}],showFinalStep:!1}),n.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"16px"}},n.createElement(De,{t:h,config:{key:"owner"},onSelect:(e,t)=>{I(l=>({...l,[e]:t}))},formData:N,visibleFields:["fillingPointName","emergencyName","aeName","aeMobile","aeEmail","jeName","jeMobile","jeEmail","eeName","eeMobile","eeEmail"]}),n.createElement(Ae,{t:h,config:{key:"address"},onSelect:(e,t)=>{I(l=>({...l,[e]:{...l[e]||{},...t}}))},formData:N,isEdit:!!b}),n.createElement("div",{style:{display:"flex",marginBottom:"24px",justifyContent:P?"center":"flex-end"}},n.createElement(t.SubmitBar,{label:h(b?"ES_COMMON_UPDATE":"ES_COMMON_SAVE"),onSubmit:e=>{e&&e.preventDefault&&e.preventDefault();const t=(l={...N,tenantId:A},{RequestInfo:{userInfo:{uuid:(null===(n=Digit.UserService.getUser())||void 0===n||null===(i=n.info)||void 0===i?void 0:i.uuid)||"user-123"}},fillingPoints:[{id:null==l?void 0:l.id,bookingId:null==l?void 0:l.bookingId,tenantId:null==l?void 0:l.tenantId,fillingPointName:null==l||null===(o=l.owner)||void 0===o?void 0:o.fillingPointName,emergencyName:null==l||null===(a=l.owner)||void 0===a?void 0:a.emergencyName,eeName:null==l||null===(r=l.owner)||void 0===r?void 0:r.eeName,eeEmail:null==l||null===(d=l.owner)||void 0===d?void 0:d.eeEmail,eeMobile:null==l||null===(u=l.owner)||void 0===u?void 0:u.eeMobile,aeName:null==l||null===(s=l.owner)||void 0===s?void 0:s.aeName,aeEmail:null==l||null===(c=l.owner)||void 0===c?void 0:c.aeEmail,aeMobile:null==l||null===(v=l.owner)||void 0===v?void 0:v.aeMobile,jeName:null==l||null===(m=l.owner)||void 0===m?void 0:m.jeName,jeEmail:null==l||null===(p=l.owner)||void 0===p?void 0:p.jeEmail,jeMobile:null==l||null===(E=l.owner)||void 0===E?void 0:E.jeMobile,status:null==l?void 0:l.status,address:{houseNo:null==l||null===(f=l.address)||void 0===f?void 0:f.houseNo,streetName:null==l||null===(g=l.address)||void 0===g?void 0:g.streetName,addressLine1:null==l||null===(_=l.address)||void 0===_?void 0:_.addressLine1,addressLine2:null==l||null===(T=l.address)||void 0===T?void 0:T.addressLine2,landmark:null==l||null===(I=l.address)||void 0===I?void 0:I.landmark,city:(null==l||null===(D=l.address)||void 0===D||null===(x=D.city)||void 0===x?void 0:x.name)||(null==l||null===(O=l.address)||void 0===O?void 0:O.city)||"DJB",cityCode:(null==l||null===(P=l.address)||void 0===P?void 0:P.cityCode)||(null==l||null===(R=l.address)||void 0===R||null===(k=R.city)||void 0===k?void 0:k.code)||"DJB",locality:(null==l||null===(M=l.address)||void 0===M||null===(F=M.locality)||void 0===F?void 0:F.label)||(null==l||null===(B=l.address)||void 0===B||null===(W=B.locality)||void 0===W?void 0:W.name)||(null==l||null===(U=l.address)||void 0===U?void 0:U.locality)||"",localityCode:(null==l||null===(H=l.address)||void 0===H||null===(j=H.locality)||void 0===j?void 0:j.code)||(null==l||null===(V=l.address)||void 0===V?void 0:V.localityCode)||"",pincode:null==l||null===(z=l.address)||void 0===z?void 0:z.pincode,latitude:null==l||null===(K=l.address)||void 0===K?void 0:K.latitude,longitude:null==l||null===(G=l.address)||void 0===G?void 0:G.longitude,ward:(null==l||null===(Y=l.address)||void 0===Y?void 0:Y.ward)||(null==l||null===(q=l.address)||void 0===q?void 0:q.block)||"",zone:(null==l||null===($=l.address)||void 0===$?void 0:$.zone)||"",constituency:(null==l||null===(X=l.address)||void 0===X?void 0:X.assembly)||(null==l||null===(Q=l.address)||void 0===Q?void 0:Q.constituency)||"",type:"FILLING-POINT"}}]});var l,n,i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,T,I,D,x,O,P,R,k,M,F,B,W,U,H,j,V,z,K,G,Y,q,$,X,Q;(b?L:w)(t,{onSuccess:()=>{C({label:h(b?"WT_FILLING_POINT_UPDATED_SUCCESS":"WT_FILLING_POINT_CREATED_SUCCESS")}),S.invalidateQueries("wtFillPointSearchList"),setTimeout(()=>{C(null),y.push("/digit-ui/employee/wt/search-filling-fix-point?tab=FILLING_POINT")},3e3)},onError:e=>{var t,l,n,i,o,a,r,d,u,s;const c=(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.error)||void 0===n?void 0:n.message)||(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.message)||(null==e||null===(d=e.response)||void 0===d||null===(u=d.data)||void 0===u||null===(s=u.responseInfo)||void 0===s?void 0:s.resMsgId)||h(b?"WT_FILLING_POINT_UPDATED_ERROR":"WT_FILLING_POINT_CREATED_ERROR");C({label:c,isError:!0}),setTimeout(()=>C(null),5e3)}})},disabled:R}))),D&&n.createElement(t.Toast,{error:D.isError,label:D.label,onClose:()=>C(null)}))},Oe=()=>{var e,r,d,u,s,c,m,p,E,f,g,_;const{t:h}=i.useTranslation(),T=o.useLocation(),y=o.useHistory(),S=a.useQueryClient(),b=new URLSearchParams(T.search).get("id"),[N,I]=l.useState({}),[D,C]=l.useState(null),A=Digit.ULBService.getCurrentTenantId(),x=n.useMemo(()=>({tenantId:A,filters:{id:b}}),[A,b]),O=n.useMemo(()=>({enabled:!!b}),[b]),{isLoading:w,data:L}=Digit.Hooks.wt.useFixedPointSearchAPI(x,O),[P,R]=l.useState(!1);l.useEffect(()=>{if(b&&null!=L&&L.waterTankerBookingDetail&&!P){const c=L.waterTankerBookingDetail.find(e=>{var t;return(null===(t=e.applicantDetail)||void 0===t?void 0:t.applicantId)===b});var e,t,l,n,i,o,a,r,d,u,s;c&&(I({owner:{name:null===(e=c.applicantDetail)||void 0===e?void 0:e.name,mobileNumber:null===(t=c.applicantDetail)||void 0===t?void 0:t.mobileNumber,alternateNumber:null===(l=c.applicantDetail)||void 0===l?void 0:l.alternateNumber,emailId:null===(n=c.applicantDetail)||void 0===n?void 0:n.emailId,applicantId:null===(i=c.applicantDetail)||void 0===i?void 0:i.applicantId},address:{...c.address,addressId:null===(o=c.address)||void 0===o?void 0:o.addressId,applicantId:null===(a=c.address)||void 0===a?void 0:a.applicantId,block:(null===(r=c.address)||void 0===r?void 0:r.ward)||(null===(d=c.address)||void 0===d?void 0:d.block),assembly:(null===(u=c.address)||void 0===u?void 0:u.constituency)||(null===(s=c.address)||void 0===s?void 0:s.assembly)},bookingId:c.bookingId,bookingNo:c.bookingNo,auditDetails:c.auditDetails}),R(!0))}},[L,b,P]);const k=n.useMemo(()=>({key:"address"}),[]),M=n.useCallback((e,t)=>{I(l=>({...l,[e]:{...l[e]||{},...t}}))},[]),{mutate:F}=Digit.Hooks.wt.useCreateFixedPoint(A),{mutate:B}=Digit.Hooks.wt.useUpdateFixedPoint(A),W=window.Digit.Utils.browser.isMobile(),U=!(null!=N&&null!==(e=N.owner)&&void 0!==e&&e.name&&null!=N&&null!==(r=N.owner)&&void 0!==r&&r.mobileNumber&&null!=N&&null!==(d=N.address)&&void 0!==d&&d.addressLine1&&null!=N&&null!==(u=N.address)&&void 0!==u&&u.city&&null!=N&&null!==(s=N.address)&&void 0!==s&&s.locality&&null!=N&&null!==(c=N.address)&&void 0!==c&&c.latitude&&null!=N&&null!==(m=N.address)&&void 0!==m&&m.longitude&&null!=N&&null!==(p=N.address)&&void 0!==p&&p.pincode);return w?n.createElement(t.Loader,null):n.createElement("div",{className:"employee-form-section-wrapper"},n.createElement(v,{config:[{timeLine:[{actions:b?"Update Fixed Point":"Add Fixed Point",currentStep:1}]}],showFinalStep:!1}),n.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"16px"}},n.createElement(t.CollapsibleCardPage,{title:h("Fixed Point Details"),defaultOpen:!0},n.createElement("div",{className:"formcomposer-section-grid"},n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.CardLabel,null,""+h("WT_FIXING_POINT_APPLICANT_DETAILS")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextInput,{t:h,type:"text",name:"name",value:null==N||null===(E=N.owner)||void 0===E?void 0:E.name,style:{width:"100%"},onChange:e=>M("owner",{name:e.target.value})})),n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.CardLabel,null,""+h("COMMON_MOBILE_NUMBER")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.MobileNumber,{value:null==N||null===(f=N.owner)||void 0===f?void 0:f.mobileNumber,name:"mobileNumber",onChange:e=>M("owner",{mobileNumber:e}),style:{width:"100%"}})),n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.CardLabel,null,""+h("COMMON_EMAIL_ID")),n.createElement(t.TextInput,{t:h,type:"email",name:"emailId",value:null==N||null===(g=N.owner)||void 0===g?void 0:g.emailId,style:{width:"100%"},onChange:e=>M("owner",{emailId:e.target.value})})),n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.CardLabel,null,""+h("COMMON_ALT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{value:null==N||null===(_=N.owner)||void 0===_?void 0:_.alternateNumber,name:"alternateNumber",onChange:e=>M("owner",{alternateNumber:e}),style:{width:"100%"}})))),n.createElement("div",null,n.createElement(Ae,{t:h,config:k,onSelect:M,formData:N,isEdit:!!b})),n.createElement("div",{style:{display:"flex",justifyContent:W?"center":"flex-end"}},n.createElement(t.SubmitBar,{label:h(b?"ES_COMMON_UPDATE":"ES_COMMON_SAVE"),onSubmit:e=>{const t={waterTankerBookingDetail:{bookingId:(null==(l={...N,tenantId:A})?void 0:l.bookingId)||"",bookingNo:(null==l?void 0:l.bookingNo)||null,tenantId:null==l?void 0:l.tenantId,mobileNumber:(null==l||null===(n=l.owner)||void 0===n?void 0:n.mobileNumber)||"",applicantDetail:{applicantId:(null==l||null===(i=l.owner)||void 0===i?void 0:i.applicantId)||null,bookingId:(null==l?void 0:l.bookingId)||"",name:(null==l||null===(o=l.owner)||void 0===o?void 0:o.name)||(null==l||null===(a=l.owner)||void 0===a?void 0:a.applicantName)||"",mobileNumber:(null==l||null===(r=l.owner)||void 0===r?void 0:r.mobileNumber)||"",alternateNumber:(null==l||null===(d=l.owner)||void 0===d?void 0:d.alternateNumber)||"",emailId:(null==l||null===(u=l.owner)||void 0===u?void 0:u.emailId)||"",type:"FIXED-POINT"},address:{addressId:(null==l||null===(s=l.address)||void 0===s?void 0:s.addressId)||null,applicantId:(null==l||null===(c=l.address)||void 0===c?void 0:c.applicantId)||null,houseNo:(null==l||null===(v=l.address)||void 0===v?void 0:v.houseNo)||"",streetName:(null==l||null===(m=l.address)||void 0===m?void 0:m.streetName)||"",addressLine1:(null==l||null===(p=l.address)||void 0===p?void 0:p.addressLine1)||"",addressLine2:(null==l||null===(E=l.address)||void 0===E?void 0:E.addressLine2)||"",landmark:(null==l||null===(f=l.address)||void 0===f?void 0:f.landmark)||"",city:(null==l||null===(g=l.address)||void 0===g||null===(_=g.city)||void 0===_?void 0:_.name)||(null==l||null===(T=l.address)||void 0===T?void 0:T.city)||"DJB",cityCode:(null==l||null===(I=l.address)||void 0===I?void 0:I.cityCode)||(null==l||null===(D=l.address)||void 0===D||null===(x=D.city)||void 0===x?void 0:x.code)||"DJB",locality:(null==l||null===(O=l.address)||void 0===O||null===(w=O.locality)||void 0===w?void 0:w.label)||(null==l||null===(L=l.address)||void 0===L||null===(P=L.locality)||void 0===P?void 0:P.name)||(null==l||null===(R=l.address)||void 0===R?void 0:R.locality)||"",localityCode:(null==l||null===(k=l.address)||void 0===k||null===(M=k.locality)||void 0===M?void 0:M.code)||(null==l||null===(W=l.address)||void 0===W?void 0:W.localityCode)||"",latitude:(null==l||null===(U=l.address)||void 0===U?void 0:U.latitude)||"",longitude:(null==l||null===(H=l.address)||void 0===H?void 0:H.longitude)||"",pincode:(null==l||null===(j=l.address)||void 0===j?void 0:j.pincode)||"",ward:(null==l||null===(V=l.address)||void 0===V?void 0:V.ward)||(null==l||null===(z=l.address)||void 0===z?void 0:z.block)||"",zone:(null==l||null===(K=l.address)||void 0===K?void 0:K.zone)||"",constituency:(null==l||null===(G=l.address)||void 0===G?void 0:G.assembly)||(null==l||null===(Y=l.address)||void 0===Y?void 0:Y.constituency)||"",type:"FIXED-POINT"}}};var l,n,i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,T,I,D,x,O,w,L,P,R,k,M,W,U,H,j,V,z,K,G,Y;(b?B:F)(t,{onSuccess:()=>{C({label:h(b?"WT_FILLING_POINT_UPDATED_SUCCESS":"WT_FILLING_POINT_CREATED_SUCCESS")}),S.invalidateQueries("wtFixedPointSearchList"),setTimeout(()=>{C(null),y.push("/digit-ui/employee/wt/search-filling-fix-point?tab=FIXED_POINT")},3e3)},onError:e=>{var t,l,n,i,o,a,r,d,u,s;const c=(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.error)||void 0===n?void 0:n.message)||(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.message)||(null==e||null===(d=e.response)||void 0===d||null===(u=d.data)||void 0===u||null===(s=u.responseInfo)||void 0===s?void 0:s.resMsgId)||h(b?"WT_FILLING_POINT_UPDATED_ERROR":"WT_FILLING_POINT_CREATED_ERROR");C({label:c,isError:!0}),setTimeout(()=>C(null),5e3)}})},disabled:U}))),D&&n.createElement(t.Toast,{error:D.isError,label:D.label,onClose:()=>C(null)}))},we=e=>{var i,o;let{t:a,closeModal:r,onSubmit:d,initialValues:u,tenantId:s,modalMode:c}=e;const v="VIEW"===c,m="UPDATE"===c,[p,E]=l.useState(null),[f,g]=l.useState([]),{data:_,isLoading:h}=Digit.Hooks.hrms.useHrmsMDMS(s,"egov-location","HRMSRolesandDesignation"),T=l.useMemo(()=>{var e,t;return((null===(e=(null==_?void 0:_.MdmsRes)||_)||void 0===e||null===(t=e["egov-location"])||void 0===t?void 0:t.TenantBoundary)||[]).map(e=>({i18nKey:e.hierarchyType.name||e.hierarchyType.code||e.hierarchyType,code:e.hierarchyType.code||e.hierarchyType,boundary:e.boundary}))},[_]);n.useEffect(()=>{T.length>0&&!p&&E(T[0])},[T,p]);const y=function(e,t){return void 0===t&&(t=[]),e?(("Locality"===e.label||e.children&&0===e.children.length&&e.code)&&t.push({name:e.localname||e.name,code:e.code,i18nKey:e.code}),e.children&&e.children.forEach(e=>y(e,t)),t):t},S=l.useMemo(()=>p&&p.boundary?y(p.boundary):[],[p]);return n.useEffect(()=>{var e,t;if(S.length>0&&0===f.length&&((null==u||null===(e=u.fillingPointLocalityCodes)||void 0===e?void 0:e.length)>0||null!=u&&null!==(t=u.address)&&void 0!==t&&t.locality)&&(v||m)){var l;const e=(null==u||null===(l=u.fillingPointLocalityCodes)||void 0===l?void 0:l.length)>0?u.fillingPointLocalityCodes:"string"==typeof u.address.locality?u.address.locality.split(",").map(e=>e.trim()):[],t=S.filter(t=>e.some(e=>e===t.code||e.toLowerCase()===(t.name||"").toLowerCase()));t.length>0&&g(t)}},[S,u,v,m,f]),h?n.createElement(t.Loader,null):n.createElement("div",{className:"custom-modal-overlay",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2e5}},n.createElement("style",null,"\n .custom-modal-content {\n background-color: #fff;\n border-radius: 8px;\n width: 50%;\n max-width: 600px;\n max-height: 90vh;\n display: flex;\n flex-direction: column;\n box-shadow: 0 4px 12px rgba(0,0,0,0.15);\n position: relative;\n }\n @media (max-width: 768px) {\n .custom-modal-content {\n width: 90%;\n }\n }\n "),n.createElement("div",{className:"custom-modal-content"},n.createElement("div",{className:"custom-modal-header",style:{padding:"16px 24px",borderBottom:"1px solid #eee",display:"flex",justifyContent:"space-between",alignItems:"center"}},n.createElement("h1",{style:{margin:0,fontSize:"20px",fontWeight:"600",color:"#1D4E7F"}},a(v?"WT_VIEW_LOCALITY":m?"WT_UPDATE_LOCALITY":"WT_ADD_TO_LOCALITY")),n.createElement("button",{onClick:r,style:{background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×")),n.createElement("div",{style:{padding:"24px"}},n.createElement("div",{style:{marginBottom:"16px"}},n.createElement(t.CardLabel,null,a("WT_CURRENT_LOCALITY")),n.createElement("div",{style:{fontWeight:"600",marginBottom:"8px"}},(null==u||null===(i=u.fillingPointLocalityCodes)||void 0===i?void 0:i.length)>0?u.fillingPointLocalityCodes.join(", "):(null==u||null===(o=u.address)||void 0===o?void 0:o.locality)||"NA")),!v&&n.createElement("div",{style:{marginBottom:"16px"}},n.createElement(t.CardLabel,null,a("WT_SELECT_NEW_LOCALITY")),n.createElement(t.MultiSelectDropdown,{options:S,optionsKey:"i18nKey",selected:f,onSelect:e=>{if(!v){const t=e.map(e=>e[1]);g(t)}},t:a,disabled:!p||v}),(null==f?void 0:f.length)>0&&n.createElement("div",{style:{marginTop:"8px",fontSize:"14px",color:"#666"}},n.createElement("strong",null,a("WT_LOCALITY_CODES"),":")," ",f.map(e=>e.code).join(", ")))),n.createElement("div",{className:"custom-modal-footer",style:{padding:"16px 24px",borderTop:"1px solid #eee",display:"flex",justifyContent:"flex-end",gap:"12px"}},n.createElement("button",{onClick:r,style:{padding:"8px 20px",border:"1px solid #ccc",background:"#f4f4f4",borderRadius:"4px",cursor:"pointer"}},a("CS_COMMON_CANCEL")),!v&&n.createElement("button",{onClick:()=>{d({hierarchyType:p,locality:f})},style:{padding:"8px 20px",background:"#1D4E7F",color:"#fff",border:"none",borderRadius:"4px",cursor:"pointer"}},a("CS_COMMON_SAVE")))))};delete s.Icon.Default.prototype._getIconUrl,s.Icon.Default.mergeOptions({iconRetinaUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",iconUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png"});const Le=new s.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-blue.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),Pe=new s.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12.5,41],popupAnchor:[1,-34],shadowSize:[41,41]}),Re=new s.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[35,57],iconAnchor:[17.5,57],popupAnchor:[1,-45],shadowSize:[50,50]}),ke=e=>{let{bounds:t,center:n,zoom:i}=e;const o=u.useMap();return l.useEffect(()=>{n?o.setView(n,i||15,{animate:!0}):t&&t.length>0&&o.fitBounds(t)},[t,n,i,o]),null},Me=e=>{var i;let{fillingPoints:a=[],fixedPoints:r=[],isLoading:d,t:s}=e;const c=o.useHistory(),[v,m]=l.useState(null),[p,E]=l.useState(null),[f,g]=l.useState(null),[_,h]=l.useState(null),[T,y]=l.useState(11),S=l.useRef({}),{isLoading:b,data:N}=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:Digit.ULBService.getCurrentTenantId(),filters:{fillingPointId:(I=v,(null==I?void 0:I.id)||(null==I?void 0:I.bookingId)||(null==I?void 0:I.fillingPointId)||(null==I?void 0:I.uuid)||(null==I||null===(D=I.fillingpointmetadata)||void 0===D?void 0:D.fillingPointId)),limit:1e3}},{enabled:!!v});var I,D;const C=l.useMemo(()=>v&&(null==N?void 0:N.waterTankerBookingDetail)||[],[v,N]),A=l.useMemo(()=>v?[v].filter(e=>{var t,l;return(null===(t=e.address)||void 0===t?void 0:t.latitude)&&(null===(l=e.address)||void 0===l?void 0:l.longitude)}):(null==a?void 0:a.filter(e=>{var t,l;return(null===(t=e.address)||void 0===t?void 0:t.latitude)&&(null===(l=e.address)||void 0===l?void 0:l.longitude)}))||[],[a,v]),x=l.useMemo(()=>C.filter(e=>{var t,l;return(null===(t=e.address)||void 0===t?void 0:t.latitude)&&(null===(l=e.address)||void 0===l?void 0:l.longitude)}),[C]);l.useEffect(()=>{if(f){const e=S.current[f];e&&e.openPopup()}else if(p){var e;const t=p.id||(null===(e=p.applicantDetail)||void 0===e?void 0:e.applicantId),l=S.current[t];l&&l.openPopup()}else Object.values(S.current).forEach(e=>{e&&e.isPopupOpen&&e.isPopupOpen()&&e.closePopup()})},[f,p]);const O=l.useMemo(()=>{const e=[...A.map(e=>[parseFloat(e.address.latitude),parseFloat(e.address.longitude)]),...x.map(e=>[parseFloat(e.address.latitude),parseFloat(e.address.longitude)])];return 0===e.length?null:e},[A,x]);return l.useMemo(()=>C.map(e=>{var t;return{...e,displayName:(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||(null==e?void 0:e.name)||"NA"}}),[C]),d||b?n.createElement(t.Loader,null):n.createElement("div",{style:{display:"flex",flexDirection:window.innerWidth<768?"column":"row",height:"700px",width:"100%",borderRadius:"12px",overflow:"hidden",border:"1px solid #ddd",marginTop:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.12)",background:"#fff"}},n.createElement("div",{style:{width:window.innerWidth<768?"100%":"320px",padding:"24px",borderRight:"1px solid #eee",display:"flex",flexDirection:"column",gap:"20px",background:"#f9f9f9",zIndex:10,overflowY:"auto"}},n.createElement("h3",{style:{margin:"0 0 8px 0",color:"#1D4E7F",fontSize:"20px",fontWeight:"600"}},s("WT_MAP_FILTERS")),n.createElement("div",{className:"filter-item"},n.createElement("label",{style:{display:"block",marginBottom:"8px",fontSize:"14px",fontWeight:"500",color:"#666"}},s("WT_FILLING_POINT")),n.createElement(t.Dropdown,{option:a,optionKey:"fillingPointName",selected:v,select:e=>{m(e),E(null),h(null)},t:s,placeholder:s("WT_SELECT_FILLING_POINT")})),v&&n.createElement("div",{className:"filter-item",style:{flex:1,display:"flex",flexDirection:"column"}},n.createElement("label",{style:{display:"block",marginBottom:"12px",fontSize:"14px",fontWeight:"600",color:"#1D4E7F"}},s("WT_MAPPED_FIXED_POINTS")," (",C.length,")"),n.createElement("div",{style:{maxHeight:"350px",overflowY:"auto",paddingRight:"8px",display:"flex",flexDirection:"column",gap:"8px"}},C.length>0?C.map((e,t)=>{var l,i,o,a,r,d,u,v,m,_,T,b,N,I,D;const C=(null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.fixedPointId)||(null==e?void 0:e.id)||(null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.applicantId)||t,A=(null==p||null===(o=p.applicantDetail)||void 0===o?void 0:o.fixedPointId)||(null==p?void 0:p.id)||(null==p||null===(a=p.applicantDetail)||void 0===a?void 0:a.applicantId),x=p&&C===A,O=e.id||(null===(r=e.applicantDetail)||void 0===r?void 0:r.applicantId)||t;return n.createElement("div",{key:t,onClick:()=>(e=>{var t,l,n,i;const o=(null==p||null===(t=p.applicantDetail)||void 0===t?void 0:t.fixedPointId)||(null==p?void 0:p.id)||(null==p||null===(l=p.applicantDetail)||void 0===l?void 0:l.applicantId),a=(null==e||null===(n=e.applicantDetail)||void 0===n?void 0:n.fixedPointId)||(null==e?void 0:e.id)||(null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.applicantId);if(p&&o===a){var r;E(null);const t=e.id||(null===(r=e.applicantDetail)||void 0===r?void 0:r.applicantId),l=S.current[t];l&&l.closePopup()}else{var d,u;E(e),null!=e&&null!==(d=e.address)&&void 0!==d&&d.latitude&&null!=e&&null!==(u=e.address)&&void 0!==u&&u.longitude&&(h([parseFloat(e.address.latitude),parseFloat(e.address.longitude)]),y(16))}})(e),onMouseEnter:()=>{var t,l;g(O),null!=e&&null!==(t=e.address)&&void 0!==t&&t.latitude&&null!=e&&null!==(l=e.address)&&void 0!==l&&l.longitude&&(h([parseFloat(e.address.latitude),parseFloat(e.address.longitude)]),y(16))},onMouseLeave:()=>g(null),style:{padding:"12px",background:x?"#E6EEF5":"#fff",border:x?"1.5px solid #1D4E7F":"1px solid #e0e0e0",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s ease",fontSize:"13px",color:x?"#1D4E7F":"#333",fontWeight:x?"600":"400",display:"flex",alignItems:"flex-start",gap:"10px",boxShadow:x?"0 2px 8px rgba(29, 78, 127, 0.15)":f===O?"0 4px 12px rgba(0,0,0,0.1)":"none",transform:f===O?"translateX(4px)":"none"}},n.createElement("div",{style:{width:"10px",height:"10px",borderRadius:"50%",background:"#417505",boxShadow:"0 0 4px rgba(65, 117, 5, 0.4)",marginTop:"5px",flexShrink:0}}),n.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement("span",{style:{fontWeight:"700"}},(null==e||null===(d=e.applicantDetail)||void 0===d?void 0:d.fixedPointId)||"NA"),n.createElement("span",{style:{fontSize:"11px",color:"#888",fontWeight:"400"}},(null==e||null===(u=e.applicantDetail)||void 0===u?void 0:u.name)||(null==e?void 0:e.name)||"NA")),n.createElement("div",{style:{color:"#1D4E7F",fontSize:"10px",paddingTop:"4px"}},x?"▲":"▼")),x&&n.createElement("div",{style:{marginTop:"8px",paddingTop:"8px",borderTop:"1px solid #eee",fontSize:"12px",color:"#555",display:"flex",flexDirection:"column",gap:"4px"}},n.createElement("div",null,n.createElement("strong",null,s("WT_MOBILE_NUMBER"),":")," ",(null==e||null===(v=e.applicantDetail)||void 0===v?void 0:v.mobileNumber)||"NA"),n.createElement("div",null,n.createElement("strong",null,s("WT_LOCALITY"),":")," ",(null==e||null===(m=e.address)||void 0===m?void 0:m.locality)||"NA"),n.createElement("div",null,n.createElement("strong",null,"Email:")," ",(null==e||null===(_=e.applicantDetail)||void 0===_?void 0:_.emailId)||"NA"),n.createElement("div",null,n.createElement("strong",null,"Alt Mobile:")," ",(null==e||null===(T=e.applicantDetail)||void 0===T?void 0:T.alternateNumber)||"NA"),n.createElement("div",null,n.createElement("strong",null,"Address:")," ",[null==e||null===(b=e.address)||void 0===b?void 0:b.houseNo,null==e||null===(N=e.address)||void 0===N?void 0:N.streetName,null==e||null===(I=e.address)||void 0===I?void 0:I.city,null==e||null===(D=e.address)||void 0===D?void 0:D.pincode].filter(Boolean).join(", ")||"NA"),n.createElement("button",{onClick:t=>{var l;t.stopPropagation();const n=(null==e?void 0:e.id)||(null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.applicantId);c.push("/digit-ui/employee/wt/add-fix-point-address?id="+n)},style:{marginTop:"8px",padding:"6px 12px",background:"#F47738",color:"#fff",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"bold",alignSelf:"flex-start",transition:"background 0.2s"},onMouseEnter:e=>e.target.style.background="#D6662E",onMouseLeave:e=>e.target.style.background="#F47738"},"Edit Fixed Point"))))}):n.createElement("div",{style:{textAlign:"center",padding:"20px",color:"#999",fontSize:"13px",border:"1px dashed #ccc",borderRadius:"8px"}},s("WT_NO_MAPPED_POINTS")))),n.createElement("button",{onClick:()=>{m(null),E(null),h(null),y(11)},style:{marginTop:"auto",padding:"12px",background:"#fff",border:"1px solid #1D4E7F",color:"#1D4E7F",borderRadius:"6px",cursor:"pointer",fontWeight:"600",transition:"all 0.2s"},onMouseOver:e=>{e.target.style.background="#1D4E7F",e.target.style.color="#fff"},onMouseOut:e=>{e.target.style.background="#fff",e.target.style.color="#1D4E7F"}},s("ES_COMMON_CLEAR_ALL")),v&&n.createElement("div",{style:{marginTop:"20px",padding:"16px",background:"#fff",borderRadius:"8px",border:"1px solid #e0e0e0"}},n.createElement("h4",{style:{margin:"0 0 12px 0",fontSize:"14px",color:"#333",borderBottom:"1px solid #f0f0f0",paddingBottom:"8px"}},s("WT_SUMMARY")),n.createElement("div",{style:{fontSize:"13px",display:"flex",flexDirection:"column",gap:"8px"}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},n.createElement("span",{style:{color:"#777"}},s("WT_FIXED_POINTS"),":"),n.createElement("span",{style:{fontWeight:"600"}},C.length)),n.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},n.createElement("span",{style:{color:"#777"}},s("WT_LOCALITY"),":"),n.createElement("span",{style:{fontWeight:"600"}},(null===(i=v.address)||void 0===i?void 0:i.locality)||"NA"))))),n.createElement("div",{style:{flex:1,position:"relative"}},n.createElement(u.MapContainer,{center:[28.6139,77.209],zoom:11,style:{height:"100%",width:"100%"},scrollWheelZoom:!0},n.createElement(u.TileLayer,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),n.createElement(ke,{bounds:O,center:_,zoom:T}),A.map((e,t)=>{var l,i,o;return n.createElement(n.Fragment,{key:"fp-group-"+(e.id||t)},n.createElement(u.Circle,{center:[parseFloat(e.address.latitude),parseFloat(e.address.longitude)],radius:5e3,pathOptions:{color:"#0d2745ff",fillColor:"#041a34ff",fillOpacity:.1,weight:1,dashArray:"5, 5"}}),n.createElement(u.Marker,{key:"fp-"+(e.id||t),position:[parseFloat(e.address.latitude),parseFloat(e.address.longitude)],icon:Le,eventHandlers:{mouseover:e=>e.target.openPopup(),mouseout:e=>e.target.closePopup()}},n.createElement(u.Popup,null,n.createElement("div",{style:{padding:"8px",minWidth:"200px"}},n.createElement("h4",{style:{margin:"0 0 8px 0",color:"#1F5FA8",fontSize:"16px",borderBottom:"1px solid #eee",paddingBottom:"4px"}},e.fillingPointName," (Filling Point)"),n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px"}},n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_FILLING_POINT_CODE"),":")," ",e.fillingPointId),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_LOCALITY"),":")," ",(null===(l=e.address)||void 0===l?void 0:l.locality)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_AE_NAME"),":")," ",(null==e?void 0:e.aeName)||"NA"," (",(null==e?void 0:e.aeMobile)||"NA",")"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_JE_NAME"),":")," ",(null==e?void 0:e.jeName)||"NA"," (",(null==e?void 0:e.jeMobile)||"NA",")"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_EE_NAME"),":")," ",(null==e?void 0:e.eeName)||"NA"," (",(null==e?void 0:e.eeMobile)||"NA",")"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,"Latitude:")," ",(null===(i=e.address)||void 0===i?void 0:i.latitude)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,"Longitude:")," ",(null===(o=e.address)||void 0===o?void 0:o.longitude)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px",color:"#1F5FA8"}},n.createElement("strong",null,"Coverage:")," 5 KM Radius"))))))}),x.map((e,t)=>{var l,i,o,a,r,d,c,v,m,E,_,h,T,y,b,N,I;const D=e.id||(null===(l=e.applicantDetail)||void 0===l?void 0:l.applicantId)||t,C=f===D,A=(null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.fixedPointId)||(null==e?void 0:e.id)||(null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.applicantId)||t,x=(null==p||null===(a=p.applicantDetail)||void 0===a?void 0:a.fixedPointId)||(null==p?void 0:p.id)||(null==p||null===(r=p.applicantDetail)||void 0===r?void 0:r.applicantId),O=p&&A===x;return n.createElement(u.Marker,{key:"fx-"+D,position:[parseFloat(e.address.latitude),parseFloat(e.address.longitude)],icon:C||O?Re:Pe,zIndexOffset:C||O?1e3:0,ref:e=>S.current[D]=e,eventHandlers:{mouseover:()=>{g(D)},mouseout:()=>{g(null)}}},n.createElement(u.Popup,null,n.createElement("div",{style:{padding:"8px",minWidth:"200px"}},n.createElement("h4",{style:{margin:"0 0 8px 0",color:"#417505",fontSize:"16px",borderBottom:"1px solid #eee",paddingBottom:"4px"}},(null==e||null===(d=e.applicantDetail)||void 0===d?void 0:d.name)||(null==e?void 0:e.name)||"NA"," (Fixed Point)"),n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px"}},n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_FIXED_POINT_CODE"),":")," ",(null==e||null===(c=e.applicantDetail)||void 0===c?void 0:c.fixedPointId)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_MOBILE_NUMBER"),":")," ",(null==e||null===(v=e.applicantDetail)||void 0===v?void 0:v.mobileNumber)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_LOCALITY"),":")," ",(null==e||null===(m=e.address)||void 0===m?void 0:m.locality)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,"Email:")," ",(null==e||null===(E=e.applicantDetail)||void 0===E?void 0:E.emailId)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,"Alt Mobile:")," ",(null==e||null===(_=e.applicantDetail)||void 0===_?void 0:_.alternateNumber)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,"Address:")," ",[null==e||null===(h=e.address)||void 0===h?void 0:h.houseNo,null==e||null===(T=e.address)||void 0===T?void 0:T.streetName,null==e||null===(y=e.address)||void 0===y?void 0:y.city,null==e||null===(b=e.address)||void 0===b?void 0:b.pincode].filter(Boolean).join(", ")||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,"Latitude:")," ",(null==e||null===(N=e.address)||void 0===N?void 0:N.latitude)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,"Longitude:")," ",(null==e||null===(I=e.address)||void 0===I?void 0:I.longitude)||"NA")))))}))))},Fe=()=>{const{t:e}=i.useTranslation(),a=o.useHistory(),r=o.useLocation(),d=new URLSearchParams(r.search).get("tab")||"FILLING_POINT",[u,s]=l.useState(d),[c,v]=l.useState(!1),[m,p]=l.useState(""),[E,f]=l.useState(""),[g,_]=l.useState(null),[h,T]=l.useState(null),[y,S]=l.useState(null),[N,I]=l.useState({}),[D,C]=l.useState(null),[A,x]=l.useState(null),[O,w]=l.useState(!1),[L,P]=l.useState(null),[R,k]=l.useState("ADD"),[M,F]=l.useState(50),[B,W]=l.useState(0),[U,H]=l.useState({}),[j,z]=l.useState({}),K=Digit.ULBService.getCurrentTenantId(),G=()=>{x(null)},{isLoading:Y,data:q,refetch:$}=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:K,filters:{...N,offset:B,limit:M}},{enabled:"FIXED_POINT"===u}),{isLoading:X,data:Q,refetch:Z}=Digit.Hooks.wt.useFillPointSearch({tenantId:K,filters:{...N,offset:B,limit:M}},{enabled:"FILLING_POINT"===u}),{isLoading:J,data:ee}=Digit.Hooks.wt.useFillPointSearch({tenantId:K,filters:{limit:1e3}},{enabled:!0}),te=(null==ee?void 0:ee.fillingPoints)||[],{isLoading:le,data:ne}=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:K,filters:{limit:1e3}},{enabled:!0}),ie=(null==ne?void 0:ne.waterTankerBookingDetail)||[],{mutate:oe}=Digit.Hooks.wt.useVendorFillingMapping(K),{mutate:ae}=Digit.Hooks.wt.useUpdateFillPoint(K),re="FIXED_POINT"===u?Y:X,de=n.useMemo(()=>{let e=("FIXED_POINT"===u?null==q?void 0:q.waterTankerBookingDetail:null==Q?void 0:Q.fillingPoints)||[];return"FIXED_POINT"===u&&null!=y&&y.code&&(e=e.filter(e=>{var t,l,n,i;const o=e.fillingPointId||(null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||e.fillingPtName||e.filling_pt_name||(e.fillingPoint&&"object"==typeof e.fillingPoint?null===(l=e.fillingPoint)||void 0===l?void 0:l.id:e.fillingPoint)||(null===(n=e.fillingPointDetail)||void 0===n?void 0:n.id)||(null===(i=e.fillingPointDetail)||void 0===i?void 0:i.bookingId);return"MAPPED"===y.code?!!o:"UNMAPPED"!==y.code||!o})),e},[q,Q,u,y]),{label:ue,placeholder:se}={FIXED_POINT:{label:"WT_FIXING_POINT_APPLICANT_DETAILS",placeholder:"WT_ENTER_FIXED_POINT_NAME"},FILLING_POINT:{label:"WT_FILLING_POINT_NAME",placeholder:"WT_ENTER_FILLING_POINT_NAME"},VIEW_ON_MAP:{label:"WT_VIEW_ON_MAP",placeholder:""}}[u],ce=()=>{p(""),f(""),_(null),T(null),S(null),C(null),I({})},ve=e=>{s(e),ce(),W(0),I({})},me=e=>(null==e?void 0:e.id)||(null==e?void 0:e.bookingId)||(null==e?void 0:e.fillingPointId)||(null==e?void 0:e.uuid),pe=e=>{const t=me(e);return t&&Object.prototype.hasOwnProperty.call(U,t)?U[t]:!0===(null==e?void 0:e.status)||"true"===(null==e?void 0:e.status)||"ACTIVE"===(null==e?void 0:e.status)},Ee=function(e,t){void 0===t&&(t="ADD"),P(e.original),k(t),w(!0)},{mutate:fe}=Digit.Hooks.wt.useLinkFillingPointLocality(K),{mutate:ge}=Digit.Hooks.wt.useUpdateFillingPointLocality(K),_e=(e,t,l)=>e?l(`${(t||Digit.ULBService.getCurrentTenantId()||"djb").replace(".","_").toUpperCase()}_REVENUE_${e}`):"",he=n.useMemo(()=>"FIXED_POINT"===u?[{Header:e("WT_FIXED_POINT_CODE"),accessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.fixedPointId)||"NA"},id:"fixedPointId"},{Header:e("WT_FIXING_POINT_APPLICANT_DETAILS"),accessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||"NA"},id:"applicantName",Cell:e=>{var t,l;let{row:i}=e;return n.createElement("span",{className:"link"},n.createElement(o.Link,{to:"/digit-ui/employee/wt/add-fix-point-address?id="+(null===(t=i.original.applicantDetail)||void 0===t?void 0:t.applicantId)},(null===(l=i.original.applicantDetail)||void 0===l?void 0:l.name)||"NA"))}},{Header:e("WT_MOBILE_NUMBER"),accessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.mobileNumber)||"NA"},id:"mobileNumber"},{Header:e("WT_LOCALITY"),accessor:t=>{var l;return _e(null==t||null===(l=t.address)||void 0===l?void 0:l.locality,K,e)||"NA"},id:"locality"},{Header:e("WT_LATITUDE"),accessor:e=>{var t;return(null==e||null===(t=e.address)||void 0===t?void 0:t.latitude)||"NA"},id:"latitude"},{Header:e("WT_LONGITUDE"),accessor:e=>{var t;return(null==e||null===(t=e.address)||void 0===t?void 0:t.longitude)||"NA"},id:"longitude"},{Header:e("WT_FILLING_POINT"),accessor:e=>{var t;return(null==e?void 0:e.fillingPointId)||(null==e||null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||(null==e?void 0:e.fillingPtName)||(null==e?void 0:e.filling_pt_name)||(null==e?void 0:e.fillingPoint)||"NA"},id:"fillingPoint",minWidth:250,Cell:l=>{var i,o,a,r;let{row:d}=l;const u=String(d.original.fillingPointId||(null===(i=d.original.fillingpointmetadata)||void 0===i?void 0:i.fillingPointId)||d.original.fillingPtName||d.original.filling_pt_name||(d.original.fillingPoint&&"object"==typeof d.original.fillingPoint?null===(o=d.original.fillingPoint)||void 0===o?void 0:o.id:d.original.fillingPoint)||(null===(a=d.original.fillingPointDetail)||void 0===a?void 0:a.id)||(null===(r=d.original.fillingPointDetail)||void 0===r?void 0:r.bookingId)||""),s=null==te?void 0:te.find(e=>{var t;return String(e.id||e.bookingId||e.fillingPointId||e.uuid||(null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId))===u&&"undefined"!==u&&"null"!==u&&""!==u});return n.createElement(t.Dropdown,{className:"fsm-registry-dropdown",selected:s,option:te,select:t=>((t,l)=>{var n,i;const o={fixedFillingPointMapping:{fixed_pt_name:null===(n=t.original.applicantDetail)||void 0===n?void 0:n.applicantId,filling_pt_name:l.id||l.bookingId||l.fillingPointId||l.uuid||(null===(i=l.fillingpointmetadata)||void 0===i?void 0:i.fillingPointId)}};oe(o,{onSuccess:()=>{x({label:e("WT_FIXED_FILLING_MAPPING_SUCCESS")}),setTimeout(G,5e3),$()},onError:t=>{var l,n,i,o;x({label:(null==t||null===(l=t.response)||void 0===l||null===(n=l.data)||void 0===n||null===(i=n.Errors)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||e("WT_FIXED_FILLING_MAPPING_FAIL"),error:!0}),setTimeout(G,5e3)}})})(d,t),style:{textAlign:"left",width:"100%",minWidth:"250px"},optionKey:"fillingPointName",t:e})}}]:[{Header:e("WT_FILLING_POINT_CODE"),accessor:e=>(null==e?void 0:e.fillingPointId)||"NA",id:"fillingPointId"},{Header:e("WT_FILLING_POINT_NAME"),accessor:e=>(null==e?void 0:e.fillingPointName)||"NA",id:"fillingPointName",Cell:e=>{let{row:t}=e;return n.createElement("span",{className:"link"},n.createElement(o.Link,{to:"/digit-ui/employee/wt/add-filling-point-address?id="+t.original.id},t.original.fillingPointName||"NA"))}},{Header:e("WT_AE_NAME"),accessor:e=>(null==e?void 0:e.aeName)||"NA",id:"aeName"},{Header:e("WT_JE_NAME"),accessor:e=>(null==e?void 0:e.jeName)||"NA",id:"jeName"},{Header:e("WT_EE_NAME"),accessor:e=>(null==e?void 0:e.eeName)||"NA",id:"eeName"},{Header:e("WT_LOCALITY"),Cell:t=>{var l,i,o,a;let{row:r}=t;const d=(null===(l=r.original)||void 0===l||null===(i=l.fillingPointLocalityCodes)||void 0===i?void 0:i.length)>0?r.original.fillingPointLocalityCodes:null!==(o=r.original)&&void 0!==o&&null!==(a=o.address)&&void 0!==a&&a.locality?[r.original.address.locality]:[],u=d.length>0?d.map(t=>_e(t,K,e)).join(", "):"NA";return n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},n.createElement("span",null,u))}},{Header:e("WT_ADD_LOCALITY"),Cell:l=>{var i,o,a,r,d,u;let{row:s}=l;const c=(null===(i=s.original)||void 0===i||null===(o=i.fillingPointLocalityCodes)||void 0===o?void 0:o.length)>0||(null===(a=s.original)||void 0===a||null===(r=a.address)||void 0===r?void 0:r.locality)&&"NA"!==(null===(d=s.original)||void 0===d||null===(u=d.address)||void 0===u?void 0:u.locality);return n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},c?n.createElement(n.Fragment,null,n.createElement("button",{onClick:()=>Ee(s,"VIEW"),style:{cursor:"pointer",background:"#fff",border:"1px solid #1D4E7F",color:"#1D4E7F",borderRadius:"4px",padding:"4px 12px"}},e("CS_COMMON_VIEW")),n.createElement("button",{onClick:()=>Ee(s,"UPDATE"),style:{cursor:"pointer",background:"#1D4E7F",color:"#fff",border:"none",borderRadius:"4px",padding:"4px 12px"}},e("CS_COMMON_UPDATE"))):n.createElement("button",{onClick:()=>Ee(s,"ADD"),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"4px",background:"#f4f4f4",border:"1px solid #ddd",borderRadius:"4px",padding:"4px 8px"}},n.createElement(t.AddIcon,{styles:{width:"16px",height:"16px"},fill:"#1D4E7F"}),e("CS_COMMON_ADD")))}},{Header:e("WT_ENABLE_DISABLE","Enable/Disable"),id:"status",disableSortBy:!0,Cell:l=>{let{row:i}=l;const o=me(i.original),a=o&&j[o];return n.createElement(t.ToggleSwitch,{style:{display:"flex",justifyContent:"left",opacity:a?.6:1,pointerEvents:a?"none":"auto"},value:pe(i.original),onChange:()=>(t=>{const l=t.original,n=me(l),i=!pe(l);n&&!j[n]&&(H(e=>({...e,[n]:i})),z(e=>({...e,[n]:!0})),ae(((e,t)=>{var l,n;return{RequestInfo:{userInfo:{uuid:(null===(l=Digit.UserService.getUser())||void 0===l||null===(n=l.info)||void 0===n?void 0:n.uuid)||"user-123"}},fillingPoints:[{id:null==e?void 0:e.id,bookingId:null==e?void 0:e.bookingId,fillingPointId:null==e?void 0:e.fillingPointId,tenantId:(null==e?void 0:e.tenantId)||K,fillingPointName:null==e?void 0:e.fillingPointName,emergencyName:null==e?void 0:e.emergencyName,eeName:null==e?void 0:e.eeName,eeEmail:null==e?void 0:e.eeEmail,eeMobile:null==e?void 0:e.eeMobile,aeName:null==e?void 0:e.aeName,aeEmail:null==e?void 0:e.aeEmail,aeMobile:null==e?void 0:e.aeMobile,jeName:null==e?void 0:e.jeName,jeEmail:null==e?void 0:e.jeEmail,jeMobile:null==e?void 0:e.jeMobile,fillingPointLocalityCodes:null==e?void 0:e.fillingPointLocalityCodes,status:t,address:null!=e&&e.address?{addressId:e.address.addressId,applicantId:e.address.applicantId,doorNo:e.address.doorNo,houseNo:e.address.houseNo,streetName:e.address.streetName,addressLine1:e.address.addressLine1,addressLine2:e.address.addressLine2,landmark:e.address.landmark,city:e.address.city,cityCode:e.address.cityCode,locality:e.address.locality,localityCode:e.address.localityCode,pincode:e.address.pincode,latitude:e.address.latitude,longitude:e.address.longitude,ward:e.address.ward,zone:e.address.zone,constituency:e.address.constituency,type:e.address.type||"FILLING-POINT",addressType:e.address.addressType}:void 0}]}})(l,i),{onSuccess:()=>{x({label:e(i?"WT_FILLING_POINT_ENABLED_SUCCESS":"WT_FILLING_POINT_DISABLED_SUCCESS",i?"Filling point enabled successfully":"Filling point disabled successfully")}),setTimeout(G,5e3),Z()},onError:t=>{var l,o,a,r;H(e=>({...e,[n]:!i})),x({label:(null==t||null===(l=t.response)||void 0===l||null===(o=l.data)||void 0===o||null===(a=o.Errors)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.message)||e("WT_FILLING_POINT_STATUS_UPDATE_ERROR","Unable to update filling point status"),error:!0}),setTimeout(G,5e3)},onSettled:()=>{z(e=>({...e,[n]:!1}))}}))})(i),name:"filling-point-status-"+(o||i.id)})}}],[te,U,u,e,j]),Te=window.Digit.Utils.browser.isMobile(),ye=Number("FIXED_POINT"===u?(null==q?void 0:q.Count)??(null==q?void 0:q.count)??(null==q?void 0:q.totalCount)??0:(null==Q?void 0:Q.Count)??(null==Q?void 0:Q.count)??(null==Q?void 0:Q.totalCount)??0),Se=n.useCallback(function(e){return void 0===e&&(e=[]),"FIXED_POINT"===u&&null!=y&&y.code?e.filter(e=>{var t,l,n,i;const o=e.fillingPointId||(null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||e.fillingPtName||e.filling_pt_name||(e.fillingPoint&&"object"==typeof e.fillingPoint?null===(l=e.fillingPoint)||void 0===l?void 0:l.id:e.fillingPoint)||(null===(n=e.fillingPointDetail)||void 0===n?void 0:n.id)||(null===(i=e.fillingPointDetail)||void 0===i?void 0:i.bookingId);return"MAPPED"===y.code?!!o:"UNMAPPED"!==y.code||!o}):e},[y,u]),be=n.useCallback(function(){try{let t=!1;function e(){return Se(o)}const l=200;let n=0,i=Number.POSITIVE_INFINITY;const o=[],a=b(function(){return!t&&n<i},void 0,function(){return Promise.resolve("FIXED_POINT"===u?Digit.WTService.SearchFixedPoint({tenantId:K,filters:{...N,offset:n,limit:l}}):Digit.WTService.SearchFillPoint({tenantId:K,filters:{...N,offset:n,limit:l}})).then(function(e){const l="FIXED_POINT"===u?(null==e?void 0:e.waterTankerBookingDetail)||[]:(null==e?void 0:e.fillingPoints)||[];o.push(...l);const a=Number((null==e?void 0:e.Count)??(null==e?void 0:e.count)??(null==e?void 0:e.totalCount));i=Number.isFinite(a)&&a>=0?a:o.length,l.length?n+=l.length:t=!0})});return Promise.resolve(a&&a.then?a.then(e):e())}catch(e){return Promise.reject(e)}},[Se,N,u,K]),Ne=n.useMemo(()=>"FIXED_POINT"===u?[{Header:e("WT_FIXED_POINT_CODE"),exportAccessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.fixedPointId)||"NA"}},{Header:e("WT_APPLICANT_NAME"),exportAccessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||"NA"}},{Header:e("WT_MOBILE_NUMBER"),exportAccessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.mobileNumber)||"NA"}},{Header:e("WT_LOCALITY"),exportAccessor:t=>{var l;return _e(null==t||null===(l=t.address)||void 0===l?void 0:l.locality,K,e)||"NA"}},{Header:e("WT_LATITUDE"),exportAccessor:e=>{var t;return(null==e||null===(t=e.address)||void 0===t?void 0:t.latitude)||"NA"}},{Header:e("WT_LONGITUDE"),exportAccessor:e=>{var t;return(null==e||null===(t=e.address)||void 0===t?void 0:t.longitude)||"NA"}},{Header:e("WT_FILLING_POINT"),exportAccessor:e=>{var t,l,n,i,o,a;const r=String((null==e?void 0:e.fillingPointId)||(null==e||null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||(null==e?void 0:e.fillingPtName)||(null==e?void 0:e.filling_pt_name)||(null!=e&&e.fillingPoint&&"object"==typeof e.fillingPoint?null===(l=e.fillingPoint)||void 0===l?void 0:l.id:null==e?void 0:e.fillingPoint)||(null==e||null===(n=e.fillingPointDetail)||void 0===n?void 0:n.id)||(null==e||null===(i=e.fillingPointDetail)||void 0===i?void 0:i.bookingId)||""),d=null==te?void 0:te.find(e=>{var t;return String(e.id||e.bookingId||e.fillingPointId||e.uuid||(null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId))===r&&"undefined"!==r&&"null"!==r&&""!==r}),u=(null==d?void 0:d.fillingPointName)||(null==e?void 0:e.fillingPointName)||(null==e||null===(o=e.fillingPoint)||void 0===o?void 0:o.fillingPointName)||(null==e||null===(a=e.fillingpointmetadata)||void 0===a?void 0:a.fillingPointName)||(null==e?void 0:e.fillingPtName)||(null==e?void 0:e.filling_pt_name);return u&&"undefined"!==u&&"null"!==u?u:r&&"undefined"!==r&&"null"!==r?r:"NA"}}]:[{Header:e("WT_FILLING_POINT_CODE"),exportAccessor:e=>(null==e?void 0:e.fillingPointId)||"NA"},{Header:e("WT_FILLING_POINT_NAME"),exportAccessor:e=>(null==e?void 0:e.fillingPointName)||"NA"},{Header:e("WT_AE_NAME"),exportAccessor:e=>(null==e?void 0:e.aeName)||"NA"},{Header:e("WT_AE_MOBILE"),exportAccessor:e=>(null==e?void 0:e.aeMobile)||"NA"},{Header:e("WT_AE_EMAIL"),exportAccessor:e=>(null==e?void 0:e.aeEmail)||"NA"},{Header:e("WT_JE_NAME"),exportAccessor:e=>(null==e?void 0:e.jeName)||"NA"},{Header:e("WT_JE_MOBILE"),exportAccessor:e=>(null==e?void 0:e.jeMobile)||"NA"},{Header:e("WT_JE_EMAIL"),exportAccessor:e=>(null==e?void 0:e.jeEmail)||"NA"},{Header:e("WT_EE_NAME"),exportAccessor:e=>(null==e?void 0:e.eeName)||"NA"},{Header:e("WT_EE_MOBILE"),exportAccessor:e=>(null==e?void 0:e.eeMobile)||"NA"},{Header:e("WT_EE_EMAIL"),exportAccessor:e=>(null==e?void 0:e.eeEmail)||"NA"},{Header:e("WT_LOCALITY"),exportAccessor:t=>{var l,n;const i=(null==t||null===(l=t.fillingPointLocalityCodes)||void 0===l?void 0:l.length)>0?t.fillingPointLocalityCodes:null!=t&&null!==(n=t.address)&&void 0!==n&&n.locality?[t.address.locality]:[];return i.length>0?i.map(t=>_e(t,K,e)).join(", "):"NA"}}],[u,e]);return n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement("div",{className:"search-tabs-container",style:{flexDirection:Te?"column":"row",gap:Te?"16px":"0"}},n.createElement("div",null,n.createElement("button",{className:"FILLING_POINT"===u?"search-tab-head-selected":"search-tab-head",onClick:()=>ve("FILLING_POINT"),style:{width:Te?"50%":"auto"}},e("WT_FILLING_POINT")),n.createElement("button",{className:"FIXED_POINT"===u?"search-tab-head-selected":"search-tab-head",onClick:()=>ve("FIXED_POINT"),style:{width:Te?"50%":"auto"}},e("WT_FIXED_POINT")),n.createElement("button",{className:"VIEW_ON_MAP"===u?"search-tab-head-selected":"search-tab-head",onClick:()=>ve("VIEW_ON_MAP"),style:{width:Te?"50%":"auto"}},e("WT_VIEW_ON_MAP"))),n.createElement("div",{className:"action-bar-wrap-registry",style:{alignSelf:Te?"flex-end":"auto"}},n.createElement("div",{className:"search-add",onClick:()=>{v(e=>!e)}},e("ES_VENDOR_REGISTRY_INBOX_HEADER_ADD"),n.createElement("div",{className:"search-add-icon"},n.createElement(t.AddIcon,null))),c&&n.createElement(t.Menu,{localeKeyPrefix:"ES_FSM_ACTION_CREATE",options:["FIXED_POINT","FILLING_POINT"],t:e,onSelect:e=>{"FILLING_POINT"===e?a.push("/digit-ui/employee/wt/add-filling-point-address"):"FIXED_POINT"===e&&a.push("/digit-ui/employee/wt/add-fix-point-address"),v(!1)}}))),"VIEW_ON_MAP"!==u&&n.createElement("div",{className:"finance-mainlayout"},n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null,e(ue)),n.createElement(t.TextInput,{value:m,onChange:e=>p(e.target.value),placeholder:e(se)})),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null,e("WT_MOBILE_NUMBER")),n.createElement(t.TextInput,{value:E,onChange:e=>f(e.target.value.replace(/\D/g,"").slice(0,10)),placeholder:e("WT_ENTER_MOBILE_NUMBER"),validation:{pattern:/^[6-9]\d{9}$/}})),"FIXED_POINT"===u&&n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null,e("WT_FIXED_POINT_STATUS")),n.createElement(t.Dropdown,{option:[{i18nKey:"WT_FIXED_POINT_MAPPED",code:"MAPPED"},{i18nKey:"WT_FIXED_POINT_UNMAPPED",code:"UNMAPPED"}],optionKey:"i18nKey",selected:h,select:T,t:e})),"FIXED_POINT"===u&&n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null,e("WT_FILLING_POINT")),n.createElement(t.Dropdown,{option:te,optionKey:"fillingPointName",selected:D,select:C,t:e,placeholder:e("ES_COMMON_STATUS")})),"FILLING_POINT"===u&&n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null,e("WT_FILLING_POINT_DESIGNATION")),n.createElement(t.Dropdown,{option:[{i18nKey:"WT_FILLING_POINT_DESIGNATION_AE",code:"DESIGNATION_AE"},{i18nKey:"WT_FILLING_POINT_DESIGNATION_JE",code:"DESIGNATION_JE"},{i18nKey:"WT_FILLING_POINT_DESIGNATION_EE",code:"DESIGNATION_EE"}],optionKey:"i18nKey",selected:g,select:_,t:e,placeholder:e("ES_COMMON_STATUS")})),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null," "),n.createElement("span",{className:"generic-button clear-search",onClick:ce,style:{alignSelf:"center"}},e("ES_COMMON_CLEAR_SEARCH"))),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null," "),n.createElement(t.SubmitBar,{label:e("ES_COMMON_SEARCH"),onSubmit:()=>{const e={..."FILLING_POINT"===u?{fillingPointName:m}:{name:m},mobileNumber:E,status:"FILLING_POINT"===u?null==g?void 0:g.code:null,fillingPointId:(null==D?void 0:D.id)||(null==D?void 0:D.bookingId)||(null==D?void 0:D.fillingPointId)||(null==D?void 0:D.uuid)};S(h),I(e),W(0)}})))),n.createElement(t.Card,null,"VIEW_ON_MAP"===u?n.createElement(Me,{fillingPoints:te,fixedPoints:ie,isLoading:J||le,t:e}):n.createElement(V,{key:(null==te?void 0:te.length)>0?"loaded":"loading",data:de,columns:he,pageSize:M,getCellProps:()=>({style:{padding:"20px 18px",fontSize:"16px",whiteSpace:"normal",wordBreak:"break-word",overflowWrap:"anywhere"}}),styles:{width:"1200px",minWidth:"1200px",tableLayout:"fixed"},inboxStyles:{overflowX:"auto"},t:e,isLoading:re||J,onPageSizeChange:e=>{F(Number(e.target.value))},currentPage:Math.floor(B/M),onNextPage:()=>{W(e=>e+M)},onPrevPage:()=>{W(e=>e-M)},pageSizeLimit:M,totalRecords:ye,isPaginationRequired:!0,showPagination:!0,showPageSizeOptions:!0,isSearchRequired:!1,isDownloadRequired:!0,isFilterRequired:!0,isSortRequired:!0,showCSVExport:!0,getCSVExportData:be,csvExportColumns:Ne,csvExportFileName:`wt-${"FIXED_POINT"===u?"fixed-point":"filling-point"}-search`})),A&&n.createElement(t.Toast,{error:A.error,label:A.label,onClose:G}),O&&n.createElement(we,{t:e,closeModal:()=>w(!1),onSubmit:t=>{const l={FillingPointLocality:t.locality.filter(e=>e.code).map(e=>({fillingPointId:L.bookingId||L.id,localityCode:e.code}))};("UPDATE"===R?ge:fe)(l,{onSuccess:()=>{x({label:e("UPDATE"===R?"WT_LOCALITY_UPDATE_SUCCESS":"WT_LOCALITY_LINKING_SUCCESS")}),w(!1),setTimeout(G,5e3),"FIXED_POINT"===u?$():Z()},onError:t=>{var l,n,i,o;x({label:(null==t||null===(l=t.response)||void 0===l||null===(n=l.data)||void 0===n||null===(i=n.Errors)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||e("WT_LOCALITY_LINKING_FAIL"),error:!0}),setTimeout(G,5e3)}})},initialValues:L,tenantId:K,modalMode:R}))},Be=e=>{let{options:o,optionsKey:a,selected:r=[],onSelect:d,defaultLabel:u="",defaultUnit:s="",BlockNumber:c=1,isOBPSMultiple:v=!1,props:m={},isPropsNeeded:p=!1,ServerStyle:E={},isSurvey:f=!1,disable:g=!1}=e;const[_,h]=l.useState(!1),[T,y]=l.useState(),[S,b]=l.useState(-1),N=l.useRef(),{t:I}=i.useTranslation();function D(e){return null==e?void 0:e.map(e=>({[a]:null==e?void 0:e[a],propsData:[null,e]}))}l.useEffect(()=>{A({type:"REPLACE_COMPLETE_STATE",payload:D(r)})},[null==r?void 0:r.map(e=>null==e?void 0:e[a]).join(",")]);const[C,A]=l.useReducer(function(e,t){var l,n;switch(t.type){case"ADD_TO_SELECTED_EVENT_QUEUE":return[...e,{[a]:null===(l=t.payload)||void 0===l||null===(n=l[1])||void 0===n?void 0:n[a],propsData:t.payload}];case"REMOVE_FROM_SELECTED_EVENT_QUEUE":return e.filter(e=>{var l,n;return(null==e?void 0:e[a])!==(null===(l=t.payload)||void 0===l||null===(n=l[1])||void 0===n?void 0:n[a])});case"REPLACE_COMPLETE_STATE":return t.payload;default:return e}},r,D);Digit.Hooks.useClickOutside(N,function(){h(!1)},_,{capture:!0});const x=(null==T?void 0:T.length)>0?o.filter(e=>I(e[a]&&"string"==typeof e[a]&&e[a].toUpperCase()).toLowerCase().indexOf(T.toLowerCase())>=0):o;function O(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];const n=t[0].target.checked,i=t[1];if(n){A({type:"ADD_TO_SELECTED_EVENT_QUEUE",payload:[...t]});const e=[...C,{[a]:i[a],propsData:t}];d(e.map(e=>e.propsData),m)}else{A({type:"REMOVE_FROM_SELECTED_EVENT_QUEUE",payload:[...t]});const e=C.filter(e=>(null==e?void 0:e[a])!==i[a]);d(e.map(e=>e.propsData),m)}}const w=e=>{let{option:l,index:i}=e;return n.createElement("div",{key:i,style:v&&i%2!=0?{background:"#EEEEEE"}:{}},n.createElement("input",{type:"checkbox",value:l[a],checked:!!C.find(e=>e[a]===l[a]),onChange:e=>p?O(e,l,m):v?O(e,l,c):O(e,l),style:{minWidth:"24px",width:"100%"}}),n.createElement("div",{className:"custom-checkbox"},n.createElement(t.CheckSvg,{style:{innerWidth:"24px",width:"24px"}})),n.createElement("p",{className:"label",style:i===S?{opacity:1,backgroundColor:"rgba(238, 238, 238, var(--bg-opacity))"}:{}},I(l[a]&&"string"==typeof l[a]&&l[a])))},L=()=>{const e=(null==T?void 0:T.length)>0?o.filter(e=>I(e[a]&&"string"==typeof e[a]&&e[a].toUpperCase()).toLowerCase().indexOf(T.toLowerCase())>=0):o,l=(null==e?void 0:e.length)>0&&(null==e?void 0:e.every(e=>C.find(t=>t[a]===e[a])));return n.createElement(n.Fragment,null,(null==e?void 0:e.length)>0&&n.createElement("div",{key:"select-all",style:{borderBottom:"1px solid #eee",display:"flex",alignItems:"center"}},n.createElement("input",{type:"checkbox",checked:l,onChange:t=>{if(t.target.checked){const t=e.map(e=>({[a]:e[a],propsData:[null,e]}));A({type:"REPLACE_COMPLETE_STATE",payload:t}),d(t.map(e=>e.propsData))}else A({type:"REPLACE_COMPLETE_STATE",payload:[]}),d([])},style:{minWidth:"24px"}}),n.createElement("div",{className:"custom-checkbox"},n.createElement(t.CheckSvg,{style:{innerWidth:"24px",width:"24px"}})),n.createElement("p",{className:"label",style:{fontWeight:"bold",marginLeft:"8px"}},I("WT_SELECT_ALL"))),null==e?void 0:e.map((e,t)=>n.createElement(w,{option:e,key:t,index:t})))};return n.createElement("div",{className:"multi-select-dropdown-wrap "+(g?"disabled":""),ref:N,style:g?{pointerEvents:"none",opacity:.5}:{}},n.createElement("div",{className:"master"+(_?"-active":"")},n.createElement("input",{className:"cursorPointer",type:"text",onKeyDown:e=>{var t,l,n,i,o,a,r,d,u,s,c,v;if("ArrowDown"==e.key)b(e=>e+1==x.length?0:e+1),S+1==x.length?null==e||null===(t=e.target)||void 0===t||null===(l=t.parentElement)||void 0===l||null===(n=l.parentElement)||void 0===n||null===(i=n.children)||void 0===i||null===(o=i.namedItem("jk-dropdown-unique"))||void 0===o||null===(a=o.scrollTo)||void 0===a||a.call(o,0,0):S>2&&(null==e||null===(r=e.target)||void 0===r||null===(d=r.parentElement)||void 0===d||null===(u=d.parentElement)||void 0===u||null===(s=u.children)||void 0===s||null===(c=s.namedItem("jk-dropdown-unique"))||void 0===c||null===(v=c.scrollBy)||void 0===v||v.call(c,0,45)),e.preventDefault();else if("ArrowUp"==e.key){var m,p,E,f,g,_,h,T,y,N,I,D;b(e=>0!==e?e-1:x.length-1),0===S?null==e||null===(m=e.target)||void 0===m||null===(p=m.parentElement)||void 0===p||null===(E=p.parentElement)||void 0===E||null===(f=E.children)||void 0===f||null===(g=f.namedItem("jk-dropdown-unique"))||void 0===g||null===(_=g.scrollTo)||void 0===_||_.call(g,1e5,1e5):S>2&&(null==e||null===(h=e.target)||void 0===h||null===(T=h.parentElement)||void 0===T||null===(y=T.parentElement)||void 0===y||null===(N=y.children)||void 0===N||null===(I=N.namedItem("jk-dropdown-unique"))||void 0===I||null===(D=I.scrollBy)||void 0===D||D.call(I,0,-45)),e.preventDefault()}else"Enter"==e.key&&O(e,x[S])},onFocus:()=>!g&&h(!0),value:T,onChange:function(e){y(e.target.value)},disabled:g}),n.createElement("div",{className:"label"},n.createElement("p",{title:(null==r?void 0:r.length)>0?r.map(e=>I(e[a])).join(", "):u,style:{whiteSpace:"normal",wordBreak:"break-word"}},(null==r?void 0:r.length)>0?`${f?null==r?void 0:r.filter(e=>void 0!==(null==e?void 0:e.i18nKey)).length:r.length} ${s}`:u),n.createElement(t.ArrowDown,null))),_?n.createElement("div",{className:"server",id:"jk-dropdown-unique",style:{...E,maxHeight:"300px",overflowY:"auto"}},n.createElement(L,null)):null)},We=e=>{const a=Digit.ULBService.getCurrentTenantId(),{t:r}=i.useTranslation(),d=o.useHistory(),[u,s]=l.useState(null),[c,m]=l.useState(null),[p,E]=l.useState(""),[f,g]=l.useState(""),[_,h]=l.useState(null),[T,y]=l.useState(null),[S,b]=l.useState(null),[I,D]=l.useState(null),{data:C}=Digit.Hooks.fsm.useVendorSearch({tenantId:a,filters:{status:"ACTIVE"},config:{select:e=>(null==e?void 0:e.vendor)||[]}}),[A,x]=l.useState([]),{data:O}=Digit.Hooks.wt.useFillPointSearch({tenantId:a,filters:{status:!0}}),w=(null==O?void 0:O.fillingPoints)||[],{mutate:L}=Digit.Hooks.wt.useVendorWorkOrderCreate(a),{mutate:P}=Digit.Hooks.wt.useVendorFillingMap(a);l.useEffect(()=>{!function(){try{D(null);const e=function(){if(T){const e=function(){if(T.size>=2e6)D(r("WT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=N(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",T,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?h(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):D(r("WT_FILE_UPLOAD_ERROR"))})},function(){D(r("WT_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]);const R=window.Digit.Utils.browser.isMobile();Digit.UserService.getUser();const k=!c||!p||!f;return n.createElement("div",{className:"employee-form-section-wrapper"},n.createElement(v,{config:[{timeLine:[{actions:"Vendor Assign",currentStep:1}]}],showFinalStep:!1}),n.createElement("div",{style:{flex:1}},n.createElement(t.CollapsibleCardPage,{title:r("WT_VENDOR_ASSIGN"),defaultOpen:!0},n.createElement("div",{className:"formcomposer-section-grid"},n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.Label,null,""+r("WT_VENDOR_NAME")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{t:r,option:C,optionKey:"name",select:m,selected:c,placeholder:r("WT_SELECT_VENDOR")})),n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.Label,null,""+r("COMMON_VALID_FROM_DATE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.DatePicker,{date:p,onChange:e=>E(e),style:{width:"100%"}})),n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.Label,null,""+r("COMMON_VALID_TO_DATE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.DatePicker,{date:f,min:p,onChange:e=>g(e),style:{width:"100%"}})),n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.Label,null,""+r("WT_UPLOAD_DOCUMENT")),n.createElement(t.UploadFile,{id:"wt-doc",extraStyleName:"propertyCreate",accept:".jpg,.png,.pdf,.jpeg",onUpload:function(e){h(null),y(e.target.files[0])},onDelete:()=>{h(null)},message:_?"1 "+r("WT_ACTION_FILEUPLOADED"):r("WT_ACTION_NO_FILEUPLOADED"),error:I})),n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.Label,null,""+r("WT_FILLING_POINT")),n.createElement(Be,{options:w,optionsKey:"fillingPointName",selected:A,onSelect:e=>{const t=(null==e?void 0:e.map(e=>Array.isArray(e)?e[1]:e))||[];x(t)},defaultLabel:r("SELECT_FILLING_POINT"),defaultUnit:r("SELECTED"),ServerStyle:{textAlign:"left",width:"100%",minWidth:"250px",backgroundColor:"#fff"},isPropsNeeded:!1}),A&&A.length>0&&n.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"12px",maxHeight:"120px",overflowY:"auto",padding:"4px"}},A.map((e,t)=>n.createElement("div",{key:t,style:{display:"flex",alignItems:"center",backgroundColor:"#f4f4f4",border:"1px solid #ddd",borderRadius:"16px",padding:"4px 12px",fontSize:"14px",fontWeight:"500"}},n.createElement("span",{style:{marginRight:"8px",color:"#333",maxWidth:"200px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},r((null==e?void 0:e.fillingPointName)||(null==e?void 0:e.id))),n.createElement("button",{type:"button",onClick:t=>{t.preventDefault(),t.stopPropagation();const l=e.id||e.fillingPointId;x(e=>e.filter(e=>(e.id||e.fillingPointId)!==l))},style:{background:"transparent",border:"none",color:"#888",cursor:"pointer",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"auto",padding:"0"}},"×"))))))),n.createElement("div",{style:{display:"flex",marginTop:"24px",justifyContent:R?"center":"flex-end"}},n.createElement(t.SubmitBar,{label:r("ES_COMMON_SAVE"),onSubmit:k?null:()=>{var e,t;const l={vendorWorkOrder:{tenantId:a,name:null==c?void 0:c.name,mobileNumber:null==c||null===(e=c.owner)||void 0===e?void 0:e.mobileNumber,emailId:null==c||null===(t=c.owner)||void 0===t?void 0:t.emailId,vendorId:(null==c?void 0:c.code)||(null==c?void 0:c.id),validFrom:new Date(p).getTime(),validTo:new Date(f).getTime(),serviceType:(null==S?void 0:S.code)||"WT",fileStoreId:_}},n=()=>{L(l,{onSuccess:e=>{s({isError:!1,label:r("ES_COMMON_SAVE_SUCCESS")}),setTimeout(()=>{d.push("/digit-ui/employee/vendor/search-vendor")},3e3)},onError:e=>{var t,l,n,i;s({isError:!0,label:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.message)||r("ES_COMMON_ERROR_SAVING")})}})};if(A&&A.length>0){const e={mappings:A.map(e=>({tenantId:a,fillingPointId:(null==e?void 0:e.id)||(null==e?void 0:e.bookingId)||(null==e?void 0:e.fillingPointId),vendorId:(null==c?void 0:c.code)||(null==c?void 0:c.id)}))};P(e,{onSuccess:()=>{n()},onError:e=>{var t,l,n,i;s({isError:!0,label:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.message)||r("WT_FIXED_FILLING_MAPPING_FAIL")})}})}else n()},disabled:k}))),u&&n.createElement(t.Toast,{error:u.isError,label:u.label,onClose:()=>s(null)}))},Ue=e=>{let{isLoading:i=!1,t:a,onSubmit:d=(()=>{}),data:u=null,count:s=0,setShowToast:c=!1}=e;const v=window.Digit.Utils.browser.isMobile(),m=Digit.UserService.getUser().info,p={offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",bookingNo:"",mobileNumber:"",applicantName:"",status:"",fromDate:"",toDate:""},{register:E,control:f,handleSubmit:g,setValue:_,getValues:h,reset:T,formState:y,watch:S}=r.useForm({defaultValues:p}),b=S("fromDate"),N=e=>n.createElement("span",{className:"cell-text"},e),I=l.useMemo(()=>[{Header:a("WT_BOOKING_NO"),accessor:"bookingNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;const l=t.original.bookingNo;return n.createElement("div",null,n.createElement("span",{className:"link"},n.createElement(o.Link,{to:`/digit-ui/${"EMPLOYEE"===m.type?"employee":"citizen"}/wt/bookingsearch/booking-details/${l}`},l)))}},{Header:a("WT_APPLICANT_NAME"),disableSortBy:!0,Cell:e=>{var t,l;let{row:n}=e;return N(null===(t=n.original)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:a("WT_MOBILE_NUMBER"),disableSortBy:!0,Cell:e=>{var t,l;let{row:n}=e;return N(null===(t=n.original)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:a("PT_COMMON_TABLE_COL_STATUS_LABEL"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return N(a(t.original.bookingStatus))}}],[a,m.type]),C=l.useCallback(e=>{0!==e.length&&(_("sortBy",e.id),_("sortOrder",e.desc?"DESC":"ASC"))},[_]),A=()=>{T(p),c(null),g(d)()};return n.createElement(n.Fragment,null,n.createElement("div",{className:"CITIZEN"===(null==m?void 0:m.type)?"citizen-wrapper":"employee-wrapper"},n.createElement(D,{title:a("WT_SEARCH_FILTERS_LABEL")||"Search Filters",defaultOpen:!0,tabs:[a("WT_SMART_SEARCH"),a("WT_ADVANCED_SEARCH")],defaultTab:a("WT_SMART_SEARCH")},e=>{var l,i,o,u;return n.createElement("form",{onSubmit:g(d)},e===a("WT_SMART_SEARCH")&&n.createElement("div",{className:"wt-search-grid",style:{display:"grid",gridTemplateColumns:v?"1fr":"1fr 1fr",gap:"24px"}},n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,a("WT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:E({minLength:{value:10,message:a("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:a("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:a("CORE_COMMON_MOBILE_ERROR")}}),type:"number",maxlength:10}),n.createElement(t.CardLabelError,null,null==y||null===(l=y.errors)||void 0===l||null===(i=l.mobileNumber)||void 0===i?void 0:i.message))),e===a("WT_ADVANCED_SEARCH")&&n.createElement("div",{className:"formcomposer-section-grid"},n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,a("WT_BOOKING_NO")),n.createElement(t.TextInput,{name:"bookingNo",inputRef:E({})})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,a("WT_APPLICANT_NAME")),n.createElement(t.TextInput,{name:"applicantName",inputRef:E({})})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,a("WT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:E({minLength:{value:10,message:a("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:a("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:a("CORE_COMMON_MOBILE_ERROR")}}),type:"number",maxlength:10}),n.createElement(t.CardLabelError,null,null==y||null===(o=y.errors)||void 0===o||null===(u=o.mobileNumber)||void 0===u?void 0:u.message)),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,a("FROM_DATE")),n.createElement(r.Controller,{render:e=>n.createElement(t.DatePicker,{date:e.value,onChange:e.onChange,max:(new Date).toISOString().split("T")[0]}),name:"fromDate",control:f})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,a("TO_DATE")),n.createElement(r.Controller,{render:e=>n.createElement(t.DatePicker,{date:e.value,onChange:e.onChange,min:b}),name:"toDate",control:f}))),n.createElement("div",{className:"wt-search-actions",style:{display:"flex",justifyContent:v?"center":"flex-end",flexDirection:v?"column-reverse":"row",gap:"24px",marginTop:"16px"}},n.createElement("span",{className:"generic-button clear-search",onClick:A,style:{cursor:"pointer",alignSelf:"center"}},a("ES_COMMON_CLEAR_ALL")),n.createElement("div",{style:{minWidth:v?"100%":"160px"}},n.createElement(t.SubmitBar,{label:a("ES_COMMON_SEARCH"),submit:!0}))))}),i&&n.createElement(t.Loader,null),""===u?n.createElement("p",{style:{textAlign:"center"}},"No data found"):u?n.createElement(t.Table,{t:a,data:u,totalRecords:s,columns:I,getCellProps:e=>({style:{minWidth:e.column.Header===a("WT_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:e=>{_("limit",Number(e.target.value)),g(d)()},currentPage:h("offset")/h("limit"),onNextPage:()=>{_("offset",h("offset")+h("limit")),g(d)()},onPrevPage:()=>{const e=h("offset"),t=h("limit");e-t>=0&&(_("offset",e-t),g(d)())},pageSizeLimit:h("limit"),onSort:C,disableSort:!1,sortParams:[{id:h("sortBy"),desc:"DESC"===h("sortOrder")}]}):null))},He=e=>{var l,a,r,d,u,s;let{path:c}=e;const{t:v}=i.useTranslation(),p=o.useLocation(),E="Emergency Inbox"!==v("Emergency Inbox")?`${v("Emergency Inbox")} ${v("ES_COMMON_INBOX")}`:"Emergency Inbox",f="WT_EMERGENCY_WATER_TANKER_REQUEST"!==v("WT_EMERGENCY_WATER_TANKER_REQUEST")?v("WT_EMERGENCY_WATER_TANKER_REQUEST"):"Emergency Water Tanker Request";sessionStorage.removeItem("revalidateddone");const g={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["watertanker"],applicationStatus:[],locality:[]}},_={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["mobileToilet"],applicationStatus:[],locality:[]}},h={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["treePruning"],applicationStatus:[],locality:[]}},T={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["watertanker-fixedpoint"],applicationStatus:[],locality:[]}},y=null===(l=Digit)||void 0===l||null===(a=l.ComponentRegistryService)||void 0===a?void 0:a.getComponent("ApplicationDetails"),S=null===(r=Digit)||void 0===r||null===(d=r.ComponentRegistryService)||void 0===d?void 0:d.getComponent("WTCreate"),b=null===(u=Digit)||void 0===u||null===(s=u.ComponentRegistryService)||void 0===s?void 0:s.getComponent("WTEmergencyFixedPointCreate");return n.createElement(o.Switch,null,n.createElement(t.AppContainer,null,n.createElement("div",{className:"ground-container employee-app-container form-container"},n.createElement(t.ModuleHeader,{leftContent:n.createElement(n.Fragment,null,n.createElement(t.ArrowLeft,{className:"icon"}),"Back"),onLeftClick:()=>window.history.back(),breadcrumbs:(()=>{const e=p.pathname;let l="WT";e.includes("/mt/")&&(l="MT"),e.includes("/tp/")&&(l="TP");let n=[{icon:t.HomeIcon,path:"/digit-ui/employee"},{label:v("WT_MODULE_NAME"),path:"/digit-ui/employee/module/details?moduleName="+l}];if(e.includes("/fixed-point/inbox"))n.push({label:E});else if(e.includes("/inbox")){let t="ES_COMMON_INBOX";e.includes("/tp/inbox")&&(t="TP_INBOX"),n.push({label:v(t)})}else if(e.includes("/my-bookings")){let t="WT_SEARCH_BOOKINGS";e.includes("/mt/my-bookings")&&(t="MT_SEARCH_BOOKINGS"),e.includes("/tp/my-bookings")&&(t="TP_SEARCH_BOOKINGS"),n.push({label:v(t)})}else if(e.includes("/fixed-point/request-service"))n.push({label:f});else if(e.includes("/request-service"))n.push({label:v("WT_REQUEST_SERVICE")});else if(e.includes("/fixed-point/booking-details"))n.push({label:E,path:c+"/fixed-point/inbox"}),n.push({label:v("WT_BOOKING_DETAILS")});else if(e.includes("/booking-details")||e.includes("/bookingsearch/booking-details")){const t=e.includes("/bookingsearch");n.push(t?{label:v("WT_SEARCH_BOOKINGS"),path:c+"/my-bookings"}:{label:v("ES_COMMON_INBOX"),path:c+"/inbox"}),n.push({label:v("WT_BOOKING_DETAILS")})}else e.includes("/fixed-point-schedule")?n.push({label:v("WT_FIXED_POINT_SCHEDULE_MANAGEMENT")}):e.includes("/live-tracking")?n.push({label:v("WT_LIVE_TRACKING_SYSTEM")}):e.includes("/add-filling-point-address")?n.push({label:v("WT_ADD_FILLING_POINT_ADDRESS")}):e.includes("/add-fix-point-address")?n.push({label:v("WT_ADD_FIX_POINT_ADDRESS")}):e.includes("/search-filling-fix-point")?n.push({label:v("WT_SEARCH_FIX_POINT")}):e.includes("/vendor-assign")&&n.push({label:v("WT_VENDOR_ASSIGN")});return n})()}),n.createElement("div",{className:"employee-form"},n.createElement("div",{className:"employee-form-content"},n.createElement(t.PrivateRoute,{path:c+"/inbox",component:e=>n.createElement(re,m({},e,{useNewInboxAPI:!0,parentRoute:c,businessService:"watertanker",moduleCode:"WT",filterComponent:"WT_INBOX_FILTER",initialStates:g,isInbox:!0}))}),n.createElement(t.PrivateRoute,{path:c+"/fixed-point/inbox",component:e=>n.createElement(re,m({},e,{useNewInboxAPI:!0,parentRoute:c,businessService:"watertanker-fixedpoint",detailRoute:c+"/fixed-point/booking-details",moduleCode:"WT",filterComponent:"WT_INBOX_FILTER",initialStates:T,isInbox:!0}))}),n.createElement(t.PrivateRoute,{path:c+"/mt/inbox",component:e=>n.createElement(re,m({},e,{useNewInboxAPI:!0,parentRoute:c,moduleCode:"MT",businessService:"mobileToilet",filterComponent:"WT_INBOX_FILTER",initialStates:_,isInbox:!0}))}),n.createElement(t.PrivateRoute,{path:c+"/tp/inbox",component:e=>n.createElement(re,m({},e,{useNewInboxAPI:!0,parentRoute:c,moduleCode:"TP",businessService:"treePruning",filterComponent:"WT_INBOX_FILTER",initialStates:h,isInbox:!0}))}),n.createElement(t.PrivateRoute,{path:c+"/request-service",component:S}),n.createElement(t.PrivateRoute,{path:c+"/mt/request-service",component:S}),n.createElement(t.PrivateRoute,{path:c+"/tp/request-service",component:S}),n.createElement(t.PrivateRoute,{path:c+"/fixed-point/request-service",component:b}),n.createElement(t.PrivateRoute,{path:c+"/fixed-point/booking-details/:id",component:e=>n.createElement(t.LayoutWrapper,{layoutClass:"action"},n.createElement(y,m({},e,{parentRoute:c})))}),n.createElement(t.PrivateRoute,{path:c+"/booking-details/:id",component:e=>n.createElement(t.LayoutWrapper,{layoutClass:"action"},n.createElement(y,m({},e,{parentRoute:c})))}),n.createElement(t.PrivateRoute,{path:c+"/bookingsearch/booking-details/:id",component:e=>n.createElement(t.LayoutWrapper,{layoutClass:"normal"},n.createElement(y,m({},e,{parentRoute:c})))}),n.createElement(t.PrivateRoute,{path:c+"/my-bookings",component:e=>n.createElement(A,m({},e,{parentRoute:c,moduleCode:"WT"}))}),n.createElement(t.PrivateRoute,{path:c+"/mt/my-bookings",component:e=>n.createElement(A,m({},e,{parentRoute:c,moduleCode:"MT"}))}),n.createElement(t.PrivateRoute,{path:c+"/tp/my-bookings",component:e=>n.createElement(A,m({},e,{parentRoute:c,moduleCode:"TP"}))}),n.createElement(t.PrivateRoute,{path:c+"/fixed-point-schedule",component:ce}),n.createElement(t.PrivateRoute,{path:c+"/live-tracking",component:Ie}),n.createElement(t.PrivateRoute,{path:c+"/add-filling-point-address",component:xe}),n.createElement(t.PrivateRoute,{path:c+"/add-fix-point-address",component:Oe}),n.createElement(t.PrivateRoute,{path:c+"/search-filling-fix-point",component:Fe}),n.createElement(t.PrivateRoute,{path:c+"/vendor-assignment",component:We}),n.createElement(t.PrivateRoute,{path:c+"/reports",component:e=>n.createElement(t.LayoutWrapper,{layoutClass:"normal"},n.createElement(Ue,m({t:v},e,{parentRoute:c,moduleCode:"WT"})))}))))))},je=e=>{var l,a;let{application:r,tenantId:d,buttonLabel:u}=e,s=null==r?void 0:r.bookingNo.split("-")[0];const{t:c}=i.useTranslation();return n.createElement(t.Card,null,n.createElement(t.KeyNote,{keyValue:c("BOOKING_NO"),note:null==r?void 0:r.bookingNo}),n.createElement(t.KeyNote,{keyValue:c("APPLICANT_NAME"),note:null==r||null===(l=r.applicantDetail)||void 0===l?void 0:l.name}),n.createElement(t.KeyNote,{keyValue:c("MOBILE_NUMBER"),note:c(""+(null==r||null===(a=r.applicantDetail)||void 0===a?void 0:a.mobileNumber))}),n.createElement(t.KeyNote,{keyValue:c("LOCALITY"),note:c(""+(null==r?void 0:r.localityCode))}),n.createElement(t.KeyNote,{keyValue:c("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:c(""+(null==r?void 0:r.bookingStatus))}),n.createElement("div",null,"WT"===s&&n.createElement(o.Link,{to:`/digit-ui/citizen/wt/booking/waterTanker/${null==r?void 0:r.bookingNo}/${d}`},n.createElement(t.SubmitBar,{label:u})),"MT"===s&&n.createElement(o.Link,{to:`/digit-ui/citizen/wt/booking/mobileToilet/${null==r?void 0:r.bookingNo}/${d}`},n.createElement(t.SubmitBar,{label:u})),"TP"===s&&n.createElement(o.Link,{to:`/digit-ui/citizen/wt/booking/treePruning/${null==r?void 0:r.bookingNo}/${d}`},n.createElement(t.SubmitBar,{label:u}))))};var Ve=Array.isArray,ze="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ke(e,t){return e(t={exports:{}},t.exports),t.exports}var Ge,Ye="object"==typeof ze&&ze&&ze.Object===Object&&ze,qe="object"==typeof self&&self&&self.Object===Object&&self,$e=Ye||qe||Function("return this")(),Xe=$e.Symbol,Qe=Object.prototype,Ze=Qe.hasOwnProperty,Je=Qe.toString,et=Xe?Xe.toStringTag:void 0,tt=Object.prototype.toString,lt=Xe?Xe.toStringTag:void 0,nt=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":lt&&lt in Object(e)?function(e){var t=Ze.call(e,et),l=e[et];try{e[et]=void 0;var n=!0}catch(e){}var i=Je.call(e);return n&&(t?e[et]=l:delete e[et]),i}(e):function(e){return tt.call(e)}(e)},it=function(e){return null!=e&&"object"==typeof e},ot=function(e){return"symbol"==typeof e||it(e)&&"[object Symbol]"==nt(e)},at=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rt=/^\w*$/,dt=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ut=function(e){if(!dt(e))return!1;var t=nt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},st=$e["__core-js_shared__"],ct=(Ge=/[^.]+$/.exec(st&&st.keys&&st.keys.IE_PROTO||""))?"Symbol(src)_1."+Ge:"",vt=Function.prototype.toString,mt=function(e){if(null!=e){try{return vt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},pt=/^\[object .+?Constructor\]$/,Et=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ft=function(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!dt(e)||(t=e,ct&&ct in t))&&(ut(e)?Et:pt).test(mt(e));var t}(l)?l:void 0},gt=ft(Object,"create"),_t=Object.prototype.hasOwnProperty,ht=Object.prototype.hasOwnProperty;function Tt(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}Tt.prototype.clear=function(){this.__data__=gt?gt(null):{},this.size=0},Tt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Tt.prototype.get=function(e){var t=this.__data__;if(gt){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return _t.call(t,e)?t[e]:void 0},Tt.prototype.has=function(e){var t=this.__data__;return gt?void 0!==t[e]:ht.call(t,e)},Tt.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=gt&&void 0===t?"__lodash_hash_undefined__":t,this};var yt=Tt,St=function(e,t){return e===t||e!=e&&t!=t},bt=function(e,t){for(var l=e.length;l--;)if(St(e[l][0],t))return l;return-1},Nt=Array.prototype.splice;function It(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}It.prototype.clear=function(){this.__data__=[],this.size=0},It.prototype.delete=function(e){var t=this.__data__,l=bt(t,e);return!(l<0||(l==t.length-1?t.pop():Nt.call(t,l,1),--this.size,0))},It.prototype.get=function(e){var t=this.__data__,l=bt(t,e);return l<0?void 0:t[l][1]},It.prototype.has=function(e){return bt(this.__data__,e)>-1},It.prototype.set=function(e,t){var l=this.__data__,n=bt(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this};var Dt=It,Ct=ft($e,"Map"),At=function(e,t){var l,n,i=e.__data__;return("string"==(n=typeof(l=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==l:null===l)?i["string"==typeof t?"string":"hash"]:i.map};function xt(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}xt.prototype.clear=function(){this.size=0,this.__data__={hash:new yt,map:new(Ct||Dt),string:new yt}},xt.prototype.delete=function(e){var t=At(this,e).delete(e);return this.size-=t?1:0,t},xt.prototype.get=function(e){return At(this,e).get(e)},xt.prototype.has=function(e){return At(this,e).has(e)},xt.prototype.set=function(e,t){var l=At(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this};var Ot=xt;function wt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var l=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=l.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return l.cache=o.set(i,a)||o,a};return l.cache=new(wt.Cache||Ot),l}wt.Cache=Ot;var Lt,Pt,Rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kt=/\\(\\)?/g,Mt=(Lt=wt(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Rt,function(e,l,n,i){t.push(n?i.replace(kt,"$1"):l||e)}),t},function(e){return 500===Pt.size&&Pt.clear(),e}),Pt=Lt.cache,Lt),Ft=Xe?Xe.prototype:void 0,Bt=Ft?Ft.toString:void 0,Wt=function(e){if("string"==typeof e||ot(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Ut=function(e,t,l){var n=null==e?void 0:function(e,t){for(var l=0,n=(t=function(e,t){return Ve(e)?e:function(e,t){if(Ve(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!ot(e))||rt.test(e)||!at.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:Mt(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(Ve(t))return function(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i}(t,e)+"";if(ot(t))return Bt?Bt.call(t):"";var l=t+"";return"0"==l&&1/t==-1/0?"-0":l}(e)}(e))}(t,e)).length;null!=e&&l<n;)e=e[Wt(t[l++])];return l&&l==n?e:void 0}(e,t);return void 0===n?l:n},Ht=Ke(function(e,t){(function(){var l="Expected a function",n="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",d="[object Date]",u="[object Error]",s="[object Function]",c="[object GeneratorFunction]",v="[object Map]",m="[object Number]",p="[object Object]",E="[object RegExp]",f="[object Set]",g="[object String]",_="[object Symbol]",h="[object WeakMap]",T="[object ArrayBuffer]",y="[object DataView]",S="[object Float32Array]",b="[object Float64Array]",N="[object Int8Array]",I="[object Int16Array]",D="[object Int32Array]",C="[object Uint8Array]",A="[object Uint16Array]",x="[object Uint32Array]",O=/\b__p \+= '';/g,w=/\b(__p \+=) '' \+/g,L=/(__e\(.*?\)|\b__t\)) \+\n'';/g,P=/&(?:amp|lt|gt|quot|#39);/g,R=/[&<>"']/g,k=RegExp(P.source),M=RegExp(R.source),F=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,j=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,z=RegExp(V.source),K=/^\s+/,G=/\s/,Y=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,q=/\{\n\/\* \[wrapped with (.+)\] \*/,$=/,? & /,X=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Q=/[()=,{}\[\]\/\s]/,Z=/\\(\\)?/g,J=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ee=/\w*$/,te=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ne=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,oe=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,re=/($^)/,de=/['\n\r\u2028\u2029\\]/g,ue="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",se="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ce="["+se+"]",ve="["+ue+"]",me="\\d+",pe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+se+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",fe="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",he="[\\ud800-\\udbff][\\udc00-\\udfff]",Te="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ye="(?:"+pe+"|"+Ee+")",Se="(?:"+Te+"|"+Ee+")",be="(?:"+ve+"|"+fe+")?",Ne="[\\ufe0e\\ufe0f]?"+be+"(?:\\u200d(?:"+[ge,_e,he].join("|")+")[\\ufe0e\\ufe0f]?"+be+")*",Ie="(?:"+["[\\u2700-\\u27bf]",_e,he].join("|")+")"+Ne,De="(?:"+[ge+ve+"?",ve,_e,he,"[\\ud800-\\udfff]"].join("|")+")",Ce=RegExp("['’]","g"),Ae=RegExp(ve,"g"),xe=RegExp(fe+"(?="+fe+")|"+De+Ne,"g"),Oe=RegExp([Te+"?"+pe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ce,Te,"$"].join("|")+")",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ce,Te+ye,"$"].join("|")+")",Te+"?"+ye+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Te+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Ie].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+ue+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Re=-1,ke={};ke[S]=ke[b]=ke[N]=ke[I]=ke[D]=ke[C]=ke["[object Uint8ClampedArray]"]=ke[A]=ke[x]=!0,ke[o]=ke[a]=ke[T]=ke[r]=ke[y]=ke[d]=ke[u]=ke[s]=ke[v]=ke[m]=ke[p]=ke[E]=ke[f]=ke[g]=ke[h]=!1;var Me={};Me[o]=Me[a]=Me[T]=Me[y]=Me[r]=Me[d]=Me[S]=Me[b]=Me[N]=Me[I]=Me[D]=Me[v]=Me[m]=Me[p]=Me[E]=Me[f]=Me[g]=Me[_]=Me[C]=Me["[object Uint8ClampedArray]"]=Me[A]=Me[x]=!0,Me[u]=Me[s]=Me[h]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Be=parseFloat,We=parseInt,Ue="object"==typeof ze&&ze&&ze.Object===Object&&ze,He="object"==typeof self&&self&&self.Object===Object&&self,je=Ue||He||Function("return this")(),Ve=t&&!t.nodeType&&t,Ke=Ve&&e&&!e.nodeType&&e,Ge=Ke&&Ke.exports===Ve,Ye=Ge&&Ue.process,qe=function(){try{return Ke&&Ke.require&&Ke.require("util").types||Ye&&Ye.binding&&Ye.binding("util")}catch(e){}}(),$e=qe&&qe.isArrayBuffer,Xe=qe&&qe.isDate,Qe=qe&&qe.isMap,Ze=qe&&qe.isRegExp,Je=qe&&qe.isSet,et=qe&&qe.isTypedArray;function tt(e,t,l){switch(l.length){case 0:return e.call(t);case 1:return e.call(t,l[0]);case 2:return e.call(t,l[0],l[1]);case 3:return e.call(t,l[0],l[1],l[2])}return e.apply(t,l)}function lt(e,t,l,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,l(a),e)}return n}function nt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l,e););return e}function it(e,t){for(var l=null==e?0:e.length;l--&&!1!==t(e[l],l,e););return e}function ot(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(!t(e[l],l,e))return!1;return!0}function at(e,t){for(var l=-1,n=null==e?0:e.length,i=0,o=[];++l<n;){var a=e[l];t(a,l,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&gt(e,t,0)>-1}function dt(e,t,l){for(var n=-1,i=null==e?0:e.length;++n<i;)if(l(t,e[n]))return!0;return!1}function ut(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i}function st(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e}function ct(e,t,l,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(l=e[++i]);++i<o;)l=t(l,e[i],i,e);return l}function vt(e,t,l,n){var i=null==e?0:e.length;for(n&&i&&(l=e[--i]);i--;)l=t(l,e[i],i,e);return l}function mt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(t(e[l],l,e))return!0;return!1}var pt=yt("length");function Et(e,t,l){var n;return l(e,function(e,l,i){if(t(e,l,i))return n=l,!1}),n}function ft(e,t,l,n){for(var i=e.length,o=l+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function gt(e,t,l){return t==t?function(e,t,l){for(var n=l-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,l):ft(e,ht,l)}function _t(e,t,l,n){for(var i=l-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function ht(e){return e!=e}function Tt(e,t){var l=null==e?0:e.length;return l?Nt(e,t)/l:NaN}function yt(e){return function(t){return null==t?void 0:t[e]}}function St(e){return function(t){return null==e?void 0:e[t]}}function bt(e,t,l,n,i){return i(e,function(e,i,o){l=n?(n=!1,e):t(l,e,i,o)}),l}function Nt(e,t){for(var l,n=-1,i=e.length;++n<i;){var o=t(e[n]);void 0!==o&&(l=void 0===l?o:l+o)}return l}function It(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}function Dt(e){return e?e.slice(0,zt(e)+1).replace(K,""):e}function Ct(e){return function(t){return e(t)}}function At(e,t){return ut(t,function(t){return e[t]})}function xt(e,t){return e.has(t)}function Ot(e,t){for(var l=-1,n=e.length;++l<n&&gt(t,e[l],0)>-1;);return l}function wt(e,t){for(var l=e.length;l--&&gt(t,e[l],0)>-1;);return l}function Lt(e,t){for(var l=e.length,n=0;l--;)e[l]===t&&++n;return n}var Pt=St({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Rt=St({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function kt(e){return"\\"+Fe[e]}function Mt(e){return we.test(e)}function Ft(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l}function Bt(e,t){return function(l){return e(t(l))}}function Wt(e,t){for(var l=-1,i=e.length,o=0,a=[];++l<i;){var r=e[l];r!==t&&r!==n||(e[l]=n,a[o++]=l)}return a}function Ut(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l}function Ht(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=[e,e]}),l}function jt(e){return Mt(e)?function(e){for(var t=xe.lastIndex=0;xe.test(e);)++t;return t}(e):pt(e)}function Vt(e){return Mt(e)?function(e){return e.match(xe)||[]}(e):function(e){return e.split("")}(e)}function zt(e){for(var t=e.length;t--&&G.test(e.charAt(t)););return t}var Kt=St({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Gt=function e(t){var G=(t=null==t?je:Gt.defaults(je.Object(),t,Gt.pick(je,Pe))).Array,ue=t.Date,se=t.Error,ce=t.Function,ve=t.Math,me=t.Object,pe=t.RegExp,Ee=t.String,fe=t.TypeError,ge=G.prototype,_e=me.prototype,he=t["__core-js_shared__"],Te=ce.prototype.toString,ye=_e.hasOwnProperty,Se=0,be=function(){var e=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ne=_e.toString,Ie=Te.call(me),De=je._,xe=pe("^"+Te.call(ye).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),we=Ge?t.Buffer:void 0,Fe=t.Symbol,Ue=t.Uint8Array,He=we?we.allocUnsafe:void 0,Ve=Bt(me.getPrototypeOf,me),ze=me.create,Ke=_e.propertyIsEnumerable,Ye=ge.splice,qe=Fe?Fe.isConcatSpreadable:void 0,pt=Fe?Fe.iterator:void 0,St=Fe?Fe.toStringTag:void 0,Yt=function(){try{var e=Qi(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),qt=t.clearTimeout!==je.clearTimeout&&t.clearTimeout,$t=ue&&ue.now!==je.Date.now&&ue.now,Xt=t.setTimeout!==je.setTimeout&&t.setTimeout,Qt=ve.ceil,Zt=ve.floor,Jt=me.getOwnPropertySymbols,el=we?we.isBuffer:void 0,tl=t.isFinite,ll=ge.join,nl=Bt(me.keys,me),il=ve.max,ol=ve.min,al=ue.now,rl=t.parseInt,dl=ve.random,ul=ge.reverse,sl=Qi(t,"DataView"),cl=Qi(t,"Map"),vl=Qi(t,"Promise"),ml=Qi(t,"Set"),pl=Qi(t,"WeakMap"),El=Qi(me,"create"),fl=pl&&new pl,gl={},_l=Io(sl),hl=Io(cl),Tl=Io(vl),yl=Io(ml),Sl=Io(pl),bl=Fe?Fe.prototype:void 0,Nl=bl?bl.valueOf:void 0,Il=bl?bl.toString:void 0;function Dl(e){if(ja(e)&&!wa(e)&&!(e instanceof Ol)){if(e instanceof xl)return e;if(ye.call(e,"__wrapped__"))return Do(e)}return new xl(e)}var Cl=function(){function e(){}return function(t){if(!Ha(t))return{};if(ze)return ze(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}();function Al(){}function xl(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Ol(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function wl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Ll(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Pl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Rl(e){var t=-1,l=null==e?0:e.length;for(this.__data__=new Pl;++t<l;)this.add(e[t])}function kl(e){var t=this.__data__=new Ll(e);this.size=t.size}function Ml(e,t){var l=wa(e),n=!l&&Oa(e),i=!l&&!n&&ka(e),o=!l&&!n&&!i&&Xa(e),a=l||n||i||o,r=a?It(e.length,Ee):[],d=r.length;for(var u in e)!t&&!ye.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||io(u,d))||r.push(u);return r}function Fl(e){var t=e.length;return t?e[Rn(0,t-1)]:void 0}function Bl(e,t){return So(Ei(e),Yl(t,0,e.length))}function Wl(e){return So(Ei(e))}function Ul(e,t,l){(void 0!==l&&!Ca(e[t],l)||void 0===l&&!(t in e))&&Kl(e,t,l)}function Hl(e,t,l){var n=e[t];ye.call(e,t)&&Ca(n,l)&&(void 0!==l||t in e)||Kl(e,t,l)}function jl(e,t){for(var l=e.length;l--;)if(Ca(e[l][0],t))return l;return-1}function Vl(e,t,l,n){return Zl(e,function(e,i,o){t(n,e,l(e),o)}),n}function zl(e,t){return e&&fi(t,_r(t),e)}function Kl(e,t,l){"__proto__"==t&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l}function Gl(e,t){for(var l=-1,n=t.length,i=G(n),o=null==e;++l<n;)i[l]=o?void 0:mr(e,t[l]);return i}function Yl(e,t,l){return e==e&&(void 0!==l&&(e=e<=l?e:l),void 0!==t&&(e=e>=t?e:t)),e}function ql(e,t,l,n,i,a){var u,h=1&t,O=2&t,w=4&t;if(l&&(u=i?l(e,n,i,a):l(e)),void 0!==u)return u;if(!Ha(e))return e;var L=wa(e);if(L){if(u=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&ye.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(e),!h)return Ei(e,u)}else{var P=eo(e),R=P==s||P==c;if(ka(e))return ui(e,h);if(P==p||P==o||R&&!i){if(u=O||R?{}:lo(e),!h)return O?function(e,t){return fi(e,Ji(e),t)}(e,function(e,t){return e&&fi(t,hr(t),e)}(u,e)):function(e,t){return fi(e,Zi(e),t)}(e,zl(u,e))}else{if(!Me[P])return i?e:{};u=function(e,t,l){var n=e.constructor;switch(t){case T:return si(e);case r:case d:return new n(+e);case y:return function(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);case S:case b:case N:case I:case D:case C:case"[object Uint8ClampedArray]":case A:case x:return ci(e,l);case v:return new n;case m:case g:return new n(e);case E:return function(e){var t=new e.constructor(e.source,ee.exec(e));return t.lastIndex=e.lastIndex,t}(e);case f:return new n;case _:return Nl?me(Nl.call(e)):{}}}(e,P,h)}}a||(a=new kl);var k=a.get(e);if(k)return k;a.set(e,u),Ya(e)?e.forEach(function(n){u.add(ql(n,t,l,n,e,a))}):Va(e)&&e.forEach(function(n,i){u.set(i,ql(n,t,l,i,e,a))});var M=L?void 0:(w?O?zi:Vi:O?hr:_r)(e);return nt(M||e,function(n,i){M&&(n=e[i=n]),Hl(u,i,ql(n,t,l,i,e,a))}),u}function $l(e,t,l){var n=l.length;if(null==e)return!n;for(e=me(e);n--;){var i=l[n],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Xl(e,t,n){if("function"!=typeof e)throw new fe(l);return _o(function(){e.apply(void 0,n)},t)}function Ql(e,t,l,n){var i=-1,o=rt,a=!0,r=e.length,d=[],u=t.length;if(!r)return d;l&&(t=ut(t,Ct(l))),n?(o=dt,a=!1):t.length>=200&&(o=xt,a=!1,t=new Rl(t));e:for(;++i<r;){var s=e[i],c=null==l?s:l(s);if(s=n||0!==s?s:0,a&&c==c){for(var v=u;v--;)if(t[v]===c)continue e;d.push(s)}else o(t,c,n)||d.push(s)}return d}Dl.templateSettings={escape:F,evaluate:B,interpolate:W,variable:"",imports:{_:Dl}},(Dl.prototype=Al.prototype).constructor=Dl,(xl.prototype=Cl(Al.prototype)).constructor=xl,(Ol.prototype=Cl(Al.prototype)).constructor=Ol,wl.prototype.clear=function(){this.__data__=El?El(null):{},this.size=0},wl.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},wl.prototype.get=function(e){var t=this.__data__;if(El){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return ye.call(t,e)?t[e]:void 0},wl.prototype.has=function(e){var t=this.__data__;return El?void 0!==t[e]:ye.call(t,e)},wl.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=El&&void 0===t?"__lodash_hash_undefined__":t,this},Ll.prototype.clear=function(){this.__data__=[],this.size=0},Ll.prototype.delete=function(e){var t=this.__data__,l=jl(t,e);return!(l<0||(l==t.length-1?t.pop():Ye.call(t,l,1),--this.size,0))},Ll.prototype.get=function(e){var t=this.__data__,l=jl(t,e);return l<0?void 0:t[l][1]},Ll.prototype.has=function(e){return jl(this.__data__,e)>-1},Ll.prototype.set=function(e,t){var l=this.__data__,n=jl(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this},Pl.prototype.clear=function(){this.size=0,this.__data__={hash:new wl,map:new(cl||Ll),string:new wl}},Pl.prototype.delete=function(e){var t=$i(this,e).delete(e);return this.size-=t?1:0,t},Pl.prototype.get=function(e){return $i(this,e).get(e)},Pl.prototype.has=function(e){return $i(this,e).has(e)},Pl.prototype.set=function(e,t){var l=$i(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this},Rl.prototype.add=Rl.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Rl.prototype.has=function(e){return this.__data__.has(e)},kl.prototype.clear=function(){this.__data__=new Ll,this.size=0},kl.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},kl.prototype.get=function(e){return this.__data__.get(e)},kl.prototype.has=function(e){return this.__data__.has(e)},kl.prototype.set=function(e,t){var l=this.__data__;if(l instanceof Ll){var n=l.__data__;if(!cl||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new Pl(n)}return l.set(e,t),this.size=l.size,this};var Zl=hi(rn),Jl=hi(dn,!0);function en(e,t){var l=!0;return Zl(e,function(e,n,i){return l=!!t(e,n,i)}),l}function tn(e,t,l){for(var n=-1,i=e.length;++n<i;){var o=e[n],a=t(o);if(null!=a&&(void 0===r?a==a&&!$a(a):l(a,r)))var r=a,d=o}return d}function ln(e,t){var l=[];return Zl(e,function(e,n,i){t(e,n,i)&&l.push(e)}),l}function nn(e,t,l,n,i){var o=-1,a=e.length;for(l||(l=no),i||(i=[]);++o<a;){var r=e[o];t>0&&l(r)?t>1?nn(r,t-1,l,n,i):st(i,r):n||(i[i.length]=r)}return i}var on=Ti(),an=Ti(!0);function rn(e,t){return e&&on(e,t,_r)}function dn(e,t){return e&&an(e,t,_r)}function un(e,t){return at(t,function(t){return Ba(e[t])})}function sn(e,t){for(var l=0,n=(t=oi(t,e)).length;null!=e&&l<n;)e=e[No(t[l++])];return l&&l==n?e:void 0}function cn(e,t,l){var n=t(e);return wa(e)?n:st(n,l(e))}function vn(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":St&&St in me(e)?function(e){var t=ye.call(e,St),l=e[St];try{e[St]=void 0;var n=!0}catch(e){}var i=Ne.call(e);return n&&(t?e[St]=l:delete e[St]),i}(e):function(e){return Ne.call(e)}(e)}function mn(e,t){return e>t}function pn(e,t){return null!=e&&ye.call(e,t)}function En(e,t){return null!=e&&t in me(e)}function fn(e,t,l){for(var n=l?dt:rt,i=e[0].length,o=e.length,a=o,r=G(o),d=Infinity,u=[];a--;){var s=e[a];a&&t&&(s=ut(s,Ct(t))),d=ol(s.length,d),r[a]=!l&&(t||i>=120&&s.length>=120)?new Rl(a&&s):void 0}s=e[0];var c=-1,v=r[0];e:for(;++c<i&&u.length<d;){var m=s[c],p=t?t(m):m;if(m=l||0!==m?m:0,!(v?xt(v,p):n(u,p,l))){for(a=o;--a;){var E=r[a];if(!(E?xt(E,p):n(e[a],p,l)))continue e}v&&v.push(p),u.push(m)}}return u}function gn(e,t,l){var n=null==(e=po(e,t=oi(t,e)))?e:e[No(Fo(t))];return null==n?void 0:tt(n,e,l)}function _n(e){return ja(e)&&vn(e)==o}function hn(e,t,l,n,i){return e===t||(null==e||null==t||!ja(e)&&!ja(t)?e!=e&&t!=t:function(e,t,l,n,i,s){var c=wa(e),h=wa(t),S=c?a:eo(e),b=h?a:eo(t),N=(S=S==o?p:S)==p,I=(b=b==o?p:b)==p,D=S==b;if(D&&ka(e)){if(!ka(t))return!1;c=!0,N=!1}if(D&&!N)return s||(s=new kl),c||Xa(e)?Hi(e,t,l,n,i,s):function(e,t,l,n,i,o,a){switch(l){case y:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T:return!(e.byteLength!=t.byteLength||!o(new Ue(e),new Ue(t)));case r:case d:case m:return Ca(+e,+t);case u:return e.name==t.name&&e.message==t.message;case E:case g:return e==t+"";case v:var s=Ft;case f:if(s||(s=Ut),e.size!=t.size&&!(1&n))return!1;var c=a.get(e);if(c)return c==t;n|=2,a.set(e,t);var p=Hi(s(e),s(t),n,i,o,a);return a.delete(e),p;case _:if(Nl)return Nl.call(e)==Nl.call(t)}return!1}(e,t,S,l,n,i,s);if(!(1&l)){var C=N&&ye.call(e,"__wrapped__"),A=I&&ye.call(t,"__wrapped__");if(C||A){var x=C?e.value():e,O=A?t.value():t;return s||(s=new kl),i(x,O,l,n,s)}}return!!D&&(s||(s=new kl),function(e,t,l,n,i,o){var a=1&l,r=Vi(e),d=r.length;if(d!=Vi(t).length&&!a)return!1;for(var u=d;u--;){var s=r[u];if(!(a?s in t:ye.call(t,s)))return!1}var c=o.get(e),v=o.get(t);if(c&&v)return c==t&&v==e;var m=!0;o.set(e,t),o.set(t,e);for(var p=a;++u<d;){var E=e[s=r[u]],f=t[s];if(n)var g=a?n(f,E,s,t,e,o):n(E,f,s,e,t,o);if(!(void 0===g?E===f||i(E,f,l,n,o):g)){m=!1;break}p||(p="constructor"==s)}if(m&&!p){var _=e.constructor,h=t.constructor;_==h||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof h&&h instanceof h||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,l,n,i,s))}(e,t,l,n,hn,i))}function Tn(e,t,l,n){var i=l.length,o=i,a=!n;if(null==e)return!o;for(e=me(e);i--;){var r=l[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var d=(r=l[i])[0],u=e[d],s=r[1];if(a&&r[2]){if(void 0===u&&!(d in e))return!1}else{var c=new kl;if(n)var v=n(u,s,d,e,t,c);if(!(void 0===v?hn(s,u,3,n,c):v))return!1}}return!0}function yn(e){return!(!Ha(e)||(t=e,be&&be in t))&&(Ba(e)?xe:ne).test(Io(e));var t}function Sn(e){return"function"==typeof e?e:null==e?zr:"object"==typeof e?wa(e)?Cn(e[0],e[1]):Dn(e):Jr(e)}function bn(e){if(!so(e))return nl(e);var t=[];for(var l in me(e))ye.call(e,l)&&"constructor"!=l&&t.push(l);return t}function Nn(e,t){return e<t}function In(e,t){var l=-1,n=Pa(e)?G(e.length):[];return Zl(e,function(e,i,o){n[++l]=t(e,i,o)}),n}function Dn(e){var t=Xi(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(l){return l===e||Tn(l,e,t)}}function Cn(e,t){return ao(e)&&co(t)?vo(No(e),t):function(l){var n=mr(l,e);return void 0===n&&n===t?pr(l,e):hn(t,n,3)}}function An(e,t,l,n,i){e!==t&&on(t,function(o,a){if(i||(i=new kl),Ha(o))!function(e,t,l,n,i,o,a){var r=fo(e,l),d=fo(t,l),u=a.get(d);if(u)Ul(e,l,u);else{var s=o?o(r,d,l+"",e,t,a):void 0,c=void 0===s;if(c){var v=wa(d),m=!v&&ka(d),p=!v&&!m&&Xa(d);s=d,v||m||p?wa(r)?s=r:Ra(r)?s=Ei(r):m?(c=!1,s=ui(d,!0)):p?(c=!1,s=ci(d,!0)):s=[]:Ka(d)||Oa(d)?(s=r,Oa(r)?s=ir(r):Ha(r)&&!Ba(r)||(s=lo(d))):c=!1}c&&(a.set(d,s),i(s,d,n,o,a),a.delete(d)),Ul(e,l,s)}}(e,t,a,l,An,n,i);else{var r=n?n(fo(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Ul(e,a,r)}},hr)}function xn(e,t){var l=e.length;if(l)return io(t+=t<0?l:0,l)?e[t]:void 0}function On(e,t,l){t=t.length?ut(t,function(e){return wa(e)?function(t){return sn(t,1===e.length?e[0]:e)}:e}):[zr];var n=-1;return t=ut(t,Ct(qi())),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,r=l.length;++n<a;){var d=vi(i[n],o[n]);if(d)return n>=r?d:d*("desc"==l[n]?-1:1)}return e.index-t.index}(e,t,l)});n--;)e[n]=e[n].value;return e}(In(e,function(e,l,i){return{criteria:ut(t,function(t){return t(e)}),index:++n,value:e}}))}function wn(e,t,l){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],r=sn(e,a);l(r,a)&&Wn(o,oi(a,e),r)}return o}function Ln(e,t,l,n){var i=n?_t:gt,o=-1,a=t.length,r=e;for(e===t&&(t=Ei(t)),l&&(r=ut(e,Ct(l)));++o<a;)for(var d=0,u=t[o],s=l?l(u):u;(d=i(r,s,d,n))>-1;)r!==e&&Ye.call(r,d,1),Ye.call(e,d,1);return e}function Pn(e,t){for(var l=e?t.length:0,n=l-1;l--;){var i=t[l];if(l==n||i!==o){var o=i;io(i)?Ye.call(e,i,1):Qn(e,i)}}return e}function Rn(e,t){return e+Zt(dl()*(t-e+1))}function kn(e,t){var l="";if(!e||t<1||t>9007199254740991)return l;do{t%2&&(l+=e),(t=Zt(t/2))&&(e+=e)}while(t);return l}function Mn(e,t){return ho(mo(e,t,zr),e+"")}function Fn(e){return Fl(Cr(e))}function Bn(e,t){var l=Cr(e);return So(l,Yl(t,0,l.length))}function Wn(e,t,l,n){if(!Ha(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var d=No(t[i]),u=l;if("__proto__"===d||"constructor"===d||"prototype"===d)return e;if(i!=a){var s=r[d];void 0===(u=n?n(s,d,r):void 0)&&(u=Ha(s)?s:io(t[i+1])?[]:{})}Hl(r,d,u),r=r[d]}return e}var Un=fl?function(e,t){return fl.set(e,t),e}:zr,Hn=Yt?function(e,t){return Yt(e,"toString",{configurable:!0,enumerable:!1,value:Hr(t),writable:!0})}:zr;function jn(e){return So(Cr(e))}function Vn(e,t,l){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(l=l>i?i:l)<0&&(l+=i),i=t>l?0:l-t>>>0,t>>>=0;for(var o=G(i);++n<i;)o[n]=e[n+t];return o}function zn(e,t){var l;return Zl(e,function(e,n,i){return!(l=t(e,n,i))}),!!l}function Kn(e,t,l){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!$a(a)&&(l?a<=t:a<t)?n=o+1:i=o}return i}return Gn(e,t,zr,l)}function Gn(e,t,l,n){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=l(t))!=t,r=null===t,d=$a(t),u=void 0===t;i<o;){var s=Zt((i+o)/2),c=l(e[s]),v=void 0!==c,m=null===c,p=c==c,E=$a(c);if(a)var f=n||p;else f=u?p&&(n||v):r?p&&v&&(n||!m):d?p&&v&&!m&&(n||!E):!m&&!E&&(n?c<=t:c<t);f?i=s+1:o=s}return ol(o,4294967294)}function Yn(e,t){for(var l=-1,n=e.length,i=0,o=[];++l<n;){var a=e[l],r=t?t(a):a;if(!l||!Ca(r,d)){var d=r;o[i++]=0===a?0:a}}return o}function qn(e){return"number"==typeof e?e:$a(e)?NaN:+e}function $n(e){if("string"==typeof e)return e;if(wa(e))return ut(e,$n)+"";if($a(e))return Il?Il.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xn(e,t,l){var n=-1,i=rt,o=e.length,a=!0,r=[],d=r;if(l)a=!1,i=dt;else if(o>=200){var u=t?null:ki(e);if(u)return Ut(u);a=!1,i=xt,d=new Rl}else d=t?[]:r;e:for(;++n<o;){var s=e[n],c=t?t(s):s;if(s=l||0!==s?s:0,a&&c==c){for(var v=d.length;v--;)if(d[v]===c)continue e;t&&d.push(c),r.push(s)}else i(d,c,l)||(d!==r&&d.push(c),r.push(s))}return r}function Qn(e,t){return null==(e=po(e,t=oi(t,e)))||delete e[No(Fo(t))]}function Zn(e,t,l,n){return Wn(e,t,l(sn(e,t)),n)}function Jn(e,t,l,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return l?Vn(e,n?0:o,n?o+1:i):Vn(e,n?o+1:0,n?i:o)}function ei(e,t){var l=e;return l instanceof Ol&&(l=l.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},l)}function ti(e,t,l){var n=e.length;if(n<2)return n?Xn(e[0]):[];for(var i=-1,o=G(n);++i<n;)for(var a=e[i],r=-1;++r<n;)r!=i&&(o[i]=Ql(o[i]||a,e[r],t,l));return Xn(nn(o,1),t,l)}function li(e,t,l){for(var n=-1,i=e.length,o=t.length,a={};++n<i;)l(a,e[n],n<o?t[n]:void 0);return a}function ni(e){return Ra(e)?e:[]}function ii(e){return"function"==typeof e?e:zr}function oi(e,t){return wa(e)?e:ao(e,t)?[e]:bo(or(e))}var ai=Mn;function ri(e,t,l){var n=e.length;return l=void 0===l?n:l,!t&&l>=n?e:Vn(e,t,l)}var di=qt||function(e){return je.clearTimeout(e)};function ui(e,t){if(t)return e.slice();var l=e.length,n=He?He(l):new e.constructor(l);return e.copy(n),n}function si(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function ci(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var l=void 0!==e,n=null===e,i=e==e,o=$a(e),a=void 0!==t,r=null===t,d=t==t,u=$a(t);if(!r&&!u&&!o&&e>t||o&&a&&d&&!r&&!u||n&&a&&d||!l&&d||!i)return 1;if(!n&&!o&&!u&&e<t||u&&l&&i&&!n&&!o||r&&l&&i||!a&&i||!d)return-1}return 0}function mi(e,t,l,n){for(var i=-1,o=e.length,a=l.length,r=-1,d=t.length,u=il(o-a,0),s=G(d+u),c=!n;++r<d;)s[r]=t[r];for(;++i<a;)(c||i<o)&&(s[l[i]]=e[i]);for(;u--;)s[r++]=e[i++];return s}function pi(e,t,l,n){for(var i=-1,o=e.length,a=-1,r=l.length,d=-1,u=t.length,s=il(o-r,0),c=G(s+u),v=!n;++i<s;)c[i]=e[i];for(var m=i;++d<u;)c[m+d]=t[d];for(;++a<r;)(v||i<o)&&(c[m+l[a]]=e[i++]);return c}function Ei(e,t){var l=-1,n=e.length;for(t||(t=G(n));++l<n;)t[l]=e[l];return t}function fi(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],d=n?n(l[r],e[r],r,l,e):void 0;void 0===d&&(d=e[r]),i?Kl(l,r,d):Hl(l,r,d)}return l}function gi(e,t){return function(l,n){var i=wa(l)?lt:Vl,o=t?t():{};return i(l,e,qi(n,2),o)}}function _i(e){return Mn(function(t,l){var n=-1,i=l.length,o=i>1?l[i-1]:void 0,a=i>2?l[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(l[0],l[1],a)&&(o=i<3?void 0:o,i=1),t=me(t);++n<i;){var r=l[n];r&&e(t,r,n,o)}return t})}function hi(e,t){return function(l,n){if(null==l)return l;if(!Pa(l))return e(l,n);for(var i=l.length,o=t?i:-1,a=me(l);(t?o--:++o<i)&&!1!==n(a[o],o,a););return l}}function Ti(e){return function(t,l,n){for(var i=-1,o=me(t),a=n(t),r=a.length;r--;){var d=a[e?r:++i];if(!1===l(o[d],d,o))break}return t}}function yi(e){return function(t){var l=Mt(t=or(t))?Vt(t):void 0,n=l?l[0]:t.charAt(0),i=l?ri(l,1).join(""):t.slice(1);return n[e]()+i}}function Si(e){return function(t){return ct(Br(Or(t).replace(Ce,"")),e,"")}}function bi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var l=Cl(e.prototype),n=e.apply(l,t);return Ha(n)?n:l}}function Ni(e){return function(t,l,n){var i=me(t);if(!Pa(t)){var o=qi(l,3);t=_r(t),l=function(e){return o(i[e],e,i)}}var a=e(t,l,n);return a>-1?i[o?t[a]:a]:void 0}}function Ii(e){return ji(function(t){var n=t.length,i=n,o=xl.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new fe(l);if(o&&!r&&"wrapper"==Gi(a))var r=new xl([],!0)}for(i=r?i:n;++i<n;){var d=Gi(a=t[i]),u="wrapper"==d?Ki(a):void 0;r=u&&ro(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?r[Gi(u[0])].apply(r,u[3]):1==a.length&&ro(a)?r[d]():r.thru(a)}return function(){var e=arguments,l=e[0];if(r&&1==e.length&&wa(l))return r.plant(l).value();for(var i=0,o=n?t[i].apply(this,e):l;++i<n;)o=t[i].call(this,o);return o}})}function Di(e,t,l,n,i,o,a,r,d,u){var s=128&t,c=1&t,v=2&t,m=24&t,p=512&t,E=v?void 0:bi(e);return function f(){for(var g=arguments.length,_=G(g),h=g;h--;)_[h]=arguments[h];if(m)var T=Yi(f),y=Lt(_,T);if(n&&(_=mi(_,n,i,m)),o&&(_=pi(_,o,a,m)),g-=y,m&&g<u){var S=Wt(_,T);return Pi(e,t,Di,f.placeholder,l,_,S,r,d,u-g)}var b=c?l:this,N=v?b[e]:e;return g=_.length,r?_=Eo(_,r):p&&g>1&&_.reverse(),s&&d<g&&(_.length=d),this&&this!==je&&this instanceof f&&(N=E||bi(N)),N.apply(b,_)}}function Ci(e,t){return function(l,n){return function(e,t,l,n){return rn(e,function(e,i,o){t(n,l(e),i,o)}),n}(l,e,t(n),{})}}function Ai(e,t){return function(l,n){var i;if(void 0===l&&void 0===n)return t;if(void 0!==l&&(i=l),void 0!==n){if(void 0===i)return n;"string"==typeof l||"string"==typeof n?(l=$n(l),n=$n(n)):(l=qn(l),n=qn(n)),i=e(l,n)}return i}}function xi(e){return ji(function(t){return t=ut(t,Ct(qi())),Mn(function(l){var n=this;return e(t,function(e){return tt(e,n,l)})})})}function Oi(e,t){var l=(t=void 0===t?" ":$n(t)).length;if(l<2)return l?kn(t,e):t;var n=kn(t,Qt(e/jt(t)));return Mt(t)?ri(Vt(n),0,e).join(""):n.slice(0,e)}function wi(e){return function(t,l,n){return n&&"number"!=typeof n&&oo(t,l,n)&&(l=n=void 0),t=er(t),void 0===l?(l=t,t=0):l=er(l),function(e,t,l,n){for(var i=-1,o=il(Qt((t-e)/(l||1)),0),a=G(o);o--;)a[n?o:++i]=e,e+=l;return a}(t,l,n=void 0===n?t<l?1:-1:er(n),e)}}function Li(e){return function(t,l){return"string"==typeof t&&"string"==typeof l||(t=nr(t),l=nr(l)),e(t,l)}}function Pi(e,t,l,n,i,o,a,r,d,u){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,r,d,u],v=l.apply(void 0,c);return ro(e)&&go(v,c),v.placeholder=n,To(v,e,t)}function Ri(e){var t=ve[e];return function(e,l){if(e=nr(e),(l=null==l?0:ol(tr(l),292))&&tl(e)){var n=(or(e)+"e").split("e");return+((n=(or(t(n[0]+"e"+(+n[1]+l)))+"e").split("e"))[0]+"e"+(+n[1]-l))}return t(e)}}var ki=ml&&1/Ut(new ml([,-0]))[1]==1/0?function(e){return new ml(e)}:$r;function Mi(e){return function(t){var l=eo(t);return l==v?Ft(t):l==f?Ht(t):function(e,t){return ut(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fi(e,t,i,o,a,r,d,u){var s=2&t;if(!s&&"function"!=typeof e)throw new fe(l);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),d=void 0===d?d:il(tr(d),0),u=void 0===u?u:tr(u),c-=a?a.length:0,64&t){var v=o,m=a;o=a=void 0}var p=s?void 0:Ki(e),E=[e,t,i,o,a,v,m,r,d,u];if(p&&function(e,t){var l=e[1],i=t[1],o=l|i;if(!(o<131||128==i&&8==l||128==i&&256==l&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==l))return e;1&i&&(e[2]=t[2],o|=1&l?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?mi(r,a,t[4]):a,e[4]=r?Wt(e[3],n):t[4]}(a=t[5])&&(e[5]=(r=e[5])?pi(r,a,t[6]):a,e[6]=r?Wt(e[5],n):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:ol(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(E,p),e=E[0],t=E[1],i=E[2],o=E[3],a=E[4],!(u=E[9]=void 0===E[9]?s?0:e.length:il(E[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)f=8==t||16==t?function(e,t,l){var n=bi(e);return function i(){for(var o=arguments.length,a=G(o),r=o,d=Yi(i);r--;)a[r]=arguments[r];var u=o<3&&a[0]!==d&&a[o-1]!==d?[]:Wt(a,d);if((o-=u.length)<l)return Pi(e,t,Di,i.placeholder,void 0,a,u,void 0,void 0,l-o);var s=this&&this!==je&&this instanceof i?n:e;return tt(s,this,a)}}(e,t,u):32!=t&&33!=t||a.length?Di.apply(void 0,E):function(e,t,l,n){var i=1&t,o=bi(e);return function t(){for(var a=-1,r=arguments.length,d=-1,u=n.length,s=G(u+r),c=this&&this!==je&&this instanceof t?o:e;++d<u;)s[d]=n[d];for(;r--;)s[d++]=arguments[++a];return tt(c,i?l:this,s)}}(e,t,i,o);else var f=function(e,t,l){var n=1&t,i=bi(e);return function t(){var o=this&&this!==je&&this instanceof t?i:e;return o.apply(n?l:this,arguments)}}(e,t,i);return To((p?Un:go)(f,E),e,t)}function Bi(e,t,l,n){return void 0===e||Ca(e,_e[l])&&!ye.call(n,l)?t:e}function Wi(e,t,l,n,i,o){return Ha(e)&&Ha(t)&&(o.set(t,e),An(e,t,void 0,Wi,o),o.delete(t)),e}function Ui(e){return Ka(e)?void 0:e}function Hi(e,t,l,n,i,o){var a=1&l,r=e.length,d=t.length;if(r!=d&&!(a&&d>r))return!1;var u=o.get(e),s=o.get(t);if(u&&s)return u==t&&s==e;var c=-1,v=!0,m=2&l?new Rl:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var p=e[c],E=t[c];if(n)var f=a?n(E,p,c,t,e,o):n(p,E,c,e,t,o);if(void 0!==f){if(f)continue;v=!1;break}if(m){if(!mt(t,function(e,t){if(!xt(m,t)&&(p===e||i(p,e,l,n,o)))return m.push(t)})){v=!1;break}}else if(p!==E&&!i(p,E,l,n,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function ji(e){return ho(mo(e,void 0,Lo),e+"")}function Vi(e){return cn(e,_r,Zi)}function zi(e){return cn(e,hr,Ji)}var Ki=fl?function(e){return fl.get(e)}:$r;function Gi(e){for(var t=e.name+"",l=gl[t],n=ye.call(gl,t)?l.length:0;n--;){var i=l[n],o=i.func;if(null==o||o==e)return i.name}return t}function Yi(e){return(ye.call(Dl,"placeholder")?Dl:e).placeholder}function qi(){var e=Dl.iteratee||Kr;return e=e===Kr?Sn:e,arguments.length?e(arguments[0],arguments[1]):e}function $i(e,t){var l,n,i=e.__data__;return("string"==(n=typeof(l=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==l:null===l)?i["string"==typeof t?"string":"hash"]:i.map}function Xi(e){for(var t=_r(e),l=t.length;l--;){var n=t[l],i=e[n];t[l]=[n,i,co(i)]}return t}function Qi(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return yn(l)?l:void 0}var Zi=Jt?function(e){return null==e?[]:(e=me(e),at(Jt(e),function(t){return Ke.call(e,t)}))}:ld,Ji=Jt?function(e){for(var t=[];e;)st(t,Zi(e)),e=Ve(e);return t}:ld,eo=vn;function to(e,t,l){for(var n=-1,i=(t=oi(t,e)).length,o=!1;++n<i;){var a=No(t[n]);if(!(o=null!=e&&l(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Ua(i)&&io(a,i)&&(wa(e)||Oa(e))}function lo(e){return"function"!=typeof e.constructor||so(e)?{}:Cl(Ve(e))}function no(e){return wa(e)||Oa(e)||!!(qe&&e&&e[qe])}function io(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&oe.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,l){if(!Ha(l))return!1;var n=typeof t;return!!("number"==n?Pa(l)&&io(t,l.length):"string"==n&&t in l)&&Ca(l[t],e)}function ao(e,t){if(wa(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!$a(e))||H.test(e)||!U.test(e)||null!=t&&e in me(t)}function ro(e){var t=Gi(e),l=Dl[t];if("function"!=typeof l||!(t in Ol.prototype))return!1;if(e===l)return!0;var n=Ki(l);return!!n&&e===n[0]}(sl&&eo(new sl(new ArrayBuffer(1)))!=y||cl&&eo(new cl)!=v||vl&&"[object Promise]"!=eo(vl.resolve())||ml&&eo(new ml)!=f||pl&&eo(new pl)!=h)&&(eo=function(e){var t=vn(e),l=t==p?e.constructor:void 0,n=l?Io(l):"";if(n)switch(n){case _l:return y;case hl:return v;case Tl:return"[object Promise]";case yl:return f;case Sl:return h}return t});var uo=he?Ba:nd;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}function co(e){return e==e&&!Ha(e)}function vo(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in me(l))}}function mo(e,t,l){return t=il(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=il(n.length-t,0),a=G(o);++i<o;)a[i]=n[t+i];i=-1;for(var r=G(t+1);++i<t;)r[i]=n[i];return r[t]=l(a),tt(e,this,r)}}function po(e,t){return t.length<2?e:sn(e,Vn(t,0,-1))}function Eo(e,t){for(var l=e.length,n=ol(t.length,l),i=Ei(e);n--;){var o=t[n];e[n]=io(o,l)?i[o]:void 0}return e}function fo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var go=yo(Un),_o=Xt||function(e,t){return je.setTimeout(e,t)},ho=yo(Hn);function To(e,t,l){var n=t+"";return ho(e,function(e,t){var l=t.length;if(!l)return e;var n=l-1;return t[n]=(l>1?"& ":"")+t[n],t=t.join(l>2?", ":" "),e.replace(Y,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return nt(i,function(l){var n="_."+l[0];t&l[1]&&!rt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(q);return t?t[1].split($):[]}(n),l)))}function yo(e){var t=0,l=0;return function(){var n=al(),i=16-(n-l);if(l=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function So(e,t){var l=-1,n=e.length,i=n-1;for(t=void 0===t?n:t;++l<t;){var o=Rn(l,i),a=e[o];e[o]=e[l],e[l]=a}return e.length=t,e}var bo=function(e){var t=ya(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(j,function(e,l,n,i){t.push(n?i.replace(Z,"$1"):l||e)}),t},function(e){return 500===l.size&&l.clear(),e}),l=t.cache;return t}();function No(e){if("string"==typeof e||$a(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Io(e){if(null!=e){try{return Te.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Do(e){if(e instanceof Ol)return e.clone();var t=new xl(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Co=Mn(function(e,t){return Ra(e)?Ql(e,nn(t,1,Ra,!0)):[]}),Ao=Mn(function(e,t){var l=Fo(t);return Ra(l)&&(l=void 0),Ra(e)?Ql(e,nn(t,1,Ra,!0),qi(l,2)):[]}),xo=Mn(function(e,t){var l=Fo(t);return Ra(l)&&(l=void 0),Ra(e)?Ql(e,nn(t,1,Ra,!0),void 0,l):[]});function Oo(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:tr(l);return i<0&&(i=il(n+i,0)),ft(e,qi(t,3),i)}function wo(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n-1;return void 0!==l&&(i=tr(l),i=l<0?il(n+i,0):ol(i,n-1)),ft(e,qi(t,3),i,!0)}function Lo(e){return null!=e&&e.length?nn(e,1):[]}function Po(e){return e&&e.length?e[0]:void 0}var Ro=Mn(function(e){var t=ut(e,ni);return t.length&&t[0]===e[0]?fn(t):[]}),ko=Mn(function(e){var t=Fo(e),l=ut(e,ni);return t===Fo(l)?t=void 0:l.pop(),l.length&&l[0]===e[0]?fn(l,qi(t,2)):[]}),Mo=Mn(function(e){var t=Fo(e),l=ut(e,ni);return(t="function"==typeof t?t:void 0)&&l.pop(),l.length&&l[0]===e[0]?fn(l,void 0,t):[]});function Fo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Bo=Mn(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?Ln(e,t):e}var Uo=ji(function(e,t){var l=null==e?0:e.length,n=Gl(e,t);return Pn(e,ut(t,function(e){return io(e,l)?+e:e}).sort(vi)),n});function Ho(e){return null==e?e:ul.call(e)}var jo=Mn(function(e){return Xn(nn(e,1,Ra,!0))}),Vo=Mn(function(e){var t=Fo(e);return Ra(t)&&(t=void 0),Xn(nn(e,1,Ra,!0),qi(t,2))}),zo=Mn(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,Xn(nn(e,1,Ra,!0),void 0,t)});function Ko(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ra(e))return t=il(e.length,t),!0}),It(t,function(t){return ut(e,yt(t))})}function Go(e,t){if(!e||!e.length)return[];var l=Ko(e);return null==t?l:ut(l,function(e){return tt(t,void 0,e)})}var Yo=Mn(function(e,t){return Ra(e)?Ql(e,t):[]}),qo=Mn(function(e){return ti(at(e,Ra))}),$o=Mn(function(e){var t=Fo(e);return Ra(t)&&(t=void 0),ti(at(e,Ra),qi(t,2))}),Xo=Mn(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,ti(at(e,Ra),void 0,t)}),Qo=Mn(Ko),Zo=Mn(function(e){var t=e.length,l=t>1?e[t-1]:void 0;return l="function"==typeof l?(e.pop(),l):void 0,Go(e,l)});function Jo(e){var t=Dl(e);return t.__chain__=!0,t}function ea(e,t){return t(e)}var ta=ji(function(e){var t=e.length,l=t?e[0]:0,n=this.__wrapped__,i=function(t){return Gl(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Ol&&io(l)?((n=n.slice(l,+l+(t?1:0))).__actions__.push({func:ea,args:[i],thisArg:void 0}),new xl(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),la=gi(function(e,t,l){ye.call(e,l)?++e[l]:Kl(e,l,1)}),na=Ni(Oo),ia=Ni(wo);function oa(e,t){return(wa(e)?nt:Zl)(e,qi(t,3))}function aa(e,t){return(wa(e)?it:Jl)(e,qi(t,3))}var ra=gi(function(e,t,l){ye.call(e,l)?e[l].push(t):Kl(e,l,[t])}),da=Mn(function(e,t,l){var n=-1,i="function"==typeof t,o=Pa(e)?G(e.length):[];return Zl(e,function(e){o[++n]=i?tt(t,e,l):gn(e,t,l)}),o}),ua=gi(function(e,t,l){Kl(e,l,t)});function sa(e,t){return(wa(e)?ut:In)(e,qi(t,3))}var ca=gi(function(e,t,l){e[l?0:1].push(t)},function(){return[[],[]]}),va=Mn(function(e,t){if(null==e)return[];var l=t.length;return l>1&&oo(e,t[0],t[1])?t=[]:l>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),On(e,nn(t,1),[])}),ma=$t||function(){return je.Date.now()};function pa(e,t,l){return t=l?void 0:t,Fi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function Ea(e,t){var n;if("function"!=typeof t)throw new fe(l);return e=tr(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var fa=Mn(function(e,t,l){var n=1;if(l.length){var i=Wt(l,Yi(fa));n|=32}return Fi(e,n,t,l,i)}),ga=Mn(function(e,t,l){var n=3;if(l.length){var i=Wt(l,Yi(ga));n|=32}return Fi(t,n,e,l,i)});function _a(e,t,n){var i,o,a,r,d,u,s=0,c=!1,v=!1,m=!0;if("function"!=typeof e)throw new fe(l);function p(t){var l=i,n=o;return i=o=void 0,s=t,r=e.apply(n,l)}function E(e){return s=e,d=_o(g,t),c?p(e):r}function f(e){var l=e-u;return void 0===u||l>=t||l<0||v&&e-s>=a}function g(){var e=ma();if(f(e))return _(e);d=_o(g,function(e){var l=t-(e-u);return v?ol(l,a-(e-s)):l}(e))}function _(e){return d=void 0,m&&i?p(e):(i=o=void 0,r)}function h(){var e=ma(),l=f(e);if(i=arguments,o=this,u=e,l){if(void 0===d)return E(u);if(v)return di(d),d=_o(g,t),p(u)}return void 0===d&&(d=_o(g,t)),r}return t=nr(t)||0,Ha(n)&&(c=!!n.leading,a=(v="maxWait"in n)?il(nr(n.maxWait)||0,t):a,m="trailing"in n?!!n.trailing:m),h.cancel=function(){void 0!==d&&di(d),s=0,i=u=o=d=void 0},h.flush=function(){return void 0===d?r:_(ma())},h}var ha=Mn(function(e,t){return Xl(e,1,t)}),Ta=Mn(function(e,t,l){return Xl(e,nr(t)||0,l)});function ya(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new fe(l);var n=function(){var l=arguments,i=t?t.apply(this,l):l[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,l);return n.cache=o.set(i,a)||o,a};return n.cache=new(ya.Cache||Pl),n}function Sa(e){if("function"!=typeof e)throw new fe(l);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ya.Cache=Pl;var ba=ai(function(e,t){var l=(t=1==t.length&&wa(t[0])?ut(t[0],Ct(qi())):ut(nn(t,1),Ct(qi()))).length;return Mn(function(n){for(var i=-1,o=ol(n.length,l);++i<o;)n[i]=t[i].call(this,n[i]);return tt(e,this,n)})}),Na=Mn(function(e,t){return Fi(e,32,void 0,t,Wt(t,Yi(Na)))}),Ia=Mn(function(e,t){return Fi(e,64,void 0,t,Wt(t,Yi(Ia)))}),Da=ji(function(e,t){return Fi(e,256,void 0,void 0,void 0,t)});function Ca(e,t){return e===t||e!=e&&t!=t}var Aa=Li(mn),xa=Li(function(e,t){return e>=t}),Oa=_n(function(){return arguments}())?_n:function(e){return ja(e)&&ye.call(e,"callee")&&!Ke.call(e,"callee")},wa=G.isArray,La=$e?Ct($e):function(e){return ja(e)&&vn(e)==T};function Pa(e){return null!=e&&Ua(e.length)&&!Ba(e)}function Ra(e){return ja(e)&&Pa(e)}var ka=el||nd,Ma=Xe?Ct(Xe):function(e){return ja(e)&&vn(e)==d};function Fa(e){if(!ja(e))return!1;var t=vn(e);return t==u||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ka(e)}function Ba(e){if(!Ha(e))return!1;var t=vn(e);return t==s||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wa(e){return"number"==typeof e&&e==tr(e)}function Ua(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ha(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ja(e){return null!=e&&"object"==typeof e}var Va=Qe?Ct(Qe):function(e){return ja(e)&&eo(e)==v};function za(e){return"number"==typeof e||ja(e)&&vn(e)==m}function Ka(e){if(!ja(e)||vn(e)!=p)return!1;var t=Ve(e);if(null===t)return!0;var l=ye.call(t,"constructor")&&t.constructor;return"function"==typeof l&&l instanceof l&&Te.call(l)==Ie}var Ga=Ze?Ct(Ze):function(e){return ja(e)&&vn(e)==E},Ya=Je?Ct(Je):function(e){return ja(e)&&eo(e)==f};function qa(e){return"string"==typeof e||!wa(e)&&ja(e)&&vn(e)==g}function $a(e){return"symbol"==typeof e||ja(e)&&vn(e)==_}var Xa=et?Ct(et):function(e){return ja(e)&&Ua(e.length)&&!!ke[vn(e)]},Qa=Li(Nn),Za=Li(function(e,t){return e<=t});function Ja(e){if(!e)return[];if(Pa(e))return qa(e)?Vt(e):Ei(e);if(pt&&e[pt])return function(e){for(var t,l=[];!(t=e.next()).done;)l.push(t.value);return l}(e[pt]());var t=eo(e);return(t==v?Ft:t==f?Ut:Cr)(e)}function er(e){return e?(e=nr(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function tr(e){var t=er(e),l=t%1;return t==t?l?t-l:t:0}function lr(e){return e?Yl(tr(e),0,4294967295):0}function nr(e){if("number"==typeof e)return e;if($a(e))return NaN;if(Ha(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ha(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Dt(e);var l=le.test(e);return l||ie.test(e)?We(e.slice(2),l?2:8):te.test(e)?NaN:+e}function ir(e){return fi(e,hr(e))}function or(e){return null==e?"":$n(e)}var ar=_i(function(e,t){if(so(t)||Pa(t))fi(t,_r(t),e);else for(var l in t)ye.call(t,l)&&Hl(e,l,t[l])}),rr=_i(function(e,t){fi(t,hr(t),e)}),dr=_i(function(e,t,l,n){fi(t,hr(t),e,n)}),ur=_i(function(e,t,l,n){fi(t,_r(t),e,n)}),sr=ji(Gl),cr=Mn(function(e,t){e=me(e);var l=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(n=1);++l<n;)for(var o=t[l],a=hr(o),r=-1,d=a.length;++r<d;){var u=a[r],s=e[u];(void 0===s||Ca(s,_e[u])&&!ye.call(e,u))&&(e[u]=o[u])}return e}),vr=Mn(function(e){return e.push(void 0,Wi),tt(yr,void 0,e)});function mr(e,t,l){var n=null==e?void 0:sn(e,t);return void 0===n?l:n}function pr(e,t){return null!=e&&to(e,t,En)}var Er=Ci(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=l},Hr(zr)),fr=Ci(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),ye.call(e,t)?e[t].push(l):e[t]=[l]},qi),gr=Mn(gn);function _r(e){return Pa(e)?Ml(e):bn(e)}function hr(e){return Pa(e)?Ml(e,!0):function(e){if(!Ha(e))return function(e){var t=[];if(null!=e)for(var l in me(e))t.push(l);return t}(e);var t=so(e),l=[];for(var n in e)("constructor"!=n||!t&&ye.call(e,n))&&l.push(n);return l}(e)}var Tr=_i(function(e,t,l){An(e,t,l)}),yr=_i(function(e,t,l,n){An(e,t,l,n)}),Sr=ji(function(e,t){var l={};if(null==e)return l;var n=!1;t=ut(t,function(t){return t=oi(t,e),n||(n=t.length>1),t}),fi(e,zi(e),l),n&&(l=ql(l,7,Ui));for(var i=t.length;i--;)Qn(l,t[i]);return l}),br=ji(function(e,t){return null==e?{}:function(e,t){return wn(e,t,function(t,l){return pr(e,l)})}(e,t)});function Nr(e,t){if(null==e)return{};var l=ut(zi(e),function(e){return[e]});return t=qi(t),wn(e,l,function(e,l){return t(e,l[0])})}var Ir=Mi(_r),Dr=Mi(hr);function Cr(e){return null==e?[]:At(e,_r(e))}var Ar=Si(function(e,t,l){return t=t.toLowerCase(),e+(l?xr(t):t)});function xr(e){return Fr(or(e).toLowerCase())}function Or(e){return(e=or(e))&&e.replace(ae,Pt).replace(Ae,"")}var wr=Si(function(e,t,l){return e+(l?"-":"")+t.toLowerCase()}),Lr=Si(function(e,t,l){return e+(l?" ":"")+t.toLowerCase()}),Pr=yi("toLowerCase"),Rr=Si(function(e,t,l){return e+(l?"_":"")+t.toLowerCase()}),kr=Si(function(e,t,l){return e+(l?" ":"")+Fr(t)}),Mr=Si(function(e,t,l){return e+(l?" ":"")+t.toUpperCase()}),Fr=yi("toUpperCase");function Br(e,t,l){return e=or(e),void 0===(t=l?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(Oe)||[]}(e):function(e){return e.match(X)||[]}(e):e.match(t)||[]}var Wr=Mn(function(e,t){try{return tt(e,void 0,t)}catch(e){return Fa(e)?e:new se(e)}}),Ur=ji(function(e,t){return nt(t,function(t){t=No(t),Kl(e,t,fa(e[t],e))}),e});function Hr(e){return function(){return e}}var jr=Ii(),Vr=Ii(!0);function zr(e){return e}function Kr(e){return Sn("function"==typeof e?e:ql(e,1))}var Gr=Mn(function(e,t){return function(l){return gn(l,e,t)}}),Yr=Mn(function(e,t){return function(l){return gn(e,l,t)}});function qr(e,t,l){var n=_r(t),i=un(t,n);null!=l||Ha(t)&&(i.length||!n.length)||(l=t,t=e,e=this,i=un(t,_r(t)));var o=!(Ha(l)&&"chain"in l&&!l.chain),a=Ba(e);return nt(i,function(l){var n=t[l];e[l]=n,a&&(e.prototype[l]=function(){var t=this.__chain__;if(o||t){var l=e(this.__wrapped__),i=l.__actions__=Ei(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),l.__chain__=t,l}return n.apply(e,st([this.value()],arguments))})}),e}function $r(){}var Xr=xi(ut),Qr=xi(ot),Zr=xi(mt);function Jr(e){return ao(e)?yt(No(e)):function(e){return function(t){return sn(t,e)}}(e)}var ed=wi(),td=wi(!0);function ld(){return[]}function nd(){return!1}var id,od=Ai(function(e,t){return e+t},0),ad=Ri("ceil"),rd=Ai(function(e,t){return e/t},1),dd=Ri("floor"),ud=Ai(function(e,t){return e*t},1),sd=Ri("round"),cd=Ai(function(e,t){return e-t},0);return Dl.after=function(e,t){if("function"!=typeof t)throw new fe(l);return e=tr(e),function(){if(--e<1)return t.apply(this,arguments)}},Dl.ary=pa,Dl.assign=ar,Dl.assignIn=rr,Dl.assignInWith=dr,Dl.assignWith=ur,Dl.at=sr,Dl.before=Ea,Dl.bind=fa,Dl.bindAll=Ur,Dl.bindKey=ga,Dl.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return wa(e)?e:[e]},Dl.chain=Jo,Dl.chunk=function(e,t,l){t=(l?oo(e,t,l):void 0===t)?1:il(tr(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var i=0,o=0,a=G(Qt(n/t));i<n;)a[o++]=Vn(e,i,i+=t);return a},Dl.compact=function(e){for(var t=-1,l=null==e?0:e.length,n=0,i=[];++t<l;){var o=e[t];o&&(i[n++]=o)}return i},Dl.concat=function(){var e=arguments.length;if(!e)return[];for(var t=G(e-1),l=arguments[0],n=e;n--;)t[n-1]=arguments[n];return st(wa(l)?Ei(l):[l],nn(t,1))},Dl.cond=function(e){var t=null==e?0:e.length,n=qi();return e=t?ut(e,function(e){if("function"!=typeof e[1])throw new fe(l);return[n(e[0]),e[1]]}):[],Mn(function(l){for(var n=-1;++n<t;){var i=e[n];if(tt(i[0],this,l))return tt(i[1],this,l)}})},Dl.conforms=function(e){return function(e){var t=_r(e);return function(l){return $l(l,e,t)}}(ql(e,1))},Dl.constant=Hr,Dl.countBy=la,Dl.create=function(e,t){var l=Cl(e);return null==t?l:zl(l,t)},Dl.curry=function e(t,l,n){var i=Fi(t,8,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Dl.curryRight=function e(t,l,n){var i=Fi(t,16,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Dl.debounce=_a,Dl.defaults=cr,Dl.defaultsDeep=vr,Dl.defer=ha,Dl.delay=Ta,Dl.difference=Co,Dl.differenceBy=Ao,Dl.differenceWith=xo,Dl.drop=function(e,t,l){var n=null==e?0:e.length;return n?Vn(e,(t=l||void 0===t?1:tr(t))<0?0:t,n):[]},Dl.dropRight=function(e,t,l){var n=null==e?0:e.length;return n?Vn(e,0,(t=n-(t=l||void 0===t?1:tr(t)))<0?0:t):[]},Dl.dropRightWhile=function(e,t){return e&&e.length?Jn(e,qi(t,3),!0,!0):[]},Dl.dropWhile=function(e,t){return e&&e.length?Jn(e,qi(t,3),!0):[]},Dl.fill=function(e,t,l,n){var i=null==e?0:e.length;return i?(l&&"number"!=typeof l&&oo(e,t,l)&&(l=0,n=i),function(e,t,l,n){var i=e.length;for((l=tr(l))<0&&(l=-l>i?0:i+l),(n=void 0===n||n>i?i:tr(n))<0&&(n+=i),n=l>n?0:lr(n);l<n;)e[l++]=t;return e}(e,t,l,n)):[]},Dl.filter=function(e,t){return(wa(e)?at:ln)(e,qi(t,3))},Dl.flatMap=function(e,t){return nn(sa(e,t),1)},Dl.flatMapDeep=function(e,t){return nn(sa(e,t),1/0)},Dl.flatMapDepth=function(e,t,l){return l=void 0===l?1:tr(l),nn(sa(e,t),l)},Dl.flatten=Lo,Dl.flattenDeep=function(e){return null!=e&&e.length?nn(e,1/0):[]},Dl.flattenDepth=function(e,t){return null!=e&&e.length?nn(e,t=void 0===t?1:tr(t)):[]},Dl.flip=function(e){return Fi(e,512)},Dl.flow=jr,Dl.flowRight=Vr,Dl.fromPairs=function(e){for(var t=-1,l=null==e?0:e.length,n={};++t<l;){var i=e[t];n[i[0]]=i[1]}return n},Dl.functions=function(e){return null==e?[]:un(e,_r(e))},Dl.functionsIn=function(e){return null==e?[]:un(e,hr(e))},Dl.groupBy=ra,Dl.initial=function(e){return null!=e&&e.length?Vn(e,0,-1):[]},Dl.intersection=Ro,Dl.intersectionBy=ko,Dl.intersectionWith=Mo,Dl.invert=Er,Dl.invertBy=fr,Dl.invokeMap=da,Dl.iteratee=Kr,Dl.keyBy=ua,Dl.keys=_r,Dl.keysIn=hr,Dl.map=sa,Dl.mapKeys=function(e,t){var l={};return t=qi(t,3),rn(e,function(e,n,i){Kl(l,t(e,n,i),e)}),l},Dl.mapValues=function(e,t){var l={};return t=qi(t,3),rn(e,function(e,n,i){Kl(l,n,t(e,n,i))}),l},Dl.matches=function(e){return Dn(ql(e,1))},Dl.matchesProperty=function(e,t){return Cn(e,ql(t,1))},Dl.memoize=ya,Dl.merge=Tr,Dl.mergeWith=yr,Dl.method=Gr,Dl.methodOf=Yr,Dl.mixin=qr,Dl.negate=Sa,Dl.nthArg=function(e){return e=tr(e),Mn(function(t){return xn(t,e)})},Dl.omit=Sr,Dl.omitBy=function(e,t){return Nr(e,Sa(qi(t)))},Dl.once=function(e){return Ea(2,e)},Dl.orderBy=function(e,t,l,n){return null==e?[]:(wa(t)||(t=null==t?[]:[t]),wa(l=n?void 0:l)||(l=null==l?[]:[l]),On(e,t,l))},Dl.over=Xr,Dl.overArgs=ba,Dl.overEvery=Qr,Dl.overSome=Zr,Dl.partial=Na,Dl.partialRight=Ia,Dl.partition=ca,Dl.pick=br,Dl.pickBy=Nr,Dl.property=Jr,Dl.propertyOf=function(e){return function(t){return null==e?void 0:sn(e,t)}},Dl.pull=Bo,Dl.pullAll=Wo,Dl.pullAllBy=function(e,t,l){return e&&e.length&&t&&t.length?Ln(e,t,qi(l,2)):e},Dl.pullAllWith=function(e,t,l){return e&&e.length&&t&&t.length?Ln(e,t,void 0,l):e},Dl.pullAt=Uo,Dl.range=ed,Dl.rangeRight=td,Dl.rearg=Da,Dl.reject=function(e,t){return(wa(e)?at:ln)(e,Sa(qi(t,3)))},Dl.remove=function(e,t){var l=[];if(!e||!e.length)return l;var n=-1,i=[],o=e.length;for(t=qi(t,3);++n<o;){var a=e[n];t(a,n,e)&&(l.push(a),i.push(n))}return Pn(e,i),l},Dl.rest=function(e,t){if("function"!=typeof e)throw new fe(l);return Mn(e,t=void 0===t?t:tr(t))},Dl.reverse=Ho,Dl.sampleSize=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:tr(t),(wa(e)?Bl:Bn)(e,t)},Dl.set=function(e,t,l){return null==e?e:Wn(e,t,l)},Dl.setWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Wn(e,t,l,n)},Dl.shuffle=function(e){return(wa(e)?Wl:jn)(e)},Dl.slice=function(e,t,l){var n=null==e?0:e.length;return n?(l&&"number"!=typeof l&&oo(e,t,l)?(t=0,l=n):(t=null==t?0:tr(t),l=void 0===l?n:tr(l)),Vn(e,t,l)):[]},Dl.sortBy=va,Dl.sortedUniq=function(e){return e&&e.length?Yn(e):[]},Dl.sortedUniqBy=function(e,t){return e&&e.length?Yn(e,qi(t,2)):[]},Dl.split=function(e,t,l){return l&&"number"!=typeof l&&oo(e,t,l)&&(t=l=void 0),(l=void 0===l?4294967295:l>>>0)?(e=or(e))&&("string"==typeof t||null!=t&&!Ga(t))&&!(t=$n(t))&&Mt(e)?ri(Vt(e),0,l):e.split(t,l):[]},Dl.spread=function(e,t){if("function"!=typeof e)throw new fe(l);return t=null==t?0:il(tr(t),0),Mn(function(l){var n=l[t],i=ri(l,0,t);return n&&st(i,n),tt(e,this,i)})},Dl.tail=function(e){var t=null==e?0:e.length;return t?Vn(e,1,t):[]},Dl.take=function(e,t,l){return e&&e.length?Vn(e,0,(t=l||void 0===t?1:tr(t))<0?0:t):[]},Dl.takeRight=function(e,t,l){var n=null==e?0:e.length;return n?Vn(e,(t=n-(t=l||void 0===t?1:tr(t)))<0?0:t,n):[]},Dl.takeRightWhile=function(e,t){return e&&e.length?Jn(e,qi(t,3),!1,!0):[]},Dl.takeWhile=function(e,t){return e&&e.length?Jn(e,qi(t,3)):[]},Dl.tap=function(e,t){return t(e),e},Dl.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new fe(l);return Ha(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),_a(e,t,{leading:i,maxWait:t,trailing:o})},Dl.thru=ea,Dl.toArray=Ja,Dl.toPairs=Ir,Dl.toPairsIn=Dr,Dl.toPath=function(e){return wa(e)?ut(e,No):$a(e)?[e]:Ei(bo(or(e)))},Dl.toPlainObject=ir,Dl.transform=function(e,t,l){var n=wa(e),i=n||ka(e)||Xa(e);if(t=qi(t,4),null==l){var o=e&&e.constructor;l=i?n?new o:[]:Ha(e)&&Ba(o)?Cl(Ve(e)):{}}return(i?nt:rn)(e,function(e,n,i){return t(l,e,n,i)}),l},Dl.unary=function(e){return pa(e,1)},Dl.union=jo,Dl.unionBy=Vo,Dl.unionWith=zo,Dl.uniq=function(e){return e&&e.length?Xn(e):[]},Dl.uniqBy=function(e,t){return e&&e.length?Xn(e,qi(t,2)):[]},Dl.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xn(e,void 0,t):[]},Dl.unset=function(e,t){return null==e||Qn(e,t)},Dl.unzip=Ko,Dl.unzipWith=Go,Dl.update=function(e,t,l){return null==e?e:Zn(e,t,ii(l))},Dl.updateWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Zn(e,t,ii(l),n)},Dl.values=Cr,Dl.valuesIn=function(e){return null==e?[]:At(e,hr(e))},Dl.without=Yo,Dl.words=Br,Dl.wrap=function(e,t){return Na(ii(t),e)},Dl.xor=qo,Dl.xorBy=$o,Dl.xorWith=Xo,Dl.zip=Qo,Dl.zipObject=function(e,t){return li(e||[],t||[],Hl)},Dl.zipObjectDeep=function(e,t){return li(e||[],t||[],Wn)},Dl.zipWith=Zo,Dl.entries=Ir,Dl.entriesIn=Dr,Dl.extend=rr,Dl.extendWith=dr,qr(Dl,Dl),Dl.add=od,Dl.attempt=Wr,Dl.camelCase=Ar,Dl.capitalize=xr,Dl.ceil=ad,Dl.clamp=function(e,t,l){return void 0===l&&(l=t,t=void 0),void 0!==l&&(l=(l=nr(l))==l?l:0),void 0!==t&&(t=(t=nr(t))==t?t:0),Yl(nr(e),t,l)},Dl.clone=function(e){return ql(e,4)},Dl.cloneDeep=function(e){return ql(e,5)},Dl.cloneDeepWith=function(e,t){return ql(e,5,t="function"==typeof t?t:void 0)},Dl.cloneWith=function(e,t){return ql(e,4,t="function"==typeof t?t:void 0)},Dl.conformsTo=function(e,t){return null==t||$l(e,t,_r(t))},Dl.deburr=Or,Dl.defaultTo=function(e,t){return null==e||e!=e?t:e},Dl.divide=rd,Dl.endsWith=function(e,t,l){e=or(e),t=$n(t);var n=e.length,i=l=void 0===l?n:Yl(tr(l),0,n);return(l-=t.length)>=0&&e.slice(l,i)==t},Dl.eq=Ca,Dl.escape=function(e){return(e=or(e))&&M.test(e)?e.replace(R,Rt):e},Dl.escapeRegExp=function(e){return(e=or(e))&&z.test(e)?e.replace(V,"\\$&"):e},Dl.every=function(e,t,l){var n=wa(e)?ot:en;return l&&oo(e,t,l)&&(t=void 0),n(e,qi(t,3))},Dl.find=na,Dl.findIndex=Oo,Dl.findKey=function(e,t){return Et(e,qi(t,3),rn)},Dl.findLast=ia,Dl.findLastIndex=wo,Dl.findLastKey=function(e,t){return Et(e,qi(t,3),dn)},Dl.floor=dd,Dl.forEach=oa,Dl.forEachRight=aa,Dl.forIn=function(e,t){return null==e?e:on(e,qi(t,3),hr)},Dl.forInRight=function(e,t){return null==e?e:an(e,qi(t,3),hr)},Dl.forOwn=function(e,t){return e&&rn(e,qi(t,3))},Dl.forOwnRight=function(e,t){return e&&dn(e,qi(t,3))},Dl.get=mr,Dl.gt=Aa,Dl.gte=xa,Dl.has=function(e,t){return null!=e&&to(e,t,pn)},Dl.hasIn=pr,Dl.head=Po,Dl.identity=zr,Dl.includes=function(e,t,l,n){e=Pa(e)?e:Cr(e),l=l&&!n?tr(l):0;var i=e.length;return l<0&&(l=il(i+l,0)),qa(e)?l<=i&&e.indexOf(t,l)>-1:!!i&&gt(e,t,l)>-1},Dl.indexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:tr(l);return i<0&&(i=il(n+i,0)),gt(e,t,i)},Dl.inRange=function(e,t,l){return t=er(t),void 0===l?(l=t,t=0):l=er(l),function(e,t,l){return e>=ol(t,l)&&e<il(t,l)}(e=nr(e),t,l)},Dl.invoke=gr,Dl.isArguments=Oa,Dl.isArray=wa,Dl.isArrayBuffer=La,Dl.isArrayLike=Pa,Dl.isArrayLikeObject=Ra,Dl.isBoolean=function(e){return!0===e||!1===e||ja(e)&&vn(e)==r},Dl.isBuffer=ka,Dl.isDate=Ma,Dl.isElement=function(e){return ja(e)&&1===e.nodeType&&!Ka(e)},Dl.isEmpty=function(e){if(null==e)return!0;if(Pa(e)&&(wa(e)||"string"==typeof e||"function"==typeof e.splice||ka(e)||Xa(e)||Oa(e)))return!e.length;var t=eo(e);if(t==v||t==f)return!e.size;if(so(e))return!bn(e).length;for(var l in e)if(ye.call(e,l))return!1;return!0},Dl.isEqual=function(e,t){return hn(e,t)},Dl.isEqualWith=function(e,t,l){var n=(l="function"==typeof l?l:void 0)?l(e,t):void 0;return void 0===n?hn(e,t,void 0,l):!!n},Dl.isError=Fa,Dl.isFinite=function(e){return"number"==typeof e&&tl(e)},Dl.isFunction=Ba,Dl.isInteger=Wa,Dl.isLength=Ua,Dl.isMap=Va,Dl.isMatch=function(e,t){return e===t||Tn(e,t,Xi(t))},Dl.isMatchWith=function(e,t,l){return l="function"==typeof l?l:void 0,Tn(e,t,Xi(t),l)},Dl.isNaN=function(e){return za(e)&&e!=+e},Dl.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return yn(e)},Dl.isNil=function(e){return null==e},Dl.isNull=function(e){return null===e},Dl.isNumber=za,Dl.isObject=Ha,Dl.isObjectLike=ja,Dl.isPlainObject=Ka,Dl.isRegExp=Ga,Dl.isSafeInteger=function(e){return Wa(e)&&e>=-9007199254740991&&e<=9007199254740991},Dl.isSet=Ya,Dl.isString=qa,Dl.isSymbol=$a,Dl.isTypedArray=Xa,Dl.isUndefined=function(e){return void 0===e},Dl.isWeakMap=function(e){return ja(e)&&eo(e)==h},Dl.isWeakSet=function(e){return ja(e)&&"[object WeakSet]"==vn(e)},Dl.join=function(e,t){return null==e?"":ll.call(e,t)},Dl.kebabCase=wr,Dl.last=Fo,Dl.lastIndexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n;return void 0!==l&&(i=(i=tr(l))<0?il(n+i,0):ol(i,n-1)),t==t?function(e,t,l){for(var n=l+1;n--;)if(e[n]===t)return n;return n}(e,t,i):ft(e,ht,i,!0)},Dl.lowerCase=Lr,Dl.lowerFirst=Pr,Dl.lt=Qa,Dl.lte=Za,Dl.max=function(e){return e&&e.length?tn(e,zr,mn):void 0},Dl.maxBy=function(e,t){return e&&e.length?tn(e,qi(t,2),mn):void 0},Dl.mean=function(e){return Tt(e,zr)},Dl.meanBy=function(e,t){return Tt(e,qi(t,2))},Dl.min=function(e){return e&&e.length?tn(e,zr,Nn):void 0},Dl.minBy=function(e,t){return e&&e.length?tn(e,qi(t,2),Nn):void 0},Dl.stubArray=ld,Dl.stubFalse=nd,Dl.stubObject=function(){return{}},Dl.stubString=function(){return""},Dl.stubTrue=function(){return!0},Dl.multiply=ud,Dl.nth=function(e,t){return e&&e.length?xn(e,tr(t)):void 0},Dl.noConflict=function(){return je._===this&&(je._=De),this},Dl.noop=$r,Dl.now=ma,Dl.pad=function(e,t,l){e=or(e);var n=(t=tr(t))?jt(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Oi(Zt(i),l)+e+Oi(Qt(i),l)},Dl.padEnd=function(e,t,l){e=or(e);var n=(t=tr(t))?jt(e):0;return t&&n<t?e+Oi(t-n,l):e},Dl.padStart=function(e,t,l){e=or(e);var n=(t=tr(t))?jt(e):0;return t&&n<t?Oi(t-n,l)+e:e},Dl.parseInt=function(e,t,l){return l||null==t?t=0:t&&(t=+t),rl(or(e).replace(K,""),t||0)},Dl.random=function(e,t,l){if(l&&"boolean"!=typeof l&&oo(e,t,l)&&(t=l=void 0),void 0===l&&("boolean"==typeof t?(l=t,t=void 0):"boolean"==typeof e&&(l=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=er(e),void 0===t?(t=e,e=0):t=er(t)),e>t){var n=e;e=t,t=n}if(l||e%1||t%1){var i=dl();return ol(e+i*(t-e+Be("1e-"+((i+"").length-1))),t)}return Rn(e,t)},Dl.reduce=function(e,t,l){var n=wa(e)?ct:bt,i=arguments.length<3;return n(e,qi(t,4),l,i,Zl)},Dl.reduceRight=function(e,t,l){var n=wa(e)?vt:bt,i=arguments.length<3;return n(e,qi(t,4),l,i,Jl)},Dl.repeat=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:tr(t),kn(or(e),t)},Dl.replace=function(){var e=arguments,t=or(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dl.result=function(e,t,l){var n=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++n<i;){var o=null==e?void 0:e[No(t[n])];void 0===o&&(n=i,o=l),e=Ba(o)?o.call(e):o}return e},Dl.round=sd,Dl.runInContext=e,Dl.sample=function(e){return(wa(e)?Fl:Fn)(e)},Dl.size=function(e){if(null==e)return 0;if(Pa(e))return qa(e)?jt(e):e.length;var t=eo(e);return t==v||t==f?e.size:bn(e).length},Dl.snakeCase=Rr,Dl.some=function(e,t,l){var n=wa(e)?mt:zn;return l&&oo(e,t,l)&&(t=void 0),n(e,qi(t,3))},Dl.sortedIndex=function(e,t){return Kn(e,t)},Dl.sortedIndexBy=function(e,t,l){return Gn(e,t,qi(l,2))},Dl.sortedIndexOf=function(e,t){var l=null==e?0:e.length;if(l){var n=Kn(e,t);if(n<l&&Ca(e[n],t))return n}return-1},Dl.sortedLastIndex=function(e,t){return Kn(e,t,!0)},Dl.sortedLastIndexBy=function(e,t,l){return Gn(e,t,qi(l,2),!0)},Dl.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var l=Kn(e,t,!0)-1;if(Ca(e[l],t))return l}return-1},Dl.startCase=kr,Dl.startsWith=function(e,t,l){return e=or(e),l=null==l?0:Yl(tr(l),0,e.length),t=$n(t),e.slice(l,l+t.length)==t},Dl.subtract=cd,Dl.sum=function(e){return e&&e.length?Nt(e,zr):0},Dl.sumBy=function(e,t){return e&&e.length?Nt(e,qi(t,2)):0},Dl.template=function(e,t,l){var n=Dl.templateSettings;l&&oo(e,t,l)&&(t=void 0),e=or(e),t=dr({},t,n,Bi);var i,o,a=dr({},t.imports,n.imports,Bi),r=_r(a),d=At(a,r),u=0,s=t.interpolate||re,c="__p += '",v=pe((t.escape||re).source+"|"+s.source+"|"+(s===W?J:re).source+"|"+(t.evaluate||re).source+"|$","g"),m="//# sourceURL="+(ye.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Re+"]")+"\n";e.replace(v,function(t,l,n,a,r,d){return n||(n=a),c+=e.slice(u,d).replace(de,kt),l&&(i=!0,c+="' +\n__e("+l+") +\n'"),r&&(o=!0,c+="';\n"+r+";\n__p += '"),n&&(c+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=d+t.length,t}),c+="';\n";var p=ye.call(t,"variable")&&t.variable;if(p){if(Q.test(p))throw new se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(o?c.replace(O,""):c).replace(w,"$1").replace(L,"$1;"),c="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var E=Wr(function(){return ce(r,m+"return "+c).apply(void 0,d)});if(E.source=c,Fa(E))throw E;return E},Dl.times=function(e,t){if((e=tr(e))<1||e>9007199254740991)return[];var l=4294967295,n=ol(e,4294967295);e-=4294967295;for(var i=It(n,t=qi(t));++l<e;)t(l);return i},Dl.toFinite=er,Dl.toInteger=tr,Dl.toLength=lr,Dl.toLower=function(e){return or(e).toLowerCase()},Dl.toNumber=nr,Dl.toSafeInteger=function(e){return e?Yl(tr(e),-9007199254740991,9007199254740991):0===e?e:0},Dl.toString=or,Dl.toUpper=function(e){return or(e).toUpperCase()},Dl.trim=function(e,t,l){if((e=or(e))&&(l||void 0===t))return Dt(e);if(!e||!(t=$n(t)))return e;var n=Vt(e),i=Vt(t);return ri(n,Ot(n,i),wt(n,i)+1).join("")},Dl.trimEnd=function(e,t,l){if((e=or(e))&&(l||void 0===t))return e.slice(0,zt(e)+1);if(!e||!(t=$n(t)))return e;var n=Vt(e);return ri(n,0,wt(n,Vt(t))+1).join("")},Dl.trimStart=function(e,t,l){if((e=or(e))&&(l||void 0===t))return e.replace(K,"");if(!e||!(t=$n(t)))return e;var n=Vt(e);return ri(n,Ot(n,Vt(t))).join("")},Dl.truncate=function(e,t){var l=30,n="...";if(Ha(t)){var i="separator"in t?t.separator:i;l="length"in t?tr(t.length):l,n="omission"in t?$n(t.omission):n}var o=(e=or(e)).length;if(Mt(e)){var a=Vt(e);o=a.length}if(l>=o)return e;var r=l-jt(n);if(r<1)return n;var d=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return d+n;if(a&&(r+=d.length-r),Ga(i)){if(e.slice(r).search(i)){var u,s=d;for(i.global||(i=pe(i.source,or(ee.exec(i))+"g")),i.lastIndex=0;u=i.exec(s);)var c=u.index;d=d.slice(0,void 0===c?r:c)}}else if(e.indexOf($n(i),r)!=r){var v=d.lastIndexOf(i);v>-1&&(d=d.slice(0,v))}return d+n},Dl.unescape=function(e){return(e=or(e))&&k.test(e)?e.replace(P,Kt):e},Dl.uniqueId=function(e){var t=++Se;return or(e)+t},Dl.upperCase=Mr,Dl.upperFirst=Fr,Dl.each=oa,Dl.eachRight=aa,Dl.first=Po,qr(Dl,(id={},rn(Dl,function(e,t){ye.call(Dl.prototype,t)||(id[t]=e)}),id),{chain:!1}),Dl.VERSION="4.17.21",nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Dl[e].placeholder=Dl}),nt(["drop","take"],function(e,t){Ol.prototype[e]=function(l){l=void 0===l?1:il(tr(l),0);var n=this.__filtered__&&!t?new Ol(this):this.clone();return n.__filtered__?n.__takeCount__=ol(l,n.__takeCount__):n.__views__.push({size:ol(l,4294967295),type:e+(n.__dir__<0?"Right":"")}),n},Ol.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),nt(["filter","map","takeWhile"],function(e,t){var l=t+1,n=1==l||3==l;Ol.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:qi(e,3),type:l}),t.__filtered__=t.__filtered__||n,t}}),nt(["head","last"],function(e,t){var l="take"+(t?"Right":"");Ol.prototype[e]=function(){return this[l](1).value()[0]}}),nt(["initial","tail"],function(e,t){var l="drop"+(t?"":"Right");Ol.prototype[e]=function(){return this.__filtered__?new Ol(this):this[l](1)}}),Ol.prototype.compact=function(){return this.filter(zr)},Ol.prototype.find=function(e){return this.filter(e).head()},Ol.prototype.findLast=function(e){return this.reverse().find(e)},Ol.prototype.invokeMap=Mn(function(e,t){return"function"==typeof e?new Ol(this):this.map(function(l){return gn(l,e,t)})}),Ol.prototype.reject=function(e){return this.filter(Sa(qi(e)))},Ol.prototype.slice=function(e,t){e=tr(e);var l=this;return l.__filtered__&&(e>0||t<0)?new Ol(l):(e<0?l=l.takeRight(-e):e&&(l=l.drop(e)),void 0!==t&&(l=(t=tr(t))<0?l.dropRight(-t):l.take(t-e)),l)},Ol.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ol.prototype.toArray=function(){return this.take(4294967295)},rn(Ol.prototype,function(e,t){var l=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=Dl[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);i&&(Dl.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,r=t instanceof Ol,d=a[0],u=r||wa(t),s=function(e){var t=i.apply(Dl,st([e],a));return n&&c?t[0]:t};u&&l&&"function"==typeof d&&1!=d.length&&(r=u=!1);var c=this.__chain__,v=!!this.__actions__.length,m=o&&!c,p=r&&!v;if(!o&&u){t=p?t:new Ol(this);var E=e.apply(t,a);return E.__actions__.push({func:ea,args:[s],thisArg:void 0}),new xl(E,c)}return m&&p?e.apply(this,a):(E=this.thru(s),m?n?E.value()[0]:E.value():E)})}),nt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[e],l=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Dl.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(wa(i)?i:[],e)}return this[l](function(l){return t.apply(wa(l)?l:[],e)})}}),rn(Ol.prototype,function(e,t){var l=Dl[t];if(l){var n=l.name+"";ye.call(gl,n)||(gl[n]=[]),gl[n].push({name:t,func:l})}}),gl[Di(void 0,2).name]=[{name:"wrapper",func:void 0}],Ol.prototype.clone=function(){var e=new Ol(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Ol.prototype.reverse=function(){if(this.__filtered__){var e=new Ol(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ol.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,l=wa(e),n=t<0,i=l?e.length:0,o=function(e,t,l){for(var n=-1,i=l.length;++n<i;){var o=l[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=ol(t,e+a);break;case"takeRight":e=il(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,d=r-a,u=n?r:a-1,s=this.__iteratees__,c=s.length,v=0,m=ol(d,this.__takeCount__);if(!l||!n&&i==d&&m==d)return ei(e,this.__actions__);var p=[];e:for(;d--&&v<m;){for(var E=-1,f=e[u+=t];++E<c;){var g=s[E],_=g.type,h=(0,g.iteratee)(f);if(2==_)f=h;else if(!h){if(1==_)continue e;break e}}p[v++]=f}return p},Dl.prototype.at=ta,Dl.prototype.chain=function(){return Jo(this)},Dl.prototype.commit=function(){return new xl(this.value(),this.__chain__)},Dl.prototype.next=function(){void 0===this.__values__&&(this.__values__=Ja(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Dl.prototype.plant=function(e){for(var t,l=this;l instanceof Al;){var n=Do(l);n.__index__=0,n.__values__=void 0,t?i.__wrapped__=n:t=n;var i=n;l=l.__wrapped__}return i.__wrapped__=e,t},Dl.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ol){var t=e;return this.__actions__.length&&(t=new Ol(this)),(t=t.reverse()).__actions__.push({func:ea,args:[Ho],thisArg:void 0}),new xl(t,this.__chain__)}return this.thru(Ho)},Dl.prototype.toJSON=Dl.prototype.valueOf=Dl.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Dl.prototype.first=Dl.prototype.head,pt&&(Dl.prototype[pt]=function(){return this}),Dl}();Ke?((Ke.exports=Gt)._=Gt,Ve._=Gt):je._=Gt}).call(ze)});const jt=e=>{var l,o,a;let{data:r,OpenImage:d}=e;const{t:u}=i.useTranslation();return n.createElement("div",null,r.date&&n.createElement("p",null,r.date),n.createElement("p",null,r.name),r.mobileNumber&&n.createElement(t.TelePhone,{mobile:r.mobileNumber}),r.source&&n.createElement("p",null,u("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),null!=r&&r.wfComment?n.createElement("div",null,null==r||null===(l=r.wfComment)||void 0===l?void 0:l.map(e=>n.createElement("div",{className:"TLComments"},n.createElement("h3",null,u("WF_COMMON_COMMENTS")),n.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(o=r.thumbnailsToShow)||void 0===o||null===(a=o.thumbs)||void 0===a?void 0:a.length)>0?n.createElement("div",{className:"TLComments"},n.createElement("h3",null,u("CS_COMMON_ATTACHMENTS")),n.createElement(t.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:()=>{d(null==r?void 0:r.thumbnailsToShow)}})):null)},Vt=e=>{var a,r,d,u,s,c;let v=null==e||null===(a=e.application)||void 0===a?void 0:a.bookingNo.split("-")[0];const{t:m}=i.useTranslation(),p="WT"==v?"watertanker":"MT"===v?"mobileToilet":"TP"===v?"treePruning":"unknown",E="WT"===v?"request-service.water_tanker":"MT"===v?"request-service.mobile_toilet":"TP"===v?"request-service.tree_pruning":"request-service.unknown",{isLoading:f,data:g}=Digit.Hooks.useWorkflowDetails({tenantId:null===(r=e.application)||void 0===r?void 0:r.tenantId,id:null===(d=e.application)||void 0===d?void 0:d.bookingNo,moduleCode:p});function _(e){var t;window.open(null==e||null===(t=e.fullImage)||void 0===t?void 0:t[0],"_blank")}const h=t=>{if("OPEN"===t.state){var l,i;const o={date:null==t||null===(l=t.auditDetails)||void 0===l?void 0:l.lastModified,source:(null===(i=e.application)||void 0===i?void 0:i.channel)||""};return n.createElement(jt,{data:o})}if(t.state){var o,a,r,d,u;const e={date:null==t||null===(o=t.auditDetails)||void 0===o?void 0:o.lastModified,name:null==t||null===(a=t.assignes)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.name,mobileNumber:null==t||null===(d=t.assignes)||void 0===d||null===(u=d[0])||void 0===u?void 0:u.mobileNumber,comment:m(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return n.createElement(jt,{data:e,OpenImage:_})}{var s,c;const l={date:Digit.DateUtils.ConvertTimestampToDate(null===(s=e.application)||void 0===s?void 0:s.auditDetails.lastModified),name:null==t||null===(c=t.assigner)||void 0===c?void 0:c.name,comment:m(null==t?void 0:t.comment)};return n.createElement(jt,{data:l})}};return f?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,!f&&n.createElement(l.Fragment,null,(null==g||null===(u=g.timeline)||void 0===u?void 0:u.length)>0&&n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},m("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=g&&g.timeline&&1===(null==g||null===(s=g.timeline)||void 0===s?void 0:s.length)?n.createElement(t.CheckPoint,{isCompleted:!0,label:m((null==g||null===(c=g.timeline[0])||void 0===c?void 0:c.state)&&""+g.timeline[0].state||"NA"),customChild:h(null==g?void 0:g.timeline[0])}):n.createElement(t.ConnectingCheckPoints,null,(null==g?void 0:g.timeline)&&(null==g?void 0:g.timeline.map((e,l)=>{var i;return n.createElement(n.Fragment,{key:l},n.createElement(t.CheckPoint,{keyValue:l,isCompleted:0===l,label:m(""+(null==g||null===(i=g.processInstances[l].state)||void 0===i?void 0:i.state)),customChild:h(e)}))})))),g&&(l=>{var i,a;let r=l[0];switch(null==r?void 0:r.action){case"PAY":return"citizen"===(null==e?void 0:e.userType)?n.createElement("div",{style:{marginTop:"1em",bottom:"0px",width:"100%",marginBottom:"1.2em"}},n.createElement(o.Link,{to:{pathname:`/digit-ui/citizen/payment/my-bills/${E}/${null==e||null===(i=e.application)||void 0===i?void 0:i.bookingNo}`,state:{tenantId:e.application.tenantId,bookingNo:null==e||null===(a=e.application)||void 0===a?void 0:a.bookingNo}}},n.createElement(t.SubmitBar,{label:m("CS_APPLICATION_DETAILS_MAKE_PAYMENT")}))):null;default:return null}})(null==g?void 0:g.nextActions))},zt=e=>n.createElement("span",{className:"cell-text"},e),Kt=e=>{const t=(e=>{var t,l,n,i;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.auditDetails)||void 0===l?void 0:l.createdTime)||(null==e||null===(n=e.workflowData)||void 0===n||null===(i=n.auditDetails)||void 0===i?void 0:i.createdTime)})(e);return t?`${Digit.DateUtils.ConvertEpochToDate(t)} ${Digit.DateUtils.ConvertEpochToTimeInHours(t)}`:""},Gt=e=>{var t;const l=null==e||null===(t=e.searchData)||void 0===t?void 0:t.driverTripReport;if(Array.isArray(l)&&l.length>0){var n,i;const e=null===(n=l[0])||void 0===n||null===(i=n.auditDetails)||void 0===i?void 0:i.lastModifiedTime;if(e)return`${Digit.DateUtils.ConvertEpochToDate(e)} ${Digit.DateUtils.ConvertEpochToTimeInHours(e)}`}return"-"},Yt=e=>n.createElement("span",{className:"sla-cell"},e),qt=(e,t,l)=>e?l(`${(t||Digit.ULBService.getCurrentTenantId()||"djb").replace(".","_").toUpperCase()}_REVENUE_${e}`):"",$t=e=>{var t;return(null==e||null===(t=e.vendor)||void 0===t?void 0:t.name)||(null==e?void 0:e.vendorName)||"-"},Xt=e=>{var t,l;const n=(null==e?void 0:e.vehicle)||(null==e||null===(t=e.vendor)||void 0===t||null===(l=t.vehicles)||void 0===l?void 0:l.find(t=>(null==t?void 0:t.id)===(null==e?void 0:e.vehicleId)));return(null==n?void 0:n.registrationNumber)||(null==n?void 0:n.name)||(null==n?void 0:n.type)||(null==e?void 0:e.vehicleName)||(null==e?void 0:e.vehicleRegistrationNo)||"-"},Qt=e=>{var t,l,n;const i=(null==e?void 0:e.driver)||(null==e||null===(t=e.vendor)||void 0===t||null===(l=t.drivers)||void 0===l?void 0:l.find(t=>{var l;return(null==t?void 0:t.id)===(null==e?void 0:e.driverId)||(null==t?void 0:t.ownerId)===(null==e?void 0:e.driverId)||(null==t||null===(l=t.owner)||void 0===l?void 0:l.uuid)===(null==e?void 0:e.driverId)}));return(null==i?void 0:i.name)||(null==i||null===(n=i.owner)||void 0===n?void 0:n.name)||(null==e?void 0:e.driverName)||"-"},Zt=e=>{var o;let{searchParams:r,onFilterChange:d,defaultSearchParams:u,moduleCode:s,...c}=e;const{t:v}=i.useTranslation(),[m,p]=(a.useQueryClient(),l.useState(()=>({...r,services:[]})));l.useEffect(()=>{p({...r,services:(null==r?void 0:r.services)||[]})},[r]);const E="TP"===s?[{i18nKey:"TP_BOOKING_CREATED",code:"BOOKING_CREATED",value:v("TP_BOOKING_CREATED"),uuid:"BOOKING_CREATED"},{i18nKey:"TP_PENDING_FOR_APPROVAL",code:"PENDING_FOR_APPROVAL",value:v("TP_PENDING_FOR_APPROVAL"),uuid:"PENDING_FOR_APPROVAL"},{i18nKey:"TP_PAYMENT_PENDING",code:"PAYMENT_PENDING",value:v("TP_PAYMENT_PENDING"),uuid:"PAYMENT_PENDING"},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_VERIFICATION",code:"TEAM_ASSIGNMENT_FOR_VERIFICATION",value:v("TP_TEAM_ASSIGNMENT_FOR_VERIFICATION"),uuid:"TEAM_ASSIGNMENT_FOR_VERIFICATION"},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_EXECUTION",code:"TEAM_ASSIGNMENT_FOR_EXECUTION",value:v("TP_TEAM_ASSIGNMENT_FOR_EXECUTION"),uuid:"TEAM_ASSIGNMENT_FOR_EXECUTION"},{i18nKey:"TP_TREE_PRUNING_SERVICE_COMPLETED",code:"TREE_PRUNING_SERVICE_COMPLETED",value:v("TP_TREE_PRUNING_SERVICE_COMPLETED"),uuid:"TREE_PRUNING_SERVICE_COMPLETED"}]:[{i18nKey:"WT_SCHEDULED",code:"SCHEDULED",value:v("WT_SCHEDULED"),uuid:"SCHEDULED"},{i18nKey:"WT_IN_TRANSIT",code:"IN_TRANSIT",value:v("WT_IN_TRANSIT"),uuid:"IN_TRANSIT"},{i18nKey:"WT_TANKER_DELIVERED",code:"TANKER_DELIVERED",value:v("WT_TANKER_DELIVERED"),uuid:"TANKER_DELIVERED"},{i18nKey:"WT_MISSED",code:"MISSED",value:v("WT_MISSED"),uuid:"MISSED"},{i18nKey:"WT_CANCELLED",code:"CANCELLED",value:v("WT_CANCELLED"),uuid:"CANCELLED"}],f=e=>{let t=e.delete,l={...m,...e};t&&t.forEach(e=>delete l[e]),delete e.delete,p({...l})},g=()=>{const e={...u,services:(null==u?void 0:u.services)||(null==r?void 0:r.services)||[],status:null,applicationStatus:null,fromDate:"",toDate:"",fillingPointId:null,fillingPoint:null};p(e),d(e)};return Digit.ULBService.getCurrentTenantId(),n.createElement(n.Fragment,null,n.createElement("div",{className:"filter-card"},n.createElement("div",{className:"heading",style:{alignItems:"center"}},n.createElement("div",{className:"filter-label",style:{display:"flex",alignItems:"center"}},n.createElement("span",null,n.createElement("svg",{width:"17",height:"17",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M0.66666 2.48016C3.35999 5.9335 8.33333 12.3335 8.33333 12.3335V20.3335C8.33333 21.0668 8.93333 21.6668 9.66666 21.6668H12.3333C13.0667 21.6668 13.6667 21.0668 13.6667 20.3335V12.3335C13.6667 12.3335 18.6267 5.9335 21.32 2.48016C22 1.60016 21.3733 0.333496 20.2667 0.333496H1.71999C0.613327 0.333496 -0.01334 1.60016 0.66666 2.48016Z",fill:"#505A5F"}))),n.createElement("span",{style:{marginLeft:"8px",fontWeight:"normal"}},v("ES_COMMON_FILTER_BY"),":")),n.createElement("div",{className:"clearAll",onClick:g,style:{cursor:"pointer"}},v("ES_COMMON_CLEAR_ALL")),"desktop"===c.type&&n.createElement("span",{className:"clear-search",onClick:g,style:{border:"1px solid #e0e0e0",padding:"6px",minWidth:"fit-content",cursor:"pointer"}},n.createElement("svg",{width:"17",height:"17",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M8 5V8L12 4L8 0V3C3.58 3 0 6.58 0 11C0 12.57 0.46 14.03 1.24 15.26L2.7 13.8C2.25 12.97 2 12.01 2 11C2 7.69 4.69 5 8 5ZM14.76 6.74L13.3 8.2C13.74 9.04 14 9.99 14 11C14 14.31 11.31 17 8 17V14L4 18L8 22V19C12.42 19 16 15.42 16 11C16 9.43 15.54 7.97 14.76 6.74Z",fill:"#505A5F"}))),"mobile"===c.type&&n.createElement("span",{onClick:c.onClose,style:{cursor:"pointer"}},n.createElement(t.CloseSvg,null))),n.createElement("div",{id:"filter-form",className:"filter-form"},n.createElement("div",{className:"filter-form-field"},n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,v("PT_COMMON_TABLE_COL_STATUS_LABEL")),n.createElement(t.Dropdown,{selected:null==m?void 0:m.status,select:e=>f({status:e,applicationStatus:e?[e]:null}),option:E,optionKey:"i18nKey",t:v})),n.createElement("div",{className:"search-field-wrapper",style:{marginTop:"16px"}},n.createElement("label",null,v("FROM_DATE")),n.createElement(t.DatePicker,{date:"number"==typeof(null==m?void 0:m.fromDate)?(()=>{const e=new Date(m.fromDate);return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`})():null==m?void 0:m.fromDate,onChange:e=>{if(e){const t=e.split("-"),l=new Date(t[0],t[1]-1,t[2]);l.setHours(0,0,0,0),f({fromDate:l.getTime()})}else f({fromDate:""})},max:(new Date).toISOString().split("T")[0]})),n.createElement("div",{className:"search-field-wrapper",style:{marginTop:"16px"}},n.createElement("label",null,v("TO_DATE")),n.createElement(t.DatePicker,{date:"number"==typeof(null==m?void 0:m.toDate)?(()=>{const e=new Date(m.toDate);return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`})():null==m?void 0:m.toDate,onChange:e=>{if(e){const t=e.split("-"),l=new Date(t[0],t[1]-1,t[2]);l.setHours(23,59,59,999),f({toDate:l.getTime()})}else f({toDate:""})},max:(new Date).toISOString().split("T")[0]})),n.createElement("div",{className:"tag-container hide-x-scrollbar"},null==m||null===(o=m.locality)||void 0===o?void 0:o.map((e,l)=>n.createElement(t.RemoveableTag,{key:l,text:v(e.i18nkey),onClick:()=>{const t=null==m?void 0:m.locality.filter(t=>t.code!==e.code);f({locality:t}),d({...m,locality:t})}})))),n.createElement("div",null,n.createElement(t.SubmitBar,{className:"w-fullwidth",onSubmit:()=>{var e;0===(null===(e=m.services)||void 0===e?void 0:e.length)&&null!=u&&u.services?d({...m,services:u.services}):d(m)},label:v("ES_COMMON_APPLY")})))))},Jt=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),el=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Jt,null)),tl=e=>null==e?"":String(e),ll=function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];return t.find(e=>null!=e&&""!==e)},nl=function(e,t){return void 0===t&&(t=[]),t.map(tl).filter(Boolean).some(t=>tl(e)===t)},il=e=>{var i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,h,T,y,S,b,N,I,D;let{t:C,applicationData:A,closeModal:x}=e;console.log("Application Data in Edit Modal:",A);const O=Digit.ULBService.getCurrentTenantId(),w=Digit.ULBService.getStateId(),[L,P]=l.useState({owner:{},address:{},requestDetails:{},dispatchDetails:{}}),{data:R}=Digit.Hooks.fsm.useVendorSearch({tenantId:O,filters:{...ll(null==L||null===(i=L.dispatchDetails)||void 0===i||null===(o=i.fillingPoint)||void 0===o?void 0:o.id,null==L||null===(a=L.dispatchDetails)||void 0===a||null===(r=a.fillingPoint)||void 0===r?void 0:r.fillingPointId,null==L||null===(d=L.dispatchDetails)||void 0===d||null===(u=d.fillingPoint)||void 0===u?void 0:u.bookingId)?{fillingPointId:ll(null==L||null===(s=L.dispatchDetails)||void 0===s||null===(c=s.fillingPoint)||void 0===c?void 0:c.id,null==L||null===(v=L.dispatchDetails)||void 0===v||null===(m=v.fillingPoint)||void 0===m?void 0:m.fillingPointId,null==L||null===(p=L.dispatchDetails)||void 0===p||null===(E=p.fillingPoint)||void 0===E?void 0:E.bookingId)}:{}},config:{enabled:!!ll(null==L||null===(f=L.dispatchDetails)||void 0===f||null===(g=f.fillingPoint)||void 0===g?void 0:g.id,null==L||null===(_=L.dispatchDetails)||void 0===_||null===(h=_.fillingPoint)||void 0===h?void 0:h.fillingPointId,null==L||null===(T=L.dispatchDetails)||void 0===T||null===(y=T.fillingPoint)||void 0===y?void 0:y.bookingId,null==A?void 0:A.fillingPointId)}}),{data:k}=Digit.Hooks.useCustomMDMS(w,"request-service",[{name:"VehicleType"}],{select:e=>{var t;return(null==e||null===(t=e["request-service"])||void 0===t?void 0:t.VehicleType)||[]}}),{data:M}=Digit.Hooks.useCustomMDMS(w,"request-service",[{name:"TankerType"}],{select:e=>{var t;return(null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerType)||[]}}),{data:F}=Digit.Hooks.useCustomMDMS(w,"request-service",[{name:"TankerQuantity"}],{select:e=>{var t;return(null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerQuantity)||[]}}),{data:B}=Digit.Hooks.useCustomMDMS(w,"Request-service",[{name:"WaterType"}],{select:e=>{var t;return(null==e||null===(t=e["Request-service"])||void 0===t?void 0:t.WaterType)||[]}}),{data:W}=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:O,filters:{limit:1e3}},{enabled:!0}),{data:U}=Digit.Hooks.wt.useFillPointSearch({tenantId:O,filters:{limit:1e3}},{enabled:!0}),H=Digit.Hooks.wt.useUpdateEmergencyBooking(O);l.useEffect(()=>{if(A){var e,t,l,n,i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,h,T,y,S,b,N,I,D;const C=(null==M?void 0:M.find(e=>nl(e.code,[A.tankerType])))||{code:A.tankerType,i18nKey:A.tankerType},x=((null==F?void 0:F.map(e=>({i18nKey:""+e.code,code:""+e.code,value:""+e.code})))||[]).find(e=>nl(e.code,[A.tankerQuantity]))||{code:""+((null==A?void 0:A.tankerQuantity)||""),i18nKey:""+((null==A?void 0:A.tankerQuantity)||""),value:""+((null==A?void 0:A.tankerQuantity)||"")},O=(null==B?void 0:B.find(e=>nl(e.code,[A.waterType])))||{code:A.waterType,i18nKey:A.waterType},w=(null==W||null===(e=W.waterTankerBookingDetail)||void 0===e?void 0:e.find(e=>{var t,l,n,i;return nl(ll(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.fixedPointId,null==e?void 0:e.fixedPointId,null==e?void 0:e.fixedPointCode,null==e?void 0:e.id,null==e?void 0:e.bookingId,null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.applicantId),[null==A||null===(n=A.applicantDetail)||void 0===n?void 0:n.fixedPointId,null==A?void 0:A.fixedPointId,null==A?void 0:A.fixedPointCode,null==A?void 0:A.applicantId,null==A||null===(i=A.applicantDetail)||void 0===i?void 0:i.applicantId,null==A?void 0:A.bookingId])}))||null,L=(null==W||null===(t=W.waterTankerBookingDetail)||void 0===t?void 0:t.find(e=>{var t,l,n,i;return nl(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.applicantId,[null==A||null===(l=A.applicantDetail)||void 0===l?void 0:l.applicantId,null==A?void 0:A.applicantId])||nl(null==e||null===(n=e.applicantDetail)||void 0===n?void 0:n.mobileNumber,[null==A||null===(i=A.applicantDetail)||void 0===i?void 0:i.mobileNumber])}))||null,H=w||L||"",j=(null==U||null===(l=U.fillingPoints)||void 0===l?void 0:l.find(e=>nl(ll(null==e?void 0:e.id,null==e?void 0:e.fillingPointId,null==e?void 0:e.bookingId),[null==A?void 0:A.fillingPointId,null==A?void 0:A.fillingpointId])))||{},V=((null==R?void 0:R.vendor)||[]).find(e=>{var t,l,n;return nl(ll(null==e?void 0:e.id,null==e?void 0:e.code,null==e?void 0:e.vendor_id),[null==A?void 0:A.vendorId,null==A||null===(t=A.vendorDetail)||void 0===t?void 0:t.id,null==A||null===(l=A.vendorDetail)||void 0===l?void 0:l.code,null==A||null===(n=A.vendorDetail)||void 0===n?void 0:n.vendor_id])})||(null==A?void 0:A.vendorDetail)||"",z=V?{...V,name:(null==V?void 0:V.name)||(null==V?void 0:V.vendor_id)||"NA"}:"",K=(null==z||null===(n=z.vehicles)||void 0===n?void 0:n.find(e=>{var t,l,n;return nl(ll(null==e?void 0:e.id,null==e?void 0:e.registrationNumber,null==e?void 0:e.code),[null==A?void 0:A.vehicleId,null==A||null===(t=A.vehicleDetail)||void 0===t?void 0:t.id,null==A||null===(l=A.vehicleDetail)||void 0===l?void 0:l.registrationNumber,null==A||null===(n=A.vehicleDetail)||void 0===n?void 0:n.code])}))||(null==A?void 0:A.vehicleDetail)||"",G=K?{...K,name:(null==K?void 0:K.registrationNumber)||(null==K?void 0:K.type)||"NA"}:"",Y=(null==z||null===(i=z.drivers)||void 0===i?void 0:i.find(e=>{var t,l,n,i;return nl(ll(null==e?void 0:e.id,null==e?void 0:e.uuid,null==e?void 0:e.ownerId,null==e?void 0:e.licenseNumber),[null==A?void 0:A.driverId,null==A||null===(t=A.driverDetail)||void 0===t?void 0:t.id,null==A||null===(l=A.driverDetail)||void 0===l?void 0:l.uuid,null==A||null===(n=A.driverDetail)||void 0===n?void 0:n.ownerId,null==A||null===(i=A.driverDetail)||void 0===i?void 0:i.licenseNumber])}))||(null==A?void 0:A.driverDetail)||"",q=((null==k?void 0:k.filter(e=>{const t=e.vehicleType?e.vehicleType.toLowerCase():"";return t===(null!=C&&C.code?String(C.code).toLowerCase():"")||t.includes("tanker")}).map(e=>({i18nKey:""+e.capacityName,code:""+e.capacity,value:""+e.capacity,capacity:""+e.capacity})))||[]).find(e=>nl(e.code,[null==A?void 0:A.waterQuantity]))||{code:""+((null==A?void 0:A.waterQuantity)||""),value:""+((null==A?void 0:A.waterQuantity)||""),i18nKey:""+((null==A?void 0:A.waterQuantity)||"")};P({owner:{applicantName:(null==A||null===(o=A.applicantDetail)||void 0===o?void 0:o.name)||"",mobileNumber:(null==A||null===(a=A.applicantDetail)||void 0===a?void 0:a.mobileNumber)||"",alternateNumber:(null==A||null===(r=A.applicantDetail)||void 0===r?void 0:r.alternateNumber)||"",emailId:(null==A||null===(d=A.applicantDetail)||void 0===d?void 0:d.emailId)||"",fixedPoint:H?{...H,name:(null==H||null===(u=H.applicantDetail)||void 0===u?void 0:u.name)||(null==H||null===(s=H.applicantDetail)||void 0===s?void 0:s.fixedPointId)||"NA"}:"",applicantId:(null==A||null===(c=A.applicantDetail)||void 0===c?void 0:c.applicantId)||"",gender:(null==A||null===(v=A.applicantDetail)||void 0===v?void 0:v.gender)||null},address:{houseNo:(null==A||null===(m=A.address)||void 0===m?void 0:m.houseNo)||"",streetName:(null==A||null===(p=A.address)||void 0===p?void 0:p.streetName)||"",addressLine1:(null==A||null===(E=A.address)||void 0===E?void 0:E.addressLine1)||"",addressLine2:(null==A||null===(f=A.address)||void 0===f?void 0:f.addressLine2)||"",landmark:(null==A||null===(g=A.address)||void 0===g?void 0:g.landmark)||"",pincode:(null==A||null===(_=A.address)||void 0===_?void 0:_.pincode)||"",addressId:(null==A||null===(h=A.address)||void 0===h?void 0:h.addressId)||"",city:(null==A||null===(T=A.address)||void 0===T?void 0:T.city)||"Delhi",cityCode:(null==A||null===(y=A.address)||void 0===y?void 0:y.cityCode)||"DJB",locality:(null==A||null===(S=A.address)||void 0===S?void 0:S.locality)||"",localityCode:(null==A||null===(b=A.address)||void 0===b?void 0:b.localityCode)||"",ward:(null==A||null===(N=A.address)||void 0===N?void 0:N.ward)||"",zone:(null==A||null===(I=A.address)||void 0===I?void 0:I.zone)||"",constituency:(null==A||null===(D=A.address)||void 0===D?void 0:D.constituency)||""},requestDetails:{tankerType:C,waterType:O,tankerQuantity:x,waterQuantity:q,description:(null==A?void 0:A.description)||"",deliveryDate:(null==A?void 0:A.deliveryDate)||"",deliveryTime:(null==A?void 0:A.deliveryTime)||"",fileStoreId:(null==A?void 0:A.WTfileStoreId)||null,extraCharge:"Y"===(null==A?void 0:A.extraCharge)},dispatchDetails:{fillingPoint:{...j,id:ll(null==j?void 0:j.id,null==j?void 0:j.fillingPointId,null==j?void 0:j.bookingId),name:(null==j?void 0:j.fillingPointName)||(null==j?void 0:j.name)||"NA"},vendor:z,vehicle:G,driver:Y}})}},[A,M,F,B,W,U,k]);const j=(null==W||null===(S=W.waterTankerBookingDetail)||void 0===S?void 0:S.map(e=>{var t,l;return{...e,name:(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||(null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.fixedPointId)||"NA"}}))||[],V=(null==U||null===(b=U.fillingPoints)||void 0===b?void 0:b.map(e=>({...e,name:(null==e?void 0:e.fillingPointName)||"NA"})))||[],z=(null==R||null===(N=R.vendor)||void 0===N?void 0:N.map(e=>({...e,name:(null==e?void 0:e.name)||(null==e?void 0:e.vendor_id)||"NA"})))||[];let K=[],G=[];var Y,q,$,X;null!=L&&null!==(I=L.dispatchDetails)&&void 0!==I&&I.vendor&&"object"==typeof(null==L||null===(D=L.dispatchDetails)||void 0===D?void 0:D.vendor)&&(K=(null==L||null===(Y=L.dispatchDetails)||void 0===Y||null===(q=Y.vendor.vehicles)||void 0===q?void 0:q.map(e=>({...e,name:(null==e?void 0:e.registrationNumber)||(null==e?void 0:e.type)||"NA"})))||[],G=(null==L||null===($=L.dispatchDetails)||void 0===$||null===(X=$.vendor.drivers)||void 0===X?void 0:X.map(e=>({...e,name:(null==e?void 0:e.name)||(null==e?void 0:e.licenseNumber)||"NA"})))||[]);const Q=(null==B?void 0:B.map(e=>({i18nKey:""+e.code,code:""+e.code,value:""+e.code})))||[],Z=(null==M?void 0:M.map(e=>({i18nKey:""+e.i18nKey,code:""+e.code,value:""+e.value})))||[],J=(null==F?void 0:F.map(e=>({i18nKey:""+e.code,code:""+e.code,value:""+e.code})))||[],ee=(null==k?void 0:k.filter(e=>{var t,l;const n=e.vehicleType?e.vehicleType.toLowerCase():"";return n===(null!=L&&null!==(t=L.requestDetails)&&void 0!==t&&null!==(l=t.tankerType)&&void 0!==l&&l.code?L.requestDetails.tankerType.code.toLowerCase():"")||n.includes("tanker")}).map(e=>({i18nKey:""+e.capacityName,code:""+e.capacity,value:""+e.capacity,capacity:""+e.capacity})))||[];return H.isLoading?n.createElement(t.Loader,null):n.createElement(t.Modal,{headerBarMain:n.createElement("h1",{className:"heading-m"},C("WT_EDIT_APPLICATION_DETAILS")),headerBarEnd:n.createElement(el,{onClick:x}),actionCancelLabel:C("CS_COMMON_CANCEL"),actionCancelOnSubmit:x,actionSaveLabel:C("CS_COMMON_UPDATE"),actionSaveOnSubmit:()=>{const e=(e=>{var t,l,n,i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,h,T,y,S,b,N,I,D,C,A,x,O,w,L,P,R,k,M,F,B,W,U,H,j,V,z,K,G,Y,q,$,X,Q,Z,J,ee,te,le,ne,ie,oe,ae,re,de,ue,se,ce,ve,me,pe,Ee,fe,ge,_e,he,Te,ye,Se,be,Ne,Ie,De,Ce,Ae,xe,Oe,we,Le,Pe,Re,ke,Me,Fe,Be,We,Ue,He,je,Ve,ze,Ke,Ge,Ye,qe,$e,Xe,Qe,Ze,Je,et,tt,lt,nt;const it=null==e||null===(t=e.owner)||void 0===t?void 0:t.fixedPoint,ot=(null==it?void 0:it.applicantDetail)||{},at=(null==it?void 0:it.address)||{};return{waterTankerBookingDetail:{id:(null==e?void 0:e.id)||(null==e||null===(l=e.waterTankerBookingDetail)||void 0===l?void 0:l.id)||"",bookingNo:(null==e?void 0:e.bookingNo)||(null==e||null===(n=e.waterTankerBookingDetail)||void 0===n?void 0:n.bookingNo)||null,bookingId:(null==e?void 0:e.bookingId)||(null==e||null===(i=e.waterTankerBookingDetail)||void 0===i?void 0:i.bookingId)||"",applicantId:(null==ot?void 0:ot.applicantId)||(null==e||null===(o=e.owner)||void 0===o?void 0:o.applicantId)||(null==e?void 0:e.applicantId)||"",tenantId:null==e?void 0:e.tenantId,tankerType:null===(a=(null==e||null===(r=e.requestDetails)||void 0===r||null===(d=r.tankerType)||void 0===d?void 0:d.code)||(null==e||null===(u=e.requestDetails)||void 0===u?void 0:u.tankerType)||"")||void 0===a?void 0:a.toUpperCase(),waterType:(null==e||null===(s=e.requestDetails)||void 0===s||null===(c=s.waterType)||void 0===c?void 0:c.code)||(null==e||null===(v=e.requestDetails)||void 0===v?void 0:v.waterType),tankerQuantity:(null==e||null===(m=e.requestDetails)||void 0===m||null===(p=m.tankerQuantity)||void 0===p?void 0:p.code)||(null==e||null===(E=e.requestDetails)||void 0===E?void 0:E.tankerQuantity),waterQuantity:(null==e||null===(f=e.requestDetails)||void 0===f||null===(g=f.waterQuantity)||void 0===g?void 0:g.code)||(null==e||null===(_=e.requestDetails)||void 0===_||null===(h=_.waterQuantity)||void 0===h?void 0:h.value)||(null==e||null===(T=e.requestDetails)||void 0===T?void 0:T.waterQuantity),description:null==e||null===(y=e.requestDetails)||void 0===y?void 0:y.description,deliveryDate:null==e||null===(S=e.requestDetails)||void 0===S?void 0:S.deliveryDate,deliveryTime:null==e||null===(b=e.requestDetails)||void 0===b?void 0:b.deliveryTime,extraCharge:null!=e&&null!==(N=e.requestDetails)&&void 0!==N&&N.extraCharge?"Y":"N",addressDetailId:(null==at?void 0:at.addressId)||(null==e||null===(I=e.address)||void 0===I?void 0:I.addressDetailId)||(null==e?void 0:e.addressDetailId)||"",vendorId:(null==e||null===(D=e.dispatchDetails)||void 0===D||null===(C=D.vendor)||void 0===C?void 0:C.id)||(null==e||null===(A=e.owner)||void 0===A||null===(x=A.vendor)||void 0===x?void 0:x.id)||(null==e?void 0:e.vendorId)||"",vehicleId:(null==e||null===(O=e.dispatchDetails)||void 0===O||null===(w=O.vehicle)||void 0===w?void 0:w.id)||(null==e||null===(L=e.owner)||void 0===L||null===(P=L.vehicle)||void 0===P?void 0:P.id)||(null==e?void 0:e.vehicleId)||"",driverId:(null==e||null===(R=e.dispatchDetails)||void 0===R||null===(k=R.driver)||void 0===k||null===(M=k.owner)||void 0===M?void 0:M.uuid)||(null==e||null===(F=e.dispatchDetails)||void 0===F||null===(B=F.driver)||void 0===B?void 0:B.ownerId)||(null==e||null===(W=e.dispatchDetails)||void 0===W||null===(U=W.driver)||void 0===U?void 0:U.uuid)||(null==e||null===(H=e.dispatchDetails)||void 0===H||null===(j=H.driver)||void 0===j?void 0:j.id)||(null==e||null===(V=e.owner)||void 0===V||null===(z=V.driver)||void 0===z||null===(K=z.owner)||void 0===K?void 0:K.uuid)||(null==e||null===(G=e.owner)||void 0===G||null===(Y=G.driver)||void 0===Y?void 0:Y.ownerId)||(null==e?void 0:e.driverId)||"",fillingPointId:(null==e||null===(q=e.dispatchDetails)||void 0===q||null===($=q.fillingPoint)||void 0===$?void 0:$.id)||(null==e||null===(X=e.owner)||void 0===X||null===(Q=X.fillingPoint)||void 0===Q?void 0:Q.id)||(null==e?void 0:e.fillingPointId)||"",vehicleType:(null==e||null===(Z=e.dispatchDetails)||void 0===Z||null===(J=Z.vehicle)||void 0===J?void 0:J.vehicleType)||(null==e||null===(ee=e.owner)||void 0===ee||null===(te=ee.vehicle)||void 0===te?void 0:te.vehicleType)||(null==e?void 0:e.vehicleType)||"",vehicleCapacity:(null==e||null===(le=e.dispatchDetails)||void 0===le||null===(ne=le.vehicle)||void 0===ne?void 0:ne.capacity)||(null==e||null===(ie=e.owner)||void 0===ie||null===(oe=ie.vehicle)||void 0===oe?void 0:oe.capacity)||(null==e?void 0:e.vehicleCapacity)||"",applicantDetail:{applicantId:(null==ot?void 0:ot.applicantId)||(null==e||null===(ae=e.owner)||void 0===ae?void 0:ae.applicantId)||(null==e||null===(re=e.applicantDetail)||void 0===re?void 0:re.applicantId)||"",bookingId:(null==ot?void 0:ot.bookingId)||(null==e||null===(de=e.applicantDetail)||void 0===de?void 0:de.bookingId)||"",name:(null==e||null===(ue=e.owner)||void 0===ue?void 0:ue.applicantName)||(null==ot?void 0:ot.name)||(null==e||null===(se=e.applicantDetail)||void 0===se?void 0:se.name)||"",mobileNumber:(null==e||null===(ce=e.owner)||void 0===ce?void 0:ce.mobileNumber)||(null==ot?void 0:ot.mobileNumber)||(null==e||null===(ve=e.applicantDetail)||void 0===ve?void 0:ve.mobileNumber)||"",alternateNumber:(null==e||null===(me=e.owner)||void 0===me?void 0:me.alternateNumber)||(null==ot?void 0:ot.alternateNumber)||(null==e||null===(pe=e.applicantDetail)||void 0===pe?void 0:pe.alternateNumber)||"",emailId:(null==e||null===(Ee=e.owner)||void 0===Ee?void 0:Ee.emailId)||(null==ot?void 0:ot.emailId)||(null==e||null===(fe=e.applicantDetail)||void 0===fe?void 0:fe.emailId)||"",gender:(null==e||null===(ge=e.owner)||void 0===ge?void 0:ge.gender)||(null==ot?void 0:ot.gender)||(null==e||null===(_e=e.applicantDetail)||void 0===_e?void 0:_e.gender)||null,type:"FIXED-POINT",fixedPointId:(null==ot?void 0:ot.fixedPointId)||(null==e||null===(he=e.applicantDetail)||void 0===he?void 0:he.fixedPointId)||""},address:{applicantId:(null==at?void 0:at.applicantId)||(null==ot?void 0:ot.applicantId)||(null==e||null===(Te=e.address)||void 0===Te?void 0:Te.applicantId)||"",addressId:(null==at?void 0:at.addressId)||(null==e||null===(ye=e.address)||void 0===ye?void 0:ye.addressId)||(null==e||null===(Se=e.address)||void 0===Se?void 0:Se.addressDetailId)||"",addressType:(null==e||null===(be=e.address)||void 0===be||null===(Ne=be.addressType)||void 0===Ne?void 0:Ne.code)||(null==e||null===(Ie=e.address)||void 0===Ie?void 0:Ie.addressType)||"CORRESPONDENCE",pincode:(null==e||null===(De=e.address)||void 0===De?void 0:De.pincode)||(null==at?void 0:at.pincode)||"",city:(null==e||null===(Ce=e.address)||void 0===Ce||null===(Ae=Ce.city)||void 0===Ae||null===(xe=Ae.city)||void 0===xe?void 0:xe.name)||(null==e||null===(Oe=e.address)||void 0===Oe||null===(we=Oe.city)||void 0===we?void 0:we.name)||(null==e||null===(Le=e.address)||void 0===Le?void 0:Le.city)||(null==at?void 0:at.city)||"",cityCode:(null==e||null===(Pe=e.address)||void 0===Pe||null===(Re=Pe.city)||void 0===Re||null===(ke=Re.city)||void 0===ke?void 0:ke.code)||(null==e||null===(Me=e.address)||void 0===Me?void 0:Me.cityCode)||(null==at?void 0:at.cityCode)||"DJB",addressLine1:(null==e||null===(Fe=e.address)||void 0===Fe?void 0:Fe.addressLine1)||(null==at?void 0:at.addressLine1)||"",addressLine2:(null==e||null===(Be=e.address)||void 0===Be?void 0:Be.addressLine2)||(null==at?void 0:at.addressLine2)||"",locality:(null==e||null===(We=e.address)||void 0===We||null===(Ue=We.locality)||void 0===Ue?void 0:Ue.i18nKey)||(null==e||null===(He=e.address)||void 0===He||null===(je=He.locality)||void 0===je?void 0:je.name)||(null==e||null===(Ve=e.address)||void 0===Ve?void 0:Ve.locality)||(null==at?void 0:at.locality)||"",localityCode:(null==e||null===(ze=e.address)||void 0===ze||null===(Ke=ze.locality)||void 0===Ke?void 0:Ke.code)||(null==e||null===(Ge=e.address)||void 0===Ge?void 0:Ge.localityCode)||(null==at?void 0:at.localityCode)||"",streetName:(null==e||null===(Ye=e.address)||void 0===Ye?void 0:Ye.streetName)||(null==at?void 0:at.streetName)||"",houseNo:(null==e||null===(qe=e.address)||void 0===qe?void 0:qe.houseNo)||(null==at?void 0:at.houseNo)||"",landmark:(null==e||null===($e=e.address)||void 0===$e?void 0:$e.landmark)||(null==at?void 0:at.landmark)||"",latitude:(null==e||null===(Xe=e.address)||void 0===Xe?void 0:Xe.latitude)||(null==at?void 0:at.latitude)||"",longitude:(null==e||null===(Qe=e.address)||void 0===Qe?void 0:Qe.longitude)||(null==at?void 0:at.longitude)||"",ward:(null==e||null===(Ze=e.address)||void 0===Ze?void 0:Ze.ward)||(null==e||null===(Je=e.address)||void 0===Je?void 0:Je.block)||(null==at?void 0:at.ward)||"",zone:(null==e||null===(et=e.address)||void 0===et?void 0:et.zone)||(null==at?void 0:at.zone)||"",constituency:(null==e||null===(tt=e.address)||void 0===tt?void 0:tt.assembly)||(null==e||null===(lt=e.address)||void 0===lt?void 0:lt.constituency)||(null==at?void 0:at.constituency)||""},WTfileStoreId:(null==e||null===(nt=e.requestDetails)||void 0===nt?void 0:nt.fileStoreId)||(null==e?void 0:e.WTfileStoreId)||null,bookingStatus:(null==e?void 0:e.bookingStatus)||"BOOKING_CREATED"}}})({...A,...L,tenantId:O});H.mutate(e,{onSuccess:()=>{x(),window.location.reload()},onError:e=>{console.error("Update Error:",e)}})}},n.createElement(t.Card,{style:{maxHeight:"70vh",overflowY:"auto",padding:"20px"}},n.createElement("div",{style:{marginBottom:"24px"}},n.createElement("h2",{style:{fontSize:"18px",fontWeight:"bold",marginBottom:"16px",color:"#0B0C10",borderBottom:"1px solid #e0e0e0",paddingBottom:"8px"}},C("WT_APPLICANT_DETAILS")),n.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px"}},n.createElement("div",{style:{flex:"1 1 100%"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_FIXED_POINT")),n.createElement(t.Dropdown,{selected:L.owner.fixedPoint,option:j,select:e=>{if(e&&"object"==typeof e){const t=e.applicantDetail,l=e.address;P({...L,owner:{...L.owner,fixedPoint:e,applicantName:(null==t?void 0:t.name)||L.owner.applicantName,mobileNumber:(null==t?void 0:t.mobileNumber)||L.owner.mobileNumber,alternateNumber:(null==t?void 0:t.alternateNumber)||L.owner.alternateNumber,emailId:(null==t?void 0:t.emailId)||L.owner.emailId},address:{...L.address,houseNo:(null==l?void 0:l.houseNo)||"",streetName:(null==l?void 0:l.streetName)||"",addressLine1:(null==l?void 0:l.addressLine1)||"",addressLine2:(null==l?void 0:l.addressLine2)||"",landmark:(null==l?void 0:l.landmark)||"",pincode:null!=l&&l.pincode?l.pincode.toString().split(".")[0]:"",city:(null==l?void 0:l.city)||"Delhi",cityCode:(null==l?void 0:l.cityCode)||"DJB",locality:(null==l?void 0:l.locality)||"",localityCode:(null==l?void 0:l.localityCode)||"",ward:(null==l?void 0:l.ward)||"",zone:(null==l?void 0:l.zone)||"",constituency:(null==l?void 0:l.constituency)||""}})}},optionKey:"name",t:C,placeholder:C("WT_SELECT_FIXED_POINT"),disable:!0})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_APPLICANT_NAME")),n.createElement(t.TextInput,{value:L.owner.applicantName,onChange:e=>P({...L,owner:{...L.owner,applicantName:e.target.value}}),disable:!0})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{value:L.owner.mobileNumber,onChange:e=>P({...L,owner:{...L.owner,mobileNumber:e}}),disable:!0})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_ALT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{value:L.owner.alternateNumber,onChange:e=>P({...L,owner:{...L.owner,alternateNumber:e}}),disable:!0})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_EMAIL_ID")),n.createElement(t.TextInput,{value:L.owner.emailId,onChange:e=>P({...L,owner:{...L.owner,emailId:e.target.value}}),disable:!0})))),n.createElement("div",{style:{marginBottom:"24px"}},n.createElement("h2",{style:{fontSize:"18px",fontWeight:"bold",marginBottom:"16px",color:"#0B0C10",borderBottom:"1px solid #e0e0e0",paddingBottom:"8px"}},C("WT_ADDRESS_DETAILS")),n.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px"}},["houseNo","streetName","addressLine1","addressLine2","landmark","pincode"].map(e=>n.createElement("div",{key:e,style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_"+e.toUpperCase())),n.createElement(t.TextInput,{value:L.address[e],onChange:t=>P({...L,address:{...L.address,[e]:t.target.value}}),disable:!0}))))),n.createElement("div",{style:{marginBottom:"24px"}},n.createElement("h2",{style:{fontSize:"18px",fontWeight:"bold",marginBottom:"16px",color:"#0B0C10",borderBottom:"1px solid #e0e0e0",paddingBottom:"8px"}},C("WT_REQUEST_DETAILS")),n.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px"}},n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_TANKER_TYPE")),n.createElement(t.Dropdown,{selected:L.requestDetails.tankerType,option:Z,select:e=>P({...L,requestDetails:{...L.requestDetails,tankerType:e}}),optionKey:"i18nKey",t:C})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_WATER_TYPE")),n.createElement(t.Dropdown,{selected:L.requestDetails.waterType,option:Q,select:e=>P({...L,requestDetails:{...L.requestDetails,waterType:e}}),optionKey:"i18nKey",t:C})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_TANKER_QUANTITY")),n.createElement(t.Dropdown,{selected:L.requestDetails.tankerQuantity,option:J,select:e=>P({...L,requestDetails:{...L.requestDetails,tankerQuantity:e}}),optionKey:"i18nKey",t:C})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_WATER_QUANTITY")),n.createElement(t.Dropdown,{selected:L.requestDetails.waterQuantity,option:ee,select:e=>P({...L,requestDetails:{...L.requestDetails,waterQuantity:e}}),optionKey:"i18nKey",t:C})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_DELIVERY_DATE")),n.createElement(t.TextInput,{type:"date",value:L.requestDetails.deliveryDate,onChange:e=>P({...L,requestDetails:{...L.requestDetails,deliveryDate:e.target.value}})})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_DELIVERY_TIME")),n.createElement(t.TextInput,{type:"time",value:L.requestDetails.deliveryTime,onChange:e=>P({...L,requestDetails:{...L.requestDetails,deliveryTime:e.target.value}})})),n.createElement("div",{style:{flex:"1 1 100%"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_DESCRIPTION")),n.createElement(t.TextArea,{value:L.requestDetails.description,onChange:e=>P({...L,requestDetails:{...L.requestDetails,description:e.target.value}})})))),n.createElement("div",{style:{marginBottom:"24px"}},n.createElement("h2",{style:{fontSize:"18px",fontWeight:"bold",marginBottom:"16px",color:"#0B0C10",borderBottom:"1px solid #e0e0e0",paddingBottom:"8px"}},C("WT_DISPATCH_DETAILS")),n.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px"}},n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_FILLING_POINT")),n.createElement(t.Dropdown,{selected:L.dispatchDetails.fillingPoint,option:V,select:e=>{P({...L,dispatchDetails:{...L.dispatchDetails,fillingPoint:e,vendor:"",vehicle:"",driver:""}})},optionKey:"name",t:C})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_VENDOR")),n.createElement(t.Dropdown,{selected:L.dispatchDetails.vendor,option:z,select:e=>{P({...L,dispatchDetails:{...L.dispatchDetails,vendor:e,vehicle:"",driver:""}})},optionKey:"name",t:C})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_VEHICLE")),n.createElement(t.Dropdown,{selected:L.dispatchDetails.vehicle,option:K,select:e=>P({...L,dispatchDetails:{...L.dispatchDetails,vehicle:e}}),optionKey:"name",t:C})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},C("WT_DRIVER")),n.createElement(t.Dropdown,{selected:L.dispatchDetails.driver,option:G,select:e=>P({...L,dispatchDetails:{...L.dispatchDetails,driver:e}}),optionKey:"name",t:C}))))))},ol=e=>{let{startFileStoreId:o,endFileStoreId:a}=e;const{t:r}=i.useTranslation(),[d,u]=l.useState(null),[s,c]=l.useState(null),[v,m]=l.useState(null),p=Digit.ULBService.getCurrentTenantId();return l.useEffect(()=>{!function(){try{const e=N(function(){function e(){const e=function(){if(a)return Promise.resolve(Digit.UploadServices.Filefetch([a],p)).then(function(e){var t;null!=e&&null!==(t=e.data)&&void 0!==t&&t[a]&&m(e.data[a].split(",")[0])})}();if(e&&e.then)return e.then(function(){})}const t=function(){if(o)return Promise.resolve(Digit.UploadServices.Filefetch([o],p)).then(function(e){var t;null!=e&&null!==(t=e.data)&&void 0!==t&&t[o]&&c(e.data[o].split(",")[0])})}();return t&&t.then?t.then(e):e()},function(e){console.error("Error fetching trip images",e)});Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[o,a,p]),o||a?n.createElement("div",{style:{display:"flex",gap:"24px",marginTop:"16px",marginBottom:"16px"}},d&&n.createElement(t.Modal,{hideSubmit:!0,popmoduleClassName:"wt-trip-image-modal",headerBarMain:n.createElement("h1",{className:"heading-m"},r("WT_TRIP_IMAGE")),headerBarEnd:n.createElement("div",{onClick:()=>u(null),style:{cursor:"pointer",fontSize:"1.5rem"}},"×"),actionCancelLabel:r("CS_COMMON_CANCEL"),actionCancelOnSubmit:()=>u(null),formId:"modal-action"},n.createElement(t.Card,{style:{display:"flex",justifyContent:"center",padding:"16px"}},n.createElement("img",{src:d,alt:"Trip Image",style:{maxWidth:"100%",maxHeight:"60vh",objectFit:"contain"}}))),s&&n.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},n.createElement("p",{style:{fontWeight:"bold",marginBottom:"8px",fontSize:"16px"}},r("WT_START_TRIP_IMAGE")),n.createElement("div",{style:{position:"relative",width:"120px",height:"120px",border:"1px solid #ccc",borderRadius:"4px",overflow:"hidden"}},n.createElement("img",{src:s,alt:"Start Trip",style:{width:"100%",height:"100%",objectFit:"cover"}}),n.createElement("div",{onClick:()=>u(s),style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:"rgba(0,0,0,0.6)",borderRadius:"50%",padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"}},n.createElement(t.ViewsIcon,{fill:"#ffffff",style:{width:"24px",height:"24px"}})))),v&&n.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},n.createElement("p",{style:{fontWeight:"bold",marginBottom:"8px",fontSize:"16px"}},r("WT_END_TRIP_IMAGE")),n.createElement("div",{style:{position:"relative",width:"120px",height:"120px",border:"1px solid #ccc",borderRadius:"4px",overflow:"hidden"}},n.createElement("img",{src:v,alt:"End Trip",style:{width:"100%",height:"100%",objectFit:"cover"}}),n.createElement("div",{onClick:()=>u(v),style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:"rgba(0,0,0,0.6)",borderRadius:"50%",padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"}},n.createElement(t.ViewsIcon,{fill:"#ffffff",style:{width:"24px",height:"24px"}}))))):null},al=e=>n.createElement("h1",{className:"heading-m"},e.label),rl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),dl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(rl,null)),ul=e=>{var i,o;let{t:a,action:r,tenantId:d,closeModal:u,submitAction:s,applicationData:c,businessService:v,moduleCode:m}=e;const{data:p,isLoading:E}=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:g}=Digit.Hooks.pt.useMDMS(d,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[_,h]=l.useState({}),[T,y]=l.useState({}),[S,b]=l.useState([]),[I,D]=l.useState(null),[C,A]=l.useState(null),[x,O]=l.useState(null),[w,L]=l.useState(null),[P,R]=l.useState([]),[k,M]=l.useState(null),[F,B]=l.useState(!1);function W(e){A(e.target.files[0])}return l.useEffect(()=>{var e;g&&g["egf-master"]&&R(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),l.useEffect(()=>{var e;b(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),l.useEffect(()=>{!function(){try{L(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=N(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?O(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),l.useEffect(()=>{r&&h(null!=r&&r.showFinancialYearsModal?(e=>{let{t:l,action:i,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:`WF_${i.action}_APPLICATION`,submit:"WF_PT.CREATE_"+i.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:l("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:n.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:P,selectedFinancialYear:k,setSelectedFinancialYear:M}):(e=>{var l;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:d,selectFile:u,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:m}=e;return{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${m}_${null==o?void 0:o.action}`,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(v||"WF_ROLE_"+(null===(l=o.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${i("ES_PT_ATTACH_FILE")}${o.docUploadRequired?" *":""}`,populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:I,setSelectedApprover:D,selectFile:W,uploadedFile:x,setUploadedFile:O,businessService:v}))},[r,S,P,k,x]),r&&_.form?n.createElement(t.Modal,{headerBarMain:n.createElement(al,{label:a(_.label.heading)}),headerBarEnd:n.createElement(dl,{onClick:u}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!k:E||(null==r?void 0:r.docUploadRequired)&&!x,formId:"modal-action"},f?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};c.creationReason="STATUS",s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:{...c,workflow:t}})}else if(null!=r&&r.showFinancialYearsModal)s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==k?void 0:k.name,propertyId:null==c?void 0:c.propertyId,tenantId:d,source:null==c?void 0:c.source,channel:null==c?void 0:c.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:m};t.assignes=null!=r&&r.isTerminateState||!I?[]:[I],x&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:x}]),s({Property:{...c,workflow:t}})}},defaultValues:T,formId:"modal-action"})):n.createElement(t.Loader,null)},sl=e=>n.createElement("h1",{className:"heading-m"},e.label),cl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),vl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(cl,null)),ml=e=>{var i,o;let{t:a,action:r,tenantId:d,closeModal:u,submitAction:s,applicationData:c,businessService:v}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:p,data:E}=Digit.Hooks.pt.useMDMS(d,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[f,g]=l.useState({}),[_,h]=l.useState({}),[T,y]=l.useState([]),[S,b]=l.useState({}),[I,D]=l.useState(null),[C,A]=l.useState(null),[x,O]=l.useState(null),[w,L]=l.useState([]),[P,R]=l.useState(null);function k(e){D(e.target.files[0])}return l.useEffect(()=>{var e;E&&E["egf-master"]&&L(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]),l.useEffect(()=>{var e;y(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),l.useEffect(()=>{!function(){try{O(null);const e=function(){if(I){const e=function(){if(I.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=N(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",I,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?A(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[I]),l.useEffect(()=>{r&&g((e=>{let{t:l,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:d,uploadedFile:u,setUploadedFile:s,businessService:c}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(v=!1),i.isTerminateState&&(v=!1),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==c?void 0:c.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:v?l("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?l("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?n.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:l("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:l("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{s(null)},message:u?"1 "+l("ES_PT_ACTION_FILEUPLOADED"):l("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:T,selectedApprover:S,setSelectedApprover:b,selectFile:k,uploadedFile:C,setUploadedFile:A,businessService:v}))},[r,T,w,P,C]),r&&f.form?n.createElement(t.Modal,{headerBarMain:n.createElement(sl,{label:a(f.label.heading)}),headerBarEnd:n.createElement(vl,{onClick:u}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},p?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c={...c,action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=S&&S.uuid?[null==S?void 0:S.uuid]:null,wfDocuments:C?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:C}]:null},s({Licenses:[c]})},defaultValues:_,formId:"modal-action"})):n.createElement(t.Loader,null)},pl=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),El=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),fl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(El,null)),gl=e=>{var i,o;let{t:a,action:r,tenantId:d,closeModal:u,submitAction:s,applicationData:c,businessService:v}=e;const{data:m,isLoading:p}=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,f]=l.useState({}),[g,_]=l.useState({}),[h,T]=l.useState([]),[y,S]=l.useState({}),[b,I]=l.useState(null),[D,C]=l.useState(null),[A,x]=l.useState(null),O=!!Digit.Utils.browser.isMobile();function w(e){I(e.target.files[0])}return l.useEffect(()=>{var e;T(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),l.useEffect(()=>{!function(){try{x(null);const e=function(){if(b){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(b.size>=5242880)x(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=b&&b.type&&!e.test(null==b?void 0:b.type))x(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=N(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",b,Digit.ULBService.getStateId()||(null==d?void 0:d.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?C(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):x(a("CS_FILE_UPLOAD_ERROR"))})},function(){x(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[b]),l.useEffect(()=>{r&&f((e=>{let{t:l,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:d,uploadedFile:u,setUploadedFile:s,businessService:c,error:v}=e,m=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(m=!1),i.isTerminateState&&(m=!1),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==c?void 0:c.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:m?l("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?l("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?n.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:l("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:l("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{s(null)},message:u?"1 "+l("ES_PT_ACTION_FILEUPLOADED"):l("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:S,selectFile:w,uploadedFile:D,setUploadedFile:C,businessService:v,error:A}))},[r,h,D,A]),r&&E.form?n.createElement(t.Modal,{headerBarMain:n.createElement(pl,{label:a(E.label.heading)}),headerBarEnd:n.createElement(fl,{onClick:u}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:O?{width:"720px"}:{},style:O?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:O?{paddingLeft:"5px"}:{}},p?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:E.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c={...c,action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=y&&y.uuid?[null==y?void 0:y.uuid]:null,wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==b?void 0:b.name,fileStoreId:D}]:null},s({Licenses:[c]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:g,formId:"modal-action"})):n.createElement(t.Loader,null)},_l=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),hl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Tl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(hl,null)),yl=e=>{var i,o,r,d,u,s,c,v,m,p,E,f;let{t:g,action:_,tenantId:h,closeModal:T,submitAction:y,applicationDetails:S,applicationData:b,businessService:I,workflowDetails:D}=e;Digit.Hooks.obps.useObpsAPI(null!==(i=b)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(r=o.address)&&void 0!==r&&r.city?null===(d=b)||void 0===d||null===(u=d.landInfo)||void 0===u||null===(s=u.address)||void 0===s?void 0:s.city:h,!1);const{data:C,isLoading:A}=Digit.Hooks.useEmployeeSearch(h,{roles:null==D||null===(c=D.data)||void 0===c||null===(v=c.initialActionState)||void 0===v||null===(m=v.nextActions)||void 0===m||null===(p=m.filter(e=>(null==e?void 0:e.action)==(null==_?void 0:_.action)))||void 0===p||null===(E=p[0])||void 0===E||null===(f=E.assigneeRoles)||void 0===f?void 0:f.map(e=>({code:e})),isActive:!0},{enabled:!(null!=_&&_.isTerminateState)}),[x,O]=(a.useQueryClient(),l.useState({})),[w,L]=l.useState({}),[P,R]=l.useState([]),[k,M]=l.useState({}),[F,B]=l.useState(null),[W,U]=l.useState(null),[H,j]=l.useState(null),[V,z]=l.useState(null),K=!!Digit.Utils.browser.isMobile();function G(e){B(e.target.files[0])}l.useEffect(()=>{var e;R(null==C||null===(e=C.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[C]),l.useEffect(()=>{!function(){try{j(null);const e=function(){if(F){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(F.size>=5242880)j(g("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=F&&F.type&&!e.test(null==F?void 0:F.type))j(g("NOT_SUPPORTED_FILE_TYPE"));else{const e=N(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",F,Digit.ULBService.getStateId()||(null==h?void 0:h.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?U(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):j(g("CS_FILE_UPLOAD_ERROR"))})},function(){j(g("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[F]);const Y=e=>{let t=[];return e&&e.map((e,l)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},q=e=>{let t=[];var l;for(l=0;l<(null==e?void 0:e.questionLength);l++){var n;t.push({remarks:e["Remarks_"+l],question:null==e?void 0:e.questionList[l].question,value:null==e||null===(n=e["question_"+l])||void 0===n?void 0:n.code})}return t},$=e=>{var t,l;let n=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.fieldinspection_pending)||void 0===l?void 0:l.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),"FIELDINSPECTION_INPROGRESS"==e.status?(n=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=n)||void 0===a?void 0:a.length)>0&&n.map((e,t)=>{i.push({docs:Y(e.Documents),date:e.InspectionDate,questions:q(e),time:null==e?void 0:e.InspectionTime})}),i=i.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},X=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),l=[];return t.map(e=>{var t,n,i,o,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(n=t[0])||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)>0&&(l=[...l,...null==e||null===(o=e.uploadedDocuments)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.values]),(null==e||null===(r=e.newUploadedDocs)||void 0===r?void 0:r.length)>0&&(l=[...l,...null==e?void 0:e.newUploadedDocs])}),l},Q=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),l=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let n=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return n=null===(e=n)||void 0===e?void 0:e.concat(null!==l?l.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),n};return l.useEffect(()=>{_&&O((e=>{var l;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:d,selectFile:u,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:m,error:p}=e,E=!1;return"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SKIP_PAYMENT"!=o.action&&"SEND_BACK_TO_CITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${m}_${null==o?void 0:o.action}`,cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:o.isTerminateState||E?null:i(v||"WF_ROLE_"+(null===(l=o.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:o.isTerminateState||E?null:n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:g,action:_,approvers:P,selectedApprover:k,setSelectedApprover:M,selectFile:G,uploadedFile:W,setUploadedFile:U,businessService:I,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:H}))},[_,P,V,W,H]),_&&x.form?n.createElement(t.Modal,{headerBarMain:n.createElement(_l,{label:g(x.label.heading)}),headerBarEnd:n.createElement(Tl,{onClick:T}),actionCancelLabel:g(x.label.cancel),actionCancelOnSubmit:T,actionSaveLabel:g(x.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:K?{width:"720px"}:{},style:K?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:K?{paddingLeft:"5px"}:{}},A?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:x.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,l,n,i,o,a;b={...b,documents:X(),additionalDetails:{...null===(t=b)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:$(b),pendingapproval:Q()},workflow:{action:null==_?void 0:_.action,comment:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,assignee:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,assignes:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,varificationDocuments:W?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:W}]:null},action:null==_?void 0:_.action,comment:null==e?void 0:e.comments,assignee:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,wfDocuments:W?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:W}]:null};const r=null==S||null===(i=S.nocData)||void 0===i?void 0:i.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:{...e,documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]}}});let d={sourceRefId:null==r||null===(o=r[0])||void 0===o||null===(a=o.Noc)||void 0===a?void 0:a.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(h,d)).then(function(e){var t;let l=!0,n=!0;null==e||null===(t=e.Noc)||void 0===t||t.map(e=>{var t,i,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=l&&1!=n||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?l=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(n=!1))});let i=[];r&&r.map(e=>{var t,o,a,r,d,u,s,c,v,m,p,E;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(o=t.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(d=e.Noc)||void 0===d||null===(u=d.applicationStatus)||void 0===u?void 0:u.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(c=s.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"VOIDED"!=(null==e||null===(v=e.Noc)||void 0===v||null===(m=v.applicationStatus)||void 0===m?void 0:m.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(p=e.Noc)||void 0===p?void 0:p.nocType)&&l||"FIRE_NOC"===(null==e||null===(E=e.Noc)||void 0===E?void 0:E.nocType)&&n)&&i.push(e)}),y({BPA:b},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:w,formId:"modal-action"})):n.createElement(t.Loader,null)},Sl=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),bl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Nl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(bl,null)),Il=e=>{var i,r;let{t:d,action:u,tenantId:s,closeModal:c,submitAction:v,applicationData:m,businessService:p}=e;const{data:E,isLoading:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==u||null===(i=u.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=u&&u.isTerminateState)}),[g,_]=(a.useQueryClient(),l.useState({})),[h,T]=l.useState({}),[y,S]=l.useState([]),[b,I]=l.useState({}),[D,C]=l.useState(null),[A,x]=l.useState(null),[O,w]=l.useState(null),L=!!Digit.Utils.browser.isMobile();function P(e){C(e.target.files[0])}return o.useHistory(),l.useEffect(()=>{var e;S(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),l.useEffect(()=>{!function(){try{w(null);const e=function(){if(D){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(D.size>=5242880)w(d("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))w(d("NOT_SUPPORTED_FILE_TYPE"));else{const e=N(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",D,Digit.ULBService.getStateId()||(null==s?void 0:s.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?x(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):w(d("CS_FILE_UPLOAD_ERROR"))})},function(){w(d("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),l.useEffect(()=>{u&&_((e=>{var l;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:d,selectFile:u,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:m,error:p}=e,E=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(E=!0);let f=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(f=!0),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${m}_${null==o?void 0:o.action}`,cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||f?null:i(v||"WF_ROLE_"+(null===(l=o.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:o.isTerminateState||f?null:n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:E,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:d,action:u,approvers:y,selectedApprover:b,setSelectedApprover:I,selectFile:P,uploadedFile:A,setUploadedFile:x,businessService:p,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:O}))},[u,y,A,O]),u&&g.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Sl,{label:d(g.label.heading)}),headerBarEnd:n.createElement(Nl,{onClick:c}),actionCancelLabel:d(g.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:d(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:L?{width:"720px"}:{},style:L?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:L?{paddingLeft:"5px"}:{}},f?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:g.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=m)||void 0===t||null===(l=t.documents)||void 0===l?void 0:l.length)>0?[...null===(n=m)||void 0===n?void 0:n.documents]:[];i.map((e,t)=>{o.push(e)}),m={...m,workflow:{action:null==u?void 0:u.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,documents:A?[{documentType:(null==u?void 0:u.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:A}]:null},documents:o},v({Noc:m},!1,{isNoc:!0})},defaultValues:h,formId:"modal-action"})):n.createElement(t.Loader,null)};function Dl(e){var t=this.__data__=new Dt(e);this.size=t.size}Dl.prototype.clear=function(){this.__data__=new Dt,this.size=0},Dl.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},Dl.prototype.get=function(e){return this.__data__.get(e)},Dl.prototype.has=function(e){return this.__data__.has(e)},Dl.prototype.set=function(e,t){var l=this.__data__;if(l instanceof Dt){var n=l.__data__;if(!Ct||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new Ot(n)}return l.set(e,t),this.size=l.size,this};var Cl=Dl,Al=function(){try{var e=ft(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),xl=function(e,t,l){"__proto__"==t&&Al?Al(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l},Ol=Object.prototype.hasOwnProperty,wl=function(e,t,l){var n=e[t];Ol.call(e,t)&&St(n,l)&&(void 0!==l||t in e)||xl(e,t,l)},Ll=function(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],d=n?n(l[r],e[r],r,l,e):void 0;void 0===d&&(d=e[r]),i?xl(l,r,d):wl(l,r,d)}return l},Pl=function(e){return it(e)&&"[object Arguments]"==nt(e)},Rl=Object.prototype,kl=Rl.hasOwnProperty,Ml=Rl.propertyIsEnumerable,Fl=Pl(function(){return arguments}())?Pl:function(e){return it(e)&&kl.call(e,"callee")&&!Ml.call(e,"callee")},Bl=function(){return!1},Wl=Ke(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?$e.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Bl}),Ul=/^(?:0|[1-9]\d*)$/,Hl=function(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&Ul.test(e))&&e>-1&&e%1==0&&e<t},jl=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Vl={};Vl["[object Float32Array]"]=Vl["[object Float64Array]"]=Vl["[object Int8Array]"]=Vl["[object Int16Array]"]=Vl["[object Int32Array]"]=Vl["[object Uint8Array]"]=Vl["[object Uint8ClampedArray]"]=Vl["[object Uint16Array]"]=Vl["[object Uint32Array]"]=!0,Vl["[object Arguments]"]=Vl["[object Array]"]=Vl["[object ArrayBuffer]"]=Vl["[object Boolean]"]=Vl["[object DataView]"]=Vl["[object Date]"]=Vl["[object Error]"]=Vl["[object Function]"]=Vl["[object Map]"]=Vl["[object Number]"]=Vl["[object Object]"]=Vl["[object RegExp]"]=Vl["[object Set]"]=Vl["[object String]"]=Vl["[object WeakMap]"]=!1;var zl=function(e){return function(t){return e(t)}},Kl=Ke(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l&&Ye.process,o=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Gl=Kl&&Kl.isTypedArray,Yl=Gl?zl(Gl):function(e){return it(e)&&jl(e.length)&&!!Vl[nt(e)]},ql=Object.prototype.hasOwnProperty,$l=function(e,t){var l=Ve(e),n=!l&&Fl(e),i=!l&&!n&&Wl(e),o=!l&&!n&&!i&&Yl(e),a=l||n||i||o,r=a?function(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}(e.length,String):[],d=r.length;for(var u in e)!t&&!ql.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Hl(u,d))||r.push(u);return r},Xl=Object.prototype,Ql=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Xl)},Zl=function(e,t){return function(l){return e(t(l))}},Jl=Zl(Object.keys,Object),en=Object.prototype.hasOwnProperty,tn=function(e){return null!=e&&jl(e.length)&&!ut(e)},ln=function(e){return tn(e)?$l(e):function(e){if(!Ql(e))return Jl(e);var t=[];for(var l in Object(e))en.call(e,l)&&"constructor"!=l&&t.push(l);return t}(e)},nn=Object.prototype.hasOwnProperty,on=function(e){return tn(e)?$l(e,!0):function(e){if(!dt(e))return function(e){var t=[];if(null!=e)for(var l in Object(e))t.push(l);return t}(e);var t=Ql(e),l=[];for(var n in e)("constructor"!=n||!t&&nn.call(e,n))&&l.push(n);return l}(e)},an=Ke(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?$e.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var l=e.length,n=o?o(l):new e.constructor(l);return e.copy(n),n}}),rn=function(){return[]},dn=Object.prototype.propertyIsEnumerable,un=Object.getOwnPropertySymbols,sn=un?function(e){return null==e?[]:(e=Object(e),function(t,l){for(var n=-1,i=null==t?0:t.length,o=0,a=[];++n<i;){var r=t[n];dn.call(e,r)&&(a[o++]=r)}return a}(un(e)))}:rn,cn=function(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e},vn=Zl(Object.getPrototypeOf,Object),mn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)cn(t,sn(e)),e=vn(e);return t}:rn,pn=function(e,t,l){var n=t(e);return Ve(e)?n:cn(n,l(e))},En=function(e){return pn(e,ln,sn)},fn=function(e){return pn(e,on,mn)},gn=ft($e,"DataView"),_n=ft($e,"Promise"),hn=ft($e,"Set"),Tn=ft($e,"WeakMap"),yn=mt(gn),Sn=mt(Ct),bn=mt(_n),Nn=mt(hn),In=mt(Tn),Dn=nt;(gn&&"[object DataView]"!=Dn(new gn(new ArrayBuffer(1)))||Ct&&"[object Map]"!=Dn(new Ct)||_n&&"[object Promise]"!=Dn(_n.resolve())||hn&&"[object Set]"!=Dn(new hn)||Tn&&"[object WeakMap]"!=Dn(new Tn))&&(Dn=function(e){var t=nt(e),l="[object Object]"==t?e.constructor:void 0,n=l?mt(l):"";if(n)switch(n){case yn:return"[object DataView]";case Sn:return"[object Map]";case bn:return"[object Promise]";case Nn:return"[object Set]";case In:return"[object WeakMap]"}return t});var Cn=Dn,An=Object.prototype.hasOwnProperty,xn=$e.Uint8Array,On=function(e){var t=new e.constructor(e.byteLength);return new xn(t).set(new xn(e)),t},wn=/\w*$/,Ln=Xe?Xe.prototype:void 0,Pn=Ln?Ln.valueOf:void 0,Rn=Object.create,kn=function(){function e(){}return function(t){if(!dt(t))return{};if(Rn)return Rn(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}(),Mn=Kl&&Kl.isMap,Fn=Mn?zl(Mn):function(e){return it(e)&&"[object Map]"==Cn(e)},Bn=Kl&&Kl.isSet,Wn=Bn?zl(Bn):function(e){return it(e)&&"[object Set]"==Cn(e)},Un={};Un["[object Arguments]"]=Un["[object Array]"]=Un["[object ArrayBuffer]"]=Un["[object DataView]"]=Un["[object Boolean]"]=Un["[object Date]"]=Un["[object Float32Array]"]=Un["[object Float64Array]"]=Un["[object Int8Array]"]=Un["[object Int16Array]"]=Un["[object Int32Array]"]=Un["[object Map]"]=Un["[object Number]"]=Un["[object Object]"]=Un["[object RegExp]"]=Un["[object Set]"]=Un["[object String]"]=Un["[object Symbol]"]=Un["[object Uint8Array]"]=Un["[object Uint8ClampedArray]"]=Un["[object Uint16Array]"]=Un["[object Uint32Array]"]=!0,Un["[object Error]"]=Un["[object Function]"]=Un["[object WeakMap]"]=!1;var Hn=function e(t,l,n,i,o,a){var r,d=1&l,u=2&l,s=4&l;if(n&&(r=o?n(t,i,o,a):n(t)),void 0!==r)return r;if(!dt(t))return t;var c=Ve(t);if(c){if(r=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&An.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(t),!d)return function(e,t){var l=-1,n=e.length;for(t||(t=Array(n));++l<n;)t[l]=e[l];return t}(t,r)}else{var v=Cn(t),m="[object Function]"==v||"[object GeneratorFunction]"==v;if(Wl(t))return an(t,d);if("[object Object]"==v||"[object Arguments]"==v||m&&!o){if(r=u||m?{}:function(e){return"function"!=typeof e.constructor||Ql(e)?{}:kn(vn(e))}(t),!d)return u?function(e,t){return Ll(e,mn(e),t)}(t,function(e,t){return e&&Ll(t,on(t),e)}(r,t)):function(e,t){return Ll(e,sn(e),t)}(t,function(e,t){return e&&Ll(t,ln(t),e)}(r,t))}else{if(!Un[v])return o?t:{};r=function(e,t,l){var n=e.constructor;switch(t){case"[object ArrayBuffer]":return On(e);case"[object Boolean]":case"[object Date]":return new n(+e);case"[object DataView]":return function(e,t){var l=t?On(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var l=t?On(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}(e,l);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,wn.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new n;case"[object Symbol]":return Pn?Object(Pn.call(e)):{}}}(t,v,d)}}a||(a=new Cl);var p=a.get(t);if(p)return p;a.set(t,r),Wn(t)?t.forEach(function(i){r.add(e(i,l,n,i,t,a))}):Fn(t)&&t.forEach(function(i,o){r.set(o,e(i,l,n,o,t,a))});var E=c?void 0:(s?u?fn:En:u?on:ln)(t);return function(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l););}(E||t,function(i,o){E&&(i=t[o=i]),wl(r,o,e(i,l,n,o,t,a))}),r},jn=function(e){return Hn(e,5)};const Vn=e=>n.createElement("h1",{className:"heading-m"},e.label),zn=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Kn=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(zn,null)),Gn=function(e,t){void 0===t&&(t="dayend");try{const l=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),n=new Date(Date.UTC(l[1],l[2]-1,l[3]));return n.setMinutes(n.getMinutes()+n.getTimezoneOffset()),"dayend"===t&&(n.setHours(n.getHours()+24),n.setSeconds(n.getSeconds()-1)),n.getTime()}catch(t){return e}},Yn=e=>{var i,o;let{t:a,action:r,tenantId:d,closeModal:u,submitAction:s,applicationData:c,businessService:v,cardClassName:p,cardFormWrapperClassName:E,cardFormClassName:f,formClassName:g}=e;const{data:_,isLoading:h}=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[T,y]=l.useState({}),[S,b]=l.useState({}),[I,D]=l.useState([]),[C,A]=l.useState({}),[x,O]=l.useState(null),[w,L]=l.useState(null),[P,R]=l.useState(null),k=window.Digit.Utils.browser.isMobile(),M=window.location.href.includes("/employee");function F(e){O(e.target.files[0])}return l.useEffect(()=>{var e;D(null==_||null===(e=_.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[_]),l.useEffect(()=>{!function(){try{R(null);const e=function(){if(x){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(x.size>=5242880)R(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=x&&x.type&&!e.test(null==x?void 0:x.type))R(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=N(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",x,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?L(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):R(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),R(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[x]),l.useEffect(()=>{var e,l,i,o;"DisconnectWSConnection"==(null===(e=c)||void 0===e||null===(l=e.processInstance)||void 0===l?void 0:l.businessService)||"DisconnectSWConnection"==(null===(i=c)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&y((e=>{var l;let{t:i,action:o,selectFile:a,uploadedFile:r,setUploadedFile:d,businessService:u,error:s}=e,c=!1;return null!=o&&null!==(l=o.action)&&void 0!==l&&l.includes("SEND_BACK"),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(c=!0),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${null==u?void 0:u.toUpperCase()}_${null==o?void 0:o.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[c&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!c,type:"custom",populators:c?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,l)=>n.createElement(t.DatePicker,m({onChange:e.onChange,date:e.value},l))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:a,onDelete:()=>{d(null)},message:r?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:s,iserror:s,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:I,selectedApprover:C,setSelectedApprover:A,selectFile:F,uploadedFile:w,setUploadedFile:L,businessService:v,error:P})):r&&y((e=>{var l;let{t:i,action:o,selectFile:a,uploadedFile:r,setUploadedFile:d,businessService:u,error:s}=e;return null!=o&&null!==(l=o.action)&&void 0!==l&&l.includes("SEND_BACK"),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${null==u?void 0:u.toUpperCase()}_${null==o?void 0:o.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:a,onDelete:()=>{d(null)},message:r?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:s,iserror:s,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:I,selectedApprover:C,setSelectedApprover:A,selectFile:F,uploadedFile:w,setUploadedFile:L,businessService:v,error:P}))},[r,I,w,P]),r&&T.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Vn,{label:a(T.label.heading)}),headerBarEnd:n.createElement(Kn,{onClick:u}),actionCancelLabel:a(T.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(T.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:k&&M?{width:"100%",height:"auto"}:{}},h?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:T.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n,i,o,a,u,v,m,p;if(null!==(t=c)&&void 0!==t&&t.isBillAmend){var E,f,g,_,h,T,y,S,b;const t={...null===(E=c)||void 0===E||null===(f=E.billAmendmentDetails)||void 0===f?void 0:f.additionalDetails,comments:null!=e&&e.comments?e.comments:null},l={...null===(g=c)||void 0===g?void 0:g.billAmendmentDetails,workflow:{businessId:null===(_=c)||void 0===_||null===(h=_.billAmendmentDetails)||void 0===h?void 0:h.amendmentId,action:null==r?void 0:r.action,tenantId:d,businessService:null!==(T=c)&&void 0!==T&&null!==(y=T.applicationType)&&void 0!==y&&y.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(S=c)&&void 0!==S&&null!==(b=S.applicationType)&&void 0!==b&&b.includes("WATER")?"WS":"SW",assignes:null!=C&&C.uuid?[{uuid:null==C?void 0:C.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:w?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==x?void 0:x.name,fileStoreId:w}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:w?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==x?void 0:x.name,fileStoreId:w}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=C&&C.uuid?[{uuid:null==C?void 0:C.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:w?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==x?void 0:x.name,fileStoreId:w}]:[]}};s({AmendmentUpdate:l})}else{if(c={...c,action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:[],assignes:null!=C&&C.uuid?[{uuid:null==C?void 0:C.uuid}]:[],wfDocuments:w?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==x?void 0:x.name,fileStoreId:w}]:null,processInstance:{...null===(l=c)||void 0===l?void 0:l.processInstance,action:null==r?void 0:r.action,assignes:null!=C&&C.uuid?[{uuid:null==C?void 0:C.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:w?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==x?void 0:x.name,fileStoreId:w}]:[]}},null!=e&&e.date&&null!==(n=c)&&void 0!==n&&null!==(i=n.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=jn(null==e?void 0:e.date);c.disconnectionExecutionDate=Gn(t)}else if(null!=e&&e.date){const t=jn(null==e?void 0:e.date);c.connectionExecutionDate=Gn(t)}var N;if("DisconnectWSConnection"==(null===(o=c)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(u=c)||void 0===u||null===(v=u.processInstance)||void 0===v?void 0:v.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(N=c)||void 0===N?void 0:N.serviceType)?s({WaterConnection:c,disconnectRequest:!0}):s({SewerageConnection:c,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(m=c)||void 0===m?void 0:m.applicationType))s({SewerageConnection:c,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(p=c)||void 0===p?void 0:p.applicationType))s({WaterConnection:c,disconnectRequest:!1,reconnectRequest:!0});else{var I,D,A,O,L,P,R,k,M,F,B,W,U;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(I=t.value)&&void 0!==I&&I.adhocPenalty&&(c.additionalDetails.adhocPenalty=parseInt(null==t||null===(D=t.value)||void 0===D?void 0:D.adhocPenalty)||""),null!=t&&null!==(A=t.value)&&void 0!==A&&A.adhocPenaltyComment&&(c.additionalDetails.adhocPenaltyComment=(null==t||null===(O=t.value)||void 0===O?void 0:O.adhocPenaltyComment)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocPenaltyReason&&(c.additionalDetails.adhocPenaltyReason=(null==t||null===(P=t.value)||void 0===P?void 0:P.adhocPenaltyReason)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocRebate&&(c.additionalDetails.adhocRebate=parseInt(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(c.additionalDetails.adhocRebateComment=(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebateComment)||""),null!=t&&null!==(B=t.value)&&void 0!==B&&B.adhocRebateReason&&(c.additionalDetails.adhocRebateReason=(null==t||null===(W=t.value)||void 0===W?void 0:W.adhocRebateReason)||"");const l=sessionStorage.getItem("Digit.DUE_VERIFICATION_DATA");if(l)try{c.dueVerification=JSON.parse(l)}catch(e){console.error("Error parsing due verification data",e)}"WATER"==(null===(U=c)||void 0===U?void 0:U.serviceType)?s({WaterConnection:c,disconnectRequest:!1,reconnectRequest:!1}):s({SewerageConnection:c,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:S,formId:"modal-action",cardFormClassName:f,cardFormWrapperClassName:E,cardClassName:p,formClassName:g})):n.createElement(t.Loader,null)},qn=e=>n.createElement("h1",{className:"heading-m"},e.label),$n=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Xn=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement($n,null)),Qn=e=>{var i,o;let{t:a,action:r,tenantId:d,closeModal:u,submitAction:s,applicationData:c,businessService:v,moduleCode:m}=e;console.log("applicationData",c);const{data:p}=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,f]=l.useState({}),[g,_]=l.useState({}),[h,T]=l.useState([]),[y,S]=l.useState(null),[b,I]=l.useState(null),[D,C]=l.useState(null),[A,x]=l.useState(null),[O,w]=l.useState(!1);function L(e){I(e.target.files[0])}return l.useEffect(()=>{var e;T(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),l.useEffect(()=>{!function(){try{x(null);const e=function(){if(b){const e=function(){if(b.size>=5242880)x(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=N(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",b,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?C(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):x(a("CS_FILE_UPLOAD_ERROR"))})},function(){x(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[b]),l.useEffect(()=>{r&&f((e=>{let{t:l,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:d}=e;return{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${d}_${null==i?void 0:i.action}`,cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:l("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${l("ES_PTR_ATTACH_FILE")}${i.docUploadRequired?" *":""}`,populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:l("PTR_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+l("ES_PTR_ACTION_FILEUPLOADED"):l("ES_PTR_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:S,selectFile:L,uploadedFile:D,setUploadedFile:C,businessService:v}))},[r,h,D]),r&&E.form?n.createElement(t.Modal,{headerBarMain:n.createElement(qn,{label:a(E.label.heading)}),headerBarEnd:n.createElement(Xn,{onClick:u}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m};D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==b?void 0:b.name,filestoreId:D}]),s({PetRegistrationApplications:[{...c,workflow:t}]})},defaultValues:g,formId:"modal-action"})):n.createElement(t.Loader,null)},Zn=e=>n.createElement("h1",{className:"heading-m"},e.label),Jn=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ei=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Jn,null)),ti=e=>{var i,a,r;let{t:d,action:u,tenantId:s,closeModal:c,submitAction:v,applicationData:m,businessService:p,moduleCode:E,cardClassName:f,cardFormWrapperClassName:g,cardFormClassName:_,formClassName:h}=e;const{data:T}=Digit.Hooks.useEmployeeSearch(s,{roles:null==u||null===(i=u.roles)||void 0===i||null===(a=i[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=u&&u.isTerminateState)}),y=o.useHistory(),[S,b]=l.useState({}),[N,I]=l.useState({}),[D,C]=l.useState([]),[A,x]=l.useState(null),[O,w]=l.useState(null);return l.useEffect(()=>{var e;C(null==T||null===(e=T.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[T]),l.useEffect(()=>{"INITIATED"===(null==u?void 0:u.state)?y.push("/digit-ui/employee/asset/assetservice/edit/"+(null==m?void 0:m.applicationNo)):b((e=>{let{t:t,action:l,businessService:n}=e;return console.log("njhsegfdhjsbedwfdwe",l),{label:{heading:`WF_${null==l?void 0:l.action}_APPLICATION`,submit:`WF_${n}_${null==l?void 0:l.action}`,cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:d,action:u,approvers:D,selectedApprover:A,setSelectedApprover:x,uploadedFile:O,setUploadedFile:w,businessService:p}))},[u,D,O]),u&&S.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Zn,{label:d(S.label.heading)}),headerBarEnd:n.createElement(ei,{onClick:c}),actionCancelLabel:d(S.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:d(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==u?void 0:u.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:E};O&&(t.documents=[]),v({Asset:{...m,workflow:t}})},defaultValues:N,formId:"modal-action",cardFormClassName:_,cardFormWrapperClassName:g,cardClassName:f,formClassName:h})):n.createElement(t.Loader,null)},li=e=>n.createElement("h1",{className:"heading-m"},e.label),ni=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ii=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(ni,null)),oi=e=>{var i,o;let{t:a,action:r,tenantId:d,closeModal:u,submitAction:s,applicationData:c,businessService:v,moduleCode:m}=e;const{data:p}=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,f]=l.useState({}),[g,_]=l.useState({}),[h,T]=l.useState([]),[y,S]=l.useState(null),[b,I]=l.useState(null),[D,C]=l.useState(null),[A,x]=l.useState(null),[O,w]=l.useState(!1);function L(e){I(e.target.files[0])}return l.useEffect(()=>{var e;T(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),l.useEffect(()=>{!function(){try{x(null);const e=function(){if(b){const e=function(){if(b.size>=5242880)x(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=N(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",b,d)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?C(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):x(a("CS_FILE_UPLOAD_ERROR"))})},function(){x(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[b]),l.useEffect(()=>{r&&f((e=>{let{t:l,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r}=e;return{label:{heading:"CHB_"+(null==i?void 0:i.action),submit:"CHB_"+(null==i?void 0:i.action),cancel:"CS_COMMON_BACK"},form:[{body:[{label:l("ES_CHB_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:`${l("ES_CHB_ATTACH_FILE")}${i.docUploadRequired?" *":""}`,populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},message:a?"1 "+l("CS_ACTION_FILEUPLOADED"):l("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:S,selectFile:L,uploadedFile:D,setUploadedFile:C,businessService:v}))},[r,h,D]),r&&E.form?n.createElement(t.Modal,{headerBarMain:n.createElement(li,{label:a(E.label.heading)}),headerBarEnd:n.createElement(ii,{onClick:u}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:m};D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==b?void 0:b.name,fileStoreId:D}]),s({hallsBookingApplication:{...c,workflow:t}})},defaultValues:g,formId:"modal-action"})):n.createElement(t.Loader,null)},ai=e=>n.createElement("h1",{className:"heading-m"},e.label),ri=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),di=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(ri,null)),ui=e=>{var i,o;let{t:a,action:r,tenantId:d,closeModal:u,submitAction:s,applicationData:c,businessService:v,moduleCode:m}=e;console.log("snjdskbjdfbjskfjkbs",r);const{data:p}=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,f]=l.useState({}),[g,_]=l.useState({}),[h,T]=l.useState([]),[y,S]=l.useState(null),[b,I]=l.useState(null),[D,C]=l.useState(null),[A,x]=l.useState(null),[O,w]=l.useState(null),[L,P]=l.useState(!1);function R(e){C(e.target.files[0])}return l.useEffect(()=>{var e;T(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),l.useEffect(()=>{!function(){try{w(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)w(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=N(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",D,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?x(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):w(a("CS_FILE_UPLOAD_ERROR"))})},function(){w(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),l.useEffect(()=>{r&&f((e=>{let{t:l,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:d}=e;console.log("action",i);const u=(new Date).toISOString().split("T")[0];return console.log("todayedsta ::",u),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${d}_${null==i?void 0:i.action}`,cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:["COMPLETIONPENDING"===(null==i?void 0:i.state)?{label:l("EW_PICKUP_DATE"),type:"date",isMandatory:!0,populators:{name:"date",min:(new Date).toISOString().split("T")[0],max:new Date(Date.now()+6048e5).toISOString().split("T")[0]}}:"null","REQUESTCOMPLETED"===(null==i?void 0:i.state)?{label:l("ES_EW_ACTION_TRANSACTION_ID"),type:"text",isMandatory:!0,populators:{name:"transactionId"}}:"null","REQUESTCOMPLETED"===(null==i?void 0:i.state)?{label:l("ES_EW_ACTION_FINALAMOUNT"),type:"text",isMandatory:!0,populators:{name:"finalAmount"}}:"null",{label:l("ES_EW_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${l("ES_EW_PHOTO")}${i.docUploadRequired?" *":""}`,populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:l("EW_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+l("ES_EW_ACTION_FILEUPLOADED"):l("ES_EW_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:S,selectFile:R,uploadedFile:A,setUploadedFile:x,businessService:v}))},[r,h,A]),console.log("conggg",E),r&&E.form?n.createElement(t.Modal,{headerBarMain:n.createElement(ai,{label:a(E.label.heading)}),headerBarEnd:n.createElement(di,{onClick:u}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m};console.log("applicationData",e),A&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,filestoreId:A},{}]),c.pickUpDate=null==e?void 0:e.date,c.transactionId=null==e?void 0:e.transactionId,c.finalAmount=null==e?void 0:e.finalAmount,s({EwasteApplication:[{...c,workflow:t}]})},defaultValues:g,formId:"modal-action"})):n.createElement(t.Loader,null)},si=e=>n.createElement("h1",{className:"heading-m"},e.label),ci=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),vi=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(ci,null)),mi=e=>{var i,o;let{t:a,action:r,tenantId:d,closeModal:u,submitAction:s,applicationData:c,businessService:v,moduleCode:m}=e;const{data:p}=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[E,f]=l.useState({}),[g,_]=l.useState({}),[h,T]=l.useState([]),[y,S]=l.useState(null),[b,D]=l.useState(null),[C,A]=l.useState(null),[x,O]=l.useState(null),[w,L]=l.useState(!1);function P(e){L(!0),D(e.target.files[0])}return l.useEffect(()=>{var e;T(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),l.useEffect(()=>{!function(){try{O(null);const e=function(){if(b){const e=function(){if(b.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=I(function(){return N(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",b,d)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?A(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(a("CS_FILE_UPLOAD_ERROR"))})},function(e,t){if(L(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[b]),console.log("actyhdesh,jhfsefsef",r,c),l.useEffect(()=>{f((e=>{let{t:l,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,approvers:d,selectedApprover:u,setSelectedApprover:s,isUploading:c}=e;const v=()=>n.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:"SV_"+(null==i?void 0:i.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==i?void 0:i.action)||"REJECT"===(null==i?void 0:i.action)||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?"":{label:l("SV_ASSIGNEE"),type:"dropdown",populators:n.createElement(t.Dropdown,{option:d,t:l,optionKey:"name",select:s,selected:u})},{label:l("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:`${l("SV_ATTATCH_FILE")}${i.docUploadRequired?" *":""}`,populators:n.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:c?n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},n.createElement(v,null),n.createElement("span",null,"Uploading...")):a?"1 "+l("SV_FILE_UPLOADED"):l("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:S,selectFile:P,uploadedFile:C,setUploadedFile:A,businessService:v,isUploading:w}))},[r,h,C]),r&&E.form?n.createElement(t.Modal,{headerBarMain:n.createElement(si,{label:a(E.label.heading)}),headerBarEnd:n.createElement(vi,{onClick:u}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==c||null===(t=c.auditDetails)||void 0===t?void 0:t.createdBy]:null!=y&&y.uuid?[null==y?void 0:y.uuid]:null};C&&(l.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==b?void 0:b.name,fileStoreId:C}]),s({streetVendingDetail:{...c,workflow:l}})},defaultValues:g,formId:"modal-action"})):n.createElement(t.Loader,null)},pi=e=>n.createElement("h1",{className:"heading-m"},e.label),Ei=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),fi=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Ei,null)),gi=e=>{var i,o,a,r,d;let{t:u,action:s,tenantId:c,closeModal:v,submitAction:m,applicationData:p,businessService:E,moduleCode:f,cardClassName:g,cardFormWrapperClassName:_,cardFormClassName:h,formClassName:T}=e;const{data:y}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),{data:S}=Digit.Hooks.fsm.useVendorSearch({tenantId:c,config:{enabled:"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}});let b=[];null==S||null===(a=S.vendor)||void 0===a||a.forEach(e=>{var t,l;if("WT"===(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.description)||"WT"===(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.serviceType)){var n;const t=`${null==e?void 0:e.name} (${null==e||null===(n=e.owner)||void 0===n?void 0:n.mobileNumber})`;b.push({code:null==e?void 0:e.name,name:t,i18nKey:t,vendorId:null==e?void 0:e.id})}});const{data:I}=Digit.Hooks.fsm.useVehiclesSearch({tenantId:c,filters:{vendorId:null==p?void 0:p.vendorId},config:{enabled:"DELIVERY_PENDING"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}});let D=[];null==I||null===(r=I.vehicle)||void 0===r||null===(d=r.filter(e=>{var t,l,n;return(null==e||null===(t=e.driverData)||void 0===t?void 0:t.id)||(null==e||null===(l=e.driver)||void 0===l?void 0:l.id)||(null==e||null===(n=e.owner)||void 0===n?void 0:n.id)}))||void 0===d||d.map(e=>{var t,l,n;D.push({code:null==e?void 0:e.registrationNumber,name:null==e?void 0:e.registrationNumber,i18nKey:null==e?void 0:e.registrationNumber,tankerCapacity:null==e?void 0:e.tankCapacity,vehicleId:null==e?void 0:e.id,driverId:(null==e||null===(t=e.driverData)||void 0===t?void 0:t.ownerId)||(null==e||null===(l=e.driver)||void 0===l?void 0:l.ownerId)||(null==e?void 0:e.ownerId)||(null==e||null===(n=e.owner)||void 0===n?void 0:n.uuid)})});const[C,A]=l.useState({}),[x,O]=l.useState({}),[w,L]=l.useState([]),[P,R]=l.useState(null),[k,M]=l.useState(null),[F,B]=l.useState(null),[W,U]=l.useState(null),[H,j]=l.useState(null);function V(e){R(e.target.files[0])}return l.useEffect(()=>{var e;L(null==y||null===(e=y.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[y]),l.useEffect(()=>{!function(){try{B(null);const e=function(){if(P){const e=function(){if(P.size>=5242880)B(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=N(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",P,c)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?M(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):B(u("CS_FILE_UPLOAD_ERROR"))})},function(){B(u("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[P]),l.useEffect(()=>{s&&A((e=>{let{t:l,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,selectedVendor:d,setSelectedVendor:u,vendorDescription:s,vehicleDescription:c,selectVehicle:v,setSelectVehicle:m}=e;return{label:{heading:"RS_"+(null==i?void 0:i.action),submit:"RS_"+(null==i?void 0:i.action),cancel:"CS_COMMON_BACK"},form:[{body:[{label:l("ES_RS_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==i?void 0:i.state)&&"ASSIGN_VEHICLE_DRIVER"!==(null==i?void 0:i.action)?{label:l("RS_ASSIGN"),type:"dropdown",populators:n.createElement(t.Dropdown,{option:s,t:l,optionKey:"i18nKey",select:u,selected:d})}:"null","DELIVERY_PENDING"===(null==i?void 0:i.state)||"ASSIGN_VEHICLE_DRIVER"===(null==i?void 0:i.action)?{label:l("RS_REGISTRATION_NUMBER"),type:"dropdown",populators:n.createElement(t.Dropdown,{option:c,t:l,optionKey:"i18nKey",select:m,selected:v})}:"null",{label:`${l("ES_RS_ATTACH_FILE")}${i.docUploadRequired?" *":""}`,populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},message:a?"1 "+l("CS_ACTION_FILEUPLOADED"):l("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:u,action:s,selectFile:V,uploadedFile:k,setUploadedFile:M,selectedVendor:W,setSelectedVendor:U,vendorDescription:S?b:void 0,vehicleDescription:I||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)?D:void 0,selectVehicle:H,setSelectVehicle:j}))},[s,w,k,S,H,I]),s&&C.form?n.createElement(t.Modal,{headerBarMain:n.createElement(pi,{label:u(C.label.heading)}),headerBarEnd:n.createElement(fi,{onClick:v}),actionCancelLabel:u(C.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:u(C.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:C.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comments:null==e?void 0:e.comments,businessService:E,moduleName:f};k&&(t.documents=[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:k}]),"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)&&(p.vendorId=null==W?void 0:W.vendorId),"DELIVERY_PENDING"===(null==s?void 0:s.state)&&(p.vehicleId=null==H?void 0:H.vehicleId),"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)&&(p.vehicleId=null==H?void 0:H.vehicleId,p.driverId=null==H?void 0:H.driverId),"watertanker-fixedpoint"===E&&(t.moduleName="request-service.water_tanker",t.businessService="watertanker-fixedpoint");let l="watertanker"===E||"watertanker-fixedpoint"===E?{waterTankerBookingDetail:{...p,workflow:t}}:{mobileToiletBookingDetail:{...p,workflow:t}};m(l)},defaultValues:x,formId:"modal-action",cardFormClassName:h,cardFormWrapperClassName:_,cardClassName:g,formClassName:T})):n.createElement(t.Loader,null)},_i=e=>null!=e&&e.businessService.includes("PT")?n.createElement(ul,e):null!=e&&e.businessService.includes("ptr")?n.createElement(Qn,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")||null!=e&&e.businessService.includes("DIRECTRENEWAL")?n.createElement(ml,e):null!=e&&e.moduleCode.includes("BPAREG")?n.createElement(gl,e):null!=e&&e.moduleCode.includes("BPA")?n.createElement(yl,e):null!=e&&e.moduleCode.includes("NOC")?n.createElement(Il,e):null!=e&&e.moduleCode.includes("WS")?n.createElement(Yn,e):null!=e&&e.businessService.includes("asset-create")?n.createElement(ti,e):null!=e&&e.businessService.includes("ewst")?n.createElement(ui,e):null!=e&&e.businessService.includes("booking-refund")?n.createElement(oi,e):null!=e&&e.businessService.includes("street-vending")?n.createElement(mi,e):null!=e&&e.businessService.includes("watertanker")||null!=e&&e.businessService.includes("mobileToilet")?n.createElement(gi,e):void 0;function hi(e){let{documents:l,svgStyles:o={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:d}=e;const{t:u}=i.useTranslation(),s=window.location.href.includes("stakeholder");return n.createElement("div",{style:{marginTop:"19px"}},!s&&(null==l?void 0:l.map((e,i)=>{var o;return n.createElement(n.Fragment,{key:i},null!=e&&e.title?n.createElement(t.CardSubHeader,{style:d||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,n.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,l)=>{var i;return n.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:l},n.createElement("div",{style:{display:"flex",justifyContent:"center"}},n.createElement(t.PDFSvg,null)),n.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",color:"#505A5F"}},u(null==e?void 0:e.title)),a?null!=e&&null!==(i=e.documentType)&&void 0!==i&&i.includes("NOC")?n.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType.split(".")[1])):n.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&n.createElement("div",null,n.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))),r&&(null==l?void 0:l.length)!=i+1?n.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)})),s&&(null==l?void 0:l.map((e,l)=>{var i;return n.createElement(n.Fragment,{key:l},null!=e&&e.title?n.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,n.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,l)=>n.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=o&&o.minWidth?null==o?void 0:o.minWidth:"160px",marginRight:"20px"},key:l},n.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},n.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?n.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(null==e?void 0:e.docInfo)):null,n.createElement(t.PDFSvg,null),n.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+u(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&n.createElement("div",null,n.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const Ti=e=>{var t,i;let{t:o,formData:a,applicationData:r,docs:d,bpaActionsDetails:u}=e;const s=(null==r?void 0:r.status)||"",c=(null==u||null===(t=u.data)||void 0===t?void 0:t.nextActions)||[],v=Digit.ULBService.getStateId(),[m,p]=l.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[E,f]=l.useState(null),[g,_]=l.useState([]),[h,T]=l.useState(!0),[y,S]=l.useState(!1),[b,N]=l.useState(!1),{isLoading:I,data:D}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:C,data:A}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return l.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==D||null===(o=D.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,l;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(l=r.additionalDetails)||void 0===l?void 0:l.applicationType)}));let u=[];null===(t=i)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{var t,l,n,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==A||null===(t=A["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,o.length);o===l&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==d||null===(n=d[0])||void 0===n||null===(i=n.values)||void 0===i||i.map(t=>{var l,n;o===`${null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[0]}.${null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[1]}`&&e.uploadedDocuments[0].values.push(t)}),u.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(u)),_(u)},[!I,!C]),l.useEffect(()=>{let e=0;g.map(t=>{let l=!1;m.map(e=>{t.required&&t.code==`${e.documentType.split(".")[0]}.${e.documentType.split(".")[1]}`&&(l=!0)}),!l&&t.required&&(e+=1)}),T("0"!=e&&0!=e||!(m.length>0))},[m,y]),l.useEffect(()=>{N("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,u]),n.createElement("div",null,null==g?void 0:g.map((e,t)=>n.createElement("div",null,n.createElement(yi,{key:t,index:t,document:e,t:o,error:E,setError:f,setDocuments:p,documents:m,setCheckRequiredFields:S,applicationStatus:s,actions:c,bpaTaxDocuments:g,checkEnablingDocs:b}))))};function yi(e){var i,o;let{t:a,document:r,setDocuments:d,documents:u,index:s,bpaTaxDocuments:c,checkEnablingDocs:v}=e;const m=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],p=Digit.ULBService.getStateId(),[E,f]=l.useState(m?{...m,active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}:1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[g,_]=l.useState(null),[h,T]=l.useState(()=>(null==m?void 0:m.fileStoreId)||null),[y,S]=l.useState([]);return l.useEffect(()=>{null!=E&&E.code&&d(e=>{var t;const l=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==h?void 0:h.length)||null===h?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==h),{documentType:null==E?void 0:E.code,fileStoreId:h,documentUid:h,fileName:(null==g?void 0:g.name)||"",id:u?null===(t=u.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[h,E]),l.useEffect(()=>{try{y.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],y.map(e=>{var t,l,n;null!=E&&E.code&&r.newUploadedDocs.push({documentType:null==E?void 0:E.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.fileStoreId,tenantId:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.tenantId})}),c[s]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)))}catch(e){Promise.reject(e)}},[y,E]),l.useEffect(()=>{},[g]),n.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&n.createElement(hi,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),v?n.createElement("div",{style:{marginTop:"20px"}},n.createElement(t.LabelFieldPair,{style:{width:"100%"}},n.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),n.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:E,optionKey:"i18nKey",select:e=>f(e),style:{width:"100%"}})),n.createElement(t.LabelFieldPair,{style:{width:"100%"}},n.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:p,getFormState:e=>((e,t)=>{let l=Object.fromEntries(t),n=Object.values(l);var i;0!==Object.keys(l).length&&S(n),(i=n[n.length-1])&&_(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Si(e){let{fiReport:l,isCitizen:o=!1}=e;const{t:a}=i.useTranslation();return n.createElement(n.Fragment,null,n.createElement("div",{style:{marginTop:"10px"}},n.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),l.map((e,i)=>{var o,r,d,u,s,c;return n.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},n.createElement(t.StatusTable,null,n.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==l?void 0:l.length)?""+a("BPA_FI_REPORT"):`${a("BPA_FI_REPORT")} - ${i+1}`),n.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?`${null===(o=e.date)||void 0===o?void 0:o.split("-")[2]}/${null===(r=e.date)||void 0===r?void 0:r.split("-")[1]}/${null===(d=e.date)||void 0===d?void 0:d.split("-")[0]}`:null==e?void 0:e.date:"NA"}),n.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(u=e.questions)||void 0===u?void 0:u.length)&&(null==e||null===(s=e.questions)||void 0===s?void 0:s.map(e=>n.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},n.createElement(t.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),n.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),n.createElement(hi,{documents:(c=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==c?void 0:c.map(e=>{var t;return{title:null==e||null===(t=e.documentType)||void 0===t?void 0:t.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function bi(e){let{t:i,document:o,setNocDocuments:a,setError:r,nocDocuments:d}=e;const u=null==d?void 0:d.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],s=Digit.ULBService.getStateId(),[c,v]=l.useState(),[m,p]=l.useState(null),[E,f]=l.useState(()=>(null==u?void 0:u.fileStoreId)||null);return l.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const l=null==e?void 0:e.filter(e=>{var t,l;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.code)});return 0===(null==E?void 0:E.length)||null===E?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==E),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:E,documentUid:E,fileName:(null==m?void 0:m.name)||""}]})},[E]),l.useEffect(()=>{!function(){try{r(null);const e=function(){if(m){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(m.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=m&&m.type&&!e.test(null==m?void 0:m.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=N(function(){return f(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",m,Digit.ULBService.getStateId())).then(function(e){var t,l,n,o;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?f(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):r(i("CS_FILE_UPLOAD_ERROR"))})},function(){r(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[m]),n.createElement("div",{style:{}},n.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},n.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),l=Object.values(t);var n;(n=l[l.length-1])&&p(n.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Ni=e=>{var i;let{t:o,noc:a,docs:r,isNoc:d,applicationData:u,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),m=(null==u?void 0:u.status)||"",p=(null==c||null===(i=c.data)||void 0===i?void 0:i.nextActions)||[],{data:E}=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:d}),{data:f}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!d}),{data:g}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[_,h]=l.useState([]),[T,y]=l.useState([]),[S,b]=l.useState(!1),[N,I]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[D,C]=l.useState(null),A=window.location.href.includes("/employee/");return l.useEffect(()=>{var e;h(null==g||null===(e=g["common-masters"])||void 0===e?void 0:e.DocumentType)},[g]),l.useEffect(()=>{var e,t,l;let n,i=[];var o,r,s,c;n=d?null==E||null===(o=E.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==f||null===(s=f.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,l;return e.WFState==(null==u?void 0:u.status)&&e.RiskType==(null==u?void 0:u.riskType)&&e.ServiceType==(null==u||null===(t=u.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==u||null===(l=u.additionalDetails)||void 0===l?void 0:l.applicationType)}),null!==(e=n)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(l=t.docTypes)&&void 0!==l&&l[0]&&(n[0].docTypes[0].nocType=n[0].nocType,n[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(n[0].docTypes[0]));let v=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==_||_.forEach(l=>{let n=l.code.slice(0,null==t?void 0:t.length);t===n&&(e.hasDropdown=!0,e.dropdownData.push(l))}),v.push(e)}),y(v))},[E,_]),l.useEffect(()=>{b("NOC_VERIFICATION_INPROGRESS"===m&&(null==p?void 0:p.length)>0)},[u,c]),n.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:A?""+o(`BPA_${null==a?void 0:a.nocType}_HEADER`):o(`BPA_${null==a?void 0:a.nocType}_HEADER`),labelStyle:{fontSize:"20px",width:"150%"}}),s&&s.map((e,l)=>{if(null!=e&&e.value)return n.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:A?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#2E9E8F"}:{color:"#D83A2F"}}:{className:"border-none",label:A?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),n.createElement(hi,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),S&&(null==T?void 0:T.map((e,t)=>n.createElement(bi,{key:t,document:e,t:o,error:D,setError:C,setNocDocuments:I,nocDocuments:N,checkEnablingDocs:S}))))},Ii=e=>{let{permissions:i,t:o}=e;const[a,r,d]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[u,s,c]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);l.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const v=window.Digit.Utils.browser.isMobile();return n.createElement("div",null,n.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,l)=>n.createElement(t.CheckBox,{key:l,styles:{margin:"20px 0 40px",maxWidth:v?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,l)=>{const n=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>l===t?{...e,checked:n}:e))})(e,0,l),isLabelFirst:!0,index:l})),null==u?void 0:u.map((e,l)=>n.createElement("div",null,n.createElement(t.TextInput,{key:l,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{s(()=>null==u?void 0:u.map((l,n)=>{var i;return t===n?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:l}))})(e,l),textInputStyle:{maxWidth:v?"96%":"830px",width:v?"96%":"830px"},style:v?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),n.createElement(t.LinkButton,{label:n.createElement("div",null,n.createElement("span",null,n.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:v?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...u];t.splice(e,1),s([...t])})(l)}))),n.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{s([...u,{label:""}])}}))};function Di(e){let{documents:o,svgStyles:a={},isSendBackFlow:r=!1,applicationStatus:d}=e;const{t:u}=i.useTranslation(),[s,c]=l.useState(()=>[]),[v,m]=(Digit.ULBService.getCurrentTenantId(),l.useState({})),[p,E]=l.useState(null),[f,g]=l.useState({});l.useEffect(()=>{let e=0,t=0;null==o||o.forEach(l=>{var n;null==l||null===(n=l.values)||void 0===n||n.forEach(l=>{var n,i;l.isPhoto||(e++,(f[null==l||null===(n=l.originalDoc)||void 0===n?void 0:n.id]??(null==l||null===(i=l.originalDoc)||void 0===i?void 0:i.isVerified))&&t++)})});const l=!(!d||"PENDING_FOR_DOCUMENT_VERIFICATION"===d)||0===e||t===e;window.isDocumentsVerified=l,window.dispatchEvent(new CustomEvent("DOCUMENTS_VERIFIED",{detail:l}))},[f,o,d]),l.useEffect(()=>{var e;let t=[];null==o||o.forEach(e=>{t=[...t,...e.values?e.values:[]]}),c(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[o]),l.useEffect(()=>{var e;null!=s&&s.length&&"BillAmend"===(null==o||null===(e=o[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(s,Digit.ULBService.getCurrentTenantId()).then(e=>{m(null==e?void 0:e.data)}):null!=s&&s.length&&Digit.UploadServices.Filefetch(s,Digit.ULBService.getStateId()).then(e=>{m(null==e?void 0:e.data)})},[s]);const _=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),h=window.location.href.includes("employee/ws"),T=window.location.href.includes("stakeholder"),y=function(e,t){try{return Promise.resolve(N(function(){return Promise.resolve(fetch(e)).then(function(e){if(!e.ok)throw new Error("HTTP error! status: "+e.status);return Promise.resolve(e.blob()).then(function(l){const n=e.headers.get("content-type")||l.type,i=window.URL.createObjectURL(l),o=t.replace(/\.[^/.]+$/,"");let a="pdf";n&&(n.includes("image/jpeg")?a="jpg":n.includes("image/png")?a="png":n.includes("image/webp")?a="webp":n.includes("application/pdf")?a="pdf":n.includes("text/plain")&&(a="txt"));const r=document.createElement("a");r.href=i,r.setAttribute("download",`${o}.${a}`),document.body.appendChild(r),r.click(),r.parentNode.removeChild(r),setTimeout(()=>window.URL.revokeObjectURL(i),100)})})},function(t){console.error("Error downloading file",t),window.open(e,"_blank")}))}catch(e){return Promise.reject(e)}};return n.createElement("div",{style:{marginTop:"19px"}},(()=>{if(!p)return null;const e=p.toLowerCase().includes(".pdf")||p.toLowerCase().includes("pdf");return n.createElement(t.Modal,{headerBarMain:n.createElement("h1",{className:"heading-m"},"Document Preview"),headerBarEnd:n.createElement("div",{style:{display:"flex",gap:"15px",alignItems:"center",paddingRight:"10px"}},n.createElement("div",{onClick:()=>{y(p,"Document.pdf")},style:{cursor:"pointer",display:"flex",alignItems:"center"},title:"Download Document"},n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n.createElement("polyline",{points:"7 10 12 15 17 10"}),n.createElement("line",{x1:"12",y1:"15",x2:"12",y2:"3"}))),n.createElement("div",{onClick:()=>E(null),style:{cursor:"pointer",display:"flex",alignItems:"center"}},n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#000000",width:"24px",height:"24px"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),hideSubmit:!0,popupStyles:{maxWidth:"80vw",width:"100%"},popupModuleMianStyles:{display:"flex",justifyContent:"center",alignItems:"center",padding:"0",overflowY:"hidden"}},e?n.createElement("iframe",{src:p,title:"Document Preview",style:{width:"100%",height:"80vh",border:"none",display:"block"}}):n.createElement("img",{src:p,alt:"Document Preview",style:{maxWidth:"100%",maxHeight:"80vh",objectFit:"contain",display:"block"}}))})(),!T&&(null==o?void 0:o.map((e,l)=>{var i;return n.createElement(n.Fragment,{key:l},null!=e&&e.title?n.createElement(t.CardSubHeader,{style:_?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,h?n.createElement("div",{style:{marginTop:"8px"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?e.values.map((e,l)=>((e,l)=>{var i;const o=null===(i=v[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],a=(e=>{if(!e)return"";const t=e.split(".");return(t[t.length-1]||"").replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())})(null==e?void 0:e.documentType),r=(null==e?void 0:e.documentUid)||"",s=null==e?void 0:e.isPhoto;let c="",m="",p="";return"WS_IDENTITY_PROOF"===e.title?(c="Identity Proof*",m="Identity Proof Document Number",p="Upload Identity Proof Document*"):"WS_OWNERSHIP_PROOF"===e.title?(c="Ownership Proof*",m="Ownership Proof Document Number",p="Upload Ownership Proof*"):"WS_OTHER_DOCUMENTS"===e.title?(c="Other Documents*",m="Other Document Number",p="Upload Other Documents*"):"WS_APPLICANT_PHOTO"===e.title?p="Upload Applicant Photo*":(c=((null==e?void 0:e.categoryLabel)||"Document")+"*",m="Document Number",p="Upload Document*"),n.createElement("div",{key:l,style:{marginBottom:"24px"}},n.createElement(t.StatusTable,null,!s&&n.createElement(n.Fragment,null,n.createElement(t.Row,{label:c,text:a||u("NA")}),n.createElement(t.Row,{label:m,text:r||u("NA")})),n.createElement(t.Row,{label:p,text:n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"16px"}},s?o?n.createElement("div",{style:{position:"relative"}},n.createElement("img",{src:o,alt:"Applicant Photo",style:{width:"100px",height:"100px",objectFit:"cover",borderRadius:"4px",border:"1px solid #ccc"}})):n.createElement("div",{style:{fontSize:"14px",color:"#505A5F"}},u("NA")):n.createElement("div",{onClick:()=>{o&&E(o)},disabled:!o,style:{cursor:"pointer"}},n.createElement(t.ViewsIcon,null)),!s&&n.createElement(n.Fragment,null,n.createElement("div",{onClick:()=>{o&&y(o,(a||"Document")+".pdf")},title:"Download Document",style:{cursor:"pointer",display:"flex",alignItems:"center"}},n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n.createElement("polyline",{points:"7 10 12 15 17 10"}),n.createElement("line",{x1:"12",y1:"15",x2:"12",y2:"3"}))),n.createElement("label",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"14px",color:"#0B0C0C",margin:0}},n.createElement("input",{key:`chk-${null==e||null===(f=e.originalDoc)||void 0===f?void 0:f.id}-${null==e||null===(_=e.originalDoc)||void 0===_?void 0:_.isVerified}`,type:"checkbox",className:"verify-doc-checkbox",style:{width:"18px",height:"18px",accentColor:"#F47738",cursor:d&&"PENDING_FOR_DOCUMENT_VERIFICATION"!==d?"not-allowed":"pointer"},disabled:d&&"PENDING_FOR_DOCUMENT_VERIFICATION"!==d,defaultChecked:null==e||null===(h=e.originalDoc)||void 0===h?void 0:h.isVerified,onChange:t=>{var l;const n=t.target.checked;null!=e&&e.originalDoc&&(e.originalDoc.isVerified=n),null!=e&&null!==(l=e.originalDoc)&&void 0!==l&&l.id&&g(t=>({...t,[e.originalDoc.id]:n}))}}),"Check Verified")))})));var f,_,h})(e,l)):!window.location.href.includes("citizen")&&n.createElement("div",null,n.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))):n.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i,o;return n.createElement("a",{target:"_",href:null===(i=v[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:l},n.createElement("div",{style:{display:"flex",justifyContent:"center"}},n.createElement(t.PDFSvg,null)),n.createElement("p",{style:_?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},u(null==e?void 0:e.title)),r?null!=e&&null!==(o=e.documentType)&&void 0!==o&&o.includes("NOC")?n.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType.split(".")[1])):n.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&n.createElement("div",null,n.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),T&&(null==o?void 0:o.map((e,l)=>{var i;return n.createElement(n.Fragment,{key:l},null!=e&&e.title?n.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,n.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return n.createElement("a",{target:"_",href:null===(i=v[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:null!=a&&a.minWidth?null==a?void 0:a.minWidth:"160px",marginRight:"20px"},key:l},n.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},n.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?n.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(null==e?void 0:e.docInfo)):null,n.createElement(t.PDFSvg,null),n.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},""+u(null==e?void 0:e.title))))}):!window.location.href.includes("citizen")&&n.createElement("div",null,n.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function Ci(e){let{taxHeadEstimatesCalculation:l}=e;const{taxHeadEstimates:o}=l,{t:a}=i.useTranslation();return n.createElement("div",{style:{marginTop:"40px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),n.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==o?void 0:o.map((e,l)=>n.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:l===(null==o?void 0:o.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),n.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),n.createElement(t.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==l?void 0:l.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Ai(e){let{floors:l}=e;const{t:o}=i.useTranslation();return n.createElement(n.Fragment,null,l.map(e=>{var l;return n.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},o(null==e?void 0:e.title)),null==e||null===(l=e.values)||void 0===l?void 0:l.map((e,l)=>{var i;return n.createElement(n.Fragment,{key:l},n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==l?"16px":"revert"}},o(e.title)),n.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},n.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:n.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title),text:o(e.value)||"N/A",last:l===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}const xi=e=>{var o,a,r;let{scrutinyDetails:d,paymentsList:u=[]}=e;const{t:s}=i.useTranslation(),c=e=>null!=e&&e.value&&null!=e&&e.isTransLate?n.createElement("span",{style:{color:"#2E9E8F"}},s(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?s(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void s("NA");return n.createElement(l.Fragment,null,!(null!=d&&d.isChecklist)&&n.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},n.createElement(t.StatusTable,null,n.createElement("div",null,null==d||null===(o=d.values)||void 0===o?void 0:o.map((e,l)=>null!=e&&e.isUnit?n.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red"}:{},key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.value?`${c(e)} ${s(null==e?void 0:e.isUnit)}`:s("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?n.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen",wordBreak:"break-all"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red",wordBreak:"break-all"}:{wordBreak:"break-all"},key:""+e.title,label:""+s(""+e.title),text:c(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},s(null==e?void 0:e.title)):n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},s(null==e?void 0:e.title))),null==d||null===(a=d.permit)||void 0===a?void 0:a.map((e,l)=>n.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),n.createElement("div",null,null==d||null===(r=d.scruntinyDetails)||void 0===r?void 0:r.map((e,i)=>n.createElement(l.Fragment,null,n.createElement(t.Row,{className:"border-none",label:""+s(null==e?void 0:e.title),labelStyle:{width:"150%"}}),n.createElement("a",{href:null==e?void 0:e.value}," ",n.createElement(t.PDFSvg,null)," "),n.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},s(null==e?void 0:e.text))))))))},Oi=e=>{var o,a,r,d,u;let{edcrDetails:s,applicationData:c}=e;const{t:v}=i.useTranslation(),m=window.Digit.Utils.browser.isMobile(),p=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],E=e=>{const t=e;return(e,l,n)=>e[t]},f=l.useMemo(()=>p.map(e=>({Header:v(""+e.name),accessor:E(e.id),id:e.id})));function g(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,d,u;l.push({Floor:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(d=e.occupancies)||void 0===d||null===(u=d[0])||void 0===u?void 0:u.CarpetArea)||0,key:v("BPA_FLOOR_NAME_"+e.number)})}),l}function _(e){var t;let l=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,n="";if((null==l?void 0:l.length)>0){var i,o;let t=null===(i=l[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(n=t.map(e=>e?""+v("BPA_SUBOCCUPANCYTYPE_"+function(e,t,l){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===l&&(l=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,l);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return n||"NA"}return n.createElement(l.Fragment,null,n.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},n.createElement(t.StatusTable,null,null==s||null===(o=s.values)||void 0===o?void 0:o.map((e,l)=>null!=e&&e.isHeader?n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},v(null==e?void 0:e.title)):n.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+v(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==s||null===(a=s.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(d=r.value)||void 0===d||null===(u=d.planDetail)||void 0===u?void 0:u.blocks.map((e,l)=>{var i,o,a,r,d;return n.createElement("div",{key:l,style:(null==s||null===(i=s.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(d=r.blocks)||void 0===d?void 0:d.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},v("BPA_BLOCK_SUBHEADER")," ",l+1),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+v("BPA_SUB_OCCUPANCY_LABEL"),text:_(l)})),n.createElement("div",{style:window.location.href.includes("citizen")||m?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},n.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:v,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:g(e),columns:f,getCellProps:e=>({style:{}})})))})))},wi=e=>{let{headComment:t,otherComment:l}=e;return n.createElement("div",{className:"checkpoint-comments-wrap"},n.createElement("h4",null,t),n.createElement("p",null,l))},Li=e=>{var l,o,a;let{data:r,OpenImage:d,privacy:u={}}=e;const{t:s}=i.useTranslation();return n.createElement("div",null,r.date&&n.createElement("p",null,r.date),n.createElement("p",null,r.name),r.mobileNumber&&n.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},n.createElement(t.TelePhone,{mobile:r.mobileNumber,privacy:u}),n.createElement("p",null,"    ")),r.source&&n.createElement("p",null,s("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),r.comment&&n.createElement(wi,{otherComment:null==r?void 0:r.otherComment,headComment:null==r?void 0:r.comment}),null!=r&&r.wfComment?n.createElement("div",null,null==r||null===(l=r.wfComment)||void 0===l?void 0:l.map((e,t)=>n.createElement("div",{className:"TLComments",key:t},n.createElement("h3",null,s("WF_COMMON_COMMENTS")),n.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(o=r.thumbnailsToShow)||void 0===o||null===(a=o.thumbs)||void 0===a?void 0:a.length)>0?n.createElement("div",{className:"TLComments"},n.createElement("h3",null,s("CS_COMMON_ATTACHMENTS")),n.createElement(t.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:(e,t)=>{d(e,t,null==r?void 0:r.thumbnailsToShow)}})):null)};function Pi(e){let{units:l}=e;const{t:o}=i.useTranslation();return n.createElement(n.Fragment,null,l.map((e,l)=>{var i;return n.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${o(null==e?void 0:e.title)} ${l+1}`),n.createElement(n.Fragment,{key:l},n.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},n.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:n.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"N/A",last:l===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function Ri(e){let{units:l}=e;const{t:o}=i.useTranslation();return n.createElement(n.Fragment,null,l.map((e,l)=>{var i;return n.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${o(null==e?void 0:e.title)} ${l+1}`),n.createElement(n.Fragment,{key:l},n.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},n.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:n.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"NA",last:l===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const ki=e=>{var l;let{wsAdditionalDetails:o}=e;const{t:a}=i.useTranslation();(r=location.search)&&(/^[?#]/.test(r)?r.slice(1):r).split("&").reduce((e,t)=>{let[l,n]=t.split("=");return e[l]=n?decodeURIComponent(n.replace(/\+/g," ")):"",e},{});var r,{connectionDetails:d}=(null==o?void 0:o.additionalDetails)||{connectionDetails:[],plumberDetails:[]};return n.createElement(n.Fragment,null,n.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==o||null===(l=o.additionalDetails)||void 0===l?void 0:l.connectionDetails)&&n.createElement(t.StatusTable,null,n.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},a("WS_COMMON_CONNECTION_DETAIL")),n.createElement("div",null,n.createElement("div",{className:"connection-details-new-value-wrapper"},null==d?void 0:d.map((e,l)=>n.createElement("div",{key:l},n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+a(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""}))))))))},Mi=[{title:"PT_PENDING_DUES_FROM_EARLIER",value:"Pending dues from earlier"},{title:"PT_MISCALCULATION_OF_EARLIER_ASSESSMENT",value:"Miscalculation of earlier Assessment"},{title:"PT_ONE_TIME_PENALITY",value:"One time penality"},{title:"PT_OTHERS",value:"Others"}],Fi=[{title:"PT_ADVANCED_PAID_BY_CITIZEN_EARLIER",value:"Advanced Paid By Citizen Earlier"},{title:"PT_REBATE_PROVIDED_BY_COMMISSIONER_EO",value:"Rebate provided by commissioner/EO"},{title:"PT_ADDITIONAL_AMOUNT_CHARGED_FROM_THE_CITIZEN",value:"Additional amount charged from the citizen"},{title:"PT_OTHERS",value:"Others"}],Bi=e=>{var o,a,r,d;let{wsAdditionalDetails:u}=e;const{t:s}=i.useTranslation(),[c,v,p]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[E,f,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),h=!(null==u||null===(o=u.additionalDetails)||void 0===o||!o.isPaid),[T,y]=l.useState(!1),[S,b]=l.useState(c||{}),[N,I]=l.useState(null),[D,C]=l.useState(u.additionalDetails.data?u.additionalDetails.data:{}),[A,x]=l.useState(u.additionalDetails.values?u.additionalDetails.values:[]),O=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(O,"BillingService",["TaxHeadMaster"]),l.useEffect(()=>{var e,t,l;const i={...null==u||null===(e=u.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails};if((null==c||null===(l=c.billDetails)||void 0===l?void 0:l.length)>0){var o,a,r,d,s,m,p;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:n.createElement("span",null,"₹",null==c||null===(o=c.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:n.createElement("span",null,"₹",null==c||null===(r=c.billDetails)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.charge)},{title:"WS_TAX_HEADER",value:n.createElement("span",null,"₹",null==c||null===(s=c.billDetails)||void 0===s||null===(m=s[0])||void 0===m?void 0:m.taxAmount)}];x(e),C(null==c||null===(p=c.billDetails)||void 0===p?void 0:p[0])}else v(i),b(i)},[]);let w={};const L=e=>n.createElement("h1",{className:"heading-m"},e.label),P=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),R=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(P,null)),k=function(e,t,l){void 0===t&&(t=!1);let n={...S};if("adhocPenalty"!=e&&"adhocRebate"!=e||!l.target.value)t?(n[e+"_data"]=l,n[e]=l.title,"PT_OTHERS"==l.title&&"adhocPenaltyReason"==e&&(n.adhocPenaltyComment=""),"PT_OTHERS"==l.title&&"adhocRebateReason"==e&&(n.adhocRebateComment="")):n[e]=l.target.value;else{var i,o;const t=0==(null==l||null===(i=l.target)||void 0===i?void 0:i.value)?1:Math.sign(null==l||null===(o=l.target)||void 0===o?void 0:o.value)||-1;n[e]=1==t?l.target.value:""}b(n)};return n.createElement(l.Fragment,null,n.createElement("div",{style:{lineHeight:"19px",maxWidth:"100%",minWidth:"280px"}},A&&n.createElement(t.StatusTable,null,n.createElement("div",null,null==A?void 0:A.map((e,l)=>n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),n.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),n.createElement("div",null,n.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+s("WS_COMMON_TOTAL_AMT"),text:n.createElement("span",null,"₹",(null==D?void 0:D.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),n.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+s("CS_INBOX_STATUS_FILTER"),text:s(h?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:h?{color:"#2E9E8F"}:{color:"#D83A2F"}}))),null!=u&&null!==(a=u.additionalDetails)&&void 0!==a&&a.isAdhocRebate?n.createElement("div",{onClick:e=>{y(!0)}},n.createElement("span",{className:"add-details-link hover-button",style:{cursor:"pointer",color:"#a82227"}},s("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,T&&n.createElement(t.Modal,{headerBarMain:n.createElement(L,{label:s("PT_ADD_REBATE_PENALITY")}),headerBarEnd:n.createElement(R,{onClick:()=>{b(c),y(!1)}}),actionCancelLabel:s("PT_CANCEL"),actionCancelOnSubmit:()=>{b(c),y(!1)},actionSaveLabel:s("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=S&&S.adhocPenalty?Number(null==S?void 0:S.adhocPenalty):0,l=null!=S&&S.adhocRebate?Number(null==S?void 0:S.adhocRebate):0;var n,i;if(t||l)if(l>(null==u||null===(n=u.additionalDetails)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.totalAmount))I({isError:!1,isWarning:!0,key:"error",message:s("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,d,c,m,p,E,g,h;const e=null==u||null===(o=u.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==u||null===(r=u.additionalDetails)||void 0===r||null===(d=r.appDetails)||void 0===d?void 0:d.tenantId,l={...null==u||null===(c=u.additionalDetails)||void 0===c||null===(m=c.appDetails)||void 0===m?void 0:m.additionalDetails,...S};u.additionalDetails.appDetails.additionalDetails=l;const n={CalculationCriteria:"WATER"==(null==u||null===(p=u.additionalDetails)||void 0===p||null===(E=p.appDetails)||void 0===E?void 0:E.service)?[{applicationNo:e,tenantId:t,waterConnection:u.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:u.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==u||null===(g=u.additionalDetails)||void 0===g||null===(h=g.appDetails)||void 0===h?void 0:h.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(n,i).then((e,t)=>{var l,n,i,o,a,r,d,u,s,c,m,p,E,g,h;(null==e||null===(l=e.Calculation)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(E=e.Calculation)||void 0===E||null===(g=E[0])||void 0===g||null===(h=g.taxHeadEstimates)||void 0===h||h.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const T=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(u=e.Calculation)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(m=c[0])||void 0===m?void 0:m.taxAmount}];f(jn(e.Calculation[0])),C(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),x(T),S.billDetails=null==e?void 0:e.Calculation,v(S),y(!1)}).catch(e=>{var t,l,n,i,o,a;I({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(n=l.Errors[0])&&void 0!==n&&n.message?s(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):s("PT_COMMON_ADD_REBATE_PENALITY")})})}else I({isError:!1,isWarning:!0,key:"warning",message:s("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto",background:"#f0f3f7"}},n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},n.createElement(t.Card,null,n.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_PENALTY")),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,s("PT_TX_HEADS")),n.createElement("div",{className:"field"},n.createElement(t.Dropdown,{isMandatory:!0,option:Mi,optionKey:"title",select:e=>k("adhocPenaltyReason",!0,e),selected:(null==S?void 0:S.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:s}))),"PT_OTHERS"===(null==S||null===(r=S.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,s("PT_REASON")),n.createElement("div",{className:"field"},n.createElement(t.TextInput,m({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==S?void 0:S.adhocPenaltyComment)||"",onChange:e=>k("adhocPenaltyComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")})))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),n.createElement("div",{className:"field"},n.createElement(t.TextInput,m({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==S?void 0:S.adhocPenalty)||"",onChange:e=>k("adhocPenalty",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")}))))),n.createElement(t.Card,null,n.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_REBATE")),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,s("PT_TX_HEADS")),n.createElement("div",{className:"field"},n.createElement(t.Dropdown,{isMandatory:!0,option:Fi,optionKey:"title",select:e=>k("adhocRebateReason",!0,e),selected:(null==S?void 0:S.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:s}))),"PT_OTHERS"===(null==S||null===(d=S.adhocRebateReason_data)||void 0===d?void 0:d.title)&&n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,s("PT_REASON")),n.createElement(t.TextInput,m({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==S?void 0:S.adhocRebateComment)||"",onChange:e=>k("adhocRebateComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")}))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),n.createElement("div",{className:"field"},n.createElement(t.TextInput,m({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==S?void 0:S.adhocRebate)||"",onChange:e=>k("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")}))))))),N&&n.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==N?void 0:N.isWarning,error:null==N||!N.isWarning,label:s(null==N?void 0:N.message),onClose:()=>{I(!1)},isDleteBtn:!0})))},Wi=e=>{let{style:t}=e;return n.createElement("span",null,n.createElement("svg",{style:{...t},display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},Ui=e=>{let{t:l,userType:i=!1,infoBannerLabel:o="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:d=""}=e;i=i||Digit.SessionStorage.get("userType");const u=window.Digit.Utils.browser.isMobile();return n.createElement(n.Fragment,null,n.createElement("div",{style:u?{}:{width:"80%"}},n.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},n.createElement("div",null,n.createElement(t.InfoBannerIcon,null),n.createElement("h2",{style:{color:"#3498DB"}},l(o))),l(a)+" ",n.createElement(Wi,{style:{display:"inline",marginBottom:"5px"}})," "+l(r),n.createElement("div",null," "+l(d)))))},Hi=e=>{var o,a,r,d,u,s,c;let{wsAdditionalDetails:v}=e;const{t:m}=i.useTranslation(),[p,E]=l.useState(!1),[f,g]=l.useState({}),_=e=>n.createElement("h1",{className:"heading-m"},e.label),h=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),T=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(h,null));return n.createElement(l.Fragment,null,n.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=v&&null!==(o=v.additionalDetails)&&void 0!==o&&o.isViewBreakup?n.createElement("div",{onClick:e=>(()=>{var e;let t=v.additionalDetails.data||{};const l=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),n=l?JSON.parse(l):{};null!=n&&null!==(e=n.value)&&void 0!==e&&e.totalAmount&&(t=null==n?void 0:n.value),g(t),E(!0)})(),style:{marginTop:"12px"}},n.createElement("span",{className:"add-details-link hover-button"},m("WS_PAYMENT_VIEW_BREAKUP"))):null,p&&n.createElement(t.Modal,{headerBarMain:n.createElement(_,{label:m("WS_CALCULATION_BREAKUP")}),headerBarEnd:n.createElement(T,{onClick:()=>{E(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},n.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},n.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_APPLICATION_FEE_HEADER")),null==f||null===(a=f.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:n.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),n.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:n.createElement("span",null,"₹",Number(null==f?void 0:f.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),n.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_SERVICE_FEE_HEADER")),null==f||null===(d=f.billSlabData)||void 0===d||null===(u=d.CHARGES)||void 0===u?void 0:u.map(e=>n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:n.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),n.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:n.createElement("span",null,"₹",Number(null==f?void 0:f.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==f||null===(s=f.billSlabData)||void 0===s||null===(c=s.TAX)||void 0===c?void 0:c.map(e=>n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:n.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),n.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:n.createElement("span",null,"₹",Number(null==f?void 0:f.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},ji={root:{width:"100%",marginTop:"2px",overflowX:"auto",boxShadow:"none"},table:{minWidth:700,backgroundColor:"rgba(250, 250, 250, var(--bg-opacity))"},cell:{maxWidth:"7em",minWidth:"1em",border:"1px solid #e8e7e6",padding:"4px 5px",fontSize:"0.8em",textAlign:"left",lineHeight:"1.5em"},cellHeader:{overflow:"hidden",textOverflow:"ellipsis"},cellLeft:{},cellRight:{}},Vi=e=>{let{className:t="table",headers:l=[],values:o=[],arrears:a=0}=e;const{t:r}=i.useTranslation();return n.createElement(n.Fragment,null,n.createElement("div",{style:ji.root},n.createElement("table",{className:"table-fixed-column-common-pay",style:ji.table},n.createElement("thead",null,n.createElement("tr",null,n.createElement("th",{style:{...ji.cell,...ji.cellLeft,...ji.cellHeader}},r("CS_BILL_PERIOD")),l.map((e,t)=>n.createElement("th",{style:{...ji.cell,...l.length==t+1?ji.cellRight:{},...ji.cellHeader},key:t},r(e))))),n.createElement("tbody",null,Object.values(o).map((e,t)=>n.createElement("tr",{key:t},n.createElement("td",{style:{...ji.cell,...ji.cellLeft},component:"th",scope:"row"},Object.keys(o)[t]),l.map((t,i)=>n.createElement("td",{style:{...ji.cell,textAlign:"left",...l.length==i+1?ji.cellRight:{},whiteSpace:"pre"},key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),n.createElement("tr",null,n.createElement("td",{style:{...ji.cell,...ji.cellLeft}}),l.map((e,t)=>t==l.length-1?n.createElement("td",{style:{...ji.cell,...ji.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},a):t==l.length-2?n.createElement("td",{style:{...ji.cell,textAlign:"left"},key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):n.createElement("td",{style:ji.cell,key:t,numeric:!0})))))))},zi={buttonStyle:{display:"flex",justifyContent:"flex-end",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},Ki=e=>{var t,o,a;let{bill:r={}}=e;const{t:d}=i.useTranslation();let u={},s=(null==r||null===(t=r.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const c=(null===(o=s)||void 0===o?void 0:o.reduce((e,t,l)=>0===l?e:e+t.amount,0))||0;let v="₹ "+((null==c||null===(a=c.toFixed)||void 0===a?void 0:a.call(c,0))||Number(0).toFixed(0));s.shift(),s.map(e=>{let t=function(e){var t,l,n;void 0===e&&(e={});let i={};const{billAccountDetails:o=[]}=e;return o.map(e=>{i[e.taxHeadCode]={value:e.amount,order:e.order}}),i.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},i.CS_BILL_DUEDATE={value:(null===(l=e)||void 0===l?void 0:l.expiryDate)&&new Date(null===(n=e)||void 0===n?void 0:n.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);u[((e,t)=>{const l=new Date(e),n=new Date(t);return n.getYear()-l.getYear()!=0?`FY${l.getYear()+1900}-${n.getYear()-100}`:`${l.toLocaleDateString()}-${n.toLocaleDateString()}`})(e.fromPeriod,e.toPeriod)]=t});let m={};!u||Object.keys(u).map((e,t)=>{Object.keys(u[e]).map(t=>{m[t]=u[e]&&u[e][t]&&u[e][t].order||0})});let p=[];p=Object.keys(m),p.sort((e,t)=>m[e]-m[t]);const[E,f]=l.useState(!1);return 0==c||c<0?n.createElement("span",null):n.createElement(n.Fragment,null,n.createElement("div",{style:zi.headerStyle},d("CS_ARREARS_DETAILS")),E&&n.createElement(Vi,{headers:[...p],values:u,arrears:v}),!E&&n.createElement("div",{style:zi.buttonStyle},n.createElement("button",{type:"button",onClick:()=>{f(!0)}},d("CS_SHOW_CARD"))),E&&n.createElement("div",{style:zi.buttonStyle},n.createElement("button",{type:"button",onClick:()=>{f(!1)}},d("CS_HIDE_CARD"))))},Gi=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Yi=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Gi,null)),qi=e=>{let{t:l,closeModal:i}=e;console.log(" ----- Renew POP coming "),Digit.Hooks.sv.useCreateDemand();const a=o.useHistory();return n.createElement(n.Fragment,null,n.createElement(t.Modal,{headerBarMain:n.createElement(e=>n.createElement("h1",{className:"heading-m"},e.label),{label:"SV_WANT_TO_EDIT"}),headerBarEnd:n.createElement(Yi,{onClick:i}),actionCancelLabel:l("CS_COMMON_BACK"),actionCancelOnSubmit:i,hideSubmit:!0,formId:"modal-action"},n.createElement(t.Card,{style:{boxShadow:"none"}},n.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},n.createElement(t.SubmitBar,{label:l("SV_YES_PROCEED_WITH_APPLICATION"),onSubmit:()=>{a.push("renew-application/info")}}),n.createElement(t.SubmitBar,{label:l("SV_NO_PROCEED_PAYEMNT"),onSubmit:()=>{console.log(" testing coming compilter"),a.push("renew-application/check/makePayment")}})))))},$i=e=>{let{applicationData:o}=e;const{t:a}=i.useTranslation(),[r,d]=l.useState(""),[u,s]=l.useState([]),c=l.useMemo(()=>[{Header:a("K No."),accessor:"kno"},{Header:a("Full Name"),accessor:"fullName"},{Header:a("Full Address"),accessor:"fullAddress"},{Header:a("Due Amount"),accessor:"dueAmount"},{Header:a("Total Amount"),accessor:"totalAmount"}],[a]);return l.useEffect(()=>{const e=sessionStorage.getItem("Digit.DUE_VERIFICATION_DATA");if(e)try{s(JSON.parse(e))}catch(e){console.error("Error parsing due verification data",e)}else null!=o&&o.dueVerification&&Array.isArray(o.dueVerification)&&(s(o.dueVerification),sessionStorage.setItem("Digit.DUE_VERIFICATION_DATA",JSON.stringify(o.dueVerification)))},[o]),n.createElement("div",{style:{marginBottom:"20px"}},n.createElement("h2",{style:{fontSize:"24px",fontWeight:"bold",marginBottom:"16px"}},a("Due Verification")),n.createElement("div",{style:{display:"flex",alignItems:"flex-end",gap:"20px",marginBottom:"20px"}},n.createElement("div",{style:{flex:1}},n.createElement("span",{style:{fontSize:"16px",color:"#0B0C0C",marginBottom:"8px",display:"inline-block"}},a("K No.(Existing KNo of same property)")," ",n.createElement("span",{style:{color:"red"}},"*")),n.createElement(t.TextInput,{type:"number",value:r,onChange:e=>d(e.target.value),style:{width:"100%",marginBottom:"0"}})),n.createElement("div",{style:{flex:1,paddingBottom:"2px"}},n.createElement("button",{type:"button",onClick:()=>{if(r){const e={kno:r,fullName:"John Doe",fullAddress:"123 Main St, New Delhi, Delhi 110001",dueAmount:"1500",totalAmount:"1500"},t=[...u,e];s(t),sessionStorage.setItem("Digit.DUE_VERIFICATION_DATA",JSON.stringify(t)),d("")}},style:{background:"linear-gradient(135deg, #1f5fa8, #0b2e5b)",padding:"8px 24px",borderRadius:"4px",border:"none",cursor:"pointer"}},n.createElement(t.AddIcon,null)))),u.length>0&&n.createElement("div",{style:{marginTop:"30px",overflowX:"auto"}},n.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:a,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,data:u,columns:c,getCellProps:e=>({style:{padding:"12px"}})})))},Xi=()=>{const{t:e}=i.useTranslation(),[o,a]=l.useState(null),[r,d]=l.useState(""),[u,s]=l.useState("");return n.createElement("div",{style:{marginBottom:"20px"}},n.createElement("h2",{style:{fontSize:"24px",fontWeight:"bold",marginBottom:"16px"}},e("Inspection Information")),n.createElement("div",{style:{display:"flex",gap:"20px",marginBottom:"20px",flexWrap:"wrap"}},n.createElement("div",{style:{flex:"1"}},n.createElement("span",{style:{fontSize:"16px",color:"#0B0C0C",marginBottom:"8px",display:"inline-block"}},e("Inspection Type")," ",n.createElement("span",{style:{color:"red"}},"*")),n.createElement(t.Dropdown,{option:[{name:"Select",code:""}],optionKey:"name",id:"inspectionType",selected:o,select:a,t:e,style:{width:"100%"}})),n.createElement("div",{style:{flex:"1"}},n.createElement("span",{style:{fontSize:"16px",color:"#0B0C0C",marginBottom:"8px",display:"inline-block"}},e("Inspection Date")," ",n.createElement("span",{style:{color:"red"}},"*")),n.createElement(t.DatePicker,{date:r,onChange:d,style:{width:"100%"}}))),n.createElement("div",{style:{display:"flex",gap:"20px",marginBottom:"20px",flexWrap:"wrap"}},n.createElement("div",{style:{flex:"1"}},n.createElement("span",{style:{fontSize:"16px",color:"#0B0C0C",marginBottom:"8px",display:"inline-block"}},e("Inspector Name")," ",n.createElement("span",{style:{color:"red"}},"*")),n.createElement(t.TextInput,{value:u,onChange:e=>s(e.target.value),style:{width:"50%",marginBottom:"0"}}))))};function Qi(e){var a,r,d,u,s,c,v,m,p,E,f,g,h,T;let{applicationDetails:y,workflowDetails:S,isDataLoading:b,applicationData:N,timelineStatusPrefix:I,showTimeLine:D=!0,statusAttribute:C="status",paymentsList:A,oldValue:x,isInfoLabel:O=!1}=e;const{t:w}=i.useTranslation(),[L,P]=l.useState(!1);let{id:R}=o.useParams();function k(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}const[M,F]=l.useState({}),[B,W]=l.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!==(null==N?void 0:N.status)||B.loading||B.loaded||B.canLoad||W({loading:!1,loaded:!1,canLoad:!0}),null==B||!B.canLoad||B.loading||B.loaded||(W({loading:!0,loaded:!1,canLoad:!0}),function(e,t,l,n){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){l(a),n({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(l){if((null==i||null===(l=i.Assessments)||void 0===l?void 0:l.length)>0)return Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==N?void 0:N.tenantId)||tenantId,null==N?void 0:N.propertyId,F,W));const U=e=>{if(null==e||void 0===e||""===e)return"NA";const t=new Date(e);let l=t.getMonth()+1,n=t.getDate();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,`${n}/${l}/${t.getFullYear()}`},H=function(e,t,l){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:U(null==N||null===(i=N.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==N?void 0:N.channel)||""};return n.createElement(Li,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,d,u,s,c,v,m,p,E,f,g,h,T,S,b,I;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==y?void 0:y.tenantId,businessIds:null==y?void 0:y.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let l="";return l="+91 "+_.get(e,`ProcessInstances[${t}].assignes[0].mobileNumber`),l}}},D=l[t-1],C={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:null==e||null===(d=e.assignes)||void 0===d||null===(u=d[0])||void 0===u?void 0:u.name,mobileNumber:(null==N||null===(s=N.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.uuid)===(null==e||null===(m=e.assignes)||void 0===m||null===(p=m[0])||void 0===p?void 0:p.uuid)&&null!=N&&null!==(E=N.processInstance)&&void 0!==E&&null!==(f=E.assignes)&&void 0!==f&&null!==(g=f[0])&&void 0!==g&&g.mobileNumber?null==N||null===(h=N.processInstance)||void 0===h||null===(T=h.assignes)||void 0===T||null===(S=T[0])||void 0===S?void 0:S.mobileNumber:null==e||null===(b=e.assignes)||void 0===b||null===(I=b[0])||void 0===I?void 0:I.mobileNumber,comment:w(null==e?void 0:e.comment),wfComment:D?D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return n.createElement(Li,{data:C,OpenImage:k,privacy:i})}{var D,C,A,x,O;const t={date:U(null==N||null===(D=N.auditDetails)||void 0===D?void 0:D.lastModifiedTime),name:null==e||null===(C=e.assignes)||void 0===C||null===(A=C[0])||void 0===A?void 0:A.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(x=e.assignes)||void 0===x||null===(O=x[0])||void 0===O?void 0:O.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return n.createElement(Li,{data:t,OpenImage:k})}},j=(e,t)=>e?t?e:w(e):w("NA"),V=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),z=window.location.href.includes("employee/noc"),K=window.location.href.includes("employee/obps"),G=()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||V?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{},Y=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${j(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${w(null==e?void 0:e.isUnit)}`:w("N/A"):null!=e&&e.value?j(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):w("N/A"),[q,$]=l.useState(!1);return n.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},O?n.createElement(Ui,{t:w,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==y||null===(a=y.applicationDetails)||void 0===a?void 0:a.map((e,l)=>{var i,a,r,d,u,s,c,v,m,p,E,f,g,_,h,T,b,I,D,C,O,L,k,F,B,W,U,H,j,q,$,X,Q,Z,J,ee,te,le,ne,ie;return n.createElement(n.Fragment,{key:l},n.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")||V?{lineHeight:"19px",maxWidth:"100%",minWidth:"280px"}:{}},(null==e||null===(i=e.title)||void 0===i?void 0:i.trim())&&(0!==l||e.asSectionHeader?n.createElement(t.CardSectionHeader,{style:0===l&&V?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"16px",fontSize:"24px"}},w(e.title),null!=e&&e.Component?n.createElement(e.Component,null):null):n.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},w(e.title))),(null==e?void 0:e.isTable)&&n.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse",border:"1px solid black"}},n.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map((e,t)=>n.createElement("th",{style:{padding:"10px",paddingLeft:"5px",border:"1px solid black"},key:t},w(e)))),null==e?void 0:e.tableRows.map((l,i)=>n.createElement("tr",{key:i},l.map((l,a)=>Array.isArray(l)&&l.length>1&&!0===e.isMaintenance?n.createElement("td",{style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"},key:a},n.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"5px"}},l.map((e,l)=>n.createElement("a",{key:l,onClick:()=>{Digit.UploadServices.Filefetch([e.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var t,l,n;const i=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.url;if(i){const e=i.split(",")[0];e?window.open(e,"_blank"):console.error("No valid URL found to open!")}else console.error("URL is missing in the response!")}).catch(e=>{console.error("Error fetching file:",e)})},rel:"noopener noreferrer",style:{marginRight:"5px",display:"inline-block",cursor:"pointer"}},n.createElement(t.PDFSvg,{style:{width:"25px",height:"25px"}}))))):n.createElement("td",{key:a,style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"}},l&&!0===l.editButton?n.createElement("span",{style:{display:"inline-flex",gap:"10px",alignItems:"center"}},n.createElement(o.Link,{to:{pathname:"/digit-ui/employee/asset/assetservice/maintenance-edit/"+R,state:{data:l.data}}},n.createElement("button",null," ",n.createElement(t.EditIcon,null)," ")),n.createElement("div",{key:i,onClick:()=>{P(!0)},style:{cursor:"pointer"}},n.createElement(t.ViewsIcon,null))):w(l)))))),n.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||V?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(a=e.values)||void 0===a?void 0:a.map((l,i)=>{var a,r,d;return!0===l.map&&"N/A"!==l.value?n.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:w(l.title),label:w(l.title),text:n.createElement("img",{src:w(l.value),alt:"",privacy:null==l?void 0:l.privacy})}):!0===(null==l?void 0:l.isLink)?n.createElement(t.Row,{key:w(l.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?n.createElement("div",{style:{width:"200%"}},n.createElement(o.Link,{to:null==l?void 0:l.to},n.createElement("span",{className:"link",style:{color:"#a82227"}},w(null==l?void 0:l.title)))):z||K?""+w(l.title):w(l.title),text:n.createElement("div",null,n.createElement(o.Link,{to:null==l?void 0:l.to},n.createElement("span",{className:"link",style:{color:"#a82227"}},null==l?void 0:l.value))),last:i===(null==e||null===(d=e.values)||void 0===d?void 0:d.length)-1,caption:l.caption,className:"border-none",rowContainerStyle:G(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):n.createElement("div",{key:i},window.location.href.includes("modify")?n.createElement(t.Row,{className:"border-none",key:""+l.title,label:""+w(""+l.title),privacy:null==l?void 0:l.privacy,text:null!=l&&l.oldValue?null==l?void 0:l.oldValue:null!=l&&l.value?null==l?void 0:l.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):n.createElement(t.Row,{key:w(l.title),label:w(l.title),text:Y(l),last:i===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:l.caption,className:"border-none",privacy:null==l?void 0:l.privacy,rowContainerStyle:G(),labelStyle:{wordBreak:"break-all",fontWeight:l.isBold?"bold":"normal",fontStyle:l.isBold?"italic":"normal"},textStyle:{wordBreak:"break-all",fontWeight:l.isBold?"bold":"normal",fontStyle:l.isBold?"italic":"normal"}}),"PT_TOTAL_DUES"===l.title?n.createElement(Ki,{bill:null===(r=M.Bill)||void 0===r?void 0:r[0]}):"")})))),(null==e?void 0:e.belowComponent)&&n.createElement(e.belowComponent,null),(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.inspectionReport)&&n.createElement(xi,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:A}),(null==y||null===(d=y.applicationData)||void 0===d||null===(u=d.additionalDetails)||void 0===u||null===(s=u.fieldinspection_pending)||void 0===s?void 0:s.length)>0&&(null==e||null===(c=e.additionalDetails)||void 0===c?void 0:c.fiReport)&&n.createElement(Si,{fiReport:null==y||null===(v=y.applicationData)||void 0===v||null===(m=v.additionalDetails)||void 0===m?void 0:m.fieldinspection_pending}),(null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.floors)&&n.createElement(Ai,{floors:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.units)&&n.createElement(Ri,{units:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.units}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.accessories)&&n.createElement(Pi,{units:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.accessories}),(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.permissions)&&(null==S||null===(b=S.data)||void 0===b||null===(I=b.nextActions)||void 0===I?void 0:I.length)>0&&n.createElement(Ii,{applicationData:null==y?void 0:y.applicationData,t:w,permissions:null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.permissions}),(null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.obpsDocuments)&&n.createElement(Ti,{t:w,applicationData:null==y?void 0:y.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:S}),(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.noc)&&n.createElement(Ni,{t:w,isNoc:!0,NOCdata:e.values,applicationData:null==y?void 0:y.applicationData,docs:e.additionalDetails.noc,noc:null===(L=e.additionalDetails)||void 0===L?void 0:L.data,bpaActionsDetails:S}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.scruntinyDetails)&&n.createElement(xi,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&n.createElement(xi,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.subOccupancyTableDetails)&&n.createElement(Oi,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==y?void 0:y.applicationData}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documentsWithUrl)&&n.createElement(hi,{documents:null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documents)&&n.createElement(Di,{documents:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documents,applicationStatus:null==N?void 0:N.applicationStatus}),(null==e||null===(q=e.additionalDetails)||void 0===q?void 0:q.documents)&&("PENDING_FOR_FIELD_INSPECTION"===(null==N?void 0:N.applicationStatus)||"PENDING_APPROVAL_FOR_CONNECTION"===(null==N?void 0:N.applicationStatus))&&n.createElement($i,{applicationData:N}),(null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.documents)&&"PENDING_APPROVAL_FOR_CONNECTION"===(null==N?void 0:N.applicationStatus)&&n.createElement(Xi,null),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.taxHeadEstimatesCalculation)&&n.createElement(Ci,{taxHeadEstimatesCalculation:null==e||null===(Q=e.additionalDetails)||void 0===Q?void 0:Q.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&n.createElement(ki,{wsAdditionalDetails:e,oldValue:x}),(null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.redirectUrl)&&n.createElement(o.Link,{to:null==e||null===(J=e.additionalDetails)||void 0===J||null===(ee=J.redirectUrl)||void 0===ee?void 0:ee.url},n.createElement("span",{className:"add-details-link hover-button"},null==e||null===(te=e.additionalDetails)||void 0===te||null===(le=te.redirectUrl)||void 0===le?void 0:le.title)),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&n.createElement(Bi,{wsAdditionalDetails:e,workflowDetails:S}),(null==e||null===(ie=e.additionalDetails)||void 0===ie?void 0:ie.estimationDetails)&&n.createElement(Hi,{wsAdditionalDetails:e,workflowDetails:S}))}),D&&(null==S||null===(r=S.data)||void 0===r||null===(d=r.timeline)||void 0===d?void 0:d.length)>0&&n.createElement(n.Fragment,null,n.createElement(t.BreakLine,null),((null==S?void 0:S.isLoading)||b)&&n.createElement(t.Loader,null),!(null!=S&&S.isLoading)&&!b&&n.createElement(l.Fragment,null,n.createElement("div",{id:"timeline"},n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},w("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=S&&null!==(u=S.data)&&void 0!==u&&u.timeline&&1===(null==S||null===(s=S.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)?n.createElement(t.CheckPoint,{isCompleted:!0,label:w(`${I}${null==S||null===(v=S.data)||void 0===v||null===(m=v.timeline[0])||void 0===m?void 0:m.state}`),customChild:H(null==S||null===(p=S.data)||void 0===p?void 0:p.timeline[0],null==S||null===(E=S.data)||void 0===E?void 0:E.timeline)}):n.createElement(t.ConnectingCheckPoints,null,(null==S||null===(f=S.data)||void 0===f?void 0:f.timeline)&&(null==S||null===(g=S.data)||void 0===g?void 0:g.timeline.slice(0,q?null==S?void 0:S.data.timeline.length:2).map((e,l,i)=>{var o;let a="";var r,d,u,s,c,v;return window.location.href.includes("/obps/")&&(a=null!=S&&null!==(r=S.data)&&void 0!==r&&null!==(d=r.timeline[l-1])&&void 0!==d&&null!==(u=d.state)&&void 0!==u&&u.includes("BACK_FROM")||null!=S&&null!==(s=S.data)&&void 0!==s&&null!==(c=s.timeline[l-1])&&void 0!==c&&null!==(v=c.state)&&void 0!==v&&v.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0===l?"":"_DONE"),n.createElement(n.Fragment,{key:l},n.createElement(t.CheckPoint,{keyValue:l,isCompleted:0===l,info:e.comment,label:w(`${I}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[C]}${a}`),customChild:H(e,l,null==S||null===(o=S.data)||void 0===o?void 0:o.timeline)}))}))),(null==S||null===(h=S.data)||void 0===h||null===(T=h.timeline)||void 0===T?void 0:T.length)>2&&n.createElement(t.LinkButton,{label:w(q?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{$(e=>!e)}})))),n.createElement("div",null,L&&n.createElement(qi,{t:w,closeModal:()=>setRnewButton(!1),actionCancelOnSubmit:()=>setRnewButton(!1),application:application})))}function Zi(e){var l,i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,h,T;let{t:y,showToast:S,closeToast:b,businessService:N}=e;if(null!=N&&N.includes("NewTL")||null!=N&&N.includes("TL")||null!=N&&N.includes("EDITRENEWAL")){var I;let e="";switch(null==S||null===(I=S.action)||void 0===I?void 0:I.action){case"SENDBACK":e="error"===(null==S?void 0:S.key)?null==S||null===(l=S.error)||void 0===l?void 0:l.message:y("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==S?void 0:S.key)?null==S||null===(i=S.error)||void 0===i?void 0:i.message:y("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==S?void 0:S.key)?null==S||null===(o=S.error)||void 0===o?void 0:o.message:y("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==S?void 0:S.key)?null==S||null===(a=S.error)||void 0===a?void 0:a.message:y("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==S?void 0:S.key)?null==S||null===(r=S.error)||void 0===r?void 0:r.message:y("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==S?void 0:S.key)?null==S||null===(d=S.error)||void 0===d?void 0:d.message:y("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==S?void 0:S.key)?null==S||null===(u=S.error)||void 0===u?void 0:u.message:y("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==S?void 0:S.key)?null==S||null===(s=S.error)||void 0===s?void 0:s.message:y(`ES_${N}_${null==S||null===(c=S.action)||void 0===c?void 0:c.action}_UPDATE_SUCCESS`)}return n.createElement(n.Fragment,null,S&&n.createElement(t.Toast,{error:"error"===S.key,label:e,onClose:b}))}if(null!=N&&N.includes("BPA")||null!=N&&N.includes("BPA_LOW")||null!=N&&N.includes("BPA_OC")){var D;const e=function(e){var t;void 0===e&&(e=[]);let l=e[0];return l=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=N&&N.includes("BPA_OC")?y(e[1]):y(e[0]),l};let l="";switch(null==S||null===(D=S.action)||void 0===D?void 0:D.action){case"REVOCATE":l="error"===(null==S?void 0:S.key)?null==S||null===(v=S.error)||void 0===v?void 0:v.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":l="error"===(null==S?void 0:S.key)?null==S||null===(m=S.error)||void 0===m?void 0:m.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":l="error"===(null==S?void 0:S.key)?null==S||null===(p=S.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":l="error"===(null==S?void 0:S.key)?null==S||null===(E=S.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":l="error"===(null==S?void 0:S.key)?null==S||null===(f=S.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":l="error"===(null==S?void 0:S.key)?null==S||null===(g=S.error)||void 0===g?void 0:g.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":l="error"===(null==S?void 0:S.key)?null==S||null===(_=S.error)||void 0===_?void 0:_.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:l="error"===(null==S?void 0:S.key)?null==S||null===(h=S.error)||void 0===h?void 0:h.message:y(`ES_${N}_${null==S||null===(T=S.action)||void 0===T?void 0:T.action}_UPDATE_SUCCESS`)}return n.createElement(n.Fragment,null,S&&n.createElement(t.Toast,{error:"error"===S.key,label:l,onClose:b}))}{var C,A;const e="error"===(null==S?void 0:S.key)?null==S||null===(C=S.error)||void 0===C?void 0:C.message:`ES_${N}_${null==S||null===(A=S.action)||void 0===A?void 0:A.action}_UPDATE_SUCCESS`;return n.createElement(n.Fragment,null,S&&n.createElement(t.Toast,{error:"error"===S.key,label:y(e),onClose:b}))}}function Ji(e){var l,o,a,r,d,u,s,c,v,m,p,E,f,g,_,h,T,y,S;let{workflowDetails:b,displayMenu:N,onActionSelect:I,setDisplayMenu:D,businessService:C,forcedActionPrefix:A,ActionBarStyle:x={},MenuStyle:O={},isAction:w,applicationDetails:L}=e;const{t:P}=i.useTranslation();let R=Digit.UserService.getUser();const k=n.useRef(),[M,F]=n.useState(()=>"undefined"!=typeof window&&void 0!==window.isDocumentsVerified&&!window.isDocumentsVerified);if(n.useEffect(()=>{"undefined"!=typeof window&&void 0!==window.isDocumentsVerified&&F(!window.isDocumentsVerified);const e=e=>{F(!e.detail)};if("undefined"!=typeof window)return window.addEventListener("DOCUMENTS_VERIFIED",e),()=>window.removeEventListener("DOCUMENTS_VERIFIED",e)},[]),window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};R=null==t?void 0:t.value}const B=null===(l=R)||void 0===l||null===(o=l.info)||void 0===o||null===(a=o.roles)||void 0===a?void 0:a.map(e=>e.code);let W=!1,U=!1,H=(null==b||null===(r=b.data)||void 0===r||null===(d=r.actionState)||void 0===d||null===(u=d.nextActions)||void 0===u?void 0:u.filter(e=>(null==B?void 0:B.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==b||null===(s=b.data)||void 0===s||null===(c=s.nextActions)||void 0===c?void 0:c.filter(e=>(null==B?void 0:B.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(k,()=>{D(!1)},N),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==H?void 0:H.length)||null!=H&&null!==(v=H[0])&&void 0!==v&&null!==(m=v.redirectionUrl)&&void 0!==m&&m.pathname.includes("/pt/property-details/")&&1==(null==H?void 0:H.length)?(U=!1,W=!0):(null==H?void 0:H.length)>0&&(U=!0,W=!1);const j=Digit.SessionStorage.get("User"),V=null==j||null===(p=j.info)||void 0===p?void 0:p.uuid,z=null==L||null===(E=L.applicationData)||void 0===E||null===(f=E.auditDetails)||void 0===f?void 0:f.lastModifiedBy;return n.createElement(n.Fragment,null,!(null!=b&&b.isLoading)&&U&&!W&&!w&&n.createElement(t.ActionBar,{style:{...x}},N&&(null!=b&&null!==(g=b.data)&&void 0!==g&&null!==(_=g.actionState)&&void 0!==_&&_.nextActions||null!=b&&null!==(h=b.data)&&void 0!==h&&h.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:A||"WF_EMPLOYEE_"+(null==C?void 0:C.toUpperCase()),options:H,optionKey:"action",t:P,onSelect:I,style:O}):null,"ewst"===C?z===V||null==z?n.createElement(t.SubmitBar,{ref:k,label:P("WF_TAKE_ACTION"),onSubmit:()=>D(!N),disabled:M}):n.createElement(t.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+P("EW_ALERT_ANOTHER_VENDOR")):n.createElement(t.SubmitBar,{ref:k,label:P("WF_TAKE_ACTION"),onSubmit:()=>D(!N),disabled:M})),!(null!=b&&b.isLoading)&&!U&&W&&!w&&n.createElement(t.ActionBar,{style:{...x}},n.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==H||null===(T=H[0])||void 0===T?void 0:T.action,value:null==H||null===(y=H[0])||void 0===y?void 0:y.action,onClick:e=>{I((null==H?void 0:H[0])||{})}},P(`${A||"WF_EMPLOYEE_"+(null==C?void 0:C.toUpperCase())}_${null==H||null===(S=H[0])||void 0===S?void 0:S.action}`))))}const eo=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),to=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(eo,null));function lo(e){let{action:l,closeWarningPopup:o}=e;const{t:a}=i.useTranslation(),r=window.Digit.Utils.browser.isMobile();return n.createElement(n.Fragment,null,n.createElement(t.Modal,{headerBarMain:n.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:n.createElement(to,{onClick:()=>{o()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},n.createElement(t.Card,null,n.createElement("div",{style:{marginBottom:"30px"}},n.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==l?void 0:l.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),n.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+a("PT_AMOUNT_DUE"),text:"₹"+a(null==l?void 0:l.AmountDueForPay)}),n.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},n.createElement(t.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:o,style:{marginLeft:"10px"}}),n.createElement(t.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(`${window.location.origin}${null==l||null===(e=l.redirectionUrl)||void 0===e?void 0:e.pathname}`)},style:{marginLeft:"10px"}})))),")")}const no=e=>{var r;const d=Digit.ULBService.getCurrentTenantId(),u=Digit.ULBService.getStateId(),{t:s}=i.useTranslation(),c=o.useHistory();let{id:v}=o.useParams();const[m,p]=l.useState(!1),[E,f]=l.useState(null),[g,_]=l.useState(!1),[h,T]=l.useState(!1),[y,S]=l.useState(!1),{applicationDetails:b,showToast:I,setShowToast:D,isLoading:C,isDataLoading:A,applicationData:x,mutate:O,nocMutation:w,workflowDetails:L,id:P,businessService:R,closeToast:k,moduleCode:M,timelineStatusPrefix:F,forcedActionPrefix:B,statusAttribute:W,ActionBarStyle:U,MenuStyle:H,paymentsList:j,showTimeLine:V=!0,oldValue:z,isInfoLabel:K=!1,clearDataDetails:G,isAction:Y=!1}=e;l.useEffect(()=>{I&&L.revalidate()},[I]);const q=a.useQueryClient(),$=()=>{f(null),_(!1)};return C||h?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,C?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,n.createElement(Qi,{applicationDetails:b,id:P,workflowDetails:L,isDataLoading:A,applicationData:x,businessService:R,timelineStatusPrefix:F,statusAttribute:W,paymentsList:j,showTimeLine:V,oldValue:z,isInfoLabel:K}),g?n.createElement(_i,{t:s,action:E,tenantId:d,state:u,id:v,applicationDetails:b,applicationData:null==b?void 0:b.applicationData,closeModal:$,submitAction:function(e,t,l){void 0===t&&(t=!1),void 0===l&&(l={});try{let n=!1;const i=function(i,o,a,r,d,u,v,m,p,f,g,_){if(0!=(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(a=o.comment)||void 0===a?void 0:a.length)&&0!=(null==e||null===(r=e.Licenses)||void 0===r||null===(d=r[0])||void 0===d||null===(u=d.comment)||void 0===u?void 0:u.length)&&0!=(null==e||null===(v=e.WaterConnection)||void 0===v||null===(m=v.comment)||void 0===m?void 0:m.length)&&0!=(null==e||null===(p=e.SewerageConnection)||void 0===p||null===(f=p.comment)||void 0===f?void 0:f.length)&&0!=(null==e||null===(g=e.BPA)||void 0===g||null===(_=g.comment)||void 0===_?void 0:_.length)){function h(t){if(n)return t;O&&(T(!0),O(e,{onError:(e,t)=>{T(!1),D({key:"error",error:e}),setTimeout(k,5e3)},onSuccess:(e,t)=>{var n,i,o,a,r,d,u,v,m,p,f,g;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),T(!1),null!==(n=l)&&void 0!==n&&n.bpa&&(e.selectedAction=E,c.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=l)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=E,c.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=l)&&void 0!==o&&o.isNoc&&c.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0?null!=t&&null!==(r=t.AmendmentUpdate)&&void 0!==r&&null!==(d=r.workflow)&&void 0!==d&&d.action.includes("SEND_BACK")?D({key:"success",label:s("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(u=t.AmendmentUpdate)&&void 0!==u&&null!==(v=u.workflow)&&void 0!==v&&v.action.includes("RE-SUBMIT")?D({key:"success",label:s("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(m=t.AmendmentUpdate)&&void 0!==m&&null!==(p=m.workflow)&&void 0!==p&&p.action.includes("APPROVE")?D({key:"success",label:s("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(f=t.AmendmentUpdate)&&void 0!==f&&null!==(g=f.workflow)&&void 0!==g&&g.action.includes("REJECT")&&D({key:"success",label:s("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(D({key:"success",action:E}),G&&setTimeout(G,3e3),setTimeout(k,5e3),q.clear(),q.refetchQueries("APPLICATION_SEARCH"))}})),$()}T(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const i=function(){if(!1!==t&&w){var e;const l=null===(e=t)||void 0===e?void 0:e.map(e=>null==w?void 0:w.mutateAsync(e)),i=N(function(){return T(!0),Promise.resolve(Promise.all(l)).then(function(e){e&&e.map(e=>{var t,l;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.nocType)})})},function(e){var t,l,i,o,a,r,d,u,c,v,m,p;T(!1);let E=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(i=l.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?s(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(d=r.Errors)||void 0===d||null===(u=d[0])||void 0===u?void 0:u.code):(null==e||null===(c=e.response)||void 0===c||null===(v=c.data)||void 0===v||null===(m=v.Errors)||void 0===m||null===(p=m[0])||void 0===p?void 0:p.message)||e;$(),D({key:"error",error:{message:E}}),setTimeout(k,5e3),n=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(h):h(i)}alert("Please fill in the comments before submitting")}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==L||null===(r=L.data)||void 0===r?void 0:r.timeline,businessService:R,workflowDetails:L,moduleCode:M,cardFormWrapperClassName:"modal-form"}):null,y?n.createElement(lo,{action:E,workflowDetails:L,businessService:R,isWarningPop:y,closeWarningPopup:()=>{S(!1)}}):null,n.createElement(Zi,{t:s,showToast:I,closeToast:k,businessService:R}),n.createElement(Ji,{isAction:Y,workflowDetails:L,displayMenu:m,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)D({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(k,5e3);else if(null!=e&&e.isWarningPopUp)S(!0);else if(null!=e&&e.redirectionUrll){var t,l,n,i,o;if("ACTIVATE_CONNECTION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action))c.push(""+(null==e||null===(n=e.redirectionUrll)||void 0===n?void 0:n.pathname),JSON.stringify({data:null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.state,url:`${null===(o=location)||void 0===o?void 0:o.pathname}${location.search}`}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(l=e.redirectionUrll)||void 0===l?void 0:l.action)){var a,r;c.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),{data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state})}else{var d;window.location.assign(`${window.location.origin}/digit-ui/employee/payment/collect/${null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.pathname}`)}}else if(null!=e&&e.redirectionUrl){var u,s;c.push({pathname:null===(u=e.redirectionUrl)||void 0===u?void 0:u.pathname,state:{...null===(s=e.redirectionUrl)||void 0===s?void 0:s.state}})}else _(!0);f(e),p(!1)},setDisplayMenu:p,businessService:R,forcedActionPrefix:B,ActionBarStyle:U,MenuStyle:H,applicationDetails:b})))},io=()=>n.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("polyline",{points:"20 6 9 17 4 12"})),oo=()=>n.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("circle",{cx:"12",cy:"12",r:"10"}),n.createElement("polyline",{className:"clock-hands2",points:"12 6 12 12 16 14"})),ao=e=>{var l;let{workflowDetails:o,hideTimeline:a}=e;const{t:r}=i.useTranslation(),d=null==o||null===(l=o.data)||void 0===l?void 0:l.processInstances;return d&&0!==d.length?n.createElement(t.Card,{className:"workflow-timeline-card2 digit-form-composer",style:{background:"#fff",padding:"16px",height:a?"100%":""}},n.createElement("div",{className:"timeline-header-wrapper "+(a?"collapsed":"")},n.createElement(t.CardSubHeader,{style:{marginBottom:"0",fontSize:"16px",fontWeight:"700",color:"#374151"},className:a?"hidden-content":""},r("WORKFLOW_TIMELINE"))),n.createElement("div",{className:a?"hidden-content":"timeline-container2"},d.map((e,t)=>{var l,i,o,a,u,s,c;const v=(e=>0===e?"current2":"completed2")(t),m=t!==d.length-1&&d.length>1,p=(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.lastModifiedTime)||(null==e||null===(i=e.auditDetails)||void 0===i?void 0:i.createdTime);return n.createElement("div",{key:t,className:"timeline-item2 "+v},n.createElement("div",{className:"timeline-marker2"},n.createElement("div",{className:"timeline-circle2"},n.createElement("completed2"===v?io:oo,null)),m&&n.createElement("div",{className:"timeline-line2"})),n.createElement("div",{className:"timeline-content2"},n.createElement("div",{className:"timeline-header2"},n.createElement("div",{className:"timeline-title2"},r("WF_"+(null==e||null===(o=e.state)||void 0===o?void 0:o.state))),n.createElement("span",{className:"timeline-date2"},(e=>{if(!e)return"N/A";const t=new Date(e);return`${String(t.getDate()).padStart(2,"0")}/${String(t.getMonth()+1).padStart(2,"0")}/${t.getFullYear().toString().slice(-2)} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`})(p))),n.createElement("div",{className:"timeline-body2"},n.createElement("div",{className:"timeline-status-tag2 status-"+v},r((null==e||null===(a=e.state)||void 0===a?void 0:a.applicationStatus)||(null==e||null===(u=e.state)||void 0===u?void 0:u.state))),(null==e?void 0:e.comment)&&n.createElement("div",{className:"timeline-comment2"},e.comment)),(null==e||null===(s=e.assigner)||void 0===s?void 0:s.name)&&n.createElement("div",{className:"timeline-footer2"},n.createElement("span",null,r("ES_COMMON_ASSIGNED_TO"),": ",n.createElement("strong",null,null==e||null===(c=e.assigner)||void 0===c?void 0:c.name)))))}))):null};var ro=n.memo(()=>{var e,a,r,d,u;const{t:s}=i.useTranslation(),c=o.useLocation(),[v,m]=n.useState("undefined"!=typeof window&&window.innerWidth<768),p=Digit.ULBService.getCurrentTenantId(),{id:E}=o.useParams(),[f,g]=l.useState(null),[_,h]=l.useState({}),[T,y]=l.useState(!1),[S,b]=l.useState("watertanker"),N=c.pathname.includes("/fixed-point/"),I=null==E?void 0:E.startsWith("WT"),D=null==E?void 0:E.startsWith("TP"),C=N?"watertanker-fixedpoint":I?"watertanker":D?"treePruning":"mobileToilet";Digit.UserService.getUser(),sessionStorage.setItem(I?"wt":D?"tp":"mt",E);const{isLoading:A,data:x}=I?Digit.Hooks.wt.useWTApplicationDetail(s,p,E):D?Digit.Hooks.wt.useTPApplicationDetail(s,p,E):Digit.Hooks.wt.useMTApplicationDetail(s,p,E),{mutate:O}=I?Digit.Hooks.wt.useWTApplicationAction(p):D?Digit.Hooks.wt.useTPApplicationAction(p):Digit.Hooks.wt.useMTApplicationAction(p);let w=Digit.Hooks.useWorkflowDetails({tenantId:(null==x||null===(e=x.applicationData)||void 0===e?void 0:e.tenantId)||p,id:null==x||null===(a=x.applicationData)||void 0===a||null===(r=a.applicationData)||void 0===r?void 0:r.bookingNo,moduleCode:C,role:I?["WT_CEMP"]:D?["TP_CEMP"]:["MT_CEMP"]});return l.useEffect(()=>{if(x){var e,l,i,o,a,r,d;let T=Ht.cloneDeep(x);const S=null==T||null===(e=T.applicationData)||void 0===e||null===(l=e.applicationData)||void 0===l?void 0:l.bookingStatus,b="DELIVERED"===S||"TANKER_DELIVERED"===S;var u,c;if((null==T||null===(i=T.applicationDetails)||void 0===i?void 0:i.length)>0&&!b&&N)T.applicationDetails[0].Component=()=>n.createElement("div",{onClick:()=>y(!0),style:{float:"right",display:"flex",alignItems:"center",cursor:"pointer",color:"#f47738",gap:"8px",padding:"4px 12px",backgroundColor:"#fff",borderRadius:"4px",border:"1px solid #f47738",transition:"all 0.2s ease"}},n.createElement(t.EditIcon,{style:{fill:"#f47738",width:"16px",height:"16px"}}),n.createElement("span",{style:{fontWeight:"600",fontSize:"14px"}},s("WT_EDIT_FIELDS"))),(null==T||null===(u=T.applicationData)||void 0===u||null===(c=u.applicationDetails)||void 0===c?void 0:c.length)>0&&(T.applicationData.applicationDetails[0].Component=T.applicationDetails[0].Component);else if((null==T||null===(o=T.applicationDetails)||void 0===o?void 0:o.length)>0){var v,m;delete T.applicationDetails[0].Component,(null==T||null===(v=T.applicationData)||void 0===v||null===(m=v.applicationDetails)||void 0===m?void 0:m.length)>0&&delete T.applicationData.applicationDetails[0].Component}const I=null==T||null===(a=T.applicationData)||void 0===a||null===(r=a.applicationData)||void 0===r||null===(d=r.driverTripReport)||void 0===d?void 0:d[0];if(I&&"TANKER_DELIVERED"===S){var p,E,f,g,_;const e={title:"WT_DRIVER_TRIP_REPORT",asSectionHeader:!0,values:[{title:"WT_START_LATITUDE",value:(null==I||null===(p=I.startLatitude)||void 0===p?void 0:p.toString())||s("CS_NA")},{title:"WT_START_LONGITUDE",value:(null==I||null===(E=I.startLongitude)||void 0===E?void 0:E.toString())||s("CS_NA")},{title:"WT_END_LATITUDE",value:(null==I||null===(f=I.endLatitude)||void 0===f?void 0:f.toString())||s("CS_NA")},{title:"WT_END_LONGITUDE",value:(null==I||null===(g=I.endLongitude)||void 0===g?void 0:g.toString())||s("CS_NA")}],belowComponent:()=>n.createElement(ol,{startFileStoreId:null==I?void 0:I.startFileStoreId,endFileStoreId:null==I?void 0:I.endFileStoreId})};if(null!=T&&T.applicationDetails){const t=T.applicationDetails.findIndex(e=>"WT_VEHICLE_DETAILS"===e.title);-1!==t?T.applicationDetails.splice(t+1,0,e):T.applicationDetails.push(e)}if(null!=T&&null!==(_=T.applicationData)&&void 0!==_&&_.applicationDetails){const t=T.applicationData.applicationDetails.findIndex(e=>"WT_VEHICLE_DETAILS"===e.title);-1!==t?T.applicationData.applicationDetails.splice(t+1,0,e):T.applicationData.applicationDetails.push(e)}}h(T)}},[x,N]),l.useEffect(()=>{var e,t,l,n,i;null!=w&&null!==(e=w.data)&&void 0!==e&&e.applicationBusinessService&&!("watertanker"===(null==w||null===(t=w.data)||void 0===t?void 0:t.applicationBusinessService)&&"watertanker"===C||"mobileToilet"===(null==w||null===(l=w.data)||void 0===l?void 0:l.applicationBusinessService)&&"mobileToilet"===C||"treePruning"===(null==w||null===(n=w.data)||void 0===n?void 0:n.applicationBusinessService)&&"treePruning"===C)&&b(null==w||null===(i=w.data)||void 0===i?void 0:i.applicationBusinessService)},[w.data]),n.createElement(n.Fragment,null,T&&n.createElement(il,{t:s,applicationData:null==_||null===(d=_.applicationData)||void 0===d?void 0:d.applicationData,closeModal:()=>y(!1)}),n.createElement("div",{className:"workflow-timeline-wrapper no-scrollbar "+(v?"hide-workflow":""),style:{flex:"1 1 300px",maxWidth:v?"fit-content":"400px",transition:"max-width 0.3s"}},n.createElement(ao,{workflowDetails:w})),n.createElement("div",{style:{flex:"2 1 500px",minWidth:"300px",overflowY:"auto"}},n.createElement(no,{applicationDetails:null==_?void 0:_.applicationData,isLoading:A,isDataLoading:A,applicationData:null==_||null===(u=_.applicationData)||void 0===u?void 0:u.applicationData,mutate:O,workflowDetails:w,businessService:C,moduleCode:N?"request-service.water_tanker":"request-service",showToast:f,setShowToast:g,closeToast:()=>{g(null)},timelineStatusPrefix:"",forcedActionPrefix:"RS",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"},showTimeLine:!1})))});const uo=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),so=e=>{let{onClick:t}=e;return n.createElement("div",{className:"icon-bg-secondary",onClick:t},n.createElement(uo,null))},co=e=>n.createElement("h1",{className:"heading-m"},e.t("SERVICE_TYPE")),vo=e=>e.substr(0,1).toUpperCase()+e.substr(1),mo=function(e,t,l){try{var n,i,o,a,r,d,u,s,c,v,m,p,g,_;return Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${h=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),h.toLowerCase().split(" ").map(vo).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.bookingNo,isTOCRequired:!1,heading:l("MT_ACKNOWLEDGEMENT"),details:[{title:l("MT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:l("MT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:l("MT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:l("MT_ALT_MOBILE_NUMBER"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.alternateNumber},{title:l("MT_EMAIL_ID"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.emailId}].filter(e=>e.value)},{title:l("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_PINCODE"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.pincode},{title:l("WT_CITY"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.city},{title:l("WT_LOCALITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.locality},{title:l("WT_STREET_NAME"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.streetName},{title:l("WT_DOOR_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.doorNo},{title:l("WT_HOUSE_NO"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.houseNo},{title:l("WT_ADDRESS_LINE1"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.addressLine1},{title:l("WT_ADDRESS_LINE2"),value:null==e||null===(g=e.address)||void 0===g?void 0:g.addressLine2},{title:l("WT_LANDMARK"),value:null==e||null===(_=e.address)||void 0===_?void 0:_.landmark}].filter(e=>e.value)},{title:l("MT_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:l("MT_NUMBER_OF_MOBILE_TOILETS"),value:null==e?void 0:e.noOfMobileToilet},{title:l("MT_DELIVERY_FROM_DATE"),value:f(null==e?void 0:e.deliveryFromDate)},{title:l("MT_DELIVERY_TO_DATE"),value:f(null==e?void 0:e.deliveryToDate)},{title:l("MT_REQUIREMENT_TIME"),value:`${E(null==e?void 0:e.deliveryFromTime)} - ${E(null==e?void 0:e.deliveryToTime)}`},{title:l("MT_SPECIAL_REQUEST"),value:null==e?void 0:e.description}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var h},po=e=>{console.log("GetActionMessage",e);const{t:t}=i.useTranslation();return e.isSuccess?t("MT_SUBMIT_SUCCESSFULL"):e.isLoading?t("MT_APPLICATION_PENDING"):e.isSuccess?void 0:t("MT_APPLICATION_FAILED")},Eo={padding:"4px 0px",justifyContent:"space-between"},fo=e=>{var l,i;return console.log("BannerPicker",e),n.createElement(t.Banner,{message:po(e),applicationNumber:null===(l=e.data)||void 0===l||null===(i=l.mobileToiletBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("MT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},go=e=>e.substr(0,1).toUpperCase()+e.substr(1),_o=function(e,t,l){try{var n,i,o,a,r,d,u,s,c,v,m,p,E,f;return Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${g=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),g.toLowerCase().split(" ").map(go).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.bookingNo,isTOCRequired:!1,heading:l("TP_ACKNOWLEDGEMENT"),details:[{title:l("MT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:l("MT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:l("MT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:l("MT_ALT_MOBILE_NUMBER"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.alternateNumber},{title:l("MT_EMAIL_ID"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.emailId}].filter(e=>e.value)},{title:l("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_PINCODE"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.pincode},{title:l("WT_CITY"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.city},{title:l("WT_LOCALITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.locality},{title:l("WT_STREET_NAME"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.streetName},{title:l("WT_DOOR_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.doorNo},{title:l("WT_HOUSE_NO"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.houseNo},{title:l("WT_ADDRESS_LINE1"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.addressLine1},{title:l("WT_ADDRESS_LINE2"),value:null==e||null===(E=e.address)||void 0===E?void 0:E.addressLine2},{title:l("WT_LANDMARK"),value:null==e||null===(f=e.address)||void 0===f?void 0:f.landmark}].filter(e=>e.value)},{title:l("TP_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:l("REASON_FOR_PRUNING"),value:l(null==e?void 0:e.reasonForPruning)},{title:l("LATITUDE_GEOTAG"),value:null==e?void 0:e.latitude},{title:l("LONGITUDE_GEOTAG"),value:null==e?void 0:e.longitude}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var g},ho=e=>{const{t:t}=i.useTranslation();return e.isSuccess?t("TP_SUBMIT_SUCCESSFULL"):e.isLoading?t("TP_APPLICATION_PENDING"):e.isSuccess?void 0:t("TP_APPLICATION_FAILED")},To={padding:"4px 0px",justifyContent:"space-between"},yo=e=>{var l,i;return console.log("BannerPicker",e),n.createElement(t.Banner,{message:ho(e),applicationNumber:null===(l=e.data)||void 0===l||null===(i=l.treePruningBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("TP_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},So=e=>{let{jumpTo:l}=e;i.useTranslation();const a=o.useHistory();return n.createElement(t.LinkButton,{label:n.createElement(t.EditIcon,{style:{marginTop:"-30px",float:"right",position:"relative",bottom:"32px"}}),className:"check-page-link-button",onClick:function(){a.push(l)}})},bo=e=>{Digit.UploadServices.Filefetch([e],Digit.ULBService.getStateId()).then(e=>{var t,l,n;const i=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.url;if(i){const e=i.split(",")[0];e?window.open(e,"_blank"):console.error("No valid URL found to open!")}else console.error("URL is missing in the response!")}).catch(e=>{console.error("Error fetching file:",e)})},No=e=>{const{t:t}=i.useTranslation();return e.isSuccess?t("WT_SUBMIT_SUCCESSFULL"):e.isLoading?t("WT_APPLICATION_PENDING"):e.isSuccess?void 0:t("WT_APPLICATION_FAILED")},Io={padding:"4px 0px",justifyContent:"space-between"},Do=e=>{var l,i;return n.createElement(t.Banner,{message:No(e),applicationNumber:null===(l=e.data)||void 0===l||null===(i=l.waterTankerBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("WT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},Co=e=>{console.log("GetActionMessage",e);const{t:t}=i.useTranslation();return e.isSuccess?t("MT_SUBMIT_SUCCESSFULL"):e.isLoading?t("MT_APPLICATION_PENDING"):e.isSuccess?void 0:t("MT_APPLICATION_FAILED")},Ao={padding:"4px 0px",justifyContent:"space-between"},xo=e=>{var l,i;return console.log("BannerPicker",e),n.createElement(t.Banner,{message:Co(e),applicationNumber:null===(l=e.data)||void 0===l||null===(i=l.mobileToiletBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("MT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},Oo=e=>{const{t:t}=i.useTranslation();return e.isSuccess?t("TP_SUBMIT_SUCCESSFULL"):e.isLoading?t("TP_APPLICATION_PENDING"):e.isSuccess?void 0:t("TP_APPLICATION_FAILED")},wo={padding:"4px 0px",justifyContent:"space-between"},Lo=e=>{var l,i;return console.log("BannerPicker",e),n.createElement(t.Banner,{message:Oo(e),applicationNumber:null===(l=e.data)||void 0===l||null===(i=l.treePruningBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("TP_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},Po=[{head:"FP_INFO",body:[{route:"fp-info",component:"EmergencyFixedPointInfoPage",nextStep:"fp-applicant-details",key:"fpInfoDetails"}]},{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"fp-applicant-details",component:"EmergencyFixedPointApplicantDetails",withoutLabel:!0,key:"owner",type:"component",nextStep:"fp-address-details",isMandatory:!0,texts:{header:"ES_APPLICANT_DETAILS"},timeLine:[{currentStep:1,actions:"ES_APPLICANT_DETAILS"}]}]},{head:"ES_TITLE_ADDRESS_DETAILS",body:[{route:"fp-address-details",component:"AddressDetails",withoutLabel:!0,key:"address",type:"component",isMandatory:!0,nextStep:"fp-dispatch-details",texts:{header:"ES_ADDRESS_DETAILS"},timeLine:[{currentStep:2,actions:"ES_ADDRESS_DETAILS"}]}]},{head:"WT_DISPATCH_DETAILS",body:[{route:"fp-dispatch-details",component:"EmergencyFixedPointDispatchDetails",withoutLabel:!0,key:"dispatchDetails",type:"component",isMandatory:!0,nextStep:"fp-request-details",texts:{header:"WT_DISPATCH_DETAILS"},timeLine:[{currentStep:3,actions:"WT_DISPATCH_DETAILS"}]}]},{head:"FP_REQUEST_DETAILS",body:[{route:"fp-request-details",component:"EmergencyFixedPointRequestDetails",withoutLabel:!0,key:"requestDetails",type:"component",isMandatory:!0,nextStep:null,texts:{submitBarLabel:"CS_COMMON_SAVE",header:"WT_REQUEST_DETAILS"},timeLine:[{currentStep:4,actions:"ES_REQUEST_DETAILS"}]}]}],Ro=e=>{let{stateCode:t,userType:i,tenants:a}=e;const{path:r,url:d}=o.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"WT",language:u}),Digit.SessionStorage.set("WT_TENANTS",a),l.useEffect(()=>"employee"===i&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===i?n.createElement(He,{path:r,url:d,userType:i}):n.createElement(x,null)},ko=e=>{let{matchPath:o}=e;const{t:a}=i.useTranslation(),[,,r]=Digit.Hooks.useSessionStorage("WT",{});l.useEffect(()=>{r()},[]);const d=[{link:o+"/wt",i18nKey:a("WT_REQUEST_TANKER")},{link:o+"/wt/status",i18nKey:a("WT_VIEW_APPLICATIONS")},{link:o+"/wt/wt-Vendor",i18nKey:a("Vendor Management")}];return n.createElement(t.CitizenHomeCard,{header:a("WATER_TANKER_SERVICE"),links:d,Icon:()=>n.createElement(t.PTIcon,{className:"fill-path-primary-main"})})},Mo={ApplicantDetails:t.ApplicantDetails,AddressDetails:t.AddressDetails,WTCreate:()=>{var e,t,r,d,u,s,m,p,E;const f=a.useQueryClient(),g=o.useRouteMatch(),{t:_}=i.useTranslation(),{pathname:h}=o.useLocation(),T=o.useHistory();let y=[];const[S,b,N]=Digit.Hooks.useSessionStorage("WT_Create",{}),I=Digit.UserService.getUser(),D=Digit.ULBService.getCurrentTenantId(),C=null==I||null===(e=I.info)||void 0===e?void 0:e.uuid,{data:A}=Digit.Hooks.useUserSearch(D,{uuid:[C]},{},{enabled:!!C});function x(e,t,l,n,i){if(void 0===i&&(i=!1),"owners"===e){let l=S.owners||[];l[n]=t,b({...S,[e]:[...l]})}else if("units"===e){let e=S.units||[];e=t,b({...S,units:e})}else b({...S,[e]:{...S[e],...t}});null!=t&&t.silent||((e,t,l,n)=>{let i,o=h.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=h.slice(0,-3),o=o.split("/").pop(),r=!0):(o=h.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let d=y.find(e=>n?e.key===n:e.route===o);d||(d=y.find(e=>e.route===o));let{nextStep:u={}}=d||{},s=T.push;if(e&&(s=T.replace),l&&(u=n),"request-details"===u){var c,v;const e=null==S||null===(c=S.serviceType)||void 0===c||null===(v=c.serviceType)||void 0===v?void 0:v.code;"MobileToilet"===e?u="toiletRequest-details":"TREE_PRUNING"===e&&(u="treePruningRequest-details")}if(null===u)return s(g.path+"/check");i=isNaN(u.split("/").pop())&&r&&"map"!==u?`${g.path}/${u}/${t}`:`${g.path}/${u}`,s(i)})(l,n,i,e)}S.serviceType&&0!==Object.keys(S.serviceType).length||!h.includes("employee")||(h.includes("mt")?b({serviceType:{serviceType:{code:"MobileToilet",i18nKey:"Mobile Toilet",value:"Mobile Toilet"}}}):h.includes("tp")?b({serviceType:{serviceType:{code:"TREE_PRUNING",i18nKey:"Tree Pruning",value:"Tree Pruning"}}}):b({serviceType:{serviceType:{code:"WT",i18nKey:"Water Tanker",value:"Water Tanker"}}})),S&&Object.keys(S).length>0&&window.location.href.includes("/service-type")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(N(),f.invalidateQueries("WT_Create"));const O=()=>{N(),f.invalidateQueries("WT_Create")};c.forEach(e=>{y=y.concat(e.body.filter(e=>!e.hideInCitizen))}),y.indexRoute=h.includes("citizen")?"service-type":"info";const w=null===(t=Digit)||void 0===t||null===(r=t.ComponentRegistryService)||void 0===r?void 0:r.getComponent("WTCheckPage"),L=null===(d=Digit)||void 0===d||null===(u=d.ComponentRegistryService)||void 0===u?void 0:u.getComponent("WTAcknowledgement"),P=null===(s=Digit)||void 0===s||null===(m=s.ComponentRegistryService)||void 0===m?void 0:m.getComponent("MTAcknowledgement"),R=null===(p=Digit)||void 0===p||null===(E=p.ComponentRegistryService)||void 0===E?void 0:E.getComponent("TPAcknowledgement"),k=["applicant-details","address-details","request-details","toiletRequest-details","treePruningRequest-details"],M=k.some(e=>h.includes(e)),F=l.useRef({});return l.useEffect(()=>{if(M){const e=h.split("/").pop();F.current[e]&&F.current[e].scrollIntoView({behavior:"smooth",block:"start"})}},[h,M]),n.createElement(n.Fragment,null,n.createElement("div",{className:"employee-form-section-wrapper"},!h.includes("/info")&&n.createElement(v,{config:y,showFinalStep:!0}),n.createElement("div",{className:"employee-form-section"},n.createElement(o.Switch,null,n.createElement(o.Route,{path:g.path+"/check"},n.createElement(w,{onSubmit:function(){try{var e,t,l,n,i,o;return"WT"===(null==S||null===(e=S.serviceType)||void 0===e||null===(t=e.serviceType)||void 0===t?void 0:t.code)&&T.push(g.path+"/wt-acknowledgement"),"MobileToilet"===(null==S||null===(l=S.serviceType)||void 0===l||null===(n=l.serviceType)||void 0===n?void 0:n.code)&&T.push(g.path+"/mt-acknowledgement"),"TREE_PRUNING"===(null==S||null===(i=S.serviceType)||void 0===i||null===(o=i.serviceType)||void 0===o?void 0:o.code)&&T.push(g.path+"/tp-acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:S})),n.createElement(o.Route,{path:g.path+"/wt-acknowledgement"},n.createElement(L,{data:S,onSuccess:O})),n.createElement(o.Route,{path:g.path+"/mt-acknowledgement"},n.createElement(P,{data:S,onSuccess:O})),n.createElement(o.Route,{path:g.path+"/tp-acknowledgement"},n.createElement(R,{data:S,onSuccess:O})),y.map((e,t)=>{if(!k.includes(e.route)){var l;const{component:i,texts:a,inputs:r,key:d,additionaFields:u}=e,s="string"==typeof i?Digit.ComponentRegistryService.getComponent(i):i;return n.createElement(o.Route,{path:`${g.path}/${e.route}`,key:t},n.createElement(s,{config:{texts:a,inputs:r,key:d,additionaFields:u},onSelect:x,t:_,formData:S,userDetails:null==A||null===(l=A.user)||void 0===l?void 0:l[0]}))}return null}),n.createElement(o.Route,{path:k.map(e=>`${g.path}/${e}`)},n.createElement("div",{className:"single-page-form-container"},y.filter(e=>k.includes(e.route)).map((e,t)=>{var l,i,o;const{component:a}=e,r="string"==typeof a?Digit.ComponentRegistryService.getComponent(a):a,d=null==S||null===(l=S.serviceType)||void 0===l||null===(i=l.serviceType)||void 0===i?void 0:i.code;return"request-details"===e.route&&"WT"!==d||"toiletRequest-details"===e.route&&"MobileToilet"!==d||"treePruningRequest-details"===e.route&&"TREE_PRUNING"!==d?null:n.createElement("div",{key:t,ref:t=>F.current[e.route]=t,className:"form-section-unit"},n.createElement(r,{config:{...e,isCollapsible:!0,defaultOpen:!0},onSelect:x,t:_,formData:S,userDetails:null==A||null===(o=A.user)||void 0===o?void 0:o[0]}))}))),n.createElement(o.Route,null,n.createElement(o.Redirect,{to:`${g.path}/${y.indexRoute}`}))))))},InfoPage:e=>{var i,o;let{t:a,onSelect:r,formData:d,config:u}=e;const[s,c]=l.useState(""),[v,m]=l.useState(!1),[p,E]=l.useState(!1),f={MobileToilet:"MT_MODULE",WT:"WT_MODULE",TREE_PRUNING:"TREE_PRUNING"}[null==d||null===(i=d.serviceType)||void 0===i||null===(o=i.serviceType)||void 0===o?void 0:o.code],g=()=>{const e={...d.infodetails||{},existingDataSet:s};r(u.key,{...d[u.key],...e})};return n.createElement(n.Fragment,null,n.createElement(t.Card,{className:"search-form-wrapper",style:{flexDirection:"column",gap:"12px",justifyContent:"flex-start"}},f&&n.createElement(t.CardHeader,null,a(f)),n.createElement("div",null,n.createElement("p",{className:"primaryColor"},a("SV_DOC_REQ_SCREEN_SUB_HEADER")),n.createElement("p",{className:"primaryColor"},a("SV_DOC_REQ_SCREEN_TEXT")),n.createElement("p",{className:"primaryColor"},a("SV_DOC_REQ_SCREEN_SUB_TEXT"))),n.createElement("span",null,n.createElement(t.SubmitBar,{label:a("COMMON_NEXT"),onSubmit:()=>{p?m(!0):g()}}))),v&&n.createElement(R,{t:a,closeModal:()=>m(!1),actionCancelOnSubmit:()=>m(!1),onSubmit:()=>{g(),m(!1)},setExistingDataSet:c}))},RequestDetails:e=>{var i,o,a,r,d,u,s,c,v;let{t:p,config:E,onSelect:f,formData:g}=e;Digit.UserService.getUser();let _={};const[h,T]=l.useState((null==g||null===(i=g.requestDetails)||void 0===i?void 0:i.tankerType)||""),[y,S]=l.useState((null==g||null===(o=g.requestDetails)||void 0===o?void 0:o.tankerQuantity)||{i18nKey:"1",code:"1",value:"1"}),[b,I]=l.useState((null==g||null===(a=g.requestDetails)||void 0===a?void 0:a.waterQuantity)||""),[D,C]=l.useState((null==g||null===(r=g.requestDetails)||void 0===r?void 0:r.waterType)||""),[A,x]=l.useState((null==g||null===(d=g.requestDetails)||void 0===d?void 0:d.deliveryDate)||""),[O,w]=l.useState((null==g||null===(u=g.requestDetails)||void 0===u?void 0:u.description)||""),[L,P]=l.useState((null==g||null===(s=g.requestDetails)||void 0===s?void 0:s.deliveryTime)||""),[R,k]=l.useState((null==g||null===(c=g.requestDetails)||void 0===c?void 0:c.extraCharge)||!1),[M,F]=l.useState((null==g||null===(v=g.requestDetails)||void 0===v?void 0:v.fileStoreId)||null),[B,W]=l.useState(null),[U,H]=l.useState(null),j=Digit.ULBService.getStateId(),V={width:"100%"},{data:z}=Digit.Hooks.useCustomMDMS(j,"request-service",[{name:"VehicleType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.VehicleType}}),{data:K}=Digit.Hooks.useCustomMDMS(j,"request-service",[{name:"TankerType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerType}}),{data:G}=Digit.Hooks.useCustomMDMS(j,"request-service",[{name:"TankerQuantity"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerQuantity}}),{data:Y}=Digit.Hooks.useCustomMDMS(j,"Request-service",[{name:"WaterType"}],{select:e=>{var t;return null==e||null===(t=e["Request-service"])||void 0===t?void 0:t.WaterType}});let q=[],$=[],X=[],Q=[];Y&&Y.map(e=>{Q.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),G&&G.map(e=>{$.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),z&&z.map(e=>{q.push({i18nKey:""+e.capacity,code:""+e.capacity,value:""+e.capacity,vehicleType:e.vehicleType,capacityName:e.capacityName})}),K&&K.map(e=>{X.push({i18nKey:""+e.i18nKey,code:""+e.code,value:""+e.value})});const Z=q.map(e=>{if(h.code===e.vehicleType)return{i18nKey:e.capacityName,code:e.code,value:e.capacityName}}).filter(e=>void 0!==e),J=()=>n.createElement("div",{className:"flex items-center"},n.createElement(t.TextInput,{type:"time",value:L,style:V,onChange:e=>P(e.target.value),min:"06:00",max:"23:59"}));return l.useEffect(()=>{!function(){try{H(null);const e=function(){if(B){const e=function(){if(B.size>=2e6)H(p("WT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=N(function(){return Promise.resolve(Digit.UploadServices.Filestorage("wt",B,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?F(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):H(p("WT_FILE_UPLOAD_ERROR"))})},function(){H(p("WT_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[B]),l.useEffect(()=>{!h&&null!=X&&X.length&&T(X[0])},[X]),n.createElement(n.Fragment,null,n.createElement(t.FormStep,{config:E,onSelect:()=>{let e={...g.requestDetails,tankerType:h,deliveryDate:A,tankerQuantity:y,waterType:D,waterQuantity:b,deliveryTime:L,description:O,extraCharge:R,fileStoreId:M};f(E.key,e,!1)},t:p,isDisabled:!(h&&A&&y&&b&&L&&O&&D),className:"card-form-container"},n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_TANKER_TYPE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.RadioButtons,{t:p,options:X,style:{display:"flex",flexWrap:"wrap",maxHeight:"30px"},innerStyles:{minWidth:"24%"},optionsKey:"i18nKey",name:"tankerType",value:h,selectedOption:h,onSelect:T,labelKey:"i18nKey",isPTFlow:!0})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_WATER_TYPE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:D,placeholder:p("WT_SELECT_WATER_TYPE"),select:C,option:Q,style:V,optionKey:"i18nKey",t:p})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_WATER_QUANTITY")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:b,placeholder:"Select Water Quantity",select:I,option:Z,style:V,optionKey:"i18nKey",t:p})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_TANKER_QUANTITY")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:y,placeholder:"Select Tanker Quantity",select:S,option:$,style:V,optionKey:"i18nKey",t:p})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_DELIVERY_DATE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextInput,{t:p,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",style:V,value:A,onChange:function(e){x(e.target.value)},min:(new Date).toISOString().split("T")[0],rules:{required:p("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||p("ERR_DEFAULT_INPUT_FIELD_MSG")}})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_DELIVERY_TIME")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(J,null)),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_UPLOAD_DOCUMENT")),n.createElement(t.UploadFile,{id:"wt-doc",extraStyleName:"propertyCreate",accept:".jpg,.png,.pdf,.jpeg",onUpload:function(e){F(null),W(e.target.files[0])},onDelete:()=>{F(null)},message:M?"1 "+p("WT_ACTION_FILEUPLOADED"):p("WT_ACTION_NO_FILEUPLOADED"),error:U})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_DESCRIPTION")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextArea,m({t:p,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"description",value:O,onChange:function(e){w(e.target.value)},style:V,ValidationRequired:!0},_={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:p("PT_NAME_ERROR_MESSAGE")}))),U?n.createElement("div",{style:{height:"20px",width:"100%",fontSize:"20px",color:"red",marginTop:"5px"}},U):"",n.createElement(t.CheckBox,{label:p("WT_IMMEDIATE"),onChange:()=>{k(!R)},checked:R})))},WTCheckPage:e=>{var a,r,d,u,s,c,v,m,g,_,h,T;let{onSubmit:y,value:S={}}=e;const{t:b}=i.useTranslation(),{pathname:N}=o.useLocation(),{owner:I,requestDetails:D,address:C,serviceType:A,toiletRequestDetails:x,treePruningRequestDetails:O}=S,[w,L]=l.useState(!1),P=null!=D&&D.extraCharge?"YES":"NO",[R,F]=l.useState(null),B=N.includes("citizen")?"/digit-ui/citizen/wt/request-service":"/digit-ui/employee/wt/request-service";return n.useEffect(()=>{null!=D&&D.fileStoreId&&Digit.UploadServices.Filefetch([null==D?void 0:D.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var t,l,n,i;const o=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.url)||void 0===i?void 0:i.split(",")[0];F(o)})},[null==D?void 0:D.fileStoreId]),n.createElement(n.Fragment,null,n.createElement(t.Card,{className:"overflow-y-scroll"},n.createElement(t.CardHeader,null,b("WT_SUMMARY_PAGE")),n.createElement("div",null,n.createElement(t.CardSubHeader,null,b("ES_TITILE_OWNER_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:b("COMMON_APPLICANT_NAME"),text:""+b(p(null==I?void 0:I.applicantName)),actionButton:n.createElement(k,{jumpTo:B+"/applicant-details"})}),n.createElement(t.Row,{label:b("COMMON_MOBILE_NUMBER"),text:""+b(p(null==I?void 0:I.mobileNumber))}),n.createElement(t.Row,{label:b("COMMON_ALT_MOBILE_NUMBER"),text:""+b(p(null==I?void 0:I.alternateNumber))}),n.createElement(t.Row,{label:b("COMMON_EMAIL_ID"),text:""+b(p(null==I?void 0:I.emailId))})),n.createElement(t.CardSubHeader,null,b("ES_TITLE_ADDRESS_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:b("HOUSE_NO"),text:""+b(p(null==C?void 0:C.houseNo)),actionButton:n.createElement(k,{jumpTo:B+"/address-details"})}),n.createElement(t.Row,{label:b("ADDRESS_LINE1"),text:""+b(p(null==C?void 0:C.addressLine1))}),n.createElement(t.Row,{label:b("ADDRESS_LINE2"),text:""+b(p(null==C?void 0:C.addressLine2))}),n.createElement(t.Row,{label:b("CITY"),text:""+b(p(null==C||null===(a=C.city)||void 0===a||null===(r=a.city)||void 0===r?void 0:r.name))}),n.createElement(t.Row,{label:b("LOCALITY"),text:""+b(p(null==C||null===(d=C.locality)||void 0===d?void 0:d.i18nKey))}),n.createElement(t.Row,{label:b("PINCODE"),text:""+b(p(null==C?void 0:C.pincode))}),n.createElement(t.Row,{label:b("LANDMARK"),text:""+b(p(null==C?void 0:C.landmark))}),n.createElement(t.Row,{label:b("STREET_NAME"),text:""+b(p(null==C?void 0:C.streetName))})),"WT"===(null==A||null===(u=A.serviceType)||void 0===u?void 0:u.code)&&n.createElement(l.Fragment,null,n.createElement(t.CardSubHeader,null,b("WT_REQUEST_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:b("WT_TANKER_TYPE"),text:""+b(p(null==D||null===(s=D.tankerType)||void 0===s?void 0:s.value)),actionButton:n.createElement(k,{jumpTo:B+"/request-details"})}),n.createElement(t.Row,{label:b("WT_WATER_TYPE"),text:""+b(p(null==D||null===(c=D.waterType)||void 0===c?void 0:c.code))}),n.createElement(t.Row,{label:b("WT_TANKER_QUANTITY"),text:""+b(p(null==D||null===(v=D.tankerQuantity)||void 0===v?void 0:v.code))}),n.createElement(t.Row,{label:b("WT_WATER_QUANTITY"),text:""+b(p(null==D||null===(m=D.waterQuantity)||void 0===m?void 0:m.value))}),n.createElement(t.Row,{label:b("WT_DELIVERY_DATE"),text:""+b(p(f(null==D?void 0:D.deliveryDate)))}),n.createElement(t.Row,{label:b("WT_DELIVERY_TIME"),text:""+p(E(null==D?void 0:D.deliveryTime))}),n.createElement(t.Row,{label:b("WT_DESCRIPTION"),text:""+b(p(null==D?void 0:D.description))}),(null==D?void 0:D.fileStoreId)&&n.createElement(t.Row,{label:b("WT_UPLOAD_DOCUMENT"),text:n.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>M(null==D?void 0:D.fileStoreId)},n.createElement(t.GenericFileIcon,null))}),n.createElement(t.Row,{label:b("WT_IMMEDIATE"),text:""+b(p(P))}))),"MobileToilet"===(null==A||null===(g=A.serviceType)||void 0===g?void 0:g.code)&&n.createElement(l.Fragment,null,n.createElement(t.CardSubHeader,null,b("ES_REQUEST_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:b("MT_NUMBER_OF_MOBILE_TOILETS"),text:""+b(p(null==x||null===(_=x.mobileToilet)||void 0===_?void 0:_.code)),actionButton:n.createElement(k,{jumpTo:B+"/toiletRequest-details"})}),n.createElement(t.Row,{label:b("MT_DELIVERY_FROM_DATE"),text:""+b(p(f(null==x?void 0:x.deliveryfromDate)))}),n.createElement(t.Row,{label:b("MT_DELIVERY_TO_DATE"),text:""+b(f(p(null==x?void 0:x.deliverytoDate)))}),n.createElement(t.Row,{label:b("MT_REQUIREMNENT_FROM_TIME"),text:p(E(null==x?void 0:x.deliveryfromTime))}),n.createElement(t.Row,{label:b("MT_REQUIREMNENT_TO_TIME"),text:p(E(null==x?void 0:x.deliverytoTime))}),n.createElement(t.Row,{label:b("MT_SPECIAL_REQUEST"),text:""+b(p(null==x?void 0:x.specialRequest))}))),"TREE_PRUNING"===(null==A||null===(h=A.serviceType)||void 0===h?void 0:h.code)&&n.createElement(l.Fragment,null,n.createElement(t.CardSubHeader,null,b("TP_REQUEST_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:b("REASON_FOR_PRUNING"),text:""+b(p(null==O||null===(T=O.reasonOfPruning)||void 0===T?void 0:T.code)),actionButton:n.createElement(k,{jumpTo:B+"/treePruningRequest-details"})}),n.createElement(t.Row,{label:b("LOCATION_GEOTAG"),text:""+b(p(null==O?void 0:O.geoTagLocation))}),n.createElement(t.Row,{label:b("UPLOAD_THE_SITE_PHOTOGRAPH"),text:n.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>M(null==O?void 0:O.supportingDocumentFile)},n.createElement(t.GenericFileIcon,null))}))),n.createElement(t.CheckBox,{label:b("FINAL_DECLARATION_MESSAGE"),onChange:()=>{L(!w)},checked:w})),n.createElement(t.SubmitBar,{label:b("COMMON_BUTTON_SUBMIT"),onSubmit:y,disabled:!w})))},WTAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:d}=i.useTranslation(),u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useTankerCreateAPI(u),c=Digit.UserService.getUser().info,{data:v}=Digit.Hooks.useStore.getInitData(),{tenants:m}=v||{};return l.useEffect(()=>{try{a.tenantId=u;let e=(e=>{var t,l,n,i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,h,T,y,S,b,N,I,D,C,A,x,O,w,L,P,R,k,M,F,B,W,U;return{waterTankerBookingDetail:{tenantId:null==e?void 0:e.tenantId,tankerType:null===(t=(null==e||null===(l=e.requestDetails)||void 0===l||null===(n=l.tankerType)||void 0===n?void 0:n.code)||(null==e||null===(i=e.requestDetails)||void 0===i?void 0:i.tankerType)||"")||void 0===t?void 0:t.toUpperCase(),waterType:null==e||null===(o=e.requestDetails)||void 0===o||null===(a=o.waterType)||void 0===a?void 0:a.code,tankerQuantity:null==e||null===(r=e.requestDetails)||void 0===r||null===(d=r.tankerQuantity)||void 0===d?void 0:d.code,waterQuantity:null==e||null===(u=e.requestDetails)||void 0===u||null===(s=u.waterQuantity)||void 0===s?void 0:s.code,description:null==e||null===(c=e.requestDetails)||void 0===c?void 0:c.description,deliveryDate:null==e||null===(v=e.requestDetails)||void 0===v?void 0:v.deliveryDate,deliveryTime:null==e||null===(m=e.requestDetails)||void 0===m?void 0:m.deliveryTime,extraCharge:null!=e&&null!==(p=e.requestDetails)&&void 0!==p&&p.extraCharge?"Y":"N",addressDetailId:(null==e||null===(E=e.address)||void 0===E?void 0:E.addressDetailId)||"",applicantDetail:{name:null==e||null===(f=e.owner)||void 0===f?void 0:f.applicantName,mobileNumber:null==e||null===(g=e.owner)||void 0===g?void 0:g.mobileNumber,alternateNumber:null==e||null===(_=e.owner)||void 0===_?void 0:_.alternateNumber,emailId:null==e||null===(h=e.owner)||void 0===h?void 0:h.emailId},address:{addressType:null==e||null===(T=e.address)||void 0===T||null===(y=T.addressType)||void 0===y?void 0:y.code,pincode:null==e||null===(S=e.address)||void 0===S?void 0:S.pincode,city:(null==e||null===(b=e.address)||void 0===b||null===(N=b.city)||void 0===N||null===(I=N.city)||void 0===I?void 0:I.name)||"DJB",cityCode:(null==e||null===(D=e.address)||void 0===D||null===(C=D.city)||void 0===C||null===(A=C.city)||void 0===A?void 0:A.code)||"DJB",addressLine1:null==e||null===(x=e.address)||void 0===x?void 0:x.addressLine1,addressLine2:null==e||null===(O=e.address)||void 0===O?void 0:O.addressLine2,locality:null==e||null===(w=e.address)||void 0===w||null===(L=w.locality)||void 0===L?void 0:L.i18nKey,localityCode:null==e||null===(P=e.address)||void 0===P||null===(R=P.locality)||void 0===R?void 0:R.code,streetName:null==e||null===(k=e.address)||void 0===k?void 0:k.streetName,houseNo:null==e||null===(M=e.address)||void 0===M?void 0:M.houseNo,landmark:null==e||null===(F=e.address)||void 0===F?void 0:F.landmark,latitude:null==e||null===(B=e.address)||void 0===B?void 0:B.latitude,longitude:null==e||null===(W=e.address)||void 0===W?void 0:W.longitude},WTfileStoreId:null==e||null===(U=e.requestDetails)||void 0===U?void 0:U.fileStoreId,bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"watertanker",moduleName:"request-service.water_tanker"}}}})(a);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?n.createElement(t.Loader,null):n.createElement(t.Card,{className:"vehicle-details-card"},n.createElement(H,{t:d,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),n.createElement(t.StatusTable,null,s.isSuccess&&n.createElement(t.Row,{rowContainerStyle:U,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&n.createElement(t.SubmitBar,{label:d("WT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.waterTankerBookingDetail;const l=m.find(e=>e.code===t.tenantId);return Promise.resolve(B({...t},l,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),n.createElement(o.Link,"CITIZEN"===(null==c?void 0:c.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},n.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},WTApplicationDetails:()=>{var e,a,r,d,u,s,c,v,m,p,g,_,h;const{t:T}=i.useTranslation(),{acknowledgementIds:y,tenantId:S}=o.useParams(),[b,N]=l.useState(!1),[I,D]=l.useState(null),{data:C}=Digit.Hooks.useStore.getInitData(),{tenants:A}=C||{},{isLoading:x,data:O,refetch:w}=Digit.Hooks.wt.useTankerSearchAPI({tenantId:S,filters:{bookingNo:y}}),L=Ut(O,"waterTankerBookingDetail",[]);Ut(O,"waterTankerBookingDetail[0].bookingNo",[]);let P=L&&L.length>0&&L[0]||{};const R=P;sessionStorage.setItem("wt",JSON.stringify(R));let k="N"===(null==P?void 0:P.extraCharge)?"No":"Yes";const M=Digit.Hooks.wt.useTankerCreateAPI(S,!1),{data:F,isLoading:W}=Digit.Hooks.useRecieptSearch({tenantId:S,businessService:"request-service.water_tanker",consumerCodes:y,isEmployee:!1},{enabled:!!y});let U=[];U.push({label:T("WT_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>H()});const H=function(){try{const e=R||{},t=A.find(t=>t.code===e.tenantId);return Promise.resolve(B({...e},t,T)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return x?n.createElement(t.Loader,null):(F&&(null==F?void 0:F.Payments.length)>0&&0==W&&U.push({label:T("WT_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:l,...n}=e;try{function i(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:n})).then(function(e){window.open(e[n],"_blank")})}let e=L[0]||{},n=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!n){let i={filestoreIds:[null==l?void 0:l.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...l}]},"request-service.water_tanker-receipt")).then(function(t){var l;i=t;const o={...e,paymentReceiptFilestoreId:null===(l=i)||void 0===l?void 0:l.filestoreIds[0]};return Promise.resolve(M.mutateAsync({waterTankerBookingDetail:o})).then(function(){var e;n=null===(e=i)||void 0===e?void 0:e.filestoreIds[0],w()})})}}();return Promise.resolve(o&&o.then?o.then(i):i())}catch(e){return Promise.reject(e)}}({tenantId:null==F||null===(e=F.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==F?void 0:F.Payments[0]})}}),n.createElement(n.Fragment,null,n.createElement("div",null,n.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},n.createElement(t.Header,{styles:{fontSize:"32px"}},T("WT_BOOKING_DETAILS")),U&&U.length>0&&n.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>N(!b),displayOptions:b,options:U})),n.createElement(t.Card,null,n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:T("WT_BOOKING_NO"),text:null==P?void 0:P.bookingNo})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},T("WT_APPLICANT_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:T("WT_APPLICANT_NAME"),text:(null==P||null===(e=P.applicantDetail)||void 0===e?void 0:e.name)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_MOBILE_NUMBER"),text:(null==P||null===(a=P.applicantDetail)||void 0===a?void 0:a.mobileNumber)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_ALT_MOBILE_NUMBER"),text:(null==P||null===(r=P.applicantDetail)||void 0===r?void 0:r.alternateNumber)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_EMAIL_ID"),text:(null==P||null===(d=P.applicantDetail)||void 0===d?void 0:d.emailId)||T("CS_NA")})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},T("WT_ADDRESS_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:T("WT_PINCODE"),text:(null==P||null===(u=P.address)||void 0===u?void 0:u.pincode)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_CITY"),text:(null==P||null===(s=P.address)||void 0===s?void 0:s.city)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_LOCALITY"),text:(null==P||null===(c=P.address)||void 0===c?void 0:c.locality)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_STREET_NAME"),text:(null==P||null===(v=P.address)||void 0===v?void 0:v.streetName)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_DOOR_NO"),text:(null==P||null===(m=P.address)||void 0===m?void 0:m.doorNo)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_HOUSE_NO"),text:(null==P||null===(p=P.address)||void 0===p?void 0:p.houseNo)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_ADDRESS_LINE1"),text:(null==P||null===(g=P.address)||void 0===g?void 0:g.addressLine1)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_ADDRESS_LINE2"),text:(null==P||null===(_=P.address)||void 0===_?void 0:_.addressLine2)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_LANDMARK"),text:(null==P||null===(h=P.address)||void 0===h?void 0:h.landmark)||T("CS_NA")})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},T("ES_REQUEST_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:T("WT_TANKER_TYPE"),text:(null==P?void 0:P.tankerType)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_WATER_TYPE"),text:T(null==P?void 0:P.waterType)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_TANKER_QUANTITY"),text:(null==P?void 0:P.tankerQuantity)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_WATER_QUANTITY"),text:(null==P?void 0:P.waterQuantity)+" Ltr"||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_DELIVERY_DATE"),text:f(null==P?void 0:P.deliveryDate)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_DELIVERY_TIME"),text:E(null==P?void 0:P.deliveryTime)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_DESCRIPTION"),text:(null==P?void 0:P.description)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("WT_IMMEDIATE"),text:k||T("CS_NA")})),n.createElement(Vt,{application:R,id:null==R?void 0:R.bookingNo,userType:"citizen"}),I&&n.createElement(t.Toast,{error:I.key,label:T(I.label),style:{bottom:"0px"},onClose:()=>{D(null)}})))))},MTApplicationDetails:()=>{var e,a,r,d,u,s,c,v,m,p,g,_;const{t:h}=i.useTranslation(),{acknowledgementIds:T,tenantId:y}=o.useParams(),[S,b]=l.useState(!1),[N,I]=l.useState(null),{data:D}=Digit.Hooks.useStore.getInitData(),{tenants:C}=D||{},{isLoading:A,data:x,refetch:O}=Digit.Hooks.wt.useMobileToiletSearchAPI({tenantId:y,filters:{bookingNo:T}}),w=Ut(x,"mobileToiletBookingDetails",[]);Ut(x,"mobileToiletBookingDetails[0].bookingNo",[]);let L=w&&w.length>0&&w[0]||{};const P=L;sessionStorage.setItem("mt",JSON.stringify(P));const R=Digit.Hooks.wt.useMobileToiletCreateAPI(y,!1),{data:k,isLoading:M}=Digit.Hooks.useRecieptSearch({tenantId:y,businessService:"request-service.mobile_toilet",consumerCodes:T,isEmployee:!1},{enabled:!!T});let F=[];if(F.push({label:h("MT_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>B()}),A)return n.createElement(t.Loader,null);k&&(null==k?void 0:k.Payments.length)>0&&0==M&&F.push({label:h("MT_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:l,...n}=e;try{function i(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:n})).then(function(e){window.open(e[n],"_blank")})}let e=w[0]||{},n=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!n){let i={filestoreIds:[null==l?void 0:l.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...l}]},"request-service.mobile_toilet-receipt")).then(function(t){var l;i=t;const o={...e,paymentReceiptFilestoreId:null===(l=i)||void 0===l?void 0:l.filestoreIds[0]};return Promise.resolve(R.mutateAsync({mobileToiletBookingDetail:o})).then(function(){var e;n=null===(e=i)||void 0===e?void 0:e.filestoreIds[0],O()})})}}();return Promise.resolve(o&&o.then?o.then(i):i())}catch(e){return Promise.reject(e)}}({tenantId:null==k||null===(e=k.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==k?void 0:k.Payments[0]})}});const B=function(){try{const e=P||{},t=C.find(t=>t.code===e.tenantId);return Promise.resolve(mo({...e},t,h)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return n.createElement(n.Fragment,null,n.createElement("div",null,n.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},n.createElement(t.Header,{styles:{fontSize:"32px"}},h("MT_BOOKING_DETAILS")),F.length>0&&n.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>b(!S),displayOptions:S,options:F})),n.createElement(t.Card,null,n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:h("MT_BOOKING_NO"),text:null==L?void 0:L.bookingNo})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},h("MT_APPLICANT_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:h("MT_APPLICANT_NAME"),text:(null==L||null===(e=L.applicantDetail)||void 0===e?void 0:e.name)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("MT_MOBILE_NUMBER"),text:(null==L||null===(a=L.applicantDetail)||void 0===a?void 0:a.mobileNumber)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("MT_ALT_MOBILE_NUMBER"),text:(null==L||null===(r=L.applicantDetail)||void 0===r?void 0:r.alternateNumber)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("MT_EMAIL_ID"),text:(null==L||null===(d=L.applicantDetail)||void 0===d?void 0:d.emailId)||h("CS_NA")})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},h("ES_TITLE_ADDRESS_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:h("PINCODE"),text:(null==L||null===(u=L.address)||void 0===u?void 0:u.pincode)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("CITY"),text:(null==L||null===(s=L.address)||void 0===s?void 0:s.city)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("LOCALITY"),text:(null==L||null===(c=L.address)||void 0===c?void 0:c.locality)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("STREET_NAME"),text:(null==L||null===(v=L.address)||void 0===v?void 0:v.streetName)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("HOUSE_NO"),text:(null==L||null===(m=L.address)||void 0===m?void 0:m.houseNo)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("ADDRESS_LINE1"),text:(null==L||null===(p=L.address)||void 0===p?void 0:p.addressLine1)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("ADDRESS_LINE2"),text:(null==L||null===(g=L.address)||void 0===g?void 0:g.addressLine2)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("LANDMARK"),text:(null==L||null===(_=L.address)||void 0===_?void 0:_.landmark)||h("CS_NA")})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},h("ES_REQUEST_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:h("MT_NUMBER_OF_MOBILE_TOILETS"),text:(null==L?void 0:L.noOfMobileToilet)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("MT_DELIVERY_FROM_DATE"),text:f(null==L?void 0:L.deliveryFromDate)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("MT_DELIVERY_TO_DATE"),text:f(null==L?void 0:L.deliveryToDate)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("MT_REQUIREMNENT_FROM_TIME"),text:E(null==L?void 0:L.deliveryFromTime)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("MT_REQUIREMNENT_TO_TIME"),text:E(null==L?void 0:L.deliveryToTime)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("MT_SPECIAL_REQUEST"),text:(null==L?void 0:L.description)||h("CS_NA")})),n.createElement(Vt,{application:P,id:null==P?void 0:P.bookingNo,userType:"citizen"}),N&&n.createElement(t.Toast,{error:N.key,label:h(N.label),style:{bottom:"0px"},onClose:()=>{I(null)}}))))},TPApplicationDetails:()=>{var e,a,r,d,u,s,c,v,m,p,E,f;const{t:g}=i.useTranslation(),{acknowledgementIds:_,tenantId:h}=o.useParams(),[T,y]=l.useState(!1),[S,b]=l.useState(null),{data:N}=Digit.Hooks.useStore.getInitData(),{tenants:I}=N||{},{isLoading:D,data:C,refetch:A}=Digit.Hooks.wt.useTreePruningSearchAPI({tenantId:h,filters:{bookingNo:_}}),x=Ut(C,"treePruningBookingDetails",[]);Ut(C,"treePruningBookingDetails[0].bookingNo",[]);let O=x&&x.length>0&&x[0]||{};console.log("tp_details",O);const w=O;sessionStorage.setItem("tp",JSON.stringify(w));const L=Digit.Hooks.wt.useTreePruningCreateAPI(h,!1),{data:P,isLoading:R}=Digit.Hooks.useRecieptSearch({tenantId:h,businessService:"request-service.tree_pruning",consumerCodes:_,isEmployee:!1},{enabled:!!_});let k=[];if(k.push({label:g("TP_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>M()}),D)return n.createElement(t.Loader,null);P&&(null==P?void 0:P.Payments.length)>0&&0==R&&k.push({label:g("TP_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:l,...n}=e;try{function i(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:n})).then(function(e){window.open(e[n],"_blank")})}let e=x[0]||{},n=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!n){let i={filestoreIds:[null==l?void 0:l.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...l}]},"request-service.tree_pruning-receipt")).then(function(t){var l;i=t;const o={...e,paymentReceiptFilestoreId:null===(l=i)||void 0===l?void 0:l.filestoreIds[0]};return Promise.resolve(L.mutateAsync({treePruningBookingDetail:o})).then(function(){var e;n=null===(e=i)||void 0===e?void 0:e.filestoreIds[0],A()})})}}();return Promise.resolve(o&&o.then?o.then(i):i())}catch(e){return Promise.reject(e)}}({tenantId:null==P||null===(e=P.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==P?void 0:P.Payments[0]})}});const M=function(){try{const e=w||{},t=I.find(t=>t.code===e.tenantId);return Promise.resolve(_o({...e},t,g)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return n.createElement(n.Fragment,null,n.createElement("div",null,n.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},n.createElement(t.Header,{styles:{fontSize:"32px"}},g("TP_BOOKING_DETAILS")),k.length>0&&n.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>y(!T),displayOptions:T,options:k})),n.createElement(t.Card,null,n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:g("WT_BOOKING_NO"),text:null==O?void 0:O.bookingNo})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},g("TP_APPLICANT_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:g("WT_APPLICANT_NAME"),text:(null==O||null===(e=O.applicantDetail)||void 0===e?void 0:e.name)||g("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:g("WT_MOBILE_NUMBER"),text:(null==O||null===(a=O.applicantDetail)||void 0===a?void 0:a.mobileNumber)||g("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:g("WT_ALT_MOBILE_NUMBER"),text:(null==O||null===(r=O.applicantDetail)||void 0===r?void 0:r.alternateNumber)||g("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:g("WT_EMAIL_ID"),text:(null==O||null===(d=O.applicantDetail)||void 0===d?void 0:d.emailId)||g("CS_NA")})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},g("ES_TITLE_ADDRESS_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:g("PINCODE"),text:(null==O||null===(u=O.address)||void 0===u?void 0:u.pincode)||g("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:g("CITY"),text:(null==O||null===(s=O.address)||void 0===s?void 0:s.city)||g("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:g("LOCALITY"),text:(null==O||null===(c=O.address)||void 0===c?void 0:c.locality)||g("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:g("STREET_NAME"),text:(null==O||null===(v=O.address)||void 0===v?void 0:v.streetName)||g("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:g("HOUSE_NO"),text:(null==O||null===(m=O.address)||void 0===m?void 0:m.houseNo)||g("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:g("ADDRESS_LINE1"),text:(null==O||null===(p=O.address)||void 0===p?void 0:p.addressLine1)||g("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:g("ADDRESS_LINE2"),text:(null==O||null===(E=O.address)||void 0===E?void 0:E.addressLine2)||g("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:g("LANDMARK"),text:(null==O||null===(f=O.address)||void 0===f?void 0:f.landmark)||g("CS_NA")})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},g("TP_REQUEST_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:g("REASON_FOR_PRUNING"),text:g(null==O?void 0:O.reasonForPruning)||g("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:g("LATITUDE_GEOTAG"),text:(null==O?void 0:O.latitude)||g("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:g("LONGITUDE_GEOTAG"),text:(null==O?void 0:O.longitude)||g("CS_NA")})),n.createElement(Vt,{application:w,id:null==w?void 0:w.bookingNo,userType:"citizen"}),S&&n.createElement(t.Toast,{error:S.key,label:g(S.label),style:{bottom:"0px"},onClose:()=>{b(null)}}))))},WTMyApplications:()=>{const{t:e}=i.useTranslation(),a=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),r=Digit.UserService.getUser().info,[d,u]=l.useState(""),[s,c]=l.useState(null),[v,m]=l.useState(null),[p,E]=l.useState("watertanker"),[f,g]=l.useState("watertanker");let _,h,T=window.location.href.split("/").pop();isNaN(parseInt(T))?_=4:(h=T,_=parseInt(T)+50);let y=isNaN(parseInt(T))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:a,MobileNumber:null==r?void 0:r.mobileNumber}:{limit:"50",sortOrder:"ASC",sortBy:"createdTime",offset:h,tenantId:a,MobileNumber:null==r?void 0:r.mobileNumber};l.useEffect(()=>{m(y)},[T]);const{isLoading:S,data:b}=Digit.Hooks.wt.useTankerSearchAPI({filters:v},{enabled:!!v&&"watertanker"===p}),{isLoading:N,data:I}=Digit.Hooks.wt.useMobileToiletSearchAPI({filters:v},{enabled:!!v&&"mobileToilet"===p}),{isLoading:D,data:C}=Digit.Hooks.wt.useTreePruningSearchAPI({filters:v},{enabled:!!v&&"treePruning"===p});let A=!1,x=[];if("watertanker"===p?(A=S,x=(null==b?void 0:b.waterTankerBookingDetail)||[]):"mobileToilet"===p?(A=N,x=(null==I?void 0:I.mobileToiletBookingDetails)||[]):"treePruning"===p?(A=D,x=null==C?void 0:C.treePruningBookingDetails):(A=S||N||D,x=[...(null==I?void 0:I.mobileToiletBookingDetails)||[],...(null==b?void 0:b.waterTankerBookingDetail)||[],...(null==C?void 0:C.treePruningBookingDetails)||[]]),A)return n.createElement(t.Loader,null);const O=[{label:e("MOBILE_TOILET"),code:"mobileToilet"},{label:e("WATER_TANKER"),code:"watertanker"},{label:e("TREE_PRUNING"),code:"treePruning"}],w=[{i18nKey:"Booking Created",code:"BOOKING_CREATED",value:e("WT_BOOKING_CREATED")},{i18nKey:"Booking Approved",code:"APPROVED",value:e("WT_BOOKING_APPROVED")},{i18nKey:"Tanker Delivered",code:"TANKER_DELIVERED",value:e("WT_TANKER_DELIVERED")},{i18nKey:"Vendor Assigned",code:"ASSIGN_VENDOR",value:e("WT_ASSIGN_VENDOR")},{i18nKey:"Rejected",code:"REJECT",value:e("WT_BOOKING_REJECTED")}],L=[{i18nKey:"BOOKING_CREATED",code:"BOOKING_CREATED",value:e("TP_BOOKING_CREATED")},{i18nKey:"PENDING_FOR_APPROVAL",code:"PENDING_FOR_APPROVAL",value:e("TP_PENDING_FOR_APPROVAL")},{i18nKey:"PAYMENT_PENDING",code:"PAYMENT_PENDING",value:e("TP_PAYMENT_PENDING")},{i18nKey:"TEAM_ASSIGNMENT_FOR_VERIFICATION",code:"TEAM_ASSIGNMENT_FOR_VERIFICATION",value:e("TP_TEAM_ASSIGNMENT_FOR_VERIFICATION")},{i18nKey:"TEAM_ASSIGNMENT_FOR_EXECUTION",code:"TEAM_ASSIGNMENT_FOR_EXECUTION",value:e("TP_TEAM_ASSIGNMENT_FOR_EXECUTION")},{i18nKey:"TREE_PRUNING_SERVICE_COMPLETED",code:"TREE_PRUNING_SERVICE_COMPLETED",value:e("TP_TREE_PRUNING_SERVICE_COMPLETED")}];return n.createElement(n.Fragment,null,n.createElement(t.Header,null,`${e("MY_BOOKINGS")} (${x.length})`),n.createElement(t.Card,null,n.createElement("div",{style:{marginLeft:"16px"}},n.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"16px"}},n.createElement("div",{style:{flex:1}},n.createElement(t.CardLabel,null,e("SERVICE_TYPE")),n.createElement(t.Dropdown,{selected:O.find(e=>e.code===f),select:e=>{g(e.code),c("")},option:O,placeholder:e("Select Service Type"),optionKey:"label",t:e})),n.createElement("div",{style:{flex:1}},n.createElement(t.CardLabel,null,e("BOOKING_NO")),n.createElement(t.TextInput,{placeholder:e("Enter Booking No."),value:d,onChange:e=>u(e.target.value)})),n.createElement("div",{style:{flex:1}},n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.CardLabel,null,e("PT_COMMON_TABLE_COL_STATUS_LABEL")),n.createElement(t.Dropdown,{className:"form-field",selected:s,select:c,option:"treePruning"===f?L:w,placeholder:e("Select Status"),optionKey:"value",style:{width:"100%"},t:e}))),n.createElement("div",null,n.createElement("div",{style:{marginTop:"17%"}},n.createElement(t.SubmitBar,{label:e("ES_COMMON_SEARCH"),onSubmit:()=>{E(f);const e=d.trim(),t={...y,bookingNo:e||void 0,status:(null==s?void 0:s.code)||void 0};m(t)}}),n.createElement("p",{className:"link",style:{marginLeft:"30%",marginTop:"10px",display:"block"},onClick:()=>{u(""),c("")}},e("ES_COMMON_CLEAR_ALL"))))),n.createElement(o.Link,{to:"request-service/service-type"},n.createElement(t.SubmitBar,{style:{borderRadius:"30px",width:"20%"},label:e("NEW_REQUEST")+" +"})))),n.createElement("div",null,x.length>0&&x.map((t,l)=>n.createElement("div",{key:l},n.createElement(je,{application:t,tenantId:a,buttonLabel:e("SUMMARY")}))),0===x.length&&!A&&n.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("NO_APPLICATION_FOUND_MSG")),0!==x.length&&((null==I?void 0:I.count)||0)+((null==b?void 0:b.count)||0)+((null==C?void 0:C.count)||0)>_&&n.createElement("div",null,n.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},n.createElement("span",{className:"link"},n.createElement(o.Link,{to:"/digit-ui/citizen/wt/status/"+_},e("LOAD_MORE_MSG")))))))},ApplicationDetails:ro,WFApplicationTimeline:Vt,WFCaption:jt,WTEmpInbox:re,WTCitizenCard:()=>{const{t:e}=i.useTranslation(),a=o.useHistory(),[r,d]=l.useState("-"),u=Digit.ULBService.getCurrentTenantId()||Digit.ULBService.getCitizenCurrentTenant(!0),{data:s,isFetching:c,isSuccess:v}=Digit.Hooks.useNewInboxGeneral({tenantId:u,ModuleCode:"WT",filters:{limit:10,offset:0,services:["watertanker"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.wtAccess()}});l.useEffect(()=>{!c&&v&&d(s)},[c]);const m=[{label:e("ES_COMMON_INBOX"),link:"/digit-ui/citizen/wt/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/citizen/wt/my-bookings"}],p={Icon:n.createElement(t.CHBIcon,null),moduleName:e("WT_MODULE_NAME"),kpis:[{count:null==r?void 0:r.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/citizen/wt/inbox"}],links:m,onDetailsClick:()=>{a.push("/digit-ui/citizen/wt/inbox")}};return n.createElement("div",{className:"wt-citizen-card-premium"},n.createElement(t.EmployeeModuleCard,p))},WTCard:j,ServiceTypes:e=>{var i;let{t:o,config:a,onSelect:r,userType:d,formData:u}=e;const s=Digit.ULBService.getStateId(),{data:c}=Digit.Hooks.useCustomMDMS(s,"request-service",[{name:"ServiceType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.ServiceType}}),[v,m]=(Digit.UserService.getUser(),l.useState((null==u||null===(i=u.serviceType)||void 0===i?void 0:i.serviceType)||"")),p=l.useCallback(()=>{let e={...u.serviceType,serviceType:v};r(a.key,e,!1)},[u.serviceType,v,r,a.key]);return l.useEffect(()=>{"citizen"===d&&(console.log("calling meeeeeee"),p())},[v,d,p]),n.createElement(t.Modal,{headerBarMain:n.createElement(co,{t:o}),headerBarEnd:n.createElement(so,{onClick:()=>window.history.back()}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"50vh",width:"50%",overflowY:"visible"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},n.createElement(n.Fragment,null,n.createElement(t.FormStep,{config:a,onSelect:p,t:o,isDisabled:!v},n.createElement("div",null,n.createElement(t.CardLabel,null,""+o("REQUEST_TYPE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:v,placeholder:"Select Service Type",select:m,option:c,optionKey:"i18nKey",t:o})))))},ToiletRequestDetails:e=>{var i,o,a,r,d,u;let{t:s,config:c,onSelect:v,userType:m,formData:p}=e;const E=Digit.UserService.getUser().info,[f,g]=l.useState((null==p||null===(i=p.toiletRequestDetails)||void 0===i?void 0:i.mobileToilet)||""),[_,h]=l.useState((null==p||null===(o=p.toiletRequestDetails)||void 0===o?void 0:o.deliveryfromTime)||""),[T,y]=l.useState((null==p||null===(a=p.toiletRequestDetails)||void 0===a?void 0:a.deliverytoTime)||""),[S,b]=l.useState((null==p||null===(r=p.toiletRequestDetails)||void 0===r?void 0:r.deliveryfromDate)||""),[N,I]=l.useState((null==p||null===(d=p.toiletRequestDetails)||void 0===d?void 0:d.deliverytoDate)||""),[D,C]=l.useState((null==p||null===(u=p.toiletRequestDetails)||void 0===u?void 0:u.specialRequest)||""),A=Digit.ULBService.getStateId(),x={width:"EMPLOYEE"===E.type?"52%":"100%"},{data:O}=Digit.Hooks.useCustomMDMS(A,"request-service",[{name:"NoOfMobileToilet"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.NoOfMobileToilet}});let w=[];O&&O.map(e=>{w.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})});const L=()=>n.createElement("div",{className:"flex items-center"},n.createElement(t.TextInput,{type:"time",value:_,style:x,onChange:e=>h(e.target.value),min:"06:00",max:"23:59"})),P=()=>n.createElement("div",{className:"flex items-center"},n.createElement(t.TextInput,{type:"time",value:T,style:x,onChange:e=>y(e.target.value),min:"06:00",max:"23:59"})),R=()=>{let e={...p.toiletRequestDetails,mobileToilet:f,deliveryfromTime:_,deliverytoTime:T,deliveryfromDate:S,deliverytoDate:N,specialRequest:D};v(c.key,e,!1)};return l.useEffect(()=>{"citizen"===m&&R()},[f,_,T,S,N,D]),n.createElement(n.Fragment,null,n.createElement(t.FormStep,{config:c,onSelect:R,t:s,isDisabled:!(f&&_&&T&&S&&N&&D)},n.createElement("div",null,n.createElement(t.CardLabel,null,s("MT_NUMBER_OF_MOBILE_TOILETS")," ",n.createElement("span",{className:"check-page-link-button"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:f,placeholder:"Select Number of Mobile Toilets",select:g,option:w,style:x,optionKey:"i18nKey",t:s}),n.createElement(t.CardLabel,null,""+s("MT_DELIVERY_FROM_DATE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",style:x,value:S,onChange:function(e){b(e.target.value)},min:(new Date).toISOString().split("T")[0],rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||s("ERR_DEFAULT_INPUT_FIELD_MSG")}}),n.createElement(t.CardLabel,null,""+s("MT_DELIVERY_TO_DATE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",value:N,style:x,onChange:function(e){I(e.target.value)},min:S,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||s("ERR_DEFAULT_INPUT_FIELD_MSG")}}),n.createElement(t.CardLabel,null,""+s("MT_REQUIREMNENT_FROM_TIME")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(L,null),n.createElement(t.CardLabel,null,""+s("MT_REQUIREMNENT_TO_TIME")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(P,null),n.createElement(t.CardLabel,null,""+s("MT_SPECIAL_REQUEST")," ",n.createElement("span",{className:"check-page-link-button"})),n.createElement(t.TextArea,{t:s,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"mobileToilet",style:x,placeholder:"Special Request",value:D,onChange:function(e){C(e.target.value)},style:{width:"EMPLOYEE"===E.type?"51.6%":null}}))))},TreePruningRequestDetails:e=>{var i,o,a;let{t:r,config:d,onSelect:u,userType:s,formData:c}=e;const v=Digit.UserService.getUser().info,[m,p]=l.useState((null==c||null===(i=c.treePruningRequestDetails)||void 0===i?void 0:i.reasonOfPruning)||""),[E,f]=l.useState(""),[g,_]=l.useState(""),[h,T]=l.useState((null==c||null===(o=c.treePruningRequestDetails)||void 0===o?void 0:o.geoTagLocation)||""),[y,S]=l.useState((null==c||null===(a=c.treePruningRequestDetails)||void 0===a?void 0:a.supportingDocumentFile)||""),[b,N]=l.useState(!1),[I,D]=l.useState(""),C=Digit.ULBService.getStateId(),A={width:"EMPLOYEE"===v.type?"50%":"100%"},{data:x}=Digit.Hooks.useCustomMDMS(C,"request-service",[{name:"ReasonPruningType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.ReasonPruningType}}),O=()=>{let e={...c.treePruningRequestDetails,reasonOfPruning:m,geoTagLocation:h,supportingDocumentFile:y,latitude:E,longitude:g};u(d.key,e,!1)};l.useEffect(()=>{"citizen"===s&&O()},[m,h,y,b]);const w=()=>n.createElement("div",{className:"loading-spinner"});return n.createElement(t.FormStep,{config:d,onSelect:O,t:r,isDisabled:!m||!y},n.createElement("div",null,n.createElement(t.CardLabel,null,r("REASON_FOR_PRUNING")," ",n.createElement("span",{className:"check-page-link-button"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:m,placeholder:"Select Reason",select:p,option:x,style:A,optionKey:"code",t:r}),n.createElement(t.CardLabel,null,r("LOCATION_GEOTAG")),n.createElement("div",{style:{display:"flex",alignItems:"stretch",gap:"8px",width:"EMPLOYEE"===v.type?"53%":"100%"}},n.createElement(t.TextInput,{t:r,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"geoTagLocation",value:h,placeholder:"Select Location",onChange:e=>{const{name:t,value:l}=e.target?e.target:{name:e.name,value:e};"reasonOfPruning"===t?p(l):"geoTagLocation"===t||"location"===t?T(l):"supportingDocumentFile"===t&&S(l)},max:(new Date).toISOString().split("T")[0],style:{flex:1},rules:{required:r("dddddddd"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||r("hhhhhhh")},className:"location-input"}),n.createElement("div",{className:"butt-icon",onClick:()=>{"geolocation"in navigator?navigator.geolocation.getCurrentPosition(e=>{const{latitude:t,longitude:l}=e.coords;T(`${t}, ${l}`),f(t),_(l)},e=>{console.error("Error getting location:",e),alert("Unable to retrieve your location. Please check your browser settings.")}):alert("Geolocation is not supported by your browser.")},style:{cursor:"pointer",width:"25px",marginBottom:"8px"}},n.createElement(t.LocationIcon,{className:"fill-path-primary-main"}))),n.createElement(t.CardLabel,null,r("UPLOAD_THE_SITE_PHOTOGRAPH")," ",n.createElement("span",{className:"check-page-link-button"},"*")),n.createElement("div",{style:{marginBottom:"16px",...A}},n.createElement(t.UploadFile,{id:"supportingDocument",onUpload:e=>((e,t)=>{const l=e.target.files[0];l.size>=5242880?(setError("supportingDocument",{message:r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")}),t(null)):(N(!0),Digit.UploadServices.Filestorage("TP",l,Digit.ULBService.getStateId()).then(e=>{var l,n;(null==e||null===(l=e.data)||void 0===l||null===(n=l.files)||void 0===n?void 0:n.length)>0?t(e.data.files[0].fileStoreId):setError("supportingDocument",{message:r("CS_FILE_UPLOAD_ERROR")})}).catch(()=>setError("supportingDocument",{message:r("CS_FILE_UPLOAD_ERROR")})).finally(()=>N(!1)))})(e,S),onDelete:()=>{S(null)},message:b?n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},n.createElement(w,null),n.createElement("span",null,"Uploading...")):y?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},accept:"image/*, .pdf, .png, .jpeg, .jpg",buttonType:"button",error:I||!y}))))},MTAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:d}=i.useTranslation(),u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useMobileToiletCreateAPI(u),c=Digit.UserService.getUser().info,{data:v}=Digit.Hooks.useStore.getInitData(),{tenants:m}=v||{};return l.useEffect(()=>{try{a.tenantId=u;let e=g(a);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?n.createElement(t.Loader,null):n.createElement(t.Card,null,n.createElement(fo,{t:d,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),n.createElement(t.StatusTable,null,s.isSuccess&&n.createElement(t.Row,{rowContainerStyle:Eo,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&n.createElement(t.SubmitBar,{label:d("MT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.mobileToiletBookingDetail;const l=m.find(e=>e.code===t.tenantId);return Promise.resolve(mo({...t},l,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),n.createElement(o.Link,"CITIZEN"===(null==c?void 0:c.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},n.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},TPAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:d}=i.useTranslation(),u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useTreePruningCreateAPI(u),c=Digit.UserService.getUser().info,{data:v}=Digit.Hooks.useStore.getInitData(),{tenants:m}=v||{};return l.useEffect(()=>{try{a.tenantId=u;let e=h(a);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?n.createElement(t.Loader,null):n.createElement(t.Card,null,n.createElement(yo,{t:d,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),n.createElement(t.StatusTable,null,s.isSuccess&&n.createElement(t.Row,{rowContainerStyle:To,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&n.createElement(t.SubmitBar,{label:d("TP_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.treePruningBookingDetail;const l=m.find(e=>e.code===t.tenantId);return Promise.resolve(_o({...t},l,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),n.createElement(o.Link,"CITIZEN"===(null==c?void 0:c.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},n.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},MTCitizenCard:()=>{const{t:e}=i.useTranslation(),[o,a]=l.useState("-"),r=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),{data:d,isFetching:u,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:r,ModuleCode:"WT",filters:{limit:10,offset:0,services:["mobileToilet"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.mtAccess()}});l.useEffect(()=>{!u&&s&&a(d)},[u]);const c=[{label:e("ES_COMMON_INBOX"),link:"/digit-ui/citizen/wt/mt/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/citizen/wt/mt/my-bookings"}],v={Icon:n.createElement(t.CHBIcon,null),moduleName:e("ACTION_TEST_MT"),kpis:[{count:null==o?void 0:o.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/wt/mt/inbox"}],links:c};return n.createElement(t.EmployeeModuleCard,v)},FixedPointScheduleManagement:ce,LiveTrackingSystem:Ie,AddFillingPointAddress:xe,AddFixPointAddress:Oe,AddFillingPointMetaData:De,WTSearchPointAddress:Fe,VendorAssign:We,EmergencyFixedPointInfoPage:e=>{let{t:i,onSelect:o,formData:a,config:r}=e;const[d,u]=l.useState(""),[s,c]=l.useState(!1),[v,m]=l.useState(!1),p="WT_EMERGENCY_WATER_TANKER_REQUEST"!==i("WT_EMERGENCY_WATER_TANKER_REQUEST")?i("WT_EMERGENCY_WATER_TANKER_REQUEST"):"Emergency Water Tanker Request",E=()=>{const e={...a.infodetails||{},existingDataSet:d};o(r.key,{...a[r.key],...e})};return n.createElement(n.Fragment,null,n.createElement(t.Card,{className:"search-form-wrapper",style:{flexDirection:"column",gap:"12px",justifyContent:"flex-start"}},n.createElement(t.CardHeader,null,p),n.createElement("div",null,n.createElement("p",{className:"primaryColor"},i("SV_DOC_REQ_SCREEN_SUB_HEADER")),n.createElement("p",{className:"primaryColor"},i("SV_DOC_REQ_SCREEN_TEXT")),n.createElement("p",{className:"primaryColor"},i("SV_DOC_REQ_SCREEN_SUB_TEXT"))),n.createElement("span",null,n.createElement(t.SubmitBar,{label:i("COMMON_NEXT"),onSubmit:()=>{v?c(!0):E()}}))),s&&n.createElement(R,{t:i,closeModal:()=>c(!1),actionCancelOnSubmit:()=>c(!1),onSubmit:()=>{E(),c(!1)},setExistingDataSet:u}))},EmergencyFixedPointRequestDetails:e=>{var i,o,a,r,d,u,s,c,v;let{t:p,config:E,onSelect:f,formData:g}=e;Digit.UserService.getUser();let _={};const[h,T]=l.useState((null==g||null===(i=g.requestDetails)||void 0===i?void 0:i.tankerType)||{code:"TANKER",i18nKey:"TANKER",value:"TANKER"}),[y,S]=l.useState((null==g||null===(o=g.requestDetails)||void 0===o?void 0:o.tankerQuantity)||{i18nKey:"1",code:"1",value:"1"}),[b,I]=l.useState((null==g||null===(a=g.requestDetails)||void 0===a?void 0:a.waterQuantity)||""),[D,C]=l.useState((null==g||null===(r=g.requestDetails)||void 0===r?void 0:r.waterType)||""),[A,x]=l.useState((null==g||null===(d=g.requestDetails)||void 0===d?void 0:d.deliveryDate)||(new Date).toISOString().split("T")[0]),[O,w]=l.useState((null==g||null===(u=g.requestDetails)||void 0===u?void 0:u.description)||""),[L,P]=l.useState((null==g||null===(s=g.requestDetails)||void 0===s?void 0:s.deliveryTime)||(new Date).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"})),[R,k]=l.useState((null==g||null===(c=g.requestDetails)||void 0===c?void 0:c.extraCharge)||!1),[M,F]=l.useState((null==g||null===(v=g.requestDetails)||void 0===v?void 0:v.fileStoreId)||null),[B,W]=l.useState(null),[U,H]=l.useState(null),j=Digit.ULBService.getStateId(),V={width:"100%"},{data:z}=Digit.Hooks.useCustomMDMS(j,"request-service",[{name:"VehicleType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.VehicleType}}),{data:K}=Digit.Hooks.useCustomMDMS(j,"request-service",[{name:"TankerType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerType}}),{data:G}=Digit.Hooks.useCustomMDMS(j,"request-service",[{name:"TankerQuantity"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerQuantity}}),{data:Y}=Digit.Hooks.useCustomMDMS(j,"Request-service",[{name:"WaterType"}],{select:e=>{var t;return null==e||null===(t=e["Request-service"])||void 0===t?void 0:t.WaterType}});let q=[],$=[],X=[];Y&&Y.map(e=>{X.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),G&&G.map(e=>{$.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),z&&z.map(e=>{q.push({i18nKey:""+e.capacity,code:""+e.capacity,value:""+e.capacity,vehicleType:e.vehicleType,capacityName:e.capacityName})}),K&&K.map(e=>{});let Q=q.filter(e=>{const t=e.vehicleType?e.vehicleType.toLowerCase():"";return t===(null!=h&&h.code?h.code.toLowerCase():"")||t.includes("tanker")}).map(e=>({i18nKey:""+e.capacityName,code:""+e.code,value:""+e.value,capacity:""+e.capacity}));0===Q.length&&q.length>0&&(Q=q.map(e=>({i18nKey:""+e.capacityName,code:""+e.code,value:""+e.value,capacity:""+e.capacity})));const Z=()=>n.createElement("div",{className:"flex items-center"},n.createElement(t.TextInput,{type:"time",value:L,style:V,onChange:e=>P(e.target.value),min:"06:00",max:"23:59"}));return l.useEffect(()=>{!function(){try{H(null);const e=function(){if(B){const e=function(){if(B.size>=2e6)H(p("WT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=N(function(){return Promise.resolve(Digit.UploadServices.Filestorage("wt",B,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?F(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):H(p("WT_FILE_UPLOAD_ERROR"))})},function(){H(p("WT_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[B]),l.useEffect(()=>{if(!D&&null!=Y&&Y.length){const e=Y.find(e=>{var t,l;return"Drinkable"===e.code||"DRINKABLE"===(null===(t=e.code)||void 0===t?void 0:t.toUpperCase())||"DRINKING_WATER"===(null===(l=e.code)||void 0===l?void 0:l.toUpperCase())});C(e?{i18nKey:""+e.code,code:""+e.code,value:""+e.code}:{i18nKey:""+Y[0].code,code:""+Y[0].code,value:""+Y[0].code})}},[Y,D]),n.createElement(n.Fragment,null,n.createElement(t.FormStep,{config:E,onSelect:()=>{let e={...g.requestDetails,tankerType:h,deliveryDate:A,tankerQuantity:y,waterType:D,waterQuantity:b,deliveryTime:L,description:O,extraCharge:R,fileStoreId:M};f(E.key,e,!1)},t:p,isDisabled:!(h&&A&&y&&b&&L&&D),className:"card-form-container"},n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_WATER_TYPE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:D,placeholder:p("WT_SELECT_WATER_TYPE"),select:C,option:X,style:V,optionKey:"i18nKey",t:p})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_WATER_QUANTITY")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:b,placeholder:"Select Water Quantity",select:I,option:Q,style:V,optionKey:"i18nKey",t:p})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_TANKER_QUANTITY")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:y,placeholder:"Select Tanker Quantity",select:S,option:$,style:V,optionKey:"i18nKey",t:p})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_DELIVERY_DATE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextInput,{t:p,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",style:V,value:A,onChange:function(e){x(e.target.value)},min:(new Date).toISOString().split("T")[0],max:(new Date).toISOString().split("T")[0],rules:{required:p("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||p("ERR_DEFAULT_INPUT_FIELD_MSG")}})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_DELIVERY_TIME")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(Z,null)),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_UPLOAD_DOCUMENT")),n.createElement(t.UploadFile,{id:"wt-doc",extraStyleName:"propertyCreate",accept:".jpg,.png,.pdf,.jpeg",onUpload:function(e){F(null),W(e.target.files[0])},onDelete:()=>{F(null)},message:M?"1 "+p("WT_ACTION_FILEUPLOADED"):p("WT_ACTION_NO_FILEUPLOADED"),error:U})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_DESCRIPTION")),n.createElement(t.TextArea,m({t:p,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"description",value:O,onChange:function(e){w(e.target.value)},style:V,ValidationRequired:!1},_={isRequired:!1,pattern:"^[a-zA-Z ]+$",type:"tel",title:p("PT_NAME_ERROR_MESSAGE")}))),U?n.createElement("div",{style:{height:"20px",width:"100%",fontSize:"20px",color:"red",marginTop:"5px"}},U):"",n.createElement(t.CheckBox,{label:p("WT_IMMEDIATE"),onChange:()=>{k(!R)},checked:R})))},EmergencyFixedPointCheckPage:e=>{var a,r,d,u,s,c,v,m,g,_,h,T,y,S,b,N,I,D,C,A,x,O;let{onSubmit:w,value:L={}}=e;const{t:P}=i.useTranslation(),{pathname:R}=o.useLocation(),{owner:k,requestDetails:M,dispatchDetails:F,address:B,serviceType:W,toiletRequestDetails:U,treePruningRequestDetails:H}=L,[j,V]=l.useState(!1),z=null!=M&&M.extraCharge?"YES":"NO",[K,G]=l.useState(null),Y=!(null!=W&&null!==(a=W.serviceType)&&void 0!==a&&a.code)||"WT"===(null==W||null===(r=W.serviceType)||void 0===r?void 0:r.code),q=R.includes("citizen")?"/digit-ui/citizen/wt/fixed-point/request-service":"/digit-ui/employee/wt/fixed-point/request-service";return n.useEffect(()=>{null!=M&&M.fileStoreId&&Digit.UploadServices.Filefetch([null==M?void 0:M.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var t,l,n,i;const o=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.url)||void 0===i?void 0:i.split(",")[0];G(o)})},[null==M?void 0:M.fileStoreId]),n.createElement(n.Fragment,null,n.createElement(t.Card,{className:"overflow-y-scroll"},n.createElement(t.CardHeader,null,P("WT_SUMMARY_PAGE")),n.createElement("div",null,n.createElement(t.CardSubHeader,null,P("ES_APPLICANT_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:"YES"===(null==k||null===(d=k.isExistingFixedPoint)||void 0===d?void 0:d.code)||"FIXED-POINT"===(null==k?void 0:k.type)?P("WT_FIXED_POINT_DELIVERY_POINT","Fixed Point/Delivery Point"):P("COMMON_APPLICANT_NAME"),text:""+P(p(null==k?void 0:k.applicantName)),actionButton:n.createElement(So,{jumpTo:q+"/fp-applicant-details"})}),n.createElement(t.Row,{label:P("COMMON_MOBILE_NUMBER"),text:""+P(p(null==k?void 0:k.mobileNumber))}),n.createElement(t.Row,{label:P("COMMON_ALT_MOBILE_NUMBER"),text:""+P(p(null==k?void 0:k.alternateNumber))}),n.createElement(t.Row,{label:P("COMMON_EMAIL_ID"),text:""+P(p(null==k?void 0:k.emailId))})),n.createElement(t.CardSubHeader,null,P("ES_TITLE_ADDRESS_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:P("HOUSE_NO"),text:""+P(p(null==B?void 0:B.houseNo)),actionButton:n.createElement(So,{jumpTo:q+"/fp-address-details"})}),n.createElement(t.Row,{label:P("ADDRESS_LINE1"),text:""+P(p(null==B?void 0:B.addressLine1))}),n.createElement(t.Row,{label:P("ADDRESS_LINE2"),text:""+P(p(null==B?void 0:B.addressLine2))}),n.createElement(t.Row,{label:P("CITY"),text:""+P(p(null==B||null===(u=B.city)||void 0===u||null===(s=u.city)||void 0===s?void 0:s.name))}),n.createElement(t.Row,{label:P("LOCALITY"),text:""+P(p(null==B||null===(c=B.locality)||void 0===c?void 0:c.i18nKey))}),n.createElement(t.Row,{label:P("PINCODE"),text:""+P(p(null==B?void 0:B.pincode))}),n.createElement(t.Row,{label:P("LATITUDE"),text:""+P(p(null==B?void 0:B.latitude))}),n.createElement(t.Row,{label:P("LONGITUDE"),text:""+P(p(null==B?void 0:B.longitude))}),n.createElement(t.Row,{label:P("ASSEMBLY"),text:""+P(p("string"==typeof(null==B?void 0:B.assembly)?null==B?void 0:B.assembly:null==B||null===(v=B.assembly)||void 0===v?void 0:v.name))}),n.createElement(t.Row,{label:P("BLOCK"),text:""+P(p("string"==typeof(null==B?void 0:B.block)?null==B?void 0:B.block:(null==B||null===(m=B.block)||void 0===m?void 0:m.name)||(null==B||null===(g=B.ward)||void 0===g?void 0:g.name)))}),n.createElement(t.Row,{label:P("ZONE"),text:""+P(p("string"==typeof(null==B?void 0:B.zone)?null==B?void 0:B.zone:null==B||null===(_=B.zone)||void 0===_?void 0:_.name))}),n.createElement(t.Row,{label:P("LANDMARK"),text:""+P(p(null==B?void 0:B.landmark))}),n.createElement(t.Row,{label:P("STREET_NAME"),text:""+P(p(null==B?void 0:B.streetName))})),n.createElement(t.CardSubHeader,null,P("WT_DISPATCH_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:P("WT_FILLING_POINT"),text:""+P(p(null==F||null===(h=F.fillingPoint)||void 0===h?void 0:h.name)),actionButton:n.createElement(So,{jumpTo:q+"/fp-dispatch-details"})}),n.createElement(t.Row,{label:P("WT_VENDOR"),text:""+P(p(null==F||null===(T=F.vendor)||void 0===T?void 0:T.name))}),n.createElement(t.Row,{label:P("WT_VEHICLE"),text:""+P(p(null==F||null===(y=F.vehicle)||void 0===y?void 0:y.name))}),n.createElement(t.Row,{label:P("WT_DRIVER"),text:""+P(p(null==F||null===(S=F.driver)||void 0===S?void 0:S.name))})),Y&&n.createElement(l.Fragment,null,n.createElement(t.CardSubHeader,null,P("WT_REQUEST_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:P("WT_TANKER_TYPE"),text:""+P(p(null==M||null===(b=M.tankerType)||void 0===b?void 0:b.value)),actionButton:n.createElement(So,{jumpTo:q+"/fp-request-details"})}),n.createElement(t.Row,{label:P("WT_WATER_TYPE"),text:""+P(p(null==M||null===(N=M.waterType)||void 0===N?void 0:N.code))}),n.createElement(t.Row,{label:P("WT_TANKER_QUANTITY"),text:""+P(p(null==M||null===(I=M.tankerQuantity)||void 0===I?void 0:I.code))}),n.createElement(t.Row,{label:P("WT_WATER_QUANTITY"),text:""+P(p(null==M||null===(D=M.waterQuantity)||void 0===D?void 0:D.value))}),n.createElement(t.Row,{label:P("WT_DELIVERY_DATE"),text:""+P(p(f(null==M?void 0:M.deliveryDate)))}),n.createElement(t.Row,{label:P("WT_DELIVERY_TIME"),text:""+p(E(null==M?void 0:M.deliveryTime))}),n.createElement(t.Row,{label:P("WT_DESCRIPTION"),text:""+P(p(null==M?void 0:M.description))}),(null==M?void 0:M.fileStoreId)&&n.createElement(t.Row,{label:P("WT_UPLOAD_DOCUMENT"),text:n.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>bo(null==M?void 0:M.fileStoreId)},n.createElement(t.GenericFileIcon,null))}),n.createElement(t.Row,{label:P("WT_IMMEDIATE"),text:""+P(p(z))}))),"MobileToilet"===(null==W||null===(C=W.serviceType)||void 0===C?void 0:C.code)&&n.createElement(l.Fragment,null,n.createElement(t.CardSubHeader,null,P("ES_REQUEST_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:P("MT_NUMBER_OF_MOBILE_TOILETS"),text:""+P(p(null==U||null===(A=U.mobileToilet)||void 0===A?void 0:A.code)),actionButton:n.createElement(So,{jumpTo:q+"/fp-request-details"})}),n.createElement(t.Row,{label:P("MT_DELIVERY_FROM_DATE"),text:""+P(p(f(null==U?void 0:U.deliveryfromDate)))}),n.createElement(t.Row,{label:P("MT_DELIVERY_TO_DATE"),text:""+P(f(p(null==U?void 0:U.deliverytoDate)))}),n.createElement(t.Row,{label:P("MT_REQUIREMNENT_FROM_TIME"),text:p(E(null==U?void 0:U.deliveryfromTime))}),n.createElement(t.Row,{label:P("MT_REQUIREMNENT_TO_TIME"),text:p(E(null==U?void 0:U.deliverytoTime))}),n.createElement(t.Row,{label:P("MT_SPECIAL_REQUEST"),text:""+P(p(null==U?void 0:U.specialRequest))}))),"TREE_PRUNING"===(null==W||null===(x=W.serviceType)||void 0===x?void 0:x.code)&&n.createElement(l.Fragment,null,n.createElement(t.CardSubHeader,null,P("TP_REQUEST_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:P("REASON_FOR_PRUNING"),text:""+P(p(null==H||null===(O=H.reasonOfPruning)||void 0===O?void 0:O.code)),actionButton:n.createElement(So,{jumpTo:q+"/fp-request-details"})}),n.createElement(t.Row,{label:P("LOCATION_GEOTAG"),text:""+P(p(null==H?void 0:H.geoTagLocation))}),n.createElement(t.Row,{label:P("UPLOAD_THE_SITE_PHOTOGRAPH"),text:n.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>bo(null==H?void 0:H.supportingDocumentFile)},n.createElement(t.GenericFileIcon,null))}))),n.createElement(t.CheckBox,{label:P("FINAL_DECLARATION_MESSAGE"),onChange:()=>{V(!j)},checked:j})),n.createElement(t.SubmitBar,{label:P("COMMON_BUTTON_SUBMIT"),onSubmit:w,disabled:!j})))},WTEmergencyFixedPointAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:d}=i.useTranslation(),u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useTankerCreateAPI(u),c=Digit.UserService.getUser().info,{data:v}=Digit.Hooks.useStore.getInitData(),{tenants:m}=v||{};return l.useEffect(()=>{try{a.tenantId=u;let e=(e=>{var t,l,n,i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,h,T,y,S,b,N,I,D,C,A,x,O,w,L,P,R,k,M,F,B,W,U,H,j,V,z,K,G,Y,q,$,X,Q,Z,J,ee,te,le,ne,ie,oe,ae,re,de,ue,se,ce,ve,me,pe,Ee,fe,ge,_e,he,Te,ye,Se,be,Ne,Ie,De,Ce,Ae,xe,Oe,we,Le,Pe,Re,ke,Me,Fe,Be,We,Ue,He,je,Ve,ze,Ke,Ge;const Ye=null==e||null===(t=e.owner)||void 0===t?void 0:t.fixedPoint,qe=(null==Ye?void 0:Ye.applicantDetail)||{},$e=(null==Ye?void 0:Ye.address)||{};return{waterTankerBookingDetail:{id:(null==e?void 0:e.id)||(null==e||null===(l=e.waterTankerBookingDetail)||void 0===l?void 0:l.id)||"",bookingNo:(null==e?void 0:e.bookingNo)||(null==e||null===(n=e.waterTankerBookingDetail)||void 0===n?void 0:n.bookingNo)||null,applicantId:(null==qe?void 0:qe.applicantId)||(null==e||null===(i=e.owner)||void 0===i?void 0:i.applicantId)||"",tenantId:null==e?void 0:e.tenantId,tankerType:null===(o=(null==e||null===(a=e.requestDetails)||void 0===a||null===(r=a.tankerType)||void 0===r?void 0:r.code)||(null==e||null===(d=e.requestDetails)||void 0===d?void 0:d.tankerType)||"")||void 0===o?void 0:o.toUpperCase(),waterType:(null==e||null===(u=e.requestDetails)||void 0===u||null===(s=u.waterType)||void 0===s?void 0:s.code)||(null==e||null===(c=e.requestDetails)||void 0===c?void 0:c.waterType),tankerQuantity:(null==e||null===(v=e.requestDetails)||void 0===v||null===(m=v.tankerQuantity)||void 0===m?void 0:m.code)||(null==e||null===(p=e.requestDetails)||void 0===p?void 0:p.tankerQuantity),waterQuantity:(null==e||null===(E=e.requestDetails)||void 0===E||null===(f=E.waterQuantity)||void 0===f?void 0:f.code)||(null==e||null===(g=e.requestDetails)||void 0===g||null===(_=g.waterQuantity)||void 0===_?void 0:_.value)||(null==e||null===(h=e.requestDetails)||void 0===h?void 0:h.waterQuantity),description:null==e||null===(T=e.requestDetails)||void 0===T?void 0:T.description,deliveryDate:null==e||null===(y=e.requestDetails)||void 0===y?void 0:y.deliveryDate,deliveryTime:null==e||null===(S=e.requestDetails)||void 0===S?void 0:S.deliveryTime,extraCharge:null!=e&&null!==(b=e.requestDetails)&&void 0!==b&&b.extraCharge?"Y":"N",addressDetailId:(null==$e?void 0:$e.addressId)||(null==e||null===(N=e.address)||void 0===N?void 0:N.addressDetailId)||"",vendorId:(null==e||null===(I=e.dispatchDetails)||void 0===I||null===(D=I.vendor)||void 0===D?void 0:D.id)||(null==e||null===(C=e.owner)||void 0===C||null===(A=C.vendor)||void 0===A?void 0:A.id)||"",vehicleId:(null==e||null===(x=e.dispatchDetails)||void 0===x||null===(O=x.vehicle)||void 0===O?void 0:O.id)||(null==e||null===(w=e.owner)||void 0===w||null===(L=w.vehicle)||void 0===L?void 0:L.id)||"",driverId:(null==e||null===(P=e.dispatchDetails)||void 0===P||null===(R=P.driver)||void 0===R||null===(k=R.owner)||void 0===k?void 0:k.uuid)||(null==e||null===(M=e.dispatchDetails)||void 0===M||null===(F=M.driver)||void 0===F?void 0:F.ownerId)||(null==e||null===(B=e.dispatchDetails)||void 0===B||null===(W=B.driver)||void 0===W?void 0:W.uuid)||(null==e||null===(U=e.dispatchDetails)||void 0===U||null===(H=U.driver)||void 0===H?void 0:H.id)||(null==e||null===(j=e.owner)||void 0===j||null===(V=j.driver)||void 0===V||null===(z=V.owner)||void 0===z?void 0:z.uuid)||(null==e||null===(K=e.owner)||void 0===K||null===(G=K.driver)||void 0===G?void 0:G.ownerId)||"",fillingPointId:(null==e||null===(Y=e.dispatchDetails)||void 0===Y||null===(q=Y.fillingPoint)||void 0===q?void 0:q.id)||(null==e||null===($=e.owner)||void 0===$||null===(X=$.fillingPoint)||void 0===X?void 0:X.id)||"",vehicleType:(null==e||null===(Q=e.dispatchDetails)||void 0===Q||null===(Z=Q.vehicle)||void 0===Z?void 0:Z.vehicleType)||(null==e||null===(J=e.owner)||void 0===J||null===(ee=J.vehicle)||void 0===ee?void 0:ee.vehicleType)||"",vehicleCapacity:(null==e||null===(te=e.dispatchDetails)||void 0===te||null===(le=te.vehicle)||void 0===le?void 0:le.capacity)||(null==e||null===(ne=e.owner)||void 0===ne||null===(ie=ne.vehicle)||void 0===ie?void 0:ie.capacity)||"",applicantDetail:{applicantId:(null==qe?void 0:qe.applicantId)||(null==e||null===(oe=e.owner)||void 0===oe?void 0:oe.applicantId)||"",bookingId:(null==qe?void 0:qe.bookingId)||"",name:(null==e||null===(ae=e.owner)||void 0===ae?void 0:ae.applicantName)||(null==qe?void 0:qe.name)||"",mobileNumber:(null==e||null===(re=e.owner)||void 0===re?void 0:re.mobileNumber)||(null==qe?void 0:qe.mobileNumber)||"",alternateNumber:(null==e||null===(de=e.owner)||void 0===de?void 0:de.alternateNumber)||(null==qe?void 0:qe.alternateNumber)||"",emailId:(null==e||null===(ue=e.owner)||void 0===ue?void 0:ue.emailId)||(null==qe?void 0:qe.emailId)||"",gender:(null==e||null===(se=e.owner)||void 0===se?void 0:se.gender)||(null==qe?void 0:qe.gender)||null,type:"FIXED-POINT",fixedPointId:(null==qe?void 0:qe.fixedPointId)||""},address:{applicantId:(null==$e?void 0:$e.applicantId)||(null==qe?void 0:qe.applicantId)||"",addressId:(null==$e?void 0:$e.addressId)||(null==e||null===(ce=e.address)||void 0===ce?void 0:ce.addressId)||"",addressType:(null==e||null===(ve=e.address)||void 0===ve||null===(me=ve.addressType)||void 0===me?void 0:me.code)||(null==e||null===(pe=e.address)||void 0===pe?void 0:pe.addressType)||"CORRESPONDENCE",pincode:(null==e||null===(Ee=e.address)||void 0===Ee?void 0:Ee.pincode)||(null==$e?void 0:$e.pincode)||"",city:(null==e||null===(fe=e.address)||void 0===fe||null===(ge=fe.city)||void 0===ge||null===(_e=ge.city)||void 0===_e?void 0:_e.name)||(null==e||null===(he=e.address)||void 0===he||null===(Te=he.city)||void 0===Te?void 0:Te.name)||(null==e||null===(ye=e.address)||void 0===ye?void 0:ye.city)||(null==$e?void 0:$e.city)||"",cityCode:(null==e||null===(Se=e.address)||void 0===Se||null===(be=Se.city)||void 0===be||null===(Ne=be.city)||void 0===Ne?void 0:Ne.code)||(null==e||null===(Ie=e.address)||void 0===Ie?void 0:Ie.cityCode)||(null==$e?void 0:$e.cityCode)||"DJB",addressLine1:(null==e||null===(De=e.address)||void 0===De?void 0:De.addressLine1)||(null==$e?void 0:$e.addressLine1)||"",addressLine2:(null==e||null===(Ce=e.address)||void 0===Ce?void 0:Ce.addressLine2)||(null==$e?void 0:$e.addressLine2)||"",locality:(null==e||null===(Ae=e.address)||void 0===Ae||null===(xe=Ae.locality)||void 0===xe?void 0:xe.i18nKey)||(null==e||null===(Oe=e.address)||void 0===Oe||null===(we=Oe.locality)||void 0===we?void 0:we.name)||(null==e||null===(Le=e.address)||void 0===Le?void 0:Le.locality)||(null==$e?void 0:$e.locality)||"",localityCode:(null==e||null===(Pe=e.address)||void 0===Pe||null===(Re=Pe.locality)||void 0===Re?void 0:Re.code)||(null==e||null===(ke=e.address)||void 0===ke?void 0:ke.localityCode)||(null==$e?void 0:$e.localityCode)||"",streetName:(null==e||null===(Me=e.address)||void 0===Me?void 0:Me.streetName)||(null==$e?void 0:$e.streetName)||"",houseNo:(null==e||null===(Fe=e.address)||void 0===Fe?void 0:Fe.houseNo)||(null==$e?void 0:$e.houseNo)||"",landmark:(null==e||null===(Be=e.address)||void 0===Be?void 0:Be.landmark)||(null==$e?void 0:$e.landmark)||"",latitude:(null==e||null===(We=e.address)||void 0===We?void 0:We.latitude)||(null==$e?void 0:$e.latitude)||"",longitude:(null==e||null===(Ue=e.address)||void 0===Ue?void 0:Ue.longitude)||(null==$e?void 0:$e.longitude)||"",ward:(null==e||null===(He=e.address)||void 0===He?void 0:He.ward)||(null==e||null===(je=e.address)||void 0===je?void 0:je.block)||(null==$e?void 0:$e.ward)||"",zone:(null==e||null===(Ve=e.address)||void 0===Ve?void 0:Ve.zone)||(null==$e?void 0:$e.zone)||"",constituency:(null==e||null===(ze=e.address)||void 0===ze?void 0:ze.assembly)||(null==e||null===(Ke=e.address)||void 0===Ke?void 0:Ke.constituency)||(null==$e?void 0:$e.constituency)||""},WTfileStoreId:null==e||null===(Ge=e.requestDetails)||void 0===Ge?void 0:Ge.fileStoreId,bookingStatus:"BOOKING_CREATED",workflow:{action:"CREATE",comments:"",businessService:"watertanker-fixedpoint",moduleName:"request-service.water_tanker"}}}})(a);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?n.createElement(t.Loader,null):n.createElement(t.Card,{className:"vehicle-details-card"},n.createElement(Do,{t:d,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),n.createElement(t.StatusTable,null,s.isSuccess&&n.createElement(t.Row,{rowContainerStyle:Io,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&n.createElement(t.SubmitBar,{label:d("WT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.waterTankerBookingDetail;const l=m.find(e=>e.code===t.tenantId);return Promise.resolve(B({...t},l,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),n.createElement(o.Link,"CITIZEN"===(null==c?void 0:c.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},n.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},MTEmergencyFixedPointAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:d}=i.useTranslation(),u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useMobileToiletCreateAPI(u),c=Digit.UserService.getUser().info,{data:v}=Digit.Hooks.useStore.getInitData(),{tenants:m}=v||{};return l.useEffect(()=>{try{a.tenantId=u;let e=g(a);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?n.createElement(t.Loader,null):n.createElement(t.Card,null,n.createElement(xo,{t:d,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),n.createElement(t.StatusTable,null,s.isSuccess&&n.createElement(t.Row,{rowContainerStyle:Ao,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&n.createElement(t.SubmitBar,{label:d("MT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.mobileToiletBookingDetail;const l=m.find(e=>e.code===t.tenantId);return Promise.resolve(mo({...t},l,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),n.createElement(o.Link,"CITIZEN"===(null==c?void 0:c.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},n.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},EmergencyFixedPointTPAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:d}=i.useTranslation(),u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useTreePruningCreateAPI(u),c=Digit.UserService.getUser().info,{data:v}=Digit.Hooks.useStore.getInitData(),{tenants:m}=v||{};return l.useEffect(()=>{try{a.tenantId=u;let e=h(a);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?n.createElement(t.Loader,null):n.createElement(t.Card,null,n.createElement(Lo,{t:d,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),n.createElement(t.StatusTable,null,s.isSuccess&&n.createElement(t.Row,{rowContainerStyle:wo,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&n.createElement(t.SubmitBar,{label:d("TP_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.treePruningBookingDetail;const l=m.find(e=>e.code===t.tenantId);return Promise.resolve(_o({...t},l,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),n.createElement(o.Link,"CITIZEN"===(null==c?void 0:c.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},n.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},WTEmergencyFixedPointCreate:()=>{var e,t,r,d,u;const s=a.useQueryClient(),c=o.useRouteMatch(),{t:v}=i.useTranslation(),{pathname:m}=o.useLocation(),p=o.useHistory(),[E,f,g]=Digit.Hooks.useSessionStorage("FP_Create",{}),_=Digit.UserService.getUser(),h=Digit.ULBService.getCurrentTenantId(),T=null==_||null===(e=_.info)||void 0===e?void 0:e.uuid,{data:y}=Digit.Hooks.useUserSearch(h,{uuid:[T]},{},{enabled:!!T}),S=l.useMemo(()=>{let e=[];return Po.forEach(t=>{e=e.concat(t.body)}),e.indexRoute="fp-info",e},[]);l.useEffect(()=>{E&&Object.keys(E).length>0&&window.location.href.includes("/fp-info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(g(),s.invalidateQueries("FP_Create"))},[E,g,s]);const b=l.useCallback((e,t,l,n)=>{let i,o=m.split("/").pop(),a=!1;const r=o.charAt(o.length-1);Number(parseInt(o))||"0"===o||"-1"===o?(o="-1"===o||"-2"===o?m.slice(0,-3).split("/").pop():m.slice(0,-2).split("/").pop(),a=!0):a=!1,isNaN(r)||(a=!0);let d=S.find(e=>n?e.key===n:e.route===o);d||(d=S.find(e=>e.route===o));let{nextStep:u={}}=d||{},s=e?p.replace:p.push;if(l&&(u=n),null===u)return s(c.path+"/fp-check");i=isNaN(u.split("/").pop())&&a&&"map"!==u?`${c.path}/${u}/${t}`:`${c.path}/${u}`,s(i)},[m,S,c.path,p]),N=["fp-applicant-details","fp-address-details","fp-dispatch-details","fp-request-details"],I=l.useRef(E);l.useEffect(()=>{I.current=E},[E]);const D=l.useCallback(function(e,t,l,n,i){void 0===i&&(i=!1);const o=I.current;if("multiple"!==e){if("owners"===e){let l=o.owners||[],i=!0;try{i=JSON.stringify(l[n])!==JSON.stringify(t)}catch(e){i=Object.keys(t).some(e=>{var i;return(null===(i=l[n])||void 0===i?void 0:i[e])!==t[e]})}if(i){l[n]=t;const i={...o,[e]:[...l]};f(i),I.current=i}}else if("units"===e){let e=!0;try{e=JSON.stringify(o.units)!==JSON.stringify(t)}catch(l){e=Object.keys(t).some(e=>{var l;return(null===(l=o.units)||void 0===l?void 0:l[e])!==t[e]})}if(e){const e={...o,units:t};f(e),I.current=e}}else{const{...l}=t,n={...o[e],...l};let i=!0;try{i=JSON.stringify(o[e])!==JSON.stringify(n)}catch(t){i=Object.keys(n).some(t=>{var l;return(null===(l=o[e])||void 0===l?void 0:l[t])!==n[t]})}if(i){const t={...o,[e]:n};f(t),I.current=t}}null!=t&&t.silent||b(l,n,i,e)}else{let e={...o},a=!1;if(Object.keys(t).forEach(l=>{if("navigationKey"!==l&&"silent"!==l){const n={...e[l],...t[l]};let i=!0;try{i=JSON.stringify(e[l])!==JSON.stringify(n)}catch(t){i=Object.keys(n).some(t=>{var i;return(null===(i=e[l])||void 0===i?void 0:i[t])!==n[t]})}i&&(e[l]=n,a=!0)}}),a&&(f(e),I.current=e),t.silent)return;const r=t.navigationKey||Object.keys(t)[0];b(l,n,i,r)}},[f,b]),C=l.useMemo(()=>S.filter(e=>N.includes(e.route)).map(e=>({...e,Component:"string"==typeof e.component?Digit.ComponentRegistryService.getComponent(e.component):e.component,compConfig:{...e,isCollapsible:!0,defaultOpen:!0}})),[S]),A=N.some(e=>m.includes(e)),x=l.useRef({});l.useEffect(()=>{if(A){const e=m.split("/").pop();x.current[e]&&x.current[e].scrollIntoView({behavior:"smooth",block:"start"})}},[m,A]);const O=null===(t=Digit)||void 0===t||null===(r=t.ComponentRegistryService)||void 0===r?void 0:r.getComponent("EmergencyFixedPointCheckPage"),w=null===(d=Digit)||void 0===d||null===(u=d.ComponentRegistryService)||void 0===u?void 0:u.getComponent("WTEmergencyFixedPointAcknowledgement");return n.createElement(n.Fragment,null,n.createElement("div",{className:"employee-form-section-wrapper"},n.createElement("div",{className:"employee-form-section"},n.createElement(o.Switch,null,n.createElement(o.Route,{path:c.path+"/fp-check"},n.createElement(O,{onSubmit:function(){try{return p.push(c.path+"/fp-wt-acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:E})),n.createElement(o.Route,{path:c.path+"/fp-wt-acknowledgement"},n.createElement(w,{data:E,onSuccess:()=>{g(),s.invalidateQueries("FP_Create")}})),S.map((e,t)=>{if(!N.includes(e.route)){var l;const{component:i,texts:a,inputs:r,key:d,additionaFields:u}=e,s="string"==typeof i?Digit.ComponentRegistryService.getComponent(i):i;return n.createElement(o.Route,{path:`${c.path}/${e.route}`,key:t},n.createElement(s,{config:{texts:a,inputs:r,key:d,additionaFields:u},onSelect:D,t:v,formData:E,userDetails:null==y||null===(l=y.user)||void 0===l?void 0:l[0]}))}return null}),n.createElement(o.Route,{path:N.map(e=>`${c.path}/${e}`)},n.createElement("div",{className:"single-page-form-container"},C.map((e,t)=>{var l;const{Component:i,compConfig:o}=e;return n.createElement("div",{key:t,ref:t=>x.current[e.route]=t,className:"form-section-unit"},n.createElement(i,{config:o,onSelect:D,t:v,formData:E,userDetails:null==y||null===(l=y.user)||void 0===l?void 0:l[0]}))}))),n.createElement(o.Route,null,n.createElement(o.Redirect,{to:`${c.path}/${S.indexRoute}`}))))))},EmergencyFixedPointApplicantDetails:e=>{var i,o,a,r,d,u,s,c,v,p,E,f,g,_,h,T,y,S,b,N,I,D,C,A,x,O,w,L,P,R,k,M;let{t:F,config:B,onSelect:W,formData:U}=e;const H=Digit.UserService.getUser().info,j={width:"EMPLOYEE"===H.type?"100%":"86%"};let V={};const[z,K]=l.useState(("EMPLOYEE"===H.type?"":null==H?void 0:H.name)||(null==U||null===(i=U.owner)||void 0===i?void 0:i.applicantName)||(null==U||null===(o=U.infodetails)||void 0===o||null===(a=o.existingDataSet)||void 0===a||null===(r=a.owner)||void 0===r?void 0:r.applicantName)||""),[G,Y]=l.useState(("EMPLOYEE"===H.type?"":null==H?void 0:H.mobileNumber)||(null==U||null===(d=U.owner)||void 0===d?void 0:d.mobileNumber)||(null==U||null===(u=U.infodetails)||void 0===u||null===(s=u.existingDataSet)||void 0===s||null===(c=s.owner)||void 0===c?void 0:c.mobileNumber)||""),[q,$]=l.useState((null==U||null===(v=U.owner)||void 0===v?void 0:v.gender)||""),[X,Q]=l.useState((null==U||null===(p=U.owner)||void 0===p?void 0:p.dateOfBirth)||(null==U||null===(E=U.owner)||void 0===E||null===(f=E.requestDetails)||void 0===f?void 0:f.applicantName)||""),[Z,J]=l.useState(("EMPLOYEE"===H.type?"":null==H?void 0:H.emailId)||(null==U||null===(g=U.owner)||void 0===g?void 0:g.emailId)||(null==U||null===(_=U.infodetails)||void 0===_||null===(h=_.existingDataSet)||void 0===h||null===(T=h.owner)||void 0===T?void 0:T.emailId)||""),[ee,te]=l.useState((null==U||null===(y=U.owner)||void 0===y?void 0:y.alternateNumber)||(null==U||null===(S=U.infodetails)||void 0===S||null===(b=S.existingDataSet)||void 0===b||null===(N=b.owner)||void 0===N?void 0:N.alternateNumber)||""),[le,ne]=l.useState((null==U||null===(I=U.owner)||void 0===I?void 0:I.guardianName)||""),[ie,oe]=l.useState((null==U||null===(D=U.owner)||void 0===D?void 0:D.relationShipType)||""),[ae,re]=l.useState((null==U||null===(C=U.owner)||void 0===C?void 0:C.fixedPoint)||""),[de,ue]=l.useState(null),[se,ce]=l.useState(""),[ve,me]=l.useState("");n.useEffect(()=>{const e=setTimeout(()=>{me(se)},500);return()=>clearTimeout(e)},[se]);const pe=n.useCallback(e=>{ce(e)},[]),[Ee,fe]=l.useState((null==U||null===(A=U.owner)||void 0===A?void 0:A.isExistingFixedPoint)||{code:"YES",name:"Yes",i18nKey:"YES"}),ge=Digit.ULBService.getCurrentTenantId(),{data:_e}=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:ge,filters:{limit:1e3,...ve?{name:ve}:{}}},{enabled:"YES"===(null==Ee?void 0:Ee.code)}),he=(null==_e||null===(x=_e.waterTankerBookingDetail)||void 0===x?void 0:x.map(e=>{var t,l;return{...e,name:(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||(null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.fixedPointId)||"NA"}}))||[],{data:Te}=Digit.Hooks.useEnabledMDMS(Digit.ULBService.getStateId(),"common-masters",[{name:"GenderType"}],{select:e=>{var t;return null==e||null===(t=e["common-masters"])||void 0===t?void 0:t.GenderType}});let ye=[];Te&&Te.map(e=>{"TRANSGENDER"!==e.code&&ye.push({i18nKey:""+e.code,code:""+e.code,name:""+e.code})});const Se=e=>{if(null==e||""===e)return"";if("object"==typeof e){if(void 0!==e.code)return e.code;if(void 0!==e.uuid)return e.uuid;if(void 0!==e.id)return e.id;try{return JSON.stringify(e)}catch(t){return String(e)}}return String(e)},be=n.useRef(null);return n.useEffect(()=>{if(!(ae||G||Z||ee))return;let e="";var t;e="YES"===(null==Ee?void 0:Ee.code)?(null==ae||null===(t=ae.applicantDetail)||void 0===t?void 0:t.name)||(null==ae?void 0:ae.name)||"":"string"==typeof ae?ae:(null==ae?void 0:ae.name)||"";let l={applicantName:e,mobileNumber:G,gender:q,dateOfBirth:X,alternateNumber:ee,relationShipType:ie,guardianName:le,emailId:Z,fixedPoint:ae,isExistingFixedPoint:Ee},n=!1;if(be.current){for(const e of Object.keys(l))if(Se(be.current[e])!==Se(l[e])){n=!0;break}}else n=!0;const i=(null==U?void 0:U.owner)||{};let o=!1;for(const e of Object.keys(l)){const t=Se(l[e]),n=Se(i[e]);if(t!==n){if(!t&&n)continue;o=!0}}(n||o)&&(be.current=l,W(B.key,{...l,silent:!0},!1))},[ae,Ee,G,q,X,ee,ie,le,Z,W,B.key,null==U?void 0:U.owner]),n.createElement(n.Fragment,null,n.createElement(t.FormStep,{config:B,onSelect:()=>{var e,t,l,n;let i={...U.owner||{},applicantName:"YES"===(null==Ee?void 0:Ee.code)?(null==ae||null===(e=ae.applicantDetail)||void 0===e?void 0:e.name)||(null==ae?void 0:ae.name)||"":"string"==typeof ae?ae:(null==ae?void 0:ae.name)||"",mobileNumber:"YES"===(null==Ee?void 0:Ee.code)?(null==ae||null===(t=ae.applicantDetail)||void 0===t?void 0:t.mobileNumber)||G||"":G||"",alternateNumber:"YES"===(null==Ee?void 0:Ee.code)?(null==ae||null===(l=ae.applicantDetail)||void 0===l?void 0:l.alternateNumber)||ee||"":ee||"",emailId:"YES"===(null==Ee?void 0:Ee.code)?(null==ae||null===(n=ae.applicantDetail)||void 0===n?void 0:n.emailId)||Z||"":Z||"",gender:q,dateOfBirth:X,relationShipType:ie,guardianName:le,fixedPoint:ae,isExistingFixedPoint:Ee};de?W("multiple",{owner:i,address:de,navigationKey:B.key}):W(B.key,i,!1)},t:F,isDisabled:!ae||!G||null!=B&&null!==(O=B.additionaFields)&&void 0!==O&&O.guardianName?!le:null!=B&&null!==(w=B.additionaFields)&&void 0!==w&&w.dateofBirth?!X:null!=B&&null!==(L=B.additionaFields)&&void 0!==L&&L.gender?!q:null,className:"search-form-wrapper"},n.createElement(n.Fragment,null,n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("WT_EXISTING_FIXED_POINT","Existing Fixed Point/Delivery Point?")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.RadioButtons,{t:F,options:[{code:"YES",name:"Yes",i18nKey:"YES"},{code:"NO",name:"No",i18nKey:"NO"}],optionsKey:"i18nKey",name:"isExistingFixedPoint",value:Ee,selectedOption:Ee,onSelect:e=>{fe(e),re("")},style:{display:"flex",gap:"30px",marginBottom:"0px"},innerStyles:{minWidth:"24%",marginBottom:"0px"}})),n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("Fixed Point/Delivery Point")),"YES"===(null==Ee?void 0:Ee.code)?n.createElement(t.Dropdown,{className:"form-field",selected:ae,option:he,select:e=>{if(re(e),e&&"object"==typeof e){const t=e.applicantDetail;t&&(K(t.name||z),Y(t.mobileNumber||G),te(t.alternateNumber||ee),J(t.emailId||Z));const l=e.address;if(l){const e={houseNo:l.houseNo||"",streetName:l.streetName||"",addressLine1:l.addressLine1||"",addressLine2:l.addressLine2||"",landmark:l.landmark||"",city:l.city||"",cityCode:l.cityCode||"",locality:l.locality||"",localityCode:l.localityCode||"",pincode:l.pincode?l.pincode.toString().split(".")[0]:""};ue(e),W("multiple",{address:e,silent:!0})}}else ue(null)},optionKey:"name",t:F,name:"fixedPoint",placeholder:F("WT_SELECT_FIXED_POINT","Select Fixed Point"),onSearch:pe}):n.createElement(t.TextInput,{t:F,type:"text",isMandatory:!1,name:"fixedPointText",value:"string"==typeof ae?ae:(null==ae?void 0:ae.name)||"",onChange:e=>re(e.target.value),style:j,placeholder:F("WT_ENTER_FIXED_POINT","Enter Fixed Point")})),null!=B&&null!==(P=B.additionaFields)&&void 0!==P&&P.gender?n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("COMMON_GENDER")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.RadioButtons,{t:F,options:ye,style:{display:"flex",flexWrap:"wrap",maxHeight:"30px"},innerStyles:{minWidth:"24%"},optionsKey:"i18nKey",name:"gender",value:q,selectedOption:q,onSelect:$,labelKey:"i18nKey",isPTFlow:!0})):null,n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("COMMON_MOBILE_NUMBER")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.MobileNumber,{value:G,name:"mobileNumber",onChange:e=>{Y({value:e}.value)},required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:F("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")})),n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("COMMON_ALT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{value:ee,name:"alternateNumber",onChange:e=>{te({value:e}.value)},required:!1,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:F("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")})),null!=B&&null!==(R=B.additionaFields)&&void 0!==R&&R.dateofBirth?n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("COMMON_BIRTH_DATE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextInput,{t:F,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"dateOfBirth",value:X,onChange:function(e){Q(e.target.value)},style:j,max:(new Date).toISOString().split("T")[0],rules:{required:F("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||F("ERR_DEFAULT_INPUT_FIELD_MSG")}})):null,null!=B&&null!==(k=B.additionaFields)&&void 0!==k&&k.guardianName?n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("COMMON_GUARDIAN")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextInput,m({t:F,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"guardianName",style:j,value:le,onChange:function(e){ne(e.target.value)},ValidationRequired:!0},V={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:F("PT_NAME_ERROR_MESSAGE")}))):null,null!=B&&null!==(M=B.additionaFields)&&void 0!==M&&M.guardianName?n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("COMMON_RELATIONTYPE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:ie,option:[{name:"Husband",code:"HUSBAND",i18nKey:"COMMON_HUSBAND"},{name:"Father",code:"FATHER",i18nKey:"COMMON_FATHER"}],select:oe,optionKey:"i18nKey",t:F,name:"relationShipType",placeholder:"Select"})):null,n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("COMMON_EMAIL_ID")),n.createElement(t.TextInput,m({t:F,type:"email",optionKey:"i18nKey",name:"emailId",value:Z,style:j,onChange:function(e){J(e.target.value)},ValidationRequired:!0},V={isRequired:!0,pattern:"^[a-zA-Z0-9._%+-]+@[a-zA-Z]+\\.[a-zA-Z]{3,4}$",type:"email",title:F("PT_NAME_ERROR_MESSAGE")}))))))},EmergencyFixedPointDispatchDetails:e=>{var i,a,r,d,u,s;let{t:c,config:v,onSelect:m,formData:p}=e;const E=Digit.ULBService.getCurrentTenantId(),[f,g]=l.useState((null==p||null===(i=p.dispatchDetails)||void 0===i?void 0:i.fillingPoint)||""),[_,h]=l.useState((null==p||null===(a=p.dispatchDetails)||void 0===a?void 0:a.vendor)||""),[T,y]=l.useState((null==p||null===(r=p.dispatchDetails)||void 0===r?void 0:r.vehicle)||""),[S,b]=l.useState((null==p||null===(d=p.dispatchDetails)||void 0===d?void 0:d.driver)||""),{data:N}=Digit.Hooks.wt.useFillPointSearch({tenantId:E,filters:{limit:1e3}},{enabled:!0}),I=l.useMemo(()=>{var e;return(null==N||null===(e=N.fillingPoints)||void 0===e?void 0:e.map(e=>({...e,name:(null==e?void 0:e.fillingPointName)||"NA"})))||[]},[N]),{data:D}=Digit.Hooks.fsm.useVendorSearch({tenantId:E,filters:{...null!=f&&f.fillingPointId?{fillingPointId:f.id}:{}},config:{enabled:!0}}),C=l.useMemo(()=>{var e;return(null==D||null===(e=D.vendor)||void 0===e?void 0:e.map(e=>({...e,name:(null==e?void 0:e.name)||(null==e?void 0:e.vendor_id)||"NA"})))||[]},[D]),A=l.useMemo(()=>{var e;return _&&"object"==typeof _&&(null===(e=_.vehicles)||void 0===e?void 0:e.map(e=>({...e,name:(null==e?void 0:e.registrationNumber)||(null==e?void 0:e.type)||"NA"})))||[]},[_]),x=l.useMemo(()=>({registrationNumber:null==T?void 0:T.registrationNumber}),[null==T?void 0:T.registrationNumber]),{data:O}=Digit.Hooks.fsm.useVehiclesSearch({tenantId:E,filters:x,config:{enabled:!(null==T||!T.registrationNumber)}});l.useEffect(()=>{var e,t;const l=null==O||null===(e=O.vehicle)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.driverData;if(l){const e={...l,name:(null==l?void 0:l.name)||(null==l?void 0:l.licenseNumber)||"NA"};(null==S?void 0:S.id)!==e.id&&b(e)}else O&&""!==S&&b("")},[O,S]);const w=n.useRef(null);return n.useEffect(()=>{const e={fillingPoint:f,vendor:_,vehicle:T,driver:S};let t=!0;try{t=JSON.stringify(w.current)!==JSON.stringify(e)}catch(l){t=Object.keys(e).some(t=>{var l;return(null===(l=w.current)||void 0===l?void 0:l[t])!==e[t]})}t&&(w.current=e,m(v.key,{...e,silent:!0},!1))},[f,_,T,S,m,v.key]),n.createElement(n.Fragment,null,n.createElement(t.FormStep,{config:v,onSelect:()=>{m(v.key,{fillingPoint:f,vendor:_,vehicle:T,driver:S},!1)},t:c,isDisabled:!(f&&_&&T&&S),className:"search-form-wrapper"},n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+c("WT_FILLING_POINT","Filling Point")),n.createElement(t.Dropdown,{className:"form-field",selected:f,option:I,select:g,optionKey:"name",t:c,name:"fillingPoint",placeholder:c("WT_SELECT_FILLING_POINT","Select Filling Point")})),n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+c("WT_VENDOR","Vendor")),n.createElement(t.Dropdown,{className:"form-field",selected:_,option:C,select:e=>{h(e),y(""),b("")},optionKey:"name",t:c,name:"vendor",placeholder:c("WT_SELECT_VENDOR","Select Vendor")})),n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+c("WT_VEHICLE","Vehicle")),n.createElement(t.Dropdown,{className:"form-field",selected:T,option:A,select:y,optionKey:"name",t:c,name:"vehicle",placeholder:c("WT_SELECT_VEHICLE","Select Vehicle")})),n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+c("WT_DRIVER","Driver")),n.createElement(t.TextInput,{className:"form-field",value:(null==S?void 0:S.name)||S||"",disabled:!0,t:c,name:"driver"}),(null==T?void 0:T.registrationNumber)&&O&&!(null!=O&&null!==(u=O.vehicle)&&void 0!==u&&null!==(s=u[0])&&void 0!==s&&s.driverData)&&n.createElement("div",{style:{marginTop:"10px",color:"red",fontSize:"14px"}},c("WT_DRIVER_NOT_MAPPED","Please map the driver with the selected vehicle to proceed further - "),n.createElement(o.Link,{to:"/digit-ui/employee/vendor/search-vendor",style:{color:"#a82227",textDecoration:"underline",fontWeight:"bold"}},c("WT_CLICK_HERE","click here"))))))}};exports.WTComponents={WTCard:j,WTModule:Ro,MTCard:()=>{const{t:e}=i.useTranslation(),[o,a]=l.useState("-"),{data:r,isLoading:d,isFetching:u,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"MT",filters:{limit:10,offset:0,services:["mobileToilet"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.mtAccess()}});if(l.useEffect(()=>{!u&&s&&a(r)},[u]),!Digit.Utils.mtAccess())return null;const c=[{count:d?"-":null==o?void 0:o.totalCount,label:e("ES_COMMON_INBOX"),link:"/digit-ui/employee/wt/mt/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/wt/mt/my-bookings"},{label:e("MT_APPLICATION_CREATE"),link:"/digit-ui/employee/wt/mt/request-service"}],v=Digit.UserService.hasAccess(["MT_CEMP"])||!1,m={Icon:n.createElement(t.CHBIcon,null),moduleName:e("ACTION_TEST_MT"),kpis:[{count:null==o?void 0:o.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/mt/inbox"}],links:c.filter(e=>!(null!=e&&e.role)||v)};return n.createElement(t.EmployeeModuleCard,m)},TPCard:()=>{const{t:e}=i.useTranslation(),[o,a]=l.useState("-"),{data:r,isLoading:d,isFetching:u,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"TP",filters:{limit:10,offset:0,services:["treePruning"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.tpAccess()}});l.useEffect(()=>{!u&&s&&a(r)},[u]);const c=[{count:d?"-":null==o?void 0:o.totalCount,label:e("ES_COMMON_INBOX"),link:"/digit-ui/employee/wt/tp/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/wt/tp/my-bookings"},{label:e("TP_APPLICATION_CREATE"),link:"/digit-ui/employee/wt/tp/request-service"}],v=Digit.UserService.hasAccess(["TP_CEMP"])||!1,m={Icon:n.createElement(t.CHBIcon,null),moduleName:e("ACTION_TEST_TP"),kpis:[{count:null==o?void 0:o.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/wt/tp/inbox"}],links:c.filter(e=>!(null!=e&&e.role)||v)};return n.createElement(t.EmployeeModuleCard,m)},WTLinks:ko,WT_INBOX_FILTER:e=>n.createElement(Zt,e),WTInboxTableConfig:e=>({WT:{inboxColumns:t=>[{Header:e("WT_BOOKING_NO"),id:"bookingNo",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""},Cell:e=>{var l,i,a,r;let{row:d}=e;return n.createElement("div",null,n.createElement("span",{className:"link"},n.createElement(o.Link,{to:`${t.detailRoute||t.parentRoute+"/booking-details"}/${null==d||null===(l=d.original)||void 0===l||null===(i=l.searchData)||void 0===i?void 0:i.bookingNo}`},null===(a=d.original)||void 0===a||null===(r=a.searchData)||void 0===r?void 0:r.bookingNo)))},mobileCell:e=>{var t;return Yt(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:window.location.href.includes("fixed-point")?e("WT_FIXED_POINT_NAME"):e("WT_APPLICANT_NAME"),id:"applicantName",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""},Cell:e=>{var t,l,n,i,o;return zt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,l;return Yt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:e("WT_MOBILE_NUMBER"),id:"mobileNumber",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""},Cell:e=>{var t,l,n,i,o;return zt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,l;return Yt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:e("LOCALITY"),id:"localityCode",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.localityCode)||""},Cell:t=>{var l,n,i,o;let{row:a}=t;return zt(qt(null===(l=a.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.localityCode,null===(i=a.original)||void 0===i||null===(o=i.searchData)||void 0===o?void 0:o.tenantId,e))},mobileCell:t=>{var l,n;return Yt(qt(null==t||null===(l=t.searchData)||void 0===l?void 0:l.localityCode,null==t||null===(n=t.searchData)||void 0===n?void 0:n.tenantId,e))}},{Header:e("Filling Point"),id:"fillingPoint",accessor:e=>{var t,l,n;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.fillingPointMetadata)||void 0===l?void 0:l.name)||(null==e||null===(n=e.searchData)||void 0===n?void 0:n.fillingPointName)||"-"},Cell:e=>{var t,l,n,i,o;let{row:a}=e;const r=(null===(t=a.original)||void 0===t||null===(l=t.searchData)||void 0===l||null===(n=l.fillingPointMetadata)||void 0===n?void 0:n.name)||(null===(i=a.original)||void 0===i||null===(o=i.searchData)||void 0===o?void 0:o.fillingPointName)||"-";return zt(r)},mobileCell:e=>{var t,l,n;return Yt((null==e||null===(t=e.searchData)||void 0===t||null===(l=t.fillingPointMetadata)||void 0===l?void 0:l.name)||(null==e||null===(n=e.searchData)||void 0===n?void 0:n.fillingPointName)||"-")}},{Header:e("CREATED_AT"),id:"createdTime",accessor:e=>Kt(e),Cell:e=>{let{row:t}=e;return zt(Kt(null==t?void 0:t.original))},mobileCell:e=>Yt(Kt(e))},{Header:e("WT_STATUS"),id:"applicationStatus",accessor:e=>{var t,l;return(null==e||null===(t=e.workflowData)||void 0===t||null===(l=t.state)||void 0===l?void 0:l.applicationStatus)||""},Cell:t=>{var l,n,i;let{row:o}=t;return zt(e(""+(null==o||null===(l=o.original)||void 0===l||null===(n=l.workflowData)||void 0===n||null===(i=n.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var l,n;return Yt(e("ES_WT_COMMON_STATUS_"+(null==t||null===(l=t.workflowData)||void 0===l||null===(n=l.state)||void 0===n?void 0:n.applicationStatus)))}},...window.location.href.includes("fixed-point")?[{Header:e("WT_DELIVERY_DATE_TIME"),id:"deliveryDateTime",accessor:e=>Gt(e),Cell:e=>{let{row:t}=e;return zt(Gt(null==t?void 0:t.original))},mobileCell:e=>Yt(Gt(e))},{Header:e("WT_VENDOR_NAME"),id:"vendorName",accessor:e=>$t(null==e?void 0:e.searchData),Cell:e=>{var t;let{row:l}=e;return zt($t(null==l||null===(t=l.original)||void 0===t?void 0:t.searchData))},mobileCell:e=>Yt($t(null==e?void 0:e.searchData))},{Header:e("WT_VEHICLE_NO"),id:"vehicleNumber",accessor:e=>Xt(null==e?void 0:e.searchData),Cell:e=>{var t;let{row:l}=e;return zt(Xt(null==l||null===(t=l.original)||void 0===t?void 0:t.searchData))},mobileCell:e=>Yt(Xt(null==e?void 0:e.searchData))},{Header:e("WT_DRIVER_NAME"),id:"driverName",accessor:e=>Qt(null==e?void 0:e.searchData),Cell:e=>{var t;let{row:l}=e;return zt(Qt(null==l||null===(t=l.original)||void 0===t?void 0:t.searchData))},mobileCell:e=>Yt(Qt(null==e?void 0:e.searchData))}]:[]],serviceRequestIdKey:t=>{var l,n;return null==t||null===(l=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===l||null===(n=l.props)||void 0===n?void 0:n.children}},MT:{inboxColumns:t=>[{Header:e("MT_BOOKING_NO"),id:"bookingNo",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""},Cell:e=>{var l,i,a,r;let{row:d}=e;return n.createElement("div",null,n.createElement("span",{className:"link"},n.createElement(o.Link,{to:t.parentRoute+"/booking-details/"+(null==d||null===(l=d.original)||void 0===l||null===(i=l.searchData)||void 0===i?void 0:i.bookingNo)},null===(a=d.original)||void 0===a||null===(r=a.searchData)||void 0===r?void 0:r.bookingNo)))},mobileCell:e=>{var t;return Yt(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("MT_APPLICANT_NAME"),id:"applicantName",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""},Cell:e=>{var t,l,n,i,o;return zt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,l;return Yt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:e("MT_MOBILE_NUMBER"),id:"mobileNumber",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""},Cell:e=>{var t,l,n,i,o;return zt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,l;return Yt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:e("LOCALITY"),id:"localityCode",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.localityCode)||""},Cell:t=>{var l,n,i,o;let{row:a}=t;return zt(qt(null===(l=a.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.localityCode,null===(i=a.original)||void 0===i||null===(o=i.searchData)||void 0===o?void 0:o.tenantId,e))},mobileCell:t=>{var l,n;return Yt(qt(null==t||null===(l=t.searchData)||void 0===l?void 0:l.localityCode,null==t||null===(n=t.searchData)||void 0===n?void 0:n.tenantId,e))}},{Header:e("MT_STATUS"),id:"applicationStatus",accessor:e=>{var t,l;return(null==e||null===(t=e.workflowData)||void 0===t||null===(l=t.state)||void 0===l?void 0:l.applicationStatus)||""},Cell:t=>{var l,n,i;let{row:o}=t;return zt(e(""+(null==o||null===(l=o.original)||void 0===l||null===(n=l.workflowData)||void 0===n||null===(i=n.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var l,n;return Yt(e("ES_WT_COMMON_STATUS_"+(null==t||null===(l=t.workflowData)||void 0===l||null===(n=l.state)||void 0===n?void 0:n.applicationStatus)))}}],serviceRequestIdKey:t=>{var l,n;return null==t||null===(l=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===l||null===(n=l.props)||void 0===n?void 0:n.children}},TP:{inboxColumns:t=>[{Header:e("MT_BOOKING_NO"),id:"bookingNo",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""},Cell:e=>{var l,i,a,r;let{row:d}=e;return n.createElement("div",null,n.createElement("span",{className:"link"},n.createElement(o.Link,{to:t.parentRoute+"/booking-details/"+(null==d||null===(l=d.original)||void 0===l||null===(i=l.searchData)||void 0===i?void 0:i.bookingNo)},null===(a=d.original)||void 0===a||null===(r=a.searchData)||void 0===r?void 0:r.bookingNo)))},mobileCell:e=>{var t;return Yt(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("MT_APPLICANT_NAME"),id:"applicantName",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""},Cell:e=>{var t,l,n,i,o;return zt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,l;return Yt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:e("MT_MOBILE_NUMBER"),id:"mobileNumber",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""},Cell:e=>{var t,l,n,i,o;return zt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,l;return Yt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:e("LOCALITY"),id:"localityCode",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.localityCode)||""},Cell:t=>{var l,n,i,o;let{row:a}=t;return zt(qt(null===(l=a.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.localityCode,null===(i=a.original)||void 0===i||null===(o=i.searchData)||void 0===o?void 0:o.tenantId,e))},mobileCell:t=>{var l,n;return Yt(qt(null==t||null===(l=t.searchData)||void 0===l?void 0:l.localityCode,null==t||null===(n=t.searchData)||void 0===n?void 0:n.tenantId,e))}},{Header:e("MT_STATUS"),id:"applicationStatus",accessor:e=>{var t,l;return(null==e||null===(t=e.workflowData)||void 0===t||null===(l=t.state)||void 0===l?void 0:l.applicationStatus)||""},Cell:t=>{var l,n,i;let{row:o}=t;return zt(e(""+(null==o||null===(l=o.original)||void 0===l||null===(n=l.workflowData)||void 0===n||null===(i=n.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var l,n;return Yt(e("ES_WT_COMMON_STATUS_"+(null==t||null===(l=t.workflowData)||void 0===l||null===(n=l.state)||void 0===n?void 0:n.applicationStatus)))}}],serviceRequestIdKey:t=>{var l,n;return null==t||null===(l=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===l||null===(n=l.props)||void 0===n?void 0:n.children}}})},exports.WTLinks=ko,exports.WTModule=Ro,exports.initWTComponents=()=>{Object.entries(Mo).forEach(e=>{let[t,l]=e;Digit.ComponentRegistryService.setComponent(t,l)})};
1
+ function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@djb25/digit-ui-react-components"),l=require("react"),n=e(l),i=require("react-i18next"),o=require("react-router-dom"),a=require("react-query"),r=require("react-hook-form"),d=require("socket.io-client"),u=require("react-leaflet"),s=e(require("leaflet"));function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(null,arguments)}function v(e,t){if(null==e)return{};var l={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;l[n]=e[n]}return l}require("leaflet/dist/leaflet.css");const m=[{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"service-type",component:"ServiceTypes",withoutLabel:!0,key:"serviceType",type:"component",nextStep:"info",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT"}},{route:"info",component:"InfoPage",nextStep:"applicant-details",key:"infodetails"},{route:"applicant-details",component:"ApplicantDetails",withoutLabel:!0,key:"owner",type:"component",nextStep:"address-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"ES_APPLICANT_DETAILS"},timeLine:[{currentStep:1,actions:"ES_APPLICANT_DETAILS"}]}]},{head:"ES_TITLE_ADDRESS_DETAILS",body:[{route:"address-details",component:"AddressDetails",withoutLabel:!0,key:"address",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"request-details",texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"ES_ADDRESS_DETAILS"},timeLine:[{currentStep:2,actions:"ES_ADDRESS_DETAILS"}]}]},{head:"ES_REQUEST_DETAILS",body:[{route:"request-details",component:"RequestDetails",withoutLabel:!0,key:"requestDetails",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:null,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"WT_REQUEST_DETAILS"},timeLine:[{currentStep:3,actions:"ES_REQUEST_DETAILS"}]}]},{head:"ES_TOILET_REQUEST_DETAILS",body:[{route:"toiletRequest-details",component:"ToiletRequestDetails",withoutLabel:!0,key:"toiletRequestDetails",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:null,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"MT_REQUEST_DETAILS"},timeLine:[{currentStep:3,actions:"ES_TOILET_REQUEST_DETAILS"}]}]},{head:"ES_TREE_PRUNING_REQUEST_DETAILS",body:[{route:"treePruningRequest-details",component:"TreePruningRequestDetails",withoutLabel:!0,key:"treePruningRequestDetails",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:null,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"TP_REQUEST_DETAILS"},timeLine:[{currentStep:3,actions:"ES_TREE_PRUNING_REQUEST_DETAILS"}]}]}],p=["config","onSelect","showFinalStep"],E=e=>{let l=e.config,a=e.showFinalStep;v(e,p);const r=i.useTranslation().t,d=o.useLocation().pathname.split("/").pop();if("info"===d)return null;const u=l.filter(e=>e.timeLine&&e.timeLine.length>0).reduce((e,t)=>{const l=t.timeLine[0],n=e.findIndex(e=>e.key===l.currentStep);return-1===n?e.push({key:l.currentStep,label:l.actions,routes:[t.route],stepNumber:l.currentStep}):e[n].routes.push(t.route),e},[]).sort((e,t)=>e.stepNumber-t.stepNumber);a&&u.push({key:"final-submit",label:"Review & Submit",routes:["check","wt-acknowledgement","mt-acknowledgement","tp-acknowledgement","fp-check","fp-wt-acknowledgement"],stepNumber:u.length+1});const s=u.findIndex(e=>e.routes.includes(d)),c=-1!==s?s:0;return n.createElement(n.Fragment,null,n.createElement("div",{className:"vertical-timeline-container"},n.createElement("div",{className:"vertical-timeline-wrapper"},u.map((e,l)=>{const i=l<c;return n.createElement("div",{key:l,className:"vertical-timeline-step "+(i?"completed":"")+" "+(l===c?"activeTimeline active":""),onClick:()=>{}},n.createElement("div",{className:"vertical-timeline-connector "+(l<c?"completed":"")}),n.createElement("div",{className:"vertical-timeline-pill"},i?n.createElement(t.TickMark,null):e.stepNumber),n.createElement("div",{className:"vertical-timeline-content"},n.createElement("div",{className:"vertical-timeline-label"},r(e.label))))}))))},f=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||void 0===e||""===e)}(e)?e:"NA"},g=e=>{if(!e)return"NA";const t=e.split(":").map(Number),l=t[0],n=l>=12?"PM":"AM";return(l%12||12)+":"+t[1].toString().padStart(2,"0")+" "+n},h=e=>{if(!e)return"NA";const t=e.split("-");return t[2]+"-"+t[1]+"-"+t[0]},y=e=>{var t,l,n,i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,h,y,T,S,b,N,I,D,C,A,x,O;return{mobileToiletBookingDetail:{tenantId:null==e?void 0:e.tenantId,description:null==e||null===(t=e.toiletRequestDetails)||void 0===t?void 0:t.specialRequest,noOfMobileToilet:null==e||null===(l=e.toiletRequestDetails)||void 0===l||null===(n=l.mobileToilet)||void 0===n?void 0:n.code,deliveryFromDate:null==e||null===(i=e.toiletRequestDetails)||void 0===i?void 0:i.deliveryfromDate,deliveryToDate:null==e||null===(o=e.toiletRequestDetails)||void 0===o?void 0:o.deliverytoDate,deliveryFromTime:null==e||null===(a=e.toiletRequestDetails)||void 0===a?void 0:a.deliveryfromTime,deliveryToTime:null==e||null===(r=e.toiletRequestDetails)||void 0===r?void 0:r.deliverytoTime,addressDetailId:(null==e||null===(d=e.address)||void 0===d?void 0:d.addressDetailId)||"",applicantDetail:{name:null==e||null===(u=e.owner)||void 0===u?void 0:u.applicantName,mobileNumber:null==e||null===(s=e.owner)||void 0===s?void 0:s.mobileNumber,alternateNumber:null==e||null===(c=e.owner)||void 0===c?void 0:c.alternateNumber,emailId:null==e||null===(v=e.owner)||void 0===v?void 0:v.emailId},address:{addressType:null==e||null===(m=e.address)||void 0===m||null===(p=m.addressType)||void 0===p?void 0:p.code,pincode:null==e||null===(E=e.address)||void 0===E?void 0:E.pincode,city:(null==e||null===(f=e.address)||void 0===f||null===(g=f.city)||void 0===g||null===(_=g.city)||void 0===_?void 0:_.name)||"DJB",cityCode:(null==e||null===(h=e.address)||void 0===h||null===(y=h.city)||void 0===y||null===(T=y.city)||void 0===T?void 0:T.code)||"DJB",addressLine1:null==e||null===(S=e.address)||void 0===S?void 0:S.addressLine1,addressLine2:null==e||null===(b=e.address)||void 0===b?void 0:b.addressLine2,locality:null==e||null===(N=e.address)||void 0===N||null===(I=N.locality)||void 0===I?void 0:I.i18nKey,localityCode:null==e||null===(D=e.address)||void 0===D||null===(C=D.locality)||void 0===C?void 0:C.code,streetName:null==e||null===(A=e.address)||void 0===A?void 0:A.streetName,houseNo:null==e||null===(x=e.address)||void 0===x?void 0:x.houseNo,landmark:null==e||null===(O=e.address)||void 0===O?void 0:O.landmark},bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"mobileToilet",moduleName:"request-service.mobile_toilet"}}}},T=e=>{var t,l,n,i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,h,y,T,S,b,N,I,D,C;return{treePruningBookingDetail:{tenantId:null==e?void 0:e.tenantId,latitude:null==e||null===(t=e.treePruningRequestDetails)||void 0===t?void 0:t.latitude,longitude:null==e||null===(l=e.treePruningRequestDetails)||void 0===l?void 0:l.longitude,reasonForPruning:null==e||null===(n=e.treePruningRequestDetails)||void 0===n||null===(i=n.reasonOfPruning)||void 0===i?void 0:i.code,applicantDetail:{name:null==e||null===(o=e.owner)||void 0===o?void 0:o.applicantName,mobileNumber:null==e||null===(a=e.owner)||void 0===a?void 0:a.mobileNumber,alternateNumber:null==e||null===(r=e.owner)||void 0===r?void 0:r.alternateNumber,emailId:null==e||null===(d=e.owner)||void 0===d?void 0:d.emailId},documentDetails:[{documentType:"Site Photograph",fileStoreId:null==e||null===(u=e.treePruningRequestDetails)||void 0===u?void 0:u.supportingDocumentFile}],address:{addressType:null==e||null===(s=e.address)||void 0===s||null===(c=s.addressType)||void 0===c?void 0:c.code,pincode:null==e||null===(v=e.address)||void 0===v?void 0:v.pincode,city:(null==e||null===(m=e.address)||void 0===m||null===(p=m.city)||void 0===p||null===(E=p.city)||void 0===E?void 0:E.name)||"DJB",cityCode:(null==e||null===(f=e.address)||void 0===f||null===(g=f.city)||void 0===g||null===(_=g.city)||void 0===_?void 0:_.code)||"DJB",addressLine1:null==e||null===(h=e.address)||void 0===h?void 0:h.addressLine1,addressLine2:null==e||null===(y=e.address)||void 0===y?void 0:y.addressLine2,locality:null==e||null===(T=e.address)||void 0===T||null===(S=T.locality)||void 0===S?void 0:S.i18nKey,localityCode:null==e||null===(b=e.address)||void 0===b||null===(N=b.locality)||void 0===N?void 0:N.code,streetName:null==e||null===(I=e.address)||void 0===I?void 0:I.streetName,houseNo:null==e||null===(D=e.address)||void 0===D?void 0:D.houseNo,landmark:null==e||null===(C=e.address)||void 0===C?void 0:C.landmark},bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"treePruning",moduleName:"request-service.tree_pruning"}}}},S=function(){function e(){}return e.prototype.then=function(t,l){const n=new e,i=this.s;if(i){const e=1&i?t:l;if(e){try{b(n,1,e(this.v))}catch(e){b(n,2,e)}return n}return this}return this.o=function(e){try{const i=e.v;1&e.s?b(n,1,t?t(i):i):l?b(n,1,l(i)):b(n,2,i)}catch(e){b(n,2,e)}},n},e}();function b(e,t,l){if(!e.s){if(l instanceof S){if(!l.s)return void(l.o=b.bind(null,e,t));1&t&&(t=l.s),l=l.v}if(l&&l.then)return void l.then(b.bind(null,e,t),b.bind(null,e,2));e.s=t,e.v=l;const n=e.o;n&&n(e)}}function N(e){return e instanceof S&&1&e.s}function I(e,t,l){for(var n;;){var i=e();if(N(i)&&(i=i.v),!i)return o;if(i.then){n=0;break}var o=l();if(o&&o.then){if(!N(o)){n=1;break}o=o.s}if(t){var a=t();if(a&&a.then&&!N(a)){n=2;break}}}var r=new S,d=b.bind(null,r,2);return(0===n?i.then(s):1===n?o.then(u):a.then(c)).then(void 0,d),r;function u(n){o=n;do{if(t&&(a=t())&&a.then&&!N(a))return void a.then(c).then(void 0,d);if(!(i=e())||N(i)&&!i.v)return void b(r,1,o);if(i.then)return void i.then(s).then(void 0,d);N(o=l())&&(o=o.v)}while(!o||!o.then);o.then(u).then(void 0,d)}function s(e){e?(o=l())&&o.then?o.then(u).then(void 0,d):u(o):b(r,1,o)}function c(){(i=e())?i.then?i.then(s).then(void 0,d):s(i):b(r,1,o)}}function D(e,t){try{var l=e()}catch(e){return t(e)}return l&&l.then?l.then(void 0,t):l}function C(e,t){try{var l=e()}catch(e){return t(!0,e)}return l&&l.then?l.then(t.bind(null,!1),t.bind(null,!0)):t(!1,l)}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const A=e=>{let i=e.number,o=e.title,a=e.children,r=e.defaultOpen,d=e.tabs,u=void 0===d?null:d,s=e.defaultTab,c=void 0===s?"":s,v=e.onTabChange,m=void 0===v?()=>{}:v;const p=l.useState(void 0!==r&&r),E=p[0],f=p[1],g=l.useState(c||u&&u[0]||""),_=g[0],h=g[1];return n.createElement("div",{className:"collapsible-card"},n.createElement("div",{className:"collapsible-card-header",onClick:()=>f(!E)},n.createElement("h3",{className:"collapsible-card-title"},i?i+". ":"",o),n.createElement("span",{className:"collapsible-card-arrow "+(E?"rotate":"")},n.createElement(t.ArrowDown,null))),E&&n.createElement("div",{className:"collapsible-card-body"},u&&n.createElement("div",{className:"collapsible-card-tabs"},u.map((e,t)=>n.createElement("button",{key:t,onClick:()=>(e=>{h(e),m(e)})(e),className:"collapsible-card-tab-button "+(_===e?"active":"")},e))),n.createElement("div",{className:"collapsible-card-tab-content"},u?n.createElement("div",{key:_},a(_)):n.createElement("div",null,a))))},x=e=>{let i=e.tenantId,a=e.isLoading,d=e.t,u=e.onSubmit,s=e.data,v=e.count,m=e.setShowToast,p=e.moduleCode,E=e.isFixedPoint;console.log("WTSearchApplication Rendered",{moduleCode:p,isFixedPoint:E});const f=window.Digit.Utils.browser.isMobile(),g=Digit.UserService.getUser().info,_=l.useState(!1),h=_[0],y=_[1],T=l.useState(null),S=T[0],b=T[1],N=l.useState(!1),I=N[0],x=N[1],O=l.useCallback(function(e){try{return e?(x(!0),y(!0),Promise.resolve(C(function(){return D(function(){return Promise.resolve(Digit.UploadServices.FileFetchbyid(e,i)).then(function(e){if(200!==(null==e?void 0:e.status)||null==e||!e.data)throw new Error("Failed to fetch image");{var t;const l=new Blob([e.data],{type:(null===(t=e.headers)||void 0===t?void 0:t["content-type"])||"image/jpeg"}),n=URL.createObjectURL(l);b(n)}})},function(e){console.error(e)})},function(e,t){if(x(!1),e)throw t;return t}))):Promise.resolve()}catch(e){return Promise.reject(e)}},[i]),w={offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",bookingNo:"",mobileNumber:"",applicantName:"",status:"",fromDate:"",toDate:""},L=r.useForm({defaultValues:w}),P=L.register,R=L.control,k=L.handleSubmit,M=L.setValue,F=L.getValues,B=L.reset,W=L.formState,U=(0,L.watch)("fromDate"),H=Digit.Hooks.wt.useFillPointSearch({tenantId:Digit.ULBService.getCurrentTenantId(),filters:{limit:1e3}},{enabled:!!E}).data,j=(null==H?void 0:H.fillingPoints)||[],V=Digit.Hooks.wt.useDriverTripReportSearch({tenantId:i,filters:{bookingNo:Array.isArray(s)?s.map(e=>e.bookingNo).join(","):null}},{enabled:!!s&&Array.isArray(s)&&s.length>0&&"WT"===p}).data,z=l.useMemo(()=>s&&Array.isArray(s)&&"WT"===p&&null!=V&&V.driverTripReports?s.map(e=>{const t=V.driverTripReports.find(t=>t.bookingNo===e.bookingNo);return c({},e,t)}):s,[s,V,p]),K=e=>n.createElement("span",{className:"cell-text"},e),G=l.useMemo(()=>[{Header:d("S.No"),accessor:(e,t)=>t+1},{Header:d("WT_BOOKING_NO"),accessor:"bookingNo",disableSortBy:!0,Cell:e=>{const t=e.row.original.bookingNo;return n.createElement("div",null,n.createElement("span",{className:"link"},n.createElement(o.Link,{to:"/digit-ui/"+("EMPLOYEE"===g.type?"employee":"citizen")+"/wt/bookingsearch/booking-details/"+t},t)))}},{Header:d("WT_APPLICANT_NAME"),disableSortBy:!0,Cell:e=>{var t,l;return K(null===(t=e.row.original)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:d("WT_MOBILE_NUMBER"),disableSortBy:!0,Cell:e=>{var t,l;return K(null===(t=e.row.original)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:d("PT_COMMON_TABLE_COL_STATUS_LABEL"),disableSortBy:!0,Cell:e=>K(d(e.row.original.bookingStatus))},{Header:d("WT_VEHICLE_NO"),accessor:"vehicleRegistrationNo"},{Header:d("WT_DRIVER_NAME"),accessor:"driverName"},{Header:d("WT_TANK_CAPACITY"),accessor:"tankCapicity"},{Header:d("WT_STATUS"),accessor:"currentStatus"},{Header:d("WT_START_PHOTO"),Cell:e=>{let l=e.row;return l.original.startFileStoreId?n.createElement("div",{style:{color:"#f47738",cursor:"pointer",display:"inline-block"},onClick:()=>O(l.original.startFileStoreId)},n.createElement(t.ViewsIcon,null)):d("CS_NA")}},{Header:d("WT_END_PHOTO"),Cell:e=>{let l=e.row;return l.original.endFileStoreId?n.createElement("div",{style:{color:"#f47738",cursor:"pointer",display:"inline-block"},onClick:()=>O(l.original.endFileStoreId)},n.createElement(t.ViewsIcon,null)):d("CS_NA")}}],[d,g.type]),q="TP"===p?[{i18nKey:"TP_BOOKING_CREATED",code:"BOOKING_CREATED",value:d("TP_BOOKING_CREATED")},{i18nKey:"TP_PENDING_FOR_APPROVAL",code:"PENDING_FOR_APPROVAL",value:d("TP_PENDING_FOR_APPROVAL")},{i18nKey:"TP_PAYMENT_PENDING",code:"PAYMENT_PENDING",value:d("TP_PAYMENT_PENDING")},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_VERIFICATION",code:"TEAM_ASSIGNMENT_FOR_VERIFICATION",value:d("TP_TEAM_ASSIGNMENT_FOR_VERIFICATION")},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_EXECUTION",code:"TEAM_ASSIGNMENT_FOR_EXECUTION",value:d("TP_TEAM_ASSIGNMENT_FOR_EXECUTION")},{i18nKey:"TP_TREE_PRUNING_SERVICE_COMPLETED",code:"TREE_PRUNING_SERVICE_COMPLETED",value:d("TP_TREE_PRUNING_SERVICE_COMPLETED")}]:[{i18nKey:"WT_BOOKING_CREATED",code:"BOOKING_CREATED",value:d("WT_BOOKING_CREATED")},{i18nKey:"WT_VENDOR_ASSIGNED",code:"VENDOR_ASSIGNED",value:d("WT_VENDOR_ASSIGNED")},{i18nKey:"WT_DELIVERY_PENDING",code:"DELIVERY_PENDING",value:d("WT_DELIVERY_PENDING")},{i18nKey:"WT_DELIVERED",code:"DELIVERED",value:d("WT_DELIVERED")},{i18nKey:"WT_REQUEST_REJECTED",code:"REQUEST_REJECTED",value:d("WT_REQUEST_REJECTED")}],Y=l.useCallback(e=>{0!==e.length&&(M("sortBy",e.id),M("sortOrder",e.desc?"DESC":"ASC"))},[M]),X=()=>{B(w),m(null),k(u)()};return n.createElement(n.Fragment,null,n.createElement("div",{className:"CITIZEN"===(null==g?void 0:g.type)?"citizen-wrapper":"employee-wrapper"},n.createElement(A,{title:d("WT_SEARCH_FILTERS_LABEL")||"Search Filters",defaultOpen:!0,tabs:[d("WT_SMART_SEARCH"),d("WT_ADVANCED_SEARCH")],defaultTab:d("WT_SMART_SEARCH")},e=>{var l,i,o,a;return n.createElement("form",{onSubmit:k(u)},e===d("WT_SMART_SEARCH")&&n.createElement("div",{className:"formcomposer-section-grid"},n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_BOOKING_NO")),n.createElement(t.TextInput,{name:"bookingNo",inputRef:P({})})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:P({minLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:d("CORE_COMMON_MOBILE_ERROR")}}),type:"number",maxlength:10}),n.createElement(t.CardLabelError,null,null==W||null===(l=W.errors)||void 0===l||null===(i=l.mobileNumber)||void 0===i?void 0:i.message))),e===d("WT_ADVANCED_SEARCH")&&n.createElement("div",{className:"formcomposer-section-grid"},n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_BOOKING_NO")),n.createElement(t.TextInput,{name:"bookingNo",inputRef:P({})})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_APPLICANT_NAME")),n.createElement(t.TextInput,{name:"applicantName",inputRef:P({})})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:P({minLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:d("CORE_COMMON_MOBILE_ERROR")}}),type:"number",maxlength:10}),n.createElement(t.CardLabelError,null,null==W||null===(o=W.errors)||void 0===o||null===(a=o.mobileNumber)||void 0===a?void 0:a.message)),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("PT_COMMON_TABLE_COL_STATUS_LABEL")),n.createElement(r.Controller,{control:R,name:"status",render:e=>n.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:q,optionKey:"i18nKey",t:d})})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("FROM_DATE")),n.createElement(r.Controller,{render:e=>n.createElement(t.DatePicker,{date:e.value,onChange:e.onChange,max:(new Date).toISOString().split("T")[0]}),name:"fromDate",control:R})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("TO_DATE")),n.createElement(r.Controller,{render:e=>n.createElement(t.DatePicker,{date:e.value,onChange:e.onChange,min:U}),name:"toDate",control:R})),E&&n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_FILLING_POINT")),n.createElement(r.Controller,{control:R,name:"fillingPointId",render:e=>n.createElement(t.Dropdown,{selected:j.find(t=>(t.id||t.fillingPointId||t.bookingId)===e.value),select:t=>e.onChange((null==t?void 0:t.id)||(null==t?void 0:t.fillingPointId)||(null==t?void 0:t.bookingId)),onBlur:e.onBlur,option:j,optionKey:"fillingPointName",t:d})}))),n.createElement("div",{className:"wt-search-actions",style:{display:"flex",justifyContent:f?"center":"flex-end",flexDirection:f?"column-reverse":"row",gap:"24px",marginTop:"16px"}},n.createElement("span",{className:"generic-button clear-search",onClick:X,style:{cursor:"pointer",alignSelf:"center"}},d("ES_COMMON_CLEAR_ALL")),n.createElement("div",{style:{minWidth:f?"100%":"160px"}},n.createElement(t.SubmitBar,{label:d("ES_COMMON_SEARCH"),submit:!0}))))}),!a&&null!=s&&s.display?n.createElement(t.Card,{style:{marginTop:20}},d(s.display).split("\\n").map((e,t)=>n.createElement("p",{key:t,style:{textAlign:"center"}},e))):a||""===s?(""!==s||a)&&n.createElement(t.Loader,null):n.createElement(t.Table,{t:d,data:z,totalRecords:v,columns:G,getCellProps:e=>({style:{minWidth:e.column.Header===d("WT_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:e=>{M("limit",Number(e.target.value)),k(u)()},currentPage:F("offset")/F("limit"),onNextPage:()=>{M("offset",F("offset")+F("limit")),k(u)()},onPrevPage:()=>{const e=F("offset"),t=F("limit");e-t>=0&&(M("offset",e-t),k(u)())},pageSizeLimit:F("limit"),onSort:Y,disableSort:!1,sortParams:[{id:F("sortBy"),desc:"DESC"===F("sortOrder")}]})),h&&n.createElement(t.Modal,{headerBarMain:n.createElement("h1",{className:"heading-m"},d("WT_VIEW_PHOTO")),headerBarEnd:n.createElement("div",{className:"icon-bg-secondary",onClick:()=>{y(!1),b(null)},style:{cursor:"pointer"}},n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF",width:"24",height:"24"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))),hideSubmit:!0,actionCancelLabel:d("CS_COMMON_CLOSE"),actionCancelOnSubmit:()=>{y(!1),b(null)}},n.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px"}},I?n.createElement(t.Loader,null):S?n.createElement("img",{src:S,alt:"View",style:{maxWidth:"100%",maxHeight:"500px"}}):n.createElement("p",null,d("CS_COMMON_NO_DATA")))))},O=e=>{let o=e.moduleCode;const a=i.useTranslation().t,r=Digit.ULBService.getCurrentTenantId(),d=l.useState({}),u=d[0],s=d[1],v=l.useState(null),m=v[0],p=v[1];l.useEffect(()=>{if(m){const e=setTimeout(()=>{p(null)},1e3);return()=>clearTimeout(e)}},[m]);const E={enabled:!!(u&&Object.keys(u).length>0)};let f=[],g=0,_=!1,h=!1;if("WT"===o){var y=Digit.Hooks.wt.useTankerSearchAPI({tenantId:r,filters:u},E);_=y.isLoading,h=y.isSuccess;var T=y.data,S=(T=void 0===T?{}:T).waterTankerBookingDetail;f=void 0===S?[]:S;var b=T.count;g=void 0===b?0:b}else if("MT"===o){var N=Digit.Hooks.wt.useMobileToiletSearchAPI({tenantId:r,filters:u},E);_=N.isLoading,h=N.isSuccess;var I=N.data,D=(I=void 0===I?{}:I).mobileToiletBookingDetails;f=void 0===D?[]:D;var C=I.Count;g=void 0===C?0:C}else if("TP"===o){var A=Digit.Hooks.wt.useTreePruningSearchAPI({tenantId:r,filters:u},E);_=A.isLoading,h=A.isSuccess;var O=A.data,w=(O=void 0===O?{}:O).treePruningBookingDetails;f=void 0===w?[]:w;var L=O.Count;g=void 0===L?0:L}return n.createElement(n.Fragment,null,n.createElement(x,{t:a,isLoading:_,tenantId:r,setShowToast:p,onSubmit:function(e){const t=e.fromDate,l=e.toDate,n=c({},e,l?{toDate:l}:{},t?{fromDate:t}:{});let i=Object.keys(n).filter(e=>n[e]).reduce((e,t)=>c({},e,{[t]:"object"==typeof n[t]?n[t].code:n[t]}),{});!(Object.keys(i).length>0)||i.bookingNo||i.fromDate||i.status||i.toDate||i.mobileNumber?i.fromDate&&!i.toDate||!i.fromDate&&i.toDate?p({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):s(i):p({warning:!0,label:"ERR_PROVIDE_ONE_PARAMETERS"})},data:h&&!_?f.length>0?f:{display:"ES_COMMON_NO_DATA"}:"",count:g,moduleCode:o}),m&&n.createElement(t.Toast,{error:m.error,warning:m.warning,label:a(m.label),onClose:()=>p(null)}))},w=()=>{var e,l,a,r,d,u,s,v,m,p,E,f;const g=i.useTranslation().t,_=o.useLocation(),h=o.useRouteMatch().path,y=null===(e=Digit)||void 0===e||null===(l=e.ComponentRegistryService)||void 0===l?void 0:l.getComponent("WTCreate"),T=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("WTApplicationDetails"),S=null===(d=Digit)||void 0===d||null===(u=d.ComponentRegistryService)||void 0===u?void 0:u.getComponent("MTApplicationDetails"),b=null===(s=Digit)||void 0===s||null===(v=s.ComponentRegistryService)||void 0===v?void 0:v.getComponent("TPApplicationDetails"),N=null===(m=Digit)||void 0===m||null===(p=m.ComponentRegistryService)||void 0===p?void 0:p.getComponent("WTMyApplications"),I=Digit.ComponentRegistryService.getComponent("WTEmpInbox"),D=null===(E=Digit)||void 0===E||null===(f=E.ComponentRegistryService)||void 0===f?void 0:f.getComponent("ApplicationDetails"),C=e=>({searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:[e],applicationStatus:[],locality:[]}}),A=C("watertanker"),x=C("mobileToilet");return n.createElement("span",{style:{width:"100%"}},n.createElement(o.Switch,null,n.createElement(t.AppContainer,null,n.createElement("div",{className:"ground-container employee-app-container form-container"},n.createElement(t.ModuleHeader,{leftContent:n.createElement(n.Fragment,null,n.createElement(t.ArrowLeft,{className:"icon"}),g("CS_COMMON_BACK")),onLeftClick:()=>window.history.back(),breadcrumbs:(()=>{const e=_.pathname;let l=[{icon:t.HomeIcon,path:"/digit-ui/citizen"},{label:g("WT_MODULE_NAME"),path:h+"/wt-Vendor"}];if(e.includes("/inbox")){let n="ES_COMMON_INBOX";e.includes("/mt/inbox")&&(l=[{icon:t.HomeIcon,path:"/digit-ui/citizen"},{label:g("ACTION_TEST_MT"),path:h+"/mt-Vendor"}]),l.push({label:g(n)})}else if(e.includes("/my-bookings")){let t="WT_SEARCH_BOOKINGS";e.includes("/mt/my-bookings")&&(t="MT_SEARCH_BOOKINGS"),l.push({label:g(t)})}else e.includes("/status")?l.push({label:g("WT_MY_APPLICATIONS")}):(e.includes("/booking/")||e.includes("/booking-details")||e.includes("/bookingsearch/booking-details"))&&(l.push({label:g("ES_COMMON_INBOX"),path:e.includes("/mt/")?h+"/mt/inbox":h+"/inbox"}),l.push({label:g("WT_BOOKING_DETAILS")}));return l})()}),n.createElement("div",{className:"employee-form-content abcd"},n.createElement(t.PrivateRoute,{path:h+"/inbox",component:()=>n.createElement(I,{useNewInboxAPI:!0,parentRoute:h,moduleCode:"WT",businessService:"watertanker",filterComponent:"WT_INBOX_FILTER",initialStates:A,isInbox:!0})}),n.createElement(t.PrivateRoute,{path:h+"/mt/inbox",component:()=>n.createElement(I,{useNewInboxAPI:!0,parentRoute:h,businessService:"mobileToilet",moduleCode:"MT",filterComponent:"WT_INBOX_FILTER",initialStates:x,isInbox:!0})}),n.createElement(t.PrivateRoute,{path:h+"/request-service",component:y}),n.createElement(t.PrivateRoute,{path:h+"/status",component:N}),n.createElement(t.PrivateRoute,{path:h+"/booking/waterTanker/:acknowledgementIds/:tenantId",component:T}),n.createElement(t.PrivateRoute,{path:h+"/booking/mobileToilet/:acknowledgementIds/:tenantId",component:S}),n.createElement(t.PrivateRoute,{path:h+"/booking/treePruning/:acknowledgementIds/:tenantId",component:b}),n.createElement(t.PrivateRoute,{path:h+"/booking-details/:id",component:()=>n.createElement(D,{parentRoute:h})}),n.createElement(t.PrivateRoute,{path:h+"/bookingsearch/booking-details/:id",component:()=>n.createElement(D,{parentRoute:h})}),n.createElement(t.PrivateRoute,{path:h+"/vendor",component:()=>Digit.UserService.hasAccess(["WT_VENDOR"])?n.createElement("div",{style:{display:"flex",gap:"24px",flexWrap:"wrap",width:"100%",padding:"8px 0"}},n.createElement(t.CitizenHomeCard,{header:g("WT_MODULE_NAME"),links:[{i18nKey:g("ES_COMMON_INBOX"),link:"/digit-ui/citizen/wt/inbox"},{i18nKey:g("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/citizen/wt/my-bookings"},{i18nKey:g("WT_REQUEST_TANKER"),link:"/digit-ui/citizen/wt/request-service"}],Icon:()=>n.createElement(t.CHBIcon,{className:"fill-path-primary-main"})}),n.createElement(t.CitizenHomeCard,{header:g("TITLE_VENDOR_MANAGEMENT"),links:[{i18nKey:g("SEARCH_VENDOR"),link:"/digit-ui/citizen/vendor/search-vendor"}],Icon:()=>n.createElement(t.PropertyHouse,{className:"fill-path-primary-main"})})):n.createElement(o.Redirect,{to:{pathname:"/digit-ui/citizen/login",state:{from:h+"/wt-Vendor",role:"WT_VENDOR"}}})}),n.createElement(t.PrivateRoute,{path:h+"/mt-Vendor",component:()=>Digit.UserService.hasAccess(["MT_VENDOR"])?n.createElement("div",{style:{display:"flex",gap:"24px",flexWrap:"wrap",width:"100%",padding:"8px 0"}},n.createElement(t.CitizenHomeCard,{header:g("ACTION_TEST_MT"),links:[{i18nKey:g("ES_COMMON_INBOX"),link:"/digit-ui/citizen/wt/mt/inbox"},{i18nKey:g("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/citizen/wt/mt/my-bookings"},{i18nKey:g("MT_REQUEST_TANKER"),link:"/digit-ui/citizen/wt/request-service"}],Icon:()=>n.createElement(t.CHBIcon,{className:"fill-path-primary-main"})}),n.createElement(t.CitizenHomeCard,{header:g("TITLE_VENDOR_MANAGEMENT"),links:[{i18nKey:g("SEARCH_VENDOR"),link:"/digit-ui/citizen/vendor/search-vendor"}],Icon:()=>n.createElement(t.PropertyHouse,{className:"fill-path-primary-main"})})):n.createElement(o.Redirect,{to:{pathname:"/digit-ui/citizen/login",state:{from:h+"/mt-Vendor",role:"MT_VENDOR"}}})}),n.createElement(t.PrivateRoute,{path:h+"/my-bookings",component:e=>n.createElement(O,c({},e,{parentRoute:h,moduleCode:"WT"}))}),n.createElement(t.PrivateRoute,{path:h+"/mt/my-bookings",component:e=>n.createElement(O,c({},e,{parentRoute:h,moduleCode:"MT"}))}))))))},L=e=>{let a=e.onSubmit,r=e.setExistingDataSet;const d=i.useTranslation().t,u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=l.useState(null),v=s[0],m=s[1],p=l.useState(!1),E=p[0],f=p[1],g=o.useParams().offset;l.useEffect(()=>{E&&(a(),f(!1))},[E,a]);let _={limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:g&&!isNaN(parseInt(g))?g:"0",tenantId:u};l.useEffect(()=>{m(_)},[g]);const h=Digit.Hooks.wt.useTankerSearchAPI({filters:v}),y=h.isLoading,T=h.data;if(y)return n.createElement(t.Loader,null);const S=(null==T?void 0:T.waterTankerBookingDetail)||[],b={padding:"10px",margin:"10px 0",border:"1px solid #ccc",transition:"background-color 0.3s ease, box-shadow 0.3s ease"},N={boxShadow:"1px 4px 4px 7px rgba(0, 0, 0, 0.5)"};return n.createElement(n.Fragment,null,n.createElement("div",null,S.length>0&&S.map((e,l)=>{var i;return n.createElement("div",{key:l},n.createElement(t.Card,{style:c({},b,{cursor:"pointer"}),onMouseEnter:e=>{e.currentTarget.style.backgroundColor=N.backgroundColor,e.currentTarget.style.boxShadow=N.boxShadow},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="",e.currentTarget.style.boxShadow=""},onClick:()=>{(e=>{var t,l,n,i,o,a,d,u,s,c,v,m,p,E,g,_,h,y;const T={address:{houseNo:null==e||null===(t=e.address)||void 0===t?void 0:t.houseNo,streetName:null==e||null===(l=e.address)||void 0===l?void 0:l.streetName,addressline1:null==e||null===(n=e.address)||void 0===n?void 0:n.addressLine1,addressline2:null==e||null===(i=e.address)||void 0===i?void 0:i.addressLine2,landmark:null==e||null===(o=e.address)||void 0===o?void 0:o.landmark,pincode:null==e||null===(a=e.address)||void 0===a?void 0:a.pincode,cityValue:{code:null==e||null===(d=e.address)||void 0===d?void 0:d.city,value:null==e||null===(u=e.address)||void 0===u?void 0:u.city,i18nKey:null==e||null===(s=e.address)||void 0===s?void 0:s.city,city:{name:null==e||null===(c=e.address)||void 0===c?void 0:c.city,code:null==e||null===(v=e.address)||void 0===v?void 0:v.cityCode}},locality:{code:null==e||null===(m=e.address)||void 0===m?void 0:m.localityCode,value:null==e||null===(p=e.address)||void 0===p?void 0:p.locality,i18nKey:null==e||null===(E=e.address)||void 0===E?void 0:E.locality}},owner:{applicantName:null==e||null===(g=e.applicantDetail)||void 0===g?void 0:g.name,mobileNumber:null==e||null===(_=e.applicantDetail)||void 0===_?void 0:_.mobileNumber,alternateNumber:null==e||null===(h=e.applicantDetail)||void 0===h?void 0:h.alternateNumber,emailId:null==e||null===(y=e.applicantDetail)||void 0===y?void 0:y.emailId},requestDetails:{deliveryDate:null==e?void 0:e.deliveryDate,deliveryTime:null==e?void 0:e.deliveryTime,waterQuantity:{code:null==e?void 0:e.waterQuantity,value:null==e?void 0:e.waterQuantity,i18nKey:null==e?void 0:e.waterQuantity},tankerType:{code:null==e?void 0:e.tankerType,value:null==e?void 0:e.tankerType,i18nKey:null==e?void 0:e.tankerType},description:null==e?void 0:e.description}};r(T),f(!0)})(e)}},n.createElement(t.KeyNote,{keyValue:d("BOOKING_NO"),note:null==e?void 0:e.bookingNo}),n.createElement(t.KeyNote,{keyValue:d("APPLICANT_NAME"),note:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name}),n.createElement(t.KeyNote,{keyValue:d("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:d(""+(null==e?void 0:e.bookingStatus))})))}),0===S.length&&!y&&n.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},d("NO_APPLICATION_FOUND_MSG"))))},P=n.memo(e=>n.createElement("h1",{className:"heading-m"},(0,e.t)("MY_BOOKINGS"))),R=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),k=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(R,null)),M=e=>{let i=e.t,o=e.closeModal,a=e.onSubmit,r=e.setExistingDataSet;const d=l.useState(!1),u=d[0],s=d[1],c=l.useState(!1),v=c[0],m=c[1],p=l.useCallback(()=>{v&&(a(),m(!1))},[v,a]);return l.useEffect(()=>{p()},[p]),n.createElement(n.Fragment,null,n.createElement(t.Modal,{headerBarMain:n.createElement(P,{t:i}),headerBarEnd:n.createElement(k,{onClick:o}),actionCancelLabel:u&&i("CS_COMMON_BACK"),actionCancelOnSubmit:()=>s(!1),hideSubmit:!0,formId:"modal-action"},n.createElement(t.Card,{style:{boxShadow:"none"}},u&&n.createElement(L,{onSubmit:a,setExistingDataSet:r}),n.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},!u&&n.createElement(t.SubmitBar,{label:i("USE_EXISTING_DETAILS"),onSubmit:()=>{s(!0)}}),!u&&n.createElement(t.SubmitBar,{label:i("FILL_NEW_DETAILS"),onSubmit:()=>{m(!0)}})))))},F=e=>{let l=e.jumpTo;i.useTranslation();const a=o.useHistory();return n.createElement(t.LinkButton,{label:n.createElement(t.EditIcon,{style:{marginTop:"-30px",float:"right",position:"relative",bottom:"32px"}}),className:"check-page-link-button",onClick:function(){a.push(l)}})},B=e=>{Digit.UploadServices.Filefetch([e],Digit.ULBService.getStateId()).then(e=>{var t,l,n;const i=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.url;if(i){const e=i.split(",")[0];e?window.open(e,"_blank"):console.error("No valid URL found to open!")}else console.error("URL is missing in the response!")}).catch(e=>{console.error("Error fetching file:",e)})},W=e=>e.substr(0,1).toUpperCase()+e.substr(1),U=function(e,t,l){try{var n,i,o,a,r,d,u,s,c,v,m,p,E,f;return console.log("booking",e),console.log("tenantInfo",t),Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:l(null==t?void 0:t.i18nKey)+" "+(_=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),_.toLowerCase().split(" ").map(W).join(" ")),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.bookingNo,isTOCRequired:!1,heading:l("WT_ACKNOWLEDGEMENT"),details:[{title:l("WT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:l("WT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:l("WT_ALT_MOBILE_NUMBER"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.alternateNumber},{title:l("WT_EMAIL_ID"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.emailId}].filter(e=>e.value)},{title:l("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_PINCODE"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.pincode},{title:l("WT_CITY"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.city},{title:l("WT_LOCALITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.locality},{title:l("WT_STREET_NAME"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.streetName},{title:l("WT_DOOR_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.doorNo},{title:l("WT_HOUSE_NO"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.houseNo},{title:l("WT_ADDRESS_LINE1"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.addressLine1},{title:l("WT_ADDRESS_LINE2"),value:null==e||null===(E=e.address)||void 0===E?void 0:E.addressLine2},{title:l("WT_LANDMARK"),value:null==e||null===(f=e.address)||void 0===f?void 0:f.landmark}].filter(e=>e.value)},{title:l("WT_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_TANKER_TYPE"),value:null==e?void 0:e.tankerType},{title:l("WT_WATER_TYPE"),value:l(null==e?void 0:e.waterType)},{title:l("WT_TANKER_QUANTITY"),value:null==e?void 0:e.tankerQuantity},{title:l("WT_WATER_QUANTITY"),value:(null==e?void 0:e.waterQuantity)+" Ltr"},{title:l("WT_DELIVERY_DATE_TIME"),value:h(null==e?void 0:e.deliveryDate)+" ("+g(null==e?void 0:e.deliveryTime)+")"},{title:l("WT_DESCRIPTION"),value:null==e?void 0:e.description},{title:l("WT_IMMEDIATE"),value:l("Y"===(null==e?void 0:e.extraCharge)?"YES":"NO")}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var _},H=e=>{const t=i.useTranslation().t;return e.isSuccess?t("WT_SUBMIT_SUCCESSFULL"):e.isLoading?t("WT_APPLICATION_PENDING"):e.isSuccess?void 0:t("WT_APPLICATION_FAILED")},j={padding:"4px 0px",justifyContent:"space-between"},V=e=>{var l,i;return n.createElement(t.Banner,{message:H(e),applicationNumber:null===(l=e.data)||void 0===l||null===(i=l.waterTankerBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("WT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},z=()=>{var e,l;const o=i.useTranslation().t,a=Digit.ULBService.getCurrentTenantId(),r="WT_EMERGENCY_WATER_TANKER_REQUEST"!==o("WT_EMERGENCY_WATER_TANKER_REQUEST")?o("WT_EMERGENCY_WATER_TANKER_REQUEST"):"Emergency Water Tanker Request",d=Digit.Hooks.useNewInboxGeneral({tenantId:a,ModuleCode:"WT",filters:{limit:10,offset:0,services:["watertanker"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.wtAccess()}}),u=d.data,s=d.isLoading,c=Digit.Hooks.useNewInboxGeneral({tenantId:a,ModuleCode:"WT",filters:{limit:10,offset:0,services:["watertanker-fixedpoint"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.wtAccess()}}),v=c.data,m=c.isLoading,p=s?"-":null!=(e=null==u?void 0:u.totalCount)?e:0,E=m?"-":null!=(l=null==v?void 0:v.totalCount)?l:0,f=[{count:p,label:o("ES_COMMON_INBOX_CITIZEN"),link:"/digit-ui/employee/wt/inbox"},{count:E,label:o("ES_COMMON_INBOX_FIXED_POINT"),link:"/digit-ui/employee/wt/fixed-point/inbox"},{label:o("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/wt/my-bookings"},{label:o("WT_APPLICATION_CREATE"),link:"/digit-ui/employee/wt/request-service"},{label:r,link:"/digit-ui/employee/wt/fixed-point/request-service"},{label:o("WT_FIXED_POINT_SCHEDULE_MANAGEMENT"),link:"/digit-ui/employee/wt/fixed-point-schedule"},{label:o("WT_LIVE_TRACKING_SYSTEM"),link:"/digit-ui/employee/wt/live-tracking"},{label:o("WT_SEARCH_FIX_POINT"),link:"/digit-ui/employee/wt/search-filling-fix-point"},{label:o("Vendor_Assign"),link:"/digit-ui/employee/wt/vendor-assignment"}],g=Digit.UserService.hasAccess(["WT_CEMP"])||!1,_={Icon:n.createElement(t.CHBIcon,null),moduleName:o("WT_MODULE_NAME"),kpis:[{count:s?"-":p,label:"WT_ONLINE_INBOX"!==o("WT_ONLINE_INBOX")?o("WT_ONLINE_INBOX"):"General Inbox",link:"/digit-ui/employee/wt/inbox"},{count:m?"-":E,label:"WT_EMERGENCY_INBOX"!==o("WT_EMERGENCY_INBOX")?o("WT_EMERGENCY_INBOX"):"Emergency Inbox",link:"/digit-ui/employee/wt/fixed-point/inbox"}],links:f.filter(e=>!(null!=e&&e.role)||g)};return n.createElement(t.EmployeeModuleCard,_)},K=["t","currentPage","columns","data","getCellProps","disableSort","onSort","onNextPage","onPrevPage","onPageSizeChange","isPaginationRequired","pageSizeLimit","sortParams","totalRecords","showCSVExport","csvExportFileName","csvExportData","getCSVExportData","csvExportColumns","csvExportButtonLabel"],G=e=>{let l=e.t,i=e.currentPage,o=e.columns,a=e.data,r=e.getCellProps,d=e.disableSort,u=e.onSort,s=e.onNextPage,m=e.onPrevPage,p=e.onPageSizeChange,E=e.isPaginationRequired,f=e.pageSizeLimit,g=e.sortParams,_=e.totalRecords,h=e.showCSVExport,y=e.csvExportFileName,T=e.csvExportData,S=e.getCSVExportData,b=e.csvExportColumns,N=e.csvExportButtonLabel,I=v(e,K);return n.createElement(t.Table,c({t:l,data:a,currentPage:i,columns:o,getCellProps:r,onNextPage:s,onPrevPage:m,pageSizeLimit:f,disableSort:d,isPaginationRequired:E,onPageSizeChange:p,onSort:u,sortParams:g,totalRecords:_,showCSVExport:h,csvExportFileName:y,csvExportData:T,getCSVExportData:S,csvExportColumns:b,csvExportButtonLabel:N,inboxStyles:{overflowX:"scroll"}},I))},q=e=>{let l=e.businessService;const o=i.useTranslation().t;return n.createElement(t.Card,{className:"filter inboxLinks"},n.createElement("div",{className:"complaint-links-container"},"CITIZEN"!==Digit.UserService.getUser().info.type&&n.createElement("div",{className:"header"},n.createElement("span",{className:"logo"},n.createElement(t.HomeIcon,null))," ",n.createElement("span",{className:"text"},o(l+"_REQUEST")))))},Y={mobileNumber:t.MobileNumber},X=["vendorName","vehicleName","driverName","fillingPointId"],Q=e=>null==e?"":String(e),Z=e=>(null==e?void 0:e.name)||(null==e?void 0:e.vendor_id)||"",J=e=>(null==e?void 0:e.registrationNumber)||(null==e?void 0:e.name)||(null==e?void 0:e.type)||"",$=e=>{var t;return(null==e?void 0:e.name)||(null==e||null===(t=e.owner)||void 0===t?void 0:t.name)||(null==e?void 0:e.licenseNumber)||""},ee=e=>(null==e?void 0:e.fillingPointName)||(null==e?void 0:e.name)||"",te=e=>"object"==typeof e?(null==e?void 0:e.id)||(null==e?void 0:e.fillingPointId)||(null==e?void 0:e.bookingId)||"":Q(e),le=function(e,t,l,n){if(void 0===e&&(e=[]),void 0===n&&(n=[]),!t)return null;const i=("object"==typeof t?[l(t),...n.map(e=>null==t?void 0:t[e])]:[t]).map(Q).filter(Boolean);return e.find(e=>[l(e),...n.map(t=>null==e?void 0:e[t])].map(Q).filter(Boolean).some(e=>i.includes(e)))||("object"==typeof t?t:null)},ne=e=>{var o;let a=e.onSearch,d=e.type,u=e.onClose,s=e.searchFields,v=e.searchParams,m=e.isInboxPage,p=e.clearSearch;const E=i.useTranslation().t,f=r.useForm({defaultValues:m?v:c({locality:null,city:null},v)}),g=f.handleSubmit,_=f.reset,h=f.control,y=f.formState,T=f.setValue,S=(0,f.watch)(),b=window.innerWidth<=640,N=e=>{const t=c({},e);if(e.mobileNumber||delete t.mobileNumber,C){const e="object"==typeof t.vendorName?Z(t.vendorName):Q(t.vendorName),l="object"==typeof t.vehicleName?J(t.vehicleName):Q(t.vehicleName),n="object"==typeof t.driverName?$(t.driverName):Q(t.driverName),i="object"==typeof t.fillingPointId?te(t.fillingPointId):Q(t.fillingPointId);e?t.vendorName=e:delete t.vendorName,l?t.vehicleName=l:delete t.vehicleName,n?t.driverName=n:delete t.driverName,i?t.fillingPointId=i:delete t.fillingPointId}t.delete=[],s.forEach(e=>{t[e.name]||t.delete.push(e.name)}),C&&X.forEach(e=>{t[e]||t.delete.push(e)}),a(t),"mobile"===d&&u()};function I(){const e=s.reduce((e,t)=>c({},e,{[null==t?void 0:t.name]:""}),{});if(C&&X.forEach(t=>{e[t]=""}),_(e),m){const e=c({},v);e.delete=[],s.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),C&&X.forEach(t=>{e.delete.push(t)}),a(c({},e))}else p()}const D=e=>n.createElement(t.LinkLabel,{style:c({display:"inline"},e?{margin:0}:{}),onClick:I},E("ES_COMMON_CLEAR_SEARCH")),C=window.location.href.includes("fixed-point"),x=Digit.Hooks.wt.useFillPointSearch({tenantId:Digit.ULBService.getCurrentTenantId(),filters:{limit:1e3}},{enabled:!!C}).data,O=(null==x?void 0:x.fillingPoints)||[],w=l.useMemo(()=>O.map(e=>c({},e,{name:ee(e)||"NA"})),[O]),L=l.useMemo(()=>le(w,null==S?void 0:S.fillingPointId,ee,["id","fillingPointId","bookingId","name"]),[w,null==S?void 0:S.fillingPointId]),P=te(L||(null==S?void 0:S.fillingPointId)),R=Digit.Hooks.fsm.useVendorSearch({tenantId:Digit.ULBService.getCurrentTenantId(),filters:c({limit:1e3},P?{fillingPointId:P}:{}),config:{enabled:!!C}}).data,k=l.useMemo(()=>((null==R?void 0:R.vendor)||[]).map(e=>c({},e,{name:Z(e)||"NA"})),[R]),M=l.useMemo(()=>le(k,null==S?void 0:S.vendorName,Z,["id","vendor_id","name"]),[k,null==S?void 0:S.vendorName]),F=l.useMemo(()=>k.flatMap(e=>((null==e?void 0:e.vehicles)||[]).map(t=>c({},t,{name:J(t)||"NA",vendorId:null==e?void 0:e.id}))),[k]),B=l.useMemo(()=>k.flatMap(e=>((null==e?void 0:e.drivers)||[]).map(t=>c({},t,{name:$(t)||"NA",vendorId:null==e?void 0:e.id}))),[k]),W=l.useMemo(()=>M?((null==M?void 0:M.vehicles)||[]).map(e=>c({},e,{name:J(e)||"NA",vendorId:null==M?void 0:M.id})):F,[F,M]),U=l.useMemo(()=>M?((null==M?void 0:M.drivers)||[]).map(e=>c({},e,{name:$(e)||"NA",vendorId:null==M?void 0:M.id})):B,[B,M]);return n.createElement("form",{id:"search-form",onSubmit:g(N),className:" search-complaint-container"},n.createElement(n.Fragment,null,("mobile"===d||b)&&n.createElement("div",{className:"complaint-header"},n.createElement("h2",null,E("ES_COMMON_SEARCH_BY")),n.createElement("span",{onClick:u},n.createElement(t.CloseSvg,null))),C?n.createElement(A,{title:E("WT_SEARCH_FILTERS_LABEL")||"Search Filters",defaultOpen:!0,tabs:[E("WT_SMART_SEARCH"),E("WT_ADVANCED_SEARCH")],defaultTab:E("WT_SMART_SEARCH")},e=>n.createElement("div",{className:"formcomposer-section-grid"},e===E("WT_SMART_SEARCH")&&n.createElement(l.Fragment,null,null==s?void 0:s.map(e=>"bookingNo"!==e.name&&"mobileNumber"!==e.name?null:n.createElement("div",{key:e.name,className:"input-fields"},n.createElement("span",{className:"mobile-input"},n.createElement(t.Label,null,E(e.label)+" "+(e.isMendatory?"*":"")),n.createElement(r.Controller,e.type?{render:t=>n.createElement(null==Y?void 0:Y[e.type],{formValue:S,setValue:T,onChange:t.onChange,value:t.value}),name:e.name,control:h,defaultValue:""}:{render:e=>n.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:h,defaultValue:""}))))),e===E("WT_ADVANCED_SEARCH")&&n.createElement(l.Fragment,null,null==s?void 0:s.map(e=>n.createElement("div",{key:e.name,className:"input-fields"},n.createElement("span",{className:"mobile-input"},n.createElement(t.Label,null,E(e.label)+" "+(e.isMendatory?"*":"")),n.createElement(r.Controller,e.type?{render:t=>n.createElement(null==Y?void 0:Y[e.type],{formValue:S,setValue:T,onChange:t.onChange,value:t.value}),name:e.name,control:h,defaultValue:""}:{render:e=>n.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:h,defaultValue:""})))),n.createElement("div",{className:"input-fields"},n.createElement("span",{className:"mobile-input"},n.createElement(t.Label,null,E("WT_FILLING_POINT")),n.createElement(r.Controller,{control:h,name:"fillingPointId",render:e=>n.createElement(t.Dropdown,{selected:le(w,e.value,ee,["id","fillingPointId","bookingId","name"]),select:t=>{e.onChange(t),T("vendorName",""),T("vehicleName",""),T("driverName","")},onBlur:e.onBlur,option:w,optionKey:"name",t:E})}))),n.createElement("div",{className:"input-fields"},n.createElement("span",{className:"mobile-input"},n.createElement(t.Label,null,E("WT_VENDOR_NAME")),n.createElement(r.Controller,{control:h,name:"vendorName",render:e=>n.createElement(t.Dropdown,{selected:le(k,e.value,Z,["id","vendor_id","name"]),select:t=>{e.onChange(t),T("vehicleName",""),T("driverName","")},onBlur:e.onBlur,option:k,optionKey:"name",t:E})}))),n.createElement("div",{className:"input-fields"},n.createElement("span",{className:"mobile-input"},n.createElement(t.Label,null,E("WT_VEHICLE_NO")),n.createElement(r.Controller,{control:h,name:"vehicleName",render:e=>n.createElement(t.Dropdown,{selected:le(W,e.value,J,["id","registrationNumber","name"]),select:e.onChange,onBlur:e.onBlur,option:W,optionKey:"name",t:E})}))),n.createElement("div",{className:"input-fields"},n.createElement("span",{className:"mobile-input"},n.createElement(t.Label,null,E("WT_DRIVER_NAME")),n.createElement(r.Controller,{control:h,name:"driverName",render:e=>n.createElement(t.Dropdown,{selected:le(U,e.value,$,["id","ownerId","licenseNumber","name"]),select:e.onChange,onBlur:e.onBlur,option:U,optionKey:"name",t:E})})))))):n.createElement("div",{className:"formcomposer-section-grid"},null==s||null===(o=s.filter(e=>!0))||void 0===o?void 0:o.map((e,l)=>{var i,o,a,d,u;return n.createElement("div",{key:e.name,className:"input-fields"},n.createElement("span",{className:"mobile-input"},n.createElement(t.Label,null,E(e.label)+" "+(e.isMendatory?"*":"")),n.createElement(r.Controller,e.type?{render:t=>n.createElement(null==Y?void 0:Y[e.type],{formValue:S,setValue:T,onChange:t.onChange,value:t.value}),name:e.name,control:h,defaultValue:""}:{render:e=>n.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:h,defaultValue:""})),null!=y&&null!==(i=y.dirtyFields)&&void 0!==i&&i[e.name]&&null!=y&&null!==(o=y.errors)&&void 0!==o&&null!==(a=o[e.name])&&void 0!==a&&a.message?n.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==y||null===(d=y.errors)||void 0===d||null===(u=d[e.name])||void 0===u?void 0:u.message):null)})),n.createElement("div",{className:"formcomposer-section-button"},m?n.createElement("div",{className:"generic-button clear-search"},n.createElement("p",{onClick:I},E("ES_COMMON_CLEAR_SEARCH"))):n.createElement("div",null,D()),"desktop"===d&&!b&&n.createElement(t.SubmitBar,{className:"generic-button",disabled:!!Object.keys(y.errors).length||(()=>{var e;let t=!0;return Object.keys(S).forEach(e=>{!["locality","city"].includes(e)&&S[e]&&(t=!1)}),null==s||!s.find(e=>"locality"===e.name)||null!=S&&null!==(e=S.locality)&&void 0!==e&&e.code||(t=!0),t})(),label:E("ES_COMMON_SEARCH"),onClick:g(N),submit:!0,form:"search-form"})),("mobile"===d||b)&&n.createElement(t.ActionBar,{className:"clear-search-container"},n.createElement("button",{className:"clear-search",style:{flex:1}},D(b)),n.createElement(t.SubmitBar,{disabled:!!Object.keys(y.errors).length,label:E("ES_COMMON_SEARCH"),style:{flex:1},onClick:g(N),submit:!0}))))},ie=["tableConfig","filterComponent"],oe=e=>{var o;let a=e.tableConfig,r=e.filterComponent,d=v(e,ie);const u=d.data,s=d.useNewInboxAPI,c=i.useTranslation().t,m=n.useCallback(e=>{var t,l,n,i;const o=(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.auditDetails)||void 0===l?void 0:l.createdTime)||(null==e||null===(n=e.workflowData)||void 0===n||null===(i=n.auditDetails)||void 0===i?void 0:i.createdTime);return o?Digit.DateUtils.ConvertEpochToDate(o)+" "+Digit.DateUtils.ConvertEpochToTimeInHours(o):""},[]),p=l.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r)})[0],E=l.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(d.EmptyResultInboxComp)})[0],f=l.useState(!1),g=f[0],_=f[1],h=n.useMemo(()=>d.isSearch?a.searchColumns(d):a.inboxColumns(d)||[],[]),y=n.useMemo(()=>{var e,t,l,n,i;const o=[{Header:(null==h||null===(e=h[0])||void 0===e?void 0:e.Header)||c("WT_BOOKING_NO"),exportAccessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""}},{Header:(null==h||null===(t=h[1])||void 0===t?void 0:t.Header)||c("WT_APPLICANT_NAME"),exportAccessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""}},{Header:(null==h||null===(l=h[2])||void 0===l?void 0:l.Header)||c("WT_MOBILE_NUMBER"),exportAccessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""}},{Header:(null==h||null===(n=h[3])||void 0===n?void 0:n.Header)||c("LOCALITY"),exportAccessor:e=>{var t,l;if(null==e||null===(t=e.searchData)||void 0===t||!t.localityCode)return"";const n=((null==e||null===(l=e.searchData)||void 0===l?void 0:l.tenantId)||Digit.ULBService.getCurrentTenantId()||"djb").replace(".","_").toUpperCase();return c(n+"_REVENUE_"+e.searchData.localityCode)}}];var a,r,d,u,s,v;return null!=h&&h.some(e=>"fillingPoint"===(null==e?void 0:e.id))&&o.push({Header:(null==h||null===(a=h.find(e=>"fillingPoint"===(null==e?void 0:e.id)))||void 0===a?void 0:a.Header)||c("Filling Point"),exportAccessor:e=>{var t,l,n;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.fillingPointMetadata)||void 0===l?void 0:l.name)||(null==e||null===(n=e.searchData)||void 0===n?void 0:n.fillingPointName)||"-"}}),null!=h&&h.some(e=>"createdTime"===(null==e?void 0:e.id))&&o.push({Header:(null==h||null===(r=h.find(e=>"createdTime"===(null==e?void 0:e.id)))||void 0===r?void 0:r.Header)||c("CREATED_AT"),exportAccessor:e=>m(e)}),o.push({Header:(null==h||null===(i=h.find(e=>"applicationStatus"===(null==e?void 0:e.id)))||void 0===i?void 0:i.Header)||c("WT_STATUS"),exportAccessor:e=>{var t,l;return null!=e&&null!==(t=e.workflowData)&&void 0!==t&&null!==(l=t.state)&&void 0!==l&&l.applicationStatus?c(e.workflowData.state.applicationStatus):""}}),null!=h&&h.some(e=>"deliveryDateTime"===(null==e?void 0:e.id))&&o.push({Header:(null==h||null===(d=h.find(e=>"deliveryDateTime"===(null==e?void 0:e.id)))||void 0===d?void 0:d.Header)||c("WT_DELIVERY_DATE_TIME"),exportAccessor:e=>{var t;const l=null==e||null===(t=e.searchData)||void 0===t?void 0:t.driverTripReport;if(Array.isArray(l)&&l.length>0){var n,i;const e=null===(n=l[0])||void 0===n||null===(i=n.auditDetails)||void 0===i?void 0:i.lastModifiedTime;if(e)return Digit.DateUtils.ConvertEpochToDate(e)+" "+Digit.DateUtils.ConvertEpochToTimeInHours(e)}return"-"}}),null!=h&&h.some(e=>"vendorName"===(null==e?void 0:e.id))&&o.push({Header:(null==h||null===(u=h.find(e=>"vendorName"===(null==e?void 0:e.id)))||void 0===u?void 0:u.Header)||c("WT_VENDOR_NAME"),exportAccessor:e=>{var t,l,n;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.vendor)||void 0===l?void 0:l.name)||(null==e||null===(n=e.searchData)||void 0===n?void 0:n.vendorName)||"-"}}),null!=h&&h.some(e=>"vehicleNumber"===(null==e?void 0:e.id))&&o.push({Header:(null==h||null===(s=h.find(e=>"vehicleNumber"===(null==e?void 0:e.id)))||void 0===s?void 0:s.Header)||c("WT_VEHICLE_NO"),exportAccessor:e=>{var t,l;const n=null==e?void 0:e.searchData,i=(null==n?void 0:n.vehicle)||(null==n||null===(t=n.vendor)||void 0===t||null===(l=t.vehicles)||void 0===l?void 0:l.find(e=>(null==e?void 0:e.id)===(null==n?void 0:n.vehicleId)));return(null==i?void 0:i.registrationNumber)||(null==i?void 0:i.name)||(null==i?void 0:i.type)||(null==n?void 0:n.vehicleName)||(null==n?void 0:n.vehicleRegistrationNo)||"-"}}),null!=h&&h.some(e=>"driverName"===(null==e?void 0:e.id))&&o.push({Header:(null==h||null===(v=h.find(e=>"driverName"===(null==e?void 0:e.id)))||void 0===v?void 0:v.Header)||c("WT_DRIVER_NAME"),exportAccessor:e=>{var t,l,n;const i=null==e?void 0:e.searchData,o=(null==i?void 0:i.driver)||(null==i||null===(t=i.vendor)||void 0===t||null===(l=t.drivers)||void 0===l?void 0:l.find(e=>{var t;return(null==e?void 0:e.id)===(null==i?void 0:i.driverId)||(null==e?void 0:e.ownerId)===(null==i?void 0:i.driverId)||(null==e||null===(t=e.owner)||void 0===t?void 0:t.uuid)===(null==i?void 0:i.driverId)}));return(null==o?void 0:o.name)||(null==o||null===(n=o.owner)||void 0===n?void 0:n.name)||(null==i?void 0:i.driverName)||"-"}}),o},[h,m,c]);let T;if(d.isLoading)T=n.createElement(t.Loader,null);else if(g)T=null;else if(!u||0===(null==u?void 0:u.length)||s&&null!=u&&null!==(o=u[0])&&void 0!==o&&o.dataEmpty){var S;T=E?n.createElement(E,{data:u}):0===(null==u?void 0:u.length)||s&&null!=u&&null!==(S=u[0])&&void 0!==S&&S.dataEmpty?n.createElement(t.Card,{style:{marginTop:20}},c("DATA_NOT_FOUND","Data Not Found").split("\n").map((e,t)=>n.createElement("p",{key:t,style:{textAlign:"center"}},e))):n.createElement(t.Loader,null)}else(null==u?void 0:u.length)>0&&(T=n.createElement(G,{t:c,data:u,columns:h,getCellProps:e=>({style:{padding:"8px 12px",fontSize:"13.5px"}}),onPageSizeChange:d.onPageSizeChange,currentPage:d.currentPage,onNextPage:d.onNextPage,onPrevPage:d.onPrevPage,pageSizeLimit:d.pageSizeLimit,onSort:d.onSort,disableSort:d.disableSort,sortParams:d.sortParams,autoSort:!1,totalRecords:d.totalRecords,showCSVExport:!0,getCSVExportData:d.getCSVExportData,csvExportColumns:y,csvExportFileName:String(d.moduleCode||"wt").toLowerCase()+"-inbox"}));return n.createElement("div",{className:"inbox-container"},!d.isSearch&&n.createElement("div",{className:"side-panel-item"},n.createElement(q,{parentRoute:d.parentRoute,businessService:d.moduleCode}),n.createElement("div",{className:"filter-form "},n.createElement(p,{defaultSearchParams:d.defaultSearchParams,onFilterChange:d.onFilterChange,searchParams:d.searchParams,type:"desktop",useNewInboxAPI:s,statusMap:s?null==u?void 0:u[0].statusMap:null,moduleCode:d.moduleCode}))),n.createElement("div",{className:"employee-form-content",style:{flex:1}},!d.isSearch&&n.createElement("div",{className:"summary-cards-container"},((e,t,l,n)=>{const i=e=>{var t;return((null==u||null===(t=u[0])||void 0===t?void 0:t.statusMap)||[]).filter(t=>{const l=(t.applicationStatus||t.applicationstatus||t.bookingStatus||t.bookingstatus||t.statusid||"").toUpperCase().replace(/\s+/g,"_");return e.includes(l)}).reduce((e,t)=>e+t.count,0)},o=("watertanker-fixedpoint"===d.businessService||null===(e=d.searchParams)||void 0===e||null===(t=e.services)||void 0===t||t.includes("watertanker-fixedpoint"),[{label:"WT_TOTAL_BOOKINGS",count:(null==u||null===(l=u[0])||void 0===l?void 0:l.totalCount)||0,color:"#0B2559",filter:null,active:!(null!==(n=d.searchParams)&&void 0!==n&&n.status)},{label:"WT_SCHEDULED",count:i(["SCHEDULED","VENDOR_ASSIGNED"]),color:"#F59E0B",filter:["SCHEDULED"]},{label:"WT_DELIVERED",count:i(["TANKER_DELIVERED","DELIVERED"]),color:"#10B981",filter:["TANKER_DELIVERED"]}]);return o.push({label:"IN_TRANSIT",count:i(["IN_TRANSIT","DELIVERY_PENDING"]),color:"#A855F7",filter:["IN_TRANSIT"]},{label:"MISSED",count:i(["MISSED","DELIVERY_MISSED"]),color:"#EF4444",filter:["MISSED"]},{label:"REJECTED",count:i(["CANCELLED","REJECTED","REQUEST_REJECTED"]),color:"#64748B",filter:["CANCELLED"]}),o})().map((e,t)=>{var l,i,o,a,r;const u=null!==(l=d.searchParams)&&void 0!==l&&null!==(i=l.status)&&void 0!==i&&i.code?null===(o=e.filter)||void 0===o?void 0:o.includes(null===(a=d.searchParams)||void 0===a||null===(r=a.status)||void 0===r?void 0:r.code):e.active;return n.createElement("div",{key:t,className:"summary-card",style:{backgroundColor:"#fff",borderRadius:"6px",padding:"16px 14px",boxShadow:"0 2px 8px rgba(0,0,0,0.05)",flex:"1 1 0%",minWidth:"110px",border:u?"2px solid "+e.color:"1px solid #E2E8F0",cursor:"pointer",display:"flex",flexDirection:"column",justifyContent:"space-between",transition:"all 0.2s ease-in-out"}},n.createElement("div",{style:{fontSize:"11px",color:"#64748B",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},c(e.label)),n.createElement("div",{style:{fontSize:"28px",fontWeight:"700",color:e.color,marginTop:"12px"}},String(e.count).padStart(2,"0")))})),n.createElement(ne,{defaultSearchParams:d.defaultSearchParams,onSearch:e=>{d.onSearch(e),_(!1)},type:"desktop",searchFields:d.searchFields,isInboxPage:!(null!=d&&d.isSearch),searchParams:d.searchParams,clearSearch:()=>_(!0)}),n.createElement("div",{className:"result",style:{flex:1}},T)))},ae=e=>{const o=i.useTranslation().t,a=l.useState(()=>{var t,l;return null!==(t=e.sortParams)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.desc?{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}})[0];function r(){}return n.createElement(n.Fragment,null,n.createElement("div",{className:"filter"},n.createElement("div",{className:"filter-card"},n.createElement("div",{className:"heading"},n.createElement("div",{className:"filter-label"},o("SORT_BY"),":"),n.createElement("div",{className:"clearAll",onClick:r},o("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&n.createElement("span",{className:"clear-search",onClick:r},o("ES_COMMON_CLEAR_ALL")),"mobile"===e.type&&n.createElement("span",{onClick:e.onClose},n.createElement(t.CloseSvg,null))),n.createElement("div",null,n.createElement(t.RadioButtons,{onSelect:function(t){e.onSort([{id:"createdTime",desc:"DESC"===t.code}]),e.onClose()},selectedOption:a,optionsKey:"name",options:[{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}]})))))},re=e=>{let i=e.t,o=e.data,a=e.onFilterChange,r=e.onSearch,d=e.onSort,u=e.serviceRequestIdKey,s=e.isFstpOperator,c=e.isLoading,v=e.isSearch,m=e.searchParams,p=e.searchFields,E=e.sortParams,f=e.linkPrefix,g=e.filterComponent;const _=l.useState(v?"SEARCH":""),h=_[0],y=_[1],T=l.useState(!!v),S=T[0],b=T[1],N=l.useState(E)[1],I=l.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(g)})[0];l.useEffect(()=>{h&&b(!0)},[h]);const D=()=>{b(!1),y(""),N(E)};if(c)return n.createElement(t.Loader,null);let C;return o&&0!==(null==o?void 0:o.length)?o&&(null==o?void 0:o.length)>0&&(C=n.createElement(t.DetailsCard,{data:o,serviceRequestIdKey:u,linkPrefix:f||"/digit-ui/employee/chb/"})):C=n.createElement(t.Card,{style:{marginTop:20}},i("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>n.createElement("p",{key:t,style:{textAlign:"center"}},e))),n.createElement(n.Fragment,null,n.createElement("div",{className:"searchBox"},r&&n.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{y("SEARCH"),b(!0)}}),!v&&a&&n.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{y("FILTER"),b(!0)}}),n.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{y("SORT"),b(!0)}})),C,S&&n.createElement(t.PopUp,null,"FILTER"===h&&n.createElement("div",{className:"popup-module"},n.createElement(I,{onFilterChange:e=>{a(e),b(!1)},Close:D,type:"mobile",searchParams:m})),"SORT"===h&&n.createElement("div",{className:"popup-module"},n.createElement(ae,{type:"mobile",sortParams:E,onClose:D,onSort:d})),"SEARCH"===h&&n.createElement("div",{className:"popup-module"},n.createElement(ne,{type:"mobile",onClose:D,onSearch:r,isFstpOperator:s,searchParams:m,searchFields:p}))))},de=e=>{let a=e.classNameForMobileView,r=void 0===a?"":a;const d=i.useTranslation().t,u=[],s=l.useState([]),c=s[0],v=s[1],m=Digit.UserService.getUser().info.roles;return l.useEffect(()=>{let e=[];u.forEach(t=>{var l;t.accessTo?(l=t.accessTo,m.filter(e=>l.includes(e.code)).length&&e.push(t)):e.push(t)}),v(e)},[]),n.createElement(t.Card,{className:"employeeCard filter"},n.createElement("div",{className:"complaint-links-container "+r},n.createElement("div",{className:"header"},n.createElement("span",{className:"logo"},n.createElement(t.ShippingTruck,null))," ",n.createElement("span",{className:"text"},d("ES_TITLE_WT_REGISTRATION"))),n.createElement("div",{className:"body"},c.map((e,t)=>n.createElement("span",{className:"link",key:t},n.createElement(o.Link,{to:e.link},e.text))))))},ue=e=>{let t=e.data,l=e.isLoading,o=e.isSearch,a=e.searchFields,r=e.onFilterChange,d=e.onSearch,u=e.onSort,s=e.parentRoute,c=e.searchParams,v=e.sortParams,m=e.linkPrefix,p=e.tableConfig,E=e.filterComponent;const f=i.useTranslation().t;return n.createElement("div",{style:{padding:0}},n.createElement("div",{className:"inbox-container"},n.createElement("div",{className:"filters-container"},!o&&n.createElement(de,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:s,isMobile:!0}),n.createElement(re,{t:f,data:null!=t&&null!==(g=t[0])&&void 0!==g&&g.dataEmpty?[]:null==t?void 0:t.map(e=>{const t={};return(o?p.searchColumns():p.inboxColumns()).forEach(l=>{l.mobileCell&&(t[l.Header]=l.mobileCell(e))}),t}),onFilterChange:r,isLoading:l,isSearch:o,onSearch:d,onSort:u,searchParams:c,searchFields:a,linkPrefix:m,sortParams:v,serviceRequestIdKey:null==p?void 0:p.serviceRequestIdKey,filterComponent:E}))));var g},se=["isFetching","isLoading","searchResponseKey","data","searchFields"],ce={bookingNo:"bookingNo",applicantName:"applicantName",mobileNumber:"mobileNumber",localityCode:"localityCode",applicationStatus:"applicationStatus",bookingStatus:"bookingStatus",createdTime:"createdTime"},ve=e=>{var t,o,a,r,d;let u=e.useNewInboxAPI,s=e.parentRoute,m=e.moduleCode,p=e.detailRoute,E=e.initialStates,f=void 0===E?{}:E,g=e.filterComponent,_=e.isInbox,h=e.rawWfHandler,y=e.rawSearchHandler,T=e.combineResponse,S=e.wfConfig,b=e.searchConfig,N=e.middlewaresWf,D=e.middlewareSearch,C=e.EmptyResultInboxComp;const A=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),x=Digit.UserService.getUser().info,O=i.useTranslation().t,w=l.useState(()=>_?{}:{enabled:!1}),L=w[0],P=w[1],R=l.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("WTInboxTableConfig")})[0],k=l.useState(f.pageOffset||0),M=k[0],F=k[1],B=l.useState(f.pageSize||10),W=B[0],U=B[1],H=l.useState(f.sortParams||[{id:"createdTime",desc:!0}]),j=H[0],V=H[1],z=l.useState(f.searchParams||{}),K=z[0],G=z[1],q=ce[null==j||null===(t=j[0])||void 0===t?void 0:t.id]||(null==j||null===(o=j[0])||void 0===o?void 0:o.id)||"createdTime";let Y=window.Digit.Utils.browser.isMobile(),X=Y?{limit:100,offset:0,sortBy:q,sortOrder:null!=j&&null!==(a=j[0])&&void 0!==a&&a.desc?"DESC":"ASC"}:{limit:W,offset:M,sortBy:q,sortOrder:null!=j&&null!==(r=j[0])&&void 0!==r&&r.desc?"DESC":"ASC"};const Q=u?Digit.Hooks.useNewInboxGeneral({tenantId:A,ModuleCode:m,filters:c({},K,X,{sortParams:j})}):Digit.Hooks.useInboxGeneral({tenantId:A,businessService:m,isInbox:_,filters:c({},K,X,{sortParams:j}),rawWfHandler:h,rawSearchHandler:y,combineResponse:T,wfConfig:S,searchConfig:c({},L,b),middlewaresWf:N,middlewareSearch:D}),Z=Q.isLoading,J=Q.data,$=Q.searchFields,ee=v(Q,se);l.useEffect(()=>{null!=ee&&ee.revalidate&&(null==ee||ee.revalidate()),null!=ee&&ee.refetch&&(null==ee||ee.refetch())},[]),l.useEffect(()=>{F(0)},[K]);const te=e=>{let t=e.delete,l=c({},K,e);t&&t.forEach(e=>delete l[e]),delete e.delete,G(c({},l)),P({enabled:!0})},le=l.useCallback(e=>{var t;Array.isArray(e)&&0!==e.length&&null!==(t=e[0])&&void 0!==t&&t.id&&V(e)},[]),ne=l.useCallback(()=>{var e,t,l,n;const i={WT:"request-service.water_tanker",MT:"request-service.mobile_toilet",TP:"request-service.tree_pruning"},o={moduleName:i[m]||i.WT},a={isInboxSearch:!0,creationReason:[""]},r="ASSIGNED_TO_ME"===(null==K||null===(e=K.uuid)||void 0===e?void 0:e.code),d=null===(t=Digit.UserService.getUser())||void 0===t||null===(l=t.info)||void 0===l?void 0:l.uuid;if(r&&d&&(o.assignee=d),Array.isArray(null==K?void 0:K.services)&&K.services.length>0&&(o.businessService=K.services),Array.isArray(null==K?void 0:K.applicationStatus)&&K.applicationStatus.length>0){const e=K.applicationStatus.map(e=>null==e?void 0:e.uuid).filter(Boolean);e.length>0&&(o.status=e)}return null!=K&&K.mobileNumber&&(a.mobileNumber=K.mobileNumber),null!=K&&K.bookingNo&&(a.bookingNo=K.bookingNo),null!=K&&K.vendorName&&(a.vendorName=K.vendorName),null!=K&&K.vehicleName&&(a.vehicleName=K.vehicleName),null!=K&&K.driverName&&(a.driverName=K.driverName),null!=K&&K.fillingPointId&&(a.fillingPointId=K.fillingPointId),Array.isArray(null==K?void 0:K.locality)&&K.locality.length>0&&(a.locality=K.locality.map(e=>String((null==e?void 0:e.code)||"").split("_").pop()).filter(Boolean)),Array.isArray(j)&&null!==(n=j[0])&&void 0!==n&&n.id&&(a.sortBy=ce[j[0].id]||j[0].id,a.sortOrder=j[0].desc?"DESC":"ASC"),{workflowFilters:o,moduleSearchCriteria:a}},[m,K,j]),ie=l.useCallback(function(){try{var e,t;let l=!1;if(!u||"function"!=typeof(null===(e=Digit)||void 0===e||null===(t=e.InboxGeneral)||void 0===t?void 0:t.Search))return Promise.resolve(Array.isArray(J)?J:[]);const n=ne(),i=n.workflowFilters,o=n.moduleSearchCriteria,a=200;let r=0,d=Number.POSITIVE_INFINITY;const s=[],c=I(function(){return!l&&r<d},void 0,function(){return Promise.resolve(Digit.InboxGeneral.Search({inbox:{tenantId:A,processSearchCriteria:i,moduleSearchCriteria:o,limit:a,offset:r}})).then(function(e){const t=Array.isArray(null==e?void 0:e.items)?e.items:[],n=t.map(t=>({searchData:(null==t?void 0:t.businessObject)||{},workflowData:(null==t?void 0:t.ProcessInstance)||{},statusMap:null==e?void 0:e.statusMap,totalCount:null==e?void 0:e.totalCount}));s.push(...n);const i=Number(null==e?void 0:e.totalCount);d=Number.isFinite(i)&&i>=0?i:s.length,0===t.length||t.length<a?l=!0:r+=t.length})});return Promise.resolve(c&&c.then?c.then(function(){return s}):s)}catch(e){return Promise.reject(e)}},[ne,J,A,u]);var ae;if(null!==(null==ee||null===(d=ee.data)||void 0===d?void 0:d.length))return Y?n.createElement(ue,{data:J,isLoading:Z,isSearch:!_,searchFields:$,onFilterChange:te,onSearch:te,onSort:le,parentRoute:s,searchParams:K,sortParams:j,linkPrefix:s+"/application-details/",tableConfig:null!=ee&&ee.tableConfig?ee.tableConfig:R(O)[m],filterComponent:g,EmptyResultInboxComp:C,useNewInboxAPI:u}):n.createElement("div",{className:"app-container",style:{padding:"CITIZEN"===(null==x?void 0:x.type)?"0 24px":""}},n.createElement(oe,{moduleCode:m,detailRoute:p,data:J,tableConfig:R(O)[m],isLoading:Z,defaultSearchParams:f.searchParams,isSearch:!_,onFilterChange:te,searchFields:$,onSearch:te,onSort:le,onNextPage:()=>{F(e=>e+W)},onPrevPage:()=>{F(e=>e-W)},currentPage:Math.floor(M/W),pageSizeLimit:W,disableSort:!1,onPageSizeChange:e=>{U(Number(e.target.value))},parentRoute:s,searchParams:K,sortParams:j,totalRecords:Number(null==J||null===(ae=J[0])||void 0===ae?void 0:ae.totalCount),filterComponent:g,EmptyResultInboxComp:C,useNewInboxAPI:u,getCSVExportData:ie}))},me=e=>{let i=e.t,o=e.closeModal,a=e.onSubmit,d=e.initialValues;const u=new Date,s=String(u.getHours()).padStart(2,"0")+":"+String(u.getMinutes()).padStart(2,"0"),v=Boolean(d),m=e=>null==e?"":String(e).trim().toLowerCase(),p=e=>{const t=void 0!==(null==e?void 0:e.value)?e.value:e;if("string"==typeof t){const e=t.trim().toUpperCase();return"TRUE"===e||"YES"===e||"Y"===e}return Boolean(t)},E=d?c({},d,{arrivalTimeFpl:d.arrivalTimeFpl||d.arrival_time_to_fpl||s,departureTimeFpl:d.departureTimeFpl||d.departure_time_from_fpl||s,arrivalFixedPoint:d.arrivalFixedPoint||d.arrival_time_delivery_point||s,departureFixedPoint:d.departureFixedPoint||d.departure_time_delivery_point||s,returnFpl:d.returnFpl||d.time_of_arriving_back_fpl_after_delivery||s,frequencyNo:d.frequencyNo||d.trip_no||1,vehicleId:d.vehicleId||d.vehicle_id||"",fixedPointCode:d.fixedPointCode||d.fixed_point_code||d.fixedPointId||"",fillingPointCode:d.fillingPointCode||d.fillingPointId||"",day:d.day||[],volume:d.volume||d.volume_water_tobe_delivery||"",remarks:d.remarks||"",active:p(d.active)}):{fixedPointCode:"",fillingPointCode:"",day:[],arrivalTimeFpl:s,departureTimeFpl:s,arrivalFixedPoint:s,departureFixedPoint:s,returnFpl:s,volume:"",remarks:"",frequencyNo:1,active:!0},f=r.useForm({defaultValues:E}),g=f.handleSubmit,_=f.control,h=f.watch,y=Digit.ULBService.getCurrentTenantId(),T=l.useState(""),S=T[0],b=T[1],N=l.useState(""),I=N[0],D=N[1];l.useEffect(()=>{const e=setTimeout(()=>{D(S)},500);return()=>clearTimeout(e)},[S]);const C=l.useCallback(e=>{b(e)},[]),A=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:y,filters:c({limit:1e3},I?{name:I}:{})},{keepPreviousData:!0}),x=A.isLoading,O=A.data,w=Digit.Hooks.wt.useFillPointSearch({tenantId:y,filters:{limit:1e3}}),L=w.isLoading,P=w.data,R=[...(null==O?void 0:O.waterTankerBookingDetail)||[],...(null==O?void 0:O.fixedPointTimeTableDetails)||[],...(null==O?void 0:O.fixedPoints)||[]],k=(null==P?void 0:P.fillingPoints)||[],M=(null==d?void 0:d.fixedPointCode)||(null==d?void 0:d.fixed_point_code)||(null==d?void 0:d.fixedPointId)||"",F=(null==d?void 0:d.fixedPointName)||M||"NA",B=R.map(e=>{var t,l,n,o,a,r,d,u,s,c;const v=(null==e?void 0:e.fixedPointCode)||(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.fixedPointId)||(null==e?void 0:e.fixedPointId)||(null==e?void 0:e.code)||(null==e?void 0:e.id)||"",m=(null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.fixedPointId)||(null==e?void 0:e.fixedPointId)||(null==e?void 0:e.id)||v,p=(null==e||null===(n=e.applicantDetail)||void 0===n?void 0:n.applicantId)||(null==e?void 0:e.id)||(null==e?void 0:e.bookingId)||v,E=(null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.name)||(null==e?void 0:e.fixedPointName)||(null==e?void 0:e.name)||v||"NA",f=v?E+" ("+v+")":E,g=(null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.mobileNumber)||(null==e?void 0:e.mobileNumber)||"NA",_=(null==e||null===(r=e.address)||void 0===r?void 0:r.locality)||(null==e?void 0:e.locality)||"NA";return{name:f,mobileNumber:g,locality:_,displayLabel:f+" | "+g+" | "+_,value:p,code:v,id:m,fullAddress:[(null==e||null===(d=e.address)||void 0===d?void 0:d.houseNo)&&i("WT_HOUSE_NO")+" = "+e.address.houseNo,(null==e||null===(u=e.address)||void 0===u?void 0:u.streetName)&&i("WT_STREET_NAME")+" = "+e.address.streetName,(null==e||null===(s=e.address)||void 0===s?void 0:s.landmark)&&i("WT_LANDMARK")+" = "+e.address.landmark,(null==e||null===(c=e.address)||void 0===c?void 0:c.locality)&&i("WT_LOCALITY")+" = "+e.address.locality].filter(Boolean).join(", ")}}).reduce((e,t)=>(e.some(e=>[e.value,e.code,e.id].some(e=>[t.value,t.code,t.id].some(t=>m(e)===m(t))))||e.push(t),e),[]),W=M&&B.some(e=>[e.value,e.code,e.id].some(e=>m(e)===m(M)));if(M&&!W){const e=M&&m(F)!==m(M)?F+" ("+M+")":F;B.unshift({name:e,mobileNumber:"NA",locality:"NA",displayLabel:e+" | NA | NA",value:M,code:M,id:(null==d?void 0:d.fixedPointId)||M,fullAddress:""})}const U=e=>B.find(t=>[t.value,t.code,t.id].some(t=>m(t)===m(e))),H=k.map(e=>({displayLabel:(null==e?void 0:e.fillingPointName)||"NA",value:(null==e?void 0:e.fillingPointId)||(null==e?void 0:e.id),eeName:(null==e?void 0:e.eeName)||"NA",aeName:(null==e?void 0:e.aeName)||"NA"})),j=h("fixedPointCode"),V=U(j),z=[{label:i("MONDAY"),value:"MONDAY"},{label:i("TUESDAY"),value:"TUESDAY"},{label:i("WEDNESDAY"),value:"WEDNESDAY"},{label:i("THURSDAY"),value:"THURSDAY"},{label:i("FRIDAY"),value:"FRIDAY"},{label:i("SATURDAY"),value:"SATURDAY"},{label:i("SUNDAY"),value:"SUNDAY"}],K=[{label:"true",value:!0},{label:"false",value:!1}];return h(),n.createElement("div",{className:"custom-modal-overlay",style:{position:"fixed",top:30,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2e5}},n.createElement("style",null,"\n\n .custom-modal-content {\n\n background-color: #fff;\n\n border-radius: 8px;\n\n width: 70%;\n\n max-width: 800px;\n\n max-height: 90vh;\n\n display: flex;\n\n flex-direction: column;\n\n box-shadow: 0 4px 12px rgba(0,0,0,0.15);\n\n position: relative;\n\n }\n\n .add-trip-form {\n\n display: grid;\n\n grid-template-columns: repeat(2, 1fr);\n\n gap: 20px;\n\n }\n\n @media (max-width: 768px) {\n\n .custom-modal-content {\n\n width: 90%;\n\n max-height: 85vh;\n\n }\n\n .add-trip-form {\n\n grid-template-columns: 1fr;\n\n gap: 15px;\n\n }\n\n }\n\n @media (max-width: 480px) {\n\n .custom-modal-content {\n\n width: 95%;\n\n max-height: 95vh;\n\n }\n\n .custom-modal-body {\n\n padding: 15px !important;\n\n }\n\n .custom-modal-footer {\n\n padding: 12px 15px !important;\n\n flex-direction: row;\n\n justify-content: flex-end;\n\n }\n\n .custom-modal-header {\n\n padding: 12px 15px !important;\n\n }\n\n .custom-modal-header h1 {\n\n font-size: 18px !important;\n\n }\n\n }\n\n @media (max-width: 320px) {\n\n .custom-modal-footer {\n\n flex-direction: column-reverse;\n\n align-items: stretch;\n\n }\n\n .custom-modal-footer button {\n\n width: 100%;\n\n }\n\n }\n\n "),n.createElement("div",{className:"custom-modal-content"},n.createElement("div",{className:"custom-modal-header",style:{padding:"16px 24px",borderBottom:"1px solid #eee",display:"flex",justifyContent:"space-between",alignItems:"center"}},n.createElement("h1",{style:{margin:0,fontSize:"20px",fontWeight:"600",color:"#1D4E7F"}},i(d?"WT_EDIT_TRIP":"WT_ADD_TRIP")),n.createElement("button",{onClick:o,style:{background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×")),n.createElement("div",{className:"custom-modal-body",style:{padding:"24px",overflowY:"auto"}},n.createElement("div",{className:"add-trip-form"},n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_FIXED_POINT_CODE")),x?n.createElement(t.Loader,null):n.createElement(r.Controller,{control:_,name:"fixedPointCode",defaultValue:E.fixedPointCode||E.fixedPointId||"",render:e=>n.createElement(t.CustomNameDropdown,{option:B,optionKey:"displayLabel",selected:U(e.value),select:t=>e.onChange(t.code||t.id||t.value),t:i,optionsHeader:{name:"WT_NAME",mobileNumber:"WT_MOBILE_NUMBER",locality:"WT_LOCALITY"},onSearch:C})}),(null==V?void 0:V.fullAddress)&&n.createElement("div",{style:{marginTop:"8px",padding:"10px",backgroundColor:"#f9f9f9",border:"1px solid #ddd",borderRadius:"4px",fontSize:"14px",color:"#555"}},n.createElement("strong",null,i("WT_ADDRESS"),":")," ",V.fullAddress)),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_FILLING_POINT")),L?n.createElement(t.Loader,null):n.createElement(r.Controller,{control:_,name:"fillingPointCode",defaultValue:E.fillingPointCode,render:e=>n.createElement(t.CustomNameDropdown,{option:H,optionKey:"displayLabel",selected:H.find(t=>t.value===e.value),select:t=>e.onChange(t.value),t:i})})),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_DAY")),n.createElement(r.Controller,{control:_,name:"day",render:e=>n.createElement(t.MultiSelectDropdown,{options:z,optionsKey:"label",selected:z.filter(t=>(e.value||[]).some(e=>e===t.value||(null==e?void 0:e.value)===t.value)),onSelect:t=>{const l=(t||[]).map(e=>null!=e&&e[1]?e[1]:(null==e?void 0:e.value)||e);e.onChange(l)},t:i,defaultLabel:i("WT_SELECT_DAYS"),defaultUnit:i("WT_DAYS"),ServerStyle:{backgroundColor:"#fff",zIndex:1e3,border:"1px solid #ccc",boxShadow:"0px 4px 6px rgba(0,0,0,0.1)",borderRadius:"4px"}})})),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_ARRIVAL_TIME_TO_FPL")),n.createElement(r.Controller,{control:_,name:"arrivalTimeFpl",defaultValue:E.arrivalTimeFpl,render:e=>n.createElement(t.TextInput,{type:"time",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_DEPARTURE_TIME_FROM_FPL")),n.createElement(r.Controller,{control:_,name:"departureTimeFpl",defaultValue:E.departureTimeFpl,render:e=>n.createElement(t.TextInput,{type:"time",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_ARRIVAL_AT_FIXED_POINT")),n.createElement(r.Controller,{control:_,name:"arrivalFixedPoint",defaultValue:E.arrivalFixedPoint,render:e=>n.createElement(t.TextInput,{type:"time",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_DEPARTURE_AT_FIXED_POINT")),n.createElement(r.Controller,{control:_,name:"departureFixedPoint",defaultValue:E.departureFixedPoint,render:e=>n.createElement(t.TextInput,{type:"time",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_RETURN_TO_FPL")),n.createElement(r.Controller,{control:_,name:"returnFpl",defaultValue:E.returnFpl,render:e=>n.createElement(t.TextInput,{type:"time",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_VOLUME")),n.createElement(r.Controller,{control:_,name:"volume",defaultValue:E.volume,render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),v&&n.createElement("div",{className:"field-group"},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_ACTIVE")),n.createElement(r.Controller,{control:_,name:"active",defaultValue:E.active,render:e=>n.createElement(t.CustomNameDropdown,{option:K,optionKey:"label",selected:K.find(t=>t.value===p(e.value))||K[0],select:t=>e.onChange(t.value),t:i})})),n.createElement("div",{className:"field-group remarks-field-group",style:{gridColumn:"span 2"}},n.createElement(t.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},i("WT_REMARKS")),n.createElement(r.Controller,{control:_,name:"remarks",defaultValue:E.remarks,render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})))),n.createElement("div",{className:"custom-modal-footer",style:{padding:"16px 24px",borderTop:"1px solid #eee",display:"flex",justifyContent:"flex-end",gap:"12px"}},n.createElement("button",{className:"button-cancel",onClick:o,style:{padding:"8px 20px",border:"1px solid #ccc",background:"#f4f4f4",borderRadius:"4px",cursor:"pointer"}},i("CS_COMMON_CANCEL")),n.createElement("button",{className:"button-save",onClick:g(e=>{const t=U(e.fixedPointCode),l=c({},e,{fixedPointId:t?t.id:(null==d?void 0:d.fixedPointId)||"",fixedPointCode:t?t.code:e.fixedPointCode||(null==d?void 0:d.fixedPointCode)||""});a(l)}),style:{padding:"8px 20px",background:"#1D4E7F",color:"#ffffffff",border:"none",borderRadius:"4px",cursor:"pointer"}},i(d?"WT_UPDATE":"CS_COMMON_SAVE")))))},pe=e=>{if(!e)return e;if(e.includes("AM")||e.includes("PM"))return e;const t=e.split(":");if(t.length<2)return e;let l=parseInt(t[0],10);const n=l>=12?"PM":"AM";return l=l%12||12,(l<10?"0"+l:l)+":"+t[1]+" "+n},Ee=e=>{if(!e)return e;const t=e.match(/^(\d{2}):(\d{2})\s?(AM|PM)$/i);if(!t)return e;let l=t[1],n=t[2],i=t[3];return l=parseInt(l,10),"PM"===i.toUpperCase()&&l<12&&(l+=12),"AM"===i.toUpperCase()&&12===l&&(l=0),(l<10?"0"+l:l)+":"+n},fe=e=>{var o;let r=c({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));const d=i.useTranslation().t,u=a.useQueryClient(),s=Digit.ULBService.getCurrentTenantId(),v=l.useState(!1),m=v[0],p=v[1],E=l.useState(null),f=E[0],g=E[1],_=l.useState("all"),h=_[0],y=_[1],T=l.useState({label:"All Fixed Points",value:"all"}),S=T[0],b=T[1],N=l.useState({label:"All Days",value:"all"}),D=N[0],C=N[1],A=l.useState({label:"All Status",value:"all"}),x=A[0],O=A[1],w=l.useState(null),L=w[0],P=w[1],R=l.useState(0),k=R[0],M=R[1],F=l.useState(10),B=F[0],W=F[1],U=l.useState({limit:10,offset:0}),H=U[0],j=U[1],V=Digit.Hooks.wt.useFixedPointScheduleSearch(s,H),z=V.isLoading,K=V.data,q=V.refetch;l.useEffect(()=>{q&&q()},[]);const Y=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:s,filters:{offset:0,limit:100}}).data,X=n.useMemo(()=>c({},H,{limit:1e3,offset:0}),[H]),Q=Digit.Hooks.wt.useFixedPointScheduleSearch(s,X).data,Z=n.useMemo(()=>{const e=[...(null==Y?void 0:Y.fixedPointTimeTableDetails)||(null==Y?void 0:Y.waterTankerBookingDetail)||(null==Y?void 0:Y.fixedPoints)||[],...(null==Q?void 0:Q.fixedPointTimeTableDetails)||[]].map(e=>{var t,l,n;return{label:e.fixedPointCode||(null===(t=e.applicantDetail)||void 0===t?void 0:t.fixedPointId)||e.name||(null===(l=e.applicantDetail)||void 0===l?void 0:l.name)||e.bookingId,value:e.fixedPointCode||(null===(n=e.applicantDetail)||void 0===n?void 0:n.fixedPointId)||e.bookingId}}).filter(e=>e.label&&e.value).filter((e,t,l)=>l.findIndex(t=>t.value===e.value)===t);return[{label:"WT_ALL_FIXED_POINTS"!==d("WT_ALL_FIXED_POINTS")?d("WT_ALL_FIXED_POINTS"):"All Fixed Points",value:"all"},...e]},[Y,Q,d]);console.log(Z,"fixedPoints"),console.log(Y,"fixedPointData");const J=Digit.Hooks.wt.useCreateFixedPointSchedule(s).mutate,$=Digit.Hooks.wt.useUpdateFixedPointSchedule(s).mutate,ee=()=>{g(null)},te=n.useCallback(function(e){return void 0===e&&(e=[]),e.map(e=>({scheduleId:e.systemAssignedScheduleId,fixedPointName:e.fixedPointName,fixedPoint:e.fixedPointCode||e.fixedPointId,fixedPointId:e.fixedPointId||e.id||null,day:e.day,freq:e.tripNo,arrToFpl:e.arrivalTimeToFpl,depFromFpl:e.departureTimeFromFpl,arrAtFixedPoint:e.arrivalTimeDeliveryPoint,depAtFixedPoint:e.departureTimeDeliveryPoint,returnToFpl:e.timeOfArrivingBackFplAfterDelivery,volume:e.volumeWaterTobeDelivery,vehicle:e.vehicleId,active:e.isEnable?"Y":"N",totalCount:e.totalCount,fillingPointId:e.fillingPointId}))},[]),le=n.useMemo(()=>({MONDAY:1,TUESDAY:2,WEDNESDAY:3,THURSDAY:4,FRIDAY:5,SATURDAY:6,SUNDAY:7}),[]),ne=n.useMemo(()=>te((null==K?void 0:K.fixedPointTimeTableDetails)||[]).sort((e,t)=>{var l,n;const i=(e.fixedPoint||"").localeCompare(t.fixedPoint||"");return 0!==i?i:(le[null===(l=e.day)||void 0===l?void 0:l.toUpperCase()]||8)-(le[null===(n=t.day)||void 0===n?void 0:n.toUpperCase()]||8)}),[K,te,le]),ie=function(e,t){var l;void 0===e&&(e=null),void 0===t&&(t=null);const n=e||{fixedPointCode:"all"===(null==S?void 0:S.value)?"":null==S?void 0:S.value,day:"all"===(null==D?void 0:D.value)?"":null==D||null===(l=D.value)||void 0===l?void 0:l.toUpperCase(),status:"all"===(null==x?void 0:x.value)?"":null==x?void 0:x.value},i=null!==t?t:0;null===t&&M(0),j(e=>c({},n,{limit:e.limit,offset:i}))},oe=n.useMemo(()=>[{Header:d("WT_FIXED_POINT_CODE"),accessor:"fixedPoint"},{Header:d("WT_FIXED_POINT_NAME"),accessor:"fixedPointName"},{Header:d("WT_DAY"),accessor:"day"},{Header:d("WT_ARR_TO_FPL"),accessor:"arrToFpl"},{Header:d("WT_DEP_FROM_FPL"),accessor:"depFromFpl"},{Header:d("WT_ARR_AT_FIXED_POINT"),accessor:"arrAtFixedPoint"},{Header:d("WT_DEP_AT_FIXED_POINT"),accessor:"depAtFixedPoint"},{Header:d("WT_RETURN_TO_FPL"),accessor:"returnToFpl"},{Header:d("WT_VOLUME"),accessor:"volume"},{Header:d("WT_ACTIVE"),accessor:"active",Cell:e=>{let t=e.value;return n.createElement("span",{style:{background:"Y"===t?"#E6F4EA":"#FCE8E6",padding:"2px 8px",borderRadius:"10px",color:"Y"===t?"#1E8E3E":"#D93025"}},t)}},{Header:d("WT_ACTION"),Cell:e=>{let t=e.row;return n.createElement("div",{style:{display:"flex",gap:"5px"}},n.createElement("button",{onClick:()=>{P(t.index),p(!0)},style:{color:"#1D4E7F",border:"1px solid #1D4E7F",background:"none",padding:"2px 8px",cursor:"pointer"}},d("WT_EDIT")))}}],[d]),ae=n.useCallback(function(){try{let t=!1;function e(){return te(a)}const l=c({},H||{});delete l.limit,delete l.offset;const n=200;let i=0,o=Number.POSITIVE_INFINITY;const a=[],r=I(function(){return!t&&i<o},void 0,function(){return Promise.resolve(Digit.WTService.SearchFixedPointSchedule({tenantId:s,filters:c({},l,{limit:n,offset:i})})).then(function(e){var l,r;const d=(null==e?void 0:e.fixedPointTimeTableDetails)||[];a.push(...d);const u=Number(null!=(l=null!=(r=null==e?void 0:e.count)?r:null==e?void 0:e.totalCount)?l:null==e?void 0:e.Count);o=Number.isFinite(u)&&u>=0?u:a.length,!d.length||d.length<n?t=!0:i+=d.length})});return Promise.resolve(r&&r.then?r.then(e):e())}catch(e){return Promise.reject(e)}},[H,te,s]),re=n.useMemo(()=>[{Header:d("WT_SCHEDULE_ID"),accessor:"scheduleId"},{Header:d("WT_FIXED_POINT"),accessor:"fixedPoint"},{Header:d("WT_DAY"),accessor:"day"},{Header:d("WT_FREQ"),accessor:"freq"},{Header:d("WT_ARR_TO_FPL"),accessor:"arrToFpl"},{Header:d("WT_DEP_FROM_FPL"),accessor:"depFromFpl"},{Header:d("WT_ARR_AT_FIXED_POINT"),accessor:"arrAtFixedPoint"},{Header:d("WT_DEP_AT_FIXED_POINT"),accessor:"depAtFixedPoint"},{Header:d("WT_RETURN_TO_FPL"),accessor:"returnToFpl"},{Header:d("WT_VOLUME"),accessor:"volume"},{Header:d("WT_ACTIVE"),accessor:"active"}],[d]);return n.createElement("div",{className:"fixed-point-schedule-management"},n.createElement(t.Card,{style:{padding:"20px"}},n.createElement("div",{className:"finance-mainlayout",style:{marginBottom:"20px"}},n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.CardLabel,null,d("WT_EXPORT")),n.createElement(t.Dropdown,{option:[{label:d("WT_EXCEL_WEEKWISE"),value:"Weekwise"},{label:d("WT_EXCEL_MONTHWISE"),value:"Monthwise"},{label:d("WT_EXCEL_YEARWISE"),value:"Yearwise"}],optionKey:"label",placeholder:d("WT_EXPORT"),t:d,select:e=>{const t=new Date,l=t.getDate()+"-"+(t.getMonth()+1)+"-"+t.getFullYear(),n="FixedPointSchedule_"+e.value+"_"+l,i=(null==Q?void 0:Q.fixedPointTimeTableDetails)||[],o=[[d("WT_SCHEDULE_ID"),d("WT_FIXED_POINT"),d("WT_DAY"),d("WT_FREQ"),d("WT_ARR_TO_FPL"),d("WT_DEP_FROM_FPL"),d("WT_ARR_AT_FIXED_POINT"),d("WT_DEP_AT_FIXED_POINT"),d("WT_RETURN_TO_FPL"),d("WT_VOLUME"),d("WT_VEHICLE"),d("WT_ACTIVE")],...i.map(e=>[e.systemAssignedScheduleId,e.fixedPointCode,d(e.day),e.tripNo,e.arrivalTimeToFpl,e.departureTimeFromFpl,e.arrivalTimeDeliveryPoint,e.departureTimeDeliveryPoint,e.timeOfArrivingBackFplAfterDelivery,e.volumeWaterTobeDelivery,e.vehicleId,e.isEnable?"Y":"N"])];if(window.Digit&&window.Digit.Download&&window.Digit.Download.Excel)window.Digit.Download.Excel(o,n);else{const e=o.map(e=>e.map(e=>'"'+(""+(null==e?"":e)).replace(/"/g,'\\"')+'"').join(",")),t=new Blob([e.join("\n")],{type:"text/csv"}),l=window.URL.createObjectURL(t),i=document.createElement("a");i.setAttribute("hidden",""),i.setAttribute("href",l),i.setAttribute("download",n+".csv"),document.body.appendChild(i),i.click(),document.body.removeChild(i)}}})),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.CardLabel,null,d("WT_FIXED_POINT")),n.createElement(t.Dropdown,{option:Z,optionKey:"label",selected:S,t:d,select:e=>{b(e)},placeholder:d("WT_ALL_FIXED_POINTS")})),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.CardLabel,null,d("WT_DAY")),n.createElement(t.Dropdown,{option:[{label:"All Days",value:"all"},{label:d("MONDAY"),value:"MONDAY"},{label:d("TUESDAY"),value:"TUESDAY"},{label:d("WEDNESDAY"),value:"WEDNESDAY"},{label:d("THURSDAY"),value:"THURSDAY"},{label:d("FRIDAY"),value:"FRIDAY"},{label:d("SATURDAY"),value:"SATURDAY"},{label:d("SUNDAY"),value:"SUNDAY"}],optionKey:"label",selected:D,t:d,select:e=>{var t;C(e),y(e.value),ie({fixedPointCode:"all"===(null==S?void 0:S.value)?"":null==S?void 0:S.value,day:"all"===(null==e?void 0:e.value)?"":null==e||null===(t=e.value)||void 0===t?void 0:t.toUpperCase(),status:"all"===(null==x?void 0:x.value)?"":null==x?void 0:x.value})},placeholder:"All Days"})),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.CardLabel,null,d("WT_STATUS")),n.createElement(t.Dropdown,{option:[{label:"All Status",value:"all"},{label:"Active",value:"Active"},{label:"Inactive",value:"Inactive"}],optionKey:"label",selected:x,t:d,select:e=>{var t;O(e),ie({fixedPointCode:"all"===(null==S?void 0:S.value)?"":null==S?void 0:S.value,day:"all"===(null==D?void 0:D.value)?"":null==D||null===(t=D.value)||void 0===t?void 0:t.toUpperCase(),status:"all"===(null==e?void 0:e.value)?"":null==e?void 0:e.value})},placeholder:"All Status"})),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null," "),n.createElement("span",{className:"generic-button clear-search",onClick:()=>{y("all"),C({label:"All Days",value:"all"}),b({label:"All Fixed Points",value:"all"}),O({label:"All Status",value:"all"}),M(0),j({limit:B,offset:0})},style:{alignSelf:"center"}},d("ES_COMMON_CLEAR_SEARCH"))),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null," "),n.createElement(t.SubmitBar,{label:d("ES_COMMON_SEARCH"),onSubmit:()=>ie()}))),n.createElement("div",{style:{display:"flex",gap:"5px",marginBottom:"20px",flexWrap:"wrap"}},["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"].map(e=>n.createElement("button",{key:e,onClick:()=>{y(e),C({label:e,value:e}),ie({fixedPointCode:"all"===(null==S?void 0:S.value)?"":null==S?void 0:S.value,day:e.toUpperCase(),status:"all"===(null==x?void 0:x.value)?"":null==x?void 0:x.value})},style:{padding:"8px 16px",border:"1px solid #ccc",borderRadius:"4px",background:h===e?"#1D4E7F":"#fff",color:h===e?"#fff":"#333",cursor:"pointer"}},d(e.toUpperCase())))),n.createElement("span",null,n.createElement("button",{onClick:()=>{P(null),p(!0)},style:{background:"#1E8E3E",color:"#fff",border:"none",padding:"10px 20px",borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",gap:"5px",marginBottom:"10px"}},n.createElement("span",null,"+")," ",d("WT_ADD_TRIP"))),n.createElement("div",{style:{width:"100%",overflowX:"auto"}},n.createElement(G,{t:d,data:ne,columns:oe,getCellProps:e=>({}),styles:{minWidth:"1200px"},inboxStyles:{overflowX:"auto"},isLoading:z,onPageSizeChange:e=>{const t=Number(e.target.value);W(t),M(0),j(e=>c({},e,{limit:t,offset:0}))},currentPage:Math.floor(k/B),onNextPage:()=>{const e=k+B;M(e),j(t=>c({},t,{offset:e}))},onPrevPage:()=>{const e=Math.max(0,k-B);M(e),j(t=>c({},t,{offset:e}))},pageSizeLimit:B,onSort:r.onSort,disableSort:!0,sortParams:r.sortParams,totalRecords:(null==K?void 0:K.count)||(null==K?void 0:K.totalCount)||(null==ne||null===(o=ne[0])||void 0===o?void 0:o.totalCount),showCSVExport:!0,getCSVExportData:ae,csvExportColumns:re,csvExportFileName:"wt-fixed-point-schedule"}))),m&&n.createElement(me,{t:d,closeModal:()=>{p(!1),P(null)},initialValues:null!==L?{scheduleId:ne[L].scheduleId,fixedPointCode:ne[L].fixedPoint,fixedPointId:ne[L].fixedPointId,fillingPointCode:ne[L].fillingPointId,day:[{label:d(ne[L].day),value:ne[L].day}],frequencyNo:ne[L].freq,arrivalTimeFpl:Ee(ne[L].arrToFpl),departureTimeFpl:Ee(ne[L].depFromFpl),arrivalFixedPoint:Ee(ne[L].arrAtFixedPoint),departureFixedPoint:Ee(ne[L].depAtFixedPoint),returnFpl:Ee(ne[L].returnToFpl),volume:ne[L].volume,vehicleId:ne[L].vehicle,active:{label:d("Y"===ne[L].active?"YES":"NO"),value:"Y"===ne[L].active?"Yes":"No"}}:null,onSubmit:e=>{var t,l,n;console.log(e,"dsdsdsdsdsdsds");const i=null==e?void 0:e.day;let o=[];if(Array.isArray(i))o=i.map(e=>"string"==typeof e?e:(null==e?void 0:e.value)||e).filter(e=>e&&"WT_SELECT_ALL"!==e);else if(i){const e=(null==i?void 0:i.value)||i;e&&"WT_SELECT_ALL"!==e&&(o=[e])}const a=null!==L?ne[L]:{},r="Yes"===(null===(t=e.active)||void 0===t?void 0:t.value)||"Yes"===e.active||!0===e.active,c=void 0!==e.active?r:null===L||"Y"===(null==a?void 0:a.active),v={system_assigned_schedule_id:e.scheduleId||a.scheduleId||null,fixed_point_code:e.fixedPointId||e.fixedPointCode||"",fillingPointId:e.fillingPointCode||e.fillingPointId||null,day:o.map(e=>e.toUpperCase()),trip_no:Number(e.frequencyNo)||1,arrival_time_to_fpl:pe(e.arrivalTimeFpl),departure_time_from_fpl:pe(e.departureTimeFpl),arrival_time_delivery_point:pe(e.arrivalFixedPoint),departure_time_delivery_point:pe(e.departureFixedPoint),time_of_arriving_back_fpl_after_delivery:pe(e.returnFpl),volume_water_tobe_delivery:e.volume,active:c,is_enable:c,remarks:e.remarks||"",vehicle_id:e.vehicleId||a.vehicle||null,audit_details:(null==K||null===(l=K.fixedPointTimeTableDetails)||void 0===l||null===(n=l[L])||void 0===n?void 0:n.auditDetails)||null};v.system_assigned_schedule_id||delete v.system_assigned_schedule_id,v.vehicle_id||delete v.vehicle_id,v.audit_details||delete v.audit_details;const m=null!==L?{fixedPointDetailsList:[v]}:{fixedPointDetails:v},E={onError:e=>{var t,l,n,i,o,a,r;const d=(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.error)||void 0===n?void 0:n.message)||(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.message)||(null==e?void 0:e.message)||"Operation Failed";g({key:"error",label:d}),setTimeout(ee,5e3)},onSuccess:e=>{var t;if(null!=e&&e.error||null!=e&&null!==(t=e.data)&&void 0!==t&&t.error){var l,n,i;const t=(null==e||null===(l=e.error)||void 0===l?void 0:l.message)||(null==e||null===(n=e.data)||void 0===n||null===(i=n.error)||void 0===i?void 0:i.message)||"Operation Failed";g({key:"error",label:t}),setTimeout(ee,5e3)}else g({label:d(null!==L?"WT_SCHEDULE_UPDATE_SUCCESS":"WT_SCHEDULE_CREATE_SUCCESS")}),p(!1),P(null),u.invalidateQueries(["FIXED_POINT_SCHEDULE_SEARCH",s])}};null!==L?$(m,E):J(m,E)}}),f&&n.createElement("div",{style:{position:"fixed",zIndex:3e5}},n.createElement(t.Toast,{error:"error"===f.key,label:f.label,onClose:ee})))},ge=new Map,_e=function(e,t){try{if(null==e||null==t)return Promise.resolve(null);const l=e.toFixed(5)+","+t.toFixed(5);return ge.has(l)?Promise.resolve(ge.get(l)):Promise.resolve(D(function(){return Promise.resolve(fetch("https://nominatim.openstreetmap.org/reverse?format=json&lat="+e+"&lon="+t+"&zoom=18&addressdetails=1",{headers:{"Accept-Language":"en","User-Agent":"Digit-UI-WT-Module"}})).then(function(e){if(!e.ok)throw new Error("Geocoding failed: "+e.statusText);return Promise.resolve(e.json()).then(function(e){return ge.set(l,e),e})})},function(e){return console.error("Error in reverseGeocode:",e),null}))}catch(e){return Promise.reject(e)}},he=function(e,t){if(void 0===t&&(t=!1),!e)return"Unknown Address";if(t&&e.display_name)return e.display_name;if(!e.address)return e.display_name||"Unknown Address";const l=e.address,n=[l.house_number||l.amenity,l.road,l.suburb||l.neighbourhood||l.village,l.city_district||l.city||l.town,l.state,l.postcode].filter(Boolean);return n.length>0?n.join(", "):e.display_name||"Unknown Address"},ye=(e,t,l,n)=>{const i=Te(l-e),o=Te(n-t),a=Math.sin(i/2)*Math.sin(i/2)+Math.cos(Te(e))*Math.cos(Te(l))*Math.sin(o/2)*Math.sin(o/2);return 2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))*6371};function Te(e){return e*(Math.PI/180)}delete s.Icon.Default.prototype._getIconUrl,s.Icon.Default.mergeOptions({iconRetinaUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",iconUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png"});const Se=s.divIcon({className:"blinking-green-dot",html:'\n <div style="position: relative;">\n <div style="\n width: 14px;\n height: 14px;\n background: #4caf50;\n border: 2px solid white;\n border-radius: 50%;\n box-shadow: 0 0 10px rgba(76, 175, 80, 0.8);\n z-index: 2;\n position: relative;\n animation: blink 1s infinite ease-in-out;\n "></div>\n <div style="\n position: absolute;\n top: -6px;\n left: -6px;\n width: 26px;\n height: 26px;\n background: rgba(76, 175, 80, 0.3);\n border-radius: 50%;\n animation: pulse 2s infinite;\n z-index: 1;\n "></div>\n <style>\n @keyframes blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.6; }\n }\n @keyframes pulse {\n 0% { transform: scale(0.6); opacity: 1; }\n 100% { transform: scale(2); opacity: 0; }\n }\n </style>\n </div>\n ',iconSize:[14,14],iconAnchor:[7,7]}),be=new s.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),Ne=new s.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-blue.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),Ie=e=>{let t=e.lat,i=e.lng,o=e.fallback;const a=l.useState(void 0===o?"Resolving area":o),r=a[0],d=a[1];return l.useEffect(()=>{!function(){try{const e=function(){if(null!=t&&null!=i)return Promise.resolve(_e(t,i)).then(function(e){d(he(e))})}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[t,i]),n.createElement("span",{title:(null==t?void 0:t.toFixed(6))+", "+(null==i?void 0:i.toFixed(6))},r)},De=e=>{let t=e.selectedDriver,n=e.mapZoom,i=e.mapCenter;const o=u.useMap();return l.useEffect(()=>{null!=t&&t.lat&&null!=t&&t.lng&&o.setView([t.lat,t.lng],n||15,{animate:!0,duration:1})},[t,o]),l.useEffect(()=>{Array.isArray(i)&&2===i.length&&o.setView(i,n||15,{animate:!0,duration:1})},[i,o]),l.useEffect(()=>{n&&o.setZoom(n)},[n,o]),null},Ce=e=>{let t=e.start,o=e.end;const a=i.useTranslation().t,r=((e,t)=>{const n=i.useTranslation().t,o=l.useState(null),a=o[0],r=o[1],d=l.useState(!1),u=d[0],s=d[1],c=l.useState(null),v=c[0],m=c[1];return l.useEffect(()=>{e&&t&&function(){try{s(!0),Promise.resolve(C(function(){return D(function(){return Promise.resolve(fetch("https://router.project-osrm.org/route/v1/driving/"+e.lng+","+e.lat+";"+t.lng+","+t.lat+"?overview=full&geometries=geojson&steps=true")).then(function(e){if(!e.ok)throw new Error(n("FAILED_TO_FETCH_ROUTE"));return Promise.resolve(e.json()).then(function(e){if(e.routes&&e.routes[0]){const t=e.routes[0],l=t.geometry.coordinates.map(e=>[e[1],e[0]]);r({coordinates:l,distance:t.distance,duration:t.duration,legs:t.legs})}})})},function(e){console.error(n("Error fetching route:"),e),m(e.message)})},function(e,t){if(s(!1),e)throw t;return t}))}catch(e){return Promise.reject(e)}}()},[null==e?void 0:e.lat,null==e?void 0:e.lng,null==t?void 0:t.lat,null==t?void 0:t.lng]),{routeData:a,loading:u,error:v}})(t,o),d=r.routeData,s=r.loading,c=r.error,v=l.useState(!1),m=v[0],p=v[1],E=l.useState(null),f=E[0],g=E[1];return s?n.createElement("div",{style:{position:"absolute",top:"20px",left:"20px",background:"white",padding:"8px 16px",borderRadius:"4px",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",zIndex:1e3}},a("LOADING_ROUTE")):c?n.createElement("div",{style:{position:"absolute",top:"20px",left:"20px",background:"#ffebee",color:"#c62828",padding:"8px 16px",borderRadius:"4px",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",zIndex:1e3}},a("ERROR_LOADING_ROUTE"),c):d?n.createElement(n.Fragment,null,n.createElement(u.Polyline,{positions:d.coordinates,color:"#1F5FA8",weight:5,opacity:.8,lineJoin:"round"}),(f||m)&&n.createElement("div",{style:{position:"absolute",bottom:"80px",left:"10px",right:"10px",background:"white",padding:"16px",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",zIndex:1e3,maxWidth:"calc(100% - 20px)",border:"1px solid #e0e0e0",maxHeight:"50vh",overflowY:"auto"}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"}},n.createElement("h4",{style:{margin:0,color:"#1F5FA8"}},a("ROUTE_INFORMATION")),n.createElement("button",{onClick:()=>p(!1),style:{background:"none",border:"none",cursor:"pointer",fontSize:"24px",color:"#666",padding:"0 8px"}},"×")),n.createElement("div",{style:{marginBottom:"12px"}},n.createElement("div",null,n.createElement("strong",null,a("TOTAL_DISTANCE"),":")," ",(d.distance/1e3).toFixed(2)," km"),n.createElement("div",null,n.createElement("strong",null,a("ESTIMATED_TIME"),":")," ",Math.round(d.duration/60)," minutes")),f&&n.createElement("div",{style:{padding:"8px",background:"#f5f5f5",borderRadius:"4px",marginBottom:"8px"}},n.createElement("div",null,n.createElement("strong",null,a("CURRENT_STEP"),":")," ",f.maneuver.type),n.createElement("div",null,n.createElement("strong",null,a("INSTRUCTION"),":")," ",f.maneuver.instruction||f.name),n.createElement("div",null,n.createElement("strong",null,a("DISTANCE"),":")," ",(f.distance/1e3).toFixed(2)," km"),n.createElement("div",null,n.createElement("strong",null,a("DURATION"),":")," ",Math.round(f.duration/60)," min")),m&&d.legs&&n.createElement("div",{style:{maxHeight:"200px",overflowY:"auto"}},n.createElement("h5",{style:{margin:"8px 0",color:"#666"}},a("TURN_BY_TURN_DIRECTIONS"),":"),d.legs[0].steps.map((e,t)=>n.createElement("div",{key:t,style:{padding:"8px",borderBottom:"1px solid #eee",fontSize:"12px",cursor:"pointer",background:f===e?"#e3f2fd":"transparent"},onMouseEnter:()=>g(e),onMouseLeave:()=>g(null)},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},n.createElement("span",{style:{width:"20px",height:"20px",borderRadius:"50%",background:"#1F5FA8",color:"white",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",flexShrink:0}},t+1),n.createElement("div",null,n.createElement("div",{style:{fontWeight:"500"}},e.maneuver.instruction||e.name),n.createElement("div",{style:{color:"#666"}},(e.distance/1e3).toFixed(2)," km · ",Math.round(e.duration/60)," min")))))))):null},Ae=e=>{let t=e.isOnline;return n.createElement("span",{style:{display:"inline-block",padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",backgroundColor:t?"#e6f7e6":"#ffe6e6",color:t?"#2e7d32":"#c62828",border:"1px solid "+(t?"#a5d6a7":"#ef9a9a")}},n.createElement("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:t?"#4caf50":"#f44336",marginRight:"6px"}}),t?"ONLINE":"OFFLINE")},xe=e=>{let t=e.driver,o=e.isSelected,a=e.onClick,r=e.vendorList;const d=i.useTranslation().t,u=l.useState("Resolving area..."),s=u[0],c=u[1],v=l.useState("Resolving area..."),m=v[0],p=v[1],E=l.useRef({lat:null,lng:null}),f=l.useRef({lat:null,lng:null});l.useEffect(()=>{!function(){try{const e=function(){if(t.lat&&t.lng){const e=E.current.lat?ye(E.current.lat,E.current.lng,t.lat,t.lng):Infinity,l=function(){if(e>.2)return Promise.resolve(_e(t.lat,t.lng)).then(function(e){c(he(e)),E.current={lat:t.lat,lng:t.lng}})}();if(l&&l.then)return l.then(function(){})}}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[t.lat,t.lng]),l.useEffect(()=>{!function(){try{const e=function(){if(t.activeDeliveryLat&&t.activeDeliveryLng){const e=f.current.lat?ye(f.current.lat,f.current.lng,t.activeDeliveryLat,t.activeDeliveryLng):Infinity,l=function(){if(e>.2)return Promise.resolve(_e(t.activeDeliveryLat,t.activeDeliveryLng)).then(function(e){p(he(e)),f.current={lat:t.activeDeliveryLat,lng:t.activeDeliveryLng}})}();if(l&&l.then)return l.then(function(){})}}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[t.activeDeliveryLat,t.activeDeliveryLng]);const g=l.useMemo(()=>{if(!r||!r.length)return{name:"Unknown",vehicle:"N/A"};for(const o of r){var e;const a=null===(e=o.drivers)||void 0===e?void 0:e.find(e=>{var l,n;return e.id===t.driverId||(null===(l=e.owner)||void 0===l?void 0:l.mobileNumber)===t.driverId||(null===(n=e.owner)||void 0===n?void 0:n.uuid)===t.driverId});var l,n,i;if(a)return{name:(null===(l=a.owner)||void 0===l?void 0:l.name)||"Unknown",vehicle:(null===(n=o.vehicles)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.registrationNumber)||"N/A"}}return{name:"Unknown",vehicle:"N/A"}},[r,t.driverId]);return n.createElement("div",{onClick:a,style:{padding:"10px",borderRadius:"8px",background:o?"#f0f4ff":"white",border:"2px solid "+(o?"#1F5FA8":"#f0f0f0"),cursor:"pointer",position:"relative",transition:"all 0.2s ease"}},n.createElement("div",{style:{display:"flex",gap:"12px",marginBottom:"8px"}},n.createElement("div",{style:{width:"40px",height:"40px",borderRadius:"8px",background:"#f0f2f5",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"20px"}},"👤"),n.createElement("div",{style:{flex:1}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},n.createElement("div",null,n.createElement("div",{style:{fontWeight:"700",fontSize:"14px",color:"#0d47a1"}},"DRV-",t.driverId.substring(0,4).toUpperCase()),n.createElement("div",{style:{fontSize:"11px",color:"#666"}},g.name," • ",g.vehicle)),n.createElement("div",{style:{fontSize:"10px",fontWeight:"700",padding:"2px 8px",borderRadius:"4px",background:t.isOnline?"#e8f5e9":"#ffebee",color:t.isOnline?"#2e7d32":"#c62828"}},t.isOnline?"ONLINE":"OFFLINE")))),n.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px"}},n.createElement("div",null,n.createElement("div",{style:{fontSize:"10px",fontWeight:"600",color:"#aaa",marginBottom:"2px"}},d("CURRENT_LOCATION")),n.createElement("div",{style:{fontSize:"11px",fontWeight:"700",color:"#333",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},s))),n.createElement("div",null,n.createElement("div",null,n.createElement("div",{style:{fontSize:"10px",fontWeight:"600",color:"#aaa",marginBottom:"2px"}},d("DESTINATION")),n.createElement("div",{style:{fontSize:"11px",fontWeight:"700",color:"#333",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},m))))};function Oe(){const e=i.useTranslation().t,o=Digit.ULBService.getCurrentTenantId(),a=l.useState({}),r=a[0],s=a[1],v=l.useState(!1),m=v[0],p=v[1],E=l.useState(null),f=E[0],g=E[1],_=l.useState(""),h=_[0],y=_[1],T=l.useState("all"),S=T[0],b=T[1],N=l.useState(!0),I=N[0],D=N[1],C=l.useState([28.6139,77.209]),A=C[0],x=C[1],O=l.useState(12),w=O[0],L=O[1],P=l.useState(!0),R=P[0],k=P[1],M=l.useState(window.innerWidth<=768),F=M[0],B=M[1],W=l.useState(null),U=W[0],H=W[1],j=l.useState(null),V=j[0],z=j[1],K=Digit.Hooks.wt.useFillPointSearch({tenantId:o,filters:{status:"ACTIVE"}}).data,G=l.useMemo(()=>(null==K?void 0:K.fillingPoints)||[],[K]),q=Digit.Hooks.fsm.useVendorSearch({tenantId:o,filters:c({status:"ACTIVE"},null!=U&&U.id?{fillingPointId:null==U?void 0:U.id}:{}),config:{select:e=>(null==e?void 0:e.vendor)||[]}}).data,Y=l.useMemo(()=>q||[],[q]);l.useEffect(()=>{var e,t,l;null!=q&&q.length&&Object.keys(r).length&&(console.log("=== VENDOR DEBUG ==="),console.log("Vendor[0] vehicles:",null===(e=q[0])||void 0===e?void 0:e.vehicles),console.log("Vendor[0] drivers:",null===(t=q[0])||void 0===t||null===(l=t.drivers)||void 0===l?void 0:l.map(e=>{var t,l;return{id:e.id,mobile:null===(t=e.owner)||void 0===t?void 0:t.mobileNumber,uuid:null===(l=e.owner)||void 0===l?void 0:l.uuid}})),console.log("Socket driverId example:",Object.keys(r)[0]))},[q,r]),l.useEffect(()=>{const e=()=>{B(window.innerWidth<=768),window.innerWidth<=768?k(!1):k(!0)};return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]);const X=l.useMemo(()=>d.io("https://dev-djberp.nitcon.in",{path:"/driver-tanker-tracker-service/socket.io",transports:["websocket"],autoConnect:!1}),[]);l.useEffect(()=>(X.connect(),X.on("connect",()=>{console.log("Admin connected:",X.id),p(!0),X.emit("admin-join")}),X.on("disconnect",()=>{console.log("Admin disconnected"),p(!1)}),X.on("drivers-snapshot",e=>{if(console.log("drivers-snapshot",e),!Array.isArray(e))return;const t={};e.forEach(e=>{e&&e.driverId&&(t[e.driverId]=c({},e,{lastUpdate:(new Date).toISOString()}))}),s(t)}),X.on("driver-location-update",e=>{console.log("driver-location-update",e),e&&e.driverId&&s(t=>c({},t,{[e.driverId]:c({},t[e.driverId]||{},e,{lastUpdate:(new Date).toISOString()})}))}),X.on("driver-status",e=>{console.log("driver-status",e),e&&e.driverId&&s(t=>c({},t,{[e.driverId]:c({},t[e.driverId],e,{lastUpdate:(new Date).toISOString()})}))}),()=>{X.disconnect()}),[X]),l.useEffect(()=>{null!=f&&f.lat&&null!=f&&f.lng&&(x([f.lat,f.lng]),L(15))},[f]);const Q=Object.values(r).filter(e=>{const t=e.driverId.toLowerCase().includes(h.toLowerCase()),l="all"===S||"online"===S&&e.isOnline||"offline"===S&&!e.isOnline,n=!U||!(!q||!q.length)&&q.some(t=>{var l;return null===(l=t.drivers)||void 0===l?void 0:l.some(t=>{var l,n,i,o;return(null===(l=t.owner)||void 0===l?void 0:l.mobileNumber)===e.driverId||(null===(n=t.owner)||void 0===n?void 0:n.uuid)===e.driverId||t.id===e.driverId||String(null===(i=t.owner)||void 0===i?void 0:i.mobileNumber)===String(e.driverId)||String(null===(o=t.owner)||void 0===o?void 0:o.uuid)===String(e.driverId)})}),i=!V||((null===(o=V.drivers)||void 0===o?void 0:o.map(e=>{var t,l,n,i;return[null===(t=e.owner)||void 0===t?void 0:t.mobileNumber,null===(l=e.owner)||void 0===l?void 0:l.uuid,e.id,String(null===(n=e.owner)||void 0===n?void 0:n.mobileNumber),String(null===(i=e.owner)||void 0===i?void 0:i.uuid)]}).flat().filter(Boolean))||[]).some(t=>e.driverId===t);var o;return t&&l&&n&&i}),Z=Object.values(r).filter(e=>e.isOnline).length,J=Object.values(r).filter(e=>!e.isOnline).length,$=Object.values(r).filter(e=>e.isOnline&&e.activeDeliveryLat&&e.activeDeliveryLng).length;return n.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100vh",width:"100%",overflow:"hidden",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif",background:"#f0f2f5",padding:"16px",boxSizing:"border-box"}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px",background:"white",padding:"12px 24px",borderRadius:"12px",boxShadow:"0 2px 8px rgba(0,0,0,0.05)",border:"2px solid #1F5FA844"}},n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},n.createElement("h1",{style:{margin:0,fontSize:"24px",fontWeight:"700",color:"#0d47a1"}},e("WT_LIVE_DRIVER_TRACKING")),n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",background:"#e8f5e9",color:"#2e7d32",borderRadius:"20px",fontSize:"12px",fontWeight:"700",border:"1px solid #c8e6c9"}},n.createElement("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:m?"#4caf50":"#f44336",boxShadow:m?"0 0 8px #4caf50":"none"}}))),n.createElement("p",{style:{margin:"4px 0 0 0",fontSize:"14px",color:"#666"}},e("REAL_TIME_TELEMETRY_AND_FLEET_COORDINATION"))),n.createElement("div",{style:{display:"flex",gap:"12px"}},[{label:e("TOTAL_FLEET"),value:Object.keys(r).length,color:"#0d47a1"},{label:e("ONLINE"),value:Z,color:"#2e7d32"},{label:e("OFFLINE"),value:J,color:"#c62828"},{label:e("ACTIVE"),value:$,color:"#0d47a1"}].map((e,t)=>n.createElement("div",{key:t,style:{background:"#f8f9fa",padding:"8px 16px",borderRadius:"8px",minWidth:"100px",display:"flex",flexDirection:"column",border:"1px solid #e0e0e0"}},n.createElement("div",{style:{fontSize:"10px",fontWeight:"600",color:"#888",marginBottom:"4px"}},e.label),n.createElement("div",{style:{fontSize:"20px",fontWeight:"700",color:e.color}},e.value))))),n.createElement("div",{style:{display:"flex",flex:1,gap:"16px",overflow:"hidden"}},F&&n.createElement("button",{onClick:()=>{k(!R)},style:{position:"absolute",top:"80px",left:"20px",zIndex:2e3,background:"#1F5FA8",color:"white",border:"none",borderRadius:"8px",padding:"8px 12px",fontSize:"12px",cursor:"pointer",boxShadow:"0 2px 8px rgba(0,0,0,0.2)"}},R?"Close":"Menu"),n.createElement("div",{style:c({width:F?R?"100%":"0":"360px",height:"100%",display:"flex",flexDirection:"column",background:"transparent",position:F?"absolute":"relative",top:0,left:0,zIndex:1500,transition:"all 0.3s ease-in-out"},F&&!R&&{width:"0",opacity:0,pointerEvents:"none"})},R&&n.createElement(n.Fragment,null,n.createElement("div",{style:{padding:"12px",background:"white",borderRadius:"12px",display:"flex",flexDirection:"column",height:"100%",boxShadow:"0 2px 8px rgba(0,0,0,0.05)",border:"1px solid #e0e0e0"}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"}},n.createElement("h3",{style:{margin:0,fontSize:"14px",fontWeight:"700",color:"#888",letterSpacing:"1px"}},e("WT_FILTER_FLEET")),n.createElement("button",{onClick:()=>{H(null),z(null),y(""),b("all")},style:{background:"none",border:"none",color:"#1F5FA8",fontSize:"12px",fontWeight:"700",cursor:"pointer"}},e("WT_RESET_ALL"))),n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"12px"}},n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},n.createElement("label",{style:{fontSize:"12px",fontWeight:"700",color:"#888"}},e("WT_SELECT_FILLING_POINT")),n.createElement(t.Dropdown,{t:e,option:G,optionKey:"fillingPointName",select:e=>{H(e),z(null)},selected:U,placeholder:e("WT_SELECT_FILLING_POINT"),style:{width:"100%",margin:0}})),n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},n.createElement("label",{style:{fontSize:"12px",fontWeight:"700",color:"#888"}},e("WT_SELECT_VENDOR")),n.createElement(t.Dropdown,{t:e,option:Y,optionKey:"name",select:z,selected:V,placeholder:e("WT_SELECT_VENDOR"),style:{width:"100%",margin:0}})),n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},n.createElement("label",{style:{fontSize:"10px",fontWeight:"700",color:"#888"}},e("WT_SEARCH_DRIVER_BY_ID")),n.createElement("div",{style:{position:"relative"}},n.createElement("span",{style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"#888"}},"🔍"),n.createElement("input",{type:"text",placeholder:e("WT_SEARCH_DRIVER_BY_ID"),value:h,onChange:e=>y(e.target.value),style:{width:"100%",padding:"10px 10px 10px 36px",border:"1px solid #e0e0e0",borderRadius:"8px",fontSize:"12px",outline:"none",background:"#f8f9fa",boxSizing:"border-box"}})))),n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"}},n.createElement("div",{style:{display:"flex",gap:"8px"}},["all","online","offline"].map(e=>n.createElement("button",{key:e,onClick:()=>b(e),style:{padding:"4px 12px",borderRadius:"4px",background:S===e?"#1F5FA8":"transparent",color:S===e?"white":"#666",border:S===e?"none":"1px solid #e0e0e0",cursor:"pointer",fontSize:"12px",fontWeight:"600",textTransform:"capitalize"}},e))),n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},n.createElement("input",{type:"checkbox",id:"showRoutes",checked:I,onChange:e=>D(e.target.checked),style:{cursor:"pointer"}}),n.createElement("label",{htmlFor:"showRoutes",style:{fontSize:"12px",color:"#666",cursor:"pointer"}},"Routes"))),n.createElement("div",{style:{flex:1,overflowY:"auto",padding:"4px",marginTop:"8px",display:"flex",flexDirection:"column",gap:"12px"}},0===Q.length?n.createElement("div",{style:{textAlign:"center",padding:"40px 20px",color:"#999"}},n.createElement("p",null,e("WT_NO_DRIVERS_FOUND"))):Q.map(e=>n.createElement(xe,{key:e.driverId,driver:e,isSelected:(null==f?void 0:f.driverId)===e.driverId,vendorList:q,onClick:()=>{g(e),F&&k(!1)}})))))),n.createElement("div",{style:{flex:1,height:"100%",minHeight:0,position:"relative",background:"white",borderRadius:"12px",overflow:"hidden",boxShadow:"0 2px 8px rgba(0,0,0,0.05)",border:"1px solid #e0e0e0"}},n.createElement(u.MapContainer,{center:A,zoom:w,style:{height:"100%",width:"100%"},zoomControl:!1},n.createElement(u.TileLayer,{url:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),n.createElement(De,{selectedDriver:f,mapZoom:w,mapCenter:A}),Q.filter(e=>e.driverId!==(null==f?void 0:f.driverId)).map(e=>n.createElement(u.Marker,{key:e.driverId,position:[Number(e.lat),Number(e.lng)],icon:e.isOnline?Se:be,eventHandlers:{click:()=>{g(e)}}})),f&&null!=f.lat&&null!=f.lng&&n.createElement(u.Marker,{key:f.driverId,position:[Number(f.lat),Number(f.lng)],icon:f.isOnline?Se:be},n.createElement(u.Popup,null,n.createElement("div",{style:{minWidth:F?"200px":"250px",padding:"8px"}},n.createElement("div",{style:{fontWeight:"bold",fontSize:F?"14px":"16px",color:"#1F5FA8",marginBottom:"8px",borderBottom:"1px solid #eee",paddingBottom:"4px"}},"Driver #",f.driverId.substring(0,8),"... (Selected)"),n.createElement("div",{style:{marginBottom:"8px"}},n.createElement(Ae,{isOnline:f.isOnline})),n.createElement("div",{style:{fontSize:F?"12px":"13px"}},n.createElement("div",{style:{marginBottom:"8px"}},n.createElement("strong",null,"Current Location"),n.createElement("div",null,n.createElement(Ie,{lat:f.lat,lng:f.lng}))),f.activeDeliveryLat&&f.activeDeliveryLng&&n.createElement("div",{style:{marginBottom:"8px"}},n.createElement("strong",null,e("DELIVERY_DESTINATION")),n.createElement("div",null,n.createElement(Ie,{lat:f.activeDeliveryLat,lng:f.activeDeliveryLng}))),n.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px",background:"#f5f5f5",padding:"8px",borderRadius:"4px",marginTop:"8px"}},f.speed&&n.createElement(n.Fragment,null,n.createElement("span",null,e("WT_SPEED"),":"),n.createElement("span",null,(3.6*f.speed).toFixed(1)," ",e("WT_KM_PER_HOUR"))),f.heading&&n.createElement(n.Fragment,null,n.createElement("span",null,e("WT_HEADING"),":"),n.createElement("span",null,Math.round(f.heading),"°")),f.accuracy&&n.createElement(n.Fragment,null,n.createElement("span",null,e("WT_ACCURACY"),":"),n.createElement("span",null,Math.round(f.accuracy),"m"))),f.lastUpdate&&n.createElement("div",{style:{marginTop:"8px",color:"#666",fontSize:"10px"}},e("WT_LAST_UPDATE"),": ",new Date(f.lastUpdate).toLocaleString()))))),f&&null!=f.activeDeliveryLat&&null!=f.activeDeliveryLng&&n.createElement(u.Marker,{key:"dest-"+f.driverId,position:[Number(f.activeDeliveryLat),Number(f.activeDeliveryLng)],icon:Ne}),I&&f&&f.lat&&f.lng&&f.activeDeliveryLat&&f.activeDeliveryLng&&n.createElement(Ce,{start:{lat:f.lat,lng:f.lng},end:{lat:f.activeDeliveryLat,lng:f.activeDeliveryLng},color:"#2196f3",weight:6})),n.createElement("div",{style:{position:"absolute",top:F?"60px":"20px",right:"10px",zIndex:1e3,background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",padding:"4px",display:"flex",flexDirection:F?"column":"row",gap:"4px"}},f&&n.createElement(n.Fragment,null,n.createElement("button",{onClick:()=>{if(null!=f&&f.lat&&null!=f&&f.lng){const e=[Number(f.lat),Number(f.lng)];x(e),L(15)}},style:{padding:F?"10px 12px":"8px 16px",background:"#1F5FA8",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:F?"12px":"14px",fontWeight:"500",whiteSpace:"nowrap"}},e("WT_CENTER")),n.createElement("button",{onClick:()=>g(null),style:{padding:F?"10px 12px":"8px 16px",background:"#f44336",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:F?"12px":"14px",fontWeight:"500",whiteSpace:"nowrap"}},e("WT_CLEAR"))),!f&&n.createElement("div",{style:{padding:F?"10px 12px":"8px 16px",background:"#f5f5f5",color:"#666",borderRadius:"4px",fontSize:F?"12px":"14px"}},F?"Select driver":"Select a driver from the list")),f&&n.createElement("div",{style:{position:"absolute",bottom:F?"10px":"20px",left:F?"10px":"20px",right:F?"10px":"auto",zIndex:1e3,background:"white",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:F?"12px":"16px",maxWidth:F?"calc(100% - 20px)":"300px",border:"2px solid #2196f3"}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"}},n.createElement("h4",{style:{margin:0,color:"#1F5FA8",fontSize:F?"14px":"16px"}},e("WT_SELECTED_DRIVER")),n.createElement(Ae,{isOnline:f.isOnline})),n.createElement("div",{style:{fontSize:F?"12px":"13px"}},n.createElement("div",null,n.createElement("strong",null,e("WT_ID"),":")," ",f.driverId.substring(0,6).toUpperCase(),"..."),n.createElement("div",null,n.createElement("strong",null,e("WT_LOCATION"),":")," ",n.createElement(Ie,{lat:f.lat,lng:f.lng})),f.speed&&n.createElement("div",null,n.createElement("strong",null,e("WT_SPEED"),":")," ",Math.round(3.6*f.speed)," ",e("km/h")),f.lastSeen&&n.createElement("div",null,n.createElement("strong",null,e("WT_LAST_SEEN"),":")," ",new Date(f.lastSeen).toLocaleTimeString()))),n.createElement("div",{style:{position:"absolute",top:"20px",left:"20px",zIndex:1e3,display:"flex",flexDirection:"column",gap:"8px"}},n.createElement("button",{onClick:()=>L(e=>e+1),style:{width:"32px",height:"32px",background:"white",border:"1px solid #e0e0e0",borderRadius:"4px",fontSize:"18px",fontWeight:"700",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},"+"),n.createElement("button",{onClick:()=>L(e=>e-1),style:{width:"32px",height:"32px",background:"white",border:"1px solid #e0e0e0",borderRadius:"4px",fontSize:"18px",fontWeight:"700",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},"−")),n.createElement("div",{style:{position:"absolute",top:"20px",right:"20px",zIndex:1e3,display:"flex",gap:"12px"}}))))}const we=e=>{let l=e.t,i=e.formData,o=void 0===i?{}:i,a=e.onSelect,r=e.config,d=void 0===r?{}:r,u=e.visibleFields,s=void 0===u?[]:u;const v=(null==d?void 0:d.key)||"metaData",m=[{label:"WT_FILLING_POINT_NAME",name:"fillingPointName",isMandatory:!0},{label:"WT_AE_NAME",name:"aeName",isMandatory:!0,validation:{pattern:"^[a-zA-Z]+( [a-zA-Z]+)*$"}},{label:"WT_AE_MOBILE_NUMBER",name:"aeMobile",isMandatory:!0,componentInFront:n.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91"),validation:{pattern:"[6-9]{1}[0-9]{9}",type:"tel",maxLength:10}},{label:"WT_AE_EMAIL_ID",name:"aeEmail",validation:{pattern:"^[a-zA-Z0-9._%+-]+@[a-z.-]+\\.(com|org|in)$"}},{label:"WT_JE_NAME",name:"jeName",isMandatory:!0,validation:{pattern:"^[a-zA-Z]+( [a-zA-Z]+)*$"}},{label:"WT_JE_MOBILE_NUMBER",name:"jeMobile",isMandatory:!0,componentInFront:n.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91"),validation:{pattern:"[6-9]{1}[0-9]{9}",type:"tel",maxLength:10}},{label:"WT_JE_EMAIL_ID",name:"jeEmail",validation:{pattern:"^[a-zA-Z0-9._%+-]+@[a-z.-]+\\.(com|org|in)$"}},{label:"WT_EE_NAME",name:"eeName",isMandatory:!0,validation:{pattern:"^[a-zA-Z]+( [a-zA-Z]+)*$"}},{label:"WT_EE_MOBILE_NUMBER",name:"eeMobile",isMandatory:!0,componentInFront:n.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91"),validation:{pattern:"[6-9]{1}[0-9]{9}",type:"tel",maxLength:10}},{label:"WT_EE_EMAIL_ID",name:"eeEmail",validation:{pattern:"^[a-zA-Z0-9._%+-]+@[a-z.-]+\\.(com|org|in)$"}}],p=s&&s.length>0?m.filter(e=>s.includes(e.name)):m;return n.createElement(t.CollapsibleCardPage,{title:"Filling Point Details",defaultOpen:!0},n.createElement("div",{className:"formcomposer-section-grid"},p.map(e=>{var i,r;return n.createElement("div",{key:e.name},n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},l(e.label),e.isMandatory?" *":""),n.createElement("div",{style:{display:"flex"}},e.componentInFront||null,n.createElement(t.TextInput,c({value:(null==o||null===(i=o[v])||void 0===i?void 0:i[e.name])||"",onChange:t=>((e,t)=>{if(!a)return;let l=e;["aeMobile","jeMobile","eeMobile","alternateNumber"].includes(t)&&(l=e.slice(0,10).replace(/[^0-9]/g,"")),a(v,c({},null==o?void 0:o[v],{[t]:l}))})(t.target.value,e.name),maxLength:null===(r=e.validation)||void 0===r?void 0:r.maxLength},e.validation)))))})))},Le=[{name:"Correspondence",code:"CORRESPONDENCE",i18nKey:"COMMON_ADDRESS_TYPE_CORRESPONDENCE"},{name:"Permanent",code:"PERMANENT",i18nKey:"COMMON_ADDRESS_TYPE_PERMANENT"},{name:"Other",code:"OTHER",i18nKey:"COMMON_ADDRESS_TYPE_OTHER"}],Pe=e=>{var i,a,r,d,u,s,v,m,p,E,f,g,_,h,y;let T=e.t,S=e.config,b=e.formData,N=e.onSelect,I=e.isEdit;const A=Digit.Hooks.useTenants().data,x=o.useLocation(),O=Digit.ULBService.getCurrentTenantId(),w=(null===(i=x.state)||void 0===i?void 0:i.usedAddressTypes)||[],L=l.useState((null==b||null===(a=b.address)||void 0===a?void 0:a.pincode)||""),P=L[0],R=L[1],k=l.useState((null==b||null===(r=b.address)||void 0===r?void 0:r.city)||null),M=k[0],F=k[1],B=l.useState((null==b||null===(d=b.address)||void 0===d?void 0:d.locality)||null),W=B[0],U=B[1],H=l.useState((null==b||null===(u=b.address)||void 0===u?void 0:u.houseNo)||""),j=H[0],V=H[1],z=l.useState((null==b||null===(s=b.address)||void 0===s?void 0:s.streetName)||""),K=z[0],G=z[1],q=l.useState((null==b||null===(v=b.address)||void 0===v?void 0:v.landmark)||""),Y=q[0],X=q[1],Q=l.useState((null==b||null===(m=b.address)||void 0===m?void 0:m.addressLine1)||""),Z=Q[0],J=Q[1],$=l.useState((null==b||null===(p=b.address)||void 0===p?void 0:p.addressLine2)||""),ee=$[0],te=$[1],le=l.useState(null!=b&&null!==(E=b.address)&&void 0!==E&&E.addressType?Le.find(e=>e.code===b.address.addressType)||b.address.addressType:Le.find(e=>"PERMANENT"===e.code)),ne=le[0],ie=le[1],oe=l.useState((null==b||null===(f=b.address)||void 0===f?void 0:f.zone)||""),ae=oe[0],re=oe[1],de=l.useState((null==b||null===(g=b.address)||void 0===g?void 0:g.block)||""),ue=de[0],se=de[1],ce=l.useState((null==b||null===(_=b.address)||void 0===_?void 0:_.assembly)||""),ve=ce[0],me=ce[1],pe=l.useState((null==b||null===(h=b.address)||void 0===h?void 0:h.latitude)||""),Ee=pe[0],fe=pe[1],ge=l.useState((null==b||null===(y=b.address)||void 0===y?void 0:y.longitude)||""),_e=ge[0],he=ge[1],ye=l.useState("")[0],Te=l.useState(!1),Se=Te[0],be=Te[1],Ne=l.useState(!1)[1],Ie=l.useState(null)[1],De=l.useState(null)[1],Ce=l.useRef(!I),Ae=l.useRef(null),xe=l.useRef(null),Oe=(l.useMemo(()=>Le.filter(3===w.length?e=>"OTHER"===e.code:e=>!w.includes(e.code)),[w]),Digit.Hooks.useCommonMDMS(O,"egov-location",["TenantBoundary"]).data);l.useEffect(()=>{if(!M&&A&&A.length>0){const e=A.find(e=>e.code===O)||A[0];F(e)}},[A,M,O]);const we=l.useMemo(()=>{var e;const t=((null==Oe||null===(e=Oe["egov-location"])||void 0===e?void 0:e.TenantBoundary)||[]).find(e=>{var t;return"REVENUE"===(null==e||null===(t=e.hierarchyType)||void 0===t?void 0:t.code)}),l=(null==t?void 0:t.boundary)||[];return Array.isArray(l)?l:[l]},[Oe]),Pe=l.useMemo(()=>{let e=[];const t=Array.isArray(we)?we:we?[we]:[],l=function(t,n,i,o){if(void 0===n&&(n=null),void 0===i&&(i=null),void 0===o&&(o=null),!t)return;let a=n,r=i,d=o;"Zone"!==t.label&&"ZONE"!==t.label||(a=t.localname||t.code||t.name),"Ward"!==t.label&&"WARD"!==t.label&&"Block"!==t.label&&"BLOCK"!==t.label||(r=t.code||t.localname||t.name),"Assembly Constituency"!==t.label&&"ASSEMBLY_CONSTITUENCY"!==t.label||(d=t.code||t.localname||t.name),"Locality"!==t.label&&"LOCALITY"!==t.label||e.push(c({},t,{name:t.localname||t.name||t.code,i18nkey:t.i18nkey||(O.replace(".","_")+"_REVENUE_"+t.code).toUpperCase(),zone:a,ward:r,assembly:d})),t.children&&t.children.length>0&&t.children.forEach(e=>l(e,a,r,d))};return t.forEach(e=>l(e)),e},[we,O]),Re=l.useMemo(()=>{const e=new Set;return Pe.forEach(t=>{t.pincode&&(Array.isArray(t.pincode)?t.pincode:[t.pincode]).forEach(t=>{if(t){const l=t.toString().split(".")[0];e.add(l)}})}),0===e.size&&null!=M&&M.pincode&&(Array.isArray(M.pincode)?M.pincode:[M.pincode]).forEach(t=>{if(t){const l=t.toString().split(".")[0];e.add(l)}}),Array.from(e).sort().map(e=>({code:e,name:e,i18nKey:e}))},[Pe,M]),ke=l.useMemo(()=>P&&Re.some(e=>e.code===P)?Pe.filter(e=>!!e.pincode&&(Array.isArray(e.pincode)?e.pincode:[e.pincode]).some(e=>e.toString()===P)):Pe,[Pe,P,Re]);return l.useEffect(()=>{var e;const t=(null==b?void 0:b.id)||(null==b?void 0:b.bookingId)||(null==b||null===(e=b.address)||void 0===e?void 0:e.id);if(t&&xe.current!==t&&(Ce.current=!1,xe.current=t),null!=b&&b.address&&!Ce.current&&A){var l;const e=b.address,t=A.find(t=>t.code===e.cityCode||t.code===e.city||t.name===e.city)||e.city;if(t&&(!M||M.code!==t.code&&M!==t)&&F(t||null),R((null===(l=e.pincode)||void 0===l?void 0:l.toString().split(".")[0])||""),V(e.houseNo||""),G(e.streetName||""),X(e.landmark||""),J(e.addressLine1||""),ie(Le.find(t=>t.code===e.addressType)||e.addressType||Le.find(e=>"PERMANENT"===e.code)),re(e.zone||""),se(e.block||e.ward||""),me(e.assembly||e.constituency||""),fe(e.latitude||""),he(e.longitude||""),(null==Pe?void 0:Pe.length)>0||!e.cityCode){const t=Pe.find(t=>t.code===e.localityCode||t.code===e.locality||t.i18nkey===e.locality);U(t||e.locality||null),t&&(!e.zone&&t.zone&&re(t.zone),!e.block&&t.ward&&se(t.ward),!e.assembly&&t.assembly&&me(t.assembly)),Ce.current=!0,Ae.current=JSON.stringify(e)}}},[null==b?void 0:b.address,M,A,Pe]),l.useEffect(()=>{navigator.geolocation&&navigator.geolocation.getCurrentPosition(e=>{fe(e.coords.latitude),he(e.coords.longitude)},()=>{})},[]),l.useEffect(()=>{ye&&Object.keys(ye).length&&(R(ye.pinCode),F(null==A?void 0:A.find(e=>e.name===ye.city)),U(Array.isArray(we)?we.find(e=>e.i18nkey===ye.locality):null),V(ye.houseNumber),G(ye.streetName),X(ye.landmark),J(ye.address),re(ye.zone),se(ye.block),me(ye.assembly),fe(ye.latitude),he(ye.longitude),ie(Le.find(e=>e.code===ye.addressType)))},[ye,Pe]),l.useEffect(()=>{if(!Z||Z.trim().length<5)return;const e=setTimeout(()=>{!function(){try{Promise.resolve(C(function(){return D(function(){Ne(!0),Ie(null);const e=[j,K,Z,ee,(null==W?void 0:W.name)||("string"==typeof W?W:""),(null==M?void 0:M.name)||("string"==typeof M?M:""),P].filter(Boolean).join(", ");return e.trim()?Promise.resolve(function(e){try{return e&&e.trim()?Promise.resolve(D(function(){return Promise.resolve(fetch("https://nominatim.openstreetmap.org/search?format=json&q="+encodeURIComponent(e),{headers:{"Accept-Language":"en","User-Agent":"Digit-UI-WT-Module"}})).then(function(e){if(!e.ok)throw new Error("Geocoding failed: "+e.statusText);return Promise.resolve(e.json())})},function(e){return console.error("Error in geocodeAddress:",e),null})):Promise.resolve(null)}catch(e){return Promise.reject(e)}}(e)).then(function(e){e&&e.length>0?(fe(e[0].lat),he(e[0].lon),De(e[0].display_name)):Ie(T("WT_LOCATION_NOT_FOUND"))}):(Ie(T("WT_ENTER_ADDRESS_DETAILS_FIRST")),void Ne(!1))},function(){Ie(T("WT_GEOCODING_ERROR"))})},function(e,t){if(Ne(!1),e)throw t;return t}))}catch(e){return Promise.reject(e)}}()},1e3);return()=>clearTimeout(e)},[Z]),l.useEffect(()=>{if(!N||!Ce.current)return;const e={pincode:P||"",city:(null==M?void 0:M.code)||M||null,locality:(null==W?void 0:W.code)||W||null,houseNo:j||"",landmark:Y||"",addressLine1:Z||"",addressLine2:ee||"",streetName:K||"",addressType:(null==ne?void 0:ne.code)||ne||null,zone:ae||"",block:ue||"",assembly:ve||"",latitude:Ee||"",longitude:_e||""},t=JSON.stringify(e);Ae.current!==t&&(Ae.current=t,N((null==S?void 0:S.key)||"address",e))},[P,M,W,j,Y,Z,ee,K,ne,ae,ue,ve,Ee,_e]),n.createElement(t.CollapsibleCardPage,{title:T("WT_ADDRESS_DETAILS"),defaultOpen:!0},n.createElement("div",{className:"formcomposer-section-grid"},n.createElement("div",{style:{position:"relative"}},n.createElement(t.CardLabel,null,T("PINCODE")),n.createElement(t.TextInput,{value:P,onChange:e=>{const t=e.target.value.replace(/\D/g,"").slice(0,6);t!==P&&(U(null),re(""),se(""),fe(""),he(""),J("")),R(t),be(!0)},onFocus:()=>be(!0),onBlur:()=>{setTimeout(()=>be(!1),200)},style:{width:"100%"},maxlength:6}),Se&&(null==Re?void 0:Re.length)>0&&n.createElement("div",{className:"options-card",style:{position:"absolute",zIndex:100,width:"100%",maxHeight:"200px",overflowY:"auto",backgroundColor:"white",boxShadow:"0 2px 5px rgba(0,0,0,0.1)"}},Re.filter(e=>!P||e.code.toLowerCase().includes(P.toLowerCase())).map((e,t)=>n.createElement("div",{key:t,className:"cp profile-dropdown--item",style:{padding:"10px",borderBottom:"1px solid #eee",cursor:"pointer"},onClick:()=>{R(e.code),be(!1)}},e.code)))),n.createElement("div",null,n.createElement(t.CardLabel,null,T("LOCALITY")),n.createElement(t.Dropdown,{selected:W,select:e=>{U(e),null!=e&&e.latitude&&fe(e.latitude),null!=e&&e.longitude&&he(e.longitude),null!=e&&e.localname&&J(e.localname),null!=e&&e.zone&&re(e.zone),null!=e&&e.ward&&se(e.ward),null!=e&&e.assembly&&me(e.assembly)},option:ke,optionKey:"i18nkey",t:T,style:{width:"100%"},isSearchable:!0})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("HOUSE_NO")),n.createElement(t.TextInput,{value:j,onChange:e=>V(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("STREET_NAME")),n.createElement(t.TextInput,{value:K,onChange:e=>G(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("ADDRESS_LINE1")),n.createElement(t.TextInput,{value:Z,onChange:e=>J(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("ADDRESS_LINE2")),n.createElement(t.TextInput,{value:ee,onChange:e=>te(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("BLOCK")),n.createElement(t.TextInput,{value:ue,onChange:e=>se(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("ZONE")),n.createElement(t.TextInput,{value:ae,onChange:e=>re(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("LATITUDE")),n.createElement(t.TextInput,{value:Ee,onChange:e=>fe(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("LONGITUDE")),n.createElement(t.TextInput,{value:_e,onChange:e=>he(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("ASSEMBLY_CONSTITUENCY")),n.createElement(t.TextInput,{value:ve,onChange:e=>me(e.target.value),style:{width:"100%"}})),n.createElement("div",null,n.createElement(t.CardLabel,null,T("LANDMARK")),n.createElement(t.TextInput,{value:Y,onChange:e=>X(e.target.value),style:{width:"100%"}}))))},Re=()=>{var e,r,d,u,s,v,m,p,f,g,_,h;const y=i.useTranslation().t,T=o.useLocation(),S=o.useHistory(),b=a.useQueryClient(),N=new URLSearchParams(T.search).get("id"),I=l.useState({}),D=I[0],C=I[1],A=l.useState(null),x=A[0],O=A[1],w=Digit.ULBService.getCurrentTenantId(),L=Digit.Hooks.wt.useFillPointSearch({tenantId:w,filters:{id:N}},{enabled:!!N}),P=L.isLoading,R=L.data;l.useEffect(()=>{if(N&&null!=R&&R.fillingPoints){const e=R.fillingPoints.find(e=>e.id===N);e&&C({id:e.id,tenantId:e.tenantId,status:e.status,owner:{fillingPointName:e.fillingPointName,emergencyName:e.emergencyName,aeName:e.aeName,aeMobile:e.aeMobile,aeEmail:e.aeEmail,jeName:e.jeName,jeMobile:e.jeMobile,jeEmail:e.jeEmail,eeName:e.eeName,eeMobile:e.eeMobile,eeEmail:e.eeEmail},address:c({},e.address)})}},[R,N]);const k=Digit.Hooks.wt.useCreateFillPoint(w).mutate,M=Digit.Hooks.wt.useUpdateFillPoint(w).mutate,F=window.Digit.Utils.browser.isMobile(),B=!(null!=D&&null!==(e=D.owner)&&void 0!==e&&e.aeName&&null!=D&&null!==(r=D.owner)&&void 0!==r&&r.aeMobile&&null!=D&&null!==(d=D.owner)&&void 0!==d&&d.jeName&&null!=D&&null!==(u=D.owner)&&void 0!==u&&u.jeMobile&&null!=D&&null!==(s=D.owner)&&void 0!==s&&s.eeName&&null!=D&&null!==(v=D.owner)&&void 0!==v&&v.eeMobile&&null!=D&&null!==(m=D.address)&&void 0!==m&&m.addressLine1&&null!=D&&null!==(p=D.address)&&void 0!==p&&p.city&&null!=D&&null!==(f=D.address)&&void 0!==f&&f.locality&&null!=D&&null!==(g=D.address)&&void 0!==g&&g.latitude&&null!=D&&null!==(_=D.address)&&void 0!==_&&_.longitude&&null!=D&&null!==(h=D.address)&&void 0!==h&&h.pincode);return P?n.createElement(t.Loader,null):n.createElement("div",{className:"employee-form-section-wrapper"},n.createElement(E,{config:[{timeLine:[{actions:N?"Update Filling Point":"Add Filling Point",currentStep:1}]}],showFinalStep:!1}),n.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"16px"}},n.createElement(we,{t:y,config:{key:"owner"},onSelect:(e,t)=>{C(l=>c({},l,{[e]:t}))},formData:D,visibleFields:["fillingPointName","emergencyName","aeName","aeMobile","aeEmail","jeName","jeMobile","jeEmail","eeName","eeMobile","eeEmail"]}),n.createElement(Pe,{t:y,config:{key:"address"},onSelect:(e,t)=>{C(l=>c({},l,{[e]:c({},l[e]||{},t)}))},formData:D,isEdit:!!N}),n.createElement("div",{style:{display:"flex",marginBottom:"24px",justifyContent:F?"center":"flex-end"}},n.createElement(t.SubmitBar,{label:y(N?"ES_COMMON_UPDATE":"ES_COMMON_SAVE"),onSubmit:e=>{e&&e.preventDefault&&e.preventDefault();const t=(l=c({},D,{tenantId:w}),{RequestInfo:{userInfo:{uuid:(null===(n=Digit.UserService.getUser())||void 0===n||null===(i=n.info)||void 0===i?void 0:i.uuid)||"user-123"}},fillingPoints:[{id:null==l?void 0:l.id,bookingId:null==l?void 0:l.bookingId,tenantId:null==l?void 0:l.tenantId,fillingPointName:null==l||null===(o=l.owner)||void 0===o?void 0:o.fillingPointName,emergencyName:null==l||null===(a=l.owner)||void 0===a?void 0:a.emergencyName,eeName:null==l||null===(r=l.owner)||void 0===r?void 0:r.eeName,eeEmail:null==l||null===(d=l.owner)||void 0===d?void 0:d.eeEmail,eeMobile:null==l||null===(u=l.owner)||void 0===u?void 0:u.eeMobile,aeName:null==l||null===(s=l.owner)||void 0===s?void 0:s.aeName,aeEmail:null==l||null===(v=l.owner)||void 0===v?void 0:v.aeEmail,aeMobile:null==l||null===(m=l.owner)||void 0===m?void 0:m.aeMobile,jeName:null==l||null===(p=l.owner)||void 0===p?void 0:p.jeName,jeEmail:null==l||null===(E=l.owner)||void 0===E?void 0:E.jeEmail,jeMobile:null==l||null===(f=l.owner)||void 0===f?void 0:f.jeMobile,status:null==l?void 0:l.status,address:{houseNo:null==l||null===(g=l.address)||void 0===g?void 0:g.houseNo,streetName:null==l||null===(_=l.address)||void 0===_?void 0:_.streetName,addressLine1:null==l||null===(h=l.address)||void 0===h?void 0:h.addressLine1,addressLine2:null==l||null===(T=l.address)||void 0===T?void 0:T.addressLine2,landmark:null==l||null===(I=l.address)||void 0===I?void 0:I.landmark,city:(null==l||null===(C=l.address)||void 0===C||null===(A=C.city)||void 0===A?void 0:A.name)||(null==l||null===(x=l.address)||void 0===x?void 0:x.city)||"DJB",cityCode:(null==l||null===(L=l.address)||void 0===L?void 0:L.cityCode)||(null==l||null===(P=l.address)||void 0===P||null===(R=P.city)||void 0===R?void 0:R.code)||"DJB",locality:(null==l||null===(F=l.address)||void 0===F||null===(B=F.locality)||void 0===B?void 0:B.label)||(null==l||null===(W=l.address)||void 0===W||null===(U=W.locality)||void 0===U?void 0:U.name)||(null==l||null===(H=l.address)||void 0===H?void 0:H.locality)||"",localityCode:(null==l||null===(j=l.address)||void 0===j||null===(V=j.locality)||void 0===V?void 0:V.code)||(null==l||null===(z=l.address)||void 0===z?void 0:z.localityCode)||"",pincode:null==l||null===(K=l.address)||void 0===K?void 0:K.pincode,latitude:null==l||null===(G=l.address)||void 0===G?void 0:G.latitude,longitude:null==l||null===(q=l.address)||void 0===q?void 0:q.longitude,ward:(null==l||null===(Y=l.address)||void 0===Y?void 0:Y.ward)||(null==l||null===(X=l.address)||void 0===X?void 0:X.block)||"",zone:(null==l||null===(Q=l.address)||void 0===Q?void 0:Q.zone)||"",constituency:(null==l||null===(Z=l.address)||void 0===Z?void 0:Z.assembly)||(null==l||null===(J=l.address)||void 0===J?void 0:J.constituency)||"",type:"FILLING-POINT"}}]});var l,n,i,o,a,r,d,u,s,v,m,p,E,f,g,_,h,T,I,C,A,x,L,P,R,F,B,W,U,H,j,V,z,K,G,q,Y,X,Q,Z,J;(N?M:k)(t,{onSuccess:()=>{O({label:y(N?"WT_FILLING_POINT_UPDATED_SUCCESS":"WT_FILLING_POINT_CREATED_SUCCESS")}),b.invalidateQueries("wtFillPointSearchList"),setTimeout(()=>{O(null),S.push("/digit-ui/employee/wt/search-filling-fix-point?tab=FILLING_POINT")},3e3)},onError:e=>{var t,l,n,i,o,a,r,d,u,s;const c=(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.error)||void 0===n?void 0:n.message)||(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.message)||(null==e||null===(d=e.response)||void 0===d||null===(u=d.data)||void 0===u||null===(s=u.responseInfo)||void 0===s?void 0:s.resMsgId)||y(N?"WT_FILLING_POINT_UPDATED_ERROR":"WT_FILLING_POINT_CREATED_ERROR");O({label:c,isError:!0}),setTimeout(()=>O(null),5e3)}})},disabled:B}))),x&&n.createElement(t.Toast,{error:x.isError,label:x.label,onClose:()=>O(null)}))},ke=()=>{var e,r,d,u,s,v,m,p,f,g,_,h;const y=i.useTranslation().t,T=o.useLocation(),S=o.useHistory(),b=a.useQueryClient(),N=new URLSearchParams(T.search).get("id"),I=l.useState({}),D=I[0],C=I[1],A=l.useState(null),x=A[0],O=A[1],w=Digit.ULBService.getCurrentTenantId(),L=n.useMemo(()=>({tenantId:w,filters:{id:N}}),[w,N]),P=n.useMemo(()=>({enabled:!!N}),[N]),R=Digit.Hooks.wt.useFixedPointSearchAPI(L,P),k=R.isLoading,M=R.data,F=l.useState(!1),B=F[0],W=F[1];l.useEffect(()=>{if(N&&null!=M&&M.waterTankerBookingDetail&&!B){const v=M.waterTankerBookingDetail.find(e=>{var t;return(null===(t=e.applicantDetail)||void 0===t?void 0:t.applicantId)===N});var e,t,l,n,i,o,a,r,d,u,s;v&&(C({owner:{name:null===(e=v.applicantDetail)||void 0===e?void 0:e.name,mobileNumber:null===(t=v.applicantDetail)||void 0===t?void 0:t.mobileNumber,alternateNumber:null===(l=v.applicantDetail)||void 0===l?void 0:l.alternateNumber,emailId:null===(n=v.applicantDetail)||void 0===n?void 0:n.emailId,applicantId:null===(i=v.applicantDetail)||void 0===i?void 0:i.applicantId},address:c({},v.address,{addressId:null===(o=v.address)||void 0===o?void 0:o.addressId,applicantId:null===(a=v.address)||void 0===a?void 0:a.applicantId,block:(null===(r=v.address)||void 0===r?void 0:r.ward)||(null===(d=v.address)||void 0===d?void 0:d.block),assembly:(null===(u=v.address)||void 0===u?void 0:u.constituency)||(null===(s=v.address)||void 0===s?void 0:s.assembly)}),bookingId:v.bookingId,bookingNo:v.bookingNo,auditDetails:v.auditDetails}),W(!0))}},[M,N,B]);const U=n.useMemo(()=>({key:"address"}),[]),H=n.useCallback((e,t)=>{C(l=>c({},l,{[e]:c({},l[e]||{},t)}))},[]),j=Digit.Hooks.wt.useCreateFixedPoint(w).mutate,V=Digit.Hooks.wt.useUpdateFixedPoint(w).mutate,z=window.Digit.Utils.browser.isMobile(),K=!(null!=D&&null!==(e=D.owner)&&void 0!==e&&e.name&&null!=D&&null!==(r=D.owner)&&void 0!==r&&r.mobileNumber&&null!=D&&null!==(d=D.address)&&void 0!==d&&d.addressLine1&&null!=D&&null!==(u=D.address)&&void 0!==u&&u.city&&null!=D&&null!==(s=D.address)&&void 0!==s&&s.locality&&null!=D&&null!==(v=D.address)&&void 0!==v&&v.latitude&&null!=D&&null!==(m=D.address)&&void 0!==m&&m.longitude&&null!=D&&null!==(p=D.address)&&void 0!==p&&p.pincode);return k?n.createElement(t.Loader,null):n.createElement("div",{className:"employee-form-section-wrapper"},n.createElement(E,{config:[{timeLine:[{actions:N?"Update Fixed Point":"Add Fixed Point",currentStep:1}]}],showFinalStep:!1}),n.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"16px"}},n.createElement(t.CollapsibleCardPage,{title:y("Fixed Point Details"),defaultOpen:!0},n.createElement("div",{className:"formcomposer-section-grid"},n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.CardLabel,null,""+y("WT_FIXING_POINT_APPLICANT_DETAILS")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextInput,{t:y,type:"text",name:"name",value:null==D||null===(f=D.owner)||void 0===f?void 0:f.name,style:{width:"100%"},onChange:e=>H("owner",{name:e.target.value})})),n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.CardLabel,null,""+y("COMMON_MOBILE_NUMBER")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.MobileNumber,{value:null==D||null===(g=D.owner)||void 0===g?void 0:g.mobileNumber,name:"mobileNumber",onChange:e=>H("owner",{mobileNumber:e}),style:{width:"100%"}})),n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.CardLabel,null,""+y("COMMON_EMAIL_ID")),n.createElement(t.TextInput,{t:y,type:"email",name:"emailId",value:null==D||null===(_=D.owner)||void 0===_?void 0:_.emailId,style:{width:"100%"},onChange:e=>H("owner",{emailId:e.target.value})})),n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.CardLabel,null,""+y("COMMON_ALT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{value:null==D||null===(h=D.owner)||void 0===h?void 0:h.alternateNumber,name:"alternateNumber",onChange:e=>H("owner",{alternateNumber:e}),style:{width:"100%"}})))),n.createElement("div",null,n.createElement(Pe,{t:y,config:U,onSelect:H,formData:D,isEdit:!!N})),n.createElement("div",{style:{display:"flex",justifyContent:z?"center":"flex-end"}},n.createElement(t.SubmitBar,{label:y(N?"ES_COMMON_UPDATE":"ES_COMMON_SAVE"),onSubmit:e=>{const t={waterTankerBookingDetail:{bookingId:(null==(l=c({},D,{tenantId:w}))?void 0:l.bookingId)||"",bookingNo:(null==l?void 0:l.bookingNo)||null,tenantId:null==l?void 0:l.tenantId,mobileNumber:(null==l||null===(n=l.owner)||void 0===n?void 0:n.mobileNumber)||"",applicantDetail:{applicantId:(null==l||null===(i=l.owner)||void 0===i?void 0:i.applicantId)||null,bookingId:(null==l?void 0:l.bookingId)||"",name:(null==l||null===(o=l.owner)||void 0===o?void 0:o.name)||(null==l||null===(a=l.owner)||void 0===a?void 0:a.applicantName)||"",mobileNumber:(null==l||null===(r=l.owner)||void 0===r?void 0:r.mobileNumber)||"",alternateNumber:(null==l||null===(d=l.owner)||void 0===d?void 0:d.alternateNumber)||"",emailId:(null==l||null===(u=l.owner)||void 0===u?void 0:u.emailId)||"",type:"FIXED-POINT"},address:{addressId:(null==l||null===(s=l.address)||void 0===s?void 0:s.addressId)||null,applicantId:(null==l||null===(v=l.address)||void 0===v?void 0:v.applicantId)||null,houseNo:(null==l||null===(m=l.address)||void 0===m?void 0:m.houseNo)||"",streetName:(null==l||null===(p=l.address)||void 0===p?void 0:p.streetName)||"",addressLine1:(null==l||null===(E=l.address)||void 0===E?void 0:E.addressLine1)||"",addressLine2:(null==l||null===(f=l.address)||void 0===f?void 0:f.addressLine2)||"",landmark:(null==l||null===(g=l.address)||void 0===g?void 0:g.landmark)||"",city:(null==l||null===(_=l.address)||void 0===_||null===(h=_.city)||void 0===h?void 0:h.name)||(null==l||null===(T=l.address)||void 0===T?void 0:T.city)||"DJB",cityCode:(null==l||null===(I=l.address)||void 0===I?void 0:I.cityCode)||(null==l||null===(C=l.address)||void 0===C||null===(A=C.city)||void 0===A?void 0:A.code)||"DJB",locality:(null==l||null===(x=l.address)||void 0===x||null===(L=x.locality)||void 0===L?void 0:L.label)||(null==l||null===(P=l.address)||void 0===P||null===(R=P.locality)||void 0===R?void 0:R.name)||(null==l||null===(k=l.address)||void 0===k?void 0:k.locality)||"",localityCode:(null==l||null===(M=l.address)||void 0===M||null===(F=M.locality)||void 0===F?void 0:F.code)||(null==l||null===(B=l.address)||void 0===B?void 0:B.localityCode)||"",latitude:(null==l||null===(W=l.address)||void 0===W?void 0:W.latitude)||"",longitude:(null==l||null===(U=l.address)||void 0===U?void 0:U.longitude)||"",pincode:(null==l||null===(H=l.address)||void 0===H?void 0:H.pincode)||"",ward:(null==l||null===(z=l.address)||void 0===z?void 0:z.ward)||(null==l||null===(K=l.address)||void 0===K?void 0:K.block)||"",zone:(null==l||null===(G=l.address)||void 0===G?void 0:G.zone)||"",constituency:(null==l||null===(q=l.address)||void 0===q?void 0:q.assembly)||(null==l||null===(Y=l.address)||void 0===Y?void 0:Y.constituency)||"",type:"FIXED-POINT"}}};var l,n,i,o,a,r,d,u,s,v,m,p,E,f,g,_,h,T,I,C,A,x,L,P,R,k,M,F,B,W,U,H,z,K,G,q,Y;(N?V:j)(t,{onSuccess:()=>{O({label:y(N?"WT_FILLING_POINT_UPDATED_SUCCESS":"WT_FILLING_POINT_CREATED_SUCCESS")}),b.invalidateQueries("wtFixedPointSearchList"),setTimeout(()=>{O(null),S.push("/digit-ui/employee/wt/search-filling-fix-point?tab=FIXED_POINT")},3e3)},onError:e=>{var t,l,n,i,o,a,r,d,u,s;const c=(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.error)||void 0===n?void 0:n.message)||(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.message)||(null==e||null===(d=e.response)||void 0===d||null===(u=d.data)||void 0===u||null===(s=u.responseInfo)||void 0===s?void 0:s.resMsgId)||y(N?"WT_FILLING_POINT_UPDATED_ERROR":"WT_FILLING_POINT_CREATED_ERROR");O({label:c,isError:!0}),setTimeout(()=>O(null),5e3)}})},disabled:K}))),x&&n.createElement(t.Toast,{error:x.isError,label:x.label,onClose:()=>O(null)}))},Me=e=>{var i,o;let a=e.t,r=e.closeModal,d=e.onSubmit,u=e.initialValues,s=e.tenantId,c=e.modalMode;const v="VIEW"===c,m="UPDATE"===c,p=l.useState(null),E=p[0],f=p[1],g=l.useState([]),_=g[0],h=g[1],y=Digit.Hooks.hrms.useHrmsMDMS(s,"egov-location","HRMSRolesandDesignation"),T=y.data,S=y.isLoading,b=l.useMemo(()=>{var e,t;return((null===(e=(null==T?void 0:T.MdmsRes)||T)||void 0===e||null===(t=e["egov-location"])||void 0===t?void 0:t.TenantBoundary)||[]).map(e=>({i18nKey:e.hierarchyType.name||e.hierarchyType.code||e.hierarchyType,code:e.hierarchyType.code||e.hierarchyType,boundary:e.boundary}))},[T]);n.useEffect(()=>{b.length>0&&!E&&f(b[0])},[b,E]);const N=function(e,t){return void 0===t&&(t=[]),e?(("Locality"===e.label||e.children&&0===e.children.length&&e.code)&&t.push({name:e.localname||e.name,code:e.code,i18nKey:e.code}),e.children&&e.children.forEach(e=>N(e,t)),t):t},I=l.useMemo(()=>E&&E.boundary?N(E.boundary):[],[E]);return n.useEffect(()=>{var e,t;if(I.length>0&&0===_.length&&((null==u||null===(e=u.fillingPointLocalityCodes)||void 0===e?void 0:e.length)>0||null!=u&&null!==(t=u.address)&&void 0!==t&&t.locality)&&(v||m)){var l;const e=(null==u||null===(l=u.fillingPointLocalityCodes)||void 0===l?void 0:l.length)>0?u.fillingPointLocalityCodes:"string"==typeof u.address.locality?u.address.locality.split(",").map(e=>e.trim()):[],t=I.filter(t=>e.some(e=>e===t.code||e.toLowerCase()===(t.name||"").toLowerCase()));t.length>0&&h(t)}},[I,u,v,m,_]),S?n.createElement(t.Loader,null):n.createElement("div",{className:"custom-modal-overlay",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2e5}},n.createElement("style",null,"\n .custom-modal-content {\n background-color: #fff;\n border-radius: 8px;\n width: 50%;\n max-width: 600px;\n max-height: 90vh;\n display: flex;\n flex-direction: column;\n box-shadow: 0 4px 12px rgba(0,0,0,0.15);\n position: relative;\n }\n @media (max-width: 768px) {\n .custom-modal-content {\n width: 90%;\n }\n }\n "),n.createElement("div",{className:"custom-modal-content"},n.createElement("div",{className:"custom-modal-header",style:{padding:"16px 24px",borderBottom:"1px solid #eee",display:"flex",justifyContent:"space-between",alignItems:"center"}},n.createElement("h1",{style:{margin:0,fontSize:"20px",fontWeight:"600",color:"#1D4E7F"}},a(v?"WT_VIEW_LOCALITY":m?"WT_UPDATE_LOCALITY":"WT_ADD_TO_LOCALITY")),n.createElement("button",{onClick:r,style:{background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×")),n.createElement("div",{style:{padding:"24px"}},n.createElement("div",{style:{marginBottom:"16px"}},n.createElement(t.CardLabel,null,a("WT_CURRENT_LOCALITY")),n.createElement("div",{style:{fontWeight:"600",marginBottom:"8px"}},(null==u||null===(i=u.fillingPointLocalityCodes)||void 0===i?void 0:i.length)>0?u.fillingPointLocalityCodes.join(", "):(null==u||null===(o=u.address)||void 0===o?void 0:o.locality)||"NA")),!v&&n.createElement("div",{style:{marginBottom:"16px"}},n.createElement(t.CardLabel,null,a("WT_SELECT_NEW_LOCALITY")),n.createElement(t.MultiSelectDropdown,{options:I,optionsKey:"i18nKey",selected:_,onSelect:e=>{if(!v){const t=e.map(e=>e[1]);h(t)}},t:a,disabled:!E||v}),(null==_?void 0:_.length)>0&&n.createElement("div",{style:{marginTop:"8px",fontSize:"14px",color:"#666"}},n.createElement("strong",null,a("WT_LOCALITY_CODES"),":")," ",_.map(e=>e.code).join(", ")))),n.createElement("div",{className:"custom-modal-footer",style:{padding:"16px 24px",borderTop:"1px solid #eee",display:"flex",justifyContent:"flex-end",gap:"12px"}},n.createElement("button",{onClick:r,style:{padding:"8px 20px",border:"1px solid #ccc",background:"#f4f4f4",borderRadius:"4px",cursor:"pointer"}},a("CS_COMMON_CANCEL")),!v&&n.createElement("button",{onClick:()=>{d({hierarchyType:E,locality:_})},style:{padding:"8px 20px",background:"#1D4E7F",color:"#fff",border:"none",borderRadius:"4px",cursor:"pointer"}},a("CS_COMMON_SAVE")))))};delete s.Icon.Default.prototype._getIconUrl,s.Icon.Default.mergeOptions({iconRetinaUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",iconUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png"});const Fe=new s.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-blue.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),Be=new s.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12.5,41],popupAnchor:[1,-34],shadowSize:[41,41]}),We=new s.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[35,57],iconAnchor:[17.5,57],popupAnchor:[1,-45],shadowSize:[50,50]}),Ue=e=>{let t=e.bounds,n=e.center,i=e.zoom;const o=u.useMap();return l.useEffect(()=>{n?o.setView(n,i||15,{animate:!0}):t&&t.length>0&&o.fitBounds(t)},[t,n,i,o]),null},He=e=>{var i;let a=e.fillingPoints,r=void 0===a?[]:a,d=e.isLoading,s=e.t;const v=o.useHistory(),m=l.useState(null),p=m[0],E=m[1],f=l.useState(null),g=f[0],_=f[1],h=l.useState(null),y=h[0],T=h[1],S=l.useState(null),b=S[0],N=S[1],I=l.useState(11),D=I[0],C=I[1],A=l.useRef({}),x=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:Digit.ULBService.getCurrentTenantId(),filters:{fillingPointId:(L=p,(null==L?void 0:L.id)||(null==L?void 0:L.bookingId)||(null==L?void 0:L.fillingPointId)||(null==L?void 0:L.uuid)||(null==L||null===(P=L.fillingpointmetadata)||void 0===P?void 0:P.fillingPointId)),limit:1e3}},{enabled:!!p}),O=x.isLoading,w=x.data;var L,P;const R=l.useMemo(()=>p&&(null==w?void 0:w.waterTankerBookingDetail)||[],[p,w]),k=l.useMemo(()=>p?[p].filter(e=>{var t,l;return(null===(t=e.address)||void 0===t?void 0:t.latitude)&&(null===(l=e.address)||void 0===l?void 0:l.longitude)}):(null==r?void 0:r.filter(e=>{var t,l;return(null===(t=e.address)||void 0===t?void 0:t.latitude)&&(null===(l=e.address)||void 0===l?void 0:l.longitude)}))||[],[r,p]),M=l.useMemo(()=>R.filter(e=>{var t,l;return(null===(t=e.address)||void 0===t?void 0:t.latitude)&&(null===(l=e.address)||void 0===l?void 0:l.longitude)}),[R]);l.useEffect(()=>{if(y){const e=A.current[y];e&&e.openPopup()}else if(g){var e;const t=g.id||(null===(e=g.applicantDetail)||void 0===e?void 0:e.applicantId),l=A.current[t];l&&l.openPopup()}else Object.values(A.current).forEach(e=>{e&&e.isPopupOpen&&e.isPopupOpen()&&e.closePopup()})},[y,g]);const F=l.useMemo(()=>{const e=[...k.map(e=>[parseFloat(e.address.latitude),parseFloat(e.address.longitude)]),...M.map(e=>[parseFloat(e.address.latitude),parseFloat(e.address.longitude)])];return 0===e.length?null:e},[k,M]);return l.useMemo(()=>R.map(e=>{var t;return c({},e,{displayName:(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||(null==e?void 0:e.name)||"NA"})}),[R]),d||O?n.createElement(t.Loader,null):n.createElement("div",{style:{display:"flex",flexDirection:window.innerWidth<768?"column":"row",height:"700px",width:"100%",borderRadius:"12px",overflow:"hidden",border:"1px solid #ddd",marginTop:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.12)",background:"#fff"}},n.createElement("div",{style:{width:window.innerWidth<768?"100%":"320px",padding:"24px",borderRight:"1px solid #eee",display:"flex",flexDirection:"column",gap:"20px",background:"#f9f9f9",zIndex:10,overflowY:"auto"}},n.createElement("h3",{style:{margin:"0 0 8px 0",color:"#1D4E7F",fontSize:"20px",fontWeight:"600"}},s("WT_MAP_FILTERS")),n.createElement("div",{className:"filter-item"},n.createElement("label",{style:{display:"block",marginBottom:"8px",fontSize:"14px",fontWeight:"500",color:"#666"}},s("WT_FILLING_POINT")),n.createElement(t.Dropdown,{option:r,optionKey:"fillingPointName",selected:p,select:e=>{E(e),_(null),N(null)},t:s,placeholder:s("WT_SELECT_FILLING_POINT")})),p&&n.createElement("div",{className:"filter-item",style:{flex:1,display:"flex",flexDirection:"column"}},n.createElement("label",{style:{display:"block",marginBottom:"12px",fontSize:"14px",fontWeight:"600",color:"#1D4E7F"}},s("WT_MAPPED_FIXED_POINTS")," (",R.length,")"),n.createElement("div",{style:{maxHeight:"350px",overflowY:"auto",paddingRight:"8px",display:"flex",flexDirection:"column",gap:"8px"}},R.length>0?R.map((e,t)=>{var l,i,o,a,r,d,u,c,m,p,E,f,h,S,b;const I=(null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.fixedPointId)||(null==e?void 0:e.id)||(null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.applicantId)||t,D=(null==g||null===(o=g.applicantDetail)||void 0===o?void 0:o.fixedPointId)||(null==g?void 0:g.id)||(null==g||null===(a=g.applicantDetail)||void 0===a?void 0:a.applicantId),x=g&&I===D,O=e.id||(null===(r=e.applicantDetail)||void 0===r?void 0:r.applicantId)||t;return n.createElement("div",{key:t,onClick:()=>(e=>{var t,l,n,i;const o=(null==g||null===(t=g.applicantDetail)||void 0===t?void 0:t.fixedPointId)||(null==g?void 0:g.id)||(null==g||null===(l=g.applicantDetail)||void 0===l?void 0:l.applicantId),a=(null==e||null===(n=e.applicantDetail)||void 0===n?void 0:n.fixedPointId)||(null==e?void 0:e.id)||(null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.applicantId);if(g&&o===a){var r;_(null);const t=e.id||(null===(r=e.applicantDetail)||void 0===r?void 0:r.applicantId),l=A.current[t];l&&l.closePopup()}else{var d,u;_(e),null!=e&&null!==(d=e.address)&&void 0!==d&&d.latitude&&null!=e&&null!==(u=e.address)&&void 0!==u&&u.longitude&&(N([parseFloat(e.address.latitude),parseFloat(e.address.longitude)]),C(16))}})(e),onMouseEnter:()=>{var t,l;T(O),null!=e&&null!==(t=e.address)&&void 0!==t&&t.latitude&&null!=e&&null!==(l=e.address)&&void 0!==l&&l.longitude&&(N([parseFloat(e.address.latitude),parseFloat(e.address.longitude)]),C(16))},onMouseLeave:()=>T(null),style:{padding:"12px",background:x?"#E6EEF5":"#fff",border:x?"1.5px solid #1D4E7F":"1px solid #e0e0e0",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s ease",fontSize:"13px",color:x?"#1D4E7F":"#333",fontWeight:x?"600":"400",display:"flex",alignItems:"flex-start",gap:"10px",boxShadow:x?"0 2px 8px rgba(29, 78, 127, 0.15)":y===O?"0 4px 12px rgba(0,0,0,0.1)":"none",transform:y===O?"translateX(4px)":"none"}},n.createElement("div",{style:{width:"10px",height:"10px",borderRadius:"50%",background:"#417505",boxShadow:"0 0 4px rgba(65, 117, 5, 0.4)",marginTop:"5px",flexShrink:0}}),n.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement("span",{style:{fontWeight:"700"}},(null==e||null===(d=e.applicantDetail)||void 0===d?void 0:d.fixedPointId)||"NA"),n.createElement("span",{style:{fontSize:"11px",color:"#888",fontWeight:"400"}},(null==e||null===(u=e.applicantDetail)||void 0===u?void 0:u.name)||(null==e?void 0:e.name)||"NA")),n.createElement("div",{style:{color:"#1D4E7F",fontSize:"10px",paddingTop:"4px"}},x?"▲":"▼")),x&&n.createElement("div",{style:{marginTop:"8px",paddingTop:"8px",borderTop:"1px solid #eee",fontSize:"12px",color:"#555",display:"flex",flexDirection:"column",gap:"4px"}},n.createElement("div",null,n.createElement("strong",null,s("WT_MOBILE_NUMBER"),":")," ",(null==e||null===(c=e.applicantDetail)||void 0===c?void 0:c.mobileNumber)||"NA"),n.createElement("div",null,n.createElement("strong",null,s("WT_LOCALITY"),":")," ",(null==e||null===(m=e.address)||void 0===m?void 0:m.locality)||"NA"),n.createElement("div",null,n.createElement("strong",null,"Email:")," ",(null==e||null===(p=e.applicantDetail)||void 0===p?void 0:p.emailId)||"NA"),n.createElement("div",null,n.createElement("strong",null,"Alt Mobile:")," ",(null==e||null===(E=e.applicantDetail)||void 0===E?void 0:E.alternateNumber)||"NA"),n.createElement("div",null,n.createElement("strong",null,"Address:")," ",[null==e||null===(f=e.address)||void 0===f?void 0:f.houseNo,null==e||null===(h=e.address)||void 0===h?void 0:h.streetName,null==e||null===(S=e.address)||void 0===S?void 0:S.city,null==e||null===(b=e.address)||void 0===b?void 0:b.pincode].filter(Boolean).join(", ")||"NA"),n.createElement("button",{onClick:t=>{var l;t.stopPropagation();const n=(null==e?void 0:e.id)||(null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.applicantId);v.push("/digit-ui/employee/wt/add-fix-point-address?id="+n)},style:{marginTop:"8px",padding:"6px 12px",background:"#F47738",color:"#fff",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"bold",alignSelf:"flex-start",transition:"background 0.2s"},onMouseEnter:e=>e.target.style.background="#D6662E",onMouseLeave:e=>e.target.style.background="#F47738"},"Edit Fixed Point"))))}):n.createElement("div",{style:{textAlign:"center",padding:"20px",color:"#999",fontSize:"13px",border:"1px dashed #ccc",borderRadius:"8px"}},s("WT_NO_MAPPED_POINTS")))),n.createElement("button",{onClick:()=>{E(null),_(null),N(null),C(11)},style:{marginTop:"auto",padding:"12px",background:"#fff",border:"1px solid #1D4E7F",color:"#1D4E7F",borderRadius:"6px",cursor:"pointer",fontWeight:"600",transition:"all 0.2s"},onMouseOver:e=>{e.target.style.background="#1D4E7F",e.target.style.color="#fff"},onMouseOut:e=>{e.target.style.background="#fff",e.target.style.color="#1D4E7F"}},s("ES_COMMON_CLEAR_ALL")),p&&n.createElement("div",{style:{marginTop:"20px",padding:"16px",background:"#fff",borderRadius:"8px",border:"1px solid #e0e0e0"}},n.createElement("h4",{style:{margin:"0 0 12px 0",fontSize:"14px",color:"#333",borderBottom:"1px solid #f0f0f0",paddingBottom:"8px"}},s("WT_SUMMARY")),n.createElement("div",{style:{fontSize:"13px",display:"flex",flexDirection:"column",gap:"8px"}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},n.createElement("span",{style:{color:"#777"}},s("WT_FIXED_POINTS"),":"),n.createElement("span",{style:{fontWeight:"600"}},R.length)),n.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},n.createElement("span",{style:{color:"#777"}},s("WT_LOCALITY"),":"),n.createElement("span",{style:{fontWeight:"600"}},(null===(i=p.address)||void 0===i?void 0:i.locality)||"NA"))))),n.createElement("div",{style:{flex:1,position:"relative"}},n.createElement(u.MapContainer,{center:[28.6139,77.209],zoom:11,style:{height:"100%",width:"100%"},scrollWheelZoom:!0},n.createElement(u.TileLayer,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),n.createElement(Ue,{bounds:F,center:b,zoom:D}),k.map((e,t)=>{var l,i,o;return n.createElement(n.Fragment,{key:"fp-group-"+(e.id||t)},n.createElement(u.Circle,{center:[parseFloat(e.address.latitude),parseFloat(e.address.longitude)],radius:5e3,pathOptions:{color:"#0d2745ff",fillColor:"#041a34ff",fillOpacity:.1,weight:1,dashArray:"5, 5"}}),n.createElement(u.Marker,{key:"fp-"+(e.id||t),position:[parseFloat(e.address.latitude),parseFloat(e.address.longitude)],icon:Fe,eventHandlers:{mouseover:e=>e.target.openPopup(),mouseout:e=>e.target.closePopup()}},n.createElement(u.Popup,null,n.createElement("div",{style:{padding:"8px",minWidth:"200px"}},n.createElement("h4",{style:{margin:"0 0 8px 0",color:"#1F5FA8",fontSize:"16px",borderBottom:"1px solid #eee",paddingBottom:"4px"}},e.fillingPointName," (Filling Point)"),n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px"}},n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_FILLING_POINT_CODE"),":")," ",e.fillingPointId),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_LOCALITY"),":")," ",(null===(l=e.address)||void 0===l?void 0:l.locality)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_AE_NAME"),":")," ",(null==e?void 0:e.aeName)||"NA"," (",(null==e?void 0:e.aeMobile)||"NA",")"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_JE_NAME"),":")," ",(null==e?void 0:e.jeName)||"NA"," (",(null==e?void 0:e.jeMobile)||"NA",")"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_EE_NAME"),":")," ",(null==e?void 0:e.eeName)||"NA"," (",(null==e?void 0:e.eeMobile)||"NA",")"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,"Latitude:")," ",(null===(i=e.address)||void 0===i?void 0:i.latitude)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,"Longitude:")," ",(null===(o=e.address)||void 0===o?void 0:o.longitude)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px",color:"#1F5FA8"}},n.createElement("strong",null,"Coverage:")," 5 KM Radius"))))))}),M.map((e,t)=>{var l,i,o,a,r,d,c,v,m,p,E,f,_,h,S,b,N;const I=e.id||(null===(l=e.applicantDetail)||void 0===l?void 0:l.applicantId)||t,D=y===I,C=(null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.fixedPointId)||(null==e?void 0:e.id)||(null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.applicantId)||t,x=(null==g||null===(a=g.applicantDetail)||void 0===a?void 0:a.fixedPointId)||(null==g?void 0:g.id)||(null==g||null===(r=g.applicantDetail)||void 0===r?void 0:r.applicantId),O=g&&C===x;return n.createElement(u.Marker,{key:"fx-"+I,position:[parseFloat(e.address.latitude),parseFloat(e.address.longitude)],icon:D||O?We:Be,zIndexOffset:D||O?1e3:0,ref:e=>A.current[I]=e,eventHandlers:{mouseover:()=>{T(I)},mouseout:()=>{T(null)}}},n.createElement(u.Popup,null,n.createElement("div",{style:{padding:"8px",minWidth:"200px"}},n.createElement("h4",{style:{margin:"0 0 8px 0",color:"#417505",fontSize:"16px",borderBottom:"1px solid #eee",paddingBottom:"4px"}},(null==e||null===(d=e.applicantDetail)||void 0===d?void 0:d.name)||(null==e?void 0:e.name)||"NA"," (Fixed Point)"),n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px"}},n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_FIXED_POINT_CODE"),":")," ",(null==e||null===(c=e.applicantDetail)||void 0===c?void 0:c.fixedPointId)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_MOBILE_NUMBER"),":")," ",(null==e||null===(v=e.applicantDetail)||void 0===v?void 0:v.mobileNumber)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,s("WT_LOCALITY"),":")," ",(null==e||null===(m=e.address)||void 0===m?void 0:m.locality)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,"Email:")," ",(null==e||null===(p=e.applicantDetail)||void 0===p?void 0:p.emailId)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,"Alt Mobile:")," ",(null==e||null===(E=e.applicantDetail)||void 0===E?void 0:E.alternateNumber)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,"Address:")," ",[null==e||null===(f=e.address)||void 0===f?void 0:f.houseNo,null==e||null===(_=e.address)||void 0===_?void 0:_.streetName,null==e||null===(h=e.address)||void 0===h?void 0:h.city,null==e||null===(S=e.address)||void 0===S?void 0:S.pincode].filter(Boolean).join(", ")||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,"Latitude:")," ",(null==e||null===(b=e.address)||void 0===b?void 0:b.latitude)||"NA"),n.createElement("p",{style:{margin:0,fontSize:"12px"}},n.createElement("strong",null,"Longitude:")," ",(null==e||null===(N=e.address)||void 0===N?void 0:N.longitude)||"NA")))))}))))},je=()=>{var e,a,r,d,u,s;const v=i.useTranslation().t,m=o.useHistory(),p=o.useLocation(),E=new URLSearchParams(p.search).get("tab")||"FILLING_POINT",f=l.useState(E),g=f[0],_=f[1],h=l.useState(!1),y=h[0],T=h[1],S=l.useState(""),b=S[0],N=S[1],D=l.useState(""),C=D[0],A=D[1],x=l.useState(null),O=x[0],w=x[1],L=l.useState(null),P=L[0],R=L[1],k=l.useState(null),M=k[0],F=k[1],B=l.useState({}),W=B[0],U=B[1],H=l.useState(null),j=H[0],V=H[1],z=l.useState(null),K=z[0],q=z[1],Y=l.useState(!1),X=Y[0],Q=Y[1],Z=l.useState(null),J=Z[0],$=Z[1],ee=l.useState("ADD"),te=ee[0],le=ee[1],ne=l.useState(50),ie=ne[0],oe=ne[1],ae=l.useState(0),re=ae[0],de=ae[1],ue=l.useState({}),se=ue[0],ce=ue[1],ve=l.useState({}),me=ve[0],pe=ve[1],Ee=Digit.ULBService.getCurrentTenantId(),fe=()=>{q(null)},ge=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:Ee,filters:c({},W,{offset:re,limit:ie})},{enabled:"FIXED_POINT"===g}),_e=ge.isLoading,he=ge.data,ye=ge.refetch,Te=Digit.Hooks.wt.useFillPointSearch({tenantId:Ee,filters:c({},W,{offset:re,limit:ie})},{enabled:"FILLING_POINT"===g}),Se=Te.isLoading,be=Te.data,Ne=Te.refetch,Ie=Digit.Hooks.wt.useFillPointSearch({tenantId:Ee,filters:{limit:1e3}},{enabled:!0}),De=Ie.isLoading,Ce=Ie.data,Ae=(null==Ce?void 0:Ce.fillingPoints)||[],xe=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:Ee,filters:{limit:1e3}},{enabled:!0}),Oe=xe.isLoading,we=xe.data,Le=(null==we?void 0:we.waterTankerBookingDetail)||[],Pe=Digit.Hooks.wt.useVendorFillingMapping(Ee).mutate,Re=Digit.Hooks.wt.useUpdateFillPoint(Ee).mutate,ke="FIXED_POINT"===g?_e:Se,Fe=n.useMemo(()=>{let e=("FIXED_POINT"===g?null==he?void 0:he.waterTankerBookingDetail:null==be?void 0:be.fillingPoints)||[];return"FIXED_POINT"===g&&null!=M&&M.code&&(e=e.filter(e=>{var t,l,n,i;const o=e.fillingPointId||(null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||e.fillingPtName||e.filling_pt_name||(e.fillingPoint&&"object"==typeof e.fillingPoint?null===(l=e.fillingPoint)||void 0===l?void 0:l.id:e.fillingPoint)||(null===(n=e.fillingPointDetail)||void 0===n?void 0:n.id)||(null===(i=e.fillingPointDetail)||void 0===i?void 0:i.bookingId);return"MAPPED"===M.code?!!o:"UNMAPPED"!==M.code||!o})),e},[he,be,g,M]),Be={FIXED_POINT:{label:"WT_FIXING_POINT_APPLICANT_DETAILS",placeholder:"WT_ENTER_FIXED_POINT_NAME"},FILLING_POINT:{label:"WT_FILLING_POINT_NAME",placeholder:"WT_ENTER_FILLING_POINT_NAME"},VIEW_ON_MAP:{label:"WT_VIEW_ON_MAP",placeholder:""}}[g],We=Be.label,Ue=Be.placeholder,je=()=>{N(""),A(""),w(null),R(null),F(null),V(null),U({})},Ve=e=>{_(e),je(),de(0),U({})},ze=e=>(null==e?void 0:e.id)||(null==e?void 0:e.bookingId)||(null==e?void 0:e.fillingPointId)||(null==e?void 0:e.uuid),Ke=e=>{const t=ze(e);return t&&Object.prototype.hasOwnProperty.call(se,t)?se[t]:!0===(null==e?void 0:e.status)||"true"===(null==e?void 0:e.status)||"ACTIVE"===(null==e?void 0:e.status)},Ge=function(e,t){void 0===t&&(t="ADD"),$(e.original),le(t),Q(!0)},qe=Digit.Hooks.wt.useLinkFillingPointLocality(Ee).mutate,Ye=Digit.Hooks.wt.useUpdateFillingPointLocality(Ee).mutate,Xe=(e,t,l)=>e?l((t||Digit.ULBService.getCurrentTenantId()||"djb").replace(".","_").toUpperCase()+"_REVENUE_"+e):"",Qe=n.useMemo(()=>"FIXED_POINT"===g?[{Header:v("WT_FIXED_POINT_CODE"),accessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.fixedPointId)||"NA"},id:"fixedPointId"},{Header:v("WT_FIXING_POINT_APPLICANT_DETAILS"),accessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||"NA"},id:"applicantName",Cell:e=>{var t,l;let i=e.row;return n.createElement("span",{className:"link"},n.createElement(o.Link,{to:"/digit-ui/employee/wt/add-fix-point-address?id="+(null===(t=i.original.applicantDetail)||void 0===t?void 0:t.applicantId)},(null===(l=i.original.applicantDetail)||void 0===l?void 0:l.name)||"NA"))}},{Header:v("WT_MOBILE_NUMBER"),accessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.mobileNumber)||"NA"},id:"mobileNumber"},{Header:v("WT_LOCALITY"),accessor:e=>{var t;return Xe(null==e||null===(t=e.address)||void 0===t?void 0:t.locality,Ee,v)||"NA"},id:"locality"},{Header:v("WT_LATITUDE"),accessor:e=>{var t;return(null==e||null===(t=e.address)||void 0===t?void 0:t.latitude)||"NA"},id:"latitude"},{Header:v("WT_LONGITUDE"),accessor:e=>{var t;return(null==e||null===(t=e.address)||void 0===t?void 0:t.longitude)||"NA"},id:"longitude"},{Header:v("WT_FILLING_POINT"),accessor:e=>{var t;return(null==e?void 0:e.fillingPointId)||(null==e||null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||(null==e?void 0:e.fillingPtName)||(null==e?void 0:e.filling_pt_name)||(null==e?void 0:e.fillingPoint)||"NA"},id:"fillingPoint",minWidth:250,Cell:e=>{var l,i,o,a;let r=e.row;const d=String(r.original.fillingPointId||(null===(l=r.original.fillingpointmetadata)||void 0===l?void 0:l.fillingPointId)||r.original.fillingPtName||r.original.filling_pt_name||(r.original.fillingPoint&&"object"==typeof r.original.fillingPoint?null===(i=r.original.fillingPoint)||void 0===i?void 0:i.id:r.original.fillingPoint)||(null===(o=r.original.fillingPointDetail)||void 0===o?void 0:o.id)||(null===(a=r.original.fillingPointDetail)||void 0===a?void 0:a.bookingId)||""),u=null==Ae?void 0:Ae.find(e=>{var t;return String(e.id||e.bookingId||e.fillingPointId||e.uuid||(null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId))===d&&"undefined"!==d&&"null"!==d&&""!==d});return n.createElement(t.Dropdown,{className:"fsm-registry-dropdown",selected:u,option:Ae,select:e=>((e,t)=>{var l,n;const i={fixedFillingPointMapping:{fixed_pt_name:null===(l=e.original.applicantDetail)||void 0===l?void 0:l.applicantId,filling_pt_name:t.id||t.bookingId||t.fillingPointId||t.uuid||(null===(n=t.fillingpointmetadata)||void 0===n?void 0:n.fillingPointId)}};Pe(i,{onSuccess:()=>{q({label:v("WT_FIXED_FILLING_MAPPING_SUCCESS")}),setTimeout(fe,5e3),ye()},onError:e=>{var t,l,n,i;q({label:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.message)||v("WT_FIXED_FILLING_MAPPING_FAIL"),error:!0}),setTimeout(fe,5e3)}})})(r,e),style:{textAlign:"left",width:"100%",minWidth:"250px"},optionKey:"fillingPointName",t:v})}}]:[{Header:v("WT_FILLING_POINT_CODE"),accessor:e=>(null==e?void 0:e.fillingPointId)||"NA",id:"fillingPointId"},{Header:v("WT_FILLING_POINT_NAME"),accessor:e=>(null==e?void 0:e.fillingPointName)||"NA",id:"fillingPointName",Cell:e=>{let t=e.row;return n.createElement("span",{className:"link"},n.createElement(o.Link,{to:"/digit-ui/employee/wt/add-filling-point-address?id="+t.original.id},t.original.fillingPointName||"NA"))}},{Header:v("WT_AE_NAME"),accessor:e=>(null==e?void 0:e.aeName)||"NA",id:"aeName"},{Header:v("WT_JE_NAME"),accessor:e=>(null==e?void 0:e.jeName)||"NA",id:"jeName"},{Header:v("WT_EE_NAME"),accessor:e=>(null==e?void 0:e.eeName)||"NA",id:"eeName"},{Header:v("WT_LOCALITY"),Cell:e=>{var t,l,i,o;let a=e.row;const r=(null===(t=a.original)||void 0===t||null===(l=t.fillingPointLocalityCodes)||void 0===l?void 0:l.length)>0?a.original.fillingPointLocalityCodes:null!==(i=a.original)&&void 0!==i&&null!==(o=i.address)&&void 0!==o&&o.locality?[a.original.address.locality]:[],d=r.length>0?r.map(e=>Xe(e,Ee,v)).join(", "):"NA";return n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},n.createElement("span",null,d))}},{Header:v("WT_ADD_LOCALITY"),Cell:e=>{var l,i,o,a,r,d;let u=e.row;const s=(null===(l=u.original)||void 0===l||null===(i=l.fillingPointLocalityCodes)||void 0===i?void 0:i.length)>0||(null===(o=u.original)||void 0===o||null===(a=o.address)||void 0===a?void 0:a.locality)&&"NA"!==(null===(r=u.original)||void 0===r||null===(d=r.address)||void 0===d?void 0:d.locality);return n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},s?n.createElement(n.Fragment,null,n.createElement("button",{onClick:()=>Ge(u,"VIEW"),style:{cursor:"pointer",background:"#fff",border:"1px solid #1D4E7F",color:"#1D4E7F",borderRadius:"4px",padding:"4px 12px"}},v("CS_COMMON_VIEW")),n.createElement("button",{onClick:()=>Ge(u,"UPDATE"),style:{cursor:"pointer",background:"#1D4E7F",color:"#fff",border:"none",borderRadius:"4px",padding:"4px 12px"}},v("CS_COMMON_UPDATE"))):n.createElement("button",{onClick:()=>Ge(u,"ADD"),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"4px",background:"#f4f4f4",border:"1px solid #ddd",borderRadius:"4px",padding:"4px 8px"}},n.createElement(t.AddIcon,{styles:{width:"16px",height:"16px"},fill:"#1D4E7F"}),v("CS_COMMON_ADD")))}},{Header:v("WT_ENABLE_DISABLE","Enable/Disable"),id:"status",disableSortBy:!0,Cell:e=>{let l=e.row;const i=ze(l.original),o=i&&me[i];return n.createElement(t.ToggleSwitch,{style:{display:"flex",justifyContent:"left",opacity:o?.6:1,pointerEvents:o?"none":"auto"},value:Ke(l.original),onChange:()=>(e=>{const t=e.original,l=ze(t),n=!Ke(t);l&&!me[l]&&(ce(e=>c({},e,{[l]:n})),pe(e=>c({},e,{[l]:!0})),Re(((e,t)=>{var l,n;return{RequestInfo:{userInfo:{uuid:(null===(l=Digit.UserService.getUser())||void 0===l||null===(n=l.info)||void 0===n?void 0:n.uuid)||"user-123"}},fillingPoints:[{id:null==e?void 0:e.id,bookingId:null==e?void 0:e.bookingId,fillingPointId:null==e?void 0:e.fillingPointId,tenantId:(null==e?void 0:e.tenantId)||Ee,fillingPointName:null==e?void 0:e.fillingPointName,emergencyName:null==e?void 0:e.emergencyName,eeName:null==e?void 0:e.eeName,eeEmail:null==e?void 0:e.eeEmail,eeMobile:null==e?void 0:e.eeMobile,aeName:null==e?void 0:e.aeName,aeEmail:null==e?void 0:e.aeEmail,aeMobile:null==e?void 0:e.aeMobile,jeName:null==e?void 0:e.jeName,jeEmail:null==e?void 0:e.jeEmail,jeMobile:null==e?void 0:e.jeMobile,fillingPointLocalityCodes:null==e?void 0:e.fillingPointLocalityCodes,status:t,address:null!=e&&e.address?{addressId:e.address.addressId,applicantId:e.address.applicantId,doorNo:e.address.doorNo,houseNo:e.address.houseNo,streetName:e.address.streetName,addressLine1:e.address.addressLine1,addressLine2:e.address.addressLine2,landmark:e.address.landmark,city:e.address.city,cityCode:e.address.cityCode,locality:e.address.locality,localityCode:e.address.localityCode,pincode:e.address.pincode,latitude:e.address.latitude,longitude:e.address.longitude,ward:e.address.ward,zone:e.address.zone,constituency:e.address.constituency,type:e.address.type||"FILLING-POINT",addressType:e.address.addressType}:void 0}]}})(t,n),{onSuccess:()=>{q({label:v(n?"WT_FILLING_POINT_ENABLED_SUCCESS":"WT_FILLING_POINT_DISABLED_SUCCESS",n?"Filling point enabled successfully":"Filling point disabled successfully")}),setTimeout(fe,5e3),Ne()},onError:e=>{var t,i,o,a;ce(e=>c({},e,{[l]:!n})),q({label:(null==e||null===(t=e.response)||void 0===t||null===(i=t.data)||void 0===i||null===(o=i.Errors)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.message)||v("WT_FILLING_POINT_STATUS_UPDATE_ERROR","Unable to update filling point status"),error:!0}),setTimeout(fe,5e3)},onSettled:()=>{pe(e=>c({},e,{[l]:!1}))}}))})(l),name:"filling-point-status-"+(i||l.id)})}}],[Ae,se,g,v,me]),Ze=window.Digit.Utils.browser.isMobile(),Je=Number("FIXED_POINT"===g?null!=(e=null!=(a=null!=(r=null==he?void 0:he.Count)?r:null==he?void 0:he.count)?a:null==he?void 0:he.totalCount)?e:0:null!=(d=null!=(u=null!=(s=null==be?void 0:be.Count)?s:null==be?void 0:be.count)?u:null==be?void 0:be.totalCount)?d:0),$e=n.useCallback(function(e){return void 0===e&&(e=[]),"FIXED_POINT"===g&&null!=M&&M.code?e.filter(e=>{var t,l,n,i;const o=e.fillingPointId||(null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||e.fillingPtName||e.filling_pt_name||(e.fillingPoint&&"object"==typeof e.fillingPoint?null===(l=e.fillingPoint)||void 0===l?void 0:l.id:e.fillingPoint)||(null===(n=e.fillingPointDetail)||void 0===n?void 0:n.id)||(null===(i=e.fillingPointDetail)||void 0===i?void 0:i.bookingId);return"MAPPED"===M.code?!!o:"UNMAPPED"!==M.code||!o}):e},[M,g]),et=n.useCallback(function(){try{let t=!1;function e(){return $e(o)}const l=200;let n=0,i=Number.POSITIVE_INFINITY;const o=[],a=I(function(){return!t&&n<i},void 0,function(){return Promise.resolve("FIXED_POINT"===g?Digit.WTService.SearchFixedPoint({tenantId:Ee,filters:c({},W,{offset:n,limit:l})}):Digit.WTService.SearchFillPoint({tenantId:Ee,filters:c({},W,{offset:n,limit:l})})).then(function(e){var l,a;const r="FIXED_POINT"===g?(null==e?void 0:e.waterTankerBookingDetail)||[]:(null==e?void 0:e.fillingPoints)||[];o.push(...r);const d=Number(null!=(l=null!=(a=null==e?void 0:e.Count)?a:null==e?void 0:e.count)?l:null==e?void 0:e.totalCount);i=Number.isFinite(d)&&d>=0?d:o.length,r.length?n+=r.length:t=!0})});return Promise.resolve(a&&a.then?a.then(e):e())}catch(e){return Promise.reject(e)}},[$e,W,g,Ee]),tt=n.useMemo(()=>"FIXED_POINT"===g?[{Header:v("WT_FIXED_POINT_CODE"),exportAccessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.fixedPointId)||"NA"}},{Header:v("WT_APPLICANT_NAME"),exportAccessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||"NA"}},{Header:v("WT_MOBILE_NUMBER"),exportAccessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.mobileNumber)||"NA"}},{Header:v("WT_LOCALITY"),exportAccessor:e=>{var t;return Xe(null==e||null===(t=e.address)||void 0===t?void 0:t.locality,Ee,v)||"NA"}},{Header:v("WT_LATITUDE"),exportAccessor:e=>{var t;return(null==e||null===(t=e.address)||void 0===t?void 0:t.latitude)||"NA"}},{Header:v("WT_LONGITUDE"),exportAccessor:e=>{var t;return(null==e||null===(t=e.address)||void 0===t?void 0:t.longitude)||"NA"}},{Header:v("WT_FILLING_POINT"),exportAccessor:e=>{var t,l,n,i,o,a;const r=String((null==e?void 0:e.fillingPointId)||(null==e||null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||(null==e?void 0:e.fillingPtName)||(null==e?void 0:e.filling_pt_name)||(null!=e&&e.fillingPoint&&"object"==typeof e.fillingPoint?null===(l=e.fillingPoint)||void 0===l?void 0:l.id:null==e?void 0:e.fillingPoint)||(null==e||null===(n=e.fillingPointDetail)||void 0===n?void 0:n.id)||(null==e||null===(i=e.fillingPointDetail)||void 0===i?void 0:i.bookingId)||""),d=null==Ae?void 0:Ae.find(e=>{var t;return String(e.id||e.bookingId||e.fillingPointId||e.uuid||(null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId))===r&&"undefined"!==r&&"null"!==r&&""!==r}),u=(null==d?void 0:d.fillingPointName)||(null==e?void 0:e.fillingPointName)||(null==e||null===(o=e.fillingPoint)||void 0===o?void 0:o.fillingPointName)||(null==e||null===(a=e.fillingpointmetadata)||void 0===a?void 0:a.fillingPointName)||(null==e?void 0:e.fillingPtName)||(null==e?void 0:e.filling_pt_name);return u&&"undefined"!==u&&"null"!==u?u:r&&"undefined"!==r&&"null"!==r?r:"NA"}}]:[{Header:v("WT_FILLING_POINT_CODE"),exportAccessor:e=>(null==e?void 0:e.fillingPointId)||"NA"},{Header:v("WT_FILLING_POINT_NAME"),exportAccessor:e=>(null==e?void 0:e.fillingPointName)||"NA"},{Header:v("WT_AE_NAME"),exportAccessor:e=>(null==e?void 0:e.aeName)||"NA"},{Header:v("WT_AE_MOBILE"),exportAccessor:e=>(null==e?void 0:e.aeMobile)||"NA"},{Header:v("WT_AE_EMAIL"),exportAccessor:e=>(null==e?void 0:e.aeEmail)||"NA"},{Header:v("WT_JE_NAME"),exportAccessor:e=>(null==e?void 0:e.jeName)||"NA"},{Header:v("WT_JE_MOBILE"),exportAccessor:e=>(null==e?void 0:e.jeMobile)||"NA"},{Header:v("WT_JE_EMAIL"),exportAccessor:e=>(null==e?void 0:e.jeEmail)||"NA"},{Header:v("WT_EE_NAME"),exportAccessor:e=>(null==e?void 0:e.eeName)||"NA"},{Header:v("WT_EE_MOBILE"),exportAccessor:e=>(null==e?void 0:e.eeMobile)||"NA"},{Header:v("WT_EE_EMAIL"),exportAccessor:e=>(null==e?void 0:e.eeEmail)||"NA"},{Header:v("WT_LOCALITY"),exportAccessor:e=>{var t,l;const n=(null==e||null===(t=e.fillingPointLocalityCodes)||void 0===t?void 0:t.length)>0?e.fillingPointLocalityCodes:null!=e&&null!==(l=e.address)&&void 0!==l&&l.locality?[e.address.locality]:[];return n.length>0?n.map(e=>Xe(e,Ee,v)).join(", "):"NA"}}],[g,v]);return n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement("div",{className:"search-tabs-container",style:{flexDirection:Ze?"column":"row",gap:Ze?"16px":"0"}},n.createElement("div",null,n.createElement("button",{className:"FILLING_POINT"===g?"search-tab-head-selected":"search-tab-head",onClick:()=>Ve("FILLING_POINT"),style:{width:Ze?"50%":"auto"}},v("WT_FILLING_POINT")),n.createElement("button",{className:"FIXED_POINT"===g?"search-tab-head-selected":"search-tab-head",onClick:()=>Ve("FIXED_POINT"),style:{width:Ze?"50%":"auto"}},v("WT_FIXED_POINT")),n.createElement("button",{className:"VIEW_ON_MAP"===g?"search-tab-head-selected":"search-tab-head",onClick:()=>Ve("VIEW_ON_MAP"),style:{width:Ze?"50%":"auto"}},v("WT_VIEW_ON_MAP"))),n.createElement("div",{className:"action-bar-wrap-registry",style:{alignSelf:Ze?"flex-end":"auto"}},n.createElement("div",{className:"search-add",onClick:()=>{T(e=>!e)}},v("ES_VENDOR_REGISTRY_INBOX_HEADER_ADD"),n.createElement("div",{className:"search-add-icon"},n.createElement(t.AddIcon,null))),y&&n.createElement(t.Menu,{localeKeyPrefix:"ES_FSM_ACTION_CREATE",options:["FIXED_POINT","FILLING_POINT"],t:v,onSelect:e=>{"FILLING_POINT"===e?m.push("/digit-ui/employee/wt/add-filling-point-address"):"FIXED_POINT"===e&&m.push("/digit-ui/employee/wt/add-fix-point-address"),T(!1)}}))),"VIEW_ON_MAP"!==g&&n.createElement("div",{className:"finance-mainlayout"},n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null,v(We)),n.createElement(t.TextInput,{value:b,onChange:e=>N(e.target.value),placeholder:v(Ue)})),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null,v("WT_MOBILE_NUMBER")),n.createElement(t.TextInput,{value:C,onChange:e=>A(e.target.value.replace(/\D/g,"").slice(0,10)),placeholder:v("WT_ENTER_MOBILE_NUMBER"),validation:{pattern:/^[6-9]\d{9}$/}})),"FIXED_POINT"===g&&n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null,v("WT_FIXED_POINT_STATUS")),n.createElement(t.Dropdown,{option:[{i18nKey:"WT_FIXED_POINT_MAPPED",code:"MAPPED"},{i18nKey:"WT_FIXED_POINT_UNMAPPED",code:"UNMAPPED"}],optionKey:"i18nKey",selected:P,select:R,t:v})),"FIXED_POINT"===g&&n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null,v("WT_FILLING_POINT")),n.createElement(t.Dropdown,{option:Ae,optionKey:"fillingPointName",selected:j,select:V,t:v,placeholder:v("ES_COMMON_STATUS")})),"FILLING_POINT"===g&&n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null,v("WT_FILLING_POINT_DESIGNATION")),n.createElement(t.Dropdown,{option:[{i18nKey:"WT_FILLING_POINT_DESIGNATION_AE",code:"DESIGNATION_AE"},{i18nKey:"WT_FILLING_POINT_DESIGNATION_JE",code:"DESIGNATION_JE"},{i18nKey:"WT_FILLING_POINT_DESIGNATION_EE",code:"DESIGNATION_EE"}],optionKey:"i18nKey",selected:O,select:w,t:v,placeholder:v("ES_COMMON_STATUS")})),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null," "),n.createElement("span",{className:"generic-button clear-search",onClick:je,style:{alignSelf:"center"}},v("ES_COMMON_CLEAR_SEARCH"))),n.createElement("div",{className:"finance-mainlayout-col1"},n.createElement(t.Label,null," "),n.createElement(t.SubmitBar,{label:v("ES_COMMON_SEARCH"),onSubmit:()=>{const e=c({},"FILLING_POINT"===g?{fillingPointName:b}:{name:b},{mobileNumber:C,status:"FILLING_POINT"===g?null==O?void 0:O.code:null,fillingPointId:(null==j?void 0:j.id)||(null==j?void 0:j.bookingId)||(null==j?void 0:j.fillingPointId)||(null==j?void 0:j.uuid)});F(P),U(e),de(0)}})))),n.createElement(t.Card,null,"VIEW_ON_MAP"===g?n.createElement(He,{fillingPoints:Ae,fixedPoints:Le,isLoading:De||Oe,t:v}):n.createElement(G,{key:(null==Ae?void 0:Ae.length)>0?"loaded":"loading",data:Fe,columns:Qe,pageSize:ie,getCellProps:()=>({style:{padding:"20px 18px",fontSize:"16px",whiteSpace:"normal",wordBreak:"break-word",overflowWrap:"anywhere"}}),styles:{width:"1200px",minWidth:"1200px",tableLayout:"fixed"},inboxStyles:{overflowX:"auto"},t:v,isLoading:ke||De,onPageSizeChange:e=>{oe(Number(e.target.value))},currentPage:Math.floor(re/ie),onNextPage:()=>{de(e=>e+ie)},onPrevPage:()=>{de(e=>e-ie)},pageSizeLimit:ie,totalRecords:Je,isPaginationRequired:!0,showPagination:!0,showPageSizeOptions:!0,isSearchRequired:!1,isDownloadRequired:!0,isFilterRequired:!0,isSortRequired:!0,showCSVExport:!0,getCSVExportData:et,csvExportColumns:tt,csvExportFileName:"wt-"+("FIXED_POINT"===g?"fixed-point":"filling-point")+"-search"})),K&&n.createElement(t.Toast,{error:K.error,label:K.label,onClose:fe}),X&&n.createElement(Me,{t:v,closeModal:()=>Q(!1),onSubmit:e=>{const t={FillingPointLocality:e.locality.filter(e=>e.code).map(e=>({fillingPointId:J.bookingId||J.id,localityCode:e.code}))};("UPDATE"===te?Ye:qe)(t,{onSuccess:()=>{q({label:v("UPDATE"===te?"WT_LOCALITY_UPDATE_SUCCESS":"WT_LOCALITY_LINKING_SUCCESS")}),Q(!1),setTimeout(fe,5e3),"FIXED_POINT"===g?ye():Ne()},onError:e=>{var t,l,n,i;q({label:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.message)||v("WT_LOCALITY_LINKING_FAIL"),error:!0}),setTimeout(fe,5e3)}})},initialValues:J,tenantId:Ee,modalMode:te}))},Ve=e=>{let o=e.options,a=e.optionsKey,r=e.selected,d=void 0===r?[]:r,u=e.onSelect,s=e.defaultLabel,v=void 0===s?"":s,m=e.defaultUnit,p=void 0===m?"":m,E=e.BlockNumber,f=void 0===E?1:E,g=e.isOBPSMultiple,_=void 0!==g&&g,h=e.props,y=void 0===h?{}:h,T=e.isPropsNeeded,S=void 0!==T&&T,b=e.ServerStyle,N=void 0===b?{}:b,I=e.isSurvey,D=void 0!==I&&I,C=e.disable,A=void 0!==C&&C;const x=l.useState(!1),O=x[0],w=x[1],L=l.useState(),P=L[0],R=L[1],k=l.useState(-1),M=k[0],F=k[1],B=l.useRef(),W=i.useTranslation().t;function U(e){return null==e?void 0:e.map(e=>({[a]:null==e?void 0:e[a],propsData:[null,e]}))}l.useEffect(()=>{V({type:"REPLACE_COMPLETE_STATE",payload:U(d)})},[null==d?void 0:d.map(e=>null==e?void 0:e[a]).join(",")]);const H=l.useReducer(function(e,t){var l,n;switch(t.type){case"ADD_TO_SELECTED_EVENT_QUEUE":return[...e,{[a]:null===(l=t.payload)||void 0===l||null===(n=l[1])||void 0===n?void 0:n[a],propsData:t.payload}];case"REMOVE_FROM_SELECTED_EVENT_QUEUE":return e.filter(e=>{var l,n;return(null==e?void 0:e[a])!==(null===(l=t.payload)||void 0===l||null===(n=l[1])||void 0===n?void 0:n[a])});case"REPLACE_COMPLETE_STATE":return t.payload;default:return e}},d,U),j=H[0],V=H[1];Digit.Hooks.useClickOutside(B,function(){w(!1)},O,{capture:!0});const z=(null==P?void 0:P.length)>0?o.filter(e=>W(e[a]&&"string"==typeof e[a]&&e[a].toUpperCase()).toLowerCase().indexOf(P.toLowerCase())>=0):o;function K(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];const n=t[0].target.checked,i=t[1];if(n){V({type:"ADD_TO_SELECTED_EVENT_QUEUE",payload:[...t]});const e=[...j,{[a]:i[a],propsData:t}];u(e.map(e=>e.propsData),y)}else{V({type:"REMOVE_FROM_SELECTED_EVENT_QUEUE",payload:[...t]});const e=j.filter(e=>(null==e?void 0:e[a])!==i[a]);u(e.map(e=>e.propsData),y)}}const G=e=>{let l=e.option,i=e.index;return n.createElement("div",{key:i,style:_&&i%2!=0?{background:"#EEEEEE"}:{}},n.createElement("input",{type:"checkbox",value:l[a],checked:!!j.find(e=>e[a]===l[a]),onChange:e=>S?K(e,l,y):_?K(e,l,f):K(e,l),style:{minWidth:"24px",width:"100%"}}),n.createElement("div",{className:"custom-checkbox"},n.createElement(t.CheckSvg,{style:{innerWidth:"24px",width:"24px"}})),n.createElement("p",{className:"label",style:i===M?{opacity:1,backgroundColor:"rgba(238, 238, 238, var(--bg-opacity))"}:{}},W(l[a]&&"string"==typeof l[a]&&l[a])))},q=()=>{const e=(null==P?void 0:P.length)>0?o.filter(e=>W(e[a]&&"string"==typeof e[a]&&e[a].toUpperCase()).toLowerCase().indexOf(P.toLowerCase())>=0):o,l=(null==e?void 0:e.length)>0&&(null==e?void 0:e.every(e=>j.find(t=>t[a]===e[a])));return n.createElement(n.Fragment,null,(null==e?void 0:e.length)>0&&n.createElement("div",{key:"select-all",style:{borderBottom:"1px solid #eee",display:"flex",alignItems:"center"}},n.createElement("input",{type:"checkbox",checked:l,onChange:t=>{if(t.target.checked){const t=e.map(e=>({[a]:e[a],propsData:[null,e]}));V({type:"REPLACE_COMPLETE_STATE",payload:t}),u(t.map(e=>e.propsData))}else V({type:"REPLACE_COMPLETE_STATE",payload:[]}),u([])},style:{minWidth:"24px"}}),n.createElement("div",{className:"custom-checkbox"},n.createElement(t.CheckSvg,{style:{innerWidth:"24px",width:"24px"}})),n.createElement("p",{className:"label",style:{fontWeight:"bold",marginLeft:"8px"}},W("WT_SELECT_ALL"))),null==e?void 0:e.map((e,t)=>n.createElement(G,{option:e,key:t,index:t})))};return n.createElement("div",{className:"multi-select-dropdown-wrap "+(A?"disabled":""),ref:B,style:A?{pointerEvents:"none",opacity:.5}:{}},n.createElement("div",{className:"master"+(O?"-active":"")},n.createElement("input",{className:"cursorPointer",type:"text",onKeyDown:e=>{var t,l,n,i,o,a,r,d,u,s,c,v;if("ArrowDown"==e.key)F(e=>e+1==z.length?0:e+1),M+1==z.length?null==e||null===(t=e.target)||void 0===t||null===(l=t.parentElement)||void 0===l||null===(n=l.parentElement)||void 0===n||null===(i=n.children)||void 0===i||null===(o=i.namedItem("jk-dropdown-unique"))||void 0===o||null===(a=o.scrollTo)||void 0===a||a.call(o,0,0):M>2&&(null==e||null===(r=e.target)||void 0===r||null===(d=r.parentElement)||void 0===d||null===(u=d.parentElement)||void 0===u||null===(s=u.children)||void 0===s||null===(c=s.namedItem("jk-dropdown-unique"))||void 0===c||null===(v=c.scrollBy)||void 0===v||v.call(c,0,45)),e.preventDefault();else if("ArrowUp"==e.key){var m,p,E,f,g,_,h,y,T,S,b,N;F(e=>0!==e?e-1:z.length-1),0===M?null==e||null===(m=e.target)||void 0===m||null===(p=m.parentElement)||void 0===p||null===(E=p.parentElement)||void 0===E||null===(f=E.children)||void 0===f||null===(g=f.namedItem("jk-dropdown-unique"))||void 0===g||null===(_=g.scrollTo)||void 0===_||_.call(g,1e5,1e5):M>2&&(null==e||null===(h=e.target)||void 0===h||null===(y=h.parentElement)||void 0===y||null===(T=y.parentElement)||void 0===T||null===(S=T.children)||void 0===S||null===(b=S.namedItem("jk-dropdown-unique"))||void 0===b||null===(N=b.scrollBy)||void 0===N||N.call(b,0,-45)),e.preventDefault()}else"Enter"==e.key&&K(e,z[M])},onFocus:()=>!A&&w(!0),value:P,onChange:function(e){R(e.target.value)},disabled:A}),n.createElement("div",{className:"label"},n.createElement("p",{title:(null==d?void 0:d.length)>0?d.map(e=>W(e[a])).join(", "):v,style:{whiteSpace:"normal",wordBreak:"break-word"}},(null==d?void 0:d.length)>0?(D?null==d?void 0:d.filter(e=>void 0!==(null==e?void 0:e.i18nKey)).length:d.length)+" "+p:v),n.createElement(t.ArrowDown,null))),O?n.createElement("div",{className:"server",id:"jk-dropdown-unique",style:c({},N,{maxHeight:"300px",overflowY:"auto"})},n.createElement(q,null)):null)},ze=e=>{const a=Digit.ULBService.getCurrentTenantId(),r=i.useTranslation().t,d=o.useHistory(),u=l.useState(null),s=u[0],c=u[1],v=l.useState(null),m=v[0],p=v[1],f=l.useState(""),g=f[0],_=f[1],h=l.useState(""),y=h[0],T=h[1],S=l.useState(null),b=S[0],N=S[1],I=l.useState(null),C=I[0],A=I[1],x=l.useState(null)[0],O=l.useState(null),w=O[0],L=O[1],P=Digit.Hooks.fsm.useVendorSearch({tenantId:a,filters:{status:"ACTIVE"},config:{select:e=>(null==e?void 0:e.vendor)||[]}}).data,R=l.useState([]),k=R[0],M=R[1],F=Digit.Hooks.wt.useFillPointSearch({tenantId:a,filters:{status:!0}}).data,B=(null==F?void 0:F.fillingPoints)||[],W=Digit.Hooks.wt.useVendorWorkOrderCreate(a).mutate,U=Digit.Hooks.wt.useVendorFillingMap(a).mutate;l.useEffect(()=>{!function(){try{L(null);const e=function(){if(C){const e=function(){if(C.size>=2e6)L(r("WT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?N(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):L(r("WT_FILE_UPLOAD_ERROR"))})},function(){L(r("WT_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]);const H=window.Digit.Utils.browser.isMobile();Digit.UserService.getUser();const j=!m||!g||!y;return n.createElement("div",{className:"employee-form-section-wrapper"},n.createElement(E,{config:[{timeLine:[{actions:"Vendor Assign",currentStep:1}]}],showFinalStep:!1}),n.createElement("div",{style:{flex:1}},n.createElement(t.CollapsibleCardPage,{title:r("WT_VENDOR_ASSIGN"),defaultOpen:!0},n.createElement("div",{className:"formcomposer-section-grid"},n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.Label,null,""+r("WT_VENDOR_NAME")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{t:r,option:P,optionKey:"name",select:p,selected:m,placeholder:r("WT_SELECT_VENDOR")})),n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.Label,null,""+r("COMMON_VALID_FROM_DATE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.DatePicker,{date:g,onChange:e=>_(e),style:{width:"100%"}})),n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.Label,null,""+r("COMMON_VALID_TO_DATE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.DatePicker,{date:y,min:g,onChange:e=>T(e),style:{width:"100%"}})),n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.Label,null,""+r("WT_UPLOAD_DOCUMENT")),n.createElement(t.UploadFile,{id:"wt-doc",extraStyleName:"propertyCreate",accept:".jpg,.png,.pdf,.jpeg",onUpload:function(e){N(null),A(e.target.files[0])},onDelete:()=>{N(null)},message:b?"1 "+r("WT_ACTION_FILEUPLOADED"):r("WT_ACTION_NO_FILEUPLOADED"),error:w})),n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.Label,null,""+r("WT_FILLING_POINT")),n.createElement(Ve,{options:B,optionsKey:"fillingPointName",selected:k,onSelect:e=>{const t=(null==e?void 0:e.map(e=>Array.isArray(e)?e[1]:e))||[];M(t)},defaultLabel:r("SELECT_FILLING_POINT"),defaultUnit:r("SELECTED"),ServerStyle:{textAlign:"left",width:"100%",minWidth:"250px",backgroundColor:"#fff"},isPropsNeeded:!1}),k&&k.length>0&&n.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"12px",maxHeight:"120px",overflowY:"auto",padding:"4px"}},k.map((e,t)=>n.createElement("div",{key:t,style:{display:"flex",alignItems:"center",backgroundColor:"#f4f4f4",border:"1px solid #ddd",borderRadius:"16px",padding:"4px 12px",fontSize:"14px",fontWeight:"500"}},n.createElement("span",{style:{marginRight:"8px",color:"#333",maxWidth:"200px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},r((null==e?void 0:e.fillingPointName)||(null==e?void 0:e.id))),n.createElement("button",{type:"button",onClick:t=>{t.preventDefault(),t.stopPropagation();const l=e.id||e.fillingPointId;M(e=>e.filter(e=>(e.id||e.fillingPointId)!==l))},style:{background:"transparent",border:"none",color:"#888",cursor:"pointer",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"auto",padding:"0"}},"×"))))))),n.createElement("div",{style:{display:"flex",marginTop:"24px",justifyContent:H?"center":"flex-end"}},n.createElement(t.SubmitBar,{label:r("ES_COMMON_SAVE"),onSubmit:j?null:()=>{var e,t;const l={vendorWorkOrder:{tenantId:a,name:null==m?void 0:m.name,mobileNumber:null==m||null===(e=m.owner)||void 0===e?void 0:e.mobileNumber,emailId:null==m||null===(t=m.owner)||void 0===t?void 0:t.emailId,vendorId:(null==m?void 0:m.code)||(null==m?void 0:m.id),validFrom:new Date(g).getTime(),validTo:new Date(y).getTime(),serviceType:(null==x?void 0:x.code)||"WT",fileStoreId:b}},n=()=>{W(l,{onSuccess:e=>{c({isError:!1,label:r("ES_COMMON_SAVE_SUCCESS")}),setTimeout(()=>{d.push("/digit-ui/employee/vendor/search-vendor")},3e3)},onError:e=>{var t,l,n,i;c({isError:!0,label:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.message)||r("ES_COMMON_ERROR_SAVING")})}})};if(k&&k.length>0){const e={mappings:k.map(e=>({tenantId:a,fillingPointId:(null==e?void 0:e.id)||(null==e?void 0:e.bookingId)||(null==e?void 0:e.fillingPointId),vendorId:(null==m?void 0:m.code)||(null==m?void 0:m.id)}))};U(e,{onSuccess:()=>{n()},onError:e=>{var t,l,n,i;c({isError:!0,label:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.message)||r("WT_FIXED_FILLING_MAPPING_FAIL")})}})}else n()},disabled:j}))),s&&n.createElement(t.Toast,{error:s.isError,label:s.label,onClose:()=>c(null)}))},Ke=e=>{let i=e.isLoading,a=void 0!==i&&i,d=e.t,u=e.onSubmit,s=void 0===u?()=>{}:u,c=e.data,v=void 0===c?null:c,m=e.count,p=void 0===m?0:m,E=e.setShowToast,f=void 0!==E&&E;const g=window.Digit.Utils.browser.isMobile(),_=Digit.UserService.getUser().info,h={offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",bookingNo:"",mobileNumber:"",applicantName:"",status:"",fromDate:"",toDate:""},y=r.useForm({defaultValues:h}),T=y.register,S=y.control,b=y.handleSubmit,N=y.setValue,I=y.getValues,D=y.reset,C=y.formState,x=(0,y.watch)("fromDate"),O=e=>n.createElement("span",{className:"cell-text"},e),w=l.useMemo(()=>[{Header:d("WT_BOOKING_NO"),accessor:"bookingNo",disableSortBy:!0,Cell:e=>{const t=e.row.original.bookingNo;return n.createElement("div",null,n.createElement("span",{className:"link"},n.createElement(o.Link,{to:"/digit-ui/"+("EMPLOYEE"===_.type?"employee":"citizen")+"/wt/bookingsearch/booking-details/"+t},t)))}},{Header:d("WT_APPLICANT_NAME"),disableSortBy:!0,Cell:e=>{var t,l;return O(null===(t=e.row.original)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:d("WT_MOBILE_NUMBER"),disableSortBy:!0,Cell:e=>{var t,l;return O(null===(t=e.row.original)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:d("PT_COMMON_TABLE_COL_STATUS_LABEL"),disableSortBy:!0,Cell:e=>O(d(e.row.original.bookingStatus))}],[d,_.type]),L=l.useCallback(e=>{0!==e.length&&(N("sortBy",e.id),N("sortOrder",e.desc?"DESC":"ASC"))},[N]),P=()=>{D(h),f(null),b(s)()};return n.createElement(n.Fragment,null,n.createElement("div",{className:"CITIZEN"===(null==_?void 0:_.type)?"citizen-wrapper":"employee-wrapper"},n.createElement(A,{title:d("WT_SEARCH_FILTERS_LABEL")||"Search Filters",defaultOpen:!0,tabs:[d("WT_SMART_SEARCH"),d("WT_ADVANCED_SEARCH")],defaultTab:d("WT_SMART_SEARCH")},e=>{var l,i,o,a;return n.createElement("form",{onSubmit:b(s)},e===d("WT_SMART_SEARCH")&&n.createElement("div",{className:"wt-search-grid",style:{display:"grid",gridTemplateColumns:g?"1fr":"1fr 1fr",gap:"24px"}},n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:T({minLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:d("CORE_COMMON_MOBILE_ERROR")}}),type:"number",maxlength:10}),n.createElement(t.CardLabelError,null,null==C||null===(l=C.errors)||void 0===l||null===(i=l.mobileNumber)||void 0===i?void 0:i.message))),e===d("WT_ADVANCED_SEARCH")&&n.createElement("div",{className:"formcomposer-section-grid"},n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_BOOKING_NO")),n.createElement(t.TextInput,{name:"bookingNo",inputRef:T({})})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_APPLICANT_NAME")),n.createElement(t.TextInput,{name:"applicantName",inputRef:T({})})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("WT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:T({minLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:d("CORE_COMMON_MOBILE_ERROR")}}),type:"number",maxlength:10}),n.createElement(t.CardLabelError,null,null==C||null===(o=C.errors)||void 0===o||null===(a=o.mobileNumber)||void 0===a?void 0:a.message)),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("FROM_DATE")),n.createElement(r.Controller,{render:e=>n.createElement(t.DatePicker,{date:e.value,onChange:e.onChange,max:(new Date).toISOString().split("T")[0]}),name:"fromDate",control:S})),n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,d("TO_DATE")),n.createElement(r.Controller,{render:e=>n.createElement(t.DatePicker,{date:e.value,onChange:e.onChange,min:x}),name:"toDate",control:S}))),n.createElement("div",{className:"wt-search-actions",style:{display:"flex",justifyContent:g?"center":"flex-end",flexDirection:g?"column-reverse":"row",gap:"24px",marginTop:"16px"}},n.createElement("span",{className:"generic-button clear-search",onClick:P,style:{cursor:"pointer",alignSelf:"center"}},d("ES_COMMON_CLEAR_ALL")),n.createElement("div",{style:{minWidth:g?"100%":"160px"}},n.createElement(t.SubmitBar,{label:d("ES_COMMON_SEARCH"),submit:!0}))))}),a&&n.createElement(t.Loader,null),""===v?n.createElement("p",{style:{textAlign:"center"}},"No data found"):v?n.createElement(t.Table,{t:d,data:v,totalRecords:p,columns:w,getCellProps:e=>({style:{minWidth:e.column.Header===d("WT_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:e=>{N("limit",Number(e.target.value)),b(s)()},currentPage:I("offset")/I("limit"),onNextPage:()=>{N("offset",I("offset")+I("limit")),b(s)()},onPrevPage:()=>{const e=I("offset"),t=I("limit");e-t>=0&&(N("offset",e-t),b(s)())},pageSizeLimit:I("limit"),onSort:L,disableSort:!1,sortParams:[{id:I("sortBy"),desc:"DESC"===I("sortOrder")}]}):null))},Ge=e=>{var l,a,r,d,u,s;let v=e.path;const m=i.useTranslation().t,p=o.useLocation(),E="Emergency Inbox"!==m("Emergency Inbox")?m("Emergency Inbox")+" "+m("ES_COMMON_INBOX"):"Emergency Inbox",f="WT_EMERGENCY_WATER_TANKER_REQUEST"!==m("WT_EMERGENCY_WATER_TANKER_REQUEST")?m("WT_EMERGENCY_WATER_TANKER_REQUEST"):"Emergency Water Tanker Request";sessionStorage.removeItem("revalidateddone");const g={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["watertanker"],applicationStatus:[],locality:[]}},_={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["mobileToilet"],applicationStatus:[],locality:[]}},h={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["treePruning"],applicationStatus:[],locality:[]}},y={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["watertanker-fixedpoint"],applicationStatus:[],locality:[]}},T=null===(l=Digit)||void 0===l||null===(a=l.ComponentRegistryService)||void 0===a?void 0:a.getComponent("ApplicationDetails"),S=null===(r=Digit)||void 0===r||null===(d=r.ComponentRegistryService)||void 0===d?void 0:d.getComponent("WTCreate"),b=null===(u=Digit)||void 0===u||null===(s=u.ComponentRegistryService)||void 0===s?void 0:s.getComponent("WTEmergencyFixedPointCreate");return n.createElement(o.Switch,null,n.createElement(t.AppContainer,null,n.createElement("div",{className:"ground-container employee-app-container form-container"},n.createElement(t.ModuleHeader,{leftContent:n.createElement(n.Fragment,null,n.createElement(t.ArrowLeft,{className:"icon"}),"Back"),onLeftClick:()=>window.history.back(),breadcrumbs:(()=>{const e=p.pathname;let l="WT";e.includes("/mt/")&&(l="MT"),e.includes("/tp/")&&(l="TP");let n=[{icon:t.HomeIcon,path:"/digit-ui/employee"},{label:m("WT_MODULE_NAME"),path:"/digit-ui/employee/module/details?moduleName="+l}];if(e.includes("/fixed-point/inbox"))n.push({label:E});else if(e.includes("/inbox")){let t="ES_COMMON_INBOX";e.includes("/tp/inbox")&&(t="TP_INBOX"),n.push({label:m(t)})}else if(e.includes("/my-bookings")){let t="WT_SEARCH_BOOKINGS";e.includes("/mt/my-bookings")&&(t="MT_SEARCH_BOOKINGS"),e.includes("/tp/my-bookings")&&(t="TP_SEARCH_BOOKINGS"),n.push({label:m(t)})}else if(e.includes("/fixed-point/request-service"))n.push({label:f});else if(e.includes("/request-service"))n.push({label:m("WT_REQUEST_SERVICE")});else if(e.includes("/fixed-point/booking-details"))n.push({label:E,path:v+"/fixed-point/inbox"}),n.push({label:m("WT_BOOKING_DETAILS")});else if(e.includes("/booking-details")||e.includes("/bookingsearch/booking-details")){const t=e.includes("/bookingsearch");n.push(t?{label:m("WT_SEARCH_BOOKINGS"),path:v+"/my-bookings"}:{label:m("ES_COMMON_INBOX"),path:v+"/inbox"}),n.push({label:m("WT_BOOKING_DETAILS")})}else e.includes("/fixed-point-schedule")?n.push({label:m("WT_FIXED_POINT_SCHEDULE_MANAGEMENT")}):e.includes("/live-tracking")?n.push({label:m("WT_LIVE_TRACKING_SYSTEM")}):e.includes("/add-filling-point-address")?n.push({label:m("WT_ADD_FILLING_POINT_ADDRESS")}):e.includes("/add-fix-point-address")?n.push({label:m("WT_ADD_FIX_POINT_ADDRESS")}):e.includes("/search-filling-fix-point")?n.push({label:m("WT_SEARCH_FIX_POINT")}):e.includes("/vendor-assign")&&n.push({label:m("WT_VENDOR_ASSIGN")});return n})()}),n.createElement("div",{className:"employee-form"},n.createElement("div",{className:"employee-form-content"},n.createElement(t.PrivateRoute,{path:v+"/inbox",component:e=>n.createElement(ve,c({},e,{useNewInboxAPI:!0,parentRoute:v,businessService:"watertanker",moduleCode:"WT",filterComponent:"WT_INBOX_FILTER",initialStates:g,isInbox:!0}))}),n.createElement(t.PrivateRoute,{path:v+"/fixed-point/inbox",component:e=>n.createElement(ve,c({},e,{useNewInboxAPI:!0,parentRoute:v,businessService:"watertanker-fixedpoint",detailRoute:v+"/fixed-point/booking-details",moduleCode:"WT",filterComponent:"WT_INBOX_FILTER",initialStates:y,isInbox:!0}))}),n.createElement(t.PrivateRoute,{path:v+"/mt/inbox",component:e=>n.createElement(ve,c({},e,{useNewInboxAPI:!0,parentRoute:v,moduleCode:"MT",businessService:"mobileToilet",filterComponent:"WT_INBOX_FILTER",initialStates:_,isInbox:!0}))}),n.createElement(t.PrivateRoute,{path:v+"/tp/inbox",component:e=>n.createElement(ve,c({},e,{useNewInboxAPI:!0,parentRoute:v,moduleCode:"TP",businessService:"treePruning",filterComponent:"WT_INBOX_FILTER",initialStates:h,isInbox:!0}))}),n.createElement(t.PrivateRoute,{path:v+"/request-service",component:S}),n.createElement(t.PrivateRoute,{path:v+"/mt/request-service",component:S}),n.createElement(t.PrivateRoute,{path:v+"/tp/request-service",component:S}),n.createElement(t.PrivateRoute,{path:v+"/fixed-point/request-service",component:b}),n.createElement(t.PrivateRoute,{path:v+"/fixed-point/booking-details/:id",component:e=>n.createElement(t.LayoutWrapper,{layoutClass:"action"},n.createElement(T,c({},e,{parentRoute:v})))}),n.createElement(t.PrivateRoute,{path:v+"/booking-details/:id",component:e=>n.createElement(t.LayoutWrapper,{layoutClass:"action"},n.createElement(T,c({},e,{parentRoute:v})))}),n.createElement(t.PrivateRoute,{path:v+"/bookingsearch/booking-details/:id",component:e=>n.createElement(t.LayoutWrapper,{layoutClass:"normal"},n.createElement(T,c({},e,{parentRoute:v})))}),n.createElement(t.PrivateRoute,{path:v+"/my-bookings",component:e=>n.createElement(O,c({},e,{parentRoute:v,moduleCode:"WT"}))}),n.createElement(t.PrivateRoute,{path:v+"/mt/my-bookings",component:e=>n.createElement(O,c({},e,{parentRoute:v,moduleCode:"MT"}))}),n.createElement(t.PrivateRoute,{path:v+"/tp/my-bookings",component:e=>n.createElement(O,c({},e,{parentRoute:v,moduleCode:"TP"}))}),n.createElement(t.PrivateRoute,{path:v+"/fixed-point-schedule",component:fe}),n.createElement(t.PrivateRoute,{path:v+"/live-tracking",component:Oe}),n.createElement(t.PrivateRoute,{path:v+"/add-filling-point-address",component:Re}),n.createElement(t.PrivateRoute,{path:v+"/add-fix-point-address",component:ke}),n.createElement(t.PrivateRoute,{path:v+"/search-filling-fix-point",component:je}),n.createElement(t.PrivateRoute,{path:v+"/vendor-assignment",component:ze}),n.createElement(t.PrivateRoute,{path:v+"/reports",component:e=>n.createElement(t.LayoutWrapper,{layoutClass:"normal"},n.createElement(Ke,c({t:m},e,{parentRoute:v,moduleCode:"WT"})))}))))))},qe=e=>{var l,a;let r=e.application,d=e.tenantId,u=e.buttonLabel,s=null==r?void 0:r.bookingNo.split("-")[0];const c=i.useTranslation().t;return n.createElement(t.Card,null,n.createElement(t.KeyNote,{keyValue:c("BOOKING_NO"),note:null==r?void 0:r.bookingNo}),n.createElement(t.KeyNote,{keyValue:c("APPLICANT_NAME"),note:null==r||null===(l=r.applicantDetail)||void 0===l?void 0:l.name}),n.createElement(t.KeyNote,{keyValue:c("MOBILE_NUMBER"),note:c(""+(null==r||null===(a=r.applicantDetail)||void 0===a?void 0:a.mobileNumber))}),n.createElement(t.KeyNote,{keyValue:c("LOCALITY"),note:c(""+(null==r?void 0:r.localityCode))}),n.createElement(t.KeyNote,{keyValue:c("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:c(""+(null==r?void 0:r.bookingStatus))}),n.createElement("div",null,"WT"===s&&n.createElement(o.Link,{to:"/digit-ui/citizen/wt/booking/waterTanker/"+(null==r?void 0:r.bookingNo)+"/"+d},n.createElement(t.SubmitBar,{label:u})),"MT"===s&&n.createElement(o.Link,{to:"/digit-ui/citizen/wt/booking/mobileToilet/"+(null==r?void 0:r.bookingNo)+"/"+d},n.createElement(t.SubmitBar,{label:u})),"TP"===s&&n.createElement(o.Link,{to:"/digit-ui/citizen/wt/booking/treePruning/"+(null==r?void 0:r.bookingNo)+"/"+d},n.createElement(t.SubmitBar,{label:u}))))};var Ye=Array.isArray,Xe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Qe(e,t){return e(t={exports:{}},t.exports),t.exports}var Ze,Je="object"==typeof self&&self&&self.Object===Object&&self,$e="object"==typeof Xe&&Xe&&Xe.Object===Object&&Xe||Je||Function("return this")(),et=$e.Symbol,tt=Object.prototype,lt=tt.hasOwnProperty,nt=tt.toString,it=et?et.toStringTag:void 0,ot=Object.prototype.toString,at=et?et.toStringTag:void 0,rt=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":at&&at in Object(e)?function(e){var t=lt.call(e,it),l=e[it];try{e[it]=void 0;var n=!0}catch(e){}var i=nt.call(e);return n&&(t?e[it]=l:delete e[it]),i}(e):function(e){return ot.call(e)}(e)},dt=function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==rt(e)},ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,st=/^\w*$/,ct=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},vt=$e["__core-js_shared__"],mt=(Ze=/[^.]+$/.exec(vt&&vt.keys&&vt.keys.IE_PROTO||""))?"Symbol(src)_1."+Ze:"",pt=Function.prototype.toString,Et=/^\[object .+?Constructor\]$/,ft=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gt=function(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!ct(e)||(t=e,mt&&mt in t))&&(function(e){if(!ct(e))return!1;var t=rt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?ft:Et).test(function(e){if(null!=e){try{return pt.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}(l)?l:void 0},_t=gt(Object,"create"),ht=Object.prototype.hasOwnProperty,yt=Object.prototype.hasOwnProperty;function Tt(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}Tt.prototype.clear=function(){this.__data__=_t?_t(null):{},this.size=0},Tt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Tt.prototype.get=function(e){var t=this.__data__;if(_t){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return ht.call(t,e)?t[e]:void 0},Tt.prototype.has=function(e){var t=this.__data__;return _t?void 0!==t[e]:yt.call(t,e)},Tt.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=_t&&void 0===t?"__lodash_hash_undefined__":t,this};var St=Tt,bt=function(e,t){for(var l=e.length;l--;)if((n=e[l][0])===(i=t)||n!=n&&i!=i)return l;var n,i;return-1},Nt=Array.prototype.splice;function It(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}It.prototype.clear=function(){this.__data__=[],this.size=0},It.prototype.delete=function(e){var t=this.__data__,l=bt(t,e);return!(l<0||(l==t.length-1?t.pop():Nt.call(t,l,1),--this.size,0))},It.prototype.get=function(e){var t=this.__data__,l=bt(t,e);return l<0?void 0:t[l][1]},It.prototype.has=function(e){return bt(this.__data__,e)>-1},It.prototype.set=function(e,t){var l=this.__data__,n=bt(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this};var Dt=It,Ct=gt($e,"Map"),At=function(e,t){var l,n,i=e.__data__;return("string"==(n=typeof(l=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==l:null===l)?i["string"==typeof t?"string":"hash"]:i.map};function xt(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}xt.prototype.clear=function(){this.size=0,this.__data__={hash:new St,map:new(Ct||Dt),string:new St}},xt.prototype.delete=function(e){var t=At(this,e).delete(e);return this.size-=t?1:0,t},xt.prototype.get=function(e){return At(this,e).get(e)},xt.prototype.has=function(e){return At(this,e).has(e)},xt.prototype.set=function(e,t){var l=At(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this};var Ot=xt;function wt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var l=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=l.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return l.cache=o.set(i,a)||o,a};return l.cache=new(wt.Cache||Ot),l}wt.Cache=Ot;var Lt,Pt,Rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kt=/\\(\\)?/g,Mt=(Lt=wt(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Rt,function(e,l,n,i){t.push(n?i.replace(kt,"$1"):l||e)}),t},function(e){return 500===Pt.size&&Pt.clear(),e}),Pt=Lt.cache,Lt),Ft=et?et.prototype:void 0,Bt=Ft?Ft.toString:void 0,Wt=function(e){if("string"==typeof e||dt(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Ut=function(e,t,l){var n=null==e?void 0:function(e,t){for(var l=0,n=(t=function(e,t){return Ye(e)?e:function(e,t){if(Ye(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!dt(e))||st.test(e)||!ut.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:Mt(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(Ye(t))return function(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i}(t,e)+"";if(dt(t))return Bt?Bt.call(t):"";var l=t+"";return"0"==l&&1/t==-1/0?"-0":l}(e)}(e))}(t,e)).length;null!=e&&l<n;)e=e[Wt(t[l++])];return l&&l==n?e:void 0}(e,t);return void 0===n?l:n},Ht=Qe(function(e,t){(function(){var l="Expected a function",n="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",d="[object Date]",u="[object Error]",s="[object Function]",c="[object GeneratorFunction]",v="[object Map]",m="[object Number]",p="[object Object]",E="[object RegExp]",f="[object Set]",g="[object String]",_="[object Symbol]",h="[object WeakMap]",y="[object ArrayBuffer]",T="[object DataView]",S="[object Float32Array]",b="[object Float64Array]",N="[object Int8Array]",I="[object Int16Array]",D="[object Int32Array]",C="[object Uint8Array]",A="[object Uint16Array]",x="[object Uint32Array]",O=/\b__p \+= '';/g,w=/\b(__p \+=) '' \+/g,L=/(__e\(.*?\)|\b__t\)) \+\n'';/g,P=/&(?:amp|lt|gt|quot|#39);/g,R=/[&<>"']/g,k=RegExp(P.source),M=RegExp(R.source),F=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,j=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,z=RegExp(V.source),K=/^\s+/,G=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Y=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Q=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Z=/[()=,{}\[\]\/\s]/,J=/\\(\\)?/g,$=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ee=/\w*$/,te=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ne=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,oe=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,re=/($^)/,de=/['\n\r\u2028\u2029\\]/g,ue="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",se="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ce="["+se+"]",ve="["+ue+"]",me="\\d+",pe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+se+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",fe="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",he="[\\ud800-\\udbff][\\udc00-\\udfff]",ye="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Te="(?:"+pe+"|"+Ee+")",Se="(?:"+ye+"|"+Ee+")",be="(?:"+ve+"|"+fe+")?",Ne="[\\ufe0e\\ufe0f]?"+be+"(?:\\u200d(?:"+[ge,_e,he].join("|")+")[\\ufe0e\\ufe0f]?"+be+")*",Ie="(?:"+["[\\u2700-\\u27bf]",_e,he].join("|")+")"+Ne,De="(?:"+[ge+ve+"?",ve,_e,he,"[\\ud800-\\udfff]"].join("|")+")",Ce=RegExp("['’]","g"),Ae=RegExp(ve,"g"),xe=RegExp(fe+"(?="+fe+")|"+De+Ne,"g"),Oe=RegExp([ye+"?"+pe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ce,ye,"$"].join("|")+")",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ce,ye+Te,"$"].join("|")+")",ye+"?"+Te+"+(?:['’](?:d|ll|m|re|s|t|ve))?",ye+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Ie].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+ue+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Re=-1,ke={};ke[S]=ke[b]=ke[N]=ke[I]=ke[D]=ke[C]=ke["[object Uint8ClampedArray]"]=ke[A]=ke[x]=!0,ke[o]=ke[a]=ke[y]=ke[r]=ke[T]=ke[d]=ke[u]=ke[s]=ke[v]=ke[m]=ke[p]=ke[E]=ke[f]=ke[g]=ke[h]=!1;var Me={};Me[o]=Me[a]=Me[y]=Me[T]=Me[r]=Me[d]=Me[S]=Me[b]=Me[N]=Me[I]=Me[D]=Me[v]=Me[m]=Me[p]=Me[E]=Me[f]=Me[g]=Me[_]=Me[C]=Me["[object Uint8ClampedArray]"]=Me[A]=Me[x]=!0,Me[u]=Me[s]=Me[h]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Be=parseFloat,We=parseInt,Ue="object"==typeof Xe&&Xe&&Xe.Object===Object&&Xe,He="object"==typeof self&&self&&self.Object===Object&&self,je=Ue||He||Function("return this")(),Ve=t&&!t.nodeType&&t,ze=Ve&&e&&!e.nodeType&&e,Ke=ze&&ze.exports===Ve,Ge=Ke&&Ue.process,qe=function(){try{return ze&&ze.require&&ze.require("util").types||Ge&&Ge.binding&&Ge.binding("util")}catch(e){}}(),Ye=qe&&qe.isArrayBuffer,Qe=qe&&qe.isDate,Ze=qe&&qe.isMap,Je=qe&&qe.isRegExp,$e=qe&&qe.isSet,et=qe&&qe.isTypedArray;function tt(e,t,l){switch(l.length){case 0:return e.call(t);case 1:return e.call(t,l[0]);case 2:return e.call(t,l[0],l[1]);case 3:return e.call(t,l[0],l[1],l[2])}return e.apply(t,l)}function lt(e,t,l,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,l(a),e)}return n}function nt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l,e););return e}function it(e,t){for(var l=null==e?0:e.length;l--&&!1!==t(e[l],l,e););return e}function ot(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(!t(e[l],l,e))return!1;return!0}function at(e,t){for(var l=-1,n=null==e?0:e.length,i=0,o=[];++l<n;){var a=e[l];t(a,l,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&gt(e,t,0)>-1}function dt(e,t,l){for(var n=-1,i=null==e?0:e.length;++n<i;)if(l(t,e[n]))return!0;return!1}function ut(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i}function st(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e}function ct(e,t,l,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(l=e[++i]);++i<o;)l=t(l,e[i],i,e);return l}function vt(e,t,l,n){var i=null==e?0:e.length;for(n&&i&&(l=e[--i]);i--;)l=t(l,e[i],i,e);return l}function mt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(t(e[l],l,e))return!0;return!1}var pt=Tt("length");function Et(e,t,l){var n;return l(e,function(e,l,i){if(t(e,l,i))return n=l,!1}),n}function ft(e,t,l,n){for(var i=e.length,o=l+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function gt(e,t,l){return t==t?function(e,t,l){for(var n=l-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,l):ft(e,ht,l)}function _t(e,t,l,n){for(var i=l-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function ht(e){return e!=e}function yt(e,t){var l=null==e?0:e.length;return l?Nt(e,t)/l:NaN}function Tt(e){return function(t){return null==t?void 0:t[e]}}function St(e){return function(t){return null==e?void 0:e[t]}}function bt(e,t,l,n,i){return i(e,function(e,i,o){l=n?(n=!1,e):t(l,e,i,o)}),l}function Nt(e,t){for(var l,n=-1,i=e.length;++n<i;){var o=t(e[n]);void 0!==o&&(l=void 0===l?o:l+o)}return l}function It(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}function Dt(e){return e?e.slice(0,zt(e)+1).replace(K,""):e}function Ct(e){return function(t){return e(t)}}function At(e,t){return ut(t,function(t){return e[t]})}function xt(e,t){return e.has(t)}function Ot(e,t){for(var l=-1,n=e.length;++l<n&&gt(t,e[l],0)>-1;);return l}function wt(e,t){for(var l=e.length;l--&&gt(t,e[l],0)>-1;);return l}function Lt(e,t){for(var l=e.length,n=0;l--;)e[l]===t&&++n;return n}var Pt=St({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Rt=St({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function kt(e){return"\\"+Fe[e]}function Mt(e){return we.test(e)}function Ft(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l}function Bt(e,t){return function(l){return e(t(l))}}function Wt(e,t){for(var l=-1,i=e.length,o=0,a=[];++l<i;){var r=e[l];r!==t&&r!==n||(e[l]=n,a[o++]=l)}return a}function Ut(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l}function Ht(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=[e,e]}),l}function jt(e){return Mt(e)?function(e){for(var t=xe.lastIndex=0;xe.test(e);)++t;return t}(e):pt(e)}function Vt(e){return Mt(e)?function(e){return e.match(xe)||[]}(e):function(e){return e.split("")}(e)}function zt(e){for(var t=e.length;t--&&G.test(e.charAt(t)););return t}var Kt=St({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Gt=function e(t){var G=(t=null==t?je:Gt.defaults(je.Object(),t,Gt.pick(je,Pe))).Array,ue=t.Date,se=t.Error,ce=t.Function,ve=t.Math,me=t.Object,pe=t.RegExp,Ee=t.String,fe=t.TypeError,ge=G.prototype,_e=me.prototype,he=t["__core-js_shared__"],ye=ce.prototype.toString,Te=_e.hasOwnProperty,Se=0,be=function(){var e=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ne=_e.toString,Ie=ye.call(me),De=je._,xe=pe("^"+ye.call(Te).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),we=Ke?t.Buffer:void 0,Fe=t.Symbol,Ue=t.Uint8Array,He=we?we.allocUnsafe:void 0,Ve=Bt(me.getPrototypeOf,me),ze=me.create,Ge=_e.propertyIsEnumerable,qe=ge.splice,Xe=Fe?Fe.isConcatSpreadable:void 0,pt=Fe?Fe.iterator:void 0,St=Fe?Fe.toStringTag:void 0,qt=function(){try{var e=Zi(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Yt=t.clearTimeout!==je.clearTimeout&&t.clearTimeout,Xt=ue&&ue.now!==je.Date.now&&ue.now,Qt=t.setTimeout!==je.setTimeout&&t.setTimeout,Zt=ve.ceil,Jt=ve.floor,$t=me.getOwnPropertySymbols,el=we?we.isBuffer:void 0,tl=t.isFinite,ll=ge.join,nl=Bt(me.keys,me),il=ve.max,ol=ve.min,al=ue.now,rl=t.parseInt,dl=ve.random,ul=ge.reverse,sl=Zi(t,"DataView"),cl=Zi(t,"Map"),vl=Zi(t,"Promise"),ml=Zi(t,"Set"),pl=Zi(t,"WeakMap"),El=Zi(me,"create"),fl=pl&&new pl,gl={},_l=Io(sl),hl=Io(cl),yl=Io(vl),Tl=Io(ml),Sl=Io(pl),bl=Fe?Fe.prototype:void 0,Nl=bl?bl.valueOf:void 0,Il=bl?bl.toString:void 0;function Dl(e){if(ja(e)&&!wa(e)&&!(e instanceof Ol)){if(e instanceof xl)return e;if(Te.call(e,"__wrapped__"))return Do(e)}return new xl(e)}var Cl=function(){function e(){}return function(t){if(!Ha(t))return{};if(ze)return ze(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}();function Al(){}function xl(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Ol(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function wl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Ll(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Pl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Rl(e){var t=-1,l=null==e?0:e.length;for(this.__data__=new Pl;++t<l;)this.add(e[t])}function kl(e){var t=this.__data__=new Ll(e);this.size=t.size}function Ml(e,t){var l=wa(e),n=!l&&Oa(e),i=!l&&!n&&ka(e),o=!l&&!n&&!i&&Qa(e),a=l||n||i||o,r=a?It(e.length,Ee):[],d=r.length;for(var u in e)!t&&!Te.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||io(u,d))||r.push(u);return r}function Fl(e){var t=e.length;return t?e[Rn(0,t-1)]:void 0}function Bl(e,t){return So(Ei(e),ql(t,0,e.length))}function Wl(e){return So(Ei(e))}function Ul(e,t,l){(void 0!==l&&!Ca(e[t],l)||void 0===l&&!(t in e))&&Kl(e,t,l)}function Hl(e,t,l){var n=e[t];Te.call(e,t)&&Ca(n,l)&&(void 0!==l||t in e)||Kl(e,t,l)}function jl(e,t){for(var l=e.length;l--;)if(Ca(e[l][0],t))return l;return-1}function Vl(e,t,l,n){return Jl(e,function(e,i,o){t(n,e,l(e),o)}),n}function zl(e,t){return e&&fi(t,_r(t),e)}function Kl(e,t,l){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l}function Gl(e,t){for(var l=-1,n=t.length,i=G(n),o=null==e;++l<n;)i[l]=o?void 0:mr(e,t[l]);return i}function ql(e,t,l){return e==e&&(void 0!==l&&(e=e<=l?e:l),void 0!==t&&(e=e>=t?e:t)),e}function Yl(e,t,l,n,i,a){var u,h=1&t,O=2&t,w=4&t;if(l&&(u=i?l(e,n,i,a):l(e)),void 0!==u)return u;if(!Ha(e))return e;var L=wa(e);if(L){if(u=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&Te.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(e),!h)return Ei(e,u)}else{var P=eo(e),R=P==s||P==c;if(ka(e))return ui(e,h);if(P==p||P==o||R&&!i){if(u=O||R?{}:lo(e),!h)return O?function(e,t){return fi(e,$i(e),t)}(e,function(e,t){return e&&fi(t,hr(t),e)}(u,e)):function(e,t){return fi(e,Ji(e),t)}(e,zl(u,e))}else{if(!Me[P])return i?e:{};u=function(e,t,l){var n=e.constructor;switch(t){case y:return si(e);case r:case d:return new n(+e);case T:return function(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);case S:case b:case N:case I:case D:case C:case"[object Uint8ClampedArray]":case A:case x:return ci(e,l);case v:return new n;case m:case g:return new n(e);case E:return function(e){var t=new e.constructor(e.source,ee.exec(e));return t.lastIndex=e.lastIndex,t}(e);case f:return new n;case _:return Nl?me(Nl.call(e)):{}}}(e,P,h)}}a||(a=new kl);var k=a.get(e);if(k)return k;a.set(e,u),qa(e)?e.forEach(function(n){u.add(Yl(n,t,l,n,e,a))}):Va(e)&&e.forEach(function(n,i){u.set(i,Yl(n,t,l,i,e,a))});var M=L?void 0:(w?O?zi:Vi:O?hr:_r)(e);return nt(M||e,function(n,i){M&&(n=e[i=n]),Hl(u,i,Yl(n,t,l,i,e,a))}),u}function Xl(e,t,l){var n=l.length;if(null==e)return!n;for(e=me(e);n--;){var i=l[n],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Ql(e,t,n){if("function"!=typeof e)throw new fe(l);return _o(function(){e.apply(void 0,n)},t)}function Zl(e,t,l,n){var i=-1,o=rt,a=!0,r=e.length,d=[],u=t.length;if(!r)return d;l&&(t=ut(t,Ct(l))),n?(o=dt,a=!1):t.length>=200&&(o=xt,a=!1,t=new Rl(t));e:for(;++i<r;){var s=e[i],c=null==l?s:l(s);if(s=n||0!==s?s:0,a&&c==c){for(var v=u;v--;)if(t[v]===c)continue e;d.push(s)}else o(t,c,n)||d.push(s)}return d}Dl.templateSettings={escape:F,evaluate:B,interpolate:W,variable:"",imports:{_:Dl}},(Dl.prototype=Al.prototype).constructor=Dl,(xl.prototype=Cl(Al.prototype)).constructor=xl,(Ol.prototype=Cl(Al.prototype)).constructor=Ol,wl.prototype.clear=function(){this.__data__=El?El(null):{},this.size=0},wl.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},wl.prototype.get=function(e){var t=this.__data__;if(El){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return Te.call(t,e)?t[e]:void 0},wl.prototype.has=function(e){var t=this.__data__;return El?void 0!==t[e]:Te.call(t,e)},wl.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=El&&void 0===t?"__lodash_hash_undefined__":t,this},Ll.prototype.clear=function(){this.__data__=[],this.size=0},Ll.prototype.delete=function(e){var t=this.__data__,l=jl(t,e);return!(l<0||(l==t.length-1?t.pop():qe.call(t,l,1),--this.size,0))},Ll.prototype.get=function(e){var t=this.__data__,l=jl(t,e);return l<0?void 0:t[l][1]},Ll.prototype.has=function(e){return jl(this.__data__,e)>-1},Ll.prototype.set=function(e,t){var l=this.__data__,n=jl(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this},Pl.prototype.clear=function(){this.size=0,this.__data__={hash:new wl,map:new(cl||Ll),string:new wl}},Pl.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},Pl.prototype.get=function(e){return Xi(this,e).get(e)},Pl.prototype.has=function(e){return Xi(this,e).has(e)},Pl.prototype.set=function(e,t){var l=Xi(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this},Rl.prototype.add=Rl.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Rl.prototype.has=function(e){return this.__data__.has(e)},kl.prototype.clear=function(){this.__data__=new Ll,this.size=0},kl.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},kl.prototype.get=function(e){return this.__data__.get(e)},kl.prototype.has=function(e){return this.__data__.has(e)},kl.prototype.set=function(e,t){var l=this.__data__;if(l instanceof Ll){var n=l.__data__;if(!cl||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new Pl(n)}return l.set(e,t),this.size=l.size,this};var Jl=hi(rn),$l=hi(dn,!0);function en(e,t){var l=!0;return Jl(e,function(e,n,i){return l=!!t(e,n,i)}),l}function tn(e,t,l){for(var n=-1,i=e.length;++n<i;){var o=e[n],a=t(o);if(null!=a&&(void 0===r?a==a&&!Xa(a):l(a,r)))var r=a,d=o}return d}function ln(e,t){var l=[];return Jl(e,function(e,n,i){t(e,n,i)&&l.push(e)}),l}function nn(e,t,l,n,i){var o=-1,a=e.length;for(l||(l=no),i||(i=[]);++o<a;){var r=e[o];t>0&&l(r)?t>1?nn(r,t-1,l,n,i):st(i,r):n||(i[i.length]=r)}return i}var on=yi(),an=yi(!0);function rn(e,t){return e&&on(e,t,_r)}function dn(e,t){return e&&an(e,t,_r)}function un(e,t){return at(t,function(t){return Ba(e[t])})}function sn(e,t){for(var l=0,n=(t=oi(t,e)).length;null!=e&&l<n;)e=e[No(t[l++])];return l&&l==n?e:void 0}function cn(e,t,l){var n=t(e);return wa(e)?n:st(n,l(e))}function vn(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":St&&St in me(e)?function(e){var t=Te.call(e,St),l=e[St];try{e[St]=void 0;var n=!0}catch(e){}var i=Ne.call(e);return n&&(t?e[St]=l:delete e[St]),i}(e):function(e){return Ne.call(e)}(e)}function mn(e,t){return e>t}function pn(e,t){return null!=e&&Te.call(e,t)}function En(e,t){return null!=e&&t in me(e)}function fn(e,t,l){for(var n=l?dt:rt,i=e[0].length,o=e.length,a=o,r=G(o),d=Infinity,u=[];a--;){var s=e[a];a&&t&&(s=ut(s,Ct(t))),d=ol(s.length,d),r[a]=!l&&(t||i>=120&&s.length>=120)?new Rl(a&&s):void 0}s=e[0];var c=-1,v=r[0];e:for(;++c<i&&u.length<d;){var m=s[c],p=t?t(m):m;if(m=l||0!==m?m:0,!(v?xt(v,p):n(u,p,l))){for(a=o;--a;){var E=r[a];if(!(E?xt(E,p):n(e[a],p,l)))continue e}v&&v.push(p),u.push(m)}}return u}function gn(e,t,l){var n=null==(e=po(e,t=oi(t,e)))?e:e[No(Fo(t))];return null==n?void 0:tt(n,e,l)}function _n(e){return ja(e)&&vn(e)==o}function hn(e,t,l,n,i){return e===t||(null==e||null==t||!ja(e)&&!ja(t)?e!=e&&t!=t:function(e,t,l,n,i,s){var c=wa(e),h=wa(t),S=c?a:eo(e),b=h?a:eo(t),N=(S=S==o?p:S)==p,I=(b=b==o?p:b)==p,D=S==b;if(D&&ka(e)){if(!ka(t))return!1;c=!0,N=!1}if(D&&!N)return s||(s=new kl),c||Qa(e)?Hi(e,t,l,n,i,s):function(e,t,l,n,i,o,a){switch(l){case T:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!o(new Ue(e),new Ue(t)));case r:case d:case m:return Ca(+e,+t);case u:return e.name==t.name&&e.message==t.message;case E:case g:return e==t+"";case v:var s=Ft;case f:if(s||(s=Ut),e.size!=t.size&&!(1&n))return!1;var c=a.get(e);if(c)return c==t;n|=2,a.set(e,t);var p=Hi(s(e),s(t),n,i,o,a);return a.delete(e),p;case _:if(Nl)return Nl.call(e)==Nl.call(t)}return!1}(e,t,S,l,n,i,s);if(!(1&l)){var C=N&&Te.call(e,"__wrapped__"),A=I&&Te.call(t,"__wrapped__");if(C||A){var x=C?e.value():e,O=A?t.value():t;return s||(s=new kl),i(x,O,l,n,s)}}return!!D&&(s||(s=new kl),function(e,t,l,n,i,o){var a=1&l,r=Vi(e),d=r.length;if(d!=Vi(t).length&&!a)return!1;for(var u=d;u--;){var s=r[u];if(!(a?s in t:Te.call(t,s)))return!1}var c=o.get(e),v=o.get(t);if(c&&v)return c==t&&v==e;var m=!0;o.set(e,t),o.set(t,e);for(var p=a;++u<d;){var E=e[s=r[u]],f=t[s];if(n)var g=a?n(f,E,s,t,e,o):n(E,f,s,e,t,o);if(!(void 0===g?E===f||i(E,f,l,n,o):g)){m=!1;break}p||(p="constructor"==s)}if(m&&!p){var _=e.constructor,h=t.constructor;_==h||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof h&&h instanceof h||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,l,n,i,s))}(e,t,l,n,hn,i))}function yn(e,t,l,n){var i=l.length,o=i,a=!n;if(null==e)return!o;for(e=me(e);i--;){var r=l[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var d=(r=l[i])[0],u=e[d],s=r[1];if(a&&r[2]){if(void 0===u&&!(d in e))return!1}else{var c=new kl;if(n)var v=n(u,s,d,e,t,c);if(!(void 0===v?hn(s,u,3,n,c):v))return!1}}return!0}function Tn(e){return!(!Ha(e)||(t=e,be&&be in t))&&(Ba(e)?xe:ne).test(Io(e));var t}function Sn(e){return"function"==typeof e?e:null==e?zr:"object"==typeof e?wa(e)?Cn(e[0],e[1]):Dn(e):$r(e)}function bn(e){if(!so(e))return nl(e);var t=[];for(var l in me(e))Te.call(e,l)&&"constructor"!=l&&t.push(l);return t}function Nn(e,t){return e<t}function In(e,t){var l=-1,n=Pa(e)?G(e.length):[];return Jl(e,function(e,i,o){n[++l]=t(e,i,o)}),n}function Dn(e){var t=Qi(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(l){return l===e||yn(l,e,t)}}function Cn(e,t){return ao(e)&&co(t)?vo(No(e),t):function(l){var n=mr(l,e);return void 0===n&&n===t?pr(l,e):hn(t,n,3)}}function An(e,t,l,n,i){e!==t&&on(t,function(o,a){if(i||(i=new kl),Ha(o))!function(e,t,l,n,i,o,a){var r=fo(e,l),d=fo(t,l),u=a.get(d);if(u)Ul(e,l,u);else{var s=o?o(r,d,l+"",e,t,a):void 0,c=void 0===s;if(c){var v=wa(d),m=!v&&ka(d),p=!v&&!m&&Qa(d);s=d,v||m||p?wa(r)?s=r:Ra(r)?s=Ei(r):m?(c=!1,s=ui(d,!0)):p?(c=!1,s=ci(d,!0)):s=[]:Ka(d)||Oa(d)?(s=r,Oa(r)?s=ir(r):Ha(r)&&!Ba(r)||(s=lo(d))):c=!1}c&&(a.set(d,s),i(s,d,n,o,a),a.delete(d)),Ul(e,l,s)}}(e,t,a,l,An,n,i);else{var r=n?n(fo(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Ul(e,a,r)}},hr)}function xn(e,t){var l=e.length;if(l)return io(t+=t<0?l:0,l)?e[t]:void 0}function On(e,t,l){t=t.length?ut(t,function(e){return wa(e)?function(t){return sn(t,1===e.length?e[0]:e)}:e}):[zr];var n=-1;return t=ut(t,Ct(Yi())),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,r=l.length;++n<a;){var d=vi(i[n],o[n]);if(d)return n>=r?d:d*("desc"==l[n]?-1:1)}return e.index-t.index}(e,t,l)});n--;)e[n]=e[n].value;return e}(In(e,function(e,l,i){return{criteria:ut(t,function(t){return t(e)}),index:++n,value:e}}))}function wn(e,t,l){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],r=sn(e,a);l(r,a)&&Wn(o,oi(a,e),r)}return o}function Ln(e,t,l,n){var i=n?_t:gt,o=-1,a=t.length,r=e;for(e===t&&(t=Ei(t)),l&&(r=ut(e,Ct(l)));++o<a;)for(var d=0,u=t[o],s=l?l(u):u;(d=i(r,s,d,n))>-1;)r!==e&&qe.call(r,d,1),qe.call(e,d,1);return e}function Pn(e,t){for(var l=e?t.length:0,n=l-1;l--;){var i=t[l];if(l==n||i!==o){var o=i;io(i)?qe.call(e,i,1):Zn(e,i)}}return e}function Rn(e,t){return e+Jt(dl()*(t-e+1))}function kn(e,t){var l="";if(!e||t<1||t>9007199254740991)return l;do{t%2&&(l+=e),(t=Jt(t/2))&&(e+=e)}while(t);return l}function Mn(e,t){return ho(mo(e,t,zr),e+"")}function Fn(e){return Fl(Cr(e))}function Bn(e,t){var l=Cr(e);return So(l,ql(t,0,l.length))}function Wn(e,t,l,n){if(!Ha(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var d=No(t[i]),u=l;if("__proto__"===d||"constructor"===d||"prototype"===d)return e;if(i!=a){var s=r[d];void 0===(u=n?n(s,d,r):void 0)&&(u=Ha(s)?s:io(t[i+1])?[]:{})}Hl(r,d,u),r=r[d]}return e}var Un=fl?function(e,t){return fl.set(e,t),e}:zr,Hn=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:Hr(t),writable:!0})}:zr;function jn(e){return So(Cr(e))}function Vn(e,t,l){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(l=l>i?i:l)<0&&(l+=i),i=t>l?0:l-t>>>0,t>>>=0;for(var o=G(i);++n<i;)o[n]=e[n+t];return o}function zn(e,t){var l;return Jl(e,function(e,n,i){return!(l=t(e,n,i))}),!!l}function Kn(e,t,l){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!Xa(a)&&(l?a<=t:a<t)?n=o+1:i=o}return i}return Gn(e,t,zr,l)}function Gn(e,t,l,n){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=l(t))!=t,r=null===t,d=Xa(t),u=void 0===t;i<o;){var s=Jt((i+o)/2),c=l(e[s]),v=void 0!==c,m=null===c,p=c==c,E=Xa(c);if(a)var f=n||p;else f=u?p&&(n||v):r?p&&v&&(n||!m):d?p&&v&&!m&&(n||!E):!m&&!E&&(n?c<=t:c<t);f?i=s+1:o=s}return ol(o,4294967294)}function qn(e,t){for(var l=-1,n=e.length,i=0,o=[];++l<n;){var a=e[l],r=t?t(a):a;if(!l||!Ca(r,d)){var d=r;o[i++]=0===a?0:a}}return o}function Yn(e){return"number"==typeof e?e:Xa(e)?NaN:+e}function Xn(e){if("string"==typeof e)return e;if(wa(e))return ut(e,Xn)+"";if(Xa(e))return Il?Il.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Qn(e,t,l){var n=-1,i=rt,o=e.length,a=!0,r=[],d=r;if(l)a=!1,i=dt;else if(o>=200){var u=t?null:ki(e);if(u)return Ut(u);a=!1,i=xt,d=new Rl}else d=t?[]:r;e:for(;++n<o;){var s=e[n],c=t?t(s):s;if(s=l||0!==s?s:0,a&&c==c){for(var v=d.length;v--;)if(d[v]===c)continue e;t&&d.push(c),r.push(s)}else i(d,c,l)||(d!==r&&d.push(c),r.push(s))}return r}function Zn(e,t){var l=-1,n=(t=oi(t,e)).length;if(!n)return!0;for(;++l<n;){var i=No(t[l]);if("__proto__"===i&&!Te.call(e,"__proto__"))return!1;if(("constructor"===i||"prototype"===i)&&l<n-1)return!1}var o=po(e,t);return null==o||delete o[No(Fo(t))]}function Jn(e,t,l,n){return Wn(e,t,l(sn(e,t)),n)}function $n(e,t,l,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return l?Vn(e,n?0:o,n?o+1:i):Vn(e,n?o+1:0,n?i:o)}function ei(e,t){var l=e;return l instanceof Ol&&(l=l.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},l)}function ti(e,t,l){var n=e.length;if(n<2)return n?Qn(e[0]):[];for(var i=-1,o=G(n);++i<n;)for(var a=e[i],r=-1;++r<n;)r!=i&&(o[i]=Zl(o[i]||a,e[r],t,l));return Qn(nn(o,1),t,l)}function li(e,t,l){for(var n=-1,i=e.length,o=t.length,a={};++n<i;)l(a,e[n],n<o?t[n]:void 0);return a}function ni(e){return Ra(e)?e:[]}function ii(e){return"function"==typeof e?e:zr}function oi(e,t){return wa(e)?e:ao(e,t)?[e]:bo(or(e))}var ai=Mn;function ri(e,t,l){var n=e.length;return l=void 0===l?n:l,!t&&l>=n?e:Vn(e,t,l)}var di=Yt||function(e){return je.clearTimeout(e)};function ui(e,t){if(t)return e.slice();var l=e.length,n=He?He(l):new e.constructor(l);return e.copy(n),n}function si(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function ci(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var l=void 0!==e,n=null===e,i=e==e,o=Xa(e),a=void 0!==t,r=null===t,d=t==t,u=Xa(t);if(!r&&!u&&!o&&e>t||o&&a&&d&&!r&&!u||n&&a&&d||!l&&d||!i)return 1;if(!n&&!o&&!u&&e<t||u&&l&&i&&!n&&!o||r&&l&&i||!a&&i||!d)return-1}return 0}function mi(e,t,l,n){for(var i=-1,o=e.length,a=l.length,r=-1,d=t.length,u=il(o-a,0),s=G(d+u),c=!n;++r<d;)s[r]=t[r];for(;++i<a;)(c||i<o)&&(s[l[i]]=e[i]);for(;u--;)s[r++]=e[i++];return s}function pi(e,t,l,n){for(var i=-1,o=e.length,a=-1,r=l.length,d=-1,u=t.length,s=il(o-r,0),c=G(s+u),v=!n;++i<s;)c[i]=e[i];for(var m=i;++d<u;)c[m+d]=t[d];for(;++a<r;)(v||i<o)&&(c[m+l[a]]=e[i++]);return c}function Ei(e,t){var l=-1,n=e.length;for(t||(t=G(n));++l<n;)t[l]=e[l];return t}function fi(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],d=n?n(l[r],e[r],r,l,e):void 0;void 0===d&&(d=e[r]),i?Kl(l,r,d):Hl(l,r,d)}return l}function gi(e,t){return function(l,n){var i=wa(l)?lt:Vl,o=t?t():{};return i(l,e,Yi(n,2),o)}}function _i(e){return Mn(function(t,l){var n=-1,i=l.length,o=i>1?l[i-1]:void 0,a=i>2?l[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(l[0],l[1],a)&&(o=i<3?void 0:o,i=1),t=me(t);++n<i;){var r=l[n];r&&e(t,r,n,o)}return t})}function hi(e,t){return function(l,n){if(null==l)return l;if(!Pa(l))return e(l,n);for(var i=l.length,o=t?i:-1,a=me(l);(t?o--:++o<i)&&!1!==n(a[o],o,a););return l}}function yi(e){return function(t,l,n){for(var i=-1,o=me(t),a=n(t),r=a.length;r--;){var d=a[e?r:++i];if(!1===l(o[d],d,o))break}return t}}function Ti(e){return function(t){var l=Mt(t=or(t))?Vt(t):void 0,n=l?l[0]:t.charAt(0),i=l?ri(l,1).join(""):t.slice(1);return n[e]()+i}}function Si(e){return function(t){return ct(Br(Or(t).replace(Ce,"")),e,"")}}function bi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var l=Cl(e.prototype),n=e.apply(l,t);return Ha(n)?n:l}}function Ni(e){return function(t,l,n){var i=me(t);if(!Pa(t)){var o=Yi(l,3);t=_r(t),l=function(e){return o(i[e],e,i)}}var a=e(t,l,n);return a>-1?i[o?t[a]:a]:void 0}}function Ii(e){return ji(function(t){var n=t.length,i=n,o=xl.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new fe(l);if(o&&!r&&"wrapper"==Gi(a))var r=new xl([],!0)}for(i=r?i:n;++i<n;){var d=Gi(a=t[i]),u="wrapper"==d?Ki(a):void 0;r=u&&ro(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?r[Gi(u[0])].apply(r,u[3]):1==a.length&&ro(a)?r[d]():r.thru(a)}return function(){var e=arguments,l=e[0];if(r&&1==e.length&&wa(l))return r.plant(l).value();for(var i=0,o=n?t[i].apply(this,e):l;++i<n;)o=t[i].call(this,o);return o}})}function Di(e,t,l,n,i,o,a,r,d,u){var s=128&t,c=1&t,v=2&t,m=24&t,p=512&t,E=v?void 0:bi(e);return function f(){for(var g=arguments.length,_=G(g),h=g;h--;)_[h]=arguments[h];if(m)var y=qi(f),T=Lt(_,y);if(n&&(_=mi(_,n,i,m)),o&&(_=pi(_,o,a,m)),g-=T,m&&g<u){var S=Wt(_,y);return Pi(e,t,Di,f.placeholder,l,_,S,r,d,u-g)}var b=c?l:this,N=v?b[e]:e;return g=_.length,r?_=Eo(_,r):p&&g>1&&_.reverse(),s&&d<g&&(_.length=d),this&&this!==je&&this instanceof f&&(N=E||bi(N)),N.apply(b,_)}}function Ci(e,t){return function(l,n){return function(e,t,l,n){return rn(e,function(e,i,o){t(n,l(e),i,o)}),n}(l,e,t(n),{})}}function Ai(e,t){return function(l,n){var i;if(void 0===l&&void 0===n)return t;if(void 0!==l&&(i=l),void 0!==n){if(void 0===i)return n;"string"==typeof l||"string"==typeof n?(l=Xn(l),n=Xn(n)):(l=Yn(l),n=Yn(n)),i=e(l,n)}return i}}function xi(e){return ji(function(t){return t=ut(t,Ct(Yi())),Mn(function(l){var n=this;return e(t,function(e){return tt(e,n,l)})})})}function Oi(e,t){var l=(t=void 0===t?" ":Xn(t)).length;if(l<2)return l?kn(t,e):t;var n=kn(t,Zt(e/jt(t)));return Mt(t)?ri(Vt(n),0,e).join(""):n.slice(0,e)}function wi(e){return function(t,l,n){return n&&"number"!=typeof n&&oo(t,l,n)&&(l=n=void 0),t=er(t),void 0===l?(l=t,t=0):l=er(l),function(e,t,l,n){for(var i=-1,o=il(Zt((t-e)/(l||1)),0),a=G(o);o--;)a[n?o:++i]=e,e+=l;return a}(t,l,n=void 0===n?t<l?1:-1:er(n),e)}}function Li(e){return function(t,l){return"string"==typeof t&&"string"==typeof l||(t=nr(t),l=nr(l)),e(t,l)}}function Pi(e,t,l,n,i,o,a,r,d,u){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,r,d,u],v=l.apply(void 0,c);return ro(e)&&go(v,c),v.placeholder=n,yo(v,e,t)}function Ri(e){var t=ve[e];return function(e,l){if(e=nr(e),(l=null==l?0:ol(tr(l),292))&&tl(e)){var n=(or(e)+"e").split("e");return+((n=(or(t(n[0]+"e"+(+n[1]+l)))+"e").split("e"))[0]+"e"+(+n[1]-l))}return t(e)}}var ki=ml&&1/Ut(new ml([,-0]))[1]==1/0?function(e){return new ml(e)}:Xr;function Mi(e){return function(t){var l=eo(t);return l==v?Ft(t):l==f?Ht(t):function(e,t){return ut(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fi(e,t,i,o,a,r,d,u){var s=2&t;if(!s&&"function"!=typeof e)throw new fe(l);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),d=void 0===d?d:il(tr(d),0),u=void 0===u?u:tr(u),c-=a?a.length:0,64&t){var v=o,m=a;o=a=void 0}var p=s?void 0:Ki(e),E=[e,t,i,o,a,v,m,r,d,u];if(p&&function(e,t){var l=e[1],i=t[1],o=l|i;if(!(o<131||128==i&&8==l||128==i&&256==l&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==l))return e;1&i&&(e[2]=t[2],o|=1&l?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?mi(r,a,t[4]):a,e[4]=r?Wt(e[3],n):t[4]}(a=t[5])&&(e[5]=(r=e[5])?pi(r,a,t[6]):a,e[6]=r?Wt(e[5],n):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:ol(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(E,p),e=E[0],t=E[1],i=E[2],o=E[3],a=E[4],!(u=E[9]=void 0===E[9]?s?0:e.length:il(E[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)f=8==t||16==t?function(e,t,l){var n=bi(e);return function i(){for(var o=arguments.length,a=G(o),r=o,d=qi(i);r--;)a[r]=arguments[r];var u=o<3&&a[0]!==d&&a[o-1]!==d?[]:Wt(a,d);if((o-=u.length)<l)return Pi(e,t,Di,i.placeholder,void 0,a,u,void 0,void 0,l-o);var s=this&&this!==je&&this instanceof i?n:e;return tt(s,this,a)}}(e,t,u):32!=t&&33!=t||a.length?Di.apply(void 0,E):function(e,t,l,n){var i=1&t,o=bi(e);return function t(){for(var a=-1,r=arguments.length,d=-1,u=n.length,s=G(u+r),c=this&&this!==je&&this instanceof t?o:e;++d<u;)s[d]=n[d];for(;r--;)s[d++]=arguments[++a];return tt(c,i?l:this,s)}}(e,t,i,o);else var f=function(e,t,l){var n=1&t,i=bi(e);return function t(){var o=this&&this!==je&&this instanceof t?i:e;return o.apply(n?l:this,arguments)}}(e,t,i);return yo((p?Un:go)(f,E),e,t)}function Bi(e,t,l,n){return void 0===e||Ca(e,_e[l])&&!Te.call(n,l)?t:e}function Wi(e,t,l,n,i,o){return Ha(e)&&Ha(t)&&(o.set(t,e),An(e,t,void 0,Wi,o),o.delete(t)),e}function Ui(e){return Ka(e)?void 0:e}function Hi(e,t,l,n,i,o){var a=1&l,r=e.length,d=t.length;if(r!=d&&!(a&&d>r))return!1;var u=o.get(e),s=o.get(t);if(u&&s)return u==t&&s==e;var c=-1,v=!0,m=2&l?new Rl:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var p=e[c],E=t[c];if(n)var f=a?n(E,p,c,t,e,o):n(p,E,c,e,t,o);if(void 0!==f){if(f)continue;v=!1;break}if(m){if(!mt(t,function(e,t){if(!xt(m,t)&&(p===e||i(p,e,l,n,o)))return m.push(t)})){v=!1;break}}else if(p!==E&&!i(p,E,l,n,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function ji(e){return ho(mo(e,void 0,Lo),e+"")}function Vi(e){return cn(e,_r,Ji)}function zi(e){return cn(e,hr,$i)}var Ki=fl?function(e){return fl.get(e)}:Xr;function Gi(e){for(var t=e.name+"",l=gl[t],n=Te.call(gl,t)?l.length:0;n--;){var i=l[n],o=i.func;if(null==o||o==e)return i.name}return t}function qi(e){return(Te.call(Dl,"placeholder")?Dl:e).placeholder}function Yi(){var e=Dl.iteratee||Kr;return e=e===Kr?Sn:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var l,n,i=e.__data__;return("string"==(n=typeof(l=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==l:null===l)?i["string"==typeof t?"string":"hash"]:i.map}function Qi(e){for(var t=_r(e),l=t.length;l--;){var n=t[l],i=e[n];t[l]=[n,i,co(i)]}return t}function Zi(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return Tn(l)?l:void 0}var Ji=$t?function(e){return null==e?[]:(e=me(e),at($t(e),function(t){return Ge.call(e,t)}))}:ld,$i=$t?function(e){for(var t=[];e;)st(t,Ji(e)),e=Ve(e);return t}:ld,eo=vn;function to(e,t,l){for(var n=-1,i=(t=oi(t,e)).length,o=!1;++n<i;){var a=No(t[n]);if(!(o=null!=e&&l(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Ua(i)&&io(a,i)&&(wa(e)||Oa(e))}function lo(e){return"function"!=typeof e.constructor||so(e)?{}:Cl(Ve(e))}function no(e){return wa(e)||Oa(e)||!!(Xe&&e&&e[Xe])}function io(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&oe.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,l){if(!Ha(l))return!1;var n=typeof t;return!!("number"==n?Pa(l)&&io(t,l.length):"string"==n&&t in l)&&Ca(l[t],e)}function ao(e,t){if(wa(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!Xa(e))||H.test(e)||!U.test(e)||null!=t&&e in me(t)}function ro(e){var t=Gi(e),l=Dl[t];if("function"!=typeof l||!(t in Ol.prototype))return!1;if(e===l)return!0;var n=Ki(l);return!!n&&e===n[0]}(sl&&eo(new sl(new ArrayBuffer(1)))!=T||cl&&eo(new cl)!=v||vl&&"[object Promise]"!=eo(vl.resolve())||ml&&eo(new ml)!=f||pl&&eo(new pl)!=h)&&(eo=function(e){var t=vn(e),l=t==p?e.constructor:void 0,n=l?Io(l):"";if(n)switch(n){case _l:return T;case hl:return v;case yl:return"[object Promise]";case Tl:return f;case Sl:return h}return t});var uo=he?Ba:nd;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}function co(e){return e==e&&!Ha(e)}function vo(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in me(l))}}function mo(e,t,l){return t=il(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=il(n.length-t,0),a=G(o);++i<o;)a[i]=n[t+i];i=-1;for(var r=G(t+1);++i<t;)r[i]=n[i];return r[t]=l(a),tt(e,this,r)}}function po(e,t){return t.length<2?e:sn(e,Vn(t,0,-1))}function Eo(e,t){for(var l=e.length,n=ol(t.length,l),i=Ei(e);n--;){var o=t[n];e[n]=io(o,l)?i[o]:void 0}return e}function fo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var go=To(Un),_o=Qt||function(e,t){return je.setTimeout(e,t)},ho=To(Hn);function yo(e,t,l){var n=t+"";return ho(e,function(e,t){var l=t.length;if(!l)return e;var n=l-1;return t[n]=(l>1?"& ":"")+t[n],t=t.join(l>2?", ":" "),e.replace(q,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return nt(i,function(l){var n="_."+l[0];t&l[1]&&!rt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(Y);return t?t[1].split(X):[]}(n),l)))}function To(e){var t=0,l=0;return function(){var n=al(),i=16-(n-l);if(l=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function So(e,t){var l=-1,n=e.length,i=n-1;for(t=void 0===t?n:t;++l<t;){var o=Rn(l,i),a=e[o];e[o]=e[l],e[l]=a}return e.length=t,e}var bo=function(e){var t=Ta(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(j,function(e,l,n,i){t.push(n?i.replace(J,"$1"):l||e)}),t},function(e){return 500===l.size&&l.clear(),e}),l=t.cache;return t}();function No(e){if("string"==typeof e||Xa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Io(e){if(null!=e){try{return ye.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Do(e){if(e instanceof Ol)return e.clone();var t=new xl(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Co=Mn(function(e,t){return Ra(e)?Zl(e,nn(t,1,Ra,!0)):[]}),Ao=Mn(function(e,t){var l=Fo(t);return Ra(l)&&(l=void 0),Ra(e)?Zl(e,nn(t,1,Ra,!0),Yi(l,2)):[]}),xo=Mn(function(e,t){var l=Fo(t);return Ra(l)&&(l=void 0),Ra(e)?Zl(e,nn(t,1,Ra,!0),void 0,l):[]});function Oo(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:tr(l);return i<0&&(i=il(n+i,0)),ft(e,Yi(t,3),i)}function wo(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n-1;return void 0!==l&&(i=tr(l),i=l<0?il(n+i,0):ol(i,n-1)),ft(e,Yi(t,3),i,!0)}function Lo(e){return null!=e&&e.length?nn(e,1):[]}function Po(e){return e&&e.length?e[0]:void 0}var Ro=Mn(function(e){var t=ut(e,ni);return t.length&&t[0]===e[0]?fn(t):[]}),ko=Mn(function(e){var t=Fo(e),l=ut(e,ni);return t===Fo(l)?t=void 0:l.pop(),l.length&&l[0]===e[0]?fn(l,Yi(t,2)):[]}),Mo=Mn(function(e){var t=Fo(e),l=ut(e,ni);return(t="function"==typeof t?t:void 0)&&l.pop(),l.length&&l[0]===e[0]?fn(l,void 0,t):[]});function Fo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Bo=Mn(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?Ln(e,t):e}var Uo=ji(function(e,t){var l=null==e?0:e.length,n=Gl(e,t);return Pn(e,ut(t,function(e){return io(e,l)?+e:e}).sort(vi)),n});function Ho(e){return null==e?e:ul.call(e)}var jo=Mn(function(e){return Qn(nn(e,1,Ra,!0))}),Vo=Mn(function(e){var t=Fo(e);return Ra(t)&&(t=void 0),Qn(nn(e,1,Ra,!0),Yi(t,2))}),zo=Mn(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,Qn(nn(e,1,Ra,!0),void 0,t)});function Ko(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ra(e))return t=il(e.length,t),!0}),It(t,function(t){return ut(e,Tt(t))})}function Go(e,t){if(!e||!e.length)return[];var l=Ko(e);return null==t?l:ut(l,function(e){return tt(t,void 0,e)})}var qo=Mn(function(e,t){return Ra(e)?Zl(e,t):[]}),Yo=Mn(function(e){return ti(at(e,Ra))}),Xo=Mn(function(e){var t=Fo(e);return Ra(t)&&(t=void 0),ti(at(e,Ra),Yi(t,2))}),Qo=Mn(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,ti(at(e,Ra),void 0,t)}),Zo=Mn(Ko),Jo=Mn(function(e){var t=e.length,l=t>1?e[t-1]:void 0;return l="function"==typeof l?(e.pop(),l):void 0,Go(e,l)});function $o(e){var t=Dl(e);return t.__chain__=!0,t}function ea(e,t){return t(e)}var ta=ji(function(e){var t=e.length,l=t?e[0]:0,n=this.__wrapped__,i=function(t){return Gl(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Ol&&io(l)?((n=n.slice(l,+l+(t?1:0))).__actions__.push({func:ea,args:[i],thisArg:void 0}),new xl(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),la=gi(function(e,t,l){Te.call(e,l)?++e[l]:Kl(e,l,1)}),na=Ni(Oo),ia=Ni(wo);function oa(e,t){return(wa(e)?nt:Jl)(e,Yi(t,3))}function aa(e,t){return(wa(e)?it:$l)(e,Yi(t,3))}var ra=gi(function(e,t,l){Te.call(e,l)?e[l].push(t):Kl(e,l,[t])}),da=Mn(function(e,t,l){var n=-1,i="function"==typeof t,o=Pa(e)?G(e.length):[];return Jl(e,function(e){o[++n]=i?tt(t,e,l):gn(e,t,l)}),o}),ua=gi(function(e,t,l){Kl(e,l,t)});function sa(e,t){return(wa(e)?ut:In)(e,Yi(t,3))}var ca=gi(function(e,t,l){e[l?0:1].push(t)},function(){return[[],[]]}),va=Mn(function(e,t){if(null==e)return[];var l=t.length;return l>1&&oo(e,t[0],t[1])?t=[]:l>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),On(e,nn(t,1),[])}),ma=Xt||function(){return je.Date.now()};function pa(e,t,l){return t=l?void 0:t,Fi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function Ea(e,t){var n;if("function"!=typeof t)throw new fe(l);return e=tr(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var fa=Mn(function(e,t,l){var n=1;if(l.length){var i=Wt(l,qi(fa));n|=32}return Fi(e,n,t,l,i)}),ga=Mn(function(e,t,l){var n=3;if(l.length){var i=Wt(l,qi(ga));n|=32}return Fi(t,n,e,l,i)});function _a(e,t,n){var i,o,a,r,d,u,s=0,c=!1,v=!1,m=!0;if("function"!=typeof e)throw new fe(l);function p(t){var l=i,n=o;return i=o=void 0,s=t,r=e.apply(n,l)}function E(e){return s=e,d=_o(g,t),c?p(e):r}function f(e){var l=e-u;return void 0===u||l>=t||l<0||v&&e-s>=a}function g(){var e=ma();if(f(e))return _(e);d=_o(g,function(e){var l=t-(e-u);return v?ol(l,a-(e-s)):l}(e))}function _(e){return d=void 0,m&&i?p(e):(i=o=void 0,r)}function h(){var e=ma(),l=f(e);if(i=arguments,o=this,u=e,l){if(void 0===d)return E(u);if(v)return di(d),d=_o(g,t),p(u)}return void 0===d&&(d=_o(g,t)),r}return t=nr(t)||0,Ha(n)&&(c=!!n.leading,a=(v="maxWait"in n)?il(nr(n.maxWait)||0,t):a,m="trailing"in n?!!n.trailing:m),h.cancel=function(){void 0!==d&&di(d),s=0,i=u=o=d=void 0},h.flush=function(){return void 0===d?r:_(ma())},h}var ha=Mn(function(e,t){return Ql(e,1,t)}),ya=Mn(function(e,t,l){return Ql(e,nr(t)||0,l)});function Ta(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new fe(l);var n=function(){var l=arguments,i=t?t.apply(this,l):l[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,l);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ta.Cache||Pl),n}function Sa(e){if("function"!=typeof e)throw new fe(l);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ta.Cache=Pl;var ba=ai(function(e,t){var l=(t=1==t.length&&wa(t[0])?ut(t[0],Ct(Yi())):ut(nn(t,1),Ct(Yi()))).length;return Mn(function(n){for(var i=-1,o=ol(n.length,l);++i<o;)n[i]=t[i].call(this,n[i]);return tt(e,this,n)})}),Na=Mn(function(e,t){return Fi(e,32,void 0,t,Wt(t,qi(Na)))}),Ia=Mn(function(e,t){return Fi(e,64,void 0,t,Wt(t,qi(Ia)))}),Da=ji(function(e,t){return Fi(e,256,void 0,void 0,void 0,t)});function Ca(e,t){return e===t||e!=e&&t!=t}var Aa=Li(mn),xa=Li(function(e,t){return e>=t}),Oa=_n(function(){return arguments}())?_n:function(e){return ja(e)&&Te.call(e,"callee")&&!Ge.call(e,"callee")},wa=G.isArray,La=Ye?Ct(Ye):function(e){return ja(e)&&vn(e)==y};function Pa(e){return null!=e&&Ua(e.length)&&!Ba(e)}function Ra(e){return ja(e)&&Pa(e)}var ka=el||nd,Ma=Qe?Ct(Qe):function(e){return ja(e)&&vn(e)==d};function Fa(e){if(!ja(e))return!1;var t=vn(e);return t==u||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ka(e)}function Ba(e){if(!Ha(e))return!1;var t=vn(e);return t==s||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wa(e){return"number"==typeof e&&e==tr(e)}function Ua(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ha(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ja(e){return null!=e&&"object"==typeof e}var Va=Ze?Ct(Ze):function(e){return ja(e)&&eo(e)==v};function za(e){return"number"==typeof e||ja(e)&&vn(e)==m}function Ka(e){if(!ja(e)||vn(e)!=p)return!1;var t=Ve(e);if(null===t)return!0;var l=Te.call(t,"constructor")&&t.constructor;return"function"==typeof l&&l instanceof l&&ye.call(l)==Ie}var Ga=Je?Ct(Je):function(e){return ja(e)&&vn(e)==E},qa=$e?Ct($e):function(e){return ja(e)&&eo(e)==f};function Ya(e){return"string"==typeof e||!wa(e)&&ja(e)&&vn(e)==g}function Xa(e){return"symbol"==typeof e||ja(e)&&vn(e)==_}var Qa=et?Ct(et):function(e){return ja(e)&&Ua(e.length)&&!!ke[vn(e)]},Za=Li(Nn),Ja=Li(function(e,t){return e<=t});function $a(e){if(!e)return[];if(Pa(e))return Ya(e)?Vt(e):Ei(e);if(pt&&e[pt])return function(e){for(var t,l=[];!(t=e.next()).done;)l.push(t.value);return l}(e[pt]());var t=eo(e);return(t==v?Ft:t==f?Ut:Cr)(e)}function er(e){return e?(e=nr(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function tr(e){var t=er(e),l=t%1;return t==t?l?t-l:t:0}function lr(e){return e?ql(tr(e),0,4294967295):0}function nr(e){if("number"==typeof e)return e;if(Xa(e))return NaN;if(Ha(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ha(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Dt(e);var l=le.test(e);return l||ie.test(e)?We(e.slice(2),l?2:8):te.test(e)?NaN:+e}function ir(e){return fi(e,hr(e))}function or(e){return null==e?"":Xn(e)}var ar=_i(function(e,t){if(so(t)||Pa(t))fi(t,_r(t),e);else for(var l in t)Te.call(t,l)&&Hl(e,l,t[l])}),rr=_i(function(e,t){fi(t,hr(t),e)}),dr=_i(function(e,t,l,n){fi(t,hr(t),e,n)}),ur=_i(function(e,t,l,n){fi(t,_r(t),e,n)}),sr=ji(Gl),cr=Mn(function(e,t){e=me(e);var l=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(n=1);++l<n;)for(var o=t[l],a=hr(o),r=-1,d=a.length;++r<d;){var u=a[r],s=e[u];(void 0===s||Ca(s,_e[u])&&!Te.call(e,u))&&(e[u]=o[u])}return e}),vr=Mn(function(e){return e.push(void 0,Wi),tt(Tr,void 0,e)});function mr(e,t,l){var n=null==e?void 0:sn(e,t);return void 0===n?l:n}function pr(e,t){return null!=e&&to(e,t,En)}var Er=Ci(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=l},Hr(zr)),fr=Ci(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),Te.call(e,t)?e[t].push(l):e[t]=[l]},Yi),gr=Mn(gn);function _r(e){return Pa(e)?Ml(e):bn(e)}function hr(e){return Pa(e)?Ml(e,!0):function(e){if(!Ha(e))return function(e){var t=[];if(null!=e)for(var l in me(e))t.push(l);return t}(e);var t=so(e),l=[];for(var n in e)("constructor"!=n||!t&&Te.call(e,n))&&l.push(n);return l}(e)}var yr=_i(function(e,t,l){An(e,t,l)}),Tr=_i(function(e,t,l,n){An(e,t,l,n)}),Sr=ji(function(e,t){var l={};if(null==e)return l;var n=!1;t=ut(t,function(t){return t=oi(t,e),n||(n=t.length>1),t}),fi(e,zi(e),l),n&&(l=Yl(l,7,Ui));for(var i=t.length;i--;)Zn(l,t[i]);return l}),br=ji(function(e,t){return null==e?{}:function(e,t){return wn(e,t,function(t,l){return pr(e,l)})}(e,t)});function Nr(e,t){if(null==e)return{};var l=ut(zi(e),function(e){return[e]});return t=Yi(t),wn(e,l,function(e,l){return t(e,l[0])})}var Ir=Mi(_r),Dr=Mi(hr);function Cr(e){return null==e?[]:At(e,_r(e))}var Ar=Si(function(e,t,l){return t=t.toLowerCase(),e+(l?xr(t):t)});function xr(e){return Fr(or(e).toLowerCase())}function Or(e){return(e=or(e))&&e.replace(ae,Pt).replace(Ae,"")}var wr=Si(function(e,t,l){return e+(l?"-":"")+t.toLowerCase()}),Lr=Si(function(e,t,l){return e+(l?" ":"")+t.toLowerCase()}),Pr=Ti("toLowerCase"),Rr=Si(function(e,t,l){return e+(l?"_":"")+t.toLowerCase()}),kr=Si(function(e,t,l){return e+(l?" ":"")+Fr(t)}),Mr=Si(function(e,t,l){return e+(l?" ":"")+t.toUpperCase()}),Fr=Ti("toUpperCase");function Br(e,t,l){return e=or(e),void 0===(t=l?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(Oe)||[]}(e):function(e){return e.match(Q)||[]}(e):e.match(t)||[]}var Wr=Mn(function(e,t){try{return tt(e,void 0,t)}catch(e){return Fa(e)?e:new se(e)}}),Ur=ji(function(e,t){return nt(t,function(t){t=No(t),Kl(e,t,fa(e[t],e))}),e});function Hr(e){return function(){return e}}var jr=Ii(),Vr=Ii(!0);function zr(e){return e}function Kr(e){return Sn("function"==typeof e?e:Yl(e,1))}var Gr=Mn(function(e,t){return function(l){return gn(l,e,t)}}),qr=Mn(function(e,t){return function(l){return gn(e,l,t)}});function Yr(e,t,l){var n=_r(t),i=un(t,n);null!=l||Ha(t)&&(i.length||!n.length)||(l=t,t=e,e=this,i=un(t,_r(t)));var o=!(Ha(l)&&"chain"in l&&!l.chain),a=Ba(e);return nt(i,function(l){var n=t[l];e[l]=n,a&&(e.prototype[l]=function(){var t=this.__chain__;if(o||t){var l=e(this.__wrapped__),i=l.__actions__=Ei(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),l.__chain__=t,l}return n.apply(e,st([this.value()],arguments))})}),e}function Xr(){}var Qr=xi(ut),Zr=xi(ot),Jr=xi(mt);function $r(e){return ao(e)?Tt(No(e)):function(e){return function(t){return sn(t,e)}}(e)}var ed=wi(),td=wi(!0);function ld(){return[]}function nd(){return!1}var id,od=Ai(function(e,t){return e+t},0),ad=Ri("ceil"),rd=Ai(function(e,t){return e/t},1),dd=Ri("floor"),ud=Ai(function(e,t){return e*t},1),sd=Ri("round"),cd=Ai(function(e,t){return e-t},0);return Dl.after=function(e,t){if("function"!=typeof t)throw new fe(l);return e=tr(e),function(){if(--e<1)return t.apply(this,arguments)}},Dl.ary=pa,Dl.assign=ar,Dl.assignIn=rr,Dl.assignInWith=dr,Dl.assignWith=ur,Dl.at=sr,Dl.before=Ea,Dl.bind=fa,Dl.bindAll=Ur,Dl.bindKey=ga,Dl.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return wa(e)?e:[e]},Dl.chain=$o,Dl.chunk=function(e,t,l){t=(l?oo(e,t,l):void 0===t)?1:il(tr(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var i=0,o=0,a=G(Zt(n/t));i<n;)a[o++]=Vn(e,i,i+=t);return a},Dl.compact=function(e){for(var t=-1,l=null==e?0:e.length,n=0,i=[];++t<l;){var o=e[t];o&&(i[n++]=o)}return i},Dl.concat=function(){var e=arguments.length;if(!e)return[];for(var t=G(e-1),l=arguments[0],n=e;n--;)t[n-1]=arguments[n];return st(wa(l)?Ei(l):[l],nn(t,1))},Dl.cond=function(e){var t=null==e?0:e.length,n=Yi();return e=t?ut(e,function(e){if("function"!=typeof e[1])throw new fe(l);return[n(e[0]),e[1]]}):[],Mn(function(l){for(var n=-1;++n<t;){var i=e[n];if(tt(i[0],this,l))return tt(i[1],this,l)}})},Dl.conforms=function(e){return function(e){var t=_r(e);return function(l){return Xl(l,e,t)}}(Yl(e,1))},Dl.constant=Hr,Dl.countBy=la,Dl.create=function(e,t){var l=Cl(e);return null==t?l:zl(l,t)},Dl.curry=function e(t,l,n){var i=Fi(t,8,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Dl.curryRight=function e(t,l,n){var i=Fi(t,16,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Dl.debounce=_a,Dl.defaults=cr,Dl.defaultsDeep=vr,Dl.defer=ha,Dl.delay=ya,Dl.difference=Co,Dl.differenceBy=Ao,Dl.differenceWith=xo,Dl.drop=function(e,t,l){var n=null==e?0:e.length;return n?Vn(e,(t=l||void 0===t?1:tr(t))<0?0:t,n):[]},Dl.dropRight=function(e,t,l){var n=null==e?0:e.length;return n?Vn(e,0,(t=n-(t=l||void 0===t?1:tr(t)))<0?0:t):[]},Dl.dropRightWhile=function(e,t){return e&&e.length?$n(e,Yi(t,3),!0,!0):[]},Dl.dropWhile=function(e,t){return e&&e.length?$n(e,Yi(t,3),!0):[]},Dl.fill=function(e,t,l,n){var i=null==e?0:e.length;return i?(l&&"number"!=typeof l&&oo(e,t,l)&&(l=0,n=i),function(e,t,l,n){var i=e.length;for((l=tr(l))<0&&(l=-l>i?0:i+l),(n=void 0===n||n>i?i:tr(n))<0&&(n+=i),n=l>n?0:lr(n);l<n;)e[l++]=t;return e}(e,t,l,n)):[]},Dl.filter=function(e,t){return(wa(e)?at:ln)(e,Yi(t,3))},Dl.flatMap=function(e,t){return nn(sa(e,t),1)},Dl.flatMapDeep=function(e,t){return nn(sa(e,t),1/0)},Dl.flatMapDepth=function(e,t,l){return l=void 0===l?1:tr(l),nn(sa(e,t),l)},Dl.flatten=Lo,Dl.flattenDeep=function(e){return null!=e&&e.length?nn(e,1/0):[]},Dl.flattenDepth=function(e,t){return null!=e&&e.length?nn(e,t=void 0===t?1:tr(t)):[]},Dl.flip=function(e){return Fi(e,512)},Dl.flow=jr,Dl.flowRight=Vr,Dl.fromPairs=function(e){for(var t=-1,l=null==e?0:e.length,n={};++t<l;){var i=e[t];Kl(n,i[0],i[1])}return n},Dl.functions=function(e){return null==e?[]:un(e,_r(e))},Dl.functionsIn=function(e){return null==e?[]:un(e,hr(e))},Dl.groupBy=ra,Dl.initial=function(e){return null!=e&&e.length?Vn(e,0,-1):[]},Dl.intersection=Ro,Dl.intersectionBy=ko,Dl.intersectionWith=Mo,Dl.invert=Er,Dl.invertBy=fr,Dl.invokeMap=da,Dl.iteratee=Kr,Dl.keyBy=ua,Dl.keys=_r,Dl.keysIn=hr,Dl.map=sa,Dl.mapKeys=function(e,t){var l={};return t=Yi(t,3),rn(e,function(e,n,i){Kl(l,t(e,n,i),e)}),l},Dl.mapValues=function(e,t){var l={};return t=Yi(t,3),rn(e,function(e,n,i){Kl(l,n,t(e,n,i))}),l},Dl.matches=function(e){return Dn(Yl(e,1))},Dl.matchesProperty=function(e,t){return Cn(e,Yl(t,1))},Dl.memoize=Ta,Dl.merge=yr,Dl.mergeWith=Tr,Dl.method=Gr,Dl.methodOf=qr,Dl.mixin=Yr,Dl.negate=Sa,Dl.nthArg=function(e){return e=tr(e),Mn(function(t){return xn(t,e)})},Dl.omit=Sr,Dl.omitBy=function(e,t){return Nr(e,Sa(Yi(t)))},Dl.once=function(e){return Ea(2,e)},Dl.orderBy=function(e,t,l,n){return null==e?[]:(wa(t)||(t=null==t?[]:[t]),wa(l=n?void 0:l)||(l=null==l?[]:[l]),On(e,t,l))},Dl.over=Qr,Dl.overArgs=ba,Dl.overEvery=Zr,Dl.overSome=Jr,Dl.partial=Na,Dl.partialRight=Ia,Dl.partition=ca,Dl.pick=br,Dl.pickBy=Nr,Dl.property=$r,Dl.propertyOf=function(e){return function(t){return null==e?void 0:sn(e,t)}},Dl.pull=Bo,Dl.pullAll=Wo,Dl.pullAllBy=function(e,t,l){return e&&e.length&&t&&t.length?Ln(e,t,Yi(l,2)):e},Dl.pullAllWith=function(e,t,l){return e&&e.length&&t&&t.length?Ln(e,t,void 0,l):e},Dl.pullAt=Uo,Dl.range=ed,Dl.rangeRight=td,Dl.rearg=Da,Dl.reject=function(e,t){return(wa(e)?at:ln)(e,Sa(Yi(t,3)))},Dl.remove=function(e,t){var l=[];if(!e||!e.length)return l;var n=-1,i=[],o=e.length;for(t=Yi(t,3);++n<o;){var a=e[n];t(a,n,e)&&(l.push(a),i.push(n))}return Pn(e,i),l},Dl.rest=function(e,t){if("function"!=typeof e)throw new fe(l);return Mn(e,t=void 0===t?t:tr(t))},Dl.reverse=Ho,Dl.sampleSize=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:tr(t),(wa(e)?Bl:Bn)(e,t)},Dl.set=function(e,t,l){return null==e?e:Wn(e,t,l)},Dl.setWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Wn(e,t,l,n)},Dl.shuffle=function(e){return(wa(e)?Wl:jn)(e)},Dl.slice=function(e,t,l){var n=null==e?0:e.length;return n?(l&&"number"!=typeof l&&oo(e,t,l)?(t=0,l=n):(t=null==t?0:tr(t),l=void 0===l?n:tr(l)),Vn(e,t,l)):[]},Dl.sortBy=va,Dl.sortedUniq=function(e){return e&&e.length?qn(e):[]},Dl.sortedUniqBy=function(e,t){return e&&e.length?qn(e,Yi(t,2)):[]},Dl.split=function(e,t,l){return l&&"number"!=typeof l&&oo(e,t,l)&&(t=l=void 0),(l=void 0===l?4294967295:l>>>0)?(e=or(e))&&("string"==typeof t||null!=t&&!Ga(t))&&!(t=Xn(t))&&Mt(e)?ri(Vt(e),0,l):e.split(t,l):[]},Dl.spread=function(e,t){if("function"!=typeof e)throw new fe(l);return t=null==t?0:il(tr(t),0),Mn(function(l){var n=l[t],i=ri(l,0,t);return n&&st(i,n),tt(e,this,i)})},Dl.tail=function(e){var t=null==e?0:e.length;return t?Vn(e,1,t):[]},Dl.take=function(e,t,l){return e&&e.length?Vn(e,0,(t=l||void 0===t?1:tr(t))<0?0:t):[]},Dl.takeRight=function(e,t,l){var n=null==e?0:e.length;return n?Vn(e,(t=n-(t=l||void 0===t?1:tr(t)))<0?0:t,n):[]},Dl.takeRightWhile=function(e,t){return e&&e.length?$n(e,Yi(t,3),!1,!0):[]},Dl.takeWhile=function(e,t){return e&&e.length?$n(e,Yi(t,3)):[]},Dl.tap=function(e,t){return t(e),e},Dl.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new fe(l);return Ha(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),_a(e,t,{leading:i,maxWait:t,trailing:o})},Dl.thru=ea,Dl.toArray=$a,Dl.toPairs=Ir,Dl.toPairsIn=Dr,Dl.toPath=function(e){return wa(e)?ut(e,No):Xa(e)?[e]:Ei(bo(or(e)))},Dl.toPlainObject=ir,Dl.transform=function(e,t,l){var n=wa(e),i=n||ka(e)||Qa(e);if(t=Yi(t,4),null==l){var o=e&&e.constructor;l=i?n?new o:[]:Ha(e)&&Ba(o)?Cl(Ve(e)):{}}return(i?nt:rn)(e,function(e,n,i){return t(l,e,n,i)}),l},Dl.unary=function(e){return pa(e,1)},Dl.union=jo,Dl.unionBy=Vo,Dl.unionWith=zo,Dl.uniq=function(e){return e&&e.length?Qn(e):[]},Dl.uniqBy=function(e,t){return e&&e.length?Qn(e,Yi(t,2)):[]},Dl.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Qn(e,void 0,t):[]},Dl.unset=function(e,t){return null==e||Zn(e,t)},Dl.unzip=Ko,Dl.unzipWith=Go,Dl.update=function(e,t,l){return null==e?e:Jn(e,t,ii(l))},Dl.updateWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Jn(e,t,ii(l),n)},Dl.values=Cr,Dl.valuesIn=function(e){return null==e?[]:At(e,hr(e))},Dl.without=qo,Dl.words=Br,Dl.wrap=function(e,t){return Na(ii(t),e)},Dl.xor=Yo,Dl.xorBy=Xo,Dl.xorWith=Qo,Dl.zip=Zo,Dl.zipObject=function(e,t){return li(e||[],t||[],Hl)},Dl.zipObjectDeep=function(e,t){return li(e||[],t||[],Wn)},Dl.zipWith=Jo,Dl.entries=Ir,Dl.entriesIn=Dr,Dl.extend=rr,Dl.extendWith=dr,Yr(Dl,Dl),Dl.add=od,Dl.attempt=Wr,Dl.camelCase=Ar,Dl.capitalize=xr,Dl.ceil=ad,Dl.clamp=function(e,t,l){return void 0===l&&(l=t,t=void 0),void 0!==l&&(l=(l=nr(l))==l?l:0),void 0!==t&&(t=(t=nr(t))==t?t:0),ql(nr(e),t,l)},Dl.clone=function(e){return Yl(e,4)},Dl.cloneDeep=function(e){return Yl(e,5)},Dl.cloneDeepWith=function(e,t){return Yl(e,5,t="function"==typeof t?t:void 0)},Dl.cloneWith=function(e,t){return Yl(e,4,t="function"==typeof t?t:void 0)},Dl.conformsTo=function(e,t){return null==t||Xl(e,t,_r(t))},Dl.deburr=Or,Dl.defaultTo=function(e,t){return null==e||e!=e?t:e},Dl.divide=rd,Dl.endsWith=function(e,t,l){e=or(e),t=Xn(t);var n=e.length,i=l=void 0===l?n:ql(tr(l),0,n);return(l-=t.length)>=0&&e.slice(l,i)==t},Dl.eq=Ca,Dl.escape=function(e){return(e=or(e))&&M.test(e)?e.replace(R,Rt):e},Dl.escapeRegExp=function(e){return(e=or(e))&&z.test(e)?e.replace(V,"\\$&"):e},Dl.every=function(e,t,l){var n=wa(e)?ot:en;return l&&oo(e,t,l)&&(t=void 0),n(e,Yi(t,3))},Dl.find=na,Dl.findIndex=Oo,Dl.findKey=function(e,t){return Et(e,Yi(t,3),rn)},Dl.findLast=ia,Dl.findLastIndex=wo,Dl.findLastKey=function(e,t){return Et(e,Yi(t,3),dn)},Dl.floor=dd,Dl.forEach=oa,Dl.forEachRight=aa,Dl.forIn=function(e,t){return null==e?e:on(e,Yi(t,3),hr)},Dl.forInRight=function(e,t){return null==e?e:an(e,Yi(t,3),hr)},Dl.forOwn=function(e,t){return e&&rn(e,Yi(t,3))},Dl.forOwnRight=function(e,t){return e&&dn(e,Yi(t,3))},Dl.get=mr,Dl.gt=Aa,Dl.gte=xa,Dl.has=function(e,t){return null!=e&&to(e,t,pn)},Dl.hasIn=pr,Dl.head=Po,Dl.identity=zr,Dl.includes=function(e,t,l,n){e=Pa(e)?e:Cr(e),l=l&&!n?tr(l):0;var i=e.length;return l<0&&(l=il(i+l,0)),Ya(e)?l<=i&&e.indexOf(t,l)>-1:!!i&&gt(e,t,l)>-1},Dl.indexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:tr(l);return i<0&&(i=il(n+i,0)),gt(e,t,i)},Dl.inRange=function(e,t,l){return t=er(t),void 0===l?(l=t,t=0):l=er(l),function(e,t,l){return e>=ol(t,l)&&e<il(t,l)}(e=nr(e),t,l)},Dl.invoke=gr,Dl.isArguments=Oa,Dl.isArray=wa,Dl.isArrayBuffer=La,Dl.isArrayLike=Pa,Dl.isArrayLikeObject=Ra,Dl.isBoolean=function(e){return!0===e||!1===e||ja(e)&&vn(e)==r},Dl.isBuffer=ka,Dl.isDate=Ma,Dl.isElement=function(e){return ja(e)&&1===e.nodeType&&!Ka(e)},Dl.isEmpty=function(e){if(null==e)return!0;if(Pa(e)&&(wa(e)||"string"==typeof e||"function"==typeof e.splice||ka(e)||Qa(e)||Oa(e)))return!e.length;var t=eo(e);if(t==v||t==f)return!e.size;if(so(e))return!bn(e).length;for(var l in e)if(Te.call(e,l))return!1;return!0},Dl.isEqual=function(e,t){return hn(e,t)},Dl.isEqualWith=function(e,t,l){var n=(l="function"==typeof l?l:void 0)?l(e,t):void 0;return void 0===n?hn(e,t,void 0,l):!!n},Dl.isError=Fa,Dl.isFinite=function(e){return"number"==typeof e&&tl(e)},Dl.isFunction=Ba,Dl.isInteger=Wa,Dl.isLength=Ua,Dl.isMap=Va,Dl.isMatch=function(e,t){return e===t||yn(e,t,Qi(t))},Dl.isMatchWith=function(e,t,l){return l="function"==typeof l?l:void 0,yn(e,t,Qi(t),l)},Dl.isNaN=function(e){return za(e)&&e!=+e},Dl.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Tn(e)},Dl.isNil=function(e){return null==e},Dl.isNull=function(e){return null===e},Dl.isNumber=za,Dl.isObject=Ha,Dl.isObjectLike=ja,Dl.isPlainObject=Ka,Dl.isRegExp=Ga,Dl.isSafeInteger=function(e){return Wa(e)&&e>=-9007199254740991&&e<=9007199254740991},Dl.isSet=qa,Dl.isString=Ya,Dl.isSymbol=Xa,Dl.isTypedArray=Qa,Dl.isUndefined=function(e){return void 0===e},Dl.isWeakMap=function(e){return ja(e)&&eo(e)==h},Dl.isWeakSet=function(e){return ja(e)&&"[object WeakSet]"==vn(e)},Dl.join=function(e,t){return null==e?"":ll.call(e,t)},Dl.kebabCase=wr,Dl.last=Fo,Dl.lastIndexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n;return void 0!==l&&(i=(i=tr(l))<0?il(n+i,0):ol(i,n-1)),t==t?function(e,t,l){for(var n=l+1;n--;)if(e[n]===t)return n;return n}(e,t,i):ft(e,ht,i,!0)},Dl.lowerCase=Lr,Dl.lowerFirst=Pr,Dl.lt=Za,Dl.lte=Ja,Dl.max=function(e){return e&&e.length?tn(e,zr,mn):void 0},Dl.maxBy=function(e,t){return e&&e.length?tn(e,Yi(t,2),mn):void 0},Dl.mean=function(e){return yt(e,zr)},Dl.meanBy=function(e,t){return yt(e,Yi(t,2))},Dl.min=function(e){return e&&e.length?tn(e,zr,Nn):void 0},Dl.minBy=function(e,t){return e&&e.length?tn(e,Yi(t,2),Nn):void 0},Dl.stubArray=ld,Dl.stubFalse=nd,Dl.stubObject=function(){return{}},Dl.stubString=function(){return""},Dl.stubTrue=function(){return!0},Dl.multiply=ud,Dl.nth=function(e,t){return e&&e.length?xn(e,tr(t)):void 0},Dl.noConflict=function(){return je._===this&&(je._=De),this},Dl.noop=Xr,Dl.now=ma,Dl.pad=function(e,t,l){e=or(e);var n=(t=tr(t))?jt(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Oi(Jt(i),l)+e+Oi(Zt(i),l)},Dl.padEnd=function(e,t,l){e=or(e);var n=(t=tr(t))?jt(e):0;return t&&n<t?e+Oi(t-n,l):e},Dl.padStart=function(e,t,l){e=or(e);var n=(t=tr(t))?jt(e):0;return t&&n<t?Oi(t-n,l)+e:e},Dl.parseInt=function(e,t,l){return l||null==t?t=0:t&&(t=+t),rl(or(e).replace(K,""),t||0)},Dl.random=function(e,t,l){if(l&&"boolean"!=typeof l&&oo(e,t,l)&&(t=l=void 0),void 0===l&&("boolean"==typeof t?(l=t,t=void 0):"boolean"==typeof e&&(l=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=er(e),void 0===t?(t=e,e=0):t=er(t)),e>t){var n=e;e=t,t=n}if(l||e%1||t%1){var i=dl();return ol(e+i*(t-e+Be("1e-"+((i+"").length-1))),t)}return Rn(e,t)},Dl.reduce=function(e,t,l){var n=wa(e)?ct:bt,i=arguments.length<3;return n(e,Yi(t,4),l,i,Jl)},Dl.reduceRight=function(e,t,l){var n=wa(e)?vt:bt,i=arguments.length<3;return n(e,Yi(t,4),l,i,$l)},Dl.repeat=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:tr(t),kn(or(e),t)},Dl.replace=function(){var e=arguments,t=or(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dl.result=function(e,t,l){var n=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++n<i;){var o=null==e?void 0:e[No(t[n])];void 0===o&&(n=i,o=l),e=Ba(o)?o.call(e):o}return e},Dl.round=sd,Dl.runInContext=e,Dl.sample=function(e){return(wa(e)?Fl:Fn)(e)},Dl.size=function(e){if(null==e)return 0;if(Pa(e))return Ya(e)?jt(e):e.length;var t=eo(e);return t==v||t==f?e.size:bn(e).length},Dl.snakeCase=Rr,Dl.some=function(e,t,l){var n=wa(e)?mt:zn;return l&&oo(e,t,l)&&(t=void 0),n(e,Yi(t,3))},Dl.sortedIndex=function(e,t){return Kn(e,t)},Dl.sortedIndexBy=function(e,t,l){return Gn(e,t,Yi(l,2))},Dl.sortedIndexOf=function(e,t){var l=null==e?0:e.length;if(l){var n=Kn(e,t);if(n<l&&Ca(e[n],t))return n}return-1},Dl.sortedLastIndex=function(e,t){return Kn(e,t,!0)},Dl.sortedLastIndexBy=function(e,t,l){return Gn(e,t,Yi(l,2),!0)},Dl.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var l=Kn(e,t,!0)-1;if(Ca(e[l],t))return l}return-1},Dl.startCase=kr,Dl.startsWith=function(e,t,l){return e=or(e),l=null==l?0:ql(tr(l),0,e.length),t=Xn(t),e.slice(l,l+t.length)==t},Dl.subtract=cd,Dl.sum=function(e){return e&&e.length?Nt(e,zr):0},Dl.sumBy=function(e,t){return e&&e.length?Nt(e,Yi(t,2)):0},Dl.template=function(e,t,l){var n=Dl.templateSettings;l&&oo(e,t,l)&&(t=void 0),e=or(e),t=ur({},t,n,Bi);var i=ur({},t.imports,n.imports,Bi),o=_r(i),a=At(i,o);nt(o,function(e){if(Z.test(e))throw new se("Invalid `imports` option passed into `_.template`")});var r,d,u=0,s=t.interpolate||re,c="__p += '",v=pe((t.escape||re).source+"|"+s.source+"|"+(s===W?$:re).source+"|"+(t.evaluate||re).source+"|$","g"),m="//# sourceURL="+(Te.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Re+"]")+"\n";e.replace(v,function(t,l,n,i,o,a){return n||(n=i),c+=e.slice(u,a).replace(de,kt),l&&(r=!0,c+="' +\n__e("+l+") +\n'"),o&&(d=!0,c+="';\n"+o+";\n__p += '"),n&&(c+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=a+t.length,t}),c+="';\n";var p=Te.call(t,"variable")&&t.variable;if(p){if(Z.test(p))throw new se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(d?c.replace(O,""):c).replace(w,"$1").replace(L,"$1;"),c="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(d?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var E=Wr(function(){return ce(o,m+"return "+c).apply(void 0,a)});if(E.source=c,Fa(E))throw E;return E},Dl.times=function(e,t){if((e=tr(e))<1||e>9007199254740991)return[];var l=4294967295,n=ol(e,4294967295);e-=4294967295;for(var i=It(n,t=Yi(t));++l<e;)t(l);return i},Dl.toFinite=er,Dl.toInteger=tr,Dl.toLength=lr,Dl.toLower=function(e){return or(e).toLowerCase()},Dl.toNumber=nr,Dl.toSafeInteger=function(e){return e?ql(tr(e),-9007199254740991,9007199254740991):0===e?e:0},Dl.toString=or,Dl.toUpper=function(e){return or(e).toUpperCase()},Dl.trim=function(e,t,l){if((e=or(e))&&(l||void 0===t))return Dt(e);if(!e||!(t=Xn(t)))return e;var n=Vt(e),i=Vt(t);return ri(n,Ot(n,i),wt(n,i)+1).join("")},Dl.trimEnd=function(e,t,l){if((e=or(e))&&(l||void 0===t))return e.slice(0,zt(e)+1);if(!e||!(t=Xn(t)))return e;var n=Vt(e);return ri(n,0,wt(n,Vt(t))+1).join("")},Dl.trimStart=function(e,t,l){if((e=or(e))&&(l||void 0===t))return e.replace(K,"");if(!e||!(t=Xn(t)))return e;var n=Vt(e);return ri(n,Ot(n,Vt(t))).join("")},Dl.truncate=function(e,t){var l=30,n="...";if(Ha(t)){var i="separator"in t?t.separator:i;l="length"in t?tr(t.length):l,n="omission"in t?Xn(t.omission):n}var o=(e=or(e)).length;if(Mt(e)){var a=Vt(e);o=a.length}if(l>=o)return e;var r=l-jt(n);if(r<1)return n;var d=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return d+n;if(a&&(r+=d.length-r),Ga(i)){if(e.slice(r).search(i)){var u,s=d;for(i.global||(i=pe(i.source,or(ee.exec(i))+"g")),i.lastIndex=0;u=i.exec(s);)var c=u.index;d=d.slice(0,void 0===c?r:c)}}else if(e.indexOf(Xn(i),r)!=r){var v=d.lastIndexOf(i);v>-1&&(d=d.slice(0,v))}return d+n},Dl.unescape=function(e){return(e=or(e))&&k.test(e)?e.replace(P,Kt):e},Dl.uniqueId=function(e){var t=++Se;return or(e)+t},Dl.upperCase=Mr,Dl.upperFirst=Fr,Dl.each=oa,Dl.eachRight=aa,Dl.first=Po,Yr(Dl,(id={},rn(Dl,function(e,t){Te.call(Dl.prototype,t)||(id[t]=e)}),id),{chain:!1}),Dl.VERSION="4.18.1",nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Dl[e].placeholder=Dl}),nt(["drop","take"],function(e,t){Ol.prototype[e]=function(l){l=void 0===l?1:il(tr(l),0);var n=this.__filtered__&&!t?new Ol(this):this.clone();return n.__filtered__?n.__takeCount__=ol(l,n.__takeCount__):n.__views__.push({size:ol(l,4294967295),type:e+(n.__dir__<0?"Right":"")}),n},Ol.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),nt(["filter","map","takeWhile"],function(e,t){var l=t+1,n=1==l||3==l;Ol.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Yi(e,3),type:l}),t.__filtered__=t.__filtered__||n,t}}),nt(["head","last"],function(e,t){var l="take"+(t?"Right":"");Ol.prototype[e]=function(){return this[l](1).value()[0]}}),nt(["initial","tail"],function(e,t){var l="drop"+(t?"":"Right");Ol.prototype[e]=function(){return this.__filtered__?new Ol(this):this[l](1)}}),Ol.prototype.compact=function(){return this.filter(zr)},Ol.prototype.find=function(e){return this.filter(e).head()},Ol.prototype.findLast=function(e){return this.reverse().find(e)},Ol.prototype.invokeMap=Mn(function(e,t){return"function"==typeof e?new Ol(this):this.map(function(l){return gn(l,e,t)})}),Ol.prototype.reject=function(e){return this.filter(Sa(Yi(e)))},Ol.prototype.slice=function(e,t){e=tr(e);var l=this;return l.__filtered__&&(e>0||t<0)?new Ol(l):(e<0?l=l.takeRight(-e):e&&(l=l.drop(e)),void 0!==t&&(l=(t=tr(t))<0?l.dropRight(-t):l.take(t-e)),l)},Ol.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ol.prototype.toArray=function(){return this.take(4294967295)},rn(Ol.prototype,function(e,t){var l=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=Dl[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);i&&(Dl.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,r=t instanceof Ol,d=a[0],u=r||wa(t),s=function(e){var t=i.apply(Dl,st([e],a));return n&&c?t[0]:t};u&&l&&"function"==typeof d&&1!=d.length&&(r=u=!1);var c=this.__chain__,v=!!this.__actions__.length,m=o&&!c,p=r&&!v;if(!o&&u){t=p?t:new Ol(this);var E=e.apply(t,a);return E.__actions__.push({func:ea,args:[s],thisArg:void 0}),new xl(E,c)}return m&&p?e.apply(this,a):(E=this.thru(s),m?n?E.value()[0]:E.value():E)})}),nt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[e],l=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Dl.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(wa(i)?i:[],e)}return this[l](function(l){return t.apply(wa(l)?l:[],e)})}}),rn(Ol.prototype,function(e,t){var l=Dl[t];if(l){var n=l.name+"";Te.call(gl,n)||(gl[n]=[]),gl[n].push({name:t,func:l})}}),gl[Di(void 0,2).name]=[{name:"wrapper",func:void 0}],Ol.prototype.clone=function(){var e=new Ol(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Ol.prototype.reverse=function(){if(this.__filtered__){var e=new Ol(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ol.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,l=wa(e),n=t<0,i=l?e.length:0,o=function(e,t,l){for(var n=-1,i=l.length;++n<i;){var o=l[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=ol(t,e+a);break;case"takeRight":e=il(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,d=r-a,u=n?r:a-1,s=this.__iteratees__,c=s.length,v=0,m=ol(d,this.__takeCount__);if(!l||!n&&i==d&&m==d)return ei(e,this.__actions__);var p=[];e:for(;d--&&v<m;){for(var E=-1,f=e[u+=t];++E<c;){var g=s[E],_=g.type,h=(0,g.iteratee)(f);if(2==_)f=h;else if(!h){if(1==_)continue e;break e}}p[v++]=f}return p},Dl.prototype.at=ta,Dl.prototype.chain=function(){return $o(this)},Dl.prototype.commit=function(){return new xl(this.value(),this.__chain__)},Dl.prototype.next=function(){void 0===this.__values__&&(this.__values__=$a(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Dl.prototype.plant=function(e){for(var t,l=this;l instanceof Al;){var n=Do(l);n.__index__=0,n.__values__=void 0,t?i.__wrapped__=n:t=n;var i=n;l=l.__wrapped__}return i.__wrapped__=e,t},Dl.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ol){var t=e;return this.__actions__.length&&(t=new Ol(this)),(t=t.reverse()).__actions__.push({func:ea,args:[Ho],thisArg:void 0}),new xl(t,this.__chain__)}return this.thru(Ho)},Dl.prototype.toJSON=Dl.prototype.valueOf=Dl.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Dl.prototype.first=Dl.prototype.head,pt&&(Dl.prototype[pt]=function(){return this}),Dl}();ze?((ze.exports=Gt)._=Gt,Ve._=Gt):je._=Gt}).call(Xe)});const jt=e=>{var l,o,a;let r=e.data,d=e.OpenImage;const u=i.useTranslation().t;return n.createElement("div",null,r.date&&n.createElement("p",null,r.date),n.createElement("p",null,r.name),r.mobileNumber&&n.createElement(t.TelePhone,{mobile:r.mobileNumber}),r.source&&n.createElement("p",null,u("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),null!=r&&r.wfComment?n.createElement("div",null,null==r||null===(l=r.wfComment)||void 0===l?void 0:l.map(e=>n.createElement("div",{className:"TLComments"},n.createElement("h3",null,u("WF_COMMON_COMMENTS")),n.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(o=r.thumbnailsToShow)||void 0===o||null===(a=o.thumbs)||void 0===a?void 0:a.length)>0?n.createElement("div",{className:"TLComments"},n.createElement("h3",null,u("CS_COMMON_ATTACHMENTS")),n.createElement(t.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:()=>{d(null==r?void 0:r.thumbnailsToShow)}})):null)},Vt=e=>{var a,r,d,u,s,c;let v=null==e||null===(a=e.application)||void 0===a?void 0:a.bookingNo.split("-")[0];const m=i.useTranslation().t,p="WT"===v?"request-service.water_tanker":"MT"===v?"request-service.mobile_toilet":"TP"===v?"request-service.tree_pruning":"request-service.unknown",E=Digit.Hooks.useWorkflowDetails({tenantId:null===(r=e.application)||void 0===r?void 0:r.tenantId,id:null===(d=e.application)||void 0===d?void 0:d.bookingNo,moduleCode:"WT"==v?"watertanker":"MT"===v?"mobileToilet":"TP"===v?"treePruning":"unknown"}),f=E.isLoading,g=E.data;function _(e){var t;window.open(null==e||null===(t=e.fullImage)||void 0===t?void 0:t[0],"_blank")}const h=t=>{if("OPEN"===t.state){var l,i;const o={date:null==t||null===(l=t.auditDetails)||void 0===l?void 0:l.lastModified,source:(null===(i=e.application)||void 0===i?void 0:i.channel)||""};return n.createElement(jt,{data:o})}if(t.state){var o,a,r,d,u;const e={date:null==t||null===(o=t.auditDetails)||void 0===o?void 0:o.lastModified,name:null==t||null===(a=t.assignes)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.name,mobileNumber:null==t||null===(d=t.assignes)||void 0===d||null===(u=d[0])||void 0===u?void 0:u.mobileNumber,comment:m(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return n.createElement(jt,{data:e,OpenImage:_})}{var s,c;const l={date:Digit.DateUtils.ConvertTimestampToDate(null===(s=e.application)||void 0===s?void 0:s.auditDetails.lastModified),name:null==t||null===(c=t.assigner)||void 0===c?void 0:c.name,comment:m(null==t?void 0:t.comment)};return n.createElement(jt,{data:l})}};return f?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,!f&&n.createElement(l.Fragment,null,(null==g||null===(u=g.timeline)||void 0===u?void 0:u.length)>0&&n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},m("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=g&&g.timeline&&1===(null==g||null===(s=g.timeline)||void 0===s?void 0:s.length)?n.createElement(t.CheckPoint,{isCompleted:!0,label:m((null==g||null===(c=g.timeline[0])||void 0===c?void 0:c.state)&&""+g.timeline[0].state||"NA"),customChild:h(null==g?void 0:g.timeline[0])}):n.createElement(t.ConnectingCheckPoints,null,(null==g?void 0:g.timeline)&&(null==g?void 0:g.timeline.map((e,l)=>{var i;return n.createElement(n.Fragment,{key:l},n.createElement(t.CheckPoint,{keyValue:l,isCompleted:0===l,label:m(""+(null==g||null===(i=g.processInstances[l].state)||void 0===i?void 0:i.state)),customChild:h(e)}))})))),g&&(l=>{var i,a;let r=l[0];switch(null==r?void 0:r.action){case"PAY":return"citizen"===(null==e?void 0:e.userType)?n.createElement("div",{style:{marginTop:"1em",bottom:"0px",width:"100%",marginBottom:"1.2em"}},n.createElement(o.Link,{to:{pathname:"/digit-ui/citizen/payment/my-bills/"+p+"/"+(null==e||null===(i=e.application)||void 0===i?void 0:i.bookingNo),state:{tenantId:e.application.tenantId,bookingNo:null==e||null===(a=e.application)||void 0===a?void 0:a.bookingNo}}},n.createElement(t.SubmitBar,{label:m("CS_APPLICATION_DETAILS_MAKE_PAYMENT")}))):null;default:return null}})(null==g?void 0:g.nextActions))},zt=["tenantId","payments"],Kt=e=>n.createElement("span",{className:"cell-text"},e),Gt=e=>{const t=(e=>{var t,l,n,i;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.auditDetails)||void 0===l?void 0:l.createdTime)||(null==e||null===(n=e.workflowData)||void 0===n||null===(i=n.auditDetails)||void 0===i?void 0:i.createdTime)})(e);return t?Digit.DateUtils.ConvertEpochToDate(t)+" "+Digit.DateUtils.ConvertEpochToTimeInHours(t):""},qt=e=>{var t;const l=null==e||null===(t=e.searchData)||void 0===t?void 0:t.driverTripReport;if(Array.isArray(l)&&l.length>0){var n,i;const e=null===(n=l[0])||void 0===n||null===(i=n.auditDetails)||void 0===i?void 0:i.lastModifiedTime;if(e)return Digit.DateUtils.ConvertEpochToDate(e)+" "+Digit.DateUtils.ConvertEpochToTimeInHours(e)}return"-"},Yt=e=>n.createElement("span",{className:"sla-cell"},e),Xt=(e,t,l)=>e?l((t||Digit.ULBService.getCurrentTenantId()||"djb").replace(".","_").toUpperCase()+"_REVENUE_"+e):"",Qt=e=>{var t;return(null==e||null===(t=e.vendor)||void 0===t?void 0:t.name)||(null==e?void 0:e.vendorName)||"-"},Zt=e=>{var t,l;const n=(null==e?void 0:e.vehicle)||(null==e||null===(t=e.vendor)||void 0===t||null===(l=t.vehicles)||void 0===l?void 0:l.find(t=>(null==t?void 0:t.id)===(null==e?void 0:e.vehicleId)));return(null==n?void 0:n.registrationNumber)||(null==n?void 0:n.name)||(null==n?void 0:n.type)||(null==e?void 0:e.vehicleName)||(null==e?void 0:e.vehicleRegistrationNo)||"-"},Jt=e=>{var t,l,n;const i=(null==e?void 0:e.driver)||(null==e||null===(t=e.vendor)||void 0===t||null===(l=t.drivers)||void 0===l?void 0:l.find(t=>{var l;return(null==t?void 0:t.id)===(null==e?void 0:e.driverId)||(null==t?void 0:t.ownerId)===(null==e?void 0:e.driverId)||(null==t||null===(l=t.owner)||void 0===l?void 0:l.uuid)===(null==e?void 0:e.driverId)}));return(null==i?void 0:i.name)||(null==i||null===(n=i.owner)||void 0===n?void 0:n.name)||(null==e?void 0:e.driverName)||"-"},$t=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],el=e=>{var o;let r=e.searchParams,d=e.onFilterChange,u=e.defaultSearchParams,s=e.moduleCode,m=v(e,$t);const p=i.useTranslation().t,E=(a.useQueryClient(),l.useState(()=>c({},r,{services:[]}))),f=E[0],g=E[1];l.useEffect(()=>{g(c({},r,{services:(null==r?void 0:r.services)||[]}))},[r]);const _="TP"===s?[{i18nKey:"TP_BOOKING_CREATED",code:"BOOKING_CREATED",value:p("TP_BOOKING_CREATED"),uuid:"BOOKING_CREATED"},{i18nKey:"TP_PENDING_FOR_APPROVAL",code:"PENDING_FOR_APPROVAL",value:p("TP_PENDING_FOR_APPROVAL"),uuid:"PENDING_FOR_APPROVAL"},{i18nKey:"TP_PAYMENT_PENDING",code:"PAYMENT_PENDING",value:p("TP_PAYMENT_PENDING"),uuid:"PAYMENT_PENDING"},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_VERIFICATION",code:"TEAM_ASSIGNMENT_FOR_VERIFICATION",value:p("TP_TEAM_ASSIGNMENT_FOR_VERIFICATION"),uuid:"TEAM_ASSIGNMENT_FOR_VERIFICATION"},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_EXECUTION",code:"TEAM_ASSIGNMENT_FOR_EXECUTION",value:p("TP_TEAM_ASSIGNMENT_FOR_EXECUTION"),uuid:"TEAM_ASSIGNMENT_FOR_EXECUTION"},{i18nKey:"TP_TREE_PRUNING_SERVICE_COMPLETED",code:"TREE_PRUNING_SERVICE_COMPLETED",value:p("TP_TREE_PRUNING_SERVICE_COMPLETED"),uuid:"TREE_PRUNING_SERVICE_COMPLETED"}]:[{i18nKey:"WT_SCHEDULED",code:"SCHEDULED",value:p("WT_SCHEDULED"),uuid:"SCHEDULED"},{i18nKey:"WT_IN_TRANSIT",code:"IN_TRANSIT",value:p("WT_IN_TRANSIT"),uuid:"IN_TRANSIT"},{i18nKey:"WT_TANKER_DELIVERED",code:"TANKER_DELIVERED",value:p("WT_TANKER_DELIVERED"),uuid:"TANKER_DELIVERED"},{i18nKey:"WT_MISSED",code:"MISSED",value:p("WT_MISSED"),uuid:"MISSED"},{i18nKey:"WT_CANCELLED",code:"CANCELLED",value:p("WT_CANCELLED"),uuid:"CANCELLED"}],h=e=>{let t=e.delete,l=c({},f,e);t&&t.forEach(e=>delete l[e]),delete e.delete,g(c({},l))},y=()=>{const e=c({},u,{services:(null==u?void 0:u.services)||(null==r?void 0:r.services)||[],status:null,applicationStatus:null,fromDate:"",toDate:"",fillingPointId:null,fillingPoint:null});g(e),d(e)};return Digit.ULBService.getCurrentTenantId(),n.createElement(n.Fragment,null,n.createElement("div",{className:"filter-card"},n.createElement("div",{className:"heading",style:{alignItems:"center"}},n.createElement("div",{className:"filter-label",style:{display:"flex",alignItems:"center"}},n.createElement("span",null,n.createElement("svg",{width:"17",height:"17",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M0.66666 2.48016C3.35999 5.9335 8.33333 12.3335 8.33333 12.3335V20.3335C8.33333 21.0668 8.93333 21.6668 9.66666 21.6668H12.3333C13.0667 21.6668 13.6667 21.0668 13.6667 20.3335V12.3335C13.6667 12.3335 18.6267 5.9335 21.32 2.48016C22 1.60016 21.3733 0.333496 20.2667 0.333496H1.71999C0.613327 0.333496 -0.01334 1.60016 0.66666 2.48016Z",fill:"#505A5F"}))),n.createElement("span",{style:{marginLeft:"8px",fontWeight:"normal"}},p("ES_COMMON_FILTER_BY"),":")),n.createElement("div",{className:"clearAll",onClick:y,style:{cursor:"pointer"}},p("ES_COMMON_CLEAR_ALL")),"desktop"===m.type&&n.createElement("span",{className:"clear-search",onClick:y,style:{border:"1px solid #e0e0e0",padding:"6px",minWidth:"fit-content",cursor:"pointer"}},n.createElement("svg",{width:"17",height:"17",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M8 5V8L12 4L8 0V3C3.58 3 0 6.58 0 11C0 12.57 0.46 14.03 1.24 15.26L2.7 13.8C2.25 12.97 2 12.01 2 11C2 7.69 4.69 5 8 5ZM14.76 6.74L13.3 8.2C13.74 9.04 14 9.99 14 11C14 14.31 11.31 17 8 17V14L4 18L8 22V19C12.42 19 16 15.42 16 11C16 9.43 15.54 7.97 14.76 6.74Z",fill:"#505A5F"}))),"mobile"===m.type&&n.createElement("span",{onClick:m.onClose,style:{cursor:"pointer"}},n.createElement(t.CloseSvg,null))),n.createElement("div",{id:"filter-form",className:"filter-form"},n.createElement("div",{className:"filter-form-field"},n.createElement("div",{className:"search-field-wrapper"},n.createElement("label",null,p("PT_COMMON_TABLE_COL_STATUS_LABEL")),n.createElement(t.Dropdown,{selected:null==f?void 0:f.status,select:e=>h({status:e,applicationStatus:e?[e]:null}),option:_,optionKey:"i18nKey",t:p})),n.createElement("div",{className:"search-field-wrapper",style:{marginTop:"16px"}},n.createElement("label",null,p("FROM_DATE")),n.createElement(t.DatePicker,{date:"number"==typeof(null==f?void 0:f.fromDate)?(()=>{const e=new Date(f.fromDate);return e.getFullYear()+"-"+String(e.getMonth()+1).padStart(2,"0")+"-"+String(e.getDate()).padStart(2,"0")})():null==f?void 0:f.fromDate,onChange:e=>{if(e){const t=e.split("-"),l=new Date(t[0],t[1]-1,t[2]);l.setHours(0,0,0,0),h({fromDate:l.getTime()})}else h({fromDate:""})},max:(new Date).toISOString().split("T")[0]})),n.createElement("div",{className:"search-field-wrapper",style:{marginTop:"16px"}},n.createElement("label",null,p("TO_DATE")),n.createElement(t.DatePicker,{date:"number"==typeof(null==f?void 0:f.toDate)?(()=>{const e=new Date(f.toDate);return e.getFullYear()+"-"+String(e.getMonth()+1).padStart(2,"0")+"-"+String(e.getDate()).padStart(2,"0")})():null==f?void 0:f.toDate,onChange:e=>{if(e){const t=e.split("-"),l=new Date(t[0],t[1]-1,t[2]);l.setHours(23,59,59,999),h({toDate:l.getTime()})}else h({toDate:""})},max:(new Date).toISOString().split("T")[0]})),n.createElement("div",{className:"tag-container hide-x-scrollbar"},null==f||null===(o=f.locality)||void 0===o?void 0:o.map((e,l)=>n.createElement(t.RemoveableTag,{key:l,text:p(e.i18nkey),onClick:()=>{const t=null==f?void 0:f.locality.filter(t=>t.code!==e.code);h({locality:t}),d(c({},f,{locality:t}))}})))),n.createElement("div",null,n.createElement(t.SubmitBar,{className:"w-fullwidth",onSubmit:()=>{var e;0===(null===(e=f.services)||void 0===e?void 0:e.length)&&null!=u&&u.services?d(c({},f,{services:u.services})):d(f)},label:p("ES_COMMON_APPLY")})))))},tl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ll=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(tl,null)),nl=e=>null==e?"":String(e),il=function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];return t.find(e=>null!=e&&""!==e)},ol=function(e,t){return void 0===t&&(t=[]),t.map(nl).filter(Boolean).some(t=>nl(e)===t)},al=e=>{var i,o,a,r,d,u,s,v,m,p,E,f,g,_,h,y,T,S,b,N,I,D,C;let A=e.t,x=e.applicationData,O=e.closeModal;console.log("Application Data in Edit Modal:",x);const w=Digit.ULBService.getCurrentTenantId(),L=Digit.ULBService.getStateId(),P=l.useState({owner:{},address:{},requestDetails:{},dispatchDetails:{}}),R=P[0],k=P[1],M=Digit.Hooks.fsm.useVendorSearch({tenantId:w,filters:c({},il(null==R||null===(i=R.dispatchDetails)||void 0===i||null===(o=i.fillingPoint)||void 0===o?void 0:o.id,null==R||null===(a=R.dispatchDetails)||void 0===a||null===(r=a.fillingPoint)||void 0===r?void 0:r.fillingPointId,null==R||null===(d=R.dispatchDetails)||void 0===d||null===(u=d.fillingPoint)||void 0===u?void 0:u.bookingId)?{fillingPointId:il(null==R||null===(s=R.dispatchDetails)||void 0===s||null===(v=s.fillingPoint)||void 0===v?void 0:v.id,null==R||null===(m=R.dispatchDetails)||void 0===m||null===(p=m.fillingPoint)||void 0===p?void 0:p.fillingPointId,null==R||null===(E=R.dispatchDetails)||void 0===E||null===(f=E.fillingPoint)||void 0===f?void 0:f.bookingId)}:{}),config:{enabled:!!il(null==R||null===(g=R.dispatchDetails)||void 0===g||null===(_=g.fillingPoint)||void 0===_?void 0:_.id,null==R||null===(h=R.dispatchDetails)||void 0===h||null===(y=h.fillingPoint)||void 0===y?void 0:y.fillingPointId,null==R||null===(T=R.dispatchDetails)||void 0===T||null===(S=T.fillingPoint)||void 0===S?void 0:S.bookingId,null==x?void 0:x.fillingPointId)}}).data,F=Digit.Hooks.useCustomMDMS(L,"request-service",[{name:"VehicleType"}],{select:e=>{var t;return(null==e||null===(t=e["request-service"])||void 0===t?void 0:t.VehicleType)||[]}}).data,B=Digit.Hooks.useCustomMDMS(L,"request-service",[{name:"TankerType"}],{select:e=>{var t;return(null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerType)||[]}}).data,W=Digit.Hooks.useCustomMDMS(L,"request-service",[{name:"TankerQuantity"}],{select:e=>{var t;return(null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerQuantity)||[]}}).data,U=Digit.Hooks.useCustomMDMS(L,"Request-service",[{name:"WaterType"}],{select:e=>{var t;return(null==e||null===(t=e["Request-service"])||void 0===t?void 0:t.WaterType)||[]}}).data,H=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:w,filters:{limit:1e3}},{enabled:!0}).data,j=Digit.Hooks.wt.useFillPointSearch({tenantId:w,filters:{limit:1e3}},{enabled:!0}).data,V=Digit.Hooks.wt.useUpdateEmergencyBooking(w);l.useEffect(()=>{if(x){var e,t,l,n,i,o,a,r,d,u,s,v,m,p,E,f,g,_,h,y,T,S,b,N,I,D,C;const A=(null==B?void 0:B.find(e=>ol(e.code,[x.tankerType])))||{code:x.tankerType,i18nKey:x.tankerType},O=((null==W?void 0:W.map(e=>({i18nKey:""+e.code,code:""+e.code,value:""+e.code})))||[]).find(e=>ol(e.code,[x.tankerQuantity]))||{code:""+((null==x?void 0:x.tankerQuantity)||""),i18nKey:""+((null==x?void 0:x.tankerQuantity)||""),value:""+((null==x?void 0:x.tankerQuantity)||"")},w=(null==U?void 0:U.find(e=>ol(e.code,[x.waterType])))||{code:x.waterType,i18nKey:x.waterType},L=(null==H||null===(e=H.waterTankerBookingDetail)||void 0===e?void 0:e.find(e=>{var t,l,n,i;return ol(il(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.fixedPointId,null==e?void 0:e.fixedPointId,null==e?void 0:e.fixedPointCode,null==e?void 0:e.id,null==e?void 0:e.bookingId,null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.applicantId),[null==x||null===(n=x.applicantDetail)||void 0===n?void 0:n.fixedPointId,null==x?void 0:x.fixedPointId,null==x?void 0:x.fixedPointCode,null==x?void 0:x.applicantId,null==x||null===(i=x.applicantDetail)||void 0===i?void 0:i.applicantId,null==x?void 0:x.bookingId])}))||null,P=(null==H||null===(t=H.waterTankerBookingDetail)||void 0===t?void 0:t.find(e=>{var t,l,n,i;return ol(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.applicantId,[null==x||null===(l=x.applicantDetail)||void 0===l?void 0:l.applicantId,null==x?void 0:x.applicantId])||ol(null==e||null===(n=e.applicantDetail)||void 0===n?void 0:n.mobileNumber,[null==x||null===(i=x.applicantDetail)||void 0===i?void 0:i.mobileNumber])}))||null,R=L||P||"",V=(null==j||null===(l=j.fillingPoints)||void 0===l?void 0:l.find(e=>ol(il(null==e?void 0:e.id,null==e?void 0:e.fillingPointId,null==e?void 0:e.bookingId),[null==x?void 0:x.fillingPointId,null==x?void 0:x.fillingpointId])))||{},z=((null==M?void 0:M.vendor)||[]).find(e=>{var t,l,n;return ol(il(null==e?void 0:e.id,null==e?void 0:e.code,null==e?void 0:e.vendor_id),[null==x?void 0:x.vendorId,null==x||null===(t=x.vendorDetail)||void 0===t?void 0:t.id,null==x||null===(l=x.vendorDetail)||void 0===l?void 0:l.code,null==x||null===(n=x.vendorDetail)||void 0===n?void 0:n.vendor_id])})||(null==x?void 0:x.vendorDetail)||"",K=z?c({},z,{name:(null==z?void 0:z.name)||(null==z?void 0:z.vendor_id)||"NA"}):"",G=(null==K||null===(n=K.vehicles)||void 0===n?void 0:n.find(e=>{var t,l,n;return ol(il(null==e?void 0:e.id,null==e?void 0:e.registrationNumber,null==e?void 0:e.code),[null==x?void 0:x.vehicleId,null==x||null===(t=x.vehicleDetail)||void 0===t?void 0:t.id,null==x||null===(l=x.vehicleDetail)||void 0===l?void 0:l.registrationNumber,null==x||null===(n=x.vehicleDetail)||void 0===n?void 0:n.code])}))||(null==x?void 0:x.vehicleDetail)||"",q=G?c({},G,{name:(null==G?void 0:G.registrationNumber)||(null==G?void 0:G.type)||"NA"}):"",Y=(null==K||null===(i=K.drivers)||void 0===i?void 0:i.find(e=>{var t,l,n,i;return ol(il(null==e?void 0:e.id,null==e?void 0:e.uuid,null==e?void 0:e.ownerId,null==e?void 0:e.licenseNumber),[null==x?void 0:x.driverId,null==x||null===(t=x.driverDetail)||void 0===t?void 0:t.id,null==x||null===(l=x.driverDetail)||void 0===l?void 0:l.uuid,null==x||null===(n=x.driverDetail)||void 0===n?void 0:n.ownerId,null==x||null===(i=x.driverDetail)||void 0===i?void 0:i.licenseNumber])}))||(null==x?void 0:x.driverDetail)||"",X=((null==F?void 0:F.filter(e=>{const t=e.vehicleType?e.vehicleType.toLowerCase():"";return t===(null!=A&&A.code?String(A.code).toLowerCase():"")||t.includes("tanker")}).map(e=>({i18nKey:""+e.capacityName,code:""+e.capacity,value:""+e.capacity,capacity:""+e.capacity})))||[]).find(e=>ol(e.code,[null==x?void 0:x.waterQuantity]))||{code:""+((null==x?void 0:x.waterQuantity)||""),value:""+((null==x?void 0:x.waterQuantity)||""),i18nKey:""+((null==x?void 0:x.waterQuantity)||"")};k({owner:{applicantName:(null==x||null===(o=x.applicantDetail)||void 0===o?void 0:o.name)||"",mobileNumber:(null==x||null===(a=x.applicantDetail)||void 0===a?void 0:a.mobileNumber)||"",alternateNumber:(null==x||null===(r=x.applicantDetail)||void 0===r?void 0:r.alternateNumber)||"",emailId:(null==x||null===(d=x.applicantDetail)||void 0===d?void 0:d.emailId)||"",fixedPoint:R?c({},R,{name:(null==R||null===(u=R.applicantDetail)||void 0===u?void 0:u.name)||(null==R||null===(s=R.applicantDetail)||void 0===s?void 0:s.fixedPointId)||"NA"}):"",applicantId:(null==x||null===(v=x.applicantDetail)||void 0===v?void 0:v.applicantId)||"",gender:(null==x||null===(m=x.applicantDetail)||void 0===m?void 0:m.gender)||null},address:{houseNo:(null==x||null===(p=x.address)||void 0===p?void 0:p.houseNo)||"",streetName:(null==x||null===(E=x.address)||void 0===E?void 0:E.streetName)||"",addressLine1:(null==x||null===(f=x.address)||void 0===f?void 0:f.addressLine1)||"",addressLine2:(null==x||null===(g=x.address)||void 0===g?void 0:g.addressLine2)||"",landmark:(null==x||null===(_=x.address)||void 0===_?void 0:_.landmark)||"",pincode:(null==x||null===(h=x.address)||void 0===h?void 0:h.pincode)||"",addressId:(null==x||null===(y=x.address)||void 0===y?void 0:y.addressId)||"",city:(null==x||null===(T=x.address)||void 0===T?void 0:T.city)||"Delhi",cityCode:(null==x||null===(S=x.address)||void 0===S?void 0:S.cityCode)||"DJB",locality:(null==x||null===(b=x.address)||void 0===b?void 0:b.locality)||"",localityCode:(null==x||null===(N=x.address)||void 0===N?void 0:N.localityCode)||"",ward:(null==x||null===(I=x.address)||void 0===I?void 0:I.ward)||"",zone:(null==x||null===(D=x.address)||void 0===D?void 0:D.zone)||"",constituency:(null==x||null===(C=x.address)||void 0===C?void 0:C.constituency)||""},requestDetails:{tankerType:A,waterType:w,tankerQuantity:O,waterQuantity:X,description:(null==x?void 0:x.description)||"",deliveryDate:(null==x?void 0:x.deliveryDate)||"",deliveryTime:(null==x?void 0:x.deliveryTime)||"",fileStoreId:(null==x?void 0:x.WTfileStoreId)||null,extraCharge:"Y"===(null==x?void 0:x.extraCharge)},dispatchDetails:{fillingPoint:c({},V,{id:il(null==V?void 0:V.id,null==V?void 0:V.fillingPointId,null==V?void 0:V.bookingId),name:(null==V?void 0:V.fillingPointName)||(null==V?void 0:V.name)||"NA"}),vendor:K,vehicle:q,driver:Y}})}},[x,B,W,U,H,j,F]);const z=(null==H||null===(b=H.waterTankerBookingDetail)||void 0===b?void 0:b.map(e=>{var t,l;return c({},e,{name:(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||(null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.fixedPointId)||"NA"})}))||[],K=(null==j||null===(N=j.fillingPoints)||void 0===N?void 0:N.map(e=>c({},e,{name:(null==e?void 0:e.fillingPointName)||"NA"})))||[],G=(null==M||null===(I=M.vendor)||void 0===I?void 0:I.map(e=>c({},e,{name:(null==e?void 0:e.name)||(null==e?void 0:e.vendor_id)||"NA"})))||[];let q=[],Y=[];var X,Q,Z,J;null!=R&&null!==(D=R.dispatchDetails)&&void 0!==D&&D.vendor&&"object"==typeof(null==R||null===(C=R.dispatchDetails)||void 0===C?void 0:C.vendor)&&(q=(null==R||null===(X=R.dispatchDetails)||void 0===X||null===(Q=X.vendor.vehicles)||void 0===Q?void 0:Q.map(e=>c({},e,{name:(null==e?void 0:e.registrationNumber)||(null==e?void 0:e.type)||"NA"})))||[],Y=(null==R||null===(Z=R.dispatchDetails)||void 0===Z||null===(J=Z.vendor.drivers)||void 0===J?void 0:J.map(e=>c({},e,{name:(null==e?void 0:e.name)||(null==e?void 0:e.licenseNumber)||"NA"})))||[]);const $=(null==U?void 0:U.map(e=>({i18nKey:""+e.code,code:""+e.code,value:""+e.code})))||[],ee=(null==B?void 0:B.map(e=>({i18nKey:""+e.i18nKey,code:""+e.code,value:""+e.value})))||[],te=(null==W?void 0:W.map(e=>({i18nKey:""+e.code,code:""+e.code,value:""+e.code})))||[],le=(null==F?void 0:F.filter(e=>{var t,l;const n=e.vehicleType?e.vehicleType.toLowerCase():"";return n===(null!=R&&null!==(t=R.requestDetails)&&void 0!==t&&null!==(l=t.tankerType)&&void 0!==l&&l.code?R.requestDetails.tankerType.code.toLowerCase():"")||n.includes("tanker")}).map(e=>({i18nKey:""+e.capacityName,code:""+e.capacity,value:""+e.capacity,capacity:""+e.capacity})))||[];return V.isLoading?n.createElement(t.Loader,null):n.createElement(t.Modal,{headerBarMain:n.createElement("h1",{className:"heading-m"},A("WT_EDIT_APPLICATION_DETAILS")),headerBarEnd:n.createElement(ll,{onClick:O}),actionCancelLabel:A("CS_COMMON_CANCEL"),actionCancelOnSubmit:O,actionSaveLabel:A("CS_COMMON_UPDATE"),actionSaveOnSubmit:()=>{const e=(e=>{var t,l,n,i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,h,y,T,S,b,N,I,D,C,A,x,O,w,L,P,R,k,M,F,B,W,U,H,j,V,z,K,G,q,Y,X,Q,Z,J,$,ee,te,le,ne,ie,oe,ae,re,de,ue,se,ce,ve,me,pe,Ee,fe,ge,_e,he,ye,Te,Se,be,Ne,Ie,De,Ce,Ae,xe,Oe,we,Le,Pe,Re,ke,Me,Fe,Be,We,Ue,He,je,Ve,ze,Ke,Ge,qe,Ye,Xe,Qe,Ze,Je,$e,et,tt,lt,nt;const it=null==e||null===(t=e.owner)||void 0===t?void 0:t.fixedPoint,ot=(null==it?void 0:it.applicantDetail)||{},at=(null==it?void 0:it.address)||{};return{waterTankerBookingDetail:{id:(null==e?void 0:e.id)||(null==e||null===(l=e.waterTankerBookingDetail)||void 0===l?void 0:l.id)||"",bookingNo:(null==e?void 0:e.bookingNo)||(null==e||null===(n=e.waterTankerBookingDetail)||void 0===n?void 0:n.bookingNo)||null,bookingId:(null==e?void 0:e.bookingId)||(null==e||null===(i=e.waterTankerBookingDetail)||void 0===i?void 0:i.bookingId)||"",applicantId:(null==ot?void 0:ot.applicantId)||(null==e||null===(o=e.owner)||void 0===o?void 0:o.applicantId)||(null==e?void 0:e.applicantId)||"",tenantId:null==e?void 0:e.tenantId,tankerType:null===(a=(null==e||null===(r=e.requestDetails)||void 0===r||null===(d=r.tankerType)||void 0===d?void 0:d.code)||(null==e||null===(u=e.requestDetails)||void 0===u?void 0:u.tankerType)||"")||void 0===a?void 0:a.toUpperCase(),waterType:(null==e||null===(s=e.requestDetails)||void 0===s||null===(c=s.waterType)||void 0===c?void 0:c.code)||(null==e||null===(v=e.requestDetails)||void 0===v?void 0:v.waterType),tankerQuantity:(null==e||null===(m=e.requestDetails)||void 0===m||null===(p=m.tankerQuantity)||void 0===p?void 0:p.code)||(null==e||null===(E=e.requestDetails)||void 0===E?void 0:E.tankerQuantity),waterQuantity:(null==e||null===(f=e.requestDetails)||void 0===f||null===(g=f.waterQuantity)||void 0===g?void 0:g.code)||(null==e||null===(_=e.requestDetails)||void 0===_||null===(h=_.waterQuantity)||void 0===h?void 0:h.value)||(null==e||null===(y=e.requestDetails)||void 0===y?void 0:y.waterQuantity),description:null==e||null===(T=e.requestDetails)||void 0===T?void 0:T.description,deliveryDate:null==e||null===(S=e.requestDetails)||void 0===S?void 0:S.deliveryDate,deliveryTime:null==e||null===(b=e.requestDetails)||void 0===b?void 0:b.deliveryTime,extraCharge:null!=e&&null!==(N=e.requestDetails)&&void 0!==N&&N.extraCharge?"Y":"N",addressDetailId:(null==at?void 0:at.addressId)||(null==e||null===(I=e.address)||void 0===I?void 0:I.addressDetailId)||(null==e?void 0:e.addressDetailId)||"",vendorId:(null==e||null===(D=e.dispatchDetails)||void 0===D||null===(C=D.vendor)||void 0===C?void 0:C.id)||(null==e||null===(A=e.owner)||void 0===A||null===(x=A.vendor)||void 0===x?void 0:x.id)||(null==e?void 0:e.vendorId)||"",vehicleId:(null==e||null===(O=e.dispatchDetails)||void 0===O||null===(w=O.vehicle)||void 0===w?void 0:w.id)||(null==e||null===(L=e.owner)||void 0===L||null===(P=L.vehicle)||void 0===P?void 0:P.id)||(null==e?void 0:e.vehicleId)||"",driverId:(null==e||null===(R=e.dispatchDetails)||void 0===R||null===(k=R.driver)||void 0===k||null===(M=k.owner)||void 0===M?void 0:M.uuid)||(null==e||null===(F=e.dispatchDetails)||void 0===F||null===(B=F.driver)||void 0===B?void 0:B.ownerId)||(null==e||null===(W=e.dispatchDetails)||void 0===W||null===(U=W.driver)||void 0===U?void 0:U.uuid)||(null==e||null===(H=e.dispatchDetails)||void 0===H||null===(j=H.driver)||void 0===j?void 0:j.id)||(null==e||null===(V=e.owner)||void 0===V||null===(z=V.driver)||void 0===z||null===(K=z.owner)||void 0===K?void 0:K.uuid)||(null==e||null===(G=e.owner)||void 0===G||null===(q=G.driver)||void 0===q?void 0:q.ownerId)||(null==e?void 0:e.driverId)||"",fillingPointId:(null==e||null===(Y=e.dispatchDetails)||void 0===Y||null===(X=Y.fillingPoint)||void 0===X?void 0:X.id)||(null==e||null===(Q=e.owner)||void 0===Q||null===(Z=Q.fillingPoint)||void 0===Z?void 0:Z.id)||(null==e?void 0:e.fillingPointId)||"",vehicleType:(null==e||null===(J=e.dispatchDetails)||void 0===J||null===($=J.vehicle)||void 0===$?void 0:$.vehicleType)||(null==e||null===(ee=e.owner)||void 0===ee||null===(te=ee.vehicle)||void 0===te?void 0:te.vehicleType)||(null==e?void 0:e.vehicleType)||"",vehicleCapacity:(null==e||null===(le=e.dispatchDetails)||void 0===le||null===(ne=le.vehicle)||void 0===ne?void 0:ne.capacity)||(null==e||null===(ie=e.owner)||void 0===ie||null===(oe=ie.vehicle)||void 0===oe?void 0:oe.capacity)||(null==e?void 0:e.vehicleCapacity)||"",applicantDetail:{applicantId:(null==ot?void 0:ot.applicantId)||(null==e||null===(ae=e.owner)||void 0===ae?void 0:ae.applicantId)||(null==e||null===(re=e.applicantDetail)||void 0===re?void 0:re.applicantId)||"",bookingId:(null==ot?void 0:ot.bookingId)||(null==e||null===(de=e.applicantDetail)||void 0===de?void 0:de.bookingId)||"",name:(null==e||null===(ue=e.owner)||void 0===ue?void 0:ue.applicantName)||(null==ot?void 0:ot.name)||(null==e||null===(se=e.applicantDetail)||void 0===se?void 0:se.name)||"",mobileNumber:(null==e||null===(ce=e.owner)||void 0===ce?void 0:ce.mobileNumber)||(null==ot?void 0:ot.mobileNumber)||(null==e||null===(ve=e.applicantDetail)||void 0===ve?void 0:ve.mobileNumber)||"",alternateNumber:(null==e||null===(me=e.owner)||void 0===me?void 0:me.alternateNumber)||(null==ot?void 0:ot.alternateNumber)||(null==e||null===(pe=e.applicantDetail)||void 0===pe?void 0:pe.alternateNumber)||"",emailId:(null==e||null===(Ee=e.owner)||void 0===Ee?void 0:Ee.emailId)||(null==ot?void 0:ot.emailId)||(null==e||null===(fe=e.applicantDetail)||void 0===fe?void 0:fe.emailId)||"",gender:(null==e||null===(ge=e.owner)||void 0===ge?void 0:ge.gender)||(null==ot?void 0:ot.gender)||(null==e||null===(_e=e.applicantDetail)||void 0===_e?void 0:_e.gender)||null,type:"FIXED-POINT",fixedPointId:(null==ot?void 0:ot.fixedPointId)||(null==e||null===(he=e.applicantDetail)||void 0===he?void 0:he.fixedPointId)||""},address:{applicantId:(null==at?void 0:at.applicantId)||(null==ot?void 0:ot.applicantId)||(null==e||null===(ye=e.address)||void 0===ye?void 0:ye.applicantId)||"",addressId:(null==at?void 0:at.addressId)||(null==e||null===(Te=e.address)||void 0===Te?void 0:Te.addressId)||(null==e||null===(Se=e.address)||void 0===Se?void 0:Se.addressDetailId)||"",addressType:(null==e||null===(be=e.address)||void 0===be||null===(Ne=be.addressType)||void 0===Ne?void 0:Ne.code)||(null==e||null===(Ie=e.address)||void 0===Ie?void 0:Ie.addressType)||"CORRESPONDENCE",pincode:(null==e||null===(De=e.address)||void 0===De?void 0:De.pincode)||(null==at?void 0:at.pincode)||"",city:(null==e||null===(Ce=e.address)||void 0===Ce||null===(Ae=Ce.city)||void 0===Ae||null===(xe=Ae.city)||void 0===xe?void 0:xe.name)||(null==e||null===(Oe=e.address)||void 0===Oe||null===(we=Oe.city)||void 0===we?void 0:we.name)||(null==e||null===(Le=e.address)||void 0===Le?void 0:Le.city)||(null==at?void 0:at.city)||"",cityCode:(null==e||null===(Pe=e.address)||void 0===Pe||null===(Re=Pe.city)||void 0===Re||null===(ke=Re.city)||void 0===ke?void 0:ke.code)||(null==e||null===(Me=e.address)||void 0===Me?void 0:Me.cityCode)||(null==at?void 0:at.cityCode)||"DJB",addressLine1:(null==e||null===(Fe=e.address)||void 0===Fe?void 0:Fe.addressLine1)||(null==at?void 0:at.addressLine1)||"",addressLine2:(null==e||null===(Be=e.address)||void 0===Be?void 0:Be.addressLine2)||(null==at?void 0:at.addressLine2)||"",locality:(null==e||null===(We=e.address)||void 0===We||null===(Ue=We.locality)||void 0===Ue?void 0:Ue.i18nKey)||(null==e||null===(He=e.address)||void 0===He||null===(je=He.locality)||void 0===je?void 0:je.name)||(null==e||null===(Ve=e.address)||void 0===Ve?void 0:Ve.locality)||(null==at?void 0:at.locality)||"",localityCode:(null==e||null===(ze=e.address)||void 0===ze||null===(Ke=ze.locality)||void 0===Ke?void 0:Ke.code)||(null==e||null===(Ge=e.address)||void 0===Ge?void 0:Ge.localityCode)||(null==at?void 0:at.localityCode)||"",streetName:(null==e||null===(qe=e.address)||void 0===qe?void 0:qe.streetName)||(null==at?void 0:at.streetName)||"",houseNo:(null==e||null===(Ye=e.address)||void 0===Ye?void 0:Ye.houseNo)||(null==at?void 0:at.houseNo)||"",landmark:(null==e||null===(Xe=e.address)||void 0===Xe?void 0:Xe.landmark)||(null==at?void 0:at.landmark)||"",latitude:(null==e||null===(Qe=e.address)||void 0===Qe?void 0:Qe.latitude)||(null==at?void 0:at.latitude)||"",longitude:(null==e||null===(Ze=e.address)||void 0===Ze?void 0:Ze.longitude)||(null==at?void 0:at.longitude)||"",ward:(null==e||null===(Je=e.address)||void 0===Je?void 0:Je.ward)||(null==e||null===($e=e.address)||void 0===$e?void 0:$e.block)||(null==at?void 0:at.ward)||"",zone:(null==e||null===(et=e.address)||void 0===et?void 0:et.zone)||(null==at?void 0:at.zone)||"",constituency:(null==e||null===(tt=e.address)||void 0===tt?void 0:tt.assembly)||(null==e||null===(lt=e.address)||void 0===lt?void 0:lt.constituency)||(null==at?void 0:at.constituency)||""},WTfileStoreId:(null==e||null===(nt=e.requestDetails)||void 0===nt?void 0:nt.fileStoreId)||(null==e?void 0:e.WTfileStoreId)||null,bookingStatus:(null==e?void 0:e.bookingStatus)||"BOOKING_CREATED"}}})(c({},x,R,{tenantId:w}));V.mutate(e,{onSuccess:()=>{O(),window.location.reload()},onError:e=>{console.error("Update Error:",e)}})}},n.createElement(t.Card,{style:{maxHeight:"70vh",overflowY:"auto",padding:"20px"}},n.createElement("div",{style:{marginBottom:"24px"}},n.createElement("h2",{style:{fontSize:"18px",fontWeight:"bold",marginBottom:"16px",color:"#0B0C10",borderBottom:"1px solid #e0e0e0",paddingBottom:"8px"}},A("WT_APPLICANT_DETAILS")),n.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px"}},n.createElement("div",{style:{flex:"1 1 100%"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_FIXED_POINT")),n.createElement(t.Dropdown,{selected:R.owner.fixedPoint,option:z,select:e=>{if(e&&"object"==typeof e){const t=e.applicantDetail,l=e.address;k(c({},R,{owner:c({},R.owner,{fixedPoint:e,applicantName:(null==t?void 0:t.name)||R.owner.applicantName,mobileNumber:(null==t?void 0:t.mobileNumber)||R.owner.mobileNumber,alternateNumber:(null==t?void 0:t.alternateNumber)||R.owner.alternateNumber,emailId:(null==t?void 0:t.emailId)||R.owner.emailId}),address:c({},R.address,{houseNo:(null==l?void 0:l.houseNo)||"",streetName:(null==l?void 0:l.streetName)||"",addressLine1:(null==l?void 0:l.addressLine1)||"",addressLine2:(null==l?void 0:l.addressLine2)||"",landmark:(null==l?void 0:l.landmark)||"",pincode:null!=l&&l.pincode?l.pincode.toString().split(".")[0]:"",city:(null==l?void 0:l.city)||"Delhi",cityCode:(null==l?void 0:l.cityCode)||"DJB",locality:(null==l?void 0:l.locality)||"",localityCode:(null==l?void 0:l.localityCode)||"",ward:(null==l?void 0:l.ward)||"",zone:(null==l?void 0:l.zone)||"",constituency:(null==l?void 0:l.constituency)||""})}))}},optionKey:"name",t:A,placeholder:A("WT_SELECT_FIXED_POINT"),disable:!0})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_APPLICANT_NAME")),n.createElement(t.TextInput,{value:R.owner.applicantName,onChange:e=>k(c({},R,{owner:c({},R.owner,{applicantName:e.target.value})})),disable:!0})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{value:R.owner.mobileNumber,onChange:e=>k(c({},R,{owner:c({},R.owner,{mobileNumber:e})})),disable:!0})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_ALT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{value:R.owner.alternateNumber,onChange:e=>k(c({},R,{owner:c({},R.owner,{alternateNumber:e})})),disable:!0})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_EMAIL_ID")),n.createElement(t.TextInput,{value:R.owner.emailId,onChange:e=>k(c({},R,{owner:c({},R.owner,{emailId:e.target.value})})),disable:!0})))),n.createElement("div",{style:{marginBottom:"24px"}},n.createElement("h2",{style:{fontSize:"18px",fontWeight:"bold",marginBottom:"16px",color:"#0B0C10",borderBottom:"1px solid #e0e0e0",paddingBottom:"8px"}},A("WT_ADDRESS_DETAILS")),n.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px"}},["houseNo","streetName","addressLine1","addressLine2","landmark","pincode"].map(e=>n.createElement("div",{key:e,style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_"+e.toUpperCase())),n.createElement(t.TextInput,{value:R.address[e],onChange:t=>k(c({},R,{address:c({},R.address,{[e]:t.target.value})})),disable:!0}))))),n.createElement("div",{style:{marginBottom:"24px"}},n.createElement("h2",{style:{fontSize:"18px",fontWeight:"bold",marginBottom:"16px",color:"#0B0C10",borderBottom:"1px solid #e0e0e0",paddingBottom:"8px"}},A("WT_REQUEST_DETAILS")),n.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px"}},n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_TANKER_TYPE")),n.createElement(t.Dropdown,{selected:R.requestDetails.tankerType,option:ee,select:e=>k(c({},R,{requestDetails:c({},R.requestDetails,{tankerType:e})})),optionKey:"i18nKey",t:A})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_WATER_TYPE")),n.createElement(t.Dropdown,{selected:R.requestDetails.waterType,option:$,select:e=>k(c({},R,{requestDetails:c({},R.requestDetails,{waterType:e})})),optionKey:"i18nKey",t:A})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_TANKER_QUANTITY")),n.createElement(t.Dropdown,{selected:R.requestDetails.tankerQuantity,option:te,select:e=>k(c({},R,{requestDetails:c({},R.requestDetails,{tankerQuantity:e})})),optionKey:"i18nKey",t:A})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_WATER_QUANTITY")),n.createElement(t.Dropdown,{selected:R.requestDetails.waterQuantity,option:le,select:e=>k(c({},R,{requestDetails:c({},R.requestDetails,{waterQuantity:e})})),optionKey:"i18nKey",t:A})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_DELIVERY_DATE")),n.createElement(t.TextInput,{type:"date",value:R.requestDetails.deliveryDate,onChange:e=>k(c({},R,{requestDetails:c({},R.requestDetails,{deliveryDate:e.target.value})}))})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_DELIVERY_TIME")),n.createElement(t.TextInput,{type:"time",value:R.requestDetails.deliveryTime,onChange:e=>k(c({},R,{requestDetails:c({},R.requestDetails,{deliveryTime:e.target.value})}))})),n.createElement("div",{style:{flex:"1 1 100%"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_DESCRIPTION")),n.createElement(t.TextArea,{value:R.requestDetails.description,onChange:e=>k(c({},R,{requestDetails:c({},R.requestDetails,{description:e.target.value})}))})))),n.createElement("div",{style:{marginBottom:"24px"}},n.createElement("h2",{style:{fontSize:"18px",fontWeight:"bold",marginBottom:"16px",color:"#0B0C10",borderBottom:"1px solid #e0e0e0",paddingBottom:"8px"}},A("WT_DISPATCH_DETAILS")),n.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px"}},n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_FILLING_POINT")),n.createElement(t.Dropdown,{selected:R.dispatchDetails.fillingPoint,option:K,select:e=>{k(c({},R,{dispatchDetails:c({},R.dispatchDetails,{fillingPoint:e,vendor:"",vehicle:"",driver:""})}))},optionKey:"name",t:A})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_VENDOR")),n.createElement(t.Dropdown,{selected:R.dispatchDetails.vendor,option:G,select:e=>{k(c({},R,{dispatchDetails:c({},R.dispatchDetails,{vendor:e,vehicle:"",driver:""})}))},optionKey:"name",t:A})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_VEHICLE")),n.createElement(t.Dropdown,{selected:R.dispatchDetails.vehicle,option:q,select:e=>k(c({},R,{dispatchDetails:c({},R.dispatchDetails,{vehicle:e})})),optionKey:"name",t:A})),n.createElement("div",{style:{flex:"1 1 200px"}},n.createElement(t.CardLabel,{style:{fontWeight:"600",marginBottom:"4px",fontSize:"14px"}},A("WT_DRIVER")),n.createElement(t.Dropdown,{selected:R.dispatchDetails.driver,option:Y,select:e=>k(c({},R,{dispatchDetails:c({},R.dispatchDetails,{driver:e})})),optionKey:"name",t:A}))))))},rl=e=>{let o=e.startFileStoreId,a=e.endFileStoreId;const r=i.useTranslation().t,d=l.useState(null),u=d[0],s=d[1],c=l.useState(null),v=c[0],m=c[1],p=l.useState(null),E=p[0],f=p[1],g=Digit.ULBService.getCurrentTenantId();return l.useEffect(()=>{!function(){try{const e=D(function(){function e(){const e=function(){if(a)return Promise.resolve(Digit.UploadServices.Filefetch([a],g)).then(function(e){var t;null!=e&&null!==(t=e.data)&&void 0!==t&&t[a]&&f(e.data[a].split(",")[0])})}();if(e&&e.then)return e.then(function(){})}const t=function(){if(o)return Promise.resolve(Digit.UploadServices.Filefetch([o],g)).then(function(e){var t;null!=e&&null!==(t=e.data)&&void 0!==t&&t[o]&&m(e.data[o].split(",")[0])})}();return t&&t.then?t.then(e):e()},function(e){console.error("Error fetching trip images",e)});Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[o,a,g]),o||a?n.createElement("div",{style:{display:"flex",gap:"24px",marginTop:"16px",marginBottom:"16px"}},u&&n.createElement(t.Modal,{hideSubmit:!0,popmoduleClassName:"wt-trip-image-modal",headerBarMain:n.createElement("h1",{className:"heading-m"},r("WT_TRIP_IMAGE")),headerBarEnd:n.createElement("div",{onClick:()=>s(null),style:{cursor:"pointer",fontSize:"1.5rem"}},"×"),actionCancelLabel:r("CS_COMMON_CANCEL"),actionCancelOnSubmit:()=>s(null),formId:"modal-action"},n.createElement(t.Card,{style:{display:"flex",justifyContent:"center",padding:"16px"}},n.createElement("img",{src:u,alt:"Trip Image",style:{maxWidth:"100%",maxHeight:"60vh",objectFit:"contain"}}))),v&&n.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},n.createElement("p",{style:{fontWeight:"bold",marginBottom:"8px",fontSize:"16px"}},r("WT_START_TRIP_IMAGE")),n.createElement("div",{style:{position:"relative",width:"120px",height:"120px",border:"1px solid #ccc",borderRadius:"4px",overflow:"hidden"}},n.createElement("img",{src:v,alt:"Start Trip",style:{width:"100%",height:"100%",objectFit:"cover"}}),n.createElement("div",{onClick:()=>s(v),style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:"rgba(0,0,0,0.6)",borderRadius:"50%",padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"}},n.createElement(t.ViewsIcon,{fill:"#ffffff",style:{width:"24px",height:"24px"}})))),E&&n.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},n.createElement("p",{style:{fontWeight:"bold",marginBottom:"8px",fontSize:"16px"}},r("WT_END_TRIP_IMAGE")),n.createElement("div",{style:{position:"relative",width:"120px",height:"120px",border:"1px solid #ccc",borderRadius:"4px",overflow:"hidden"}},n.createElement("img",{src:E,alt:"End Trip",style:{width:"100%",height:"100%",objectFit:"cover"}}),n.createElement("div",{onClick:()=>s(E),style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:"rgba(0,0,0,0.6)",borderRadius:"50%",padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"}},n.createElement(t.ViewsIcon,{fill:"#ffffff",style:{width:"24px",height:"24px"}}))))):null};function dl(e,t){try{var l=e()}catch(e){return t(e)}return l&&l.then?l.then(void 0,t):l}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const ul=e=>n.createElement("h1",{className:"heading-m"},e.label),sl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),cl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(sl,null)),vl=e=>{var i,o;let a=e.t,r=e.action,d=e.tenantId,u=e.closeModal,s=e.submitAction,v=e.applicationData,m=e.businessService,p=e.moduleCode;const E=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),f=E.data,g=E.isLoading,_=Digit.Hooks.pt.useMDMS(d,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),h=_.isLoading,y=_.data,T=l.useState({}),S=T[0],b=T[1],N=l.useState({})[0],I=l.useState([]),D=I[0],C=I[1],A=l.useState(null),x=A[0],O=A[1],w=l.useState(null),L=w[0],P=w[1],R=l.useState(null),k=R[0],M=R[1],F=l.useState(null)[1],B=l.useState([]),W=B[0],U=B[1],H=l.useState(null),j=H[0],V=H[1];function z(e){P(e.target.files[0])}return l.useState(!1),l.useEffect(()=>{var e;y&&y["egf-master"]&&U(null===(e=y["egf-master"])||void 0===e?void 0:e.FinancialYear)},[y]),l.useEffect(()=>{var e;C(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),l.useEffect(()=>{!function(){try{F(null);const e=function(){if(L){const e=function(){if(L.size>=5242880)F(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=dl(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",L,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?M(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):F(a("CS_FILE_UPLOAD_ERROR"))})},function(){F(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[L]),l.useEffect(()=>{r&&b(null!=r&&r.showFinancialYearsModal?(e=>{let l=e.action,i=e.financialYears,o=e.selectedFinancialYear,a=e.setSelectedFinancialYear;return{label:{heading:"WF_"+l.action+"_APPLICATION",submit:"WF_PT.CREATE_"+l.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:(0,e.t)("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:n.createElement(t.RadioButtons,{options:i,optionsKey:"name",onSelect:a,selectedOption:o})}]}]}})({t:a,action:r,financialYears:W,selectedFinancialYear:j,setSelectedFinancialYear:V}):(e=>{var l;let i=e.t,o=e.action,a=e.approvers,r=e.selectedApprover,d=e.setSelectedApprover,u=e.selectFile,s=e.uploadedFile,c=e.setUploadedFile;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+e.businessService+"_"+(null==o?void 0:o.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(e.assigneeLabel||"WF_ROLE_"+(null===(l=o.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:D,selectedApprover:x,setSelectedApprover:O,selectFile:z,uploadedFile:k,setUploadedFile:M,businessService:m}))},[r,D,W,j,k]),r&&S.form?n.createElement(t.Modal,{headerBarMain:n.createElement(ul,{label:a(S.label.heading)}),headerBarEnd:n.createElement(cl,{onClick:u}),actionCancelLabel:a(S.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(S.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!j:g||(null==r?void 0:r.docUploadRequired)&&!k,formId:"modal-action"},h?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};v.creationReason="STATUS",s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:c({},v,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==j?void 0:j.name,propertyId:null==v?void 0:v.propertyId,tenantId:d,source:null==v?void 0:v.source,channel:null==v?void 0:v.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!x?[]:[x],k&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==L?void 0:L.name,fileStoreId:k}]),s({Property:c({},v,{workflow:t})})}},defaultValues:N,formId:"modal-action"})):n.createElement(t.Loader,null)},ml=e=>n.createElement("h1",{className:"heading-m"},e.label),pl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),El=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(pl,null)),fl=e=>{var i,o;let a=e.t,r=e.action,d=e.tenantId,u=e.closeModal,s=e.submitAction,v=e.applicationData,m=e.businessService;const p=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}).data,E=Digit.Hooks.pt.useMDMS(d,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),f=E.isLoading,g=E.data,_=l.useState({}),h=_[0],y=_[1],T=l.useState({})[0],S=l.useState([]),b=S[0],N=S[1],I=l.useState({}),D=I[0],C=I[1],A=l.useState(null),x=A[0],O=A[1],w=l.useState(null),L=w[0],P=w[1],R=l.useState(null)[1],k=l.useState([]),M=k[0],F=k[1],B=l.useState(null)[0];function W(e){O(e.target.files[0])}return l.useEffect(()=>{var e;g&&g["egf-master"]&&F(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),l.useEffect(()=>{var e;N(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),l.useEffect(()=>{!function(){try{R(null);const e=function(){if(x){const e=function(){if(x.size>=5242880)R(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=dl(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",x,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?P(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):R(a("CS_FILE_UPLOAD_ERROR"))})},function(){R(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[x]),l.useEffect(()=>{r&&y((e=>{let l=e.t,i=e.action,o=e.approvers,a=e.selectedApprover,r=e.setSelectedApprover,d=e.selectFile,u=e.uploadedFile,s=e.setUploadedFile,c=e.businessService,v=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(v=!1),i.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:v?l("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?l("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?n.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:l("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:l("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{s(null)},message:u?"1 "+l("ES_PT_ACTION_FILEUPLOADED"):l("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:b,selectedApprover:D,setSelectedApprover:C,selectFile:W,uploadedFile:L,setUploadedFile:P,businessService:m}))},[r,b,M,B,L]),r&&h.form?n.createElement(t.Modal,{headerBarMain:n.createElement(ml,{label:a(h.label.heading)}),headerBarEnd:n.createElement(El,{onClick:u}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=c({},v,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=D&&D.uuid?[null==D?void 0:D.uuid]:null,wfDocuments:L?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==x?void 0:x.name,fileStoreId:L}]:null}),s({Licenses:[v]})},defaultValues:T,formId:"modal-action"})):n.createElement(t.Loader,null)},gl=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),_l=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),hl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(_l,null)),yl=e=>{var i,o;let a=e.t,r=e.action,d=e.tenantId,u=e.closeModal,s=e.submitAction,v=e.applicationData,m=e.businessService;const p=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),E=p.data,f=p.isLoading,g=l.useState({}),_=g[0],h=g[1],y=l.useState({})[0],T=l.useState([]),S=T[0],b=T[1],N=l.useState({}),I=N[0],D=N[1],C=l.useState(null),A=C[0],x=C[1],O=l.useState(null),w=O[0],L=O[1],P=l.useState(null),R=P[0],k=P[1],M=!!Digit.Utils.browser.isMobile();function F(e){x(e.target.files[0])}return l.useEffect(()=>{var e;b(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),l.useEffect(()=>{!function(){try{k(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)k(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))k(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=dl(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",A,Digit.ULBService.getStateId()||(null==d?void 0:d.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?L(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):k(a("CS_FILE_UPLOAD_ERROR"))})},function(){k(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),l.useEffect(()=>{r&&h((e=>{let l=e.t,i=e.action,o=e.approvers,a=e.selectedApprover,r=e.setSelectedApprover,d=e.selectFile,u=e.uploadedFile,s=e.setUploadedFile,c=e.businessService,v=e.error,m=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(m=!1),i.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:m?l("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?l("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?n.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:l("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:l("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{s(null)},message:u?"1 "+l("ES_PT_ACTION_FILEUPLOADED"):l("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:a,action:r,approvers:S,selectedApprover:I,setSelectedApprover:D,selectFile:F,uploadedFile:w,setUploadedFile:L,businessService:m,error:R}))},[r,S,w,R]),r&&_.form?n.createElement(t.Modal,{headerBarMain:n.createElement(gl,{label:a(_.label.heading)}),headerBarEnd:n.createElement(hl,{onClick:u}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:M?{width:"720px"}:{},style:M?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:M?{paddingLeft:"5px"}:{}},f?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:_.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=c({},v,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=I&&I.uuid?[null==I?void 0:I.uuid]:null,wfDocuments:w?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:w}]:null}),s({Licenses:[v]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:y,formId:"modal-action"})):n.createElement(t.Loader,null)},Tl=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Sl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),bl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Sl,null)),Nl=e=>{var i,o,r,d,u,s,v,m,p,E,f,g;let _=e.t,h=e.action,y=e.tenantId,T=e.closeModal,S=e.submitAction,b=e.applicationDetails,N=e.applicationData,I=e.businessService,D=e.workflowDetails;Digit.Hooks.obps.useObpsAPI(null!==(i=N)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(r=o.address)&&void 0!==r&&r.city?null===(d=N)||void 0===d||null===(u=d.landInfo)||void 0===u||null===(s=u.address)||void 0===s?void 0:s.city:y,!1);const C=Digit.Hooks.useEmployeeSearch(y,{roles:null==D||null===(v=D.data)||void 0===v||null===(m=v.initialActionState)||void 0===m||null===(p=m.nextActions)||void 0===p||null===(E=p.filter(e=>(null==e?void 0:e.action)==(null==h?void 0:h.action)))||void 0===E||null===(f=E[0])||void 0===f||null===(g=f.assigneeRoles)||void 0===g?void 0:g.map(e=>({code:e})),isActive:!0},{enabled:!(null!=h&&h.isTerminateState)}),A=C.data,x=C.isLoading,O=(a.useQueryClient(),l.useState({})),w=O[0],L=O[1],P=l.useState({})[0],R=l.useState([]),k=R[0],M=R[1],F=l.useState({}),B=F[0],W=F[1],U=l.useState(null),H=U[0],j=U[1],V=l.useState(null),z=V[0],K=V[1],G=l.useState(null),q=G[0],Y=G[1],X=l.useState(null)[0],Q=!!Digit.Utils.browser.isMobile();function Z(e){j(e.target.files[0])}l.useEffect(()=>{var e;M(null==A||null===(e=A.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[A]),l.useEffect(()=>{!function(){try{Y(null);const e=function(){if(H){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(H.size>=5242880)Y(_("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=H&&H.type&&!e.test(null==H?void 0:H.type))Y(_("NOT_SUPPORTED_FILE_TYPE"));else{const e=dl(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",H,Digit.ULBService.getStateId()||(null==y?void 0:y.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?K(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):Y(_("CS_FILE_UPLOAD_ERROR"))})},function(){Y(_("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[H]);const J=e=>{let t=[];return e&&e.map((e,l)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},$=e=>{let t=[];var l;for(l=0;l<(null==e?void 0:e.questionLength);l++){var n;t.push({remarks:e["Remarks_"+l],question:null==e?void 0:e.questionList[l].question,value:null==e||null===(n=e["question_"+l])||void 0===n?void 0:n.code})}return t},ee=e=>{var t,l;let n=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.fieldinspection_pending)||void 0===l?void 0:l.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),"FIELDINSPECTION_INPROGRESS"==e.status?(n=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=n)||void 0===a?void 0:a.length)>0&&n.map((e,t)=>{i.push({docs:J(e.Documents),date:e.InspectionDate,questions:$(e),time:null==e?void 0:e.InspectionTime})}),i=i.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},te=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),l=[];return t.map(e=>{var t,n,i,o,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(n=t[0])||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)>0&&(l=[...l,...null==e||null===(o=e.uploadedDocuments)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.values]),(null==e||null===(r=e.newUploadedDocs)||void 0===r?void 0:r.length)>0&&(l=[...l,...null==e?void 0:e.newUploadedDocs])}),l},le=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),l=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let n=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return n=null===(e=n)||void 0===e?void 0:e.concat(null!==l?l.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),n};return l.useEffect(()=>{h&&L((e=>{var l;let i=e.t,o=e.action,a=e.approvers,r=e.selectedApprover,d=e.setSelectedApprover,u=e.selectFile,s=e.uploadedFile,c=e.setUploadedFile,v=e.error,m=!1;return"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SKIP_PAYMENT"!=o.action&&"SEND_BACK_TO_CITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(m=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+e.businessService+"_"+(null==o?void 0:o.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:o.isTerminateState||m?null:i(e.assigneeLabel||"WF_ROLE_"+(null===(l=o.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:o.isTerminateState||m?null:n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:_,action:h,approvers:k,selectedApprover:B,setSelectedApprover:W,selectFile:Z,uploadedFile:z,setUploadedFile:K,businessService:I,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:q}))},[h,k,X,z,q]),h&&w.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Tl,{label:_(w.label.heading)}),headerBarEnd:n.createElement(bl,{onClick:T}),actionCancelLabel:_(w.label.cancel),actionCancelOnSubmit:T,actionSaveLabel:_(w.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:Q?{width:"720px"}:{},style:Q?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:Q?{paddingLeft:"5px"}:{}},x?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:w.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,l,n,i,o,a;N=c({},N,{documents:te(),additionalDetails:c({},null===(t=N)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:ee(N),pendingapproval:le()}),workflow:{action:null==h?void 0:h.action,comment:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,assignee:null!=B&&B.uuid?[null==B?void 0:B.uuid]:null,assignes:null!=B&&B.uuid?[null==B?void 0:B.uuid]:null,varificationDocuments:z?[{documentType:(null==h?void 0:h.action)+" DOC",fileName:null==H?void 0:H.name,fileStoreId:z}]:null},action:null==h?void 0:h.action,comment:null==e?void 0:e.comments,assignee:null!=B&&B.uuid?[null==B?void 0:B.uuid]:null,wfDocuments:z?[{documentType:(null==h?void 0:h.action)+" DOC",fileName:null==H?void 0:H.name,fileStoreId:z}]:null});const r=null==b||null===(i=b.nocData)||void 0===i?void 0:i.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:c({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}});let d={sourceRefId:null==r||null===(o=r[0])||void 0===o||null===(a=o.Noc)||void 0===a?void 0:a.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(y,d)).then(function(e){var t;let l=!0,n=!0;null==e||null===(t=e.Noc)||void 0===t||t.map(e=>{var t,i,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=l&&1!=n||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?l=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(n=!1))});let i=[];r&&r.map(e=>{var t,o,a,r,d,u,s,c,v,m,p,E;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(o=t.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(d=e.Noc)||void 0===d||null===(u=d.applicationStatus)||void 0===u?void 0:u.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(c=s.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"VOIDED"!=(null==e||null===(v=e.Noc)||void 0===v||null===(m=v.applicationStatus)||void 0===m?void 0:m.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(p=e.Noc)||void 0===p?void 0:p.nocType)&&l||"FIRE_NOC"===(null==e||null===(E=e.Noc)||void 0===E?void 0:E.nocType)&&n)&&i.push(e)}),S({BPA:N},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:P,formId:"modal-action"})):n.createElement(t.Loader,null)},Il=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Dl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Cl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Dl,null)),Al=e=>{var i,r;let d=e.t,u=e.action,s=e.tenantId,v=e.closeModal,m=e.submitAction,p=e.applicationData,E=e.businessService;const f=Digit.Hooks.useEmployeeSearch(s,{roles:null==u||null===(i=u.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=u&&u.isTerminateState)}),g=f.data,_=f.isLoading,h=(a.useQueryClient(),l.useState({})),y=h[0],T=h[1],S=l.useState({})[0],b=l.useState([]),N=b[0],I=b[1],D=l.useState({}),C=D[0],A=D[1],x=l.useState(null),O=x[0],w=x[1],L=l.useState(null),P=L[0],R=L[1],k=l.useState(null),M=k[0],F=k[1],B=!!Digit.Utils.browser.isMobile();function W(e){w(e.target.files[0])}return o.useHistory(),l.useEffect(()=>{var e;I(null==g||null===(e=g.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[g]),l.useEffect(()=>{!function(){try{F(null);const e=function(){if(O){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(O.size>=5242880)F(d("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=O&&O.type&&!e.test(null==O?void 0:O.type))F(d("NOT_SUPPORTED_FILE_TYPE"));else{const e=dl(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",O,Digit.ULBService.getStateId()||(null==s?void 0:s.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?R(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):F(d("CS_FILE_UPLOAD_ERROR"))})},function(){F(d("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[O]),l.useEffect(()=>{u&&T((e=>{var l;let i=e.t,o=e.action,a=e.approvers,r=e.selectedApprover,d=e.setSelectedApprover,u=e.selectFile,s=e.uploadedFile,c=e.setUploadedFile,v=e.error,m=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(m=!0);let p=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(p=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+e.businessService+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||p?null:i(e.assigneeLabel||"WF_ROLE_"+(null===(l=o.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:o.isTerminateState||p?null:n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:m,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:d,action:u,approvers:N,selectedApprover:C,setSelectedApprover:A,selectFile:W,uploadedFile:P,setUploadedFile:R,businessService:E,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:M}))},[u,N,P,M]),u&&y.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Il,{label:d(y.label.heading)}),headerBarEnd:n.createElement(Cl,{onClick:v}),actionCancelLabel:d(y.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:d(y.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:B?{width:"720px"}:{},style:B?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:B?{paddingLeft:"5px"}:{}},_?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:y.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=p)||void 0===t||null===(l=t.documents)||void 0===l?void 0:l.length)>0?[...null===(n=p)||void 0===n?void 0:n.documents]:[];i.map((e,t)=>{o.push(e)}),p=c({},p,{workflow:{action:null==u?void 0:u.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:null,documents:P?[{documentType:(null==u?void 0:u.action)+" DOC",fileName:null==O?void 0:O.name,fileStoreId:P}]:null},documents:o}),m({Noc:p},!1,{isNoc:!0})},defaultValues:S,formId:"modal-action"})):n.createElement(t.Loader,null)};var xl=function(e,t){return e===t||e!=e&&t!=t},Ol=function(e,t){for(var l=e.length;l--;)if(xl(e[l][0],t))return l;return-1},wl=Array.prototype.splice;function Ll(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}Ll.prototype.clear=function(){this.__data__=[],this.size=0},Ll.prototype.delete=function(e){var t=this.__data__,l=Ol(t,e);return!(l<0||(l==t.length-1?t.pop():wl.call(t,l,1),--this.size,0))},Ll.prototype.get=function(e){var t=this.__data__,l=Ol(t,e);return l<0?void 0:t[l][1]},Ll.prototype.has=function(e){return Ol(this.__data__,e)>-1},Ll.prototype.set=function(e,t){var l=this.__data__,n=Ol(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this};var Pl=Ll,Rl="object"==typeof Xe&&Xe&&Xe.Object===Object&&Xe,kl="object"==typeof self&&self&&self.Object===Object&&self,Ml=Rl||kl||Function("return this")(),Fl=Ml.Symbol,Bl=Object.prototype,Wl=Bl.hasOwnProperty,Ul=Bl.toString,Hl=Fl?Fl.toStringTag:void 0,jl=Object.prototype.toString,Vl=Fl?Fl.toStringTag:void 0,zl=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Vl&&Vl in Object(e)?function(e){var t=Wl.call(e,Hl),l=e[Hl];try{e[Hl]=void 0;var n=!0}catch(e){}var i=Ul.call(e);return n&&(t?e[Hl]=l:delete e[Hl]),i}(e):function(e){return jl.call(e)}(e)},Kl=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Gl=function(e){if(!Kl(e))return!1;var t=zl(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ql=Ml["__core-js_shared__"],Yl=function(){var e=/[^.]+$/.exec(ql&&ql.keys&&ql.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Xl=Function.prototype.toString,Ql=function(e){if(null!=e){try{return Xl.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Zl=/^\[object .+?Constructor\]$/,Jl=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$l=function(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Kl(e)||(t=e,Yl&&Yl in t))&&(Gl(e)?Jl:Zl).test(Ql(e));var t}(l)?l:void 0},en=$l(Ml,"Map"),tn=$l(Object,"create"),ln=Object.prototype.hasOwnProperty,nn=Object.prototype.hasOwnProperty;function on(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}on.prototype.clear=function(){this.__data__=tn?tn(null):{},this.size=0},on.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},on.prototype.get=function(e){var t=this.__data__;if(tn){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return ln.call(t,e)?t[e]:void 0},on.prototype.has=function(e){var t=this.__data__;return tn?void 0!==t[e]:nn.call(t,e)},on.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=tn&&void 0===t?"__lodash_hash_undefined__":t,this};var an=on,rn=function(e,t){var l,n,i=e.__data__;return("string"==(n=typeof(l=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==l:null===l)?i["string"==typeof t?"string":"hash"]:i.map};function dn(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}dn.prototype.clear=function(){this.size=0,this.__data__={hash:new an,map:new(en||Pl),string:new an}},dn.prototype.delete=function(e){var t=rn(this,e).delete(e);return this.size-=t?1:0,t},dn.prototype.get=function(e){return rn(this,e).get(e)},dn.prototype.has=function(e){return rn(this,e).has(e)},dn.prototype.set=function(e,t){var l=rn(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this};var un=dn;function sn(e){var t=this.__data__=new Pl(e);this.size=t.size}sn.prototype.clear=function(){this.__data__=new Pl,this.size=0},sn.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},sn.prototype.get=function(e){return this.__data__.get(e)},sn.prototype.has=function(e){return this.__data__.has(e)},sn.prototype.set=function(e,t){var l=this.__data__;if(l instanceof Pl){var n=l.__data__;if(!en||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new un(n)}return l.set(e,t),this.size=l.size,this};var cn=sn,vn=function(){try{var e=$l(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),mn=function(e,t,l){"__proto__"==t&&vn?vn(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l},pn=Object.prototype.hasOwnProperty,En=function(e,t,l){var n=e[t];pn.call(e,t)&&xl(n,l)&&(void 0!==l||t in e)||mn(e,t,l)},fn=function(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],d=n?n(l[r],e[r],r,l,e):void 0;void 0===d&&(d=e[r]),i?mn(l,r,d):En(l,r,d)}return l},gn=function(e){return null!=e&&"object"==typeof e},_n=function(e){return gn(e)&&"[object Arguments]"==zl(e)},hn=Object.prototype,yn=hn.hasOwnProperty,Tn=hn.propertyIsEnumerable,Sn=_n(function(){return arguments}())?_n:function(e){return gn(e)&&yn.call(e,"callee")&&!Tn.call(e,"callee")},bn=Array.isArray,Nn=function(){return!1},In=Qe(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?Ml.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Nn}),Dn=/^(?:0|[1-9]\d*)$/,Cn=function(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&Dn.test(e))&&e>-1&&e%1==0&&e<t},An=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},xn={};xn["[object Float32Array]"]=xn["[object Float64Array]"]=xn["[object Int8Array]"]=xn["[object Int16Array]"]=xn["[object Int32Array]"]=xn["[object Uint8Array]"]=xn["[object Uint8ClampedArray]"]=xn["[object Uint16Array]"]=xn["[object Uint32Array]"]=!0,xn["[object Arguments]"]=xn["[object Array]"]=xn["[object ArrayBuffer]"]=xn["[object Boolean]"]=xn["[object DataView]"]=xn["[object Date]"]=xn["[object Error]"]=xn["[object Function]"]=xn["[object Map]"]=xn["[object Number]"]=xn["[object Object]"]=xn["[object RegExp]"]=xn["[object Set]"]=xn["[object String]"]=xn["[object WeakMap]"]=!1;var On=function(e){return function(t){return e(t)}},wn=Qe(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l&&Rl.process,o=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Ln=wn&&wn.isTypedArray,Pn=Ln?On(Ln):function(e){return gn(e)&&An(e.length)&&!!xn[zl(e)]},Rn=Object.prototype.hasOwnProperty,kn=function(e,t){var l=bn(e),n=!l&&Sn(e),i=!l&&!n&&In(e),o=!l&&!n&&!i&&Pn(e),a=l||n||i||o,r=a?function(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}(e.length,String):[],d=r.length;for(var u in e)!t&&!Rn.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Cn(u,d))||r.push(u);return r},Mn=Object.prototype,Fn=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Mn)},Bn=function(e,t){return function(l){return e(t(l))}},Wn=Bn(Object.keys,Object),Un=Object.prototype.hasOwnProperty,Hn=function(e){return null!=e&&An(e.length)&&!Gl(e)},jn=function(e){return Hn(e)?kn(e):function(e){if(!Fn(e))return Wn(e);var t=[];for(var l in Object(e))Un.call(e,l)&&"constructor"!=l&&t.push(l);return t}(e)},Vn=Object.prototype.hasOwnProperty,zn=function(e){return Hn(e)?kn(e,!0):function(e){if(!Kl(e))return function(e){var t=[];if(null!=e)for(var l in Object(e))t.push(l);return t}(e);var t=Fn(e),l=[];for(var n in e)("constructor"!=n||!t&&Vn.call(e,n))&&l.push(n);return l}(e)},Kn=Qe(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?Ml.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var l=e.length,n=o?o(l):new e.constructor(l);return e.copy(n),n}}),Gn=function(){return[]},qn=Object.prototype.propertyIsEnumerable,Yn=Object.getOwnPropertySymbols,Xn=Yn?function(e){return null==e?[]:(e=Object(e),function(t,l){for(var n=-1,i=null==t?0:t.length,o=0,a=[];++n<i;){var r=t[n];qn.call(e,r)&&(a[o++]=r)}return a}(Yn(e)))}:Gn,Qn=function(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e},Zn=Bn(Object.getPrototypeOf,Object),Jn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Qn(t,Xn(e)),e=Zn(e);return t}:Gn,$n=function(e,t,l){var n=t(e);return bn(e)?n:Qn(n,l(e))},ei=function(e){return $n(e,jn,Xn)},ti=function(e){return $n(e,zn,Jn)},li=$l(Ml,"DataView"),ni=$l(Ml,"Promise"),ii=$l(Ml,"Set"),oi=$l(Ml,"WeakMap"),ai=Ql(li),ri=Ql(en),di=Ql(ni),ui=Ql(ii),si=Ql(oi),ci=zl;(li&&"[object DataView]"!=ci(new li(new ArrayBuffer(1)))||en&&"[object Map]"!=ci(new en)||ni&&"[object Promise]"!=ci(ni.resolve())||ii&&"[object Set]"!=ci(new ii)||oi&&"[object WeakMap]"!=ci(new oi))&&(ci=function(e){var t=zl(e),l="[object Object]"==t?e.constructor:void 0,n=l?Ql(l):"";if(n)switch(n){case ai:return"[object DataView]";case ri:return"[object Map]";case di:return"[object Promise]";case ui:return"[object Set]";case si:return"[object WeakMap]"}return t});var vi=ci,mi=Object.prototype.hasOwnProperty,pi=Ml.Uint8Array,Ei=function(e){var t=new e.constructor(e.byteLength);return new pi(t).set(new pi(e)),t},fi=/\w*$/,gi=Fl?Fl.prototype:void 0,_i=gi?gi.valueOf:void 0,hi=Object.create,yi=function(){function e(){}return function(t){if(!Kl(t))return{};if(hi)return hi(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}(),Ti=wn&&wn.isMap,Si=Ti?On(Ti):function(e){return gn(e)&&"[object Map]"==vi(e)},bi=wn&&wn.isSet,Ni=bi?On(bi):function(e){return gn(e)&&"[object Set]"==vi(e)},Ii={};Ii["[object Arguments]"]=Ii["[object Array]"]=Ii["[object ArrayBuffer]"]=Ii["[object DataView]"]=Ii["[object Boolean]"]=Ii["[object Date]"]=Ii["[object Float32Array]"]=Ii["[object Float64Array]"]=Ii["[object Int8Array]"]=Ii["[object Int16Array]"]=Ii["[object Int32Array]"]=Ii["[object Map]"]=Ii["[object Number]"]=Ii["[object Object]"]=Ii["[object RegExp]"]=Ii["[object Set]"]=Ii["[object String]"]=Ii["[object Symbol]"]=Ii["[object Uint8Array]"]=Ii["[object Uint8ClampedArray]"]=Ii["[object Uint16Array]"]=Ii["[object Uint32Array]"]=!0,Ii["[object Error]"]=Ii["[object Function]"]=Ii["[object WeakMap]"]=!1;var Di=function e(t,l,n,i,o,a){var r,d=1&l,u=2&l,s=4&l;if(n&&(r=o?n(t,i,o,a):n(t)),void 0!==r)return r;if(!Kl(t))return t;var c=bn(t);if(c){if(r=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&mi.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(t),!d)return function(e,t){var l=-1,n=e.length;for(t||(t=Array(n));++l<n;)t[l]=e[l];return t}(t,r)}else{var v=vi(t),m="[object Function]"==v||"[object GeneratorFunction]"==v;if(In(t))return Kn(t,d);if("[object Object]"==v||"[object Arguments]"==v||m&&!o){if(r=u||m?{}:function(e){return"function"!=typeof e.constructor||Fn(e)?{}:yi(Zn(e))}(t),!d)return u?function(e,t){return fn(e,Jn(e),t)}(t,function(e,t){return e&&fn(t,zn(t),e)}(r,t)):function(e,t){return fn(e,Xn(e),t)}(t,function(e,t){return e&&fn(t,jn(t),e)}(r,t))}else{if(!Ii[v])return o?t:{};r=function(e,t,l){var n=e.constructor;switch(t){case"[object ArrayBuffer]":return Ei(e);case"[object Boolean]":case"[object Date]":return new n(+e);case"[object DataView]":return function(e,t){var l=t?Ei(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var l=t?Ei(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}(e,l);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,fi.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new n;case"[object Symbol]":return _i?Object(_i.call(e)):{}}}(t,v,d)}}a||(a=new cn);var p=a.get(t);if(p)return p;a.set(t,r),Ni(t)?t.forEach(function(i){r.add(e(i,l,n,i,t,a))}):Si(t)&&t.forEach(function(i,o){r.set(o,e(i,l,n,o,t,a))});var E=c?void 0:(s?u?ti:ei:u?zn:jn)(t);return function(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l););}(E||t,function(i,o){E&&(i=t[o=i]),En(r,o,e(i,l,n,o,t,a))}),r},Ci=function(e){return Di(e,5)};const Ai=e=>n.createElement("h1",{className:"heading-m"},e.label),xi=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Oi=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(xi,null)),wi=function(e,t){void 0===t&&(t="dayend");try{const l=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),n=new Date(Date.UTC(l[1],l[2]-1,l[3]));return n.setMinutes(n.getMinutes()+n.getTimezoneOffset()),"dayend"===t&&(n.setHours(n.getHours()+24),n.setSeconds(n.getSeconds()-1)),n.getTime()}catch(t){return e}},Li=e=>{var i,o;let a=e.t,r=e.action,d=e.tenantId,u=e.closeModal,s=e.submitAction,v=e.applicationData,m=e.businessService,p=e.cardClassName,E=e.cardFormWrapperClassName,f=e.cardFormClassName,g=e.formClassName;const _=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),h=_.data,y=_.isLoading,T=l.useState({}),S=T[0],b=T[1],N=l.useState({})[0],I=l.useState([]),D=I[0],C=I[1],A=l.useState({}),x=A[0],O=A[1],w=l.useState(null),L=w[0],P=w[1],R=l.useState(null),k=R[0],M=R[1],F=l.useState(null),B=F[0],W=F[1],U=window.Digit.Utils.browser.isMobile(),H=window.location.href.includes("/employee");function j(e){P(e.target.files[0])}return l.useEffect(()=>{var e;C(null==h||null===(e=h.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[h]),l.useEffect(()=>{!function(){try{W(null);const e=function(){if(L){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(L.size>=5242880)W(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=L&&L.type&&!e.test(null==L?void 0:L.type))W(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=dl(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",L,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?M(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):W(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),W(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[L]),l.useEffect(()=>{var e,l,i,o;"DisconnectWSConnection"==(null===(e=v)||void 0===e||null===(l=e.processInstance)||void 0===l?void 0:l.businessService)||"DisconnectSWConnection"==(null===(i=v)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&b((e=>{var l;let i=e.t,o=e.action,a=e.selectFile,r=e.uploadedFile,d=e.setUploadedFile,u=e.businessService,s=e.error,v=!1;return null!=o&&null!==(l=o.action)&&void 0!==l&&l.includes("SEND_BACK"),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(v=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[v&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!v,type:"custom",populators:v?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,l)=>n.createElement(t.DatePicker,c({onChange:e.onChange,date:e.value},l))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:a,onDelete:()=>{d(null)},message:r?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:s,iserror:s,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:D,selectedApprover:x,setSelectedApprover:O,selectFile:j,uploadedFile:k,setUploadedFile:M,businessService:m,error:B})):r&&b((e=>{var l;let i=e.t,o=e.action,a=e.selectFile,r=e.uploadedFile,d=e.setUploadedFile,u=e.businessService,s=e.error;return null!=o&&null!==(l=o.action)&&void 0!==l&&l.includes("SEND_BACK"),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:a,onDelete:()=>{d(null)},message:r?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:s,iserror:s,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:D,selectedApprover:x,setSelectedApprover:O,selectFile:j,uploadedFile:k,setUploadedFile:M,businessService:m,error:B}))},[r,D,k,B]),r&&S.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Ai,{label:a(S.label.heading)}),headerBarEnd:n.createElement(Oi,{onClick:u}),actionCancelLabel:a(S.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:U&&H?{width:"100%",height:"auto"}:{}},y?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n,i,o,a,u,m,p,E;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var f,g,_,h,y,T,S,b,N;const t=c({},null===(f=v)||void 0===f||null===(g=f.billAmendmentDetails)||void 0===g?void 0:g.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),l=c({},null===(_=v)||void 0===_?void 0:_.billAmendmentDetails,{workflow:{businessId:null===(h=v)||void 0===h||null===(y=h.billAmendmentDetails)||void 0===y?void 0:y.amendmentId,action:null==r?void 0:r.action,tenantId:d,businessService:null!==(T=v)&&void 0!==T&&null!==(S=T.applicationType)&&void 0!==S&&S.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(b=v)&&void 0!==b&&null!==(N=b.applicationType)&&void 0!==N&&N.includes("WATER")?"WS":"SW",assignes:null!=x&&x.uuid?[{uuid:null==x?void 0:x.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:k?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==L?void 0:L.name,fileStoreId:k}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:k?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==L?void 0:L.name,fileStoreId:k}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=x&&x.uuid?[{uuid:null==x?void 0:x.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:k?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==L?void 0:L.name,fileStoreId:k}]:[]}});s({AmendmentUpdate:l})}else{if(v=c({},v,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=x&&x.uuid?[null==x?void 0:x.uuid]:[],assignes:null!=x&&x.uuid?[{uuid:null==x?void 0:x.uuid}]:[],wfDocuments:k?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==L?void 0:L.name,fileStoreId:k}]:null,processInstance:c({},null===(l=v)||void 0===l?void 0:l.processInstance,{action:null==r?void 0:r.action,assignes:null!=x&&x.uuid?[{uuid:null==x?void 0:x.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:k?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==L?void 0:L.name,fileStoreId:k}]:[]})}),null!=e&&e.date&&null!==(n=v)&&void 0!==n&&null!==(i=n.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=Ci(null==e?void 0:e.date);v.disconnectionExecutionDate=wi(t)}else if(null!=e&&e.date){const t=Ci(null==e?void 0:e.date);v.connectionExecutionDate=wi(t)}var I;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(u=v)||void 0===u||null===(m=u.processInstance)||void 0===m?void 0:m.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(I=v)||void 0===I?void 0:I.serviceType)?s({WaterConnection:v,disconnectRequest:!0}):s({SewerageConnection:v,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(p=v)||void 0===p?void 0:p.applicationType))s({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(E=v)||void 0===E?void 0:E.applicationType))s({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var D,C,A,O,w,P,R,M,F,B,W,U,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(D=t.value)&&void 0!==D&&D.adhocPenalty&&(v.additionalDetails.adhocPenalty=parseInt(null==t||null===(C=t.value)||void 0===C?void 0:C.adhocPenalty)||""),null!=t&&null!==(A=t.value)&&void 0!==A&&A.adhocPenaltyComment&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(O=t.value)||void 0===O?void 0:O.adhocPenaltyComment)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(P=t.value)||void 0===P?void 0:P.adhocPenaltyReason)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocRebate&&(v.additionalDetails.adhocRebate=parseInt(null==t||null===(M=t.value)||void 0===M?void 0:M.adhocRebate)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebateComment&&(v.additionalDetails.adhocRebateComment=(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocRebateComment)||""),null!=t&&null!==(W=t.value)&&void 0!==W&&W.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateReason)||"");const l=sessionStorage.getItem("Digit.DUE_VERIFICATION_DATA");if(l)try{v.dueVerification=JSON.parse(l)}catch(e){console.error("Error parsing due verification data",e)}"WATER"==(null===(H=v)||void 0===H?void 0:H.serviceType)?s({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!1}):s({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:N,formId:"modal-action",cardFormClassName:f,cardFormWrapperClassName:E,cardClassName:p,formClassName:g})):n.createElement(t.Loader,null)},Pi=e=>n.createElement("h1",{className:"heading-m"},e.label),Ri=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ki=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Ri,null)),Mi=e=>{var i,o;let a=e.t,r=e.action,d=e.tenantId,u=e.closeModal,s=e.submitAction,v=e.applicationData,m=e.businessService,p=e.moduleCode;console.log("applicationData",v);const E=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}).data,f=l.useState({}),g=f[0],_=f[1],h=l.useState({})[0],y=l.useState([]),T=y[0],S=y[1],b=l.useState(null),N=b[0],I=b[1],D=l.useState(null),C=D[0],A=D[1],x=l.useState(null),O=x[0],w=x[1],L=l.useState(null)[1];function P(e){A(e.target.files[0])}return l.useState(!1),l.useEffect(()=>{var e;S(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),l.useEffect(()=>{!function(){try{L(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=dl(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?w(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),l.useEffect(()=>{r&&_((e=>{let l=e.t,i=e.action,o=e.selectFile,a=e.uploadedFile,r=e.setUploadedFile;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+e.businessService+"_"+(null==i?void 0:i.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:l("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:l("ES_PTR_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:l("PTR_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+l("ES_PTR_ACTION_FILEUPLOADED"):l("ES_PTR_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:T,selectedApprover:N,setSelectedApprover:I,selectFile:P,uploadedFile:O,setUploadedFile:w,businessService:m}))},[r,T,O]),r&&g.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Pi,{label:a(g.label.heading)}),headerBarEnd:n.createElement(ki,{onClick:u}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p};O&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:O}]),s({PetRegistrationApplications:[c({},v,{workflow:t})]})},defaultValues:h,formId:"modal-action"})):n.createElement(t.Loader,null)},Fi=e=>n.createElement("h1",{className:"heading-m"},e.label),Bi=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Wi=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Bi,null)),Ui=e=>{var i,a,r;let d=e.t,u=e.action,s=e.closeModal,v=e.submitAction,m=e.applicationData,p=e.businessService,E=e.moduleCode,f=e.cardClassName,g=e.cardFormWrapperClassName,_=e.cardFormClassName,h=e.formClassName;const y=Digit.Hooks.useEmployeeSearch(e.tenantId,{roles:null==u||null===(i=u.roles)||void 0===i||null===(a=i[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=u&&u.isTerminateState)}).data,T=o.useHistory(),S=l.useState({}),b=S[0],N=S[1],I=l.useState({})[0],D=l.useState([]),C=D[0],A=D[1],x=l.useState(null),O=x[0],w=x[1],L=l.useState(null),P=L[0],R=L[1];return l.useEffect(()=>{var e;A(null==y||null===(e=y.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[y]),l.useEffect(()=>{"INITIATED"===(null==u?void 0:u.state)?T.push("/digit-ui/employee/asset/assetservice/edit/"+(null==m?void 0:m.applicationNo)):N((e=>{let t=e.t,l=e.action,n=e.businessService;return console.log("njhsegfdhjsbedwfdwe",l),{label:{heading:"WF_"+(null==l?void 0:l.action)+"_APPLICATION",submit:"WF_"+n+"_"+(null==l?void 0:l.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:d,action:u,approvers:C,selectedApprover:O,setSelectedApprover:w,uploadedFile:P,setUploadedFile:R,businessService:p}))},[u,C,P]),u&&b.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Fi,{label:d(b.label.heading)}),headerBarEnd:n.createElement(Wi,{onClick:s}),actionCancelLabel:d(b.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:d(b.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:b.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==u?void 0:u.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:E};P&&(t.documents=[]),v({Asset:c({},m,{workflow:t})})},defaultValues:I,formId:"modal-action",cardFormClassName:_,cardFormWrapperClassName:g,cardClassName:f,formClassName:h})):n.createElement(t.Loader,null)},Hi=e=>n.createElement("h1",{className:"heading-m"},e.label),ji=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Vi=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(ji,null)),zi=e=>{var i,o;let a=e.t,r=e.action,d=e.tenantId,u=e.closeModal,s=e.submitAction,v=e.applicationData,m=e.businessService,p=e.moduleCode;const E=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}).data,f=l.useState({}),g=f[0],_=f[1],h=l.useState({})[0],y=l.useState([]),T=y[0],S=y[1],b=l.useState(null),N=b[0],I=b[1],D=l.useState(null),C=D[0],A=D[1],x=l.useState(null),O=x[0],w=x[1],L=l.useState(null)[1];function P(e){A(e.target.files[0])}return l.useState(!1),l.useEffect(()=>{var e;S(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),l.useEffect(()=>{!function(){try{L(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=dl(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,d)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?w(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),l.useEffect(()=>{r&&_((e=>{let l=e.t,i=e.action,o=e.selectFile,a=e.uploadedFile,r=e.setUploadedFile;return{label:{heading:"CHB_"+(null==i?void 0:i.action),submit:"CHB_"+(null==i?void 0:i.action),cancel:"CS_COMMON_BACK"},form:[{body:[{label:l("ES_CHB_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:l("ES_CHB_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},message:a?"1 "+l("CS_ACTION_FILEUPLOADED"):l("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:T,selectedApprover:N,setSelectedApprover:I,selectFile:P,uploadedFile:O,setUploadedFile:w,businessService:m}))},[r,T,O]),r&&g.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Hi,{label:a(g.label.heading)}),headerBarEnd:n.createElement(Vi,{onClick:u}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:p};O&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:O}]),s({hallsBookingApplication:c({},v,{workflow:t})})},defaultValues:h,formId:"modal-action"})):n.createElement(t.Loader,null)},Ki=e=>n.createElement("h1",{className:"heading-m"},e.label),Gi=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),qi=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Gi,null)),Yi=e=>{var i,o;let a=e.t,r=e.action,d=e.tenantId,u=e.closeModal,s=e.submitAction,v=e.applicationData,m=e.businessService,p=e.moduleCode;console.log("snjdskbjdfbjskfjkbs",r);const E=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}).data,f=l.useState({}),g=f[0],_=f[1],h=l.useState({})[0],y=l.useState([]),T=y[0],S=y[1],b=l.useState(null),N=b[0],I=b[1],D=(l.useState(null),l.useState(null)),C=D[0],A=D[1],x=l.useState(null),O=x[0],w=x[1],L=l.useState(null)[1];function P(e){A(e.target.files[0])}return l.useState(!1),l.useEffect(()=>{var e;S(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),l.useEffect(()=>{!function(){try{L(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=dl(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?w(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),l.useEffect(()=>{r&&_((e=>{let l=e.t,i=e.action,o=e.selectFile,a=e.uploadedFile,r=e.setUploadedFile,d=e.businessService;console.log("action",i);const u=(new Date).toISOString().split("T")[0];return console.log("todayedsta ::",u),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+d+"_"+(null==i?void 0:i.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:["COMPLETIONPENDING"===(null==i?void 0:i.state)?{label:l("EW_PICKUP_DATE"),type:"date",isMandatory:!0,populators:{name:"date",min:(new Date).toISOString().split("T")[0],max:new Date(Date.now()+6048e5).toISOString().split("T")[0]}}:"null","REQUESTCOMPLETED"===(null==i?void 0:i.state)?{label:l("ES_EW_ACTION_TRANSACTION_ID"),type:"text",isMandatory:!0,populators:{name:"transactionId"}}:"null","REQUESTCOMPLETED"===(null==i?void 0:i.state)?{label:l("ES_EW_ACTION_FINALAMOUNT"),type:"text",isMandatory:!0,populators:{name:"finalAmount"}}:"null",{label:l("ES_EW_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:l("ES_EW_PHOTO")+(i.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:l("EW_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+l("ES_EW_ACTION_FILEUPLOADED"):l("ES_EW_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:T,selectedApprover:N,setSelectedApprover:I,selectFile:P,uploadedFile:O,setUploadedFile:w,businessService:m}))},[r,T,O]),console.log("conggg",g),r&&g.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Ki,{label:a(g.label.heading)}),headerBarEnd:n.createElement(qi,{onClick:u}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p};console.log("applicationData",e),O&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:O},{}]),v.pickUpDate=null==e?void 0:e.date,v.transactionId=null==e?void 0:e.transactionId,v.finalAmount=null==e?void 0:e.finalAmount,s({EwasteApplication:[c({},v,{workflow:t})]})},defaultValues:h,formId:"modal-action"})):n.createElement(t.Loader,null)},Xi=e=>n.createElement("h1",{className:"heading-m"},e.label),Qi=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Zi=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Qi,null)),Ji=e=>{var i,o;let a=e.t,r=e.action,d=e.tenantId,u=e.closeModal,s=e.submitAction,v=e.applicationData,m=e.businessService,p=e.moduleCode;const E=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}).data,f=l.useState({}),g=f[0],_=f[1],h=l.useState({})[0],y=l.useState([]),T=y[0],S=y[1],b=l.useState(null),N=b[0],I=b[1],D=l.useState(null),C=D[0],A=D[1],x=l.useState(null),O=x[0],w=x[1],L=l.useState(null)[1],P=l.useState(!1),R=P[0],k=P[1];function M(e){k(!0),A(e.target.files[0])}return l.useEffect(()=>{var e;S(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),l.useEffect(()=>{!function(){try{L(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var l=dl(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,d)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?w(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(a("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return l&&l.then?l.then(t.bind(null,!1),t.bind(null,!0)):t(!1,l)}(0,function(e,t){if(k(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),console.log("actyhdesh,jhfsefsef",r,v),l.useEffect(()=>{_((e=>{let l=e.t,i=e.action,o=e.selectFile,a=e.uploadedFile,r=e.setUploadedFile,d=e.approvers,u=e.selectedApprover,s=e.setSelectedApprover,c=e.isUploading;const v=()=>n.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"SV_"+(null==i?void 0:i.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==i?void 0:i.action)||"REJECT"===(null==i?void 0:i.action)||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?"":{label:l("SV_ASSIGNEE"),type:"dropdown",populators:n.createElement(t.Dropdown,{option:d,t:l,optionKey:"name",select:s,selected:u})},{label:l("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:l("SV_ATTATCH_FILE")+(i.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:c?n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},n.createElement(v,null),n.createElement("span",null,"Uploading...")):a?"1 "+l("SV_FILE_UPLOADED"):l("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:T,selectedApprover:N,setSelectedApprover:I,selectFile:M,uploadedFile:O,setUploadedFile:w,businessService:m,isUploading:R}))},[r,T,O]),r&&g.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Xi,{label:a(g.label.heading)}),headerBarEnd:n.createElement(Zi,{onClick:u}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==v||null===(t=v.auditDetails)||void 0===t?void 0:t.createdBy]:null!=N&&N.uuid?[null==N?void 0:N.uuid]:null};O&&(l.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:O}]),s({streetVendingDetail:c({},v,{workflow:l})})},defaultValues:h,formId:"modal-action"})):n.createElement(t.Loader,null)},$i=e=>n.createElement("h1",{className:"heading-m"},e.label),eo=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),to=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(eo,null)),lo=e=>{var i,o,a,r,d;let u=e.t,s=e.action,v=e.tenantId,m=e.closeModal,p=e.submitAction,E=e.applicationData,f=e.businessService,g=e.moduleCode,_=e.cardClassName,h=e.cardFormWrapperClassName,y=e.cardFormClassName,T=e.formClassName;const S=Digit.Hooks.useEmployeeSearch(v,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}).data,b=Digit.Hooks.fsm.useVendorSearch({tenantId:v,config:{enabled:"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}}).data;let N=[];null==b||null===(a=b.vendor)||void 0===a||a.forEach(e=>{var t,l;if("WT"===(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.description)||"WT"===(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.serviceType)){var n;const t=(null==e?void 0:e.name)+" ("+(null==e||null===(n=e.owner)||void 0===n?void 0:n.mobileNumber)+")";N.push({code:null==e?void 0:e.name,name:t,i18nKey:t,vendorId:null==e?void 0:e.id})}});const I=Digit.Hooks.fsm.useVehiclesSearch({tenantId:v,filters:{vendorId:null==E?void 0:E.vendorId},config:{enabled:"DELIVERY_PENDING"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}}).data;let D=[];null==I||null===(r=I.vehicle)||void 0===r||null===(d=r.filter(e=>{var t,l,n;return(null==e||null===(t=e.driverData)||void 0===t?void 0:t.id)||(null==e||null===(l=e.driver)||void 0===l?void 0:l.id)||(null==e||null===(n=e.owner)||void 0===n?void 0:n.id)}))||void 0===d||d.map(e=>{var t,l,n;D.push({code:null==e?void 0:e.registrationNumber,name:null==e?void 0:e.registrationNumber,i18nKey:null==e?void 0:e.registrationNumber,tankerCapacity:null==e?void 0:e.tankCapacity,vehicleId:null==e?void 0:e.id,driverId:(null==e||null===(t=e.driverData)||void 0===t?void 0:t.ownerId)||(null==e||null===(l=e.driver)||void 0===l?void 0:l.ownerId)||(null==e?void 0:e.ownerId)||(null==e||null===(n=e.owner)||void 0===n?void 0:n.uuid)})});const C=l.useState({}),A=C[0],x=C[1],O=l.useState({})[0],w=l.useState([]),L=w[0],P=w[1],R=l.useState(null),k=R[0],M=R[1],F=l.useState(null),B=F[0],W=F[1],U=l.useState(null)[1],H=l.useState(null),j=H[0],V=H[1],z=l.useState(null),K=z[0],G=z[1];function q(e){M(e.target.files[0])}return l.useEffect(()=>{var e;P(null==S||null===(e=S.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[S]),l.useEffect(()=>{!function(){try{U(null);const e=function(){if(k){const e=function(){if(k.size>=5242880)U(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=dl(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",k,v)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?W(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):U(u("CS_FILE_UPLOAD_ERROR"))})},function(){U(u("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[k]),l.useEffect(()=>{s&&x((e=>{let l=e.t,i=e.action,o=e.selectFile,a=e.uploadedFile,r=e.setUploadedFile,d=e.selectedVendor,u=e.setSelectedVendor,s=e.vendorDescription,c=e.vehicleDescription,v=e.selectVehicle,m=e.setSelectVehicle;return{label:{heading:"RS_"+(null==i?void 0:i.action),submit:"RS_"+(null==i?void 0:i.action),cancel:"CS_COMMON_BACK"},form:[{body:[{label:l("ES_RS_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==i?void 0:i.state)&&"ASSIGN_VEHICLE_DRIVER"!==(null==i?void 0:i.action)?{label:l("RS_ASSIGN"),type:"dropdown",populators:n.createElement(t.Dropdown,{option:s,t:l,optionKey:"i18nKey",select:u,selected:d})}:"null","DELIVERY_PENDING"===(null==i?void 0:i.state)||"ASSIGN_VEHICLE_DRIVER"===(null==i?void 0:i.action)?{label:l("RS_REGISTRATION_NUMBER"),type:"dropdown",populators:n.createElement(t.Dropdown,{option:c,t:l,optionKey:"i18nKey",select:m,selected:v})}:"null",{label:l("ES_RS_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},message:a?"1 "+l("CS_ACTION_FILEUPLOADED"):l("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:u,action:s,selectFile:q,uploadedFile:B,setUploadedFile:W,selectedVendor:j,setSelectedVendor:V,vendorDescription:b?N:void 0,vehicleDescription:I||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)?D:void 0,selectVehicle:K,setSelectVehicle:G}))},[s,L,B,b,K,I]),s&&A.form?n.createElement(t.Modal,{headerBarMain:n.createElement($i,{label:u(A.label.heading)}),headerBarEnd:n.createElement(to,{onClick:m}),actionCancelLabel:u(A.label.cancel),actionCancelOnSubmit:m,actionSaveLabel:u(A.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:A.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comments:null==e?void 0:e.comments,businessService:f,moduleName:g};B&&(t.documents=[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==k?void 0:k.name,fileStoreId:B}]),"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)&&(E.vendorId=null==j?void 0:j.vendorId),"DELIVERY_PENDING"===(null==s?void 0:s.state)&&(E.vehicleId=null==K?void 0:K.vehicleId),"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)&&(E.vehicleId=null==K?void 0:K.vehicleId,E.driverId=null==K?void 0:K.driverId),"watertanker-fixedpoint"===f&&(t.moduleName="request-service.water_tanker",t.businessService="watertanker-fixedpoint");let l="watertanker"===f||"watertanker-fixedpoint"===f?{waterTankerBookingDetail:c({},E,{workflow:t})}:{mobileToiletBookingDetail:c({},E,{workflow:t})};p(l)},defaultValues:O,formId:"modal-action",cardFormClassName:y,cardFormWrapperClassName:h,cardClassName:_,formClassName:T})):n.createElement(t.Loader,null)},no=e=>null!=e&&e.businessService.includes("PT")?n.createElement(vl,e):null!=e&&e.businessService.includes("ptr")?n.createElement(Mi,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")||null!=e&&e.businessService.includes("DIRECTRENEWAL")?n.createElement(fl,e):null!=e&&e.moduleCode.includes("BPAREG")?n.createElement(yl,e):null!=e&&e.moduleCode.includes("BPA")?n.createElement(Nl,e):null!=e&&e.moduleCode.includes("NOC")?n.createElement(Al,e):null!=e&&e.moduleCode.includes("WS")?n.createElement(Li,e):null!=e&&e.businessService.includes("asset-create")?n.createElement(Ui,e):null!=e&&e.businessService.includes("ewst")?n.createElement(Yi,e):null!=e&&e.businessService.includes("booking-refund")?n.createElement(zi,e):null!=e&&e.businessService.includes("street-vending")?n.createElement(Ji,e):null!=e&&e.businessService.includes("watertanker")||null!=e&&e.businessService.includes("mobileToilet")?n.createElement(lo,e):void 0;function io(e){let l=e.documents,o=e.svgStyles,a=void 0===o?{}:o,r=e.isSendBackFlow,d=void 0!==r&&r,u=e.isHrLine,s=void 0!==u&&u,c=e.titleStyles;const v=i.useTranslation().t,m=window.location.href.includes("stakeholder");return n.createElement("div",{style:{marginTop:"19px"}},!m&&(null==l?void 0:l.map((e,i)=>{var o;return n.createElement(n.Fragment,{key:i},null!=e&&e.title?n.createElement(t.CardSubHeader,{style:c||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},v(null==e?void 0:e.title)):null,n.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,l)=>{var i;return n.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:l},n.createElement("div",{style:{display:"flex",justifyContent:"center"}},n.createElement(t.PDFSvg,null)),n.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",color:"#505A5F"}},v(null==e?void 0:e.title)),d?null!=e&&null!==(i=e.documentType)&&void 0!==i&&i.includes("NOC")?n.createElement("p",{style:{textAlign:"center"}},v(null==e?void 0:e.documentType.split(".")[1])):n.createElement("p",{style:{textAlign:"center"}},v(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&n.createElement("div",null,n.createElement("p",null,v("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))),s&&(null==l?void 0:l.length)!=i+1?n.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)})),m&&(null==l?void 0:l.map((e,l)=>{var i;return n.createElement(n.Fragment,{key:l},null!=e&&e.title?n.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},v(null==e?void 0:e.title)):null,n.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,l)=>n.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=a&&a.minWidth?null==a?void 0:a.minWidth:"160px",marginRight:"20px"},key:l},n.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},n.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},v(null==e?void 0:e.title)),null!=e&&e.docInfo?n.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+v(null==e?void 0:e.docInfo)):null,n.createElement(t.PDFSvg,null),n.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+v(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&n.createElement("div",null,n.createElement("p",null,v("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const oo=e=>{var t,i;let o=e.t,a=e.formData,r=e.applicationData,d=e.docs,u=e.bpaActionsDetails;const s=(null==r?void 0:r.status)||"",c=(null==u||null===(t=u.data)||void 0===t?void 0:t.nextActions)||[],v=Digit.ULBService.getStateId(),m=l.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),p=m[0],E=m[1],f=l.useState(null),g=f[0],_=f[1],h=l.useState([]),y=h[0],T=h[1],S=l.useState(!0)[1],b=l.useState(!1),N=b[0],I=b[1],D=l.useState(!1),C=D[0],A=D[1],x=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),O=x.isLoading,w=x.data,L=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),P=L.data;return l.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=w&&null!==(e=w.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==w||null===(o=w.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,l;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(l=r.additionalDetails)||void 0===l?void 0:l.applicationType)}));let u=[];null===(t=i)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{var t,l,n,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==P||null===(t=P["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,o.length);o===l&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==d||null===(n=d[0])||void 0===n||null===(i=n.values)||void 0===i||i.map(t=>{var l,n;o===(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[0])+"."+(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),u.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(u)),T(u)},[!O,!L.isLoading]),l.useEffect(()=>{let e=0;y.map(t=>{let l=!1;p.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(l=!0)}),!l&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(p.length>0))},[p,N]),l.useEffect(()=>{A("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,u]),n.createElement("div",null,null==y?void 0:y.map((e,t)=>n.createElement("div",null,n.createElement(ao,{key:t,index:t,document:e,t:o,error:g,setError:_,setDocuments:E,documents:p,setCheckRequiredFields:I,applicationStatus:s,actions:c,bpaTaxDocuments:y,checkEnablingDocs:C}))))};function ao(e){var i,o;let a=e.t,r=e.document,d=e.setDocuments,u=e.documents,s=e.index,v=e.bpaTaxDocuments,m=e.checkEnablingDocs;const p=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],E=Digit.ULBService.getStateId(),f=l.useState(p?c({},p,{active:!0,code:null==p?void 0:p.documentType,i18nKey:null==p?void 0:p.documentType}):1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),g=f[0],_=f[1],h=l.useState(null),y=h[0],T=h[1],S=l.useState(()=>(null==p?void 0:p.fileStoreId)||null)[0],b=l.useState([]),N=b[0],I=b[1];return l.useEffect(()=>{null!=g&&g.code&&d(e=>{var t;const l=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));return 0===(null==S?void 0:S.length)||null===S?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==S),{documentType:null==g?void 0:g.code,fileStoreId:S,documentUid:S,fileName:(null==y?void 0:y.name)||"",id:u?null===(t=u.find(e=>e.documentType===(null==g?void 0:g.code)))||void 0===t?void 0:t.id:void 0}]})},[S,g]),l.useEffect(()=>{try{N.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],N.map(e=>{var t,l,n;null!=g&&g.code&&r.newUploadedDocs.push({documentType:null==g?void 0:g.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.fileStoreId,tenantId:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.tenantId})}),v[s]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(v)))}catch(e){Promise.reject(e)}},[N,g]),l.useEffect(()=>{},[y]),n.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&n.createElement(io,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),m?n.createElement("div",{style:{marginTop:"20px"}},n.createElement(t.LabelFieldPair,{style:{width:"100%"}},n.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),n.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:g,optionKey:"i18nKey",select:e=>_(e),style:{width:"100%"}})),n.createElement(t.LabelFieldPair,{style:{width:"100%"}},n.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:E,getFormState:e=>((e,t)=>{let l=Object.fromEntries(t),n=Object.values(l);var i;0!==Object.keys(l).length&&I(n),(i=n[n.length-1])&&T(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function ro(e){let l=e.fiReport,o=e.isCitizen,a=void 0!==o&&o;const r=i.useTranslation().t;return n.createElement(n.Fragment,null,n.createElement("div",{style:{marginTop:"10px"}},n.createElement(a?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+r("BPA_FI_REPORT")),l.map((e,i)=>{var o,a,d,u,s,c;return n.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},n.createElement(t.StatusTable,null,n.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==l?void 0:l.length)?""+r("BPA_FI_REPORT"):r("BPA_FI_REPORT")+" - "+(i+1)),n.createElement(t.Row,{className:"border-none",label:""+r("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(o=e.date)||void 0===o?void 0:o.split("-")[2])+"/"+(null===(a=e.date)||void 0===a?void 0:a.split("-")[1])+"/"+(null===(d=e.date)||void 0===d?void 0:d.split("-")[0]):null==e?void 0:e.date:"NA"}),n.createElement(t.Row,{className:"border-none",label:""+r("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(u=e.questions)||void 0===u?void 0:u.length)&&(null==e||null===(s=e.questions)||void 0===s?void 0:s.map(e=>n.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},n.createElement(t.Row,{className:"border-none",label:""+r(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),n.createElement(t.Row,{className:"border-none",label:""+r("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),n.createElement(io,{documents:(c=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==c?void 0:c.map(e=>{var t;return{title:null==e||null===(t=e.documentType)||void 0===t?void 0:t.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function uo(e){let i=e.t,o=e.document,a=e.setNocDocuments,r=e.setError,d=e.nocDocuments;const u=null==d?void 0:d.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],s=Digit.ULBService.getStateId(),c=(l.useState(),l.useState(null)),v=c[0],m=c[1],p=l.useState(()=>(null==u?void 0:u.fileStoreId)||null),E=p[0],f=p[1];return l.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const l=null==e?void 0:e.filter(e=>{var t,l;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.code)});return 0===(null==E?void 0:E.length)||null===E?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==E),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:E,documentUid:E,fileName:(null==v?void 0:v.name)||""}]})},[E]),l.useEffect(()=>{!function(){try{r(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(v.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=dl(function(){return f(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,Digit.ULBService.getStateId())).then(function(e){var t,l,n,o;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?f(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):r(i("CS_FILE_UPLOAD_ERROR"))})},function(){r(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[v]),n.createElement("div",{style:{}},n.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},n.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),l=Object.values(t);var n;(n=l[l.length-1])&&m(n.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const so=e=>{var i;let o=e.t,a=e.noc,r=e.docs,d=e.isNoc,u=e.applicationData,s=e.NOCdata,c=e.bpaActionsDetails;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),m=(null==u?void 0:u.status)||"",p=(null==c||null===(i=c.data)||void 0===i?void 0:i.nextActions)||[],E=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:d}).data,f=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!d}).data,g=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]).data,_=l.useState([]),h=_[0],y=_[1],T=l.useState([]),S=T[0],b=T[1],N=l.useState(!1),I=N[0],D=N[1],C=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),A=C[0],x=C[1],O=l.useState(null),w=O[0],L=O[1],P=window.location.href.includes("/employee/");return l.useEffect(()=>{var e;y(null==g||null===(e=g["common-masters"])||void 0===e?void 0:e.DocumentType)},[g]),l.useEffect(()=>{var e,t,l;let n,i=[];var o,r,s,c;n=d?null==E||null===(o=E.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==f||null===(s=f.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,l;return e.WFState==(null==u?void 0:u.status)&&e.RiskType==(null==u?void 0:u.riskType)&&e.ServiceType==(null==u||null===(t=u.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==u||null===(l=u.additionalDetails)||void 0===l?void 0:l.applicationType)}),null!==(e=n)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(l=t.docTypes)&&void 0!==l&&l[0]&&(n[0].docTypes[0].nocType=n[0].nocType,n[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(n[0].docTypes[0]));let v=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==h||h.forEach(l=>{let n=l.code.slice(0,null==t?void 0:t.length);t===n&&(e.hasDropdown=!0,e.dropdownData.push(l))}),v.push(e)}),b(v))},[E,h]),l.useEffect(()=>{D("NOC_VERIFICATION_INPROGRESS"===m&&(null==p?void 0:p.length)>0)},[u,c]),n.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:P?""+o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),s&&s.map((e,l)=>{if(null!=e&&e.value)return n.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:P?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#2E9E8F"}:{color:"#D83A2F"}}:{className:"border-none",label:P?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),n.createElement(io,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),I&&(null==S?void 0:S.map((e,t)=>n.createElement(uo,{key:t,document:e,t:o,error:w,setError:L,setNocDocuments:x,nocDocuments:A,checkEnablingDocs:I}))))},co=e=>{let i=e.permissions,o=e.t;const a=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),r=a[0],d=a[1],u=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]),s=u[0],v=u[1];l.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const m=window.Digit.Utils.browser.isMobile();return n.createElement("div",null,n.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==r?void 0:r.map((e,l)=>n.createElement(t.CheckBox,{key:l,styles:{margin:"20px 0 40px",maxWidth:m?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,l)=>{const n=e.target.checked;d(()=>null==r?void 0:r.map((e,t)=>l===t?c({},e,{checked:n}):e))})(e,0,l),isLabelFirst:!0,index:l})),null==s?void 0:s.map((e,l)=>n.createElement("div",null,n.createElement(t.TextInput,{key:l,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{v(()=>null==s?void 0:s.map((l,n)=>{var i;return t===n?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:l}))})(e,l),textInputStyle:{maxWidth:m?"96%":"830px",width:m?"96%":"830px"},style:m?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),n.createElement(t.LinkButton,{label:n.createElement("div",null,n.createElement("span",null,n.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:m?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),v([...t])})(l)}))),n.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:m?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{v([...s,{label:""}])}}))};function vo(e){let o=e.documents,a=e.svgStyles,r=void 0===a?{}:a,d=e.isSendBackFlow,u=void 0!==d&&d,s=e.applicationStatus;const v=i.useTranslation().t,m=l.useState(()=>[]),p=m[0],E=m[1],f=(Digit.ULBService.getCurrentTenantId(),l.useState({})),g=f[0],_=f[1],h=l.useState(null),y=h[0],T=h[1],S=l.useState({}),b=S[0],N=S[1];l.useEffect(()=>{let e=0,t=0;null==o||o.forEach(l=>{var n;null==l||null===(n=l.values)||void 0===n||n.forEach(l=>{var n,i,o,a;l.isPhoto||(e++,null!=(n=null!=(i=b[null==l||null===(o=l.originalDoc)||void 0===o?void 0:o.id])?i:null==l||null===(a=l.originalDoc)||void 0===a?void 0:a.isVerified)&&n&&t++)})});const l=!(!s||"PENDING_FOR_DOCUMENT_VERIFICATION"===s)||0===e||t===e;window.isDocumentsVerified=l,window.dispatchEvent(new CustomEvent("DOCUMENTS_VERIFIED",{detail:l}))},[b,o,s]),l.useEffect(()=>{var e;let t=[];null==o||o.forEach(e=>{t=[...t,...e.values?e.values:[]]}),E(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[o]),l.useEffect(()=>{var e;null!=p&&p.length&&"BillAmend"===(null==o||null===(e=o[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(p,Digit.ULBService.getCurrentTenantId()).then(e=>{_(null==e?void 0:e.data)}):null!=p&&p.length&&Digit.UploadServices.Filefetch(p,Digit.ULBService.getStateId()).then(e=>{_(null==e?void 0:e.data)})},[p]);const I=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),D=window.location.href.includes("employee/ws"),C=window.location.href.includes("stakeholder"),A=function(e,t){try{return Promise.resolve(dl(function(){return Promise.resolve(fetch(e)).then(function(e){if(!e.ok)throw new Error("HTTP error! status: "+e.status);return Promise.resolve(e.blob()).then(function(l){const n=e.headers.get("content-type")||l.type,i=window.URL.createObjectURL(l),o=t.replace(/\.[^/.]+$/,"");let a="pdf";n&&(n.includes("image/jpeg")?a="jpg":n.includes("image/png")?a="png":n.includes("image/webp")?a="webp":n.includes("application/pdf")?a="pdf":n.includes("text/plain")&&(a="txt"));const r=document.createElement("a");r.href=i,r.setAttribute("download",o+"."+a),document.body.appendChild(r),r.click(),r.parentNode.removeChild(r),setTimeout(()=>window.URL.revokeObjectURL(i),100)})})},function(t){console.error("Error downloading file",t),window.open(e,"_blank")}))}catch(e){return Promise.reject(e)}};return n.createElement("div",{style:{marginTop:"19px"}},(()=>{if(!y)return null;const e=y.toLowerCase().includes(".pdf")||y.toLowerCase().includes("pdf");return n.createElement(t.Modal,{headerBarMain:n.createElement("h1",{className:"heading-m"},"Document Preview"),headerBarEnd:n.createElement("div",{style:{display:"flex",gap:"15px",alignItems:"center",paddingRight:"10px"}},n.createElement("div",{onClick:()=>{A(y,"Document.pdf")},style:{cursor:"pointer",display:"flex",alignItems:"center"},title:"Download Document"},n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n.createElement("polyline",{points:"7 10 12 15 17 10"}),n.createElement("line",{x1:"12",y1:"15",x2:"12",y2:"3"}))),n.createElement("div",{onClick:()=>T(null),style:{cursor:"pointer",display:"flex",alignItems:"center"}},n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#000000",width:"24px",height:"24px"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),hideSubmit:!0,popupStyles:{maxWidth:"80vw",width:"100%"},popupModuleMianStyles:{display:"flex",justifyContent:"center",alignItems:"center",padding:"0",overflowY:"hidden"}},e?n.createElement("iframe",{src:y,title:"Document Preview",style:{width:"100%",height:"80vh",border:"none",display:"block"}}):n.createElement("img",{src:y,alt:"Document Preview",style:{maxWidth:"100%",maxHeight:"80vh",objectFit:"contain",display:"block"}}))})(),!C&&(null==o?void 0:o.map((e,l)=>{var i;return n.createElement(n.Fragment,{key:l},null!=e&&e.title?n.createElement(t.CardSubHeader,{style:I?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},v(null==e?void 0:e.title)):null,D?n.createElement("div",{style:{marginTop:"8px"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?e.values.map((e,l)=>((e,l)=>{var i;const o=null===(i=g[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],a=(e=>{if(!e)return"";const t=e.split(".");return(t[t.length-1]||"").replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())})(null==e?void 0:e.documentType),r=(null==e?void 0:e.documentUid)||"",d=null==e?void 0:e.isPhoto;let u="",m="",p="";return"WS_IDENTITY_PROOF"===e.title?(u="Identity Proof*",m="Identity Proof Document Number",p="Upload Identity Proof Document*"):"WS_OWNERSHIP_PROOF"===e.title?(u="Ownership Proof*",m="Ownership Proof Document Number",p="Upload Ownership Proof*"):"WS_OTHER_DOCUMENTS"===e.title?(u="Other Documents*",m="Other Document Number",p="Upload Other Documents*"):"WS_APPLICANT_PHOTO"===e.title?p="Upload Applicant Photo*":(u=((null==e?void 0:e.categoryLabel)||"Document")+"*",m="Document Number",p="Upload Document*"),n.createElement("div",{key:l,style:{marginBottom:"24px"}},n.createElement(t.StatusTable,null,!d&&n.createElement(n.Fragment,null,n.createElement(t.Row,{label:u,text:a||v("NA")}),n.createElement(t.Row,{label:m,text:r||v("NA")})),n.createElement(t.Row,{label:p,text:n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"16px"}},d?o?n.createElement("div",{style:{position:"relative"}},n.createElement("img",{src:o,alt:"Applicant Photo",style:{width:"100px",height:"100px",objectFit:"cover",borderRadius:"4px",border:"1px solid #ccc"}})):n.createElement("div",{style:{fontSize:"14px",color:"#505A5F"}},v("NA")):n.createElement("div",{onClick:()=>{o&&T(o)},disabled:!o,style:{cursor:"pointer"}},n.createElement(t.ViewsIcon,null)),!d&&n.createElement(n.Fragment,null,n.createElement("div",{onClick:()=>{o&&A(o,(a||"Document")+".pdf")},title:"Download Document",style:{cursor:"pointer",display:"flex",alignItems:"center"}},n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n.createElement("polyline",{points:"7 10 12 15 17 10"}),n.createElement("line",{x1:"12",y1:"15",x2:"12",y2:"3"}))),n.createElement("label",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"14px",color:"#0B0C0C",margin:0}},n.createElement("input",{key:"chk-"+(null==e||null===(E=e.originalDoc)||void 0===E?void 0:E.id)+"-"+(null==e||null===(f=e.originalDoc)||void 0===f?void 0:f.isVerified),type:"checkbox",className:"verify-doc-checkbox",style:{width:"18px",height:"18px",accentColor:"#F47738",cursor:s&&"PENDING_FOR_DOCUMENT_VERIFICATION"!==s?"not-allowed":"pointer"},disabled:s&&"PENDING_FOR_DOCUMENT_VERIFICATION"!==s,defaultChecked:null==e||null===(_=e.originalDoc)||void 0===_?void 0:_.isVerified,onChange:t=>{var l;const n=t.target.checked;null!=e&&e.originalDoc&&(e.originalDoc.isVerified=n),null!=e&&null!==(l=e.originalDoc)&&void 0!==l&&l.id&&N(t=>c({},t,{[e.originalDoc.id]:n}))}}),"Check Verified")))})));var E,f,_})(e,l)):!window.location.href.includes("citizen")&&n.createElement("div",null,n.createElement("p",null,v("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))):n.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i,o;return n.createElement("a",{target:"_",href:null===(i=g[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:l},n.createElement("div",{style:{display:"flex",justifyContent:"center"}},n.createElement(t.PDFSvg,null)),n.createElement("p",{style:I?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},v(null==e?void 0:e.title)),u?null!=e&&null!==(o=e.documentType)&&void 0!==o&&o.includes("NOC")?n.createElement("p",{style:{textAlign:"center"}},v(null==e?void 0:e.documentType.split(".")[1])):n.createElement("p",{style:{textAlign:"center"}},v(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&n.createElement("div",null,n.createElement("p",null,v("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),C&&(null==o?void 0:o.map((e,l)=>{var i;return n.createElement(n.Fragment,{key:l},null!=e&&e.title?n.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},v(null==e?void 0:e.title)):null,n.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return n.createElement("a",{target:"_",href:null===(i=g[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:null!=r&&r.minWidth?null==r?void 0:r.minWidth:"160px",marginRight:"20px"},key:l},n.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},n.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},v(null==e?void 0:e.title)),null!=e&&e.docInfo?n.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+v(null==e?void 0:e.docInfo)):null,n.createElement(t.PDFSvg,null),n.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},""+v(null==e?void 0:e.title))))}):!window.location.href.includes("citizen")&&n.createElement("div",null,n.createElement("p",null,v("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function mo(e){let l=e.taxHeadEstimatesCalculation;const o=l.taxHeadEstimates,a=i.useTranslation().t;return n.createElement("div",{style:{marginTop:"40px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),n.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==o?void 0:o.map((e,l)=>n.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:l===(null==o?void 0:o.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),n.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),n.createElement(t.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==l?void 0:l.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function po(e){let l=e.floors;const o=i.useTranslation().t;return n.createElement(n.Fragment,null,l.map(e=>{var l;return n.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},o(null==e?void 0:e.title)),null==e||null===(l=e.values)||void 0===l?void 0:l.map((e,l)=>{var i;return n.createElement(n.Fragment,{key:l},n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==l?"16px":"revert"}},o(e.title)),n.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},n.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:n.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title),text:o(e.value)||"N/A",last:l===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}const Eo=e=>{var o,a,r;let d=e.scrutinyDetails;const u=i.useTranslation().t,s=e=>null!=e&&e.value&&null!=e&&e.isTransLate?n.createElement("span",{style:{color:"#2E9E8F"}},u(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?u(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void u("NA");return n.createElement(l.Fragment,null,!(null!=d&&d.isChecklist)&&n.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},n.createElement(t.StatusTable,null,n.createElement("div",null,null==d||null===(o=d.values)||void 0===o?void 0:o.map((e,l)=>null!=e&&e.isUnit?n.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red"}:{},key:""+e.title,label:""+u(""+e.title),text:null!=e&&e.value?s(e)+" "+u(null==e?void 0:e.isUnit):u("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?n.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen",wordBreak:"break-all"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red",wordBreak:"break-all"}:{wordBreak:"break-all"},key:""+e.title,label:""+u(""+e.title),text:s(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},u(null==e?void 0:e.title)):n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},u(null==e?void 0:e.title))),null==d||null===(a=d.permit)||void 0===a?void 0:a.map((e,l)=>n.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),n.createElement("div",null,null==d||null===(r=d.scruntinyDetails)||void 0===r?void 0:r.map((e,i)=>n.createElement(l.Fragment,null,n.createElement(t.Row,{className:"border-none",label:""+u(null==e?void 0:e.title),labelStyle:{width:"150%"}}),n.createElement("a",{href:null==e?void 0:e.value}," ",n.createElement(t.PDFSvg,null)," "),n.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},u(null==e?void 0:e.text))))))))},fo=e=>{var o,a,r,d,u;let s=e.edcrDetails,c=e.applicationData;const v=i.useTranslation().t,m=window.Digit.Utils.browser.isMobile(),p=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],E=e=>{const t=e;return(e,l,n)=>e[t]},f=l.useMemo(()=>p.map(e=>({Header:v(""+e.name),accessor:E(e.id),id:e.id})));function g(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,d,u;l.push({Floor:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(d=e.occupancies)||void 0===d||null===(u=d[0])||void 0===u?void 0:u.CarpetArea)||0,key:v("BPA_FLOOR_NAME_"+e.number)})}),l}function _(e){var t;let l=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,n="";if((null==l?void 0:l.length)>0){var i,o;let t=null===(i=l[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(n=t.map(e=>e?""+v("BPA_SUBOCCUPANCYTYPE_"+function(e,t,l){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===l&&(l=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,l);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return n||"NA"}return n.createElement(l.Fragment,null,n.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},n.createElement(t.StatusTable,null,null==s||null===(o=s.values)||void 0===o?void 0:o.map((e,l)=>null!=e&&e.isHeader?n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},v(null==e?void 0:e.title)):n.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+v(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==s||null===(a=s.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(d=r.value)||void 0===d||null===(u=d.planDetail)||void 0===u?void 0:u.blocks.map((e,l)=>{var i,o,a,r,d;return n.createElement("div",{key:l,style:(null==s||null===(i=s.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(d=r.blocks)||void 0===d?void 0:d.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},v("BPA_BLOCK_SUBHEADER")," ",l+1),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+v("BPA_SUB_OCCUPANCY_LABEL"),text:_(l)})),n.createElement("div",{style:window.location.href.includes("citizen")||m?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},n.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:v,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:g(e),columns:f,getCellProps:e=>({style:{}})})))})))},go=e=>{let t=e.otherComment;return n.createElement("div",{className:"checkpoint-comments-wrap"},n.createElement("h4",null,e.headComment),n.createElement("p",null,t))},_o=e=>{var l,o,a;let r=e.data,d=e.OpenImage,u=e.privacy,s=void 0===u?{}:u;const c=i.useTranslation().t;return n.createElement("div",null,r.date&&n.createElement("p",null,r.date),n.createElement("p",null,r.name),r.mobileNumber&&n.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},n.createElement(t.TelePhone,{mobile:r.mobileNumber,privacy:s}),n.createElement("p",null,"    ")),r.source&&n.createElement("p",null,c("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),r.comment&&n.createElement(go,{otherComment:null==r?void 0:r.otherComment,headComment:null==r?void 0:r.comment}),null!=r&&r.wfComment?n.createElement("div",null,null==r||null===(l=r.wfComment)||void 0===l?void 0:l.map((e,t)=>n.createElement("div",{className:"TLComments",key:t},n.createElement("h3",null,c("WF_COMMON_COMMENTS")),n.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(o=r.thumbnailsToShow)||void 0===o||null===(a=o.thumbs)||void 0===a?void 0:a.length)>0?n.createElement("div",{className:"TLComments"},n.createElement("h3",null,c("CS_COMMON_ATTACHMENTS")),n.createElement(t.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:(e,t)=>{d(e,t,null==r?void 0:r.thumbnailsToShow)}})):null)};function ho(e){let l=e.units;const o=i.useTranslation().t;return n.createElement(n.Fragment,null,l.map((e,l)=>{var i;return n.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},o(null==e?void 0:e.title)+" "+(l+1)),n.createElement(n.Fragment,{key:l},n.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},n.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:n.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"N/A",last:l===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function yo(e){let l=e.units;const o=i.useTranslation().t;return n.createElement(n.Fragment,null,l.map((e,l)=>{var i;return n.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},o(null==e?void 0:e.title)+" "+(l+1)),n.createElement(n.Fragment,{key:l},n.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},n.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:n.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"NA",last:l===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const To=e=>{var l;let o=e.wsAdditionalDetails;const a=i.useTranslation().t;(r=location.search)&&(/^[?#]/.test(r)?r.slice(1):r).split("&").reduce((e,t)=>{let l=t.split("="),n=l[1];return e[l[0]]=n?decodeURIComponent(n.replace(/\+/g," ")):"",e},{});var r,d=((null==o?void 0:o.additionalDetails)||{connectionDetails:[],plumberDetails:[]}).connectionDetails;return n.createElement(n.Fragment,null,n.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==o||null===(l=o.additionalDetails)||void 0===l?void 0:l.connectionDetails)&&n.createElement(t.StatusTable,null,n.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},a("WS_COMMON_CONNECTION_DETAIL")),n.createElement("div",null,n.createElement("div",{className:"connection-details-new-value-wrapper"},null==d?void 0:d.map((e,l)=>n.createElement("div",{key:l},n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+a(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""}))))))))},So=[{title:"PT_PENDING_DUES_FROM_EARLIER",value:"Pending dues from earlier"},{title:"PT_MISCALCULATION_OF_EARLIER_ASSESSMENT",value:"Miscalculation of earlier Assessment"},{title:"PT_ONE_TIME_PENALITY",value:"One time penality"},{title:"PT_OTHERS",value:"Others"}],bo=[{title:"PT_ADVANCED_PAID_BY_CITIZEN_EARLIER",value:"Advanced Paid By Citizen Earlier"},{title:"PT_REBATE_PROVIDED_BY_COMMISSIONER_EO",value:"Rebate provided by commissioner/EO"},{title:"PT_ADDITIONAL_AMOUNT_CHARGED_FROM_THE_CITIZEN",value:"Additional amount charged from the citizen"},{title:"PT_OTHERS",value:"Others"}],No=e=>{var o,a,r,d;let u=e.wsAdditionalDetails;const s=i.useTranslation().t,v=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),m=v[0],p=v[1],E=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{})[1],f=!(null==u||null===(o=u.additionalDetails)||void 0===o||!o.isPaid),g=l.useState(!1),h=g[0],y=g[1],T=l.useState(m||{}),S=T[0],b=T[1],N=l.useState(null),I=N[0],D=N[1],C=l.useState(u.additionalDetails.data?u.additionalDetails.data:{}),A=C[0],x=C[1],O=l.useState(u.additionalDetails.values?u.additionalDetails.values:[]),w=O[0],L=O[1],P=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(P,"BillingService",["TaxHeadMaster"]),l.useEffect(()=>{var e,t,l;const i=c({},null==u||null===(e=u.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==m||null===(l=m.billDetails)||void 0===l?void 0:l.length)>0){var o,a,r,d,s,v,E;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:n.createElement("span",null,"₹",null==m||null===(o=m.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:n.createElement("span",null,"₹",null==m||null===(r=m.billDetails)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.charge)},{title:"WS_TAX_HEADER",value:n.createElement("span",null,"₹",null==m||null===(s=m.billDetails)||void 0===s||null===(v=s[0])||void 0===v?void 0:v.taxAmount)}];L(e),x(null==m||null===(E=m.billDetails)||void 0===E?void 0:E[0])}else p(i),b(i)},[]);let R={};const k=e=>n.createElement("h1",{className:"heading-m"},e.label),M=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),F=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(M,null)),B=function(e,t,l){void 0===t&&(t=!1);let n=c({},S);if("adhocPenalty"!=e&&"adhocRebate"!=e||!l.target.value)t?(n[e+"_data"]=l,n[e]=l.title,"PT_OTHERS"==l.title&&"adhocPenaltyReason"==e&&(n.adhocPenaltyComment=""),"PT_OTHERS"==l.title&&"adhocRebateReason"==e&&(n.adhocRebateComment="")):n[e]=l.target.value;else{var i,o;const t=0==(null==l||null===(i=l.target)||void 0===i?void 0:i.value)?1:Math.sign(null==l||null===(o=l.target)||void 0===o?void 0:o.value)||-1;n[e]=1==t?l.target.value:""}b(n)};return n.createElement(l.Fragment,null,n.createElement("div",{style:{lineHeight:"19px",maxWidth:"100%",minWidth:"280px"}},w&&n.createElement(t.StatusTable,null,n.createElement("div",null,null==w?void 0:w.map((e,l)=>n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),n.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),n.createElement("div",null,n.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+s("WS_COMMON_TOTAL_AMT"),text:n.createElement("span",null,"₹",(null==A?void 0:A.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),n.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+s("CS_INBOX_STATUS_FILTER"),text:s(f?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:f?{color:"#2E9E8F"}:{color:"#D83A2F"}}))),null!=u&&null!==(a=u.additionalDetails)&&void 0!==a&&a.isAdhocRebate?n.createElement("div",{onClick:e=>{y(!0)}},n.createElement("span",{className:"add-details-link hover-button",style:{cursor:"pointer",color:"#a82227"}},s("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,h&&n.createElement(t.Modal,{headerBarMain:n.createElement(k,{label:s("PT_ADD_REBATE_PENALITY")}),headerBarEnd:n.createElement(F,{onClick:()=>{b(m),y(!1)}}),actionCancelLabel:s("PT_CANCEL"),actionCancelOnSubmit:()=>{b(m),y(!1)},actionSaveLabel:s("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=S&&S.adhocPenalty?Number(null==S?void 0:S.adhocPenalty):0,l=null!=S&&S.adhocRebate?Number(null==S?void 0:S.adhocRebate):0;var n,i;if(t||l)if(l>(null==u||null===(n=u.additionalDetails)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.totalAmount))D({isError:!1,isWarning:!0,key:"error",message:s("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,d,v,m,f,g,h,T;const e=null==u||null===(o=u.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==u||null===(r=u.additionalDetails)||void 0===r||null===(d=r.appDetails)||void 0===d?void 0:d.tenantId,l=c({},null==u||null===(v=u.additionalDetails)||void 0===v||null===(m=v.appDetails)||void 0===m?void 0:m.additionalDetails,S);u.additionalDetails.appDetails.additionalDetails=l;const n={CalculationCriteria:"WATER"==(null==u||null===(f=u.additionalDetails)||void 0===f||null===(g=f.appDetails)||void 0===g?void 0:g.service)?[{applicationNo:e,tenantId:t,waterConnection:u.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:u.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==u||null===(h=u.additionalDetails)||void 0===h||null===(T=h.appDetails)||void 0===T?void 0:T.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(n,i).then((e,t)=>{var l,n,i,o,a,r,d,u,s,c,v,m,f,g,h;(null==e||null===(l=e.Calculation)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(g=f[0])||void 0===g||null===(h=g.taxHeadEstimates)||void 0===h||h.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const T=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(u=e.Calculation)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.taxAmount}];E(Ci(e.Calculation[0])),x(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),L(T),S.billDetails=null==e?void 0:e.Calculation,p(S),y(!1)}).catch(e=>{var t,l,n,i,o,a;D({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(n=l.Errors[0])&&void 0!==n&&n.message?s(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):s("PT_COMMON_ADD_REBATE_PENALITY")})})}else D({isError:!1,isWarning:!0,key:"warning",message:s("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto",background:"#f0f3f7"}},n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},n.createElement(t.Card,null,n.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_PENALTY")),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,s("PT_TX_HEADS")),n.createElement("div",{className:"field"},n.createElement(t.Dropdown,{isMandatory:!0,option:So,optionKey:"title",select:e=>B("adhocPenaltyReason",!0,e),selected:(null==S?void 0:S.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:s}))),"PT_OTHERS"===(null==S||null===(r=S.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,s("PT_REASON")),n.createElement("div",{className:"field"},n.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==S?void 0:S.adhocPenaltyComment)||"",onChange:e=>B("adhocPenaltyComment",!1,e)},R={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")})))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),n.createElement("div",{className:"field"},n.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==S?void 0:S.adhocPenalty)||"",onChange:e=>B("adhocPenalty",!1,e)},R={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")}))))),n.createElement(t.Card,null,n.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_REBATE")),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,s("PT_TX_HEADS")),n.createElement("div",{className:"field"},n.createElement(t.Dropdown,{isMandatory:!0,option:bo,optionKey:"title",select:e=>B("adhocRebateReason",!0,e),selected:(null==S?void 0:S.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:s}))),"PT_OTHERS"===(null==S||null===(d=S.adhocRebateReason_data)||void 0===d?void 0:d.title)&&n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,s("PT_REASON")),n.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==S?void 0:S.adhocRebateComment)||"",onChange:e=>B("adhocRebateComment",!1,e)},R={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")}))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),n.createElement("div",{className:"field"},n.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==S?void 0:S.adhocRebate)||"",onChange:e=>B("adhocRebate",!1,e)},R={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")}))))))),I&&n.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==I?void 0:I.isWarning,error:null==I||!I.isWarning,label:s(null==I?void 0:I.message),onClose:()=>{D(!1)},isDleteBtn:!0})))},Io=e=>n.createElement("span",null,n.createElement("svg",{style:c({},e.style),display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"}))),Do=e=>{let l=e.t,i=e.userType,o=void 0!==i&&i,a=e.infoBannerLabel,r=void 0===a?"":a,d=e.infoClickLable,u=void 0===d?"":d,s=e.infoClickInfoLabel,c=void 0===s?"":s,v=e.infoClickInfoLabel1,m=void 0===v?"":v;o=o||Digit.SessionStorage.get("userType");const p=window.Digit.Utils.browser.isMobile();return n.createElement(n.Fragment,null,n.createElement("div",{style:p?{}:{width:"80%"}},n.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},n.createElement("div",null,n.createElement(t.InfoBannerIcon,null),n.createElement("h2",{style:{color:"#3498DB"}},l(r))),l(u)+" ",n.createElement(Io,{style:{display:"inline",marginBottom:"5px"}})," "+l(c),n.createElement("div",null," "+l(m)))))},Co=e=>{var o,a,r,d,u,s,c;let v=e.wsAdditionalDetails;const m=i.useTranslation().t,p=l.useState(!1),E=p[0],f=p[1],g=l.useState({}),_=g[0],h=g[1],y=e=>n.createElement("h1",{className:"heading-m"},e.label),T=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),S=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(T,null));return n.createElement(l.Fragment,null,n.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=v&&null!==(o=v.additionalDetails)&&void 0!==o&&o.isViewBreakup?n.createElement("div",{onClick:e=>(()=>{var e;let t=v.additionalDetails.data||{};const l=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),n=l?JSON.parse(l):{};null!=n&&null!==(e=n.value)&&void 0!==e&&e.totalAmount&&(t=null==n?void 0:n.value),h(t),f(!0)})(),style:{marginTop:"12px"}},n.createElement("span",{className:"add-details-link hover-button"},m("WS_PAYMENT_VIEW_BREAKUP"))):null,E&&n.createElement(t.Modal,{headerBarMain:n.createElement(y,{label:m("WS_CALCULATION_BREAKUP")}),headerBarEnd:n.createElement(S,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},n.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},n.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_APPLICATION_FEE_HEADER")),null==_||null===(a=_.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:n.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),n.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:n.createElement("span",null,"₹",Number(null==_?void 0:_.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),n.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_SERVICE_FEE_HEADER")),null==_||null===(d=_.billSlabData)||void 0===d||null===(u=d.CHARGES)||void 0===u?void 0:u.map(e=>n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:n.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),n.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:n.createElement("span",null,"₹",Number(null==_?void 0:_.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==_||null===(s=_.billSlabData)||void 0===s||null===(c=s.TAX)||void 0===c?void 0:c.map(e=>n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:n.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),n.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:n.createElement("span",null,"₹",Number(null==_?void 0:_.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Ao={root:{width:"100%",marginTop:"2px",overflowX:"auto",boxShadow:"none"},table:{minWidth:700,backgroundColor:"rgba(250, 250, 250, var(--bg-opacity))"},cell:{maxWidth:"7em",minWidth:"1em",border:"1px solid #e8e7e6",padding:"4px 5px",fontSize:"0.8em",textAlign:"left",lineHeight:"1.5em"},cellHeader:{overflow:"hidden",textOverflow:"ellipsis"},cellLeft:{},cellRight:{}},xo=e=>{let t=e.headers,l=void 0===t?[]:t,o=e.values,a=void 0===o?[]:o,r=e.arrears,d=void 0===r?0:r;const u=i.useTranslation().t;return n.createElement(n.Fragment,null,n.createElement("div",{style:Ao.root},n.createElement("table",{className:"table-fixed-column-common-pay",style:Ao.table},n.createElement("thead",null,n.createElement("tr",null,n.createElement("th",{style:c({},Ao.cell,Ao.cellLeft,Ao.cellHeader)},u("CS_BILL_PERIOD")),l.map((e,t)=>n.createElement("th",{style:c({},Ao.cell,l.length==t+1?Ao.cellRight:{},Ao.cellHeader),key:t},u(e))))),n.createElement("tbody",null,Object.values(a).map((e,t)=>n.createElement("tr",{key:t},n.createElement("td",{style:c({},Ao.cell,Ao.cellLeft),component:"th",scope:"row"},Object.keys(a)[t]),l.map((t,i)=>n.createElement("td",{style:c({},Ao.cell,{textAlign:"left"},l.length==i+1?Ao.cellRight:{},{whiteSpace:"pre"}),key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),n.createElement("tr",null,n.createElement("td",{style:c({},Ao.cell,Ao.cellLeft)}),l.map((e,t)=>t==l.length-1?n.createElement("td",{style:c({},Ao.cell,Ao.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},d):t==l.length-2?n.createElement("td",{style:c({},Ao.cell,{textAlign:"left"}),key:t,numeric:!0},u("COMMON_ARREARS_TOTAL")):n.createElement("td",{style:Ao.cell,key:t,numeric:!0})))))))},Oo={buttonStyle:{display:"flex",justifyContent:"flex-end",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},wo=e=>{var t,o,a;let r=e.bill,d=void 0===r?{}:r;const u=i.useTranslation().t;let s={},c=(null==d||null===(t=d.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];c=[...c];const v=(null===(o=c)||void 0===o?void 0:o.reduce((e,t,l)=>0===l?e:e+t.amount,0))||0;let m="₹ "+((null==v||null===(a=v.toFixed)||void 0===a?void 0:a.call(v,0))||Number(0).toFixed(0));c.shift(),c.map(e=>{let t=function(e){var t,l,n;void 0===e&&(e={});let i={};const o=e.billAccountDetails;return(void 0===o?[]:o).map(e=>{i[e.taxHeadCode]={value:e.amount,order:e.order}}),i.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},i.CS_BILL_DUEDATE={value:(null===(l=e)||void 0===l?void 0:l.expiryDate)&&new Date(null===(n=e)||void 0===n?void 0:n.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);s[((e,t)=>{const l=new Date(e),n=new Date(t);return n.getYear()-l.getYear()!=0?"FY"+(l.getYear()+1900)+"-"+(n.getYear()-100):l.toLocaleDateString()+"-"+n.toLocaleDateString()})(e.fromPeriod,e.toPeriod)]=t});let p={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{p[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let E=[];E=Object.keys(p),E.sort((e,t)=>p[e]-p[t]);const f=l.useState(!1),g=f[0],_=f[1];return 0==v||v<0?n.createElement("span",null):n.createElement(n.Fragment,null,n.createElement("div",{style:Oo.headerStyle},u("CS_ARREARS_DETAILS")),g&&n.createElement(xo,{headers:[...E],values:s,arrears:m}),!g&&n.createElement("div",{style:Oo.buttonStyle},n.createElement("button",{type:"button",onClick:()=>{_(!0)}},u("CS_SHOW_CARD"))),g&&n.createElement("div",{style:Oo.buttonStyle},n.createElement("button",{type:"button",onClick:()=>{_(!1)}},u("CS_HIDE_CARD"))))},Lo=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Po=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Lo,null)),Ro=e=>{let l=e.t,i=e.closeModal;console.log(" ----- Renew POP coming "),Digit.Hooks.sv.useCreateDemand();const a=o.useHistory();return n.createElement(n.Fragment,null,n.createElement(t.Modal,{headerBarMain:n.createElement(e=>n.createElement("h1",{className:"heading-m"},e.label),{label:"SV_WANT_TO_EDIT"}),headerBarEnd:n.createElement(Po,{onClick:i}),actionCancelLabel:l("CS_COMMON_BACK"),actionCancelOnSubmit:i,hideSubmit:!0,formId:"modal-action"},n.createElement(t.Card,{style:{boxShadow:"none"}},n.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},n.createElement(t.SubmitBar,{label:l("SV_YES_PROCEED_WITH_APPLICATION"),onSubmit:()=>{a.push("renew-application/info")}}),n.createElement(t.SubmitBar,{label:l("SV_NO_PROCEED_PAYEMNT"),onSubmit:()=>{console.log(" testing coming compilter"),a.push("renew-application/check/makePayment")}})))))},ko=e=>{let o=e.applicationData;const a=i.useTranslation().t,r=l.useState(""),d=r[0],u=r[1],s=l.useState([]),c=s[0],v=s[1],m=l.useMemo(()=>[{Header:a("K No."),accessor:"kno"},{Header:a("Full Name"),accessor:"fullName"},{Header:a("Full Address"),accessor:"fullAddress"},{Header:a("Due Amount"),accessor:"dueAmount"},{Header:a("Total Amount"),accessor:"totalAmount"}],[a]);return l.useEffect(()=>{const e=sessionStorage.getItem("Digit.DUE_VERIFICATION_DATA");if(e)try{v(JSON.parse(e))}catch(e){console.error("Error parsing due verification data",e)}else null!=o&&o.dueVerification&&Array.isArray(o.dueVerification)&&(v(o.dueVerification),sessionStorage.setItem("Digit.DUE_VERIFICATION_DATA",JSON.stringify(o.dueVerification)))},[o]),n.createElement("div",{style:{marginBottom:"20px"}},n.createElement("h2",{style:{fontSize:"24px",fontWeight:"bold",marginBottom:"16px"}},a("Due Verification")),n.createElement("div",{style:{display:"flex",alignItems:"flex-end",gap:"20px",marginBottom:"20px"}},n.createElement("div",{style:{flex:1}},n.createElement("span",{style:{fontSize:"16px",color:"#0B0C0C",marginBottom:"8px",display:"inline-block"}},a("K No.(Existing KNo of same property)")," ",n.createElement("span",{style:{color:"red"}},"*")),n.createElement(t.TextInput,{type:"number",value:d,onChange:e=>u(e.target.value),style:{width:"100%",marginBottom:"0"}})),n.createElement("div",{style:{flex:1,paddingBottom:"2px"}},n.createElement("button",{type:"button",onClick:()=>{if(d){const e={kno:d,fullName:"John Doe",fullAddress:"123 Main St, New Delhi, Delhi 110001",dueAmount:"1500",totalAmount:"1500"},t=[...c,e];v(t),sessionStorage.setItem("Digit.DUE_VERIFICATION_DATA",JSON.stringify(t)),u("")}},style:{background:"linear-gradient(135deg, #1f5fa8, #0b2e5b)",padding:"8px 24px",borderRadius:"4px",border:"none",cursor:"pointer"}},n.createElement(t.AddIcon,null)))),c.length>0&&n.createElement("div",{style:{marginTop:"30px",overflowX:"auto"}},n.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:a,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,data:c,columns:m,getCellProps:e=>({style:{padding:"12px"}})})))},Mo=()=>{const e=i.useTranslation().t,o=l.useState(null),a=o[0],r=o[1],d=l.useState(""),u=d[0],s=d[1],c=l.useState(""),v=c[0],m=c[1];return n.createElement("div",{style:{marginBottom:"20px"}},n.createElement("h2",{style:{fontSize:"24px",fontWeight:"bold",marginBottom:"16px"}},e("Inspection Information")),n.createElement("div",{style:{display:"flex",gap:"20px",marginBottom:"20px",flexWrap:"wrap"}},n.createElement("div",{style:{flex:"1"}},n.createElement("span",{style:{fontSize:"16px",color:"#0B0C0C",marginBottom:"8px",display:"inline-block"}},e("Inspection Type")," ",n.createElement("span",{style:{color:"red"}},"*")),n.createElement(t.Dropdown,{option:[{name:"Select",code:""}],optionKey:"name",id:"inspectionType",selected:a,select:r,t:e,style:{width:"100%"}})),n.createElement("div",{style:{flex:"1"}},n.createElement("span",{style:{fontSize:"16px",color:"#0B0C0C",marginBottom:"8px",display:"inline-block"}},e("Inspection Date")," ",n.createElement("span",{style:{color:"red"}},"*")),n.createElement(t.DatePicker,{date:u,onChange:s,style:{width:"100%"}}))),n.createElement("div",{style:{display:"flex",gap:"20px",marginBottom:"20px",flexWrap:"wrap"}},n.createElement("div",{style:{flex:"1"}},n.createElement("span",{style:{fontSize:"16px",color:"#0B0C0C",marginBottom:"8px",display:"inline-block"}},e("Inspector Name")," ",n.createElement("span",{style:{color:"red"}},"*")),n.createElement(t.TextInput,{value:v,onChange:e=>m(e.target.value),style:{width:"50%",marginBottom:"0"}}))))};function Fo(e){var a,r,d,u,s,c,v,m,p,E,f,g,h,y;let T=e.applicationDetails,S=e.workflowDetails,b=e.isDataLoading,N=e.applicationData,I=e.timelineStatusPrefix,D=e.showTimeLine,C=void 0===D||D,A=e.statusAttribute,x=void 0===A?"status":A,O=e.paymentsList,w=e.oldValue,L=e.isInfoLabel,P=void 0!==L&&L;const R=i.useTranslation().t,k=l.useState(!1),M=k[0],F=k[1];let B=o.useParams().id;function W(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}const U=l.useState({}),H=U[0],j=U[1],V=l.useState({loading:!1,loaded:!1,canLoad:!1}),z=V[0],K=V[1];"ACTIVE"!==(null==N?void 0:N.status)||z.loading||z.loaded||z.canLoad||K({loading:!1,loaded:!1,canLoad:!0}),null==z||!z.canLoad||z.loading||z.loaded||(K({loading:!0,loaded:!1,canLoad:!0}),function(e,t,l,n){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){l(a),n({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(l){if((null==i||null===(l=i.Assessments)||void 0===l?void 0:l.length)>0)return Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==N?void 0:N.tenantId)||tenantId,null==N?void 0:N.propertyId,j,K));const G=e=>{if(null==e||void 0===e||""===e)return"NA";const t=new Date(e);let l=t.getMonth()+1,n=t.getDate();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,n+"/"+l+"/"+t.getFullYear()},q=function(e,t,l){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:G(null==N||null===(i=N.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==N?void 0:N.channel)||""};return n.createElement(_o,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,d,u,s,c,v,m,p,E,f,g,h,y,S,b,I;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==T?void 0:T.tenantId,businessIds:null==T?void 0:T.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let l="";return l="+91 "+_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber"),l}}},D=l[t-1],C={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:null==e||null===(d=e.assignes)||void 0===d||null===(u=d[0])||void 0===u?void 0:u.name,mobileNumber:(null==N||null===(s=N.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.uuid)===(null==e||null===(m=e.assignes)||void 0===m||null===(p=m[0])||void 0===p?void 0:p.uuid)&&null!=N&&null!==(E=N.processInstance)&&void 0!==E&&null!==(f=E.assignes)&&void 0!==f&&null!==(g=f[0])&&void 0!==g&&g.mobileNumber?null==N||null===(h=N.processInstance)||void 0===h||null===(y=h.assignes)||void 0===y||null===(S=y[0])||void 0===S?void 0:S.mobileNumber:null==e||null===(b=e.assignes)||void 0===b||null===(I=b[0])||void 0===I?void 0:I.mobileNumber,comment:R(null==e?void 0:e.comment),wfComment:D?D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return n.createElement(_o,{data:C,OpenImage:W,privacy:i})}{var D,C,A,x,O;const t={date:G(null==N||null===(D=N.auditDetails)||void 0===D?void 0:D.lastModifiedTime),name:null==e||null===(C=e.assignes)||void 0===C||null===(A=C[0])||void 0===A?void 0:A.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(x=e.assignes)||void 0===x||null===(O=x[0])||void 0===O?void 0:O.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return n.createElement(_o,{data:t,OpenImage:W})}},Y=(e,t)=>e?t?e:R(e):R("NA"),X=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),Q=window.location.href.includes("employee/noc"),Z=window.location.href.includes("employee/obps"),J=()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||X?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{},$=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?Y(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+R(null==e?void 0:e.isUnit):R("N/A"):null!=e&&e.value?Y(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):R("N/A"),ee=l.useState(!1),te=ee[0],le=ee[1];return n.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},P?n.createElement(Do,{t:R,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==T||null===(a=T.applicationDetails)||void 0===a?void 0:a.map((e,l)=>{var i,a,r,d,u,s,c,v,m,p,E,f,g,_,h,y,b,I,D,C,A,x,L,P,k,M,W,U,j,V,z,K,G,q,Y,ee,te,le,ne,ie;return n.createElement(n.Fragment,{key:l},n.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")||X?{lineHeight:"19px",maxWidth:"100%",minWidth:"280px"}:{}},(null==e||null===(i=e.title)||void 0===i?void 0:i.trim())&&(0!==l||e.asSectionHeader?n.createElement(t.CardSectionHeader,{style:0===l&&X?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"16px",fontSize:"24px"}},R(e.title),null!=e&&e.Component?n.createElement(e.Component,null):null):n.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},R(e.title))),(null==e?void 0:e.isTable)&&n.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse",border:"1px solid black"}},n.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map((e,t)=>n.createElement("th",{style:{padding:"10px",paddingLeft:"5px",border:"1px solid black"},key:t},R(e)))),null==e?void 0:e.tableRows.map((l,i)=>n.createElement("tr",{key:i},l.map((l,a)=>Array.isArray(l)&&l.length>1&&!0===e.isMaintenance?n.createElement("td",{style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"},key:a},n.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"5px"}},l.map((e,l)=>n.createElement("a",{key:l,onClick:()=>{Digit.UploadServices.Filefetch([e.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var t,l,n;const i=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.url;if(i){const e=i.split(",")[0];e?window.open(e,"_blank"):console.error("No valid URL found to open!")}else console.error("URL is missing in the response!")}).catch(e=>{console.error("Error fetching file:",e)})},rel:"noopener noreferrer",style:{marginRight:"5px",display:"inline-block",cursor:"pointer"}},n.createElement(t.PDFSvg,{style:{width:"25px",height:"25px"}}))))):n.createElement("td",{key:a,style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"}},l&&!0===l.editButton?n.createElement("span",{style:{display:"inline-flex",gap:"10px",alignItems:"center"}},n.createElement(o.Link,{to:{pathname:"/digit-ui/employee/asset/assetservice/maintenance-edit/"+B,state:{data:l.data}}},n.createElement("button",null," ",n.createElement(t.EditIcon,null)," ")),n.createElement("div",{key:i,onClick:()=>{F(!0)},style:{cursor:"pointer"}},n.createElement(t.ViewsIcon,null))):R(l)))))),n.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||X?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(a=e.values)||void 0===a?void 0:a.map((l,i)=>{var a,r,d;return!0===l.map&&"N/A"!==l.value?n.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:R(l.title),label:R(l.title),text:n.createElement("img",{src:R(l.value),alt:"",privacy:null==l?void 0:l.privacy})}):!0===(null==l?void 0:l.isLink)?n.createElement(t.Row,{key:R(l.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?n.createElement("div",{style:{width:"200%"}},n.createElement(o.Link,{to:null==l?void 0:l.to},n.createElement("span",{className:"link",style:{color:"#a82227"}},R(null==l?void 0:l.title)))):Q||Z?""+R(l.title):R(l.title),text:n.createElement("div",null,n.createElement(o.Link,{to:null==l?void 0:l.to},n.createElement("span",{className:"link",style:{color:"#a82227"}},null==l?void 0:l.value))),last:i===(null==e||null===(d=e.values)||void 0===d?void 0:d.length)-1,caption:l.caption,className:"border-none",rowContainerStyle:J(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):n.createElement("div",{key:i},window.location.href.includes("modify")?n.createElement(t.Row,{className:"border-none",key:""+l.title,label:""+R(""+l.title),privacy:null==l?void 0:l.privacy,text:null!=l&&l.oldValue?null==l?void 0:l.oldValue:null!=l&&l.value?null==l?void 0:l.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):n.createElement(t.Row,{key:R(l.title),label:R(l.title),text:$(l),last:i===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:l.caption,className:"border-none",privacy:null==l?void 0:l.privacy,rowContainerStyle:J(),labelStyle:{wordBreak:"break-all",fontWeight:l.isBold?"bold":"normal",fontStyle:l.isBold?"italic":"normal"},textStyle:{wordBreak:"break-all",fontWeight:l.isBold?"bold":"normal",fontStyle:l.isBold?"italic":"normal"}}),"PT_TOTAL_DUES"===l.title?n.createElement(wo,{bill:null===(r=H.Bill)||void 0===r?void 0:r[0]}):"")})))),(null==e?void 0:e.belowComponent)&&n.createElement(e.belowComponent,null),(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.inspectionReport)&&n.createElement(Eo,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:O}),(null==T||null===(d=T.applicationData)||void 0===d||null===(u=d.additionalDetails)||void 0===u||null===(s=u.fieldinspection_pending)||void 0===s?void 0:s.length)>0&&(null==e||null===(c=e.additionalDetails)||void 0===c?void 0:c.fiReport)&&n.createElement(ro,{fiReport:null==T||null===(v=T.applicationData)||void 0===v||null===(m=v.additionalDetails)||void 0===m?void 0:m.fieldinspection_pending}),(null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.floors)&&n.createElement(po,{floors:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.units)&&n.createElement(yo,{units:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.units}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.accessories)&&n.createElement(ho,{units:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.accessories}),(null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.permissions)&&(null==S||null===(b=S.data)||void 0===b||null===(I=b.nextActions)||void 0===I?void 0:I.length)>0&&n.createElement(co,{applicationData:null==T?void 0:T.applicationData,t:R,permissions:null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.permissions}),(null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.obpsDocuments)&&n.createElement(oo,{t:R,applicationData:null==T?void 0:T.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:S}),(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.noc)&&n.createElement(so,{t:R,isNoc:!0,NOCdata:e.values,applicationData:null==T?void 0:T.applicationData,docs:e.additionalDetails.noc,noc:null===(x=e.additionalDetails)||void 0===x?void 0:x.data,bpaActionsDetails:S}),(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.scruntinyDetails)&&n.createElement(Eo,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.buildingExtractionDetails)&&n.createElement(Eo,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.subOccupancyTableDetails)&&n.createElement(fo,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==T?void 0:T.applicationData}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.documentsWithUrl)&&n.createElement(io,{documents:null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documentsWithUrl}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documents)&&n.createElement(vo,{documents:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documents,applicationStatus:null==N?void 0:N.applicationStatus}),(null==e||null===(V=e.additionalDetails)||void 0===V?void 0:V.documents)&&("PENDING_FOR_FIELD_INSPECTION"===(null==N?void 0:N.applicationStatus)||"PENDING_APPROVAL_FOR_CONNECTION"===(null==N?void 0:N.applicationStatus))&&n.createElement(ko,{applicationData:N}),(null==e||null===(z=e.additionalDetails)||void 0===z?void 0:z.documents)&&"PENDING_APPROVAL_FOR_CONNECTION"===(null==N?void 0:N.applicationStatus)&&n.createElement(Mo,null),(null==e||null===(K=e.additionalDetails)||void 0===K?void 0:K.taxHeadEstimatesCalculation)&&n.createElement(mo,{taxHeadEstimatesCalculation:null==e||null===(G=e.additionalDetails)||void 0===G?void 0:G.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&n.createElement(To,{wsAdditionalDetails:e,oldValue:w}),(null==e||null===(q=e.additionalDetails)||void 0===q?void 0:q.redirectUrl)&&n.createElement(o.Link,{to:null==e||null===(Y=e.additionalDetails)||void 0===Y||null===(ee=Y.redirectUrl)||void 0===ee?void 0:ee.url},n.createElement("span",{className:"add-details-link hover-button"},null==e||null===(te=e.additionalDetails)||void 0===te||null===(le=te.redirectUrl)||void 0===le?void 0:le.title)),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&n.createElement(No,{wsAdditionalDetails:e,workflowDetails:S}),(null==e||null===(ie=e.additionalDetails)||void 0===ie?void 0:ie.estimationDetails)&&n.createElement(Co,{wsAdditionalDetails:e,workflowDetails:S}))}),C&&(null==S||null===(r=S.data)||void 0===r||null===(d=r.timeline)||void 0===d?void 0:d.length)>0&&n.createElement(n.Fragment,null,n.createElement(t.BreakLine,null),((null==S?void 0:S.isLoading)||b)&&n.createElement(t.Loader,null),!(null!=S&&S.isLoading)&&!b&&n.createElement(l.Fragment,null,n.createElement("div",{id:"timeline"},n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},R("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=S&&null!==(u=S.data)&&void 0!==u&&u.timeline&&1===(null==S||null===(s=S.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)?n.createElement(t.CheckPoint,{isCompleted:!0,label:R(""+I+(null==S||null===(v=S.data)||void 0===v||null===(m=v.timeline[0])||void 0===m?void 0:m.state)),customChild:q(null==S||null===(p=S.data)||void 0===p?void 0:p.timeline[0],null==S||null===(E=S.data)||void 0===E?void 0:E.timeline)}):n.createElement(t.ConnectingCheckPoints,null,(null==S||null===(f=S.data)||void 0===f?void 0:f.timeline)&&(null==S||null===(g=S.data)||void 0===g?void 0:g.timeline.slice(0,te?null==S?void 0:S.data.timeline.length:2).map((e,l,i)=>{var o;let a="";var r,d,u,s,c,v;return window.location.href.includes("/obps/")&&(a=null!=S&&null!==(r=S.data)&&void 0!==r&&null!==(d=r.timeline[l-1])&&void 0!==d&&null!==(u=d.state)&&void 0!==u&&u.includes("BACK_FROM")||null!=S&&null!==(s=S.data)&&void 0!==s&&null!==(c=s.timeline[l-1])&&void 0!==c&&null!==(v=c.state)&&void 0!==v&&v.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0===l?"":"_DONE"),n.createElement(n.Fragment,{key:l},n.createElement(t.CheckPoint,{keyValue:l,isCompleted:0===l,info:e.comment,label:R(""+I+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[x])+a),customChild:q(e,l,null==S||null===(o=S.data)||void 0===o?void 0:o.timeline)}))}))),(null==S||null===(h=S.data)||void 0===h||null===(y=h.timeline)||void 0===y?void 0:y.length)>2&&n.createElement(t.LinkButton,{label:R(te?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{le(e=>!e)}})))),n.createElement("div",null,M&&n.createElement(Ro,{t:R,closeModal:()=>setRnewButton(!1),actionCancelOnSubmit:()=>setRnewButton(!1),application:application})))}function Bo(e){var l,i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,h,y;let T=e.t,S=e.showToast,b=e.closeToast,N=e.businessService;if(null!=N&&N.includes("NewTL")||null!=N&&N.includes("TL")||null!=N&&N.includes("EDITRENEWAL")){var I;let e="";switch(null==S||null===(I=S.action)||void 0===I?void 0:I.action){case"SENDBACK":e="error"===(null==S?void 0:S.key)?null==S||null===(l=S.error)||void 0===l?void 0:l.message:T("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==S?void 0:S.key)?null==S||null===(i=S.error)||void 0===i?void 0:i.message:T("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==S?void 0:S.key)?null==S||null===(o=S.error)||void 0===o?void 0:o.message:T("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==S?void 0:S.key)?null==S||null===(a=S.error)||void 0===a?void 0:a.message:T("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==S?void 0:S.key)?null==S||null===(r=S.error)||void 0===r?void 0:r.message:T("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==S?void 0:S.key)?null==S||null===(d=S.error)||void 0===d?void 0:d.message:T("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==S?void 0:S.key)?null==S||null===(u=S.error)||void 0===u?void 0:u.message:T("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==S?void 0:S.key)?null==S||null===(s=S.error)||void 0===s?void 0:s.message:T("ES_"+N+"_"+(null==S||null===(c=S.action)||void 0===c?void 0:c.action)+"_UPDATE_SUCCESS")}return n.createElement(n.Fragment,null,S&&n.createElement(t.Toast,{error:"error"===S.key,label:e,onClose:b}))}if(null!=N&&N.includes("BPA")||null!=N&&N.includes("BPA_LOW")||null!=N&&N.includes("BPA_OC")){var D;const e=function(e){var t;void 0===e&&(e=[]);let l=e[0];return l=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=N&&N.includes("BPA_OC")?T(e[1]):T(e[0]),l};let l="";switch(null==S||null===(D=S.action)||void 0===D?void 0:D.action){case"REVOCATE":l="error"===(null==S?void 0:S.key)?null==S||null===(v=S.error)||void 0===v?void 0:v.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":l="error"===(null==S?void 0:S.key)?null==S||null===(m=S.error)||void 0===m?void 0:m.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":l="error"===(null==S?void 0:S.key)?null==S||null===(p=S.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":l="error"===(null==S?void 0:S.key)?null==S||null===(E=S.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":l="error"===(null==S?void 0:S.key)?null==S||null===(f=S.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":l="error"===(null==S?void 0:S.key)?null==S||null===(g=S.error)||void 0===g?void 0:g.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":l="error"===(null==S?void 0:S.key)?null==S||null===(_=S.error)||void 0===_?void 0:_.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:l="error"===(null==S?void 0:S.key)?null==S||null===(h=S.error)||void 0===h?void 0:h.message:T("ES_"+N+"_"+(null==S||null===(y=S.action)||void 0===y?void 0:y.action)+"_UPDATE_SUCCESS")}return n.createElement(n.Fragment,null,S&&n.createElement(t.Toast,{error:"error"===S.key,label:l,onClose:b}))}{var C,A;const e="error"===(null==S?void 0:S.key)?null==S||null===(C=S.error)||void 0===C?void 0:C.message:"ES_"+N+"_"+(null==S||null===(A=S.action)||void 0===A?void 0:A.action)+"_UPDATE_SUCCESS";return n.createElement(n.Fragment,null,S&&n.createElement(t.Toast,{error:"error"===S.key,label:T(e),onClose:b}))}}function Wo(e){var l,o,a,r,d,u,s,v,m,p,E,f,g,_,h,y,T,S,b;let N=e.workflowDetails,I=e.displayMenu,D=e.onActionSelect,C=e.setDisplayMenu,A=e.businessService,x=e.forcedActionPrefix,O=e.ActionBarStyle,w=void 0===O?{}:O,L=e.MenuStyle,P=void 0===L?{}:L,R=e.isAction,k=e.applicationDetails;const M=i.useTranslation().t;let F=Digit.UserService.getUser();const B=n.useRef(),W=n.useState(()=>"undefined"!=typeof window&&void 0!==window.isDocumentsVerified&&!window.isDocumentsVerified),U=W[0],H=W[1];if(n.useEffect(()=>{"undefined"!=typeof window&&void 0!==window.isDocumentsVerified&&H(!window.isDocumentsVerified);const e=e=>{H(!e.detail)};if("undefined"!=typeof window)return window.addEventListener("DOCUMENTS_VERIFIED",e),()=>window.removeEventListener("DOCUMENTS_VERIFIED",e)},[]),window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};F=null==t?void 0:t.value}const j=null===(l=F)||void 0===l||null===(o=l.info)||void 0===o||null===(a=o.roles)||void 0===a?void 0:a.map(e=>e.code);let V=!1,z=!1,K=(null==N||null===(r=N.data)||void 0===r||null===(d=r.actionState)||void 0===d||null===(u=d.nextActions)||void 0===u?void 0:u.filter(e=>(null==j?void 0:j.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==N||null===(s=N.data)||void 0===s||null===(v=s.nextActions)||void 0===v?void 0:v.filter(e=>(null==j?void 0:j.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(B,()=>{C(!1)},I),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==K?void 0:K.length)||null!=K&&null!==(m=K[0])&&void 0!==m&&null!==(p=m.redirectionUrl)&&void 0!==p&&p.pathname.includes("/pt/property-details/")&&1==(null==K?void 0:K.length)?(z=!1,V=!0):(null==K?void 0:K.length)>0&&(z=!0,V=!1);const G=Digit.SessionStorage.get("User"),q=null==G||null===(E=G.info)||void 0===E?void 0:E.uuid,Y=null==k||null===(f=k.applicationData)||void 0===f||null===(g=f.auditDetails)||void 0===g?void 0:g.lastModifiedBy;return n.createElement(n.Fragment,null,!(null!=N&&N.isLoading)&&z&&!V&&!R&&n.createElement(t.ActionBar,{style:c({},w)},I&&(null!=N&&null!==(_=N.data)&&void 0!==_&&null!==(h=_.actionState)&&void 0!==h&&h.nextActions||null!=N&&null!==(y=N.data)&&void 0!==y&&y.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:x||"WF_EMPLOYEE_"+(null==A?void 0:A.toUpperCase()),options:K,optionKey:"action",t:M,onSelect:D,style:P}):null,"ewst"===A?Y===q||null==Y?n.createElement(t.SubmitBar,{ref:B,label:M("WF_TAKE_ACTION"),onSubmit:()=>C(!I),disabled:U}):n.createElement(t.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+M("EW_ALERT_ANOTHER_VENDOR")):n.createElement(t.SubmitBar,{ref:B,label:M("WF_TAKE_ACTION"),onSubmit:()=>C(!I),disabled:U})),!(null!=N&&N.isLoading)&&!z&&V&&!R&&n.createElement(t.ActionBar,{style:c({},w)},n.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==K||null===(T=K[0])||void 0===T?void 0:T.action,value:null==K||null===(S=K[0])||void 0===S?void 0:S.action,onClick:e=>{D((null==K?void 0:K[0])||{})}},M((x||"WF_EMPLOYEE_"+(null==A?void 0:A.toUpperCase()))+"_"+(null==K||null===(b=K[0])||void 0===b?void 0:b.action)))))}const Uo=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Ho=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Uo,null));function jo(e){let l=e.action,o=e.closeWarningPopup;const a=i.useTranslation().t,r=window.Digit.Utils.browser.isMobile();return n.createElement(n.Fragment,null,n.createElement(t.Modal,{headerBarMain:n.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:n.createElement(Ho,{onClick:()=>{o()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},n.createElement(t.Card,null,n.createElement("div",{style:{marginBottom:"30px"}},n.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==l?void 0:l.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),n.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+a("PT_AMOUNT_DUE"),text:"₹"+a(null==l?void 0:l.AmountDueForPay)}),n.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},n.createElement(t.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:o,style:{marginLeft:"10px"}}),n.createElement(t.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==l||null===(e=l.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const Vo=e=>{var r;const d=Digit.ULBService.getCurrentTenantId(),u=Digit.ULBService.getStateId(),s=i.useTranslation().t,v=o.useHistory();let m=o.useParams().id;const p=l.useState(!1),E=p[0],f=p[1],g=l.useState(null),_=g[0],h=g[1],y=l.useState(!1),T=y[0],S=y[1],b=l.useState(!1),N=b[0],I=b[1],D=l.useState(!1),C=D[0],A=D[1],x=e.applicationDetails,O=e.showToast,w=e.setShowToast,L=e.isLoading,P=e.isDataLoading,R=e.applicationData,k=e.mutate,M=e.nocMutation,F=e.workflowDetails,B=e.id,W=e.businessService,U=e.closeToast,H=e.moduleCode,j=e.timelineStatusPrefix,V=e.forcedActionPrefix,z=e.statusAttribute,K=e.ActionBarStyle,G=e.MenuStyle,q=e.paymentsList,Y=e.showTimeLine,X=void 0===Y||Y,Q=e.oldValue,Z=e.isInfoLabel,J=void 0!==Z&&Z,$=e.clearDataDetails,ee=e.isAction,te=void 0!==ee&&ee;l.useEffect(()=>{O&&F.revalidate()},[O]);const le=a.useQueryClient(),ne=()=>{h(null),S(!1)};return L||N?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,L?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,n.createElement(Fo,{applicationDetails:x,id:B,workflowDetails:F,isDataLoading:P,applicationData:R,businessService:W,timelineStatusPrefix:j,statusAttribute:z,paymentsList:q,showTimeLine:X,oldValue:Q,isInfoLabel:J}),T?n.createElement(no,{t:s,action:_,tenantId:d,state:u,id:m,applicationDetails:x,applicationData:null==x?void 0:x.applicationData,closeModal:ne,submitAction:function(e,t,l){void 0===t&&(t=!1),void 0===l&&(l={});try{let n=!1;const i=function(i,o,a,r,d,u,m,p,E,f,g,h){if(0!=(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(a=o.comment)||void 0===a?void 0:a.length)&&0!=(null==e||null===(r=e.Licenses)||void 0===r||null===(d=r[0])||void 0===d||null===(u=d.comment)||void 0===u?void 0:u.length)&&0!=(null==e||null===(m=e.WaterConnection)||void 0===m||null===(p=m.comment)||void 0===p?void 0:p.length)&&0!=(null==e||null===(E=e.SewerageConnection)||void 0===E||null===(f=E.comment)||void 0===f?void 0:f.length)&&0!=(null==e||null===(g=e.BPA)||void 0===g||null===(h=g.comment)||void 0===h?void 0:h.length)){function y(t){if(n)return t;k&&(I(!0),k(e,{onError:(e,t)=>{I(!1),w({key:"error",error:e}),setTimeout(U,5e3)},onSuccess:(e,t)=>{var n,i,o,a,r,d,u,c,m,p,E,f;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),I(!1),null!==(n=l)&&void 0!==n&&n.bpa&&(e.selectedAction=_,v.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=l)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=_,v.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=l)&&void 0!==o&&o.isNoc&&v.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0?null!=t&&null!==(r=t.AmendmentUpdate)&&void 0!==r&&null!==(d=r.workflow)&&void 0!==d&&d.action.includes("SEND_BACK")?w({key:"success",label:s("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(u=t.AmendmentUpdate)&&void 0!==u&&null!==(c=u.workflow)&&void 0!==c&&c.action.includes("RE-SUBMIT")?w({key:"success",label:s("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(m=t.AmendmentUpdate)&&void 0!==m&&null!==(p=m.workflow)&&void 0!==p&&p.action.includes("APPROVE")?w({key:"success",label:s("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(E=t.AmendmentUpdate)&&void 0!==E&&null!==(f=E.workflow)&&void 0!==f&&f.action.includes("REJECT")&&w({key:"success",label:s("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(w({key:"success",action:_}),$&&setTimeout($,3e3),setTimeout(U,5e3),le.clear(),le.refetchQueries("APPLICATION_SEARCH"))}})),ne()}I(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(c({},e)));const i=function(){if(!1!==t&&M){var e;const l=null===(e=t)||void 0===e?void 0:e.map(e=>null==M?void 0:M.mutateAsync(e)),i=dl(function(){return I(!0),Promise.resolve(Promise.all(l)).then(function(e){e&&e.map(e=>{var t,l;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.nocType)})})},function(e){var t,l,i,o,a,r,d,u,c,v,m,p;I(!1);let E=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(i=l.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?s(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(d=r.Errors)||void 0===d||null===(u=d[0])||void 0===u?void 0:u.code):(null==e||null===(c=e.response)||void 0===c||null===(v=c.data)||void 0===v||null===(m=v.Errors)||void 0===m||null===(p=m[0])||void 0===p?void 0:p.message)||e;ne(),w({key:"error",error:{message:E}}),setTimeout(U,5e3),n=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(y):y(i)}alert("Please fill in the comments before submitting")}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==F||null===(r=F.data)||void 0===r?void 0:r.timeline,businessService:W,workflowDetails:F,moduleCode:H,cardFormWrapperClassName:"modal-form"}):null,C?n.createElement(jo,{action:_,workflowDetails:F,businessService:W,isWarningPop:C,closeWarningPopup:()=>{A(!1)}}):null,n.createElement(Bo,{t:s,showToast:O,closeToast:U,businessService:W}),n.createElement(Wo,{isAction:te,workflowDetails:F,displayMenu:E,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)w({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(U,5e3);else if(null!=e&&e.isWarningPopUp)A(!0);else if(null!=e&&e.redirectionUrll){var t,l,n,i,o;if("ACTIVATE_CONNECTION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action))v.push(""+(null==e||null===(n=e.redirectionUrll)||void 0===n?void 0:n.pathname),JSON.stringify({data:null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.state,url:""+(null===(o=location)||void 0===o?void 0:o.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(l=e.redirectionUrll)||void 0===l?void 0:l.action)){var a,r;v.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),{data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state})}else{var d;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.pathname))}}else if(null!=e&&e.redirectionUrl){var u,s;v.push({pathname:null===(u=e.redirectionUrl)||void 0===u?void 0:u.pathname,state:c({},null===(s=e.redirectionUrl)||void 0===s?void 0:s.state)})}else S(!0);h(e),f(!1)},setDisplayMenu:f,businessService:W,forcedActionPrefix:V,ActionBarStyle:K,MenuStyle:G,applicationDetails:x})))},zo=()=>n.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("polyline",{points:"20 6 9 17 4 12"})),Ko=()=>n.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("circle",{cx:"12",cy:"12",r:"10"}),n.createElement("polyline",{className:"clock-hands2",points:"12 6 12 12 16 14"})),Go=e=>{var l;let o=e.workflowDetails,a=e.hideTimeline;const r=i.useTranslation().t,d=null==o||null===(l=o.data)||void 0===l?void 0:l.processInstances;return d&&0!==d.length?n.createElement(t.Card,{className:"workflow-timeline-card2 digit-form-composer",style:{background:"#fff",padding:"16px",height:a?"100%":""}},n.createElement("div",{className:"timeline-header-wrapper "+(a?"collapsed":"")},n.createElement(t.CardSubHeader,{style:{marginBottom:"0",fontSize:"16px",fontWeight:"700",color:"#374151"},className:a?"hidden-content":""},r("WORKFLOW_TIMELINE"))),n.createElement("div",{className:a?"hidden-content":"timeline-container2"},d.map((e,t)=>{var l,i,o,a,u,s,c;const v=(e=>0===e?"current2":"completed2")(t),m=t!==d.length-1&&d.length>1,p=(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.lastModifiedTime)||(null==e||null===(i=e.auditDetails)||void 0===i?void 0:i.createdTime);return n.createElement("div",{key:t,className:"timeline-item2 "+v},n.createElement("div",{className:"timeline-marker2"},n.createElement("div",{className:"timeline-circle2"},n.createElement("completed2"===v?zo:Ko,null)),m&&n.createElement("div",{className:"timeline-line2"})),n.createElement("div",{className:"timeline-content2"},n.createElement("div",{className:"timeline-header2"},n.createElement("div",{className:"timeline-title2"},r("WF_"+(null==e||null===(o=e.state)||void 0===o?void 0:o.state))),n.createElement("span",{className:"timeline-date2"},(e=>{if(!e)return"N/A";const t=new Date(e);return String(t.getDate()).padStart(2,"0")+"/"+String(t.getMonth()+1).padStart(2,"0")+"/"+t.getFullYear().toString().slice(-2)+" "+String(t.getHours()).padStart(2,"0")+":"+String(t.getMinutes()).padStart(2,"0")})(p))),n.createElement("div",{className:"timeline-body2"},n.createElement("div",{className:"timeline-status-tag2 status-"+v},r((null==e||null===(a=e.state)||void 0===a?void 0:a.applicationStatus)||(null==e||null===(u=e.state)||void 0===u?void 0:u.state))),(null==e?void 0:e.comment)&&n.createElement("div",{className:"timeline-comment2"},e.comment)),(null==e||null===(s=e.assigner)||void 0===s?void 0:s.name)&&n.createElement("div",{className:"timeline-footer2"},n.createElement("span",null,r("ES_COMMON_ASSIGNED_TO"),": ",n.createElement("strong",null,null==e||null===(c=e.assigner)||void 0===c?void 0:c.name)))))}))):null};var qo=n.memo(()=>{var e,a,r,d,u;const s=i.useTranslation().t,c=o.useLocation(),v=n.useState("undefined"!=typeof window&&window.innerWidth<768)[0],m=Digit.ULBService.getCurrentTenantId(),p=o.useParams().id,E=l.useState(null),f=E[0],g=E[1],_=l.useState({}),h=_[0],y=_[1],T=l.useState(!1),S=T[0],b=T[1],N=l.useState("watertanker")[1],I=c.pathname.includes("/fixed-point/"),D=null==p?void 0:p.startsWith("WT"),C=null==p?void 0:p.startsWith("TP"),A=I?"watertanker-fixedpoint":D?"watertanker":C?"treePruning":"mobileToilet";Digit.UserService.getUser(),sessionStorage.setItem(D?"wt":C?"tp":"mt",p);const x=D?Digit.Hooks.wt.useWTApplicationDetail(s,m,p):C?Digit.Hooks.wt.useTPApplicationDetail(s,m,p):Digit.Hooks.wt.useMTApplicationDetail(s,m,p),O=x.isLoading,w=x.data,L=(D?Digit.Hooks.wt.useWTApplicationAction(m):C?Digit.Hooks.wt.useTPApplicationAction(m):Digit.Hooks.wt.useMTApplicationAction(m)).mutate;let P=Digit.Hooks.useWorkflowDetails({tenantId:(null==w||null===(e=w.applicationData)||void 0===e?void 0:e.tenantId)||m,id:null==w||null===(a=w.applicationData)||void 0===a||null===(r=a.applicationData)||void 0===r?void 0:r.bookingNo,moduleCode:A,role:D?["WT_CEMP"]:C?["TP_CEMP"]:["MT_CEMP"]});return l.useEffect(()=>{if(w){var e,l,i,o,a,r,d;let h=Ht.cloneDeep(w);const T=null==h||null===(e=h.applicationData)||void 0===e||null===(l=e.applicationData)||void 0===l?void 0:l.bookingStatus,S="DELIVERED"===T||"TANKER_DELIVERED"===T;var u,c;if((null==h||null===(i=h.applicationDetails)||void 0===i?void 0:i.length)>0&&!S&&I)h.applicationDetails[0].Component=()=>n.createElement("div",{onClick:()=>b(!0),style:{float:"right",display:"flex",alignItems:"center",cursor:"pointer",color:"#f47738",gap:"8px",padding:"4px 12px",backgroundColor:"#fff",borderRadius:"4px",border:"1px solid #f47738",transition:"all 0.2s ease"}},n.createElement(t.EditIcon,{style:{fill:"#f47738",width:"16px",height:"16px"}}),n.createElement("span",{style:{fontWeight:"600",fontSize:"14px"}},s("WT_EDIT_FIELDS"))),(null==h||null===(u=h.applicationData)||void 0===u||null===(c=u.applicationDetails)||void 0===c?void 0:c.length)>0&&(h.applicationData.applicationDetails[0].Component=h.applicationDetails[0].Component);else if((null==h||null===(o=h.applicationDetails)||void 0===o?void 0:o.length)>0){var v,m;delete h.applicationDetails[0].Component,(null==h||null===(v=h.applicationData)||void 0===v||null===(m=v.applicationDetails)||void 0===m?void 0:m.length)>0&&delete h.applicationData.applicationDetails[0].Component}const N=null==h||null===(a=h.applicationData)||void 0===a||null===(r=a.applicationData)||void 0===r||null===(d=r.driverTripReport)||void 0===d?void 0:d[0];if(N&&"TANKER_DELIVERED"===T){var p,E,f,g,_;const e={title:"WT_DRIVER_TRIP_REPORT",asSectionHeader:!0,values:[{title:"WT_START_LATITUDE",value:(null==N||null===(p=N.startLatitude)||void 0===p?void 0:p.toString())||s("CS_NA")},{title:"WT_START_LONGITUDE",value:(null==N||null===(E=N.startLongitude)||void 0===E?void 0:E.toString())||s("CS_NA")},{title:"WT_END_LATITUDE",value:(null==N||null===(f=N.endLatitude)||void 0===f?void 0:f.toString())||s("CS_NA")},{title:"WT_END_LONGITUDE",value:(null==N||null===(g=N.endLongitude)||void 0===g?void 0:g.toString())||s("CS_NA")}],belowComponent:()=>n.createElement(rl,{startFileStoreId:null==N?void 0:N.startFileStoreId,endFileStoreId:null==N?void 0:N.endFileStoreId})};if(null!=h&&h.applicationDetails){const t=h.applicationDetails.findIndex(e=>"WT_VEHICLE_DETAILS"===e.title);-1!==t?h.applicationDetails.splice(t+1,0,e):h.applicationDetails.push(e)}if(null!=h&&null!==(_=h.applicationData)&&void 0!==_&&_.applicationDetails){const t=h.applicationData.applicationDetails.findIndex(e=>"WT_VEHICLE_DETAILS"===e.title);-1!==t?h.applicationData.applicationDetails.splice(t+1,0,e):h.applicationData.applicationDetails.push(e)}}y(h)}},[w,I]),l.useEffect(()=>{var e,t,l,n,i;null!=P&&null!==(e=P.data)&&void 0!==e&&e.applicationBusinessService&&!("watertanker"===(null==P||null===(t=P.data)||void 0===t?void 0:t.applicationBusinessService)&&"watertanker"===A||"mobileToilet"===(null==P||null===(l=P.data)||void 0===l?void 0:l.applicationBusinessService)&&"mobileToilet"===A||"treePruning"===(null==P||null===(n=P.data)||void 0===n?void 0:n.applicationBusinessService)&&"treePruning"===A)&&N(null==P||null===(i=P.data)||void 0===i?void 0:i.applicationBusinessService)},[P.data]),n.createElement(n.Fragment,null,S&&n.createElement(al,{t:s,applicationData:null==h||null===(d=h.applicationData)||void 0===d?void 0:d.applicationData,closeModal:()=>b(!1)}),n.createElement("div",{className:"workflow-timeline-wrapper no-scrollbar "+(v?"hide-workflow":""),style:{flex:"1 1 300px",maxWidth:v?"fit-content":"400px",transition:"max-width 0.3s"}},n.createElement(Go,{workflowDetails:P})),n.createElement("div",{style:{flex:"2 1 500px",minWidth:"300px",overflowY:"auto"}},n.createElement(Vo,{applicationDetails:null==h?void 0:h.applicationData,isLoading:O,isDataLoading:O,applicationData:null==h||null===(u=h.applicationData)||void 0===u?void 0:u.applicationData,mutate:L,workflowDetails:P,businessService:A,moduleCode:I?"request-service.water_tanker":"request-service",showToast:f,setShowToast:g,closeToast:()=>{g(null)},timelineStatusPrefix:"",forcedActionPrefix:"RS",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"},showTimeLine:!1})))});const Yo=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Xo=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Yo,null)),Qo=e=>n.createElement("h1",{className:"heading-m"},e.t("SERVICE_TYPE")),Zo=e=>e.substr(0,1).toUpperCase()+e.substr(1),Jo=function(e,t,l){try{var n,i,o,a,r,d,u,s,c,v,m,p,E,f;return Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:l(null==t?void 0:t.i18nKey)+" "+(_=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),_.toLowerCase().split(" ").map(Zo).join(" ")),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.bookingNo,isTOCRequired:!1,heading:l("MT_ACKNOWLEDGEMENT"),details:[{title:l("MT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:l("MT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:l("MT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:l("MT_ALT_MOBILE_NUMBER"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.alternateNumber},{title:l("MT_EMAIL_ID"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.emailId}].filter(e=>e.value)},{title:l("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_PINCODE"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.pincode},{title:l("WT_CITY"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.city},{title:l("WT_LOCALITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.locality},{title:l("WT_STREET_NAME"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.streetName},{title:l("WT_DOOR_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.doorNo},{title:l("WT_HOUSE_NO"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.houseNo},{title:l("WT_ADDRESS_LINE1"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.addressLine1},{title:l("WT_ADDRESS_LINE2"),value:null==e||null===(E=e.address)||void 0===E?void 0:E.addressLine2},{title:l("WT_LANDMARK"),value:null==e||null===(f=e.address)||void 0===f?void 0:f.landmark}].filter(e=>e.value)},{title:l("MT_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:l("MT_NUMBER_OF_MOBILE_TOILETS"),value:null==e?void 0:e.noOfMobileToilet},{title:l("MT_DELIVERY_FROM_DATE"),value:h(null==e?void 0:e.deliveryFromDate)},{title:l("MT_DELIVERY_TO_DATE"),value:h(null==e?void 0:e.deliveryToDate)},{title:l("MT_REQUIREMENT_TIME"),value:g(null==e?void 0:e.deliveryFromTime)+" - "+g(null==e?void 0:e.deliveryToTime)},{title:l("MT_SPECIAL_REQUEST"),value:null==e?void 0:e.description}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var _},$o=e=>{console.log("GetActionMessage",e);const t=i.useTranslation().t;return e.isSuccess?t("MT_SUBMIT_SUCCESSFULL"):e.isLoading?t("MT_APPLICATION_PENDING"):e.isSuccess?void 0:t("MT_APPLICATION_FAILED")},ea={padding:"4px 0px",justifyContent:"space-between"},ta=e=>{var l,i;return console.log("BannerPicker",e),n.createElement(t.Banner,{message:$o(e),applicationNumber:null===(l=e.data)||void 0===l||null===(i=l.mobileToiletBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("MT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},la=e=>e.substr(0,1).toUpperCase()+e.substr(1),na=function(e,t,l){try{var n,i,o,a,r,d,u,s,c,v,m,p,E,f;return Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:l(null==t?void 0:t.i18nKey)+" "+(g=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),g.toLowerCase().split(" ").map(la).join(" ")),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.bookingNo,isTOCRequired:!1,heading:l("TP_ACKNOWLEDGEMENT"),details:[{title:l("MT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:l("MT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:l("MT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:l("MT_ALT_MOBILE_NUMBER"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.alternateNumber},{title:l("MT_EMAIL_ID"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.emailId}].filter(e=>e.value)},{title:l("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_PINCODE"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.pincode},{title:l("WT_CITY"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.city},{title:l("WT_LOCALITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.locality},{title:l("WT_STREET_NAME"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.streetName},{title:l("WT_DOOR_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.doorNo},{title:l("WT_HOUSE_NO"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.houseNo},{title:l("WT_ADDRESS_LINE1"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.addressLine1},{title:l("WT_ADDRESS_LINE2"),value:null==e||null===(E=e.address)||void 0===E?void 0:E.addressLine2},{title:l("WT_LANDMARK"),value:null==e||null===(f=e.address)||void 0===f?void 0:f.landmark}].filter(e=>e.value)},{title:l("TP_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:l("REASON_FOR_PRUNING"),value:l(null==e?void 0:e.reasonForPruning)},{title:l("LATITUDE_GEOTAG"),value:null==e?void 0:e.latitude},{title:l("LONGITUDE_GEOTAG"),value:null==e?void 0:e.longitude}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var g},ia=e=>{const t=i.useTranslation().t;return e.isSuccess?t("TP_SUBMIT_SUCCESSFULL"):e.isLoading?t("TP_APPLICATION_PENDING"):e.isSuccess?void 0:t("TP_APPLICATION_FAILED")},oa={padding:"4px 0px",justifyContent:"space-between"},aa=e=>{var l,i;return console.log("BannerPicker",e),n.createElement(t.Banner,{message:ia(e),applicationNumber:null===(l=e.data)||void 0===l||null===(i=l.treePruningBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("TP_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},ra=["tenantId","payments"],da=["tenantId","payments"],ua=e=>{let l=e.jumpTo;i.useTranslation();const a=o.useHistory();return n.createElement(t.LinkButton,{label:n.createElement(t.EditIcon,{style:{marginTop:"-30px",float:"right",position:"relative",bottom:"32px"}}),className:"check-page-link-button",onClick:function(){a.push(l)}})},sa=e=>{Digit.UploadServices.Filefetch([e],Digit.ULBService.getStateId()).then(e=>{var t,l,n;const i=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.url;if(i){const e=i.split(",")[0];e?window.open(e,"_blank"):console.error("No valid URL found to open!")}else console.error("URL is missing in the response!")}).catch(e=>{console.error("Error fetching file:",e)})},ca=e=>{const t=i.useTranslation().t;return e.isSuccess?t("WT_SUBMIT_SUCCESSFULL"):e.isLoading?t("WT_APPLICATION_PENDING"):e.isSuccess?void 0:t("WT_APPLICATION_FAILED")},va={padding:"4px 0px",justifyContent:"space-between"},ma=e=>{var l,i;return n.createElement(t.Banner,{message:ca(e),applicationNumber:null===(l=e.data)||void 0===l||null===(i=l.waterTankerBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("WT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},pa=e=>{console.log("GetActionMessage",e);const t=i.useTranslation().t;return e.isSuccess?t("MT_SUBMIT_SUCCESSFULL"):e.isLoading?t("MT_APPLICATION_PENDING"):e.isSuccess?void 0:t("MT_APPLICATION_FAILED")},Ea={padding:"4px 0px",justifyContent:"space-between"},fa=e=>{var l,i;return console.log("BannerPicker",e),n.createElement(t.Banner,{message:pa(e),applicationNumber:null===(l=e.data)||void 0===l||null===(i=l.mobileToiletBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("MT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},ga=e=>{const t=i.useTranslation().t;return e.isSuccess?t("TP_SUBMIT_SUCCESSFULL"):e.isLoading?t("TP_APPLICATION_PENDING"):e.isSuccess?void 0:t("TP_APPLICATION_FAILED")},_a={padding:"4px 0px",justifyContent:"space-between"},ha=e=>{var l,i;return console.log("BannerPicker",e),n.createElement(t.Banner,{message:ga(e),applicationNumber:null===(l=e.data)||void 0===l||null===(i=l.treePruningBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("TP_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},ya=[{head:"FP_INFO",body:[{route:"fp-info",component:"EmergencyFixedPointInfoPage",nextStep:"fp-applicant-details",key:"fpInfoDetails"}]},{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"fp-applicant-details",component:"EmergencyFixedPointApplicantDetails",withoutLabel:!0,key:"owner",type:"component",nextStep:"fp-address-details",isMandatory:!0,texts:{header:"ES_APPLICANT_DETAILS"},timeLine:[{currentStep:1,actions:"ES_APPLICANT_DETAILS"}]}]},{head:"ES_TITLE_ADDRESS_DETAILS",body:[{route:"fp-address-details",component:"AddressDetails",withoutLabel:!0,key:"address",type:"component",isMandatory:!0,nextStep:"fp-dispatch-details",texts:{header:"ES_ADDRESS_DETAILS"},timeLine:[{currentStep:2,actions:"ES_ADDRESS_DETAILS"}]}]},{head:"WT_DISPATCH_DETAILS",body:[{route:"fp-dispatch-details",component:"EmergencyFixedPointDispatchDetails",withoutLabel:!0,key:"dispatchDetails",type:"component",isMandatory:!0,nextStep:"fp-request-details",texts:{header:"WT_DISPATCH_DETAILS"},timeLine:[{currentStep:3,actions:"WT_DISPATCH_DETAILS"}]}]},{head:"FP_REQUEST_DETAILS",body:[{route:"fp-request-details",component:"EmergencyFixedPointRequestDetails",withoutLabel:!0,key:"requestDetails",type:"component",isMandatory:!0,nextStep:null,texts:{submitBarLabel:"CS_COMMON_SAVE",header:"WT_REQUEST_DETAILS"},timeLine:[{currentStep:4,actions:"ES_REQUEST_DETAILS"}]}]}],Ta=["silent"],Sa=e=>{let t=e.stateCode,i=e.userType,a=e.tenants;const r=o.useRouteMatch(),d=r.path,u=r.url,s=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"WT",language:s}),Digit.SessionStorage.set("WT_TENANTS",a),l.useEffect(()=>"employee"===i&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===i?n.createElement(Ge,{path:d,url:u,userType:i}):n.createElement(w,null)},ba=e=>{let o=e.matchPath;const a=i.useTranslation().t,r=Digit.Hooks.useSessionStorage("WT",{})[2];l.useEffect(()=>{r()},[]);const d=[{link:o+"/wt",i18nKey:a("WT_REQUEST_TANKER")},{link:o+"/wt/status",i18nKey:a("WT_VIEW_APPLICATIONS")},{link:o+"/wt/wt-Vendor",i18nKey:a("Vendor Management")}];return n.createElement(t.CitizenHomeCard,{header:a("WATER_TANKER_SERVICE"),links:d,Icon:()=>n.createElement(t.PTIcon,{className:"fill-path-primary-main"})})},Na={ApplicantDetails:t.ApplicantDetails,AddressDetails:t.AddressDetails,WTCreate:()=>{var e,t,r,d,u,s,v,p,f;const g=a.useQueryClient(),_=o.useRouteMatch(),h=i.useTranslation().t,y=o.useLocation().pathname,T=o.useHistory();let S=[];const b=Digit.Hooks.useSessionStorage("WT_Create",{}),N=b[0],I=b[1],D=b[2],C=Digit.UserService.getUser(),A=Digit.ULBService.getCurrentTenantId(),x=null==C||null===(e=C.info)||void 0===e?void 0:e.uuid,O=Digit.Hooks.useUserSearch(A,{uuid:[x]},{},{enabled:!!x}).data;function w(e,t,l,n,i){if(void 0===i&&(i=!1),"owners"===e){let l=N.owners||[];l[n]=t,I(c({},N,{[e]:[...l]}))}else if("units"===e){let e=N.units||[];e=t,I(c({},N,{units:e}))}else I(c({},N,{[e]:c({},N[e],t)}));null!=t&&t.silent||((e,t,l,n)=>{let i,o=y.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=y.slice(0,-3),o=o.split("/").pop(),r=!0):(o=y.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let d=S.find(e=>n?e.key===n:e.route===o);d||(d=S.find(e=>e.route===o));let u=(d||{}).nextStep,s=void 0===u?{}:u,c=T.push;if(e&&(c=T.replace),l&&(s=n),"request-details"===s){var v,m;const e=null==N||null===(v=N.serviceType)||void 0===v||null===(m=v.serviceType)||void 0===m?void 0:m.code;"MobileToilet"===e?s="toiletRequest-details":"TREE_PRUNING"===e&&(s="treePruningRequest-details")}if(null===s)return c(_.path+"/check");i=isNaN(s.split("/").pop())&&r&&"map"!==s?_.path+"/"+s+"/"+t:_.path+"/"+s,c(i)})(l,n,i,e)}N.serviceType&&0!==Object.keys(N.serviceType).length||!y.includes("employee")||(y.includes("mt")?I({serviceType:{serviceType:{code:"MobileToilet",i18nKey:"Mobile Toilet",value:"Mobile Toilet"}}}):y.includes("tp")?I({serviceType:{serviceType:{code:"TREE_PRUNING",i18nKey:"Tree Pruning",value:"Tree Pruning"}}}):I({serviceType:{serviceType:{code:"WT",i18nKey:"Water Tanker",value:"Water Tanker"}}})),N&&Object.keys(N).length>0&&window.location.href.includes("/service-type")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(D(),g.invalidateQueries("WT_Create"));const L=()=>{D(),g.invalidateQueries("WT_Create")};m.forEach(e=>{S=S.concat(e.body.filter(e=>!e.hideInCitizen))}),S.indexRoute=y.includes("citizen")?"service-type":"info";const P=null===(t=Digit)||void 0===t||null===(r=t.ComponentRegistryService)||void 0===r?void 0:r.getComponent("WTCheckPage"),R=null===(d=Digit)||void 0===d||null===(u=d.ComponentRegistryService)||void 0===u?void 0:u.getComponent("WTAcknowledgement"),k=null===(s=Digit)||void 0===s||null===(v=s.ComponentRegistryService)||void 0===v?void 0:v.getComponent("MTAcknowledgement"),M=null===(p=Digit)||void 0===p||null===(f=p.ComponentRegistryService)||void 0===f?void 0:f.getComponent("TPAcknowledgement"),F=["applicant-details","address-details","request-details","toiletRequest-details","treePruningRequest-details"],B=F.some(e=>y.includes(e)),W=l.useRef({});return l.useEffect(()=>{if(B){const e=y.split("/").pop();W.current[e]&&W.current[e].scrollIntoView({behavior:"smooth",block:"start"})}},[y,B]),n.createElement(n.Fragment,null,n.createElement("div",{className:"employee-form-section-wrapper"},!y.includes("/info")&&n.createElement(E,{config:S,showFinalStep:!0}),n.createElement("div",{className:"employee-form-section"},n.createElement(o.Switch,null,n.createElement(o.Route,{path:_.path+"/check"},n.createElement(P,{onSubmit:function(){try{var e,t,l,n,i,o;return"WT"===(null==N||null===(e=N.serviceType)||void 0===e||null===(t=e.serviceType)||void 0===t?void 0:t.code)&&T.push(_.path+"/wt-acknowledgement"),"MobileToilet"===(null==N||null===(l=N.serviceType)||void 0===l||null===(n=l.serviceType)||void 0===n?void 0:n.code)&&T.push(_.path+"/mt-acknowledgement"),"TREE_PRUNING"===(null==N||null===(i=N.serviceType)||void 0===i||null===(o=i.serviceType)||void 0===o?void 0:o.code)&&T.push(_.path+"/tp-acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:N})),n.createElement(o.Route,{path:_.path+"/wt-acknowledgement"},n.createElement(R,{data:N,onSuccess:L})),n.createElement(o.Route,{path:_.path+"/mt-acknowledgement"},n.createElement(k,{data:N,onSuccess:L})),n.createElement(o.Route,{path:_.path+"/tp-acknowledgement"},n.createElement(M,{data:N,onSuccess:L})),S.map((e,t)=>{if(!F.includes(e.route)){var l;const i=e.component,a=e.texts,r=e.inputs,d=e.key,u=e.additionaFields,s="string"==typeof i?Digit.ComponentRegistryService.getComponent(i):i;return n.createElement(o.Route,{path:_.path+"/"+e.route,key:t},n.createElement(s,{config:{texts:a,inputs:r,key:d,additionaFields:u},onSelect:w,t:h,formData:N,userDetails:null==O||null===(l=O.user)||void 0===l?void 0:l[0]}))}return null}),n.createElement(o.Route,{path:F.map(e=>_.path+"/"+e)},n.createElement("div",{className:"single-page-form-container"},S.filter(e=>F.includes(e.route)).map((e,t)=>{var l,i,o;const a=e.component,r="string"==typeof a?Digit.ComponentRegistryService.getComponent(a):a,d=null==N||null===(l=N.serviceType)||void 0===l||null===(i=l.serviceType)||void 0===i?void 0:i.code;return"request-details"===e.route&&"WT"!==d||"toiletRequest-details"===e.route&&"MobileToilet"!==d||"treePruningRequest-details"===e.route&&"TREE_PRUNING"!==d?null:n.createElement("div",{key:t,ref:t=>W.current[e.route]=t,className:"form-section-unit"},n.createElement(r,{config:c({},e,{isCollapsible:!0,defaultOpen:!0}),onSelect:w,t:h,formData:N,userDetails:null==O||null===(o=O.user)||void 0===o?void 0:o[0]}))}))),n.createElement(o.Route,null,n.createElement(o.Redirect,{to:_.path+"/"+S.indexRoute}))))))},InfoPage:e=>{var i,o;let a=e.t,r=e.onSelect,d=e.formData,u=e.config;const s=l.useState(""),v=s[0],m=s[1],p=l.useState(!1),E=p[0],f=p[1],g=l.useState(!1)[0],_={MobileToilet:"MT_MODULE",WT:"WT_MODULE",TREE_PRUNING:"TREE_PRUNING"}[null==d||null===(i=d.serviceType)||void 0===i||null===(o=i.serviceType)||void 0===o?void 0:o.code],h=()=>{const e=c({},d.infodetails||{},{existingDataSet:v});r(u.key,c({},d[u.key],e))};return n.createElement(n.Fragment,null,n.createElement(t.Card,{className:"search-form-wrapper",style:{flexDirection:"column",gap:"12px",justifyContent:"flex-start"}},_&&n.createElement(t.CardHeader,null,a(_)),n.createElement("div",null,n.createElement("p",{className:"primaryColor"},a("SV_DOC_REQ_SCREEN_SUB_HEADER")),n.createElement("p",{className:"primaryColor"},a("SV_DOC_REQ_SCREEN_TEXT")),n.createElement("p",{className:"primaryColor"},a("SV_DOC_REQ_SCREEN_SUB_TEXT"))),n.createElement("span",null,n.createElement(t.SubmitBar,{label:a("COMMON_NEXT"),onSubmit:()=>{g?f(!0):h()}}))),E&&n.createElement(M,{t:a,closeModal:()=>f(!1),actionCancelOnSubmit:()=>f(!1),onSubmit:()=>{h(),f(!1)},setExistingDataSet:m}))},RequestDetails:e=>{var i,o,a,r,d,u,s,v,m;let p=e.t,E=e.config,f=e.onSelect,g=e.formData;Digit.UserService.getUser();let _={};const h=l.useState((null==g||null===(i=g.requestDetails)||void 0===i?void 0:i.tankerType)||""),y=h[0],T=h[1],S=l.useState((null==g||null===(o=g.requestDetails)||void 0===o?void 0:o.tankerQuantity)||{i18nKey:"1",code:"1",value:"1"}),b=S[0],N=S[1],I=l.useState((null==g||null===(a=g.requestDetails)||void 0===a?void 0:a.waterQuantity)||""),C=I[0],A=I[1],x=l.useState((null==g||null===(r=g.requestDetails)||void 0===r?void 0:r.waterType)||""),O=x[0],w=x[1],L=l.useState((null==g||null===(d=g.requestDetails)||void 0===d?void 0:d.deliveryDate)||""),P=L[0],R=L[1],k=l.useState((null==g||null===(u=g.requestDetails)||void 0===u?void 0:u.description)||""),M=k[0],F=k[1],B=l.useState((null==g||null===(s=g.requestDetails)||void 0===s?void 0:s.deliveryTime)||""),W=B[0],U=B[1],H=l.useState((null==g||null===(v=g.requestDetails)||void 0===v?void 0:v.extraCharge)||!1),j=H[0],V=H[1],z=l.useState((null==g||null===(m=g.requestDetails)||void 0===m?void 0:m.fileStoreId)||null),K=z[0],G=z[1],q=l.useState(null),Y=q[0],X=q[1],Q=l.useState(null),Z=Q[0],J=Q[1],$=Digit.ULBService.getStateId(),ee={width:"100%"},te=Digit.Hooks.useCustomMDMS($,"request-service",[{name:"VehicleType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.VehicleType}}).data,le=Digit.Hooks.useCustomMDMS($,"request-service",[{name:"TankerType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerType}}).data,ne=Digit.Hooks.useCustomMDMS($,"request-service",[{name:"TankerQuantity"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerQuantity}}).data,ie=Digit.Hooks.useCustomMDMS($,"Request-service",[{name:"WaterType"}],{select:e=>{var t;return null==e||null===(t=e["Request-service"])||void 0===t?void 0:t.WaterType}}).data;let oe=[],ae=[],re=[],de=[];ie&&ie.map(e=>{de.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),ne&&ne.map(e=>{ae.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),te&&te.map(e=>{oe.push({i18nKey:""+e.capacity,code:""+e.capacity,value:""+e.capacity,vehicleType:e.vehicleType,capacityName:e.capacityName})}),le&&le.map(e=>{re.push({i18nKey:""+e.i18nKey,code:""+e.code,value:""+e.value})});const ue=oe.map(e=>{if(y.code===e.vehicleType)return{i18nKey:e.capacityName,code:e.code,value:e.capacityName}}).filter(e=>void 0!==e),se=()=>n.createElement("div",{className:"flex items-center"},n.createElement(t.TextInput,{type:"time",value:W,style:ee,onChange:e=>U(e.target.value),min:"06:00",max:"23:59"}));return l.useEffect(()=>{!function(){try{J(null);const e=function(){if(Y){const e=function(){if(Y.size>=2e6)J(p("WT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("wt",Y,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?G(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):J(p("WT_FILE_UPLOAD_ERROR"))})},function(){J(p("WT_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[Y]),l.useEffect(()=>{!y&&null!=re&&re.length&&T(re[0])},[re]),n.createElement(n.Fragment,null,n.createElement(t.FormStep,{config:E,onSelect:()=>{let e=c({},g.requestDetails,{tankerType:y,deliveryDate:P,tankerQuantity:b,waterType:O,waterQuantity:C,deliveryTime:W,description:M,extraCharge:j,fileStoreId:K});f(E.key,e,!1)},t:p,isDisabled:!(y&&P&&b&&C&&W&&M&&O),className:"card-form-container"},n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_TANKER_TYPE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.RadioButtons,{t:p,options:re,style:{display:"flex",flexWrap:"wrap",maxHeight:"30px"},innerStyles:{minWidth:"24%"},optionsKey:"i18nKey",name:"tankerType",value:y,selectedOption:y,onSelect:T,labelKey:"i18nKey",isPTFlow:!0})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_WATER_TYPE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:O,placeholder:p("WT_SELECT_WATER_TYPE"),select:w,option:de,style:ee,optionKey:"i18nKey",t:p})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_WATER_QUANTITY")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:C,placeholder:"Select Water Quantity",select:A,option:ue,style:ee,optionKey:"i18nKey",t:p})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_TANKER_QUANTITY")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:b,placeholder:"Select Tanker Quantity",select:N,option:ae,style:ee,optionKey:"i18nKey",t:p})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_DELIVERY_DATE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextInput,{t:p,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",style:ee,value:P,onChange:function(e){R(e.target.value)},min:(new Date).toISOString().split("T")[0],rules:{required:p("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||p("ERR_DEFAULT_INPUT_FIELD_MSG")}})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_DELIVERY_TIME")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(se,null)),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_UPLOAD_DOCUMENT")),n.createElement(t.UploadFile,{id:"wt-doc",extraStyleName:"propertyCreate",accept:".jpg,.png,.pdf,.jpeg",onUpload:function(e){G(null),X(e.target.files[0])},onDelete:()=>{G(null)},message:K?"1 "+p("WT_ACTION_FILEUPLOADED"):p("WT_ACTION_NO_FILEUPLOADED"),error:Z})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_DESCRIPTION")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextArea,c({t:p,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"description",value:M,onChange:function(e){F(e.target.value)},style:ee,ValidationRequired:!0},_={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:p("PT_NAME_ERROR_MESSAGE")}))),Z?n.createElement("div",{style:{height:"20px",width:"100%",fontSize:"20px",color:"red",marginTop:"5px"}},Z):"",n.createElement(t.CheckBox,{label:p("WT_IMMEDIATE"),onChange:()=>{V(!j)},checked:j})))},WTCheckPage:e=>{var a,r,d,u,s,c,v,m,p,E,_,y;let T=e.onSubmit,S=e.value,b=void 0===S?{}:S;const N=i.useTranslation().t,I=o.useLocation().pathname,D=b.owner,C=b.requestDetails,A=b.address,x=b.serviceType,O=b.toiletRequestDetails,w=b.treePruningRequestDetails,L=l.useState(!1),P=L[0],R=L[1],k=null!=C&&C.extraCharge?"YES":"NO",M=l.useState(null)[1],W=I.includes("citizen")?"/digit-ui/citizen/wt/request-service":"/digit-ui/employee/wt/request-service";return n.useEffect(()=>{null!=C&&C.fileStoreId&&Digit.UploadServices.Filefetch([null==C?void 0:C.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var t,l,n,i;const o=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.url)||void 0===i?void 0:i.split(",")[0];M(o)})},[null==C?void 0:C.fileStoreId]),n.createElement(n.Fragment,null,n.createElement(t.Card,{className:"overflow-y-scroll"},n.createElement(t.CardHeader,null,N("WT_SUMMARY_PAGE")),n.createElement("div",null,n.createElement(t.CardSubHeader,null,N("ES_TITILE_OWNER_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:N("COMMON_APPLICANT_NAME"),text:""+N(f(null==D?void 0:D.applicantName)),actionButton:n.createElement(F,{jumpTo:W+"/applicant-details"})}),n.createElement(t.Row,{label:N("COMMON_MOBILE_NUMBER"),text:""+N(f(null==D?void 0:D.mobileNumber))}),n.createElement(t.Row,{label:N("COMMON_ALT_MOBILE_NUMBER"),text:""+N(f(null==D?void 0:D.alternateNumber))}),n.createElement(t.Row,{label:N("COMMON_EMAIL_ID"),text:""+N(f(null==D?void 0:D.emailId))})),n.createElement(t.CardSubHeader,null,N("ES_TITLE_ADDRESS_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:N("HOUSE_NO"),text:""+N(f(null==A?void 0:A.houseNo)),actionButton:n.createElement(F,{jumpTo:W+"/address-details"})}),n.createElement(t.Row,{label:N("ADDRESS_LINE1"),text:""+N(f(null==A?void 0:A.addressLine1))}),n.createElement(t.Row,{label:N("ADDRESS_LINE2"),text:""+N(f(null==A?void 0:A.addressLine2))}),n.createElement(t.Row,{label:N("CITY"),text:""+N(f(null==A||null===(a=A.city)||void 0===a||null===(r=a.city)||void 0===r?void 0:r.name))}),n.createElement(t.Row,{label:N("LOCALITY"),text:""+N(f(null==A||null===(d=A.locality)||void 0===d?void 0:d.i18nKey))}),n.createElement(t.Row,{label:N("PINCODE"),text:""+N(f(null==A?void 0:A.pincode))}),n.createElement(t.Row,{label:N("LANDMARK"),text:""+N(f(null==A?void 0:A.landmark))}),n.createElement(t.Row,{label:N("STREET_NAME"),text:""+N(f(null==A?void 0:A.streetName))})),"WT"===(null==x||null===(u=x.serviceType)||void 0===u?void 0:u.code)&&n.createElement(l.Fragment,null,n.createElement(t.CardSubHeader,null,N("WT_REQUEST_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:N("WT_TANKER_TYPE"),text:""+N(f(null==C||null===(s=C.tankerType)||void 0===s?void 0:s.value)),actionButton:n.createElement(F,{jumpTo:W+"/request-details"})}),n.createElement(t.Row,{label:N("WT_WATER_TYPE"),text:""+N(f(null==C||null===(c=C.waterType)||void 0===c?void 0:c.code))}),n.createElement(t.Row,{label:N("WT_TANKER_QUANTITY"),text:""+N(f(null==C||null===(v=C.tankerQuantity)||void 0===v?void 0:v.code))}),n.createElement(t.Row,{label:N("WT_WATER_QUANTITY"),text:""+N(f(null==C||null===(m=C.waterQuantity)||void 0===m?void 0:m.value))}),n.createElement(t.Row,{label:N("WT_DELIVERY_DATE"),text:""+N(f(h(null==C?void 0:C.deliveryDate)))}),n.createElement(t.Row,{label:N("WT_DELIVERY_TIME"),text:""+f(g(null==C?void 0:C.deliveryTime))}),n.createElement(t.Row,{label:N("WT_DESCRIPTION"),text:""+N(f(null==C?void 0:C.description))}),(null==C?void 0:C.fileStoreId)&&n.createElement(t.Row,{label:N("WT_UPLOAD_DOCUMENT"),text:n.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>B(null==C?void 0:C.fileStoreId)},n.createElement(t.GenericFileIcon,null))}),n.createElement(t.Row,{label:N("WT_IMMEDIATE"),text:""+N(f(k))}))),"MobileToilet"===(null==x||null===(p=x.serviceType)||void 0===p?void 0:p.code)&&n.createElement(l.Fragment,null,n.createElement(t.CardSubHeader,null,N("ES_REQUEST_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:N("MT_NUMBER_OF_MOBILE_TOILETS"),text:""+N(f(null==O||null===(E=O.mobileToilet)||void 0===E?void 0:E.code)),actionButton:n.createElement(F,{jumpTo:W+"/toiletRequest-details"})}),n.createElement(t.Row,{label:N("MT_DELIVERY_FROM_DATE"),text:""+N(f(h(null==O?void 0:O.deliveryfromDate)))}),n.createElement(t.Row,{label:N("MT_DELIVERY_TO_DATE"),text:""+N(h(f(null==O?void 0:O.deliverytoDate)))}),n.createElement(t.Row,{label:N("MT_REQUIREMNENT_FROM_TIME"),text:f(g(null==O?void 0:O.deliveryfromTime))}),n.createElement(t.Row,{label:N("MT_REQUIREMNENT_TO_TIME"),text:f(g(null==O?void 0:O.deliverytoTime))}),n.createElement(t.Row,{label:N("MT_SPECIAL_REQUEST"),text:""+N(f(null==O?void 0:O.specialRequest))}))),"TREE_PRUNING"===(null==x||null===(_=x.serviceType)||void 0===_?void 0:_.code)&&n.createElement(l.Fragment,null,n.createElement(t.CardSubHeader,null,N("TP_REQUEST_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:N("REASON_FOR_PRUNING"),text:""+N(f(null==w||null===(y=w.reasonOfPruning)||void 0===y?void 0:y.code)),actionButton:n.createElement(F,{jumpTo:W+"/treePruningRequest-details"})}),n.createElement(t.Row,{label:N("LOCATION_GEOTAG"),text:""+N(f(null==w?void 0:w.geoTagLocation))}),n.createElement(t.Row,{label:N("UPLOAD_THE_SITE_PHOTOGRAPH"),text:n.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>B(null==w?void 0:w.supportingDocumentFile)},n.createElement(t.GenericFileIcon,null))}))),n.createElement(t.CheckBox,{label:N("FINAL_DECLARATION_MESSAGE"),onChange:()=>{R(!P)},checked:P})),n.createElement(t.SubmitBar,{label:N("COMMON_BUTTON_SUBMIT"),onSubmit:T,disabled:!P})))},WTAcknowledgement:e=>{let a=e.data,r=e.onSuccess;const d=i.useTranslation().t,u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useTankerCreateAPI(u),v=Digit.UserService.getUser().info,m=(Digit.Hooks.useStore.getInitData().data||{}).tenants;return l.useEffect(()=>{try{a.tenantId=u;let e=(e=>{var t,l,n,i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,h,y,T,S,b,N,I,D,C,A,x,O,w,L,P,R,k,M,F,B,W,U;return{waterTankerBookingDetail:{tenantId:null==e?void 0:e.tenantId,tankerType:null===(t=(null==e||null===(l=e.requestDetails)||void 0===l||null===(n=l.tankerType)||void 0===n?void 0:n.code)||(null==e||null===(i=e.requestDetails)||void 0===i?void 0:i.tankerType)||"")||void 0===t?void 0:t.toUpperCase(),waterType:null==e||null===(o=e.requestDetails)||void 0===o||null===(a=o.waterType)||void 0===a?void 0:a.code,tankerQuantity:null==e||null===(r=e.requestDetails)||void 0===r||null===(d=r.tankerQuantity)||void 0===d?void 0:d.code,waterQuantity:null==e||null===(u=e.requestDetails)||void 0===u||null===(s=u.waterQuantity)||void 0===s?void 0:s.code,description:null==e||null===(c=e.requestDetails)||void 0===c?void 0:c.description,deliveryDate:null==e||null===(v=e.requestDetails)||void 0===v?void 0:v.deliveryDate,deliveryTime:null==e||null===(m=e.requestDetails)||void 0===m?void 0:m.deliveryTime,extraCharge:null!=e&&null!==(p=e.requestDetails)&&void 0!==p&&p.extraCharge?"Y":"N",addressDetailId:(null==e||null===(E=e.address)||void 0===E?void 0:E.addressDetailId)||"",applicantDetail:{name:null==e||null===(f=e.owner)||void 0===f?void 0:f.applicantName,mobileNumber:null==e||null===(g=e.owner)||void 0===g?void 0:g.mobileNumber,alternateNumber:null==e||null===(_=e.owner)||void 0===_?void 0:_.alternateNumber,emailId:null==e||null===(h=e.owner)||void 0===h?void 0:h.emailId},address:{addressType:null==e||null===(y=e.address)||void 0===y||null===(T=y.addressType)||void 0===T?void 0:T.code,pincode:null==e||null===(S=e.address)||void 0===S?void 0:S.pincode,city:(null==e||null===(b=e.address)||void 0===b||null===(N=b.city)||void 0===N||null===(I=N.city)||void 0===I?void 0:I.name)||"DJB",cityCode:(null==e||null===(D=e.address)||void 0===D||null===(C=D.city)||void 0===C||null===(A=C.city)||void 0===A?void 0:A.code)||"DJB",addressLine1:null==e||null===(x=e.address)||void 0===x?void 0:x.addressLine1,addressLine2:null==e||null===(O=e.address)||void 0===O?void 0:O.addressLine2,locality:null==e||null===(w=e.address)||void 0===w||null===(L=w.locality)||void 0===L?void 0:L.i18nKey,localityCode:null==e||null===(P=e.address)||void 0===P||null===(R=P.locality)||void 0===R?void 0:R.code,streetName:null==e||null===(k=e.address)||void 0===k?void 0:k.streetName,houseNo:null==e||null===(M=e.address)||void 0===M?void 0:M.houseNo,landmark:null==e||null===(F=e.address)||void 0===F?void 0:F.landmark,latitude:null==e||null===(B=e.address)||void 0===B?void 0:B.latitude,longitude:null==e||null===(W=e.address)||void 0===W?void 0:W.longitude},WTfileStoreId:null==e||null===(U=e.requestDetails)||void 0===U?void 0:U.fileStoreId,bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"watertanker",moduleName:"request-service.water_tanker"}}}})(a);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?n.createElement(t.Loader,null):n.createElement(t.Card,{className:"vehicle-details-card"},n.createElement(V,{t:d,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),n.createElement(t.StatusTable,null,s.isSuccess&&n.createElement(t.Row,{rowContainerStyle:j,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&n.createElement(t.SubmitBar,{label:d("WT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.waterTankerBookingDetail;const l=m.find(e=>e.code===t.tenantId);return Promise.resolve(U(c({},t),l,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),n.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},n.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},WTApplicationDetails:()=>{var e,a,r,d,u,s,m,p,E,f,_,y,T;const S=i.useTranslation().t,b=o.useParams(),N=b.acknowledgementIds,I=b.tenantId,D=l.useState(!1),C=D[0],A=D[1],x=l.useState(null),O=x[0],w=x[1],L=(Digit.Hooks.useStore.getInitData().data||{}).tenants,P=Digit.Hooks.wt.useTankerSearchAPI({tenantId:I,filters:{bookingNo:N}}),R=P.isLoading,k=P.data,M=P.refetch,F=Ut(k,"waterTankerBookingDetail",[]);Ut(k,"waterTankerBookingDetail[0].bookingNo",[]);let B=F&&F.length>0&&F[0]||{};const W=B;sessionStorage.setItem("wt",JSON.stringify(W));let H="N"===(null==B?void 0:B.extraCharge)?"No":"Yes";const j=Digit.Hooks.wt.useTankerCreateAPI(I,!1),V=Digit.Hooks.useRecieptSearch({tenantId:I,businessService:"request-service.water_tanker",consumerCodes:N,isEmployee:!1},{enabled:!!N}),z=V.data,K=V.isLoading;let G=[];G.push({label:S("WT_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>q()});const q=function(){try{const e=W||{},t=L.find(t=>t.code===e.tenantId);return Promise.resolve(U(c({},e),t,S)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return R?n.createElement(t.Loader,null):(z&&(null==z?void 0:z.Payments.length)>0&&0==K&&G.push({label:S("WT_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let t=e.tenantId,l=e.payments;v(e,zt);try{function n(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:i})).then(function(e){window.open(e[i],"_blank")})}let e=F[0]||{},i=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!i){let n={filestoreIds:[null==l?void 0:l.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},l)]},"request-service.water_tanker-receipt")).then(function(t){var l;n=t;const o=c({},e,{paymentReceiptFilestoreId:null===(l=n)||void 0===l?void 0:l.filestoreIds[0]});return Promise.resolve(j.mutateAsync({waterTankerBookingDetail:o})).then(function(){var e;i=null===(e=n)||void 0===e?void 0:e.filestoreIds[0],M()})})}}();return Promise.resolve(o&&o.then?o.then(n):n())}catch(e){return Promise.reject(e)}}({tenantId:null==z||null===(e=z.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==z?void 0:z.Payments[0]})}}),n.createElement(n.Fragment,null,n.createElement("div",null,n.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},n.createElement(t.Header,{styles:{fontSize:"32px"}},S("WT_BOOKING_DETAILS")),G&&G.length>0&&n.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>A(!C),displayOptions:C,options:G})),n.createElement(t.Card,null,n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:S("WT_BOOKING_NO"),text:null==B?void 0:B.bookingNo})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},S("WT_APPLICANT_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:S("WT_APPLICANT_NAME"),text:(null==B||null===(e=B.applicantDetail)||void 0===e?void 0:e.name)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_MOBILE_NUMBER"),text:(null==B||null===(a=B.applicantDetail)||void 0===a?void 0:a.mobileNumber)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_ALT_MOBILE_NUMBER"),text:(null==B||null===(r=B.applicantDetail)||void 0===r?void 0:r.alternateNumber)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_EMAIL_ID"),text:(null==B||null===(d=B.applicantDetail)||void 0===d?void 0:d.emailId)||S("CS_NA")})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},S("WT_ADDRESS_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:S("WT_PINCODE"),text:(null==B||null===(u=B.address)||void 0===u?void 0:u.pincode)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_CITY"),text:(null==B||null===(s=B.address)||void 0===s?void 0:s.city)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_LOCALITY"),text:(null==B||null===(m=B.address)||void 0===m?void 0:m.locality)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_STREET_NAME"),text:(null==B||null===(p=B.address)||void 0===p?void 0:p.streetName)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_DOOR_NO"),text:(null==B||null===(E=B.address)||void 0===E?void 0:E.doorNo)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_HOUSE_NO"),text:(null==B||null===(f=B.address)||void 0===f?void 0:f.houseNo)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_ADDRESS_LINE1"),text:(null==B||null===(_=B.address)||void 0===_?void 0:_.addressLine1)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_ADDRESS_LINE2"),text:(null==B||null===(y=B.address)||void 0===y?void 0:y.addressLine2)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_LANDMARK"),text:(null==B||null===(T=B.address)||void 0===T?void 0:T.landmark)||S("CS_NA")})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},S("ES_REQUEST_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:S("WT_TANKER_TYPE"),text:(null==B?void 0:B.tankerType)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_WATER_TYPE"),text:S(null==B?void 0:B.waterType)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_TANKER_QUANTITY"),text:(null==B?void 0:B.tankerQuantity)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_WATER_QUANTITY"),text:(null==B?void 0:B.waterQuantity)+" Ltr"||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_DELIVERY_DATE"),text:h(null==B?void 0:B.deliveryDate)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_DELIVERY_TIME"),text:g(null==B?void 0:B.deliveryTime)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_DESCRIPTION"),text:(null==B?void 0:B.description)||S("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:S("WT_IMMEDIATE"),text:H||S("CS_NA")})),n.createElement(Vt,{application:W,id:null==W?void 0:W.bookingNo,userType:"citizen"}),O&&n.createElement(t.Toast,{error:O.key,label:S(O.label),style:{bottom:"0px"},onClose:()=>{w(null)}})))))},MTApplicationDetails:()=>{var e,a,r,d,u,s,m,p,E,f,_,y;const T=i.useTranslation().t,S=o.useParams(),b=S.acknowledgementIds,N=S.tenantId,I=l.useState(!1),D=I[0],C=I[1],A=l.useState(null),x=A[0],O=A[1],w=(Digit.Hooks.useStore.getInitData().data||{}).tenants,L=Digit.Hooks.wt.useMobileToiletSearchAPI({tenantId:N,filters:{bookingNo:b}}),P=L.isLoading,R=L.data,k=L.refetch,M=Ut(R,"mobileToiletBookingDetails",[]);Ut(R,"mobileToiletBookingDetails[0].bookingNo",[]);let F=M&&M.length>0&&M[0]||{};const B=F;sessionStorage.setItem("mt",JSON.stringify(B));const W=Digit.Hooks.wt.useMobileToiletCreateAPI(N,!1),U=Digit.Hooks.useRecieptSearch({tenantId:N,businessService:"request-service.mobile_toilet",consumerCodes:b,isEmployee:!1},{enabled:!!b}),H=U.data,j=U.isLoading;let V=[];if(V.push({label:T("MT_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>z()}),P)return n.createElement(t.Loader,null);H&&(null==H?void 0:H.Payments.length)>0&&0==j&&V.push({label:T("MT_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let t=e.tenantId,l=e.payments;v(e,ra);try{function n(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:i})).then(function(e){window.open(e[i],"_blank")})}let e=M[0]||{},i=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!i){let n={filestoreIds:[null==l?void 0:l.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},l)]},"request-service.mobile_toilet-receipt")).then(function(t){var l;n=t;const o=c({},e,{paymentReceiptFilestoreId:null===(l=n)||void 0===l?void 0:l.filestoreIds[0]});return Promise.resolve(W.mutateAsync({mobileToiletBookingDetail:o})).then(function(){var e;i=null===(e=n)||void 0===e?void 0:e.filestoreIds[0],k()})})}}();return Promise.resolve(o&&o.then?o.then(n):n())}catch(e){return Promise.reject(e)}}({tenantId:null==H||null===(e=H.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==H?void 0:H.Payments[0]})}});const z=function(){try{const e=B||{},t=w.find(t=>t.code===e.tenantId);return Promise.resolve(Jo(c({},e),t,T)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return n.createElement(n.Fragment,null,n.createElement("div",null,n.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},n.createElement(t.Header,{styles:{fontSize:"32px"}},T("MT_BOOKING_DETAILS")),V.length>0&&n.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>C(!D),displayOptions:D,options:V})),n.createElement(t.Card,null,n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:T("MT_BOOKING_NO"),text:null==F?void 0:F.bookingNo})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},T("MT_APPLICANT_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:T("MT_APPLICANT_NAME"),text:(null==F||null===(e=F.applicantDetail)||void 0===e?void 0:e.name)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("MT_MOBILE_NUMBER"),text:(null==F||null===(a=F.applicantDetail)||void 0===a?void 0:a.mobileNumber)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("MT_ALT_MOBILE_NUMBER"),text:(null==F||null===(r=F.applicantDetail)||void 0===r?void 0:r.alternateNumber)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("MT_EMAIL_ID"),text:(null==F||null===(d=F.applicantDetail)||void 0===d?void 0:d.emailId)||T("CS_NA")})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},T("ES_TITLE_ADDRESS_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:T("PINCODE"),text:(null==F||null===(u=F.address)||void 0===u?void 0:u.pincode)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("CITY"),text:(null==F||null===(s=F.address)||void 0===s?void 0:s.city)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("LOCALITY"),text:(null==F||null===(m=F.address)||void 0===m?void 0:m.locality)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("STREET_NAME"),text:(null==F||null===(p=F.address)||void 0===p?void 0:p.streetName)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("HOUSE_NO"),text:(null==F||null===(E=F.address)||void 0===E?void 0:E.houseNo)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("ADDRESS_LINE1"),text:(null==F||null===(f=F.address)||void 0===f?void 0:f.addressLine1)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("ADDRESS_LINE2"),text:(null==F||null===(_=F.address)||void 0===_?void 0:_.addressLine2)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("LANDMARK"),text:(null==F||null===(y=F.address)||void 0===y?void 0:y.landmark)||T("CS_NA")})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},T("ES_REQUEST_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:T("MT_NUMBER_OF_MOBILE_TOILETS"),text:(null==F?void 0:F.noOfMobileToilet)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("MT_DELIVERY_FROM_DATE"),text:h(null==F?void 0:F.deliveryFromDate)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("MT_DELIVERY_TO_DATE"),text:h(null==F?void 0:F.deliveryToDate)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("MT_REQUIREMNENT_FROM_TIME"),text:g(null==F?void 0:F.deliveryFromTime)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("MT_REQUIREMNENT_TO_TIME"),text:g(null==F?void 0:F.deliveryToTime)||T("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:T("MT_SPECIAL_REQUEST"),text:(null==F?void 0:F.description)||T("CS_NA")})),n.createElement(Vt,{application:B,id:null==B?void 0:B.bookingNo,userType:"citizen"}),x&&n.createElement(t.Toast,{error:x.key,label:T(x.label),style:{bottom:"0px"},onClose:()=>{O(null)}}))))},TPApplicationDetails:()=>{var e,a,r,d,u,s,m,p,E,f,g,_;const h=i.useTranslation().t,y=o.useParams(),T=y.acknowledgementIds,S=y.tenantId,b=l.useState(!1),N=b[0],I=b[1],D=l.useState(null),C=D[0],A=D[1],x=(Digit.Hooks.useStore.getInitData().data||{}).tenants,O=Digit.Hooks.wt.useTreePruningSearchAPI({tenantId:S,filters:{bookingNo:T}}),w=O.isLoading,L=O.data,P=O.refetch,R=Ut(L,"treePruningBookingDetails",[]);Ut(L,"treePruningBookingDetails[0].bookingNo",[]);let k=R&&R.length>0&&R[0]||{};console.log("tp_details",k);const M=k;sessionStorage.setItem("tp",JSON.stringify(M));const F=Digit.Hooks.wt.useTreePruningCreateAPI(S,!1),B=Digit.Hooks.useRecieptSearch({tenantId:S,businessService:"request-service.tree_pruning",consumerCodes:T,isEmployee:!1},{enabled:!!T}),W=B.data,U=B.isLoading;let H=[];if(H.push({label:h("TP_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>j()}),w)return n.createElement(t.Loader,null);W&&(null==W?void 0:W.Payments.length)>0&&0==U&&H.push({label:h("TP_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let t=e.tenantId,l=e.payments;v(e,da);try{function n(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:i})).then(function(e){window.open(e[i],"_blank")})}let e=R[0]||{},i=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!i){let n={filestoreIds:[null==l?void 0:l.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},l)]},"request-service.tree_pruning-receipt")).then(function(t){var l;n=t;const o=c({},e,{paymentReceiptFilestoreId:null===(l=n)||void 0===l?void 0:l.filestoreIds[0]});return Promise.resolve(F.mutateAsync({treePruningBookingDetail:o})).then(function(){var e;i=null===(e=n)||void 0===e?void 0:e.filestoreIds[0],P()})})}}();return Promise.resolve(o&&o.then?o.then(n):n())}catch(e){return Promise.reject(e)}}({tenantId:null==W||null===(e=W.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==W?void 0:W.Payments[0]})}});const j=function(){try{const e=M||{},t=x.find(t=>t.code===e.tenantId);return Promise.resolve(na(c({},e),t,h)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return n.createElement(n.Fragment,null,n.createElement("div",null,n.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},n.createElement(t.Header,{styles:{fontSize:"32px"}},h("TP_BOOKING_DETAILS")),H.length>0&&n.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>I(!N),displayOptions:N,options:H})),n.createElement(t.Card,null,n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:h("WT_BOOKING_NO"),text:null==k?void 0:k.bookingNo})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},h("TP_APPLICANT_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:h("WT_APPLICANT_NAME"),text:(null==k||null===(e=k.applicantDetail)||void 0===e?void 0:e.name)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("WT_MOBILE_NUMBER"),text:(null==k||null===(a=k.applicantDetail)||void 0===a?void 0:a.mobileNumber)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("WT_ALT_MOBILE_NUMBER"),text:(null==k||null===(r=k.applicantDetail)||void 0===r?void 0:r.alternateNumber)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("WT_EMAIL_ID"),text:(null==k||null===(d=k.applicantDetail)||void 0===d?void 0:d.emailId)||h("CS_NA")})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},h("ES_TITLE_ADDRESS_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:h("PINCODE"),text:(null==k||null===(u=k.address)||void 0===u?void 0:u.pincode)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("CITY"),text:(null==k||null===(s=k.address)||void 0===s?void 0:s.city)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("LOCALITY"),text:(null==k||null===(m=k.address)||void 0===m?void 0:m.locality)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("STREET_NAME"),text:(null==k||null===(p=k.address)||void 0===p?void 0:p.streetName)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("HOUSE_NO"),text:(null==k||null===(E=k.address)||void 0===E?void 0:E.houseNo)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("ADDRESS_LINE1"),text:(null==k||null===(f=k.address)||void 0===f?void 0:f.addressLine1)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("ADDRESS_LINE2"),text:(null==k||null===(g=k.address)||void 0===g?void 0:g.addressLine2)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("LANDMARK"),text:(null==k||null===(_=k.address)||void 0===_?void 0:_.landmark)||h("CS_NA")})),n.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},h("TP_REQUEST_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",label:h("REASON_FOR_PRUNING"),text:h(null==k?void 0:k.reasonForPruning)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("LATITUDE_GEOTAG"),text:(null==k?void 0:k.latitude)||h("CS_NA")}),n.createElement(t.Row,{className:"border-none",label:h("LONGITUDE_GEOTAG"),text:(null==k?void 0:k.longitude)||h("CS_NA")})),n.createElement(Vt,{application:M,id:null==M?void 0:M.bookingNo,userType:"citizen"}),C&&n.createElement(t.Toast,{error:C.key,label:h(C.label),style:{bottom:"0px"},onClose:()=>{A(null)}}))))},WTMyApplications:()=>{const e=i.useTranslation().t,a=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),r=Digit.UserService.getUser().info,d=l.useState(""),u=d[0],s=d[1],v=l.useState(null),m=v[0],p=v[1],E=l.useState(null),f=E[0],g=E[1],_=l.useState("watertanker"),h=_[0],y=_[1],T=l.useState("watertanker"),S=T[0],b=T[1];let N,I,D=window.location.href.split("/").pop();isNaN(parseInt(D))?N=4:(I=D,N=parseInt(D)+50);let C=isNaN(parseInt(D))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:a,MobileNumber:null==r?void 0:r.mobileNumber}:{limit:"50",sortOrder:"ASC",sortBy:"createdTime",offset:I,tenantId:a,MobileNumber:null==r?void 0:r.mobileNumber};l.useEffect(()=>{g(C)},[D]);const A=Digit.Hooks.wt.useTankerSearchAPI({filters:f},{enabled:!!f&&"watertanker"===h}),x=A.isLoading,O=A.data,w=Digit.Hooks.wt.useMobileToiletSearchAPI({filters:f},{enabled:!!f&&"mobileToilet"===h}),L=w.isLoading,P=w.data,R=Digit.Hooks.wt.useTreePruningSearchAPI({filters:f},{enabled:!!f&&"treePruning"===h}),k=R.isLoading,M=R.data;let F=!1,B=[];if("watertanker"===h?(F=x,B=(null==O?void 0:O.waterTankerBookingDetail)||[]):"mobileToilet"===h?(F=L,B=(null==P?void 0:P.mobileToiletBookingDetails)||[]):"treePruning"===h?(F=k,B=null==M?void 0:M.treePruningBookingDetails):(F=x||L||k,B=[...(null==P?void 0:P.mobileToiletBookingDetails)||[],...(null==O?void 0:O.waterTankerBookingDetail)||[],...(null==M?void 0:M.treePruningBookingDetails)||[]]),F)return n.createElement(t.Loader,null);const W=[{label:e("MOBILE_TOILET"),code:"mobileToilet"},{label:e("WATER_TANKER"),code:"watertanker"},{label:e("TREE_PRUNING"),code:"treePruning"}],U=[{i18nKey:"Booking Created",code:"BOOKING_CREATED",value:e("WT_BOOKING_CREATED")},{i18nKey:"Booking Approved",code:"APPROVED",value:e("WT_BOOKING_APPROVED")},{i18nKey:"Tanker Delivered",code:"TANKER_DELIVERED",value:e("WT_TANKER_DELIVERED")},{i18nKey:"Vendor Assigned",code:"ASSIGN_VENDOR",value:e("WT_ASSIGN_VENDOR")},{i18nKey:"Rejected",code:"REJECT",value:e("WT_BOOKING_REJECTED")}],H=[{i18nKey:"BOOKING_CREATED",code:"BOOKING_CREATED",value:e("TP_BOOKING_CREATED")},{i18nKey:"PENDING_FOR_APPROVAL",code:"PENDING_FOR_APPROVAL",value:e("TP_PENDING_FOR_APPROVAL")},{i18nKey:"PAYMENT_PENDING",code:"PAYMENT_PENDING",value:e("TP_PAYMENT_PENDING")},{i18nKey:"TEAM_ASSIGNMENT_FOR_VERIFICATION",code:"TEAM_ASSIGNMENT_FOR_VERIFICATION",value:e("TP_TEAM_ASSIGNMENT_FOR_VERIFICATION")},{i18nKey:"TEAM_ASSIGNMENT_FOR_EXECUTION",code:"TEAM_ASSIGNMENT_FOR_EXECUTION",value:e("TP_TEAM_ASSIGNMENT_FOR_EXECUTION")},{i18nKey:"TREE_PRUNING_SERVICE_COMPLETED",code:"TREE_PRUNING_SERVICE_COMPLETED",value:e("TP_TREE_PRUNING_SERVICE_COMPLETED")}];return n.createElement(n.Fragment,null,n.createElement(t.Header,null,e("MY_BOOKINGS")+" ("+B.length+")"),n.createElement(t.Card,null,n.createElement("div",{style:{marginLeft:"16px"}},n.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"16px"}},n.createElement("div",{style:{flex:1}},n.createElement(t.CardLabel,null,e("SERVICE_TYPE")),n.createElement(t.Dropdown,{selected:W.find(e=>e.code===S),select:e=>{b(e.code),p("")},option:W,placeholder:e("Select Service Type"),optionKey:"label",t:e})),n.createElement("div",{style:{flex:1}},n.createElement(t.CardLabel,null,e("BOOKING_NO")),n.createElement(t.TextInput,{placeholder:e("Enter Booking No."),value:u,onChange:e=>s(e.target.value)})),n.createElement("div",{style:{flex:1}},n.createElement("div",{style:{display:"flex",flexDirection:"column"}},n.createElement(t.CardLabel,null,e("PT_COMMON_TABLE_COL_STATUS_LABEL")),n.createElement(t.Dropdown,{className:"form-field",selected:m,select:p,option:"treePruning"===S?H:U,placeholder:e("Select Status"),optionKey:"value",style:{width:"100%"},t:e}))),n.createElement("div",null,n.createElement("div",{style:{marginTop:"17%"}},n.createElement(t.SubmitBar,{label:e("ES_COMMON_SEARCH"),onSubmit:()=>{y(S);const e=u.trim(),t=c({},C,{bookingNo:e||void 0,status:(null==m?void 0:m.code)||void 0});g(t)}}),n.createElement("p",{className:"link",style:{marginLeft:"30%",marginTop:"10px",display:"block"},onClick:()=>{s(""),p("")}},e("ES_COMMON_CLEAR_ALL"))))),n.createElement(o.Link,{to:"request-service/service-type"},n.createElement(t.SubmitBar,{style:{borderRadius:"30px",width:"20%"},label:e("NEW_REQUEST")+" +"})))),n.createElement("div",null,B.length>0&&B.map((t,l)=>n.createElement("div",{key:l},n.createElement(qe,{application:t,tenantId:a,buttonLabel:e("SUMMARY")}))),0===B.length&&!F&&n.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("NO_APPLICATION_FOUND_MSG")),0!==B.length&&((null==P?void 0:P.count)||0)+((null==O?void 0:O.count)||0)+((null==M?void 0:M.count)||0)>N&&n.createElement("div",null,n.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},n.createElement("span",{className:"link"},n.createElement(o.Link,{to:"/digit-ui/citizen/wt/status/"+N},e("LOAD_MORE_MSG")))))))},ApplicationDetails:qo,WFApplicationTimeline:Vt,WFCaption:jt,WTEmpInbox:ve,WTCitizenCard:()=>{const e=i.useTranslation().t,a=o.useHistory(),r=l.useState("-"),d=r[0],u=r[1],s=Digit.ULBService.getCurrentTenantId()||Digit.ULBService.getCitizenCurrentTenant(!0),c=Digit.Hooks.useNewInboxGeneral({tenantId:s,ModuleCode:"WT",filters:{limit:10,offset:0,services:["watertanker"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.wtAccess()}}),v=c.data,m=c.isFetching,p=c.isSuccess;l.useEffect(()=>{!m&&p&&u(v)},[m]);const E=[{label:e("ES_COMMON_INBOX"),link:"/digit-ui/citizen/wt/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/citizen/wt/my-bookings"}],f={Icon:n.createElement(t.CHBIcon,null),moduleName:e("WT_MODULE_NAME"),kpis:[{count:null==d?void 0:d.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/citizen/wt/inbox"}],links:E,onDetailsClick:()=>{a.push("/digit-ui/citizen/wt/inbox")}};return n.createElement("div",{className:"wt-citizen-card-premium"},n.createElement(t.EmployeeModuleCard,f))},WTCard:z,ServiceTypes:e=>{var i;let o=e.t,a=e.config,r=e.onSelect,d=e.userType,u=e.formData;const s=Digit.ULBService.getStateId(),v=Digit.Hooks.useCustomMDMS(s,"request-service",[{name:"ServiceType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.ServiceType}}).data,m=(Digit.UserService.getUser(),l.useState((null==u||null===(i=u.serviceType)||void 0===i?void 0:i.serviceType)||"")),p=m[0],E=m[1],f=l.useCallback(()=>{let e=c({},u.serviceType,{serviceType:p});r(a.key,e,!1)},[u.serviceType,p,r,a.key]);return l.useEffect(()=>{"citizen"===d&&(console.log("calling meeeeeee"),f())},[p,d,f]),n.createElement(t.Modal,{headerBarMain:n.createElement(Qo,{t:o}),headerBarEnd:n.createElement(Xo,{onClick:()=>window.history.back()}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"50vh",width:"50%",overflowY:"visible"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},n.createElement(n.Fragment,null,n.createElement(t.FormStep,{config:a,onSelect:f,t:o,isDisabled:!p},n.createElement("div",null,n.createElement(t.CardLabel,null,""+o("REQUEST_TYPE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:p,placeholder:"Select Service Type",select:E,option:v,optionKey:"i18nKey",t:o})))))},ToiletRequestDetails:e=>{var i,o,a,r,d,u;let s=e.t,v=e.config,m=e.onSelect,p=e.userType,E=e.formData;const f=Digit.UserService.getUser().info,g=l.useState((null==E||null===(i=E.toiletRequestDetails)||void 0===i?void 0:i.mobileToilet)||""),_=g[0],h=g[1],y=l.useState((null==E||null===(o=E.toiletRequestDetails)||void 0===o?void 0:o.deliveryfromTime)||""),T=y[0],S=y[1],b=l.useState((null==E||null===(a=E.toiletRequestDetails)||void 0===a?void 0:a.deliverytoTime)||""),N=b[0],I=b[1],D=l.useState((null==E||null===(r=E.toiletRequestDetails)||void 0===r?void 0:r.deliveryfromDate)||""),C=D[0],A=D[1],x=l.useState((null==E||null===(d=E.toiletRequestDetails)||void 0===d?void 0:d.deliverytoDate)||""),O=x[0],w=x[1],L=l.useState((null==E||null===(u=E.toiletRequestDetails)||void 0===u?void 0:u.specialRequest)||""),P=L[0],R=L[1],k=Digit.ULBService.getStateId(),M={width:"EMPLOYEE"===f.type?"52%":"100%"},F=Digit.Hooks.useCustomMDMS(k,"request-service",[{name:"NoOfMobileToilet"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.NoOfMobileToilet}}).data;let B=[];F&&F.map(e=>{B.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})});const W=()=>n.createElement("div",{className:"flex items-center"},n.createElement(t.TextInput,{type:"time",value:T,style:M,onChange:e=>S(e.target.value),min:"06:00",max:"23:59"})),U=()=>n.createElement("div",{className:"flex items-center"},n.createElement(t.TextInput,{type:"time",value:N,style:M,onChange:e=>I(e.target.value),min:"06:00",max:"23:59"})),H=()=>{let e=c({},E.toiletRequestDetails,{mobileToilet:_,deliveryfromTime:T,deliverytoTime:N,deliveryfromDate:C,deliverytoDate:O,specialRequest:P});m(v.key,e,!1)};return l.useEffect(()=>{"citizen"===p&&H()},[_,T,N,C,O,P]),n.createElement(n.Fragment,null,n.createElement(t.FormStep,{config:v,onSelect:H,t:s,isDisabled:!(_&&T&&N&&C&&O&&P)},n.createElement("div",null,n.createElement(t.CardLabel,null,s("MT_NUMBER_OF_MOBILE_TOILETS")," ",n.createElement("span",{className:"check-page-link-button"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:_,placeholder:"Select Number of Mobile Toilets",select:h,option:B,style:M,optionKey:"i18nKey",t:s}),n.createElement(t.CardLabel,null,""+s("MT_DELIVERY_FROM_DATE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",style:M,value:C,onChange:function(e){A(e.target.value)},min:(new Date).toISOString().split("T")[0],rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||s("ERR_DEFAULT_INPUT_FIELD_MSG")}}),n.createElement(t.CardLabel,null,""+s("MT_DELIVERY_TO_DATE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",value:O,style:M,onChange:function(e){w(e.target.value)},min:C,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||s("ERR_DEFAULT_INPUT_FIELD_MSG")}}),n.createElement(t.CardLabel,null,""+s("MT_REQUIREMNENT_FROM_TIME")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(W,null),n.createElement(t.CardLabel,null,""+s("MT_REQUIREMNENT_TO_TIME")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(U,null),n.createElement(t.CardLabel,null,""+s("MT_SPECIAL_REQUEST")," ",n.createElement("span",{className:"check-page-link-button"})),n.createElement(t.TextArea,{t:s,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"mobileToilet",style:M,placeholder:"Special Request",value:P,onChange:function(e){R(e.target.value)},style:{width:"EMPLOYEE"===f.type?"51.6%":null}}))))},TreePruningRequestDetails:e=>{var i,o,a;let r=e.t,d=e.config,u=e.onSelect,s=e.userType,v=e.formData;const m=Digit.UserService.getUser().info,p=l.useState((null==v||null===(i=v.treePruningRequestDetails)||void 0===i?void 0:i.reasonOfPruning)||""),E=p[0],f=p[1],g=l.useState(""),_=g[0],h=g[1],y=l.useState(""),T=y[0],S=y[1],b=l.useState((null==v||null===(o=v.treePruningRequestDetails)||void 0===o?void 0:o.geoTagLocation)||""),N=b[0],I=b[1],D=l.useState((null==v||null===(a=v.treePruningRequestDetails)||void 0===a?void 0:a.supportingDocumentFile)||""),C=D[0],A=D[1],x=l.useState(!1),O=x[0],w=x[1],L=l.useState("")[0],P=Digit.ULBService.getStateId(),R={width:"EMPLOYEE"===m.type?"50%":"100%"},k=Digit.Hooks.useCustomMDMS(P,"request-service",[{name:"ReasonPruningType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.ReasonPruningType}}).data,M=()=>{let e=c({},v.treePruningRequestDetails,{reasonOfPruning:E,geoTagLocation:N,supportingDocumentFile:C,latitude:_,longitude:T});u(d.key,e,!1)};l.useEffect(()=>{"citizen"===s&&M()},[E,N,C,O]);const F=()=>n.createElement("div",{className:"loading-spinner"});return n.createElement(t.FormStep,{config:d,onSelect:M,t:r,isDisabled:!E||!C},n.createElement("div",null,n.createElement(t.CardLabel,null,r("REASON_FOR_PRUNING")," ",n.createElement("span",{className:"check-page-link-button"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:E,placeholder:"Select Reason",select:f,option:k,style:R,optionKey:"code",t:r}),n.createElement(t.CardLabel,null,r("LOCATION_GEOTAG")),n.createElement("div",{style:{display:"flex",alignItems:"stretch",gap:"8px",width:"EMPLOYEE"===m.type?"53%":"100%"}},n.createElement(t.TextInput,{t:r,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"geoTagLocation",value:N,placeholder:"Select Location",onChange:e=>{const t=e.target?e.target:{name:e.name,value:e},l=t.name,n=t.value;"reasonOfPruning"===l?f(n):"geoTagLocation"===l||"location"===l?I(n):"supportingDocumentFile"===l&&A(n)},max:(new Date).toISOString().split("T")[0],style:{flex:1},rules:{required:r("dddddddd"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||r("hhhhhhh")},className:"location-input"}),n.createElement("div",{className:"butt-icon",onClick:()=>{"geolocation"in navigator?navigator.geolocation.getCurrentPosition(e=>{const t=e.coords,l=t.latitude,n=t.longitude;I(l+", "+n),h(l),S(n)},e=>{console.error("Error getting location:",e),alert("Unable to retrieve your location. Please check your browser settings.")}):alert("Geolocation is not supported by your browser.")},style:{cursor:"pointer",width:"25px",marginBottom:"8px"}},n.createElement(t.LocationIcon,{className:"fill-path-primary-main"}))),n.createElement(t.CardLabel,null,r("UPLOAD_THE_SITE_PHOTOGRAPH")," ",n.createElement("span",{className:"check-page-link-button"},"*")),n.createElement("div",{style:c({marginBottom:"16px"},R)},n.createElement(t.UploadFile,{id:"supportingDocument",onUpload:e=>((e,t)=>{const l=e.target.files[0];l.size>=5242880?(setError("supportingDocument",{message:r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")}),t(null)):(w(!0),Digit.UploadServices.Filestorage("TP",l,Digit.ULBService.getStateId()).then(e=>{var l,n;(null==e||null===(l=e.data)||void 0===l||null===(n=l.files)||void 0===n?void 0:n.length)>0?t(e.data.files[0].fileStoreId):setError("supportingDocument",{message:r("CS_FILE_UPLOAD_ERROR")})}).catch(()=>setError("supportingDocument",{message:r("CS_FILE_UPLOAD_ERROR")})).finally(()=>w(!1)))})(e,A),onDelete:()=>{A(null)},message:O?n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},n.createElement(F,null),n.createElement("span",null,"Uploading...")):C?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},accept:"image/*, .pdf, .png, .jpeg, .jpg",buttonType:"button",error:L||!C}))))},MTAcknowledgement:e=>{let a=e.data,r=e.onSuccess;const d=i.useTranslation().t,u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useMobileToiletCreateAPI(u),v=Digit.UserService.getUser().info,m=(Digit.Hooks.useStore.getInitData().data||{}).tenants;return l.useEffect(()=>{try{a.tenantId=u;let e=y(a);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?n.createElement(t.Loader,null):n.createElement(t.Card,null,n.createElement(ta,{t:d,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),n.createElement(t.StatusTable,null,s.isSuccess&&n.createElement(t.Row,{rowContainerStyle:ea,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&n.createElement(t.SubmitBar,{label:d("MT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.mobileToiletBookingDetail;const l=m.find(e=>e.code===t.tenantId);return Promise.resolve(Jo(c({},t),l,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),n.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},n.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},TPAcknowledgement:e=>{let a=e.data,r=e.onSuccess;const d=i.useTranslation().t,u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useTreePruningCreateAPI(u),v=Digit.UserService.getUser().info,m=(Digit.Hooks.useStore.getInitData().data||{}).tenants;return l.useEffect(()=>{try{a.tenantId=u;let e=T(a);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?n.createElement(t.Loader,null):n.createElement(t.Card,null,n.createElement(aa,{t:d,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),n.createElement(t.StatusTable,null,s.isSuccess&&n.createElement(t.Row,{rowContainerStyle:oa,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&n.createElement(t.SubmitBar,{label:d("TP_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.treePruningBookingDetail;const l=m.find(e=>e.code===t.tenantId);return Promise.resolve(na(c({},t),l,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),n.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},n.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},MTCitizenCard:()=>{const e=i.useTranslation().t,o=l.useState("-"),a=o[0],r=o[1],d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),u=Digit.Hooks.useNewInboxGeneral({tenantId:d,ModuleCode:"WT",filters:{limit:10,offset:0,services:["mobileToilet"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.mtAccess()}}),s=u.data,c=u.isFetching,v=u.isSuccess;l.useEffect(()=>{!c&&v&&r(s)},[c]);const m=[{label:e("ES_COMMON_INBOX"),link:"/digit-ui/citizen/wt/mt/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/citizen/wt/mt/my-bookings"}],p={Icon:n.createElement(t.CHBIcon,null),moduleName:e("ACTION_TEST_MT"),kpis:[{count:null==a?void 0:a.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/wt/mt/inbox"}],links:m};return n.createElement(t.EmployeeModuleCard,p)},FixedPointScheduleManagement:fe,LiveTrackingSystem:Oe,AddFillingPointAddress:Re,AddFixPointAddress:ke,AddFillingPointMetaData:we,WTSearchPointAddress:je,VendorAssign:ze,EmergencyFixedPointInfoPage:e=>{let i=e.t,o=e.onSelect,a=e.formData,r=e.config;const d=l.useState(""),u=d[0],s=d[1],v=l.useState(!1),m=v[0],p=v[1],E=l.useState(!1)[0],f="WT_EMERGENCY_WATER_TANKER_REQUEST"!==i("WT_EMERGENCY_WATER_TANKER_REQUEST")?i("WT_EMERGENCY_WATER_TANKER_REQUEST"):"Emergency Water Tanker Request",g=()=>{const e=c({},a.infodetails||{},{existingDataSet:u});o(r.key,c({},a[r.key],e))};return n.createElement(n.Fragment,null,n.createElement(t.Card,{className:"search-form-wrapper",style:{flexDirection:"column",gap:"12px",justifyContent:"flex-start"}},n.createElement(t.CardHeader,null,f),n.createElement("div",null,n.createElement("p",{className:"primaryColor"},i("SV_DOC_REQ_SCREEN_SUB_HEADER")),n.createElement("p",{className:"primaryColor"},i("SV_DOC_REQ_SCREEN_TEXT")),n.createElement("p",{className:"primaryColor"},i("SV_DOC_REQ_SCREEN_SUB_TEXT"))),n.createElement("span",null,n.createElement(t.SubmitBar,{label:i("COMMON_NEXT"),onSubmit:()=>{E?p(!0):g()}}))),m&&n.createElement(M,{t:i,closeModal:()=>p(!1),actionCancelOnSubmit:()=>p(!1),onSubmit:()=>{g(),p(!1)},setExistingDataSet:s}))},EmergencyFixedPointRequestDetails:e=>{var i,o,a,r,d,u,s,v,m;let p=e.t,E=e.config,f=e.onSelect,g=e.formData;Digit.UserService.getUser();let _={};const h=l.useState((null==g||null===(i=g.requestDetails)||void 0===i?void 0:i.tankerType)||{code:"TANKER",i18nKey:"TANKER",value:"TANKER"})[0],y=l.useState((null==g||null===(o=g.requestDetails)||void 0===o?void 0:o.tankerQuantity)||{i18nKey:"1",code:"1",value:"1"}),T=y[0],S=y[1],b=l.useState((null==g||null===(a=g.requestDetails)||void 0===a?void 0:a.waterQuantity)||""),N=b[0],I=b[1],C=l.useState((null==g||null===(r=g.requestDetails)||void 0===r?void 0:r.waterType)||""),A=C[0],x=C[1],O=l.useState((null==g||null===(d=g.requestDetails)||void 0===d?void 0:d.deliveryDate)||(new Date).toISOString().split("T")[0]),w=O[0],L=O[1],P=l.useState((null==g||null===(u=g.requestDetails)||void 0===u?void 0:u.description)||""),R=P[0],k=P[1],M=l.useState((null==g||null===(s=g.requestDetails)||void 0===s?void 0:s.deliveryTime)||(new Date).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"})),F=M[0],B=M[1],W=l.useState((null==g||null===(v=g.requestDetails)||void 0===v?void 0:v.extraCharge)||!1),U=W[0],H=W[1],j=l.useState((null==g||null===(m=g.requestDetails)||void 0===m?void 0:m.fileStoreId)||null),V=j[0],z=j[1],K=l.useState(null),G=K[0],q=K[1],Y=l.useState(null),X=Y[0],Q=Y[1],Z=Digit.ULBService.getStateId(),J={width:"100%"},$=Digit.Hooks.useCustomMDMS(Z,"request-service",[{name:"VehicleType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.VehicleType}}).data,ee=Digit.Hooks.useCustomMDMS(Z,"request-service",[{name:"TankerType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerType}}).data,te=Digit.Hooks.useCustomMDMS(Z,"request-service",[{name:"TankerQuantity"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerQuantity}}).data,le=Digit.Hooks.useCustomMDMS(Z,"Request-service",[{name:"WaterType"}],{select:e=>{var t;return null==e||null===(t=e["Request-service"])||void 0===t?void 0:t.WaterType}}).data;let ne=[],ie=[],oe=[];le&&le.map(e=>{oe.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),te&&te.map(e=>{ie.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),$&&$.map(e=>{ne.push({i18nKey:""+e.capacity,code:""+e.capacity,value:""+e.capacity,vehicleType:e.vehicleType,capacityName:e.capacityName})}),ee&&ee.map(e=>{});let ae=ne.filter(e=>{const t=e.vehicleType?e.vehicleType.toLowerCase():"";return t===(null!=h&&h.code?h.code.toLowerCase():"")||t.includes("tanker")}).map(e=>({i18nKey:""+e.capacityName,code:""+e.code,value:""+e.value,capacity:""+e.capacity}));0===ae.length&&ne.length>0&&(ae=ne.map(e=>({i18nKey:""+e.capacityName,code:""+e.code,value:""+e.value,capacity:""+e.capacity})));const re=()=>n.createElement("div",{className:"flex items-center"},n.createElement(t.TextInput,{type:"time",value:F,style:J,onChange:e=>B(e.target.value),min:"06:00",max:"23:59"}));return l.useEffect(()=>{!function(){try{Q(null);const e=function(){if(G){const e=function(){if(G.size>=2e6)Q(p("WT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("wt",G,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?z(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):Q(p("WT_FILE_UPLOAD_ERROR"))})},function(){Q(p("WT_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[G]),l.useEffect(()=>{if(!A&&null!=le&&le.length){const e=le.find(e=>{var t,l;return"Drinkable"===e.code||"DRINKABLE"===(null===(t=e.code)||void 0===t?void 0:t.toUpperCase())||"DRINKING_WATER"===(null===(l=e.code)||void 0===l?void 0:l.toUpperCase())});x(e?{i18nKey:""+e.code,code:""+e.code,value:""+e.code}:{i18nKey:""+le[0].code,code:""+le[0].code,value:""+le[0].code})}},[le,A]),n.createElement(n.Fragment,null,n.createElement(t.FormStep,{config:E,onSelect:()=>{let e=c({},g.requestDetails,{tankerType:h,deliveryDate:w,tankerQuantity:T,waterType:A,waterQuantity:N,deliveryTime:F,description:R,extraCharge:U,fileStoreId:V});f(E.key,e,!1)},t:p,isDisabled:!(h&&w&&T&&N&&F&&A),className:"card-form-container"},n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_WATER_TYPE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:A,placeholder:p("WT_SELECT_WATER_TYPE"),select:x,option:oe,style:J,optionKey:"i18nKey",t:p})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_WATER_QUANTITY")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:N,placeholder:"Select Water Quantity",select:I,option:ae,style:J,optionKey:"i18nKey",t:p})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_TANKER_QUANTITY")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:T,placeholder:"Select Tanker Quantity",select:S,option:ie,style:J,optionKey:"i18nKey",t:p})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_DELIVERY_DATE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextInput,{t:p,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",style:J,value:w,onChange:function(e){L(e.target.value)},min:(new Date).toISOString().split("T")[0],max:(new Date).toISOString().split("T")[0],rules:{required:p("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||p("ERR_DEFAULT_INPUT_FIELD_MSG")}})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_DELIVERY_TIME")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(re,null)),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_UPLOAD_DOCUMENT")),n.createElement(t.UploadFile,{id:"wt-doc",extraStyleName:"propertyCreate",accept:".jpg,.png,.pdf,.jpeg",onUpload:function(e){z(null),q(e.target.files[0])},onDelete:()=>{z(null)},message:V?"1 "+p("WT_ACTION_FILEUPLOADED"):p("WT_ACTION_NO_FILEUPLOADED"),error:X})),n.createElement("div",null,n.createElement(t.CardLabel,null,""+p("WT_DESCRIPTION")),n.createElement(t.TextArea,c({t:p,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"description",value:R,onChange:function(e){k(e.target.value)},style:J,ValidationRequired:!1},_={isRequired:!1,pattern:"^[a-zA-Z ]+$",type:"tel",title:p("PT_NAME_ERROR_MESSAGE")}))),X?n.createElement("div",{style:{height:"20px",width:"100%",fontSize:"20px",color:"red",marginTop:"5px"}},X):"",n.createElement(t.CheckBox,{label:p("WT_IMMEDIATE"),onChange:()=>{H(!U)},checked:U})))},EmergencyFixedPointCheckPage:e=>{var a,r,d,u,s,c,v,m,p,E,_,y,T,S,b,N,I,D,C,A,x,O;let w=e.onSubmit,L=e.value,P=void 0===L?{}:L;const R=i.useTranslation().t,k=o.useLocation().pathname,M=P.owner,F=P.requestDetails,B=P.dispatchDetails,W=P.address,U=P.serviceType,H=P.toiletRequestDetails,j=P.treePruningRequestDetails,V=l.useState(!1),z=V[0],K=V[1],G=null!=F&&F.extraCharge?"YES":"NO",q=l.useState(null)[1],Y=!(null!=U&&null!==(a=U.serviceType)&&void 0!==a&&a.code)||"WT"===(null==U||null===(r=U.serviceType)||void 0===r?void 0:r.code),X=k.includes("citizen")?"/digit-ui/citizen/wt/fixed-point/request-service":"/digit-ui/employee/wt/fixed-point/request-service";return n.useEffect(()=>{null!=F&&F.fileStoreId&&Digit.UploadServices.Filefetch([null==F?void 0:F.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var t,l,n,i;const o=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.url)||void 0===i?void 0:i.split(",")[0];q(o)})},[null==F?void 0:F.fileStoreId]),n.createElement(n.Fragment,null,n.createElement(t.Card,{className:"overflow-y-scroll"},n.createElement(t.CardHeader,null,R("WT_SUMMARY_PAGE")),n.createElement("div",null,n.createElement(t.CardSubHeader,null,R("ES_APPLICANT_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:"YES"===(null==M||null===(d=M.isExistingFixedPoint)||void 0===d?void 0:d.code)||"FIXED-POINT"===(null==M?void 0:M.type)?R("WT_FIXED_POINT_DELIVERY_POINT","Fixed Point/Delivery Point"):R("COMMON_APPLICANT_NAME"),text:""+R(f(null==M?void 0:M.applicantName)),actionButton:n.createElement(ua,{jumpTo:X+"/fp-applicant-details"})}),n.createElement(t.Row,{label:R("COMMON_MOBILE_NUMBER"),text:""+R(f(null==M?void 0:M.mobileNumber))}),n.createElement(t.Row,{label:R("COMMON_ALT_MOBILE_NUMBER"),text:""+R(f(null==M?void 0:M.alternateNumber))}),n.createElement(t.Row,{label:R("COMMON_EMAIL_ID"),text:""+R(f(null==M?void 0:M.emailId))})),n.createElement(t.CardSubHeader,null,R("ES_TITLE_ADDRESS_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:R("HOUSE_NO"),text:""+R(f(null==W?void 0:W.houseNo)),actionButton:n.createElement(ua,{jumpTo:X+"/fp-address-details"})}),n.createElement(t.Row,{label:R("ADDRESS_LINE1"),text:""+R(f(null==W?void 0:W.addressLine1))}),n.createElement(t.Row,{label:R("ADDRESS_LINE2"),text:""+R(f(null==W?void 0:W.addressLine2))}),n.createElement(t.Row,{label:R("CITY"),text:""+R(f(null==W||null===(u=W.city)||void 0===u||null===(s=u.city)||void 0===s?void 0:s.name))}),n.createElement(t.Row,{label:R("LOCALITY"),text:""+R(f(null==W||null===(c=W.locality)||void 0===c?void 0:c.i18nKey))}),n.createElement(t.Row,{label:R("PINCODE"),text:""+R(f(null==W?void 0:W.pincode))}),n.createElement(t.Row,{label:R("LATITUDE"),text:""+R(f(null==W?void 0:W.latitude))}),n.createElement(t.Row,{label:R("LONGITUDE"),text:""+R(f(null==W?void 0:W.longitude))}),n.createElement(t.Row,{label:R("ASSEMBLY"),text:""+R(f("string"==typeof(null==W?void 0:W.assembly)?null==W?void 0:W.assembly:null==W||null===(v=W.assembly)||void 0===v?void 0:v.name))}),n.createElement(t.Row,{label:R("BLOCK"),text:""+R(f("string"==typeof(null==W?void 0:W.block)?null==W?void 0:W.block:(null==W||null===(m=W.block)||void 0===m?void 0:m.name)||(null==W||null===(p=W.ward)||void 0===p?void 0:p.name)))}),n.createElement(t.Row,{label:R("ZONE"),text:""+R(f("string"==typeof(null==W?void 0:W.zone)?null==W?void 0:W.zone:null==W||null===(E=W.zone)||void 0===E?void 0:E.name))}),n.createElement(t.Row,{label:R("LANDMARK"),text:""+R(f(null==W?void 0:W.landmark))}),n.createElement(t.Row,{label:R("STREET_NAME"),text:""+R(f(null==W?void 0:W.streetName))})),n.createElement(t.CardSubHeader,null,R("WT_DISPATCH_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:R("WT_FILLING_POINT"),text:""+R(f(null==B||null===(_=B.fillingPoint)||void 0===_?void 0:_.name)),actionButton:n.createElement(ua,{jumpTo:X+"/fp-dispatch-details"})}),n.createElement(t.Row,{label:R("WT_VENDOR"),text:""+R(f(null==B||null===(y=B.vendor)||void 0===y?void 0:y.name))}),n.createElement(t.Row,{label:R("WT_VEHICLE"),text:""+R(f(null==B||null===(T=B.vehicle)||void 0===T?void 0:T.name))}),n.createElement(t.Row,{label:R("WT_DRIVER"),text:""+R(f(null==B||null===(S=B.driver)||void 0===S?void 0:S.name))})),Y&&n.createElement(l.Fragment,null,n.createElement(t.CardSubHeader,null,R("WT_REQUEST_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:R("WT_TANKER_TYPE"),text:""+R(f(null==F||null===(b=F.tankerType)||void 0===b?void 0:b.value)),actionButton:n.createElement(ua,{jumpTo:X+"/fp-request-details"})}),n.createElement(t.Row,{label:R("WT_WATER_TYPE"),text:""+R(f(null==F||null===(N=F.waterType)||void 0===N?void 0:N.code))}),n.createElement(t.Row,{label:R("WT_TANKER_QUANTITY"),text:""+R(f(null==F||null===(I=F.tankerQuantity)||void 0===I?void 0:I.code))}),n.createElement(t.Row,{label:R("WT_WATER_QUANTITY"),text:""+R(f(null==F||null===(D=F.waterQuantity)||void 0===D?void 0:D.value))}),n.createElement(t.Row,{label:R("WT_DELIVERY_DATE"),text:""+R(f(h(null==F?void 0:F.deliveryDate)))}),n.createElement(t.Row,{label:R("WT_DELIVERY_TIME"),text:""+f(g(null==F?void 0:F.deliveryTime))}),n.createElement(t.Row,{label:R("WT_DESCRIPTION"),text:""+R(f(null==F?void 0:F.description))}),(null==F?void 0:F.fileStoreId)&&n.createElement(t.Row,{label:R("WT_UPLOAD_DOCUMENT"),text:n.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>sa(null==F?void 0:F.fileStoreId)},n.createElement(t.GenericFileIcon,null))}),n.createElement(t.Row,{label:R("WT_IMMEDIATE"),text:""+R(f(G))}))),"MobileToilet"===(null==U||null===(C=U.serviceType)||void 0===C?void 0:C.code)&&n.createElement(l.Fragment,null,n.createElement(t.CardSubHeader,null,R("ES_REQUEST_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:R("MT_NUMBER_OF_MOBILE_TOILETS"),text:""+R(f(null==H||null===(A=H.mobileToilet)||void 0===A?void 0:A.code)),actionButton:n.createElement(ua,{jumpTo:X+"/fp-request-details"})}),n.createElement(t.Row,{label:R("MT_DELIVERY_FROM_DATE"),text:""+R(f(h(null==H?void 0:H.deliveryfromDate)))}),n.createElement(t.Row,{label:R("MT_DELIVERY_TO_DATE"),text:""+R(h(f(null==H?void 0:H.deliverytoDate)))}),n.createElement(t.Row,{label:R("MT_REQUIREMNENT_FROM_TIME"),text:f(g(null==H?void 0:H.deliveryfromTime))}),n.createElement(t.Row,{label:R("MT_REQUIREMNENT_TO_TIME"),text:f(g(null==H?void 0:H.deliverytoTime))}),n.createElement(t.Row,{label:R("MT_SPECIAL_REQUEST"),text:""+R(f(null==H?void 0:H.specialRequest))}))),"TREE_PRUNING"===(null==U||null===(x=U.serviceType)||void 0===x?void 0:x.code)&&n.createElement(l.Fragment,null,n.createElement(t.CardSubHeader,null,R("TP_REQUEST_DETAILS")),n.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},n.createElement(t.Row,{label:R("REASON_FOR_PRUNING"),text:""+R(f(null==j||null===(O=j.reasonOfPruning)||void 0===O?void 0:O.code)),actionButton:n.createElement(ua,{jumpTo:X+"/fp-request-details"})}),n.createElement(t.Row,{label:R("LOCATION_GEOTAG"),text:""+R(f(null==j?void 0:j.geoTagLocation))}),n.createElement(t.Row,{label:R("UPLOAD_THE_SITE_PHOTOGRAPH"),text:n.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>sa(null==j?void 0:j.supportingDocumentFile)},n.createElement(t.GenericFileIcon,null))}))),n.createElement(t.CheckBox,{label:R("FINAL_DECLARATION_MESSAGE"),onChange:()=>{K(!z)},checked:z})),n.createElement(t.SubmitBar,{label:R("COMMON_BUTTON_SUBMIT"),onSubmit:w,disabled:!z})))},WTEmergencyFixedPointAcknowledgement:e=>{let a=e.data,r=e.onSuccess;const d=i.useTranslation().t,u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useTankerCreateAPI(u),v=Digit.UserService.getUser().info,m=(Digit.Hooks.useStore.getInitData().data||{}).tenants;return l.useEffect(()=>{try{a.tenantId=u;let e=(e=>{var t,l,n,i,o,a,r,d,u,s,c,v,m,p,E,f,g,_,h,y,T,S,b,N,I,D,C,A,x,O,w,L,P,R,k,M,F,B,W,U,H,j,V,z,K,G,q,Y,X,Q,Z,J,$,ee,te,le,ne,ie,oe,ae,re,de,ue,se,ce,ve,me,pe,Ee,fe,ge,_e,he,ye,Te,Se,be,Ne,Ie,De,Ce,Ae,xe,Oe,we,Le,Pe,Re,ke,Me,Fe,Be,We,Ue,He,je,Ve,ze,Ke,Ge;const qe=null==e||null===(t=e.owner)||void 0===t?void 0:t.fixedPoint,Ye=(null==qe?void 0:qe.applicantDetail)||{},Xe=(null==qe?void 0:qe.address)||{};return{waterTankerBookingDetail:{id:(null==e?void 0:e.id)||(null==e||null===(l=e.waterTankerBookingDetail)||void 0===l?void 0:l.id)||"",bookingNo:(null==e?void 0:e.bookingNo)||(null==e||null===(n=e.waterTankerBookingDetail)||void 0===n?void 0:n.bookingNo)||null,applicantId:(null==Ye?void 0:Ye.applicantId)||(null==e||null===(i=e.owner)||void 0===i?void 0:i.applicantId)||"",tenantId:null==e?void 0:e.tenantId,tankerType:null===(o=(null==e||null===(a=e.requestDetails)||void 0===a||null===(r=a.tankerType)||void 0===r?void 0:r.code)||(null==e||null===(d=e.requestDetails)||void 0===d?void 0:d.tankerType)||"")||void 0===o?void 0:o.toUpperCase(),waterType:(null==e||null===(u=e.requestDetails)||void 0===u||null===(s=u.waterType)||void 0===s?void 0:s.code)||(null==e||null===(c=e.requestDetails)||void 0===c?void 0:c.waterType),tankerQuantity:(null==e||null===(v=e.requestDetails)||void 0===v||null===(m=v.tankerQuantity)||void 0===m?void 0:m.code)||(null==e||null===(p=e.requestDetails)||void 0===p?void 0:p.tankerQuantity),waterQuantity:(null==e||null===(E=e.requestDetails)||void 0===E||null===(f=E.waterQuantity)||void 0===f?void 0:f.code)||(null==e||null===(g=e.requestDetails)||void 0===g||null===(_=g.waterQuantity)||void 0===_?void 0:_.value)||(null==e||null===(h=e.requestDetails)||void 0===h?void 0:h.waterQuantity),description:null==e||null===(y=e.requestDetails)||void 0===y?void 0:y.description,deliveryDate:null==e||null===(T=e.requestDetails)||void 0===T?void 0:T.deliveryDate,deliveryTime:null==e||null===(S=e.requestDetails)||void 0===S?void 0:S.deliveryTime,extraCharge:null!=e&&null!==(b=e.requestDetails)&&void 0!==b&&b.extraCharge?"Y":"N",addressDetailId:(null==Xe?void 0:Xe.addressId)||(null==e||null===(N=e.address)||void 0===N?void 0:N.addressDetailId)||"",vendorId:(null==e||null===(I=e.dispatchDetails)||void 0===I||null===(D=I.vendor)||void 0===D?void 0:D.id)||(null==e||null===(C=e.owner)||void 0===C||null===(A=C.vendor)||void 0===A?void 0:A.id)||"",vehicleId:(null==e||null===(x=e.dispatchDetails)||void 0===x||null===(O=x.vehicle)||void 0===O?void 0:O.id)||(null==e||null===(w=e.owner)||void 0===w||null===(L=w.vehicle)||void 0===L?void 0:L.id)||"",driverId:(null==e||null===(P=e.dispatchDetails)||void 0===P||null===(R=P.driver)||void 0===R||null===(k=R.owner)||void 0===k?void 0:k.uuid)||(null==e||null===(M=e.dispatchDetails)||void 0===M||null===(F=M.driver)||void 0===F?void 0:F.ownerId)||(null==e||null===(B=e.dispatchDetails)||void 0===B||null===(W=B.driver)||void 0===W?void 0:W.uuid)||(null==e||null===(U=e.dispatchDetails)||void 0===U||null===(H=U.driver)||void 0===H?void 0:H.id)||(null==e||null===(j=e.owner)||void 0===j||null===(V=j.driver)||void 0===V||null===(z=V.owner)||void 0===z?void 0:z.uuid)||(null==e||null===(K=e.owner)||void 0===K||null===(G=K.driver)||void 0===G?void 0:G.ownerId)||"",fillingPointId:(null==e||null===(q=e.dispatchDetails)||void 0===q||null===(Y=q.fillingPoint)||void 0===Y?void 0:Y.id)||(null==e||null===(X=e.owner)||void 0===X||null===(Q=X.fillingPoint)||void 0===Q?void 0:Q.id)||"",vehicleType:(null==e||null===(Z=e.dispatchDetails)||void 0===Z||null===(J=Z.vehicle)||void 0===J?void 0:J.vehicleType)||(null==e||null===($=e.owner)||void 0===$||null===(ee=$.vehicle)||void 0===ee?void 0:ee.vehicleType)||"",vehicleCapacity:(null==e||null===(te=e.dispatchDetails)||void 0===te||null===(le=te.vehicle)||void 0===le?void 0:le.capacity)||(null==e||null===(ne=e.owner)||void 0===ne||null===(ie=ne.vehicle)||void 0===ie?void 0:ie.capacity)||"",applicantDetail:{applicantId:(null==Ye?void 0:Ye.applicantId)||(null==e||null===(oe=e.owner)||void 0===oe?void 0:oe.applicantId)||"",bookingId:(null==Ye?void 0:Ye.bookingId)||"",name:(null==e||null===(ae=e.owner)||void 0===ae?void 0:ae.applicantName)||(null==Ye?void 0:Ye.name)||"",mobileNumber:(null==e||null===(re=e.owner)||void 0===re?void 0:re.mobileNumber)||(null==Ye?void 0:Ye.mobileNumber)||"",alternateNumber:(null==e||null===(de=e.owner)||void 0===de?void 0:de.alternateNumber)||(null==Ye?void 0:Ye.alternateNumber)||"",emailId:(null==e||null===(ue=e.owner)||void 0===ue?void 0:ue.emailId)||(null==Ye?void 0:Ye.emailId)||"",gender:(null==e||null===(se=e.owner)||void 0===se?void 0:se.gender)||(null==Ye?void 0:Ye.gender)||null,type:"FIXED-POINT",fixedPointId:(null==Ye?void 0:Ye.fixedPointId)||""},address:{applicantId:(null==Xe?void 0:Xe.applicantId)||(null==Ye?void 0:Ye.applicantId)||"",addressId:(null==Xe?void 0:Xe.addressId)||(null==e||null===(ce=e.address)||void 0===ce?void 0:ce.addressId)||"",addressType:(null==e||null===(ve=e.address)||void 0===ve||null===(me=ve.addressType)||void 0===me?void 0:me.code)||(null==e||null===(pe=e.address)||void 0===pe?void 0:pe.addressType)||"CORRESPONDENCE",pincode:(null==e||null===(Ee=e.address)||void 0===Ee?void 0:Ee.pincode)||(null==Xe?void 0:Xe.pincode)||"",city:(null==e||null===(fe=e.address)||void 0===fe||null===(ge=fe.city)||void 0===ge||null===(_e=ge.city)||void 0===_e?void 0:_e.name)||(null==e||null===(he=e.address)||void 0===he||null===(ye=he.city)||void 0===ye?void 0:ye.name)||(null==e||null===(Te=e.address)||void 0===Te?void 0:Te.city)||(null==Xe?void 0:Xe.city)||"",cityCode:(null==e||null===(Se=e.address)||void 0===Se||null===(be=Se.city)||void 0===be||null===(Ne=be.city)||void 0===Ne?void 0:Ne.code)||(null==e||null===(Ie=e.address)||void 0===Ie?void 0:Ie.cityCode)||(null==Xe?void 0:Xe.cityCode)||"DJB",addressLine1:(null==e||null===(De=e.address)||void 0===De?void 0:De.addressLine1)||(null==Xe?void 0:Xe.addressLine1)||"",addressLine2:(null==e||null===(Ce=e.address)||void 0===Ce?void 0:Ce.addressLine2)||(null==Xe?void 0:Xe.addressLine2)||"",locality:(null==e||null===(Ae=e.address)||void 0===Ae||null===(xe=Ae.locality)||void 0===xe?void 0:xe.i18nKey)||(null==e||null===(Oe=e.address)||void 0===Oe||null===(we=Oe.locality)||void 0===we?void 0:we.name)||(null==e||null===(Le=e.address)||void 0===Le?void 0:Le.locality)||(null==Xe?void 0:Xe.locality)||"",localityCode:(null==e||null===(Pe=e.address)||void 0===Pe||null===(Re=Pe.locality)||void 0===Re?void 0:Re.code)||(null==e||null===(ke=e.address)||void 0===ke?void 0:ke.localityCode)||(null==Xe?void 0:Xe.localityCode)||"",streetName:(null==e||null===(Me=e.address)||void 0===Me?void 0:Me.streetName)||(null==Xe?void 0:Xe.streetName)||"",houseNo:(null==e||null===(Fe=e.address)||void 0===Fe?void 0:Fe.houseNo)||(null==Xe?void 0:Xe.houseNo)||"",landmark:(null==e||null===(Be=e.address)||void 0===Be?void 0:Be.landmark)||(null==Xe?void 0:Xe.landmark)||"",latitude:(null==e||null===(We=e.address)||void 0===We?void 0:We.latitude)||(null==Xe?void 0:Xe.latitude)||"",longitude:(null==e||null===(Ue=e.address)||void 0===Ue?void 0:Ue.longitude)||(null==Xe?void 0:Xe.longitude)||"",ward:(null==e||null===(He=e.address)||void 0===He?void 0:He.ward)||(null==e||null===(je=e.address)||void 0===je?void 0:je.block)||(null==Xe?void 0:Xe.ward)||"",zone:(null==e||null===(Ve=e.address)||void 0===Ve?void 0:Ve.zone)||(null==Xe?void 0:Xe.zone)||"",constituency:(null==e||null===(ze=e.address)||void 0===ze?void 0:ze.assembly)||(null==e||null===(Ke=e.address)||void 0===Ke?void 0:Ke.constituency)||(null==Xe?void 0:Xe.constituency)||""},WTfileStoreId:null==e||null===(Ge=e.requestDetails)||void 0===Ge?void 0:Ge.fileStoreId,bookingStatus:"BOOKING_CREATED",workflow:{action:"CREATE",comments:"",businessService:"watertanker-fixedpoint",moduleName:"request-service.water_tanker"}}}})(a);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?n.createElement(t.Loader,null):n.createElement(t.Card,{className:"vehicle-details-card"},n.createElement(ma,{t:d,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),n.createElement(t.StatusTable,null,s.isSuccess&&n.createElement(t.Row,{rowContainerStyle:va,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&n.createElement(t.SubmitBar,{label:d("WT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.waterTankerBookingDetail;const l=m.find(e=>e.code===t.tenantId);return Promise.resolve(U(c({},t),l,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),n.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},n.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},MTEmergencyFixedPointAcknowledgement:e=>{let a=e.data,r=e.onSuccess;const d=i.useTranslation().t,u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useMobileToiletCreateAPI(u),v=Digit.UserService.getUser().info,m=(Digit.Hooks.useStore.getInitData().data||{}).tenants;return l.useEffect(()=>{try{a.tenantId=u;let e=y(a);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?n.createElement(t.Loader,null):n.createElement(t.Card,null,n.createElement(fa,{t:d,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),n.createElement(t.StatusTable,null,s.isSuccess&&n.createElement(t.Row,{rowContainerStyle:Ea,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&n.createElement(t.SubmitBar,{label:d("MT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.mobileToiletBookingDetail;const l=m.find(e=>e.code===t.tenantId);return Promise.resolve(Jo(c({},t),l,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),n.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},n.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},EmergencyFixedPointTPAcknowledgement:e=>{let a=e.data,r=e.onSuccess;const d=i.useTranslation().t,u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useTreePruningCreateAPI(u),v=Digit.UserService.getUser().info,m=(Digit.Hooks.useStore.getInitData().data||{}).tenants;return l.useEffect(()=>{try{a.tenantId=u;let e=T(a);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?n.createElement(t.Loader,null):n.createElement(t.Card,null,n.createElement(ha,{t:d,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),n.createElement(t.StatusTable,null,s.isSuccess&&n.createElement(t.Row,{rowContainerStyle:_a,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&n.createElement(t.SubmitBar,{label:d("TP_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.treePruningBookingDetail;const l=m.find(e=>e.code===t.tenantId);return Promise.resolve(na(c({},t),l,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),n.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},n.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},WTEmergencyFixedPointCreate:()=>{var e,t,r,d,u;const s=a.useQueryClient(),m=o.useRouteMatch(),p=i.useTranslation().t,E=o.useLocation().pathname,f=o.useHistory(),g=Digit.Hooks.useSessionStorage("FP_Create",{}),_=g[0],h=g[1],y=g[2],T=Digit.UserService.getUser(),S=Digit.ULBService.getCurrentTenantId(),b=null==T||null===(e=T.info)||void 0===e?void 0:e.uuid,N=Digit.Hooks.useUserSearch(S,{uuid:[b]},{},{enabled:!!b}).data,I=l.useMemo(()=>{let e=[];return ya.forEach(t=>{e=e.concat(t.body)}),e.indexRoute="fp-info",e},[]);l.useEffect(()=>{_&&Object.keys(_).length>0&&window.location.href.includes("/fp-info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(y(),s.invalidateQueries("FP_Create"))},[_,y,s]);const D=l.useCallback((e,t,l,n)=>{let i,o=E.split("/").pop(),a=!1;const r=o.charAt(o.length-1);Number(parseInt(o))||"0"===o||"-1"===o?(o="-1"===o||"-2"===o?E.slice(0,-3).split("/").pop():E.slice(0,-2).split("/").pop(),a=!0):a=!1,isNaN(r)||(a=!0);let d=I.find(e=>n?e.key===n:e.route===o);d||(d=I.find(e=>e.route===o));let u=(d||{}).nextStep,s=void 0===u?{}:u,c=e?f.replace:f.push;if(l&&(s=n),null===s)return c(m.path+"/fp-check");i=isNaN(s.split("/").pop())&&a&&"map"!==s?m.path+"/"+s+"/"+t:m.path+"/"+s,c(i)},[E,I,m.path,f]),C=["fp-applicant-details","fp-address-details","fp-dispatch-details","fp-request-details"],A=l.useRef(_);l.useEffect(()=>{A.current=_},[_]);const x=l.useCallback(function(e,t,l,n,i){void 0===i&&(i=!1);const o=A.current;if("multiple"!==e){if("owners"===e){let l=o.owners||[],i=!0;try{i=JSON.stringify(l[n])!==JSON.stringify(t)}catch(e){i=Object.keys(t).some(e=>{var i;return(null===(i=l[n])||void 0===i?void 0:i[e])!==t[e]})}if(i){l[n]=t;const i=c({},o,{[e]:[...l]});h(i),A.current=i}}else if("units"===e){let e=!0;try{e=JSON.stringify(o.units)!==JSON.stringify(t)}catch(l){e=Object.keys(t).some(e=>{var l;return(null===(l=o.units)||void 0===l?void 0:l[e])!==t[e]})}if(e){const e=c({},o,{units:t});h(e),A.current=e}}else{const l=v(t,Ta),n=c({},o[e],l);let i=!0;try{i=JSON.stringify(o[e])!==JSON.stringify(n)}catch(t){i=Object.keys(n).some(t=>{var l;return(null===(l=o[e])||void 0===l?void 0:l[t])!==n[t]})}if(i){const t=c({},o,{[e]:n});h(t),A.current=t}}null!=t&&t.silent||D(l,n,i,e)}else{let e=c({},o),a=!1;if(Object.keys(t).forEach(l=>{if("navigationKey"!==l&&"silent"!==l){const n=c({},e[l],t[l]);let i=!0;try{i=JSON.stringify(e[l])!==JSON.stringify(n)}catch(t){i=Object.keys(n).some(t=>{var i;return(null===(i=e[l])||void 0===i?void 0:i[t])!==n[t]})}i&&(e[l]=n,a=!0)}}),a&&(h(e),A.current=e),t.silent)return;const r=t.navigationKey||Object.keys(t)[0];D(l,n,i,r)}},[h,D]),O=l.useMemo(()=>I.filter(e=>C.includes(e.route)).map(e=>c({},e,{Component:"string"==typeof e.component?Digit.ComponentRegistryService.getComponent(e.component):e.component,compConfig:c({},e,{isCollapsible:!0,defaultOpen:!0})})),[I]),w=C.some(e=>E.includes(e)),L=l.useRef({});l.useEffect(()=>{if(w){const e=E.split("/").pop();L.current[e]&&L.current[e].scrollIntoView({behavior:"smooth",block:"start"})}},[E,w]);const P=null===(t=Digit)||void 0===t||null===(r=t.ComponentRegistryService)||void 0===r?void 0:r.getComponent("EmergencyFixedPointCheckPage"),R=null===(d=Digit)||void 0===d||null===(u=d.ComponentRegistryService)||void 0===u?void 0:u.getComponent("WTEmergencyFixedPointAcknowledgement");return n.createElement(n.Fragment,null,n.createElement("div",{className:"employee-form-section-wrapper"},n.createElement("div",{className:"employee-form-section"},n.createElement(o.Switch,null,n.createElement(o.Route,{path:m.path+"/fp-check"},n.createElement(P,{onSubmit:function(){try{return f.push(m.path+"/fp-wt-acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:_})),n.createElement(o.Route,{path:m.path+"/fp-wt-acknowledgement"},n.createElement(R,{data:_,onSuccess:()=>{y(),s.invalidateQueries("FP_Create")}})),I.map((e,t)=>{if(!C.includes(e.route)){var l;const i=e.component,a=e.texts,r=e.inputs,d=e.key,u=e.additionaFields,s="string"==typeof i?Digit.ComponentRegistryService.getComponent(i):i;return n.createElement(o.Route,{path:m.path+"/"+e.route,key:t},n.createElement(s,{config:{texts:a,inputs:r,key:d,additionaFields:u},onSelect:x,t:p,formData:_,userDetails:null==N||null===(l=N.user)||void 0===l?void 0:l[0]}))}return null}),n.createElement(o.Route,{path:C.map(e=>m.path+"/"+e)},n.createElement("div",{className:"single-page-form-container"},O.map((e,t)=>{var l;return n.createElement("div",{key:t,ref:t=>L.current[e.route]=t,className:"form-section-unit"},n.createElement(e.Component,{config:e.compConfig,onSelect:x,t:p,formData:_,userDetails:null==N||null===(l=N.user)||void 0===l?void 0:l[0]}))}))),n.createElement(o.Route,null,n.createElement(o.Redirect,{to:m.path+"/"+I.indexRoute}))))))},EmergencyFixedPointApplicantDetails:e=>{var i,o,a,r,d,u,s,v,m,p,E,f,g,_,h,y,T,S,b,N,I,D,C,A,x,O,w,L,P,R,k,M;let F=e.t,B=e.config,W=e.onSelect,U=e.formData;const H=Digit.UserService.getUser().info,j={width:"EMPLOYEE"===H.type?"100%":"86%"};let V={};const z=l.useState(("EMPLOYEE"===H.type?"":null==H?void 0:H.name)||(null==U||null===(i=U.owner)||void 0===i?void 0:i.applicantName)||(null==U||null===(o=U.infodetails)||void 0===o||null===(a=o.existingDataSet)||void 0===a||null===(r=a.owner)||void 0===r?void 0:r.applicantName)||""),K=z[0],G=z[1],q=l.useState(("EMPLOYEE"===H.type?"":null==H?void 0:H.mobileNumber)||(null==U||null===(d=U.owner)||void 0===d?void 0:d.mobileNumber)||(null==U||null===(u=U.infodetails)||void 0===u||null===(s=u.existingDataSet)||void 0===s||null===(v=s.owner)||void 0===v?void 0:v.mobileNumber)||""),Y=q[0],X=q[1],Q=l.useState((null==U||null===(m=U.owner)||void 0===m?void 0:m.gender)||""),Z=Q[0],J=Q[1],$=l.useState((null==U||null===(p=U.owner)||void 0===p?void 0:p.dateOfBirth)||(null==U||null===(E=U.owner)||void 0===E||null===(f=E.requestDetails)||void 0===f?void 0:f.applicantName)||""),ee=$[0],te=$[1],le=l.useState(("EMPLOYEE"===H.type?"":null==H?void 0:H.emailId)||(null==U||null===(g=U.owner)||void 0===g?void 0:g.emailId)||(null==U||null===(_=U.infodetails)||void 0===_||null===(h=_.existingDataSet)||void 0===h||null===(y=h.owner)||void 0===y?void 0:y.emailId)||""),ne=le[0],ie=le[1],oe=l.useState((null==U||null===(T=U.owner)||void 0===T?void 0:T.alternateNumber)||(null==U||null===(S=U.infodetails)||void 0===S||null===(b=S.existingDataSet)||void 0===b||null===(N=b.owner)||void 0===N?void 0:N.alternateNumber)||""),ae=oe[0],re=oe[1],de=l.useState((null==U||null===(I=U.owner)||void 0===I?void 0:I.guardianName)||""),ue=de[0],se=de[1],ce=l.useState((null==U||null===(D=U.owner)||void 0===D?void 0:D.relationShipType)||""),ve=ce[0],me=ce[1],pe=l.useState((null==U||null===(C=U.owner)||void 0===C?void 0:C.fixedPoint)||""),Ee=pe[0],fe=pe[1],ge=l.useState(null),_e=ge[0],he=ge[1],ye=l.useState(""),Te=ye[0],Se=ye[1],be=l.useState(""),Ne=be[0],Ie=be[1];n.useEffect(()=>{const e=setTimeout(()=>{Ie(Te)},500);return()=>clearTimeout(e)},[Te]);const De=n.useCallback(e=>{Se(e)},[]),Ce=l.useState((null==U||null===(A=U.owner)||void 0===A?void 0:A.isExistingFixedPoint)||{code:"YES",name:"Yes",i18nKey:"YES"}),Ae=Ce[0],xe=Ce[1],Oe=Digit.ULBService.getCurrentTenantId(),we=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:Oe,filters:c({limit:1e3},Ne?{name:Ne}:{})},{enabled:"YES"===(null==Ae?void 0:Ae.code)}).data,Le=(null==we||null===(x=we.waterTankerBookingDetail)||void 0===x?void 0:x.map(e=>{var t,l;return c({},e,{name:(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||(null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.fixedPointId)||"NA"})}))||[],Pe=Digit.Hooks.useEnabledMDMS(Digit.ULBService.getStateId(),"common-masters",[{name:"GenderType"}],{select:e=>{var t;return null==e||null===(t=e["common-masters"])||void 0===t?void 0:t.GenderType}}).data;let Re=[];Pe&&Pe.map(e=>{"TRANSGENDER"!==e.code&&Re.push({i18nKey:""+e.code,code:""+e.code,name:""+e.code})});const ke=e=>{if(null==e||""===e)return"";if("object"==typeof e){if(void 0!==e.code)return e.code;if(void 0!==e.uuid)return e.uuid;if(void 0!==e.id)return e.id;try{return JSON.stringify(e)}catch(t){return String(e)}}return String(e)},Me=n.useRef(null);return n.useEffect(()=>{if(!(Ee||Y||ne||ae))return;let e="";var t;e="YES"===(null==Ae?void 0:Ae.code)?(null==Ee||null===(t=Ee.applicantDetail)||void 0===t?void 0:t.name)||(null==Ee?void 0:Ee.name)||"":"string"==typeof Ee?Ee:(null==Ee?void 0:Ee.name)||"";let l={applicantName:e,mobileNumber:Y,gender:Z,dateOfBirth:ee,alternateNumber:ae,relationShipType:ve,guardianName:ue,emailId:ne,fixedPoint:Ee,isExistingFixedPoint:Ae},n=!1;if(Me.current){for(const e of Object.keys(l))if(ke(Me.current[e])!==ke(l[e])){n=!0;break}}else n=!0;const i=(null==U?void 0:U.owner)||{};let o=!1;for(const e of Object.keys(l)){const t=ke(l[e]),n=ke(i[e]);if(t!==n){if(!t&&n)continue;o=!0}}(n||o)&&(Me.current=l,W(B.key,c({},l,{silent:!0}),!1))},[Ee,Ae,Y,Z,ee,ae,ve,ue,ne,W,B.key,null==U?void 0:U.owner]),n.createElement(n.Fragment,null,n.createElement(t.FormStep,{config:B,onSelect:()=>{var e,t,l,n;let i=c({},U.owner||{},{applicantName:"YES"===(null==Ae?void 0:Ae.code)?(null==Ee||null===(e=Ee.applicantDetail)||void 0===e?void 0:e.name)||(null==Ee?void 0:Ee.name)||"":"string"==typeof Ee?Ee:(null==Ee?void 0:Ee.name)||"",mobileNumber:"YES"===(null==Ae?void 0:Ae.code)?(null==Ee||null===(t=Ee.applicantDetail)||void 0===t?void 0:t.mobileNumber)||Y||"":Y||"",alternateNumber:"YES"===(null==Ae?void 0:Ae.code)?(null==Ee||null===(l=Ee.applicantDetail)||void 0===l?void 0:l.alternateNumber)||ae||"":ae||"",emailId:"YES"===(null==Ae?void 0:Ae.code)?(null==Ee||null===(n=Ee.applicantDetail)||void 0===n?void 0:n.emailId)||ne||"":ne||"",gender:Z,dateOfBirth:ee,relationShipType:ve,guardianName:ue,fixedPoint:Ee,isExistingFixedPoint:Ae});_e?W("multiple",{owner:i,address:_e,navigationKey:B.key}):W(B.key,i,!1)},t:F,isDisabled:!Ee||!Y||null!=B&&null!==(O=B.additionaFields)&&void 0!==O&&O.guardianName?!ue:null!=B&&null!==(w=B.additionaFields)&&void 0!==w&&w.dateofBirth?!ee:null!=B&&null!==(L=B.additionaFields)&&void 0!==L&&L.gender?!Z:null,className:"search-form-wrapper"},n.createElement(n.Fragment,null,n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("WT_EXISTING_FIXED_POINT","Existing Fixed Point/Delivery Point?")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.RadioButtons,{t:F,options:[{code:"YES",name:"Yes",i18nKey:"YES"},{code:"NO",name:"No",i18nKey:"NO"}],optionsKey:"i18nKey",name:"isExistingFixedPoint",value:Ae,selectedOption:Ae,onSelect:e=>{xe(e),fe("")},style:{display:"flex",gap:"30px",marginBottom:"0px"},innerStyles:{minWidth:"24%",marginBottom:"0px"}})),n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("Fixed Point/Delivery Point")),"YES"===(null==Ae?void 0:Ae.code)?n.createElement(t.Dropdown,{className:"form-field",selected:Ee,option:Le,select:e=>{if(fe(e),e&&"object"==typeof e){const t=e.applicantDetail;t&&(G(t.name||K),X(t.mobileNumber||Y),re(t.alternateNumber||ae),ie(t.emailId||ne));const l=e.address;if(l){const e={houseNo:l.houseNo||"",streetName:l.streetName||"",addressLine1:l.addressLine1||"",addressLine2:l.addressLine2||"",landmark:l.landmark||"",city:l.city||"",cityCode:l.cityCode||"",locality:l.locality||"",localityCode:l.localityCode||"",pincode:l.pincode?l.pincode.toString().split(".")[0]:""};he(e),W("multiple",{address:e,silent:!0})}}else he(null)},optionKey:"name",t:F,name:"fixedPoint",placeholder:F("WT_SELECT_FIXED_POINT","Select Fixed Point"),onSearch:De}):n.createElement(t.TextInput,{t:F,type:"text",isMandatory:!1,name:"fixedPointText",value:"string"==typeof Ee?Ee:(null==Ee?void 0:Ee.name)||"",onChange:e=>fe(e.target.value),style:j,placeholder:F("WT_ENTER_FIXED_POINT","Enter Fixed Point")})),null!=B&&null!==(P=B.additionaFields)&&void 0!==P&&P.gender?n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("COMMON_GENDER")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.RadioButtons,{t:F,options:Re,style:{display:"flex",flexWrap:"wrap",maxHeight:"30px"},innerStyles:{minWidth:"24%"},optionsKey:"i18nKey",name:"gender",value:Z,selectedOption:Z,onSelect:J,labelKey:"i18nKey",isPTFlow:!0})):null,n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("COMMON_MOBILE_NUMBER")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.MobileNumber,{value:Y,name:"mobileNumber",onChange:e=>{X({value:e}.value)},required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:F("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")})),n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("COMMON_ALT_MOBILE_NUMBER")),n.createElement(t.MobileNumber,{value:ae,name:"alternateNumber",onChange:e=>{re({value:e}.value)},required:!1,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:F("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")})),null!=B&&null!==(R=B.additionaFields)&&void 0!==R&&R.dateofBirth?n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("COMMON_BIRTH_DATE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextInput,{t:F,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"dateOfBirth",value:ee,onChange:function(e){te(e.target.value)},style:j,max:(new Date).toISOString().split("T")[0],rules:{required:F("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||F("ERR_DEFAULT_INPUT_FIELD_MSG")}})):null,null!=B&&null!==(k=B.additionaFields)&&void 0!==k&&k.guardianName?n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("COMMON_GUARDIAN")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.TextInput,c({t:F,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"guardianName",style:j,value:ue,onChange:function(e){se(e.target.value)},ValidationRequired:!0},V={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:F("PT_NAME_ERROR_MESSAGE")}))):null,null!=B&&null!==(M=B.additionaFields)&&void 0!==M&&M.guardianName?n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("COMMON_RELATIONTYPE")," ",n.createElement("span",{className:"astericColor"},"*")),n.createElement(t.Dropdown,{className:"form-field",selected:ve,option:[{name:"Husband",code:"HUSBAND",i18nKey:"COMMON_HUSBAND"},{name:"Father",code:"FATHER",i18nKey:"COMMON_FATHER"}],select:me,optionKey:"i18nKey",t:F,name:"relationShipType",placeholder:"Select"})):null,n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+F("COMMON_EMAIL_ID")),n.createElement(t.TextInput,c({t:F,type:"email",optionKey:"i18nKey",name:"emailId",value:ne,style:j,onChange:function(e){ie(e.target.value)},ValidationRequired:!0},V={isRequired:!0,pattern:"^[a-zA-Z0-9._%+-]+@[a-zA-Z]+\\.[a-zA-Z]{3,4}$",type:"email",title:F("PT_NAME_ERROR_MESSAGE")}))))))},EmergencyFixedPointDispatchDetails:e=>{var i,a,r,d,u,s;let v=e.t,m=e.config,p=e.onSelect,E=e.formData;const f=Digit.ULBService.getCurrentTenantId(),g=l.useState((null==E||null===(i=E.dispatchDetails)||void 0===i?void 0:i.fillingPoint)||""),_=g[0],h=g[1],y=l.useState((null==E||null===(a=E.dispatchDetails)||void 0===a?void 0:a.vendor)||""),T=y[0],S=y[1],b=l.useState((null==E||null===(r=E.dispatchDetails)||void 0===r?void 0:r.vehicle)||""),N=b[0],I=b[1],D=l.useState((null==E||null===(d=E.dispatchDetails)||void 0===d?void 0:d.driver)||""),C=D[0],A=D[1],x=Digit.Hooks.wt.useFillPointSearch({tenantId:f,filters:{limit:1e3}},{enabled:!0}).data,O=l.useMemo(()=>{var e;return(null==x||null===(e=x.fillingPoints)||void 0===e?void 0:e.map(e=>c({},e,{name:(null==e?void 0:e.fillingPointName)||"NA"})))||[]},[x]),w=Digit.Hooks.fsm.useVendorSearch({tenantId:f,filters:c({},null!=_&&_.fillingPointId?{fillingPointId:_.id}:{}),config:{enabled:!0}}).data,L=l.useMemo(()=>{var e;return(null==w||null===(e=w.vendor)||void 0===e?void 0:e.map(e=>c({},e,{name:(null==e?void 0:e.name)||(null==e?void 0:e.vendor_id)||"NA"})))||[]},[w]),P=l.useMemo(()=>{var e;return T&&"object"==typeof T&&(null===(e=T.vehicles)||void 0===e?void 0:e.map(e=>c({},e,{name:(null==e?void 0:e.registrationNumber)||(null==e?void 0:e.type)||"NA"})))||[]},[T]),R=l.useMemo(()=>({registrationNumber:null==N?void 0:N.registrationNumber}),[null==N?void 0:N.registrationNumber]),k=Digit.Hooks.fsm.useVehiclesSearch({tenantId:f,filters:R,config:{enabled:!(null==N||!N.registrationNumber)}}).data;l.useEffect(()=>{var e,t;const l=null==k||null===(e=k.vehicle)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.driverData;if(l){const e=c({},l,{name:(null==l?void 0:l.name)||(null==l?void 0:l.licenseNumber)||"NA"});(null==C?void 0:C.id)!==e.id&&A(e)}else k&&""!==C&&A("")},[k,C]);const M=n.useRef(null);return n.useEffect(()=>{const e={fillingPoint:_,vendor:T,vehicle:N,driver:C};let t=!0;try{t=JSON.stringify(M.current)!==JSON.stringify(e)}catch(l){t=Object.keys(e).some(t=>{var l;return(null===(l=M.current)||void 0===l?void 0:l[t])!==e[t]})}t&&(M.current=e,p(m.key,c({},e,{silent:!0}),!1))},[_,T,N,C,p,m.key]),n.createElement(n.Fragment,null,n.createElement(t.FormStep,{config:m,onSelect:()=>{p(m.key,{fillingPoint:_,vendor:T,vehicle:N,driver:C},!1)},t:v,isDisabled:!(_&&T&&N&&C),className:"search-form-wrapper"},n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+v("WT_FILLING_POINT","Filling Point")),n.createElement(t.Dropdown,{className:"form-field",selected:_,option:O,select:h,optionKey:"name",t:v,name:"fillingPoint",placeholder:v("WT_SELECT_FILLING_POINT","Select Filling Point")})),n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+v("WT_VENDOR","Vendor")),n.createElement(t.Dropdown,{className:"form-field",selected:T,option:L,select:e=>{S(e),I(""),A("")},optionKey:"name",t:v,name:"vendor",placeholder:v("WT_SELECT_VENDOR","Select Vendor")})),n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+v("WT_VEHICLE","Vehicle")),n.createElement(t.Dropdown,{className:"form-field",selected:N,option:P,select:I,optionKey:"name",t:v,name:"vehicle",placeholder:v("WT_SELECT_VEHICLE","Select Vehicle")})),n.createElement("div",{className:"form-field wns-search-field"},n.createElement(t.CardLabel,null,""+v("WT_DRIVER","Driver")),n.createElement(t.TextInput,{className:"form-field",value:(null==C?void 0:C.name)||C||"",disabled:!0,t:v,name:"driver"}),(null==N?void 0:N.registrationNumber)&&k&&!(null!=k&&null!==(u=k.vehicle)&&void 0!==u&&null!==(s=u[0])&&void 0!==s&&s.driverData)&&n.createElement("div",{style:{marginTop:"10px",color:"red",fontSize:"14px"}},v("WT_DRIVER_NOT_MAPPED","Please map the driver with the selected vehicle to proceed further - "),n.createElement(o.Link,{to:"/digit-ui/employee/vendor/search-vendor",style:{color:"#a82227",textDecoration:"underline",fontWeight:"bold"}},v("WT_CLICK_HERE","click here"))))))}};exports.WTComponents={WTCard:z,WTModule:Sa,MTCard:()=>{const e=i.useTranslation().t,o=l.useState("-"),a=o[0],r=o[1],d=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"MT",filters:{limit:10,offset:0,services:["mobileToilet"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.mtAccess()}}),u=d.data,s=d.isLoading,c=d.isFetching,v=d.isSuccess;if(l.useEffect(()=>{!c&&v&&r(u)},[c]),!Digit.Utils.mtAccess())return null;const m=[{count:s?"-":null==a?void 0:a.totalCount,label:e("ES_COMMON_INBOX"),link:"/digit-ui/employee/wt/mt/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/wt/mt/my-bookings"},{label:e("MT_APPLICATION_CREATE"),link:"/digit-ui/employee/wt/mt/request-service"}],p=Digit.UserService.hasAccess(["MT_CEMP"])||!1,E={Icon:n.createElement(t.CHBIcon,null),moduleName:e("ACTION_TEST_MT"),kpis:[{count:null==a?void 0:a.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/mt/inbox"}],links:m.filter(e=>!(null!=e&&e.role)||p)};return n.createElement(t.EmployeeModuleCard,E)},TPCard:()=>{const e=i.useTranslation().t,o=l.useState("-"),a=o[0],r=o[1],d=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"TP",filters:{limit:10,offset:0,services:["treePruning"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.tpAccess()}}),u=d.data,s=d.isLoading,c=d.isFetching,v=d.isSuccess;l.useEffect(()=>{!c&&v&&r(u)},[c]);const m=[{count:s?"-":null==a?void 0:a.totalCount,label:e("ES_COMMON_INBOX"),link:"/digit-ui/employee/wt/tp/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/wt/tp/my-bookings"},{label:e("TP_APPLICATION_CREATE"),link:"/digit-ui/employee/wt/tp/request-service"}],p=Digit.UserService.hasAccess(["TP_CEMP"])||!1,E={Icon:n.createElement(t.CHBIcon,null),moduleName:e("ACTION_TEST_TP"),kpis:[{count:null==a?void 0:a.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/wt/tp/inbox"}],links:m.filter(e=>!(null!=e&&e.role)||p)};return n.createElement(t.EmployeeModuleCard,E)},WTLinks:ba,WT_INBOX_FILTER:e=>n.createElement(el,e),WTInboxTableConfig:e=>({WT:{inboxColumns:t=>[{Header:e("WT_BOOKING_NO"),id:"bookingNo",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""},Cell:e=>{var l,i,a,r;let d=e.row;return n.createElement("div",null,n.createElement("span",{className:"link"},n.createElement(o.Link,{to:(t.detailRoute||t.parentRoute+"/booking-details")+"/"+(null==d||null===(l=d.original)||void 0===l||null===(i=l.searchData)||void 0===i?void 0:i.bookingNo)},null===(a=d.original)||void 0===a||null===(r=a.searchData)||void 0===r?void 0:r.bookingNo)))},mobileCell:e=>{var t;return Yt(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:window.location.href.includes("fixed-point")?e("WT_FIXED_POINT_NAME"):e("WT_APPLICANT_NAME"),id:"applicantName",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""},Cell:e=>{var t,l,n,i,o;return Kt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,l;return Yt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:e("WT_MOBILE_NUMBER"),id:"mobileNumber",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""},Cell:e=>{var t,l,n,i,o;return Kt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,l;return Yt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:e("LOCALITY"),id:"localityCode",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.localityCode)||""},Cell:t=>{var l,n,i,o;let a=t.row;return Kt(Xt(null===(l=a.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.localityCode,null===(i=a.original)||void 0===i||null===(o=i.searchData)||void 0===o?void 0:o.tenantId,e))},mobileCell:t=>{var l,n;return Yt(Xt(null==t||null===(l=t.searchData)||void 0===l?void 0:l.localityCode,null==t||null===(n=t.searchData)||void 0===n?void 0:n.tenantId,e))}},{Header:e("Filling Point"),id:"fillingPoint",accessor:e=>{var t,l,n;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.fillingPointMetadata)||void 0===l?void 0:l.name)||(null==e||null===(n=e.searchData)||void 0===n?void 0:n.fillingPointName)||"-"},Cell:e=>{var t,l,n,i,o;let a=e.row;const r=(null===(t=a.original)||void 0===t||null===(l=t.searchData)||void 0===l||null===(n=l.fillingPointMetadata)||void 0===n?void 0:n.name)||(null===(i=a.original)||void 0===i||null===(o=i.searchData)||void 0===o?void 0:o.fillingPointName)||"-";return Kt(r)},mobileCell:e=>{var t,l,n;return Yt((null==e||null===(t=e.searchData)||void 0===t||null===(l=t.fillingPointMetadata)||void 0===l?void 0:l.name)||(null==e||null===(n=e.searchData)||void 0===n?void 0:n.fillingPointName)||"-")}},{Header:e("CREATED_AT"),id:"createdTime",accessor:e=>Gt(e),Cell:e=>{let t=e.row;return Kt(Gt(null==t?void 0:t.original))},mobileCell:e=>Yt(Gt(e))},{Header:e("WT_STATUS"),id:"applicationStatus",accessor:e=>{var t,l;return(null==e||null===(t=e.workflowData)||void 0===t||null===(l=t.state)||void 0===l?void 0:l.applicationStatus)||""},Cell:t=>{var l,n,i;let o=t.row;return Kt(e(""+(null==o||null===(l=o.original)||void 0===l||null===(n=l.workflowData)||void 0===n||null===(i=n.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var l,n;return Yt(e("ES_WT_COMMON_STATUS_"+(null==t||null===(l=t.workflowData)||void 0===l||null===(n=l.state)||void 0===n?void 0:n.applicationStatus)))}},...window.location.href.includes("fixed-point")?[{Header:e("WT_DELIVERY_DATE_TIME"),id:"deliveryDateTime",accessor:e=>qt(e),Cell:e=>{let t=e.row;return Kt(qt(null==t?void 0:t.original))},mobileCell:e=>Yt(qt(e))},{Header:e("WT_VENDOR_NAME"),id:"vendorName",accessor:e=>Qt(null==e?void 0:e.searchData),Cell:e=>{var t;let l=e.row;return Kt(Qt(null==l||null===(t=l.original)||void 0===t?void 0:t.searchData))},mobileCell:e=>Yt(Qt(null==e?void 0:e.searchData))},{Header:e("WT_VEHICLE_NO"),id:"vehicleNumber",accessor:e=>Zt(null==e?void 0:e.searchData),Cell:e=>{var t;let l=e.row;return Kt(Zt(null==l||null===(t=l.original)||void 0===t?void 0:t.searchData))},mobileCell:e=>Yt(Zt(null==e?void 0:e.searchData))},{Header:e("WT_DRIVER_NAME"),id:"driverName",accessor:e=>Jt(null==e?void 0:e.searchData),Cell:e=>{var t;let l=e.row;return Kt(Jt(null==l||null===(t=l.original)||void 0===t?void 0:t.searchData))},mobileCell:e=>Yt(Jt(null==e?void 0:e.searchData))}]:[]],serviceRequestIdKey:t=>{var l,n;return null==t||null===(l=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===l||null===(n=l.props)||void 0===n?void 0:n.children}},MT:{inboxColumns:t=>[{Header:e("MT_BOOKING_NO"),id:"bookingNo",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""},Cell:e=>{var l,i,a,r;let d=e.row;return n.createElement("div",null,n.createElement("span",{className:"link"},n.createElement(o.Link,{to:t.parentRoute+"/booking-details/"+(null==d||null===(l=d.original)||void 0===l||null===(i=l.searchData)||void 0===i?void 0:i.bookingNo)},null===(a=d.original)||void 0===a||null===(r=a.searchData)||void 0===r?void 0:r.bookingNo)))},mobileCell:e=>{var t;return Yt(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("MT_APPLICANT_NAME"),id:"applicantName",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""},Cell:e=>{var t,l,n,i,o;return Kt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,l;return Yt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:e("MT_MOBILE_NUMBER"),id:"mobileNumber",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""},Cell:e=>{var t,l,n,i,o;return Kt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,l;return Yt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:e("LOCALITY"),id:"localityCode",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.localityCode)||""},Cell:t=>{var l,n,i,o;let a=t.row;return Kt(Xt(null===(l=a.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.localityCode,null===(i=a.original)||void 0===i||null===(o=i.searchData)||void 0===o?void 0:o.tenantId,e))},mobileCell:t=>{var l,n;return Yt(Xt(null==t||null===(l=t.searchData)||void 0===l?void 0:l.localityCode,null==t||null===(n=t.searchData)||void 0===n?void 0:n.tenantId,e))}},{Header:e("MT_STATUS"),id:"applicationStatus",accessor:e=>{var t,l;return(null==e||null===(t=e.workflowData)||void 0===t||null===(l=t.state)||void 0===l?void 0:l.applicationStatus)||""},Cell:t=>{var l,n,i;let o=t.row;return Kt(e(""+(null==o||null===(l=o.original)||void 0===l||null===(n=l.workflowData)||void 0===n||null===(i=n.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var l,n;return Yt(e("ES_WT_COMMON_STATUS_"+(null==t||null===(l=t.workflowData)||void 0===l||null===(n=l.state)||void 0===n?void 0:n.applicationStatus)))}}],serviceRequestIdKey:t=>{var l,n;return null==t||null===(l=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===l||null===(n=l.props)||void 0===n?void 0:n.children}},TP:{inboxColumns:t=>[{Header:e("MT_BOOKING_NO"),id:"bookingNo",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""},Cell:e=>{var l,i,a,r;let d=e.row;return n.createElement("div",null,n.createElement("span",{className:"link"},n.createElement(o.Link,{to:t.parentRoute+"/booking-details/"+(null==d||null===(l=d.original)||void 0===l||null===(i=l.searchData)||void 0===i?void 0:i.bookingNo)},null===(a=d.original)||void 0===a||null===(r=a.searchData)||void 0===r?void 0:r.bookingNo)))},mobileCell:e=>{var t;return Yt(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("MT_APPLICANT_NAME"),id:"applicantName",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""},Cell:e=>{var t,l,n,i,o;return Kt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,l;return Yt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:e("MT_MOBILE_NUMBER"),id:"mobileNumber",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""},Cell:e=>{var t,l,n,i,o;return Kt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,l;return Yt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:e("LOCALITY"),id:"localityCode",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.localityCode)||""},Cell:t=>{var l,n,i,o;let a=t.row;return Kt(Xt(null===(l=a.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.localityCode,null===(i=a.original)||void 0===i||null===(o=i.searchData)||void 0===o?void 0:o.tenantId,e))},mobileCell:t=>{var l,n;return Yt(Xt(null==t||null===(l=t.searchData)||void 0===l?void 0:l.localityCode,null==t||null===(n=t.searchData)||void 0===n?void 0:n.tenantId,e))}},{Header:e("MT_STATUS"),id:"applicationStatus",accessor:e=>{var t,l;return(null==e||null===(t=e.workflowData)||void 0===t||null===(l=t.state)||void 0===l?void 0:l.applicationStatus)||""},Cell:t=>{var l,n,i;let o=t.row;return Kt(e(""+(null==o||null===(l=o.original)||void 0===l||null===(n=l.workflowData)||void 0===n||null===(i=n.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var l,n;return Yt(e("ES_WT_COMMON_STATUS_"+(null==t||null===(l=t.workflowData)||void 0===l||null===(n=l.state)||void 0===n?void 0:n.applicationStatus)))}}],serviceRequestIdKey:t=>{var l,n;return null==t||null===(l=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===l||null===(n=l.props)||void 0===n?void 0:n.children}}})},exports.WTLinks=ba,exports.WTModule=Sa,exports.initWTComponents=()=>{Object.entries(Na).forEach(e=>{Digit.ComponentRegistryService.setComponent(e[0],e[1])})};