-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathotionProd.js
3 lines (3 loc) · 3.87 KB
/
otionProd.js
1
2
3
/*! For license information please see https://github.com/kripod/otion */
function e(e){for(var t,r=0,n=0,o=e.length;o>=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}var t=/^(br|hy|us|wr|text-si|scroll-snap-t)/,r=/^(ap|us|tab-|border-e|margin-e|margin-s|padding-e|padding-s|border-sta)/,n=/^(ap|br|hy|us|wr|mas|colu|clip-|box-de|font-k|text-e|font-fe|shape-i|text-or|text-si|border-e|margin-e|margin-s|padding-e|padding-s|border-sta|background-cl|scroll-snap-t|text-decoration-)/,o=/^(pos|background-cl)/,a={},i="undefined"!=typeof document,s="production"!=="production";function c(){var e=document.getElementById("__otion");return e||((e=document.createElement("style")).id="__otion",e.appendChild(document.createTextNode("")),document.head.appendChild(e))}function u(e){var t=e.nonce,r=e.target,n=void 0===r?c().sheet:r;return n.ownerNode.nonce=t,{sheet:n,insert:function(e,t){return n.insertRule(e,t)}}}function d(e){var t=e.nonce,r=e.target,n=void 0===r?c():r;return n.nonce=t,{sheet:n.sheet,insert:function(e,t){return n.insertBefore(document.createTextNode(e),n.childNodes[t]),t}}}var f={insert:function(){return 0}};function l(e){return e.trim().replace(/\s+/g," ")}var p=/^(-|f[lo].*[^se]$|g.{6,}[^ps]$|z|o[pr]|li.*(t|mp)$|an|(bo|s).{5}im|sca|m.{4}[bi]|ta|c.*[st]$|wido|ini)/,v=/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7}$)|([fl].{5}l|g.{8}$|pl))/,h=new Map([["nk",2],["sited",2],["pty",3],["cus-w",4],["ver",5],["cus",6],["cus-v",7],["tive",8],["sable",9]]);function m(e){return"-"+e.toLowerCase()}function g(){var c,g,b=new Set;function y(e){if(1===e.type){var t=e.selectorText,r=t.indexOf(".",2);b.add(t.slice(1,r<0?9:r))}else y(e.cssRules[0])}function w(e,t){if(s&&!g)throw new Error("On a custom otion instance, `setup()` must be called before usage.");var r="number"!=typeof t||p.test(e)?l(""+t):t+"px";return g(e,r)}function x(e,t){if("object"!=typeof t)return w(e,t);var r="";return t.forEach((function(t){r+=";"+w(e,t)})),r.slice(1)}return{setup:function(e){c=e.injector||(i?s?d({}):u({}):f),g=e.prefix||function(e,i){var s=e+":"+function(e,t){return o.test(e)?t.replace(/(sticky|text)/,"-webkit-$1, $1"):t}(e,i),c=s,u=function(e){return a[e]?a[e]:a[e]=1*t.test(e)|2*r.test(e)|4*n.test(e)}(e);return 1&u&&(c+=";-ms-"+s),2&u&&(c+=";-moz-"+s),4&u&&(c+=";-webkit-"+s),c}},hydrate:function(){for(var e=c.sheet.cssRules,t=0,r=e.length;t<r;++t){var n=e[t];7===n.type?b.add(n.name):y(n)}},css:function(t){return function t(r,n,o,a){var i="";for(var s in r){var u=r[s];if(null!=u)if("object"!=typeof u||Array.isArray(u)){for(var d=s.replace(/[A-Z]/g,m),f=x(d,u),p="_"+e(n+f),g=1,y=3;(y=d.indexOf("-",y)+1)>0;)++g;var w=v.exec(d),$=("."+p).repeat(g+(w?+!!w[1]||-!!w[2]:0));b.has(p)||(c.insert(n.slice(0,a)+$+(null!=a?$.repeat(h.get(n.slice(a+3,a+8))||1)+n.slice(a)+"{":"{")+f+"}"+o,b.size),b.add(p)),i+=" "+p}else{var k=":"===s[0]||"@"===s[0]?s:l(s).replace(/([([]) | ([)\]])| ?(:) ?/g,"$1$2$3"),A="";a||(":"===k[0]?a=n.length:"@"!==k[0]&&(k+="{",A="}")),i+=t(u,n+k,A+o,a)}}return i}(t,"","").slice(1)},keyframes:function(t){var r;return{toString:function(){if(!r){var n="";for(var o in t){n+=o+"{";var a=t[o];for(var i in a){var s=a[i];null!=s&&(n+=x(i,s))}n+="}"}r="_"+e(n),b.has(r)||(c.insert("@keyframes "+r+"{"+n+"}",b.size),b.add(r))}return r}}}}}var b=g();b.setup({});var y=b.setup,w=b.hydrate,x=b.css,$=b.keyframes;export{u as CSSOMInjector,d as DOMInjector,f as NoOpInjector,g as createInstance,x as css,w as hydrate,$ as keyframes,y as setup};
//# sourceMappingURL=bundle.min.mjs.map