PageSourceSearch

https://banglalink.net/_next/static/chunks/pages/business/bts-user/location-check-d41b04be9305dade.js

js banglalink.net collected 2026-10-01 12:04:21 UTC 12,180 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6783],{23566:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/business/bts-user/location-check",function(){return l(85021)}])},30555:(e,t,l)=>{"use strict";l.d(t,{BC:()=>s,Bp:()=>d,fu:()=>a,k0:()=>h,sU:()=>i});let r=/^(01)[3456789]\d{8}$/,a=e=>{let t=e.trim();if(!t)return{ok:!1,errorKey:"required"};let l=(e=>{let t=e.replace(/[\s\-()]/g,"").replace(/^\+/,"");return t.startsWith("880")?"0".concat(t.slice(3)):t})(t);return r.test(l)?{ok:!0,identifier:{type:"mobile",value:l}}:{ok:!1,errorKey:"invalidMobile"}},s=(e,t)=>{let l=(null!=t?t:"").toLowerCase().trim().split(/\s+/).filter(Boolean);return l.length?e.filter(e=>{var t;let r=(null!=(t=e.bts_address)?t:"").toLowerCase();return l.every(e=>r.includes(e))}):e},n=[{key:"bts_address",labelKey:"btsAddress"},{key:"bts_code",labelKey:"btsCode"},{key:"district",labelKey:"districtColumn"},{key:"thana",labelKey:"thanaColumn"},{key:"region",labelKey:"region"},{key:"male",labelKey:"male",numeric:!0,group:"groupGender"},{key:"female",labelKey:"female",numeric:!0,group:"groupGender"},{key:"age_18_25",labelKey:"age_18_25",numeric:!0,group:"groupAge"},{key:"age_26_35",labelKey:"age_26_35",numeric:!0,group:"groupAge"},{key:"age_36_45",labelKey:"age_36_45",numeric:!0,group:"groupAge"},{key:"age_45_plus",labelKey:"age_45_plus",numeric:!0,group:"groupAge"},{key:"usage_less_100_tk",labelKey:"usage_less_100_tk",numeric:!0,group:"groupUsage"},{key:"usage_100_300_tk",labelKey:"usage_100_300_tk",numeric:!0,group:"groupUsage"},{key:"usage_more_300_tk",labelKey:"usage_more_300_tk",numeric:!0,group:"groupUsage"},{key:"smartphone",labelKey:"smartphone",numeric:!0,group:"groupProfile"},{key:"postpaid_count",labelKey:"postpaid_count",numeric:!0,group:"groupProfile"},{key:"total_sub",labelKey:"subscribersCount",numeric:!0}
1],o={groupGender:{label:"#1D4ED8",band:"#E2EBFC",header:"#F0F5FE",cell:"#F7F9FE"},groupAge:{label:"#047857",band:"#DDF2EB",header:"#EEF8F5",cell:"#F5FBF9"},groupUsage:{label:"#6D28D9",band:"#EDE3FC",header:"#F6F1FE",cell:"#FAF7FE"},groupProfile:{label:"#BE185D",band:"#FAE1EC",header:"#FCF0F5",cell:"#FEF6FA"}},c={label:"#757575",band:"#FFFFFF",header:"#FFFFFF",cell:"#FFFFFF"},i=e=>e&&o[e]||c,u=["bts_address","total_sub"],d=e=>{let t=(null==e?void 0:e.length)?e:u;return n.filter(e=>t.includes(e.key))},h=e=>e.reduce((e,t)=>{let l=e[e.length-1];return l&&t.group&&l.labelKey===t.group?l.span+=1:e.push({labelKey:t.group,span:1}),e},[])},39728:(e,t,l)=>{"use strict";l.d(t,{HC:()=>h,Ix:()=>b,RY:()=>y,U_:()=>_,aE:()=>p,pf:()=>f,yJ:()=>x});var r=l(48711),a=l(7484),s=l(91013),n=l(61293),o=l(18298),c=l(86386);let i={INVALID_OTP:"OD_1022",MISSING_AUTH_HEADER:"AUTH_UNAUTHORIZED",AUTH_FAILED:"AUTH_1002"},u={[i.INVALID_OTP]:"invalidOtp",[i.MISSING_AUTH_HEADER]:"signInRequired",[i.AUTH_FAILED]:"sessionExpired"},d=e=>!!(e&&"object"==typeof e&&(e.error||e.errors||e.status_code||e.status)),h=(e,t)=>{var l,r,a,s;if(!d(e))return null;let n=u[(null==(l=e.errors)?void 0:l.code)||(null==(r=e.error)?void 0:r.code)||e.code||""];return n&&(null==t?void 0:t[n])?t[n]:(null==(a=e.error)?void 0:a.description)||(null==(s=e.error)?void 0:s.message)||e.message||null},p=e=>d(e)&&401===e.status_code,m=()=>{let e=(0,o.Ri)(a.nN);if(!e)throw{status_code:401,error:{code:i.MISSING_AUTH_HEADER,description:"No session token cookie"}};return{headers:{"X-Session-Id":"".concat(e)}}},g=(e,t)=>{if((0,r.F0)(t)&&t.response)throw console.error("".concat(e,":"),t.response.status,t.response.data),t.response.data;throw console.error("".concat(e,":"),t),t}
1,x="bts",b=async e=>{try{let t=await (0,n.r6)();return(await c.ON.post(s.OGr,e,{headers:{"client-security-token":"".concat(t.secretCode,"=").concat(t.secretToken)}})).data}catch(e){return g("Error sending BTS OTP",e)}},y=async e=>{try{return(await c.ON.post(s.ZpX,e)).data}catch(e){return g("Error verifying BTS OTP",e)}},_=async()=>{try{return(await c.ON.get(s.RBw,m())).data}catch(e){return g("Error fetching BTS districts and thanas",e)}},f=async e=>{let{district:t,thana:l}=e,r=new URLSearchParams({district:t,thana:l});try{return(await c.ON.get("".concat(s.doO,"?").concat(r.toString()),m())).data}catch(e){return g("Error fetching BTS location data",e)}}},48711:(e,t,l)=>{"use strict";l.d(t,{F0:()=>d});let{Axios:r,AxiosError:a,CanceledError:s,isCancel:n,CancelToken:o,VERSION:c,all:i,Cancel:u,isAxiosError:d,spread:h,toFormData:p,AxiosHeaders:m,HttpStatusCode:g,formToJSON:x,getAdapter:b,mergeConfig:y,create:_}=l(78028).A},85021:(e,t,l)=>{"use strict";l.r(t),l.d(t,{__N_SSP:()=>N,default:()=>w});var r=l(37876),a=l(89099),s=l(14232),n=l(39033),o=l(46243),c=l(4368),i=l(54587),u=l.n(i),d=l(30555);let h=e=>null==e||""===e?"—":String(e),p="border-b border-[#EEE] px-3 py-2 first:pl-0 last:pr-0";function m(e){var t,l,a,n,i,m;let{translation:g,results:x,permission:b,search:y}=e,_=g.locationCheck,f=(0,s.useMemo)(()=>null!=x?x:[],[x]),v=(0,s.useMemo)(()=>(0,d.Bp)(b),[b]),k=(0,s.useMemo)(()=>(0,d.k0)(v),[v]),[F,j]=(0,s.useState)(new Set),E=k.some(e=>e.labelKey);(0,s.useEffect)(()=>{j(new Set(f.map((e,t)=>t)))},[f]);let N=(0,s.useMemo)(()=>f.reduce((e,t,l)=>{var r;return F.has(l)?e+(null!=(r=t.total_sub)?r:0):e},0),[f,F]);if(!f.length||!v.length)return(0,r.jsxs)("div",{className:"my-20 flex flex-col items-center text-center",children:[(0,r.jsx)(u(),{src:"/opps.svg",alt:"",width:80,height:80,className:"mb-5"}),(0,r.jsx)("p",{className:"text-lg font-semibold text-[#D32F2F]",children:null==_?void 0:_.emptyTitle}),(0,r.jsx)("p",{className:"text-[#757575]",children:null==_?void 0:_.emptyDescription})]});let w=F.size===f.length,A=F.size>0&&F.size<f.length,S=null!=(n=null==y?void 0:y.district)?n:String(null!=(a=f[0].district)?a:""),C=null!=(m=null==y?void 0:y.thana)?m:String(null!=(i=f[0].thana)?i:"");return(0,r.jsxs)("section",{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-center text-xl font-bold text-[#212121]",children:null==_||null==(t=_.districtThana)?void 0:t.replace("{district}",S).replace("{thana}",C)}),(0,r.jsx)("p",{className:"mt-1 mb-10 text-center text-lg font-bold text-[#212121]",children:null==_||null==(l=_.totalCount)?void 0:l.replace("{count}",String(N))})]}),(0,r.jsx)(o.Ay,{theme:{token:{colorPrimary:"#F26E21"}},children:(0,r.jsx)("div",{className:"max-h-[70vh] overflow-auto",children:(0,r.jsxs)("table",{className:"w-full border-separate border-spacing-0 text-left",children:[(0,r.jsxs)("thead",{className:"text-[#212121]",children:[E?(0,r.jsx)("tr",{children:k.map((e,t)=>{var l;let a=(0,d.sU)(e.labelKey);return(0,r.jsx)("th",{colSpan:e.span,scope:"colgroup",style:{backgroundColor:a.band,color:a.label},className:"".concat(p," ").concat("h-11"," sticky top-0 ").concat(0===t?"left-0 z-30":"z-20"," text-center text-sm font-semibold whitespace-nowrap"),children:e.labelKey?null==_?void 0:_[e.labelKey]:null},null!=(l=e.labelKey)?l:"ungrouped-".concat(t))})}):null,(0,r.jsx)("tr",{children:v.map((e,t)=>(0,r.jsx)("th",{scope:"col",style:{backgroundColor:(0,d.sU)(e.group).header},className:"".concat(p," sticky ").concat(E?"top-11":"top-0"," ").concat(0===t?"left-0 z-30 min-w-[220px]":"z-20 whitespace-nowrap"," text-lg font-bold ").concat(e.numeric?"text-right":""),children:0===t?(0,r.jsx)(c.A,{checked:w,indeterminate:A,onChange:e=>j(e.target.checked?new Set(f.map((e,t)=>t)):new Set),children:(0,r.jsx)("span",{className:"text-lg text-pretty break-words",children:null==_?void 0:_[e.labelKey]})}):null==_?void 0:_[e.labelKey]},e.key))})]}),(0,r.jsx)("tbody",{children:f.map((e,t)=>(0,r.jsx)("tr",{children:v.map((l,a)=>(0,r.jsx)("td",{style:{backgroundColor:(0,d.sU)(l.group).cell},className:"".concat(p," ").concat(0===a?"sticky left-0 z-10":"whitespace-nowrap"," ").concat(l.numeric?"text-right font-semibold tabular-nums":""),children:0===a?(0,r.jsx)(c.A,{checked:F.has(t),onChange:e=>{var l;return l=e.target.checked,void j(e=>{let r=new Set(e);return l?r.add(t):r.delete(t),r})},className:"text-pretty break-words",children:h(e[l.key])}):h(e[l.key])},l.key))},t))})]})})})]})}var g=l(12827),x=l(45529),b=l(51555),y=l(80428),_=l(84283),f=l(13497),v=l(93744);function k(e){var t,l,a,n,c;let{translation:i,districts:u,loadingDistricts:d=!1,searching:h=!1,onSearch:p,onReset:m}
1=e,[k]=g.A.useForm(),[F,j]=(0,s.useState)([]),[E,N]=(0,s.useState)(!0),w=(0,s.useMemo)(()=>u.map(e=>({label:e.district,value:e.district})),[u]);return(0,r.jsx)("div",{className:"rounded-xl border border-[#EEE] p-4 sm:p-6",children:(0,r.jsx)(o.Ay,{theme:{token:{colorPrimary:"#F26E21"}},children:(0,r.jsxs)(g.A,{form:k,onFinish:p,onValuesChange:(e,t)=>{N(!((null==t?void 0:t.district)&&(null==t?void 0:t.thana)))},onReset:()=>{k.resetFields(),j([]),N(!0),m()},size:"large",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-0.5 sm:flex-row sm:gap-2",children:[(0,r.jsx)(g.A.Item,{name:"district",className:"w-full sm:w-1/2",children:(0,r.jsx)(x.A,{showSearch:!0,loading:d,placeholder:null==(t=i.locationCheck)?void 0:t.district,optionFilterProp:"label",onChange:e=>{k.setFieldsValue({thana:void 0,location:void 0});let t=u.find(t=>t.district===e);j(t?t.thanas.map(e=>({label:e,value:e})):[]),N(!0)},options:w,suffixIcon:(0,r.jsx)(_.z44,{color:"#ccc"})})}),(0,r.jsx)(g.A.Item,{name:"thana",className:"w-full sm:w-1/2",children:(0,r.jsx)(x.A,{showSearch:!0,placeholder:null==(l=i.locationCheck)?void 0:l.thana,optionFilterProp:"label",options:F,suffixIcon:(0,r.jsx)(_.z44,{color:"#ccc"})})})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)(g.A.Item,{name:"location",className:"mb-0 flex-1",children:(0,r.jsx)(b.A,{className:"h-14 w-full rounded-[15px] px-3",placeholder:null==(a=i.locationCheck)?void 0:a.location,type:"search",size:"large",allowClear:!0})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(g.A.Item,{className:"mb-0 flex-1",children:(0,r.jsx)(y.Ay,{className:"h-14 w-full rounded-[15px] px-4",type:"primary",htmlType:"submit",icon:(0,r.jsx)(f.ZYA,{}),disabled:E,loading:h,children:null==(n=i.locationCheck)?void 0:n.search})}),(0,r.jsx)(g.A.Item,{className:"mb-0 flex-1",children:(0,r.jsx)(y.Ay,{className:"h-14 w-full rounded-[15px] bg-[#fa1717] px-4",type:"primary",htmlType:"reset",icon:(0,r.jsx)(v.Nh8,{}),children:null==(c=i.locationCheck)?void 0:c.reset})})]})]})]})})})}var F=l(30465),j=l(61293),E=l(39728),N=!0;function w(e){var t,l,o,c;let{headerFooter:i}=e,u=(0,a.useRouter)(),h=(0,F.A)("bts"),[p,g]=(0,s.useState)([]),[x,b]=(0,s.useState)(!1),[y,_]=(0,s.useState)(!1),[f,v]=(0,s.useState)(null),[N,w]=(0,s.useState)([]),[A,S]=(0,s.useState)(null),[C,K]=(0,s.useState)(""),[I,T]=(0,s.useState)(null),D=()=>{K(""),T(null)},U=(e,t)=>{K(e),T(null!=t?t:null)},O=()=>{(0,j.WY)(),u.replace("/business/bts-user")};(0,s.useEffect)(()=>{(async()=>{b(!0);try{var e;let t=await (0,E.U_)();g(null!=(e=null==t?void 0:t.data)?e:[]),D()}catch(e){if((0,E.aE)(e))return void O();U("loadError",e)}finally{b(!1)}})()},[]);let P=async e=>{_(!0);try{let n=await (0,E.pf)({district:e.district,thana:e.thana});if(200===n.status_code){var t,l,r,a,s;v((0,d.BC)(null!=(a=null==(t=n.data)?void 0:t.bts_info)?a:[],e.location)),w(null!=(s=null==(r=n.data)||null==(l=r.meta)?void 0:l.permission)?s:[]),S(e),D()}}catch(e){if((0,E.aE)(e))return void O();U("searchError",e)}finally{_(!1)}},B=C?null!=(c=(0,E.HC)(I,h.errors))?c:null==(t=h.locationCheck)?void 0:t[C]:"";return(0,r.jsx)(n.A,{headerFooter:i,children:(0,r.jsxs)("div",{className:"container mx-auto px-4 py-16",children:[(0,r.jsx)("h1",{className:"text-2xl font-semibold leading-tight text-[#212121] md:text-[32px]",children:null==(l=h.locationCheck)?void 0:l.title}),(0,r.jsx)("p",{className:"mt-2 mb-6 text-base leading-6 text-[#757575]",children:null==(o=h.locationCheck)?void 0:o.subtitle}),(0,r.jsx)(k,{translation:h,districts:p,loadingDistricts:x,searching:y,onSearch:P,onReset:()=>{v(null),w([]),S(null),D()}}),B?(0,r.jsx)("p",{className:"mt-4 text-sm font-medium text-[#D32F2F]",children:B}):null,(0,r.jsx)("div",{className:"mt-10",children:(0,r.jsx)(m,{translation:h,results:f,permission:N,search:A})})]})})}}},e=>{e.O(0,[1167,4355,3371,4188,4701,2020,4587,2384,1179,8230,9203,8632,5529,4846,1555,2827,4368,9033,636,6593,8792],()=>e(e.s=23566)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.