1(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[3185],{ 2 3/***/ 38783: 4/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 5 6Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 88003, 23)); 7; 8Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 19177)); 9; 10Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3022)); 11; 12Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2435)); 13; 14Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 26143)); 15; 16Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 49637)); 17; 18Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 68746)); 19; 20Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 46265)); 21; 22Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 40376)); 23; 24Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 72674)); 25; 26Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 74425)); 27; 28Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 14362)); 29; 30Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 32164)); 31; 32Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9277)); 33; 34Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3959)); 35; 36Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 39273, 23)); 37; 38Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 95254, 23)); 39; 40Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 28786, 23)); 41; 42Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 48290, 23)); 43; 44Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 64831, 23)); 45; 46Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 65612, 23)); 47; 48Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 84945, 23)); 49; 50Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 10676, 23)); 51; 52Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 83700, 23)); 53; 54Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 60510, 23)); 55; 56Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8993, 23)); 57; 58Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 26848, 23)); 59; 60Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 40661, 23)); 61; 62Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 13958, 23)); 63; 64Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 74826, 23)); 65; 66Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 12610, 23)); 67; 68Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 56310, 23)); 69; 70Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9783, 23)); 71; 72Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 56962, 23)); 73; 74Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 84798, 23)); 75 76 77/***/ }), 78 79/***/ 30166: 80/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 81 82"use strict"; 83/* harmony export */ __webpack_require__.d(__webpack_exports__, { 84/* harmony export */ "default": function() { return /* reexport default from dynamic */ _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default.a; } 85/* harmony export */ }); 86/* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55775); 87/* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__); 88 89 90 91//# sourceMappingURL=app-dynamic.js.map 92 93/***/ }), 94 95/***/ 55775: 96/***/ (function(module, exports, __webpack_require__) { 97 98"use strict"; 99 100Object.defineProperty(exports, "__esModule", ({ 101 value: true 102})); 103Object.defineProperty(exports, "default", ({ 104 enumerable: true, 105 get: function() { 106 return dynamic; 107 } 108})); 109const _interop_require_default = __webpack_require__(47043); 110const _jsxruntime = __webpack_require__(57437); 111const _react = /*#__PURE__*/ _interop_require_default._(__webpack_require__(2265)); 112const _loadable = /*#__PURE__*/ _interop_require_default._(__webpack_require__(15602)); 113function dynamic(dynamicOptions, options) { 114 var _mergedOptions_loadableGenerated; 115 let loadableOptions = { 116 // A loading component is not required, so we default it 117 loading: (param)=>{ 118 let { error, isLoading, pastDelay } = param; 119 if (!pastDelay) return null; 120 if (false) {} 121 return null; 122 } 123 }; 124 if (typeof dynamicOptions === "function") { 125 loadableOptions.loader = dynamicOptions; 126 } 127 const mergedOptions = { 128 ...loadableOptions, 129 ...options 130 }; 131 return (0, _loadable.default)({ 132 ...mergedOptions, 133 modules: (_mergedOptions_loadableGenerated = mergedOptions.loadableGenerated) == null ? void 0 : _mergedOptions_loadableGenerated.modules 134 }); 135} 136if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { 137 Object.defineProperty(exports.default, "__esModule", { 138 value: true 139 });
140 Object.assign(exports.default, exports); 141 module.exports = exports.default; 142} //# sourceMappingURL=app-dynamic.js.map 143 144 145/***/ }), 146 147/***/ 81523: 148/***/ (function(__unused_webpack_module, exports, __webpack_require__) { 149 150"use strict"; 151/* __next_internal_client_entry_do_not_use__ cjs */ 152Object.defineProperty(exports, "__esModule", ({ 153 value: true 154})); 155Object.defineProperty(exports, "BailoutToCSR", ({ 156 enumerable: true, 157 get: function() { 158 return BailoutToCSR; 159 } 160})); 161const _bailouttocsr = __webpack_require__(18993); 162function BailoutToCSR(param) { 163 let { reason, children } = param; 164 if (typeof window === "undefined") { 165 throw new _bailouttocsr.BailoutToCSRError(reason); 166 } 167 return children; 168} //# sourceMappingURL=dynamic-bailout-to-csr.js.map 169 170 171/***/ }), 172 173/***/ 15602: 174/***/ (function(__unused_webpack_module, exports, __webpack_require__) { 175 176"use strict"; 177 178Object.defineProperty(exports, "__esModule", ({ 179 value: true 180})); 181Object.defineProperty(exports, "default", ({ 182 enumerable: true, 183 get: function() { 184 return _default; 185 } 186})); 187const _jsxruntime = __webpack_require__(57437); 188const _react = __webpack_require__(2265); 189const _dynamicbailouttocsr = __webpack_require__(81523); 190const _preloadcss = __webpack_require__(70049); 191// Normalize loader to return the module as form { default: Component } for `React.lazy`. 192// Also for backward compatible since next/dynamic allows to resolve a component directly with loader 193// Client component reference proxy need to be converted to a module. 194function convertModule(mod) { 195 // Check "default" prop before accessing it, as it could be client reference proxy that could break it reference. 196 // Cases: 197 // mod: { default: Component } 198 // mod: Component 199 // mod: { $$typeof, default: proxy(Component) } 200 // mod: proxy(Component) 201 const hasDefault = mod && "default" in mod; 202 return { 203 default: hasDefault ? mod.default : mod 204 }; 205} 206const defaultOptions = { 207 loader: ()=>Promise.resolve(convertModule(()=>null)), 208 loading: null, 209 ssr: true 210}; 211function Loadable(options) { 212 const opts = { 213 ...defaultOptions, 214 ...options 215 }; 216 const Lazy = /*#__PURE__*/ (0, _react.lazy)(()=>opts.loader().then(convertModule)); 217 const Loading = opts.loading; 218 function LoadableComponent(props) { 219 const fallbackElement = Loading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(Loading, { 220 isLoading: true, 221 pastDelay: true, 222 error: null 223 }) : null; 224 const children = opts.ssr ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, { 225 children: [ 226 typeof window === "undefined" ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_preloadcss.PreloadCss, { 227 moduleIds: opts.modules 228 }) : null, 229 /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { 230 ...props 231 }) 232 ] 233 }) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_dynamicbailouttocsr.BailoutToCSR, { 234 reason: "next/dynamic", 235 children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { 236 ...props 237 }) 238 }); 239 return /*#__PURE__*/ (0, _jsxruntime.jsx)(_react.Suspense, { 240 fallback: fallbackElement, 241 children: children 242 }); 243 } 244 LoadableComponent.displayName = "LoadableComponent"; 245 return LoadableComponent; 246} 247const _default = Loadable; //# sourceMappingURL=loadable.js.map 248 249 250/***/ }), 251 252/***/ 70049: 253/***/ (function(__unused_webpack_module, exports, __webpack_require__) { 254 255"use strict"; 256/* __next_internal_client_entry_do_not_use__ cjs */ 257Object.defineProperty(exports, "__esModule", ({ 258 value: true 259})); 260Object.defineProperty(exports, "PreloadCss", ({ 261 enumerable: true, 262 get: function() { 263 return PreloadCss; 264 } 265})); 266const _jsxruntime = __webpack_require__(57437); 267const _requestasyncstorageexternal = __webpack_require__(20544); 268function PreloadCss(param) { 269 let { moduleIds } = param; 270 // Early return in client compilation and only load requestStore on server side 271 if (typeof window !== "undefined") { 272 return null; 273 } 274 const requestStore = (0, _requestasyncstorageexternal.getExpectedRequestStore)("next/dynamic css"); 275 const allFiles = []; 276 // Search the current dynamic call unique key id in react loadable manifest, 277 // and find the corresponding CSS files to preload 278 if (requestStore.reactLoadableManifest && moduleIds) { 279 const manifest = requestStore.reactLoadableManifest; 280 for (const key of moduleIds){ 281 if (!manifest[key]) continue; 282 const cssFiles = manifest[key].files.filter((file)=>file.endsWith(".css")); 283 allFiles.push(...cssFiles); 284 } 285 } 286 if (allFiles.length === 0) { 287 return null; 288 }
289 return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, { 290 children: allFiles.map((file)=>{ 291 return /*#__PURE__*/ (0, _jsxruntime.jsx)("link", { 292 // @ts-ignore 293 precedence: "dynamic", 294 rel: "stylesheet", 295 href: requestStore.assetPrefix + "/_next/" + encodeURI(file), 296 as: "style" 297 }, file); 298 }) 299 }); 300} //# sourceMappingURL=preload-css.js.map 301 302 303/***/ }), 304 305/***/ 19177: 306/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 307 308"use strict"; 309/* harmony export */ __webpack_require__.d(__webpack_exports__, { 310/* harmony export */ "default": function() { return /* binding */ BackToTop; } 311/* harmony export */ }); 312/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57437); 313/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2265); 314/* __next_internal_client_entry_do_not_use__ default auto */ 315 316function BackToTop() { 317 const [show, setShow] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); 318 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ 319 const container = document.getElementById("middlePage"); 320 const onWindowScroll = ()=>{ 321 setShow(window.scrollY > 200); 322 }; 323 const onContainerScroll = (e)=>{ 324 const target = e.target; 325 setShow(target.scrollTop > 200); 326 }; 327 // Attach listeners 328 window.addEventListener("scroll", onWindowScroll); 329 container === null || container === void 0 ? void 0 : container.addEventListener("scroll", onContainerScroll); 330 return ()=>{ 331 window.removeEventListener("scroll", onWindowScroll); 332 container === null || container === void 0 ? void 0 : container.removeEventListener("scroll", onContainerScroll); 333 }; 334 }, []); 335 const scrollToTop = ()=>{ 336 const container = document.getElementById("middlePage"); 337 if (container && container.scrollTop > 0) { 338 container.scrollTo({ 339 top: 0, 340 behavior: "smooth" 341 }); 342 } else { 343 window.scrollTo({ 344 top: 0, 345 behavior: "smooth" 346 }); 347 } 348 }; 349 return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 350 id: "backToTop", 351 className: "back-to-top ".concat(show ? "show" : ""), 352 onClick: scrollToTop, 353 style: { 354 cursor: "pointer" 355 }, 356 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("i", { 357 className: "fa fa-arrow-up" 358 }) 359 }); 360} 361 362 363/***/ }), 364 365/***/ 3022: 366/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 367 368"use strict"; 369/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57437); 370/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2265); 371/* harmony import */ var _utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32080); 372/* harmony import */ var _hooks_useCategorySettings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(89079); 373/* harmony import */ var _constants_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30949); 374/* __next_internal_client_entry_do_not_use__ default auto */ 375 376 377 378 379const CacheManager = ()=>{ 380 const [cacheInfos, setCacheInfos] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); 381 const [isVisible, setIsVisible] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); 382 const { invalidateCache, clearCache: clearCategoryCache, isCached } = (0,_hooks_useCategorySettings__WEBPACK_IMPORTED_MODULE_3__/* .useCategorySettings */ .H)(); 383 const formatAge = (ageMs)=>{ 384 const seconds = Math.floor(ageMs / 1000); 385 const minutes = Math.floor(seconds / 60); 386 const hours = Math.floor(minutes / 60); 387 if (hours > 0) return "".concat(hours, "h ").concat(minutes % 60, "m"); 388 if (minutes > 0) return "".concat(minutes, "m ").concat(seconds % 60, "s"); 389 return "".concat(seconds, "s"); 390 }; 391 const refreshCacheInfo = ()=>{ 392 const infos = Object.entries(_utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .CACHE_KEYS */ .l6).map((param)=>{ 393 let [name, key] = param; 394 const info = (0,_utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .getCacheInfo */ .Gj)(key); 395 return { 396 key: name, 397 exists: (info === null || info === void 0 ? void 0 : info.exists) || false, 398 expired: (info === null || info === void 0 ? void 0 : info.expired) || false, 399 age: (info === null || info === void 0 ? void 0 : info.age) || 0, 400 ageFormatted: info ? formatAge(info.age) : "0s" 401 }; 402 }); 403 setCacheInfos(infos); 404 }; 405 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ 406 refreshCacheInfo(); 407 const interval = setInterval(refreshCacheInfo, 5000); // Refresh every 5 seconds 408 return ()=>clearInterval(interval); 409 }, []); 410 const handleClearCache = (key)=>{ 411 const cacheKey = _utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .CACHE_KEYS */ .l6[key]; 412 (0,_utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .clearCache */ .LK)(cacheKey); 413 refreshCacheInfo(); 414 }; 415 const handleClearAllCaches = ()=>{ 416 (0,_utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .clearAllCaches */ .YG)(); 417 refreshCacheInfo(); 418 }; 419 const handleInvalidateServerCache = async ()=>{ 420 try { 421 const success = await (0,_utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .invalidateServerCache */ .wM)(_constants_api__WEBPACK_IMPORTED_MODULE_4__/* .API_ENDPOINTS */ .Pn.CATEGORY_SETTING); 422 if (success) { 423 alert("Server cache invalidated successfully"); 424 } else {
425 alert("Failed to invalidate server cache"); 426 } 427 } catch (error) { 428 alert("Error invalidating server cache"); 429 } 430 }; 431 const handleInvalidateCategoryCache = async ()=>{ 432 try { 433 const success = await invalidateCache(); 434 if (success) { 435 alert("Category cache invalidated successfully"); 436 refreshCacheInfo(); 437 } else { 438 alert("Failed to invalidate category cache"); 439 } 440 } catch (error) { 441 alert("Error invalidating category cache"); 442 } 443 }; 444 // Only show in development mode 445 if (true) { 446 return null; 447 } 448 return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 449 style: { 450 position: "fixed", 451 top: "10px", 452 right: "10px", 453 zIndex: 9999, 454 backgroundColor: "white", 455 border: "1px solid #ccc", 456 borderRadius: "8px", 457 boxShadow: "0 2px 10px rgba(0,0,0,0.1)", 458 fontFamily: "monospace", 459 fontSize: "12px" 460 }, 461 children: isVisible && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 462 style: { 463 padding: "12px", 464 minWidth: "300px" 465 }, 466 children: [ 467 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 468 style: { 469 marginBottom: "12px" 470 }, 471 children: [ 472 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("strong", { 473 children: "Cache Status:" 474 }), 475 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 476 style: { 477 fontSize: "11px", 478 color: "#666", 479 marginTop: "4px" 480 }, 481 children: [ 482 "Category Settings: ", 483 isCached ? "\uD83D\uDCE6 Cached" : "\uD83C\uDF10 Fresh" 484 ] 485 }) 486 ] 487 }), 488 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 489 style: { 490 marginBottom: "12px" 491 }, 492 children: [ 493 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("strong", { 494 children: "Client Caches:" 495 }), 496 cacheInfos.map((info)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 497 style: { 498 display: "flex", 499 justifyContent: "space-between", 500 alignItems: "center", 501 padding: "4px 0", 502 borderBottom: "1px solid #eee" 503 }, 504 children: [ 505 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 506 children: [ 507 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 508 style: { 509 fontWeight: "bold" 510 }, 511 children: info.key 512 }), 513 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 514 style: { 515 fontSize: "10px", 516 color: "#666" 517 }, 518 children: info.exists ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { 519 children: [ 520 "Age: ", 521 info.ageFormatted, 522 info.expired && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 523 style: { 524 color: "red" 525 }, 526 children: " (EXPIRED)" 527 }) 528 ] 529 }) : "Not cached" 530 }) 531 ] 532 }), 533 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { 534 onClick: ()=>handleClearCache(info.key), 535 disabled: !info.exists, 536 style: { 537 padding: "2px 6px", 538 fontSize: "10px", 539 border: "1px solid #ccc", 540 borderRadius: "4px", 541 backgroundColor: info.exists ? "#ff6b6b" : "#f5f5f5", 542 color: info.exists ? "white" : "#999", 543 cursor: info.exists ? "pointer" : "not-allowed" 544 }, 545 children: "Clear" 546 }) 547 ] 548 }, info.key)) 549 ] 550 }), 551 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 552 style: { 553 display: "flex", 554 flexDirection: "column",
555 gap: "6px" 556 }, 557 children: [ 558 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { 559 onClick: handleClearAllCaches, 560 style: { 561 padding: "6px 12px", 562 fontSize: "11px", 563 border: "1px solid #ff6b6b", 564 borderRadius: "4px", 565 backgroundColor: "#ff6b6b", 566 color: "white", 567 cursor: "pointer" 568 }, 569 children: "Clear All Client Caches" 570 }), 571 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { 572 onClick: handleInvalidateServerCache, 573 style: { 574 padding: "6px 12px", 575 fontSize: "11px", 576 border: "1px solid #4ecdc4", 577 borderRadius: "4px", 578 backgroundColor: "#4ecdc4", 579 color: "white", 580 cursor: "pointer" 581 }, 582 children: "Invalidate Server Cache" 583 }), 584 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { 585 onClick: handleInvalidateCategoryCache, 586 style: { 587 padding: "6px 12px", 588 fontSize: "11px", 589 border: "1px solid #45b7d1", 590 borderRadius: "4px", 591 backgroundColor: "#45b7d1", 592 color: "white", 593 cursor: "pointer" 594 }, 595 children: "Invalidate Category Cache (Full)" 596 }) 597 ] 598 }), 599 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 600 style: { 601 marginTop: "12px", 602 padding: "8px", 603 backgroundColor: "#f9f9f9", 604 borderRadius: "4px", 605 fontSize: "10px", 606 color: "#666" 607 }, 608 children: [ 609 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("strong", { 610 children: "Legend:" 611 }), 612 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("br", {}), 613 "\uD83D\uDCE6 = Using cached data", 614 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("br", {}), 615 "\uD83C\uDF10 = Fresh from API", 616 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("br", {}), 617 "This panel only appears in development mode." 618 ] 619 }) 620 ] 621 }) 622 }); 623}; 624/* harmony default export */ __webpack_exports__["default"] = (CacheManager); 625 626 627/***/ }), 628 629/***/ 2435: 630/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 631 632"use strict"; 633 634// EXPORTS 635__webpack_require__.d(__webpack_exports__, { 636 "default": function() { return /* binding */ components_ConditionalLayout; } 637}); 638 639// EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/jsx-runtime.js 640var jsx_runtime = __webpack_require__(57437); 641// EXTERNAL MODULE: ./node_modules/next/dist/api/navigation.js 642var navigation = __webpack_require__(99376); 643// EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/index.js 644var react = __webpack_require__(2265); 645// EXTERNAL MODULE: ./node_modules/styled-jsx/style.js 646var style = __webpack_require__(29); 647var style_default = /*#__PURE__*/__webpack_require__.n(style); 648// EXTERNAL MODULE: ./node_modules/next/dist/api/image.js 649var api_image = __webpack_require__(33145); 650// EXTERNAL MODULE: ./src/hooks/useSettings.ts
651var useSettings = __webpack_require__(99230); 652// EXTERNAL MODULE: ./src/hooks/useStockmarketSiteSetting.ts 653var useStockmarketSiteSetting = __webpack_require__(71168); 654// EXTERNAL MODULE: ./src/constants/api.ts 655var api = __webpack_require__(30949); 656// EXTERNAL MODULE: ./node_modules/next/dist/api/link.js 657var api_link = __webpack_require__(27648); 658;// CONCATENATED MODULE: ./src/components/ProfileMenuItems.tsx 659/* __next_internal_client_entry_do_not_use__ default auto */ 660 661 662 663const ProfileMenuItems = (param)=>{ 664 let { onMenuClick } = param; 665 const [menuItems, setMenuItems] = (0,react.useState)([]); 666 const [loading, setLoading] = (0,react.useState)(true); 667 const [error, setError] = (0,react.useState)(null); 668 const [userMobile, setUserMobile] = (0,react.useState)(""); 669 const [isLoggedIn, setIsLoggedIn] = (0,react.useState)(false); 670 const [username, setUsername] = (0,react.useState)(null); 671 const [isProfileOpen, setIsProfileOpen] = (0,react.useState)(false); 672 const [remainingPoints, setRemainingPoints] = (0,react.useState)(0); 673 // Close profile dropdown 674 const closeProfile = ()=>{ 675 setIsProfileOpen(false); 676 }; 677 const handleLogout = ()=>{ 678 //if (confirm('શà«àª તમૠàªàª°à«àªàª° લà«àªàªàªàª àªàª°àªµàª¾ માàªàªà« àªà«?')) { 679 localStorage.removeItem("isLoggedIn"); 680 localStorage.removeItem("userSession"); 681 localStorage.removeItem("bookmarks"); 682 setIsLoggedIn(false); 683 setUsername(null); 684 closeProfile(); // Close profile dropdown 685 // Dispatch auth change event 686 window.dispatchEvent(new CustomEvent("authChange")); 687 window.location.href = "/"; 688 //window.location.reload(); 689 //} 690 }; 691 (0,react.useEffect)(()=>{ 692 const fetchUserPoints = async ()=>{ 693 try { 694 var _userData_userData, _userData_userData1; 695 const userSession = localStorage.getItem("userSession"); 696 if (!userSession) return; 697 const sessionData = JSON.parse(userSession); 698 console.log("User Session Data:", sessionData); 699 // â Always use rawApiResponse for profile & username 700 const userData = sessionData.rawApiResponse || {}; 701 const userId = userData.user_id || userData.id || userData.userId || ((_userData_userData = userData.userData) === null || _userData_userData === void 0 ? void 0 : _userData_userData.user_id) || ((_userData_userData1 = userData.userData) === null || _userData_userData1 === void 0 ? void 0 : _userData_userData1.id); 702 if (!userId) return; 703 const response = await fetch(api/* API_ENDPOINTS */.Pn.USER_GETPOINTS, { 704 method: "POST", 705 cache: "no-store", 706 headers: { 707 "Content-Type": "application/json" 708 }, 709 body: JSON.stringify({ 710 user_id: userId 711 }) 712 }); 713 const data = await response.json(); 714 if (data && data.remaining_points) { 715 setRemainingPoints(data.remaining_points); 716 } 717 } catch (error) { 718 console.error("Error fetching points:", error); 719 } 720 }; 721 fetchUserPoints(); 722 }, []); 723 (0,react.useEffect)(()=>{ 724 // Get user mobile from localStorage 725 if (true) { 726 const mobile = localStorage.getItem("mobile") || ""; 727 setUserMobile(mobile); 728 } 729 const fetchMenuItems = async ()=>{ 730 try { 731 setLoading(true); 732 setError(null); 733 const response = await fetch(api/* API_ENDPOINTS */.Pn.CATEGORY_SETTING, { 734 method: "GET", 735 cache: "no-store", 736 headers: { 737 "Content-Type": "application/json" 738 } 739 }); 740 if (!response.ok) { 741 throw new Error("HTTP error! status: ".concat(response.status)); 742 } 743 const data = await response.json(); 744 if (data && data.sidemenuweb && Array.isArray(data.sidemenuweb)) { 745 // Filter menu items where menuweb_status === 1 746 // const filteredMenus = data.sidemenuweb 747 // .filter((item: MenuItem) => item.menuweb_status === 1) 748 // .sort((a: MenuItem, b: MenuItem) => a.menuorder - b.menuorder); 749 // setMenuItems(filteredMenus); 750 const filteredMenus = data.sidemenuweb.filter((item)=>item.menuweb_status === 1).sort((a, b)=>a.menuorderweb - b.menuorderweb); // â sort by menuorderweb 751 setMenuItems(filteredMenus); 752 } else { 753 console.warn("â ï¸ Menu data is incomplete:", data); 754 setError("Menu data not available"); 755 } 756 } catch (err) { 757 console.error("â Error fetching menu data:", err); 758 setError(err instanceof Error ? err.message : "Failed to load menu"); 759 } finally{
760 setLoading(false); 761 } 762 }; 763 fetchMenuItems(); 764 }, []); 765 // Don't render anything if loading 766 if (loading) { 767 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 768 style: { 769 padding: "20px", 770 textAlign: "center", 771 color: "#666" 772 }, 773 children: [ 774 /*#__PURE__*/ (0,jsx_runtime.jsx)("i", { 775 className: "fa-solid fa-spinner fa-spin" 776 }), 777 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 778 style: { 779 marginLeft: "8px" 780 }, 781 children: "Loading menu..." 782 }) 783 ] 784 }); 785 } 786 // Don't render if error or no menu items 787 if (error || menuItems.length === 0) { 788 return null; 789 } 790 return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { 791 children: [ 792 userMobile && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 793 style: { 794 background: "#f8f9fa", 795 margin: "0 20px 20px 20px", 796 borderRadius: "12px", 797 padding: "16px", 798 display: "flex", 799 alignItems: "center", 800 gap: "12px" 801 }, 802 children: [ 803 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 804 style: { 805 width: "40px", 806 height: "40px", 807 display: "flex", 808 alignItems: "center", 809 justifyContent: "center", 810 backgroundColor: "rgba(217, 185, 99, 0.2)", 811 borderRadius: "50%" 812 }, 813 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { 814 width: "24", 815 height: "24",
816 viewBox: "0 0 24 24", 817 fill: "none", 818 stroke: "#d9b963", 819 strokeWidth: "2", 820 children: [ 821 /*#__PURE__*/ (0,jsx_runtime.jsx)("circle", { 822 cx: "12", 823 cy: "12", 824 r: "10" 825 }), 826 /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { 827 d: "M12 16v-4M12 8h.01" 828 }) 829 ] 830 }) 831 }), 832 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 833 style: { 834 fontSize: "16px", 835 fontWeight: "600", 836 color: "#333", 837 fontFamily: "'Noto Sans Gujarati', sans-serif" 838 }, 839 children: userMobile 840 }) 841 ] 842 }), 843 menuItems.map((item)=>{ 844 const isLogout = item.menuactionweb === "logout"; 845 const isCategory = item.menuactionweb === "myCategory"; 846 const isCity = item.menuactionweb === "myCity"; 847 const isSpecial = isLogout || isCategory || isCity; 848 const openCategoryModal = ()=>{}; 849 const openCityModal = ()=>{}; 850 return /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 851 id: item.menuactionweb || undefined, 852 href: isSpecial ? "/" : "".concat(api/* BASE_URLS */.gm.CURRENT, "/").concat(item.menuactionweb), 853 onClick: (e)=>{ 854 if (isLogout) { 855 e.preventDefault(); 856 handleLogout(); 857 return; 858 } 859 if (isCategory) { 860 e.preventDefault(); 861 openCategoryModal === null || openCategoryModal === void 0 ? void 0 : openCategoryModal(); 862 return; 863 } 864 if (isCity) { 865 e.preventDefault(); 866 openCityModal === null || openCityModal === void 0 ? void 0 : openCityModal(); 867 return; 868 } 869 if (onMenuClick) onMenuClick(); 870 }, 871 children: [ 872 /*#__PURE__*/ (0,jsx_runtime.jsx)("i", { 873 className: "iconBox", 874 children: item.menuicon ? /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { 875 src: item.menuicon, 876 alt: item.menu, 877 style: { 878 width: "32px", 879 height: "32px", 880 objectFit: "contain" 881 } 882 }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { 883 width: "20", 884 height: "20",
885 viewBox: "0 0 24 24", 886 fill: "none", 887 stroke: "currentColor", 888 strokeWidth: "2", 889 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("circle", { 890 cx: "12", 891 cy: "12", 892 r: "10" 893 }) 894 }) 895 }), 896 /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { 897 className: "userNavLable", 898 children: [ 899 item.menu_guj, 900 item.menuactionweb === "userpoint" && /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { 901 children: [ 902 "\xa0\xa0", 903 /*#__PURE__*/ (0,jsx_runtime.jsx)("b", { 904 className: "upText", 905 children: remainingPoints 906 }) 907 ] 908 }) 909 ] 910 }) 911 ] 912 }, item.id); 913 }) 914 ] 915 }); 916}; 917/* harmony default export */ var components_ProfileMenuItems = (ProfileMenuItems); 918 919;// CONCATENATED MODULE: ./src/components/Header.tsx 920/* __next_internal_client_entry_do_not_use__ default auto */ 921 922 923 924 925 926 927 928// import GoogleTranslate from "@/components/GoogleTranslate"; 929 930function resolveUrl(url) { 931 if (!url || url.trim() === "") return "/images/logo.png"; 932 const val = url.trim(); 933 if (val.startsWith("http://") || val.startsWith("https://")) return val; 934 if (val.startsWith("/")) return "".concat(api/* MEDIA_BASE_URL */.uW).concat(val); 935 return "".concat(api/* MEDIA_BASE_URL */.uW, "/").concat(val); 936} 937function Header() { 938 const [isLoggedIn, setIsLoggedIn] = (0,react.useState)(false); 939 const [username, setUsername] = (0,react.useState)("User"); 940 const [userImage, setUserImage] = (0,react.useState)("/images/avatar_male.png"); 941 const [isProfileOpen, setIsProfileOpen] = (0,react.useState)(false); 942 const [breakingNewsData, setBreakingNewsData] = (0,react.useState)(null); 943 const [showBreakingNews, setShowBreakingNews] = (0,react.useState)(false); 944 const { settings } = (0,useSettings/* useSettings */.r)(); 945 const DEFAULT_LOGO = "/assets/images/logo.png"; 946 const [logoImage, setLogoImage] = (0,react.useState)(DEFAULT_LOGO); 947 const { PodcastEnabled } = (0,useStockmarketSiteSetting/* useStockmarketSiteSetting */.l)(); 948 // const logoSrc = resolveUrl(settings?.logo); 949 (0,react.useEffect)(()=>{ 950 const resolvedLogo = resolveUrl(settings === null || settings === void 0 ? void 0 : settings.logo); 951 setLogoImage(resolvedLogo || DEFAULT_LOGO); 952 }, [ 953 settings 954 ]); 955 // Fetch Breaking News 956 (0,react.useEffect)(()=>{ 957 const fetchBreakingNews = async ()=>{ 958 try { 959 const response = await fetch(api/* API_ENDPOINTS */.Pn.BREAKING_NEWS, { 960 method: "GET", 961 cache: "no-store", 962 headers: { 963 "Content-Type": "application/json" 964 } 965 }); 966 if (response.ok) { 967 const data = await response.json(); 968 const hasBreakingNews = data.breakingnews && Array.isArray(data.breakingnews) && data.breakingnews.length > 0; 969 const hasNewsflash = data.newsflash && data.newsflash.trim() !== ""; 970 if (hasBreakingNews || hasNewsflash) { 971 setBreakingNewsData(data); 972 setShowBreakingNews(true); 973 } else { 974 setShowBreakingNews(false); 975 } 976 } 977 } catch (error) { 978 console.error("Error fetching breaking news:", error); 979 } 980 }; 981 fetchBreakingNews(); 982 }, []); 983 // Check Login and Load User Data 984 (0,react.useEffect)(()=>{ 985 const checkLoginStatus = ()=>{ 986 const isUserLoggedIn = localStorage.getItem("isLoggedIn") === "true"; 987 const userSession = localStorage.getItem("userSession"); 988 if (isUserLoggedIn && userSession) { 989 try { 990 const sessionData = JSON.parse(userSession); 991 console.log("User Session Data:", sessionData); 992 // â Always use rawApiResponse for profile & username 993 const userData = sessionData.rawApiResponse || {}; 994 setIsLoggedIn(true); 995 // â Profile Image 996 if (userData.profileImg) { 997 setUserImage(userData.profileImg); // FULL URL â no changes 998 } else { 999 setUserImage("/images/avatar_male.png"); 1000 } 1001 // â Username 1002 if (userData.firstname && userData.lastname) { 1003 setUsername("".concat(userData.firstname, " ").concat(userData.lastname)); 1004 } else if (userData.firstname) { 1005 setUsername(userData.firstname); 1006 } else if (sessionData.mobile) { 1007 setUsername(""); 1008 } else { 1009 setUsername("User"); 1010 } 1011 } catch (error) { 1012 console.error("Error parsing user session:", error); 1013 localStorage.removeItem("isLoggedIn"); 1014 localStorage.removeItem("userSession"); 1015 setIsLoggedIn(false); 1016 setUsername("User"); 1017 setUserImage("/images/avatar_male.png"); 1018 } 1019 } else { 1020 setIsLoggedIn(false); 1021 setUsername("User"); 1022 setUserImage("/images/avatar_male.png"); 1023 } 1024 }; 1025 // â Run immediately on mount 1026 checkLoginStatus(); 1027 // â Listen for login/logout and profile update events 1028 window.addEventListener("storage", checkLoginStatus); 1029 window.addEventListener("authChange", checkLoginStatus); 1030 window.addEventListener("profileUpdated", checkLoginStatus); 1031 return ()=>{ 1032 window.removeEventListener("storage", checkLoginStatus); 1033 window.removeEventListener("authChange", checkLoginStatus); 1034 window.removeEventListener("profileUpdated", checkLoginStatus); 1035 }; 1036 }, []); 1037 // Profile dropdown toggle 1038 const toggleProfile = ()=>setIsProfileOpen(!isProfileOpen); 1039 const closeProfile = ()=>setIsProfileOpen(false); 1040 // Close on outside click or Escape 1041 (0,react.useEffect)(()=>{ 1042 const handleClickOutside = (event)=>{ 1043 const target = event.target; 1044 if (isProfileOpen && !target.closest(".profile-dropdown") && !target.closest(".user-profile-trigger")) { 1045 closeProfile(); 1046 } 1047 }; 1048 const handleEscapeKey = (event)=>{ 1049 if (event.key === "Escape") closeProfile(); 1050 }; 1051 if (isProfileOpen) { 1052 document.addEventListener("mousedown", handleClickOutside); 1053 document.addEventListener("keydown", handleEscapeKey); 1054 document.body.style.overflow = "hidden"; 1055 } 1056 return ()=>{ 1057 document.removeEventListener("mousedown", handleClickOutside); 1058 document.removeEventListener("keydown", handleEscapeKey); 1059 document.body.style.overflow = "unset"; 1060 }; 1061 }, [ 1062 isProfileOpen 1063 ]); 1064 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("nav", { 1065 className: "jsx-200b5d06a146937" + " " + "navbar navbar-expand-lg bg-white fixed-top custom-header", 1066 children: [ 1067 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1068 className: "jsx-200b5d06a146937" + " " + "container-fluid", 1069 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1070 className: "jsx-200b5d06a146937" + " " + "row w-100 align-items-center", 1071 children: [ 1072 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1073 className: "jsx-200b5d06a146937" + " " + "col-lg-2 col-md-2 col-sm-6 col-6 p-0 d-flex align-items-center gap-2", 1074 children: [ 1075 /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { 1076 "aria-label": "Open menu", 1077 onClick: ()=>window.dispatchEvent(new CustomEvent("toggleMobileMenu")), 1078 style: { 1079 background: "none", 1080 border: "none", 1081 outline: "none",
1082 boxShadow: "none", 1083 padding: "4px 6px", 1084 cursor: "pointer", 1085 color: "#333", 1086 fontSize: "22px", 1087 lineHeight: 1, 1088 flexShrink: 0, 1089 WebkitAppearance: "none", 1090 MozAppearance: "none" 1091 }, 1092 className: "jsx-200b5d06a146937" + " " + "hdr-hamburger d-lg-none", 1093 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("i", { 1094 className: "jsx-200b5d06a146937" + " " + "fa-solid fa-bars" 1095 }) 1096 }), 1097 /*#__PURE__*/ (0,jsx_runtime.jsx)(api_link["default"], { 1098 href: "/", 1099 className: "navbar-brand mb-0", 1100 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 1101 src: logoImage, 1102 alt: "GSTV.in", 1103 className: "logo Image-fluid", 1104 width: 120, 1105 height: 25, 1106 priority: true, 1107 unoptimized: true, 1108 onError: ()=>setLogoImage(DEFAULT_LOGO) 1109 }, logoImage) 1110 }) 1111 ] 1112 }), 1113 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1114 className: "jsx-200b5d06a146937" + " " + "col-lg-6 col-md-6 custom-navbar p-0" 1115 }), 1116 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1117 className: "jsx-200b5d06a146937" + " " + "col-lg-4 col-md-4 col-sm-6 col-6 p-0", 1118 children: [ 1119 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1120 className: "jsx-200b5d06a146937" + " " + "custom-navbar", 1121 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1122 className: "jsx-200b5d06a146937" + " " + "navbar-collapse", 1123 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1124 className: "jsx-200b5d06a146937" + " " + "navbar-nav", 1125 children: [ 1126 PodcastEnabled && /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 1127 className: "nav-item nav-link", 1128 href: "/gstv-podcast", 1129 children: [ 1130 /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 1131 src: "/assets/images/ico_pod.svg", 1132 alt: "હà«àª®", 1133 width: 25, 1134 height: 25 1135 }), 1136 /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { 1137 className: "jsx-200b5d06a146937" + " " + "main-header-title custom-gujrati-font", 1138 children: "પà«àª¡àªàª¾àª¸à«àª" 1139 }) 1140 ] 1141 }), 1142 /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 1143 className: "nav-item nav-link", 1144 href: "/search", 1145 children: [ 1146 /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 1147 src: "/assets/images/search_icon.svg", 1148 alt: "વà«àª¬ સà«àªà«àª°à«àª", 1149 width: 25, 1150 height: 25 1151 }), 1152 /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { 1153 className: "jsx-200b5d06a146937" + " " + "main-header-title custom-gujrati-font", 1154 children: "સરà«àª" 1155 }) 1156 ] 1157 }), 1158 /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 1159 className: "nav-item nav-link", 1160 href: "/epaper", 1161 children: [ 1162 /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 1163 src: "/assets/icons/e-news-paper.svg", 1164 alt: "વà«àª¡àª¿àª¯à«", 1165 width: 25, 1166 height: 25 1167 }), 1168 /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { 1169 className: "jsx-200b5d06a146937" + " " + "main-header-title custom-gujrati-font", 1170 children: "àª-પà«àªªàª°" 1171 }) 1172 ] 1173 }), 1174 isLoggedIn ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { 1175 children: [ 1176 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1177 onClick: toggleProfile, 1178 style: { 1179 display: "flex", 1180 alignItems: "center", 1181 gap: "5px", 1182 cursor: "pointer", 1183 borderRadius: "8px", 1184 transition: "background-color 0.2s ease" 1185 }, 1186 onMouseLeave: (e)=>e.currentTarget.style.backgroundColor = "transparent", 1187 className: "jsx-200b5d06a146937" + " " + "user-profile user-profile-trigger", 1188 children: [ 1189 /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 1190 src: userImage, 1191 alt: "User Profile", 1192 className: "user-avatar", 1193 width: 40, 1194 height: 40, 1195 style: { 1196 borderRadius: "50%", 1197 objectFit: "cover", 1198 border: "2px solid #e0e0e0" 1199 }, 1200 onError: (e)=>{ 1201 e.currentTarget.src = "/images/avatar_male.png"; 1202 } 1203 }), 1204 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 1205 className: "jsx-200b5d06a146937" + " " + "userName", 1206 children: username 1207 }), 1208 " ", 1209 /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 1210 src: "/images/arrow-drop1.svg", 1211 alt: "User Profile", 1212 width: 24, 1213 height: 24 1214 }) 1215 ] 1216 }), 1217 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1218 className: "jsx-200b5d06a146937" + " " + "profile-dropdown profileTopBox ".concat(isProfileOpen ? "active" : ""), 1219 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1220 className: "jsx-200b5d06a146937" + " " + "profile-sidebar", 1221 children: [ 1222 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1223 className: "jsx-200b5d06a146937" + " " + "profileTitle", 1224 children: [ 1225 /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { 1226 onClick: closeProfile, 1227 id: "backProfile", 1228 className: "jsx-200b5d06a146937" + " " + "backProfile", 1229 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { 1230 width: "24", 1231 height: "24", 1232 viewB
1232ox: "0 0 24 24", 1233 fill: "none", 1234 stroke: "currentColor", 1235 strokeWidth: "2", 1236 className: "jsx-200b5d06a146937", 1237 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { 1238 d: "M19 12H5M12 19l-7-7 7-7", 1239 className: "jsx-200b5d06a146937" 1240 }) 1241 }) 1242 }), 1243 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1244 className: "jsx-200b5d06a146937" + " " + "title", 1245 children: "મારૠપà«àª°à«àª«àª¾àªàª²" 1246 }) 1247 ] 1248 }), 1249 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1250 className: "jsx-200b5d06a146937" + " " + "userNav", 1251 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(components_ProfileMenuItems, { 1252 onMenuClick: closeProfile 1253 }) 1254 }) 1255 ] 1256 }) 1257 }) 1258 ] 1259 }) : /*#__PURE__*/ (0,jsx_runtime.jsx)(api_link["default"], { 1260 href: "/login", 1261 className: "nav-item nav-link loginclsheader", 1262 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { 1263 className: "jsx-200b5d06a146937" + " " + "btnLogin", 1264 children: [ 1265 /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 1266 src: "/assets/images/user-icon.svg", 1267 className: "user-icon", 1268 alt: "user-icon", 1269 width: 35, 1270 height: 35 1271 }), 1272 " લà«àªàª¿àª¨" 1273 ] 1274 }) 1275 }) 1276 ] 1277 }) 1278 }) 1279 }), 1280 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1281 className: "jsx-200b5d06a146937" + " " + "profile-icons custom-profile-icons", 1282 children: [ 1283 PodcastEnabled && /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 1284 href: "/gstv-podcast", 1285 className: "e-news-paper searchNews mobile-header-menu", 1286 children: [ 1287 /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 1288 src: "/assets/images/ico_pod.svg", 1289 alt: "પà«àª¡àªàª¾àª¸à«àª", 1290 width: 21, 1291 height: 21 1292 }), 1293 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 1294 className: "jsx-200b5d06a146937" + " " + "hrader-title-text", 1295 children: "પà«àª¡àªàª¾àª¸à«àª" 1296 }) 1297 ] 1298 }), 1299 /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 1300 href: "/search", 1301 className: "e-news-paper searchNews mobile-header-menu ", 1302 children: [ 1303 /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 1304 src: "/assets/images/search_icon.svg", 1305 alt: "Search", 1306 width: 21, 1307 height: 21 1308 }), 1309 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 1310 className: "jsx-200b5d06a146937" + " " + "hrader-title-text", 1311 children: "સરà«àª" 1312 }) 1313 ] 1314 }), 1315 /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 1316 href: "/epaper", 1317 className: "e-news-paper epapercls mobiledisplay mobile-header-menu", 1318 children: [ 1319 /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 1320 src: "/assets/icons/e-news-paper.svg", 1321 alt: "E-news-paper", 1322 width: 21, 1323 height: 21 1324 }), 1325 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 1326 className: "jsx-200b5d06a146937" + " " + "hrader-title-text", 1327 children: "àª-પà«àªªàª°" 1328 }) 1329 ] 1330 }), 1331 isLoggedIn ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { 1332 children: [ 1333 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1334 onClick: toggleProfile, 1335 style: { 1336 display: "flex", 1337 alignItems: "center", 1338 gap: "5px", 1339 cursor: "pointer", 1340 borderRadius: "8px", 1341 transition: "background-color 0.2s ease" 1342 }, 1343 onMouseLeave: (e)=>e.currentTarget.style.backgroundColor = "transparent", 1344 className: "jsx-200b5d06a146937" + " " + "user-profile user-profile-trigger ", 1345 children: [ 1346 /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 1347 src: userImage, 1348 alt: "User Profile", 1349 className: "user-avatar", 1350 width: 40, 1351 height: 40, 1352 style: { 1353 borderRadius: "50%", 1354 objectFit: "cover", 1355 border: "2px solid #e0e0e0" 1356 }, 1357 onError: (e)=>{ 1358 e.currentTarget.src = "/images/avatar_male.png"; 1359 } 1360 }), 1361 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 1362 className: "jsx-200b5d06a146937" + " " + "userName", 1363 children: username 1364 }), 1365 " ", 1366 /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 1367 src: "/images/arrow-drop1.svg", 1368 alt: "User Profile", 1369 width: 24, 1370 height: 24 1371 }) 1372 ] 1373 }), 1374 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1375 className: "jsx-200b5d06a146937" + " " + "profile-dropdown profileTopBox ".concat(isProfileOpen ? "active" : ""), 1376 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1377 className: "jsx-200b5d06a146937" + " " + "profile-sidebar", 1378 children: [ 1379 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1380 className: "jsx-200b5d06a146937" + " " + "profileTitle", 1381 children: [ 1382 /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { 1383 onClick: closeProfile, 1384 id: "backProfile", 1385 className: "jsx-200b5d06a146937" + " " + "backProfile", 1386 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { 1387 width: "24", 1388 height: "24", 1389 viewB
1389ox: "0 0 24 24", 1390 fill: "none", 1391 stroke: "currentColor", 1392 strokeWidth: "2", 1393 className: "jsx-200b5d06a146937", 1394 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { 1395 d: "M19 12H5M12 19l-7-7 7-7", 1396 className: "jsx-200b5d06a146937" 1397 }) 1398 }) 1399 }), 1400 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1401 className: "jsx-200b5d06a146937" + " " + "title", 1402 children: "મારૠપà«àª°à«àª«àª¾àªàª²" 1403 }) 1404 ] 1405 }), 1406 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1407 className: "jsx-200b5d06a146937" + " " + "userNav", 1408 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(components_ProfileMenuItems, { 1409 onMenuClick: closeProfile 1410 }) 1411 }) 1412 ] 1413 }) 1414 }) 1415 ] 1416 }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 1417 href: "/login", 1418 className: "btnLogin mobile-header-menu", 1419 children: [ 1420 /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 1421 src: "/assets/images/user-icon.svg", 1422 className: "user-icon", 1423 alt: "user-icon", 1424 width: 35, 1425 height: 35 1426 }), 1427 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 1428 className: "jsx-200b5d06a146937", 1429 children: "લà«àªàª¿àª¨" 1430 }) 1431 ] 1432 }) 1433 ] 1434 }) 1435 ] 1436 }) 1437 ] 1438 }) 1439 }), 1440 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1441 id: "myCityModal", 1442 tabIndex: -1, 1443 "aria-labelledby": "myCityModalLabel", 1444 "aria-hidden": "true", 1445 style: { 1446 backgroundColor: "rgba(0,0,0,0.6)", 1447 zIndex: 1050 1448 }, 1449 className: "jsx-200b5d06a146937" + " " + "modal fade", 1450 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1451 style: { 1452 maxWidth: "900px", 1453 margin: "20px auto" 1454 }, 1455 className: "jsx-200b5d06a146937" + " " + "modal
1455-dialog modal-lg", 1456 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1457 style: { 1458 backgroundColor: "white", 1459 borderRadius: "15px", 1460 border: "none", 1461 boxShadow: "0 10px 30px rgba(0,0,0,0.3)", 1462 overflow: "hidden" 1463 }, 1464 className: "jsx-200b5d06a146937" + " " + "modal-content", 1465 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("form", { 1466 method: "POST", 1467 id: "cityForm", 1468 className: "jsx-200b5d06a146937", 1469 children: [ 1470 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1471 style: { 1472 backgroundColor: "#d4a574", 1473 borderRadius: "15px 15px 0 0", 1474 padding: "20px 30px", 1475 border: "none", 1476 display: "flex", 1477 alignItems: "center", 1478 justifyContent: "space-between" 1479 }, 1480 className: "jsx-200b5d06a146937" + " " + "modal-header", 1481 children: [ 1482 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1483 className: "jsx-200b5d06a146937" + " " + "colTitle", 1484 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("h4", { 1485 style: { 1486 margin: 0, 1487 fontSize: "22px", 1488 fontWeight: "600", 1489 color: "white", 1490 fontFamily: "'Noto Sans Gujarati', sans-serif" 1491 }, 1492 className: "jsx-200b5d06a146937" + " " + "modal-title", 1493 children: "શહà«àª° પસàªàª¦ àªàª°à«" 1494 }) 1495 }), 1496 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1497 style: { 1498 flex: 1, 1499 maxWidth: "400px" 1500 }, 1501 className: "jsx-200b5d06a146937", 1502 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1503 style: { 1504 position: "relative", 1505 margin: "0px 10px" 1506 }, 1507 className: "jsx-200b5d06a146937", 1508 children: [ 1509 /*#__PURE__*/ (0,jsx_runtime.jsx)("input", { 1510 type: "text", 1511 id: "citySearch", 1512 placeholder: "સરà«àª યà«àª° સિàªà«", 1513 style: { 1514 width: "100%", 1515 padding: "12px 45px 12px 20px", 1516 borderRadius: "25px", 1517 border: "none", 1518 fontSize: "16px", 1519 outline: "none", 1520 backgroundColor: "white", 1521 boxShadow: "0 2px 5px rgba(0,0,0,0.1)" 1522 }, 1523 className: "jsx-200b5d06a146937" 1524 }), 1525 /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { 1526 type: "button", 1527 style: { 1528 position: "absolute", 1529 right: "15px", 1530 top: "50%", 1531 transform: "translateY(-50%)", 1532 background: "none", 1533 border: "none", 1534 cursor: "pointer", 1535 padding: "5px" 1536 }, 1537 className: "jsx-200b5d06a146937" + " " + "btnSearch", 1538 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { 1539 width: "20", 1540 height: "20", 1541 viewB
1541ox: "0 0 24 24", 1542 fill: "none", 1543 stroke: "#666", 1544 strokeWidth: "2", 1545 className: "jsx-200b5d06a146937", 1546 children: [ 1547 /*#__PURE__*/ (0,jsx_runtime.jsx)("circle", { 1548 cx: "11", 1549 cy: "11", 1550 r: "8", 1551 className: "jsx-200b5d06a146937" 1552 }), 1553 /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { 1554 d: "m21 21-4.35-4.35", 1555 className: "jsx-200b5d06a146937" 1556 }) 1557 ] 1558 }) 1559 }) 1560 ] 1561 }) 1562 }), 1563 /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { 1564 type: "button", 1565 "data-bs-dismiss": "modal", 1566 "aria-label": "Close", 1567 style: { 1568 background: "white", 1569 borderRadius: "50%", 1570 width: "30px", 1571 height: "30px", 1572 border: "none", 1573 display: "flex", 1574 alignItems: "center", 1575 justifyContent: "center", 1576 cursor: "pointer", 1577 boxShadow: "0 2px 5px rgba(0,0,0,0.2)" 1578 }, 1579 className: "jsx-200b5d06a146937" + " " + "btn-close", 1580 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { 1581 width: "16", 1582 height: "16",
1583 viewBox: "0 0 24 24", 1584 fill: "none", 1585 stroke: "#666", 1586 strokeWidth: "2", 1587 className: "jsx-200b5d06a146937", 1588 children: [ 1589 /*#__PURE__*/ (0,jsx_runtime.jsx)("line", { 1590 x1: "18", 1591 y1: "6", 1592 x2: "6", 1593 y2: "18", 1594 className: "jsx-200b5d06a146937" 1595 }), 1596 /*#__PURE__*/ (0,jsx_runtime.jsx)("line", { 1597 x1: "6", 1598 y1: "6", 1599 x2: "18", 1600 y2: "18", 1601 className: "jsx-200b5d06a146937" 1602 }) 1603 ] 1604 }) 1605 }) 1606 ] 1607 }), 1608 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1609 style: { 1610 padding: "30px 30px", 1611 backgroundColor: "#f8f9fa", 1612 minHeight: "300px" 1613 }, 1614 className: "jsx-200b5d06a146937" + " " + "modal-body", 1615 children: [ 1616 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1617 className: "jsx-200b5d06a146937" + " " + "cityList" 1618 }), 1619 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1620 style: { 1621 display: "none", 1622 textAlign: "center", 1623 padding: "40px", 1624 color: "#666", 1625 fontSize: "18px", 1626 fontFamily: "'Noto Sans Gujarati', sans-serif" 1627 }, 1628 className: "jsx-200b5d06a146937" + " " + "no-results", 1629 children: "શહà«àª° મળà«àª¯à«àª નથà«" 1630 }) 1631 ] 1632 }), 1633 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1634 style: { 1635 padding: "25px 30px", 1636 backgroundColor: "#8B0000", 1637 borderRadius: "0 0 15px 15px", 1638 border: "none", 1639 textAlign: "center" 1640 }, 1641 className: "jsx-200b5d06a146937" + " " + "modal-footer", 1642 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { 1643 type: "button", 1644 id: "btnSubmitCity", 1645 "data-bs-dismiss": "modal", 1646 style: { 1647 backgroundColor: "white", 1648 color: "#8B0000", 1649 border: "none", 1650 padding: "15px 40px", 1651 borderRadius: "25px", 1652 fontSize: "18px", 1653 fontWeight: "600", 1654 cursor: "pointer", 1655 transition: "all 0.3s ease", 1656 fontFamily: "'Noto Sans Gujarati', sans-serif", 1657 minWidth: "200px" 1658 }, 1659 className: "jsx-200b5d06a146937" + " " + "btnSubmitCity", 1660 children: "àªàªàª³ વધ
1660à«" 1661 }) 1662 }) 1663 ] 1664 }) 1665 }) 1666 }) 1667 }), 1668 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1669 id: "myCategoryModal", 1670 tabIndex: -1, 1671 "aria-labelledby": "myCategoryModalLabel", 1672 "aria-hidden": "true", 1673 style: { 1674 backgroundColor: "rgba(0,0,0,0.6)", 1675 zIndex: 1050 1676 }, 1677 className: "jsx-200b5d06a146937" + " " + "modal fade", 1678 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1679 style: { 1680 maxWidth: "900px", 1681 margin: "20px auto" 1682 }, 1683 className: "jsx-200b5d06a146937" + " " + "modal-dialog modal-lg", 1684 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1685 style: { 1686 backgroundColor: "white", 1687 borderRadius: "15px", 1688 border: "none", 1689 boxShadow: "0 10px 30px rgba(0,0,0,0.3)", 1690 overflow: "hidden" 1691 }, 1692 className: "jsx-200b5d06a146937" + " " + "modal-content", 1693 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("form", { 1694 method: "POST", 1695 id: "categoryForm", 1696 className: "jsx-200b5d06a146937", 1697 children: [ 1698 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1699 style: { 1700 backgroundColor: "#b1974f", 1701 borderRadius: "15px 15px 0 0", 1702 padding: "15px", 1703 border: "none", 1704 display: "flex", 1705 alignItems: "center", 1706 justifyContent: "space-between" 1707 }, 1708 className: "jsx-200b5d06a146937" + " " + "modal-header", 1709 children: [ 1710 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1711 style: { 1712 display: "flex", 1713 alignItems: "center", 1714 gap: "10px", 1715 flex: 1 1716 }, 1717 className: "jsx-200b5d06a146937", 1718 children: [ 1719 /*#__PURE__*/ (0,jsx_runtime.jsx)("h4", { 1720 id: "myCategoryModalLabel", 1721 style: { 1722 color: "white", 1723 fontSize: "24px", 1724 fontWeight: "bold", 1725 margin: 0, 1726 fontFamily: '"Hind Vadodara", sans-serif' 1727 }, 1728 className: "jsx-200b5d06a146937" + " " + "modal-title", 1729 children: "àªà«àªà«àªàª°à« પસàªàª¦ àªàª°à«" 1730 }), 1731 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1732 style: { 1733 flex: 1, 1734 maxWidth: "400px" 1735 }, 1736 className: "jsx-200b5d06a146937", 1737 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1738 style: { 1739 position: "relative" 1740 }, 1741 className: "jsx-200b5d06a146937", 1742 children: [ 1743 /*#__PURE__*/ (0,jsx_runtime.jsx)("input", { 1744 type: "text", 1745 id: "categorySearch", 1746 placeholder: "સરà«àª યà«àª° àªà«àªà«àªàª°à«", 1747 style: { 1748 width: "100%", 1749 padding: "12px 45px 12px 20px", 1750 borderRadius: "25px", 1751 border: "none", 1752 fontSize: "16px", 1753 outline: "none", 1754 backgroundColor: "white", 1755 boxShadow: "0 2px 5px rgba(0,0,0,0.1)" 1756 }, 1757 className: "jsx-200b5d06a146937" 1758 }), 1759 /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { 1760 type: "button", 1761 style: { 1762 position: "absolute", 1763 right: "15px", 1764 top: "50%", 1765 transform: "translateY(-50%)", 1766 background: "none", 1767 border: "none", 1768 cursor: "pointer", 1769 padding: "5px" 1770 }, 1771 className: "jsx-200b5d06a146937" + " " + "btnSearch", 1772 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { 1773 width: "20", 1774 height: "20", 1775 viewB
1775ox: "0 0 24 24", 1776 fill: "none", 1777 stroke: "#666", 1778 strokeWidth: "2", 1779 className: "jsx-200b5d06a146937", 1780 children: [ 1781 /*#__PURE__*/ (0,jsx_runtime.jsx)("circle", { 1782 cx: "11", 1783 cy: "11", 1784 r: "8", 1785 className: "jsx-200b5d06a146937" 1786 }), 1787 /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { 1788 d: "m21 21-4.35-4.35", 1789 className: "jsx-200b5d06a146937" 1790 }) 1791 ] 1792 }) 1793 }) 1794 ] 1795 }) 1796 }) 1797 ] 1798 }), 1799 /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { 1800 type: "button", 1801 "data-bs-dismiss": "modal", 1802 "aria-label": "Close", 1803 style: { 1804 background: "white", 1805 borderRadius: "50%", 1806 width: "30px", 1807 height: "30px", 1808 border: "none", 1809 display: "flex", 1810 alignItems: "center", 1811 justifyContent: "center", 1812 cursor: "pointer", 1813 boxShadow: "0 2px 5px rgba(0,0,0,0.2)" 1814 }, 1815 className: "jsx-200b5d06a146937" + " " + "btn-close", 1816 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { 1817 width: "16", 1818 height: "16",
1819 viewBox: "0 0 24 24", 1820 fill: "none", 1821 stroke: "#666", 1822 strokeWidth: "2", 1823 className: "jsx-200b5d06a146937", 1824 children: [ 1825 /*#__PURE__*/ (0,jsx_runtime.jsx)("line", { 1826 x1: "18", 1827 y1: "6", 1828 x2: "6", 1829 y2: "18", 1830 className: "jsx-200b5d06a146937" 1831 }), 1832 /*#__PURE__*/ (0,jsx_runtime.jsx)("line", { 1833 x1: "6", 1834 y1: "6", 1835 x2: "18", 1836 y2: "18", 1837 className: "jsx-200b5d06a146937" 1838 }) 1839 ] 1840 }) 1841 }) 1842 ] 1843 }), 1844 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1845 style: { 1846 padding: "30px 30px 0", 1847 backgroundColor: "white", 1848 overflowY: "auto" 1849 }, 1850 className: "jsx-200b5d06a146937" + " " + "modal-body", 1851 children: [ 1852 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1853 style: { 1854 display: "grid" 1855 }, 1856 className: "jsx-200b5d06a146937" + " " + "categorydataList" 1857 }), 1858 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1859 style: { 1860 display: "none", 1861 textAlign: "center", 1862 padding: "60px 20px", 1863 fontSize: "18px", 1864 color: "#666", 1865 fontFamily: '"Hind Vadodara", sans-serif' 1866 }, 1867 className: "jsx-200b5d06a146937" + " " + "no-resultscat", 1868 children: "àªà«àªà«àªàª°à« મળà«àª¯à«àª નથà«" 1869 }), 1870 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1871 style: { 1872 display: "none", 1873 textAlign: "center", 1874 padding: "60px 20px", 1875 fontSize: "16px", 1876 color: "#999", 1877 fontFamily: '"Hind Vadodara", sans-serif' 1878 }, 1879 className: "jsx-200b5d06a146937" + " " + "loading-categories", 1880 children: [ 1881 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1882 style: { 1883 marginBottom: "15px" 1884 }, 1885 className: "jsx-200b5d06a146937", 1886 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1887 style: { 1888 width: "40px", 1889 height: "40px", 1890 border: "3px solid #f3f3f3", 1891 borderTop: "3px solid #d4a574", 1892 borderRadius: "50%", 1893 animation: "spin 1s linear infinite", 1894 margin: "0 auto" 1895 }, 1896 className: "jsx-200b5d06a146937" 1897 }) 1898 }), 1899 "àªà«àªà«àªàª°à« લà«àª¡ થઠરહૠàªà«..." 1900 ] 1901 }) 1902 ] 1903 }), 1904 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1905 style: { 1906 backgroundColor: "#8B0000", 1907 borderRadius: "0 0 15px 15px", 1908 padding: "20px 30px", 1909 border: "none", 1910 justifyContent: "center", 1911 display: "flex" 1912 }, 1913 className: "jsx-200b5d06a146937" + " " + "modal
1913-footer", 1914 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { 1915 type: "button", 1916 id: "btnSubmitCategory", 1917 "data-bs-dismiss": "modal", 1918 style: { 1919 backgroundColor: "transparent", 1920 color: "white", 1921 border: "2px solid white", 1922 padding: "12px 50px", 1923 borderRadius: "25px", 1924 fontSize: "18px", 1925 fontWeight: "bold", 1926 cursor: "pointer", 1927 fontFamily: '"Hind Vadodara", sans-serif', 1928 transition: "all 0.3s ease", 1929 minWidth: "150px" 1930 }, 1931 className: "jsx-200b5d06a146937" + " " + "btnSubmitCategory", 1932 children: "àªàªàª³ વધ
1932à«" 1933 }) 1934 }) 1935 ] 1936 }) 1937 }) 1938 }) 1939 }), 1940 /*#__PURE__*/ (0,jsx_runtime.jsx)((style_default()), { 1941 id: "200b5d06a146937", 1942 children: ".goog-te-banner-frame,.VIpgJd-ZVi9od-ORHb-OEVmcd{display:none!important;visibility:hidden!important}iframe.goog-te-banner-frame{display:none!important}body{top:0px!important;position:static!important}.goog-logo-link{display:none!important}.goog-te-gadget span{display:none!important}.hdr-hamburger{display:none;background:none!important;border:none!important;outline:none!important;-webkit-box-shadow:none!important;-moz-box-shadow:none!important;box-shadow:none!important;-webkit-appearance:none!important;-moz-appearance:none!important;-ms-appearance:none!important;appearance:none!important;padding:4px 6px;cursor:pointer;color:#333;font-size:22px;line-height:1;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0}.hdr-hamburger:focus,.hdr-hamburger:focus-visible,.hdr-hamburger:active{outline:none!important;-webkit-box-shadow:none!important;-moz-box-shadow:none!important;box-shadow:none!important;border:none!important}@media(max-width:991px){.hdr-hamburger{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center}.mobile-menu-btn{display:none!important}}" 1943 }) 1944 ] 1945 }); 1946} 1947 1948;// CONCATENATED MODULE: ./src/components/Footer.tsx 1949/* __next_internal_client_entry_do_not_use__ default auto */ 1950 1951 1952 1953 1954 1955function Footer() { 1956 const path = (0,navigation.usePathname)(); 1957 const [mounted, setMounted] = (0,react.useState)(false); 1958 (0,react.useEffect)(()=>{ 1959 setMounted(true); 1960 }, []); 1961 const isActive = (route)=>{ 1962 if (!mounted) return false; 1963 return path === route || route === "/" && path === ""; 1964 }; 1965 const liveActive = isActive("/livetv"); 1966 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1967 className: "jsx-f0f7d36ee6742cdf" + " " + "custom-footer", 1968 children: [ 1969 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 1970 className: "jsx-f0f7d36ee6742cdf" + " " + "row footer-menu", 1971 children: [ 1972 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1973 className: "jsx-f0f7d36ee6742cdf" + " " + "col-2 footer-item", 1974 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 1975 href: "/", 1976 className: isActive("/") ? "active" : "", 1977 children: [ 1978 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1979 className: "jsx-f0f7d36ee6742cdf" + " " + "footer-image", 1980 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 1981 src: "/assets/icons/footer-home1.svg", 1982 alt: "Home", 1983 width: 26, 1984 height: 26, 1985 unoptimized: true 1986 }) 1987 }), 1988 /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { 1989 className: "jsx-f0f7d36ee6742cdf" + " " + "footer-link custom-gujrati-font", 1990 children: "હà«àª®" 1991 }) 1992 ] 1993 }) 1994 }), 1995 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 1996 className: "jsx-f0f7d36ee6742cdf" + " " + "col-2 footer-item", 1997 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 1998 href: "/journalist", 1999 className: isActive("/journalist") ? "active" : "", 2000 children: [ 2001 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 2002 className: "jsx-f0f7d36ee6742cdf" + " " + "footer-image", 2003 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 2004 src: "/assets/icons/footer-imjournalist.svg", 2005 alt: "Journalist", 2006 width: 26, 2007 height: 26, 2008 unoptimized: true 2009 }) 2010 }), 2011 /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { 2012 className: "jsx-f0f7d36ee6742cdf" + " " + "footer-link custom-gujrati-font", 2013 children: "àªàª°à«àª¨àª¾àª²àª¿àª¸à«àª" 2014 }) 2015 ] 2016 }) 2017 }), 2018 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 2019 className: "jsx-f0f7d36ee6742cdf" + " " + "col-4 footer-item footer-live-wrap", 2020 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_link["default"], { 2021 href: "/livetv", 2022 className: "footer-live-btn".concat(liveActive ? " active" : ""), 2023 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 2024 className: "jsx-f0f7d36ee6742cdf" + " " + "footer-image", 2025 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 2026 src: "/assets/icons/footer-livetv.svg", 2027 alt: "Journalist", 2028 width: 70, 2029 height: 70, 2030 unoptimized: true 2031 }) 2032 }) 2033 }) 2034 }), 2035 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 2036 className: "jsx-f0f7d36ee6742cdf" + " " + "col-2 footer-item", 2037 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 2038 href: "/epaper", 2039 className: isActive("/epaper") ? "active" : "", 2040 children: [ 2041 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 2042 className: "jsx-f0f7d36ee6742cdf" + " " + "footer-image", 2043 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 2044 src: "/assets/icons/footer-epaper.svg", 2045 alt: "E-Paper", 2046 width: 26, 2047 height: 26, 2048 unoptimized: true 2049 }) 2050 }), 2051 /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { 2052 className: "jsx-f0f7d36ee6742cdf" + " " + "footer-link custom-gujrati-font", 2053 children: "àª-પà«àªªàª°" 2054 }) 2055 ] 2056 }) 2057 }), 2058 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 2059 className: "jsx-f0f7d36ee6742cdf" + " " + "col-2 footer-item", 2060 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 2061 href: "/web-stories", 2062 className: isActive("/web-stories") ? "active" : "", 2063 children: [ 2064 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 2065 className: "jsx-f0f7d36ee6742cdf" + " " + "footer-image", 2066 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 2067 src: "/assets/icons/footer-webstory.svg", 2068 alt: "Stories", 2069 width: 26, 2070 height: 26, 2071 unoptimized: true 2072 }) 2073 }), 2074 /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { 2075 className: "jsx-f0f7d36ee6742cdf" + " " + "footer-link custom-gujrati-font", 2076 children: "સà«àªà«àª°à«àª" 2077 }) 2078 ] 2079 }) 2080 }) 2081 ] 2082 }), 2083 /*#__PURE__*/ (0,jsx_runtime.jsx)((style_default()), { 2084 id: "f0f7d36ee6742cdf", 2085 children: ".footer-item.jsx-f0f7d36ee6742cdf{width:20%;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;
2085-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center}.footer-item.jsx-f0f7d36ee6742cdf a.jsx-f0f7d36ee6742cdf{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;gap:3px;text-decoration:none!important}.footer-live-wrap.jsx-f0f7d36ee6742cdf{margin-top:-24px}.footer-live-btn.jsx-f0f7d36ee6742cdf{display:-webkit-box!important;display:-webkit-flex!important;display:-moz-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-webkit-flex-direction:column!important;-moz-box-orient:vertical!important;-moz-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important;-webkit-box-align:center!important;-webkit-align-items:center!important;-moz-box-align:center!important;-ms-flex-align:center!important;align-items:center!important;-webkit-box-pack:center!important;-webkit-justify-content:center!important;-moz-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important;width:62px;height:62px;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;background:#850E00;-webkit-box-shadow:0 4px 18px rgba(133,14,0,.4);-moz-box-shadow:0 4px 18px rgba(133,14,0,.4);box-shadow:0 4px 18px rgba(133,14,0,.4);border:3px solid#fff;gap:2px!important;padding:6px 4px 4px!important;text-decoration:none!important;-webkit-transition:background.2s,-webkit-transform.15s;-moz-transition:background.2s,-moz-transform.15s;-o-transition:background.2s,-o-transform.15s;transition:background.2s,-webkit-transform.15s;transition:background.2s,-moz-transform.15s;transition:background.2s,-o-transform.15s;transition:background.2s,transform.15s}.footer-live-btn.active.jsx-f0f7d36ee6742cdf,.footer-live-btn.jsx-f0f7d36ee6742cdf:hover{background:#6d0900;-webkit-transform:scale(1.05);-moz-transform:scale(1.05);-ms-transform:scale(1.05);-o-transform:scale(1.05);transform:scale(1.05)}.footer-live-text.jsx-f0f7d36ee6742cdf{font-size:10px;font-weight:800;color:#fff;letter-spacing:.5px;border:1.5px solid#fff;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;padding:0px 4px;line-height:14px;display:block}" 2086 }) 2087 ] 2088 }); 2089} 2090 2091;// CONCATENATED MODULE: ./src/components/AutoScrollToTop.tsx 2092/* __next_internal_client_entry_do_not_use__ default auto */ 2093 2094/** 2095 * AutoScrollToTop Component 2096 * 2097 * Automatically scrolls the page to the top (0, 0) whenever the route changes. 2098 * This ensures that every page loads from the top position, providing a consistent 2099 * user experience across all navigation scenarios. 2100 * 2101 * Features: 2102 * - Scrolls to top on route changes (link clicks, browser navigation, etc.) 2103 * - Works with Next.js App Router 2104 * - Instant scroll behavior (no animation) 2105 * - No visual glitches or delays 2106 * - Handles all browsers and edge cases 2107 * 2108 * Usage: 2109 * Add this component to your root layout or ConditionalLayout component: 2110 * <AutoScrollToTop /> 2111 */ function AutoScrollToTop() { 2112 const pathname = (0,navigation.usePathname)(); 2113 (0,react.useEffect)(()=>{ 2114 // â CRITICAL FIX: Skip auto-scroll for pages with infinite scroll 2115 // These pages handle their own scroll behavior and URL updates 2116 const skipScrollRoutes = [ 2117 "/news/", 2118 "/journalistdetails/", 2119 "/campuscornerdetails/", 2120 "/shorts/" 2121 ]; 2122 // Check if current pathname should skip auto-scroll 2123 const shouldSkipScroll = pathname ? skipScrollRoutes.some((route)=>pathname.includes(route)) : false; 2124 if (shouldSkipScroll) { 2125 console.log("\uD83D\uDCDC AutoScrollToTop: Skipping auto-scroll for infinite scroll page: ".concat(pathname)); 2126 return; 2127 } 2128 // Scroll to top immediately when pathname changes 2129 // Using multiple methods to ensure maximum browser compatibility 2130 // Method 1: window.scrollTo with instant behavior 2131 window.scrollTo({ 2132 top: 0, 2133 left: 0, 2134 behavior: "instant" 2135 }); 2136 // Method 2: Direct property assignment (fallback for older browsers) 2137 window.scrollTo(0, 0); 2138 // Method 3: Ensure document.documentElement is scrolled to top 2139 // This handles edge cases in different browsers 2140 if (document.documentElement) { 2141 document.documentElement.scrollTop = 0; 2142 document.documentElement.scrollLeft = 0; 2143 } 2144 // Method 4: Ensure document.body is scrolled to top 2145 // Additional fallback for maximum compatibility 2146 if (document.body) { 2147 document.body.scrollTop = 0; 2148 document.body.scrollLeft = 0; 2149 } 2150 // Log for debugging (can be removed in production) 2151 console.log("\uD83D\uDCDC AutoScrollToTop: Scrolled to top for route: ".concat(pathname)); 2152 }, [ 2153 pathname 2154 ]); // Re-run whenever the pathname changes 2155 // This component doesn't render anything visible 2156 return null; 2157} 2158 2159;// CONCATENATED MODULE: ./src/components/ConditionalLayout.tsx 2160/* __next_internal_client_entry_do_not_use__ default auto */ 2161 2162 2163 2164 2165 2166const ConditionalLayout = (param)=>{ 2167 let { children } = param; 2168 const pathname = (0,navigation.usePathname)(); 2169 const [mounted, setMounted] = (0,react.useState)(false); 2170 (0,react.useEffect)(()=>{ 2171 setMounted(true); 2172 }, []); 2173 // Check if current page should hide header and footer (full-screen pages) 2174 const shouldHideHeaderFooter = (pathname === null || pathname === void 0 ? void 0 : pathname.startsWith("/videos/")) || (pathname === null || pathname === void 0 ? void 0 : pathname.startsWith("/shorts/")) || pathname === "/login"; 2175 // During SSR and initial hydration, always render the default layout 2176 // This prevents hydration mismatch 2177 if (!mounted) { 2178 return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { 2179 children: [ 2180 /*#__PURE__*/ (0,jsx_runtime.jsx)(AutoScrollToTop, {}), 2181 /*#__PURE__*/ (0,jsx_runtime.jsx)(Header, {}), 2182 children, 2183 /*#__PURE__*/ (0,jsx_runtime.jsx)(Footer, {}) 2184 ] 2185 }); 2186 } 2187 if (shouldHideHeaderFooter) { 2188 // Full-screen layout without header and footer 2189 return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { 2190 children: [ 2191 /*#__PURE__*/ (0,jsx_runtime.jsx)(AutoScrollToTop, {}), 2192 children 2193 ] 2194 }); 2195 } 2196 // Default layout with header and footer 2197 return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { 2198 children: [ 2199 /*#__PURE__*/ (0,jsx_runtime.jsx)(AutoScrollToTop, {}), 2200 /*#__PURE__*/ (0,jsx_runtime.jsx)(Header, {}), 2201 children, 2202 /*#__PURE__*/ (0,jsx_runtime.jsx)(Footer, {}) 2203 ] 2204 }); 2205}; 2206/* harmony default export */ var components_ConditionalLayout = (ConditionalLayout); 2207 2208
2209/***/ }), 2210 2211/***/ 26143: 2212/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 2213 2214"use strict"; 2215/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2216/* harmony export */ "default": function() { return /* binding */ CookieConsentBanner; } 2217/* harmony export */ }); 2218/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57437); 2219/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2265); 2220/* harmony import */ var _styles_CookieConsentBanner_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12610); 2221/* harmony import */ var _styles_CookieConsentBanner_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_styles_CookieConsentBanner_css__WEBPACK_IMPORTED_MODULE_2__); 2222/* __next_internal_client_entry_do_not_use__ default auto */ 2223 2224 2225function CookieConsentBanner() { 2226 const [showBanner, setShowBanner] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); 2227 const [showSettings, setShowSettings] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); 2228 const [preferences, setPreferences] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ 2229 essential: true, 2230 analytics: true, 2231 marketing: true, 2232 personalization: true 2233 }); 2234 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ 2235 // Check if user has already given consent 2236 const saved = localStorage.getItem("cookieConsent"); 2237 if (!saved) { 2238 setShowBanner(true); 2239 } else { 2240 try { 2241 const savedPrefs = JSON.parse(saved); 2242 setPreferences(savedPrefs); 2243 } catch (e) { 2244 setShowBanner(true); 2245 } 2246 } 2247 }, []); 2248 const saveCookieConsent = (prefs)=>{ 2249 localStorage.setItem("cookieConsent", JSON.stringify(prefs)); 2250 localStorage.setItem("cookieConsentTime", new Date().toISOString()); 2251 setPreferences(prefs); 2252 setShowBanner(false); 2253 setShowSettings(false); 2254 // Trigger analytics if enabled 2255 if (prefs.analytics && window.gtag) { 2256 window.gtag("consent", "update", { 2257 "analytics_storage": prefs.analytics ? "granted" : "denied" 2258 }); 2259 } 2260 }; 2261 const handleAcceptAll = ()=>{ 2262 const allAccepted = { 2263 essential: true, 2264 analytics: true, 2265 marketing: true, 2266 personalization: true 2267 }; 2268 saveCookieConsent(allAccepted); 2269 }; 2270 const handleRejectAll = ()=>{ 2271 const onlyEssential = { 2272 essential: true, 2273 analytics: false, 2274 marketing: false, 2275 personalization: false 2276 }; 2277 saveCookieConsent(onlyEssential); 2278 }; 2279 const handleSavePreferences = ()=>{ 2280 saveCookieConsent(preferences); 2281 }; 2282 const togglePreference = (key)=>{ 2283 if (key === "essential") return; // Essential cannot be toggled 2284 setPreferences((prev)=>({ 2285 ...prev, 2286 [key]: !prev[key] 2287 })); 2288 }; 2289 if (!showBanner) return null; 2290 return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { 2291 children: [ 2292 !showSettings && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 2293 className: "cookie-consent-banner", 2294 role: "dialog", 2295 "aria-label": "Cookie Consent", 2296 children: [ 2297 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 2298 className: "cookie-banner-content", 2299 children: [ 2300 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 2301 className: "cookie-banner-text", 2302 children: [ 2303 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { 2304 children: "\uD83C\uDF6A Cookie Policy" 2305 }), 2306 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { 2307 children: [ 2308 "We use cookies to enhance your experience, analyze traffic, and serve personalized content. By accepting, you agree to our use of cookies as described
2308in our", 2309 " ", 2310 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { 2311 href: "/cookie-policy", 2312 target: "_blank", 2313 rel: "noopener noreferrer", 2314 children: "Cookie Policy" 2315 }), 2316 "." 2317 ] 2318 }) 2319 ] 2320 }), 2321 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 2322 className: "cookie-banner-buttons", 2323 children: [ 2324 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { 2325 className: "cookie-btn cookie-btn-accept", 2326 onClick: handleAcceptAll, 2327 "aria-label": "Accept all cookies", 2328 children: "Accept All" 2329 }), 2330 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { 2331 className: "cookie-btn cookie-btn-settings", 2332 onClick: ()=>setShowSettings(true), 2333 "aria-label": "Customize cookie settings", 2334 children: "Customize" 2335 }), 2336 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { 2337 className: "cookie-btn cookie-btn-reject", 2338 onClick: handleRejectAll, 2339 "aria-label": "Reject non-essential cookies", 2340 children: "Reject All" 2341 }) 2342 ] 2343 }) 2344 ] 2345 }), 2346 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { 2347 className: "cookie-banner-close", 2348 onClick: handleRejectAll, 2349 "aria-label": "Close cookie banner", 2350 title: "Close (Reject All)", 2351 children: "\xd7" 2352 }) 2353 ] 2354 }), 2355 showSettings && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
2356 className: "cookie-settings-modal", 2357 role: "dialog", 2358 "aria-label": "Cookie Settings", 2359 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 2360 className: "cookie-settings-content", 2361 children: [ 2362 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 2363 className: "cookie-settings-header", 2364 children: [ 2365 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { 2366 children: "Cookie Settings" 2367 }), 2368 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { 2369 className: "cookie-settings-close", 2370 onClick: ()=>setShowSettings(false), 2371 "aria-label": "Close settings", 2372 children: "\xd7" 2373 }) 2374 ] 2375 }), 2376 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
2377 className: "cookie-settings-body", 2378 children: [ 2379 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { 2380 className: "cookie-settings-intro", 2381 children: "Manage your cookie preferences below. Essential cookies cannot be disabled as they are required for the website to function properly." 2382 }), 2383 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 2384 className: "cookie-category", 2385 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 2386 className: "cookie-category-header", 2387 children: [ 2388 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 2389 className: "cookie-category-info", 2390 children: [ 2391 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { 2392 children: "\uD83D\uDD12 Essential Cookies" 2393 }), 2394 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { 2395 className: "cookie-category-desc", 2396 children: "Required for website functionality, security, and compliance. These cannot be disabled." 2397 }) 2398 ] 2399 }), 2400 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { 2401 className: "cookie-toggle disabled", 2402 children: [ 2403 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { 2404 type: "checkbox", 2405 checked: preferences.essential, 2406 disabled: true, 2407 "aria-label": "Essential cookies (always enabled)" 2408 }), 2409 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 2410 className: "toggle-switch" 2411 }) 2412 ] 2413 }) 2414 ] 2415 }) 2416 }), 2417 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 2418 className: "cookie-category", 2419 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 2420 className: "cookie-category-header", 2421 children: [ 2422 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 2423 className: "cookie-category-info", 2424 children: [ 2425 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { 2426 children: "\uD83D\uDCCA Analytics Co
2426okies" 2427 }), 2428 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { 2429 className: "cookie-category-desc", 2430 children: "Help us understand how visitors interact with our website to improve user experience." 2431 }) 2432 ] 2433 }), 2434 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { 2435 className: "cookie-toggle", 2436 children: [ 2437 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { 2438 type: "checkbox", 2439 checked: preferences.analytics, 2440 onChange: ()=>togglePreference("analytics"), 2441 "aria-label": "Analytics cookies" 2442 }), 2443 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 2444 className: "toggle-switch" 2445 }) 2446 ] 2447 }) 2448 ] 2449 }) 2450 }), 2451 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 2452 className: "cookie-category", 2453 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 2454 className: "cookie-category-header", 2455 children: [ 2456 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 2457 className: "cookie-category-info", 2458 children: [ 2459 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { 2460 children: "\uD83D\uDCE2 Marketing Cookies" 2461 }), 2462 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { 2463 className: "cookie-category-desc", 2464 children: "Used to track visitors and display personalized advertisements from our partners." 2465 }) 2466 ] 2467 }), 2468 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { 2469 className: "cookie-toggle", 2470 children: [ 2471 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { 2472 type: "checkbox", 2473 checked: preferences.marketing, 2474 onChange: ()=>togglePreference("marketing"), 2475 "aria-label": "Marketing cookies" 2476 }), 2477 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 2478 className: "toggle-switch" 2479 }) 2480 ] 2481 }) 2482 ] 2483 }) 2484 }), 2485 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 2486 className: "cookie-category", 2487 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 2488 className: "cookie-category-header", 2489 children: [ 2490 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 2491 className: "cookie-category-info", 2492 children: [ 2493 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { 2494 children: "â Personalization Cookies" 2495 }), 2496 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { 2497 className: "cookie-category-desc", 2498 children: "Remember your preferences and customize content based on your interests." 2499 }) 2500 ] 2501 }), 2502 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { 2503 className: "cookie-toggle", 2504 children: [ 2505 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { 2506 type: "checkbox", 2507 checked: preferences.personalization, 2508 onChange: ()=>togglePreference("personalization"), 2509 "aria-label": "Personalization cookies" 2510 }), 2511 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 2512 className: "toggle-switch" 2513 }) 2514 ] 2515 }) 2516 ] 2517 }) 2518 }) 2519 ] 2520 }), 2521 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
2522 className: "cookie-settings-footer", 2523 children: [ 2524 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { 2525 className: "cookie-btn cookie-btn-secondary", 2526 onClick: handleRejectAll, 2527 children: "Reject All" 2528 }), 2529 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { 2530 className: "cookie-btn cookie-btn-accept", 2531 onClick: handleSavePreferences, 2532 children: "Save Preferences" 2533 }) 2534 ] 2535 }), 2536 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 2537 className: "cookie-settings-links", 2538 children: [ 2539 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { 2540 href: "/privacy-policy", 2541 target: "_blank", 2542 rel: "noopener noreferrer", 2543 children: "Privacy Policy" 2544 }), 2545 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 2546 className: "separator", 2547 children: "â¢" 2548 }), 2549 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { 2550 href: "/cookie-policy", 2551 target: "_blank", 2552 rel: "noopener noreferrer", 2553 children: "Cookie Policy" 2554 }), 2555 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 2556 className: "separator", 2557 children: "â¢" 2558 }), 2559 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { 2560 href: "/terms-condition", 2561 target: "_blank", 2562 rel: "noopener noreferrer", 2563 children: "Terms of Service" 2564 }) 2565 ] 2566 }) 2567 ] 2568 }) 2569 }), 2570 showSettings && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 2571 className: "cookie-modal-backdrop", 2572 onClick: ()=>setShowSettings(false), 2573 "aria-hidden": "true" 2574 }) 2575 ] 2576 }); 2577} 2578 2579 2580/***/ }), 2581 2582/***/ 49637: 2583/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 2584 2585"use strict"; 2586/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2587/* harmony export */ "default": function() { return /* binding */ GoogleAnalyticsTracker; } 2588/* harmony export */ }); 2589/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57437); 2590/* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99376); 2591/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2265); 2592/* __next_internal_client_entry_do_not_use__ default auto */ 2593 2594 2595function GoogleAnalyticsTrackerContent() { 2596 const pathname = (0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.usePathname)(); 2597 const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useSearchParams)(); 2598 const lastTracked = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(""); 2599 (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{ 2600 if (!window.gtag) return; 2601 const url = pathname + ((searchParams === null || searchParams === void 0 ? void 0 : searchParams.toString()) ? "?".concat(searchParams) : ""); 2602 // â Prevent duplicate (STRICT MODE + hydration) 2603 if (lastTracked.current === url) return; 2604 lastTracked.current = url; 2605 // â Use EVENT instead of CONFIG (important fix) 2606 window.gtag("event", "page_view", { 2607 page_path: url, 2608 page_location: window.location.href, 2609 page_title: document.title 2610 }); 2611 }, [ 2612 pathname, 2613 searchParams 2614 ]); 2615 return null; 2616} 2617function GoogleAnalyticsTracker() { 2618 return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_2__.Suspense, { 2619 fallback: null, 2620 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(GoogleAnalyticsTrackerContent, {}) 2621 }); 2622} 2623 2624 2625/***/ }), 2626 2627/***/ 68746: 2628/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 2629 2630"use strict"; 2631 2632// EXPORTS 2633__webpack_require__.d(__webpack_exports__, { 2634 "default": function() { return /* binding */ components_LayoutWrapper; } 2635}); 2636 2637// EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/jsx-runtime.js 2638var jsx_runtime = __webpack_require__(57437); 2639// EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/index.js 2640var react = __webpack_require__(2265); 2641// EXTERNAL MODULE: ./node_modules/next/dist/api/navigation.js 2642var navigation = __webpack_require__(99376); 2643;// CONCATENATED MODULE: ./src/components/AdSlot.tsx 2644/* __next_internal_client_entry_do_not_use__ default auto */ 2645 2646// â Reserve ad space to prevent CLS â each slot has a known size 2647const AD_SLOT_MIN_HEIGHTS = { 2648 gstvin_top: 0,
2649 gstvin_footer: 90, 2650 gstvin_sidebar: 250, 2651 gstvin_inarticle1: 250, 2652 gstvin_inarticle2: 250 2653}; 2654const AdSlot = (param)=>{ 2655 let { slotId, className = "" } = param; 2656 const adRef = (0,react.useRef)(null); 2657 const displayedRef = (0,react.useRef)(false); 2658 const [mounted, setMounted] = (0,react.useState)(false); 2659 const [adFilled, setAdFilled] = (0,react.useState)(false); 2660 var _AD_SLOT_MIN_HEIGHTS_slotId; 2661 const minHeight = (_AD_SLOT_MIN_HEIGHTS_slotId = AD_SLOT_MIN_HEIGHTS[slotId]) !== null && _AD_SLOT_MIN_HEIGHTS_slotId !== void 0 ? _AD_SLOT_MIN_HEIGHTS_slotId : 90; 2662 // 1ï¸â£ Block SSR output 2663 (0,react.useEffect)(()=>{ 2664 setMounted(true); 2665 }, []); 2666 // 2ï¸â£ Run GPT only AFTER mount 2667 (0,react.useEffect)(()=>{ 2668 var _window_googletag; 2669 if (mounted && !displayedRef.current && ((_window_googletag = window.googletag) === null || _window_googletag === void 0 ? void 0 : _window_googletag.cmd)) { 2670 window.googletag.cmd.push(()=>{ 2671 window.googletag.display(slotId); 2672 // â Listen for slot render to know if ad filled 2673 window.googletag.pubads().addEventListener("slotRenderEnded", (event)=>{ 2674 if (event.slot.getSlotElementId() === slotId) { 2675 setAdFilled(!event.isEmpty); 2676 } 2677 }); 2678 }); 2679 displayedRef.current = true; 2680 } 2681 }, [ 2682 mounted, 2683 slotId 2684 ]); 2685 // ð¥ CRITICAL LINE 2686 if (!mounted) return null; 2687 return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 2688 className: "text-center pb-2 ".concat(className), 2689 // â Reserve minimum height before ad loads â prevents CLS 2690 style: !adFilled ? { 2691 minHeight: "".concat(minHeight, "px") 2692 } : undefined, 2693 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 2694 id: slotId, 2695 ref: adRef 2696 }) 2697 }); 2698}; 2699/* harmony default export */ var components_AdSlot = (AdSlot); 2700 2701// EXTERNAL MODULE: ./node_modules/next/dist/api/link.js 2702var api_link = __webpack_require__(27648); 2703;// CONCATENATED MODULE: ./src/components/ProFooter.tsx 2704/* __next_internal_client_entry_do_not_use__ default auto */ 2705 2706function ProFooter() { 2707 return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 2708 id: "footerMiddle", 2709 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 2710 className: "row align-items-center", 2711 children: [ 2712 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 2713 className: "col-lg-6 d-flex justify-content-lg-start justify-content-center", 2714 children: [ 2715 "\xa9 Copyright ", 2716 new Date().getFullYear(), 2717 " | GSTV. All rights reserved." 2718 ] 2719 }), 2720 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 2721 className: "col-lg-6 d-flex justify-content-lg-end justify-content-center", 2722 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("ul", { 2723 className: "custom-address-list", 2724 children: [ 2725 /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { 2726 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_link["default"], { 2727 href: "/career", 2728 children: "Career" 2729 }) 2730 }), 2731 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 2732 children: "|" 2733 }), 2734 /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { 2735 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_link["default"], { 2736 href: "/contact-us", 2737 children: "Contact us" 2738 }) 2739 }), 2740 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 2741 children: "|" 2742 }), 2743 /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { 2744 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_link["default"], { 2745 href: "/cookie-policy", 2746 children: "Cookie policy" 2747 }) 2748 }), 2749 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 2750 children: "|" 2751 }), 2752 /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { 2753 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_link["default"], { 2754 href: "/privacy-policy", 2755 children: "Privacy policy" 2756 }) 2757 }), 2758 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 2759 children: "|" 2760 }), 2761 /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { 2762 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_link["default"], { 2763 href: "/refund-policy", 2764 children: "Refund policy" 2765 }) 2766 }), 2767 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 2768 children: "|" 2769 }), 2770 /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { 2771 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_link["default"], { 2772 href: "/terms-condition", 2773 children: "Terms & condition" 2774 }) 2775 }) 2776 ] 2777 }) 2778 }) 2779 ] 2780 }) 2781 }); 2782} 2783 2784// EXTERNAL MODULE: ./src/components/RightSidebar.tsx 2785var RightSidebar = __webpack_require__(74425); 2786;// CONCATENATED MODULE: ./src/components/LayoutWrapper.tsx 2787/* __next_internal_client_entry_do_not_use__ default auto */ 2788 2789 2790 2791 2792 2793const LayoutWrapper = (param)=>{ 2794 let { children } = param; 2795 const pathname = (0,navigation.usePathname)(); 2796 const [isMobile, setIsMobile] = (0,react.useState)(false); 2797 const [isMounted, setIsMounted] = (0,react.useState)(false); 2798 // Check if current page should hide sidebars 2799 const shouldHideSidebars = (pathname === null || pathname === void 0 ? void 0 : pathname.startsWith("/epaper")) || (pathname === null || pathname === void 0 ? void 0 : pathname.startsWith("/review")) || (pathname === null || pathname === void 0 ? void 0 : pathname.startsWith("/payment")) || (pathname === null || pathname === void 0 ? void 0 : pathname.startsWith("/magazine")) || (pathname === null || pathname === void 0 ? void 0 : pathname.startsWith("/buddhiprakash")) || (pathname === null || pathname === void 0 ? void 0 : pathname.startsWith("/videos/")) || pathname === "/login" || pathname === "/
2799profile" || pathname === "/bookmarklist" || pathname === "/userpoint" || pathname === "/addekasana" || pathname === "/addjournalist" || pathname === "/addcampuscorner" || pathname === "/addganapati" || pathname === "/getcampuscorner" || pathname === "/getganapati" || pathname === "/getjournalist" || (pathname === null || pathname === void 0 ? void 0 : pathname.startsWith("/getekasana")) || pathname === "/career"; 2800 // Extract the actual page content (last child) 2801 const childrenArray = react.Children.toArray(children); 2802 const leftSidebar = childrenArray[0]; 2803 const rightSidebar = childrenArray[1]; 2804 const pageContent = childrenArray[2]; 2805 // Fix hydration error - check mobile on client side only 2806 (0,react.useEffect)(()=>{ 2807 setIsMounted(true); 2808 setIsMobile(window.innerWidth <= 768); 2809 const handleResize = ()=>{ 2810 setIsMobile(window.innerWidth <= 768); 2811 }; 2812 window.addEventListener("resize", handleResize); 2813 return ()=>window.removeEventListener("resize", handleResize); 2814 }, []); 2815 const showRightSidebar = !shouldHideSidebars && !isMobile; 2816 if (shouldHideSidebars) { 2817 // Check if it's a video detail page for full-screen layout 2818 if (pathname === null || pathname === void 0 ? void 0 : pathname.startsWith("/videos/")) { 2819 // Full-screen video layout 2820 return /*#__PURE__*/ (0,jsx_runtime.jsx)(jsx_runtime.Fragment, { 2821 children: pageContent 2822 }); 2823 //return <>{pageContent}</>; 2824 } 2825 // Check if it's login page for full-screen centered layout 2826 if (pathname === "/login") { 2827 return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { 2828 children: [ 2829 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2830 slotId: "gstvin_top" 2831 }), 2832 pageContent, 2833 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2834 slotId: "gstvin_footer" 2835 }) 2836 ] 2837 }); 2838 //return <>{pageContent}</>; 2839 } 2840 // Check if it's profile page for full-width layout (with header) 2841 if (pathname === "/profile") { 2842 // Profile page layout - full width without sidebars but with header space 2843 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 2844 className: "contents-main-div", 2845 id: "middlePage", 2846 children: [ 2847 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2848 slotId: "gstvin_top" 2849 }), 2850 pageContent, 2851 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2852 slotId: "gstvin_footer" 2853 }), 2854 /*#__PURE__*/ (0,jsx_runtime.jsx)(ProFooter, {}) 2855 ] 2856 }); 2857 } 2858 // Check if it's career page for full-width layout (with header) 2859 if (pathname === "/career") { 2860 // Career page layout - full width without sidebars but with header space 2861 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 2862 className: "contents-main-div career-layout", 2863 id: "middlePage", 2864 children: [ 2865 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2866 slotId: "gstvin_top" 2867 }), 2868 pageContent, 2869 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2870 slotId: "gstvin_footer" 2871 }), 2872 /*#__PURE__*/ (0,jsx_runtime.jsx)(ProFooter, {}) 2873 ] 2874 }); 2875 } 2876 // Check if it's bookmarklist page for full-width layout (with header) 2877 if (pathname === "/bookmarklist") { 2878 // Bookmarklist page layout - full width without sidebars but with header space 2879 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 2880 className: "contents-main-div bookmarklist-layout", 2881 id: "middlePage", 2882 children: [ 2883 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2884 slotId: "gstvin_top" 2885 }), 2886 pageContent, 2887 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2888 slotId: "gstvin_footer" 2889 }), 2890 /*#__PURE__*/ (0,jsx_runtime.jsx)(ProFooter, {}) 2891 ] 2892 }); 2893 } 2894 // Check if it's userpoint page for full-width layout (with header) 2895 if (pathname === "/userpoint") { 2896 // Userpoint page layout - full width without sidebars but with header space 2897 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 2898 className: "contents-main-div userpoint-layout", 2899 id: "middlePage", 2900 children: [ 2901 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2902 slotId: "gstvin_top" 2903 }), 2904 pageContent, 2905 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2906 slotId: "gstvin_footer" 2907 }), 2908 /*#__PURE__*/ (0,jsx_runtime.jsx)(ProFooter, {}) 2909 ] 2910 }); 2911 } 2912 // Check if it's addekasana page for full-width layout (with header) 2913 if (pathname === "/addekasana") { 2914 // Addekasana page layout - full width without sidebars but with header space 2915 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 2916 className: "contents-main-div addekasana-layout", 2917 id: "middlePage", 2918 children: [ 2919 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2920 slotId: "gstvin_top" 2921 }), 2922 pageContent, 2923 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2924 slotId: "gstvin_footer" 2925 }), 2926 /*#__PURE__*/ (0,jsx_runtime.jsx)(ProFooter, {}) 2927 ] 2928 }); 2929 } 2930 // Check if it's getekasana page for full-width layout (with header) 2931 if (pathname === null || pathname === void 0 ? void 0 : pathname.startsWith("/getekasana")) { 2932 // Getekasana page layout - full width without sidebars but with header space 2933 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 2934 className: "contents-main-div getekasana-layout", 2935 id: "middlePage", 2936 children: [ 2937 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2938 slotId: "gstvin_top" 2939 }), 2940 pageContent, 2941 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2942 slotId: "gstvin_footer" 2943 }), 2944 /*#__PURE__*/ (0,jsx_runtime.jsx)(ProFooter, {}) 2945 ] 2946 }); 2947 } 2948 // Check if it's addjournalist page for full-width layout (with header) 2949 if (pathname === "/addjournalist") { 2950 // Addjournalist page layout - full width without sidebars but with header space 2951 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 2952 className: "contents-main-div", 2953 id: "middlePage", 2954 children: [ 2955 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2956 slotId: "gstvin_top" 2957 }), 2958 pageContent, 2959 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2960 slotId: "gstvin_footer" 2961 }), 2962 /*#__PURE__*/ (0,jsx_runtime.jsx)(ProFooter, {}) 2963 ] 2964 }); 2965 } 2966 // Check if it's addcampuscorner page for full-width layout (with header)
2967 if (pathname === "/addcampuscorner") { 2968 // Addcampuscorner page layout - full width without sidebars but with header space 2969 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 2970 className: "contents-main-div", 2971 id: "middlePage", 2972 children: [ 2973 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2974 slotId: "gstvin_top" 2975 }), 2976 pageContent, 2977 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2978 slotId: "gstvin_footer" 2979 }), 2980 /*#__PURE__*/ (0,jsx_runtime.jsx)(ProFooter, {}) 2981 ] 2982 }); 2983 } 2984 // Check if it's getcampuscorner page for full-width layout (with header) 2985 if (pathname === "/getcampuscorner") { 2986 // Getcampuscorner page layout - full width without sidebars but with header space 2987 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 2988 className: "contents-main-div", 2989 id: "middlePage", 2990 children: [ 2991 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2992 slotId: "gstvin_top" 2993 }), 2994 pageContent, 2995 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 2996 slotId: "gstvin_footer" 2997 }), 2998 /*#__PURE__*/ (0,jsx_runtime.jsx)(ProFooter, {}) 2999 ] 3000 }); 3001 } 3002 // Check if it's getganapati page for full-width layout (with header) 3003 if (pathname === "/getganapati") { 3004 // Getganapati page layout - full width without sidebars but with header space 3005 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 3006 className: "contents-main-div", 3007 id: "middlePage", 3008 children: [ 3009 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 3010 slotId: "gstvin_top" 3011 }), 3012 pageContent, 3013 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 3014 slotId: "gstvin_footer" 3015 }), 3016 /*#__PURE__*/ (0,jsx_runtime.jsx)(ProFooter, {}) 3017 ] 3018 }); 3019 } 3020 // Epaper pages: Full width layout without sidebars 3021 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 3022 className: "contents-main-div epaper-layout", 3023 id: "middlePage", 3024 children: [ 3025 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 3026 slotId: "gstvin_top" 3027 }), 3028 pageContent, 3029 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 3030 slotId: "gstvin_footer" 3031 }), 3032 /*#__PURE__*/ (0,jsx_runtime.jsx)(ProFooter, {}) 3033 ] 3034 }); 3035 } 3036 // Default layout: With sidebars 3037 if (shouldHideSidebars) { 3038 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 3039 className: "contents-main-div", 3040 id: "middlePage", 3041 children: [ 3042 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 3043 slotId: "gstvin_top" 3044 }), 3045 pageContent, 3046 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 3047 slotId: "gstvin_footer" 3048 }), 3049 /*#__PURE__*/ (0,jsx_runtime.jsx)(ProFooter, {}) 3050 ] 3051 }); 3052 } 3053 // DEFAULT LAYOUT WITH OPTIONAL RIGHT SIDEBAR 3054 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 3055 className: "contents-main-div", 3056 children: [ 3057 leftSidebar, 3058 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 3059 className: "row left-nav", 3060 children: [ 3061 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 3062 className: "col-md-9 col-lg-9 Center-main-div", 3063 children: [ 3064 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 3065 slotId: "gstvin_top" 3066 }), 3067 pageContent, 3068 /*#__PURE__*/ (0,jsx_runtime.jsx)(components_AdSlot, { 3069 slotId: "gstvin_footer" 3070 }) 3071 ] 3072 }), 3073 showRightSidebar && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 3074 className: "col-md-3 col-lg-3 right-sidebar", 3075 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(RightSidebar["default"], {}) 3076 }) 3077 ] 3078 }) 3079 ] 3080 }); 3081}; 3082/* harmony default export */ var components_LayoutWrapper = (LayoutWrapper); 3083 3084 3085/***/ }), 3086 3087/***/ 46265: 3088/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 3089 3090"use strict"; 3091 3092// EXPORTS 3093__webpack_require__.d(__webpack_exports__, { 3094 "default": function() { return /* binding */ LeftSidebar; } 3095}); 3096 3097// EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/jsx-runtime.js 3098var jsx_runtime = __webpack_require__(57437); 3099// EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/index.js 3100var react = __webpack_require__(2265); 3101// EXTERNAL MODULE: ./node_modules/next/dist/api/image.js 3102var api_image = __webpack_require__(33145); 3103// EXTERNAL MODULE: ./node_modules/next/dist/api/link.js 3104var api_link = __webpack_require__(27648); 3105// EXTERNAL MODULE: ./node_modules/next/dist/api/navigation.js 3106var navigation = __webpack_require__(99376); 3107// EXTERNAL MODULE: ./src/hooks/useCategorySettings.ts 3108var useCategorySettings = __webpack_require__(89079); 3109// EXTERNAL MODULE: ./src/utils/cacheUtils.ts 3110var cacheUtils = __webpack_require__(32080); 3111;// CONCATENATED MODULE: ./src/hooks/useCategorySettingsTopMenu.ts 3112/* __next_internal_client_entry_do_not_use__ useCategorySettingsTopMenu auto */ /** 3113 * Hook to fetch category settings for the top menu 3114 * Uses the dedicated CATEGORY_SETTING_TOP_MENU endpoint via /api/categorysetting-topmenu 3115 * This is specifically for the top menu design on the home page 3116 */ 3117 3118/** 3119 * Hook to fetch category settings for top menu 3120 * This uses the /api/categorysetting-topmenu endpoint which proxies to CATEGORY_SETTING_TOP_MENU 3121 */ const useCategorySettingsTopMenu = ()=>{ 3122 const [categories, setCategories] = (0,react.useState)([]); 3123 const [loading, setLoading] = (0,react.useState)(true); 3124 const [error, setError] = (0,react.useState)(null); 3125 const [isApiCallInProgress, setIsApiCallInProgress] = (0,react.useState)(false); 3126 const CACHE_KEY = "category_settings_topmenu158"; 3127 const loadTopMenuCategories = (0,react.useCallback)(async function() { 3128 let forceRefresh = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
3129 if (isApiCallInProgress) { 3130 console.log("\uD83C\uDFAF useCategorySettingsTopMenu: API call already in progress"); 3131 return; 3132 } 3133 // Check cache first (unless force refresh) 3134 if (!forceRefresh) { 3135 const cachedData = (0,cacheUtils/* loadFromCache */.xB)(CACHE_KEY); 3136 if (cachedData && cachedData.length > 0) { 3137 console.log("\uD83C\uDFAF useCategorySettingsTopMenu: Using cached data"); 3138 setCategories(cachedData); 3139 setLoading(false); 3140 setError(null); 3141 return; 3142 } 3143 } 3144 try { 3145 console.log("\uD83C\uDFAF useCategorySettingsTopMenu: Starting API call to /api/categorysetting-topmenu"); 3146 setIsApiCallInProgress(true); 3147 setLoading(true); 3148 setError(null); 3149 const apiUrl = "/api/categorysetting-topmenu"; 3150 console.log("\uD83C\uDFAF useCategorySettingsTopMenu: Fetching from URL:", apiUrl); 3151 const response = await fetch(apiUrl, { 3152 method: "GET", 3153 cache: "no-store", 3154 headers: { 3155 "Content-Type": "application/json" 3156 } 3157 }); 3158 console.log("\uD83C\uDFAF useCategorySettingsTopMenu: API response status:", response.status); 3159 if (!response.ok) { 3160 throw new Error("HTTP error! status: ".concat(response.status)); 3161 } 3162 const data = await response.json(); 3163 console.log("\uD83C\uDFAF useCategorySettingsTopMenu: API response data received"); 3164 // Extract categories from the response 3165 const allCategories = data.category || []; 3166 console.log("\uD83C\uDFAF useCategorySettingsTopMenu: Categories count:", allCategories.length); 3167 // Sort by catOrder (no need to build hierarchy for top menu - flat list) 3168 const sortedCategories = allCategories.sort((a, b)=>a.catOrder - b.catOrder); 3169 // Save to cache 3170 (0,cacheUtils/* saveToCache */.cW)(CACHE_KEY, sortedCategories, cacheUtils/* CACHE_TTL */.mJ.CATEGORY_SETTINGS); 3171 // Update state 3172 setCategories(sortedCategories); 3173 setLoading(false); 3174 setError(null); 3175 console.log("\uD83C\uDFAF useCategorySettingsTopMenu: Categories set successfully! Count:", sortedCategories.length); 3176 } catch (err) { 3177 console.error("\uD83C\uDFAF useCategorySettingsTopMenu: Error loading categories:", err); 3178 const errorMsg = err instanceof Error ? err.message : "Failed to load top menu categories"; 3179 setError(errorMsg); 3180 setLoading(false); 3181 } finally{ 3182 setIsApiCallInProgress(false); 3183 } 3184 }, [ 3185 isApiCallInProgress 3186 ]); 3187 // Load on mount 3188 (0,react.useEffect)(()=>{ 3189 console.log("\uD83C\uDFAF useCategorySettingsTopMenu: Hook mounted, loading categories"); 3190 loadTopMenuCategories(); 3191 }, [ 3192 loadTopMenuCategories 3193 ]); 3194 // Refetch function 3195 const refetch = (0,react.useCallback)(()=>{ 3196 console.log("\uD83C\uDFAF useCategorySettingsTopMenu: Refetch called - forcing fresh data"); 3197 (0,cacheUtils/* clearCache */.LK)(CACHE_KEY); 3198 setCategories([]); 3199 loadTopMenuCategories(true); 3200 }, [ 3201 loadTopMenuCategories 3202 ]); 3203 return { 3204 categories, 3205 loading, 3206 error, 3207 refetch 3208 }; 3209}; 3210 3211// EXTERNAL MODULE: ./src/hooks/useStockmarketSiteSetting.ts 3212var useStockmarketSiteSetting = __webpack_require__(71168); 3213// EXTERNAL MODULE: ./src/constants/api.ts 3214var api = __webpack_require__(30949); 3215// EXTERNAL MODULE: ./src/hooks/useUserSession.ts 3216var useUserSession = __webpack_require__(83284); 3217// EXTERNAL MODULE: ./src/styles/sidebar.css 3218var sidebar = __webpack_require__(88341); 3219;// CONCATENATED MODULE: ./src/components/LeftSidebar.tsx 3220/* __next_internal_client_entry_do_not_use__ default auto */ 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231function LeftSidebar() { 3232 // Row 1: Top menu using CATEGORY_SETTING_TOP_MENU endpoint 3233 const { categories: topMenuCategories, loading: topMenuLoading, error: topMenuError } = useCategorySettingsTopMenu(); 3234 // Row 2: Full categories using CATEGORY_SETTING endpoint (unchanged) 3235 const { categories, loading, error } = (0,useCategorySettings/* useCategorySettings */.H)(); 3236 const { isLoggedIn, user_id } = (0,useUserSession/* useUserSession */.EC)(); 3237 const pathname = (0,navigation.usePathname)(); 3238 const [openSubmenu, setOpenSubmenu] = (0,react.useState)(null); 3239 const [isMobileMenuOpen, setIsMobileMenuOpen] = (0,react.useState)(false); 3240 const [isMounted, setIsMounted] = (0,react.useState)(false); 3241 const [moreMenuOpen, setMoreMenuOpen] = (0,react.useState)(false); 3242 const [moreMenuPos, setMoreMenuPos] = (0,react.useState)({ 3243 top: 0, 3244 left: 0 3245 }); 3246 const [moreStripOpen, setMoreStripOpen] = (0,react.useState)(false); 3247 const [moreStripPos, setMoreStripPos] = (0,react.useState)({ 3248 top: 0, 3249 left: 0 3250 }); 3251 const [hoveredCatId, setHoveredCatId] = (0,react.useState)(null); 3252 // Stable gujarat subcategories â never resets to empty once populated 3253 const [gujaratSubs, setGujaratSubs] = (0,react.useState)([]); 3254 const MAX_VISIBLE = 15; 3255 // Responsive MAX_STRIP_VISIBLE based on screen width 3256 // Desktop: 14, Smaller screens: 12, Tablets: 10 3257 const getMaxStripVisible = ()=>{ 3258 if (false) {} 3259 const width = window.innerWidth; 3260 if (width >= 1400) return 17; // Desktop 3261 if (width >= 1024) return 15; // Small Desktop 3262 if (width >= 768) return 10; // Tablet (but mobile menu used instead) 3263 return 14; // Fallback 3264 }; 3265 const MAX_STRIP_VISIBLE = getMaxStripVisible(); 3266 const [userCategoryPreferences, setUserCategoryPreferences] = (0,react.useState)(null);
3267 const [loadingPreferences, setLoadingPreferences] = (0,react.useState)(false); 3268 const [preferencesError, setPreferencesError] = (0,react.useState)(false); 3269 const { RashiEnabled } = (0,useStockmarketSiteSetting/* useStockmarketSiteSetting */.l)(); 3270 /* ========================= 3271 MOUNT 3272 ========================= */ (0,react.useEffect)(()=>{ 3273 setIsMounted(true); 3274 }, []); 3275 /* ========================= 3276 FETCH USER PREFS (UNCHANGED LOGIC) 3277 ========================= */ (0,react.useEffect)(()=>{ 3278 const fetchUserCategoryPreferences = async ()=>{ 3279 if (!isLoggedIn || !user_id) { 3280 setUserCategoryPreferences(null); 3281 return; 3282 } 3283 setLoadingPreferences(true); 3284 setPreferencesError(false); 3285 try { 3286 const response = await fetch(api/* API_ENDPOINTS */.Pn.GET_CATEGORY_CITY, { 3287 method: "POST", 3288 cache: "no-store", 3289 headers: { 3290 "Content-Type": "application/json" 3291 }, 3292 body: JSON.stringify({ 3293 user_id 3294 }) 3295 }); 3296 const data = await response.json(); 3297 if ((data === null || data === void 0 ? void 0 : data.category) && Array.isArray(data.category)) { 3298 setUserCategoryPreferences({ 3299 category: data.category.map(Number), 3300 city: (data.city || []).map(Number) 3301 }); 3302 } else { 3303 setUserCategoryPreferences(null); 3304 } 3305 } catch (e) { 3306 setPreferencesError(true); 3307 setUserCategoryPreferences(null); 3308 } finally{ 3309 setLoadingPreferences(false); 3310 } 3311 }; 3312 fetchUserCategoryPreferences(); 3313 }, [ 3314 isLoggedIn, 3315 user_id 3316 ]); 3317 /* ========================= 3318 CONSTANTS 3319 ========================= */ const ALWAYS_VISIBLE_SLUGS = (0,react.useMemo)(()=>[ 3320 "campuscorner", 3321 "journalist", 3322 "rashifal", 3323 "web-stories", 3324 "livetv" 3325 ], []); 3326 /* ========================= 3327 FILTERED CATEGORIES (MEMOIZED) 3328 SAME LOGIC 3329 ========================= */ const filteredCategories = (0,react.useMemo)(()=>{ 3330 // Always show all categories - don't filter by user preferences for main menu 3331 // User preferences are only applied to the mobile menu via GET_CATEGORY_CITY 3332 if (!categories || categories.length === 0) { 3333 return categories; 3334 } 3335 // For logged-in users with city preferences, optionally filter Gujarat subcategories 3336 // But ALWAYS ensure Gujarat and its subcategories are present for Row 2 3337 if (isLoggedIn && (userCategoryPreferences === null || userCategoryPreferences === void 0 ? void 0 : userCategoryPreferences.city) && userCategoryPreferences.city.length > 0) { 3338 const allowedCategoryIds = userCategoryPreferences.category; 3339 const allowedCityIds = userCategoryPreferences.city; 3340 return categories.filter((cat)=>ALWAYS_VISIBLE_SLUGS.includes(cat.slug) || allowedCategoryIds.includes(cat.id) || cat.slug === "gujarat" // Always include Gujarat 3341 ).map((cat)=>{ 3342 // Apply city filter to Gujarat if user has selected specific cities 3343 if (cat.slug === "gujarat" && cat.subcategories && allowedCityIds.length > 0) { 3344 return { 3345 ...cat, 3346 subcategories: cat.subcategories.filter((sub)=>(sub === null || sub === void 0 ? void 0 : sub.id) && allowedCityIds.includes(Number(sub.id))) 3347 }; 3348 } 3349 return cat; 3350 }); 3351 } 3352 // If not logged in or no preferences, return all categories as-is 3353 return categories; 3354 }, [ 3355 categories, 3356 isLoggedIn, 3357 userCategoryPreferences, 3358 ALWAYS_VISIBLE_SLUGS 3359 ]); 3360 /* ========================= 3361 POPULATE GUJARAT SUBS â direct API fetch, independent of context 3362 ========================= */ (0,react.useEffect)(()=>{ 3363 // Already have data â don't re-fetch 3364 if (gujaratSubs.length > 0) return; 3365 const fetchGujaratSubs = async ()=>{ 3366 try { 3367 const res = await fetch("/api/categorysetting", { 3368 method: "GET", 3369 cache: "no-store" 3370 }); 3371 if (!res.ok) return; 3372 const data = await res.json(); 3373 const allCats = data.category || []; 3374 // Find gujarat parent 3375 const gujarat = allCats.find((c)=>c.slug === "gujarat" && c.parentID === 0); 3376 if (!gujarat) return; 3377 // Get its children 3378 const subs = allCats.filter((c)=>c.parentID === gujarat.id); 3379 if (!subs.length) return; 3380 // Sort by catOrder 3381 subs.sort((a, b)=>{ 3382 var _a_catOrder, _b_catOrder; 3383 return ((_a_catOrder = a.catOrder) !== null && _a_catOrder !== void 0 ? _a_catOrder : 0) - ((_b_catOrder = b.catOrder) !== null && _b_catOrder !== void 0 ? _b_catOrder : 0); 3384 }); 3385 setGujaratSubs(subs); 3386 } catch (e) { 3387 console.error("Gujarat subs fetch failed", e); 3388 } 3389 }; 3390 fetchGujaratSubs(); 3391 // eslint-disable-next-line react-hooks/exhaustive-deps 3392 }, []); // fetch once on mount 3393 /* ========================= 3394 CLOSE MORE MENU ON OUTSIDE CLICK 3395 ========================= */ (0,react.useEffect)(()=>{ 3396 if (!moreMenuOpen) return; 3397 const handler = (e)=>{ 3398 const target = e.target; 3399 const btn = document.querySelector(".more-menu-btn"); 3400 const dropdown = document.querySelector(".more-dropdown-fixed"); 3401 if (btn && !btn.contains(target) && dropdown && !dropdown.contains(target)) { 3402 setMoreMenuOpen(false); 3403 } 3404 }; 3405 document.addEventListener("mousedown", handler); 3406 return ()=>document.removeEventListener("mousedown", handler); 3407 }, [ 3408 moreMenuOpen 3409 ]); 3410 (0,react.useEffect)(()=>{ 3411 if (!moreStripOpen) return; 3412 const handler = (e)=>{ 3413 const target = e.target; 3414 const btn = document.querySelector(".more-strip-btn"); 3415 const dropdown = document.querySelector(".more-strip-dropdown"); 3416 if (btn && !btn.contains(target) && dropdown && !dropdown.contains(target)) { 3417 setMoreStripOpen(false); 3418 } 3419 }; 3420 document.addEventListener("mousedown", handler); 3421 return ()=>document.removeEventListener("mousedown", handler); 3422 }, [ 3423 moreStripOpen 3424 ]); 3425 /* ========================= 3426 MOBILE MENU TOGGLE 3427 ========================= */ (0,react.useEffect)(()=>{ 3428 const handleToggleMobileMenu = ()=>setIsMobileMenuOpen((prev)=>!prev); 3429 window.addEventListener("toggleMobileMenu", handleToggleMobileMenu); 3430 return ()=>window.removeEventListener("toggleMobileMenu", handleToggleMobileMenu); 3431 }, []); 3432 /* ========================= 3433 AUTO OPEN SUBMENU FROM URL 3434 ========================= */ (0,react.useEffect)(()=>{ 3435 if (!pathname || !filteredCategories.length) return; 3436 const parts = pathname.split("/"); 3437 if (parts[1] === "category" && parts.length >= 4) { 3438 var _category_subcategories; 3439 const slug = parts[2]; 3440 const category = filteredCategories.find((c)=>c.slug === slug); 3441 if (category === null || category === void 0 ? void 0 : (_category_subcategories = category.subcategories) === null || _category_subcategories === void 0 ? void 0 : _category_subcategories.length) { 3442 setOpenSubmenu(category.id); 3443 } 3444 } 3445 }, [ 3446 pathname, 3447 filteredCategories 3448 ]); 3449 /* ========================= 3450 CLICK / ESC HANDLERS 3451 ========================= */ (0,react.useEffect)(()=>{ 3452 const handleClickOutside = (event)=>{ 3453 const sidebar = document.querySelector(".mobile-sidebar-menu"); 3454 const menuToggle = document.querySelector(".mobile-menu-toggle"); 3455 if (isMobileMenuOpen && sidebar && !sidebar.contains(event.target) && menuToggle && !menuToggle.contains(event.target)) { 3456 setIsMobileMenuOpen(false); 3457 } 3458 }; 3459 const handleEscapeKey = (event)=>{ 3460 if (event.key === "Escape") setIsMobileMenuOpen(false); 3461 }; 3462 if (isMobileMenuOpen) { 3463 document.addEventListener("mousedown", handleClickOutside); 3464 document.addEventListener("keydown", handleEscapeKey); 3465 document.body.style.overflow = "hidden"; 3466 } else { 3467 document.body.style.overflow = "unset"; 3468 } 3469 return ()=>{ 3470 document.removeEventListener("mousedown", handleClickOutside); 3471 document.removeEventListener("keydown", handleEscapeKey); 3472 document.body.style.overflow = "unset"; 3473 }; 3474 }, [ 3475 isMobileMenuOpen 3476 ]); 3477 /* ========================= 3478 HELPERS (STABLE) 3479 ========================= */ const toggleSubmenu = (0,react.useCallback)((id)=>{ 3480 setOpenSubmenu((prev)=>prev === id ? null : id); 3481 }, []); 3482 const isActiveCategory = (0,react.useCallback)((slug, id)=>id <= 0 ? pathname === "/".concat(slug) : pathname === "/category/".concat(slug), [ 3483 pathname 3484 ]); 3485 const isActiveSubcategory = (0,react.useCallback)((c, s)=>pathname === "/category/".concat(c, "/").concat(s), [ 3486 pathname 3487 ]); 3488 const renderCategoryIcon = (0,react.useCallback)((category)=>{ 3489 if (category.icon) { 3490 return /*#__PURE__*/ (0,jsx_runtime.jsx)(api_image["default"], { 3491 src: category.icon, 3492 alt: category.category_name, 3493 width: 25, 3494 height: 25, 3495 onError: (e)=>e.currentTarget.src = "/images/category_icon.svg" 3496 }); 3497 } 3498 return /*#__PURE__*/ (0,jsx_runtime.jsx)("i", { 3499 className: "fa-solid fa-folder" 3500 }); 3501 }, []); 3502 const getCategoryPath = (0,react.useCallback)((slug, id)=>id <= 0 ? "/".concat(slug) : "/category/".concat(slug), []); 3503 const getSubcategoryPath = (0,react.useCallback)((c, s)=>"/category/".concat(c, "/").concat(s), []); 3504 return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { 3505 children: [ 3506 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 3507 className: "col-lg-2 mb-1 col-md-2 d-lg-none", 3508 style: { 3509 zIndex: 999 3510 }, 3511 children: [ 3512 /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { 3513 className: "mobile-menu-btn d-lg-none", 3514 onClick: ()=>window.dispatchEvent(new CustomEvent("toggleMobileMenu")), 3515 style: { 3516 background: "none", 3517 border: "none", 3518 padding: "8px 12px", 3519 cursor: "pointer", 3520 display: "flex", 3521 flexDirection: "column", 3522 alignItems: "center", 3523 justifyContent: "center", 3524 color: "#333", 3525 fontSize: "12px", 3526 fontFamily: "'Hind Vadodara', sans-serif", 3527 minWidth: "60px", 3528 top: "56px", 3529 position: "fixed", 3530 left: "0px", 3531 zIndex: "1000" 3532 }, 3533 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("i", { 3534 className: "fa-solid fa-bars", 3535 style: { 3536 fontSize: "20px", 3537 marginBottom: "2px" 3538 } 3539 }) 3540 }), 3541 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 3542 className: "nav-list custom-sidebar scrollarea", 3543 style: { 3544 display: "none" 3545 }, 3546 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("ul", { 3547 className: "sidebar-menu", 3548 children: [ 3549 /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { 3550 className: " allcatshow catMobileshow", 3551 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 3552 href: "/category/gstv-satrang", 3553 className: "", 3554 children: [ 3555 /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { 3556 src: "/assets/icons/gstv_satrang.svg", 3557 alt: "GSTV શતરàªàª" 3558 }), 3559 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 3560 children: "GSTV શતરàªàª" 3561 }) 3562 ] 3563 }) 3564 }), 3565 RashiEnabled && /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { 3566 className: " allcatshow catMobileshow", 3567 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 3568 href: "/rashifal", 3569 className: "", 3570 children: [ 3571 /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { 3572 src: "".concat(api/* MEDIA_BASE_URL */.uW, "/backend/public/uploads/category/icon/rashifal.svg"), 3573 alt: "રાશિફળ" 3574 }), 3575 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 3576 children: "રાશિફળ" 3577 }) 3578 ] 3579 }) 3580 }), 3581 /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { 3582 className: "allcatshow catMobileshow", 3583 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 3584 href: "/livetv", 3585 className: "", 3586 children: [ 3587 /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { 3588 src: "".concat(api/* MEDIA_BASE_URL */.uW, "/public/assets/icons/icon-live.svg"), 3589 alt: "લાàªàªµ àªà«àªµà«" 3590 }), 3591 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 3592 children: "લાàªàªµ àªà«àªµà«" 3593 }) 3594 ] 3595 }) 3596 }) 3597 ] 3598 }) 3599 }) 3600 ] 3601 }), 3602 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 3603 className: "desktop-top-menu d-lg-block", 3604 children: [ 3605 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 3606
3606 className: "desktop-menu-scroll", 3607 children: [ 3608 /*#__PURE__*/ (0,jsx_runtime.jsx)(api_link["default"], { 3609 href: "/", 3610 className: "menu-home", 3611 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("i", { 3612 className: "fa-solid fa-house" 3613 }) 3614 }), 3615 !isMounted && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 3616 className: "menu-loading", 3617 children: "àªà«àªà«àªàª°à« લà«àª¡ થઠરહૠàªà«..." 3618 }), 3619 isMounted && topMenuLoading && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 3620 className: "menu-loading", 3621 children: "àªà«àªà«àªàª°à« લà«àª¡ થઠરહૠàªà«..." 3622 }), 3623 isMounted && topMenuError && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 3624 className: "menu-loading text-danger", 3625 children: "Error loading categories" 3626 }), 3627 isMounted && !topMenuLoading && !topMenuError && (()=>{ 3628 // Use topMenuCategories for Row 1 3629 const nonGujaratCats = topMenuCategories.filter((c)=>c.slug !== "gujarat"); 3630 const visibleCats = nonGujaratCats.slice(0, MAX_VISIBLE); 3631 const moreCats = nonGujaratCats.slice(MAX_VISIBLE); 3632 const hasMore = moreCats.length > 0; 3633 return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { 3634 children: [ 3635 visibleCats.map((category, index)=>{ 3636 var _category_subcategories; 3637 var _category_subcategories_length; 3638 const hasSub = ((_category_subcategories_length = (_category_subcategories = category.subcategories) === null || _category_subcategories === void 0 ? void 0 : _category_subcategories.length) !== null && _category_subcategories_length !== void 0 ? _category_subcategories_length : 0) > 0; 3639 const isHovered = hoveredCatId === category.id; 3640 return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 3641 className: "desktop-menu-item".concat(isHovered ? " hovered" : ""), 3642 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_link["default"], { 3643 href: getCategoryPath(category.slug, category.id), 3644 className: "desktop-menu-link ".concat(isActiveCategory(category.slug, category.id) ? "active" : ""), 3645 children: category.category_name_guj 3646 }) 3647 }, "".concat(category.id, "-").concat(index)); 3648 }), 3649 hasMore && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 3650 className: "desktop-menu-item more-menu-wrapper", 3651 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { 3652 className: "desktop-menu-link more-menu-btn", 3653 onClick: (e)=>{ 3654 const rect = e.currentTarget.getBoundingClientRect(); 3655 const viewportWidth = window.innerWidth; 3656 const dropdownWidth = 300; // Approximate width of dropdown 3657 let leftPos = rect.left; 3658 // If dropdown would go off right edge, align it to the right edge instead 3659 if (leftPos + dropdownWidth > viewportWidth - 20) { 3660 leftPos = viewportWidth - dropdownWidth - 20; 3661 } 3662 // Ensure it doesn't go off the left edge 3663 leftPos = Math.max(10, leftPos); 3664 setMoreMenuPos({ 3665 top: rect.bottom, 3666 left: leftPos 3667 }); 3668 setMoreMenuOpen((prev)=>!prev); 3669 }, 3670 "aria-expanded": moreMenuOpen, 3671 children: [ 3672 "વધૠ", 3673 /*#__PURE__*/ (0,jsx_runtime.jsx)("i", { 3674 className: "fa-solid fa-chevron-".concat(moreMenuOpen ? "up" : "down"), 3675 style: { 3676 fontSize: "11px", 3677 marginLeft: "4px" 3678 } 3679 }) 3680 ] 3681 }) 3682 }), 3683 hasMore && moreMenuOpen && /*#__PURE__*/ (0,jsx_runtime.jsx)("ul", { 3684 className: "desktop-submenu-fixed more-dropdown-fixed", 3685 style: { 3686 top: moreMenuPos.top, 3687 left: moreMenuPos.left 3688 }, 3689 children: moreCats.map((category, index)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("li", { 3690 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_link["default"], { 3691 href: getCategoryPath(category.slug, category.id), 3692 className: isActiveCategory(category.slug, category.id) ? "active" : "", 3693 onClick: ()=>setMoreMenuOpen(false), 3694 children: category.category_name_guj 3695 }) 3696 }, "more-".concat(category.id, "-").concat(index))) 3697 }) 3698 ] 3699 }); 3700 })() 3701 ] 3702 }), 3703 gujaratSubs.length > 0 && (()=>{ 3704 var _this, _hoveredCat_subcategories, _hoveredCat_subcategories1; 3705 const hoveredCat = hoveredCatId !== null ? (_this = filteredCategories !== null && filteredCategories !== void 0 ? filteredCategories : categories) === null || _this === void 0 ? void 0 : _this.find((c)=>c.id === hoveredCatId) : null; 3706 const stripSubs = (hoveredCat === null || hoveredCat === void 0 ? void 0 : (_hoveredCat_subcategories = hoveredCat.subcategories) === null || _hoveredCat_subcategories === void 0 ? void 0 : _hoveredCat_subcategories.length) ? hoveredCat.subcategories : gujaratSubs; 3707 const stripSlug = (hoveredCat === null || hoveredCat === void 0 ? void 0 : (_hoveredCat_subcategories1 = hoveredCat.subcategories) === null || _hoveredCat_subcategories1 === void 0 ? void 0 : _hoveredCat_subcategories1.length) ? hoveredCat.slug : "gujarat"; 3708 const isGujarat = stripSlug === "gujarat"; 3709 const visibleSubs = stripSubs.slice(0, MAX_STRIP_VISIBLE); 3710 const moreSubs = stripSubs.slice(MAX_STRIP_VISIBLE); 3711 const hasMoreSubs = moreSubs.length > 0; 3712 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 3713 className: "desktop-subcat-strip".concat(isGujarat ? " gujarat-strip" : ""), 3714 onMouseEnter: ()=>hoveredCat && setHoveredCatId(hoveredCat.id), 3715 onMouseLeave: ()=>setHoveredCatId(null), 3716 children: [ 3717 isGujarat && /*#__PURE__*/ (0,jsx_runtime.jsx)(api_link["default"], { 3718 href: "/category/gujarat", 3719 className: "strip-category-label", 3720 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { 3721 src: "/assets/icons/gujarat.webp", 3722 alt: "àªà«àªàª°àª¾àª¤", 3723 className: "strip-gujarat-icon" 3724 }) 3725 }), 3726 visibleSubs.map((sub, i)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(api_link["default"], { 3727 href: getSubcategoryPath(stripSlug, sub.slug), 3728 className: "subcat-strip-link ".concat(isActiveSubcategory(stripSlug, sub.slug) ? "active" : ""), 3729 children: sub.category_name_guj 3730 }, i)), 3731 hasMoreSubs && /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { 3732 children: [ 3733 /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { 3734 className: "subcat-strip-link more-strip-btn", 3735 onClick: (e)=>{ 3736 const rect = e.currentTarget.getBoundingClientRect(); 3737 const viewportWidth = window.innerWidth; 3738 const dropdownWidth = 260; 3739 let leftPos = rect.left; 3740 if (leftPos + dropdownWidth > viewportWidth - 20) { 3741 leftPos = viewportWidth - dropdownWidth - 20; 3742 } 3743 leftPos = Math.max(10, leftPos); 3744 setMoreStripPos({ 3745 top: rect.bottom, 3746 left: leftPos 3747 }); 3748 setMoreStripOpen((prev)=>!prev); 3749 }, 3750 children: [ 3751 "વધૠ", 3752 /*#__PURE__*/ (0,jsx_runtime.jsx)("i", { 3753 className: "fa-solid fa-chevron-".concat(moreStripOpen ? "up" : "down"), 3754 style: { 3755 fontSize: "10px", 3756 marginLeft: "3px" 3757 } 3758 }) 3759 ] 3760 }), 3761 moreStripOpen && /*#__PURE__*/ (0,jsx_runtime.jsx)("ul", { 3762 className: "desktop-submenu-fixed more-strip-dropdown", 3763 style: { 3764 top: moreStripPos.top, 3765 left: moreStripPos.left 3766 }, 3767 children: moreSubs.map((sub, i)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("li", { 3768 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(api_link["default"], { 3769 href: getSubcategoryPath(stripSlug, sub.slug), 3770 className: isActiveSubcategory(stripSlug, sub.slug) ? "active" : "", 3771 onClick: ()=>setMoreStripOpen(false), 3772 children: sub.category_name_guj 3773 }) 3774 }, "strip-more-".concat(i))) 3775 }) 3776 ] 3777 }) 3778 ] 3779 }); 3780 })() 3781 ] 3782 }), 3783 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 3784 className: "mobile-menu-overlay ".concat(isMobileMenuOpen ? "active" : ""), 3785 onClick: ()=>setIsMobileMenuOpen(false) 3786 }), 3787 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 3788 className: "mobile-sidebar-menu ".concat(isMobileMenuOpen ? "active" : ""), 3789 children: [ 3790 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 3791 className: "mobile-menu-header", 3792 children: [ 3793 /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { 3794 className: "back-arrow-btn", 3795 onClick: ()=>setIsMobileMenuOpen(false), 3796 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { 3797 src: "/images/arrow-backProfile.svg", 3798 alt: "Back", 3799 className: "back-arrow" 3800 }) 3801 }), 3802 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 3803 className: "menu-title", 3804 children: "All Categories" 3805 }) 3806 ] 3807 }), 3808 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 3809 className: "mobile-menu-content", 3810 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("ul", { 3811 className: "mobile-menu-list", 3812 children: [ 3813 !isMounted && /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { 3814 className: "mobile-menu-item", 3815 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 3816 style: { 3817 padding: "15px", 3818 textAlign: "center", 3819 color: "#666" 3820 }, 3821 children: "àªà«àªà«àªàª°à« લà«àª¡ થઠરહૠàªà«..." 3822 }) 3823 }
3823), 3824 isMounted && loading && /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { 3825 className: "mobile-menu-item", 3826 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 3827 style: { 3828 padding: "15px", 3829 textAlign: "center", 3830 color: "#666" 3831 }, 3832 children: "àªà«àªà«àªàª°à« લà«àª¡ થઠરહૠàªà«..." 3833 }) 3834 }), 3835 isMounted && error && /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { 3836 className: "mobile-menu-item", 3837 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 3838 style: { 3839 padding: "15px", 3840 color: "#dc3545", 3841 fontSize: "14px" 3842 }, 3843 children: "Error loading categories" 3844 }) 3845 }), 3846 isMounted && !loading && !error && filteredCategories.map((category, index)=>{ 3847 var _category_subcategories; 3848 const hasSub = ((_category_subcategories = category.subcategories) === null || _category_subcategories === void 0 ? void 0 : _category_subcategories.length) > 0; 3849 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("li", { 3850 className: "mobile-menu-item", 3851 children: [ 3852 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 3853 className: "mobile-category-item", 3854 children: [ 3855 /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 3856 href: getCategoryPath(category.slug, category.id), 3857 className: "mobile-category-link ".concat(isActiveCategory(category.slug, category.id) ? "active" : ""), 3858 onClick: ()=>setIsMobileMenuOpen(false), 3859 children: [ 3860 renderCategoryIcon(category), 3861 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 3862 children: category.category_name_guj 3863 }) 3864 ] 3865 }), 3866 hasSub && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { 3867 className: "mobile-submenu-toggle", 3868 onClick: ()=>toggleSubmenu(category.id), 3869 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("i", { 3870 className: "fa-solid ".concat(openSubmenu === category.id ? "fa-chevron-up" : "fa-chevron-down") 3871 }) 3872 }) 3873 ] 3874 }), 3875 hasSub && /*#__PURE__*/ (0,jsx_runtime.jsx)("ul", { 3876 className: "mobile-submenu ".concat(openSubmenu === category.id ? "show" : ""), 3877 children: category.subcategories.map((sub, subIndex)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("li", { 3878 className: "mobile-subcategory-item", 3879 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)(api_link["default"], { 3880 href: "/category/".concat(category.slug, "/").concat(sub.slug), 3881 className: "mobile-subcategory-link ".concat(isActiveSubcategory(category.slug, sub.slug) ? "active" : ""), 3882 onClick: ()=>setIsMobileMenuOpen(false), 3883 children: [ 3884 renderCategoryIcon(sub), 3885 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 3886 children: sub.category_name_guj 3887 }) 3888 ] 3889 }) 3890 }, "mobile-sub-".concat(category.id, "-").concat(sub.slug, "-").concat(subIndex))) 3891 }) 3892 ] 3893 }, "mobile-".concat(category.id, "-").concat(category.slug, "-").concat(index)); 3894 }) 3895 ] 3896 }) 3897 }) 3898 ] 3899 }) 3900 ] 3901 }); 3902} 3903 3904 3905/***/ }), 3906 3907/***/ 40376: 3908/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 3909 3910"use strict"; 3911/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57437); 3912/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2265); 3913/* __next_internal_client_entry_do_not_use__ default auto */ 3914 3915const MobileAppPrompt = ()=>{ 3916 const [showPrompt, setShowPrompt] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); 3917 const [isMobile, setIsMobile] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); 3918 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ 3919 const checkMobile = ()=>{ 3920 const userAgent = navigator.userAgent || navigator.vendor || ""; 3921 const isMobileDevice = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent.toLowerCase()); 3922 const isSmallScreen = window.innerWidth <= 768; 3923 return isMobileDevice || isSmallScreen; 3924 }; 3925 if (checkMobile()) { 3926 setIsMobile(true); 3927 const timer = setTimeout(()=>{ 3928 setShowPrompt(true); 3929 }, 2000); 3930 return ()=>clearTimeout(timer); 3931 } 3932 }, []); 3933 const handleAppOpen = ()=>{ 3934 const userAgent = navigator.userAgent || navigator.vendor || ""; 3935 const newUrl = window.location.href.replace(/^https:/, "gstvapp:"); 3936 if (/android/i.test(userAgent)) { 3937 window.location.href = newUrl; 3938 setTimeout(()=>{ 3939 window.location.href = "https://onelink.to/43bgxx"; 3940 }, 500); 3941 } else if (/iPad|iPhone|iPod/.test(userAgent)) { 3942 window.location.href = newUrl; 3943 setTimeout(()=>{ 3944 window.location.href = "https://onelink.to/43bgxx"; 3945 }, 500); 3946 } 3947 setShowPrompt(false); 3948 }; 3949 const handleContinueInBrowser = ()=>{ 3950 setShowPrompt(false); 3951 }; 3952 const handleBackdropClick = ()=>{ 3953 setShowPrompt(false); 3954 }; 3955 if (!isMobile) return null; 3956 return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { 3957 children: [ 3958 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 3959 className: "app-prompt-backdrop ".concat(showPrompt ? "show" : ""), 3960 onClick: handleBackdropClick 3961 }), 3962 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 3963 className: "mobile-app-prompt ".concat(showPrompt ? "show" : ""), 3964 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 3965 className: "app-prompt-content", 3966 children: [ 3967 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 3968 className: "app-prompt-header", 3969 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { 3970 children: "Open In" 3971 }) 3972 }), 3973 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 3974 className: "app-options", 3975 children: [ 3976 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 3977 className: "app-option", 3978 children: [ 3979 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 3980 className: "app-info", 3981 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 3982 className: "app-name", 3983 children: "GSTV News App" 3984 }) 3985 }), 3986 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { 3987 className: "app-button open-btn", 3988 onClick: handleAppOpen, 3989 children: "Open" 3990 }) 3991 ] 3992 }), 3993 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 3994 className: "app-option", 3995 children: [ 3996 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 3997 className: "app-info", 3998 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 3999 className: "app-name", 4000 children: "Chrome Browser" 4001 }) 4002 }), 4003 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { 4004 className: "app-button continue-btn", 4005 onClick: handleContinueInBrowser, 4006 children: "Continue" 4007 }) 4008 ] 4009 }) 4010 ] 4011 }) 4012 ] 4013 }) 4014 }) 4015 ] 4016 }); 4017}; 4018/* harmony default export */ __webpack_exports__["default"] = (MobileAppPrompt); 4019 4020 4021/***/ }), 4022 4023/***/ 72674: 4024/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 4025 4026"use strict"; 4027 4028// EXPORTS 4029__webpack_require__.d(__webpack_exports__, { 4030 "default": function() { return /* binding */ PollLoader; } 4031}); 4032 4033// EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/jsx-runtime.js 4034var jsx_runtime = __webpack_require__(57437); 4035// EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/index.js 4036var react = __webpack_require__(2265); 4037// EXTERNAL MODULE: ./node_modules/styled-jsx/style.js 4038var style = __webpack_require__(29); 4039var style_default = /*#__PURE__*/__webpack_require__.n(style); 4040// EXTERNAL MODULE: ./src/components/PollSection.tsx 4041var PollSection = __webpack_require__(3798); 4042;// CONCATENATED MODULE: ./src/components/PollPopup.jsx 4043/* __next_internal_client_entry_do_not_use__ default auto */ 4044 4045 4046 4047function PollPopup(param) { 4048 let { poll } = param; 4049 const [open, setOpen] = (0,react.useState)(false); 4050 const [pollLoaded, setPollLoaded] = (0,react.useState)(false); 4051 if (!poll || !Array.isArray(poll.poll) || poll.poll[0] === null) { 4052 return null; 4053 } 4054 const togglePopup = ()=>setOpen(!open); 4055 // When popup opens â wait for PollSection to load â then apply CSS tweaks 4056 (0,react.useEffect)(()=>{ 4057 if (open) { 4058 const timer = setTimeout(()=>{ 4059 setPollLoaded(true); 4060 }, 50); // small delay to ensure DOM is rendered 4061 return ()=>clearTimeout(timer); 4062 } else { 4063 setPollLoaded(false); 4064 } 4065 }, [ 4066 open 4067 ]); 4068 return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { 4069 children: [ 4070 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 4071 id: "knowMoreBtn", 4072 onClick: togglePopup, 4073 title: "Poll", 4074 className: style_default().dynamic([ 4075 [ 4076 "5b98d32347e858ee", 4077 [ 4078 open ? "block" : "none" 4079 ] 4080 ] 4081 ]) + " " + "know-more-btn", 4082 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { 4083 src: open ? "/assets/images/close.svg" : "/assets/images/poll.svg", 4084 alt: "Poll Icon", 4085 className: style_default().dynamic([ 4086 [ 4087 "5b98d32347e858ee", 4088 [ 4089 open ? "block" : "none" 4090 ] 4091 ] 4092 ]) 4093 }) 4094 }), 4095 open && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 4096 id: "floatingNewsPopup", 4097 className: style_default().dynamic([ 4098 [ 4099 "5b98d32347e858ee", 4100 [ 4101 open ? "block" : "none" 4102 ] 4103 ] 4104 ]) + " " + "floating-news-popup", 4105 children: [ 4106 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 4107 className: style_default().dynamic([ 4108 [ 4109 "5b98d32347e858ee", 4110 [ 4111 open ? "block" : "none" 4112 ] 4113 ] 4114 ]) + " " + "popup-header", 4115 children: [ 4116 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 4117 className: style_default().dynamic([ 4118 [ 4119 "5b98d32347e858ee", 4120 [ 4121 open ? "block" : "none" 4122 ] 4123 ] 4124 ]) + " " + "popup-title", 4125 children: "પà«àª²" 4126 }), 4127 /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { 4128 onClick: togglePopup, 4129
4129 className: style_default().dynamic([ 4130 [ 4131 "5b98d32347e858ee", 4132 [ 4133 open ? "block" : "none" 4134 ] 4135 ] 4136 ]) + " " + "close-btn", 4137 children: "\xd7" 4138 }) 4139 ] 4140 }), 4141 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 4142 className: style_default().dynamic([ 4143 [ 4144 "5b98d32347e858ee", 4145 [ 4146 open ? "block" : "none" 4147 ] 4148 ] 4149 ]) + " " + "popup-body ".concat(pollLoaded ? "poll-loaded" : ""), 4150 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(PollSection["default"], {}) 4151 }) 4152 ] 4153 }), 4154 /*#__PURE__*/ (0,jsx_runtime.jsx)((style_default()), { 4155 id: "5b98d32347e858ee", 4156 dynamic: [ 4157 open ? "block" : "none" 4158 ], 4159 children: ".know-more-btn.__jsx-style-dynamic-selector{position:fixed;left:20px;bottom:70px;width:48px;height:48px;background:#800d00;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;display:none;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;z-index:999999}.floating-news-popup.__jsx-style-dynamic-selector{position:fixed;bottom:120px;left:20px;width:320px;background:#fff;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;-webkit-box-shadow:0 5px 25px rgba(0,0,0,.3);-moz-box-shadow:0 5px 25px rgba(0,0,0,.3);box-shadow:0 5px 25px rgba(0,0,0,.3);z-index:999999;display:".concat(open ? "block" : "none", "}.popup-header.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:12px;background:#800d00;color:#fff;-webkit-border-radius:10px 10px 0 0;-moz-border-radius:10px 10px 0 0;border-radius:10px 10px 0 0}.popup-body.__jsx-style-dynamic-selector{padding:15px}") 4160 }) 4161 ] 4162 }); 4163} 4164 4165// EXTERNAL MODULE: ./src/constants/api.ts 4166var api = __webpack_require__(30949); 4167;// CONCATENATED MODULE: ./src/components/PollLoader.jsx 4168/* __next_internal_client_entry_do_not_use__ default auto */ 4169 4170 4171 4172function PollLoader() { 4173 const [poll, setPoll] = (0,react.useState)(null); 4174 (0,react.useEffect)(()=>{ 4175 async function loadPoll() { 4176 try { 4177 const res = await fetch(api/* API_ENDPOINTS */.Pn.POLL, { 4178 method: "POST", 4179 cache: "no-store", 4180 headers: { 4181 "Content-Type": "application/json", 4182 Accept: "application/json" 4183 }, 4184 body: JSON.stringify({}) 4185 }); 4186 if (!res) { 4187 console.log("API Error:", res.status); 4188 setPoll(null); 4189 return; 4190 } 4191 const data = await res.json(); 4192 if (data && data.poll) { 4193 setPoll(data); 4194 } else { 4195 setPoll(null); 4196 } 4197 } catch (err) { 4198 console.error("Poll Load Error:", err); 4199 setPoll(null); 4200 } 4201 } 4202 loadPoll(); 4203 }, []); 4204 return poll ? /*#__PURE__*/ (0,jsx_runtime.jsx)(PollPopup, { 4205 poll: poll 4206 }) : null; 4207} 4208 4209 4210/***/ }), 4211 4212/***/ 3798: 4213/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 4214 4215"use strict"; 4216__webpack_require__.r(__webpack_exports__); 4217/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57437); 4218/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2265); 4219/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27648); 4220/* harmony import */ var _utils_deviceId__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(64783); 4221/* harmony import */ var _hooks_useUserSession__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(83284); 4222/* harmony import */ var _constants_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30949); 4223/* harmony import */ var _LoginOtpModal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(87435); 4224/* __next_internal_client_entry_do_not_use__ default auto */ 4225 4226 4227 4228 4229 4230 4231const PollSection = ()=>{ 4232 const { isLoggedIn, user_id } = (0,_hooks_useUserSession__WEBPACK_IMPORTED_MODULE_3__/* .useUserSession */ .EC)(); 4233 const deviceId = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>(0,_utils_deviceId__WEBPACK_IMPORTED_MODULE_6__.getOrCreateDeviceId)(), []); 4234 const [polls, setPolls] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); 4235 const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); 4236 const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); 4237 const [selectedOptions, setSelectedOptions] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); 4238 const [voteMessages, setVoteMessages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); 4239 const [submitting, setSubmitting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); 4240 const [isModalOpen, setIsModalOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); 4241 const [expanded, setExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); 4242 // â STORE pollID & voteId 4243 const [drawData, setDrawData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); 4244 const voteKey = (pollId)=>"poll_voted_".concat(pollId, "_").concat(user_id || deviceId); 4245 // ---------------- FETCH POLLS ---------------- 4246 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ 4247 const fetchPolls = async ()=>{ 4248 try {
4249 setLoading(true); 4250 const response = await fetch(_constants_api__WEBPACK_IMPORTED_MODULE_4__/* .API_ENDPOINTS */ .Pn.POLL, { 4251 method: "POST", 4252 cache: "no-store", 4253 headers: { 4254 "Content-Type": "application/json", 4255 Accept: "application/json" 4256 } 4257 }); 4258 const data = await response.json(); 4259 setPolls(data.poll.filter((p)=>p.status === "Active")); 4260 } catch (err) { 4261 setError(err.message); 4262 } finally{ 4263 setLoading(false); 4264 } 4265 }; 4266 fetchPolls(); 4267 }, []); 4268 // ---------------- LOAD SAVED VOTES ---------------- 4269 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ 4270 const selections = {}; 4271 polls.forEach((p)=>{ 4272 const saved = localStorage.getItem(voteKey(p.id)); 4273 if (saved && saved !== "1") selections[p.id] = saved; 4274 }); 4275 setSelectedOptions(selections); 4276 }, [ 4277 polls 4278 ]); 4279 // ---------------- OPTION CHANGE ---------------- 4280 const handleOptionChange = (pollId, option)=>{ 4281 if (submitting[pollId]) return; 4282 setSelectedOptions((prev)=>({ 4283 ...prev, 4284 [pollId]: option 4285 })); 4286 const prevStored = localStorage.getItem(voteKey(pollId)) || ""; 4287 const prevSelected = selectedOptions[pollId] || prevStored; 4288 submitVote(pollId, option, prevSelected); 4289 if (!isLoggedIn) setIsModalOpen(true); 4290 }; 4291 const handleLoginSuccess = ()=>{ 4292 setIsModalOpen(false); 4293 }; 4294 // ---------------- SUBMIT VOTE ---------------- 4295 const submitVote = async (pollId, option, prevSelected)=>{ 4296 try { 4297 var _data_data, _data_data1, _data_result, _data_result1, _data_data2, _data_data3, _data_result2, _data_result3; 4298 setSubmitting((prev)=>({ 4299 ...prev, 4300 [pollId]: true 4301 })); 4302 setVoteMessages((prev)=>({ 4303 ...prev, 4304 [pollId]: "Submitting..." 4305 })); 4306 let currentUserId = user_id || localStorage.getItem("userId"); 4307 const payload = { 4308 pollID: String(pollId), 4309 selectedAnswer: String(option), 4310 userID: currentUserId || "", 4311 IPaddress: String(deviceId || "") 4312 }; 4313 const res = await fetch(_constants_api__WEBPACK_IMPORTED_MODULE_4__/* .API_ENDPOINTS */ .Pn.POLL_SUBMIT, { 4314 method: "POST", 4315 cache: "no-store", 4316 headers: { 4317 "Content-Type": "application/json", 4318 Accept: "application/json" 4319 }, 4320 body: JSON.stringify(payload) 4321 }); 4322 const data = await res.json(); 4323 // â SAFE EXTRACTION (FIXED) 4324 const pollID = (data === null || data === void 0 ? void 0 : data.pollID) || (data === null || data === void 0 ? void 0 : data.poll_id) || (data === null || data === void 0 ? void 0 : (_data_data = data.data) === null || _data_data === void 0 ? void 0 : _data_data.pollID) || (data === null || data === void 0 ? void 0 : (_data_data1 = data.data) === null || _data_data1 === void 0 ? void 0 : _data_data1.poll_id) || (data === null || data === void 0 ? void 0 : (_data_result = data.result) === null || _data_result === void 0 ? void 0 : _data_result.pollID) || (data === null || data === void 0 ? void 0 : (_data_result1 = data.result) === null || _data_result1 === void 0 ? void 0 : _data_result1.poll_id); 4325 const voteId = (data === null || data === void 0 ? void 0 : data.voteId) || (data === null || data === void 0 ? void 0 : data.vote_id) || (data === null || data === void 0 ? void 0 : (_data_data2 = data.data) === null || _data_data2 === void 0 ? void 0 : _data_data2.voteId) || (data === null || data === void 0 ? void 0 : (_data_data3 = data.data) === null || _data_data3 === void 0 ? void 0 : _data_data3.vote_id) || (data === null || data === void 0 ? void 0 : (_data_result2 = data.result) === null || _data_result2 === void 0 ? void 0 : _data_result2.voteId) || (data === null || data === void 0 ? void 0 : (_data_result3 = data.result) === null || _data_result3 === void 0 ? void 0 : _data_result3.vote_id); 4326 if (pollID && voteId) { 4327 setDrawData({ 4328 pollID: String(pollID), 4329 voteId: String(voteId) 4330 }); 4331 setIsModalOpen(true); 4332 } else { 4333 console.error("â pollID or voteId not found:", data); 4334 } 4335 localStorage.setItem(voteKey(pollId), option); 4336 const msg = prevSelected && prevSelected !== option ? "તમારૠમત ઠપડà«àª થયૠàªà«." : "àªàªªàª¨à« મ
4336ત નà«àªàª§àª¾àª¯à« àªà«!"; 4337 setVoteMessages((prev)=>({ 4338 ...prev, 4339 [pollId]: data.message || msg 4340 })); 4341 setTimeout(()=>{ 4342 setVoteMessages((prev)=>{ 4343 const next = { 4344 ...prev 4345 }; 4346 delete next[pollId]; 4347 return next; 4348 }); 4349 }, 3000); 4350 } catch (e) { 4351 setVoteMessages((prev)=>({ 4352 ...prev, 4353 [pollId]: "મત àªàªªàªµàª¾àª®àª¾àª àªà«àª² થઠàªà«!" 4354 })); 4355 } finally{ 4356 setSubmitting((prev)=>({ 4357 ...prev, 4358 [pollId]: false 4359 })); 4360 } 4361 }; 4362 // ---------------- UI (UNCHANGED) ---------------- 4363 if (error || !polls.length) return null; 4364 return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 4365 className: "poll-section", 4366 children: [ 4367 polls.map((poll, index)=>{ 4368 const options = poll.answerOption.split(":"); 4369 const isLast = index === polls.length - 1; 4370 const words = poll.question.split(/\s+/); 4371 const isLong = words.length > 50; 4372 const text = expanded[poll.id] ? poll.question : words.slice(0, 50).join(" ") + (isLong ? "..." : ""); 4373 const isExpired = new Date() > new Date(poll.expiredate); 4374 return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 4375 className: "MCQs", 4376 style: { 4377 border: "1px solid #800d00", 4378 borderRadius: "12px 12px 0 0" 4379 }, 4380 children: [ 4381 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 4382 className: "storySectionNav blogs-head-bar first fastrack_head", 4383 style: { 4384 justifyContent: "center", 4385 alignItems: "center" 4386 }, 4387 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { 4388 className: "blog-category", 4389 children: "પà«àª²" 4390 }) 4391 }), 4392 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h5", { 4393 className: "MCQ-Question custom-gujrati-font", 4394 style: { 4395 margin: "10px" 4396 }, 4397 children: [ 4398 text, 4399 isLong && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 4400 onClick: ()=>setExpanded((prev)=>({ 4401 ...prev, 4402 [poll.id]: !prev[poll.id] 4403 })), 4404 style: { 4405 cursor: "pointer", 4406 color: "var(--primary-color)" 4407 }, 4408 children: expanded[poll.id] ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { 4409 title: "પાàªàª¾ àªàª¾àª", 4410 style: { 4411 background: "rgb(128, 13, 0)", 4412 border: "2px solid rgb(128, 13, 0)", 4413 borderRadius: "50%", 4414 width: "25px", 4415 height: "25px", 4416 color: "white", 4417 fontSize: "12px", 4418 cursor: "pointer", 4419 display: "inline-flex", 4420 alignItems: "center", 4421 justifyContent: "center", 4422 transition: "0.3s", 4423 backdropFilter: "blur(10px)", 4424 boxShadow: "rgba(0, 0, 0, 0.2) 0px 4px 15px", 4425 marginLeft: "5px" 4426 }, 4427 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("i", { 4428 className: "fas fa-arrow-left" 4429 }) 4430 }) : " વધૠવાàªàªà«" 4431 }) 4432 ] 4433 }), 4434 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 4435 className: "MCQ-options custom-gujrati-font", 4436 style: { 4437 padding: "10px", 4438 position: "relative" 4439 }, 4440 children: [ 4441 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { 4442 className: "MCQ-msg", 4443 children: voteMessages[poll.id] 4444 }), 4445 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 4446 style: { 4447 float: "left", 4448 width: "100%", 4449 position: "relative", 4450 gap: "10px", 4451 display: "flex", 4452 flexDirection: "column" 4453 }, 4454 children: [ 4455 new Date() > new Date(poll.expiredate) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 4456 className: "poll-overlay", 4457 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { 4458 children: poll.pollmsg 4459 }) 4460 }), 4461 options.map((opt, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 4462 className: "all-options", 4463 children: [ 4464 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { 4465 id: "pollOption".concat(poll.id), 4466 type: "radio", 4467 name: "pollOption".concat(poll.id), 4468 checked: selectedOptions[poll.id] === opt, 4469 onChange: ()=>handleOptionChange(poll.id, opt), 4470 disabled: isExpired || submitting[poll.id] 4471 }), 4472 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { 4473 htmlFor: "pollOption".concat(poll.id), 4474 children: opt 4475 }) 4476 ] 4477 }, i)) 4478 ] 4479 }), 4480 isLast && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(next_link__WEBPACK_IMPORTED_MODULE_2__["default"], { 4481 href: "/poll-result", 4482 className: "poleres", 4483 children: "પરિણામ
4483à« àªà«àª" 4484 }) 4485 ] 4486 }) 4487 ] 4488 }, poll.id); 4489 }), 4490 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_LoginOtpModal__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, { 4491 isOpen: isModalOpen, 4492 pollData: drawData, 4493 onClose: ()=>setIsModalOpen(false), 4494 onSuccess: handleLoginSuccess 4495 }) 4496 ] 4497 }); 4498}; 4499/* harmony default export */ __webpack_exports__["default"] = (PollSection); 4500 4501 4502/***/ }), 4503 4504/***/ 74425: 4505/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 4506 4507"use strict"; 4508/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57437); 4509/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2265); 4510/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27648); 4511/* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99376); 4512/* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30166); 4513/* harmony import */ var _constants_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(30949); 4514/* harmony import */ var _hooks_useSiteSetting__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(31090); 4515/* harmony import */ var _hooks_useStockmarketSiteSetting__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(71168); 4516/* __next_internal_client_entry_do_not_use__ default auto */ 4517 4518 4519 4520 4521 4522 4523 4524// import StockMarket from '@/components/StockMarket'; 4525/* ------------------------------------------------------- 4526 Lazy loaded sidebar components (KEEP AS IS) 4527-------------------------------------------------------- */ const PollSection = (0,next_dynamic__WEBPACK_IMPORTED_MODULE_4__["default"])(()=>Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 3798)), { 4528 loadableGenerated: { 4529 webpack: ()=>[ 4530 /*require.resolve*/(3798) 4531 ] 4532 }, 4533 ssr: false 4534}); 4535const EpaperRightSidebar = (0,next_dynamic__WEBPACK_IMPORTED_MODULE_4__["default"])(()=>__webpack_require__.e(/* import() */ 6019).then(__webpack_require__.bind(__webpack_require__, 66019)), { 4536 loadableGenerated: { 4537 webpack: ()=>[ 4538 /*require.resolve*/(66019) 4539 ] 4540 }, 4541 ssr: false 4542}); 4543const GstvMagazineBox = (0,next_dynamic__WEBPACK_IMPORTED_MODULE_4__["default"])(()=>__webpack_require__.e(/* import() */ 4531).then(__webpack_require__.bind(__webpack_require__, 84531)), { 4544 loadableGenerated: { 4545 webpack: ()=>[ 4546 /*require.resolve*/(84531) 4547 ] 4548 }, 4549 ssr: false 4550}); 4551const GSTVSatrangBox = (0,next_dynamic__WEBPACK_IMPORTED_MODULE_4__["default"])(()=>__webpack_require__.e(/* import() */ 4788).then(__webpack_require__.bind(__webpack_require__, 24788)), { 4552 loadableGenerated: { 4553 webpack: ()=>[ 4554 /*require.resolve*/(24788) 4555 ] 4556 }, 4557 ssr: false 4558}); 4559const GstvFastTrack = (0,next_dynamic__WEBPACK_IMPORTED_MODULE_4__["default"])(()=>__webpack_require__.e(/* import() */ 6788).then(__webpack_require__.bind(__webpack_require__, 16788)), { 4560 loadableGenerated: { 4561 webpack: ()=>[ 4562 /*require.resolve*/(16788) 4563 ] 4564 }, 4565 ssr: false 4566}); 4567const RashifalSidebar = (0,next_dynamic__WEBPACK_IMPORTED_MODULE_4__["default"])(()=>__webpack_require__.e(/* import() */ 4688).then(__webpack_require__.bind(__webpack_require__, 14688)), { 4568 loadableGenerated: { 4569 webpack: ()=>[ 4570 /*require.resolve*/(14688) 4571 ] 4572 }, 4573 ssr: false 4574}); 4575const WhatsappJoinBanner = (0,next_dynamic__WEBPACK_IMPORTED_MODULE_4__["default"])(()=>__webpack_require__.e(/* import() */ 5153).then(__webpack_require__.bind(__webpack_require__, 95153)), { 4576 loadableGenerated: { 4577 webpack: ()=>[ 4578 /*require.resolve*/(95153) 4579 ] 4580 }, 4581 ssr: false 4582}); 4583const LiveTvSection = (0,next_dynamic__WEBPACK_IMPORTED_MODULE_4__["default"])(()=>__webpack_require__.e(/* import() */ 6656).then(__webpack_require__.bind(__webpack_require__, 56656)), { 4584 loadableGenerated: { 4585 webpack: ()=>[ 4586 /*require.resolve*/(56656) 4587 ] 4588 }, 4589 ssr: false 4590}); 4591const WebStoriesSidebar = (0,next_dynamic__WEBPACK_IMPORTED_MODULE_4__["default"])(()=>__webpack_require__.e(/* import() */ 236).then(__webpack_require__.bind(__webpack_require__, 20236)), { 4592 loadableGenerated: { 4593 webpack: ()=>[ 4594 /*require.resolve*/(20236) 4595 ] 4596 }, 4597 ssr: false 4598}); 4599const LiveMatchScore = (0,next_dynamic__WEBPACK_IMPORTED_MODULE_4__["default"])(()=>__webpack_require__.e(/* import() */ 819).then(__webpack_require__.bind(__webpack_require__, 90819)), { 4600 loadableGenerated: { 4601 webpack: ()=>[ 4602 /*require.resolve*/(90819) 4603 ] 4604 }, 4605 ssr: false 4606}); 4607const StockMarket = (0,next_dynamic__WEBPACK_IMPORTED_MODULE_4__["default"])(()=>__webpack_require__.e(/* import() */ 3520).then(__webpack_require__.bind(__webpack_require__, 3520)), { 4608 loadableGenerated: { 4609 webpack: ()=>[ 4610 /*require.resolve*/(3520) 4611 ] 4612 }, 4613 ssr: false 4614}); 4615const RightSidebar = ()=>{ 4616 const pathname = (0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.usePathname)(); 4617 const isVideoPage = pathname === "/category/videos";
4618 const isPollPage = pathname === "/poll"; 4619 const { liveScoreEnabled } = (0,_hooks_useSiteSetting__WEBPACK_IMPORTED_MODULE_6__/* .useSiteSetting */ .Q)(); 4620 const { StockMarketEnabled } = (0,_hooks_useStockmarketSiteSetting__WEBPACK_IMPORTED_MODULE_7__/* .useStockmarketSiteSetting */ .l)(); 4621 /* ------------------------------------------------------- 4622 Delay heavy sidebar sections (SESSION CACHED) 4623 -------------------------------------------------------- */ const [showHeavySections, setShowHeavySections] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); 4624 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ 4625 // If already loaded once â don't delay again 4626 const cached = sessionStorage.getItem("gstv_sidebar_loaded"); 4627 if (cached === "1") { 4628 setShowHeavySections(true); 4629 return; 4630 } 4631 const timer = setTimeout(()=>{ 4632 setShowHeavySections(true); 4633 sessionStorage.setItem("gstv_sidebar_loaded", "1"); 4634 }, 1200); 4635 return ()=>clearTimeout(timer); 4636 }, []); 4637 return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { 4638 children: [ 4639 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 4640 className: "for-lg", 4641 children: StockMarketEnabled && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StockMarket, {}) 4642 }), 4643 !isPollPage && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(PollSection, {}), 4644 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { 4645 className: "for-lg", 4646 children: liveScoreEnabled && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LiveMatchScore, {}) 4647 }), 4648 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(EpaperRightSidebar, {}), 4649 showHeavySections && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { 4650 children: [ 4651 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(WhatsappJoinBanner, {}), 4652 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(GstvFastTrack, { 4653 className: "mb-4" 4654 }), 4655 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(GstvMagazineBox, { 4656 className: "mb-4" 4657 }), 4658 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(GSTVSatrangBox, {}), 4659 isVideoPage && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(WebStoriesSidebar, {}), 4660 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LiveTvSection, {}) 4661 ] 4662 }), 4663 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 4664 className: "download-app", 4665 style: { 4666 textAlign: "center" 4667 }, 4668 children: [ 4669 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h6", { 4670 style: { 4671 fontSize: "20px", 4672 fontFamily: '"Hind Vadodara", sans-serif', 4673 color: "#000", 4674 marginBottom: "10px" 4675 }, 4676 children: "GSTVનૠàªàªªà«àª²àª¿àªà«àª¶àª¨ ડાàªàª¨àª²à«àª¡ àªàª°à«" 4677 }), 4678 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 4679 className: "download-btn clearfix", 4680 style: { 4681 display: "inline-flex", 4682 gap: "10px" 4683 }, 4684 children: [ 4685 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(next_link__WEBPACK_IMPORTED_MODULE_2__["default"], { 4686 href: "https://play.google.com/store/apps/details?id=com.tops.gstvapps", 4687 target: "_blank", 4688 rel: "noopener noreferrer", 4689 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { 4690 src: "".concat(_constants_api__WEBPACK_IMPORTED_MODULE_5__/* .UPLOAD_PATHS */ .wM.PUBLIC_ASSETS, "/images/play-store.png"), 4691 alt: "Play Store", 4692 loading: "lazy"
4693 }) 4694 }), 4695 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(next_link__WEBPACK_IMPORTED_MODULE_2__["default"], { 4696 href: "https://apps.apple.com/in/app/gstv-gujarat-samachar/id1609602449", 4697 target: "_blank", 4698 rel: "noopener noreferrer", 4699 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { 4700 src: "".concat(_constants_api__WEBPACK_IMPORTED_MODULE_5__/* .UPLOAD_PATHS */ .wM.PUBLIC_ASSETS, "/images/appstore.png"), 4701 alt: "App Store", 4702 loading: "lazy" 4703 }) 4704 }) 4705 ] 4706 }) 4707 ] 4708 }), 4709 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 4710 className: "address", 4711 children: [ 4712 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h6", { 4713 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("ul", { 4714 className: "custom-address-list", 4715 children: [ 4716 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { 4717 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(next_link__WEBPACK_IMPORTED_MODULE_2__["default"], { 4718 href: "/career", 4719 children: "Career" 4720 }) 4721 }), 4722 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 4723 children: "|" 4724 }), 4725 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { 4726 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(next_link__WEBPACK_IMPORTED_MODULE_2__["default"], { 4727 href: "/contact-us", 4728 children: "Contact us" 4729 }) 4730 }), 4731 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 4732 children: "|" 4733 }), 4734 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { 4735 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(next_link__WEBPACK_IMPORTED_MODULE_2__["default"], { 4736 href: "/cookie-policy", 4737 children: "Cookie policy" 4738 }) 4739 }), 4740 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 4741 children: "|" 4742 }), 4743 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { 4744 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(next_link__WEBPACK_IMPORTED_MODULE_2__["default"], { 4745 href: "/privacy-policy", 4746 children: "Privacy policy" 4747 }) 4748 }), 4749 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 4750 children: "|" 4751 }), 4752 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { 4753 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(next_link__WEBPACK_IMPORTED_MODULE_2__["default"], { 4754 href: "/refund-policy", 4755 children: "Refund policy" 4756 }) 4757 }), 4758 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 4759 children: "|" 4760 }), 4761 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { 4762 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(next_link__WEBPACK_IMPORTED_MODULE_2__["default"], { 4763 href: "/terms-condition", 4764 children: "Terms & condition" 4765 }) 4766 }) 4767 ] 4768 }) 4769 }), 4770 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h6", { 4771 className: "custom-text", 4772 children: [ 4773 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { 4774 children: [ 4775 "Design & developed by ", 4776 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { 4777 className: "highlight-text", 4778 children: "GSTV" 4779 }) 4780 ] 4781 }), 4782 /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("br", {}), 4783 "\xa9 Copyright ", 4784 new Date().getFullYear(), 4785 " | GSTV. All rights reserved." 4786 ] 4787 }) 4788 ] 4789 }) 4790 ] 4791 }); 4792}; 4793/* ------------------------------------------------------- 4794 Prevent unnecessary re-renders 4795-------------------------------------------------------- */ /* harmony default export */ __webpack_exports__["default"] = (/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(RightSidebar)); 4796 4797 4798/***/ }), 4799 4800/***/ 32164: 4801/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 4802 4803"use strict"; 4804/* harmony export */ __webpack_require__.d(__webpack_exports__, { 4805/* harmony export */ BookmarkProvider: function() { return /* binding */ BookmarkProvider; } 4806/* harmony export */ }); 4807/* unused harmony export useBookmarks */ 4808/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57437); 4809/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2265); 4810/* harmony import */ var _constants_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30949); 4811/* __next_internal_client_entry_do_not_use__ useBookmarks,BookmarkProvider auto */ 4812 4813 4814const BookmarkContext = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(null); 4815const useBookmarks = ()=>useContext(BookmarkContext); 4816function BookmarkProvider(param) { 4817 let { children } = param; 4818 const [userId, setUserId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); 4819 const [bookmarks, setBookmarks] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); 4820 // Load logged-in user ID 4821 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ 4822 const s = localStorage.getItem("userSession"); 4823 if (!s) return setUserId(null); 4824 try { 4825 var _parsed_userData, _parsed_userData1; 4826 const parsed = JSON.parse(s); 4827 const uid = (parsed === null || parsed === void 0 ? void 0 : (_parsed_userData = parsed.userData) === null || _parsed_userData === void 0 ? void 0 : _parsed_userData.user_id
4827) || (parsed === null || parsed === void 0 ? void 0 : (_parsed_userData1 = parsed.userData) === null || _parsed_userData1 === void 0 ? void 0 : _parsed_userData1.id) || (parsed === null || parsed === void 0 ? void 0 : parsed.id) || (parsed === null || parsed === void 0 ? void 0 : parsed.user_id) || null; 4828 setUserId(uid); 4829 } catch (e) { 4830 setUserId(null); 4831 } 4832 }, []); 4833 // Load user bookmarks 4834 const loadUserBookmarks = ()=>{ 4835 if (!userId) return setBookmarks([]); 4836 const stored = JSON.parse(localStorage.getItem("bookmarks_".concat(userId)) || "[]"); 4837 setBookmarks(stored); 4838 }; 4839 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ 4840 loadUserBookmarks(); 4841 }, [ 4842 userId 4843 ]); 4844 // Save bookmarks to localStorage 4845 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ 4846 if (!userId) return; 4847 localStorage.setItem("bookmarks_".concat(userId), JSON.stringify(bookmarks)); 4848 // Notify other components 4849 window.dispatchEvent(new Event("storage")); 4850 }, [ 4851 bookmarks, 4852 userId 4853 ]); 4854 // Check status 4855 const isBookmarked = (id)=>bookmarks.some((b)=>b.id === id); 4856 // Add or Remove Bookmark via API 4857 const toggleBookmark = async (item)=>{ 4858 if (!userId) { 4859 alert("Please login to bookmark."); 4860 return; 4861 } 4862 const isAlready = isBookmarked(item.id); 4863 // API call 4864 const res = await fetch(_constants_api__WEBPACK_IMPORTED_MODULE_2__/* .API_ENDPOINTS */ .Pn.REMOVE_BOOKMARK, { 4865 method: "POST", 4866 cache: "no-store", 4867 headers: { 4868 "Content-Type": "application/x-www-form-urlencoded", 4869 Accept: "application/json" 4870 }, 4871 body: new URLSearchParams({ 4872 user_id: userId, 4873 news_id: item.id.toString() 4874 }) 4875 }); 4876 // Local update 4877 if (isAlready) { 4878 setBookmarks((prev)=>prev.filter((b)=>b.id !== item.id)); 4879 } else { 4880 setBookmarks((prev)=>[ 4881 ...prev, 4882 item 4883 ]); 4884 } 4885 }; 4886 // Force remove bookmark 4887 const removeBookmark = async function(id) { 4888 let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "news"; 4889 if (!userId) return; 4890 await fetch(_constants_api__WEBPACK_IMPORTED_MODULE_2__/* .API_ENDPOINTS */ .Pn.REMOVE_BOOKMARK, { 4891 method: "POST", 4892 cache: "no-store", 4893 headers: { 4894 "Content-Type": "application/x-www-form-urlencoded", 4895 Accept: "application/json" 4896 }, 4897 body: new URLSearchParams({ 4898 user_id: userId, 4899 news_id: id.toString() 4900 }) 4901 }); 4902 setBookmarks((prev)=>prev.filter((b)=>b.id !== id)); 4903 }; 4904 return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(BookmarkContext.Provider, { 4905 value: { 4906 bookmarks, 4907 isBookmarked, 4908 toggleBookmark, 4909 removeBookmark, 4910 reloadBookmarks: loadUserBookmarks, 4911 userId 4912 }, 4913 children: children 4914 }); 4915} 4916 4917 4918/***/ }), 4919 4920/***/ 9277: 4921/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 4922 4923"use strict"; 4924/* harmony export */ __webpack_require__.d(__webpack_exports__, { 4925/* harmony export */ CategorySettingsProvider: function() { return /* binding */ CategorySettingsProvider; }, 4926/* harmony export */ b: function() { return /* binding */ useCategorySettingsContext; } 4927/* harmony export */ }); 4928/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57437); 4929/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2265); 4930/* harmony import */ var _utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32080); 4931/* harmony import */ var _constants_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(30949); 4932/* __next_internal_client_entry_do_not_use__ CategorySettingsProvi
4932der,useCategorySettingsContext auto */ 4933 4934 4935 4936// Create Context 4937const CategorySettingsContext = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(undefined); 4938// Build Category Hierarchy Function 4939const buildCategoryHierarchy = (categories)=>{ 4940 console.log("\uD83D\uDD25 buildCategoryHierarchy: Building hierarchy from", categories.length, "categories"); 4941 // Separate parent and child categories 4942 const parentCategories = categories.filter((cat)=>cat.parentID === 0); 4943 const childCategories = categories.filter((cat)=>cat.parentID !== 0); 4944 console.log("\uD83D\uDD25 buildCategoryHierarchy: Parent categories:", parentCategories.length); 4945 console.log("\uD83D\uDD25 buildCategoryHierarchy: Child categories:", childCategories.length); 4946 // Build hierarchy 4947 const hierarchicalCategories = parentCategories.map((parent)=>{ 4948 const subcategories = childCategories.filter((child)=>child.parentID === parent.id); 4949 return { 4950 ...parent, 4951 subcategories: subcategories.length > 0 ? subcategories : undefined 4952 }; 4953 }); 4954 // Sort by catOrder 4955 const sortedCategories = hierarchicalCategories.sort((a, b)=>a.catOrder - b.catOrder); 4956 // Add static menu items 4957 const finalCategories = [ 4958 ...sortedCategories 4959 ]; 4960 console.log("\uD83D\uDD25 buildCategoryHierarchy: Final hierarchy built with", finalCategories.length, "total categories"); 4961 return finalCategories; 4962}; 4963// Provider Component 4964const CategorySettingsProvider = (param)=>{ 4965 let { children, useTopMenuEndpoint = false } = param; 4966 const [categories, setCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); 4967 const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); 4968 const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); 4969 const [isCached, setIsCached] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); 4970 const [isApiCallInProgress, setIsApiCallInProgress] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); 4971 // Load Category Settings Function 4972 const loadCategorySettings = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async function() { 4973 let forceRefresh = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; 4974 if (isApiCallInProgress) { 4975 console.log("\uD83D\uDD25 CategorySettingsProvider: API call already in progress, skipping..."); 4976 return; 4977 } 4978 // Check cache first (unless force refresh) 4979 if (!forceRefresh) { 4980 const cachedData = (0,_utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .loadFromCache */ .xB)(_utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .CACHE_KEYS */ .l6.CATEGORY_SETTINGS); 4981 if (cachedData && cachedData.length > 0) { 4982 console.log("\uD83D\uDD25 CategorySettingsProvider: Using cached data, skipping API call"); 4983 setCategories(cachedData); 4984 setLoading(false); 4985 setError(null); 4986 setIsCached(true); 4987 return; 4988 } 4989 } 4990 try { 4991 console.log("\uD83D\uDD25 CategorySettingsProvider: Starting API call..."); 4992 setIsApiCallInProgress(true); 4993 setLoading(true); 4994 setError(null); 4995 setIsCached(false); 4996 const apiUrl = useTopMenuEndpoint ? _constants_api__WEBPACK_IMPORTED_MODULE_3__/* .API_ENDPOINTS */ .Pn.CATEGORY_SETTING_TOP_MENU : _constants_api__WEBPACK_IMPORTED_MODULE_3__/* .API_ENDPOINTS */ .Pn.CATEGORY_SETTING; 4997 console.log("\uD83D\uDD25 CategorySettingsProvider: Fetching from URL:", apiUrl, useTopMenuEndpoint ? "(TOP_MENU)" : "(DEFAULT)"); 4998 const response = await fetch(apiUrl, { 4999 headers: { 5000 "Cache-Control": "max-age=3600" 5001 } 5002 }); 5003 console.log("\uD83D\uDD25 CategorySettingsProvider: API response status:", response.status); 5004 if (!response.ok) { 5005 throw new Error("HTTP error! status: ".concat(response.status)); 5006 } 5007 const data = await response.json();
5008 console.log("\uD83D\uDD25 CategorySettingsProvider: API response data received"); 5009 // Extract categories from the response 5010 const allCategories = data.category || []; 5011 console.log("\uD83D\uDD25 CategorySettingsProvider: All categories count:", allCategories.length); 5012 // Build hierarchical structure 5013 const hierarchicalCategories = buildCategoryHierarchy(allCategories); 5014 console.log("\uD83D\uDD25 CategorySettingsProvider: Hierarchical categories built:", hierarchicalCategories.length); 5015 // Save to cache 5016 (0,_utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .saveToCache */ .cW)(_utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .CACHE_KEYS */ .l6.CATEGORY_SETTINGS, hierarchicalCategories, _utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .CACHE_TTL */ .mJ.CATEGORY_SETTINGS); 5017 // Update state 5018 setCategories(hierarchicalCategories); 5019 setLoading(false); 5020 setError(null); 5021 setIsCached(false); 5022 console.log("\uD83D\uDD25 CategorySettingsProvider: Categories set successfully! Count:", hierarchicalCategories.length); 5023 } catch (err) { 5024 console.error("\uD83D\uDD25 CategorySettingsProvider: Error loading categories:", err); 5025 const errorMsg = err instanceof Error ? err.message : "Failed to load categories"; 5026 setError(errorMsg); 5027 setLoading(false); 5028 setIsCached(false); 5029 } finally{ 5030 setIsApiCallInProgress(false); 5031 } 5032 }, [ 5033 isApiCallInProgress, 5034 useTopMenuEndpoint 5035 ]); 5036 // Load on mount 5037 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ 5038 console.log("\uD83D\uDD25 CategorySettingsProvider: Component mounted, loading categories..."); 5039 loadCategorySettings(); 5040 }, [ 5041 loadCategorySettings 5042 ]); 5043 // Refetch function 5044 const refetch = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{ 5045 console.log("\uD83D\uDD25 CategorySettingsProvider: Refetch called - forcing fresh data"); 5046 (0,_utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .clearCache */ .LK)(_utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .CACHE_KEYS */ .l6.CATEGORY_SETTINGS); 5047 setCategories([]); 5048 loadCategorySettings(true); 5049 }, [ 5050 loadCategorySettings 5051 ]); 5052 // Clear cache function 5053 const clearCacheData = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{ 5054 console.log("\uD83D\uDD25 CategorySettingsProvider: Clear cache called"); 5055 (0,_utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .clearCache */ .LK)(_utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .CACHE_KEYS */ .l6.CATEGORY_SETTINGS); 5056 setCategories([]); 5057 setLoading(true); 5058 setError(null); 5059 setIsCached(false); 5060 }, []); 5061 // Invalidate cache function 5062 const invalidateCache = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async ()=>{ 5063 console.log("\uD83D\uDD25 CategorySettingsProvider: Invalidate cache called"); 5064 try { 5065 const success = await (0,_utils_cacheUtils__WEBPACK_IMPORTED_MODULE_2__/* .invalidateCategorySettingsCache */ .D2)(); 5066 if (success) { 5067 clearCacheData(); 5068 loadCategorySettings(true); 5069 } 5070 return success; 5071 } catch (error) { 5072 console.error("\uD83D\uDD25 CategorySettingsProvider: Error invalidating cache:", error); 5073 return false; 5074 } 5075 }, [ 5076 clearCacheData, 5077 loadCategorySettings 5078 ]); 5079 const value = { 5080 categories, 5081 loading, 5082 error, 5083 isCached, 5084 refetch, 5085 clearCacheData, 5086 invalidateCache 5087 }; 5088 return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CategorySettingsContext.Provider, { 5089 value: value, 5090 children: children 5091 }); 5092}; 5093// Custom Hook to use the context 5094const useCategorySettingsContext = ()=>{ 5095 const context = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(CategorySettingsContext); 5096 if (context === undefined) { 5097 throw new Error("useCategorySettingsContext must be used within a CategorySettingsProvi
5097der"); 5098 } 5099 return context; 5100}; 5101 5102 5103/***/ }), 5104 5105/***/ 3959: 5106/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 5107 5108"use strict"; 5109/* harmony export */ __webpack_require__.d(__webpack_exports__, { 5110/* harmony export */ K: function() { return /* binding */ useSettingsContext; }, 5111/* harmony export */ SettingsProvider: function() { return /* binding */ SettingsProvider; } 5112/* harmony export */ }); 5113/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57437); 5114/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2265); 5115/* harmony import */ var _constants_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30949); 5116/* __next_internal_client_entry_do_not_use__ SettingsProvider,useSettingsContext auto */ 5117 5118 5119const SettingsContext = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(undefined); 5120const CACHE_KEY = "site_settings_cache_v1"; 5121const CACHE_TTL_MS = 10 * 60 * 1000; // 10 minutes 5122function resolveUrl(url) { 5123 if (!url || url.trim() === "") return "/images/logo.png"; 5124 const val = url.trim(); 5125 if (val.startsWith("http://") || val.startsWith("https://")) return val; 5126 if (val.startsWith("/")) return "".concat(_constants_api__WEBPACK_IMPORTED_MODULE_2__/* .MEDIA_BASE_URL */ .uW).concat(val); 5127 return "".concat(_constants_api__WEBPACK_IMPORTED_MODULE_2__/* .MEDIA_BASE_URL */ .uW, "/").concat(val); 5128} 5129function SettingsProvider(param) { 5130 let { children } = param; 5131 const [settings, setSettings] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); 5132 const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); 5133 const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); 5134 const mounted = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true); 5135 const parseSettingsPayload = (raw)=>{ 5136 if (!raw) return null; 5137 // API may return { settings: [...] } or { setting: [...] } 5138 const arr = Array.isArray(raw === null || raw === void 0 ? void 0 : raw.settings) ? raw.settings : Array.isArray(raw === null || raw === void 0 ? void 0 : raw.setting) ? raw.setting : []; 5139 if (arr.length === 0) return null; 5140 // If the API returns an array of key/value pairs, reduce; else assume first object contains keys 5141 const first = arr[0]; 5142 if (Array.isArray(first)) { 5143 try { 5144 return first.reduce((acc, item)=>{ 5145 if (item && item.key) acc[item.key] = item.value; 5146 return acc; 5147 }, {}); 5148 } catch (e) { 5149 return null; 5150 } 5151 } 5152 return first; 5153 }; 5154 const loadFromCache = ()=>{ 5155 try { 5156 const raw = localStorage.getItem(CACHE_KEY); 5157 if (!raw) return null; 5158 const { ts, data } = JSON.parse(raw); 5159 if (Date.now() - ts > CACHE_TTL_MS) return null; 5160 return data; 5161 } catch (e) { 5162 return null; 5163 } 5164 }; 5165 const saveToCache = (data)=>{ 5166 try { 5167 localStorage.setItem(CACHE_KEY, JSON.stringify({ 5168 ts: Date.now(), 5169 data 5170 })); 5171 } catch (e) { 5172 // ignore 5173 } 5174 }; 5175 const fetchSettings = async ()=>{ 5176 try { 5177 setLoading(true); 5178 setError(null); 5179 const res = await (0,_constants_api__WEBPACK_IMPORTED_MODULE_2__/* .commonApiGet */ .MD)(_constants_api__WEBPACK_IMPORTED_MODULE_2__/* .API_ENDPOINTS */ .Pn.CATEGORY_SETTING); 5180 if (!res.ok) throw new Error("HTTP ".concat(res.status)); 5181 const json = await res.json(); 5182 const parsed = parseSettingsPayload(json); 5183 if (parsed) { 5184 setSettings(parsed); 5185 saveToCache(parsed); 5186 } else { 5187 throw new Error("Invalid settings payload"); 5188 } 5189 } catch (e) { 5190 setError((e === null || e === void 0 ? void 0 : e.message) || "Failed to load settings"); 5191 // Fallback: try cache or defaults 5192 const cached = loadFromCache(); 5193 if (cached) { 5194 setSettings(cached); 5195 } else { 5196 setSettings({ 5197 logo: "/images/logo.png", 5198 metatitle: "GSTV", 5199 metakeyword: "GSTV, Gujarat, News, Samachar, TV, Gujarati News", 5200 metadesc: "GSTV News Website", 5201 gujrat_agree_text: "હà«àª સàªàª®àª¤ àªà«àª àªà« મારા દà«àªµàª¾àª°àª¾ ઠપલà«àª¡ àªàª°àªµàª¾àª®àª¾àª àªàªµàª¤à« સામàªà«àª°à« સàªàªªà«àª°à«àª£àªªàª£à« સતà«àª¯ ઠનૠવાસà«àª¤àªµàª¿àª àªà«. àªà« àªà«àª પણ પà«àª°àªàª¾àª°àª¨à« àªà«à
5201ªà« માહિતૠમળશૠતૠતà«àª¨à« સàªàªªà«àª°à«àª£ àªàªµàª¾àª¬àª¦àª¾àª°à« મારૠરહà«àª¶à«.", 5202 campus_agree_text: "હà«àª સહમત àªà«àª àªà« મારા દà«àªµàª¾àª°àª¾ ઠપલà«àª¡ àªàª°àªµàª¾àª®àª¾àª àªàªµàª¤à« સામàªà«àª°à« àªà«àªàªªàª£ પà«àª°àªàª¾àª°àª¨à« વાàªàª§àª¾àªàª¨àª, ઠશà«àª²à«àª², હિàªàª¸àª àªà« àªà«àª°àªàª¾àª¯àª¦à«àª¸àª° નથà«. àªà« àªàªµà« àªà«àª સામàªà«àª°à« મળશૠતૠતà«àª¨à« સàªàªªà«àª°à«àª£ àªàªµàª¾àª¬àª¦àª¾àª°à« મારૠરહà«àª¶à«." 5203 }); 5204 } 5205 } finally{ 5206 if (mounted.current) setLoading(false); 5207 } 5208 }; 5209 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ 5210 mounted.current = true; 5211 const cached = loadFromCache(); 5212 if (cached) { 5213 var _JSON_parse; 5214 setSettings(cached); 5215 setLoading(false); 5216 // Refresh in background if stale soon 5217 if (Date.now() - (((_JSON_parse = JSON.parse(localStorage.getItem(CACHE_KEY) || "{}")) === null || _JSON_parse === void 0 ? void 0 : _JSON_parse.ts) || 0) > CACHE_TTL_MS / 2) { 5218 fetchSettings(); 5219 } 5220 } else { 5221 fetchSettings(); 5222 } 5223 return ()=>{ 5224 mounted.current = false; 5225 }; 5226 }, []); 5227 const value = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>({ 5228 settings, 5229 loading, 5230 error, 5231 logoUrl: resolveUrl(settings === null || settings === void 0 ? void 0 : settings.logo), 5232 refresh: fetchSettings 5233 }), [ 5234 settings, 5235 loading, 5236 error 5237 ]); 5238 return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SettingsContext.Provider, { 5239 value: value, 5240 children: children 5241 }); 5242} 5243function useSettingsContext() { 5244 const ctx = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(SettingsContext); 5245 if (!ctx) return undefined; 5246 return ctx; 5247} 5248 5249 5250/***/ }), 5251 5252/***/ 89079: 5253/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 5254 5255"use strict"; 5256/* harmony export */ __webpack_require__.d(__webpack_exports__, { 5257/* harmony export */ H: function() { return /* binding */ useCategorySettings; } 5258/* harmony export */ }); 5259/* harmony import */ var _contexts_CategorySettingsContext__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9277); 5260/* __next_internal_client_entry_do_not_use__ useCategorySettings auto */ /** 5261 * DEPRECATED: This hook is now a wrapper around useCategorySettingsContext 5262 * Please use useCategorySettingsContext directly from @/contexts/CategorySettingsContext 5263 * This file is kept for backward compatibility only. 5264 */ 5265/** 5266 * Main hook to access category settings 5267 * This is now a wrapper around the CategorySettingsContext 5268 */ const useCategorySettings = ()=>{ 5269 const context = (0,_contexts_CategorySettingsContext__WEBPACK_IMPORTED_MODULE_0__/* .useCategorySettingsContext */ .b)(); 5270 return { 5271 categories: context.categories, 5272 loading: context.loading, 5273 error: context.error, 5274 refetch: context.refetch, 5275 clearCache: context.clearCacheData, 5276 invalidateCache: context.invalidateCache, 5277 isCached: context.isCached 5278 }; 5279}; 5280 5281 5282/***/ }), 5283 5284/***/ 99230: 5285/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 5286 5287"use strict"; 5288/* harmony export */ __webpack_require__.d(__webpack_exports__, { 5289/* harmony export */ r: function() { return /* binding */ useSettings; } 5290/* harmony export */ }); 5291/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2265); 5292/* harmony import */ var _contexts_SettingsContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3959); 5293/* harmony import */ var _constants_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30949); 5294/* __next_internal_client_entry_do_not_use__ useSettings auto */ 5295 5296 5297function resolveUrl(url) { 5298 if (!url || url.trim() === "") return "/images/logo.png"; 5299 const val = url.trim(); 5300 if (val.startsWith("http://") || val.startsWith("https://")) return val; 5301 if (val.startsWith("/")) return "".concat(_constants_api__WEBPACK_IMPORTED_MODULE_2__/* .MEDIA_BASE_URL */ .uW).concat(val); 5302 return "".concat(_constants_api__WEBPACK_IMPORTED_MODULE_2__/* .MEDIA_BASE_URL */ .uW, "/").concat(val); 5303} 5304// Hook that prefers SettingsContext if present, and falls back to a one-off fetch 5305const useSettings = ()=>{ 5306 const ctx = (0,_contexts_SettingsContext__WEBPACK_IMPORTED_MODULE_1__/* .useSettingsContext */ .K)(); 5307 // Fallback: minimal client-side fetch (rarely used if provider is mounted) 5308 const [settings, setSettings] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); 5309 const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true); 5310 const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); 5311 const [logoUrl, setLogoUrl] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("/images/logo.png"); 5312 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(()=>{ 5313 // If context is available, don't fetch 5314 if (ctx) return; 5315 const fetchSettings = async ()=>{ 5316 try {
5317 setLoading(true); 5318 setError(null); 5319 const res = await (0,_constants_api__WEBPACK_IMPORTED_MODULE_2__/* .commonApiGet */ .MD)(_constants_api__WEBPACK_IMPORTED_MODULE_2__/* .API_ENDPOINTS */ .Pn.CATEGORY_SETTING); 5320 if (!res.ok) throw new Error("HTTP ".concat(res.status)); 5321 const json = await res.json(); 5322 const arr = Array.isArray(json.settings) ? json.settings : Array.isArray(json.setting) ? json.setting : []; 5323 if (arr.length === 0) throw new Error("No settings data found"); 5324 const first = arr[0]; 5325 setSettings(first); 5326 setLogoUrl(resolveUrl(first === null || first === void 0 ? void 0 : first.logo)); 5327 } catch (e) { 5328 setError((e === null || e === void 0 ? void 0 : e.message) || "Failed to fetch settings"); 5329 setSettings({ 5330 logo: "/images/logo.png", 5331 metatitle: "GSTV", 5332 metakeyword: "GSTV, Gujarat, News, Samachar, TV, Gujarati News", 5333 metadesc: "GSTV News Website" 5334 }); 5335 setLogoUrl("/images/logo.png"); 5336 } finally{ 5337 setLoading(false); 5338 } 5339 }; 5340 fetchSettings(); 5341 }, [ 5342 ctx 5343 ]); 5344 // If context is available, return it 5345 if (ctx) { 5346 return { 5347 ...ctx, 5348 settings: ctx.settings, 5349 logoUrl: ctx.logoUrl 5350 }; 5351 } 5352 return { 5353 settings, 5354 loading, 5355 error, 5356 logoUrl 5357 }; 5358}; 5359 5360 5361/***/ }), 5362 5363/***/ 31090: 5364/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 5365 5366"use strict"; 5367/* harmony export */ __webpack_require__.d(__webpack_exports__, { 5368/* harmony export */ Q: function() { return /* binding */ useSiteSetting; } 5369/* harmony export */ }); 5370/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2265); 5371/* harmony import */ var _constants_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30949); 5372 5373 5374const useSiteSetting = ()=>{ 5375 const [liveScoreEnabled, setLiveScoreEnabled] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); 5376 const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true); 5377 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(()=>{ 5378 const fetchSetting = async ()=>{ 5379 try { 5380 var _json_setting; 5381 const res = await fetch(_constants_api__WEBPACK_IMPORTED_MODULE_1__/* .API_ENDPOINTS */ .Pn.CATEGORY_SETTING, { 5382 cache: "no-store" 5383 }); 5384 const json = await res.json(); 5385 if ((json === null || json === void 0 ? void 0 : (_json_setting = json.setting) === null || _json_setting === void 0 ? void 0 : _json_setting.length) > 0) { 5386 setLiveScoreEnabled(json.setting[0].livescore === 1); 5387 } 5388 } catch (error) { 5389 console.error("Setting API error", error); 5390 } finally{ 5391 setLoading(false); 5392 } 5393 }; 5394 fetchSetting(); 5395 }, []); 5396 return { 5397 liveScoreEnabled, 5398 loading 5399 }; 5400}; 5401 5402 5403/***/ }), 5404 5405/***/ 71168: 5406/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 5407 5408"use strict"; 5409/* harmony export */ __webpack_require__.d(__webpack_exports__, { 5410/* harmony export */ l: function() { return /* binding */ useStockmarketSiteSetting; } 5411/* harmony export */ }); 5412/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2265); 5413/* harmony import */ var _constants_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30949); 5414 5415 5416const useStockmarketSiteSetting = ()=>{ 5417 const [StockMarketEnabled, setStockMarketEnabled] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); 5418 const [PodcastEnabled, setPodcastEnabled] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); 5419 const [RashiEnabled, setRashiEnabled] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); 5420 const [LiveNewsHomeEnabled, setLiveNewsHomeEnabled] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); 5421 const [whatsappChannelLink, setWhatsappChannelLink] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); 5422 const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true); 5423 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(()=>{ 5424 const fetchSetting = async ()=>{ 5425 try { 5426 var _json_setting; 5427 const res = await fetch(_constants_api__WEBPACK_IMPORTED_MODULE_1__/* .API_ENDPOINTS */ .Pn.CATEGORY_SETTING, { 5428 cache: "no-store" 5429 }); 5430 const json = await res.json(); 5431 if ((json === null || json === void 0 ? void 0 : (_json_setting = json.setting) === null || _json_setting === void 0 ? void 0 : _json_setting.length) > 0) { 5432 setStockMarketEnabled(json.setting[0].stockmarket == 1); 5433 setPodcastEnabled(json.setting[0].podcast_status == 1); 5434 setRashiEnabled(json.setting[0].rashi_status == 1); 5435 setLiveNewsHomeEnabled(json.setting[0].livetvnews); 5436 } 5437 } catch (error) { 5438 console.error("Setting API error", error); 5439 } finally{
5440 setLoading(false); 5441 } 5442 }; 5443 // Fetch whatsapp channel link from CATEGORY_SETTING_WITH_PLAN (separate call, cached) 5444 const fetchWhatsapp = async ()=>{ 5445 try { 5446 var _json_setting; 5447 const res = await fetch(_constants_api__WEBPACK_IMPORTED_MODULE_1__/* .API_ENDPOINTS */ .Pn.CATEGORY_SETTING_WITH_PLAN, { 5448 method: "POST", 5449 cache: "no-store", 5450 headers: { 5451 "Content-Type": "application/json" 5452 }, 5453 body: JSON.stringify({ 5454 user_id: 0 5455 }) 5456 }); 5457 const json = await res.json(); 5458 const link = json === null || json === void 0 ? void 0 : (_json_setting = json.setting) === null || _json_setting === void 0 ? void 0 : _json_setting.whatsupchannellink; 5459 if (link && link.trim()) setWhatsappChannelLink(link.trim()); 5460 } catch (e) {} 5461 }; 5462 fetchSetting(); 5463 fetchWhatsapp(); 5464 }, []); 5465 return { 5466 StockMarketEnabled, 5467 PodcastEnabled, 5468 RashiEnabled, 5469 LiveNewsHomeEnabled, 5470 whatsappChannelLink, 5471 loading 5472 }; 5473}; 5474 5475 5476/***/ }), 5477 5478/***/ 32080: 5479/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 5480 5481"use strict"; 5482/* harmony export */ __webpack_require__.d(__webpack_exports__, { 5483/* harmony export */ D2: function() { return /* binding */ invalidateCategorySettingsCache; }, 5484/* harmony export */ Gj: function() { return /* binding */ getCacheInfo; }, 5485/* harmony export */ LK: function() { return /* binding */ clearCache; }, 5486/* harmony export */ YG: function() { return /* binding */ clearAllCaches; }, 5487/* harmony export */ cW: function() { return /* binding */ saveToCache; }, 5488/* harmony export */ l6: function() { return /* binding */ CACHE_KEYS; }, 5489/* harmony export */ mJ: function() { return /* binding */ CACHE_TTL; }, 5490/* harmony export */ wM: function() { return /* binding */ invalidateServerCache; }, 5491/* harmony export */ xB: function() { return /* binding */ loadFromCache; } 5492/* harmony export */ }); 5493/** 5494 * Cache utility functions for managing API caches 5495 */ // Client-side cache keys 5496const CACHE_KEYS = { 5497 CATEGORY_SETTINGS: "gstv_category_settings_client_cache" 5498}; 5499// Cache TTL configurations (in milliseconds) 5500const CACHE_TTL = { 5501 CATEGORY_SETTINGS: 30 * 60 * 1000, 5502 SHORT: 5 * 60 * 1000, 5503 MEDIUM: 30 * 60 * 1000, 5504 LONG: 60 * 60 * 1000, 5505 VERY_LONG: 24 * 60 * 60 * 1000 5506}; 5507/** 5508 * Generic function to save data to localStorage with expiration 5509 */ function saveToCache(key, data, ttlMs) { 5510 if (false) {} 5511 try { 5512 const cacheEntry = { 5513 data, 5514 timestamp: Date.now(), 5515 expiresAt: Date.now() + ttlMs 5516 }; 5517 localStorage.setItem(key, JSON.stringify(cacheEntry)); 5518 } catch (error) { 5519 console.warn("\uD83D\uDCBE Cache: Failed to save to ".concat(key, ":"), error); 5520 } 5521} 5522/** 5523 * Generic function to load data from localStorage with expiration check 5524 */ function loadFromCache(key) { 5525 if (false) {} 5526 try { 5527 const cached = localStorage.getItem(key); 5528 if (!cached) return null; 5529 const cacheEntry = JSON.parse(cached); 5530 // Check if cache is still valid 5531 if (Date.now() > cacheEntry.expiresAt) { 5532 localStorage.removeItem(key); 5533 return null; 5534 } 5535 return cacheEntry.data; 5536 } catch (error) { 5537 localStorage.removeItem(key); 5538 return null; 5539 } 5540} 5541/** 5542 * Clear specific cache entry 5543 */ function clearCache(key) { 5544 if (false) {} 5545 try { 5546 localStorage.removeItem(key); 5547 } catch (error) { 5548 console.warn("\uD83D\uDCBE Cache: Failed to clear ".concat(key, ":"), error); 5549 } 5550} 5551/** 5552 * Clear all GSTV caches 5553 */ function clearAllCaches() { 5554 if (false) {} 5555 try { 5556 Object.values(CACHE_KEYS).forEach((key)=>{ 5557 localStorage.removeItem(key); 5558 }); 5559 } catch (error) { 5560 console.warn("\uD83D\uDCBE Cache: Failed to clear all caches:", error); 5561 } 5562} 5563/** 5564 * Get cache info for debugging 5565 */ function getCacheInfo(key) { 5566 if (false) {} 5567 try { 5568 const cached = localStorage.getItem(key); 5569 if (!cached) return { 5570 exists: false, 5571 expired: false, 5572 age: 0 5573 }; 5574 const cacheEntry = JSON.parse(cached); 5575 const now = Date.now(); 5576 const age = now - cacheEntry.timestamp; 5577 const expired = now > cacheEntry.expiresAt; 5578 return { 5579 exists: true, 5580 expired, 5581 age 5582 }; 5583 } catch (error) { 5584 return null; 5585 } 5586} 5587/** 5588 * Invalidate server-side cache by calling the DELETE endpoint
5589 */ async function invalidateServerCache(endpoint) { 5590 try { 5591 const response = await fetch(endpoint, { 5592 method: "DELETE", 5593 headers: { 5594 "Content-Type": "application/json" 5595 } 5596 }); 5597 if (response.ok) { 5598 return true; 5599 } else { 5600 return false; 5601 } 5602 } catch (error) { 5603 return false; 5604 } 5605} 5606/** 5607 * Invalidate both client and server caches for category settings 5608 */ async function invalidateCategorySettingsCache() { 5609 try { 5610 // Clear client cache 5611 clearCache(CACHE_KEYS.CATEGORY_SETTINGS); 5612 // Invalidate server cache 5613 const serverInvalidated = await invalidateServerCache("/api/categorysetting"); 5614 return serverInvalidated; 5615 } catch (error) { 5616 return false; 5617 } 5618} 5619 5620 5621/***/ }), 5622 5623/***/ 84798: 5624/***/ (function() { 5625 5626// extracted by mini-css-extract-plugin 5627 5628/***/ }), 5629 5630/***/ 9783: 5631/***/ (function() { 5632 5633// extracted by mini-css-extract-plugin 5634 5635/***/ }), 5636 5637/***/ 56962: 5638/***/ (function() { 5639 5640// extracted by mini-css-extract-plugin 5641 5642/***/ }), 5643 5644/***/ 12610: 5645/***/ (function() { 5646 5647// extracted by mini-css-extract-plugin 5648 5649/***/ }), 5650 5651/***/ 74826: 5652/***/ (function() { 5653 5654// extracted by mini-css-extract-plugin 5655 5656/***/ }), 5657 5658/***/ 65612: 5659/***/ (function() { 5660 5661// extracted by mini-css-extract-plugin 5662 5663/***/ }), 5664 5665/***/ 84945: 5666/***/ (function() { 5667 5668// extracted by mini-css-extract-plugin 5669 5670/***/ }), 5671 5672/***/ 64831: 5673/***/ (function() { 5674 5675// extracted by mini-css-extract-plugin 5676 5677/***/ }), 5678 5679/***/ 10676: 5680/***/ (function() { 5681 5682// extracted by mini-css-extract-plugin 5683 5684/***/ }), 5685 5686/***/ 56310: 5687/***/ (function() { 5688 5689// extracted by mini-css-extract-plugin 5690 5691/***/ }), 5692 5693/***/ 26848: 5694/***/ (function() { 5695 5696// extracted by mini-css-extract-plugin 5697 5698/***/ }), 5699 5700/***/ 48290: 5701/***/ (function() { 5702 5703// extracted by mini-css-extract-plugin 5704 5705/***/ }), 5706 5707/***/ 13958: 5708/***/ (function() { 5709 5710// extracted by mini-css-extract-plugin 5711 5712/***/ }), 5713 5714/***/ 8993: 5715/***/ (function() { 5716 5717// extracted by mini-css-extract-plugin 5718 5719/***/ }), 5720 5721/***/ 83700: 5722/***/ (function() { 5723 5724// extracted by mini-css-extract-plugin 5725 5726/***/ }), 5727 5728/***/ 40661: 5729/***/ (function() { 5730 5731// extracted by mini-css-extract-plugin 5732 5733/***/ }), 5734 5735/***/ 88341: 5736/***/ (function() { 5737 5738// extracted by mini-css-extract-plugin 5739 5740/***/ }), 5741 5742/***/ 39273: 5743/***/ (function() { 5744 5745// extracted by mini-css-extract-plugin 5746 5747/***/ }), 5748 5749/***/ 95254: 5750/***/ (function() { 5751 5752// extracted by mini-css-extract-plugin 5753 5754/***/ }), 5755 5756/***/ 28786: 5757/***/ (function() { 5758 5759// extracted by mini-css-extract-plugin 5760 5761/***/ }), 5762 5763/***/ 60510: 5764/***/ (function() { 5765 5766// extracted by mini-css-extract-plugin 5767 5768/***/ }) 5769 5770}, 5771/******/ function(__webpack_require__) { // webpackRuntimeModules 5772/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); } 5773/******/ __webpack_require__.O(0, [708,6269,8086,8052,7293,244,9962,2564,2240,9669,2972,29,3145,8003,4306,5605,2971,2117,1744], function() { return __webpack_exec__(38783); }); 5774/******/ var __webpack_exports__ = __webpack_require__.O(); 5775/******/ _N_E = __webpack_exports__; 5776/******/ } 5777]);
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.