{"version":3,"sources":["app/modules/auth/redux/AuthInit.tsx","_metronic/layout/core/PageData.tsx","_metronic/helpers/AssetHelpers.ts","_metronic/helpers/RouterHelpers.ts","_metronic/helpers/components/KTSVG.tsx","app/utils/statusRequest.js","_metronic/assets/ts/_utils/_ElementStyleUtil.ts","_metronic/assets/ts/_utils/_DataUtil.ts","_metronic/assets/ts/_utils/_TypesHelpers.ts","_metronic/assets/ts/_utils/_DOMEventHandlerUtil.ts","_metronic/assets/ts/_utils/ElementAnimateUtil.ts","_metronic/assets/ts/_utils/DomHelpers.ts","_metronic/assets/ts/_utils/EventHandlerUtil.ts","_metronic/layout/core/MetronicSplashScreen.tsx","_metronic/assets/ts/components/_CookieComponent.ts","_metronic/assets/ts/components/_DrawerComponent.ts","_metronic/assets/ts/components/_FeedbackComponent.ts","_metronic/assets/ts/components/_ImageInputComponent.ts","_metronic/assets/ts/components/_ScrollComponent.ts","_metronic/assets/ts/components/_ScrollTopComponent.ts","_metronic/assets/ts/components/_StepperComponent.ts","_metronic/assets/ts/components/_StickyComponent.ts","_metronic/assets/ts/components/_ToggleComponent.ts","_metronic/assets/ts/components/_PasswordMeterComponent.ts","_metronic/assets/ts/components/_SwapperComponent.ts","_metronic/assets/ts/components/MenuComponent.ts","_metronic/assets/ts/components/SearchComponent.ts","setup/redux/RootReducer.ts","setup/redux/Store.ts","_metronic/i18n/Metronici18n.tsx","_metronic/i18n/i18nProvider.tsx","_metronic/layout/components/aside/AsideMenuItem.tsx","_metronic/layout/components/aside/AsideMenuMain.tsx","_metronic/layout/components/aside/AsideMenu.tsx","_metronic/layout/components/aside/AsideDefault.tsx","_metronic/layout/components/Footer.tsx","_metronic/layout/components/header/page-title/DefaultTitle.tsx","_metronic/partials/layout/header-menus/HeaderUserMenu.tsx","_metronic/partials/content/fallback-view/FallbackView.tsx","_metronic/layout/components/header/Topbar.tsx","_metronic/layout/components/header/HeaderWrapper.tsx","_metronic/layout/components/ScrollTop.tsx","_metronic/layout/components/toolbar/Toolbar1.tsx","_metronic/layout/components/toolbar/Toolbar.tsx","_metronic/layout/components/Content.tsx","_metronic/layout/MasterLayout.tsx","_metronic/partials/widgets/tables/TablesWidget1.tsx","app/pages/requests/Peticion.js","_metronic/partials/widgets/stats/StatsWidget3.tsx","app/pages/dashboard/DashboardWrapper.js","app/pages/dashboard/DashboardConsultadoWrapper.js","app/routing/PrivateRoutes.tsx","app/modules/errors/components/Error500.tsx","app/modules/errors/SSOFailPage.js","_metronic/layout/MasterInit.tsx","app/routing/Routes.tsx","app/App.tsx","setup/axios/SetupAxios.ts","index.tsx","_metronic/layout/core/LayoutSetup.ts","app/modules/auth/redux/AuthRedux.ts","app/modules/auth/redux/AuthCRUD.ts","app/modules/auth/components/ForgotPassword.tsx","app/modules/auth/components/ForgotPasswordReset.js","app/modules/auth/components/Login.tsx","app/modules/auth/AuthPage.tsx","app/modules/auth/__mocks__/usersTableMock.ts","app/modules/auth/__mocks__/mockAuth.ts","app/modules/auth/Logout.tsx","app/utils/useQuery.js","_metronic/layout/core/DefaultLayoutConfig.ts","_metronic/layout/core/LayoutProvider.tsx"],"names":["connector","connect","state","auth","props","didRequest","useRef","dispatch","useDispatch","useState","showSplashScreen","setShowSplashScreen","accessToken","useSelector","shallowEqual","useEffect","requestUser","a","current","getUserByToken","user","data","firstname","name","lastname","surnames","fulfillUser","console","error","logout","children","PageDataContext","createContext","setPageTitle","_title","setPageBreadcrumbs","_breadcrumbs","setPageDescription","_description","PageDataProvider","pageTitle","pageDescription","value","pageBreadcrumbs","Provider","usePageData","useContext","PageTitle","description","breadcrumbs","toString","toAbsoluteUrl","pathname","process","checkIsActive","url","split","getCurrentUrl","indexOf","KTSVG","className","path","svgClassName","src","statuses","id","label","key","text","getLabelRequest","statusId","status","find","el","ElementStyleUtil","element","property","important","style","setProperty","attributeName","getPropertyValue","attibuteName","removeProperty","DataUtil","instance","instanceData","store","get","set","newMap","Map","delete","has","result","forEach","val","v","k","push","getObjectPropertyValueByKey","obj","map","Object","entries","hasOwnProperty","getUniqueIdWithPrefix","prefix","Math","floor","random","Date","getTime","stringSnakeToCamel","str","replace","m","toUpperCase","DOMEventHandlerUtil","selector","eventName","callBack","eventId","e","targets","querySelectorAll","target","i","length","call","parentElement","addEventListener","funcFromStore","removeEventListener","calee","type","currentTarget","ElementAnimateUtil","from","to","duration","update","complete","easings","t","b","c","d","change","start","window","performance","now","requestAnimationFrame","loop","timestamp","time","animationName","animateClasses","cssClass","classList","add","one","remove","offset","targetPos","getElementOffset","top","scrollPos","pageYOffset","document","documentElement","scrollTop","body","animate","scrollTo","getCSS","styleProp","defaultView","ownerDocument","toLowerCase","getComputedStyle","getCSSVariableValue","variableName","hex","trim","getElementActualCss","prop","cache","css","getAttribute","cssText","offsetWidth","offsetHeight","undefined","setAttribute","parseFloat","attributeValue","getElementIndex","parentNode","getElementMatches","p","Element","prototype","f","matches","webkitMatchesSelector","tagName","getClientRects","left","rect","getBoundingClientRect","win","pageXOffset","getElementParents","s","this","item","parents","getHighestZindex","bufferNode","buffer","position","parseInt","isNaN","getScrollTop","scrollingElement","getViewPort","width","innerWidth","height","innerHeight","insertAfterElement","referenceNode","insertBefore","nextSibling","isVisibleElement","throttle","timer","func","delay","setTimeout","getElementChild","childNodes","child","nodeType","getElementChildren","slide","dir","speed","callback","calcHeight","getElementActualHeight","calcPaddingTop","calcPaddingBottom","paddingTop","paddingBottom","display","overflow","slideUp","slideDown","getBreakpoint","breakpoint","getAttributeValueByBreakpoint","incomingAttr","jsonStr","join","matched","substring","JSON","parse","toJSON","resultKey","resultBreakpoint","EventHandlerUtil","metas","handlerId","meta","getEventMetasByName","setEventMetasByName","handerId","fired","getEventsMetaByHandlerId","setEventMetaByNameAndHandlerId","handler","setFiredByNameAndHandlerId","addEvent","removeEvent","on","MetronicSplashScreenContext","LayoutSplashScreen","visible","setCount","prev","CookieComponent","cookie","match","RegExp","decodeURIComponent","cookieOptions","options","expires","toUTCString","updatedCookie","encodeURIComponent","optionKey","optionValue","DrawerStore","instanceId","drawerComponentObj","defaultDrawerOptions","overlay","baseClass","overlayClass","direction","DrawerComponent","_element","overlayElement","toggleElement","instanceUid","shown","lastWidth","closeElement","_handlers","togglers","_getOption","closers","preventDefault","getElementById","_toggle","_hide","_update","String","hasBaseClass","contains","bodyCanvasAttr","attr","optionName","option","trigger","_show","_deleteOverlay","removeAttribute","_createOverlay","createElement","elementZIndex","overlayZindex","append","overlayClassOption","removeChild","_getDirection","_getWidth","toggle","show","hide","isShown","goElement","off","event","assign","drawer","getInstance","hasInstace","elementId","hideAll","getAllInstances","dr","updateAll","handleDismiss","closest","bootstrap","createInstances","initGlobalHandlers","reinitialization","defaultImageInputOptions","defaultImageInputQueires","componentName","instanseQuery","inputQuery","wrapperQuery","cancelQuery","removeQuery","hiddenQuery","ImageInputComponent","_options","_queries","inputElement","wrapperElement","cancelElement","removeElement","hiddenElement","queries","uid","_change","files","reader","FileReader","onload","readAsDataURL","_cancel","_remove","querySelector","handlers","ImageInput","elements","createInsance","defaultScrollOptions","saveState","ScrollComponent","getOption","hasAttribute","getHeightType","getAutoHeight","dependencies","wrappers","len","borderTop","borderBottom","setupHeight","getHeight","heightType","setupState","pos","setupScrollHandler","scrollHandler","cookieId","destroyScrollHandler","resetHeight","heghtType","Function","getElement","scroll","resize","createInstance","defaultScrollTopOptions","ScrollTopComponent","_scroll","_go","go","goTop","defaultStepperOptions","startIndex","animation","animationSpeed","animationNextClass","animationPreviousClass","StepperComponent","steps","btnNext","btnPrev","btnSubmit","totatStepsNumber","passedStepIndex","currentStepIndex","_goTo","index","refreshUI","initHandlers","stepDirection","_getStepDirection","getStepContent","content","getLastStepIndex","getTotalStepsNumber","isLastStep","isFirstStep","animateClass","isBetweenStep","goto","goNext","getNextStepIndex","goPrev","getPrevStepIndex","goFirst","goLast","getCurrentStepIndex","getPassedStepIndex","destroy","log","stepper","defaultStickyOptions","reverse","animationClass","StickyComponent","instanceName","eventTriggerState","lastScrollTop","offsetNum","st","enable","disable","dataStickyAttr","attrValueInStr","attrValue","zindex","widthTarget","targetElement","offsetLeft","sticky","defaultToggleOptions","ToggleComponent","attribute","_isEnabled","_disable","_enable","isEnabled","elementTargetAttr","elementToggleAttr","defaultPasswordMeterOptions","minLength","checkUppercase","checkLowercase","checkDigit","checkChar","scoreHighlightClass","defaultPasswordMeterQueires","visibilityQuery","highlightQuery","PasswordMeterComponent","visibilityElement","highlightElement","score","checkSteps","reset","highlight","check","visitbility","visibleIcon","hiddenIcon","focus","test","count","items","slice","total","checkScore","getCheckScore","getScore","checkLength","checkLowerCase","passwordMeter","SwapperStore","defaultSwapperOptions","mode","defaultSwapperQueires","attrQuery","SwapperComponent","parentSelector","prepend","place","defaultMenuOptions","dropdown","hoverTimeout","accordion","slideSpeed","expand","MenuComponent","triggerElement","_setTriggerElement","_isTriggerElement","_getItemOption","_getItemElement","itemElement","sub","subItem","_getItemParentElement","parentItem","_getItemParentElements","parent","unshift","_getDropdownPopperConfig","placementOption","placement","offsetValue","strategy","modifiers","flipVariations","_getItemChildElement","_getItemChildElements","_getItemSubElement","_getCss","_getItemSubType","_isItemSubShown","_isItemDropdownPermanent","_isItemParentShown","_isItemSubElement","_hasItemSub","_getItemLinkElement","_getItemToggleElement","_showDropdown","hideDropdowns","parentZindex","initDropdownPopper","appendChild","reference","attach","popper","createPopper","_hideDropdown","destroyDropdownPopper","_showAccordion","_hideAccordions","subElement","_hideAccordion","itemsToHide","itemToHide","_reset","removeClass","_destroy","_mouseout","timeout","_mouseover","clearTimeout","_dismiss","itemSubType","_link","_click","click","link","dismiss","mouseover","mouseout","getItemTriggerType","getItemSubType","getItemLinkElement","getItemToggleElement","getItemSubElement","getItemParentElements","isItemSubShown","isItemParentShown","getTriggerElement","isItemDropdownPermanent","hideAccordions","elementMenu","menu","menuData","subMenu","skip","updateDropdowns","forceUpdate","menuItem","menuInstance","menuItems","menuObj","stopPropagation","defaultSearchOptions","keypress","enter","layout","showOnFocus","defaultSearchQueires","SearchComponent","contentElement","formElement","spinnerElement","clearElement","submitElement","toolbarElement","resultsElement","suggestionElement","emptyElement","processing","menuObject","_getElement","getResponsiveFormMode","responsive","blur","charCode","keyCode","search","input","clear","responsiveFormMode","isProcessing","getQuery","getMenu","getFormElement","context","Search","rootSaga","rootReducer","combineReducers","all","sagaMiddleware","createSagaMiddleware","middleware","getDefaultMiddleware","immutableCheck","serializableCheck","thunk","configureStore","reducer","devTools","enhancers","reduxBatch","persistor","persistStore","run","I18N_CONFIG_KEY","REACT_APP_I18N_CONFIG_KEY","initialState","selectedLang","I18nContext","MetronicI18nProvider","lang","ls","localStorage","getItem","er","getConfig","allMessages","en","es","I18nProvider","locale","messages","AsideMenuItem","title","icon","fontIcon","hasBullet","useLocation","isActive","aside","useLayout","config","clsx","active","menuIcon","AsideMenuMain","AsideMenu","asideMenuCSSClasses","scrollRef","ref","AsideDefault","classes","theme","alt","minimize","asideMenu","Footer","footerContainer","getFullYear","href","DefaultTitle","breadCrumbs","Array","isSeparator","HeaderUserMenu","email","onClick","FallbackView","Topbar","nAvailableReports","Button","variant","size","color","border","marginLeft","marginRight","backgroundColor","HeaderWrapper","attributes","header","headerMenu","headerContainer","ScrollTop","isFirstRun","reInitialization","stickyHeader","updateHeaderSticky","Toolbar1","toolbarContainer","Toolbar","toolbar","Content","location","contentContainer","MasterLayout","Peticion","request","userInfo","back","history","useHistory","hover","setHover","cardStructure","footer","provisionalName","provisionalSurnames","createdAt","Col","Card","onMouseEnter","onMouseLeave","cursor","Body","Title","Subtitle","cte_name","cte_surnames","Text","padding","paddingLeft","Row","xs","order","textAlign","marginTop","API_URL","API_REQUEST","API_USER_REQUEST","DashboardPage","query","useQuery","requests","setRequests","loading","setLoading","setUserInfo","errorMessage","setErrorMessage","page","setPage","totalPages","setTotalPages","handleClick","newPage","behavior","axios","then","countRequests","pagination","catch","roles","md","isNew","class","l","last","right","range","rangeWithDots","number","DashboardWrapper","intl","useIntl","formatMessage","DashboardConsultadoPage","DashboardConsultadoWrapper","PrivateRoutes","isAuthorized","AccountPage","lazy","RequestsDetailPage","FormMorososPage","NewRequestsPage","CompraPage","CompraResultPage","fallback","component","exact","SSOFailPage","backgroundImage","MasterInit","Routes","redirectUrl","URLSearchParams","isCompraResultadoOK","includes","isCompraResultadoError","Logout","App","basename","AuthInit","interceptors","use","getState","headers","Authorization","err","Promise","reject","_redux","Chart","register","registerables","Bugfender","init","appKey","version","ReactDOM","render","LAYOUT_CONFIG_KEY","getEmptyCssClasses","headerMobile","asideToggle","sidebar","getEmptyHTMLAttributes","getEmptyCSSVariables","LayoutSetup","cssVariables","main","fixed","desktop","tabletAndMobile","tabletAndMobileMode","typeOptions","layouts","bodyStyles","heightAndTabletMobileMode","responsiveBreakpoint","responsiveTarget","minimized","hoverable","darkSkinEnabled","initLayout","initHeader","initPageTitle","initToolbar","initContent","initAside","initFooter","initAsideMenu","fieldsToUpdate","updatedConfig","initCSSClasses","initCSSVariables","initHTMLAttributes","isLoaded","initConfig","setItem","stringify","setLayout","DefaultLayoutConfig","getLayout","updatePartialConfig","saga","actionTypes","initialAuthState","persistReducer","storage","session","whitelist","action","payload","actions","login","setUser","takeLatest","loginSaga","put","registerSaga","userRequested","GET_USER_BY_ACCESSTOKEN_URL","LOGIN_URL","REGISTER_URL","REQUEST_PASSWORD_URL","password","token","post","role","requestPassword","initialValues","forgotPasswordSchema","Yup","shape","required","ForgotPassword","hasErrors","setHasErrors","messageError","setMessageError","formik","useFormik","validationSchema","onSubmit","values","setStatus","setSubmitting","noValidate","handleSubmit","placeholder","autoComplete","getFieldProps","onKeyPress","touched","errors","disabled","isSubmitting","isValid","ForgotPasswordReset","useParams","access_token","loginSchema","min","max","Login","urlParams","marginBottom","CompraPageAnonimo","AuthPage","UsersTableMock","mockAuth","mock","generateUserId","ids","table","onPost","reply","x","username","refreshToken","pic","onGet","startsWith","reload","fullname","occupation","companyName","phone","language","timeZone","website","emailSettings","emailNotification","sendCopyToPersonalEmail","activityRelatesEmail","youHaveNewNotifications","youAreSentADirectMessage","someoneAddsYouAsAsAConnection","uponNewOrder","newMembershipApproval","memberRegistration","updatesFromKeenthemes","newsAboutKeenthemesProductsAndFeatureUpdates","tipsOnGettingMoreOutOfKeen","thingsYouMissedSindeYouLastLoggedIntoKeen","newsAboutStartOnPartnerProductsAndOtherServices","tipsOnStartBusinessProducts","communication","sms","address","addressLine","city","postCode","socialNetworks","linkedIn","facebook","twitter","instagram","primaryColor","loader","scrolltop","megaMenu","toolbar1","toolbar2","toolbar3","toolbar4","toolbar5","LayoutContext","disableSplashScreen","splashScreen","LayoutProvider","setConfig","setClasses","setAttributes","setCSSVariables","_themeConfig","enableSplashScreen","cl"],"mappings":"4MAQMA,EAAYC,aADD,SAACC,GAAD,MAAuB,CAACC,KAAMD,EAAMC,QACjBA,KA2CrBH,OAxCsB,SAACI,GACpC,IAAMC,EAAaC,kBAAO,GACpBC,EAAWC,cACjB,EAAgDC,oBAAS,GAAzD,mBAAOC,EAAP,KAAyBC,EAAzB,KACMC,EAAcC,aAAuB,qBAAEV,KAAeS,cAAaE,KAiCzE,OA9BAC,qBAAU,WACR,IAAMC,EAAW,uCAAG,8BAAAC,EAAA,kEAEXZ,EAAWa,QAFA,gCAGaC,cAHb,iBAGDC,EAHC,EAGPC,MACFC,UAAYF,EAAKG,KACtBH,EAAKI,SAAWJ,EAAKK,SACrBlB,EAASH,EAAMsB,YAAYN,IANb,yDAShBO,QAAQC,MAAR,MACKvB,EAAWa,SACdX,EAASH,EAAMyB,UAXD,yBAchBlB,GAAoB,GAdJ,+CAiBX,kBAAON,EAAWa,SAAU,KAjBjB,gEAAH,qDAoBbN,EACFI,KAEAT,EAASH,EAAMyB,UACflB,GAAoB,MAGrB,IAEID,EAAmB,cAAC,IAAD,IAAyB,mCAAGN,EAAM0B,e,iKC7BxDC,EAAkBC,wBAAoC,CAC1DC,aAAc,SAACC,KACfC,mBAAoB,SAACC,KACrBC,mBAAoB,SAACC,OAGjBC,EAA6B,SAAC,GAAgB,IAAfT,EAAc,EAAdA,SACnC,EAAkCrB,mBAA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,IAAMN,EAAe93B,SAAS8J,eAAe,iBACzCguB,GACFA,EAAa19B,MAAMC,YAAY,UAAW,QAiB1Cg+B,GACoBrU,MAAMhmB,KAAKgC,SAASG,KAAKb,WACjCjE,SAAQ,SAACi9B,GAAD,OAAQt4B,SAASG,KAAKb,UAAUG,OAAO64B,MAC3D1K,IAAYoC,oBAAoBoI,GAChCJ,EAAUn8B,OAAOgQ,OAAO,GAAI+hB,IAAYjL,SACxCsV,EAAWrK,IAAYvK,SACvB6U,EAActK,IAAY3I,YAC1BkT,EAAgBvK,IAAYC,cAC5BtpB,YAAW,WACTszB,MACC,OAcL,OAJAxhC,qBAAU,WACRwhC,MACC,IAEI,cAACD,EAAc1/B,SAAf,CAAwBF,MAAOA,EAA/B,SAAuCZ,KAKzC,SAASsrB,IACd,OAAOtqB,qBAAWw/B,M","file":"static/js/main.76e86579.chunk.js","sourcesContent":["import {FC, useRef, useEffect, useState} from 'react'\r\nimport {shallowEqual, useSelector, connect, useDispatch, ConnectedProps} from 'react-redux'\r\nimport {LayoutSplashScreen} from '../../../../_metronic/layout/core'\r\nimport * as auth from './AuthRedux'\r\nimport {getUserByToken} from './AuthCRUD'\r\nimport {RootState} from '../../../../setup'\r\n\r\nconst mapState = (state: RootState) => ({auth: state.auth})\r\nconst connector = connect(mapState, auth.actions)\r\ntype PropsFromRedux = ConnectedProps\r\n\r\nconst AuthInit: FC = (props) => {\r\n const didRequest = useRef(false)\r\n const dispatch = useDispatch()\r\n const [showSplashScreen, setShowSplashScreen] = useState(true)\r\n const accessToken = useSelector(({auth}) => auth.accessToken, shallowEqual)\r\n\r\n // We should request user by authToken before rendering the application\r\n useEffect(() => {\r\n const requestUser = async () => {\r\n try {\r\n if (!didRequest.current) {\r\n const {data: user} = await getUserByToken()\r\n user.firstname = user.name\r\n user.lastname = user.surnames\r\n dispatch(props.fulfillUser(user))\r\n }\r\n } catch (error) {\r\n console.error(error)\r\n if (!didRequest.current) {\r\n dispatch(props.logout())\r\n }\r\n } finally {\r\n setShowSplashScreen(false)\r\n }\r\n\r\n return () => (didRequest.current = true)\r\n }\r\n\r\n if (accessToken) {\r\n requestUser()\r\n } else {\r\n dispatch(props.logout())\r\n setShowSplashScreen(false)\r\n }\r\n // eslint-disable-next-line\r\n }, [])\r\n\r\n return showSplashScreen ? : <>{props.children}\r\n}\r\n\r\nexport default connector(AuthInit)\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, {FC, createContext, useContext, useEffect, useState} from 'react'\r\n\r\nexport interface PageLink {\r\n title: string\r\n path: string\r\n isActive: boolean\r\n isSeparator?: boolean\r\n}\r\n\r\nexport interface PageDataContextModel {\r\n pageTitle?: string\r\n setPageTitle: (_title: string) => void\r\n pageDescription?: string\r\n setPageDescription: (_description: string) => void\r\n pageBreadcrumbs?: Array\r\n setPageBreadcrumbs: (_breadcrumbs: Array) => void\r\n}\r\n\r\nconst PageDataContext = createContext({\r\n setPageTitle: (_title: string) => {},\r\n setPageBreadcrumbs: (_breadcrumbs: Array) => {},\r\n setPageDescription: (_description: string) => {},\r\n})\r\n\r\nconst PageDataProvider: React.FC = ({children}) => {\r\n const [pageTitle, setPageTitle] = useState('')\r\n const [pageDescription, setPageDescription] = useState('')\r\n const [pageBreadcrumbs, setPageBreadcrumbs] = useState>([])\r\n const value: PageDataContextModel = {\r\n pageTitle,\r\n setPageTitle,\r\n pageDescription,\r\n setPageDescription,\r\n pageBreadcrumbs,\r\n setPageBreadcrumbs,\r\n }\r\n return {children}\r\n}\r\n\r\nfunction usePageData() {\r\n return useContext(PageDataContext)\r\n}\r\n\r\ntype Props = {\r\n description?: string\r\n breadcrumbs?: Array\r\n}\r\n\r\nconst PageTitle: FC = ({children, description, breadcrumbs}) => {\r\n const {setPageTitle, setPageDescription, setPageBreadcrumbs} = usePageData()\r\n useEffect(() => {\r\n if (children) {\r\n setPageTitle(children.toString())\r\n }\r\n return () => {\r\n setPageTitle('')\r\n }\r\n }, [children])\r\n\r\n useEffect(() => {\r\n if (description) {\r\n setPageDescription(description)\r\n }\r\n return () => {\r\n setPageDescription('')\r\n }\r\n }, [description])\r\n\r\n useEffect(() => {\r\n if (breadcrumbs) {\r\n setPageBreadcrumbs(breadcrumbs)\r\n }\r\n return () => {\r\n setPageBreadcrumbs([])\r\n }\r\n }, [breadcrumbs])\r\n\r\n return <>\r\n}\r\n\r\nconst PageDescription: React.FC = ({children}) => {\r\n const {setPageDescription} = usePageData()\r\n useEffect(() => {\r\n if (children) {\r\n setPageDescription(children.toString())\r\n }\r\n return () => {\r\n setPageDescription('')\r\n }\r\n }, [children])\r\n return <>\r\n}\r\n\r\nexport {PageDescription, PageTitle, PageDataProvider, usePageData}\r\n","export const toAbsoluteUrl = (pathname: string) => process.env.PUBLIC_URL + pathname\r\n","export function getCurrentUrl(pathname: string) {\r\n return pathname.split(/[?#]/)[0]\r\n}\r\n\r\nexport function checkIsActive(pathname: string, url: string) {\r\n const current = getCurrentUrl(pathname)\r\n if (!current || !url) {\r\n return false\r\n }\r\n\r\n if (current === url) {\r\n return true\r\n }\r\n\r\n if (current.indexOf(url) > -1) {\r\n return true\r\n }\r\n\r\n return false\r\n}\r\n","import React from 'react'\r\nimport SVG from 'react-inlinesvg'\r\nimport {toAbsoluteUrl} from '../AssetHelpers'\r\ntype Props = {\r\n className?: string\r\n path: string\r\n svgClassName?: string\r\n}\r\n\r\nconst KTSVG: React.FC = ({className = '', path, svgClassName = 'mh-50px'}) => {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport {KTSVG}\r\n","const statuses = [\r\n {\r\n id: 1,\r\n label: Pdte. Consentimiento,\r\n key: 'PDTE_CONSENTIMIENTO',\r\n text: 'Pdte. Consentimiento',\r\n },\r\n {\r\n id: 2,\r\n label: Pdte. Verificación,\r\n key: 'PDTE_VERIFICACION',\r\n text: 'Pdte. Verificación',\r\n },\r\n {\r\n id: 8,\r\n label: Pdte. Enviar a proveedor,\r\n key: 'PDTE_NOTIFICAR_PROVEEDOR',\r\n text: 'Pdte. Enviar a proveedor',\r\n },\r\n {\r\n id: 4,\r\n label: Pdte. Respuesta del proveedor,\r\n key: 'PDTE_RESPUESTA_PROVEEDOR',\r\n text: 'Pdte. Respuesta del proveedor',\r\n },\r\n {\r\n id: 11,\r\n label: Primer informe,\r\n key: 'PENDIENTE',\r\n text: 'Pendiente',\r\n },\r\n {\r\n id: 6,\r\n label: Completada,\r\n key: 'COMPLETADA',\r\n text: 'Completada',\r\n },\r\n {\r\n id: 5,\r\n label: Caducada,\r\n key: 'CADUCADA',\r\n text: 'Caducada',\r\n },\r\n {\r\n id: 3,\r\n label: Baja usuario,\r\n key: 'BAJA_ACTOR',\r\n text: 'Baja usuario',\r\n },\r\n {\r\n id: 7,\r\n label: Rechazada (Consentimiento),\r\n key: 'DENEGADO_CONSENTIMIENTO',\r\n text: 'Rechazada (Consentimiento)',\r\n },\r\n {\r\n id: 9,\r\n label: Rechazada (Admin),\r\n key: 'RECHAZADA_ADMIN',\r\n text: 'Rechazada (Admin)',\r\n },\r\n {\r\n id: 10,\r\n label: Rechazada (Proveedor),\r\n key: 'ERROR_PROVEEDOR',\r\n text: 'Rechazada (Proveedor)',\r\n },\r\n {\r\n id: 12,\r\n label: Cancelada,\r\n key: 'CANCELADA_ADMIN',\r\n text: 'Cancelada',\r\n },\r\n]\r\n\r\nexport const getOptionsStatusRequest = () => {\r\n let options = {}\r\n statuses.forEach((st) => {\r\n options[st.id] = st.text\r\n })\r\n return options\r\n}\r\nexport const getOptionsStatusRequestLabel = () => {\r\n let options = []\r\n statuses.forEach((st) => {\r\n options[st.id] = st\r\n })\r\n return options\r\n}\r\n\r\nexport const getLabelRequest = (statusId) => {\r\n const status = statuses.find((el) => statusId === el.id)\r\n if (status && status.label) {\r\n return status.label\r\n } else {\r\n return 'Unknown'\r\n }\r\n}\r\n\r\nexport default getLabelRequest\r\n","export class ElementStyleUtil {\r\n public static set(element: HTMLElement, property: string, value?: any, important?: boolean) {\r\n if (important) {\r\n element.style.setProperty(property, value, 'important')\r\n } else {\r\n element.style.setProperty(property, value)\r\n }\r\n }\r\n\r\n public static get(element: HTMLElement, attributeName: string) {\r\n return element.style.getPropertyValue(attributeName)\r\n }\r\n\r\n public static remove(element: HTMLElement, attibuteName: string) {\r\n element.style.removeProperty(attibuteName)\r\n }\r\n}\r\n","export class DataUtil {\r\n static store: Map> = new Map()\r\n\r\n public static set(instance: HTMLElement | undefined, key: string, data: any): void {\r\n if (!instance) {\r\n return\r\n }\r\n\r\n const instanceData = DataUtil.store.get(instance)\r\n if (!instanceData) {\r\n const newMap = new Map().set(key, data)\r\n DataUtil.store.set(instance, newMap)\r\n return\r\n }\r\n\r\n instanceData.set(key, data)\r\n }\r\n\r\n public static get(instance: HTMLElement, key: string): any | undefined {\r\n const instanceData = DataUtil.store.get(instance)\r\n if (!instanceData) {\r\n return\r\n }\r\n\r\n return instanceData.get(key)\r\n }\r\n\r\n public static remove(instance: HTMLElement, key: string): void {\r\n const instanceData = DataUtil.store.get(instance)\r\n if (!instanceData) {\r\n return\r\n }\r\n\r\n instanceData.delete(key)\r\n }\r\n\r\n public static has(instance: HTMLElement, key: string): boolean {\r\n const instanceData = DataUtil.store.get(instance)\r\n if (instanceData) {\r\n return instanceData.has(key)\r\n }\r\n\r\n return false\r\n }\r\n\r\n public static getAllInstancesByKey(key: string) {\r\n const result: any[] = []\r\n DataUtil.store.forEach((val) => {\r\n val.forEach((v, k) => {\r\n if (k === key) {\r\n result.push(v)\r\n }\r\n })\r\n })\r\n return result\r\n }\r\n}\r\n","function getObjectPropertyValueByKey(obj: any, key: string): any | undefined {\r\n const map = new Map(Object.entries(obj))\r\n if (obj.hasOwnProperty(key) && map) {\r\n return map.get(key)\r\n }\r\n}\r\n\r\n/**\r\n * Generates unique ID for give prefix.\r\n * @param {string} prefix Prefix for generated ID\r\n * @returns {boolean}\r\n */\r\nfunction getUniqueIdWithPrefix(prefix: string | undefined): string {\r\n const result = Math.floor(Math.random() * new Date().getTime()).toString()\r\n if (!prefix) {\r\n return result\r\n }\r\n\r\n return `${prefix}${result}`\r\n}\r\n\r\n/* eslint-disable no-useless-escape */\r\nfunction stringSnakeToCamel(str: string): string {\r\n return str.replace(/(\\-\\w)/g, function (m) {\r\n return m[1].toUpperCase()\r\n })\r\n}\r\n\r\nfunction toJSON(value: string | JSON): JSON | undefined {\r\n if (typeof value !== 'string') {\r\n return value\r\n }\r\n\r\n if (!value) {\r\n return undefined\r\n }\r\n\r\n // (\"'\" => \"\\\"\");\r\n const result = value\r\n .toString()\r\n .split('')\r\n .map((el) => (el !== \"'\" ? el : '\"'))\r\n .join('')\r\n var jsonStr = result.replace(/(\\w+:)|(\\w+ :)/g, function (matched) {\r\n return '\"' + matched.substring(0, matched.length - 1) + '\":'\r\n })\r\n try {\r\n return JSON.parse(jsonStr)\r\n } catch {\r\n return undefined\r\n }\r\n}\r\n\r\nexport {getObjectPropertyValueByKey, getUniqueIdWithPrefix, stringSnakeToCamel, toJSON}\r\n","import {getUniqueIdWithPrefix} from './_TypesHelpers'\r\n\r\nexport class DOMEventHandlerUtil {\r\n public static store = new Map()\r\n\r\n public static on(\r\n element: HTMLElement,\r\n selector: string,\r\n eventName: string,\r\n callBack: any\r\n ): string {\r\n const eventId = getUniqueIdWithPrefix('DOMEvent')\r\n DOMEventHandlerUtil.store.set(eventId, (e: Event) => {\r\n const targets = element.querySelectorAll(selector)\r\n let target: HTMLElement | null = e.target as HTMLElement\r\n while (target && target !== element) {\r\n for (let i = 0; i < targets.length; i++) {\r\n if (target === targets[i]) {\r\n callBack.call(target, e)\r\n }\r\n }\r\n\r\n if (target.parentElement) {\r\n target = target.parentElement\r\n } else {\r\n target = null\r\n }\r\n }\r\n })\r\n element.addEventListener(eventName, DOMEventHandlerUtil.store.get(eventId))\r\n return eventId\r\n }\r\n\r\n public static off(element: HTMLElement, eventName: string, eventId: string): void {\r\n const funcFromStore = DOMEventHandlerUtil.store.get(eventId)\r\n if (!funcFromStore) {\r\n return\r\n }\r\n\r\n element.removeEventListener(eventName, funcFromStore)\r\n DOMEventHandlerUtil.store.delete(eventId)\r\n }\r\n\r\n public static one(element: HTMLElement, eventName: string, callBack: Function): void {\r\n element.addEventListener(eventName, function calee(e) {\r\n // remove event\r\n if (e.target && e.target.removeEventListener) {\r\n e.target.removeEventListener(e.type, calee)\r\n }\r\n\r\n if (element && e && e.currentTarget) {\r\n // if (element && element.removeEventListener && e && e.currentTarget) {\r\n e.currentTarget.removeEventListener(e.type, calee)\r\n }\r\n\r\n // call hander\r\n return callBack(e)\r\n })\r\n }\r\n}\r\n","import {DOMEventHandlerUtil} from './_DOMEventHandlerUtil'\r\nimport {ElementStyleUtil} from './_ElementStyleUtil'\r\nimport {getElementOffset} from './DomHelpers'\r\n\r\nexport class ElementAnimateUtil {\r\n public static animate(\r\n from: number,\r\n to: number,\r\n duration: number,\r\n update: Function,\r\n complete?: Function\r\n ) {\r\n /**\r\n * TinyAnimate.easings\r\n * Adapted from jQuery Easing\r\n */\r\n const easings = {\r\n linear: function (t: number, b: number, c: number, d: number) {\r\n return (c * t) / d + b\r\n },\r\n }\r\n\r\n // Create mock done() function if necessary\r\n if (!complete) {\r\n complete = function () {}\r\n }\r\n\r\n // Animation loop\r\n // let canceled = false;\r\n const change = to - from\r\n\r\n function loop(timestamp: number) {\r\n var time = (timestamp || +new Date()) - start\r\n\r\n if (time >= 0) {\r\n update(easings.linear(time, from, change, duration))\r\n }\r\n if (time >= 0 && time >= duration) {\r\n update(to)\r\n if (complete) {\r\n complete()\r\n }\r\n } else {\r\n window.requestAnimationFrame(loop)\r\n }\r\n }\r\n\r\n update(from)\r\n\r\n // Start animation loop\r\n const start =\r\n window.performance && window.performance.now ? window.performance.now() : +new Date()\r\n\r\n window.requestAnimationFrame(loop)\r\n }\r\n\r\n public static animateClass(\r\n element: HTMLElement,\r\n animationName: string,\r\n callBack?: Function\r\n ): void {\r\n const animateClasses = animationName.split(' ')\r\n animateClasses.forEach((cssClass) => element.classList.add(cssClass))\r\n DOMEventHandlerUtil.one(element, 'animationend', function () {\r\n animateClasses.forEach((cssClass) => element.classList.remove(cssClass))\r\n })\r\n\r\n if (callBack) {\r\n DOMEventHandlerUtil.one(element, 'animationend', callBack)\r\n }\r\n }\r\n\r\n public static transitionEnd(element: HTMLElement, callBack: Function) {\r\n DOMEventHandlerUtil.one(element, 'transitionend', callBack)\r\n }\r\n\r\n public static animationEnd(element: HTMLElement, callBack: Function) {\r\n DOMEventHandlerUtil.one(element, 'animationend', callBack)\r\n }\r\n\r\n public static animationDelay(element: HTMLElement, value: string) {\r\n ElementStyleUtil.set(element, 'animation-delay', value)\r\n }\r\n\r\n public static animationDuration(element: HTMLElement, value: string) {\r\n ElementStyleUtil.set(element, 'animation-duration', value)\r\n }\r\n\r\n public static scrollTo(element: HTMLElement | null, offset: number, duration: number = 500) {\r\n let targetPos = element ? getElementOffset(element).top : 0\r\n let scrollPos =\r\n window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0\r\n\r\n if (offset) {\r\n scrollPos += offset\r\n targetPos = targetPos - offset\r\n }\r\n\r\n const from = scrollPos\r\n const to = targetPos\r\n\r\n ElementAnimateUtil.animate(from, to, duration, function (value: number) {\r\n document.documentElement.scrollTop = value\r\n // document.body.parentNode.scrollTop = value;\r\n document.body.scrollTop = value\r\n }) //, easing, done\r\n }\r\n public static scrollTop(offset: number, duration: number) {\r\n ElementAnimateUtil.scrollTo(null, offset, duration)\r\n }\r\n}\r\n","import {OffsetModel} from './models/OffsetModel'\r\nimport {ViewPortModel} from './models/ViewPortModel'\r\nimport {ElementStyleUtil} from './_ElementStyleUtil'\r\nimport {DataUtil} from './_DataUtil'\r\nimport {ElementAnimateUtil} from './ElementAnimateUtil'\r\nimport {getObjectPropertyValueByKey, toJSON} from './_TypesHelpers'\r\n\r\nfunction getCSS(el: HTMLElement, styleProp: string) {\r\n const defaultView = (el.ownerDocument || document).defaultView\r\n\r\n if (!defaultView) {\r\n return ''\r\n }\r\n\r\n // sanitize property name to css notation\r\n // (hyphen separated words eg. font-Size)\r\n styleProp = styleProp.replace(/([A-Z])/g, '-$1').toLowerCase()\r\n\r\n return defaultView.getComputedStyle(el, null).getPropertyValue(styleProp)\r\n}\r\n\r\nfunction getCSSVariableValue(variableName: string) {\r\n let hex = getComputedStyle(document.documentElement).getPropertyValue(variableName)\r\n if (hex && hex.length > 0) {\r\n hex = hex.trim()\r\n }\r\n\r\n return hex\r\n}\r\n\r\nfunction getElementActualCss(el: HTMLElement, prop: any, cache: boolean) {\r\n let css = ''\r\n\r\n if (!el.getAttribute('kt-hidden-' + prop) || cache === false) {\r\n let value\r\n\r\n // the element is hidden so:\r\n // making the el block so we can meassure its height but still be hidden\r\n css = el.style.cssText\r\n el.style.cssText = 'position: absolute; visibility: hidden; display: block;'\r\n\r\n if (prop === 'width') {\r\n value = el.offsetWidth\r\n } else if (prop === 'height') {\r\n value = el.offsetHeight\r\n }\r\n\r\n el.style.cssText = css\r\n\r\n // store it in cache\r\n if (value !== undefined) {\r\n el.setAttribute('kt-hidden-' + prop, value.toString())\r\n return parseFloat(value.toString())\r\n }\r\n return 0\r\n } else {\r\n // store it in cache\r\n const attributeValue = el.getAttribute('kt-hidden-' + prop)\r\n if (attributeValue || attributeValue === '0') {\r\n return parseFloat(attributeValue)\r\n }\r\n }\r\n}\r\n\r\nfunction getElementActualHeight(el: HTMLElement) {\r\n return getElementActualCss(el, 'height', false)\r\n}\r\n\r\nfunction getElementActualWidth(el: HTMLElement, cache?: boolean) {\r\n return getElementActualCss(el, 'width', false)\r\n}\r\n\r\nfunction getElementIndex(element: HTMLElement) {\r\n if (element.parentNode) {\r\n const c = element.parentNode.children\r\n for (let i = 0; i < c.length; i++) {\r\n if (c[i] === element) return i\r\n }\r\n }\r\n return -1\r\n}\r\n\r\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches\r\nfunction getElementMatches(element: HTMLElement, selector: string) {\r\n const p = Element.prototype\r\n const f = p.matches || p.webkitMatchesSelector\r\n\r\n if (element && element.tagName) {\r\n return f.call(element, selector)\r\n } else {\r\n return false\r\n }\r\n}\r\n\r\nfunction getElementOffset(el: HTMLElement): OffsetModel {\r\n // Return zeros for disconnected and hidden (display: none) elements (gh-2310)\r\n // Support: IE <=11 only\r\n // Running getBoundingClientRect on a\r\n // disconnected node in IE throws an error\r\n if (!el.getClientRects().length) {\r\n return {top: 0, left: 0}\r\n }\r\n\r\n // Get document-relative position by adding viewport scroll to viewport-relative gBCR\r\n const rect = el.getBoundingClientRect()\r\n const win = el.ownerDocument.defaultView\r\n if (win) {\r\n return {\r\n top: rect.top + win.pageYOffset,\r\n left: rect.left + win.pageXOffset,\r\n }\r\n }\r\n\r\n return rect\r\n}\r\n\r\nfunction getElementParents(element: Element, selector: string) {\r\n // Element.matches() polyfill\r\n if (!Element.prototype.matches) {\r\n Element.prototype.matches = function (s) {\r\n const matches = (document || this.ownerDocument).querySelectorAll(s)\r\n let i = matches.length\r\n while (--i >= 0 && matches.item(i) !== this) {}\r\n return i > -1\r\n }\r\n }\r\n\r\n // Set up a parent array\r\n const parents: Array = []\r\n\r\n let el: Element | null = element\r\n\r\n // Push each parent element to the array\r\n for (; el && el !== document.body; el = el.parentElement) {\r\n if (selector) {\r\n if (el.matches(selector)) {\r\n parents.push(el)\r\n }\r\n continue\r\n }\r\n parents.push(el)\r\n }\r\n\r\n // Return our parent array\r\n return parents\r\n}\r\n\r\nfunction getHighestZindex(el: HTMLElement) {\r\n let bufferNode: Node | null = el as Node\r\n let buffer = el\r\n while (bufferNode && bufferNode !== document) {\r\n // Ignore z-index if position is set to a value where z-index is ignored by the browser\r\n // This makes behavior of this function consistent across browsers\r\n // WebKit always returns auto if the element is positioned\r\n const position = buffer.style.getPropertyValue('position')\r\n if (position === 'absolute' || position === 'relative' || position === 'fixed') {\r\n // IE returns 0 when zIndex is not specified\r\n // other browsers return a string\r\n // we ignore the case of nested elements with an explicit value of 0\r\n //
\r\n const value = parseInt(buffer.style.getPropertyValue('z-index'))\r\n if (!isNaN(value) && value !== 0) {\r\n return value\r\n }\r\n }\r\n\r\n bufferNode = bufferNode.parentNode\r\n buffer = bufferNode as HTMLElement\r\n }\r\n return null\r\n}\r\n\r\nfunction getScrollTop(): number {\r\n return (document.scrollingElement || document.documentElement).scrollTop\r\n}\r\n\r\n// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth\r\nfunction getViewPort(): ViewPortModel {\r\n return {\r\n width: window.innerWidth,\r\n height: window.innerHeight,\r\n }\r\n}\r\n\r\nfunction insertAfterElement(el: HTMLElement, referenceNode: HTMLElement) {\r\n return referenceNode.parentNode?.insertBefore(el, referenceNode.nextSibling)\r\n}\r\n\r\nfunction isElementHasClasses(element: HTMLElement, classesStr: string): boolean {\r\n const classes = classesStr.split(' ')\r\n for (let i = 0; i < classes.length; i++) {\r\n if (!element.classList.contains(classes[i])) {\r\n return false\r\n }\r\n }\r\n\r\n return true\r\n}\r\n\r\nfunction isVisibleElement(element: HTMLElement): boolean {\r\n return !(element.offsetWidth === 0 && element.offsetHeight === 0)\r\n}\r\n\r\n// Throttle function: Input as function which needs to be throttled and delay is the time interval in milliseconds\r\nfunction throttle(timer: number | undefined, func: Function, delay?: number) {\r\n // If setTimeout is already scheduled, no need to do anything\r\n if (timer) {\r\n return\r\n }\r\n\r\n // Schedule a setTimeout after delay seconds\r\n timer = window.setTimeout(function () {\r\n func()\r\n\r\n // Once setTimeout function execution is finished, timerId = undefined so that in
\r\n // the next scroll event function execution can be scheduled by the setTimeout\r\n timer = undefined\r\n }, delay)\r\n}\r\n\r\nfunction getElementChildren(element: HTMLElement, selector: string): Array | null {\r\n if (!element || !element.childNodes) {\r\n return null\r\n }\r\n\r\n const result: Array = []\r\n for (let i = 0; i < element.childNodes.length; i++) {\r\n const child = element.childNodes[i]\r\n // child.nodeType == 1 => Element, Text, Comment, ProcessingInstruction, CDATASection, EntityReference\r\n if (child.nodeType === 1 && getElementMatches(child as HTMLElement, selector)) {\r\n result.push(child as HTMLElement)\r\n }\r\n }\r\n\r\n return result\r\n}\r\n\r\nfunction getElementChild(element: HTMLElement, selector: string): HTMLElement | null {\r\n const children = getElementChildren(element, selector)\r\n return children ? children[0] : null\r\n}\r\n\r\nfunction isMobileDevice(): boolean {\r\n let test = getViewPort().width < +getBreakpoint('lg') ? true : false\r\n\r\n if (test === false) {\r\n // For use within normal web clients\r\n test = navigator.userAgent.match(/iPad/i) != null\r\n }\r\n\r\n return test\r\n}\r\n\r\nfunction slide(el: HTMLElement, dir: string, speed: number, callback: any) {\r\n if (\r\n !el ||\r\n (dir === 'up' && isVisibleElement(el) === false) ||\r\n (dir === 'down' && isVisibleElement(el) === true)\r\n ) {\r\n return\r\n }\r\n\r\n speed = speed ? speed : 600\r\n let calcHeight = getElementActualHeight(el)\r\n let calcPaddingTop: number = 0\r\n let calcPaddingBottom: number = 0\r\n\r\n if (ElementStyleUtil.get(el, 'padding-top') && DataUtil.get(el, 'slide-padding-top') !== true) {\r\n DataUtil.set(el, 'slide-padding-top', ElementStyleUtil.get(el, 'padding-top'))\r\n }\r\n\r\n if (\r\n ElementStyleUtil.get(el, 'padding-bottom') &&\r\n DataUtil.has(el, 'slide-padding-bottom') !== true\r\n ) {\r\n DataUtil.set(el, 'slide-padding-bottom', ElementStyleUtil.get(el, 'padding-bottom'))\r\n }\r\n\r\n if (DataUtil.has(el, 'slide-padding-top')) {\r\n calcPaddingTop = parseInt(DataUtil.get(el, 'slide-padding-top'))\r\n }\r\n\r\n if (DataUtil.has(el, 'slide-padding-bottom')) {\r\n calcPaddingBottom = parseInt(DataUtil.get(el, 'slide-padding-bottom'))\r\n }\r\n\r\n if (dir === 'up') {\r\n // up\r\n el.style.cssText = 'display: block; overflow: hidden;'\r\n\r\n if (calcPaddingTop) {\r\n ElementAnimateUtil.animate(0, calcPaddingTop, speed, function (value: number) {\r\n el.style.paddingTop = calcPaddingTop - value + 'px'\r\n })\r\n }\r\n\r\n if (calcPaddingBottom) {\r\n ElementAnimateUtil.animate(0, calcPaddingBottom, speed, function (value: number) {\r\n el.style.paddingBottom = calcPaddingBottom - value + 'px'\r\n })\r\n }\r\n\r\n ElementAnimateUtil.animate(\r\n 0,\r\n calcHeight || 0,\r\n speed,\r\n function (value: number) {\r\n el.style.height = (calcHeight || 0) - value + 'px'\r\n },\r\n function () {\r\n el.style.height = ''\r\n el.style.display = 'none'\r\n\r\n if (typeof callback === 'function') {\r\n callback()\r\n }\r\n }\r\n )\r\n } else if (dir === 'down') {\r\n // down\r\n el.style.cssText = 'display: block; overflow: hidden;'\r\n\r\n if (calcPaddingTop) {\r\n ElementAnimateUtil.animate(\r\n 0,\r\n calcPaddingTop,\r\n speed,\r\n function (value: number) {\r\n //\r\n el.style.paddingTop = value + 'px'\r\n },\r\n function () {\r\n el.style.paddingTop = ''\r\n }\r\n )\r\n }\r\n\r\n if (calcPaddingBottom) {\r\n ElementAnimateUtil.animate(\r\n 0,\r\n calcPaddingBottom,\r\n speed,\r\n function (value: number) {\r\n el.style.paddingBottom = value + 'px'\r\n },\r\n function () {\r\n el.style.paddingBottom = ''\r\n }\r\n )\r\n }\r\n\r\n ElementAnimateUtil.animate(\r\n 0,\r\n calcHeight || 0,\r\n speed,\r\n function (value: number) {\r\n el.style.height = value + 'px'\r\n },\r\n function () {\r\n el.style.height = ''\r\n el.style.display = ''\r\n el.style.overflow = ''\r\n\r\n if (typeof callback === 'function') {\r\n callback()\r\n }\r\n }\r\n )\r\n }\r\n}\r\n\r\nfunction slideUp(el: HTMLElement, speed: number, callback: any) {\r\n slide(el, 'up', speed, callback)\r\n}\r\n\r\nfunction slideDown(el: HTMLElement, speed: number, callback: any) {\r\n slide(el, 'down', speed, callback)\r\n}\r\n\r\nfunction getBreakpoint(breakpoint: string) {\r\n let value: number | string = getCSSVariableValue('--bs-' + breakpoint)\r\n if (value) {\r\n value = parseInt(value.trim())\r\n }\r\n\r\n return value\r\n}\r\n\r\nfunction getAttributeValueByBreakpoint(incomingAttr: string): string | JSON {\r\n let value = toJSON(incomingAttr)\r\n if (typeof value !== 'object') {\r\n return incomingAttr\r\n }\r\n\r\n const width = getViewPort().width\r\n let resultKey\r\n let resultBreakpoint = -1\r\n let breakpoint\r\n\r\n for (let key in value) {\r\n if (key === 'default') {\r\n breakpoint = 0\r\n } else {\r\n breakpoint = getBreakpoint(key) ? +getBreakpoint(key) : parseInt(key)\r\n }\r\n\r\n if (breakpoint <= width && breakpoint > resultBreakpoint) {\r\n resultKey = key\r\n resultBreakpoint = breakpoint\r\n }\r\n }\r\n\r\n return resultKey ? getObjectPropertyValueByKey(value, resultKey) : value\r\n}\r\n\r\nfunction colorLighten(color: string, amount: number) {\r\n const addLight = (_color: string, _amount: number) => {\r\n const cc = parseInt(_color, 16) + _amount\r\n const cNum = cc > 255 ? 255 : cc\r\n const c = cNum.toString(16).length > 1 ? cNum.toString(16) : `0${cNum.toString(16)}`\r\n return c\r\n }\r\n\r\n color = color.indexOf('#') >= 0 ? color.substring(1, color.length) : color\r\n amount = parseInt(((255 * amount) / 100).toString())\r\n return (color = `#${addLight(color.substring(0, 2), amount)}${addLight(\r\n color.substring(2, 4),\r\n amount\r\n )}${addLight(color.substring(4, 6), amount)}`)\r\n}\r\n\r\nfunction colorDarken(color: string, amount: number) {\r\n const subtractLight = (_color: string, _amount: number) => {\r\n const cc = parseInt(color, 16) - amount\r\n const cNum = cc < 0 ? 0 : cc\r\n const c = cNum.toString(16).length > 1 ? cNum.toString(16) : `0${cNum.toString(16)}`\r\n return c\r\n }\r\n\r\n color = color.indexOf('#') >= 0 ? color.substring(1, color.length) : color\r\n amount = parseInt(((255 * amount) / 100).toString())\r\n\r\n return (color = `#${subtractLight(color.substring(0, 2), amount)}${subtractLight(\r\n color.substring(2, 4),\r\n amount\r\n )}${subtractLight(color.substring(4, 6), amount)}`)\r\n}\r\n\r\nexport {\r\n getBreakpoint,\r\n getCSS,\r\n getCSSVariableValue,\r\n getElementActualCss,\r\n getElementActualHeight,\r\n getElementActualWidth,\r\n getElementIndex,\r\n getElementMatches,\r\n getElementOffset,\r\n getElementParents,\r\n getHighestZindex,\r\n getScrollTop,\r\n getViewPort,\r\n insertAfterElement,\r\n isElementHasClasses,\r\n isVisibleElement,\r\n throttle,\r\n getElementChildren,\r\n getElementChild,\r\n isMobileDevice,\r\n slide,\r\n slideUp,\r\n slideDown,\r\n getAttributeValueByBreakpoint,\r\n colorLighten,\r\n colorDarken,\r\n}\r\n","import {DataUtil} from './_DataUtil'\r\nimport {getUniqueIdWithPrefix} from './_TypesHelpers'\r\n\r\nexport interface EventMeta {\r\n name: string\r\n callback: Function\r\n one: boolean\r\n fired: boolean\r\n}\r\n\r\nexport class EventHandlerUtil {\r\n static store: Map> = new Map()\r\n\r\n private static setEventMetasByName(name: string, metas: Map): void {\r\n EventHandlerUtil.store.set(name, metas)\r\n }\r\n\r\n private static getEventMetasByName(name: string): Map | undefined {\r\n return EventHandlerUtil.store.get(name)\r\n }\r\n\r\n private static setEventMetaByNameAndHandlerId(\r\n name: string,\r\n handlerId: string,\r\n meta: EventMeta\r\n ): void {\r\n let metas = EventHandlerUtil.getEventMetasByName(name)\r\n if (!metas) {\r\n metas = new Map()\r\n }\r\n\r\n metas.set(handlerId, meta)\r\n EventHandlerUtil.setEventMetasByName(name, metas)\r\n }\r\n\r\n private static getEventsMetaByHandlerId(name: string, handlerId: string): EventMeta | undefined {\r\n const metas = EventHandlerUtil.store.get(name)\r\n if (!metas) {\r\n return\r\n }\r\n\r\n return metas.get(handlerId)\r\n }\r\n\r\n private static setFiredByNameAndHandlerId(name: string, handerId: string, fired: boolean): void {\r\n const meta = EventHandlerUtil.getEventsMetaByHandlerId(name, handerId)\r\n if (!meta) {\r\n return\r\n }\r\n\r\n meta.fired = fired\r\n EventHandlerUtil.setEventMetaByNameAndHandlerId(name, handerId, meta)\r\n }\r\n\r\n private static addEvent(\r\n element: HTMLElement,\r\n name: string,\r\n callback: Function,\r\n one: boolean = false\r\n ) {\r\n const handlerId = getUniqueIdWithPrefix('event')\r\n DataUtil.set(element, name, handlerId)\r\n const meta: EventMeta = {\r\n name: name,\r\n callback: callback,\r\n one: one,\r\n fired: false,\r\n }\r\n\r\n EventHandlerUtil.setEventMetaByNameAndHandlerId(name, handlerId, meta)\r\n }\r\n\r\n private static removeEvent(element: HTMLElement, name: string) {\r\n const handlerId = DataUtil.get(element, name)\r\n if (!handlerId) {\r\n return\r\n }\r\n\r\n const metas = EventHandlerUtil.getEventMetasByName(name)\r\n if (!metas) {\r\n return\r\n }\r\n\r\n metas.delete(handlerId)\r\n EventHandlerUtil.setEventMetasByName(name, metas)\r\n }\r\n\r\n public static trigger(element: HTMLElement, name: string, target?: any, e?: Event) {\r\n if (DataUtil.has(element, name)) {\r\n const handlerId = DataUtil.get(element, name)\r\n if (!handlerId) {\r\n return undefined\r\n }\r\n\r\n const handler = EventHandlerUtil.getEventsMetaByHandlerId(name, handlerId)\r\n if (handler) {\r\n if (handler.name === name) {\r\n if (handler.one === true) {\r\n if (handler.fired === false) {\r\n EventHandlerUtil.setFiredByNameAndHandlerId(name, handlerId, true)\r\n return handler.callback.call(this, target, e)\r\n }\r\n } else {\r\n return handler.callback.call(this, target, e)\r\n }\r\n }\r\n }\r\n }\r\n\r\n return null\r\n }\r\n\r\n public static on = function (element: HTMLElement, name: string, callBack: Function): void {\r\n EventHandlerUtil.addEvent(element, name, callBack, false)\r\n }\r\n\r\n public static one(element: HTMLElement, name: string, callBack: Function): void {\r\n EventHandlerUtil.addEvent(element, name, callBack, true)\r\n }\r\n\r\n public static off(element: HTMLElement, name: string): void {\r\n EventHandlerUtil.removeEvent(element, name)\r\n }\r\n}\r\n","import React, {\r\n FC,\r\n createContext,\r\n useContext,\r\n useState,\r\n useEffect,\r\n SetStateAction,\r\n Dispatch,\r\n} from 'react'\r\n\r\nconst MetronicSplashScreenContext = createContext> | undefined>(\r\n undefined\r\n)\r\n\r\nconst MetronicSplashScreenProvider: FC = ({children}) => {\r\n const [count, setCount] = useState(0)\r\n let visible = count > 0\r\n\r\n useEffect(() => {\r\n const splashScreen = document.getElementById('splash-screen')\r\n\r\n // Show SplashScreen\r\n if (splashScreen && visible) {\r\n splashScreen.classList.remove('hidden')\r\n\r\n return () => {\r\n splashScreen.classList.add('hidden')\r\n }\r\n }\r\n\r\n // Hide SplashScreen\r\n let timeout: number\r\n if (splashScreen && !visible) {\r\n timeout = window.setTimeout(() => {\r\n splashScreen.classList.add('hidden')\r\n }, 3000)\r\n }\r\n\r\n return () => {\r\n clearTimeout(timeout)\r\n }\r\n }, [visible])\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n\r\nconst LayoutSplashScreen: FC<{visible?: boolean}> = ({visible = true}) => {\r\n // Everything are ready - remove splashscreen\r\n const setCount = useContext(MetronicSplashScreenContext)\r\n\r\n useEffect(() => {\r\n if (!visible) {\r\n return\r\n }\r\n\r\n if (setCount) {\r\n setCount((prev) => {\r\n return prev + 1\r\n })\r\n }\r\n\r\n return () => {\r\n if (setCount) {\r\n setCount((prev) => {\r\n return prev - 1\r\n })\r\n }\r\n }\r\n }, [setCount, visible])\r\n\r\n return null\r\n}\r\n\r\nexport {MetronicSplashScreenProvider, LayoutSplashScreen}\r\n","/* eslint-disable no-useless-escape */\r\n// DOCS: https://javascript.info/cookie\r\nexport class CookieComponent {\r\n /**\r\n * Returns the cookie with the given name, or undefined if not found\r\n *\r\n * @param {string} name - cookie name\r\n * @returns string | null\r\n */\r\n public static get(name: string): string | undefined {\r\n let matches = document.cookie.match(\r\n new RegExp('(?:^|; )' + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + '=([^;]*)')\r\n )\r\n return matches ? decodeURIComponent(matches[1]) : undefined\r\n }\r\n\r\n /**\r\n * Please note that a cookie value is encoded,\r\n * so getCookie uses a built-in decodeURIComponent function to decode it.\r\n *\r\n * @param {string} name - cookie name\r\n * @param {string | number | boolean} value - cookie value\r\n * @param {any} cookieOptions - cookie options\r\n * @returns void\r\n */\r\n public static set(name: string, value: string | number | boolean, cookieOptions: any): void {\r\n const options = {\r\n path: '/',\r\n // add other defaults here if necessary\r\n ...cookieOptions,\r\n }\r\n\r\n if (options.expires instanceof Date) {\r\n options.expires = options.expires.toUTCString()\r\n }\r\n\r\n let updatedCookie = encodeURIComponent(name) + '=' + encodeURIComponent(value)\r\n\r\n for (let optionKey in options) {\r\n updatedCookie += '; ' + optionKey\r\n let optionValue = options[optionKey]\r\n if (optionValue !== true) {\r\n updatedCookie += '=' + optionValue\r\n }\r\n }\r\n\r\n document.cookie = updatedCookie\r\n }\r\n\r\n /**\r\n * To delete a cookie, we can call it with a negative expiration date\r\n *\r\n * @param {string} name\r\n */\r\n public static delete(name: string): void {\r\n CookieComponent.set(name, '', {\r\n 'max-age': -1,\r\n })\r\n }\r\n}\r\n","import {\r\n EventHandlerUtil,\r\n getUniqueIdWithPrefix,\r\n getObjectPropertyValueByKey,\r\n stringSnakeToCamel,\r\n getAttributeValueByBreakpoint,\r\n throttle,\r\n getCSS,\r\n DOMEventHandlerUtil,\r\n ElementStyleUtil,\r\n} from '../_utils/index'\r\n\r\nexport class DrawerStore {\r\n static store: Map = new Map()\r\n\r\n public static set(instanceId: string, drawerComponentObj: DrawerComponent): void {\r\n if (DrawerStore.has(instanceId)) {\r\n return\r\n }\r\n\r\n DrawerStore.store.set(instanceId, drawerComponentObj)\r\n }\r\n\r\n public static get(instanceId: string): DrawerComponent | undefined {\r\n if (!DrawerStore.has(instanceId)) {\r\n return\r\n }\r\n return DrawerStore.store.get(instanceId)\r\n }\r\n\r\n public static remove(instanceId: string): void {\r\n if (!DrawerStore.has(instanceId)) {\r\n return\r\n }\r\n\r\n DrawerStore.store.delete(instanceId)\r\n }\r\n\r\n public static has(instanceId: string): boolean {\r\n return DrawerStore.store.has(instanceId)\r\n }\r\n\r\n public static getAllInstances() {\r\n return DrawerStore.store\r\n }\r\n}\r\n\r\nexport interface DrawerOptions {\r\n overlay: boolean\r\n baseClass: string\r\n overlayClass: string\r\n direction: string\r\n}\r\n\r\nconst defaultDrawerOptions: DrawerOptions = {\r\n overlay: true,\r\n baseClass: 'drawer',\r\n overlayClass: 'drawer-overlay',\r\n direction: 'end',\r\n}\r\n\r\nclass DrawerComponent {\r\n element: HTMLElement\r\n overlayElement: HTMLElement | null = null\r\n toggleElement: HTMLElement | null = null\r\n options: DrawerOptions\r\n instanceUid: string\r\n name: string = ''\r\n shown: boolean = false\r\n lastWidth: number = 0\r\n closeElement: HTMLElement | null = null\r\n\r\n constructor(_element: HTMLElement, options: DrawerOptions) {\r\n this.element = _element\r\n this.options = Object.assign(defaultDrawerOptions, options)\r\n this.instanceUid = getUniqueIdWithPrefix('drawer')\r\n this.overlayElement = null\r\n this.name = this.element.getAttribute('data-kt-drawer-name') || ''\r\n this.shown = false\r\n this.toggleElement = null\r\n // Event Handlers\r\n this._handlers()\r\n // Update Instance\r\n this._update()\r\n // Bind Instance\r\n DrawerStore.set(this.element.id, this)\r\n }\r\n\r\n private _handlers = () => {\r\n const togglers = this._getOption('toggle') as string\r\n const closers = this._getOption('close') as string\r\n\r\n if (togglers !== null && togglers.length > 0) {\r\n DOMEventHandlerUtil.on(document.body, togglers, 'click', (e: Event) => {\r\n e.preventDefault()\r\n this.toggleElement = document.getElementById(togglers)\r\n this._toggle()\r\n })\r\n }\r\n\r\n if (closers !== null && closers.length > 0) {\r\n DOMEventHandlerUtil.on(document.body, closers, 'click', (e: Event) => {\r\n e.preventDefault()\r\n this.closeElement = document.getElementById(closers)\r\n\r\n this._hide()\r\n })\r\n }\r\n }\r\n\r\n private _update = () => {\r\n const width = String(this._getOption('width'))\r\n const direction = String(this._getOption('direction'))\r\n\r\n // Reset state\r\n const hasBaseClass = this.element.classList.contains(`${this.options.baseClass}-on`)\r\n const bodyCanvasAttr = String(document.body.getAttribute(`data-kt-drawer-${this.name}-`))\r\n\r\n if (hasBaseClass === true && bodyCanvasAttr === 'on') {\r\n this.shown = true\r\n } else {\r\n this.shown = false\r\n }\r\n\r\n // Activate/deactivate\r\n if (this._getOption('activate') === true) {\r\n this.element.classList.add(this.options.baseClass)\r\n this.element.classList.add(`${this.options.baseClass}-${direction}`)\r\n ElementStyleUtil.set(this.element, 'width', width, true)\r\n\r\n this.lastWidth = parseInt(width)\r\n } else {\r\n ElementStyleUtil.set(this.element, 'width', '')\r\n this.element.classList.remove(this.options.baseClass)\r\n this.element.classList.remove(`${this.options.baseClass}-${direction}`)\r\n this._hide()\r\n }\r\n }\r\n\r\n private _getOption = (name: string) => {\r\n const attr = this.element.getAttribute(`data-kt-drawer-${name}`)\r\n if (attr) {\r\n let value = getAttributeValueByBreakpoint(attr)\r\n if (value !== null && String(value) === 'true') {\r\n return true\r\n } else {\r\n if (value !== null && String(value) === 'false') {\r\n return false\r\n }\r\n }\r\n\r\n return value\r\n } else {\r\n const optionName = stringSnakeToCamel(name)\r\n const option = getObjectPropertyValueByKey(this.options, optionName)\r\n if (option) {\r\n return getAttributeValueByBreakpoint(option)\r\n } else {\r\n return null\r\n }\r\n }\r\n }\r\n\r\n private _toggle = () => {\r\n if (EventHandlerUtil.trigger(this.element, 'kt.drawer.toggle') === false) {\r\n return\r\n }\r\n\r\n if (this.shown) {\r\n this._hide()\r\n } else {\r\n this._show()\r\n }\r\n\r\n EventHandlerUtil.trigger(this.element, 'kt.drawer.toggled')\r\n }\r\n\r\n private _hide = () => {\r\n if (EventHandlerUtil.trigger(this.element, 'kt.drawer.hide') === false) {\r\n return\r\n }\r\n\r\n this.shown = false\r\n this._deleteOverlay()\r\n document.body.removeAttribute(`data-kt-drawer-${this.name}`)\r\n document.body.removeAttribute(`data-kt-drawer`)\r\n this.element.classList.remove(`${this.options.baseClass}-on`)\r\n if (this.toggleElement != null) {\r\n this.toggleElement.classList.remove('active')\r\n }\r\n\r\n EventHandlerUtil.trigger(this.element, 'kt.drawer.after.hidden')\r\n }\r\n\r\n private _show = () => {\r\n if (EventHandlerUtil.trigger(this.element, 'kt.drawer.show') === false) {\r\n return\r\n }\r\n\r\n this.shown = true\r\n this._createOverlay()\r\n document.body.setAttribute(`data-kt-drawer-${this.name}`, 'on')\r\n document.body.setAttribute('data-kt-drawer', 'on')\r\n this.element.classList.add(`${this.options.baseClass}-on`)\r\n if (this.toggleElement !== null) {\r\n this.toggleElement.classList.add('active')\r\n }\r\n\r\n EventHandlerUtil.trigger(this.element, 'kt.drawer.shown')\r\n }\r\n\r\n private _createOverlay = () => {\r\n if (this._getOption('overlay') === true) {\r\n this.overlayElement = document.createElement('DIV')\r\n const elementZIndex = getCSS(this.element, 'z-index')\r\n if (elementZIndex) {\r\n const overlayZindex = parseInt(elementZIndex) - 1\r\n ElementStyleUtil.set(this.overlayElement, 'z-index', overlayZindex) // update\r\n }\r\n document.body.append(this.overlayElement)\r\n const overlayClassOption = this._getOption('overlay-class')\r\n if (overlayClassOption) {\r\n this.overlayElement.classList.add(overlayClassOption.toString())\r\n }\r\n this.overlayElement.addEventListener('click', (e) => {\r\n e.preventDefault()\r\n this._hide()\r\n })\r\n }\r\n }\r\n\r\n private _deleteOverlay = () => {\r\n if (this.overlayElement !== null && this.overlayElement.parentNode) {\r\n this.overlayElement.parentNode.removeChild(this.overlayElement)\r\n }\r\n }\r\n\r\n private _getDirection = () => {\r\n return String(this._getOption('direction')) === 'left' ? 'left' : 'right'\r\n }\r\n\r\n private _getWidth = () => {\r\n let width = this._getOption('width')\r\n if (width && width === 'auto') {\r\n width = getCSS(this.element, 'width')\r\n }\r\n\r\n return width\r\n }\r\n\r\n ///////////////////////\r\n // ** Public API ** //\r\n ///////////////////////\r\n public toggle = () => {\r\n this._toggle()\r\n }\r\n\r\n public show = () => {\r\n this._show()\r\n }\r\n\r\n public hide = () => {\r\n this._hide()\r\n }\r\n\r\n public isShown = () => {\r\n return this.shown\r\n }\r\n\r\n public update = () => {\r\n this._update()\r\n }\r\n\r\n public goElement = () => {\r\n return this.element\r\n }\r\n\r\n // Event API\r\n public on = (name: string, handler: Function) => {\r\n return EventHandlerUtil.on(this.element, name, handler)\r\n }\r\n\r\n public one = (name: string, handler: Function) => {\r\n return EventHandlerUtil.one(this.element, name, handler)\r\n }\r\n\r\n public off = (name: string) => {\r\n return EventHandlerUtil.off(this.element, name)\r\n }\r\n\r\n public trigger = (name: string, event: Event) => {\r\n return EventHandlerUtil.trigger(this.element, name, event)\r\n }\r\n\r\n // Static methods\r\n public static hasInstace = (elementId: string): boolean => {\r\n return DrawerStore.has(elementId)\r\n }\r\n\r\n public static getInstance = (elementId: string) => {\r\n return DrawerStore.get(elementId)\r\n }\r\n\r\n public static hideAll = () => {\r\n const oldInstances = DrawerStore.getAllInstances()\r\n oldInstances.forEach((dr) => {\r\n dr.hide()\r\n })\r\n }\r\n\r\n public static updateAll = () => {\r\n const oldInstances = DrawerStore.getAllInstances()\r\n oldInstances.forEach((dr) => {\r\n dr.update()\r\n })\r\n }\r\n\r\n // Create Instances\r\n public static createInstances(selector: string): void {\r\n const elements = document.body.querySelectorAll(selector)\r\n elements.forEach((element) => {\r\n const item = element as HTMLElement\r\n let drawer = DrawerComponent.getInstance(item.id)\r\n if (!drawer) {\r\n drawer = new DrawerComponent(item, defaultDrawerOptions)\r\n }\r\n drawer.element = item\r\n drawer.hide()\r\n })\r\n }\r\n\r\n // Dismiss instances\r\n public static handleDismiss = () => {\r\n // External drawer toggle handler\r\n DOMEventHandlerUtil.on(document.body, '[data-kt-drawer-dismiss=\"true\"]', 'click', () => {\r\n /* @ts-ignore */\r\n const element = this.closest('[data-kt-drawer=\"true\"]')\r\n if (element) {\r\n const drawer = DrawerComponent.getInstance(element)\r\n if (drawer && drawer.isShown()) {\r\n drawer.hide()\r\n }\r\n }\r\n })\r\n }\r\n\r\n // Global Initialization\r\n public static initGlobalHandlers(): void {\r\n // Window Resize Handling\r\n window.addEventListener('resize', function () {\r\n let timer: number | undefined\r\n throttle(\r\n timer,\r\n () => {\r\n // Locate and update Drawer instances on window resize\r\n const elements = document.body.querySelectorAll('[data-kt-drawer=\"true\"]')\r\n elements.forEach((el) => {\r\n const item = el as HTMLElement\r\n const instance = DrawerComponent.getInstance(item.id)\r\n if (instance) {\r\n instance.element = item\r\n instance.update()\r\n }\r\n })\r\n },\r\n 200\r\n )\r\n })\r\n }\r\n\r\n public static bootstrap = () => {\r\n DrawerComponent.createInstances('[data-kt-drawer=\"true\"]')\r\n DrawerComponent.initGlobalHandlers()\r\n DrawerComponent.handleDismiss()\r\n }\r\n\r\n public static reinitialization = () => {\r\n DrawerComponent.createInstances('[data-kt-drawer=\"true\"]')\r\n DrawerComponent.hideAll()\r\n DrawerComponent.updateAll()\r\n DrawerComponent.handleDismiss()\r\n }\r\n}\r\n\r\nexport {DrawerComponent, defaultDrawerOptions}\r\n","import {\r\n DataUtil,\r\n ElementStyleUtil,\r\n EventHandlerUtil,\r\n getUniqueIdWithPrefix,\r\n getAttributeValueByBreakpoint,\r\n} from '../_utils/index'\r\n\r\nexport interface FeedbackOptions {\r\n width?: number\r\n placement?: string\r\n content?: string\r\n type?: string\r\n}\r\n\r\nconst defaultFeedbackOptions: FeedbackOptions = {\r\n width: 100,\r\n placement: 'top-center',\r\n content: '',\r\n type: 'popup',\r\n}\r\n\r\nclass FeedbackComponent {\r\n element: HTMLElement\r\n options: FeedbackOptions\r\n instanceUid: string\r\n shown: boolean\r\n\r\n constructor(_element: HTMLElement, options: FeedbackOptions) {\r\n this.element = _element\r\n this.options = Object.assign(defaultFeedbackOptions, options)\r\n this.instanceUid = getUniqueIdWithPrefix('feedback')\r\n this.shown = false\r\n\r\n // Event handlers\r\n this._handlers() // will add in the show popup\r\n DataUtil.set(this.element, 'feedback', this)\r\n }\r\n\r\n private _handlers = () => {\r\n this.element.addEventListener('click', (e: Event) => {\r\n e.preventDefault()\r\n this._go()\r\n })\r\n }\r\n\r\n private _go = () => {}\r\n\r\n private showPopup = () => {\r\n this.element = document.createElement('DIV')\r\n\r\n this.element.classList.add('feedback feedback-popup')\r\n this.element.innerHTML = this.options.content || ''\r\n\r\n if (this.options.placement === 'top-center') {\r\n this.setPopupTopCenterPosition()\r\n }\r\n\r\n document.body.appendChild(this.element)\r\n this.element.classList.add('feedback-shown')\r\n this.shown = true\r\n }\r\n\r\n private setPopupTopCenterPosition = () => {\r\n const width = getAttributeValueByBreakpoint(this.options.width?.toString() || '0')\r\n const height = ElementStyleUtil.get(this.element, 'height')\r\n this.element.classList.add('feedback-top-center')\r\n ElementStyleUtil.set(this.element, 'width', width)\r\n ElementStyleUtil.set(this.element, 'left', '50%')\r\n ElementStyleUtil.set(this.element, 'top', '-' + height)\r\n }\r\n\r\n private hidePopup = () => {\r\n this.element.remove()\r\n }\r\n\r\n ///////////////////////\r\n // ** Public API ** //\r\n ///////////////////////\r\n public show = () => {\r\n if (EventHandlerUtil.trigger(this.element, 'kt.feedback.show') === false) {\r\n return\r\n }\r\n\r\n if (this.options.type === 'popup') {\r\n this.showPopup()\r\n }\r\n\r\n EventHandlerUtil.trigger(this.element, 'kt.feedback.shown')\r\n\r\n return this\r\n }\r\n\r\n public hide = () => {\r\n if (EventHandlerUtil.trigger(this.element, 'kt.feedback.hide') === false) {\r\n return\r\n }\r\n\r\n if (this.options.type === 'popup') {\r\n this.hidePopup()\r\n }\r\n\r\n this.shown = false\r\n EventHandlerUtil.trigger(this.element, 'kt.feedback.hidden')\r\n return this\r\n }\r\n\r\n public isShown = () => {\r\n return this.isShown\r\n }\r\n\r\n public getElement = () => {\r\n return this.element\r\n }\r\n\r\n // Event API\r\n public on = (name: string, handler: Function) => {\r\n return EventHandlerUtil.on(this.element, name, handler)\r\n }\r\n\r\n public one = (name: string, handler: Function) => {\r\n return EventHandlerUtil.one(this.element, name, handler)\r\n }\r\n\r\n public off = (name: string) => {\r\n return EventHandlerUtil.off(this.element, name)\r\n }\r\n\r\n public trigger = (name: string, event: Event) => {\r\n return EventHandlerUtil.trigger(this.element, name, event)\r\n }\r\n\r\n // Create Instances\r\n public static createInstances(selector: string) {\r\n throw new Error('not implemented')\r\n }\r\n\r\n // Static methods\r\n public static hasInstace(element: HTMLElement) {\r\n throw new Error('not implemented')\r\n }\r\n\r\n public static getInstance(element: HTMLElement) {\r\n throw new Error('not implemented')\r\n }\r\n\r\n public static bootstrap(attr: string = '[data-Feedback]') {\r\n throw new Error('not implemented')\r\n }\r\n}\r\n\r\nexport {FeedbackComponent, defaultFeedbackOptions}\r\n","import {EventHandlerUtil, DataUtil, getUniqueIdWithPrefix, getCSS} from '../_utils/index'\r\n\r\nexport interface IImageInputOptions {}\r\n\r\nexport interface IImageInputQueries {\r\n componentName: string\r\n instanseQuery: string\r\n inputQuery: string\r\n wrapperQuery: string\r\n cancelQuery: string\r\n removeQuery: string\r\n hiddenQuery: string\r\n}\r\n\r\nconst defaultImageInputOptions = {}\r\n\r\nconst defaultImageInputQueires: IImageInputQueries = {\r\n componentName: 'image-input',\r\n instanseQuery: '[data-kt-image-input]',\r\n inputQuery: 'input[type=\"file\"]',\r\n wrapperQuery: '.image-input-wrapper',\r\n cancelQuery: '[data-kt-image-input-action=\"cancel\"]',\r\n removeQuery: '[data-kt-image-input-action=\"remove\"]',\r\n hiddenQuery: 'input[type=\"hidden\"]',\r\n}\r\n\r\nclass ImageInputComponent {\r\n element: HTMLElement\r\n inputElement: HTMLInputElement | null\r\n wrapperElement: HTMLElement | null\r\n cancelElement: HTMLElement | null\r\n removeElement: HTMLElement | null\r\n hiddenElement: HTMLInputElement | null\r\n src: string = ''\r\n options: IImageInputOptions\r\n queries: IImageInputQueries\r\n uid: string\r\n value: string = ''\r\n\r\n constructor(_element: HTMLElement, _options: IImageInputOptions, _queries: IImageInputQueries) {\r\n // Variables\r\n this.options = Object.assign(defaultImageInputOptions, _options)\r\n this.queries = _queries\r\n this.uid = getUniqueIdWithPrefix(this.queries.componentName)\r\n\r\n // Elements\r\n this.element = _element\r\n this.inputElement = this.element.querySelector(this.queries.inputQuery)\r\n this.wrapperElement = this.element.querySelector(this.queries.wrapperQuery)\r\n this.cancelElement = this.element.querySelector(this.queries.cancelQuery)\r\n this.removeElement = this.element.querySelector(this.queries.removeQuery)\r\n this.hiddenElement = this.element.querySelector(this.queries.hiddenQuery)\r\n if (this.wrapperElement) {\r\n this.src = getCSS(this.wrapperElement, 'backgroundImage')\r\n }\r\n\r\n // Event Handlers\r\n this.handlers()\r\n\r\n DataUtil.set(this.element, this.queries.componentName, this)\r\n }\r\n\r\n private handlers(): void {\r\n this.element.addEventListener('change', this._change)\r\n if (this.cancelElement) {\r\n this.cancelElement.addEventListener('click', this._cancel)\r\n }\r\n\r\n if (this.removeElement) {\r\n this.removeElement.addEventListener('click', this._cancel)\r\n }\r\n }\r\n\r\n // Event Handlers\r\n private _change = (e: Event) => {\r\n e.preventDefault()\r\n\r\n if (this.inputElement !== null && this.inputElement.files && this.inputElement.files[0]) {\r\n // Fire change event\r\n if (EventHandlerUtil.trigger(this.element, 'kt.imageinput.change', e) === false) {\r\n return\r\n }\r\n\r\n const reader = new FileReader()\r\n\r\n reader.onload = (e: ProgressEvent) => {\r\n if (this.wrapperElement && e.target) {\r\n this.wrapperElement.style.setProperty('background-image', `url('${e.target.result}')`)\r\n }\r\n }\r\n\r\n reader.readAsDataURL(this.inputElement.files[0])\r\n this.element.classList.add('image-input-changed')\r\n this.element.classList.remove('image-input-empty')\r\n\r\n // Fire removed event\r\n EventHandlerUtil.trigger(this.element, 'kt.imageinput.changed', e)\r\n }\r\n }\r\n\r\n private _cancel = (e: Event) => {\r\n e.preventDefault()\r\n\r\n // Fire cancel event\r\n if (EventHandlerUtil.trigger(this.element, 'kt.imageinput.cancel', e) === false) {\r\n return\r\n }\r\n\r\n this.element.classList.remove('image-input-changed')\r\n this.element.classList.remove('image-input-empty')\r\n this.element.style.setProperty('background-image', this.src)\r\n if (this.inputElement) {\r\n this.inputElement.value = ''\r\n }\r\n\r\n if (this.hiddenElement !== null) {\r\n this.hiddenElement.value = '0'\r\n }\r\n\r\n // Fire canceled event\r\n EventHandlerUtil.trigger(this.element, 'kt.imageinput.canceled', e)\r\n }\r\n\r\n private _remove = (e: Event) => {\r\n e.preventDefault()\r\n\r\n // Fire remove event\r\n if (EventHandlerUtil.trigger(this.element, 'kt.imageinput.remove', e) === false) {\r\n return\r\n }\r\n\r\n this.element.classList.remove('image-input-changed')\r\n this.element.classList.add('image-input-empty')\r\n if (this.wrapperElement) {\r\n this.wrapperElement.style.setProperty('background-image', 'none')\r\n }\r\n\r\n if (this.inputElement) {\r\n this.inputElement.value = ''\r\n }\r\n\r\n if (this.hiddenElement !== null) {\r\n this.hiddenElement.value = '1'\r\n }\r\n\r\n // Fire removed event\r\n EventHandlerUtil.trigger(this.element, 'kt.imageinput.removed', e)\r\n }\r\n\r\n ///////////////////////\r\n // ** Public API ** //\r\n ///////////////////////\r\n public getInputElement(): HTMLInputElement | null {\r\n return this.inputElement\r\n }\r\n\r\n public getElement(): HTMLElement {\r\n return this.element\r\n }\r\n\r\n // Event API\r\n public on = (name: string, handler: Function) => {\r\n return EventHandlerUtil.on(this.element, name, handler)\r\n }\r\n\r\n public one = (name: string, handler: Function) => {\r\n return EventHandlerUtil.one(this.element, name, handler)\r\n }\r\n\r\n public off = (name: string) => {\r\n return EventHandlerUtil.off(this.element, name)\r\n }\r\n\r\n public trigger = (name: string, event: Event) => {\r\n return EventHandlerUtil.trigger(this.element, name, event)\r\n }\r\n\r\n // Static methods\r\n public static getInstance = (\r\n el: HTMLElement,\r\n componentName: string = defaultImageInputQueires.componentName\r\n ) => {\r\n const ImageInput = DataUtil.get(el, componentName)\r\n if (ImageInput) {\r\n return ImageInput\r\n }\r\n\r\n return null\r\n }\r\n\r\n public static createInstances = (\r\n selector: string = defaultImageInputQueires.instanseQuery,\r\n options: IImageInputOptions = defaultImageInputOptions,\r\n queries: IImageInputQueries = defaultImageInputQueires\r\n ) => {\r\n const elements = document.body.querySelectorAll(selector)\r\n elements.forEach((el) => {\r\n const item = el as HTMLElement\r\n let ImageInput = ImageInputComponent.getInstance(item)\r\n if (!ImageInput) {\r\n ImageInput = new ImageInputComponent(item, options, queries)\r\n }\r\n })\r\n }\r\n\r\n public static createInsance = (\r\n selector: string = defaultImageInputQueires.instanseQuery,\r\n options: IImageInputOptions = defaultImageInputOptions,\r\n queries: IImageInputQueries = defaultImageInputQueires\r\n ): ImageInputComponent | undefined => {\r\n const element = document.body.querySelector(selector)\r\n if (!element) {\r\n return\r\n }\r\n const item = element as HTMLElement\r\n let ImageInput = ImageInputComponent.getInstance(item)\r\n if (!ImageInput) {\r\n ImageInput = new ImageInputComponent(item, options, queries)\r\n }\r\n return ImageInput\r\n }\r\n\r\n public static bootstrap = (selector: string = defaultImageInputQueires.instanseQuery) => {\r\n ImageInputComponent.createInstances(selector)\r\n }\r\n\r\n public static reinitialization = (selector: string = defaultImageInputQueires.instanseQuery) => {\r\n ImageInputComponent.createInstances(selector)\r\n }\r\n}\r\nexport {ImageInputComponent, defaultImageInputOptions, defaultImageInputQueires}\r\n","import {\r\n DataUtil,\r\n getObjectPropertyValueByKey,\r\n stringSnakeToCamel,\r\n getAttributeValueByBreakpoint,\r\n getViewPort,\r\n isVisibleElement,\r\n throttle,\r\n getCSS,\r\n ElementStyleUtil,\r\n} from '../_utils/index'\r\nimport {CookieComponent} from './_CookieComponent'\r\n\r\nexport interface ScrollOptions {\r\n saveState?: boolean\r\n}\r\n\r\nconst defaultScrollOptions: ScrollOptions = {\r\n saveState: true,\r\n}\r\n\r\nclass ScrollComponent {\r\n element: HTMLElement\r\n options: ScrollOptions\r\n id: string\r\n\r\n constructor(_element: HTMLElement, options: ScrollOptions) {\r\n this.element = _element\r\n this.options = Object.assign(defaultScrollOptions, options)\r\n this.id = this.element.getAttribute('id') || ''\r\n this.update()\r\n // this.element.setAttribute('data-kt-scrolltop', 'true')\r\n DataUtil.set(this.element, 'scroll', this)\r\n }\r\n\r\n private getOption = (name: string) => {\r\n if (this.element.hasAttribute('data-kt-scroll-' + name) === true) {\r\n const attr = this.element.getAttribute('data-kt-scroll-' + name) || ''\r\n let value: string | JSON | boolean = getAttributeValueByBreakpoint(attr)\r\n if (value !== null && String(value) === 'true') {\r\n value = true\r\n } else if (value !== null && String(value) === 'false') {\r\n value = false\r\n }\r\n\r\n return value\r\n } else {\r\n const optionName = stringSnakeToCamel(name)\r\n const option = getObjectPropertyValueByKey(this.options, optionName)\r\n if (option) {\r\n return getAttributeValueByBreakpoint(option)\r\n } else {\r\n return null\r\n }\r\n }\r\n }\r\n\r\n private getHeightType = () => {\r\n if (this.getOption('height')) {\r\n return 'height'\r\n }\r\n if (this.getOption('min-height')) {\r\n return 'min-height'\r\n }\r\n if (this.getOption('max-height')) {\r\n return 'max-height'\r\n }\r\n }\r\n\r\n private getAutoHeight = () => {\r\n let height: number | string = getViewPort().height\r\n const dependencies = this.getOption('dependencies')\r\n const wrappers = this.getOption('wrappers')\r\n const offset = this.getOption('offset')\r\n\r\n // Height dependencies\r\n if (dependencies !== null) {\r\n const elements = document.querySelectorAll(dependencies as string)\r\n if (elements && elements.length > 0) {\r\n for (let i = 0, len = elements.length; i < len; i++) {\r\n const element = elements[i] as HTMLElement\r\n if (isVisibleElement(element) === false) {\r\n continue\r\n }\r\n\r\n height = height - parseInt(getCSS(element, 'height'))\r\n height = height - parseInt(getCSS(element, 'margin-top'))\r\n height = height - parseInt(getCSS(element, 'margin-bottom'))\r\n\r\n const borderTop = getCSS(element, 'border-top')\r\n if (borderTop) {\r\n height = height - parseInt(borderTop)\r\n }\r\n\r\n const borderBottom = getCSS(element, 'border-bottom')\r\n if (borderBottom) {\r\n height = height - parseInt(borderBottom)\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Wrappers\r\n if (wrappers !== null) {\r\n var elements = document.querySelectorAll(wrappers as string)\r\n if (elements && elements.length > 0) {\r\n for (let i = 0, len = elements.length; i < len; i++) {\r\n const element = elements[i] as HTMLElement\r\n\r\n if (!isVisibleElement(element)) {\r\n continue\r\n }\r\n\r\n height = height - parseInt(getCSS(element, 'margin-top'))\r\n height = height - parseInt(getCSS(element, 'margin-bottom'))\r\n height = height - parseInt(getCSS(element, 'padding-top'))\r\n height = height - parseInt(getCSS(element, 'padding-bottom'))\r\n\r\n const borderTop = getCSS(element, 'border-top')\r\n if (borderTop) {\r\n height = height - parseInt(borderTop)\r\n }\r\n\r\n const borderBottom = getCSS(element, 'border-bottom')\r\n if (borderBottom) {\r\n height = height - parseInt(borderBottom)\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Custom offset\r\n if (offset !== null) {\r\n height = height - parseInt(offset as string)\r\n }\r\n\r\n height = height - parseInt(getCSS(this.element, 'margin-top'))\r\n height = height - parseInt(getCSS(this.element, 'margin-bottom'))\r\n\r\n const borderTop = getCSS(this.element, 'border-top')\r\n if (borderTop) {\r\n height = height - parseInt(borderTop)\r\n }\r\n\r\n const borderBottom = getCSS(this.element, 'border-bottom')\r\n if (borderBottom) {\r\n height = height - parseInt(borderBottom)\r\n }\r\n\r\n height = String(height) + 'px'\r\n\r\n return height\r\n }\r\n\r\n private setupHeight = () => {\r\n let height = this.getHeight()\r\n let heightType = this.getHeightType() as string\r\n\r\n // Set height\r\n if (height !== null && height.length > 0) {\r\n ElementStyleUtil.set(this.element, heightType, height)\r\n } else {\r\n ElementStyleUtil.set(this.element, heightType, '')\r\n }\r\n }\r\n\r\n private setupState = () => {\r\n if (this.getOption('save-state') === true && this.id) {\r\n const cookie = CookieComponent.get(this.id + 'st')\r\n if (cookie) {\r\n var pos = parseInt(cookie)\r\n\r\n if (pos > 0) {\r\n this.element.scrollTop = pos\r\n }\r\n }\r\n }\r\n }\r\n\r\n private setupScrollHandler = () => {\r\n if (this.getOption('save-state') === true && this.id) {\r\n this.element.addEventListener('scroll', this.scrollHandler)\r\n } else {\r\n this.element.removeEventListener('scroll', this.scrollHandler)\r\n }\r\n }\r\n\r\n private scrollHandler = () => {\r\n const cookieId = this.id + 'st'\r\n CookieComponent.set(cookieId, this.element.scrollTop, {})\r\n }\r\n\r\n private destroyScrollHandler = () => {\r\n this.element.removeEventListener('scroll', this.scrollHandler)\r\n }\r\n\r\n private resetHeight = () => {\r\n const heghtType = this.getHeightType()\r\n if (heghtType) {\r\n ElementStyleUtil.set(this.element, heghtType, '')\r\n }\r\n }\r\n\r\n ///////////////////////\r\n // ** Public API ** //\r\n ///////////////////////\r\n public update = () => {\r\n // Activate/deactivate\r\n if (\r\n this.getOption('activate') === true ||\r\n !this.element.hasAttribute('data-kt-scroll-activate')\r\n ) {\r\n this.setupHeight()\r\n this.setupScrollHandler()\r\n this.setupState()\r\n } else {\r\n this.resetHeight()\r\n this.destroyScrollHandler()\r\n }\r\n }\r\n\r\n public getHeight = () => {\r\n const heightType = this.getHeightType()\r\n const height = this.getOption(heightType || '')\r\n if (height instanceof Function) {\r\n return height.call(height)\r\n } else if (height !== null && typeof height === 'string' && height.toLowerCase() === 'auto') {\r\n return this.getAutoHeight()\r\n } else {\r\n return height\r\n }\r\n }\r\n\r\n public getElement = () => {\r\n return this.element\r\n }\r\n\r\n // Static methods\r\n public static hasInstace(element: HTMLElement) {\r\n return DataUtil.has(element, 'scroll')\r\n }\r\n\r\n public static getInstance(element: HTMLElement) {\r\n if (element !== null && ScrollComponent.hasInstace(element)) {\r\n return DataUtil.get(element, 'scroll')\r\n }\r\n }\r\n\r\n // Create Instances\r\n public static createInstances(selector: string) {\r\n const elements = document.body.querySelectorAll(selector)\r\n elements.forEach((element: Element) => {\r\n const item = element as HTMLElement\r\n let scroll = ScrollComponent.getInstance(item)\r\n if (!scroll) {\r\n scroll = new ScrollComponent(item, defaultScrollOptions)\r\n }\r\n })\r\n }\r\n\r\n public static destroyAll(attr: string = '[data-kt-scroll=\"true\"]') {}\r\n\r\n public static bootstrap(attr: string = '[data-kt-scroll=\"true\"]') {\r\n ScrollComponent.createInstances(attr)\r\n ScrollComponent.resize()\r\n }\r\n\r\n public static createInstance = (\r\n element: HTMLElement,\r\n options: ScrollOptions = defaultScrollOptions\r\n ): ScrollComponent | undefined => {\r\n let scroll = ScrollComponent.getInstance(element)\r\n if (!scroll) {\r\n scroll = new ScrollComponent(element, options)\r\n }\r\n return scroll\r\n }\r\n\r\n public static reinitialization(attr: string = '[data-kt-scroll=\"true\"]') {\r\n ScrollComponent.createInstances(attr)\r\n }\r\n\r\n public static updateAll() {\r\n const elements = document.body.querySelectorAll('[data-kt-scroll=\"true\"]')\r\n elements.forEach((element: Element) => {\r\n const instance = ScrollComponent.getInstance(element as HTMLElement)\r\n if (instance) {\r\n instance.update()\r\n }\r\n })\r\n }\r\n\r\n public static resize() {\r\n // Window Resize Handling\r\n window.addEventListener('resize', function () {\r\n let timer\r\n throttle(\r\n timer,\r\n () => {\r\n // Locate and update Drawer instances on window resize\r\n ScrollComponent.updateAll()\r\n },\r\n 200\r\n )\r\n })\r\n }\r\n}\r\n\r\nexport {ScrollComponent, defaultScrollOptions}\r\n","import {\r\n getScrollTop,\r\n getAttributeValueByBreakpoint,\r\n throttle,\r\n getObjectPropertyValueByKey,\r\n stringSnakeToCamel,\r\n getUniqueIdWithPrefix,\r\n DataUtil,\r\n ElementAnimateUtil,\r\n} from '../_utils/index'\r\n\r\nexport interface IScrollTopOptions {\r\n offset: number\r\n speed: number\r\n}\r\n\r\nconst defaultScrollTopOptions: IScrollTopOptions = {\r\n offset: 200,\r\n speed: 600,\r\n}\r\n\r\nclass ScrollTopComponent {\r\n element: HTMLElement\r\n options: IScrollTopOptions\r\n instanceUid: string\r\n\r\n constructor(_element: HTMLElement, options: IScrollTopOptions) {\r\n this.element = _element\r\n this.options = Object.assign(defaultScrollTopOptions, options)\r\n this.instanceUid = getUniqueIdWithPrefix('scrolltop')\r\n\r\n // Event Handlers\r\n this._handlers()\r\n\r\n // Bind Instance\r\n DataUtil.set(this.element, 'scrolltop', this)\r\n }\r\n\r\n private _handlers = () => {\r\n let timer: number\r\n window.addEventListener('scroll', () => {\r\n throttle(timer, () => {\r\n this._scroll()\r\n })\r\n })\r\n\r\n this.element.addEventListener('click', (e: Event) => {\r\n e.preventDefault()\r\n this._go()\r\n })\r\n }\r\n\r\n private _scroll = () => {\r\n const offset = parseInt(this._getOption('offset') as string)\r\n const pos = getScrollTop() // current vertical position\r\n if (pos > offset) {\r\n if (!document.body.hasAttribute('data-kt-scrolltop')) {\r\n document.body.setAttribute('data-kt-scrolltop', 'on')\r\n }\r\n } else {\r\n if (document.body.hasAttribute('data-kt-scrolltop')) {\r\n document.body.removeAttribute('data-kt-scrolltop')\r\n }\r\n }\r\n }\r\n\r\n private _go = () => {\r\n const speed = parseInt(this._getOption('speed') as string)\r\n ElementAnimateUtil.scrollTop(0, speed)\r\n }\r\n\r\n private _getOption = (name: string) => {\r\n const attr = this.element.getAttribute(`data-kt-scrolltop-${name}`)\r\n if (attr) {\r\n const value = getAttributeValueByBreakpoint(attr)\r\n return value !== null && String(value) === 'true'\r\n }\r\n\r\n const optionName = stringSnakeToCamel(name)\r\n const option = getObjectPropertyValueByKey(this.options, optionName)\r\n if (option) {\r\n return getAttributeValueByBreakpoint(option)\r\n }\r\n\r\n return null\r\n }\r\n\r\n ///////////////////////\r\n // ** Public API ** //\r\n ///////////////////////\r\n\r\n // Plugin API\r\n public go = () => {\r\n return this._go()\r\n }\r\n\r\n public getElement = () => {\r\n return this.element\r\n }\r\n\r\n // Static methods\r\n public static getInstance = (el: HTMLElement) => {\r\n const scrollTop = DataUtil.get(el, 'scrolltop')\r\n if (scrollTop) {\r\n return scrollTop\r\n }\r\n\r\n return null\r\n }\r\n\r\n public static createInstances = (selector: string) => {\r\n const elements = document.body.querySelectorAll(selector)\r\n elements.forEach((el) => {\r\n const item = el as HTMLElement\r\n let scrollTop = ScrollTopComponent.getInstance(item)\r\n if (!scrollTop) {\r\n scrollTop = new ScrollTopComponent(item, defaultScrollTopOptions)\r\n }\r\n })\r\n }\r\n\r\n public static createInsance = (\r\n selector: string,\r\n options: IScrollTopOptions = defaultScrollTopOptions\r\n ): ScrollTopComponent | undefined => {\r\n const element = document.body.querySelector(selector)\r\n if (!element) {\r\n return\r\n }\r\n const item = element as HTMLElement\r\n let scrollTop = ScrollTopComponent.getInstance(item)\r\n if (!scrollTop) {\r\n scrollTop = new ScrollTopComponent(item, options)\r\n }\r\n return scrollTop\r\n }\r\n\r\n public static bootstrap = () => {\r\n ScrollTopComponent.createInstances('[data-kt-scrolltop=\"true\"]')\r\n }\r\n\r\n public static reinitialization = () => {\r\n ScrollTopComponent.createInstances('[data-kt-scrolltop=\"true\"]')\r\n }\r\n\r\n public static goTop = () => {\r\n ElementAnimateUtil.scrollTop(0, defaultScrollTopOptions.speed)\r\n }\r\n}\r\nexport {ScrollTopComponent, defaultScrollTopOptions}\r\n","import {\r\n getElementIndex,\r\n getUniqueIdWithPrefix,\r\n ElementAnimateUtil,\r\n EventHandlerUtil,\r\n DataUtil,\r\n DOMEventHandlerUtil,\r\n ElementStyleUtil,\r\n} from '../_utils/index'\r\n\r\nexport interface IStepperOptions {\r\n startIndex: number\r\n animation: boolean\r\n animationSpeed: string\r\n animationNextClass: string\r\n animationPreviousClass: string\r\n}\r\n\r\nconst defaultStepperOptions: IStepperOptions = {\r\n startIndex: 1,\r\n animation: false,\r\n animationSpeed: '0.3s',\r\n animationNextClass: 'animate__animated animate__slideInRight animate__fast',\r\n animationPreviousClass: 'animate__animated animate__slideInLeft animate__fast',\r\n}\r\n\r\nclass StepperComponent {\r\n element: HTMLElement\r\n options: IStepperOptions\r\n instanceUid: string\r\n steps: NodeListOf\r\n btnNext: HTMLElement | null\r\n btnPrev: HTMLElement | null\r\n btnSubmit: HTMLElement | null\r\n totatStepsNumber: number = 0\r\n passedStepIndex: number = 0\r\n currentStepIndex: number = 1\r\n\r\n constructor(_element: HTMLElement, options: IStepperOptions) {\r\n this.element = _element\r\n this.options = Object.assign(defaultStepperOptions, options)\r\n this.instanceUid = getUniqueIdWithPrefix('stepper')\r\n\r\n // Elements\r\n this.steps = this.element.querySelectorAll('[data-kt-stepper-element=\"nav\"]')\r\n this.btnNext = this.element.querySelector('[data-kt-stepper-action=\"next\"]')\r\n this.btnPrev = this.element.querySelector('[data-kt-stepper-action=\"previous\"]')\r\n this.btnSubmit = this.element.querySelector('[data-kt-stepper-action=\"submit\"]')\r\n\r\n // Variables\r\n this.totatStepsNumber = this.steps?.length | 0\r\n this.passedStepIndex = 0\r\n this.currentStepIndex = 1\r\n\r\n // Set Current Step\r\n if (this.options.startIndex > 1) {\r\n this._goTo(this.options.startIndex)\r\n }\r\n\r\n // Event Handlers\r\n this.initHandlers()\r\n\r\n // Bind Instance\r\n DataUtil.set(this.element, 'stepper', this)\r\n }\r\n\r\n private _goTo = (index: number) => {\r\n EventHandlerUtil.trigger(this.element, 'kt.stepper.change')\r\n // Skip if this step is already shown\r\n if (index === this.currentStepIndex || index > this.totatStepsNumber || index < 0) {\r\n return\r\n }\r\n\r\n // Validate step number\r\n index = parseInt(index.toString())\r\n // Set current step\r\n this.passedStepIndex = this.currentStepIndex\r\n this.currentStepIndex = index\r\n\r\n // Refresh elements\r\n this.refreshUI()\r\n\r\n EventHandlerUtil.trigger(this.element, 'kt.stepper.changed')\r\n }\r\n\r\n private initHandlers = () => {\r\n this.btnNext?.addEventListener('click', (e: Event) => {\r\n e.preventDefault()\r\n\r\n EventHandlerUtil.trigger(this.element, 'kt.stepper.next', e)\r\n })\r\n\r\n this.btnPrev?.addEventListener('click', (e: Event) => {\r\n e.preventDefault()\r\n\r\n EventHandlerUtil.trigger(this.element, 'kt.stepper.previous', e)\r\n })\r\n\r\n DOMEventHandlerUtil.on(this.element, '[data-kt-stepper-action=\"step\"]', 'click', (e: Event) => {\r\n e.preventDefault()\r\n\r\n if (this.steps && this.steps.length > 0) {\r\n for (let i = 0; i < this.steps.length; i++) {\r\n if ((this.steps[i] as HTMLElement) === this.element) {\r\n let index = i + 1\r\n\r\n const stepDirection = this._getStepDirection(index)\r\n EventHandlerUtil.trigger(this.element, `stepper.${stepDirection}`, e)\r\n return\r\n }\r\n }\r\n }\r\n })\r\n }\r\n\r\n private _getStepDirection = (index: number) => {\r\n return index > this.currentStepIndex ? 'next' : 'previous'\r\n }\r\n\r\n private getStepContent = (index: number) => {\r\n const content = this.element.querySelectorAll('[data-kt-stepper-element=\"content\"]')\r\n if (!content) {\r\n return false\r\n }\r\n\r\n if (content[index - 1]) {\r\n return content[index - 1]\r\n }\r\n\r\n return false\r\n }\r\n\r\n private getLastStepIndex = () => {\r\n return this.totatStepsNumber\r\n }\r\n\r\n private getTotalStepsNumber = () => {\r\n return this.totatStepsNumber\r\n }\r\n\r\n private refreshUI = () => {\r\n let state = ''\r\n\r\n if (this.isLastStep()) {\r\n state = 'last'\r\n } else if (this.isFirstStep()) {\r\n state = 'first'\r\n } else {\r\n state = 'between'\r\n }\r\n\r\n // Set state class\r\n this.element.classList.remove('last')\r\n this.element.classList.remove('first')\r\n this.element.classList.remove('between')\r\n\r\n this.element.classList.add(state)\r\n\r\n // Step Items\r\n const elements = this.element.querySelectorAll(\r\n '[data-kt-stepper-element=\"nav\"], [data-kt-stepper-element=\"content\"], [data-kt-stepper-element=\"info\"]'\r\n )\r\n\r\n if (!elements || elements.length <= 0) {\r\n return\r\n }\r\n\r\n for (var i = 0, len = elements.length; i < len; i++) {\r\n var element = elements[i] as HTMLElement\r\n var index = getElementIndex(element) + 1\r\n\r\n element.classList.remove('current')\r\n element.classList.remove('completed')\r\n element.classList.remove('pending')\r\n\r\n if (index === this.currentStepIndex) {\r\n element.classList.add('current')\r\n\r\n if (\r\n this.options.animation !== false &&\r\n element.getAttribute('data-kt-stepper-element') === 'content'\r\n ) {\r\n ElementStyleUtil.set(element, 'animationDuration', this.options.animationSpeed)\r\n\r\n const animation =\r\n this._getStepDirection(this.passedStepIndex) === 'previous'\r\n ? this.options.animationPreviousClass\r\n : this.options.animationNextClass\r\n ElementAnimateUtil.animateClass(element, animation)\r\n }\r\n } else {\r\n if (index < this.currentStepIndex) {\r\n element.classList.add('completed')\r\n } else {\r\n element.classList.add('pending')\r\n }\r\n }\r\n }\r\n }\r\n\r\n private isLastStep = () => {\r\n return this.currentStepIndex === this.totatStepsNumber\r\n }\r\n\r\n private isFirstStep = () => {\r\n return this.currentStepIndex === 1\r\n }\r\n\r\n private isBetweenStep = () => {\r\n return this.isLastStep() === false && this.isFirstStep() === false\r\n }\r\n\r\n // ///////////////////////\r\n // // ** Public API ** //\r\n // ///////////////////////\r\n\r\n // // Plugin API\r\n public goto = (index: number) => {\r\n return this._goTo(index)\r\n }\r\n\r\n public goNext = () => {\r\n return this.goto(this.getNextStepIndex())\r\n }\r\n\r\n public goPrev = () => {\r\n return this.goto(this.getPrevStepIndex())\r\n }\r\n\r\n public goFirst = () => {\r\n return this.goto(1)\r\n }\r\n\r\n public goLast = () => {\r\n return this.goto(this.getLastStepIndex())\r\n }\r\n\r\n public getCurrentStepIndex = () => {\r\n return this.currentStepIndex\r\n }\r\n\r\n public getNextStepIndex = () => {\r\n if (this.totatStepsNumber >= this.currentStepIndex + 1) {\r\n return this.currentStepIndex + 1\r\n } else {\r\n return this.totatStepsNumber\r\n }\r\n }\r\n\r\n public getPassedStepIndex = () => {\r\n return this.passedStepIndex\r\n }\r\n\r\n public getPrevStepIndex = () => {\r\n if (this.currentStepIndex - 1 > 1) {\r\n return this.currentStepIndex - 1\r\n } else {\r\n return 1\r\n }\r\n }\r\n\r\n public getElement = (index: number) => {\r\n return this.element\r\n }\r\n\r\n // Event API\r\n public on = (name: string, handler: Function) => {\r\n return EventHandlerUtil.on(this.element, name, handler)\r\n }\r\n\r\n public one = (name: string, handler: Function) => {\r\n return EventHandlerUtil.one(this.element, name, handler)\r\n }\r\n\r\n public off = (name: string) => {\r\n return EventHandlerUtil.off(this.element, name)\r\n }\r\n\r\n public destroy = () => {\r\n console.log('destroy stepper')\r\n }\r\n\r\n public trigger = (name: string, event: Event) => {\r\n return EventHandlerUtil.trigger(this.element, name, event)\r\n }\r\n\r\n // Static methods\r\n public static hasInstace(element: HTMLElement): boolean {\r\n return DataUtil.has(element, 'stepper')\r\n }\r\n\r\n public static getInstance(element: HTMLElement): StepperComponent | null {\r\n if (element !== null && StepperComponent.hasInstace(element)) {\r\n return DataUtil.get(element, 'stepper')\r\n }\r\n return null\r\n }\r\n\r\n // Create Instances\r\n public static createInstances(selector: string): void {\r\n const elements = document.body.querySelectorAll(selector)\r\n elements.forEach((element) => {\r\n const item = element as HTMLElement\r\n let stepper = StepperComponent.getInstance(item)\r\n if (!stepper) {\r\n stepper = new StepperComponent(item, defaultStepperOptions)\r\n }\r\n })\r\n }\r\n\r\n public static createInsance = (\r\n element: HTMLElement,\r\n options: IStepperOptions = defaultStepperOptions\r\n ): StepperComponent | null => {\r\n if (!element) {\r\n return null\r\n }\r\n let stepper = StepperComponent.getInstance(element)\r\n if (!stepper) {\r\n stepper = new StepperComponent(element, options)\r\n }\r\n return stepper\r\n }\r\n\r\n public static bootstrap(attr: string = '[data-kt-stepper]') {\r\n StepperComponent.createInstances(attr)\r\n }\r\n}\r\n\r\nexport {StepperComponent, defaultStepperOptions}\r\n","import {\r\n getElementOffset,\r\n getScrollTop,\r\n getAttributeValueByBreakpoint,\r\n getUniqueIdWithPrefix,\r\n getObjectPropertyValueByKey,\r\n stringSnakeToCamel,\r\n getCSS,\r\n DataUtil,\r\n ElementAnimateUtil,\r\n ElementStyleUtil,\r\n EventHandlerUtil,\r\n} from '../_utils/index'\r\n\r\nexport interface StickyOptions {\r\n offset: number\r\n reverse: boolean\r\n animation: boolean\r\n animationSpeed: string\r\n animationClass: string\r\n}\r\n\r\nconst defaultStickyOptions: StickyOptions = {\r\n offset: 200,\r\n reverse: false,\r\n animation: true,\r\n animationSpeed: '0.3s',\r\n animationClass: 'animation-slide-in-down',\r\n}\r\n\r\nclass StickyComponent {\r\n element: HTMLElement\r\n options: StickyOptions\r\n instanceUid: string\r\n instanceName: string | null = ''\r\n attributeName: string\r\n eventTriggerState: boolean\r\n lastScrollTop: number\r\n\r\n constructor(_element: HTMLElement, options: StickyOptions) {\r\n this.element = _element\r\n this.options = Object.assign(defaultStickyOptions, options)\r\n this.instanceUid = getUniqueIdWithPrefix('sticky')\r\n this.instanceName = this.element.getAttribute('data-kt-sticky-name')\r\n this.attributeName = 'data-kt-sticky-' + this.instanceName\r\n this.eventTriggerState = true\r\n this.lastScrollTop = 0\r\n\r\n // Event Handlers\r\n window.addEventListener('scroll', this.scroll)\r\n\r\n // Initial Launch\r\n this.scroll()\r\n\r\n DataUtil.set(this.element, 'sticky', this)\r\n }\r\n\r\n private scroll = () => {\r\n let offset = this.getOption('offset')\r\n let reverse = this.getOption('reverse')\r\n\r\n // Exit if false\r\n if (offset === false) {\r\n return\r\n }\r\n\r\n let offsetNum = 0\r\n if (typeof offset === 'string') {\r\n offsetNum = parseInt(offset)\r\n }\r\n\r\n const st = getScrollTop()\r\n\r\n // Reverse scroll mode\r\n if (reverse === true) {\r\n // Release on reverse scroll mode\r\n if (st > offsetNum && this.lastScrollTop < st) {\r\n if (document.body.hasAttribute(this.attributeName) === false) {\r\n this.enable()\r\n document.body.setAttribute(this.attributeName, 'on')\r\n }\r\n\r\n if (this.eventTriggerState === true) {\r\n EventHandlerUtil.trigger(this.element, 'kt.sticky.on')\r\n EventHandlerUtil.trigger(this.element, 'kt.sticky.change')\r\n\r\n this.eventTriggerState = false\r\n }\r\n } else {\r\n // Back scroll mode\r\n if (document.body.hasAttribute(this.attributeName)) {\r\n this.disable()\r\n document.body.removeAttribute(this.attributeName)\r\n }\r\n\r\n if (this.eventTriggerState === false) {\r\n EventHandlerUtil.trigger(this.element, 'kt.sticky.off')\r\n EventHandlerUtil.trigger(this.element, 'kt.sticky.change')\r\n\r\n this.eventTriggerState = true\r\n }\r\n }\r\n\r\n this.lastScrollTop = st\r\n return\r\n }\r\n\r\n // Classic scroll mode\r\n if (st > offsetNum) {\r\n if (document.body.hasAttribute(this.attributeName) === false) {\r\n this.enable()\r\n document.body.setAttribute(this.attributeName, 'on')\r\n }\r\n\r\n if (this.eventTriggerState === true) {\r\n EventHandlerUtil.trigger(this.element, 'kt.sticky.on')\r\n EventHandlerUtil.trigger(this.element, 'kt.sticky.change')\r\n this.eventTriggerState = false\r\n }\r\n } else {\r\n // back scroll mode\r\n if (document.body.hasAttribute(this.attributeName) === true) {\r\n this.disable()\r\n document.body.removeAttribute(this.attributeName)\r\n }\r\n\r\n if (this.eventTriggerState === false) {\r\n EventHandlerUtil.trigger(this.element, 'kt.sticky.off')\r\n EventHandlerUtil.trigger(this.element, 'kt.sticky.change')\r\n this.eventTriggerState = true\r\n }\r\n }\r\n }\r\n\r\n private getOption = (name: string) => {\r\n const dataStickyAttr = 'data-kt-sticky-' + name\r\n if (this.element.hasAttribute(dataStickyAttr) === true) {\r\n const attrValueInStr = this.element.getAttribute(dataStickyAttr)\r\n const attrValue = getAttributeValueByBreakpoint(attrValueInStr || '')\r\n if (attrValue !== null && String(attrValue) === 'true') {\r\n return true\r\n } else if (attrValue !== null && String(attrValue) === 'false') {\r\n return false\r\n }\r\n\r\n return attrValue\r\n } else {\r\n const optionName = stringSnakeToCamel(name)\r\n const option = getObjectPropertyValueByKey(this.options, optionName)\r\n if (option) {\r\n return getAttributeValueByBreakpoint(option)\r\n }\r\n }\r\n }\r\n\r\n private disable = () => {\r\n ElementStyleUtil.remove(this.element, 'top')\r\n ElementStyleUtil.remove(this.element, 'width')\r\n ElementStyleUtil.remove(this.element, 'left')\r\n ElementStyleUtil.remove(this.element, 'right')\r\n ElementStyleUtil.remove(this.element, 'z-index')\r\n ElementStyleUtil.remove(this.element, 'position')\r\n }\r\n\r\n private enable = (update: boolean = false) => {\r\n const top = this.getOption('top')\r\n const left = this.getOption('left')\r\n // const right = this.getOption(\"right\");\r\n let width = this.getOption('width')\r\n const zindex = this.getOption('zindex')\r\n\r\n if (update !== true && this.getOption('animation') === true) {\r\n ElementStyleUtil.set(this.element, 'animationDuration', this.getOption('animationSpeed'))\r\n ElementAnimateUtil.animateClass(this.element, 'animation ' + this.getOption('animationClass'))\r\n }\r\n\r\n if (zindex !== null) {\r\n ElementStyleUtil.set(this.element, 'z-index', zindex)\r\n ElementStyleUtil.set(this.element, 'position', 'fixed')\r\n }\r\n\r\n if (top !== null) {\r\n ElementStyleUtil.set(this.element, 'top', top)\r\n }\r\n\r\n if (width !== null && width !== undefined) {\r\n const widthTarget = getObjectPropertyValueByKey(width, 'target')\r\n if (widthTarget) {\r\n const targetElement = document.querySelector(widthTarget)\r\n if (targetElement) {\r\n width = getCSS(targetElement, 'width')\r\n }\r\n }\r\n ElementStyleUtil.set(this.element, 'width', width)\r\n }\r\n\r\n if (left !== null) {\r\n if (String(left).toLowerCase() === 'auto') {\r\n var offsetLeft = getElementOffset(this.element).left\r\n\r\n if (offsetLeft > 0) {\r\n ElementStyleUtil.set(this.element, 'left', String(offsetLeft) + 'px')\r\n }\r\n }\r\n }\r\n }\r\n\r\n public update = () => {\r\n if (document.body.hasAttribute(this.attributeName) === true) {\r\n this.disable()\r\n document.body.removeAttribute(this.attributeName)\r\n this.enable(true)\r\n document.body.setAttribute(this.attributeName, 'on')\r\n }\r\n }\r\n\r\n // Event API\r\n public on = (name: string, callBack: Function) => {\r\n return EventHandlerUtil.on(this.element, name, callBack)\r\n }\r\n\r\n public one = (name: string, callback: Function) => {\r\n return EventHandlerUtil.one(this.element, name, callback)\r\n }\r\n\r\n public off = (name: string) => {\r\n return EventHandlerUtil.off(this.element, name)\r\n }\r\n\r\n public trigger = (name: string) => {\r\n return EventHandlerUtil.trigger(this.element, name)\r\n }\r\n\r\n // Static methods\r\n public static hasInstace(element: HTMLElement) {\r\n return DataUtil.has(element, 'sticky')\r\n }\r\n\r\n public static getInstance(element: HTMLElement) {\r\n if (element !== null && StickyComponent.hasInstace(element)) {\r\n return DataUtil.get(element, 'sticky')\r\n }\r\n }\r\n\r\n // Create Instances\r\n public static createInstances(selector: string) {\r\n const elements = document.body.querySelectorAll(selector)\r\n elements.forEach((element) => {\r\n const item = element as HTMLElement\r\n let sticky = StickyComponent.getInstance(item)\r\n if (!sticky) {\r\n sticky = new StickyComponent(item, defaultStickyOptions)\r\n }\r\n })\r\n }\r\n\r\n public static createInsance = (\r\n selector: string,\r\n options: StickyOptions = defaultStickyOptions\r\n ): StickyComponent | undefined => {\r\n const element = document.body.querySelector(selector)\r\n if (!element) {\r\n return\r\n }\r\n const item = element as HTMLElement\r\n let sticky = StickyComponent.getInstance(item)\r\n if (!sticky) {\r\n sticky = new StickyComponent(item, options)\r\n }\r\n return sticky\r\n }\r\n\r\n public static bootstrap(attr: string = '[data-kt-sticky=\"true\"]') {\r\n StickyComponent.createInstances(attr)\r\n }\r\n\r\n public static reInitialization(attr: string = '[data-kt-sticky=\"true\"]') {\r\n StickyComponent.createInstances(attr)\r\n }\r\n}\r\n\r\nexport {StickyComponent, defaultStickyOptions}\r\n","import {DataUtil, getUniqueIdWithPrefix, EventHandlerUtil} from '../_utils/index'\r\n// Helpers\r\nimport {CookieComponent} from './_CookieComponent'\r\n\r\nexport interface ToggleOptions {\r\n saveState: boolean\r\n targetState?: string\r\n toggleState?: string\r\n targetToggleMode?: string\r\n}\r\n\r\nconst defaultToggleOptions: ToggleOptions = {\r\n saveState: false,\r\n}\r\n\r\nclass ToggleComponent {\r\n element: HTMLElement\r\n instanceUid: string\r\n options: ToggleOptions\r\n state: string = ''\r\n target: HTMLElement | null = null\r\n attribute: string = ''\r\n\r\n constructor(_element: HTMLElement, options: ToggleOptions) {\r\n this.options = Object.assign(defaultToggleOptions, options)\r\n this.instanceUid = getUniqueIdWithPrefix('toggle')\r\n this.element = _element\r\n\r\n const elementTargetAttr = this.element.getAttribute('data-kt-toggle-target')\r\n if (elementTargetAttr) {\r\n this.target = document.querySelector(elementTargetAttr)\r\n }\r\n const elementToggleAttr = this.element.getAttribute('data-kt-toggle-state')\r\n this.state = elementToggleAttr || ''\r\n this.attribute = 'data-kt-' + this.element.getAttribute('data-kt-toggle-name')\r\n\r\n // Event Handlers\r\n this._handlers()\r\n\r\n // Update Instance\r\n // Bind Instance\r\n DataUtil.set(this.element, 'toggle', this)\r\n }\r\n\r\n private _handlers = () => {\r\n this.element.addEventListener('click', (e: Event) => {\r\n e.preventDefault()\r\n this._toggle()\r\n })\r\n }\r\n\r\n // Event handlers\r\n private _toggle = () => {\r\n // Trigger \"after.toggle\" event\r\n EventHandlerUtil.trigger(this.element, 'kt.toggle.change')\r\n\r\n if (this._isEnabled()) {\r\n this._disable()\r\n } else {\r\n this._enable()\r\n }\r\n\r\n // Trigger \"before.toggle\" event\r\n EventHandlerUtil.trigger(this.element, 'kt.toggle.changed')\r\n return this\r\n }\r\n\r\n private _enable = () => {\r\n if (this._isEnabled()) {\r\n return\r\n }\r\n\r\n EventHandlerUtil.trigger(this.element, 'kt.toggle.enable')\r\n this.target?.setAttribute(this.attribute, 'on')\r\n if (this.state.length > 0) {\r\n this.element.classList.add(this.state)\r\n }\r\n\r\n if (this.options.saveState) {\r\n CookieComponent.set(this.attribute, 'on', {})\r\n }\r\n\r\n EventHandlerUtil.trigger(this.element, 'kt.toggle.enabled')\r\n return this\r\n }\r\n\r\n private _disable = () => {\r\n if (!this._isEnabled()) {\r\n return false\r\n }\r\n\r\n EventHandlerUtil.trigger(this.element, 'kt.toggle.disable')\r\n this.target?.removeAttribute(this.attribute)\r\n\r\n if (this.state.length > 0) {\r\n this.element.classList.remove(this.state)\r\n }\r\n\r\n if (this.options.saveState) {\r\n CookieComponent.delete(this.attribute)\r\n }\r\n\r\n EventHandlerUtil.trigger(this.element, 'kt.toggle.disabled')\r\n return this\r\n }\r\n\r\n private _isEnabled = () => {\r\n if (!this.target) {\r\n return false\r\n }\r\n\r\n return String(this.target.getAttribute(this.attribute)).toLowerCase() === 'on'\r\n }\r\n\r\n ///////////////////////\r\n // ** Public API ** //\r\n ///////////////////////\r\n\r\n // Plugin API\r\n // Plugin API\r\n public toggle = () => {\r\n return this._toggle()\r\n }\r\n\r\n public enable = () => {\r\n return this._enable()\r\n }\r\n\r\n public disable = () => {\r\n return this._disable()\r\n }\r\n\r\n public isEnabled = () => {\r\n return this._isEnabled()\r\n }\r\n\r\n public goElement = () => {\r\n return this.element\r\n }\r\n\r\n // Event API\r\n public on = (name: string, handler: Function) => {\r\n return EventHandlerUtil.on(this.element, name, handler)\r\n }\r\n\r\n public one = (name: string, handler: Function) => {\r\n return EventHandlerUtil.one(this.element, name, handler)\r\n }\r\n\r\n public off = (name: string) => {\r\n return EventHandlerUtil.off(this.element, name)\r\n }\r\n\r\n public trigger = (name: string, event?: Event) => {\r\n return EventHandlerUtil.trigger(this.element, name, event)\r\n }\r\n\r\n // Static methods\r\n public static getInstance = (el: HTMLElement) => {\r\n const toggleElement = DataUtil.get(el, 'toggle')\r\n if (toggleElement) {\r\n return toggleElement\r\n }\r\n\r\n return null\r\n }\r\n\r\n public static createInstances = (selector: string) => {\r\n const elements = document.body.querySelectorAll(selector)\r\n elements.forEach((el) => {\r\n const item = el as HTMLElement\r\n let toggleElement = ToggleComponent.getInstance(item)\r\n if (!toggleElement) {\r\n toggleElement = new ToggleComponent(item, defaultToggleOptions)\r\n }\r\n })\r\n }\r\n\r\n public static createInsance = (\r\n selector: string,\r\n options: ToggleOptions = defaultToggleOptions\r\n ): ToggleComponent | undefined => {\r\n const element = document.body.querySelector(selector)\r\n if (!element) {\r\n return\r\n }\r\n const item = element as HTMLElement\r\n let toggle = ToggleComponent.getInstance(item)\r\n if (!toggle) {\r\n toggle = new ToggleComponent(item, options)\r\n }\r\n return toggle\r\n }\r\n\r\n public static reinitialization = () => {\r\n ToggleComponent.createInstances('[data-kt-toggle]')\r\n }\r\n\r\n public static bootstrap = () => {\r\n ToggleComponent.createInstances('[data-kt-toggle]')\r\n }\r\n}\r\n\r\nexport {ToggleComponent, defaultToggleOptions}\r\n","/* eslint-disable array-callback-return */\r\n/* eslint-disable no-useless-escape */\r\nimport {DataUtil} from '../_utils/index'\r\n\r\nexport interface IPasswordMeterOptions {\r\n minLength: number\r\n checkUppercase: boolean\r\n checkLowercase: boolean\r\n checkDigit: boolean\r\n checkChar: boolean\r\n scoreHighlightClass: string\r\n}\r\n\r\nexport interface IPasswordMeterQueries {\r\n componentName: string\r\n instanseQuery: string\r\n inputQuery: string\r\n visibilityQuery: string\r\n highlightQuery: string\r\n}\r\n\r\nconst defaultPasswordMeterOptions = {\r\n minLength: 8,\r\n checkUppercase: true,\r\n checkLowercase: true,\r\n checkDigit: true,\r\n checkChar: true,\r\n scoreHighlightClass: 'active',\r\n}\r\n\r\nconst defaultPasswordMeterQueires: IPasswordMeterQueries = {\r\n componentName: 'password-meter',\r\n instanseQuery: '[data-kt-password-meter]',\r\n inputQuery: 'input[type]',\r\n visibilityQuery: '[data-kt-password-meter-control=\"visibility\"]',\r\n highlightQuery: '[data-kt-password-meter-control=\"highlight\"]',\r\n}\r\n\r\nclass PasswordMeterComponent {\r\n element: HTMLElement\r\n inputElement: HTMLInputElement | null\r\n visibilityElement: HTMLElement | null\r\n highlightElement: HTMLElement | null\r\n options: IPasswordMeterOptions\r\n queries: IPasswordMeterQueries\r\n score: number\r\n checkSteps: number\r\n\r\n constructor(\r\n _element: HTMLElement,\r\n _options: IPasswordMeterOptions,\r\n _queries: IPasswordMeterQueries\r\n ) {\r\n this.element = _element\r\n this.options = Object.assign(defaultPasswordMeterOptions, _options)\r\n this.queries = _queries\r\n this.score = 0\r\n this.checkSteps = 5\r\n\r\n // Elements\r\n this.inputElement = this.element.querySelector(this.queries.inputQuery)\r\n this.visibilityElement = this.element.querySelector(this.queries.visibilityQuery)\r\n this.highlightElement = this.element.querySelector(this.queries.highlightQuery)\r\n\r\n // Event Handlers\r\n this.handlers()\r\n\r\n DataUtil.set(this.element, this.queries.componentName, this)\r\n }\r\n\r\n private handlers(): void {\r\n if (this.inputElement) {\r\n this.inputElement.addEventListener('input', () => {\r\n this.check()\r\n })\r\n }\r\n\r\n if (this.visibilityElement) {\r\n this.visibilityElement.addEventListener('click', () => {\r\n this.visitbility()\r\n })\r\n }\r\n }\r\n\r\n private visitbility() {\r\n if (this.visibilityElement && this.inputElement) {\r\n const visibleIcon = this.visibilityElement.querySelector(\r\n 'i:not(.d-none), .svg-icon:not(.d-none)'\r\n )\r\n\r\n const hiddenIcon = this.visibilityElement.querySelector('i.d-none, .svg-icon.d-none')\r\n\r\n const typeAttr = this.inputElement.getAttribute('type') || ''\r\n\r\n if (typeAttr === 'password') {\r\n this.inputElement.setAttribute('type', 'text')\r\n } else {\r\n this.inputElement.setAttribute('type', 'password')\r\n }\r\n\r\n visibleIcon?.classList.add('d-none')\r\n hiddenIcon?.classList.remove('d-none')\r\n\r\n this.inputElement.focus()\r\n }\r\n }\r\n\r\n private checkScore(): number {\r\n return 0\r\n }\r\n\r\n private checkLength(): boolean {\r\n if (this.inputElement) {\r\n return this.inputElement.value.length >= this.options.minLength // 20 score\r\n }\r\n\r\n return false\r\n }\r\n\r\n private checkLowerCase(): boolean {\r\n const val = this.inputElement ? this.inputElement.value : ''\r\n return /[a-z]/.test(val) // 20 score\r\n }\r\n\r\n private checkUppercase(): boolean {\r\n const val = this.inputElement ? this.inputElement.value : ''\r\n return /[A-Z]/.test(val) // 20 score\r\n }\r\n\r\n private checkDigit(): boolean {\r\n const val = this.inputElement ? this.inputElement.value : ''\r\n return /[0-9]/.test(val) // 20 score\r\n }\r\n\r\n private checkChar(): boolean {\r\n const val = this.inputElement ? this.inputElement.value : ''\r\n return /[~`!#$%\\^&*+=\\-\\[\\]\\\\';,/{}|\\\\\":<>\\?]/g.test(val) // 20 score\r\n }\r\n\r\n private getCheckScore(): number {\r\n let count = 1\r\n if (this.options.checkUppercase) {\r\n count++\r\n }\r\n\r\n if (this.options.checkLowercase) {\r\n count++\r\n }\r\n\r\n if (this.options.checkDigit) {\r\n count++\r\n }\r\n\r\n if (this.options.checkChar) {\r\n count++\r\n }\r\n\r\n this.checkSteps = count\r\n return 100 / this.checkSteps\r\n }\r\n\r\n private highlight() {\r\n const items = this.highlightElement\r\n ? [].slice.call(this.highlightElement.querySelectorAll('div'))\r\n : []\r\n const total = items.length\r\n let index = 0\r\n const checkScore = this.getCheckScore()\r\n const score = this.getScore()\r\n\r\n items.map((item: HTMLElement) => {\r\n index++\r\n if (checkScore * index * (this.checkSteps / total) <= score) {\r\n item.classList.add('active')\r\n } else {\r\n item.classList.remove('active')\r\n }\r\n })\r\n }\r\n\r\n ///////////////////////\r\n // ** Public API ** //\r\n ///////////////////////\r\n public reset = () => {\r\n this.score = 0\r\n this.highlight()\r\n }\r\n\r\n public getScore() {\r\n return this.score\r\n }\r\n\r\n public check() {\r\n let score = 0\r\n const checkScore = this.checkScore()\r\n if (this.checkLength()) {\r\n score = score + checkScore\r\n }\r\n\r\n if (this.options.checkUppercase && this.checkLowerCase()) {\r\n score = score + checkScore\r\n }\r\n\r\n if (this.options.checkLowercase && this.checkUppercase()) {\r\n score = score + checkScore\r\n }\r\n\r\n if (this.options.checkDigit && this.checkDigit()) {\r\n score = score + checkScore\r\n }\r\n\r\n if (this.options.checkChar && this.checkChar()) {\r\n score = score + checkScore\r\n }\r\n\r\n this.score = score\r\n this.highlight()\r\n }\r\n\r\n // Static methods\r\n public static getInstance = (\r\n el: HTMLElement,\r\n componentName: string = defaultPasswordMeterQueires.componentName\r\n ) => {\r\n const passwordMeter = DataUtil.get(el, componentName)\r\n if (passwordMeter) {\r\n return passwordMeter\r\n }\r\n\r\n return null\r\n }\r\n\r\n public static createInstances = (\r\n selector: string = defaultPasswordMeterQueires.instanseQuery,\r\n options: IPasswordMeterOptions = defaultPasswordMeterOptions,\r\n queries: IPasswordMeterQueries = defaultPasswordMeterQueires\r\n ) => {\r\n const elements = document.body.querySelectorAll(selector)\r\n elements.forEach((el) => {\r\n const item = el as HTMLElement\r\n let passwordMeter = PasswordMeterComponent.getInstance(item)\r\n if (!passwordMeter) {\r\n passwordMeter = new PasswordMeterComponent(item, options, queries)\r\n }\r\n })\r\n }\r\n\r\n public static createInsance = (\r\n selector: string = defaultPasswordMeterQueires.instanseQuery,\r\n options: IPasswordMeterOptions = defaultPasswordMeterOptions,\r\n queries: IPasswordMeterQueries = defaultPasswordMeterQueires\r\n ): PasswordMeterComponent | undefined => {\r\n const element = document.body.querySelector(selector)\r\n if (!element) {\r\n return\r\n }\r\n const item = element as HTMLElement\r\n let passwordMeter = PasswordMeterComponent.getInstance(item)\r\n if (!passwordMeter) {\r\n passwordMeter = new PasswordMeterComponent(item, options, queries)\r\n }\r\n return passwordMeter\r\n }\r\n\r\n public static bootstrap = (selector: string = defaultPasswordMeterQueires.instanseQuery) => {\r\n PasswordMeterComponent.createInstances(selector)\r\n }\r\n\r\n public static reinitialization = (\r\n selector: string = defaultPasswordMeterQueires.instanseQuery\r\n ) => {\r\n PasswordMeterComponent.createInstances(selector)\r\n }\r\n}\r\nexport {PasswordMeterComponent, defaultPasswordMeterOptions, defaultPasswordMeterQueires}\r\n","import {\r\n getAttributeValueByBreakpoint,\r\n stringSnakeToCamel,\r\n getObjectPropertyValueByKey,\r\n EventHandlerUtil,\r\n throttle,\r\n} from '../_utils/index'\r\n\r\nexport class SwapperStore {\r\n static store: Map = new Map()\r\n\r\n public static set(instanceId: string, drawerComponentObj: SwapperComponent): void {\r\n if (SwapperStore.has(instanceId)) {\r\n return\r\n }\r\n\r\n SwapperStore.store.set(instanceId, drawerComponentObj)\r\n }\r\n\r\n public static get(instanceId: string): SwapperComponent | undefined {\r\n if (!SwapperStore.has(instanceId)) {\r\n return\r\n }\r\n return SwapperStore.store.get(instanceId)\r\n }\r\n\r\n public static remove(instanceId: string): void {\r\n if (!SwapperStore.has(instanceId)) {\r\n return\r\n }\r\n\r\n SwapperStore.store.delete(instanceId)\r\n }\r\n\r\n public static has(instanceId: string): boolean {\r\n return SwapperStore.store.has(instanceId)\r\n }\r\n\r\n public static getAllInstances() {\r\n return SwapperStore.store\r\n }\r\n}\r\n\r\nexport interface ISwapperOptions {\r\n mode: string\r\n}\r\n\r\nexport interface ISwapperQueries {\r\n componentName: string\r\n instanseQuery: string\r\n attrQuery: string\r\n}\r\n\r\nconst defaultSwapperOptions: ISwapperOptions = {\r\n mode: 'append',\r\n}\r\n\r\nconst defaultSwapperQueires: ISwapperQueries = {\r\n componentName: 'swapper',\r\n instanseQuery: '[data-kt-swapper=\"true\"]',\r\n attrQuery: 'data-kt-swapper-',\r\n}\r\n\r\nclass SwapperComponent {\r\n element: HTMLElement\r\n options: ISwapperOptions\r\n queries: ISwapperQueries\r\n\r\n constructor(_element: HTMLElement, _options: ISwapperOptions, _queries: ISwapperQueries) {\r\n this.element = _element\r\n this.options = Object.assign(defaultSwapperOptions, _options)\r\n this.queries = _queries\r\n\r\n // Initial update\r\n this.update()\r\n\r\n SwapperStore.set(this.element.id, this)\r\n }\r\n\r\n private getOption(name: string) {\r\n const attr = this.element.getAttribute(`${this.queries.attrQuery}${name}`)\r\n if (attr) {\r\n let value = getAttributeValueByBreakpoint(attr)\r\n if (attr != null && String(value) === 'true') {\r\n return true\r\n } else if (value !== null && String(value) === 'false') {\r\n return false\r\n }\r\n return value\r\n } else {\r\n const optionName = stringSnakeToCamel(name)\r\n const option = getObjectPropertyValueByKey(this.options, optionName)\r\n if (option) {\r\n return getAttributeValueByBreakpoint(option)\r\n } else {\r\n return null\r\n }\r\n }\r\n }\r\n\r\n ///////////////////////\r\n // ** Public API ** //\r\n ///////////////////////\r\n public update = () => {\r\n const parentSelector = this.getOption('parent')?.toString()\r\n const mode = this.getOption('mode')\r\n const parentElement = parentSelector ? document.querySelector(parentSelector) : null\r\n\r\n if (parentElement && this.element.parentNode !== parentElement) {\r\n if (mode === 'prepend') {\r\n parentElement.prepend(this.element)\r\n } else if (mode === 'append') {\r\n parentElement.append(this.element)\r\n }\r\n }\r\n }\r\n\r\n // Event API\r\n public on = (name: string, handler: Function) => {\r\n return EventHandlerUtil.on(this.element, name, handler)\r\n }\r\n\r\n public one = (name: string, handler: Function) => {\r\n return EventHandlerUtil.one(this.element, name, handler)\r\n }\r\n\r\n public off = (name: string) => {\r\n return EventHandlerUtil.off(this.element, name)\r\n }\r\n\r\n public trigger = (name: string, event: Event) => {\r\n return EventHandlerUtil.trigger(this.element, name, event)\r\n }\r\n\r\n // Static methods\r\n public static getInstance = (\r\n el: HTMLElement,\r\n componentName: string = defaultSwapperQueires.componentName\r\n ): SwapperComponent | null => {\r\n const place = SwapperStore.get(el.id)\r\n if (place) {\r\n return place as SwapperComponent\r\n }\r\n\r\n return null\r\n }\r\n\r\n public static createInstances = (\r\n selector: string = defaultSwapperQueires.instanseQuery,\r\n options: ISwapperOptions = defaultSwapperOptions,\r\n queries: ISwapperQueries = defaultSwapperQueires\r\n ) => {\r\n const elements = document.body.querySelectorAll(selector)\r\n elements.forEach((el) => {\r\n const item = el as HTMLElement\r\n let place = SwapperComponent.getInstance(item)\r\n if (!place) {\r\n place = new SwapperComponent(item, options, queries)\r\n }\r\n })\r\n }\r\n\r\n public static createInsance = (\r\n selector: string = defaultSwapperQueires.instanseQuery,\r\n options: ISwapperOptions = defaultSwapperOptions,\r\n queries: ISwapperQueries = defaultSwapperQueires\r\n ): SwapperComponent | undefined => {\r\n const element = document.body.querySelector(selector)\r\n if (!element) {\r\n return\r\n }\r\n const item = element as HTMLElement\r\n let place = SwapperComponent.getInstance(item)\r\n if (!place) {\r\n place = new SwapperComponent(item, options, queries)\r\n }\r\n return place\r\n }\r\n\r\n public static bootstrap = (selector: string = defaultSwapperQueires.instanseQuery) => {\r\n SwapperComponent.createInstances(selector)\r\n }\r\n\r\n public static reinitialization = (selector: string = defaultSwapperQueires.instanseQuery) => {\r\n SwapperComponent.createInstances(selector)\r\n }\r\n}\r\n\r\n// Window resize handler\r\nwindow.addEventListener('resize', function () {\r\n let timer\r\n throttle(\r\n timer,\r\n () => {\r\n // Locate and update Offcanvas instances on window resize\r\n const elements = document.querySelectorAll(defaultSwapperQueires.instanseQuery)\r\n elements.forEach((el) => {\r\n const place = SwapperComponent.getInstance(el as HTMLElement)\r\n if (place) {\r\n place.update()\r\n }\r\n })\r\n },\r\n 200\r\n )\r\n})\r\n\r\nexport {SwapperComponent, defaultSwapperOptions, defaultSwapperQueires}\r\n","import {createPopper, VirtualElement} from '@popperjs/core'\r\nimport {\r\n getElementChild,\r\n getElementParents,\r\n getAttributeValueByBreakpoint,\r\n getUniqueIdWithPrefix,\r\n DataUtil,\r\n ElementStyleUtil,\r\n EventHandlerUtil,\r\n insertAfterElement,\r\n slideUp,\r\n slideDown,\r\n DOMEventHandlerUtil,\r\n throttle,\r\n getHighestZindex,\r\n} from '../_utils/index'\r\n\r\nexport interface MenuOptions {\r\n dropdown: {\r\n hoverTimeout: number\r\n zindex: number\r\n }\r\n accordion: {\r\n slideSpeed: number\r\n expand: boolean\r\n }\r\n}\r\n\r\nconst defaultMenuOptions: MenuOptions = {\r\n dropdown: {\r\n hoverTimeout: 200,\r\n zindex: 105,\r\n },\r\n accordion: {\r\n slideSpeed: 250,\r\n expand: false,\r\n },\r\n}\r\n\r\ntype PopperPlacement =\r\n | 'right'\r\n | 'auto'\r\n | 'auto-start'\r\n | 'auto-end'\r\n | 'top'\r\n | 'bottom'\r\n | 'left'\r\n | 'top-start'\r\n | 'top-end'\r\n | 'bottom-start'\r\n | 'bottom-end'\r\n | 'right-start'\r\n | 'right-end'\r\n | 'left-start'\r\n | 'left-end'\r\n | undefined\r\n\r\nclass MenuComponent {\r\n element: HTMLElement\r\n options: MenuOptions\r\n instanceUid: string\r\n triggerElement: HTMLElement | null = null\r\n\r\n constructor(_element: HTMLElement, options: MenuOptions) {\r\n this.element = _element\r\n this.options = Object.assign(defaultMenuOptions, options)\r\n this.instanceUid = getUniqueIdWithPrefix('menu')\r\n // this.element.setAttribute('data-kt-menu', 'true')\r\n this._setTriggerElement()\r\n this._update()\r\n DataUtil.set(this.element, 'menu', this)\r\n return this\r\n }\r\n\r\n // Set external trigger element\r\n private _setTriggerElement = () => {\r\n const target = document.querySelector(\r\n `[data-kt-menu-target=\"#${this.element.getAttribute('id')}\"`\r\n )\r\n\r\n if (target) {\r\n this.triggerElement = target as HTMLElement\r\n } else if (this.element.closest('[data-kt-menu-trigger]')) {\r\n this.triggerElement = this.element.closest('[data-kt-menu-trigger]') as HTMLElement\r\n } else if (\r\n this.element.parentNode &&\r\n getElementChild(this.element.parentNode as HTMLElement, '[data-kt-menu-trigger]')\r\n ) {\r\n const child = getElementChild(\r\n this.element.parentNode as HTMLElement,\r\n '[data-kt-menu-trigger]'\r\n )\r\n if (child) {\r\n this.triggerElement = child\r\n }\r\n }\r\n\r\n if (this.triggerElement) {\r\n DataUtil.set(this.triggerElement, 'menu', this)\r\n }\r\n }\r\n\r\n // Test if menu has external trigger element\r\n private _isTriggerElement = (item: HTMLElement) => {\r\n return this.triggerElement === item\r\n }\r\n\r\n // Get item option(through html attributes)\r\n private _getItemOption = (item: HTMLElement, name: string) => {\r\n let value: string | JSON | null | boolean = null\r\n if (item && item.hasAttribute('data-kt-menu-' + name)) {\r\n const attr = item.getAttribute('data-kt-menu-' + name) || ''\r\n value = getAttributeValueByBreakpoint(attr)\r\n if (value !== null && String(value) === 'true') {\r\n value = true\r\n } else if (value !== null && String(value) === 'false') {\r\n value = false\r\n }\r\n }\r\n return value\r\n }\r\n\r\n // Get item element\r\n private _getItemElement = (_element: HTMLElement) => {\r\n // Element is the external trigger element\r\n if (this._isTriggerElement(_element)) {\r\n return _element\r\n }\r\n\r\n // Element has item toggler attribute\r\n if (_element.hasAttribute('data-kt-menu-trigger')) {\r\n return _element\r\n }\r\n\r\n // Element has item DOM reference in it's data storage\r\n const itemElement = DataUtil.get(_element, 'item')\r\n if (itemElement) {\r\n return itemElement\r\n }\r\n\r\n // Item is parent of element\r\n const item = _element.closest('.menu-item[data-kt-menu-trigger]')\r\n if (item) {\r\n return item\r\n }\r\n\r\n // Element's parent has item DOM reference in it's data storage\r\n const sub = _element.closest('.menu-sub')\r\n if (sub) {\r\n const subItem = DataUtil.get(sub as HTMLElement, 'item')\r\n if (subItem) {\r\n return subItem\r\n }\r\n }\r\n }\r\n\r\n // Get item parent element\r\n private _getItemParentElement = (item: HTMLElement) => {\r\n const sub = item.closest('.menu-sub')\r\n if (!sub) {\r\n return null\r\n }\r\n\r\n const subItem = DataUtil.get(sub as HTMLElement, 'item')\r\n if (subItem) {\r\n return subItem\r\n }\r\n\r\n const parentItem = sub.closest('.menu-item[data-kt-menu-trigger]')\r\n if (sub && parentItem) {\r\n return parentItem\r\n }\r\n\r\n return null\r\n }\r\n\r\n // Get item parent elements\r\n private _getItemParentElements = (item: HTMLElement) => {\r\n const parents: Array = []\r\n let parent: Element\r\n let i = 0\r\n let buffer: HTMLElement = item\r\n\r\n do {\r\n parent = this._getItemParentElement(buffer)\r\n if (parent) {\r\n parents.push(parent)\r\n buffer = parent as HTMLElement\r\n }\r\n\r\n i++\r\n } while (parent !== null && i < 20)\r\n\r\n if (this.triggerElement) {\r\n parents.unshift(this.triggerElement)\r\n }\r\n\r\n return parents\r\n }\r\n\r\n // Prepare popper config for dropdown(see: https://popper.js.org/docs/v2/)\r\n private _getDropdownPopperConfig = (item: HTMLElement) => {\r\n // Placement\r\n const placementOption = this._getItemOption(item, 'placement')\r\n let placement: PopperPlacement = 'right'\r\n if (placementOption) {\r\n placement = placementOption as PopperPlacement\r\n }\r\n\r\n // Flip\r\n // const flipValue = this._getItemOption(item, 'flip')\r\n // const flip = flipValue ? flipValue.toString().split(',') : []\r\n\r\n // Offset\r\n const offsetValue = this._getItemOption(item, 'offset')\r\n const offset = offsetValue ? offsetValue.toString().split(',') : []\r\n\r\n // Strategy\r\n const strategy: 'absolute' | 'fixed' | undefined =\r\n this._getItemOption(item, 'overflow') === true ? 'absolute' : 'fixed'\r\n\r\n return {\r\n placement: placement,\r\n strategy: strategy,\r\n modifiers: [\r\n {\r\n name: 'offset',\r\n options: {\r\n offset: offset,\r\n },\r\n },\r\n {\r\n name: 'preventOverflow',\r\n },\r\n {\r\n name: 'flip',\r\n options: {\r\n // altBoundary: true,\r\n // fallbackPlacements: flip,\r\n flipVariations: false,\r\n },\r\n },\r\n ],\r\n }\r\n }\r\n\r\n // Get item child element\r\n private _getItemChildElement = (item: HTMLElement) => {\r\n let selector = item\r\n\r\n const subItem = DataUtil.get(item, 'sub')\r\n if (subItem) {\r\n selector = subItem\r\n }\r\n\r\n if (selector) {\r\n //element = selector.querySelector('.show.menu-item[data-kt-menu-trigger]');\r\n const element = selector.querySelector('.menu-item[data-kt-menu-trigger]')\r\n if (element) {\r\n return element\r\n }\r\n }\r\n return null\r\n }\r\n\r\n // Get item child elements\r\n private _getItemChildElements = (item: HTMLElement) => {\r\n const children: Array = []\r\n let child: Element | null\r\n let i = 0\r\n let buffer = item\r\n do {\r\n child = this._getItemChildElement(buffer)\r\n if (child) {\r\n children.push(child)\r\n buffer = child as HTMLElement\r\n }\r\n\r\n i++\r\n } while (child !== null && i < 20)\r\n\r\n return children\r\n }\r\n\r\n // Get item sub element\r\n private _getItemSubElement = (item: HTMLElement) => {\r\n if (!item) {\r\n return null\r\n }\r\n\r\n if (this._isTriggerElement(item)) {\r\n return this.element\r\n }\r\n\r\n if (item.classList.contains('menu-sub')) {\r\n return item\r\n } else if (DataUtil.has(item, 'sub')) {\r\n return DataUtil.get(item, 'sub')\r\n } else {\r\n return getElementChild(item, '.menu-sub')\r\n }\r\n }\r\n\r\n private _getCss = (el: HTMLElement, styleProp: string) => {\r\n const defaultView = (el.ownerDocument || document).defaultView\r\n if (!defaultView) {\r\n return ''\r\n }\r\n\r\n // sanitize property name to css notation\r\n // (hyphen separated words eg. font-Size)\r\n styleProp = styleProp.replace(/([A-Z])/g, '-$1').toLowerCase()\r\n\r\n return defaultView.getComputedStyle(el, null).getPropertyValue(styleProp)\r\n }\r\n\r\n // Get item sub type\r\n private _getItemSubType = (element: HTMLElement) => {\r\n const sub = this._getItemSubElement(element)\r\n if (sub && parseInt(this._getCss(sub, 'z-index')) > 0) {\r\n return 'dropdown'\r\n } else {\r\n return 'accordion'\r\n }\r\n }\r\n\r\n // Test if item's sub is shown\r\n private _isItemSubShown = (item: HTMLElement) => {\r\n let sub = this._getItemSubElement(item)\r\n if (sub) {\r\n if (this._getItemSubType(item) === 'dropdown') {\r\n return sub.classList.contains('show') && sub.hasAttribute('data-popper-placement')\r\n } else {\r\n return item.classList.contains('show')\r\n }\r\n }\r\n\r\n return false\r\n }\r\n\r\n // Test if item dropdown is permanent\r\n private _isItemDropdownPermanent = (item: HTMLElement) => {\r\n return this._getItemOption(item, 'permanent') === true\r\n }\r\n\r\n // Test if item's parent is shown\r\n private _isItemParentShown = (item: HTMLElement) => {\r\n return getElementParents(item, '.menu-item.show').length > 0\r\n }\r\n\r\n // Test of it is item sub element\r\n private _isItemSubElement = (item: HTMLElement) => {\r\n return item.classList.contains('menu-sub')\r\n }\r\n\r\n // Test if item has sub\r\n private _hasItemSub = (item: HTMLElement) => {\r\n return item.classList.contains('menu-item') && item.hasAttribute('data-kt-menu-trigger')\r\n }\r\n\r\n // Get link element\r\n private _getItemLinkElement = (item: HTMLElement) => {\r\n return getElementChild(item, '.menu-link')\r\n }\r\n\r\n // Get toggle element\r\n private _getItemToggleElement = (item: HTMLElement) => {\r\n if (this.triggerElement) {\r\n return this.triggerElement\r\n }\r\n\r\n return this._getItemLinkElement(item)\r\n }\r\n\r\n // Show item dropdown\r\n private _showDropdown = (item: HTMLElement) => {\r\n if (EventHandlerUtil.trigger(this.element, 'kt.menu.dropdown.show') === false) {\r\n return\r\n }\r\n\r\n // Hide all currently shown dropdowns except current one\r\n MenuComponent.hideDropdowns(item)\r\n\r\n // const toggle = this._isTriggerElement(item) ? item : this._getItemLinkElement(item);\r\n const sub = this._getItemSubElement(item)\r\n const width = this._getItemOption(item, 'width')\r\n const height = this._getItemOption(item, 'height')\r\n\r\n let zindex = this.options.dropdown.zindex\r\n const parentZindex = getHighestZindex(item) // update\r\n // Apply a new z-index if dropdown's toggle element or it's parent has greater z-index // update\r\n if (parentZindex !== null && parentZindex >= zindex) {\r\n zindex = parentZindex + 1\r\n }\r\n\r\n if (zindex) {\r\n ElementStyleUtil.set(sub, 'z-index', zindex)\r\n }\r\n\r\n if (width) {\r\n ElementStyleUtil.set(sub, 'width', width)\r\n }\r\n\r\n if (height) {\r\n ElementStyleUtil.set(sub, 'height', height)\r\n }\r\n\r\n this.initDropdownPopper(item, sub)\r\n\r\n item.classList.add('show')\r\n item.classList.add('menu-dropdown')\r\n sub.classList.add('show')\r\n\r\n // Append the sub the the root of the menu\r\n if (this._getItemOption(item, 'overflow') === true) {\r\n document.body.appendChild(sub)\r\n DataUtil.set(item, 'sub', sub)\r\n DataUtil.set(sub, 'item', item)\r\n DataUtil.set(sub, 'menu', this)\r\n } else {\r\n DataUtil.set(sub, 'item', item)\r\n }\r\n\r\n EventHandlerUtil.trigger(this.element, 'kt.menu.dropdown.shown')\r\n }\r\n\r\n // Init dropdown popper(new)\r\n private initDropdownPopper = (item: HTMLElement, sub: HTMLElement) => {\r\n // Setup popper instance\r\n let reference\r\n const attach = this._getItemOption(item, 'attach') as string\r\n\r\n if (attach) {\r\n if (attach === 'parent') {\r\n reference = item.parentNode\r\n } else {\r\n reference = document.querySelector(attach)\r\n }\r\n } else {\r\n reference = item\r\n }\r\n\r\n if (reference) {\r\n const popper = createPopper(\r\n reference as Element | VirtualElement,\r\n sub,\r\n this._getDropdownPopperConfig(item)\r\n )\r\n DataUtil.set(item, 'popper', popper)\r\n }\r\n }\r\n\r\n // Hide item dropdown\r\n private _hideDropdown = (item: HTMLElement) => {\r\n if (EventHandlerUtil.trigger(this.element, 'kt.menu.dropdown.hide') === false) {\r\n return\r\n }\r\n\r\n const sub = this._getItemSubElement(item)\r\n ElementStyleUtil.set(sub, 'z-index', '')\r\n ElementStyleUtil.set(sub, 'width', '')\r\n ElementStyleUtil.set(sub, 'height', '')\r\n item.classList.remove('show')\r\n item.classList.remove('menu-dropdown')\r\n sub.classList.remove('show')\r\n\r\n // Append the sub back to it's parent\r\n if (this._getItemOption(item, 'overflow') === true) {\r\n if (item.classList.contains('menu-item')) {\r\n item.appendChild(sub)\r\n } else {\r\n insertAfterElement(this.element, item)\r\n }\r\n\r\n DataUtil.remove(item, 'sub')\r\n DataUtil.remove(sub, 'item')\r\n DataUtil.remove(sub, 'menu')\r\n }\r\n\r\n if (DataUtil.has(item, 'popper') === true) {\r\n DataUtil.get(item, 'popper').destroy()\r\n DataUtil.remove(item, 'popper')\r\n }\r\n\r\n // Destroy popper(new)\r\n this.destroyDropdownPopper(item)\r\n EventHandlerUtil.trigger(this.element, 'kt.menu.dropdown.hidden')\r\n }\r\n\r\n // Destroy dropdown popper(new)\r\n private destroyDropdownPopper = (item: HTMLElement) => {\r\n if (DataUtil.has(item, 'popper') === true) {\r\n DataUtil.get(item, 'popper').destroy()\r\n DataUtil.remove(item, 'popper')\r\n }\r\n\r\n EventHandlerUtil.trigger(this.element, 'kt.menu.dropdown.hidden')\r\n }\r\n\r\n private _showAccordion = (item: HTMLElement) => {\r\n if (EventHandlerUtil.trigger(this.element, 'kt.menu.accordion.show') === false) {\r\n return\r\n }\r\n\r\n if (this.options.accordion.expand === false) {\r\n this._hideAccordions(item)\r\n }\r\n\r\n if (DataUtil.has(item, 'popper') === true) {\r\n this._hideDropdown(item)\r\n }\r\n\r\n item.classList.add('hover') // updateWW\r\n item.classList.add('showing')\r\n\r\n const subElement = this._getItemSubElement(item)\r\n if (subElement) {\r\n const sub = subElement as HTMLElement\r\n slideDown(sub, this.options.accordion.slideSpeed, () => {\r\n item.classList.remove('showing')\r\n item.classList.add('show')\r\n sub.classList.add('show')\r\n EventHandlerUtil.trigger(this.element, 'kt.menu.accordion.shown')\r\n })\r\n }\r\n }\r\n\r\n private _hideAccordion = (item: HTMLElement) => {\r\n if (EventHandlerUtil.trigger(this.element, 'kt.menu.accordion.hide') === false) {\r\n return\r\n }\r\n\r\n const sub = this._getItemSubElement(item)\r\n item.classList.add('hiding')\r\n\r\n if (sub) {\r\n slideUp(sub, this.options.accordion.slideSpeed, () => {\r\n item.classList.remove('hiding')\r\n item.classList.remove('show')\r\n sub.classList.remove('show')\r\n item.classList.remove('hover') // update\r\n EventHandlerUtil.trigger(this.element, 'kt.menu.accordion.hidden')\r\n })\r\n }\r\n }\r\n\r\n // Hide all shown accordions of item\r\n private _hideAccordions = (item: HTMLElement) => {\r\n const itemsToHide = this.element.querySelectorAll('.show[data-kt-menu-trigger]')\r\n if (itemsToHide && itemsToHide.length > 0) {\r\n for (var i = 0, len = itemsToHide.length; i < len; i++) {\r\n const itemToHide = itemsToHide[i] as HTMLElement\r\n\r\n if (\r\n this._getItemSubType(itemToHide) === 'accordion' &&\r\n itemToHide !== item &&\r\n item.contains(itemToHide) === false &&\r\n itemToHide.contains(item) === false\r\n ) {\r\n this._hideAccordion(itemToHide)\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Event Handlers\r\n // Reset item state classes if item sub type changed\r\n private _reset = (item: HTMLElement) => {\r\n if (this._hasItemSub(item) === false) {\r\n return\r\n }\r\n\r\n const sub = this._getItemSubElement(item)\r\n\r\n // Reset sub state if sub type is changed during the window resize\r\n if (DataUtil.has(item, 'type') && DataUtil.get(item, 'type') !== this._getItemSubType(item)) {\r\n // updated\r\n item.classList.remove('hover')\r\n item.classList.remove('show')\r\n item.classList.remove('show')\r\n if (sub && sub.removeClass) {\r\n sub.removeClass(sub, 'show')\r\n }\r\n } // updated\r\n }\r\n\r\n // TODO: not done\r\n private _destroy = () => {}\r\n\r\n // Update all item state classes if item sub type changed\r\n private _update = () => {\r\n const items = this.element.querySelectorAll('.menu-item[data-kt-menu-trigger]')\r\n items.forEach((el) => this._reset(el as HTMLElement))\r\n }\r\n\r\n // Hide item sub\r\n private _hide = (item: HTMLElement) => {\r\n if (!item) {\r\n return\r\n }\r\n\r\n if (this._isItemSubShown(item) === false) {\r\n return\r\n }\r\n\r\n if (this._getItemSubType(item) === 'dropdown') {\r\n this._hideDropdown(item)\r\n } else if (this._getItemSubType(item) === 'accordion') {\r\n this._hideAccordion(item)\r\n }\r\n }\r\n\r\n // Show item sub\r\n private _show = (item: HTMLElement) => {\r\n if (!item) {\r\n return\r\n }\r\n\r\n if (this._isItemSubShown(item) === true) {\r\n return\r\n }\r\n\r\n if (this._getItemSubType(item) === 'dropdown') {\r\n this._showDropdown(item) // // show current dropdown\r\n } else if (this._getItemSubType(item) === 'accordion') {\r\n this._showAccordion(item)\r\n }\r\n\r\n // Remember last submenu type\r\n\r\n DataUtil.set(item, 'type', this._getItemSubType(item)) // updated\r\n }\r\n\r\n // Toggle item sub\r\n private _toggle = (item: HTMLElement) => {\r\n if (!item) {\r\n return\r\n }\r\n\r\n if (this._isItemSubShown(item) === true) {\r\n this._hide(item)\r\n } else {\r\n this._show(item)\r\n }\r\n }\r\n\r\n // Mouseout handle\r\n private _mouseout = (element: HTMLElement, e: MouseEvent) => {\r\n const item = this._getItemElement(element)\r\n if (!item) {\r\n return\r\n }\r\n\r\n if (this._getItemOption(item, 'trigger') !== 'hover') {\r\n return\r\n }\r\n\r\n const timeout = setTimeout(() => {\r\n if (DataUtil.get(item, 'hover') === '1') {\r\n this._hide(item)\r\n }\r\n }, this.options.dropdown.hoverTimeout)\r\n\r\n DataUtil.set(item, 'hover', '1')\r\n DataUtil.set(item, 'timeout', timeout)\r\n }\r\n\r\n // Mouseover handle\r\n private _mouseover = (element: HTMLElement, e: MouseEvent) => {\r\n const item = this._getItemElement(element)\r\n if (!item) {\r\n return\r\n }\r\n\r\n if (this._getItemOption(item, 'trigger') !== 'hover') {\r\n return\r\n }\r\n\r\n if (DataUtil.get(item, 'hover') === '1') {\r\n clearTimeout(DataUtil.get(item, 'timeout'))\r\n DataUtil.remove(item, 'hover')\r\n DataUtil.remove(item, 'timeout')\r\n }\r\n\r\n this._show(item)\r\n }\r\n\r\n // Dismiss handler\r\n private _dismiss = (element: HTMLElement, e: Event) => {\r\n const item = this._getItemElement(element)\r\n const items = this._getItemChildElements(item)\r\n //if ( item !== null && _getItemOption(item, 'trigger') === 'click' && _getItemSubType(item) === 'dropdown' ) {\r\n const itemSubType = this._getItemSubType(item)\r\n if (item !== null && itemSubType === 'dropdown') {\r\n this._hide(item) // hide items dropdown\r\n\r\n // Hide all child elements as well\r\n if (items.length > 0) {\r\n for (let i = 0, len = items.length; i < len; i++) {\r\n //if ( _getItemOption(item, 'trigger') === 'click' && _getItemSubType(item) === 'dropdown' ) {\r\n if (items[i] !== null && this._getItemSubType(items[i] as HTMLElement) === 'dropdown') {\r\n this._hide(items[i] as HTMLElement)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Link handler\r\n private _link = (element: HTMLElement, e: Event) => {\r\n if (EventHandlerUtil.trigger(this.element, 'kt.menu.link.click') === false) {\r\n return\r\n }\r\n\r\n // Dismiss all shown dropdowns\r\n MenuComponent.hideDropdowns(undefined)\r\n EventHandlerUtil.trigger(this.element, 'kt.menu.link.clicked')\r\n }\r\n\r\n private _click = (element: HTMLElement, e: Event) => {\r\n e.preventDefault()\r\n const item = this._getItemElement(element)\r\n if (this._getItemOption(item, 'trigger') !== 'click') {\r\n return\r\n }\r\n\r\n if (this._getItemOption(item, 'toggle') === false) {\r\n this._show(item)\r\n } else {\r\n this._toggle(item)\r\n }\r\n }\r\n\r\n ///////////////////////\r\n // ** Public API ** //\r\n ///////////////////////\r\n public click = (element: HTMLElement, e: Event) => {\r\n return this._click(element, e)\r\n }\r\n\r\n public link = (element: HTMLElement, e: Event) => {\r\n return this._link(element, e)\r\n }\r\n\r\n public dismiss = (element: HTMLElement, e: Event) => {\r\n return this._dismiss(element, e)\r\n }\r\n\r\n public mouseover = (element: HTMLElement, e: Event) => {\r\n return this._mouseover(element, e as MouseEvent)\r\n }\r\n\r\n public mouseout = (element: HTMLElement, e: Event) => {\r\n return this._mouseout(element, e as MouseEvent)\r\n }\r\n\r\n // General Methods\r\n public getItemTriggerType = (item: HTMLElement) => {\r\n return this._getItemOption(item, 'trigger')\r\n }\r\n\r\n public getItemSubType = (element: HTMLElement) => {\r\n return this._getItemSubType(element)\r\n }\r\n\r\n public show = (item: HTMLElement) => {\r\n return this._show(item)\r\n }\r\n\r\n public hide = (item: HTMLElement) => {\r\n return this._hide(item)\r\n }\r\n\r\n public reset = (item: HTMLElement) => {\r\n return this._reset(item)\r\n }\r\n\r\n public update = () => {\r\n return this._update()\r\n }\r\n\r\n public getElement = () => {\r\n return this.element\r\n }\r\n\r\n public getItemLinkElement = (item: HTMLElement) => {\r\n return this._getItemLinkElement(item)\r\n }\r\n\r\n public getItemToggleElement = (item: HTMLElement) => {\r\n return this._getItemToggleElement(item)\r\n }\r\n\r\n public getItemSubElement = (item: HTMLElement) => {\r\n return this._getItemSubElement(item)\r\n }\r\n\r\n public getItemParentElements = (item: HTMLElement) => {\r\n return this._getItemParentElements(item)\r\n }\r\n\r\n public isItemSubShown = (item: HTMLElement) => {\r\n return this._isItemSubShown(item)\r\n }\r\n\r\n public isItemParentShown = (item: HTMLElement) => {\r\n return this._isItemParentShown(item)\r\n }\r\n\r\n public getTriggerElement = () => {\r\n return this.triggerElement\r\n }\r\n\r\n public isItemDropdownPermanent = (item: HTMLElement) => {\r\n return this._isItemDropdownPermanent(item)\r\n }\r\n\r\n // Accordion Mode Methods\r\n public hideAccordions = (item: HTMLElement) => {\r\n return this._hideAccordions(item)\r\n }\r\n\r\n // Event API\r\n public on = (name: string, handler: any) => {\r\n return EventHandlerUtil.on(this.element, name, handler)\r\n }\r\n\r\n public one = (name: string, handler: any) => {\r\n return EventHandlerUtil.one(this.element, name, handler)\r\n }\r\n\r\n public off = (name: string) => {\r\n return EventHandlerUtil.off(this.element, name)\r\n }\r\n\r\n // public static methods\r\n // Get KTMenu instance by element\r\n public static getInstance = (element: HTMLElement) => {\r\n // Element has menu DOM reference in it's DATA storage\r\n const elementMenu = DataUtil.get(element, 'menu')\r\n if (elementMenu) {\r\n return elementMenu\r\n }\r\n\r\n // Element has .menu parent\r\n const menu = element.closest('.menu')\r\n if (menu) {\r\n const menuData = DataUtil.get(menu as HTMLElement, 'menu')\r\n if (menuData) {\r\n return menuData\r\n }\r\n }\r\n\r\n // Element has a parent with DOM reference to .menu in it's DATA storage\r\n if (element.classList.contains('menu-link')) {\r\n const sub = element.closest('.menu-sub')\r\n if (sub) {\r\n const subMenu = DataUtil.get(sub as HTMLElement, 'menu')\r\n if (subMenu) {\r\n return subMenu\r\n }\r\n }\r\n }\r\n\r\n return null\r\n }\r\n\r\n // Hide all dropdowns and skip one if provided\r\n public static hideDropdowns = (skip: HTMLElement | undefined) => {\r\n const items = document.querySelectorAll('.show.menu-dropdown[data-kt-menu-trigger]')\r\n\r\n if (items && items.length > 0) {\r\n for (let i = 0, len = items.length; i < len; i++) {\r\n const item = items[i]\r\n const menu = MenuComponent.getInstance(item as HTMLElement)\r\n\r\n if (menu && menu.getItemSubType(item) === 'dropdown') {\r\n if (skip) {\r\n if (\r\n menu.getItemSubElement(item).contains(skip) === false &&\r\n item.contains(skip) === false &&\r\n item !== skip\r\n ) {\r\n menu.hide(item)\r\n }\r\n } else {\r\n menu.hide(item)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n public static updateDropdowns = () => {\r\n const items = document.querySelectorAll('.show.menu-dropdown[data-kt-menu-trigger]')\r\n if (items && items.length > 0) {\r\n for (var i = 0, len = items.length; i < len; i++) {\r\n var item = items[i]\r\n\r\n if (DataUtil.has(item as HTMLElement, 'popper')) {\r\n DataUtil.get(item as HTMLElement, 'popper').forceUpdate()\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Global handlers\r\n public static createInstances = (selector: string) => {\r\n // Initialize menus\r\n document.querySelectorAll(selector).forEach((el) => {\r\n const menuItem = el as HTMLElement\r\n let menuInstance = MenuComponent.getInstance(menuItem)\r\n if (!menuInstance) {\r\n menuInstance = new MenuComponent(el as HTMLElement, defaultMenuOptions)\r\n }\r\n })\r\n }\r\n\r\n public static initGlobalHandlers = () => {\r\n // Dropdown handler\r\n document.addEventListener('click', (e) => {\r\n const menuItems = document.querySelectorAll('.show.menu-dropdown[data-kt-menu-trigger]')\r\n if (menuItems && menuItems.length > 0) {\r\n for (let i = 0; i < menuItems.length; i++) {\r\n const item = menuItems[i] as HTMLElement\r\n const menuObj = MenuComponent.getInstance(item) as MenuComponent\r\n if (menuObj && menuObj.getItemSubType(item) === 'dropdown') {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const menu = menuObj.getElement()\r\n const sub = menuObj.getItemSubElement(item) as HTMLElement\r\n if (item === e.target || item.contains(e.target as HTMLElement)) {\r\n continue\r\n }\r\n\r\n if (sub && (sub === e.target || sub.contains(e.target as HTMLElement))) {\r\n continue\r\n }\r\n menuObj.hide(item)\r\n }\r\n }\r\n }\r\n })\r\n\r\n // Sub toggle handler\r\n DOMEventHandlerUtil.on(\r\n document.body,\r\n '.menu-item[data-kt-menu-trigger] > .menu-link, [data-kt-menu-trigger]:not(.menu-item):not([data-kt-menu-trigger=\"auto\"])',\r\n 'click',\r\n function (this: HTMLElement, e: Event) {\r\n const menu = MenuComponent.getInstance(this) as MenuComponent\r\n if (menu) {\r\n return menu.click(this, e)\r\n }\r\n }\r\n )\r\n\r\n // // Link handler\r\n DOMEventHandlerUtil.on(\r\n document.body,\r\n '.menu-item:not([data-kt-menu-trigger]) > .menu-link',\r\n 'click',\r\n function (this: HTMLElement, e: Event) {\r\n e.stopPropagation()\r\n const menu = MenuComponent.getInstance(this)\r\n if (menu && menu.link) {\r\n return menu.link(this, e)\r\n }\r\n }\r\n )\r\n\r\n // Dismiss handler\r\n DOMEventHandlerUtil.on(\r\n document.body,\r\n '[data-kt-menu-dismiss=\"true\"]',\r\n 'click',\r\n function (this: HTMLElement, e: Event) {\r\n const menu = MenuComponent.getInstance(this) as MenuComponent\r\n if (menu) {\r\n return menu.dismiss(this, e)\r\n }\r\n }\r\n )\r\n\r\n // Mouseover handler\r\n DOMEventHandlerUtil.on(\r\n document.body,\r\n '[data-kt-menu-trigger], .menu-sub',\r\n 'mouseover',\r\n function (this: HTMLElement, e: Event) {\r\n const menu = MenuComponent.getInstance(this) as MenuComponent\r\n if (menu && menu.getItemSubType(this) === 'dropdown') {\r\n return menu.mouseover(this, e)\r\n }\r\n }\r\n )\r\n\r\n // Mouseout handler\r\n DOMEventHandlerUtil.on(\r\n document.body,\r\n '[data-kt-menu-trigger], .menu-sub',\r\n 'mouseout',\r\n function (this: HTMLElement, e: Event) {\r\n const menu = MenuComponent.getInstance(this) as MenuComponent\r\n if (menu && menu.getItemSubType(this) === 'dropdown') {\r\n return menu.mouseout(this, e)\r\n }\r\n }\r\n )\r\n\r\n // Resize handler\r\n window.addEventListener('resize', () => {\r\n let timer\r\n throttle(\r\n timer,\r\n () => {\r\n // Locate and update Drawer instances on window resize\r\n const elements = document.querySelectorAll('[data-kt-menu=\"true\"]')\r\n elements.forEach((el) => {\r\n const menu = MenuComponent.getInstance(el as HTMLElement)\r\n if (menu) {\r\n menu.update()\r\n }\r\n })\r\n },\r\n 200\r\n )\r\n })\r\n }\r\n\r\n public static bootstrap = () => {\r\n MenuComponent.initGlobalHandlers()\r\n MenuComponent.createInstances('[data-kt-menu=\"true\"]')\r\n }\r\n\r\n public static reinitialization = () => {\r\n MenuComponent.createInstances('[data-kt-menu=\"true\"]')\r\n }\r\n\r\n public static createInsance = (\r\n selector: string,\r\n options: MenuOptions = defaultMenuOptions\r\n ): MenuComponent | undefined => {\r\n const element = document.body.querySelector(selector)\r\n if (!element) {\r\n return\r\n }\r\n const item = element as HTMLElement\r\n let menu = MenuComponent.getInstance(item)\r\n if (!menu) {\r\n menu = new MenuComponent(item, options)\r\n }\r\n return menu\r\n }\r\n}\r\n\r\nexport {MenuComponent, defaultMenuOptions}\r\n","import {\r\n EventHandlerUtil,\r\n DataUtil,\r\n getBreakpoint,\r\n getAttributeValueByBreakpoint,\r\n stringSnakeToCamel,\r\n getObjectPropertyValueByKey,\r\n getViewPort,\r\n isVisibleElement,\r\n throttle,\r\n} from '../_utils/index'\r\n\r\nimport {MenuComponent, defaultMenuOptions} from './MenuComponent'\r\n\r\nexport interface ISearchOptions {\r\n minLength: number // Miniam text lenght to query search\r\n keypress: boolean // Enable search on keypress\r\n enter: boolean // Enable search on enter key press\r\n layout: 'menu' | 'inline' // Use 'menu' or 'inline' layout options to display search results\r\n responsive?: number // Pass integer value or bootstrap compatible breakpoint key(sm,md,lg,xl,xxl) to enable reponsive form mode for device width below the breakpoint value\r\n showOnFocus: boolean // Always show menu on input focus\r\n}\r\n\r\nexport interface ISearchQueries {\r\n componentName: string\r\n instanseQuery: string\r\n attrQuery: string\r\n}\r\n\r\nconst defaultSearchOptions: ISearchOptions = {\r\n minLength: 2, // Miniam text lenght to query search\r\n keypress: true, // Enable search on keypress\r\n enter: true, // Enable search on enter key press\r\n layout: 'menu', // Use 'menu' or 'inline' layout options to display search results\r\n showOnFocus: true, // Always show menu on input focus\r\n}\r\n\r\nconst defaultSearchQueires: ISearchQueries = {\r\n componentName: 'search',\r\n instanseQuery: '[data-kt-search]',\r\n attrQuery: 'data-kt-search-',\r\n}\r\n\r\nclass SearchComponent {\r\n element: HTMLElement\r\n contentElement: HTMLElement\r\n formElement: HTMLFormElement\r\n inputElement: HTMLInputElement\r\n spinnerElement: HTMLElement\r\n clearElement: HTMLElement\r\n toggleElement: HTMLElement\r\n submitElement: HTMLElement\r\n toolbarElement: HTMLElement\r\n resultsElement: HTMLElement\r\n suggestionElement: HTMLElement\r\n emptyElement: HTMLElement\r\n layout: any\r\n\r\n options: ISearchOptions\r\n queries: ISearchQueries\r\n\r\n processing: boolean = false\r\n menuObject: MenuComponent | undefined\r\n\r\n constructor(_element: HTMLElement, _options: ISearchOptions, _queries: ISearchQueries) {\r\n // Variables\r\n this.options = Object.assign(defaultSearchOptions, _options)\r\n this.queries = _queries\r\n\r\n // Elements\r\n this.element = _element\r\n this.contentElement = this._getElement('content') as HTMLElement\r\n this.formElement = this._getElement('form') as HTMLFormElement\r\n this.inputElement = this._getElement('input') as HTMLInputElement\r\n this.spinnerElement = this._getElement('spinner') as HTMLElement\r\n this.clearElement = this._getElement('clear') as HTMLElement\r\n this.toggleElement = this._getElement('toggle') as HTMLElement\r\n this.submitElement = this._getElement('submit') as HTMLElement\r\n this.toolbarElement = this._getElement('toolbar') as HTMLElement\r\n\r\n this.resultsElement = this._getElement('results') as HTMLElement\r\n this.suggestionElement = this._getElement('suggestion') as HTMLElement\r\n this.emptyElement = this._getElement('empty') as HTMLElement\r\n\r\n // Layout\r\n this.layout = this.getOption('layout')\r\n if (this.layout === 'menu') {\r\n this.menuObject = new MenuComponent(this.contentElement, defaultMenuOptions)\r\n }\r\n\r\n // Update\r\n this.update()\r\n\r\n // Event Handlers\r\n this.handlers()\r\n\r\n DataUtil.set(this.element, this.queries.componentName, this)\r\n }\r\n\r\n private _getElement = (name: string) => {\r\n return this.element.querySelector('[data-kt-search-element=\"' + name + '\"]')\r\n }\r\n\r\n // Get option\r\n private getOption = (name: string) => {\r\n const attr = this.element.getAttribute(`${this.queries.attrQuery}${name}`)\r\n if (attr) {\r\n let value = getAttributeValueByBreakpoint(attr)\r\n\r\n if (value !== null && String(value) === 'true') {\r\n return true\r\n } else if (value !== null && String(value) === 'false') {\r\n return false\r\n }\r\n\r\n return value\r\n } else {\r\n const optionName = stringSnakeToCamel(name)\r\n\r\n const option = getObjectPropertyValueByKey(this.options, optionName)\r\n if (option) {\r\n return getAttributeValueByBreakpoint(option)\r\n } else {\r\n return null\r\n }\r\n }\r\n }\r\n\r\n // Check if responsive form mode is enabled\r\n private getResponsiveFormMode = () => {\r\n const responsive = this.getOption('responsive') as string\r\n const width = getViewPort().width\r\n\r\n if (!responsive) {\r\n return null\r\n }\r\n\r\n const breakpoint = getBreakpoint(responsive)\r\n let breakPointNum = -1\r\n if (!breakpoint) {\r\n breakPointNum = parseInt(responsive)\r\n } else {\r\n breakPointNum = +breakpoint\r\n }\r\n\r\n if (width < breakPointNum) {\r\n return 'on'\r\n } else {\r\n return 'off'\r\n }\r\n }\r\n\r\n // Focus\r\n private focus = () => {\r\n this.element.classList.add('focus')\r\n\r\n if (\r\n this.getOption('show-on-focus') === true ||\r\n this.inputElement.value.length >= this.options.minLength\r\n ) {\r\n this.show()\r\n }\r\n }\r\n\r\n // Blur\r\n private blur = () => {\r\n this.element.classList.remove('focus')\r\n }\r\n\r\n // Enter\r\n private enter = (e: KeyboardEvent) => {\r\n const key = e.charCode || e.keyCode || 0\r\n\r\n if (key === 13) {\r\n e.preventDefault()\r\n\r\n this.search()\r\n }\r\n }\r\n\r\n // Input\r\n private input = () => {\r\n if (this.getOption('min-length')) {\r\n const minLength = parseInt(this.getOption('min-length') as string)\r\n\r\n if (this.inputElement.value.length >= minLength) {\r\n this.search()\r\n } else if (this.inputElement.value.length === 0) {\r\n this.clear()\r\n }\r\n }\r\n }\r\n\r\n private handlers(): void {\r\n const context = this;\r\n\r\n // Focus\r\n this.inputElement.addEventListener('focus', this.focus)\r\n\r\n // Blur\r\n this.inputElement.addEventListener('blur', this.blur)\r\n\r\n // Keypress\r\n if (this.getOption('keypress') === true) {\r\n this.inputElement.addEventListener('input', this.input)\r\n }\r\n\r\n // Submit\r\n if (this.submitElement) {\r\n this.submitElement.addEventListener('click', this.search)\r\n }\r\n\r\n // Enter\r\n if (this.getOption('enter') === true) {\r\n this.inputElement.addEventListener('keypress', this.enter)\r\n }\r\n\r\n // Clear\r\n if (this.clearElement) {\r\n this.clearElement.addEventListener('click', this.clear)\r\n }\r\n\r\n // Menu\r\n if (this.menuObject) {\r\n // Toggle menu\r\n if (this.toggleElement) {\r\n this.toggleElement.addEventListener('click', this.show)\r\n\r\n this.menuObject.on('kt.menu.dropdown.show', function () {\r\n // @ts-ignore\r\n if (isVisibleElement(context.toggleElement)) {\r\n // @ts-ignore\r\n context.toggleElement.classList.add('active')\r\n // @ts-ignore\r\n context.toggleElement.classList.add('show')\r\n }\r\n })\r\n\r\n this.menuObject.on('kt.menu.dropdown.hide', function () {\r\n // @ts-ignore\r\n if (isVisibleElement(context.toggleElement)) {\r\n // @ts-ignore\r\n context.toggleElement.classList.remove('active')\r\n // @ts-ignore\r\n context.toggleElement.classList.remove('show')\r\n }\r\n })\r\n }\r\n\r\n this.menuObject.on('kt.menu.dropdown.shown', function () {\r\n // @ts-ignore\r\n context.inputElement.focus()\r\n })\r\n }\r\n\r\n // Window resize handling\r\n window.addEventListener('resize', () => {\r\n let timer\r\n\r\n throttle(\r\n timer,\r\n () => {\r\n this.update()\r\n },\r\n 200\r\n )\r\n })\r\n }\r\n\r\n ///////////////////////\r\n // ** Public API ** //\r\n ///////////////////////\r\n // Update\r\n public update = () => {\r\n // Handle responsive form\r\n if (this.layout === 'menu') {\r\n let responsiveFormMode = this.getResponsiveFormMode()\r\n\r\n if (responsiveFormMode === 'on' && !this.contentElement.contains(this.formElement)) {\r\n this.contentElement.prepend(this.formElement)\r\n this.formElement.classList.remove('d-none')\r\n } else if (\r\n responsiveFormMode === 'off' &&\r\n this.contentElement.contains(this.formElement)\r\n ) {\r\n this.element.prepend(this.formElement)\r\n this.formElement.classList.add('d-none')\r\n }\r\n }\r\n }\r\n\r\n // Show menu\r\n public show = () => {\r\n if (this.menuObject) {\r\n this.update()\r\n\r\n this.menuObject.show(this.element)\r\n }\r\n }\r\n\r\n // Hide menu\r\n public hide = () => {\r\n if (this.menuObject) {\r\n this.update()\r\n\r\n this.menuObject.hide(this.element)\r\n }\r\n }\r\n\r\n // Search\r\n public search = () => {\r\n if (!this.processing) {\r\n // Show search spinner\r\n if (this.spinnerElement) {\r\n this.spinnerElement.classList.remove('d-none')\r\n }\r\n\r\n // Hide search clear button\r\n if (this.clearElement) {\r\n this.clearElement.classList.add('d-none')\r\n }\r\n\r\n // Hide search toolbar\r\n if (this.toolbarElement) {\r\n this.toolbarElement.classList.add('d-none')\r\n }\r\n\r\n // Focus input\r\n this.inputElement.focus()\r\n\r\n this.processing = true\r\n EventHandlerUtil.trigger(this.element, 'kt.search.process', this);\r\n }\r\n }\r\n\r\n // Complete\r\n public complete = () => {\r\n if (this.spinnerElement) {\r\n this.spinnerElement.classList.add('d-none')\r\n }\r\n\r\n // Show search toolbar\r\n if (this.clearElement) {\r\n this.clearElement.classList.remove('d-none')\r\n }\r\n\r\n if (this.inputElement.value.length === 0) {\r\n this.clear()\r\n }\r\n\r\n // Focus input\r\n this.inputElement.focus()\r\n\r\n this.show()\r\n\r\n this.processing = false\r\n }\r\n\r\n // Clear\r\n public clear = () => {\r\n if (EventHandlerUtil.trigger(this.element, 'kt.search.clear') === false) {\r\n return\r\n }\r\n\r\n // Clear and focus input\r\n this.inputElement.value = ''\r\n this.inputElement.focus()\r\n\r\n // Hide clear icon\r\n if (this.clearElement) {\r\n this.clearElement.classList.add('d-none')\r\n }\r\n\r\n // Show search toolbar\r\n if (this.toolbarElement) {\r\n this.toolbarElement.classList.remove('d-none')\r\n }\r\n\r\n // Hide menu\r\n if (this.getOption('show-on-focus') === false) {\r\n this.hide()\r\n }\r\n\r\n EventHandlerUtil.trigger(this.element, 'kt.search.cleared')\r\n }\r\n\r\n public isProcessing = () => {\r\n return this.processing\r\n }\r\n\r\n public getQuery = () => {\r\n return this.inputElement.value\r\n }\r\n\r\n public getMenu = () => {\r\n return this.menuObject\r\n }\r\n\r\n public getFormElement = () => {\r\n return this.formElement\r\n }\r\n\r\n public getInputElement(): HTMLInputElement {\r\n return this.inputElement\r\n }\r\n\r\n public getContentElement(): HTMLElement {\r\n return this.contentElement\r\n }\r\n\r\n public getElement(): HTMLElement {\r\n return this.element\r\n }\r\n\r\n // Event API\r\n public on = (name: string, handler: Function) => {\r\n return EventHandlerUtil.on(this.element, name, handler)\r\n }\r\n\r\n public one = (name: string, handler: Function) => {\r\n return EventHandlerUtil.one(this.element, name, handler)\r\n }\r\n\r\n public off = (name: string) => {\r\n return EventHandlerUtil.off(this.element, name)\r\n }\r\n\r\n // Static methods\r\n public static getInstance = (\r\n el: HTMLElement,\r\n componentName: string = defaultSearchQueires.componentName\r\n ) => {\r\n const Search = DataUtil.get(el, componentName)\r\n if (Search) {\r\n return Search\r\n }\r\n\r\n return null\r\n }\r\n\r\n public static createInstances = (\r\n selector: string = defaultSearchQueires.instanseQuery,\r\n options: ISearchOptions = defaultSearchOptions,\r\n queries: ISearchQueries = defaultSearchQueires\r\n ) => {\r\n const elements = document.body.querySelectorAll(selector)\r\n elements.forEach((el) => {\r\n const item = el as HTMLElement\r\n let Search = SearchComponent.getInstance(item)\r\n if (!Search) {\r\n Search = new SearchComponent(item, options, queries)\r\n }\r\n })\r\n }\r\n\r\n public static createInsance = (\r\n selector: string = defaultSearchQueires.instanseQuery,\r\n options: ISearchOptions = defaultSearchOptions,\r\n queries: ISearchQueries = defaultSearchQueires\r\n ): SearchComponent | undefined => {\r\n const element = document.body.querySelector(selector)\r\n if (!element) {\r\n return\r\n }\r\n const item = element as HTMLElement\r\n let Search = SearchComponent.getInstance(item)\r\n if (!Search) {\r\n Search = new SearchComponent(item, options, queries)\r\n }\r\n return Search\r\n }\r\n\r\n public static bootstrap = (selector: string = defaultSearchQueires.instanseQuery) => {\r\n SearchComponent.createInstances(selector)\r\n }\r\n\r\n public static reinitialization = (selector: string = defaultSearchQueires.instanseQuery) => {\r\n SearchComponent.createInstances(selector)\r\n }\r\n}\r\nexport {SearchComponent, defaultSearchOptions, defaultSearchQueires}\r\n","import {all} from 'redux-saga/effects'\r\nimport {combineReducers} from 'redux'\r\n\r\nimport * as auth from '../../app/modules/auth'\r\n\r\nexport const rootReducer = combineReducers({\r\n auth: auth.reducer,\r\n})\r\n\r\nexport type RootState = ReturnType\r\n\r\nexport function* rootSaga() {\r\n yield all([auth.saga()])\r\n}\r\n","import {configureStore, getDefaultMiddleware} from '@reduxjs/toolkit'\r\nimport createSagaMiddleware from 'redux-saga'\r\nimport {reduxBatch} from '@manaflair/redux-batch'\r\nimport {persistStore} from 'redux-persist'\r\nimport {rootReducer, rootSaga} from './RootReducer'\r\n\r\nconst sagaMiddleware = createSagaMiddleware()\r\nconst middleware = [\r\n ...getDefaultMiddleware({\r\n immutableCheck: false,\r\n serializableCheck: false,\r\n thunk: true,\r\n }),\r\n sagaMiddleware,\r\n]\r\n\r\nconst store = configureStore({\r\n reducer: rootReducer,\r\n middleware,\r\n devTools: process.env.NODE_ENV !== 'production',\r\n // @ts-ignore\r\n enhancers: [reduxBatch],\r\n})\r\n\r\nexport type AppDispatch = typeof store.dispatch\r\n\r\n/**\r\n * @see https://github.com/rt2zz/redux-persist#persiststorestore-config-callback\r\n * @see https://github.com/rt2zz/redux-persist#persistor-object\r\n */\r\nexport const persistor = persistStore(store)\r\n\r\nsagaMiddleware.run(rootSaga)\r\n\r\nexport default store\r\n","import React, {FC, createContext, useContext} from 'react'\r\n\r\nconst I18N_CONFIG_KEY = process.env.REACT_APP_I18N_CONFIG_KEY || 'i18nConfig'\r\n\r\ntype Props = {\r\n selectedLang: 'en' | 'es'\r\n}\r\nconst initialState: Props = {\r\n selectedLang: 'es',\r\n}\r\n\r\nfunction getConfig(): Props {\r\n const ls = localStorage.getItem(I18N_CONFIG_KEY)\r\n if (ls) {\r\n try {\r\n return JSON.parse(ls) as Props\r\n } catch (er) {\r\n console.error(er)\r\n }\r\n }\r\n return initialState\r\n}\r\n\r\n// Side effect\r\nexport function setLanguage(lang: string) {\r\n localStorage.setItem(I18N_CONFIG_KEY, JSON.stringify({selectedLang: lang}))\r\n window.location.reload()\r\n}\r\n\r\nconst I18nContext = createContext(initialState)\r\n\r\nconst useLang = () => {\r\n return useContext(I18nContext).selectedLang\r\n}\r\n\r\nconst MetronicI18nProvider: FC = ({children}) => {\r\n const lang = getConfig()\r\n return {children}\r\n}\r\n\r\nexport {MetronicI18nProvider, useLang}\r\n","import {FC} from 'react'\r\nimport {useLang} from './Metronici18n'\r\nimport {IntlProvider} from 'react-intl'\r\nimport '@formatjs/intl-relativetimeformat/polyfill'\r\nimport '@formatjs/intl-relativetimeformat/locale-data/en'\r\nimport '@formatjs/intl-relativetimeformat/locale-data/es'\r\n\r\nimport enMessages from './messages/en.json'\r\nimport esMessages from './messages/es.json'\r\nconst allMessages = {\r\n en: enMessages,\r\n es: esMessages,\r\n}\r\n\r\nconst I18nProvider: FC = ({children}) => {\r\n const locale = useLang()\r\n const messages = allMessages[locale]\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n\r\nexport {I18nProvider}\r\n","import React from 'react'\r\nimport clsx from 'clsx'\r\nimport {Link} from 'react-router-dom'\r\nimport {useLocation} from 'react-router'\r\nimport {checkIsActive, KTSVG} from '../../../helpers'\r\nimport {useLayout} from '../../core'\r\n\r\ntype Props = {\r\n to: string\r\n title: string\r\n icon?: string\r\n fontIcon?: string\r\n hasBullet?: boolean\r\n}\r\n\r\nconst AsideMenuItem: React.FC = ({\r\n children,\r\n to,\r\n title,\r\n icon,\r\n fontIcon,\r\n hasBullet = false,\r\n}) => {\r\n const {pathname} = useLocation()\r\n const isActive = checkIsActive(pathname, to)\r\n const {config} = useLayout()\r\n const {aside} = config\r\n\r\n return (\r\n
\r\n \r\n {hasBullet && (\r\n \r\n \r\n \r\n )}\r\n {icon && aside.menuIcon === 'svg' && (\r\n \r\n \r\n \r\n )}\r\n {fontIcon && aside.menuIcon === 'font' && }\r\n {title}\r\n \r\n {children}\r\n
\r\n )\r\n}\r\n\r\nexport {AsideMenuItem}\r\n","/* eslint-disable react/jsx-no-target-blank */\r\nimport React from 'react'\r\nimport {AsideMenuItem} from './AsideMenuItem'\r\n\r\nexport function AsideMenuMain() {\r\n return (\r\n <>\r\n \r\n \r\n {/*\r\n
\r\n
\r\n Administración\r\n
\r\n
\r\n \r\n \r\n */}\r\n \r\n )\r\n}\r\n","import React, {useRef, useEffect} from 'react'\r\nimport {useLocation} from 'react-router'\r\nimport clsx from 'clsx'\r\nimport {AsideMenuMain} from './AsideMenuMain'\r\nimport {DrawerComponent, ScrollComponent, ToggleComponent} from '../../../assets/ts/components'\r\n\r\ntype Props = {\r\n asideMenuCSSClasses: string[]\r\n}\r\n\r\nconst AsideMenu: React.FC = ({asideMenuCSSClasses}) => {\r\n const scrollRef = useRef(null)\r\n const {pathname} = useLocation()\r\n\r\n useEffect(() => {\r\n setTimeout(() => {\r\n DrawerComponent.reinitialization()\r\n ToggleComponent.reinitialization()\r\n ScrollComponent.reinitialization()\r\n if (scrollRef.current) {\r\n scrollRef.current.scrollTop = 0\r\n }\r\n }, 50)\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [pathname])\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport {AsideMenu}\r\n","/* eslint-disable react/jsx-no-target-blank */\r\n/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React, {FC} from 'react'\r\nimport {Link} from 'react-router-dom'\r\nimport clsx from 'clsx'\r\nimport {useLayout} from '../../core'\r\nimport {KTSVG, toAbsoluteUrl} from '../../../helpers'\r\nimport {AsideMenu} from './AsideMenu'\r\n\r\nconst AsideDefault: FC = () => {\r\n const {config, classes} = useLayout()\r\n const {aside} = config\r\n\r\n return (\r\n \r\n {/* begin::Brand */}\r\n \r\n )}\r\n {/* end::Aside toggler */}\r\n \r\n {/* end::Brand */}\r\n\r\n {/* begin::Aside menu */}\r\n
\r\n \r\n
\r\n {/* end::Aside menu */}\r\n \r\n )\r\n}\r\n\r\nexport {AsideDefault}\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport {FC} from 'react'\r\nimport {useLayout} from '../core'\r\n\r\nconst Footer: FC = () => {\r\n const {classes} = useLayout()\r\n return (\r\n \r\n {/* end::Container */}\r\n \r\n )\r\n}\r\n\r\nexport {Footer}\r\n","import clsx from 'clsx'\r\nimport React, {FC} from 'react'\r\nimport {Link} from 'react-router-dom'\r\nimport {useLayout} from '../../../core/LayoutProvider'\r\nimport {usePageData} from '../../../core/PageData'\r\n\r\nconst DefaultTitle: FC = () => {\r\n const {pageTitle, pageDescription, pageBreadcrumbs} = usePageData()\r\n const {config, classes} = useLayout()\r\n return (\r\n \r\n {/* begin::Title */}\r\n {pageTitle && (\r\n

\r\n {pageTitle}\r\n {pageDescription && config.pageTitle && config.pageTitle.description && (\r\n <>\r\n \r\n {pageDescription}\r\n \r\n )}\r\n

\r\n )}\r\n {/* end::Title */}\r\n\r\n {pageBreadcrumbs &&\r\n pageBreadcrumbs.length > 0 &&\r\n config.pageTitle &&\r\n config.pageTitle.breadCrumbs && (\r\n <>\r\n {config.pageTitle.direction === 'row' && (\r\n \r\n )}\r\n
    \r\n {Array.from(pageBreadcrumbs).map((item, index) => (\r\n \r\n {!item.isSeparator ? (\r\n \r\n {item.title}\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n ))}\r\n
  • {pageTitle}
  • \r\n
\r\n \r\n )}\r\n \r\n )\r\n}\r\n\r\nexport {DefaultTitle}\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport {FC} from 'react'\r\nimport {shallowEqual, useSelector} from 'react-redux'\r\nimport {Link} from 'react-router-dom'\r\nimport {UserModel} from '../../../../app/modules/auth/models/UserModel'\r\nimport {RootState} from '../../../../setup'\r\nimport * as auth from '../../../../app/modules/auth/redux/AuthRedux'\r\nimport {useDispatch} from 'react-redux'\r\nimport {KTSVG} from '../../../helpers'\r\n\r\nconst HeaderUserMenu: FC = () => {\r\n const user: UserModel = useSelector(({auth}) => auth.user, shallowEqual) as UserModel\r\n\r\n const dispatch = useDispatch()\r\n const logout = () => {\r\n dispatch(auth.actions.logout())\r\n }\r\n\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n {user.firstname} {user.lastname}\r\n
\r\n \r\n {user.email}\r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n {/**/}\r\n\r\n
\r\n \r\n Cuenta\r\n \r\n
\r\n\r\n
\r\n \r\n Salir\r\n \r\n
\r\n \r\n )\r\n}\r\n\r\nexport {HeaderUserMenu}\r\n","import {toAbsoluteUrl} from '../../../helpers'\r\n\r\nexport function FallbackView() {\r\n return (\r\n
\r\n Start logo\r\n Cargando ...\r\n
\r\n )\r\n}\r\n","import clsx from 'clsx'\r\nimport {FC} from 'react'\r\nimport {KTSVG} from '../../../helpers'\r\nimport {HeaderUserMenu} from '../../../partials'\r\nimport {shallowEqual, useSelector} from 'react-redux'\r\nimport {UserModel} from '../../../../app/modules/auth/models/UserModel'\r\nimport {RootState} from '../../../../setup'\r\nimport {Button} from 'react-bootstrap-v5'\r\nimport {Link} from 'react-router-dom'\r\n\r\nconst toolbarButtonMarginClass = 'ms-1 ms-lg-3',\r\n toolbarUserAvatarHeightClass = 'symbol-30px symbol-md-40px'\r\n\r\nconst Topbar: FC = () => {\r\n const user: UserModel = useSelector(({auth}) => auth.user, shallowEqual) as UserModel\r\n const nAvailableReports = useSelector(({auth}) => auth.nAvailableReports)\r\n\r\n return (\r\n
\r\n {/* begin::User */}\r\n

\r\n \r\n \r\n {user?.firstname}, Dispones de {nAvailableReports} informes.\r\n \r\n \r\n \r\n \r\n {/* begin::Toggle */}\r\n \r\n \r\n
\r\n \r\n {/* end::Toggle */}\r\n \r\n {/* end::User */}\r\n \r\n )\r\n}\r\n\r\nexport {Topbar}\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport clsx from 'clsx'\r\nimport React from 'react'\r\nimport {Link} from 'react-router-dom'\r\nimport {KTSVG, toAbsoluteUrl} from '../../../helpers'\r\nimport {useLayout} from '../../core'\r\nimport {DefaultTitle} from './page-title/DefaultTitle'\r\nimport {Topbar} from './Topbar'\r\n\r\nexport function HeaderWrapper() {\r\n const {config, classes, attributes} = useLayout()\r\n const {header, aside} = config\r\n\r\n return (\r\n \r\n \r\n {/* begin::Aside mobile toggle */}\r\n {aside.display && (\r\n
\r\n \r\n \r\n
\r\n \r\n )}\r\n {/* end::Aside mobile toggle */}\r\n {/* begin::Logo */}\r\n {!aside.display && (\r\n
\r\n \r\n Logo\r\n \r\n
\r\n )}\r\n {/* end::Logo */}\r\n\r\n {aside.display && (\r\n
\r\n \r\n Logo\r\n \r\n
\r\n )}\r\n\r\n {/* begin::Wrapper */}\r\n
\r\n {/* begin::Navbar */}\r\n {header.left === 'menu' && (\r\n
\r\n )}\r\n\r\n {header.left === 'page-title' && (\r\n
\r\n \r\n
\r\n )}\r\n\r\n
\r\n \r\n
\r\n
\r\n {/* end::Wrapper */}\r\n \r\n \r\n )\r\n}\r\n","import React, {useEffect, useRef} from 'react'\r\nimport {useLocation} from 'react-router-dom'\r\nimport {\r\n ScrollTopComponent,\r\n DrawerComponent,\r\n ToggleComponent,\r\n StickyComponent,\r\n} from '../../assets/ts/components'\r\nimport {KTSVG} from '../../helpers'\r\n\r\nexport function ScrollTop() {\r\n const {pathname} = useLocation()\r\n const isFirstRun = useRef(true)\r\n\r\n const pluginsReinitialization = () => {\r\n setTimeout(() => {\r\n StickyComponent.reInitialization()\r\n setTimeout(() => {\r\n ToggleComponent.reinitialization()\r\n DrawerComponent.reinitialization()\r\n }, 70)\r\n }, 140)\r\n }\r\n\r\n const scrollTop = () => {\r\n ScrollTopComponent.goTop()\r\n }\r\n\r\n const updateHeaderSticky = () => {\r\n const stickyHeader = document.body.querySelectorAll(`[data-kt-sticky-name=\"header\"]`)\r\n if (stickyHeader && stickyHeader.length > 0) {\r\n const sticky = StickyComponent.getInstance(stickyHeader[0] as HTMLElement)\r\n if (sticky) {\r\n sticky.update()\r\n }\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n if (isFirstRun.current) {\r\n isFirstRun.current = false\r\n } else {\r\n pluginsReinitialization()\r\n }\r\n\r\n updateHeaderSticky()\r\n setTimeout(() => {\r\n scrollTop()\r\n }, 0)\r\n }, [pathname])\r\n\r\n return (\r\n
\r\n \r\n
\r\n )\r\n}\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport clsx from 'clsx'\r\nimport React, {FC} from 'react'\r\nimport {useLayout} from '../../core'\r\nimport {DefaultTitle} from '../header/page-title/DefaultTitle'\r\n\r\nconst Toolbar1: FC = () => {\r\n const {classes} = useLayout()\r\n\r\n return (\r\n
\r\n {/* begin::Container */}\r\n \r\n \r\n\r\n {/* begin::Actions */}\r\n
\r\n {/* begin::Wrapper */}\r\n
\r\n {/* end::Wrapper */}\r\n
\r\n {/* end::Actions */}\r\n
\r\n {/* end::Container */}\r\n \r\n )\r\n}\r\n\r\nexport {Toolbar1}\r\n","import React from 'react'\r\nimport {useLayout} from '../../core/LayoutProvider'\r\nimport {Toolbar1} from './Toolbar1'\r\n\r\nconst Toolbar = () => {\r\n const {config} = useLayout()\r\n\r\n switch (config.toolbar.layout) {\r\n case 'toolbar1':\r\n return \r\n\r\n default:\r\n return \r\n }\r\n}\r\n\r\nexport {Toolbar}\r\n","import React, {useEffect} from 'react'\r\nimport {useLocation} from 'react-router'\r\nimport clsx from 'clsx'\r\nimport {useLayout} from '../core'\r\nimport {DrawerComponent} from '../../assets/ts/components'\r\n\r\nconst Content: React.FC = ({children}) => {\r\n const {classes} = useLayout()\r\n const location = useLocation()\r\n useEffect(() => {\r\n DrawerComponent.hideAll()\r\n }, [location])\r\n\r\n return (\r\n
\r\n {children}\r\n
\r\n )\r\n}\r\n\r\nexport {Content}\r\n","import React, {useEffect} from 'react'\r\nimport {AsideDefault} from './components/aside/AsideDefault'\r\nimport {Footer} from './components/Footer'\r\nimport {HeaderWrapper} from './components/header/HeaderWrapper'\r\nimport {ScrollTop} from './components/ScrollTop'\r\nimport {Toolbar} from './components/toolbar/Toolbar'\r\nimport {Content} from './components/Content'\r\nimport {PageDataProvider} from './core'\r\nimport {useLocation} from 'react-router-dom'\r\nimport {MenuComponent} from '../assets/ts/components'\r\n\r\nconst MasterLayout: React.FC = ({children}) => {\r\n const location = useLocation()\r\n useEffect(() => {\r\n setTimeout(() => {\r\n MenuComponent.reinitialization()\r\n }, 500)\r\n }, [])\r\n\r\n useEffect(() => {\r\n setTimeout(() => {\r\n MenuComponent.reinitialization()\r\n }, 500)\r\n }, [location.key])\r\n\r\n return (\r\n \r\n
\r\n \r\n
\r\n \r\n\r\n
\r\n \r\n
\r\n {children}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n )\r\n}\r\n\r\nexport {MasterLayout}\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React from 'react'\r\nimport {KTSVG, toAbsoluteUrl} from '../../../helpers'\r\nimport {Dropdown1} from '../../content/dropdown/Dropdown1'\r\n\r\ntype Props = {\r\n className: string\r\n}\r\n\r\nconst TablesWidget1: React.FC = ({className}) => {\r\n return (\r\n
\r\n {/* begin::Header */}\r\n
\r\n

\r\n Tasks Overview\r\n Pending 10 tasks\r\n

\r\n
\r\n {/* begin::Menu */}\r\n \r\n \r\n \r\n {/* begin::Menu 1 */}\r\n \r\n {/* end::Menu 1 */}\r\n {/* end::Menu */}\r\n
\r\n
\r\n {/* end::Header */}\r\n {/* begin::Body */}\r\n
\r\n {/* begin::Table container */}\r\n
\r\n {/* begin::Table */}\r\n \r\n {/* begin::Table head */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* end::Table head */}\r\n {/* begin::Table body */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* end::Table body */}\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n Top Authors\r\n \r\n Successful Fellas\r\n \r\n
\r\n
\r\n 70%\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n Popular Authors\r\n \r\n Most Successful\r\n \r\n
\r\n
\r\n 50%\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n New Users\r\n \r\n Awesome Users\r\n \r\n
\r\n
\r\n 80%\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n Active Customers\r\n \r\n Best Customers\r\n \r\n
\r\n
\r\n 90%\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n Bestseller Theme\r\n \r\n Amazing Templates\r\n \r\n
\r\n
\r\n 70%\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n {/* end::Table */}\r\n
\r\n {/* end::Table container */}\r\n
\r\n
\r\n )\r\n}\r\n\r\nexport {TablesWidget1}\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport {useState} from 'react'\r\nimport {Card, Col, Button} from 'react-bootstrap-v5'\r\nimport {Link, useHistory} from 'react-router-dom'\r\nimport {Row} from 'react-bootstrap-v5'\r\nimport {getLabelRequest} from '../../utils/statusRequest'\r\n\r\nconst Peticion = ({request, userInfo, back = '/dashboard'}) => {\r\n const history = useHistory()\r\n const [hover, setHover] = useState(false)\r\n\r\n let cardStructure = {\r\n //header: ,\r\n header: '',\r\n title: 'Pedir informe de solvencia ',\r\n body: 'Dispones de - informes',\r\n footer: '',\r\n icon: 'fa fa-',\r\n id: 0,\r\n }\r\n\r\n if (request) {\r\n cardStructure.title = request.provisionalName + ' ' + request.provisionalSurnames\r\n cardStructure.id = request.id\r\n cardStructure.footer = 'El ' + request.createdAt\r\n cardStructure.header = ''\r\n cardStructure.body = getLabelRequest(request.status)\r\n }\r\n\r\n if (userInfo && !request) {\r\n cardStructure.body = 'Dispones de ' + userInfo.nAvailableReports + ' informes'\r\n }\r\n\r\n return (\r\n \r\n {\r\n setHover(true)\r\n }}\r\n onMouseLeave={() => {\r\n setHover(false)\r\n }}\r\n style={{height: 200, cursor: 'pointer', backgroundColor: !hover ? '#2d3847' : '#191f28'}}\r\n key={cardStructure.id}\r\n onClick={() => {\r\n if (!request) {\r\n history.push('/request/new')\r\n } else {\r\n history.push('/requests/' + cardStructure.id + '?back=' + back)\r\n }\r\n }}\r\n >\r\n \r\n \r\n {cardStructure.header} {cardStructure.title}\r\n \r\n {request && (\r\n \r\n \r\n Solicitado por:{' '}\r\n \r\n {request?.cte_name} {request?.cte_surnames}{' '}\r\n \r\n \r\n )}\r\n {cardStructure.body}\r\n \r\n {request ? (\r\n \r\n \r\n \r\n \r\n {cardStructure.footer}\r\n \r\n \r\n {request.status === 11 || request.status === 4 ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : request.status === 6 ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n \r\n )\r\n}\r\n\r\nexport {Peticion}\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\n/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React from 'react'\r\nimport {KTSVG} from '../../../helpers'\r\n\r\ntype Props = {\r\n className: string\r\n innerPadding?: string\r\n}\r\n\r\nconst StatsWidget3: React.FC = ({className, innerPadding = ''}) => {\r\n return (\r\n
\r\n {/* begin::Body */}\r\n
\r\n {/* begin::Section */}\r\n
\r\n {/* begin::Symbol */}\r\n
\r\n \r\n \r\n \r\n
\r\n {/* end::Symbol */}\r\n\r\n {/* begin::Title */}\r\n
\r\n \r\n Chat Application\r\n \r\n
HTML, Django
\r\n
\r\n {/* end::Title */}\r\n
\r\n {/* end::Section */}\r\n\r\n {/* begin::Info */}\r\n
\r\n 26 Authors\r\n 140 Comments\r\n
\r\n {/* end::Info */}\r\n\r\n {/* begin::Progress */}\r\n
\r\n
\r\n
\r\n {/* end::Progress */}\r\n
\r\n {/* end::Body */}\r\n \r\n )\r\n}\r\n\r\nexport {StatsWidget3}\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport {useEffect, useState} from 'react'\r\nimport {useIntl} from 'react-intl'\r\nimport {PageTitle} from '../../../_metronic/layout/core'\r\n\r\nimport {Peticion} from '../../../_metronic/partials/widgets'\r\nimport {Row} from 'react-bootstrap-v5'\r\nimport axios from 'axios'\r\nimport {shallowEqual, useSelector} from 'react-redux'\r\nimport {Link, useHistory, useLocation} from 'react-router-dom'\r\nimport useQuery from '../../utils/useQuery'\r\n\r\nconst API_URL = process.env.REACT_APP_API_URL || 'api'\r\nconst API_REQUEST = `${API_URL}/api/v1/requests`\r\n\r\nconst perPage = 14\r\n\r\nconst API_USER_REQUEST = `${API_URL}/api/v1/users`\r\n\r\nconst DashboardPage = () => {\r\n const query = useQuery()\r\n const history = useHistory()\r\n\r\n const [requests, setRequests] = useState([])\r\n const [loading, setLoading] = useState(true)\r\n const [userInfo, setUserInfo] = useState([])\r\n const [errorMessage, setErrorMessage] = useState(query.get('msg'))\r\n const [page, setPage] = useState(query.get('page') * 1 || 1)\r\n const [totalPages, setTotalPages] = useState(0)\r\n\r\n const user = useSelector(({auth}) => auth.user, shallowEqual)\r\n\r\n const location = useLocation()\r\n\r\n function pagination(c, m) {\r\n var current = c,\r\n last = m,\r\n delta = 2,\r\n left = current - delta,\r\n right = current + delta + 1,\r\n range = [],\r\n rangeWithDots = [],\r\n l\r\n\r\n for (let i = 1; i <= last; i++) {\r\n if (i == 1 || i == last || (i >= left && i < right)) {\r\n range.push(i)\r\n }\r\n }\r\n\r\n for (let i of range) {\r\n if (l) {\r\n if (i - l === 2) {\r\n rangeWithDots.push(l + 1)\r\n } else if (i - l !== 1) {\r\n rangeWithDots.push('...')\r\n }\r\n }\r\n rangeWithDots.push(i)\r\n l = i\r\n }\r\n\r\n return rangeWithDots\r\n }\r\n\r\n function renderPageNumbers() {\r\n const pageNumbers = pagination(page, totalPages)\r\n /* const pageNumbers = []\r\n for (let i = 1; i <= totalPages; i++) {\r\n pageNumbers.push(i)\r\n }*/\r\n return pageNumbers.map((number) => {\r\n return (\r\n \r\n {\r\n if (number !== '...') handleClick(number)\r\n }}\r\n >\r\n {number}\r\n \r\n \r\n )\r\n })\r\n }\r\n\r\n function handleClick(newPage) {\r\n // animate scroll to top\r\n window.scrollTo({top: 0, behavior: 'smooth'})\r\n setPage(newPage)\r\n history.push(`?page=${newPage}`)\r\n }\r\n\r\n function renderPager() {\r\n return (\r\n
    \r\n
  • \r\n {\r\n if (page > 1) handleClick(page - 1)\r\n }}\r\n >\r\n «\r\n \r\n
  • \r\n {renderPageNumbers()}\r\n
  • \r\n {\r\n if (page < totalPages) handleClick(page + 1)\r\n }}\r\n >\r\n »\r\n \r\n
  • \r\n
\r\n )\r\n }\r\n\r\n useEffect(() => {\r\n if (location.pathname == '/einforma/error_informe/') {\r\n setErrorMessage('No se ha encontrado un informe para la compra indicada.')\r\n }\r\n }, [])\r\n\r\n useEffect(() => {\r\n setLoading(true)\r\n axios\r\n .get(`${API_REQUEST}?cte_id=${user.id}&order_by=DESC&perPage=${perPage}&page=${page}`)\r\n .then(({data}) => {\r\n const countRequests = data.data\r\n setTotalPages(data.pagination.totalPages)\r\n setRequests(countRequests)\r\n setLoading(false)\r\n })\r\n .catch((e) => {\r\n setLoading(false)\r\n console.error(e)\r\n })\r\n\r\n setLoading(true)\r\n axios\r\n .get(`${API_USER_REQUEST}/${user.id}`)\r\n .then(({data}) => {\r\n delete data.roles\r\n setUserInfo(data)\r\n setLoading(false)\r\n })\r\n .catch((e) => {\r\n setLoading(false)\r\n console.error(e)\r\n })\r\n }, [user.id, page])\r\n\r\n return (\r\n <>\r\n {loading ? (\r\n \r\n ) : (\r\n <>\r\n {errorMessage ? (\r\n
\r\n
{errorMessage}
\r\n
\r\n ) : (\r\n <>\r\n )}\r\n {/* begin::Block */}\r\n
\r\n
\r\n \r\n \r\n \r\n Pincha aquí para ver los informes sobre ti\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n {/* begin::Block */}\r\n \r\n {requests.map((item) => {\r\n return \r\n })}\r\n {/* begin::Block */}\r\n \r\n
\r\n
\r\n \r\n {renderPager()}\r\n \r\n
\r\n
\r\n {/* end::Block */}\r\n \r\n )}\r\n \r\n )\r\n}\r\n\r\nconst DashboardWrapper = () => {\r\n const intl = useIntl()\r\n return (\r\n <>\r\n {intl.formatMessage({id: 'MENU.DASHBOARD'})}\r\n \r\n \r\n )\r\n}\r\n\r\nexport {DashboardWrapper}\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport {useEffect, useState} from 'react'\r\nimport {useIntl} from 'react-intl'\r\nimport {PageTitle} from '../../../_metronic/layout/core'\r\n\r\nimport {Peticion} from '../../../_metronic/partials/widgets'\r\nimport {Row} from 'react-bootstrap-v5'\r\nimport axios from 'axios'\r\nimport {shallowEqual, useSelector} from 'react-redux'\r\nimport {useLocation} from 'react-router-dom'\r\nimport useQuery from '../../utils/useQuery'\r\n\r\nconst API_URL = process.env.REACT_APP_API_URL || 'api'\r\nconst API_REQUEST = `${API_URL}/api/v1/requests`\r\n\r\nconst API_USER_REQUEST = `${API_URL}/api/v1/users`\r\n\r\nconst DashboardConsultadoPage = () => {\r\n const query = useQuery()\r\n\r\n const [requests, setRequests] = useState([])\r\n const [loading, setLoading] = useState(true)\r\n const [userInfo, setUserInfo] = useState([])\r\n const [errorMessage, setErrorMessage] = useState(query.get('msg'))\r\n\r\n const user = useSelector(({auth}) => auth.user, shallowEqual)\r\n\r\n const location = useLocation()\r\n\r\n useEffect(() => {\r\n if (location.pathname == '/einforma/error_informe/') {\r\n setErrorMessage('No se ha encontrado un informe para la compra indicada.')\r\n }\r\n }, [])\r\n\r\n useEffect(() => {\r\n setLoading(true)\r\n axios\r\n .get(`${API_REQUEST}?cdo_id=${user.id}&order_by=DESC&perPage=999999`)\r\n .then(({data}) => {\r\n const countRequests = data.data\r\n setRequests(countRequests)\r\n setLoading(false)\r\n })\r\n .catch((e) => {\r\n setLoading(false)\r\n console.error(e)\r\n })\r\n\r\n setLoading(true)\r\n axios\r\n .get(`${API_USER_REQUEST}/${user.id}`)\r\n .then(({data}) => {\r\n delete data.roles\r\n setUserInfo(data)\r\n setLoading(false)\r\n })\r\n .catch((e) => {\r\n setLoading(false)\r\n console.error(e)\r\n })\r\n }, [user.id])\r\n\r\n return (\r\n <>\r\n {loading ? (\r\n \r\n ) : (\r\n <>\r\n {errorMessage ? (\r\n
\r\n
{errorMessage}
\r\n
\r\n ) : (\r\n <>\r\n )}\r\n {/* begin::Block */}\r\n
\r\n
\r\n \r\n {requests.length === 0 &&

No hay informes solicitados sobre ti

}\r\n {/* begin::Block */}\r\n {requests.map((item) => {\r\n return (\r\n \r\n )\r\n })}\r\n {/* begin::Block */}\r\n
\r\n
\r\n
\r\n {/* end::Block */}\r\n \r\n )}\r\n \r\n )\r\n}\r\n\r\nconst DashboardConsultadoWrapper = () => {\r\n const intl = useIntl()\r\n return (\r\n <>\r\n Informes sobre ti\r\n \r\n \r\n )\r\n}\r\n\r\nexport {DashboardConsultadoWrapper}\r\n","import React, {Suspense, lazy} from 'react'\r\nimport {shallowEqual, useSelector} from 'react-redux'\r\nimport {Redirect, Route, Switch} from 'react-router-dom'\r\nimport {FallbackView} from '../../_metronic/partials'\r\nimport {DashboardWrapper} from '../pages/dashboard/DashboardWrapper'\r\nimport {DashboardConsultadoWrapper} from '../pages/dashboard/DashboardConsultadoWrapper'\r\nimport {RootState} from '../../setup'\r\n\r\nexport function PrivateRoutes() {\r\n const isAuthorized = useSelector(({auth}) => auth.user, shallowEqual)\r\n\r\n const AccountPage = lazy(() => import('../modules/accounts/AccountPage'))\r\n\r\n const RequestsDetailPage = lazy(() => import('../pages/requests/RequestsDetailPage'))\r\n const FormMorososPage = lazy(() => import('../pages/requests/FormMorososPage'))\r\n const NewRequestsPage = lazy(() => import('../pages/requests/NewRequestPage'))\r\n const CompraPage = lazy(() => import('../pages/compra/CompraPage'))\r\n const CompraResultPage = lazy(() => import('../pages/compra/CompraTransactionResult'))\r\n\r\n return (\r\n }>\r\n \r\n \r\n \r\n \r\n {isAuthorized && }\r\n {isAuthorized && }\r\n\r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n","import {FC} from 'react'\r\n\r\nconst Error500: FC = () => {\r\n return (\r\n <>\r\n

System Error

\r\n\r\n
\r\n Something went wrong!
Please try again later.\r\n
\r\n \r\n )\r\n}\r\n\r\nexport {Error500}\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React from 'react'\r\nimport {Redirect, Route, Switch, useHistory} from 'react-router-dom'\r\nimport {Error500} from './components/Error500'\r\nimport {Error404} from './components/Error404'\r\nimport {toAbsoluteUrl} from '../../../_metronic/helpers'\r\n\r\nconst SSOFailPage = () => {\r\n const history = useHistory()\r\n const redirectToDashboard = () => {\r\n history.push('/')\r\n }\r\n\r\n return (\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n <>\r\n

¡Lo sentimos!

\r\n\r\n
\r\n Ha ocurrido un error al tratar de identificarte como usuario de eInforma.\r\n
\r\n \r\n
\r\n
\r\n Regresa por favor a eInforma y vuelve a\r\n intentar acceder.\r\n
En caso de persistir el problema rogamos ponte en contacto con{' '}\r\n Atención al cliente\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n \r\n \r\n )\r\n}\r\n\r\nexport default SSOFailPage\r\n","import {useEffect, useRef} from 'react'\r\nimport {\r\n MenuComponent,\r\n DrawerComponent,\r\n ScrollComponent,\r\n ScrollTopComponent,\r\n StickyComponent,\r\n ToggleComponent,\r\n SwapperComponent,\r\n} from '../assets/ts/components'\r\n\r\nimport {useLayout} from './core'\r\n\r\nexport function MasterInit() {\r\n const {config} = useLayout()\r\n const isFirstRun = useRef(true)\r\n const pluginsInitialization = () => {\r\n isFirstRun.current = false\r\n setTimeout(() => {\r\n ToggleComponent.bootstrap()\r\n ScrollTopComponent.bootstrap()\r\n DrawerComponent.bootstrap()\r\n StickyComponent.bootstrap()\r\n MenuComponent.bootstrap()\r\n ScrollComponent.bootstrap()\r\n SwapperComponent.bootstrap()\r\n }, 500)\r\n }\r\n\r\n useEffect(() => {\r\n if (isFirstRun.current) {\r\n isFirstRun.current = false\r\n pluginsInitialization()\r\n }\r\n }, [config])\r\n\r\n return <>\r\n}\r\n","/**\r\n * High level router.\r\n *\r\n * Note: It's recommended to compose related routes in internal router\r\n * components (e.g: `src/app/modules/Auth/pages/AuthPage`, `src/app/BasePage`).\r\n */\r\n\r\nimport React, {FC, lazy} from 'react'\r\nimport {Redirect, Switch, Route} from 'react-router-dom'\r\nimport {shallowEqual, useSelector} from 'react-redux'\r\nimport {MasterLayout} from '../../_metronic/layout/MasterLayout'\r\nimport {PrivateRoutes} from './PrivateRoutes'\r\nimport {Logout, AuthPage} from '../modules/auth'\r\nimport SSOFailPage from '../modules/errors/SSOFailPage'\r\nimport {RootState} from '../../setup'\r\nimport {MasterInit} from '../../_metronic/layout/MasterInit'\r\n\r\nconst NewRequestsPage = lazy(() => import('../pages/sso/RequestSSOPage'))\r\n\r\nconst Routes: FC = () => {\r\n const isAuthorized = useSelector(({auth}) => auth.user, shallowEqual)\r\n\r\n const urlParams = new URLSearchParams(window.location.search)\r\n const redirectUrl = urlParams.get('redirectUrl')\r\n\r\n const isCompraResultadoOK = window.location.pathname.includes('/compra/transaction/ok')\r\n const isCompraResultadoError = window.location.pathname.includes('/compra/transaction/error')\r\n\r\n if (isAuthorized && redirectUrl) {\r\n window.location.href = redirectUrl\r\n }\r\n\r\n return (\r\n <>\r\n \r\n {/* Rutas para el SSO en el front */}\r\n \r\n \r\n\r\n {!isAuthorized ? (\r\n /*Render auth page when user at `/auth` and not authorized.*/\r\n \r\n \r\n \r\n ) : (\r\n /*Otherwise redirect to root page (`/`)*/\r\n\r\n \r\n )}\r\n\r\n \r\n\r\n {!isAuthorized ? (\r\n /*Redirect to `/auth` when user is not authorized*/\r\n \r\n ) : (\r\n <>\r\n \r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport {Routes}\r\n","import React, {Suspense} from 'react'\r\nimport {BrowserRouter} from 'react-router-dom'\r\nimport {I18nProvider} from '../_metronic/i18n/i18nProvider'\r\nimport {LayoutProvider, LayoutSplashScreen} from '../_metronic/layout/core'\r\nimport AuthInit from './modules/auth/redux/AuthInit'\r\nimport {Routes} from './routing/Routes'\r\n\r\ntype Props = {\r\n basename: string\r\n}\r\n\r\nconst App: React.FC = ({basename}) => {\r\n return (\r\n }>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport {App}\r\n","export default function setupAxios(axios: any, store: any) {\r\n axios.interceptors.request.use(\r\n (config: any) => {\r\n const {\r\n auth: {accessToken},\r\n } = store.getState()\r\n\r\n if (accessToken) {\r\n config.headers.Authorization = `Bearer ${accessToken}`\r\n }\r\n\r\n return config\r\n },\r\n (err: any) => Promise.reject(err)\r\n )\r\n}\r\n","import React from 'react'\r\nimport ReactDOM from 'react-dom'\r\n// Redux\r\n// https://github.com/rt2zz/redux-persist\r\nimport {PersistGate} from 'redux-persist/integration/react'\r\nimport {Provider} from 'react-redux'\r\nimport * as _redux from './setup'\r\nimport store, {persistor} from './setup/redux/Store'\r\n// Axios\r\nimport axios from 'axios'\r\nimport {Chart, registerables} from 'chart.js'\r\n\r\n// Apps\r\nimport {App} from './app/App'\r\nimport {MetronicI18nProvider} from './_metronic/i18n/Metronici18n'\r\n/**\r\n * TIP: Replace this style import with dark styles to enable dark mode\r\n *\r\n * import './_metronic/assets/sass/style.dark.scss'\r\n *\r\n * TIP: Replace this style import with rtl styles to enable rtl mode\r\n *\r\n * import './_metronic/assets/css/style.rtl.css'\r\n **/\r\nimport './_metronic/assets/sass/style.scss'\r\nimport './_metronic/assets/sass/style.react.scss'\r\nimport {Bugfender} from '@bugfender/sdk'\r\n\r\n/**\r\n * Base URL of the website.\r\n *\r\n * @see https://facebook.github.io/create-react-app/docs/using-the-public-folder\r\n */\r\nconst {PUBLIC_URL} = process.env\r\n\r\n/**\r\n * Inject Metronic interceptors for axios.\r\n *\r\n * @see https://github.com/axios/axios#interceptors\r\n */\r\n_redux.setupAxios(axios, store)\r\n\r\nChart.register(...registerables)\r\n\r\nBugfender.init({\r\n appKey: 'lbWddGln0KSiKVT9AG3A02YeJ1ZvkxHc',\r\n version: process.env.REACT_APP_VERSION,\r\n})\r\n\r\nReactDOM.render(\r\n \r\n \r\n {/* Asynchronously persist redux stores and show `SplashScreen` while it's loading. */}\r\n Cargando...}>\r\n \r\n \r\n \r\n ,\r\n document.getElementById('root')\r\n)\r\n","import {\r\n IAside,\r\n IContent,\r\n IFooter,\r\n IHeader,\r\n IToolbar,\r\n ILayout,\r\n ILayoutCSSClasses,\r\n ILayoutHTMLAttributes,\r\n ILayoutCSSVariables,\r\n IPageTitle,\r\n} from './LayoutModels'\r\nimport {DefaultLayoutConfig} from './DefaultLayoutConfig'\r\n\r\nconst LAYOUT_CONFIG_KEY = process.env.REACT_APP_BASE_LAYOUT_CONFIG_KEY || 'LayoutConfig'\r\n\r\nexport function getLayout(): ILayout {\r\n const ls = localStorage.getItem(LAYOUT_CONFIG_KEY)\r\n if (ls) {\r\n try {\r\n return JSON.parse(ls) as ILayout\r\n } catch (er) {\r\n console.error(er)\r\n }\r\n }\r\n return DefaultLayoutConfig\r\n}\r\n\r\nfunction setLayout(config: ILayout): void {\r\n try {\r\n localStorage.setItem(LAYOUT_CONFIG_KEY, JSON.stringify(config))\r\n } catch (er) {\r\n console.error(er)\r\n }\r\n}\r\n\r\nexport function getEmptyCssClasses() {\r\n return {\r\n header: [],\r\n headerContainer: [],\r\n headerMobile: [],\r\n headerMenu: [],\r\n aside: [],\r\n asideMenu: [],\r\n asideToggle: [],\r\n toolbar: [],\r\n toolbarContainer: [],\r\n content: [],\r\n contentContainer: [],\r\n footerContainer: [],\r\n sidebar: [],\r\n pageTitle: [],\r\n }\r\n}\r\n\r\nexport function getEmptyHTMLAttributes() {\r\n return {\r\n asideMenu: new Map(),\r\n headerMobile: new Map(),\r\n headerMenu: new Map(),\r\n headerContainer: new Map(),\r\n pageTitle: new Map(),\r\n }\r\n}\r\n\r\nexport function getEmptyCSSVariables() {\r\n return {\r\n body: new Map(),\r\n }\r\n}\r\n\r\nexport class LayoutSetup {\r\n public static isLoaded: boolean = false\r\n public static config: ILayout = getLayout()\r\n public static classes: ILayoutCSSClasses = getEmptyCssClasses()\r\n public static attributes: ILayoutHTMLAttributes = getEmptyHTMLAttributes()\r\n public static cssVariables: ILayoutCSSVariables = getEmptyCSSVariables()\r\n\r\n private static initCSSClasses(): void {\r\n LayoutSetup.classes = getEmptyCssClasses()\r\n }\r\n\r\n private static initHTMLAttributes(): void {\r\n LayoutSetup.attributes = Object.assign({}, getEmptyHTMLAttributes())\r\n }\r\n\r\n private static initCSSVariables(): void {\r\n LayoutSetup.cssVariables = getEmptyCSSVariables()\r\n }\r\n\r\n private static initLayout(config: ILayout): void {\r\n Array.from(document.body.attributes).forEach((attr) => {\r\n document.body.removeAttribute(attr.name)\r\n })\r\n document.body.setAttribute('style', '')\r\n document.body.setAttribute('id', 'kt_body')\r\n if (config.main?.body?.backgroundImage) {\r\n document.body.style.backgroundImage = `url('${config.main.body.backgroundImage}')`\r\n }\r\n\r\n if (config.main?.body?.class) {\r\n document.body.classList.add(config.main.body.class)\r\n }\r\n\r\n // if (config.loader.display) {\r\n // document.body.classList.add('page-loading')\r\n // document.body.classList.add('page-loading-enabled')\r\n // }\r\n }\r\n\r\n private static initHeader(config: IHeader): void {\r\n LayoutSetup.classes.headerContainer.push(\r\n config.width === 'fluid' ? 'container-fluid' : 'container'\r\n )\r\n\r\n if (config.fixed.desktop) {\r\n document.body.classList.add('header-fixed')\r\n }\r\n\r\n if (config.fixed.tabletAndMobile) {\r\n document.body.classList.add('header-tablet-and-mobile-fixed')\r\n }\r\n }\r\n\r\n private static initToolbar(config: IToolbar): void {\r\n if (!config.display) {\r\n return\r\n }\r\n\r\n document.body.classList.add('toolbar-enabled')\r\n LayoutSetup.classes.toolbarContainer.push(\r\n config.width === 'fluid' ? 'container-fluid' : 'container'\r\n )\r\n\r\n if (config.fixed.desktop) {\r\n document.body.classList.add('toolbar-fixed')\r\n }\r\n\r\n if (config.fixed.tabletAndMobileMode) {\r\n document.body.classList.add('toolbar-tablet-and-mobile-fixed')\r\n }\r\n\r\n // Height setup\r\n const type = config.layout\r\n const typeOptions = config.layouts[type]\r\n if (typeOptions) {\r\n let bodyStyles: string = ''\r\n if (typeOptions.height) {\r\n bodyStyles += ` --kt-toolbar-height: ${typeOptions.height};`\r\n }\r\n\r\n if (typeOptions.heightAndTabletMobileMode) {\r\n bodyStyles += ` --kt-toolbar-height-tablet-and-mobile: ${typeOptions.heightAndTabletMobileMode};`\r\n }\r\n document.body.setAttribute('style', bodyStyles)\r\n }\r\n }\r\n\r\n private static initPageTitle(config: IPageTitle): void {\r\n if (!config.display) {\r\n return\r\n }\r\n\r\n if (config.direction === 'column') {\r\n this.classes.pageTitle.push('flex-column')\r\n this.classes.pageTitle.push('align-items-start')\r\n } else {\r\n this.classes.pageTitle.push('align-items-center')\r\n this.classes.pageTitle.push('flex-wrap')\r\n }\r\n this.classes.pageTitle.push('me-3')\r\n\r\n if (config.responsive) {\r\n this.classes.pageTitle.push('mb-5')\r\n this.classes.pageTitle.push('mb-lg-0')\r\n\r\n LayoutSetup.attributes.pageTitle.set('data-kt-swapper', true)\r\n LayoutSetup.attributes.pageTitle.set('data-kt-swapper-mode', 'prepend')\r\n LayoutSetup.attributes.pageTitle.set(\r\n 'data-kt-swapper-parent',\r\n `{ default: '#kt_content_container', '${config.responsiveBreakpoint}': '${config.responsiveTarget}'}`\r\n )\r\n }\r\n }\r\n\r\n private static initContent(config: IContent): void {\r\n LayoutSetup.classes.contentContainer.push(\r\n config.width === 'fluid' ? 'container-fluid' : 'container'\r\n )\r\n // if (Theme::getOption('layout', 'content/container-class')) {\r\n // \tTheme::addHtmlClass('content-container', Theme::getOption('layout', 'content/container-class'));\r\n // }\r\n }\r\n\r\n private static initAside(config: IAside): void {\r\n // Check if aside is displayed\r\n if (!config.display) {\r\n return\r\n }\r\n\r\n // Enable Aside\r\n document.body.classList.add('aside-enabled')\r\n LayoutSetup.classes.aside.push(`aside-${config.theme}`)\r\n\r\n // Fixed Aside\r\n if (config.fixed) {\r\n document.body.classList.add('aside-fixed')\r\n }\r\n\r\n // Default minimized\r\n if (config.minimized) {\r\n document.body.setAttribute('data-kt-aside-minimize', 'on')\r\n }\r\n\r\n // Hoverable on minimize\r\n if (config.hoverable) {\r\n LayoutSetup.classes.aside.push('aside-hoverable')\r\n }\r\n }\r\n\r\n private static initAsideMenu(config: IAside): void {\r\n // if (Theme::getOption('layout', 'aside/menu') === 'documentation') {\r\n // \tself::$menu = new Menu( Theme::getOption('menu', 'documentation'), Theme::getPagePath() );\r\n // } else {\r\n // \tself::$menu = new Menu( Theme::getOption('menu', 'main'), Theme::getPagePath() );\r\n // }\r\n // if (Theme::getOption('layout', 'aside/menu-icons-display') === false) {\r\n // \tself::$menu->displayIcons(false);\r\n // }\r\n // self::$menu->setIconType(Theme::getOption('layout', 'aside/menu-icon'));\r\n }\r\n\r\n // private static initSidebar(sidebarConfig: ISidebarConfig): void {\r\n // // / Set Sidebar enabled class\r\n // if (sidebarConfig.display) {\r\n // document.body.classList.add('sidebar-enabled')\r\n // } else {\r\n // return\r\n // }\r\n\r\n // // Set Sidebar shown status\r\n // if (sidebarConfig.shown) {\r\n // document.body.setAttribute('data-sidebar', 'on')\r\n // }\r\n\r\n // // Set Sidebar background color class\r\n // ThemeSetup.classes.sidebar.push(sidebarConfig.bgColor)\r\n // }\r\n\r\n private static initFooter(config: IFooter): void {\r\n LayoutSetup.classes.footerContainer.push(`container${config.width === 'fluid' ? '-fluid' : ''}`)\r\n }\r\n\r\n private static initConfig(config: ILayout): void {\r\n if (config.main?.darkSkinEnabled) {\r\n document.body.classList.add('dark-skin')\r\n }\r\n\r\n // Init layout\r\n LayoutSetup.initLayout(config)\r\n if (config.main?.type !== 'default') {\r\n return\r\n }\r\n\r\n LayoutSetup.initHeader(config.header)\r\n LayoutSetup.initPageTitle(config.pageTitle as IPageTitle)\r\n LayoutSetup.initToolbar(config.toolbar)\r\n LayoutSetup.initContent(config.content)\r\n LayoutSetup.initAside(config.aside)\r\n LayoutSetup.initFooter(config.footer)\r\n LayoutSetup.initAsideMenu(config.aside)\r\n }\r\n\r\n public static updatePartialConfig(fieldsToUpdate: Partial): ILayout {\r\n const config = LayoutSetup.config\r\n const updatedConfig = {...config, ...fieldsToUpdate}\r\n LayoutSetup.initCSSClasses()\r\n LayoutSetup.initCSSVariables()\r\n LayoutSetup.initHTMLAttributes()\r\n LayoutSetup.isLoaded = false\r\n LayoutSetup.config = updatedConfig\r\n LayoutSetup.initConfig(Object.assign({}, updatedConfig))\r\n LayoutSetup.isLoaded = true // remove loading there\r\n return updatedConfig\r\n }\r\n\r\n public static setConfig(config: ILayout): void {\r\n setLayout(config)\r\n }\r\n\r\n public static bootstrap = (() => {\r\n LayoutSetup.updatePartialConfig(LayoutSetup.config)\r\n })()\r\n}\r\n","import {Action} from '@reduxjs/toolkit'\r\nimport {persistReducer} from 'redux-persist'\r\nimport session from 'redux-persist/lib/storage/session'\r\nimport {put, takeLatest} from 'redux-saga/effects'\r\nimport {UserModel} from '../models/UserModel'\r\nimport {getUserByToken} from './AuthCRUD'\r\n\r\nexport interface ActionWithPayload extends Action {\r\n payload?: T\r\n}\r\n\r\nexport const actionTypes = {\r\n Login: '[Login] Action',\r\n Logout: '[Logout] Action',\r\n Register: '[Register] Action',\r\n UserRequested: '[Request User] Action',\r\n UserLoaded: '[Load User] Auth API',\r\n SetUser: '[Set User] Action',\r\n UpdateReports: '[Update Reports] Action',\r\n}\r\n\r\nconst initialAuthState: IAuthState = {\r\n user: undefined,\r\n accessToken: undefined,\r\n}\r\n\r\nexport interface IAuthState {\r\n user?: UserModel\r\n accessToken?: string\r\n nAvailableReports?: number\r\n}\r\n\r\nexport const reducer = persistReducer(\r\n {storage: session, key: 'ibercheck', whitelist: ['user', 'accessToken', 'nAvailableReports']},\r\n (state: IAuthState = initialAuthState, action: ActionWithPayload) => {\r\n switch (action.type) {\r\n case actionTypes.Login: {\r\n const accessToken = action.payload?.accessToken\r\n return {accessToken, user: undefined}\r\n }\r\n\r\n case actionTypes.Register: {\r\n const accessToken = action.payload?.accessToken\r\n return {accessToken, user: undefined}\r\n }\r\n\r\n case actionTypes.Logout: {\r\n return initialAuthState\r\n }\r\n\r\n case actionTypes.UserRequested: {\r\n return {...state, user: undefined, nAvailableReports: undefined}\r\n }\r\n\r\n case actionTypes.UserLoaded: {\r\n const user = action.payload?.user\r\n return {...state, user, nAvailableReports: user.nAvailableReports}\r\n }\r\n case actionTypes.UpdateReports: { \r\n const nAvailableReports = action.payload?.user.nAvailableReports\r\n return {...state, nAvailableReports: nAvailableReports}\r\n }\r\n\r\n case actionTypes.SetUser: {\r\n const user = action.payload?.user\r\n return {...state, user, nAvailableReports: user.nAvailableReports}\r\n }\r\n\r\n default:\r\n return state\r\n }\r\n }\r\n)\r\n\r\nexport const actions = {\r\n login: (accessToken: string) => ({type: actionTypes.Login, payload: {accessToken}}),\r\n register: (accessToken: string) => ({\r\n type: actionTypes.Register,\r\n payload: {accessToken},\r\n }),\r\n logout: () => ({type: actionTypes.Logout}),\r\n requestUser: () => ({\r\n type: actionTypes.UserRequested,\r\n }),\r\n fulfillUser: (user: UserModel) => ({type: actionTypes.UserLoaded, payload: {user}}),\r\n setUser: (user: UserModel) => ({type: actionTypes.SetUser, payload: {user}}),\r\n}\r\n\r\nexport function* saga() {\r\n yield takeLatest(actionTypes.Login, function* loginSaga() {\r\n yield put(actions.requestUser())\r\n })\r\n\r\n yield takeLatest(actionTypes.Register, function* registerSaga() {\r\n yield put(actions.requestUser())\r\n })\r\n\r\n yield takeLatest(actionTypes.UserRequested, function* userRequested() {\r\n const {data: user} = yield getUserByToken()\r\n \r\n user.firstname = user.name\r\n user.lastname = user.surnames\r\n yield put(actions.fulfillUser(user))\r\n })\r\n}\r\n","import axios from 'axios'\r\nimport {AuthModel} from '../models/AuthModel'\r\nimport {UserModel} from '../models/UserModel'\r\n\r\nconst API_URL = process.env.REACT_APP_API_URL || 'api'\r\n\r\nexport const GET_USER_BY_ACCESSTOKEN_URL = `${API_URL}/api/v1/users/get-user`\r\nexport const LOGIN_URL = `${API_URL}/login`\r\nexport const REGISTER_URL = `${API_URL}/register`\r\nexport const REQUEST_PASSWORD_URL = `${API_URL}/forgot-password`\r\n\r\n\r\n\r\n// Server should return AuthModel\r\nexport function login(email: string, password: string, token: string) {\r\n return axios.post(LOGIN_URL, {email, password, role: \"ROLE_USER\"})\r\n}\r\n\r\n// Server should return AuthModel\r\nexport function register(email: string, firstname: string, lastname: string, password: string) {\r\n return axios.post(REGISTER_URL, {\r\n email,\r\n firstname,\r\n lastname,\r\n password,\r\n })\r\n}\r\n\r\n// Server should return object => { result: boolean } (Is Email in DB)\r\nexport function requestPassword(email: string) {\r\n return axios.post<{result: boolean}>(REQUEST_PASSWORD_URL, {email})\r\n}\r\n\r\nexport function getUserByToken() {\r\n // Authorization head should be fulfilled in interceptor.\r\n // Check common redux folder => setupAxios\r\n return axios.get(GET_USER_BY_ACCESSTOKEN_URL)\r\n}\r\n","import React, {useState} from 'react'\r\nimport * as Yup from 'yup'\r\nimport clsx from 'clsx'\r\nimport {Link} from 'react-router-dom'\r\nimport {useFormik} from 'formik'\r\nimport {requestPassword} from '../redux/AuthCRUD'\r\nimport useQuery from '../../../utils/useQuery'\r\n\r\nconst initialValues = {\r\n email: '',\r\n}\r\n\r\nconst forgotPasswordSchema = Yup.object().shape({\r\n email: Yup.string()\r\n .email('Fromato inválido')\r\n .required('El email es requerido'),\r\n})\r\n\r\nexport function ForgotPassword() {\r\n const query = useQuery() \r\n\r\n const [loading, setLoading] = useState(false)\r\n const [hasErrors, setHasErrors] = useState(undefined)\r\n \r\n \r\n const [messageError, setMessageError] = useState(query.get('msg'))\r\n const formik = useFormik({\r\n initialValues,\r\n validationSchema: forgotPasswordSchema,\r\n onSubmit: (values, {setStatus, setSubmitting}) => {\r\n setLoading(true)\r\n setHasErrors(undefined)\r\n setTimeout(() => {\r\n requestPassword(values.email)\r\n .then(({data: {result}}) => {\r\n setHasErrors(false)\r\n setLoading(false)\r\n })\r\n .catch(() => {\r\n setHasErrors(true)\r\n setLoading(false)\r\n setSubmitting(false)\r\n setStatus(`El email '${values.email}' no está siendo utilizado por ningún usuario`)\r\n })\r\n }, 1000)\r\n },\r\n })\r\n\r\n return (\r\n <>\r\n \r\n
\r\n {/* begin::Title */}\r\n

Recuperar contraseña

\r\n {/* end::Title */}\r\n\r\n {/* begin::Link */}\r\n
Introduce tu correo electrónico y te enviaremos las instrucciones para recuperar el acceso
\r\n {/* end::Link */}\r\n
\r\n\r\n {/* begin::Title */}\r\n {hasErrors === true && (\r\n
\r\n
\r\n El email '{formik.values.email}' no está siendo utilizado por ningún usuario\r\n
\r\n
\r\n )}\r\n\r\n{messageError && (\r\n
\r\n
\r\n {messageError}\r\n
\r\n
\r\n )}\r\n\r\n {hasErrors === false && (\r\n
\r\n
Se te ha enviado un mail con las instrucciones para recuperar tu cuenta. Si no lo encuentras, por favor revisa la carpeta de \"spam\".
\r\n
\r\n )}\r\n {/* end::Title */}\r\n\r\n {/* begin::Form group */}\r\n
\r\n \r\n {\r\n if (hasErrors){\r\n setHasErrors(undefined)\r\n }\r\n if (messageError) {\r\n setMessageError(null)\r\n }\r\n }}\r\n className={clsx(\r\n 'form-control form-control-lg form-control-solid',\r\n {'is-invalid': formik.touched.email && formik.errors.email},\r\n {\r\n 'is-valid': formik.touched.email && !formik.errors.email,\r\n }\r\n )}\r\n />\r\n {formik.touched.email && formik.errors.email && (\r\n
\r\n
\r\n {formik.errors.email}\r\n
\r\n
\r\n )}\r\n
\r\n {/* end::Form group */}\r\n\r\n {/* begin::Form group */}\r\n
\r\n \r\n Enviar\r\n {loading && (\r\n \r\n Por favor, espere...\r\n \r\n \r\n )}\r\n \r\n \r\n \r\n Cancelar\r\n \r\n {' '}\r\n
\r\n {/* end::Form group */}\r\n \r\n \r\n )\r\n}\r\n","import {useEffect} from 'react'\nimport {useParams} from 'react-router-dom'\nimport axios from 'axios'\nimport {useDispatch} from 'react-redux'\nimport * as auth from '../redux/AuthRedux'\n\nconst API_URL = process.env.REACT_APP_API_URL || 'api'\nconst API_REQUEST = `${API_URL}/api/v1/reset-password`\n\nexport function ForgotPasswordReset() {\n \n\n let {token} = useParams();\n const dispatch = useDispatch();\n\n useEffect(() => {\n if(token){\n axios\n // check token\n .post(`${API_REQUEST}`,{\n token, \n })\n .then(({data}) => {\n const accessToken = data.access_token;\n dispatch(auth.actions.login(accessToken))\n // todo ok sso \n window.location.href = \"/account/me/login/edit\";\n \n })\n .catch((e) => {\n console.error(e)\n // sino a /auth/forgot-password\n window.location.href = \"/auth/forgot-password?msg=El enlace ha expirado\"\n })\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [token]);\n\n \n\n return (\n <>\n Comprobando datos... \n \n )\n}\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React, {useCallback, useEffect, useRef, useState} from 'react'\r\nimport {shallowEqual, useDispatch, useSelector} from 'react-redux'\r\nimport * as Yup from 'yup'\r\nimport clsx from 'clsx'\r\nimport {Link} from 'react-router-dom'\r\nimport {useFormik} from 'formik'\r\nimport * as auth from '../redux/AuthRedux'\r\nimport {login} from '../redux/AuthCRUD'\r\nimport {RootState} from '../../../../setup'\r\n\r\nconst loginSchema = Yup.object().shape({\r\n email: Yup.string()\r\n .email('Formato incorrecto de email')\r\n .min(3, 'Mínimo 3 letras')\r\n .max(50, 'Máximo 50 letras')\r\n .required('Email requerido'),\r\n password: Yup.string()\r\n .min(3, 'Mínimo 3 letras')\r\n .max(50, 'Máximo 50 letras')\r\n .required('Contraseña requerida'),\r\n})\r\n\r\nconst initialValues = {\r\n email: '',\r\n password: '',\r\n}\r\n\r\n/*\r\n Formik+YUP+Typescript:\r\n https://jaredpalmer.com/formik/docs/tutorial#getfieldprops\r\n https://medium.com/@maurice.de.beijer/yup-validation-and-typescript-and-formik-6c342578a20e\r\n*/\r\n\r\nexport function Login({isCompraResultadoOK = false, isCompraResultadoError = false}) {\r\n const [loading, setLoading] = useState(false)\r\n const [token, setToken] = useState(null)\r\n const dispatch = useDispatch()\r\n\r\n const urlParams = new URLSearchParams(window.location.search)\r\n const accessToken = urlParams.get('accessToken')\r\n const redirectUrl = urlParams.get('redirectUrl')\r\n\r\n useEffect(() => {\r\n if (accessToken) {\r\n dispatch(auth.actions.login(accessToken))\r\n window.location.href = redirectUrl\r\n }\r\n }, [accessToken, dispatch, redirectUrl])\r\n\r\n if (accessToken) {\r\n return 'Ingresando...'\r\n }\r\n\r\n const formik = useFormik({\r\n initialValues,\r\n validationSchema: loginSchema,\r\n onSubmit: (values, {setStatus, setSubmitting}) => {\r\n setLoading(true)\r\n login(values.email, values.password, token)\r\n .then(({data: {accessToken}}) => {\r\n setLoading(false)\r\n dispatch(auth.actions.login(accessToken))\r\n })\r\n .catch(() => {\r\n setLoading(false)\r\n setSubmitting(false)\r\n setStatus('Ingreso incorrecto')\r\n })\r\n },\r\n })\r\n\r\n return (\r\n \r\n {isCompraResultadoOK && (\r\n
\r\n
\r\n Su compra se ha realizado correctamente. Por favor, inicie sesión.\r\n
\r\n
\r\n )}\r\n\r\n {isCompraResultadoError && (\r\n
\r\n
\r\n Su compra ha fallado. Por favor, intentelo de nuevo o inicie sesión.\r\n
\r\n
\r\n )}\r\n\r\n {/* begin::Heading */}\r\n
\r\n

Ingresar

\r\n
\r\n {/* begin::Heading */}\r\n\r\n {formik.status ? (\r\n
\r\n
{formik.status}
\r\n
\r\n ) : (\r\n <>\r\n )}\r\n\r\n {/* begin::Form group */}\r\n
\r\n \r\n \r\n {formik.touched.email && formik.errors.email && (\r\n
\r\n {formik.errors.email}\r\n
\r\n )}\r\n
\r\n {/* end::Form group */}\r\n\r\n {/* begin::Form group */}\r\n
\r\n
\r\n
\r\n {/* begin::Label */}\r\n \r\n {/* end::Label */}\r\n {/* begin::Link */}\r\n \r\n Recuperar contraseña\r\n \r\n {/* end::Link */}\r\n
\r\n
\r\n \r\n {formik.touched.password && formik.errors.password && (\r\n
\r\n
\r\n {formik.errors.password}\r\n
\r\n
\r\n )}\r\n
\r\n {/* end::Form group */}\r\n\r\n {/* begin::Action */}\r\n
\r\n \r\n {!loading && Login}\r\n {loading && (\r\n \r\n Por favor, espere...\r\n \r\n \r\n )}\r\n \r\n
\r\n {/* end::Action */}\r\n\r\n
\r\n\r\n
\r\n
\r\n \r\n Acceso usuarios eINFORMA\r\n \r\n
\r\n
\r\n \r\n )\r\n}\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\n// @ts-nocheck\r\nimport React, {lazy, useEffect, useRef} from 'react'\r\nimport {Redirect, Route, Switch} from 'react-router-dom'\r\nimport {ForgotPassword} from './components/ForgotPassword'\r\nimport {ForgotPasswordReset} from './components/ForgotPasswordReset'\r\nimport {Login} from './components/Login'\r\nimport {toAbsoluteUrl} from '../../../_metronic/helpers'\r\n\r\nconst CompraPageAnonimo = lazy(() => import('../../pages/compra/CompraPageAnonimo'))\r\n\r\nexport function AuthPage({isCompraResultadoOK = false, isCompraResultadoError = false}) {\r\n const redirectUrl = useRef('')\r\n\r\n const urlParams = new URLSearchParams(window.location.search)\r\n const accessToken = urlParams.get('access_token')\r\n\r\n if (accessToken) {\r\n redirectUrl.current = document.location.pathname\r\n }\r\n\r\n useEffect(() => {\r\n document.body.classList.add('bg-white')\r\n return () => {\r\n document.body.classList.remove('bg-white')\r\n }\r\n }, [])\r\n\r\n return (\r\n \r\n {/* begin::Content */}\r\n
\r\n {/* begin::Logo */}\r\n \r\n Logo\r\n \r\n {/* end::Logo */}\r\n {/* begin::Wrapper */}\r\n
\r\n \r\n (\r\n \r\n )}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n {/* end::Wrapper */}\r\n
\r\n {/* end::Content */}\r\n \r\n )\r\n}\r\n","import {toAbsoluteUrl} from '../../../../_metronic/helpers'\r\nimport {UserModel} from '../models/UserModel'\r\n\r\nexport class UsersTableMock {\r\n public static table: Array = [\r\n {\r\n id: 1,\r\n username: 'admin',\r\n password: 'demo',\r\n email: 'admin@demo.com',\r\n auth: {\r\n accessToken: 'access-token-8f3ae836da744329a6f93bf20594b5cc',\r\n refreshToken: 'access-token-f8c137a2c98743f48b643e71161d90aa',\r\n },\r\n roles: [1], // Administrator\r\n pic: toAbsoluteUrl('/media/avatars/150-2.jpg'),\r\n fullname: 'Sean S',\r\n firstname: 'Sean',\r\n lastname: 'Stark',\r\n occupation: 'CEO',\r\n companyName: 'Keenthemes',\r\n phone: '456669067890',\r\n language: 'en',\r\n timeZone: 'International Date Line West',\r\n website: 'https://keenthemes.com',\r\n emailSettings: {\r\n emailNotification: true,\r\n sendCopyToPersonalEmail: false,\r\n activityRelatesEmail: {\r\n youHaveNewNotifications: false,\r\n youAreSentADirectMessage: false,\r\n someoneAddsYouAsAsAConnection: true,\r\n uponNewOrder: false,\r\n newMembershipApproval: false,\r\n memberRegistration: true,\r\n },\r\n updatesFromKeenthemes: {\r\n newsAboutKeenthemesProductsAndFeatureUpdates: false,\r\n tipsOnGettingMoreOutOfKeen: false,\r\n thingsYouMissedSindeYouLastLoggedIntoKeen: true,\r\n newsAboutStartOnPartnerProductsAndOtherServices: true,\r\n tipsOnStartBusinessProducts: true,\r\n },\r\n },\r\n communication: {\r\n email: true,\r\n sms: true,\r\n phone: false,\r\n },\r\n address: {\r\n addressLine: 'L-12-20 Vertex, Cybersquare',\r\n city: 'San Francisco',\r\n state: 'California',\r\n postCode: '45000',\r\n },\r\n socialNetworks: {\r\n linkedIn: 'https://linkedin.com/admin',\r\n facebook: 'https://facebook.com/admin',\r\n twitter: 'https://twitter.com/admin',\r\n instagram: 'https://instagram.com/admin',\r\n },\r\n },\r\n {\r\n id: 2,\r\n username: 'user',\r\n password: 'demo',\r\n email: 'user@demo.com',\r\n auth: {\r\n accessToken: 'access-token-6829bba69dd3421d8762-991e9e806dbf',\r\n refreshToken: 'access-token-f8e4c61a318e4d618b6c199ef96b9e55',\r\n },\r\n roles: [2], // Manager\r\n pic: toAbsoluteUrl('/media/avatars/150-1.jpg'),\r\n fullname: 'Megan F',\r\n firstname: 'Megan',\r\n lastname: 'Fox',\r\n occupation: 'Deputy Head of Keenthemes in New York office',\r\n companyName: 'Keenthemes',\r\n phone: '456669067891',\r\n language: 'en',\r\n timeZone: 'International Date Line West',\r\n communication: {\r\n email: true,\r\n sms: true,\r\n phone: false,\r\n },\r\n emailSettings: {\r\n emailNotification: true,\r\n sendCopyToPersonalEmail: false,\r\n activityRelatesEmail: {\r\n youHaveNewNotifications: false,\r\n youAreSentADirectMessage: false,\r\n someoneAddsYouAsAsAConnection: true,\r\n uponNewOrder: false,\r\n newMembershipApproval: false,\r\n memberRegistration: true,\r\n },\r\n updatesFromKeenthemes: {\r\n newsAboutKeenthemesProductsAndFeatureUpdates: false,\r\n tipsOnGettingMoreOutOfKeen: false,\r\n thingsYouMissedSindeYouLastLoggedIntoKeen: true,\r\n newsAboutStartOnPartnerProductsAndOtherServices: true,\r\n tipsOnStartBusinessProducts: true,\r\n },\r\n },\r\n address: {\r\n addressLine: '3487 Ingram Road',\r\n city: 'Greensboro',\r\n state: 'North Carolina',\r\n postCode: '27409',\r\n },\r\n socialNetworks: {\r\n linkedIn: 'https://linkedin.com/user',\r\n facebook: 'https://facebook.com/user',\r\n twitter: 'https://twitter.com/user',\r\n instagram: 'https://instagram.com/user',\r\n },\r\n },\r\n {\r\n id: 3,\r\n username: 'guest',\r\n password: 'demo',\r\n email: 'guest@demo.com',\r\n auth: {\r\n accessToken: 'access-token-d2dff7b82f784de584b60964abbe45b9',\r\n refreshToken: 'access-token-c999ccfe74aa40d0aa1a64c5e620c1a5',\r\n },\r\n roles: [3], // Guest\r\n pic: toAbsoluteUrl('/media/avatars/150-5.jpg'),\r\n fullname: 'Manu G',\r\n firstname: 'Manu',\r\n lastname: 'Ginobili',\r\n occupation: 'CFO',\r\n companyName: 'Keenthemes',\r\n phone: '456669067892',\r\n language: 'en',\r\n timeZone: 'International Date Line West',\r\n communication: {\r\n email: true,\r\n sms: true,\r\n phone: false,\r\n },\r\n emailSettings: {\r\n emailNotification: true,\r\n sendCopyToPersonalEmail: false,\r\n activityRelatesEmail: {\r\n youHaveNewNotifications: false,\r\n youAreSentADirectMessage: false,\r\n someoneAddsYouAsAsAConnection: true,\r\n uponNewOrder: false,\r\n newMembershipApproval: false,\r\n memberRegistration: true,\r\n },\r\n updatesFromKeenthemes: {\r\n newsAboutKeenthemesProductsAndFeatureUpdates: false,\r\n tipsOnGettingMoreOutOfKeen: false,\r\n thingsYouMissedSindeYouLastLoggedIntoKeen: true,\r\n newsAboutStartOnPartnerProductsAndOtherServices: true,\r\n tipsOnStartBusinessProducts: true,\r\n },\r\n },\r\n address: {\r\n addressLine: '1467 Griffin Street',\r\n city: 'Phoenix',\r\n state: 'Arizona',\r\n postCode: '85012',\r\n },\r\n socialNetworks: {\r\n linkedIn: 'https://linkedin.com/guest',\r\n facebook: 'https://facebook.com/guest',\r\n twitter: 'https://twitter.com/guest',\r\n instagram: 'https://instagram.com/guest',\r\n },\r\n },\r\n ]\r\n}\r\n","import MockAdapter from 'axios-mock-adapter'\r\nimport {UserModel} from '../models/UserModel'\r\nimport {\r\n LOGIN_URL,\r\n GET_USER_BY_ACCESSTOKEN_URL,\r\n REGISTER_URL,\r\n REQUEST_PASSWORD_URL,\r\n} from '../redux/AuthCRUD'\r\nimport {UsersTableMock} from './usersTableMock'\r\n\r\nexport function mockAuth(mock: MockAdapter) {\r\n mock.onPost(LOGIN_URL).reply(({data}) => {\r\n const {email, password} = JSON.parse(data)\r\n\r\n if (email && password) {\r\n const user = UsersTableMock.table.find(\r\n (x) => x.email.toLowerCase() === email.toLowerCase() && x.password === password\r\n )\r\n\r\n if (user) {\r\n const auth = user.auth\r\n return [200, {...auth, password: undefined}]\r\n }\r\n }\r\n\r\n return [400]\r\n })\r\n\r\n mock.onPost(REGISTER_URL).reply(({data}) => {\r\n const {email, firstname, lastname, password} = JSON.parse(data)\r\n\r\n if (email && firstname && lastname && password) {\r\n const user: UserModel = {\r\n id: generateUserId(),\r\n email,\r\n firstname,\r\n lastname,\r\n username: `${firstname}-${lastname}`,\r\n password,\r\n roles: [2], // Manager\r\n auth: {\r\n accessToken: 'access-token-' + Math.random(),\r\n refreshToken: 'access-token-' + Math.random(),\r\n },\r\n pic: process.env.PUBLIC_URL + '/media/users/default.jpg',\r\n }\r\n\r\n UsersTableMock.table.push(user)\r\n const auth = user.auth\r\n\r\n return [200, {...auth, password: undefined}]\r\n }\r\n\r\n return [400]\r\n })\r\n\r\n mock.onPost(REQUEST_PASSWORD_URL).reply(({data}) => {\r\n const {email} = JSON.parse(data)\r\n\r\n if (email) {\r\n const user = UsersTableMock.table.find((x) => x.email.toLowerCase() === email.toLowerCase())\r\n let result = false\r\n if (user) {\r\n user.password = undefined\r\n result = true\r\n return [200, {result, password: undefined}]\r\n }\r\n }\r\n\r\n return [400]\r\n })\r\n\r\n mock.onGet(GET_USER_BY_ACCESSTOKEN_URL).reply(({headers: {Authorization}}) => {\r\n const accessToken =\r\n Authorization && Authorization.startsWith('Bearer ') && Authorization.slice('Bearer '.length)\r\n\r\n if (accessToken) {\r\n const user = UsersTableMock.table.find((x) => x.auth?.accessToken === accessToken)\r\n\r\n if (user) {\r\n return [200, {...user, password: undefined}]\r\n }\r\n }\r\n\r\n return [401]\r\n })\r\n\r\n function generateUserId(): number {\r\n const ids = UsersTableMock.table.map((el) => el.id)\r\n const maxId = Math.max(...ids)\r\n return maxId + 1\r\n }\r\n}\r\n","import React, {useEffect} from 'react'\r\nimport {useDispatch} from 'react-redux'\r\nimport {Redirect, Switch} from 'react-router-dom'\r\nimport * as auth from './redux/AuthRedux'\r\n\r\nexport function Logout() {\r\n const dispatch = useDispatch()\r\n useEffect(() => {\r\n dispatch(auth.actions.logout())\r\n document.location.reload()\r\n }, [dispatch])\r\n\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import {useLocation} from 'react-router-dom'\r\n\r\nexport default function useQuery() {\r\n return new URLSearchParams(useLocation().search)\r\n}\r\n","import {ILayout} from './LayoutModels'\r\n\r\nexport const DefaultLayoutConfig: ILayout = {\r\n main: {\r\n type: 'default',\r\n primaryColor: '#009EF7',\r\n darkSkinEnabled: true,\r\n },\r\n loader: {\r\n display: true,\r\n type: 'default', // Set default|spinner-message|spinner-logo to hide or show page loader\r\n },\r\n scrolltop: {\r\n display: true,\r\n },\r\n header: {\r\n display: true, // Set true|false to show or hide Header\r\n width: 'fluid', // Set fixed|fluid to change width type\r\n left: 'menu',\r\n fixed: {\r\n desktop: true, // Set true|false to set fixed Header for desktop mode\r\n tabletAndMobile: true, // Set true|false to set fixed Header for tablet and mobile modes\r\n },\r\n menuIcon: 'svg',\r\n },\r\n megaMenu: {\r\n display: true, // Set true|false to show or hide Mega Menu\r\n },\r\n aside: {\r\n display: true,\r\n theme: 'dark',\r\n menu: 'main',\r\n fixed: true,\r\n minimized: false,\r\n minimize: true,\r\n hoverable: true,\r\n menuIcon: 'svg',\r\n },\r\n content: {\r\n width: 'fixed', // Set fixed|fluid to change width\r\n layout: 'default',\r\n },\r\n toolbar: {\r\n display: true, // Display toolbar\r\n width: 'fluid', // Set fixed|fluid to change width type,\r\n fixed: {\r\n desktop: true,\r\n tabletAndMobileMode: true,\r\n },\r\n layout: 'toolbar1',\r\n layouts: {\r\n toolbar1: {\r\n height: '55px',\r\n heightAndTabletMobileMode: '55px',\r\n },\r\n toolbar2: {\r\n height: '75px',\r\n heightAndTabletMobileMode: '65px',\r\n },\r\n toolbar3: {\r\n height: '55px',\r\n heightAndTabletMobileMode: '55px',\r\n },\r\n toolbar4: {\r\n height: '65px',\r\n heightAndTabletMobileMode: '65px',\r\n },\r\n toolbar5: {\r\n height: '75px',\r\n heightAndTabletMobileMode: '65px',\r\n },\r\n },\r\n },\r\n footer: {\r\n width: 'fluid', // Set fixed|fluid to change width type\r\n },\r\n pageTitle: {\r\n display: true,\r\n breadCrumbs: true,\r\n description: false,\r\n layout: 'default',\r\n direction: 'row',\r\n responsive: true,\r\n responsiveBreakpoint: 'lg',\r\n responsiveTarget: '#kt_toolbar_container',\r\n },\r\n}\r\n","import React, {createContext, useContext, useState, useEffect} from 'react'\r\nimport {DefaultLayoutConfig} from './DefaultLayoutConfig'\r\nimport {\r\n getEmptyCssClasses,\r\n getEmptyCSSVariables,\r\n getEmptyHTMLAttributes,\r\n LayoutSetup,\r\n} from './LayoutSetup'\r\nimport {\r\n ILayout,\r\n ILayoutCSSVariables,\r\n ILayoutCSSClasses,\r\n ILayoutHTMLAttributes,\r\n} from './LayoutModels'\r\n\r\nexport interface LayoutContextModel {\r\n config: ILayout\r\n classes: ILayoutCSSClasses\r\n attributes: ILayoutHTMLAttributes\r\n cssVariables: ILayoutCSSVariables\r\n setLayout: (config: LayoutSetup) => void\r\n}\r\n\r\nconst LayoutContext = createContext({\r\n config: DefaultLayoutConfig,\r\n classes: getEmptyCssClasses(),\r\n attributes: getEmptyHTMLAttributes(),\r\n cssVariables: getEmptyCSSVariables(),\r\n setLayout: (config: LayoutSetup) => {},\r\n})\r\n\r\nconst enableSplashScreen = () => {\r\n const splashScreen = document.getElementById('splash-screen')\r\n if (splashScreen) {\r\n splashScreen.style.setProperty('display', 'flex')\r\n }\r\n}\r\n\r\nconst disableSplashScreen = () => {\r\n const splashScreen = document.getElementById('splash-screen')\r\n if (splashScreen) {\r\n splashScreen.style.setProperty('display', 'none')\r\n }\r\n}\r\n\r\nconst LayoutProvider: React.FC = ({children}) => {\r\n const [config, setConfig] = useState(LayoutSetup.config)\r\n const [classes, setClasses] = useState(LayoutSetup.classes)\r\n const [attributes, setAttributes] = useState(LayoutSetup.attributes)\r\n const [cssVariables, setCSSVariables] = useState(LayoutSetup.cssVariables)\r\n const setLayout = (_themeConfig: Partial) => {\r\n enableSplashScreen()\r\n const bodyClasses = Array.from(document.body.classList)\r\n bodyClasses.forEach((cl) => document.body.classList.remove(cl))\r\n LayoutSetup.updatePartialConfig(_themeConfig)\r\n setConfig(Object.assign({}, LayoutSetup.config))\r\n setClasses(LayoutSetup.classes)\r\n setAttributes(LayoutSetup.attributes)\r\n setCSSVariables(LayoutSetup.cssVariables)\r\n setTimeout(() => {\r\n disableSplashScreen()\r\n }, 500)\r\n }\r\n const value: LayoutContextModel = {\r\n config,\r\n classes,\r\n attributes,\r\n cssVariables,\r\n setLayout,\r\n }\r\n\r\n useEffect(() => {\r\n disableSplashScreen()\r\n }, [])\r\n\r\n return {children}\r\n}\r\n\r\nexport {LayoutContext, LayoutProvider}\r\n\r\nexport function useLayout() {\r\n return useContext(LayoutContext)\r\n}\r\n"],"sourceRoot":""}