1"use strict";(self.webpackChunk_jmc_janssen_medical_cloud_frontend=self.webpackChunk_jmc_janssen_medical_cloud_frontend||[]).push([[478],{90478:function(e,t,n){n.r(t),n.d(t,{ReferenceCard:function(){return I}});var l=n(60991),o=n(80972),i=n.n(o),a=n(9152),r=n(77034),d=n(54853),u=n(46235),c=n(16974),s=n(97527),v=n(34862),m=n(40578),_=n(89698),p=n(44821),f=n(23322),g=n(16609),y=n(16420),E=n(18149),C=n.n(E),h=n(2784),L=n(57975),b=n(98165),$=n(71321),A=n(13282),T=n(3283);const M=h.lazy((()=>Promise.all([n.e(532),n.e(6762)]).then(n.bind(n,66762)))),k=h.lazy((()=>Promise.all([n.e(532),n.e(317)]).then(n.bind(n,5028)))),w=h.lazy((()=>Promise.all([n.e(532),n.e(3721)]).then(n.bind(n,63721)))),z=h.lazy((()=>Promise.all([n.e(532),n.e(2765)]).then(n.bind(n,52765)))),R=h.lazy((()=>n.e(4317).then(n.bind(n,84317)))),D=h.lazy((()=>Promise.all([n.e(532),n.e(312)]).then(n.bind(n,14334)))),S=h.lazy((()=>Promise.all([n.e(532),n.e(317)]).then(n.bind(n,9938)))),I=e=>{let{content:t,type:n,loading:o="lazy",cvents:E,placement:I,position:N=1}=e;const P=(0,T.Pc)(),{0:O,1:j}=(0,h.useState)(!1),{0:U,1:Z}=(0,h.useState)(null),x=(0,b.Z)(),W=(0,r.bU)(),F=(0,L.v9)((e=>e.profile),C()),V=(0,L.v9)((e=>{var t;return null===(t=e.eligibleEvents)||void 0===t?void 0:t.data}),C()),Y=(0,L.v9)((e=>e.courses),C()),q=(0,L.v9)((e=>e.currentCourses),C()),B=(0,L.v9)((e=>e.materialCollection),C()),G=(0,L.I0)();(0,h.useEffect)((()=>{G((0,p.zD)()),G((0,m.zD)()),G((0,s.zD)()),G((0,v.zD)()),"cvent"===n&&null!=t&&t.iconnect_event_number&&(j(!0),y.Z.get(`${u.Z.getApiBaseUrl()}events/${null==t?void 0:t.iconnect_event_number}/personalized`).then((e=>{let{data:t}=e;j(!1),Z(null==t?void 0:t.personalizedLink)})).catch((()=>{j(!1)})))}),[]);const H=(J=t)?"iconnect_event_number"in J?f.AccessLevel.level3:"product"in J?f.AccessLevel.level1:"regulatory_status"in J?(null==J||null===(K=J.regulatory_status)||void 0===K?void 0:K.promotional_or_medical)===f.CMS_MEDICAL_CONTENT?f.AccessLevel.level3:(null==J||null===(Q=J.access_control)||void 0===Q?void 0:Q.access_level)||f.AccessLevel.level1:void 0:f.AccessLevel.level1;var J,K,Q;const X=(0,L.v9)((e=>e.materialCollection));switch(n){case"article":{var ee,te,ne,le;const e=t,n=null===(ee=e.fields)||void 0===ee?void 0:ee.footnotes,l=(null==n||null===(te=n.find((t=>t.mapped_text===e.display_title)))||void 0===te?void 0:te.text_without_footnotes)||e.display_title||e.title,i=!P.isAuthorized(H,`${$.tE}/${e.uid}`);return h.createElement(a.r,{type:"article",category:null===(ne=e.type)||void 0===ne?void 0:ne.join().toLowerCase(),name:l,placement:`${I}|referencecard:(${null==e||null===(le=e.title)||void 0===le?void 0:le.toString().toLowerCase()})`,position:N},h.createElement(M,{"data-test-id":`ReferenceCard.Article.${e.id}`,article:e,footnotes:n,showLock:i,loading:o}))}case"material":{var oe,ie,ae,re;const e=null===(oe=t.fields)||void 0===oe?void 0:oe.footnotes,n=(e,t)=>{const n=new Map(B);0===e?(n.delete(t.id),G((0,_.t8)(n))):(n.set(t.id,{material:t,amount:e}),G((0,_.t8)(n))),i()().trackEvent({event:0===e?f.MaterialEventType.MATERIAL_REMOVE_FROM_CART:f.MaterialEventType.MATERIAL_ADD_TO_CART,commerce:g.Ut.mapMaterialImpression(t,"reference card",1,e),info:{itemtotal:1}})},a=async(e,t)=>{var n,l;const o=Object.fromEntries(new URLSearchParams(null==x?void 0:x.search)),a=(0,c.Z)("repid",o),r=(0,c.Z)("busunit",o),d=new Map(X);d.set(t.id,{material:t,amount:e,salesRepId:a,businessUnit:r,deliveryMethod:null===(n=t.order_copies)||void 0===n?void 0:n.delivery_method,supplier:null===(l=t.order_copies)||void 0===l?void 0:l.supplier}),await G((0,_.t8)(d)),i()().trackEvent({event:f.MaterialEventType.MATERIAL_ADD_TO_CART,commerce:g.Ut.mapMaterialImpression(t,"material overview",1,e),info:{itemtotal:1}})},r=e=>{var t;i()().trackEvent({event:f.MaterialEventType.MATERIAL_DOWNLOAD,commerce:g.Ut.mapMaterialImpression(e,"reference card",N,null===(t=B.get(e.id))||void 0===t?void 0:t.amount)})},d=t,u=!P.isAuthorized(H,`${$.cU}/${d.uid}`);return h.createElement(R,{material:d,placement:`${I}|referencecard:(${null==d||null===(ie=d.title)||void 0===ie?void 0:ie.toString().toLowerCase()})`,position:N},h.createElement(l.ju,{url:`${$.cU}/${d.uid}`,commercial:(null===(ae=d.regulatory_status)||void 0===ae?void 0:ae.promotional_or_medical)!==f.CMS_MEDICAL_CONTENT,fullWidth:!0},h.createElement(z,{"data-test-index":`ReferenceCard.Material.${d.uid}`,"data-test-id":`ReferenceCard.Material.${d.uid}`,material:d,amount:(null==B||null===(re=B.get(t.id))||void 0===re?void 0:re.amount)||0,onDownload:()=>r(d),onOrderPrintedCopyMaterialCard:async e=>await a(e,d),onChangeAmount:e=>n(e,d),footnotes:e,showLock:u,loading:o})))}case"product_glossary_entry":{var de,ue;const e=t,n=null===(de=e.fields)||void 0===de?void 0:de.footnotes,l=(null==e||null===(ue=e.user_profile)||void 0===ue?void 0:ue.length)>0&&P.isAuthorized(f.AccessLevel.level3),i=!F.loading&&(0,A.q)(null==F?void 0:F.data,null==e?void 0:e.user_profile);return!l||i?h.createElement(S,{key:t.id,product:e,"data-test-id":`ReferenceCard.Product.${t.id}`,footnotes:n,loading:o}):F.loading?h.createElement(d.$,{size:"xl"}):null}case"audio":case"video":{var ce,se,ve;const e=t,l=null===(ce=e.fields)||void 0===ce?void 0:ce.footnotes,i=(null==l||null===(se=l.find((t=>t.mapped_text===e.display_title)))||void 0===se?void 0:se.text_without_footnotes)||e.display_title||e.title,r=!P.isAuthorized(H,`${$.nZ}/${e.video_id||e.audio_id}`);return h.createElement(a.r,{type:"media",category:n,name:i,placement:`${I}|referencecard:(${null==e||null===(ve=e.title)||void 0===ve?void 0:ve.toString().toLowerCase()})`,position:N},h.createElement(D,{"data-test-id":"video"===n?`ReferenceCard.Video.${e.video_id}`:`ReferenceCard.Audio.${e.audio_id}`,media:e,footnotes:l,showLock:r,loading:o}))}case"event":{var me,_e,pe,fe;if(!P.isAuthorized(f.AccessLevel.level3,u.Z.getNonLocalizedPathname(x.pathname),null==t?void 0:t.iconnect_event_number))return null;const e=(null!=V?V:[]).find((e=>(null==e?void 0:e.eventNumber)===(null==t?void 0:t.iconnect_event_number))),n={...t,type:null==t?void 0:t.eventType,unpublishDate:null==e?void 0:e.publicationEndDate,medical:null==e?void 0:e.medical};return e?h.createElement(l.ju,{url:`${$.ec}/${null==n?void 0:n.iconnect_event_number}`,fullWidth:!0,commercial:!(null!=n&&n.medical),isEvent:!0,eventNumber:null==n?void 0:n.iconnect_event_number},h.createElement(a.r,{key:n.id,type:"event",category:null===(me=n.type)||void 0===me||null===(_e=me.replace(" ",""))||void 0===_e?void 0:_e.toLowerCase(),eventstatus:g.Yr.getTrackingStatus(n),eventpurpose:n.medical?"medical":"promote",name:n.eventTitle,placement:`${I}|referencecard:(${null==n||null===(pe=n.eventTitle)||void 0===pe?void 0:pe.toString().toLowerCase()})`,position:N,targeturl:u.Z.getFullUrl(`${$.ec}/${n.iconnect_event_number}`,W,!1)},h.createElement(w,{event:n,"data-test-id":`ReferenceCard.Event.${null==n?void 0:n.iconnect_event_number}`,footnotes:null==n||null===(fe=n.fields)||void 0===fe?void 0:fe.footnotes,fullLengthFootnotes:!0,loading:o,onClickTag:()=>{}}))):null}case"cvent":{var ge,ye,Ee;if(!P.isAuthorized(f.AccessLevel.level3,u.Z.getNonLocalizedPathname(x.pathname),null==t?void 0:t.iconnect_event_number)||O)return null;const e=E.find((e=>(null==e?void 0:e.eventNumber)===(null==t?void 0:t.iconnect_event_number))),n={...t,medical:!1,summaryLink:null==e?void 0:e.summaryLink,registrationLink:null==e?void 0:e.registrationLink,location:null==e?void 0:e.location,style:null==e?void 0:e.style,type:f.EventType.LIVE,startDate:null==e?void 0:e.startDate,endD
1ate:null==e?void 0:e.endDate},i=U||n.registrationLink;return e?h.createElement(a.r,{key:n.id,type:"event",category:null===(ge=n.type)||void 0===ge||null===(ye=ge.replace(" ",""))||void 0===ye?void 0:ye.toLowerCase(),eventstatus:g.Yr.getTrackingStatus(n),eventpurpose:n.medical?"medical":"promote",name:n.eventTitle,placement:`${I}|referencecard:(${null===(Ee=n.eventTitle)||void 0===Ee?void 0:Ee.toString().toLowerCase()})`,position:N,targeturl:i},h.createElement(l.ju,{url:i,commercial:!0,external:!0,fullWidth:!0},h.createElement(w,{onClickTag:()=>{},event:n,"data-test-id":`ReferenceCard.Cvent.${null==n?void 0:n.iconnect_event_number}`,loading:o}))):null}case"course":{var Ce,he,Le,be,$e,Ae;const e=null==Y||null===(Ce=Y.data)||void 0===Ce?void 0:Ce.find((e=>{var n;return(null==e||null===(n=e.id)||void 0===n?void 0:n.toString())===(null==t?void 0:t.moodle_course_number)})),n=null===(he=q.data)||void 0===he?void 0:he.find((e=>e.id.toString()===(null==t?void 0:t.moodle_course_number))),i=null==t||!t.event_id||(null==V?void 0:V.find((e=>e.eventNumber===(null==t?void 0:t.event_id)))),a={...t,progress:null==n?void 0:n.progress,duration:null==e||null===(Le=e.tags)||void 0===Le||null===(be=Le.course)||void 0===be?void 0:be.duration,completionStatus:null==n?void 0:n.completionStatus};return e&&i?h.createElement(l.ju,{url:`${$.Al}/${null==a?void 0:a.moodle_course_number}`,fullWidth:!0,commercial:(null===($e=a.regulatory_status)||void 0===$e?void 0:$e.promotional_or_medical)!==f.CMS_MEDICAL_CONTENT},h.createElement(k,{"data-test-id":`ReferenceCard.Course.${a.moodle_course_number}`,course:a,footnotes:null==a||null===(Ae=a.fields)||void 0===Ae?void 0:Ae.footnotes,fullLengthFootnotes:!0,loading:o})):null}default:return n?h.createElement("p",null,`${n} component is not yet defined.`):h.createElement("p",null,"Component not published?")}};t.default=I}}]); 2//# sourceMappingURL=478-0e4e9592bf52f3bf40ab.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.