import{__require as e}from"../../postcss/lib/comment.mjs";import{__require as t}from"../../postcss/lib/parser.mjs";import{__require as s}from"../../postcss/lib/tokenize.mjs";var r,i;function n(){if(i)return r;i=1;let n=e(),o=t(),c=s();return r=class extends o{checkMissedSemicolon(){}comment(e){let t=new n;this.init(t,e[2]);let s=this.input.fromOffset(e[3])||this.input.fromOffset(this.input.css.length-1);t.source.end={column:s.col,line:s.line,offset:e[3]+1};let r=e[1].slice(2);if("*/"===r.slice(-2)&&(r=r.slice(0,-2)),/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=c(this.input,{ignoreErrors:!0})}decl(e){e.length>1&&e.some(e=>"word"===e[0])&&super.decl(e)}doubleColon(){}endFile(){for(this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.current.parent;)this.current=this.current.parent,this.current.raws.after="";this.root.source.end=this.getPosition(this.tokenizer.position())}precheckMissedSemicolon(e){let t,s,r=this.colon(e);if(!1===r)return;for(t=r-1;t>=0&&"word"!==e[t][0];t--);if(0===t||t<0)return;for(s=t-1;s>=0;s--)if("space"!==e[s][0]){s+=1;break}let i=e.slice(t),n=e.slice(s,t);e.splice(s,e.length-s),this.spaces=n.map(e=>e[1]).join(""),this.decl(i)}unclosedBracket(){}unexpectedClose(){this.current.raws.after+="}"}unknownWord(e){this.spaces+=e.map(e=>e[1]).join("")}unnamedAtrule(e){e.name=""}}}export{n as __require};