PageSourceSearch

https://fishterianz.com/_next/static/chunks/783ea472634ed13c.js

js fishterianz.com collected 2026-10-02 01:29:47 UTC 36,759 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16015,(e,t,r)=>{},98547,(e,t,r)=>{var s=e.i(47167);e.r(16015);var i=e.r(71645),n=i&&"object"==typeof i&&"default"in i?i:{default:i},a=void 0!==s.default&&s.default.env&&!0,o=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,r=t.name,s=void 0===r?"stylesheet":r,i=t.optimizeForSpeed,n=void 0===i?a:i;c(o(s),"`name` must be a string"),this._name=s,this._deletedRulePlaceholder="#"+s+"-deleted-rule____{}",c("boolean"==typeof n,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=n,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t,r=e.prototype;return r.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},r.isOptimizeForSpeed=function(){return this._optimizeForSpeed},r.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(a||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,r){return"number"==typeof r?e._serverSheet.cssRules[r]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),r},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},r.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},r.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},r.insertRule=function(e,t){if(c(o(e),"`insertRule` accepts only strings"),"undefined"==typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var r=this.getSheet();"number"!=typeof t&&(t=r.cssRules.length);try{r.insertRule(e,t)}catch(t){return a||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var s=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,s))}return this._rulesCount++},r.replaceRule=function(e,t){if(this._optimizeForSpeed||"undefined"==typeof window){var r="undefined"!=typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!r.cssRules[e])return e;r.deleteRule(e);try{r.insertRule(t,e)}catch(s){a||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),r.insertRule(this._deletedRulePlaceholder,e)}}else{var s=this._tags[e];c(s,"old rule at index `"+e+"` not found"),s.textContent=t}return e},r.deleteRule=function(e){if("undefined"==typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},r.flush=function(){this._injected=!1,this._rulesCount=0,"undefined"!=typeof window?(this._tags.forEac
1h(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},r.cssRules=function(){var e=this;return"undefined"==typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,r){return r?t=t.concat(Array.prototype.map.call(e.getSheetForTag(r).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},r.makeStyleTag=function(e,t,r){t&&c(o(t),"makeStyleTag accepts only strings as second parameter");var s=document.createElement("style");this._nonce&&s.setAttribute("nonce",this._nonce),s.type="text/css",s.setAttribute("data-"+e,""),t&&s.appendChild(document.createTextNode(t));var i=document.head||document.getElementsByTagName("head")[0];return r?i.insertBefore(s,r):i.appendChild(s),s},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}(e.prototype,t),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var d=function(e){for(var t=5381,r=e.length;r;)t=33*t^e.charCodeAt(--r);return t>>>0},u={};function m(e,t){if(!t)return"jsx-"+e;var r=String(t),s=e+r;return u[s]||(u[s]="jsx-"+d(e+"-"+r)),u[s]}function h(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var r=e+t;return u[r]||(u[r]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[r]}var p=function(){function e(e){var t=void 0===e?{}:e,r=t.styleSheet,s=void 0===r?null:r,i=t.optimizeForSpeed,n=void 0!==i&&i;this._sheet=s||new l({name:"styled-jsx",optimizeForSpeed:n}),this._sheet.inject(),s&&"boolean"==typeof n&&(this._sheet.setOptimizeForSpeed(n),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==typeof window||this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var r=this.getIdAndRules(e),s=r.styleId,i=r.rules;if(s in this._instancesCounts){this._instancesCounts[s]+=1;return}var n=i.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[s]=n,this._instancesCounts[s]=1},t.remove=function(e){var t=this,r=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(r in this._instancesCounts,"styleId: `"+r+"` not found"),this._instancesCounts[r]-=1,this._instancesCounts[r]<1){var s=this._fromServer&&this._fromServer[r];s?(s.parentNode.removeChild(s),delete this._fromServer[r]):(this._indices[r].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[r]),delete this._instancesCounts[r]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],r=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return r[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,r;return t=this.cssRules(),void 0===(r=e)&&(r={}),t.map(function(e){var t=e[0],s=e[1];return n.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:r.nonce?r.nonce:void 0,dangerouslySetInnerHTML:{__html:s}})})},t.getIdAndRules=function(e){var t=e.children,r=e.dynamic,s=e.id;if(r){var i=m(s,r);return{styleId:i,rules:Array.isArray(t)?t.map(function(e){return h(i,e)}):[h(i,t)]}}return{styleId:m(s),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),x=i.createContext(null);function f(){return new p}function g(){return i.useContext(x)}x.displayName="StyleSheetContext";var y=n.default.useInsertionEffect||n.default.useLayoutEffect,b="undefined"!=typeof window?f():void 0;function v(e){var t=b||g();return t&&("undefined"==typeof window?t.add(e):y(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}v.dynamic=function(e){return e.map(function(e){return m(e[0],e[1])}).join(" ")},r.StyleRegistry=function(e){var t=e.registry,r=e.children,s=i.useContext(x),a=i.useState(function(){return s||t||f()})[0];return n.default.createElement(x.Provider,{value:a},r)},r.createStyleRegistry=f,r.style=v,r.useStyleRegistry=g},37902,(e,t,r)=>{t.exports=e.r(98547).style},11870,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(18566),i=e.i(82043);function n({children:e}){let{user:n,isLoggedIn:a,loading:o}=(0,i.useAuth)(),l=(0,s.useRouter)();return((0,r.useEffect)(()=>
1{if(!o&&!a){let e=`${window.location.pathname}${window.location.search}`;l.push(`/login?from=${encodeURIComponent(e)}`)}},[a,o,l]),o)?(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-[#f8fafc] to-[#eef1f5] p-6",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-6 animate-fadeIn",children:[(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("div",{className:"w-16 h-16 rounded-3xl bg-white/60 backdrop-blur-xl shadow-lg border border-white/40 animate-softBounce flex items-center justify-center",children:(0,t.jsx)("div",{className:"w-8 h-8 border-[4px] border-primary-500 border-t-transparent rounded-full animate-slowSpin"})})}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"text-xl font-semibold text-gray-800 tracking-wide animate-textSlide",children:"Authenticating…"}),(0,t.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Please wait a moment while we verify your session"})]}),(0,t.jsx)("div",{className:"w-48 h-2 bg-gray-200 rounded-full overflow-hidden relative",children:(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-primary-400 to-transparent animate-shimmer"})})]})}):a?(0,t.jsx)(t.Fragment,{children:e}):null}e.s(["default",()=>n])},54906,83201,e=>{"use strict";var t=e.i(71645),r=e.i(84196);e.i(97682);var s=e.i(80441);async function i(){try{let e=await r.apiClient.get(s.API_ENDPOINTS.COMPANY.GET_APP_CONSTANT,!1);if("success"===e.status&&e.data)return e;return null}catch(e){throw console.error("Error fetching App constant:",e),e}}e.s(["getAppConstant",()=>i],83201);let n={orderConfig:{minOrderAmount:199,freeDeliveryThreshold:499,deliveryFee:50,taxPercent:0,transactionCharge:0}};function a(e,r=0){let[s,o]=(0,t.useState)(n),[l,c]=(0,t.useState)(!0);return(0,t.useEffect)(()=>{(async()=>{try{let e=await i();if(e?.data?.orderConfig){let t=e.data.orderConfig;o({orderConfig:{minOrderAmount:Number(t.minOrderAmount??199),freeDeliveryThreshold:Number(t.freeDeliveryThreshold??499),deliveryFee:Number(t.deliveryFee??50),taxPercent:Number(t.taxPercent??0),transactionCharge:Number(t.transactionCharge??0)}})}}catch(e){console.error("Using fallback config")}finally{c(!1)}})()},[]),(0,t.useMemo)(()=>{if(l)return{subtotal:0,savings:0,deliveryFee:0,taxAmount:0,transactionCharge:0,total:0,isFreeDelivery:!1,minOrderAmount:s.orderConfig.minOrderAmount,freeDeliveryThreshold:s.orderConfig.freeDeliveryThreshold,loading:!0};let t=e.reduce((e,t)=>e+t.sellingPrice*t.quantity,0),i=e.reduce((e,t)=>t.actualPrice>t.sellingPrice?e+(t.actualPrice-t.sellingPrice)*t.quantity:e,0),n=t>=s.orderConfig.freeDeliveryThreshold,a=n?0:s.orderConfig.deliveryFee,o=s.orderConfig.transactionCharge,c=(t-r)*s.orderConfig.taxPercent/100,d=Math.max(0,t+a+c+o-r);return{subtotal:t,savings:i,deliveryFee:a,taxAmount:c,transactionCharge:o,total:d,isFreeDelivery:n,minOrderAmount:s.orderConfig.minOrderAmount,freeDeliveryThreshold:s.orderConfig.freeDeliveryThreshold,loading:!1}},[e,r,s,l])}e.s(["FALLBACK_CONFIG",0,n,"useCartCalculations",()=>a],54906)},37727,e=>{"use strict";let t=(0,e.i(75254).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",()=>t],37727)},5948,e=>{"use strict";var t=e.i(84196);e.i(97682);var r=e.i(80441);async function s(e){try{let s=await t.apiClient.get(r.API_ENDPOINTS.COUPON.GET_ALL(e),!1);if("success"===s.status&&s.data.length>0)return s.data;return[]}catch(e){throw console.error("Error fetching Coupons:",e),e}}async function i(e){try{return await t.apiClient.post(r.API_ENDPOINTS.COUPON.VALIDATE,e,!0)}catch(e){throw console.error("Error validating coupon: ",e),e}}e.s(["getCoupon",()=>s,"validateCoupon",()=>i])},67471,e=>{"use strict";var t=e.i(43476),r=e.i(46932),s=e.i(88653),i=e.i(37727),n=e.i(11152);function a({isOpen:e,onClose:a,iosLink:o="#",androidLink:l="#"}){return(0,t.jsx)(s.AnimatePresence,{children:e&&(0,t.jsx)(r.motion.div,{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-md p-4",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},onClick:a,children:(0,t.jsxs)(r.motion.div,{className:"relative w-full max-w-sm rounded-2xl bg-white p-6 shadow-[0_20px_60px_rgba(0,0,0,0.25)]",initial:{scale:.95,y:20,opacity:0},animate:{scale:1,y:0,opacity:1},exit:{scale:.95,y:20,opacity:0},transition:{duration:.2},onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("button",{onClick:a,className:"absolute right-3 top-3 text-gray-400 hover:text-gray-700 transition",children:(0,t.jsx)(i.X,{size:18})}),(0,t.jsx)("div",{className:"inline-flex items-center gap-2 bg-blue-50 text-blue-600 text-xs font-medium px-3 py-1 rounded-full mb-4",children:"🎉 App Exclusive"}),(0,t.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Exclusive App-Only Discount"}),(0,t.jsx)("p",{className:"text-sm text-gray-600 leading-relaxed mb-5",children:"This coupon can be redeemed through our mobile app only. Download the app to apply your discount and enjoy fresh fish, chicken, and mutton delivered to your doorstep."}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"flex-1 flex items-center justify-center gap-2 bg-black text-white text-sm py-2.5 rounded-lg font-medium hover:bg-gray-900 transition active:scale-[0.98]",children:[(0,t.jsx)(n.FaApple,{size:16}),"iOS"]}),(0,t.jsxs)("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"flex-1 flex items-center justify-center gap-2 bg-green-600 text-white text-sm py-2.5 rounded-lg font-medium hover:bg-green-700 transition active:scale-[0.98]",children:[(0,t.jsx)(n.FaGooglePlay,{size:15}),"Android"]})]})]})})})}e.s(["default",()=>a])},18645,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(92199),i=e.i(22016),n=e.i(11870),a=e.i(4592),o=e.i(82043),l=e.i(25220),c=e.i(54906);function d({count:e,subtotal:r,savings:n,appliedCoupon:a,couponDiscount:o,deliveryFee:l,total:c,onRemoveCoupon:d,onClearCart:u,isClearing:m,clearingDisabled:h,freeDeliveryThreshold:p}){return(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-gray-100 p-4 sticky top-6",children:[(0,t.jsxs)("h2",{className:"text-base font-bold text-gray-900 mb-3 flex items-center gap-2",children:[(0,t.jsx)(s.FiShoppingCart,{size:16,className:"text-primary-500"}),"Order Summary"]}),(0,t.jsxs)("div",{className:"space-y-2 mb-4 pb-4 border-b border-gray-200",children:[(0,t.jsxs)("div",{className:"flex justify-between text-sm text-gray-700",children:[(0,t.jsxs)("span",{children:["Subtotal (",e," items)"]}),(0,t.jsxs)("span",{className:"font-semibold",children:["₹",r.toFixed(0)]})]}),n>0&&(0,t.jsxs)("div",{className:"flex justify-between text-sm text-green-600",children:[(0,t.jsx)("span",{children:"You saved"}),(0,t.jsxs)("span",{className:"font-semibold",children:["-₹",n.toFixed(0)]})]}),a&&o>0&&(0,t.jsx)("div",{className:"bg-primary-50 border border-primary-200 rounded-md p-2 -mx-1",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(s.FiTag,{size:12,className:"text-primary-600"}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("span",{className:"text-xs font-semibold text-primary-700",children:["Coupon: ",a]}),(0,t.jsx)("span",{className:"text-xs text-primary-600",children:"Applied"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"text-sm font-bold text-primary-700",children:["-₹",o.toFixed(0)]}),(0,t.jsx)("button",{onClick:d,className:"p-1 text-primary-600 hover:text-red-500 hover:bg-red-50 rounded transition-all",title:"Remove coupon",children:(0,t.jsx)(s.FiX,{size:14})})]})]})}),(0,t.jsxs)("div",{className:"flex justify-between text-sm text-gray-700",children:[(0,t.jsx)("span",{children:"Delivery fee"}),(0,t.jsx)("span",{className:"font-semibold",children:0===l?(0,t.jsx)("span",{className:"text-green-600",children:"FREE"}):`₹${l.toFixed(0)}`})]}),p&&r<p&&l>0&&(0,t.jsx)("div",{className:"bg-orange-50 border border-orange-200 rounded p-2 mt-2",children:(0,t.jsxs)("p",{className:"text-xs text-orange-700 font-medium",children:["Add ₹",Math.
1ceil(p-r)," more for FREE delivery!"]})})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4 pb-4 border-b border-gray-200",children:[(0,t.jsx)("span",{className:"text-base font-bold text-gray-900",children:"Total"}),(0,t.jsxs)("span",{className:"text-lg font-bold text-primary-600",children:["₹",c.toFixed(0)]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsxs)(i.default,{href:"/customer/checkout",className:"flex items-center justify-center gap-1.5 py-2.5 bg-primary-500 text-white text-center rounded-lg font-semibold text-sm hover:bg-primary-600 transition-all shadow-sm hover:shadow-md",children:["Checkout",(0,t.jsx)(s.FiArrowRight,{size:14})]}),(0,t.jsx)("button",{onClick:u,disabled:h,className:"flex items-center justify-center gap-1.5 py-2.5 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 hover:text-red-500 hover:border-red-300 transition-colors text-sm font-medium disabled:opacity-50 disabled:cursor-not-allowed",children:m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"w-3.5 h-3.5 border-2 border-gray-300 border-t-primary-500 rounded-full animate-spin"}),"Clearing"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.FiTrash2,{size:14}),"Clear"]})})]})]})}var u=e.i(37902),m=e.i(67471);function h({couponCode:e,setCouponCode:n,appliedCoupon:a,coupons:o,loadingCoupons:l,isValidating:c,applyCoupon:d,removeCoupon:h,handleCopyCoupon:p}){let[x,f]=(0,r.useState)(null),[g,y]=(0,r.useState)(!1),b=async e=>{y(!0)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"jsx-1c6e475930a3b77 bg-white rounded-lg shadow-sm border border-gray-100 p-3 mb-4",children:[(0,t.jsxs)("label",{className:"jsx-1c6e475930a3b77 block text-xs font-semibold text-gray-700 mb-2 flex items-center gap-1",children:[(0,t.jsx)(s.FiTag,{size:14,className:"text-primary-500"}),"Have a coupon?"]}),a?(0,t.jsxs)("div",{className:"jsx-1c6e475930a3b77 bg-green-50 border border-green-200 rounded-lg p-2.5 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"jsx-1c6e475930a3b77 flex items-center gap-2",children:[(0,t.jsx)("div",{className:"jsx-1c6e475930a3b77 w-7 h-7 bg-green-100 rounded-full flex items-center justify-center",children:(0,t.jsx)(s.FiTag,{className:"text-green-600",size:14})}),(0,t.jsxs)("div",{className:"jsx-1c6e475930a3b77",children:[(0,t.jsx)("p",{className:"jsx-1c6e475930a3b77 text-sm font-bold text-green-700",children:a}),(0,t.jsx)("p",{className:"jsx-1c6e475930a3b77 text-xs text-green-600",children:"Coupon applied"})]})]}),(0,t.jsx)("button",{onClick:h,title:"Remove coupon",className:"jsx-1c6e475930a3b77 p-1 text-green-600 hover:text-red-500 hover:bg-red-50 rounded transition-all",children:(0,t.jsx)(s.FiX,{size:18})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"jsx-1c6e475930a3b77 flex gap-2 mb-3",children:[(0,t.jsx)("input",{type:"text",value:e,onChange:e=>n(e.target.value),placeholder:"Enter code",onKeyPress:e=>"Enter"===e.key&&d(),className:"jsx-1c6e475930a3b77 flex-1 px-3 py-2 text-sm border border-gray-300 rounded-lg outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-200 transition-all"}),(0,t.jsx)("button",{onClick:()=>{y(!0)},disabled:c||!e.trim(),className:"jsx-1c6e475930a3b77 px-4 py-2 bg-primary-500 text-white rounded-lg font-semibold text-sm hover:bg-primary-600 transition-all disabled:opacity-50 disabled:cursor-not-allowed",children:"Apply"})]}),l?(0,t.jsx)("div",{className:"jsx-1c6e475930a3b77 space-y-2",children:[1,2,3].map(e=>(0,t.jsx)("div",{className:"jsx-1c6e475930a3b77 h-16 bg-gray-100 rounded-lg animate-pulse"},e))}):o.length>0?(0,t.jsxs)("div",{className:"jsx-1c6e475930a3b77",children:[(0,t.jsx)("p",{className:"jsx-1c6e475930a3b77 text-xs font-semibold text-gray-700 mb-2",children:"Available Coupons:"}),(0,t.jsx)("div",{className:"jsx-1c6e475930a3b77 max-h-44 overflow-y-auto pr-1 space-y-2 scrollbar-thin scrollbar-thumb-primary-300 scrollbar-track-primary-100 hover:scrollbar-thumb-primary-400",children:o.map(e=>(0,t.jsx)("div",{className:"jsx-1c6e475930a3b77 border border-gray-200 rounded-lg p-2.5 hover:border-primary-300 hover:bg-primary-50/30 transition-all group",children:(0,t.jsxs)("div",{className:"jsx-1c6e47
15930a3b77 flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"jsx-1c6e475930a3b77 flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"jsx-1c6e475930a3b77 flex items-center gap-2 mb-1",children:[(0,t.jsx)("span",{className:"jsx-1c6e475930a3b77 text-xs font-bold text-primary-600 font-mono bg-primary-50 px-2 py-0.5 rounded",children:e.couponCode}),"percentage"===e.discountType?(0,t.jsxs)("span",{className:"jsx-1c6e475930a3b77 text-xs font-semibold text-green-600",children:[e.discountValue,"% OFF"]}):(0,t.jsxs)("span",{className:"jsx-1c6e475930a3b77 text-xs font-semibold text-green-600",children:["₹",e.discountValue," OFF"]})]}),(0,t.jsx)("p",{className:"jsx-1c6e475930a3b77 text-xs text-gray-600 line-clamp-1",children:e.couponDescription}),e.totalAmount>0&&(0,t.jsxs)("p",{className:"jsx-1c6e475930a3b77 text-xs text-gray-500 mt-1",children:["Min order: ₹",e.totalAmount]})]}),(0,t.jsx)("button",{onClick:()=>b(e.couponCode),className:"jsx-1c6e475930a3b77 flex items-center gap-1 px-2 py-1 text-xs font-semibold text-primary-600 hover:text-white hover:bg-primary-500 border border-primary-300 rounded transition-all whitespace-nowrap",children:x===e.couponCode?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.FiCheck,{size:12}),"Copied"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.FiCopy,{size:12}),"Copy"]})})]})},e.couponId))}),(0,t.jsxs)(i.default,{href:"/coupon",className:"flex items-center justify-center gap-1 text-xs font-semibold text-primary-600 hover:text-primary-700 py-2 mt-2 hover:bg-primary-50 rounded-lg transition-all",children:["View All Coupons",(0,t.jsx)(s.FiChevronRight,{size:14})]})]}):(0,t.jsx)("p",{className:"jsx-1c6e475930a3b77 text-xs text-gray-500 text-center py-2",children:"No coupons available at the moment"})]})]}),(0,t.jsx)(m.default,{isOpen:g,onClose:()=>y(!1),iosLink:"https://apps.apple.com/in/app/fishterianz/id6756230665",androidLink:"https://play.google.com/store/apps/details?id=com.company.fishterianz"}),(0,t.jsx)(u.default,{id:"1c6e475930a3b77",children:".coupon-scroll.jsx-1c6e475930a3b77::-webkit-scrollbar{width:6px}.coupon-scroll.jsx-1c6e475930a3b77::-webkit-scrollbar-track{background:#f1f1f1;border-radius:10px}.coupon-scroll.jsx-1c6e475930a3b77::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:10px}.coupon-scroll.jsx-1c6e475930a3b77.jsx-1c6e475930a3b77::-webkit-scrollbar-thumb:hover{background:#9ca3af}.coupon-scroll.jsx-1c6e475930a3b77{scrollbar-width:thin;scrollbar-color:#d1d5db #f1f1f1}"})]})}var p=e.i(57688),x=e.i(24678),f=e.i(18566);let g=(0,r.memo)(function({item:e,onIncrement:r,onDecrement:i,onRemove:n,loading:a,disabled:o}){let l=e.quantity<=e.minQty,c=e.actualPrice>e.sellingPrice,d=e.sellingPrice*e.quantity,u=e.actualPrice*e.quantity,m=(0,f.useRouter)();return(0,t.jsx)("div",{className:"bg-white rounded-lg p-3 shadow-sm hover:shadow-md transition-all border border-gray-100",children:(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)("div",{className:"relative w-20 h-20 flex-shrink-0 rounded-lg overflow-hidden bg-gray-100",children:e.productImage&&"NA"!==e.productImage?(0,t.jsx)(p.default,{src:(0,x.getImageUrl)(e.productImage),alt:e.productName,fill:!0,className:"object-cover",sizes:"80px",onError:e=>{e.target.src="/assets/images/placeholder-image.png"}}):(0,t.jsx)(p.default,{src:"/assets/images/placeholder-image.png",alt:e.productName,fill:!0,className:"object-cover",sizes:"80px"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-2",children:[(0,t.jsx)("h3",{className:"text-sm font-bold text-gray-900 line-clamp-2 leading-tight cursor-pointer",onClick:()=>m.push(`/product/detail?id=${e.productId}`),children:e.productName}),(0,t.jsx)("button",{onClick:()=>n(e.cartId),disabled:a.remove||o,className:"p-1 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded transition-all disabled:opacity-50 disabled:cursor-not-allowed flex-shrink-0",title:"Remove item",children:a.remove?(0,t.jsx)("div",{className:"w-4 h-4 border-2 border-gray-300 border-t-red-500 rounded-full animate-spin"}):(0,t.jsx)(s.FiTrash2,{size:16})})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 mb-2",children:[(0,t.jsxs)("span",{className:"px-2 py-0.5 bg-primary-100 text-primary-700 text-xs font-semibold rounded",children:[e.quantity," kg"]}),e.cuttingType&&e.cuttingImage&&(0,t.jsxs)("div",{className:"flex items-center gap-1 px-2 py-0.5 bg-gray-100 rounded",children:[(0,t.jsx)("div",{className:"relative w-4 h-4 rounded overflow-hidden",children:(0,t.jsx)(p.default,{src:(0,x.getImageUrl)(e.cuttingImage),alt:e.cuttingType,fill:!0,className:"object-cover",sizes:"16px"})}),(0,t.jsx)("span",{className:"text-xs text-gray-700 font-medium",children:e.cuttingType})]})]}),e.comment&&e.comment.trim()&&(0,t.jsxs)("div",{className:"mb-2 flex items-start gap-1.5 bg-blue-50 border border-blue-200 rounded-lg px-2 py-1.5",children:[(0,t.jsx)(s.FiMessageSquare,{size:12,className:"text-blue-600 mt-0.5 flex-shrink-0"}),(0,t.jsxs)("p",{className:"text-xs text-blue-900 leading-relaxed break-words",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Note: "}),e.comment]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-1.5",children:[(0,t.jsxs)("span",{className:"text-base font-bold text-gray-900",children:["₹",d.toFixed(0)]}),c&&(0,t.jsxs)("span",{className:"text-xs text-gray-400 line-through",children:["₹",u.toFixed(0)]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 bg-gray-50 rounded-lg p-1",children:[(0,t.jsx)("button",{onClick:()=>i(e.cartId,e.minQty,e.quantity),disabled:l||a.decrement||o,className:"w-7 h-7 rounded bg-white border border-gray-200 text-gray-700 hover:bg-gray-100 hover:border-primary-300 hover:text-primary-600 transition-all disabled:opacity-40 disabled:cursor-not-allowed flex items-center justify-center",title:l?`Min ${e.minQty}kg`:"Decrease",children:a.decrement?(0,t.jsx)("div",{className:"w-3 h-3 border-2 border-gray-300 border-t-primary-500 rounded-full animate-spin"}):(0,t.jsx)(s.FiMinus,{size:12})}),(0,t.jsx)("span",{className:"w-8 text-center text-sm font-semibold text-gray-900",children:e.quantity}),(0,t.jsx)("button",{onClick:()=>r(e.cartId),disabled:a.increment||o,className:"w-7 h-7 rounded bg-primary-500 text-white hover:bg-primary-600 transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",title:"Increase",children:a.increment?(0,t.jsx)("div",{className:"w-3 h-3 border-2 border-white border-t-transparent roun
1ded-full animate-spin"}):(0,t.jsx)(s.FiPlus,{size:12})})]})]}),l&&(0,t.jsxs)("p",{className:"text-xs text-orange-600 mt-1.5 font-medium",children:["Minimum order: ",e.minQty," kg"]})]})]})})});var y=e.i(5948),b=e.i(86838);function v(){let{cart:e,count:u,cartLoading:m,localLoading:p,getLocalLoadingKey:x,handleIncrement:f,handleDecrement:v,handleRemoveItem:j,handleClearCart:N,ConfirmationModal:w}=function(){let{user:e}=(0,o.useAuth)(),{cart:s,count:i,loading:n,incrementQuantity:c,decrementQuantity:d,removeItem:u,loadCart:m,clearCart:h}=(0,a.useCart)(),{showSnackbar:p}=(0,l.useSnackbar)(),{confirm:x,ConfirmationModal:f}=function(){let[e,s]=(0,r.useState)(!1),[i,n]=(0,r.useState)({}),[a,o]=(0,r.useState)(null),l=(0,r.useCallback)((e={})=>new Promise(t=>{n(e),o(()=>t),s(!0)}),[]),c=(0,r.useCallback)(()=>{s(!1),a&&a(!0)},[a]),d=(0,r.useCallback)(()=>{s(!1),a&&a(!1)},[a]);return{confirm:l,ConfirmationModal:()=>{if(!e)return null;let r=(i.confirmColor,{bg:"bg-primary-500 hover:bg-primary-600",icon:"bg-primary-100 text-primary-600",ring:"focus:ring-primary-300"});return(0,t.jsx)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"bg-white rounded-xl shadow-2xl w-full max-w-sm transform animate-in zoom-in-95 duration-200",children:[(0,t.jsx)("div",{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:`w-10 h-10 rounded-lg ${r.icon} flex items-center justify-center flex-shrink-0`,children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1-1.964-1-2.732 0L3.732 16c-.77 1.333.192 3 1.732 3z"})})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h3",{className:"text-base font-bold text-gray-900",children:i.title||"Confirm Action"}),(0,t.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:i.message||"Are you sure you want to proceed?"})]})]})}),(0,t.jsxs)("div",{className:"px-4 pb-4 flex items-center gap-2 justify-end",children:[(0,t.jsx)("button",{onClick:d,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 rounded-lg border border-gray-300 transition-colors focus:outline-none focus:ring-2 focus:ring-gray-200",children:i.cancelText||"Cancel"}),(0,t.jsx)("button",{onClick:c,className:`px-4 py-2 text-sm font-semibold text-white rounded-lg transition-colors focus:outline-none focus:ring-2 ${r.bg} ${r.ring}`,children:i.confirmText||"Confirm"})]})]})})}}}(),[g,y]=(0,r.useState)({});(0,r.useEffect)(()=>{e?.customerId&&m(e.customerId)},[e?.customerId,m]);let b=(e,t)=>`${e}-${t}`,v=(0,r.useCallback)(async e=>{let t=b(e,"increment");y(e=>({...e,[t]:!0}));try{await c(e)}catch(e){p("Failed to update quantity","error")}finally{y(e=>({...e,[t]:!1}))}},[c,p]),j=(0,r.useCallback)(async(e,t,r)=>{if(r<=t)return void p(`Minimum quantity is ${t} kg`,"warning");let s=b(e,"decrement");y(e=>({...e,[s]:!0}));try{await d(e)}catch(e){p("Failed to update quantity","error")}finally{y(e=>({...e,[s]:!1}))}},[d,p]),N=(0,r.useCallback)(async e=>{if(!await x({title:"Remove Item",message:"Are you sure you want to remove this item?",confirmText:"Remove",confirmColor:"danger"}))return;let t=b(e,"remove");y(e=>({...e,[t]:!0}));try{await u(e),p("Item removed","success")}catch(e){p("Failed to remove item","error")}finally{y(e=>({...e,[t]:!1}))}},[u,x,p]),w=(0,r.useCallback)(async()=>{if(!await x({title:"Clear Cart",message:`Remove all ${i} items? This cannot be undone.`,confirmText:"Clear All",confirmColor:"danger"}))return!1;y(e=>({...e,clear:!0}));try{return await h(e?.customerId||""),p("Cart cleared","success"),!0}catch(e){return p("Failed to clear cart","error"),!1}finally{y(e=>({...e,clear:!1}))}},[h,e?.customerId,i,x,p]);return{cart:s,count:i,cartLoading:n,localLoading:g,getLocalLoadingKey:b,handleIncrement:v,handleDecrement:j,handleRemoveItem:N,handleClearCart:w,ConfirmationModal:f}}(),C=function({cart:e,onCouponChange:t}){let{user:s}=(0,o.useAuth)(),{showSnackbar:i}=(0,l.useSnackbar)(),[n,a]=(0,r.useState)(""),[c,d]=(0,r.useState)(null),[u,m]=(0,r.useState)(0),[h,p]=(0,r.useState)(null),[x,f]=(0,r.useState)(!1),[g,v]=(0,r.useState)([]),[j,N]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=b.couponHelper.getAppliedCoupon();if(e)try{let t=JSON.parse(e);d(t.couponCode),m(t.discountedAmount),p(t)}catch(e){console.error("Failed to load saved coupon:",e),i("Failed to load saved coupon","error"),b.couponHelper.removeAppliedCoupon()}},[i]),(0,r.useEffect)(()=>{(async()=>{try{N(!0);let e=await (0,y.getCoupon)("General");v(e.slice(0,5))}catch(e){i("Failed to load coupons","error"),console.error("Failed to fetch coupons:",e)}finally{N(!1)}})()},[i]);let w=(0,r.useCallback)(async()=>
1{if(!n.trim())return void i("Please enter a coupon code","error");if(!s?.customerId)return void i("Please login to apply coupon","error");if(0===e.length)return void i("Your cart is empty","error");f(!0);try{let r=e.reduce((e,t)=>e+t.sellingPrice*t.quantity,0),o=e.map(e=>e.productId).join(","),l=[...new Set(e.map(e=>e.categoryId))].join(","),c={customerId:s.customerId,couponCode:n.toUpperCase(),totalOrderAmount:r,productIds:o,categoryIds:l},u=await (0,y.validateCoupon)(c);"success"===u.status?(d(u.couponCode),m(u.discountedAmount),p(u),i(`Coupon applied! ₹${u.discountedAmount.toFixed(0)} off`,"success"),a(""),b.couponHelper.setAppliedCoupon(JSON.stringify(u)),t?.()):i(u.message||"Invalid coupon code","error")}catch(e){i(e?.message||"Failed to validate coupon","error"),console.error("Coupon validation error:",e)}finally{f(!1)}},[n,s,e,i,t]),C=(0,r.useCallback)(()=>{d(null),m(0),p(null),b.couponHelper.removeAppliedCoupon(),t?.()},[t]),S=(0,r.useCallback)(async e=>{try{return await navigator.clipboard.writeText(e),a(e),!0}catch(e){return i("Failed to copy coupon code","error"),!1}},[i]);return{couponCode:n,setCouponCode:a,appliedCoupon:c,couponDiscount:u,validatedCouponData:h,isValidating:x,coupons:g,loadingCoupons:j,applyCoupon:w,removeCoupon:C,handleCopyCoupon:S}}({cart:e}),S=(0,c.useCartCalculations)(e,C.couponDiscount);(0,r.useEffect)(()=>{0===e.length&&C.appliedCoupon&&C.removeCoupon()},[e.length,C.appliedCoupon]);let _=async()=>{await N()&&C.removeCoupon()},F=async t=>{let r=e.length;await j(t),1===r&&C.appliedCoupon&&C.removeCoupon()};return m&&0===e.length?(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-primary-50 via-white to-secondary-50",children:(0,t.jsxs)("div",{className:"text-center p-8",children:[(0,t.jsx)("div",{className:"w-12 h-12 border-4 border-primary-200 border-t-primary-500 rounded-full animate-spin mx-auto mb-4"}),(0,t.jsx)("p",{className:"text-lg font-medium text-gray-600",children:"Loading cart..."})]})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w,{}),(0,t.jsx)(n.default,{children:(0,t.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-primary-50 via-white to-secondary-50 py-6",children:(0,t.jsxs)("div",{className:"container mx-auto px-4 max-w-7xl",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl md:text-3xl font-bold text-gray-900 mb-1",children:"Shopping Cart"}),(0,t.jsxs)("p",{className:"text-sm text-gray-600",children:[u," ",1===u?"item":"items"]})]}),0===e.length?(0,t.jsxs)("div",{className:"bg-white rounded-xl p-8 text-center shadow-lg max-w-md mx-auto",children:[(0,t.jsx)("div",{className:"w-16 h-16 bg-primary-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,t.jsx)(s.FiShoppingBag,{className:"text-primary-500 w-8 h-8"})}),(0,t.jsx)("h2",{className:"text-xl font-bold text-gray-900 mb-2",children:"Your cart is empty"}),(0,t.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:"Add fresh seafood to get started!"}),(0,t.jsxs)(i.default,{href:"/product",className:"inline-flex items-center gap-2 px-6 py-2.5 bg-primary-500 text-white rounded-lg font-semibold hover:bg-primary-600 transition-all",children:["Start Shopping",(0,t.jsx)(s.FiArrowRight,{className:"w-4 h-4"})]})]}):(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[(0,t.jsx)("div",{className:"lg:col-span-2 space-y-3",children:e.map(e=>(0,t.jsx)(g,{item:e,onIncrement:f,onDecrement:v,onRemove:F,loading:{increment:p[x(e.cartId,"increment")]||!1,decrement:p[x(e.cartId,"decrement")]||!1,remove:p[x(e.cartId,"remove")]||!1},disabled:m},e.cartId))}),(0,t.jsxs)("div",{className:"lg:col-span-1",children:[(0,t.jsx)(h,{...C}),(0,t.jsx)(d,{count:u,subtotal:S.subtotal,savings:S.savings,appliedCoupon:C.appliedCoupon,couponDiscount:C.couponDiscount,deliveryFee:S.deliveryFee,total:S.total,onRemoveCoupon:C.removeCoupon,onClearCart:_,isClearing:p.clear||!1,clearingDisabled:p.clear||m,freeDeliveryThreshold:S.freeDeliveryThreshold})]})]})]})})})]})}e.s(["default",()=>v],18645)}]);

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.