text: (function(e){function t(t){for(var n,i,r=t[0],c=t[1],l=t[2],d=0,m=[];d<r.length;d++)i=r[d],o[i]&&m.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);u&&u(t);while(m.length)m.shift()();return a.push.apply(a,l||[]),s()}function s(){for(var e,t=0;t<a.length;t++){for(var s=a[t],n=!0,r=1;r<s.length;r++){var c=s[r];0!==o[c]&&(n=!1)}n&&(a.splice(t--,1),e=i(i.s=s[0]))}return e}var n={},o={app:0},a=[];function i(t){if(n[t])return n[t].exports;var s=n[t]={i:t,l:!1,exports:{}};return e[t].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=e,i.c=n,i.d=function(e,t,s){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(s,n,function(t){return e[t]}.bind(null,n));return s},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/Atomic-Categorizer/";var r=window["webpackJsonp"]=window["webpackJsonp"]||[],c=r.push.bind(r);r.push=t,r=r.slice();for(var l=0;l<r.length;l++)t(r[l]);var u=c;a.push([0,"chunk-vendors"]),s()})({0:function(e,t,s){e.exports=s("56d7")},"0786":function(e,t,s){"use strict";var n=s("2a74"),o=s.n(n);o.a},"0b4a":function(e,t,s){},"0be3":function(e,t,s){},"1a5e":function(e,t,s){},"1dcb":function(e,t,s){},2682:function(e,t,s){},"2a74":function(e,t,s){},"30b9":function(e,t,s){"use strict";var n=s("5b51"),o=s.n(n);o.a},"388b":function(e,t,s){"use strict";var n=s("6edc"),o=s.n(n);o.a},"49a5":function(e,t,s){},"56d7":function(e,t,s){"use strict";s.r(t);var n=s("2b0e"),o=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"o-app",attrs:{id:"app"}},[s("header",{staticClass:"o-app__header"},[e._m(0),s("a_infoBlock",[s("p",[e._v("This is an unofficial tool to help you categorize "),s("a",{attrs:{href:"http://bradfrost.com/blog/post/atomic-web-design/"}},[e._v("Atomic Design")]),e._v(" components.")]),s("p",[e._v("Answer the following quiz to help you figure out what category a particular component belongs to.")])])],1),s("main",{staticClass:"o-app__main"},[s("o_quiz",{attrs:{selections:e.selections}}),s("o_recommendation",{attrs:{scores:e.finalScores}}),s("div",{staticClass:"o-app__resetWrap"},[s("a_btn",{on:{click:e.reset}},[e._v("Reset")])],1)],1),s("footer",{staticClass:"o-app__footer"},[s("a_infoBlock",[s("p",[e._v("Fork this project on "),s("a",{attrs:{href:"https://github.com/Dan503/Atomic-Categorizer"}},[e._v("GitHub")])]),s("p",[e._v("This tool is intended to be used as a guide. The scoring system may not be perfect.")])]),s("div",{staticClass:"o-app__status -visuallyHidden",attrs:{role:"status"}},[s("p",[e._v(e._s(e.status))])])],1)])},a=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("h1",{staticClass:"o-app__title"},[e._v("Atomic Categorizer"),s("sup",[e._v(" [Beta]")])])}],i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("form",{staticClass:"o-quiz"},[s("a_restrictor",{staticClass:"o-quiz__restrictor"},[s("ol",{staticClass:"o-quiz__list"},e._l(e.questions,function(t,n){return s("li",{staticClass:"o-quiz__item"},[s("m_question",{key:t.q,attrs:{index:n,question:t,selections:e.selections}})],1)}),0)])],1)},r=[],c=[{q:"Will the component only ever be used once per page?",a:{yes:{o:4,m:1,a:0},no:{o:0,m:2,a:3}}},{q:"Do you expect to use the component in multiple different contexts?",a:{yes:{o:0,m:2,a:3},no:{o:3,m:2,a:0}}},{q:"What element is the outer wrapper for the component?",a:{section:{o:3,m:2,a:0},article:{o:2,m:3,a:0},aside:{o:2,m:2,a:1},nav:{o:4,m:1,a:0},li:{o:0,m:4,a:1},a:{o:0,m:2,a:3},button:{o:0,m:1,a:4},"div wrapped around a single dt and dd element":{o:0,m:1,a:4},other:{o:0,m:0,a:0}}},{q:"Does the component contain a list of repeating components?",a:{yes:{o:4,m:1,a:0},no:{o:1,m:2,a:2}}},{q:"Is the component an item in a list of components?",a:{yes:{o:0,m:4,a:1},no:{o:2,m:1,a:2}}},{q:"Is the component large and complex?",a:{yes:{o:4,m:1,a:0},no:{o:0,m:2,a:3}}},{q:"Does the component consist of only a single element?",a:{yes:{o:0,m:0,a:5},no:{o:2,m:2,a:1}}},{q:"Are there any atom components embedded into the component?",a:{yes:{o:2,m:3,a:0},no:{o:2,m:1,a:2}}},{q:"Are there any molecule components embedded into the component?",a:{yes:{o:4,m:1,a:0},no:{o:0,m:2,a:3}}},{q:"Is or will the component ever be embedded inside a molecule component?",a:{yes:{o:0,m:1,a:4},no:{o:3,m:2,a:0}}},{q:"Is or will the component ever be embedded inside an organism component?",a:{yes:{o:0,m:3,a:2},no:{o:3,m:1,a:1}}}],l=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("article",{staticClass:"m-question",attrs:{"aria-labelledby":e.legendID}},[s("fieldset",{staticClass:"m-question__fieldset"},[s("legend",{staticClass:"m-question__legend",attrs:{id:e.legendID}},[e._v(e._s(e.question.q))]),s("ul",{staticClass:"m-question__answers"},e._l(e.question.a,function(t,n){return s("li",{staticClass:"m-question__answer"},[s("a_radio",{attrs:{describedby:e.descID,label:n,name:e.question.q,points:t,index:e.index,selections:e.selections},on:{update:e.updateScores}})],1)}),0),s("div",{attrs:{id:e.descID}},[e.scores?s("m_scores",{staticClass:"m-question__scores",attrs:{scores:e.scores}}):e._e()],1)])])},u=[],d=new n["a"],m=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("label",{staticClass:"a-radio"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.chosenValue,expression:"chosenValue"}],staticClass:"a-radio__input -visuallyHidden",attrs:{type:"radio",name:e.name,"aria-describedby":e.describedby},domProps:{value:e.label,checked:e._q(e.chosenValue,e.label)},on:{change:[function(t){e.chosenValue=e.label},e.update],reset:e.reset}}),s("span",{staticClass:"a-radio__label a-btn"},[e._v(e._s(e.label))])])},p=[],h=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("button",{staticClass:"a-btn",on:{click:e.click}},[e._t("default")],2)},_=[],f={methods:{click(e){this.$emit("click",e)}}},v=f,g=(s("9f00"),s("2877")),b=Object(g["a"])(v,h,_,!1,null,null,null),y=b.exports,C={components:{a_btn:y},created(){d.$on("reset",()=>this.reset())},mounted(){this.selections[this.index]&&this.update()},data(){return{chosenValue:this.get_url_chosen_value()}},props:["name","label","points","index","describedby","selections"],methods:{update(){this.$emit("update",this.selectionData())},selectionData(){return{points:this.points,qIndex:this.index,question:this.name,selection:this.chosenValue,isReset:!1}},reset(){this.chosenValue="",this.$emit("update",Object.assign(this.selectionData(),{points:{a:0,m:0,o:0},isReset:!0}))},get_url_chosen_value(){const e=this.selections[this.index];return e||""}}},q=C,w=(s("ecfe"),Object(g["a"])(q,m,p,!1,null,null,null)),x=w.exports,O=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"a-score",class:{"-selected":e.selected}},[s("dt",{staticClass:"a-score__name",attrs:{"aria-current":e.selected}},[e._v(e._s(e.name))]),s("dd",{staticClass:"a-score__value"},[e._v(e._s(e.value))])])},j=[],k={props:["name","value","selected"]},$=k,D=(s("ec07"),Object(g["a"])($,O,j,!1,null,null,null)),I=D.exports,H=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("dl",{staticClass:"m-scores"},[s("a_score",{staticClass:"m-scores__score",attrs:{name:"Atom",value:e.scores.a,selected:e.selected.a}}),s("a_score",{staticClass:"m-scores__score",attrs:{name:"Molecule",value:e.scores.m,selected:e.selected.m}}),s("a_score",{staticClass:"m-scores__score",attrs:{name:"Organism",value:e.scores.o,selected:e.selected.o}})],1)},S=[];function E(e){const{a:t,m:s,o:n}=e,o=Math.max(t,s,n),a=Object.keys(e).reduce((t,s)=>e[t]>e[s]?t:s),i=[t,s,n].filter(e=>e===o);return{key:a,value:o,isDraw:i.length>1}}var z={components:{a_score:I},props:{scores:{type:Object,default:()=>({a:0,m:0,o:0})},highlight:{type:Boolean,default:!1}},computed:{selected(){let e={a:!1,m:!1,o:!1};if(!this.highlight)return e;const t=E(this.scores);return t.isDraw||(e[t.key]=!0),e}}},A=z,P=(s("388b"),Object(g["a"])(A,H,S,!1,null,null,null)),V=P.exports,B={data(){return{scores:!1}},components:{a_radio:x,a_score:I,m_scores:V},props:["question","index","selections"],computed:{baseID(){return this.question.q.replace(/\W/g,"")},descID(){return`description-${this.baseID}`},legendID(){return`legend-${this.baseID}`}},methods:{updateScores(e){function t(e){let t={...e};return Object.keys(t).forEach(e=>t[e]=`+${t[e]}`),t}d.$emit("update",e),this.scores=!e.isReset&&t(e.points)}}},M=B,R=(s("f351"),Object(g["a"])(M,l,u,!1,null,null,null)),T=R.exports,N=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"a-restrictor"},[e._t("default")],2)},J=[],W=(s("888f"),{}),F=Object(g["a"])(W,N,J,!1,null,null,null),U=F.exports,G={data:()=>({questions:c}),components:{m_question:T,a_restrictor:U},props:["scores","selections"]},Y=G,K=(s("30b9"),Object(g["a"])(Y,i,r,!1,null,null,null)),L=K.exports,Q=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"a-infoBlock"},[s("a_restrictor",{staticClass:"a-infoBlock__restrictor"},[e._t("default")],2)],1)},X=[],Z={components:{a_restrictor:U}},ee=Z,te=(s("8207"),Object(g["a"])(ee,Q,X,!1,null,null,null)),se=te.exports,ne=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("article",{staticClass:"o-recommendation",class:{"-visible":e.isVisible}},[s("a_restrictor",{staticClass:"o-recommendation__restrictor"},[s("div",{staticClass:"o-recommendation__inner"},[s("h2",{staticClass:"o-recommendation__title"},[e._v("Current recommendation:")]),s("m_scores",{staticClass:"o-recommendation__scores",attrs:{scores:e.scores,highlight:!0}}),s("m_graph",{staticClass:"o-recommendation__graph",attrs:{scores:e.scores}})],1)])],1)},oe=[],ae=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"m-graph",attrs:{"aria-hidden":"true"}},[s("div",{staticClass:"m-graph__chart"},[s("div",{staticClass:"m-graph__column -a",class:{"-isHighest":e.isHighest.a},style:e.style.a}),s("div",{staticClass:"m-graph__column -m",class:{"-isHighest":e.isHighest.m},style:e.style.m}),s("div",{staticClass:"m-graph__column -o",class:{"-isHighest":e.isHighest.o},style:e.style.o})]),s("div",{staticClass:"m-graph__labels"},[s("div",{staticClass:"m-graph__label -a",class:{"-isHighest":e.isHighest.a}},[e._v("A")]),s("div",{staticClass:"m-graph__label -m",class:{"-isHighest":e.isHighest.m}},[e._v("M")]),s("div",{staticClass:"m-graph__label -o",class:{"-isHighest":e.isHighest.o}},[e._v("O")])])])},ie=[],re={props:["scores"],computed:{highest(){return E(this.scores)},isHighest(){const e=e=>this.highest.key===e&&!this.highest.isDraw;return{a:e("a"),m:e("m"),o:e("o")}},percentage(){const{a:e,m:t,o:s}=this.scores,n=e=>e/this.highest.value*100+"%";return{a:n(e),m:n(t),o:n(s)}},style(){const e=e=>`transform: translateY(-${e})`;return{a:e(this.percentage.a),m:e(this.percentage.m),o:e(this.percentage.o)}}}},ce=re,le=(s("e642"),Object(g["a"])(ce,ae,ie,!1,null,null,null)),ue=le.exports,de={components:{a_score:I,a_restrictor:U,m_scores:V,m_graph:ue},props:["scores"],computed:{isVisible(){const e=Object.values(this.scores),t=e.filter(e=>0!==e);return t.length>0}}},me=de,pe=(s("d66b"),Object(g["a"])(me,ne,oe,!1,null,null,null)),he=pe.exports,_e={name:"app",data(){return{scores:{a:[],m:[],o:[]},finalScores:{a:0,m:0,o:0},status:"",selections:ve()||{}}},beforeCreate(){d.$on("update",e=>this.updateScores(e))},updated(){history.pushState(null,"",this.url)},components:{o_quiz:L,o_recommendation:he,a_infoBlock:se,a_btn:y},methods:{updateScores(e){const t=ge(this.scores,e),s=be(t);this.finalScores=s,this.status="",e.isReset||(this.selections[e.qIndex]=e.selection,this.url=fe(this.selections))},reset(){this.selections={},this.url=location.origin+location.pathname,this.status="The quiz has been reset",d.$emit("reset"),window.gtag&&window.gtag("event","reset")}}};function fe(e){const t=JSON.stringify(e),s=location.origin+location.pathname;return`${s}?selections=${encodeURIComponent(t)}`}function ve(){if(!location.search.includes("?selections="))return null;const e=location.search.replace("?selections=","");return JSON.parse(decodeURIComponent(e))}function ge(e,t){for(const s in e)e.hasOwnProperty(s)&&(e[s][t.qIndex]=t.points[s]);return e}function be(e){let t={};for(const s in e)if(e.hasOwnProperty(s)){const n=e[s],o=n.reduce((e,t)=>t+e,0);t[s]=o}return t}var ye=_e,Ce=(s("0786"),s("e7cd"),Object(g["a"])(ye,o,a,!1,null,null,null)),qe=Ce.exports,we=s("9483");Object(we["a"])("/Atomic-Categorizer/service-worker.js",{ready(){console.log("App is being served from cache by a service worker.\nFor more details, visit https://goo.gl/AFskqB")},registered(){console.log("Service worker has been registered.")},cached(){console.log("Content has been cached for offline use.")},updatefound(){console.log("New content is downloading.")},updated(){console.log("New content is available; please refresh.")},offline(){console.log("No internet connection found. App is running in offline mode.")},error(e){console.error("Error during service worker registration:",e)}}),n["a"].config.productionTip=!1,new n["a"]({render:function(e){return e(qe)}}).$mount("#app")},5806:function(e,t,s){},"5b51":function(e,t,s){},"6edc":function(e,t,s){},"81a9":function(e,t,s){},8207:function(e,t,s){"use strict";var n=s("2682"),o=s.n(n);o.a},"888f":function(e,t,s){"use strict";var n=s("af87"),o=s.n(n);o.a},"9f00":function(e,t,s){"use strict";var n=s("49a5"),o=s.n(n);o.a},af87:function(e,t,s){},d66b:function(e,t,s){"use strict";var n=s("0be3"),o=s.n(n);o.a},e642:function(e,t,s){"use strict";var n=s("1dcb"),o=s.n(n);o.a},e7cd:function(e,t,s){"use strict";var n=s("0b4a"),o=s.n(n);o.a},ec07:function(e,t,s){"use strict";var n=s("81a9"),o=s.n(n);o.a},ecfe:function(e,t,s){"use strict";var n=s("5806"),o=s.n(n);o.a},f351:function(e,t,s){"use strict";var n=s("1a5e"),o=s.n(n);o.a}});
  //# sourceMappingURL=app-legacy.21062de8.js.map