@windijs/helpers
Version:
@windijs/helpers
2 lines (1 loc) • 19.2 kB
JavaScript
var windijsHelpers=function(t,e){"use strict";function r(t,e){return Object.entries(e).reduce(((t,[e,n])=>(t[e]=n&&"object"==typeof n?r(t[e]=t[e]||(Array.isArray(n)?[]:{}),n):n,t)),t)}const n=Symbol.for("css"),a=Symbol.for("meta"),s=Symbol.for("data"),i=Symbol.for("proxy");function o(t){return null!=t&&("object"==typeof t||"function"==typeof t)&&null!=t[n]}function u(t){return Array.isArray(t)&&t.find((t=>o(t)||u(t)))}function l(t){return t[a].variants}function c(t){const{uid:e,children:r,props:n}=t[a];return Array.isArray(r)&&(t=r[0]),[e,...null!=n?n:[]].filter((t=>null!=t))}function h(t){return l(t).map((t=>t+":")).join("")+c(t).join(".")}function p(t){let e=t[n];for(const r of t[a].variants)e={[r]:e};return e}function f(t){let n;const a=new Map;for(const s of t.flat().filter((t=>null!=t))){n=p(s);for(const[t,s]of e.entries(n))null!=s&&a.set(t,a.has(t)&&"object"==typeof s?r(a.get(t),s):s)}return a}function g(t){const e=t.length;let r,n=-1,a="";const s=t.charCodeAt(0);for(;++n<e;)r=t.charCodeAt(n),a+=0!==r?44!==r?r>=1&&r<=31||127===r||0===n&&r>=48&&r<=57||1===n&&r>=48&&r<=57&&45===s?"\\"+r.toString(16)+" ":(0!==n||1!==e||45!==r)&&(r>=128||45===r||95===r||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122)?t.charAt(n):"\\"+t.charAt(n):"\\2c ":"�";return a}let d=j,y=0;const b={};function m(t){if(t<26)return String.fromCharCode(t+97);const e=(t-26)%36;return m(Math.floor((t-26)/36))+(e<10?e.toString():String.fromCharCode(e+87))}function j(t){const e=h(t);return e in b?b[e]:b[e]=m(y++)}function v(t){return d(t)}function S(t,r=[],n=0,a=n+2){const s=[];for(const i of r)s.push("string"==typeof i?e.indent(i,a):S(i.selector,i.body,a+2));return[e.indent(t,n)+" {",...s,e.indent("}",n)].join("\n")}function x(t,r){const n=[],a={selector:r,children:[]};for(const[s,i]of e.entries(t))if("string"==typeof i||i instanceof String)a.children.push({property:s,value:i});else if("number"==typeof i)a.children.push({property:s,value:i.toString()});else if(Array.isArray(i))i.map((t=>a.children.push({property:s,value:t})));else if("object"==typeof i&&null!=i){a.children[0]&&n.push({...a}),a.children=[];const t=64===r.charCodeAt(0)?{[r]:i}:i;64===s.charCodeAt(0)?n.push({rule:s,children:x(t,r)}):n.push(...x(t,s.replace(/&/g,r)))}return a.children[0]&&n.push(a),n}function w({value:t,property:r}){return Array.isArray(t)?t.map((t=>r+": "+t+";")):r.startsWith("webkit")?"-":e.camelToDash(r)+": "+t+";"}function A({selector:t,children:e},r=0){return S(t,e.map((t=>w(t))).flat(),r)}function C({rule:t,children:e},r=0){return S(t,M(e,r+2),r,0)}function M(t,e=0){const r=[];for(const n of t)r.push("selector"in n?A(n,e):C(n,e));return r}function $(t){return M(t).join("\n\n")}function R(t){const e=[],r={};for(const n of t)"selector"in n?e.push(n):n.rule in r?r[n.rule].children.push(...n.children):r[n.rule]=n;return[...e,...Object.values(r)]}function O(t,e){return $(x(p(e),"."+t))}const P=(t,e)=>$(x(f(e),t));function k(t){return+t.toFixed(10)}function L(t){let e=t.toString(16);return e="00".slice(0,2-e.length)+e,e}function G(t){return"#"+t.slice(0,3).map(L).join("").toLowerCase()}function W(t){4===t.length?t="#"+[t[1],t[1],t[2],t[2],t[3],t[3]].join(""):5===t.length&&(t="#"+[t[1],t[1],t[2],t[2],t[3],t[3],t[4],t[4]].join(""));const e=+("0x"+t.substring(1));return 9===t.length?[e>>24&255,e>>16&255,e>>8&255,(255&e)/256]:[e>>16&255,e>>8&255,255&e,1]}function T(t){const e=t[0]/255,r=t[1]/255,n=t[2]/255,a=Math.max(e,r,n),s=Math.min(e,r,n);let i,o;const u=(a+s)/2,l=a-s;return 0===l?i=o=0:(o=u<.5?l/(a+s):l/(2-a-s),i={[e]:()=>60*(r-n)/l+(r<n?360:0),[r]:()=>60*(n-e)/l+120,[n]:()=>60*(e-r)/l+240}[a]()),[i,100*o,100*u].concat([t[3]])}function H(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function X(t){let e,r,n;const a=t[0]/360,s=t[1]/100,i=t[2]/100;if(0===s)e=r=n=i;else{const t=i<.5?i*(1+s):i+s-i*s,o=2*i-t;e=H(o,t,a+1/3),r=H(o,t,a),n=H(o,t,a-1/3)}return[e,r,n].map((function(t){return Math.round(255*t)})).concat([t[3]])}function B(t,e,r,n=1){const a=t%360/360;let s=e/100,i=r/100;const o=s+i;o>1&&(s/=o,i/=o);const u=1-s-i;function l(t){const e=H(0,1,t)*u+s;return Math.round(255*e)}return[l(a+1/3),l(a),l(a-1/3),n]}function N(t,e,r=0,n=0,a=100){return(t=[...t])[n]=e?Math.max(Math.min(t[n]+e,a),0):r>=0?Math.floor((a-t[n])*r/100+t[n]):Math.floor(t[n]-t[n]*Math.abs(r)/100),t}function Y(t,e){return(t=[...t])[0]=t[0]+e,t}const _=(t,e,r=0)=>N(t,e,r,1),D=(t,e,r=0)=>N(t,e,r,2),J=(t,e,r=0)=>N(t,e,r,0,255),Z=(t,e,r=0)=>N(t,e,r,1,255),I=(t,e,r=0)=>N(t,e,r,2,255),E=(t,e,r=0)=>((t=[...t])[3]=e?Math.round(100*Math.max(Math.min(t[3]+e,1),0))/100:r>=0?Math.floor((1-t[3])*r+100*t[3])/100:Math.floor(t[3]*(100+r))/100,t);function U(t,e,r=50){const n=r/100,a=2*n-1,s=t[3]-e[3],i=((a*s==-1?a:(a+s)/(1+a*s))+1)/2,o=1-i;return[Math.round(t[0]*i+e[0]*o),Math.round(t[1]*i+e[1]*o),Math.round(t[2]*i+e[2]*o),t[3]*n+e[3]*(1-n)]}function z(t,e,r=50){return t.map(((t,n)=>3===n?e[n]+r/100*(t-e[n]):Math.floor(e[n]+r/100*(t-e[n]))))}class V{constructor(t,e,r){Array.isArray(t)?(null==t[3]&&t.push(1),this.rgbaval=t,this.hexval=G(this.rgbaval)):(this.hexval=t,this.rgbaval=null!=e?e:W(t)),this.hslaval=null!=r?r:T(this.rgbaval)}static hex(t){const e=t.toLowerCase(),r=W(e),n=T(r);return new V(e,r,n)}static rgb(t,e,r,n=1){return V.rgba(t,e,r,n)}static rgba(t,e,r,n){const a=[t,e,r,n],s=G(a),i=T(a);return new V(s,a,i)}static hsl(t,e,r,n=1){return V.hsla(t,e,r,n)}static hsla(t,e,r,n){const a=[t,e,r,n],s=X(a),i=G(s);return new V(i,s,a)}static hwb(t,e,r,n=1){return V.rgba(...B(t,e,r,n))}get hex(){const t=this.hexval;return t[1]===t[2]&&t[3]===t[4]&&t[5]===t[6]?"#"+t[1]+t[3]+t[5]:t}get rgb(){return this.rgba.slice(0,3)}get rgba(){return this.rgbaval}get hsl(){return this.hsla.slice(0,3)}get hsla(){return this.hslaval.map((t=>k(t)))}get hwb(){return[this.hue,this.whiteness,this.blackness]}static mix(t,e,r=50){return V.rgba(...U(t.rgbaval,e.rgbaval,r))}static subcolormix(t,e,r=50){return V.rgba(...z(t.rgbaval,e.rgbaval,r))}get red(){return this.rgbaval[0]}get green(){return this.rgbaval[1]}get blue(){return this.rgbaval[2]}get hue(){return k(this.hslaval[0])}get saturation(){return k(this.hslaval[1])}get lightness(){return k(this.hslaval[2])}get alpha(){return this.rgbaval[3]}get opacity(){return this.alpha}get whiteness(){const[t,e,r]=this.rgbaval;return k(Math.min(Math.min(t,e),r)/255*100)}get blackness(){const[t,e,r]=this.rgbaval;return k(100-Math.max(Math.max(t,e),r)/255*100)}get ieHexStr(){return"#"+(L(255*this.alpha)+this.hexval.slice(1)).toUpperCase()}get rgbStr(){return`rgb(${this.rgb.join(", ")})`}get rgbaStr(){return`rgba(${this.rgba.join(", ")})`}get hslStr(){const[t,e,r]=this.hsl;return`hsl(${t}, ${e}%, ${r}%)`}get hslaStr(){const[t,e,r,n]=this.hsla;return`hsla(${t}, ${e}%, ${r}%, ${n})`}get hwbStr(){const[t,e,r]=this.hwb,n=this.opacity;return n<1?`hwb(${t} ${e}% ${r}% / ${n})`:`hwb(${t} ${e}% ${r}%)`}invert(t=100){const e=this.rgba.map(((t,e)=>3===e?t:Math.round(255-t)));return V.mix(new V(G(e),e,T(e).concat([e[3]])),this,t)}adjustRed(t,e=0){return V.rgba(...J(this.rgbaval,t,e))}adjustGreen(t,e=0){return V.rgba(...Z(this.rgbaval,t,e))}adjustBlue(t,e=0){return V.rgba(...I(this.rgbaval,t,e))}adjustHue(t){return V.hsla(...Y(this.hslaval,t))}adjustSaturation(t,e=0){return V.hsla(..._(this.hslaval,t,e))}adjustLightness(t,e=0){return V.hsla(...D(this.hslaval,t,e))}adjustAlpha(t,e=0){return V.hsla(...E(this.hslaval,t,e))}complement(){return this.adjustHue(180)}saturate(t){return this.adjustSaturation(t)}desaturate(t){return this.adjustSaturation(-t)}grayscale(){return this.adjustSaturation(-100)}lighten(t){return this.adjustLightness(t)}darken(t){return this.adjustLightness(-t)}opacify(t){return this.adjustAlpha(t)}transparentize(t){return this.adjustAlpha(-t)}fadeIn(t){return this.adjustAlpha(t)}fadeOut(t){return this.adjustAlpha(-t)}adjust(t){let e=this;for(const[r,n]of Object.entries(t))e=e["adjust"+r[0].toUpperCase()+r.slice(1)](n);return e}scale(t){let e=this;for(const[r,n]of Object.entries(t))e=e["adjust"+r[0].toUpperCase()+r.slice(1)](void 0,n);return e}change(t){let e=this.rgba,r=this.hsla;for(const[n,a]of Object.entries(t))switch(n){case"red":e[0]=a,r=T(e);break;case"green":e[1]=a,r=T(e);break;case"blue":e[2]=a,r=T(e);break;case"hue":r[0]=a,e=X(r);break;case"saturation":r[1]=a,e=X(r);break;case"lightness":r[2]=a,e=X(r);break;case"alpha":e[3]=a,r[3]=a}return new V(G(e),e,r)}lightenSet(t){return[this].concat(e.range(1,t).map((e=>this.adjustLightness(void 0,100/t*e))))}darkenSet(t){return[this].concat(e.range(1,t).map((e=>this.adjustLightness(void 0,-100/t*e))))}desaturateSet(t){return[this].concat(e.range(1,t).map((e=>this.adjustSaturation(void 0,-100/t*e))))}complementSet(t){const r=this.complement();return e.range(0,t).reverse().map((e=>e===t-1?this:0===e?r:V.subcolormix(this,r,100/(t-1)*e)))}invertSet(t){const r=this.invert();return e.range(0,t).reverse().map((e=>e===t-1?this:0===e?r:V.subcolormix(this,r,100/(t-1)*e)))}}function q(t){const e=t.rgb.map((t=>t/255)).map((t=>t<.03928?t/12.92:((t+.055)/1.055)**2));return k(.2126*e[0]+.7152*e[1]+.0722*e[2])}let F;function Q(t="css",e="css",r=[],n=[]){F={uid:t,type:e,props:r,variants:n}}function K(){return F}function tt(t){return F.props.push(t)}Q();const et=(t,r,o)=>{if(null!=o)for(const[n,a]of Object.entries(o))"function"==typeof a&&(o[n]=(...t)=>(tt(e.parenWrap(n,t.toString())),a(...t)));return{[i]:!0,[n]:t,[a]:r,[s]:o}},rt=(t,e,r)=>{if("css"===e)return Reflect.get(t,n,r);if("meta"===e)return Reflect.get(t,a,r);const i=Reflect.get(t,s,r);return i&&e in i?i[e]:Reflect.get(t,e,r)};let nt=(t,e,r)=>new Proxy(et(t,e,r),{get:rt});function at(t,e,r){return nt(t,null!=r?r:K(),e)}const st=[];function it(t){const e=document.getElementById("windijs");if(e)e.textContent+="\n"+t;else{const e=document.createElement("style");e.id="windijs",e.setAttribute("type","text/css"),e.textContent=t,document.head.appendChild(e)}}function ot(t){return(e,r,n)=>{const a=et(e,r,n),s=v(a);return new Proxy({[s]:!0,...a},{get:(e,r,n)=>"toString"===r?()=>(t(s,a),Object.keys(e).join(" ")):r===s?(t(s,a),Reflect.get(e,r,n)):rt(e,r,n)})}}const ut=ot(((t,e)=>{st.includes(t)||(st.push(t),it(O(t,e)))})),lt=[],ct=[],ht=ot(((t,e)=>{lt.includes(t)||(lt.push(t),ct.push(O(t,e)))}));function pt(t,...e){return at(f(e),void 0,{uid:"apply",type:"css",props:[t],variants:[],selector:t})}function ft(t){return new Proxy(t,{get:(t,e)=>Reflect.apply(t,void 0,[e]),apply:(t,e,r)=>Reflect.apply(t,e,r)})}let gt=[];function dt(t){for(let e=gt.length-1;e>=0;e--)if(gt[e].selector===t)return gt[e].children}function yt(t,...e){const r=pt(t,...e);return gt.push({selector:t,children:e.flat().filter((t=>null!=t)),style:r}),r}function bt(t){return new Proxy(yt,{get(e,r){var n;return"ATTR"===r?jt(t):"styles"===r?null!==(n=dt(t))&&void 0!==n?n:[]:("$"===r?t+=", ":"$$"===r?t+=" > ":"_"===r?t+=" ":"__"===r?t+=" + ":"_$_"===r?t+=" ~ ":r.charCodeAt(0)<91?t+=r.toLowerCase():t+="."+r,bt(t))},apply:(e,r,n)=>Reflect.apply(e,r,[t,...n])})}const mt={match:"=",hyphenMatch:"|=",contains:"~=",includes:"*=",startsWith:"^=",endsWith:"$="},jt=t=>ft((function(e){return new Proxy(yt,{get:(r,n)=>n in mt?ft((function(r){return bt(t+=`[${e}${mt[n]}${JSON.stringify(r)}]`)})):Reflect.get(bt(t),n),apply:(r,n,a)=>(t+=`[${e}]`,Reflect.apply(r,n,[t,...a]))})})),vt=new Proxy(yt,{get(t,e){if("call"===e)return(e,...r)=>Reflect.apply(t,e,r);if("init"===e)return()=>gt=[];if("exports"===e)return gt;if("styles"===e)return new Proxy(gt.map((t=>t.children)).flat(),{get:(t,e)=>Reflect.has(t,e)?Reflect.get(t,e):dt(e)});let r="";return"ID"===e?ft((function(t){return r+="#"+t,bt(r)})):"ATTR"===e?jt(r):("All"===e?r+="*":"Root"===e?r+=":root":"Host"===e?r+=":host":e.charCodeAt(0)<91?r+=e.toLowerCase():r+="."+e,bt(r))}});function St(t,e){return e?`var(--${t}, ${e})`:`var(--${t})`}function xt(t,r,n,a){return e.parenWrap("hwb",[t,r,n].join(" ")+(a?" / "+a:""))}function wt(t,r,n,a){return e.parenWrap("drop-shadow",[t,r,n,a].join(" "))}class At{constructor(t){this.values=[],this.values=t,this.round=(t,r,n,a)=>{return e.parenWrap("inset",this.values.filter((t=>null!=t)).join(" ")+" round "+(s=t,i=r,o=n,u=a,Array.isArray(s)||Array.isArray(i)?[s,i].map((t=>Array.isArray(t)?t.join(" "):t)).join(" / "):[s,i,o,u].filter((t=>null!=t)).join(" ")));var s,i,o,u}}toString(){return e.parenWrap("inset",this.values.filter((t=>null!=t)).join(" "))}}const{matrix:Ct,matrix3d:Mt,perspective:$t,rotate:Rt,rotate3d:Ot,rotateX:Pt,rotateY:kt,rotateZ:Lt,scale:Gt,scale3d:Wt,scaleX:Tt,scaleY:Ht,scaleZ:Xt,skew:Bt,skewX:Nt,skewY:Yt,translate:_t,translate3d:Dt,translateX:Jt,translateY:Zt,translateZ:It,steps:Et,calc:Ut,clamp:zt,max:Vt,min:qt,abs:Ft,sign:Qt,blur:Kt,brightness:te,contrast:ee,grayscale:re,invert:ne,opacity:ae,saturate:se,sepia:ie,rgb:oe,rgba:ue,hsl:le,hsla:ce,counter:he,env:pe,minmax:fe,repeat:ge}=new Proxy({},{get:(t,e)=>(...t)=>e+"("+t.filter((t=>null!=t)).join(", ")+")"}),{hueRotate:de,fitContent:ye,cubicBezier:be,linearGradient:me,radialGradient:je,conicGradient:ve,repeatingConicGradient:Se,repeatingLinearGradient:xe,repeatingRadialGradient:we}=new Proxy({},{get:(t,r)=>(...t)=>e.camelToDash(r)+"("+t.map((t=>Array.isArray(t)?t.join(" "):t)).filter((t=>null!=t)).join(", ")+")"}),Ae={blur:Kt,brightness:te,contrast:ee,dropShadow:wt,grayscale:re,hueRotate:de,invert:ne,saturate:se,sepia:ie},Ce={rotate:Rt,scale:Gt,skew:Bt,translate:_t},Me=new Proxy({},{get:(t,e)=>{const r={var:St,calc:Ut,rgb:oe,rgba:ue,hsl:le,hsla:ce,hwb:xt};return e in r?r[e]:e}});function $e(t,e=t){return new Proxy({},{get:(r,n)=>Object.create({value:+n,type:t,valueOf:()=>n+e,toString:()=>n+e})})}const Re=$e("percent","%"),{deg:Oe,grad:Pe,rad:ke,turn:Le}=new Proxy({},{get:(t,e)=>$e(e)}),{s:Ge,ms:We}=new Proxy({},{get:(t,e)=>$e(e)}),Te=$e("fr"),He=$e("in"),{dpi:Xe,dpcm:Be,dppx:Ne,x:Ye}=new Proxy({},{get:(t,e)=>$e(e)}),{px:_e,pc:De,pt:Je,cm:Ze,mm:Ie,Q:Ee,ch:Ue,ex:ze,em:Ve,rem:qe,vw:Fe,vh:Qe,vmax:Ke,vmin:tr}=new Proxy({},{get:(t,e)=>$e(e)});return t.$=vt,t.$in=He,t.$var=St,t.Color=V,t.Q=Ee,t.SymbolCSS=n,t.SymbolData=s,t.SymbolMeta=a,t.SymbolProxy=i,t.abs=Ft,t.add=function(t,e){return"object"==typeof t&&"object"==typeof e&&t.type===e.type?t.value+e.value+("percent"===t.type?"%":t.type):t+" + "+e},t.adjustAlpha=E,t.adjustBlue=I,t.adjustGreen=Z,t.adjustHue=Y,t.adjustLightness=D,t.adjustRed=J,t.adjustSaturation=_,t.alphaCount=m,t.alphaNamer=j,t.apply=pt,t.applyVariant=p,t.atomic=function(...t){const e=[];for(const r of t.flat().filter((t=>null!=t)))e.push(...x(p(r),"."+v(r)));return $(R(e))},t.atomicNamer=function(t){return g(c(t).join("."))},t.attr=function(t,r,n){const a=null!=n?", "+n:"";return e.parenWrap("attr",r?t+" "+r+a:t+a)},t.baseStyleHandler=rt,t.baseStyleTarget=et,t.blur=Kt,t.brightness=te,t.build=function(...t){const e=[];for(const r of t.flat().filter((t=>null!=t))){const t=r[a].selector;"string"==typeof t&&e.push(...x(p(r),t))}return $(R(e))},t.buildAtRule=C,t.buildDecl=w,t.buildRule=A,t.buildRules=$,t.buildStyle=O,t.bundle=f,t.calc=Ut,t.ch=Ue,t.circle=function(t,r){return e.parenWrap("circle",null==r?t.toString():t+" at "+(Array.isArray(r)?r.join(" "):r))},t.clamp=zt,t.cm=Ze,t.color=Me,t.colorLuminance=q,t.conicGradient=ve,t.contrast=ee,t.counter=he,t.counters=function(t,r,n){return e.parenWrap("counters",[t,JSON.stringify(r),n].filter((t=>null!=t)).join(", "))},t.createRules=x,t.createStyleLoader=ot,t.css=at,t.cssInJsLoader=ut,t.cubicBezier=be,t.dedupRules=R,t.defineConfig=function(t){return t},t.deg=Oe,t.digitToHEX=L,t.div=function(t,e){return"object"==typeof t&&"number"==typeof e?t.value/e+("percent"===t.type?"%":t.type):"number"==typeof t&&"number"==typeof e?t/e+"":t+" / "+e},t.dpcm=Be,t.dpi=Xe,t.dppx=Ne,t.dropShadow=wt,t.ellipse=function(t,r,n){const a=[t,r].join(" ");return e.parenWrap("ellipse",null==n?a:a+" at "+(Array.isArray(n)?n.join(" "):n))},t.em=Ve,t.env=pe,t.escapeCSS=g,t.ex=ze,t.filters=Ae,t.fitContent=ye,t.fr=Te,t.getDarkColor=function(t,e=29){return t.change({lightness:Math.max(e,Math.round(e+53*(.53-q(t))))})},t.getFirstVar=function(t){const r=t[n];for(const[n,a]of e.entries(r))if(n.startsWith("--w-"))return[n,a]},t.getLightColor=function(t,e=96){return t.change({lightness:t.lightness>96?t.lightness:e})},t.getMeta=K,t.getStyleIdent=h,t.getStyleProps=c,t.getStyleVariants=l,t.getUid=function(){return F.uid},t.grad=Pe,t.grayscale=re,t.hashNamer=function(t){return"w-"+e.hash(h(t))},t.hexToRGB=W,t.hsl=le,t.hslToRGB=X,t.hsla=ce,t.hueRotate=de,t.hueToRGB=H,t.hwb=xt,t.hwbToRGB=B,t.inherit="inherit",t.initial="initial",t.injectCSS=it,t.inline=function(t,...e){const r=o(t),n=[];for(const[a,s]of Object.entries(f(e)))"string"==typeof s&&(r?n.push(a+":"+s):t.style.setProperty(a,s));if(r)return n.join(";")},t.inset=function(t,e,r,n){return new At([t,e,r,n])},t.invert=ne,t.isProxy=function(t){return null!=t&&i in t},t.isStyleArray=u,t.isStyleObject=o,t.linearGradient=me,t.matrix=Ct,t.matrix3d=Mt,t.max=Vt,t.mergeObject=r,t.min=qt,t.minmax=fe,t.mixColor=U,t.mm=Ie,t.mountCSS=function(){return ct.join("\n")},t.ms=We,t.mul=function(t,e){return"number"==typeof t&&"object"==typeof e?t*e.value+("percent"===e.type?"%":e.type):"object"==typeof t&&"number"==typeof e?t.value*e+("percent"===t.type?"%":t.type):"number"==typeof t&&"number"==typeof e?t*e+"":t+" * "+e},t.nameStyle=v,t.none="none",t.opacity=ae,t.path=function(t,r){return e.parenWrap("path",r?r+", "+JSON.stringify(t):JSON.stringify(t))},t.pc=De,t.percent=Re,t.perspective=$t,t.polygon=function(t,...r){return e.parenWrap("polygon",[t,...r].filter((t=>null!=t)).map((t=>Array.isArray(t)?t.join(" "):t)).join(", "))},t.prec=k,t.prop=(t,...e)=>t.map(((t,r)=>t+(e[r]||""))).join(""),t.pt=Je,t.pushMetaProp=tt,t.px=_e,t.queryStyles=dt,t.quote=function(t){return`${JSON.stringify(t).replace(/\\\\/g,"\\")}`},t.rad=ke,t.radialGradient=je,t.rem=qe,t.repeat=ge,t.repeatingConicGradient=Se,t.repeatingLinearGradient=xe,t.repeatingRadialGradient=we,t.resetMeta=Q,t.resetStyleMeta=function(t,e=F){return t[a]=e,t},t.rgb=oe,t.rgbToHEX=G,t.rgbToHSL=T,t.rgba=ue,t.rotate=Rt,t.rotate3d=Ot,t.rotateX=Pt,t.rotateY=kt,t.rotateZ=Lt,t.s=Ge,t.saturate=se,t.scale=Gt,t.scale3d=Wt,t.scaleX=Tt,t.scaleY=Ht,t.scaleZ=Xt,t.sepia=ie,t.sign=Qt,t.skew=Bt,t.skewX=Nt,t.skewY=Yt,t.sliceColor=function(t){const e=t.slice(t.indexOf("(")+1,t.indexOf(")"));return-1!==e.indexOf(",")?e.split(/,\s*/):e.split(/\s+\/?\s*/)},t.ssrLoader=ht,t.steps=Et,t.sub=function(t,e){return"object"==typeof t&&"object"==typeof e&&t.type===e.type?t.value-e.value+("percent"===t.type?"%":t.type):t+" - "+e},t.subMixColor=z,t.transforms=Ce,t.translate=_t,t.translate3d=Dt,t.translateX=Jt,t.translateY=Zt,t.translateZ=It,t.turn=Le,t.unify=function(...t){if("string"==typeof t[0])return P(t[0],t.slice(1));const e=Object.assign({},...t);return Object.entries(e).map((([t,e])=>Array.isArray(e)?P(t,e):P(t,[e]))).join("\n\n")},t.unset="unset",t.updateMetaType=function(t){F.type=t},t.url=function(t,r=!1,n="image/png"){return e.parenWrap("url",r?`data:${n};base64,`+t:t)},t.useArrayHelper=function(){Array.prototype.toString=function(){return this.join(u(this)?" ":",")}},t.useNamer=function(t){d=t},t.useStyleLoader=function(t){nt=t},t.vh=Qe,t.vmax=Ke,t.vmin=tr,t.vw=Fe,t.x=Ye,Object.defineProperty(t,"__esModule",{value:!0}),t}({},windijsShared);