Once stylesheets were inlined, the editor's default CSS parser read them through the browser CSSOM, where a shorthand that contains var() (background: var(--surface-1), border: 1px solid var(--border)) comes back as empty longhands. Every card, panel and border on an imported page vanished, leaving text on a flat dark background. The official PostCSS parser plugin keeps those declarations intact; vendored like the rest, no CDN.
3 lines
No EOL
51 KiB
JavaScript
3 lines
No EOL
51 KiB
JavaScript
/*! grapesjs-parser-postcss - 1.0.3 */
|
|
!function(e,t){'object'==typeof exports&&'object'==typeof module?module.exports=t():'function'==typeof define&&define.amd?define([],t):'object'==typeof exports?exports["grapesjs-parser-postcss"]=t():e["grapesjs-parser-postcss"]=t()}('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:this,(()=>(()=>{var e={241:e=>{var t=String,s=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t}};e.exports=s(),e.exports.createColors=s},353:(e,t,s)=>{"use strict";let r=s(19);class i extends r{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)}}e.exports=i,i.default=i,r.registerAtRule(i)},932:(e,t,s)=>{"use strict";let r=s(631);class i extends r{constructor(e){super(e),this.type='comment'}}e.exports=i,i.default=i},19:(e,t,s)=>{"use strict";let r,i,o,n,{isClean:l,my:a}=s(513),h=s(258),u=s(932),c=s(631);function p(e){return e.map((e=>(e.nodes&&(e.nodes=p(e.nodes)),delete e.source,e)))}function f(e){if(e[l]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)f(t)}class d extends c{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}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,s,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],s=e(this.proxyOf.nodes[t],t),!1!==s);)this.indexes[r]+=1;return delete this.indexes[r],s}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)=>'proxyOf'===t?e:e[t]?'each'===t||'string'==typeof t&&t.startsWith('walk')?(...s)=>e[t](...s.map((e=>'function'==typeof e?(t,s)=>e(t.toProxy(),s):e))):'every'===t||'some'===t?s=>e[t](((e,...t)=>s(e.toProxy(),...t))):'root'===t?()=>e.root().toProxy():'nodes'===t?e.nodes.map((e=>e.toProxy())):'first'===t||'last'===t?e[t].toProxy():e[t]:e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,'name'!==t&&'params'!==t&&'selector'!==t||e.markDirty()),!0)}}index(e){return'number'==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let s,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of i)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)s=this.indexes[e],r<s&&(this.indexes[e]=s+i.length);return this.markDirty(),this}insertBefore(e,t){let s,r=this.index(e),i=0===r&&'prepend',o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)s=this.indexes[e],r<=s&&(this.indexes[e]=s+o.length);return this.markDirty(),this}normalize(e,t){if('string'==typeof e)e=p(r(e).nodes);else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,'ignore')}else if('root'===e.type&&'document'!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,'ignore')}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error('Value field is missed in node creation');'string'!=typeof e.value&&(e.value=String(e.value)),e=[new h(e)]}else if(e.selector)e=[new i(e)];else if(e.name)e=[new o(e)];else{if(!e.text)throw new Error('Unknown node type in node creation');e=[new u(e)]}return e.map((e=>(e[a]||d.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[l]&&f(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,'')),e.parent=this.proxyOf,e)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,'prepend').reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.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){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let s in this.indexes)t=this.indexes[s],t>=e&&(this.indexes[s]=t-1);return this.markDirty(),this}replaceValues(e,t,s){return s||(s=t,t={}),this.walkDecls((r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,s))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,s)=>{let r;try{r=e(t,s)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((s,r)=>{if('atrule'===s.type&&e.test(s.name))return t(s,r)})):this.walk(((s,r)=>{if('atrule'===s.type&&s.name===e)return t(s,r)})):(t=e,this.walk(((e,s)=>{if('atrule'===e.type)return t(e,s)})))}walkComments(e){return this.walk(((t,s)=>{if('comment'===t.type)return e(t,s)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((s,r)=>{if('decl'===s.type&&e.test(s.prop))return t(s,r)})):this.walk(((s,r)=>{if('decl'===s.type&&s.prop===e)return t(s,r)})):(t=e,this.walk(((e,s)=>{if('decl'===e.type)return t(e,s)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((s,r)=>{if('rule'===s.type&&e.test(s.selector))return t(s,r)})):this.walk(((s,r)=>{if('rule'===s.type&&s.selector===e)return t(s,r)})):(t=e,this.walk(((e,s)=>{if('rule'===e.type)return t(e,s)})))}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]}}d.registerParse=e=>{r=e},d.registerRule=e=>{i=e},d.registerAtRule=e=>{o=e},d.registerRoot=e=>{n=e},e.exports=d,d.default=d,d.rebuild=e=>{'atrule'===e.type?Object.setPrototypeOf(e,o.prototype):'rule'===e.type?Object.setPrototypeOf(e,i.prototype):'decl'===e.type?Object.setPrototypeOf(e,h.prototype):'comment'===e.type?Object.setPrototypeOf(e,u.prototype):'root'===e.type&&Object.setPrototypeOf(e,n.prototype),e[a]=!0,e.nodes&&e.nodes.forEach((e=>{d.rebuild(e)}))}},671:(e,t,s)=>{"use strict";let r=s(241),i=s(868);class o extends Error{constructor(e,t,s,r,i,n){super(e),this.name='CssSyntaxError',this.reason=e,i&&(this.file=i),r&&(this.source=r),n&&(this.plugin=n),void 0!==t&&void 0!==s&&('number'==typeof t?(this.line=t,this.column=s):(this.line=t.line,this.column=t.column,this.endLine=s.line,this.endColumn=s.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,o)}setMessage(){this.message=this.plugin?this.plugin+': ':'',this.message+=this.file?this.file:'<css input>',void 0!==this.line&&(this.message+=':'+this.line+':'+this.column),this.message+=': '+this.reason}showSourceCode(e){if(!this.source)return'';let t=this.source;null==e&&(e=r.isColorSupported),i&&e&&(t=i(t));let s,o,n=t.split(/\r?\n/),l=Math.max(this.line-3,0),a=Math.min(this.line+2,n.length),h=String(a).length;if(e){let{bold:e,gray:t,red:i}=r.createColors(!0);s=t=>e(i(t)),o=e=>t(e)}else s=o=e=>e;return n.slice(l,a).map(((e,t)=>{let r=l+1+t,i=' '+(' '+r).slice(-h)+' | ';if(r===this.line){let t=o(i.replace(/\d/g,' '))+e.slice(0,this.column-1).replace(/[^\t]/g,' ');return s('>')+o(i)+e+'\n '+t+s('^')}return' '+o(i)+e})).join('\n')}toString(){let e=this.showSourceCode();return e&&(e='\n\n'+e+'\n'),this.name+': '+this.message+e}}e.exports=o,o.default=o},258:(e,t,s)=>{"use strict";let r=s(631);class i extends r{constructor(e){e&&void 0!==e.value&&'string'!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type='decl'}get variable(){return this.prop.startsWith('--')||'$'===this.prop[0]}}e.exports=i,i.default=i},461:(e,t,s)=>{"use strict";let r,i,o=s(19);class n extends o{constructor(e){super({type:'document',...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new r(new i,this,e).stringify()}}n.registerLazyResult=e=>{r=e},n.registerProcessor=e=>{i=e},e.exports=n,n.default=n},250:(e,t,s)=>{"use strict";let r=s(258),i=s(981),o=s(932),n=s(353),l=s(995),a=s(25),h=s(675);function u(e,t){if(Array.isArray(e))return e.map((e=>u(e)));let{inputs:s,...c}=e;if(s){t=[];for(let e of s){let s={...e,__proto__:l.prototype};s.map&&(s.map={...s.map,__proto__:i.prototype}),t.push(s)}}if(c.nodes&&(c.nodes=e.nodes.map((e=>u(e,t)))),c.source){let{inputId:e,...s}=c.source;c.source=s,null!=e&&(c.source.input=t[e])}if('root'===c.type)return new a(c);if('decl'===c.type)return new r(c);if('rule'===c.type)return new h(c);if('comment'===c.type)return new o(c);if('atrule'===c.type)return new n(c);throw new Error('Unknown node type: '+e.type)}e.exports=u,u.default=u},995:(e,t,s)=>{"use strict";let{SourceMapConsumer:r,SourceMapGenerator:i}=s(209),{fileURLToPath:o,pathToFileURL:n}=s(414),{isAbsolute:l,resolve:a}=s(830),{nanoid:h}=s(961),u=s(868),c=s(671),p=s(981),f=Symbol('fromOffsetCache'),d=Boolean(r&&i),m=Boolean(a&&l);class g{constructor(e,t={}){if(null==e||'object'==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),'\ufeff'===this.css[0]||''===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!m||/^\w+:\/\//.test(t.from)||l(t.from)?this.file=t.from:this.file=a(t.from)),m&&d){let e=new p(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id='<input css '+h(6)+'>'),this.map&&(this.map.file=this.from)}error(e,t,s,r={}){let i,o,l;if(t&&'object'==typeof t){let e=t,r=s;if('number'==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,s=r.col}else t=e.line,s=e.column;if('number'==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,l=e.col}else o=r.line,l=r.column}else if(!s){let e=this.fromOffset(t);t=e.line,s=e.col}let a=this.origin(t,s,o,l);return i=a?new c(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new c(e,void 0===o?t:{column:s,line:t},void 0===o?s:{column:l,line:o},this.css,this.file,r.plugin),i.input={column:s,endColumn:l,endLine:o,line:t,source:this.css},this.file&&(n&&(i.input.url=n(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,s;if(this[f])s=this[f];else{let e=this.css.split('\n');s=new Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)s[r]=t,t+=e[r].length+1;this[f]=s}t=s[s.length-1];let r=0;if(e>=t)r=s.length-1;else{let t,i=s.length-2;for(;r<i;)if(t=r+(i-r>>1),e<s[t])i=t-1;else{if(!(e>=s[t+1])){r=t;break}r=t+1}}return{col:e-s[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:a(this.map.consumer().sourceRoot||this.map.root||'.',e)}origin(e,t,s,r){if(!this.map)return!1;let i,a,h=this.map.consumer(),u=h.originalPositionFor({column:t,line:e});if(!u.source)return!1;'number'==typeof s&&(i=h.originalPositionFor({column:r,line:s})),a=l(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let c={column:u.column,endColumn:i&&i.column,endLine:i&&i.line,line:u.line,url:a.toString()};if('file:'===a.protocol){if(!o)throw new Error(`file: protocol is not available in this PostCSS build`);c.file=o(a)}let p=h.sourceContentFor(u.source);return p&&(c.source=p),c}toJSON(){let e={};for(let t of['hasBOM','css','file','id'])null!=this[t]&&(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}}e.exports=g,g.default=g,u&&u.registerInput&&u.registerInput(g)},939:(e,t,s)=>{"use strict";let{isClean:r,my:i}=s(513),o=s(505),n=s(88),l=s(19),a=s(461),h=(s(448),s(632)),u=s(964),c=s(25);const p={atrule:'AtRule',comment:'Comment',decl:'Declaration',document:'Document',root:'Root',rule:'Rule'},f={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},d={Once:!0,postcssPlugin:!0,prepare:!0},m=0;function g(e){return'object'==typeof e&&'function'==typeof e.then}function w(e){let t=!1,s=p[e.type];return'decl'===e.type?t=e.prop.toLowerCase():'atrule'===e.type&&(t=e.name.toLowerCase()),t&&e.append?[s,s+'-'+t,m,s+'Exit',s+'Exit-'+t]:t?[s,s+'-'+t,s+'Exit',s+'Exit-'+t]:e.append?[s,m,s+'Exit']:[s,s+'Exit']}function y(e){let t;return t='document'===e.type?['Document',m,'DocumentExit']:'root'===e.type?['Root',m,'RootExit']:w(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function x(e){return e[r]=!1,e.nodes&&e.nodes.forEach((e=>x(e))),e}let b={};class v{constructor(e,t,s){let r;if(this.stringified=!1,this.processed=!1,'object'!=typeof t||null===t||'root'!==t.type&&'document'!==t.type)if(t instanceof v||t instanceof h)r=x(t.root),t.map&&(void 0===s.map&&(s.map={}),s.map.inline||(s.map.inline=!1),s.map.prev=t.map);else{let e=u;s.syntax&&(e=s.syntax.parse),s.parser&&(e=s.parser),e.parse&&(e=e.parse);try{r=e(t,s)}catch(e){this.processed=!0,this.error=e}r&&!r[i]&&l.rebuild(r)}else r=x(t);this.result=new h(e,r,s),this.helpers={...b,postcss:b,result:this.result},this.plugins=this.processor.plugins.map((e=>'object'==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}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 s=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,'CssSyntaxError'!==e.name||e.plugin?s.postcssVersion:(e.plugin=s.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,s)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,s])};for(let t of this.plugins)if('object'==typeof t)for(let s in t){if(!f[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!d[s])if('object'==typeof t[s])for(let r in t[s])e(t,'*'===r?s:s+'-'+r.toLowerCase(),t[s][r]);else'function'==typeof t[s]&&e(t,s,t[s])}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],s=this.runOnRoot(t);if(g(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[r];){e[r]=!0;let t=[y(e)];for(;t.length>0;){let e=this.visitTick(t);if(g(e))try{await e}catch(e){let s=t[t.length-1].node;throw this.handleError(e,s)}}}if(this.listeners.OnceExit)for(let[t,s]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if('document'===e.type){let t=e.nodes.map((e=>s(e,this.helpers)));await Promise.all(t)}else await s(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if('object'==typeof e&&e.Once){if('document'===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return g(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if('function'==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new o(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[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){if(g(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[r];)e[r]=!0,this.walkSync(e);if(this.listeners.OnceExit)if('document'===e.type)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[s,r]of e){let e;this.result.lastPlugin=s;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if('root'!==t.type&&'document'!==t.type&&!t.parent)return!0;if(g(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:s,visitors:i}=t;if('root'!==s.type&&'document'!==s.type&&!s.parent)return void e.pop();if(i.length>0&&t.visitorIndex<i.length){let[e,r]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return r(s.toProxy(),this.helpers)}catch(e){throw this.handleError(e,s)}}if(0!==t.iterator){let i,o=t.iterator;for(;i=s.nodes[s.indexes[o]];)if(s.indexes[o]+=1,!i[r])return i[r]=!0,void e.push(y(i));t.iterator=0,delete s.indexes[o]}let o=t.events;for(;t.eventIndex<o.length;){let e=o[t.eventIndex];if(t.eventIndex+=1,e===m)return void(s.nodes&&s.nodes.length&&(s[r]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[r]=!0;let t=w(e);for(let s of t)if(s===m)e.nodes&&e.each((e=>{e[r]||this.walkSync(e)}));else{let t=this.listeners[s];if(t&&this.visitSync(t,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'}}v.registerPostcss=e=>{b=e},e.exports=v,v.default=v,c.registerLazyResult(v),a.registerLazyResult(v)},715:e=>{"use strict";let t={comma:e=>t.split(e,[','],!0),space:e=>t.split(e,[' ','\n','\t']),split(e,t,s){let r=[],i='',o=!1,n=0,l=!1,a='',h=!1;for(let s of e)h?h=!1:'\\'===s?h=!0:l?s===a&&(l=!1):'"'===s||"'"===s?(l=!0,a=s):'('===s?n+=1:')'===s?n>0&&(n-=1):0===n&&t.includes(s)&&(o=!0),o?(''!==i&&r.push(i.trim()),i='',o=!1):i+=s;return(s||''!==i)&&r.push(i.trim()),r}};e.exports=t,t.default=t},505:(e,t,s)=>{"use strict";let{SourceMapConsumer:r,SourceMapGenerator:i}=s(209),{dirname:o,relative:n,resolve:l,sep:a}=s(830),{pathToFileURL:h}=s(414),u=s(995),c=Boolean(r&&i),p=Boolean(o&&l&&n&&a);e.exports=class{constructor(e,t,s,r){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?'data:application/json;base64,'+this.toBase64(this.map.toString()):'string'==typeof this.mapOpts.annotation?this.mapOpts.annotation:'function'==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+'.map';let t='\n';this.css.includes('\r\n')&&(t='\r\n'),this.css+=t+'/*# sourceMappingURL='+e+' */'}applyPrevMaps(){for(let e of this.previous()){let t,s=this.toUrl(this.path(e.file)),i=e.root||o(e.file);!1===this.mapOpts.sourcesContent?(t=new r(e.text),t.sourcesContent&&(t.sourcesContent=t.sourcesContent.map((()=>null)))):t=e.consumer(),this.map.applySourceMap(t,s,this.toUrl(this.path(i)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],'comment'===e.type&&0===e.text.indexOf('# sourceMappingURL=')&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/(\n)?\/\*#[\S\s]*?\*\/$/gm,''))}generate(){if(this.clearAnnotation(),p&&c&&this.isMap())return this.generateMap();{let e='';return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=i.fromSourceMap(e)}else this.map=new i({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 i({file:this.outputFile()});let e,t,s=1,r=1,o='<no source>',n={generated:{column:0,line:0},original:{column:0,line:0},source:''};this.stringify(this.root,((i,l,a)=>{if(this.css+=i,l&&'end'!==a&&(n.generated.line=s,n.generated.column=r-1,l.source&&l.source.start?(n.source=this.sourcePath(l),n.original.line=l.source.start.line,n.original.column=l.source.start.column-1,this.map.addMapping(n)):(n.source=o,n.original.line=1,n.original.column=0,this.map.addMapping(n))),e=i.match(/\n/g),e?(s+=e.length,t=i.lastIndexOf('\n'),r=i.length-t):r+=i.length,l&&'start'!==a){let e=l.parent||{raws:{}};('decl'===l.type||'atrule'===l.type&&!l.nodes)&&l===e.last&&!e.raws.semicolon||(l.source&&l.source.end?(n.source=this.sourcePath(l),n.original.line=l.source.end.line,n.original.column=l.source.end.column-1,n.generated.line=s,n.generated.column=r-2,this.map.addMapping(n)):(n.source=o,n.original.line=1,n.original.column=0,n.generated.line=s,n.generated.column=r-1,this.map.addMapping(n)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}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)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let s=this.opts.to?o(this.opts.to):'.';'string'==typeof this.mapOpts.annotation&&(s=o(l(s,this.mapOpts.annotation)));let r=n(s,e);return this.memoizedPaths.set(e,r),r}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 u(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 s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):'<no source>';this.map.setSourceContent(e,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(h){let t=h(e).toString();return this.memoizedFileURLs.set(e,t),t}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;'\\'===a&&(e=e.replace(/\\/g,'/'));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}}},647:(e,t,s)=>{"use strict";let r=s(505),i=s(88),o=(s(448),s(964));const n=s(632);class l{constructor(e,t,s){let o;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=s,this._map=void 0;let l=i;this.result=new n(this._processor,o,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,'root',{get:()=>a.root});let h=new r(l,o,this._opts,t);if(h.isMap()){let[e,t]=h.generate();e&&(this.result.css=e),t&&(this.result.map=t)}}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=o;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return'NoWorkResult'}}e.exports=l,l.default=l},631:(e,t,s)=>{"use strict";let{isClean:r,my:i}=s(513),o=s(671),n=s(62),l=s(88);function a(e,t){let s=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if('proxyCache'===r)continue;let i=e[r],o=typeof i;'parent'===r&&'object'===o?t&&(s[r]=t):'source'===r?s[r]=i:Array.isArray(i)?s[r]=i.map((e=>a(e,s))):('object'===o&&null!==i&&(i=a(i)),s[r]=i)}return s}class h{constructor(e={}){this.raws={},this[r]=!1,this[i]=!0;for(let t in e)if('nodes'===t){this.nodes=[];for(let s of e[t])'function'==typeof s.clone?this.append(s.clone()):this.append(s)}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=a(this);for(let s in e)t[s]=e[s];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:s,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:s.column,line:s.line},t)}return new o(e)}getProxyProcessor(){return{get:(e,t)=>'proxyOf'===t?e:'root'===t?()=>e.root().toProxy():e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,'prop'!==t&&'value'!==t&&'name'!==t&&'params'!==t&&'important'!==t&&'text'!==t||e.markDirty()),!0)}}markDirty(){if(this[r]){this[r]=!1;let e=this;for(;e=e.parent;)e[r]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let s=this.source.start;if(e.index)s=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(s=this.positionInside(r,t))}return s}positionInside(e,t){let s=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)'\n'===s[t]?(r=1,i+=1):r+=1;return{column:r,line:i}}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},s=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 r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),s=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?s={column:e.end.column,line:e.end.line}:e.endIndex?s=this.positionInside(e.endIndex):e.index&&(s=this.positionInside(e.index+1));return(s.line<t.line||s.line===t.line&&s.column<=t.column)&&(s={column:t.column+1,line:t.line}),{end:s,start:t}}raw(e,t){return(new n).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,s=!1;for(let r of e)r===this?s=!0:s?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);s||this.remove()}return this}root(){let e=this;for(;e.parent&&'document'!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let s={},r=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if('parent'===e||'proxyCache'===e)continue;let r=this[e];if(Array.isArray(r))s[e]=r.map((e=>'object'==typeof e&&e.toJSON?e.toJSON(null,t):e));else if('object'==typeof r&&r.toJSON)s[e]=r.toJSON(null,t);else if('source'===e){let o=t.get(r.input);null==o&&(o=i,t.set(r.input,i),i++),s[e]={end:r.end,inputId:o,start:r.start}}else s[e]=r}return r&&(s.inputs=[...t.keys()].map((e=>e.toJSON()))),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=l){e.stringify&&(e=e.stringify);let t='';return e(this,(e=>{t+=e})),t}warn(e,t,s){let r={node:this};for(let e in s)r[e]=s[e];return e.warn(t,r)}get proxyOf(){return this}}e.exports=h,h.default=h},964:(e,t,s)=>{"use strict";let r=s(19),i=s(867),o=s(995);function n(e,t){let s=new o(e,t),r=new i(s);try{r.parse()}catch(e){throw e}return r.root}e.exports=n,n.default=n,r.registerParse(n)},867:(e,t,s)=>{"use strict";let r=s(258),i=s(852),o=s(932),n=s(353),l=s(25),a=s(675);const h={empty:!0,space:!0};e.exports=class{constructor(e){this.input=e,this.root=new l,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,s,r,i=new n;i.name=e[1].slice(1),''===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,l=!1,a=[],h=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],'('===t||'['===t?h.push('('===t?')':']'):'{'===t&&h.length>0?h.push('}'):t===h[h.length-1]&&h.pop(),0===h.length){if(';'===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if('{'===t){l=!0;break}if('}'===t){if(a.length>0){for(r=a.length-1,s=a[r];s&&'space'===s[0];)s=a[--r];s&&(i.source.end=this.getPosition(s[3]||s[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,'params',a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between='')):(i.raws.afterName='',i.params=''),l&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let s,r=0;for(let i=t-1;i>=0&&(s=e[i],'space'===s[0]||(r+=1,2!==r));i--);throw this.input.error('Missed semicolon','word'===s[0]?s[3]+1:s[2])}colon(e){let t,s,r,i=0;for(let[o,n]of e.entries()){if(t=n,s=t[0],'('===s&&(i+=1),')'===s&&(i-=1),0===i&&':'===s){if(r){if('word'===r[0]&&'progid'===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new o;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let s=e[1].slice(2,-2);if(/^\s*$/.test(s))t.text='',t.raws.left=s,t.raws.right='';else{let e=s.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let s=new r;this.init(s,e[0][2]);let i,o=e[e.length-1];for(';'===o[0]&&(this.semicolon=!0,e.pop()),s.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let s=e[t],r=s[3]||s[2];if(r)return r}}(e)),s.source.end.offset++;'word'!==e[0][0];)1===e.length&&this.unknownWord(e),s.raws.before+=e.shift()[1];for(s.source.start=this.getPosition(e[0][2]),s.prop='';e.length;){let t=e[0][0];if(':'===t||'space'===t||'comment'===t)break;s.prop+=e.shift()[1]}for(s.raws.between='';e.length;){if(i=e.shift(),':'===i[0]){s.raws.between+=i[1];break}'word'===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),s.raws.between+=i[1]}'_'!==s.prop[0]&&'*'!==s.prop[0]||(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let n,l=[];for(;e.length&&(n=e[0][0],'space'===n||'comment'===n);)l.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(i=e[t],'!important'===i[1].toLowerCase()){s.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r,' !important'!==r&&(s.raws.important=r);break}if('important'===i[1].toLowerCase()){let r=e.slice(0),i='';for(let e=t;e>0;e--){let t=r[e][0];if(0===i.trim().indexOf('!')&&'space'!==t)break;i=r.pop()[1]+i}0===i.trim().indexOf('!')&&(s.important=!0,s.raws.important=i,e=r)}if('space'!==i[0]&&'comment'!==i[0])break}e.some((e=>'space'!==e[0]&&'comment'!==e[0]))&&(s.raws.between+=l.map((e=>e[1])).join(''),l=[]),this.raw(s,'value',l.concat(e),t),s.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 a;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 e=this.current.nodes[this.current.nodes.length-1];e&&'rule'===e.type&&!e.raws.ownSemicolon&&(e.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='','comment'!==e.type&&(this.semicolon=!1)}other(e){let t=!1,s=null,r=!1,i=null,o=[],n=e[1].startsWith('--'),l=[],a=e;for(;a;){if(s=a[0],l.push(a),'('===s||'['===s)i||(i=a),o.push('('===s?')':']');else if(n&&r&&'{'===s)i||(i=a),o.push('}');else if(0===o.length){if(';'===s){if(r)return void this.decl(l,n);break}if('{'===s)return void this.rule(l);if('}'===s){this.tokenizer.back(l.pop()),t=!0;break}':'===s&&(r=!0)}else s===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){if(!n)for(;l.length&&(a=l[l.length-1][0],'space'===a||'comment'===a);)this.tokenizer.back(l.pop());this.decl(l,n)}else this.unknownWord(l)}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)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,s,r){let i,o,n,l,a=s.length,u='',c=!0;for(let e=0;e<a;e+=1)i=s[e],o=i[0],'space'!==o||e!==a-1||r?'comment'===o?(l=s[e-1]?s[e-1][0]:'empty',n=s[e+1]?s[e+1][0]:'empty',h[l]||h[n]||','===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let r=s.reduce(((e,t)=>e+t[1]),'');e.raws[t]={raw:r,value:u}}e[t]=u}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,'selector',e),this.current=t}spacesAndCommentsFromEnd(e){let t,s='';for(;e.length&&(t=e[e.length-1][0],'space'===t||'comment'===t);)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s='';for(;e.length&&(t=e[0][0],'space'===t||'comment'===t);)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s='';for(;e.length&&(t=e[e.length-1][0],'space'===t);)s=e.pop()[1]+s;return s}stringFrom(e,t){let s='';for(let r=t;r<e.length;r++)s+=e[r][1];return e.splice(t,e.length-t),s}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})}}},20:(e,t,s)=>{"use strict";let r=s(671),i=s(258),o=s(939),n=s(19),l=s(723),a=s(88),h=s(250),u=s(461),c=s(728),p=s(932),f=s(353),d=s(632),m=s(995),g=s(964),w=s(715),y=s(675),x=s(25),b=s(631);function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new l(e)}v.plugin=function(e,t){let s,r=!1;function i(...s){console&&console.warn&&!r&&(r=!0,console.warn(e+': postcss.plugin was deprecated. Migration guide:\n'+'https://evilmartians.com/chronicles/postcss-8-plugin-migration'),process.env.LANG&&process.env.LANG.startsWith('cn')&&console.warn(e+': 里面 postcss.plugin 被弃用. 迁移指南:\n'+'https://www.w3ctech.com/topic/2226'));let i=t(...s);return i.postcssPlugin=e,i.postcssVersion=(new l).version,i}return Object.defineProperty(i,'postcss',{get:()=>(s||(s=i()),s)}),i.process=function(e,t,s){return v([i(s)]).process(e,t)},i},v.stringify=a,v.parse=g,v.fromJSON=h,v.list=w,v.comment=e=>new p(e),v.atRule=e=>new f(e),v.decl=e=>new i(e),v.rule=e=>new y(e),v.root=e=>new x(e),v.document=e=>new u(e),v.CssSyntaxError=r,v.Declaration=i,v.Container=n,v.Processor=l,v.Document=u,v.Comment=p,v.Warning=c,v.AtRule=f,v.Result=d,v.Input=m,v.Rule=y,v.Root=x,v.Node=b,o.registerPostcss(v),e.exports=v,v.default=v},981:(e,t,s)=>{"use strict";let{SourceMapConsumer:r,SourceMapGenerator:i}=s(209),{existsSync:o,readFileSync:n}=s(777),{dirname:l,join:a}=s(830);class h{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,'data:');let s=t.map?t.map.prev:void 0,r=this.loadMap(t.from,s);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=l(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new r(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,'base64').toString():window.atob(t);var t;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'object'==typeof e&&('string'==typeof e.mappings||'string'==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let s=e.lastIndexOf(t.pop()),r=e.indexOf('*/',s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,r)))}loadFile(e){if(this.root=l(e),o(e))return this.mapFile=e,n(e,'utf-8').toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if('string'==typeof t)return t;if('function'!=typeof t){if(t instanceof r)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error('Unsupported previous source map format: '+t.toString())}{let s=t(e);if(s){let e=this.loadFile(s);if(!e)throw new Error('Unable to load previous source map: '+s.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=a(l(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}e.exports=h,h.default=h},723:(e,t,s)=>{"use strict";let r=s(647),i=s(939),o=s(461),n=s(25);class l{constructor(e=[]){this.version='8.4.31',this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),'object'==typeof s&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if('object'==typeof s&&s.postcssPlugin)t.push(s);else if('function'==typeof s)t.push(s);else if('object'!=typeof s||!s.parse&&!s.stringify)throw new Error(s+' is not a PostCSS plugin');return t}process(e,t={}){return 0===this.plugins.length&&void 0===t.parser&&void 0===t.stringifier&&void 0===t.syntax?new r(this,e,t):new i(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}e.exports=l,l.default=l,n.registerProcessor(l),o.registerProcessor(l)},632:(e,t,s)=>{"use strict";let r=s(728);class i{constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,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 s=new r(e,t);return this.messages.push(s),s}warnings(){return this.messages.filter((e=>'warning'===e.type))}get content(){return this.css}}e.exports=i,i.default=i},25:(e,t,s)=>{"use strict";let r,i,o=s(19);class n extends o{constructor(e){super(e),this.type='root',this.nodes||(this.nodes=[])}normalize(e,t,s){let r=super.normalize(e);if(t)if('prepend'===s)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let s=this.index(e);return!t&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(e={}){return new r(new i,this,e).stringify()}}n.registerLazyResult=e=>{r=e},n.registerProcessor=e=>{i=e},e.exports=n,n.default=n,o.registerRoot(n)},675:(e,t,s)=>{"use strict";let r=s(19),i=s(715);class o extends r{constructor(e){super(e),this.type='rule',this.nodes||(this.nodes=[])}get selectors(){return i.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:','+this.raw('between','beforeOpen');this.selector=e.join(s)}}e.exports=o,o.default=o,r.registerRule(o)},62:e=>{"use strict";const t={after:'\n',beforeClose:'\n',beforeComment:'\n',beforeDecl:'\n',beforeOpen:' ',beforeRule:'\n',colon:': ',commentLeft:' ',commentRight:' ',emptyBody:'',indent:' ',semicolon:!1};class s{constructor(e){this.builder=e}atrule(e,t){let s='@'+e.name,r=e.params?this.rawValue(e,'params'):'';if(void 0!==e.raws.afterName?s+=e.raws.afterName:r&&(s+=' '),e.nodes)this.block(e,s+r);else{let i=(e.raws.between||'')+(t?';':'');this.builder(s+r+i,e)}}beforeAfter(e,t){let s;s='decl'===e.type?this.raw(e,null,'beforeDecl'):'comment'===e.type?this.raw(e,null,'beforeComment'):'before'===t?this.raw(e,null,'beforeRule'):this.raw(e,null,'beforeClose');let r=e.parent,i=0;for(;r&&'root'!==r.type;)i+=1,r=r.parent;if(s.includes('\n')){let t=this.raw(e,null,'indent');if(t.length)for(let e=0;e<i;e++)s+=t}return s}block(e,t){let s,r=this.raw(e,'between','beforeOpen');this.builder(t+r+'{',e,'start'),e.nodes&&e.nodes.length?(this.body(e),s=this.raw(e,'after')):s=this.raw(e,'after','emptyBody'),s&&this.builder(s),this.builder('}',e,'end')}body(e){let t=e.nodes.length-1;for(;t>0&&'comment'===e.nodes[t].type;)t-=1;let s=this.raw(e,'semicolon');for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],o=this.raw(i,'before');o&&this.builder(o),this.stringify(i,t!==r||s)}}comment(e){let t=this.raw(e,'left','commentLeft'),s=this.raw(e,'right','commentRight');this.builder('/*'+t+e.text+s+'*/',e)}decl(e,t){let s=this.raw(e,'between','colon'),r=e.prop+s+this.rawValue(e,'value');e.important&&(r+=e.raws.important||' !important'),t&&(r+=';'),this.builder(r,e)}document(e){this.body(e)}raw(e,s,r){let i;if(r||(r=s),s&&(i=e.raws[s],void 0!==i))return i;let o=e.parent;if('before'===r){if(!o||'root'===o.type&&o.first===e)return'';if(o&&'document'===o.type)return''}if(!o)return t[r];let n=e.root();if(n.rawCache||(n.rawCache={}),void 0!==n.rawCache[r])return n.rawCache[r];if('before'===r||'after'===r)return this.beforeAfter(e,r);{let t='raw'+((l=r)[0].toUpperCase()+l.slice(1));this[t]?i=this[t](n,e):n.walk((e=>{if(i=e.raws[s],void 0!==i)return!1}))}var l;return void 0===i&&(i=t[r]),n.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes('\n')&&(t=t.replace(/[^\n]+$/,'')),!1})),t&&(t=t.replace(/\S/g,'')),t}rawBeforeComment(e,t){let s;return e.walkComments((e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes('\n')&&(s=s.replace(/[^\n]+$/,'')),!1})),void 0===s?s=this.raw(t,null,'beforeDecl'):s&&(s=s.replace(/\S/g,'')),s}rawBeforeDecl(e,t){let s;return e.walkDecls((e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes('\n')&&(s=s.replace(/[^\n]+$/,'')),!1})),void 0===s?s=this.raw(t,null,'beforeRule'):s&&(s=s.replace(/\S/g,'')),s}rawBeforeOpen(e){let t;return e.walk((e=>{if('decl'!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&void 0!==s.raws.before)return t=s.raws.before,t.includes('\n')&&(t=t.replace(/[^\n]+$/,'')),!1})),t&&(t=t.replace(/\S/g,'')),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,''),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((s=>{let r=s.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==s.raws.before){let e=s.raws.before.split('\n');return t=e[e.length-1],t=t.replace(/\S/g,''),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&'decl'===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let s=e[t],r=e.raws[t];return r&&r.value===s?r.raw:s}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)}}e.exports=s,s.default=s},88:(e,t,s)=>{"use strict";let r=s(62);function i(e,t){new r(t).stringify(e)}e.exports=i,i.default=i},513:e=>{"use strict";e.exports.isClean=Symbol('isClean'),e.exports.my=Symbol('my')},852:e=>{"use strict";const t="'".charCodeAt(0),s='"'.charCodeAt(0),r='\\'.charCodeAt(0),i='/'.charCodeAt(0),o='\n'.charCodeAt(0),n=' '.charCodeAt(0),l='\f'.charCodeAt(0),a='\t'.charCodeAt(0),h='\r'.charCodeAt(0),u='['.charCodeAt(0),c=']'.charCodeAt(0),p='('.charCodeAt(0),f=')'.charCodeAt(0),d='{'.charCodeAt(0),m='}'.charCodeAt(0),g=';'.charCodeAt(0),w='*'.charCodeAt(0),y=':'.charCodeAt(0),x='@'.charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,v=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,C=/.[\r\n"'(/\\]/,O=/[\da-f]/i;e.exports=function(e,k={}){let S,A,P,R,E,M,j,I,U,F,L=e.css.valueOf(),z=k.ignoreErrors,B=L.length,D=0,_=[],T=[];function N(t){throw e.error('Unclosed '+t,D)}return{back:function(e){T.push(e)},endOfFile:function(){return 0===T.length&&D>=B},nextToken:function(e){if(T.length)return T.pop();if(D>=B)return;let k=!!e&&e.ignoreUnclosed;switch(S=L.charCodeAt(D),S){case o:case n:case a:case h:case l:A=D;do{A+=1,S=L.charCodeAt(A)}while(S===n||S===o||S===a||S===h||S===l);F=['space',L.slice(D,A)],D=A-1;break;case u:case c:case d:case m:case y:case g:case f:{let e=String.fromCharCode(S);F=[e,e,D];break}case p:if(I=_.length?_.pop()[1]:'',U=L.charCodeAt(D+1),'url'===I&&U!==t&&U!==s&&U!==n&&U!==o&&U!==a&&U!==l&&U!==h){A=D;do{if(M=!1,A=L.indexOf(')',A+1),-1===A){if(z||k){A=D;break}N('bracket')}for(j=A;L.charCodeAt(j-1)===r;)j-=1,M=!M}while(M);F=['brackets',L.slice(D,A+1),D,A],D=A}else A=L.indexOf(')',D+1),R=L.slice(D,A+1),-1===A||C.test(R)?F=['(','(',D]:(F=['brackets',R,D,A],D=A);break;case t:case s:P=S===t?"'":'"',A=D;do{if(M=!1,A=L.indexOf(P,A+1),-1===A){if(z||k){A=D+1;break}N('string')}for(j=A;L.charCodeAt(j-1)===r;)j-=1,M=!M}while(M);F=['string',L.slice(D,A+1),D,A],D=A;break;case x:b.lastIndex=D+1,b.test(L),A=0===b.lastIndex?L.length-1:b.lastIndex-2,F=['at-word',L.slice(D,A+1),D,A],D=A;break;case r:for(A=D,E=!0;L.charCodeAt(A+1)===r;)A+=1,E=!E;if(S=L.charCodeAt(A+1),E&&S!==i&&S!==n&&S!==o&&S!==a&&S!==h&&S!==l&&(A+=1,O.test(L.charAt(A)))){for(;O.test(L.charAt(A+1));)A+=1;L.charCodeAt(A+1)===n&&(A+=1)}F=['word',L.slice(D,A+1),D,A],D=A;break;default:S===i&&L.charCodeAt(D+1)===w?(A=L.indexOf('*/',D+2)+1,0===A&&(z||k?A=L.length:N('comment')),F=['comment',L.slice(D,A+1),D,A],D=A):(v.lastIndex=D+1,v.test(L),A=0===v.lastIndex?L.length-1:v.lastIndex-2,F=['word',L.slice(D,A+1),D,A],_.push(F),D=A)}return D++,F},position:function(){return D}}}},448:e=>{"use strict";let t={};e.exports=function(e){t[e]||(t[e]=!0,'undefined'!=typeof console&&console.warn&&console.warn(e))}},728:e=>{"use strict";class t{constructor(e,t={}){if(this.type='warning',this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}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}}e.exports=t,t.default=t},868:()=>{},777:()=>{},830:()=>{},209:()=>{},414:()=>{},961:e=>{let t='useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';e.exports={nanoid:(e=21)=>{let s='',r=e;for(;r--;)s+=t[64*Math.random()|0];return s},customAlphabet:(e,t=21)=>(s=t)=>{let r='',i=s;for(;i--;)r+=e[Math.random()*e.length|0];return r}}}},t={};function s(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,s),o.exports}s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(e,'__esModule',{value:!0})};var r={};return(()=>{"use strict";s.r(r),s.d(r,{default:()=>a});var e=s(20);const t=e;e.stringify,e.fromJSON,e.plugin,e.parse,e.list,e.document,e.comment,e.atRule,e.rule,e.decl,e.root,e.CssSyntaxError,e.Declaration,e.Container,e.Processor,e.Document,e.Comment,e.Warning,e.AtRule,e.Result,e.Input,e.Rule,e.Root,e.Node;var i=void 0&&(void 0).__assign||function(){return i=Object.assign||function(e){for(var t,s=1,r=arguments.length;s<r;s++)for(var i in t=arguments[s])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)},o=function(e,t){return e&&e.log(t,{ns:'parser-poscss'})},n=function(e){var t=e.nodes||[],s={};return t.forEach((function(e){var t=e.prop,r=e.value,i=e.important;s[t]=r+(i?' !important':'')})),{selectors:e.selector||'',style:s}};const l=function(e,s){var r=[];o(s,['Input CSS',e]);var l=t().process(e).sync().root;return o(s,['PostCSS AST',l]),l.nodes.forEach((function(e){switch(e.type){case'rule':r.push(n(e));break;case'atrule':!function(e,t){var s=e.name,r=e.params;['media','keyframes'].indexOf(s)>=0?e.nodes.forEach((function(e){t.push(i(i({},n(e)),{atRule:s,params:r}))})):t.push(i(i({},n(e)),{atRule:s}))}(e,r)}})),o(s,['Output',r]),r};const a=function(e){e.setCustomParserCss(l)}})(),r})()));
|
|
//# sourceMappingURL=index.js.map
|