{"version":3,"file":"veilederFarBarn-jynF98Dr.js","sources":["../../../Features/VeilederNarDuFarBarn/Store/Valg/Types.ts","../../../Features/VeilederNarDuFarBarn/Store/Valg/Actions.ts","../../../Features/VeilederNarDuFarBarn/Components/VilkarComponent.tsx","../../../Features/VeilederNarDuFarBarn/Ids.ts","../../../Features/VeilederNarDuFarBarn/App.tsx","../../../Features/VeilederNarDuFarBarn/Store/Valg/Reducers.ts","../../../Features/VeilederNarDuFarBarn/Store/index.ts","../../../Features/VeilederNarDuFarBarn/index.tsx"],"sourcesContent":["export interface ValgState {\r\n visVilkar: boolean;\r\n}\r\n\r\nexport const TOGGLE_VILKAR = 'TOGGLE_VILKAR';\r\n\r\nexport interface ToggleVilkarAction {\r\n type: typeof TOGGLE_VILKAR;\r\n}\r\n\r\nexport type ValgStateActionTypes = ToggleVilkarAction;\r\n","import { TOGGLE_VILKAR, ToggleVilkarAction } from './Types';\r\n\r\nexport function toggleVilkar(): ToggleVilkarAction {\r\n return {\r\n type: TOGGLE_VILKAR,\r\n };\r\n}\r\n","import React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { ArticleContentComponent } from '../../Shared/Scripts/Components/ArticleContentComponent';\r\nimport { toggleVilkar } from '../Store/Valg/Actions';\r\nimport { updateZIndex } from '../../Shared/Scripts/Store/EpiContext/Actions';\r\nimport { ModalCompontent } from '../../Shared/Scripts/Components/ModalComponent';\r\nimport { VeilederFarBarnAppState } from '../Store';\r\n\r\ntype VilkarState = {\r\n open: boolean;\r\n};\r\n\r\ntype VilkarProps = MapStateToProps &\r\n MapDispatchToProps & {\r\n lenketekst: any;\r\n tittel: any;\r\n innhold: any;\r\n lukk: any;\r\n };\r\n\r\nclass VilkarComponent extends React.PureComponent {\r\n constructor(props: VilkarProps) {\r\n super(props);\r\n this.onVilkarClick = this.onVilkarClick.bind(this);\r\n this.onRequestClose = this.onRequestClose.bind(this);\r\n this.state = { open: false };\r\n }\r\n\r\n onRequestClose(): void {\r\n this.props.updateZIndex(1);\r\n this.props.toggleVilkar();\r\n this.setState({ open: false });\r\n }\r\n\r\n onVilkarClick(): void {\r\n this.props.updateZIndex(2);\r\n this.props.toggleVilkar();\r\n this.setState({ open: true });\r\n }\r\n\r\n render(): JSX.Element {\r\n if (this.props.lenketekst != null && this.props.lenketekst != undefined) {\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n );\r\n } else {\r\n return
;\r\n }\r\n }\r\n}\r\n\r\ninterface MapStateToProps {\r\n locale: string;\r\n}\r\n\r\ninterface MapDispatchToProps {\r\n toggleVilkar: typeof toggleVilkar;\r\n updateZIndex: typeof updateZIndex;\r\n}\r\n\r\nexport default connect(\r\n (state: VeilederFarBarnAppState): MapStateToProps => {\r\n return {\r\n locale: state.epiContext.locale,\r\n };\r\n },\r\n { toggleVilkar, updateZIndex },\r\n)(VilkarComponent);\r\n","export const AppModalHvorLengeContainerId = 'hvorlenge';\r\nexport const AppModalOmStudieplassContainerId = 'omstudieplass';\r\nexport const AppModalOmPermisjonContainerId = 'ompermisjon';\r\nexport const AppModalOmNavContainerId = 'omnav';\r\nexport const AppModalErStudentContainerId = 'erstudent';\r\nexport const AppModalOmNarJegKanSokeContainerId = 'omnarjegkansoke';\r\n","import React from 'react';\r\n//import * as Ids from './Ids';\r\nimport ReactModal from 'react-modal';\r\nimport { connect } from 'react-redux';\r\nimport VilkarComponent from './Components/VilkarComponent';\r\nimport { EpiContext } from '../Shared/Scripts/Store/EpiContext/Types';\r\nimport { FeilmeldingComponent } from '../Shared/Scripts/Components/FeilmeldingComponent';\r\nimport { VeilederFarBarnAppState } from './Store';\r\nimport contentResolver from '../Shared/Scripts/Utilities/EpiContentResolver';\r\nimport { AppModalHvorLengeContainerId } from './Ids';\r\nimport { AppModalOmStudieplassContainerId } from './Ids';\r\nimport { AppModalOmPermisjonContainerId } from './Ids';\r\nimport { AppModalOmNavContainerId } from './Ids';\r\nimport { AppModalErStudentContainerId } from './Ids';\r\nimport { AppModalOmNarJegKanSokeContainerId } from './Ids';\r\nimport VeilederFarBarnDto from './Models/VeilederFarBarnDto';\r\n\r\ninterface AppOwnProps {\r\n modalid: string;\r\n}\r\n\r\ntype AppProps = MapStateToProps & AppOwnProps;\r\n\r\nReactModal.setAppElement(document.getElementById(AppModalOmNavContainerId) as HTMLElement);\r\n\r\nexport class App extends React.Component {\r\n constructor(props: AppProps) {\r\n super(props);\r\n }\r\n render(): JSX.Element {\r\n const { epiContext } = this.props;\r\n const { epiModel } = this.props.epiContext;\r\n if (epiContext.epiModelFeilet) {\r\n return ;\r\n }\r\n if (epiModel != null) {\r\n if (this.props.modalid === AppModalHvorLengeContainerId) {\r\n return (\r\n \r\n );\r\n }\r\n if (this.props.modalid === AppModalOmStudieplassContainerId) {\r\n return (\r\n \r\n );\r\n }\r\n if (this.props.modalid === AppModalOmPermisjonContainerId) {\r\n return (\r\n \r\n );\r\n }\r\n if (this.props.modalid === AppModalOmNavContainerId) {\r\n return (\r\n \r\n );\r\n }\r\n if (this.props.modalid === AppModalErStudentContainerId) {\r\n return (\r\n \r\n );\r\n }\r\n if (this.props.modalid === AppModalOmNarJegKanSokeContainerId) {\r\n return (\r\n \r\n );\r\n }\r\n }\r\n return
Laster...
;\r\n }\r\n}\r\ninterface MapStateToProps {\r\n epiContext: EpiContext;\r\n}\r\nconst mapStateToProps = (state: VeilederFarBarnAppState): MapStateToProps => ({\r\n epiContext: state.epiContext,\r\n});\r\n\r\nexport default connect(mapStateToProps)(App);\r\n","import { ValgStateActionTypes, ValgState, TOGGLE_VILKAR } from './Types';\r\n\r\nexport const initialState: ValgState = {\r\n visVilkar: false,\r\n};\r\n\r\nexport function valgReducer(state: ValgState = initialState, action: ValgStateActionTypes): ValgState {\r\n switch (action.type) {\r\n case TOGGLE_VILKAR: {\r\n return {\r\n ...state,\r\n visVilkar: !state.visVilkar,\r\n };\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n","import ReduxThunk from 'redux-thunk';\r\nimport { createStore, combineReducers, Store, applyMiddleware } from 'redux';\r\nimport VeilederFarBarnDto from '../Models/VeilederFarBarnDto';\r\nimport { epiContextReducer } from '../../Shared/Scripts/Store/EpiContext/Reducers';\r\nimport { EpiContext, UpdateEpiContextActionTypes } from '../../Shared/Scripts/Store/EpiContext/Types';\r\nimport { EpiAppState } from '../../Shared/Scripts/Store/Types';\r\nimport { valgReducer } from './Valg/Reducers';\r\n\r\nconst rootReducer = combineReducers({\r\n valg: valgReducer,\r\n epiContext: (\r\n state: EpiContext | undefined,\r\n action: UpdateEpiContextActionTypes,\r\n ): EpiContext => epiContextReducer(state, action),\r\n});\r\n\r\nexport type VeilederFarBarnAppState = EpiAppState & {\r\n valg: ReturnType;\r\n};\r\n\r\nexport default function configureStore(): Store {\r\n return createStore(rootReducer, applyMiddleware(ReduxThunk));\r\n}\r\n","import React from 'react';\r\nimport { createRoot } from 'react-dom/client';\r\nimport App from './App';\r\nimport { Provider } from 'react-redux';\r\nimport { AppModalHvorLengeContainerId } from './Ids';\r\nimport { AppModalOmStudieplassContainerId } from './Ids';\r\nimport { AppModalOmPermisjonContainerId } from './Ids';\r\nimport { AppModalOmNavContainerId } from './Ids';\r\nimport { AppModalErStudentContainerId } from './Ids';\r\nimport { AppModalOmNarJegKanSokeContainerId } from './Ids';\r\n\r\nimport configureStore from './Store';\r\nimport InitEpiMessages from '../Shared/Scripts/Utilities/EpiMessages';\r\nimport { updateLanguage } from '../Shared/Scripts/Store/EpiContext/Actions';\r\nimport { epiResolveLanguage } from '../Shared/Scripts/Utilities/EpiResolveLanguage';\r\n\r\nconst store = configureStore();\r\nstore.dispatch(updateLanguage(epiResolveLanguage()));\r\n\r\nconst container = document.getElementById(AppModalHvorLengeContainerId);\r\n\r\nif (container != null) {\r\n const root = createRoot(container!);\r\n const contentLink = container.attributes['data-content'].value as string;\r\n InitEpiMessages(store, contentLink);\r\n\r\n interface ModalOwnProps {\r\n modalid: string;\r\n }\r\n\r\n type ModalProps = ModalOwnProps;\r\n\r\n const AppRoot = (props: ModalProps): JSX.Element => (\r\n \r\n \r\n \r\n );\r\n\r\n root.render();\r\n\r\n function renderModal(elementId: string ){\r\n const modal2 = document.getElementById(elementId);\r\n const root2 = createRoot(modal2!);\r\n if(root2 != null) {\r\n root2.render();\r\n }\r\n }\r\n \r\n renderModal(AppModalOmStudieplassContainerId);\r\n renderModal(AppModalOmPermisjonContainerId);\r\n renderModal(AppModalOmNavContainerId);\r\n renderModal(AppModalErStudentContainerId);\r\n renderModal(AppModalOmNarJegKanSokeContainerId);\r\n}\r\n"],"names":["jsxs","jsx","VilkarComponent","contentResolver","ReduxThunk","createRoot","App"],"mappings":";;;;;;;;;;;;;AAIO,MAAM,gBAAgB;ACFtB,SAAS,eAAmC;AACxC,SAAA;AAAA,IACH,MAAM;AAAA,EACV;AACJ;ACcA,MAAM,wBAAwB,MAAM,cAAwC;AAAA,EACxE,YAAY,OAAoB;AAC5B,UAAM,KAAK;AACX,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,iBAAiB,KAAK,eAAe,KAAK,IAAI;AAC9C,SAAA,QAAQ,EAAE,MAAM,MAAM;AAAA,EAAA;AAAA,EAG/B,iBAAuB;AACd,SAAA,MAAM,aAAa,CAAC;AACzB,SAAK,MAAM,aAAa;AACxB,SAAK,SAAS,EAAE,MAAM,MAAA,CAAO;AAAA,EAAA;AAAA,EAGjC,gBAAsB;AACb,SAAA,MAAM,aAAa,CAAC;AACzB,SAAK,MAAM,aAAa;AACxB,SAAK,SAAS,EAAE,MAAM,KAAA,CAAM;AAAA,EAAA;AAAA,EAGhC,SAAsB;AAClB,QAAI,KAAK,MAAM,cAAc,QAAQ,KAAK,MAAM,cAAc,QAAW;AAEjE,aAAAA,kCAAA,KAAC,OAAI,EAAA,WAAU,mBACX,UAAA;AAAA,QAACC,kCAAAA,IAAA,UAAA,EAAO,MAAK,UAAS,WAAU,0BAAyB,SAAS,KAAK,eAClE,UAAK,KAAA,MAAM,WAChB,CAAA;AAAA,QACAA,kCAAA;AAAA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