@cas-smartdesign/element-preview 0.2.1
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/LICENSE +8 -0
- package/dist/docs/doc.css +1 -0
- package/dist/docs/doc.mjs +328 -0
- package/dist/docs/example.js +2 -0
- package/dist/docs/index.html +26 -0
- package/dist/element-preview-with-externals.js +30 -0
- package/dist/element-preview-with-externals.js.map +7 -0
- package/dist/element-preview.d.ts +29 -0
- package/dist/element-preview.mjs +2820 -0
- package/dist/element-preview.mjs.map +1 -0
- package/npm-third-party-licenses.json +187 -0
- package/package.json +33 -0
- package/readme.md +149 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";var window;(window||={})["@cas-smartdesign/element-preview"]=(()=>{var pi=Object.create;var De=Object.defineProperty;var gi=Object.getOwnPropertyDescriptor;var mi=Object.getOwnPropertyNames;var bi=Object.getPrototypeOf,wi=Object.prototype.hasOwnProperty;var E=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),yi=(n,e)=>{for(var t in e)De(n,t,{get:e[t],enumerable:!0})},tr=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of mi(e))!wi.call(n,i)&&i!==t&&De(n,i,{get:()=>e[i],enumerable:!(r=gi(e,i))||r.enumerable});return n};var rr=(n,e,t)=>(t=n!=null?pi(bi(n)):{},tr(e||!n||!n.__esModule?De(t,"default",{value:n,enumerable:!0}):t,n)),xi=n=>tr(De({},"__esModule",{value:!0}),n);var ir=E((Jo,bt)=>{var k=String,nr=function(){return{isColorSupported:!1,reset:k,bold:k,dim:k,italic:k,underline:k,inverse:k,hidden:k,strikethrough:k,black:k,red:k,green:k,yellow:k,blue:k,magenta:k,cyan:k,white:k,gray:k,bgBlack:k,bgRed:k,bgGreen:k,bgYellow:k,bgBlue:k,bgMagenta:k,bgCyan:k,bgWhite:k}};bt.exports=nr();bt.exports.createColors=nr});var wt=E(()=>{});var qe=E((el,lr)=>{"use strict";var sr=ir(),or=wt(),ge=class n extends Error{constructor(e,t,r,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=sr.isColorSupported),or&&e&&(t=or(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),s=String(o).length,l,a;if(e){let{bold:c,gray:h,red:w}=sr.createColors(!0);l=m=>c(w(m)),a=m=>h(m)}else l=a=c=>c;return r.slice(i,o).map((c,h)=>{let w=i+1+h,m=" "+(" "+w).slice(-s)+" | ";if(w===this.line){let _=a(m.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(m)+c+`
|
|
2
|
+
`+_+l("^")}return" "+a(m)+c}).join(`
|
|
3
|
+
`)}toString(){let e=this.showSourceCode();return e&&(e=`
|
|
4
|
+
|
|
5
|
+
`+e+`
|
|
6
|
+
`),this.name+": "+this.message+e}};lr.exports=ge;ge.default=ge});var Fe=E((tl,yt)=>{"use strict";yt.exports.isClean=Symbol("isClean");yt.exports.my=Symbol("my")});var xt=E((rl,cr)=>{"use strict";var ar={after:`
|
|
7
|
+
`,beforeClose:`
|
|
8
|
+
`,beforeComment:`
|
|
9
|
+
`,beforeDecl:`
|
|
10
|
+
`,beforeOpen:" ",beforeRule:`
|
|
11
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Ei(n){return n[0].toUpperCase()+n.slice(1)}var me=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let o=(e.raws.between||"")+(t?";":"");this.builder(r+i+o,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let i=e.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`
|
|
12
|
+
`)){let s=this.raw(e,null,"indent");if(s.length)for(let l=0;l<o;l++)r+=s}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let i;e.nodes&&e.nodes.length?(this.body(e),i=this.raw(e,"after")):i=this.raw(e,"after","emptyBody"),i&&this.builder(i),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let o=e.nodes[i],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,t!==i||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),i=e.prop+r+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)}document(e){this.body(e)}raw(e,t,r){let i;if(r||(r=t),t&&(i=e.raws[t],typeof i<"u"))return i;let o=e.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return ar[r];let s=e.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[r]<"u")return s.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let l="raw"+Ei(r);this[l]?i=this[l](s,e):s.walk(a=>{if(i=a.raws[t],typeof i<"u")return!1})}return typeof i>"u"&&(i=ar[r]),s.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return t=r.raws.after,t.includes(`
|
|
13
|
+
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
|
|
14
|
+
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
|
|
15
|
+
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return t=r.raws.before,t.includes(`
|
|
16
|
+
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let i=r.parent;if(i&&i!==e&&i.parent&&i.parent===e&&typeof r.raws.before<"u"){let o=r.raws.before.split(`
|
|
17
|
+
`);return t=o[o.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let r=e[t],i=e.raws[t];return i&&i.value===r?i.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};cr.exports=me;me.default=me});var be=E((nl,ur)=>{"use strict";var Si=xt();function Et(n,e){new Si(e).stringify(n)}ur.exports=Et;Et.default=Et});var ye=E((il,hr)=>{"use strict";var{isClean:$e,my:vi}=Fe(),Oi=qe(),Ci=xt(),Ai=be();function St(n,e){let t=new n.constructor;for(let r in n){if(!Object.prototype.hasOwnProperty.call(n,r)||r==="proxyCache")continue;let i=n[r],o=typeof i;r==="parent"&&o==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(s=>St(s,t)):(o==="object"&&i!==null&&(i=St(i)),t[r]=i)}return t}var we=class{constructor(e={}){this.raws={},this[$e]=!1,this[vi]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=St(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new Oi(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[$e]){this[$e]=!1;let e=this;for(;e=e.parent;)e[$e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){t=this.toString();let i=t.indexOf(e.word);i!==-1&&(r=this.positionInside(i,t))}return r}positionInside(e,t){let r=t||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<e;s++)r[s]===`
|
|
18
|
+
`?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let i=this.toString(),o=i.indexOf(e.word);o!==-1&&(t=this.positionInside(o,i),r=this.positionInside(o+e.word.length,i))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return new Ci().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let i of e)i===this?r=!0:r?(this.parent.insertAfter(t,i),t=i):this.parent.insertBefore(t,i);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},i=t==null;t=t||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let l=this[s];if(Array.isArray(l))r[s]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)r[s]=l.toJSON(null,t);else if(s==="source"){let a=t.get(l.input);a==null&&(a=o,t.set(l.input,o),o++),r[s]={end:l.end,inputId:a,start:l.start}}else r[s]=l}return i&&(r.inputs=[...t.keys()].map(s=>s.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Ai){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let i={node:this};for(let o in r)i[o]=r[o];return e.warn(t,i)}get proxyOf(){return this}};hr.exports=we;we.default=we});var Ee=E((sl,fr)=>{"use strict";var ki=ye(),xe=class extends ki{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};fr.exports=xe;xe.default=xe});var He=E(()=>{});var We=E(()=>{});var vt=E(()=>{});var pr=E((fl,dr)=>{var _i="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Ri=(n,e=21)=>(t=e)=>{let r="",i=t;for(;i--;)r+=n[Math.random()*n.length|0];return r},Ni=(n=21)=>{let e="",t=n;for(;t--;)e+=_i[Math.random()*64|0];return e};dr.exports={nanoid:Ni,customAlphabet:Ri}});var gr=E(()=>{});var Ct=E((gl,wr)=>{"use strict";var{SourceMapConsumer:mr,SourceMapGenerator:br}=He(),{existsSync:Mi,readFileSync:Pi}=gr(),{dirname:Ot,join:Ii}=We();function Li(n){return Buffer?Buffer.from(n,"base64").toString():window.atob(n)}var Se=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,i=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Ot(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new mr(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(i.test(e)||o.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return Li(e.substr(RegExp.lastMatch.length));let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),i=e.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,i)))}loadFile(e){if(this.root=Ot(e),Mi(e))return this.mapFile=e,Pi(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(t instanceof mr)return br.fromSourceMap(t).toString();if(t instanceof br)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=Ii(Ot(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};wr.exports=Se;Se.default=Se});var ve=E((ml,Sr)=>{"use strict";var{SourceMapConsumer:Ti,SourceMapGenerator:ji}=He(),{fileURLToPath:yr,pathToFileURL:Ge}=vt(),{isAbsolute:_t,resolve:Rt}=We(),{nanoid:Bi}=pr(),At=wt(),xr=qe(),Ui=Ct(),kt=Symbol("fromOffsetCache"),zi=!!(Ti&&ji),Er=!!(Rt&&_t),le=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Er||/^\w+:\/\//.test(t.from)||_t(t.from)?this.file=t.from:this.file=Rt(t.from)),Er&&zi){let r=new Ui(this.css,t);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+Bi(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let o,s,l;if(t&&typeof t=="object"){let c=t,h=r;if(typeof c.offset=="number"){let w=this.fromOffset(c.offset);t=w.line,r=w.col}else t=c.line,r=c.column;if(typeof h.offset=="number"){let w=this.fromOffset(h.offset);s=w.line,l=w.col}else s=h.line,l=h.column}else if(!r){let c=this.fromOffset(t);t=c.line,r=c.col}let a=this.origin(t,r,s,l);return a?o=new xr(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,i.plugin):o=new xr(e,s===void 0?t:{column:r,line:t},s===void 0?r:{column:l,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:l,endLine:s,line:t,source:this.css},this.file&&(Ge&&(o.input.url=Ge(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[kt])r=this[kt];else{let o=this.css.split(`
|
|
19
|
+
`);r=new Array(o.length);let s=0;for(let l=0,a=o.length;l<a;l++)r[l]=s,s+=o[l].length+1;this[kt]=r}t=r[r.length-1];let i=0;if(e>=t)i=r.length-1;else{let o=r.length-2,s;for(;i<o;)if(s=i+(o-i>>1),e<r[s])o=s-1;else if(e>=r[s+1])i=s+1;else{i=s;break}}return{col:e-r[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Rt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:t,line:e});if(!s.source)return!1;let l;typeof r=="number"&&(l=o.originalPositionFor({column:i,line:r}));let a;_t(s.source)?a=Ge(s.source):a=new URL(s.source,this.map.consumer().sourceRoot||Ge(this.map.mapFile));let c={column:s.column,endColumn:l&&l.column,endLine:l&&l.line,line:s.line,url:a.toString()};if(a.protocol==="file:")if(yr)c.file=yr(a);else throw new Error("file: protocol is not available in this PostCSS build");let h=o.sourceContentFor(s.source);return h&&(c.source=h),c}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};Sr.exports=le;le.default=le;At&&At.registerInput&&At.registerInput(le)});var Mt=E((bl,_r)=>{"use strict";var{SourceMapConsumer:Or,SourceMapGenerator:Ze}=He(),{dirname:Ve,relative:Cr,resolve:Ar,sep:kr}=We(),{pathToFileURL:vr}=vt(),Di=ve(),qi=!!(Or&&Ze),Fi=!!(Ve&&Ar&&Cr&&kr),Nt=class{constructor(e,t,r,i){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
|
|
20
|
+
`;this.css.includes(`\r
|
|
21
|
+
`)&&(t=`\r
|
|
22
|
+
`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Ve(e.file),i;this.mapOpts.sourcesContent===!1?(i=new Or(e.text),i.sourcesContent&&(i.sourcesContent=i.sourcesContent.map(()=>null))):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/(\n)?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Fi&&qi&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Ze.fromSourceMap(e)}else this.map=new Ze({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Ze({file:this.outputFile()});let e=1,t=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(l,a,c)=>{if(this.css+=l,a&&c!=="end"&&(i.generated.line=e,i.generated.column=t-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=l.match(/\n/g),o?(e+=o.length,s=l.lastIndexOf(`
|
|
23
|
+
`),t=l.length-s):t+=l.length,a&&c!=="start"){let h=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==h.last||h.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Ve(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Ve(Ar(r,this.mapOpts.annotation)));let i=Cr(r,e);return this.memoizedPaths.set(e,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Di(this.css,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(vr){let r=vr(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;kr==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};_r.exports=Nt});var Ce=E((wl,Rr)=>{"use strict";var $i=ye(),Oe=class extends $i{constructor(e){super(e),this.type="comment"}};Rr.exports=Oe;Oe.default=Oe});var V=E((yl,Ur)=>{"use strict";var{isClean:Nr,my:Mr}=Fe(),Pr=Ee(),Ir=Ce(),Hi=ye(),Lr,Pt,It,Tr;function jr(n){return n.map(e=>(e.nodes&&(e.nodes=jr(e.nodes)),delete e.source,e))}function Br(n){if(n[Nr]=!1,n.proxyOf.nodes)for(let e of n.proxyOf.nodes)Br(e)}var U=class n extends Hi{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,i;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[t]+=1;return delete this.indexes[t],i}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):t==="every"||t==="some"?r=>e[t]((i,...o)=>r(i.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let s of i)this.proxyOf.nodes.splice(r+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],r<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),i=r===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let l of o)this.proxyOf.nodes.splice(r,0,l);let s;for(let l in this.indexes)s=this.indexes[l],r<=s&&(this.indexes[l]=s+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=jr(Lr(e).nodes);else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Pr(e)]}else if(e.selector)e=[new Pt(e)];else if(e.name)e=[new It(e)];else if(e.text)e=[new Ir(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[Mr]||n.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Nr]&&Br(i),typeof i.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(i.raws.before=t.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let i;try{i=e(t,r)}catch(o){throw t.addToError(o)}return i!==!1&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="atrule")return t(r,i)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="decl")return t(r,i)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="rule")return t(r,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};U.registerParse=n=>{Lr=n};U.registerRule=n=>{Pt=n};U.registerAtRule=n=>{It=n};U.registerRoot=n=>{Tr=n};Ur.exports=U;U.default=U;U.rebuild=n=>{n.type==="atrule"?Object.setPrototypeOf(n,It.prototype):n.type==="rule"?Object.setPrototypeOf(n,Pt.prototype):n.type==="decl"?Object.setPrototypeOf(n,Pr.prototype):n.type==="comment"?Object.setPrototypeOf(n,Ir.prototype):n.type==="root"&&Object.setPrototypeOf(n,Tr.prototype),n[Mr]=!0,n.nodes&&n.nodes.forEach(e=>{U.rebuild(e)})}});var Ke=E((xl,qr)=>{"use strict";var Wi=V(),zr,Dr,re=class extends Wi{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new zr(new Dr,this,e).stringify()}};re.registerLazyResult=n=>{zr=n};re.registerProcessor=n=>{Dr=n};qr.exports=re;re.default=re});var Lt=E((El,$r)=>{"use strict";var Fr={};$r.exports=function(e){Fr[e]||(Fr[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))}});var Tt=E((Sl,Hr)=>{"use strict";var Ae=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};Hr.exports=Ae;Ae.default=Ae});var Qe=E((vl,Wr)=>{"use strict";var Gi=Tt(),ke=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Gi(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};Wr.exports=ke;ke.default=ke});var Vr=E((Ol,Zr)=>{"use strict";var Je=/[\t\n\f\r "#'()/;[\\\]{}]/g,Xe=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Zi=/.[\r\n"'(/\\]/,Gr=/[\da-f]/i;Zr.exports=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,o,s,l,a,c,h,w,m,_,N,j=r.length,g=0,$=[],H=[];function X(){return g}function B(z){throw e.error("Unclosed "+z,g)}function W(){return H.length===0&&g>=j}function pe(z){if(H.length)return H.pop();if(g>=j)return;let I=z?z.ignoreUnclosed:!1;switch(o=r.charCodeAt(g),o){case 10:case 32:case 9:case 13:case 12:{s=g;do s+=1,o=r.charCodeAt(s);while(o===32||o===10||o===9||o===13||o===12);N=["space",r.slice(g,s)],g=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let Y=String.fromCharCode(o);N=[Y,Y,g];break}case 40:{if(m=$.length?$.pop()[1]:"",_=r.charCodeAt(g+1),m==="url"&&_!==39&&_!==34&&_!==32&&_!==10&&_!==9&&_!==12&&_!==13){s=g;do{if(h=!1,s=r.indexOf(")",s+1),s===-1)if(i||I){s=g;break}else B("bracket");for(w=s;r.charCodeAt(w-1)===92;)w-=1,h=!h}while(h);N=["brackets",r.slice(g,s+1),g,s],g=s}else s=r.indexOf(")",g+1),a=r.slice(g,s+1),s===-1||Zi.test(a)?N=["(","(",g]:(N=["brackets",a,g,s],g=s);break}case 39:case 34:{l=o===39?"'":'"',s=g;do{if(h=!1,s=r.indexOf(l,s+1),s===-1)if(i||I){s=g+1;break}else B("string");for(w=s;r.charCodeAt(w-1)===92;)w-=1,h=!h}while(h);N=["string",r.slice(g,s+1),g,s],g=s;break}case 64:{Je.lastIndex=g+1,Je.test(r),Je.lastIndex===0?s=r.length-1:s=Je.lastIndex-2,N=["at-word",r.slice(g,s+1),g,s],g=s;break}case 92:{for(s=g,c=!0;r.charCodeAt(s+1)===92;)s+=1,c=!c;if(o=r.charCodeAt(s+1),c&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(s+=1,Gr.test(r.charAt(s)))){for(;Gr.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===32&&(s+=1)}N=["word",r.slice(g,s+1),g,s],g=s;break}default:{o===47&&r.charCodeAt(g+1)===42?(s=r.indexOf("*/",g+2)+1,s===0&&(i||I?s=r.length:B("comment")),N=["comment",r.slice(g,s+1),g,s],g=s):(Xe.lastIndex=g+1,Xe.test(r),Xe.lastIndex===0?s=r.length-1:s=Xe.lastIndex-2,N=["word",r.slice(g,s+1),g,s],$.push(N),g=s);break}}return g++,N}function oe(z){H.push(z)}return{back:oe,endOfFile:W,nextToken:pe,position:X}}});var Ye=E((Cl,Qr)=>{"use strict";var Kr=V(),ae=class extends Kr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};Qr.exports=ae;ae.default=ae;Kr.registerAtRule(ae)});var ce=E((Al,en)=>{"use strict";var Jr=V(),Xr,Yr,K=class extends Jr{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let i=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of i)o.raws.before=t.raws.before}return i}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Xr(new Yr,this,e).stringify()}};K.registerLazyResult=n=>{Xr=n};K.registerProcessor=n=>{Yr=n};en.exports=K;K.default=K;Jr.registerRoot(K)});var jt=E((kl,tn)=>{"use strict";var _e={comma(n){return _e.split(n,[","],!0)},space(n){let e=[" ",`
|
|
24
|
+
`," "];return _e.split(n,e)},split(n,e,t){let r=[],i="",o=!1,s=0,l=!1,a="",c=!1;for(let h of n)c?c=!1:h==="\\"?c=!0:l?h===a&&(l=!1):h==='"'||h==="'"?(l=!0,a=h):h==="("?s+=1:h===")"?s>0&&(s-=1):s===0&&e.includes(h)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=h;return(t||i!=="")&&r.push(i.trim()),r}};tn.exports=_e;_e.default=_e});var et=E((_l,nn)=>{"use strict";var rn=V(),Vi=jt(),ue=class extends rn{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Vi.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};nn.exports=ue;ue.default=ue;rn.registerRule(ue)});var an=E((Rl,ln)=>{"use strict";var Ki=Ee(),Qi=Vr(),Ji=Ce(),Xi=Ye(),Yi=ce(),sn=et(),on={empty:!0,space:!0};function es(n){for(let e=n.length-1;e>=0;e--){let t=n[e],r=t[3]||t[2];if(r)return r}}var Bt=class{constructor(e){this.input=e,this.root=new Yi,this.current=this.root,this.spaces="",this.semicolon=!1,this.customProperty=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new Xi;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,o,s=!1,l=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?c.push(r==="("?")":"]"):r==="{"&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),c.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(o=a.length-1,i=a[o];i&&i[0]==="space";)i=a[--o];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),s&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let o=t-1;o>=0&&(i=e[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,o;for(let[s,l]of e.entries()){if(r=l,i=r[0],i==="("&&(t+=1),i===")"&&(t-=1),t===0&&i===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=r}return!1}comment(e){let t=new Ji;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=Qi(this.input)}decl(e,t){let r=new Ki;this.init(r,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||es(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let c=e[0][0];if(c===":"||c==="space"||c==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let o;for(;e.length;)if(o=e.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let s=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)s.push(e.shift());this.precheckMissedSemicolon(e);for(let c=e.length-1;c>=0;c--){if(o=e[c],o[1].toLowerCase()==="!important"){r.important=!0;let h=this.stringFrom(e,c);h=this.spacesFromEnd(e)+h,h!==" !important"&&(r.raws.important=h);break}else if(o[1].toLowerCase()==="important"){let h=e.slice(0),w="";for(let m=c;m>0;m--){let _=h[m][0];if(w.trim().indexOf("!")===0&&_!=="space")break;w=h.pop()[1]+w}w.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=w,e=h)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(c=>c[0]!=="space"&&c[0]!=="comment")&&(r.raws.between+=s.map(c=>c[1]).join(""),s=[]),this.raw(r,"value",s.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new sn;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,i=!1,o=null,s=[],l=e[1].startsWith("--"),a=[],c=e;for(;c;){if(r=c[0],a.push(c),r==="("||r==="[")o||(o=c),s.push(r==="("?")":"]");else if(l&&i&&r==="{")o||(o=c),s.push("}");else if(s.length===0)if(r===";")if(i){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(i=!0);else r===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),s.length>0&&this.unclosedBracket(o),t&&i){if(!l)for(;a.length&&(c=a[a.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,i){let o,s,l=r.length,a="",c=!0,h,w;for(let m=0;m<l;m+=1)o=r[m],s=o[0],s==="space"&&m===l-1&&!i?c=!1:s==="comment"?(w=r[m-1]?r[m-1][0]:"empty",h=r[m+1]?r[m+1][0]:"empty",!on[w]&&!on[h]?a.slice(-1)===","?c=!1:a+=o[1]:c=!1):a+=o[1];if(!c){let m=r.reduce((_,N)=>_+N[1],"");e.raws[t]={raw:m,value:a}}e[t]=a}rule(e){e.pop();let t=new sn;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let i=t;i<e.length;i++)r+=e[i][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};ln.exports=Bt});var rt=E((Nl,cn)=>{"use strict";var ts=V(),rs=an(),ns=ve();function tt(n,e){let t=new ns(n,e),r=new rs(t);try{r.parse()}catch(i){throw i}return r.root}cn.exports=tt;tt.default=tt;ts.registerParse(tt)});var Dt=E((Pl,dn)=>{"use strict";var{isClean:F,my:is}=Fe(),ss=Mt(),os=be(),ls=V(),as=Ke(),Ml=Lt(),un=Qe(),cs=rt(),us=ce(),hs={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},fs={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},ds={Once:!0,postcssPlugin:!0,prepare:!0},he=0;function Re(n){return typeof n=="object"&&typeof n.then=="function"}function fn(n){let e=!1,t=hs[n.type];return n.type==="decl"?e=n.prop.toLowerCase():n.type==="atrule"&&(e=n.name.toLowerCase()),e&&n.append?[t,t+"-"+e,he,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:n.append?[t,he,t+"Exit"]:[t,t+"Exit"]}function hn(n){let e;return n.type==="document"?e=["Document",he,"DocumentExit"]:n.type==="root"?e=["Root",he,"RootExit"]:e=fn(n),{eventIndex:0,events:e,iterator:0,node:n,visitorIndex:0,visitors:[]}}function Ut(n){return n[F]=!1,n.nodes&&n.nodes.forEach(e=>Ut(e)),n}var zt={},Q=class n{constructor(e,t,r){this.stringified=!1,this.processed=!1;let i;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))i=Ut(t);else if(t instanceof n||t instanceof un)i=Ut(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let o=cs;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(t,r)}catch(s){this.processed=!0,this.error=s}i&&!i[is]&&ls.rebuild(i)}this.result=new un(e,i,r),this.helpers={...zt,postcss:zt,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(t,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,i])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!fs[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ds[r])if(typeof t[r]=="object")for(let i in t[r])i==="*"?e(t,r,t[r][i]):e(t,r+"-"+i.toLowerCase(),t[r][i]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(Re(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[F];){e[F]=!0;let t=[hn(e)];for(;t.length>0;){let r=this.visitTick(t);if(Re(r))try{await r}catch(i){let o=t[t.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let i=e.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return Re(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=os;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new ss(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(Re(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[F];)e[F]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let o;try{o=i(t,this.helpers)}catch(s){throw this.handleError(s,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(Re(o))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:i}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&t.visitorIndex<i.length){let[s,l]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=s;try{return l(r.toProxy(),this.helpers)}catch(a){throw this.handleError(a,r)}}if(t.iterator!==0){let s=t.iterator,l;for(;l=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!l[F]){l[F]=!0,e.push(hn(l));return}t.iterator=0,delete r.indexes[s]}let o=t.events;for(;t.eventIndex<o.length;){let s=o[t.eventIndex];if(t.eventIndex+=1,s===he){r.nodes&&r.nodes.length&&(r[F]=!0,t.iterator=r.getIterator());return}else if(this.listeners[s]){t.visitors=this.listeners[s];return}}e.pop()}walkSync(e){e[F]=!0;let t=fn(e);for(let r of t)if(r===he)e.nodes&&e.each(i=>{i[F]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Q.registerPostcss=n=>{zt=n};dn.exports=Q;Q.default=Q;us.registerLazyResult(Q);as.registerLazyResult(Q)});var gn=E((Ll,pn)=>{"use strict";var ps=Mt(),gs=be(),Il=Lt(),ms=rt(),bs=Qe(),Ne=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i,o=gs;this.result=new bs(this._processor,i,this._opts),this.result.css=t;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let l=new ps(o,i,this._opts,t);if(l.isMap()){let[a,c]=l.generate();a&&(this.result.css=a),c&&(this.result.map=c)}}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=ms;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};pn.exports=Ne;Ne.default=Ne});var bn=E((Tl,mn)=>{"use strict";var ws=gn(),ys=Dt(),xs=Ke(),Es=ce(),ne=class{constructor(e=[]){this.version="8.4.32",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length===0&&typeof t.parser>"u"&&typeof t.stringifier>"u"&&typeof t.syntax>"u"?new ws(this,e,t):new ys(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};mn.exports=ne;ne.default=ne;Es.registerProcessor(ne);xs.registerProcessor(ne)});var yn=E((jl,wn)=>{"use strict";var Ss=Ee(),vs=Ct(),Os=Ce(),Cs=Ye(),As=ve(),ks=ce(),_s=et();function Me(n,e){if(Array.isArray(n))return n.map(i=>Me(i));let{inputs:t,...r}=n;if(t){e=[];for(let i of t){let o={...i,__proto__:As.prototype};o.map&&(o.map={...o.map,__proto__:vs.prototype}),e.push(o)}}if(r.nodes&&(r.nodes=n.nodes.map(i=>Me(i,e))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=e[i])}if(r.type==="root")return new ks(r);if(r.type==="decl")return new Ss(r);if(r.type==="rule")return new _s(r);if(r.type==="comment")return new Os(r);if(r.type==="atrule")return new Cs(r);throw new Error("Unknown node type: "+n.type)}wn.exports=Me;Me.default=Me});var kn=E((Bl,An)=>{"use strict";var Rs=qe(),xn=Ee(),Ns=Dt(),Ms=V(),qt=bn(),Ps=be(),Is=yn(),En=Ke(),Ls=Tt(),Sn=Ce(),vn=Ye(),Ts=Qe(),js=ve(),Bs=rt(),Us=jt(),On=et(),Cn=ce(),zs=ye();function v(...n){return n.length===1&&Array.isArray(n[0])&&(n=n[0]),new qt(n)}v.plugin=function(e,t){let r=!1;function i(...s){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
|
|
25
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
26
|
+
https://www.w3ctech.com/topic/2226`));let l=t(...s);return l.postcssPlugin=e,l.postcssVersion=new qt().version,l}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,l,a){return v([i(a)]).process(s,l)},i};v.stringify=Ps;v.parse=Bs;v.fromJSON=Is;v.list=Us;v.comment=n=>new Sn(n);v.atRule=n=>new vn(n);v.decl=n=>new xn(n);v.rule=n=>new On(n);v.root=n=>new Cn(n);v.document=n=>new En(n);v.CssSyntaxError=Rs;v.Declaration=xn;v.Container=Ms;v.Processor=qt;v.Document=En;v.Comment=Sn;v.Warning=Ls;v.AtRule=vn;v.Result=Ts;v.Input=js;v.Rule=On;v.Root=Cn;v.Node=zs;Ns.registerPostcss(v);An.exports=v;v.default=v});var Mn=E((ca,Nn)=>{Nn.exports=function(e){let t=e.prefix,r=/\s+$/.test(t)?t:`${t} `,i=e.ignoreFiles?[].concat(e.ignoreFiles):[],o=e.includeFiles?[].concat(e.includeFiles):[];return function(s){i.length&&s.source.input.file&&Rn(s.source.input.file,i)||o.length&&s.source.input.file&&!Rn(s.source.input.file,o)||s.walkRules(l=>{let a=["keyframes","-webkit-keyframes","-moz-keyframes","-o-keyframes"];l.parent&&a.includes(l.parent.name)||(l.selectors=l.selectors.map(c=>e.exclude&&Ds(c,e.exclude)?c:e.transform?e.transform(t,c,r+c,s.source.input.file,l):r+c))})}};function Rn(n,e){return e.some(t=>t instanceof RegExp?t.test(n):n.includes(t))}function Ds(n,e){return e.some(t=>t instanceof RegExp?t.test(n):n===t)}});var Ko={};yi(Ko,{initialize:()=>si,initializeExamplesForModules:()=>Go,loadPrefixedStylesheet:()=>oi});var C=rr(kn(),1),_n=C.default,Ul=C.default.stringify,zl=C.default.fromJSON,Dl=C.default.plugin,ql=C.default.parse,Fl=C.default.list,$l=C.default.document,Hl=C.default.comment,Wl=C.default.atRule,Gl=C.default.rule,Zl=C.default.decl,Vl=C.default.root,Kl=C.default.CssSyntaxError,Ql=C.default.Declaration,Jl=C.default.Container,Xl=C.default.Processor,Yl=C.default.Document,ea=C.default.Comment,ta=C.default.Warning,ra=C.default.AtRule,na=C.default.Result,ia=C.default.Input,sa=C.default.Rule,oa=C.default.Root,la=C.default.Node;var Un=rr(Mn(),1),qs="code{white-space:pre}.example{display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;gap:16px}.example>*{flex:1 1 500px}.example .tab-control{overflow:hidden}.example div[role=tab]{cursor:pointer;padding:8px 16px;display:inline-block;font-size:16px;border-bottom:2px solid transparent;background-clip:padding-box;-webkit-user-select:none;user-select:none}.example div[role=tab]:hover{background-color:#1467ba14}.example div[role=tab][selected]{background-color:#1467ba21;border-bottom:2px solid #1467ba}.tab-content{margin:16px 0}.tab-content>pre{padding-top:0}.tab-content.code{max-height:500px;overflow:auto}.tab-content.code pre{margin:0}",Fs="pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}";function $s(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function zn(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach(e=>{let t=n[e],r=typeof t;(r==="object"||r==="function")&&!Object.isFrozen(t)&&zn(t)}),n}var st=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Dn(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function J(n,...e){let t=Object.create(null);for(let r in n)t[r]=n[r];return e.forEach(function(r){for(let i in r)t[i]=r[i]}),t}var Hs="</span>",Pn=n=>!!n.scope,Ws=(n,{prefix:e})=>{if(n.startsWith("language:"))return n.replace("language:","language-");if(n.includes(".")){let t=n.split(".");return[`${e}${t.shift()}`,...t.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${n}`},$t=class{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=Dn(e)}openNode(e){if(!Pn(e))return;let t=Ws(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){Pn(e)&&(this.buffer+=Hs)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},In=(n={})=>{let e={children:[]};return Object.assign(e,n),e},Ht=class n{constructor(){this.rootNode=In(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=In({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(r=>this._walk(e,r)),e.closeNode(t)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(t=>typeof t=="string")?e.children=[e.children.join("")]:e.children.forEach(t=>{n._collapse(t)}))}},Wt=class extends Ht{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let r=e.root;t&&(r.scope=`language:${t}`),this.add(r)}toHTML(){return new $t(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Le(n){return n?typeof n=="string"?n:n.source:null}function qn(n){return se("(?=",n,")")}function Gs(n){return se("(?:",n,")*")}function Zs(n){return se("(?:",n,")?")}function se(...n){return n.map(e=>Le(e)).join("")}function Vs(n){let e=n[n.length-1];return typeof e=="object"&&e.constructor===Object?(n.splice(n.length-1,1),e):{}}function Zt(...n){return"("+(Vs(n).capture?"":"?:")+n.map(e=>Le(e)).join("|")+")"}function Fn(n){return new RegExp(n.toString()+"|").exec("").length-1}function Ks(n,e){let t=n&&n.exec(e);return t&&t.index===0}var Qs=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Vt(n,{joinWith:e}){let t=0;return n.map(r=>{t+=1;let i=t,o=Le(r),s="";for(;o.length>0;){let l=Qs.exec(o);if(!l){s+=o;break}s+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+i):(s+=l[0],l[0]==="("&&t++)}return s}).map(r=>`(${r})`).join(e)}var Js=/\b\B/,$n="[a-zA-Z]\\w*",Kt="[a-zA-Z_]\\w*",Hn="\\b\\d+(\\.\\d+)?",Wn="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Gn="\\b(0b[01]+)",Xs="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Ys=(n={})=>{let e=/^#![ ]*\//;return n.binary&&(n.begin=se(e,/.*\b/,n.binary,/\b.*/)),J({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,r)=>{t.index!==0&&r.ignoreMatch()}},n)},Te={begin:"\\\\[\\s\\S]",relevance:0},eo={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Te]},to={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Te]},ro={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},at=function(n,e,t={}){let r=J({scope:"comment",begin:n,end:e,contains:[]},t);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=Zt("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:se(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},no=at("//","$"),io=at("/\\*","\\*/"),so=at("#","$"),oo={scope:"number",begin:Hn,relevance:0},lo={scope:"number",begin:Wn,relevance:0},ao={scope:"number",begin:Gn,relevance:0},co={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Te,{begin:/\[/,end:/\]/,relevance:0,contains:[Te]}]},uo={scope:"title",begin:$n,relevance:0},ho={scope:"title",begin:Kt,relevance:0},fo={begin:"\\.\\s*"+Kt,relevance:0},po=function(n){return Object.assign(n,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},nt=Object.freeze({__proto__:null,APOS_STRING_MODE:eo,BACKSLASH_ESCAPE:Te,BINARY_NUMBER_MODE:ao,BINARY_NUMBER_RE:Gn,COMMENT:at,C_BLOCK_COMMENT_MODE:io,C_LINE_COMMENT_MODE:no,C_NUMBER_MODE:lo,C_NUMBER_RE:Wn,END_SAME_AS_BEGIN:po,HASH_COMMENT_MODE:so,IDENT_RE:$n,MATCH_NOTHING_RE:Js,METHOD_GUARD:fo,NUMBER_MODE:oo,NUMBER_RE:Hn,PHRASAL_WORDS_MODE:ro,QUOTE_STRING_MODE:to,REGEXP_MODE:co,RE_STARTERS_RE:Xs,SHEBANG:Ys,TITLE_MODE:uo,UNDERSCORE_IDENT_RE:Kt,UNDERSCORE_TITLE_MODE:ho});function go(n,e){n.input[n.index-1]==="."&&e.ignoreMatch()}function mo(n,e){n.className!==void 0&&(n.scope=n.className,delete n.className)}function bo(n,e){e&&n.beginKeywords&&(n.begin="\\b("+n.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",n.__beforeBegin=go,n.keywords=n.keywords||n.beginKeywords,delete n.beginKeywords,n.relevance===void 0&&(n.relevance=0))}function wo(n,e){Array.isArray(n.illegal)&&(n.illegal=Zt(...n.illegal))}function yo(n,e){if(n.match){if(n.begin||n.end)throw new Error("begin & end are not supported with match");n.begin=n.match,delete n.match}}function xo(n,e){n.relevance===void 0&&(n.relevance=1)}var Eo=(n,e)=>{if(!n.beforeMatch)return;if(n.starts)throw new Error("beforeMatch cannot be used with starts");let t=Object.assign({},n);Object.keys(n).forEach(r=>{delete n[r]}),n.keywords=t.keywords,n.begin=se(t.beforeMatch,qn(t.begin)),n.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},n.relevance=0,delete t.beforeMatch},So=["of","and","for","in","not","or","if","then","parent","list","value"],vo="keyword";function Zn(n,e,t=vo){let r=Object.create(null);return typeof n=="string"?i(t,n.split(" ")):Array.isArray(n)?i(t,n):Object.keys(n).forEach(function(o){Object.assign(r,Zn(n[o],e,o))}),r;function i(o,s){e&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){let a=l.split("|");r[a[0]]=[o,Oo(a[0],a[1])]})}}function Oo(n,e){return e?Number(e):Co(n)?0:1}function Co(n){return So.includes(n.toLowerCase())}var Ln={},ie=n=>{console.error(n)},Tn=(n,...e)=>{console.log(`WARN: ${n}`,...e)},fe=(n,e)=>{Ln[`${n}/${e}`]||(console.log(`Deprecated as of ${n}. ${e}`),Ln[`${n}/${e}`]=!0)},ot=new Error;function Vn(n,e,{key:t}){let r=0,i=n[t],o={},s={};for(let l=1;l<=e.length;l++)s[l+r]=i[l],o[l+r]=!0,r+=Fn(e[l-1]);n[t]=s,n[t]._emit=o,n[t]._multi=!0}function Ao(n){if(Array.isArray(n.begin)){if(n.skip||n.excludeBegin||n.returnBegin)throw ie("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ot;if(typeof n.beginScope!="object"||n.beginScope===null)throw ie("beginScope must be object"),ot;Vn(n,n.begin,{key:"beginScope"}),n.begin=Vt(n.begin,{joinWith:""})}}function ko(n){if(Array.isArray(n.end)){if(n.skip||n.excludeEnd||n.returnEnd)throw ie("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ot;if(typeof n.endScope!="object"||n.endScope===null)throw ie("endScope must be object"),ot;Vn(n,n.end,{key:"endScope"}),n.end=Vt(n.end,{joinWith:""})}}function _o(n){n.scope&&typeof n.scope=="object"&&n.scope!==null&&(n.beginScope=n.scope,delete n.scope)}function Ro(n){_o(n),typeof n.beginScope=="string"&&(n.beginScope={_wrap:n.beginScope}),typeof n.endScope=="string"&&(n.endScope={_wrap:n.endScope}),Ao(n),ko(n)}function No(n){function e(s,l){return new RegExp(Le(s),"m"+(n.case_insensitive?"i":"")+(n.unicodeRegex?"u":"")+(l?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,a){a.position=this.position++,this.matchIndexes[this.matchAt]=a,this.regexes.push([a,l]),this.matchAt+=Fn(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let l=this.regexes.map(a=>a[1]);this.matcherRe=e(Vt(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;let a=this.matcherRe.exec(l);if(!a)return null;let c=a.findIndex((w,m)=>m>0&&w!==void 0),h=this.matchIndexes[c];return a.splice(0,c),Object.assign(a,h)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];let a=new t;return this.rules.slice(l).forEach(([c,h])=>a.addRule(c,h)),a.compile(),this.multiRegexes[l]=a,a}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,a){this.rules.push([l,a]),a.type==="begin"&&this.count++}exec(l){let a=this.getMatcher(this.regexIndex);a.lastIndex=this.lastIndex;let c=a.exec(l);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,c=h.exec(l)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(s){let l=new r;return s.contains.forEach(a=>l.addRule(a.begin,{rule:a,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function o(s,l){let a=s;if(s.isCompiled)return a;[mo,yo,Ro,Eo].forEach(h=>h(s,l)),n.compilerExtensions.forEach(h=>h(s,l)),s.__beforeBegin=null,[bo,wo,xo].forEach(h=>h(s,l)),s.isCompiled=!0;let c=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),c=s.keywords.$pattern,delete s.keywords.$pattern),c=c||/\w+/,s.keywords&&(s.keywords=Zn(s.keywords,n.case_insensitive)),a.keywordPatternRe=e(c,!0),l&&(s.begin||(s.begin=/\B|\b/),a.beginRe=e(a.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(a.endRe=e(a.end)),a.terminatorEnd=Le(a.end)||"",s.endsWithParent&&l.terminatorEnd&&(a.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(a.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(h){return Mo(h==="self"?s:h)})),s.contains.forEach(function(h){o(h,a)}),s.starts&&o(s.starts,l),a.matcher=i(a),a}if(n.compilerExtensions||(n.compilerExtensions=[]),n.contains&&n.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return n.classNameAliases=J(n.classNameAliases||{}),o(n)}function Kn(n){return n?n.endsWithParent||Kn(n.starts):!1}function Mo(n){return n.variants&&!n.cachedVariants&&(n.cachedVariants=n.variants.map(function(e){return J(n,{variants:null},e)})),n.cachedVariants?n.cachedVariants:Kn(n)?J(n,{starts:n.starts?J(n.starts):null}):Object.isFrozen(n)?J(n):n}var Po="11.9.0",Gt=class extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}},Ft=Dn,jn=J,Bn=Symbol("nomatch"),Io=7,Qn=function(n){let e=Object.create(null),t=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Wt};function a(u){return l.noHighlightRe.test(u)}function c(u){let d=u.className+" ";d+=u.parentNode?u.parentNode.className:"";let y=l.languageDetectRe.exec(d);if(y){let S=I(y[1]);return S||(Tn(o.replace("{}",y[1])),Tn("Falling back to no-highlight mode for this block.",u)),S?y[1]:"no-highlight"}return d.split(/\s+/).find(S=>a(S)||I(S))}function h(u,d,y){let S="",R="";typeof d=="object"?(S=u,y=d.ignoreIllegals,R=d.language):(fe("10.7.0","highlight(lang, code, ...args) has been deprecated."),fe("10.7.0",`Please use highlight(code, options) instead.
|
|
27
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),R=u,S=d),y===void 0&&(y=!0);let L={code:S,language:R};ee("before:highlight",L);let Z=L.result?L.result:w(L.language,L.code,y);return Z.code=L.code,ee("after:highlight",Z),Z}function w(u,d,y,S){let R=Object.create(null);function L(f,p){return f.keywords[p]}function Z(){if(!b.keywords){M.addText(A);return}let f=0;b.keywordPatternRe.lastIndex=0;let p=b.keywordPatternRe.exec(A),x="";for(;p;){x+=A.substring(f,p.index);let O=q.case_insensitive?p[0].toLowerCase():p[0],P=L(b,O);if(P){let[G,fi]=P;if(M.addText(x),x="",R[O]=(R[O]||0)+1,R[O]<=Io&&(ze+=fi),G.startsWith("_"))x+=p[0];else{let di=q.classNameAliases[G]||G;D(p[0],di)}}else x+=p[0];f=b.keywordPatternRe.lastIndex,p=b.keywordPatternRe.exec(A)}x+=A.substring(f),M.addText(x)}function Be(){if(A==="")return;let f=null;if(typeof b.subLanguage=="string"){if(!e[b.subLanguage]){M.addText(A);return}f=w(b.subLanguage,A,!0,er[b.subLanguage]),er[b.subLanguage]=f._top}else f=_(A,b.subLanguage.length?b.subLanguage:null);b.relevance>0&&(ze+=f.relevance),M.__addSublanguage(f._emitter,f.language)}function T(){b.subLanguage!=null?Be():Z(),A=""}function D(f,p){f!==""&&(M.startScope(p),M.addText(f),M.endScope())}function Qt(f,p){let x=1,O=p.length-1;for(;x<=O;){if(!f._emit[x]){x++;continue}let P=q.classNameAliases[f[x]]||f[x],G=p[x];P?D(G,P):(A=G,Z(),A=""),x++}}function Jt(f,p){return f.scope&&typeof f.scope=="string"&&M.openNode(q.classNameAliases[f.scope]||f.scope),f.beginScope&&(f.beginScope._wrap?(D(A,q.classNameAliases[f.beginScope._wrap]||f.beginScope._wrap),A=""):f.beginScope._multi&&(Qt(f.beginScope,p),A="")),b=Object.create(f,{parent:{value:b}}),b}function Xt(f,p,x){let O=Ks(f.endRe,x);if(O){if(f["on:end"]){let P=new st(f);f["on:end"](p,P),P.isMatchIgnored&&(O=!1)}if(O){for(;f.endsParent&&f.parent;)f=f.parent;return f}}if(f.endsWithParent)return Xt(f.parent,p,x)}function li(f){return b.matcher.regexIndex===0?(A+=f[0],1):(mt=!0,0)}function ai(f){let p=f[0],x=f.rule,O=new st(x),P=[x.__beforeBegin,x["on:begin"]];for(let G of P)if(G&&(G(f,O),O.isMatchIgnored))return li(p);return x.skip?A+=p:(x.excludeBegin&&(A+=p),T(),!x.returnBegin&&!x.excludeBegin&&(A=p)),Jt(x,f),x.returnBegin?0:p.length}function ci(f){let p=f[0],x=d.substring(f.index),O=Xt(b,f,x);if(!O)return Bn;let P=b;b.endScope&&b.endScope._wrap?(T(),D(p,b.endScope._wrap)):b.endScope&&b.endScope._multi?(T(),Qt(b.endScope,f)):P.skip?A+=p:(P.returnEnd||P.excludeEnd||(A+=p),T(),P.excludeEnd&&(A=p));do b.scope&&M.closeNode(),!b.skip&&!b.subLanguage&&(ze+=b.relevance),b=b.parent;while(b!==O.parent);return O.starts&&Jt(O.starts,f),P.returnEnd?0:p.length}function ui(){let f=[];for(let p=b;p!==q;p=p.parent)p.scope&&f.unshift(p.scope);f.forEach(p=>M.openNode(p))}let Ue={};function Yt(f,p){let x=p&&p[0];if(A+=f,x==null)return T(),0;if(Ue.type==="begin"&&p.type==="end"&&Ue.index===p.index&&x===""){if(A+=d.slice(p.index,p.index+1),!i){let O=new Error(`0 width match regex (${u})`);throw O.languageName=u,O.badRule=Ue.rule,O}return 1}if(Ue=p,p.type==="begin")return ai(p);if(p.type==="illegal"&&!y){let O=new Error('Illegal lexeme "'+x+'" for mode "'+(b.scope||"<unnamed>")+'"');throw O.mode=b,O}else if(p.type==="end"){let O=ci(p);if(O!==Bn)return O}if(p.type==="illegal"&&x==="")return 1;if(gt>1e5&>>p.index*3)throw new Error("potential infinite loop, way more iterations than matches");return A+=x,x.length}let q=I(u);if(!q)throw ie(o.replace("{}",u)),new Error('Unknown language: "'+u+'"');let hi=No(q),pt="",b=S||hi,er={},M=new l.__emitter(l);ui();let A="",ze=0,te=0,gt=0,mt=!1;try{if(q.__emitTokens)q.__emitTokens(d,M);else{for(b.matcher.considerAll();;){gt++,mt?mt=!1:b.matcher.considerAll(),b.matcher.lastIndex=te;let f=b.matcher.exec(d);if(!f)break;let p=d.substring(te,f.index),x=Yt(p,f);te=f.index+x}Yt(d.substring(te))}return M.finalize(),pt=M.toHTML(),{language:u,value:pt,relevance:ze,illegal:!1,_emitter:M,_top:b}}catch(f){if(f.message&&f.message.includes("Illegal"))return{language:u,value:Ft(d),illegal:!0,relevance:0,_illegalBy:{message:f.message,index:te,context:d.slice(te-100,te+100),mode:f.mode,resultSoFar:pt},_emitter:M};if(i)return{language:u,value:Ft(d),illegal:!1,relevance:0,errorRaised:f,_emitter:M,_top:b};throw f}}function m(u){let d={value:Ft(u),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return d._emitter.addText(u),d}function _(u,d){d=d||l.languages||Object.keys(e);let y=m(u),S=d.filter(I).filter(je).map(T=>w(T,u,!1));S.unshift(y);let R=S.sort((T,D)=>{if(T.relevance!==D.relevance)return D.relevance-T.relevance;if(T.language&&D.language){if(I(T.language).supersetOf===D.language)return 1;if(I(D.language).supersetOf===T.language)return-1}return 0}),[L,Z]=R,Be=L;return Be.secondBest=Z,Be}function N(u,d,y){let S=d&&t[d]||y;u.classList.add("hljs"),u.classList.add(`language-${S}`)}function j(u){let d=null,y=c(u);if(a(y))return;if(ee("before:highlightElement",{el:u,language:y}),u.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",u);return}if(u.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(u)),l.throwUnescapedHTML))throw new Gt("One of your code blocks includes unescaped HTML.",u.innerHTML);d=u;let S=d.textContent,R=y?h(S,{language:y,ignoreIllegals:!0}):_(S);u.innerHTML=R.value,u.dataset.highlighted="yes",N(u,y,R.language),u.result={language:R.language,re:R.relevance,relevance:R.relevance},R.secondBest&&(u.secondBest={language:R.secondBest.language,relevance:R.secondBest.relevance}),ee("after:highlightElement",{el:u,result:R,text:S})}function g(u){l=jn(l,u)}let $=()=>{B(),fe("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function H(){B(),fe("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let X=!1;function B(){if(document.readyState==="loading"){X=!0;return}document.querySelectorAll(l.cssSelector).forEach(j)}function W(){X&&B()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",W,!1);function pe(u,d){let y=null;try{y=d(n)}catch(S){if(ie("Language definition for '{}' could not be registered.".replace("{}",u)),i)ie(S);else throw S;y=s}y.name||(y.name=u),e[u]=y,y.rawDefinition=d.bind(null,n),y.aliases&&Y(y.aliases,{languageName:u})}function oe(u){delete e[u];for(let d of Object.keys(t))t[d]===u&&delete t[d]}function z(){return Object.keys(e)}function I(u){return u=(u||"").toLowerCase(),e[u]||e[t[u]]}function Y(u,{languageName:d}){typeof u=="string"&&(u=[u]),u.forEach(y=>{t[y.toLowerCase()]=d})}function je(u){let d=I(u);return d&&!d.disableAutodetect}function ut(u){u["before:highlightBlock"]&&!u["before:highlightElement"]&&(u["before:highlightElement"]=d=>{u["before:highlightBlock"](Object.assign({block:d.el},d))}),u["after:highlightBlock"]&&!u["after:highlightElement"]&&(u["after:highlightElement"]=d=>{u["after:highlightBlock"](Object.assign({block:d.el},d))})}function ht(u){ut(u),r.push(u)}function ft(u){let d=r.indexOf(u);d!==-1&&r.splice(d,1)}function ee(u,d){let y=u;r.forEach(function(S){S[y]&&S[y](d)})}function dt(u){return fe("10.7.0","highlightBlock will be removed entirely in v12.0"),fe("10.7.0","Please use highlightElement now."),j(u)}Object.assign(n,{highlight:h,highlightAuto:_,highlightAll:B,highlightElement:j,highlightBlock:dt,configure:g,initHighlighting:$,initHighlightingOnLoad:H,registerLanguage:pe,unregisterLanguage:oe,listLanguages:z,getLanguage:I,registerAliases:Y,autoDetection:je,inherit:jn,addPlugin:ht,removePlugin:ft}),n.debugMode=function(){i=!1},n.safeMode=function(){i=!0},n.versionString=Po,n.regex={concat:se,lookahead:qn,either:Zt,optional:Zs,anyNumberOfTimes:Gs};for(let u in nt)typeof nt[u]=="object"&&zn(nt[u]);return Object.assign(n,nt),n},de=Qn({});de.newInstance=()=>Qn({});var Lo=de;de.HighlightJS=de;de.default=de;var ct=$s(Lo),lt="[A-Za-z$_][0-9A-Za-z$_]*",Jn=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Xn=["true","false","null","undefined","NaN","Infinity"],Yn=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ei=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ti=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ri=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ni=[].concat(ti,Yn,ei);function To(n){let e=n.regex,t=(u,{after:d})=>{let y="</"+u[0].slice(1);return u.input.indexOf(y,d)!==-1},r=lt,i={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(u,d)=>{let y=u[0].length+u.index,S=u.input[y];if(S==="<"||S===","){d.ignoreMatch();return}S===">"&&(t(u,{after:y})||d.ignoreMatch());let R,L=u.input.substring(y);if(R=L.match(/^\s*=/)){d.ignoreMatch();return}if((R=L.match(/^\s+extends\s+/))&&R.index===0){d.ignoreMatch();return}}},l={$pattern:lt,keyword:Jn,literal:Xn,built_in:ni,"variable.language":ri},a="[0-9](_?[0-9])*",c=`\\.(${a})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${h})((${c})|\\.)?|(${c}))[eE][+-]?(${a})\\b`},{begin:`\\b(${h})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},_={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},N={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"css"}},j={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,m]},$={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},H=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,_,N,j,g,{match:/\$\d+/},w];m.contains=H.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(H)});let X=[].concat($,m.contains),B=X.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(X)}]),W={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},pe={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},oe={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Yn,...ei]}},z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[W],illegal:/%/},Y={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function je(u){return e.concat("(?!",u.join("|"),")")}let ut={match:e.concat(/\b/,je([...ti,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},ht={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ft={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},W]},ee="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",dt={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(ee)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[W]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:oe},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),z,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,_,N,j,g,$,{match:/\$\d+/},w,oe,{className:"attr",begin:r+e.lookahead(":"),relevance:0},dt,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[$,n.REGEXP_MODE,{className:"function",begin:ee,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[W,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ht,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[W]},ut,Y,pe,ft,{match:/\$[(.]/}]}}function jo(n){let e=To(n),t=lt,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[e.exports.CLASS_REFERENCE]},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],a={$pattern:lt,keyword:Jn.concat(l),literal:Xn,built_in:ni.concat(r),"variable.language":ri},c={className:"meta",begin:"@"+t},h=(m,_,N)=>{let j=m.contains.findIndex(g=>g.label===_);if(j===-1)throw new Error("can not find mode to replace");m.contains.splice(j,1,N)};Object.assign(e.keywords,a),e.exports.PARAMS_CONTAINS.push(c),e.contains=e.contains.concat([c,i,o]),h(e,"shebang",n.SHEBANG()),h(e,"use_strict",s);let w=e.contains.find(m=>m.label==="func.def");return w.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function Bo(n){let e=n.regex,t=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=n.inherit(o,{begin:/\(/,end:/\)/}),l=n.inherit(n.APOS_STRING_MODE,{className:"string"}),a=n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,a,l,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,s,a,l]}]}]},n.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(t,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:c}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}var Uo=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),zo=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Do=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],qo=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Fo=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],$o=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function Ho(n){let e=n.regex,t=Uo(n),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",l=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,r,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+qo.join("|")+")"},{begin:":(:)?("+Fo.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$o.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Do.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+zo.join("|")+")\\b"}]}}var ii=document.createElement("style");ii.innerText=[qs,Fs].join(`
|
|
28
|
+
`);document.head.appendChild(ii);ct.registerLanguage("typescript",jo);ct.registerLanguage("html",Bo);ct.registerLanguage("css",Ho);function Wo(...n){let e=document.createElement("div"),t=document.createElement("div");t.classList.add("tab-control");let r=document.createElement("div");return n.forEach(i=>{e.appendChild(i),i.addEventListener("click",()=>{n.forEach(o=>o.removeAttribute("selected")),i.setAttribute("selected",""),r.innerHTML="",r.appendChild(i.content),r.className=i.className,r.classList.add("tab-content")})}),t.appendChild(e),t.appendChild(r),r.classList.add("tab-content"),n[0].setAttribute("selected",""),r.appendChild(n[0].content),t}function Pe(n,e){let t=document.createElement("div");return t.role="tab",t.tabIndex=0,t.innerText=n,t.content=e,e.tagName=="PRE"&&t.classList.add("code"),t}function Ie(n,e){let t=document.createElement(n);return typeof e=="string"?t.innerHTML=e:e.forEach(r=>{t.appendChild(r)}),t}async function si(n,e,t){var r,i,o;let s=e.mainContent,l=Ie("div",s);l.id=`example-preview-${t}`;let a=typeof e.css=="string"||(r=e.css)==null?void 0:r.label,c=typeof e.css=="string"?e.css:(i=e.css)==null?void 0:i.content,h=Wo(Pe("Preview",l),Pe("HTML",it("html",s)),...c?[Pe(a??"CSS",it("css",c))]:[],...e.initializer&&e.initializer.content?[Pe(e.initializer.label??"TS",it("typescript",e.initializer.content))]:[],...(e.additionalSources||[]).map(m=>Pe(m.label,it(m.language,m.content))));e.description&&n.appendChild(Ie("div",e.description));let w=Ie("div",[h]);w.classList.add("example"),n.appendChild(w),c&&oi(`#${l.id}`,c),(o=e.initializer)!=null&&o.initialize&&await e.initializer.initialize(l)}function it(n,e){let t=e.split(/\r?\n/).map(r=>{let i=r.indexOf("///");if(i>-1){let o=r.substring(i+3).trimStart();return o?r.replace(/^(\s*)([^\s].*)$/,`$1${o}`):void 0}return r}).filter(r=>typeof r<"u").join(`
|
|
29
|
+
`).trim();return n&&n!="raw"&&(t=ct.highlight(t,{language:n}).value),Ie("pre",[Ie("code",t)])}function oi(n,e){let t=document.createElement("style");t.innerHTML=_n().use((0,Un.default)({prefix:n})).process(e).css,document.head.appendChild(t)}async function Go(n,e=document.body){let t=Vo(e),r=0;Object.keys(n).forEach(async i=>{let o=document.createElement("div");o.className="example-container",t.appendChild(o);let s=n[i].default;si(o,s,r++)})}function Zo(n){let e=document.createElement("div");e.id="examples-container";let t=n.querySelector("#examples");return t?t.after(e):n.appendChild(e),e}function Vo(n){return n.children?Zo(n):n}return xi(Ko);})();
|
|
30
|
+
//# sourceMappingURL=element-preview-with-externals.js.map
|