@react-email/tailwind
Version:
A React component to wrap emails with Tailwind CSS
27 lines (26 loc) • 313 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ms=require("react/jsx-runtime"),ut=require("react");function Is(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const mr=Is(ut);var ni=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qe(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}function Rs(a){if(a.__esModule)return a;var e=a.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(a).forEach(function(r){var n=Object.getOwnPropertyDescriptor(a,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return a[r]}})}),t}var bn={exports:{}},Re=String,Di=function(){return{isColorSupported:!1,reset:Re,bold:Re,dim:Re,italic:Re,underline:Re,inverse:Re,hidden:Re,strikethrough:Re,black:Re,red:Re,green:Re,yellow:Re,blue:Re,magenta:Re,cyan:Re,white:Re,gray:Re,bgBlack:Re,bgRed:Re,bgGreen:Re,bgYellow:Re,bgBlue:Re,bgMagenta:Re,bgCyan:Re,bgWhite:Re}};bn.exports=Di();bn.exports.createColors=Di;var $s=bn.exports;const Ds={},Ns=Object.freeze(Object.defineProperty({__proto__:null,default:Ds},Symbol.toStringTag,{value:"Module"})),Le=Rs(Ns);let ii=$s,ai=Le,Dr=class Ni extends Error{constructor(e,t,r,n,l,i){super(e),this.name="CssSyntaxError",this.reason=e,l&&(this.file=l),n&&(this.source=n),i&&(this.plugin=i),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,Ni)}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=ii.isColorSupported),ai&&e&&(t=ai(t));let r=t.split(/\r?\n/),n=Math.max(this.line-3,0),l=Math.min(this.line+2,r.length),i=String(l).length,c,s;if(e){let{bold:o,gray:f,red:u}=ii.createColors(!0);c=p=>o(u(p)),s=p=>f(p)}else c=s=o=>o;return r.slice(n,l).map((o,f)=>{let u=n+1+f,p=" "+(" "+u).slice(-i)+" | ";if(u===this.line){let _=s(p.replace(/\d/g," "))+o.slice(0,this.column-1).replace(/[^\t]/g," ");return c(">")+s(p)+o+`
`+_+c("^")}return" "+s(p)+o}).join(`
`)}toString(){let e=this.showSourceCode();return e&&(e=`
`+e+`
`),this.name+": "+this.message+e}};var xn=Dr;Dr.default=Dr;var _t={};_t.isClean=Symbol("isClean");_t.my=Symbol("my");const si={after:`
`,beforeClose:`
`,beforeComment:`
`,beforeDecl:`
`,beforeOpen:" ",beforeRule:`
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Ls(a){return a[0].toUpperCase()+a.slice(1)}let Nr=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let l=(e.raws.between||"")+(t?";":"");this.builder(r+n+l,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 n=e.parent,l=0;for(;n&&n.type!=="root";)l+=1,n=n.parent;if(r.includes(`
`)){let i=this.raw(e,null,"indent");if(i.length)for(let c=0;c<l;c++)r+=i}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let n;e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),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 n=0;n<e.nodes.length;n++){let l=e.nodes[n],i=this.raw(l,"before");i&&this.builder(i),this.stringify(l,t!==n||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"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],typeof n<"u"))return n;let l=e.parent;if(r==="before"&&(!l||l.type==="root"&&l.first===e||l&&l.type==="document"))return"";if(!l)return si[r];let i=e.root();if(i.rawCache||(i.rawCache={}),typeof i.rawCache[r]<"u")return i.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let c="raw"+Ls(r);this[c]?n=this[c](i,e):i.walk(s=>{if(n=s.raws[t],typeof n<"u")return!1})}return typeof n>"u"&&(n=si[r]),i.rawCache[r]=n,n}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(`
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
`)&&(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(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
`)&&(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(`
`)&&(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 n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&typeof r.raws.before<"u"){let l=r.raws.before.split(`
`);return t=l[l.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],n=e.raws[t];return n&&n.value===r?n.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)}};var Li=Nr;Nr.default=Nr;let Fs=Li;function Lr(a,e){new Fs(e).stringify(a)}var Kt=Lr;Lr.default=Lr;let{isClean:Mt,my:zs}=_t,Us=xn,js=Li,Vs=Kt;function Fr(a,e){let t=new a.constructor;for(let r in a){if(!Object.prototype.hasOwnProperty.call(a,r)||r==="proxyCache")continue;let n=a[r],l=typeof n;r==="parent"&&l==="object"?e&&(t[r]=e):r==="source"?t[r]=n:Array.isArray(n)?t[r]=n.map(i=>Fr(i,t)):(l==="object"&&n!==null&&(n=Fr(n)),t[r]=n)}return t}let zr=class{constructor(e={}){this.raws={},this[Mt]=!1,this[zs]=!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=Fr(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:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new Us(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[Mt]){this[Mt]=!1;let e=this;for(;e=e.parent;)e[Mt]=!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 n=t.indexOf(e.word);n!==-1&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,l=this.source.start.line;for(let i=0;i<e;i++)r[i]===`
`?(n=1,l+=1):n+=1;return{column:n,line:l}}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 n=this.toString(),l=n.indexOf(e.word);l!==-1&&(t=this.positionInside(l,n),r=this.positionInside(l+e.word.length,n))}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}:typeof e.endIndex=="number"?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 js().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 n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);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={},n=t==null;t=t||new Map;let l=0;for(let i in this){if(!Object.prototype.hasOwnProperty.call(this,i)||i==="parent"||i==="proxyCache")continue;let c=this[i];if(Array.isArray(c))r[i]=c.map(s=>typeof s=="object"&&s.toJSON?s.toJSON(null,t):s);else if(typeof c=="object"&&c.toJSON)r[i]=c.toJSON(null,t);else if(i==="source"){let s=t.get(c.input);s==null&&(s=l,t.set(c.input,l),l++),r[i]={end:c.end,inputId:s,start:c.start}}else r[i]=c}return n&&(r.inputs=[...t.keys()].map(i=>i.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Vs){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let n={node:this};for(let l in r)n[l]=r[l];return e.warn(t,n)}get proxyOf(){return this}};var Xt=zr;zr.default=zr;let Ws=Xt,Ur=class extends Ws{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]==="$"}};var Zt=Ur;Ur.default=Ur;let Bs="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",qs=(a,e=21)=>(t=e)=>{let r="",n=t;for(;n--;)r+=a[Math.random()*a.length|0];return r},Gs=(a=21)=>{let e="",t=a;for(;t--;)e+=Bs[Math.random()*64|0];return e};var Ys={nanoid:Gs,customAlphabet:qs};let{SourceMapConsumer:oi,SourceMapGenerator:li}=Le,{existsSync:Hs,readFileSync:Qs}=Le,{dirname:gr,join:Js}=Le;function Ks(a){return Buffer?Buffer.from(a,"base64").toString():window.atob(a)}let jr=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,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=gr(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new oi(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,n=/^data:application\/json;charset=utf-?8,/,l=/^data:application\/json,/;if(n.test(e)||l.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return Ks(e.substr(RegExp.lastMatch.length));let i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)}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()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=gr(e),Hs(e))return this.mapFile=e,Qs(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 n=this.loadFile(r);if(!n)throw new Error("Unable to load previous source map: "+r.toString());return n}}else{if(t instanceof oi)return li.fromSourceMap(t).toString();if(t instanceof li)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=Js(gr(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)}};var Fi=jr;jr.default=jr;let{SourceMapConsumer:Xs,SourceMapGenerator:Zs}=Le,{fileURLToPath:ui,pathToFileURL:It}=Le,{isAbsolute:Vr,resolve:Wr}=Le,{nanoid:eo}=Ys,vr=Le,fi=xn,to=Fi,yr=Symbol("fromOffsetCache"),ro=!!(Xs&&Zs),ci=!!(Wr&&Vr),qt=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]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!ci||/^\w+:\/\//.test(t.from)||Vr(t.from)?this.file=t.from:this.file=Wr(t.from)),ci&&ro){let r=new to(this.css,t);if(r.text){this.map=r;let n=r.consumer().file;!this.file&&n&&(this.file=this.mapResolve(n))}}this.file||(this.id="<input css "+eo(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let l,i,c;if(t&&typeof t=="object"){let o=t,f=r;if(typeof o.offset=="number"){let u=this.fromOffset(o.offset);t=u.line,r=u.col}else t=o.line,r=o.column;if(typeof f.offset=="number"){let u=this.fromOffset(f.offset);i=u.line,c=u.col}else i=f.line,c=f.column}else if(!r){let o=this.fromOffset(t);t=o.line,r=o.col}let s=this.origin(t,r,i,c);return s?l=new fi(e,s.endLine===void 0?s.line:{column:s.column,line:s.line},s.endLine===void 0?s.column:{column:s.endColumn,line:s.endLine},s.source,s.file,n.plugin):l=new fi(e,i===void 0?t:{column:r,line:t},i===void 0?r:{column:c,line:i},this.css,this.file,n.plugin),l.input={column:r,endColumn:c,endLine:i,line:t,source:this.css},this.file&&(It&&(l.input.url=It(this.file).toString()),l.input.file=this.file),l}fromOffset(e){let t,r;if(this[yr])r=this[yr];else{let l=this.css.split(`
`);r=new Array(l.length);let i=0;for(let c=0,s=l.length;c<s;c++)r[c]=i,i+=l[c].length+1;this[yr]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let l=r.length-2,i;for(;n<l;)if(i=n+(l-n>>1),e<r[i])l=i-1;else if(e>=r[i+1])n=i+1;else{n=i;break}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Wr(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let l=this.map.consumer(),i=l.originalPositionFor({column:t,line:e});if(!i.source)return!1;let c;typeof r=="number"&&(c=l.originalPositionFor({column:n,line:r}));let s;Vr(i.source)?s=It(i.source):s=new URL(i.source,this.map.consumer().sourceRoot||It(this.map.mapFile));let o={column:i.column,endColumn:c&&c.column,endLine:c&&c.line,line:i.line,url:s.toString()};if(s.protocol==="file:")if(ui)o.file=ui(s);else throw new Error("file: protocol is not available in this PostCSS build");let f=l.sourceContentFor(i.source);return f&&(o.source=f),o}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}};var er=qt;qt.default=qt;vr&&vr.registerInput&&vr.registerInput(qt);let{SourceMapConsumer:zi,SourceMapGenerator:Wt}=Le,{dirname:Bt,relative:Ui,resolve:ji,sep:Vi}=Le,{pathToFileURL:di}=Le,no=er,io=!!(zi&&Wt),ao=!!(Bt&&ji&&Ui&&Vi),so=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,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=`
`;this.css.includes(`\r
`)&&(t=`\r
`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Bt(e.file),n;this.mapOpts.sourcesContent===!1?(n=new zi(e.text),n.sourcesContent&&(n.sourcesContent=null)):n=e.consumer(),this.map.applySourceMap(n,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(),ao&&io&&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=Wt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Wt({file:this.outputFile(),ignoreInvalidMapping:!0}),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 Wt({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",n={generated:{column:0,line:0},original:{column:0,line:0},source:""},l,i;this.stringify(this.root,(c,s,o)=>{if(this.css+=c,s&&o!=="end"&&(n.generated.line=e,n.generated.column=t-1,s.source&&s.source.start?(n.source=this.sourcePath(s),n.original.line=s.source.start.line,n.original.column=s.source.start.column-1,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,this.map.addMapping(n))),l=c.match(/\n/g),l?(e+=l.length,i=c.lastIndexOf(`
`),t=c.length-i):t+=c.length,s&&o!=="start"){let f=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==f.last||f.raws.semicolon)&&(s.source&&s.source.end?(n.source=this.sourcePath(s),n.original.line=s.source.end.line,n.original.column=s.source.end.column-1,n.generated.line=e,n.generated.column=t-2,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,n.generated.line=e,n.generated.column=t-1,this.map.addMapping(n)))}})}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?Bt(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Bt(ji(r,this.mapOpts.annotation)));let n=Ui(r,e);return this.memoizedPaths.set(e,n),n}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 no(this.originalCSS,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 n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,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(di){let r=di(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;Vi==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};var Wi=so;let oo=Xt,Br=class extends oo{constructor(e){super(e),this.type="comment"}};var tr=Br;Br.default=Br;let{isClean:Bi,my:qi}=_t,Gi=Zt,Yi=tr,lo=Xt,Hi,_n,Sn,Qi;function Ji(a){return a.map(e=>(e.nodes&&(e.nodes=Ji(e.nodes)),delete e.source,e))}function Ki(a){if(a[Bi]=!1,a.proxyOf.nodes)for(let e of a.proxyOf.nodes)Ki(e)}let Ze=class Xi extends lo{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let n of r)this.proxyOf.nodes.push(n)}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,n;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],n=e(this.proxyOf.nodes[r],r),n!==!1);)this.indexes[t]+=1;return delete this.indexes[t],n}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(n=>typeof n=="function"?(l,i)=>n(l.toProxy(),i):n)):t==="every"||t==="some"?r=>e[t]((n,...l)=>r(n.toProxy(),...l)):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),n=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let i of n)this.proxyOf.nodes.splice(r+1,0,i);let l;for(let i in this.indexes)l=this.indexes[i],r<l&&(this.indexes[i]=l+n.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),n=r===0?"prepend":!1,l=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let c of l)this.proxyOf.nodes.splice(r,0,c);let i;for(let c in this.indexes)i=this.indexes[c],r<=i&&(this.indexes[c]=i+l.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Ji(Hi(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"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 Gi(e)]}else if(e.selector)e=[new _n(e)];else if(e.name)e=[new Sn(e)];else if(e.text)e=[new Yi(e)];else throw new Error("Unknown node type in node creation");return e.map(n=>(n[qi]||Xi.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[Bi]&&Ki(n),typeof n.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(n.raws.before=t.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let n of r)this.proxyOf.nodes.unshift(n);for(let n in this.indexes)this.indexes[n]=this.indexes[n]+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(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(l){throw t.addToError(l)}return n!==!1&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if(r.type==="atrule"&&r.name===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="atrule")return t(r,n)}))}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,n)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if(r.type==="decl"&&r.prop===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="decl")return t(r,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if(r.type==="rule"&&r.selector===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="rule")return t(r,n)}))}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]}};Ze.registerParse=a=>{Hi=a};Ze.registerRule=a=>{_n=a};Ze.registerAtRule=a=>{Sn=a};Ze.registerRoot=a=>{Qi=a};var st=Ze;Ze.default=Ze;Ze.rebuild=a=>{a.type==="atrule"?Object.setPrototypeOf(a,Sn.prototype):a.type==="rule"?Object.setPrototypeOf(a,_n.prototype):a.type==="decl"?Object.setPrototypeOf(a,Gi.prototype):a.type==="comment"?Object.setPrototypeOf(a,Yi.prototype):a.type==="root"&&Object.setPrototypeOf(a,Qi.prototype),a[qi]=!0,a.nodes&&a.nodes.forEach(e=>{Ze.rebuild(e)})};let uo=st,Zi,ea,vt=class extends uo{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Zi(new ea,this,e).stringify()}};vt.registerLazyResult=a=>{Zi=a};vt.registerProcessor=a=>{ea=a};var On=vt;vt.default=vt;let pi={};var ta=function(e){pi[e]||(pi[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))};let qr=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}};var ra=qr;qr.default=qr;let fo=ra,Gr=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 fo(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var kn=Gr;Gr.default=Gr;const wr=39,hi=34,Rt=92,mi=47,$t=10,mt=32,Dt=12,Nt=9,Lt=13,co=91,po=93,ho=40,mo=41,go=123,vo=125,yo=59,wo=42,bo=58,xo=64,Ft=/[\t\n\f\r "#'()/;[\\\]{}]/g,zt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,_o=/.[\r\n"'(/\\]/,gi=/[\da-f]/i;var So=function(e,t={}){let r=e.css.valueOf(),n=t.ignoreErrors,l,i,c,s,o,f,u,p,_,x,h=r.length,m=0,C=[],S=[];function k(){return m}function O(P){throw e.error("Unclosed "+P,m)}function E(){return S.length===0&&m>=h}function M(P){if(S.length)return S.pop();if(m>=h)return;let b=P?P.ignoreUnclosed:!1;switch(l=r.charCodeAt(m),l){case $t:case mt:case Nt:case Lt:case Dt:{i=m;do i+=1,l=r.charCodeAt(i);while(l===mt||l===$t||l===Nt||l===Lt||l===Dt);x=["space",r.slice(m,i)],m=i-1;break}case co:case po:case go:case vo:case bo:case yo:case mo:{let A=String.fromCharCode(l);x=[A,A,m];break}case ho:{if(p=C.length?C.pop()[1]:"",_=r.charCodeAt(m+1),p==="url"&&_!==wr&&_!==hi&&_!==mt&&_!==$t&&_!==Nt&&_!==Dt&&_!==Lt){i=m;do{if(f=!1,i=r.indexOf(")",i+1),i===-1)if(n||b){i=m;break}else O("bracket");for(u=i;r.charCodeAt(u-1)===Rt;)u-=1,f=!f}while(f);x=["brackets",r.slice(m,i+1),m,i],m=i}else i=r.indexOf(")",m+1),s=r.slice(m,i+1),i===-1||_o.test(s)?x=["(","(",m]:(x=["brackets",s,m,i],m=i);break}case wr:case hi:{c=l===wr?"'":'"',i=m;do{if(f=!1,i=r.indexOf(c,i+1),i===-1)if(n||b){i=m+1;break}else O("string");for(u=i;r.charCodeAt(u-1)===Rt;)u-=1,f=!f}while(f);x=["string",r.slice(m,i+1),m,i],m=i;break}case xo:{Ft.lastIndex=m+1,Ft.test(r),Ft.lastIndex===0?i=r.length-1:i=Ft.lastIndex-2,x=["at-word",r.slice(m,i+1),m,i],m=i;break}case Rt:{for(i=m,o=!0;r.charCodeAt(i+1)===Rt;)i+=1,o=!o;if(l=r.charCodeAt(i+1),o&&l!==mi&&l!==mt&&l!==$t&&l!==Nt&&l!==Lt&&l!==Dt&&(i+=1,gi.test(r.charAt(i)))){for(;gi.test(r.charAt(i+1));)i+=1;r.charCodeAt(i+1)===mt&&(i+=1)}x=["word",r.slice(m,i+1),m,i],m=i;break}default:{l===mi&&r.charCodeAt(m+1)===wo?(i=r.indexOf("*/",m+2)+1,i===0&&(n||b?i=r.length:O("comment")),x=["comment",r.slice(m,i+1),m,i],m=i):(zt.lastIndex=m+1,zt.test(r),zt.lastIndex===0?i=r.length-1:i=zt.lastIndex-2,x=["word",r.slice(m,i+1),m,i],C.push(x),m=i);break}}return m++,x}function D(P){S.push(P)}return{back:D,endOfFile:E,nextToken:M,position:k}};let na=st,Gt=class extends na{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)}};var An=Gt;Gt.default=Gt;na.registerAtRule(Gt);let ia=st,aa,sa,ft=class extends ia{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=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 l of n)l.raws.before=t.raws.before}return n}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 aa(new sa,this,e).stringify()}};ft.registerLazyResult=a=>{aa=a};ft.registerProcessor=a=>{sa=a};var St=ft;ft.default=ft;ia.registerRoot(ft);let yt={comma(a){return yt.split(a,[","],!0)},space(a){let e=[" ",`
`," "];return yt.split(a,e)},split(a,e,t){let r=[],n="",l=!1,i=0,c=!1,s="",o=!1;for(let f of a)o?o=!1:f==="\\"?o=!0:c?f===s&&(c=!1):f==='"'||f==="'"?(c=!0,s=f):f==="("?i+=1:f===")"?i>0&&(i-=1):i===0&&e.includes(f)&&(l=!0),l?(n!==""&&r.push(n.trim()),n="",l=!1):n+=f;return(t||n!=="")&&r.push(n.trim()),r}};var oa=yt;yt.default=yt;let la=st,Oo=oa,Yt=class extends la{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Oo.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)}};var Cn=Yt;Yt.default=Yt;la.registerRule(Yt);let ko=Zt,Ao=So,Co=tr,Eo=An,Po=St,vi=Cn;const yi={empty:!0,space:!0};function To(a){for(let e=a.length-1;e>=0;e--){let t=a[e],r=t[3]||t[2];if(r)return r}}let Mo=class{constructor(e){this.input=e,this.root=new Po,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new Eo;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,n,l,i=!1,c=!1,s=[],o=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?o.push(r==="("?")":"]"):r==="{"&&o.length>0?o.push("}"):r===o[o.length-1]&&o.pop(),o.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){c=!0;break}else if(r==="}"){if(s.length>0){for(l=s.length-1,n=s[l];n&&n[0]==="space";)n=s[--l];n&&(t.source.end=this.getPosition(n[3]||n[2]),t.source.end.offset++)}this.end(e);break}else s.push(e);else s.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(t.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(t,"params",s),i&&(e=s[s.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=""),c&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,n;for(let l=t-1;l>=0&&(n=e[l],!(n[0]!=="space"&&(r+=1,r===2)));l--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(e){let t=0,r,n,l;for(let[i,c]of e.entries()){if(r=c,n=r[0],n==="("&&(t+=1),n===")"&&(t-=1),t===0&&n===":")if(!l)this.doubleColon(r);else{if(l[0]==="word"&&l[1]==="progid")continue;return i}l=r}return!1}comment(e){let t=new Co;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 n=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=n[2],t.raws.left=n[1],t.raws.right=n[3]}}createTokenizer(){this.tokenizer=Ao(this.input)}decl(e,t){let r=new ko;this.init(r,e[0][2]);let n=e[e.length-1];for(n[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[2]||To(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 o=e[0][0];if(o===":"||o==="space"||o==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let l;for(;e.length;)if(l=e.shift(),l[0]===":"){r.raws.between+=l[1];break}else l[0]==="word"&&/\w/.test(l[1])&&this.unknownWord([l]),r.raws.between+=l[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i=[],c;for(;e.length&&(c=e[0][0],!(c!=="space"&&c!=="comment"));)i.push(e.shift());this.precheckMissedSemicolon(e);for(let o=e.length-1;o>=0;o--){if(l=e[o],l[1].toLowerCase()==="!important"){r.important=!0;let f=this.stringFrom(e,o);f=this.spacesFromEnd(e)+f,f!==" !important"&&(r.raws.important=f);break}else if(l[1].toLowerCase()==="important"){let f=e.slice(0),u="";for(let p=o;p>0;p--){let _=f[p][0];if(u.trim().indexOf("!")===0&&_!=="space")break;u=f.pop()[1]+u}u.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=u,e=f)}if(l[0]!=="space"&&l[0]!=="comment")break}e.some(o=>o[0]!=="space"&&o[0]!=="comment")&&(r.raws.between+=i.map(o=>o[1]).join(""),i=[]),this.raw(r,"value",i.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 vi;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,n=!1,l=null,i=[],c=e[1].startsWith("--"),s=[],o=e;for(;o;){if(r=o[0],s.push(o),r==="("||r==="[")l||(l=o),i.push(r==="("?")":"]");else if(c&&n&&r==="{")l||(l=o),i.push("}");else if(i.length===0)if(r===";")if(n){this.decl(s,c);return}else break;else if(r==="{"){this.rule(s);return}else if(r==="}"){this.tokenizer.back(s.pop()),t=!0;break}else r===":"&&(n=!0);else r===i[i.length-1]&&(i.pop(),i.length===0&&(l=null));o=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(l),t&&n){if(!c)for(;s.length&&(o=s[s.length-1][0],!(o!=="space"&&o!=="comment"));)this.tokenizer.back(s.pop());this.decl(s,c)}else this.unknownWord(s)}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,n){let l,i,c=r.length,s="",o=!0,f,u;for(let p=0;p<c;p+=1)l=r[p],i=l[0],i==="space"&&p===c-1&&!n?o=!1:i==="comment"?(u=r[p-1]?r[p-1][0]:"empty",f=r[p+1]?r[p+1][0]:"empty",!yi[u]&&!yi[f]?s.slice(-1)===","?o=!1:s+=l[1]:o=!1):s+=l[1];if(!o){let p=r.reduce((_,x)=>_+x[1],"");e.raws[t]={raw:p,value:s}}e[t]=s}rule(e){e.pop();let t=new vi;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 n=t;n<e.length;n++)r+=e[n][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})}};var Io=Mo;let Ro=st,$o=Io,Do=er;function Ht(a,e){let t=new Do(a,e),r=new $o(t);try{r.parse()}catch(n){throw process.env.NODE_ENV!=="production"&&n.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?n.message+=`
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(e.from)?n.message+=`
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(e.from)&&(n.message+=`
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),n}return r.root}var En=Ht;Ht.default=Ht;Ro.registerParse(Ht);let{isClean:Je,my:No}=_t,Lo=Wi,Fo=Kt,zo=st,Uo=On,jo=ta,wi=kn,Vo=En,Wo=St;const Bo={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},qo={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},Go={Once:!0,postcssPlugin:!0,prepare:!0},ct=0;function gt(a){return typeof a=="object"&&typeof a.then=="function"}function ua(a){let e=!1,t=Bo[a.type];return a.type==="decl"?e=a.prop.toLowerCase():a.type==="atrule"&&(e=a.name.toLowerCase()),e&&a.append?[t,t+"-"+e,ct,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:a.append?[t,ct,t+"Exit"]:[t,t+"Exit"]}function bi(a){let e;return a.type==="document"?e=["Document",ct,"DocumentExit"]:a.type==="root"?e=["Root",ct,"RootExit"]:e=ua(a),{eventIndex:0,events:e,iterator:0,node:a,visitorIndex:0,visitors:[]}}function Yr(a){return a[Je]=!1,a.nodes&&a.nodes.forEach(e=>Yr(e)),a}let Hr={},dt=class fa{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))n=Yr(t);else if(t instanceof fa||t instanceof wi)n=Yr(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let l=Vo;r.syntax&&(l=r.syntax.parse),r.parser&&(l=r.parser),l.parse&&(l=l.parse);try{n=l(t,r)}catch(i){this.processed=!0,this.error=i}n&&!n[No]&&zo.rebuild(n)}this.result=new wi(e,n,r),this.helpers={...Hr,postcss:Hr,result:this.result},this.plugins=this.processor.plugins.map(l=>typeof l=="object"&&l.prepare?{...l,...l.prepare(this.result)}:l)}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{if(t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=r.postcssPlugin,e.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let n=r.postcssPlugin,l=r.postcssVersion,i=this.result.processor.version,c=l.split("."),s=i.split(".");(c[0]!==s[0]||parseInt(c[1])>parseInt(s[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+i+", but "+n+" uses "+l+". Perhaps this is the source of the error below.")}}catch(n){console&&console.error&&console.error(n)}return e}prepareVisitors(){this.listeners={};let e=(t,r,n)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,n])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!qo[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Go[r])if(typeof t[r]=="object")for(let n in t[r])n==="*"?e(t,r,t[r][n]):e(t,r+"-"+n.toLowerCase(),t[r][n]);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(gt(r))try{await r}catch(n){throw this.handleError(n)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Je];){e[Je]=!0;let t=[bi(e)];for(;t.length>0;){let r=this.visitTick(t);if(gt(r))try{await r}catch(n){let l=t[t.length-1].node;throw this.handleError(n,l)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let n=e.nodes.map(l=>r(l,this.helpers));await Promise.all(n)}else await r(e,this.helpers)}catch(n){throw this.handleError(n)}}}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 gt(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=Fo;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new Lo(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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(gt(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Je];)e[Je]=!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 process.env.NODE_ENV!=="production"&&("from"in this.opts||jo("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){this.result.lastPlugin=r;let l;try{l=n(t,this.helpers)}catch(i){throw this.handleError(i,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(gt(l))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(n.length>0&&t.visitorIndex<n.length){let[i,c]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=i;try{return c(r.toProxy(),this.helpers)}catch(s){throw this.handleError(s,r)}}if(t.iterator!==0){let i=t.iterator,c;for(;c=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!c[Je]){c[Je]=!0,e.push(bi(c));return}t.iterator=0,delete r.indexes[i]}let l=t.events;for(;t.eventIndex<l.length;){let i=l[t.eventIndex];if(t.eventIndex+=1,i===ct){r.nodes&&r.nodes.length&&(r[Je]=!0,t.iterator=r.getIterator());return}else if(this.listeners[i]){t.visitors=this.listeners[i];return}}e.pop()}walkSync(e){e[Je]=!0;let t=ua(e);for(let r of t)if(r===ct)e.nodes&&e.each(n=>{n[Je]||this.walkSync(n)});else{let n=this.listeners[r];if(n&&this.visitSync(n,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"}};dt.registerPostcss=a=>{Hr=a};var ca=dt;dt.default=dt;Wo.registerLazyResult(dt);Uo.registerLazyResult(dt);let Yo=Wi,Ho=Kt,Qo=ta,Jo=En;const Ko=kn;let Qr=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 n,l=Ho;this.result=new Ko(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get(){return i.root}});let c=new Yo(l,n,this._opts,t);if(c.isMap()){let[s,o]=c.generate();s&&(this.result.css=s),o&&(this.result.map=o)}else c.clearAnnotation(),this.result.css=c.css}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 process.env.NODE_ENV!=="production"&&("from"in this._opts||Qo("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),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=Jo;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"}};var Xo=Qr;Qr.default=Qr;let Zo=Xo,el=ca,tl=On,rl=St,wt=class{constructor(e=[]){this.version="8.4.40",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)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new Zo(this,e,t):new el(this,e,t)}use(