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