11 lines
44 KiB
JavaScript
11 lines
44 KiB
JavaScript
|
|
"use strict";var et=Object.create;var he=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var it=Object.getPrototypeOf,nt=Object.prototype.hasOwnProperty;var me=(e,r)=>(r=Symbol[e])?r:Symbol.for("Symbol."+e),ge=e=>{throw TypeError(e)};var ot=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of rt(r))!nt.call(e,l)&&l!==t&&he(e,l,{get:()=>r[l],enumerable:!(o=tt(r,l))||o.enumerable});return e};var H=(e,r,t)=>(t=e!=null?et(it(e)):{},ot(r||!e||!e.__esModule?he(t,"default",{value:e,enumerable:!0}):t,e));var ve=(e,r,t)=>{if(r!=null){typeof r!="object"&&typeof r!="function"&&ge("Object expected");var o,l;t&&(o=r[me("asyncDispose")]),o===void 0&&(o=r[me("dispose")],t&&(l=o)),typeof o!="function"&&ge("Object not disposable"),l&&(o=function(){try{l.call(this)}catch(n){return Promise.reject(n)}}),e.push([t,o,r])}else t&&e.push([t]);return r},ke=(e,r,t)=>{var o=typeof SuppressedError=="function"?SuppressedError:function(i,a,u,s){return s=Error(u),s.name="SuppressedError",s.error=i,s.suppressed=a,s},l=i=>r=t?new o(i,r,"An error was suppressed during disposal"):(t=!0,i),n=i=>{for(;i=e.pop();)try{var a=i[1]&&i[1].call(i[2]);if(i[0])return Promise.resolve(a).then(n,u=>(l(u),n()))}catch(u){l(u)}if(t)throw r};return n()};var Ye=H(require("@alloc/quick-lru")),x=require("@tailwindcss/node"),Ge=require("@tailwindcss/node/require-cache"),He=require("@tailwindcss/oxide"),qe=H(require("fs")),T=H(require("path"));function M(e){return{kind:"word",value:e}}function lt(e,r){return{kind:"function",value:e,nodes:r}}function at(e){return{kind:"separator",value:e}}function $(e){let r="";for(let t of e)switch(t.kind){case"word":case"separator":{r+=t.value;break}case"function":r+=t.value+"("+$(t.nodes)+")"}return r}var we=92,st=41,be=58,ye=44,ut=34,xe=61,Ae=62,Ce=60,Se=10,ct=40,ft=39,pt=47,$e=32,Te=9;function C(e){e=e.replaceAll(`\r
|
||
|
|
`,`
|
||
|
|
`);let r=[],t=[],o=null,l="",n;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);switch(a){case we:{l+=e[i]+e[i+1],i++;break}case pt:{if(l.length>0){let s=M(l);o?o.nodes.push(s):r.push(s),l=""}let u=M(e[i]);o?o.nodes.push(u):r.push(u);break}case be:case ye:case xe:case Ae:case Ce:case Se:case $e:case Te:{if(l.length>0){let f=M(l);o?o.nodes.push(f):r.push(f),l=""}let u=i,s=i+1;for(;s<e.length&&(n=e.charCodeAt(s),!(n!==be&&n!==ye&&n!==xe&&n!==Ae&&n!==Ce&&n!==Se&&n!==$e&&n!==Te));s++);i=s-1;let c=at(e.slice(u,s));o?o.nodes.push(c):r.push(c);break}case ft:case ut:{let u=i;for(let s=i+1;s<e.length;s++)if(n=e.charCodeAt(s),n===we)s+=1;else if(n===a){i=s;break}l+=e.slice(u,i+1);break}case ct:{let u=lt(l,[]);l="",o?o.nodes.push(u):r.push(u),t.push(u),o=u;break}case st:{let u=t.pop();if(l.length>0){let s=M(l);u?.nodes.push(s),l=""}t.length>0?o=t[t.length-1]:o=null;break}default:l+=String.fromCharCode(a)}}return l.length>0&&r.push(M(l)),r}var d=class extends Map{constructor(t){super();this.factory=t}get(t){let o=super.get(t);return o===void 0&&(o=this.factory(t,this),this.set(t,o)),o}};var or=new Uint8Array(256);var q=new Uint8Array(256);function v(e,r){let t=0,o=[],l=0,n=e.length,i=r.charCodeAt(0);for(let a=0;a<n;a++){let u=e.charCodeAt(a);if(t===0&&u===i){o.push(e.slice(l,a)),l=a+1;continue}switch(u){case 92:a+=1;break;case 39:case 34:for(;++a<n;){let s=e.charCodeAt(a);if(s===92){a+=1;continue}if(s===u)break}break;case 40:q[t]=41,t++;break;case 91:q[t]=93,t++;break;case 123:q[t]=125,t++;break;case 93:case 125:case 41:t>0&&u===q[t-1]&&t--;break}}return o.push(e.slice(l)),o}var te=(i=>(i[i.Continue=0]="Continue",i[i.Skip=1]="Skip",i[i.Stop=2]="Stop",i[i.Replace=3]="Replace",i[i.ReplaceSkip=4]="ReplaceSkip",i[i.ReplaceStop=5]="ReplaceStop",i))(te||{}),g={Continue:{kind:0},Skip:{kind:1},Stop:{kind:2},Replace:e=>({kind:3,nodes:Array.isArray(e)?e:[e]}),ReplaceSkip:e=>({kind:4,nodes:Array.isArray(e)?e:[e]}),ReplaceStop:e=>({kind:5,nodes:Array.isArray(e)?e:[e]})};function h(e,r){typeof r=="function"?Ne(e,r):Ne(e,r.enter,r.exit)}function Ne(e,r=()=>g.Continue,t=()=>g.Continue){let o={value:[e,0,null],prev:null},l={parent:null,depth:0,path(){let n=[],i=o;for(;i;){let a=i.value[2];a&&n.push(a),i=i.prev}return n.reverse(),n}};for(;o!==null;){let n=o.value,i=n[0],a=n[1],u=n[2];if(a>=i.length){o=o.prev,l.depth-=1;continue}if(l.parent=u,a>=0){let k=i[a],N=r(k,l)??g.Continue;switch(N.kind){case 0:{k.nodes&&k.nodes.length>0&&(l.depth+=1,o={value:[k.nodes,0,k],prev:o}),n[1]=~a;continue}case 2:return;case 1:{n[1]=~a;continue}case 3:{i.splice(a,1,...N.nodes);continue}case 5:{i.splice(a,1,...N.nodes);return}case 4:{i.splice(a,1,...N.nodes),n[1]+=N.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${te[N.kind]??`Unknown(${N.kind})`}\` in enter.`)}}let s=~a,c=i[s],f=t(c,l)??g.Continue;switch(f.kind){case 0:n[1]=s+1;continue;case 2:return;case 3:{i.splice(s,1,...f.nodes),n[1]=s+f.nodes.length;continue}case 5:{i.splice(s,1,...f.nodes);return}case 4:{i.splice(s,1,...f.nodes),n[1]=s+f.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${te[f.kind]??`Unknown(${f.kind})`}\` in exit.`)}}}var hr=new d(e=>{let r=C(e),t=new Set;return h(r,(o,l)=>{let n=l.parent===null?r:l.parent.nodes??[];if(o.kind==="word"&&(o.value==="+"||o.value==="-"||o.value==="*"||o.value==="/")){let i=n.indexOf(o)??-1;if(i===-1)return;let a=n[i-1];if(a?.kind!=="separator"||a.value!==" ")return;let u=n[i+1];if(u?.kind!=="separator"||u.value!==" ")return;t.add(a),t.add(u)}else o.kind==="separator"&&o.value.length>0&&o.value.trim()===""?(n[0]===o||n[n.length-1]===o)&&t.add(o):o.kind==="separator"&&o.value.trim()===","&&(o.value=",")}),t.size>0&&h(r,o=>{if(t.has(o))return t.delete(o),g.ReplaceSkip([])}),re(r),$(r)});var vr=new d(e=>{let r=C(e);return r.length===3&&r[0].kind==="word"&&r[0].value==="&"&&r[1].kind==="separator"&&r[1].value===":"&&r[2].kind==="function"&&r[2].value==="is"?$(r[2].nodes):e});function re(e){for(let r of e)switch(r.kind){case"function":{if(r.value==="url"||r.value.endsWith("_url")){r.value=F(r.value);break}if(r.value==="var"||r.va
|
||
|
|
`,r){t+=s.length;let c=t;t+=i.property.length,t+=2,t+=i.value?.length??0,i.important&&(t+=11);let f=t;t+=2,i.dst=[o,c,f]}}else if(i.kind==="rule"){if(u+=`${s}${i.selector} {
|
||
|
|
`,r){t+=s.length;let c=t;t+=i.selector.length,t+=1;let f=t;i.dst=[o,c,f],t+=2}for(let c of i.nodes)u+=l(c,a+1);u+=`${s}}
|
||
|
|
`,r&&(t+=s.length,t+=2)}else if(i.kind==="at-rule"){if(i.nodes.length===0){let c=`${s}${i.name} ${i.params};
|
||
|
|
`;if(r){t+=s.length;let f=t;t+=i.name.length,t+=1,t+=i.params.length;let k=t;t+=2,i.dst=[o,f,k]}return c}if(u+=`${s}${i.name}${i.params?` ${i.params} `:" "}{
|
||
|
|
`,r){t+=s.length;let c=t;t+=i.name.length,i.params&&(t+=1,t+=i.params.length),t+=1;let f=t;i.dst=[o,c,f],t+=2}for(let c of i.nodes)u+=l(c,a+1);u+=`${s}}
|
||
|
|
`,r&&(t+=s.length,t+=2)}else if(i.kind==="comment"){if(u+=`${s}/*${i.value}*/
|
||
|
|
`,r){t+=s.length;let c=t;t+=2+i.value.length+2;let f=t;i.dst=[o,c,f],t+=1}}else if(i.kind==="context"||i.kind==="at-root")return"";return u}let n="";for(let i of e)n+=l(i,0);return o.code=n,n}var qt=33;function We(e,r,t){let o=new d(s=>new e.Input(s.code,{map:t?.input.map,from:s.file??void 0})),l=new d(s=>Q(s.code)),n=e.root();n.source=t;function i(s){if(!s||!s[0])return;let c=l.get(s[0]),f=c.find(s[1]),k=c.find(s[2]);return{input:o.get(s[0]),start:{line:f.line,column:f.column+1,offset:s[1]},end:{line:k.line,column:k.column+1,offset:s[2]}}}function a(s,c){let f=i(c);f?s.source=f:delete s.source}function u(s,c){if(s.kind==="declaration"){let f=e.decl({prop:s.property,value:s.value??"",important:s.important});a(f,s.src),c.append(f)}else if(s.kind==="rule"){let f=e.rule({selector:s.selector});a(f,s.src),f.raws.semicolon=!0,c.append(f);for(let k of s.nodes)u(k,f)}else if(s.kind==="at-rule"){let f=e.atRule({name:s.name.slice(1),params:s.params});a(f,s.src),f.raws.semicolon=!0,c.append(f);for(let k of s.nodes)u(k,f)}else if(s.kind==="comment"){let f=e.comment({text:s.value});f.raws.left="",f.raws.right="",a(f,s.src),c.append(f)}else s.kind==="at-root"||s.kind}for(let s of r)u(s,n);return n}function Be(e){let r=new d(n=>({file:n.file??n.id??null,code:n.css}));function t(n){let i=n.source;if(!i)return;let a=i.input;if(a&&i.start!==void 0&&i.end!==void 0)return[r.get(a),i.start.offset,i.end.offset]}function o(n,i){if(n.type==="decl"){let a=E(n.prop,n.value,n.important);a.src=t(n),i.push(a)}else if(n.type==="rule"){let a=_(n.selector);a.src=t(n),n.each(u=>o(u,a.nodes)),i.push(a)}else if(n.type==="atrule"){let a=A(`@${n.name}`,n.params);a.src=t(n),n.each(u=>o(u,a.nodes)),i.push(a)}else if(n.type==="comment"){if(n.text.charCodeAt(0)!==qt)return;let a=J(n.text);a.src=t(n),i.push(a)}}let l=[];return e.each(n=>o(n,l)),l}var ce=require("@tailwindcss/node"),Y=H(require("path")),se="'",ue='"';function fe(){let e=new WeakSet;function r(t){let o=t.root().source?.input.file;if(!o)return;let l=t.source?.input.file;if(!l||e.has(t))return;let n=t.params[0],i=n[0]===ue&&n[n.length-1]===ue?ue:n[0]===se&&n[n.length-1]===se?se:null;if(!i)return;let a=t.params.slice(1,-1),u="";if(a.startsWith("!")&&(a=a.slice(1),u="!"),!a.startsWith("./")&&!a.startsWith("../"))return;let s=Y.default.posix.join((0,ce.normalizePath)(Y.default.dirname(l)),a),c=Y.default.posix.dirname((0,ce.normalizePath)(o)),f=Y.default.posix.relative(c,s);f.startsWith(".")||(f="./"+f),t.params=i+u+f+i,e.add(t)}return{postcssPlugin:"tailwindcss-postcss-fix-relative-paths",Once(t){t.walkAtRules(/source|plugin|config/,r)}}}var p=x.env.DEBUG,pe=new Ye.default({maxSize:50});function Zt(e,r,t){let o=`${r}:${t.base??""}:${JSON.stringify(t.optimize)}`;if(pe.has(o))return pe.get(o);let l={mtimes:new Map,compiler:null,scanner:null,tailwindCssAst:[],cachedPostCssAst:e.root(),optimizedPostCssAst:e.root(),fullRebuildPaths:[]};return pe.set(o,l),l}function Qt(e={}){let r=e.base??process.cwd(),t=e.optimize??process.env.NODE_ENV==="production",o=e.transformAssetUrls??!0;return{postcssPlugin:"@tailwindcss/postcss",plugins:[fe(),{postcssPlugin:"tailwindcss",async Once(l,{result:n,postcss:i}){var de=[];try{let a=ve(de,new x.Instrumentation);let u=n.opts.from??"";let s=u.endsWith(".module.css");p&&a.start(`[@tailwindcss/postcss] ${(0,T.relative)(r,u)}`);{p&&a.start("Quick bail check");let b=!0;if(l.walkAtRules(m=>{if(m.name==="import"||m.name==="reference"||m.name==="theme"||m.name==="variant"||m.name==="config"||m.name==="plugin"||m.name==="apply"||m.name==="tailwind")return b=!1,!1}),b)return;p&&a.end("Quick bail check")}let c=Zt(i,u,e);let f=T.default.dirname(T.default.resolve(u));let k=c.compiler===null;async function N(){p&&a.start("Setup compiler"),c.fullRebuildPaths.length>0&&!k&&(0,Ge.clearRequireCache)(c.fullRebuildPaths),c.fullRebuildPaths=[],p&&a.start("PostCSS AST -> Tailwind CSS AST");let b=Be(l);p&&a.end("PostCSS AST -> Tailwind CSS AST"),p&&a.start("Create compiler");let m=await(0,x.compileAst)(b,{from:n.opts.from,base:f,shouldRewriteUrls:o,onDependency:ee=>c.fullRebuildPaths.push(ee),pol
|