chatty-pub/front/dist/js/app.76b5943d.js

2 lines
24 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function(e){function t(t){for(var c,u,s=t[0],a=t[1],i=t[2],d=0,p=[];d<s.length;d++)u=s[d],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&p.push(o[u][0]),o[u]=0;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&(e[c]=a[c]);l&&l(t);while(p.length)p.shift()();return r.push.apply(r,i||[]),n()}function n(){for(var e,t=0;t<r.length;t++){for(var n=r[t],c=!0,s=1;s<n.length;s++){var a=n[s];0!==o[a]&&(c=!1)}c&&(r.splice(t--,1),e=u(u.s=n[0]))}return e}var c={},o={app:0},r=[];function u(t){if(c[t])return c[t].exports;var n=c[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.m=e,u.c=c,u.d=function(e,t,n){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},u.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)u.d(n,c,function(t){return e[t]}.bind(null,c));return n},u.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],a=s.push.bind(s);s.push=t,s=s.slice();for(var i=0;i<s.length;i++)t(s[i]);var l=a;r.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"33c1":function(e,t,n){"use strict";n("bbec")},"3d57":function(e,t,n){"use strict";n("c25a")},4008:function(e,t,n){},"40a2":function(e,t,n){},5476:function(e,t,n){"use strict";n("a946")},"56d7":function(e,t,n){"use strict";n.r(t);n("e260"),n("e6cf"),n("cca6"),n("a79d");var c=n("7a23");function o(e,t,n,o,r,u){var s=Object(c["resolveComponent"])("Styles"),a=Object(c["resolveComponent"])("router-view");return Object(c["openBlock"])(),Object(c["createBlock"])("div",{id:"app",class:[{mobile:e.isMobile}]},[Object(c["createVNode"])(s),Object(c["createVNode"])("main",null,[Object(c["createVNode"])(a,null,{default:Object(c["withCtx"])((function(e){var t=e.Component;return[Object(c["createVNode"])(c["Transition"],{name:"component-fade",mode:"out-in"},{default:Object(c["withCtx"])((function(){return[(Object(c["openBlock"])(),Object(c["createBlock"])(Object(c["resolveDynamicComponent"])(t)))]})),_:2},1024)]})),_:1})])],2)}var r=n("5530"),u=(n("ac1f"),n("5319"),n("4de4"),n("2ca0"),n("b0c0"),n("caad"),n("2532"),n("d81d"),n("5502")),s=(n("d3b7"),n("fbb9")),a={username:"pub-bot@chat.hackersanddesigners.nl",apiKey:"m1MDxscGcPQx2RvIfgG4DiSHE1nurxms",realm:"https://chat.hackersanddesigners.nl"},i=function(){return new Promise((function(e,t){s(a).then((function(t){return e(t)})).catch((function(e){return t(e)}))}))},l=function(e){return new Promise((function(t,n){e.streams.retrieve().then((function(e){return t(e)})).catch((function(e){return n(e)}))}))},d=function(e,t,n,c){return new Promise((function(o,r){e.messages.retrieve(c||{anchor:"newest",num_before:100,num_after:0,narrow:[{operator:"stream",operand:t},{operator:"topic",operand:n}]}).then((function(e){return o(e)})).catch((function(e){return r(e)}))}))},p=function(e,t,n){return new Promise((function(c,o){e.messages.retrieve(n||{anchor:"newest",num_before:100,num_after:0,narrow:[{operator:"stream",operand:t}]}).then((function(e){return c(e)})).catch((function(e){return o(e)}))}))},m=function(e,t){e.callOnEachEvent((function(e){return t(e)}),["message"],[{operator:"stream",operand:"chatty"}])},b=function(e){return new Promise((function(t,n){e.streams.subscriptions.retrieve().then((function(e){return t(e)})).catch((function(e){return n(e)}))}))},f=function(e,t){return new Promise((function(n,c){e.users.me.subscriptions.add({subscriptions:JSON.stringify([{name:t}])}).then((function(e){return n(e)})).catch((function(e){return c(e)}))}))},j=function(e,t){return new Promise((function(n,c){e.messages.send(t||{to:"chatty",type:"stream",topic:"content",content:"I come not, friends, to steal away your hearts."}).then((function(e){return n(e)})).catch((function(e){return c(e)}))}))},D={init:i,config:a,getStreams:l,getMsgs:d,getAllMsgs:p,listen:m,sendMsg:j,getSubs:b,addSub:f},O={zulip:D},h=(n("99af"),n("25f0"),n("f5b2"),{methods:{toEmojiCode:function(e){return e.replace(/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])/g,(function(e){return e.codePointAt(0).toString(16)}))},containsEmoji:function(e){var t=/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/gi;return t.test(e)}}}),g={name:"Styles",mixins:[h],computed:Object(r["a"])({},Object(u["c"])(["rules"])),data:function(){return{el:null}},methods:{generateStyleRules:function(){var e=this,t="";return this.rules.map((function(n){n.className.startsWith("@")?t+=n.className:(t+=".".concat(n.parentClassName," ").concat(n.className),e.containsEmoji(n.className)&&(t+=", .".concat(n.parentClassName," .u").concat(e.toEmojiCode(n.className)))),t+="{",n.rules.map((function(e){t+=e})),t+="}"})),t},createStyleElement:function(){var e=document.createElement("style");return e.innerText=this.generateStyleRules(),e}},mounted:function(){this.el=this.createStyleElement(),document.head.appendChild(this.el)},watch:{rules:function(){console.log("rules!");var e=this.createStyleElement();document.head.replaceChild(e,this.el),this.el=e}}},v=g,_={name:"App",components:{Styles:v},data:function(){return{api:O,zulipClient:null}},computed:Object(r["a"])({},Object(u["c"])(["isMobile","pubStr","currentStream"])),created:function(){var e=this;this.$store.commit("setMobile",this.checkIfMobile()),window.addEventListener("resize",(function(){e.$store.commit("setMobile",e.checkIfMobile())})),this.getStreams(),this.$router.afterEach((function(t){e.$store.commit("setTopics",[]),e.$store.commit("setRules",[]),e.$store.commit("setCurStream",t.path.replace("/","")),""!=e.currentStream&&e.setUpDoc(e.currentStream)}))},methods:{checkIfMobile:function(){return window.innerWidth<700},getStreams:function(){var e=this;O.zulip.init().then((function(t){e.zulipClient=t,O.zulip.getStreams(t).then((function(t){e.$store.commit("setStreams",t.streams.filter((function(t){return t.name.startsWith(e.pubStr)})))})),O.zulip.listen(e.zulipClient,e.eventHandler)}))},setUpDoc:function(e){var t=this;O.zulip.getSubs(this.zulipClient).then((function(e){e.subscriptions.map((function(e){return e.name})).includes(t.currentStream)||O.zulip.addSub(t.zulipClient,t.currentStream)})),O.zulip.getAllMsgs(this.zulipClient,e).then((function(e){for(var n=0;n<e.messages.length;n++){var c=e.messages[n];"rules"==c.subject?t.$store.commit("addRule",c):t.$store.commit("addMessage",c)}}))},eventHandler:function(e){switch(console.log(e),e.type){case"message":switch(e.message.subject){case"content":this.$store.commit("addMessage",e.message);break;case"rules":this.$store.commit("addRule",e.message);break}break;case"delete_message":this.$store.commit("deleteMessage",e.message_id);break;case"update_message":this.$store.commit("editMessage",{mid:e.message_id,content:e.rendered_content});break;case"reaction":this.$store.commit("".concat(e.op,"Reaction"),{mid:e.message_id,reaction:{emoji_code:e.emoji_code,emoji_name:e.emoji_name,reaction_type:e.reaction_type}});break;default:console.log("Event type unknown",e.type)}}}};n("c0ee");_.render=o;var k=_,C=n("bc3a"),S=n.n(C),B=n("d4cd"),w=n.n(B),E=n("f03e"),y=n.n(E),F=n("6c02"),N={class:"controls"},A=Object(c["createVNode"])("label",{for:"msg-data"},"Show chat message data",-1);function V(e,t,n,o,r,u){var s=Object(c["resolveComponent"])("Streams"),a=Object(c["resolveComponent"])("pane"),i=Object(c["resolveComponent"])("Content"),l=Object(c["resolveComponent"])("Rules"),d=Object(c["resolveComponent"])("splitpanes");return Object(c["openBlock"])(),Object(c["createBlock"])("div",{class:["pane-wrapper",u.classes]},[e.show_ui?Object(c["createCommentVNode"])("",!0):(Object(c["openBlock"])(),Object(c["createBlock"])("button",{key:0,onClick:t[1]||(t[1]=function(){return u.toggle_ui&&u.toggle_ui.apply(u,arguments)}),class:"float-btn ui"},Object(c["toDisplayString"])(e.show_ui?"Hide":"Show")+" UI ",1)),Object(c["createVNode"])(d,{class:"default-theme"},{default:Object(c["withCtx"])((function(){return[e.show_ui?(Object(c["openBlock"])(),Object(c["createBlock"])(a,{key:0,size:"10","min-size":"5",onResize:u.resizer},{default:Object(c["withCtx"])((function(){return[Object(c["createVNode"])(s),Object(c["createVNode"])("div",N,[Object(c["createVNode"])("button",{onClick:t[2]||(t[2]=function(){return u.toggle_ui&&u.toggle_ui.apply(u,arguments)})},Object(c["toDisplayString"])(e.show_ui?"Hide":"Show")+" UI",1),Object(c["createVNode"])("button",{onClick:t[3]||(t[3]=function(){return u.print&&u.print.apply(u,arguments)})},"Print"),Object(c["withDirectives"])(Object(c["createVNode"])("input",{type:"checkbox",id:"msg-data",value:"1","onUpdate:modelValue":t[4]||(t[4]=function(t){return e.show_message_data=t})},null,512),[[c["vModelCheckbox"],e.show_message_data]]),A])]})),_:1},8,["onResize"])):Object(c["createCommentVNode"])("",!0),Object(c["createVNode"])(a,{size:"55"},{default:Object(c["withCtx"])((function(){return[Object(c["createVNode"])(i,{print:!e.show_ui,show_message_data:e.show_message_data},null,8,["print","show_message_data"])]})),_:1}),e.show_ui?(Object(c["openBlock"])(),Object(c["createBlock"])(a,{key:1,size:"35","min-size":"15"},{default:Object(c["withCtx"])((function(){return[Object(c["createVNode"])(l)]})),_:1})):Object(c["createCommentVNode"])("",!0)]})),_:1})],2)}var M=Object(c["withScopeId"])("data-v-b5c7b5e8");Object(c["pushScopeId"])("data-v-b5c7b5e8");var x={class:"streams"};Object(c["popScopeId"])();var I=M((function(e,t,n,o,r,u){var s=Object(c["resolveComponent"])("Stream");return Object(c["openBlock"])(),Object(c["createBlock"])("section",x,[(Object(c["openBlock"])(!0),Object(c["createBlock"])(c["Fragment"],null,Object(c["renderList"])(e.streams,(function(e){return Object(c["openBlock"])(),Object(c["createBlock"])(s,{key:e.id,stream:e},null,8,["stream"])})),128))])})),T=Object(c["withScopeId"])("data-v-1af39708");Object(c["pushScopeId"])("data-v-1af39708");var P={class:"name"};Object(c["popScopeId"])();var z=T((function(e,t,n,o,r,u){var s=Object(c["resolveComponent"])("router-link");return Object(c["openBlock"])(),Object(c["createBlock"])("div",{class:{selected:u.selected}},[Object(c["createVNode"])("p",P,[Object(c["createVNode"])(s,{to:n.stream.name},{default:T((function(){return[Object(c["createTextVNode"])(Object(c["toDisplayString"])(n.stream.name),1)]})),_:1},8,["to"])])],2)})),$={name:"Stream",props:["stream"],computed:{selected:function(){return this.$store.state.currentStream==this.stream.name}}};n("eebe");$.render=z,$.__scopeId="data-v-1af39708";var R=$,H={name:"Streams",components:{Stream:R},computed:Object(r["a"])({},Object(u["c"])(["streams"]))};n("f021");H.render=I,H.__scopeId="data-v-b5c7b5e8";var L=H,q=Object(c["withScopeId"])("data-v-67c88b0b");Object(c["pushScopeId"])("data-v-67c88b0b");var J={class:"title"};Object(c["popScopeId"])();var U=q((function(e,t,n,o,r,u){var s=Object(c["resolveComponent"])("Chapter");return Object(c["openBlock"])(),Object(c["createBlock"])("section",{class:["content",e.currentStream]},[Object(c["createVNode"])("h1",J,Object(c["toDisplayString"])(e.currentStream.replace("pub-","")),1),(Object(c["openBlock"])(!0),Object(c["createBlock"])(c["Fragment"],null,Object(c["renderList"])(e.sortedTopics,(function(e){return Object(c["openBlock"])(),Object(c["createBlock"])(s,{key:e.title,topic:e,print:n.print,show_message_data:n.show_message_data},null,8,["topic","print","show_message_data"])})),128))],2)})),W=Object(c["withScopeId"])("data-v-756f5686");Object(c["pushScopeId"])("data-v-756f5686");var G={key:0},K=Object(c["createVNode"])("span",null," ",-1),Q=Object(c["createVNode"])("div",{style:{float:"none"}},[Object(c["createVNode"])("div",{style:{"page-break-after":"always"}})],-1);Object(c["popScopeId"])();var X=W((function(e,t,n,o,r,u){var s=Object(c["resolveComponent"])("Message");return Object(c["openBlock"])(),Object(c["createBlock"])("div",{class:["body",n.topic.title]},[Object(c["createVNode"])("h3",{onClick:t[1]||(t[1]=function(e){return r.desiresContent=!r.desiresContent}),class:"header"},[Object(c["createVNode"])("span",{class:"expandToggle",innerHTML:u.toggleSymbol},null,8,["innerHTML"]),Object(c["createVNode"])("span",null,Object(c["toDisplayString"])(n.topic.title),1)]),r.desiresContent||n.print?(Object(c["openBlock"])(),Object(c["createBlock"])("div",G,[(Object(c["openBlock"])(!0),Object(c["createBlock"])(c["Fragment"],null,Object(c["renderList"])(u.messagesToShow,(function(e){return Object(c["openBlock"])(),Object(c["createBlock"])("span",{key:e.id},[Object(c["createVNode"])(s,{message:e,show_message_data:n.show_message_data},null,8,["message","show_message_data"]),K])})),128))])):Object(c["createCommentVNode"])("",!0),Q],2)})),Y=(n("f6d6"),{class:"message-outer"}),Z={key:0,class:"message-data"},ee={class:"from"},te={class:"time"},ne={key:1,class:"message-data-reactions"},ce={class:"reactions ui"};function oe(e,t,n,o,r,u){var s=Object(c["resolveComponent"])("vue3-markdown-it");return Object(c["openBlock"])(),Object(c["createBlock"])("div",Y,[n.show_message_data?(Object(c["openBlock"])(),Object(c["createBlock"])("div",Z,[Object(c["createVNode"])("div",ee,Object(c["toDisplayString"])(n.message.sender_full_name),1),Object(c["createVNode"])("div",te,Object(c["toDisplayString"])(u.time),1)])):Object(c["createCommentVNode"])("",!0),Object(c["createVNode"])("div",{class:[u.classes,"message"]},[Object(c["createVNode"])(s,Object(c["mergeProps"])({source:u.content},e.$mdOpts),null,16,["source"])],2),n.show_message_data?(Object(c["openBlock"])(),Object(c["createBlock"])("div",ne,[(Object(c["openBlock"])(!0),Object(c["createBlock"])(c["Fragment"],null,Object(c["renderList"])(n.message.reactions,(function(e){return Object(c["openBlock"])(),Object(c["createBlock"])("span",{class:"reaction",key:e},Object(c["toDisplayString"])(String.fromCodePoint("0x"+e.emoji_code)),1)})),128))])):Object(c["createCommentVNode"])("",!0),Object(c["createVNode"])("div",ce,[(Object(c["openBlock"])(!0),Object(c["createBlock"])(c["Fragment"],null,Object(c["renderList"])(u.reactions,(function(e){return Object(c["openBlock"])(),Object(c["createBlock"])(c["Fragment"],{key:e},[Object(c["createTextVNode"])(Object(c["toDisplayString"])(e),1)],64)})),128))])])}n("7db0"),n("159b"),n("a15b");var re=n("edbf"),ue=new re,se={name:"Message",props:["message","show_message_data"],mixins:[h],computed:{rawJSON:function(){return"```json\n"+JSON.stringify(this.message,null,2)+"\n```"},content:function(){var e=this,t="https://chat.hackersanddesigners.nl",n=this.message.content.replace("\n","<br/>");n=n.replaceAll('src="','src="'+t),n=n.replaceAll('href="/','href="'+t+"/");var c=this.$store.state.topics.find((function(t){return t.title==e.message.subject})).messages.filter((function(t){return t.responseTo&&t.responseTo.id==e.message.id&&t.responseTo.sender_id==e.message.sender_id&&e.message.content.includes(t.responseTo.quote)}));return c.forEach((function(e){var t=e.reactions.map((function(e){return"u"+e.emoji_code})).join(" ");n=n.replace(e.responseTo.quote,'<span class="'.concat(t,'">').concat(e.responseTo.quote,"</span>"))})),n},reactions:function(){return this.message.reactions.map((function(e){return ue.replace_colons(":"+e.emoji_name+":")}))},classes:function(){return this.message.reactions.map((function(e){return"u"+e.emoji_code}))},time:function(){var e=this.message.timestamp,t=1e3*e,n=new Date(t);return n.toLocaleString()}},created:function(){}};n("5935");se.render=oe;var ae=se,ie={name:"Chapter",components:{Message:ae},data:function(){return{desiresContent:!1}},props:["topic","print","show_message_data"],computed:{toggleSymbol:function(){var e="";return this.print||(e=this.desiresContent?"▼ ":"► "),e},messagesToShow:function(){return this.topic.messages.filter((function(e){return!e.responseTo}))}}};n("9158");ie.render=X,ie.__scopeId="data-v-756f5686";var le=ie,de={name:"Content",components:{Chapter:le},computed:Object(r["a"])(Object(r["a"])({},Object(u["c"])(["currentStream"])),Object(u["b"])(["sortedTopics"])),methods:{},props:["print","show_message_data"]};n("c43d");de.render=U,de.__scopeId="data-v-67c88b0b";var pe=de,me=Object(c["withScopeId"])("data-v-16b43aee");Object(c["pushScopeId"])("data-v-16b43aee");var be={class:"rules"};Object(c["popScopeId"])();var fe=me((function(e,t,n,o,r,u){var s=Object(c["resolveComponent"])("Rule");return Object(c["openBlock"])(),Object(c["createBlock"])("section",be,[(Object(c["openBlock"])(!0),Object(c["createBlock"])(c["Fragment"],null,Object(c["renderList"])(e.rules,(function(e){return Object(c["openBlock"])(),Object(c["createBlock"])(s,{key:e.id,rule:e},null,8,["rule"])})),128))])})),je=Object(c["withScopeId"])("data-v-497ad388");Object(c["pushScopeId"])("data-v-497ad388");var De=Object(c["createVNode"])("p",null,"}",-1);Object(c["popScopeId"])();var Oe=je((function(e,t,n,o,r,u){return Object(c["openBlock"])(),Object(c["createBlock"])("div",{class:"rule",style:n.rule.rules},[Object(c["createVNode"])("p",{title:e.toEmojiCode(n.rule.className)},Object(c["toDisplayString"])(n.rule.className)+" {",9,["title"]),(Object(c["openBlock"])(!0),Object(c["createBlock"])(c["Fragment"],null,Object(c["renderList"])(n.rule.rules,(function(e){return Object(c["openBlock"])(),Object(c["createBlock"])("p",{key:e},"  "+Object(c["toDisplayString"])(e),1)})),128)),De],4)})),he={name:"Rule",mixins:[h],props:["rule"],computed:{}};n("3d57");he.render=Oe,he.__scopeId="data-v-497ad388";var ge=he,ve={name:"Rules",components:{Rule:ge},computed:Object(r["a"])({},Object(u["c"])(["rules"])),watch:{rules:function(){console.log("rules")}}};n("5476");ve.render=fe,ve.__scopeId="data-v-16b43aee";var _e=ve,ke=n("512e"),Ce=(n("c1ea"),n("676e")),Se={name:"Home",components:{Streams:L,Content:pe,Rules:_e,Splitpanes:ke["Splitpanes"],Pane:ke["Pane"]},data:function(){return{show_ui:!0,show_message_data:!1,panel_sizes:{0:10,1:55,2:35}}},computed:{classes:function(){return this.show_ui?"ui":"print"}},methods:{resizer:function(e,t){console.log(e,t)},print:function(){this.toggle_ui(null,!1),setTimeout((function(){window.print()}),1e3);var e=new Ce["Previewer"];console.log(e)},toggle_ui:function(e,t){this.show_ui=void 0!==t?t:!this.show_ui}}};n("33c1");Se.render=V;var Be=Se,we="/",Ee=Object(F["a"])({history:Object(F["b"])(we),routes:[{path:"/",name:"Home",component:Be},{path:"/:pathMatch(.*)*",name:"Home",component:Be}]}),ye=n("2909"),Fe=n("9558"),Ne=(n("a1f0"),n("a630"),n("3ca3"),n("1276"),n("466d"),n("a434"),n("0481"),n("4e82"),n("cd8a")),Ae=n("edbf"),Ve=new Ae,Me=function(e,t){var n="",c="",o=[],r=t,u=e.id,s=Object(Fe["a"])(/[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]?(.+)[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*\n?\{\n?((.*;\n?)+)\}/gm,{selector:1,props:2}),a=Object(Ne["stripHtml"])(e.content).result,i=a.matchAll(s);return i=Array.from(i),i.length>0?(n=Ve.replace_colons(i[0]["groups"]["selector"]),h.methods.containsEmoji(n)&&(c=h.methods.toEmojiCode(n)),o=i[0]["groups"]["props"].split("\n"),o=o.filter((function(e){return xe(e)})),{className:n,emoji_code:c,rules:o,parentClassName:r,id:u}):null},xe=function(e){return e.match(/.+:.+;/gm)},Ie=function(e){e.responseTo={id:e.content.replace(/.*\/near\//gm,"").replace(/\):.*[^]+/gm,""),sender_id:e.content.replace(/@_\*\*.*\|/gm,"").replace(/\*\*.\[said\].*[^]+/gm,""),quote:e.content.replace(/[^]+.*```quote\n/gm,"").replace(/ \n```/gm,"")}},Te=function(e){e.responseTo={id:e.content.replace(/.*\/near\//gm,"").replace(/".*[^]+/gm,""),sender_id:e.content.replace(/[^]+data-user-id="/gm,"").replace(/">[^]+/gm,""),quote:e.content.replace(/.*[^]+<\/p>\n<blockquote>\n<p>/gm,"").replace(/ <\/p>\n<\/blockquote>/gm,"")}},Pe=Object(u["a"])({strict:!1,state:{isMobile:!1,streams:[],currentStream:"",rules:[],topics:[],pubStr:"pub-"},mutations:{setMobile:function(e,t){return e.isMobile=t},setStreams:function(e,t){return e.streams=t},setCurStream:function(e,t){return e.currentStream=t},setTopics:function(e,t){return e.topics=t},addMessage:function(e,t){if(t.display_recipient==e.currentStream){t.content.startsWith("@_**")?Ie(t):t.content.includes("user-mention")&&t.content.includes("blockquote")&&Te(t);var n=e.topics.find((function(e){return e.title==t.subject}));n?n.messages.push(t):e.topics.push({title:t.subject,messages:[t]})}},deleteMessage:function(e,t){var n=t.mid,c=t.subject,o=e.topics.find((function(e){return e.title==c}));if(o){var r=o.messages.find((function(e){return e.id==n}));r&&o.messages.splice(o.messages.indexOf(r),1)}},addReaction:function(e,t){var n=t.mid,c=t.reaction,o=e.topics.map((function(e){return e.messages})).flat().find((function(e){return e.id==n}));o&&o.reactions.push(c)},removeReaction:function(e,t){var n=t.mid,c=t.reaction,o=e.topics.map((function(e){return e.messages})).flat().find((function(e){return e.id==n}));o&&o.reactions.splice(o.reactions.indexOf(c),1)},setRules:function(e,t){e.rules=t.reduce((function(t,n){var c=Me(n,e.currentStream);return null!==c&&t.push(c),t}),[])},addRule:function(e,t){null!==Me(t)&&(e.rules=[].concat(Object(ye["a"])(e.rules),[Me(t,e.currentStream)]))},editMessage:function(e,t){var n=t.mid,c=t.content,o=e.topics.map((function(e){return e.messages})).flat().find((function(e){return e.id==n})),r=e.rules.find((function(e){return e.id==n}));if(o)o.content=c,o.content.startsWith("@_**")?Ie(o):o.content.includes("user-mention")&&o.content.includes("blockquote")&&Te(o);else if(r){var u=[].concat(Object(ye["a"])(e.rules),[Me({id:n,content:c},e.currentStream)]);e.rules=u}},updateTopic:function(e,t){var n=t.orig_subject,c=t.subject,o=e.topics.find((function(e){return e.title==n}));o&&(o.title=c,o.messages.forEach((function(e){return e.subject=c})))}},actions:{},getters:{rules:function(e){return e.rules},sortedTopics:function(e){return Object(ye["a"])(e.topics).sort((function(e,t){return e.title.localeCompare(t.title)})).filter((function(e){return e.messages.length>0}))}}}),ze=(n("85e4"),Object(c["createApp"])(k)),$e={html:!0,linkify:!0,typographer:!0};ze.config.globalProperties.$http=S.a,ze.config.globalProperties.$mdOpts=$e,ze.config.globalProperties.$md=new w.a($e),ze.use(y.a).use(Ee).use(Pe).mount("#app")},5935:function(e,t,n){"use strict";n("b71c")},6338:function(e,t,n){},9158:function(e,t,n){"use strict";n("b81b")},a946:function(e,t,n){},b71c:function(e,t,n){},b81b:function(e,t,n){},bbec:function(e,t,n){},c0ee:function(e,t,n){"use strict";n("40a2")},c25a:function(e,t,n){},c43d:function(e,t,n){"use strict";n("4008")},e915:function(e,t,n){},eebe:function(e,t,n){"use strict";n("6338")},f021:function(e,t,n){"use strict";n("e915")}});
//# sourceMappingURL=app.76b5943d.js.map