-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcssobject.js
1 lines (1 loc) · 33.1 KB
/
cssobject.js
1
var CSSObject,CSSObj;(()=>{var e={553:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function define(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{define({},"")}catch(e){define=function(e,t,r){return e[t]=r}}function wrap(e,t,r,n){var o=t&&t.prototype instanceof Generator?t:Generator,i=Object.create(o.prototype),a=new Context(n||[]);return i._invoke=function makeInvokeMethod(e,t,r){var n=c;return function invoke(o,i){if(n===l)throw new Error("Generator is already running");if(n===f){if("throw"===o)throw i;return doneResult()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=maybeInvokeDelegate(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===c)throw n=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=l;var h=tryCatch(e,t,r);if("normal"===h.type){if(n=r.done?f:u,h.arg===p)continue;return{value:h.arg,done:r.done}}"throw"===h.type&&(n=f,r.method="throw",r.arg=h.arg)}}}(e,r,a),i}function tryCatch(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=wrap;var c="suspendedStart",u="suspendedYield",l="executing",f="completed",p={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var h={};define(h,i,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(values([])));_&&_!==r&&n.call(_,i)&&(h=_);var v=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(h);function defineIteratorMethods(e){["next","throw","return"].forEach((function(t){define(e,t,(function(e){return this._invoke(t,e)}))}))}function AsyncIterator(e,t){function invoke(r,o,i,a){var s=tryCatch(e[r],e,o);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){invoke("next",e,i,a)}),(function(e){invoke("throw",e,i,a)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return invoke("throw",e,i,a)}))}a(s.arg)}var r;this._invoke=function enqueue(e,n){function callInvokeWithMethodAndArg(){return new t((function(t,r){invoke(e,n,t,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method))return p;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var o=tryCatch(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function pushTryEntry(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function resetTryEntry(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return a.next=a}}return{next:doneResult}}function doneResult(){return{value:t,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(v,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===GeneratorFunction||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,define(e,s,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,a,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},defineIteratorMethods(v),define(v,s,"Generator"),define(v,i,(function(){return this})),define(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function next(){for(;t.length;){var r=t.pop();if(r in e)return next.value=r,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},757:(e,t,r)=>{e.exports=r(553)}},t={};function __webpack_require__(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,__webpack_require__),o.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";function asyncGeneratorStep(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}__webpack_require__.r(r),__webpack_require__.d(r,{default:()=>S});var e=__webpack_require__(757),t=__webpack_require__.n(e);function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(e){return typeof e}:function _typeof(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _slicedToArray(e,t){return function _arrayWithHoles(e){if(Array.isArray(e))return e}(e)||function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}(e,t)||function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}(e,t)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const n={EMPTY:"",AT:"@",DOTS:":",COMMA:",",SEMICOLON:";",BREAK_LINE:"\n",IMPORTANT:"!",VARIABLE:"--",COMMENT:{BEGIN:"/*",END:"*/"},BLOCK:{BEGIN:"{",END:"}",DOUBLE_END:"}}"},BRACKET:{BEGIN:"(",END:")",EMPTY:"()",END_RULE:");"},DATA_URI:{KEY:"data:",KEYS:{":":"=",";":"&"},VALUES:{"=":":","&":";"}},PSEUDO:{KEYS:[":","::","@"],CLASS:":",ELEMENT:"::",EVENT:"@"},REGEX_COMMENTS:/\/\*(\r|\n|.)*\*\//g,REGEX_BRACKETS:/\(([^)]+)\)/,REGEX_REPLACE:function REGEX_REPLACE(e,t){return e.replace(new RegExp(Object.keys(t).join("|"),"g"),(function(e){return t[e]}))}};const o={CHARSET:{KEY:"charset",DELIMITER:n.SEMICOLON},IMPORT:{KEY:"import",DELIMITER:n.SEMICOLON},MEDIA:{KEY:"media",DELIMITER:n.BLOCK.DOUBLE_END},KEYFRAME:{KEY:"keyframes",DELIMITER:n.BLOCK.DOUBLE_END},FONTFACE:{KEY:"font-face",DELIMITER:n.BLOCK.END}};const i={NO_UNIT:"NO_UNIT",CENTIMETERS:"cm",MILLIMETERS:"mm",INCHES:"in",PIXELS:"px",PICAS:"pc",EM:"em",REM:"rem",EX:"ex",CH:"ch",VIEWPORT_WIDTH:"vw",VIEWPORT_HEIGHT:"vh",VMIN:"vmin",VMAX:"vmax",PERCENTAGE:"%",MILLISECONDS:"ms",SECONDS:"s"};const a=function(){function FunctionRule(e,t){_classCallCheck(this,FunctionRule),this.rule={name:e,value:t}}return _createClass(FunctionRule,[{key:"rule",set:function set(e){var t=e.name,r=e.value;this.name=t,this.values=r}},{key:"values",set:function set(e){if(Array.isArray(e)){if(this.value=e.length>1?e:e.pop(),e.length<2)return;this.value=e.map((function(e){if(e.includes(n.BRACKET.BEGIN)){var t=_slicedToArray(e.split(n.BRACKET.BEGIN).map((function(e){return e.trim()})),2);return new FunctionRule(t[0],t[1])}return e}))}else this.value=e}}]),FunctionRule}();const s=function(){function Rule(e,t){return _classCallCheck(this,Rule),this.rule=[e,t],this}return _createClass(Rule,[{key:"rule",set:function set(e){var t=_slicedToArray(e,2),r=t[0],n=t[1];this.property=r,this.value=this.__values(n)}},{key:"prop",get:function get(){return this.property},set:function set(e){this.property=e}},{key:"__values",value:function __values(e){var t=this;if(e.includes(n.BRACKET.BEGIN)){var r=this.__bracketParams(e);this.setUnit(e.replace("(".concat(r,")"),""));var o=r.reduce((function(e,t,r){return e.replace("(".concat(t,")"),"#".concat(r))}),e),i=o.split(o.includes(n.COMMA)?n.COMMA:" ");return r.reduce((function(e,t,r){return e.replace("#".concat(r),"(".concat(t,")"))}),i.join("|")).split("|").map((function(e){return t.value(e.trim())}))}return this.setUnit(this.value(e))}},{key:"value",value:function value(e){if(this.__bracketParams(e).length>1)return this.__values(e);if(e.includes(n.BRACKET.END)){var t=_slicedToArray(e.replace(/[)]/g,"").split(/\((.+)/).map((function(e){return e.trim()})),2),r=t[0],value=t[1];return value=this.important(value).split(!value.startsWith(n.DATA_URI.KEY)&&value.includes(n.COMMA)?n.COMMA:" ").filter((function(e){return e!=n.EMPTY})).map((function(e){return e.trim()})),new a(r,value)}var o=this.important(e).split(n.COMMA).map((function(e){return e.trim()}));return o.length>1?o:o.pop()}},{key:"setUnit",value:function setUnit(e){var t=this;if(Array.isArray(e)){var r=[];e.map((function(e){t.setUnit(e),r.push(t.__values)})),this.values=r}else this.values=e.split(" ").map((function(e){var r=parseFloat(e)?parseFloat(e):"0"==e?0:e;return{value:r,unit:NaN==r?i.NO_UNIT:t.unity(e)}}));return e}},{key:"important",value:function important(e){var t=e.split(n.IMPORTANT);return this.isImportant=t.length>1,this.isImportant?t.shift().trim():e}},{key:"unity",value:function unity(e){var t=e.replace(/[0-9]/g,""),unity=i.NO_UNIT;return Object.entries(i).map((function(e){var r=_slicedToArray(e,2),n=r[0];r[1]==t&&(unity=n)})),unity}},{key:"__bracketParams",value:function __bracketParams(e){var t=!1,r=[],o=[];return e.split("").reduce((function(e,i){return")"==i&&0==r.length&&(t=!1),t&&(e+=i),"("==i&&1==t&&r.push("("),"("==i&&(t=!0),")"==i&&r.length>0&&r.pop(),")"==i&&0==r.length&&0==t&&(o.push(e),e=n.EMPTY),e}),n.EMPTY),o}}]),Rule}();const c=function(){function ImportRule(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return _classCallCheck(this,ImportRule),this.import={url:e,where:t},this}return _createClass(ImportRule,[{key:"import",set:function set(e){var t=this,r=e.url,o=e.where;this.url=r,null!=o&&(this.where=[],o.split(n.COMMA).map((function(e){return e.split(/and+(\s+\([^)]*\))?/g).map((function(e){return e.trim()})).filter((function(e){return""!=e})).map((function(e){if(e.includes(n.DOTS)){var r=_slicedToArray(e.replace(/[\(\)]/g,"").split(n.DOTS).map((function(e){return e.trim()})),2),o=r[0],i=r[1];t.where.push(new s(o,i))}else t.where.push(e.trim())})),t.where})))}}]),ImportRule}();const u={DescendantSelector:" ",ChildSelector:">",AdjacentSibling:"+",GeneralSibling:"~"};const l={UniversalSelector:"*",HTMLSelector:"",IDSelector:"#",ClassSelector:".",AttrSelector:"[",PseudoSelector:":",PseudoElementSelector:"::",PercentageSelector:"%",FromKeyframeSelector:"from",ToKeyframeSelector:"to"};const f={PseudoClass:":",PseudoElement:"::",PseudoEvent:"@"};const p=function(){function Pseudo(e){return _classCallCheck(this,Pseudo),this.pseudo=e,this}return _createClass(Pseudo,[{key:"pseudo",set:function set(e){var t=this;this.name=e,this.values=e,Object.entries(f).map((function(r){var n=_slicedToArray(r,2),o=n[0],i=n[1];e.substring(0,2).replace(/[a-z]/,"")==i&&(t.type=o)}))}},{key:"values",set:function set(e){e.includes(n.BRACKET.BEGIN)?(this.value=e.split(n.BRACKET.BEGIN).pop().split(n.BRACKET.END).shift(),this.name=this.name.replace("(".concat(this.value,")"),"")):delete this.value}}]),Pseudo}();const h=function(){function Selector(e){return _classCallCheck(this,Selector),this.selector=e,this}return _createClass(Selector,[{key:"type",value:function type(e){var t=this;Object.entries(l).map((function(r){var n=_slicedToArray(r,2),o=n[0],i=n[1];e.substr(0,3).replace(/[0-9a-z-_]+/g,"")==i&&(t.type=o),i!=l.ToKeyframeSelector&&i!=l.FromKeyframeSelector||e.startsWith(i)&&(t.type=o)}))}},{key:"combiner",value:function combiner(e){var t=this;this.hasCombiner=!1;var r=e.replace("~=","/=/");Object.entries(u).map((function(e){var n=_slicedToArray(e,2),o=n[0],i=n[1];r.includes(i)&&(t.hasCombiner=!0,t.combiner=o,t.selectors=r.split(i).map((function(e){return new Selector(e.trim().replace("/=/","~="))})))}))}},{key:"pseudo",value:function pseudo(e){var t=e.replace(l[this.type],n.EMPTY).replace(/[0-9a-z-_*+^~$=|\'\'\"\"\[\]]+/,""),r=t.substring(0,2).replace(/[a-z-]/g,"");if(n.PSEUDO.KEYS.includes(r)){var o=t.split(r).filter((function(e){return e!=n.EMPTY})).map((function(e){return new p(r+e)}));this.pseudo=o.length>1?o:o[0]}}},{key:"selector",set:function set(e){this.name=e,this.type(e),this.combiner(e),this.hasCombiner||this.pseudo(e)}}]),Selector}();const y=function(){function BlockRule(e){_classCallCheck(this,BlockRule),this.block=e}return _createClass(BlockRule,[{key:"block",set:function set(e){var t=e.query,r=e.selectors,n=e.rules;this.query=t,this.selectors=r,this.rules=n}}]),BlockRule}();const _=function(){function VariableRule(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;_classCallCheck(this,VariableRule),this.variable={name:e,value:t,scope:r,statment:n}}return _createClass(VariableRule,[{key:"variable",set:function set(e){var t=e.name,r=e.value,n=e.scope,o=e.statment;this.name=t,this.value=r,this.scope=n,o&&(this.statment=o)}}]),VariableRule}();const v=function(){function CommentBlock(e,t){return _classCallCheck(this,CommentBlock),this.block={block:e,line:t},this}return _createClass(CommentBlock,[{key:"block",set:function set(e){var t=e.block,r=e.line;this.line=r,this.text=t,this.comment=this.text.trim().replaceAll(n.BREAK_LINE,n.EMPTY)}},{key:"toString",value:function toString(){var e=this.text.replaceAll(n.BREAK_LINE,n.EMPTY);return"".concat(n.COMMENT.BEGIN+e+n.COMMENT.END)}}]),CommentBlock}();function _createSuper(e){var t=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var r,n=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}const m=function BlocksParser(e){return function(e){_inherits(_class,e);var t=_createSuper(_class);function _class(){return _classCallCheck(this,_class),t.apply(this,arguments)}return _createClass(_class,[{key:"block",value:function block(e){var t=_slicedToArray(e.split(n.BLOCK.BEGIN),2),r=t[0],o=t[1];return new y({query:r.trim(),selectors:this.selectors(r),rules:this.rules(o)})}},{key:"selectors",value:function selectors(e){return e.split(n.COMMA).map((function(e){return new h(e.trim())}))}},{key:"rules",value:function rules(e){return(e=this.dataURI(e)).split(n.SEMICOLON).filter((function(e){return e.trim()!=n.EMPTY})).filter((function(e){return!e.includes(n.BRACKET.EMPTY)})).filter((function(e){return!e.split(n.DOTS).map((function(e){return e.trim()})).includes(n.EMPTY)})).map((function(e){var t=_slicedToArray(e.split(n.DOTS).map((function(e){return e.trim()})),2),r=t[0],o=t[1];return new s(r,n.REGEX_REPLACE(o,n.DATA_URI.VALUES))}))}},{key:"variables",value:function variables(e,t){var variables=[];return e.map((function(e){var t=e.rules.filter((function(e){return e.prop.startsWith(n.VARIABLE)}));t.length>0&&t.map((function(t){return variables.push(new _(t.prop,t.value,e.query))}))})),Object.entries(t).map((function(e){var t=_slicedToArray(e,2),r=t[0];t[1].map((function(e){e.blocks&&e.blocks.map((function(e){var t=e.rules.filter((function(e){return e.prop.startsWith(n.VARIABLE)}));t.length>0&&t.map((function(t){variables.push(new _(t.prop,t.value,e.query,r))}))}))}))})),variables}},{key:"comment",value:function comment(e){var t=[],r=[],o=function commentblck(e,r){e.split(n.COMMENT.BEGIN).filter((function(e){return e.trim()!=n.EMPTY})).forEach((function(e){var o=e.split(n.COMMENT.END).shift();t.push(new v(o,r))}))};return e.split("\n").forEach((function(e,t){var i=n.REGEX_REPLACE(e,{"\r":"","\t":""}),a=++t;i.includes(n.COMMENT.BEGIN)?i.includes(n.COMMENT.END)?o(i,a):r.push({comment:i,line:a}):r.length>0&&(i.includes(n.COMMENT.END)?(r.push({comment:i,line:a}),o(r.map((function(e){return e.line})).join("\n"),r.map((function(e){return e.n}))),r=[]):r.push({comment:i,line:a}))})),t}},{key:"dataURI",value:function dataURI(e){e.includes(n.DATA_URI.KEY)&&e.split(n.BRACKET.BEGIN).filter((function(e){return e.includes(n.BRACKET.END)})).map((function(e){if(e.startsWith(e))return e.split(n.BRACKET.END).shift()})).map((function(t){return e=e.replace(t,n.REGEX_REPLACE(t,n.DATA_URI.KEYS))}));return e}}]),_class}(e)};const d=function ParserBlock(){_classCallCheck(this,ParserBlock)};function FontfaceRule_createSuper(e){var t=function FontfaceRule_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var r,n=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}const E=function(e){_inherits(FontfaceRule,e);var t=FontfaceRule_createSuper(FontfaceRule);function FontfaceRule(e){var r;return _classCallCheck(this,FontfaceRule),(r=t.call(this)).fontface=e,_possibleConstructorReturn(r,_assertThisInitialized(r))}return _createClass(FontfaceRule,[{key:"fontface",set:function set(e){this.rules=this.rules(e);var t=this.rules;this.name=t.find((function(e){return"font-family"==e.prop})).value}}]),FontfaceRule}(m(d));function KeyframeRule_createSuper(e){var t=function KeyframeRule_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var r,n=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}const b=function(e){_inherits(KeyframeRule,e);var t=KeyframeRule_createSuper(KeyframeRule);function KeyframeRule(e,r){var n;return _classCallCheck(this,KeyframeRule),(n=t.call(this)).name=e,n.keyframe=r,_possibleConstructorReturn(n,_assertThisInitialized(n))}return _createClass(KeyframeRule,[{key:"keyframe",set:function set(e){var t=this,r=e.split(n.BLOCK.END);this.blocks=r.map((function(e){return t.block(e.trim())}))}}]),KeyframeRule}(m(d));const R={ONLY_OR_NOT:["only","not"],MEDIA_TYPES:["all","tv","tty","aural","print","screen","braile","handheld","embossed","projection"]};const C=function(){function QuerieRule(e){return _classCallCheck(this,QuerieRule),this.rule=e,this}return _createClass(QuerieRule,[{key:"rule",set:function set(e){var t=e.rules,r=e.types,n=e.only,o=e.not;this.rules=t,this.types=r,this.only=n,this.not=o}}]),QuerieRule}();function MediaRule_createSuper(e){var t=function MediaRule_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var r,n=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}const g=function(e){_inherits(MediaRule,e);var t=MediaRule_createSuper(MediaRule);function MediaRule(e,r){var n;return _classCallCheck(this,MediaRule),(n=t.call(this)).media={query:e,blocks:r},_possibleConstructorReturn(n,_assertThisInitialized(n))}return _createClass(MediaRule,[{key:"media",set:function set(e){var t=this,r=e.query,o=e.blocks;this.querie=r,this.blocks=o.split(n.BLOCK.END).map((function(e){return t.block(e)}))}},{key:"querie",set:function set(e){this.query=e,this.queries=this.query.split(n.COMMA).map((function(e){var t={rules:[],types:[],only:!1,not:!1};return e.split(/and+(\s+\([^)]*\))?/g).map((function(e){return e.trim()})).filter((function(e){return""!=e})).map((function(e){var r=e.trim();if(r.includes(n.DOTS)){var o=_slicedToArray(r.replace(/[\(\)]/g,"").split(n.DOTS).map((function(e){return e.trim()})),2),i=o[0],a=o[1];t.rules.push(new s(i,a))}else R.ONLY_OR_NOT.map((function(e){r.startsWith(e)&&(r=r.replace(e,"").trim(),t[e]=!0)})),R.MEDIA_TYPES.includes(r)&&t.types.push(r)})),new C(t)}))}}]),MediaRule}(m(d));const O=function CharsetRule(e){_classCallCheck(this,CharsetRule),this.type=e};function StatmentsParser_createSuper(e){var t=function StatmentsParser_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var r,n=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function CSSParser_createSuper(e){var t=function CSSParser_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var r,n=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function Stylesheet_createSuper(e){var t=function Stylesheet_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var r,n=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}const k=function(e){_inherits(Stylesheet,e);var t=Stylesheet_createSuper(Stylesheet);function Stylesheet(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return _classCallCheck(this,Stylesheet),(r=t.call(this)).cssText=e,r.filename=n,r.parse(r.cssText),_possibleConstructorReturn(r,_assertThisInitialized(r))}return Stylesheet}(function(e){_inherits(CSSParser,e);var t=CSSParser_createSuper(CSSParser);function CSSParser(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return _classCallCheck(this,CSSParser),e=t.call(this),null!=r&&e.parse(r),_possibleConstructorReturn(e,_assertThisInitialized(e))}return _createClass(CSSParser,[{key:"parse",value:function parse(e){var t=this;return this.comments=this.comment(e),this.css=this.clean(e),this.blocks=this.statments().split(n.BLOCK.END).filter((function(e){return""!=e.trim()})).map((function(e){return t.block(e)})),this.variables=this.variables(this.blocks,this.stats),this}},{key:"clean",value:function clean(e){var t=n.REGEX_REPLACE(e,{"\n":"","\r":"","\t":""," ":""});return this.comments.map((function(e){return t=t.replace(e.toString(),n.EMPTY)})),t.trim()}}]),CSSParser}(function StatmentsParser(e){return function(e){_inherits(_class,e);var t=StatmentsParser_createSuper(_class);function _class(){return _classCallCheck(this,_class),t.apply(this,arguments)}return _createClass(_class,[{key:"statments",value:function statments(){var e=this;return this.stats={},this.css.split(n.AT).map((function(t){Object.entries(o).map((function(r){var o=_slicedToArray(r,2),i=o[0],a=o[1];if(t.startsWith(a.KEY)){var s=t.split(a.DELIMITER).shift();e[i.toLowerCase()].call(e,s.replace(a.KEY,n.EMPTY).trim()),e.css=e.css.replace("".concat(n.AT+s+a.DELIMITER),n.EMPTY)}}))})),this.css}},{key:"charset",value:function charset(e){var t=e.replaceAll('"',"");this.stats.charsets.push(new O(t))}},{key:"import",value:function _import(e){var t=_slicedToArray(e.replace(" ","|").split("|").map((function(e){return e.trim()})),2),r=t[0],n=t[1];this.stats.imports.push(new c(r,n))}},{key:"fontface",value:function fontface(e){var t=e.split(n.BLOCK.BEGIN).pop().trim();this.stats.fontfaces.push(new E(t))}},{key:"keyframe",value:function keyframe(e){var t=_slicedToArray(e.replace(n.BLOCK.BEGIN,"|").split("|").map((function(e){return e.trim()})),2),r=t[0],o=t[1];this.stats.keyframes.push(new b(r,o))}},{key:"media",value:function media(e){var t=_slicedToArray(e.replace(n.BLOCK.BEGIN,"|").split("|").map((function(e){return e.trim()})),2),r=t[0],o=t[1];this.stats.medias.push(new g(r,o))}},{key:"stats",get:function get(){return this.statments},set:function set(e){var t=this;this.statments=e,Object.keys(o).map((function(e){return t.statments["".concat(e.toLowerCase(),"s")]=[]}))}}]),_class}(e)}(m(d))));function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const S=function(){function CSSObject(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,CSSObject),this.options(e),this}var e;return _createClass(CSSObject,[{key:"options",value:function options(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.__defaultOptions__={only_files:e.only_files||[],ignore_files:e.ignore_files||[],load_min:e.load_min||!0},this._options=_objectSpread(_objectSpread({},this.__defaultOptions__),e),this}},{key:"static",value:function _static(e,t){var r=new k(e);return"string"==typeof e&&t(r),this}},{key:"local",value:function local(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return Object.values(document.styleSheets).forEach((function(o,i){if((null!=o.ownerNode||o.ownerNode.childNodes.length>0)&&""!=o.ownerNode.innerText){var a=o.ownerNode.dataset.name||null;if(0==t._options.only_files.length&&t._options.ignore_files.includes(a))return;if(t._options.only_files.length>0&&!t._options.only_files.includes(a))return;var s=new k(o.ownerNode.innerText,a);r?n.push(s):e(s)}})),n.length>0&&e(n),this}},{key:"external",value:function external(e){var t=this;return Object.values(document.styleSheets).forEach((function(r){"LINK"==r.ownerNode.nodeName&&t.__external(r.href,e)})),this}},{key:"__external",value:(e=function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function _next(e){asyncGeneratorStep(i,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,n,o,_next,_throw,"throw",e)}_next(void 0)}))}}(t().mark((function _callee(e,r){var n,o;return t().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.split("/").pop(),o=n.endsWith(".min.css"),this._options.load_min_css||!o){t.next=4;break}return t.abrupt("return");case 4:if(0!=this._options.only_files.length||!this._options.ignore_files.includes(n)){t.next=6;break}return t.abrupt("return");case 6:if(!(this._options.only_files.length>0)||this._options.only_files.includes(n)){t.next=8;break}return t.abrupt("return");case 8:return t.next=10,fetch(e).then((function(e){return e.text()})).then((function(e){return r(new k(e,n))})).catch((function(e){return console.error(e)}));case 10:return t.abrupt("return",t.sent);case 11:case"end":return t.stop()}}),_callee,this)}))),function __external(t,r){return e.apply(this,arguments)})}]),CSSObject}()})(),CSSObject=r.default;CSSObj= new CSSObject})();