"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),n=require("@babel/runtime/helpers/objectWithoutProperties"),a=require("react"),r=require("clsx"),i=require("@prom-ui/core/useIsMounted"),u=require("@prom-ui/icons/StarFill");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var l=c(e),s=c(t),d=c(n),f=o(a),p=c(r),b="V-LdE",m="sgjOY",v="FTT2B",y="DxUIq",g="LD2kV",_=["value","name","onChange","onHover","size","disabled"],q=[1,2,3,4,5],h=function(e){var t=e.value,n=e.name,a=e.onChange,r=e.onHover,c=e.size,o=void 0===c?18:c,h=e.disabled,j=d.default(e,_),E=i.useIsMounted(),O=f.useId(),S=f.useState(t),k=s.default(S,2),M=k[0],N=k[1],P=f.useState(!0),x=s.default(P,2),z=x[0],C=x[1],D=n||O;f.useEffect((function(){E&&"function"==typeof a&&a(M)}),[M]),f.useEffect((function(){t!==M&&N(t)}),[t]);return f.createElement("div",{className:p.default(b,l.default({},g,z)),style:{fontSize:o},onMouseLeave:function(){"function"==typeof r&&r(void 0)},"data-qaid":j["data-qaid"]||"rating_select","data-testid":j["data-testid"]||"rating_select"},q.map((function(e){var t="".concat(D,"-").concat(e);return f.createElement("input",{key:e,id:t,className:y,type:"radio",name:D,value:e,checked:M===e,onChange:function(){return function(e){C(!1),N(e)}(e)},disabled:h,"data-qaid":"rating_select_input_".concat(e),"data-testid":"rating_select_input_".concat(e)})})),q.map((function(e){var t="".concat(D,"-").concat(e);return f.createElement("label",{key:e,className:m,htmlFor:t,onClick:function(t){return function(e,t){C(!1),h||M!==e||(null==t||t.preventDefault(),N(void 0))}(e,t)},onMouseEnter:function(){return function(e){z||C(!0),"function"==typeof r&&r(e)}(e)},"data-qaid":"rating_select_label_".concat(e),"data-testid":"rating_select_label_".concat(e)},f.createElement(u.SvgStarFill,{className:v,focusable:!1,"aria-hidden":!0}))})))};h.displayName="RatingSelect",exports.RatingSelect=h,require("./style.production.v2.css");
