(window.webpackJsonp=window.webpackJsonp||[]).push([["b76c"],{"5RJm":function(e,t,n){"use strict";var o=n("WUsl"),r=n.n(o),i=n("bwDz"),a=n.n(i),l=n("tVXl"),s=n.n(l),c=n("i6as"),d=n.n(c),u=n("xie6"),f=n.n(u);n("NPPL");var p={},h=p;!function(){function e(e){return e}function t(e){return!1}function n(){}n.prototype={htmml:function(e){},chain:function(t,n){var o=this[t];if(!o)throw new Error("unknown hook "+t);this[t]=o===e?n:function(e){var t=Array.prototype.slice.call(arguments,0);return t[0]=o.apply(null,t),n.apply(null,t)}},set:function(e,t){if(!this[e])throw new Error("unknown hook "+e);this[e]=t},addNoop:function(t){this[t]=e},addFalse:function(e){this[e]=t}},p.HookCollection=n;var o={},r={},i={},a=window.document,l=window.RegExp,s=window.navigator,c=72,d={isIE:/msie/.test(s.userAgent.toLowerCase()),isIE_5or6:/msie 6/.test(s.userAgent.toLowerCase())||/msie 5/.test(s.userAgent.toLowerCase()),isOpera:/opera/.test(s.userAgent.toLowerCase())},u={bold:"Strong Ctrl+B",boldexample:"strong text",italic:"Emphasis Ctrl+I",italicexample:"emphasized text",link:"Hyperlink Ctrl+L",linkdescription:"enter link description here",quote:"Quote Ctrl+Q",quoteexample:"Quote",code:"Code Sample
 Ctrl+K",codeexample:"enter code here",image:"Image Ctrl+G",imagedescription:"enter image description here",embed:"Embed",poll:"Poll",olist:"Numbered List Ctrl+O",ulist:"Bulleted List Ctrl+U",litem:"List item",heading:"Heading Ctrl+H",headingexample:"Heading",hr:"Horizontal Separator Ctrl+R",undo:"Undo - Ctrl+Z",redo:"Redo - Ctrl+Y",redomac:"Redo - Ctrl+Shift+Z",help:"Markdown Editing Help"};function f(){}function h(e){this.buttonBar=a.getElementById("wmd-button-bar"+e),this.preview=a.getElementById("wmd-preview"+e),this.input=a.getElementById("wmd-input"+e)}function m(e,t){var n,r,i,a=this,l=[],s=0,c="none",u=function(e,t){c!=e&&(c=e,t||p()),d.isIE&&"moving"==c?i=null:r=setTimeout(f,1)},f=function(e){i=new g(t,e),r=void 0};this.setCommandMode=function(){c="command",p(),r=setTimeout(f,0)},this.canUndo=function(){return s>1},this.canRedo=function(){return!!l[s+1]},this.undo=function(){a.canUndo()&&(n?(n.restore(),n=null):(l[s]=new g(t),l[--s].restore(),e&&e())),c="none",t.input.focus(),f()},this.redo=function(){a.canRedo()&&(l[++s].restore(),e&&e()),c="none",t.input.focus(),f()};var p=function(){var o=i||new g(t);if(!o)return!1;"moving"!=c?(n&&(l[s-1].text!=n.text&&(l[s++]=n),n=null),l[s++]=o,l[s+1]=null,e&&e()):n||(n=o)},h=function(e){var t=!1;if((e.ctrlKey||e.metaKey)&&!e.altKey){var n=e.charCode||e.keyCode;switch(String.fromCharCode(n).toLowerCase()){case"y":a.redo(),t=!0;break;case"z":e.shiftKey?a.redo():a.undo(),t=!0}}t&&(e.preventDefault&&e.preventDefault(),window.event&&(window.event.returnValue=!1))},m=function(e){if(!e.ctrlKey&&!e.metaKey){var t=e.keyCode;t>=33&&t<=40||t>=63232&&t<=63235?u("moving"):8==t||46==t||127==t?u("deleting"):13==t?u("newlines"):27==t?u("escape"):(t<16||t>20)&&91!=t&&u("typing")}};!function(){o.addEvent(t.input,"keypress",function(e){!e.ctrlKey&&!e.metaKey||e.altKey||89!=e.keyCode&&90!=e.keyCode||e.preventDefault()});var e=function(){(d.isIE||i&&i.text!=t.input.value)&&null==r&&(c="paste",p(),f())};o.addEvent(t.input,"keydown",h),o.addEvent(t.input,"keydown",m),o.addEvent(t.input,"mousedown",function(){u("moving")}),t.input.onpaste=e,t.input.ondrop=e}(),f(!0),p()}function g(e,t){var n=this,r=e.input;this.init=function(){o.isVisible(r)&&(!t&&a.activeElement&&a.activeElement!==r||(this.setInputAreaSelectionStartEnd(),this.scrollTop=r.scrollTop,(!this.text&&r.selectionStart||0===r.selectionStart)&&(this.text=r.value)))},this.setInputAreaSelection=function(){if(o.isVisible(r))if(void 0===r.selectionStart||d.isOpera){if(a.selection){if(a.activeElement&&a.activeElement!==r)return;r.focus();var e=r.createTextRange();e.moveStart("character",-r.value.length),e.moveEnd("character",-r.value.length),e.moveEnd("character",n.end),e.moveStart("character",n.start),e.select()}}else r.focus(),r.selectionStart=n.start,r.selectionEnd=n.end,r.scrollTop=n.scrollTop},this.setInputAreaSelectionStartEnd=function(){if(e.ieCachedRange||!r.selectionStart&&0!==r.selectionStart){if(a.selection){n.text=o.fixEolChars(r.value);var t=e.ieCachedRange||a.selection.createRange(),i=o.fixEolChars(t.text),l=""+i+"";t.text=l;var s=o.fixEolChars(r.value);t.moveStart("character",-l.length),t.text=i,n.start=s.indexOf(""),n.end=s.lastIndexOf("")-"".length;var c=n.text.length-o.fixEolChars(r.value).length;if(c){for(t.moveStart("character",-i.length);c--;)i+="\n",n.end+=1;t.text=i}e.ieCachedRange&&(n.scrollTop=e.ieCachedScrollTop),e.ieCachedRange=null,this.setInputAreaSelection()}}else n.start=r.selectionStart,n.end=r.selectionEnd},this.restore=function(){null!=n.text&&n.text!=r.value&&(r.value=n.text),this.setInputAreaSelection(),r.scrollTop=n.scrollTop},this.getChunks=function(){var e=new f;return e.before=o.fixEolChars(n.text.substring(0,n.start)),e.startTag="",e.selection=o.fixEolChars(n.text.substring(n.start,n.end)),e.endTag="",e.after=o.fixEolChars(n.text.substring(n.end)),e.scrollTop=n.scrollTop,e},this.setChunks=function(e){e.before+=e.startTag,e.after=e.endTag+e.after,this.start=e.before.length,this.end=e.before.length+e.selection.length,this.text=e.before+e.selection+e.after,this.scrollTop=e.scrollTop},this.init()}function v(e,t,n){var i,l,s,c=function(){var e=0;return window.innerHeight?e=window.pageYOffset:a.documentElement&&a.documentElement.scrollTop?e=a.documentElement.scrollTop:a.body&&(e=a.body.scrollTop),e},u=function(){if(t.preview){var n=t.input.value;if(!n||n!=s){s=n;var o=(new Date).getTime();n=e.makeHtml(n);var r=(new Date).getTime();l=r-o,v(n)}}},f=function(){i&&(clearTimeout(i),i=void 0);var e=0;(e=l)>3e3&&(e=3e3),i=setTimeout(u,e)};this.refresh=function(e){e?(s="",u()):f()},this.processingTime=function(){return l};var p,h,m=!0,g=function(e){!function(e,t){var n=t.ownerDocument;function o(e,t){for(var o,i=e.childNodes,a=t.childNodes,l=i.length,s=a.length,c=0,d=0;c=c;)e.removeChild(i[p]);d?e.insertBefore(f,e.childNodes[c]):e.appendChild(f)}function r(e,t){return e.nodeName===t.nodeName&&e.nodeType===t.nodeType&&(3===e.nodeType||8===e.nodeType?(e.nodeValue!==t.nodeValue&&(e.nodeValue=t.nodeValue),!0):!(!e.isEqualNode||!e.isEqualNode(t))||(function(e,t){for(var n=e.attributes,o=t.attributes,r=n.length,i=o.length,a=r;--a>=0;){var l=n[a],s=l.namespaceURI,c=l.name;"style"!=l.name&&(t.hasAttributeNS(s,c)||e.removeAttributeNS(s,c))}for(a=i;--a>=0;){var d=o[a],s=d.namespaceURI,c=d.name,u=d.value;"style"!=d.name&&u!==e.getAttributeNS(s,c)&&e.setAttributeNS(s,c,u)}}(e,t),o(e,t),!0))}o(t,function(e,t){var n=t.createRange();return n.selectNode(t.body),n.createContextualFragment(e)}(e,n))}(e,t.preview)},v=function(e){var o,i=r.getTop(t.input)-c();if(t.preview&&(g(e),n()),t.preview&&(t.preview.scrollTop=(t.preview.scrollHeight-t.preview.clientHeight)*((o=t.preview).scrollHeight<=o.clientHeight?1:o.scrollTop/(o.scrollHeight-o.clientHeight))),m)m=!1;else{var a=r.getTop(t.input)-c();d.isIE?setTimeout(function(){window.scrollBy(0,a-i)},0):window.scrollBy(0,a-i)}};p=t.input,h=f,o.addEvent(p,"input",h),p.onpaste=h,p.ondrop=h,o.addEvent(p,"keypress",h),o.addEvent(p,"keydown",h),u(),t.preview&&(t.preview.scrollTop=0)}function w(e,t,n,r,i,a,l){var c=t.input,u={};!function(){var n=t.buttonBar,o=document.createElement("ul");o.id="wmd-button-row"+e,o.className="wmd-button-row",o=n.appendChild(o);var r=0,i=function(t,n,i,a){var l=document.createElement("li");l.className="wmd-button",l.style.left=r+"px",r+=25;var s=document.createElement("span");return s.className=a,l.id=t+e,l.appendChild(s),l.title=n,i&&(l.textOp=i),h(l,!0),o.appendChild(l),l},c=function(e){r+=25};u.bold=i("wmd-bold-button",l("bold"),m("doBold"),"icn-bold"),u.italic=i("wmd-italic-button",l("italic"),m("doItalic"),"icn-italic"),u.heading=i("wmd-heading-button",l("heading"),m("doHeading"),"icn-header"),c(1),u.link=i("wmd-link-button",l("link"),m(function(e,t){return this.doLinkOrImage(e,t,!1)}),"icn-link"),u.image=i("wmd-image-button",l("image"),m(function(e,t){return this.doLinkOrImage(e,t,!0)}),"icn-image"),u.embed=i("wmd-embed-button",l("embed"),m(function(e,t){return this.doEmbed(e,t)}),"icn-play"),u.quote=i("wmd-quote-button",l("quote"),m("doBlockquote"),"icn-quotes-left"),c(2),u.olist=i("wmd-olist-button",l("olist"),m(function(e,t){this.doList(e,t,!0)}),"icn-olist"),u.ulist=i("wmd-ulist-button",l("ulist"),m(function(e,t){this.doList(e,t,!1)}),"icn-ulist"),u.hr=i("wmd-hr-button",l("hr"),m("doHorizontalRule"),"icn-hr"),c(3),u.poll=i("wmd-poll-button",l("poll"),m("doPoll"),"icn-bars"),c(4),u.undo=i("wmd-undo-button",l("undo"),null,"icn-undo"),u.undo.execute=function(e){e&&e.undo()};var d=/win/.test(s.platform.toLowerCase())?l("redo"):l("redomac");if(u.redo=i("wmd-redo-button",d,null,"icn-redo"),u.redo.execute=function(e){e&&e.redo()},a){var f=document.createElement("li"),p=document.createElement("span");p.className="icn-question",f.appendChild(p),f.className="wmd-button wmd-help-button",f.id="wmd-help-button"+e,f.XShift="-240px",f.isHelp=!0,f.style.right="0px",f.title=l("help"),f.onclick=a.handler,h(f,!0),o.appendChild(f),u.help=f}v()}();var f="keydown";function p(e){if(c.focus(),e.textOp){n&&n.setCommandMode();var o=new g(t);if(!o)return;var i=o.getChunks(),a=function(e){c.focus(),i&&o.setChunks(i),o.restore(),r.refresh(e)};e.textOp(i,a)||a()}e.execute&&e.execute(n)}function h(e,t){var n=e.getElementsByTagName("span")[0];t?(n.style.color="#444",e.isHelp||(e.onclick=function(){return p(this),!1})):(n.style.color="#c5c5c5",e.onmouseover=e.onmouseout=e.onclick=function(){})}function m(e){return"string"==typeof e&&(e=i[e]),function(){e.apply(i,arguments)}}function v(){n&&(h(u.undo,n.canUndo()),h(u.redo,n.canRedo()))}d.isOpera&&(f="keypress"),o.addEvent(c,f,function(e){if((e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey){var t=e.charCode||e.keyCode;switch(String.fromCharCode(t).toLowerCase()){case"b":p(u.bold);break;case"i":p(u.italic);break;case"l":p(u.link);break;case"q":p(u.quote);break;case"k":p(u.code);break;case"g":p(u.image);break;case"o":p(u.olist);break;case"u":p(u.ulist);break;case"h":p(u.heading);break;case"r":p(u.hr);break;case"y":p(u.redo);break;case"z":e.shiftKey?p(u.redo):p(u.undo);break;default:return}e.preventDefault&&e.preventDefault(),window.event&&(window.event.returnValue=!1)}}),o.addEvent(c,"keyup",function(e){if(e.shiftKey&&!e.ctrlKey&&!e.metaKey&&13===(e.charCode||e.keyCode)){var t={};t.textOp=m("doAutoindent"),p(t)}}),d.isIE&&o.addEvent(c,"keydown",function(e){if(27===e.keyCode)return!1}),this.setUndoRedoButtonStates=v}function b(e,t,n){this.hooks=e,this.getString=t,this.converter=n}p.Editor=function(e,t,n){"function"==typeof(n=n||{}).handler&&(n={helpButton:n}),n.strings=n.strings||{},n.helpButton&&(n.strings.help=n.strings.help||n.helpButton.title);var o=function(e){return n.strings[e]||u[e]};t=t||"";var r=this.hooks=new p.HookCollection;r.addNoop("onPreviewRefresh"),r.addNoop("postBlockquoteCreation"),this.getConverter=function(){return e};var i,l=this;this.run=function(){if(!i){i=new h(t);var s,c,d=new b(r,o,e),u=new v(e,i,function(){r.onPreviewRefresh()});/\?noundo/.test(a.location.href)||(s=new m(function(){u.refresh(),c&&c.setUndoRedoButtonStates()},i),this.textOperation=function(e){s.setCommandMode(),e(),l.refreshPreview()}),(c=new w(t,i,s,u,d,n.helpButton,o)).setUndoRedoButtonStates(),(l.refreshPreview=function(){u.refresh(!0)})()}}},f.prototype.findTags=function(e,t){var n,r=this;e&&(n=o.extendRegExp(e,"","$"),this.before=this.before.replace(n,function(e){return r.startTag+=e,""}),n=o.extendRegExp(e,"^",""),this.selection=this.selection.replace(n,function(e){return r.startTag+=e,""})),t&&(n=o.extendRegExp(t,"","$"),this.selection=this.selection.replace(n,function(e){return r.endTag=e+r.endTag,""}),n=o.extendRegExp(t,"^",""),this.after=this.after.replace(n,function(e){return r.endTag=e+r.endTag,""}))},f.prototype.trimWhitespace=function(e){var t,n,o=this;e?t=n="":(t=function(e){return o.before+=e,""},n=function(e){return o.after=e+o.after,""}),this.selection=this.selection.replace(/^(\s*)/,t).replace(/(\s*)$/,n)},f.prototype.skipLines=function(e,t,n){var o,r;if(void 0===e&&(e=1),void 0===t&&(t=1),e++,t++,navigator.userAgent.match(/Chrome/)&&"X".match(/()./),this.selection=this.selection.replace(/(^\n*)/,""),this.startTag=this.startTag+l.$1,this.selection=this.selection.replace(/(\n*$)/,""),this.endTag=this.endTag+l.$1,this.startTag=this.startTag.replace(/(^\n*)/,""),this.before=this.before+l.$1,this.endTag=this.endTag.replace(/(\n*$)/,""),this.after=this.after+l.$1,this.before){for(o=r="";e--;)o+="\\n?",r+="\n";n&&(o="\\n*"),this.before=this.before.replace(new l(o+"$",""),r)}if(this.after){for(o=r="";t--;)o+="\\n?",r+="\n";n&&(o="\\n*"),this.after=this.after.replace(new l(o,""),r)}},o.isVisible=function(e){return window.getComputedStyle?"none"!==window.getComputedStyle(e,null).getPropertyValue("display"):e.currentStyle?"none"!==e.currentStyle.display:void 0},o.addEvent=function(e,t,n){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},o.removeEvent=function(e,t,n){e.detachEvent?e.detachEvent("on"+t,n):e.removeEventListener(t,n,!1)},o.fixEolChars=function(e){return e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n")},o.extendRegExp=function(e,t,n){null==t&&(t=""),null==n&&(n="");var o,r=e.toString();return r=(r=r.replace(/\/([gim]*)$/,function(e,t){return o=t,""})).replace(/(^\/|\/$)/g,""),new l(r=t+r+n,o)},r.getTop=function(e,t){var n=e.offsetTop;if(!t)for(;e=e.offsetParent;)n+=e.offsetTop;return n},r.getHeight=function(e){return e.offsetHeight||e.scrollHeight},r.getWidth=function(e){return e.offsetWidth||e.scrollWidth},r.getPageSize=function(){var e,t,n,o;return self.innerHeight&&self.scrollMaxY?(e=a.body.scrollWidth,t=self.innerHeight+self.scrollMaxY):a.body.scrollHeight>a.body.offsetHeight?(e=a.body.scrollWidth,t=a.body.scrollHeight):(e=a.body.offsetWidth,t=a.body.offsetHeight),self.innerHeight?(n=self.innerWidth,o=self.innerHeight):a.documentElement&&a.documentElement.clientHeight?(n=a.documentElement.clientWidth,o=a.documentElement.clientHeight):a.body&&(n=a.body.clientWidth,o=a.body.clientHeight),[Math.max(e,n),Math.max(t,o),n,o]},i.prompt=function(e,t){return angular.injector(["ng","footyroom"]).get("$uibModal").open(e).result.then(t)};var T=b.prototype;T.prefixes="(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)",T.unwrap=function(e){var t=new l("([^\\n])\\n(?!(\\n|"+this.prefixes+"))","g");e.selection=e.selection.replace(t,"$1 $2")},T.wrap=function(e,t){this.unwrap(e);var n=new l("(.{1,"+t+"})( +|$\\n?)","gm"),o=this;e.selection=e.selection.replace(n,function(e,t){return new l("^"+o.prefixes,"").test(e)?e:t+"\n"}),e.selection=e.selection.replace(/\s+$/,"")},T.doBold=function(e,t){return this.doBorI(e,t,2,this.getString("boldexample"))},T.doItalic=function(e,t){return this.doBorI(e,t,1,this.getString("italicexample"))},T.doBorI=function(e,t,n,o){e.trimWhitespace(),e.selection=e.selection.replace(/\n{2,}/g,"\n");var r=/(\**$)/.exec(e.before)[0],i=/(^\**)/.exec(e.after)[0],a=Math.min(r.length,i.length);if(a>=n&&(2!=a||1!=n))e.before=e.before.replace(l("[*]{"+n+"}$",""),""),e.after=e.after.replace(l("^[*]{"+n+"}",""),"");else if(!e.selection&&i){e.after=e.after.replace(/^([*_]*)/,""),e.before=e.before.replace(/(\s?)$/,"");var s=l.$1;e.before=e.before+i+s}else{e.selection||i||(e.selection=o);var c=n<=1?"*":"**";e.before+=c,e.after=c+e.after}},T.stripLinkDefs=function(e,t){return e=e.replace(/^[ ]{0,3}\[(\d+)\]:[ \t]*\n?[ \t]*?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|$)/gm,function(e,n,o,r,i){return t[n]=e.replace(/\s*$/,""),r?(t[n]=e.replace(/["(](.+?)[")]$/,""),r+i):""})},T.addLinkDef=function(e,t){var n=0,o={};e.before=this.stripLinkDefs(e.before,o),e.selection=this.stripLinkDefs(e.selection,o),e.after=this.stripLinkDefs(e.after,o);for(var r="",i=/(\[)((?:\[[^\]]*\]|[^\[\]])*)(\][ ]?(?:\n[ ]*)?\[)(\d+)(\])/g,a=e.before+e.selection+e.after,l=this.converter.makeHtml(a),s="http://this-is-a-real-link.biz/";-1!=l.indexOf(s);)s+="nicetry/";var c="\n\n",d=0,u=a.replace(i,function e(t,n,o,r,a,l,u){c+=" ["+(d+=u)+"]: "+s+d+"/unicorn\n",d+=n.length;var f=n+(o=o.replace(i,e))+r+(d-=n.length)+l;return d-=u,f});l=this.converter.makeHtml(u+c);var f=function(e){n++,e=e.replace(/^[ ]{0,3}\[(\d+)\]:/,"  ["+n+"]:"),r+="\n"+e},p=function e(t,r,a,c,u,p,h){return function(e){return-1!==l.indexOf(s+e+"/unicorn")}(d+h)?(d+=h+r.length,a=a.replace(i,e),d-=h+r.length,o[u]?(f(o[u]),r+a+c+n+p):t):t},h=e.before.length;e.before=e.before.replace(i,p),d+=h,h=e.selection.length,t?f(t):e.selection=e.selection.replace(i,p),d+=h;var m=n;return e.after=e.after.replace(i,p),e.after&&(e.after=e.after.replace(/\n*$/,"")),e.after||(e.selection=e.selection.replace(/\n*$/,"")),e.after+="\n\n"+r,m},T.doLinkOrImage=function(e,t,n){if(e.trimWhitespace(),e.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\[.*?\])?/),!(e.endTag.length>1&&e.startTag.length>0)){if(e.selection=e.startTag+e.selection+e.endTag,e.startTag=e.endTag="",/\n\n/.test(e.selection))return void this.addLinkDef(e,null);var o=this,r=function(r){if(null!==r){e.selection=(" "+e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1);var i=" [999]: "+r.replace(/^\s*(.*?)(?:\s+"(.+)")?\s*$/,function(e,t,n){var o=!1;return t=t.replace(/%(?:[\da-fA-F]{2})|\?|\+|[^\w\d-.\/[\]]/g,function(e){if(3===e.length&&"%"==e.charAt(0))return e.toUpperCase();switch(e){case"?":return o=!0,"?";case"+":if(o)return"%20"}return encodeURI(e)}),n&&(n=(n=n.trim?n.trim():n.replace(/^\s*/,"").replace(/\s*$/,"")).replace(/"/g,"quot;").replace(/\(/g,"(").replace(/\)/g,")").replace(//g,">")),n?t+' "'+n+'"':t}),a=o.addLinkDef(e,i);e.startTag=n?"![":"[",e.endTag="]["+a+"]",e.selection||(e.selection=n?o.getString("imagedescription"):o.getString("linkdescription"))}t()};return n?i.prompt({template:""},r):i.prompt({templateUrl:"/views/ng/modal/insert-link.html"},r),!0}e.startTag=e.startTag.replace(/!?\[/,""),e.endTag="",this.addLinkDef(e,null)},T.doEmbed=function(e,t){e.selection="Paste a link to content from another site (e.g. Youtube, Twitter and many others)",e.skipLines(2,1,!0)},T.doAutoindent=function(e,t){var n=!1;e.before=e.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ \t]+\n$/,"\n\n"),e.selection||/^[ \t]*(?:\n|$)/.test(e.after)||(e.after=e.after.replace(/^[^\n]*/,function(t){return e.selection=t,""}),n=!0),/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(e.before)&&this.doList&&this.doList(e),/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(e.before)&&this.doBlockquote&&this.doBlockquote(e),/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&this.doCode&&this.doCode(e),n&&(e.after=e.selection+e.after,e.selection="")},T.doBlockquote=function(e,t){e.selection=e.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,function(t,n,o,r){return e.before+=n,e.after=r+e.after,o}),e.before=e.before.replace(/(>[ \t]*)$/,function(t,n){return e.selection=n+e.selection,""}),e.selection=e.selection.replace(/^(\s|>)+$/,""),e.selection=e.selection||this.getString("quoteexample");var n,o="",r="";if(e.before){for(var i=e.before.replace(/\n$/,"").split("\n"),a=!1,l=0;l0,/^>/.test(n)?(s=!0,!a&&n.length>1&&(a=!0)):s=!!/^[ \t]*$/.test(n)||a,s?o+=n+"\n":(r+=o+n,o="\n")}/(^|\n)>/.test(o)||(r+=o,o="")}e.startTag=o,e.before=r,e.after&&(e.after=e.after.replace(/^\n?/,"\n")),e.after=e.after.replace(/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/,function(t){return e.endTag=t,""});var d=function(t){var n=t?"> ":"";e.startTag&&(e.startTag=e.startTag.replace(/\n((>|\s)*)\n$/,function(e,t){return"\n"+t.replace(/^[ ]{0,3}>?[ \t]*$/gm,n)+"\n"})),e.endTag&&(e.endTag=e.endTag.replace(/^\n((>|\s)*)\n/,function(e,t){return"\n"+t.replace(/^[ ]{0,3}>?[ \t]*$/gm,n)+"\n"}))};/^(?![ ]{0,3}>)/m.test(e.selection)?(this.wrap(e,c-2),e.selection=e.selection.replace(/^/gm,"> "),d(!0),e.skipLines()):(e.selection=e.selection.replace(/^[ ]{0,3}> ?/gm,""),this.unwrap(e),d(!1),!/^(\n|^)[ ]{0,3}>/.test(e.selection)&&e.startTag&&(e.startTag=e.startTag.replace(/\n{0,2}$/,"\n\n")),!/(\n|^)[ ]{0,3}>.*$/.test(e.selection)&&e.endTag&&(e.endTag=e.endTag.replace(/^\n{0,2}/,"\n\n"))),e.selection=this.hooks.postBlockquoteCreation(e.selection),/\n/.test(e.selection)||(e.selection=e.selection.replace(/^(> *)/,function(t,n){return e.startTag+=n,""}))},T.doCode=function(e,t){var n=/\S[ ]*$/.test(e.before);if(!/^[ ]*\S/.test(e.after)&&!n||/\n/.test(e.selection)){e.before=e.before.replace(/[ ]{4}$/,function(t){return e.selection=t+e.selection,""});var o=1,r=1;/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&(o=0),/^\n(\t|[ ]{4,})/.test(e.after)&&(r=0),e.skipLines(o,r),e.selection?/^[ ]{0,3}\S/m.test(e.selection)?/\n/.test(e.selection)?e.selection=e.selection.replace(/^/gm,"    "):e.before+="    ":e.selection=e.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t)/gm,""):(e.startTag="    ",e.selection=this.getString("codeexample"))}else e.trimWhitespace(),e.findTags(/`/,/`/),e.startTag||e.endTag?e.endTag&&!e.startTag?(e.before+=e.endTag,e.endTag=""):e.startTag=e.endTag="":(e.startTag=e.endTag="`",e.selection||(e.selection=this.getString("codeexample")))},T.doList=function(e,t,n){var o=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/,r="-",i=1,a=function(){var e;return n?(e=" "+i+". ",i++):e=" "+r+" ",e},s=function(e){return void 0===n&&(n=/^\s*\d/.test(e)),e=e.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,function(e){return a()})};if(e.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null),!e.before||/\n$/.test(e.before)||/^\n/.test(e.startTag)||(e.before+=e.startTag,e.startTag=""),e.startTag){var d=/\d+[.]/.test(e.startTag);if(e.startTag="",e.selection=e.selection.replace(/\n[ ]{4}/g,"\n"),this.unwrap(e),e.skipLines(),d&&(e.after=e.after.replace(o,s)),n==d)return}var u=1;e.before=e.before.replace(/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/,function(e){return/^\s*([*+-])/.test(e)&&(r=l.$1),u=/[^\n]\n\n[^\n]/.test(e)?1:0,s(e)}),e.selection||(e.selection=this.getString("litem"));var f=a(),p=1;e.after=e.after.replace(o,function(e){return p=/[^\n]\n\n[^\n]/.test(e)?1:0,s(e)}),e.trimWhitespace(!0),e.skipLines(u,p,!0),e.startTag=f;var h=f.replace(/./g," ");this.wrap(e,c-h.length),e.selection=e.selection.replace(/\n/g,"\n"+h)},T.doHeading=function(e,t){if(e.selection=e.selection.replace(/\s+/g," "),e.selection=e.selection.replace(/(^\s+|\s+$)/g,""),!e.selection)return e.startTag="## ",e.selection=this.getString("headingexample"),void(e.endTag=" ##");var n=0;e.findTags(/#+[ ]*/,/[ ]*#+/),/#+/.test(e.startTag)&&(n=l.lastMatch.length),e.startTag=e.endTag="",e.findTags(null,/\s?(-+|=+)/),/=+/.test(e.endTag)&&(n=1),/-+/.test(e.endTag)&&(n=2),e.startTag=e.endTag="",e.skipLines(1,1);var o=0==n?2:n-1;if(o>0){var r=o>=2?"-":"=",i=e.selection.length;for(i>c&&(i=c),e.endTag="\n";i--;)e.endTag+=r}},T.doHorizontalRule=function(e,t){e.startTag="----------\n",e.selection="",e.skipLines(2,1,!0)},T.doPoll=function(e,t){var n,o=(e.before+e.after).match(/\[poll id=([a-f\d]+)\]/i);o&&(n='poll-id="'+o[1]+'"'),i.prompt({template:"'},function(n){o||(e.startTag="[poll id="+n.id+"]\n",e.skipLines(1,0,!0));delete window["pollCache-"+n.id],t(!0)})}}(),angular.module("footyroom").service("markdown",function(){var e=new r.a.Converter({extensions:[a.a,s.a,f.a,d.a],simplifiedAutoLink:!0,tables:!0});return{render:function(t){return e.makeHtml(t)},_converter:e}}).directive("markdownEditor",["$timeout","$compile","markdown",function(e,t,n){var o=0;return{restrict:"E",template:'
',scope:{content:"=",showPreview:"=",previewEl:"=?",rows:"=?",placeholder:"=?"},link:function(r,i,a){function l(){r.showHelp=!r.showHelp,r.$apply()}r.rows=r.rows||12,r.editorId=o++,e(function(){var e=document.querySelector("#wmd-input-"+r.editorId),o=r.previewEl?document.querySelector(r.previewEl):document.querySelector(".wmd-preview");o.setAttribute("id","wmd-preview-"+r.editorId);var i=new h.Editor(n._converter,"-"+r.editorId,{handler:l});e.value=r.content||window.localStorage.getItem("markdownContent"),r.$watch("content",function(t,n){window.localStorage.setItem("markdownContent",e.value),t!==e.value&&(e.value=t,i.refreshPreview())}),i.hooks.chain("onPreviewRefresh",function(){r.content!==e.value&&r.$apply(function(){r.content=e.value}),o&&t(o.innerHTML)(r)}),i.run()})}}}]).directive("forumEditor",function(){return{restrict:"E",template:'
  • Say it
  • Cancel
',scope:{showPreview:"=",content:"=",errors:"=",submit:"=onSubmit",cancel:"=onCancel"}}}).directive("forumCommenter",["$http","$window",function(e,t){var n;return{restrict:"E",template:'\n \n \n ',scope:{commentId:"=",showPreview:"=",postId:"=",cancel:"=onCancel"},link:function(o,r){o.commentId&&(r.find("markdown-editor").litelay({spinner:!0}),e.get("/comments/"+o.commentId).then(function(e){o.content=e.data.comment.content,r.find("markdown-editor").litelay({off:!0})})),o.submit=function(){(function(t){if(!n)return n=!0,r.find("markdown-editor").litelay({spinner:!0}),o.commentId?e.put("/forum/comments/"+o.commentId,{content:o.content}):e.post("/forum/comments",{content:o.content,honeypot:o.nameEmailUrl,postId:o.postId})})().then(function(){window.localStorage.removeItem("markdownContent"),t.location.reload()}).catch(function(e){o.errors=e.data.errors||"Something went wrong, but we don't know what. Try again later or report this to us.",n=!1,r.find("markdown-editor").litelay({off:!0})})}}}}]).directive("frMarkdownIframe",function(){return{restrict:"A",link:function(e,t,n){t.bind("click",function(e){t.replaceWith('
')})}}})},DqgX:function(e,t){angular.module("footyroom").directive("frPoll",[function(){return{templateUrl:"/views/ng/poll/poll.html?2",scope:{frPoll:"@"},controllerAs:"ctrl",bindToController:!0,controller:["$http",function(e){var t=this;function n(n){return e.get("/polls/"+n).then(function(e){t.poll=e.data,t.selectedChoice=t.poll.userVote,t.showPollResult=t.poll.userVote>=0})}t.$onInit=void n(t.frPoll),t.toggleResults=function(){t.showPollResult=!t.showPollResult},t.vote=function(){if(t.voting)return;t.voting=!0;var o={pollRef:"poll-"+t.poll.id,choices:[{value:t.selectedChoice}]};e.post("/vote-poll",o).then(function(){return n(t.frPoll)}).catch(function(e){t.errors=e.data.errors}).finally(function(){t.voting=!1})}}]}}])},T8I6:function(e,t,n){"use strict";n("NPPL");angular.module("footyroom").directive("frPollEditorModal",function(){return{templateUrl:"/views/ng/poll/pollEditorModal.html?2",scope:{pollId:"@",dismiss:"=",close:"="},controllerAs:"ctrl",bindToController:!0,controller:["$http","$uibModal",function(e,t){var n,o=this;o.$onInit=function(){o.pollId?e.get("/polls/"+o.pollId).then(function(e){o.poll=e.data}):o.poll={choices:[{},{}]}},o.submit=function(){if(n)return;n=!0,function(){if(o.pollId)return e.put("/polls/"+o.pollId,{choices:o.poll.choices});return e.post("/polls",{choices:o.poll.choices})}().then(function(e){e.data.id&&(o.poll.id=e.data.id),o.close(o.poll)}).catch(function(e){o.errors=e.data.errors}).finally(function(){n=!1})},o.addChoice=function(){o.poll.choices.push({})},o.removeChoice=function(e){o.poll.choices.splice(e,1)},o.chooseImage=function(e){t.open({template:""}).result.then(function(t){e.image=t})}}]}})},i6as:function(e,t,n){!function(){function t(){var e,t=window.frameElement.getAttribute("data-src");setInterval(function(){!function(){var t=window.document.documentElement.offsetHeight;e!==t&&(window.frameElement.style.height=t+"px");e=t}(),function(){var e=window.frameElement.getAttribute("data-src");t!==e&&(window.frameElement.src="javascript: unescape(window.frameElement.getAttribute('src-doc'));");t=e}()},1e3)}function n(e,n){var o="("+t.toString()+")();";return'
'}function o(){var e=angular.injector(["ng","footyroom"]).get("urlEmbedder");return[{type:"lang",filter:function(t){return t.replace(/^((?:[-+*] |\d+\. |>)? *)((?:https:\/\/|www\.)[^'">\s]+\.[^'">\s]+)( *$)/gm,function(t,o,r,i){var a=e.get(r);return a?n(a,r):o+'"+i})}}]}angular.module("footyroom").directive("autoEmbed",["urlEmbedder",function(e){return{link:function(t,o,r){if(void 0===e.get(r.href))var i=angular.element('').appendTo(o);e.fetch(r.href).then(function(e){e&&o.replaceWith(n(e,r.href))}).finally(function(){i.remove()})}}}]).service("urlEmbedder",["$http","$q",function(e,t){var n=this;n.cache={},n.get=function(e){return n.cache[e]},n.fetch=function(o){if(void 0!==n.cache[o])return t.when(this.cache[o]);return e.get("/embed?url="+o).then(function(e){return n.cache[o]=e.data.html}).catch(function(){return n.cache[o]=null})}}]),window&&window.showdown&&(window.showdown.extensions.autoembed=o),e.exports=o}()},tVXl:function(e,t,n){!function(){function t(){return[{type:"lang",filter:function(e){return e.replace(/^( *(\d+\. {1,4}|[\w\<\'\">\-*+])[^\n]*)\n{1}(?!\n| *\d+\. {1,4}| *[-*+] +|#|$)/gm,function(e){return e.trim()+" \n"})}}]}window&&window.showdown&&(window.showdown.extensions.newline=t),e.exports=t}()},xie6:function(e,t,n){!function(){function t(){return[{type:"lang",filter:function(e){return e.replace(/^\[poll id=([a-f\d]+)\]\s*$/gm,function(e,t){return window["pollCache-"+t]?window["pollCache-"+t].replace(/fr-poll(-preview)?="(.*?)"/g,"").replace(/ng-/g,"not-ng-").replace(/ngIf/g,"not-ngIf").replace(/ngRepeat/g,"not-ngRepeat").replace(/\s+/g," "):'
'})}}]}angular.module("footyroom").directive("frPollPreview",[function(){return{require:"frPoll",link:function(e,t,n,o){t.prepend('
'),e.$watch(function(){return o.poll},function(e){e&&(delete o.showPollResult,delete o.selectedChoice,setTimeout(function(){window["pollCache-"+o.frPoll]=t[0].outerHTML},0))})}}}]),window&&window.showdown&&(window.showdown.extensions.poll=t),e.exports=t}()}}]);