@djb25/digit-ui-module-wt 1.0.2 → 1.0.3
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 +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,t=require("@djb25/digit-ui-react-components"),n=require("react"),l=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-router-dom"),r=require("react-query"),a=require("react-hook-form");function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}function c(e,t){if(null==e)return{};var n={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;n[l]=e[l]}return n}const s=[{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"}]}]}],d=["config","onSelect"],v=e=>{let{config:n}=e;c(e,d);const{t:r}=i.useTranslation(),a=o.useLocation(),u=(o.useHistory(),a.pathname.split("/").pop());if("info"===u)return null;const s=n.filter(e=>e.timeLine&&e.timeLine.length>0).reduce((e,t)=>{const n=t.timeLine[0],l=e.findIndex(e=>e.key===n.currentStep);return-1===l?e.push({key:n.currentStep,label:n.actions,routes:[t.route],stepNumber:n.currentStep}):e[l].routes.push(t.route),e},[]).sort((e,t)=>e.stepNumber-t.stepNumber);s.push({key:"final-submit",label:"Review & Submit",routes:["check","wt-acknowledgement","mt-acknowledgement","tp-acknowledgement"],stepNumber:s.length+1});const v=s.findIndex(e=>e.routes.includes(u)),p=-1!==v?v:0;return l.createElement(l.Fragment,null,l.createElement("div",{className:"vertical-timeline-container"},s.map((e,n)=>{const i=n<p;return l.createElement("div",{key:n,className:"vertical-timeline-step "+(i?"completed":"")+" "+(n===p?"active":""),onClick:()=>{}},l.createElement("div",{className:"vertical-timeline-connector "+(n<p?"completed":"")}),l.createElement("div",{className:"vertical-timeline-pill"},i?l.createElement(t.TickMark,null):e.stepNumber),l.createElement("div",{className:"vertical-timeline-content"},l.createElement("div",{className:"vertical-timeline-label"},r(e.label))))})))},p=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"NA"},m=e=>{if(!e)return"NA";const[t,n]=e.split(":").map(Number),l=t>=12?"PM":"AM";return(t%12||12)+":"+n.toString().padStart(2,"0")+" "+l},f=e=>{if(!e)return"NA";const[t,n,l]=e.split("-");return l+"-"+n+"-"+t},E=e=>{let{number:i,title:o,children:r,defaultOpen:a=!1,tabs:u=null,defaultTab:c="",onTabChange:s=(()=>{})}=e;const[d,v]=n.useState(a),[p,m]=n.useState(c||u&&u[0]||"");return l.createElement("div",{className:"collapsible-card"},l.createElement("div",{className:"collapsible-card-header",onClick:()=>v(!d)},l.createElement("h3",{className:"collapsible-card-title"},i?i+". ":"",o),l.createElement("span",{className:"collapsible-card-arrow "+(d?"rotate":"")},l.createElement(t.ArrowDown,null))),d&&l.createElement("div",{className:"collapsible-card-body"},u&&l.createElement("div",{className:"collapsible-card-tabs"},u.map((e,t)=>l.createElement("button",{key:t,onClick:()=>(e=>{m(e),s(e)})(e),className:"collapsible-card-tab-button "+(p===e?"active":"")},e))),l.createElement("div",{className:"collapsible-card-tab-content"},u?l.createElement("div",{key:p},r(p)):l.createElement("div",null,r))))},h=e=>{let{isLoading:i,t:r,onSubmit:u,data:c,count:s,setShowToast:d,moduleCode:v}=e;window.Digit.Utils.browser.isMobile();const p=Digit.UserService.getUser().info,m={offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",bookingNo:"",mobileNumber:"",applicantName:"",status:"",fromDate:"",toDate:""},{register:f,control:_,handleSubmit:h,setValue:g,getValues:S,reset:y,formState:b,watch:T}=a.useForm({defaultValues:m}),A=T("fromDate"),C=e=>l.createElement("span",{className:"cell-text"},e),N=n.useMemo(()=>[{Header:r("WT_BOOKING_NO"),accessor:"bookingNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;const n=t.original.bookingNo;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:"/digit-ui/"+("EMPLOYEE"===p.type?"employee":"citizen")+"/wt/bookingsearch/booking-details/"+n},n)))}},{Header:r("WT_APPLICANT_NAME"),disableSortBy:!0,Cell:e=>{var t,n;let{row:l}=e;return C(null===(t=l.original)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.name)}},{Header:r("WT_MOBILE_NUMBER"),disableSortBy:!0,Cell:e=>{var t,n;let{row:l}=e;return C(null===(t=l.original)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.mobileNumber)}},{Header:r("PT_COMMON_TABLE_COL_STATUS_LABEL"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return C(r(t.original.bookingStatus))}}],[r,p.type]),D="TP"===v?[{i18nKey:"TP_BOOKING_CREATED",code:"BOOKING_CREATED",value:r("TP_BOOKING_CREATED")},{i18nKey:"TP_PENDING_FOR_APPROVAL",code:"PENDING_FOR_APPROVAL",value:r("TP_PENDING_FOR_APPROVAL")},{i18nKey:"TP_PAYMENT_PENDING",code:"PAYMENT_PENDING",value:r("TP_PAYMENT_PENDING")},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_VERIFICATION",code:"TEAM_ASSIGNMENT_FOR_VERIFICATION",value:r("TP_TEAM_ASSIGNMENT_FOR_VERIFICATION")},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_EXECUTION",code:"TEAM_ASSIGNMENT_FOR_EXECUTION",value:r("TP_TEAM_ASSIGNMENT_FOR_EXECUTION")},{i18nKey:"TP_TREE_PRUNING_SERVICE_COMPLETED",code:"TREE_PRUNING_SERVICE_COMPLETED",value:r("TP_TREE_PRUNING_SERVICE_COMPLETED")}]:[{i18nKey:"Booking Created",code:"BOOKING_CREATED",value:r("WT_BOOKING_CREATED")},{i18nKey:"Booking Approved",code:"APPROVED",value:r("WT_BOOKING_APPROVED")},{i18nKey:"Tanker Delivered",code:"TANKER_DELIVERED",value:r("WT_TANKER_DELIVERED")},{i18nKey:"Vendor Assigned",code:"ASSIGN_VENDOR",value:r("WT_ASSIGN_VENDOR")},{i18nKey:"Rejected",code:"REJECT",value:r("WT_BOOKING_REJECTED")}],I=n.useCallback(e=>{0!==e.length&&(g("sortBy",e.id),g("sortOrder",e.desc?"DESC":"ASC"))},[g]),O=()=>{y(m),d(null),h(u)()};return l.createElement(l.Fragment,null,l.createElement("div",{className:"CITIZEN"===(null==p?void 0:p.type)?"citizen-wrapper":"employee-wrapper"},l.createElement(E,{title:r("WT_SEARCH_FILTERS_LABEL")||"Search Filters",defaultOpen:!0,tabs:[r("WT_SMART_SEARCH"),r("WT_ADVANCED_SEARCH")],defaultTab:r("WT_SMART_SEARCH")},e=>{var n,i,o,c;return l.createElement("form",{onSubmit:h(u)},e===r("WT_SMART_SEARCH")&&l.createElement("div",{className:"wt-search-grid",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"24px"}},l.createElement("div",{className:"search-field-wrapper"},l.createElement("label",null,r("WT_MOBILE_NUMBER")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:f({minLength:{value:10,message:r("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:r("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:r("CORE_COMMON_MOBILE_ERROR")}}),type:"number",maxlength:10}),l.createElement(t.CardLabelError,null,null==b||null===(n=b.errors)||void 0===n||null===(i=n.mobileNumber)||void 0===i?void 0:i.message))),e===r("WT_ADVANCED_SEARCH")&&l.createElement("div",{className:"wt-search-grid",style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"24px"}},l.createElement("div",{className:"search-field-wrapper"},l.createElement("label",null,r("WT_BOOKING_NO")),l.createElement(t.TextInput,{name:"bookingNo",inputRef:f({})})),l.createElement("div",{className:"search-field-wrapper"},l.createElement("label",null,r("WT_APPLICANT_NAME")),l.createElement(t.TextInput,{name:"applicantName",inputRef:f({})})),l.createElement("div",{className:"search-field-wrapper"},l.createElement("label",null,r("WT_MOBILE_NUMBER")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:f({minLength:{value:10,message:r("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:r("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:r("CORE_COMMON_MOBILE_ERROR")}}),type:"number",maxlength:10}),l.createElement(t.CardLabelError,null,null==b||null===(o=b.errors)||void 0===o||null===(c=o.mobileNumber)||void 0===c?void 0:c.message)),l.createElement("div",{className:"search-field-wrapper"},l.createElement("label",null,r("PT_COMMON_TABLE_COL_STATUS_LABEL")),l.createElement(a.Controller,{control:_,name:"status",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:D,optionKey:"i18nKey",t:r})})),l.createElement("div",{className:"search-field-wrapper"},l.createElement("label",null,r("FROM_DATE")),l.createElement(a.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,onChange:e.onChange,max:(new Date).toISOString().split("T")[0]}),name:"fromDate",control:_})),l.createElement("div",{className:"search-field-wrapper"},l.createElement("label",null,r("TO_DATE")),l.createElement(a.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,onChange:e.onChange,min:A}),name:"toDate",control:_}))),l.createElement("div",{className:"wt-search-actions",style:{display:"flex",justifyContent:"flex-end",gap:"24px",marginTop:"16px"}},l.createElement("span",{className:"clear-search-link",onClick:O,style:{color:"#f47738",cursor:"pointer",alignSelf:"center",textDecoration:"underline"}},r("ES_COMMON_CLEAR_ALL")),l.createElement("div",{style:{minWidth:"160px"}},l.createElement(t.SubmitBar,{label:r("ES_COMMON_SEARCH"),submit:!0}))))}),!i&&null!=c&&c.display?l.createElement(t.Card,{style:{marginTop:20}},r(c.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):i||""===c?(""!==c||i)&&l.createElement(t.Loader,null):l.createElement(t.Table,{t:r,data:c,totalRecords:s,columns:N,getCellProps:e=>({style:{minWidth:e.column.Header===r("WT_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:e=>{g("limit",Number(e.target.value)),h(u)()},currentPage:S("offset")/S("limit"),onNextPage:()=>{g("offset",S("offset")+S("limit")),h(u)()},onPrevPage:()=>{const e=S("offset"),t=S("limit");e-t>=0&&(g("offset",e-t),h(u)())},pageSizeLimit:S("limit"),onSort:I,disableSort:!1,sortParams:[{id:S("sortBy"),desc:"DESC"===S("sortOrder")}]})))},g=e=>{let{moduleCode:o}=e;const{t:r}=i.useTranslation(),a=Digit.ULBService.getCurrentTenantId(),[c,s]=n.useState({}),[d,v]=n.useState(null);n.useEffect(()=>{if(d){const e=setTimeout(()=>{v(null)},1e3);return()=>clearTimeout(e)}},[d]);const p={enabled:!!(c&&Object.keys(c).length>0)};let m=[],f=0,E=!1,_=!1,g=!1,S=null;return"WT"===o?({isLoading:E,isSuccess:_,isError:g,error:S,data:{waterTankerBookingDetail:m=[],Count:f=0}={}}=Digit.Hooks.wt.useTankerSearchAPI({tenantId:a,filters:c},p)):"MT"===o?({isLoading:E,isSuccess:_,isError:g,error:S,data:{mobileToiletBookingDetails:m=[],Count:f=0}={}}=Digit.Hooks.wt.useMobileToiletSearchAPI({tenantId:a,filters:c},p)):"TP"===o&&({isLoading:E,isSuccess:_,isError:g,error:S,data:{treePruningBookingDetails:m=[],Count:f=0}={}}=Digit.Hooks.wt.useTreePruningSearchAPI({tenantId:a,filters:c},p)),l.createElement(l.Fragment,null,l.createElement(h,{t:r,isLoading:E,tenantId:a,setShowToast:v,onSubmit:function(e){const{fromDate:t,toDate:n}=e,l=u({},e,n?{toDate:n}:{},t?{fromDate:t}:{});let i=Object.keys(l).filter(e=>l[e]).reduce((e,t)=>u({},e,{[t]:"object"==typeof l[t]?l[t].code:l[t]}),{});!(Object.keys(i).length>0)||i.bookingNo||i.fromDate||i.status||i.toDate||i.mobileNumber?i.fromDate&&!i.toDate||!i.fromDate&&i.toDate?v({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):s(i):v({warning:!0,label:"ERR_PROVIDE_ONE_PARAMETERS"})},data:_&&!E?m.length>0?m:{display:"ES_COMMON_NO_DATA"}:"",count:f,moduleCode:o}),d&&l.createElement(t.Toast,{error:d.error,warning:d.warning,label:r(d.label),onClose:()=>v(null)}))},S=["path","url"],y=()=>{var e,n,i,r,a,s,d,v,p,m,f,E;const _=o.useRouteMatch(),{path:h}=_,y=(c(_,S),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("WTCreate")),b=null===(i=Digit)||void 0===i||null===(r=i.ComponentRegistryService)||void 0===r?void 0:r.getComponent("WTApplicationDetails"),T=null===(a=Digit)||void 0===a||null===(s=a.ComponentRegistryService)||void 0===s?void 0:s.getComponent("MTApplicationDetails"),A=null===(d=Digit)||void 0===d||null===(v=d.ComponentRegistryService)||void 0===v?void 0:v.getComponent("TPApplicationDetails"),C=null===(p=Digit)||void 0===p||null===(m=p.ComponentRegistryService)||void 0===m?void 0:m.getComponent("WTMyApplications"),N=Digit.ComponentRegistryService.getComponent("WTEmpInbox"),D=Digit.ComponentRegistryService.getComponent("WTCitizenCard"),I=Digit.ComponentRegistryService.getComponent("MTCitizenCard"),O=null===(f=Digit)||void 0===f||null===(E=f.ComponentRegistryService)||void 0===E?void 0:E.getComponent("ApplicationDetails"),w=e=>({searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:[e],applicationStatus:[],locality:[]}}),x=w("watertanker"),R=w("mobileToilet");return l.createElement("span",{style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,l.createElement(t.BackButton,null,"Back"),l.createElement(t.PrivateRoute,{path:h+"/inbox",component:()=>l.createElement(N,{useNewInboxAPI:!0,parentRoute:h,moduleCode:"WT",businessService:"watertanker",filterComponent:"WT_INBOX_FILTER",initialStates:x,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:h+"/mt/inbox",component:()=>l.createElement(N,{useNewInboxAPI:!0,parentRoute:h,businessService:"mobileToilet",moduleCode:"MT",filterComponent:"WT_INBOX_FILTER",initialStates:R,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:h+"/request-service",component:y}),l.createElement(t.PrivateRoute,{path:h+"/status",component:C}),l.createElement(t.PrivateRoute,{path:h+"/booking/waterTanker/:acknowledgementIds/:tenantId",component:b}),l.createElement(t.PrivateRoute,{path:h+"/booking/mobileToilet/:acknowledgementIds/:tenantId",component:T}),l.createElement(t.PrivateRoute,{path:h+"/booking/treePruning/:acknowledgementIds/:tenantId",component:A}),l.createElement(t.PrivateRoute,{path:h+"/booking-details/:id",component:()=>l.createElement(O,{parentRoute:h})}),l.createElement(t.PrivateRoute,{path:h+"/bookingsearch/booking-details/:id",component:()=>l.createElement(O,{parentRoute:h})}),l.createElement(t.PrivateRoute,{path:h+"/wt-Vendor",component:()=>Digit.UserService.hasAccess(["WT_VENDOR"])?l.createElement(D,{parentRoute:h}):l.createElement(o.Redirect,{to:{pathname:"/digit-ui/citizen/login",state:{from:h+"/wt-Vendor",role:"WT_VENDOR"}}})}),l.createElement(t.PrivateRoute,{path:h+"/mt-Vendor",component:()=>Digit.UserService.hasAccess(["MT_VENDOR"])?l.createElement(I,{parentRoute:h}):l.createElement(o.Redirect,{to:{pathname:"/digit-ui/citizen/login",state:{from:h+"/mt-Vendor",role:"MT_VENDOR"}}})}),l.createElement(t.PrivateRoute,{path:h+"/my-bookings",component:e=>l.createElement(g,u({},e,{parentRoute:h,moduleCode:"WT"}))}),l.createElement(t.PrivateRoute,{path:h+"/mt/my-bookings",component:e=>l.createElement(g,u({},e,{parentRoute:h,moduleCode:"MT"}))}))))},b=e=>{let{onSubmit:r,setExistingDataSet:a}=e;const{t:c}=i.useTranslation(),s=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[d,v]=n.useState(null),[p,m]=n.useState(!1),{offset:f}=o.useParams();n.useEffect(()=>{p&&(r(),m(!1))},[p,r]);let E={limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:f&&!isNaN(parseInt(f))?f:"0",tenantId:s};n.useEffect(()=>{v(E)},[f]);const{isLoading:_,data:h}=Digit.Hooks.wt.useTankerSearchAPI({filters:d});if(_)return l.createElement(t.Loader,null);const g=(null==h?void 0:h.waterTankerBookingDetail)||[],S={padding:"10px",margin:"10px 0",border:"1px solid #ccc",transition:"background-color 0.3s ease, box-shadow 0.3s ease"},y={boxShadow:"1px 4px 4px 7px rgba(0, 0, 0, 0.5)"};return l.createElement(l.Fragment,null,l.createElement("div",null,g.length>0&&g.map((e,n)=>{var i;return l.createElement("div",{key:n},l.createElement(t.Card,{style:u({},S,{cursor:"pointer"}),onMouseEnter:e=>{e.currentTarget.style.backgroundColor=y.backgroundColor,e.currentTarget.style.boxShadow=y.boxShadow},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="",e.currentTarget.style.boxShadow=""},onClick:()=>{(e=>{var t,n,l,i,o,r,u,c,s,d,v,p,f,E,_,h,g,S;const y={address:{houseNo:null==e||null===(t=e.address)||void 0===t?void 0:t.houseNo,streetName:null==e||null===(n=e.address)||void 0===n?void 0:n.streetName,addressline1:null==e||null===(l=e.address)||void 0===l?void 0:l.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===(r=e.address)||void 0===r?void 0:r.pincode,cityValue:{code:null==e||null===(u=e.address)||void 0===u?void 0:u.city,value:null==e||null===(c=e.address)||void 0===c?void 0:c.city,i18nKey:null==e||null===(s=e.address)||void 0===s?void 0:s.city,city:{name:null==e||null===(d=e.address)||void 0===d?void 0:d.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===(f=e.address)||void 0===f?void 0:f.locality,i18nKey:null==e||null===(E=e.address)||void 0===E?void 0:E.locality}},owner:{applicantName:null==e||null===(_=e.applicantDetail)||void 0===_?void 0:_.name,mobileNumber:null==e||null===(h=e.applicantDetail)||void 0===h?void 0:h.mobileNumber,alternateNumber:null==e||null===(g=e.applicantDetail)||void 0===g?void 0:g.alternateNumber,emailId:null==e||null===(S=e.applicantDetail)||void 0===S?void 0:S.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}};a(y),m(!0)})(e)}},l.createElement(t.KeyNote,{keyValue:c("BOOKING_NO"),note:null==e?void 0:e.bookingNo}),l.createElement(t.KeyNote,{keyValue:c("APPLICANT_NAME"),note:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name}),l.createElement(t.KeyNote,{keyValue:c("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:c(""+(null==e?void 0:e.bookingStatus))})))}),0===g.length&&!_&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},c("NO_APPLICATION_FOUND_MSG"))))},T=l.memo(e=>{let{t:t}=e;return l.createElement("h1",{className:"heading-m"},t("MY_BOOKINGS"))}),A=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),C=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(A,null)),N=e=>{let{t:i,closeModal:o,onSubmit:r,setExistingDataSet:a}=e;const[u,c]=n.useState(!1),[s,d]=n.useState(!1),v=n.useCallback(()=>{s&&(r(),d(!1))},[s,r]);return n.useEffect(()=>{v()},[v]),l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement(T,{t:i}),headerBarEnd:l.createElement(C,{onClick:o}),actionCancelLabel:u&&i("CS_COMMON_BACK"),actionCancelOnSubmit:()=>c(!1),hideSubmit:!0,formId:"modal-action"},l.createElement(t.Card,{style:{boxShadow:"none"}},u&&l.createElement(b,{onSubmit:r,setExistingDataSet:a}),l.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},!u&&l.createElement(t.SubmitBar,{label:i("USE_EXISTING_DETAILS"),onSubmit:()=>{c(!0)}}),!u&&l.createElement(t.SubmitBar,{label:i("FILL_NEW_DETAILS"),onSubmit:()=>{d(!0)}})))))},D=e=>{let{jumpTo:n}=e;i.useTranslation();const r=o.useHistory();return l.createElement(t.LinkButton,{label:l.createElement(t.EditIcon,{style:{marginTop:"-30px",float:"right",position:"relative",bottom:"32px"}}),className:"check-page-link-button",onClick:function(){r.push(n)}})},I=e=>e.substr(0,1).toUpperCase()+e.substr(1),O=function(e,t,n){try{var l,i,o,r,a,u,c,s,d,v,p,E,_,h;return console.log("booking",e),console.log("tenantInfo",t),Promise.resolve({t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(g=n("ULBGRADE_"+(null==t||null===(l=t.city)||void 0===l?void 0:l.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),g.toLowerCase().split(" ").map(I).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:n("WT_ACKNOWLEDGEMENT"),details:[{title:n("WT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:n("WT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:n("WT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:n("WT_ALT_MOBILE_NUMBER"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.alternateNumber},{title:n("WT_EMAIL_ID"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.emailId}].filter(e=>e.value)},{title:n("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:n("WT_PINCODE"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.pincode},{title:n("WT_CITY"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.city},{title:n("WT_LOCALITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.locality},{title:n("WT_STREET_NAME"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.streetName},{title:n("WT_DOOR_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.doorNo},{title:n("WT_HOUSE_NO"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.houseNo},{title:n("WT_ADDRESS_LINE1"),value:null==e||null===(E=e.address)||void 0===E?void 0:E.addressLine1},{title:n("WT_ADDRESS_LINE2"),value:null==e||null===(_=e.address)||void 0===_?void 0:_.addressLine2},{title:n("WT_LANDMARK"),value:null==e||null===(h=e.address)||void 0===h?void 0:h.landmark}].filter(e=>e.value)},{title:n("WT_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:n("WT_TANKER_TYPE"),value:null==e?void 0:e.tankerType},{title:n("WT_WATER_TYPE"),value:n(null==e?void 0:e.waterType)},{title:n("WT_TANKER_QUANTITY"),value:null==e?void 0:e.tankerQuantity},{title:n("WT_WATER_QUANTITY"),value:(null==e?void 0:e.waterQuantity)+" Ltr"},{title:n("WT_DELIVERY_DATE_TIME"),value:f(null==e?void 0:e.deliveryDate)+" ("+m(null==e?void 0:e.deliveryTime)+")"},{title:n("WT_DESCRIPTION"),value:null==e?void 0:e.description},{title:n("WT_IMMEDIATE"),value:n("Y"===(null==e?void 0:e.extraCharge)?"YES":"NO")}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var g},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")},x={padding:"4px 0px",justifyContent:"space-between"},R=e=>{var n,i;return l.createElement(t.Banner,{message:w(e),applicationNumber:null===(n=e.data)||void 0===n||null===(i=n.waterTankerBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("WT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},L=e=>{let{t:n,currentPage:i,columns:o,data:r,getCellProps:a,disableSort:u,onSort:c,onNextPage:s,onPrevPage:d,onPageSizeChange:v,isPaginationRequired:p,pageSizeLimit:m,sortParams:f,totalRecords:E}=e;return l.createElement(t.Table,{t:n,data:r,currentPage:i,columns:o,getCellProps:a,onNextPage:s,onPrevPage:d,pageSizeLimit:m,disableSort:u,isPaginationRequired:p,onPageSizeChange:v,onSort:c,sortParams:f,totalRecords:E})},P=e=>{let{businessService:r}=e;const{t:a}=i.useTranslation(),u=[],[c,s]=n.useState([]),{roles:d}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=u.filter(e=>e.businessService===r).filter(e=>{let{roles:t}=e;return t.some(e=>d.map(e=>{let{code:t}=e;return t}).includes(e))||!(null!=t&&t.length)});s(e)},[]),l.createElement(t.Card,{className:"employeeCard filter inboxLinks"},l.createElement("div",{className:"complaint-links-container",style:{padding:"10px"}},l.createElement("div",{className:"header"},l.createElement("span",{className:"logo"},l.createElement(t.HomeIcon,null))," ",l.createElement("span",{className:"text"},a(r+"_REQUEST"))),l.createElement("div",{className:"body"},c.map((e,t)=>{let{link:n,text:i,hyperlink:r=!1,roles:u=[]}=e;return l.createElement("span",{className:"link",key:t},r?l.createElement("a",{href:n},i):l.createElement(o.Link,{to:n},a(i)))}))))},k={mobileNumber:t.MobileNumber},M=e=>{var n;let{onSearch:o,type:r,onClose:c,searchFields:s,searchParams:d,isInboxPage:v,clearSearch:p}=e;const{t:m}=i.useTranslation(),{handleSubmit:f,reset:E,watch:_,control:h,formState:g,setValue:S}=a.useForm({defaultValues:v?d:u({locality:null,city:null},d)}),y=_(),b=innerWidth<=640;function T(){const e=s.reduce((e,t)=>u({},e,{[null==t?void 0:t.name]:""}),{});if(E(e),v){const e=u({},d);e.delete=[],s.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),o(u({},e))}else p()}const A=e=>l.createElement(t.LinkLabel,{style:u({display:"inline"},e?{margin:0}:{}),onClick:T},m("ES_COMMON_CLEAR_SEARCH"));return l.createElement("form",{onSubmit:f(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],s.forEach(t=>{e[t.name]||e.delete.push(t.name)}),o(e),"mobile"===r&&c()})},l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:v?"24px":"revert"}},l.createElement("div",{className:"search-complaint-container",style:{width:"100%"}},("mobile"===r||b)&&l.createElement("div",{className:"complaint-header"},l.createElement("h2",null,m("ES_COMMON_SEARCH_BY")),l.createElement("span",{onClick:c},l.createElement(t.CloseSvg,null))),l.createElement("div",{className:"complaint-input-container for-pt "+(v?"":"for-search"),style:{width:"100%",display:"grid"}},null==s||null===(n=s.filter(e=>!0))||void 0===n?void 0:n.map((e,n)=>{var i,o,r;return l.createElement("div",{key:e.name,className:"input-fields"},l.createElement("span",{className:"mobile-input"},l.createElement(t.Label,null,m(e.label)+" "+(e.isMendatory?"*":"")),l.createElement(a.Controller,e.type?{render:t=>l.createElement(null==k?void 0:k[e.type],{formValue:y,setValue:S,onChange:t.onChange,value:t.value}),name:e.name,control:h,defaultValue:""}:{render:e=>l.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:h,defaultValue:""})),null!=g&&null!==(i=g.dirtyFields)&&void 0!==i&&i[e.name]?l.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==g||null===(o=g.errors)||void 0===o||null===(r=o[e.name])||void 0===r?void 0:r.message):null)}),v&&l.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px",padding:"10px"},className:"input-fields"},l.createElement("div",null,A())),"desktop"===r&&!b&&l.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},l.createElement(t.SubmitBar,{className:"submit-bar-search",label:m("ES_COMMON_SEARCH"),disabled:!!Object.keys(g.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})(),submit:!0}),!v&&l.createElement("div",null,A()))))),("mobile"===r||b)&&l.createElement(t.ActionBar,{className:"clear-search-container"},l.createElement("button",{className:"clear-search",style:{flex:1}},A(b)),l.createElement(t.SubmitBar,{disabled:!!Object.keys(g.errors).length,label:m("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},F=["tableConfig","filterComponent"],B=e=>{let{tableConfig:o,filterComponent:r}=e,a=c(e,F);const{data:u,useNewInboxAPI:s}=a,{t:d}=i.useTranslation(),[v,p]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r)}),[m,f]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a.EmptyResultInboxComp)}),[E,_]=n.useState(!1),h=l.useMemo(()=>a.isSearch?o.searchColumns(a):o.inboxColumns(a)||[],[]);let g;return a.isLoading?g=l.createElement(t.Loader,null):E?g=null:!u||0===(null==u?void 0:u.length)||s&&null!=u&&u[0].dataEmpty?g=m&&l.createElement(m,{data:u})||(0===(null==u?void 0:u.length)||s&&null!=u&&u[0].dataEmpty?l.createElement(t.Card,{style:{marginTop:20}},d("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.Loader,null)):(null==u?void 0:u.length)>0&&(g=l.createElement(L,{t:d,data:u,columns:h,getCellProps:e=>({style:{minWidth:e.column.Header===d("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:a.onPageSizeChange,currentPage:a.currentPage,onNextPage:a.onNextPage,onPrevPage:a.onPrevPage,pageSizeLimit:a.pageSizeLimit,onSort:a.onSort,disableSort:a.disableSort,sortParams:a.sortParams,totalRecords:a.totalRecords})),l.createElement("div",{className:"inbox-container"},!a.isSearch&&l.createElement("div",{className:"filters-container"},l.createElement(P,{parentRoute:a.parentRoute,businessService:a.moduleCode}),l.createElement("div",null,l.createElement(v,{defaultSearchParams:a.defaultSearchParams,onFilterChange:a.onFilterChange,searchParams:a.searchParams,type:"desktop",useNewInboxAPI:s,statusMap:s?null==u?void 0:u[0].statusMap:null,moduleCode:a.moduleCode}))),l.createElement("div",{style:{flex:1}},l.createElement(M,{defaultSearchParams:a.defaultSearchParams,onSearch:e=>{a.onSearch(e),_(!1)},type:"desktop",searchFields:a.searchFields,isInboxPage:!(null!=a&&a.isSearch),searchParams:a.searchParams,clearSearch:()=>_(!0)}),l.createElement("div",{className:"result",style:{marginLeft:null!=a&&a.isSearch?"":"24px",flex:1}},g)))},U=e=>{const{t:o}=i.useTranslation(),[r,a]=n.useState(()=>{var t,n;return null!==(t=e.sortParams)&&void 0!==t&&null!==(n=t[0])&&void 0!==n&&n.desc?{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}});function u(){}return l.createElement(l.Fragment,null,l.createElement("div",{className:"filter"},l.createElement("div",{className:"filter-card"},l.createElement("div",{className:"heading"},l.createElement("div",{className:"filter-label"},o("SORT_BY"),":"),l.createElement("div",{className:"clearAll",onClick:u},o("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&l.createElement("span",{className:"clear-search",onClick:u},o("ES_COMMON_CLEAR_ALL")),"mobile"===e.type&&l.createElement("span",{onClick:e.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement(t.RadioButtons,{onSelect:function(t){e.onSort([{id:"createdTime",desc:"DESC"===t.code}]),e.onClose()},selectedOption:r,optionsKey:"name",options:[{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}]})))))},W=e=>{let{t:i,data:o,onFilterChange:r,onSearch:a,onSort:u,serviceRequestIdKey:c,isFstpOperator:s,isLoading:d,isSearch:v,searchParams:p,searchFields:m,sortParams:f,linkPrefix:E,filterComponent:_}=e;const[h,g]=n.useState(v?"SEARCH":""),[S,y]=n.useState(!!v),[b,T]=n.useState(f),[A]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(_)});n.useEffect(()=>{h&&y(!0)},[h]);const C=()=>{y(!1),g(""),T(f)};if(d)return l.createElement(t.Loader,null);let N;return o&&0!==(null==o?void 0:o.length)?o&&(null==o?void 0:o.length)>0&&(N=l.createElement(t.DetailsCard,{data:o,serviceRequestIdKey:c,linkPrefix:E||"/digit-ui/employee/chb/"})):N=l.createElement(t.Card,{style:{marginTop:20}},i("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))),l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},a&&l.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{g("SEARCH"),y(!0)}}),!v&&r&&l.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{g("FILTER"),y(!0)}}),l.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{g("SORT"),y(!0)}})),N,S&&l.createElement(t.PopUp,null,"FILTER"===h&&l.createElement("div",{className:"popup-module"},l.createElement(A,{onFilterChange:e=>{r(e),y(!1)},Close:C,type:"mobile",searchParams:p})),"SORT"===h&&l.createElement("div",{className:"popup-module"},l.createElement(U,{type:"mobile",sortParams:f,onClose:C,onSort:u})),"SEARCH"===h&&l.createElement("div",{className:"popup-module"},l.createElement(M,{type:"mobile",onClose:C,onSearch:a,isFstpOperator:s,searchParams:p,searchFields:m}))))},j=e=>{let{classNameForMobileView:r=""}=e;const{t:a}=i.useTranslation(),u=[],[c,s]=n.useState([]),{roles:d}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];u.forEach(t=>{var n;t.accessTo?(n=t.accessTo,d.filter(e=>n.includes(e.code)).length&&e.push(t)):e.push(t)}),s(e)},[]),l.createElement(t.Card,{className:"employeeCard filter"},l.createElement("div",{className:"complaint-links-container "+r},l.createElement("div",{className:"header"},l.createElement("span",{className:"logo"},l.createElement(t.ShippingTruck,null))," ",l.createElement("span",{className:"text"},a("ES_TITLE_WT_REGISTRATION"))),l.createElement("div",{className:"body"},c.map((e,t)=>{let{link:n,text:i}=e;return l.createElement("span",{className:"link",key:t},l.createElement(o.Link,{to:n},i))}))))},H=e=>{let{data:t,isLoading:n,isSearch:o,searchFields:r,onFilterChange:a,onSearch:u,onSort:c,parentRoute:s,searchParams:d,sortParams:v,linkPrefix:p,tableConfig:m,filterComponent:f}=e;const{t:E}=i.useTranslation();return l.createElement("div",{style:{padding:0}},l.createElement("div",{className:"inbox-container"},l.createElement("div",{className:"filters-container"},!o&&l.createElement(j,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:s,isMobile:!0}),l.createElement(W,{t:E,data:null==t?void 0:t.map(e=>{const t={};return(o?m.searchColumns():m.inboxColumns()).forEach(n=>{n.mobileCell&&(t[n.Header]=n.mobileCell(e))}),t}),onFilterChange:a,isLoading:n,isSearch:o,onSearch:u,onSort:c,searchParams:d,searchFields:r,linkPrefix:p,sortParams:v,serviceRequestIdKey:null==m?void 0:m.serviceRequestIdKey,filterComponent:f}))))},z=["isFetching","isLoading","searchResponseKey","data","searchFields"],V=e=>{var t,o,r,a,s;let{useNewInboxAPI:d,parentRoute:v,moduleCode:p,initialStates:m={},filterComponent:f,isInbox:E,rawWfHandler:_,rawSearchHandler:h,combineResponse:g,wfConfig:S,searchConfig:y,middlewaresWf:b,middlewareSearch:T,EmptyResultInboxComp:A}=e;const C=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),N=Digit.UserService.getUser().info,{t:D}=i.useTranslation(),[I,O]=n.useState(()=>E?{}:{enabled:!1}),[w,x]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("WTInboxTableConfig")}),[R,L]=n.useState(m.pageOffset||0),[P,k]=n.useState(m.pageSize||10),[M,F]=n.useState(m.sortParams||[{id:"createdTime",desc:!0}]),[U,W]=n.useState(m.searchParams||{});let j=window.Digit.Utils.browser.isMobile(),V=j?{limit:100,offset:0,sortBy:null==M||null===(t=M[0])||void 0===t?void 0:t.id,sortOrder:null!=M&&null!==(o=M[0])&&void 0!==o&&o.desc?"DESC":"ASC"}:{limit:P,offset:R,sortBy:null==M||null===(r=M[0])||void 0===r?void 0:r.id,sortOrder:null!=M&&null!==(a=M[0])&&void 0!==a&&a.desc?"DESC":"ASC"};const K=d?Digit.Hooks.useNewInboxGeneral({tenantId:C,ModuleCode:p,filters:u({},U,V,{sortParams:M})}):Digit.Hooks.useInboxGeneral({tenantId:C,businessService:p,isInbox:E,filters:u({},U,V,{sortParams:M}),rawWfHandler:_,rawSearchHandler:h,combineResponse:g,wfConfig:S,searchConfig:u({},I,y),middlewaresWf:b,middlewareSearch:T}),{isLoading:G,data:q,searchFields:Y}=K,X=c(K,z);n.useEffect(()=>{L(0)},[U]);const $=e=>{let t=e.delete,n=u({},U,e);t&&t.forEach(e=>delete n[e]),delete e.delete,W(u({},n)),O({enabled:!0})},Q=n.useCallback(e=>{0!==e.length&&F(e)},[]);var Z,J;if(null!==(null==X||null===(s=X.data)||void 0===s?void 0:s.length))return j?l.createElement(H,{data:q,isLoading:G,isSearch:!E,searchFields:Y,onFilterChange:$,onSearch:$,onSort:Q,parentRoute:v,searchParams:U,sortParams:M,linkPrefix:v+"/application-details/",tableConfig:null!=X&&X.tableConfig?null===(Z=res)||void 0===Z?void 0:Z.tableConfig:w(D)[p],filterComponent:f,EmptyResultInboxComp:A,useNewInboxAPI:d}):l.createElement("div",{style:{padding:"CITIZEN"===(null==N?void 0:N.type)?"0 24px":""}},l.createElement(B,{moduleCode:p,data:q,tableConfig:w(D)[p],isLoading:G,defaultSearchParams:m.searchParams,isSearch:!E,onFilterChange:$,searchFields:Y,onSearch:$,onSort:Q,onNextPage:()=>{L(e=>e+P)},onPrevPage:()=>{L(e=>e-P)},currentPage:Math.floor(R/P),pageSizeLimit:P,disableSort:!1,onPageSizeChange:e=>{k(Number(e.target.value))},parentRoute:v,searchParams:U,sortParams:M,totalRecords:Number(null==q||null===(J=q[0])||void 0===J?void 0:J.totalCount),filterComponent:f,EmptyResultInboxComp:A,useNewInboxAPI:d}))},K=e=>{var n,r,a,c;let{path:s}=e;const{t:d}=i.useTranslation(),v=o.useLocation();sessionStorage.removeItem("revalidateddone");const p=[{icon:t.HomeIcon,label:d("HOME")},{label:d((()=>{const e=v.pathname;return e.includes("/mt/inbox")?"ES_COMMON_INBOX":e.includes("/tp/inbox")?"TP_INBOX":e.includes("/wt/inbox")?"ES_COMMON_INBOX":e.includes("/mt/my-bookings")?"MT_SEARCH_BOOKINGS":e.includes("/tp/my-bookings")?"TP_SEARCH_BOOKINGS":e.includes("/my-bookings")?"WT_SEARCH_BOOKINGS":e.includes("/request-service")?"WT_REQUEST_SERVICE":e.includes("/booking-details")?"WT_BOOKING_DETAILS":""})())}],m={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["watertanker"],applicationStatus:[],locality:[]}},f={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["mobileToilet"],applicationStatus:[],locality:[]}},E={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["treePruning"],applicationStatus:[],locality:[]}},_=null===(n=Digit)||void 0===n||null===(r=n.ComponentRegistryService)||void 0===r?void 0:r.getComponent("ApplicationDetails"),h=null===(a=Digit)||void 0===a||null===(c=a.ComponentRegistryService)||void 0===c?void 0:c.getComponent("WTCreate");return l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,l.createElement("div",{className:"ground-container employee-app-container"},l.createElement(t.ModuleHeader,{leftContent:l.createElement(l.Fragment,null,l.createElement(t.ArrowLeft,{className:"icon"}),"Back"),onLeftClick:()=>window.history.back(),breadcrumbs:p}),l.createElement(t.PrivateRoute,{path:s+"/inbox",component:()=>l.createElement(V,{useNewInboxAPI:!0,parentRoute:s,businessService:"watertanker",moduleCode:"WT",filterComponent:"WT_INBOX_FILTER",initialStates:m,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:s+"/mt/inbox",component:()=>l.createElement(V,{useNewInboxAPI:!0,parentRoute:s,moduleCode:"MT",businessService:"mobileToilet",filterComponent:"WT_INBOX_FILTER",initialStates:f,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:s+"/tp/inbox",component:()=>l.createElement(V,{useNewInboxAPI:!0,parentRoute:s,moduleCode:"TP",businessService:"treePruning",filterComponent:"WT_INBOX_FILTER",initialStates:E,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:s+"/request-service",component:h}),l.createElement(t.PrivateRoute,{path:s+"/mt/request-service",component:h}),l.createElement(t.PrivateRoute,{path:s+"/tp/request-service",component:h}),l.createElement(t.PrivateRoute,{path:s+"/booking-details/:id",component:()=>l.createElement(_,{parentRoute:s})}),l.createElement(t.PrivateRoute,{path:s+"/bookingsearch/booking-details/:id",component:()=>l.createElement(_,{parentRoute:s})}),l.createElement(t.PrivateRoute,{path:s+"/my-bookings",component:e=>l.createElement(g,u({},e,{parentRoute:s,moduleCode:"WT"}))}),l.createElement(t.PrivateRoute,{path:s+"/mt/my-bookings",component:e=>l.createElement(g,u({},e,{parentRoute:s,moduleCode:"MT"}))}),l.createElement(t.PrivateRoute,{path:s+"/tp/my-bookings",component:e=>l.createElement(g,u({},e,{parentRoute:s,moduleCode:"TP"}))}))))},G=e=>{var n,r;let{application:a,tenantId:u,buttonLabel:c}=e,s=null==a?void 0:a.bookingNo.split("-")[0];const{t:d}=i.useTranslation();return l.createElement(t.Card,null,l.createElement(t.KeyNote,{keyValue:d("BOOKING_NO"),note:null==a?void 0:a.bookingNo}),l.createElement(t.KeyNote,{keyValue:d("APPLICANT_NAME"),note:null==a||null===(n=a.applicantDetail)||void 0===n?void 0:n.name}),l.createElement(t.KeyNote,{keyValue:d("MOBILE_NUMBER"),note:d(""+(null==a||null===(r=a.applicantDetail)||void 0===r?void 0:r.mobileNumber))}),l.createElement(t.KeyNote,{keyValue:d("LOCALITY"),note:d(""+(null==a?void 0:a.localityCode))}),l.createElement(t.KeyNote,{keyValue:d("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:d(""+(null==a?void 0:a.bookingStatus))}),l.createElement("div",null,"WT"===s&&l.createElement(o.Link,{to:"/digit-ui/citizen/wt/booking/waterTanker/"+(null==a?void 0:a.bookingNo)+"/"+u},l.createElement(t.SubmitBar,{label:c})),"MT"===s&&l.createElement(o.Link,{to:"/digit-ui/citizen/wt/booking/mobileToilet/"+(null==a?void 0:a.bookingNo)+"/"+u},l.createElement(t.SubmitBar,{label:c})),"TP"===s&&l.createElement(o.Link,{to:"/digit-ui/citizen/wt/booking/treePruning/"+(null==a?void 0:a.bookingNo)+"/"+u},l.createElement(t.SubmitBar,{label:c}))))};var q=Array.isArray,Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function X(e,t){return e(t={exports:{}},t.exports),t.exports}var $,Q="object"==typeof self&&self&&self.Object===Object&&self,Z="object"==typeof Y&&Y&&Y.Object===Object&&Y||Q||Function("return this")(),J=Z.Symbol,ee=Object.prototype,te=ee.hasOwnProperty,ne=ee.toString,le=J?J.toStringTag:void 0,ie=Object.prototype.toString,oe=J?J.toStringTag:void 0,re=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":oe&&oe in Object(e)?function(e){var t=te.call(e,le),n=e[le];try{e[le]=void 0;var l=!0}catch(e){}var i=ne.call(e);return l&&(t?e[le]=n:delete e[le]),i}(e):function(e){return ie.call(e)}(e)},ae=function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==re(e)},ue=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ce=/^\w*$/,se=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},de=Z["__core-js_shared__"],ve=($=/[^.]+$/.exec(de&&de.keys&&de.keys.IE_PROTO||""))?"Symbol(src)_1."+$:"",pe=Function.prototype.toString,me=/^\[object .+?Constructor\]$/,fe=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ee=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!se(e)||(t=e,ve&&ve in t))&&(function(e){if(!se(e))return!1;var t=re(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?fe:me).test(function(e){if(null!=e){try{return pe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}(n)?n:void 0},_e=Ee(Object,"create"),he=Object.prototype.hasOwnProperty,ge=Object.prototype.hasOwnProperty;function Se(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}Se.prototype.clear=function(){this.__data__=_e?_e(null):{},this.size=0},Se.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Se.prototype.get=function(e){var t=this.__data__;if(_e){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return he.call(t,e)?t[e]:void 0},Se.prototype.has=function(e){var t=this.__data__;return _e?void 0!==t[e]:ge.call(t,e)},Se.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=_e&&void 0===t?"__lodash_hash_undefined__":t,this};var ye=Se,be=function(e,t){for(var n=e.length;n--;)if((l=e[n][0])===(i=t)||l!=l&&i!=i)return n;var l,i;return-1},Te=Array.prototype.splice;function Ae(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}Ae.prototype.clear=function(){this.__data__=[],this.size=0},Ae.prototype.delete=function(e){var t=this.__data__,n=be(t,e);return!(n<0||(n==t.length-1?t.pop():Te.call(t,n,1),--this.size,0))},Ae.prototype.get=function(e){var t=this.__data__,n=be(t,e);return n<0?void 0:t[n][1]},Ae.prototype.has=function(e){return be(this.__data__,e)>-1},Ae.prototype.set=function(e,t){var n=this.__data__,l=be(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Ce=Ae,Ne=Ee(Z,"Map"),De=function(e,t){var n,l,i=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function Ie(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}Ie.prototype.clear=function(){this.size=0,this.__data__={hash:new ye,map:new(Ne||Ce),string:new ye}},Ie.prototype.delete=function(e){var t=De(this,e).delete(e);return this.size-=t?1:0,t},Ie.prototype.get=function(e){return De(this,e).get(e)},Ie.prototype.has=function(e){return De(this,e).has(e)},Ie.prototype.set=function(e,t){var n=De(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Oe=Ie;function we(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");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 r=e.apply(this,l);return n.cache=o.set(i,r)||o,r};return n.cache=new(we.Cache||Oe),n}we.Cache=Oe;var xe,Re,Le=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pe=/\\(\\)?/g,ke=(xe=we(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Le,function(e,n,l,i){t.push(l?i.replace(Pe,"$1"):n||e)}),t},function(e){return 500===Re.size&&Re.clear(),e}),Re=xe.cache,xe),Me=J?J.prototype:void 0,Fe=Me?Me.toString:void 0,Be=function(e){if("string"==typeof e||ae(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Ue=function(e,t,n){var l=null==e?void 0:function(e,t){for(var n=0,l=(t=function(e,t){return q(e)?e:function(e,t){if(q(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ae(e))||ce.test(e)||!ue.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:ke(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(q(t))return function(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}(t,e)+"";if(ae(t))return Fe?Fe.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}(e)}(e))}(t,e)).length;null!=e&&n<l;)e=e[Be(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l},We=X(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",r="[object Array]",a="[object Boolean]",u="[object Date]",c="[object Error]",s="[object Function]",d="[object GeneratorFunction]",v="[object Map]",p="[object Number]",m="[object Object]",f="[object RegExp]",E="[object Set]",_="[object String]",h="[object Symbol]",g="[object WeakMap]",S="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",T="[object Float64Array]",A="[object Int8Array]",C="[object Int16Array]",N="[object Int32Array]",D="[object Uint8Array]",I="[object Uint16Array]",O="[object Uint32Array]",w=/\b__p \+= '';/g,x=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,P=/[&<>"']/g,k=RegExp(L.source),M=RegExp(P.source),F=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,U=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,H=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,V=RegExp(z.source),K=/^\s+/,G=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,$=/,? & /,Q=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Z=/[()=,{}\[\]\/\s]/,J=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,re=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,ce=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\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",ve="["+de+"]",pe="["+se+"]",me="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_e="\\ud83c[\\udffb-\\udfff]",he="[^\\ud800-\\udfff]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",ye="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+Ee+")",Te="(?:"+ye+"|"+Ee+")",Ae="(?:"+pe+"|"+_e+")?",Ce="[\\ufe0e\\ufe0f]?"+Ae+"(?:\\u200d(?:"+[he,ge,Se].join("|")+")[\\ufe0e\\ufe0f]?"+Ae+")*",Ne="(?:"+["[\\u2700-\\u27bf]",ge,Se].join("|")+")"+Ce,De="(?:"+[he+pe+"?",pe,ge,Se,"[\\ud800-\\udfff]"].join("|")+")",Ie=RegExp("['’]","g"),Oe=RegExp(pe,"g"),we=RegExp(_e+"(?="+_e+")|"+De+Ce,"g"),xe=RegExp([ye+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,ye,"$"].join("|")+")",Te+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,ye+be,"$"].join("|")+")",ye+"?"+be+"+(?:['’](?: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,Ne].join("|"),"g"),Re=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\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"],ke=-1,Me={};Me[b]=Me[T]=Me[A]=Me[C]=Me[N]=Me[D]=Me["[object Uint8ClampedArray]"]=Me[I]=Me[O]=!0,Me[o]=Me[r]=Me[S]=Me[a]=Me[y]=Me[u]=Me[c]=Me[s]=Me[v]=Me[p]=Me[m]=Me[f]=Me[E]=Me[_]=Me[g]=!1;var Fe={};Fe[o]=Fe[r]=Fe[S]=Fe[y]=Fe[a]=Fe[u]=Fe[b]=Fe[T]=Fe[A]=Fe[C]=Fe[N]=Fe[v]=Fe[p]=Fe[m]=Fe[f]=Fe[E]=Fe[_]=Fe[h]=Fe[D]=Fe["[object Uint8ClampedArray]"]=Fe[I]=Fe[O]=!0,Fe[c]=Fe[s]=Fe[g]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,We=parseInt,je="object"==typeof Y&&Y&&Y.Object===Object&&Y,He="object"==typeof self&&self&&self.Object===Object&&self,ze=je||He||Function("return this")(),Ve=t&&!t.nodeType&&t,Ke=Ve&&e&&!e.nodeType&&e,Ge=Ke&&Ke.exports===Ve,qe=Ge&&je.process,Ye=function(){try{return Ke&&Ke.require&&Ke.require("util").types||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Xe=Ye&&Ye.isArrayBuffer,$e=Ye&&Ye.isDate,Qe=Ye&&Ye.isMap,Ze=Ye&&Ye.isRegExp,Je=Ye&&Ye.isSet,et=Ye&&Ye.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,l){for(var i=-1,o=null==e?0:e.length;++i<o;){var r=e[i];t(l,r,n(r),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function rt(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var r=e[n];t(r,n,e)&&(o[i++]=r)}return o}function at(e,t){return!(null==e||!e.length)&&_t(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function ct(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function st(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function dt(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function vt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function pt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var mt=yt("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function Et(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function _t(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,gt,n)}function ht(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function gt(e){return e!=e}function St(e,t){var n=null==e?0:e.length;return n?At(e,t)/n:NaN}function yt(e){return function(t){return null==t?void 0:t[e]}}function bt(e){return function(t){return null==e?void 0:e[t]}}function Tt(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function At(e,t){for(var n,l=-1,i=e.length;++l<i;){var o=t(e[l]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Ct(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Nt(e){return e?e.slice(0,Vt(e)+1).replace(K,""):e}function Dt(e){return function(t){return e(t)}}function It(e,t){return ct(t,function(t){return e[t]})}function Ot(e,t){return e.has(t)}function wt(e,t){for(var n=-1,l=e.length;++n<l&&_t(t,e[n],0)>-1;);return n}function xt(e,t){for(var n=e.length;n--&&_t(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Lt=bt({"À":"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"}),Pt=bt({"&":"&","<":"<",">":">",'"':""","'":"'"});function kt(e){return"\\"+Be[e]}function Mt(e){return Re.test(e)}function Ft(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Bt(e,t){return function(n){return e(t(n))}}function Ut(e,t){for(var n=-1,i=e.length,o=0,r=[];++n<i;){var a=e[n];a!==t&&a!==l||(e[n]=l,r[o++]=n)}return r}function Wt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Ht(e){return Mt(e)?function(e){for(var t=we.lastIndex=0;we.test(e);)++t;return t}(e):mt(e)}function zt(e){return Mt(e)?function(e){return e.match(we)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&G.test(e.charAt(t)););return t}var Kt=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Gt=function e(t){var G=(t=null==t?ze:Gt.defaults(ze.Object(),t,Gt.pick(ze,Pe))).Array,Y=t.Date,se=t.Error,de=t.Function,ve=t.Math,pe=t.Object,me=t.RegExp,fe=t.String,Ee=t.TypeError,_e=G.prototype,he=pe.prototype,ge=t["__core-js_shared__"],Se=de.prototype.toString,ye=he.hasOwnProperty,be=0,Te=function(){var e=/[^.]+$/.exec(ge&&ge.keys&&ge.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ae=he.toString,Ce=Se.call(pe),Ne=ze._,De=me("^"+Se.call(ye).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),we=Ge?t.Buffer:void 0,Re=t.Symbol,Be=t.Uint8Array,je=we?we.allocUnsafe:void 0,He=Bt(pe.getPrototypeOf,pe),Ve=pe.create,Ke=he.propertyIsEnumerable,qe=_e.splice,Ye=Re?Re.isConcatSpreadable:void 0,mt=Re?Re.iterator:void 0,bt=Re?Re.toStringTag:void 0,qt=function(){try{var e=Qi(pe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Yt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=Y&&Y.now!==ze.Date.now&&Y.now,$t=t.setTimeout!==ze.setTimeout&&t.setTimeout,Qt=ve.ceil,Zt=ve.floor,Jt=pe.getOwnPropertySymbols,en=we?we.isBuffer:void 0,tn=t.isFinite,nn=_e.join,ln=Bt(pe.keys,pe),on=ve.max,rn=ve.min,an=Y.now,un=t.parseInt,cn=ve.random,sn=_e.reverse,dn=Qi(t,"DataView"),vn=Qi(t,"Map"),pn=Qi(t,"Promise"),mn=Qi(t,"Set"),fn=Qi(t,"WeakMap"),En=Qi(pe,"create"),_n=fn&&new fn,hn={},gn=Co(dn),Sn=Co(vn),yn=Co(pn),bn=Co(mn),Tn=Co(fn),An=Re?Re.prototype:void 0,Cn=An?An.valueOf:void 0,Nn=An?An.toString:void 0;function Dn(e){if(Hr(e)&&!xr(e)&&!(e instanceof xn)){if(e instanceof wn)return e;if(ye.call(e,"__wrapped__"))return No(e)}return new wn(e)}var In=function(){function e(){}return function(t){if(!jr(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function On(){}function wn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function xn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function kn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Pn;++t<n;)this.add(e[t])}function Mn(e){var t=this.__data__=new Ln(e);this.size=t.size}function Fn(e,t){var n=xr(e),l=!n&&wr(e),i=!n&&!l&&kr(e),o=!n&&!l&&!i&&$r(e),r=n||l||i||o,a=r?Ct(e.length,fe):[],u=a.length;for(var c in e)!t&&!ye.call(e,c)||r&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||io(c,u))||a.push(c);return a}function Bn(e){var t=e.length;return t?e[Pl(0,t-1)]:void 0}function Un(e,t){return bo(fi(e),Yn(t,0,e.length))}function Wn(e){return bo(fi(e))}function jn(e,t,n){(void 0!==n&&!Dr(e[t],n)||void 0===n&&!(t in e))&&Gn(e,t,n)}function Hn(e,t,n){var l=e[t];ye.call(e,t)&&Dr(l,n)&&(void 0!==n||t in e)||Gn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(Dr(e[n][0],t))return n;return-1}function Vn(e,t,n,l){return Jn(e,function(e,i,o){t(l,e,n(e),o)}),l}function Kn(e,t){return e&&Ei(t,ha(t),e)}function Gn(e,t,n){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qn(e,t){for(var n=-1,l=t.length,i=G(l),o=null==e;++n<l;)i[n]=o?void 0:pa(e,t[n]);return i}function Yn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,l,i,r){var c,g=1&t,w=2&t,x=4&t;if(n&&(c=i?n(e,l,i,r):n(e)),void 0!==c)return c;if(!jr(e))return e;var R=xr(e);if(R){if(c=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ye.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!g)return fi(e,c)}else{var L=eo(e),P=L==s||L==d;if(kr(e))return ci(e,g);if(L==m||L==o||P&&!i){if(c=w||P?{}:no(e),!g)return w?function(e,t){return Ei(e,Ji(e),t)}(e,function(e,t){return e&&Ei(t,ga(t),e)}(c,e)):function(e,t){return Ei(e,Zi(e),t)}(e,Kn(c,e))}else{if(!Fe[L])return i?e:{};c=function(e,t,n){var l=e.constructor;switch(t){case S:return si(e);case a:case u:return new l(+e);case y:return function(e,t){var n=t?si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case b:case T:case A:case C:case N:case D:case"[object Uint8ClampedArray]":case I:case O:return di(e,n);case v:return new l;case p:case _:return new l(e);case f:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new l;case h:return Cn?pe(Cn.call(e)):{}}}(e,L,g)}}r||(r=new Mn);var k=r.get(e);if(k)return k;r.set(e,c),qr(e)?e.forEach(function(l){c.add(Xn(l,t,n,l,e,r))}):zr(e)&&e.forEach(function(l,i){c.set(i,Xn(l,t,n,i,e,r))});var M=R?void 0:(x?w?Vi:zi:w?ga:ha)(e);return lt(M||e,function(l,i){M&&(l=e[i=l]),Hn(c,i,Xn(l,t,n,i,e,r))}),c}function $n(e,t,n){var l=n.length;if(null==e)return!l;for(e=pe(e);l--;){var i=n[l],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Qn(e,t,l){if("function"!=typeof e)throw new Ee(n);return ho(function(){e.apply(void 0,l)},t)}function Zn(e,t,n,l){var i=-1,o=at,r=!0,a=e.length,u=[],c=t.length;if(!a)return u;n&&(t=ct(t,Dt(n))),l?(o=ut,r=!1):t.length>=200&&(o=Ot,r=!1,t=new kn(t));e:for(;++i<a;){var s=e[i],d=null==n?s:n(s);if(s=l||0!==s?s:0,r&&d==d){for(var v=c;v--;)if(t[v]===d)continue e;u.push(s)}else o(t,d,l)||u.push(s)}return u}Dn.templateSettings={escape:F,evaluate:B,interpolate:U,variable:"",imports:{_:Dn}},(Dn.prototype=On.prototype).constructor=Dn,(wn.prototype=In(On.prototype)).constructor=wn,(xn.prototype=In(On.prototype)).constructor=xn,Rn.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},Rn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Rn.prototype.get=function(e){var t=this.__data__;if(En){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ye.call(t,e)?t[e]:void 0},Rn.prototype.has=function(e){var t=this.__data__;return En?void 0!==t[e]:ye.call(t,e)},Rn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=En&&void 0===t?"__lodash_hash_undefined__":t,this},Ln.prototype.clear=function(){this.__data__=[],this.size=0},Ln.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},Ln.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},Ln.prototype.has=function(e){return zn(this.__data__,e)>-1},Ln.prototype.set=function(e,t){var n=this.__data__,l=zn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},Pn.prototype.clear=function(){this.size=0,this.__data__={hash:new Rn,map:new(vn||Ln),string:new Rn}},Pn.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},Pn.prototype.get=function(e){return Xi(this,e).get(e)},Pn.prototype.has=function(e){return Xi(this,e).has(e)},Pn.prototype.set=function(e,t){var n=Xi(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},kn.prototype.add=kn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},kn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.clear=function(){this.__data__=new Ln,this.size=0},Mn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Mn.prototype.get=function(e){return this.__data__.get(e)},Mn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ln){var l=n.__data__;if(!vn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pn(l)}return n.set(e,t),this.size=n.size,this};var Jn=gi(al),el=gi(ul,!0);function tl(e,t){var n=!0;return Jn(e,function(e,l,i){return n=!!t(e,l,i)}),n}function nl(e,t,n){for(var l=-1,i=e.length;++l<i;){var o=e[l],r=t(o);if(null!=r&&(void 0===a?r==r&&!Xr(r):n(r,a)))var a=r,u=o}return u}function ll(e,t){var n=[];return Jn(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function il(e,t,n,l,i){var o=-1,r=e.length;for(n||(n=lo),i||(i=[]);++o<r;){var a=e[o];t>0&&n(a)?t>1?il(a,t-1,n,l,i):st(i,a):l||(i[i.length]=a)}return i}var ol=Si(),rl=Si(!0);function al(e,t){return e&&ol(e,t,ha)}function ul(e,t){return e&&rl(e,t,ha)}function cl(e,t){return rt(t,function(t){return Br(e[t])})}function sl(e,t){for(var n=0,l=(t=oi(t,e)).length;null!=e&&n<l;)e=e[Ao(t[n++])];return n&&n==l?e:void 0}function dl(e,t,n){var l=t(e);return xr(e)?l:st(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in pe(e)?function(e){var t=ye.call(e,bt),n=e[bt];try{e[bt]=void 0;var l=!0}catch(e){}var i=Ae.call(e);return l&&(t?e[bt]=n:delete e[bt]),i}(e):function(e){return Ae.call(e)}(e)}function pl(e,t){return e>t}function ml(e,t){return null!=e&&ye.call(e,t)}function fl(e,t){return null!=e&&t in pe(e)}function El(e,t,n){for(var l=n?ut:at,i=e[0].length,o=e.length,r=o,a=G(o),u=Infinity,c=[];r--;){var s=e[r];r&&t&&(s=ct(s,Dt(t))),u=rn(s.length,u),a[r]=!n&&(t||i>=120&&s.length>=120)?new kn(r&&s):void 0}s=e[0];var d=-1,v=a[0];e:for(;++d<i&&c.length<u;){var p=s[d],m=t?t(p):p;if(p=n||0!==p?p:0,!(v?Ot(v,m):l(c,m,n))){for(r=o;--r;){var f=a[r];if(!(f?Ot(f,m):l(e[r],m,n)))continue e}v&&v.push(m),c.push(p)}}return c}function _l(e,t,n){var l=null==(e=mo(e,t=oi(t,e)))?e:e[Ao(Fo(t))];return null==l?void 0:tt(l,e,n)}function hl(e){return Hr(e)&&vl(e)==o}function gl(e,t,n,l,i){return e===t||(null==e||null==t||!Hr(e)&&!Hr(t)?e!=e&&t!=t:function(e,t,n,l,i,s){var d=xr(e),g=xr(t),b=d?r:eo(e),T=g?r:eo(t),A=(b=b==o?m:b)==m,C=(T=T==o?m:T)==m,N=b==T;if(N&&kr(e)){if(!kr(t))return!1;d=!0,A=!1}if(N&&!A)return s||(s=new Mn),d||$r(e)?ji(e,t,n,l,i,s):function(e,t,n,l,i,o,r){switch(n){case y:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!o(new Be(e),new Be(t)));case a:case u:case p:return Dr(+e,+t);case c:return e.name==t.name&&e.message==t.message;case f:case _:return e==t+"";case v:var s=Ft;case E:if(s||(s=Wt),e.size!=t.size&&!(1&l))return!1;var d=r.get(e);if(d)return d==t;l|=2,r.set(e,t);var m=ji(s(e),s(t),l,i,o,r);return r.delete(e),m;case h:if(Cn)return Cn.call(e)==Cn.call(t)}return!1}(e,t,b,n,l,i,s);if(!(1&n)){var D=A&&ye.call(e,"__wrapped__"),I=C&&ye.call(t,"__wrapped__");if(D||I){var O=D?e.value():e,w=I?t.value():t;return s||(s=new Mn),i(O,w,n,l,s)}}return!!N&&(s||(s=new Mn),function(e,t,n,l,i,o){var r=1&n,a=zi(e),u=a.length;if(u!=zi(t).length&&!r)return!1;for(var c=u;c--;){var s=a[c];if(!(r?s in t:ye.call(t,s)))return!1}var d=o.get(e),v=o.get(t);if(d&&v)return d==t&&v==e;var p=!0;o.set(e,t),o.set(t,e);for(var m=r;++c<u;){var f=e[s=a[c]],E=t[s];if(l)var _=r?l(E,f,s,t,e,o):l(f,E,s,e,t,o);if(!(void 0===_?f===E||i(f,E,n,l,o):_)){p=!1;break}m||(m="constructor"==s)}if(p&&!m){var h=e.constructor,g=t.constructor;h==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof h&&h instanceof h&&"function"==typeof g&&g instanceof g||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,n,l,i,s))}(e,t,n,l,gl,i))}function Sl(e,t,n,l){var i=n.length,o=i,r=!l;if(null==e)return!o;for(e=pe(e);i--;){var a=n[i];if(r&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){var u=(a=n[i])[0],c=e[u],s=a[1];if(r&&a[2]){if(void 0===c&&!(u in e))return!1}else{var d=new Mn;if(l)var v=l(c,s,u,e,t,d);if(!(void 0===v?gl(s,c,3,l,d):v))return!1}}return!0}function yl(e){return!(!jr(e)||(t=e,Te&&Te in t))&&(Br(e)?De:ie).test(Co(e));var t}function bl(e){return"function"==typeof e?e:null==e?Va:"object"==typeof e?xr(e)?Dl(e[0],e[1]):Nl(e):Ja(e)}function Tl(e){if(!co(e))return ln(e);var t=[];for(var n in pe(e))ye.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Al(e,t){return e<t}function Cl(e,t){var n=-1,l=Lr(e)?G(e.length):[];return Jn(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Nl(e){var t=$i(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function Dl(e,t){return ro(e)&&so(t)?vo(Ao(e),t):function(n){var l=pa(n,e);return void 0===l&&l===t?ma(n,e):gl(t,l,3)}}function Il(e,t,n,l,i){e!==t&&ol(t,function(o,r){if(i||(i=new Mn),jr(o))!function(e,t,n,l,i,o,r){var a=Eo(e,n),u=Eo(t,n),c=r.get(u);if(c)jn(e,n,c);else{var s=o?o(a,u,n+"",e,t,r):void 0,d=void 0===s;if(d){var v=xr(u),p=!v&&kr(u),m=!v&&!p&&$r(u);s=u,v||p||m?xr(a)?s=a:Pr(a)?s=fi(a):p?(d=!1,s=ci(u,!0)):m?(d=!1,s=di(u,!0)):s=[]:Kr(u)||wr(u)?(s=a,wr(a)?s=ia(a):jr(a)&&!Br(a)||(s=no(u))):d=!1}d&&(r.set(u,s),i(s,u,l,o,r),r.delete(u)),jn(e,n,s)}}(e,t,r,n,Il,l,i);else{var a=l?l(Eo(e,r),o,r+"",e,t,i):void 0;void 0===a&&(a=o),jn(e,r,a)}},ga)}function Ol(e,t){var n=e.length;if(n)return io(t+=t<0?n:0,n)?e[t]:void 0}function wl(e,t,n){t=t.length?ct(t,function(e){return xr(e)?function(t){return sl(t,1===e.length?e[0]:e)}:e}):[Va];var l=-1;return t=ct(t,Dt(Yi())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,r=i.length,a=n.length;++l<r;){var u=vi(i[l],o[l]);if(u)return l>=a?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Cl(e,function(e,n,i){return{criteria:ct(t,function(t){return t(e)}),index:++l,value:e}}))}function xl(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var r=t[l],a=sl(e,r);n(a,r)&&Ul(o,oi(r,e),a)}return o}function Rl(e,t,n,l){var i=l?ht:_t,o=-1,r=t.length,a=e;for(e===t&&(t=fi(t)),n&&(a=ct(e,Dt(n)));++o<r;)for(var u=0,c=t[o],s=n?n(c):c;(u=i(a,s,u,l))>-1;)a!==e&&qe.call(a,u,1),qe.call(e,u,1);return e}function Ll(e,t){for(var n=e?t.length:0,l=n-1;n--;){var i=t[n];if(n==l||i!==o){var o=i;io(i)?qe.call(e,i,1):Ql(e,i)}}return e}function Pl(e,t){return e+Zt(cn()*(t-e+1))}function kl(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Zt(t/2))&&(e+=e)}while(t);return n}function Ml(e,t){return go(po(e,t,Va),e+"")}function Fl(e){return Bn(Da(e))}function Bl(e,t){var n=Da(e);return bo(n,Yn(t,0,n.length))}function Ul(e,t,n,l){if(!jr(e))return e;for(var i=-1,o=(t=oi(t,e)).length,r=o-1,a=e;null!=a&&++i<o;){var u=Ao(t[i]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=r){var s=a[u];void 0===(c=l?l(s,u,a):void 0)&&(c=jr(s)?s:io(t[i+1])?[]:{})}Hn(a,u,c),a=a[u]}return e}var Wl=_n?function(e,t){return _n.set(e,t),e}:Va,jl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:ja(t),writable:!0})}:Va;function Hl(e){return bo(Da(e))}function zl(e,t,n){var l=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=G(i);++l<i;)o[l]=e[l+t];return o}function Vl(e,t){var n;return Jn(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Kl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var o=l+i>>>1,r=e[o];null!==r&&!Xr(r)&&(n?r<=t:r<t)?l=o+1:i=o}return i}return Gl(e,t,Va,n)}function Gl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var r=(t=n(t))!=t,a=null===t,u=Xr(t),c=void 0===t;i<o;){var s=Zt((i+o)/2),d=n(e[s]),v=void 0!==d,p=null===d,m=d==d,f=Xr(d);if(r)var E=l||m;else E=c?m&&(l||v):a?m&&v&&(l||!p):u?m&&v&&!p&&(l||!f):!p&&!f&&(l?d<=t:d<t);E?i=s+1:o=s}return rn(o,4294967294)}function ql(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var r=e[n],a=t?t(r):r;if(!n||!Dr(a,u)){var u=a;o[i++]=0===r?0:r}}return o}function Yl(e){return"number"==typeof e?e:Xr(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(xr(e))return ct(e,Xl)+"";if(Xr(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function $l(e,t,n){var l=-1,i=at,o=e.length,r=!0,a=[],u=a;if(n)r=!1,i=ut;else if(o>=200){var c=t?null:ki(e);if(c)return Wt(c);r=!1,i=Ot,u=new kn}else u=t?[]:a;e:for(;++l<o;){var s=e[l],d=t?t(s):s;if(s=n||0!==s?s:0,r&&d==d){for(var v=u.length;v--;)if(u[v]===d)continue e;t&&u.push(d),a.push(s)}else i(u,d,n)||(u!==a&&u.push(d),a.push(s))}return a}function Ql(e,t){var n=-1,l=(t=oi(t,e)).length;if(!l)return!0;for(var i=null==e||"object"!=typeof e&&"function"!=typeof e;++n<l;){var o=t[n];if("string"==typeof o){if("__proto__"===o&&!ye.call(e,"__proto__"))return!1;if("constructor"===o&&n+1<l&&"string"==typeof t[n+1]&&"prototype"===t[n+1]){if(i&&0===n)continue;return!1}}}var r=mo(e,t);return null==r||delete r[Ao(Fo(t))]}function Zl(e,t,n,l){return Ul(e,t,n(sl(e,t)),l)}function Jl(e,t,n,l){for(var i=e.length,o=l?i:-1;(l?o--:++o<i)&&t(e[o],o,e););return n?zl(e,l?0:o,l?o+1:i):zl(e,l?o+1:0,l?i:o)}function ei(e,t){var n=e;return n instanceof xn&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function ti(e,t,n){var l=e.length;if(l<2)return l?$l(e[0]):[];for(var i=-1,o=G(l);++i<l;)for(var r=e[i],a=-1;++a<l;)a!=i&&(o[i]=Zn(o[i]||r,e[a],t,n));return $l(il(o,1),t,n)}function ni(e,t,n){for(var l=-1,i=e.length,o=t.length,r={};++l<i;)n(r,e[l],l<o?t[l]:void 0);return r}function li(e){return Pr(e)?e:[]}function ii(e){return"function"==typeof e?e:Va}function oi(e,t){return xr(e)?e:ro(e,t)?[e]:To(oa(e))}var ri=Ml;function ai(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var ui=Yt||function(e){return ze.clearTimeout(e)};function ci(e,t){if(t)return e.slice();var n=e.length,l=je?je(n):new e.constructor(n);return e.copy(l),l}function si(e){var t=new e.constructor(e.byteLength);return new Be(t).set(new Be(e)),t}function di(e,t){var n=t?si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=Xr(e),r=void 0!==t,a=null===t,u=t==t,c=Xr(t);if(!a&&!c&&!o&&e>t||o&&r&&u&&!a&&!c||l&&r&&u||!n&&u||!i)return 1;if(!l&&!o&&!c&&e<t||c&&n&&i&&!l&&!o||a&&n&&i||!r&&i||!u)return-1}return 0}function pi(e,t,n,l){for(var i=-1,o=e.length,r=n.length,a=-1,u=t.length,c=on(o-r,0),s=G(u+c),d=!l;++a<u;)s[a]=t[a];for(;++i<r;)(d||i<o)&&(s[n[i]]=e[i]);for(;c--;)s[a++]=e[i++];return s}function mi(e,t,n,l){for(var i=-1,o=e.length,r=-1,a=n.length,u=-1,c=t.length,s=on(o-a,0),d=G(s+c),v=!l;++i<s;)d[i]=e[i];for(var p=i;++u<c;)d[p+u]=t[u];for(;++r<a;)(v||i<o)&&(d[p+n[r]]=e[i++]);return d}function fi(e,t){var n=-1,l=e.length;for(t||(t=G(l));++n<l;)t[n]=e[n];return t}function Ei(e,t,n,l){var i=!n;n||(n={});for(var o=-1,r=t.length;++o<r;){var a=t[o],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),i?Gn(n,a,u):Hn(n,a,u)}return n}function _i(e,t){return function(n,l){var i=xr(n)?nt:Vn,o=t?t():{};return i(n,e,Yi(l,2),o)}}function hi(e){return Ml(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,r=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,r&&oo(n[0],n[1],r)&&(o=i<3?void 0:o,i=1),t=pe(t);++l<i;){var a=n[l];a&&e(t,a,l,o)}return t})}function gi(e,t){return function(n,l){if(null==n)return n;if(!Lr(n))return e(n,l);for(var i=n.length,o=t?i:-1,r=pe(n);(t?o--:++o<i)&&!1!==l(r[o],o,r););return n}}function Si(e){return function(t,n,l){for(var i=-1,o=pe(t),r=l(t),a=r.length;a--;){var u=r[e?a:++i];if(!1===n(o[u],u,o))break}return t}}function yi(e){return function(t){var n=Mt(t=oa(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),i=n?ai(n,1).join(""):t.slice(1);return l[e]()+i}}function bi(e){return function(t){return dt(Ba(wa(t).replace(Ie,"")),e,"")}}function Ti(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 n=In(e.prototype),l=e.apply(n,t);return jr(l)?l:n}}function Ai(e){return function(t,n,l){var i=pe(t);if(!Lr(t)){var o=Yi(n,3);t=ha(t),n=function(e){return o(i[e],e,i)}}var r=e(t,n,l);return r>-1?i[o?t[r]:r]:void 0}}function Ci(e){return Hi(function(t){var l=t.length,i=l,o=wn.prototype.thru;for(e&&t.reverse();i--;){var r=t[i];if("function"!=typeof r)throw new Ee(n);if(o&&!a&&"wrapper"==Gi(r))var a=new wn([],!0)}for(i=a?i:l;++i<l;){var u=Gi(r=t[i]),c="wrapper"==u?Ki(r):void 0;a=c&&ao(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?a[Gi(c[0])].apply(a,c[3]):1==r.length&&ao(r)?a[u]():a.thru(r)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&xr(n))return a.plant(n).value();for(var i=0,o=l?t[i].apply(this,e):n;++i<l;)o=t[i].call(this,o);return o}})}function Ni(e,t,n,l,i,o,r,a,u,c){var s=128&t,d=1&t,v=2&t,p=24&t,m=512&t,f=v?void 0:Ti(e);return function E(){for(var _=arguments.length,h=G(_),g=_;g--;)h[g]=arguments[g];if(p)var S=qi(E),y=Rt(h,S);if(l&&(h=pi(h,l,i,p)),o&&(h=mi(h,o,r,p)),_-=y,p&&_<c){var b=Ut(h,S);return Li(e,t,Ni,E.placeholder,n,h,b,a,u,c-_)}var T=d?n:this,A=v?T[e]:e;return _=h.length,a?h=fo(h,a):m&&_>1&&h.reverse(),s&&u<_&&(h.length=u),this&&this!==ze&&this instanceof E&&(A=f||Ti(A)),A.apply(T,h)}}function Di(e,t){return function(n,l){return function(e,t,n,l){return al(e,function(e,i,o){t(l,n(e),i,o)}),l}(n,e,t(l),{})}}function Ii(e,t){return function(n,l){var i;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(i=n),void 0!==l){if(void 0===i)return l;"string"==typeof n||"string"==typeof l?(n=Xl(n),l=Xl(l)):(n=Yl(n),l=Yl(l)),i=e(n,l)}return i}}function Oi(e){return Hi(function(t){return t=ct(t,Dt(Yi())),Ml(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function wi(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?kl(t,e):t;var l=kl(t,Qt(e/Ht(t)));return Mt(t)?ai(zt(l),0,e).join(""):l.slice(0,e)}function xi(e){return function(t,n,l){return l&&"number"!=typeof l&&oo(t,n,l)&&(n=l=void 0),t=ea(t),void 0===n?(n=t,t=0):n=ea(n),function(e,t,n,l){for(var i=-1,o=on(Qt((t-e)/(n||1)),0),r=G(o);o--;)r[l?o:++i]=e,e+=n;return r}(t,n,l=void 0===l?t<n?1:-1:ea(l),e)}}function Ri(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=la(t),n=la(n)),e(t,n)}}function Li(e,t,n,l,i,o,r,a,u,c){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var d=[e,t,i,s?o:void 0,s?r:void 0,s?void 0:o,s?void 0:r,a,u,c],v=n.apply(void 0,d);return ao(e)&&_o(v,d),v.placeholder=l,So(v,e,t)}function Pi(e){var t=ve[e];return function(e,n){if(e=la(e),(n=null==n?0:rn(ta(n),292))&&tn(e)){var l=(oa(e)+"e").split("e");return+((l=(oa(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var ki=mn&&1/Wt(new mn([,-0]))[1]==1/0?function(e){return new mn(e)}:Xa;function Mi(e){return function(t){var n=eo(t);return n==v?Ft(t):n==E?jt(t):function(e,t){return ct(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fi(e,t,i,o,r,a,u,c){var s=2&t;if(!s&&"function"!=typeof e)throw new Ee(n);var d=o?o.length:0;if(d||(t&=-97,o=r=void 0),u=void 0===u?u:on(ta(u),0),c=void 0===c?c:ta(c),d-=r?r.length:0,64&t){var v=o,p=r;o=r=void 0}var m=s?void 0:Ki(e),f=[e,t,i,o,r,v,p,a,u,c];if(m&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var r=t[3];if(r){var a=e[3];e[3]=a?pi(a,r,t[4]):r,e[4]=a?Ut(e[3],l):t[4]}(r=t[5])&&(e[5]=(a=e[5])?mi(a,r,t[6]):r,e[6]=a?Ut(e[5],l):t[6]),(r=t[7])&&(e[7]=r),128&i&&(e[8]=null==e[8]?t[8]:rn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(f,m),e=f[0],t=f[1],i=f[2],o=f[3],r=f[4],!(c=f[9]=void 0===f[9]?s?0:e.length:on(f[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=Ti(e);return function i(){for(var o=arguments.length,r=G(o),a=o,u=qi(i);a--;)r[a]=arguments[a];var c=o<3&&r[0]!==u&&r[o-1]!==u?[]:Ut(r,u);if((o-=c.length)<n)return Li(e,t,Ni,i.placeholder,void 0,r,c,void 0,void 0,n-o);var s=this&&this!==ze&&this instanceof i?l:e;return tt(s,this,r)}}(e,t,c):32!=t&&33!=t||r.length?Ni.apply(void 0,f):function(e,t,n,l){var i=1&t,o=Ti(e);return function t(){for(var r=-1,a=arguments.length,u=-1,c=l.length,s=G(c+a),d=this&&this!==ze&&this instanceof t?o:e;++u<c;)s[u]=l[u];for(;a--;)s[u++]=arguments[++r];return tt(d,i?n:this,s)}}(e,t,i,o);else var E=function(e,t,n){var l=1&t,i=Ti(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return So((m?Wl:_o)(E,f),e,t)}function Bi(e,t,n,l){return void 0===e||Dr(e,he[n])&&!ye.call(l,n)?t:e}function Ui(e,t,n,l,i,o){return jr(e)&&jr(t)&&(o.set(t,e),Il(e,t,void 0,Ui,o),o.delete(t)),e}function Wi(e){return Kr(e)?void 0:e}function ji(e,t,n,l,i,o){var r=1&n,a=e.length,u=t.length;if(a!=u&&!(r&&u>a))return!1;var c=o.get(e),s=o.get(t);if(c&&s)return c==t&&s==e;var d=-1,v=!0,p=2&n?new kn:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var m=e[d],f=t[d];if(l)var E=r?l(f,m,d,t,e,o):l(m,f,d,e,t,o);if(void 0!==E){if(E)continue;v=!1;break}if(p){if(!pt(t,function(e,t){if(!Ot(p,t)&&(m===e||i(m,e,n,l,o)))return p.push(t)})){v=!1;break}}else if(m!==f&&!i(m,f,n,l,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function Hi(e){return go(po(e,void 0,Ro),e+"")}function zi(e){return dl(e,ha,Zi)}function Vi(e){return dl(e,ga,Ji)}var Ki=_n?function(e){return _n.get(e)}:Xa;function Gi(e){for(var t=e.name+"",n=hn[t],l=ye.call(hn,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function qi(e){return(ye.call(Dn,"placeholder")?Dn:e).placeholder}function Yi(){var e=Dn.iteratee||Ka;return e=e===Ka?bl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var n,l,i=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function $i(e){for(var t=ha(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,so(i)]}return t}function Qi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return yl(n)?n:void 0}var Zi=Jt?function(e){return null==e?[]:(e=pe(e),rt(Jt(e),function(t){return Ke.call(e,t)}))}:nu,Ji=Jt?function(e){for(var t=[];e;)st(t,Zi(e)),e=He(e);return t}:nu,eo=vl;function to(e,t,n){for(var l=-1,i=(t=oi(t,e)).length,o=!1;++l<i;){var r=Ao(t[l]);if(!(o=null!=e&&n(e,r)))break;e=e[r]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&Wr(i)&&io(r,i)&&(xr(e)||wr(e))}function no(e){return"function"!=typeof e.constructor||co(e)?{}:In(He(e))}function lo(e){return xr(e)||wr(e)||!!(Ye&&e&&e[Ye])}function io(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&re.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,n){if(!jr(n))return!1;var l=typeof t;return!!("number"==l?Lr(n)&&io(t,n.length):"string"==l&&t in n)&&Dr(n[t],e)}function ro(e,t){if(xr(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Xr(e))||j.test(e)||!W.test(e)||null!=t&&e in pe(t)}function ao(e){var t=Gi(e),n=Dn[t];if("function"!=typeof n||!(t in xn.prototype))return!1;if(e===n)return!0;var l=Ki(n);return!!l&&e===l[0]}(dn&&eo(new dn(new ArrayBuffer(1)))!=y||vn&&eo(new vn)!=v||pn&&"[object Promise]"!=eo(pn.resolve())||mn&&eo(new mn)!=E||fn&&eo(new fn)!=g)&&(eo=function(e){var t=vl(e),n=t==m?e.constructor:void 0,l=n?Co(n):"";if(l)switch(l){case gn:return y;case Sn:return v;case yn:return"[object Promise]";case bn:return E;case Tn:return g}return t});var uo=ge?Br:lu;function co(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||he)}function so(e){return e==e&&!jr(e)}function vo(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in pe(n))}}function po(e,t,n){return t=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=on(l.length-t,0),r=G(o);++i<o;)r[i]=l[t+i];i=-1;for(var a=G(t+1);++i<t;)a[i]=l[i];return a[t]=n(r),tt(e,this,a)}}function mo(e,t){return t.length<2?e:sl(e,zl(t,0,-1))}function fo(e,t){for(var n=e.length,l=rn(t.length,n),i=fi(e);l--;){var o=t[l];e[l]=io(o,n)?i[o]:void 0}return e}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _o=yo(Wl),ho=$t||function(e,t){return ze.setTimeout(e,t)},go=yo(jl);function So(e,t,n){var l=t+"";return go(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace(q,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!at(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(X);return t?t[1].split($):[]}(l),n)))}function yo(e){var t=0,n=0;return function(){var l=an(),i=16-(l-n);if(n=l,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function bo(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=Pl(n,i),r=e[o];e[o]=e[n],e[n]=r}return e.length=t,e}var To=function(e){var t=yr(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(H,function(e,n,l,i){t.push(l?i.replace(J,"$1"):n||e)}),t},function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}();function Ao(e){if("string"==typeof e||Xr(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Co(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function No(e){if(e instanceof xn)return e.clone();var t=new wn(e.__wrapped__,e.__chain__);return t.__actions__=fi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Do=Ml(function(e,t){return Pr(e)?Zn(e,il(t,1,Pr,!0)):[]}),Io=Ml(function(e,t){var n=Fo(t);return Pr(n)&&(n=void 0),Pr(e)?Zn(e,il(t,1,Pr,!0),Yi(n,2)):[]}),Oo=Ml(function(e,t){var n=Fo(t);return Pr(n)&&(n=void 0),Pr(e)?Zn(e,il(t,1,Pr,!0),void 0,n):[]});function wo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ta(n);return i<0&&(i=on(l+i,0)),Et(e,Yi(t,3),i)}function xo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=ta(n),i=n<0?on(l+i,0):rn(i,l-1)),Et(e,Yi(t,3),i,!0)}function Ro(e){return null!=e&&e.length?il(e,1):[]}function Lo(e){return e&&e.length?e[0]:void 0}var Po=Ml(function(e){var t=ct(e,li);return t.length&&t[0]===e[0]?El(t):[]}),ko=Ml(function(e){var t=Fo(e),n=ct(e,li);return t===Fo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,Yi(t,2)):[]}),Mo=Ml(function(e){var t=Fo(e),n=ct(e,li);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?El(n,void 0,t):[]});function Fo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Bo=Ml(Uo);function Uo(e,t){return e&&e.length&&t&&t.length?Rl(e,t):e}var Wo=Hi(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return Ll(e,ct(t,function(e){return io(e,n)?+e:e}).sort(vi)),l});function jo(e){return null==e?e:sn.call(e)}var Ho=Ml(function(e){return $l(il(e,1,Pr,!0))}),zo=Ml(function(e){var t=Fo(e);return Pr(t)&&(t=void 0),$l(il(e,1,Pr,!0),Yi(t,2))}),Vo=Ml(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,$l(il(e,1,Pr,!0),void 0,t)});function Ko(e){if(!e||!e.length)return[];var t=0;return e=rt(e,function(e){if(Pr(e))return t=on(e.length,t),!0}),Ct(t,function(t){return ct(e,yt(t))})}function Go(e,t){if(!e||!e.length)return[];var n=Ko(e);return null==t?n:ct(n,function(e){return tt(t,void 0,e)})}var qo=Ml(function(e,t){return Pr(e)?Zn(e,t):[]}),Yo=Ml(function(e){return ti(rt(e,Pr))}),Xo=Ml(function(e){var t=Fo(e);return Pr(t)&&(t=void 0),ti(rt(e,Pr),Yi(t,2))}),$o=Ml(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,ti(rt(e,Pr),void 0,t)}),Qo=Ml(Ko),Zo=Ml(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Go(e,n)});function Jo(e){var t=Dn(e);return t.__chain__=!0,t}function er(e,t){return t(e)}var tr=Hi(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof xn&&io(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:er,args:[i],thisArg:void 0}),new wn(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),nr=_i(function(e,t,n){ye.call(e,n)?++e[n]:Gn(e,n,1)}),lr=Ai(wo),ir=Ai(xo);function or(e,t){return(xr(e)?lt:Jn)(e,Yi(t,3))}function rr(e,t){return(xr(e)?it:el)(e,Yi(t,3))}var ar=_i(function(e,t,n){ye.call(e,n)?e[n].push(t):Gn(e,n,[t])}),ur=Ml(function(e,t,n){var l=-1,i="function"==typeof t,o=Lr(e)?G(e.length):[];return Jn(e,function(e){o[++l]=i?tt(t,e,n):_l(e,t,n)}),o}),cr=_i(function(e,t,n){Gn(e,n,t)});function sr(e,t){return(xr(e)?ct:Cl)(e,Yi(t,3))}var dr=_i(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),vr=Ml(function(e,t){if(null==e)return[];var n=t.length;return n>1&&oo(e,t[0],t[1])?t=[]:n>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),wl(e,il(t,1),[])}),pr=Xt||function(){return ze.Date.now()};function mr(e,t,n){return t=n?void 0:t,Fi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function fr(e,t){var l;if("function"!=typeof t)throw new Ee(n);return e=ta(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var Er=Ml(function(e,t,n){var l=1;if(n.length){var i=Ut(n,qi(Er));l|=32}return Fi(e,l,t,n,i)}),_r=Ml(function(e,t,n){var l=3;if(n.length){var i=Ut(n,qi(_r));l|=32}return Fi(t,l,e,n,i)});function hr(e,t,l){var i,o,r,a,u,c,s=0,d=!1,v=!1,p=!0;if("function"!=typeof e)throw new Ee(n);function m(t){var n=i,l=o;return i=o=void 0,s=t,a=e.apply(l,n)}function f(e){return s=e,u=ho(_,t),d?m(e):a}function E(e){var n=e-c;return void 0===c||n>=t||n<0||v&&e-s>=r}function _(){var e=pr();if(E(e))return h(e);u=ho(_,function(e){var n=t-(e-c);return v?rn(n,r-(e-s)):n}(e))}function h(e){return u=void 0,p&&i?m(e):(i=o=void 0,a)}function g(){var e=pr(),n=E(e);if(i=arguments,o=this,c=e,n){if(void 0===u)return f(c);if(v)return ui(u),u=ho(_,t),m(c)}return void 0===u&&(u=ho(_,t)),a}return t=la(t)||0,jr(l)&&(d=!!l.leading,r=(v="maxWait"in l)?on(la(l.maxWait)||0,t):r,p="trailing"in l?!!l.trailing:p),g.cancel=function(){void 0!==u&&ui(u),s=0,i=c=o=u=void 0},g.flush=function(){return void 0===u?a:h(pr())},g}var gr=Ml(function(e,t){return Qn(e,1,t)}),Sr=Ml(function(e,t,n){return Qn(e,la(t)||0,n)});function yr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(n);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 r=e.apply(this,n);return l.cache=o.set(i,r)||o,r};return l.cache=new(yr.Cache||Pn),l}function br(e){if("function"!=typeof e)throw new Ee(n);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)}}yr.Cache=Pn;var Tr=ri(function(e,t){var n=(t=1==t.length&&xr(t[0])?ct(t[0],Dt(Yi())):ct(il(t,1),Dt(Yi()))).length;return Ml(function(l){for(var i=-1,o=rn(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),Ar=Ml(function(e,t){return Fi(e,32,void 0,t,Ut(t,qi(Ar)))}),Cr=Ml(function(e,t){return Fi(e,64,void 0,t,Ut(t,qi(Cr)))}),Nr=Hi(function(e,t){return Fi(e,256,void 0,void 0,void 0,t)});function Dr(e,t){return e===t||e!=e&&t!=t}var Ir=Ri(pl),Or=Ri(function(e,t){return e>=t}),wr=hl(function(){return arguments}())?hl:function(e){return Hr(e)&&ye.call(e,"callee")&&!Ke.call(e,"callee")},xr=G.isArray,Rr=Xe?Dt(Xe):function(e){return Hr(e)&&vl(e)==S};function Lr(e){return null!=e&&Wr(e.length)&&!Br(e)}function Pr(e){return Hr(e)&&Lr(e)}var kr=en||lu,Mr=$e?Dt($e):function(e){return Hr(e)&&vl(e)==u};function Fr(e){if(!Hr(e))return!1;var t=vl(e);return t==c||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Kr(e)}function Br(e){if(!jr(e))return!1;var t=vl(e);return t==s||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ur(e){return"number"==typeof e&&e==ta(e)}function Wr(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function jr(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Hr(e){return null!=e&&"object"==typeof e}var zr=Qe?Dt(Qe):function(e){return Hr(e)&&eo(e)==v};function Vr(e){return"number"==typeof e||Hr(e)&&vl(e)==p}function Kr(e){if(!Hr(e)||vl(e)!=m)return!1;var t=He(e);if(null===t)return!0;var n=ye.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==Ce}var Gr=Ze?Dt(Ze):function(e){return Hr(e)&&vl(e)==f},qr=Je?Dt(Je):function(e){return Hr(e)&&eo(e)==E};function Yr(e){return"string"==typeof e||!xr(e)&&Hr(e)&&vl(e)==_}function Xr(e){return"symbol"==typeof e||Hr(e)&&vl(e)==h}var $r=et?Dt(et):function(e){return Hr(e)&&Wr(e.length)&&!!Me[vl(e)]},Qr=Ri(Al),Zr=Ri(function(e,t){return e<=t});function Jr(e){if(!e)return[];if(Lr(e))return Yr(e)?zt(e):fi(e);if(mt&&e[mt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[mt]());var t=eo(e);return(t==v?Ft:t==E?Wt:Da)(e)}function ea(e){return e?(e=la(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ta(e){var t=ea(e),n=t%1;return t==t?n?t-n:t:0}function na(e){return e?Yn(ta(e),0,4294967295):0}function la(e){if("number"==typeof e)return e;if(Xr(e))return NaN;if(jr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=jr(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Nt(e);var n=le.test(e);return n||oe.test(e)?We(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ia(e){return Ei(e,ga(e))}function oa(e){return null==e?"":Xl(e)}var ra=hi(function(e,t){if(co(t)||Lr(t))Ei(t,ha(t),e);else for(var n in t)ye.call(t,n)&&Hn(e,n,t[n])}),aa=hi(function(e,t){Ei(t,ga(t),e)}),ua=hi(function(e,t,n,l){Ei(t,ga(t),e,l)}),ca=hi(function(e,t,n,l){Ei(t,ha(t),e,l)}),sa=Hi(qn),da=Ml(function(e,t){e=pe(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],r=ga(o),a=-1,u=r.length;++a<u;){var c=r[a],s=e[c];(void 0===s||Dr(s,he[c])&&!ye.call(e,c))&&(e[c]=o[c])}return e}),va=Ml(function(e){return e.push(void 0,Ui),tt(ya,void 0,e)});function pa(e,t,n){var l=null==e?void 0:sl(e,t);return void 0===l?n:l}function ma(e,t){return null!=e&&to(e,t,fl)}var fa=Di(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),e[t]=n},ja(Va)),Ea=Di(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),ye.call(e,t)?e[t].push(n):e[t]=[n]},Yi),_a=Ml(_l);function ha(e){return Lr(e)?Fn(e):Tl(e)}function ga(e){return Lr(e)?Fn(e,!0):function(e){if(!jr(e))return function(e){var t=[];if(null!=e)for(var n in pe(e))t.push(n);return t}(e);var t=co(e),n=[];for(var l in e)("constructor"!=l||!t&&ye.call(e,l))&&n.push(l);return n}(e)}var Sa=hi(function(e,t,n){Il(e,t,n)}),ya=hi(function(e,t,n,l){Il(e,t,n,l)}),ba=Hi(function(e,t){var n={};if(null==e)return n;var l=!1;t=ct(t,function(t){return t=oi(t,e),l||(l=t.length>1),t}),Ei(e,Vi(e),n),l&&(n=Xn(n,7,Wi));for(var i=t.length;i--;)Ql(n,t[i]);return n}),Ta=Hi(function(e,t){return null==e?{}:function(e,t){return xl(e,t,function(t,n){return ma(e,n)})}(e,t)});function Aa(e,t){if(null==e)return{};var n=ct(Vi(e),function(e){return[e]});return t=Yi(t),xl(e,n,function(e,n){return t(e,n[0])})}var Ca=Mi(ha),Na=Mi(ga);function Da(e){return null==e?[]:It(e,ha(e))}var Ia=bi(function(e,t,n){return t=t.toLowerCase(),e+(n?Oa(t):t)});function Oa(e){return Fa(oa(e).toLowerCase())}function wa(e){return(e=oa(e))&&e.replace(ae,Lt).replace(Oe,"")}var xa=bi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ra=bi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),La=yi("toLowerCase"),Pa=bi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),ka=bi(function(e,t,n){return e+(n?" ":"")+Fa(t)}),Ma=bi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Fa=yi("toUpperCase");function Ba(e,t,n){return e=oa(e),void 0===(t=n?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(xe)||[]}(e):function(e){return e.match(Q)||[]}(e):e.match(t)||[]}var Ua=Ml(function(e,t){try{return tt(e,void 0,t)}catch(e){return Fr(e)?e:new se(e)}}),Wa=Hi(function(e,t){return lt(t,function(t){t=Ao(t),Gn(e,t,Er(e[t],e))}),e});function ja(e){return function(){return e}}var Ha=Ci(),za=Ci(!0);function Va(e){return e}function Ka(e){return bl("function"==typeof e?e:Xn(e,1))}var Ga=Ml(function(e,t){return function(n){return _l(n,e,t)}}),qa=Ml(function(e,t){return function(n){return _l(e,n,t)}});function Ya(e,t,n){var l=ha(t),i=cl(t,l);null!=n||jr(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=cl(t,ha(t)));var o=!(jr(n)&&"chain"in n&&!n.chain),r=Br(e);return lt(i,function(n){var l=t[n];e[n]=l,r&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=fi(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,st([this.value()],arguments))})}),e}function Xa(){}var $a=Oi(ct),Qa=Oi(ot),Za=Oi(pt);function Ja(e){return ro(e)?yt(Ao(e)):function(e){return function(t){return sl(t,e)}}(e)}var eu=xi(),tu=xi(!0);function nu(){return[]}function lu(){return!1}var iu,ou=Ii(function(e,t){return e+t},0),ru=Pi("ceil"),au=Ii(function(e,t){return e/t},1),uu=Pi("floor"),cu=Ii(function(e,t){return e*t},1),su=Pi("round"),du=Ii(function(e,t){return e-t},0);return Dn.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=ta(e),function(){if(--e<1)return t.apply(this,arguments)}},Dn.ary=mr,Dn.assign=ra,Dn.assignIn=aa,Dn.assignInWith=ua,Dn.assignWith=ca,Dn.at=sa,Dn.before=fr,Dn.bind=Er,Dn.bindAll=Wa,Dn.bindKey=_r,Dn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return xr(e)?e:[e]},Dn.chain=Jo,Dn.chunk=function(e,t,n){t=(n?oo(e,t,n):void 0===t)?1:on(ta(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,r=G(Qt(l/t));i<l;)r[o++]=zl(e,i,i+=t);return r},Dn.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,i=[];++t<n;){var o=e[t];o&&(i[l++]=o)}return i},Dn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=G(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return st(xr(n)?fi(n):[n],il(t,1))},Dn.cond=function(e){var t=null==e?0:e.length,l=Yi();return e=t?ct(e,function(e){if("function"!=typeof e[1])throw new Ee(n);return[l(e[0]),e[1]]}):[],Ml(function(n){for(var l=-1;++l<t;){var i=e[l];if(tt(i[0],this,n))return tt(i[1],this,n)}})},Dn.conforms=function(e){return function(e){var t=ha(e);return function(n){return $n(n,e,t)}}(Xn(e,1))},Dn.constant=ja,Dn.countBy=nr,Dn.create=function(e,t){var n=In(e);return null==t?n:Kn(n,t)},Dn.curry=function e(t,n,l){var i=Fi(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Dn.curryRight=function e(t,n,l){var i=Fi(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Dn.debounce=hr,Dn.defaults=da,Dn.defaultsDeep=va,Dn.defer=gr,Dn.delay=Sr,Dn.difference=Do,Dn.differenceBy=Io,Dn.differenceWith=Oo,Dn.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:ta(t))<0?0:t,l):[]},Dn.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,0,(t=l-(t=n||void 0===t?1:ta(t)))<0?0:t):[]},Dn.dropRightWhile=function(e,t){return e&&e.length?Jl(e,Yi(t,3),!0,!0):[]},Dn.dropWhile=function(e,t){return e&&e.length?Jl(e,Yi(t,3),!0):[]},Dn.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&oo(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=ta(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:ta(l))<0&&(l+=i),l=n>l?0:na(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Dn.filter=function(e,t){return(xr(e)?rt:ll)(e,Yi(t,3))},Dn.flatMap=function(e,t){return il(sr(e,t),1)},Dn.flatMapDeep=function(e,t){return il(sr(e,t),1/0)},Dn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ta(n),il(sr(e,t),n)},Dn.flatten=Ro,Dn.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},Dn.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:ta(t)):[]},Dn.flip=function(e){return Fi(e,512)},Dn.flow=Ha,Dn.flowRight=za,Dn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var i=e[t];l[i[0]]=i[1]}return l},Dn.functions=function(e){return null==e?[]:cl(e,ha(e))},Dn.functionsIn=function(e){return null==e?[]:cl(e,ga(e))},Dn.groupBy=ar,Dn.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},Dn.intersection=Po,Dn.intersectionBy=ko,Dn.intersectionWith=Mo,Dn.invert=fa,Dn.invertBy=Ea,Dn.invokeMap=ur,Dn.iteratee=Ka,Dn.keyBy=cr,Dn.keys=ha,Dn.keysIn=ga,Dn.map=sr,Dn.mapKeys=function(e,t){var n={};return t=Yi(t,3),al(e,function(e,l,i){Gn(n,t(e,l,i),e)}),n},Dn.mapValues=function(e,t){var n={};return t=Yi(t,3),al(e,function(e,l,i){Gn(n,l,t(e,l,i))}),n},Dn.matches=function(e){return Nl(Xn(e,1))},Dn.matchesProperty=function(e,t){return Dl(e,Xn(t,1))},Dn.memoize=yr,Dn.merge=Sa,Dn.mergeWith=ya,Dn.method=Ga,Dn.methodOf=qa,Dn.mixin=Ya,Dn.negate=br,Dn.nthArg=function(e){return e=ta(e),Ml(function(t){return Ol(t,e)})},Dn.omit=ba,Dn.omitBy=function(e,t){return Aa(e,br(Yi(t)))},Dn.once=function(e){return fr(2,e)},Dn.orderBy=function(e,t,n,l){return null==e?[]:(xr(t)||(t=null==t?[]:[t]),xr(n=l?void 0:n)||(n=null==n?[]:[n]),wl(e,t,n))},Dn.over=$a,Dn.overArgs=Tr,Dn.overEvery=Qa,Dn.overSome=Za,Dn.partial=Ar,Dn.partialRight=Cr,Dn.partition=dr,Dn.pick=Ta,Dn.pickBy=Aa,Dn.property=Ja,Dn.propertyOf=function(e){return function(t){return null==e?void 0:sl(e,t)}},Dn.pull=Bo,Dn.pullAll=Uo,Dn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Rl(e,t,Yi(n,2)):e},Dn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Rl(e,t,void 0,n):e},Dn.pullAt=Wo,Dn.range=eu,Dn.rangeRight=tu,Dn.rearg=Nr,Dn.reject=function(e,t){return(xr(e)?rt:ll)(e,br(Yi(t,3)))},Dn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=Yi(t,3);++l<o;){var r=e[l];t(r,l,e)&&(n.push(r),i.push(l))}return Ll(e,i),n},Dn.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Ml(e,t=void 0===t?t:ta(t))},Dn.reverse=jo,Dn.sampleSize=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:ta(t),(xr(e)?Un:Bl)(e,t)},Dn.set=function(e,t,n){return null==e?e:Ul(e,t,n)},Dn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ul(e,t,n,l)},Dn.shuffle=function(e){return(xr(e)?Wn:Hl)(e)},Dn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&oo(e,t,n)?(t=0,n=l):(t=null==t?0:ta(t),n=void 0===n?l:ta(n)),zl(e,t,n)):[]},Dn.sortBy=vr,Dn.sortedUniq=function(e){return e&&e.length?ql(e):[]},Dn.sortedUniqBy=function(e,t){return e&&e.length?ql(e,Yi(t,2)):[]},Dn.split=function(e,t,n){return n&&"number"!=typeof n&&oo(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=oa(e))&&("string"==typeof t||null!=t&&!Gr(t))&&!(t=Xl(t))&&Mt(e)?ai(zt(e),0,n):e.split(t,n):[]},Dn.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:on(ta(t),0),Ml(function(n){var l=n[t],i=ai(n,0,t);return l&&st(i,l),tt(e,this,i)})},Dn.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},Dn.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:ta(t))<0?0:t):[]},Dn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:ta(t)))<0?0:t,l):[]},Dn.takeRightWhile=function(e,t){return e&&e.length?Jl(e,Yi(t,3),!1,!0):[]},Dn.takeWhile=function(e,t){return e&&e.length?Jl(e,Yi(t,3)):[]},Dn.tap=function(e,t){return t(e),e},Dn.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(n);return jr(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),hr(e,t,{leading:i,maxWait:t,trailing:o})},Dn.thru=er,Dn.toArray=Jr,Dn.toPairs=Ca,Dn.toPairsIn=Na,Dn.toPath=function(e){return xr(e)?ct(e,Ao):Xr(e)?[e]:fi(To(oa(e)))},Dn.toPlainObject=ia,Dn.transform=function(e,t,n){var l=xr(e),i=l||kr(e)||$r(e);if(t=Yi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:jr(e)&&Br(o)?In(He(e)):{}}return(i?lt:al)(e,function(e,l,i){return t(n,e,l,i)}),n},Dn.unary=function(e){return mr(e,1)},Dn.union=Ho,Dn.unionBy=zo,Dn.unionWith=Vo,Dn.uniq=function(e){return e&&e.length?$l(e):[]},Dn.uniqBy=function(e,t){return e&&e.length?$l(e,Yi(t,2)):[]},Dn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?$l(e,void 0,t):[]},Dn.unset=function(e,t){return null==e||Ql(e,t)},Dn.unzip=Ko,Dn.unzipWith=Go,Dn.update=function(e,t,n){return null==e?e:Zl(e,t,ii(n))},Dn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Zl(e,t,ii(n),l)},Dn.values=Da,Dn.valuesIn=function(e){return null==e?[]:It(e,ga(e))},Dn.without=qo,Dn.words=Ba,Dn.wrap=function(e,t){return Ar(ii(t),e)},Dn.xor=Yo,Dn.xorBy=Xo,Dn.xorWith=$o,Dn.zip=Qo,Dn.zipObject=function(e,t){return ni(e||[],t||[],Hn)},Dn.zipObjectDeep=function(e,t){return ni(e||[],t||[],Ul)},Dn.zipWith=Zo,Dn.entries=Ca,Dn.entriesIn=Na,Dn.extend=aa,Dn.extendWith=ua,Ya(Dn,Dn),Dn.add=ou,Dn.attempt=Ua,Dn.camelCase=Ia,Dn.capitalize=Oa,Dn.ceil=ru,Dn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=la(n))==n?n:0),void 0!==t&&(t=(t=la(t))==t?t:0),Yn(la(e),t,n)},Dn.clone=function(e){return Xn(e,4)},Dn.cloneDeep=function(e){return Xn(e,5)},Dn.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},Dn.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},Dn.conformsTo=function(e,t){return null==t||$n(e,t,ha(t))},Dn.deburr=wa,Dn.defaultTo=function(e,t){return null==e||e!=e?t:e},Dn.divide=au,Dn.endsWith=function(e,t,n){e=oa(e),t=Xl(t);var l=e.length,i=n=void 0===n?l:Yn(ta(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Dn.eq=Dr,Dn.escape=function(e){return(e=oa(e))&&M.test(e)?e.replace(P,Pt):e},Dn.escapeRegExp=function(e){return(e=oa(e))&&V.test(e)?e.replace(z,"\\$&"):e},Dn.every=function(e,t,n){var l=xr(e)?ot:tl;return n&&oo(e,t,n)&&(t=void 0),l(e,Yi(t,3))},Dn.find=lr,Dn.findIndex=wo,Dn.findKey=function(e,t){return ft(e,Yi(t,3),al)},Dn.findLast=ir,Dn.findLastIndex=xo,Dn.findLastKey=function(e,t){return ft(e,Yi(t,3),ul)},Dn.floor=uu,Dn.forEach=or,Dn.forEachRight=rr,Dn.forIn=function(e,t){return null==e?e:ol(e,Yi(t,3),ga)},Dn.forInRight=function(e,t){return null==e?e:rl(e,Yi(t,3),ga)},Dn.forOwn=function(e,t){return e&&al(e,Yi(t,3))},Dn.forOwnRight=function(e,t){return e&&ul(e,Yi(t,3))},Dn.get=pa,Dn.gt=Ir,Dn.gte=Or,Dn.has=function(e,t){return null!=e&&to(e,t,ml)},Dn.hasIn=ma,Dn.head=Lo,Dn.identity=Va,Dn.includes=function(e,t,n,l){e=Lr(e)?e:Da(e),n=n&&!l?ta(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),Yr(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&_t(e,t,n)>-1},Dn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ta(n);return i<0&&(i=on(l+i,0)),_t(e,t,i)},Dn.inRange=function(e,t,n){return t=ea(t),void 0===n?(n=t,t=0):n=ea(n),function(e,t,n){return e>=rn(t,n)&&e<on(t,n)}(e=la(e),t,n)},Dn.invoke=_a,Dn.isArguments=wr,Dn.isArray=xr,Dn.isArrayBuffer=Rr,Dn.isArrayLike=Lr,Dn.isArrayLikeObject=Pr,Dn.isBoolean=function(e){return!0===e||!1===e||Hr(e)&&vl(e)==a},Dn.isBuffer=kr,Dn.isDate=Mr,Dn.isElement=function(e){return Hr(e)&&1===e.nodeType&&!Kr(e)},Dn.isEmpty=function(e){if(null==e)return!0;if(Lr(e)&&(xr(e)||"string"==typeof e||"function"==typeof e.splice||kr(e)||$r(e)||wr(e)))return!e.length;var t=eo(e);if(t==v||t==E)return!e.size;if(co(e))return!Tl(e).length;for(var n in e)if(ye.call(e,n))return!1;return!0},Dn.isEqual=function(e,t){return gl(e,t)},Dn.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?gl(e,t,void 0,n):!!l},Dn.isError=Fr,Dn.isFinite=function(e){return"number"==typeof e&&tn(e)},Dn.isFunction=Br,Dn.isInteger=Ur,Dn.isLength=Wr,Dn.isMap=zr,Dn.isMatch=function(e,t){return e===t||Sl(e,t,$i(t))},Dn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,$i(t),n)},Dn.isNaN=function(e){return Vr(e)&&e!=+e},Dn.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return yl(e)},Dn.isNil=function(e){return null==e},Dn.isNull=function(e){return null===e},Dn.isNumber=Vr,Dn.isObject=jr,Dn.isObjectLike=Hr,Dn.isPlainObject=Kr,Dn.isRegExp=Gr,Dn.isSafeInteger=function(e){return Ur(e)&&e>=-9007199254740991&&e<=9007199254740991},Dn.isSet=qr,Dn.isString=Yr,Dn.isSymbol=Xr,Dn.isTypedArray=$r,Dn.isUndefined=function(e){return void 0===e},Dn.isWeakMap=function(e){return Hr(e)&&eo(e)==g},Dn.isWeakSet=function(e){return Hr(e)&&"[object WeakSet]"==vl(e)},Dn.join=function(e,t){return null==e?"":nn.call(e,t)},Dn.kebabCase=xa,Dn.last=Fo,Dn.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l;return void 0!==n&&(i=(i=ta(n))<0?on(l+i,0):rn(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):Et(e,gt,i,!0)},Dn.lowerCase=Ra,Dn.lowerFirst=La,Dn.lt=Qr,Dn.lte=Zr,Dn.max=function(e){return e&&e.length?nl(e,Va,pl):void 0},Dn.maxBy=function(e,t){return e&&e.length?nl(e,Yi(t,2),pl):void 0},Dn.mean=function(e){return St(e,Va)},Dn.meanBy=function(e,t){return St(e,Yi(t,2))},Dn.min=function(e){return e&&e.length?nl(e,Va,Al):void 0},Dn.minBy=function(e,t){return e&&e.length?nl(e,Yi(t,2),Al):void 0},Dn.stubArray=nu,Dn.stubFalse=lu,Dn.stubObject=function(){return{}},Dn.stubString=function(){return""},Dn.stubTrue=function(){return!0},Dn.multiply=cu,Dn.nth=function(e,t){return e&&e.length?Ol(e,ta(t)):void 0},Dn.noConflict=function(){return ze._===this&&(ze._=Ne),this},Dn.noop=Xa,Dn.now=pr,Dn.pad=function(e,t,n){e=oa(e);var l=(t=ta(t))?Ht(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return wi(Zt(i),n)+e+wi(Qt(i),n)},Dn.padEnd=function(e,t,n){e=oa(e);var l=(t=ta(t))?Ht(e):0;return t&&l<t?e+wi(t-l,n):e},Dn.padStart=function(e,t,n){e=oa(e);var l=(t=ta(t))?Ht(e):0;return t&&l<t?wi(t-l,n)+e:e},Dn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(oa(e).replace(K,""),t||0)},Dn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&oo(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=ea(e),void 0===t?(t=e,e=0):t=ea(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=cn();return rn(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Pl(e,t)},Dn.reduce=function(e,t,n){var l=xr(e)?dt:Tt,i=arguments.length<3;return l(e,Yi(t,4),n,i,Jn)},Dn.reduceRight=function(e,t,n){var l=xr(e)?vt:Tt,i=arguments.length<3;return l(e,Yi(t,4),n,i,el)},Dn.repeat=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:ta(t),kl(oa(e),t)},Dn.replace=function(){var e=arguments,t=oa(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dn.result=function(e,t,n){var l=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[Ao(t[l])];void 0===o&&(l=i,o=n),e=Br(o)?o.call(e):o}return e},Dn.round=su,Dn.runInContext=e,Dn.sample=function(e){return(xr(e)?Bn:Fl)(e)},Dn.size=function(e){if(null==e)return 0;if(Lr(e))return Yr(e)?Ht(e):e.length;var t=eo(e);return t==v||t==E?e.size:Tl(e).length},Dn.snakeCase=Pa,Dn.some=function(e,t,n){var l=xr(e)?pt:Vl;return n&&oo(e,t,n)&&(t=void 0),l(e,Yi(t,3))},Dn.sortedIndex=function(e,t){return Kl(e,t)},Dn.sortedIndexBy=function(e,t,n){return Gl(e,t,Yi(n,2))},Dn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Kl(e,t);if(l<n&&Dr(e[l],t))return l}return-1},Dn.sortedLastIndex=function(e,t){return Kl(e,t,!0)},Dn.sortedLastIndexBy=function(e,t,n){return Gl(e,t,Yi(n,2),!0)},Dn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Kl(e,t,!0)-1;if(Dr(e[n],t))return n}return-1},Dn.startCase=ka,Dn.startsWith=function(e,t,n){return e=oa(e),n=null==n?0:Yn(ta(n),0,e.length),t=Xl(t),e.slice(n,n+t.length)==t},Dn.subtract=du,Dn.sum=function(e){return e&&e.length?At(e,Va):0},Dn.sumBy=function(e,t){return e&&e.length?At(e,Yi(t,2)):0},Dn.template=function(e,t,n){var l=Dn.templateSettings;n&&oo(e,t,n)&&(t=void 0),e=oa(e),t=ua({},t,l,Bi);var i,o,r=ua({},t.imports,l.imports,Bi),a=ha(r),u=It(r,a),c=0,s=t.interpolate||ue,d="__p += '",v=me((t.escape||ue).source+"|"+s.source+"|"+(s===U?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),p="//# sourceURL="+(ye.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ke+"]")+"\n";e.replace(v,function(t,n,l,r,a,u){return l||(l=r),d+=e.slice(c,u).replace(ce,kt),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),a&&(o=!0,d+="';\n"+a+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),c=u+t.length,t}),d+="';\n";var m=ye.call(t,"variable")&&t.variable;if(m){if(Z.test(m))throw new se("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(w,""):d).replace(x,"$1").replace(R,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var f=Ua(function(){return de(a,p+"return "+d).apply(void 0,u)});if(f.source=d,Fr(f))throw f;return f},Dn.times=function(e,t){if((e=ta(e))<1||e>9007199254740991)return[];var n=4294967295,l=rn(e,4294967295);e-=4294967295;for(var i=Ct(l,t=Yi(t));++n<e;)t(n);return i},Dn.toFinite=ea,Dn.toInteger=ta,Dn.toLength=na,Dn.toLower=function(e){return oa(e).toLowerCase()},Dn.toNumber=la,Dn.toSafeInteger=function(e){return e?Yn(ta(e),-9007199254740991,9007199254740991):0===e?e:0},Dn.toString=oa,Dn.toUpper=function(e){return oa(e).toUpperCase()},Dn.trim=function(e,t,n){if((e=oa(e))&&(n||void 0===t))return Nt(e);if(!e||!(t=Xl(t)))return e;var l=zt(e),i=zt(t);return ai(l,wt(l,i),xt(l,i)+1).join("")},Dn.trimEnd=function(e,t,n){if((e=oa(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Xl(t)))return e;var l=zt(e);return ai(l,0,xt(l,zt(t))+1).join("")},Dn.trimStart=function(e,t,n){if((e=oa(e))&&(n||void 0===t))return e.replace(K,"");if(!e||!(t=Xl(t)))return e;var l=zt(e);return ai(l,wt(l,zt(t))).join("")},Dn.truncate=function(e,t){var n=30,l="...";if(jr(t)){var i="separator"in t?t.separator:i;n="length"in t?ta(t.length):n,l="omission"in t?Xl(t.omission):l}var o=(e=oa(e)).length;if(Mt(e)){var r=zt(e);o=r.length}if(n>=o)return e;var a=n-Ht(l);if(a<1)return l;var u=r?ai(r,0,a).join(""):e.slice(0,a);if(void 0===i)return u+l;if(r&&(a+=u.length-a),Gr(i)){if(e.slice(a).search(i)){var c,s=u;for(i.global||(i=me(i.source,oa(te.exec(i))+"g")),i.lastIndex=0;c=i.exec(s);)var d=c.index;u=u.slice(0,void 0===d?a:d)}}else if(e.indexOf(Xl(i),a)!=a){var v=u.lastIndexOf(i);v>-1&&(u=u.slice(0,v))}return u+l},Dn.unescape=function(e){return(e=oa(e))&&k.test(e)?e.replace(L,Kt):e},Dn.uniqueId=function(e){var t=++be;return oa(e)+t},Dn.upperCase=Ma,Dn.upperFirst=Fa,Dn.each=or,Dn.eachRight=rr,Dn.first=Lo,Ya(Dn,(iu={},al(Dn,function(e,t){ye.call(Dn.prototype,t)||(iu[t]=e)}),iu),{chain:!1}),Dn.VERSION="4.17.23",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Dn[e].placeholder=Dn}),lt(["drop","take"],function(e,t){xn.prototype[e]=function(n){n=void 0===n?1:on(ta(n),0);var l=this.__filtered__&&!t?new xn(this):this.clone();return l.__filtered__?l.__takeCount__=rn(n,l.__takeCount__):l.__views__.push({size:rn(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},xn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;xn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Yi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");xn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");xn.prototype[e]=function(){return this.__filtered__?new xn(this):this[n](1)}}),xn.prototype.compact=function(){return this.filter(Va)},xn.prototype.find=function(e){return this.filter(e).head()},xn.prototype.findLast=function(e){return this.reverse().find(e)},xn.prototype.invokeMap=Ml(function(e,t){return"function"==typeof e?new xn(this):this.map(function(n){return _l(n,e,t)})}),xn.prototype.reject=function(e){return this.filter(br(Yi(e)))},xn.prototype.slice=function(e,t){e=ta(e);var n=this;return n.__filtered__&&(e>0||t<0)?new xn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ta(t))<0?n.dropRight(-t):n.take(t-e)),n)},xn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},xn.prototype.toArray=function(){return this.take(4294967295)},al(xn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=Dn[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(Dn.prototype[t]=function(){var t=this.__wrapped__,r=l?[1]:arguments,a=t instanceof xn,u=r[0],c=a||xr(t),s=function(e){var t=i.apply(Dn,st([e],r));return l&&d?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(a=c=!1);var d=this.__chain__,v=!!this.__actions__.length,p=o&&!d,m=a&&!v;if(!o&&c){t=m?t:new xn(this);var f=e.apply(t,r);return f.__actions__.push({func:er,args:[s],thisArg:void 0}),new wn(f,d)}return p&&m?e.apply(this,r):(f=this.thru(s),p?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=_e[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Dn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(xr(i)?i:[],e)}return this[n](function(n){return t.apply(xr(n)?n:[],e)})}}),al(xn.prototype,function(e,t){var n=Dn[t];if(n){var l=n.name+"";ye.call(hn,l)||(hn[l]=[]),hn[l].push({name:t,func:n})}}),hn[Ni(void 0,2).name]=[{name:"wrapper",func:void 0}],xn.prototype.clone=function(){var e=new xn(this.__wrapped__);return e.__actions__=fi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=fi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=fi(this.__views__),e},xn.prototype.reverse=function(){if(this.__filtered__){var e=new xn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},xn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=xr(e),l=t<0,i=n?e.length:0,o=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var o=n[l],r=o.size;switch(o.type){case"drop":e+=r;break;case"dropRight":t-=r;break;case"take":t=rn(t,e+r);break;case"takeRight":e=on(e,t-r)}}return{start:e,end:t}}(0,i,this.__views__),r=o.start,a=o.end,u=a-r,c=l?a:r-1,s=this.__iteratees__,d=s.length,v=0,p=rn(u,this.__takeCount__);if(!n||!l&&i==u&&p==u)return ei(e,this.__actions__);var m=[];e:for(;u--&&v<p;){for(var f=-1,E=e[c+=t];++f<d;){var _=s[f],h=_.type,g=(0,_.iteratee)(E);if(2==h)E=g;else if(!g){if(1==h)continue e;break e}}m[v++]=E}return m},Dn.prototype.at=tr,Dn.prototype.chain=function(){return Jo(this)},Dn.prototype.commit=function(){return new wn(this.value(),this.__chain__)},Dn.prototype.next=function(){void 0===this.__values__&&(this.__values__=Jr(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Dn.prototype.plant=function(e){for(var t,n=this;n instanceof On;){var l=No(n);l.__index__=0,l.__values__=void 0,t?i.__wrapped__=l:t=l;var i=l;n=n.__wrapped__}return i.__wrapped__=e,t},Dn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof xn){var t=e;return this.__actions__.length&&(t=new xn(this)),(t=t.reverse()).__actions__.push({func:er,args:[jo],thisArg:void 0}),new wn(t,this.__chain__)}return this.thru(jo)},Dn.prototype.toJSON=Dn.prototype.valueOf=Dn.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Dn.prototype.first=Dn.prototype.head,mt&&(Dn.prototype[mt]=function(){return this}),Dn}();Ke?((Ke.exports=Gt)._=Gt,Ve._=Gt):ze._=Gt}).call(Y)});const je=e=>{var n,o,r;let{data:a,OpenImage:u}=e;const{t:c}=i.useTranslation();return l.createElement("div",null,a.date&&l.createElement("p",null,a.date),l.createElement("p",null,a.name),a.mobileNumber&&l.createElement(t.TelePhone,{mobile:a.mobileNumber}),a.source&&l.createElement("p",null,c("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+a.source.toUpperCase())),null!=a&&a.wfComment?l.createElement("div",null,null==a||null===(n=a.wfComment)||void 0===n?void 0:n.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,c("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==a||null===(o=a.thumbnailsToShow)||void 0===o||null===(r=o.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,c("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==a?void 0:a.thumbnailsToShow.thumbs,onClick:()=>{u(null==a?void 0:a.thumbnailsToShow)}})):null)},He=e=>{var r,a,u,c,s,d;let v=null==e||null===(r=e.application)||void 0===r?void 0:r.bookingNo.split("-")[0];const{t:p}=i.useTranslation(),m="WT"==v?"watertanker":"MT"===v?"mobileToilet":"TP"===v?"treePruning":"unknown",f="WT"===v?"request-service.water_tanker":"MT"===v?"request-service.mobile_toilet":"TP"===v?"request-service.tree_pruning":"request-service.unknown",{isLoading:E,data:_}=Digit.Hooks.useWorkflowDetails({tenantId:null===(a=e.application)||void 0===a?void 0:a.tenantId,id:null===(u=e.application)||void 0===u?void 0:u.bookingNo,moduleCode:m});function h(e){var t;window.open(null==e||null===(t=e.fullImage)||void 0===t?void 0:t[0],"_blank")}const g=t=>{if("OPEN"===t.state){var n,i;const o={date:null==t||null===(n=t.auditDetails)||void 0===n?void 0:n.lastModified,source:(null===(i=e.application)||void 0===i?void 0:i.channel)||""};return l.createElement(je,{data:o})}if(t.state){var o,r,a,u,c;const e={date:null==t||null===(o=t.auditDetails)||void 0===o?void 0:o.lastModified,name:null==t||null===(r=t.assignes)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.name,mobileNumber:null==t||null===(u=t.assignes)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.mobileNumber,comment:p(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return l.createElement(je,{data:e,OpenImage:h})}{var s,d;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(s=e.application)||void 0===s?void 0:s.auditDetails.lastModified),name:null==t||null===(d=t.assigner)||void 0===d?void 0:d.name,comment:p(null==t?void 0:t.comment)};return l.createElement(je,{data:n})}};return E?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,!E&&l.createElement(n.Fragment,null,(null==_||null===(c=_.timeline)||void 0===c?void 0:c.length)>0&&l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},p("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=_&&_.timeline&&1===(null==_||null===(s=_.timeline)||void 0===s?void 0:s.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:p((null==_||null===(d=_.timeline[0])||void 0===d?void 0:d.state)&&""+_.timeline[0].state||"NA"),customChild:g(null==_?void 0:_.timeline[0])}):l.createElement(t.ConnectingCheckPoints,null,(null==_?void 0:_.timeline)&&(null==_?void 0:_.timeline.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:p(""+(null==_||null===(i=_.processInstances[n].state)||void 0===i?void 0:i.state)),customChild:g(e)}))})))),_&&(n=>{var i,r;let a=n[0];switch(null==a?void 0:a.action){case"PAY":return"citizen"===(null==e?void 0:e.userType)?l.createElement("div",{style:{marginTop:"1em",bottom:"0px",width:"100%",marginBottom:"1.2em"}},l.createElement(o.Link,{to:{pathname:"/digit-ui/citizen/payment/my-bills/"+f+"/"+(null==e||null===(i=e.application)||void 0===i?void 0:i.bookingNo),state:{tenantId:e.application.tenantId,bookingNo:null==e||null===(r=e.application)||void 0===r?void 0:r.bookingNo}}},l.createElement(t.SubmitBar,{label:p("CS_APPLICATION_DETAILS_MAKE_PAYMENT")}))):null;default:return null}})(null==_?void 0:_.nextActions))},ze=["tenantId","payments"],Ve=e=>l.createElement("span",{className:"cell-text"},e),Ke=e=>l.createElement("span",{className:"sla-cell"},e),Ge=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],qe=e=>{var o;let{searchParams:a,onFilterChange:s,defaultSearchParams:d}=e,v=c(e,Ge);const{t:p}=i.useTranslation(),[m,f]=(r.useQueryClient(),n.useState(()=>u({},a,{services:[]}))),E=e=>{let t=e.delete,n=u({},m,e);t&&t.forEach(e=>delete n[e]),delete e.delete,f(u({},n))},_=()=>{f(u({},d,{services:[]})),s(u({},d))},h=Digit.ULBService.getCurrentTenantId();return l.createElement(l.Fragment,null,l.createElement("div",{className:"filter"},l.createElement("div",{className:"filter-card"},l.createElement("div",{className:"heading",style:{alignItems:"center"}},l.createElement("div",{className:"filter-label",style:{display:"flex",alignItems:"center"}},l.createElement("span",null,l.createElement("svg",{width:"17",height:"17",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.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"}))),l.createElement("span",{style:{marginLeft:"8px",fontWeight:"normal"}},p("ES_COMMON_FILTER_BY"),":")),l.createElement("div",{className:"clearAll",onClick:_},p("ES_COMMON_CLEAR_ALL")),"desktop"===v.type&&l.createElement("span",{className:"clear-search",onClick:_,style:{border:"1px solid #e0e0e0",padding:"6px"}},l.createElement("svg",{width:"17",height:"17",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.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"===v.type&&l.createElement("span",{onClick:v.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},p("ES_INBOX_LOCALITY"),":"),l.createElement(t.Localities,{selectLocality:e=>{E({locality:[...(null==m?void 0:m.locality)||[],e]})},tenantId:h,boundaryType:"revenue"}),l.createElement("div",{className:"tag-container"},null==m||null===(o=m.locality)||void 0===o?void 0:o.map((e,n)=>l.createElement(t.RemoveableTag,{key:n,text:p(e.i18nkey),onClick:()=>{E({locality:null==m?void 0:m.locality.filter(t=>t.code!==e.code)})}})))),l.createElement("div",null,l.createElement(t.SubmitBar,{onSubmit:()=>{s(0===m.services.length?u({},m,{services:d.services}):m)},label:p("ES_COMMON_APPLY")}))))))};function Ye(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const Xe=e=>l.createElement("h1",{className:"heading-m"},e.label),$e=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),Qe=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement($e,null)),Ze=e=>{var i,o;let{t:r,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:v,businessService:p,moduleCode:m}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:_,data:h}=Digit.Hooks.pt.useMDMS(c,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[g,S]=n.useState({}),[y,b]=n.useState({}),[T,A]=n.useState([]),[C,N]=n.useState(null),[D,I]=n.useState(null),[O,w]=n.useState(null),[x,R]=n.useState(null),[L,P]=n.useState([]),[k,M]=n.useState(null),[F,B]=n.useState(!1);function U(e){I(e.target.files[0])}return n.useEffect(()=>{var e;h&&h["egf-master"]&&P(null===(e=h["egf-master"])||void 0===e?void 0:e.FinancialYear)},[h]),n.useEffect(()=>{var e;A(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]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)R(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ye(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",D,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?w(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):R(r("CS_FILE_UPLOAD_ERROR"))})},function(){R(r("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]),n.useEffect(()=>{a&&S(null!=a&&a.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:r,setSelectedFinancialYear:a}=e;return{label:{heading:"WF_"+i.action+"_APPLICATION",submit:"WF_PT.CREATE_"+i.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:a,selectedOption:r})}]}]}})({t:r,action:a,financialYears:L,selectedFinancialYear:k,setSelectedFinancialYear:M}):(e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,assigneeLabel:v,businessService:p}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+p+"_"+(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===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{d(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:T,selectedApprover:C,setSelectedApprover:N,selectFile:U,uploadedFile:O,setUploadedFile:w,businessService:p}))},[a,T,L,k,O]),a&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Xe,{label:r(g.label.heading)}),headerBarEnd:l.createElement(Qe,{onClick:s}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(g.label.submit),actionSaveOnSubmit:()=>{},isDisabled:a.showFinancialYearsModal?!k:E||(null==a?void 0:a.docUploadRequired)&&!O,formId:"modal-action"},_?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==a?void 0:a.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};v.creationReason="STATUS",d({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Property:u({},v,{workflow:t})})}else if(null!=a&&a.showFinancialYearsModal)d({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Assessment:{financialYear:null==k?void 0:k.name,propertyId:null==v?void 0:v.propertyId,tenantId:c,source:null==v?void 0:v.source,channel:null==v?void 0:v.channel,assessmentDate:Date.now()}});else{let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:m};t.assignes=null!=a&&a.isTerminateState||!C?[]:[C],O&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:O}]),d({Property:u({},v,{workflow:t})})}},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},Je=e=>l.createElement("h1",{className:"heading-m"},e.label),et=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),tt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(et,null)),nt=e=>{var i,o;let{t:r,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:v,businessService:p}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:f,data:E}=Digit.Hooks.pt.useMDMS(c,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[_,h]=n.useState({}),[g,S]=n.useState({}),[y,b]=n.useState([]),[T,A]=n.useState({}),[C,N]=n.useState(null),[D,I]=n.useState(null),[O,w]=n.useState(null),[x,R]=n.useState([]),[L,P]=n.useState(null);function k(e){N(e.target.files[0])}return n.useEffect(()=>{var e;E&&E["egf-master"]&&R(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]),n.useEffect(()=>{var e;b(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]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ye(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(r("CS_FILE_UPLOAD_ERROR"))})},function(){w(r("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]),n.useEffect(()=>{a&&h((e=>{let{t:n,action:i,approvers:o,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:c,setUploadedFile:s,businessService:d}=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==d?void 0:d.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:a,selected:r}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:c?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:y,selectedApprover:T,setSelectedApprover:A,selectFile:k,uploadedFile:D,setUploadedFile:I,businessService:p}))},[a,y,x,L,D]),a&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Je,{label:r(_.label.heading)}),headerBarEnd:l.createElement(tt,{onClick:s}),actionCancelLabel:r(_.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=u({},v,{action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,wfDocuments:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null}),d({Licenses:[v]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},lt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),it=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),ot=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(it,null)),rt=e=>{var i,o;let{t:r,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:v,businessService:p}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,y]=n.useState([]),[b,T]=n.useState({}),[A,C]=n.useState(null),[N,D]=n.useState(null),[I,O]=n.useState(null),w=!!Digit.Utils.browser.isMobile();function x(e){C(e.target.files[0])}return n.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]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)O(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))O(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ye(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",A,Digit.ULBService.getStateId()||(null==c?void 0:c.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(r("CS_FILE_UPLOAD_ERROR"))})},function(){O(r("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]),n.useEffect(()=>{a&&_((e=>{let{t:n,action:i,approvers:o,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:c,setUploadedFile:s,businessService:d,error:v}=e,p=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(p=!1),i.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:p?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:a,selected:r}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:c?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:r,action:a,approvers:S,selectedApprover:b,setSelectedApprover:T,selectFile:x,uploadedFile:N,setUploadedFile:D,businessService:p,error:I}))},[a,S,N,I]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(lt,{label:r(E.label.heading)}),headerBarEnd:l.createElement(ot,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:w?{width:"720px"}:{},style:w?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:w?{paddingLeft:"5px"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=u({},v,{action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:null}),d({Licenses:[v]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},at=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ut=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),ct=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ut,null)),st=e=>{var i,o,a,c,s,d,v,p,m,f,E,_;let{t:h,action:g,tenantId:S,closeModal:y,submitAction:b,applicationDetails:T,applicationData:A,businessService:C,workflowDetails:N}=e;Digit.Hooks.obps.useObpsAPI(null!==(i=A)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(a=o.address)&&void 0!==a&&a.city?null===(c=A)||void 0===c||null===(s=c.landInfo)||void 0===s||null===(d=s.address)||void 0===d?void 0:d.city:S,!1);const{data:D,isLoading:I}=Digit.Hooks.useEmployeeSearch(S,{roles:null==N||null===(v=N.data)||void 0===v||null===(p=v.initialActionState)||void 0===p||null===(m=p.nextActions)||void 0===m||null===(f=m.filter(e=>(null==e?void 0:e.action)==(null==g?void 0:g.action)))||void 0===f||null===(E=f[0])||void 0===E||null===(_=E.assigneeRoles)||void 0===_?void 0:_.map(e=>({code:e})),isActive:!0},{enabled:!(null!=g&&g.isTerminateState)}),[O,w]=(r.useQueryClient(),n.useState({})),[x,R]=n.useState({}),[L,P]=n.useState([]),[k,M]=n.useState({}),[F,B]=n.useState(null),[U,W]=n.useState(null),[j,H]=n.useState(null),[z,V]=n.useState(null),K=!!Digit.Utils.browser.isMobile();function G(e){B(e.target.files[0])}n.useEffect(()=>{var e;P(null==D||null===(e=D.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}}))},[D]),n.useEffect(()=>{!function(){try{H(null);const e=function(){if(F){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(F.size>=5242880)H(h("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=F&&F.type&&!e.test(null==F?void 0:F.type))H(h("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ye(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",F,Digit.ULBService.getStateId()||(null==S?void 0:S.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?W(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):H(h("CS_FILE_UPLOAD_ERROR"))})},function(){H(h("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 q=e=>{let t=[];return e&&e.map((e,n)=>{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},Y=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},X=e=>{var t,n;let l=[],i=[];var o,r;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(r=l)||void 0===r?void 0:r.length)>0&&l.map((e,t)=>{i.push({docs:q(e.Documents),date:e.InspectionDate,questions:Y(e),time:null==e?void 0:e.InspectionTime})}),i=i.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},$=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,i,o,r,a;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(l=t[0])||void 0===l||null===(i=l.values)||void 0===i?void 0:i.length)>0&&(n=[...n,...null==e||null===(o=e.uploadedDocuments)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.values]),(null==e||null===(a=e.newUploadedDocs)||void 0===a?void 0:a.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},Q=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),n=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let l=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return l=null===(e=l)||void 0===e?void 0:e.concat(null!==n?n.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),l};return n.useEffect(()=>{g&&w((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,assigneeLabel:v,businessService:p,error:m}=e,f=!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)||(f=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+p+"_"+(null==o?void 0:o.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:o.isTerminateState||f?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||f?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{d(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:h,action:g,approvers:L,selectedApprover:k,setSelectedApprover:M,selectFile:G,uploadedFile:U,setUploadedFile:W,businessService:C,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:j}))},[g,L,z,U,j]),g&&O.form?l.createElement(t.Modal,{headerBarMain:l.createElement(at,{label:h(O.label.heading)}),headerBarEnd:l.createElement(ct,{onClick:y}),actionCancelLabel:h(O.label.cancel),actionCancelOnSubmit:y,actionSaveLabel:h(O.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"}:{}},I?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:O.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,i,o,r;A=u({},A,{documents:$(),additionalDetails:u({},null===(t=A)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:X(A),pendingapproval:Q()}),workflow:{action:null==g?void 0:g.action,comment:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(l=e.comments)||void 0===l?void 0:l.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:U?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null},action:null==g?void 0:g.action,comment:null==e?void 0:e.comments,assignee:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,wfDocuments:U?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null});const a=null==T||null===(i=T.nocData)||void 0===i?void 0:i.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:u({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}});let c={sourceRefId:null==a||null===(o=a[0])||void 0===o||null===(r=o.Noc)||void 0===r?void 0:r.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(S,c)).then(function(e){var t;let n=!0,l=!0;null==e||null===(t=e.Noc)||void 0===t||t.map(e=>{var t,i,o,r,a;"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===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"VOIDED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())||1!=n&&1!=l||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(l=!1))});let i=[];a&&a.map(e=>{var t,o,r,a,u,c,s,d,v,p,m,f;("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===(r=e.Noc)||void 0===r||null===(a=r.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(c=u.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(d=s.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"VOIDED"!=(null==e||null===(v=e.Noc)||void 0===v||null===(p=v.applicationStatus)||void 0===p?void 0:p.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&n||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&l)&&i.push(e)}),b({BPA:A},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:x,formId:"modal-action"})):l.createElement(t.Loader,null)},dt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),vt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),pt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(vt,null)),mt=e=>{var i,a;let{t:c,action:s,tenantId:d,closeModal:v,submitAction:p,applicationData:m,businessService:f}=e;const{data:E,isLoading:_}=Digit.Hooks.useEmployeeSearch(d,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(a=i.map)||void 0===a?void 0:a.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[h,g]=(r.useQueryClient(),n.useState({})),[S,y]=n.useState({}),[b,T]=n.useState([]),[A,C]=n.useState({}),[N,D]=n.useState(null),[I,O]=n.useState(null),[w,x]=n.useState(null),R=!!Digit.Utils.browser.isMobile();function L(e){D(e.target.files[0])}return o.useHistory(),n.useEffect(()=>{var e;T(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]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(N){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(N.size>=5242880)x(c("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=N&&N.type&&!e.test(null==N?void 0:N.type))x(c("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ye(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",N,Digit.ULBService.getStateId()||(null==d?void 0:d.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(c("CS_FILE_UPLOAD_ERROR"))})},function(){x(c("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)}}()},[N]),n.useEffect(()=>{s&&g((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,assigneeLabel:v,businessService:p,error:m}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let E=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+p+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||E?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||E?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{d(null)},showHint:!0,message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:c,action:s,approvers:b,selectedApprover:A,setSelectedApprover:C,selectFile:L,uploadedFile:I,setUploadedFile:O,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:w}))},[s,b,I,w]),s&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(dt,{label:c(h.label.heading)}),headerBarEnd:l.createElement(pt,{onClick:v}),actionCancelLabel:c(h.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:c(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:R?{width:"720px"}:{},style:R?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:R?{paddingLeft:"5px"}:{}},_?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=m)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=m)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),m=u({},m,{workflow:{action:null==s?void 0:s.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=A&&A.uuid?[null==A?void 0:A.uuid]:null,documents:I?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:I}]:null},documents:o}),p({Noc:m},!1,{isNoc:!0})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)};var ft=function(e,t){return e===t||e!=e&&t!=t},Et=function(e,t){for(var n=e.length;n--;)if(ft(e[n][0],t))return n;return-1},_t=Array.prototype.splice;function ht(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}ht.prototype.clear=function(){this.__data__=[],this.size=0},ht.prototype.delete=function(e){var t=this.__data__,n=Et(t,e);return!(n<0||(n==t.length-1?t.pop():_t.call(t,n,1),--this.size,0))},ht.prototype.get=function(e){var t=this.__data__,n=Et(t,e);return n<0?void 0:t[n][1]},ht.prototype.has=function(e){return Et(this.__data__,e)>-1},ht.prototype.set=function(e,t){var n=this.__data__,l=Et(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var gt=ht,St="object"==typeof Y&&Y&&Y.Object===Object&&Y,yt="object"==typeof self&&self&&self.Object===Object&&self,bt=St||yt||Function("return this")(),Tt=bt.Symbol,At=Object.prototype,Ct=At.hasOwnProperty,Nt=At.toString,Dt=Tt?Tt.toStringTag:void 0,It=Object.prototype.toString,Ot=Tt?Tt.toStringTag:void 0,wt=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ot&&Ot in Object(e)?function(e){var t=Ct.call(e,Dt),n=e[Dt];try{e[Dt]=void 0;var l=!0}catch(e){}var i=Nt.call(e);return l&&(t?e[Dt]=n:delete e[Dt]),i}(e):function(e){return It.call(e)}(e)},xt=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Rt=function(e){if(!xt(e))return!1;var t=wt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Lt=bt["__core-js_shared__"],Pt=function(){var e=/[^.]+$/.exec(Lt&&Lt.keys&&Lt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),kt=Function.prototype.toString,Mt=function(e){if(null!=e){try{return kt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ft=/^\[object .+?Constructor\]$/,Bt=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ut=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!xt(e)||(t=e,Pt&&Pt in t))&&(Rt(e)?Bt:Ft).test(Mt(e));var t}(n)?n:void 0},Wt=Ut(bt,"Map"),jt=Ut(Object,"create"),Ht=Object.prototype.hasOwnProperty,zt=Object.prototype.hasOwnProperty;function Vt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}Vt.prototype.clear=function(){this.__data__=jt?jt(null):{},this.size=0},Vt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Vt.prototype.get=function(e){var t=this.__data__;if(jt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Ht.call(t,e)?t[e]:void 0},Vt.prototype.has=function(e){var t=this.__data__;return jt?void 0!==t[e]:zt.call(t,e)},Vt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=jt&&void 0===t?"__lodash_hash_undefined__":t,this};var Kt=Vt,Gt=function(e,t){var n,l,i=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function qt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}qt.prototype.clear=function(){this.size=0,this.__data__={hash:new Kt,map:new(Wt||gt),string:new Kt}},qt.prototype.delete=function(e){var t=Gt(this,e).delete(e);return this.size-=t?1:0,t},qt.prototype.get=function(e){return Gt(this,e).get(e)},qt.prototype.has=function(e){return Gt(this,e).has(e)},qt.prototype.set=function(e,t){var n=Gt(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Yt=qt;function Xt(e){var t=this.__data__=new gt(e);this.size=t.size}Xt.prototype.clear=function(){this.__data__=new gt,this.size=0},Xt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Xt.prototype.get=function(e){return this.__data__.get(e)},Xt.prototype.has=function(e){return this.__data__.has(e)},Xt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof gt){var l=n.__data__;if(!Wt||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Yt(l)}return n.set(e,t),this.size=n.size,this};var $t=Xt,Qt=function(){try{var e=Ut(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Zt=function(e,t,n){"__proto__"==t&&Qt?Qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Jt=Object.prototype.hasOwnProperty,en=function(e,t,n){var l=e[t];Jt.call(e,t)&&ft(l,n)&&(void 0!==n||t in e)||Zt(e,t,n)},tn=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,r=t.length;++o<r;){var a=t[o],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),i?Zt(n,a,u):en(n,a,u)}return n},nn=function(e){return null!=e&&"object"==typeof e},ln=function(e){return nn(e)&&"[object Arguments]"==wt(e)},on=Object.prototype,rn=on.hasOwnProperty,an=on.propertyIsEnumerable,un=ln(function(){return arguments}())?ln:function(e){return nn(e)&&rn.call(e,"callee")&&!an.call(e,"callee")},cn=Array.isArray,sn=function(){return!1},dn=X(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?bt.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||sn}),vn=/^(?:0|[1-9]\d*)$/,pn=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&vn.test(e))&&e>-1&&e%1==0&&e<t},mn=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},fn={};fn["[object Float32Array]"]=fn["[object Float64Array]"]=fn["[object Int8Array]"]=fn["[object Int16Array]"]=fn["[object Int32Array]"]=fn["[object Uint8Array]"]=fn["[object Uint8ClampedArray]"]=fn["[object Uint16Array]"]=fn["[object Uint32Array]"]=!0,fn["[object Arguments]"]=fn["[object Array]"]=fn["[object ArrayBuffer]"]=fn["[object Boolean]"]=fn["[object DataView]"]=fn["[object Date]"]=fn["[object Error]"]=fn["[object Function]"]=fn["[object Map]"]=fn["[object Number]"]=fn["[object Object]"]=fn["[object RegExp]"]=fn["[object Set]"]=fn["[object String]"]=fn["[object WeakMap]"]=!1;var En=function(e){return function(t){return e(t)}},_n=X(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&St.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),hn=_n&&_n.isTypedArray,gn=hn?En(hn):function(e){return nn(e)&&mn(e.length)&&!!fn[wt(e)]},Sn=Object.prototype.hasOwnProperty,yn=function(e,t){var n=cn(e),l=!n&&un(e),i=!n&&!l&&dn(e),o=!n&&!l&&!i&&gn(e),r=n||l||i||o,a=r?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=a.length;for(var c in e)!t&&!Sn.call(e,c)||r&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||pn(c,u))||a.push(c);return a},bn=Object.prototype,Tn=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||bn)},An=function(e,t){return function(n){return e(t(n))}},Cn=An(Object.keys,Object),Nn=Object.prototype.hasOwnProperty,Dn=function(e){return null!=e&&mn(e.length)&&!Rt(e)},In=function(e){return Dn(e)?yn(e):function(e){if(!Tn(e))return Cn(e);var t=[];for(var n in Object(e))Nn.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},On=Object.prototype.hasOwnProperty,wn=function(e){return Dn(e)?yn(e,!0):function(e){if(!xt(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Tn(e),n=[];for(var l in e)("constructor"!=l||!t&&On.call(e,l))&&n.push(l);return n}(e)},xn=X(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?bt.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=o?o(n):new e.constructor(n);return e.copy(l),l}}),Rn=function(){return[]},Ln=Object.prototype.propertyIsEnumerable,Pn=Object.getOwnPropertySymbols,kn=Pn?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,r=[];++l<i;){var a=t[l];Ln.call(e,a)&&(r[o++]=a)}return r}(Pn(e)))}:Rn,Mn=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},Fn=An(Object.getPrototypeOf,Object),Bn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Mn(t,kn(e)),e=Fn(e);return t}:Rn,Un=function(e,t,n){var l=t(e);return cn(e)?l:Mn(l,n(e))},Wn=function(e){return Un(e,In,kn)},jn=function(e){return Un(e,wn,Bn)},Hn=Ut(bt,"DataView"),zn=Ut(bt,"Promise"),Vn=Ut(bt,"Set"),Kn=Ut(bt,"WeakMap"),Gn=Mt(Hn),qn=Mt(Wt),Yn=Mt(zn),Xn=Mt(Vn),$n=Mt(Kn),Qn=wt;(Hn&&"[object DataView]"!=Qn(new Hn(new ArrayBuffer(1)))||Wt&&"[object Map]"!=Qn(new Wt)||zn&&"[object Promise]"!=Qn(zn.resolve())||Vn&&"[object Set]"!=Qn(new Vn)||Kn&&"[object WeakMap]"!=Qn(new Kn))&&(Qn=function(e){var t=wt(e),n="[object Object]"==t?e.constructor:void 0,l=n?Mt(n):"";if(l)switch(l){case Gn:return"[object DataView]";case qn:return"[object Map]";case Yn:return"[object Promise]";case Xn:return"[object Set]";case $n:return"[object WeakMap]"}return t});var Zn=Qn,Jn=Object.prototype.hasOwnProperty,el=bt.Uint8Array,tl=function(e){var t=new e.constructor(e.byteLength);return new el(t).set(new el(e)),t},nl=/\w*$/,ll=Tt?Tt.prototype:void 0,il=ll?ll.valueOf:void 0,ol=Object.create,rl=function(){function e(){}return function(t){if(!xt(t))return{};if(ol)return ol(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),al=_n&&_n.isMap,ul=al?En(al):function(e){return nn(e)&&"[object Map]"==Zn(e)},cl=_n&&_n.isSet,sl=cl?En(cl):function(e){return nn(e)&&"[object Set]"==Zn(e)},dl={};dl["[object Arguments]"]=dl["[object Array]"]=dl["[object ArrayBuffer]"]=dl["[object DataView]"]=dl["[object Boolean]"]=dl["[object Date]"]=dl["[object Float32Array]"]=dl["[object Float64Array]"]=dl["[object Int8Array]"]=dl["[object Int16Array]"]=dl["[object Int32Array]"]=dl["[object Map]"]=dl["[object Number]"]=dl["[object Object]"]=dl["[object RegExp]"]=dl["[object Set]"]=dl["[object String]"]=dl["[object Symbol]"]=dl["[object Uint8Array]"]=dl["[object Uint8ClampedArray]"]=dl["[object Uint16Array]"]=dl["[object Uint32Array]"]=!0,dl["[object Error]"]=dl["[object Function]"]=dl["[object WeakMap]"]=!1;var vl=function e(t,n,l,i,o,r){var a,u=1&n,c=2&n,s=4&n;if(l&&(a=o?l(t,i,o,r):l(t)),void 0!==a)return a;if(!xt(t))return t;var d=cn(t);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Jn.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!u)return function(e,t){var n=-1,l=e.length;for(t||(t=Array(l));++n<l;)t[n]=e[n];return t}(t,a)}else{var v=Zn(t),p="[object Function]"==v||"[object GeneratorFunction]"==v;if(dn(t))return xn(t,u);if("[object Object]"==v||"[object Arguments]"==v||p&&!o){if(a=c||p?{}:function(e){return"function"!=typeof e.constructor||Tn(e)?{}:rl(Fn(e))}(t),!u)return c?function(e,t){return tn(e,Bn(e),t)}(t,function(e,t){return e&&tn(t,wn(t),e)}(a,t)):function(e,t){return tn(e,kn(e),t)}(t,function(e,t){return e&&tn(t,In(t),e)}(a,t))}else{if(!dl[v])return o?t:{};a=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return tl(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?tl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);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 n=t?tl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,nl.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return il?Object(il.call(e)):{}}}(t,v,u)}}r||(r=new $t);var m=r.get(t);if(m)return m;r.set(t,a),sl(t)?t.forEach(function(i){a.add(e(i,n,l,i,t,r))}):ul(t)&&t.forEach(function(i,o){a.set(o,e(i,n,l,o,t,r))});var f=d?void 0:(s?c?jn:Wn:c?wn:In)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(i,o){f&&(i=t[o=i]),en(a,o,e(i,n,l,o,t,r))}),a},pl=function(e){return vl(e,5)};const ml=e=>l.createElement("h1",{className:"heading-m"},e.label),fl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(fl,null)),_l=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},hl=e=>{var i,o;let{t:r,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:v,businessService:p}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,y]=n.useState([]),[b,T]=n.useState({}),[A,C]=n.useState(null),[N,D]=n.useState(null),[I,O]=n.useState(null),w=window.Digit.Utils.browser.isMobile(),x=window.location.href.includes("/employee");function R(e){C(e.target.files[0])}return n.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]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)O(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))O(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ye(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",A,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(r("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),O(r("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]),n.useEffect(()=>{var e,n,i,o;"DisconnectWSConnection"==(null===(e=v)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(i=v)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?a&&_((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:c,selectFile:s,uploadedFile:d,setUploadedFile:v,businessService:p,error:m}=e,f=!0,E=!1;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(f=!1),o.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==p?void 0:p.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:f?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:c,selected:a}):null},E&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!E,type:"custom",populators:E?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,u({onChange:e.onChange,date:e.value},n))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{v(null)},message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:S,selectedApprover:b,setSelectedApprover:T,selectFile:R,uploadedFile:N,setUploadedFile:D,businessService:p,error:I})):a&&_((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,businessService:v,error:p}=e,m=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(m=!1),o.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:m?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:c,onDelete:()=>{d(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:S,selectedApprover:b,setSelectedApprover:T,selectFile:R,uploadedFile:N,setUploadedFile:D,businessService:p,error:I}))},[a,S,N,I]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ml,{label:r(E.label.heading)}),headerBarEnd:l.createElement(El,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:w&&x?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,r,s,p,m,f;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var E,_,h,g,S,y,T,C,D;const t=u({},null===(E=v)||void 0===E||null===(_=E.billAmendmentDetails)||void 0===_?void 0:_.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=u({},null===(h=v)||void 0===h?void 0:h.billAmendmentDetails,{workflow:{businessId:null===(g=v)||void 0===g||null===(S=g.billAmendmentDetails)||void 0===S?void 0:S.amendmentId,action:null==a?void 0:a.action,tenantId:c,businessService:null!==(y=v)&&void 0!==y&&null!==(T=y.applicationType)&&void 0!==T&&T.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(C=v)&&void 0!==C&&null!==(D=C.applicationType)&&void 0!==D&&D.includes("WATER")?"WS":"SW",assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:null,processInstance:{action:null==a?void 0:a.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:[]}});d({AmendmentUpdate:n})}else{if(v=u({},v,{action:null==a?void 0:a.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:[],assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],wfDocuments:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:null,processInstance:u({},null===(n=v)||void 0===n?void 0:n.processInstance,{action:null==a?void 0:a.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:[]})}),null!=e&&e.date&&null!==(l=v)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=pl(null==e?void 0:e.date);v.disconnectionExecutionDate=_l(t)}else if(null!=e&&e.date){const t=pl(null==e?void 0:e.date);v.connectionExecutionDate=_l(t)}var I;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(r=o.processInstance)||void 0===r?void 0:r.businessService)||"DisconnectSWConnection"==(null===(s=v)||void 0===s||null===(p=s.processInstance)||void 0===p?void 0:p.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(I=v)||void 0===I?void 0:I.serviceType)?d({WaterConnection:v,disconnectRequest:!0}):d({SewerageConnection:v,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(m=v)||void 0===m?void 0:m.applicationType))d({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=v)||void 0===f?void 0:f.applicationType))d({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var O,w,x,R,L,P,k,M,F,B,U,W,j;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenalty&&(v.additionalDetails.adhocPenalty=parseInt(null==t||null===(w=t.value)||void 0===w?void 0:w.adhocPenalty)||""),null!=t&&null!==(x=t.value)&&void 0!==x&&x.adhocPenaltyComment&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyComment)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(P=t.value)||void 0===P?void 0:P.adhocPenaltyReason)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.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!==(U=t.value)&&void 0!==U&&U.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(W=t.value)||void 0===W?void 0:W.adhocRebateReason)||""),"WATER"==(null===(j=v)||void 0===j?void 0:j.serviceType)?d({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!1}):d({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},gl=e=>l.createElement("h1",{className:"heading-m"},e.label),Sl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),yl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Sl,null)),bl=e=>{var i,o;let{t:r,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:v,businessService:p,moduleCode:m}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,y]=n.useState([]),[b,T]=n.useState(null),[A,C]=n.useState(null),[N,D]=n.useState(null),[I,O]=n.useState(null),[w,x]=n.useState(!1);function R(e){C(e.target.files[0])}return n.useEffect(()=>{var e;y(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]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)O(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ye(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",A,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(r("CS_FILE_UPLOAD_ERROR"))})},function(){O(r("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)}}()},[A]),n.useEffect(()=>{a&&_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:r,setUploadedFile:a,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:n("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_PTR_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{a(null)},showHint:!0,hintText:n("PTR_ATTACH_RESTRICTIONS_SIZE"),message:r?"1 "+n("ES_PTR_ACTION_FILEUPLOADED"):n("ES_PTR_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:S,selectedApprover:b,setSelectedApprover:T,selectFile:R,uploadedFile:N,setUploadedFile:D,businessService:p}))},[a,S,N]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(gl,{label:r(E.label.heading)}),headerBarEnd:l.createElement(yl,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m};N&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,filestoreId:N}]),d({PetRegistrationApplications:[u({},v,{workflow:t})]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Tl=e=>l.createElement("h1",{className:"heading-m"},e.label),Al=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Al,null)),Nl=e=>{var i,r,a;let{t:c,action:s,tenantId:d,closeModal:v,submitAction:p,applicationData:m,businessService:f,moduleCode:E}=e;const{data:_}=Digit.Hooks.useEmployeeSearch(d,{roles:null==s||null===(i=s.roles)||void 0===i||null===(r=i[0])||void 0===r||null===(a=r.map)||void 0===a?void 0:a.call(r,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),h=o.useHistory(),[g,S]=n.useState({}),[y,b]=n.useState({}),[T,A]=n.useState([]),[C,N]=n.useState(null),[D,I]=n.useState(null);return n.useEffect(()=>{var e;A(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}}))},[_]),n.useEffect(()=>{"INITIATED"===(null==s?void 0:s.state)?h.push("/digit-ui/employee/asset/assetservice/edit/"+(null==m?void 0:m.applicationNo)):S((e=>{let{t:t,action:n,businessService:l}=e;return console.log("njhsegfdhjsbedwfdwe",n),{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:c,action:s,approvers:T,selectedApprover:C,setSelectedApprover:N,uploadedFile:D,setUploadedFile:I,businessService:f}))},[s,T,D]),s&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Tl,{label:c(g.label.heading)}),headerBarEnd:l.createElement(Cl,{onClick:v}),actionCancelLabel:c(g.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:c(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,businessService:f,moduleName:E};D&&(t.documents=[]),p({Asset:u({},m,{workflow:t})})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},Dl=e=>l.createElement("h1",{className:"heading-m"},e.label),Il=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),Ol=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Il,null)),wl=e=>{var i,o;let{t:r,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:v,businessService:p,moduleCode:m}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,y]=n.useState([]),[b,T]=n.useState(null),[A,C]=n.useState(null),[N,D]=n.useState(null),[I,O]=n.useState(null),[w,x]=n.useState(!1);function R(e){C(e.target.files[0])}return n.useEffect(()=>{var e;y(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]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)O(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ye(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",A,c)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(r("CS_FILE_UPLOAD_ERROR"))})},function(){O(r("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)}}()},[A]),n.useEffect(()=>{a&&_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:r,setUploadedFile:a}=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:n("ES_CHB_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("ES_CHB_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{a(null)},message:r?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:S,selectedApprover:b,setSelectedApprover:T,selectFile:R,uploadedFile:N,setUploadedFile:D,businessService:p}))},[a,S,N]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Dl,{label:r(E.label.heading)}),headerBarEnd:l.createElement(Ol,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:m};N&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]),d({hallsBookingApplication:u({},v,{workflow:t})})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},xl=e=>l.createElement("h1",{className:"heading-m"},e.label),Rl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Rl,null)),Pl=e=>{var i,o;let{t:r,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:v,businessService:p,moduleCode:m}=e;console.log("snjdskbjdfbjskfjkbs",a);const{data:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,y]=n.useState([]),[b,T]=n.useState(null),[A,C]=n.useState(null),[N,D]=n.useState(null),[I,O]=n.useState(null),[w,x]=n.useState(null),[R,L]=n.useState(!1);function P(e){D(e.target.files[0])}return n.useEffect(()=>{var e;y(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]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)x(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ye(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",N,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(r("CS_FILE_UPLOAD_ERROR"))})},function(){x(r("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)}}()},[N]),n.useEffect(()=>{a&&_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:r,setUploadedFile:a,businessService:u}=e;console.log("action",i);const c=(new Date).toISOString().split("T")[0];return console.log("todayedsta ::",c),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:["COMPLETIONPENDING"===(null==i?void 0:i.state)?{label:n("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:n("ES_EW_ACTION_TRANSACTION_ID"),type:"text",isMandatory:!0,populators:{name:"transactionId"}}:"null","REQUESTCOMPLETED"===(null==i?void 0:i.state)?{label:n("ES_EW_ACTION_FINALAMOUNT"),type:"text",isMandatory:!0,populators:{name:"finalAmount"}}:"null",{label:n("ES_EW_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_EW_PHOTO")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{a(null)},showHint:!0,hintText:n("EW_ATTACH_RESTRICTIONS_SIZE"),message:r?"1 "+n("ES_EW_ACTION_FILEUPLOADED"):n("ES_EW_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:S,selectedApprover:b,setSelectedApprover:T,selectFile:P,uploadedFile:I,setUploadedFile:O,businessService:p}))},[a,S,I]),console.log("conggg",E),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(xl,{label:r(E.label.heading)}),headerBarEnd:l.createElement(Ll,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m};console.log("applicationData",e),I&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==N?void 0:N.name,filestoreId:I},{}]),v.pickUpDate=null==e?void 0:e.date,v.transactionId=null==e?void 0:e.transactionId,v.finalAmount=null==e?void 0:e.finalAmount,d({EwasteApplication:[u({},v,{workflow:t})]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},kl=e=>l.createElement("h1",{className:"heading-m"},e.label),Ml=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ml,null)),Bl=e=>{var i,o;let{t:r,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:v,businessService:p,moduleCode:m}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==a?void 0:a.isTerminateState}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,y]=n.useState([]),[b,T]=n.useState(null),[A,C]=n.useState(null),[N,D]=n.useState(null),[I,O]=n.useState(null),[w,x]=n.useState(!1);function R(e){x(!0),C(e.target.files[0])}return n.useEffect(()=>{var e;y(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]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)O(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=Ye(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",A,c)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(r("CS_FILE_UPLOAD_ERROR"))})},function(){O(r("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(x(!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)}}()},[A]),console.log("actyhdesh,jhfsefsef",a,v),n.useEffect(()=>{_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:r,setUploadedFile:a,approvers:u,selectedApprover:c,setSelectedApprover:s,isUploading:d}=e;const v=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",d),{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:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:u,t:n,optionKey:"name",select:s,selected:c})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{a(null)},message:d?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(v,null),l.createElement("span",null,"Uploading...")):r?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:r,action:a,approvers:S,selectedApprover:b,setSelectedApprover:T,selectFile:R,uploadedFile:N,setUploadedFile:D,businessService:p,isUploading:w}))},[a,S,N]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(kl,{label:r(E.label.heading)}),headerBarEnd:l.createElement(Fl,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m,assignes:"SENDBACKTOCITIZEN"===(null==a?void 0:a.action)?[null==v||null===(t=v.auditDetails)||void 0===t?void 0:t.createdBy]:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null};N&&(n.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]),d({streetVendingDetail:u({},v,{workflow:n})})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Ul=e=>l.createElement("h1",{className:"heading-m"},e.label),Wl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),jl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Wl,null)),Hl=e=>{var i,o,r,a;let{t:c,action:s,tenantId:d,closeModal:v,submitAction:p,applicationData:m,businessService:f,moduleCode:E}=e;const{data:_}=Digit.Hooks.useEmployeeSearch(d,{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:h}=Digit.Hooks.fsm.useVendorSearch({tenantId:d,config:{enabled:"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)}});let g=[];null==h||null===(r=h.vendor)||void 0===r||r.map(e=>{var t;"WT"===(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.description)&&g.push({code:null==e?void 0:e.name,name:null==e?void 0:e.name,i18nKey:null==e?void 0:e.name,vendorId:null==e?void 0:e.id})});const{data:S}=Digit.Hooks.fsm.useVehiclesSearch({tenantId:d,config:{enabled:"DELIVERY_PENDING"===(null==s?void 0:s.state)}});let y=[];null==S||null===(a=S.vehicle)||void 0===a||a.map(e=>{y.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})});const[b,T]=n.useState({}),[A,C]=n.useState({}),[N,D]=n.useState([]),[I,O]=n.useState(null),[w,x]=n.useState(null),[R,L]=n.useState(null),[P,k]=n.useState(null),[M,F]=n.useState(null);function B(e){O(e.target.files[0])}return n.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}}))},[_]),n.useEffect(()=>{!function(){try{L(null);const e=function(){if(I){const e=function(){if(I.size>=5242880)L(c("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ye(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",I,d)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?x(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):L(c("CS_FILE_UPLOAD_ERROR"))})},function(){L(c("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]),n.useEffect(()=>{s&&T((e=>{let{t:n,action:i,selectFile:o,uploadedFile:r,setUploadedFile:a,selectedVendor:u,setSelectedVendor:c,vendorDescription:s,vehicleDescription:d,selectVehicle:v,setSelectVehicle:p}=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:n("ES_RS_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==i?void 0:i.state)?{label:n("RS_ASSIGN"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:s,t:n,optionKey:"i18nKey",select:c,selected:u})}:"null","DELIVERY_PENDING"===(null==i?void 0:i.state)?{label:n("RS_REGISTRATION_NUMBER"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:d,t:n,optionKey:"i18nKey",select:p,selected:v})}:"null",{label:n("ES_RS_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{a(null)},message:r?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:c,action:s,selectFile:B,uploadedFile:w,setUploadedFile:x,selectedVendor:P,setSelectedVendor:k,vendorDescription:h?g:void 0,vehicleDescription:S?y:void 0,selectVehicle:M,setSelectVehicle:F}))},[s,N,w,h,M,S]),s&&b.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ul,{label:c(b.label.heading)}),headerBarEnd:l.createElement(jl,{onClick:v}),actionCancelLabel:c(b.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:c(b.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:b.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:E};w&&(t.documents=[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:w}]),"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)&&(m.vendorId=null==P?void 0:P.vendorId),"DELIVERY_PENDING"===(null==s?void 0:s.state)&&(m.vehicleId=null==M?void 0:M.vehicleId);let n="watertanker"===f?{waterTankerBookingDetail:u({},m,{workflow:t})}:{mobileToiletBookingDetail:u({},m,{workflow:t})};p(n)},defaultValues:A,formId:"modal-action"})):l.createElement(t.Loader,null)},zl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Ze,e):null!=e&&e.businessService.includes("ptr")?l.createElement(bl,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")?l.createElement(nt,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(rt,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(st,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(mt,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(hl,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(Nl,e):null!=e&&e.businessService.includes("ewst")?l.createElement(Pl,e):null!=e&&e.businessService.includes("booking-refund")?l.createElement(wl,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(Bl,e):null!=e&&e.businessService.includes("watertanker")||null!=e&&e.businessService.includes("mobileToilet")?l.createElement(Hl,e):void 0;function Vl(e){let{documents:n,svgStyles:o={},isSendBackFlow:r=!1,isHrLine:a=!1,titleStyles:u}=e;const{t:c}=i.useTranslation(),s=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!s&&(null==n?void 0:n.map((e,i)=>{var o;return l.createElement(l.Fragment,{key:i},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},c(null==e?void 0:e.title)):null,l.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,n)=>{var i;return l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",color:"#505A5F"}},c(null==e?void 0:e.title)),r?null!=e&&null!==(i=e.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},c(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},c(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,c("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))),a&&(null==n?void 0:n.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)})),s&&(null==n?void 0:n.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},c(null==e?void 0:e.title)):null,l.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,n)=>l.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:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},c(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+c(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+c(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,c("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}X(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",r="[object Array]",a="[object Boolean]",u="[object Date]",c="[object Error]",s="[object Function]",d="[object GeneratorFunction]",v="[object Map]",p="[object Number]",m="[object Object]",f="[object RegExp]",E="[object Set]",_="[object String]",h="[object Symbol]",g="[object WeakMap]",S="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",T="[object Float64Array]",A="[object Int8Array]",C="[object Int16Array]",N="[object Int32Array]",D="[object Uint8Array]",I="[object Uint16Array]",O="[object Uint32Array]",w=/\b__p \+= '';/g,x=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,P=/[&<>"']/g,k=RegExp(L.source),M=RegExp(P.source),F=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,U=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,H=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,V=RegExp(z.source),K=/^\s+/,G=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,$=/,? & /,Q=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Z=/[()=,{}\[\]\/\s]/,J=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,re=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,ce=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\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",ve="["+de+"]",pe="["+se+"]",me="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_e="\\ud83c[\\udffb-\\udfff]",he="[^\\ud800-\\udfff]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",ye="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+Ee+")",Te="(?:"+ye+"|"+Ee+")",Ae="(?:"+pe+"|"+_e+")?",Ce="[\\ufe0e\\ufe0f]?"+Ae+"(?:\\u200d(?:"+[he,ge,Se].join("|")+")[\\ufe0e\\ufe0f]?"+Ae+")*",Ne="(?:"+["[\\u2700-\\u27bf]",ge,Se].join("|")+")"+Ce,De="(?:"+[he+pe+"?",pe,ge,Se,"[\\ud800-\\udfff]"].join("|")+")",Ie=RegExp("['’]","g"),Oe=RegExp(pe,"g"),we=RegExp(_e+"(?="+_e+")|"+De+Ce,"g"),xe=RegExp([ye+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,ye,"$"].join("|")+")",Te+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,ye+be,"$"].join("|")+")",ye+"?"+be+"+(?:['’](?: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,Ne].join("|"),"g"),Re=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\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"],ke=-1,Me={};Me[b]=Me[T]=Me[A]=Me[C]=Me[N]=Me[D]=Me["[object Uint8ClampedArray]"]=Me[I]=Me[O]=!0,Me[o]=Me[r]=Me[S]=Me[a]=Me[y]=Me[u]=Me[c]=Me[s]=Me[v]=Me[p]=Me[m]=Me[f]=Me[E]=Me[_]=Me[g]=!1;var Fe={};Fe[o]=Fe[r]=Fe[S]=Fe[y]=Fe[a]=Fe[u]=Fe[b]=Fe[T]=Fe[A]=Fe[C]=Fe[N]=Fe[v]=Fe[p]=Fe[m]=Fe[f]=Fe[E]=Fe[_]=Fe[h]=Fe[D]=Fe["[object Uint8ClampedArray]"]=Fe[I]=Fe[O]=!0,Fe[c]=Fe[s]=Fe[g]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,We=parseInt,je="object"==typeof Y&&Y&&Y.Object===Object&&Y,He="object"==typeof self&&self&&self.Object===Object&&self,ze=je||He||Function("return this")(),Ve=t&&!t.nodeType&&t,Ke=Ve&&e&&!e.nodeType&&e,Ge=Ke&&Ke.exports===Ve,qe=Ge&&je.process,Ye=function(){try{return Ke&&Ke.require&&Ke.require("util").types||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Xe=Ye&&Ye.isArrayBuffer,$e=Ye&&Ye.isDate,Qe=Ye&&Ye.isMap,Ze=Ye&&Ye.isRegExp,Je=Ye&&Ye.isSet,et=Ye&&Ye.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,l){for(var i=-1,o=null==e?0:e.length;++i<o;){var r=e[i];t(l,r,n(r),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function rt(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var r=e[n];t(r,n,e)&&(o[i++]=r)}return o}function at(e,t){return!(null==e||!e.length)&&_t(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function ct(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function st(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function dt(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function vt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function pt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var mt=yt("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function Et(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function _t(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,gt,n)}function ht(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function gt(e){return e!=e}function St(e,t){var n=null==e?0:e.length;return n?At(e,t)/n:NaN}function yt(e){return function(t){return null==t?void 0:t[e]}}function bt(e){return function(t){return null==e?void 0:e[t]}}function Tt(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function At(e,t){for(var n,l=-1,i=e.length;++l<i;){var o=t(e[l]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Ct(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Nt(e){return e?e.slice(0,Vt(e)+1).replace(K,""):e}function Dt(e){return function(t){return e(t)}}function It(e,t){return ct(t,function(t){return e[t]})}function Ot(e,t){return e.has(t)}function wt(e,t){for(var n=-1,l=e.length;++n<l&&_t(t,e[n],0)>-1;);return n}function xt(e,t){for(var n=e.length;n--&&_t(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Lt=bt({"À":"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"}),Pt=bt({"&":"&","<":"<",">":">",'"':""","'":"'"});function kt(e){return"\\"+Be[e]}function Mt(e){return Re.test(e)}function Ft(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Bt(e,t){return function(n){return e(t(n))}}function Ut(e,t){for(var n=-1,i=e.length,o=0,r=[];++n<i;){var a=e[n];a!==t&&a!==l||(e[n]=l,r[o++]=n)}return r}function Wt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Ht(e){return Mt(e)?function(e){for(var t=we.lastIndex=0;we.test(e);)++t;return t}(e):mt(e)}function zt(e){return Mt(e)?function(e){return e.match(we)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&G.test(e.charAt(t)););return t}var Kt=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Gt=function e(t){var G=(t=null==t?ze:Gt.defaults(ze.Object(),t,Gt.pick(ze,Pe))).Array,Y=t.Date,se=t.Error,de=t.Function,ve=t.Math,pe=t.Object,me=t.RegExp,fe=t.String,Ee=t.TypeError,_e=G.prototype,he=pe.prototype,ge=t["__core-js_shared__"],Se=de.prototype.toString,ye=he.hasOwnProperty,be=0,Te=function(){var e=/[^.]+$/.exec(ge&&ge.keys&&ge.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ae=he.toString,Ce=Se.call(pe),Ne=ze._,De=me("^"+Se.call(ye).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),we=Ge?t.Buffer:void 0,Re=t.Symbol,Be=t.Uint8Array,je=we?we.allocUnsafe:void 0,He=Bt(pe.getPrototypeOf,pe),Ve=pe.create,Ke=he.propertyIsEnumerable,qe=_e.splice,Ye=Re?Re.isConcatSpreadable:void 0,mt=Re?Re.iterator:void 0,bt=Re?Re.toStringTag:void 0,qt=function(){try{var e=Qi(pe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Yt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=Y&&Y.now!==ze.Date.now&&Y.now,$t=t.setTimeout!==ze.setTimeout&&t.setTimeout,Qt=ve.ceil,Zt=ve.floor,Jt=pe.getOwnPropertySymbols,en=we?we.isBuffer:void 0,tn=t.isFinite,nn=_e.join,ln=Bt(pe.keys,pe),on=ve.max,rn=ve.min,an=Y.now,un=t.parseInt,cn=ve.random,sn=_e.reverse,dn=Qi(t,"DataView"),vn=Qi(t,"Map"),pn=Qi(t,"Promise"),mn=Qi(t,"Set"),fn=Qi(t,"WeakMap"),En=Qi(pe,"create"),_n=fn&&new fn,hn={},gn=Co(dn),Sn=Co(vn),yn=Co(pn),bn=Co(mn),Tn=Co(fn),An=Re?Re.prototype:void 0,Cn=An?An.valueOf:void 0,Nn=An?An.toString:void 0;function Dn(e){if(Hr(e)&&!xr(e)&&!(e instanceof xn)){if(e instanceof wn)return e;if(ye.call(e,"__wrapped__"))return No(e)}return new wn(e)}var In=function(){function e(){}return function(t){if(!jr(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function On(){}function wn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function xn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function kn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Pn;++t<n;)this.add(e[t])}function Mn(e){var t=this.__data__=new Ln(e);this.size=t.size}function Fn(e,t){var n=xr(e),l=!n&&wr(e),i=!n&&!l&&kr(e),o=!n&&!l&&!i&&$r(e),r=n||l||i||o,a=r?Ct(e.length,fe):[],u=a.length;for(var c in e)!t&&!ye.call(e,c)||r&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||io(c,u))||a.push(c);return a}function Bn(e){var t=e.length;return t?e[Pl(0,t-1)]:void 0}function Un(e,t){return bo(fi(e),Yn(t,0,e.length))}function Wn(e){return bo(fi(e))}function jn(e,t,n){(void 0!==n&&!Dr(e[t],n)||void 0===n&&!(t in e))&&Gn(e,t,n)}function Hn(e,t,n){var l=e[t];ye.call(e,t)&&Dr(l,n)&&(void 0!==n||t in e)||Gn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(Dr(e[n][0],t))return n;return-1}function Vn(e,t,n,l){return Jn(e,function(e,i,o){t(l,e,n(e),o)}),l}function Kn(e,t){return e&&Ei(t,ha(t),e)}function Gn(e,t,n){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qn(e,t){for(var n=-1,l=t.length,i=G(l),o=null==e;++n<l;)i[n]=o?void 0:pa(e,t[n]);return i}function Yn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,l,i,r){var c,g=1&t,w=2&t,x=4&t;if(n&&(c=i?n(e,l,i,r):n(e)),void 0!==c)return c;if(!jr(e))return e;var R=xr(e);if(R){if(c=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ye.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!g)return fi(e,c)}else{var L=eo(e),P=L==s||L==d;if(kr(e))return ci(e,g);if(L==m||L==o||P&&!i){if(c=w||P?{}:no(e),!g)return w?function(e,t){return Ei(e,Ji(e),t)}(e,function(e,t){return e&&Ei(t,ga(t),e)}(c,e)):function(e,t){return Ei(e,Zi(e),t)}(e,Kn(c,e))}else{if(!Fe[L])return i?e:{};c=function(e,t,n){var l=e.constructor;switch(t){case S:return si(e);case a:case u:return new l(+e);case y:return function(e,t){var n=t?si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case b:case T:case A:case C:case N:case D:case"[object Uint8ClampedArray]":case I:case O:return di(e,n);case v:return new l;case p:case _:return new l(e);case f:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new l;case h:return Cn?pe(Cn.call(e)):{}}}(e,L,g)}}r||(r=new Mn);var k=r.get(e);if(k)return k;r.set(e,c),qr(e)?e.forEach(function(l){c.add(Xn(l,t,n,l,e,r))}):zr(e)&&e.forEach(function(l,i){c.set(i,Xn(l,t,n,i,e,r))});var M=R?void 0:(x?w?Vi:zi:w?ga:ha)(e);return lt(M||e,function(l,i){M&&(l=e[i=l]),Hn(c,i,Xn(l,t,n,i,e,r))}),c}function $n(e,t,n){var l=n.length;if(null==e)return!l;for(e=pe(e);l--;){var i=n[l],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Qn(e,t,l){if("function"!=typeof e)throw new Ee(n);return ho(function(){e.apply(void 0,l)},t)}function Zn(e,t,n,l){var i=-1,o=at,r=!0,a=e.length,u=[],c=t.length;if(!a)return u;n&&(t=ct(t,Dt(n))),l?(o=ut,r=!1):t.length>=200&&(o=Ot,r=!1,t=new kn(t));e:for(;++i<a;){var s=e[i],d=null==n?s:n(s);if(s=l||0!==s?s:0,r&&d==d){for(var v=c;v--;)if(t[v]===d)continue e;u.push(s)}else o(t,d,l)||u.push(s)}return u}Dn.templateSettings={escape:F,evaluate:B,interpolate:U,variable:"",imports:{_:Dn}},(Dn.prototype=On.prototype).constructor=Dn,(wn.prototype=In(On.prototype)).constructor=wn,(xn.prototype=In(On.prototype)).constructor=xn,Rn.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},Rn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Rn.prototype.get=function(e){var t=this.__data__;if(En){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ye.call(t,e)?t[e]:void 0},Rn.prototype.has=function(e){var t=this.__data__;return En?void 0!==t[e]:ye.call(t,e)},Rn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=En&&void 0===t?"__lodash_hash_undefined__":t,this},Ln.prototype.clear=function(){this.__data__=[],this.size=0},Ln.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},Ln.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},Ln.prototype.has=function(e){return zn(this.__data__,e)>-1},Ln.prototype.set=function(e,t){var n=this.__data__,l=zn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},Pn.prototype.clear=function(){this.size=0,this.__data__={hash:new Rn,map:new(vn||Ln),string:new Rn}},Pn.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},Pn.prototype.get=function(e){return Xi(this,e).get(e)},Pn.prototype.has=function(e){return Xi(this,e).has(e)},Pn.prototype.set=function(e,t){var n=Xi(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},kn.prototype.add=kn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},kn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.clear=function(){this.__data__=new Ln,this.size=0},Mn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Mn.prototype.get=function(e){return this.__data__.get(e)},Mn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ln){var l=n.__data__;if(!vn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pn(l)}return n.set(e,t),this.size=n.size,this};var Jn=gi(al),el=gi(ul,!0);function tl(e,t){var n=!0;return Jn(e,function(e,l,i){return n=!!t(e,l,i)}),n}function nl(e,t,n){for(var l=-1,i=e.length;++l<i;){var o=e[l],r=t(o);if(null!=r&&(void 0===a?r==r&&!Xr(r):n(r,a)))var a=r,u=o}return u}function ll(e,t){var n=[];return Jn(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function il(e,t,n,l,i){var o=-1,r=e.length;for(n||(n=lo),i||(i=[]);++o<r;){var a=e[o];t>0&&n(a)?t>1?il(a,t-1,n,l,i):st(i,a):l||(i[i.length]=a)}return i}var ol=Si(),rl=Si(!0);function al(e,t){return e&&ol(e,t,ha)}function ul(e,t){return e&&rl(e,t,ha)}function cl(e,t){return rt(t,function(t){return Br(e[t])})}function sl(e,t){for(var n=0,l=(t=oi(t,e)).length;null!=e&&n<l;)e=e[Ao(t[n++])];return n&&n==l?e:void 0}function dl(e,t,n){var l=t(e);return xr(e)?l:st(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in pe(e)?function(e){var t=ye.call(e,bt),n=e[bt];try{e[bt]=void 0;var l=!0}catch(e){}var i=Ae.call(e);return l&&(t?e[bt]=n:delete e[bt]),i}(e):function(e){return Ae.call(e)}(e)}function pl(e,t){return e>t}function ml(e,t){return null!=e&&ye.call(e,t)}function fl(e,t){return null!=e&&t in pe(e)}function El(e,t,n){for(var l=n?ut:at,i=e[0].length,o=e.length,r=o,a=G(o),u=Infinity,c=[];r--;){var s=e[r];r&&t&&(s=ct(s,Dt(t))),u=rn(s.length,u),a[r]=!n&&(t||i>=120&&s.length>=120)?new kn(r&&s):void 0}s=e[0];var d=-1,v=a[0];e:for(;++d<i&&c.length<u;){var p=s[d],m=t?t(p):p;if(p=n||0!==p?p:0,!(v?Ot(v,m):l(c,m,n))){for(r=o;--r;){var f=a[r];if(!(f?Ot(f,m):l(e[r],m,n)))continue e}v&&v.push(m),c.push(p)}}return c}function _l(e,t,n){var l=null==(e=mo(e,t=oi(t,e)))?e:e[Ao(Fo(t))];return null==l?void 0:tt(l,e,n)}function hl(e){return Hr(e)&&vl(e)==o}function gl(e,t,n,l,i){return e===t||(null==e||null==t||!Hr(e)&&!Hr(t)?e!=e&&t!=t:function(e,t,n,l,i,s){var d=xr(e),g=xr(t),b=d?r:eo(e),T=g?r:eo(t),A=(b=b==o?m:b)==m,C=(T=T==o?m:T)==m,N=b==T;if(N&&kr(e)){if(!kr(t))return!1;d=!0,A=!1}if(N&&!A)return s||(s=new Mn),d||$r(e)?ji(e,t,n,l,i,s):function(e,t,n,l,i,o,r){switch(n){case y:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!o(new Be(e),new Be(t)));case a:case u:case p:return Dr(+e,+t);case c:return e.name==t.name&&e.message==t.message;case f:case _:return e==t+"";case v:var s=Ft;case E:if(s||(s=Wt),e.size!=t.size&&!(1&l))return!1;var d=r.get(e);if(d)return d==t;l|=2,r.set(e,t);var m=ji(s(e),s(t),l,i,o,r);return r.delete(e),m;case h:if(Cn)return Cn.call(e)==Cn.call(t)}return!1}(e,t,b,n,l,i,s);if(!(1&n)){var D=A&&ye.call(e,"__wrapped__"),I=C&&ye.call(t,"__wrapped__");if(D||I){var O=D?e.value():e,w=I?t.value():t;return s||(s=new Mn),i(O,w,n,l,s)}}return!!N&&(s||(s=new Mn),function(e,t,n,l,i,o){var r=1&n,a=zi(e),u=a.length;if(u!=zi(t).length&&!r)return!1;for(var c=u;c--;){var s=a[c];if(!(r?s in t:ye.call(t,s)))return!1}var d=o.get(e),v=o.get(t);if(d&&v)return d==t&&v==e;var p=!0;o.set(e,t),o.set(t,e);for(var m=r;++c<u;){var f=e[s=a[c]],E=t[s];if(l)var _=r?l(E,f,s,t,e,o):l(f,E,s,e,t,o);if(!(void 0===_?f===E||i(f,E,n,l,o):_)){p=!1;break}m||(m="constructor"==s)}if(p&&!m){var h=e.constructor,g=t.constructor;h==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof h&&h instanceof h&&"function"==typeof g&&g instanceof g||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,n,l,i,s))}(e,t,n,l,gl,i))}function Sl(e,t,n,l){var i=n.length,o=i,r=!l;if(null==e)return!o;for(e=pe(e);i--;){var a=n[i];if(r&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){var u=(a=n[i])[0],c=e[u],s=a[1];if(r&&a[2]){if(void 0===c&&!(u in e))return!1}else{var d=new Mn;if(l)var v=l(c,s,u,e,t,d);if(!(void 0===v?gl(s,c,3,l,d):v))return!1}}return!0}function yl(e){return!(!jr(e)||(t=e,Te&&Te in t))&&(Br(e)?De:ie).test(Co(e));var t}function bl(e){return"function"==typeof e?e:null==e?Va:"object"==typeof e?xr(e)?Dl(e[0],e[1]):Nl(e):Ja(e)}function Tl(e){if(!co(e))return ln(e);var t=[];for(var n in pe(e))ye.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Al(e,t){return e<t}function Cl(e,t){var n=-1,l=Lr(e)?G(e.length):[];return Jn(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Nl(e){var t=$i(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function Dl(e,t){return ro(e)&&so(t)?vo(Ao(e),t):function(n){var l=pa(n,e);return void 0===l&&l===t?ma(n,e):gl(t,l,3)}}function Il(e,t,n,l,i){e!==t&&ol(t,function(o,r){if(i||(i=new Mn),jr(o))!function(e,t,n,l,i,o,r){var a=Eo(e,n),u=Eo(t,n),c=r.get(u);if(c)jn(e,n,c);else{var s=o?o(a,u,n+"",e,t,r):void 0,d=void 0===s;if(d){var v=xr(u),p=!v&&kr(u),m=!v&&!p&&$r(u);s=u,v||p||m?xr(a)?s=a:Pr(a)?s=fi(a):p?(d=!1,s=ci(u,!0)):m?(d=!1,s=di(u,!0)):s=[]:Kr(u)||wr(u)?(s=a,wr(a)?s=ia(a):jr(a)&&!Br(a)||(s=no(u))):d=!1}d&&(r.set(u,s),i(s,u,l,o,r),r.delete(u)),jn(e,n,s)}}(e,t,r,n,Il,l,i);else{var a=l?l(Eo(e,r),o,r+"",e,t,i):void 0;void 0===a&&(a=o),jn(e,r,a)}},ga)}function Ol(e,t){var n=e.length;if(n)return io(t+=t<0?n:0,n)?e[t]:void 0}function wl(e,t,n){t=t.length?ct(t,function(e){return xr(e)?function(t){return sl(t,1===e.length?e[0]:e)}:e}):[Va];var l=-1;return t=ct(t,Dt(Yi())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,r=i.length,a=n.length;++l<r;){var u=vi(i[l],o[l]);if(u)return l>=a?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Cl(e,function(e,n,i){return{criteria:ct(t,function(t){return t(e)}),index:++l,value:e}}))}function xl(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var r=t[l],a=sl(e,r);n(a,r)&&Ul(o,oi(r,e),a)}return o}function Rl(e,t,n,l){var i=l?ht:_t,o=-1,r=t.length,a=e;for(e===t&&(t=fi(t)),n&&(a=ct(e,Dt(n)));++o<r;)for(var u=0,c=t[o],s=n?n(c):c;(u=i(a,s,u,l))>-1;)a!==e&&qe.call(a,u,1),qe.call(e,u,1);return e}function Ll(e,t){for(var n=e?t.length:0,l=n-1;n--;){var i=t[n];if(n==l||i!==o){var o=i;io(i)?qe.call(e,i,1):Ql(e,i)}}return e}function Pl(e,t){return e+Zt(cn()*(t-e+1))}function kl(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Zt(t/2))&&(e+=e)}while(t);return n}function Ml(e,t){return go(po(e,t,Va),e+"")}function Fl(e){return Bn(Da(e))}function Bl(e,t){var n=Da(e);return bo(n,Yn(t,0,n.length))}function Ul(e,t,n,l){if(!jr(e))return e;for(var i=-1,o=(t=oi(t,e)).length,r=o-1,a=e;null!=a&&++i<o;){var u=Ao(t[i]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=r){var s=a[u];void 0===(c=l?l(s,u,a):void 0)&&(c=jr(s)?s:io(t[i+1])?[]:{})}Hn(a,u,c),a=a[u]}return e}var Wl=_n?function(e,t){return _n.set(e,t),e}:Va,jl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:ja(t),writable:!0})}:Va;function Hl(e){return bo(Da(e))}function zl(e,t,n){var l=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=G(i);++l<i;)o[l]=e[l+t];return o}function Vl(e,t){var n;return Jn(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Kl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var o=l+i>>>1,r=e[o];null!==r&&!Xr(r)&&(n?r<=t:r<t)?l=o+1:i=o}return i}return Gl(e,t,Va,n)}function Gl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var r=(t=n(t))!=t,a=null===t,u=Xr(t),c=void 0===t;i<o;){var s=Zt((i+o)/2),d=n(e[s]),v=void 0!==d,p=null===d,m=d==d,f=Xr(d);if(r)var E=l||m;else E=c?m&&(l||v):a?m&&v&&(l||!p):u?m&&v&&!p&&(l||!f):!p&&!f&&(l?d<=t:d<t);E?i=s+1:o=s}return rn(o,4294967294)}function ql(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var r=e[n],a=t?t(r):r;if(!n||!Dr(a,u)){var u=a;o[i++]=0===r?0:r}}return o}function Yl(e){return"number"==typeof e?e:Xr(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(xr(e))return ct(e,Xl)+"";if(Xr(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function $l(e,t,n){var l=-1,i=at,o=e.length,r=!0,a=[],u=a;if(n)r=!1,i=ut;else if(o>=200){var c=t?null:ki(e);if(c)return Wt(c);r=!1,i=Ot,u=new kn}else u=t?[]:a;e:for(;++l<o;){var s=e[l],d=t?t(s):s;if(s=n||0!==s?s:0,r&&d==d){for(var v=u.length;v--;)if(u[v]===d)continue e;t&&u.push(d),a.push(s)}else i(u,d,n)||(u!==a&&u.push(d),a.push(s))}return a}function Ql(e,t){return null==(e=mo(e,t=oi(t,e)))||delete e[Ao(Fo(t))]}function Zl(e,t,n,l){return Ul(e,t,n(sl(e,t)),l)}function Jl(e,t,n,l){for(var i=e.length,o=l?i:-1;(l?o--:++o<i)&&t(e[o],o,e););return n?zl(e,l?0:o,l?o+1:i):zl(e,l?o+1:0,l?i:o)}function ei(e,t){var n=e;return n instanceof xn&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function ti(e,t,n){var l=e.length;if(l<2)return l?$l(e[0]):[];for(var i=-1,o=G(l);++i<l;)for(var r=e[i],a=-1;++a<l;)a!=i&&(o[i]=Zn(o[i]||r,e[a],t,n));return $l(il(o,1),t,n)}function ni(e,t,n){for(var l=-1,i=e.length,o=t.length,r={};++l<i;)n(r,e[l],l<o?t[l]:void 0);return r}function li(e){return Pr(e)?e:[]}function ii(e){return"function"==typeof e?e:Va}function oi(e,t){return xr(e)?e:ro(e,t)?[e]:To(oa(e))}var ri=Ml;function ai(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var ui=Yt||function(e){return ze.clearTimeout(e)};function ci(e,t){if(t)return e.slice();var n=e.length,l=je?je(n):new e.constructor(n);return e.copy(l),l}function si(e){var t=new e.constructor(e.byteLength);return new Be(t).set(new Be(e)),t}function di(e,t){var n=t?si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=Xr(e),r=void 0!==t,a=null===t,u=t==t,c=Xr(t);if(!a&&!c&&!o&&e>t||o&&r&&u&&!a&&!c||l&&r&&u||!n&&u||!i)return 1;if(!l&&!o&&!c&&e<t||c&&n&&i&&!l&&!o||a&&n&&i||!r&&i||!u)return-1}return 0}function pi(e,t,n,l){for(var i=-1,o=e.length,r=n.length,a=-1,u=t.length,c=on(o-r,0),s=G(u+c),d=!l;++a<u;)s[a]=t[a];for(;++i<r;)(d||i<o)&&(s[n[i]]=e[i]);for(;c--;)s[a++]=e[i++];return s}function mi(e,t,n,l){for(var i=-1,o=e.length,r=-1,a=n.length,u=-1,c=t.length,s=on(o-a,0),d=G(s+c),v=!l;++i<s;)d[i]=e[i];for(var p=i;++u<c;)d[p+u]=t[u];for(;++r<a;)(v||i<o)&&(d[p+n[r]]=e[i++]);return d}function fi(e,t){var n=-1,l=e.length;for(t||(t=G(l));++n<l;)t[n]=e[n];return t}function Ei(e,t,n,l){var i=!n;n||(n={});for(var o=-1,r=t.length;++o<r;){var a=t[o],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),i?Gn(n,a,u):Hn(n,a,u)}return n}function _i(e,t){return function(n,l){var i=xr(n)?nt:Vn,o=t?t():{};return i(n,e,Yi(l,2),o)}}function hi(e){return Ml(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,r=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,r&&oo(n[0],n[1],r)&&(o=i<3?void 0:o,i=1),t=pe(t);++l<i;){var a=n[l];a&&e(t,a,l,o)}return t})}function gi(e,t){return function(n,l){if(null==n)return n;if(!Lr(n))return e(n,l);for(var i=n.length,o=t?i:-1,r=pe(n);(t?o--:++o<i)&&!1!==l(r[o],o,r););return n}}function Si(e){return function(t,n,l){for(var i=-1,o=pe(t),r=l(t),a=r.length;a--;){var u=r[e?a:++i];if(!1===n(o[u],u,o))break}return t}}function yi(e){return function(t){var n=Mt(t=oa(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),i=n?ai(n,1).join(""):t.slice(1);return l[e]()+i}}function bi(e){return function(t){return dt(Ba(wa(t).replace(Ie,"")),e,"")}}function Ti(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 n=In(e.prototype),l=e.apply(n,t);return jr(l)?l:n}}function Ai(e){return function(t,n,l){var i=pe(t);if(!Lr(t)){var o=Yi(n,3);t=ha(t),n=function(e){return o(i[e],e,i)}}var r=e(t,n,l);return r>-1?i[o?t[r]:r]:void 0}}function Ci(e){return Hi(function(t){var l=t.length,i=l,o=wn.prototype.thru;for(e&&t.reverse();i--;){var r=t[i];if("function"!=typeof r)throw new Ee(n);if(o&&!a&&"wrapper"==Gi(r))var a=new wn([],!0)}for(i=a?i:l;++i<l;){var u=Gi(r=t[i]),c="wrapper"==u?Ki(r):void 0;a=c&&ao(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?a[Gi(c[0])].apply(a,c[3]):1==r.length&&ao(r)?a[u]():a.thru(r)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&xr(n))return a.plant(n).value();for(var i=0,o=l?t[i].apply(this,e):n;++i<l;)o=t[i].call(this,o);return o}})}function Ni(e,t,n,l,i,o,r,a,u,c){var s=128&t,d=1&t,v=2&t,p=24&t,m=512&t,f=v?void 0:Ti(e);return function E(){for(var _=arguments.length,h=G(_),g=_;g--;)h[g]=arguments[g];if(p)var S=qi(E),y=Rt(h,S);if(l&&(h=pi(h,l,i,p)),o&&(h=mi(h,o,r,p)),_-=y,p&&_<c){var b=Ut(h,S);return Li(e,t,Ni,E.placeholder,n,h,b,a,u,c-_)}var T=d?n:this,A=v?T[e]:e;return _=h.length,a?h=fo(h,a):m&&_>1&&h.reverse(),s&&u<_&&(h.length=u),this&&this!==ze&&this instanceof E&&(A=f||Ti(A)),A.apply(T,h)}}function Di(e,t){return function(n,l){return function(e,t,n,l){return al(e,function(e,i,o){t(l,n(e),i,o)}),l}(n,e,t(l),{})}}function Ii(e,t){return function(n,l){var i;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(i=n),void 0!==l){if(void 0===i)return l;"string"==typeof n||"string"==typeof l?(n=Xl(n),l=Xl(l)):(n=Yl(n),l=Yl(l)),i=e(n,l)}return i}}function Oi(e){return Hi(function(t){return t=ct(t,Dt(Yi())),Ml(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function wi(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?kl(t,e):t;var l=kl(t,Qt(e/Ht(t)));return Mt(t)?ai(zt(l),0,e).join(""):l.slice(0,e)}function xi(e){return function(t,n,l){return l&&"number"!=typeof l&&oo(t,n,l)&&(n=l=void 0),t=ea(t),void 0===n?(n=t,t=0):n=ea(n),function(e,t,n,l){for(var i=-1,o=on(Qt((t-e)/(n||1)),0),r=G(o);o--;)r[l?o:++i]=e,e+=n;return r}(t,n,l=void 0===l?t<n?1:-1:ea(l),e)}}function Ri(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=la(t),n=la(n)),e(t,n)}}function Li(e,t,n,l,i,o,r,a,u,c){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var d=[e,t,i,s?o:void 0,s?r:void 0,s?void 0:o,s?void 0:r,a,u,c],v=n.apply(void 0,d);return ao(e)&&_o(v,d),v.placeholder=l,So(v,e,t)}function Pi(e){var t=ve[e];return function(e,n){if(e=la(e),(n=null==n?0:rn(ta(n),292))&&tn(e)){var l=(oa(e)+"e").split("e");return+((l=(oa(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var ki=mn&&1/Wt(new mn([,-0]))[1]==1/0?function(e){return new mn(e)}:Xa;function Mi(e){return function(t){var n=eo(t);return n==v?Ft(t):n==E?jt(t):function(e,t){return ct(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fi(e,t,i,o,r,a,u,c){var s=2&t;if(!s&&"function"!=typeof e)throw new Ee(n);var d=o?o.length:0;if(d||(t&=-97,o=r=void 0),u=void 0===u?u:on(ta(u),0),c=void 0===c?c:ta(c),d-=r?r.length:0,64&t){var v=o,p=r;o=r=void 0}var m=s?void 0:Ki(e),f=[e,t,i,o,r,v,p,a,u,c];if(m&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var r=t[3];if(r){var a=e[3];e[3]=a?pi(a,r,t[4]):r,e[4]=a?Ut(e[3],l):t[4]}(r=t[5])&&(e[5]=(a=e[5])?mi(a,r,t[6]):r,e[6]=a?Ut(e[5],l):t[6]),(r=t[7])&&(e[7]=r),128&i&&(e[8]=null==e[8]?t[8]:rn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(f,m),e=f[0],t=f[1],i=f[2],o=f[3],r=f[4],!(c=f[9]=void 0===f[9]?s?0:e.length:on(f[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=Ti(e);return function i(){for(var o=arguments.length,r=G(o),a=o,u=qi(i);a--;)r[a]=arguments[a];var c=o<3&&r[0]!==u&&r[o-1]!==u?[]:Ut(r,u);if((o-=c.length)<n)return Li(e,t,Ni,i.placeholder,void 0,r,c,void 0,void 0,n-o);var s=this&&this!==ze&&this instanceof i?l:e;return tt(s,this,r)}}(e,t,c):32!=t&&33!=t||r.length?Ni.apply(void 0,f):function(e,t,n,l){var i=1&t,o=Ti(e);return function t(){for(var r=-1,a=arguments.length,u=-1,c=l.length,s=G(c+a),d=this&&this!==ze&&this instanceof t?o:e;++u<c;)s[u]=l[u];for(;a--;)s[u++]=arguments[++r];return tt(d,i?n:this,s)}}(e,t,i,o);else var E=function(e,t,n){var l=1&t,i=Ti(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return So((m?Wl:_o)(E,f),e,t)}function Bi(e,t,n,l){return void 0===e||Dr(e,he[n])&&!ye.call(l,n)?t:e}function Ui(e,t,n,l,i,o){return jr(e)&&jr(t)&&(o.set(t,e),Il(e,t,void 0,Ui,o),o.delete(t)),e}function Wi(e){return Kr(e)?void 0:e}function ji(e,t,n,l,i,o){var r=1&n,a=e.length,u=t.length;if(a!=u&&!(r&&u>a))return!1;var c=o.get(e),s=o.get(t);if(c&&s)return c==t&&s==e;var d=-1,v=!0,p=2&n?new kn:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var m=e[d],f=t[d];if(l)var E=r?l(f,m,d,t,e,o):l(m,f,d,e,t,o);if(void 0!==E){if(E)continue;v=!1;break}if(p){if(!pt(t,function(e,t){if(!Ot(p,t)&&(m===e||i(m,e,n,l,o)))return p.push(t)})){v=!1;break}}else if(m!==f&&!i(m,f,n,l,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function Hi(e){return go(po(e,void 0,Ro),e+"")}function zi(e){return dl(e,ha,Zi)}function Vi(e){return dl(e,ga,Ji)}var Ki=_n?function(e){return _n.get(e)}:Xa;function Gi(e){for(var t=e.name+"",n=hn[t],l=ye.call(hn,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function qi(e){return(ye.call(Dn,"placeholder")?Dn:e).placeholder}function Yi(){var e=Dn.iteratee||Ka;return e=e===Ka?bl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var n,l,i=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function $i(e){for(var t=ha(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,so(i)]}return t}function Qi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return yl(n)?n:void 0}var Zi=Jt?function(e){return null==e?[]:(e=pe(e),rt(Jt(e),function(t){return Ke.call(e,t)}))}:nu,Ji=Jt?function(e){for(var t=[];e;)st(t,Zi(e)),e=He(e);return t}:nu,eo=vl;function to(e,t,n){for(var l=-1,i=(t=oi(t,e)).length,o=!1;++l<i;){var r=Ao(t[l]);if(!(o=null!=e&&n(e,r)))break;e=e[r]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&Wr(i)&&io(r,i)&&(xr(e)||wr(e))}function no(e){return"function"!=typeof e.constructor||co(e)?{}:In(He(e))}function lo(e){return xr(e)||wr(e)||!!(Ye&&e&&e[Ye])}function io(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&re.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,n){if(!jr(n))return!1;var l=typeof t;return!!("number"==l?Lr(n)&&io(t,n.length):"string"==l&&t in n)&&Dr(n[t],e)}function ro(e,t){if(xr(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Xr(e))||j.test(e)||!W.test(e)||null!=t&&e in pe(t)}function ao(e){var t=Gi(e),n=Dn[t];if("function"!=typeof n||!(t in xn.prototype))return!1;if(e===n)return!0;var l=Ki(n);return!!l&&e===l[0]}(dn&&eo(new dn(new ArrayBuffer(1)))!=y||vn&&eo(new vn)!=v||pn&&"[object Promise]"!=eo(pn.resolve())||mn&&eo(new mn)!=E||fn&&eo(new fn)!=g)&&(eo=function(e){var t=vl(e),n=t==m?e.constructor:void 0,l=n?Co(n):"";if(l)switch(l){case gn:return y;case Sn:return v;case yn:return"[object Promise]";case bn:return E;case Tn:return g}return t});var uo=ge?Br:lu;function co(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||he)}function so(e){return e==e&&!jr(e)}function vo(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in pe(n))}}function po(e,t,n){return t=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=on(l.length-t,0),r=G(o);++i<o;)r[i]=l[t+i];i=-1;for(var a=G(t+1);++i<t;)a[i]=l[i];return a[t]=n(r),tt(e,this,a)}}function mo(e,t){return t.length<2?e:sl(e,zl(t,0,-1))}function fo(e,t){for(var n=e.length,l=rn(t.length,n),i=fi(e);l--;){var o=t[l];e[l]=io(o,n)?i[o]:void 0}return e}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _o=yo(Wl),ho=$t||function(e,t){return ze.setTimeout(e,t)},go=yo(jl);function So(e,t,n){var l=t+"";return go(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace(q,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!at(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(X);return t?t[1].split($):[]}(l),n)))}function yo(e){var t=0,n=0;return function(){var l=an(),i=16-(l-n);if(n=l,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function bo(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=Pl(n,i),r=e[o];e[o]=e[n],e[n]=r}return e.length=t,e}var To=function(e){var t=yr(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(H,function(e,n,l,i){t.push(l?i.replace(J,"$1"):n||e)}),t},function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}();function Ao(e){if("string"==typeof e||Xr(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Co(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function No(e){if(e instanceof xn)return e.clone();var t=new wn(e.__wrapped__,e.__chain__);return t.__actions__=fi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Do=Ml(function(e,t){return Pr(e)?Zn(e,il(t,1,Pr,!0)):[]}),Io=Ml(function(e,t){var n=Fo(t);return Pr(n)&&(n=void 0),Pr(e)?Zn(e,il(t,1,Pr,!0),Yi(n,2)):[]}),Oo=Ml(function(e,t){var n=Fo(t);return Pr(n)&&(n=void 0),Pr(e)?Zn(e,il(t,1,Pr,!0),void 0,n):[]});function wo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ta(n);return i<0&&(i=on(l+i,0)),Et(e,Yi(t,3),i)}function xo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=ta(n),i=n<0?on(l+i,0):rn(i,l-1)),Et(e,Yi(t,3),i,!0)}function Ro(e){return null!=e&&e.length?il(e,1):[]}function Lo(e){return e&&e.length?e[0]:void 0}var Po=Ml(function(e){var t=ct(e,li);return t.length&&t[0]===e[0]?El(t):[]}),ko=Ml(function(e){var t=Fo(e),n=ct(e,li);return t===Fo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,Yi(t,2)):[]}),Mo=Ml(function(e){var t=Fo(e),n=ct(e,li);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?El(n,void 0,t):[]});function Fo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Bo=Ml(Uo);function Uo(e,t){return e&&e.length&&t&&t.length?Rl(e,t):e}var Wo=Hi(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return Ll(e,ct(t,function(e){return io(e,n)?+e:e}).sort(vi)),l});function jo(e){return null==e?e:sn.call(e)}var Ho=Ml(function(e){return $l(il(e,1,Pr,!0))}),zo=Ml(function(e){var t=Fo(e);return Pr(t)&&(t=void 0),$l(il(e,1,Pr,!0),Yi(t,2))}),Vo=Ml(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,$l(il(e,1,Pr,!0),void 0,t)});function Ko(e){if(!e||!e.length)return[];var t=0;return e=rt(e,function(e){if(Pr(e))return t=on(e.length,t),!0}),Ct(t,function(t){return ct(e,yt(t))})}function Go(e,t){if(!e||!e.length)return[];var n=Ko(e);return null==t?n:ct(n,function(e){return tt(t,void 0,e)})}var qo=Ml(function(e,t){return Pr(e)?Zn(e,t):[]}),Yo=Ml(function(e){return ti(rt(e,Pr))}),Xo=Ml(function(e){var t=Fo(e);return Pr(t)&&(t=void 0),ti(rt(e,Pr),Yi(t,2))}),$o=Ml(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,ti(rt(e,Pr),void 0,t)}),Qo=Ml(Ko),Zo=Ml(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Go(e,n)});function Jo(e){var t=Dn(e);return t.__chain__=!0,t}function er(e,t){return t(e)}var tr=Hi(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof xn&&io(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:er,args:[i],thisArg:void 0}),new wn(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),nr=_i(function(e,t,n){ye.call(e,n)?++e[n]:Gn(e,n,1)}),lr=Ai(wo),ir=Ai(xo);function or(e,t){return(xr(e)?lt:Jn)(e,Yi(t,3))}function rr(e,t){return(xr(e)?it:el)(e,Yi(t,3))}var ar=_i(function(e,t,n){ye.call(e,n)?e[n].push(t):Gn(e,n,[t])}),ur=Ml(function(e,t,n){var l=-1,i="function"==typeof t,o=Lr(e)?G(e.length):[];return Jn(e,function(e){o[++l]=i?tt(t,e,n):_l(e,t,n)}),o}),cr=_i(function(e,t,n){Gn(e,n,t)});function sr(e,t){return(xr(e)?ct:Cl)(e,Yi(t,3))}var dr=_i(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),vr=Ml(function(e,t){if(null==e)return[];var n=t.length;return n>1&&oo(e,t[0],t[1])?t=[]:n>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),wl(e,il(t,1),[])}),pr=Xt||function(){return ze.Date.now()};function mr(e,t,n){return t=n?void 0:t,Fi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function fr(e,t){var l;if("function"!=typeof t)throw new Ee(n);return e=ta(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var Er=Ml(function(e,t,n){var l=1;if(n.length){var i=Ut(n,qi(Er));l|=32}return Fi(e,l,t,n,i)}),_r=Ml(function(e,t,n){var l=3;if(n.length){var i=Ut(n,qi(_r));l|=32}return Fi(t,l,e,n,i)});function hr(e,t,l){var i,o,r,a,u,c,s=0,d=!1,v=!1,p=!0;if("function"!=typeof e)throw new Ee(n);function m(t){var n=i,l=o;return i=o=void 0,s=t,a=e.apply(l,n)}function f(e){return s=e,u=ho(_,t),d?m(e):a}function E(e){var n=e-c;return void 0===c||n>=t||n<0||v&&e-s>=r}function _(){var e=pr();if(E(e))return h(e);u=ho(_,function(e){var n=t-(e-c);return v?rn(n,r-(e-s)):n}(e))}function h(e){return u=void 0,p&&i?m(e):(i=o=void 0,a)}function g(){var e=pr(),n=E(e);if(i=arguments,o=this,c=e,n){if(void 0===u)return f(c);if(v)return ui(u),u=ho(_,t),m(c)}return void 0===u&&(u=ho(_,t)),a}return t=la(t)||0,jr(l)&&(d=!!l.leading,r=(v="maxWait"in l)?on(la(l.maxWait)||0,t):r,p="trailing"in l?!!l.trailing:p),g.cancel=function(){void 0!==u&&ui(u),s=0,i=c=o=u=void 0},g.flush=function(){return void 0===u?a:h(pr())},g}var gr=Ml(function(e,t){return Qn(e,1,t)}),Sr=Ml(function(e,t,n){return Qn(e,la(t)||0,n)});function yr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(n);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 r=e.apply(this,n);return l.cache=o.set(i,r)||o,r};return l.cache=new(yr.Cache||Pn),l}function br(e){if("function"!=typeof e)throw new Ee(n);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)}}yr.Cache=Pn;var Tr=ri(function(e,t){var n=(t=1==t.length&&xr(t[0])?ct(t[0],Dt(Yi())):ct(il(t,1),Dt(Yi()))).length;return Ml(function(l){for(var i=-1,o=rn(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),Ar=Ml(function(e,t){return Fi(e,32,void 0,t,Ut(t,qi(Ar)))}),Cr=Ml(function(e,t){return Fi(e,64,void 0,t,Ut(t,qi(Cr)))}),Nr=Hi(function(e,t){return Fi(e,256,void 0,void 0,void 0,t)});function Dr(e,t){return e===t||e!=e&&t!=t}var Ir=Ri(pl),Or=Ri(function(e,t){return e>=t}),wr=hl(function(){return arguments}())?hl:function(e){return Hr(e)&&ye.call(e,"callee")&&!Ke.call(e,"callee")},xr=G.isArray,Rr=Xe?Dt(Xe):function(e){return Hr(e)&&vl(e)==S};function Lr(e){return null!=e&&Wr(e.length)&&!Br(e)}function Pr(e){return Hr(e)&&Lr(e)}var kr=en||lu,Mr=$e?Dt($e):function(e){return Hr(e)&&vl(e)==u};function Fr(e){if(!Hr(e))return!1;var t=vl(e);return t==c||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Kr(e)}function Br(e){if(!jr(e))return!1;var t=vl(e);return t==s||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ur(e){return"number"==typeof e&&e==ta(e)}function Wr(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function jr(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Hr(e){return null!=e&&"object"==typeof e}var zr=Qe?Dt(Qe):function(e){return Hr(e)&&eo(e)==v};function Vr(e){return"number"==typeof e||Hr(e)&&vl(e)==p}function Kr(e){if(!Hr(e)||vl(e)!=m)return!1;var t=He(e);if(null===t)return!0;var n=ye.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==Ce}var Gr=Ze?Dt(Ze):function(e){return Hr(e)&&vl(e)==f},qr=Je?Dt(Je):function(e){return Hr(e)&&eo(e)==E};function Yr(e){return"string"==typeof e||!xr(e)&&Hr(e)&&vl(e)==_}function Xr(e){return"symbol"==typeof e||Hr(e)&&vl(e)==h}var $r=et?Dt(et):function(e){return Hr(e)&&Wr(e.length)&&!!Me[vl(e)]},Qr=Ri(Al),Zr=Ri(function(e,t){return e<=t});function Jr(e){if(!e)return[];if(Lr(e))return Yr(e)?zt(e):fi(e);if(mt&&e[mt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[mt]());var t=eo(e);return(t==v?Ft:t==E?Wt:Da)(e)}function ea(e){return e?(e=la(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ta(e){var t=ea(e),n=t%1;return t==t?n?t-n:t:0}function na(e){return e?Yn(ta(e),0,4294967295):0}function la(e){if("number"==typeof e)return e;if(Xr(e))return NaN;if(jr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=jr(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Nt(e);var n=le.test(e);return n||oe.test(e)?We(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ia(e){return Ei(e,ga(e))}function oa(e){return null==e?"":Xl(e)}var ra=hi(function(e,t){if(co(t)||Lr(t))Ei(t,ha(t),e);else for(var n in t)ye.call(t,n)&&Hn(e,n,t[n])}),aa=hi(function(e,t){Ei(t,ga(t),e)}),ua=hi(function(e,t,n,l){Ei(t,ga(t),e,l)}),ca=hi(function(e,t,n,l){Ei(t,ha(t),e,l)}),sa=Hi(qn),da=Ml(function(e,t){e=pe(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],r=ga(o),a=-1,u=r.length;++a<u;){var c=r[a],s=e[c];(void 0===s||Dr(s,he[c])&&!ye.call(e,c))&&(e[c]=o[c])}return e}),va=Ml(function(e){return e.push(void 0,Ui),tt(ya,void 0,e)});function pa(e,t,n){var l=null==e?void 0:sl(e,t);return void 0===l?n:l}function ma(e,t){return null!=e&&to(e,t,fl)}var fa=Di(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),e[t]=n},ja(Va)),Ea=Di(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),ye.call(e,t)?e[t].push(n):e[t]=[n]},Yi),_a=Ml(_l);function ha(e){return Lr(e)?Fn(e):Tl(e)}function ga(e){return Lr(e)?Fn(e,!0):function(e){if(!jr(e))return function(e){var t=[];if(null!=e)for(var n in pe(e))t.push(n);return t}(e);var t=co(e),n=[];for(var l in e)("constructor"!=l||!t&&ye.call(e,l))&&n.push(l);return n}(e)}var Sa=hi(function(e,t,n){Il(e,t,n)}),ya=hi(function(e,t,n,l){Il(e,t,n,l)}),ba=Hi(function(e,t){var n={};if(null==e)return n;var l=!1;t=ct(t,function(t){return t=oi(t,e),l||(l=t.length>1),t}),Ei(e,Vi(e),n),l&&(n=Xn(n,7,Wi));for(var i=t.length;i--;)Ql(n,t[i]);return n}),Ta=Hi(function(e,t){return null==e?{}:function(e,t){return xl(e,t,function(t,n){return ma(e,n)})}(e,t)});function Aa(e,t){if(null==e)return{};var n=ct(Vi(e),function(e){return[e]});return t=Yi(t),xl(e,n,function(e,n){return t(e,n[0])})}var Ca=Mi(ha),Na=Mi(ga);function Da(e){return null==e?[]:It(e,ha(e))}var Ia=bi(function(e,t,n){return t=t.toLowerCase(),e+(n?Oa(t):t)});function Oa(e){return Fa(oa(e).toLowerCase())}function wa(e){return(e=oa(e))&&e.replace(ae,Lt).replace(Oe,"")}var xa=bi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ra=bi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),La=yi("toLowerCase"),Pa=bi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),ka=bi(function(e,t,n){return e+(n?" ":"")+Fa(t)}),Ma=bi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Fa=yi("toUpperCase");function Ba(e,t,n){return e=oa(e),void 0===(t=n?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(xe)||[]}(e):function(e){return e.match(Q)||[]}(e):e.match(t)||[]}var Ua=Ml(function(e,t){try{return tt(e,void 0,t)}catch(e){return Fr(e)?e:new se(e)}}),Wa=Hi(function(e,t){return lt(t,function(t){t=Ao(t),Gn(e,t,Er(e[t],e))}),e});function ja(e){return function(){return e}}var Ha=Ci(),za=Ci(!0);function Va(e){return e}function Ka(e){return bl("function"==typeof e?e:Xn(e,1))}var Ga=Ml(function(e,t){return function(n){return _l(n,e,t)}}),qa=Ml(function(e,t){return function(n){return _l(e,n,t)}});function Ya(e,t,n){var l=ha(t),i=cl(t,l);null!=n||jr(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=cl(t,ha(t)));var o=!(jr(n)&&"chain"in n&&!n.chain),r=Br(e);return lt(i,function(n){var l=t[n];e[n]=l,r&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=fi(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,st([this.value()],arguments))})}),e}function Xa(){}var $a=Oi(ct),Qa=Oi(ot),Za=Oi(pt);function Ja(e){return ro(e)?yt(Ao(e)):function(e){return function(t){return sl(t,e)}}(e)}var eu=xi(),tu=xi(!0);function nu(){return[]}function lu(){return!1}var iu,ou=Ii(function(e,t){return e+t},0),ru=Pi("ceil"),au=Ii(function(e,t){return e/t},1),uu=Pi("floor"),cu=Ii(function(e,t){return e*t},1),su=Pi("round"),du=Ii(function(e,t){return e-t},0);return Dn.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=ta(e),function(){if(--e<1)return t.apply(this,arguments)}},Dn.ary=mr,Dn.assign=ra,Dn.assignIn=aa,Dn.assignInWith=ua,Dn.assignWith=ca,Dn.at=sa,Dn.before=fr,Dn.bind=Er,Dn.bindAll=Wa,Dn.bindKey=_r,Dn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return xr(e)?e:[e]},Dn.chain=Jo,Dn.chunk=function(e,t,n){t=(n?oo(e,t,n):void 0===t)?1:on(ta(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,r=G(Qt(l/t));i<l;)r[o++]=zl(e,i,i+=t);return r},Dn.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,i=[];++t<n;){var o=e[t];o&&(i[l++]=o)}return i},Dn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=G(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return st(xr(n)?fi(n):[n],il(t,1))},Dn.cond=function(e){var t=null==e?0:e.length,l=Yi();return e=t?ct(e,function(e){if("function"!=typeof e[1])throw new Ee(n);return[l(e[0]),e[1]]}):[],Ml(function(n){for(var l=-1;++l<t;){var i=e[l];if(tt(i[0],this,n))return tt(i[1],this,n)}})},Dn.conforms=function(e){return function(e){var t=ha(e);return function(n){return $n(n,e,t)}}(Xn(e,1))},Dn.constant=ja,Dn.countBy=nr,Dn.create=function(e,t){var n=In(e);return null==t?n:Kn(n,t)},Dn.curry=function e(t,n,l){var i=Fi(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Dn.curryRight=function e(t,n,l){var i=Fi(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Dn.debounce=hr,Dn.defaults=da,Dn.defaultsDeep=va,Dn.defer=gr,Dn.delay=Sr,Dn.difference=Do,Dn.differenceBy=Io,Dn.differenceWith=Oo,Dn.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:ta(t))<0?0:t,l):[]},Dn.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,0,(t=l-(t=n||void 0===t?1:ta(t)))<0?0:t):[]},Dn.dropRightWhile=function(e,t){return e&&e.length?Jl(e,Yi(t,3),!0,!0):[]},Dn.dropWhile=function(e,t){return e&&e.length?Jl(e,Yi(t,3),!0):[]},Dn.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&oo(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=ta(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:ta(l))<0&&(l+=i),l=n>l?0:na(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Dn.filter=function(e,t){return(xr(e)?rt:ll)(e,Yi(t,3))},Dn.flatMap=function(e,t){return il(sr(e,t),1)},Dn.flatMapDeep=function(e,t){return il(sr(e,t),1/0)},Dn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ta(n),il(sr(e,t),n)},Dn.flatten=Ro,Dn.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},Dn.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:ta(t)):[]},Dn.flip=function(e){return Fi(e,512)},Dn.flow=Ha,Dn.flowRight=za,Dn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var i=e[t];l[i[0]]=i[1]}return l},Dn.functions=function(e){return null==e?[]:cl(e,ha(e))},Dn.functionsIn=function(e){return null==e?[]:cl(e,ga(e))},Dn.groupBy=ar,Dn.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},Dn.intersection=Po,Dn.intersectionBy=ko,Dn.intersectionWith=Mo,Dn.invert=fa,Dn.invertBy=Ea,Dn.invokeMap=ur,Dn.iteratee=Ka,Dn.keyBy=cr,Dn.keys=ha,Dn.keysIn=ga,Dn.map=sr,Dn.mapKeys=function(e,t){var n={};return t=Yi(t,3),al(e,function(e,l,i){Gn(n,t(e,l,i),e)}),n},Dn.mapValues=function(e,t){var n={};return t=Yi(t,3),al(e,function(e,l,i){Gn(n,l,t(e,l,i))}),n},Dn.matches=function(e){return Nl(Xn(e,1))},Dn.matchesProperty=function(e,t){return Dl(e,Xn(t,1))},Dn.memoize=yr,Dn.merge=Sa,Dn.mergeWith=ya,Dn.method=Ga,Dn.methodOf=qa,Dn.mixin=Ya,Dn.negate=br,Dn.nthArg=function(e){return e=ta(e),Ml(function(t){return Ol(t,e)})},Dn.omit=ba,Dn.omitBy=function(e,t){return Aa(e,br(Yi(t)))},Dn.once=function(e){return fr(2,e)},Dn.orderBy=function(e,t,n,l){return null==e?[]:(xr(t)||(t=null==t?[]:[t]),xr(n=l?void 0:n)||(n=null==n?[]:[n]),wl(e,t,n))},Dn.over=$a,Dn.overArgs=Tr,Dn.overEvery=Qa,Dn.overSome=Za,Dn.partial=Ar,Dn.partialRight=Cr,Dn.partition=dr,Dn.pick=Ta,Dn.pickBy=Aa,Dn.property=Ja,Dn.propertyOf=function(e){return function(t){return null==e?void 0:sl(e,t)}},Dn.pull=Bo,Dn.pullAll=Uo,Dn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Rl(e,t,Yi(n,2)):e},Dn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Rl(e,t,void 0,n):e},Dn.pullAt=Wo,Dn.range=eu,Dn.rangeRight=tu,Dn.rearg=Nr,Dn.reject=function(e,t){return(xr(e)?rt:ll)(e,br(Yi(t,3)))},Dn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=Yi(t,3);++l<o;){var r=e[l];t(r,l,e)&&(n.push(r),i.push(l))}return Ll(e,i),n},Dn.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Ml(e,t=void 0===t?t:ta(t))},Dn.reverse=jo,Dn.sampleSize=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:ta(t),(xr(e)?Un:Bl)(e,t)},Dn.set=function(e,t,n){return null==e?e:Ul(e,t,n)},Dn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ul(e,t,n,l)},Dn.shuffle=function(e){return(xr(e)?Wn:Hl)(e)},Dn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&oo(e,t,n)?(t=0,n=l):(t=null==t?0:ta(t),n=void 0===n?l:ta(n)),zl(e,t,n)):[]},Dn.sortBy=vr,Dn.sortedUniq=function(e){return e&&e.length?ql(e):[]},Dn.sortedUniqBy=function(e,t){return e&&e.length?ql(e,Yi(t,2)):[]},Dn.split=function(e,t,n){return n&&"number"!=typeof n&&oo(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=oa(e))&&("string"==typeof t||null!=t&&!Gr(t))&&!(t=Xl(t))&&Mt(e)?ai(zt(e),0,n):e.split(t,n):[]},Dn.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:on(ta(t),0),Ml(function(n){var l=n[t],i=ai(n,0,t);return l&&st(i,l),tt(e,this,i)})},Dn.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},Dn.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:ta(t))<0?0:t):[]},Dn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:ta(t)))<0?0:t,l):[]},Dn.takeRightWhile=function(e,t){return e&&e.length?Jl(e,Yi(t,3),!1,!0):[]},Dn.takeWhile=function(e,t){return e&&e.length?Jl(e,Yi(t,3)):[]},Dn.tap=function(e,t){return t(e),e},Dn.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(n);return jr(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),hr(e,t,{leading:i,maxWait:t,trailing:o})},Dn.thru=er,Dn.toArray=Jr,Dn.toPairs=Ca,Dn.toPairsIn=Na,Dn.toPath=function(e){return xr(e)?ct(e,Ao):Xr(e)?[e]:fi(To(oa(e)))},Dn.toPlainObject=ia,Dn.transform=function(e,t,n){var l=xr(e),i=l||kr(e)||$r(e);if(t=Yi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:jr(e)&&Br(o)?In(He(e)):{}}return(i?lt:al)(e,function(e,l,i){return t(n,e,l,i)}),n},Dn.unary=function(e){return mr(e,1)},Dn.union=Ho,Dn.unionBy=zo,Dn.unionWith=Vo,Dn.uniq=function(e){return e&&e.length?$l(e):[]},Dn.uniqBy=function(e,t){return e&&e.length?$l(e,Yi(t,2)):[]},Dn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?$l(e,void 0,t):[]},Dn.unset=function(e,t){return null==e||Ql(e,t)},Dn.unzip=Ko,Dn.unzipWith=Go,Dn.update=function(e,t,n){return null==e?e:Zl(e,t,ii(n))},Dn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Zl(e,t,ii(n),l)},Dn.values=Da,Dn.valuesIn=function(e){return null==e?[]:It(e,ga(e))},Dn.without=qo,Dn.words=Ba,Dn.wrap=function(e,t){return Ar(ii(t),e)},Dn.xor=Yo,Dn.xorBy=Xo,Dn.xorWith=$o,Dn.zip=Qo,Dn.zipObject=function(e,t){return ni(e||[],t||[],Hn)},Dn.zipObjectDeep=function(e,t){return ni(e||[],t||[],Ul)},Dn.zipWith=Zo,Dn.entries=Ca,Dn.entriesIn=Na,Dn.extend=aa,Dn.extendWith=ua,Ya(Dn,Dn),Dn.add=ou,Dn.attempt=Ua,Dn.camelCase=Ia,Dn.capitalize=Oa,Dn.ceil=ru,Dn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=la(n))==n?n:0),void 0!==t&&(t=(t=la(t))==t?t:0),Yn(la(e),t,n)},Dn.clone=function(e){return Xn(e,4)},Dn.cloneDeep=function(e){return Xn(e,5)},Dn.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},Dn.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},Dn.conformsTo=function(e,t){return null==t||$n(e,t,ha(t))},Dn.deburr=wa,Dn.defaultTo=function(e,t){return null==e||e!=e?t:e},Dn.divide=au,Dn.endsWith=function(e,t,n){e=oa(e),t=Xl(t);var l=e.length,i=n=void 0===n?l:Yn(ta(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Dn.eq=Dr,Dn.escape=function(e){return(e=oa(e))&&M.test(e)?e.replace(P,Pt):e},Dn.escapeRegExp=function(e){return(e=oa(e))&&V.test(e)?e.replace(z,"\\$&"):e},Dn.every=function(e,t,n){var l=xr(e)?ot:tl;return n&&oo(e,t,n)&&(t=void 0),l(e,Yi(t,3))},Dn.find=lr,Dn.findIndex=wo,Dn.findKey=function(e,t){return ft(e,Yi(t,3),al)},Dn.findLast=ir,Dn.findLastIndex=xo,Dn.findLastKey=function(e,t){return ft(e,Yi(t,3),ul)},Dn.floor=uu,Dn.forEach=or,Dn.forEachRight=rr,Dn.forIn=function(e,t){return null==e?e:ol(e,Yi(t,3),ga)},Dn.forInRight=function(e,t){return null==e?e:rl(e,Yi(t,3),ga)},Dn.forOwn=function(e,t){return e&&al(e,Yi(t,3))},Dn.forOwnRight=function(e,t){return e&&ul(e,Yi(t,3))},Dn.get=pa,Dn.gt=Ir,Dn.gte=Or,Dn.has=function(e,t){return null!=e&&to(e,t,ml)},Dn.hasIn=ma,Dn.head=Lo,Dn.identity=Va,Dn.includes=function(e,t,n,l){e=Lr(e)?e:Da(e),n=n&&!l?ta(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),Yr(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&_t(e,t,n)>-1},Dn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ta(n);return i<0&&(i=on(l+i,0)),_t(e,t,i)},Dn.inRange=function(e,t,n){return t=ea(t),void 0===n?(n=t,t=0):n=ea(n),function(e,t,n){return e>=rn(t,n)&&e<on(t,n)}(e=la(e),t,n)},Dn.invoke=_a,Dn.isArguments=wr,Dn.isArray=xr,Dn.isArrayBuffer=Rr,Dn.isArrayLike=Lr,Dn.isArrayLikeObject=Pr,Dn.isBoolean=function(e){return!0===e||!1===e||Hr(e)&&vl(e)==a},Dn.isBuffer=kr,Dn.isDate=Mr,Dn.isElement=function(e){return Hr(e)&&1===e.nodeType&&!Kr(e)},Dn.isEmpty=function(e){if(null==e)return!0;if(Lr(e)&&(xr(e)||"string"==typeof e||"function"==typeof e.splice||kr(e)||$r(e)||wr(e)))return!e.length;var t=eo(e);if(t==v||t==E)return!e.size;if(co(e))return!Tl(e).length;for(var n in e)if(ye.call(e,n))return!1;return!0},Dn.isEqual=function(e,t){return gl(e,t)},Dn.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?gl(e,t,void 0,n):!!l},Dn.isError=Fr,Dn.isFinite=function(e){return"number"==typeof e&&tn(e)},Dn.isFunction=Br,Dn.isInteger=Ur,Dn.isLength=Wr,Dn.isMap=zr,Dn.isMatch=function(e,t){return e===t||Sl(e,t,$i(t))},Dn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,$i(t),n)},Dn.isNaN=function(e){return Vr(e)&&e!=+e},Dn.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return yl(e)},Dn.isNil=function(e){return null==e},Dn.isNull=function(e){return null===e},Dn.isNumber=Vr,Dn.isObject=jr,Dn.isObjectLike=Hr,Dn.isPlainObject=Kr,Dn.isRegExp=Gr,Dn.isSafeInteger=function(e){return Ur(e)&&e>=-9007199254740991&&e<=9007199254740991},Dn.isSet=qr,Dn.isString=Yr,Dn.isSymbol=Xr,Dn.isTypedArray=$r,Dn.isUndefined=function(e){return void 0===e},Dn.isWeakMap=function(e){return Hr(e)&&eo(e)==g},Dn.isWeakSet=function(e){return Hr(e)&&"[object WeakSet]"==vl(e)},Dn.join=function(e,t){return null==e?"":nn.call(e,t)},Dn.kebabCase=xa,Dn.last=Fo,Dn.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l;return void 0!==n&&(i=(i=ta(n))<0?on(l+i,0):rn(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):Et(e,gt,i,!0)},Dn.lowerCase=Ra,Dn.lowerFirst=La,Dn.lt=Qr,Dn.lte=Zr,Dn.max=function(e){return e&&e.length?nl(e,Va,pl):void 0},Dn.maxBy=function(e,t){return e&&e.length?nl(e,Yi(t,2),pl):void 0},Dn.mean=function(e){return St(e,Va)},Dn.meanBy=function(e,t){return St(e,Yi(t,2))},Dn.min=function(e){return e&&e.length?nl(e,Va,Al):void 0},Dn.minBy=function(e,t){return e&&e.length?nl(e,Yi(t,2),Al):void 0},Dn.stubArray=nu,Dn.stubFalse=lu,Dn.stubObject=function(){return{}},Dn.stubString=function(){return""},Dn.stubTrue=function(){return!0},Dn.multiply=cu,Dn.nth=function(e,t){return e&&e.length?Ol(e,ta(t)):void 0},Dn.noConflict=function(){return ze._===this&&(ze._=Ne),this},Dn.noop=Xa,Dn.now=pr,Dn.pad=function(e,t,n){e=oa(e);var l=(t=ta(t))?Ht(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return wi(Zt(i),n)+e+wi(Qt(i),n)},Dn.padEnd=function(e,t,n){e=oa(e);var l=(t=ta(t))?Ht(e):0;return t&&l<t?e+wi(t-l,n):e},Dn.padStart=function(e,t,n){e=oa(e);var l=(t=ta(t))?Ht(e):0;return t&&l<t?wi(t-l,n)+e:e},Dn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(oa(e).replace(K,""),t||0)},Dn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&oo(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=ea(e),void 0===t?(t=e,e=0):t=ea(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=cn();return rn(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Pl(e,t)},Dn.reduce=function(e,t,n){var l=xr(e)?dt:Tt,i=arguments.length<3;return l(e,Yi(t,4),n,i,Jn)},Dn.reduceRight=function(e,t,n){var l=xr(e)?vt:Tt,i=arguments.length<3;return l(e,Yi(t,4),n,i,el)},Dn.repeat=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:ta(t),kl(oa(e),t)},Dn.replace=function(){var e=arguments,t=oa(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dn.result=function(e,t,n){var l=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[Ao(t[l])];void 0===o&&(l=i,o=n),e=Br(o)?o.call(e):o}return e},Dn.round=su,Dn.runInContext=e,Dn.sample=function(e){return(xr(e)?Bn:Fl)(e)},Dn.size=function(e){if(null==e)return 0;if(Lr(e))return Yr(e)?Ht(e):e.length;var t=eo(e);return t==v||t==E?e.size:Tl(e).length},Dn.snakeCase=Pa,Dn.some=function(e,t,n){var l=xr(e)?pt:Vl;return n&&oo(e,t,n)&&(t=void 0),l(e,Yi(t,3))},Dn.sortedIndex=function(e,t){return Kl(e,t)},Dn.sortedIndexBy=function(e,t,n){return Gl(e,t,Yi(n,2))},Dn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Kl(e,t);if(l<n&&Dr(e[l],t))return l}return-1},Dn.sortedLastIndex=function(e,t){return Kl(e,t,!0)},Dn.sortedLastIndexBy=function(e,t,n){return Gl(e,t,Yi(n,2),!0)},Dn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Kl(e,t,!0)-1;if(Dr(e[n],t))return n}return-1},Dn.startCase=ka,Dn.startsWith=function(e,t,n){return e=oa(e),n=null==n?0:Yn(ta(n),0,e.length),t=Xl(t),e.slice(n,n+t.length)==t},Dn.subtract=du,Dn.sum=function(e){return e&&e.length?At(e,Va):0},Dn.sumBy=function(e,t){return e&&e.length?At(e,Yi(t,2)):0},Dn.template=function(e,t,n){var l=Dn.templateSettings;n&&oo(e,t,n)&&(t=void 0),e=oa(e),t=ua({},t,l,Bi);var i,o,r=ua({},t.imports,l.imports,Bi),a=ha(r),u=It(r,a),c=0,s=t.interpolate||ue,d="__p += '",v=me((t.escape||ue).source+"|"+s.source+"|"+(s===U?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),p="//# sourceURL="+(ye.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ke+"]")+"\n";e.replace(v,function(t,n,l,r,a,u){return l||(l=r),d+=e.slice(c,u).replace(ce,kt),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),a&&(o=!0,d+="';\n"+a+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),c=u+t.length,t}),d+="';\n";var m=ye.call(t,"variable")&&t.variable;if(m){if(Z.test(m))throw new se("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(w,""):d).replace(x,"$1").replace(R,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var f=Ua(function(){return de(a,p+"return "+d).apply(void 0,u)});if(f.source=d,Fr(f))throw f;return f},Dn.times=function(e,t){if((e=ta(e))<1||e>9007199254740991)return[];var n=4294967295,l=rn(e,4294967295);e-=4294967295;for(var i=Ct(l,t=Yi(t));++n<e;)t(n);return i},Dn.toFinite=ea,Dn.toInteger=ta,Dn.toLength=na,Dn.toLower=function(e){return oa(e).toLowerCase()},Dn.toNumber=la,Dn.toSafeInteger=function(e){return e?Yn(ta(e),-9007199254740991,9007199254740991):0===e?e:0},Dn.toString=oa,Dn.toUpper=function(e){return oa(e).toUpperCase()},Dn.trim=function(e,t,n){if((e=oa(e))&&(n||void 0===t))return Nt(e);if(!e||!(t=Xl(t)))return e;var l=zt(e),i=zt(t);return ai(l,wt(l,i),xt(l,i)+1).join("")},Dn.trimEnd=function(e,t,n){if((e=oa(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Xl(t)))return e;var l=zt(e);return ai(l,0,xt(l,zt(t))+1).join("")},Dn.trimStart=function(e,t,n){if((e=oa(e))&&(n||void 0===t))return e.replace(K,"");if(!e||!(t=Xl(t)))return e;var l=zt(e);return ai(l,wt(l,zt(t))).join("")},Dn.truncate=function(e,t){var n=30,l="...";if(jr(t)){var i="separator"in t?t.separator:i;n="length"in t?ta(t.length):n,l="omission"in t?Xl(t.omission):l}var o=(e=oa(e)).length;if(Mt(e)){var r=zt(e);o=r.length}if(n>=o)return e;var a=n-Ht(l);if(a<1)return l;var u=r?ai(r,0,a).join(""):e.slice(0,a);if(void 0===i)return u+l;if(r&&(a+=u.length-a),Gr(i)){if(e.slice(a).search(i)){var c,s=u;for(i.global||(i=me(i.source,oa(te.exec(i))+"g")),i.lastIndex=0;c=i.exec(s);)var d=c.index;u=u.slice(0,void 0===d?a:d)}}else if(e.indexOf(Xl(i),a)!=a){var v=u.lastIndexOf(i);v>-1&&(u=u.slice(0,v))}return u+l},Dn.unescape=function(e){return(e=oa(e))&&k.test(e)?e.replace(L,Kt):e},Dn.uniqueId=function(e){var t=++be;return oa(e)+t},Dn.upperCase=Ma,Dn.upperFirst=Fa,Dn.each=or,Dn.eachRight=rr,Dn.first=Lo,Ya(Dn,(iu={},al(Dn,function(e,t){ye.call(Dn.prototype,t)||(iu[t]=e)}),iu),{chain:!1}),Dn.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Dn[e].placeholder=Dn}),lt(["drop","take"],function(e,t){xn.prototype[e]=function(n){n=void 0===n?1:on(ta(n),0);var l=this.__filtered__&&!t?new xn(this):this.clone();return l.__filtered__?l.__takeCount__=rn(n,l.__takeCount__):l.__views__.push({size:rn(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},xn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;xn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Yi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");xn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");xn.prototype[e]=function(){return this.__filtered__?new xn(this):this[n](1)}}),xn.prototype.compact=function(){return this.filter(Va)},xn.prototype.find=function(e){return this.filter(e).head()},xn.prototype.findLast=function(e){return this.reverse().find(e)},xn.prototype.invokeMap=Ml(function(e,t){return"function"==typeof e?new xn(this):this.map(function(n){return _l(n,e,t)})}),xn.prototype.reject=function(e){return this.filter(br(Yi(e)))},xn.prototype.slice=function(e,t){e=ta(e);var n=this;return n.__filtered__&&(e>0||t<0)?new xn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ta(t))<0?n.dropRight(-t):n.take(t-e)),n)},xn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},xn.prototype.toArray=function(){return this.take(4294967295)},al(xn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=Dn[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(Dn.prototype[t]=function(){var t=this.__wrapped__,r=l?[1]:arguments,a=t instanceof xn,u=r[0],c=a||xr(t),s=function(e){var t=i.apply(Dn,st([e],r));return l&&d?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(a=c=!1);var d=this.__chain__,v=!!this.__actions__.length,p=o&&!d,m=a&&!v;if(!o&&c){t=m?t:new xn(this);var f=e.apply(t,r);return f.__actions__.push({func:er,args:[s],thisArg:void 0}),new wn(f,d)}return p&&m?e.apply(this,r):(f=this.thru(s),p?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=_e[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Dn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(xr(i)?i:[],e)}return this[n](function(n){return t.apply(xr(n)?n:[],e)})}}),al(xn.prototype,function(e,t){var n=Dn[t];if(n){var l=n.name+"";ye.call(hn,l)||(hn[l]=[]),hn[l].push({name:t,func:n})}}),hn[Ni(void 0,2).name]=[{name:"wrapper",func:void 0}],xn.prototype.clone=function(){var e=new xn(this.__wrapped__);return e.__actions__=fi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=fi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=fi(this.__views__),e},xn.prototype.reverse=function(){if(this.__filtered__){var e=new xn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},xn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=xr(e),l=t<0,i=n?e.length:0,o=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var o=n[l],r=o.size;switch(o.type){case"drop":e+=r;break;case"dropRight":t-=r;break;case"take":t=rn(t,e+r);break;case"takeRight":e=on(e,t-r)}}return{start:e,end:t}}(0,i,this.__views__),r=o.start,a=o.end,u=a-r,c=l?a:r-1,s=this.__iteratees__,d=s.length,v=0,p=rn(u,this.__takeCount__);if(!n||!l&&i==u&&p==u)return ei(e,this.__actions__);var m=[];e:for(;u--&&v<p;){for(var f=-1,E=e[c+=t];++f<d;){var _=s[f],h=_.type,g=(0,_.iteratee)(E);if(2==h)E=g;else if(!g){if(1==h)continue e;break e}}m[v++]=E}return m},Dn.prototype.at=tr,Dn.prototype.chain=function(){return Jo(this)},Dn.prototype.commit=function(){return new wn(this.value(),this.__chain__)},Dn.prototype.next=function(){void 0===this.__values__&&(this.__values__=Jr(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Dn.prototype.plant=function(e){for(var t,n=this;n instanceof On;){var l=No(n);l.__index__=0,l.__values__=void 0,t?i.__wrapped__=l:t=l;var i=l;n=n.__wrapped__}return i.__wrapped__=e,t},Dn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof xn){var t=e;return this.__actions__.length&&(t=new xn(this)),(t=t.reverse()).__actions__.push({func:er,args:[jo],thisArg:void 0}),new wn(t,this.__chain__)}return this.thru(jo)},Dn.prototype.toJSON=Dn.prototype.valueOf=Dn.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Dn.prototype.first=Dn.prototype.head,mt&&(Dn.prototype[mt]=function(){return this}),Dn}();Ke?((Ke.exports=Gt)._=Gt,Ve._=Gt):ze._=Gt}).call(Y)});const Kl=e=>{var t,i;let{t:o,formData:r,applicationData:a,docs:u,bpaActionsDetails:c}=e;const s=(null==a?void 0:a.status)||"",d=(null==c||null===(t=c.data)||void 0===t?void 0:t.nextActions)||[],v=Digit.ULBService.getStateId(),[p,m]=n.useState((null==r||null===(i=r.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=n.useState(null),[_,h]=n.useState([]),[g,S]=n.useState(!0),[y,b]=n.useState(!1),[T,A]=n.useState(!1),{isLoading:C,data:N}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:D,data:I}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var o,r;null!=N&&null!==(e=N.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==N||null===(o=N.BPA)||void 0===o||null===(r=o.DocTypeMapping)||void 0===r?void 0:r.filter(e=>{var t,n;return e.WFState==(null==a?void 0:a.status)?null==a?void 0:a.status:e.RiskType==(null==a?void 0:a.riskType)&&e.ServiceType==(null==a||null===(t=a.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==a||null===(n=a.additionalDetails)||void 0===n?void 0:n.applicationType)}));let c=[];null===(t=i)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==I||null===(t=I["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,o.length);o===n&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(l=u[0])||void 0===l||null===(i=l.values)||void 0===i||i.map(t=>{var n,l;o===(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0])+"."+(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),c.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)),h(c)},[!C,!D]),n.useEffect(()=>{let e=0;_.map(t=>{let n=!1;p.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(n=!0)}),!n&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(p.length>0))},[p,y]),n.useEffect(()=>{A("DOC_VERIFICATION_INPROGRESS"===s&&(null==d?void 0:d.length)>0)},[a,c]),l.createElement("div",null,null==_?void 0:_.map((e,t)=>l.createElement("div",null,l.createElement(Gl,{key:t,index:t,document:e,t:o,error:f,setError:E,setDocuments:m,documents:p,setCheckRequiredFields:b,applicationStatus:s,actions:d,bpaTaxDocuments:_,checkEnablingDocs:T}))))};function Gl(e){var i,o;let{t:r,document:a,setDocuments:c,documents:s,index:d,bpaTaxDocuments:v,checkEnablingDocs:p}=e;const m=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],f=Digit.ULBService.getStateId(),[E,_]=n.useState(m?u({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}):1===(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)?null==a?void 0:a.dropdownData[0]:{}),[h,g]=n.useState(null),[S,y]=n.useState(()=>(null==m?void 0:m.fileStoreId)||null),[b,T]=n.useState([]);return n.useEffect(()=>{null!=E&&E.code&&c(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==S?void 0:S.length)||null===S?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==S),{documentType:null==E?void 0:E.code,fileStoreId:S,documentUid:S,fileName:(null==h?void 0:h.name)||"",id:s?null===(t=s.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[S,E]),n.useEffect(()=>{try{b.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),a.newUploadedDocs=[],b.map(e=>{var t,n,l;null!=E&&E.code&&a.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===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),v[d]=a,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(v)))}catch(e){Promise.reject(e)}},[b,E]),n.useEffect(()=>{},[h]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+r(null==a?void 0:a.code)),(null==a||null===(o=a.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(Vl,{documents:null==a?void 0:a.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),p?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=a&&a.required?r(null==a?void 0:a.code)+"* ":""+r(null==a?void 0:a.code)),l.createElement(t.Dropdown,{className:"form-field",t:r,isMandatory:!1,option:null==a?void 0:a.dropdownData,selected:E,optionKey:"i18nKey",select:e=>_(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:f,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);var i;0!==Object.keys(n).length&&T(l),(i=l[l.length-1])&&g(i.file)})(0,e),t:r,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function ql(e){let{fiReport:n,isCitizen:o=!1}=e;const{t:r}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+r("BPA_FI_REPORT")),n.map((e,i)=>{var o,a,u,c,s,d;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(t.StatusTable,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+r("BPA_FI_REPORT"):r("BPA_FI_REPORT")+" - "+(i+1)),l.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===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),l.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===(c=e.questions)||void 0===c?void 0:c.length)&&(null==e||null===(s=e.questions)||void 0===s?void 0:s.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(t.Row,{className:"border-none",label:""+r(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+r("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Vl,{documents:(d=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==d?void 0:d.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 Yl(e){let{t:i,document:o,setNocDocuments:r,setError:a,nocDocuments:u}=e;const c=null==u?void 0:u.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(),[d,v]=n.useState(),[p,m]=n.useState(null),[f,E]=n.useState(()=>(null==c?void 0:c.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&r(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==p?void 0:p.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{a(null);const e=function(){if(p){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(p.size>=5242880)a(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=p&&p.type&&!e.test(null==p?void 0:p.type))a(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ye(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",p,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?E(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):a(i("CS_FILE_UPLOAD_ERROR"))})},function(){a(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)}}()},[p]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&m(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Xl=e=>{var i;let{t:o,noc:r,docs:a,isNoc:u,applicationData:c,NOCdata:s,bpaActionsDetails:d}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),p=(null==c?void 0:c.status)||"",m=(null==d||null===(i=d.data)||void 0===i?void 0:i.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:E}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!u}),{data:_}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[h,g]=n.useState([]),[S,y]=n.useState([]),[b,T]=n.useState(!1),[A,C]=Digit.Hooks.useSessionStorage(null==r?void 0:r.nocType,[]),[N,D]=n.useState(null),I=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;g(null==_||null===(e=_["common-masters"])||void 0===e?void 0:e.DocumentType)},[_]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,a,s,d;l=u?null==f||null===(o=f.NOC)||void 0===o||null===(a=o.DocumentTypeMapping)||void 0===a?void 0:a.filter(e=>(null==e?void 0:e.applicationType)===(null==r?void 0:r.applicationType)&&(null==e?void 0:e.nocType)===(null==r?void 0:r.nocType)):null==E||null===(s=E.BPA)||void 0===s||null===(d=s.DocTypeMapping)||void 0===d?void 0:d.filter(e=>{var t,n;return e.WFState==(null==c?void 0:c.status)&&e.RiskType==(null==c?void 0:c.riskType)&&e.ServiceType==(null==c||null===(t=c.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==c||null===(n=c.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==r?void 0:r.additionalDetails,applicationStatus:null==r?void 0:r.applicationStatus,appNumberLink:null==r?void 0:r.applicationNo,nocNo:null==r?void 0:r.nocNo},i.push(l[0].docTypes[0]));let v=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==h||h.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),v.push(e)}),y(v))},[f,h]),n.useEffect(()=>{T("NOC_VERIFICATION_INPROGRESS"===p&&(null==m?void 0:m.length)>0)},[c,d]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:I?""+o("BPA_"+(null==r?void 0:r.nocType)+"_HEADER"):o("BPA_"+(null==r?void 0:r.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),s&&s.map((e,n)=>{if(null!=e&&e.value)return l.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:I?""+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:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:I?""+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")})})),l.createElement(Vl,{documents:a,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==S?void 0:S.map((e,t)=>l.createElement(Yl,{key:t,document:e,t:o,error:N,setError:D,setNocDocuments:C,nocDocuments:A,checkEnablingDocs:b}))))},$l=e=>{let{permissions:i,t:o}=e;const[r,a,c]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[s,d,v]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const p=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==r?void 0:r.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:p?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;a(()=>null==r?void 0:r.map((e,t)=>n===t?u({},e,{checked:l}):e))})(e,0,n),isLabelFirst:!0,index:n})),null==s?void 0:s.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{d(()=>null==s?void 0:s.map((n,l)=>{var i;return t===l?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:n}))})(e,n),textInputStyle:{maxWidth:p?"96%":"830px",width:p?"96%":"830px"},style:p?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:p?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),d([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:p?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{d([...s,{label:""}])}}))};function Ql(e){let{documents:o,svgStyles:r={},isSendBackFlow:a=!1}=e;const{t:u}=i.useTranslation(),[c,s]=n.useState(()=>[]),[d,v]=(Digit.ULBService.getCurrentTenantId(),n.useState({}));n.useEffect(()=>{var e;let t=[];null==o||o.forEach((e,n,l)=>{t=[...t,...e.values?e.values:[]]}),s(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[o]),n.useEffect(()=>{var e;null!=c&&c.length&&"BillAmend"===(null==o||null===(e=o[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(c,Digit.ULBService.getCurrentTenantId()).then(e=>{v(null==e?void 0:e.data)}):null!=c&&c.length&&Digit.UploadServices.Filefetch(c,Digit.ULBService.getStateId()).then(e=>{v(null==e?void 0:e.data)})},[c]);const p=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),m=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!m&&(null==o?void 0:o.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:p?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C, 100%",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.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,n)=>{var i,o;return l.createElement("a",{target:"_",href:null===(i=d[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:p?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},u(null==e?void 0:e.title)),a?null!=e&&null!==(o=e.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),m&&(null==o?void 0:o.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.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,n)=>{var i;return l.createElement("a",{target:"_",href:null===(i=d[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:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.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")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function Zl(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:o}=n,{t:r}=i.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:r("ES_PT_TITLE_TAX_HEADS"),text:r("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==o?void 0:o.map((e,n)=>l.createElement(t.Row,{key:r(e.taxHeadCode),label:r(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==o?void 0:o.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(t.Row,{label:r("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Jl(e){let{floors:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},o(null==e?void 0:e.title)),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==n?"16px":"revert"}},o(e.title)),l.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},l.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,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title),text:o(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function ei(e){let{owners:n}=e,o={};o=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:r}=i.useTranslation(),a=(null==n?void 0:n.length)||1;let c={marginTop:"19px"},s={position:"relative",padding:"8px"},d={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(a)>1?c={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(a)>1||(c={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},s={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(c=u({},c,{maxWidth:"950px"}),c=u({},c,{maxWidth:"950px"}),d={}),n.sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},o.map((e,n)=>{var i;return l.createElement("div",{key:r(null==e?void 0:e.title),style:c,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(a)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(a)>1?r(null==e?void 0:e.title)+" "+(n+1):r(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:s},l.createElement("div",{style:{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,n)=>{var i;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:r(e.title),label:r(e.title),text:l.createElement("img",{src:r(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:r(e.title),label:""+r(e.title),text:r(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:d}))}))))})))}const ti=e=>{var o,r,a;let{scrutinyDetails:u,paymentsList:c=[]}=e;const{t:s}=i.useTranslation(),d=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},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 l.createElement(n.Fragment,null,!(null!=u&&u.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement("div",null,null==u||null===(o=u.values)||void 0===o?void 0:o.map((e,n)=>null!=e&&e.isUnit?l.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?d(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?l.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:d(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},s(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},s(null==e?void 0:e.title))),null==u||null===(r=u.permit)||void 0===r?void 0:r.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),l.createElement("div",null,null==u||null===(a=u.scruntinyDetails)||void 0===a?void 0:a.map((e,i)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+s(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(t.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},s(null==e?void 0:e.text))))))))},ni=e=>{var o,r,a,u,c;let{edcrDetails:s,applicationData:d}=e;const{t:v}=i.useTranslation(),p=window.Digit.Utils.browser.isMobile(),m=[{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"}],f=e=>{const t=e;return(e,n,l)=>e[t]},E=n.useMemo(()=>m.map(e=>({Header:v(""+e.name),accessor:f(e.id),id:e.id})));function _(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,i,o,r,a,u,c;n.push({Floor:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(r=e.occupancies)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.CarpetArea)||0,key:v("BPA_FLOOR_NAME_"+e.number)})}),n}function h(e){var t;let n=null==d||null===(t=d.landInfo)||void 0===t?void 0:t.unit,l="";if((null==n?void 0:n.length)>0){var i,o;let t=null===(i=n[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+v("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.StatusTable,null,null==s||null===(o=s.values)||void 0===o?void 0:o.map((e,n)=>null!=e&&e.isHeader?l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},v(null==e?void 0:e.title)):l.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===(r=s.subOccupancyTableDetails)||void 0===r||null===(a=r[0])||void 0===a||null===(u=a.value)||void 0===u||null===(c=u.planDetail)||void 0===c?void 0:c.blocks.map((e,n)=>{var i,o,r,a,u;return l.createElement("div",{key:n,style:(null==s||null===(i=s.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(r=o.value)||void 0===r||null===(a=r.planDetail)||void 0===a||null===(u=a.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},v("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+v("BPA_SUB_OCCUPANCY_LABEL"),text:h(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||p?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.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:_(e),columns:E,getCellProps:e=>({style:{}})})))})))},li=e=>{let{headComment:t,otherComment:n}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,t),l.createElement("p",null,n))},ii=e=>{var n,o,r;let{data:a,OpenImage:u,privacy:c={}}=e;const{t:s}=i.useTranslation();return l.createElement("div",null,a.date&&l.createElement("p",null,a.date),l.createElement("p",null,a.name),a.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:a.mobileNumber,privacy:c}),l.createElement("p",null," ")),a.source&&l.createElement("p",null,s("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+a.source.toUpperCase())),a.comment&&l.createElement(li,{otherComment:null==a?void 0:a.otherComment,headComment:null==a?void 0:a.comment}),null!=a&&a.wfComment?l.createElement("div",null,null==a||null===(n=a.wfComment)||void 0===n?void 0:n.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==a||null===(o=a.thumbnailsToShow)||void 0===o||null===(r=o.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==a?void 0:a.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==a?void 0:a.thumbnailsToShow)}})):null)};function oi(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.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"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},o(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.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,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"N/A",last:n===(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:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.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"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},o(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.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,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"NA",last:n===(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 ai=e=>{var o,r,a,u;let{wsAdditionalDetails:c}=e;const{t:s}=i.useTranslation();let d=(v=location.search)?(/^[?#]/.test(v)?v.slice(1):v).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var v;const p=null==d?void 0:d.mode;var{connectionDetails:m,plumberDetails:f,roadCuttingDetails:E,activationDetails:_}=(null==c?void 0:c.additionalDetails)||{connectionDetails:[],plumberDetails:[]};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==c||null===(o=c.additionalDetails)||void 0===o?void 0:o.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==m?void 0:m.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==c||null===(r=c.additionalDetails)||void 0===r?void 0:r.plumberDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==f?void 0:f.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==c||null===(a=c.additionalDetails)||void 0===a?void 0:a.roadCuttingDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map(e=>{var n;return l.createElement("div",{style:(null==E?void 0:E.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(n=e.values)||void 0===n?void 0:n.map(e=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))})))),(null==c||null===(u=c.additionalDetails)||void 0===u?void 0:u.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==_?void 0:_.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},ui=[{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"}],ci=[{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"}],si=e=>{var o,r,a,c;let{wsAdditionalDetails:s}=e;const{t:d}=i.useTranslation(),[v,p,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,h]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),g=!(null==s||null===(o=s.additionalDetails)||void 0===o||!o.isPaid),[S,y]=n.useState(!1),[b,T]=n.useState(v||{}),[A,C]=n.useState(null),[N,D]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[I,O]=n.useState(s.additionalDetails.values?s.additionalDetails.values:[]),w=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(w,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i=u({},null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==v||null===(n=v.billDetails)||void 0===n?void 0:n.length)>0){var o,r,a,c,d,m,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(o=v.billDetails)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(a=v.billDetails)||void 0===a||null===(c=a[0])||void 0===c?void 0:c.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==v||null===(d=v.billDetails)||void 0===d||null===(m=d[0])||void 0===m?void 0:m.taxAmount)}];O(e),D(null==v||null===(f=v.billDetails)||void 0===f?void 0:f[0])}else p(i),T(i)},[]);let x={};const R=e=>l.createElement("h1",{className:"heading-m"},e.label),L=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(L,null)),k=function(e,t,n){void 0===t&&(t=!1);let l=u({},b);if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var i,o;const t=0==(null==n||null===(i=n.target)||void 0===i?void 0:i.value)?1:Math.sign(null==n||null===(o=n.target)||void 0===o?void 0:o.value)||-1;l[e]=1==t?n.target.value:""}T(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},I&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==I?void 0:I.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+d("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==N?void 0:N.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+d("CS_INBOX_STATUS_FILTER"),text:d(g?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:g?{color:"#00703C"}:{color:"#D4351C"}}))),null!=s&&null!==(r=s.additionalDetails)&&void 0!==r&&r.isAdhocRebate?l.createElement("div",{onClick:e=>{y(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},d("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,S&&l.createElement(t.Modal,{headerBarMain:l.createElement(R,{label:d("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(P,{onClick:()=>{T(v),y(!1)}}),actionCancelLabel:d("PT_CANCEL"),actionCancelOnSubmit:()=>{T(v),y(!1)},actionSaveLabel:d("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,n=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var l,i;if(t||n)if(n>(null==s||null===(l=s.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))C({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,r,a,c,v,m,f,h,g,S;const e=null==s||null===(o=s.additionalDetails)||void 0===o||null===(r=o.appDetails)||void 0===r?void 0:r.applicationNo,t=null==s||null===(a=s.additionalDetails)||void 0===a||null===(c=a.appDetails)||void 0===c?void 0:c.tenantId,n=u({},null==s||null===(v=s.additionalDetails)||void 0===v||null===(m=v.appDetails)||void 0===m?void 0:m.additionalDetails,b);s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(f=s.additionalDetails)||void 0===f||null===(h=f.appDetails)||void 0===h?void 0:h.service)?[{applicationNo:e,tenantId:t,waterConnection:s.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:s.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==s||null===(g=s.additionalDetails)||void 0===g||null===(S=g.appDetails)||void 0===S?void 0:S.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,r,a,u,c,s,d,v,m,f,h,g;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(h=f[0])||void 0===h||null===(g=h.taxHeadEstimates)||void 0===g||g.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.taxHeadEstimates,"category");const S=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(a=e.Calculation)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(s=c[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(v=d[0])||void 0===v?void 0:v.taxAmount}];E(pl(e.Calculation[0])),D(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),O(S),b.billDetails=null==e?void 0:e.Calculation,p(b),y(!1)}).catch(e=>{var t,n,l,i,o,r;C({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(l=n.Errors[0])&&void 0!==l&&l.message?d(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(r=o.Errors[0])||void 0===r?void 0:r.code)):d("PT_COMMON_ADD_REBATE_PENALITY")})})}else C({isError:!1,isWarning:!0,key:"warning",message:d("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_PENALTY")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:ui,optionKey:"title",select:e=>k("adhocPenaltyReason",!0,e),selected:(null==b?void 0:b.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:d})),"PT_OTHERS"===(null==b||null===(a=b.adhocPenaltyReason_data)||void 0===a?void 0:a.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>k("adhocPenaltyComment",!1,e)},x={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==b?void 0:b.adhocPenalty)||"",onChange:e=>k("adhocPenalty",!1,e)},x={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_REBATE")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:ci,optionKey:"title",select:e=>k("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:d})),"PT_OTHERS"===(null==b||null===(c=b.adhocRebateReason_data)||void 0===c?void 0:c.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>k("adhocRebateComment",!1,e)},x={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==b?void 0:b.adhocRebate)||"",onChange:e=>k("adhocRebate",!1,e)},x={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),A&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==A?void 0:A.isWarning,error:null==A||!A.isWarning,label:d(null==A?void 0:A.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},di=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:u({},t),display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.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"})))},vi=e=>{let{t:n,userType:i=!1,infoBannerLabel:o="",infoClickLable:r="",infoClickInfoLabel:a="",infoClickInfoLabel1:u=""}=e;i=i||Digit.SessionStorage.get("userType");const c=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:c?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(t.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},n(o))),n(r)+" ",l.createElement(di,{style:{display:"inline",marginBottom:"5px"}})," "+n(a),l.createElement("div",null," "+n(u)))))},pi=e=>{var o,r,a,u,c,s,d;let{wsAdditionalDetails:v}=e;const{t:p}=i.useTranslation(),[m,f]=n.useState(!1),[E,_]=n.useState({}),h=e=>l.createElement("h1",{className:"heading-m"},e.label),g=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(g,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=v&&null!==(o=v.additionalDetails)&&void 0!==o&&o.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=v.additionalDetails.data||{};const n=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),l=n?JSON.parse(n):{};null!=l&&null!==(e=l.value)&&void 0!==e&&e.totalAmount&&(t=null==l?void 0:l.value),_(t),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},p("WS_PAYMENT_VIEW_BREAKUP"))):null,m&&l.createElement(t.Modal,{headerBarMain:l.createElement(h,{label:p("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(S,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},p("WS_APPLICATION_FEE_HEADER")),null==E||null===(r=E.billSlabData)||void 0===r||null===(a=r.FEE)||void 0===a?void 0:a.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},p("WS_SERVICE_FEE_HEADER")),null==E||null===(u=E.billSlabData)||void 0===u||null===(c=u.CHARGES)||void 0===c?void 0:c.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==E||null===(s=E.billSlabData)||void 0===s||null===(d=s.TAX)||void 0===d?void 0:d.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},mi={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:{}},fi=e=>{let{className:t="table",headers:n=[],values:o=[],arrears:r=0}=e;const{t:a}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:mi.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:mi.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:u({},mi.cell,mi.cellLeft,mi.cellHeader)},a("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:u({},mi.cell,n.length==t+1?mi.cellRight:{},mi.cellHeader),key:t},a(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:u({},mi.cell,mi.cellLeft),component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:u({},mi.cell,{textAlign:"left"},n.length==i+1?mi.cellRight:{},{whiteSpace:"pre"}),key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:u({},mi.cell,mi.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:u({},mi.cell,mi.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},r):t==n.length-2?l.createElement("td",{style:u({},mi.cell,{textAlign:"left"}),key:t,numeric:!0},a("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:mi.cell,key:t,numeric:!0})))))))},Ei={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))"}},_i=e=>{var t,o,r;let{bill:a={}}=e;const{t:u}=i.useTranslation();let c={},s=(null==a||null===(t=a.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const d=(null===(o=s)||void 0===o?void 0:o.reduce((e,t,n)=>0===n?e:e+t.amount,0))||0;let v="₹ "+((null==d||null===(r=d.toFixed)||void 0===r?void 0:r.call(d,0))||Number(0).toFixed(0));s.shift(),s.map(e=>{let t=function(e){var t,n,l;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===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);c[((e,t)=>{const n=new Date(e),l=new Date(t);return l.getYear()-n.getYear()!=0?"FY"+(n.getYear()+1900)+"-"+(l.getYear()-100):n.toLocaleDateString()+"-"+l.toLocaleDateString()})(e.fromPeriod,e.toPeriod)]=t});let p={};!c||Object.keys(c).map((e,t)=>{Object.keys(c[e]).map(t=>{p[t]=c[e]&&c[e][t]&&c[e][t].order||0})});let m=[];m=Object.keys(p),m.sort((e,t)=>p[e]-p[t]);const[f,E]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Ei.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(fi,{headers:[...m],values:c,arrears:v}),!f&&l.createElement("div",{style:Ei.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:Ei.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))},hi=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),gi=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(hi,null)),Si=e=>{let{t:n,closeModal:i}=e;console.log(" ----- Renew POP coming "),Digit.Hooks.sv.useCreateDemand();const r=o.useHistory();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement(e=>l.createElement("h1",{className:"heading-m"},e.label),{label:"SV_WANT_TO_EDIT"}),headerBarEnd:l.createElement(gi,{onClick:i}),actionCancelLabel:n("CS_COMMON_BACK"),actionCancelOnSubmit:i,hideSubmit:!0,formId:"modal-action"},l.createElement(t.Card,{style:{boxShadow:"none"}},l.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},l.createElement(t.SubmitBar,{label:n("SV_YES_PROCEED_WITH_APPLICATION"),onSubmit:()=>{r.push("renew-application/info")}}),l.createElement(t.SubmitBar,{label:n("SV_NO_PROCEED_PAYEMNT"),onSubmit:()=>{console.log(" testing coming compilter"),r.push("renew-application/check/makePayment")}})))))};function yi(e){var r,a,u,c,s,d,v,p,m,f,E,h,g,S,y;let{applicationDetails:b,workflowDetails:T,isDataLoading:A,applicationData:C,timelineStatusPrefix:N,showTimeLine:D=!0,statusAttribute:I="status",paymentsList:O,oldValue:w,isInfoLabel:x=!1}=e;const{t:R}=i.useTranslation(),L=(o.useHistory(),o.useLocation()),[P,k]=n.useState(!1),[M,F]=n.useState(null);new URLSearchParams(L.search);let{id:B}=o.useParams();const U=null==b||null===(r=b.applicationData)||void 0===r?void 0:r.owners;function W(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("ownersSequences:- ",U);const[j,H]=n.useState({}),[z,V]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==C?void 0:C.status)||z.loading||z.loaded||z.canLoad||V({loading:!1,loaded:!1,canLoad:!0}),null==z||!z.canLoad||z.loading||z.loaded||(V({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){n(r),l({loading:!1,loaded:!0,canLoad:!0})}let r={};const a=function(n){if((null==i||null===(n=i.Assessments)||void 0===n?void 0:n.length)>0)return Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){r=e})}();return a&&a.then?a.then(o):o()})}catch(e){return Promise.reject(e)}}((null==C?void 0:C.tenantId)||tenantId,null==C?void 0:C.propertyId,H,V));const K=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+t.getFullYear()},G=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:K(null==C||null===(i=C.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==C?void 0:C.channel)||""};return l.createElement(ii,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,r,a,u,c,s,d,v,p,m,f,E,h,g,S,y,T,A;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==b?void 0:b.tenantId,businessIds:null==b?void 0:b.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber"),n}}},N=n[t-1],D={date:null==e||null===(a=e.auditDetails)||void 0===a?void 0:a.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.name,mobileNumber:(null==C||null===(s=C.processInstance)||void 0===s||null===(d=s.assignes)||void 0===d||null===(v=d[0])||void 0===v?void 0:v.uuid)===(null==e||null===(p=e.assignes)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.uuid)&&null!=C&&null!==(f=C.processInstance)&&void 0!==f&&null!==(E=f.assignes)&&void 0!==E&&null!==(h=E[0])&&void 0!==h&&h.mobileNumber?null==C||null===(g=C.processInstance)||void 0===g||null===(S=g.assignes)||void 0===S||null===(y=S[0])||void 0===y?void 0:y.mobileNumber:null==e||null===(T=e.assignes)||void 0===T||null===(A=T[0])||void 0===A?void 0:A.mobileNumber,comment:R(null==e?void 0:e.comment),wfComment:N?N.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(ii,{data:D,OpenImage:W,privacy:i})}{var N,D,I,O,w;const t={date:K(null==C||null===(N=C.auditDetails)||void 0===N?void 0:N.lastModifiedTime),name:null==e||null===(D=e.assignes)||void 0===D||null===(I=D[0])||void 0===I?void 0:I.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(O=e.assignes)||void 0===O||null===(w=O[0])||void 0===w?void 0:w.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(ii,{data:t,OpenImage:W})}},q=(e,t)=>e?t?e:R(e):R("NA"),Y=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),X=window.location.href.includes("employee/noc"),$=window.location.href.includes("employee/obps"),Q=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||Y?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),Z=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?q(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?q(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):R("N/A"),[J,ee]=n.useState(!1);return l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},x?l.createElement(vi,{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==b||null===(a=b.applicationDetails)||void 0===a?void 0:a.map((e,n)=>{var i,r,a,u,c,s,d,v,p,m,f,E,_,h,g,S,y,A,C,N,D,I,x,L,P,M,U,W,H,z,V,K,G,q,J,ee,te,ne,le;return l.createElement(l.Fragment,{key:n},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:Y?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==n||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==n&&Y?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},X?""+R(e.title):R(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},R(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse",borderCollapse:"collapse",border:"1px solid black"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"5px",border:"1px solid black"}},R(e)))),null==e?void 0:e.tableRows.map((n,i)=>l.createElement("tr",null,n.map((n,r)=>Array.isArray(n)&&n.length>1&&!0===e.isMaintenance?l.createElement("td",{style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"},key:r},l.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"5px"}},n.map((e,n)=>l.createElement("a",{key:n,onClick:()=>{Digit.UploadServices.Filefetch([e.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var t,n,l;console.log("Response of file:",e);const i=null==e||null===(t=e.data)||void 0===t||null===(n=t.fileStoreIds)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.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"}},l.createElement(t.PDFSvg,{style:{width:"25px",height:"25px"}}))))):l.createElement("td",{key:r,style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"}},console.log("Comming Maintainaince data row:- ",n.data),n&&!0===n.editButton?l.createElement("span",{style:{display:"inline-flex",gap:"10px",alignItems:"center"}},l.createElement(o.Link,{to:{pathname:"/digit-ui/employee/asset/assetservice/maintenance-edit/"+B,state:{data:n.data}}},l.createElement("button",null," ",l.createElement(t.EditIcon,null)," ")),l.createElement("div",{key:i,onClick:()=>(F(n.data),void k(!0)),style:{cursor:"pointer"}},l.createElement(t.ViewsIcon,null))):R(n)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||Y?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(i=e.values)||void 0===i?void 0:i.map((n,i)=>{var r,a,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:R(n.title),label:R(n.title),text:l.createElement("img",{src:R(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:R(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},R(null==n?void 0:n.title)))):X||$?""+R(n.title):R(n.title),text:l.createElement("div",null,l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:i===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:Q(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+R(""+n.title),privacy:null==n?void 0:n.privacy,text:null!=n&&n.oldValue?null==n?void 0:n.oldValue:null!=n&&n.value?null==n?void 0:n.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(t.Row,{key:R(n.title),label:R(n.title),text:Z(n),last:i===(null==e||null===(r=e.values)||void 0===r?void 0:r.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:Q(),labelStyle:{wordBreak:"break-all",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isBold?"italic":"normal"},textStyle:{wordBreak:"break-all",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isBold?"italic":"normal"}}),"PT_TOTAL_DUES"===n.title?l.createElement(_i,{bill:null===(a=j.Bill)||void 0===a?void 0:a[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.inspectionReport)&&l.createElement(ti,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:O}),(null==b||null===(a=b.applicationData)||void 0===a||null===(u=a.additionalDetails)||void 0===u||null===(c=u.fieldinspection_pending)||void 0===c?void 0:c.length)>0&&(null==e||null===(s=e.additionalDetails)||void 0===s?void 0:s.fiReport)&&l.createElement(ql,{fiReport:null==b||null===(d=b.applicationData)||void 0===d||null===(v=d.additionalDetails)||void 0===v?void 0:v.fieldinspection_pending}),(null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.floors)&&l.createElement(Jl,{floors:null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.floors}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.owners)&&l.createElement(ei,{owners:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units)&&l.createElement(ri,{units:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.accessories)&&l.createElement(oi,{units:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.accessories}),(null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.permissions)&&(null==T||null===(A=T.data)||void 0===A||null===(C=A.nextActions)||void 0===C?void 0:C.length)>0&&l.createElement($l,{applicationData:null==b?void 0:b.applicationData,t:R,permissions:null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.permissions}),(null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.obpsDocuments)&&l.createElement(Kl,{t:R,applicationData:null==b?void 0:b.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:T}),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&l.createElement(Xl,{t:R,isNoc:!0,NOCdata:e.values,applicationData:null==b?void 0:b.applicationData,docs:e.additionalDetails.noc,noc:null===(x=e.additionalDetails)||void 0===x?void 0:x.data,bpaActionsDetails:T}),(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.scruntinyDetails)&&l.createElement(ti,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.buildingExtractionDetails)&&l.createElement(ti,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.subOccupancyTableDetails)&&l.createElement(ni,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==b?void 0:b.applicationData}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl)&&l.createElement(Vl,{documents:null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documentsWithUrl}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documents)&&l.createElement(Ql,{documents:null==e||null===(z=e.additionalDetails)||void 0===z?void 0:z.documents}),(null==e||null===(V=e.additionalDetails)||void 0===V?void 0:V.taxHeadEstimatesCalculation)&&l.createElement(Zl,{taxHeadEstimatesCalculation:null==e||null===(K=e.additionalDetails)||void 0===K?void 0:K.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(ai,{wsAdditionalDetails:e,oldValue:w}),(null==e||null===(G=e.additionalDetails)||void 0===G?void 0:G.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(o.Link,{to:null==e||null===(q=e.additionalDetails)||void 0===q||null===(J=q.redirectUrl)||void 0===J?void 0:J.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(ee=e.additionalDetails)||void 0===ee||null===(te=ee.redirectUrl)||void 0===te?void 0:te.title))),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&l.createElement(si,{wsAdditionalDetails:e,workflowDetails:T}),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement(pi,{wsAdditionalDetails:e,workflowDetails:T}))}),D&&(null==T||null===(u=T.data)||void 0===u||null===(c=u.timeline)||void 0===c?void 0:c.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==T?void 0:T.isLoading)||A)&&l.createElement(t.Loader,null),!(null!=T&&T.isLoading)&&!A&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},R("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=T&&null!==(s=T.data)&&void 0!==s&&s.timeline&&1===(null==T||null===(d=T.data)||void 0===d||null===(v=d.timeline)||void 0===v?void 0:v.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:R(""+N+(null==T||null===(p=T.data)||void 0===p||null===(m=p.timeline[0])||void 0===m?void 0:m.state)),customChild:G(null==T||null===(f=T.data)||void 0===f?void 0:f.timeline[0],null==T||null===(E=T.data)||void 0===E?void 0:E.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==T||null===(h=T.data)||void 0===h?void 0:h.timeline)&&(null==T||null===(g=T.data)||void 0===g?void 0:g.timeline.slice(0,J?null==T?void 0:T.data.timeline.length:2).map((e,n,i)=>{var o;let r="";var a,u,c,s,d,v;return window.location.href.includes("/obps/")&&(r=null!=T&&null!==(a=T.data)&&void 0!==a&&null!==(u=a.timeline[n-1])&&void 0!==u&&null!==(c=u.state)&&void 0!==c&&c.includes("BACK_FROM")||null!=T&&null!==(s=T.data)&&void 0!==s&&null!==(d=s.timeline[n-1])&&void 0!==d&&null!==(v=d.state)&&void 0!==v&&v.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==n?"":"_DONE"),l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,info:e.comment,label:R(""+N+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[I])+r),customChild:G(e,n,null==T||null===(o=T.data)||void 0===o?void 0:o.timeline)}))}))),(null==T||null===(S=T.data)||void 0===S||null===(y=S.timeline)||void 0===y?void 0:y.length)>2&&l.createElement(t.LinkButton,{label:R(J?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{ee(e=>!e)}})))),l.createElement("div",null,P&&l.createElement(Si,{t:R,closeModal:()=>setRnewButton(!1),actionCancelOnSubmit:()=>setRnewButton(!1),application:application})))}function bi(e){var n,i,o,r,a,u,c,s,d,v,p,m,f,E,_,h,g,S;let{t:y,showToast:b,closeToast:T,businessService:A}=e;if(null!=A&&A.includes("NewTL")||null!=A&&A.includes("TL")||null!=A&&A.includes("EDITRENEWAL")){var C;let e="";switch(null==b||null===(C=b.action)||void 0===C?void 0:C.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:y("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:y("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(o=b.error)||void 0===o?void 0:o.message:y("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:y("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:y("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==b?void 0:b.key)?null==b||null===(u=b.error)||void 0===u?void 0:u.message:y("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(c=b.error)||void 0===c?void 0:c.message:y("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(s=b.error)||void 0===s?void 0:s.message:y("ES_"+A+"_"+(null==b||null===(d=b.action)||void 0===d?void 0:d.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:e,onClose:T}))}if(null!=A&&A.includes("BPA")||null!=A&&A.includes("BPA_LOW")||null!=A&&A.includes("BPA_OC")){var N;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=A&&A.includes("BPA_OC")?y(e[1]):y(e[0]),n};let n="";switch(null==b||null===(N=b.action)||void 0===N?void 0:N.action){case"REVOCATE":n="error"===(null==b?void 0:b.key)?null==b||null===(v=b.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":n="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==b?void 0:b.key)?null==b||null===(E=b.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==b?void 0:b.key)?null==b||null===(h=b.error)||void 0===h?void 0:h.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==b?void 0:b.key)?null==b||null===(g=b.error)||void 0===g?void 0:g.message:y("ES_"+A+"_"+(null==b||null===(S=b.action)||void 0===S?void 0:S.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:T}))}{var D,I;const e="error"===(null==b?void 0:b.key)?null==b||null===(D=b.error)||void 0===D?void 0:D.message:"ES_"+A+"_"+(null==b||null===(I=b.action)||void 0===I?void 0:I.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:y(e),onClose:T}))}}function Ti(e){var o,r,a,c,s,d,v,p,m,f,E,_,h,g,S,y,b,T,A;let{workflowDetails:C,displayMenu:N,onActionSelect:D,setDisplayMenu:I,businessService:O,forcedActionPrefix:w,ActionBarStyle:x={},MenuStyle:R={},isAction:L,applicationDetails:P}=e;const{t:k}=i.useTranslation();let M=Digit.UserService.getUser();const F=n.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};M=null==t?void 0:t.value}const B=null===(o=M)||void 0===o||null===(r=o.info)||void 0===r||null===(a=r.roles)||void 0===a?void 0:a.map(e=>e.code);let U=!1,W=!1,j=(null==C||null===(c=C.data)||void 0===c||null===(s=c.actionState)||void 0===s||null===(d=s.nextActions)||void 0===d?void 0:d.filter(e=>(null==B?void 0:B.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==C||null===(v=C.data)||void 0===v||null===(p=v.nextActions)||void 0===p?void 0:p.filter(e=>(null==B?void 0:B.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(F,()=>{I(!1)},N),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==j?void 0:j.length)||null!=j&&null!==(m=j[0])&&void 0!==m&&null!==(f=m.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==j?void 0:j.length)?(W=!1,U=!0):(null==j?void 0:j.length)>0&&(W=!0,U=!1);const H=Digit.SessionStorage.get("User"),z=null==H||null===(E=H.info)||void 0===E?void 0:E.uuid,V=null==P||null===(_=P.applicationData)||void 0===_||null===(h=_.auditDetails)||void 0===h?void 0:h.lastModifiedBy;return l.createElement(l.Fragment,null,!(null!=C&&C.isLoading)&&W&&!U&&!L&&l.createElement(t.ActionBar,{style:u({},x)},N&&(null!=C&&null!==(g=C.data)&&void 0!==g&&null!==(S=g.actionState)&&void 0!==S&&S.nextActions||null!=C&&null!==(y=C.data)&&void 0!==y&&y.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:w||"WF_EMPLOYEE_"+(null==O?void 0:O.toUpperCase()),options:j,optionKey:"action",t:k,onSelect:D,style:R}):null,"ewst"===O?V===z||null==V?l.createElement(t.SubmitBar,{ref:F,label:k("WF_TAKE_ACTION"),onSubmit:()=>I(!N)}):l.createElement(t.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+k("EW_ALERT_ANOTHER_VENDOR")):l.createElement(t.SubmitBar,{ref:F,label:k("WF_TAKE_ACTION"),onSubmit:()=>I(!N)})),!(null!=C&&C.isLoading)&&!W&&U&&!L&&l.createElement(t.ActionBar,{style:u({},x)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==j||null===(b=j[0])||void 0===b?void 0:b.action,value:null==j||null===(T=j[0])||void 0===T?void 0:T.action,onClick:e=>{D((null==j?void 0:j[0])||{})}},k((w||"WF_EMPLOYEE_"+(null==O?void 0:O.toUpperCase()))+"_"+(null==j||null===(A=j[0])||void 0===A?void 0:A.action)))))}const Ai=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),Ci=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ai,null));function Ni(e){let{action:n,closeWarningPopup:o}=e;const{t:r}=i.useTranslation(),a=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},r("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(Ci,{onClick:()=>{o()}}),hideSubmit:!0,isDisabled:!1,popupStyles:a?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,r("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",r("PT_DUE_WARNING_MSG2"))),l.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+r("PT_AMOUNT_DUE"),text:"₹"+r(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:r("ES_PT_COMMON_CANCEL"),onSubmit:o,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:r("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==n||null===(e=n.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const Di=e=>{var a;const c=Digit.ULBService.getCurrentTenantId(),s=Digit.ULBService.getStateId(),{t:d}=i.useTranslation(),v=o.useHistory();let{id:p}=o.useParams();const[m,f]=n.useState(!1),[E,_]=n.useState(null),[h,g]=n.useState(!1),[S,y]=n.useState(!1),[b,T]=n.useState(!1),{applicationDetails:A,showToast:C,setShowToast:N,isLoading:D,isDataLoading:I,applicationData:O,mutate:w,nocMutation:x,workflowDetails:R,id:L,businessService:P,closeToast:k,moduleCode:M,timelineStatusPrefix:F,forcedActionPrefix:B,statusAttribute:U,ActionBarStyle:W,MenuStyle:j,paymentsList:H,showTimeLine:z=!0,oldValue:V,isInfoLabel:K=!1,clearDataDetails:G,isAction:q=!1}=e;n.useEffect(()=>{C&&R.revalidate()},[C]);const Y=r.useQueryClient(),X=()=>{_(null),g(!1)};return D||S?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,D?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(yi,{applicationDetails:A,id:L,workflowDetails:R,isDataLoading:I,applicationData:O,businessService:P,timelineStatusPrefix:F,statusAttribute:U,paymentsList:H,showTimeLine:z,oldValue:V,isInfoLabel:K}),h?l.createElement(zl,{t:d,action:E,tenantId:c,state:s,id:p,applicationDetails:A,applicationData:null==A?void 0:A.applicationData,closeModal:X,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,r,a,c,s,p,m,f,_,h,g){if(0!=(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(r=o.comment)||void 0===r?void 0:r.length)&&0!=(null==e||null===(a=e.Licenses)||void 0===a||null===(c=a[0])||void 0===c||null===(s=c.comment)||void 0===s?void 0:s.length)&&0!=(null==e||null===(p=e.WaterConnection)||void 0===p||null===(m=p.comment)||void 0===m?void 0:m.length)&&0!=(null==e||null===(f=e.SewerageConnection)||void 0===f||null===(_=f.comment)||void 0===_?void 0:_.length)&&0!=(null==e||null===(h=e.BPA)||void 0===h||null===(g=h.comment)||void 0===g?void 0:g.length)){function S(t){if(l)return t;w&&(y(!0),w(e,{onError:(e,t)=>{y(!1),N({key:"error",error:e}),setTimeout(k,5e3)},onSuccess:(e,t)=>{var l,i,o,r,a,u,c,s,p,m,f,_;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),y(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=E,v.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=E,v.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&v.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(r=e.Amendments)||void 0===r?void 0:r.length)>0?null!=t&&null!==(a=t.AmendmentUpdate)&&void 0!==a&&null!==(u=a.workflow)&&void 0!==u&&u.action.includes("SEND_BACK")?N({key:"success",label:d("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(s=c.workflow)&&void 0!==s&&s.action.includes("RE-SUBMIT")?N({key:"success",label:d("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(p=t.AmendmentUpdate)&&void 0!==p&&null!==(m=p.workflow)&&void 0!==m&&m.action.includes("APPROVE")?N({key:"success",label:d("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(f=t.AmendmentUpdate)&&void 0!==f&&null!==(_=f.workflow)&&void 0!==_&&_.action.includes("REJECT")&&N({key:"success",label:d("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(N({key:"success",action:E}),G&&setTimeout(G,3e3),setTimeout(k,5e3),Y.clear(),Y.refetchQueries("APPLICATION_SEARCH"))}})),X()}y(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(u({},e)));const i=function(){if(!1!==t&&x){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==x?void 0:x.mutateAsync(e)),i=Ye(function(){return y(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,i,o,r,a,u,c,s,v,p,m;y(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?d(null==e||null===(r=e.response)||void 0===r||null===(a=r.data)||void 0===a||null===(u=a.Errors)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.code):(null==e||null===(s=e.response)||void 0===s||null===(v=s.data)||void 0===v||null===(p=v.Errors)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.message)||e;X(),N({key:"error",error:{message:f}}),setTimeout(k,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(S):S(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==R||null===(a=R.data)||void 0===a?void 0:a.timeline,businessService:P,workflowDetails:R,moduleCode:M}):null,b?l.createElement(Ni,{action:E,workflowDetails:R,businessService:P,isWarningPop:b,closeWarningPopup:()=>{T(!1)}}):null,l.createElement(bi,{t:d,showToast:C,closeToast:k,businessService:P}),l.createElement(Ti,{isAction:q,workflowDetails:R,displayMenu:m,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)N({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(k,5e3);else if(null!=e&&e.isWarningPopUp)T(!0);else if(null!=e&&e.redirectionUrll){var t,n,l,i,o;if("ACTIVATE_CONNECTION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action))v.push(""+(null==e||null===(l=e.redirectionUrll)||void 0===l?void 0:l.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===(n=e.redirectionUrll)||void 0===n?void 0:n.action)){var r,a;v.push(""+(null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.pathname),{data:null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.state})}else{var c;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.pathname))}}else if(null!=e&&e.redirectionUrl){var s,d;v.push({pathname:null===(s=e.redirectionUrl)||void 0===s?void 0:s.pathname,state:u({},null===(d=e.redirectionUrl)||void 0===d?void 0:d.state)})}else g(!0);_(e),f(!1)},setDisplayMenu:f,businessService:P,forcedActionPrefix:B,ActionBarStyle:W,MenuStyle:j,applicationDetails:A})))},Ii=()=>l.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"},l.createElement("polyline",{points:"20 6 9 17 4 12"})),Oi=()=>l.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l.createElement("circle",{cx:"12",cy:"12",r:"10"}),l.createElement("polyline",{className:"clock-hands2",points:"12 6 12 12 16 14"})),wi=e=>{var n;let{workflowDetails:o}=e;const{t:r}=i.useTranslation();if(null==o||null===(n=o.data)||void 0===n||!n.timeline)return null;const a=o.data.timeline;return l.createElement(t.Card,{className:"workflow-timeline-card2 digit-form-composer",style:{background:"#fafafa",padding:"16px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"16px",fontWeight:"700",color:"#374151"}},r("WORKFLOW_TIMELINE")),l.createElement("div",{className:"timeline-container2"},a.map((e,t)=>{var n,i,o,u;const c=((e,t)=>0===t?"current2":"completed2")(0,t),s=t!==a.length-1&&a.length>1;return l.createElement("div",{key:t,className:"timeline-item2 "+c},l.createElement("div",{className:"timeline-marker2"},l.createElement("div",{className:"timeline-circle2"},l.createElement("completed2"===c?Ii:Oi,null)),s&&l.createElement("div",{className:"timeline-line2"})),l.createElement("div",{className:"timeline-content2"},l.createElement("div",{className:"timeline-header2"},l.createElement("div",{className:"timeline-title2"},r("WF_"+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e.state))),l.createElement("span",{className:"timeline-date2"},(e=>{if(!e)return"N/A";const t=new Date(e);return t.getDate().toString().padStart(2,"0")+"/"+(t.getMonth()+1).toString().padStart(2,"0")+"/"+t.getFullYear().toString().slice(-2)+" "+t.getHours().toString().padStart(2,"0")+":"+t.getMinutes().toString().padStart(2,"0")})(null==e||null===(n=e.auditDetails)||void 0===n?void 0:n.lastModified))),l.createElement("div",{className:"timeline-body2"},l.createElement("div",{className:"timeline-status-tag2 status-"+c},r(e.status)),(null==e?void 0:e.comment)&&l.createElement("div",{className:"timeline-comment2"},r(e.comment))),(null==e||null===(i=e.assignes)||void 0===i?void 0:i.length)>0&&l.createElement("div",{className:"timeline-footer2"},l.createElement("span",null,r("ES_COMMON_ASSIGNED_TO"),": ",l.createElement("strong",null,null==e||null===(o=e.assignes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.name)))))})))};var xi=l.memo(()=>{var e,r,a,u;const{t:c}=i.useTranslation(),s=(Digit.Hooks.useStore.getInitData(),Digit.ULBService.getCurrentTenantId()),{id:d}=o.useParams(),[v,p]=n.useState(null),[m,f]=n.useState({}),[E,_]=n.useState(!1),[h,g]=n.useState("watertanker"),S=null==d?void 0:d.startsWith("WT"),y=null==d?void 0:d.startsWith("TP"),b=S?"watertanker":y?"treePruning":"mobileToilet",T=Digit.UserService.getUser().info;sessionStorage.setItem(S?"wt":y?"tp":"mt",d);const{isLoading:A,data:C}=S?Digit.Hooks.wt.useWTApplicationDetail(c,s,d):y?Digit.Hooks.wt.useTPApplicationDetail(c,s,d):Digit.Hooks.wt.useMTApplicationDetail(c,s,d),{mutate:N}=S?Digit.Hooks.wt.useWTApplicationAction(s):y?Digit.Hooks.wt.useTPApplicationAction(s):Digit.Hooks.wt.useMTApplicationAction(s);let D=Digit.Hooks.useWorkflowDetails({tenantId:(null==C||null===(e=C.applicationData)||void 0===e?void 0:e.tenantId)||s,id:null==C||null===(r=C.applicationData)||void 0===r||null===(a=r.applicationData)||void 0===a?void 0:a.bookingNo,moduleCode:b,role:S?["WT_CEMP"]:y?["TP_CEMP"]:["MT_CEMP"]});n.useEffect(()=>{C&&f(We.cloneDeep(C))},[C]),n.useEffect(()=>{var e,t,n,l,i;null!=D&&null!==(e=D.data)&&void 0!==e&&e.applicationBusinessService&&!("watertanker"===(null==D||null===(t=D.data)||void 0===t?void 0:t.applicationBusinessService)&&"watertanker"===b||"mobileToilet"===(null==D||null===(n=D.data)||void 0===n?void 0:n.applicationBusinessService)&&"mobileToilet"===b||"treePruning"===(null==D||null===(l=D.data)||void 0===l?void 0:l.applicationBusinessService)&&"treePruning"===b)&&g(null==D||null===(i=D.data)||void 0===i?void 0:i.applicationBusinessService)},[D.data]);const[I,O]=n.useState(!0);let w=[];return l.createElement("div",{style:{padding:"CITIZEN"===(null==T?void 0:T.type)?"0 15px":""}},l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},c("BOOKING_DETAILS")),l.createElement("div",{style:{zIndex:"10",display:"flex",flexDirection:"row-reverse",alignItems:"center",marginTop:"-25px"}},w&&w.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper employee-mulitlink-main-div",onHeadClick:()=>_(!E),displayOptions:E,options:w,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"}))),l.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"20px"}},l.createElement("div",{style:{flex:"0 0 25%",minWidth:"250px"}},l.createElement("div",{style:{}},l.createElement(wi,{workflowDetails:D}))),l.createElement("div",{style:{flex:"1"}},l.createElement(Di,{applicationDetails:null==m?void 0:m.applicationData,isLoading:A,isDataLoading:A,applicationData:null==m||null===(u=m.applicationData)||void 0===u?void 0:u.applicationData,mutate:N,workflowDetails:D,businessService:b,moduleCode:"request-service",showToast:v,setShowToast:p,closeToast:()=>{p(null)},timelineStatusPrefix:"",forcedActionPrefix:"RS",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"},showTimeLine:!1}))))});const Ri=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),Li=e=>{let{onClick:t}=e;return l.createElement("div",{className:"icon-bg-secondary",onClick:t},l.createElement(Ri,null))},Pi=e=>l.createElement("h1",{className:"heading-m"},e.t("SERVICE_TYPE")),ki=e=>e.substr(0,1).toUpperCase()+e.substr(1),Mi=function(e,t,n){try{var l,i,o,r,a,u,c,s,d,v,p,E,_,h;return Promise.resolve({t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(g=n("ULBGRADE_"+(null==t||null===(l=t.city)||void 0===l?void 0:l.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),g.toLowerCase().split(" ").map(ki).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:n("MT_ACKNOWLEDGEMENT"),details:[{title:n("MT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:n("MT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:n("MT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:n("MT_ALT_MOBILE_NUMBER"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.alternateNumber},{title:n("MT_EMAIL_ID"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.emailId}].filter(e=>e.value)},{title:n("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:n("WT_PINCODE"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.pincode},{title:n("WT_CITY"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.city},{title:n("WT_LOCALITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.locality},{title:n("WT_STREET_NAME"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.streetName},{title:n("WT_DOOR_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.doorNo},{title:n("WT_HOUSE_NO"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.houseNo},{title:n("WT_ADDRESS_LINE1"),value:null==e||null===(E=e.address)||void 0===E?void 0:E.addressLine1},{title:n("WT_ADDRESS_LINE2"),value:null==e||null===(_=e.address)||void 0===_?void 0:_.addressLine2},{title:n("WT_LANDMARK"),value:null==e||null===(h=e.address)||void 0===h?void 0:h.landmark}].filter(e=>e.value)},{title:n("MT_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:n("MT_NUMBER_OF_MOBILE_TOILETS"),value:null==e?void 0:e.noOfMobileToilet},{title:n("MT_DELIVERY_FROM_DATE"),value:f(null==e?void 0:e.deliveryFromDate)},{title:n("MT_DELIVERY_TO_DATE"),value:f(null==e?void 0:e.deliveryToDate)},{title:n("MT_REQUIREMENT_TIME"),value:m(null==e?void 0:e.deliveryFromTime)+" - "+m(null==e?void 0:e.deliveryToTime)},{title:n("MT_SPECIAL_REQUEST"),value:null==e?void 0:e.description}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var g},Fi=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")},Bi={padding:"4px 0px",justifyContent:"space-between"},Ui=e=>{var n,i;return console.log("BannerPicker",e),l.createElement(t.Banner,{message:Fi(e),applicationNumber:null===(n=e.data)||void 0===n||null===(i=n.mobileToiletBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("MT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},Wi=e=>e.substr(0,1).toUpperCase()+e.substr(1),ji=function(e,t,n){try{var l,i,o,r,a,u,c,s,d,v,p,m,f,E;return Promise.resolve({t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(_=n("ULBGRADE_"+(null==t||null===(l=t.city)||void 0===l?void 0:l.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),_.toLowerCase().split(" ").map(Wi).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:n("TP_ACKNOWLEDGEMENT"),details:[{title:n("MT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:n("MT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:n("MT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:n("MT_ALT_MOBILE_NUMBER"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.alternateNumber},{title:n("MT_EMAIL_ID"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.emailId}].filter(e=>e.value)},{title:n("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:n("WT_PINCODE"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.pincode},{title:n("WT_CITY"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.city},{title:n("WT_LOCALITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.locality},{title:n("WT_STREET_NAME"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.streetName},{title:n("WT_DOOR_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.doorNo},{title:n("WT_HOUSE_NO"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.houseNo},{title:n("WT_ADDRESS_LINE1"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.addressLine1},{title:n("WT_ADDRESS_LINE2"),value:null==e||null===(f=e.address)||void 0===f?void 0:f.addressLine2},{title:n("WT_LANDMARK"),value:null==e||null===(E=e.address)||void 0===E?void 0:E.landmark}].filter(e=>e.value)},{title:n("TP_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:n("REASON_FOR_PRUNING"),value:n(null==e?void 0:e.reasonForPruning)},{title:n("LATITUDE_GEOTAG"),value:null==e?void 0:e.latitude},{title:n("LONGITUDE_GEOTAG"),value:null==e?void 0:e.longitude}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var _},Hi=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")},zi={padding:"4px 0px",justifyContent:"space-between"},Vi=e=>{var n,i;return console.log("BannerPicker",e),l.createElement(t.Banner,{message:Hi(e),applicationNumber:null===(n=e.data)||void 0===n||null===(i=n.treePruningBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("TP_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},Ki=["tenantId","payments"],Gi=["tenantId","payments"],qi=e=>{let{stateCode:t,userType:i,tenants:r}=e;const{path:a,url:u}=o.useRouteMatch(),c=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"WT",language:c}),Digit.SessionStorage.set("WT_TENANTS",r),n.useEffect(()=>"employee"===i&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===i?l.createElement(K,{path:a,url:u,userType:i}):l.createElement(y,null)},Yi=e=>{let{matchPath:o}=e;const{t:r}=i.useTranslation(),[a,u,c]=Digit.Hooks.useSessionStorage("WT",{});n.useEffect(()=>{c()},[]);const s=[{link:o+"/wt",i18nKey:r("WT_REAQUEST_TANKER")},{link:o+"/wt/status",i18nKey:r("WT_VIEW_APPLICATIONS")}];return l.createElement(t.CitizenHomeCard,{header:r("WATER_TANKER_SERVICE"),links:s,Icon:()=>l.createElement(t.PTIcon,{className:"fill-path-primary-main"})})},Xi={ApplicantDetails:t.ApplicantDetails,AddressDetails:t.AddressDetails,WTCreate:()=>{var e,t,n,a,c,d,p,m;const f=r.useQueryClient(),E=o.useRouteMatch(),{t:_}=i.useTranslation(),{pathname:h}=o.useLocation(),g=o.useHistory();let S=[];const[y,b,T]=Digit.Hooks.useSessionStorage("WT_Create",{});function A(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=y.owners||[];n[l]=t,b(u({},y,{[e]:[...n]}))}else if("units"===e){let e=y.units||[];e=t,b(u({},y,{units:e}))}else b(u({},y,{[e]:u({},y[e],t)}));((e,t,n,l)=>{let i,o=h.split("/").pop(),r=o.charAt(o.length-1),a=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=h.slice(0,-3),o=o.split("/").pop(),a=!0):(o=h.slice(0,-2),o=o.split("/").pop(),a=!0):a=!1,isNaN(r)||(a=!0);let{nextStep:u={}}=S.find(e=>e.route===o),c=g.push;if(e&&(c=g.replace),n&&(u=l),"request-details"===u){var s,d;const e=null==y||null===(s=y.serviceType)||void 0===s||null===(d=s.serviceType)||void 0===d?void 0:d.code;"MobileToilet"===e?u="toiletRequest-details":"TREE_PRUNING"===e&&(u="treePruningRequest-details")}if(null===u)return c(E.path+"/check");i=isNaN(u.split("/").pop())&&a&&"map"!==u?E.path+"/"+u+"/"+t:E.path+"/"+u,c(i)})(n,l,i,e)}y.serviceType&&0!==Object.keys(y.serviceType).length||!h.includes("employee")||(h.includes("mt")?(console.log("MT Create"),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"}}})),y&&Object.keys(y).length>0&&window.location.href.includes("/service-type")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(T(),f.invalidateQueries("WT_Create"));const C=()=>{T(),f.invalidateQueries("WT_Create")};s.forEach(e=>{S=S.concat(e.body.filter(e=>!e.hideInCitizen))}),S.indexRoute=h.includes("citizen")?"service-type":"info";const N=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent("WTCheckPage"),D=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("WTAcknowledgement"),I=null===(c=Digit)||void 0===c||null===(d=c.ComponentRegistryService)||void 0===d?void 0:d.getComponent("MTAcknowledgement"),O=null===(p=Digit)||void 0===p||null===(m=p.ComponentRegistryService)||void 0===m?void 0:m.getComponent("TPAcknowledgement");return l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"flex",width:"100%",gap:"24px"}},!h.includes("/info")&&l.createElement("div",{style:{flex:"0 0 280px",background:"#fff",padding:"20px 0",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",borderRadius:"4px"}},l.createElement(v,{config:S})),l.createElement("div",{style:{flex:"1",overflowY:"auto"}},l.createElement(o.Switch,null,S.map((e,t)=>{const{component:n,texts:i,inputs:r,key:a,additionaFields:u}=e,c="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(o.Route,{path:E.path+"/"+e.route,key:t},l.createElement(c,{config:{texts:i,inputs:r,key:a,additionaFields:u},onSelect:A,t:_,formData:y}))}),l.createElement(o.Route,{path:E.path+"/check"},l.createElement(N,{onSubmit:function(){try{var e,t,n,l,i,o;return"WT"===(null==y||null===(e=y.serviceType)||void 0===e||null===(t=e.serviceType)||void 0===t?void 0:t.code)&&g.push(E.path+"/wt-acknowledgement"),"MobileToilet"===(null==y||null===(n=y.serviceType)||void 0===n||null===(l=n.serviceType)||void 0===l?void 0:l.code)&&g.push(E.path+"/mt-acknowledgement"),"TREE_PRUNING"===(null==y||null===(i=y.serviceType)||void 0===i||null===(o=i.serviceType)||void 0===o?void 0:o.code)&&g.push(E.path+"/tp-acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:y})),l.createElement(o.Route,{path:E.path+"/wt-acknowledgement"},l.createElement(D,{data:y,onSuccess:C})),l.createElement(o.Route,{path:E.path+"/mt-acknowledgement"},l.createElement(I,{data:y,onSuccess:C})),l.createElement(o.Route,{path:E.path+"/tp-acknowledgement"},l.createElement(O,{data:y,onSuccess:C})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:E.path+"/"+S.indexRoute}))))))},InfoPage:e=>{var i,o;let{t:r,onSelect:a,formData:c,config:s}=e;const[d,v]=n.useState(""),[p,m]=n.useState(!1),[f,E]=n.useState(!1),_={MobileToilet:"MT_MODULE",WT:"WT_MODULE",TREE_PRUNING:"TREE_PRUNING"}[null==c||null===(i=c.serviceType)||void 0===i||null===(o=i.serviceType)||void 0===o?void 0:o.code],h=()=>{const e=u({},c.infodetails||{},{existingDataSet:d});a(s.key,u({},c[s.key],e))};return l.createElement(l.Fragment,null,l.createElement(t.Card,null,_&&l.createElement(t.CardHeader,null,r(_)),l.createElement("div",null,l.createElement(t.CardText,{className:"primaryColor"},r("SV_DOC_REQ_SCREEN_SUB_HEADER")),l.createElement(t.CardText,{className:"primaryColor"},r("SV_DOC_REQ_SCREEN_TEXT")),l.createElement(t.CardText,{className:"primaryColor"},r("SV_DOC_REQ_SCREEN_SUB_TEXT"))),l.createElement("span",null,l.createElement(t.SubmitBar,{label:r("COMMON_NEXT"),onSubmit:()=>{f?m(!0):h()}}))),p&&l.createElement(N,{t:r,closeModal:()=>m(!1),actionCancelOnSubmit:()=>m(!1),onSubmit:()=>{h(),m(!1)},setExistingDataSet:v}))},RequestDetails:e=>{var i,o,r,a,c,s,d,v;let{t:p,config:m,onSelect:f,formData:E}=e;const _=Digit.UserService.getUser().info;let h={};const[g,S]=n.useState((null==E||null===(i=E.requestDetails)||void 0===i?void 0:i.tankerType)||""),[y,b]=n.useState((null==E||null===(o=E.requestDetails)||void 0===o?void 0:o.tankerQuantity)||""),[T,A]=n.useState((null==E||null===(r=E.requestDetails)||void 0===r?void 0:r.waterQuantity)||""),[C,N]=n.useState((null==E||null===(a=E.requestDetails)||void 0===a?void 0:a.waterType)||""),[D,I]=n.useState((null==E||null===(c=E.requestDetails)||void 0===c?void 0:c.deliveryDate)||""),[O,w]=n.useState((null==E||null===(s=E.requestDetails)||void 0===s?void 0:s.description)||""),[x,R]=n.useState((null==E||null===(d=E.requestDetails)||void 0===d?void 0:d.deliveryTime)||""),[L,P]=n.useState((null==E||null===(v=E.requestDetails)||void 0===v?void 0:v.extraCharge)||!1),k=Digit.ULBService.getStateId(),M={width:"EMPLOYEE"===_.type?"50%":"100%"},{data:F}=Digit.Hooks.useCustomMDMS(k,"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(k,"request-service",[{name:"TankerType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerType}}),{data:U}=Digit.Hooks.useCustomMDMS(k,"request-service",[{name:"TankerQuantity"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerQuantity}}),{data:W}=Digit.Hooks.useCustomMDMS(k,"Request-service",[{name:"WaterType"}],{select:e=>{var t;return null==e||null===(t=e["Request-service"])||void 0===t?void 0:t.WaterType}});let j=[],H=[],z=[],V=[];W&&W.map(e=>{V.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),U&&U.map(e=>{H.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),F&&F.map(e=>{j.push({i18nKey:""+e.capacity,code:""+e.capacity,value:""+e.capacity,vehicleType:e.vehicleType,capacityName:e.capacityName})}),B&&B.map(e=>{z.push({i18nKey:""+e.i18nKey,code:""+e.code,value:""+e.value})});const K=j.map(e=>{if(g.code===e.vehicleType)return{i18nKey:e.capacityName,code:e.code,value:e.capacityName}}).filter(e=>void 0!==e),G=()=>l.createElement("div",{className:"flex items-center"},l.createElement(t.TextInput,{type:"time",value:x,style:M,onChange:e=>R(e.target.value),min:"06:00",max:"23:59"}));return n.useEffect(()=>{!g&&null!=z&&z.length&&S(z[0])},[z]),l.createElement(l.Fragment,null,l.createElement(t.FormStep,{config:m,onSelect:()=>{let e=u({},E.requestDetails,{tankerType:g,deliveryDate:D,tankerQuantity:y,waterType:C,waterQuantity:T,deliveryTime:x,description:O,extraCharge:L});f(m.key,e,!1)},t:p,isDisabled:!(g&&D&&y&&T&&x&&O&&C)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+p("WT_TANKER_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.RadioButtons,{t:p,options:z,style:{display:"flex",flexWrap:"wrap",maxHeight:"30px"},innerStyles:{minWidth:"24%"},optionsKey:"i18nKey",name:"tankerType",value:g,selectedOption:g,onSelect:S,labelKey:"i18nKey",isPTFlow:!0}),l.createElement(t.CardLabel,null,""+p("WT_WATER_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:C,placeholder:p("WT_SELECT_WATER_TYPE"),select:N,option:V,style:M,optionKey:"i18nKey",t:p}),l.createElement(t.CardLabel,null,""+p("WT_WATER_QUANTITY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:T,placeholder:"Select Water Quantity",select:A,option:K,style:M,optionKey:"i18nKey",t:p}),l.createElement(t.CardLabel,null,""+p("WT_TANKER_QUANTITY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:y,placeholder:"Select Tanker Quantity",select:b,option:H,style:M,optionKey:"i18nKey",t:p}),l.createElement(t.CardLabel,null,""+p("WT_DELIVERY_DATE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:p,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",style:M,value:D,onChange:function(e){I(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")}}),l.createElement(t.CardLabel,null,""+p("WT_DELIVERY_TIME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(G,null),l.createElement(t.CardLabel,null,""+p("WT_DESCRIPTION")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextArea,u({t:p,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"description",value:O,onChange:function(e){w(e.target.value)},style:M,ValidationRequired:!0},h={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:p("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CheckBox,{label:p("WT_IMMEDIATE"),onChange:()=>{P(!L)},checked:L}))))},WTCheckPage:e=>{var o,r,a,u,c,s,d,v,E,_,h,g;let{onSubmit:S,value:y={}}=e;const{t:b}=i.useTranslation(),{owner:T,requestDetails:A,address:C,serviceType:N,toiletRequestDetails:I,treePruningRequestDetails:O}=y,[w,x]=n.useState(!1),R=null!=A&&A.extraCharge?"YES":"NO";return l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardHeader,null,b("WT_SUMMARY_PAGE")),l.createElement("div",null,l.createElement(t.CardSubHeader,null,b("ES_TITILE_OWNER_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:b("COMMON_APPLICANT_NAME"),text:""+b(p(null==T?void 0:T.applicantName)),actionButton:l.createElement(D,{jumpTo:"/digit-ui/citizen/wt/request-service/applicant-details"})}),l.createElement(t.Row,{label:b("COMMON_MOBILE_NUMBER"),text:""+b(p(null==T?void 0:T.mobileNumber))}),l.createElement(t.Row,{label:b("COMMON_ALT_MOBILE_NUMBER"),text:""+b(p(null==T?void 0:T.alternateNumber))}),l.createElement(t.Row,{label:b("COMMON_EMAIL_ID"),text:""+b(p(null==T?void 0:T.emailId))})),l.createElement(t.CardSubHeader,null,b("ES_TITLE_ADDRESS_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:b("HOUSE_NO"),text:""+b(p(null==C?void 0:C.houseNo)),actionButton:l.createElement(D,{jumpTo:"/digit-ui/citizen/wt/request-service/address-details"})}),l.createElement(t.Row,{label:b("ADDRESS_LINE1"),text:""+b(p(null==C?void 0:C.addressLine1))}),l.createElement(t.Row,{label:b("ADDRESS_LINE2"),text:""+b(p(null==C?void 0:C.addressLine2))}),l.createElement(t.Row,{label:b("CITY"),text:""+b(p(null==C||null===(o=C.city)||void 0===o||null===(r=o.city)||void 0===r?void 0:r.name))}),l.createElement(t.Row,{label:b("LOCALITY"),text:""+b(p(null==C||null===(a=C.locality)||void 0===a?void 0:a.i18nKey))}),l.createElement(t.Row,{label:b("PINCODE"),text:""+b(p(null==C?void 0:C.pincode))}),l.createElement(t.Row,{label:b("LANDMARK"),text:""+b(p(null==C?void 0:C.landmark))}),l.createElement(t.Row,{label:b("STREET_NAME"),text:""+b(p(null==C?void 0:C.streetName))})),"WT"===(null==N||null===(u=N.serviceType)||void 0===u?void 0:u.code)&&l.createElement(n.Fragment,null,l.createElement(t.CardSubHeader,null,b("WT_REQUEST_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:b("WT_TANKER_TYPE"),text:""+b(p(null==A||null===(c=A.tankerType)||void 0===c?void 0:c.value)),actionButton:l.createElement(D,{jumpTo:"/digit-ui/citizen/wt/request-service/request-details"})}),l.createElement(t.Row,{label:b("WT_WATER_TYPE"),text:""+b(p(null==A||null===(s=A.waterType)||void 0===s?void 0:s.code))}),l.createElement(t.Row,{label:b("WT_TANKER_QUANTITY"),text:""+b(p(null==A||null===(d=A.tankerQuantity)||void 0===d?void 0:d.code))}),l.createElement(t.Row,{label:b("WT_WATER_QUANTITY"),text:""+b(p(null==A||null===(v=A.waterQuantity)||void 0===v?void 0:v.value))}),l.createElement(t.Row,{label:b("WT_DELIVERY_DATE"),text:""+b(p(f(null==A?void 0:A.deliveryDate)))}),l.createElement(t.Row,{label:b("WT_DELIVERY_TIME"),text:""+p(m(null==A?void 0:A.deliveryTime))}),l.createElement(t.Row,{label:b("WT_DESCRIPTION"),text:""+b(p(null==A?void 0:A.description))}),l.createElement(t.Row,{label:b("WT_IMMEDIATE"),text:""+b(p(R))}))),"MobileToilet"===(null==N||null===(E=N.serviceType)||void 0===E?void 0:E.code)&&l.createElement(n.Fragment,null,l.createElement(t.CardSubHeader,null,b("ES_REQUEST_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:b("MT_NUMBER_OF_MOBILE_TOILETS"),text:""+b(p(null==I||null===(_=I.mobileToilet)||void 0===_?void 0:_.code)),actionButton:l.createElement(D,{jumpTo:"/digit-ui/citizen/wt/request-service/toiletRequest-details"})}),l.createElement(t.Row,{label:b("MT_DELIVERY_FROM_DATE"),text:""+b(p(f(null==I?void 0:I.deliveryfromDate)))}),l.createElement(t.Row,{label:b("MT_DELIVERY_TO_DATE"),text:""+b(f(p(null==I?void 0:I.deliverytoDate)))}),l.createElement(t.Row,{label:b("MT_REQUIREMNENT_FROM_TIME"),text:p(m(null==I?void 0:I.deliveryfromTime))}),l.createElement(t.Row,{label:b("MT_REQUIREMNENT_TO_TIME"),text:p(m(null==I?void 0:I.deliverytoTime))}),l.createElement(t.Row,{label:b("MT_SPECIAL_REQUEST"),text:""+b(p(null==I?void 0:I.specialRequest))}))),"TREE_PRUNING"===(null==N||null===(h=N.serviceType)||void 0===h?void 0:h.code)&&l.createElement(n.Fragment,null,l.createElement(t.CardSubHeader,null,b("TP_REQUEST_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:b("REASON_FOR_PRUNING"),text:""+b(p(null==O||null===(g=O.reasonOfPruning)||void 0===g?void 0:g.code)),actionButton:l.createElement(D,{jumpTo:"/digit-ui/citizen/wt/request-service/treePruningRequest-details"})}),l.createElement(t.Row,{label:b("LOCATION_GEOTAG"),text:""+b(p(null==O?void 0:O.geoTagLocation))}),l.createElement(t.Row,{label:b("UPLOAD_THE_SITE_PHOTOGRAPH"),text:l.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>{Digit.UploadServices.Filefetch([null==O?void 0:O.supportingDocumentFile],Digit.ULBService.getStateId()).then(e=>{var t,n,l;const i=null==e||null===(t=e.data)||void 0===t||null===(n=t.fileStoreIds)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.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)})}},l.createElement(t.GenericFileIcon,null))}))),l.createElement(t.CheckBox,{label:b("FINAL_DECLARATION_MESSAGE"),onChange:()=>{x(!w)},styles:{height:"auto",marginBottom:"30px",marginTop:"10px"}})),l.createElement(t.SubmitBar,{label:b("COMMON_BUTTON_SUBMIT"),onSubmit:S,disabled:!w})))},WTAcknowledgement:e=>{let{data:r,onSuccess:a}=e;const{t:c}=i.useTranslation(),s=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),d=Digit.Hooks.wt.useTankerCreateAPI(s),v=Digit.UserService.getUser().info,{data:p}=Digit.Hooks.useStore.getInitData(),{tenants:m}=p||{};return n.useEffect(()=>{try{r.tenantId=s;let e=(e=>{var t,n,l,i,o,r,a,u,c,s,d,v,p,m,f,E,_,h,g,S,y,b,T,A,C,N,D,I,O,w,x,R,L,P,k;return{waterTankerBookingDetail:{tenantId:null==e?void 0:e.tenantId,tankerType:null==e||null===(t=e.requestDetails)||void 0===t||null===(n=t.tankerType)||void 0===n?void 0:n.code,waterType:null==e||null===(l=e.requestDetails)||void 0===l||null===(i=l.waterType)||void 0===i?void 0:i.code,tankerQuantity:null==e||null===(o=e.requestDetails)||void 0===o||null===(r=o.tankerQuantity)||void 0===r?void 0:r.code,waterQuantity:null==e||null===(a=e.requestDetails)||void 0===a||null===(u=a.waterQuantity)||void 0===u?void 0:u.code,description:null==e||null===(c=e.requestDetails)||void 0===c?void 0:c.description,deliveryDate:null==e||null===(s=e.requestDetails)||void 0===s?void 0:s.deliveryDate,deliveryTime:null==e||null===(d=e.requestDetails)||void 0===d?void 0:d.deliveryTime,extraCharge:null!=e&&null!==(v=e.requestDetails)&&void 0!==v&&v.extraCharge?"Y":"N",addressDetailId:(null==e||null===(p=e.address)||void 0===p?void 0:p.addressDetailId)||"",applicantDetail:{name:null==e||null===(m=e.owner)||void 0===m?void 0:m.applicantName,mobileNumber:null==e||null===(f=e.owner)||void 0===f?void 0:f.mobileNumber,alternateNumber:null==e||null===(E=e.owner)||void 0===E?void 0:E.alternateNumber,emailId:null==e||null===(_=e.owner)||void 0===_?void 0:_.emailId},address:{addressType:null==e||null===(h=e.address)||void 0===h||null===(g=h.addressType)||void 0===g?void 0:g.code,pincode:null==e||null===(S=e.address)||void 0===S?void 0:S.pincode,city:null==e||null===(y=e.address)||void 0===y||null===(b=y.city)||void 0===b||null===(T=b.city)||void 0===T?void 0:T.name,cityCode:null==e||null===(A=e.address)||void 0===A||null===(C=A.city)||void 0===C||null===(N=C.city)||void 0===N?void 0:N.code,addressLine1:null==e||null===(D=e.address)||void 0===D?void 0:D.addressLine1,addressLine2:null==e||null===(I=e.address)||void 0===I?void 0:I.addressLine2,locality:null==e||null===(O=e.address)||void 0===O||null===(w=O.locality)||void 0===w?void 0:w.i18nKey,localityCode:null==e||null===(x=e.address)||void 0===x||null===(R=x.locality)||void 0===R?void 0:R.code,streetName:null==e||null===(L=e.address)||void 0===L?void 0:L.streetName,houseNo:null==e||null===(P=e.address)||void 0===P?void 0:P.houseNo,landmark:null==e||null===(k=e.address)||void 0===k?void 0:k.landmark},bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"watertanker",moduleName:"request-service.water_tanker"}}}})(r);d.mutate(e,{onSuccess:a})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),d.isLoading||d.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(R,{t:c,data:d.data,isSuccess:d.isSuccess,isLoading:d.isIdle||d.isLoading}),l.createElement(t.StatusTable,null,d.isSuccess&&l.createElement(t.Row,{rowContainerStyle:x,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),d.isSuccess&&l.createElement(t.SubmitBar,{label:c("WT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=d.data)||void 0===e?void 0:e.waterTankerBookingDetail;const n=m.find(e=>e.code===t.tenantId);return Promise.resolve(O(u({},t),n,c)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},l.createElement(t.LinkButton,{label:c("CORE_COMMON_GO_TO_HOME")})))},WTApplicationDetails:()=>{var e,r,a,s,d,v,p,E,_,h,g,S,y;const{t:b}=i.useTranslation(),{acknowledgementIds:T,tenantId:A}=o.useParams(),[C,N]=n.useState(!1),[D,I]=n.useState(null),{data:w}=Digit.Hooks.useStore.getInitData(),{tenants:x}=w||{},{isLoading:R,data:L,refetch:P}=Digit.Hooks.wt.useTankerSearchAPI({tenantId:A,filters:{bookingNo:T}}),k=Ue(L,"waterTankerBookingDetail",[]);Ue(L,"waterTankerBookingDetail[0].bookingNo",[]);let M=k&&k.length>0&&k[0]||{};const F=M;sessionStorage.setItem("wt",JSON.stringify(F));let B="N"===(null==M?void 0:M.extraCharge)?"No":"Yes";const U=Digit.Hooks.wt.useTankerCreateAPI(A,!1),{data:W,isLoading:j}=Digit.Hooks.useRecieptSearch({tenantId:A,businessService:"request-service.water_tanker",consumerCodes:T,isEmployee:!1},{enabled:!!T});let H=[];H.push({label:b("WT_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>z()});const z=function(){try{const e=F||{},t=x.find(t=>t.code===e.tenantId);return Promise.resolve(O(u({},e),t,b)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return R?l.createElement(t.Loader,null):(W&&(null==W?void 0:W.Payments.length)>0&&0==j&&H.push({label:b("WT_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;c(e,ze);try{function l(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:i})).then(function(e){window.open(e[i],"_blank")})}let e=k[0]||{},i=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!i){let l={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},n)]},"request-service.water_tanker-receipt")).then(function(t){var n;l=t;const o=u({},e,{paymentReceiptFilestoreId:null===(n=l)||void 0===n?void 0:n.filestoreIds[0]});return Promise.resolve(U.mutateAsync({waterTankerBookingDetail:o})).then(function(){var e;i=null===(e=l)||void 0===e?void 0:e.filestoreIds[0],P()})})}}();return Promise.resolve(o&&o.then?o.then(l):l())}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]})}}),l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},b("WT_BOOKING_DETAILS")),H&&H.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>N(!C),displayOptions:C,options:H})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:b("WT_BOOKING_NO"),text:null==M?void 0:M.bookingNo})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("WT_APPLICANT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:b("WT_APPLICANT_NAME"),text:(null==M||null===(e=M.applicantDetail)||void 0===e?void 0:e.name)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_MOBILE_NUMBER"),text:(null==M||null===(r=M.applicantDetail)||void 0===r?void 0:r.mobileNumber)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_ALT_MOBILE_NUMBER"),text:(null==M||null===(a=M.applicantDetail)||void 0===a?void 0:a.alternateNumber)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_EMAIL_ID"),text:(null==M||null===(s=M.applicantDetail)||void 0===s?void 0:s.emailId)||b("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("WT_ADDRESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:b("WT_PINCODE"),text:(null==M||null===(d=M.address)||void 0===d?void 0:d.pincode)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_CITY"),text:(null==M||null===(v=M.address)||void 0===v?void 0:v.city)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_LOCALITY"),text:(null==M||null===(p=M.address)||void 0===p?void 0:p.locality)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_STREET_NAME"),text:(null==M||null===(E=M.address)||void 0===E?void 0:E.streetName)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_DOOR_NO"),text:(null==M||null===(_=M.address)||void 0===_?void 0:_.doorNo)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_HOUSE_NO"),text:(null==M||null===(h=M.address)||void 0===h?void 0:h.houseNo)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_ADDRESS_LINE1"),text:(null==M||null===(g=M.address)||void 0===g?void 0:g.addressLine1)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_ADDRESS_LINE2"),text:(null==M||null===(S=M.address)||void 0===S?void 0:S.addressLine2)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_LANDMARK"),text:(null==M||null===(y=M.address)||void 0===y?void 0:y.landmark)||b("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ES_REQUEST_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:b("WT_TANKER_TYPE"),text:(null==M?void 0:M.tankerType)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_WATER_TYPE"),text:b(null==M?void 0:M.waterType)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_TANKER_QUANTITY"),text:(null==M?void 0:M.tankerQuantity)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_WATER_QUANTITY"),text:(null==M?void 0:M.waterQuantity)+" Ltr"||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_DELIVERY_DATE"),text:f(null==M?void 0:M.deliveryDate)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_DELIVERY_TIME"),text:m(null==M?void 0:M.deliveryTime)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_DESCRIPTION"),text:(null==M?void 0:M.description)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_IMMEDIATE"),text:B||b("CS_NA")})),l.createElement(He,{application:F,id:null==F?void 0:F.bookingNo,userType:"citizen"}),D&&l.createElement(t.Toast,{error:D.key,label:b(D.label),style:{bottom:"0px"},onClose:()=>{I(null)}})))))},MTApplicationDetails:()=>{var e,r,a,s,d,v,p,E,_,h,g,S;const{t:y}=i.useTranslation(),{acknowledgementIds:b,tenantId:T}=o.useParams(),[A,C]=n.useState(!1),[N,D]=n.useState(null),{data:I}=Digit.Hooks.useStore.getInitData(),{tenants:O}=I||{},{isLoading:w,data:x,refetch:R}=Digit.Hooks.wt.useMobileToiletSearchAPI({tenantId:T,filters:{bookingNo:b}}),L=Ue(x,"mobileToiletBookingDetails",[]);Ue(x,"mobileToiletBookingDetails[0].bookingNo",[]);let P=L&&L.length>0&&L[0]||{};const k=P;sessionStorage.setItem("mt",JSON.stringify(k));const M=Digit.Hooks.wt.useMobileToiletCreateAPI(T,!1),{data:F,isLoading:B}=Digit.Hooks.useRecieptSearch({tenantId:T,businessService:"request-service.mobile_toilet",consumerCodes:b,isEmployee:!1},{enabled:!!b});let U=[];if(U.push({label:y("MT_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>W()}),w)return l.createElement(t.Loader,null);F&&(null==F?void 0:F.Payments.length)>0&&0==B&&U.push({label:y("MT_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;c(e,Ki);try{function l(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:i})).then(function(e){window.open(e[i],"_blank")})}let e=L[0]||{},i=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!i){let l={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},n)]},"request-service.mobile_toilet-receipt")).then(function(t){var n;l=t;const o=u({},e,{paymentReceiptFilestoreId:null===(n=l)||void 0===n?void 0:n.filestoreIds[0]});return Promise.resolve(M.mutateAsync({mobileToiletBookingDetail:o})).then(function(){var e;i=null===(e=l)||void 0===e?void 0:e.filestoreIds[0],R()})})}}();return Promise.resolve(o&&o.then?o.then(l):l())}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]})}});const W=function(){try{const e=k||{},t=O.find(t=>t.code===e.tenantId);return Promise.resolve(Mi(u({},e),t,y)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},y("MT_BOOKING_DETAILS")),U.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>C(!A),displayOptions:A,options:U})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:y("MT_BOOKING_NO"),text:null==P?void 0:P.bookingNo})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},y("MT_APPLICANT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:y("MT_APPLICANT_NAME"),text:(null==P||null===(e=P.applicantDetail)||void 0===e?void 0:e.name)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("MT_MOBILE_NUMBER"),text:(null==P||null===(r=P.applicantDetail)||void 0===r?void 0:r.mobileNumber)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("MT_ALT_MOBILE_NUMBER"),text:(null==P||null===(a=P.applicantDetail)||void 0===a?void 0:a.alternateNumber)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("MT_EMAIL_ID"),text:(null==P||null===(s=P.applicantDetail)||void 0===s?void 0:s.emailId)||y("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},y("ES_TITLE_ADDRESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:y("PINCODE"),text:(null==P||null===(d=P.address)||void 0===d?void 0:d.pincode)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("CITY"),text:(null==P||null===(v=P.address)||void 0===v?void 0:v.city)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("LOCALITY"),text:(null==P||null===(p=P.address)||void 0===p?void 0:p.locality)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("STREET_NAME"),text:(null==P||null===(E=P.address)||void 0===E?void 0:E.streetName)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("HOUSE_NO"),text:(null==P||null===(_=P.address)||void 0===_?void 0:_.houseNo)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("ADDRESS_LINE1"),text:(null==P||null===(h=P.address)||void 0===h?void 0:h.addressLine1)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("ADDRESS_LINE2"),text:(null==P||null===(g=P.address)||void 0===g?void 0:g.addressLine2)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("LANDMARK"),text:(null==P||null===(S=P.address)||void 0===S?void 0:S.landmark)||y("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},y("ES_REQUEST_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:y("MT_NUMBER_OF_MOBILE_TOILETS"),text:(null==P?void 0:P.noOfMobileToilet)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("MT_DELIVERY_FROM_DATE"),text:f(null==P?void 0:P.deliveryFromDate)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("MT_DELIVERY_TO_DATE"),text:f(null==P?void 0:P.deliveryToDate)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("MT_REQUIREMNENT_FROM_TIME"),text:m(null==P?void 0:P.deliveryFromTime)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("MT_REQUIREMNENT_TO_TIME"),text:m(null==P?void 0:P.deliveryToTime)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("MT_SPECIAL_REQUEST"),text:(null==P?void 0:P.description)||y("CS_NA")})),l.createElement(He,{application:k,id:null==k?void 0:k.bookingNo,userType:"citizen"}),N&&l.createElement(t.Toast,{error:N.key,label:y(N.label),style:{bottom:"0px"},onClose:()=>{D(null)}}))))},TPApplicationDetails:()=>{var e,r,a,s,d,v,p,m,f,E,_,h;const{t:g}=i.useTranslation(),{acknowledgementIds:S,tenantId:y}=o.useParams(),[b,T]=n.useState(!1),[A,C]=n.useState(null),{data:N}=Digit.Hooks.useStore.getInitData(),{tenants:D}=N||{},{isLoading:I,data:O,refetch:w}=Digit.Hooks.wt.useTreePruningSearchAPI({tenantId:y,filters:{bookingNo:S}}),x=Ue(O,"treePruningBookingDetails",[]);Ue(O,"treePruningBookingDetails[0].bookingNo",[]);let R=x&&x.length>0&&x[0]||{};console.log("tp_details",R);const L=R;sessionStorage.setItem("tp",JSON.stringify(L));const P=Digit.Hooks.wt.useTreePruningCreateAPI(y,!1),{data:k,isLoading:M}=Digit.Hooks.useRecieptSearch({tenantId:y,businessService:"request-service.tree_pruning",consumerCodes:S,isEmployee:!1},{enabled:!!S});let F=[];if(F.push({label:g("TP_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>B()}),I)return l.createElement(t.Loader,null);k&&(null==k?void 0:k.Payments.length)>0&&0==M&&F.push({label:g("TP_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;c(e,Gi);try{function l(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:i})).then(function(e){window.open(e[i],"_blank")})}let e=x[0]||{},i=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!i){let l={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},n)]},"request-service.tree_pruning-receipt")).then(function(t){var n;l=t;const o=u({},e,{paymentReceiptFilestoreId:null===(n=l)||void 0===n?void 0:n.filestoreIds[0]});return Promise.resolve(P.mutateAsync({treePruningBookingDetail:o})).then(function(){var e;i=null===(e=l)||void 0===e?void 0:e.filestoreIds[0],w()})})}}();return Promise.resolve(o&&o.then?o.then(l):l())}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=L||{},t=D.find(t=>t.code===e.tenantId);return Promise.resolve(ji(u({},e),t,g)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},g("TP_BOOKING_DETAILS")),F.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>T(!b),displayOptions:b,options:F})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:g("WT_BOOKING_NO"),text:null==R?void 0:R.bookingNo})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},g("TP_APPLICANT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:g("WT_APPLICANT_NAME"),text:(null==R||null===(e=R.applicantDetail)||void 0===e?void 0:e.name)||g("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:g("WT_MOBILE_NUMBER"),text:(null==R||null===(r=R.applicantDetail)||void 0===r?void 0:r.mobileNumber)||g("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:g("WT_ALT_MOBILE_NUMBER"),text:(null==R||null===(a=R.applicantDetail)||void 0===a?void 0:a.alternateNumber)||g("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:g("WT_EMAIL_ID"),text:(null==R||null===(s=R.applicantDetail)||void 0===s?void 0:s.emailId)||g("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},g("ES_TITLE_ADDRESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:g("PINCODE"),text:(null==R||null===(d=R.address)||void 0===d?void 0:d.pincode)||g("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:g("CITY"),text:(null==R||null===(v=R.address)||void 0===v?void 0:v.city)||g("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:g("LOCALITY"),text:(null==R||null===(p=R.address)||void 0===p?void 0:p.locality)||g("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:g("STREET_NAME"),text:(null==R||null===(m=R.address)||void 0===m?void 0:m.streetName)||g("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:g("HOUSE_NO"),text:(null==R||null===(f=R.address)||void 0===f?void 0:f.houseNo)||g("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:g("ADDRESS_LINE1"),text:(null==R||null===(E=R.address)||void 0===E?void 0:E.addressLine1)||g("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:g("ADDRESS_LINE2"),text:(null==R||null===(_=R.address)||void 0===_?void 0:_.addressLine2)||g("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:g("LANDMARK"),text:(null==R||null===(h=R.address)||void 0===h?void 0:h.landmark)||g("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},g("TP_REQUEST_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:g("REASON_FOR_PRUNING"),text:g(null==R?void 0:R.reasonForPruning)||g("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:g("LATITUDE_GEOTAG"),text:(null==R?void 0:R.latitude)||g("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:g("LONGITUDE_GEOTAG"),text:(null==R?void 0:R.longitude)||g("CS_NA")})),l.createElement(He,{application:L,id:null==L?void 0:L.bookingNo,userType:"citizen"}),A&&l.createElement(t.Toast,{error:A.key,label:g(A.label),style:{bottom:"0px"},onClose:()=>{C(null)}}))))},WTMyApplications:()=>{const{t:e}=i.useTranslation(),r=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),a=Digit.UserService.getUser().info,[c,s]=n.useState(""),[d,v]=n.useState(null),[p,m]=n.useState(null),[f,E]=n.useState("watertanker"),[_,h]=n.useState("watertanker");let g,S,y=window.location.href.split("/").pop();isNaN(parseInt(y))?g=4:(S=y,g=parseInt(y)+50);let b=isNaN(parseInt(y))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:r,MobileNumber:null==a?void 0:a.mobileNumber}:{limit:"50",sortOrder:"ASC",sortBy:"createdTime",offset:S,tenantId:r,MobileNumber:null==a?void 0:a.mobileNumber};n.useEffect(()=>{m(b)},[y]);const{isLoading:T,data:A}=Digit.Hooks.wt.useTankerSearchAPI({filters:p},{enabled:!!p&&"watertanker"===f}),{isLoading:C,data:N}=Digit.Hooks.wt.useMobileToiletSearchAPI({filters:p},{enabled:!!p&&"mobileToilet"===f}),{isLoading:D,data:I}=Digit.Hooks.wt.useTreePruningSearchAPI({filters:p},{enabled:!!p&&"treePruning"===f});let O=!1,w=[];if("watertanker"===f?(O=T,w=(null==A?void 0:A.waterTankerBookingDetail)||[]):"mobileToilet"===f?(O=C,w=(null==N?void 0:N.mobileToiletBookingDetails)||[]):"treePruning"===f?(O=D,w=null==I?void 0:I.treePruningBookingDetails):(O=T||C||D,w=[...(null==N?void 0:N.mobileToiletBookingDetails)||[],...(null==A?void 0:A.waterTankerBookingDetail)||[],...(null==I?void 0:I.treePruningBookingDetails)||[]]),O)return l.createElement(t.Loader,null);const x=[{label:e("MOBILE_TOILET"),code:"mobileToilet"},{label:e("WATER_TANKER"),code:"watertanker"},{label:e("TREE_PRUNING"),code:"treePruning"}],R=[{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 l.createElement(l.Fragment,null,l.createElement(t.Header,null,e("MY_BOOKINGS")+" ("+w.length+")"),l.createElement(t.Card,null,l.createElement("div",{style:{marginLeft:"16px"}},l.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"16px"}},l.createElement("div",{style:{flex:1}},l.createElement(t.CardLabel,null,e("SERVICE_TYPE")),l.createElement(t.Dropdown,{selected:x.find(e=>e.code===_),select:e=>{h(e.code),v("")},option:x,placeholder:e("Select Service Type"),optionKey:"label",t:e})),l.createElement("div",{style:{flex:1}},l.createElement(t.CardLabel,null,e("BOOKING_NO")),l.createElement(t.TextInput,{placeholder:e("Enter Booking No."),value:c,onChange:e=>s(e.target.value)})),l.createElement("div",{style:{flex:1}},l.createElement("div",{style:{display:"flex",flexDirection:"column"}},l.createElement(t.CardLabel,null,e("PT_COMMON_TABLE_COL_STATUS_LABEL")),l.createElement(t.Dropdown,{className:"form-field",selected:d,select:v,option:"treePruning"===_?L:R,placeholder:e("Select Status"),optionKey:"value",style:{width:"100%"},t:e}))),l.createElement("div",null,l.createElement("div",{style:{marginTop:"17%"}},l.createElement(t.SubmitBar,{label:e("ES_COMMON_SEARCH"),onSubmit:()=>{E(_);const e=c.trim(),t=u({},b,{bookingNo:e||void 0,status:(null==d?void 0:d.code)||void 0});m(t)}}),l.createElement("p",{className:"link",style:{marginLeft:"30%",marginTop:"10px",display:"block"},onClick:()=>{s(""),v("")}},e("ES_COMMON_CLEAR_ALL"))))),l.createElement(o.Link,{to:"request-service/service-type"},l.createElement(t.SubmitBar,{style:{borderRadius:"30px",width:"20%"},label:e("NEW_REQUEST")+" +"})))),l.createElement("div",null,w.length>0&&w.map((t,n)=>l.createElement("div",{key:n},l.createElement(G,{application:t,tenantId:r,buttonLabel:e("SUMMARY")}))),0===w.length&&!O&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("NO_APPLICATION_FOUND_MSG")),0!==w.length&&((null==N?void 0:N.count)||0)+((null==A?void 0:A.count)||0)+((null==I?void 0:I.count)||0)>g&&l.createElement("div",null,l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},l.createElement("span",{className:"link"},l.createElement(o.Link,{to:"/digit-ui/citizen/wt/status/"+g},e("LOAD_MORE_MSG")))))))},ApplicationDetails:xi,WFApplicationTimeline:He,WFCaption:je,WTEmpInbox:V,WTCitizenCard:()=>{const{t:e}=i.useTranslation(),[o,r]=n.useState("-"),a=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),{data:u,isFetching:c,isSuccess:s}=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()}});n.useEffect(()=>{!c&&s&&r(u)},[c]);const d=[{label:e("ES_COMMON_INBOX"),link:"/digit-ui/citizen/wt/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/citizen/wt/my-bookings"}],v={Icon:l.createElement(t.CHBIcon,null),moduleName:e("WT_MODULE_NAME"),kpis:[{count:null==o?void 0:o.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/wt/inbox"}],links:d};return l.createElement(t.EmployeeModuleCard,v)},ServiceTypes:e=>{var i;let{t:o,config:r,onSelect:a,userType:c,formData:s}=e;const d=Digit.ULBService.getStateId(),{data:v}=Digit.Hooks.useCustomMDMS(d,"request-service",[{name:"ServiceType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.ServiceType}}),[p,m]=(Digit.UserService.getUser(),n.useState((null==s||null===(i=s.serviceType)||void 0===i?void 0:i.serviceType)||"")),f=n.useCallback(()=>{let e=u({},s.serviceType,{serviceType:p});a(r.key,e,!1)},[s.serviceType,p,a,r.key]);return n.useEffect(()=>{"citizen"===c&&(console.log("calling meeeeeee"),f())},[p,c,f]),l.createElement(t.Modal,{headerBarMain:l.createElement(Pi,{t:o}),headerBarEnd:l.createElement(Li,{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"},l.createElement(l.Fragment,null,l.createElement(t.FormStep,{config:r,onSelect:f,t:o,isDisabled:!p},l.createElement("div",null,l.createElement(t.CardLabel,null,""+o("REQUEST_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:p,placeholder:"Select Service Type",select:m,option:v,optionKey:"i18nKey",t:o})))))},ToiletRequestDetails:e=>{var i,o,r,a,c,s;let{t:d,config:v,onSelect:p,userType:m,formData:f}=e;const E=Digit.UserService.getUser().info,[_,h]=n.useState((null==f||null===(i=f.toiletRequestDetails)||void 0===i?void 0:i.mobileToilet)||""),[g,S]=n.useState((null==f||null===(o=f.toiletRequestDetails)||void 0===o?void 0:o.deliveryfromTime)||""),[y,b]=n.useState((null==f||null===(r=f.toiletRequestDetails)||void 0===r?void 0:r.deliverytoTime)||""),[T,A]=n.useState((null==f||null===(a=f.toiletRequestDetails)||void 0===a?void 0:a.deliveryfromDate)||""),[C,N]=n.useState((null==f||null===(c=f.toiletRequestDetails)||void 0===c?void 0:c.deliverytoDate)||""),[D,I]=n.useState((null==f||null===(s=f.toiletRequestDetails)||void 0===s?void 0:s.specialRequest)||""),O=Digit.ULBService.getStateId(),w={width:"EMPLOYEE"===E.type?"52%":"100%"},{data:x}=Digit.Hooks.useCustomMDMS(O,"request-service",[{name:"NoOfMobileToilet"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.NoOfMobileToilet}});let R=[];x&&x.map(e=>{R.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})});const L=()=>l.createElement("div",{className:"flex items-center"},l.createElement(t.TextInput,{type:"time",value:g,style:w,onChange:e=>S(e.target.value),min:"06:00",max:"23:59"})),P=()=>l.createElement("div",{className:"flex items-center"},l.createElement(t.TextInput,{type:"time",value:y,style:w,onChange:e=>b(e.target.value),min:"06:00",max:"23:59"})),k=()=>{let e=u({},f.toiletRequestDetails,{mobileToilet:_,deliveryfromTime:g,deliverytoTime:y,deliveryfromDate:T,deliverytoDate:C,specialRequest:D});p(v.key,e,!1)};return n.useEffect(()=>{"citizen"===m&&k()},[_,g,y,T,C,D]),l.createElement(l.Fragment,null,l.createElement(t.FormStep,{config:v,onSelect:k,t:d,isDisabled:!(_&&g&&y&&T&&C&&D)},l.createElement("div",null,l.createElement(t.CardLabel,null,d("MT_NUMBER_OF_MOBILE_TOILETS")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:_,placeholder:"Select Number of Mobile Toilets",select:h,option:R,style:w,optionKey:"i18nKey",t:d}),l.createElement(t.CardLabel,null,""+d("MT_DELIVERY_FROM_DATE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:d,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",style:w,value:T,onChange:function(e){A(e.target.value)},min:(new Date).toISOString().split("T")[0],rules:{required:d("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||d("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+d("MT_DELIVERY_TO_DATE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:d,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",value:C,style:w,onChange:function(e){N(e.target.value)},min:T,rules:{required:d("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||d("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+d("MT_REQUIREMNENT_FROM_TIME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(L,null),l.createElement(t.CardLabel,null,""+d("MT_REQUIREMNENT_TO_TIME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(P,null),l.createElement(t.CardLabel,null,""+d("MT_SPECIAL_REQUEST")," ",l.createElement("span",{className:"check-page-link-button"})),l.createElement(t.TextArea,{t:d,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"mobileToilet",style:w,placeholder:"Special Request",value:D,onChange:function(e){I(e.target.value)},style:{width:"EMPLOYEE"===E.type?"51.6%":null}}))))},TreePruningRequestDetails:e=>{var i,o,r;let{t:a,config:c,onSelect:s,userType:d,formData:v}=e;const p=Digit.UserService.getUser().info,[m,f]=n.useState((null==v||null===(i=v.treePruningRequestDetails)||void 0===i?void 0:i.reasonOfPruning)||""),[E,_]=n.useState(""),[h,g]=n.useState(""),[S,y]=n.useState((null==v||null===(o=v.treePruningRequestDetails)||void 0===o?void 0:o.geoTagLocation)||""),[b,T]=n.useState((null==v||null===(r=v.treePruningRequestDetails)||void 0===r?void 0:r.supportingDocumentFile)||""),[A,C]=n.useState(!1),[N,D]=n.useState(""),I=Digit.ULBService.getStateId(),O={width:"EMPLOYEE"===p.type?"50%":"100%"},{data:w}=Digit.Hooks.useCustomMDMS(I,"request-service",[{name:"ReasonPruningType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.ReasonPruningType}}),x=()=>{let e=u({},v.treePruningRequestDetails,{reasonOfPruning:m,geoTagLocation:S,supportingDocumentFile:b,latitude:E,longitude:h});s(c.key,e,!1)};n.useEffect(()=>{"citizen"===d&&x()},[m,S,b,A]);const R=()=>l.createElement("div",{className:"loading-spinner"});return l.createElement(t.FormStep,{config:c,onSelect:x,t:a,isDisabled:!m||!b},l.createElement("div",null,l.createElement(t.CardLabel,null,a("REASON_FOR_PRUNING")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:m,placeholder:"Select Reason",select:f,option:w,style:O,optionKey:"code",t:a}),l.createElement(t.CardLabel,null,a("LOCATION_GEOTAG")),l.createElement("div",{style:{display:"flex",alignItems:"stretch",gap:"8px",width:"EMPLOYEE"===p.type?"53%":"100%"}},l.createElement(t.TextInput,{t:a,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"geoTagLocation",value:S,placeholder:"Select Location",onChange:e=>{const{name:t,value:n}=e.target?e.target:{name:e.name,value:e};"reasonOfPruning"===t?f(n):"geoTagLocation"===t||"location"===t?y(n):"supportingDocumentFile"===t&&T(n)},max:(new Date).toISOString().split("T")[0],style:{flex:1},rules:{required:a("dddddddd"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||a("hhhhhhh")},className:"location-input"}),l.createElement("div",{className:"butt-icon",onClick:()=>{"geolocation"in navigator?navigator.geolocation.getCurrentPosition(e=>{const{latitude:t,longitude:n}=e.coords;y(t+", "+n),_(t),g(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"}},l.createElement(t.LocationIcon,{className:"fill-path-primary-main"}))),l.createElement(t.CardLabel,null,a("UPLOAD_THE_SITE_PHOTOGRAPH")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement("div",{style:u({marginBottom:"16px"},O)},l.createElement(t.UploadFile,{id:"supportingDocument",onUpload:e=>((e,t)=>{const n=e.target.files[0];n.size>=5242880?(setError("supportingDocument",{message:a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")}),t(null)):(C(!0),Digit.UploadServices.Filestorage("TP",n,Digit.ULBService.getStateId()).then(e=>{var n,l;(null==e||null===(n=e.data)||void 0===n||null===(l=n.files)||void 0===l?void 0:l.length)>0?t(e.data.files[0].fileStoreId):setError("supportingDocument",{message:a("CS_FILE_UPLOAD_ERROR")})}).catch(()=>setError("supportingDocument",{message:a("CS_FILE_UPLOAD_ERROR")})).finally(()=>C(!1)))})(e,T),onDelete:()=>{T(null)},message:A?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(R,null),l.createElement("span",null,"Uploading...")):b?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},accept:"image/*, .pdf, .png, .jpeg, .jpg",buttonType:"button",error:N||!b}))))},MTAcknowledgement:e=>{let{data:r,onSuccess:a}=e;const{t:c}=i.useTranslation(),s=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),d=Digit.Hooks.wt.useMobileToiletCreateAPI(s),v=Digit.UserService.getUser().info,{data:p}=Digit.Hooks.useStore.getInitData(),{tenants:m}=p||{};return n.useEffect(()=>{try{r.tenantId=s;let e=(e=>{var t,n,l,i,o,r,a,u,c,s,d,v,p,m,f,E,_,h,g,S,y,b,T,A,C,N,D,I,O,w;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===(n=e.toiletRequestDetails)||void 0===n||null===(l=n.mobileToilet)||void 0===l?void 0:l.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===(r=e.toiletRequestDetails)||void 0===r?void 0:r.deliveryfromTime,deliveryToTime:null==e||null===(a=e.toiletRequestDetails)||void 0===a?void 0:a.deliverytoTime,addressDetailId:(null==e||null===(u=e.address)||void 0===u?void 0:u.addressDetailId)||"",applicantDetail:{name:null==e||null===(c=e.owner)||void 0===c?void 0:c.applicantName,mobileNumber:null==e||null===(s=e.owner)||void 0===s?void 0:s.mobileNumber,alternateNumber:null==e||null===(d=e.owner)||void 0===d?void 0:d.alternateNumber,emailId:null==e||null===(v=e.owner)||void 0===v?void 0:v.emailId},address:{addressType:null==e||null===(p=e.address)||void 0===p||null===(m=p.addressType)||void 0===m?void 0:m.code,pincode:null==e||null===(f=e.address)||void 0===f?void 0:f.pincode,city:null==e||null===(E=e.address)||void 0===E||null===(_=E.city)||void 0===_||null===(h=_.city)||void 0===h?void 0:h.name,cityCode:null==e||null===(g=e.address)||void 0===g||null===(S=g.city)||void 0===S||null===(y=S.city)||void 0===y?void 0:y.code,addressLine1:null==e||null===(b=e.address)||void 0===b?void 0:b.addressLine1,addressLine2:null==e||null===(T=e.address)||void 0===T?void 0:T.addressLine2,locality:null==e||null===(A=e.address)||void 0===A||null===(C=A.locality)||void 0===C?void 0:C.i18nKey,localityCode:null==e||null===(N=e.address)||void 0===N||null===(D=N.locality)||void 0===D?void 0:D.code,streetName:null==e||null===(I=e.address)||void 0===I?void 0:I.streetName,houseNo:null==e||null===(O=e.address)||void 0===O?void 0:O.houseNo,landmark:null==e||null===(w=e.address)||void 0===w?void 0:w.landmark},bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"mobileToilet",moduleName:"request-service.mobile_toilet"}}}})(r);d.mutate(e,{onSuccess:a})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),d.isLoading||d.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(Ui,{t:c,data:d.data,isSuccess:d.isSuccess,isLoading:d.isIdle||d.isLoading}),l.createElement(t.StatusTable,null,d.isSuccess&&l.createElement(t.Row,{rowContainerStyle:Bi,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),d.isSuccess&&l.createElement(t.SubmitBar,{label:c("MT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=d.data)||void 0===e?void 0:e.mobileToiletBookingDetail;const n=m.find(e=>e.code===t.tenantId);return Promise.resolve(Mi(u({},t),n,c)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},l.createElement(t.LinkButton,{label:c("CORE_COMMON_GO_TO_HOME")})))},TPAcknowledgement:e=>{let{data:r,onSuccess:a}=e;const{t:c}=i.useTranslation(),s=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),d=Digit.Hooks.wt.useTreePruningCreateAPI(s),v=Digit.UserService.getUser().info,{data:p}=Digit.Hooks.useStore.getInitData(),{tenants:m}=p||{};return n.useEffect(()=>{try{r.tenantId=s;let e=(e=>{var t,n,l,i,o,r,a,u,c,s,d,v,p,m,f,E,_,h,g,S,y,b,T,A,C,N,D;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===(n=e.treePruningRequestDetails)||void 0===n?void 0:n.longitude,reasonForPruning:null==e||null===(l=e.treePruningRequestDetails)||void 0===l||null===(i=l.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===(r=e.owner)||void 0===r?void 0:r.mobileNumber,alternateNumber:null==e||null===(a=e.owner)||void 0===a?void 0:a.alternateNumber,emailId:null==e||null===(u=e.owner)||void 0===u?void 0:u.emailId},documentDetails:[{documentType:"Site Photograph",fileStoreId:null==e||null===(c=e.treePruningRequestDetails)||void 0===c?void 0:c.supportingDocumentFile}],address:{addressType:null==e||null===(s=e.address)||void 0===s||null===(d=s.addressType)||void 0===d?void 0:d.code,pincode:null==e||null===(v=e.address)||void 0===v?void 0:v.pincode,city:null==e||null===(p=e.address)||void 0===p||null===(m=p.city)||void 0===m||null===(f=m.city)||void 0===f?void 0:f.name,cityCode:null==e||null===(E=e.address)||void 0===E||null===(_=E.city)||void 0===_||null===(h=_.city)||void 0===h?void 0:h.code,addressLine1:null==e||null===(g=e.address)||void 0===g?void 0:g.addressLine1,addressLine2:null==e||null===(S=e.address)||void 0===S?void 0:S.addressLine2,locality:null==e||null===(y=e.address)||void 0===y||null===(b=y.locality)||void 0===b?void 0:b.i18nKey,localityCode:null==e||null===(T=e.address)||void 0===T||null===(A=T.locality)||void 0===A?void 0:A.code,streetName:null==e||null===(C=e.address)||void 0===C?void 0:C.streetName,houseNo:null==e||null===(N=e.address)||void 0===N?void 0:N.houseNo,landmark:null==e||null===(D=e.address)||void 0===D?void 0:D.landmark},bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"treePruning",moduleName:"request-service.tree_pruning"}}}})(r);d.mutate(e,{onSuccess:a})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),d.isLoading||d.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(Vi,{t:c,data:d.data,isSuccess:d.isSuccess,isLoading:d.isIdle||d.isLoading}),l.createElement(t.StatusTable,null,d.isSuccess&&l.createElement(t.Row,{rowContainerStyle:zi,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),d.isSuccess&&l.createElement(t.SubmitBar,{label:c("TP_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=d.data)||void 0===e?void 0:e.treePruningBookingDetail;const n=m.find(e=>e.code===t.tenantId);return Promise.resolve(ji(u({},t),n,c)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},l.createElement(t.LinkButton,{label:c("CORE_COMMON_GO_TO_HOME")})))},MTCitizenCard:()=>{const{t:e}=i.useTranslation(),[o,r]=n.useState("-"),a=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),{data:u,isFetching:c,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:a,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()}});n.useEffect(()=>{!c&&s&&r(u)},[c]);const d=[{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:l.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:d};return l.createElement(t.EmployeeModuleCard,v)}};exports.WTComponents={WTCard:()=>{const{t:e}=i.useTranslation(),[o,r]=n.useState("-"),{data:a,isLoading:u,isFetching:c,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),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()}});n.useEffect(()=>{!c&&s&&r(a)},[c]);const d=[{count:u?"-":null==o?void 0:o.totalCount,label:e("ES_COMMON_INBOX"),link:"/digit-ui/employee/wt/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"}],v=Digit.UserService.hasAccess(["WT_CEMP"])||!1,p={Icon:l.createElement(t.CHBIcon,null),moduleName:e("WT_MODULE_NAME"),kpis:[{count:null==o?void 0:o.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/wt/inbox"}],links:d.filter(e=>!(null!=e&&e.role)||v)};return l.createElement(t.EmployeeModuleCard,p)},WTModule:qi,MTCard:()=>{const{t:e}=i.useTranslation(),[o,r]=n.useState("-"),{data:a,isLoading:u,isFetching:c,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(n.useEffect(()=>{!c&&s&&r(a)},[c]),!Digit.Utils.mtAccess())return null;const d=[{count:u?"-":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,p={Icon:l.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:d.filter(e=>!(null!=e&&e.role)||v)};return l.createElement(t.EmployeeModuleCard,p)},TPCard:()=>{const{t:e}=i.useTranslation(),[o,r]=n.useState("-"),{data:a,isLoading:u,isFetching:c,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()}});n.useEffect(()=>{!c&&s&&r(a)},[c]);const d=[{count:u?"-":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,p={Icon:l.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:d.filter(e=>!(null!=e&&e.role)||v)};return l.createElement(t.EmployeeModuleCard,p)},WTLinks:Yi,WT_INBOX_FILTER:e=>l.createElement(qe,e),WTInboxTableConfig:e=>({WT:{inboxColumns:t=>[{Header:e("WT_BOOKING_NO"),Cell:e=>{var n,i,r,a;let{row:u}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:t.parentRoute+"/booking-details/"+(null==u||null===(n=u.original)||void 0===n||null===(i=n.searchData)||void 0===i?void 0:i.bookingNo)},null===(r=u.original)||void 0===r||null===(a=r.searchData)||void 0===a?void 0:a.bookingNo)))},mobileCell:e=>{var t;return Ke(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("WT_APPLICANT_NAME"),Cell:e=>{var t,n,l,i,o;return Ve(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,n;return Ke(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.name)}},{Header:e("WT_MOBILE_NUMBER"),Cell:e=>{var t,n,l,i,o;return Ve(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,n;return Ke(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.mobileNumber)}},{Header:e("LOCALITY"),Cell:t=>{var n,l;let{row:i}=t;return Ve(e(""+(null===(n=i.original)||void 0===n||null===(l=n.searchData)||void 0===l?void 0:l.localityCode)))},mobileCell:t=>{var n;return Ke(e(""+(null==t||null===(n=t.searchData)||void 0===n?void 0:n.localityCode)))}},{Header:e("WT_STATUS"),Cell:t=>{var n,l,i;let{row:o}=t;return Ve(e(""+(null==o||null===(n=o.original)||void 0===n||null===(l=n.workflowData)||void 0===l||null===(i=l.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var n,l;return Ke(e("ES_WT_COMMON_STATUS_"+(null==t||null===(n=t.workflowData)||void 0===n||null===(l=n.state)||void 0===l?void 0:l.applicationStatus)))}}],serviceRequestIdKey:t=>{var n,l;return null==t||null===(n=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===n||null===(l=n.props)||void 0===l?void 0:l.children}},MT:{inboxColumns:t=>[{Header:e("MT_BOOKING_NO"),Cell:e=>{var n,i,r,a;let{row:u}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:t.parentRoute+"/booking-details/"+(null==u||null===(n=u.original)||void 0===n||null===(i=n.searchData)||void 0===i?void 0:i.bookingNo)},null===(r=u.original)||void 0===r||null===(a=r.searchData)||void 0===a?void 0:a.bookingNo)))},mobileCell:e=>{var t;return Ke(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("MT_APPLICANT_NAME"),Cell:e=>{var t,n,l,i,o;return Ve(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,n;return Ke(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.name)}},{Header:e("MT_MOBILE_NUMBER"),Cell:e=>{var t,n,l,i,o;return Ve(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,n;return Ke(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.mobileNumber)}},{Header:e("LOCALITY"),Cell:t=>{var n,l;let{row:i}=t;return Ve(e(""+(null===(n=i.original)||void 0===n||null===(l=n.searchData)||void 0===l?void 0:l.localityCode)))},mobileCell:t=>{var n;return Ke(e(""+(null==t||null===(n=t.searchData)||void 0===n?void 0:n.localityCode)))}},{Header:e("MT_STATUS"),Cell:t=>{var n,l,i;let{row:o}=t;return Ve(e(""+(null==o||null===(n=o.original)||void 0===n||null===(l=n.workflowData)||void 0===l||null===(i=l.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var n,l;return Ke(e("ES_WT_COMMON_STATUS_"+(null==t||null===(n=t.workflowData)||void 0===n||null===(l=n.state)||void 0===l?void 0:l.applicationStatus)))}}],serviceRequestIdKey:t=>{var n,l;return null==t||null===(n=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===n||null===(l=n.props)||void 0===l?void 0:l.children}},TP:{inboxColumns:t=>[{Header:e("MT_BOOKING_NO"),Cell:e=>{var n,i,r,a;let{row:u}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:t.parentRoute+"/booking-details/"+(null==u||null===(n=u.original)||void 0===n||null===(i=n.searchData)||void 0===i?void 0:i.bookingNo)},null===(r=u.original)||void 0===r||null===(a=r.searchData)||void 0===a?void 0:a.bookingNo)))},mobileCell:e=>{var t;return Ke(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("MT_APPLICANT_NAME"),Cell:e=>{var t,n,l,i,o;return Ve(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,n;return Ke(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.name)}},{Header:e("MT_MOBILE_NUMBER"),Cell:e=>{var t,n,l,i,o;return Ve(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,n;return Ke(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.mobileNumber)}},{Header:e("LOCALITY"),Cell:t=>{var n,l;let{row:i}=t;return Ve(e(""+(null===(n=i.original)||void 0===n||null===(l=n.searchData)||void 0===l?void 0:l.localityCode)))},mobileCell:t=>{var n;return Ke(e(""+(null==t||null===(n=t.searchData)||void 0===n?void 0:n.localityCode)))}},{Header:e("MT_STATUS"),Cell:t=>{var n,l,i;let{row:o}=t;return Ve(e(""+(null==o||null===(n=o.original)||void 0===n||null===(l=n.workflowData)||void 0===l||null===(i=l.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var n,l;return Ke(e("ES_WT_COMMON_STATUS_"+(null==t||null===(n=t.workflowData)||void 0===n||null===(l=n.state)||void 0===l?void 0:l.applicationStatus)))}}],serviceRequestIdKey:t=>{var n,l;return null==t||null===(n=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===n||null===(l=n.props)||void 0===l?void 0:l.children}}})},exports.WTLinks=Yi,exports.WTModule=qi,exports.initWTComponents=()=>{Object.entries(Xi).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|
|
1
|
+
var e,t=require("@djb25/digit-ui-react-components"),n=require("react"),l=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-router-dom"),a=require("react-query"),r=require("react-hook-form");function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}function s(e,t){if(null==e)return{};var n={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;n[l]=e[l]}return n}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"}]}]}],d=["config","onSelect"],v=e=>{let{config:n}=e;s(e,d);const{t:a}=i.useTranslation(),r=o.useLocation(),u=(o.useHistory(),r.pathname.split("/").pop());if("info"===u)return null;const c=n.filter(e=>e.timeLine&&e.timeLine.length>0).reduce((e,t)=>{const n=t.timeLine[0],l=e.findIndex(e=>e.key===n.currentStep);return-1===l?e.push({key:n.currentStep,label:n.actions,routes:[t.route],stepNumber:n.currentStep}):e[l].routes.push(t.route),e},[]).sort((e,t)=>e.stepNumber-t.stepNumber);c.push({key:"final-submit",label:"Review & Submit",routes:["check","wt-acknowledgement","mt-acknowledgement","tp-acknowledgement"],stepNumber:c.length+1});const v=c.findIndex(e=>e.routes.includes(u)),m=-1!==v?v:0;return l.createElement(l.Fragment,null,l.createElement("div",{className:"vertical-timeline-container"},c.map((e,n)=>{const i=n<m;return l.createElement("div",{key:n,className:"vertical-timeline-step "+(i?"completed":"")+" "+(n===m?"active":""),onClick:()=>{}},l.createElement("div",{className:"vertical-timeline-connector "+(n<m?"completed":"")}),l.createElement("div",{className:"vertical-timeline-pill"},i?l.createElement(t.TickMark,null):e.stepNumber),l.createElement("div",{className:"vertical-timeline-content"},l.createElement("div",{className:"vertical-timeline-label"},a(e.label))))})))},m=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"NA"},p=e=>{if(!e)return"NA";const[t,n]=e.split(":").map(Number),l=t>=12?"PM":"AM";return(t%12||12)+":"+n.toString().padStart(2,"0")+" "+l},E=e=>{if(!e)return"NA";const[t,n,l]=e.split("-");return l+"-"+n+"-"+t},f=e=>{let{number:i,title:o,children:a,defaultOpen:r=!1,tabs:u=null,defaultTab:s="",onTabChange:c=(()=>{})}=e;const[d,v]=n.useState(r),[m,p]=n.useState(s||u&&u[0]||"");return l.createElement("div",{className:"collapsible-card"},l.createElement("div",{className:"collapsible-card-header",onClick:()=>v(!d)},l.createElement("h3",{className:"collapsible-card-title"},i?i+". ":"",o),l.createElement("span",{className:"collapsible-card-arrow "+(d?"rotate":"")},l.createElement(t.ArrowDown,null))),d&&l.createElement("div",{className:"collapsible-card-body"},u&&l.createElement("div",{className:"collapsible-card-tabs"},u.map((e,t)=>l.createElement("button",{key:t,onClick:()=>(e=>{p(e),c(e)})(e),className:"collapsible-card-tab-button "+(m===e?"active":"")},e))),l.createElement("div",{className:"collapsible-card-tab-content"},u?l.createElement("div",{key:m},a(m)):l.createElement("div",null,a))))},g=e=>{let{isLoading:i,t:a,onSubmit:u,data:s,count:c,setShowToast:d,moduleCode:v}=e;window.Digit.Utils.browser.isMobile();const m=Digit.UserService.getUser().info,p={offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",bookingNo:"",mobileNumber:"",applicantName:"",status:"",fromDate:"",toDate:""},{register:E,control:_,handleSubmit:g,setValue:S,getValues:h,reset:T,formState:b,watch:y}=r.useForm({defaultValues:p}),C=y("fromDate"),A=e=>l.createElement("span",{className:"cell-text"},e),N=n.useMemo(()=>[{Header:a("WT_BOOKING_NO"),accessor:"bookingNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;const n=t.original.bookingNo;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:"/digit-ui/"+("EMPLOYEE"===m.type?"employee":"citizen")+"/wt/bookingsearch/booking-details/"+n},n)))}},{Header:a("WT_APPLICANT_NAME"),disableSortBy:!0,Cell:e=>{var t,n;let{row:l}=e;return A(null===(t=l.original)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.name)}},{Header:a("WT_MOBILE_NUMBER"),disableSortBy:!0,Cell:e=>{var t,n;let{row:l}=e;return A(null===(t=l.original)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.mobileNumber)}},{Header:a("PT_COMMON_TABLE_COL_STATUS_LABEL"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return A(a(t.original.bookingStatus))}}],[a,m.type]),D="TP"===v?[{i18nKey:"TP_BOOKING_CREATED",code:"BOOKING_CREATED",value:a("TP_BOOKING_CREATED")},{i18nKey:"TP_PENDING_FOR_APPROVAL",code:"PENDING_FOR_APPROVAL",value:a("TP_PENDING_FOR_APPROVAL")},{i18nKey:"TP_PAYMENT_PENDING",code:"PAYMENT_PENDING",value:a("TP_PAYMENT_PENDING")},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_VERIFICATION",code:"TEAM_ASSIGNMENT_FOR_VERIFICATION",value:a("TP_TEAM_ASSIGNMENT_FOR_VERIFICATION")},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_EXECUTION",code:"TEAM_ASSIGNMENT_FOR_EXECUTION",value:a("TP_TEAM_ASSIGNMENT_FOR_EXECUTION")},{i18nKey:"TP_TREE_PRUNING_SERVICE_COMPLETED",code:"TREE_PRUNING_SERVICE_COMPLETED",value:a("TP_TREE_PRUNING_SERVICE_COMPLETED")}]:[{i18nKey:"Booking Created",code:"BOOKING_CREATED",value:a("WT_BOOKING_CREATED")},{i18nKey:"Booking Approved",code:"APPROVED",value:a("WT_BOOKING_APPROVED")},{i18nKey:"Tanker Delivered",code:"TANKER_DELIVERED",value:a("WT_TANKER_DELIVERED")},{i18nKey:"Vendor Assigned",code:"ASSIGN_VENDOR",value:a("WT_ASSIGN_VENDOR")},{i18nKey:"Rejected",code:"REJECT",value:a("WT_BOOKING_REJECTED")}],I=n.useCallback(e=>{0!==e.length&&(S("sortBy",e.id),S("sortOrder",e.desc?"DESC":"ASC"))},[S]),O=()=>{T(p),d(null),g(u)()};return l.createElement(l.Fragment,null,l.createElement("div",{className:"CITIZEN"===(null==m?void 0:m.type)?"citizen-wrapper":"employee-wrapper"},l.createElement(f,{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 n,i,o,s;return l.createElement("form",{onSubmit:g(u)},e===a("WT_SMART_SEARCH")&&l.createElement("div",{className:"wt-search-grid",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"24px"}},l.createElement("div",{className:"search-field-wrapper"},l.createElement("label",null,a("WT_MOBILE_NUMBER")),l.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}),l.createElement(t.CardLabelError,null,null==b||null===(n=b.errors)||void 0===n||null===(i=n.mobileNumber)||void 0===i?void 0:i.message))),e===a("WT_ADVANCED_SEARCH")&&l.createElement("div",{className:"wt-search-grid",style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"24px"}},l.createElement("div",{className:"search-field-wrapper"},l.createElement("label",null,a("WT_BOOKING_NO")),l.createElement(t.TextInput,{name:"bookingNo",inputRef:E({})})),l.createElement("div",{className:"search-field-wrapper"},l.createElement("label",null,a("WT_APPLICANT_NAME")),l.createElement(t.TextInput,{name:"applicantName",inputRef:E({})})),l.createElement("div",{className:"search-field-wrapper"},l.createElement("label",null,a("WT_MOBILE_NUMBER")),l.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}),l.createElement(t.CardLabelError,null,null==b||null===(o=b.errors)||void 0===o||null===(s=o.mobileNumber)||void 0===s?void 0:s.message)),l.createElement("div",{className:"search-field-wrapper"},l.createElement("label",null,a("PT_COMMON_TABLE_COL_STATUS_LABEL")),l.createElement(r.Controller,{control:_,name:"status",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:D,optionKey:"i18nKey",t:a})})),l.createElement("div",{className:"search-field-wrapper"},l.createElement("label",null,a("FROM_DATE")),l.createElement(r.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,onChange:e.onChange,max:(new Date).toISOString().split("T")[0]}),name:"fromDate",control:_})),l.createElement("div",{className:"search-field-wrapper"},l.createElement("label",null,a("TO_DATE")),l.createElement(r.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,onChange:e.onChange,min:C}),name:"toDate",control:_}))),l.createElement("div",{className:"wt-search-actions",style:{display:"flex",justifyContent:"flex-end",gap:"24px",marginTop:"16px"}},l.createElement("span",{className:"clear-search-link",onClick:O,style:{color:"#f47738",cursor:"pointer",alignSelf:"center",textDecoration:"underline"}},a("ES_COMMON_CLEAR_ALL")),l.createElement("div",{style:{minWidth:"160px"}},l.createElement(t.SubmitBar,{label:a("ES_COMMON_SEARCH"),submit:!0}))))}),!i&&null!=s&&s.display?l.createElement(t.Card,{style:{marginTop:20}},a(s.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):i||""===s?(""!==s||i)&&l.createElement(t.Loader,null):l.createElement(t.Table,{t:a,data:s,totalRecords:c,columns:N,getCellProps:e=>({style:{minWidth:e.column.Header===a("WT_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:e=>{S("limit",Number(e.target.value)),g(u)()},currentPage:h("offset")/h("limit"),onNextPage:()=>{S("offset",h("offset")+h("limit")),g(u)()},onPrevPage:()=>{const e=h("offset"),t=h("limit");e-t>=0&&(S("offset",e-t),g(u)())},pageSizeLimit:h("limit"),onSort:I,disableSort:!1,sortParams:[{id:h("sortBy"),desc:"DESC"===h("sortOrder")}]})))},S=e=>{let{moduleCode:o}=e;const{t:a}=i.useTranslation(),r=Digit.ULBService.getCurrentTenantId(),[s,c]=n.useState({}),[d,v]=n.useState(null);n.useEffect(()=>{if(d){const e=setTimeout(()=>{v(null)},1e3);return()=>clearTimeout(e)}},[d]);const m={enabled:!!(s&&Object.keys(s).length>0)};let p=[],E=0,f=!1,_=!1,S=!1,h=null;return"WT"===o?({isLoading:f,isSuccess:_,isError:S,error:h,data:{waterTankerBookingDetail:p=[],Count:E=0}={}}=Digit.Hooks.wt.useTankerSearchAPI({tenantId:r,filters:s},m)):"MT"===o?({isLoading:f,isSuccess:_,isError:S,error:h,data:{mobileToiletBookingDetails:p=[],Count:E=0}={}}=Digit.Hooks.wt.useMobileToiletSearchAPI({tenantId:r,filters:s},m)):"TP"===o&&({isLoading:f,isSuccess:_,isError:S,error:h,data:{treePruningBookingDetails:p=[],Count:E=0}={}}=Digit.Hooks.wt.useTreePruningSearchAPI({tenantId:r,filters:s},m)),l.createElement(l.Fragment,null,l.createElement(g,{t:a,isLoading:f,tenantId:r,setShowToast:v,onSubmit:function(e){const{fromDate:t,toDate:n}=e,l=u({},e,n?{toDate:n}:{},t?{fromDate:t}:{});let i=Object.keys(l).filter(e=>l[e]).reduce((e,t)=>u({},e,{[t]:"object"==typeof l[t]?l[t].code:l[t]}),{});!(Object.keys(i).length>0)||i.bookingNo||i.fromDate||i.status||i.toDate||i.mobileNumber?i.fromDate&&!i.toDate||!i.fromDate&&i.toDate?v({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):c(i):v({warning:!0,label:"ERR_PROVIDE_ONE_PARAMETERS"})},data:_&&!f?p.length>0?p:{display:"ES_COMMON_NO_DATA"}:"",count:E,moduleCode:o}),d&&l.createElement(t.Toast,{error:d.error,warning:d.warning,label:a(d.label),onClose:()=>v(null)}))},h=["path","url"],T=()=>{var e,n,i,a,r,c,d,v,m,p,E,f;const _=o.useRouteMatch(),{path:g}=_,T=(s(_,h),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("WTCreate")),b=null===(i=Digit)||void 0===i||null===(a=i.ComponentRegistryService)||void 0===a?void 0:a.getComponent("WTApplicationDetails"),y=null===(r=Digit)||void 0===r||null===(c=r.ComponentRegistryService)||void 0===c?void 0:c.getComponent("MTApplicationDetails"),C=null===(d=Digit)||void 0===d||null===(v=d.ComponentRegistryService)||void 0===v?void 0:v.getComponent("TPApplicationDetails"),A=null===(m=Digit)||void 0===m||null===(p=m.ComponentRegistryService)||void 0===p?void 0:p.getComponent("WTMyApplications"),N=Digit.ComponentRegistryService.getComponent("WTEmpInbox"),D=Digit.ComponentRegistryService.getComponent("WTCitizenCard"),I=Digit.ComponentRegistryService.getComponent("MTCitizenCard"),O=null===(E=Digit)||void 0===E||null===(f=E.ComponentRegistryService)||void 0===f?void 0:f.getComponent("ApplicationDetails"),L=e=>({searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:[e],applicationStatus:[],locality:[]}}),w=L("watertanker"),R=L("mobileToilet");return l.createElement("span",{style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,l.createElement(t.BackButton,null,"Back"),l.createElement(t.PrivateRoute,{path:g+"/inbox",component:()=>l.createElement(N,{useNewInboxAPI:!0,parentRoute:g,moduleCode:"WT",businessService:"watertanker",filterComponent:"WT_INBOX_FILTER",initialStates:w,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:g+"/mt/inbox",component:()=>l.createElement(N,{useNewInboxAPI:!0,parentRoute:g,businessService:"mobileToilet",moduleCode:"MT",filterComponent:"WT_INBOX_FILTER",initialStates:R,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:g+"/request-service",component:T}),l.createElement(t.PrivateRoute,{path:g+"/status",component:A}),l.createElement(t.PrivateRoute,{path:g+"/booking/waterTanker/:acknowledgementIds/:tenantId",component:b}),l.createElement(t.PrivateRoute,{path:g+"/booking/mobileToilet/:acknowledgementIds/:tenantId",component:y}),l.createElement(t.PrivateRoute,{path:g+"/booking/treePruning/:acknowledgementIds/:tenantId",component:C}),l.createElement(t.PrivateRoute,{path:g+"/booking-details/:id",component:()=>l.createElement(O,{parentRoute:g})}),l.createElement(t.PrivateRoute,{path:g+"/bookingsearch/booking-details/:id",component:()=>l.createElement(O,{parentRoute:g})}),l.createElement(t.PrivateRoute,{path:g+"/wt-Vendor",component:()=>Digit.UserService.hasAccess(["WT_VENDOR"])?l.createElement(D,{parentRoute:g}):l.createElement(o.Redirect,{to:{pathname:"/digit-ui/citizen/login",state:{from:g+"/wt-Vendor",role:"WT_VENDOR"}}})}),l.createElement(t.PrivateRoute,{path:g+"/mt-Vendor",component:()=>Digit.UserService.hasAccess(["MT_VENDOR"])?l.createElement(I,{parentRoute:g}):l.createElement(o.Redirect,{to:{pathname:"/digit-ui/citizen/login",state:{from:g+"/mt-Vendor",role:"MT_VENDOR"}}})}),l.createElement(t.PrivateRoute,{path:g+"/my-bookings",component:e=>l.createElement(S,u({},e,{parentRoute:g,moduleCode:"WT"}))}),l.createElement(t.PrivateRoute,{path:g+"/mt/my-bookings",component:e=>l.createElement(S,u({},e,{parentRoute:g,moduleCode:"MT"}))}))))},b=e=>{let{onSubmit:a,setExistingDataSet:r}=e;const{t:s}=i.useTranslation(),c=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[d,v]=n.useState(null),[m,p]=n.useState(!1),{offset:E}=o.useParams();n.useEffect(()=>{m&&(a(),p(!1))},[m,a]);let f={limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:E&&!isNaN(parseInt(E))?E:"0",tenantId:c};n.useEffect(()=>{v(f)},[E]);const{isLoading:_,data:g}=Digit.Hooks.wt.useTankerSearchAPI({filters:d});if(_)return l.createElement(t.Loader,null);const S=(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 l.createElement(l.Fragment,null,l.createElement("div",null,S.length>0&&S.map((e,n)=>{var i;return l.createElement("div",{key:n},l.createElement(t.Card,{style:u({},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,n,l,i,o,a,u,s,c,d,v,m,E,f,_,g,S,h;const T={address:{houseNo:null==e||null===(t=e.address)||void 0===t?void 0:t.houseNo,streetName:null==e||null===(n=e.address)||void 0===n?void 0:n.streetName,addressline1:null==e||null===(l=e.address)||void 0===l?void 0:l.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===(u=e.address)||void 0===u?void 0:u.city,value:null==e||null===(s=e.address)||void 0===s?void 0:s.city,i18nKey:null==e||null===(c=e.address)||void 0===c?void 0:c.city,city:{name:null==e||null===(d=e.address)||void 0===d?void 0:d.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===(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===(_=e.applicantDetail)||void 0===_?void 0:_.name,mobileNumber:null==e||null===(g=e.applicantDetail)||void 0===g?void 0:g.mobileNumber,alternateNumber:null==e||null===(S=e.applicantDetail)||void 0===S?void 0:S.alternateNumber,emailId:null==e||null===(h=e.applicantDetail)||void 0===h?void 0:h.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),p(!0)})(e)}},l.createElement(t.KeyNote,{keyValue:s("BOOKING_NO"),note:null==e?void 0:e.bookingNo}),l.createElement(t.KeyNote,{keyValue:s("APPLICANT_NAME"),note:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name}),l.createElement(t.KeyNote,{keyValue:s("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:s(""+(null==e?void 0:e.bookingStatus))})))}),0===S.length&&!_&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},s("NO_APPLICATION_FOUND_MSG"))))},y=l.memo(e=>{let{t:t}=e;return l.createElement("h1",{className:"heading-m"},t("MY_BOOKINGS"))}),C=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),A=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(C,null)),N=e=>{let{t:i,closeModal:o,onSubmit:a,setExistingDataSet:r}=e;const[u,s]=n.useState(!1),[c,d]=n.useState(!1),v=n.useCallback(()=>{c&&(a(),d(!1))},[c,a]);return n.useEffect(()=>{v()},[v]),l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement(y,{t:i}),headerBarEnd:l.createElement(A,{onClick:o}),actionCancelLabel:u&&i("CS_COMMON_BACK"),actionCancelOnSubmit:()=>s(!1),hideSubmit:!0,formId:"modal-action"},l.createElement(t.Card,{style:{boxShadow:"none"}},u&&l.createElement(b,{onSubmit:a,setExistingDataSet:r}),l.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},!u&&l.createElement(t.SubmitBar,{label:i("USE_EXISTING_DETAILS"),onSubmit:()=>{s(!0)}}),!u&&l.createElement(t.SubmitBar,{label:i("FILL_NEW_DETAILS"),onSubmit:()=>{d(!0)}})))))},D=e=>{let{jumpTo:n}=e;i.useTranslation();const a=o.useHistory();return l.createElement(t.LinkButton,{label:l.createElement(t.EditIcon,{style:{marginTop:"-30px",float:"right",position:"relative",bottom:"32px"}}),className:"check-page-link-button",onClick:function(){a.push(n)}})},I=e=>e.substr(0,1).toUpperCase()+e.substr(1),O=function(e,t,n){try{var l,i,o,a,r,u,s,c,d,v,m,f,_,g;return console.log("booking",e),console.log("tenantInfo",t),Promise.resolve({t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(S=n("ULBGRADE_"+(null==t||null===(l=t.city)||void 0===l?void 0:l.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),S.toLowerCase().split(" ").map(I).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:n("WT_ACKNOWLEDGEMENT"),details:[{title:n("WT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:n("WT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:n("WT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:n("WT_ALT_MOBILE_NUMBER"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.alternateNumber},{title:n("WT_EMAIL_ID"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.emailId}].filter(e=>e.value)},{title:n("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:n("WT_PINCODE"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.pincode},{title:n("WT_CITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.city},{title:n("WT_LOCALITY"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.locality},{title:n("WT_STREET_NAME"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.streetName},{title:n("WT_DOOR_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.doorNo},{title:n("WT_HOUSE_NO"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.houseNo},{title:n("WT_ADDRESS_LINE1"),value:null==e||null===(f=e.address)||void 0===f?void 0:f.addressLine1},{title:n("WT_ADDRESS_LINE2"),value:null==e||null===(_=e.address)||void 0===_?void 0:_.addressLine2},{title:n("WT_LANDMARK"),value:null==e||null===(g=e.address)||void 0===g?void 0:g.landmark}].filter(e=>e.value)},{title:n("WT_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:n("WT_TANKER_TYPE"),value:null==e?void 0:e.tankerType},{title:n("WT_WATER_TYPE"),value:n(null==e?void 0:e.waterType)},{title:n("WT_TANKER_QUANTITY"),value:null==e?void 0:e.tankerQuantity},{title:n("WT_WATER_QUANTITY"),value:(null==e?void 0:e.waterQuantity)+" Ltr"},{title:n("WT_DELIVERY_DATE_TIME"),value:E(null==e?void 0:e.deliveryDate)+" ("+p(null==e?void 0:e.deliveryTime)+")"},{title:n("WT_DESCRIPTION"),value:null==e?void 0:e.description},{title:n("WT_IMMEDIATE"),value:n("Y"===(null==e?void 0:e.extraCharge)?"YES":"NO")}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var S},L=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")},w={padding:"4px 0px",justifyContent:"space-between"},R=e=>{var n,i;return l.createElement(t.Banner,{message:L(e),applicationNumber:null===(n=e.data)||void 0===n||null===(i=n.waterTankerBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("WT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},x=e=>{let{t:n,currentPage:i,columns:o,data:a,getCellProps:r,disableSort:u,onSort:s,onNextPage:c,onPrevPage:d,onPageSizeChange:v,isPaginationRequired:m,pageSizeLimit:p,sortParams:E,totalRecords:f}=e;return l.createElement(t.Table,{t:n,data:a,currentPage:i,columns:o,getCellProps:r,onNextPage:c,onPrevPage:d,pageSizeLimit:p,disableSort:u,isPaginationRequired:m,onPageSizeChange:v,onSort:s,sortParams:E,totalRecords:f})},P=e=>{let{businessService:a}=e;const{t:r}=i.useTranslation(),u=[],[s,c]=n.useState([]),{roles:d}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=u.filter(e=>e.businessService===a).filter(e=>{let{roles:t}=e;return t.some(e=>d.map(e=>{let{code:t}=e;return t}).includes(e))||!(null!=t&&t.length)});c(e)},[]),l.createElement(t.Card,{className:"employeeCard filter inboxLinks"},l.createElement("div",{className:"complaint-links-container",style:{padding:"10px"}},l.createElement("div",{className:"header"},l.createElement("span",{className:"logo"},l.createElement(t.HomeIcon,null))," ",l.createElement("span",{className:"text"},r(a+"_REQUEST"))),l.createElement("div",{className:"body"},s.map((e,t)=>{let{link:n,text:i,hyperlink:a=!1,roles:u=[]}=e;return l.createElement("span",{className:"link",key:t},a?l.createElement("a",{href:n},i):l.createElement(o.Link,{to:n},r(i)))}))))},M={mobileNumber:t.MobileNumber},k=e=>{var n;let{onSearch:o,type:a,onClose:s,searchFields:c,searchParams:d,isInboxPage:v,clearSearch:m}=e;const{t:p}=i.useTranslation(),{handleSubmit:E,reset:f,watch:_,control:g,formState:S,setValue:h}=r.useForm({defaultValues:v?d:u({locality:null,city:null},d)}),T=_(),b=innerWidth<=640;function y(){const e=c.reduce((e,t)=>u({},e,{[null==t?void 0:t.name]:""}),{});if(f(e),v){const e=u({},d);e.delete=[],c.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),o(u({},e))}else m()}const C=e=>l.createElement(t.LinkLabel,{style:u({display:"inline"},e?{margin:0}:{}),onClick:y},p("ES_COMMON_CLEAR_SEARCH"));return l.createElement("form",{onSubmit:E(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],c.forEach(t=>{e[t.name]||e.delete.push(t.name)}),o(e),"mobile"===a&&s()})},l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginBottom:"16px",marginLeft:v?"16px":"revert"}},l.createElement("div",{className:"search-complaint-container",style:{width:"100%"}},("mobile"===a||b)&&l.createElement("div",{className:"complaint-header"},l.createElement("h2",null,p("ES_COMMON_SEARCH_BY")),l.createElement("span",{onClick:s},l.createElement(t.CloseSvg,null))),l.createElement("div",{className:"complaint-input-container for-pt "+(v?"":"for-search"),style:{width:"100%",display:"grid"}},null==c||null===(n=c.filter(e=>!0))||void 0===n?void 0:n.map((e,n)=>{var i,o,a;return l.createElement("div",{key:e.name,className:"input-fields"},l.createElement("span",{className:"mobile-input"},l.createElement(t.Label,null,p(e.label)+" "+(e.isMendatory?"*":"")),l.createElement(r.Controller,e.type?{render:t=>l.createElement(null==M?void 0:M[e.type],{formValue:T,setValue:h,onChange:t.onChange,value:t.value}),name:e.name,control:g,defaultValue:""}:{render:e=>l.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:g,defaultValue:""})),null!=S&&null!==(i=S.dirtyFields)&&void 0!==i&&i[e.name]?l.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==S||null===(o=S.errors)||void 0===o||null===(a=o[e.name])||void 0===a?void 0:a.message):null)}),v&&l.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px",padding:"10px"},className:"input-fields"},l.createElement("div",null,C())),"desktop"===a&&!b&&l.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},l.createElement(t.SubmitBar,{className:"submit-bar-search",label:p("ES_COMMON_SEARCH"),disabled:!!Object.keys(S.errors).length||(()=>{var e;let t=!0;return Object.keys(T).forEach(e=>{!["locality","city"].includes(e)&&T[e]&&(t=!1)}),null==c||!c.find(e=>"locality"===e.name)||null!=T&&null!==(e=T.locality)&&void 0!==e&&e.code||(t=!0),t})(),submit:!0}),!v&&l.createElement("div",null,C()))))),("mobile"===a||b)&&l.createElement(t.ActionBar,{className:"clear-search-container"},l.createElement("button",{className:"clear-search",style:{flex:1}},C(b)),l.createElement(t.SubmitBar,{disabled:!!Object.keys(S.errors).length,label:p("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},F=["tableConfig","filterComponent"],B=e=>{let{tableConfig:o,filterComponent:a}=e,r=s(e,F);const{data:u,useNewInboxAPI:c}=r,{t:d}=i.useTranslation(),[v,m]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a)}),[p,E]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r.EmptyResultInboxComp)}),[f,_]=n.useState(!1),g=l.useMemo(()=>r.isSearch?o.searchColumns(r):o.inboxColumns(r)||[],[]);let S;return r.isLoading?S=l.createElement(t.Loader,null):f?S=null:!u||0===(null==u?void 0:u.length)||c&&null!=u&&u[0].dataEmpty?S=p&&l.createElement(p,{data:u})||(0===(null==u?void 0:u.length)||c&&null!=u&&u[0].dataEmpty?l.createElement(t.Card,{style:{marginTop:20}},d("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.Loader,null)):(null==u?void 0:u.length)>0&&(S=l.createElement(x,{t:d,data:u,columns:g,getCellProps:e=>({style:{minWidth:e.column.Header===d("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:r.onPageSizeChange,currentPage:r.currentPage,onNextPage:r.onNextPage,onPrevPage:r.onPrevPage,pageSizeLimit:r.pageSizeLimit,onSort:r.onSort,disableSort:r.disableSort,sortParams:r.sortParams,totalRecords:r.totalRecords})),l.createElement("div",{className:"inbox-container"},!r.isSearch&&l.createElement("div",{className:"filters-container"},l.createElement(P,{parentRoute:r.parentRoute,businessService:r.moduleCode}),l.createElement("div",null,l.createElement(v,{defaultSearchParams:r.defaultSearchParams,onFilterChange:r.onFilterChange,searchParams:r.searchParams,type:"desktop",useNewInboxAPI:c,statusMap:c?null==u?void 0:u[0].statusMap:null,moduleCode:r.moduleCode}))),l.createElement("div",{style:{flex:1}},l.createElement(k,{defaultSearchParams:r.defaultSearchParams,onSearch:e=>{r.onSearch(e),_(!1)},type:"desktop",searchFields:r.searchFields,isInboxPage:!(null!=r&&r.isSearch),searchParams:r.searchParams,clearSearch:()=>_(!0)}),l.createElement("div",{className:"result",style:{marginLeft:null!=r&&r.isSearch?"":"16px",flex:1}},S)))},U=e=>{const{t:o}=i.useTranslation(),[a,r]=n.useState(()=>{var t,n;return null!==(t=e.sortParams)&&void 0!==t&&null!==(n=t[0])&&void 0!==n&&n.desc?{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}});function u(){}return l.createElement(l.Fragment,null,l.createElement("div",{className:"filter"},l.createElement("div",{className:"filter-card"},l.createElement("div",{className:"heading"},l.createElement("div",{className:"filter-label"},o("SORT_BY"),":"),l.createElement("div",{className:"clearAll",onClick:u},o("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&l.createElement("span",{className:"clear-search",onClick:u},o("ES_COMMON_CLEAR_ALL")),"mobile"===e.type&&l.createElement("span",{onClick:e.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.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")}]})))))},W=e=>{let{t:i,data:o,onFilterChange:a,onSearch:r,onSort:u,serviceRequestIdKey:s,isFstpOperator:c,isLoading:d,isSearch:v,searchParams:m,searchFields:p,sortParams:E,linkPrefix:f,filterComponent:_}=e;const[g,S]=n.useState(v?"SEARCH":""),[h,T]=n.useState(!!v),[b,y]=n.useState(E),[C]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(_)});n.useEffect(()=>{g&&T(!0)},[g]);const A=()=>{T(!1),S(""),y(E)};if(d)return l.createElement(t.Loader,null);let N;return o&&0!==(null==o?void 0:o.length)?o&&(null==o?void 0:o.length)>0&&(N=l.createElement(t.DetailsCard,{data:o,serviceRequestIdKey:s,linkPrefix:f||"/digit-ui/employee/chb/"})):N=l.createElement(t.Card,{style:{marginTop:20}},i("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))),l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},r&&l.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{S("SEARCH"),T(!0)}}),!v&&a&&l.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{S("FILTER"),T(!0)}}),l.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{S("SORT"),T(!0)}})),N,h&&l.createElement(t.PopUp,null,"FILTER"===g&&l.createElement("div",{className:"popup-module"},l.createElement(C,{onFilterChange:e=>{a(e),T(!1)},Close:A,type:"mobile",searchParams:m})),"SORT"===g&&l.createElement("div",{className:"popup-module"},l.createElement(U,{type:"mobile",sortParams:E,onClose:A,onSort:u})),"SEARCH"===g&&l.createElement("div",{className:"popup-module"},l.createElement(k,{type:"mobile",onClose:A,onSearch:r,isFstpOperator:c,searchParams:m,searchFields:p}))))},H=e=>{let{classNameForMobileView:a=""}=e;const{t:r}=i.useTranslation(),u=[],[s,c]=n.useState([]),{roles:d}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];u.forEach(t=>{var n;t.accessTo?(n=t.accessTo,d.filter(e=>n.includes(e.code)).length&&e.push(t)):e.push(t)}),c(e)},[]),l.createElement(t.Card,{className:"employeeCard filter"},l.createElement("div",{className:"complaint-links-container "+a},l.createElement("div",{className:"header"},l.createElement("span",{className:"logo"},l.createElement(t.ShippingTruck,null))," ",l.createElement("span",{className:"text"},r("ES_TITLE_WT_REGISTRATION"))),l.createElement("div",{className:"body"},s.map((e,t)=>{let{link:n,text:i}=e;return l.createElement("span",{className:"link",key:t},l.createElement(o.Link,{to:n},i))}))))},j=e=>{let{data:t,isLoading:n,isSearch:o,searchFields:a,onFilterChange:r,onSearch:u,onSort:s,parentRoute:c,searchParams:d,sortParams:v,linkPrefix:m,tableConfig:p,filterComponent:E}=e;const{t:f}=i.useTranslation();return l.createElement("div",{style:{padding:0}},l.createElement("div",{className:"inbox-container"},l.createElement("div",{className:"filters-container"},!o&&l.createElement(H,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:c,isMobile:!0}),l.createElement(W,{t:f,data:null==t?void 0:t.map(e=>{const t={};return(o?p.searchColumns():p.inboxColumns()).forEach(n=>{n.mobileCell&&(t[n.Header]=n.mobileCell(e))}),t}),onFilterChange:r,isLoading:n,isSearch:o,onSearch:u,onSort:s,searchParams:d,searchFields:a,linkPrefix:m,sortParams:v,serviceRequestIdKey:null==p?void 0:p.serviceRequestIdKey,filterComponent:E}))))},z=["isFetching","isLoading","searchResponseKey","data","searchFields"],V=e=>{var t,o,a,r,c;let{useNewInboxAPI:d,parentRoute:v,moduleCode:m,initialStates:p={},filterComponent:E,isInbox:f,rawWfHandler:_,rawSearchHandler:g,combineResponse:S,wfConfig:h,searchConfig:T,middlewaresWf:b,middlewareSearch:y,EmptyResultInboxComp:C}=e;const A=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),N=Digit.UserService.getUser().info,{t:D}=i.useTranslation(),[I,O]=n.useState(()=>f?{}:{enabled:!1}),[L,w]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("WTInboxTableConfig")}),[R,x]=n.useState(p.pageOffset||0),[P,M]=n.useState(p.pageSize||10),[k,F]=n.useState(p.sortParams||[{id:"createdTime",desc:!0}]),[U,W]=n.useState(p.searchParams||{});let H=window.Digit.Utils.browser.isMobile(),V=H?{limit:100,offset:0,sortBy:null==k||null===(t=k[0])||void 0===t?void 0:t.id,sortOrder:null!=k&&null!==(o=k[0])&&void 0!==o&&o.desc?"DESC":"ASC"}:{limit:P,offset:R,sortBy:null==k||null===(a=k[0])||void 0===a?void 0:a.id,sortOrder:null!=k&&null!==(r=k[0])&&void 0!==r&&r.desc?"DESC":"ASC"};const K=d?Digit.Hooks.useNewInboxGeneral({tenantId:A,ModuleCode:m,filters:u({},U,V,{sortParams:k})}):Digit.Hooks.useInboxGeneral({tenantId:A,businessService:m,isInbox:f,filters:u({},U,V,{sortParams:k}),rawWfHandler:_,rawSearchHandler:g,combineResponse:S,wfConfig:h,searchConfig:u({},I,T),middlewaresWf:b,middlewareSearch:y}),{isLoading:G,data:q,searchFields:Y}=K,X=s(K,z);n.useEffect(()=>{x(0)},[U]);const Q=e=>{let t=e.delete,n=u({},U,e);t&&t.forEach(e=>delete n[e]),delete e.delete,W(u({},n)),O({enabled:!0})},Z=n.useCallback(e=>{0!==e.length&&F(e)},[]);var $,J;if(null!==(null==X||null===(c=X.data)||void 0===c?void 0:c.length))return H?l.createElement(j,{data:q,isLoading:G,isSearch:!f,searchFields:Y,onFilterChange:Q,onSearch:Q,onSort:Z,parentRoute:v,searchParams:U,sortParams:k,linkPrefix:v+"/application-details/",tableConfig:null!=X&&X.tableConfig?null===($=res)||void 0===$?void 0:$.tableConfig:L(D)[m],filterComponent:E,EmptyResultInboxComp:C,useNewInboxAPI:d}):l.createElement("div",{style:{padding:"CITIZEN"===(null==N?void 0:N.type)?"0 24px":""}},l.createElement(B,{moduleCode:m,data:q,tableConfig:L(D)[m],isLoading:G,defaultSearchParams:p.searchParams,isSearch:!f,onFilterChange:Q,searchFields:Y,onSearch:Q,onSort:Z,onNextPage:()=>{x(e=>e+P)},onPrevPage:()=>{x(e=>e-P)},currentPage:Math.floor(R/P),pageSizeLimit:P,disableSort:!1,onPageSizeChange:e=>{M(Number(e.target.value))},parentRoute:v,searchParams:U,sortParams:k,totalRecords:Number(null==q||null===(J=q[0])||void 0===J?void 0:J.totalCount),filterComponent:E,EmptyResultInboxComp:C,useNewInboxAPI:d}))},K=e=>{var n,a,r,s;let{path:c}=e;const{t:d}=i.useTranslation(),v=o.useLocation();sessionStorage.removeItem("revalidateddone");const m={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["watertanker"],applicationStatus:[],locality:[]}},p={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["mobileToilet"],applicationStatus:[],locality:[]}},E={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["treePruning"],applicationStatus:[],locality:[]}},f=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("ApplicationDetails"),_=null===(r=Digit)||void 0===r||null===(s=r.ComponentRegistryService)||void 0===s?void 0:s.getComponent("WTCreate");return l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,l.createElement("div",{className:"form-container"},l.createElement(t.ModuleHeader,{leftContent:l.createElement(l.Fragment,null,l.createElement(t.ArrowLeft,{className:"icon"}),"Back"),onLeftClick:()=>window.history.back(),breadcrumbs:(()=>{const e=v.pathname;let n="WT";e.includes("/mt/")&&(n="MT"),e.includes("/tp/")&&(n="TP");let l=[{icon:t.HomeIcon,label:d("HOME"),path:"/digit-ui/employee"},{label:d("WT_MODULE_NAME"),path:"/digit-ui/employee/module/details?moduleName="+n}];if(e.includes("/inbox")){let t="ES_COMMON_INBOX";e.includes("/tp/inbox")&&(t="TP_INBOX"),l.push({label:d(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"),l.push({label:d(t)})}else if(e.includes("/request-service"))l.push({label:d("WT_REQUEST_SERVICE")});else if(e.includes("/booking-details")||e.includes("/bookingsearch/booking-details")){const t=e.includes("/bookingsearch");l.push(t?{label:d("WT_SEARCH_BOOKINGS"),path:c+"/my-bookings"}:{label:d("ES_COMMON_INBOX"),path:c+"/inbox"}),l.push({label:d("WT_BOOKING_DETAILS")})}return l})()}),l.createElement(t.PrivateRoute,{path:c+"/inbox",component:()=>l.createElement(V,{useNewInboxAPI:!0,parentRoute:c,businessService:"watertanker",moduleCode:"WT",filterComponent:"WT_INBOX_FILTER",initialStates:m,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:c+"/mt/inbox",component:()=>l.createElement(V,{useNewInboxAPI:!0,parentRoute:c,moduleCode:"MT",businessService:"mobileToilet",filterComponent:"WT_INBOX_FILTER",initialStates:p,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:c+"/tp/inbox",component:()=>l.createElement(V,{useNewInboxAPI:!0,parentRoute:c,moduleCode:"TP",businessService:"treePruning",filterComponent:"WT_INBOX_FILTER",initialStates:E,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:c+"/request-service",component:_}),l.createElement(t.PrivateRoute,{path:c+"/mt/request-service",component:_}),l.createElement(t.PrivateRoute,{path:c+"/tp/request-service",component:_}),l.createElement(t.PrivateRoute,{path:c+"/booking-details/:id",component:()=>l.createElement(f,{parentRoute:c})}),l.createElement(t.PrivateRoute,{path:c+"/bookingsearch/booking-details/:id",component:()=>l.createElement(f,{parentRoute:c})}),l.createElement(t.PrivateRoute,{path:c+"/my-bookings",component:e=>l.createElement(S,u({},e,{parentRoute:c,moduleCode:"WT"}))}),l.createElement(t.PrivateRoute,{path:c+"/mt/my-bookings",component:e=>l.createElement(S,u({},e,{parentRoute:c,moduleCode:"MT"}))}),l.createElement(t.PrivateRoute,{path:c+"/tp/my-bookings",component:e=>l.createElement(S,u({},e,{parentRoute:c,moduleCode:"TP"}))}))))},G=e=>{var n,a;let{application:r,tenantId:u,buttonLabel:s}=e,c=null==r?void 0:r.bookingNo.split("-")[0];const{t:d}=i.useTranslation();return l.createElement(t.Card,null,l.createElement(t.KeyNote,{keyValue:d("BOOKING_NO"),note:null==r?void 0:r.bookingNo}),l.createElement(t.KeyNote,{keyValue:d("APPLICANT_NAME"),note:null==r||null===(n=r.applicantDetail)||void 0===n?void 0:n.name}),l.createElement(t.KeyNote,{keyValue:d("MOBILE_NUMBER"),note:d(""+(null==r||null===(a=r.applicantDetail)||void 0===a?void 0:a.mobileNumber))}),l.createElement(t.KeyNote,{keyValue:d("LOCALITY"),note:d(""+(null==r?void 0:r.localityCode))}),l.createElement(t.KeyNote,{keyValue:d("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:d(""+(null==r?void 0:r.bookingStatus))}),l.createElement("div",null,"WT"===c&&l.createElement(o.Link,{to:"/digit-ui/citizen/wt/booking/waterTanker/"+(null==r?void 0:r.bookingNo)+"/"+u},l.createElement(t.SubmitBar,{label:s})),"MT"===c&&l.createElement(o.Link,{to:"/digit-ui/citizen/wt/booking/mobileToilet/"+(null==r?void 0:r.bookingNo)+"/"+u},l.createElement(t.SubmitBar,{label:s})),"TP"===c&&l.createElement(o.Link,{to:"/digit-ui/citizen/wt/booking/treePruning/"+(null==r?void 0:r.bookingNo)+"/"+u},l.createElement(t.SubmitBar,{label:s}))))};var q=Array.isArray,Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function X(e,t){return e(t={exports:{}},t.exports),t.exports}var Q,Z="object"==typeof Y&&Y&&Y.Object===Object&&Y,$="object"==typeof self&&self&&self.Object===Object&&self,J=Z||$||Function("return this")(),ee=J.Symbol,te=Object.prototype,ne=te.hasOwnProperty,le=te.toString,ie=ee?ee.toStringTag:void 0,oe=Object.prototype.toString,ae=ee?ee.toStringTag:void 0,re=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ae&&ae in Object(e)?function(e){var t=ne.call(e,ie),n=e[ie];try{e[ie]=void 0;var l=!0}catch(e){}var i=le.call(e);return l&&(t?e[ie]=n:delete e[ie]),i}(e):function(e){return oe.call(e)}(e)},ue=function(e){return null!=e&&"object"==typeof e},se=function(e){return"symbol"==typeof e||ue(e)&&"[object Symbol]"==re(e)},ce=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,de=/^\w*$/,ve=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},me=function(e){if(!ve(e))return!1;var t=re(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},pe=J["__core-js_shared__"],Ee=(Q=/[^.]+$/.exec(pe&&pe.keys&&pe.keys.IE_PROTO||""))?"Symbol(src)_1."+Q:"",fe=Function.prototype.toString,_e=function(e){if(null!=e){try{return fe.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ge=/^\[object .+?Constructor\]$/,Se=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),he=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!ve(e)||(t=e,Ee&&Ee in t))&&(me(e)?Se:ge).test(_e(e));var t}(n)?n:void 0},Te=he(Object,"create"),be=Object.prototype.hasOwnProperty,ye=Object.prototype.hasOwnProperty;function Ce(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}Ce.prototype.clear=function(){this.__data__=Te?Te(null):{},this.size=0},Ce.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ce.prototype.get=function(e){var t=this.__data__;if(Te){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},Ce.prototype.has=function(e){var t=this.__data__;return Te?void 0!==t[e]:ye.call(t,e)},Ce.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Te&&void 0===t?"__lodash_hash_undefined__":t,this};var Ae=Ce,Ne=function(e,t){return e===t||e!=e&&t!=t},De=function(e,t){for(var n=e.length;n--;)if(Ne(e[n][0],t))return n;return-1},Ie=Array.prototype.splice;function Oe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}Oe.prototype.clear=function(){this.__data__=[],this.size=0},Oe.prototype.delete=function(e){var t=this.__data__,n=De(t,e);return!(n<0||(n==t.length-1?t.pop():Ie.call(t,n,1),--this.size,0))},Oe.prototype.get=function(e){var t=this.__data__,n=De(t,e);return n<0?void 0:t[n][1]},Oe.prototype.has=function(e){return De(this.__data__,e)>-1},Oe.prototype.set=function(e,t){var n=this.__data__,l=De(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Le=Oe,we=he(J,"Map"),Re=function(e,t){var n,l,i=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function xe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}xe.prototype.clear=function(){this.size=0,this.__data__={hash:new Ae,map:new(we||Le),string:new Ae}},xe.prototype.delete=function(e){var t=Re(this,e).delete(e);return this.size-=t?1:0,t},xe.prototype.get=function(e){return Re(this,e).get(e)},xe.prototype.has=function(e){return Re(this,e).has(e)},xe.prototype.set=function(e,t){var n=Re(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Pe=xe;function Me(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");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(Me.Cache||Pe),n}Me.Cache=Pe;var ke,Fe,Be=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ue=/\\(\\)?/g,We=(ke=Me(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Be,function(e,n,l,i){t.push(l?i.replace(Ue,"$1"):n||e)}),t},function(e){return 500===Fe.size&&Fe.clear(),e}),Fe=ke.cache,ke),He=ee?ee.prototype:void 0,je=He?He.toString:void 0,ze=function(e){if("string"==typeof e||se(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Ve=function(e,t,n){var l=null==e?void 0:function(e,t){for(var n=0,l=(t=function(e,t){return q(e)?e:function(e,t){if(q(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!se(e))||de.test(e)||!ce.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:We(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(q(t))return function(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}(t,e)+"";if(se(t))return je?je.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}(e)}(e))}(t,e)).length;null!=e&&n<l;)e=e[ze(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l},Ke=X(function(e,t){(function(){var n="Expected a function",l="__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]",u="[object Date]",s="[object Error]",c="[object Function]",d="[object GeneratorFunction]",v="[object Map]",m="[object Number]",p="[object Object]",E="[object RegExp]",f="[object Set]",_="[object String]",g="[object Symbol]",S="[object WeakMap]",h="[object ArrayBuffer]",T="[object DataView]",b="[object Float32Array]",y="[object Float64Array]",C="[object Int8Array]",A="[object Int16Array]",N="[object Int32Array]",D="[object Uint8Array]",I="[object Uint16Array]",O="[object Uint32Array]",L=/\b__p \+= '';/g,w=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,x=/&(?:amp|lt|gt|quot|#39);/g,P=/[&<>"']/g,M=RegExp(x.source),k=RegExp(P.source),F=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,U=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,j=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,V=RegExp(z.source),K=/^\s+/,G=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,Q=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,$=/[()=,{}\[\]\/\s]/,J=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,se=/['\n\r\u2028\u2029\\]/g,ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\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",ve="["+de+"]",me="["+ce+"]",pe="\\d+",Ee="[a-z\\xdf-\\xf6\\xf8-\\xff]",fe="[^\\ud800-\\udfff"+de+pe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_e="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",Se="(?:\\ud83c[\\udde6-\\uddff]){2}",he="[\\ud800-\\udbff][\\udc00-\\udfff]",Te="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+Ee+"|"+fe+")",ye="(?:"+Te+"|"+fe+")",Ce="(?:"+me+"|"+_e+")?",Ae="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[ge,Se,he].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",Ne="(?:"+["[\\u2700-\\u27bf]",Se,he].join("|")+")"+Ae,De="(?:"+[ge+me+"?",me,Se,he,"[\\ud800-\\udfff]"].join("|")+")",Ie=RegExp("['’]","g"),Oe=RegExp(me,"g"),Le=RegExp(_e+"(?="+_e+")|"+De+Ae,"g"),we=RegExp([Te+"?"+Ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Te,"$"].join("|")+")",ye+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,Te+be,"$"].join("|")+")",Te+"?"+be+"+(?:['’](?: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_])",pe,Ne].join("|"),"g"),Re=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),xe=/[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"],Me=-1,ke={};ke[b]=ke[y]=ke[C]=ke[A]=ke[N]=ke[D]=ke["[object Uint8ClampedArray]"]=ke[I]=ke[O]=!0,ke[o]=ke[a]=ke[h]=ke[r]=ke[T]=ke[u]=ke[s]=ke[c]=ke[v]=ke[m]=ke[p]=ke[E]=ke[f]=ke[_]=ke[S]=!1;var Fe={};Fe[o]=Fe[a]=Fe[h]=Fe[T]=Fe[r]=Fe[u]=Fe[b]=Fe[y]=Fe[C]=Fe[A]=Fe[N]=Fe[v]=Fe[m]=Fe[p]=Fe[E]=Fe[f]=Fe[_]=Fe[g]=Fe[D]=Fe["[object Uint8ClampedArray]"]=Fe[I]=Fe[O]=!0,Fe[s]=Fe[c]=Fe[S]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,We=parseInt,He="object"==typeof Y&&Y&&Y.Object===Object&&Y,je="object"==typeof self&&self&&self.Object===Object&&self,ze=He||je||Function("return this")(),Ve=t&&!t.nodeType&&t,Ke=Ve&&e&&!e.nodeType&&e,Ge=Ke&&Ke.exports===Ve,qe=Ge&&He.process,Ye=function(){try{return Ke&&Ke.require&&Ke.require("util").types||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Xe=Ye&&Ye.isArrayBuffer,Qe=Ye&&Ye.isDate,Ze=Ye&&Ye.isMap,$e=Ye&&Ye.isRegExp,Je=Ye&&Ye.isSet,et=Ye&&Ye.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,l){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(l,a,n(a),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&_t(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function st(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function ct(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function dt(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function vt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function mt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var pt=Tt("length");function Et(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function ft(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function _t(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):ft(e,St,n)}function gt(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function St(e){return e!=e}function ht(e,t){var n=null==e?0:e.length;return n?Ct(e,t)/n:NaN}function Tt(e){return function(t){return null==t?void 0:t[e]}}function bt(e){return function(t){return null==e?void 0:e[t]}}function yt(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function Ct(e,t){for(var n,l=-1,i=e.length;++l<i;){var o=t(e[l]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function At(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Nt(e){return e?e.slice(0,Vt(e)+1).replace(K,""):e}function Dt(e){return function(t){return e(t)}}function It(e,t){return st(t,function(t){return e[t]})}function Ot(e,t){return e.has(t)}function Lt(e,t){for(var n=-1,l=e.length;++n<l&&_t(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&&_t(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var xt=bt({"À":"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"}),Pt=bt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Mt(e){return"\\"+Be[e]}function kt(e){return Re.test(e)}function Ft(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Bt(e,t){return function(n){return e(t(n))}}function Ut(e,t){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var r=e[n];r!==t&&r!==l||(e[n]=l,a[o++]=n)}return a}function Wt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function jt(e){return kt(e)?function(e){for(var t=Le.lastIndex=0;Le.test(e);)++t;return t}(e):pt(e)}function zt(e){return kt(e)?function(e){return e.match(Le)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&G.test(e.charAt(t)););return t}var Kt=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Gt=function e(t){var G=(t=null==t?ze:Gt.defaults(ze.Object(),t,Gt.pick(ze,Pe))).Array,Y=t.Date,ce=t.Error,de=t.Function,ve=t.Math,me=t.Object,pe=t.RegExp,Ee=t.String,fe=t.TypeError,_e=G.prototype,ge=me.prototype,Se=t["__core-js_shared__"],he=de.prototype.toString,Te=ge.hasOwnProperty,be=0,ye=function(){var e=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ce=ge.toString,Ae=he.call(me),Ne=ze._,De=pe("^"+he.call(Te).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=Ge?t.Buffer:void 0,Re=t.Symbol,Be=t.Uint8Array,He=Le?Le.allocUnsafe:void 0,je=Bt(me.getPrototypeOf,me),Ve=me.create,Ke=ge.propertyIsEnumerable,qe=_e.splice,Ye=Re?Re.isConcatSpreadable:void 0,pt=Re?Re.iterator:void 0,bt=Re?Re.toStringTag:void 0,qt=function(){try{var e=Zi(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Yt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=Y&&Y.now!==ze.Date.now&&Y.now,Qt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Zt=ve.ceil,$t=ve.floor,Jt=me.getOwnPropertySymbols,en=Le?Le.isBuffer:void 0,tn=t.isFinite,nn=_e.join,ln=Bt(me.keys,me),on=ve.max,an=ve.min,rn=Y.now,un=t.parseInt,sn=ve.random,cn=_e.reverse,dn=Zi(t,"DataView"),vn=Zi(t,"Map"),mn=Zi(t,"Promise"),pn=Zi(t,"Set"),En=Zi(t,"WeakMap"),fn=Zi(me,"create"),_n=En&&new En,gn={},Sn=Ao(dn),hn=Ao(vn),Tn=Ao(mn),bn=Ao(pn),yn=Ao(En),Cn=Re?Re.prototype:void 0,An=Cn?Cn.valueOf:void 0,Nn=Cn?Cn.toString:void 0;function Dn(e){if(ja(e)&&!wa(e)&&!(e instanceof wn)){if(e instanceof Ln)return e;if(Te.call(e,"__wrapped__"))return No(e)}return new Ln(e)}var In=function(){function e(){}return function(t){if(!Ha(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function On(){}function Ln(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function wn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Mn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Pn;++t<n;)this.add(e[t])}function kn(e){var t=this.__data__=new xn(e);this.size=t.size}function Fn(e,t){var n=wa(e),l=!n&&La(e),i=!n&&!l&&Ma(e),o=!n&&!l&&!i&&Qa(e),a=n||l||i||o,r=a?At(e.length,Ee):[],u=r.length;for(var s in e)!t&&!Te.call(e,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||io(s,u))||r.push(s);return r}function Bn(e){var t=e.length;return t?e[Pl(0,t-1)]:void 0}function Un(e,t){return bo(Ei(e),Yn(t,0,e.length))}function Wn(e){return bo(Ei(e))}function Hn(e,t,n){(void 0!==n&&!Da(e[t],n)||void 0===n&&!(t in e))&&Gn(e,t,n)}function jn(e,t,n){var l=e[t];Te.call(e,t)&&Da(l,n)&&(void 0!==n||t in e)||Gn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(Da(e[n][0],t))return n;return-1}function Vn(e,t,n,l){return Jn(e,function(e,i,o){t(l,e,n(e),o)}),l}function Kn(e,t){return e&&fi(t,gr(t),e)}function Gn(e,t,n){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qn(e,t){for(var n=-1,l=t.length,i=G(l),o=null==e;++n<l;)i[n]=o?void 0:mr(e,t[n]);return i}function Yn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,l,i,a){var s,S=1&t,L=2&t,w=4&t;if(n&&(s=i?n(e,l,i,a):n(e)),void 0!==s)return s;if(!Ha(e))return e;var R=wa(e);if(R){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Te.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!S)return Ei(e,s)}else{var x=eo(e),P=x==c||x==d;if(Ma(e))return si(e,S);if(x==p||x==o||P&&!i){if(s=L||P?{}:no(e),!S)return L?function(e,t){return fi(e,Ji(e),t)}(e,function(e,t){return e&&fi(t,Sr(t),e)}(s,e)):function(e,t){return fi(e,$i(e),t)}(e,Kn(s,e))}else{if(!Fe[x])return i?e:{};s=function(e,t,n){var l=e.constructor;switch(t){case h:return ci(e);case r:case u:return new l(+e);case T:return function(e,t){var n=t?ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case b:case y:case C:case A:case N:case D:case"[object Uint8ClampedArray]":case I:case O:return di(e,n);case v:return new l;case m:case _:return new l(e);case E:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case f:return new l;case g:return An?me(An.call(e)):{}}}(e,x,S)}}a||(a=new kn);var M=a.get(e);if(M)return M;a.set(e,s),qa(e)?e.forEach(function(l){s.add(Xn(l,t,n,l,e,a))}):za(e)&&e.forEach(function(l,i){s.set(i,Xn(l,t,n,i,e,a))});var k=R?void 0:(w?L?Vi:zi:L?Sr:gr)(e);return lt(k||e,function(l,i){k&&(l=e[i=l]),jn(s,i,Xn(l,t,n,i,e,a))}),s}function Qn(e,t,n){var l=n.length;if(null==e)return!l;for(e=me(e);l--;){var i=n[l],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Zn(e,t,l){if("function"!=typeof e)throw new fe(n);return go(function(){e.apply(void 0,l)},t)}function $n(e,t,n,l){var i=-1,o=rt,a=!0,r=e.length,u=[],s=t.length;if(!r)return u;n&&(t=st(t,Dt(n))),l?(o=ut,a=!1):t.length>=200&&(o=Ot,a=!1,t=new Mn(t));e:for(;++i<r;){var c=e[i],d=null==n?c:n(c);if(c=l||0!==c?c:0,a&&d==d){for(var v=s;v--;)if(t[v]===d)continue e;u.push(c)}else o(t,d,l)||u.push(c)}return u}Dn.templateSettings={escape:F,evaluate:B,interpolate:U,variable:"",imports:{_:Dn}},(Dn.prototype=On.prototype).constructor=Dn,(Ln.prototype=In(On.prototype)).constructor=Ln,(wn.prototype=In(On.prototype)).constructor=wn,Rn.prototype.clear=function(){this.__data__=fn?fn(null):{},this.size=0},Rn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Rn.prototype.get=function(e){var t=this.__data__;if(fn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Te.call(t,e)?t[e]:void 0},Rn.prototype.has=function(e){var t=this.__data__;return fn?void 0!==t[e]:Te.call(t,e)},Rn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=fn&&void 0===t?"__lodash_hash_undefined__":t,this},xn.prototype.clear=function(){this.__data__=[],this.size=0},xn.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},xn.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},xn.prototype.has=function(e){return zn(this.__data__,e)>-1},xn.prototype.set=function(e,t){var n=this.__data__,l=zn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},Pn.prototype.clear=function(){this.size=0,this.__data__={hash:new Rn,map:new(vn||xn),string:new Rn}},Pn.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},Pn.prototype.get=function(e){return Xi(this,e).get(e)},Pn.prototype.has=function(e){return Xi(this,e).has(e)},Pn.prototype.set=function(e,t){var n=Xi(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Mn.prototype.add=Mn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Mn.prototype.has=function(e){return this.__data__.has(e)},kn.prototype.clear=function(){this.__data__=new xn,this.size=0},kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},kn.prototype.get=function(e){return this.__data__.get(e)},kn.prototype.has=function(e){return this.__data__.has(e)},kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof xn){var l=n.__data__;if(!vn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pn(l)}return n.set(e,t),this.size=n.size,this};var Jn=Si(rl),el=Si(ul,!0);function tl(e,t){var n=!0;return Jn(e,function(e,l,i){return n=!!t(e,l,i)}),n}function nl(e,t,n){for(var l=-1,i=e.length;++l<i;){var o=e[l],a=t(o);if(null!=a&&(void 0===r?a==a&&!Xa(a):n(a,r)))var r=a,u=o}return u}function ll(e,t){var n=[];return Jn(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function il(e,t,n,l,i){var o=-1,a=e.length;for(n||(n=lo),i||(i=[]);++o<a;){var r=e[o];t>0&&n(r)?t>1?il(r,t-1,n,l,i):ct(i,r):l||(i[i.length]=r)}return i}var ol=hi(),al=hi(!0);function rl(e,t){return e&&ol(e,t,gr)}function ul(e,t){return e&&al(e,t,gr)}function sl(e,t){return at(t,function(t){return Ba(e[t])})}function cl(e,t){for(var n=0,l=(t=oi(t,e)).length;null!=e&&n<l;)e=e[Co(t[n++])];return n&&n==l?e:void 0}function dl(e,t,n){var l=t(e);return wa(e)?l:ct(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in me(e)?function(e){var t=Te.call(e,bt),n=e[bt];try{e[bt]=void 0;var l=!0}catch(e){}var i=Ce.call(e);return l&&(t?e[bt]=n:delete e[bt]),i}(e):function(e){return Ce.call(e)}(e)}function ml(e,t){return e>t}function pl(e,t){return null!=e&&Te.call(e,t)}function El(e,t){return null!=e&&t in me(e)}function fl(e,t,n){for(var l=n?ut:rt,i=e[0].length,o=e.length,a=o,r=G(o),u=Infinity,s=[];a--;){var c=e[a];a&&t&&(c=st(c,Dt(t))),u=an(c.length,u),r[a]=!n&&(t||i>=120&&c.length>=120)?new Mn(a&&c):void 0}c=e[0];var d=-1,v=r[0];e:for(;++d<i&&s.length<u;){var m=c[d],p=t?t(m):m;if(m=n||0!==m?m:0,!(v?Ot(v,p):l(s,p,n))){for(a=o;--a;){var E=r[a];if(!(E?Ot(E,p):l(e[a],p,n)))continue e}v&&v.push(p),s.push(m)}}return s}function _l(e,t,n){var l=null==(e=po(e,t=oi(t,e)))?e:e[Co(Fo(t))];return null==l?void 0:tt(l,e,n)}function gl(e){return ja(e)&&vl(e)==o}function Sl(e,t,n,l,i){return e===t||(null==e||null==t||!ja(e)&&!ja(t)?e!=e&&t!=t:function(e,t,n,l,i,c){var d=wa(e),S=wa(t),b=d?a:eo(e),y=S?a:eo(t),C=(b=b==o?p:b)==p,A=(y=y==o?p:y)==p,N=b==y;if(N&&Ma(e)){if(!Ma(t))return!1;d=!0,C=!1}if(N&&!C)return c||(c=new kn),d||Qa(e)?Hi(e,t,n,l,i,c):function(e,t,n,l,i,o,a){switch(n){case T:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case h:return!(e.byteLength!=t.byteLength||!o(new Be(e),new Be(t)));case r:case u:case m:return Da(+e,+t);case s:return e.name==t.name&&e.message==t.message;case E:case _:return e==t+"";case v:var c=Ft;case f:if(c||(c=Wt),e.size!=t.size&&!(1&l))return!1;var d=a.get(e);if(d)return d==t;l|=2,a.set(e,t);var p=Hi(c(e),c(t),l,i,o,a);return a.delete(e),p;case g:if(An)return An.call(e)==An.call(t)}return!1}(e,t,b,n,l,i,c);if(!(1&n)){var D=C&&Te.call(e,"__wrapped__"),I=A&&Te.call(t,"__wrapped__");if(D||I){var O=D?e.value():e,L=I?t.value():t;return c||(c=new kn),i(O,L,n,l,c)}}return!!N&&(c||(c=new kn),function(e,t,n,l,i,o){var a=1&n,r=zi(e),u=r.length;if(u!=zi(t).length&&!a)return!1;for(var s=u;s--;){var c=r[s];if(!(a?c in t:Te.call(t,c)))return!1}var d=o.get(e),v=o.get(t);if(d&&v)return d==t&&v==e;var m=!0;o.set(e,t),o.set(t,e);for(var p=a;++s<u;){var E=e[c=r[s]],f=t[c];if(l)var _=a?l(f,E,c,t,e,o):l(E,f,c,e,t,o);if(!(void 0===_?E===f||i(E,f,n,l,o):_)){m=!1;break}p||(p="constructor"==c)}if(m&&!p){var g=e.constructor,S=t.constructor;g==S||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof S&&S instanceof S||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,n,l,i,c))}(e,t,n,l,Sl,i))}function hl(e,t,n,l){var i=n.length,o=i,a=!l;if(null==e)return!o;for(e=me(e);i--;){var r=n[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=n[i])[0],s=e[u],c=r[1];if(a&&r[2]){if(void 0===s&&!(u in e))return!1}else{var d=new kn;if(l)var v=l(s,c,u,e,t,d);if(!(void 0===v?Sl(c,s,3,l,d):v))return!1}}return!0}function Tl(e){return!(!Ha(e)||(t=e,ye&&ye in t))&&(Ba(e)?De:ie).test(Ao(e));var t}function bl(e){return"function"==typeof e?e:null==e?Vr:"object"==typeof e?wa(e)?Dl(e[0],e[1]):Nl(e):Jr(e)}function yl(e){if(!so(e))return ln(e);var t=[];for(var n in me(e))Te.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cl(e,t){return e<t}function Al(e,t){var n=-1,l=xa(e)?G(e.length):[];return Jn(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Nl(e){var t=Qi(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(n){return n===e||hl(n,e,t)}}function Dl(e,t){return ao(e)&&co(t)?vo(Co(e),t):function(n){var l=mr(n,e);return void 0===l&&l===t?pr(n,e):Sl(t,l,3)}}function Il(e,t,n,l,i){e!==t&&ol(t,function(o,a){if(i||(i=new kn),Ha(o))!function(e,t,n,l,i,o,a){var r=fo(e,n),u=fo(t,n),s=a.get(u);if(s)Hn(e,n,s);else{var c=o?o(r,u,n+"",e,t,a):void 0,d=void 0===c;if(d){var v=wa(u),m=!v&&Ma(u),p=!v&&!m&&Qa(u);c=u,v||m||p?wa(r)?c=r:Pa(r)?c=Ei(r):m?(d=!1,c=si(u,!0)):p?(d=!1,c=di(u,!0)):c=[]:Ka(u)||La(u)?(c=r,La(r)?c=ir(r):Ha(r)&&!Ba(r)||(c=no(u))):d=!1}d&&(a.set(u,c),i(c,u,l,o,a),a.delete(u)),Hn(e,n,c)}}(e,t,a,n,Il,l,i);else{var r=l?l(fo(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Hn(e,a,r)}},Sr)}function Ol(e,t){var n=e.length;if(n)return io(t+=t<0?n:0,n)?e[t]:void 0}function Ll(e,t,n){t=t.length?st(t,function(e){return wa(e)?function(t){return cl(t,1===e.length?e[0]:e)}:e}):[Vr];var l=-1;return t=st(t,Dt(Yi())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,a=i.length,r=n.length;++l<a;){var u=vi(i[l],o[l]);if(u)return l>=r?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Al(e,function(e,n,i){return{criteria:st(t,function(t){return t(e)}),index:++l,value:e}}))}function wl(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var a=t[l],r=cl(e,a);n(r,a)&&Ul(o,oi(a,e),r)}return o}function Rl(e,t,n,l){var i=l?gt:_t,o=-1,a=t.length,r=e;for(e===t&&(t=Ei(t)),n&&(r=st(e,Dt(n)));++o<a;)for(var u=0,s=t[o],c=n?n(s):s;(u=i(r,c,u,l))>-1;)r!==e&&qe.call(r,u,1),qe.call(e,u,1);return e}function xl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var i=t[n];if(n==l||i!==o){var o=i;io(i)?qe.call(e,i,1):Zl(e,i)}}return e}function Pl(e,t){return e+$t(sn()*(t-e+1))}function Ml(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=$t(t/2))&&(e+=e)}while(t);return n}function kl(e,t){return So(mo(e,t,Vr),e+"")}function Fl(e){return Bn(Dr(e))}function Bl(e,t){var n=Dr(e);return bo(n,Yn(t,0,n.length))}function Ul(e,t,n,l){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 u=Co(t[i]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var c=r[u];void 0===(s=l?l(c,u,r):void 0)&&(s=Ha(c)?c:io(t[i+1])?[]:{})}jn(r,u,s),r=r[u]}return e}var Wl=_n?function(e,t){return _n.set(e,t),e}:Vr,Hl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:Hr(t),writable:!0})}:Vr;function jl(e){return bo(Dr(e))}function zl(e,t,n){var l=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=G(i);++l<i;)o[l]=e[l+t];return o}function Vl(e,t){var n;return Jn(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Kl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var o=l+i>>>1,a=e[o];null!==a&&!Xa(a)&&(n?a<=t:a<t)?l=o+1:i=o}return i}return Gl(e,t,Vr,n)}function Gl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,r=null===t,u=Xa(t),s=void 0===t;i<o;){var c=$t((i+o)/2),d=n(e[c]),v=void 0!==d,m=null===d,p=d==d,E=Xa(d);if(a)var f=l||p;else f=s?p&&(l||v):r?p&&v&&(l||!m):u?p&&v&&!m&&(l||!E):!m&&!E&&(l?d<=t:d<t);f?i=c+1:o=c}return an(o,4294967294)}function ql(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var a=e[n],r=t?t(a):a;if(!n||!Da(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function Yl(e){return"number"==typeof e?e:Xa(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(wa(e))return st(e,Xl)+"";if(Xa(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ql(e,t,n){var l=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(n)a=!1,i=ut;else if(o>=200){var s=t?null:Mi(e);if(s)return Wt(s);a=!1,i=Ot,u=new Mn}else u=t?[]:r;e:for(;++l<o;){var c=e[l],d=t?t(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var v=u.length;v--;)if(u[v]===d)continue e;t&&u.push(d),r.push(c)}else i(u,d,n)||(u!==r&&u.push(d),r.push(c))}return r}function Zl(e,t){return null==(e=po(e,t=oi(t,e)))||delete e[Co(Fo(t))]}function $l(e,t,n,l){return Ul(e,t,n(cl(e,t)),l)}function Jl(e,t,n,l){for(var i=e.length,o=l?i:-1;(l?o--:++o<i)&&t(e[o],o,e););return n?zl(e,l?0:o,l?o+1:i):zl(e,l?o+1:0,l?i:o)}function ei(e,t){var n=e;return n instanceof wn&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([e],t.args))},n)}function ti(e,t,n){var l=e.length;if(l<2)return l?Ql(e[0]):[];for(var i=-1,o=G(l);++i<l;)for(var a=e[i],r=-1;++r<l;)r!=i&&(o[i]=$n(o[i]||a,e[r],t,n));return Ql(il(o,1),t,n)}function ni(e,t,n){for(var l=-1,i=e.length,o=t.length,a={};++l<i;)n(a,e[l],l<o?t[l]:void 0);return a}function li(e){return Pa(e)?e:[]}function ii(e){return"function"==typeof e?e:Vr}function oi(e,t){return wa(e)?e:ao(e,t)?[e]:yo(or(e))}var ai=kl;function ri(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var ui=Yt||function(e){return ze.clearTimeout(e)};function si(e,t){if(t)return e.slice();var n=e.length,l=He?He(n):new e.constructor(n);return e.copy(l),l}function ci(e){var t=new e.constructor(e.byteLength);return new Be(t).set(new Be(e)),t}function di(e,t){var n=t?ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=Xa(e),a=void 0!==t,r=null===t,u=t==t,s=Xa(t);if(!r&&!s&&!o&&e>t||o&&a&&u&&!r&&!s||l&&a&&u||!n&&u||!i)return 1;if(!l&&!o&&!s&&e<t||s&&n&&i&&!l&&!o||r&&n&&i||!a&&i||!u)return-1}return 0}function mi(e,t,n,l){for(var i=-1,o=e.length,a=n.length,r=-1,u=t.length,s=on(o-a,0),c=G(u+s),d=!l;++r<u;)c[r]=t[r];for(;++i<a;)(d||i<o)&&(c[n[i]]=e[i]);for(;s--;)c[r++]=e[i++];return c}function pi(e,t,n,l){for(var i=-1,o=e.length,a=-1,r=n.length,u=-1,s=t.length,c=on(o-r,0),d=G(c+s),v=!l;++i<c;)d[i]=e[i];for(var m=i;++u<s;)d[m+u]=t[u];for(;++a<r;)(v||i<o)&&(d[m+n[a]]=e[i++]);return d}function Ei(e,t){var n=-1,l=e.length;for(t||(t=G(l));++n<l;)t[n]=e[n];return t}function fi(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?Gn(n,r,u):jn(n,r,u)}return n}function _i(e,t){return function(n,l){var i=wa(n)?nt:Vn,o=t?t():{};return i(n,e,Yi(l,2),o)}}function gi(e){return kl(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=me(t);++l<i;){var r=n[l];r&&e(t,r,l,o)}return t})}function Si(e,t){return function(n,l){if(null==n)return n;if(!xa(n))return e(n,l);for(var i=n.length,o=t?i:-1,a=me(n);(t?o--:++o<i)&&!1!==l(a[o],o,a););return n}}function hi(e){return function(t,n,l){for(var i=-1,o=me(t),a=l(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===n(o[u],u,o))break}return t}}function Ti(e){return function(t){var n=kt(t=or(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),i=n?ri(n,1).join(""):t.slice(1);return l[e]()+i}}function bi(e){return function(t){return dt(Br(Lr(t).replace(Ie,"")),e,"")}}function yi(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 n=In(e.prototype),l=e.apply(n,t);return Ha(l)?l:n}}function Ci(e){return function(t,n,l){var i=me(t);if(!xa(t)){var o=Yi(n,3);t=gr(t),n=function(e){return o(i[e],e,i)}}var a=e(t,n,l);return a>-1?i[o?t[a]:a]:void 0}}function Ai(e){return ji(function(t){var l=t.length,i=l,o=Ln.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new fe(n);if(o&&!r&&"wrapper"==Gi(a))var r=new Ln([],!0)}for(i=r?i:l;++i<l;){var u=Gi(a=t[i]),s="wrapper"==u?Ki(a):void 0;r=s&&ro(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?r[Gi(s[0])].apply(r,s[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,n=e[0];if(r&&1==e.length&&wa(n))return r.plant(n).value();for(var i=0,o=l?t[i].apply(this,e):n;++i<l;)o=t[i].call(this,o);return o}})}function Ni(e,t,n,l,i,o,a,r,u,s){var c=128&t,d=1&t,v=2&t,m=24&t,p=512&t,E=v?void 0:yi(e);return function f(){for(var _=arguments.length,g=G(_),S=_;S--;)g[S]=arguments[S];if(m)var h=qi(f),T=Rt(g,h);if(l&&(g=mi(g,l,i,m)),o&&(g=pi(g,o,a,m)),_-=T,m&&_<s){var b=Ut(g,h);return xi(e,t,Ni,f.placeholder,n,g,b,r,u,s-_)}var y=d?n:this,C=v?y[e]:e;return _=g.length,r?g=Eo(g,r):p&&_>1&&g.reverse(),c&&u<_&&(g.length=u),this&&this!==ze&&this instanceof f&&(C=E||yi(C)),C.apply(y,g)}}function Di(e,t){return function(n,l){return function(e,t,n,l){return rl(e,function(e,i,o){t(l,n(e),i,o)}),l}(n,e,t(l),{})}}function Ii(e,t){return function(n,l){var i;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(i=n),void 0!==l){if(void 0===i)return l;"string"==typeof n||"string"==typeof l?(n=Xl(n),l=Xl(l)):(n=Yl(n),l=Yl(l)),i=e(n,l)}return i}}function Oi(e){return ji(function(t){return t=st(t,Dt(Yi())),kl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Li(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?Ml(t,e):t;var l=Ml(t,Zt(e/jt(t)));return kt(t)?ri(zt(l),0,e).join(""):l.slice(0,e)}function wi(e){return function(t,n,l){return l&&"number"!=typeof l&&oo(t,n,l)&&(n=l=void 0),t=er(t),void 0===n?(n=t,t=0):n=er(n),function(e,t,n,l){for(var i=-1,o=on(Zt((t-e)/(n||1)),0),a=G(o);o--;)a[l?o:++i]=e,e+=n;return a}(t,n,l=void 0===l?t<n?1:-1:er(l),e)}}function Ri(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=lr(t),n=lr(n)),e(t,n)}}function xi(e,t,n,l,i,o,a,r,u,s){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,i,c?o:void 0,c?a:void 0,c?void 0:o,c?void 0:a,r,u,s],v=n.apply(void 0,d);return ro(e)&&_o(v,d),v.placeholder=l,ho(v,e,t)}function Pi(e){var t=ve[e];return function(e,n){if(e=lr(e),(n=null==n?0:an(tr(n),292))&&tn(e)){var l=(or(e)+"e").split("e");return+((l=(or(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var Mi=pn&&1/Wt(new pn([,-0]))[1]==1/0?function(e){return new pn(e)}:Xr;function ki(e){return function(t){var n=eo(t);return n==v?Ft(t):n==f?Ht(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fi(e,t,i,o,a,r,u,s){var c=2&t;if(!c&&"function"!=typeof e)throw new fe(n);var d=o?o.length:0;if(d||(t&=-97,o=a=void 0),u=void 0===u?u:on(tr(u),0),s=void 0===s?s:tr(s),d-=a?a.length:0,64&t){var v=o,m=a;o=a=void 0}var p=c?void 0:Ki(e),E=[e,t,i,o,a,v,m,r,u,s];if(p&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?mi(r,a,t[4]):a,e[4]=r?Ut(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?pi(r,a,t[6]):a,e[6]=r?Ut(e[5],l):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:an(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],!(s=E[9]=void 0===E[9]?c?0:e.length:on(E[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)f=8==t||16==t?function(e,t,n){var l=yi(e);return function i(){for(var o=arguments.length,a=G(o),r=o,u=qi(i);r--;)a[r]=arguments[r];var s=o<3&&a[0]!==u&&a[o-1]!==u?[]:Ut(a,u);if((o-=s.length)<n)return xi(e,t,Ni,i.placeholder,void 0,a,s,void 0,void 0,n-o);var c=this&&this!==ze&&this instanceof i?l:e;return tt(c,this,a)}}(e,t,s):32!=t&&33!=t||a.length?Ni.apply(void 0,E):function(e,t,n,l){var i=1&t,o=yi(e);return function t(){for(var a=-1,r=arguments.length,u=-1,s=l.length,c=G(s+r),d=this&&this!==ze&&this instanceof t?o:e;++u<s;)c[u]=l[u];for(;r--;)c[u++]=arguments[++a];return tt(d,i?n:this,c)}}(e,t,i,o);else var f=function(e,t,n){var l=1&t,i=yi(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return ho((p?Wl:_o)(f,E),e,t)}function Bi(e,t,n,l){return void 0===e||Da(e,ge[n])&&!Te.call(l,n)?t:e}function Ui(e,t,n,l,i,o){return Ha(e)&&Ha(t)&&(o.set(t,e),Il(e,t,void 0,Ui,o),o.delete(t)),e}function Wi(e){return Ka(e)?void 0:e}function Hi(e,t,n,l,i,o){var a=1&n,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var s=o.get(e),c=o.get(t);if(s&&c)return s==t&&c==e;var d=-1,v=!0,m=2&n?new Mn:void 0;for(o.set(e,t),o.set(t,e);++d<r;){var p=e[d],E=t[d];if(l)var f=a?l(E,p,d,t,e,o):l(p,E,d,e,t,o);if(void 0!==f){if(f)continue;v=!1;break}if(m){if(!mt(t,function(e,t){if(!Ot(m,t)&&(p===e||i(p,e,n,l,o)))return m.push(t)})){v=!1;break}}else if(p!==E&&!i(p,E,n,l,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function ji(e){return So(mo(e,void 0,Ro),e+"")}function zi(e){return dl(e,gr,$i)}function Vi(e){return dl(e,Sr,Ji)}var Ki=_n?function(e){return _n.get(e)}:Xr;function Gi(e){for(var t=e.name+"",n=gn[t],l=Te.call(gn,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function qi(e){return(Te.call(Dn,"placeholder")?Dn:e).placeholder}function Yi(){var e=Dn.iteratee||Kr;return e=e===Kr?bl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var n,l,i=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function Qi(e){for(var t=gr(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,co(i)]}return t}function Zi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Tl(n)?n:void 0}var $i=Jt?function(e){return null==e?[]:(e=me(e),at(Jt(e),function(t){return Ke.call(e,t)}))}:nu,Ji=Jt?function(e){for(var t=[];e;)ct(t,$i(e)),e=je(e);return t}:nu,eo=vl;function to(e,t,n){for(var l=-1,i=(t=oi(t,e)).length,o=!1;++l<i;){var a=Co(t[l]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&Wa(i)&&io(a,i)&&(wa(e)||La(e))}function no(e){return"function"!=typeof e.constructor||so(e)?{}:In(je(e))}function lo(e){return wa(e)||La(e)||!!(Ye&&e&&e[Ye])}function io(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,n){if(!Ha(n))return!1;var l=typeof t;return!!("number"==l?xa(n)&&io(t,n.length):"string"==l&&t in n)&&Da(n[t],e)}function ao(e,t){if(wa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Xa(e))||H.test(e)||!W.test(e)||null!=t&&e in me(t)}function ro(e){var t=Gi(e),n=Dn[t];if("function"!=typeof n||!(t in wn.prototype))return!1;if(e===n)return!0;var l=Ki(n);return!!l&&e===l[0]}(dn&&eo(new dn(new ArrayBuffer(1)))!=T||vn&&eo(new vn)!=v||mn&&"[object Promise]"!=eo(mn.resolve())||pn&&eo(new pn)!=f||En&&eo(new En)!=S)&&(eo=function(e){var t=vl(e),n=t==p?e.constructor:void 0,l=n?Ao(n):"";if(l)switch(l){case Sn:return T;case hn:return v;case Tn:return"[object Promise]";case bn:return f;case yn:return S}return t});var uo=Se?Ba:lu;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function co(e){return e==e&&!Ha(e)}function vo(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mo(e,t,n){return t=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=on(l.length-t,0),a=G(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=G(t+1);++i<t;)r[i]=l[i];return r[t]=n(a),tt(e,this,r)}}function po(e,t){return t.length<2?e:cl(e,zl(t,0,-1))}function Eo(e,t){for(var n=e.length,l=an(t.length,n),i=Ei(e);l--;){var o=t[l];e[l]=io(o,n)?i[o]:void 0}return e}function fo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _o=To(Wl),go=Qt||function(e,t){return ze.setTimeout(e,t)},So=To(Hl);function ho(e,t,n){var l=t+"";return So(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace(q,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!rt(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(X);return t?t[1].split(Q):[]}(l),n)))}function To(e){var t=0,n=0;return function(){var l=rn(),i=16-(l-n);if(n=l,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function bo(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=Pl(n,i),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var yo=function(e){var t=Ta(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(j,function(e,n,l,i){t.push(l?i.replace(J,"$1"):n||e)}),t},function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}();function Co(e){if("string"==typeof e||Xa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ao(e){if(null!=e){try{return he.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function No(e){if(e instanceof wn)return e.clone();var t=new Ln(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Do=kl(function(e,t){return Pa(e)?$n(e,il(t,1,Pa,!0)):[]}),Io=kl(function(e,t){var n=Fo(t);return Pa(n)&&(n=void 0),Pa(e)?$n(e,il(t,1,Pa,!0),Yi(n,2)):[]}),Oo=kl(function(e,t){var n=Fo(t);return Pa(n)&&(n=void 0),Pa(e)?$n(e,il(t,1,Pa,!0),void 0,n):[]});function Lo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:tr(n);return i<0&&(i=on(l+i,0)),ft(e,Yi(t,3),i)}function wo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=tr(n),i=n<0?on(l+i,0):an(i,l-1)),ft(e,Yi(t,3),i,!0)}function Ro(e){return null!=e&&e.length?il(e,1):[]}function xo(e){return e&&e.length?e[0]:void 0}var Po=kl(function(e){var t=st(e,li);return t.length&&t[0]===e[0]?fl(t):[]}),Mo=kl(function(e){var t=Fo(e),n=st(e,li);return t===Fo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?fl(n,Yi(t,2)):[]}),ko=kl(function(e){var t=Fo(e),n=st(e,li);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?fl(n,void 0,t):[]});function Fo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Bo=kl(Uo);function Uo(e,t){return e&&e.length&&t&&t.length?Rl(e,t):e}var Wo=ji(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return xl(e,st(t,function(e){return io(e,n)?+e:e}).sort(vi)),l});function Ho(e){return null==e?e:cn.call(e)}var jo=kl(function(e){return Ql(il(e,1,Pa,!0))}),zo=kl(function(e){var t=Fo(e);return Pa(t)&&(t=void 0),Ql(il(e,1,Pa,!0),Yi(t,2))}),Vo=kl(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,Ql(il(e,1,Pa,!0),void 0,t)});function Ko(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Pa(e))return t=on(e.length,t),!0}),At(t,function(t){return st(e,Tt(t))})}function Go(e,t){if(!e||!e.length)return[];var n=Ko(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var qo=kl(function(e,t){return Pa(e)?$n(e,t):[]}),Yo=kl(function(e){return ti(at(e,Pa))}),Xo=kl(function(e){var t=Fo(e);return Pa(t)&&(t=void 0),ti(at(e,Pa),Yi(t,2))}),Qo=kl(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,ti(at(e,Pa),void 0,t)}),Zo=kl(Ko),$o=kl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Go(e,n)});function Jo(e){var t=Dn(e);return t.__chain__=!0,t}function ea(e,t){return t(e)}var ta=ji(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof wn&&io(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:ea,args:[i],thisArg:void 0}),new Ln(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),na=_i(function(e,t,n){Te.call(e,n)?++e[n]:Gn(e,n,1)}),la=Ci(Lo),ia=Ci(wo);function oa(e,t){return(wa(e)?lt:Jn)(e,Yi(t,3))}function aa(e,t){return(wa(e)?it:el)(e,Yi(t,3))}var ra=_i(function(e,t,n){Te.call(e,n)?e[n].push(t):Gn(e,n,[t])}),ua=kl(function(e,t,n){var l=-1,i="function"==typeof t,o=xa(e)?G(e.length):[];return Jn(e,function(e){o[++l]=i?tt(t,e,n):_l(e,t,n)}),o}),sa=_i(function(e,t,n){Gn(e,n,t)});function ca(e,t){return(wa(e)?st:Al)(e,Yi(t,3))}var da=_i(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),va=kl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&oo(e,t[0],t[1])?t=[]:n>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),Ll(e,il(t,1),[])}),ma=Xt||function(){return ze.Date.now()};function pa(e,t,n){return t=n?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 l;if("function"!=typeof t)throw new fe(n);return e=tr(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var fa=kl(function(e,t,n){var l=1;if(n.length){var i=Ut(n,qi(fa));l|=32}return Fi(e,l,t,n,i)}),_a=kl(function(e,t,n){var l=3;if(n.length){var i=Ut(n,qi(_a));l|=32}return Fi(t,l,e,n,i)});function ga(e,t,l){var i,o,a,r,u,s,c=0,d=!1,v=!1,m=!0;if("function"!=typeof e)throw new fe(n);function p(t){var n=i,l=o;return i=o=void 0,c=t,r=e.apply(l,n)}function E(e){return c=e,u=go(_,t),d?p(e):r}function f(e){var n=e-s;return void 0===s||n>=t||n<0||v&&e-c>=a}function _(){var e=ma();if(f(e))return g(e);u=go(_,function(e){var n=t-(e-s);return v?an(n,a-(e-c)):n}(e))}function g(e){return u=void 0,m&&i?p(e):(i=o=void 0,r)}function S(){var e=ma(),n=f(e);if(i=arguments,o=this,s=e,n){if(void 0===u)return E(s);if(v)return ui(u),u=go(_,t),p(s)}return void 0===u&&(u=go(_,t)),r}return t=lr(t)||0,Ha(l)&&(d=!!l.leading,a=(v="maxWait"in l)?on(lr(l.maxWait)||0,t):a,m="trailing"in l?!!l.trailing:m),S.cancel=function(){void 0!==u&&ui(u),c=0,i=s=o=u=void 0},S.flush=function(){return void 0===u?r:g(ma())},S}var Sa=kl(function(e,t){return Zn(e,1,t)}),ha=kl(function(e,t,n){return Zn(e,lr(t)||0,n)});function Ta(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new fe(n);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(Ta.Cache||Pn),l}function ba(e){if("function"!=typeof e)throw new fe(n);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=Pn;var ya=ai(function(e,t){var n=(t=1==t.length&&wa(t[0])?st(t[0],Dt(Yi())):st(il(t,1),Dt(Yi()))).length;return kl(function(l){for(var i=-1,o=an(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),Ca=kl(function(e,t){return Fi(e,32,void 0,t,Ut(t,qi(Ca)))}),Aa=kl(function(e,t){return Fi(e,64,void 0,t,Ut(t,qi(Aa)))}),Na=ji(function(e,t){return Fi(e,256,void 0,void 0,void 0,t)});function Da(e,t){return e===t||e!=e&&t!=t}var Ia=Ri(ml),Oa=Ri(function(e,t){return e>=t}),La=gl(function(){return arguments}())?gl:function(e){return ja(e)&&Te.call(e,"callee")&&!Ke.call(e,"callee")},wa=G.isArray,Ra=Xe?Dt(Xe):function(e){return ja(e)&&vl(e)==h};function xa(e){return null!=e&&Wa(e.length)&&!Ba(e)}function Pa(e){return ja(e)&&xa(e)}var Ma=en||lu,ka=Qe?Dt(Qe):function(e){return ja(e)&&vl(e)==u};function Fa(e){if(!ja(e))return!1;var t=vl(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ka(e)}function Ba(e){if(!Ha(e))return!1;var t=vl(e);return t==c||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ua(e){return"number"==typeof e&&e==tr(e)}function Wa(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 za=Ze?Dt(Ze):function(e){return ja(e)&&eo(e)==v};function Va(e){return"number"==typeof e||ja(e)&&vl(e)==m}function Ka(e){if(!ja(e)||vl(e)!=p)return!1;var t=je(e);if(null===t)return!0;var n=Te.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&he.call(n)==Ae}var Ga=$e?Dt($e):function(e){return ja(e)&&vl(e)==E},qa=Je?Dt(Je):function(e){return ja(e)&&eo(e)==f};function Ya(e){return"string"==typeof e||!wa(e)&&ja(e)&&vl(e)==_}function Xa(e){return"symbol"==typeof e||ja(e)&&vl(e)==g}var Qa=et?Dt(et):function(e){return ja(e)&&Wa(e.length)&&!!ke[vl(e)]},Za=Ri(Cl),$a=Ri(function(e,t){return e<=t});function Ja(e){if(!e)return[];if(xa(e))return Ya(e)?zt(e):Ei(e);if(pt&&e[pt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[pt]());var t=eo(e);return(t==v?Ft:t==f?Wt:Dr)(e)}function er(e){return e?(e=lr(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),n=t%1;return t==t?n?t-n:t:0}function nr(e){return e?Yn(tr(e),0,4294967295):0}function lr(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=Nt(e);var n=le.test(e);return n||oe.test(e)?We(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ir(e){return fi(e,Sr(e))}function or(e){return null==e?"":Xl(e)}var ar=gi(function(e,t){if(so(t)||xa(t))fi(t,gr(t),e);else for(var n in t)Te.call(t,n)&&jn(e,n,t[n])}),rr=gi(function(e,t){fi(t,Sr(t),e)}),ur=gi(function(e,t,n,l){fi(t,Sr(t),e,l)}),sr=gi(function(e,t,n,l){fi(t,gr(t),e,l)}),cr=ji(qn),dr=kl(function(e,t){e=me(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],a=Sr(o),r=-1,u=a.length;++r<u;){var s=a[r],c=e[s];(void 0===c||Da(c,ge[s])&&!Te.call(e,s))&&(e[s]=o[s])}return e}),vr=kl(function(e){return e.push(void 0,Ui),tt(Tr,void 0,e)});function mr(e,t,n){var l=null==e?void 0:cl(e,t);return void 0===l?n:l}function pr(e,t){return null!=e&&to(e,t,El)}var Er=Di(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},Hr(Vr)),fr=Di(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),Te.call(e,t)?e[t].push(n):e[t]=[n]},Yi),_r=kl(_l);function gr(e){return xa(e)?Fn(e):yl(e)}function Sr(e){return xa(e)?Fn(e,!0):function(e){if(!Ha(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=so(e),n=[];for(var l in e)("constructor"!=l||!t&&Te.call(e,l))&&n.push(l);return n}(e)}var hr=gi(function(e,t,n){Il(e,t,n)}),Tr=gi(function(e,t,n,l){Il(e,t,n,l)}),br=ji(function(e,t){var n={};if(null==e)return n;var l=!1;t=st(t,function(t){return t=oi(t,e),l||(l=t.length>1),t}),fi(e,Vi(e),n),l&&(n=Xn(n,7,Wi));for(var i=t.length;i--;)Zl(n,t[i]);return n}),yr=ji(function(e,t){return null==e?{}:function(e,t){return wl(e,t,function(t,n){return pr(e,n)})}(e,t)});function Cr(e,t){if(null==e)return{};var n=st(Vi(e),function(e){return[e]});return t=Yi(t),wl(e,n,function(e,n){return t(e,n[0])})}var Ar=ki(gr),Nr=ki(Sr);function Dr(e){return null==e?[]:It(e,gr(e))}var Ir=bi(function(e,t,n){return t=t.toLowerCase(),e+(n?Or(t):t)});function Or(e){return Fr(or(e).toLowerCase())}function Lr(e){return(e=or(e))&&e.replace(re,xt).replace(Oe,"")}var wr=bi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Rr=bi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),xr=Ti("toLowerCase"),Pr=bi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Mr=bi(function(e,t,n){return e+(n?" ":"")+Fr(t)}),kr=bi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Fr=Ti("toUpperCase");function Br(e,t,n){return e=or(e),void 0===(t=n?void 0:t)?function(e){return xe.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Ur=kl(function(e,t){try{return tt(e,void 0,t)}catch(e){return Fa(e)?e:new ce(e)}}),Wr=ji(function(e,t){return lt(t,function(t){t=Co(t),Gn(e,t,fa(e[t],e))}),e});function Hr(e){return function(){return e}}var jr=Ai(),zr=Ai(!0);function Vr(e){return e}function Kr(e){return bl("function"==typeof e?e:Xn(e,1))}var Gr=kl(function(e,t){return function(n){return _l(n,e,t)}}),qr=kl(function(e,t){return function(n){return _l(e,n,t)}});function Yr(e,t,n){var l=gr(t),i=sl(t,l);null!=n||Ha(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=sl(t,gr(t)));var o=!(Ha(n)&&"chain"in n&&!n.chain),a=Ba(e);return lt(i,function(n){var l=t[n];e[n]=l,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Ei(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,ct([this.value()],arguments))})}),e}function Xr(){}var Qr=Oi(st),Zr=Oi(ot),$r=Oi(mt);function Jr(e){return ao(e)?Tt(Co(e)):function(e){return function(t){return cl(t,e)}}(e)}var eu=wi(),tu=wi(!0);function nu(){return[]}function lu(){return!1}var iu,ou=Ii(function(e,t){return e+t},0),au=Pi("ceil"),ru=Ii(function(e,t){return e/t},1),uu=Pi("floor"),su=Ii(function(e,t){return e*t},1),cu=Pi("round"),du=Ii(function(e,t){return e-t},0);return Dn.after=function(e,t){if("function"!=typeof t)throw new fe(n);return e=tr(e),function(){if(--e<1)return t.apply(this,arguments)}},Dn.ary=pa,Dn.assign=ar,Dn.assignIn=rr,Dn.assignInWith=ur,Dn.assignWith=sr,Dn.at=cr,Dn.before=Ea,Dn.bind=fa,Dn.bindAll=Wr,Dn.bindKey=_a,Dn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return wa(e)?e:[e]},Dn.chain=Jo,Dn.chunk=function(e,t,n){t=(n?oo(e,t,n):void 0===t)?1:on(tr(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,a=G(Zt(l/t));i<l;)a[o++]=zl(e,i,i+=t);return a},Dn.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,i=[];++t<n;){var o=e[t];o&&(i[l++]=o)}return i},Dn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=G(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return ct(wa(n)?Ei(n):[n],il(t,1))},Dn.cond=function(e){var t=null==e?0:e.length,l=Yi();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new fe(n);return[l(e[0]),e[1]]}):[],kl(function(n){for(var l=-1;++l<t;){var i=e[l];if(tt(i[0],this,n))return tt(i[1],this,n)}})},Dn.conforms=function(e){return function(e){var t=gr(e);return function(n){return Qn(n,e,t)}}(Xn(e,1))},Dn.constant=Hr,Dn.countBy=na,Dn.create=function(e,t){var n=In(e);return null==t?n:Kn(n,t)},Dn.curry=function e(t,n,l){var i=Fi(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Dn.curryRight=function e(t,n,l){var i=Fi(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Dn.debounce=ga,Dn.defaults=dr,Dn.defaultsDeep=vr,Dn.defer=Sa,Dn.delay=ha,Dn.difference=Do,Dn.differenceBy=Io,Dn.differenceWith=Oo,Dn.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:tr(t))<0?0:t,l):[]},Dn.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,0,(t=l-(t=n||void 0===t?1:tr(t)))<0?0:t):[]},Dn.dropRightWhile=function(e,t){return e&&e.length?Jl(e,Yi(t,3),!0,!0):[]},Dn.dropWhile=function(e,t){return e&&e.length?Jl(e,Yi(t,3),!0):[]},Dn.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&oo(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=tr(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:tr(l))<0&&(l+=i),l=n>l?0:nr(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Dn.filter=function(e,t){return(wa(e)?at:ll)(e,Yi(t,3))},Dn.flatMap=function(e,t){return il(ca(e,t),1)},Dn.flatMapDeep=function(e,t){return il(ca(e,t),1/0)},Dn.flatMapDepth=function(e,t,n){return n=void 0===n?1:tr(n),il(ca(e,t),n)},Dn.flatten=Ro,Dn.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},Dn.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:tr(t)):[]},Dn.flip=function(e){return Fi(e,512)},Dn.flow=jr,Dn.flowRight=zr,Dn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var i=e[t];l[i[0]]=i[1]}return l},Dn.functions=function(e){return null==e?[]:sl(e,gr(e))},Dn.functionsIn=function(e){return null==e?[]:sl(e,Sr(e))},Dn.groupBy=ra,Dn.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},Dn.intersection=Po,Dn.intersectionBy=Mo,Dn.intersectionWith=ko,Dn.invert=Er,Dn.invertBy=fr,Dn.invokeMap=ua,Dn.iteratee=Kr,Dn.keyBy=sa,Dn.keys=gr,Dn.keysIn=Sr,Dn.map=ca,Dn.mapKeys=function(e,t){var n={};return t=Yi(t,3),rl(e,function(e,l,i){Gn(n,t(e,l,i),e)}),n},Dn.mapValues=function(e,t){var n={};return t=Yi(t,3),rl(e,function(e,l,i){Gn(n,l,t(e,l,i))}),n},Dn.matches=function(e){return Nl(Xn(e,1))},Dn.matchesProperty=function(e,t){return Dl(e,Xn(t,1))},Dn.memoize=Ta,Dn.merge=hr,Dn.mergeWith=Tr,Dn.method=Gr,Dn.methodOf=qr,Dn.mixin=Yr,Dn.negate=ba,Dn.nthArg=function(e){return e=tr(e),kl(function(t){return Ol(t,e)})},Dn.omit=br,Dn.omitBy=function(e,t){return Cr(e,ba(Yi(t)))},Dn.once=function(e){return Ea(2,e)},Dn.orderBy=function(e,t,n,l){return null==e?[]:(wa(t)||(t=null==t?[]:[t]),wa(n=l?void 0:n)||(n=null==n?[]:[n]),Ll(e,t,n))},Dn.over=Qr,Dn.overArgs=ya,Dn.overEvery=Zr,Dn.overSome=$r,Dn.partial=Ca,Dn.partialRight=Aa,Dn.partition=da,Dn.pick=yr,Dn.pickBy=Cr,Dn.property=Jr,Dn.propertyOf=function(e){return function(t){return null==e?void 0:cl(e,t)}},Dn.pull=Bo,Dn.pullAll=Uo,Dn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Rl(e,t,Yi(n,2)):e},Dn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Rl(e,t,void 0,n):e},Dn.pullAt=Wo,Dn.range=eu,Dn.rangeRight=tu,Dn.rearg=Na,Dn.reject=function(e,t){return(wa(e)?at:ll)(e,ba(Yi(t,3)))},Dn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=Yi(t,3);++l<o;){var a=e[l];t(a,l,e)&&(n.push(a),i.push(l))}return xl(e,i),n},Dn.rest=function(e,t){if("function"!=typeof e)throw new fe(n);return kl(e,t=void 0===t?t:tr(t))},Dn.reverse=Ho,Dn.sampleSize=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:tr(t),(wa(e)?Un:Bl)(e,t)},Dn.set=function(e,t,n){return null==e?e:Ul(e,t,n)},Dn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ul(e,t,n,l)},Dn.shuffle=function(e){return(wa(e)?Wn:jl)(e)},Dn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&oo(e,t,n)?(t=0,n=l):(t=null==t?0:tr(t),n=void 0===n?l:tr(n)),zl(e,t,n)):[]},Dn.sortBy=va,Dn.sortedUniq=function(e){return e&&e.length?ql(e):[]},Dn.sortedUniqBy=function(e,t){return e&&e.length?ql(e,Yi(t,2)):[]},Dn.split=function(e,t,n){return n&&"number"!=typeof n&&oo(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=or(e))&&("string"==typeof t||null!=t&&!Ga(t))&&!(t=Xl(t))&&kt(e)?ri(zt(e),0,n):e.split(t,n):[]},Dn.spread=function(e,t){if("function"!=typeof e)throw new fe(n);return t=null==t?0:on(tr(t),0),kl(function(n){var l=n[t],i=ri(n,0,t);return l&&ct(i,l),tt(e,this,i)})},Dn.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},Dn.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:tr(t))<0?0:t):[]},Dn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:tr(t)))<0?0:t,l):[]},Dn.takeRightWhile=function(e,t){return e&&e.length?Jl(e,Yi(t,3),!1,!0):[]},Dn.takeWhile=function(e,t){return e&&e.length?Jl(e,Yi(t,3)):[]},Dn.tap=function(e,t){return t(e),e},Dn.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new fe(n);return Ha(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),ga(e,t,{leading:i,maxWait:t,trailing:o})},Dn.thru=ea,Dn.toArray=Ja,Dn.toPairs=Ar,Dn.toPairsIn=Nr,Dn.toPath=function(e){return wa(e)?st(e,Co):Xa(e)?[e]:Ei(yo(or(e)))},Dn.toPlainObject=ir,Dn.transform=function(e,t,n){var l=wa(e),i=l||Ma(e)||Qa(e);if(t=Yi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:Ha(e)&&Ba(o)?In(je(e)):{}}return(i?lt:rl)(e,function(e,l,i){return t(n,e,l,i)}),n},Dn.unary=function(e){return pa(e,1)},Dn.union=jo,Dn.unionBy=zo,Dn.unionWith=Vo,Dn.uniq=function(e){return e&&e.length?Ql(e):[]},Dn.uniqBy=function(e,t){return e&&e.length?Ql(e,Yi(t,2)):[]},Dn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Ql(e,void 0,t):[]},Dn.unset=function(e,t){return null==e||Zl(e,t)},Dn.unzip=Ko,Dn.unzipWith=Go,Dn.update=function(e,t,n){return null==e?e:$l(e,t,ii(n))},Dn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:$l(e,t,ii(n),l)},Dn.values=Dr,Dn.valuesIn=function(e){return null==e?[]:It(e,Sr(e))},Dn.without=qo,Dn.words=Br,Dn.wrap=function(e,t){return Ca(ii(t),e)},Dn.xor=Yo,Dn.xorBy=Xo,Dn.xorWith=Qo,Dn.zip=Zo,Dn.zipObject=function(e,t){return ni(e||[],t||[],jn)},Dn.zipObjectDeep=function(e,t){return ni(e||[],t||[],Ul)},Dn.zipWith=$o,Dn.entries=Ar,Dn.entriesIn=Nr,Dn.extend=rr,Dn.extendWith=ur,Yr(Dn,Dn),Dn.add=ou,Dn.attempt=Ur,Dn.camelCase=Ir,Dn.capitalize=Or,Dn.ceil=au,Dn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=lr(n))==n?n:0),void 0!==t&&(t=(t=lr(t))==t?t:0),Yn(lr(e),t,n)},Dn.clone=function(e){return Xn(e,4)},Dn.cloneDeep=function(e){return Xn(e,5)},Dn.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},Dn.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},Dn.conformsTo=function(e,t){return null==t||Qn(e,t,gr(t))},Dn.deburr=Lr,Dn.defaultTo=function(e,t){return null==e||e!=e?t:e},Dn.divide=ru,Dn.endsWith=function(e,t,n){e=or(e),t=Xl(t);var l=e.length,i=n=void 0===n?l:Yn(tr(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Dn.eq=Da,Dn.escape=function(e){return(e=or(e))&&k.test(e)?e.replace(P,Pt):e},Dn.escapeRegExp=function(e){return(e=or(e))&&V.test(e)?e.replace(z,"\\$&"):e},Dn.every=function(e,t,n){var l=wa(e)?ot:tl;return n&&oo(e,t,n)&&(t=void 0),l(e,Yi(t,3))},Dn.find=la,Dn.findIndex=Lo,Dn.findKey=function(e,t){return Et(e,Yi(t,3),rl)},Dn.findLast=ia,Dn.findLastIndex=wo,Dn.findLastKey=function(e,t){return Et(e,Yi(t,3),ul)},Dn.floor=uu,Dn.forEach=oa,Dn.forEachRight=aa,Dn.forIn=function(e,t){return null==e?e:ol(e,Yi(t,3),Sr)},Dn.forInRight=function(e,t){return null==e?e:al(e,Yi(t,3),Sr)},Dn.forOwn=function(e,t){return e&&rl(e,Yi(t,3))},Dn.forOwnRight=function(e,t){return e&&ul(e,Yi(t,3))},Dn.get=mr,Dn.gt=Ia,Dn.gte=Oa,Dn.has=function(e,t){return null!=e&&to(e,t,pl)},Dn.hasIn=pr,Dn.head=xo,Dn.identity=Vr,Dn.includes=function(e,t,n,l){e=xa(e)?e:Dr(e),n=n&&!l?tr(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),Ya(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&_t(e,t,n)>-1},Dn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:tr(n);return i<0&&(i=on(l+i,0)),_t(e,t,i)},Dn.inRange=function(e,t,n){return t=er(t),void 0===n?(n=t,t=0):n=er(n),function(e,t,n){return e>=an(t,n)&&e<on(t,n)}(e=lr(e),t,n)},Dn.invoke=_r,Dn.isArguments=La,Dn.isArray=wa,Dn.isArrayBuffer=Ra,Dn.isArrayLike=xa,Dn.isArrayLikeObject=Pa,Dn.isBoolean=function(e){return!0===e||!1===e||ja(e)&&vl(e)==r},Dn.isBuffer=Ma,Dn.isDate=ka,Dn.isElement=function(e){return ja(e)&&1===e.nodeType&&!Ka(e)},Dn.isEmpty=function(e){if(null==e)return!0;if(xa(e)&&(wa(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Qa(e)||La(e)))return!e.length;var t=eo(e);if(t==v||t==f)return!e.size;if(so(e))return!yl(e).length;for(var n in e)if(Te.call(e,n))return!1;return!0},Dn.isEqual=function(e,t){return Sl(e,t)},Dn.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?Sl(e,t,void 0,n):!!l},Dn.isError=Fa,Dn.isFinite=function(e){return"number"==typeof e&&tn(e)},Dn.isFunction=Ba,Dn.isInteger=Ua,Dn.isLength=Wa,Dn.isMap=za,Dn.isMatch=function(e,t){return e===t||hl(e,t,Qi(t))},Dn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,hl(e,t,Qi(t),n)},Dn.isNaN=function(e){return Va(e)&&e!=+e},Dn.isNative=function(e){if(uo(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Tl(e)},Dn.isNil=function(e){return null==e},Dn.isNull=function(e){return null===e},Dn.isNumber=Va,Dn.isObject=Ha,Dn.isObjectLike=ja,Dn.isPlainObject=Ka,Dn.isRegExp=Ga,Dn.isSafeInteger=function(e){return Ua(e)&&e>=-9007199254740991&&e<=9007199254740991},Dn.isSet=qa,Dn.isString=Ya,Dn.isSymbol=Xa,Dn.isTypedArray=Qa,Dn.isUndefined=function(e){return void 0===e},Dn.isWeakMap=function(e){return ja(e)&&eo(e)==S},Dn.isWeakSet=function(e){return ja(e)&&"[object WeakSet]"==vl(e)},Dn.join=function(e,t){return null==e?"":nn.call(e,t)},Dn.kebabCase=wr,Dn.last=Fo,Dn.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l;return void 0!==n&&(i=(i=tr(n))<0?on(l+i,0):an(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):ft(e,St,i,!0)},Dn.lowerCase=Rr,Dn.lowerFirst=xr,Dn.lt=Za,Dn.lte=$a,Dn.max=function(e){return e&&e.length?nl(e,Vr,ml):void 0},Dn.maxBy=function(e,t){return e&&e.length?nl(e,Yi(t,2),ml):void 0},Dn.mean=function(e){return ht(e,Vr)},Dn.meanBy=function(e,t){return ht(e,Yi(t,2))},Dn.min=function(e){return e&&e.length?nl(e,Vr,Cl):void 0},Dn.minBy=function(e,t){return e&&e.length?nl(e,Yi(t,2),Cl):void 0},Dn.stubArray=nu,Dn.stubFalse=lu,Dn.stubObject=function(){return{}},Dn.stubString=function(){return""},Dn.stubTrue=function(){return!0},Dn.multiply=su,Dn.nth=function(e,t){return e&&e.length?Ol(e,tr(t)):void 0},Dn.noConflict=function(){return ze._===this&&(ze._=Ne),this},Dn.noop=Xr,Dn.now=ma,Dn.pad=function(e,t,n){e=or(e);var l=(t=tr(t))?jt(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return Li($t(i),n)+e+Li(Zt(i),n)},Dn.padEnd=function(e,t,n){e=or(e);var l=(t=tr(t))?jt(e):0;return t&&l<t?e+Li(t-l,n):e},Dn.padStart=function(e,t,n){e=or(e);var l=(t=tr(t))?jt(e):0;return t&&l<t?Li(t-l,n)+e:e},Dn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(or(e).replace(K,""),t||0)},Dn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&oo(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=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 l=e;e=t,t=l}if(n||e%1||t%1){var i=sn();return an(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Pl(e,t)},Dn.reduce=function(e,t,n){var l=wa(e)?dt:yt,i=arguments.length<3;return l(e,Yi(t,4),n,i,Jn)},Dn.reduceRight=function(e,t,n){var l=wa(e)?vt:yt,i=arguments.length<3;return l(e,Yi(t,4),n,i,el)},Dn.repeat=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:tr(t),Ml(or(e),t)},Dn.replace=function(){var e=arguments,t=or(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dn.result=function(e,t,n){var l=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[Co(t[l])];void 0===o&&(l=i,o=n),e=Ba(o)?o.call(e):o}return e},Dn.round=cu,Dn.runInContext=e,Dn.sample=function(e){return(wa(e)?Bn:Fl)(e)},Dn.size=function(e){if(null==e)return 0;if(xa(e))return Ya(e)?jt(e):e.length;var t=eo(e);return t==v||t==f?e.size:yl(e).length},Dn.snakeCase=Pr,Dn.some=function(e,t,n){var l=wa(e)?mt:Vl;return n&&oo(e,t,n)&&(t=void 0),l(e,Yi(t,3))},Dn.sortedIndex=function(e,t){return Kl(e,t)},Dn.sortedIndexBy=function(e,t,n){return Gl(e,t,Yi(n,2))},Dn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Kl(e,t);if(l<n&&Da(e[l],t))return l}return-1},Dn.sortedLastIndex=function(e,t){return Kl(e,t,!0)},Dn.sortedLastIndexBy=function(e,t,n){return Gl(e,t,Yi(n,2),!0)},Dn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Kl(e,t,!0)-1;if(Da(e[n],t))return n}return-1},Dn.startCase=Mr,Dn.startsWith=function(e,t,n){return e=or(e),n=null==n?0:Yn(tr(n),0,e.length),t=Xl(t),e.slice(n,n+t.length)==t},Dn.subtract=du,Dn.sum=function(e){return e&&e.length?Ct(e,Vr):0},Dn.sumBy=function(e,t){return e&&e.length?Ct(e,Yi(t,2)):0},Dn.template=function(e,t,n){var l=Dn.templateSettings;n&&oo(e,t,n)&&(t=void 0),e=or(e),t=ur({},t,l,Bi);var i,o,a=ur({},t.imports,l.imports,Bi),r=gr(a),u=It(a,r),s=0,c=t.interpolate||ue,d="__p += '",v=pe((t.escape||ue).source+"|"+c.source+"|"+(c===U?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),m="//# sourceURL="+(Te.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(v,function(t,n,l,a,r,u){return l||(l=a),d+=e.slice(s,u).replace(se,Mt),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),r&&(o=!0,d+="';\n"+r+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),d+="';\n";var p=Te.call(t,"variable")&&t.variable;if(p){if($.test(p))throw new ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(L,""):d).replace(w,"$1").replace(R,"$1;"),d="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")+d+"return __p\n}";var E=Ur(function(){return de(r,m+"return "+d).apply(void 0,u)});if(E.source=d,Fa(E))throw E;return E},Dn.times=function(e,t){if((e=tr(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var i=At(l,t=Yi(t));++n<e;)t(n);return i},Dn.toFinite=er,Dn.toInteger=tr,Dn.toLength=nr,Dn.toLower=function(e){return or(e).toLowerCase()},Dn.toNumber=lr,Dn.toSafeInteger=function(e){return e?Yn(tr(e),-9007199254740991,9007199254740991):0===e?e:0},Dn.toString=or,Dn.toUpper=function(e){return or(e).toUpperCase()},Dn.trim=function(e,t,n){if((e=or(e))&&(n||void 0===t))return Nt(e);if(!e||!(t=Xl(t)))return e;var l=zt(e),i=zt(t);return ri(l,Lt(l,i),wt(l,i)+1).join("")},Dn.trimEnd=function(e,t,n){if((e=or(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Xl(t)))return e;var l=zt(e);return ri(l,0,wt(l,zt(t))+1).join("")},Dn.trimStart=function(e,t,n){if((e=or(e))&&(n||void 0===t))return e.replace(K,"");if(!e||!(t=Xl(t)))return e;var l=zt(e);return ri(l,Lt(l,zt(t))).join("")},Dn.truncate=function(e,t){var n=30,l="...";if(Ha(t)){var i="separator"in t?t.separator:i;n="length"in t?tr(t.length):n,l="omission"in t?Xl(t.omission):l}var o=(e=or(e)).length;if(kt(e)){var a=zt(e);o=a.length}if(n>=o)return e;var r=n-jt(l);if(r<1)return l;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+l;if(a&&(r+=u.length-r),Ga(i)){if(e.slice(r).search(i)){var s,c=u;for(i.global||(i=pe(i.source,or(te.exec(i))+"g")),i.lastIndex=0;s=i.exec(c);)var d=s.index;u=u.slice(0,void 0===d?r:d)}}else if(e.indexOf(Xl(i),r)!=r){var v=u.lastIndexOf(i);v>-1&&(u=u.slice(0,v))}return u+l},Dn.unescape=function(e){return(e=or(e))&&M.test(e)?e.replace(x,Kt):e},Dn.uniqueId=function(e){var t=++be;return or(e)+t},Dn.upperCase=kr,Dn.upperFirst=Fr,Dn.each=oa,Dn.eachRight=aa,Dn.first=xo,Yr(Dn,(iu={},rl(Dn,function(e,t){Te.call(Dn.prototype,t)||(iu[t]=e)}),iu),{chain:!1}),Dn.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Dn[e].placeholder=Dn}),lt(["drop","take"],function(e,t){wn.prototype[e]=function(n){n=void 0===n?1:on(tr(n),0);var l=this.__filtered__&&!t?new wn(this):this.clone();return l.__filtered__?l.__takeCount__=an(n,l.__takeCount__):l.__views__.push({size:an(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Yi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");wn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");wn.prototype[e]=function(){return this.__filtered__?new wn(this):this[n](1)}}),wn.prototype.compact=function(){return this.filter(Vr)},wn.prototype.find=function(e){return this.filter(e).head()},wn.prototype.findLast=function(e){return this.reverse().find(e)},wn.prototype.invokeMap=kl(function(e,t){return"function"==typeof e?new wn(this):this.map(function(n){return _l(n,e,t)})}),wn.prototype.reject=function(e){return this.filter(ba(Yi(e)))},wn.prototype.slice=function(e,t){e=tr(e);var n=this;return n.__filtered__&&(e>0||t<0)?new wn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=tr(t))<0?n.dropRight(-t):n.take(t-e)),n)},wn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},wn.prototype.toArray=function(){return this.take(4294967295)},rl(wn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=Dn[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(Dn.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof wn,u=a[0],s=r||wa(t),c=function(e){var t=i.apply(Dn,ct([e],a));return l&&d?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(r=s=!1);var d=this.__chain__,v=!!this.__actions__.length,m=o&&!d,p=r&&!v;if(!o&&s){t=p?t:new wn(this);var E=e.apply(t,a);return E.__actions__.push({func:ea,args:[c],thisArg:void 0}),new Ln(E,d)}return m&&p?e.apply(this,a):(E=this.thru(c),m?l?E.value()[0]:E.value():E)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=_e[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Dn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(wa(i)?i:[],e)}return this[n](function(n){return t.apply(wa(n)?n:[],e)})}}),rl(wn.prototype,function(e,t){var n=Dn[t];if(n){var l=n.name+"";Te.call(gn,l)||(gn[l]=[]),gn[l].push({name:t,func:n})}}),gn[Ni(void 0,2).name]=[{name:"wrapper",func:void 0}],wn.prototype.clone=function(){var e=new wn(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},wn.prototype.reverse=function(){if(this.__filtered__){var e=new wn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},wn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=wa(e),l=t<0,i=n?e.length:0,o=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var o=n[l],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=an(t,e+a);break;case"takeRight":e=on(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,s=l?r:a-1,c=this.__iteratees__,d=c.length,v=0,m=an(u,this.__takeCount__);if(!n||!l&&i==u&&m==u)return ei(e,this.__actions__);var p=[];e:for(;u--&&v<m;){for(var E=-1,f=e[s+=t];++E<d;){var _=c[E],g=_.type,S=(0,_.iteratee)(f);if(2==g)f=S;else if(!S){if(1==g)continue e;break e}}p[v++]=f}return p},Dn.prototype.at=ta,Dn.prototype.chain=function(){return Jo(this)},Dn.prototype.commit=function(){return new Ln(this.value(),this.__chain__)},Dn.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__++]}},Dn.prototype.plant=function(e){for(var t,n=this;n instanceof On;){var l=No(n);l.__index__=0,l.__values__=void 0,t?i.__wrapped__=l:t=l;var i=l;n=n.__wrapped__}return i.__wrapped__=e,t},Dn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof wn){var t=e;return this.__actions__.length&&(t=new wn(this)),(t=t.reverse()).__actions__.push({func:ea,args:[Ho],thisArg:void 0}),new Ln(t,this.__chain__)}return this.thru(Ho)},Dn.prototype.toJSON=Dn.prototype.valueOf=Dn.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Dn.prototype.first=Dn.prototype.head,pt&&(Dn.prototype[pt]=function(){return this}),Dn}();Ke?((Ke.exports=Gt)._=Gt,Ve._=Gt):ze._=Gt}).call(Y)});const Ge=e=>{var n,o,a;let{data:r,OpenImage:u}=e;const{t:s}=i.useTranslation();return l.createElement("div",null,r.date&&l.createElement("p",null,r.date),l.createElement("p",null,r.name),r.mobileNumber&&l.createElement(t.TelePhone,{mobile:r.mobileNumber}),r.source&&l.createElement("p",null,s("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),null!=r&&r.wfComment?l.createElement("div",null,null==r||null===(n=r.wfComment)||void 0===n?void 0:n.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("WF_COMMON_COMMENTS")),l.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?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:()=>{u(null==r?void 0:r.thumbnailsToShow)}})):null)},qe=e=>{var a,r,u,s,c,d;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:_}=Digit.Hooks.useWorkflowDetails({tenantId:null===(r=e.application)||void 0===r?void 0:r.tenantId,id:null===(u=e.application)||void 0===u?void 0:u.bookingNo,moduleCode:p});function g(e){var t;window.open(null==e||null===(t=e.fullImage)||void 0===t?void 0:t[0],"_blank")}const S=t=>{if("OPEN"===t.state){var n,i;const o={date:null==t||null===(n=t.auditDetails)||void 0===n?void 0:n.lastModified,source:(null===(i=e.application)||void 0===i?void 0:i.channel)||""};return l.createElement(Ge,{data:o})}if(t.state){var o,a,r,u,s;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===(u=t.assignes)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.mobileNumber,comment:m(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return l.createElement(Ge,{data:e,OpenImage:g})}{var c,d;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(c=e.application)||void 0===c?void 0:c.auditDetails.lastModified),name:null==t||null===(d=t.assigner)||void 0===d?void 0:d.name,comment:m(null==t?void 0:t.comment)};return l.createElement(Ge,{data:n})}};return f?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,!f&&l.createElement(n.Fragment,null,(null==_||null===(s=_.timeline)||void 0===s?void 0:s.length)>0&&l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},m("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=_&&_.timeline&&1===(null==_||null===(c=_.timeline)||void 0===c?void 0:c.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:m((null==_||null===(d=_.timeline[0])||void 0===d?void 0:d.state)&&""+_.timeline[0].state||"NA"),customChild:S(null==_?void 0:_.timeline[0])}):l.createElement(t.ConnectingCheckPoints,null,(null==_?void 0:_.timeline)&&(null==_?void 0:_.timeline.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:m(""+(null==_||null===(i=_.processInstances[n].state)||void 0===i?void 0:i.state)),customChild:S(e)}))})))),_&&(n=>{var i,a;let r=n[0];switch(null==r?void 0:r.action){case"PAY":return"citizen"===(null==e?void 0:e.userType)?l.createElement("div",{style:{marginTop:"1em",bottom:"0px",width:"100%",marginBottom:"1.2em"}},l.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}}},l.createElement(t.SubmitBar,{label:m("CS_APPLICATION_DETAILS_MAKE_PAYMENT")}))):null;default:return null}})(null==_?void 0:_.nextActions))},Ye=["tenantId","payments"],Xe=e=>l.createElement("span",{className:"cell-text"},e),Qe=e=>l.createElement("span",{className:"sla-cell"},e),Ze=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],$e=e=>{var o;let{searchParams:r,onFilterChange:c,defaultSearchParams:d}=e,v=s(e,Ze);const{t:m}=i.useTranslation(),[p,E]=(a.useQueryClient(),n.useState(()=>u({},r,{services:[]}))),f=e=>{let t=e.delete,n=u({},p,e);t&&t.forEach(e=>delete n[e]),delete e.delete,E(u({},n))},_=()=>{E(u({},d,{services:[]})),c(u({},d))},g=Digit.ULBService.getCurrentTenantId();return l.createElement(l.Fragment,null,l.createElement("div",{className:"filter"},l.createElement("div",{className:"filter-card"},l.createElement("div",{className:"heading",style:{alignItems:"center"}},l.createElement("div",{className:"filter-label",style:{display:"flex",alignItems:"center"}},l.createElement("span",null,l.createElement("svg",{width:"17",height:"17",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.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"}))),l.createElement("span",{style:{marginLeft:"8px",fontWeight:"normal"}},m("ES_COMMON_FILTER_BY"),":")),l.createElement("div",{className:"clearAll",onClick:_},m("ES_COMMON_CLEAR_ALL")),"desktop"===v.type&&l.createElement("span",{className:"clear-search",onClick:_,style:{border:"1px solid #e0e0e0",padding:"6px"}},l.createElement("svg",{width:"17",height:"17",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.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"===v.type&&l.createElement("span",{onClick:v.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},m("ES_INBOX_LOCALITY"),":"),l.createElement(t.Localities,{selectLocality:e=>{f({locality:[...(null==p?void 0:p.locality)||[],e]})},tenantId:g,boundaryType:"revenue"}),l.createElement("div",{className:"tag-container"},null==p||null===(o=p.locality)||void 0===o?void 0:o.map((e,n)=>l.createElement(t.RemoveableTag,{key:n,text:m(e.i18nkey),onClick:()=>{f({locality:null==p?void 0:p.locality.filter(t=>t.code!==e.code)})}})))),l.createElement("div",null,l.createElement(t.SubmitBar,{onSubmit:()=>{c(0===p.services.length?u({},p,{services:d.services}):p)},label:m("ES_COMMON_APPLY")}))))))};function Je(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const et=e=>l.createElement("h1",{className:"heading-m"},e.label),tt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),nt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(tt,null)),lt=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:v,businessService:m,moduleCode:p}=e;const{data:E,isLoading:f}=Digit.Hooks.useEmployeeSearch(s,{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:_,data:g}=Digit.Hooks.pt.useMDMS(s,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[S,h]=n.useState({}),[T,b]=n.useState({}),[y,C]=n.useState([]),[A,N]=n.useState(null),[D,I]=n.useState(null),[O,L]=n.useState(null),[w,R]=n.useState(null),[x,P]=n.useState([]),[M,k]=n.useState(null),[F,B]=n.useState(!1);function U(e){I(e.target.files[0])}return n.useEffect(()=>{var e;g&&g["egf-master"]&&P(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),n.useEffect(()=>{var e;C(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]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)R(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",D,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.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)}}()},[D]),n.useEffect(()=>{r&&h(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,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:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:x,selectedFinancialYear:M,setSelectedFinancialYear:k}):(e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,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===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{d(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:y,selectedApprover:A,setSelectedApprover:N,selectFile:U,uploadedFile:O,setUploadedFile:L,businessService:m}))},[r,y,x,M,O]),r&&S.form?l.createElement(t.Modal,{headerBarMain:l.createElement(et,{label:a(S.label.heading)}),headerBarEnd:l.createElement(nt,{onClick:c}),actionCancelLabel:a(S.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(S.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!M:f||(null==r?void 0:r.docUploadRequired)&&!O,formId:"modal-action"},_?l.createElement(t.Loader,null):l.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",d({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:u({},v,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)d({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==M?void 0:M.name,propertyId:null==v?void 0:v.propertyId,tenantId:s,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||!A?[]:[A],O&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:O}]),d({Property:u({},v,{workflow:t})})}},defaultValues:T,formId:"modal-action"})):l.createElement(t.Loader,null)},it=e=>l.createElement("h1",{className:"heading-m"},e.label),ot=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),at=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ot,null)),rt=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:v,businessService:m}=e;const{data:p}=Digit.Hooks.useEmployeeSearch(s,{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:E,data:f}=Digit.Hooks.pt.useMDMS(s,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[_,g]=n.useState({}),[S,h]=n.useState({}),[T,b]=n.useState([]),[y,C]=n.useState({}),[A,N]=n.useState(null),[D,I]=n.useState(null),[O,L]=n.useState(null),[w,R]=n.useState([]),[x,P]=n.useState(null);function M(e){N(e.target.files[0])}return n.useEffect(()=>{var e;f&&f["egf-master"]&&R(null===(e=f["egf-master"])||void 0===e?void 0:e.FinancialYear)},[f]),n.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]),n.useEffect(()=>{!function(){try{L(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",A,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.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)}}()},[A]),n.useEffect(()=>{r&&g((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:c,businessService:d}=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==d?void 0:d.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:T,selectedApprover:y,setSelectedApprover:C,selectFile:M,uploadedFile:D,setUploadedFile:I,businessService:m}))},[r,T,w,x,D]),r&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(it,{label:a(_.label.heading)}),headerBarEnd:l.createElement(at,{onClick:c}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=u({},v,{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==A?void 0:A.name,fileStoreId:D}]:null}),d({Licenses:[v]})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},ut=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),st=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),ct=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(st,null)),dt=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:v,businessService:m}=e;const{data:p,isLoading:E}=Digit.Hooks.useEmployeeSearch(s,{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,_]=n.useState({}),[g,S]=n.useState({}),[h,T]=n.useState([]),[b,y]=n.useState({}),[C,A]=n.useState(null),[N,D]=n.useState(null),[I,O]=n.useState(null),L=!!Digit.Utils.browser.isMobile();function w(e){A(e.target.files[0])}return n.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]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))O(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==s?void 0:s.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.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(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)}}()},[C]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:c,businessService:d,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==d?void 0:d.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:m?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:a,action:r,approvers:h,selectedApprover:b,setSelectedApprover:y,selectFile:w,uploadedFile:N,setUploadedFile:D,businessService:m,error:I}))},[r,h,N,I]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ut,{label:a(f.label.heading)}),headerBarEnd:l.createElement(ct,{onClick:c}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(f.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"}:{}},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:f.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=u({},v,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null}),d({Licenses:[v]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},vt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),mt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),pt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(mt,null)),Et=e=>{var i,o,r,s,c,d,v,m,p,E,f,_;let{t:g,action:S,tenantId:h,closeModal:T,submitAction:b,applicationDetails:y,applicationData:C,businessService:A,workflowDetails:N}=e;Digit.Hooks.obps.useObpsAPI(null!==(i=C)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(r=o.address)&&void 0!==r&&r.city?null===(s=C)||void 0===s||null===(c=s.landInfo)||void 0===c||null===(d=c.address)||void 0===d?void 0:d.city:h,!1);const{data:D,isLoading:I}=Digit.Hooks.useEmployeeSearch(h,{roles:null==N||null===(v=N.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==S?void 0:S.action)))||void 0===E||null===(f=E[0])||void 0===f||null===(_=f.assigneeRoles)||void 0===_?void 0:_.map(e=>({code:e})),isActive:!0},{enabled:!(null!=S&&S.isTerminateState)}),[O,L]=(a.useQueryClient(),n.useState({})),[w,R]=n.useState({}),[x,P]=n.useState([]),[M,k]=n.useState({}),[F,B]=n.useState(null),[U,W]=n.useState(null),[H,j]=n.useState(null),[z,V]=n.useState(null),K=!!Digit.Utils.browser.isMobile();function G(e){B(e.target.files[0])}n.useEffect(()=>{var e;P(null==D||null===(e=D.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}}))},[D]),n.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=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",F,Digit.ULBService.getStateId()||(null==h?void 0:h.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?W(null==e||null===(l=e.data)||void 0===l||null===(i=l.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 q=e=>{let t=[];return e&&e.map((e,n)=>{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},Y=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},X=e=>{var t,n;let l=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=l)||void 0===a?void 0:a.length)>0&&l.map((e,t)=>{i.push({docs:q(e.Documents),date:e.InspectionDate,questions:Y(e),time:null==e?void 0:e.InspectionTime})}),i=i.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},Q=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,i,o,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(l=t[0])||void 0===l||null===(i=l.values)||void 0===i?void 0:i.length)>0&&(n=[...n,...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&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},Z=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),n=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let l=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return l=null===(e=l)||void 0===e?void 0:e.concat(null!==n?n.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),l};return n.useEffect(()=>{S&&L((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,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===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||E?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{d(null)},message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:g,action:S,approvers:x,selectedApprover:M,setSelectedApprover:k,selectFile:G,uploadedFile:U,setUploadedFile:W,businessService:A,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:H}))},[S,x,z,U,H]),S&&O.form?l.createElement(t.Modal,{headerBarMain:l.createElement(vt,{label:g(O.label.heading)}),headerBarEnd:l.createElement(pt,{onClick:T}),actionCancelLabel:g(O.label.cancel),actionCancelOnSubmit:T,actionSaveLabel:g(O.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"}:{}},I?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:O.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,i,o,a;C=u({},C,{documents:Q(),additionalDetails:u({},null===(t=C)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:X(C),pendingapproval:Z()}),workflow:{action:null==S?void 0:S.action,comment:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,assignee:null!=M&&M.uuid?[null==M?void 0:M.uuid]:null,assignes:null!=M&&M.uuid?[null==M?void 0:M.uuid]:null,varificationDocuments:U?[{documentType:(null==S?void 0:S.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null},action:null==S?void 0:S.action,comment:null==e?void 0:e.comments,assignee:null!=M&&M.uuid?[null==M?void 0:M.uuid]:null,wfDocuments:U?[{documentType:(null==S?void 0:S.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null});const r=null==y||null===(i=y.nocData)||void 0===i?void 0:i.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:u({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}});let s={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,s)).then(function(e){var t;let n=!0,l=!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!=n&&1!=l||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(l=!1))});let i=[];r&&r.map(e=>{var t,o,a,r,u,s,c,d,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===(u=e.Noc)||void 0===u||null===(s=u.applicationStatus)||void 0===s?void 0:s.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(c=e.Noc)||void 0===c||null===(d=c.applicationStatus)||void 0===d?void 0:d.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)&&n||"FIRE_NOC"===(null==e||null===(E=e.Noc)||void 0===E?void 0:E.nocType)&&l)&&i.push(e)}),b({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:w,formId:"modal-action"})):l.createElement(t.Loader,null)},ft=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),_t=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),gt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(_t,null)),St=e=>{var i,r;let{t:s,action:c,tenantId:d,closeModal:v,submitAction:m,applicationData:p,businessService:E}=e;const{data:f,isLoading:_}=Digit.Hooks.useEmployeeSearch(d,{roles:null==c||null===(i=c.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=c&&c.isTerminateState)}),[g,S]=(a.useQueryClient(),n.useState({})),[h,T]=n.useState({}),[b,y]=n.useState([]),[C,A]=n.useState({}),[N,D]=n.useState(null),[I,O]=n.useState(null),[L,w]=n.useState(null),R=!!Digit.Utils.browser.isMobile();function x(e){D(e.target.files[0])}return o.useHistory(),n.useEffect(()=>{var e;y(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]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(N){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(N.size>=5242880)w(s("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=N&&N.type&&!e.test(null==N?void 0:N.type))w(s("NOT_SUPPORTED_FILE_TYPE"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",N,Digit.ULBService.getStateId()||(null==d?void 0:d.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(s("CS_FILE_UPLOAD_ERROR"))})},function(){w(s("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)}}()},[N]),n.useEffect(()=>{c&&S((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,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===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||f?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:E,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{d(null)},showHint:!0,message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:s,action:c,approvers:b,selectedApprover:C,setSelectedApprover:A,selectFile:x,uploadedFile:I,setUploadedFile:O,businessService:E,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:L}))},[c,b,I,L]),c&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ft,{label:s(g.label.heading)}),headerBarEnd:l.createElement(gt,{onClick:v}),actionCancelLabel:s(g.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:s(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:R?{width:"720px"}:{},style:R?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:R?{paddingLeft:"5px"}:{}},_?l.createElement(t.Loader,null):l.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,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=p)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=p)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),p=u({},p,{workflow:{action:null==c?void 0:c.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:I?[{documentType:(null==c?void 0:c.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:I}]:null},documents:o}),m({Noc:p},!1,{isNoc:!0})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)};function ht(e){var t=this.__data__=new Le(e);this.size=t.size}ht.prototype.clear=function(){this.__data__=new Le,this.size=0},ht.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ht.prototype.get=function(e){return this.__data__.get(e)},ht.prototype.has=function(e){return this.__data__.has(e)},ht.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Le){var l=n.__data__;if(!we||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pe(l)}return n.set(e,t),this.size=n.size,this};var Tt=ht,bt=function(){try{var e=he(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),yt=function(e,t,n){"__proto__"==t&&bt?bt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Ct=Object.prototype.hasOwnProperty,At=function(e,t,n){var l=e[t];Ct.call(e,t)&&Ne(l,n)&&(void 0!==n||t in e)||yt(e,t,n)},Nt=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?yt(n,r,u):At(n,r,u)}return n},Dt=function(e){return ue(e)&&"[object Arguments]"==re(e)},It=Object.prototype,Ot=It.hasOwnProperty,Lt=It.propertyIsEnumerable,wt=Dt(function(){return arguments}())?Dt:function(e){return ue(e)&&Ot.call(e,"callee")&&!Lt.call(e,"callee")},Rt=function(){return!1},xt=X(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?J.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Rt}),Pt=/^(?:0|[1-9]\d*)$/,Mt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Pt.test(e))&&e>-1&&e%1==0&&e<t},kt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ft={};Ft["[object Float32Array]"]=Ft["[object Float64Array]"]=Ft["[object Int8Array]"]=Ft["[object Int16Array]"]=Ft["[object Int32Array]"]=Ft["[object Uint8Array]"]=Ft["[object Uint8ClampedArray]"]=Ft["[object Uint16Array]"]=Ft["[object Uint32Array]"]=!0,Ft["[object Arguments]"]=Ft["[object Array]"]=Ft["[object ArrayBuffer]"]=Ft["[object Boolean]"]=Ft["[object DataView]"]=Ft["[object Date]"]=Ft["[object Error]"]=Ft["[object Function]"]=Ft["[object Map]"]=Ft["[object Number]"]=Ft["[object Object]"]=Ft["[object RegExp]"]=Ft["[object Set]"]=Ft["[object String]"]=Ft["[object WeakMap]"]=!1;var Bt=function(e){return function(t){return e(t)}},Ut=X(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&Z.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Wt=Ut&&Ut.isTypedArray,Ht=Wt?Bt(Wt):function(e){return ue(e)&&kt(e.length)&&!!Ft[re(e)]},jt=Object.prototype.hasOwnProperty,zt=function(e,t){var n=q(e),l=!n&&wt(e),i=!n&&!l&&xt(e),o=!n&&!l&&!i&&Ht(e),a=n||l||i||o,r=a?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=r.length;for(var s in e)!t&&!jt.call(e,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Mt(s,u))||r.push(s);return r},Vt=Object.prototype,Kt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Vt)},Gt=function(e,t){return function(n){return e(t(n))}},qt=Gt(Object.keys,Object),Yt=Object.prototype.hasOwnProperty,Xt=function(e){return null!=e&&kt(e.length)&&!me(e)},Qt=function(e){return Xt(e)?zt(e):function(e){if(!Kt(e))return qt(e);var t=[];for(var n in Object(e))Yt.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Zt=Object.prototype.hasOwnProperty,$t=function(e){return Xt(e)?zt(e,!0):function(e){if(!ve(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Kt(e),n=[];for(var l in e)("constructor"!=l||!t&&Zt.call(e,l))&&n.push(l);return n}(e)},Jt=X(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?J.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=o?o(n):new e.constructor(n);return e.copy(l),l}}),en=function(){return[]},tn=Object.prototype.propertyIsEnumerable,nn=Object.getOwnPropertySymbols,ln=nn?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,a=[];++l<i;){var r=t[l];tn.call(e,r)&&(a[o++]=r)}return a}(nn(e)))}:en,on=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},an=Gt(Object.getPrototypeOf,Object),rn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)on(t,ln(e)),e=an(e);return t}:en,un=function(e,t,n){var l=t(e);return q(e)?l:on(l,n(e))},sn=function(e){return un(e,Qt,ln)},cn=function(e){return un(e,$t,rn)},dn=he(J,"DataView"),vn=he(J,"Promise"),mn=he(J,"Set"),pn=he(J,"WeakMap"),En=_e(dn),fn=_e(we),_n=_e(vn),gn=_e(mn),Sn=_e(pn),hn=re;(dn&&"[object DataView]"!=hn(new dn(new ArrayBuffer(1)))||we&&"[object Map]"!=hn(new we)||vn&&"[object Promise]"!=hn(vn.resolve())||mn&&"[object Set]"!=hn(new mn)||pn&&"[object WeakMap]"!=hn(new pn))&&(hn=function(e){var t=re(e),n="[object Object]"==t?e.constructor:void 0,l=n?_e(n):"";if(l)switch(l){case En:return"[object DataView]";case fn:return"[object Map]";case _n:return"[object Promise]";case gn:return"[object Set]";case Sn:return"[object WeakMap]"}return t});var Tn=hn,bn=Object.prototype.hasOwnProperty,yn=J.Uint8Array,Cn=function(e){var t=new e.constructor(e.byteLength);return new yn(t).set(new yn(e)),t},An=/\w*$/,Nn=ee?ee.prototype:void 0,Dn=Nn?Nn.valueOf:void 0,In=Object.create,On=function(){function e(){}return function(t){if(!ve(t))return{};if(In)return In(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Ln=Ut&&Ut.isMap,wn=Ln?Bt(Ln):function(e){return ue(e)&&"[object Map]"==Tn(e)},Rn=Ut&&Ut.isSet,xn=Rn?Bt(Rn):function(e){return ue(e)&&"[object Set]"==Tn(e)},Pn={};Pn["[object Arguments]"]=Pn["[object Array]"]=Pn["[object ArrayBuffer]"]=Pn["[object DataView]"]=Pn["[object Boolean]"]=Pn["[object Date]"]=Pn["[object Float32Array]"]=Pn["[object Float64Array]"]=Pn["[object Int8Array]"]=Pn["[object Int16Array]"]=Pn["[object Int32Array]"]=Pn["[object Map]"]=Pn["[object Number]"]=Pn["[object Object]"]=Pn["[object RegExp]"]=Pn["[object Set]"]=Pn["[object String]"]=Pn["[object Symbol]"]=Pn["[object Uint8Array]"]=Pn["[object Uint8ClampedArray]"]=Pn["[object Uint16Array]"]=Pn["[object Uint32Array]"]=!0,Pn["[object Error]"]=Pn["[object Function]"]=Pn["[object WeakMap]"]=!1;var Mn=function e(t,n,l,i,o,a){var r,u=1&n,s=2&n,c=4&n;if(l&&(r=o?l(t,i,o,a):l(t)),void 0!==r)return r;if(!ve(t))return t;var d=q(t);if(d){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&bn.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!u)return function(e,t){var n=-1,l=e.length;for(t||(t=Array(l));++n<l;)t[n]=e[n];return t}(t,r)}else{var v=Tn(t),m="[object Function]"==v||"[object GeneratorFunction]"==v;if(xt(t))return Jt(t,u);if("[object Object]"==v||"[object Arguments]"==v||m&&!o){if(r=s||m?{}:function(e){return"function"!=typeof e.constructor||Kt(e)?{}:On(an(e))}(t),!u)return s?function(e,t){return Nt(e,rn(e),t)}(t,function(e,t){return e&&Nt(t,$t(t),e)}(r,t)):function(e,t){return Nt(e,ln(e),t)}(t,function(e,t){return e&&Nt(t,Qt(t),e)}(r,t))}else{if(!Pn[v])return o?t:{};r=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return Cn(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?Cn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);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 n=t?Cn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,An.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return Dn?Object(Dn.call(e)):{}}}(t,v,u)}}a||(a=new Tt);var p=a.get(t);if(p)return p;a.set(t,r),xn(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):wn(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var E=d?void 0:(c?s?cn:sn:s?$t:Qt)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(E||t,function(i,o){E&&(i=t[o=i]),At(r,o,e(i,n,l,o,t,a))}),r},kn=function(e){return Mn(e,5)};const Fn=e=>l.createElement("h1",{className:"heading-m"},e.label),Bn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),Un=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Bn,null)),Wn=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},Hn=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:v,businessService:m}=e;const{data:p,isLoading:E}=Digit.Hooks.useEmployeeSearch(s,{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,_]=n.useState({}),[g,S]=n.useState({}),[h,T]=n.useState([]),[b,y]=n.useState({}),[C,A]=n.useState(null),[N,D]=n.useState(null),[I,O]=n.useState(null),L=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function R(e){A(e.target.files[0])}return n.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]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))O(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),O(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)}}()},[C]),n.useEffect(()=>{var e,n,i,o;"DisconnectWSConnection"==(null===(e=v)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(i=v)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&_((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:s,selectFile:c,uploadedFile:d,setUploadedFile:v,businessService:m,error:p}=e,E=!0,f=!1;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(E=!1),o.isTerminateState&&(E=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(f=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==m?void 0:m.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:E?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:E?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:E?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:s,selected:r}):null},f&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!f,type:"custom",populators:f?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,u({onChange:e.onChange,date:e.value},n))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:c,onDelete:()=>{v(null)},message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:h,selectedApprover:b,setSelectedApprover:y,selectFile:R,uploadedFile:N,setUploadedFile:D,businessService:m,error:I})):r&&_((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,businessService:v,error:m}=e,p=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(p=!1),o.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{d(null)},message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:h,selectedApprover:b,setSelectedApprover:y,selectFile:R,uploadedFile:N,setUploadedFile:D,businessService:m,error:I}))},[r,h,N,I]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Fn,{label:a(f.label.heading)}),headerBarEnd:l.createElement(Un,{onClick:c}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:L&&w?{width:"100%",height:"auto"}:{}},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,a,c,m,p,E;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var f,_,g,S,h,T,y,A,D;const t=u({},null===(f=v)||void 0===f||null===(_=f.billAmendmentDetails)||void 0===_?void 0:_.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=u({},null===(g=v)||void 0===g?void 0:g.billAmendmentDetails,{workflow:{businessId:null===(S=v)||void 0===S||null===(h=S.billAmendmentDetails)||void 0===h?void 0:h.amendmentId,action:null==r?void 0:r.action,tenantId:s,businessService:null!==(T=v)&&void 0!==T&&null!==(y=T.applicationType)&&void 0!==y&&y.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(A=v)&&void 0!==A&&null!==(D=A.applicationType)&&void 0!==D&&D.includes("WATER")?"WS":"SW",assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:[]}});d({AmendmentUpdate:n})}else{if(v=u({},v,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:[],assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null,processInstance:u({},null===(n=v)||void 0===n?void 0:n.processInstance,{action:null==r?void 0:r.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:[]})}),null!=e&&e.date&&null!==(l=v)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=kn(null==e?void 0:e.date);v.disconnectionExecutionDate=Wn(t)}else if(null!=e&&e.date){const t=kn(null==e?void 0:e.date);v.connectionExecutionDate=Wn(t)}var I;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(c=v)||void 0===c||null===(m=c.processInstance)||void 0===m?void 0:m.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(I=v)||void 0===I?void 0:I.serviceType)?d({WaterConnection:v,disconnectRequest:!0}):d({SewerageConnection:v,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(p=v)||void 0===p?void 0:p.applicationType))d({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(E=v)||void 0===E?void 0:E.applicationType))d({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var O,L,w,R,x,P,M,k,F,B,U,W,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenalty&&(v.additionalDetails.adhocPenalty=parseInt(null==t||null===(L=t.value)||void 0===L?void 0:L.adhocPenalty)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyComment&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyComment)||""),null!=t&&null!==(x=t.value)&&void 0!==x&&x.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(P=t.value)||void 0===P?void 0:P.adhocPenaltyReason)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebate&&(v.additionalDetails.adhocRebate=parseInt(null==t||null===(k=t.value)||void 0===k?void 0:k.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!==(U=t.value)&&void 0!==U&&U.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(W=t.value)||void 0===W?void 0:W.adhocRebateReason)||""),"WATER"==(null===(H=v)||void 0===H?void 0:H.serviceType)?d({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!1}):d({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},jn=e=>l.createElement("h1",{className:"heading-m"},e.label),zn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),Vn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(zn,null)),Kn=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:v,businessService:m,moduleCode:p}=e;console.log("applicationData",v);const{data:E}=Digit.Hooks.useEmployeeSearch(s,{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,_]=n.useState({}),[g,S]=n.useState({}),[h,T]=n.useState([]),[b,y]=n.useState(null),[C,A]=n.useState(null),[N,D]=n.useState(null),[I,O]=n.useState(null),[L,w]=n.useState(!1);function R(e){A(e.target.files[0])}return n.useEffect(()=>{var e;T(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]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.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)}}()},[C]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:n("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_PTR_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("PTR_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_PTR_ACTION_FILEUPLOADED"):n("ES_PTR_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:b,setSelectedApprover:y,selectFile:R,uploadedFile:N,setUploadedFile:D,businessService:m}))},[r,h,N]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(jn,{label:a(f.label.heading)}),headerBarEnd:l.createElement(Vn,{onClick:c}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.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};N&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:N}]),d({PetRegistrationApplications:[u({},v,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Gn=e=>l.createElement("h1",{className:"heading-m"},e.label),qn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),Yn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(qn,null)),Xn=e=>{var i,a,r;let{t:s,action:c,tenantId:d,closeModal:v,submitAction:m,applicationData:p,businessService:E,moduleCode:f}=e;const{data:_}=Digit.Hooks.useEmployeeSearch(d,{roles:null==c||null===(i=c.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!=c&&c.isTerminateState)}),g=o.useHistory(),[S,h]=n.useState({}),[T,b]=n.useState({}),[y,C]=n.useState([]),[A,N]=n.useState(null),[D,I]=n.useState(null);return n.useEffect(()=>{var e;C(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}}))},[_]),n.useEffect(()=>{"INITIATED"===(null==c?void 0:c.state)?g.push("/digit-ui/employee/asset/assetservice/edit/"+(null==p?void 0:p.applicationNo)):h((e=>{let{t:t,action:n,businessService:l}=e;return console.log("njhsegfdhjsbedwfdwe",n),{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:s,action:c,approvers:y,selectedApprover:A,setSelectedApprover:N,uploadedFile:D,setUploadedFile:I,businessService:E}))},[c,y,D]),c&&S.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Gn,{label:s(S.label.heading)}),headerBarEnd:l.createElement(Yn,{onClick:v}),actionCancelLabel:s(S.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:s(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==c?void 0:c.action,comment:null==e?void 0:e.comments,businessService:E,moduleName:f};D&&(t.documents=[]),m({Asset:u({},p,{workflow:t})})},defaultValues:T,formId:"modal-action"})):l.createElement(t.Loader,null)},Qn=e=>l.createElement("h1",{className:"heading-m"},e.label),Zn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),$n=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Zn,null)),Jn=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:v,businessService:m,moduleCode:p}=e;const{data:E}=Digit.Hooks.useEmployeeSearch(s,{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,_]=n.useState({}),[g,S]=n.useState({}),[h,T]=n.useState([]),[b,y]=n.useState(null),[C,A]=n.useState(null),[N,D]=n.useState(null),[I,O]=n.useState(null),[L,w]=n.useState(!1);function R(e){A(e.target.files[0])}return n.useEffect(()=>{var e;T(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]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,s)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.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)}}()},[C]),n.useEffect(()=>{r&&_((e=>{let{t:n,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:n("ES_CHB_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("ES_CHB_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},message:a?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:b,setSelectedApprover:y,selectFile:R,uploadedFile:N,setUploadedFile:D,businessService:m}))},[r,h,N]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Qn,{label:a(f.label.heading)}),headerBarEnd:l.createElement($n,{onClick:c}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.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};N&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]),d({hallsBookingApplication:u({},v,{workflow:t})})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},el=e=>l.createElement("h1",{className:"heading-m"},e.label),tl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(tl,null)),ll=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:v,businessService:m,moduleCode:p}=e;console.log("snjdskbjdfbjskfjkbs",r);const{data:E}=Digit.Hooks.useEmployeeSearch(s,{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,_]=n.useState({}),[g,S]=n.useState({}),[h,T]=n.useState([]),[b,y]=n.useState(null),[C,A]=n.useState(null),[N,D]=n.useState(null),[I,O]=n.useState(null),[L,w]=n.useState(null),[R,x]=n.useState(!1);function P(e){D(e.target.files[0])}return n.useEffect(()=>{var e;T(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]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)w(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",N,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.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)}}()},[N]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;console.log("action",i);const s=(new Date).toISOString().split("T")[0];return console.log("todayedsta ::",s),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:["COMPLETIONPENDING"===(null==i?void 0:i.state)?{label:n("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:n("ES_EW_ACTION_TRANSACTION_ID"),type:"text",isMandatory:!0,populators:{name:"transactionId"}}:"null","REQUESTCOMPLETED"===(null==i?void 0:i.state)?{label:n("ES_EW_ACTION_FINALAMOUNT"),type:"text",isMandatory:!0,populators:{name:"finalAmount"}}:"null",{label:n("ES_EW_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_EW_PHOTO")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("EW_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_EW_ACTION_FILEUPLOADED"):n("ES_EW_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:b,setSelectedApprover:y,selectFile:P,uploadedFile:I,setUploadedFile:O,businessService:m}))},[r,h,I]),console.log("conggg",f),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(el,{label:a(f.label.heading)}),headerBarEnd:l.createElement(nl,{onClick:c}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.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),I&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==N?void 0:N.name,filestoreId:I},{}]),v.pickUpDate=null==e?void 0:e.date,v.transactionId=null==e?void 0:e.transactionId,v.finalAmount=null==e?void 0:e.finalAmount,d({EwasteApplication:[u({},v,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},il=e=>l.createElement("h1",{className:"heading-m"},e.label),ol=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),al=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ol,null)),rl=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:v,businessService:m,moduleCode:p}=e;const{data:E}=Digit.Hooks.useEmployeeSearch(s,{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}),[f,_]=n.useState({}),[g,S]=n.useState({}),[h,T]=n.useState([]),[b,y]=n.useState(null),[C,A]=n.useState(null),[N,D]=n.useState(null),[I,O]=n.useState(null),[L,w]=n.useState(!1);function R(e){w(!0),A(e.target.files[0])}return n.useEffect(()=>{var e;T(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]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,s)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(a("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(w(!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),n.useEffect(()=>{_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:s,setSelectedApprover:c,isUploading:d}=e;const v=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",d),{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:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:u,t:n,optionKey:"name",select:c,selected:s})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:d?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(v,null),l.createElement("span",null,"Uploading...")):a?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:b,setSelectedApprover:y,selectFile:R,uploadedFile:N,setUploadedFile:D,businessService:m,isUploading:L}))},[r,h,N]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(il,{label:a(f.label.heading)}),headerBarEnd:l.createElement(al,{onClick:c}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={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!=b&&b.uuid?[null==b?void 0:b.uuid]:null};N&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]),d({streetVendingDetail:u({},v,{workflow:n})})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},ul=e=>l.createElement("h1",{className:"heading-m"},e.label),sl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(sl,null)),dl=e=>{var i,o,a,r;let{t:s,action:c,tenantId:d,closeModal:v,submitAction:m,applicationData:p,businessService:E,moduleCode:f}=e;const{data:_}=Digit.Hooks.useEmployeeSearch(d,{roles:null==c||null===(i=c.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=c&&c.isTerminateState)}),{data:g}=Digit.Hooks.fsm.useVendorSearch({tenantId:d,config:{enabled:"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==c?void 0:c.state)}});let S=[];null==g||null===(a=g.vendor)||void 0===a||a.map(e=>{var t;"WT"===(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.description)&&S.push({code:null==e?void 0:e.name,name:null==e?void 0:e.name,i18nKey:null==e?void 0:e.name,vendorId:null==e?void 0:e.id})});const{data:h}=Digit.Hooks.fsm.useVehiclesSearch({tenantId:d,config:{enabled:"DELIVERY_PENDING"===(null==c?void 0:c.state)}});let T=[];null==h||null===(r=h.vehicle)||void 0===r||r.map(e=>{T.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})});const[b,y]=n.useState({}),[C,A]=n.useState({}),[N,D]=n.useState([]),[I,O]=n.useState(null),[L,w]=n.useState(null),[R,x]=n.useState(null),[P,M]=n.useState(null),[k,F]=n.useState(null);function B(e){O(e.target.files[0])}return n.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}}))},[_]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(I){const e=function(){if(I.size>=5242880)x(s("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Je(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",I,d)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?w(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(s("CS_FILE_UPLOAD_ERROR"))})},function(){x(s("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]),n.useEffect(()=>{c&&y((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,selectedVendor:u,setSelectedVendor:s,vendorDescription:c,vehicleDescription:d,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:n("ES_RS_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==i?void 0:i.state)?{label:n("RS_ASSIGN"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:c,t:n,optionKey:"i18nKey",select:s,selected:u})}:"null","DELIVERY_PENDING"===(null==i?void 0:i.state)?{label:n("RS_REGISTRATION_NUMBER"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:d,t:n,optionKey:"i18nKey",select:m,selected:v})}:"null",{label:n("ES_RS_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},message:a?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:s,action:c,selectFile:B,uploadedFile:L,setUploadedFile:w,selectedVendor:P,setSelectedVendor:M,vendorDescription:g?S:void 0,vehicleDescription:h?T:void 0,selectVehicle:k,setSelectVehicle:F}))},[c,N,L,g,k,h]),c&&b.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ul,{label:s(b.label.heading)}),headerBarEnd:l.createElement(cl,{onClick:v}),actionCancelLabel:s(b.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:s(b.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:b.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==c?void 0:c.action,comments:null==e?void 0:e.comments,businessService:E,moduleName:f};L&&(t.documents=[{documentType:(null==c?void 0:c.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:L}]),"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==c?void 0:c.state)&&(p.vendorId=null==P?void 0:P.vendorId),"DELIVERY_PENDING"===(null==c?void 0:c.state)&&(p.vehicleId=null==k?void 0:k.vehicleId);let n="watertanker"===E?{waterTankerBookingDetail:u({},p,{workflow:t})}:{mobileToiletBookingDetail:u({},p,{workflow:t})};m(n)},defaultValues:C,formId:"modal-action"})):l.createElement(t.Loader,null)},vl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(lt,e):null!=e&&e.businessService.includes("ptr")?l.createElement(Kn,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")?l.createElement(rt,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(dt,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(Et,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(St,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Hn,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(Xn,e):null!=e&&e.businessService.includes("ewst")?l.createElement(ll,e):null!=e&&e.businessService.includes("booking-refund")?l.createElement(Jn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(rl,e):null!=e&&e.businessService.includes("watertanker")||null!=e&&e.businessService.includes("mobileToilet")?l.createElement(dl,e):void 0;function ml(e){let{documents:n,svgStyles:o={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:s}=i.useTranslation(),c=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!c&&(null==n?void 0:n.map((e,i)=>{var o;return l.createElement(l.Fragment,{key:i},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},s(null==e?void 0:e.title)):null,l.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,n)=>{var i;return l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",color:"#505A5F"}},s(null==e?void 0:e.title)),a?null!=e&&null!==(i=e.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},s(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},s(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))),r&&(null==n?void 0:n.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)})),c&&(null==n?void 0:n.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},s(null==e?void 0:e.title)):null,l.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,n)=>l.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:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},s(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+s(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+s(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const pl=e=>{var t,i;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:s}=e;const c=(null==r?void 0:r.status)||"",d=(null==s||null===(t=s.data)||void 0===t?void 0:t.nextActions)||[],v=Digit.ULBService.getStateId(),[m,p]=n.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[E,f]=n.useState(null),[_,g]=n.useState([]),[S,h]=n.useState(!0),[T,b]=n.useState(!1),[y,C]=n.useState(!1),{isLoading:A,data:N}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:D,data:I}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var o,a;null!=N&&null!==(e=N.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==N||null===(o=N.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,n;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===(n=r.additionalDetails)||void 0===n?void 0:n.applicationType)}));let s=[];null===(t=i)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==I||null===(t=I["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,o.length);o===n&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(l=u[0])||void 0===l||null===(i=l.values)||void 0===i||i.map(t=>{var n,l;o===(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0])+"."+(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),s.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(s)),g(s)},[!A,!D]),n.useEffect(()=>{let e=0;_.map(t=>{let n=!1;m.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(n=!0)}),!n&&t.required&&(e+=1)}),h("0"!=e&&0!=e||!(m.length>0))},[m,T]),n.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===c&&(null==d?void 0:d.length)>0)},[r,s]),l.createElement("div",null,null==_?void 0:_.map((e,t)=>l.createElement("div",null,l.createElement(El,{key:t,index:t,document:e,t:o,error:E,setError:f,setDocuments:p,documents:m,setCheckRequiredFields:b,applicationStatus:c,actions:d,bpaTaxDocuments:_,checkEnablingDocs:y}))))};function El(e){var i,o;let{t:a,document:r,setDocuments:s,documents:c,index:d,bpaTaxDocuments:v,checkEnablingDocs:m}=e;const p=null==c?void 0:c.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,_]=n.useState(p?u({},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,S]=n.useState(null),[h,T]=n.useState(()=>(null==p?void 0:p.fileStoreId)||null),[b,y]=n.useState([]);return n.useEffect(()=>{null!=f&&f.code&&s(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==h?void 0:h.length)||null===h?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==h),{documentType:null==f?void 0:f.code,fileStoreId:h,documentUid:h,fileName:(null==g?void 0:g.name)||"",id:c?null===(t=c.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===t?void 0:t.id:void 0}]})},[h,f]),n.useEffect(()=>{try{b.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],b.map(e=>{var t,n,l;null!=f&&f.code&&r.newUploadedDocs.push({documentType:null==f?void 0:f.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),v[d]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(v)))}catch(e){Promise.reject(e)}},[b,f]),n.useEffect(()=>{},[g]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.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)&&l.createElement(ml,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),m?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.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)),l.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:f,optionKey:"i18nKey",select:e=>_(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:E,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);var i;0!==Object.keys(n).length&&y(l),(i=l[l.length-1])&&S(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function fl(e){let{fiReport:n,isCitizen:o=!1}=e;const{t:a}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),n.map((e,i)=>{var o,r,u,s,c,d;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(t.StatusTable,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+a("BPA_FI_REPORT"):a("BPA_FI_REPORT")+" - "+(i+1)),l.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===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),l.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===(s=e.questions)||void 0===s?void 0:s.length)&&(null==e||null===(c=e.questions)||void 0===c?void 0:c.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(t.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(ml,{documents:(d=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==d?void 0:d.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 _l(e){let{t:i,document:o,setNocDocuments:a,setError:r,nocDocuments:u}=e;const s=null==u?void 0:u.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],c=Digit.ULBService.getStateId(),[d,v]=n.useState(),[m,p]=n.useState(null),[E,f]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.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 n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==E?void 0:E.length)||null===E?n:[...null==n?void 0:n.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]),n.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=Je(function(){return f(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",m,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?f(null==e||null===(l=e.data)||void 0===l||null===(o=l.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]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:c,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&p(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const gl=e=>{var i;let{t:o,noc:a,docs:r,isNoc:u,applicationData:s,NOCdata:c,bpaActionsDetails:d}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),m=(null==s?void 0:s.status)||"",p=(null==d||null===(i=d.data)||void 0===i?void 0:i.nextActions)||[],{data:E}=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:f}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!u}),{data:_}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[g,S]=n.useState([]),[h,T]=n.useState([]),[b,y]=n.useState(!1),[C,A]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[N,D]=n.useState(null),I=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;S(null==_||null===(e=_["common-masters"])||void 0===e?void 0:e.DocumentType)},[_]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,r,c,d;l=u?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===(c=f.BPA)||void 0===c||null===(d=c.DocTypeMapping)||void 0===d?void 0:d.filter(e=>{var t,n;return e.WFState==(null==s?void 0:s.status)&&e.RiskType==(null==s?void 0:s.riskType)&&e.ServiceType==(null==s||null===(t=s.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==s||null===(n=s.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[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(l[0].docTypes[0]));let v=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==g||g.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),v.push(e)}),T(v))},[E,g]),n.useEffect(()=>{y("NOC_VERIFICATION_INPROGRESS"===m&&(null==p?void 0:p.length)>0)},[s,d]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:I?""+o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),c&&c.map((e,n)=>{if(null!=e&&e.value)return l.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:I?""+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:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:I?""+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")})})),l.createElement(ml,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==h?void 0:h.map((e,t)=>l.createElement(_l,{key:t,document:e,t:o,error:N,setError:D,setNocDocuments:A,nocDocuments:C,checkEnablingDocs:b}))))},Sl=e=>{let{permissions:i,t:o}=e;const[a,r,s]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[c,d,v]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const m=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,n)=>l.createElement(t.CheckBox,{key:n,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,n)=>{const l=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>n===t?u({},e,{checked:l}):e))})(e,0,n),isLabelFirst:!0,index:n})),null==c?void 0:c.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{d(()=>null==c?void 0:c.map((n,l)=>{var i;return t===l?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:n}))})(e,n),textInputStyle:{maxWidth:m?"96%":"830px",width:m?"96%":"830px"},style:m?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:m?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...c];t.splice(e,1),d([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:m?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{d([...c,{label:""}])}}))};function hl(e){let{documents:o,svgStyles:a={},isSendBackFlow:r=!1}=e;const{t:u}=i.useTranslation(),[s,c]=n.useState(()=>[]),[d,v]=(Digit.ULBService.getCurrentTenantId(),n.useState({}));n.useEffect(()=>{var e;let t=[];null==o||o.forEach((e,n,l)=>{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]),n.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=>{v(null==e?void 0:e.data)}):null!=s&&s.length&&Digit.UploadServices.Filefetch(s,Digit.ULBService.getStateId()).then(e=>{v(null==e?void 0:e.data)})},[s]);const m=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),p=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!p&&(null==o?void 0:o.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:m?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C, 100%",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.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,n)=>{var i,o;return l.createElement("a",{target:"_",href:null===(i=d[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:m?{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")?l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),p&&(null==o?void 0:o.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.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,n)=>{var i;return l.createElement("a",{target:"_",href:null===(i=d[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:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.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")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function Tl(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:o}=n,{t:a}=i.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==o?void 0:o.map((e,n)=>l.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==o?void 0:o.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(t.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function bl(e){let{floors:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},o(null==e?void 0:e.title)),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==n?"16px":"revert"}},o(e.title)),l.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},l.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,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title),text:o(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function yl(e){let{owners:n}=e,o={};o=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:a}=i.useTranslation(),r=(null==n?void 0:n.length)||1;let s={marginTop:"19px"},c={position:"relative",padding:"8px"},d={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?s={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(s={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},c={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(s=u({},s,{maxWidth:"950px"}),s=u({},s,{maxWidth:"950px"}),d={}),n.sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},o.map((e,n)=>{var i;return l.createElement("div",{key:a(null==e?void 0:e.title),style:s,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?a(null==e?void 0:e.title)+" "+(n+1):a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:c},l.createElement("div",{style:{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,n)=>{var i;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:a(e.title),label:a(e.title),text:l.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:d}))}))))})))}const Cl=e=>{var o,a,r;let{scrutinyDetails:u,paymentsList:s=[]}=e;const{t:c}=i.useTranslation(),d=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},c(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?c(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void c("NA");return l.createElement(n.Fragment,null,!(null!=u&&u.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement("div",null,null==u||null===(o=u.values)||void 0===o?void 0:o.map((e,n)=>null!=e&&e.isUnit?l.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:""+c(""+e.title),text:null!=e&&e.value?d(e)+" "+c(null==e?void 0:e.isUnit):c("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?l.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:""+c(""+e.title),text:d(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},c(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},c(null==e?void 0:e.title))),null==u||null===(a=u.permit)||void 0===a?void 0:a.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),l.createElement("div",null,null==u||null===(r=u.scruntinyDetails)||void 0===r?void 0:r.map((e,i)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+c(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(t.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},c(null==e?void 0:e.text))))))))},Al=e=>{var o,a,r,u,s;let{edcrDetails:c,applicationData:d}=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,n,l)=>e[t]},f=n.useMemo(()=>p.map(e=>({Header:v(""+e.name),accessor:E(e.id),id:e.id})));function _(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,i,o,a,r,u,s;n.push({Floor:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.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===(u=e.occupancies)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.CarpetArea)||0,key:v("BPA_FLOOR_NAME_"+e.number)})}),n}function g(e){var t;let n=null==d||null===(t=d.landInfo)||void 0===t?void 0:t.unit,l="";if((null==n?void 0:n.length)>0){var i,o;let t=null===(i=n[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+v("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.StatusTable,null,null==c||null===(o=c.values)||void 0===o?void 0:o.map((e,n)=>null!=e&&e.isHeader?l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},v(null==e?void 0:e.title)):l.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==c||null===(a=c.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(s=u.planDetail)||void 0===s?void 0:s.blocks.map((e,n)=>{var i,o,a,r,u;return l.createElement("div",{key:n,style:(null==c||null===(i=c.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===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},v("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+v("BPA_SUB_OCCUPANCY_LABEL"),text:g(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||m?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.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:_(e),columns:f,getCellProps:e=>({style:{}})})))})))},Nl=e=>{let{headComment:t,otherComment:n}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,t),l.createElement("p",null,n))},Dl=e=>{var n,o,a;let{data:r,OpenImage:u,privacy:s={}}=e;const{t:c}=i.useTranslation();return l.createElement("div",null,r.date&&l.createElement("p",null,r.date),l.createElement("p",null,r.name),r.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:r.mobileNumber,privacy:s}),l.createElement("p",null," ")),r.source&&l.createElement("p",null,c("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),r.comment&&l.createElement(Nl,{otherComment:null==r?void 0:r.otherComment,headComment:null==r?void 0:r.comment}),null!=r&&r.wfComment?l.createElement("div",null,null==r||null===(n=r.wfComment)||void 0===n?void 0:n.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,c("WF_COMMON_COMMENTS")),l.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?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,c("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==r?void 0:r.thumbnailsToShow)}})):null)};function Il(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.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"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},o(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.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,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"N/A",last:n===(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 Ol(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.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"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},o(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.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,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"NA",last:n===(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 Ll=e=>{var o,a,r,u;let{wsAdditionalDetails:s}=e;const{t:c}=i.useTranslation();let d=(v=location.search)?(/^[?#]/.test(v)?v.slice(1):v).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var v;const m=null==d?void 0:d.mode;var{connectionDetails:p,plumberDetails:E,roadCuttingDetails:f,activationDetails:_}=(null==s?void 0:s.additionalDetails)||{connectionDetails:[],plumberDetails:[]};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==s||null===(o=s.additionalDetails)||void 0===o?void 0:o.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==p?void 0:p.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==s||null===(a=s.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=m&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==s||null===(r=s.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=m&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==f?void 0:f.map(e=>{var n;return l.createElement("div",{style:(null==f?void 0:f.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(n=e.values)||void 0===n?void 0:n.map(e=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))})))),(null==s||null===(u=s.additionalDetails)||void 0===u?void 0:u.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==_?void 0:_.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},wl=[{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"}],Rl=[{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"}],xl=e=>{var o,a,r,s;let{wsAdditionalDetails:c}=e;const{t:d}=i.useTranslation(),[v,m,p]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[E,f,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),S=!(null==c||null===(o=c.additionalDetails)||void 0===o||!o.isPaid),[h,T]=n.useState(!1),[b,y]=n.useState(v||{}),[C,A]=n.useState(null),[N,D]=n.useState(c.additionalDetails.data?c.additionalDetails.data:{}),[I,O]=n.useState(c.additionalDetails.values?c.additionalDetails.values:[]),L=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(L,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i=u({},null==c||null===(e=c.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==v||null===(n=v.billDetails)||void 0===n?void 0:n.length)>0){var o,a,r,s,d,p,E;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(o=v.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(r=v.billDetails)||void 0===r||null===(s=r[0])||void 0===s?void 0:s.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==v||null===(d=v.billDetails)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.taxAmount)}];O(e),D(null==v||null===(E=v.billDetails)||void 0===E?void 0:E[0])}else m(i),y(i)},[]);let w={};const R=e=>l.createElement("h1",{className:"heading-m"},e.label),x=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(x,null)),M=function(e,t,n){void 0===t&&(t=!1);let l=u({},b);if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var i,o;const t=0==(null==n||null===(i=n.target)||void 0===i?void 0:i.value)?1:Math.sign(null==n||null===(o=n.target)||void 0===o?void 0:o.value)||-1;l[e]=1==t?n.target.value:""}y(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},I&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==I?void 0:I.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+d("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==N?void 0:N.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+d("CS_INBOX_STATUS_FILTER"),text:d(S?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:S?{color:"#00703C"}:{color:"#D4351C"}}))),null!=c&&null!==(a=c.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{T(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},d("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,h&&l.createElement(t.Modal,{headerBarMain:l.createElement(R,{label:d("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(P,{onClick:()=>{y(v),T(!1)}}),actionCancelLabel:d("PT_CANCEL"),actionCancelOnSubmit:()=>{y(v),T(!1)},actionSaveLabel:d("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,n=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var l,i;if(t||n)if(n>(null==c||null===(l=c.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))A({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,s,v,p,E,g,S,h;const e=null==c||null===(o=c.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==c||null===(r=c.additionalDetails)||void 0===r||null===(s=r.appDetails)||void 0===s?void 0:s.tenantId,n=u({},null==c||null===(v=c.additionalDetails)||void 0===v||null===(p=v.appDetails)||void 0===p?void 0:p.additionalDetails,b);c.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==c||null===(E=c.additionalDetails)||void 0===E||null===(g=E.appDetails)||void 0===g?void 0:g.service)?[{applicationNo:e,tenantId:t,waterConnection:c.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:c.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==c||null===(S=c.additionalDetails)||void 0===S||null===(h=S.appDetails)||void 0===h?void 0:h.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,a,r,u,s,c,d,v,p,E,g,S;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.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===(S=g.taxHeadEstimates)||void 0===S||S.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 h=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(s=e.Calculation)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.charge},{title:"WS_TAX_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(v=d[0])||void 0===v?void 0:v.taxAmount}];f(kn(e.Calculation[0])),D(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),O(h),b.billDetails=null==e?void 0:e.Calculation,m(b),T(!1)}).catch(e=>{var t,n,l,i,o,a;A({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(l=n.Errors[0])&&void 0!==l&&l.message?d(""+(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)):d("PT_COMMON_ADD_REBATE_PENALITY")})})}else A({isError:!1,isWarning:!0,key:"warning",message:d("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_PENALTY")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:wl,optionKey:"title",select:e=>M("adhocPenaltyReason",!0,e),selected:(null==b?void 0:b.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:d})),"PT_OTHERS"===(null==b||null===(r=b.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>M("adhocPenaltyComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==b?void 0:b.adhocPenalty)||"",onChange:e=>M("adhocPenalty",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_REBATE")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Rl,optionKey:"title",select:e=>M("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:d})),"PT_OTHERS"===(null==b||null===(s=b.adhocRebateReason_data)||void 0===s?void 0:s.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>M("adhocRebateComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==b?void 0:b.adhocRebate)||"",onChange:e=>M("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:d(null==C?void 0:C.message),onClose:()=>{A(!1)},isDleteBtn:!0})))},Pl=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:u({},t),display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.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"})))},Ml=e=>{let{t:n,userType:i=!1,infoBannerLabel:o="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;i=i||Digit.SessionStorage.get("userType");const s=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:s?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(t.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},n(o))),n(a)+" ",l.createElement(Pl,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(u)))))},kl=e=>{var o,a,r,u,s,c,d;let{wsAdditionalDetails:v}=e;const{t:m}=i.useTranslation(),[p,E]=n.useState(!1),[f,_]=n.useState({}),g=e=>l.createElement("h1",{className:"heading-m"},e.label),S=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),h=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(S,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=v&&null!==(o=v.additionalDetails)&&void 0!==o&&o.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=v.additionalDetails.data||{};const n=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),l=n?JSON.parse(n):{};null!=l&&null!==(e=l.value)&&void 0!==e&&e.totalAmount&&(t=null==l?void 0:l.value),_(t),E(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},m("WS_PAYMENT_VIEW_BREAKUP"))):null,p&&l.createElement(t.Modal,{headerBarMain:l.createElement(g,{label:m("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(h,{onClick:()=>{E(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.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=>l.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:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.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:l.createElement("span",null,"₹",Number(null==f?void 0:f.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_SERVICE_FEE_HEADER")),null==f||null===(u=f.billSlabData)||void 0===u||null===(s=u.CHARGES)||void 0===s?void 0:s.map(e=>l.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:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.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:l.createElement("span",null,"₹",Number(null==f?void 0:f.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==f||null===(c=f.billSlabData)||void 0===c||null===(d=c.TAX)||void 0===d?void 0:d.map(e=>l.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:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.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:l.createElement("span",null,"₹",Number(null==f?void 0:f.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Fl={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:{}},Bl=e=>{let{className:t="table",headers:n=[],values:o=[],arrears:a=0}=e;const{t:r}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:Fl.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Fl.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:u({},Fl.cell,Fl.cellLeft,Fl.cellHeader)},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:u({},Fl.cell,n.length==t+1?Fl.cellRight:{},Fl.cellHeader),key:t},r(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:u({},Fl.cell,Fl.cellLeft),component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:u({},Fl.cell,{textAlign:"left"},n.length==i+1?Fl.cellRight:{},{whiteSpace:"pre"}),key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:u({},Fl.cell,Fl.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:u({},Fl.cell,Fl.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:u({},Fl.cell,{textAlign:"left"}),key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Fl.cell,key:t,numeric:!0})))))))},Ul={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))"}},Wl=e=>{var t,o,a;let{bill:r={}}=e;const{t:u}=i.useTranslation();let s={},c=(null==r||null===(t=r.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];c=[...c];const d=(null===(o=c)||void 0===o?void 0:o.reduce((e,t,n)=>0===n?e:e+t.amount,0))||0;let v="₹ "+((null==d||null===(a=d.toFixed)||void 0===a?void 0:a.call(d,0))||Number(0).toFixed(0));c.shift(),c.map(e=>{let t=function(e){var t,n,l;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===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);s[((e,t)=>{const n=new Date(e),l=new Date(t);return l.getYear()-n.getYear()!=0?"FY"+(n.getYear()+1900)+"-"+(l.getYear()-100):n.toLocaleDateString()+"-"+l.toLocaleDateString()})(e.fromPeriod,e.toPeriod)]=t});let m={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{m[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let p=[];p=Object.keys(m),p.sort((e,t)=>m[e]-m[t]);const[E,f]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Ul.headerStyle},u("CS_ARREARS_DETAILS")),E&&l.createElement(Bl,{headers:[...p],values:s,arrears:v}),!E&&l.createElement("div",{style:Ul.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{f(!0)}},u("CS_SHOW_CARD"))),E&&l.createElement("div",{style:Ul.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{f(!1)}},u("CS_HIDE_CARD"))))},Hl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),jl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Hl,null)),zl=e=>{let{t:n,closeModal:i}=e;console.log(" ----- Renew POP coming "),Digit.Hooks.sv.useCreateDemand();const a=o.useHistory();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement(e=>l.createElement("h1",{className:"heading-m"},e.label),{label:"SV_WANT_TO_EDIT"}),headerBarEnd:l.createElement(jl,{onClick:i}),actionCancelLabel:n("CS_COMMON_BACK"),actionCancelOnSubmit:i,hideSubmit:!0,formId:"modal-action"},l.createElement(t.Card,{style:{boxShadow:"none"}},l.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},l.createElement(t.SubmitBar,{label:n("SV_YES_PROCEED_WITH_APPLICATION"),onSubmit:()=>{a.push("renew-application/info")}}),l.createElement(t.SubmitBar,{label:n("SV_NO_PROCEED_PAYEMNT"),onSubmit:()=>{console.log(" testing coming compilter"),a.push("renew-application/check/makePayment")}})))))};function Vl(e){var a,r,u,s,c,d,v,m,p,E,f,g,S,h,T;let{applicationDetails:b,workflowDetails:y,isDataLoading:C,applicationData:A,timelineStatusPrefix:N,showTimeLine:D=!0,statusAttribute:I="status",paymentsList:O,oldValue:L,isInfoLabel:w=!1}=e;const{t:R}=i.useTranslation(),x=(o.useHistory(),o.useLocation()),[P,M]=n.useState(!1),[k,F]=n.useState(null);new URLSearchParams(x.search);let{id:B}=o.useParams();const U=null==b||null===(a=b.applicationData)||void 0===a?void 0:a.owners;function W(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("ownersSequences:- ",U);const[H,j]=n.useState({}),[z,V]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==A?void 0:A.status)||z.loading||z.loaded||z.canLoad||V({loading:!1,loaded:!1,canLoad:!0}),null==z||!z.canLoad||z.loading||z.loaded||(V({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){n(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(n){if((null==i||null===(n=i.Assessments)||void 0===n?void 0:n.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==A?void 0:A.tenantId)||tenantId,null==A?void 0:A.propertyId,j,V));const K=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+t.getFullYear()},G=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:K(null==A||null===(i=A.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==A?void 0:A.channel)||""};return l.createElement(Dl,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,s,c,d,v,m,p,E,f,g,S,h,T,y,C;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==b?void 0:b.tenantId,businessIds:null==b?void 0:b.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber"),n}}},N=n[t-1],D={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.name,mobileNumber:(null==A||null===(c=A.processInstance)||void 0===c||null===(d=c.assignes)||void 0===d||null===(v=d[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!=A&&null!==(E=A.processInstance)&&void 0!==E&&null!==(f=E.assignes)&&void 0!==f&&null!==(g=f[0])&&void 0!==g&&g.mobileNumber?null==A||null===(S=A.processInstance)||void 0===S||null===(h=S.assignes)||void 0===h||null===(T=h[0])||void 0===T?void 0:T.mobileNumber:null==e||null===(y=e.assignes)||void 0===y||null===(C=y[0])||void 0===C?void 0:C.mobileNumber,comment:R(null==e?void 0:e.comment),wfComment:N?N.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Dl,{data:D,OpenImage:W,privacy:i})}{var N,D,I,O,L;const t={date:K(null==A||null===(N=A.auditDetails)||void 0===N?void 0:N.lastModifiedTime),name:null==e||null===(D=e.assignes)||void 0===D||null===(I=D[0])||void 0===I?void 0:I.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(O=e.assignes)||void 0===O||null===(L=O[0])||void 0===L?void 0:L.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Dl,{data:t,OpenImage:W})}},q=(e,t)=>e?t?e:R(e):R("NA"),Y=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),X=window.location.href.includes("employee/noc"),Q=window.location.href.includes("employee/obps"),Z=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||Y?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),$=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?q(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?q(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):R("N/A"),[J,ee]=n.useState(!1);return l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},w?l.createElement(Ml,{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==b||null===(r=b.applicationDetails)||void 0===r?void 0:r.map((e,n)=>{var i,a,r,u,s,c,d,v,m,p,E,f,_,g,S,h,T,C,A,N,D,I,w,x,P,k,U,W,j,z,V,K,G,q,J,ee,te,ne,le;return l.createElement(l.Fragment,{key:n},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:Y?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==n||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==n&&Y?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},X?""+R(e.title):R(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},R(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse",borderCollapse:"collapse",border:"1px solid black"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"5px",border:"1px solid black"}},R(e)))),null==e?void 0:e.tableRows.map((n,i)=>l.createElement("tr",null,n.map((n,a)=>Array.isArray(n)&&n.length>1&&!0===e.isMaintenance?l.createElement("td",{style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"},key:a},l.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"5px"}},n.map((e,n)=>l.createElement("a",{key:n,onClick:()=>{Digit.UploadServices.Filefetch([e.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var t,n,l;console.log("Response of file:",e);const i=null==e||null===(t=e.data)||void 0===t||null===(n=t.fileStoreIds)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.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"}},l.createElement(t.PDFSvg,{style:{width:"25px",height:"25px"}}))))):l.createElement("td",{key:a,style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"}},console.log("Comming Maintainaince data row:- ",n.data),n&&!0===n.editButton?l.createElement("span",{style:{display:"inline-flex",gap:"10px",alignItems:"center"}},l.createElement(o.Link,{to:{pathname:"/digit-ui/employee/asset/assetservice/maintenance-edit/"+B,state:{data:n.data}}},l.createElement("button",null," ",l.createElement(t.EditIcon,null)," ")),l.createElement("div",{key:i,onClick:()=>(F(n.data),void M(!0)),style:{cursor:"pointer"}},l.createElement(t.ViewsIcon,null))):R(n)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||Y?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(i=e.values)||void 0===i?void 0:i.map((n,i)=>{var a,r,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:R(n.title),label:R(n.title),text:l.createElement("img",{src:R(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:R(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},R(null==n?void 0:n.title)))):X||Q?""+R(n.title):R(n.title),text:l.createElement("div",null,l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:i===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:Z(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+R(""+n.title),privacy:null==n?void 0:n.privacy,text:null!=n&&n.oldValue?null==n?void 0:n.oldValue:null!=n&&n.value?null==n?void 0:n.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(t.Row,{key:R(n.title),label:R(n.title),text:$(n),last:i===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:Z(),labelStyle:{wordBreak:"break-all",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isBold?"italic":"normal"},textStyle:{wordBreak:"break-all",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isBold?"italic":"normal"}}),"PT_TOTAL_DUES"===n.title?l.createElement(Wl,{bill:null===(r=H.Bill)||void 0===r?void 0:r[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(a=e.additionalDetails)||void 0===a?void 0:a.inspectionReport)&&l.createElement(Cl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:O}),(null==b||null===(r=b.applicationData)||void 0===r||null===(u=r.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)&&l.createElement(fl,{fiReport:null==b||null===(d=b.applicationData)||void 0===d||null===(v=d.additionalDetails)||void 0===v?void 0:v.fieldinspection_pending}),(null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.floors)&&l.createElement(bl,{floors:null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.floors}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners)&&l.createElement(yl,{owners:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.owners}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units)&&l.createElement(Ol,{units:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.units}),(null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.accessories)&&l.createElement(Il,{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==y||null===(C=y.data)||void 0===C||null===(A=C.nextActions)||void 0===A?void 0:A.length)>0&&l.createElement(Sl,{applicationData:null==b?void 0:b.applicationData,t:R,permissions:null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.permissions}),(null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.obpsDocuments)&&l.createElement(pl,{t:R,applicationData:null==b?void 0:b.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:y}),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&l.createElement(gl,{t:R,isNoc:!0,NOCdata:e.values,applicationData:null==b?void 0:b.applicationData,docs:e.additionalDetails.noc,noc:null===(w=e.additionalDetails)||void 0===w?void 0:w.data,bpaActionsDetails:y}),(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.scruntinyDetails)&&l.createElement(Cl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.buildingExtractionDetails)&&l.createElement(Cl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.subOccupancyTableDetails)&&l.createElement(Al,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==b?void 0:b.applicationData}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl)&&l.createElement(ml,{documents:null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documentsWithUrl}),(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documents)&&l.createElement(hl,{documents:null==e||null===(z=e.additionalDetails)||void 0===z?void 0:z.documents}),(null==e||null===(V=e.additionalDetails)||void 0===V?void 0:V.taxHeadEstimatesCalculation)&&l.createElement(Tl,{taxHeadEstimatesCalculation:null==e||null===(K=e.additionalDetails)||void 0===K?void 0:K.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Ll,{wsAdditionalDetails:e,oldValue:L}),(null==e||null===(G=e.additionalDetails)||void 0===G?void 0:G.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(o.Link,{to:null==e||null===(q=e.additionalDetails)||void 0===q||null===(J=q.redirectUrl)||void 0===J?void 0:J.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(ee=e.additionalDetails)||void 0===ee||null===(te=ee.redirectUrl)||void 0===te?void 0:te.title))),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&l.createElement(xl,{wsAdditionalDetails:e,workflowDetails:y}),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement(kl,{wsAdditionalDetails:e,workflowDetails:y}))}),D&&(null==y||null===(u=y.data)||void 0===u||null===(s=u.timeline)||void 0===s?void 0:s.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==y?void 0:y.isLoading)||C)&&l.createElement(t.Loader,null),!(null!=y&&y.isLoading)&&!C&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},R("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=y&&null!==(c=y.data)&&void 0!==c&&c.timeline&&1===(null==y||null===(d=y.data)||void 0===d||null===(v=d.timeline)||void 0===v?void 0:v.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:R(""+N+(null==y||null===(m=y.data)||void 0===m||null===(p=m.timeline[0])||void 0===p?void 0:p.state)),customChild:G(null==y||null===(E=y.data)||void 0===E?void 0:E.timeline[0],null==y||null===(f=y.data)||void 0===f?void 0:f.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==y||null===(g=y.data)||void 0===g?void 0:g.timeline)&&(null==y||null===(S=y.data)||void 0===S?void 0:S.timeline.slice(0,J?null==y?void 0:y.data.timeline.length:2).map((e,n,i)=>{var o;let a="";var r,u,s,c,d,v;return window.location.href.includes("/obps/")&&(a=null!=y&&null!==(r=y.data)&&void 0!==r&&null!==(u=r.timeline[n-1])&&void 0!==u&&null!==(s=u.state)&&void 0!==s&&s.includes("BACK_FROM")||null!=y&&null!==(c=y.data)&&void 0!==c&&null!==(d=c.timeline[n-1])&&void 0!==d&&null!==(v=d.state)&&void 0!==v&&v.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==n?"":"_DONE"),l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,info:e.comment,label:R(""+N+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[I])+a),customChild:G(e,n,null==y||null===(o=y.data)||void 0===o?void 0:o.timeline)}))}))),(null==y||null===(h=y.data)||void 0===h||null===(T=h.timeline)||void 0===T?void 0:T.length)>2&&l.createElement(t.LinkButton,{label:R(J?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{ee(e=>!e)}})))),l.createElement("div",null,P&&l.createElement(zl,{t:R,closeModal:()=>setRnewButton(!1),actionCancelOnSubmit:()=>setRnewButton(!1),application:application})))}function Kl(e){var n,i,o,a,r,u,s,c,d,v,m,p,E,f,_,g,S,h;let{t:T,showToast:b,closeToast:y,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var A;let e="";switch(null==b||null===(A=b.action)||void 0===A?void 0:A.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:T("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:T("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(o=b.error)||void 0===o?void 0:o.message:T("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:T("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:T("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==b?void 0:b.key)?null==b||null===(u=b.error)||void 0===u?void 0:u.message:T("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(s=b.error)||void 0===s?void 0:s.message:T("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(c=b.error)||void 0===c?void 0:c.message:T("ES_"+C+"_"+(null==b||null===(d=b.action)||void 0===d?void 0:d.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:e,onClose:y}))}if(null!=C&&C.includes("BPA")||null!=C&&C.includes("BPA_LOW")||null!=C&&C.includes("BPA_OC")){var N;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?T(e[1]):T(e[0]),n};let n="";switch(null==b||null===(N=b.action)||void 0===N?void 0:N.action){case"REVOCATE":n="error"===(null==b?void 0:b.key)?null==b||null===(v=b.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":n="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==b?void 0:b.key)?null==b||null===(E=b.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==b?void 0:b.key)?null==b||null===(g=b.error)||void 0===g?void 0:g.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==b?void 0:b.key)?null==b||null===(S=b.error)||void 0===S?void 0:S.message:T("ES_"+C+"_"+(null==b||null===(h=b.action)||void 0===h?void 0:h.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:y}))}{var D,I;const e="error"===(null==b?void 0:b.key)?null==b||null===(D=b.error)||void 0===D?void 0:D.message:"ES_"+C+"_"+(null==b||null===(I=b.action)||void 0===I?void 0:I.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:T(e),onClose:y}))}}function Gl(e){var o,a,r,s,c,d,v,m,p,E,f,_,g,S,h,T,b,y,C;let{workflowDetails:A,displayMenu:N,onActionSelect:D,setDisplayMenu:I,businessService:O,forcedActionPrefix:L,ActionBarStyle:w={},MenuStyle:R={},isAction:x,applicationDetails:P}=e;const{t:M}=i.useTranslation();let k=Digit.UserService.getUser();const F=n.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};k=null==t?void 0:t.value}const B=null===(o=k)||void 0===o||null===(a=o.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let U=!1,W=!1,H=(null==A||null===(s=A.data)||void 0===s||null===(c=s.actionState)||void 0===c||null===(d=c.nextActions)||void 0===d?void 0:d.filter(e=>(null==B?void 0:B.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==A||null===(v=A.data)||void 0===v||null===(m=v.nextActions)||void 0===m?void 0:m.filter(e=>(null==B?void 0:B.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(F,()=>{I(!1)},N),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==H?void 0:H.length)||null!=H&&null!==(p=H[0])&&void 0!==p&&null!==(E=p.redirectionUrl)&&void 0!==E&&E.pathname.includes("/pt/property-details/")&&1==(null==H?void 0:H.length)?(W=!1,U=!0):(null==H?void 0:H.length)>0&&(W=!0,U=!1);const j=Digit.SessionStorage.get("User"),z=null==j||null===(f=j.info)||void 0===f?void 0:f.uuid,V=null==P||null===(_=P.applicationData)||void 0===_||null===(g=_.auditDetails)||void 0===g?void 0:g.lastModifiedBy;return l.createElement(l.Fragment,null,!(null!=A&&A.isLoading)&&W&&!U&&!x&&l.createElement(t.ActionBar,{style:u({},w)},N&&(null!=A&&null!==(S=A.data)&&void 0!==S&&null!==(h=S.actionState)&&void 0!==h&&h.nextActions||null!=A&&null!==(T=A.data)&&void 0!==T&&T.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:L||"WF_EMPLOYEE_"+(null==O?void 0:O.toUpperCase()),options:H,optionKey:"action",t:M,onSelect:D,style:R}):null,"ewst"===O?V===z||null==V?l.createElement(t.SubmitBar,{ref:F,label:M("WF_TAKE_ACTION"),onSubmit:()=>I(!N)}):l.createElement(t.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+M("EW_ALERT_ANOTHER_VENDOR")):l.createElement(t.SubmitBar,{ref:F,label:M("WF_TAKE_ACTION"),onSubmit:()=>I(!N)})),!(null!=A&&A.isLoading)&&!W&&U&&!x&&l.createElement(t.ActionBar,{style:u({},w)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==H||null===(b=H[0])||void 0===b?void 0:b.action,value:null==H||null===(y=H[0])||void 0===y?void 0:y.action,onClick:e=>{D((null==H?void 0:H[0])||{})}},M((L||"WF_EMPLOYEE_"+(null==O?void 0:O.toUpperCase()))+"_"+(null==H||null===(C=H[0])||void 0===C?void 0:C.action)))))}const ql=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),Yl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ql,null));function Xl(e){let{action:n,closeWarningPopup:o}=e;const{t:a}=i.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(Yl,{onClick:()=>{o()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),l.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==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:o,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==n||null===(e=n.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const Ql=e=>{var r;const s=Digit.ULBService.getCurrentTenantId(),c=Digit.ULBService.getStateId(),{t:d}=i.useTranslation(),v=o.useHistory();let{id:m}=o.useParams();const[p,E]=n.useState(!1),[f,_]=n.useState(null),[g,S]=n.useState(!1),[h,T]=n.useState(!1),[b,y]=n.useState(!1),{applicationDetails:C,showToast:A,setShowToast:N,isLoading:D,isDataLoading:I,applicationData:O,mutate:L,nocMutation:w,workflowDetails:R,id:x,businessService:P,closeToast:M,moduleCode:k,timelineStatusPrefix:F,forcedActionPrefix:B,statusAttribute:U,ActionBarStyle:W,MenuStyle:H,paymentsList:j,showTimeLine:z=!0,oldValue:V,isInfoLabel:K=!1,clearDataDetails:G,isAction:q=!1}=e;n.useEffect(()=>{A&&R.revalidate()},[A]);const Y=a.useQueryClient(),X=()=>{_(null),S(!1)};return D||h?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,D?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(Vl,{applicationDetails:C,id:x,workflowDetails:R,isDataLoading:I,applicationData:O,businessService:P,timelineStatusPrefix:F,statusAttribute:U,paymentsList:j,showTimeLine:z,oldValue:V,isInfoLabel:K}),g?l.createElement(vl,{t:d,action:f,tenantId:s,state:c,id:m,applicationDetails:C,applicationData:null==C?void 0:C.applicationData,closeModal:X,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,a,r,s,c,m,p,E,_,g,S){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===(s=r[0])||void 0===s||null===(c=s.comment)||void 0===c?void 0:c.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===(_=E.comment)||void 0===_?void 0:_.length)&&0!=(null==e||null===(g=e.BPA)||void 0===g||null===(S=g.comment)||void 0===S?void 0:S.length)){function h(t){if(l)return t;L&&(T(!0),L(e,{onError:(e,t)=>{T(!1),N({key:"error",error:e}),setTimeout(M,5e3)},onSuccess:(e,t)=>{var l,i,o,a,r,u,s,c,m,p,E,_;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),T(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=f,v.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=f,v.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&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!==(u=r.workflow)&&void 0!==u&&u.action.includes("SEND_BACK")?N({key:"success",label:d("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(s=t.AmendmentUpdate)&&void 0!==s&&null!==(c=s.workflow)&&void 0!==c&&c.action.includes("RE-SUBMIT")?N({key:"success",label:d("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")?N({key:"success",label:d("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(E=t.AmendmentUpdate)&&void 0!==E&&null!==(_=E.workflow)&&void 0!==_&&_.action.includes("REJECT")&&N({key:"success",label:d("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(N({key:"success",action:f}),G&&setTimeout(G,3e3),setTimeout(M,5e3),Y.clear(),Y.refetchQueries("APPLICATION_SEARCH"))}})),X()}T(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(u({},e)));const i=function(){if(!1!==t&&w){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==w?void 0:w.mutateAsync(e)),i=Je(function(){return T(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,i,o,a,r,u,s,c,v,m,p;T(!1);let E=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?d(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.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;X(),N({key:"error",error:{message:E}}),setTimeout(M,5e3),l=!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==R||null===(r=R.data)||void 0===r?void 0:r.timeline,businessService:P,workflowDetails:R,moduleCode:k}):null,b?l.createElement(Xl,{action:f,workflowDetails:R,businessService:P,isWarningPop:b,closeWarningPopup:()=>{y(!1)}}):null,l.createElement(Kl,{t:d,showToast:A,closeToast:M,businessService:P}),l.createElement(Gl,{isAction:q,workflowDetails:R,displayMenu:p,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)N({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(M,5e3);else if(null!=e&&e.isWarningPopUp)y(!0);else if(null!=e&&e.redirectionUrll){var t,n,l,i,o;if("ACTIVATE_CONNECTION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action))v.push(""+(null==e||null===(l=e.redirectionUrll)||void 0===l?void 0:l.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===(n=e.redirectionUrll)||void 0===n?void 0:n.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 s;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.pathname))}}else if(null!=e&&e.redirectionUrl){var c,d;v.push({pathname:null===(c=e.redirectionUrl)||void 0===c?void 0:c.pathname,state:u({},null===(d=e.redirectionUrl)||void 0===d?void 0:d.state)})}else S(!0);_(e),E(!1)},setDisplayMenu:E,businessService:P,forcedActionPrefix:B,ActionBarStyle:W,MenuStyle:H,applicationDetails:C})))},Zl=()=>l.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"},l.createElement("polyline",{points:"20 6 9 17 4 12"})),$l=()=>l.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l.createElement("circle",{cx:"12",cy:"12",r:"10"}),l.createElement("polyline",{className:"clock-hands2",points:"12 6 12 12 16 14"})),Jl=e=>{var n;let{workflowDetails:o}=e;const{t:a}=i.useTranslation();if(null==o||null===(n=o.data)||void 0===n||!n.timeline)return null;const r=o.data.timeline;return l.createElement(t.Card,{className:"workflow-timeline-card2 digit-form-composer",style:{background:"#fafafa",padding:"16px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"16px",fontWeight:"700",color:"#374151"}},a("WORKFLOW_TIMELINE")),l.createElement("div",{className:"timeline-container2"},r.map((e,t)=>{var n,i,o,u;const s=((e,t)=>0===t?"current2":"completed2")(0,t),c=t!==r.length-1&&r.length>1;return l.createElement("div",{key:t,className:"timeline-item2 "+s},l.createElement("div",{className:"timeline-marker2"},l.createElement("div",{className:"timeline-circle2"},l.createElement("completed2"===s?Zl:$l,null)),c&&l.createElement("div",{className:"timeline-line2"})),l.createElement("div",{className:"timeline-content2"},l.createElement("div",{className:"timeline-header2"},l.createElement("div",{className:"timeline-title2"},a("WF_"+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e.state))),l.createElement("span",{className:"timeline-date2"},(e=>{if(!e)return"N/A";const t=new Date(e);return t.getDate().toString().padStart(2,"0")+"/"+(t.getMonth()+1).toString().padStart(2,"0")+"/"+t.getFullYear().toString().slice(-2)+" "+t.getHours().toString().padStart(2,"0")+":"+t.getMinutes().toString().padStart(2,"0")})(null==e||null===(n=e.auditDetails)||void 0===n?void 0:n.lastModified))),l.createElement("div",{className:"timeline-body2"},l.createElement("div",{className:"timeline-status-tag2 status-"+s},a(e.status)),(null==e?void 0:e.comment)&&l.createElement("div",{className:"timeline-comment2"},a(e.comment))),(null==e||null===(i=e.assignes)||void 0===i?void 0:i.length)>0&&l.createElement("div",{className:"timeline-footer2"},l.createElement("span",null,a("ES_COMMON_ASSIGNED_TO"),": ",l.createElement("strong",null,null==e||null===(o=e.assignes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.name)))))})))};var ei=l.memo(()=>{var e,a,r,u;const{t:s}=i.useTranslation(),c=(Digit.Hooks.useStore.getInitData(),Digit.ULBService.getCurrentTenantId()),{id:d}=o.useParams(),[v,m]=n.useState(null),[p,E]=n.useState({}),[f,_]=n.useState(!1),[g,S]=n.useState("watertanker"),h=null==d?void 0:d.startsWith("WT"),T=null==d?void 0:d.startsWith("TP"),b=h?"watertanker":T?"treePruning":"mobileToilet",y=Digit.UserService.getUser().info;sessionStorage.setItem(h?"wt":T?"tp":"mt",d);const{isLoading:C,data:A}=h?Digit.Hooks.wt.useWTApplicationDetail(s,c,d):T?Digit.Hooks.wt.useTPApplicationDetail(s,c,d):Digit.Hooks.wt.useMTApplicationDetail(s,c,d),{mutate:N}=h?Digit.Hooks.wt.useWTApplicationAction(c):T?Digit.Hooks.wt.useTPApplicationAction(c):Digit.Hooks.wt.useMTApplicationAction(c);let D=Digit.Hooks.useWorkflowDetails({tenantId:(null==A||null===(e=A.applicationData)||void 0===e?void 0:e.tenantId)||c,id:null==A||null===(a=A.applicationData)||void 0===a||null===(r=a.applicationData)||void 0===r?void 0:r.bookingNo,moduleCode:b,role:h?["WT_CEMP"]:T?["TP_CEMP"]:["MT_CEMP"]});n.useEffect(()=>{A&&E(Ke.cloneDeep(A))},[A]),n.useEffect(()=>{var e,t,n,l,i;null!=D&&null!==(e=D.data)&&void 0!==e&&e.applicationBusinessService&&!("watertanker"===(null==D||null===(t=D.data)||void 0===t?void 0:t.applicationBusinessService)&&"watertanker"===b||"mobileToilet"===(null==D||null===(n=D.data)||void 0===n?void 0:n.applicationBusinessService)&&"mobileToilet"===b||"treePruning"===(null==D||null===(l=D.data)||void 0===l?void 0:l.applicationBusinessService)&&"treePruning"===b)&&S(null==D||null===(i=D.data)||void 0===i?void 0:i.applicationBusinessService)},[D.data]);const[I,O]=n.useState(!0);let L=[];return l.createElement("div",{style:{padding:"CITIZEN"===(null==y?void 0:y.type)?"0 15px":""}},l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},s("BOOKING_DETAILS")),l.createElement("div",{style:{zIndex:"10",display:"flex",flexDirection:"row-reverse",alignItems:"center",marginTop:"-25px"}},L&&L.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper employee-mulitlink-main-div",onHeadClick:()=>_(!f),displayOptions:f,options:L,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"}))),l.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"20px"}},l.createElement("div",{style:{flex:"0 0 25%",minWidth:"250px"}},l.createElement("div",{style:{}},l.createElement(Jl,{workflowDetails:D}))),l.createElement("div",{style:{flex:"1"}},l.createElement(Ql,{applicationDetails:null==p?void 0:p.applicationData,isLoading:C,isDataLoading:C,applicationData:null==p||null===(u=p.applicationData)||void 0===u?void 0:u.applicationData,mutate:N,workflowDetails:D,businessService:b,moduleCode:"request-service",showToast:v,setShowToast:m,closeToast:()=>{m(null)},timelineStatusPrefix:"",forcedActionPrefix:"RS",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"},showTimeLine:!1}))))});const ti=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),ni=e=>{let{onClick:t}=e;return l.createElement("div",{className:"icon-bg-secondary",onClick:t},l.createElement(ti,null))},li=e=>l.createElement("h1",{className:"heading-m"},e.t("SERVICE_TYPE")),ii=e=>e.substr(0,1).toUpperCase()+e.substr(1),oi=function(e,t,n){try{var l,i,o,a,r,u,s,c,d,v,m,f,_,g;return Promise.resolve({t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(S=n("ULBGRADE_"+(null==t||null===(l=t.city)||void 0===l?void 0:l.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),S.toLowerCase().split(" ").map(ii).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:n("MT_ACKNOWLEDGEMENT"),details:[{title:n("MT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:n("MT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:n("MT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:n("MT_ALT_MOBILE_NUMBER"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.alternateNumber},{title:n("MT_EMAIL_ID"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.emailId}].filter(e=>e.value)},{title:n("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:n("WT_PINCODE"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.pincode},{title:n("WT_CITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.city},{title:n("WT_LOCALITY"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.locality},{title:n("WT_STREET_NAME"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.streetName},{title:n("WT_DOOR_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.doorNo},{title:n("WT_HOUSE_NO"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.houseNo},{title:n("WT_ADDRESS_LINE1"),value:null==e||null===(f=e.address)||void 0===f?void 0:f.addressLine1},{title:n("WT_ADDRESS_LINE2"),value:null==e||null===(_=e.address)||void 0===_?void 0:_.addressLine2},{title:n("WT_LANDMARK"),value:null==e||null===(g=e.address)||void 0===g?void 0:g.landmark}].filter(e=>e.value)},{title:n("MT_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:n("MT_NUMBER_OF_MOBILE_TOILETS"),value:null==e?void 0:e.noOfMobileToilet},{title:n("MT_DELIVERY_FROM_DATE"),value:E(null==e?void 0:e.deliveryFromDate)},{title:n("MT_DELIVERY_TO_DATE"),value:E(null==e?void 0:e.deliveryToDate)},{title:n("MT_REQUIREMENT_TIME"),value:p(null==e?void 0:e.deliveryFromTime)+" - "+p(null==e?void 0:e.deliveryToTime)},{title:n("MT_SPECIAL_REQUEST"),value:null==e?void 0:e.description}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var S},ai=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")},ri={padding:"4px 0px",justifyContent:"space-between"},ui=e=>{var n,i;return console.log("BannerPicker",e),l.createElement(t.Banner,{message:ai(e),applicationNumber:null===(n=e.data)||void 0===n||null===(i=n.mobileToiletBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("MT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},si=e=>e.substr(0,1).toUpperCase()+e.substr(1),ci=function(e,t,n){try{var l,i,o,a,r,u,s,c,d,v,m,p,E,f;return Promise.resolve({t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(_=n("ULBGRADE_"+(null==t||null===(l=t.city)||void 0===l?void 0:l.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),_.toLowerCase().split(" ").map(si).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:n("TP_ACKNOWLEDGEMENT"),details:[{title:n("MT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:n("MT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:n("MT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:n("MT_ALT_MOBILE_NUMBER"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.alternateNumber},{title:n("MT_EMAIL_ID"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.emailId}].filter(e=>e.value)},{title:n("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:n("WT_PINCODE"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.pincode},{title:n("WT_CITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.city},{title:n("WT_LOCALITY"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.locality},{title:n("WT_STREET_NAME"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.streetName},{title:n("WT_DOOR_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.doorNo},{title:n("WT_HOUSE_NO"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.houseNo},{title:n("WT_ADDRESS_LINE1"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.addressLine1},{title:n("WT_ADDRESS_LINE2"),value:null==e||null===(E=e.address)||void 0===E?void 0:E.addressLine2},{title:n("WT_LANDMARK"),value:null==e||null===(f=e.address)||void 0===f?void 0:f.landmark}].filter(e=>e.value)},{title:n("TP_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:n("REASON_FOR_PRUNING"),value:n(null==e?void 0:e.reasonForPruning)},{title:n("LATITUDE_GEOTAG"),value:null==e?void 0:e.latitude},{title:n("LONGITUDE_GEOTAG"),value:null==e?void 0:e.longitude}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var _},di=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")},vi={padding:"4px 0px",justifyContent:"space-between"},mi=e=>{var n,i;return console.log("BannerPicker",e),l.createElement(t.Banner,{message:di(e),applicationNumber:null===(n=e.data)||void 0===n||null===(i=n.treePruningBookingDetail)||void 0===i?void 0:i.bookingNo,info:e.isSuccess?e.t("TP_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},pi=["tenantId","payments"],Ei=["tenantId","payments"],fi=e=>{let{stateCode:t,userType:i,tenants:a}=e;const{path:r,url:u}=o.useRouteMatch(),s=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"WT",language:s}),Digit.SessionStorage.set("WT_TENANTS",a),n.useEffect(()=>"employee"===i&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===i?l.createElement(K,{path:r,url:u,userType:i}):l.createElement(T,null)},_i=e=>{let{matchPath:o}=e;const{t:a}=i.useTranslation(),[r,u,s]=Digit.Hooks.useSessionStorage("WT",{});n.useEffect(()=>{s()},[]);const c=[{link:o+"/wt",i18nKey:a("WT_REAQUEST_TANKER")},{link:o+"/wt/status",i18nKey:a("WT_VIEW_APPLICATIONS")}];return l.createElement(t.CitizenHomeCard,{header:a("WATER_TANKER_SERVICE"),links:c,Icon:()=>l.createElement(t.PTIcon,{className:"fill-path-primary-main"})})},gi={ApplicantDetails:t.ApplicantDetails,AddressDetails:t.AddressDetails,WTCreate:()=>{var e,t,n,r,s,d,m,p;const E=a.useQueryClient(),f=o.useRouteMatch(),{t:_}=i.useTranslation(),{pathname:g}=o.useLocation(),S=o.useHistory();let h=[];const[T,b,y]=Digit.Hooks.useSessionStorage("WT_Create",{});function C(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=T.owners||[];n[l]=t,b(u({},T,{[e]:[...n]}))}else if("units"===e){let e=T.units||[];e=t,b(u({},T,{units:e}))}else b(u({},T,{[e]:u({},T[e],t)}));((e,t,n,l)=>{let i,o=g.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=g.slice(0,-3),o=o.split("/").pop(),r=!0):(o=g.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:u={}}=h.find(e=>e.route===o),s=S.push;if(e&&(s=S.replace),n&&(u=l),"request-details"===u){var c,d;const e=null==T||null===(c=T.serviceType)||void 0===c||null===(d=c.serviceType)||void 0===d?void 0:d.code;"MobileToilet"===e?u="toiletRequest-details":"TREE_PRUNING"===e&&(u="treePruningRequest-details")}if(null===u)return s(f.path+"/check");i=isNaN(u.split("/").pop())&&r&&"map"!==u?f.path+"/"+u+"/"+t:f.path+"/"+u,s(i)})(n,l,i,e)}T.serviceType&&0!==Object.keys(T.serviceType).length||!g.includes("employee")||(g.includes("mt")?(console.log("MT Create"),b({serviceType:{serviceType:{code:"MobileToilet",i18nKey:"Mobile Toilet",value:"Mobile Toilet"}}})):g.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"}}})),T&&Object.keys(T).length>0&&window.location.href.includes("/service-type")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(y(),E.invalidateQueries("WT_Create"));const A=()=>{y(),E.invalidateQueries("WT_Create")};c.forEach(e=>{h=h.concat(e.body.filter(e=>!e.hideInCitizen))}),h.indexRoute=g.includes("citizen")?"service-type":"info";const N=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent("WTCheckPage"),D=null===(n=Digit)||void 0===n||null===(r=n.ComponentRegistryService)||void 0===r?void 0:r.getComponent("WTAcknowledgement"),I=null===(s=Digit)||void 0===s||null===(d=s.ComponentRegistryService)||void 0===d?void 0:d.getComponent("MTAcknowledgement"),O=null===(m=Digit)||void 0===m||null===(p=m.ComponentRegistryService)||void 0===p?void 0:p.getComponent("TPAcknowledgement");return l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"flex",width:"100%",gap:"24px"}},!g.includes("/info")&&l.createElement("div",{style:{flex:"0 0 280px",background:"#fff",padding:"20px 0",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",borderRadius:"4px"}},l.createElement(v,{config:h})),l.createElement("div",{style:{flex:"1",overflowY:"auto"}},l.createElement(o.Switch,null,h.map((e,t)=>{const{component:n,texts:i,inputs:a,key:r,additionaFields:u}=e,s="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(o.Route,{path:f.path+"/"+e.route,key:t},l.createElement(s,{config:{texts:i,inputs:a,key:r,additionaFields:u},onSelect:C,t:_,formData:T}))}),l.createElement(o.Route,{path:f.path+"/check"},l.createElement(N,{onSubmit:function(){try{var e,t,n,l,i,o;return"WT"===(null==T||null===(e=T.serviceType)||void 0===e||null===(t=e.serviceType)||void 0===t?void 0:t.code)&&S.push(f.path+"/wt-acknowledgement"),"MobileToilet"===(null==T||null===(n=T.serviceType)||void 0===n||null===(l=n.serviceType)||void 0===l?void 0:l.code)&&S.push(f.path+"/mt-acknowledgement"),"TREE_PRUNING"===(null==T||null===(i=T.serviceType)||void 0===i||null===(o=i.serviceType)||void 0===o?void 0:o.code)&&S.push(f.path+"/tp-acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:T})),l.createElement(o.Route,{path:f.path+"/wt-acknowledgement"},l.createElement(D,{data:T,onSuccess:A})),l.createElement(o.Route,{path:f.path+"/mt-acknowledgement"},l.createElement(I,{data:T,onSuccess:A})),l.createElement(o.Route,{path:f.path+"/tp-acknowledgement"},l.createElement(O,{data:T,onSuccess:A})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:f.path+"/"+h.indexRoute}))))))},InfoPage:e=>{var i,o;let{t:a,onSelect:r,formData:s,config:c}=e;const[d,v]=n.useState(""),[m,p]=n.useState(!1),[E,f]=n.useState(!1),_={MobileToilet:"MT_MODULE",WT:"WT_MODULE",TREE_PRUNING:"TREE_PRUNING"}[null==s||null===(i=s.serviceType)||void 0===i||null===(o=i.serviceType)||void 0===o?void 0:o.code],g=()=>{const e=u({},s.infodetails||{},{existingDataSet:d});r(c.key,u({},s[c.key],e))};return l.createElement(l.Fragment,null,l.createElement(t.Card,{className:"search-form-wrapper",style:{flexDirection:"column",gap:"12px"}},_&&l.createElement(t.CardHeader,null,a(_)),l.createElement("div",null,l.createElement(t.CardText,{className:"primaryColor"},a("SV_DOC_REQ_SCREEN_SUB_HEADER")),l.createElement(t.CardText,{className:"primaryColor"},a("SV_DOC_REQ_SCREEN_TEXT")),l.createElement(t.CardText,{className:"primaryColor"},a("SV_DOC_REQ_SCREEN_SUB_TEXT"))),l.createElement("span",null,l.createElement(t.SubmitBar,{label:a("COMMON_NEXT"),onSubmit:()=>{E?p(!0):g()}}))),m&&l.createElement(N,{t:a,closeModal:()=>p(!1),actionCancelOnSubmit:()=>p(!1),onSubmit:()=>{g(),p(!1)},setExistingDataSet:v}))},RequestDetails:e=>{var i,o,a,r,s,c,d,v;let{t:m,config:p,onSelect:E,formData:f}=e;const _=Digit.UserService.getUser().info;let g={};const[S,h]=n.useState((null==f||null===(i=f.requestDetails)||void 0===i?void 0:i.tankerType)||""),[T,b]=n.useState((null==f||null===(o=f.requestDetails)||void 0===o?void 0:o.tankerQuantity)||""),[y,C]=n.useState((null==f||null===(a=f.requestDetails)||void 0===a?void 0:a.waterQuantity)||""),[A,N]=n.useState((null==f||null===(r=f.requestDetails)||void 0===r?void 0:r.waterType)||""),[D,I]=n.useState((null==f||null===(s=f.requestDetails)||void 0===s?void 0:s.deliveryDate)||""),[O,L]=n.useState((null==f||null===(c=f.requestDetails)||void 0===c?void 0:c.description)||""),[w,R]=n.useState((null==f||null===(d=f.requestDetails)||void 0===d?void 0:d.deliveryTime)||""),[x,P]=n.useState((null==f||null===(v=f.requestDetails)||void 0===v?void 0:v.extraCharge)||!1),M=Digit.ULBService.getStateId(),k={width:"EMPLOYEE"===_.type?"50%":"100%"},{data:F}=Digit.Hooks.useCustomMDMS(M,"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(M,"request-service",[{name:"TankerType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerType}}),{data:U}=Digit.Hooks.useCustomMDMS(M,"request-service",[{name:"TankerQuantity"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerQuantity}}),{data:W}=Digit.Hooks.useCustomMDMS(M,"Request-service",[{name:"WaterType"}],{select:e=>{var t;return null==e||null===(t=e["Request-service"])||void 0===t?void 0:t.WaterType}});let H=[],j=[],z=[],V=[];W&&W.map(e=>{V.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),U&&U.map(e=>{j.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),F&&F.map(e=>{H.push({i18nKey:""+e.capacity,code:""+e.capacity,value:""+e.capacity,vehicleType:e.vehicleType,capacityName:e.capacityName})}),B&&B.map(e=>{z.push({i18nKey:""+e.i18nKey,code:""+e.code,value:""+e.value})});const K=H.map(e=>{if(S.code===e.vehicleType)return{i18nKey:e.capacityName,code:e.code,value:e.capacityName}}).filter(e=>void 0!==e),G=()=>l.createElement("div",{className:"flex items-center"},l.createElement(t.TextInput,{type:"time",value:w,style:k,onChange:e=>R(e.target.value),min:"06:00",max:"23:59"}));return n.useEffect(()=>{!S&&null!=z&&z.length&&h(z[0])},[z]),l.createElement(l.Fragment,null,l.createElement(t.FormStep,{config:p,onSelect:()=>{let e=u({},f.requestDetails,{tankerType:S,deliveryDate:D,tankerQuantity:T,waterType:A,waterQuantity:y,deliveryTime:w,description:O,extraCharge:x});E(p.key,e,!1)},t:m,isDisabled:!(S&&D&&T&&y&&w&&O&&A)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+m("WT_TANKER_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.RadioButtons,{t:m,options:z,style:{display:"flex",flexWrap:"wrap",maxHeight:"30px"},innerStyles:{minWidth:"24%"},optionsKey:"i18nKey",name:"tankerType",value:S,selectedOption:S,onSelect:h,labelKey:"i18nKey",isPTFlow:!0}),l.createElement(t.CardLabel,null,""+m("WT_WATER_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:A,placeholder:m("WT_SELECT_WATER_TYPE"),select:N,option:V,style:k,optionKey:"i18nKey",t:m}),l.createElement(t.CardLabel,null,""+m("WT_WATER_QUANTITY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:y,placeholder:"Select Water Quantity",select:C,option:K,style:k,optionKey:"i18nKey",t:m}),l.createElement(t.CardLabel,null,""+m("WT_TANKER_QUANTITY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:T,placeholder:"Select Tanker Quantity",select:b,option:j,style:k,optionKey:"i18nKey",t:m}),l.createElement(t.CardLabel,null,""+m("WT_DELIVERY_DATE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:m,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",style:k,value:D,onChange:function(e){I(e.target.value)},min:(new Date).toISOString().split("T")[0],rules:{required:m("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||m("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+m("WT_DELIVERY_TIME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(G,null),l.createElement(t.CardLabel,null,""+m("WT_DESCRIPTION")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextArea,u({t:m,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"description",value:O,onChange:function(e){L(e.target.value)},style:k,ValidationRequired:!0},g={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:m("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CheckBox,{label:m("WT_IMMEDIATE"),onChange:()=>{P(!x)},checked:x}))))},WTCheckPage:e=>{var o,a,r,u,s,c,d,v,f,_,g,S;let{onSubmit:h,value:T={}}=e;const{t:b}=i.useTranslation(),{owner:y,requestDetails:C,address:A,serviceType:N,toiletRequestDetails:I,treePruningRequestDetails:O}=T,[L,w]=n.useState(!1),R=null!=C&&C.extraCharge?"YES":"NO";return l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardHeader,null,b("WT_SUMMARY_PAGE")),l.createElement("div",null,l.createElement(t.CardSubHeader,null,b("ES_TITILE_OWNER_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:b("COMMON_APPLICANT_NAME"),text:""+b(m(null==y?void 0:y.applicantName)),actionButton:l.createElement(D,{jumpTo:"/digit-ui/citizen/wt/request-service/applicant-details"})}),l.createElement(t.Row,{label:b("COMMON_MOBILE_NUMBER"),text:""+b(m(null==y?void 0:y.mobileNumber))}),l.createElement(t.Row,{label:b("COMMON_ALT_MOBILE_NUMBER"),text:""+b(m(null==y?void 0:y.alternateNumber))}),l.createElement(t.Row,{label:b("COMMON_EMAIL_ID"),text:""+b(m(null==y?void 0:y.emailId))})),l.createElement(t.CardSubHeader,null,b("ES_TITLE_ADDRESS_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:b("HOUSE_NO"),text:""+b(m(null==A?void 0:A.houseNo)),actionButton:l.createElement(D,{jumpTo:"/digit-ui/citizen/wt/request-service/address-details"})}),l.createElement(t.Row,{label:b("ADDRESS_LINE1"),text:""+b(m(null==A?void 0:A.addressLine1))}),l.createElement(t.Row,{label:b("ADDRESS_LINE2"),text:""+b(m(null==A?void 0:A.addressLine2))}),l.createElement(t.Row,{label:b("CITY"),text:""+b(m(null==A||null===(o=A.city)||void 0===o||null===(a=o.city)||void 0===a?void 0:a.name))}),l.createElement(t.Row,{label:b("LOCALITY"),text:""+b(m(null==A||null===(r=A.locality)||void 0===r?void 0:r.i18nKey))}),l.createElement(t.Row,{label:b("PINCODE"),text:""+b(m(null==A?void 0:A.pincode))}),l.createElement(t.Row,{label:b("LANDMARK"),text:""+b(m(null==A?void 0:A.landmark))}),l.createElement(t.Row,{label:b("STREET_NAME"),text:""+b(m(null==A?void 0:A.streetName))})),"WT"===(null==N||null===(u=N.serviceType)||void 0===u?void 0:u.code)&&l.createElement(n.Fragment,null,l.createElement(t.CardSubHeader,null,b("WT_REQUEST_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:b("WT_TANKER_TYPE"),text:""+b(m(null==C||null===(s=C.tankerType)||void 0===s?void 0:s.value)),actionButton:l.createElement(D,{jumpTo:"/digit-ui/citizen/wt/request-service/request-details"})}),l.createElement(t.Row,{label:b("WT_WATER_TYPE"),text:""+b(m(null==C||null===(c=C.waterType)||void 0===c?void 0:c.code))}),l.createElement(t.Row,{label:b("WT_TANKER_QUANTITY"),text:""+b(m(null==C||null===(d=C.tankerQuantity)||void 0===d?void 0:d.code))}),l.createElement(t.Row,{label:b("WT_WATER_QUANTITY"),text:""+b(m(null==C||null===(v=C.waterQuantity)||void 0===v?void 0:v.value))}),l.createElement(t.Row,{label:b("WT_DELIVERY_DATE"),text:""+b(m(E(null==C?void 0:C.deliveryDate)))}),l.createElement(t.Row,{label:b("WT_DELIVERY_TIME"),text:""+m(p(null==C?void 0:C.deliveryTime))}),l.createElement(t.Row,{label:b("WT_DESCRIPTION"),text:""+b(m(null==C?void 0:C.description))}),l.createElement(t.Row,{label:b("WT_IMMEDIATE"),text:""+b(m(R))}))),"MobileToilet"===(null==N||null===(f=N.serviceType)||void 0===f?void 0:f.code)&&l.createElement(n.Fragment,null,l.createElement(t.CardSubHeader,null,b("ES_REQUEST_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:b("MT_NUMBER_OF_MOBILE_TOILETS"),text:""+b(m(null==I||null===(_=I.mobileToilet)||void 0===_?void 0:_.code)),actionButton:l.createElement(D,{jumpTo:"/digit-ui/citizen/wt/request-service/toiletRequest-details"})}),l.createElement(t.Row,{label:b("MT_DELIVERY_FROM_DATE"),text:""+b(m(E(null==I?void 0:I.deliveryfromDate)))}),l.createElement(t.Row,{label:b("MT_DELIVERY_TO_DATE"),text:""+b(E(m(null==I?void 0:I.deliverytoDate)))}),l.createElement(t.Row,{label:b("MT_REQUIREMNENT_FROM_TIME"),text:m(p(null==I?void 0:I.deliveryfromTime))}),l.createElement(t.Row,{label:b("MT_REQUIREMNENT_TO_TIME"),text:m(p(null==I?void 0:I.deliverytoTime))}),l.createElement(t.Row,{label:b("MT_SPECIAL_REQUEST"),text:""+b(m(null==I?void 0:I.specialRequest))}))),"TREE_PRUNING"===(null==N||null===(g=N.serviceType)||void 0===g?void 0:g.code)&&l.createElement(n.Fragment,null,l.createElement(t.CardSubHeader,null,b("TP_REQUEST_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:b("REASON_FOR_PRUNING"),text:""+b(m(null==O||null===(S=O.reasonOfPruning)||void 0===S?void 0:S.code)),actionButton:l.createElement(D,{jumpTo:"/digit-ui/citizen/wt/request-service/treePruningRequest-details"})}),l.createElement(t.Row,{label:b("LOCATION_GEOTAG"),text:""+b(m(null==O?void 0:O.geoTagLocation))}),l.createElement(t.Row,{label:b("UPLOAD_THE_SITE_PHOTOGRAPH"),text:l.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>{Digit.UploadServices.Filefetch([null==O?void 0:O.supportingDocumentFile],Digit.ULBService.getStateId()).then(e=>{var t,n,l;const i=null==e||null===(t=e.data)||void 0===t||null===(n=t.fileStoreIds)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.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)})}},l.createElement(t.GenericFileIcon,null))}))),l.createElement(t.CheckBox,{label:b("FINAL_DECLARATION_MESSAGE"),onChange:()=>{w(!L)},styles:{height:"auto",marginBottom:"30px",marginTop:"10px"}})),l.createElement(t.SubmitBar,{label:b("COMMON_BUTTON_SUBMIT"),onSubmit:h,disabled:!L})))},WTAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:s}=i.useTranslation(),c=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),d=Digit.Hooks.wt.useTankerCreateAPI(c),v=Digit.UserService.getUser().info,{data:m}=Digit.Hooks.useStore.getInitData(),{tenants:p}=m||{};return n.useEffect(()=>{try{a.tenantId=c;let e=(e=>{var t,n,l,i,o,a,r,u,s,c,d,v,m,p,E,f,_,g,S,h,T,b,y,C,A,N,D,I,O,L,w,R,x,P,M;return{waterTankerBookingDetail:{tenantId:null==e?void 0:e.tenantId,tankerType:null==e||null===(t=e.requestDetails)||void 0===t||null===(n=t.tankerType)||void 0===n?void 0:n.code,waterType:null==e||null===(l=e.requestDetails)||void 0===l||null===(i=l.waterType)||void 0===i?void 0:i.code,tankerQuantity:null==e||null===(o=e.requestDetails)||void 0===o||null===(a=o.tankerQuantity)||void 0===a?void 0:a.code,waterQuantity:null==e||null===(r=e.requestDetails)||void 0===r||null===(u=r.waterQuantity)||void 0===u?void 0:u.code,description:null==e||null===(s=e.requestDetails)||void 0===s?void 0:s.description,deliveryDate:null==e||null===(c=e.requestDetails)||void 0===c?void 0:c.deliveryDate,deliveryTime:null==e||null===(d=e.requestDetails)||void 0===d?void 0:d.deliveryTime,extraCharge:null!=e&&null!==(v=e.requestDetails)&&void 0!==v&&v.extraCharge?"Y":"N",addressDetailId:(null==e||null===(m=e.address)||void 0===m?void 0:m.addressDetailId)||"",applicantDetail:{name:null==e||null===(p=e.owner)||void 0===p?void 0:p.applicantName,mobileNumber:null==e||null===(E=e.owner)||void 0===E?void 0:E.mobileNumber,alternateNumber:null==e||null===(f=e.owner)||void 0===f?void 0:f.alternateNumber,emailId:null==e||null===(_=e.owner)||void 0===_?void 0:_.emailId},address:{addressType:null==e||null===(g=e.address)||void 0===g||null===(S=g.addressType)||void 0===S?void 0:S.code,pincode:null==e||null===(h=e.address)||void 0===h?void 0:h.pincode,city:null==e||null===(T=e.address)||void 0===T||null===(b=T.city)||void 0===b||null===(y=b.city)||void 0===y?void 0:y.name,cityCode:null==e||null===(C=e.address)||void 0===C||null===(A=C.city)||void 0===A||null===(N=A.city)||void 0===N?void 0:N.code,addressLine1:null==e||null===(D=e.address)||void 0===D?void 0:D.addressLine1,addressLine2:null==e||null===(I=e.address)||void 0===I?void 0:I.addressLine2,locality:null==e||null===(O=e.address)||void 0===O||null===(L=O.locality)||void 0===L?void 0:L.i18nKey,localityCode:null==e||null===(w=e.address)||void 0===w||null===(R=w.locality)||void 0===R?void 0:R.code,streetName:null==e||null===(x=e.address)||void 0===x?void 0:x.streetName,houseNo:null==e||null===(P=e.address)||void 0===P?void 0:P.houseNo,landmark:null==e||null===(M=e.address)||void 0===M?void 0:M.landmark},bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"watertanker",moduleName:"request-service.water_tanker"}}}})(a);d.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),d.isLoading||d.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(R,{t:s,data:d.data,isSuccess:d.isSuccess,isLoading:d.isIdle||d.isLoading}),l.createElement(t.StatusTable,null,d.isSuccess&&l.createElement(t.Row,{rowContainerStyle:w,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),d.isSuccess&&l.createElement(t.SubmitBar,{label:s("WT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=d.data)||void 0===e?void 0:e.waterTankerBookingDetail;const n=p.find(e=>e.code===t.tenantId);return Promise.resolve(O(u({},t),n,s)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},l.createElement(t.LinkButton,{label:s("CORE_COMMON_GO_TO_HOME")})))},WTApplicationDetails:()=>{var e,a,r,c,d,v,m,f,_,g,S,h,T;const{t:b}=i.useTranslation(),{acknowledgementIds:y,tenantId:C}=o.useParams(),[A,N]=n.useState(!1),[D,I]=n.useState(null),{data:L}=Digit.Hooks.useStore.getInitData(),{tenants:w}=L||{},{isLoading:R,data:x,refetch:P}=Digit.Hooks.wt.useTankerSearchAPI({tenantId:C,filters:{bookingNo:y}}),M=Ve(x,"waterTankerBookingDetail",[]);Ve(x,"waterTankerBookingDetail[0].bookingNo",[]);let k=M&&M.length>0&&M[0]||{};const F=k;sessionStorage.setItem("wt",JSON.stringify(F));let B="N"===(null==k?void 0:k.extraCharge)?"No":"Yes";const U=Digit.Hooks.wt.useTankerCreateAPI(C,!1),{data:W,isLoading:H}=Digit.Hooks.useRecieptSearch({tenantId:C,businessService:"request-service.water_tanker",consumerCodes:y,isEmployee:!1},{enabled:!!y});let j=[];j.push({label:b("WT_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>z()});const z=function(){try{const e=F||{},t=w.find(t=>t.code===e.tenantId);return Promise.resolve(O(u({},e),t,b)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return R?l.createElement(t.Loader,null):(W&&(null==W?void 0:W.Payments.length)>0&&0==H&&j.push({label:b("WT_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;s(e,Ye);try{function l(){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 l={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},n)]},"request-service.water_tanker-receipt")).then(function(t){var n;l=t;const o=u({},e,{paymentReceiptFilestoreId:null===(n=l)||void 0===n?void 0:n.filestoreIds[0]});return Promise.resolve(U.mutateAsync({waterTankerBookingDetail:o})).then(function(){var e;i=null===(e=l)||void 0===e?void 0:e.filestoreIds[0],P()})})}}();return Promise.resolve(o&&o.then?o.then(l):l())}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]})}}),l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},b("WT_BOOKING_DETAILS")),j&&j.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>N(!A),displayOptions:A,options:j})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:b("WT_BOOKING_NO"),text:null==k?void 0:k.bookingNo})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("WT_APPLICANT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:b("WT_APPLICANT_NAME"),text:(null==k||null===(e=k.applicantDetail)||void 0===e?void 0:e.name)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_MOBILE_NUMBER"),text:(null==k||null===(a=k.applicantDetail)||void 0===a?void 0:a.mobileNumber)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_ALT_MOBILE_NUMBER"),text:(null==k||null===(r=k.applicantDetail)||void 0===r?void 0:r.alternateNumber)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_EMAIL_ID"),text:(null==k||null===(c=k.applicantDetail)||void 0===c?void 0:c.emailId)||b("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("WT_ADDRESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:b("WT_PINCODE"),text:(null==k||null===(d=k.address)||void 0===d?void 0:d.pincode)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_CITY"),text:(null==k||null===(v=k.address)||void 0===v?void 0:v.city)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_LOCALITY"),text:(null==k||null===(m=k.address)||void 0===m?void 0:m.locality)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_STREET_NAME"),text:(null==k||null===(f=k.address)||void 0===f?void 0:f.streetName)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_DOOR_NO"),text:(null==k||null===(_=k.address)||void 0===_?void 0:_.doorNo)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_HOUSE_NO"),text:(null==k||null===(g=k.address)||void 0===g?void 0:g.houseNo)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_ADDRESS_LINE1"),text:(null==k||null===(S=k.address)||void 0===S?void 0:S.addressLine1)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_ADDRESS_LINE2"),text:(null==k||null===(h=k.address)||void 0===h?void 0:h.addressLine2)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_LANDMARK"),text:(null==k||null===(T=k.address)||void 0===T?void 0:T.landmark)||b("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ES_REQUEST_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:b("WT_TANKER_TYPE"),text:(null==k?void 0:k.tankerType)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_WATER_TYPE"),text:b(null==k?void 0:k.waterType)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_TANKER_QUANTITY"),text:(null==k?void 0:k.tankerQuantity)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_WATER_QUANTITY"),text:(null==k?void 0:k.waterQuantity)+" Ltr"||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_DELIVERY_DATE"),text:E(null==k?void 0:k.deliveryDate)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_DELIVERY_TIME"),text:p(null==k?void 0:k.deliveryTime)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_DESCRIPTION"),text:(null==k?void 0:k.description)||b("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:b("WT_IMMEDIATE"),text:B||b("CS_NA")})),l.createElement(qe,{application:F,id:null==F?void 0:F.bookingNo,userType:"citizen"}),D&&l.createElement(t.Toast,{error:D.key,label:b(D.label),style:{bottom:"0px"},onClose:()=>{I(null)}})))))},MTApplicationDetails:()=>{var e,a,r,c,d,v,m,f,_,g,S,h;const{t:T}=i.useTranslation(),{acknowledgementIds:b,tenantId:y}=o.useParams(),[C,A]=n.useState(!1),[N,D]=n.useState(null),{data:I}=Digit.Hooks.useStore.getInitData(),{tenants:O}=I||{},{isLoading:L,data:w,refetch:R}=Digit.Hooks.wt.useMobileToiletSearchAPI({tenantId:y,filters:{bookingNo:b}}),x=Ve(w,"mobileToiletBookingDetails",[]);Ve(w,"mobileToiletBookingDetails[0].bookingNo",[]);let P=x&&x.length>0&&x[0]||{};const M=P;sessionStorage.setItem("mt",JSON.stringify(M));const k=Digit.Hooks.wt.useMobileToiletCreateAPI(y,!1),{data:F,isLoading:B}=Digit.Hooks.useRecieptSearch({tenantId:y,businessService:"request-service.mobile_toilet",consumerCodes:b,isEmployee:!1},{enabled:!!b});let U=[];if(U.push({label:T("MT_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>W()}),L)return l.createElement(t.Loader,null);F&&(null==F?void 0:F.Payments.length)>0&&0==B&&U.push({label:T("MT_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;s(e,pi);try{function l(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:i})).then(function(e){window.open(e[i],"_blank")})}let e=x[0]||{},i=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!i){let l={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},n)]},"request-service.mobile_toilet-receipt")).then(function(t){var n;l=t;const o=u({},e,{paymentReceiptFilestoreId:null===(n=l)||void 0===n?void 0:n.filestoreIds[0]});return Promise.resolve(k.mutateAsync({mobileToiletBookingDetail:o})).then(function(){var e;i=null===(e=l)||void 0===e?void 0:e.filestoreIds[0],R()})})}}();return Promise.resolve(o&&o.then?o.then(l):l())}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]})}});const W=function(){try{const e=M||{},t=O.find(t=>t.code===e.tenantId);return Promise.resolve(oi(u({},e),t,T)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},T("MT_BOOKING_DETAILS")),U.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>A(!C),displayOptions:C,options:U})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:T("MT_BOOKING_NO"),text:null==P?void 0:P.bookingNo})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},T("MT_APPLICANT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:T("MT_APPLICANT_NAME"),text:(null==P||null===(e=P.applicantDetail)||void 0===e?void 0:e.name)||T("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:T("MT_MOBILE_NUMBER"),text:(null==P||null===(a=P.applicantDetail)||void 0===a?void 0:a.mobileNumber)||T("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:T("MT_ALT_MOBILE_NUMBER"),text:(null==P||null===(r=P.applicantDetail)||void 0===r?void 0:r.alternateNumber)||T("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:T("MT_EMAIL_ID"),text:(null==P||null===(c=P.applicantDetail)||void 0===c?void 0:c.emailId)||T("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},T("ES_TITLE_ADDRESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:T("PINCODE"),text:(null==P||null===(d=P.address)||void 0===d?void 0:d.pincode)||T("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:T("CITY"),text:(null==P||null===(v=P.address)||void 0===v?void 0:v.city)||T("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:T("LOCALITY"),text:(null==P||null===(m=P.address)||void 0===m?void 0:m.locality)||T("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:T("STREET_NAME"),text:(null==P||null===(f=P.address)||void 0===f?void 0:f.streetName)||T("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:T("HOUSE_NO"),text:(null==P||null===(_=P.address)||void 0===_?void 0:_.houseNo)||T("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:T("ADDRESS_LINE1"),text:(null==P||null===(g=P.address)||void 0===g?void 0:g.addressLine1)||T("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:T("ADDRESS_LINE2"),text:(null==P||null===(S=P.address)||void 0===S?void 0:S.addressLine2)||T("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:T("LANDMARK"),text:(null==P||null===(h=P.address)||void 0===h?void 0:h.landmark)||T("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},T("ES_REQUEST_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:T("MT_NUMBER_OF_MOBILE_TOILETS"),text:(null==P?void 0:P.noOfMobileToilet)||T("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:T("MT_DELIVERY_FROM_DATE"),text:E(null==P?void 0:P.deliveryFromDate)||T("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:T("MT_DELIVERY_TO_DATE"),text:E(null==P?void 0:P.deliveryToDate)||T("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:T("MT_REQUIREMNENT_FROM_TIME"),text:p(null==P?void 0:P.deliveryFromTime)||T("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:T("MT_REQUIREMNENT_TO_TIME"),text:p(null==P?void 0:P.deliveryToTime)||T("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:T("MT_SPECIAL_REQUEST"),text:(null==P?void 0:P.description)||T("CS_NA")})),l.createElement(qe,{application:M,id:null==M?void 0:M.bookingNo,userType:"citizen"}),N&&l.createElement(t.Toast,{error:N.key,label:T(N.label),style:{bottom:"0px"},onClose:()=>{D(null)}}))))},TPApplicationDetails:()=>{var e,a,r,c,d,v,m,p,E,f,_,g;const{t:S}=i.useTranslation(),{acknowledgementIds:h,tenantId:T}=o.useParams(),[b,y]=n.useState(!1),[C,A]=n.useState(null),{data:N}=Digit.Hooks.useStore.getInitData(),{tenants:D}=N||{},{isLoading:I,data:O,refetch:L}=Digit.Hooks.wt.useTreePruningSearchAPI({tenantId:T,filters:{bookingNo:h}}),w=Ve(O,"treePruningBookingDetails",[]);Ve(O,"treePruningBookingDetails[0].bookingNo",[]);let R=w&&w.length>0&&w[0]||{};console.log("tp_details",R);const x=R;sessionStorage.setItem("tp",JSON.stringify(x));const P=Digit.Hooks.wt.useTreePruningCreateAPI(T,!1),{data:M,isLoading:k}=Digit.Hooks.useRecieptSearch({tenantId:T,businessService:"request-service.tree_pruning",consumerCodes:h,isEmployee:!1},{enabled:!!h});let F=[];if(F.push({label:S("TP_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>B()}),I)return l.createElement(t.Loader,null);M&&(null==M?void 0:M.Payments.length)>0&&0==k&&F.push({label:S("TP_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;s(e,Ei);try{function l(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:i})).then(function(e){window.open(e[i],"_blank")})}let e=w[0]||{},i=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!i){let l={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},n)]},"request-service.tree_pruning-receipt")).then(function(t){var n;l=t;const o=u({},e,{paymentReceiptFilestoreId:null===(n=l)||void 0===n?void 0:n.filestoreIds[0]});return Promise.resolve(P.mutateAsync({treePruningBookingDetail:o})).then(function(){var e;i=null===(e=l)||void 0===e?void 0:e.filestoreIds[0],L()})})}}();return Promise.resolve(o&&o.then?o.then(l):l())}catch(e){return Promise.reject(e)}}({tenantId:null==M||null===(e=M.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==M?void 0:M.Payments[0]})}});const B=function(){try{const e=x||{},t=D.find(t=>t.code===e.tenantId);return Promise.resolve(ci(u({},e),t,S)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},S("TP_BOOKING_DETAILS")),F.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>y(!b),displayOptions:b,options:F})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:S("WT_BOOKING_NO"),text:null==R?void 0:R.bookingNo})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},S("TP_APPLICANT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:S("WT_APPLICANT_NAME"),text:(null==R||null===(e=R.applicantDetail)||void 0===e?void 0:e.name)||S("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:S("WT_MOBILE_NUMBER"),text:(null==R||null===(a=R.applicantDetail)||void 0===a?void 0:a.mobileNumber)||S("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:S("WT_ALT_MOBILE_NUMBER"),text:(null==R||null===(r=R.applicantDetail)||void 0===r?void 0:r.alternateNumber)||S("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:S("WT_EMAIL_ID"),text:(null==R||null===(c=R.applicantDetail)||void 0===c?void 0:c.emailId)||S("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},S("ES_TITLE_ADDRESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:S("PINCODE"),text:(null==R||null===(d=R.address)||void 0===d?void 0:d.pincode)||S("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:S("CITY"),text:(null==R||null===(v=R.address)||void 0===v?void 0:v.city)||S("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:S("LOCALITY"),text:(null==R||null===(m=R.address)||void 0===m?void 0:m.locality)||S("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:S("STREET_NAME"),text:(null==R||null===(p=R.address)||void 0===p?void 0:p.streetName)||S("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:S("HOUSE_NO"),text:(null==R||null===(E=R.address)||void 0===E?void 0:E.houseNo)||S("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:S("ADDRESS_LINE1"),text:(null==R||null===(f=R.address)||void 0===f?void 0:f.addressLine1)||S("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:S("ADDRESS_LINE2"),text:(null==R||null===(_=R.address)||void 0===_?void 0:_.addressLine2)||S("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:S("LANDMARK"),text:(null==R||null===(g=R.address)||void 0===g?void 0:g.landmark)||S("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},S("TP_REQUEST_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:S("REASON_FOR_PRUNING"),text:S(null==R?void 0:R.reasonForPruning)||S("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:S("LATITUDE_GEOTAG"),text:(null==R?void 0:R.latitude)||S("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:S("LONGITUDE_GEOTAG"),text:(null==R?void 0:R.longitude)||S("CS_NA")})),l.createElement(qe,{application:x,id:null==x?void 0:x.bookingNo,userType:"citizen"}),C&&l.createElement(t.Toast,{error:C.key,label:S(C.label),style:{bottom:"0px"},onClose:()=>{A(null)}}))))},WTMyApplications:()=>{const{t:e}=i.useTranslation(),a=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),r=Digit.UserService.getUser().info,[s,c]=n.useState(""),[d,v]=n.useState(null),[m,p]=n.useState(null),[E,f]=n.useState("watertanker"),[_,g]=n.useState("watertanker");let S,h,T=window.location.href.split("/").pop();isNaN(parseInt(T))?S=4:(h=T,S=parseInt(T)+50);let b=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};n.useEffect(()=>{p(b)},[T]);const{isLoading:y,data:C}=Digit.Hooks.wt.useTankerSearchAPI({filters:m},{enabled:!!m&&"watertanker"===E}),{isLoading:A,data:N}=Digit.Hooks.wt.useMobileToiletSearchAPI({filters:m},{enabled:!!m&&"mobileToilet"===E}),{isLoading:D,data:I}=Digit.Hooks.wt.useTreePruningSearchAPI({filters:m},{enabled:!!m&&"treePruning"===E});let O=!1,L=[];if("watertanker"===E?(O=y,L=(null==C?void 0:C.waterTankerBookingDetail)||[]):"mobileToilet"===E?(O=A,L=(null==N?void 0:N.mobileToiletBookingDetails)||[]):"treePruning"===E?(O=D,L=null==I?void 0:I.treePruningBookingDetails):(O=y||A||D,L=[...(null==N?void 0:N.mobileToiletBookingDetails)||[],...(null==C?void 0:C.waterTankerBookingDetail)||[],...(null==I?void 0:I.treePruningBookingDetails)||[]]),O)return l.createElement(t.Loader,null);const w=[{label:e("MOBILE_TOILET"),code:"mobileToilet"},{label:e("WATER_TANKER"),code:"watertanker"},{label:e("TREE_PRUNING"),code:"treePruning"}],R=[{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")}],x=[{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 l.createElement(l.Fragment,null,l.createElement(t.Header,null,e("MY_BOOKINGS")+" ("+L.length+")"),l.createElement(t.Card,null,l.createElement("div",{style:{marginLeft:"16px"}},l.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"16px"}},l.createElement("div",{style:{flex:1}},l.createElement(t.CardLabel,null,e("SERVICE_TYPE")),l.createElement(t.Dropdown,{selected:w.find(e=>e.code===_),select:e=>{g(e.code),v("")},option:w,placeholder:e("Select Service Type"),optionKey:"label",t:e})),l.createElement("div",{style:{flex:1}},l.createElement(t.CardLabel,null,e("BOOKING_NO")),l.createElement(t.TextInput,{placeholder:e("Enter Booking No."),value:s,onChange:e=>c(e.target.value)})),l.createElement("div",{style:{flex:1}},l.createElement("div",{style:{display:"flex",flexDirection:"column"}},l.createElement(t.CardLabel,null,e("PT_COMMON_TABLE_COL_STATUS_LABEL")),l.createElement(t.Dropdown,{className:"form-field",selected:d,select:v,option:"treePruning"===_?x:R,placeholder:e("Select Status"),optionKey:"value",style:{width:"100%"},t:e}))),l.createElement("div",null,l.createElement("div",{style:{marginTop:"17%"}},l.createElement(t.SubmitBar,{label:e("ES_COMMON_SEARCH"),onSubmit:()=>{f(_);const e=s.trim(),t=u({},b,{bookingNo:e||void 0,status:(null==d?void 0:d.code)||void 0});p(t)}}),l.createElement("p",{className:"link",style:{marginLeft:"30%",marginTop:"10px",display:"block"},onClick:()=>{c(""),v("")}},e("ES_COMMON_CLEAR_ALL"))))),l.createElement(o.Link,{to:"request-service/service-type"},l.createElement(t.SubmitBar,{style:{borderRadius:"30px",width:"20%"},label:e("NEW_REQUEST")+" +"})))),l.createElement("div",null,L.length>0&&L.map((t,n)=>l.createElement("div",{key:n},l.createElement(G,{application:t,tenantId:a,buttonLabel:e("SUMMARY")}))),0===L.length&&!O&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("NO_APPLICATION_FOUND_MSG")),0!==L.length&&((null==N?void 0:N.count)||0)+((null==C?void 0:C.count)||0)+((null==I?void 0:I.count)||0)>S&&l.createElement("div",null,l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},l.createElement("span",{className:"link"},l.createElement(o.Link,{to:"/digit-ui/citizen/wt/status/"+S},e("LOAD_MORE_MSG")))))))},ApplicationDetails:ei,WFApplicationTimeline:qe,WFCaption:Ge,WTEmpInbox:V,WTCitizenCard:()=>{const{t:e}=i.useTranslation(),[o,a]=n.useState("-"),r=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),{data:u,isFetching:s,isSuccess:c}=Digit.Hooks.useNewInboxGeneral({tenantId:r,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()}});n.useEffect(()=>{!s&&c&&a(u)},[s]);const d=[{label:e("ES_COMMON_INBOX"),link:"/digit-ui/citizen/wt/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/citizen/wt/my-bookings"}],v={Icon:l.createElement(t.CHBIcon,null),moduleName:e("WT_MODULE_NAME"),kpis:[{count:null==o?void 0:o.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/wt/inbox"}],links:d};return l.createElement(t.EmployeeModuleCard,v)},ServiceTypes:e=>{var i;let{t:o,config:a,onSelect:r,userType:s,formData:c}=e;const d=Digit.ULBService.getStateId(),{data:v}=Digit.Hooks.useCustomMDMS(d,"request-service",[{name:"ServiceType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.ServiceType}}),[m,p]=(Digit.UserService.getUser(),n.useState((null==c||null===(i=c.serviceType)||void 0===i?void 0:i.serviceType)||"")),E=n.useCallback(()=>{let e=u({},c.serviceType,{serviceType:m});r(a.key,e,!1)},[c.serviceType,m,r,a.key]);return n.useEffect(()=>{"citizen"===s&&(console.log("calling meeeeeee"),E())},[m,s,E]),l.createElement(t.Modal,{headerBarMain:l.createElement(li,{t:o}),headerBarEnd:l.createElement(ni,{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"},l.createElement(l.Fragment,null,l.createElement(t.FormStep,{config:a,onSelect:E,t:o,isDisabled:!m},l.createElement("div",null,l.createElement(t.CardLabel,null,""+o("REQUEST_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:m,placeholder:"Select Service Type",select:p,option:v,optionKey:"i18nKey",t:o})))))},ToiletRequestDetails:e=>{var i,o,a,r,s,c;let{t:d,config:v,onSelect:m,userType:p,formData:E}=e;const f=Digit.UserService.getUser().info,[_,g]=n.useState((null==E||null===(i=E.toiletRequestDetails)||void 0===i?void 0:i.mobileToilet)||""),[S,h]=n.useState((null==E||null===(o=E.toiletRequestDetails)||void 0===o?void 0:o.deliveryfromTime)||""),[T,b]=n.useState((null==E||null===(a=E.toiletRequestDetails)||void 0===a?void 0:a.deliverytoTime)||""),[y,C]=n.useState((null==E||null===(r=E.toiletRequestDetails)||void 0===r?void 0:r.deliveryfromDate)||""),[A,N]=n.useState((null==E||null===(s=E.toiletRequestDetails)||void 0===s?void 0:s.deliverytoDate)||""),[D,I]=n.useState((null==E||null===(c=E.toiletRequestDetails)||void 0===c?void 0:c.specialRequest)||""),O=Digit.ULBService.getStateId(),L={width:"EMPLOYEE"===f.type?"52%":"100%"},{data:w}=Digit.Hooks.useCustomMDMS(O,"request-service",[{name:"NoOfMobileToilet"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.NoOfMobileToilet}});let R=[];w&&w.map(e=>{R.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})});const x=()=>l.createElement("div",{className:"flex items-center"},l.createElement(t.TextInput,{type:"time",value:S,style:L,onChange:e=>h(e.target.value),min:"06:00",max:"23:59"})),P=()=>l.createElement("div",{className:"flex items-center"},l.createElement(t.TextInput,{type:"time",value:T,style:L,onChange:e=>b(e.target.value),min:"06:00",max:"23:59"})),M=()=>{let e=u({},E.toiletRequestDetails,{mobileToilet:_,deliveryfromTime:S,deliverytoTime:T,deliveryfromDate:y,deliverytoDate:A,specialRequest:D});m(v.key,e,!1)};return n.useEffect(()=>{"citizen"===p&&M()},[_,S,T,y,A,D]),l.createElement(l.Fragment,null,l.createElement(t.FormStep,{config:v,onSelect:M,t:d,isDisabled:!(_&&S&&T&&y&&A&&D)},l.createElement("div",null,l.createElement(t.CardLabel,null,d("MT_NUMBER_OF_MOBILE_TOILETS")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:_,placeholder:"Select Number of Mobile Toilets",select:g,option:R,style:L,optionKey:"i18nKey",t:d}),l.createElement(t.CardLabel,null,""+d("MT_DELIVERY_FROM_DATE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:d,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",style:L,value:y,onChange:function(e){C(e.target.value)},min:(new Date).toISOString().split("T")[0],rules:{required:d("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||d("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+d("MT_DELIVERY_TO_DATE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:d,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",value:A,style:L,onChange:function(e){N(e.target.value)},min:y,rules:{required:d("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||d("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+d("MT_REQUIREMNENT_FROM_TIME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(x,null),l.createElement(t.CardLabel,null,""+d("MT_REQUIREMNENT_TO_TIME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(P,null),l.createElement(t.CardLabel,null,""+d("MT_SPECIAL_REQUEST")," ",l.createElement("span",{className:"check-page-link-button"})),l.createElement(t.TextArea,{t:d,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"mobileToilet",style:L,placeholder:"Special Request",value:D,onChange:function(e){I(e.target.value)},style:{width:"EMPLOYEE"===f.type?"51.6%":null}}))))},TreePruningRequestDetails:e=>{var i,o,a;let{t:r,config:s,onSelect:c,userType:d,formData:v}=e;const m=Digit.UserService.getUser().info,[p,E]=n.useState((null==v||null===(i=v.treePruningRequestDetails)||void 0===i?void 0:i.reasonOfPruning)||""),[f,_]=n.useState(""),[g,S]=n.useState(""),[h,T]=n.useState((null==v||null===(o=v.treePruningRequestDetails)||void 0===o?void 0:o.geoTagLocation)||""),[b,y]=n.useState((null==v||null===(a=v.treePruningRequestDetails)||void 0===a?void 0:a.supportingDocumentFile)||""),[C,A]=n.useState(!1),[N,D]=n.useState(""),I=Digit.ULBService.getStateId(),O={width:"EMPLOYEE"===m.type?"50%":"100%"},{data:L}=Digit.Hooks.useCustomMDMS(I,"request-service",[{name:"ReasonPruningType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.ReasonPruningType}}),w=()=>{let e=u({},v.treePruningRequestDetails,{reasonOfPruning:p,geoTagLocation:h,supportingDocumentFile:b,latitude:f,longitude:g});c(s.key,e,!1)};n.useEffect(()=>{"citizen"===d&&w()},[p,h,b,C]);const R=()=>l.createElement("div",{className:"loading-spinner"});return l.createElement(t.FormStep,{config:s,onSelect:w,t:r,isDisabled:!p||!b},l.createElement("div",null,l.createElement(t.CardLabel,null,r("REASON_FOR_PRUNING")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:p,placeholder:"Select Reason",select:E,option:L,style:O,optionKey:"code",t:r}),l.createElement(t.CardLabel,null,r("LOCATION_GEOTAG")),l.createElement("div",{style:{display:"flex",alignItems:"stretch",gap:"8px",width:"EMPLOYEE"===m.type?"53%":"100%"}},l.createElement(t.TextInput,{t:r,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"geoTagLocation",value:h,placeholder:"Select Location",onChange:e=>{const{name:t,value:n}=e.target?e.target:{name:e.name,value:e};"reasonOfPruning"===t?E(n):"geoTagLocation"===t||"location"===t?T(n):"supportingDocumentFile"===t&&y(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"}),l.createElement("div",{className:"butt-icon",onClick:()=>{"geolocation"in navigator?navigator.geolocation.getCurrentPosition(e=>{const{latitude:t,longitude:n}=e.coords;T(t+", "+n),_(t),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"}},l.createElement(t.LocationIcon,{className:"fill-path-primary-main"}))),l.createElement(t.CardLabel,null,r("UPLOAD_THE_SITE_PHOTOGRAPH")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement("div",{style:u({marginBottom:"16px"},O)},l.createElement(t.UploadFile,{id:"supportingDocument",onUpload:e=>((e,t)=>{const n=e.target.files[0];n.size>=5242880?(setError("supportingDocument",{message:r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")}),t(null)):(A(!0),Digit.UploadServices.Filestorage("TP",n,Digit.ULBService.getStateId()).then(e=>{var n,l;(null==e||null===(n=e.data)||void 0===n||null===(l=n.files)||void 0===l?void 0:l.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(()=>A(!1)))})(e,y),onDelete:()=>{y(null)},message:C?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(R,null),l.createElement("span",null,"Uploading...")):b?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},accept:"image/*, .pdf, .png, .jpeg, .jpg",buttonType:"button",error:N||!b}))))},MTAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:s}=i.useTranslation(),c=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),d=Digit.Hooks.wt.useMobileToiletCreateAPI(c),v=Digit.UserService.getUser().info,{data:m}=Digit.Hooks.useStore.getInitData(),{tenants:p}=m||{};return n.useEffect(()=>{try{a.tenantId=c;let e=(e=>{var t,n,l,i,o,a,r,u,s,c,d,v,m,p,E,f,_,g,S,h,T,b,y,C,A,N,D,I,O,L;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===(n=e.toiletRequestDetails)||void 0===n||null===(l=n.mobileToilet)||void 0===l?void 0:l.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===(u=e.address)||void 0===u?void 0:u.addressDetailId)||"",applicantDetail:{name:null==e||null===(s=e.owner)||void 0===s?void 0:s.applicantName,mobileNumber:null==e||null===(c=e.owner)||void 0===c?void 0:c.mobileNumber,alternateNumber:null==e||null===(d=e.owner)||void 0===d?void 0:d.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===(_=f.city)||void 0===_||null===(g=_.city)||void 0===g?void 0:g.name,cityCode:null==e||null===(S=e.address)||void 0===S||null===(h=S.city)||void 0===h||null===(T=h.city)||void 0===T?void 0:T.code,addressLine1:null==e||null===(b=e.address)||void 0===b?void 0:b.addressLine1,addressLine2:null==e||null===(y=e.address)||void 0===y?void 0:y.addressLine2,locality:null==e||null===(C=e.address)||void 0===C||null===(A=C.locality)||void 0===A?void 0:A.i18nKey,localityCode:null==e||null===(N=e.address)||void 0===N||null===(D=N.locality)||void 0===D?void 0:D.code,streetName:null==e||null===(I=e.address)||void 0===I?void 0:I.streetName,houseNo:null==e||null===(O=e.address)||void 0===O?void 0:O.houseNo,landmark:null==e||null===(L=e.address)||void 0===L?void 0:L.landmark},bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"mobileToilet",moduleName:"request-service.mobile_toilet"}}}})(a);d.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),d.isLoading||d.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(ui,{t:s,data:d.data,isSuccess:d.isSuccess,isLoading:d.isIdle||d.isLoading}),l.createElement(t.StatusTable,null,d.isSuccess&&l.createElement(t.Row,{rowContainerStyle:ri,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),d.isSuccess&&l.createElement(t.SubmitBar,{label:s("MT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=d.data)||void 0===e?void 0:e.mobileToiletBookingDetail;const n=p.find(e=>e.code===t.tenantId);return Promise.resolve(oi(u({},t),n,s)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},l.createElement(t.LinkButton,{label:s("CORE_COMMON_GO_TO_HOME")})))},TPAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:s}=i.useTranslation(),c=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),d=Digit.Hooks.wt.useTreePruningCreateAPI(c),v=Digit.UserService.getUser().info,{data:m}=Digit.Hooks.useStore.getInitData(),{tenants:p}=m||{};return n.useEffect(()=>{try{a.tenantId=c;let e=(e=>{var t,n,l,i,o,a,r,u,s,c,d,v,m,p,E,f,_,g,S,h,T,b,y,C,A,N,D;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===(n=e.treePruningRequestDetails)||void 0===n?void 0:n.longitude,reasonForPruning:null==e||null===(l=e.treePruningRequestDetails)||void 0===l||null===(i=l.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===(u=e.owner)||void 0===u?void 0:u.emailId},documentDetails:[{documentType:"Site Photograph",fileStoreId:null==e||null===(s=e.treePruningRequestDetails)||void 0===s?void 0:s.supportingDocumentFile}],address:{addressType:null==e||null===(c=e.address)||void 0===c||null===(d=c.addressType)||void 0===d?void 0:d.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,cityCode:null==e||null===(f=e.address)||void 0===f||null===(_=f.city)||void 0===_||null===(g=_.city)||void 0===g?void 0:g.code,addressLine1:null==e||null===(S=e.address)||void 0===S?void 0:S.addressLine1,addressLine2:null==e||null===(h=e.address)||void 0===h?void 0:h.addressLine2,locality:null==e||null===(T=e.address)||void 0===T||null===(b=T.locality)||void 0===b?void 0:b.i18nKey,localityCode:null==e||null===(y=e.address)||void 0===y||null===(C=y.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===(N=e.address)||void 0===N?void 0:N.houseNo,landmark:null==e||null===(D=e.address)||void 0===D?void 0:D.landmark},bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"treePruning",moduleName:"request-service.tree_pruning"}}}})(a);d.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),d.isLoading||d.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(mi,{t:s,data:d.data,isSuccess:d.isSuccess,isLoading:d.isIdle||d.isLoading}),l.createElement(t.StatusTable,null,d.isSuccess&&l.createElement(t.Row,{rowContainerStyle:vi,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),d.isSuccess&&l.createElement(t.SubmitBar,{label:s("TP_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=d.data)||void 0===e?void 0:e.treePruningBookingDetail;const n=p.find(e=>e.code===t.tenantId);return Promise.resolve(ci(u({},t),n,s)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},l.createElement(t.LinkButton,{label:s("CORE_COMMON_GO_TO_HOME")})))},MTCitizenCard:()=>{const{t:e}=i.useTranslation(),[o,a]=n.useState("-"),r=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),{data:u,isFetching:s,isSuccess:c}=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()}});n.useEffect(()=>{!s&&c&&a(u)},[s]);const d=[{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:l.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:d};return l.createElement(t.EmployeeModuleCard,v)}};exports.WTComponents={WTCard:()=>{const{t:e}=i.useTranslation(),[o,a]=n.useState("-"),{data:r,isLoading:u,isFetching:s,isSuccess:c}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),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()}});n.useEffect(()=>{!s&&c&&a(r)},[s]);const d=[{count:u?"-":null==o?void 0:o.totalCount,label:e("ES_COMMON_INBOX"),link:"/digit-ui/employee/wt/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"}],v=Digit.UserService.hasAccess(["WT_CEMP"])||!1,m={Icon:l.createElement(t.CHBIcon,null),moduleName:e("WT_MODULE_NAME"),kpis:[{count:null==o?void 0:o.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/wt/inbox"}],links:d.filter(e=>!(null!=e&&e.role)||v)};return l.createElement(t.EmployeeModuleCard,m)},WTModule:fi,MTCard:()=>{const{t:e}=i.useTranslation(),[o,a]=n.useState("-"),{data:r,isLoading:u,isFetching:s,isSuccess:c}=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(n.useEffect(()=>{!s&&c&&a(r)},[s]),!Digit.Utils.mtAccess())return null;const d=[{count:u?"-":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:l.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:d.filter(e=>!(null!=e&&e.role)||v)};return l.createElement(t.EmployeeModuleCard,m)},TPCard:()=>{const{t:e}=i.useTranslation(),[o,a]=n.useState("-"),{data:r,isLoading:u,isFetching:s,isSuccess:c}=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()}});n.useEffect(()=>{!s&&c&&a(r)},[s]);const d=[{count:u?"-":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:l.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:d.filter(e=>!(null!=e&&e.role)||v)};return l.createElement(t.EmployeeModuleCard,m)},WTLinks:_i,WT_INBOX_FILTER:e=>l.createElement($e,e),WTInboxTableConfig:e=>({WT:{inboxColumns:t=>[{Header:e("WT_BOOKING_NO"),Cell:e=>{var n,i,a,r;let{row:u}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:t.parentRoute+"/booking-details/"+(null==u||null===(n=u.original)||void 0===n||null===(i=n.searchData)||void 0===i?void 0:i.bookingNo)},null===(a=u.original)||void 0===a||null===(r=a.searchData)||void 0===r?void 0:r.bookingNo)))},mobileCell:e=>{var t;return Qe(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("WT_APPLICANT_NAME"),Cell:e=>{var t,n,l,i,o;return Xe(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,n;return Qe(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.name)}},{Header:e("WT_MOBILE_NUMBER"),Cell:e=>{var t,n,l,i,o;return Xe(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,n;return Qe(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.mobileNumber)}},{Header:e("LOCALITY"),Cell:t=>{var n,l;let{row:i}=t;return Xe(e(""+(null===(n=i.original)||void 0===n||null===(l=n.searchData)||void 0===l?void 0:l.localityCode)))},mobileCell:t=>{var n;return Qe(e(""+(null==t||null===(n=t.searchData)||void 0===n?void 0:n.localityCode)))}},{Header:e("WT_STATUS"),Cell:t=>{var n,l,i;let{row:o}=t;return Xe(e(""+(null==o||null===(n=o.original)||void 0===n||null===(l=n.workflowData)||void 0===l||null===(i=l.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var n,l;return Qe(e("ES_WT_COMMON_STATUS_"+(null==t||null===(n=t.workflowData)||void 0===n||null===(l=n.state)||void 0===l?void 0:l.applicationStatus)))}}],serviceRequestIdKey:t=>{var n,l;return null==t||null===(n=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===n||null===(l=n.props)||void 0===l?void 0:l.children}},MT:{inboxColumns:t=>[{Header:e("MT_BOOKING_NO"),Cell:e=>{var n,i,a,r;let{row:u}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:t.parentRoute+"/booking-details/"+(null==u||null===(n=u.original)||void 0===n||null===(i=n.searchData)||void 0===i?void 0:i.bookingNo)},null===(a=u.original)||void 0===a||null===(r=a.searchData)||void 0===r?void 0:r.bookingNo)))},mobileCell:e=>{var t;return Qe(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("MT_APPLICANT_NAME"),Cell:e=>{var t,n,l,i,o;return Xe(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,n;return Qe(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.name)}},{Header:e("MT_MOBILE_NUMBER"),Cell:e=>{var t,n,l,i,o;return Xe(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,n;return Qe(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.mobileNumber)}},{Header:e("LOCALITY"),Cell:t=>{var n,l;let{row:i}=t;return Xe(e(""+(null===(n=i.original)||void 0===n||null===(l=n.searchData)||void 0===l?void 0:l.localityCode)))},mobileCell:t=>{var n;return Qe(e(""+(null==t||null===(n=t.searchData)||void 0===n?void 0:n.localityCode)))}},{Header:e("MT_STATUS"),Cell:t=>{var n,l,i;let{row:o}=t;return Xe(e(""+(null==o||null===(n=o.original)||void 0===n||null===(l=n.workflowData)||void 0===l||null===(i=l.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var n,l;return Qe(e("ES_WT_COMMON_STATUS_"+(null==t||null===(n=t.workflowData)||void 0===n||null===(l=n.state)||void 0===l?void 0:l.applicationStatus)))}}],serviceRequestIdKey:t=>{var n,l;return null==t||null===(n=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===n||null===(l=n.props)||void 0===l?void 0:l.children}},TP:{inboxColumns:t=>[{Header:e("MT_BOOKING_NO"),Cell:e=>{var n,i,a,r;let{row:u}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:t.parentRoute+"/booking-details/"+(null==u||null===(n=u.original)||void 0===n||null===(i=n.searchData)||void 0===i?void 0:i.bookingNo)},null===(a=u.original)||void 0===a||null===(r=a.searchData)||void 0===r?void 0:r.bookingNo)))},mobileCell:e=>{var t;return Qe(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("MT_APPLICANT_NAME"),Cell:e=>{var t,n,l,i,o;return Xe(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,n;return Qe(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.name)}},{Header:e("MT_MOBILE_NUMBER"),Cell:e=>{var t,n,l,i,o;return Xe(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,n;return Qe(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.mobileNumber)}},{Header:e("LOCALITY"),Cell:t=>{var n,l;let{row:i}=t;return Xe(e(""+(null===(n=i.original)||void 0===n||null===(l=n.searchData)||void 0===l?void 0:l.localityCode)))},mobileCell:t=>{var n;return Qe(e(""+(null==t||null===(n=t.searchData)||void 0===n?void 0:n.localityCode)))}},{Header:e("MT_STATUS"),Cell:t=>{var n,l,i;let{row:o}=t;return Xe(e(""+(null==o||null===(n=o.original)||void 0===n||null===(l=n.workflowData)||void 0===l||null===(i=l.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var n,l;return Qe(e("ES_WT_COMMON_STATUS_"+(null==t||null===(n=t.workflowData)||void 0===n||null===(l=n.state)||void 0===l?void 0:l.applicationStatus)))}}],serviceRequestIdKey:t=>{var n,l;return null==t||null===(n=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===n||null===(l=n.props)||void 0===l?void 0:l.children}}})},exports.WTLinks=_i,exports.WTModule=fi,exports.initWTComponents=()=>{Object.entries(gi).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|