UNPKG

@onesy/style-react

Version:

Onesy CSS in JS styling solution for React

6 lines 160 kB
/** @license StyleReact v1.0.2 * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).StyleReact={},e.React)}(this,(function(e,t){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(t);function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function o(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})})),t}var n={},a={},l="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},u={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const s={},r="undefined"!=typeof window&&void 0!==window.document,i=!(void 0===l||!e.exports);t.default=function e(t,o,n={}){var a;const l=Object.assign(Object.assign({},s),n),{variant:u}=l,c=o&&"object"==typeof o&&Object.getPrototypeOf(o);switch(t){case"string":return"string"==typeof o;case"number":return"number"==typeof o&&!Number.isNaN(o);case"boolean":return"boolean"==typeof o;case"array":return Array.isArray(o);case"object":return"object"==typeof o&&!!o&&o.constructor===Object;case"object-like":return"object"==typeof o&&(null===o||o.constructor!==Object);case"class":return("object"==typeof o||"function"==typeof o)&&(/class/gi.test(String(o))||/class/gi.test(String(null==o?void 0:o.constructor)));case"function":return!!(o&&o instanceof Function);case"async":return!(!e("function",o)||!(r?"AsyncFunction"===o.constructor.name:o()instanceof Promise));case"map":return!(c!==Map.prototype);case"weakmap":return!(c!==WeakMap.prototype);case"set":return!(c!==Set.prototype);case"weakset":return!(c!==WeakSet.prototype);case"promise":return!(c!==Promise.prototype);case"int8array":return!(c!==Int8Array.prototype);case"uint8array":return!(c!==Uint8Array.prototype);case"uint8clampedarray":return!(c!==Uint8ClampedArray.prototype);case"int16array":return!(c!==Int16Array.prototype);case"uint16array":return!(c!==Uint16Array.prototype);case"int32array":return!(c!==Int32Array.prototype);case"uint32array":return!(c!==Uint32Array.prototype);case"float32array":return!(c!==Float32Array.prototype);case"float64array":return!(c!==Float64Array.prototype);case"bigint64array":return!(c!==BigInt64Array.prototype);case"biguint64array":return!(c!==BigUint64Array.prototype);case"typedarray":return e("int8array",o)||e("uint8array",o)||e("uint8clampedarray",o)||e("int16array",o)||e("uint16array",o)||e("int32array",o)||e("uint32array",o)||e("float32array",o)||e("float64array",o)||e("bigint64array",o)||e("biguint64array",o);case"dataview":return!(c!==DataView.prototype);case"arraybuffer":return!(c!==ArrayBuffer.prototype);case"sharedarraybuffer":return"undefined"!=typeof SharedArrayBuffer&&!(c!==SharedArrayBuffer.prototype);case"symbol":return!("symbol"!=typeof o);case"error":return!!(o&&o instanceof Error);case"date":return!!(o&&o instanceof Date);case"regexp":return!!(o&&o instanceof RegExp);case"arguments":return!(!o||"[object Arguments]"!==o.toString());case"null":return null===o;case"undefined":return void 0===o;case"blob":return r&&o instanceof Blob;case"buffer":return!(!i||"function"!=typeof(null===(a=null==o?void 0:o.constructor)||void 0===a?void 0:a.isBuffer)||!o.constructor.isBuffer(o));case"element":if(o)switch(u){case void 0:case"html":case"element":return r&&("object"==typeof HTMLElement?o instanceof HTMLElement:o&&"object"==typeof o&&null!==o&&1===o.nodeType&&"string"==typeof o.nodeName);case"node":return r&&("object"==typeof Node?o instanceof Node:o&&"object"==typeof o&&null!==o&&"number"==typeof o.nodeType&&"string"==typeof o.nodeName);case"react":return o.elementType||o.hasOwnProperty("$$typeof");default:return!1}return!1;case"simple":return e("string",o,l)||e("number",o,l)||e("boolean",o,l)||e("undefined",o,l)||e("null",o,l);case"not-array-object":return!e("array",o,l)&&!e("object",o,l);default:return!1}}}(u,u.exports);var c=i(u.exports),d={},h={},p={},f={},y=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(f,"__esModule",{value:!0});const v=y(u.exports),m={decode:!1,decodeMethod:decodeURIComponent};var g=f.default=(e,t={})=>{const s=Object.assign(Object.assign({},m),t);let r=e;try{(0,v.default)("string",e)&&s.decode&&(0,v.default)("function",s.decodeMethod)&&(r=s.decodeMethod(e))}catch(e){}try{if((0,v.default)("string",r)){if("undefined"===r)return;return"NaN"===r?NaN:JSON.parse(r)}return r}catch(e){}return r};!function(e){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.getObjectPropertyValue=void 0;const s=t(u.exports),r=t(f);e.getObjectPropertyValue=(t,i)=>{if(t&&i){if((0,s.default)("string",i)){const s=i.split(".").filter(Boolean).map((e=>(0,r.default)(e)));return(0,e.getObjectPropertyValue)(t,s)}if((0,s.default)("array",i)){const s=i[0];if(1===i.length)return t[s];if(t.hasOwnProperty(s))return(0,e.getObjectPropertyValue)(t[s],i.slice(1))}}},e.default=e.getObjectPropertyValue}(p);var b=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(h,"__esModule",{value:!0});const w=b(p);h.default=(e,...t)=>{if(!e||!t.length)return;let s;const r=t.filter(Boolean);for(const t of r)if(s=(0,w.default)(e,t),void 0!==s)return s};var x=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(d,"__esModule",{value:!0});const S=x(u.exports),k=x(h);var _=d.default=(e,...t)=>{const s={simple:[],array:[],object:[]},r=[];return(0,S.default)("array",e)&&e.forEach((e=>{const i=(0,S.default)("not-array-object",e),o=(0,S.default)("array",e),n=i||!t.length?e:(0,k.default)(e,...t);s[i?"simple":o?"array":"object"].find((e=>n===e))||void 0===n||(r.push(e),s[i?"simple":o?"array":"object"].push(n))})),r},j=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0});const E=j(u.exports),F=j(d),O={response:"array"};a.default=function(e,t={}){const s=Object.assign(Object.assign({},O),t);if((0,E.default)("array",e)){const t=(0,F.default)(e),r=t.length,i=(0,E.default)("number",s.items)?s.items:r;if(i<1)return[t];if(1===i)return t.map((e=>[e]));const o=new Array(i).fill(0);let n=i-2;const a=[];if("array"===s.response){for(;n>=0;){n=i-2;for(let e=0;e<r;e++)o[i-1]=e,a.push(o.map((e=>t[e])));for(;;){if(o[n]!==r-1){o[n]++;break}if(o[n]=0,n--,n<0)break}}return a}if("yield"===s.response)return function*(){for(;n>=0;){n=i-2;for(let e=0;e<r;e++){o[i-1]=e;const s=o.map((e=>t[e]));yield s,a.push(s)}for(;;){if(o[n]!==r-1){o[n]++;break}if(o[n]=0,n--,n<0)break}}return a}}};var A=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0});const M=A(a),N={response:"array"};var C=n.default=function(e,t=0,s={}){const r=Object.assign(Object.assign({},N),s);return(0,M.default)(e,Object.assign(Object.assign({},r),{items:t}))},z={};Object.defineProperty(z,"__esModule",{value:!0});var B=z.default=()=>"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==l?l:void 0;function $(e){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$(e)}function P(e){var t=function(e,t){if("object"!=$(e)||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var r=s.call(e,t||"default");if("object"!=$(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==$(t)?t:t+""}function D(e,t,s){return(t=P(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}var R={};Object.defineProperty(R,"__esModule",{value:!0});const T=e=>Array.isArray(e),I=e=>"object"==typeof e&&!!e&&e.constructor===Object,H=(e,t)=>{const s=t||new WeakSet;if(s.has(e))return e;if((I(e)||T(e))&&s.add(e),T(e))return e.map((e=>H(e,s)));if(I(e)){const t={};return Object.keys(e).forEach((r=>t[r]=H(e[r],s))),t}return e};var V=R.default=H,U={},q={},W={},L={},Z=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(L,"__esModule",{value:!0});const G=Z(u.exports);L.default=e=>(0,G.default)("string",e)?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:e,function(e){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.optionsDefault=void 0;const s=t(u.exports),r=t(L);e.optionsDefault={filters:[",",".","-","_","s+"],replaceWith:" ",trim:!0};e.default=(t,i={})=>{try{const o=Object.assign(Object.assign({},e.optionsDefault),i);if(o.className&&(o.replaceWith="-",o.cammelCaseTransform=!0,o.lowercase=!0),(0,s.default)("string",t)){let e=t;if(o.url){const t=e.split("?").filter(Boolean);let s=t[0];const r=t[1];return"/"===s.slice(-1)&&(s=s.slice(0,-1)),e=r?[s,r].join("?"):s,e}return o.cammelCaseTransform&&(e=e.split(/(?=[A-Z])/g).join(o.replaceWith||" ")),o.filters.forEach((t=>{const s=new RegExp(`\\${t}`,"g");e=e.replace(s,o.replaceWith||" ")})),o.trim&&(e=e.trim()),o.capitalize&&(e=(0,r.default)(e)),o.lowercase&&(e=e.toLocaleLowerCase()),e}return t}catch(e){}return t}}(W);var J=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(q,"__esModule",{value:!0});const K=J(u.exports),X=J(W),Q=J(f),Y={valueOverride:!1},ee=(e,t="",s=void 0,r={})=>{const i=Object.assign(Object.assign({},Y),r);if(!e&&!t)return e;if((0,K.default)("string",t)){const r=t.split(".").filter(Boolean).map((e=>(0,Q.default)(e)));return ee(e,r,s,i)}if((0,K.default)("array",t)){const r=t[0],o=(0,X.default)(String(r),{filters:[".",","],replaceWith:""});if(1!==t.length){((0,K.default)("array",e)&&(0,K.default)("number",r)||(0,K.default)("object",e))&&((null==e?void 0:e.hasOwnProperty(r))&&!i.valueOverride||(e[o]=(0,K.default)("number",t[1])?[]:{}));const n=e[o];return(0,K.default)("object",n)||(0,K.default)("array",n)?ee(e[r],t.slice(1),s,i):e}((0,K.default)("array",e)&&(0,K.default)("number",r)||(0,K.default)("object",e))&&((null==e?void 0:e.hasOwnProperty(r))&&!i.valueOverride||(e[o]=(0,K.default)("number",t[1])?[]:{}),e[(0,K.default)("string",r)?o:r]=s)}return e};q.default=ee;var te=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(U,"__esModule",{value:!0});const se=te(u.exports),re=te(z),ie=te(q),oe={};var ne=U.default=(e,t={})=>{var s,r,i,o;const n=Object.assign(Object.assign({},oe),t);try{return(0,se.default)("function",e)?e():void 0}catch(e){if(n.log){console.error("Try: ",e);const t=(0,re.default)();"test"===(null===(s=t.AMAUI)||void 0===s?void 0:s.env)&&((null===(o=null===(i=null===(r=t.AMAUI)||void 0===r?void 0:r.test)||void 0===i?void 0:i.Try)||void 0===o?void 0:o.logs)||(0,ie.default)(t,"AMAUI.test.Try.logs",[]),t.AMAUI.test.Try.logs.push(e))}}};const ae={emit:{priorValue:!0,copy:!1,pre:{},post:{}}};var le=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};D(this,"methods",[]),D(this,"push",this.emit),this.value=e,this.options=t,this.options={...ae,...this.options}}get length(){return this.methods.length}emit(e){for(var t,s,r,i=arguments.length,o=new Array(i>1?i-1:0),n=1;n<i;n++)o[n-1]=arguments[n];const a=[e,...o];null!==(t=this.options.emit)&&void 0!==t&&t.priorValue&&(this.value=1===a.length?a[0]:a),c("function",null===(s=this.options.emit.pre)||void 0===s?void 0:s.method)&&this.options.emit.pre.method(...a);const l=this.options.emit.copy?V(a):a,u=this.methods.filter((e=>c("function",e)));for(const e of u)ne((()=>e(...l)));c("function",null===(r=this.options.emit.post)||void 0===r?void 0:r.method)&&this.options.emit.post.method(...a)}forEach(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];this.methods.forEach((e=>ne((()=>e(...t)))))}map(e){if(!this.methods.length)return;let t=e;for(const e of this.methods)t=ne((()=>e(t)));return t}subscribe(e){c("function",e)&&-1===this.methods.indexOf(e)&&this.methods.push(e);const t=this;return{unsubscribe:()=>{t.unsubscribe(e)}}}unsubscribe(e){if(c("function",e)&&this.methods.indexOf(e)>-1){const t=this.methods.findIndex((t=>t===e));t>-1&&this.methods.splice(t,1)}}};const ue=e=>pe("string",e)?e.replace(/[A-Z]/g,(e=>"-".concat(e[0]))).toLowerCase():e,ce=e=>pe("string",e)?e.replace(/-./g,(e=>void 0!==e[1]?e[1].toUpperCase():"")):e,de=e=>he(ce(e)),he=e=>pe("string",e)?e.charAt(0).toUpperCase()+e.slice(1):e,pe=(e,t)=>{switch(e){case"string":return"string"==typeof t;case"number":return"number"==typeof t&&!Number.isNaN(t);case"array":return Array.isArray(t);case"boolean":return"boolean"==typeof t;case"null":return null===t;case"undefined":return void 0===t;case"object":return"object"==typeof t&&!!t&&t.constructor===Object;case"function":return!!(t&&t instanceof Function);case"simple":return pe("string",t)||pe("number",t)||pe("boolean",t)||pe("undefined",t)||pe("null",t);default:return}},fe=e=>e instanceof le||pe("function",null==e?void 0:e.emit),ye=e=>{const t=[];if(pe("string",e)){const s=/\$[a-zA-Z1-9_]+/g;t.push(...(e.match(s)||[]).map((e=>e.replace("$",""))))}return t},ve=(e,t,s)=>{const r={value:[],options:{}};if(pe("string",e)&&e.length&&void 0!==t&&s)if(pe("string",t))r.value=[t];else if(pe("number",t)){var i;const o=null===(i=s.subscriptions.rule.unit.map({property:e,value:t}))||void 0===i?void 0:i.value;r.value=[(null==o?void 0:o.value)||t]}else if(pe("array",t)&&t.every((e=>pe("simple",e))))r.value=[t.flatMap((t=>ve(e,t,s).value)).join(" ")];else if(pe("array",t)&&t.every((e=>pe("array",e)||pe("object",e))))r.value=[t.flatMap((t=>ve(e,t,s).value)).join(", ")];else if(pe("object",t))if(t.value){const i=(t.fallbacks||[]).flatMap((t=>ve(e,t,s).value));r.value=[i,ve(e,t.value,s).value].flat().filter(Boolean),t.rule&&(r.options.rule=t.rule)}else{var o;const i=null===(o=s.subscriptions.rule.value.map({property:e,value:t}))||void 0===o?void 0:o.value;r.value=i||[]}else r.value=[t];return r},me=e=>pe("function",e)||fe(e)||pe("object",e)&&Object.keys(e).some((t=>me(e[t])));function*ge(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"abcdefghijklmnopqrstuvwxyz";const s=pe("array",t)?t:t.split("");let r,i=e,o=C(s,i,{response:"yield"})();for(;;){var n;r=o.next(),null!==(n=r)&&void 0!==n&&n.done&&(o=C(s,++i,{response:"yield"})(),r=o.next()),yield r.value.join("")}}const be=function(e){return Number((e/(arguments.length>1&&void 0!==arguments[1]?arguments[1]:16)).toFixed(4))};B().onesy_methods={makeName:ge()};const we=e=>pe("object",e)?(e.hasOwnProperty("className")||Object.defineProperty(e,"className",{get:function(){return Object.keys(e.classNames).map((t=>e.classNames[t])).join(" ")}}),e.hasOwnProperty("class")||Object.defineProperty(e,"class",{get:function(){return Object.keys(e.classes).map((t=>e.classes[t])).join(" ")}}),e.hasOwnProperty("styles")||(e.styles=function(){const t=[];for(var s=arguments.length,r=new Array(s),i=0;i<s;i++)r[i]=arguments[i];return r.forEach((s=>{e.classes[s]&&t.push(e.classes[s])})),t.join(" ")}),e):e;let xe=0;const Se=()=>"".concat(xe++,"-").concat((new Date).getTime());var ke={},_e={},je=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_e,"__esModule",{value:!0});const Ee=je(u.exports);var Fe=_e.default=function e(t,s){let r;switch(t){case"browser":return"undefined"!=typeof window&&void 0!==window.document;case"worker":return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;case"nodejs":return new Function("try {return this===global;}catch(e){return false;}")();case"localhost":return r=void 0!==s?s:e("browser")&&window.location.hostname,(0,Ee.default)("string",r)&&["localhost","127.0.0.1"].some((e=>r.indexOf(e)>-1));default:return!1}},Oe=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ke,"__esModule",{value:!0});const Ae=Oe(u.exports),Me=Oe(_e),Ne=Oe(U);var Ce=ke.default=function e(t){const s={};s.value=t,(0,Ae.default)("string",t)&&(s.value=window.document.querySelector(t)),(0,Ae.default)("element",s.value)||delete s.value;const r=(e=s.value)=>{const t=(0,Ae.default)("element",e)&&(e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.msMatchesSelector);return t?t.bind(e):()=>!1};return s.parent=function(){if(this.value&&(0,Me.default)("browser")&&this.value.parentNode)return this.value.parentNode},s.parents=function(t,s="some"){const i=[];let o=this.value;for(;o&&o!==document;)o=e(o).parent(),o&&(!(null==t?void 0:t.length)||t[s]&&t[s]((e=>(0,Ne.default)((()=>r(o)(e))))))&&i.push(o);return i},s.nearest=function(t,s="some"){if(!(null==t?void 0:t.length)||t[s]&&t[s]((e=>(0,Ne.default)((()=>r(this.value)(e))))))return this.value;let i=this.value;for(;i&&i!==document;)if(i=e(i).parent(),i&&(!(null==t?void 0:t.length)||t[s]&&t[s]((e=>(0,Ne.default)((()=>r(i)(e)))))))return i},s.furthest=function(e,t="some"){const s=this.parents(e,t);return s[s.length-1]},s.hasParent=function(t,s=!0,i="some"){let o=this.value;if(!s)return!(null==t?void 0:t.length)||t[i]&&t[i]((e=>(0,Ne.default)((()=>r(this.parent())(e)))));for(;o&&o!==document;)if(o=e(o).parent(),o&&(!(null==t?void 0:t.length)||t[i]&&t[i]((e=>(0,Ne.default)((()=>r(o)(e)))))))return!0;return!1},s.hasParents=function(e,t=!0,s="some"){if(!(null==e?void 0:e.length))return!!this.parent();const i=this.parents();return!!(this.value&&(null==e?void 0:e.length)&&e[s]&&e[s]((e=>{const s=i.findIndex((t=>(0,Ae.default)("string",e)?(0,Ne.default)((()=>r(t)(e))):t===e));return s>-1&&(t&&i.splice(s,1),!0)})))},s},ze={},Be=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ze,"__esModule",{value:!0});const $e=Be(u.exports),Pe=Be(R),De={copy:!1,merge:{array:!1}},Re=(e,t,s={})=>{const r=Object.assign(Object.assign({},De),s);if(r.merge.array&&(0,$e.default)("array",e)&&(0,$e.default)("array",t)){const s=Math.max(e.length,t.length);for(let i=0;i<s;i++)void 0===e[i]&&(e[i]=t[i]),((0,$e.default)("object",e[i])&&(0,$e.default)("object",t[i])||(0,$e.default)("array",e[i])&&(0,$e.default)("array",t[i]))&&(e[i]=Re(e[i],t[i],r))}return(0,$e.default)("object",e)&&(0,$e.default)("object",t)&&Object.keys(t).forEach((s=>{e.hasOwnProperty(s)?(0,$e.default)("object",e[s])&&(0,$e.default)("object",t[s])&&(e[s]=Re(e[s],t[s],r)):e[s]=r.copy?(0,Pe.default)(t[s]):t[s]})),e};var Te=ze.default=Re;const Ie=()=>Math.floor((new Date).getTime()/1e3),He={value:{copy:!1},add:{override:!0}};class Ve{static meta=new WeakMap;static options_=He;static get options(){return this.options_}static set options(e){this.options_={...this.options,...e}}static class(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return e=>{const[s,r]=t;this.add(s,r,e)}}static method(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return(e,s)=>{const r=e.constructor,[i,o]=t;this.add(i,o,r,s)}}static property(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return(e,s)=>{const r=e.constructor,[i,o]=t;this.add(i,o,r,s)}}static parameter(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return(e,s,r)=>{const i=e.constructor,[o]=t;this.add("onesy-meta-param:".concat(r),o,i,s)}}static add(e,t,s,r){if(!c("simple",s)){const i=this.options.value.copy?V(t):t;let o=this.meta.get(s);if(o||(o=new Map,this.meta.set(s,o)),void 0!==r){let s=o.get(r);if(s||(s=new Map,o.set(r,s)),!s.has(e)||this.options.add.override)return s.set(e,{value:this.options.value.copy?V(t):t,added_at:Ie()}),i}else if(!o.has(e)||this.options.add.override)return o.set(e,{value:this.options.value.copy?V(t):t,added_at:Ie()}),i}}static update(e,t,s,r){if(!c("simple",s)){const i=this.options.value.copy?V(t):t;let o=this.meta.get(s);if(o||(o=new Map,this.meta.set(s,o)),void 0!==r){let t=o.get(r);if(t||(t=new Map,o.set(r,t)),t.has(e)){const s=t.get(e);return s.value=i,s.updated_at=Ie(),t.set(e,s),i}}else if(o.has(e)){const t=o.get(e);return t.value=i,t.updated_at=Ie(),o.set(e,t),i}}}static get(e,t,s){if(!c("simple",t)){const r=this.meta.get(t);if(!r)return;if(void 0!==s){const t=r.get(s);if(!t)return;if(!t.has(e))return;return this.options.value.copy?V(t.get(e).value):t.get(e).value}if(!r.has(e))return;return this.options.value.copy?V(r.get(e).value):r.get(e).value}}static has(e,t,s){if(!c("simple",t)){const r=this.meta.get(t);if(!r)return!1;if(void 0!==s){const t=r.get(s);return!!t&&t.has(e)}return r.has(e)}}static remove(e,t,s){if(!c("simple",t)){const r=this.meta.get(t);if(!r)return;if(void 0!==s){const t=r.get(s);if(!t)return;t.delete(e)}else r.delete(e)}}static values(e,t){if(!c("simple",e)){const s=this.meta.get(e);if(!s)return;if(void 0!==t){const e=s.get(t);return e&&Array.from(e.values())}return s&&Array.from(s.values()).map((e=>e.value))}}static keys(e,t){if(!c("simple",e)){const s=this.meta.get(e);if(!s)return;if(void 0!==t){const e=s.get(t);return e&&Array.from(e.keys())}return s&&Array.from(s.keys())}}static reset(){this.meta=new WeakMap,this.options=He}}var Ue=Ve;var qe=class{make(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{element:{},data:{}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"style";if(Fe("browser")){const s=window.document.createElement(t);return Object.keys((null==e?void 0:e.element)||{}).forEach((t=>s.setAttribute(t,e.element[t]))),Object.keys((null==e?void 0:e.data)||{}).forEach((t=>{s[t]=e.data[t],s.setAttribute(0===t.indexOf("data-")?t:"data-".concat(t),e.data[t])})),s}}add(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"lower",s=arguments.length>2?arguments[2]:void 0;if(Fe("browser")){const o=window.document.styleSheets;if(o.length&&"upper"!==t){var r,i;const n=Array.from(o).find((e=>"reset"===e.ownerNode.method));let a=Array.from(o).filter((e=>"pure"===e.ownerNode.method));a=a[a.length-1],"reset"===(null==s||null===(r=s.data)||void 0===r?void 0:r.method)||"lower"===t&&!a&&!n?window.document.head.insertBefore(e,(null===(i=o[0])||void 0===i?void 0:i.ownerNode)||null):"lower"===t?a?window.document.head.insertBefore(e,a.ownerNode.nextElementSibling):n&&window.document.head.insertBefore(e,n.ownerNode.nextElementSibling):window.document.head.append(e)}else window.document.head.append(e);return e}}remove(e){var t;let s=e;null!=e&&e.ownerNode&&(s=s.ownerNode),null!==(t=s)&&void 0!==t&&t.remove&&s.remove()}};const We={mode:"regular",rule:{sort:!0,prefix:!0,rtl:!1},minify:!0,optimize:!1,classNamePrefix:""};class Le{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:V(We);D(this,"mode","regular"),D(this,"subscriptions",{className:{pre:new le,name:new le,post:new le},keyframes:{pre:new le,name:new le,post:new le},rule:{pre:new le,unit:new le,value:new le,prefix:new le,rtl:new le,add:new le,update:new le,update_props:new le,remove:new le,post:new le},rules:{sort:new le},sheet:{add:new le,update:new le,update_props:new le,remove:new le},sheet_manager:{add:new le,update:new le,update_props:new le,remove:new le}}),D(this,"values",{css:""}),D(this,"refs",{}),D(this,"sheets",[]),D(this,"sheet_managers",[]),this.options=e,this.options=Te(e,We,{copy:!0}),this.init()}get response(){return this.values.css="",this.sheets.forEach((e=>{const t=e.css;t&&(this.values.css+=t)})),this.values.css&&(this.values.css="\n".concat(this.values.css,"\n")),this.options.minify&&(this.values.css=this.values.css.replace(/\n/g,"").replace(/ ?(\{|:|,|>|~) ?/g,"$1").replace(/;(\})/g,"$1")),this.values}get css(){return this.response.css}get plugins(){const e=this;return{set add(t){(pe("array",t)?t:[t]).filter((t=>pe("object",t)&&pe("function",t.method)&&!Ue.get(t.method,e,"plugin")||pe("function",t)&&!Ue.get(t,e,"plugin"))).forEach((t=>{try{const s=pe("function",t)?t:t.method,r=pe("object",t)?t.arguments:[],i=s(e,...r);Ue.add(s,i,e,"plugin")}catch(e){console.error("OnesyStyle use: ",e)}}))},set remove(t){(pe("array",t)?t:[t]).filter((t=>pe("object",t)&&pe("function",t.method)&&!Ue.get(t.method,e,"plugin")||pe("function",t)&&!Ue.get(t,e,"plugin"))).forEach((t=>{try{const s=pe("function",t)?t:t.method,r=Ue.get(s,e,"plugin");pe("function",null==r?void 0:r.remove)&&r.remove()}catch(e){console.error("OnesyStyle remove plugin: ",e)}}))}}}init(){if(this.element=this.options.element||this.element,this.mode=this.options.mode||"regular",this.renderer=this.options.renderer||new qe,void 0===this.id&&(this.id=Se()),Fe("browser")){this.element||(this.element=window.document.body),this.element.setAttribute("data-onesy-style","true"),this.element["onesy-style"]=!0,this.element.onesy_style=this;const e=ne((()=>window.getComputedStyle(this.element)));this.direction=(null==e?void 0:e.direction)||ne((()=>window.getComputedStyle(document.documentElement).direction))||"ltr",this.options.rule.rtl="rtl"===this.direction}}static get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const s=this.all(e);return s[-1===t?s.length-1:t]}static first(e){return this.get(e)}static last(e){return this.get(e,-1)}static nearest(e){var t;return null===(t=Ce(e).nearest(this.attributes.map((e=>"[".concat(e,"]")))))||void 0===t?void 0:t.onesy_style}static furthest(e){var t;return null===(t=Ce(e).furthest(this.attributes.map((e=>"[".concat(e,"]")))))||void 0===t?void 0:t.onesy_style}static all(e){return[e,...Ce(e).parents(this.attributes.map((e=>"[".concat(e,"]"))))].filter(Boolean).map((e=>e.onesy_style)).filter(Boolean)||[]}}D(Le,"counter",{className:0,keyframesName:0}),D(Le,"attributes",["data-onesy-style","onesy-style"]);var Ze=Le,Ge={},Je={exports:{}},Ke={exports:{}};!function(e){var t;e.exports=(t=t||function(e,t){var s;if("undefined"!=typeof window&&window.crypto&&(s=window.crypto),"undefined"!=typeof self&&self.crypto&&(s=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(s=globalThis.crypto),!s&&"undefined"!=typeof window&&window.msCrypto&&(s=window.msCrypto),!s&&void 0!==l&&l.crypto&&(s=l.crypto),!s)try{s=require("crypto")}catch(e){}var r=function(){if(s){if("function"==typeof s.getRandomValues)try{return s.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof s.randomBytes)try{return s.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var s;return e.prototype=t,s=new e,e.prototype=null,s}}(),o={},n=o.lib={},a=n.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=n.WordArray=a.extend({init:function(e,s){e=this.words=e||[],this.sigBytes=s!=t?s:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,s=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var n=s[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=n<<24-(r+o)%4*8}else for(var a=0;a<i;a+=4)t[r+a>>>2]=s[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,s=this.sigBytes;t[s>>>2]&=4294967295<<32-s%4*8,t.length=e.ceil(s/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],s=0;s<e;s+=4)t.push(r());return new u.init(t,e)}}),c=o.enc={},d=c.Hex={stringify:function(e){for(var t=e.words,s=e.sigBytes,r=[],i=0;i<s;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,s=[],r=0;r<t;r+=2)s[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(s,t/2)}},h=c.Latin1={stringify:function(e){for(var t=e.words,s=e.sigBytes,r=[],i=0;i<s;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,s=[],r=0;r<t;r++)s[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(s,t)}},p=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},f=n.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var s,r=this._data,i=r.words,o=r.sigBytes,n=this.blockSize,a=o/(4*n),l=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*n,c=e.min(4*l,o);if(l){for(var d=0;d<l;d+=n)this._doProcessBlock(i,d);s=i.splice(0,l),r.sigBytes-=c}return new u.init(s,c)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});n.Hasher=f.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,s){return new e.init(s).finalize(t)}},_createHmacHelper:function(e){return function(t,s){return new y.HMAC.init(e,s).finalize(t)}}});var y=o.algo={};return o}(Math),t)}(Ke),function(e){var t;e.exports=(t=Ke.exports,function(e){var s=t,r=s.lib,i=r.WordArray,o=r.Hasher,n=s.algo,a=[],l=[];!function(){function t(t){for(var s=e.sqrt(t),r=2;r<=s;r++)if(!(t%r))return!1;return!0}function s(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)t(r)&&(i<8&&(a[i]=s(e.pow(r,.5))),l[i]=s(e.pow(r,1/3)),i++),r++}();var u=[],c=n.SHA256=o.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(e,t){for(var s=this._hash.words,r=s[0],i=s[1],o=s[2],n=s[3],a=s[4],c=s[5],d=s[6],h=s[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var f=u[p-15],y=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,v=u[p-2],m=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[p]=y+u[p-7]+m+u[p-16]}var g=r&i^r&o^i&o,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=h+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&c^~a&d)+l[p]+u[p];h=d,d=c,c=a,a=n+w|0,n=o,o=i,i=r,r=w+(b+g)|0}s[0]=s[0]+r|0,s[1]=s[1]+i|0,s[2]=s[2]+o|0,s[3]=s[3]+n|0,s[4]=s[4]+a|0,s[5]=s[5]+c|0,s[6]=s[6]+d|0,s[7]=s[7]+h|0},_doFinalize:function(){var t=this._data,s=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return s[i>>>5]|=128<<24-i%32,s[14+(i+64>>>9<<4)]=e.floor(r/4294967296),s[15+(i+64>>>9<<4)]=r,t.sigBytes=4*s.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});s.SHA256=o._createHelper(c),s.HmacSHA256=o._createHmacHelper(c)}(Math),t.SHA256)}(Je);var Xe=Je.exports,Qe={},Ye=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qe,"__esModule",{value:!0});const et=Ye(u.exports),tt=(e,t)=>{let s=t(e);if(void 0===s)return"";try{(0,et.default)("object-like",s)&&(0,et.default)("not-array-object",s)&&null!==s&&(s=Object.assign({},s))}catch(e){}return(0,et.default)("object",s)?`{${Object.keys(s).sort().map((e=>`"${e}":${tt(s[e],t)}`)).filter((e=>":"!==e.slice(-1))).join(",")}}`:(0,et.default)("array",s)?`[${s.map((e=>tt(e,t))).filter(Boolean).join(",")}]`:(0,et.default)("string",s)?`"${s}"`:(e=>(0,et.default)("string",e)?e.replace(/(\s|\r|\n)+/," "):e)(JSON.stringify((e=>void 0===e?"undefined":e instanceof Function||e instanceof Object?e.toString():e)(s)))};Qe.default=e=>{const t=new WeakSet;return tt(e,(e=>{if("object"==typeof e&&null!==e){if(t.has(e))return;t.add(e)}return e}))};var st=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ge,"__esModule",{value:!0});const rt=st(Je.exports),it=st(Qe),ot={serialize:!0,withPrefix:!0};var nt=Ge.default=(e,t={})=>{const s=Object.assign(Object.assign({},ot),t);let r=e;return s.serialize&&(r=(0,it.default)(r)),r=(0,rt.default)(r).toString(),s.withPrefix?`0x${r}`:r};const at={value_version:"value",pure:!1,parents:[],sort:!0,prefix:!0,rtl:!0};class lt{constructor(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:at;D(this,"value_version","value"),D(this,"pure",!1),D(this,"parents",[]),D(this,"values",{property:"",value:"",css:""}),this.value=e,this.property=t,this.options=s,this.init()}get parent(){return this.parents[this.parents.length-1]}get response(){return{css:this.values.css}}get css(){return this.response.css}updateValues(){this.values.css="".concat(this.values.property,": ").concat(this.values.value,";"),this.values.css.indexOf("undefined")>-1&&(this.values.css="")}init(e){var t,s,r,i;this.values.property=ue(this.property),this.values.value=void 0!==e?e:this.value,this.value_version=this.options.value_version||"value",this.pure=void 0!==this.options.pure&&this.options.pure,this.owner=this.options.owner,this.parents=this.options.parents||[],this.onesyStyle=this.options.onesyStyle,this.onesyStyleSheet=this.options.onesyStyleSheet,this.onesyStyleRule=this.options.onesyStyleRule,void 0===this.id&&(this.id=Se()),void 0===this.level&&(this.level=this.parents.length-1),this.parents.filter((e=>!(e instanceof gt))).forEach((e=>e.rules_owned.push(this))),void 0===e&&["method","onesy_subscription"].indexOf(this.value_version)>-1&&("method"===this.value_version?this.values.value=ne((()=>this.value(this.onesyStyleSheet.props))):"onesy_subscription"===this.value_version&&(this.values.value=this.value.value,this.value.subscribed||(this.value.subscribed=[]),-1===this.value.subscribed.indexOf(this)&&(this.value.subscribe(this.update.bind(this)),this.value.subscribed.push(this))),this.values.value=pe("function",this.values.value)?ne((()=>this.values.value(this.onesyStyleSheet.props))):this.values.value),this.values.value=ve(this.values.property,this.values.value,this.onesyStyle).value[0];if(this.onesyStyle.options.rule.rtl&&(void 0===this.onesyStyleSheet||!1!==this.onesyStyleSheet.options.rule.rtl)&&(void 0===(null===(t=this.onesyStyleSheet)||void 0===t?void 0:t.onesyTheme)||this.onesyStyleSheet.onesyTheme.options.rule.rtl)&&!1!==(null===(s=this.parent)||void 0===s?void 0:s.options.rtl)){const e=this.onesyStyle.subscriptions.rule.rtl.map(this.values);var o,n;if(null!=e&&e.value)null!=e&&null!==(o=e.value)&&void 0!==o&&o.property&&(this.values.property=e.value.property),null!=e&&null!==(n=e.value)&&void 0!==n&&n.value&&(this.values.value=e.value.value)}if(this.onesyStyle.options.rule.prefix&&(void 0===this.onesyStyleSheet||!1!==this.onesyStyleSheet.options.rule.prefix)&&(void 0===(null===(r=this.onesyStyleSheet)||void 0===r?void 0:r.onesyTheme)||!1!==this.onesyStyleSheet.onesyTheme.options.rule.prefix)&&!1!==(null===(i=this.parent)||void 0===i?void 0:i.options.prefix)&&0!==this.values.property.indexOf("-")&&ne((()=>0!==this.values.value.indexOf("-")))){var a;const e=(null===(a=this.onesyStyle.subscriptions.rule.prefix.map({value:this.values.value,property:this.values.property}))||void 0===a?void 0:a.value)||[];e.length&&e.forEach((e=>{var t;!((null===(t=this.parent)||void 0===t?void 0:t.rules)||[]).find((t=>t instanceof lt&&t.values.property===e.property&&t.values.value===e.value))&&this.parent&&lt.make(e.value,e.property,{value_version:"value",pure:this.pure,owner:this.parent,parents:this.parents,onesyStyleRule:this.onesyStyleRule,onesyStyleSheet:this.parent.onesyStyleSheet,onesyStyle:this.parent.onesyStyle})}))}if(this.owner){this.owner.rules.find((e=>e.value.id===this.id))||this.owner.rules.push({property:this.property,value:this}),this.level_actual=this.owner.level_actual+1}this.updateValues()}update(e){var t;void 0!==e&&this.init(e),this.makeSelector(),void 0===e&&["method","onesy_subscription"].indexOf(this.value_version)>-1&&("method"===this.value_version?this.values.value=ne((()=>this.value(this.onesyStyleSheet.props))):"onesy_subscription"===this.value_version&&(this.values.value=this.value.value),this.values.value=pe("function",this.values.value)?ne((()=>this.values.value(this.onesyStyleSheet.props))):this.values.value,this.values.value=ve(this.values.property,this.values.value,this.onesyStyle).value[0]),this.updateValues();const s=this.onesyStyleSheet.domElementForTesting||Fe("browser")&&window.document.createElement("div");s&&(s.style[this.values.property]=this.values.value);const r=(null==s||null===(t=s.style)||void 0===t?void 0:t[this.values.property])||this.values.value;if(this.owner.rule&&this.owner.rule.style[this.values.property]!==r){var i;const e=this.owner.owner.rule||this.owner.owner.sheet;if(pe("string",this.values.value)&&null!==(i=this.values.value)&&void 0!==i&&i.includes("!important")){let t=Array.from((null==e?void 0:e.cssRules)||[]).findIndex((e=>e===this.owner.rule));t>-1&&(ne((()=>e.deleteRule(t))),this.owner.updateValues(),t=ne((()=>e.insertRule(this.owner.values.css))),t>-1&&(this.owner.rule=e.cssRules[t]))}else ne((()=>this.owner.rule.style[this.values.property]=this.values.value));this.values.css="".concat(this.values.property,": ").concat(this.values.value,";")}}remove(){this.clear()}makeSelector(){if(["animation","animation-name"].some((e=>this.values.property.indexOf(e)>-1))){const e=ye(this.values.value),t=e.map((e=>this.onesyStyleSheet.onesyStyleSheetManager.names.keyframes[e])).filter(Boolean);e.forEach(((e,s)=>this.values.value=this.values.value.replace("$".concat(e),t[s]))),this.updateValues()}}clear(){var e;if(null!==(e=this.owner)&&void 0!==e&&e.rule&&(this.owner.rule.style[this.values.property]=""),this.owner){const e=this.owner.rules.findIndex((e=>e.value===this));e>-1&&this.owner.rules.splice(e,1)}this.parents.filter((e=>!(e instanceof gt))).forEach((e=>{const t=e.rules_owned.findIndex((e=>e.value===this));t>-1&&e.rules_owned.splice(t,1)}))}static make(e,t){return new lt(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{value_version:"value",pure:!1,parents:[this]})}}var ut=lt;function ct(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[];const i=(e,t)=>{pe("string",e)&&e.length?r.push(e):pe("object",e)?Object.keys(e).forEach((t=>i(e[t],t))):pe("array",e)?e.forEach((e=>i(e))):t&&e&&r.push(t)};return i(e),r=r.filter(Boolean).map((e=>{let s=e.trim();return[".","#"].indexOf(s[0])>-1&&(s=s.slice(1)),"".concat(t||"").concat(s)})),r=_(r),s?r:r.join(" ")}const dt={mode:"regular",value_version:"value",version:"property",pure:!1,index:0,sort:!0,prefix:!0,rtl:!0},ht=B();class pt{constructor(e,t){var s=this;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:dt;D(this,"value_version","value"),D(this,"mode","regular"),D(this,"version","property"),D(this,"pure",!1),D(this,"index",0),D(this,"parents",[]),D(this,"status","idle"),D(this,"isVariable",!1),D(this,"static",!0),D(this,"rules_owned",[]),D(this,"className_",""),D(this,"selector_",""),D(this,"classNames_",""),D(this,"keyframesName_",""),D(this,"values",{value:void 0,css:""}),D(this,"rules",[]),D(this,"makeRuleClassNameDefault",(function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"a";return"".concat((null===(e=s.onesyStyle.options)||void 0===e?void 0:e.classNamePrefix)||"").concat(t,"-").concat(++s.counter.className)})),D(this,"makeRuleKeyframesNameDefault",(function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"a";return"".concat((null===(e=s.onesyStyle.options)||void 0===e?void 0:e.classNamePrefix)||"").concat(t,"-").concat(++s.counter.keyframesName)})),this.value=e,this.property=t,this.options=r,this.options={...dt,...this.options},this.init()}get selector(){return this.selector_}set selector(e){this.selector_=e}get className(){return this.className_}set className(e){"at-rule"===this.parent.version||(this.className_=e,this.classNames.match(new RegExp("^(.)?".concat(this.className," | (.)?").concat(this.className," | (.)?").concat(this.className,"$"),"g"))||(this.classNames="".concat(this.className," ").concat(this.classNames).trim()),this.onesyStyleSheet.names.classNames[this.property]=this.className,"static"===this.onesyStyleSheet.version&&this.onesyStyleSheet.onesyStyleSheetManager&&(this.onesyStyleSheet.onesyStyleSheetManager.names.classNames[this.property]=this.className))}get classNames(){return this.classNames_}set classNames(e){this.classNames_=e,this.onesyStyleSheet.names.classes[this.property]=this.classNames,"static"===this.onesyStyleSheet.version&&this.onesyStyleSheet.onesyStyleSheetManager&&(this.onesyStyleSheet.onesyStyleSheetManager.names.classes[this.property]=this.classNames)}get keyframesName(){return this.keyframesName_}set keyframesName(e){this.keyframesName_=e;const t=0===this.property.indexOf("@")?this.property.split(" ")[1]:this.property;this.onesyStyleSheet.names.keyframes[t]=this.keyframesName,"static"===this.onesyStyleSheet.version&&this.onesyStyleSheet.onesyStyleSheetManager&&(this.onesyStyleSheet.onesyStyleSheetManager.names.keyframes[t]||(this.onesyStyleSheet.onesyStyleSheetManager.names.keyframes[t]=this.keyframesName))}get hash(){return this.hash_}get parent(){return this.parents[this.parents.length-1]}get response(){return{css:this.values.css}}get css(){return this.response.css}get allOwnedCss(){let e=this.values.css;return this.rules_owned.filter((e=>e instanceof pt)).forEach((t=>e+="\n\n".concat(t.allOwnedCss))),e=e.replace("".concat(this.selector||this.property," {"),"AMAUI_ITEM {"),e}get counter(){return Ze.counter}updateValues(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=this.selector||this.property;this.values.css="".concat(t," {\n");let s=!0;this.rules.forEach(((e,t)=>{const r=e.value.css;r&&(s=!1,this.values.css+="".concat(" ".repeat(e.value.level_actual)).concat(r).concat("\n".repeat(e.value instanceof pt&&t!==this.rules.length-1?2:1)))})),this.values.css+="".concat(" ".repeat(this.level_actual),"}"),!s||this.className&&"static"!==this.onesyStyleSheet.version||(this.values.css=""),e&&this.makeHash()}makeHash(){this.hash||!this.static||!this.onesyStyleSheet.onesyStyle.options.optimize||"static"!==this.onesyStyleSheet.version||"property"!==this.version||this.isVariable&&"atomic"===this.onesyStyleSheet.mode||(this.hash_=nt("atomic"===this.onesyStyleSheet.mode?this.css:this.allOwnedCss))}init(e){var t,s=this;let r=void 0!==e?e:this.value;this.mode=this.options.mode||"regular",this.version=this.options.version||"property",this.pure=void 0!==this.options.pure?this.options.pure:this.pure,this.index=void 0!==this.options.index?this.options.index:this.index,this.owner=this.options.owner,this.parents=this.options.parents||[],this.onesyStyleSheet=this.options.onesyStyleSheet,this.onesyStyle=this.options.onesyStyle,void 0===this.id&&(this.id=Se()),void 0===this.level&&(this.level=this.parents.length-1),this.owner&&(this.level_actual=void 0===this.owner.level_actual?0:this.owner.level_actual+1),this.parents.filter((e=>!(e instanceof gt))).forEach((e=>e.rules_owned.push(this)));pe("string",r)&&(r=(()=>{const e={};return r.trim().split("\n").filter(Boolean).map((e=>e.trim())).forEach((t=>{if(t){const s=t.split(":");let r=s[1];const i=s[0];r=r&&r.trim().replace(";",""),i&&r&&(e[i]=g(r,{decode:!1}))}})),e})()),pe("object",r)&&(void 0!==r["@pure"]&&(this.pure=!!r["@pure"]),void 0!==r["@p"]&&(this.pure=!!r["@p"])),this.pure||0!==this.level||0===this.property.indexOf("@")||(this.isVariable=!0),pe("function",r)?this.value_version="method":fe(r)?(this.value_version="onesy_subscription",r.subscribed||(r.subscribed=[]),-1===r.subscribed.indexOf(this)&&(r.subscribe(this.update.bind(this)),r.subscribed.push(this))):this.values.value=r;const i=0===(null===(t=this.property)||void 0===t?void 0:t.indexOf("@"));if(this.version=i?"at-rule":"property",["method","onesy_subscription"].indexOf(this.value_version)>-1&&("method"===this.value_version?this.values.value=ne((()=>r(this.onesyStyleSheet.props))):"onesy_subscription"===this.value_version&&(this.values.value=this.value.value),this.values.value=pe("function",this.values.value)?ne((()=>this.values.value(this.onesyStyleSheet.props))):this.values.value),r=this.values.value,pe("object",r)){if(r["@classNames"]||r["@cs"]){const e=ct(r["@classNames"]||r["@cs"]);this.classNames.match(new RegExp("^".concat(e," | ").concat(e," | ").concat(e,"$"),"g"))||(this.classNames="".concat(this.classNames||""," ").concat(e).trim())}(r["@options"]||r["@o"])&&(this.options=Te(r["@options"]||r["@o"]||{},this.options));const e=Object.keys(r),t=this.rules_owned;this.rules=[],this.rules_owned=[],e.forEach((e=>this.addProperty(e,r[e],this.rules.length,!1,!1))),t.forEach((e=>e.remove())),this.unique;const i=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:s).rules.some((e=>pe("function",e.value.value)||fe(e.value.value)||e.value instanceof pt&&i(e.value)))};this.static=!i()}if(this.owner){this.owner.rules.find((e=>e.value.id===this.id))||this.owner.rules.push({property:this.property,value:this})}this.updateValues(),this.status="inited"}addProperty(e,t){var s;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.rules.length,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];const n=0===e.indexOf("@"),a=this,l="at-rule"===this.version,u=l&&(null===(s=a.property)||void 0===s?void 0:s.indexOf("@keyframes"))>-1,c=e.indexOf("&")>-1||l||u,d=!(n||c)||["@font-face"].includes(a.property);if(!(["@classNames","@cs","@options","@o","@pure","@p"].indexOf(e)>-1)){if(d){const s=ue(e),{value:i=[],options:o}=ve(s,t,this.onesyStyle);i.forEach((e=>{"regular"!==this.onesyStyleSheet.mode&&a.isVariable?"atomic"===this.onesyStyleSheet.mode&&a.isVariable&&pt.make({[s]:e},ht.onesy_methods.makeName.next().value,{mode:"atomic",version:"property",pure:this.pure,index:this.index+1+r,owner:a.parent,parents:[...a.parents,a],onesyStyleSheet:a.onesyStyleSheet,onesyStyle:a.onesyStyle}):e&&ut.make(e,s,{value_version:pe("function",e)||fe(e)?pe("function",e)?"method":"onesy_subscription":"value",pure:this.pure,owner:a,parents:[...a.parents,a],onesyStyleRule:a,onesyStyleSheet:a.onesyStyleSheet,onesyStyle:a.onesyStyle,...o.rule})}))}else{let s;this.onesyStyle.subscriptions.rule.pre.emit(null);const i=[...a.parents,a],o=["@import","@charset","@namespace","@color-profile","@property","@font-feature-values","@counter-style","@keyframes","@font-face","@page"],l=["@media","@supports"];if(u)s=pt.make(t,e,{mode:"regular",version:n?"at-rule":"property",pure:!1,index:r,owner:a,parents:i,onesyStyleSheet:a.onesyStyleSheet,onesyStyle:a.onesyStyle});else if(n&&o.some((t=>0===e.indexOf(t))))s=pt.make(t,e,{mode:"regular",version:n?"at-rule":"property",pure:!1,index:r,owner:this.onesyStyleSheet,parents:i,onesyStyleSheet:a.onesyStyleSheet,onesyStyle:a.onesyStyle});else if(n&&l.some((t=>0===e.indexOf(t)))||c){let o;for(let e=i.length-1;e>=0&&(o=i[e],!("at-rule"===o.version&&l.some((e=>0===o.property.indexOf(e)))||o instanceof gt));e--);s=pt.make(t,e,{mode:"regular",version:n?"at-rule":"property",pure:!1,index:r,owner:o,parents:i,onesyStyleSheet:a.onesyStyleSheet,onesyStyle:a.onesyStyle})}this.onesyStyle.subscriptions.rule.post.emit(s)}if(i&&this.unique,o){this.add()||this.rules_owned.forEach((e=>e.update()))}}}add(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.css||this.updateValues(),this.makeSelector(),this.rules_owned.filter((e=>e instanceof pt)).forEach((e=>e.add())),e&&this.updateValues(),"active"===this.onesyStyleSheet.status)return this.addRuleToCss();this.status="active"}updateProps(){["method","onesy_subscription"].indexOf(this.value_version)>-1&&this.init(),this.add(!1),this.rules_owned.forEach((e=>e.update())),this.updateValues(),this.onesyStyle.subscriptions.rule.update_props.emit(this)}update(e){(void 0!==e||["method","onesy_subscription"].indexOf(this.value_version)>-1)&&this.init(e),this.add(!1),this.rules_owned.forEach((e=>e.update())),this.updateValues(),this.onesyStyle.subscriptions.rule.update.emit(this)}remove(){this.rules_owned.filter((e=>e instanceof pt)).forEach((e=>e.remove()));const e=this.onesyStyle.refs[this.hash];if(!e||e.main.rule===this&&!e.refs.length){if(e&&delete this.onesyStyle.refs[this.hash],this.onesyStyleSheet.sheet){const e=Array.from(this.onesyStyleSheet.sheet.cssRules).findIndex((e=>e===this.rule));e>-1&&this.onesyStyleSheet.sheet.deleteRule(e)}this.clear()}else if(e&&e.main.rule!==this){const t=e.refs.indexOf(this.onesyStyleSheet);t>-1&&e.refs.splice(t,1),e.refs.length||"remove"!==e.main.sheet.status||e.main.sheet.remove(),this.clear()}}addRuleToCss(){if(!this.rule&&!this.ref){const e=this.css;if(e){const t=this.owner.sheet||this.owner.rule;if(null!=t&&t.cssRules){let s=t.cssRules.length;if(s=ne((()=>t.insertRule(e,s))),void 0!==s){const e=t.cssRules[s];return this.rule=e,this.onesyStyle.subscriptions.rule.add.emit(this),!0}}}}}addRuleRef(){if(!this.rule){const e=this.owner.sheet||this.owner.rule;if(null!=e&&e.cssRules){const t=Array.from(e.cssRules).find((e=>e.selectorText===this.selector));void 0!==t&&(this.rule=t),this.rules_owned.filter((e=>e instanceof pt)).forEach((e=>e.addRuleRef()))}}}makeSelector(){if(!this.selector){this.hash||this.makeHash();const e="at-rule"===this.parent.version,t=0===this.property.indexOf("@keyframes");if(this.isVariable||"atomic"===this.mode||t)this.makeRuleClassName(),this.makeRuleKeyframesName();else if(this.selector=this.property,e&&"property"===this.version){let e=this.parent;for(;"at-rule"===e.version;)e=e.parent;this.selector=this.selector.replace(/&/g,e.selector);ye(this.property).forEach((e=>{const t=this.makeClassName(e),s=new RegExp("\\$".concat(e),"g");this.selector=this.property.replace(s,".".concat(t))}))}els