mirror of
https://github.com/WenPai-org/wpmind.git
synced 2025-08-03 11:11:27 +08:00
7 lines
No EOL
71 KiB
JavaScript
7 lines
No EOL
71 KiB
JavaScript
(()=>{"use strict";var e,t={606:(e,t,n)=>{var r={};n.r(r),n.d(r,{getSettingsPageURL:()=>p,isConnected:()=>u});var s={};n.r(s),n.d(s,{getHighlightBlocks:()=>g});var i={};n.r(i),n.d(i,{removeHighlightBlocks:()=>f,setHighlightBlocks:()=>m});var o={};n.r(o),n.d(o,{close:()=>J,open:()=>X,processStream:()=>ae,requestAI:()=>ce,reset:()=>le,setContext:()=>te,setError:()=>oe,setInput:()=>ee,setInsertionPlace:()=>ne,setLoading:()=>se,setResponse:()=>ie,setScreen:()=>re,toggle:()=>Y});var l={};n.r(l),n.d(l,{getContext:()=>he,getError:()=>we,getInput:()=>pe,getInsertionPlace:()=>de,getLoading:()=>me,getProgress:()=>ke,getRenderBuffer:()=>be,getResponse:()=>fe,getScreen:()=>ge,isOpen:()=>ue});const{connected:a,settingsPageURL:c}=window.mindData;function u(){return"1"===a}function p(){return c}const h=window.wp.data,d=(0,h.createReduxStore)("mind",{selectors:r,reducer:e=>e});(0,h.register)(d);function g(e){return e?.highlightBlocks||[]}function m(e){return{type:"SET_HIGHLIGHT_BLOCKS",highlightBlocks:e}}function f(e){return{type:"REMOVE_HIGHLIGHT_BLOCKS",removeBlocks:e}}const k=(0,h.createReduxStore)("mind/blocks",{reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{highlightBlocks:[]},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t.type){case"SET_HIGHLIGHT_BLOCKS":if(t.highlightBlocks&&t.highlightBlocks.length)return{...e,highlightBlocks:[...e.highlightBlocks,...t.highlightBlocks]};break;case"REMOVE_HIGHLIGHT_BLOCKS":if(e.highlightBlocks&&e.highlightBlocks.length&&t.removeBlocks&&t.removeBlocks.length)return{...e,highlightBlocks:e.highlightBlocks.filter((e=>!t.removeBlocks.includes(e)))}}return e},selectors:s,actions:i});(0,h.register)(k);let b={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function w(e){b=e}const _=/[&<>"']/,x=new RegExp(_.source,"g"),E=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,y=new RegExp(E.source,"g"),v={"&":"&","<":"<",">":">",'"':""","'":"'"},S=e=>v[e];function O(e,t){if(t){if(_.test(e))return e.replace(x,S)}else if(E.test(e))return e.replace(y,S);return e}const C=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,T=/(^|[^\[])\^/g;function I(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r="object"==typeof r&&"source"in r?r.source:r).replace(T,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}function R(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const $={exec:()=>null};function P(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function M(e,t,n){const r=e.length;if(0===r)return"";let s=0;for(;s<r;){const i=e.charAt(r-s-1);if(i!==t||n){if(i===t||!n)break;s++}else s++}return e.slice(0,r-s)}function A(e,t,n,r){const s=t.href,i=t.title?O(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:s,title:i,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:s,title:i,text:O(o)}}class B{options;rules;lexer;constructor(e){this.options=e||b}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:M(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=M(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=M(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let o="",l="",a=!1;for(;e;){let n=!1;if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;o=t[0],e=e.substring(o.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,l=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,l=r.slice(u),u+=t[1].length);let p=!1;if(!r&&/^ *$/.test(c)&&(o+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const a=e.split("\n",1)[0];if(c=a,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),s.test(c))break;if(i.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=u||!c.trim())l+="\n"+c.slice(u);else{if(p)break;if(r.search(/[^ ]/)>=4)break;if(s.test(r))break;if(i.test(r))break;if(n.test(r))break;l+="\n"+c}p||c.trim()||(p=!0),o+=a+"\n",e=e.substring(a.length+1),r=c.slice(u)}}s.loose||(a?s.loose=!0:/\n *\n *$/.test(o)&&(a=!0));let h,d=null;this.options.gfm&&(d=/^\[[ xX]\] /.exec(l),d&&(h="[ ] "!==d[0],l=l.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:o,task:!!d,checked:h,loose:!1,text:l,tokens:[]}),s.raw+=o}s.items[s.items.length-1].raw=o.trimEnd(),s.items[s.items.length-1].text=l.trimEnd(),s.raw=s.raw.trimEnd();for(let e=0;e<s.items.length;e++)if(this.lexer.state.top=!1,s.items[e].tokens=this.lexer.blockTokens(s.items[e].text,[]),!s.loose){const t=s.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));s.loose=n}if(s.loose)for(let e=0;e<s.items.length;e++)s.items[e].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){if(!/[:|]/.test(t[2]))return;const e={type:"table",raw:t[0],header:P(t[1]).map((e=>({text:e,tokens:[]}))),align:t[2].replace(/^\||\| *$/g,"").split("|"),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){let t,n,r,s,i=e.align.length;for(t=0;t<i;t++){const n=e.align[t];n&&(/^ *-+: *$/.test(n)?e.align[t]="right":/^ *:-+: *$/.test(n)?e.align[t]="center":/^ *:-+ *$/.test(n)?e.align[t]="left":e.align[t]=null)}for(i=e.rows.length,t=0;t<i;t++)e.rows[t]=P(e.rows[t],e.header.length).map((e=>({text:e,tokens:[]})));for(i=e.header.length,n=0;n<i;n++)e.header[n].tokens=this.lexer.inline(e.header[n].text);for(i=e.rows.length,n=0;n<i;n++)for(s=e.rows[n],r=0;r<s.length;r++)s[r].tokens=this.lexer.inline(s[r].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:O(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=M(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),A(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return A(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(r&&(!r[3]||!n.match(/[\p{L}\p{N}]/u))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){const n=[...r[0]].length-1;let s,i,o=n,l=0;const a="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=a.exec(t));){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(i=[...s].length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){l+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+l);const t=[...r[0]][0].length,a=e.slice(0,n+r.index+t+i);if(Math.min(n,i)%2){const e=a.slice(1,-1);return{type:"em",raw:a,text:e,tokens:this.lexer.inlineTokens(e)}}const c=a.slice(2,-2);return{type:"strong",raw:a,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=O(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=O(t[1]),n="mailto:"+e):(e=O(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=O(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0]}while(r!==t[0]);e=O(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:O(t[0]),{type:"text",raw:t[0],text:e}}}}const z={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:$,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};z.def=I(z.def).replace("label",z._label).replace("title",z._title).getRegex(),z.bullet=/(?:[*+-]|\d{1,9}[.)])/,z.listItemStart=I(/^( *)(bull) */).replace("bull",z.bullet).getRegex(),z.list=I(z.list).replace(/bull/g,z.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+z.def.source+")").getRegex(),z._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",z._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,z.html=I(z.html,"i").replace("comment",z._comment).replace("tag",z._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),z.lheading=I(z.lheading).replace(/bull/g,z.bullet).getRegex(),z.paragraph=I(z._paragraph).replace("hr",z.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",z._tag).getRegex(),z.blockquote=I(z.blockquote).replace("paragraph",z.paragraph).getRegex(),z.normal={...z},z.gfm={...z.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},z.gfm.table=I(z.gfm.table).replace("hr",z.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",z._tag).getRegex(),z.gfm.paragraph=I(z._paragraph).replace("hr",z.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",z.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",z._tag).getRegex(),z.pedantic={...z.normal,html:I("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",z._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:$,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:I(z.normal._paragraph).replace("hr",z.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",z.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const j={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:$,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:$,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/,_punctuation:"\\p{P}$+<=>`^|~"};j.punctuation=I(j.punctuation,"u").replace(/punctuation/g,j._punctuation).getRegex(),j.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,j.anyPunctuation=/\\[punct]/g,j._escapes=/\\([punct])/g,j._comment=I(z._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),j.emStrong.lDelim=I(j.emStrong.lDelim,"u").replace(/punct/g,j._punctuation).getRegex(),j.emStrong.rDelimAst=I(j.emStrong.rDelimAst,"gu").replace(/punct/g,j._punctuation).getRegex(),j.emStrong.rDelimUnd=I(j.emStrong.rDelimUnd,"gu").replace(/punct/g,j._punctuation).getRegex(),j.anyPunctuation=I(j.anyPunctuation,"gu").replace(/punct/g,j._punctuation).getRegex(),j._escapes=I(j._escapes,"gu").replace(/punct/g,j._punctuation).getRegex(),j._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,j._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,j.autolink=I(j.autolink).replace("scheme",j._scheme).replace("email",j._email).getRegex(),j._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,j.tag=I(j.tag).replace("comment",j._comment).replace("attribute",j._attribute).getRegex(),j._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,j._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,j._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,j.link=I(j.link).replace("label",j._label).replace("href",j._href).replace("title",j._title).getRegex(),j.reflink=I(j.reflink).replace("label",j._label).replace("ref",z._label).getRegex(),j.nolink=I(j.nolink).replace("ref",z._label).getRegex(),j.reflinkSearch=I(j.reflinkSearch,"g").replace("reflink",j.reflink).replace("nolink",j.nolink).getRegex(),j.normal={...j},j.pedantic={...j.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:I(/^!?\[(label)\]\((.*?)\)/).replace("label",j._label).getRegex(),reflink:I(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",j._label).getRegex()},j.gfm={...j.normal,escape:I(j.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},j.gfm.url=I(j.gfm.url,"i").replace("email",j.gfm._extended_email).getRegex(),j.breaks={...j.gfm,br:I(j.br).replace("{2,}","*").getRegex(),text:I(j.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class L{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||b,this.options.tokenizer=this.options.tokenizer||new B,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:z.normal,inline:j.normal};this.options.pedantic?(t.block=z.pedantic,t.inline=j.pedantic):this.options.gfm&&(t.block=z.gfm,this.options.breaks?t.inline=j.breaks:t.inline=j.gfm),this.tokenizer.rules=t}static get rules(){return{block:z,inline:j}}static lex(e,t){return new L(t).lex(e)}static lexInline(e,t){return new L(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,s,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=s.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,s,i,o,l,a=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(a));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(a));)a=a.slice(0,i.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(o||(l=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,l))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(l=n.raw.slice(-1)),o=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class N{options;constructor(e){this.options=e||b}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+O(r)+'">'+(n?e:O(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:O(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const r=R(e);if(null===r)return n;let s='<a href="'+(e=r)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>",s}image(e,t,n){const r=R(e);if(null===r)return n;let s=`<img src="${e=r}" alt="${n}"`;return t&&(s+=` title="${t}"`),s+=">",s}text(e){return e}}class q{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class U{options;renderer;textRenderer;constructor(e){this.options=e||b,this.options.renderer=this.options.renderer||new N,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new q}static parse(e,t){return new U(t).parse(e)}static parseInline(e,t){return new U(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const s=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const e=s,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(s.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=s;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,this.parseInline(e.tokens,this.textRenderer).replace(C,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")));continue}case"code":{const e=s;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=s;let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let i="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];r="";for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});i+=this.renderer.tablerow(r)}n+=this.renderer.table(t,i);continue}case"blockquote":{const e=s,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=s,t=e.ordered,r=e.start,i=e.loose;let o="";for(let t=0;t<e.items.length;t++){const n=e.items[t],r=n.checked,s=n.task;let l="";if(n.task){const e=this.renderer.checkbox(!!r);i?n.tokens.length>0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):l+=e+" "}l+=this.parse(n.tokens,i),o+=this.renderer.listitem(l,s,!!r)}n+=this.renderer.list(o,t,r);continue}case"html":{const e=s;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=s;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let i=s,o=i.tokens?this.parseInline(i.tokens):i.text;for(;r+1<e.length&&"text"===e[r+1].type;)i=e[++r],o+="\n"+(i.tokens?this.parseInline(i.tokens):i.text);n+=t?this.renderer.paragraph(o):o;continue}default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const s=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){n+=e||"";continue}}switch(s.type){case"escape":{const e=s;n+=t.text(e.text);break}case"html":{const e=s;n+=t.html(e.text);break}case"link":{const e=s;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=s;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=s;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=s;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=s;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=s;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=s;n+=t.text(e.text);break}default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class H{options;constructor(e){this.options=e||b}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}const D=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(L.lex,U.parse);parseInline=this.#e(L.lexInline,U.parseInline);Parser=U;Renderer=N;TextRenderer=q;Lexer=L;Tokenizer=B;Hooks=H;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{n=n.concat(this.walkTokens(e[r],t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new N(this.defaults);for(const n in e.renderer){const r=e.renderer[n],s=n,i=t[s];t[s]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new B(this.defaults);for(const n in e.tokenizer){const r=e.tokenizer[n],s=n,i=t[s];t[s]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new H;for(const n in e.hooks){const r=e.hooks[n],s=n,i=t[s];H.passThroughHooks.has(n)?t[s]=e=>{if(this.defaults.async)return Promise.resolve(r.call(t,e)).then((e=>i.call(t,e)));const n=r.call(t,e);return i.call(t,n)}:t[s]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return L.lex(e,t??this.defaults)}parser(e,t){return U.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const s={...r},i={...this.defaults,...s};!0===this.defaults.async&&!1===s.async&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const o=this.#t(!!i.silent,!!i.async);if(null==n)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then((t=>e(t,i))).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>t(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(o);try{i.hooks&&(n=i.hooks.preprocess(n));const r=e(n,i);i.walkTokens&&this.walkTokens(r,i.walkTokens);let s=t(r,i);return i.hooks&&(s=i.hooks.postprocess(s)),s}catch(e){return o(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+O(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Z(e,t){return D.parse(e,t)}function Q(e){let t=Z.parse(e);return t=t.replace(/<pre><code/g,"<pre").replace(/<\/code><\/pre>/g,"</pre>"),t}Z.options=Z.setOptions=function(e){return D.setOptions(e),Z.defaults=D.defaults,w(Z.defaults),Z},Z.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},Z.defaults=b,Z.use=function(...e){return D.use(...e),Z.defaults=D.defaults,w(Z.defaults),Z},Z.walkTokens=function(e,t){return D.walkTokens(e,t)},Z.parseInline=D.parseInline,Z.Parser=U,Z.parser=U.parse,Z.Renderer=N,Z.TextRenderer=q,Z.Lexer=L,Z.lexer=L.lex,Z.Tokenizer=B,Z.Hooks=H,Z.parse=Z,Z.options,Z.setOptions,Z.use,Z.walkTokens,Z.parseInline,U.parse,L.lex,Z.use({headerIds:!1});const F={isOpen:!1,input:"",context:"",insertionPlace:"",screen:"",loading:!1,response:"",error:null,progress:{charsProcessed:0,queueSize:0,isComplete:!1},renderBuffer:{content:"",lastUpdate:0}},G=window.wp.i18n,W=window.wp.apiFetch;var K=n.n(W);class V{constructor(e){this.dispatch=e,this.buffer="",this.responseText="",this.decoder=new TextDecoder,this.lastUpdate=Date.now(),this.updateQueue=[],this.isProcessing=!1,this.CONFIG={CHUNK_DELAY:30,UPDATE_INTERVAL:50,BATCH_SIZE:3,MAX_QUEUE_SIZE:100,TYPING_SPEED:{FAST:20,MEDIUM:35,SLOW:50}}}async processStream(e){try{for(this.startQueueProcessor();;){const{value:t,done:n}=await e.read();if(n)break;await this.processChunk(t)}await this.flushQueue(),this.sendCompletion()}catch(e){this.handleError(e)}}async processChunk(e){const t=this.decoder.decode(e,{stream:!0}),n=this.parseChunks(t);for(const e of n)await this.queueUpdate(e)}parseChunks(e){const t=[],n=e.split("\n");for(const e of n)if(e.startsWith("data: "))try{const n=JSON.parse(e.slice(6));n.content&&t.push(n.content)}catch(e){console.debug("Chunk parse error:",e)}return t}async queueUpdate(e){this.updateQueue.push(e),this.updateQueue.length>this.CONFIG.MAX_QUEUE_SIZE&&await this.flushQueue()}async startQueueProcessor(){if(!this.isProcessing){for(this.isProcessing=!0;this.updateQueue.length>0;){const e=this.updateQueue.splice(0,this.CONFIG.BATCH_SIZE);await this.processBatch(e)}this.isProcessing=!1}}async processBatch(e){const t=e.join("");this.responseText+=t;const n=Date.now();n-this.lastUpdate>=this.CONFIG.UPDATE_INTERVAL&&(this.dispatch({type:"REQUEST_AI_CHUNK",payload:{content:this.responseText,progress:this.calculateProgress()}}),this.lastUpdate=n),await new Promise((e=>setTimeout(e,this.CONFIG.CHUNK_DELAY)))}calculateProgress(){return{charsProcessed:this.responseText.length,queueSize:this.updateQueue.length,isComplete:!1}}async flushQueue(){for(;this.updateQueue.length>0;)await this.startQueueProcessor()}sendCompletion(){this.dispatch({type:"REQUEST_AI_SUCCESS",payload:{content:this.responseText,progress:{isComplete:!0}}})}handleError(e){this.dispatch({type:"REQUEST_AI_ERROR",payload:e.message})}}function X(){return{type:"OPEN"}}function J(){return{type:"CLOSE"}}function Y(){return{type:"TOGGLE"}}function ee(e){return{type:"SET_INPUT",input:e}}function te(e){return{type:"SET_CONTEXT",context:e}}function ne(e){return{type:"SET_INSERTION_PLACE",insertionPlace:e}}function re(e){return{type:"SET_SCREEN",screen:e}}function se(e){return{type:"SET_LOADING",loading:e}}function ie(e){return{type:"SET_RESPONSE",response:e}}function oe(e){return{type:"SET_ERROR",error:e}}function le(){return{type:"RESET"}}function ae(e){return async({dispatch:t})=>{const n=new TextDecoder;let r="",s="";const i=e=>new Promise((t=>setTimeout(t,e)));try{for(;;){const{value:o,done:l}=await e.read();if(l)break;r+=n.decode(o,{stream:!0});const a=r.split("\n");r=a.pop()||"";for(const e of a)if(e.startsWith("data: "))try{const n=JSON.parse(e.slice(6));if(n.error)return void t({type:"REQUEST_AI_ERROR",payload:n.message});if(n.done)return void t({type:"REQUEST_AI_SUCCESS",payload:s});n.content&&(s+=n.content,t({type:"REQUEST_AI_CHUNK",payload:s}),await i(50))}catch(e){t({type:"REQUEST_AI_ERROR",payload:(0,G.__)("Failed to parse stream data","mind")})}}}catch(e){t({type:"REQUEST_AI_ERROR",payload:e.message})}}}function ce(){return async({dispatch:e,select:t})=>{if(!u)return;if(t.getLoading())return;e({type:"REQUEST_AI_PENDING"});const n=t.getContext(),r={request:t.getInput()};"selected-blocks"===n&&(r.context=function(){const{getBlock:e,getSelectedBlockClientIds:t}=wp.data.select("core/block-editor"),n=t();let r="";return n.forEach((t=>{const n=e(t);n?.attributes?.content&&(r=`${r}<p>${n.attributes.content}</p>`)})),r}());try{const t=new V(e),n=await K()({path:"/mind/v1/request_ai",method:"POST",data:r,parse:!1});if(!n.ok){const e=await n.json();throw new Error(e.message||(0,G.__)("Failed to fetch AI response","mind"))}await t.processStream(n.body.getReader())}catch(t){e({type:"REQUEST_AI_ERROR",payload:t.message||(0,G.__)("Failed to fetch AI response","mind")})}}}function ue(e){return e?.isOpen||!1}function pe(e){return e?.input||""}function he(e){return e?.context||""}function de(e){return e?.insertionPlace||""}function ge(e){return e?.screen||""}function me(e){return e?.loading||!1}function fe(e){return e?.response||!1}function ke(e){return e?.progress||!1}function be(e){return e?.renderBuffer||!1}function we(e){return e?.error||!1}const _e=(0,h.createReduxStore)("mind/popup",{reducer:function(e=F,t={}){switch(t.type){case"CLOSE":if(e.isOpen)return{...e,isOpen:!1};break;case"OPEN":if(!e.isOpen)return{...e,isOpen:!0};break;case"TOGGLE":return{...e,isOpen:!e.isOpen};case"SET_INPUT":if(e.input!==t.input)return{...e,input:t.input};break;case"SET_CONTEXT":if(e.context!==t.context)return{...e,context:t.context};break;case"SET_INSERTION_PLACE":if(e.insertionPlace!==t.insertionPlace)return{...e,insertionPlace:t.insertionPlace};break;case"SET_SCREEN":if(e.screen!==t.screen)return{...e,screen:t.screen};break;case"SET_LOADING":if(e.loading!==t.loading)return{...e,loading:t.loading};break;case"SET_RESPONSE":if(e.response!==t.response)return{...e,response:t.response};break;case"SET_ERROR":if(e.error!==t.error)return{...e,error:t.error};break;case"REQUEST_AI_PENDING":return{...e,isOpen:!0,loading:!0,response:"",error:null,screen:"request",progress:F.progress,renderBuffer:F.renderBuffer};case"REQUEST_AI_CHUNK":const n=Date.now();return n-e.renderBuffer.lastUpdate>=50?{...e,loading:!0,response:!!t.payload.content&&Q(t.payload.content),progress:t.payload.progress,renderBuffer:{content:t.payload.content,lastUpdate:n}}:{...e,renderBuffer:{content:t.payload.content,lastUpdate:e.renderBuffer.lastUpdate}};case"REQUEST_AI_SUCCESS":return{...e,loading:!1,response:!!t.payload.content&&Q(t.payload.content),progress:{...t.payload.progress,isComplete:!0},renderBuffer:{content:t.payload.content,lastUpdate:Date.now()}};case"REQUEST_AI_ERROR":return{...e,loading:!1,response:!1,error:t.payload||"",progress:F.progress,renderBuffer:F.renderBuffer};case"RESET":return{...e,input:"",context:"",insertionPlace:"",screen:"",response:!1,error:!1,loading:!1}}return e},actions:o,selectors:l});(0,h.register)(_e);const xe=window.wp.element,Ee=window.wp.components,ye=window.wp.blocks,ve=window.wp.domReady;var Se=n.n(ve);function Oe(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Oe(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}const Ce=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Oe(e))&&(r&&(r+=" "),r+=t);return r},Te=window.React;var Ie;function Re(){return Re=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Re.apply(this,arguments)}var $e=function(e){return Te.createElement("svg",Re({xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 66 66"},e),Ie||(Ie=Te.createElement("path",{fill:"currentColor",d:"M24.667 24.316C28.83 20.17 31.675 11 31.675 11s2.59 9.163 6.658 13.316C42.531 28.601 52 31.325 52 31.325s-9.477 2.717-13.667 7.008C34.186 42.581 31.675 52 31.675 52s-2.767-9.425-7.008-13.667C20.425 34.093 11 31.325 11 31.325s9.417-2.776 13.667-7.009ZM48.667 51.521C50.393 49.802 51.573 46 51.573 46s1.073 3.8 2.76 5.521C56.073 53.298 60 54.427 60 54.427s-3.93 1.127-5.667 2.906c-1.72 1.762-2.76 5.667-2.76 5.667s-1.148-3.908-2.906-5.667C46.908 55.575 43 54.427 43 54.427s3.904-1.15 5.667-2.906ZM6.667 45.573C7.784 44.46 8.547 42 8.547 42s.695 2.458 1.786 3.573c1.127 1.15 3.667 1.88 3.667 1.88s-2.543.729-3.667 1.88C9.221 50.473 8.547 53 8.547 53s-.742-2.529-1.88-3.667S3 47.453 3 47.453s2.526-.745 3.667-1.88ZM50.333 6.222C51.653 4.907 52.556 2 52.556 2s.82 2.905 2.11 4.222C55.999 7.581 59 8.444 59 8.444s-3.005.862-4.333 2.223C53.352 12.014 52.556 15 52.556 15s-.878-2.988-2.223-4.333C48.99 9.322 46 8.444 46 8.444s2.986-.88 4.333-2.222Z"})))};function Pe(e){const{onInsert:t}=e,n=(0,xe.useRef)(),{reset:r,setInput:s,setScreen:i,requestAI:o}=(0,h.useDispatch)("mind/popup"),{isOpen:l,input:a,context:c,screen:u,loading:p,response:d}=(0,h.useSelect)((e=>{const{isOpen:t,getInput:n,getContext:r,getScreen:s,getLoading:i,getResponse:o}=e("mind/popup");return{isOpen:t(),input:n(),context:r(),screen:s(),loading:i(),response:o()}}));let g=c;switch(c){case"selected-blocks":g=(0,G.__)("Selected Blocks");break;case"post-title":g=(0,G.__)("Post Title")}return(0,xe.useEffect)((()=>{l&&!p&&n?.current&&n.current.focus()}),[l,p,n]),(0,xe.useEffect)((()=>{""===u&&a&&i("request")}),[u,a,i]),(0,xe.useEffect)((()=>{if(n?.current){n.current.style.height="0px";const e=n.current.scrollHeight;n.current.style.height=e+"px"}}),[n,a]),(0,xe.createElement)("div",{className:"mind-popup-input"},(0,xe.createElement)($e,null),(0,xe.createElement)("textarea",{ref:n,placeholder:(0,G.__)("Ask AI to write anything…","mind"),value:a,onChange:e=>{s(e.target.value)},onKeyDown:function(e){""===u||"Backspace"!==e.key||e.target.value?!d||"Enter"!==e.key||e.shiftKey?"request"!==u||"Enter"!==e.key||e.shiftKey||o():t():r()},disabled:p,rows:1}),g?(0,xe.createElement)("span",{className:"mind-popup-input-context"},g):null)}function Me(){return(0,xe.createElement)("div",{className:"mind-popup-loading-line"},(0,xe.createElement)("span",null))}function Ae(e){const{type:t,children:n}=e;return(0,xe.createElement)("div",{className:"mind-popup-notice "+(t?`mind-popup-notice-${t}`:"")},n)}const Be=(0,xe.memo)((function({response:e,loading:t}){const n=(0,xe.useRef)();return(0,xe.useEffect)((()=>{if(!n.current)return;const e=n.current.closest(".mind-popup-content");if(!e)return;const{scrollHeight:t,clientHeight:r}=e;t-r<1e3&&e.scrollTo({top:t,behavior:"smooth"})}),[e]),e||t?(0,Te.createElement)("div",{ref:n,className:"mind-popup-response",style:{opacity:t?.85:1}},(0,Te.createElement)(xe.RawHTML,null,e),t&&(0,Te.createElement)("div",{className:"mind-popup-cursor"})):null}),((e,t)=>e.renderBuffer.lastUpdate===t.renderBuffer.lastUpdate&&e.loading===t.loading&&e.progress.isComplete===t.progress.isComplete));var ze,je,Le,Ne,qe,Ue,He,De,Ze,Qe,Fe;function Ge(){return Ge=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ge.apply(this,arguments)}function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},We.apply(this,arguments)}function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ke.apply(this,arguments)}function Ve(){return Ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ve.apply(this,arguments)}function Xe(){return Xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xe.apply(this,arguments)}function Je(){return Je=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Je.apply(this,arguments)}const Ye=[{type:"category",label:(0,G.__)("Post Presets","mind")},{type:"request",label:(0,G.__)("Post title about…","mind"),request:(0,G.__)("Write a post title about ","mind"),icon:(0,Te.createElement)((function(e){return Te.createElement("svg",Ge({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),ze||(ze=Te.createElement("path",{fill:"transparent",stroke:"currentColor",strokeWidth:1.5,d:"M8 5v6M11 5H5M5 19h8M5 15h15"})))}),null)},{type:"request",label:(0,G.__)("Post about…","mind"),request:(0,G.__)("Write a blog post about ","mind"),icon:(0,Te.createElement)((function(e){return Te.createElement("svg",We({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),je||(je=Te.createElement("path",{fill:"transparent",stroke:"currentColor",strokeWidth:1.5,d:"M7.5 7.25h9M7.5 10.75h9M7.5 14.25H13"})),Le||(Le=Te.createElement("rect",{width:13.5,height:16.5,x:5.25,y:3.75,fill:"transparent",stroke:"currentColor",strokeWidth:1.5,rx:1.25})))}),null)},{type:"request",label:(0,G.__)("Outline about…","mind"),request:(0,G.__)("Write a blog post outline about ","mind"),icon:(0,Te.createElement)((function(e){return Te.createElement("svg",Ke({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),Ne||(Ne=Te.createElement("path",{fill:"transparent",stroke:"currentColor",strokeWidth:1.5,d:"M10 6.25h11M10 11.75h11M10 17.25h11"})),qe||(qe=Te.createElement("circle",{cx:5.5,cy:11.75,r:1.5,fill:"currentColor"})),Ue||(Ue=Te.createElement("circle",{cx:5.5,cy:17.25,r:1.5,fill:"currentColor"})),He||(He=Te.createElement("circle",{cx:5.5,cy:6.25,r:1.5,fill:"currentColor"})))}),null)},{type:"category",label:(0,G.__)("Content Presets","mind")},{type:"request",label:(0,G.__)("Paragraph about…","mind"),request:(0,G.__)("Create a paragraph about ","mind"),icon:(0,Te.createElement)((function(e){return Te.createElement("svg",Ve({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),De||(De=Te.createElement("path",{fill:"transparent",stroke:"currentColor",strokeWidth:1.5,d:"M3 7.25h18M3 11.75h18M3 16.25h11"})))}),null)},{type:"request",label:(0,G.__)("List about…","mind"),request:(0,G.__)("Create a list about ","mind"),icon:(0,Te.createElement)((function(e){return Te.createElement("svg",Xe({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),Ze||(Ze=Te.createElement("path",{fill:"transparent",stroke:"currentColor",strokeWidth:1.5,d:"M3 6.25h18M10 11.75h11M3 17.25h18"})),Qe||(Qe=Te.createElement("circle",{cx:4.75,cy:11.75,r:1.75,fill:"currentColor"})))}),null)},{type:"request",label:(0,G.__)("Table about…","mind"),request:(0,G.__)("Create a table about ","mind"),icon:(0,Te.createElement)((function(e){return Te.createElement("svg",Je({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),Fe||(Fe=Te.createElement("path",{fill:"currentColor",d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2ZM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5Zm8 5.5h6.5v3.5H13V10Zm-1.5 3.5h-7V10h7v3.5Zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5Zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5Z"})))}),null)}];function et(){const e=(0,xe.useRef)(),{setInput:t,setScreen:n}=(0,h.useDispatch)("mind/popup"),{isOpen:r,input:s,screen:i,loading:o,response:l,progress:a,renderBuffer:c,error:u}=(0,h.useSelect)((e=>{const{isOpen:t,getInput:n,getContext:r,getScreen:s,getLoading:i,getResponse:o,getProgress:l,getRenderBuffer:a,getError:c}=e("mind/popup");return{isOpen:t(),input:n(),context:r(),screen:s(),loading:i(),response:o(),progress:l(),renderBuffer:a(),error:c()}}));return(0,xe.useEffect)((()=>{r&&!o&&e?.current&&function(){if(e?.current){const t=e.current.querySelector("input");t&&t.focus()}}()}),[r,o,e]),(0,xe.useEffect)((()=>{""===i&&s&&n("request")}),[i,s,n]),(0,Te.createElement)("div",{className:"mind-popup-content"},""===i?(0,Te.createElement)("div",{className:"mind-popup-commands"},Ye.map((e=>"category"===e.type?(0,Te.createElement)("span",{key:e.type+e.label,className:"mind-popup-commands-category"},e.label):(0,Te.createElement)(Ee.Button,{key:e.type+e.label,className:"mind-popup-commands-button",onClick:()=>{t(e.request),n("request")}},e.icon||"",e.label)))):null,"request"===i&&(0,Te.createElement)("div",{className:"mind-popup-request"},l&&(0,Te.createElement)(Be,{progress:a,loading:o,response:l,renderBuffer:c}),!o&&u&&(0,Te.createElement)(Ae,{type:"error"},u)))}function tt(e){return(0,xe.createElement)("span",{className:"mind-popup-loading-text"},e.children)}function nt(e){const{onInsert:t}=e,{close:n,reset:r,setError:s,requestAI:i}=(0,h.useDispatch)("mind/popup"),{input:o,loading:l,response:a}=(0,h.useSelect)((e=>{const{getInput:t,getContext:n,getScreen:r,getLoading:s,getResponse:i}=e("mind/popup");return{input:t(),context:n(),screen:r(),loading:s(),response:i()}}));return a||l||o&&!l&&!a?(0,Te.createElement)("div",{className:"mind-popup-footer"},l&&(0,Te.createElement)(tt,null,(0,G.__)("Writing","mind")),(0,Te.createElement)("div",{className:"mind-popup-footer-actions"},o&&!l&&!a&&(0,Te.createElement)(Ee.Button,{onClick:()=>{i()}},(0,G.__)("Get Answer","mind")," ",(0,Te.createElement)("kbd",null,"⏎")),a&&!l&&(0,Te.createElement)(Te.Fragment,null,(0,Te.createElement)(Ee.Button,{onClick:()=>{s(""),i()}},(0,G.__)("Regenerate","mind")," ",(0,Te.createElement)("kbd",null,"↻")),(0,Te.createElement)(Ee.Button,{onClick:()=>{window.navigator.clipboard.writeText(a),r(),n()}},(0,G.__)("Copy","mind")),(0,Te.createElement)(Ee.Button,{onClick:t},(0,G.__)("Insert","mind")," ",(0,Te.createElement)("kbd",null,"⏎"))))):null}var rt;function st(){return st=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},st.apply(this,arguments)}var it=function(e){return Te.createElement("svg",st({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),rt||(rt=Te.createElement("path",{fill:"currentColor",d:"M7.636 9.92a1.557 1.557 0 0 1-.475-1.142c0-.445.159-.826.475-1.142a1.557 1.557 0 0 1 1.142-.475c.445 0 .826.159 1.142.475.317.316.475.697.475 1.142 0 .445-.158.826-.475 1.142a1.557 1.557 0 0 1-1.142.475c-.445 0-.826-.158-1.142-.475Zm-2.747 2.747c-1.079-1.079-1.618-2.375-1.618-3.889 0-1.514.54-2.81 1.618-3.889C5.968 3.81 7.264 3.271 8.78 3.271c1.513 0 2.81.54 3.888 1.618.758.758 1.248 1.639 1.47 2.643a5.513 5.513 0 0 1-.132 2.938l6.366 6.365v3.536l-5.426-.014-.326-2.298-2.346-.347-.428-2.332-1.375-1.375a5.567 5.567 0 0 1-2.935.128c-1.006-.22-1.888-.708-2.646-1.466Zm1.06-1.06c.679.678 1.47 1.06 2.377 1.147.906.086 1.732-.092 2.478-.535l2.434 2.434.315 1.722 2.391.372.283 2.118h2.638v-1.414l-6.646-6.647c.443-.746.621-1.572.535-2.478-.087-.906-.47-1.698-1.147-2.376-.778-.778-1.721-1.167-2.829-1.167s-2.05.389-2.828 1.167-1.167 1.72-1.167 2.828c0 1.108.389 2.05 1.167 2.829Z"})))};function ot(){const{settingsPageURL:e}=(0,h.useSelect)((e=>{const{getSettingsPageURL:t}=e("mind");return{settingsPageURL:t()}}));return(0,xe.createElement)("div",{className:"mind-popup-connected-screen"},(0,xe.createElement)("h2",null,(0,xe.createElement)(it,null),(0,G.__)("OpenAI Key","mind")),(0,xe.createElement)("div",null,(0,xe.createElement)("p",null,(0,G.__)("In order to use Mind, you will need to provide your OpenAI API key. Please insert your API key in the plugin settings to get started.","mind"))),(0,xe.createElement)("div",null,(0,xe.createElement)("a",{className:"mind-popup-connected-screen-button",href:e},(0,G.__)("Go to Settings","mind"))))}const lt="mind-popup-container";function at(){const{setHighlightBlocks:e}=(0,h.useDispatch)("mind/blocks"),{close:t,reset:n}=(0,h.useDispatch)("mind/popup"),{connected:r,isOpen:s,insertionPlace:i,loading:o,response:l}=(0,h.useSelect)((e=>{const{isConnected:t}=e("mind"),{isOpen:n,getInsertionPlace:r,getLoading:s,getResponse:i}=e("mind/popup");return{connected:t(),isOpen:n(),insertionPlace:r(),loading:s(),response:i()}})),{selectedClientIds:a}=(0,h.useSelect)((e=>{const{getSelectedBlockClientIds:t}=e("core/block-editor");return{selectedClientIds:t()}}),[]),{insertBlocks:c,replaceBlocks:u}=(0,h.useDispatch)("core/block-editor");function p(){!function(){const t=(0,ye.rawHandler)({HTML:l});t.length&&("selected-blocks"===i?u(a,t):c(t),e(t.map((e=>e.clientId))))}(),n(),t()}return s?(0,xe.createElement)(Ee.Modal,{title:!1,className:Ce("mind-popup",!r&&"mind-popup-not-connected"),overlayClassName:"mind-popup-overlay",onRequestClose:()=>{n(),t()},__experimentalHideHeader:!0},r?(0,xe.createElement)(xe.Fragment,null,(0,xe.createElement)(Pe,{onInsert:p}),o&&(0,xe.createElement)(Me,null),(0,xe.createElement)(et,null),(0,xe.createElement)(nt,{onInsert:p})):(0,xe.createElement)(ot,null)):null}Se()((()=>{if(document.querySelector(`.${lt}`))return;const e=document.querySelector(".block-editor");if(!e)return;const t=document.createElement("div");t.classList.add(lt),e.appendChild(t),(0,xe.createRoot)(t).render((0,xe.createElement)(at,null))}));const ct=window.wp.hooks,ut=window.wp.blockEditor,pt=window.wp.compose;var ht;function dt(){return dt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dt.apply(this,arguments)}var gt,mt=function(e){return Te.createElement("svg",dt({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 -960 960 960"},e),ht||(ht=Te.createElement("path",{d:"M376-253.847 333.847-296l184-184-184-184L376-706.153 602.153-480 376-253.847Z"})))};function ft(){return ft=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ft.apply(this,arguments)}var kt,bt=function(e){return Te.createElement("svg",ft({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),gt||(gt=Te.createElement("path",{fill:"currentColor",d:"M7.333 14.274C8.044 13.566 8.53 12 8.53 12s.442 1.565 1.137 2.274C10.383 15.005 12 15.47 12 15.47s-1.618.464-2.333 1.197C8.959 17.392 8.53 19 8.53 19s-.473-1.61-1.197-2.333C6.61 15.942 5 15.47 5 15.47s1.608-.474 2.333-1.197ZM15.333 17.3c.407-.405.684-1.3.684-1.3s.253.894.65 1.3c.41.417 1.333.683 1.333.683s-.924.265-1.333.684c-.405.414-.65 1.333-.65 1.333s-.27-.92-.684-1.333c-.413-.414-1.333-.684-1.333-.684s.919-.27 1.333-.684ZM11.333 6.248C12.35 5.236 13.043 3 13.043 3s.631 2.235 1.624 3.248C15.69 7.293 18 7.958 18 7.958s-2.311.662-3.333 1.709C13.655 10.703 13.043 13 13.043 13s-.675-2.299-1.71-3.333C10.3 8.632 8 7.957 8 7.957s2.297-.677 3.333-1.71Z"})))};function wt(){return wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wt.apply(this,arguments)}var _t,xt=function(e){return Te.createElement("svg",wt({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),kt||(kt=Te.createElement("path",{fill:"transparent",stroke:"currentColor",strokeWidth:1.5,d:"M8.5 12.5 12 16l7.5-7.5m-16 4L7 16l1-1m6.5-6.5-3.25 3.25"})))};function Et(){return Et=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Et.apply(this,arguments)}var yt,vt=function(e){return Te.createElement("svg",Et({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),_t||(_t=Te.createElement("path",{fill:"transparent",stroke:"currentColor",strokeWidth:1.5,d:"M3 9.75h18M3 14.25h12"})))};function St(){return St=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},St.apply(this,arguments)}var Ot,Ct=function(e){return Te.createElement("svg",St({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),yt||(yt=Te.createElement("path",{fill:"transparent",stroke:"currentColor",strokeWidth:1.5,d:"M3 5.25h18M3 9.75h18M3 14.25h18M3 18.75h12"})))};function Tt(){return Tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tt.apply(this,arguments)}var It,Rt=function(e){return Te.createElement("svg",Tt({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),Ot||(Ot=Te.createElement("path",{fill:"transparent",stroke:"currentColor",strokeWidth:1.5,d:"M3 7.75h18M3 12.25h6M11 12.25h5M18 12.25h3M3 16.75h4M9 16.75h4"})))};function $t(){return $t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$t.apply(this,arguments)}var Pt,Mt,At=function(e){return Te.createElement("svg",$t({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),It||(It=Te.createElement("path",{fill:"transparent",stroke:"currentColor",strokeWidth:1.5,d:"M13.647 6.955 15.53 4.25H8.471l1.882 2.705m3.294 0L16 17.386l-4 3.864-4-3.864 2.353-10.431m3.294 0h-3.294"})))};function Bt(){return Bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bt.apply(this,arguments)}var zt,jt=function(e){return Te.createElement("svg",Bt({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),Pt||(Pt=Te.createElement("path",{fill:"transparent",stroke:"currentColor",strokeWidth:1.5,d:"M19.75 12A7.75 7.75 0 0 0 6.52 6.52L5.4 7.64M4.25 12a7.75 7.75 0 0 0 13.23 5.48l1.12-1.12"})),Mt||(Mt=Te.createElement("path",{fill:"transparent",stroke:"currentColor",strokeWidth:1.5,d:"M4.75 4.25v4h4M19.25 19.75v-4h-4"})))};function Lt(){return Lt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lt.apply(this,arguments)}var Nt=function(e){return Te.createElement("svg",Lt({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),zt||(zt=Te.createElement("path",{d:"m11.876 21 3.711-10.2h1.702L21 21h-1.701l-.86-2.596H14.48L13.595 21h-1.718Zm3.1-4.084H17.9l-1.426-4.203h-.072l-1.426 4.204ZM5.445 18.45l-1.151-1.2 4.119-4.297a13.309 13.309 0 0 1-1.35-1.843A14.345 14.345 0 0 1 6.057 9.1h1.701c.248.511.51.97.786 1.377.276.406.61.838 1.004 1.293a11.953 11.953 0 0 0 1.496-2.094 13.27 13.27 0 0 0 .993-2.276H3V5.7h5.705V4h1.63v1.7h5.704v1.7h-2.374a16.04 16.04 0 0 1-1.16 2.925c-.487.948-1.09 1.84-1.807 2.674l1.949 2.08-.611 1.745L9.52 14.2l-4.075 4.25Z"})))};function qt(e,t){return t={tagName:"span",className:"",...t},e.replace(/\p{RI}\p{RI}|\p{Emoji}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?(\u{200D}\p{Emoji}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?)+|\p{EPres}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?|\p{Emoji}(\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})/gu,`<${t.tagName}${t.className?` class="${t.className}"`:""} role="img" aria-hidden="true">$&</${t.tagName}>`)}const Ut=["core/paragraph","core/heading"],Ht=[[(0,G.__)("professional","mind"),(0,G.__)("🧐 Professional","mind")],[(0,G.__)("friendly","mind"),(0,G.__)("😀 Friendly","mind")],[(0,G.__)("straightforward","mind"),(0,G.__)("🙂 Straightforward","mind")],[(0,G.__)("educational","mind"),(0,G.__)("🎓 Educational","mind")],[(0,G.__)("confident","mind"),(0,G.__)("😎 Confident","mind")],[(0,G.__)("witty","mind"),(0,G.__)("🤣 Witty","mind")],[(0,G.__)("heartfelt","mind"),(0,G.__)("🤗 Heartfelt","mind")]],Dt=[[(0,G.__)("chinese","mind"),(0,G.__)("🇨🇳 Chinese","mind")],[(0,G.__)("dutch","mind"),(0,G.__)("🇳🇱 Dutch","mind")],[(0,G.__)("english","mind"),(0,G.__)("🇺🇸 English","mind")],[(0,G.__)("filipino","mind"),(0,G.__)("🇵🇭 Filipino","mind")],[(0,G.__)("french","mind"),(0,G.__)("🇫🇷 French","mind")],[(0,G.__)("german","mind"),(0,G.__)("🇩🇪 German","mind")],[(0,G.__)("indonesian","mind"),(0,G.__)("🇮🇩 Indonesian","mind")],[(0,G.__)("italian","mind"),(0,G.__)("🇮🇹 Italian","mind")],[(0,G.__)("japanese","mind"),(0,G.__)("🇯🇵 Japanese","mind")],[(0,G.__)("korean","mind"),(0,G.__)("🇰🇷 Korean","mind")],[(0,G.__)("portuguese","mind"),(0,G.__)("🇵🇹 Portuguese","mind")],[(0,G.__)("russian","mind"),(0,G.__)("🇷🇺 Russian","mind")],[(0,G.__)("spanish","mind"),(0,G.__)("🇪🇸 Spanish","mind")],[(0,G.__)("vietnamese","mind"),(0,G.__)("🇻🇳 Vietnamese","mind")]];function Zt(){const{open:e,setInput:t,setContext:n,setInsertionPlace:r,requestAI:s}=(0,h.useDispatch)("mind/popup");function i(i){e(),t(i),n("selected-blocks"),r("selected-blocks"),s()}return(0,xe.createElement)(Ee.ToolbarGroup,null,(0,xe.createElement)(Ee.DropdownMenu,{icon:(0,xe.createElement)($e,null),label:(0,G.__)("Mind","@@text_domain"),className:"mind-toolbar-toggle",popoverProps:{className:"mind-toolbar-dropdown"}},(()=>(0,xe.createElement)(xe.Fragment,null,(0,xe.createElement)(Ee.MenuGroup,null,(0,xe.createElement)(Ee.MenuItem,{icon:(0,xe.createElement)(bt,null),iconPosition:"left",onClick:()=>{i((0,G.__)("Improve writing language","mind"))}},(0,G.__)("Improve","mind")),(0,xe.createElement)(Ee.MenuItem,{icon:(0,xe.createElement)(xt,null),iconPosition:"left",onClick:()=>{i((0,G.__)("Fix spelling and grammar","mind"))}},(0,G.__)("Fix Spelling & Grammar","mind")),(0,xe.createElement)(Ee.MenuItem,{icon:(0,xe.createElement)(vt,null),iconPosition:"left",onClick:()=>{i((0,G.__)("Make shorter","mind"))}},(0,G.__)("Make Shorter","mind")),(0,xe.createElement)(Ee.MenuItem,{icon:(0,xe.createElement)(Ct,null),iconPosition:"left",onClick:()=>{i((0,G.__)("Make longer","mind"))}},(0,G.__)("Make Longer","mind")),(0,xe.createElement)(Ee.MenuItem,{icon:(0,xe.createElement)(Rt,null),iconPosition:"left",onClick:()=>{i((0,G.__)("Summarize","mind"))}},(0,G.__)("Summarize","mind")),(0,xe.createElement)(Ee.MenuItem,{icon:(0,xe.createElement)(jt,null),iconPosition:"left",onClick:()=>{i((0,G.__)("Paraphrase","mind"))}},(0,G.__)("Paraphrase","mind"))),(0,xe.createElement)(Ee.MenuGroup,null,(0,xe.createElement)(Ee.DropdownMenu,{icon:(0,xe.createElement)(At,null),iconPosition:"left",toggleProps:{children:(0,xe.createElement)(xe.Fragment,null,(0,G.__)("Adjust Tone","mind"),(0,xe.createElement)(mt,null))},popoverProps:{placement:"right-end",className:"mind-toolbar-dropdown"},className:"mind-toolbar-dropdown-toggle"},(()=>(0,xe.createElement)(xe.Fragment,null,(0,xe.createElement)(Ee.MenuGroup,{label:(0,G.__)("Select Tone","@@text_domain")},Ht.map((e=>(0,xe.createElement)(Ee.MenuItem,{key:e[0],onClick:()=>{i((0,G.sprintf)(
|
|
// translators: %s - tone.
|
|
// translators: %s - tone.
|
|
(0,G.__)("Change tone to %s","mind"),e[0]))}},(0,xe.createElement)(xe.RawHTML,null,qt(e[1]))))))))),(0,xe.createElement)(Ee.DropdownMenu,{icon:(0,xe.createElement)(Nt,null),iconPosition:"left",toggleProps:{children:(0,xe.createElement)(xe.Fragment,null,(0,G.__)("Translate","mind"),(0,xe.createElement)(mt,null))},popoverProps:{placement:"right-end",className:"mind-toolbar-dropdown"},className:"mind-toolbar-dropdown-toggle"},(()=>(0,xe.createElement)(xe.Fragment,null,(0,xe.createElement)(Ee.MenuGroup,{label:(0,G.__)("Select Language","@@text_domain")},Dt.map((e=>(0,xe.createElement)(Ee.MenuItem,{key:e[0],onClick:()=>{i((0,G.sprintf)(
|
|
// translators: %s - tone.
|
|
// translators: %s - tone.
|
|
(0,G.__)("Translate to %s","mind"),e[0]))}},(0,xe.createElement)(xe.RawHTML,null,qt(e[1]))))))))))))))}const Qt=(0,pt.createHigherOrderComponent)((e=>function(t){var n;return n=t,Ut.includes(n.name)?(0,xe.createElement)(xe.Fragment,null,(0,xe.createElement)(e,t),(0,xe.createElement)(ut.BlockControls,{group:"other"},(0,xe.createElement)(Zt,null))):(0,xe.createElement)(e,t)}),"withToolbarControl");(0,ct.addFilter)("editor.BlockEdit","mind/block-toolbar-toggle",Qt);const Ft=window.lodash;function Gt(e){const{styles:t}=e,n=(0,xe.useMemo)((()=>{const e=(0,ut.transformStyles)([{css:t}],".editor-styles-wrapper");let n="";return(0,Ft.map)((0,Ft.compact)(e),(e=>{n+=e})),n}),[t]);return(0,Te.createElement)("style",{dangerouslySetInnerHTML:{__html:n}})}const Wt=["core/paragraph","core/list","core/code","core/preformatted","core/quote","core/blockquote"],Kt=(0,pt.createHigherOrderComponent)((e=>function(t){const{name:n,clientId:r}=t,[s,i]=(0,xe.useState)(!1),{removeHighlightBlocks:o}=(0,h.useDispatch)("mind/blocks"),{highlightBlocks:l}=(0,h.useSelect)((e=>{const{getHighlightBlocks:t}=e("mind/blocks");return{highlightBlocks:t()}})),a=Wt.includes(n)&&l&&l.length&&l.includes(r);return(0,xe.useEffect)((()=>{a&&setTimeout((()=>{i(!0),setTimeout((()=>{i(!1),o([r])}),3e3)}),3e3)}),[a,r,o]),a?(0,xe.createElement)(xe.Fragment,null,(0,xe.createElement)(e,t),(0,xe.createElement)(Gt,{styles:`\n\t\t\t\t\t\t\t[data-block="${r}"] {\n\t\t\t\t\t\t\t\tbackground-color: rgba(228, 85, 223, 0.1);\n\t\t\t\t\t\t\t\tbox-shadow: 0 0 0 0.75rem rgba(228, 85, 223, 0.1);\n\t\t\t\t\t\t\t\t${s?"transition: 3s background-color, 3s box-shadow;":""}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t${s?`\n\t\t\t\t\t\t\t\t\t\t[data-block="${r}"] {\n\t\t\t\t\t\t\t\t\t\t\tbackground-color: rgba(228, 85, 223, 0);\n\t\t\t\t\t\t\t\t\t\t\tbox-shadow: 0 0 0 0.75rem rgba(228, 85, 223, 0);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t`:""}\n\t\t\t\t\t\t`})):(0,xe.createElement)(e,t)}),"withMindAIEditorStyles");(0,ct.addFilter)("editor.BlockEdit","mind/editor-styles",Kt);const Vt=(0,G.getLocaleData)(),Xt="Type / to choose a block",Jt=Vt&&void 0!==Vt[Xt]?Vt[Xt]:Xt;(0,G.setLocaleData)({[Xt]:[`${Jt}... Press \`space\` for AI`]},"default");const Yt=(0,pt.createHigherOrderComponent)((e=>function(t){const{name:n,attributes:r}=t,{content:s}=r,i=(0,pt.usePrevious)(s),{open:o,setInsertionPlace:l}=(0,h.useDispatch)("mind/popup");return(0,xe.useEffect)((()=>{"core/paragraph"!==n||i||" "!==s||(o(),l("selected-blocks"))}),[n,i,s,o,l]),(0,xe.createElement)(e,t)}),"withMindAI");(0,ct.addFilter)("editor.BlockEdit","mind/open-popup",Yt);const en="mind-post-toolbar-toggle";function tn(){const{toggle:e}=(0,h.useDispatch)("mind/popup");return(0,Te.createElement)("button",{type:"button",className:"components-button components-icon-button",onClick:t=>{t.preventDefault(),e()}},(0,Te.createElement)($e,null),(0,G.__)("Open Mind","@@text_domain"))}Se()((()=>{(0,h.subscribe)((0,Ft.throttle)((()=>{if(document.querySelector(`.${en}`))return;const e=document.querySelector(".editor-header__toolbar, .edit-post-header__toolbar");e&&(e=>{const t=document.createElement("div");t.classList.add(en),e.appendChild(t),(0,xe.createRoot)(t).render((0,Te.createElement)(tn,null))})(e)}),200,{trailing:!0}))}))}},n={};function r(e){var s=n[e];if(void 0!==s)return s.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.m=t,e=[],r.O=(t,n,s,i)=>{if(!n){var o=1/0;for(u=0;u<e.length;u++){n=e[u][0],s=e[u][1],i=e[u][2];for(var l=!0,a=0;a<n.length;a++)(!1&i||o>=i)&&Object.keys(r.O).every((e=>r.O[e](n[a])))?n.splice(a--,1):(l=!1,i<o&&(o=i));if(l){e.splice(u--,1);var c=s();void 0!==c&&(t=c)}}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[n,s,i]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={8:0,117:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var s,i,o=n[0],l=n[1],a=n[2],c=0;if(o.some((t=>0!==e[t]))){for(s in l)r.o(l,s)&&(r.m[s]=l[s]);if(a)var u=a(r)}for(t&&t(n);c<o.length;c++)i=o[c],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return r.O(u)},n=self.webpackChunkmind=self.webpackChunkmind||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var s=r.O(void 0,[117],(()=>r(606)));s=r.O(s)})(); |