plugin-build-guide-block 1.1.9 → 1.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("plugin-build-guide-block",["react-i18next","@nocobase/client-v2","react","antd","@nocobase/client","@formily/react","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["plugin-build-guide-block"]=t(require("react-i18next"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["plugin-build-guide-block"]=t(e["react-i18next"],e["@nocobase/client-v2"],e.react,e.antd,e["@nocobase/client"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,i,o,l,a){return function(){"use strict";var s={375:function(e){e.exports=l},230:function(e){e.exports=o},342:function(e){e.exports=i},485:function(e){e.exports=t},694:function(e){e.exports=a},59:function(e){e.exports=r},155:function(e){e.exports=n},953:function(t){t.exports=e}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return s[e](n,n.exports,u),n.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.g.importScripts&&(p=u.g.location+"");var p,f=u.g.document;if(!p&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(p=f.currentScript.src),!p)){var d=f.getElementsByTagName("script");if(d.length)for(var h=d.length-1;h>-1&&(!p||!/^http(s?):/.test(p));)p=d[h--].src}if(!p)throw Error("Automatic publicPath is not supported in this browser");u.p=p.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var m={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/plugin-build-guide-block/dist/client/")}if(!e){var r=window.__nocobase_modern_client_prefix__||"v",i="/"+(r=String(r).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var o=window.location.pathname||"/",l=o.indexOf(i);e=l>=0?o.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+r+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/plugin-build-guide-block/dist/client/"}u.p=e}(),!function(){u.r(m),u.d(m,{default:function(){return t9}});var e,t=u(342),n=u(155),r=u.n(n),i=u(59),o=u(375),l=u(485),a=u(953);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){n(e);return}a.done?t(s):Promise.resolve(s).then(r,i)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){c(o,r,i,l,a,"next",e)}function a(e){c(o,r,i,l,a,"throw",e)}l(void 0)})}}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],l=!0,a=!1;try{for(i=i.call(e);!(l=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==i.return||i.return()}finally{if(a)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:s(0)}),a(l,"throw",{value:s(1)}),a(l,"return",{value:s(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function s(a){return function(s){var c=[a,s];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(6===c[0]&&o.label<i[1]){o.label=i[1],i=c;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(c);break}i[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var h={draft:"default",building:"blue",completed:"success",error:"error"},g=[{label:"HTML",value:"html"},{label:"Markdown",value:"markdown"}],b=function(e){var t=Number(e);return Number.isFinite(t)?Math.max(1,Math.min(12,Math.round(t))):5},y=function(){var e=(0,a.useTranslation)().t,t=(0,l.useApp)().apiClient,s=i.App.useApp(),c=s.message,u=s.modal,m=f(i.Form.useForm(),1)[0],y=i.Form.useWatch("llmService",m),k=f((0,n.useState)([]),2),x=k[0],w=k[1],v=f((0,n.useState)(!1),2),S=v[0],O=v[1],T=f((0,n.useState)(!1),2),E=T[0],_=T[1],A=f((0,n.useState)(null),2),I=A[0],C=A[1],P=f((0,n.useState)(!1),2),R=P[0],N=P[1],j=f((0,n.useState)([]),2),D=j[0],z=j[1],$=f((0,n.useState)([]),2),M=$[0],L=$[1],B=f((0,n.useState)(null),2),F=B[0],U=B[1],G=(0,n.useRef)(null),q=(0,n.useCallback)(function(){return p(function(){var e,n;return d(this,function(r){switch(r.label){case 0:O(!0),r.label=1;case 1:return r.trys.push([1,,3,4]),[4,t.resource("aiBuildGuideSpaces").list({appends:["documents"],sort:["-createdAt"],paginate:!1})];case 2:return w((null==(n=r.sent())||null==(e=n.data)?void 0:e.data)||[]),[3,4];case 3:return O(!1),[7];case 4:return[2]}})})()},[t]);(0,n.useEffect)(function(){q()},[q]),(0,n.useEffect)(function(){return function(){G.current&&clearTimeout(G.current)}},[]);var H=(0,n.useCallback)(function(){return p(function(){var e,n;return d(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t.resource("ai").listLLMServices()];case 1:return z(((null==(n=r.sent())||null==(e=n.data)?void 0:e.data)||[]).map(function(e){return{label:e.title||e.name,value:e.name}})),[3,3];case 2:return r.sent(),z([]),[3,3];case 3:return[2]}})})()},[t]),W=(0,n.useCallback)(function(e){return p(function(){var n,r;return d(this,function(i){switch(i.label){case 0:if(!e)return L([]),[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,t.resource("ai").listModels({llmService:e})];case 2:return L(((null==(r=i.sent())||null==(n=r.data)?void 0:n.data)||[]).map(function(e){return{label:e.id||e.name,value:e.id||e.name}})),[3,4];case 3:return i.sent(),L([]),[3,4];case 4:return[2]}})})()},[t]);(0,n.useEffect)(function(){W(y)},[y,W]);var Z=function(e){C(e.id),m.resetFields(),m.setFieldsValue({title:e.title,llmService:e.llmService,model:e.model,outputFormat:e.outputFormat||"html",targetChapterCount:b(e.targetChapterCount),chapterGuidance:e.chapterGuidance,systemPrompt:e.systemPrompt}),H(),W(e.llmService),_(!0)},Y=(0,n.useCallback)(function(){G.current&&(clearTimeout(G.current),G.current=null),U(null)},[]),Q=[{title:e("Title"),dataIndex:"title"},{title:e("Status"),dataIndex:"status",render:function(e){return e?r().createElement(i.Tag,{color:h[e]||"default"},String(e).toUpperCase()):null}},{title:e("Build Phase"),dataIndex:"buildPhase"},{title:e("Chapters"),dataIndex:"pageCount"},{title:e("Actions"),key:"actions",render:function(n,l){return r().createElement(i.Space,{split:"|"},r().createElement(i.Button,{type:"link",icon:r().createElement(o.PlayCircleOutlined,null),loading:F===l.id,disabled:"building"===l.status,onClick:function(){return p(function(){var n,r,i,o,a,s,u;return d(this,function(f){switch(f.label){case 0:U(l.id),f.label=1;case 1:return f.trys.push([1,3,,4]),[4,t.resource("aiBuildGuideSpaces").build({filterByTk:l.id})];case 2:return f.sent(),c.success(e("Build started")),n=Date.now(),r=!1,i=function(){return p(function(){var o,a,s,u,p;return d(this,function(f){switch(f.label){case 0:return f.trys.push([0,4,,6]),[4,t.resource("aiBuildGuideSpaces").get({filterByTk:l.id})];case 1:if("building"===(u=null==(s=f.sent())||null==(a=s.data)||null==(o=a.data)?void 0:o.status))return[3,3];return Y(),[4,q()];case 2:return f.sent(),"completed"===u?c.success(e("Build completed")):"error"===u&&c.error(e("Build failed")),[2];case 3:return(p=Date.now()-n)>=3e5&&!r&&(r=!0,c.info(e("Build is still running"))),G.current=setTimeout(i,p>=3e5?1e4:3e3),[3,6];case 4:return f.sent(),Y(),[4,q()];case 5:return f.sent(),[3,6];case 6:return[2]}})})()},G.current=setTimeout(i,3e3),[3,4];case 3:return o=f.sent(),c.error((null==o||null==(u=o.response)||null==(s=u.data)||null==(a=s.error)?void 0:a.message)||e("Build failed")),U(null),[3,4];case 4:return[2]}})})()}},e("Build")),r().createElement("a",{onClick:function(){return Z(l)}},e("Edit")),r().createElement("a",{onClick:function(){return u.confirm({title:e("Delete"),content:e("Are you sure you want to delete this space?"),onOk:function(){return p(function(){return d(this,function(n){switch(n.label){case 0:return[4,t.resource("aiBuildGuideSpaces").destroy({filterByTk:l.id})];case 1:return n.sent(),c.success(e("Deleted")),[4,q()];case 2:return n.sent(),[2]}})})()}})}},e("Delete")))}}];return r().createElement("div",null,r().createElement(i.Space,{style:{marginBottom:16}},r().createElement(i.Button,{type:"primary",icon:r().createElement(o.PlusOutlined,null),onClick:function(){C(null),m.resetFields(),m.setFieldsValue({outputFormat:"html",targetChapterCount:5,systemPrompt:"You are an expert technical writer. Generate a comprehensive user guide based on the provided documents."}),H(),_(!0)}},e("Create space")),r().createElement(i.Button,{onClick:q},e("Refresh"))),r().createElement(i.Table,{rowKey:"id",loading:S,dataSource:x,columns:Q}),r().createElement(i.Drawer,{title:I?e("Edit space"):e("Create space"),open:E,onClose:function(){return _(!1)},width:640,footer:r().createElement(i.Space,{style:{float:"right"}},r().createElement(i.Button,{onClick:function(){return _(!1)}},e("Cancel")),r().createElement(i.Button,{type:"primary",loading:R,onClick:function(){return p(function(){var n,r,i,o,l;return d(this,function(a){switch(a.label){case 0:return[4,m.validateFields()];case 1:(n=a.sent()).targetChapterCount=b(n.targetChapterCount),N(!0),a.label=2;case 2:if(a.trys.push([2,8,9,10]),!I)return[3,4];return[4,t.resource("aiBuildGuideSpaces").update({filterByTk:I,values:n})];case 3:return a.sent(),[3,6];case 4:return[4,t.resource("aiBuildGuideSpaces").create({values:n})];case 5:a.sent(),a.label=6;case 6:return c.success(e("Saved successfully")),_(!1),[4,q()];case 7:return a.sent(),[3,10];case 8:if(null==(r=a.sent())?void 0:r.errorFields)return[2];return c.error((null==r||null==(l=r.response)||null==(o=l.data)||null==(i=o.error)?void 0:i.message)||e("Save failed")),[3,10];case 9:return N(!1),[7];case 10:return[2]}})})()}},e("Submit")))},r().createElement(i.Form,{form:m,layout:"vertical",onValuesChange:function(e){"llmService"in e&&m.setFieldValue("model",void 0)}},r().createElement(i.Form.Item,{name:"title",label:e("Title"),rules:[{required:!0}]},r().createElement(i.Input,null)),r().createElement(i.Form.Item,{name:"llmService",label:e("LLM Service"),rules:[{required:!0}]},r().createElement(i.Select,{options:D,onFocus:H,showSearch:!0,optionFilterProp:"label"})),r().createElement(i.Form.Item,{name:"model",label:e("Model"),rules:[{required:!0}]},r().createElement(i.Select,{options:M,disabled:!y,showSearch:!0,optionFilterProp:"label"})),r().createElement(i.Form.Item,{name:"outputFormat",label:e("Output format"),rules:[{required:!0}]},r().createElement(i.Select,{options:g})),r().createElement(i.Form.Item,{name:"targetChapterCount",label:e("Target chapters"),rules:[{required:!0}]},r().createElement(i.InputNumber,{min:1,max:12,precision:0,style:{width:"100%"}})),r().createElement(i.Form.Item,{name:"chapterGuidance",label:e("Chapter guidance")},r().createElement(i.Input.TextArea,{rows:3,placeholder:e("Describe how the guide should be split into chapters")})),r().createElement(i.Form.Item,{name:"systemPrompt",label:e("System Prompt")},r().createElement(i.Input.TextArea,{rows:4})))))},k=u(230);function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let w=Object.entries,v=Object.setPrototypeOf,S=Object.isFrozen,O=Object.getPrototypeOf,T=Object.getOwnPropertyDescriptor,E=Object.freeze,_=Object.seal,A=Object.create,I="u">typeof Reflect&&Reflect,C=I.apply,P=I.construct;E||(E=function(e){return e}),_||(_=function(e){return e}),C||(C=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)}),P||(P=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});let R=K(Array.prototype.forEach),N=K(Array.prototype.lastIndexOf),j=K(Array.prototype.pop),D=K(Array.prototype.push),z=K(Array.prototype.splice),$=Array.isArray,M=K(String.prototype.toLowerCase),L=K(String.prototype.toString),B=K(String.prototype.match),F=K(String.prototype.replace),U=K(String.prototype.indexOf),G=K(String.prototype.trim),q=K(Number.prototype.toString),H=K(Boolean.prototype.toString),W="u"<typeof BigInt?null:K(BigInt.prototype.toString),Z="u"<typeof Symbol?null:K(Symbol.prototype.toString),Y=K(Object.prototype.hasOwnProperty),Q=K(Object.prototype.toString),X=K(RegExp.prototype.test),V=(e=TypeError,function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return P(e,n)});function K(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return C(e,t,r)}}function J(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:M;if(v&&v(e,null),!$(t))return e;let r=t.length;for(;r--;){let i=t[r];if("string"==typeof i){let e=n(i);e!==i&&(S(t)||(t[r]=e),i=e)}e[i]=!0}return e}function ee(e){let t=A(null);for(let r of w(e)){var n=function(e){if(Array.isArray(e))return e}(r)||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,l=[],a=!0,s=!1;try{i=(t=t.call(e)).next,!1;for(;!(a=(n=i.call(t)).done)&&(l.push(n.value),2!==l.length);a=!0);}catch(e){s=!0,r=e}finally{try{if(!a&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(s)throw r}}return l}}(r)||function(e){if(e){if("string"==typeof e)return x(e,2);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?x(e,2):void 0}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();let i=n[0],o=n[1];Y(e,i)&&($(o)?t[i]=function(e){for(let t=0;t<e.length;t++)Y(e,t)||(e[t]=null);return e}(o):o&&"object"==typeof o&&o.constructor===Object?t[i]=ee(o):t[i]=o)}return t}function et(e,t){for(;null!==e;){let n=T(e,t);if(n){if(n.get)return K(n.get);if("function"==typeof n.value)return K(n.value)}e=O(e)}return function(){return null}}let en=E(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),er=E(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ei=E(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),eo=E(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),el=E(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ea=E(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),es=E(["#text"]),ec=E(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),eu=E(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ep=E(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ef=E(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ed=_(/{{[\w\W]*|^[\w\W]*}}/g),eh=_(/<%[\w\W]*|^[\w\W]*%>/g),em=_(/\${[\w\W]*/g),eg=_(/^data-[\-\w.\u00B7-\uFFFF]+$/),eb=_(/^aria-[\-\w]+$/),ey=_(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ek=_(/^(?:\w+script|data):/i),ex=_(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ew=_(/^html$/i),ev=_(/^[a-z][.\w]*(-[.\w]+)+$/i),eS=_(/<[/\w!]/g),eO=_(/<[/\w]/g),eT=_(/<\/no(script|embed|frames)/i),eE=_(/\/>/i),e_=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null,r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}},eA=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},eI=function(e,t,n,r){return Y(e,t)&&$(e[t])?J(r.base?ee(r.base):{},e[t],r.transform):n};var eC=function e(){let t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"u"<typeof window?null:window,i=t=>e(t);if(i.version="3.4.10",i.removed=[],!r||!r.document||9!==r.document.nodeType||!r.Element)return i.isSupported=!1,i;let o=r.document,l=o,a=l.currentScript;r.DocumentFragment;let s=r.HTMLTemplateElement,c=r.Node,u=r.Element,p=r.NodeFilter;void 0===r.NamedNodeMap&&(r.NamedNodeMap||r.MozNamedAttrMap),r.HTMLFormElement;let f=r.DOMParser,d=r.trustedTypes,h=u.prototype,m=et(h,"cloneNode"),g=et(h,"remove"),b=et(h,"nextSibling"),y=et(h,"childNodes"),k=et(h,"parentNode"),x=et(h,"shadowRoot"),v=et(h,"attributes"),S=c&&c.prototype?et(c.prototype,"nodeType"):null,O=c&&c.prototype?et(c.prototype,"nodeName"):null;if("function"==typeof s){let e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let T="",I=!1,C=0,P=function(){if(C>0)throw V('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},K=function(e){P(),C++;try{return t.createHTML(e)}finally{C--}},eC=function(e){P(),C++;try{return t.createScriptURL(e)}finally{C--}},eP=o,eR=eP.implementation,eN=eP.createNodeIterator,ej=eP.createDocumentFragment,eD=eP.getElementsByTagName,ez=l.importNode,e$=eA();i.isSupported="function"==typeof w&&"function"==typeof k&&eR&&void 0!==eR.createHTMLDocument;let eM=ey,eL=null,eB=J({},[...en,...er,...ei,...el,...es]),eF=null,eU=J({},[...ec,...eu,...ep,...ef]),eG=Object.seal(A(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),eq=null,eH=null,eW=Object.seal(A(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),eZ=!0,eY=!0,eQ=!1,eX=!0,eV=!1,eK=!0,eJ=!1,e0=!1,e1=!1,e2=!1,e3=!1,e4=!1,e6=!0,e9=!1,e5="user-content-",e8=!0,e7=!1,te={},tt=null,tn=J({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),tr=null,ti=J({},["audio","video","img","source","image","track"]),to=null,tl=J({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ta="http://www.w3.org/1998/Math/MathML",ts="http://www.w3.org/2000/svg",tc="http://www.w3.org/1999/xhtml",tu=tc,tp=!1,tf=null,td=J({},[ta,ts,tc],L),th=E(["mi","mo","mn","ms","mtext"]),tm=J({},th),tg=E(["annotation-xml"]),tb=J({},tg),ty=J({},["title","style","font","a","script"]),tk=null,tx=["application/xhtml+xml","text/html"],tw=null,tv=null,tS=o.createElement("form"),tO=function(e){return e instanceof RegExp||e instanceof Function},tT=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(tv&&tv===e)return;e&&"object"==typeof e||(e={}),e=ee(e),tw="application/xhtml+xml"===(tk=-1===tx.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE)?L:M,eL=eI(e,"ALLOWED_TAGS",eB,{transform:tw}),eF=eI(e,"ALLOWED_ATTR",eU,{transform:tw}),tf=eI(e,"ALLOWED_NAMESPACES",td,{transform:L}),to=eI(e,"ADD_URI_SAFE_ATTR",tl,{transform:tw,base:tl}),tr=eI(e,"ADD_DATA_URI_TAGS",ti,{transform:tw,base:ti}),tt=eI(e,"FORBID_CONTENTS",tn,{transform:tw}),eq=eI(e,"FORBID_TAGS",ee({}),{transform:tw}),eH=eI(e,"FORBID_ATTR",ee({}),{transform:tw}),te=!!Y(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?ee(e.USE_PROFILES):e.USE_PROFILES),eZ=!1!==e.ALLOW_ARIA_ATTR,eY=!1!==e.ALLOW_DATA_ATTR,eQ=e.ALLOW_UNKNOWN_PROTOCOLS||!1,eX=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,eV=e.SAFE_FOR_TEMPLATES||!1,eK=!1!==e.SAFE_FOR_XML,eJ=e.WHOLE_DOCUMENT||!1,e2=e.RETURN_DOM||!1,e3=e.RETURN_DOM_FRAGMENT||!1,e4=e.RETURN_TRUSTED_TYPE||!1,e1=e.FORCE_BODY||!1,e6=!1!==e.SANITIZE_DOM,e9=e.SANITIZE_NAMED_PROPS||!1,e8=!1!==e.KEEP_CONTENT,e7=e.IN_PLACE||!1,eM=!function(e){try{return X(e,""),!0}catch(e){return!1}}(e.ALLOWED_URI_REGEXP)?ey:e.ALLOWED_URI_REGEXP,tu="string"==typeof e.NAMESPACE?e.NAMESPACE:tc,tm=Y(e,"MATHML_TEXT_INTEGRATION_POINTS")&&e.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof e.MATHML_TEXT_INTEGRATION_POINTS?ee(e.MATHML_TEXT_INTEGRATION_POINTS):J({},th),tb=Y(e,"HTML_INTEGRATION_POINTS")&&e.HTML_INTEGRATION_POINTS&&"object"==typeof e.HTML_INTEGRATION_POINTS?ee(e.HTML_INTEGRATION_POINTS):J({},tg);let r=Y(e,"CUSTOM_ELEMENT_HANDLING")&&e.CUSTOM_ELEMENT_HANDLING&&"object"==typeof e.CUSTOM_ELEMENT_HANDLING?ee(e.CUSTOM_ELEMENT_HANDLING):A(null);if(eG=A(null),Y(r,"tagNameCheck")&&tO(r.tagNameCheck)&&(eG.tagNameCheck=r.tagNameCheck),Y(r,"attributeNameCheck")&&tO(r.attributeNameCheck)&&(eG.attributeNameCheck=r.attributeNameCheck),Y(r,"allowCustomizedBuiltInElements")&&"boolean"==typeof r.allowCustomizedBuiltInElements&&(eG.allowCustomizedBuiltInElements=r.allowCustomizedBuiltInElements),_(eG),eV&&(eY=!1),e3&&(e2=!0),te&&(eL=J({},es),eF=A(null),!0===te.html&&(J(eL,en),J(eF,ec)),!0===te.svg&&(J(eL,er),J(eF,eu),J(eF,ef)),!0===te.svgFilters&&(J(eL,ei),J(eF,eu),J(eF,ef)),!0===te.mathMl&&(J(eL,el),J(eF,ep),J(eF,ef))),eW.tagCheck=null,eW.attributeCheck=null,Y(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?eW.tagCheck=e.ADD_TAGS:$(e.ADD_TAGS)&&(eL===eB&&(eL=ee(eL)),J(eL,e.ADD_TAGS,tw))),Y(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?eW.attributeCheck=e.ADD_ATTR:$(e.ADD_ATTR)&&(eF===eU&&(eF=ee(eF)),J(eF,e.ADD_ATTR,tw))),Y(e,"ADD_URI_SAFE_ATTR")&&$(e.ADD_URI_SAFE_ATTR)&&J(to,e.ADD_URI_SAFE_ATTR,tw),Y(e,"FORBID_CONTENTS")&&$(e.FORBID_CONTENTS)&&(tt===tn&&(tt=ee(tt)),J(tt,e.FORBID_CONTENTS,tw)),Y(e,"ADD_FORBID_CONTENTS")&&$(e.ADD_FORBID_CONTENTS)&&(tt===tn&&(tt=ee(tt)),J(tt,e.ADD_FORBID_CONTENTS,tw)),e8&&(eL["#text"]=!0),eJ&&J(eL,["html","head","body"]),eL.table&&(J(eL,["tbody"]),delete eq.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw V('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw V('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let n=t;t=e.TRUSTED_TYPES_POLICY;try{T=K("")}catch(e){throw t=n,e}}else null===e.TRUSTED_TYPES_POLICY?(t=void 0,T=""):(void 0===t&&(I||(n=e_(d,a),I=!0),t=n),t&&"string"==typeof T&&(T=K("")));(e$.uponSanitizeElement.length>0||e$.uponSanitizeAttribute.length>0)&&eL===eB&&(eL=ee(eL)),e$.uponSanitizeAttribute.length>0&&eF===eU&&(eF=ee(eF)),E&&E(e),tv=e},tE=J({},[...er,...ei,...eo]),t_=J({},[...el,...ea]),tA=function(e){var t,n,r;let i=k(e);i&&i.tagName||(i={namespaceURI:tu,tagName:"template"});let o=M(e.tagName),l=M(i.tagName);return!!tf[e.namespaceURI]&&(e.namespaceURI===ts?(t=i).namespaceURI===tc?"svg"===o:t.namespaceURI===ta?"svg"===o&&("annotation-xml"===l||tm[l]):!!tE[o]:e.namespaceURI===ta?(n=i).namespaceURI===tc?"math"===o:n.namespaceURI===ts?"math"===o&&tb[l]:!!t_[o]:e.namespaceURI===tc?((r=i).namespaceURI!==ts||!!tb[l])&&(r.namespaceURI!==ta||!!tm[l])&&!t_[o]&&(ty[o]||!tE[o]):"application/xhtml+xml"===tk&&!!tf[e.namespaceURI])},tI=function(e){D(i.removed,{element:e});try{k(e).removeChild(e)}catch(t){if(g(e),!k(e))throw V("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},tC=function(e){let t=y(e);if(t){let e=[];R(t,t=>{D(e,t)}),R(e,e=>{try{g(e)}catch(e){}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if("string"==typeof i)try{e.removeAttribute(i)}catch(e){}}},tP=function(e,t){try{D(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){D(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(e2||e3)try{tI(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},tR=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if("string"==typeof i&&!eF[tw(i)])try{e.removeAttribute(i)}catch(e){}}},tN=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(S?S(e):e.nodeType)===1&&tR(e);let n=y(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},tj=function(e){let n=null,r=null;if(e1)e="<remove></remove>"+e;else{let t=B(e,/^[\r\n\t ]+/);r=t&&t[0]}"application/xhtml+xml"===tk&&tu===tc&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let i=t?K(e):e;if(tu===tc)try{n=new f().parseFromString(i,tk)}catch(e){}if(!n||!n.documentElement){n=eR.createDocument(tu,"template",null);try{n.documentElement.innerHTML=tp?T:i}catch(e){}}let l=n.body||n.documentElement;return(e&&r&&l.insertBefore(o.createTextNode(r),l.childNodes[0]||null),tu===tc)?eD.call(n,eJ?"html":"body")[0]:eJ?n.documentElement:l},tD=function(e){return eN.call(e.ownerDocument||e,e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},tz=function(e){return e=F(e,ed," "),e=F(e,eh," "),e=F(e,em," ")},t$=function(e){var t;e.normalize();let n=eN.call(e.ownerDocument||e,e,p.SHOW_TEXT|p.SHOW_COMMENT|p.SHOW_CDATA_SECTION|p.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=tz(r.data),r=n.nextNode();let i=null==(t=e.querySelectorAll)?void 0:t.call(e,"template");i&&R(i,e=>{tL(e.content)&&t$(e.content)})},tM=function(e){let t=O?O(e):null;return"string"==typeof t&&"form"===tw(t)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==v(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==S(e)||e.childNodes!==y(e))},tL=function(e){if(!S||"object"!=typeof e||null===e)return!1;try{return 11===S(e)}catch(e){return!1}},tB=function(e){if(!S||"object"!=typeof e||null===e)return!1;try{return"number"==typeof S(e)}catch(e){return!1}};function tF(e,t,n){0!==e.length&&R(e,e=>{e.call(i,t,n,tv)})}let tU=function(e,t){if(!eq[t]&&tW(t)&&(eG.tagNameCheck instanceof RegExp&&X(eG.tagNameCheck,t)||eG.tagNameCheck instanceof Function&&eG.tagNameCheck(t)))return!1;if(e8&&!tt[t]){let t=k(e),n=y(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=e7?n[i]:m(n[i],!0);t.insertBefore(r,b(e))}}}return tI(e),!0},tG=function(e){if(tF(e$.beforeSanitizeElements,e,null),tM(e))return tI(e),!0;let t=tw(O?O(e):e.nodeName);if(tF(e$.uponSanitizeElement,e,{tagName:t,allowedTags:eL}),eK&&e.hasChildNodes()&&!tB(e.firstElementChild)&&X(eS,e.textContent)&&X(eS,e.innerHTML)||eK&&e.namespaceURI===tc&&"style"===t&&tB(e.firstElementChild)||7===e.nodeType||eK&&8===e.nodeType&&X(eO,e.data)||0)return tI(e),!0;if(eq[t]||!(eW.tagCheck instanceof Function&&eW.tagCheck(t))&&!eL[t])return tU(e,t);if((S?S(e):e.nodeType)===1&&!tA(e)||("noscript"===t||"noembed"===t||"noframes"===t)&&X(eT,e.innerHTML))return tI(e),!0;if(eV&&3===e.nodeType){let t=tz(e.textContent);e.textContent!==t&&(D(i.removed,{element:e.cloneNode()}),e.textContent=t)}return tF(e$.afterSanitizeElements,e,null),!1},tq=function(e,t,n){if(eH[t]||e6&&("id"===t||"name"===t)&&(n in o||n in tS))return!1;let r=eF[t]||eW.attributeCheck instanceof Function&&eW.attributeCheck(t,e);if(eY&&X(eg,t));else if(eZ&&X(eb,t));else if(r){if(to[t]);else if(X(eM,F(n,ex,"")));else if(("src"===t||"xlink:href"===t||"href"===t)&&"script"!==e&&0===U(n,"data:")&&tr[e]);else if(eQ&&!X(ek,F(n,ex,"")));else if(n)return!1}else if(!(tW(e)&&(eG.tagNameCheck instanceof RegExp&&X(eG.tagNameCheck,e)||eG.tagNameCheck instanceof Function&&eG.tagNameCheck(e))&&(eG.attributeNameCheck instanceof RegExp&&X(eG.attributeNameCheck,t)||eG.attributeNameCheck instanceof Function&&eG.attributeNameCheck(t,e))||"is"===t&&eG.allowCustomizedBuiltInElements&&(eG.tagNameCheck instanceof RegExp&&X(eG.tagNameCheck,n)||eG.tagNameCheck instanceof Function&&eG.tagNameCheck(n))))return!1;return!0},tH=J({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),tW=function(e){return!tH[M(e)]&&X(ev,e)},tZ=function(e,n,r,i){if(t&&"object"==typeof d&&"function"==typeof d.getAttributeType&&!r)switch(d.getAttributeType(e,n)){case"TrustedHTML":return K(i);case"TrustedScriptURL":return eC(i)}return i},tY=function(e,t,n,r){try{n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),tM(e)?tI(e):j(i.removed)}catch(n){tP(t,e)}},tQ=function(e){tF(e$.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||tM(e))return;let n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:eF,forceKeepAttr:void 0},r=t.length,i=tw(e.nodeName);for(;r--;){let o=t[r],l=o.name,a=o.namespaceURI,s=o.value,c=tw(l),u="value"===l?s:G(s);if(n.attrName=c,n.attrValue=u,n.keepAttr=!0,n.forceKeepAttr=void 0,tF(e$.uponSanitizeAttribute,e,n),u=n.attrValue,e9&&("id"===c||"name"===c)&&0!==U(u,e5)&&(tP(l,e),u=e5+u),eK&&X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)||"attributename"===c&&B(u,"href")){tP(l,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr||!eX&&X(eE,u)||(eV&&(u=tz(u)),!tq(i,c,u))){tP(l,e);continue}(u=tZ(i,c,a,u))!==s&&tY(e,l,a,u)}}tF(e$.afterSanitizeAttributes,e,null)},tX=function(e){let t=null,n=tD(e);for(tF(e$.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(tF(e$.uponSanitizeShadowNode,t,null),tG(t),tQ(t),tL(t.content)&&tX(t.content),(S?S(t):t.nodeType)===1){let e=x(t);tL(e)&&(tV(e),tX(e))}tF(e$.afterSanitizeShadowDOM,e,null)},tV=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){tX(e.shadow);continue}let n=e.node,r=(S?S(n):n.nodeType)===1,i=y(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=O?O(n):null;if("string"==typeof e&&"template"===tw(e)){let e=n.content;tL(e)&&t.push({node:e,shadow:null})}}if(r){let e=x(n);tL(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return i.sanitize=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,a=null,s=null;if((tp=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!tB(e)&&"string"!=typeof(e=function(e){switch(typeof e){case"string":return e;case"number":return q(e);case"boolean":return H(e);case"bigint":return W?W(e):"0";case"symbol":return Z?Z(e):"Symbol()";case"undefined":default:return Q(e);case"function":case"object":{if(null===e)return Q(e);let t=et(e,"toString");if("function"==typeof t){let n=t(e);return"string"==typeof n?n:Q(n)}return Q(e)}}}(e)))throw V("dirty is not a string, aborting");if(!i.isSupported)return e;e0||tT(n),i.removed=[];let c=e7&&"string"!=typeof e&&tB(e);if(c){let t=O?O(e):e.nodeName;if("string"==typeof t){let e=tw(t);if(!eL[e]||eq[e])throw V("root node is forbidden and cannot be sanitized in-place")}if(tM(e))throw V("root node is clobbered and cannot be sanitized in-place");try{tV(e)}catch(t){throw tC(e),t}}else if(tB(e))1===(o=(r=tj("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o),tV(o);else{if(!e2&&!eV&&!eJ&&-1===e.indexOf("<"))return t&&e4?K(e):e;if(!(r=tj(e)))return e2?null:e4?T:""}r&&e1&&tI(r.firstChild);let u=tD(c?e:r);try{for(;a=u.nextNode();)tG(a),tQ(a),tL(a.content)&&tX(a.content)}catch(t){throw c&&tC(e),t}if(c)return R(i.removed,e=>{e.element&&tN(e.element)}),eV&&t$(e),e;if(e2){if(eV&&t$(r),e3)for(s=ej.call(r.ownerDocument);r.firstChild;)s.appendChild(r.firstChild);else s=r;return(eF.shadowroot||eF.shadowrootmode)&&(s=ez.call(l,s,!0)),s}let p=eJ?r.outerHTML:r.innerHTML;return eJ&&eL["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&X(ew,r.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+p),eV&&(p=tz(p)),t&&e4?K(p):p},i.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tT(e),e0=!0},i.clearConfig=function(){tv=null,e0=!1,t=n,T=""},i.isValidAttribute=function(e,t,n){return tv||tT({}),tq(tw(e),tw(t),n)},i.addHook=function(e,t){"function"==typeof t&&D(e$[e],t)},i.removeHook=function(e,t){if(void 0!==t){let n=N(e$[e],t);return -1===n?void 0:z(e$[e],n,1)[0]}return j(e$[e])},i.removeHooks=function(e){e$[e]=[]},i.removeAllHooks=function(){e$=eA()},i}();function eP(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let eR=eP(),eN=/[&<>"']/,ej=RegExp(eN.source,"g"),eD=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ez=RegExp(eD.source,"g"),e$={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},eM=e=>e$[e];function eL(e,t){if(t){if(eN.test(e))return e.replace(ej,eM)}else if(eD.test(e))return e.replace(ez,eM);return e}let eB=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,eF=/(^|[^\[])\^/g;function eU(e,t){let n="string"==typeof e?e:e.source;t=t||"";let r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(eF,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function eG(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}let eq={exec:()=>null};function eH(e,t){let n=e.replace(/\|/g,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"}).split(/ \|/),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 eW(e,t,n){let r=e.length;if(0===r)return"";let i=0;for(;i<r;){let o=e.charAt(r-i-1);if(o!==t||n)if(o!==t&&n)i++;else break;else i++}return e.slice(0,r-i)}function eZ(e,t,n,r){let i=t.href,o=t.title?eL(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;let e={type:"link",raw:n,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:i,title:o,text:eL(l)}}class eY{options;rules;lexer;constructor(e){this.options=e||eR}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:eW(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t){let n=e.match(/^(\s+)(?:```)/);if(null===n)return t;let r=n[1];return t.split("\n").map(e=>{let t=e.match(/^\s+/);if(null===t)return e;let[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.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){let t=eW(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){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");e=eW(e.replace(/^ *>[ \t]?/gm,""),"\n");let n=this.lexer.state.top;this.lexer.state.top=!0;let 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(),r=n.length>1,i={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:"[*+-]");let o=RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),l="",a="",s=!1;for(;e;){let n,r=!1;if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;l=t[0],e=e.substring(l.length);let c=t[2].split("\n",1)[0].replace(/^\t+/,e=>" ".repeat(3*e.length)),u=e.split("\n",1)[0],p=0;this.options.pedantic?(p=2,a=c.trimStart()):(p=(p=t[2].search(/[^ ]/))>4?1:p,a=c.slice(p),p+=t[1].length);let f=!1;if(!c&&/^ *$/.test(u)&&(l+=u+"\n",e=e.substring(u.length+1),r=!0),!r){let t=RegExp(`^ {0,${Math.min(3,p-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),n=RegExp(`^ {0,${Math.min(3,p-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),r=RegExp(`^ {0,${Math.min(3,p-1)}}(?:\`\`\`|~~~)`),i=RegExp(`^ {0,${Math.min(3,p-1)}}#`);for(;e;){let o=e.split("\n",1)[0];if(u=o,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),r.test(u)||i.test(u)||t.test(u)||n.test(e))break;if(u.search(/[^ ]/)>=p||!u.trim())a+="\n"+u.slice(p);else{if(f||c.search(/[^ ]/)>=4||r.test(c)||i.test(c)||n.test(c))break;a+="\n"+u}f||u.trim()||(f=!0),l+=o+"\n",e=e.substring(o.length+1),c=u.slice(p)}}!i.loose&&(s?i.loose=!0:/\n *\n *$/.test(l)&&(s=!0));let d=null;this.options.gfm&&(d=/^\[[ xX]\] /.exec(a))&&(n="[ ] "!==d[0],a=a.replace(/^\[[ xX]\] +/,"")),i.items.push({type:"list_item",raw:l,task:!!d,checked:n,loose:!1,text:a,tokens:[]}),i.raw+=l}i.items[i.items.length-1].raw=l.trimEnd(),i.items[i.items.length-1].text=a.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>"space"===e.type);i.loose=t.length>0&&t.some(e=>/\n.*\n/.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let 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){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let n=eH(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)/^ *-+: *$/.test(e)?o.align.push("right"):/^ *:-+: *$/.test(e)?o.align.push("center"):/^ *:-+ *$/.test(e)?o.align.push("left"):o.align.push(null);for(let e of n)o.header.push({text:e,tokens:this.lexer.inline(e)});for(let e of i)o.rows.push(eH(e,o.header.length).map(e=>({text:e,tokens:this.lexer.inline(e)})));return o}}lheading(e){let 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){let t=this.rules.block.paragraph.exec(e);if(t){let 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){let 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){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:eL(t[1])}}tag(e){let 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){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;let t=eW(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e){if(-1===e.indexOf(")"))return -1;let t=0;for(let n=0;n<e.length;n++)if("\\"===e[n])n++;else if("("===e[n])t++;else if(")"===e[n]&&--t<0)return n;return -1}(t[2]);if(e>-1){let 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){let 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)),eZ(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$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=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return eZ(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(/[\p{L}\p{N}]/u))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,o,l=n,a=0,s="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(s.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=s.exec(t));){if(!(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6]))continue;if(o=[...i].length,r[3]||r[4]){l+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){a+=o;continue}if((l-=o)>0)continue;o=Math.min(o,o+l+a);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+o);if(Math.min(n,o)%2){let e=s.slice(1,-1);return{type:"em",raw:s,text:e,tokens:this.lexer.inlineTokens(e)}}let c=s.slice(2,-2);return{type:"strong",raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," "),n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=eL(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let 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){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return n="@"===t[2]?"mailto:"+(e=eL(t[1])):e=eL(t[1]),{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])n="mailto:"+(e=eL(t[0]));else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(r!==t[0]);e=eL(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){let t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:eL(t[0]),{type:"text",raw:t[0],text:e}}}}let eQ=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,eX=/(?:[*+-]|\d{1,9}[.)])/,eV=eU(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,eX).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),eK=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,eJ=/(?!\s*\])(?:\\.|[^\[\]\\])+/,e0=eU(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",eJ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),e1=eU(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,eX).getRegex(),e2="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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",e3=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,e4=eU("^ {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|$))","i").replace("comment",e3).replace("tag",e2).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),e6=eU(eK).replace("hr",eQ).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",e2).getRegex(),e9={blockquote:eU(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",e6).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:e0,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:eQ,html:e4,lheading:eV,list:e1,newline:/^(?: *(?:\n|$))+/,paragraph:e6,table:eq,text:/^[^\n]+/},e5=eU("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",eQ).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",e2).getRegex(),e8={...e9,table:e5,paragraph:eU(eK).replace("hr",eQ).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",e5).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",e2).getRegex()},e7={...e9,html:eU("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",e3).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:eq,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:eU(eK).replace("hr",eQ).replace("heading"," *#{1,6} *[^\n]").replace("lheading",eV).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},te=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,tt=/^( {2,}|\\)\n(?!\s*$)/,tn="\\p{P}\\p{S}",tr=eU(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,tn).getRegex(),ti=eU(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,tn).getRegex(),to=eU("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,tn).getRegex(),tl=eU("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,tn).getRegex(),ta=eU(/\\([punct])/,"gu").replace(/punct/g,tn).getRegex(),ts=eU(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("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])?)+(?![-_])/).getRegex(),tc=eU(e3).replace("(?:--\x3e|$)","--\x3e").getRegex(),tu=eU("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",tc).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),tp=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,tf=eU(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",tp).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),td=eU(/^!?\[(label)\]\[(ref)\]/).replace("label",tp).replace("ref",eJ).getRegex(),th=eU(/^!?\[(ref)\](?:\[\])?/).replace("ref",eJ).getRegex(),tm=eU("reflink|nolink(?!\\()","g").replace("reflink",td).replace("nolink",th).getRegex(),tg={_backpedal:eq,anyPunctuation:ta,autolink:ts,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:tt,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:eq,emStrongLDelim:ti,emStrongRDelimAst:to,emStrongRDelimUnd:tl,escape:te,link:tf,nolink:th,punctuation:tr,reflink:td,reflinkSearch:tm,tag:tu,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:eq},tb={...tg,link:eU(/^!?\[(label)\]\((.*?)\)/).replace("label",tp).getRegex(),reflink:eU(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",tp).getRegex()},ty={...tg,escape:eU(te).replace("])","~|])").getRegex(),url:eU(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_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.!#$%&'*+\/=?_`{\|}~-]+@)))/},tk={...ty,br:eU(tt).replace("{2,}","*").getRegex(),text:eU(ty.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},tx={normal:e9,gfm:e8,pedantic:e7},tw={normal:tg,gfm:ty,breaks:tk,pedantic:tb};class tv{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||eR,this.options.tokenizer=this.options.tokenizer||new eY,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:tx.normal,inline:tw.normal};this.options.pedantic?(t.block=tx.pedantic,t.inline=tw.pedantic):this.options.gfm&&(t.block=tx.gfm,this.options.breaks?t.inline=tw.breaks:t.inline=tw.gfm),this.tokenizer.rules=t}static get rules(){return{block:tx,inline:tw}}static lex(e,t){return new tv(t).lex(e)}static lexInline(e,t){return new tv(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){let n,r,i,o;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);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),(r=t[t.length-1])&&("paragraph"===r.type||"text"===r.type)?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);continue}if((n=this.tokenizer.fences(e))||(n=this.tokenizer.heading(e))||(n=this.tokenizer.hr(e))||(n=this.tokenizer.blockquote(e))||(n=this.tokenizer.list(e))||(n=this.tokenizer.html(e))){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length),(r=t[t.length-1])&&("paragraph"===r.type||"text"===r.type)?(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if((n=this.tokenizer.table(e))||(n=this.tokenizer.lheading(e))){e=e.substring(n.raw.length),t.push(n);continue}if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach(e=>{"number"==typeof(t=e.call({lexer:this},r))&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i))){r=t[t.length-1],o&&"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),o=i.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),(r=t[t.length-1])&&"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);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw 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,i,o,l,a,s=e;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(s));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(s));)s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(s));)s=s.slice(0,o.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(a=""),l=!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);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),(r=t[t.length-1])&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),(r=t[t.length-1])&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if((n=this.tokenizer.emStrong(e,s,a))||(n=this.tokenizer.codespan(e))||(n=this.tokenizer.br(e))||(n=this.tokenizer.del(e))||(n=this.tokenizer.autolink(e))||!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach(e=>{"number"==typeof(t=e.call({lexer:this},r))&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(n=this.tokenizer.inlineText(i)){e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),l=!0,(r=t[t.length-1])&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}}class tS{options;constructor(e){this.options=e||eR}code(e,t,n){let r=(t||"").match(/^\S*/)?.[0];return(e=e.replace(/\n$/,"")+"\n",r)?'<pre><code class="language-'+eL(r)+'">'+(n?e:eL(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:eL(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("plugin-build-guide-block",["react-i18next","@nocobase/client-v2","react","antd","@nocobase/client","@formily/react","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["plugin-build-guide-block"]=t(require("react-i18next"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["plugin-build-guide-block"]=t(e["react-i18next"],e["@nocobase/client-v2"],e.react,e.antd,e["@nocobase/client"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,i,o,l,a){return function(){"use strict";var s={375:function(e){e.exports=l},230:function(e){e.exports=o},342:function(e){e.exports=i},485:function(e){e.exports=t},694:function(e){e.exports=a},59:function(e){e.exports=r},155:function(e){e.exports=n},953:function(t){t.exports=e}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return s[e](n,n.exports,u),n.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.g.importScripts&&(p=u.g.location+"");var p,f=u.g.document;if(!p&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(p=f.currentScript.src),!p)){var d=f.getElementsByTagName("script");if(d.length)for(var h=d.length-1;h>-1&&(!p||!/^http(s?):/.test(p));)p=d[h--].src}if(!p)throw Error("Automatic publicPath is not supported in this browser");u.p=p.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var m={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/plugin-build-guide-block/dist/client/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/plugin-build-guide-block/dist/client/")}if(!e){var i=window.__nocobase_modern_client_prefix__||"v",o="/"+(i=String(i).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var l=window.location.pathname||"/",a=l.indexOf(o);e=a>=0?l.slice(0,a+1):"/"}e&&(e=e.replace(RegExp("/"+i+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/plugin-build-guide-block/dist/client/"}u.p=e}(),!function(){u.r(m),u.d(m,{default:function(){return t9}});var e,t=u(342),n=u(155),r=u.n(n),i=u(59),o=u(375),l=u(485),a=u(953);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){n(e);return}a.done?t(s):Promise.resolve(s).then(r,i)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){c(o,r,i,l,a,"next",e)}function a(e){c(o,r,i,l,a,"throw",e)}l(void 0)})}}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],l=!0,a=!1;try{for(i=i.call(e);!(l=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==i.return||i.return()}finally{if(a)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:s(0)}),a(l,"throw",{value:s(1)}),a(l,"return",{value:s(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function s(a){return function(s){var c=[a,s];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(6===c[0]&&o.label<i[1]){o.label=i[1],i=c;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(c);break}i[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var h={draft:"default",building:"blue",completed:"success",error:"error"},g=[{label:"HTML",value:"html"},{label:"Markdown",value:"markdown"}],b=function(e){var t=Number(e);return Number.isFinite(t)?Math.max(1,Math.min(12,Math.round(t))):5},y=function(){var e=(0,a.useTranslation)().t,t=(0,l.useApp)().apiClient,s=i.App.useApp(),c=s.message,u=s.modal,m=f(i.Form.useForm(),1)[0],y=i.Form.useWatch("llmService",m),k=f((0,n.useState)([]),2),x=k[0],w=k[1],v=f((0,n.useState)(!1),2),S=v[0],O=v[1],T=f((0,n.useState)(!1),2),E=T[0],_=T[1],A=f((0,n.useState)(null),2),I=A[0],C=A[1],P=f((0,n.useState)(!1),2),R=P[0],N=P[1],j=f((0,n.useState)([]),2),D=j[0],z=j[1],$=f((0,n.useState)([]),2),M=$[0],L=$[1],B=f((0,n.useState)(null),2),F=B[0],U=B[1],G=(0,n.useRef)(null),q=(0,n.useCallback)(function(){return p(function(){var e,n;return d(this,function(r){switch(r.label){case 0:O(!0),r.label=1;case 1:return r.trys.push([1,,3,4]),[4,t.resource("aiBuildGuideSpaces").list({appends:["documents"],sort:["-createdAt"],paginate:!1})];case 2:return w((null==(n=r.sent())||null==(e=n.data)?void 0:e.data)||[]),[3,4];case 3:return O(!1),[7];case 4:return[2]}})})()},[t]);(0,n.useEffect)(function(){q()},[q]),(0,n.useEffect)(function(){return function(){G.current&&clearTimeout(G.current)}},[]);var H=(0,n.useCallback)(function(){return p(function(){var e,n;return d(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t.resource("ai").listLLMServices()];case 1:return z(((null==(n=r.sent())||null==(e=n.data)?void 0:e.data)||[]).map(function(e){return{label:e.title||e.name,value:e.name}})),[3,3];case 2:return r.sent(),z([]),[3,3];case 3:return[2]}})})()},[t]),W=(0,n.useCallback)(function(e){return p(function(){var n,r;return d(this,function(i){switch(i.label){case 0:if(!e)return L([]),[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,t.resource("ai").listModels({llmService:e})];case 2:return L(((null==(r=i.sent())||null==(n=r.data)?void 0:n.data)||[]).map(function(e){return{label:e.id||e.name,value:e.id||e.name}})),[3,4];case 3:return i.sent(),L([]),[3,4];case 4:return[2]}})})()},[t]);(0,n.useEffect)(function(){W(y)},[y,W]);var Z=function(e){C(e.id),m.resetFields(),m.setFieldsValue({title:e.title,llmService:e.llmService,model:e.model,outputFormat:e.outputFormat||"html",targetChapterCount:b(e.targetChapterCount),chapterGuidance:e.chapterGuidance,systemPrompt:e.systemPrompt}),H(),W(e.llmService),_(!0)},Y=(0,n.useCallback)(function(){G.current&&(clearTimeout(G.current),G.current=null),U(null)},[]),Q=[{title:e("Title"),dataIndex:"title"},{title:e("Status"),dataIndex:"status",render:function(e){return e?r().createElement(i.Tag,{color:h[e]||"default"},String(e).toUpperCase()):null}},{title:e("Build Phase"),dataIndex:"buildPhase"},{title:e("Chapters"),dataIndex:"pageCount"},{title:e("Actions"),key:"actions",render:function(n,l){return r().createElement(i.Space,{split:"|"},r().createElement(i.Button,{type:"link",icon:r().createElement(o.PlayCircleOutlined,null),loading:F===l.id,disabled:"building"===l.status,onClick:function(){return p(function(){var n,r,i,o,a,s,u;return d(this,function(f){switch(f.label){case 0:U(l.id),f.label=1;case 1:return f.trys.push([1,3,,4]),[4,t.resource("aiBuildGuideSpaces").build({filterByTk:l.id})];case 2:return f.sent(),c.success(e("Build started")),n=Date.now(),r=!1,i=function(){return p(function(){var o,a,s,u,p;return d(this,function(f){switch(f.label){case 0:return f.trys.push([0,4,,6]),[4,t.resource("aiBuildGuideSpaces").get({filterByTk:l.id})];case 1:if("building"===(u=null==(s=f.sent())||null==(a=s.data)||null==(o=a.data)?void 0:o.status))return[3,3];return Y(),[4,q()];case 2:return f.sent(),"completed"===u?c.success(e("Build completed")):"error"===u&&c.error(e("Build failed")),[2];case 3:return(p=Date.now()-n)>=3e5&&!r&&(r=!0,c.info(e("Build is still running"))),G.current=setTimeout(i,p>=3e5?1e4:3e3),[3,6];case 4:return f.sent(),Y(),[4,q()];case 5:return f.sent(),[3,6];case 6:return[2]}})})()},G.current=setTimeout(i,3e3),[3,4];case 3:return o=f.sent(),c.error((null==o||null==(u=o.response)||null==(s=u.data)||null==(a=s.error)?void 0:a.message)||e("Build failed")),U(null),[3,4];case 4:return[2]}})})()}},e("Build")),r().createElement("a",{onClick:function(){return Z(l)}},e("Edit")),r().createElement("a",{onClick:function(){return u.confirm({title:e("Delete"),content:e("Are you sure you want to delete this space?"),onOk:function(){return p(function(){return d(this,function(n){switch(n.label){case 0:return[4,t.resource("aiBuildGuideSpaces").destroy({filterByTk:l.id})];case 1:return n.sent(),c.success(e("Deleted")),[4,q()];case 2:return n.sent(),[2]}})})()}})}},e("Delete")))}}];return r().createElement("div",null,r().createElement(i.Space,{style:{marginBottom:16}},r().createElement(i.Button,{type:"primary",icon:r().createElement(o.PlusOutlined,null),onClick:function(){C(null),m.resetFields(),m.setFieldsValue({outputFormat:"html",targetChapterCount:5,systemPrompt:"You are an expert technical writer. Generate a comprehensive user guide based on the provided documents."}),H(),_(!0)}},e("Create space")),r().createElement(i.Button,{onClick:q},e("Refresh"))),r().createElement(i.Table,{rowKey:"id",loading:S,dataSource:x,columns:Q}),r().createElement(i.Drawer,{title:I?e("Edit space"):e("Create space"),open:E,onClose:function(){return _(!1)},width:640,footer:r().createElement(i.Space,{style:{float:"right"}},r().createElement(i.Button,{onClick:function(){return _(!1)}},e("Cancel")),r().createElement(i.Button,{type:"primary",loading:R,onClick:function(){return p(function(){var n,r,i,o,l;return d(this,function(a){switch(a.label){case 0:return[4,m.validateFields()];case 1:(n=a.sent()).targetChapterCount=b(n.targetChapterCount),N(!0),a.label=2;case 2:if(a.trys.push([2,8,9,10]),!I)return[3,4];return[4,t.resource("aiBuildGuideSpaces").update({filterByTk:I,values:n})];case 3:return a.sent(),[3,6];case 4:return[4,t.resource("aiBuildGuideSpaces").create({values:n})];case 5:a.sent(),a.label=6;case 6:return c.success(e("Saved successfully")),_(!1),[4,q()];case 7:return a.sent(),[3,10];case 8:if(null==(r=a.sent())?void 0:r.errorFields)return[2];return c.error((null==r||null==(l=r.response)||null==(o=l.data)||null==(i=o.error)?void 0:i.message)||e("Save failed")),[3,10];case 9:return N(!1),[7];case 10:return[2]}})})()}},e("Submit")))},r().createElement(i.Form,{form:m,layout:"vertical",onValuesChange:function(e){"llmService"in e&&m.setFieldValue("model",void 0)}},r().createElement(i.Form.Item,{name:"title",label:e("Title"),rules:[{required:!0}]},r().createElement(i.Input,null)),r().createElement(i.Form.Item,{name:"llmService",label:e("LLM Service"),rules:[{required:!0}]},r().createElement(i.Select,{options:D,onFocus:H,showSearch:!0,optionFilterProp:"label"})),r().createElement(i.Form.Item,{name:"model",label:e("Model"),rules:[{required:!0}]},r().createElement(i.Select,{options:M,disabled:!y,showSearch:!0,optionFilterProp:"label"})),r().createElement(i.Form.Item,{name:"outputFormat",label:e("Output format"),rules:[{required:!0}]},r().createElement(i.Select,{options:g})),r().createElement(i.Form.Item,{name:"targetChapterCount",label:e("Target chapters"),rules:[{required:!0}]},r().createElement(i.InputNumber,{min:1,max:12,precision:0,style:{width:"100%"}})),r().createElement(i.Form.Item,{name:"chapterGuidance",label:e("Chapter guidance")},r().createElement(i.Input.TextArea,{rows:3,placeholder:e("Describe how the guide should be split into chapters")})),r().createElement(i.Form.Item,{name:"systemPrompt",label:e("System Prompt")},r().createElement(i.Input.TextArea,{rows:4})))))},k=u(230);function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let w=Object.entries,v=Object.setPrototypeOf,S=Object.isFrozen,O=Object.getPrototypeOf,T=Object.getOwnPropertyDescriptor,E=Object.freeze,_=Object.seal,A=Object.create,I="u">typeof Reflect&&Reflect,C=I.apply,P=I.construct;E||(E=function(e){return e}),_||(_=function(e){return e}),C||(C=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)}),P||(P=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});let R=K(Array.prototype.forEach),N=K(Array.prototype.lastIndexOf),j=K(Array.prototype.pop),D=K(Array.prototype.push),z=K(Array.prototype.splice),$=Array.isArray,M=K(String.prototype.toLowerCase),L=K(String.prototype.toString),B=K(String.prototype.match),F=K(String.prototype.replace),U=K(String.prototype.indexOf),G=K(String.prototype.trim),q=K(Number.prototype.toString),H=K(Boolean.prototype.toString),W="u"<typeof BigInt?null:K(BigInt.prototype.toString),Z="u"<typeof Symbol?null:K(Symbol.prototype.toString),Y=K(Object.prototype.hasOwnProperty),Q=K(Object.prototype.toString),X=K(RegExp.prototype.test),V=(e=TypeError,function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return P(e,n)});function K(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return C(e,t,r)}}function J(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:M;if(v&&v(e,null),!$(t))return e;let r=t.length;for(;r--;){let i=t[r];if("string"==typeof i){let e=n(i);e!==i&&(S(t)||(t[r]=e),i=e)}e[i]=!0}return e}function ee(e){let t=A(null);for(let r of w(e)){var n=function(e){if(Array.isArray(e))return e}(r)||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,l=[],a=!0,s=!1;try{i=(t=t.call(e)).next,!1;for(;!(a=(n=i.call(t)).done)&&(l.push(n.value),2!==l.length);a=!0);}catch(e){s=!0,r=e}finally{try{if(!a&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(s)throw r}}return l}}(r)||function(e){if(e){if("string"==typeof e)return x(e,2);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?x(e,2):void 0}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();let i=n[0],o=n[1];Y(e,i)&&($(o)?t[i]=function(e){for(let t=0;t<e.length;t++)Y(e,t)||(e[t]=null);return e}(o):o&&"object"==typeof o&&o.constructor===Object?t[i]=ee(o):t[i]=o)}return t}function et(e,t){for(;null!==e;){let n=T(e,t);if(n){if(n.get)return K(n.get);if("function"==typeof n.value)return K(n.value)}e=O(e)}return function(){return null}}let en=E(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),er=E(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ei=E(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),eo=E(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),el=E(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ea=E(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),es=E(["#text"]),ec=E(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),eu=E(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ep=E(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ef=E(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ed=_(/{{[\w\W]*|^[\w\W]*}}/g),eh=_(/<%[\w\W]*|^[\w\W]*%>/g),em=_(/\${[\w\W]*/g),eg=_(/^data-[\-\w.\u00B7-\uFFFF]+$/),eb=_(/^aria-[\-\w]+$/),ey=_(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ek=_(/^(?:\w+script|data):/i),ex=_(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ew=_(/^html$/i),ev=_(/^[a-z][.\w]*(-[.\w]+)+$/i),eS=_(/<[/\w!]/g),eO=_(/<[/\w]/g),eT=_(/<\/no(script|embed|frames)/i),eE=_(/\/>/i),e_=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null,r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}},eA=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},eI=function(e,t,n,r){return Y(e,t)&&$(e[t])?J(r.base?ee(r.base):{},e[t],r.transform):n};var eC=function e(){let t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"u"<typeof window?null:window,i=t=>e(t);if(i.version="3.4.10",i.removed=[],!r||!r.document||9!==r.document.nodeType||!r.Element)return i.isSupported=!1,i;let o=r.document,l=o,a=l.currentScript;r.DocumentFragment;let s=r.HTMLTemplateElement,c=r.Node,u=r.Element,p=r.NodeFilter;void 0===r.NamedNodeMap&&(r.NamedNodeMap||r.MozNamedAttrMap),r.HTMLFormElement;let f=r.DOMParser,d=r.trustedTypes,h=u.prototype,m=et(h,"cloneNode"),g=et(h,"remove"),b=et(h,"nextSibling"),y=et(h,"childNodes"),k=et(h,"parentNode"),x=et(h,"shadowRoot"),v=et(h,"attributes"),S=c&&c.prototype?et(c.prototype,"nodeType"):null,O=c&&c.prototype?et(c.prototype,"nodeName"):null;if("function"==typeof s){let e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let T="",I=!1,C=0,P=function(){if(C>0)throw V('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},K=function(e){P(),C++;try{return t.createHTML(e)}finally{C--}},eC=function(e){P(),C++;try{return t.createScriptURL(e)}finally{C--}},eP=o,eR=eP.implementation,eN=eP.createNodeIterator,ej=eP.createDocumentFragment,eD=eP.getElementsByTagName,ez=l.importNode,e$=eA();i.isSupported="function"==typeof w&&"function"==typeof k&&eR&&void 0!==eR.createHTMLDocument;let eM=ey,eL=null,eB=J({},[...en,...er,...ei,...el,...es]),eF=null,eU=J({},[...ec,...eu,...ep,...ef]),eG=Object.seal(A(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),eq=null,eH=null,eW=Object.seal(A(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),eZ=!0,eY=!0,eQ=!1,eX=!0,eV=!1,eK=!0,eJ=!1,e0=!1,e1=!1,e2=!1,e3=!1,e4=!1,e6=!0,e9=!1,e5="user-content-",e8=!0,e7=!1,te={},tt=null,tn=J({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),tr=null,ti=J({},["audio","video","img","source","image","track"]),to=null,tl=J({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ta="http://www.w3.org/1998/Math/MathML",ts="http://www.w3.org/2000/svg",tc="http://www.w3.org/1999/xhtml",tu=tc,tp=!1,tf=null,td=J({},[ta,ts,tc],L),th=E(["mi","mo","mn","ms","mtext"]),tm=J({},th),tg=E(["annotation-xml"]),tb=J({},tg),ty=J({},["title","style","font","a","script"]),tk=null,tx=["application/xhtml+xml","text/html"],tw=null,tv=null,tS=o.createElement("form"),tO=function(e){return e instanceof RegExp||e instanceof Function},tT=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(tv&&tv===e)return;e&&"object"==typeof e||(e={}),e=ee(e),tw="application/xhtml+xml"===(tk=-1===tx.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE)?L:M,eL=eI(e,"ALLOWED_TAGS",eB,{transform:tw}),eF=eI(e,"ALLOWED_ATTR",eU,{transform:tw}),tf=eI(e,"ALLOWED_NAMESPACES",td,{transform:L}),to=eI(e,"ADD_URI_SAFE_ATTR",tl,{transform:tw,base:tl}),tr=eI(e,"ADD_DATA_URI_TAGS",ti,{transform:tw,base:ti}),tt=eI(e,"FORBID_CONTENTS",tn,{transform:tw}),eq=eI(e,"FORBID_TAGS",ee({}),{transform:tw}),eH=eI(e,"FORBID_ATTR",ee({}),{transform:tw}),te=!!Y(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?ee(e.USE_PROFILES):e.USE_PROFILES),eZ=!1!==e.ALLOW_ARIA_ATTR,eY=!1!==e.ALLOW_DATA_ATTR,eQ=e.ALLOW_UNKNOWN_PROTOCOLS||!1,eX=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,eV=e.SAFE_FOR_TEMPLATES||!1,eK=!1!==e.SAFE_FOR_XML,eJ=e.WHOLE_DOCUMENT||!1,e2=e.RETURN_DOM||!1,e3=e.RETURN_DOM_FRAGMENT||!1,e4=e.RETURN_TRUSTED_TYPE||!1,e1=e.FORCE_BODY||!1,e6=!1!==e.SANITIZE_DOM,e9=e.SANITIZE_NAMED_PROPS||!1,e8=!1!==e.KEEP_CONTENT,e7=e.IN_PLACE||!1,eM=!function(e){try{return X(e,""),!0}catch(e){return!1}}(e.ALLOWED_URI_REGEXP)?ey:e.ALLOWED_URI_REGEXP,tu="string"==typeof e.NAMESPACE?e.NAMESPACE:tc,tm=Y(e,"MATHML_TEXT_INTEGRATION_POINTS")&&e.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof e.MATHML_TEXT_INTEGRATION_POINTS?ee(e.MATHML_TEXT_INTEGRATION_POINTS):J({},th),tb=Y(e,"HTML_INTEGRATION_POINTS")&&e.HTML_INTEGRATION_POINTS&&"object"==typeof e.HTML_INTEGRATION_POINTS?ee(e.HTML_INTEGRATION_POINTS):J({},tg);let r=Y(e,"CUSTOM_ELEMENT_HANDLING")&&e.CUSTOM_ELEMENT_HANDLING&&"object"==typeof e.CUSTOM_ELEMENT_HANDLING?ee(e.CUSTOM_ELEMENT_HANDLING):A(null);if(eG=A(null),Y(r,"tagNameCheck")&&tO(r.tagNameCheck)&&(eG.tagNameCheck=r.tagNameCheck),Y(r,"attributeNameCheck")&&tO(r.attributeNameCheck)&&(eG.attributeNameCheck=r.attributeNameCheck),Y(r,"allowCustomizedBuiltInElements")&&"boolean"==typeof r.allowCustomizedBuiltInElements&&(eG.allowCustomizedBuiltInElements=r.allowCustomizedBuiltInElements),_(eG),eV&&(eY=!1),e3&&(e2=!0),te&&(eL=J({},es),eF=A(null),!0===te.html&&(J(eL,en),J(eF,ec)),!0===te.svg&&(J(eL,er),J(eF,eu),J(eF,ef)),!0===te.svgFilters&&(J(eL,ei),J(eF,eu),J(eF,ef)),!0===te.mathMl&&(J(eL,el),J(eF,ep),J(eF,ef))),eW.tagCheck=null,eW.attributeCheck=null,Y(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?eW.tagCheck=e.ADD_TAGS:$(e.ADD_TAGS)&&(eL===eB&&(eL=ee(eL)),J(eL,e.ADD_TAGS,tw))),Y(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?eW.attributeCheck=e.ADD_ATTR:$(e.ADD_ATTR)&&(eF===eU&&(eF=ee(eF)),J(eF,e.ADD_ATTR,tw))),Y(e,"ADD_URI_SAFE_ATTR")&&$(e.ADD_URI_SAFE_ATTR)&&J(to,e.ADD_URI_SAFE_ATTR,tw),Y(e,"FORBID_CONTENTS")&&$(e.FORBID_CONTENTS)&&(tt===tn&&(tt=ee(tt)),J(tt,e.FORBID_CONTENTS,tw)),Y(e,"ADD_FORBID_CONTENTS")&&$(e.ADD_FORBID_CONTENTS)&&(tt===tn&&(tt=ee(tt)),J(tt,e.ADD_FORBID_CONTENTS,tw)),e8&&(eL["#text"]=!0),eJ&&J(eL,["html","head","body"]),eL.table&&(J(eL,["tbody"]),delete eq.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw V('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw V('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let n=t;t=e.TRUSTED_TYPES_POLICY;try{T=K("")}catch(e){throw t=n,e}}else null===e.TRUSTED_TYPES_POLICY?(t=void 0,T=""):(void 0===t&&(I||(n=e_(d,a),I=!0),t=n),t&&"string"==typeof T&&(T=K("")));(e$.uponSanitizeElement.length>0||e$.uponSanitizeAttribute.length>0)&&eL===eB&&(eL=ee(eL)),e$.uponSanitizeAttribute.length>0&&eF===eU&&(eF=ee(eF)),E&&E(e),tv=e},tE=J({},[...er,...ei,...eo]),t_=J({},[...el,...ea]),tA=function(e){var t,n,r;let i=k(e);i&&i.tagName||(i={namespaceURI:tu,tagName:"template"});let o=M(e.tagName),l=M(i.tagName);return!!tf[e.namespaceURI]&&(e.namespaceURI===ts?(t=i).namespaceURI===tc?"svg"===o:t.namespaceURI===ta?"svg"===o&&("annotation-xml"===l||tm[l]):!!tE[o]:e.namespaceURI===ta?(n=i).namespaceURI===tc?"math"===o:n.namespaceURI===ts?"math"===o&&tb[l]:!!t_[o]:e.namespaceURI===tc?((r=i).namespaceURI!==ts||!!tb[l])&&(r.namespaceURI!==ta||!!tm[l])&&!t_[o]&&(ty[o]||!tE[o]):"application/xhtml+xml"===tk&&!!tf[e.namespaceURI])},tI=function(e){D(i.removed,{element:e});try{k(e).removeChild(e)}catch(t){if(g(e),!k(e))throw V("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},tC=function(e){let t=y(e);if(t){let e=[];R(t,t=>{D(e,t)}),R(e,e=>{try{g(e)}catch(e){}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if("string"==typeof i)try{e.removeAttribute(i)}catch(e){}}},tP=function(e,t){try{D(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){D(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(e2||e3)try{tI(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},tR=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if("string"==typeof i&&!eF[tw(i)])try{e.removeAttribute(i)}catch(e){}}},tN=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(S?S(e):e.nodeType)===1&&tR(e);let n=y(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},tj=function(e){let n=null,r=null;if(e1)e="<remove></remove>"+e;else{let t=B(e,/^[\r\n\t ]+/);r=t&&t[0]}"application/xhtml+xml"===tk&&tu===tc&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let i=t?K(e):e;if(tu===tc)try{n=new f().parseFromString(i,tk)}catch(e){}if(!n||!n.documentElement){n=eR.createDocument(tu,"template",null);try{n.documentElement.innerHTML=tp?T:i}catch(e){}}let l=n.body||n.documentElement;return(e&&r&&l.insertBefore(o.createTextNode(r),l.childNodes[0]||null),tu===tc)?eD.call(n,eJ?"html":"body")[0]:eJ?n.documentElement:l},tD=function(e){return eN.call(e.ownerDocument||e,e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},tz=function(e){return e=F(e,ed," "),e=F(e,eh," "),e=F(e,em," ")},t$=function(e){var t;e.normalize();let n=eN.call(e.ownerDocument||e,e,p.SHOW_TEXT|p.SHOW_COMMENT|p.SHOW_CDATA_SECTION|p.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=tz(r.data),r=n.nextNode();let i=null==(t=e.querySelectorAll)?void 0:t.call(e,"template");i&&R(i,e=>{tL(e.content)&&t$(e.content)})},tM=function(e){let t=O?O(e):null;return"string"==typeof t&&"form"===tw(t)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==v(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==S(e)||e.childNodes!==y(e))},tL=function(e){if(!S||"object"!=typeof e||null===e)return!1;try{return 11===S(e)}catch(e){return!1}},tB=function(e){if(!S||"object"!=typeof e||null===e)return!1;try{return"number"==typeof S(e)}catch(e){return!1}};function tF(e,t,n){0!==e.length&&R(e,e=>{e.call(i,t,n,tv)})}let tU=function(e,t){if(!eq[t]&&tW(t)&&(eG.tagNameCheck instanceof RegExp&&X(eG.tagNameCheck,t)||eG.tagNameCheck instanceof Function&&eG.tagNameCheck(t)))return!1;if(e8&&!tt[t]){let t=k(e),n=y(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=e7?n[i]:m(n[i],!0);t.insertBefore(r,b(e))}}}return tI(e),!0},tG=function(e){if(tF(e$.beforeSanitizeElements,e,null),tM(e))return tI(e),!0;let t=tw(O?O(e):e.nodeName);if(tF(e$.uponSanitizeElement,e,{tagName:t,allowedTags:eL}),eK&&e.hasChildNodes()&&!tB(e.firstElementChild)&&X(eS,e.textContent)&&X(eS,e.innerHTML)||eK&&e.namespaceURI===tc&&"style"===t&&tB(e.firstElementChild)||7===e.nodeType||eK&&8===e.nodeType&&X(eO,e.data)||0)return tI(e),!0;if(eq[t]||!(eW.tagCheck instanceof Function&&eW.tagCheck(t))&&!eL[t])return tU(e,t);if((S?S(e):e.nodeType)===1&&!tA(e)||("noscript"===t||"noembed"===t||"noframes"===t)&&X(eT,e.innerHTML))return tI(e),!0;if(eV&&3===e.nodeType){let t=tz(e.textContent);e.textContent!==t&&(D(i.removed,{element:e.cloneNode()}),e.textContent=t)}return tF(e$.afterSanitizeElements,e,null),!1},tq=function(e,t,n){if(eH[t]||e6&&("id"===t||"name"===t)&&(n in o||n in tS))return!1;let r=eF[t]||eW.attributeCheck instanceof Function&&eW.attributeCheck(t,e);if(eY&&X(eg,t));else if(eZ&&X(eb,t));else if(r){if(to[t]);else if(X(eM,F(n,ex,"")));else if(("src"===t||"xlink:href"===t||"href"===t)&&"script"!==e&&0===U(n,"data:")&&tr[e]);else if(eQ&&!X(ek,F(n,ex,"")));else if(n)return!1}else if(!(tW(e)&&(eG.tagNameCheck instanceof RegExp&&X(eG.tagNameCheck,e)||eG.tagNameCheck instanceof Function&&eG.tagNameCheck(e))&&(eG.attributeNameCheck instanceof RegExp&&X(eG.attributeNameCheck,t)||eG.attributeNameCheck instanceof Function&&eG.attributeNameCheck(t,e))||"is"===t&&eG.allowCustomizedBuiltInElements&&(eG.tagNameCheck instanceof RegExp&&X(eG.tagNameCheck,n)||eG.tagNameCheck instanceof Function&&eG.tagNameCheck(n))))return!1;return!0},tH=J({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),tW=function(e){return!tH[M(e)]&&X(ev,e)},tZ=function(e,n,r,i){if(t&&"object"==typeof d&&"function"==typeof d.getAttributeType&&!r)switch(d.getAttributeType(e,n)){case"TrustedHTML":return K(i);case"TrustedScriptURL":return eC(i)}return i},tY=function(e,t,n,r){try{n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),tM(e)?tI(e):j(i.removed)}catch(n){tP(t,e)}},tQ=function(e){tF(e$.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||tM(e))return;let n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:eF,forceKeepAttr:void 0},r=t.length,i=tw(e.nodeName);for(;r--;){let o=t[r],l=o.name,a=o.namespaceURI,s=o.value,c=tw(l),u="value"===l?s:G(s);if(n.attrName=c,n.attrValue=u,n.keepAttr=!0,n.forceKeepAttr=void 0,tF(e$.uponSanitizeAttribute,e,n),u=n.attrValue,e9&&("id"===c||"name"===c)&&0!==U(u,e5)&&(tP(l,e),u=e5+u),eK&&X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)||"attributename"===c&&B(u,"href")){tP(l,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr||!eX&&X(eE,u)||(eV&&(u=tz(u)),!tq(i,c,u))){tP(l,e);continue}(u=tZ(i,c,a,u))!==s&&tY(e,l,a,u)}}tF(e$.afterSanitizeAttributes,e,null)},tX=function(e){let t=null,n=tD(e);for(tF(e$.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(tF(e$.uponSanitizeShadowNode,t,null),tG(t),tQ(t),tL(t.content)&&tX(t.content),(S?S(t):t.nodeType)===1){let e=x(t);tL(e)&&(tV(e),tX(e))}tF(e$.afterSanitizeShadowDOM,e,null)},tV=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){tX(e.shadow);continue}let n=e.node,r=(S?S(n):n.nodeType)===1,i=y(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=O?O(n):null;if("string"==typeof e&&"template"===tw(e)){let e=n.content;tL(e)&&t.push({node:e,shadow:null})}}if(r){let e=x(n);tL(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return i.sanitize=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,a=null,s=null;if((tp=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!tB(e)&&"string"!=typeof(e=function(e){switch(typeof e){case"string":return e;case"number":return q(e);case"boolean":return H(e);case"bigint":return W?W(e):"0";case"symbol":return Z?Z(e):"Symbol()";case"undefined":default:return Q(e);case"function":case"object":{if(null===e)return Q(e);let t=et(e,"toString");if("function"==typeof t){let n=t(e);return"string"==typeof n?n:Q(n)}return Q(e)}}}(e)))throw V("dirty is not a string, aborting");if(!i.isSupported)return e;e0||tT(n),i.removed=[];let c=e7&&"string"!=typeof e&&tB(e);if(c){let t=O?O(e):e.nodeName;if("string"==typeof t){let e=tw(t);if(!eL[e]||eq[e])throw V("root node is forbidden and cannot be sanitized in-place")}if(tM(e))throw V("root node is clobbered and cannot be sanitized in-place");try{tV(e)}catch(t){throw tC(e),t}}else if(tB(e))1===(o=(r=tj("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o),tV(o);else{if(!e2&&!eV&&!eJ&&-1===e.indexOf("<"))return t&&e4?K(e):e;if(!(r=tj(e)))return e2?null:e4?T:""}r&&e1&&tI(r.firstChild);let u=tD(c?e:r);try{for(;a=u.nextNode();)tG(a),tQ(a),tL(a.content)&&tX(a.content)}catch(t){throw c&&tC(e),t}if(c)return R(i.removed,e=>{e.element&&tN(e.element)}),eV&&t$(e),e;if(e2){if(eV&&t$(r),e3)for(s=ej.call(r.ownerDocument);r.firstChild;)s.appendChild(r.firstChild);else s=r;return(eF.shadowroot||eF.shadowrootmode)&&(s=ez.call(l,s,!0)),s}let p=eJ?r.outerHTML:r.innerHTML;return eJ&&eL["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&X(ew,r.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+p),eV&&(p=tz(p)),t&&e4?K(p):p},i.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tT(e),e0=!0},i.clearConfig=function(){tv=null,e0=!1,t=n,T=""},i.isValidAttribute=function(e,t,n){return tv||tT({}),tq(tw(e),tw(t),n)},i.addHook=function(e,t){"function"==typeof t&&D(e$[e],t)},i.removeHook=function(e,t){if(void 0!==t){let n=N(e$[e],t);return -1===n?void 0:z(e$[e],n,1)[0]}return j(e$[e])},i.removeHooks=function(e){e$[e]=[]},i.removeAllHooks=function(){e$=eA()},i}();function eP(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let eR=eP(),eN=/[&<>"']/,ej=RegExp(eN.source,"g"),eD=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ez=RegExp(eD.source,"g"),e$={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},eM=e=>e$[e];function eL(e,t){if(t){if(eN.test(e))return e.replace(ej,eM)}else if(eD.test(e))return e.replace(ez,eM);return e}let eB=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,eF=/(^|[^\[])\^/g;function eU(e,t){let n="string"==typeof e?e:e.source;t=t||"";let r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(eF,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function eG(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}let eq={exec:()=>null};function eH(e,t){let n=e.replace(/\|/g,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"}).split(/ \|/),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 eW(e,t,n){let r=e.length;if(0===r)return"";let i=0;for(;i<r;){let o=e.charAt(r-i-1);if(o!==t||n)if(o!==t&&n)i++;else break;else i++}return e.slice(0,r-i)}function eZ(e,t,n,r){let i=t.href,o=t.title?eL(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;let e={type:"link",raw:n,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:i,title:o,text:eL(l)}}class eY{options;rules;lexer;constructor(e){this.options=e||eR}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:eW(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t){let n=e.match(/^(\s+)(?:```)/);if(null===n)return t;let r=n[1];return t.split("\n").map(e=>{let t=e.match(/^\s+/);if(null===t)return e;let[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.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){let t=eW(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){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");e=eW(e.replace(/^ *>[ \t]?/gm,""),"\n");let n=this.lexer.state.top;this.lexer.state.top=!0;let 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(),r=n.length>1,i={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:"[*+-]");let o=RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),l="",a="",s=!1;for(;e;){let n,r=!1;if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;l=t[0],e=e.substring(l.length);let c=t[2].split("\n",1)[0].replace(/^\t+/,e=>" ".repeat(3*e.length)),u=e.split("\n",1)[0],p=0;this.options.pedantic?(p=2,a=c.trimStart()):(p=(p=t[2].search(/[^ ]/))>4?1:p,a=c.slice(p),p+=t[1].length);let f=!1;if(!c&&/^ *$/.test(u)&&(l+=u+"\n",e=e.substring(u.length+1),r=!0),!r){let t=RegExp(`^ {0,${Math.min(3,p-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),n=RegExp(`^ {0,${Math.min(3,p-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),r=RegExp(`^ {0,${Math.min(3,p-1)}}(?:\`\`\`|~~~)`),i=RegExp(`^ {0,${Math.min(3,p-1)}}#`);for(;e;){let o=e.split("\n",1)[0];if(u=o,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),r.test(u)||i.test(u)||t.test(u)||n.test(e))break;if(u.search(/[^ ]/)>=p||!u.trim())a+="\n"+u.slice(p);else{if(f||c.search(/[^ ]/)>=4||r.test(c)||i.test(c)||n.test(c))break;a+="\n"+u}f||u.trim()||(f=!0),l+=o+"\n",e=e.substring(o.length+1),c=u.slice(p)}}!i.loose&&(s?i.loose=!0:/\n *\n *$/.test(l)&&(s=!0));let d=null;this.options.gfm&&(d=/^\[[ xX]\] /.exec(a))&&(n="[ ] "!==d[0],a=a.replace(/^\[[ xX]\] +/,"")),i.items.push({type:"list_item",raw:l,task:!!d,checked:n,loose:!1,text:a,tokens:[]}),i.raw+=l}i.items[i.items.length-1].raw=l.trimEnd(),i.items[i.items.length-1].text=a.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>"space"===e.type);i.loose=t.length>0&&t.some(e=>/\n.*\n/.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let 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){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let n=eH(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)/^ *-+: *$/.test(e)?o.align.push("right"):/^ *:-+: *$/.test(e)?o.align.push("center"):/^ *:-+ *$/.test(e)?o.align.push("left"):o.align.push(null);for(let e of n)o.header.push({text:e,tokens:this.lexer.inline(e)});for(let e of i)o.rows.push(eH(e,o.header.length).map(e=>({text:e,tokens:this.lexer.inline(e)})));return o}}lheading(e){let 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){let t=this.rules.block.paragraph.exec(e);if(t){let 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){let 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){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:eL(t[1])}}tag(e){let 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){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;let t=eW(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e){if(-1===e.indexOf(")"))return -1;let t=0;for(let n=0;n<e.length;n++)if("\\"===e[n])n++;else if("("===e[n])t++;else if(")"===e[n]&&--t<0)return n;return -1}(t[2]);if(e>-1){let 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){let 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)),eZ(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$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=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return eZ(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(/[\p{L}\p{N}]/u))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,o,l=n,a=0,s="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(s.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=s.exec(t));){if(!(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6]))continue;if(o=[...i].length,r[3]||r[4]){l+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){a+=o;continue}if((l-=o)>0)continue;o=Math.min(o,o+l+a);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+o);if(Math.min(n,o)%2){let e=s.slice(1,-1);return{type:"em",raw:s,text:e,tokens:this.lexer.inlineTokens(e)}}let c=s.slice(2,-2);return{type:"strong",raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," "),n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=eL(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let 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){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return n="@"===t[2]?"mailto:"+(e=eL(t[1])):e=eL(t[1]),{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])n="mailto:"+(e=eL(t[0]));else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(r!==t[0]);e=eL(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){let t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:eL(t[0]),{type:"text",raw:t[0],text:e}}}}let eQ=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,eX=/(?:[*+-]|\d{1,9}[.)])/,eV=eU(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,eX).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),eK=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,eJ=/(?!\s*\])(?:\\.|[^\[\]\\])+/,e0=eU(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",eJ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),e1=eU(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,eX).getRegex(),e2="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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",e3=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,e4=eU("^ {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|$))","i").replace("comment",e3).replace("tag",e2).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),e6=eU(eK).replace("hr",eQ).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",e2).getRegex(),e9={blockquote:eU(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",e6).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:e0,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:eQ,html:e4,lheading:eV,list:e1,newline:/^(?: *(?:\n|$))+/,paragraph:e6,table:eq,text:/^[^\n]+/},e5=eU("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",eQ).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",e2).getRegex(),e8={...e9,table:e5,paragraph:eU(eK).replace("hr",eQ).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",e5).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",e2).getRegex()},e7={...e9,html:eU("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",e3).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:eq,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:eU(eK).replace("hr",eQ).replace("heading"," *#{1,6} *[^\n]").replace("lheading",eV).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},te=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,tt=/^( {2,}|\\)\n(?!\s*$)/,tn="\\p{P}\\p{S}",tr=eU(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,tn).getRegex(),ti=eU(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,tn).getRegex(),to=eU("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,tn).getRegex(),tl=eU("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,tn).getRegex(),ta=eU(/\\([punct])/,"gu").replace(/punct/g,tn).getRegex(),ts=eU(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("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])?)+(?![-_])/).getRegex(),tc=eU(e3).replace("(?:--\x3e|$)","--\x3e").getRegex(),tu=eU("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",tc).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),tp=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,tf=eU(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",tp).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),td=eU(/^!?\[(label)\]\[(ref)\]/).replace("label",tp).replace("ref",eJ).getRegex(),th=eU(/^!?\[(ref)\](?:\[\])?/).replace("ref",eJ).getRegex(),tm=eU("reflink|nolink(?!\\()","g").replace("reflink",td).replace("nolink",th).getRegex(),tg={_backpedal:eq,anyPunctuation:ta,autolink:ts,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:tt,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:eq,emStrongLDelim:ti,emStrongRDelimAst:to,emStrongRDelimUnd:tl,escape:te,link:tf,nolink:th,punctuation:tr,reflink:td,reflinkSearch:tm,tag:tu,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:eq},tb={...tg,link:eU(/^!?\[(label)\]\((.*?)\)/).replace("label",tp).getRegex(),reflink:eU(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",tp).getRegex()},ty={...tg,escape:eU(te).replace("])","~|])").getRegex(),url:eU(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_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.!#$%&'*+\/=?_`{\|}~-]+@)))/},tk={...ty,br:eU(tt).replace("{2,}","*").getRegex(),text:eU(ty.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},tx={normal:e9,gfm:e8,pedantic:e7},tw={normal:tg,gfm:ty,breaks:tk,pedantic:tb};class tv{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||eR,this.options.tokenizer=this.options.tokenizer||new eY,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:tx.normal,inline:tw.normal};this.options.pedantic?(t.block=tx.pedantic,t.inline=tw.pedantic):this.options.gfm&&(t.block=tx.gfm,this.options.breaks?t.inline=tw.breaks:t.inline=tw.gfm),this.tokenizer.rules=t}static get rules(){return{block:tx,inline:tw}}static lex(e,t){return new tv(t).lex(e)}static lexInline(e,t){return new tv(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){let n,r,i,o;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);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),(r=t[t.length-1])&&("paragraph"===r.type||"text"===r.type)?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);continue}if((n=this.tokenizer.fences(e))||(n=this.tokenizer.heading(e))||(n=this.tokenizer.hr(e))||(n=this.tokenizer.blockquote(e))||(n=this.tokenizer.list(e))||(n=this.tokenizer.html(e))){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length),(r=t[t.length-1])&&("paragraph"===r.type||"text"===r.type)?(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if((n=this.tokenizer.table(e))||(n=this.tokenizer.lheading(e))){e=e.substring(n.raw.length),t.push(n);continue}if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach(e=>{"number"==typeof(t=e.call({lexer:this},r))&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i))){r=t[t.length-1],o&&"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),o=i.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),(r=t[t.length-1])&&"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);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw 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,i,o,l,a,s=e;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(s));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(s));)s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(s));)s=s.slice(0,o.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(a=""),l=!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);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),(r=t[t.length-1])&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),(r=t[t.length-1])&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if((n=this.tokenizer.emStrong(e,s,a))||(n=this.tokenizer.codespan(e))||(n=this.tokenizer.br(e))||(n=this.tokenizer.del(e))||(n=this.tokenizer.autolink(e))||!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach(e=>{"number"==typeof(t=e.call({lexer:this},r))&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(n=this.tokenizer.inlineText(i)){e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),l=!0,(r=t[t.length-1])&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}}class tS{options;constructor(e){this.options=e||eR}code(e,t,n){let r=(t||"").match(/^\S*/)?.[0];return(e=e.replace(/\n$/,"")+"\n",r)?'<pre><code class="language-'+eL(r)+'">'+(n?e:eL(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:eL(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>
11
11
  ${e}</blockquote>
12
12
  `}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>
13
13
  `}hr(){return"<hr>\n"}list(e,t,n){let r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return`<li>${e}</li>
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons")):"function"==typeof define&&define.amd?define("plugin-build-guide-block/client-v2",["react-i18next","@nocobase/client-v2","react","antd","@ant-design/icons"],t):"object"==typeof exports?exports["plugin-build-guide-block/client-v2"]=t(require("react-i18next"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons")):e["plugin-build-guide-block/client-v2"]=t(e["react-i18next"],e["@nocobase/client-v2"],e.react,e.antd,e["@ant-design/icons"])}(self,function(e,t,n,r,o){return function(){"use strict";var i,u,c,a={375:function(e){e.exports=o},485:function(e){e.exports=t},59:function(e){e.exports=r},155:function(e){e.exports=n},953:function(t){t.exports=e}},l={};function f(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return a[e](n,n.exports,f),n.exports}f.m=a,f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,{a:t}),t},f.d=function(e,t){for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.f={},f.e=function(e){return Promise.all(Object.keys(f.f).reduce(function(t,n){return f.f[n](e,t),t},[]))},f.u=function(e){return""+e+".bea427a4cf8864b4.js"},f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p={},f.l=function(e,t,n,r){if(p[e])return void p[e].push(t);if(void 0!==n)for(var o,i,u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var a=u[c];if(a.getAttribute("src")==e||a.getAttribute("data-rspack")=="plugin-build-guide-block/client-v2:"+n){o=a;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,f.nc&&o.setAttribute("nonce",f.nc),o.setAttribute("data-rspack","plugin-build-guide-block/client-v2:"+n),o.src=e),p[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=p[e];if(delete p[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},f.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.g.importScripts&&(s=f.g.location+"");var p,s,d=f.g.document;if(!s&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(s=d.currentScript.src),!s)){var b=d.getElementsByTagName("script");if(b.length)for(var v=b.length-1;v>-1&&(!s||!/^http(s?):/.test(s));)s=b[v--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");f.p=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i={889:0},f.f.j=function(e,t){var n=f.o(i,e)?i[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=f.p+f.u(e),u=Error();f.l(o,function(t){if(f.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",u.name="ChunkLoadError",u.type=r,u.request=o,n[1](u)}},"chunk-"+e,e)}},u=function(e,t){var n,r,o=t[0],u=t[1],c=t[2],a=0;if(o.some(function(e){return 0!==i[e]})){for(n in u)f.o(u,n)&&(f.m[n]=u[n]);c&&c(f)}for(e&&e(t);a<o.length;a++)r=o[a],f.o(i,r)&&i[r]&&i[r][0](),i[r]=0},(c=self.webpackChunkplugin_build_guide_block_client_v2=self.webpackChunkplugin_build_guide_block_client_v2||[]).forEach(u.bind(null,0)),c.push=u.bind(null,c.push.bind(c));var g={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/plugin-build-guide-block/dist/client-v2/")}if(!e){var r=window.__nocobase_modern_client_prefix__||"v",o="/"+(r=String(r).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var i=window.location.pathname||"/",u=i.indexOf(o);e=u>=0?i.slice(0,u+1):"/"}e&&(e=e.replace(RegExp("/"+r+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/plugin-build-guide-block/dist/client-v2/"}f.p=e}(),!function(){f.r(g),f.d(g,{default:function(){return c}});var e=f(485);function t(e,t,n,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){n(e);return}c.done?t(a):Promise.resolve(a).then(r,o)}function n(e,t,r){return(n=u()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&o(i,n.prototype),i}).apply(null,arguments)}f(155);function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e){var t="function"==typeof Map?new Map:void 0;return(i=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return n(e,arguments,r(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(i,e)})(e)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}var c=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,t;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return e=i,t=arguments,e=r(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,u()?Reflect.construct(e,t||[],r(this).constructor):e.apply(this,t))}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&o(i,e),n=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(u,"next",{value:a(0)}),c(u,"throw",{value:a(1)}),c(u,"return",{value:a(2)}),"function"==typeof Symbol&&c(u,Symbol.iterator,{value:function(){return this}}),u;function a(c){return function(a){var l=[c,a];if(n)throw TypeError("Generator is already executing.");for(;u&&(u=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return this.pluginSettingsManager.addMenuItem({key:"ai-build-guide",title:this.t("Build Guide Block"),icon:"ReadOutlined",aclSnippet:"pm.ai-build-guide"}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai-build-guide",key:"index",title:this.t("Build Guide Block"),componentLoader:function(){return f.e("376").then(f.bind(f,571)).then(function(e){return{default:e.UserGuideManager}})}}),[2]})},function(){var n=this,r=arguments;return new Promise(function(o,i){var u=e.apply(n,r);function c(e){t(u,o,i,c,a,"next",e)}function a(e){t(u,o,i,c,a,"throw",e)}c(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(i.prototype,n),i}(i(e.Plugin))}(),g}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons")):"function"==typeof define&&define.amd?define("plugin-build-guide-block/client-v2",["react-i18next","@nocobase/client-v2","react","antd","@ant-design/icons"],t):"object"==typeof exports?exports["plugin-build-guide-block/client-v2"]=t(require("react-i18next"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons")):e["plugin-build-guide-block/client-v2"]=t(e["react-i18next"],e["@nocobase/client-v2"],e.react,e.antd,e["@ant-design/icons"])}(self,function(e,t,n,r,o){return function(){"use strict";var i,u,c,a={375:function(e){e.exports=o},485:function(e){e.exports=t},59:function(e){e.exports=r},155:function(e){e.exports=n},953:function(t){t.exports=e}},l={};function f(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return a[e](n,n.exports,f),n.exports}f.m=a,f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,{a:t}),t},f.d=function(e,t){for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.f={},f.e=function(e){return Promise.all(Object.keys(f.f).reduce(function(t,n){return f.f[n](e,t),t},[]))},f.u=function(e){return""+e+".bea427a4cf8864b4.js"},f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p={},f.l=function(e,t,n,r){if(p[e])return void p[e].push(t);if(void 0!==n)for(var o,i,u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var a=u[c];if(a.getAttribute("src")==e||a.getAttribute("data-rspack")=="plugin-build-guide-block/client-v2:"+n){o=a;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,f.nc&&o.setAttribute("nonce",f.nc),o.setAttribute("data-rspack","plugin-build-guide-block/client-v2:"+n),o.src=e),p[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=p[e];if(delete p[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},f.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.g.importScripts&&(s=f.g.location+"");var p,s,d=f.g.document;if(!s&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(s=d.currentScript.src),!s)){var b=d.getElementsByTagName("script");if(b.length)for(var v=b.length-1;v>-1&&(!s||!/^http(s?):/.test(s));)s=b[v--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");f.p=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i={889:0},f.f.j=function(e,t){var n=f.o(i,e)?i[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=f.p+f.u(e),u=Error();f.l(o,function(t){if(f.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",u.name="ChunkLoadError",u.type=r,u.request=o,n[1](u)}},"chunk-"+e,e)}},u=function(e,t){var n,r,o=t[0],u=t[1],c=t[2],a=0;if(o.some(function(e){return 0!==i[e]})){for(n in u)f.o(u,n)&&(f.m[n]=u[n]);c&&c(f)}for(e&&e(t);a<o.length;a++)r=o[a],f.o(i,r)&&i[r]&&i[r][0](),i[r]=0},(c=self.webpackChunkplugin_build_guide_block_client_v2=self.webpackChunkplugin_build_guide_block_client_v2||[]).forEach(u.bind(null,0)),c.push=u.bind(null,c.push.bind(c));var g={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/plugin-build-guide-block/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/plugin-build-guide-block/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var u=window.location.pathname||"/",c=u.indexOf(i);e=c>=0?u.slice(0,c+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/plugin-build-guide-block/dist/client-v2/"}f.p=e}(),!function(){f.r(g),f.d(g,{default:function(){return c}});var e=f(485);function t(e,t,n,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){n(e);return}c.done?t(a):Promise.resolve(a).then(r,o)}function n(e,t,r){return(n=u()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&o(i,n.prototype),i}).apply(null,arguments)}f(155);function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e){var t="function"==typeof Map?new Map:void 0;return(i=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return n(e,arguments,r(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(i,e)})(e)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}var c=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,t;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return e=i,t=arguments,e=r(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,u()?Reflect.construct(e,t||[],r(this).constructor):e.apply(this,t))}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&o(i,e),n=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(u,"next",{value:a(0)}),c(u,"throw",{value:a(1)}),c(u,"return",{value:a(2)}),"function"==typeof Symbol&&c(u,Symbol.iterator,{value:function(){return this}}),u;function a(c){return function(a){var l=[c,a];if(n)throw TypeError("Generator is already executing.");for(;u&&(u=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return this.pluginSettingsManager.addMenuItem({key:"ai-build-guide",title:this.t("Build Guide Block"),icon:"ReadOutlined",aclSnippet:"pm.ai-build-guide"}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai-build-guide",key:"index",title:this.t("Build Guide Block"),componentLoader:function(){return f.e("376").then(f.bind(f,571)).then(function(e){return{default:e.UserGuideManager}})}}),[2]})},function(){var n=this,r=arguments;return new Promise(function(o,i){var u=e.apply(n,r);function c(e){t(u,o,i,c,a,"next",e)}function a(e){t(u,o,i,c,a,"throw",e)}c(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(i.prototype,n),i}(i(e.Plugin))}(),g}()});
@@ -8,20 +8,20 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.6",
11
+ "@nocobase/client": "2.1.9",
12
12
  "react": "18.2.0",
13
13
  "@formily/react": "2.3.7",
14
14
  "antd": "5.24.2",
15
15
  "react-i18next": "11.18.6",
16
16
  "@ant-design/icons": "5.6.1",
17
- "@nocobase/client-v2": "2.1.6",
18
- "@nocobase/server": "2.1.6",
17
+ "@nocobase/client-v2": "2.1.9",
18
+ "@nocobase/server": "2.1.9",
19
19
  "@formily/core": "2.3.7",
20
- "@nocobase/flow-engine": "2.1.6",
21
- "@nocobase/actions": "2.1.6",
22
- "@nocobase/database": "2.1.6",
23
- "@nocobase/plugin-ai": "2.1.6",
24
- "@nocobase/plugin-file-manager": "2.1.6",
20
+ "@nocobase/flow-engine": "2.1.9",
21
+ "@nocobase/actions": "2.1.9",
22
+ "@nocobase/database": "2.1.9",
23
+ "@nocobase/plugin-ai": "2.1.9",
24
+ "@nocobase/plugin-file-manager": "2.1.9",
25
25
  "@langchain/core": "1.1.48",
26
26
  "axios": "1.7.7"
27
27
  };
@@ -56,6 +56,7 @@ const MAX_CHAPTERS = 12;
56
56
  const DEFAULT_TARGET_CHAPTERS = 5;
57
57
  const WORKER_JOB_BUILD_GUIDE_PROCESS = "build-guide:process";
58
58
  const BUILD_GUIDE_QUEUE_CHANNEL = "plugin-build-guide-block.build";
59
+ const BUILD_GUIDE_WORKER_ALIASES = [BUILD_GUIDE_QUEUE_CHANNEL, "plugin-build-guide-block:build:queue"];
59
60
  const BUILD_GUIDE_QUEUE_CONCURRENCY = Math.max(
60
61
  1,
61
62
  Number.parseInt(process.env.BUILD_GUIDE_QUEUE_CONCURRENCY || process.env.BUILD_GUIDE_MAX_CONCURRENCY || "1", 10) || 1
@@ -677,8 +678,17 @@ async function runBuild(app, db, run) {
677
678
  });
678
679
  }
679
680
  function isBuildGuideWorker(app) {
681
+ return app.serving(WORKER_JOB_BUILD_GUIDE_PROCESS) || workerModeServesBuildGuide();
682
+ }
683
+ function workerModeServesBuildGuide() {
680
684
  const workerMode = process.env.WORKER_MODE || "";
681
- return app.serving(WORKER_JOB_BUILD_GUIDE_PROCESS) || workerMode === "worker" || workerMode === "task" || process.env.APP_ROLE === "worker";
685
+ const workerModes = workerMode.split(",").map((mode) => mode.trim()).filter(Boolean);
686
+ return workerModes.some((mode) => {
687
+ if (mode === "*" || mode === "worker" || mode === "task" || mode === WORKER_JOB_BUILD_GUIDE_PROCESS) {
688
+ return true;
689
+ }
690
+ return BUILD_GUIDE_WORKER_ALIASES.some((alias) => mode === alias || mode.endsWith(`:${alias}`));
691
+ });
682
692
  }
683
693
  function clearLocalBuildMemoryQueue(app) {
684
694
  var _a, _b, _c, _d, _e;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "displayName.zh-CN": "构建指南区块",
6
6
  "description": "Generate user guides, tutorials and help books from documents using AI, then render the result as a block (HTML or Markdown).",
7
7
  "description.vi-VN": "Tạo hướng dẫn người dùng, tutorial và help book từ tài liệu bằng AI, hiển thị kết quả dưới dạng block (HTML hoặc Markdown).",
8
- "version": "1.1.9",
8
+ "version": "1.1.11",
9
9
  "license": "Apache-2.0",
10
10
  "keywords": [
11
11
  "ai",
@@ -20,6 +20,7 @@ const DEFAULT_TARGET_CHAPTERS = 5;
20
20
  export const WORKER_JOB_BUILD_GUIDE_PROCESS = 'build-guide:process';
21
21
 
22
22
  const BUILD_GUIDE_QUEUE_CHANNEL = 'plugin-build-guide-block.build';
23
+ const BUILD_GUIDE_WORKER_ALIASES = [BUILD_GUIDE_QUEUE_CHANNEL, 'plugin-build-guide-block:build:queue'];
23
24
  const BUILD_GUIDE_QUEUE_CONCURRENCY = Math.max(
24
25
  1,
25
26
  Number.parseInt(process.env.BUILD_GUIDE_QUEUE_CONCURRENCY || process.env.BUILD_GUIDE_MAX_CONCURRENCY || '1', 10) || 1,
@@ -737,13 +738,22 @@ async function runBuild(app: any, db: any, run: BuildRunContext) {
737
738
  }
738
739
 
739
740
  function isBuildGuideWorker(app: Application) {
741
+ return app.serving(WORKER_JOB_BUILD_GUIDE_PROCESS) || workerModeServesBuildGuide();
742
+ }
743
+
744
+ function workerModeServesBuildGuide() {
740
745
  const workerMode = process.env.WORKER_MODE || '';
741
- return (
742
- app.serving(WORKER_JOB_BUILD_GUIDE_PROCESS) ||
743
- workerMode === 'worker' ||
744
- workerMode === 'task' ||
745
- process.env.APP_ROLE === 'worker'
746
- );
746
+ const workerModes = workerMode
747
+ .split(',')
748
+ .map((mode) => mode.trim())
749
+ .filter(Boolean);
750
+
751
+ return workerModes.some((mode) => {
752
+ if (mode === '*' || mode === 'worker' || mode === 'task' || mode === WORKER_JOB_BUILD_GUIDE_PROCESS) {
753
+ return true;
754
+ }
755
+ return BUILD_GUIDE_WORKER_ALIASES.some((alias) => mode === alias || mode.endsWith(`:${alias}`));
756
+ });
747
757
  }
748
758
 
749
759
  function clearLocalBuildMemoryQueue(app: Application) {