"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="_8RSGF",m="FF3m3",v="_1Zpyt",_="_25gdX",y="DscdS",g=["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,S=d.default(e,g),j=i.useIsMounted(),E=f.useId(),O=f.useState(t),F=s.default(O,2),k=F[0],M=F[1],N=f.useState(!0),P=s.default(N,2),z=P[0],C=P[1],x=n||E;f.useEffect((function(){j&&"function"==typeof a&&a(k)}),[k]),f.useEffect((function(){t!==k&&M(t)}),[t]);return f.createElement("div",{className:p.default(b,l.default({},y,z)),style:{fontSize:o},onMouseLeave:function(){"function"==typeof r&&r(void 0)},"data-qaid":S["data-qaid"]||"rating_select","data-testid":S["data-testid"]||"rating_select"},q.map((function(e){var t="".concat(x,"-").concat(e);return f.createElement("input",{key:e,id:t,className:_,type:"radio",name:x,value:e,checked:k===e,onChange:function(){return function(e){C(!1),M(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(x,"-").concat(e);return f.createElement("label",{key:e,className:m,htmlFor:t,onClick:function(t){return function(e,t){C(!1),h||k!==e||(null==t||t.preventDefault(),M(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.css");
