{"version":3,"sources":["webpack:///./Avensia.Common/Features/Shared/Generic/H4.tsx","webpack:///./Avensia.Common/Features/CustomerService/QuestionsBlock.tsx"],"names":["h4","fontSize","fontWeight","lineHeight","letterSpacing","props","toggleAccordion","groupIndex","List","state","openGroupIndexList","includes","index","indexOf","splice","push","setState","openGroupIndex","renderAccordionHeader","heading","AccordionHeader","Heading","css","ToggleIcon","transform","render","isMobile","questions","Title","map","idx","header","text","CustomAccordion","body","AccordionBody","for","key","onToggle","isOpen","Fragment","H4","Component","div","alignItems","display","justifyContent","Accordion","backgroundColor","theme","cardBackgroundColor","marginBottom","h3","margin","y","h5","textAlign","marginLeft","Add","flexShrink","marginRight","property","duration","willChange","timingFunction"],"mappings":"oJAGe,MAAOA,GAAG,CACvBC,SAAU,IACVC,WAAY,OACZC,WAAY,SACZC,cAAe,Q,kBCkBjB,cACE,WAAYC,GAAZ,MACE,YAAMA,IAAM,K,OAOd,EAAAC,gBAAkB,SAACC,GACjB,IAAIC,EAAO,YAAI,EAAKC,MAAMC,oBAC1B,GAAKF,EAAKG,SAASJ,GAEZ,CACL,IAAMK,EAAQJ,EAAKK,QAAQN,GAC3BC,EAAKM,OAAOF,EAAO,QAHnBJ,EAAKO,KAAKR,GAKZ,EAAKS,SAAS,CACZC,eAAgB,EAAKR,MAAMQ,iBAAmBV,EAAaA,EAAa,KACxEG,mBAAoBF,KAIxB,EAAAU,sBAAwB,SAACC,EAAiBZ,GACxC,OACE,kBAACa,EAAe,KACd,kBAACC,EAAO,CAACC,IAAK,CAAEpB,WAAY,EAAKO,MAAMQ,iBAAmBV,EAAa,OAAS,WAAaY,GAC7F,kBAACI,EAAU,CAACD,IAAK,CAAEE,UAAW,EAAKf,MAAMQ,iBAAmBV,EAAa,iBAAmB,iBAxBhG,EAAKE,MAAQ,CACXQ,eAAgB,KAChBP,mBAAoB,I,EA2D1B,OAhE6B,iBAgC3B,YAAAe,OAAA,sBACQ,aAAEC,EAAA,EAAAA,SAAUC,EAAA,EAAAA,UAAWR,EAAA,EAAAA,QAE7B,OACE,6BACE,kBAACS,EAAK,KAAET,GACPO,IACKC,GACFA,EAAUE,KAAI,SAAC,EAAkBC,G,IAAhBC,EAAA,EAAAA,OAAQC,EAAA,EAAAA,KAAgB,OACvC,kBAACC,EAAe,CACdC,KACE,kBAACC,EAAa,KACZ,kBAAC,IAAW,CAACC,IAAKJ,KAGtBK,IAAKP,EACLC,OAAQ,EAAKb,sBAAsB,YAAiBa,GAASD,GAE7DQ,SAAU,WAAM,SAAKhC,gBAAgBwB,IACrCS,OAAQ,EAAK9B,MAAMC,mBAAmBC,SAASmB,UAGjDH,GACFA,EAAUE,KAAI,SAAC,EAAkBC,G,IAAhBC,EAAA,EAAAA,OAAQC,EAAA,EAAAA,KAAgB,OACvC,kBAAC,IAAMQ,SAAQ,CAACH,IAAKP,GACnB,kBAACW,EAAE,KAAE,YAAiBV,IACtB,kBAAC,IAAW,CAACK,IAAKJ,UAMlC,EAhEA,CAA6B,IAAMU,WAoE7BtB,GAFS,YAES,IAAOuB,IAAI,CACjCC,WAAY,SACZC,QAAS,OACTC,eAAgB,mBAGZb,EAAkB,YAAOc,EAAA,EAAW,CACxCC,gBAAiB,SAAAC,GAAS,OAAAA,EAAMC,qBAChCC,aAAc,aAAa,MAGvBvB,EAAQ,IAAOwB,KAAE,GACrBC,OAAQ,CACNC,EAAG,aAAa,OAEjB,MAAsB,CACrBD,OAAQ,CACNC,EAAG,aAAa,M,IAKhBjC,EAAU,IAAOkC,GAAG,CACxBC,UAAW,OACXrD,WAAY,OACZsD,WAAY,aAAa,MAGrBlC,EAAa,YAAOmC,EAAA,EAAK,aAC7BC,WAAY,EACZC,YAAa,aAAa,KACvB,aAAW,CACZC,SAAU,MACVC,SAAU,MACVC,YAAY,EACZC,eAAgB,WAId7B,EAAgB,IAAOQ,IAAI,CAC/Bc,WAAY,aAAa","file":"assets/13.chunk.33d11527acfef80f96f0.js","sourcesContent":["import { styled } from '@glitz/react';\r\nimport * as style from '../Style';\r\n\r\nexport default styled.h4({\r\n fontSize: style.delta,\r\n fontWeight: 'bold',\r\n lineHeight: 'normal',\r\n letterSpacing: '2px',\r\n});\r\n","/**\r\n * @ComponentFor QuestionsBlock\r\n */\r\n\r\nimport React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport { epiPropertyValue, EpiProperty } from '@avensia/scope-episerver';\r\nimport QuestionsBlockType from './QuestionsBlock.type';\r\nimport H4 from 'Shared/Generic/H4';\r\nimport Add from 'Shared/Icon/Add';\r\nimport Accordion from 'Shared/Accordion';\r\nimport { pixelsToUnit, transition, minMediumMediaQuery } from 'Shared/Style';\r\n\r\ntype PropType = {\r\n blockID?: number;\r\n isMobile: boolean;\r\n questions: QuestionsBlockType[];\r\n heading?: string;\r\n};\r\n\r\ntype StateType = {\r\n openGroupIndex?: number;\r\n openGroupIndexList?: number[];\r\n};\r\n\r\nclass QuestionsBlock extends React.Component {\r\n constructor(props: PropType) {\r\n super(props);\r\n this.state = {\r\n openGroupIndex: null,\r\n openGroupIndexList: [],\r\n };\r\n }\r\n\r\n toggleAccordion = (groupIndex: number) => {\r\n let List = [...this.state.openGroupIndexList];\r\n if (!List.includes(groupIndex)) {\r\n List.push(groupIndex);\r\n } else {\r\n const index = List.indexOf(groupIndex);\r\n List.splice(index, 1);\r\n }\r\n this.setState({\r\n openGroupIndex: this.state.openGroupIndex !== groupIndex ? groupIndex : null,\r\n openGroupIndexList: List,\r\n });\r\n };\r\n\r\n renderAccordionHeader = (heading: string, groupIndex: number) => {\r\n return (\r\n \r\n {heading}\r\n \r\n \r\n );\r\n };\r\n\r\n render() {\r\n const { isMobile, questions, heading } = this.props;\r\n\r\n return (\r\n
\r\n {heading}\r\n {isMobile\r\n ? !!questions &&\r\n questions.map(({ header, text }, idx) => (\r\n \r\n \r\n \r\n }\r\n key={idx}\r\n header={this.renderAccordionHeader(epiPropertyValue(header), idx)}\r\n // tslint:disable-next-line:jsx-no-lambda\r\n onToggle={() => this.toggleAccordion(idx)}\r\n isOpen={this.state.openGroupIndexList.includes(idx)}\r\n />\r\n ))\r\n : !!questions &&\r\n questions.map(({ header, text }, idx) => (\r\n \r\n

{epiPropertyValue(header)}

\r\n \r\n
\r\n ))}\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default QuestionsBlock;\r\n\r\nconst AccordionHeader = styled.div({\r\n alignItems: 'center',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n});\r\n\r\nconst CustomAccordion = styled(Accordion, {\r\n backgroundColor: theme => theme.cardBackgroundColor,\r\n marginBottom: pixelsToUnit(10),\r\n});\r\n\r\nconst Title = styled.h3({\r\n margin: {\r\n y: pixelsToUnit(17),\r\n },\r\n [minMediumMediaQuery]: {\r\n margin: {\r\n y: pixelsToUnit(20),\r\n },\r\n },\r\n});\r\n\r\nconst Heading = styled.h5({\r\n textAlign: 'left',\r\n lineHeight: '3rem',\r\n marginLeft: pixelsToUnit(10),\r\n});\r\n\r\nconst ToggleIcon = styled(Add, {\r\n flexShrink: 0,\r\n marginRight: pixelsToUnit(10),\r\n ...transition({\r\n property: 'all',\r\n duration: '.2s',\r\n willChange: true,\r\n timingFunction: 'ease',\r\n }),\r\n});\r\n\r\nconst AccordionBody = styled.div({\r\n marginLeft: pixelsToUnit(10),\r\n});\r\n"],"sourceRoot":""}