"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[9137],{979137:(e,t,a)=>{a.r(t),a.d(t,{default:()=>b});var i=a(296540),l=a(469733),n=a(951272),r=a(927099),s=a(71479),A=a(459449),E=a(126457),c=a(870443),C=a(566723),o=a(388151),m=a(705426);const _=(0,s.A)("div")`
  line-height: 1.5;
  word-break: break-word;
  margin-bottom: ${C.S2};
`,u=(0,s.A)(r.A)`
  color: ${({theme:{motifPalette:{text01:e}}})=>e} !important;
  padding-right: ${({theme:{spacing:e}})=>e["spacing-xl"]};
`,d={url:""},O=c.A.object().shape({url:c.A.string().label("DEVICE_ACTIONS_CUSTOM_UPGRADE_LABEL").matches(/^(ftp|https?):\/\/.+\/[^\/]+\.(bin|tar)$/,{message:i.createElement(A.sA,{id:"COMMON_VALIDATION_VALID_URL"})}).required()}),b=({onCancel:e,onConfirm:t})=>{const a=(0,l.useDispatch)(),s=(0,i.useCallback)(e=>{t(e.url)},[t]),c=(0,i.useCallback)(()=>{e?e():a((0,E.AS)())},[e]);return i.createElement(n.l1,{initialValues:d,validationSchema:O,onSubmit:s},({handleSubmit:e,dirty:t,isValid:a,isSubmitting:l})=>i.createElement(m.A,{actions:[{text:i.createElement(A.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",onClick:c},{text:i.createElement(A.sA,{id:"COMMON_ACTION_UPDATE"}),type:"button",variant:"primary",disabled:!t||(!a||l),onClick:e}],title:i.createElement(u,{size:"body",weight:"bold",truncate:!0},i.createElement(A.sA,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_CONFIRM_TITLE"})),size:"small",onRequestClose:c},i.createElement(_,null,i.createElement(r.A,{size:"body"},i.createElement(A.sA,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_CONFIRM_MESSAGE"}))),i.createElement(o.A,{name:"url",label:"DEVICE_ACTIONS_CUSTOM_UPGRADE_LABEL",variant:"secondary"}),i.createElement(r.A,{color:"tertiary",size:"caption"},i.createElement(A.sA,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_PLACEHOLDER"}))))}}}]);