"use strict";
exports.id = 6596;
exports.ids = [6596];
exports.modules = {

/***/ 5045:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);

const Footer = ()=>{
    return /*#__PURE__*/ _jsx("div", {
        className: "w-full bg-black py-2 text-center text-red-50 mt-auto dir-ltr font-mono",
        children: "\xa9133pr"
    });
};
/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (Footer)));


/***/ }),

/***/ 4036:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Header_UserMenu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1201);
/* harmony import */ var _Header_MobileMenu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(756);
/* harmony import */ var _SideNav_Logo__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2508);
/* harmony import */ var _context_UserDataContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3401);
/* harmony import */ var _Header_Notification__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1918);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_Header_UserMenu__WEBPACK_IMPORTED_MODULE_1__]);
_Header_UserMenu__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];






const Header = ({ isMobile  })=>{
    const { userData  } = (0,_context_UserDataContext__WEBPACK_IMPORTED_MODULE_4__/* .useUser */ .aF)();
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
        className: "w-full bg-theme-primary py-2.5 px-5",
        children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
            className: "flex items-center w-full",
            children: [
                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    className: "w-4/12" + (isMobile ? " order-2 text-left" : " order-0 text-right"),
                    children: [
                        isMobile && userData.status && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Header_Notification__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
                            count: userData.data.notification_count,
                            isMobile: isMobile
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Header_UserMenu__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
                            isMobile: isMobile
                        })
                    ]
                }),
                isMobile && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: "w-4/12 text-center order-1 invert",
                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_SideNav_Logo__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {})
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: "w-4/12 text-left order-0",
                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Header_MobileMenu__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {})
                        })
                    ]
                }),
                !isMobile && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: "w-8/12 text-left",
                    children: userData.status && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Header_Notification__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
                        count: userData.data.notification_count,
                        isMobile: isMobile
                    })
                })
            ]
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Header);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 756:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_icons_rx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5452);
/* harmony import */ var react_icons_rx__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_icons_rx__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _SideNav_Menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3029);
/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4147);
/* harmony import */ var react_icons_ai__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9847);
/* harmony import */ var react_icons_ai__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_icons_ai__WEBPACK_IMPORTED_MODULE_5__);






const MobileMenu = ()=>{
    const [isOpen, setIsOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const handleClose = ()=>{
        setIsOpen(false);
    };
    const handleOpen = ()=>{
        setIsOpen(true);
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                onClick: handleOpen,
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_rx__WEBPACK_IMPORTED_MODULE_2__.RxHamburgerMenu, {
                    size: 25
                })
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: "absolute right-0 top-0 bg-white h-screen w-screen z-10 flex flex-col pt-10" + (!isOpen ? " translate-x-full" : " translate-x-0"),
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                        onClick: handleClose,
                        className: "absolute left-10 top-5 z-12 text-theme-secondary border border-theme-gray rounded-full p-2 hover:bg-white hover:shadow",
                        role: "button",
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_ai__WEBPACK_IMPORTED_MODULE_5__.AiOutlineClose, {
                            size: 25
                        })
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: "h-full",
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_SideNav_Menu__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {})
                    }),
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: "bg-theme-gray py-5 text-theme-dark-gray text-center text-sm",
                        children: [
                            "Ver ",
                            _package_json__WEBPACK_IMPORTED_MODULE_4__/* .version */ .i8
                        ]
                    })
                ]
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MobileMenu);


/***/ }),

/***/ 1918:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ Header_Notification)
});

// EXTERNAL MODULE: external "react/jsx-runtime"
var jsx_runtime_ = __webpack_require__(997);
// EXTERNAL MODULE: external "react"
var external_react_ = __webpack_require__(6689);
// EXTERNAL MODULE: external "cookie-cutter"
var external_cookie_cutter_ = __webpack_require__(4957);
var external_cookie_cutter_default = /*#__PURE__*/__webpack_require__.n(external_cookie_cutter_);
// EXTERNAL MODULE: external "react-icons/fi"
var fi_ = __webpack_require__(2750);
;// CONCATENATED MODULE: ./components/layout/dashboard/Header/NotificationContent.js


const NotificationContent = ({ title , content , close  })=>{
    return /*#__PURE__*/ jsx_runtime_.jsx("div", {
        className: "h-screen w-screen bg-gray-300 bg-opacity-25 fixed top-0 left-0 flex justify-center items-center",
        children: /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
            className: "w-full lg:w-1/3 h-full lg:h-[400px] bg-white rounded-lg shadow",
            children: [
                /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                    className: "flex justify-between items-center p-3 border-b border-gray-300",
                    children: [
                        /*#__PURE__*/ jsx_runtime_.jsx("h1", {
                            children: title
                        }),
                        /*#__PURE__*/ jsx_runtime_.jsx("span", {
                            role: "button",
                            onClick: close,
                            children: /*#__PURE__*/ jsx_runtime_.jsx(fi_.FiX, {})
                        })
                    ]
                }),
                /*#__PURE__*/ jsx_runtime_.jsx("div", {
                    className: "p-3 overflow-y-auto",
                    children: content
                })
            ]
        })
    });
};
/* harmony default export */ const Header_NotificationContent = (NotificationContent);

// EXTERNAL MODULE: ./context/UserDataContext.js
var UserDataContext = __webpack_require__(3401);
;// CONCATENATED MODULE: ./components/layout/dashboard/Header/NotificationList.js






const NotificationList = ({ count  })=>{
    const [Data, setData] = (0,external_react_.useState)([]);
    const [isError, setIsError] = (0,external_react_.useState)(false);
    const [modalShow, setModalShow] = (0,external_react_.useState)(false);
    const [modalData, setModalData] = (0,external_react_.useState)([]);
    const token = external_cookie_cutter_default().get("token");
    const { refetch  } = (0,UserDataContext/* useUser */.aF)();
    const GetData = ()=>{
        fetch("/api/notification/my", {
            method: "GET",
            headers: {
                Authorization: "bearer " + token
            }
        }).then(async (r)=>{
            if (r.status === 200) {
                setData(await r.json());
            } else {
                setIsError(true);
            }
        });
    };
    const UpdateData = async (id, data)=>{
        await fetch("/api/notification/edit/" + id, {
            body: JSON.stringify(data),
            method: "POST",
            headers: {
                Authorization: "bearer " + token
            }
        }).then(async (r)=>{
            return r.status === 200;
        });
    };
    const handleShowModal = (id)=>{
        const newData = Data.find((e)=>e.id === id);
        setModalData(newData);
        setModalShow(true);
        const DataIndex = Data.findIndex((x)=>x.id === id);
        if (DataIndex !== -1) {
            const DataRead = {
                ...Data[DataIndex],
                Notification_Receiver: {
                    isRead: true
                }
            };
            setData([
                ...Data.slice(0, DataIndex),
                DataRead,
                ...Data.slice(DataIndex + 1)
            ]);
            UpdateData(id, {
                isRead: "true"
            }).then((r)=>{
                setInterval(()=>{
                    refetch();
                    GetData();
                }, 5000);
            });
        }
    };
    const handleCloseModal = ()=>{
        setModalData([]);
        setModalShow(false);
    };
    const handleUnRead = (id)=>{
        const DataIndex = Data.findIndex((x)=>x.id === id);
        if (DataIndex !== -1) {
            const DataRead = {
                ...Data[DataIndex],
                Notification_Receiver: {
                    isRead: false
                }
            };
            setData([
                ...Data.slice(0, DataIndex),
                DataRead,
                ...Data.slice(DataIndex + 1)
            ]);
            UpdateData(id, {
                isRead: "false"
            }).then((r)=>{
                setInterval(()=>{
                    refetch();
                    GetData();
                }, 5000);
            });
        }
    };
    (0,external_react_.useEffect)(()=>{
        if (!isError && count > 0 && Data.length === 0) {
            GetData();
        }
    }, []);
    return /*#__PURE__*/ (0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
        children: [
            Data.map((notif, index)=>{
                return /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                    className: "block relative px-4 py-3 text-sm text-gray-600 transition-colors duration-200 transform hover:bg-gray-100 text-right group/item",
                    children: [
                        !notif.Notification_Receiver.isRead ? /*#__PURE__*/ jsx_runtime_.jsx("span", {
                            className: "absolute left-3 top-o invisible group-hover/item:visible",
                            onClick: ()=>handleShowModal(notif.id),
                            children: /*#__PURE__*/ jsx_runtime_.jsx(fi_.FiEye, {})
                        }) : /*#__PURE__*/ jsx_runtime_.jsx("span", {
                            className: "absolute left-3 top-o invisible group-hover/item:visible",
                            onClick: ()=>handleUnRead(notif.id),
                            children: /*#__PURE__*/ jsx_runtime_.jsx(fi_.FiEyeOff, {})
                        }),
                        /*#__PURE__*/ jsx_runtime_.jsx("p", {
                            children: notif.title
                        }),
                        /*#__PURE__*/ jsx_runtime_.jsx("p", {
                            className: "truncate",
                            children: notif.content
                        })
                    ]
                }, index + notif.id);
            }),
            modalShow && /*#__PURE__*/ jsx_runtime_.jsx(Header_NotificationContent, {
                title: modalData.title,
                content: modalData.content,
                close: handleCloseModal
            })
        ]
    });
};
/* harmony default export */ const Header_NotificationList = (NotificationList);

// EXTERNAL MODULE: external "react-icons/ai"
var ai_ = __webpack_require__(9847);
;// CONCATENATED MODULE: ./components/layout/dashboard/Header/Notification.js




const Notification = ({ count  })=>{
    const [open, setOpen] = (0,external_react_.useState)(false);
    const wrapperRef = (0,external_react_.useRef)(null);
    useOutsideAlerter(wrapperRef, setOpen);
    return /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
        className: "relative inline-block",
        ref: wrapperRef,
        children: [
            /*#__PURE__*/ jsx_runtime_.jsx("button", {
                onClick: ()=>setOpen(!open),
                className: "relative flex items-center p-2 text-sm text-gray-600 rounded-md focus:ring-main focus:ring focus:outline-none",
                children: /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                    className: "relative",
                    children: [
                        /*#__PURE__*/ jsx_runtime_.jsx("span", {
                            className: "absolute -top-1 right-0 flex justify-center items-center rounded-full w-[10px] h-[10px] " + (count > 0 ? "bg-amber-200" : "bg-theme-main"),
                            children: count
                        }),
                        /*#__PURE__*/ jsx_runtime_.jsx(ai_.AiFillBell, {
                            size: 20,
                            className: "text-theme-dark-gray inline-flex"
                        })
                    ]
                })
            }),
            /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                className: "absolute left-0 z-20 w-[300px] py-2 mt-2 overflow-hidden bg-white rounded-md shadow-xl" + (!open ? " hidden" : ""),
                children: [
                    /*#__PURE__*/ jsx_runtime_.jsx("div", {
                        role: "button",
                        className: "flex items-center p-3 -mt-2 text-sm text-gray-600 transition-colors duration-200 transform hover:bg-gray-100",
                        children: /*#__PURE__*/ jsx_runtime_.jsx("div", {
                            className: "mx-1",
                            children: /*#__PURE__*/ (0,jsx_runtime_.jsxs)("span", {
                                className: "text-sm font-semibold text-gray-700",
                                children: [
                                    count,
                                    " پیام خوانده نشده دارید."
                                ]
                            })
                        })
                    }),
                    count > 0 && /*#__PURE__*/ (0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
                        children: [
                            /*#__PURE__*/ jsx_runtime_.jsx("hr", {
                                className: "border-gray-200"
                            }),
                            /*#__PURE__*/ jsx_runtime_.jsx(Header_NotificationList, {
                                count: count
                            })
                        ]
                    })
                ]
            })
        ]
    });
};
/* harmony default export */ const Header_Notification = (Notification);
function useOutsideAlerter(ref, setOpen) {
    (0,external_react_.useEffect)(()=>{
        function handleClickOutside(event) {
            if (ref.current && !ref.current.contains(event.target)) {
                setOpen(false);
            }
        }
        document.addEventListener("mousedown", handleClickOutside);
        return ()=>{
            document.removeEventListener("mousedown", handleClickOutside);
        };
    }, [
        ref
    ]);
}


/***/ }),

/***/ 1201:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _context_UserDataContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3401);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _context_AuthDataContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(284);
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1664);
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var react_icons_go__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5856);
/* harmony import */ var react_icons_go__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_icons_go__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var react_icons_bi__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6652);
/* harmony import */ var react_icons_bi__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_icons_bi__WEBPACK_IMPORTED_MODULE_6__);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_context_AuthDataContext__WEBPACK_IMPORTED_MODULE_3__]);
_context_AuthDataContext__WEBPACK_IMPORTED_MODULE_3__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];







const UserMenu = ({ isMobile  })=>{
    const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    const { userData , refetch  } = (0,_context_UserDataContext__WEBPACK_IMPORTED_MODULE_1__/* .useUser */ .aF)();
    const { logout  } = (0,_context_AuthDataContext__WEBPACK_IMPORTED_MODULE_3__/* .useAuth */ .aC)();
    const wrapperRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        refetch();
    }, []);
    useOutsideAlerter(wrapperRef, setOpen);
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
        className: "relative inline-block",
        ref: wrapperRef,
        children: userData.status ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
            children: [
                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", {
                    onClick: ()=>setOpen(!open),
                    className: "relative flex items-center p-2 text-sm text-gray-600 rounded-md focus:ring-main focus:ring focus:outline-none",
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            className: "mx-1",
                            children: userData.data.userDetail.first_name + " " + userData.data.userDetail.last_name
                        }),
                        open ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_go__WEBPACK_IMPORTED_MODULE_5__.GoChevronUp, {}) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_go__WEBPACK_IMPORTED_MODULE_5__.GoChevronDown, {})
                    ]
                }),
                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    className: "absolute z-20 w-56 py-2 mt-2 overflow-hidden bg-white rounded-md shadow-xl" + (!open ? " hidden" : "") + (isMobile ? " left-0" : " right-0"),
                    children: [
                        /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                            role: "button",
                            className: "flex items-center p-3 -mt-2 text-sm text-gray-600 transition-colors duration-200 transform hover:bg-gray-100",
                            children: [
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                    className: "avatar bg-gray-200 rounded-full p-2",
                                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_bi__WEBPACK_IMPORTED_MODULE_6__.BiUser, {})
                                }),
                                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                    className: "mx-1",
                                    children: [
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                            className: "text-sm font-semibold text-gray-700",
                                            children: userData.data.userDetail.first_name + " " + userData.data.userDetail.last_name
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                            className: "text-sm text-gray-500",
                                            children: userData.data.email
                                        })
                                    ]
                                })
                            ]
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("hr", {
                            className: "border-gray-200"
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_link__WEBPACK_IMPORTED_MODULE_4___default()), {
                            href: "/Profile",
                            passHref: true,
                            legacyBehavior: true,
                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("a", {
                                className: "block px-4 py-3 text-sm text-gray-600 capitalize transition-colors duration-200 transform hover:bg-gray-100 text-right",
                                children: "ویرایش پروفایل"
                            })
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            role: "button",
                            onClick: ()=>logout(),
                            className: "block px-4 py-3 text-sm text-gray-600 capitalize transition-colors duration-200 transform hover:bg-gray-100 text-right",
                            children: "خروج"
                        })
                    ]
                })
            ]
        }) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_link__WEBPACK_IMPORTED_MODULE_4___default()), {
            href: "/Login",
            passHref: true,
            legacyBehavior: true,
            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("a", {
                className: "relative flex items-center p-2 text-sm text-gray-600 bg-white border border-transparent rounded-md bg-[#F8F8F8] ring-1 ring-[#2B327C] focus:ring-main focus:ring focus:outline-none hover:shadow hover:shadow-blue-900",
                children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            className: "mx-1",
                            children: "ورود"
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_go__WEBPACK_IMPORTED_MODULE_5__.GoKey, {})
                    ]
                })
            })
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (UserMenu);
function useOutsideAlerter(ref, setOpen) {
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        function handleClickOutside(event) {
            if (ref.current && !ref.current.contains(event.target)) {
                setOpen(false);
            }
        }
        document.addEventListener("mousedown", handleClickOutside);
        return ()=>{
            document.removeEventListener("mousedown", handleClickOutside);
        };
    }, [
        ref
    ]);
}

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 2508:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1664);
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_2__);



const Logo = ()=>{
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_link__WEBPACK_IMPORTED_MODULE_1___default()), {
        href: "/Dashboard",
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
            src: "/assets/images/logo.svg",
            alt: "لوگو",
            width: 155,
            height: 33,
            className: "inline-block"
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Logo);


/***/ }),

/***/ 3029:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1664);
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _context_UserDataContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3401);
/* harmony import */ var react_icons_rx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5452);
/* harmony import */ var react_icons_rx__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_icons_rx__WEBPACK_IMPORTED_MODULE_4__);





const Menu = ()=>{
    const { userData  } = (0,_context_UserDataContext__WEBPACK_IMPORTED_MODULE_3__/* .useUser */ .aF)();
    const LogoutItems = [
        {
            link: "/Login",
            text: "ورود",
            icon: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_rx__WEBPACK_IMPORTED_MODULE_4__.RxAvatar, {
                className: "text-theme-dark-gray"
            })
        }
    ];
    const LoginItems = [
        {
            link: "/Dashboard",
            text: "داشبورد",
            icon: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_rx__WEBPACK_IMPORTED_MODULE_4__.RxDashboard, {
                className: "text-theme-dark-gray"
            })
        },
        {
            link: "/Dashboard/Inout",
            text: "ورود و خروج",
            icon: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_rx__WEBPACK_IMPORTED_MODULE_4__.RxEnter, {
                className: "text-theme-dark-gray"
            })
        },
        {
            link: "/Dashboard/Vacation",
            text: "مرخصی",
            icon: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_rx__WEBPACK_IMPORTED_MODULE_4__.RxMoon, {
                className: "text-theme-dark-gray"
            })
        }
    ];
    const ManagerItems = [
        {
            link: "/Manager",
            text: "داشبورد",
            icon: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_rx__WEBPACK_IMPORTED_MODULE_4__.RxDashboard, {
                className: "text-theme-dark-gray"
            })
        },
        {
            link: "/Manager/Users",
            text: "کاربران",
            icon: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_rx__WEBPACK_IMPORTED_MODULE_4__.RxPerson, {
                className: "text-theme-dark-gray"
            })
        },
        {
            link: "/Manager/Roles",
            text: "نقش ها",
            icon: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_rx__WEBPACK_IMPORTED_MODULE_4__.RxLockClosed, {
                className: "text-theme-dark-gray"
            })
        },
        {
            link: "/Manager/Files",
            text: "فایل ها",
            icon: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_rx__WEBPACK_IMPORTED_MODULE_4__.RxFile, {
                className: "text-theme-dark-gray"
            })
        },
        {
            link: "/Manager/Notifications",
            text: "مدیریت اعلانات",
            icon: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_rx__WEBPACK_IMPORTED_MODULE_4__.RxBell, {
                className: "text-theme-dark-gray"
            })
        },
        {
            link: "/Manager/Inout",
            text: "مدیریت ورود و خروج",
            icon: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_rx__WEBPACK_IMPORTED_MODULE_4__.RxCountdownTimer, {
                className: "text-theme-dark-gray"
            })
        },
        {
            link: "/Manager/Vacation",
            text: "مدیریت مرخصی",
            icon: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_icons_rx__WEBPACK_IMPORTED_MODULE_4__.RxMoon, {
                className: "text-theme-dark-gray"
            })
        }
    ];
    const Render = ({ link , text , icon  })=>{
        return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_link__WEBPACK_IMPORTED_MODULE_2___default()), {
                href: link,
                passHref: true,
                legacyBehavior: true,
                children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", {
                    className: "text-theme-dark-gray flex items-center p-2 hover:bg-white hover:border-l-2 hover:border-theme-main",
                    children: [
                        icon,
                        " ",
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            className: "mr-2",
                            children: text
                        })
                    ]
                })
            })
        });
    };
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: userData.status ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
            children: [
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: "border-b border-gray-500",
                    children: ManagerItems.map((items, index)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Render, {
                            link: items.link,
                            text: items.text,
                            icon: items.icon
                        }, index))
                }),
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    children: LoginItems.map((items, index)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Render, {
                            link: items.link,
                            text: items.text,
                            icon: items.icon
                        }, index))
                })
            ]
        }) : LogoutItems.map((items, index)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Render, {
                link: items.link,
                text: items.text,
                icon: items.icon
            }, index))
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Menu);


/***/ }),

/***/ 5961:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _SideNav_Menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3029);
/* harmony import */ var _SideNav_Logo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2508);
/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4147);




const Sidenav = ({ isOpen  })=>{
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: "bg-theme-main h-full overflow-y-hidden flex flex-col",
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: "py-3 px-2 text-center",
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_SideNav_Logo__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {})
            }),
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: "bg-theme-gray h-full overflow-y-auto",
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_SideNav_Menu__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {})
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: "bg-theme-gray py-5 text-theme-dark-gray text-center text-sm",
                children: [
                    "Ver ",
                    _package_json__WEBPACK_IMPORTED_MODULE_3__/* .version */ .i8
                ]
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Sidenav);


/***/ }),

/***/ 4047:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* unused harmony export getServerSideProps */
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Header__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4036);
/* harmony import */ var _Footer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5045);
/* harmony import */ var next_head__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(968);
/* harmony import */ var next_head__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_head__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _Sidenav__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5961);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_Header__WEBPACK_IMPORTED_MODULE_1__]);
_Header__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];






const Index = ({ children , title , description  })=>{
    const [width, setWidth] = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(0);
    const handleResize = ()=>setWidth(window.innerWidth);
    (0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(()=>{
        if (width === 0) {
            setWidth(window.innerWidth);
        }
        window.addEventListener("resize", handleResize);
        return ()=>window.removeEventListener("resize", handleResize);
    }, [
        handleResize
    ]);
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_head__WEBPACK_IMPORTED_MODULE_3___default()), {
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("title", {
                        children: title
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("meta", {
                        name: "description",
                        content: description
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("meta", {
                        name: "viewport",
                        content: "width=device-width, initial-scale=1"
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("link", {
                        rel: "icon",
                        href: "/favicon.ico"
                    })
                ]
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: "flex flex-row",
                children: [
                    width > 991 && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: "lg:w-1/6",
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Sidenav__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {})
                    }),
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: "lg:w-5/6 w-full min-h-screen flex flex-col" + (width < 991 ? " overflow-x-hidden" : ""),
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Header__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
                                isMobile: width < 991
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("main", {
                                children: children
                            })
                        ]
                    })
                ]
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Index);
async function getServerSideProps(context) {
    return {
        props: {}
    };
}

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 4147:
/***/ ((module) => {

module.exports = {"i8":"0.1.0"};

/***/ })

};
;