1"use strict";(self.webpackChunk_metafox_react=self.webpackChunk_metafox_react||[]).push([["metafox-form-elements-VideoUrlField-VideoUrlField"],{60455:function(e,t,l){l.d(t,{A:function(){return c}});var r=l(62809),n=l(24735),a=l(22989),i=l(62958),o=l.n(i),u=l(354),d=l.n(u),s=l(30758),m=l(25979);function c({text:e,sx:t,error:l=!1,component:i="span"}){let{i18n:u}=(0,r.PCX)();if(!e)return null;if(d()(e)&&e.startsWith("<html>"))return s.createElement(n.A,{sx:t,error:l},u.formatMessage({id:"[placeholder]",defaultMessage:e}));let c=o()(e)?e[0]:e;return s.createElement(n.A,{sx:t,error:l},s.createElement(a.A,{component:i,sx:{whiteSpace:"normal",wordBreak:"break-word",mb:.5}},s.createElement(m.Ay,{html:c})))}},4611:function(e,t,l){l.d(t,{A:function(){return a}});var r=l(62809),n=l(30758);function a({text:e}){let{i18n:t}=(0,r.PCX)();return e?e.startsWith("<html>")?n.createElement(n.Fragment,null,t.formatMessage({id:"[placeholder]",defaultMessage:e})):n.createElement(n.Fragment,null,e):null}},93568:function(e,t,l){l.r(t);var r=l(62809),n=l(69470),a=l(22989),i=l(24476),o=l(83059),u=l(81141),d=l.n(u),s=l(90424),m=l.n(s),c=l(53282),f=l.n(c),p=l(30758),h=l(60455),b=l(4611),v=l(95129),E=l(21275);let g="VideoEmbedView",x=(0,i.Ay)("div",{name:g,slot:"playerWrapper"})(({theme:e})=>({})),A=(0,i.Ay)("div",{name:g,slot:"title"})(({theme:e})=>({borderBottomLeftRadius:e.shape.borderRadius,borderBottomRightRadius:e.shape.borderRadius,border:e.mixins.border("secondary"),borderTop:"none",padding:e.spacing(2),display:"flex",flexDirection:"column"})),k=(0,i.Ay)(n.A,{name:"Text"})(({theme:e})=>({"& input::placeholder":{color:e.palette.text.hint}}));t.default=({config:e,disabled:t,name:l,formik:n})=>{let[i,u,{setValue:s,setTouched:c}]=(0,o.Mt)(null!=l?l:"VideoUrlField"),{apiClient:g,compactData:y}=(0,r.PCX)(),{label:_,hint:w,autoComplete:C,placeholder:F,noFeedback:M,variant:S,disabled:V,margin:R,fullWidth:P,type:W="text",rows:B,size:T,required:U,description:X,autoFocus:$,readOnly:j,maxLength:q,fetchEndpoint:D,autoFillValueFromLink:I={title:":title",text:":description"},showEmbed:L=!1}=e,N=p.useRef(""),[O,z]=p.useState(!1),[G,H]=p.useState(""),[J,K]=p.useState({}),Q=p.useMemo(()=>m()(()=>{""===N.current||u.error||O||(z(!0),n.setSubmitting(!0),g.request({url:D||"/link/fetch",method:"post",data:{link:N.current}}).then(e=>{var t;let l=null==(t=e.data)?void 0:t.data;if(H(""),L&&K(l),!f()(I)){let e=y(I,l);Object.keys(e).forEach(t=>n.setFieldValue(t,e[t]))}}).catch(e=>{var t,l,r,n,a,i,o;H((null==(r=e.response)||null==(l=r.data)||null==(t=l.error)?void 0:t.message)||(null==(a=e.response)||null==(n=a.data)?void 0:n.message)||(null==(o=e.response)||null==(i=o.data)?void 0:i.error)||e.message)}).finally(()=>{(null==u?void 0:u.touched)||c(!0),n.setSubmitting(!1),z(!1)}))},1e3),[g,y,O,z,u.error]);if(p.useEffect(()=>{""===i.value||u.error||Q()},[null==u?void 0:u.error,i.value]),!i.value){var Y;i.value=null!=(Y=e.defaultValue)?Y:""}let Z=G||u.error,ee=!!(Z&&(u.touched||n.submitCount)),et=(0,p.createElement)(k,{...i,disabled:V||t||n.isSubmitting||O,required:U,label:p.createElement(b.A,{hint:w,text:_}),autoFocus:$,variant:S,size:T,"data-testid":d()(`field ${l}`),inputProps:{"data-testid":d()(`input ${l}`),maxLength:q,autoComplete:C,readOnly:j},rows:B,placeholder:F,onChange:e=>{s(e.target.value),N.current=e.target.value},margin:R,error:ee,fullWidth:P,type:W,helperText:M?null:ee?Z:X?p.createElement(h.A,{text:X,hint:w}):null});return p.createElement(p.Fragment,null,et,!f()(J)&&L&&p.createElement(a.A,{mt:2},p.createElement(x,null,p.createElement(v.A,{src:null==J?void 0:J.link,thumb_url:null==J?void 0:J.image,autoplayIntersection:!0,embed_code:null==J?void 0:J.embed_code,...J})),p.createElement(A,{"data-testid":"embedview"},p.createElement(a.A,{mb:1,fontWeight:600},p.createElement(r.N_E,{to:null==J?void 0:J.link,asModal:!0},p.createElement(E.mE,{variant:"h4",lines:1},J.title))),p.createElement(a.A,{mb:1},p.createElement(E.mE,{variant:"body1",lines:2},J.description)))))}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.