1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5531],{94705:function(e,n,r){r.d(n,{Z:function(){return b}});var s=r(85893),t=r(67294),a=r(34958),i=r(13742),o=r(35739),c=r(26042),l=r(99534),d=r(13879),u=r(87764),m=r(62461),p=(r(70499),t.forwardRef((function(e,n){var r=e.className,t=(0,l.Z)(e,["className"]);return(0,s.jsx)(d.mY,(0,c.Z)({ref:n,className:(0,m.cn)("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",r)},t))})));p.displayName=d.mY.displayName;var f=t.forwardRef((function(e,n){var r=e.className,t=(0,l.Z)(e,["className"]);return(0,s.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,s.jsx)(u.Z,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,s.jsx)(d.mY.Input,(0,c.Z)({ref:n,className:(0,m.cn)("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",r)},t))]})}));f.displayName=d.mY.Input.displayName;var x=t.forwardRef((function(e,n){var r=e.className,t=(0,l.Z)(e,["className"]);return(0,s.jsx)(d.mY.List,(0,c.Z)({ref:n,className:(0,m.cn)("max-h-[300px] overflow-y-auto overflow-x-hidden",r)},t))}));x.displayName=d.mY.List.displayName;var h=t.forwardRef((function(e,n){return(0,s.jsx)(d.mY.Empty,(0,c.Z)({ref:n,className:"py-6 text-center text-sm"},e))}));h.displayName=d.mY.Empty.displayName;var v=t.forwardRef((function(e,n){var r=e.className,t=(0,l.Z)(e,["className"]);return(0,s.jsx)(d.mY.Group,(0,c.Z)({ref:n,className:(0,m.cn)("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",r)},t))}));v.displayName=d.mY.Group.displayName,t.forwardRef((function(e,n){var r=e.className,t=(0,l.Z)(e,["className"]);return(0,s.jsx)(d.mY.Separator,(0,c.Z)({ref:n,className:(0,m.cn)("-mx-1 h-px bg-border",r)},t))})).displayName=d.mY.Separator.displayName;var g=t.forwardRef((function(e,n){var r=e.className,t=(0,l.Z)(e,["className"]);return(0,s.jsx)(d.mY.Item,(0,c.Z)({ref:n,className:(0,m.cn)("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors duration-200 hover:bg-accent hover:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:cursor-not-allowed data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r)},t))}));g.displayName=d.mY.Item.displayName;var N=r(43341);function b(e){var n=e.value,r=e.onChange,c=e.currencies,l=e.className,d=void 0===l?"":l,u=(0,t.useState)(!1),b=u[0],y=u[1];return(0,s.jsxs)(N.J2,{open:b,onOpenChange:y,children:[(0,s.jsx)(N.xo,{asChild:!0,children:(0,s.jsxs)(o.z,{type:"button",variant:"outline",role:"combobox","aria-expanded":b,className:(0,m.cn)("h-9 w-24 justify-between px-3 text-sm font-normal",d),children:[n,(0,s.jsx)(a.Z,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),(0,s.jsx)(N.yk,{className:"w-44 p-0",align:"end",children:(0,s.jsxs)(p,{children:[(0,s.jsx)(f,{placeholder:"Search currency",className:"h-9","data-no-autoscroll":!0}),(0,s.jsxs)(x,{className:"max-h-56",children:[(0,s.jsx)(h,{children:"No currency found."}),(0,s.jsx)(v,{children:c.map((function(e){return(0,s.jsxs)(g,{value:e,onSelect:function(){r(e),y(!1)},children:[e,(0,s.jsx)(i.Z,{className:(0,m.cn)("ml-auto h-4 w-4",n===e?"opacity-100":"opacity-0")})]},e)}))})]})]})})]})}},2294:function(e,n,r){r.d(n,{Z:function(){return o}});var s=r(85893),t=r(3751),a=r(30381),i=r.n(a);function o(e){var n=e.countdownTime,r=e.expiryDate,a=e.displayText,o=e.compactUI,c=void 0!==o&&o,l=i()(r).toDate(),d=i()(),u=i()(r).diff(d,"seconds"),m=(0,t.useTimer)({expiryTimestamp:l,autoStart:!0}),p=m.seconds,f=m.minutes,x=m.hours,h=m.days;if(u>3600*n||u<=0)return null;var v=function(e){return e.toString().padStart(2,"0")};return c?(0,s.jsxs)("div",{className:"inline-flex items-center gap-x-1.5 whitespace-nowrap",children:[(0,s.jsx)("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:a||"Expires in"}),(0,s.jsxs)("span",{className:"text-xs font-bold tabular-nums text-red-600 dark:text-red-400",children:[h>0&&"".concat(h,"d "),v(x),"h : ",v(f),"m : ",v(p),"s"]})]}):(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"text-xs font-semibold",children:a||"Expires in"}),(0,s.jsxs)("div",{className:"flex gap-x-1",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(0,s.jsx)("span",{className:"text-base font-bold tabular-nums",children:v(h)}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Days"})]}),(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:":"}),(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(0,s.jsx)("span",{className:"text-base font-bold tabular-nums",children:v(x)}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Hrs"})]}),(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:":"}),(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(0,s.jsx)("span",{className:"text-base font-bold tabular-nums",children:v(f)}
1),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Mins"})]}),(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:":"}),(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(0,s.jsx)("span",{className:"text-base font-bold tabular-nums",children:v(p)}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Secs"})]})]})]})}},39240:function(e,n,r){r.d(n,{Z:function(){return x}});var s=r(85893),t=r(21362),a=r(71646),i=r(64998),o=r(30381),c=r.n(o),l=r(67294),d=r(35739),u=r(72685),m=r(93520),p=r(9888),f=r(2294);function x(e){var n,r,o=e.couponCode,x=e.setCouponCode,h=e.onApply,v=e.isCouponValid,g=e.product,N=e.appConfig,b=e.couponBtnColor,y=void 0===b?"primary":b,j=e.className,w=void 0===j?"":j,_=e.inputClassName,C=void 0===_?"":_,Z=(0,l.useState)(!1),k=Z[0],S=Z[1];return(0,s.jsxs)("div",{className:"flex flex-col gap-2 ".concat(w),children:[(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)(a.Z,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,s.jsx)(u.I,{onChange:function(e){return x(e.target.value)},value:o,className:"pl-9 ".concat(C),placeholder:"Apply Coupon Code",onKeyPress:function(e){return"Enter"==e.key&&h(o)}})]}),(0,s.jsx)(d.z,{onClick:function(){return h(o)},variant:"primary"===y?"default":"secondary",size:"sm",className:"px-3",children:"Apply"})]}),null!=v&&(0,s.jsx)("div",{className:"text-sm mt-1 ".concat(v?"text-green-500":"text-red-500"),children:v?"Coupon applied successfully":"Invalid coupon applied"}),(null===(n=g.featured_discounts)||void 0===n?void 0:n.length)>0&&(0,s.jsx)(t.UQ,{type:"single",collapsible:!0,value:k?"coupons":"",onValueChange:function(e){return S("coupons"===e)},children:(0,s.jsxs)(t.Qd,{value:"coupons",className:"border-none",children:[(0,s.jsx)(t.o4,{className:"rounded-md border bg-panel-surface px-3 py-1.5 text-sm font-normal text-muted-foreground transition-colors hover:no-underline",children:"Available Coupons"}),(0,s.jsx)(t.vF,{className:"pb-0 pt-1 bg-card",children:(0,s.jsx)("div",{className:"flex max-h-72 flex-col gap-2 overflow-y-auto pr-1",children:null===(r=g.featured_discounts)||void 0===r?void 0:r.map((function(e){var n=(0,m.hb)(N.web_hideMaxCouponCount)&&e.maxcount>0,r="1"===e.enable_countdown_timer&&parseInt(e.countdown_time)>0,t="1"!=N.web_disablecouponexpiry&&e.expiry_date;return(0,s.jsxs)("button",{type:"button",onClick:function(){x(e.coupon_code),h(e.coupon_code)},className:"group flex w-full items-center justify-between gap-3 rounded-xl border bg-background p-2.5 text-left transition-all hover:border-primary hover:shadow-sm",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10",children:(0,s.jsx)("img",{src:"/icons/coupon.svg",width:"18",className:"opacity-90",alt:""})}),(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-0 text-sm font-bold leading-tight text-foreground",children:[e.percent_off>0?(0,s.jsxs)("span",{children:[e.percent_off,"% OFF"]}):(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(p.Z,{price:e.flat_price,mrp:e.flat_price,currency:e.currency,className:"!text-foreground",mrpClassName:"text-sm",priceClassName:"text-sm font-bold"}),"OFF"]}),e.maxdiscount>0&&(0,s.jsxs)("span",{className:"flex items-center gap-1 text-xs font-normal text-muted-foreground",children:["up to",(0,s.jsx)(p.Z,{price:e.maxdiscount,mrp:e.maxdiscount,currency:e.currency,mrpClassName:"text-xs",priceClassName:"text-xs !text-muted-foreground"})]})]}),(n||t)&&(0,s.jsxs)("span",{className:"truncate text-xs text-muted-foreground",children:[n&&"".concat(e.maxcount," uses left"),n&&t&&" \xb7 ",t&&"Expires ".concat(c()(e.expiry_date).format("DD MMM, YY"))]}),r&&(0,s.jsx)(f.Z,{countdownTime:parseInt(e.countdown_time),expiryDate:e.expiry_date})]})]}),(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,s.jsx)("span",{className:"rounded-md border border-dashed bg-muted px-2.5 py-1 font-mono text-xs font-semibold tracking-wider text-foreground transition-colors group-hover:border-primary/50",children:e.coupon_code}),(0,s.jsx)(i.Z,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-all group-hover:translate-x-0.5 group-hover:text-primary"})]})]},e.id)}))})})]})})]})}},68598:function(e,n,r){r.d(n,{Z:function(){return d}});var s=r(85893),t=r(59417),a=r(67814),i=(r(96486),r(35739)),o=r(70499),c=r(15702),l=r(96754);function d(e){var n=e.product,r=e.isOpen,d=e.toggle,u=e.onBuyNow,m=e.couponCode,p=e.setCouponCode,f=e.isLoading,x=e.studyMaterialSelected,h=e.selectedInstallments,v=e.selectedSubscriptionPlan,g=e.creditsApplied,N=e.setCreditsApplied,b=e.setFinalPrice,y=e.currency,j=e.setCurrency,w=e.exchangeRates,_=e.selectedPlan,C=e.testPass,Z=e.isEmiSelected,k=e.isLinkedCourse,S=e.isTestPass,R=e.selectedUpsellItem,O=e.upgradeFrom,P=e.ctaLabel;return(0,s.jsx)(o.Vq,{open:r,onOpenChange:d,children:(0,s.jsxs)(o.cZ,{className:"text-foreground border-border rounded-3xl max-h-[90dvh] max-w-3xl p-0 overflow-y-auto no-scrollbar gap-0.5",children:[(0,s.jsx)("div",{className:"relative h-[100px] md:h-[250px] overflow-hidden",style:n.image?void 0:{backgroundColor:"gray"},children:(0,s.jsx)(l.L,{imageStr:n.image,title:n.title})}),(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsx)(o.fK,{children:(0,s.jsx)(o.$N,{className:"text-xl",children:n.title})}),(0,s.jsx)(c.Z,{upgradeFrom:O,product:n,couponCode:m,setCouponCode:p,setFinalPrice
1:b,currency:y,exchangeRates:w,setCurrency:j,selectedSubscriptionPlan:v,studyMaterialSelected:x,creditsApplied:g,setCreditsApplied:N,selectedInstallments:h,selectedPlan:_,testPass:C,autoApplyCoupon:!0,isLinkedCourse:k,isTestPass:S,selectedUpsellItem:R})]}),(0,s.jsx)(o.cN,{className:"p-6 pt-0",children:(0,s.jsxs)(i.z,{className:"w-full",onClick:function(){return u(Z)},disabled:f,children:[P||"Buy now",f&&(0,s.jsx)(a.G,{icon:t.LM3,spin:!0,className:"ml-2"})]})})]})})}},15702:function(e,n,r){var s=r(47568),t=r(29815),a=r(97582),i=r(85893),o=r(96486),c=r(67294),l=r(93223),d=r(94705),u=r(47628),m=r(89885),p=r(47041),f=r(96076),x=r(93520),h=r(9888),v=r(39240),g=r(62461);function N(e,n){var r,N,b,y=e.product,j=e.couponCode,w=e.setCouponCode,_=e.studyMaterialSelected,C=e.creditsApplied,Z=e.setCreditsApplied,k=e.setFinalPrice,S=e.currency,R=e.setCurrency,O=e.alignEnd,P=e.disableAffiliateCode,I=e.selectedInstallments,T=e.exchangeRates,E=e.selectedPlan,M=(e.selectedSubscriptionPlan,e.couponBtnColor),z=void 0===M?"primary":M,F=e.hideCouponSelect,A=e.hideCoupon,Y=void 0!==A&&A,D=e.onCouponValidChange,L=e.testPass,V=e.onBeforeCouponApply,B=e.autoApplyCoupon,U=e.isLinkedCourse,G=e.isTestPass,K=void 0!==G&&G,Q=e.selectedUpsellItem,q=e.showDiscountRow,H=e.upgradeFrom,J=e.hideTitle,$=void 0!==J&&J,W=e.serviceHeading,X=e.priceRowLabel,ee=e.totalLabel,ne=void 0===ee?"Total":ee,re=e.rowClassName,se=void 0===re?"":re,te=e.totalRowClassName,ae=void 0===te?"":te,ie=(0,c.useState)(0),oe=ie[0],ce=ie[1],le=(0,c.useState)(),de=le[0],ue=le[1],me=(0,c.useContext)(m.Z).appConfig,pe=(0,c.useState)(0),fe=pe[0],xe=pe[1],he=(0,c.useState)(0),ve=he[0],ge=he[1],Ne=(0,c.useState)(0),be=Ne[0],ye=Ne[1],je=(0,c.useState)(),we=je[0],_e=je[1],Ce=(0,c.useState)(),Ze=Ce[0],ke=Ce[1],Se=(0,c.useState)(1),Re=(Se[0],Se[1],(0,c.useState)(!1)),Oe=Re[0],Pe=Re[1],Ie=(0,c.useRef)(null),Te=0,Ee=0,Me=y.price,ze=(0,c.useMemo)((function(){return(0,x.hb)(y.enable_international_pricing)}),[y.enable_international_pricing]),Fe=(0,c.useMemo)((function(){return(0,x.hb)(me.web_enableinternationalpayments)}),[me.web_enableinternationalpayments]),Ae=(0,c.useMemo)((function(){return!ze&&Fe}),[ze,Fe]),Ye=(0,c.useMemo)((function(){return"0"==me.web_enablecouponcode||F||(0,x.hb)(y.disable_discount_code)}),[me.web_enablecouponcode,F,y.disable_discount_code]),De=(0,c.useMemo)((function(){return(0,x.hb)(null===y||void 0===y?void 0:y.is_sebi_flow_enabled)}),[null===y||void 0===y?void 0:y.is_sebi_flow_enabled]),Le=(0,c.useMemo)((function(){var e,n,r=null!==(n=null===y||void 0===y||null===(e=y.sebi_details)||void 0===e?void 0:e.consent_type)&&void 0!==n?n:f.ng.NONE;return!(!De||r===f.ng.NONE)}),[De,null===y||void 0===y||null===(r=y.sebi_details)||void 0===r?void 0:r.consent_type]),Ve=(0,c.useMemo)((function(){var e,n,r=null!==(n=null===y||void 0===y||null===(e=y.sebi_details)||void 0===e?void 0:e.pan_verification_mode)&&void 0!==n?n:f.Qi.NONE;return!(!De||r===f.Qi.NONE)}),[De,null===y||void 0===y||null===(N=y.sebi_details)||void 0===N?void 0:N.pan_verification_mode]),Be=(0,c.useMemo)((function(){return!(0,o.isEmpty)(Q)&&(null===Q||void 0===Q?void 0:Q.length)>0?Q.reduce((function(e,n){var r,s,t=null===y||void 0===y||null===(r=y.upsell_items)||void 0===r?void 0:r.find((function(e){return e.upsell_id===n}));return t?e+Number(null!==(s=null===t||void 0===t?void 0:t.price)&&void 0!==s?s:0):e}),0):0}),[Q,y.upsell_items]),Ue=(0,c.useMemo)((function(){return!(0,o.isEmpty)(Q)&&(null===Q||void 0===Q?void 0:Q.length)>0?Q.reduce((function(e,n){var r,s=null===y||void 0===y||null===(r=y.upsell_items)||void 0===r?void 0:r.find((function(e){return e.upsell_id===n}));if(s){var t,a,i=Number(null!==(t=s.price_kicker)&&void 0!==t?t:1),o=Number(s.price);return e+(Number(o)*Number(i)/100+Number(null!==(a=s.uhs_price)&&void 0!==a?a:0))}}),0):0}),[Q,y.upsell_items]);if((null===I||void 0===I?void 0:I.length)>0){var Ge=y.installmentPlans.filter((function(e){return I.includes(e.ins_no)})).map((function(e){return e.ins_price}));Te=(0,o.sum)(Ge)}y.price_without_gst>0&&(y.gst=y.price-y.price_without_gst),Te>0&&(Me=Te),_&&(Me=Number(Me)+Number(_.price));var Ke,Qe,qe,He,Je=U&&y.linked_price_kicker?y.linked_price_kicker:y.priceKicker;(Ee=oe>0?(Number(Me)-Number(oe))*Number(Je)/100:Number(Me)*Number(Je)/100,y.uhs_price=Number(y.uhs_price),y.uhs_price>0&&(Ee=Number(Ee)+Number(y.uhs_price)),Le)&&(Ee=null!==(Qe=Number(Ee)+Number(null===y||void 0===y||null===(Ke=y.seb
1i_details)||void 0===Ke?void 0:Ke.aadhar_consent_price))&&void 0!==Qe?Qe:0);Ve&&(Ee=null!==(He=Number(Ee)+Number(null===y||void 0===y||null===(qe=y.sebi_details)||void 0===qe?void 0:qe.pan_verification_price))&&void 0!==He?He:0);Ue>0&&(Ee=Number(Ee)+Number(Ue));var $e=(0,c.useMemo)((function(){return"INR"==S}),[S]);(0,c.useEffect)((function(){var n=P?null:localStorage.getItem("discount_code");(n||e.couponCode)&&(w(e.couponCode||n),B&&We(e.couponCode||n)),Xe(),k(en())}),[]),(0,c.useEffect)((function(){k(Ze||en()),null==be||be<=0||(be>en()?_e(en()-11):_e(be))}),[I,Te,Ee,_,L,Me,C,be,oe,Ze,Q]),(0,c.useEffect)((function(){"INR"!=S&&ke(T[S]*en())}),[S,T,oe]);var We=function(){var n=(0,s.Z)((function(n){var r,s;return(0,a.__generator)(this,(function(a){switch(a.label){case 0:return n?V?[4,V(n)]:[3,2]:[2];case 1:if(!a.sent())return[2];a.label=2;case 2:return r=K?u.OM:u.zL,s=K?[n,y.itemId,y.itemType,null===I||void 0===I?void 0:I.join(","),null===E||void 0===E?void 0:E.id,"0",me.web_apiurl,"https://thetestpassapi.akamai.net.in"]:[n,y.itemId,y.itemType,null===I||void 0===I?void 0:I.join(","),null===E||void 0===E?void 0:E.id,void 0,H],[4,r.apply(void 0,(0,t.Z)(s)).then((function(n){ue(!0),null===D||void 0===D||D(!0),Z(0),e.setCouponResponse&&e.setCouponResponse(n);var r=n.percent_off>0?Me*n.percent_off/100:n.flat_price;if(n.maxdiscount>0&&(r=Math.min(r,n.maxdiscount)),100==n.percent_off&&(r=Me,y.uhs_price=0),ce($e?Math.round(r):r),y.price_without_gst>0){var s=n.percent_off>0?1-n.percent_off/100:1-n.flat_price/y.price,t=$e?Math.round(y.price_without_gst*s):y.price_without_gst*s,a=$e?Math.round(y.gst*s):y.gst*s;xe(t),ge(a)}})).catch((function(e){ue(!1),null===D||void 0===D||D(!1),w("")}))];case 3:return a.sent(),[2]}}))}));return function(e){return n.apply(this,arguments)}}();(0,c.useImperativeHandle)(n,(function(){return{applyCoupon:We,isCouponValid:de}}));var Xe=function(){var e=(0,s.Z)((function(){var e,n,r,s,t;return(0,a.__generator)(this,(function(a){switch(a.label){case 0:e=(0,p.getCookie)(f.JR)||-1,a.label=1;case 1:return a.trys.push([1,3,,4]),-1==e?[2]:[4,(0,u.M_)("",e)];case 2:return r=a.sent(),s=Number(null===r||void 0===r||null===(n=r[0])||void 0===n?void 0:n.refer_credits),isNaN(s)||ye(s),[3,4];case 3:return t=a.sent(),console.error("error",t),[3,4];case 4:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}(),en=function(){var e=(null===I||void 0===I?void 0:I.length)>0?Te:Number(y.price);return oe>0&&(e-=oe),Ee>0&&(e+=Ee),_&&(e+=Number(_.price)),C&&(e-=C),L&&(e+=Number(L.price)),Be>0&&(e+=Number(Be)),$e?Math.round(e):e};return(0,c.useEffect)((function(){Ie.current&&Pe(Ie.current.clientWidth<650);var e=new ResizeObserver((function(e){var n=e[0].contentRect.width;Pe(n<650)}));return Ie.current&&e.observe(Ie.current),function(){Ie.current&&e.unobserve(Ie.current)}}),[null===(b=Ie.current)||void 0===b?void 0:b.clientWidth]),(0,i.jsxs)("div",{className:"flex ".concat(Oe?"flex-col":"flex-row-reverse"," gap-2"),ref:Ie,children:[!Ye&&!Y&&(0,i.jsx)("div",{className:"flex flex-col",children:(0,i.jsx)(v.Z,{couponCode:j,setCouponCode:w,onApply:We,isCouponValid:de,product:y,appConfig:me,couponBtnColor:z})}),(0,i.jsxs)("div",{className:"flex flex-col gap-2 text-sm text-muted-foreground ".concat(Oe?"px-0 mx-0":"pr-2"," ").concat(O?"payment-align-end":""),style:{flex:1},children:[!$&&(0,i.jsx)("h5",{className:"font-bold mb-0",children:"Summary"}),W&&(0,i.jsx)("h5",{className:"mb-0 text-[15px] font-semibold text-foreground",children:W}),Ae&&T&&(0,i.jsxs)("div",{className:"flex justify-between items-center",children:[(0,i.jsx)("span",{children:"Payment Currency"}),(0,i.jsx)(d.Z,{value:S,onChange:R,currencies:Object.keys(T),className:"h-8 ".concat(O?"ml-auto":"")})]}),(!I||0==I.length)&&y.price_without_gst>0?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:(0,g.cn)("flex justify-between items-center",se),children:[(0,i.jsx)("span",{children:X||"Price (Excluding GST)"}),(0,i.jsxs)("span",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:oe>0&&fe>0?"text-muted-foreground line-through":"",children:(0,i.jsx)(h.Z,{price:y.price_without_gst,mrp:y.price_without_gst,currency:y.currency,size:"xs",weight:"normal",color:"secondary"})}),oe>0&&fe>0&&(0,i.jsx)(h.Z,{price:fe,mrp:fe,currency:y.currency,size:"xs",weight:"normal",color:"secondary"})]})]}),(0,i.jsxs)("div",{className:(0,g.cn)("flex justify-between items-center",se),children:[(0,i.jsx)("span",{children:"GST"}),(0,i.jsxs)("span",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:oe>0&&ve>0?"text-muted-foreground line-through":"",children:(0,i.jsx)(h.Z,{price:y.gst,mrp:y.gst,currency:y.currency,size:"xs",weight:"normal",color:"secondary"})}),oe>0&&ve>0&&(0,i.jsx)(h.Z,{price:ve,mrp:ve,currency:y.currency,size:"xs",weight:"normal",color:"secondary"})]})]})]}):(0,i.jsxs)("div",{className:(0,g.cn)("flex justify-between items-center",se),children:[(0,i.jsx)("span",{children:X||"Price (Including GST)"}),(0,i.jsx)(h.Z,{price:Te>0?Te:y.price,mrp:Te>0?Te:y.price,currency:y.currency,size:"xs",weight:"normal",color:"secondary"})]}),_&&(0,i.jsxs)("div",{className:"flex justify-between items-center",children:[(0,i.jsx)("span",{children:(0,x.hb)(me.web_showBookPrice)&&_.title||"Price"}),(0,i.jsx)(h.Z,{price:_.price,mrp:_.price,currency:y.currency,size:"xs",weight:"normal",color:"secondary"})]}),L&&(0,i.jsxs)("div",{className:"flex justify-between items-center",children:[(0,i.jsx)("span",{children:"Test Pass Subscription"}),(0,i.jsx)(h.Z,{price:L.price,mrp:L.price,currency:L.currency,size:"xs",weight:"normal",color:"secondary"})]}),(0,i.jsxs)("div",{className:"flex justify-between items-center",children:[(0,i.jsx)("span",{children:"Net Discount"}),(!Ye||q)&&(0,i.jsx)("span",{className:Number(oe)>0?"text-green-500":"",children:(0,i.jsx)(h.Z,{price:Number(oe),mrp:Number(oe),currency:y.currency,size:"xs",weight:"normal",color:"secondary"})})]}),Be>0&&(0,i.jsxs)("div",{className:"flex justify-between items-center",children:[(0,i.jsx)("span",{children:"Combo Offer Items"}),(0,i.jsx)(h.Z,{price:Be,mrp:Be,currency:y.currency,size:"xs",weight:"normal",color:"secondary"})]}),Number(Ee)>0&&(0,i.jsxs)("div",{className:"flex justify-between items-center",children:[(0,i.jsx)("span",{children:"Internet Handling Fees"}),(0,i.jsx)(h.Z,{price:Ee>0?$e?Math.round(Ee):Ee:"0",currency:y.currency,size:"xs",weight:"normal",color:"secondary"})]}),(0,i.jsxs)("div",{className:(0,g.cn)("flex justify-between items-center border-t pt-3 mt-1 text-base font-semibold text-foreground",ae),children:[(0,i.jsx)("span",{children:ne}),(0,i.jsx)(h.Z,{price:en(),mrp:en(),currency:y.currency,size:"xs",weight:"semibold",color:"secondary",className:"!text-foreground !text-base"})]}),"INR"!=S&&Ze>0&&(0,i.jsxs)("div",{className:"flex justify-between items-center font-semibold",children:[(0,i.jsxs)("span",{children:["Total in ",S," (approx.)"]}),(0,i.jsx)(h.Z,{price:Ze.toFixed(2),mrp:Ze.toFixed(2),currency:S,size:"xs",weight:"semibold",color:"secondary"})]}),!ze&&we>=1&&((0,o.isEmpty)(me.web_menuitems)?"1"==me.web_enablemenureferral&&(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("input",{id:"applyCredits",type:"checkbox",className:"rounded border-border",checked:C>0,onChange:function(){Z(C>0?0:we)}}),(0,i.jsxs)(l._,{htmlFor:"applyCredits",className:"mb-0 flex items-center gap-2 text-sm font-semibold",children:["Apply Credits",(0,i.jsx)(h.Z,{price:null!==we&&void 0!==we?we:0,mrp:null!==we&&void 0!==we?we:0,currency:y.currency,size:"xs",weight:"semibold",color:"secondary"})]})]}):(0,o.some)(me.web_menuitems,{type:"REFERRAL"}))]})]})}n.Z=(0,c.forwardRef)(N)},86839:function(e,n,r){r.d(n,{Z:function(){return d}});
1var s=r(85893),t=r(67294),a=r(70499),i=r(35739),o=r(4380),c=r(96076),l=r(17156);function d(e){var n=e.isOpen,r=e.toggle,d=e.pdfUrl,u=e.onContinue,m=(0,t.useState)(!1),p=m[0],f=m[1];return(0,s.jsx)(a.Vq,{open:n,onOpenChange:r,children:(0,s.jsxs)(a.cZ,{className:"max-w-4xl h-[80vh] flex flex-col bg-background !rounded-md p-0 overflow-hidden gap-0.5",children:[(0,s.jsxs)(a.fK,{className:"flex flex-row items-center gap-2 px-3 py-2 border-b bg-muted",children:[(0,s.jsx)("img",{src:"/icons/frame-icon.svg",alt:"Terms and Conditions",className:"h-5 w-5 opacity-70"}),(0,s.jsx)(a.$N,{className:"mb-0 text-sm font-medium text-muted-foreground",children:"Terms & Conditions"})]}),(0,s.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,s.jsx)(o.Z,{link:d,allowDownload:"0",title:"Terms and Condition",host:c.Nf,isOpen:!0,isEncrypted:"0",encryptionVersion:"1",encryptionKey:"",phone:"",watermarkConfig:l.xb,clientUrl:""})}),(0,s.jsxs)(a.cN,{className:"flex flex-col gap-4 sm:flex-col justify-center items-center my-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",id:"terms",className:"w-4 h-4 rounded border-border text-primary focus:ring-primary focus:ring-2 cursor-pointer",checked:p,onChange:function(e){return f(e.target.checked)}}),(0,s.jsxs)("label",{htmlFor:"terms",className:"text-sm font-medium leading-none cursor-pointer select-none",children:["I have read & agree to the"," ",(0,s.jsx)("span",{className:"underline font-semibold",children:"terms and conditions"})]})]}),(0,s.jsx)(i.z,{onClick:function(){p&&(u(),r(),f(!1))},disabled:!p,className:"w-full max-w-xs bg-primary text-white hover:bg-primary/90 disabled:bg-muted disabled:opacity-50 disabled:text-muted-foreground",children:"Continue"})]})]})})}},21362:function(e,n,r){r.d(n,{Qd:function(){return m},UQ:function(){return u},o4:function(){return p},vF:function(){return f}});var s=r(26042),t=r(69396),a=r(99534),i=r(85893),o=r(67294),c=r(47398),l=r(8971),d=r(62461),u=c.fC,m=o.forwardRef((function(e,n){var r=e.className,t=(0,a.Z)(e,["className"]);return(0,i.jsx)(c.ck,(0,s.Z)({ref:n,className:(0,d.cn)("border-b",r)},t))}));m.displayName="AccordionItem";var p=o.forwardRef((function(e,n){var r=e.className,o=e.children,u=(0,a.Z)(e,["className","children"]);return(0,i.jsx)(c.h4,{className:"flex",children:(0,i.jsxs)(c.xz,(0,t.Z)((0,s.Z)({ref:n,className:(0,d.cn)("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",r)},u),{children:[o,(0,i.jsx)(l.Z,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]}))})}));p.displayName=c.xz.displayName;var f=o.forwardRef((function(e,n){var r=e.className,o=e.children,l=(0,a.Z)(e,["className","children"]);return(0,i.jsx)(c.VY,(0,t.Z)((0,s.Z)({ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"},l),{children:(0,i.jsx)("div",{className:(0,d.cn)("pb-4 pt-0",r),children:o})}))}));f.displayName=c.VY.displayName},50723:function(e,n,r){r.d(n,{Zn:function(){return m},cY:function(){return f},hf:function(){return p}});var s=r(40872),t=r(26042),a=r(69396),i=r(99534),o=r(85893),c=r(67294),l=r(28058),d=r(55780),u=r(62461),m=c.forwardRef((function(e,n){var r=e.className,s=e.containerClassName,a=(0,i.Z)(e,["className","containerClassName"]);return(0,o.jsx)(l.uZ,(0,t.Z)({ref:n,containerClassName:(0,u.cn)("flex items-center gap-2 has-[:disabled]:opacity-50",s),className:(0,u.cn)("disabled:cursor-not-allowed",r)},a))}));m.displayName="InputOTP";var p=c.forwardRef((function(e,n){var r=e.className,s=(0,i.Z)(e,["className"]);return(0,o.jsx)("div",(0,t.Z)({ref:n,className:(0,u.cn)("flex items-center",r)},s))}));p.displayName="InputOTPGroup";var f=c.forwardRef((function(e,n){var r=e.index,s=e.className,d=(0,i.Z)(e,["index","className"]),m=c.useContext(l.VM).slots[r],p=m.char,f=m.hasFakeCaret,x=m.isActive;return(0,o.jsxs)("div",(0,a.Z)((0,t.Z)({ref:n,className:(0,u.cn)("relative flex h-10 w-10 items-center justify-center border-y border-r border-input bg-background text-foreground text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",x&&"z-10 ring-2 ring-ring ring-offset-background",s)},d),{children:[p,(f||x&&!p)&&(0,o.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,o.jsx)("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]}))}));f.displayName="InputOTPSlot",c.forwardRef((function(e,n){var r=(0,s.Z)({},e);return(0,o.jsx)("div",(0,a.Z)((0,t.Z)({ref:n,role:"separator"},r),{children:(0,o.jsx)(d.Z,{})}))})).displayName="InputOTPSeparator"},43341:function(e,n,r){r.d(n,{J2:function(){return l},xo:function(){return d},yk:function(){return u}});var s=r(26042),t=r(99534),a=r(85893),i=r(67294),o=r(86419),c=r(62461),l=o.fC,d=o.xz,u=i.forwardRef((function(e,n){var r=e.className,i=e.align,l=void 0===i?"center":i,d=e.sideOffset,u=void 0===d?4:d,m=e.portalled,p=void 0===m||m,f=(0,t.Z)(e,["className","align","sideOffset","portalled"]),x=(0,a.jsx)(o.VY,(0,s.Z)({ref:n,align:l,sideOffset:u,className:(0,
1c.cn)("z-[100] w-72 rounded-md border bg-charcoal/50 p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[var(--radix-popover-content-transform-origin)]",r)},f));return p?(0,a.jsx)(o.h_,{children:x}):x}));u.displayName=o.VY.displayName},67507:function(e,n,r){r.d(n,{l:function(){return _}});var s=r(47568),t=r(26042),a=r(69396),i=r(97582),o=r(85893),c=r(67294),l=r(96486),d=r(47041),u=r(19201),m=r(89885),p=r(47628),f=r(96076),x=r(50526),h=r(68598),v=r(36316),g=r(3751),N=r(70499),b=r(35739),y=r(50723);function j(e){var n=e.isOpen,r=e.toggle,s=e.phone,t=e.isLoading,a=e.isResending,i=e.onConfirm,l=e.onResend,d=(0,c.useState)(""),u=d[0],m=d[1],p=(0,c.useState)(!1),f=p[0],x=p[1],h=(0,g.useTimer)({autoStart:!0,expiryTimestamp:new Date((new Date).getTime()+3e4),onExpire:function(){return x(!0)}});return(0,o.jsx)(N.Vq,{open:n,onOpenChange:r,children:(0,o.jsxs)(N.cZ,{className:"max-w-sm",children:[(0,o.jsxs)(N.fK,{children:[(0,o.jsx)(N.$N,{children:"Verify your number"}),(0,o.jsxs)(N.Be,{children:["For Cash on Delivery orders, enter the 6-digit OTP sent to ",s," ","to confirm your order."]})]}),(0,o.jsx)("div",{className:"flex flex-col items-center gap-3",children:(0,o.jsx)(y.Zn,{value:u,onChange:m,maxLength:6,pattern:/^\d*$/,pasteTransformer:function(e){return e.replace(/\D/g,"")},disabled:t,children:(0,o.jsx)(y.hf,{className:"gap-2",children:Array.from({length:6}).map((function(e,n){return(0,o.jsx)(y.cY,{index:n,className:"h-11 w-11 rounded-lg border border-input text-base font-semibold first:rounded-l-lg last:rounded-r-lg",hasFakeCaret:!0,autoFocus:0===n},n)}))})})}),(0,o.jsxs)(N.cN,{className:"flex-col gap-2 sm:flex-col",children:[(0,o.jsxs)(b.z,{className:"w-full",disabled:6!==u.length||t,onClick:function(){return i(u)},children:[t&&(0,o.jsx)(v.Z,{className:"mr-2 size-4 animate-spin"}),"Place Order"]}),f?(0,o.jsx)(b.z,{type:"button",variant:"outline",className:"w-full",disabled:a,onClick:function(){m(""),null===l||void 0===l||l(),h.restart(new Date((new Date).getTime()+3e4)),x(!1)},children:a?"Resending...":"Resend OTP"}):(0,o.jsxs)("p",{className:"text-center text-sm text-muted-foreground",children:["Resend OTP in ",h.seconds,"s"]})]})]})})}var w=r(86839);function _(e){var n=e.product,r=e.createOrderFn,v=e.buildOrderData,g=e.onSuccess,N=e.showCouponModal,b=void 0!==N&&N,y=e.couponModalProps,_=void 0===y?{}:y,C=(0,c.useContext)(m.Z),Z=C.currentUser,k=C.toggleAuthModal,S=(0,c.useState)({}),R=S[0],O=S[1],P=(0,c.useState)(!1),I=P[0],T=P[1],E=(0,c.useState)(!1),M=E[0],z=E[1],F=(0,c.useState)(!1),A=F[0],Y=F[1],D=(0,c.useState)(!1),L=D[0],V=D[1],B=(0,c.useState)(!1),U=B[0],G=B[1],K=(0,c.useState)(!1),Q=K[0],q=K[1],H=(0,c.useState)(""),J=H[0],$=H[1],W=(0,c.useState)(null===n||void 0===n?void 0:n.price),X=W[0],ee=W[1],ne=(0,c.useState)("INR"),re=ne[0],se=ne[1],te=(0,c.useState)(!1),ae=te[0],ie=te[1],oe=(0,c.useRef)(null),ce=(0,c.useRef)(!1),le=(0,c.useRef)(null),de=function(e){void 0!==e&&(le.current=e),Z&&Z.userid?(0,l.isEmpty)(null===n||void 0===n?void 0:n.terms_and_conditions_pdf)||ce.current?(0,l.isEmpty)(le.current)?(O({}),T(!0)):pe(le.current):ie(!0):null===k||void 0===k||k()},ue=function(){ce.current=!0,ie(!1),de()},me=function(){var e=(0,s.Z)((function(e){var n,r,s,t;return(0,i.__generator)(this,(function(a){switch(a.label){case 0:if(n=e||(null===R||void 0===R?void 0:R.phone),(0,l.isEmpty)(n))return u.A.error("Phone number required for Cash on Delivery"),[2];V(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(0,p.nh)(n)];case 2:return a.sent(),z(!1),Y(!0),[3,5];case 3:return r=a.sent(),u.A.error((null===(s=r.response)||void 0===s||null===(t=s.data)||void 0===t?void 0:t.message)||"Failed to send OTP"),[3,5];case 4:return V(!1),[7];case 5:return[2]}}
1))}));return function(n){return e.apply(this,arguments)}}(),pe=function(){var e=(0,s.Z)((function(e){var n,r,s,o,c,l;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:V(!0),i.label=1;case 1:return i.trys.push([1,6,,7]),n=(0,d.getCookie)(f.JR)||(null===Z||void 0===Z?void 0:Z.userid),r=(0,a.Z)((0,t.Z)({},e),{user_id:n,email:null===Z||void 0===Z?void 0:Z.email}),[4,(0,p.AK)(r)];case 2:if(!(s=i.sent())||s<=0)throw new Error("Invalid address id");return oe.current=s,O(e),T(!1),b?(z(!0),V(!1),[3,5]):[3,3];case 3:return[4,me(e.phone)];case 4:i.sent(),i.label=5;case 5:return[3,7];case 6:return o=i.sent(),V(!1),u.A.error((null===(c=o.response)||void 0===c||null===(l=c.data)||void 0===l?void 0:l.message)||o.message||"Failed to save address"),[3,7];case 7:return[2]}}))}));return function(n){return e.apply(this,arguments)}}(),fe=function(){return me()},xe=function(){var e=(0,s.Z)((function(){var e,n,r;return(0,i.__generator)(this,(function(s){switch(s.label){case 0:q(!0),s.label=1;case 1:return s.trys.push([1,3,4,5]),[4,(0,p.nh)(R.phone)];case 2:return s.sent(),[3,5];case 3:return e=s.sent(),u.A.error((null===(n=e.response)||void 0===n||null===(r=n.data)||void 0===r?void 0:r.message)||"Failed to resend OTP"),[3,5];case 4:return q(!1),[7];case 5:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}(),he=function(){var e=(0,s.Z)((function(e){var n,s,o,c,l,d;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:if(U)return[2];G(!0),n=null,i.label=1;case 1:return i.trys.push([1,3,4,5]),s=(0,a.Z)((0,t.Z)({},v({addressId:oe.current,couponCode:J,finalPrice:X,currency:re})),{is_cod:1,otp:e}),[4,r(s)];case 2:if(!(o=i.sent())||!o.order_id)throw new Error("Invalid request: order not created");return n=o,[3,5];case 3:return c=i.sent(),u.A.error((null===(l=c.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.message)||c.message||"Invalid OTP, please try again"),[3,5];case 4:return G(!1),[7];case 5:return n&&(Y(!1),null===g||void 0===g||g(n)),[2]}}))}));return function(n){return e.apply(this,arguments)}}();return{startCOD:de,isLoading:L,CODModals:function(){return(0,o.jsxs)(o.Fragment,{children:[!(0,l.isEmpty)(null===n||void 0===n?void 0:n.terms_and_conditions_pdf)&&(0,o.jsx)(w.Z,{isOpen:ae,toggle:function(){return ie(!1)},pdfUrl:n.terms_and_conditions_pdf,onContinue:ue}),I&&(0,o.jsx)(x.Z,{isOpen:I,toggle:function(){return T(!1)},isLoading:L,product:n,onBuyNow:pe}),b&&M&&(0,o.jsx)(h.Z,(0,t.Z)({isOpen:M,toggle:function(){return z(!1)},product:n,isLoading:L,couponCode:J,setCouponCode:function(e){return $(null!==e&&void 0!==e?e:"")},setFinalPrice:ee,currency:re,setCurrency:se,ctaLabel:"Pay on Delivery",onBuyNow:fe},_)),A&&(0,o.jsx)(j,{isOpen:A,toggle:function(){return Y(!1)},phone:null===R||void 0===R?void 0:R.phone,isLoading:U,isResending:Q,onConfirm:he,onResend:xe})]})}}}},20118:function(e,n,r){r.d(n,{Tm:function(){return a},cY:function(){return t},hn:function(){return i}});var s=r(95495),t=(0,s.O4)("cart",[]),a=(0,s.O4)("cart_added_at",null),i=2592e5}}]);
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.