@wsxjs/wsx-marked-components 0.0.18 → 0.0.20
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.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1023 -1250
- package/package.json +5 -5
- package/src/Blockquote.css +0 -1
- package/src/Code.css +0 -1
- package/src/Code.wsx +0 -1
- package/src/Error.wsx +0 -1
- package/src/Heading.css +0 -1
- package/src/List.wsx +1 -24
- package/src/Markdown.css +0 -1
- package/src/Markdown.wsx +2 -33
- package/src/Paragraph.wsx +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("@wsxjs/wsx-core"),pe=require("marked"),be="wsx-marked-heading{display:block}wsx-marked-heading h1{font-size:2.5rem;font-weight:700;margin:1.5rem 0 1rem;color:var(--text-primary, #2c3e50);border-bottom:2px solid var(--primary-red, #dc2626);padding-bottom:.5rem}wsx-marked-heading h2{font-size:2rem;font-weight:600;margin:1.25rem 0 .75rem;color:var(--text-primary, #2c3e50)}wsx-marked-heading h3{font-size:1.5rem;font-weight:600;margin:1rem 0 .5rem;color:var(--text-primary, #2c3e50)}wsx-marked-heading h4,wsx-marked-heading h5,wsx-marked-heading h6{font-size:1.25rem;font-weight:600;margin:.75rem 0 .5rem;color:var(--text-primary, #2c3e50)}";var Ce;let Ae,Re;function oe(e,t,r){return(t=De(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lt(e,t,r,c,v,M){function j(n,o,l){return function(a,s){return l&&l(a),n[o].call(a,s)}}function S(n,o){for(var l=0;l<n.length;l++)n[l].call(o);return o}function y(n,o,l,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(o+" must "+(l||"be")+" a function"+(a?"":" or undefined"));return n}function m(n,o,l,a,s,R,D,$,q,k,b,h,g){function x(u){if(!g(u))throw new TypeError("Attempted to access private element on non-instance")}var f,w=o[0],_=o[3],A=!$;if(!A){l||Array.isArray(w)||(w=[w]);var i={},T=[],p=s===3?"get":s===4||h?"set":"value";k?(b||h?i={get:ye(function(){return _(this)},a,"get"),set:function(u){o[4](this,u)}}:i[p]=_,b||ye(i[p],a,s===2?"":p)):b||(i=Object.getOwnPropertyDescriptor(n,a))}for(var d=n,P=w.length-1;P>=0;P-=l?2:1){var K=w[P],W=l?w[P-1]:void 0,J={},N={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:R,addInitializer:(function(u,O){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");y(O,"An initializer","be",!0),D.push(O)}).bind(null,J)};try{if(A)(f=y(K.call(W,d,N),"class decorators","return"))&&(d=f);else{var H,V;N.static=q,N.private=k,k?s===2?H=function(u){return x(u),i.value}:(s<4&&(H=j(i,"get",x)),s!==3&&(V=j(i,"set",x))):(H=function(u){return u[a]},(s<2||s===4)&&(V=function(u,O){u[a]=O}));var G=N.access={has:k?g.bind():function(u){return a in u}};if(H&&(G.get=H),V&&(G.set=V),d=K.call(W,h?{get:i.get,set:i.set}:i[p],N),h){if(typeof d=="object"&&d)(f=y(d.get,"accessor.get"))&&(i.get=f),(f=y(d.set,"accessor.set"))&&(i.set=f),(f=y(d.init,"accessor.init"))&&T.push(f);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(d,(b?"field":"method")+" decorators","return")&&(b?T.push(d):i[p]=d)}}finally{J.v=!0}}return(b||h)&&$.push(function(u,O){for(var B=T.length-1;B>=0;B--)O=T[B].call(u,O);return O}),b||A||(k?h?$.push(j(i,"get"),j(i,"set")):$.push(s===2?i[p]:j.call.bind(i[p])):Object.defineProperty(n,a,i)),d}function E(n,o){return Object.defineProperty(n,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:o})}if(arguments.length>=6)var L=M[Symbol.metadata||Symbol.for("Symbol.metadata")];var I=Object.create(L??null),C=function(n,o,l,a){var s,R,D=[],$=function(p){return ft(p)===n},q=new Map;function k(p){p&&D.push(S.bind(null,p))}for(var b=0;b<o.length;b++){var h=o[b];if(Array.isArray(h)){var g=h[1],x=h[2],f=h.length>3,w=16&g,_=!!(8&g),A=(g&=7)==0,i=x+"/"+_;if(!A&&!f){var T=q.get(i);if(T===!0||T===3&&g!==4||T===4&&g!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+x);q.set(i,!(g>2)||g)}m(_?n:n.prototype,h,w,f?"#"+x:De(x),g,a,_?R=R||[]:s=s||[],D,_,f,A,g===1,_&&f?$:l)}}return k(s),k(R),D}(e,t,v,I);return r.length||E(e,I),{e:C,get c(){var n=[];return r.length&&[E(m(e,[r],c,e.name,5,I,n),I),S.bind(null,n,e)]}}}function De(e){var t=ut(e,"string");return typeof t=="symbol"?t:t+""}function ut(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var c=r.call(e,t);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ye(e,t,r){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:r?r+" "+t:t})}catch{}return e}function ft(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}Re=[z.autoRegister({tagName:"wsx-marked-heading"})];exports.Heading=void 0;class dt extends z.LightComponent{constructor(){super({styles:be,styleName:"wsx-marked-heading"}),oe(this,"_autoStyles",be),oe(this,"level",1),oe(this,"text","")}static get observedAttributes(){return["level","text"]}attributeChangedCallback(t,r,c){t==="level"?this.level=parseInt(c,10)||1:t==="text"&&(this.text=c),this.rerender()}render(){return this.level===1?z.jsx("h1",null,this.text):this.level===2?z.jsx("h2",null,this.text):this.level===3?z.jsx("h3",null,this.text):this.level===4?z.jsx("h4",null,this.text):this.level===5?z.jsx("h5",null,this.text):z.jsx("h6",null,this.text)}}Ce=dt;[exports.Heading,Ae]=lt(Ce,[],Re,0,void 0,z.LightComponent).c;Ae();const ve="wsx-marked-code{display:block;margin:1rem 0}wsx-marked-code pre{background:var(--bg-secondary, #f5f5f5);border:1px solid var(--border-color, #e0e0e0);border-radius:8px;padding:1rem;overflow-x:auto;font-family:Courier New,monospace;font-size:.9rem;line-height:1.5}wsx-marked-code code{background:transparent;padding:0;border:none;font-family:inherit}wsx-marked-code .language-label{display:inline-block;background:var(--primary-red, #dc2626);color:#fff;padding:.25rem .5rem;font-size:.75rem;border-radius:4px 4px 0 0;margin-bottom:-1px}";var Me;let Ie,Ne;function ae(e,t,r){return(t=He(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mt(e,t,r,c,v,M){function j(n,o,l){return function(a,s){return l&&l(a),n[o].call(a,s)}}function S(n,o){for(var l=0;l<n.length;l++)n[l].call(o);return o}function y(n,o,l,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(o+" must "+(l||"be")+" a function"+(a?"":" or undefined"));return n}function m(n,o,l,a,s,R,D,$,q,k,b,h,g){function x(u){if(!g(u))throw new TypeError("Attempted to access private element on non-instance")}var f,w=o[0],_=o[3],A=!$;if(!A){l||Array.isArray(w)||(w=[w]);var i={},T=[],p=s===3?"get":s===4||h?"set":"value";k?(b||h?i={get:ke(function(){return _(this)},a,"get"),set:function(u){o[4](this,u)}}:i[p]=_,b||ke(i[p],a,s===2?"":p)):b||(i=Object.getOwnPropertyDescriptor(n,a))}for(var d=n,P=w.length-1;P>=0;P-=l?2:1){var K=w[P],W=l?w[P-1]:void 0,J={},N={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:R,addInitializer:(function(u,O){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");y(O,"An initializer","be",!0),D.push(O)}).bind(null,J)};try{if(A)(f=y(K.call(W,d,N),"class decorators","return"))&&(d=f);else{var H,V;N.static=q,N.private=k,k?s===2?H=function(u){return x(u),i.value}:(s<4&&(H=j(i,"get",x)),s!==3&&(V=j(i,"set",x))):(H=function(u){return u[a]},(s<2||s===4)&&(V=function(u,O){u[a]=O}));var G=N.access={has:k?g.bind():function(u){return a in u}};if(H&&(G.get=H),V&&(G.set=V),d=K.call(W,h?{get:i.get,set:i.set}:i[p],N),h){if(typeof d=="object"&&d)(f=y(d.get,"accessor.get"))&&(i.get=f),(f=y(d.set,"accessor.set"))&&(i.set=f),(f=y(d.init,"accessor.init"))&&T.push(f);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(d,(b?"field":"method")+" decorators","return")&&(b?T.push(d):i[p]=d)}}finally{J.v=!0}}return(b||h)&&$.push(function(u,O){for(var B=T.length-1;B>=0;B--)O=T[B].call(u,O);return O}),b||A||(k?h?$.push(j(i,"get"),j(i,"set")):$.push(s===2?i[p]:j.call.bind(i[p])):Object.defineProperty(n,a,i)),d}function E(n,o){return Object.defineProperty(n,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:o})}if(arguments.length>=6)var L=M[Symbol.metadata||Symbol.for("Symbol.metadata")];var I=Object.create(L??null),C=function(n,o,l,a){var s,R,D=[],$=function(p){return gt(p)===n},q=new Map;function k(p){p&&D.push(S.bind(null,p))}for(var b=0;b<o.length;b++){var h=o[b];if(Array.isArray(h)){var g=h[1],x=h[2],f=h.length>3,w=16&g,_=!!(8&g),A=(g&=7)==0,i=x+"/"+_;if(!A&&!f){var T=q.get(i);if(T===!0||T===3&&g!==4||T===4&&g!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+x);q.set(i,!(g>2)||g)}m(_?n:n.prototype,h,w,f?"#"+x:He(x),g,a,_?R=R||[]:s=s||[],D,_,f,A,g===1,_&&f?$:l)}}return k(s),k(R),D}(e,t,v,I);return r.length||E(e,I),{e:C,get c(){var n=[];return r.length&&[E(m(e,[r],c,e.name,5,I,n),I),S.bind(null,n,e)]}}}function He(e){var t=ht(e,"string");return typeof t=="symbol"?t:t+""}function ht(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var c=r.call(e,t);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ke(e,t,r){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:r?r+" "+t:t})}catch{}return e}function gt(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}Ne=[z.autoRegister({tagName:"wsx-marked-code"})];exports.Code=void 0;class pt extends z.LightComponent{constructor(){super({styles:ve,styleName:"wsx-marked-code"}),ae(this,"_autoStyles",ve),ae(this,"code",""),ae(this,"language","")}static get observedAttributes(){return["code","language"]}attributeChangedCallback(t,r,c){t==="code"?this.code=c||"":t==="language"&&(this.language=c||""),this.rerender()}render(){return z.jsx("div",null,this.language&&z.jsx("span",{class:"language-label"},this.language),z.jsx("pre",null,z.jsx("code",null,this.code)))}}Me=pt;[exports.Code,Ie]=mt(Me,[],Ne,0,void 0,z.LightComponent).c;Ie();const je="wsx-marked-blockquote{display:block;margin:1rem 0;padding:1rem 1.5rem;border-left:4px solid var(--primary-red, #dc2626);background:var(--bg-secondary, #f9f9f9);border-radius:4px;font-style:italic;color:var(--text-secondary, #666)}";var qe;let Pe,Ve;function bt(e,t,r){return(t=Be(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yt(e,t,r,c,v,M){function j(n,o,l){return function(a,s){return l&&l(a),n[o].call(a,s)}}function S(n,o){for(var l=0;l<n.length;l++)n[l].call(o);return o}function y(n,o,l,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(o+" must "+(l||"be")+" a function"+(a?"":" or undefined"));return n}function m(n,o,l,a,s,R,D,$,q,k,b,h,g){function x(u){if(!g(u))throw new TypeError("Attempted to access private element on non-instance")}var f,w=o[0],_=o[3],A=!$;if(!A){l||Array.isArray(w)||(w=[w]);var i={},T=[],p=s===3?"get":s===4||h?"set":"value";k?(b||h?i={get:xe(function(){return _(this)},a,"get"),set:function(u){o[4](this,u)}}:i[p]=_,b||xe(i[p],a,s===2?"":p)):b||(i=Object.getOwnPropertyDescriptor(n,a))}for(var d=n,P=w.length-1;P>=0;P-=l?2:1){var K=w[P],W=l?w[P-1]:void 0,J={},N={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:R,addInitializer:(function(u,O){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");y(O,"An initializer","be",!0),D.push(O)}).bind(null,J)};try{if(A)(f=y(K.call(W,d,N),"class decorators","return"))&&(d=f);else{var H,V;N.static=q,N.private=k,k?s===2?H=function(u){return x(u),i.value}:(s<4&&(H=j(i,"get",x)),s!==3&&(V=j(i,"set",x))):(H=function(u){return u[a]},(s<2||s===4)&&(V=function(u,O){u[a]=O}));var G=N.access={has:k?g.bind():function(u){return a in u}};if(H&&(G.get=H),V&&(G.set=V),d=K.call(W,h?{get:i.get,set:i.set}:i[p],N),h){if(typeof d=="object"&&d)(f=y(d.get,"accessor.get"))&&(i.get=f),(f=y(d.set,"accessor.set"))&&(i.set=f),(f=y(d.init,"accessor.init"))&&T.push(f);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(d,(b?"field":"method")+" decorators","return")&&(b?T.push(d):i[p]=d)}}finally{J.v=!0}}return(b||h)&&$.push(function(u,O){for(var B=T.length-1;B>=0;B--)O=T[B].call(u,O);return O}),b||A||(k?h?$.push(j(i,"get"),j(i,"set")):$.push(s===2?i[p]:j.call.bind(i[p])):Object.defineProperty(n,a,i)),d}function E(n,o){return Object.defineProperty(n,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:o})}if(arguments.length>=6)var L=M[Symbol.metadata||Symbol.for("Symbol.metadata")];var I=Object.create(L??null),C=function(n,o,l,a){var s,R,D=[],$=function(p){return kt(p)===n},q=new Map;function k(p){p&&D.push(S.bind(null,p))}for(var b=0;b<o.length;b++){var h=o[b];if(Array.isArray(h)){var g=h[1],x=h[2],f=h.length>3,w=16&g,_=!!(8&g),A=(g&=7)==0,i=x+"/"+_;if(!A&&!f){var T=q.get(i);if(T===!0||T===3&&g!==4||T===4&&g!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+x);q.set(i,!(g>2)||g)}m(_?n:n.prototype,h,w,f?"#"+x:Be(x),g,a,_?R=R||[]:s=s||[],D,_,f,A,g===1,_&&f?$:l)}}return k(s),k(R),D}(e,t,v,I);return r.length||E(e,I),{e:C,get c(){var n=[];return r.length&&[E(m(e,[r],c,e.name,5,I,n),I),S.bind(null,n,e)]}}}function Be(e){var t=vt(e,"string");return typeof t=="symbol"?t:t+""}function vt(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var c=r.call(e,t);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function xe(e,t,r){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:r?r+" "+t:t})}catch{}return e}function kt(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}Ve=[z.autoRegister({tagName:"wsx-marked-blockquote"})];exports.Blockquote=void 0;class jt extends z.LightComponent{constructor(){super({styles:je,styleName:"wsx-marked-blockquote"}),bt(this,"_autoStyles",je)}render(){return z.jsx("blockquote",null,z.jsx("slot",null))}}qe=jt;[exports.Blockquote,Pe]=yt(qe,[],Ve,0,void 0,z.LightComponent).c;Pe();var Ke;let We,Je;function xt(e,t,r){return(t=Ge(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wt(e,t,r,c,v,M){function j(n,o,l){return function(a,s){return l&&l(a),n[o].call(a,s)}}function S(n,o){for(var l=0;l<n.length;l++)n[l].call(o);return o}function y(n,o,l,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(o+" must "+(l||"be")+" a function"+(a?"":" or undefined"));return n}function m(n,o,l,a,s,R,D,$,q,k,b,h,g){function x(u){if(!g(u))throw new TypeError("Attempted to access private element on non-instance")}var f,w=o[0],_=o[3],A=!$;if(!A){l||Array.isArray(w)||(w=[w]);var i={},T=[],p=s===3?"get":s===4||h?"set":"value";k?(b||h?i={get:we(function(){return _(this)},a,"get"),set:function(u){o[4](this,u)}}:i[p]=_,b||we(i[p],a,s===2?"":p)):b||(i=Object.getOwnPropertyDescriptor(n,a))}for(var d=n,P=w.length-1;P>=0;P-=l?2:1){var K=w[P],W=l?w[P-1]:void 0,J={},N={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:R,addInitializer:(function(u,O){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");y(O,"An initializer","be",!0),D.push(O)}).bind(null,J)};try{if(A)(f=y(K.call(W,d,N),"class decorators","return"))&&(d=f);else{var H,V;N.static=q,N.private=k,k?s===2?H=function(u){return x(u),i.value}:(s<4&&(H=j(i,"get",x)),s!==3&&(V=j(i,"set",x))):(H=function(u){return u[a]},(s<2||s===4)&&(V=function(u,O){u[a]=O}));var G=N.access={has:k?g.bind():function(u){return a in u}};if(H&&(G.get=H),V&&(G.set=V),d=K.call(W,h?{get:i.get,set:i.set}:i[p],N),h){if(typeof d=="object"&&d)(f=y(d.get,"accessor.get"))&&(i.get=f),(f=y(d.set,"accessor.set"))&&(i.set=f),(f=y(d.init,"accessor.init"))&&T.push(f);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(d,(b?"field":"method")+" decorators","return")&&(b?T.push(d):i[p]=d)}}finally{J.v=!0}}return(b||h)&&$.push(function(u,O){for(var B=T.length-1;B>=0;B--)O=T[B].call(u,O);return O}),b||A||(k?h?$.push(j(i,"get"),j(i,"set")):$.push(s===2?i[p]:j.call.bind(i[p])):Object.defineProperty(n,a,i)),d}function E(n,o){return Object.defineProperty(n,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:o})}if(arguments.length>=6)var L=M[Symbol.metadata||Symbol.for("Symbol.metadata")];var I=Object.create(L??null),C=function(n,o,l,a){var s,R,D=[],$=function(p){return Tt(p)===n},q=new Map;function k(p){p&&D.push(S.bind(null,p))}for(var b=0;b<o.length;b++){var h=o[b];if(Array.isArray(h)){var g=h[1],x=h[2],f=h.length>3,w=16&g,_=!!(8&g),A=(g&=7)==0,i=x+"/"+_;if(!A&&!f){var T=q.get(i);if(T===!0||T===3&&g!==4||T===4&&g!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+x);q.set(i,!(g>2)||g)}m(_?n:n.prototype,h,w,f?"#"+x:Ge(x),g,a,_?R=R||[]:s=s||[],D,_,f,A,g===1,_&&f?$:l)}}return k(s),k(R),D}(e,t,v,I);return r.length||E(e,I),{e:C,get c(){var n=[];return r.length&&[E(m(e,[r],c,e.name,5,I,n),I),S.bind(null,n,e)]}}}function Ge(e){var t=_t(e,"string");return typeof t=="symbol"?t:t+""}function _t(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var c=r.call(e,t);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function we(e,t,r){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:r?r+" "+t:t})}catch{}return e}function Tt(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}Je=[z.autoRegister({tagName:"wsx-marked-paragraph"})];exports.Paragraph=void 0;class Ot extends z.LightComponent{constructor(){super({styleName:"wsx-marked-paragraph"}),xt(this,"content",void 0);const[t,r]=this.useState("content","");Object.defineProperty(this,"content",{get:t,set:r,enumerable:!0,configurable:!0})}static get observedAttributes(){return["content"]}attributeChangedCallback(t,r,c){t==="content"&&(this.content=c||"")}render(){return z.jsx("p",{class:"marked-paragraph"},this.content)}}Ke=Ot;[exports.Paragraph,We]=wt(Ke,[],Je,0,void 0,z.LightComponent).c;We();var Xe;let Fe,Ue;function _e(e,t,r){return(t=Qe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Et(e,t,r,c,v,M){function j(n,o,l){return function(a,s){return l&&l(a),n[o].call(a,s)}}function S(n,o){for(var l=0;l<n.length;l++)n[l].call(o);return o}function y(n,o,l,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(o+" must "+(l||"be")+" a function"+(a?"":" or undefined"));return n}function m(n,o,l,a,s,R,D,$,q,k,b,h,g){function x(u){if(!g(u))throw new TypeError("Attempted to access private element on non-instance")}var f,w=o[0],_=o[3],A=!$;if(!A){l||Array.isArray(w)||(w=[w]);var i={},T=[],p=s===3?"get":s===4||h?"set":"value";k?(b||h?i={get:Te(function(){return _(this)},a,"get"),set:function(u){o[4](this,u)}}:i[p]=_,b||Te(i[p],a,s===2?"":p)):b||(i=Object.getOwnPropertyDescriptor(n,a))}for(var d=n,P=w.length-1;P>=0;P-=l?2:1){var K=w[P],W=l?w[P-1]:void 0,J={},N={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:R,addInitializer:(function(u,O){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");y(O,"An initializer","be",!0),D.push(O)}).bind(null,J)};try{if(A)(f=y(K.call(W,d,N),"class decorators","return"))&&(d=f);else{var H,V;N.static=q,N.private=k,k?s===2?H=function(u){return x(u),i.value}:(s<4&&(H=j(i,"get",x)),s!==3&&(V=j(i,"set",x))):(H=function(u){return u[a]},(s<2||s===4)&&(V=function(u,O){u[a]=O}));var G=N.access={has:k?g.bind():function(u){return a in u}};if(H&&(G.get=H),V&&(G.set=V),d=K.call(W,h?{get:i.get,set:i.set}:i[p],N),h){if(typeof d=="object"&&d)(f=y(d.get,"accessor.get"))&&(i.get=f),(f=y(d.set,"accessor.set"))&&(i.set=f),(f=y(d.init,"accessor.init"))&&T.push(f);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(d,(b?"field":"method")+" decorators","return")&&(b?T.push(d):i[p]=d)}}finally{J.v=!0}}return(b||h)&&$.push(function(u,O){for(var B=T.length-1;B>=0;B--)O=T[B].call(u,O);return O}),b||A||(k?h?$.push(j(i,"get"),j(i,"set")):$.push(s===2?i[p]:j.call.bind(i[p])):Object.defineProperty(n,a,i)),d}function E(n,o){return Object.defineProperty(n,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:o})}if(arguments.length>=6)var L=M[Symbol.metadata||Symbol.for("Symbol.metadata")];var I=Object.create(L??null),C=function(n,o,l,a){var s,R,D=[],$=function(p){return Lt(p)===n},q=new Map;function k(p){p&&D.push(S.bind(null,p))}for(var b=0;b<o.length;b++){var h=o[b];if(Array.isArray(h)){var g=h[1],x=h[2],f=h.length>3,w=16&g,_=!!(8&g),A=(g&=7)==0,i=x+"/"+_;if(!A&&!f){var T=q.get(i);if(T===!0||T===3&&g!==4||T===4&&g!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+x);q.set(i,!(g>2)||g)}m(_?n:n.prototype,h,w,f?"#"+x:Qe(x),g,a,_?R=R||[]:s=s||[],D,_,f,A,g===1,_&&f?$:l)}}return k(s),k(R),D}(e,t,v,I);return r.length||E(e,I),{e:C,get c(){var n=[];return r.length&&[E(m(e,[r],c,e.name,5,I,n),I),S.bind(null,n,e)]}}}function Qe(e){var t=St(e,"string");return typeof t=="symbol"?t:t+""}function St(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var c=r.call(e,t);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Te(e,t,r){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:r?r+" "+t:t})}catch{}return e}function Lt(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}Ue=[z.autoRegister({tagName:"wsx-marked-list"})];exports.List=void 0;class zt extends z.LightComponent{constructor(){super({styleName:"wsx-marked-list"}),_e(this,"ordered",void 0),_e(this,"items",void 0);const[t,r]=this.useState("ordered",!1);Object.defineProperty(this,"ordered",{get:t,set:r,enumerable:!0,configurable:!0});let c=this.reactive([]);Object.defineProperty(this,"items",{get:()=>c,set:v=>{c=v!==null&&typeof v<"u"&&(Array.isArray(v)||typeof v=="object")?this.reactive(v):v,this.scheduleRerender()},enumerable:!0,configurable:!0})}static get observedAttributes(){return["ordered","items"]}attributeChangedCallback(t,r,c){if(t==="ordered")this.ordered=c==="true";else if(t==="items")try{this.items=JSON.parse(c||"[]")}catch{this.items=[]}}render(){return this.ordered?z.jsx("ol",{class:"marked-list"},this.items.map((t,r)=>z.jsx("li",{key:r,class:"marked-list-item"},t))):z.jsx("ul",{class:"marked-list"},this.items.map((t,r)=>z.jsx("li",{key:r,class:"marked-list-item"},t)))}}Xe=zt;[exports.List,Fe]=Et(Xe,[],Ue,0,void 0,z.LightComponent).c;Fe();var Ye;let Ze,et;function $t(e,t,r){return(t=tt(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ct(e,t,r,c,v,M){function j(n,o,l){return function(a,s){return l&&l(a),n[o].call(a,s)}}function S(n,o){for(var l=0;l<n.length;l++)n[l].call(o);return o}function y(n,o,l,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(o+" must "+(l||"be")+" a function"+(a?"":" or undefined"));return n}function m(n,o,l,a,s,R,D,$,q,k,b,h,g){function x(u){if(!g(u))throw new TypeError("Attempted to access private element on non-instance")}var f,w=o[0],_=o[3],A=!$;if(!A){l||Array.isArray(w)||(w=[w]);var i={},T=[],p=s===3?"get":s===4||h?"set":"value";k?(b||h?i={get:Oe(function(){return _(this)},a,"get"),set:function(u){o[4](this,u)}}:i[p]=_,b||Oe(i[p],a,s===2?"":p)):b||(i=Object.getOwnPropertyDescriptor(n,a))}for(var d=n,P=w.length-1;P>=0;P-=l?2:1){var K=w[P],W=l?w[P-1]:void 0,J={},N={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:R,addInitializer:(function(u,O){if(u.v)throw ue("attempted to call addInitializer after decoration was finished");y(O,"An initializer","be",!0),D.push(O)}).bind(null,J)};try{if(A)(f=y(K.call(W,d,N),"class decorators","return"))&&(d=f);else{var H,V;N.static=q,N.private=k,k?s===2?H=function(u){return x(u),i.value}:(s<4&&(H=j(i,"get",x)),s!==3&&(V=j(i,"set",x))):(H=function(u){return u[a]},(s<2||s===4)&&(V=function(u,O){u[a]=O}));var G=N.access={has:k?g.bind():function(u){return a in u}};if(H&&(G.get=H),V&&(G.set=V),d=K.call(W,h?{get:i.get,set:i.set}:i[p],N),h){if(typeof d=="object"&&d)(f=y(d.get,"accessor.get"))&&(i.get=f),(f=y(d.set,"accessor.set"))&&(i.set=f),(f=y(d.init,"accessor.init"))&&T.push(f);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(d,(b?"field":"method")+" decorators","return")&&(b?T.push(d):i[p]=d)}}finally{J.v=!0}}return(b||h)&&$.push(function(u,O){for(var B=T.length-1;B>=0;B--)O=T[B].call(u,O);return O}),b||A||(k?h?$.push(j(i,"get"),j(i,"set")):$.push(s===2?i[p]:j.call.bind(i[p])):Object.defineProperty(n,a,i)),d}function E(n,o){return Object.defineProperty(n,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:o})}if(arguments.length>=6)var L=M[Symbol.metadata||Symbol.for("Symbol.metadata")];var I=Object.create(L??null),C=function(n,o,l,a){var s,R,D=[],$=function(p){return Rt(p)===n},q=new Map;function k(p){p&&D.push(S.bind(null,p))}for(var b=0;b<o.length;b++){var h=o[b];if(Array.isArray(h)){var g=h[1],x=h[2],f=h.length>3,w=16&g,_=!!(8&g),A=(g&=7)==0,i=x+"/"+_;if(!A&&!f){var T=q.get(i);if(T===!0||T===3&&g!==4||T===4&&g!==3)throw ue("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+x);q.set(i,!(g>2)||g)}m(_?n:n.prototype,h,w,f?"#"+x:tt(x),g,a,_?R=R||[]:s=s||[],D,_,f,A,g===1,_&&f?$:l)}}return k(s),k(R),D}(e,t,v,I);return r.length||E(e,I),{e:C,get c(){var n=[];return r.length&&[E(m(e,[r],c,e.name,5,I,n),I),S.bind(null,n,e)]}}}function tt(e){var t=At(e,"string");return typeof t=="symbol"?t:t+""}function At(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var c=r.call(e,t);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Oe(e,t,r){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:r?r+" "+t:t})}catch{}return e}function Rt(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}et=[z.autoRegister({tagName:"wsx-marked-error"})];exports.Error=void 0;let ue=class extends z.LightComponent{constructor(){super({styleName:"wsx-marked-error"}),$t(this,"message","")}static get observedAttributes(){return["message"]}attributeChangedCallback(t,r,c){t==="message"&&(this.message=c||"",this.rerender())}render(){return z.jsx("div",{class:"error"},this.message)}};Ye=ue;[exports.Error,Ze]=Ct(Ye,[],et,0,void 0,z.LightComponent).c;Ze();function Dt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ie={exports:{}};function Mt(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var It=Nt;function Nt(e,t,r){var c=r&&r.stringify||Mt,v=1;if(typeof e=="object"&&e!==null){var M=t.length+v;if(M===1)return e;var j=new Array(M);j[0]=c(e);for(var S=1;S<M;S++)j[S]=c(t[S]);return j.join(" ")}if(typeof e!="string")return e;var y=t.length;if(y===0)return e;for(var m="",E=1-v,L=-1,I=e&&e.length||0,C=0;C<I;){if(e.charCodeAt(C)===37&&C+1<I){switch(L=L>-1?L:0,e.charCodeAt(C+1)){case 100:case 102:if(E>=y||t[E]==null)break;L<C&&(m+=e.slice(L,C)),m+=Number(t[E]),L=C+2,C++;break;case 105:if(E>=y||t[E]==null)break;L<C&&(m+=e.slice(L,C)),m+=Math.floor(Number(t[E])),L=C+2,C++;break;case 79:case 111:case 106:if(E>=y||t[E]===void 0)break;L<C&&(m+=e.slice(L,C));var n=typeof t[E];if(n==="string"){m+="'"+t[E]+"'",L=C+2,C++;break}if(n==="function"){m+=t[E].name||"<anonymous>",L=C+2,C++;break}m+=c(t[E]),L=C+2,C++;break;case 115:if(E>=y)break;L<C&&(m+=e.slice(L,C)),m+=String(t[E]),L=C+2,C++;break;case 37:L<C&&(m+=e.slice(L,C)),m+="%",L=C+2,C++,E--;break}++E}++C}return L===-1?e:(L<I&&(m+=e.slice(L)),m)}const Ee=It;ie.exports=X;const Z=Zt().console||{},Ht={mapHttpRequest:ee,mapHttpResponse:ee,wrapRequestSerializer:se,wrapResponseSerializer:se,wrapErrorSerializer:se,req:ee,res:ee,err:Le,errWithCause:Le};function F(e,t){return e==="silent"?1/0:t.levels.values[e]}const he=Symbol("pino.logFuncs"),fe=Symbol("pino.hierarchy"),qt={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function Se(e,t){const r={logger:t,parent:e[fe]};t[fe]=r}function Pt(e,t,r){const c={};t.forEach(v=>{c[v]=r[v]?r[v]:Z[v]||Z[qt[v]||"log"]||Q}),e[he]=c}function Vt(e,t){return Array.isArray(e)?e.filter(function(c){return c!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function X(e){e=e||{},e.browser=e.browser||{};const t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");const r=e.browser.write||Z;e.browser.write&&(e.browser.asObject=!0);const c=e.serializers||{},v=Vt(e.browser.serialize,c);let M=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(M=!1);const j=Object.keys(e.customLevels||{}),S=["error","fatal","warn","info","debug","trace"].concat(j);typeof r=="function"&&S.forEach(function(o){r[o]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");const y=e.level||"info",m=Object.create(r);m.log||(m.log=Q),Pt(m,S,r),Se({},m),Object.defineProperty(m,"levelVal",{get:L}),Object.defineProperty(m,"level",{get:I,set:C});const E={transmit:t,serialize:v,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:S,timestamp:Ut(e),messageKey:e.messageKey||"msg",onChild:e.onChild||Q};m.levels=Bt(e),m.level=y,m.isLevelEnabled=function(o){return this.levels.values[o]?this.levels.values[o]>=this.levels.values[this.level]:!1},m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=Q,m.serializers=c,m._serialize=v,m._stdErrSerialize=M,m.child=function(...o){return n.call(this,E,...o)},t&&(m._logEvent=de());function L(){return F(this.level,this)}function I(){return this._level}function C(o){if(o!=="silent"&&!this.levels.values[o])throw Error("unknown level "+o);this._level=o,U(this,E,m,"error"),U(this,E,m,"fatal"),U(this,E,m,"warn"),U(this,E,m,"info"),U(this,E,m,"debug"),U(this,E,m,"trace"),j.forEach(l=>{U(this,E,m,l)})}function n(o,l,a){if(!l)throw new Error("missing bindings for child Pino");a=a||{},v&&l.serializers&&(a.serializers=l.serializers);const s=a.serializers;if(v&&s){var R=Object.assign({},c,s),D=e.browser.serialize===!0?Object.keys(R):v;delete l.serializers,ge([l],D,R,this._stdErrSerialize)}function $(k){this._childLevel=(k._childLevel|0)+1,this.bindings=l,R&&(this.serializers=R,this._serialize=D),t&&(this._logEvent=de([].concat(k._logEvent.bindings,l)))}$.prototype=this;const q=new $(this);return Se(this,q),q.child=function(...k){return n.call(this,o,...k)},q.level=a.level||this.level,o.onChild(q),q}return m}function Bt(e){const t=e.customLevels||{},r=Object.assign({},X.levels.values,t),c=Object.assign({},X.levels.labels,Kt(t));return{values:r,labels:c}}function Kt(e){const t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}X.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};X.stdSerializers=Ht;X.stdTimeFunctions=Object.assign({},{nullTime:rt,epochTime:nt,unixTime:Qt,isoTime:Yt});function Wt(e){const t=[];e.bindings&&t.push(e.bindings);let r=e[fe];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function U(e,t,r,c){if(Object.defineProperty(e,c,{value:F(e.level,r)>F(c,r)?Q:r[he][c],writable:!0,enumerable:!0,configurable:!0}),e[c]===Q){if(!t.transmit)return;const M=t.transmit.level||e.level,j=F(M,r);if(F(c,r)<j)return}e[c]=Gt(e,t,r,c);const v=Wt(e);v.length!==0&&(e[c]=Jt(v,e[c]))}function Jt(e,t){return function(){return t.apply(this,[...e,...arguments])}}function Gt(e,t,r,c){return function(v){return function(){const j=t.timestamp(),S=new Array(arguments.length),y=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Z?Z:this;for(var m=0;m<S.length;m++)S[m]=arguments[m];var E=!1;if(t.serialize&&(ge(S,this._serialize,this.serializers,this._stdErrSerialize),E=!0),t.asObject||t.formatters?v.call(y,...Xt(this,c,S,j,t)):v.apply(y,S),t.transmit){const L=t.transmit.level||e._level,I=F(L,r),C=F(c,r);if(C<I)return;Ft(this,{ts:j,methodLevel:c,methodValue:C,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:F(e._level,r)},S,E)}}}(e[he][c])}function Xt(e,t,r,c,v){const{level:M,log:j=L=>L}=v.formatters||{},S=r.slice();let y=S[0];const m={};let E=(e._childLevel|0)+1;if(E<1&&(E=1),c&&(m.time=c),M){const L=M(t,e.levels.values[t]);Object.assign(m,L)}else m.level=e.levels.values[t];if(v.asObjectBindingsOnly){if(y!==null&&typeof y=="object")for(;E--&&typeof S[0]=="object";)Object.assign(m,S.shift());return[j(m),...S]}else{if(y!==null&&typeof y=="object"){for(;E--&&typeof S[0]=="object";)Object.assign(m,S.shift());y=S.length?Ee(S.shift(),S):void 0}else typeof y=="string"&&(y=Ee(S.shift(),S));return y!==void 0&&(m[v.messageKey]=y),[j(m)]}}function ge(e,t,r,c){for(const v in e)if(c&&e[v]instanceof Error)e[v]=X.stdSerializers.err(e[v]);else if(typeof e[v]=="object"&&!Array.isArray(e[v])&&t)for(const M in e[v])t.indexOf(M)>-1&&M in r&&(e[v][M]=r[M](e[v][M]))}function Ft(e,t,r,c=!1){const v=t.send,M=t.ts,j=t.methodLevel,S=t.methodValue,y=t.val,m=e._logEvent.bindings;c||ge(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=M,e._logEvent.messages=r.filter(function(E){return m.indexOf(E)===-1}),e._logEvent.level.label=j,e._logEvent.level.value=S,v(j,e._logEvent,y),e._logEvent=de(m)}function de(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Le(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)t[r]===void 0&&(t[r]=e[r]);return t}function Ut(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?rt:nt}function ee(){return{}}function se(e){return e}function Q(){}function rt(){return!1}function nt(){return Date.now()}function Qt(){return Math.round(Date.now()/1e3)}function Yt(){return new Date(Date.now()).toISOString()}function Zt(){function e(t){return typeof t<"u"&&t}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}ie.exports.default=X;ie.exports.pino=X;var er=ie.exports;const te=Dt(er);function ne(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function tr(){var e;return typeof process<"u"&&((e=process.versions)==null?void 0:e.node)!==void 0}function rr(){return typeof window<"u"&&typeof document<"u"}const ce={name:"WSX",level:ne()?"info":"debug",pretty:!ne()};function nr(e={}){const{name:t,level:r,pretty:c,pinoOptions:v}={...ce,...e},M={name:t||ce.name,level:r||ce.level,...v};if(rr()&&(M.browser={asObject:!1,write:void 0,...(v==null?void 0:v.browser)||{}}),c&&tr()&&!ne())try{return te(M,te.transport({target:"pino-pretty",options:{colorize:!0,translateTime:"HH:MM:ss.l",ignore:"pid,hostname",singleLine:!1}}))}catch{return console.warn("[wsx-logger] pino-pretty not available, using default formatter"),te(M)}return te(M)}class it{constructor(t={}){this.isProd=ne(),this.pinoLogger=nr(t)}debug(t,...r){this.isProd||(r.length>0?this.pinoLogger.debug({args:r},t):this.pinoLogger.debug(t))}info(t,...r){this.isProd?r.length>0?this.pinoLogger.info({args:r},t):this.pinoLogger.info(t):r.length>0?this.pinoLogger.info({args:r},t):this.pinoLogger.info(t)}warn(t,...r){r.length>0?this.pinoLogger.warn({args:r},t):this.pinoLogger.warn(t)}error(t,...r){r.length>0?this.pinoLogger.error({args:r},t):this.pinoLogger.error(t)}fatal(t,...r){r.length>0?this.pinoLogger.fatal({args:r},t):this.pinoLogger.fatal(t)}trace(t,...r){this.isProd||(r.length>0?this.pinoLogger.trace({args:r},t):this.pinoLogger.trace(t))}getPinoLogger(){return this.pinoLogger}}new it;function ir(e,t={}){return new it({...t,name:t.name||`WSX:${e}`})}const ze="wsx-markdown{display:block}.marked-content{line-height:1.7;color:var(--text-primary, #2c3e50)}.marked-content .marked-paragraph{margin:1rem 0;line-height:1.7}.marked-content .marked-list{margin:1rem 0;padding-left:2rem}.marked-content .marked-list-item{margin:.5rem 0;line-height:1.6}.marked-content a{color:var(--primary-red, #dc2626);text-decoration:none;border-bottom:1px solid transparent;transition:border-color .2s ease}.marked-content a:hover{border-bottom-color:var(--primary-red, #dc2626)}.marked-content strong{font-weight:600;color:var(--text-primary, #2c3e50)}.marked-content em{font-style:italic}.marked-content hr{border:none;border-top:2px solid var(--border-color, #e0e0e0);margin:2rem 0}.marked-content img{max-width:100%;height:auto;border-radius:8px;margin:1rem 0}.error{color:#dc2626;padding:1rem;background:#fee2e2;border-radius:6px;border:1px solid #fecaca}";function me(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}function or(e){if(!e||!Array.isArray(e))return[];const t=[];return e.forEach(r=>{if(r.type==="paragraph"){const c=r;c.tokens&&Array.isArray(c.tokens)&&t.push(...c.tokens)}else(r.type==="text"||r.type==="strong"||r.type==="em"||r.type==="link"||r.type==="code"||r.type==="br")&&t.push(r)}),t}function Y(e){return!e||!Array.isArray(e)?"":e.map(t=>{switch(t.type){case"text":return t.text||"";case"strong":{const r=t,c=r.tokens&&Array.isArray(r.tokens)?r.tokens:[];return`<strong>${Y(c)}</strong>`}case"em":{const r=t,c=r.tokens&&Array.isArray(r.tokens)?r.tokens:[];return`<em>${Y(c)}</em>`}case"link":{const r=t,c=r.title?` title="${me(r.title)}"`:"",v=r.tokens&&Array.isArray(r.tokens)?r.tokens:[];return`<a href="${r.href||"#"}"${c}>${Y(v)}</a>`}case"code":return`<code>${me(t.text||"")}</code>`;case"br":return"<br>";default:return""}}).join("")}var ot;let at,st;function le(e,t,r){return(t=ct(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ar(e,t,r,c,v,M){function j(n,o,l){return function(a,s){return l&&l(a),n[o].call(a,s)}}function S(n,o){for(var l=0;l<n.length;l++)n[l].call(o);return o}function y(n,o,l,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(o+" must "+(l||"be")+" a function"+(a?"":" or undefined"));return n}function m(n,o,l,a,s,R,D,$,q,k,b,h,g){function x(u){if(!g(u))throw new TypeError("Attempted to access private element on non-instance")}var f,w=o[0],_=o[3],A=!$;if(!A){l||Array.isArray(w)||(w=[w]);var i={},T=[],p=s===3?"get":s===4||h?"set":"value";k?(b||h?i={get:$e(function(){return _(this)},a,"get"),set:function(u){o[4](this,u)}}:i[p]=_,b||$e(i[p],a,s===2?"":p)):b||(i=Object.getOwnPropertyDescriptor(n,a))}for(var d=n,P=w.length-1;P>=0;P-=l?2:1){var K=w[P],W=l?w[P-1]:void 0,J={},N={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:R,addInitializer:(function(u,O){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");y(O,"An initializer","be",!0),D.push(O)}).bind(null,J)};try{if(A)(f=y(K.call(W,d,N),"class decorators","return"))&&(d=f);else{var H,V;N.static=q,N.private=k,k?s===2?H=function(u){return x(u),i.value}:(s<4&&(H=j(i,"get",x)),s!==3&&(V=j(i,"set",x))):(H=function(u){return u[a]},(s<2||s===4)&&(V=function(u,O){u[a]=O}));var G=N.access={has:k?g.bind():function(u){return a in u}};if(H&&(G.get=H),V&&(G.set=V),d=K.call(W,h?{get:i.get,set:i.set}:i[p],N),h){if(typeof d=="object"&&d)(f=y(d.get,"accessor.get"))&&(i.get=f),(f=y(d.set,"accessor.set"))&&(i.set=f),(f=y(d.init,"accessor.init"))&&T.push(f);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(d,(b?"field":"method")+" decorators","return")&&(b?T.push(d):i[p]=d)}}finally{J.v=!0}}return(b||h)&&$.push(function(u,O){for(var B=T.length-1;B>=0;B--)O=T[B].call(u,O);return O}),b||A||(k?h?$.push(j(i,"get"),j(i,"set")):$.push(s===2?i[p]:j.call.bind(i[p])):Object.defineProperty(n,a,i)),d}function E(n,o){return Object.defineProperty(n,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:o})}if(arguments.length>=6)var L=M[Symbol.metadata||Symbol.for("Symbol.metadata")];var I=Object.create(L??null),C=function(n,o,l,a){var s,R,D=[],$=function(p){return cr(p)===n},q=new Map;function k(p){p&&D.push(S.bind(null,p))}for(var b=0;b<o.length;b++){var h=o[b];if(Array.isArray(h)){var g=h[1],x=h[2],f=h.length>3,w=16&g,_=!!(8&g),A=(g&=7)==0,i=x+"/"+_;if(!A&&!f){var T=q.get(i);if(T===!0||T===3&&g!==4||T===4&&g!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+x);q.set(i,!(g>2)||g)}m(_?n:n.prototype,h,w,f?"#"+x:ct(x),g,a,_?R=R||[]:s=s||[],D,_,f,A,g===1,_&&f?$:l)}}return k(s),k(R),D}(e,t,v,I);return r.length||E(e,I),{e:C,get c(){var n=[];return r.length&&[E(m(e,[r],c,e.name,5,I,n),I),S.bind(null,n,e)]}}}function ct(e){var t=sr(e,"string");return typeof t=="symbol"?t:t+""}function sr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var c=r.call(e,t);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function $e(e,t,r){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:r?r+" "+t:t})}catch{}return e}function cr(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}const re=ir("Markdown");st=[z.autoRegister({tagName:"wsx-markdown"})];exports.Markdown=void 0;class lr extends z.LightComponent{constructor(){super({styles:ze,styleName:"wsx-markdown",lightDOM:!0}),le(this,"_autoStyles",ze),le(this,"markdown",void 0),le(this,"customRenderers",{}),re.info("Markdown initialized");const[t,r]=this.useState("markdown","");Object.defineProperty(this,"markdown",{get:t,set:r,enumerable:!0,configurable:!0})}static get observedAttributes(){return["markdown"]}attributeChangedCallback(t,r,c){t==="markdown"&&(this.markdown=c||"",this.rerender())}setCustomRenderers(t){this.customRenderers={...this.customRenderers,...t},this.rerender()}getCustomRenderers(){return{...this.customRenderers}}render(){if(!this.markdown)return z.jsx("div",{class:"marked-content"});try{const t=pe.marked.lexer(this.markdown);return z.jsx("div",{class:"marked-content"},this.renderTokens(t))}catch(t){return re.error("Failed to render markdown",t),z.jsx("div",{class:"marked-content"},z.jsx("wsx-marked-error",{message:`Error: ${t}`}))}}onConnected(){const t=this.getAttribute("markdown");t&&(this.markdown=t)}renderTokens(t){return t.map(r=>this.renderToken(r)).filter(r=>r!==null)}renderToken(t){const r=this.customRenderers[t.type];if(r){const c=r(t,()=>this.defaultRenderToken(t));if(c!==null)return c}return this.defaultRenderToken(t)}defaultRenderToken(t){switch(t.type){case"heading":{const r=t;return z.jsx("wsx-marked-heading",{level:r.depth.toString(),text:Y(r.tokens)})}case"code":{const r=t;return z.jsx("wsx-marked-code",{code:r.text,language:r.lang||""})}case"blockquote":{const r=t;return z.jsx("wsx-marked-blockquote",null,this.renderTokens(r.tokens))}case"paragraph":{const r=t;return z.jsx("wsx-marked-paragraph",{content:Y(r.tokens)})}case"list":{const r=t,c=r.items.map(v=>{if(!v.tokens||!Array.isArray(v.tokens))return re.warn("List item has no tokens or tokens is not an array",{item:v}),"";const M=this.renderTokens(v.tokens);if(M.length===0)return"";const j=document.createElement("div");M.forEach(y=>{y&&j.appendChild(y)});const S=j.innerHTML;return S||re.warn("tempContainer.innerHTML is empty after appending elements",{renderedElementsCount:M.length,itemTokens:v.tokens}),S});return z.jsx("wsx-marked-list",{ordered:r.ordered?"true":"false",items:JSON.stringify(c)})}case"html":{const r=t;return z.jsx("div",null,r.text)}case"hr":return z.jsx("hr",null);case"space":return null;case"text":{const r=t;return z.jsx("span",null,r.text||"")}default:{const c=new pe.marked.Renderer()[t.type],v=(c==null?void 0:c(t))||"";return v?z.jsx("div",null,v):null}}}}ot=lr;[exports.Markdown,at]=ar(ot,[],st,0,void 0,z.LightComponent).c;at();exports.escapeHtml=me;exports.extractInlineTokens=or;exports.renderInlineTokens=Y;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("@wsxjs/wsx-core"),oe=require("marked"),ie="wsx-marked-heading{display:block}wsx-marked-heading h1{font-size:2.5rem;font-weight:700;margin:1.5rem 0 1rem;color:var(--text-primary, #2c3e50);border-bottom:2px solid var(--primary-red, #dc2626);padding-bottom:.5rem}wsx-marked-heading h2{font-size:2rem;font-weight:600;margin:1.25rem 0 .75rem;color:var(--text-primary, #2c3e50)}wsx-marked-heading h3{font-size:1.5rem;font-weight:600;margin:1rem 0 .5rem;color:var(--text-primary, #2c3e50)}wsx-marked-heading h4,wsx-marked-heading h5,wsx-marked-heading h6{font-size:1.25rem;font-weight:600;margin:.75rem 0 .5rem;color:var(--text-primary, #2c3e50)}";var pe;let ye,ve;function Q(t,e,r){return(e=be(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xe(t,e,r,f,O,q){function T(o,a,l){return function(n,s){return l&&l(n),o[a].call(n,s)}}function N(o,a){for(var l=0;l<o.length;l++)o[l].call(a);return a}function _(o,a,l,n){if(typeof o!="function"&&(n||o!==void 0))throw new TypeError(a+" must "+(l||"be")+" a function"+(n?"":" or undefined"));return o}function P(o,a,l,n,s,S,$,w,R,b,y,g,m){function p(u){if(!m(u))throw new TypeError("Attempted to access private element on non-instance")}var c,v=a[0],x=a[3],E=!w;if(!E){l||Array.isArray(v)||(v=[v]);var i={},k=[],h=s===3?"get":s===4||g?"set":"value";b?(y||g?i={get:ae(function(){return x(this)},n,"get"),set:function(u){a[4](this,u)}}:i[h]=x,y||ae(i[h],n,s===2?"":h)):y||(i=Object.getOwnPropertyDescriptor(o,n))}for(var d=o,M=v.length-1;M>=0;M-=l?2:1){var K=v[M],B=l?v[M-1]:void 0,W={},C={kind:["field","accessor","method","getter","setter","class"][s],name:n,metadata:S,addInitializer:(function(u,j){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");_(j,"An initializer","be",!0),$.push(j)}).bind(null,W)};try{if(E)(c=_(K.call(B,d,C),"class decorators","return"))&&(d=c);else{var I,D;C.static=R,C.private=b,b?s===2?I=function(u){return p(u),i.value}:(s<4&&(I=T(i,"get",p)),s!==3&&(D=T(i,"set",p))):(I=function(u){return u[n]},(s<2||s===4)&&(D=function(u,j){u[n]=j}));var G=C.access={has:b?m.bind():function(u){return n in u}};if(I&&(G.get=I),D&&(G.set=D),d=K.call(B,g?{get:i.get,set:i.set}:i[h],C),g){if(typeof d=="object"&&d)(c=_(d.get,"accessor.get"))&&(i.get=c),(c=_(d.set,"accessor.set"))&&(i.set=c),(c=_(d.init,"accessor.init"))&&k.push(c);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else _(d,(y?"field":"method")+" decorators","return")&&(y?k.push(d):i[h]=d)}}finally{W.v=!0}}return(y||g)&&w.push(function(u,j){for(var z=k.length-1;z>=0;z--)j=k[z].call(u,j);return j}),y||E||(b?g?w.push(T(i,"get"),T(i,"set")):w.push(s===2?i[h]:T.call.bind(i[h])):Object.defineProperty(o,n,i)),d}function H(o,a){return Object.defineProperty(o,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:a})}if(arguments.length>=6)var U=q[Symbol.metadata||Symbol.for("Symbol.metadata")];var A=Object.create(U??null),X=function(o,a,l,n){var s,S,$=[],w=function(h){return Je(h)===o},R=new Map;function b(h){h&&$.push(N.bind(null,h))}for(var y=0;y<a.length;y++){var g=a[y];if(Array.isArray(g)){var m=g[1],p=g[2],c=g.length>3,v=16&m,x=!!(8&m),E=(m&=7)==0,i=p+"/"+x;if(!E&&!c){var k=R.get(i);if(k===!0||k===3&&m!==4||k===4&&m!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);R.set(i,!(m>2)||m)}P(x?o:o.prototype,g,v,c?"#"+p:be(p),m,n,x?S=S||[]:s=s||[],$,x,c,E,m===1,x&&c?w:l)}}return b(s),b(S),$}(t,e,O,A);return r.length||H(t,A),{e:X,get c(){var o=[];return r.length&&[H(P(t,[r],f,t.name,5,A,o),A),N.bind(null,o,t)]}}}function be(t){var e=Fe(t,"string");return typeof e=="symbol"?e:e+""}function Fe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var f=r.call(t,e);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function ae(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function Je(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}ve=[L.autoRegister({tagName:"wsx-marked-heading"})];exports.Heading=void 0;class Ye extends L.LightComponent{constructor(){super({styles:ie,styleName:"wsx-marked-heading"}),Q(this,"_autoStyles",ie),Q(this,"level",1),Q(this,"text","")}static get observedAttributes(){return["level","text"]}attributeChangedCallback(e,r,f){e==="level"?this.level=parseInt(f,10)||1:e==="text"&&(this.text=f),this.rerender()}render(){return this.level===1?L.jsx("h1",null,this.text):this.level===2?L.jsx("h2",null,this.text):this.level===3?L.jsx("h3",null,this.text):this.level===4?L.jsx("h4",null,this.text):this.level===5?L.jsx("h5",null,this.text):L.jsx("h6",null,this.text)}}pe=Ye;[exports.Heading,ye]=Xe(pe,[],ve,0,void 0,L.LightComponent).c;ye();const se="wsx-marked-code{display:block;margin:1rem 0}wsx-marked-code pre{background:var(--bg-secondary, #f5f5f5);border:1px solid var(--border-color, #e0e0e0);border-radius:8px;padding:1rem;overflow-x:auto;font-family:Courier New,monospace;font-size:.9rem;line-height:1.5}wsx-marked-code code{background:transparent;padding:0;border:none;font-family:inherit}wsx-marked-code .language-label{display:inline-block;background:var(--primary-red, #dc2626);color:#fff;padding:.25rem .5rem;font-size:.75rem;border-radius:4px 4px 0 0;margin-bottom:-1px}";var xe;let ke,je;function V(t,e,r){return(e=Te(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qe(t,e,r,f,O,q){function T(o,a,l){return function(n,s){return l&&l(n),o[a].call(n,s)}}function N(o,a){for(var l=0;l<o.length;l++)o[l].call(a);return a}function _(o,a,l,n){if(typeof o!="function"&&(n||o!==void 0))throw new TypeError(a+" must "+(l||"be")+" a function"+(n?"":" or undefined"));return o}function P(o,a,l,n,s,S,$,w,R,b,y,g,m){function p(u){if(!m(u))throw new TypeError("Attempted to access private element on non-instance")}var c,v=a[0],x=a[3],E=!w;if(!E){l||Array.isArray(v)||(v=[v]);var i={},k=[],h=s===3?"get":s===4||g?"set":"value";b?(y||g?i={get:le(function(){return x(this)},n,"get"),set:function(u){a[4](this,u)}}:i[h]=x,y||le(i[h],n,s===2?"":h)):y||(i=Object.getOwnPropertyDescriptor(o,n))}for(var d=o,M=v.length-1;M>=0;M-=l?2:1){var K=v[M],B=l?v[M-1]:void 0,W={},C={kind:["field","accessor","method","getter","setter","class"][s],name:n,metadata:S,addInitializer:(function(u,j){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");_(j,"An initializer","be",!0),$.push(j)}).bind(null,W)};try{if(E)(c=_(K.call(B,d,C),"class decorators","return"))&&(d=c);else{var I,D;C.static=R,C.private=b,b?s===2?I=function(u){return p(u),i.value}:(s<4&&(I=T(i,"get",p)),s!==3&&(D=T(i,"set",p))):(I=function(u){return u[n]},(s<2||s===4)&&(D=function(u,j){u[n]=j}));var G=C.access={has:b?m.bind():function(u){return n in u}};if(I&&(G.get=I),D&&(G.set=D),d=K.call(B,g?{get:i.get,set:i.set}:i[h],C),g){if(typeof d=="object"&&d)(c=_(d.get,"accessor.get"))&&(i.get=c),(c=_(d.set,"accessor.set"))&&(i.set=c),(c=_(d.init,"accessor.init"))&&k.push(c);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else _(d,(y?"field":"method")+" decorators","return")&&(y?k.push(d):i[h]=d)}}finally{W.v=!0}}return(y||g)&&w.push(function(u,j){for(var z=k.length-1;z>=0;z--)j=k[z].call(u,j);return j}),y||E||(b?g?w.push(T(i,"get"),T(i,"set")):w.push(s===2?i[h]:T.call.bind(i[h])):Object.defineProperty(o,n,i)),d}function H(o,a){return Object.defineProperty(o,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:a})}if(arguments.length>=6)var U=q[Symbol.metadata||Symbol.for("Symbol.metadata")];var A=Object.create(U??null),X=function(o,a,l,n){var s,S,$=[],w=function(h){return Ze(h)===o},R=new Map;function b(h){h&&$.push(N.bind(null,h))}for(var y=0;y<a.length;y++){var g=a[y];if(Array.isArray(g)){var m=g[1],p=g[2],c=g.length>3,v=16&m,x=!!(8&m),E=(m&=7)==0,i=p+"/"+x;if(!E&&!c){var k=R.get(i);if(k===!0||k===3&&m!==4||k===4&&m!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);R.set(i,!(m>2)||m)}P(x?o:o.prototype,g,v,c?"#"+p:Te(p),m,n,x?S=S||[]:s=s||[],$,x,c,E,m===1,x&&c?w:l)}}return b(s),b(S),$}(t,e,O,A);return r.length||H(t,A),{e:X,get c(){var o=[];return r.length&&[H(P(t,[r],f,t.name,5,A,o),A),N.bind(null,o,t)]}}}function Te(t){var e=Ve(t,"string");return typeof e=="symbol"?e:e+""}function Ve(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var f=r.call(t,e);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function le(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function Ze(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}je=[L.autoRegister({tagName:"wsx-marked-code"})];exports.Code=void 0;class et extends L.LightComponent{constructor(){super({styles:se,styleName:"wsx-marked-code"}),V(this,"_autoStyles",se),V(this,"code",""),V(this,"language","")}static get observedAttributes(){return["code","language"]}attributeChangedCallback(e,r,f){e==="code"?this.code=f||"":e==="language"&&(this.language=f||""),this.rerender()}render(){return L.jsx("div",null,this.language&&L.jsx("span",{class:"language-label"},this.language),L.jsx("pre",null,L.jsx("code",null,this.code)))}}xe=et;[exports.Code,ke]=Qe(xe,[],je,0,void 0,L.LightComponent).c;ke();const ce="wsx-marked-blockquote{display:block;margin:1rem 0;padding:1rem 1.5rem;border-left:4px solid var(--primary-red, #dc2626);background:var(--bg-secondary, #f9f9f9);border-radius:4px;font-style:italic;color:var(--text-secondary, #666)}";var we;let _e,Le;function tt(t,e,r){return(e=Ee(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rt(t,e,r,f,O,q){function T(o,a,l){return function(n,s){return l&&l(n),o[a].call(n,s)}}function N(o,a){for(var l=0;l<o.length;l++)o[l].call(a);return a}function _(o,a,l,n){if(typeof o!="function"&&(n||o!==void 0))throw new TypeError(a+" must "+(l||"be")+" a function"+(n?"":" or undefined"));return o}function P(o,a,l,n,s,S,$,w,R,b,y,g,m){function p(u){if(!m(u))throw new TypeError("Attempted to access private element on non-instance")}var c,v=a[0],x=a[3],E=!w;if(!E){l||Array.isArray(v)||(v=[v]);var i={},k=[],h=s===3?"get":s===4||g?"set":"value";b?(y||g?i={get:ue(function(){return x(this)},n,"get"),set:function(u){a[4](this,u)}}:i[h]=x,y||ue(i[h],n,s===2?"":h)):y||(i=Object.getOwnPropertyDescriptor(o,n))}for(var d=o,M=v.length-1;M>=0;M-=l?2:1){var K=v[M],B=l?v[M-1]:void 0,W={},C={kind:["field","accessor","method","getter","setter","class"][s],name:n,metadata:S,addInitializer:(function(u,j){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");_(j,"An initializer","be",!0),$.push(j)}).bind(null,W)};try{if(E)(c=_(K.call(B,d,C),"class decorators","return"))&&(d=c);else{var I,D;C.static=R,C.private=b,b?s===2?I=function(u){return p(u),i.value}:(s<4&&(I=T(i,"get",p)),s!==3&&(D=T(i,"set",p))):(I=function(u){return u[n]},(s<2||s===4)&&(D=function(u,j){u[n]=j}));var G=C.access={has:b?m.bind():function(u){return n in u}};if(I&&(G.get=I),D&&(G.set=D),d=K.call(B,g?{get:i.get,set:i.set}:i[h],C),g){if(typeof d=="object"&&d)(c=_(d.get,"accessor.get"))&&(i.get=c),(c=_(d.set,"accessor.set"))&&(i.set=c),(c=_(d.init,"accessor.init"))&&k.push(c);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else _(d,(y?"field":"method")+" decorators","return")&&(y?k.push(d):i[h]=d)}}finally{W.v=!0}}return(y||g)&&w.push(function(u,j){for(var z=k.length-1;z>=0;z--)j=k[z].call(u,j);return j}),y||E||(b?g?w.push(T(i,"get"),T(i,"set")):w.push(s===2?i[h]:T.call.bind(i[h])):Object.defineProperty(o,n,i)),d}function H(o,a){return Object.defineProperty(o,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:a})}if(arguments.length>=6)var U=q[Symbol.metadata||Symbol.for("Symbol.metadata")];var A=Object.create(U??null),X=function(o,a,l,n){var s,S,$=[],w=function(h){return ot(h)===o},R=new Map;function b(h){h&&$.push(N.bind(null,h))}for(var y=0;y<a.length;y++){var g=a[y];if(Array.isArray(g)){var m=g[1],p=g[2],c=g.length>3,v=16&m,x=!!(8&m),E=(m&=7)==0,i=p+"/"+x;if(!E&&!c){var k=R.get(i);if(k===!0||k===3&&m!==4||k===4&&m!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);R.set(i,!(m>2)||m)}P(x?o:o.prototype,g,v,c?"#"+p:Ee(p),m,n,x?S=S||[]:s=s||[],$,x,c,E,m===1,x&&c?w:l)}}return b(s),b(S),$}(t,e,O,A);return r.length||H(t,A),{e:X,get c(){var o=[];return r.length&&[H(P(t,[r],f,t.name,5,A,o),A),N.bind(null,o,t)]}}}function Ee(t){var e=nt(t,"string");return typeof e=="symbol"?e:e+""}function nt(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var f=r.call(t,e);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function ue(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function ot(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}Le=[L.autoRegister({tagName:"wsx-marked-blockquote"})];exports.Blockquote=void 0;class it extends L.LightComponent{constructor(){super({styles:ce,styleName:"wsx-marked-blockquote"}),tt(this,"_autoStyles",ce)}render(){return L.jsx("blockquote",null,L.jsx("slot",null))}}we=it;[exports.Blockquote,_e]=rt(we,[],Le,0,void 0,L.LightComponent).c;_e();var $e;let Se,Ce;function at(t,e,r){return(e=Ie(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function st(t,e,r,f,O,q){function T(o,a,l){return function(n,s){return l&&l(n),o[a].call(n,s)}}function N(o,a){for(var l=0;l<o.length;l++)o[l].call(a);return a}function _(o,a,l,n){if(typeof o!="function"&&(n||o!==void 0))throw new TypeError(a+" must "+(l||"be")+" a function"+(n?"":" or undefined"));return o}function P(o,a,l,n,s,S,$,w,R,b,y,g,m){function p(u){if(!m(u))throw new TypeError("Attempted to access private element on non-instance")}var c,v=a[0],x=a[3],E=!w;if(!E){l||Array.isArray(v)||(v=[v]);var i={},k=[],h=s===3?"get":s===4||g?"set":"value";b?(y||g?i={get:fe(function(){return x(this)},n,"get"),set:function(u){a[4](this,u)}}:i[h]=x,y||fe(i[h],n,s===2?"":h)):y||(i=Object.getOwnPropertyDescriptor(o,n))}for(var d=o,M=v.length-1;M>=0;M-=l?2:1){var K=v[M],B=l?v[M-1]:void 0,W={},C={kind:["field","accessor","method","getter","setter","class"][s],name:n,metadata:S,addInitializer:(function(u,j){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");_(j,"An initializer","be",!0),$.push(j)}).bind(null,W)};try{if(E)(c=_(K.call(B,d,C),"class decorators","return"))&&(d=c);else{var I,D;C.static=R,C.private=b,b?s===2?I=function(u){return p(u),i.value}:(s<4&&(I=T(i,"get",p)),s!==3&&(D=T(i,"set",p))):(I=function(u){return u[n]},(s<2||s===4)&&(D=function(u,j){u[n]=j}));var G=C.access={has:b?m.bind():function(u){return n in u}};if(I&&(G.get=I),D&&(G.set=D),d=K.call(B,g?{get:i.get,set:i.set}:i[h],C),g){if(typeof d=="object"&&d)(c=_(d.get,"accessor.get"))&&(i.get=c),(c=_(d.set,"accessor.set"))&&(i.set=c),(c=_(d.init,"accessor.init"))&&k.push(c);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else _(d,(y?"field":"method")+" decorators","return")&&(y?k.push(d):i[h]=d)}}finally{W.v=!0}}return(y||g)&&w.push(function(u,j){for(var z=k.length-1;z>=0;z--)j=k[z].call(u,j);return j}),y||E||(b?g?w.push(T(i,"get"),T(i,"set")):w.push(s===2?i[h]:T.call.bind(i[h])):Object.defineProperty(o,n,i)),d}function H(o,a){return Object.defineProperty(o,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:a})}if(arguments.length>=6)var U=q[Symbol.metadata||Symbol.for("Symbol.metadata")];var A=Object.create(U??null),X=function(o,a,l,n){var s,S,$=[],w=function(h){return ct(h)===o},R=new Map;function b(h){h&&$.push(N.bind(null,h))}for(var y=0;y<a.length;y++){var g=a[y];if(Array.isArray(g)){var m=g[1],p=g[2],c=g.length>3,v=16&m,x=!!(8&m),E=(m&=7)==0,i=p+"/"+x;if(!E&&!c){var k=R.get(i);if(k===!0||k===3&&m!==4||k===4&&m!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);R.set(i,!(m>2)||m)}P(x?o:o.prototype,g,v,c?"#"+p:Ie(p),m,n,x?S=S||[]:s=s||[],$,x,c,E,m===1,x&&c?w:l)}}return b(s),b(S),$}(t,e,O,A);return r.length||H(t,A),{e:X,get c(){var o=[];return r.length&&[H(P(t,[r],f,t.name,5,A,o),A),N.bind(null,o,t)]}}}function Ie(t){var e=lt(t,"string");return typeof e=="symbol"?e:e+""}function lt(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var f=r.call(t,e);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function fe(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function ct(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}Ce=[L.autoRegister({tagName:"wsx-marked-paragraph"})];exports.Paragraph=void 0;class ut extends L.LightComponent{constructor(){super({styleName:"wsx-marked-paragraph"}),at(this,"content",void 0);const[e,r]=this.useState("content","");Object.defineProperty(this,"content",{get:e,set:r,enumerable:!0,configurable:!0})}static get observedAttributes(){return["content"]}attributeChangedCallback(e,r,f){e==="content"&&(this.content=f||"")}render(){return L.jsx("p",{class:"marked-paragraph"},this.content)}}$e=ut;[exports.Paragraph,Se]=st($e,[],Ce,0,void 0,L.LightComponent).c;Se();var Oe;let Ae,Re;function de(t,e,r){return(e=Me(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ft(t,e,r,f,O,q){function T(o,a,l){return function(n,s){return l&&l(n),o[a].call(n,s)}}function N(o,a){for(var l=0;l<o.length;l++)o[l].call(a);return a}function _(o,a,l,n){if(typeof o!="function"&&(n||o!==void 0))throw new TypeError(a+" must "+(l||"be")+" a function"+(n?"":" or undefined"));return o}function P(o,a,l,n,s,S,$,w,R,b,y,g,m){function p(u){if(!m(u))throw new TypeError("Attempted to access private element on non-instance")}var c,v=a[0],x=a[3],E=!w;if(!E){l||Array.isArray(v)||(v=[v]);var i={},k=[],h=s===3?"get":s===4||g?"set":"value";b?(y||g?i={get:ge(function(){return x(this)},n,"get"),set:function(u){a[4](this,u)}}:i[h]=x,y||ge(i[h],n,s===2?"":h)):y||(i=Object.getOwnPropertyDescriptor(o,n))}for(var d=o,M=v.length-1;M>=0;M-=l?2:1){var K=v[M],B=l?v[M-1]:void 0,W={},C={kind:["field","accessor","method","getter","setter","class"][s],name:n,metadata:S,addInitializer:(function(u,j){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");_(j,"An initializer","be",!0),$.push(j)}).bind(null,W)};try{if(E)(c=_(K.call(B,d,C),"class decorators","return"))&&(d=c);else{var I,D;C.static=R,C.private=b,b?s===2?I=function(u){return p(u),i.value}:(s<4&&(I=T(i,"get",p)),s!==3&&(D=T(i,"set",p))):(I=function(u){return u[n]},(s<2||s===4)&&(D=function(u,j){u[n]=j}));var G=C.access={has:b?m.bind():function(u){return n in u}};if(I&&(G.get=I),D&&(G.set=D),d=K.call(B,g?{get:i.get,set:i.set}:i[h],C),g){if(typeof d=="object"&&d)(c=_(d.get,"accessor.get"))&&(i.get=c),(c=_(d.set,"accessor.set"))&&(i.set=c),(c=_(d.init,"accessor.init"))&&k.push(c);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else _(d,(y?"field":"method")+" decorators","return")&&(y?k.push(d):i[h]=d)}}finally{W.v=!0}}return(y||g)&&w.push(function(u,j){for(var z=k.length-1;z>=0;z--)j=k[z].call(u,j);return j}),y||E||(b?g?w.push(T(i,"get"),T(i,"set")):w.push(s===2?i[h]:T.call.bind(i[h])):Object.defineProperty(o,n,i)),d}function H(o,a){return Object.defineProperty(o,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:a})}if(arguments.length>=6)var U=q[Symbol.metadata||Symbol.for("Symbol.metadata")];var A=Object.create(U??null),X=function(o,a,l,n){var s,S,$=[],w=function(h){return gt(h)===o},R=new Map;function b(h){h&&$.push(N.bind(null,h))}for(var y=0;y<a.length;y++){var g=a[y];if(Array.isArray(g)){var m=g[1],p=g[2],c=g.length>3,v=16&m,x=!!(8&m),E=(m&=7)==0,i=p+"/"+x;if(!E&&!c){var k=R.get(i);if(k===!0||k===3&&m!==4||k===4&&m!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);R.set(i,!(m>2)||m)}P(x?o:o.prototype,g,v,c?"#"+p:Me(p),m,n,x?S=S||[]:s=s||[],$,x,c,E,m===1,x&&c?w:l)}}return b(s),b(S),$}(t,e,O,A);return r.length||H(t,A),{e:X,get c(){var o=[];return r.length&&[H(P(t,[r],f,t.name,5,A,o),A),N.bind(null,o,t)]}}}function Me(t){var e=dt(t,"string");return typeof e=="symbol"?e:e+""}function dt(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var f=r.call(t,e);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function ge(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function gt(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}Re=[L.autoRegister({tagName:"wsx-marked-list"})];exports.List=void 0;class mt extends L.LightComponent{constructor(){super(),de(this,"ordered",void 0),de(this,"items",void 0);const[e,r]=this.useState("ordered",!1);Object.defineProperty(this,"ordered",{get:e,set:r,enumerable:!0,configurable:!0});let f=this.reactive([]);Object.defineProperty(this,"items",{get:()=>f,set:O=>{f=O!==null&&typeof O<"u"&&(Array.isArray(O)||typeof O=="object")?this.reactive(O):O,this.scheduleRerender()},enumerable:!0,configurable:!0})}render(){return this.ordered?L.jsx("ol",{class:"marked-list"},this.items.map((e,r)=>L.jsx("li",{key:r,class:"marked-list-item"},e))):L.jsx("ul",{class:"marked-list"},this.items.map((e,r)=>L.jsx("li",{key:r,class:"marked-list-item"},e)))}}Oe=mt;[exports.List,Ae]=ft(Oe,[],Re,0,void 0,L.LightComponent).c;Ae();var De;let ze,Ne;function ht(t,e,r){return(e=He(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pt(t,e,r,f,O,q){function T(o,a,l){return function(n,s){return l&&l(n),o[a].call(n,s)}}function N(o,a){for(var l=0;l<o.length;l++)o[l].call(a);return a}function _(o,a,l,n){if(typeof o!="function"&&(n||o!==void 0))throw new TypeError(a+" must "+(l||"be")+" a function"+(n?"":" or undefined"));return o}function P(o,a,l,n,s,S,$,w,R,b,y,g,m){function p(u){if(!m(u))throw new TypeError("Attempted to access private element on non-instance")}var c,v=a[0],x=a[3],E=!w;if(!E){l||Array.isArray(v)||(v=[v]);var i={},k=[],h=s===3?"get":s===4||g?"set":"value";b?(y||g?i={get:me(function(){return x(this)},n,"get"),set:function(u){a[4](this,u)}}:i[h]=x,y||me(i[h],n,s===2?"":h)):y||(i=Object.getOwnPropertyDescriptor(o,n))}for(var d=o,M=v.length-1;M>=0;M-=l?2:1){var K=v[M],B=l?v[M-1]:void 0,W={},C={kind:["field","accessor","method","getter","setter","class"][s],name:n,metadata:S,addInitializer:(function(u,j){if(u.v)throw te("attempted to call addInitializer after decoration was finished");_(j,"An initializer","be",!0),$.push(j)}).bind(null,W)};try{if(E)(c=_(K.call(B,d,C),"class decorators","return"))&&(d=c);else{var I,D;C.static=R,C.private=b,b?s===2?I=function(u){return p(u),i.value}:(s<4&&(I=T(i,"get",p)),s!==3&&(D=T(i,"set",p))):(I=function(u){return u[n]},(s<2||s===4)&&(D=function(u,j){u[n]=j}));var G=C.access={has:b?m.bind():function(u){return n in u}};if(I&&(G.get=I),D&&(G.set=D),d=K.call(B,g?{get:i.get,set:i.set}:i[h],C),g){if(typeof d=="object"&&d)(c=_(d.get,"accessor.get"))&&(i.get=c),(c=_(d.set,"accessor.set"))&&(i.set=c),(c=_(d.init,"accessor.init"))&&k.push(c);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else _(d,(y?"field":"method")+" decorators","return")&&(y?k.push(d):i[h]=d)}}finally{W.v=!0}}return(y||g)&&w.push(function(u,j){for(var z=k.length-1;z>=0;z--)j=k[z].call(u,j);return j}),y||E||(b?g?w.push(T(i,"get"),T(i,"set")):w.push(s===2?i[h]:T.call.bind(i[h])):Object.defineProperty(o,n,i)),d}function H(o,a){return Object.defineProperty(o,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:a})}if(arguments.length>=6)var U=q[Symbol.metadata||Symbol.for("Symbol.metadata")];var A=Object.create(U??null),X=function(o,a,l,n){var s,S,$=[],w=function(h){return vt(h)===o},R=new Map;function b(h){h&&$.push(N.bind(null,h))}for(var y=0;y<a.length;y++){var g=a[y];if(Array.isArray(g)){var m=g[1],p=g[2],c=g.length>3,v=16&m,x=!!(8&m),E=(m&=7)==0,i=p+"/"+x;if(!E&&!c){var k=R.get(i);if(k===!0||k===3&&m!==4||k===4&&m!==3)throw te("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);R.set(i,!(m>2)||m)}P(x?o:o.prototype,g,v,c?"#"+p:He(p),m,n,x?S=S||[]:s=s||[],$,x,c,E,m===1,x&&c?w:l)}}return b(s),b(S),$}(t,e,O,A);return r.length||H(t,A),{e:X,get c(){var o=[];return r.length&&[H(P(t,[r],f,t.name,5,A,o),A),N.bind(null,o,t)]}}}function He(t){var e=yt(t,"string");return typeof e=="symbol"?e:e+""}function yt(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var f=r.call(t,e);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function me(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function vt(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}Ne=[L.autoRegister({tagName:"wsx-marked-error"})];exports.Error=void 0;let te=class extends L.LightComponent{constructor(){super({styleName:"wsx-marked-error"}),ht(this,"message","")}static get observedAttributes(){return["message"]}attributeChangedCallback(e,r,f){e==="message"&&(this.message=f||"",this.rerender())}render(){return L.jsx("div",{class:"error"},this.message)}};De=te;[exports.Error,ze]=pt(De,[],Ne,0,void 0,L.LightComponent).c;ze();var bt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qe={exports:{}};(function(t){(function(e,r){t.exports?t.exports=r():e.log=r()})(bt,function(){var e=function(){},r="undefined",f=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),O=["trace","debug","info","warn","error"],q={},T=null;function N(a,l){var n=a[l];if(typeof n.bind=="function")return n.bind(a);try{return Function.prototype.bind.call(n,a)}catch{return function(){return Function.prototype.apply.apply(n,[a,arguments])}}}function _(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function P(a){return a==="debug"&&(a="log"),typeof console===r?!1:a==="trace"&&f?_:console[a]!==void 0?N(console,a):console.log!==void 0?N(console,"log"):e}function H(){for(var a=this.getLevel(),l=0;l<O.length;l++){var n=O[l];this[n]=l<a?e:this.methodFactory(n,a,this.name)}if(this.log=this.debug,typeof console===r&&a<this.levels.SILENT)return"No console available for logging"}function U(a){return function(){typeof console!==r&&(H.call(this),this[a].apply(this,arguments))}}function A(a,l,n){return P(a)||U.apply(this,arguments)}function X(a,l){var n=this,s,S,$,w="loglevel";typeof a=="string"?w+=":"+a:typeof a=="symbol"&&(w=void 0);function R(p){var c=(O[p]||"silent").toUpperCase();if(!(typeof window===r||!w)){try{window.localStorage[w]=c;return}catch{}try{window.document.cookie=encodeURIComponent(w)+"="+c+";"}catch{}}}function b(){var p;if(!(typeof window===r||!w)){try{p=window.localStorage[w]}catch{}if(typeof p===r)try{var c=window.document.cookie,v=encodeURIComponent(w),x=c.indexOf(v+"=");x!==-1&&(p=/^([^;]+)/.exec(c.slice(x+v.length+1))[1])}catch{}return n.levels[p]===void 0&&(p=void 0),p}}function y(){if(!(typeof window===r||!w)){try{window.localStorage.removeItem(w)}catch{}try{window.document.cookie=encodeURIComponent(w)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function g(p){var c=p;if(typeof c=="string"&&n.levels[c.toUpperCase()]!==void 0&&(c=n.levels[c.toUpperCase()]),typeof c=="number"&&c>=0&&c<=n.levels.SILENT)return c;throw new TypeError("log.setLevel() called with invalid level: "+p)}n.name=a,n.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},n.methodFactory=l||A,n.getLevel=function(){return $??S??s},n.setLevel=function(p,c){return $=g(p),c!==!1&&R($),H.call(n)},n.setDefaultLevel=function(p){S=g(p),b()||n.setLevel(p,!1)},n.resetLevel=function(){$=null,y(),H.call(n)},n.enableAll=function(p){n.setLevel(n.levels.TRACE,p)},n.disableAll=function(p){n.setLevel(n.levels.SILENT,p)},n.rebuild=function(){if(T!==n&&(s=g(T.getLevel())),H.call(n),T===n)for(var p in q)q[p].rebuild()},s=g(T?T.getLevel():"WARN");var m=b();m!=null&&($=g(m)),H.call(n)}T=new X,T.getLogger=function(l){if(typeof l!="symbol"&&typeof l!="string"||l==="")throw new TypeError("You must supply a name when creating a logger.");var n=q[l];return n||(n=q[l]=new X(l,T.methodFactory)),n};var o=typeof window!==r?window.log:void 0;return T.noConflict=function(){return typeof window!==r&&window.log===T&&(window.log=o),T},T.getLoggers=function(){return q},T.default=T,T})})(qe);var kt=qe.exports;const jt=xt(kt),Pe={trace:"trace",debug:"debug",info:"info",warn:"warn",error:"error",silent:"silent"},Tt={0:"trace",1:"debug",2:"info",3:"warn",4:"error",5:"silent"};function re(){var t,e;if(typeof process<"u")return process.env.NODE_ENV==="production"||process.env.MODE==="production";try{const r=globalThis;if((e=(t=r.import)==null?void 0:t.meta)!=null&&e.env){const f=r.import.meta.env;return f.MODE==="production"||f.PROD===!0}}catch{}return!1}const Y={name:"WSX",level:re()?"info":"debug",pretty:!re()};function wt(t={}){const{name:e,level:r}={...Y,...t},f=e||Y.name,O=jt.getLogger(f),q=r||Y.level;return O.setLevel(Pe[q]),O}function F(t,e){return t?`[${t}] ${e}`:e}class Ue{constructor(e={}){this.isProd=re(),this.name=e.name||Y.name,this.currentLevel=e.level||Y.level,this.logInstance=wt(e)}debug(e,...r){if(!this.isProd||this.shouldLog("debug")){const f=F(this.name,e);r.length>0?this.logInstance.debug(f,...r):this.logInstance.debug(f)}}info(e,...r){if(this.shouldLog("info")){const f=F(this.name,e);r.length>0?this.logInstance.info(f,...r):this.logInstance.info(f)}}warn(e,...r){const f=F(this.name,e);r.length>0?this.logInstance.warn(f,...r):this.logInstance.warn(f)}error(e,...r){const f=F(this.name,e);r.length>0?this.logInstance.error(f,...r):this.logInstance.error(f)}fatal(e,...r){const f=F(this.name,e);r.length>0?this.logInstance.error(`[FATAL] ${f}`,...r):this.logInstance.error(`[FATAL] ${f}`)}trace(e,...r){if(!this.isProd||this.shouldLog("trace")){const f=F(this.name,e);r.length>0?this.logInstance.trace(f,...r):this.logInstance.trace(f)}}shouldLog(e){const r=["trace","debug","info","warn","error","silent"],f=r.indexOf(this.currentLevel);return r.indexOf(e)>=f}getLoglevelLogger(){return this.logInstance}setLevel(e){this.currentLevel=e,this.logInstance.setLevel(Pe[e])}getLevel(){const e=this.logInstance.getLevel();return Tt[e]||this.currentLevel}}new Ue;function _t(t,e={}){return new Ue({...e,name:e.name||`WSX:${t}`})}function ne(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function Lt(t){if(!t||!Array.isArray(t))return[];const e=[];return t.forEach(r=>{if(r.type==="paragraph"){const f=r;f.tokens&&Array.isArray(f.tokens)&&e.push(...f.tokens)}else(r.type==="text"||r.type==="strong"||r.type==="em"||r.type==="link"||r.type==="code"||r.type==="br")&&e.push(r)}),e}function J(t){return!t||!Array.isArray(t)?"":t.map(e=>{switch(e.type){case"text":return e.text||"";case"strong":{const r=e,f=r.tokens&&Array.isArray(r.tokens)?r.tokens:[];return`<strong>${J(f)}</strong>`}case"em":{const r=e,f=r.tokens&&Array.isArray(r.tokens)?r.tokens:[];return`<em>${J(f)}</em>`}case"link":{const r=e,f=r.title?` title="${ne(r.title)}"`:"",O=r.tokens&&Array.isArray(r.tokens)?r.tokens:[];return`<a href="${r.href||"#"}"${f}>${J(O)}</a>`}case"code":return`<code>${ne(e.text||"")}</code>`;case"br":return"<br>";default:return""}}).join("")}const Et="wsx-markdown{display:block}.marked-content{line-height:1.7;color:var(--text-primary, #2c3e50)}.marked-content .marked-paragraph{margin:1rem 0;line-height:1.7}.marked-content .marked-list{margin:1rem 0;padding-left:2rem}.marked-content .marked-list-item{margin:.5rem 0;line-height:1.6}.marked-content a{color:var(--primary-red, #dc2626);text-decoration:none;border-bottom:1px solid transparent;transition:border-color .2s ease}.marked-content a:hover{border-bottom-color:var(--primary-red, #dc2626)}.marked-content strong{font-weight:600;color:var(--text-primary, #2c3e50)}.marked-content em{font-style:italic}.marked-content hr{border:none;border-top:2px solid var(--border-color, #e0e0e0);margin:2rem 0}.marked-content img{max-width:100%;height:auto;border-radius:8px;margin:1rem 0}.error{color:#dc2626;padding:1rem;background:#fee2e2;border-radius:6px;border:1px solid #fecaca}";var Ke;let Be,We;function Z(t,e,r){return(e=Ge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $t(t,e,r,f,O,q){function T(o,a,l){return function(n,s){return l&&l(n),o[a].call(n,s)}}function N(o,a){for(var l=0;l<o.length;l++)o[l].call(a);return a}function _(o,a,l,n){if(typeof o!="function"&&(n||o!==void 0))throw new TypeError(a+" must "+(l||"be")+" a function"+(n?"":" or undefined"));return o}function P(o,a,l,n,s,S,$,w,R,b,y,g,m){function p(u){if(!m(u))throw new TypeError("Attempted to access private element on non-instance")}var c,v=a[0],x=a[3],E=!w;if(!E){l||Array.isArray(v)||(v=[v]);var i={},k=[],h=s===3?"get":s===4||g?"set":"value";b?(y||g?i={get:he(function(){return x(this)},n,"get"),set:function(u){a[4](this,u)}}:i[h]=x,y||he(i[h],n,s===2?"":h)):y||(i=Object.getOwnPropertyDescriptor(o,n))}for(var d=o,M=v.length-1;M>=0;M-=l?2:1){var K=v[M],B=l?v[M-1]:void 0,W={},C={kind:["field","accessor","method","getter","setter","class"][s],name:n,metadata:S,addInitializer:(function(u,j){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");_(j,"An initializer","be",!0),$.push(j)}).bind(null,W)};try{if(E)(c=_(K.call(B,d,C),"class decorators","return"))&&(d=c);else{var I,D;C.static=R,C.private=b,b?s===2?I=function(u){return p(u),i.value}:(s<4&&(I=T(i,"get",p)),s!==3&&(D=T(i,"set",p))):(I=function(u){return u[n]},(s<2||s===4)&&(D=function(u,j){u[n]=j}));var G=C.access={has:b?m.bind():function(u){return n in u}};if(I&&(G.get=I),D&&(G.set=D),d=K.call(B,g?{get:i.get,set:i.set}:i[h],C),g){if(typeof d=="object"&&d)(c=_(d.get,"accessor.get"))&&(i.get=c),(c=_(d.set,"accessor.set"))&&(i.set=c),(c=_(d.init,"accessor.init"))&&k.push(c);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else _(d,(y?"field":"method")+" decorators","return")&&(y?k.push(d):i[h]=d)}}finally{W.v=!0}}return(y||g)&&w.push(function(u,j){for(var z=k.length-1;z>=0;z--)j=k[z].call(u,j);return j}),y||E||(b?g?w.push(T(i,"get"),T(i,"set")):w.push(s===2?i[h]:T.call.bind(i[h])):Object.defineProperty(o,n,i)),d}function H(o,a){return Object.defineProperty(o,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:a})}if(arguments.length>=6)var U=q[Symbol.metadata||Symbol.for("Symbol.metadata")];var A=Object.create(U??null),X=function(o,a,l,n){var s,S,$=[],w=function(h){return Ct(h)===o},R=new Map;function b(h){h&&$.push(N.bind(null,h))}for(var y=0;y<a.length;y++){var g=a[y];if(Array.isArray(g)){var m=g[1],p=g[2],c=g.length>3,v=16&m,x=!!(8&m),E=(m&=7)==0,i=p+"/"+x;if(!E&&!c){var k=R.get(i);if(k===!0||k===3&&m!==4||k===4&&m!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);R.set(i,!(m>2)||m)}P(x?o:o.prototype,g,v,c?"#"+p:Ge(p),m,n,x?S=S||[]:s=s||[],$,x,c,E,m===1,x&&c?w:l)}}return b(s),b(S),$}(t,e,O,A);return r.length||H(t,A),{e:X,get c(){var o=[];return r.length&&[H(P(t,[r],f,t.name,5,A,o),A),N.bind(null,o,t)]}}}function Ge(t){var e=St(t,"string");return typeof e=="symbol"?e:e+""}function St(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var f=r.call(t,e);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function he(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function Ct(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}const ee=_t("Markdown");We=[L.autoRegister({tagName:"wsx-markdown"})];exports.Markdown=void 0;class It extends L.LightComponent{constructor(){super(),Z(this,"_autoStyles",Et),Z(this,"markdown",void 0),Z(this,"customRenderers",{});const[e,r]=this.useState("markdown","");Object.defineProperty(this,"markdown",{get:e,set:r,enumerable:!0,configurable:!0})}setCustomRenderers(e){this.customRenderers={...this.customRenderers,...e},this.rerender()}getCustomRenderers(){return{...this.customRenderers}}render(){if(!this.markdown)return L.jsx("div",{class:"marked-content"});try{const e=oe.marked.lexer(this.markdown);return L.jsx("div",{class:"marked-content"},this.renderTokens(e))}catch(e){return ee.error("Failed to render markdown",e),L.jsx("div",{class:"marked-content"},L.jsx("wsx-marked-error",{message:`Error: ${e}`}))}}renderTokens(e){return e.map(r=>this.renderToken(r)).filter(r=>r!==null)}renderToken(e){const r=this.customRenderers[e.type];if(r){const f=r(e,()=>this.defaultRenderToken(e));if(f!==null)return f}return this.defaultRenderToken(e)}defaultRenderToken(e){switch(e.type){case"heading":{const r=e;return L.jsx("wsx-marked-heading",{level:r.depth.toString(),text:J(r.tokens)})}case"code":{const r=e;return L.jsx("wsx-marked-code",{code:r.text,language:r.lang||""})}case"blockquote":{const r=e;return L.jsx("wsx-marked-blockquote",null,this.renderTokens(r.tokens))}case"paragraph":{const r=e;return L.jsx("wsx-marked-paragraph",{content:J(r.tokens)})}case"list":{const r=e,f=r.items.map(O=>{if(!O.tokens||!Array.isArray(O.tokens))return ee.warn("List item has no tokens or tokens is not an array",{item:O}),"";const q=this.renderTokens(O.tokens);if(q.length===0)return"";const T=document.createElement("div");q.forEach(_=>{_&&T.appendChild(_)});const N=T.innerHTML;return N||ee.warn("tempContainer.innerHTML is empty after appending elements",{renderedElementsCount:q.length,itemTokens:O.tokens}),N});return L.jsx("wsx-marked-list",{ordered:r.ordered?"true":"false",items:f})}case"html":{const r=e;return L.jsx("div",null,r.text)}case"hr":return L.jsx("hr",null);case"space":return null;case"text":{const r=e;return L.jsx("span",null,r.text||"")}default:{const f=new oe.marked.Renderer()[e.type],O=(f==null?void 0:f(e))||"";return O?L.jsx("div",null,O):null}}}}Ke=It;[exports.Markdown,Be]=$t(Ke,[],We,0,void 0,L.LightComponent).c;Be();exports.escapeHtml=ne;exports.extractInlineTokens=Lt;exports.renderInlineTokens=J;
|