"use strict";const M=require("../../../../../../_virtual/tokenize.js");require("./tokenTypes.js");const z=require("../../../../../../_virtual/tokenTypes.js");(function(g){g.__esModule=!0,g.default=N,g.FIELDS=void 0;var e=D(z.__exports),w,n;function b(){if(typeof WeakMap!="function")return null;var t=new WeakMap;return b=function(){return t},t}function D(t){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var l=b();if(l&&l.has(t))return l.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if(Object.prototype.hasOwnProperty.call(t,f)){var u=i?Object.getOwnPropertyDescriptor(t,f):null;u&&(u.get||u.set)?Object.defineProperty(r,f,u):r[f]=t[f]}return r.default=t,l&&l.set(t,r),r}for(var L=(w={},w[e.tab]=!0,w[e.newline]=!0,w[e.cr]=!0,w[e.feed]=!0,w),x=(n={},n[e.space]=!0,n[e.tab]=!0,n[e.newline]=!0,n[e.cr]=!0,n[e.feed]=!0,n[e.ampersand]=!0,n[e.asterisk]=!0,n[e.bang]=!0,n[e.comma]=!0,n[e.colon]=!0,n[e.semicolon]=!0,n[e.openParenthesis]=!0,n[e.closeParenthesis]=!0,n[e.openSquare]=!0,n[e.closeSquare]=!0,n[e.singleQuote]=!0,n[e.doubleQuote]=!0,n[e.plus]=!0,n[e.pipe]=!0,n[e.tilde]=!0,n[e.greaterThan]=!0,n[e.equals]=!0,n[e.dollar]=!0,n[e.caret]=!0,n[e.slash]=!0,n),C={},S="0123456789abcdefABCDEF",q=0;q<S.length;q++)C[S.charCodeAt(q)]=!0;function R(t,l){var r=l,i;do{if(i=t.charCodeAt(r),x[i])return r-1;i===e.backslash?r=W(t,r)+1:r++}while(r<t.length);return r-1}function W(t,l){var r=l,i=t.charCodeAt(r+1);if(!L[i])if(C[i]){var f=0;do r++,f++,i=t.charCodeAt(r+1);while(C[i]&&f<6);f<6&&i===e.space&&r++}else r++;return r}var I={TYPE:0,START_LINE:1,START_COL:2,END_LINE:3,END_COL:4,START_POS:5,END_POS:6};g.FIELDS=I;function N(t){var l=[],r=t.css.valueOf(),i=r,f=i.length,u=-1,o=1,s=0,d=0,c,E,h,p,m,P,O,T,a,k,_,A,v;function y(Q,F){if(t.safe)r+=F,a=r.length-1;else throw t.error("Unclosed "+Q,o,s-u,s)}for(;s<f;){switch(c=r.charCodeAt(s),c===e.newline&&(u=s,o+=1),c){case e.space:case e.tab:case e.newline:case e.cr:case e.feed:a=s;do a+=1,c=r.charCodeAt(a),c===e.newline&&(u=a,o+=1);while(c===e.space||c===e.newline||c===e.tab||c===e.cr||c===e.feed);v=e.space,p=o,h=a-u-1,d=a;break;case e.plus:case e.greaterThan:case e.tilde:case e.pipe:a=s;do a+=1,c=r.charCodeAt(a);while(c===e.plus||c===e.greaterThan||c===e.tilde||c===e.pipe);v=e.combinator,p=o,h=s-u,d=a;break;case e.asterisk:case e.ampersand:case e.bang:case e.comma:case e.equals:case e.dollar:case e.caret:case e.openSquare:case e.closeSquare:case e.colon:case e.semicolon:case e.openParenthesis:case e.closeParenthesis:a=s,v=c,p=o,h=s-u,d=a+1;break;case e.singleQuote:case e.doubleQuote:A=c===e.singleQuote?"'":'"',a=s;do for(m=!1,a=r.indexOf(A,a+1),a===-1&&y("quote",A),P=a;r.charCodeAt(P-1)===e.backslash;)P-=1,m=!m;while(m);v=e.str,p=o,h=s-u,d=a+1;break;default:c===e.slash&&r.charCodeAt(s+1)===e.asterisk?(a=r.indexOf("*/",s+2)+1,a===0&&y("comment","*/"),E=r.slice(s,a+1),T=E.split(`
`),O=T.length-1,O>0?(k=o+O,_=a-T[O].length):(k=o,_=u),v=e.comment,o=k,p=k,h=a-_):c===e.slash?(a=s,v=c,p=o,h=s-u,d=a+1):(a=R(r,s),v=e.word,p=o,h=a-u),d=a+1;break}l.push([v,o,s-u,p,h,s,d]),_&&(u=_,_=null),s=d}return l}})(M.__exports);
//# sourceMappingURL=tokenize.js.map
