{"version":3,"file":"Reducers-B2K9L-Cu.js","sources":["../../../Features/Shared/Scripts/Store/StegVisning/Types.ts","../../../Features/Shared/Scripts/Utilities/LiveMessage.ts","../../../Features/Shared/Scripts/Store/StegVisning/Reducers.ts"],"sourcesContent":["export interface StegVisning {\r\n id: string;\r\n isCollapsed: boolean;\r\n}\r\n\r\nexport const SET_COLLAPSED = 'SET_COLLAPSED';\r\n\r\nexport interface SetCollapseAction {\r\n type: typeof SET_COLLAPSED;\r\n payload: StegVisning;\r\n}\r\n\r\nexport type StegVisningActionTypes = SetCollapseAction;\r\n","/**\r\n * This function uses two divs that exist in _Layout.cshtml with aria-live,\r\n * inserting the message to the corresponding div to be read out by screen readers.\r\n * @param message The message that will be read out for screen readers\r\n * @param assertive Optional parameter to determine if the message should be polite or assertive.\r\n */\r\n\r\nexport function updateLiveMessage() {\r\n const liveMessageDiv = document.getElementById('polite-live-message');\r\n const liveMessageSecondDiv = document.getElementById('politeSecond-live-message');\r\n const resultatMessage = document.getElementById('resultatTekst')?.innerHTML ?? '';\r\n if (liveMessageDiv?.innerHTML === resultatMessage) {\r\n if (liveMessageSecondDiv) {\r\n liveMessageSecondDiv.innerHTML = resultatMessage;\r\n }\r\n } else if (liveMessageDiv) {\r\n liveMessageDiv.innerHTML = resultatMessage;\r\n }\r\n}\r\n","import { SET_COLLAPSED, StegVisning, StegVisningActionTypes } from './Types';\r\n\r\nconst initialState: { [id: string]: StegVisning } = {};\r\n\r\nexport function stegVisningReducer(\r\n state: {\r\n [id: string]: StegVisning;\r\n } = initialState,\r\n action: StegVisningActionTypes,\r\n): {\r\n [id: string]: StegVisning;\r\n} {\r\n switch (action.type) {\r\n case SET_COLLAPSED: {\r\n const newState = { ...state };\r\n newState[action.payload.id] = {\r\n id: action.payload.id,\r\n isCollapsed: action.payload.isCollapsed,\r\n };\r\n return newState;\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n"],"names":[],"mappings":"AAKO,MAAM,gBAAgB;ACEtB,SAAS,oBAAoB;AAC1B,QAAA,iBAAiB,SAAS,eAAe,qBAAqB;AAC9D,QAAA,uBAAuB,SAAS,eAAe,2BAA2B;AAChF,QAAM,kBAAkB,SAAS,eAAe,eAAe,GAAG,aAAa;AAC3E,MAAA,gBAAgB,cAAc,iBAAiB;AAC/C,QAAI,sBAAsB;AACtB,2BAAqB,YAAY;AAAA,IAAA;AAAA,aAE9B,gBAAgB;AACvB,mBAAe,YAAY;AAAA,EAAA;AAEnC;AChBA,MAAM,eAA8C,CAAC;AAErC,SAAA,mBACZ,QAEI,cACJ,QAGF;AACE,UAAQ,OAAO,MAAM;AAAA,IACjB,KAAK,eAAe;AACV,YAAA,WAAW,EAAE,GAAG,MAAM;AACnB,eAAA,OAAO,QAAQ,EAAE,IAAI;AAAA,QAC1B,IAAI,OAAO,QAAQ;AAAA,QACnB,aAAa,OAAO,QAAQ;AAAA,MAChC;AACO,aAAA;AAAA,IAAA;AAAA,IAEX;AACW,aAAA;AAAA,EAAA;AAEnB;"}