PageSourceSearch

https://doorstephub.com/_next/static/chunks/2538-218b30aeebdf0bc9.js

js doorstephub.com collected 2026-10-02 06:22:49 UTC 11,828 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2538],{65060:function(e,t,a){a.d(t,{b:function(){return d}});var i=a(57437),n=a(27648),s=a(34924),l=a(49322),r=a(88906),c=a(82023),o=a(92934);function d(e){var t,a;let{eligibility:d,loading:u=!1,className:m="",compact:h=!1,showLoading:x=!1}=e;if(u&&x)return(0,i.jsx)("div",{className:"animate-pulse rounded-2xl border border-emerald-100 bg-emerald-50/80 ".concat(h?"h-14":"h-36"," ").concat(m),"aria-hidden":!0});if(u||!(null==d?void 0:d.amcApplicable)&&!(null==d?void 0:d.limitExhausted))return null;let p=d.planName||"your AMC plan",f=d.benefitTitle||"this service",v=function(e){var t,a;if(!e)return null;if(e.unlimited)return"Unlimited visits for this service";let i=Number(null!==(t=e.remaining)&&void 0!==t?t:0),n=Number(null!==(a=e.total)&&void 0!==a?a:0);return n>0?"".concat(i," of ").concat(n," visit").concat(1===n?"":"s"," remaining for this service"):null!=e.remaining?"".concat(i," visit").concat(1===i?"":"s"," remaining for this service"):null}(d);return d.limitExhausted?h?(0,i.jsxs)(s.E.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"flex items-start gap-3 rounded-xl border border-amber-200 bg-amber-50 px-3.5 py-3 ".concat(m),children:[(0,i.jsx)("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-amber-500 text-white",children:(0,i.jsx)(l.Z,{className:"h-4 w-4"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-bold text-amber-950",children:"AMC limit used for this service"}),(0,i.jsxs)("p",{className:"mt-0.5 text-xs text-amber-900 leading-snug",children:["Covered under ",(0,i.jsx)("span",{className:"font-semibold",children:p}),f?(0,i.jsxs)(i.Fragment,{children:[" \xb7 ",f]}):null,null!=d.total?(0,i.jsxs)(i.Fragment,{children:[" \xb7 ",d.total,"/year used"]}):null]})]})]}):(0,i.jsx)(s.E.div,{initial:{opacity:0,y:10,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.35},className:"relative overflow-hidden rounded-2xl border border-amber-300 bg-gradient-to-br from-amber-500 via-amber-600 to-orange-700 text-white shadow-[0_18px_40px_-24px_rgba(217,119,6,0.65)] ".concat(m),children:(0,i.jsxs)("div",{className:"relative p-4 sm:p-5",children:[(0,i.jsxs)("div",{className:"flex items-start gap-3",children:[(0,i.jsx)("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl bg-white/15 ring-1 ring-white/25",children:(0,i.jsx)(l.Z,{className:"h-5 w-5"})}),(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsx)("p",{className:"inline-flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-[0.18em] text-amber-100",children:"AMC limit reached"}),(0,i.jsx)("h3",{className:"mt-1 text-lg sm:text-xl font-bold leading-tight tracking-tight",children:"This service is under AMC, but visits are used up"}),(0,i.jsxs)("p",{className:"mt-1.5 text-sm text-amber-50/95 leading-relaxed",children:[(0,i.jsx)("span",{className:"font-semibold text-white",children:f})," is part of your"," ",(0,i.jsx)("span",{className:"font-semibold text-white",children:p})," plan",null!=d.total?(0,i.jsxs)(i.Fragment,{children:[" ","(",d.total," visit",1===Number(d.total)?"":"s","/year — all used)."]}):"."," ","You can still book this service at normal rates."]})]})]}),(0,i.jsx)("div",{className:"mt-4",children:(0,i.jsx)(n.default,{href:"/account/amc",className:"inline-flex items-center rounded-full bg-white px-3 py-1 text-[11px] font-bold text-amber-800 hover:bg-amber-50 transition-colors",children:"View my AMC"})})]})}):h?(0,i.jsxs)(s.E.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"flex items-start gap-3 rounded-xl border border-emerald-200 bg-emerald-50 px-3.5 py-3 ".concat(m),children:[(0,i.jsx)("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-emerald-600 text-white",children:(0,i.jsx)(r.Z,{className:"h-4 w-4"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-bold text-emerald-900",children:"AMC available for this service"}),(0,i.jsxs)("p",{className:"mt-0.5 text-xs text-emerald-800 leading-snug",children:["Covered under ",(0,i.jsx)("span",{className:"font-semibold",children:p}),f?(0,i.jsxs)(i.Fragment,{children:[" \xb7 ",f]}):null,v?(0,i.jsxs)(i.Fragment,{children:[" \xb7 ",v]}):null]}),(0,i.jsx)("p",{className:"mt-1 text-[11px] font-semibold text-emerald-700",children:"Optional — choose AMC cover for ₹0 or pay normally"})]})]}):(0,i.jsxs)(s.E.div,{initial:{opacity:0,y:10,scale:.98}
1,animate:{opacity:1,y:0,scale:1},transition:{duration:.35},className:"relative overflow-hidden rounded-2xl border border-emerald-300/70 bg-gradient-to-br from-emerald-600 via-[#037166] to-[#025951] text-white shadow-[0_18px_40px_-24px_rgba(3,113,102,0.7)] ".concat(m),children:[(0,i.jsx)("div",{className:"absolute -right-8 -top-8 h-28 w-28 rounded-full bg-white/10"}),(0,i.jsx)("div",{className:"absolute -bottom-10 -left-6 h-24 w-24 rounded-full bg-white/5"}),(0,i.jsxs)("div",{className:"relative p-4 sm:p-5",children:[(0,i.jsxs)("div",{className:"flex items-start gap-3",children:[(0,i.jsx)("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl bg-white/15 ring-1 ring-white/25",children:(0,i.jsx)(r.Z,{className:"h-5 w-5"})}),(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsxs)("p",{className:"inline-flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-[0.18em] text-emerald-100",children:[(0,i.jsx)(c.Z,{className:"h-3 w-3"}),"AMC Active"]}),(0,i.jsx)("h3",{className:"mt-1 text-lg sm:text-xl font-bold leading-tight tracking-tight",children:"You have this service under AMC"}),(0,i.jsxs)("p",{className:"mt-1.5 text-sm text-emerald-50/95 leading-relaxed",children:["Good news — ",(0,i.jsx)("span",{className:"font-semibold text-white",children:f})," is covered by your"," ",(0,i.jsx)("span",{className:"font-semibold text-white",children:p})," plan.",v?(0,i.jsxs)(i.Fragment,{children:[" ",(0,i.jsx)("span",{className:"font-semibold text-white",children:v}),"."]}):null," ","You can choose AMC cover or pay the normal booking fee."]})]})]}),(0,i.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[v?(0,i.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-white/20 px-3 py-1.5 text-[12px] font-bold ring-1 ring-white/25",children:[(0,i.jsx)(o.Z,{className:"h-3.5 w-3.5"}),d.unlimited?"Unlimited":"".concat(null!==(t=d.remaining)&&void 0!==t?t:0,"/").concat(null!==(a=d.total)&&void 0!==a?a:"—"," left")]}):null,(0,i.jsx)("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-white/15 px-3 py-1 text-[11px] font-semibold ring-1 ring-white/20",children:"Optional: use AMC for ₹0 covered fee*"}),(0,i.jsx)(n.default,{href:"/account/amc",className:"inline-flex items-center rounded-full bg-white px-3 py-1 text-[11px] font-bold text-[#037166] hover:bg-emerald-50 transition-colors",children:"View my AMC"})]}),(0,i.jsx)("p",{className:"mt-2 text-[10px] text-white/70",children:"*Spare parts may be extra as per plan terms."})]})]})}},31569:function(e,t,a){a.d(t,{_:function(){return l}});var i=a(2265),n=a(54104),s=a(622);function l(){let{serviceId:e,categoryId:t,subcategoryId:a,enabled:l=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{user:r,token:c,isAuthenticated:o}=(0,n.a)(),d=(null==r?void 0:r._id)||(null==r?void 0:r.id)||null,u=String((null==r?void 0:r.phone)||(null==r?void 0:r.mobile)||"").replace(/\D/g,"").slice(-10),[m,h]=(0,i.useState)(!1),[x,p]=(0,i.useState)(null);return(0,i.useEffect)(()=>{let i=!1,n=e?String(e):"";if(!l||!o||!d&&!u||!n){p(null),h(!1);return}return h(!0),(async()=>{let e=await (0,s.yA)({userId:d,phone:u||void 0,serviceId:n,categoryId:t?String(t):void 0,subcategoryId:a?String(a):void 0,token:c});i||(p((null==e?void 0:e.amcApplicable)||(null==e?void 0:e.limitExhausted)?e:null),h(!1))})(),()=>{i=!0}},[l,o,d,u,e,t,a,c]),{loading:m,amcApplicable:!!(null==x?void 0:x.amcApplicable),limitExhausted:!!(null==x?void 0:x.limitExhausted),eligibility:x}}},622:function(e,t,a){a.d(t,{Pg:function(){return d},Xb:function(){return c},kF:function(){return l},t3:function(){return s},xj:function(){return r},yA:function(){return o}});var i=a(88664);async function n(e){let t=e.headers.get("content-type")||"",a=await e.text();if(!t.includes("application/json"))throw Error(404===e.status?"AMC API not available on this server yet. Please deploy the latest backend.":"AMC API returned non-JSON (HTTP ".concat(e.status,")."));try{return JSON.parse(a)}catch(e){throw Error("Invalid AMC API response")}}async function s(){if(!i.CT)throw Error("API base URL is not configured");let e=await fetch("".concat(i.CT,"/app/amc/plans"),{cache:"no-store"}),t=await n(e);if(!(null==t?void 0:t.success))throw Error((null==t?void 0:t.message)||"Failed to load Book AMC Services");return Array.isArray(t.plans)?t.plans:Array.isArray(t.data)?t.data:[]}async function l(e){if(!i.CT)throw Error("API base URL is not configured");let t=await fetch("".concat(i.CT,"/app/amc/plans/").concat(encodeURIComponent(e)),{cache:"no-store"}),a=await n(t);if(!(null==a?void 0:a.success))throw Error((null==a?void 0:a.message)||"AMC plan not found");return a.plan||a.data||null}async function r(){let{userId:e,phone:t,token:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.CT)return{success:!1,hasActiveAmc:!1,active:[],purchases:[]};let s={};a&&(s.Authorization="Bearer ".concat(a));let l=new URLSearchParams;e&&l.set("userId",String(e)),t&&l.set("phone",String(t).replace(/\D/g,"").slice(-10));let r=l.toString();try{let e=await fetch("".concat(i.CT,"/app/amc/my").concat(r?"?".concat(r):""),{headers:s,cache:"no-store"}),t=await n(e);if(!(null==t?void 0:t.success))return{success:!1,hasActiveAmc:!1,active:[],purchases:[]};return{success:!0,hasActiveAmc:!!t.hasActiveAmc,active:Array.isArray(t.active)?t.active:[],purchases:Array.isArray(t.purchases)?t.purchases:[],history:Array.isArray(t.history)?t.history:[]}}catch(e){return{success:!1,hasActiveAmc:!1,active:[],purchases:[]}}}async function c(e,t){if(!i.CT)throw Error("API base URL is not configured");let a={"Content-Type":"application/json"};t&&(a.Authorization="Bearer ".concat(t));let s=await fetch("".concat(i.CT,"/app/amc/initiate-payment"),{method:"POST",headers:a,body:JSON.stringify(e)}),l=await n(s);if(!(null==l?void 0:l.success)||!(null==l?void 0:l.access_key))throw Error((null==l?void 0:l.message)||"Could not start AMC payment");return l}async function o(){let{userId:e,serviceId:t,categoryId:a,subcategoryId:s,phone:l,token:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.CT)return{success:!1,amcApplicable:!1};if(!e&&!l||!t)return{success:!1,amcApplicable:!1,message:"userId/phone and serviceId are required"};let c={"Content-Type":"application/json"};r&&(c.Authorization="Bearer ".concat(r));try{var o,d,u;let r=await fetch("".concat(i.CT,"/app/amc/check-eligibility"),{method:"POST",headers:c,body:JSON.stringify({userId:e,phone:l,serviceId:t,ondemandServiceId:t,...a?{c
1ategoryId:a}:{},...s?{subcategoryId:s}:{}}),cache:"no-store"}),m=await n(r);return{success:!!(null==m?void 0:m.success),amcApplicable:!!(null==m?void 0:m.amcApplicable),limitExhausted:!!(null==m?void 0:m.limitExhausted),purchaseId:(null==m?void 0:m.purchaseId)||null,planName:(null==m?void 0:m.planName)||"",benefitTitle:(null==m?void 0:m.benefitTitle)||"",remaining:null!==(o=null==m?void 0:m.remaining)&&void 0!==o?o:null,total:null!==(d=null==m?void 0:m.total)&&void 0!==d?d:null,used:null!==(u=null==m?void 0:m.used)&&void 0!==u?u:null,unlimited:!!(null==m?void 0:m.unlimited),message:(null==m?void 0:m.message)||""}}catch(e){return{success:!1,amcApplicable:!1,limitExhausted:!1}}}function d(e){return"₹".concat(Number(e||0).toLocaleString("en-IN"))}}}]);

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.