"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var R=require("../../@babel/runtime/helpers/esm/extends.js"),D=require("../../@babel/runtime/helpers/esm/assertThisInitialized.js"),G=require("../../@babel/runtime/helpers/esm/inheritsLoose.js"),N=require("../../@babel/runtime/helpers/esm/wrapNativeSuper.js"),Y={1:`Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).

`,2:`Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).

`,3:`Passed an incorrect argument to a color function, please pass a string representation of a color.

`,4:`Couldn't generate valid rgb string from %s, it returned %s.

`,5:`Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.

`,6:`Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).

`,7:`Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).

`,8:`Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.

`,9:`Please provide a number of steps to the modularScale helper.

`,10:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.

`,11:`Invalid value passed as base to modularScale, expected number or em string but got "%s"

`,12:`Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.

`,13:`Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.

`,14:`Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.

`,15:`Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.

`,16:`You must provide a template to this method.

`,17:`You passed an unsupported selector state to this method.

`,18:`minScreen and maxScreen must be provided as stringified numbers with the same units.

`,19:`fromSize and toSize must be provided as stringified numbers with the same units.

`,20:`expects either an array of objects or a single object with the properties prop, fromSize, and toSize.

`,21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:`fontFace expects a name of a font-family.

`,24:`fontFace expects either the path to the font file(s) or a name of a local copy.

`,25:`fontFace expects localFonts to be an array.

`,26:`fontFace expects fileFormats to be an array.

`,27:`radialGradient requries at least 2 color-stops to properly render.

`,28:`Please supply a filename to retinaImage() as the first argument.

`,29:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.

`,30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation

`,32:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])
To pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')

`,33:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation

`,34:`borderRadius expects a radius value as a string or number as the second argument.

`,35:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.

`,36:`Property must be a string value.

`,37:`Syntax Error at %s.

`,38:`Formula contains a function that needs parentheses at %s.

`,39:`Formula is missing closing parenthesis at %s.

`,40:`Formula has too many closing parentheses at %s.

`,41:`All values in a formula must have the same unit or be unitless.

`,42:`Please provide a number of steps to the modularScale helper.

`,43:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.

`,44:`Invalid value passed as base to modularScale, expected number or em/rem string but got %s.

`,45:`Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.

`,46:`Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.

`,47:`minScreen and maxScreen must be provided as stringified numbers with the same units.

`,48:`fromSize and toSize must be provided as stringified numbers with the same units.

`,49:`Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.

`,50:`Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.

`,51:`Expects the first argument object to have the properties prop, fromSize, and toSize.

`,52:`fontFace expects either the path to the font file(s) or a name of a local copy.

`,53:`fontFace expects localFonts to be an array.

`,54:`fontFace expects fileFormats to be an array.

`,55:`fontFace expects a name of a font-family.

`,56:`linearGradient requries at least 2 color-stops to properly render.

`,57:`radialGradient requries at least 2 color-stops to properly render.

`,58:`Please supply a filename to retinaImage() as the first argument.

`,59:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.

`,60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:`Property must be a string value.

`,62:`borderRadius expects a radius value as a string or number as the second argument.

`,63:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.

`,64:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.

`,65:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').

`,66:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.

`,67:`You must provide a template to this method.

`,68:`You passed an unsupported selector state to this method.

`,69:`Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.

`,70:`Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.

`,71:`Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.

`,72:`Passed invalid base value %s to %s(), please pass a value like "12px" or 12.

`,73:`Please provide a valid CSS variable.

`,74:`CSS variable not found and no default was provided.

`,75:`important requires a valid style object, got a %s instead.

`,76:`fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.

`,77:`remToPx expects a value in "rem" but you provided it in "%s".

`,78:`base must be set in "px" or "%" but you set it in "%s".
`};function L(){for(var a=arguments.length,e=new Array(a),n=0;n<a;n++)e[n]=arguments[n];var s=e[0],r=[],t;for(t=1;t<e.length;t+=1)r.push(e[t]);return r.forEach(function(i){s=s.replace(/%[a-z]/,i)}),s}var d=function(a){G.default(e,a);function e(n){var s;if(process.env.NODE_ENV==="production")s=a.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+n+" for more information.")||this;else{for(var r=arguments.length,t=new Array(r>1?r-1:0),i=1;i<r;i++)t[i-1]=arguments[i];s=a.call(this,L.apply(void 0,[Y[n]].concat(t)))||this}return D.default(s)}return e}(N.default(Error)),O=/--[\S]*/g;function B(a,e){if(!a||!a.match(O))throw new d(73);var n;return typeof document<"u"&&document.documentElement!==null&&(n=getComputedStyle(document.documentElement).getPropertyValue(a)),n?n.trim():e}function v(a){return Math.round(a*255)}function J(a,e,n){return v(a)+","+v(e)+","+v(n)}function b(a,e,n,s){if(s===void 0&&(s=J),e===0)return s(n,n,n);var r=(a%360+360)%360/60,t=(1-Math.abs(2*n-1))*e,i=t*(1-Math.abs(r%2-1)),o=0,f=0,l=0;r>=0&&r<1?(o=t,f=i):r>=1&&r<2?(o=i,f=t):r>=2&&r<3?(f=t,l=i):r>=3&&r<4?(f=i,l=t):r>=4&&r<5?(o=i,l=t):r>=5&&r<6&&(o=t,l=i);var h=n-t/2,m=o+h,u=f+h,c=l+h;return s(m,u,c)}var T={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};function K(a){if(typeof a!="string")return a;var e=a.toLowerCase();return T[e]?"#"+T[e]:a}var Q=/^#[a-fA-F0-9]{6}$/,U=/^#[a-fA-F0-9]{8}$/,W=/^#[a-fA-F0-9]{3}$/,X=/^#[a-fA-F0-9]{4}$/,y=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,Z=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,V=/^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,_=/^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;function S(a){if(typeof a!="string")throw new d(3);var e=K(a);if(e.match(Q))return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16)};if(e.match(U)){var n=parseFloat((parseInt(""+e[7]+e[8],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16),alpha:n}}if(e.match(W))return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16)};if(e.match(X)){var s=parseFloat((parseInt(""+e[4]+e[4],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16),alpha:s}}var r=y.exec(e);if(r)return{red:parseInt(""+r[1],10),green:parseInt(""+r[2],10),blue:parseInt(""+r[3],10)};var t=Z.exec(e);if(t)return{red:parseInt(""+t[1],10),green:parseInt(""+t[2],10),blue:parseInt(""+t[3],10),alpha:parseFloat(""+t[4])};var i=V.exec(e);if(i){var o=parseInt(""+i[1],10),f=parseInt(""+i[2],10)/100,l=parseInt(""+i[3],10)/100,h="rgb("+b(o,f,l)+")",m=y.exec(h);if(!m)throw new d(4,e,h);return{red:parseInt(""+m[1],10),green:parseInt(""+m[2],10),blue:parseInt(""+m[3],10)}}var u=_.exec(e);if(u){var c=parseInt(""+u[1],10),M=parseInt(""+u[2],10)/100,$=parseInt(""+u[3],10)/100,F="rgb("+b(c,M,$)+")",g=y.exec(F);if(!g)throw new d(4,e,F);return{red:parseInt(""+g[1],10),green:parseInt(""+g[2],10),blue:parseInt(""+g[3],10),alpha:parseFloat(""+u[4])}}throw new d(5)}function ee(a){var e=a.red/255,n=a.green/255,s=a.blue/255,r=Math.max(e,n,s),t=Math.min(e,n,s),i=(r+t)/2;if(r===t)return a.alpha!==void 0?{hue:0,saturation:0,lightness:i,alpha:a.alpha}:{hue:0,saturation:0,lightness:i};var o,f=r-t,l=i>.5?f/(2-r-t):f/(r+t);switch(r){case e:o=(n-s)/f+(n<s?6:0);break;case n:o=(s-e)/f+2;break;default:o=(e-n)/f+4;break}return o*=60,a.alpha!==void 0?{hue:o,saturation:l,lightness:i,alpha:a.alpha}:{hue:o,saturation:l,lightness:i}}function k(a){return ee(S(a))}var w=function(e){return e.length===7&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function p(a){var e=a.toString(16);return e.length===1?"0"+e:e}function x(a){return p(Math.round(a*255))}function ae(a,e,n){return w("#"+x(a)+x(e)+x(n))}function j(a,e,n){return b(a,e,n,ae)}function z(a,e,n){if(typeof a=="object"&&e===void 0&&n===void 0)return j(a.hue,a.saturation,a.lightness);throw new d(1)}function C(a,e,n,s){if(typeof a=="object"&&e===void 0&&n===void 0&&s===void 0)return a.alpha>=1?j(a.hue,a.saturation,a.lightness):"rgba("+b(a.hue,a.saturation,a.lightness)+","+a.alpha+")";throw new d(2)}function I(a,e,n){if(typeof a=="number"&&typeof e=="number"&&typeof n=="number")return w("#"+p(a)+p(e)+p(n));if(typeof a=="object"&&e===void 0&&n===void 0)return w("#"+p(a.red)+p(a.green)+p(a.blue));throw new d(6)}function H(a,e,n,s){if(typeof a=="string"&&typeof e=="number"){var r=S(a);return"rgba("+r.red+","+r.green+","+r.blue+","+e+")"}else if(typeof a=="object"&&e===void 0&&n===void 0&&s===void 0)return a.alpha>=1?I(a.red,a.green,a.blue):"rgba("+a.red+","+a.green+","+a.blue+","+a.alpha+")";throw new d(7)}var ne=function(e){return typeof e.red=="number"&&typeof e.green=="number"&&typeof e.blue=="number"&&(typeof e.alpha!="number"||typeof e.alpha>"u")},re=function(e){return typeof e.red=="number"&&typeof e.green=="number"&&typeof e.blue=="number"&&typeof e.alpha=="number"},te=function(e){return typeof e.hue=="number"&&typeof e.saturation=="number"&&typeof e.lightness=="number"&&(typeof e.alpha!="number"||typeof e.alpha>"u")},se=function(e){return typeof e.hue=="number"&&typeof e.saturation=="number"&&typeof e.lightness=="number"&&typeof e.alpha=="number"};function P(a){if(typeof a!="object")throw new d(8);if(re(a))return H(a);if(ne(a))return I(a);if(se(a))return C(a);if(te(a))return z(a);throw new d(8)}function q(a,e,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=e?a.apply(this,r):q(a,e,r)}}function E(a){return q(a,a.length,[])}function A(a,e,n){return Math.max(a,Math.min(e,n))}function ie(a,e){if(e==="transparent")return e;var n=k(e);return P(R.default({},n,{lightness:A(0,1,n.lightness-parseFloat(a))}))}var oe=E(ie);function fe(a,e){if(e==="transparent")return e;var n=k(e);return P(R.default({},n,{lightness:A(0,1,n.lightness+parseFloat(a))}))}var de=E(fe);exports.cssVar=B;exports.darken=oe;exports.hsl=z;exports.hsla=C;exports.lighten=de;exports.parseToHsl=k;exports.parseToRgb=S;exports.rgb=I;exports.rgba=H;exports.toColorString=P;
