(window.webpackJsonp=window.webpackJsonp||[]).push([[107,5,6,7,8,30],{487:function(t,e,n){t.exports={}},488:function(t,e,n){t.exports={}},489:function(t,e,n){t.exports={}},490:function(t,e,n){t.exports={}},492:function(t,e,n){"use strict";n(487)},493:function(t,e,n){"use strict";n.r(e);n(81),n(5);var r={props:{id:{type:String,default:null},default:{type:Object,default:function(){return{size:"lg",sort:"title"}}},options:{type:Array,default:null}},data:function(){return{sort:null,size:null,defaultSort:"title",sizeopts:[{text:"Ruudukko",icon:"grip",value:"lg"},{text:"Lista",icon:"bars",value:"sm"}]}},watch:{id:function(){this.getKategoriat()},size:function(){this.setKategoriat()},sort:function(){this.setKategoriat()}},mounted:function(){this.getKategoriat()},methods:{setKategoriat:function(){var t={size:this.size,sort:this.sort},e=localStorage.kategoriat?JSON.parse(localStorage.kategoriat):{};e[this.id]=t,localStorage.kategoriat=JSON.stringify(e),this.$emit("change",t)},getKategoriat:function(){var t=(localStorage.kategoriat?JSON.parse(localStorage.kategoriat):{})[this.id]||{size:this.default.size,sort:this.default.sort};this.size=t.size||this.default.size,this.sort=t.sort||this.default.sort}}},o=(n(492),n(16)),component=Object(o.a)(r,(function(){var t=this,e=t._self._c;return e("div",[e("span",{staticClass:"op-lajittelu"},[e("label",{attrs:{for:"lajittelu"}},[t._v("Lajittelu:")]),t._v(" "),e("b-form-select",{staticStyle:{"max-width":"11rem"},attrs:{id:"lajittelu",options:t.options,"text-field":"title","value-field":"id"},model:{value:t.sort,callback:function(e){t.sort=e},expression:"sort"}})],1),t._v(" "),e("span",{staticClass:"op-painikkeet"},[t._l(t.sizeopts,(function(n){return[e("span",{key:n.text},[e("label",{attrs:{for:n.text}},[t._v(t._s(n.text))]),t._v(" "),e("b-button",{class:{active:t.size===n.value},attrs:{id:n.text,"aria-label":n.text,"aria-current":t.size===n.value,variant:"outline-secondary"},on:{click:function(e){t.size=n.value}}},[e("fa",{attrs:{icon:["fas",n.icon]}})],1)],1)]}))],2)])}),[],!1,null,"69ced20d",null);e.default=component.exports},494:function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return c}));var r=n(35),o=n(34),l=(n(11),n(21),Object(r.a)((function t(e){Object(o.a)(this,t),this.date=(e.date||(new Date).toISOString()).substr(0,10);var base=window.location.origin+"/",n=base+"media.png";this.title=e.title,this.titleTemplate=e.titleTemplate,this.desc=e.desc?e.desc.replace(/(<([^>]+)>)/gi,"").replace(/\n/gi,""):"",this.url=base+e.url,this.image=e.img?base+"xmedia/"+e.img:n,this.identifier=e.id,this.db=e.db}))),c=function(data){return{title:data.title,titleTemplate:data.titleTemplate||"%s - Duodecim Oppiportti",link:[{hid:"canonical",rel:"canonical",href:data.url}],meta:[{hid:"description",name:"description",content:data.desc},{hid:"robots",name:"robots",content:"index, follow"},{hid:"author",name:"author",content:"Duodecim Oppiportti"},{hid:"publisher",name:"publisher",content:"Kustannus Oy Duodecim"},{hid:"keywords",name:"keywords",content:"duodecim, oppiportti"},{hid:"duo:database",name:"duo:database",content:data.db},{hid:"duo:identifier",name:"duo:identifier",content:data.identifier},{hid:"duo:updated",property:"duo:updated",content:data.date},{hid:"twitter:card",name:"twitter:card",content:"summary"},{hid:"twitter:title",name:"twitter:title",content:data.title},{hid:"twitter:description",name:"twitter:description",content:data.desc},{hid:"twitter:image",name:"twitter:image",content:data.image},{hid:"twitter:site",name:"twitter:site",content:"@DuodecimFi"},{hid:"twitter:creator",name:"twitter:creator",content:"@DuodecimFi"},{hid:"og:site_name",property:"og:site_name",content:"Duodecim Oppiportti"},{hid:"og:type",property:"og:type",content:"article"},{hid:"og:title",property:"og:title",content:data.title},{hid:"og:description",property:"og:description",content:data.desc},{hid:"og:image",property:"og:image",content:data.image},{hid:"og:url",property:"og:url",content:data.url},{hid:"og:updated_time",property:"og:updated_time",content:data.date}]}}},495:function(t,e,n){"use strict";n(488)},496:function(t,e,n){"use strict";n.r(e);n(19);var r={props:{dataset:{type:Object,default:null},size:{type:String,default:"lg"},q:{type:String,default:null},to:{type:String,default:null},route:{type:String,default:"esittely"}},computed:{access:function(){return this.$store.getters["kayttaja/hasAccess"](this.dataset.auth)},kirjanmerkki:function(){return this.dataset.favorite},image:function(){return this.dataset.thumbnail||this.dataset.img},status:function(){var data=this.dataset,t=new Date(data.date),e=new Date(data.date);for(var n in e.setFullYear(t.getFullYear()+1),this.dataset.basic)data[n]=this.dataset.basic[n];switch(!0){case!0===data.completed:return{icon:"check",text:"Suoritettu"};case"Webinaari"===data.type&&t>new Date:return{icon:"calendar-check",text:"Tulossa "+t.toLocaleDateString("fi")};case"Webinaari"===data.type&&new Date>=e:return{icon:"lock",text:"Ei katsottavissa"};case"Webinaari"===data.type&&t.toDateString()===(new Date).toDateString():return{icon:"calendar-check",text:"Koulutus tänään"};case 2===data.userstatus:return{icon:"triangle-exclamation",text:"Suoritus kesken"};case t>new Date:return{icon:"arrow-right",text:"Tulossa"};case!this.access:return{icon:"lock",text:"Ei käyttöoikeutta",cls:"inactive"};case"Webinaari"===data.type:return t.setFullYear(t.getFullYear()+1),{icon:"play",text:"Katso tallenne"};case"3"===data.updatestatus:return{icon:"star",text:"Uutuus",cls:"active"};case data.updated:return{icon:"rotate",text:"Päivitetty",cls:"active"};default:return null}}},methods:{linkParams:function(){var t={name:this.route,params:{id:this.dataset.id||this.dataset.name}};return this.q&&(t.query={q:this.q}),this.to&&(t.query={to:this.to}),t}}},o=(n(495),n(16)),component=Object(o.a)(r,(function(){var t=this,e=t._self._c;return e("nuxt-link",{staticClass:"op-kuvake",class:"op-kuvake-".concat(t.size),attrs:{to:t.localeRoute(t.linkParams())}},[e("b-img-lazy",{staticClass:"op-kuva",attrs:{alt:"",src:t.image?"/xmedia/"+t.image:n(87)}}),t._v(" "),e("div",{staticClass:"op-otsikko"},[e("div",{staticClass:"op-tyyppi"},[t._v(t._s(t.dataset.type||t.dataset.db))]),t._v(" "),e("h3",[t._v(t._s(t.dataset.title))])]),t._v(" "),t.status?e("div",{staticClass:"op-status",class:t.status.cls},[e("fa",{attrs:{icon:["fas",t.status.icon]}}),t._v(" "),e("span",[t._v(t._s(t.status.text))])],1):t._e(),t._v(" "),t.kirjanmerkki?e("div",{staticClass:"op-kirjanmerkki"},[e("fa",{attrs:{icon:["fas","bookmark"]}})],1):t._e()],1)}),[],!1,null,"48520e16",null);e.default=component.exports},497:function(t,e,n){"use strict";n(489)},498:function(t,e,n){"use strict";n.r(e);var r={props:{dataset:{type:Array,default:null},size:{type:String,default:"lg"},q:{type:String,default:null},to:{type:String,default:null},route:{type:String,default:"esittely"}}},o=(n(497),n(16)),component=Object(o.a)(r,(function(){var t=this,e=t._self._c;return e("div",[t.dataset&&t.dataset.length?e("div",[e("div",{staticClass:"op-lista"},t._l(t.dataset,(function(n){return e("AineistoKuvake",{key:n.id,attrs:{dataset:n,size:t.size,to:t.to,q:t.q,route:t.route}})})),1)]):e("div",[t._v("Ei sisältöjä")])])}),[],!1,null,"a7e5a456",null);e.default=component.exports;installComponents(component,{AineistoKuvake:n(496).default})},500:function(t,e,n){"use strict";n(490)},502:function(t,e,n){"use strict";n.r(e);n(81);var r={props:{id:{type:String,default:null},title:{type:String,default:null},desc:{type:String,default:null},dataset:{type:Array,default:null},controls:{type:Boolean,default:!0},options:{type:Array,default:null},defaultSort:{type:String,default:"title"},defaultSize:{type:String,default:"lg"}},data:function(){return{size:"lg",sort:this.defaultSort||"title",opts:[{id:"title",title:"Aakkosjärjestys"},{id:"date",title:"Uusimmat ensin"},{id:"revdate",title:"Vanhimmat ensin"},{id:"suoritus",title:"Suorituksen tila"},{id:"amount",title:"Suosituimmuus"},{id:"rating",title:"Arvioinnit"}]}},computed:{items:function(){return this.$sorters.sortBy(this.dataset,this.sort)}},methods:{changeView:function(t){this.sort=t.sort,this.size=t.size}}},o=(n(500),n(16)),component=Object(o.a)(r,(function(){var t=this,e=t._self._c;return e("b-container",[e("b-row",[e("b-col",[e("YhteinenOtsikko",{attrs:{title:t.title}}),t._v(" "),t.desc?e("p",{staticClass:"op-kuvaus",domProps:{innerHTML:t._s(t.desc)}}):t._e()],1)],1),t._v(" "),e("b-row",[e("b-col",[t._t("default")],2)],1),t._v(" "),t.dataset&&t.controls?e("b-row",[e("b-col",[e("AineistoToiminnot",{attrs:{id:t.id,options:t.options||t.opts,default:{size:t.size,sort:t.sort}},on:{change:t.changeView}})],1)],1):t._e(),t._v(" "),e("AineistoLista",{attrs:{dataset:t.items,size:t.size}})],1)}),[],!1,null,"1d9be3e0",null);e.default=component.exports;installComponents(component,{YhteinenOtsikko:n(320).default,AineistoToiminnot:n(493).default,AineistoLista:n(498).default})},525:function(t,e,n){t.exports={}},561:function(t,e,n){"use strict";n(525)},600:function(t,e,n){"use strict";n.r(e);var r={props:{otsikko:{type:String,default:null},tyyppi:{type:String,default:null},dataset:{type:Array,default:null},all:{type:Boolean,default:!1}}},o=(n(561),n(16)),component=Object(o.a)(r,(function(){var t=this,e=t._self._c;return e("div",[t.all?e("b-container",[e("YhteinenOtsikko",{attrs:{title:t.otsikko}}),t._v(" "),e("ul",{staticClass:"op-aiheet",attrs:{role:"menu"}},t._l(t.dataset,(function(n){return e("li",{key:n.id},[e("nuxt-link",{attrs:{role:"menuitem",to:t.localeRoute({name:n.type,params:{id:n.id}})}},[t._v(t._s(n.title)+" "),e("small",[t._v("("+t._s(n.count)+")")])])],1)})),0)],1):t._e(),t._v(" "),t.all?t._e():e("div",[e("AineistoKategoria",{attrs:{id:"aiheet",title:t.dataset.title,dataset:t.dataset.items}})],1)],1)}),[],!1,null,"545f4374",null);e.default=component.exports;installComponents(component,{YhteinenOtsikko:n(320).default,AineistoKategoria:n(502).default})},773:function(t,e,n){"use strict";n.r(e);n(5),n(4),n(2),n(1),n(6),n(3),n(7);var r=n(0),o=n(12),l=(n(38),n(494));function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var d={asyncData:function(t){return Object(o.a)(regeneratorRuntime.mark((function e(){var n,r,o,l,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.$axios,r=t.route,o=t.error,e.prev=1,l=r.params.id||"aiheet",e.next=5,n.$get("topic/".concat(l));case 5:return c=e.sent,e.abrupt("return",{dataset:c,all:"aiheet"===l});case 9:e.prev=9,e.t0=e.catch(1),o({statusCode:404,message:"Aiheita ei löytynyt"});case 12:case"end":return e.stop()}}),e,null,[[1,9]])})))()},data:function(){return{alldata:null}},head:function(){var data=new l.a({title:this.$t("app.title")+" - "+this.dataset.title,titleTemplate:this.$t("app.title"),desc:this.$t("app.desc"),url:this.$route.fullPath.substring(1)});return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(l.b)(data))}},f=d,h=n(16),component=Object(h.a)(f,(function(){var t=this;return(0,t._self._c)("EtusivuAiheet",{attrs:{otsikko:"Sisällöt aiheittain",all:t.all,dataset:t.dataset}})}),[],!1,null,null,null);e.default=component.exports;installComponents(component,{EtusivuAiheet:n(600).default})}}]);