owncast/static/web/_next/static/chunks/177.35d11cd14fe99093.js
2023-11-24 06:25:00 +00:00

1 line
No EOL
7.3 KiB
JavaScript
Vendored

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{90177:function(e,t,i){i.r(t),i.d(t,{textile:function(){return r}});var n={addition:"inserted",attributes:"propertyName",bold:"strong",cite:"keyword",code:"monospace",definitionList:"list",deletion:"deleted",div:"punctuation",em:"emphasis",footnote:"variable",footCite:"qualifier",header:"heading",html:"comment",image:"atom",italic:"emphasis",link:"link",linkDefinition:"link",list1:"list",list2:"list.special",list3:"list",notextile:"string.special",pre:"operator",p:"content",quote:"bracket",span:"quote",specialChar:"character",strong:"strong",sub:"content.special",sup:"content.special",table:"variableName.special",tableHeading:"operator"};function startNewLine(e,t){t.mode=l.newLayout,t.tableHeading=!1,"definitionList"===t.layoutType&&t.spanningLayout&&e.match(RE("definitionListEnd"),!1)&&(t.spanningLayout=!1)}function handlePhraseModifier(e,t,i){if("_"===i)return e.eat("_")?togglePhraseModifier(e,t,"italic",/__/,2):togglePhraseModifier(e,t,"em",/_/,1);if("*"===i)return e.eat("*")?togglePhraseModifier(e,t,"bold",/\*\*/,2):togglePhraseModifier(e,t,"strong",/\*/,1);if("["===i)return e.match(/\d+\]/)&&(t.footCite=!0),tokenStyles(t);if("("===i&&e.match(/^(r|tm|c)\)/))return n.specialChar;if("<"===i&&e.match(/(\w+)[^>]+>[^<]+<\/\1>/))return n.html;if("?"===i&&e.eat("?"))return togglePhraseModifier(e,t,"cite",/\?\?/,2);if("="===i&&e.eat("="))return togglePhraseModifier(e,t,"notextile",/==/,2);if("-"===i&&!e.eat("-"))return togglePhraseModifier(e,t,"deletion",/-/,1);if("+"===i)return togglePhraseModifier(e,t,"addition",/\+/,1);if("~"===i)return togglePhraseModifier(e,t,"sub",/~/,1);if("^"===i)return togglePhraseModifier(e,t,"sup",/\^/,1);if("%"===i)return togglePhraseModifier(e,t,"span",/%/,1);if("@"===i)return togglePhraseModifier(e,t,"code",/@/,1);if("!"===i){var a=togglePhraseModifier(e,t,"image",/(?:\([^\)]+\))?!/,1);return e.match(/^:\S+/),a}return tokenStyles(t)}function togglePhraseModifier(e,t,i,n,a){var r=e.pos>a?e.string.charAt(e.pos-a-1):null,o=e.peek();if(t[i]){if((!o||/\W/.test(o))&&r&&/\S/.test(r)){var s=tokenStyles(t);return t[i]=!1,s}}else(!r||/\W/.test(r))&&o&&/\S/.test(o)&&e.match(RegExp("^.*\\S"+n.source+"(?:\\W|$)"),!1)&&(t[i]=!0,t.mode=l.attributes);return tokenStyles(t)}function tokenStyles(e){var t=textileDisabled(e);if(t)return t;var i=[];return e.layoutType&&i.push(n[e.layoutType]),i=i.concat(activeStyles(e,"addition","bold","cite","code","deletion","em","footCite","image","italic","link","span","strong","sub","sup","table","tableHeading")),"header"===e.layoutType&&i.push(n.header+"-"+e.header),i.length?i.join(" "):null}function textileDisabled(e){var t=e.layoutType;switch(t){case"notextile":case"code":case"pre":return n[t];default:if(e.notextile)return n.notextile+(t?" "+n[t]:"");return null}}function activeStyles(e){for(var t=[],i=1;i<arguments.length;++i)e[arguments[i]]&&t.push(n[arguments[i]]);return t}function blankLine(e){var t=e.spanningLayout,i=e.layoutType;for(var n in e)e.hasOwnProperty(n)&&delete e[n];e.mode=l.newLayout,t&&(e.layoutType=i,e.spanningLayout=!0)}var a={cache:{},single:{bc:"bc",bq:"bq",definitionList:/- .*?:=+/,definitionListEnd:/.*=:\s*$/,div:"div",drawTable:/\|.*\|/,foot:/fn\d+/,header:/h[1-6]/,html:/\s*<(?:\/)?(\w+)(?:[^>]+)?>(?:[^<]+<\/\1>)?/,link:/[^"]+":\S/,linkDefinition:/\[[^\s\]]+\]\S+/,list:/(?:#+|\*+)/,notextile:"notextile",para:"p",pre:"pre",table:"table",tableCellAttributes:/[\/\\]\d+/,tableHeading:/\|_\./,tableText:/[^"_\*\[\(\?\+~\^%@|-]+/,text:/[^!"_=\*\[\(<\?\+~\^%@-]+/},attributes:{align:/(?:<>|<|>|=)/,selector:/\([^\(][^\)]+\)/,lang:/\[[^\[\]]+\]/,pad:/(?:\(+|\)+){1,2}/,css:/\{[^\}]+\}/},createRe:function(e){switch(e){case"drawTable":return a.makeRe("^",a.single.drawTable,"$");case"html":return a.makeRe("^",a.single.html,"(?:",a.single.html,")*","$");case"linkDefinition":return a.makeRe("^",a.single.linkDefinition,"$");case"listLayout":return a.makeRe("^",a.single.list,RE("allAttributes"),"*\\s+");case"tableCellAttributes":return a.makeRe("^",a.choiceRe(a.single.tableCellAttributes,RE("allAttributes")),"+\\.");case"type":return a.makeRe("^",RE("allTypes"));case"typeLayout":return a.makeRe("^",RE("allTypes"),RE("allAttributes"),"*\\.\\.?","(\\s+|$)");case"attributes":return a.makeRe("^",RE("allAttributes"),"+");case"allTypes":return a.choiceRe(a.single.div,a.single.foot,a.single.header,a.single.bc,a.single.bq,a.single.notextile,a.single.pre,a.single.table,a.single.para);case"allAttributes":return a.choiceRe(a.attributes.selector,a.attributes.css,a.attributes.lang,a.attributes.align,a.attributes.pad);default:return a.makeRe("^",a.single[e])}},makeRe:function(){for(var e="",t=0;t<arguments.length;++t){var i=arguments[t];e+="string"==typeof i?i:i.source}return new RegExp(e)},choiceRe:function(){for(var e=[arguments[0]],t=1;t<arguments.length;++t)e[2*t-1]="|",e[2*t]=arguments[t];return e.unshift("(?:"),e.push(")"),a.makeRe.apply(null,e)}};function RE(e){return a.cache[e]||(a.cache[e]=a.createRe(e))}var l={newLayout:function(e,t){var i;return e.match(RE("typeLayout"),!1)?(t.spanningLayout=!1,(t.mode=l.blockType)(e,t)):(!textileDisabled(t)&&(e.match(RE("listLayout"),!1)?i=l.list:e.match(RE("drawTable"),!1)?i=l.table:e.match(RE("linkDefinition"),!1)?i=l.linkDefinition:e.match(RE("definitionList"))?i=l.definitionList:e.match(RE("html"),!1)&&(i=l.html)),(t.mode=i||l.text)(e,t))},blockType:function(e,t){var i,n;return(t.layoutType=null,i=e.match(RE("type")))?((i=(n=i[0]).match(RE("header")))?(t.layoutType="header",t.header=parseInt(i[0][1])):n.match(RE("bq"))?t.layoutType="quote":n.match(RE("bc"))?t.layoutType="code":n.match(RE("foot"))?t.layoutType="footnote":n.match(RE("notextile"))?t.layoutType="notextile":n.match(RE("pre"))?t.layoutType="pre":n.match(RE("div"))?t.layoutType="div":n.match(RE("table"))&&(t.layoutType="table"),t.mode=l.attributes,tokenStyles(t)):(t.mode=l.text)(e,t)},text:function(e,t){if(e.match(RE("text")))return tokenStyles(t);var i=e.next();return'"'===i?(t.mode=l.link)(e,t):handlePhraseModifier(e,t,i)},attributes:function(e,t){return(t.mode=l.layoutLength,e.match(RE("attributes")))?n.attributes:tokenStyles(t)},layoutLength:function(e,t){return e.eat(".")&&e.eat(".")&&(t.spanningLayout=!0),t.mode=l.text,tokenStyles(t)},list:function(e,t){var i=e.match(RE("list"));t.listDepth=i[0].length;var n=(t.listDepth-1)%3;return n?1===n?t.layoutType="list2":t.layoutType="list3":t.layoutType="list1",t.mode=l.attributes,tokenStyles(t)},link:function(e,t){return(t.mode=l.text,e.match(RE("link")))?(e.match(/\S+/),n.link):tokenStyles(t)},linkDefinition:function(e){return e.skipToEnd(),n.linkDefinition},definitionList:function(e,t){return e.match(RE("definitionList")),t.layoutType="definitionList",e.match(/\s*$/)?t.spanningLayout=!0:t.mode=l.attributes,tokenStyles(t)},html:function(e){return e.skipToEnd(),n.html},table:function(e,t){return t.layoutType="table",(t.mode=l.tableCell)(e,t)},tableCell:function(e,t){return e.match(RE("tableHeading"))?t.tableHeading=!0:e.eat("|"),t.mode=l.tableCellAttributes,tokenStyles(t)},tableCellAttributes:function(e,t){return(t.mode=l.tableText,e.match(RE("tableCellAttributes")))?n.attributes:tokenStyles(t)},tableText:function(e,t){return e.match(RE("tableText"))?tokenStyles(t):"|"===e.peek()?(t.mode=l.tableCell,tokenStyles(t)):handlePhraseModifier(e,t,e.next())}};let r={name:"textile",startState:function(){return{mode:l.newLayout}},token:function(e,t){return e.sol()&&startNewLine(e,t),t.mode(e,t)},blankLine:blankLine}}}]);