"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[3011],{443011:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_});var a=n(296540),r=n(469733),i=n(951272),c=n(170121),d=n(217439),s=n(459449),l=n(126457),o=n(566723),m=n(417378),A=n(874734),E=n(778851);const u={[A.OH.PRD]:"6Ld47OUpAAAAALQ4AgR1gfk-hnSw27y3zIMKLOSw",[A.OH.STG]:"6LeKc-UpAAAAAN6YqRab29cPCbU-cfe7_EvchSvc",[A.OH.DEV]:"6LeocOUpAAAAANmIju4N9DzlkK4UNYdYThrUkK3y"},p=e=>{const[t,n]=(0,a.useState)(),i=(0,a.useRef)(),c=(0,r.useSelector)(m.S$),d=(0,E.GO)(c);return(0,a.useEffect)(()=>{const t=()=>{const{grecaptcha:a}=window;a.enterprise.ready(()=>n(()=>()=>a.enterprise.execute(u[d],{action:e}))),i.current?.removeEventListener("load",t)};return"grecaptcha"in window?t():(i.current=document.createElement("script"),i.current.src=(e=>`https://www.google.com/recaptcha/enterprise.js?render=${u[e]}`)(d),i.current.addEventListener("load",t),document.body.appendChild(i.current),(()=>{const e="hide-grecaptcha-badge";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.innerText=".grecaptcha-badge { visibility: hidden; }",document.head.appendChild(t)})()),()=>{i.current?.removeEventListener("load",t)}},[]),t};var h=n(870443),C=n(388151),b=n(705426),O=n(294303);const f={feedback:""},S=h.A.object().shape({feedback:h.A.string().min(1).max(4096).required().label("COMMON_FEEDBACK")}),_=({onSubmit:e})=>{const t=(0,r.useDispatch)(),{formatMessage:n}=(0,s.tz)(),[m,A]=(0,a.useState)(!1),E=()=>t((0,l.AS)()),u=p("firmware_downgrade_feedback");return a.createElement(i.l1,{initialValues:f,validationSchema:S,onSubmit:async({feedback:t})=>{if(!m&&u){A(!0);try{const n=await u();e(t,n)}catch(e){0}finally{A(!1),E()}}}},({handleSubmit:e,dirty:t,isValid:r,isSubmitting:i})=>a.createElement(b.A,{actions:[{text:a.createElement(s.sA,{id:"COMMON_ACTION_SKIP"}),type:"button",onClick:E},{text:a.createElement(s.sA,{id:"COMMON_ACTION_CONTINUE"}),type:"button",variant:"primary",disabled:m||!t||!r||i,onClick:e}],title:a.createElement(c.A,{variant:"medium"},a.createElement(s.sA,{id:"DEVICE_ACTIONS_DOWNGRADE_FEEDBACK_TITLE"})),size:"small",onRequestClose:E,allowOverflow:!0},a.createElement(O.A,{gap:o.Ln,flexDirection:"column"},a.createElement(d.A,{variant:"body-primary"},a.createElement(s.sA,{id:"DEVICE_ACTIONS_DOWNGRADE_FEEDBACK_MESSAGE"})),a.createElement(C.A,{name:"feedback",type:"textarea",size:"body",placeholder:n({id:"DEVICE_ACTIONS_DOWNGRADE_FEEDBACK_PLACEHOLDER"}),minHeight:"76px",maxHeight:"200px",maxWidth:"360px",minWidth:"360px",resize:!0}))))}}}]);