Initial commit

This commit is contained in:
mats committed 2026-10-19 16:04:17 +02:00
commit afed023152
8152 files changed
+2086461

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
class t extends Error{reason;filename;line;column;source;constructor(t,i,e,s,n){super(`${t}:${e}:${s}: ${i}`),this.reason=i,this.filename=t,this.line=e,this.column=s,this.source=n}}class i{start;end;source;constructor(t,i,e){this.start=t,this.end=i,this.source=e}}var e;!function(t){t.stylesheet="stylesheet",t.rule="rule",t.declaration="declaration",t.comment="comment",t.atRule="at-rule",t.container="container",t.charset="charset",t.counterStyle="counter-style",t.document="document",t.customMedia="custom-media",t.fontFace="font-face",t.fontFeatureValues="font-feature-values",t.host="host",t.import="import",t.keyframes="keyframes",t.keyframe="keyframe",t.layer="layer",t.media="media",t.namespace="namespace",t.page="page",t.pageMarginBox="page-margin-box",t.positionTry="position-try",t.property="property",t.scope="scope",t.startingStyle="starting-style",t.supports="supports",t.viewTransition="view-transition"}(e||(e={}));const s=(t,i,e)=>{let s=e,n=1e4;do{const e=i.map(i=>t.indexOf(i,s));e.push(t.indexOf("\\",s));const r=e.filter(t=>-1!==t);if(0===r.length)return-1;const o=Math.min(...r);if("\\"!==t[o])return o;s=o+2,n--}while(n>0);throw new Error("Too many escaping")},n=(t,i,e)=>{let r=e,o=1e4;do{const e=i.map(i=>t.indexOf(i,r));e.push(t.indexOf("(",r)),e.push(t.indexOf('"',r)),e.push(t.indexOf("'",r)),e.push(t.indexOf("\\",r));const c=e.filter(t=>-1!==t);if(0===c.length)return-1;const h=Math.min(...c);switch(t[h]){case"\\":r=h+2;break;case"(":{const i=n(t,[")"],h+1);if(-1===i)return-1;r=i+1}break;case'"':{const i=s(t,['"'],h+1);if(-1===i)return-1;r=i+1}break;case"'":{const i=s(t,["'"],h+1);if(-1===i)return-1;r=i+1}break;default:return h}o--}while(o>0);throw new Error("Too many escaping")},r=/\/\*[^]*?(?:\*\/|$)/g;function o(t){return t?t.trim():""}function c(t,i){const e=t&&"string"==typeof t.type,s=e?t:i;for(const i in t){const e=t[i];Array.isArray(e)?e.forEach(t=>{c(t,s)}):e&&"object"==typeof e&&c(e,s)}return e&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:i||null}),t}class h{level=0;indentation=" ";compress=!1;constructor(t){"string"==typeof t?.indent&&(this.indentation=t?.indent),t?.compress&&(this.compress=!0)}emit(t,i){return t}indent(t){return this.level=this.level||1,t?(this.level+=t,""):Array(this.level).join(this.indentation)}visit(t){switch(t.type){case e.stylesheet:return this.stylesheet(t);case e.rule:return this.rule(t);case e.declaration:return this.declaration(t);case e.comment:return this.comment(t);case e.container:return this.container(t);case e.charset:return this.charset(t);case e.counterStyle:return this.counterStyle(t);case e.document:return this.document(t);case e.customMedia:return this.customMedia(t);case e.fontFace:return this.fontFace(t);case e.fontFeatureValues:return this.fontFeatureValues(t);case e.host:return this.host(t);case e.import:return this.import(t);case e.keyframes:return this.keyframes(t);case e.keyframe:return this.keyframe(t);case e.layer:return this.layer(t);case e.media:return this.media(t);case e.namespace:return this.namespace(t);case e.page:return this.page(t);case e.pageMarginBox:return this.pageMarginBox(t);case e.positionTry:return this.positionTry(t);case e.property:return this.property(t);case e.scope:return this.scope(t);case e.startingStyle:return this.startingStyle(t);case e.supports:return this.supports(t);case e.viewTransition:return this.viewTransition(t);case e.atRule:return this.genericAtRule(t)}}mapVisit(t,i){let e="";i=i||"";for(let s=0,n=t.length;s<n;s++)e+=this.visit(t[s]),i&&s<n-1&&(e+=this.emit(i));return e}compile(t){return this.compress?t.stylesheet.rules.map(this.visit,this).join(""):this.stylesheet(t)}stylesheet(t){return this.mapVisit(t.stylesheet.rules,"\n\n")}comment(t){return this.compress?this.emit("",t.position):this.emit(`${this.indent()}/*${t.comment}*/`,t.position)}container(t){return this.compress?this.emit(`@container ${t.container}`,t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}"):this.emit(`${this.indent()}@container ${t.container}`,t.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(t.rules,"\n\n")+this.emit(`\n${this.indent(-1)}${this.indent()}}`)}layer(t){return this.compress?this.emit(`@layer ${t.layer}`,t.position)+(t.rules?this.emit("{")+this.mapVisit(t.rules)+this.emit("}"):";"):this.emit(`${this.indent()}@layer ${t.layer}`,t.position)+(t.rules?this.emit(` {\n${this.indent(1)}`)+this.mapVisit(t.rules,"\n\n")+this.emit(`\n${this.indent(-1)}${this.indent()}}`):";")}import(t){return this.emit(`@import ${t.import};`,t.position)}media(t){return this.compress?this.emit(`@media ${t.media}`,t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}"):this.emit(`${this.indent()}@media ${t.media}`,t.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(t.rules,"\n\n")+this.emit(`\n${this.indent(-1)}${this.indent()}}`)}document(t){const i=`@${t.vendor||""}document ${t.document}`;return this.compress?this.emit(i,t.position)+this.emit("{")+this.mapVisit(t.rulLine truncated
//# sourceMappingURL=adobe-css-tools.mjs.map